From f4f8d16d37d86c9ac8f612050c2f84468e72dd5f Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Tue, 13 Feb 2024 17:23:36 -0800 Subject: [PATCH 001/137] Bugfix: hashmap int overflow (#421) Fixes #409 and #249. --------- Co-authored-by: David Gardner --- CHANGELOG.md | 4 ++++ 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 ++++ src/sundials/sundials_hashmap.h | 9 +++++---- 8 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07991d8942..ee6a7bb502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,6 +157,10 @@ sundials_band.h Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +[#409](https://github.com/LLNL/sundials/issues/409) and +[#249](https://github.com/LLNL/sundials/issues/249) + ## Changes to SUNDIALS in release 6.7.0 Added the `SUNAdaptController` base class, ported ARKODE's internal diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index f4e7dc788c..964fa6acc9 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -313,6 +313,10 @@ rely on these are recommended to transition to the corresponding :c:type:`SUNMat Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v5.7.0 ----------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 34cb8b14fa..92b97c8e8c 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -283,6 +283,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v6.7.0 ----------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 8ddbe732f5..8f846a2625 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -283,6 +283,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v6.7.0 ----------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index a9ac1ad26c..0792c82bcb 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -244,6 +244,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v6.7.0 ----------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 49a782fa6e..aa3b28d7b7 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -258,6 +258,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v5.7.0 ----------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 5b26e0e2b4..d010166e85 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -239,6 +239,10 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: Fixed `GitHub Issue #329 `_ so that C++20 aggregate initialization can be used. +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 `_ and +`#249 `_. + Changes in v6.7.0 ----------------- diff --git a/src/sundials/sundials_hashmap.h b/src/sundials/sundials_hashmap.h index d8743ebe73..3da8ae6e02 100644 --- a/src/sundials/sundials_hashmap.h +++ b/src/sundials/sundials_hashmap.h @@ -20,14 +20,15 @@ #ifndef _SUNDIALS_HASHMAP_H #define _SUNDIALS_HASHMAP_H +#include #include #include #include "sundials/sundials_errors.h" #include "sundials/sundials_types.h" -static const unsigned long HASH_PRIME = 14695981039346656037U; -static const unsigned long HASH_OFFSET_BASIS = 1099511628211U; +static const uint64_t HASH_PRIME = 14695981039346656037U; +static const uint64_t HASH_OFFSET_BASIS = 1099511628211U; /* For a nice discussion on popular hashing algorithms see: @@ -36,9 +37,9 @@ static const unsigned long HASH_OFFSET_BASIS = 1099511628211U; This is a 64-bit implementation of the 'a' modification of the Fowler–Noll–Vo hash (i.e., FNV1-a). */ -static unsigned long fnv1a_hash(const char* str) +static uint64_t fnv1a_hash(const char* str) { - unsigned long hash = HASH_OFFSET_BASIS; + uint64_t hash = HASH_OFFSET_BASIS; char c; while ((c = *str++)) { hash = (hash ^ c) * HASH_PRIME; } return hash; From 84747f92e1db712a47192509c7ce6858b2fed591 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" Date: Wed, 21 Feb 2024 12:13:42 -0600 Subject: [PATCH 002/137] F2003 examples (#420) This PR replaces #302, since it proved way too difficult to merge changes from `develop` directly into that branch, so I just propagated the new/changed files from #302 into a new branch off of `develop`. --------- Co-authored-by: Cody Balos --- CHANGELOG.md | 5 + doc/arkode/guide/source/Introduction.rst | 6 + doc/cvode/guide/source/Introduction.rst | 6 + doc/cvodes/guide/source/Introduction.rst | 6 + doc/ida/guide/source/Introduction.rst | 6 + doc/idas/guide/source/Introduction.rst | 6 + doc/kinsol/guide/source/Introduction.rst | 6 + examples/arkode/C_openmp/CMakeLists.txt | 5 +- examples/arkode/F2003_custom/CMakeLists.txt | 3 - examples/arkode/F2003_custom/README | 38 - .../F2003_custom/ark_brusselator1D_f2003.f90 | 2 +- examples/arkode/F2003_parallel/CMakeLists.txt | 24 +- examples/arkode/F2003_parallel/README | 46 - ...ark_brusselator1D_task_local_nls_f2003.f90 | 72 +- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 517 ++++++ .../F2003_parallel/ark_diag_kry_bbd_f2003.out | 82 + .../F2003_parallel/ark_diag_non_f2003.f90 | 317 ++++ .../F2003_parallel/ark_diag_non_f2003.out | 29 + .../F2003_parallel/ark_heat2D_f2003.f90 | 961 +++++++++++ .../F2003_parallel/ark_heat2D_f2003.out | 46 + examples/arkode/F2003_serial/CMakeLists.txt | 112 +- examples/arkode/F2003_serial/README | 20 - .../F2003_serial/ark_analytic_f2003.f90 | 38 +- .../ark_bruss1D_FEM_klu_f2003.f90 | 1439 +++++++++++++++++ .../ark_bruss1D_FEM_klu_f2003.out | 73 + .../arkode/F2003_serial/ark_bruss_f2003.f90 | 526 ++++++ .../arkode/F2003_serial/ark_bruss_f2003.out | 33 + .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 541 +++++++ .../F2003_serial/ark_diurnal_kry_bp_f2003.out | 50 + .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 229 +-- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 654 ++++++++ .../F2003_serial/ark_roberts_dnsL_f2003.out | 49 + .../F2003_serial/ark_roberts_dns_f2003.f90 | 657 ++++++++ .../F2003_serial/ark_roberts_dns_f2003.out | 49 + examples/cvode/CMakeLists.txt | 1 + examples/cvode/F2003_parallel/CMakeLists.txt | 150 ++ .../F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 512 ++++++ .../F2003_parallel/cv_diag_kry_bbd_f2003.out | 80 + .../F2003_parallel/cv_diag_kry_f2003.f90 | 507 ++++++ .../F2003_parallel/cv_diag_kry_f2003.out | 76 + .../F2003_parallel/cv_diag_non_p_f2003.f90 | 329 ++++ .../F2003_parallel/cv_diag_non_p_f2003.out | 30 + examples/cvode/F2003_serial/CMakeLists.txt | 60 +- examples/cvode/F2003_serial/README | 40 - .../F2003_serial/cv_advdiff_bnd_f2003.f90 | 446 +++++ .../F2003_serial/cv_advdiff_bnd_f2003.out | 30 + .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 523 ++++++ .../F2003_serial/cv_diurnal_kry_bp_f2003.out | 48 + .../F2003_serial/cv_diurnal_kry_f2003.f90 | 749 +++++++++ .../F2003_serial/cv_diurnal_kry_f2003.out | 46 + .../F2003_serial/cv_roberts_dnsL_f2003.f90 | 533 ++++++ .../F2003_serial/cv_roberts_dnsL_f2003.out | 43 + .../cv_roberts_dns_constraints_f2003.f90 | 556 +++++++ .../cv_roberts_dns_constraints_f2003.out | 44 + .../F2003_serial/cv_roberts_dns_f2003.f90 | 531 ++++++ .../F2003_serial/cv_roberts_dns_f2003.out | 44 + .../F2003_serial/cv_roberts_klu_f2003.f90 | 586 +++++++ .../F2003_serial/cv_roberts_klu_f2003.out | 44 + examples/cvodes/F2003_serial/CMakeLists.txt | 3 - examples/cvodes/F2003_serial/README | 42 - examples/ida/CMakeLists.txt | 6 + examples/ida/F2003_openmp/CMakeLists.txt | 131 ++ .../F2003_openmp/idaHeat2D_kry_omp_f2003.f90 | 697 ++++++++ .../idaHeat2D_kry_omp_f2003_4.out | 57 + .../idaHeat2D_kry_omp_f2003_8.out | 57 + examples/ida/F2003_parallel/CMakeLists.txt | 149 ++ .../ida_heat2D_kry_bbd_f2003.f90 | 1045 ++++++++++++ .../ida_heat2D_kry_bbd_f2003_4.out | 68 + examples/ida/F2003_serial/CMakeLists.txt | 3 - examples/ida/F2003_serial/README | 37 - examples/idas/F2003_serial/CMakeLists.txt | 3 - examples/idas/F2003_serial/README | 37 - examples/kinsol/CMakeLists.txt | 1 + examples/kinsol/F2003_parallel/CMakeLists.txt | 148 ++ .../F2003_parallel/kin_diagon_kry_f2003.f90 | 564 +++++++ .../F2003_parallel/kin_diagon_kry_f2003_8.out | 48 + examples/kinsol/F2003_serial/CMakeLists.txt | 14 +- examples/kinsol/F2003_serial/README | 37 - .../F2003_serial/kinDiagon_kry_f2003.f90 | 484 ++++++ .../F2003_serial/kinDiagon_kry_f2003.out | 47 + .../templates/cmakelists_openmp_F2003_ex.in | 153 ++ .../templates/makefile_openmp_F2003_ex.in | 69 + test/answers | 2 +- 83 files changed, 16067 insertions(+), 496 deletions(-) delete mode 100644 examples/arkode/F2003_custom/README delete mode 100644 examples/arkode/F2003_parallel/README create mode 100644 examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 create mode 100644 examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out create mode 100644 examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 create mode 100644 examples/arkode/F2003_parallel/ark_diag_non_f2003.out create mode 100644 examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 create mode 100644 examples/arkode/F2003_parallel/ark_heat2D_f2003.out delete mode 100644 examples/arkode/F2003_serial/README create mode 100644 examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 create mode 100644 examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.out create mode 100644 examples/arkode/F2003_serial/ark_bruss_f2003.f90 create mode 100644 examples/arkode/F2003_serial/ark_bruss_f2003.out create mode 100644 examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 create mode 100644 examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out create mode 100644 examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 create mode 100644 examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.out create mode 100644 examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 create mode 100644 examples/arkode/F2003_serial/ark_roberts_dns_f2003.out create mode 100644 examples/cvode/F2003_parallel/CMakeLists.txt create mode 100644 examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 create mode 100644 examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.out create mode 100644 examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 create mode 100644 examples/cvode/F2003_parallel/cv_diag_kry_f2003.out create mode 100644 examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 create mode 100644 examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out delete mode 100644 examples/cvode/F2003_serial/README create mode 100644 examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_diurnal_kry_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_roberts_dns_f2003.out create mode 100644 examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 create mode 100644 examples/cvode/F2003_serial/cv_roberts_klu_f2003.out delete mode 100644 examples/cvodes/F2003_serial/README create mode 100644 examples/ida/F2003_openmp/CMakeLists.txt create mode 100644 examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 create mode 100644 examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out create mode 100644 examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out create mode 100644 examples/ida/F2003_parallel/CMakeLists.txt create mode 100644 examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 create mode 100644 examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003_4.out delete mode 100644 examples/ida/F2003_serial/README delete mode 100644 examples/idas/F2003_serial/README create mode 100644 examples/kinsol/F2003_parallel/CMakeLists.txt create mode 100644 examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 create mode 100644 examples/kinsol/F2003_parallel/kin_diagon_kry_f2003_8.out delete mode 100644 examples/kinsol/F2003_serial/README create mode 100644 examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 create mode 100644 examples/kinsol/F2003_serial/kinDiagon_kry_f2003.out create mode 100644 examples/templates/cmakelists_openmp_F2003_ex.in create mode 100644 examples/templates/makefile_openmp_F2003_ex.in diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6a7bb502..31ba6903fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # SUNDIALS Changelog +## Changes to SUNDIALS in release X.X.X + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + ## Changes to SUNDIALS in release 7.0.0-rc.1 ⚠️ This is a release candidate. diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 964fa6acc9..621855c4e2 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -130,6 +130,12 @@ provided with SUNDIALS, or again may utilize a user-supplied module. Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v6.0.0-rc.1 ---------------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 92b97c8e8c..5f01fb5398 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -111,6 +111,12 @@ implementations. Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v7.0.0-rc.1 ---------------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 8f846a2625..bde9ca1895 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -111,6 +111,12 @@ Fortran. Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v7.0.0-rc.1 ---------------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 0792c82bcb..39530a20dd 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -72,6 +72,12 @@ systems. Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v7.0.0-rc.1 ---------------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index aa3b28d7b7..082ddfc796 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -86,6 +86,12 @@ integrate any final-condition ODE dependent on the solution of the original IVP Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v6.0.0-rc.1 ---------------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index d010166e85..0ef7e5e9a7 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -88,6 +88,12 @@ applications written in Fortran. Changes from previous versions ============================== +Changes in vX.X.X +----------------- + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current +Fortran 2003 interface. + Changes in v7.0.0-rc.1 ---------------------- diff --git a/examples/arkode/C_openmp/CMakeLists.txt b/examples/arkode/C_openmp/CMakeLists.txt index fe7fd50ddf..1415e70ceb 100644 --- a/examples/arkode/C_openmp/CMakeLists.txt +++ b/examples/arkode/C_openmp/CMakeLists.txt @@ -14,8 +14,9 @@ # CMakeLists.txt file for ARKODE OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples +# "name\;args\;type\;float precision\;int precision" where the type +# is 'develop' for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 388f7fe63d..6393b31306 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -113,9 +113,6 @@ endforeach(example_tuple ${FARKODE_tests}) # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) - # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) diff --git a/examples/arkode/F2003_custom/README b/examples/arkode/F2003_custom/README deleted file mode 100644 index 0f94899288..0000000000 --- a/examples/arkode/F2003_custom/README +++ /dev/null @@ -1,38 +0,0 @@ -List of custom ARKODE F2003 examples - - ark_analytic_complex_f2003 - ark_brusselator1D_f2003 - -The ark_analytic_complex examples relies a custom module: - - fnvector_complex_mod -- Fortran-supplied N_Vector implementation - using complex numbers - -The ark_brusselator1D example relies on three custom modules: - - fnvector_fortran_mod -- Fortran-supplied N_Vector implementation - using 2D multidimensional data array. - fsunmatrix_fortran_mod -- Fortran-supplied SUNMatrix implementation - for a block-diagonal matrix structure - via 3D multidimensional data array. - fsunlinsol_fortran_mod -- Fortran-supplied SUNLinearSolver - implementation for direct linear solves - corresponding with above matrices/vectors. - -The test progams are used to test the custom module implementations. - -The following CMake command was used to configure SUNDIALS: - -cmake \ - -D CMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_DIR \ - -D EXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_DIR/examples\ - -D BUILD_SHARED_LIBS=ON \ - -D BUILD_STATIC_LIBS=ON \ - -D BUILD_ARKODE=ON \ - -D BUILD_TESTING=ON \ - -D BUILD_FORTRAN_MODULE_INTERFACE=ON \ - -D EXAMPLES_ENABLE_F2003=ON \ - -D SUNDIALS_INDEX_SIZE=64 \ - -D SUNDIALS_PRECISION=double \ -$SUNDIALS_SOURCE_DIR - diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 index b67f1e9a43..86a7d97447 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -285,7 +285,7 @@ program main type(SUNLinearSolver), pointer :: sunls ! sundials linear solver type(c_ptr) :: arkode_mem ! ARKODE memory - ! solution vector, N and Nvar are set in the ode_mod moduel + ! solution vector, N and Nvar are set in the ode_mod module real(c_double) :: y(Nvar,N) !======= Internals ============ diff --git a/examples/arkode/F2003_parallel/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index 6379317225..d1084b5af3 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -1,5 +1,6 @@ # --------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL +# modified by Daniel M. Margolis @ SMU # --------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security @@ -19,19 +20,16 @@ set(FARKODE_examples "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2") - -if(MPI_Fortran_COMPILER) - # use MPI wrapper as the compiler - set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) -else() - # add MPI_INCLUDE_PATH to include directories - include_directories(${MPI_INCLUDE_PATH}) -endif() + "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" + "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "ark_diag_non_f2003\;\;1\;4\;develop\;2" + "ark_heat2D_f2003\;\;1\;4\;develop\;2") # Set-up linker flags and link libraries set(SUNDIALS_LIBS sundials_arkode sundials_farkode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod sundials_nvecmpiplusx sundials_fnvecmpiplusx_mod sundials_nvecmpimanyvector @@ -57,7 +55,7 @@ foreach(example_tuple ${FARKODE_examples}) add_executable(${example} ${example}.f90) # libraries to link against - target_link_libraries(${example} ${SUNDIALS_LIBS}) + target_link_libraries(${example} MPI::MPI_Fortran ${SUNDIALS_LIBS}) set_target_properties(${example} PROPERTIES FOLDER "Examples") endif() @@ -93,10 +91,6 @@ endforeach(example_tuple ${FARKODE_examples}) # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) - # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} @@ -109,6 +103,8 @@ if(EXAMPLES_INSTALL) # Makefile: convert semi-colon separated target list to space separated string set(EXAMPLE_LIBS_LIST sundials_farkode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod sundials_arkode sundials_fnvecmpiplusx_mod sundials_nvecmpiplusx diff --git a/examples/arkode/F2003_parallel/README b/examples/arkode/F2003_parallel/README deleted file mode 100644 index bb97c411f5..0000000000 --- a/examples/arkode/F2003_parallel/README +++ /dev/null @@ -1,46 +0,0 @@ -List of parallel ARKODE F2003 examples - - ark_brusselator1D_task_local_nls : 1-D 3-species advection-reaction problem - with a user-defined nonlinear solver - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=OFF \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_INSTALL=ON \ --DENABLE_MPI=ON \ --DENABLE_LAPACK=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_HYPRE=ON \ --DHYPRE_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/hypre/2.11.1/include \ --DHYPRE_LIBRARY=/usr/casc/sundials/apps/rh6/hypre/2.11.1/lib/libHYPRE.a \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ --DENABLE_SUPERLUMT=ON \ --DSUPERLUMT_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/superlu_mt/SuperLU_MT_3.1/SRC \ --DSUPERLUMT_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/superlu_mt/SuperLU_MT_3.1/lib \ --DSUPERLUMT_THREAD_TYPE=Pthread \ --DENABLE_PETSC=ON \ --DPETSC_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/petsc/3.7.2/include \ --DPETSC_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/petsc/3.7.2/lib \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 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 4e46b8991c..5e83ff44c7 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 @@ -91,19 +91,19 @@ module ode_mod integer :: Npts ! number of spatial nodes (local) integer :: Neq ! number of equations (local) - double precision :: xmax ! maximum x value - double precision :: dx ! mesh spacing + real(c_double) :: xmax ! maximum x value + real(c_double) :: dx ! mesh spacing ! Problem parameters - double precision :: c ! advection speed - double precision :: A ! constant concentrations - double precision :: B - double precision :: k1 ! reaction rates - double precision :: k2 - double precision :: k3 - double precision :: k4 - double precision :: k5 - double precision :: k6 + real(c_double) :: c ! advection speed + real(c_double) :: A ! constant concentrations + real(c_double) :: B + real(c_double) :: k1 ! reaction rates + real(c_double) :: k2 + real(c_double) :: k3 + real(c_double) :: k4 + real(c_double) :: k5 + real(c_double) :: k6 ! integrator options real(c_double) :: t0, tf ! initial and final time @@ -143,15 +143,15 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr) :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: ydata(:) real(c_double), pointer :: fdata(:) ! local variables - integer :: i, j, idx1, idx2 ! loop counters and array indices - double precision :: tmp ! temporary value + integer :: i, j, idx1, idx2 ! loop counters and array indices + real(c_double) :: tmp ! temporary value !======= Internals ============ @@ -229,15 +229,15 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr) :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: ydata(:) real(c_double), pointer :: fdata(:) ! local variables - double precision :: u, v, w ! chemcial species - integer :: j, idx ! loop counter and array index + real(c_double) :: u, v, w ! chemcial species + integer :: j, idx ! loop counter and array index !======= Internals ============ @@ -305,7 +305,7 @@ integer(c_int) function AdvectionReaction(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr) :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data !======= Internals ============ @@ -368,14 +368,14 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & integer(c_int), value :: jok ! flag to signal for Jacobian update integer(c_int) :: jcurPtr ! flag to singal Jacobian is current real(c_double), value :: gamma ! current gamma value - type(c_ptr) :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local variables real(c_double), pointer :: ydata(:) ! vector data real(c_double), pointer :: pdata(:) ! matrix data - double precision :: u, v, w ! chemical species - integer :: i, idx, offset ! loop counter, array index, col offset + real(c_double) :: u, v, w ! chemical species + integer :: i, idx, offset ! loop counter, array index, col offset !======= Internals ============ @@ -477,7 +477,7 @@ integer(c_int) function PSolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & real(c_double), value :: gamma ! current gamma value real(c_double), value :: delta ! current gamma value integer(c_int), value :: lr ! left or right preconditioning - type(c_ptr) :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! shortcuts type(N_Vector), pointer :: z_local ! z vector data @@ -668,8 +668,8 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & real(c_double), pointer :: J_data(:) real(c_double), pointer :: bnode_data(:) - double precision :: u, v, w ! chemical species - integer :: i, idx ! loop counter and array index + real(c_double) :: u, v, w ! chemical species + integer :: i, idx ! loop counter and array index !======= Internals ============ @@ -1065,7 +1065,7 @@ program main integer :: i integer :: ierr ! MPI error status integer(c_int) :: retval ! SUNDIALS error status - double precision :: starttime, endtime ! timing variables + real(c_double) :: starttime, endtime ! timing variables type(N_Vector), pointer :: sunvec_ys ! sundials serial vector type(N_Vector), pointer :: sunvec_y ! sundials MPI+X vector @@ -1224,9 +1224,9 @@ subroutine EvolveProblemIMEX(sunvec_y) type(SUNLinearSolver), pointer :: sun_LS ! linear solver type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - integer :: ierr ! MPI error status - integer :: iout ! output counter - double precision :: tout, dtout ! output time and update + integer :: ierr ! MPI error status + integer :: iout ! output counter + real(c_double) :: tout, dtout ! output time and update !======= Internals ============ @@ -1278,7 +1278,7 @@ subroutine EvolveProblemIMEX(sunvec_y) ! Create linear solver sun_LS => FSUNLinSol_SPGMR(sunvec_y, SUN_PREC_LEFT, 0, sunctx) - if (.not. associated(sun_NLS)) then + if (.not. associated(sun_LS)) then print *, "Error: FSUNLinSol_SPGMR returned NULL" call MPI_Abort(comm, 1, ierr) end if @@ -1513,9 +1513,9 @@ subroutine EvolveProblemExplicit(sunvec_y) integer(c_long) :: nfe(1) ! number of RHS evals integer(c_long) :: netf(1) ! number of error test fails - integer :: ierr ! output counter - integer :: iout ! output counter - double precision :: tout, dtout ! output time and update + integer :: ierr ! output counter + integer :: iout ! output counter + real(c_double) :: tout, dtout ! output time and update !======= Internals ============ @@ -1657,7 +1657,7 @@ subroutine WriteOutput(t, sunvec_y) integer i, idx ! loop counter and array index - double precision :: u, v, w ! RMS norm of chemical species + real(c_double) :: u, v, w ! RMS norm of chemical species !======= Internals ============ @@ -1732,10 +1732,10 @@ subroutine SetIC(sunvec_y) type(N_Vector) :: sunvec_y ! solution N_Vector ! local variables - real(c_double), pointer :: ydata(:) ! vector data + real(c_double), pointer :: ydata(:) ! vector data - double precision :: x, us, vs, ws ! position and state - double precision :: p, mu, sigma, alpha ! perturbation vars + real(c_double) :: x, us, vs, ws ! position and state + real(c_double) :: p, mu, sigma, alpha ! perturbation vars integer :: j, idx ! loop counter and array index diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 new file mode 100644 index 0000000000..7e849b7830 --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -0,0 +1,517 @@ +! ---------------------------------------------------------------- +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ---------------------------------------------------------------- +! Example problem: +! +! Diagonal ODE example. Stiff case, with diagonal preconditioner. +! Uses FARKODE interfaces and FARKBBD interfaces. Since the BBD +! preconditioner "local" function requires no communication, +! FARKBBDPrecInit is called with NULL-valued cfn argument. +! Solves problem twice -- with left and right preconditioning. +! +! Note that this problem should only work with SUNDIALS configured +! to use 'sunrealtype' as 'double' and 'sunindextype' as '64bit' +! ---------------------------------------------------------------- + +module DiagkryData + ! -------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + ! -------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 + integer(c_long), parameter :: nlocal = 10 + integer(c_long) :: neq, mu, ml, mudq, mldq + integer(c_int) :: iPretype + real(c_double) :: alpha + +contains + + ! ---------------------------------------------------------------- + ! ODE RHS function f(t,y). + ! ---------------------------------------------------------------- + integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: y(:) + real(c_double), pointer, dimension(nlocal) :: ydot(:) + + ! local data + integer :: i + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Fill ydot with rhs function + do i = 1,nlocal + ydot(i) = -alpha * (myid * nlocal + i) * y(i) + end do + + retval = 0 ! Return with success + return + end function frhs + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Local g function for BBD preconditioner (calls ODE RHS). + ! ---------------------------------------------------------------- + integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + integer(c_long) :: nnlocal ! local space + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_g ! output g N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + integer :: ierr + + ierr = frhs(t, sunvec_y, sunvec_g, user_data) + if (ierr /= 0) then + write(0,*) "Error in LocalgFn user-defined function, ierr = ", ierr + stop 1 + end if + + retval = 0 ! Return with success + return + end function LocalgFn + ! ---------------------------------------------------------------- + +end module DiagkryData +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! Main driver program +! ---------------------------------------------------------------- +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use farkode_mod ! Access ARKODE + use farkode_arkstep_mod ! Access ARKStep + use fnvector_parallel_mod ! Access parallel N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use DiagkryData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data + type(c_ptr) :: arkode_mem ! ARKODE memory + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nst_a(1) ! number of step attempts + integer(c_long) :: nfe(1) ! number of explicit RHS evals + integer(c_long) :: nfi(1) ! number of implicit RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: ncfn(1) ! number of nonlinear convergence fails + integer(c_long) :: ncfl(1) ! number of linear convergence fails + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + integer(c_long) :: ngebbd(1) ! num g evaluations + real(c_double) :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer(c_long) :: lenrwbbd(1) ! band preconditioner real/int workspace size + integer(c_long) :: leniwbbd(1) + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "Diagonal test problem:"; + write(6,'(A,i4)') " neq = " , neq + write(6,'(A,i4)') " nlocal = " , nlocal + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,es9.2)') " alpha = ", alpha + write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write(6,*) " Method is DIRK/NEWTON/SPGMR" + write(6,*) " Precond is band-block-diagonal, using ARKBBDPRE" + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create the ARKStep timestepper module + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(frhs), t0, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) then + print *, "Error: FARKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Tell ARKODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + retval = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + if (retval /= 0) then + print *, 'Error in FARKStepSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FARKStepSStolerances(arkode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FARKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initialize BBD preconditioner + mu = 0 + ml = 0 + mudq = 0 + mldq = 0 + retval = FARKBBDPrecInit(arkode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & + c_funloc(LocalgFn), c_null_funptr) + if (retval /= 0) then + print *, "Error: FARKBBDPrecInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Run problem twice, using differing preconditioning types each time + do iPretype = 1,2 + + if (iPretype == 2) then + + y = 1.d0 + retval = FARKStepReInit(arkode_mem, c_null_funptr, c_funloc(frhs), & + t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FARKStepReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKBBDPrecReInit(arkode_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error in FARKBBDPrecReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + if (outproc) write(6,*) " Preconditioning on right:" + + end if + + if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" + + ! Main time-stepping loop: calls FARKStepEvolve to perform the integration, + ! then prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0+dTout + if (outproc) then + write(6,*) " t steps steps att. fe fi" + write(6,*) " -------------------------------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKStepEvolve returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Retrieve solver statistics + retval = FARKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKStepGetNumStepAttempts returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write(6,'(3x,f10.6,4(3x,i6))') t, nst, nst_a, nfe, nfi + tout = min(tout + dTout, Tf) + + end do + if (outproc) then + write(6,*) " -------------------------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1,nlocal + erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FARKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKStepGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + if (retval /= 0) then + print *, "Error: FARKStepGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + avdim = dble(nli) / dble(nni) + + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FARKStepGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumLinConvFails(arkode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumErrTestFails(arkode_mem, netf) + if (retval /= 0) then + print *, "Error: FARKStepGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FARKStepGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FARKStepGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKBBDPrecGetWorkSpace(arkode_mem, lenrwbbd, leniwbbd) + if (retval /= 0) then + print *, "Error: FARKBBDPrecGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKBBDPrecGetNumGfnEvals(arkode_mem, ngebbd) + if (retval /= 0) then + print *, "Error: FARKBBDPrecGetNumGfnEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write(6,'(A,i6)') " Total explicit RHS evals = ", nfe + write(6,'(A,i6)') " Total implicit RHS evals = ", nfi + write(6,'(A,i6)') " Total preconditioner setups = ", npre + write(6,'(A,i6)') " Total preconditioner solves = ", npsol + write(6,'(A,i6)') " Total nonlinear iterations = ", nni + write(6,'(A,i6)') " Total linear iterations = ", nli + write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write(6,'(A,i6)') " - Linear = ", ncfl + write(6,'(A,i6)') " Total number of error test failures = ", netf + write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write(6,'(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd + write(6,'(A,i6)') " Total number of g evals = ", ngebbd + write(6,'(A)') " " + write(6,'(A)') " " + write(6,'(A)') " " + end if + end do + + ! Clean up and return with successful completion + call FARKStepFree(arkode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out new file mode 100644 index 0000000000..537ef428b9 --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out @@ -0,0 +1,82 @@ + + Diagonal test problem: + neq = 40 + nlocal = 10 + nprocs = 4 + rtol = 1.00E-05 + atol = 1.00E-10 + alpha = 1.00E+01 + ydot_i = -alpha*i * y_i (i = 1,...,neq) + Method is DIRK/NEWTON/SPGMR + Precond is band-block-diagonal, using ARKBBDPRE + + Preconditioning on left: + t steps steps att. fe fi + ------------------------------------------------- + 0.100000 173 173 0 1846 + 0.200000 221 221 0 2362 + 0.300000 248 248 0 2650 + 0.400000 266 266 0 2848 + 0.500000 281 281 0 3007 + 0.600000 291 291 0 3116 + 0.700000 300 300 0 3215 + 0.800000 306 306 0 3275 + 0.900000 312 312 0 3335 + 1.000000 319 319 0 3410 + ------------------------------------------------- +Max. absolute error is 7.52E-11 + + Final Solver Statistics: + Internal solver steps = 319 (attempted = 319) + Total explicit RHS evals = 0 + Total implicit RHS evals = 3410 + Total preconditioner setups = 6 + Total preconditioner solves = 3380 + Total nonlinear iterations = 1812 + Total linear iterations = 1785 + Average Krylov subspace dimension = 0.9851 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 0 + Main solver real/int workspace sizes = 862 267 + Linear solver real/int workspace sizes = 535 126 + BBD preconditioner real/int workspace sizes = 160 72 + Total number of g evals = 12 + + + + Preconditioning on right: + t steps steps att. fe fi + ------------------------------------------------- + 0.100000 173 173 0 1846 + 0.200000 221 221 0 2362 + 0.300000 248 248 0 2650 + 0.400000 266 266 0 2848 + 0.500000 281 281 0 3007 + 0.600000 291 291 0 3116 + 0.700000 300 300 0 3215 + 0.800000 306 306 0 3275 + 0.900000 312 312 0 3335 + 1.000000 319 319 0 3410 + ------------------------------------------------- +Max. absolute error is 7.52E-11 + + Final Solver Statistics: + Internal solver steps = 319 (attempted = 319) + Total explicit RHS evals = 0 + Total implicit RHS evals = 3410 + Total preconditioner setups = 6 + Total preconditioner solves = 3380 + Total nonlinear iterations = 1812 + Total linear iterations = 1785 + Average Krylov subspace dimension = 0.9851 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 0 + Main solver real/int workspace sizes = 862 272 + Linear solver real/int workspace sizes = 535 126 + BBD preconditioner real/int workspace sizes = 160 72 + Total number of g evals = 12 + + + diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 new file mode 100644 index 0000000000..0ddb06d0d1 --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -0,0 +1,317 @@ +!----------------------------------------------------------------- +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +!----------------------------------------------------------------- +! Example problem: +! +! Diagonal ODE example. Nonstiff case: alpha = 10/NEQ. +! Uses ERKStep to explicitly solve nonstiff ODE. +! +!----------------------------------------------------------------- + +module DiagnonData + !--------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + !--------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_long), parameter :: nlocal = 2 + integer(c_long) :: neq + real(c_double) :: alpha + +contains + + + + !----------------------------------------------------------------- + ! ODE RHS function f(t,y). + !----------------------------------------------------------------- + integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: y(:) + real(c_double), pointer, dimension(nlocal) :: ydot(:) + + ! local data + integer :: i + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Fill ydot with rhs function + do i = 1,nlocal + ydot(i) = -alpha * (myid * nlocal + i) * y(i) + end do + + retval = 0 ! Return with success + return + end function frhs + !----------------------------------------------------------------- + + +end module DiagnonData +!------------------------------------------------------------------- + + +!------------------------------------------------------------------- +! Main driver program +!------------------------------------------------------------------- +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use farkode_mod ! Access ARKODE + use farkode_erkstep_mod ! Access ERKStep + use fnvector_parallel_mod ! Access parallel N_Vector + use DiagnonData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data + type(c_ptr) :: arkode_mem ! ARKODE memory + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nst_a(1) ! number of step attempts + integer(c_long) :: nfe(1) ! number of explicit RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 / neq + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "Diagonal test problem:"; + write(6,'(A,i4)') " neq = " , neq + write(6,'(A,i4)') " nlocal = " , nlocal + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,es9.2)') " alpha = ", alpha + write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create the ERKStep timestepper module + arkode_mem = FERKStepCreate(c_funloc(frhs), t0, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) then + print *, "Error: FERKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FERKStepSStolerances(arkode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FERKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Main time-stepping loop: calls FERKStepEvolve to perform the + ! integration, then prints results. Stops when the final time + ! has been reached. + t(1) = T0 + dTout = 0.1d0 + tout = T0+dTout + if (outproc) then + write(6,*) " t steps steps att. fe" + write(6,*) " -----------------------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FERKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FERKStepEvolve returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FERKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FERKStepGetNumStepAttempts returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + if (retval /= 0) then + print *, "Error: FERKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write(6,'(3x,f10.6,3(3x,i5))') t, nst, nst_a, nfe + tout = min(tout + dTout, Tf) + + end do + if (outproc) then + write(6,*) " -----------------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1,nlocal + erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FERKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FERKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FERKStepGetNumStepAttempts returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + if (retval /= 0) then + print *, "Error: FERKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumErrTestFails(arkode_mem, netf) + if (retval /= 0) then + print *, "Error: FERKStepGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write(6,'(A,i6)') " Total RHS evals = ", nfe + write(6,'(A,i6)') " Total number of error test failures = ", netf + endif + + ! Clean up and return with successful completion + call FERKStepFree(arkode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +!----------------------------------------------------------------- diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.out b/examples/arkode/F2003_parallel/ark_diag_non_f2003.out new file mode 100644 index 0000000000..addb75abbd --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.out @@ -0,0 +1,29 @@ + + Diagonal test problem: + neq = 8 + nlocal = 2 + nprocs = 4 + rtol = 1.00E-05 + atol = 1.00E-10 + alpha = 1.25E+00 + ydot_i = -alpha*i * y_i (i = 1,...,neq) + + t steps steps att. fe + ----------------------------------------- + 0.100000 12 13 67 + 0.200000 21 22 112 + 0.300000 29 30 152 + 0.400000 38 39 197 + 0.500000 46 47 237 + 0.600000 54 55 277 + 0.700000 63 64 322 + 0.800000 71 72 362 + 0.900000 80 81 407 + 1.000000 88 89 447 + ----------------------------------------- +Max. absolute error is 3.47E-09 + + Final Solver Statistics: + Internal solver steps = 88 (attempted = 89) + Total RHS evals = 447 + Total number of error test failures = 1 diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 new file mode 100644 index 0000000000..18fb0f4600 --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -0,0 +1,961 @@ +! ---------------------------------------------------------------- +! 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 +! ---------------------------------------------------------------- +! Example problem: +! +! The following test simulates a simple anisotropic 2D heat +! equation, +! u_t = kx*u_xx + ky*u_yy + h, +! for t in [0, 10], (x,y) in [0, 1]^2, with initial conditions +! u(0,x,y) = 0, +! stationary boundary conditions, i.e. +! u_t(t,0,y) = u_t(t,1,y) = u_t(t,x,0) = u_t(t,x,1) = 0, +! and a heat source of the form +! h(x,y) = sin(pi*x)*sin(2*pi*y). +! +! Under this setup, the problem has an analytical solution: +! u(t,x,y) = a(t)*sin(pi*x)*sin(2*pi*y), where +! a(t) = (1 - exp(-(kx+4*ky)*pi^2*t)) / ((kx+4*ky)*pi^2). +! +! The spatial derivatives are computed using second-order +! centered differences, with the data distributed over nx*ny +! points on a uniform spatial grid. +! +! The spatial grid parameters nx and ny, the parameters kx and ky, +! as well as the desired relative and absolute solver tolerances, +! are provided in the input file input_heat2D.txt. +! +! This program solves the problem with a DIRK method. This +! employs a Newton iteration with the PCG iterative linear solver, +! which itself uses a Jacobi preconditioner. The example uses the +! built-in finite-difference Jacobian-vector product routine, but +! supplies both the RHS and preconditioner setup/solve functions. +! +! 20 outputs are printed at equal intervals, and run statistics +! are printed at the end. +! ---------------------------------------------------------------- + +module Heat2DData + ! -------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters, as well as + ! data buffers for MPI exchanges with neighboring processes. + ! Also contains routines to: + ! (a) initialize the module + ! (b) perform exchanges + ! (c) free module data. + ! -------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! Grid and MPI domain decomposition information + integer :: nx ! global number of x grid points + integer :: ny ! global number of y grid points + integer :: is ! global x indices of this subdomain + integer :: ie + integer :: js ! global y indices of this subdomain + integer :: je + integer :: nxl ! local number of x grid points + integer :: nyl ! local number of y grid points + real(c_double) :: dx ! x-directional mesh spacing + real(c_double) :: dy ! y-directional mesh spacing + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + logical :: HaveNbor(2,2) ! flags denoting neighbor on boundary + real(c_double), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange + real(c_double), dimension(:), allocatable :: Wrecv + real(c_double), dimension(:), allocatable :: Nrecv + real(c_double), dimension(:), allocatable :: Srecv + real(c_double), dimension(:), allocatable :: Esend ! send buffers for neighbor exchange + real(c_double), dimension(:), allocatable :: Wsend + real(c_double), dimension(:), allocatable :: Nsend + real(c_double), dimension(:), allocatable :: Ssend + + ! Problem parameters + real(c_double) :: kx ! x-directional diffusion coefficient + real(c_double) :: ky ! y-directional diffusion coefficient + real(c_double), dimension(:,:), allocatable :: h ! heat source vector + + ! Preconditioning data + real(c_double), dimension(:,:), allocatable :: d ! inverse of Jacobian diagonal + +contains + + ! -------------------------------------------------------------- + ! Initialize memory allocated within Userdata (set to defaults) + ! -------------------------------------------------------------- + subroutine InitHeat2DData() + implicit none + nx = 0 + ny = 0 + is = 0 + ie = 0 + js = 0 + je = 0 + nxl = 0 + nyl = 0 + dx = 0.d0 + dy = 0.d0 + kx = 0.d0 + ky = 0.d0 + if (allocated(h)) deallocate(h) + if (allocated(d)) deallocate(d) + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + HaveNbor = .false. + if (allocated(Erecv)) deallocate(Erecv) + if (allocated(Wrecv)) deallocate(Wrecv) + if (allocated(Nrecv)) deallocate(Nrecv) + if (allocated(Srecv)) deallocate(Srecv) + if (allocated(Esend)) deallocate(Esend) + if (allocated(Wsend)) deallocate(Wsend) + if (allocated(Nsend)) deallocate(Nsend) + if (allocated(Ssend)) deallocate(Ssend) + end subroutine InitHeat2DData + ! -------------------------------------------------------------- + + + ! -------------------------------------------------------------- + ! Set up parallel decomposition + ! -------------------------------------------------------------- + subroutine SetupDecomp(ierr) + ! declarations + implicit none + + integer, intent(out) :: ierr + integer :: dims(2), periods(2), coords(2) + + ! internals + + ! check that this has not been called before + if (allocated(h) .or. allocated(d)) then + write(0,*) "SetupDecomp warning: parallel decomposition already set up" + ierr = 1 + return + end if + + ! get suggested parallel decomposition + dims = (/0, 0/) + call MPI_Comm_size(MPI_COMM_WORLD, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = " , ierr + return + end if + call MPI_Dims_create(nprocs, 2, dims, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Dims_create = " , ierr + return + end if + + ! set up 2D Cartesian communicator + periods = (/0, 0/) + call MPI_Cart_create(MPI_COMM_WORLD, 2, dims, periods, 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_create = " , ierr + return + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = " , ierr + return + end if + + ! determine local extents + call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_get = " , ierr + return + end if + is = nx*coords(1)/dims(1) + 1 + ie = nx*(coords(1)+1)/dims(1) + js = ny*coords(2)/dims(2) + 1 + je = ny*(coords(2)+1)/dims(2) + nxl = ie-is+1 + nyl = je-js+1 + + ! determine if I have neighbors, and allocate exchange buffers + HaveNbor(1,1) = (is /= 1) + HaveNbor(1,2) = (ie /= nx) + HaveNbor(2,1) = (js /= 1) + HaveNbor(2,2) = (je /= ny) + if (HaveNbor(1,1)) then + allocate(Wrecv(nyl)) + allocate(Wsend(nyl)) + endif + if (HaveNbor(1,2)) then + allocate(Erecv(nyl)) + allocate(Esend(nyl)) + endif + if (HaveNbor(2,1)) then + allocate(Srecv(nxl)) + allocate(Ssend(nxl)) + endif + if (HaveNbor(2,2)) then + allocate(Nrecv(nxl)) + allocate(Nsend(nxl)) + endif + + ! allocate temporary vectors + allocate(h(nxl,nyl)) ! Create vector for heat source + allocate(d(nxl,nyl)) ! Create vector for Jacobian diagonal + + ierr = 0 ! return with success flag + return + end subroutine SetupDecomp + ! -------------------------------------------------------------- + + + ! -------------------------------------------------------------- + ! Perform neighbor exchange + ! -------------------------------------------------------------- + subroutine Exchange(y, ierr) + ! declarations + implicit none + real(c_double), intent(in) :: y(nxl,nyl) + integer, intent(out) :: ierr + integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; + integer :: stat(MPI_STATUS_SIZE) + integer :: i, ipW, ipE, ipS, ipN + integer :: coords(2), dims(2), periods(2), nbcoords(2) + + ! internals + + ! MPI neighborhood information + call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_get = ", ierr + return + endif + if (HaveNbor(1,1)) then + nbcoords = (/ coords(1)-1, coords(2) /) + call MPI_Cart_rank(comm, nbcoords, ipW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + endif + endif + if (HaveNbor(1,2)) then + nbcoords = (/ coords(1)+1, coords(2) /) + call MPI_Cart_rank(comm, nbcoords, ipE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + endif + endif + if (HaveNbor(2,1)) then + nbcoords = (/ coords(1), coords(2)-1 /) + call MPI_Cart_rank(comm, nbcoords, ipS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + endif + endif + if (HaveNbor(2,2)) then + nbcoords = (/ coords(1), coords(2)+1 /) + call MPI_Cart_rank(comm, nbcoords, ipN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + endif + endif + + ! open Irecv buffers + if (HaveNbor(1,1)) then + call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & + MPI_ANY_TAG, comm, reqRW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + endif + endif + if (HaveNbor(1,2)) then + call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & + MPI_ANY_TAG, comm, reqRE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + endif + endif + if (HaveNbor(2,1)) then + call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & + MPI_ANY_TAG, comm, reqRS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + endif + endif + if (HaveNbor(2,2)) then + call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & + MPI_ANY_TAG, comm, reqRN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + endif + endif + + ! send data + if (HaveNbor(1,1)) then + do i=1,nyl + Wsend(i) = y(1,i) + enddo + call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & + comm, reqSW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + endif + endif + if (HaveNbor(1,2)) then + do i=1,nyl + Esend(i) = y(nxl,i) + enddo + call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & + comm, reqSE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + endif + endif + if (HaveNbor(2,1)) then + do i=1,nxl + Ssend(i) = y(i,1) + enddo + call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & + comm, reqSS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + endif + endif + if (HaveNbor(2,2)) then + do i=1,nxl + Nsend(i) = y(i,nyl) + enddo + call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & + comm, reqSN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + endif + endif + + ! wait for messages to finish + if (HaveNbor(1,1)) then + call MPI_Wait(reqRW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + call MPI_Wait(reqSW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + endif + if (HaveNbor(1,2)) then + call MPI_Wait(reqRE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + call MPI_Wait(reqSE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + endif + if (HaveNbor(2,1)) then + call MPI_Wait(reqRS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + call MPI_Wait(reqSS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + endif + if (HaveNbor(2,2)) then + call MPI_Wait(reqRN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + call MPI_Wait(reqSN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + endif + endif + + ierr = MPI_SUCCESS ! return with success flag + return + end subroutine Exchange + ! -------------------------------------------------------------- + + + ! -------------------------------------------------------------- + ! Free memory allocated within Userdata + ! -------------------------------------------------------------- + subroutine FreeHeat2DData(ierr) + implicit none + integer, intent(out) :: ierr + if (allocated(h)) deallocate(h) + if (allocated(d)) deallocate(d) + if (allocated(Wrecv)) deallocate(Wrecv) + if (allocated(Wsend)) deallocate(Wsend) + if (allocated(Erecv)) deallocate(Erecv) + if (allocated(Esend)) deallocate(Esend) + if (allocated(Srecv)) deallocate(Srecv) + if (allocated(Ssend)) deallocate(Ssend) + if (allocated(Nrecv)) deallocate(Nrecv) + if (allocated(Nsend)) deallocate(Nsend) + ierr = 0 ! return with success flag + return + end subroutine FreeHeat2DData + ! -------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! ODE RHS function f(t,y). + ! ---------------------------------------------------------------- + integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) + real(c_double), pointer, dimension(nxl,nyl) :: ydot(:,:) + + ! local data + real(c_double) :: c1, c2, c3 + integer :: i, j, ierr + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Exchange boundary data with neighbors + call Exchange(y, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in Exchange = " , ierr + retval = -1 + return + end if + + ! iterate over subdomain interior, computing approximation to RHS + c1 = kx/dx/dx + c2 = ky/dy/dy + c3 = -2.d0*(c1 + c2) + do j=2,nyl-1 + do i=2,nxl-1 + ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + enddo + enddo + + ! iterate over subdomain boundaries (if not at overall domain boundary) + if (HaveNbor(1,1)) then ! West face + i=1 + do j=2,nyl-1 + ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + enddo + endif + if (HaveNbor(1,2)) then ! East face + i=nxl + do j=2,nyl-1 + ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + enddo + endif + if (HaveNbor(2,1)) then ! South face + j=1 + do i=2,nxl-1 + ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + enddo + endif + if (HaveNbor(2,2)) then ! West face + j=nyl + do i=2,nxl-1 + ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + enddo + endif + if (HaveNbor(1,1) .and. HaveNbor(2,1)) then ! South-West corner + i=1 + j=1 + ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + endif + if (HaveNbor(1,1) .and. HaveNbor(2,2)) then ! North-West corner + i=1 + j=nyl + ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + endif + if (HaveNbor(1,2) .and. HaveNbor(2,1)) then ! South-East corner + i=nxl + j=1 + ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + endif + if (HaveNbor(1,2) .and. HaveNbor(2,2)) then ! North-East corner + i=nxl + j=nyl + ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + endif + + ydot = ydot + h ! add in heat source + + retval = 0 ! Return with success + return + end function frhs + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Preconditioner setup routine (fills inverse of Jacobian diagonal) + ! ---------------------------------------------------------------- + integer(c_int) function PSetup(t, sunvec_y, sunvec_ydot, jok, jcurPtr, & + gamma, user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + integer(c_int), value :: jok ! flag to signal for Jacobian update + integer(c_int) :: jcurPtr ! flag to singal Jacobian is current + real(c_double), value :: gamma ! current gamma value + type(c_ptr), value :: user_data ! user-defined data + + ! local variables + real(c_double) :: c + + !======= Internals ============ + + ! set constant for matrix diagonal + c = 1.d0 + gamma*2.d0*(kx/dx/dx + ky/dy/dy) + + ! set all entries of d to the inverse of the diagonal values in interior + ! (since boundary RHS is 0, set boundary diagonals to the same) + d = 1.d0/c + + jcurPtr = 1 ! update jcur flag + + ierr = 0 ! Return with success + return + end function PSetup + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Preconditioner solve routine + ! ---------------------------------------------------------------- + integer(c_int) function PSolve(t, sunvec_y, sunvec_ydot, sunvec_r, & + sunvec_z, gamma, delta, lr, user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(N_Vector) :: sunvec_r ! rhs N_Vector + type(N_Vector) :: sunvec_z ! rhs N_Vector + real(c_double), value :: gamma ! current gamma value + real(c_double), value :: delta ! current delta value + integer(c_int), value :: lr ! left or right preconditioning + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nxl,nyl) :: r(:,:) + real(c_double), pointer, dimension(nxl,nyl) :: z(:,:) + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + r(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_r) + z(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_z) + + ! perform Jacobi solve (whole array operation) + z = r*d + + ierr = 0 ! Return with success + return + end function PSolve + ! ---------------------------------------------------------------- + +end module Heat2DData +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use farkode_mod ! Access ARKODE + use farkode_arkstep_mod ! Access ARKStep + use fnvector_parallel_mod ! Access parallel N_Vector + use fsunlinsol_pcg_mod ! Access GMRES SUNLinearSolver + use Heat2DData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + real(c_double), parameter :: pi = 3.1415926535897932d0 + integer, parameter :: Nt = 20 ! total number of output times + integer, parameter :: nx_ = 60 ! spatial mesh size + integer, parameter :: ny_ = 120 + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 0.3d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + real(c_double), parameter :: kx_ = 0.5d0 ! heat conductivity coefficients + real(c_double), parameter :: ky_ = 0.75d0 + real(c_double), parameter :: nlscoef = 1.d-7 ! nonlinear solver tolerance factor + + ! solution vector and other local variables + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + type(N_Vector), pointer :: sunvec_ones ! masking vector for output + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) ! vector data + type(SUNLinearSolver), pointer :: sun_LS ! linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(c_ptr) :: arkode_mem ! ARKODE memory + integer(c_long) :: N, Ntot + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout, urms + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nst_a(1) ! number of step attempts + integer(c_long) :: nfe(1) ! number of explicit RHS evals + integer(c_long) :: nfi(1) ! number of implicit RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: ncfn(1) ! number of convergence fails + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + integer :: i, j, ioutput + character(len=4) :: idstring + character(len=14) :: outname + character(len=24) :: subdomainname + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Initialize Heat2DData module + call InitHeat2DData() + nx = nx_ + ny = ny_ + kx = kx_ + ky = ky_ + dx = 1.d0/(nx-1) ! x mesh spacing + dy = 1.d0/(ny-1) ! x mesh spacing + + ! Set up parallel decomposition (computes local mesh sizes) + call SetupDecomp(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in SetupDecomp = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "2D Heat PDE test problem:"; + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,i4)') " nx = ", nx + write(6,'(A,i4)') " ny = ", ny + write(6,'(A,f5.2)') " kx = ", kx + write(6,'(A,f5.2)') " ky = ", ky + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,i4)') " nxl (proc 0) = ", nxl + write(6,'(A,i4)') " nyl (proc 0) = ", nyl + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + N = nxl*nyl + Ntot = nx*ny + sunvec_y => FN_VNew_Parallel(comm, N, Ntot, sunctx) + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + y = 0.d0 + + ! Create the ARKStep timestepper module + arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(frhs), t0, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) then + print *, "Error: FARKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Create linear solver + sun_LS => FSUNLinSol_PCG(sunvec_y, SUN_PREC_LEFT, int(20, c_int), sunctx) + if (.not. associated(sun_LS)) then + print *, "Error: FSUNLinSol_PCG returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach linear solver + sunmat_A => null() + retval = FARKStepSetLinearSolver(arkode_mem, sun_LS, sunmat_A) + if (retval /= 0) then + print *, "Error: FARKStepSetLinearSolver returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach preconditioner + retval = FARKStepSetPreconditioner(arkode_mem, c_funloc(PSetup), & + c_funloc(PSolve)) + if (retval /= 0) then + print *, "Error: FARKStepSetPreconditioner returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FARKStepSStolerances(arkode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FARKStepSStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify nonlinear solver convergence coefficient + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + if (retval /= 0) then + print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify nonlinear solver predictor method + retval = FARKStepSetPredictorMethod(arkode_mem, int(1, c_int)) + if (retval /= 0) then + print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify that problem is linearly implicit + retval = FARKStepSetLinear(arkode_mem, int(0, c_int)) + if (retval /= 0) then + print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! fill in the heat source array + do j=1,nyl + do i=1,nxl + h(i,j) = sin(pi*(is+i-2)*dx) * sin(2.d0*pi*(js+j-2)*dy) + enddo + enddo + + ! Each processor outputs subdomain information + write(idstring, "(f4.3)") myid/1000.0 + subdomainname = "heat2d_subdomain" // idstring // ".txt" + open(100, file=subdomainname) + write(100,'(6(i9,1x))') nx, ny, is, ie, js, je + close(100) + + ! Open output streams for results, access data array + outname = "heat2d" // idstring // ".txt" + open(101, file=outname) + + ! Output initial condition to disk + do j=1,nyl + do i=1,nxl + write(101,'(es25.16)',advance='no') y(i,j) + enddo + enddo + write(101,*) " " + + ! create masking vector for computing solution RMS norm + sunvec_ones => FN_VNew_Parallel(comm, N, Ntot, sunctx) + call FN_VConst(1.d0, sunvec_ones) + + ! Main time-stepping loop: calls ARKODE to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = (Tf-T0)/Nt + tout = T0+dTout + urms = FN_VWrmsNorm(sunvec_y, sunvec_ones) + if (outproc) then + write(6,*) " t ||u||_rms" + write(6,*) " ----------------------" + write(6,'(2(2x,f10.6))') t, urms + endif + do ioutput=1,Nt + + ! Integrate to output time + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKStepEvolve returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + urms = FN_VWrmsNorm(sunvec_y, sunvec_ones) + if (outproc) write(6,'(2(2x,f10.6))') t, urms + tout = min(tout + dTout, Tf) + + ! output results to disk + do j=1,nyl + do i=1,nxl + write(101,'(es25.16)',advance='no') y(i,j) + enddo + enddo + write(101,*) " " + + enddo + if (outproc) then + write(6,*) " ----------------------" + endif + close(101) + + ! Get final statistics + retval = FARKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKStepGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKStepGetNumStepAttempts returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumErrTestFails(arkode_mem, netf) + if (retval /= 0) then + print *, "Error: FARKStepGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + if (retval /= 0) then + print *, "Error: FARKStepGetNumNonlinSolvIters returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumLinConvFails(arkode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinConvFails returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKStepGetNumLinIters returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKStepGetNumPrecSolves returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write(6,'(A,i6,A,i6)') " Total RHS evals: Fe = ", nfe, ", Fi = ", nfi + write(6,'(A,i6)') " Total linear iterations = ", nli + write(6,'(A,i6)') " Total number of Preconditioner setups = ", npre + write(6,'(A,i6)') " Total number of Preconditioner solves = ", npsol + write(6,'(A,i6)') " Total number of linear solver convergence failures = ", & + ncfn + write(6,'(A,i6)') " Total number of Newton iterations = ", nni + write(6,'(A,i6)') " Total number of error test failures = ", netf + endif + + ! Clean up and return with successful completion + call FARKStepFree(arkode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call FN_VDestroy(sunvec_ones) + retval = FSUNLinSolFree(sun_LS) ! free linear solver + call FreeHeat2DData(ierr) ! free user data + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.out b/examples/arkode/F2003_parallel/ark_heat2D_f2003.out new file mode 100644 index 0000000000..f4b687e137 --- /dev/null +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.out @@ -0,0 +1,46 @@ + + 2D Heat PDE test problem: + nprocs = 4 + nx = 60 + ny = 120 + kx = 0.50 + ky = 0.75 + rtol = 1.00E-05 + atol = 1.00E-10 + nxl (proc 0) = 30 + nyl (proc 0) = 60 + + t ||u||_rms + ---------------------- + 0.000000 0.000000 + 0.015000 0.005780 + 0.030000 0.009224 + 0.045000 0.011275 + 0.060000 0.012497 + 0.075000 0.013224 + 0.090000 0.013658 + 0.105000 0.013916 + 0.120000 0.014070 + 0.135000 0.014162 + 0.150000 0.014216 + 0.165000 0.014249 + 0.180000 0.014268 + 0.195000 0.014280 + 0.210000 0.014287 + 0.225000 0.014291 + 0.240000 0.014293 + 0.255000 0.014295 + 0.270000 0.014295 + 0.285000 0.014296 + 0.300000 0.014296 + ---------------------- + + Final Solver Statistics: + Internal solver steps = 55 (attempted = 57) + Total RHS evals: Fe = 0, Fi = 573 + Total linear iterations = 4982 + Total number of Preconditioner setups = 21 + Total number of Preconditioner solves = 4982 + Total number of linear solver convergence failures = 237 + Total number of Newton iterations = 285 + Total number of error test failures = 2 diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index 15bb197be6..635906df1b 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -1,5 +1,6 @@ # --------------------------------------------------------------- # Programmer(s): Cody J. Balos @ LLNL +# modified by Daniel M. Margolis @ SMU # --------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security @@ -20,6 +21,9 @@ # Examples using SUNDIALS linear solvers set(FARKODE_examples "ark_analytic_f2003\;\;develop" + "ark_bruss_f2003\;\;develop" + "ark_diurnal_kry_bp_f2003\;\;develop" + "ark_roberts_dns_f2003\;\;develop" "ark_kpr_mri_f2003\;\;develop" "ark_kpr_mri_f2003\;0 0.002\;develop" "ark_kpr_mri_f2003\;1 0.002\;develop" @@ -33,6 +37,25 @@ set(FARKODE_examples "ark_kpr_mri_f2003\;9 0.001\;develop" ) +# Examples using SUNDIALS KLU interface +if(SUNDIALS_INDEX_SIZE MATCHES "64") + + set(FARKODE_examples_KLU + "ark_bruss1D_FEM_klu_f2003\;develop" + ) + +endif() + +# Examples using LAPACK interface +if(SUNDIALS_INDEX_SIZE MATCHES "64") + + set(FARKODE_examples_LAPACK + "ark_roberts_dnsL_f2003\;\;develop" + ) + +endif() + +# Regression tests set(FARKODE_tests "test_ark_butcher_f2003\;develop" ) @@ -87,6 +110,92 @@ foreach(example_tuple ${FARKODE_examples}) endif() endforeach(example_tuple ${FARKODE_examples}) + +# Add the build and install targets for each KLU example (if needed) +if(BUILD_SUNLINSOL_KLU) + + # Sundials KLU linear solver module + set(SUNLINSOLKLU_LIBS + sundials_sunlinsolklu + sundials_fsunlinsolklu_mod) + + # KLU libraries + list(APPEND SUNLINSOLKLU_LIBS) + + foreach(example_tuple ${FARKODE_examples_KLU}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_type) + + # example source files + add_executable(${example} ${example}.f90) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + + # add example to regression tests + sundials_add_test(${example} ${example} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${example}.out + EXAMPLE_TYPE ${example_type}) + + # libraries to link against + target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLKLU_LIBS}) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example}.out + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + endif() + + endforeach(example_tuple ${FARKODE_examples_KLU}) + +endif() + + +# Add the build and install targets for each LAPACK example (if needed) +if(BUILD_SUNLINSOL_LAPACKDENSE) + + # Sundials LAPACK linear solver modules + set(SUNLINSOLLAPACK_LIBS + sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) + + # LAPACK libraries + list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) + + foreach(example_tuple ${FARKODE_examples_LAPACK}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_type) + + # example source files + add_executable(${example} ${example}.f90) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + + # add example to regression tests + sundials_add_test(${example} ${example} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${example}.out + EXAMPLE_TYPE ${example_type}) + + # libraries to link against + target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example}.out + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + endif() + + endforeach(example_tuple ${FARKODE_examples_LAPACK}) + +endif() + + # Add the build and install targets for regression test foreach(example_tuple ${FARKODE_tests}) @@ -123,9 +232,6 @@ endforeach(example_tuple ${FARKODE_tests}) # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) - # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) diff --git a/examples/arkode/F2003_serial/README b/examples/arkode/F2003_serial/README deleted file mode 100644 index 614972bdb1..0000000000 --- a/examples/arkode/F2003_serial/README +++ /dev/null @@ -1,20 +0,0 @@ -List of serial ARKODE F2003 examples - - ark_analytic_f2003 : simple stiff, linear, ODE (DIRK/DENSE) - test_ark_butcher_f2003 : smoke tests for the Fortran 2003 interface to the ARKodeButcherTable API - -The following CMake command was used to configure SUNDIALS: - -cmake \ - -D CMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_DIR \ - -D EXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_DIR/examples\ - -D BUILD_SHARED_LIBS=ON \ - -D BUILD_STATIC_LIBS=ON \ - -D BUILD_ARKODE=ON \ - -D BUILD_TESTING=ON \ - -D BUILD_FORTRAN_MODULE_INTERFACE=ON \ - -D EXAMPLES_ENABLE_F2003=ON \ - -D SUNDIALS_INDEX_SIZE=64 \ - -D SUNDIALS_PRECISION=double \ -$SUNDIALS_SOURCE_DIR - diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 9900c83f29..877d76062b 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -3,7 +3,7 @@ ! modified by Jean M. Sexton @ LBL ! ------------------------------------------------------------------ ! SUNDIALS Copyright Start -! Copyright (c) 2002-2024, Lawrence Livermore National Security +! Copyright (c) 2002-2023, Lawrence Livermore National Security ! and Southern Methodist University. ! All rights reserved. ! @@ -25,7 +25,7 @@ ! than 100 the problem becomes quite stiff. ! ------------------------------------------------------------------ -module ode_mod +module analytic_mod !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -38,7 +38,7 @@ module ode_mod integer(c_long), parameter :: neq = 1 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + real(c_double), parameter :: lamda = -100.0d0 contains @@ -61,14 +61,14 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & implicit none ! calling variables - real(c_double), value :: tn ! current time - type(N_Vector) :: sunvec_y ! solution N_Vector - type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr) :: user_data ! user-defined data + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: yvec(:) - real(c_double), pointer :: fvec(:) + real(c_double), pointer, dimension(neq) :: yvec(:) + real(c_double), pointer, dimension(neq) :: fvec(:) !======= Internals ============ @@ -84,21 +84,27 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & return end function RhsFn + ! ---------------------------------------------------------------- + +end module analytic_mod +! ------------------------------------------------------------------ -end module ode_mod +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ program main !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_core_mod ! Fortran interface to SUNDIALS core types, data structures, etc. + use farkode_mod ! Fortran interface to the ARKODE use farkode_arkstep_mod ! Fortran interface to the ARKStep time-stepper module use fnvector_serial_mod ! Fortran interface to serial N_Vector use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver use fsunadaptcontroller_soderlind_mod ! Fortran interface to Soderlind controller - use ode_mod ! ODE functions + use analytic_mod ! ODE functions !======= Declarations ========= implicit none @@ -120,7 +126,7 @@ program main 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 + real(c_double), pointer, dimension(neq) :: yvec(:) ! underlying vector !======= Internals ============ @@ -165,8 +171,8 @@ program main ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetLinearSolver' - stop 1 + write(*,*) 'Error in FARKStepSetLinearSolver' + stop 1 end if ! set relative and absolute tolerances @@ -230,6 +236,7 @@ program main ierr = FSUNContext_Free(ctx) end program main +! ---------------------------------------------------------------- ! ---------------------------------------------------------------- @@ -361,3 +368,4 @@ subroutine ARKStepStats(arkode_mem) return end subroutine ARKStepStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 new file mode 100644 index 0000000000..8adb2d54bc --- /dev/null +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -0,0 +1,1439 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! Example problem: +! +! The following test simulates a brusselator problem from chemical +! kinetics. This is a PDE system with 3 components, Y = [u,v,w], +! satisfying the equations, +! du/dt = du*u_xx + a - (w+1)*u + v*u^2 +! dv/dt = dv*v_xx + w*u - v*u^2 +! dw/dt = dw*w_xx + (b-w)/ep - w*u +! for t in the interval [0, 10], x in [0, 10], with initial +! conditions +! u(0,x) = a + 0.1*sin(pi*x), +! v(0,x) = b/a + 0.1*sin(pi*x), +! w(0,x) = b + 0.1*sin(pi*x), +! and with stationary boundary conditions, i.e. +! u_t(t,0) = u_t(t,1) = 0, +! v_t(t,0) = v_t(t,1) = 0, +! w_t(t,0) = w_t(t,1) = 0. +! +! Here, we use a piecewise linear Galerkin finite element +! discretization in space, where all element-wise integrals are +! computed using 3-node Gaussian quadrature (since we will have +! quartic polynomials in the reaction terms for the u_t and v_t +! equations (including the test function)). The time derivative +! terms in this system will include a mass matrix, giving rise to +! an ODE system of the form +! M y_t = L y + R(y), +! where M is the 3x3 block mass matrix for each component, L is +! the 3x3 block Laplace operator for each component, and R(y) is +! comprised of the nonlinear reaction terms for each component. +! Since it it highly inefficient to rewrite this system as +! y_t = M^{-1}(L y + R(y)), +! we solve this system using FARKODE, with a user-supplied mass +! matrix. We therefore provide functions to evaluate the ODE RHS +! f(t,y) = L y + R(y), +! its Jacobian +! J(t,y) = L + dR/dy, +! and the mass matrix, M. +! +! We use N=201 spatial nodes, with parameters +! a=0.6, b=2.0, du=0.025, dv=0.025, dw=0.025, ep=1.d-5 +! +! This program solves the problem with the DIRK method, using a +! Newton iteration with the SUNKLU sparse linear solvers for both +! the system and mass matrices. These matrices are stored in +! compressed-sparse-row format. +! +! Output is printed 10 times throughout the defined time interval. +! Run statistics (optional outputs) are printed at the end. +! ------------------------------------------------------------------ + +module Bruss1DFEMKLU_UserData + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! number of equations + integer(c_int), parameter :: neqreal = 3 + + ! ODE parameters + integer(c_int), parameter :: N = 201 ! number of intervals + integer(c_int), parameter :: neq = neqreal*N ! set overall problem size + integer(c_int), parameter :: nnz = 15*neq + real(c_double), parameter :: a = 0.6d0 ! constant forcing on u + real(c_double), parameter :: b = 2.d0 ! steady-state value of w + real(c_double), parameter :: du = 2.5d-2 ! diffusion coeff for u + real(c_double), parameter :: dv = 2.5d-2 ! diffusion coeff for v + real(c_double), parameter :: dw = 2.5d-2 ! diffusion coeff for w + real(c_double), parameter :: ep = 1.d-5 ! stiffness parameter + real(c_double), dimension(N) :: x ! mesh node locations + +contains + + ! function that maps 2D data into 1D address space + ! (0-based since CSR matrix will be sent to C solver) + integer(c_int) function idx(ix, ivar) + integer(c_int) :: ivar, ix + idx = neqreal*(ix - 1) + ivar - 1 + end function idx + +end module Bruss1DFEMKLU_UserData +! ------------------------------------------------------------------ + +! finite element basis functions +module FEMBasis + use, intrinsic :: iso_c_binding + +contains + + ! left/right basis functions + real(c_double) function ChiL(xl,xr,x) + real(c_double) :: xl, xr, x + ChiL = (xr-x)/(xr-xl) + end function ChiL + + real(c_double) function ChiR(xl,xr,x) + real(c_double) :: xl, xr, x + ChiR = (x-xl)/(xr-xl) + end function ChiR + + ! derivatives of left/right basis functions + real(c_double) function ChiL_x(xl,xr) + real(c_double) :: xl, xr + ChiL_x = 1.d0/(xl-xr) + end function ChiL_X + + real(c_double) function ChiR_x(xl,xr) + real(c_double) :: xl, xr + ChiR_x = 1.d0/(xr-xl) + end function ChiR_x + + ! FEM output evaluation routines: value and derivative + real(c_double) function Eval(ul,ur,xl,xr,x) + real(c_double) :: ul, ur, xl, xr, x + Eval = ul*ChiL(xl,xr,x) + ur*ChiR(xl,xr,x) + end function Eval + + real(c_double) function Eval_x(ul,ur,xl,xr) + real(c_double) :: ul, ur, xl, xr + Eval_x = ul*ChiL_x(xl,xr) + ur*ChiR_x(xl,xr) + end function Eval_x + +end module FEMBasis +! ------------------------------------------------------------------ + +! quadrature data +module Quadrature + use, intrinsic :: iso_c_binding + +contains + + ! nodes + real(c_double) function X1(xl,xr) + real(c_double) :: xl, xr + X1 = 0.5d0*(xl+xr) - 0.5d0*(xr-xl)*0.774596669241483377035853079956d0 + end function X1 + + real(c_double) function X2(xl,xr) + real(c_double) :: xl, xr + X2 = 0.5d0*(xl+xr) + end function X2 + + real(c_double) function X3(xl,xr) + real(c_double) :: xl, xr + X3 = 0.5d0*(xl+xr) + 0.5d0*(xr-xl)*0.774596669241483377035853079956d0 + end function X3 + + ! quadrature + real(c_double) function Quad(f1,f2,f3,xl,xr) + real(c_double) :: f1, f2, f3, xl, xr + real(c_double), parameter :: wt1=0.55555555555555555555555555555556d0 + real(c_double), parameter :: wt2=0.88888888888888888888888888888889d0 + real(c_double), parameter :: wt3=0.55555555555555555555555555555556d0 + Quad = 0.5d0*(xr-xl)*(wt1*f1 + wt2*f2 + wt3*f3) + end function Quad + +end module Quadrature +! ------------------------------------------------------------------ + +module bruss1D_ode_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use Bruss1DFEMKLU_UserData + use fsundials_core_mod + +contains + + ! ---------------------------------------------------------------- + ! ImpRhsFn provides the right hand side implicit function for the + ! ODE: dy1/dt = f1(t,y1,y2,y3) + ! dy2/dt = f2(t,y1,y2,y3) + ! dy3/dt = f3(t,y1,y2,y3) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C) + + !======= Inclusions =========== + use FEMBasis + use Quadrature + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! Local data + integer(c_int) :: ix + logical :: left, right + real(c_double) :: ul, ur, vl, vr, wl, wr, xl, xr, u, v, w, f1, f2, f3 + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neqreal, N) :: yvec(:,:) + real(c_double), pointer, dimension(neqreal, N) :: fvec(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_y) + fvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_f) + + ! clear out rhs + fvec = 0.d0 + + ! iterate over intervals, filling in rhs function + do ix=1,N-1 + + ! set booleans to determine whether equations exist on the left/right */ + left = .true. + right = .true. + if (ix==1) left = .false. + if (ix==(N-1)) right = .false. + + ! set nodal value shortcuts (interval index aligns with left node) + ul = yvec(1,ix) + vl = yvec(2,ix) + wl = yvec(3,ix) + ur = yvec(1,ix+1) + vr = yvec(2,ix+1) + wr = yvec(3,ix+1) + + ! set mesh shortcuts + xl = x(ix) + xr = x(ix+1) + + ! left test function + if (left) then + + ! u -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X3(xl,xr)) + fvec(1,ix) = fvec(1,ix) + Quad(f1,f2,f3,xl,xr) + + ! u -- diffusion + f1 = -du * Eval_x(ul,ur,xl,xr) * ChiL_x(xl,xr) + fvec(1,ix) = fvec(1,ix) + Quad(f1,f1,f1,xl,xr) + + ! v -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = (w*u - v*u*u) * ChiL(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = (w*u - v*u*u) * ChiL(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = (w*u - v*u*u) * ChiL(xl,xr,X3(xl,xr)) + fvec(2,ix) = fvec(2,ix) + Quad(f1,f2,f3,xl,xr) + + ! v -- diffusion + f1 = -dv * Eval_x(vl,vr,xl,xr) * ChiL_x(xl,xr) + fvec(2,ix) = fvec(2,ix) + Quad(f1,f1,f1,xl,xr) + + ! w -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = ((b-w)/ep - w*u) * ChiL(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = ((b-w)/ep - w*u) * ChiL(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = ((b-w)/ep - w*u) * ChiL(xl,xr,X3(xl,xr)) + fvec(3,ix) = fvec(3,ix) + Quad(f1,f2,f3,xl,xr) + + ! w -- diffusion + f1 = -dw * Eval_x(wl,wr,xl,xr) * ChiL_x(xl,xr) + fvec(3,ix) = fvec(3,ix) + Quad(f1,f1,f1,xl,xr) + + end if + + ! right test function + if (right) then + + ! u -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X3(xl,xr)) + fvec(1,ix+1) = fvec(1,ix+1) + Quad(f1,f2,f3,xl,xr) + + ! u -- diffusion + f1 = -du * Eval_x(ul,ur,xl,xr) * ChiR_x(xl,xr) + fvec(1,ix+1) = fvec(1,ix+1) + Quad(f1,f1,f1,xl,xr) + + ! v -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = (w*u - v*u*u) * ChiR(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = (w*u - v*u*u) * ChiR(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = (w*u - v*u*u) * ChiR(xl,xr,X3(xl,xr)) + fvec(2,ix+1) = fvec(2,ix+1) + Quad(f1,f2,f3,xl,xr) + + ! v -- diffusion + f1 = -dv * Eval_x(vl,vr,xl,xr) * ChiR_x(xl,xr) + fvec(2,ix+1) = fvec(2,ix+1) + Quad(f1,f1,f1,xl,xr) + + ! w -- reaction + u = Eval(ul, ur, xl, xr, X1(xl,xr)) + v = Eval(vl, vr, xl, xr, X1(xl,xr)) + w = Eval(wl, wr, xl, xr, X1(xl,xr)) + f1 = ((b-w)/ep - w*u) * ChiR(xl,xr,X1(xl,xr)) + u = Eval(ul, ur, xl, xr, X2(xl,xr)) + v = Eval(vl, vr, xl, xr, X2(xl,xr)) + w = Eval(wl, wr, xl, xr, X2(xl,xr)) + f2 = ((b-w)/ep - w*u) * ChiR(xl,xr,X2(xl,xr)) + u = Eval(ul, ur, xl, xr, X3(xl,xr)) + v = Eval(vl, vr, xl, xr, X3(xl,xr)) + w = Eval(wl, wr, xl, xr, X3(xl,xr)) + f3 = ((b-w)/ep - w*u) * ChiR(xl,xr,X3(xl,xr)) + fvec(3,ix+1) = fvec(3,ix+1) + Quad(f1,f2,f3,xl,xr) + + ! w -- diffusion + f1 = -dw * Eval_x(wl,wr,xl,xr) * ChiR_x(xl,xr) + fvec(3,ix+1) = fvec(3,ix+1) + Quad(f1,f1,f1,xl,xr) + + end if + + end do + + ! return success + ierr = 0 + return + + end function ImpRhsFn + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Jac: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Jac') + + !======= Inclusions =========== + use FEMBasis + use Quadrature + use fnvector_serial_mod + use fsunmatrix_sparse_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! Local data + integer(c_int) :: ix, nz, Nint + real(c_double) :: ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr + real(c_double) :: u1, u2, u3, v1, v2, v3, w1, w2, w3 + real(c_double) :: df1, df2, df3, dQdf1, dQdf2, dQdf3 + real(c_double) :: ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3 + real(c_double), dimension(3,-1:1) :: Ju, Jv, Jw + + ! pointers to data in SUNDIALS vectors + integer(c_long), pointer, dimension(nnz) :: Jcolvals(:) + integer(c_long), pointer, dimension(neq+1) :: Jrowptrs(:) + real(c_double), pointer, dimension(nnz) :: Jdata(:) + real(c_double), pointer, dimension(neqreal,N) :: yvec(:,:) + real(c_double), pointer, dimension(neqreal,N) :: fvec(:,:) + + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_y) + fvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_f) + Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) + Jcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) + Jrowptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_J) + + ! check that vector/matrix dimensions match up + if ((3*N /= neq) .or. (nnz < 27*(N-2))) then + ierr = 1 + return + end if + + ! set integer*4 version of N for call to idx() + Nint = N + + ! clear out Jacobian matrix data + Jdata = 0.d0 + nz = 0 + + ! Dirichlet boundary at left + Jrowptrs(idx(1,1)+1) = nz + Jrowptrs(idx(1,2)+1) = nz + Jrowptrs(idx(1,3)+1) = nz + + ! iterate through nodes, filling in matrix by rows + do ix=2,N-1 + + ! set nodal value shortcuts (interval index aligns with left node) + xl = x(ix-1) + ul = yvec(1,ix-1) + vl = yvec(2,ix-1) + wl = yvec(3,ix-1) + xc = x(ix) + uc = yvec(1,ix) + vc = yvec(2,ix) + wc = yvec(3,ix) + xr = x(ix+1) + ur = yvec(1,ix+1) + vr = yvec(2,ix+1) + wr = yvec(3,ix+1) + + ! compute entries of all Jacobian rows at node ix + Ju = 0.d0 + Jv = 0.d0 + Jw = 0.d0 + + ! first compute dependence on values to left and center + + ! evaluate relevant variables in left subinterval + u1 = Eval(ul, uc, xl, xc, X1(xl,xc)) + v1 = Eval(vl, vc, xl, xc, X1(xl,xc)) + w1 = Eval(wl, wc, xl, xc, X1(xl,xc)) + u2 = Eval(ul, uc, xl, xc, X2(xl,xc)) + v2 = Eval(vl, vc, xl, xc, X2(xl,xc)) + w2 = Eval(wl, wc, xl, xc, X2(xl,xc)) + u3 = Eval(ul, uc, xl, xc, X3(xl,xc)) + v3 = Eval(vl, vc, xl, xc, X3(xl,xc)) + w3 = Eval(wl, wc, xl, xc, X3(xl,xc)) + + dQdf1 = Quad(1.d0, 0.d0, 0.d0, xl, xc) + dQdf2 = Quad(0.d0, 1.d0, 0.d0, xl, xc) + dQdf3 = Quad(0.d0, 0.d0, 1.d0, xl, xc) + + ChiL1 = ChiL(xl, xc, X1(xl,xc)) + ChiL2 = ChiL(xl, xc, X2(xl,xc)) + ChiL3 = ChiL(xl, xc, X3(xl,xc)) + ChiR1 = ChiR(xl, xc, X1(xl,xc)) + ChiR2 = ChiR(xl, xc, X2(xl,xc)) + ChiR3 = ChiR(xl, xc, X3(xl,xc)) + + ! compute diffusion Jacobian components + + ! L_u = -du * u_x * ChiR_x + ! dL_u/dul + Ju(1,-1) = (-du) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) + ! dL_u/duc + Ju(1,0) = (-du) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) + + ! L_v = -dv * v_x * ChiR_x + ! dL_v/dvl + Jv(2,-1) = (-dv) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) + ! dL_v/dvc + Jv(2,0) = (-dv) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) + + ! L_w = -dw * w_x * ChiR_x + ! dL_w/dwl + Jw(3,-1) = (-dw) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) + ! dL_w/dwc + Jw(3,0) = (-dw) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) + + + ! compute reaction Jacobian components + + ! R_u = (a - (w+1.d0)*u + v*u*u) + ! dR_u/dul + df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiR1 + df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiR2 + df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiR3 + Ju(1,-1) = Ju(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/duc + df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiR1 * ChiR1 + df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiR2 * ChiR2 + df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiR3 * ChiR3 + Ju(1,0) = Ju(1,0)+ dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvl + df1 = (u1*u1) * ChiL1 * ChiR1 + df2 = (u2*u2) * ChiL2 * ChiR2 + df3 = (u3*u3) * ChiL3 * ChiR3 + Ju(2,-1) = Ju(2,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvc + df1 = (u1*u1) * ChiR1 * ChiR1 + df2 = (u2*u2) * ChiR2 * ChiR2 + df3 = (u3*u3) * ChiR3 * ChiR3 + Ju(2,0) = Ju(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwl + df1 = (-u1) * ChiL1 * ChiR1 + df2 = (-u2) * ChiL2 * ChiR2 + df3 = (-u3) * ChiL3 * ChiR3 + Ju(3,-1) = Ju(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwc + df1 = (-u1) * ChiR1 * ChiR1 + df2 = (-u2) * ChiR2 * ChiR2 + df3 = (-u3) * ChiR3 * ChiR3 + Ju(3,0) = Ju(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! R_v = (w*u - v*u*u) + ! dR_v/dul + df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiR1 + df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiR2 + df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiR3 + Jv(1,-1) = Jv(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/duc + df1 = (w1 - 2.d0*v1*u1) * ChiR1 * ChiR1 + df2 = (w2 - 2.d0*v2*u2) * ChiR2 * ChiR2 + df3 = (w3 - 2.d0*v3*u3) * ChiR3 * ChiR3 + Jv(1,0) = Jv(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvl + df1 = (-u1*u1) * ChiL1 * ChiR1 + df2 = (-u2*u2) * ChiL2 * ChiR2 + df3 = (-u3*u3) * ChiL3 * ChiR3 + Jv(2,-1) = Jv(2,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvc + df1 = (-u1*u1) * ChiR1 * ChiR1 + df2 = (-u2*u2) * ChiR2 * ChiR2 + df3 = (-u3*u3) * ChiR3 * ChiR3 + Jv(2,0) = Jv(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwl + df1 = (u1) * ChiL1 * ChiR1 + df2 = (u2) * ChiL2 * ChiR2 + df3 = (u3) * ChiL3 * ChiR3 + Jv(3,-1) = Jv(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwc + df1 = (u1) * ChiR1 * ChiR1 + df2 = (u2) * ChiR2 * ChiR2 + df3 = (u3) * ChiR3 * ChiR3 + Jv(3,0) = Jv(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! R_w = ((b-w)/ep - w*u) + ! dR_w/dul + df1 = (-w1) * ChiL1 * ChiR1 + df2 = (-w2) * ChiL2 * ChiR2 + df3 = (-w3) * ChiL3 * ChiR3 + Jw(1,-1) = Jw(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/duc + df1 = (-w1) * ChiR1 * ChiR1 + df2 = (-w2) * ChiR2 * ChiR2 + df3 = (-w3) * ChiR3 * ChiR3 + Jw(1,0) = Jw(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwl + df1 = (-1.d0/ep - u1) * ChiL1 * ChiR1 + df2 = (-1.d0/ep - u2) * ChiL2 * ChiR2 + df3 = (-1.d0/ep - u3) * ChiL3 * ChiR3 + Jw(3,-1) = Jw(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwc + df1 = (-1.d0/ep - u1) * ChiR1 * ChiR1 + df2 = (-1.d0/ep - u2) * ChiR2 * ChiR2 + df3 = (-1.d0/ep - u3) * ChiR3 * ChiR3 + Jw(3,0) = Jw(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! second compute dependence on values to center and right + + ! evaluate relevant variables in right subinterval + u1 = Eval(uc, ur, xc, xr, X1(xc,xr)) + v1 = Eval(vc, vr, xc, xr, X1(xc,xr)) + w1 = Eval(wc, wr, xc, xr, X1(xc,xr)) + u2 = Eval(uc, ur, xc, xr, X2(xc,xr)) + v2 = Eval(vc, vr, xc, xr, X2(xc,xr)) + w2 = Eval(wc, wr, xc, xr, X2(xc,xr)) + u3 = Eval(uc, ur, xc, xr, X3(xc,xr)) + v3 = Eval(vc, vr, xc, xr, X3(xc,xr)) + w3 = Eval(wc, wr, xc, xr, X3(xc,xr)) + + dQdf1 = Quad(1.d0, 0.d0, 0.d0, xc, xr) + dQdf2 = Quad(0.d0, 1.d0, 0.d0, xc, xr) + dQdf3 = Quad(0.d0, 0.d0, 1.d0, xc, xr) + + ChiL1 = ChiL(xc, xr, X1(xc,xr)) + ChiL2 = ChiL(xc, xr, X2(xc,xr)) + ChiL3 = ChiL(xc, xr, X3(xc,xr)) + ChiR1 = ChiR(xc, xr, X1(xc,xr)) + ChiR2 = ChiR(xc, xr, X2(xc,xr)) + ChiR3 = ChiR(xc, xr, X3(xc,xr)) + + + ! compute diffusion Jacobian components + + ! L_u = -du * u_x * ChiL_x + ! dL_u/duc + Ju(1,0) = Ju(1,0) + (-du) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) + + ! dL_u/dur + Ju(1,1) = Ju(1,1) + (-du) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) + + ! L_v = -dv * v_x * ChiL_x + ! dL_v/dvc + Jv(2,0) = Jv(2,0) + (-dv) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) + + ! dL_v/dvr + Jv(2,1) = Jv(2,1) + (-dv) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) + + ! L_w = -dw * w_x * ChiL_x + ! dL_w/dwc + Jw(3,0) = Jw(3,0) + (-dw) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) + + ! dL_w/dwr + Jw(3,1) = Jw(3,1) + (-dw) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) + + + ! compute reaction Jacobian components + + ! R_u = (a - (w+1.d0)*u + v*u*u) + ! dR_u/duc + df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiL1 + df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiL2 + df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiL3 + Ju(1,0) = Ju(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dur + df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiR1 + df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiR2 + df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiR3 + Ju(1,1) = Ju(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvc + df1 = (u1*u1) * ChiL1 * ChiL1 + df2 = (u2*u2) * ChiL2 * ChiL2 + df3 = (u3*u3) * ChiL3 * ChiL3 + Ju(2,0) = Ju(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvr + df1 = (u1*u1) * ChiL1 * ChiR1 + df2 = (u2*u2) * ChiL2 * ChiR2 + df3 = (u3*u3) * ChiL3 * ChiR3 + Ju(2,1) = Ju(2,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwc + df1 = (-u1) * ChiL1 * ChiL1 + df2 = (-u2) * ChiL2 * ChiL2 + df3 = (-u3) * ChiL3 * ChiL3 + Ju(3,0) = Ju(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwr + df1 = (-u1) * ChiL1 * ChiR1 + df2 = (-u2) * ChiL2 * ChiR2 + df3 = (-u3) * ChiL3 * ChiR3 + Ju(3,1) = Ju(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! R_v = (w*u - v*u*u) + ! dR_v/duc + df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiL1 + df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiL2 + df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiL3 + Jv(1,0) = Jv(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dur + df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiR1 + df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiR2 + df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiR3 + Jv(1,1) = Jv(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvc + df1 = (-u1*u1) * ChiL1 * ChiL1 + df2 = (-u2*u2) * ChiL2 * ChiL2 + df3 = (-u3*u3) * ChiL3 * ChiL3 + Jv(2,0) = Jv(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvr + df1 = (-u1*u1) * ChiL1 * ChiR1 + df2 = (-u2*u2) * ChiL2 * ChiR2 + df3 = (-u3*u3) * ChiL3 * ChiR3 + Jv(2,1) = Jv(2,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwc + df1 = (u1) * ChiL1 * ChiL1 + df2 = (u2) * ChiL2 * ChiL2 + df3 = (u3) * ChiL3 * ChiL3 + Jv(3,0) = Jv(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwr + df1 = (u1) * ChiL1 * ChiR1 + df2 = (u2) * ChiL2 * ChiR2 + df3 = (u3) * ChiL3 * ChiR3 + Jv(3,1) = Jv(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! R_w = ((b-w)/ep - w*u) + ! dR_w/duc + df1 = (-w1) * ChiL1 * ChiL1 + df2 = (-w2) * ChiL2 * ChiL2 + df3 = (-w3) * ChiL3 * ChiL3 + Jw(1,0) = Jw(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dur + df1 = (-w1) * ChiL1 * ChiR1 + df2 = (-w2) * ChiL2 * ChiR2 + df3 = (-w3) * ChiL3 * ChiR3 + Jw(1,1) = Jw(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwc + df1 = (-1.d0/ep - u1) * ChiL1 * ChiL1 + df2 = (-1.d0/ep - u2) * ChiL2 * ChiL2 + df3 = (-1.d0/ep - u3) * ChiL3 * ChiL3 + Jw(3,0) = Jw(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwr + df1 = (-1.d0/ep - u1) * ChiL1 * ChiR1 + df2 = (-1.d0/ep - u2) * ChiL2 * ChiR2 + df3 = (-1.d0/ep - u3) * ChiL3 * ChiR3 + Jw(3,1) = Jw(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + + ! insert Jacobian entries into CSR matrix structure + + ! Ju row + Jrowptrs(idx(ix,1)+1) = nz + + Jdata(nz+1:nz+3) = (/ Ju(1,-1), Ju(2,-1), Ju(3,-1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Ju(1,0), Ju(2,0), Ju(3,0) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Ju(1,1), Ju(2,1), Ju(3,1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) + nz = nz+3 + + ! Jv row + Jrowptrs(idx(ix,2)+1) = nz + + Jdata(nz+1:nz+3) = (/ Jv(1,-1), Jv(2,-1), Jv(3,-1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Jv(1,0), Jv(2,0), Jv(3,0) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Jv(1,1), Jv(2,1), Jv(3,1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) + nz = nz+3 + + ! Jw row + Jrowptrs(idx(ix,3)+1) = nz + + Jdata(nz+1:nz+3) = (/ Jw(1,-1), Jw(2,-1), Jw(3,-1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Jw(1,0), Jw(2,0), Jw(3,0) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) + nz = nz+3 + + Jdata(nz+1:nz+3) = (/ Jw(1,1), Jw(2,1), Jw(3,1) /) + Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) + nz = nz+3 + + end do + + ! Dirichlet boundary at right + Jrowptrs(idx(Nint,1)+1) = nz + Jrowptrs(idx(Nint,2)+1) = nz + Jrowptrs(idx(Nint,3)+1) = nz + + ! signal end of data in CSR matrix + Jrowptrs(idx(Nint,3)+2) = nz + + ! return success + ierr = 0 + return + + end function Jac + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Mass matrix computation routine + ! ---------------------------------------------------------------- + integer(c_int) function Mass(tn, sunmat_M, user_data, & + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Mass') + + !======= Inclusions =========== + use FEMBasis + use Quadrature + use fnvector_serial_mod + use fsunmatrix_sparse_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(SUNMatrix) :: sunmat_M ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! Local data + integer(c_int) :: ix, nz, Nint + real(c_double) :: xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3 + logical :: left, right + + ! pointers to data in SUNDIALS vectors + integer(c_long), pointer, dimension(nnz) :: Mcolvals(:) + integer(c_long), pointer, dimension(neq+1) :: Mrowptrs(:) + real(c_double), pointer, dimension(nnz) :: Mdata(:) + + !======= Internals ============ + ! get data arrays from SUNDIALS vectors + Mdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_M) + Mcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_M) + Mrowptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_M) + + ! check that vector/matrix dimensions match up + if ((3*N /= neq) .or. (nnz /= 15*neq)) then + ierr = 1 + return + end if + + ! set integer*4 version of N for call to idx() + Nint = N + + ! clear out Jacobian matrix data + Mdata = 0.d0 + nz = 0 + + ! iterate through nodes, filling in matrix by rows + do ix=1,N + + ! set booleans to determine whether intervals exist on the left/right */ + left = .true. + right = .true. + if (ix==1) left = .false. + if (ix==N) right = .false. + + ! set nodal value shortcuts (interval index aligns with left node) + if (left) then + xl = x(ix-1) + end if + xc = x(ix) + if (right) then + xr = x(ix+1) + end if + + ! compute entries of all mass matrix rows at node ix + Ml = 0.d0 + Mc = 0.d0 + Mr = 0.d0 + + ! first compute dependence on values to left and center + if (left) then + + ChiL1 = ChiL(xl, xc, X1(xl,xc)) + ChiL2 = ChiL(xl, xc, X2(xl,xc)) + ChiL3 = ChiL(xl, xc, X3(xl,xc)) + ChiR1 = ChiR(xl, xc, X1(xl,xc)) + ChiR2 = ChiR(xl, xc, X2(xl,xc)) + ChiR3 = ChiR(xl, xc, X3(xl,xc)) + + Ml = Ml + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xl, xc) + Mc = Mc + Quad(ChiR1*ChiR1, ChiR2*ChiR2, ChiR3*ChiR3, xl, xc) + + end if + + ! second compute dependence on values to center and right + if (right) then + + ChiL1 = ChiL(xc, xr, X1(xc,xr)) + ChiL2 = ChiL(xc, xr, X2(xc,xr)) + ChiL3 = ChiL(xc, xr, X3(xc,xr)) + ChiR1 = ChiR(xc, xr, X1(xc,xr)) + ChiR2 = ChiR(xc, xr, X2(xc,xr)) + ChiR3 = ChiR(xc, xr, X3(xc,xr)) + + Mc = Mc + Quad(ChiL1*ChiL1, ChiL2*ChiL2, ChiL3*ChiL3, xc, xr) + Mr = Mr + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xc, xr) + + end if + + + ! insert mass matrix entries into CSR matrix structure + + ! u row + Mrowptrs(idx(ix,1)+1) = nz + if (left) then + nz = nz+1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix-1,1) + end if + nz = nz+1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix,1) + if (right) then + nz = nz+1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix+1,1) + end if + + ! v row + Mrowptrs(idx(ix,2)+1) = nz + if (left) then + nz = nz+1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix-1,2) + end if + nz = nz+1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix,2) + if (right) then + nz = nz+1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix+1,2) + end if + + ! w row + Mrowptrs(idx(ix,3)+1) = nz + if (left) then + nz = nz+1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix-1,3) + end if + nz = nz+1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix,3) + if (right) then + nz = nz+1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix+1,3) + end if + + end do + + ! signal end of data in CSR matrix + Mrowptrs(idx(Nint,3)+2) = nz + + ! return success + ierr = 0 + return + + end function Mass + ! ---------------------------------------------------------------- + +end module bruss1D_ode_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use bruss1D_ode_mod ! custom problem-specification module + use farkode_mod ! Fortran interface to the ARKODE module + use farkode_arkstep_mod ! Fortran interface to the ARKStep module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_sparse_mod ! Fortran interface to sparse SUNMatrix + use fsunlinsol_klu_mod ! Fortran interface to dense SUNLinearSolver + use Bruss1DFEMKLU_UserData ! Declarations and indexing + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: ctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tend ! final time + real(c_double) :: rtol, atol ! relative and absolute tolerance + real(c_double) :: dtout ! output time interval + real(c_double) :: tout ! output time + real(c_double) :: tcur(1) ! current time + real(c_double) :: pi, h, z ! constants and variables to help with mesh + integer(c_int) :: time_dep ! time dependence parameter + integer(c_int) :: ierr ! error flag from C functions + integer(c_int) :: nout ! number of outputs + integer(c_int) :: outstep ! output loop counter + integer(c_int) :: sparsetype ! CSR signal, here + integer(c_long) :: mxsteps ! max num steps + integer :: i + + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_v ! sundials vector + type(N_Vector), pointer :: sunvec_w ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials (linsol) matrix + type(SUNMatrix), pointer :: sunmat_M ! sundials (mass) matrix + type(SUNLinearSolver), pointer :: sunls_A ! sundials linear solver + type(SUNLinearSolver), pointer :: sunls_M ! sundials linear solver + type(c_ptr) :: arkode_mem ! ARKODE memory + type(c_ptr) :: outstr ! standard output file stream + real(c_double), pointer, dimension(neqreal,N) :: yvec(:,:) ! underlying vector y + real(c_double), pointer, dimension(neqreal,N) :: umask(:,:) ! identifier for u + real(c_double), pointer, dimension(neqreal,N) :: vmask(:,:) ! identifier for v + real(c_double), pointer, dimension(neqreal,N) :: wmask(:,:) ! identifier for w + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, ctx) + + ! initialize ODE + tstart = 0.0d0 + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = (tend - tstart)/10.d0 + nout = ceiling(tend/dtout) + + ! create and assign SUNDIALS N_Vectors + sunvec_y => FN_VNew_Serial(int(neq,c_long), ctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + yvec(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_y) + + sunvec_u => FN_VNew_Serial(int(neq,c_long), ctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + umask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_u) + + sunvec_v => FN_VNew_Serial(int(neq,c_long), ctx) + if (.not. associated(sunvec_v)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + vmask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_v) + + sunvec_w => FN_VNew_Serial(int(neq,c_long), ctx) + if (.not. associated(sunvec_w)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + wmask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_w) + + ! set up spatial mesh; this [arbitrarily] clusters + ! more intervals near the end points of the interval + pi = 4.d0*atan(1.d0) + h = 10.d0/(N - 1) + do i=1,N + z = -5.d0 + h*(i - 1) + x(i) = 0.5d0/atan(5.d0)*atan(z) + 0.5d0 + end do + + ! output mesh to disk + open(200, file='bruss_FEM_mesh.txt') + do i=1,N + write(200,*) x(i) + end do + close(200) + + ! set initial conditions into yvec + do i=1,N + yvec(1,i) = a + 0.1d0*sin(pi*x(i)) ! u0 + yvec(2,i) = b/a + 0.1d0*sin(pi*x(i)) ! v0 + yvec(3,i) = b + 0.1d0*sin(pi*x(i)) ! w0 + end do + + ! set mask values for each solution component + umask = 0.d0 + vmask = 0.d0 + wmask = 0.d0 + do i=1,N + umask(1,i) = 1.d0 + vmask(2,i) = 1.d0 + wmask(3,i) = 1.d0 + end do + + ! create ARKStep memory + arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(ImpRhsFn), tstart, sunvec_y, ctx) + if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + + ! Tell ARKODE to use a sparse linear solver for both Newton and mass matrix systems. + sparsetype = 1 + sunmat_A => FSUNSparseMatrix(int(neq,c_long), int(neq,c_long), int(nnz,c_long), sparsetype, ctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat_A = NULL' + stop 1 + end if + + sunmat_M => FSUNSparseMatrix(int(neq,c_long), int(neq,c_long), int(nnz,c_long), sparsetype, ctx) + if (.not. associated(sunmat_M)) then + print *, 'ERROR: sunmat_M = NULL' + stop 1 + end if + + sunls_A => FSUNLinSol_KLU(sunvec_y, sunmat_A, ctx) + if (.not. associated(sunls_A)) then + print *, 'ERROR: sunls_A = NULL' + stop 1 + end if + + ierr = FARKStepSetLinearSolver(arkode_mem, sunls_A, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FARKStepSetLinearSolver' + stop 1 + end if + + ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) + if (ierr /= 0) then + print *, 'Error in FARKStepSetJacFn' + stop 1 + end if + + sunls_M => FSUNLinSol_KLU(sunvec_y, sunmat_M, ctx) + if (.not. associated(sunls_M)) then + print *, 'ERROR: sunls_M = NULL' + stop 1 + end if + + time_dep = 0 + ierr = FARKStepSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) + if (ierr /= 0) then + print *, 'Error in FARKStepSetMassLinearSolver' + stop 1 + end if + + ierr = FARKStepSetMassFn(arkode_mem, c_funloc(Mass)) + if (ierr /= 0) then + print *, 'Error in FARKStepSetMassFn' + stop 1 + end if + + ! set relative and absolute tolerances + rtol = 1.0d-6 + atol = 1.0d-11 + + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ! set residual tolerance with the same atol as above + ierr = FARKStepResStolerance(arkode_mem, atol) + if (ierr /= 0) then + print *, 'Error in FARKStepResStolerance, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Set maximum number of internal time steps + mxsteps = 1000 + ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + if (ierr /= 0) then + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 + end if + + ! Open output stream for results + open(501, file='bruss_FEM_u.txt') + open(502, file='bruss_FEM_v.txt') + open(503, file='bruss_FEM_w.txt') + + ! output initial condition to disk + write(501,*) ( yvec(1,i), i=1,N ) + write(502,*) ( yvec(2,i), i=1,N ) + write(503,*) ( yvec(3,i), i=1,N ) + + ! output solver parameters to screen + ierr = FSUNDIALSFileOpen('stdout', 'w', outstr) + if (ierr /= 0) then + print *, 'Error in FSUNDIALSFileOpen' + stop 1 + end if + ierr = FARKStepWriteParameters(arkode_mem, outstr) + if (ierr /= 0) then + print *, 'Error in FARKStepWriteParameters' + stop 1 + end if + ierr = FSUNDIALSFileClose(outstr) + if (ierr /= 0) then + print *, 'Error in FSUNDIALSFileClose' + stop 1 + end if + + ! Start time stepping + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t ||u||_rms ||v||_rms ||w||_rms' + print *, ' ----------------------------------------------------' + print '(3x,4(es12.5,1x))', tcur, sqrt(sum(yvec*yvec*umask)/N), & + sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) + do outstep = 1,nout + + ! set the next output time + tout = min(tout + dtout, tend) + + ierr = FARKStepSetStopTime(arkode_mem, tout) + if (ierr /= 0) then + print *, 'Error in FARKStepSetStopTime, ierr = ', ierr, '; halting' + stop 1 + end if + + ! call ARKStep + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr < 0) then + print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ! output current solution information (using yvec) + print '(3x,4(es12.5,1x))', Tcur, sqrt(sum(yvec*yvec*umask)/N), & + sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) + write(501,*) ( yvec(1,i), i=1,N ) + write(502,*) ( yvec(2,i), i=1,N ) + write(503,*) ( yvec(3,i), i=1,N ) + + end do + print *, ' ----------------------------------------------------' + close(501) + close(502) + close(503) + + ! diagnostics output + call ARKStepStats(arkode_mem) + + ! clean up + call FARKStepFree(arkode_mem) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_v) + call FN_VDestroy(sunvec_w) + call FSUNMatDestroy(sunmat_A) + call FSUNMatDestroy(sunmat_M) + ierr = FSUNLinSolFree(sunls_A) + ierr = FSUNLinSolFree(sunls_M) + ierr = FSUNContext_Free(ctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! ARKStepStats +! +! Print ARKODE statstics to stdandard out +! ---------------------------------------------------------------- +subroutine ARKStepStats(arkode_mem) + + !======= Inclusions =========== + use iso_c_binding + use farkode_mod + use farkode_arkstep_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: arkode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nst_a(1) ! num steps attempted + integer(c_long) :: nfe(1) ! num explicit function evals + integer(c_long) :: nfi(1) ! num implicit function evals + integer(c_long) :: nlinsetups(1) ! num linear solver setups + integer(c_long) :: netfails(1) ! num error test fails + + real(c_double) :: hlast(1) ! last step size + real(c_double) :: hcur(1) ! step size for next step + real(c_double) :: tcur(1) ! internal time reached + + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + integer(c_long) :: nmassevals(1) ! number of Mass matrix evaluations + + !======= Internals ============ + + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetLastStep(arkode_mem, hlast) + if (ierr /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetCurrentStep(arkode_mem, hcur) + if (ierr /= 0) then + print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetCurrentTime(arkode_mem, tcur) + if (ierr /= 0) then + print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumMassSetups(arkode_mem, nmassevals) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumMassSetups, retval = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a + print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe + print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi + print '(4x,A,i9)' ,'Total jac function calls =',njacevals + print '(4x,A,i9)' ,'Total mass function calls =',nmassevals + print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,es12.5)','Last internal step size =',hlast + print '(4x,A,es12.5)','Next internal step size =',hcur + print '(4x,A,es12.5)','Current internal time =',tcur + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine ARKStepStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.out b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.out new file mode 100644 index 0000000000..5d33259b20 --- /dev/null +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.out @@ -0,0 +1,73 @@ +ARKODE solver parameters: + Solver relative tolerance = 1e-06 + Solver absolute tolerance = 9.999999999999999e-12 + Absolute residual tolerance = 9.999999999999999e-12 + + Maximum step increase (first step) = 10000 + Step reduction factor on multiple error fails = 0.3 + Minimum error fails before above factor is used = 2 + Step reduction factor on nonlinear convergence failure = 0.25 + Explicit safety factor = 0.5 + Safety factor = 0.96 + Growth factor = 20 + Step growth lower bound = 1 + Step growth upper bound = 1.5 + Default explicit stability function +Soderlind SUNAdaptController module: + k1 = 0.58 + k2 = -0.21 + k3 = 0.1 + k4 = 0 + k5 = 0 + bias factor = 1.5 + previous error = 1 + previous-previous error = 1 + previous step = 1 + previous-previous step = 1 + firststeps = 0 + Maximum number of error test failures = 7 + Maximum number of convergence test failures = 10 +ARKStep time step module parameters: + Method order 4 + Implicit integrator + Implicit predictor method = 0 + Implicit solver tolerance coefficient = 0.1 + Maximum number of nonlinear corrections = 3 + Nonlinear convergence rate constant = 0.3 + Nonlinear divergence tolerance = 2.3 + Gamma factor LSetup tolerance = 0.2 + Number of steps between LSetup calls = 20 + + + Finished initialization, starting time steps + + t ||u||_rms ||v||_rms ||w||_rms + ---------------------------------------------------- + 0.00000E+00 6.32978E-01 3.36571E+00 2.03247E+00 + 1.00000E+00 6.97284E-01 3.23962E+00 1.99999E+00 + 2.00000E+00 7.89499E-01 3.05139E+00 1.99999E+00 + 3.00000E+00 7.83680E-01 2.93001E+00 1.99999E+00 + 4.00000E+00 6.48123E-01 3.00833E+00 1.99999E+00 + 5.00000E+00 5.52224E-01 3.17028E+00 1.99999E+00 + 6.00000E+00 5.22112E-01 3.30889E+00 1.99999E+00 + 7.00000E+00 5.20869E-01 3.40614E+00 1.99999E+00 + 8.00000E+00 5.30276E-01 3.46669E+00 1.99999E+00 + 9.00000E+00 5.45196E-01 3.49456E+00 1.99999E+00 + 1.00000E+01 5.65426E-01 3.49094E+00 1.99999E+00 + ---------------------------------------------------- + + General Solver Stats: + Total internal steps taken = 103 + Total internal steps attempts = 103 + Total rhs exp function calls = 0 + Total rhs imp function calls = 1733 + Total jac function calls = 11 + Total mass function calls = 1 + Num lin solver setup calls = 49 + Num error test failures = 0 + Last internal step size = 1.79674E-02 + Next internal step size = 1.79674E-02 + Current internal time = 1.00000E+01 + Num nonlinear solver iters = 1215 + Num nonlinear solver fails = 10 + diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 new file mode 100644 index 0000000000..cdf1ebdb0b --- /dev/null +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -0,0 +1,526 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! The following test simulates a brusselator problem from chemical +! kinetics. This is an ODE system with 3 components, Y = [u,v,w], +! satisfying the equations, +! du/dt = a - (w+1)*u + v*u^2 +! dv/dt = w*u - v*u^2 +! dw/dt = (b-w)/ep - w*u +! for t in the interval [0.0, 10.0], with initial conditions +! Y0 = [u0,v0,w0]. We use the initial conditions and parameters +! u0=3.9, v0=1.1, w0=2.8, a=1.2, b=2.5, ep=1.0e-5 +! Here, all three solution components exhibit a rapid transient +! change during the first 0.2 time units, followed by a slow and +! smooth evolution. +! +! This program solves a the Fortran ODE test problem using the +! FARKODE interface for the ARKODE ODE solver module. +! +! This program uses the IMEX ARK solver; here the +! implicit systems are solved with a modified Newton iteration +! with the SUNDENSE linear solver. The Jacobian routine and +! right-hand side routines are supplied. +! +! Output is printed 10 times throughout the defined time interval. +! Run statistics (optional outputs) are printed at the end. +! ------------------------------------------------------------------ + +module bruss_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! number of equations + integer(c_long), parameter :: neq = 3 + + ! ODE parameters + real(c_double), parameter, dimension(neq) :: y0 = (/ 3.9d0, 1.1d0, 2.8d0 /) + real(c_double), parameter :: a = 1.2d0 + real(c_double), parameter :: b = 2.5d0 + real(c_double), parameter :: ep = 1.d-5 + +contains + + ! ---------------------------------------------------------------- + ! ExpRhsFn provides the right hand side explicit function for the + ! ODE: dy1/dt = f1(t,y1,y2,y3) + ! dy2/dt = f2(t,y1,y2,y3) + ! dy3/dt = f3(t,y1,y2,y3) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function ExpRhsFn(tn, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + real(c_double) :: u, v, w + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yvec(:) + real(c_double), pointer, dimension(neq) :: fvec(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yvec => FN_VGetArrayPointer(sunvec_y) + fvec => FN_VGetArrayPointer(sunvec_f) + + ! set temporary values + u = yvec(1) + v = yvec(2) + w = yvec(3) + + ! fill RHS vector + fvec(1) = a - (w + 1.d0)*u + v*u*u + fvec(2) = w*u - v*u*u + fvec(3) = -w*u + + ! return success + ierr = 0 + return + + end function ExpRhsFn + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! ImpRhsFn provides the right hand side implicit function for the + ! ODE: dy1/dt = f1(t,y1,y2,y3) + ! dy2/dt = f2(t,y1,y2,y3) + ! dy3/dt = f3(t,y1,y2,y3) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + real(c_double) :: u, v, w + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yvec(:) + real(c_double), pointer, dimension(neq) :: fvec(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yvec => FN_VGetArrayPointer(sunvec_y) + fvec => FN_VGetArrayPointer(sunvec_f) + + ! set temporary values + u = yvec(1) + v = yvec(2) + w = yvec(3) + + ! fill RHS vector + fvec(1) = 0.d0 + fvec(2) = 0.d0 + fvec(3) = (b-w)/ep + + ! return success + ierr = 0 + return + + end function ImpRhsFn + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Jac: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Jac') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1:3, 1:3) = 0.d0 + J(3,3) = -1.d0/ep + + ! return success + ierr = 0 + return + + end function Jac + ! ---------------------------------------------------------------- + +end module bruss_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use farkode_mod ! Fortran interface to the ARKODE module + use farkode_arkstep_mod ! Fortran interface to the ARKStep module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver + use bruss_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: sunctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tend ! final time + real(c_double) :: rtol, atol ! relative and absolute tolerance + 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 + + real(c_double), parameter :: nlscoef = 1.d-2 ! non-linear solver coefficient + integer(c_int), parameter :: order = 3 ! method order + + 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, dimension(neq) :: yvec(:) ! underlying vector + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize ODE + tstart = 0.0d0 + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = 1.0d0 + nout = ceiling(tend/dtout) + + ! create SUNDIALS N_Vector + sunvec_y => FN_VNew_Serial(neq, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + yvec => FN_VGetArrayPointer(sunvec_y) + + ! initialize solution vector + yvec = y0 + + ! create ARKStep memory + arkode_mem = FARKStepCreate(c_funloc(ExpRhsFn), c_funloc(ImpRhsFn), tstart, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + + ! Tell ARKODE to use a dense linear solver with user-supplied Jacobian function. + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + sunls => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + stop 1 + end if + + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FARKStepSetLinearSolver' + stop 1 + end if + + ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) + if (ierr /= 0) then + print *, 'Error in FARKStepSetJacFn' + stop 1 + end if + + ! set relative and absolute tolerances + rtol = 1.0d-6 + atol = 1.0d-10 + + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Set additional method parameters + ierr = FARKStepSetOrder(arkode_mem, order) + if (ierr /= 0) then + print *, 'Error in FARKStepSetOrder' + stop 1 + end if + + ierr = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + if (ierr /= 0) then + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 + end if + + imethod = 0 + idefault = 1 + pq = 0 + adapt_params = 0.d0 + ierr = FARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) + if (ierr /= 0) then + print *, 'Error in FARKStepSetAdaptivityMethod, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Open output stream for results, output comment line + open(100, file='solution.txt') + write(100,*) '# t u v w' + + ! output initial condition to disk + write(100,'(3x,4(es23.16,1x))') tstart, yvec + + ! Start time stepping + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t u v w ' + print *, ' ---------------------------------------------------' + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + do outstep = 1,nout + + ! call ARKStepEvolve + tout = min(tout + dtout, tend) + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + stop 1 + endif + + ! output current solution + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + write(100,'(3x,4(es23.16,1x))') tcur, yvec(1), yvec(2), yvec(3) + + enddo + print *, ' ----------------------------------------------------' + close(100) + + ! diagnostics output + call ARKStepStats(arkode_mem) + + ! clean up + call FARKStepFree(arkode_mem) + call FN_VDestroy(sunvec_y) + call FSUNMatDestroy(sunmat_A) + ierr = FSUNLinSolFree(sunls) + ierr = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! ARKStepStats +! +! Print ARKODE statstics to stdandard out +! ---------------------------------------------------------------- +subroutine ARKStepStats(arkode_mem) + + !======= Inclusions =========== + use iso_c_binding + use farkode_mod + use farkode_arkstep_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: arkode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nst_a(1) ! num steps attempted + integer(c_long) :: nfe(1) ! num explicit function evals + integer(c_long) :: nfi(1) ! num implicit function evals + integer(c_long) :: nlinsetups(1) ! num linear solver setups + integer(c_long) :: netfails(1) ! num error test fails + + real(c_double) :: hinused(1) ! initial step size + real(c_double) :: hlast(1) ! last step size + real(c_double) :: hcur(1) ! step size for next step + real(c_double) :: tcur(1) ! internal time reached + + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + + !======= Internals ============ + + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetActualInitStep(arkode_mem, hinused) + if (ierr /= 0) then + print *, 'Error in FARKStepGetActualInitStep, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetLastStep(arkode_mem, hlast) + if (ierr /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetCurrentStep(arkode_mem, hcur) + if (ierr /= 0) then + print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetCurrentTime(arkode_mem, tcur) + if (ierr /= 0) then + print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a + print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe + print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi + print '(4x,A,i9)' ,'Total jac function calls =',njacevals + print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,es12.5)','First internal step size =',hinused + print '(4x,A,es12.5)','Last internal step size =',hlast + print '(4x,A,es12.5)','Next internal step size =',hcur + print '(4x,A,es12.5)','Current internal time =',tcur + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine ARKStepStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.out b/examples/arkode/F2003_serial/ark_bruss_f2003.out new file mode 100644 index 0000000000..ca8828b461 --- /dev/null +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.out @@ -0,0 +1,33 @@ + + Finished initialization, starting time steps + + t u v w + --------------------------------------------------- + 0.00000E+00 3.90000E+00 1.10000E+00 2.80000E+00 + 1.00000E+00 2.07527E+00 1.05960E+00 2.50484E+00 + 2.00000E+00 1.10046E+00 1.72361E+00 2.50655E+00 + 3.00000E+00 7.89620E-01 2.32667E+00 2.50298E+00 + 4.00000E+00 8.11773E-01 2.72558E+00 2.48752E+00 + 5.00000E+00 1.18700E+00 2.59554E+00 2.48729E+00 + 6.00000E+00 1.88731E+00 1.49410E+00 2.51530E+00 + 7.00000E+00 1.32327E+00 1.61902E+00 2.50135E+00 + 8.00000E+00 9.21787E-01 2.13022E+00 2.50268E+00 + 9.00000E+00 8.49542E-01 2.53948E+00 2.45131E+00 + 1.00000E+01 1.06497E+00 2.59596E+00 2.47069E+00 + ---------------------------------------------------- + + General Solver Stats: + Total internal steps taken = 905 + Total internal steps attempts = 934 + Total rhs exp function calls = 3710 + Total rhs imp function calls = 7500 + Total jac function calls = 28 + Num lin solver setup calls = 158 + Num error test failures = 29 + First internal step size = 2.84252E-08 + Last internal step size = 2.07420E-02 + Next internal step size = 2.07420E-02 + Current internal time = 1.00030E+01 + Num nonlinear solver iters = 3790 + Num nonlinear solver fails = 17 + diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 new file mode 100644 index 0000000000..2f8fdd3aa8 --- /dev/null +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -0,0 +1,541 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! FARKODE Example Problem: 2D kinetics-transport, +! precond. Krylov solver. +! +! An ODE system is generated from the following 2-species diurnal +! kinetics advection-diffusion PDE system in 2 space dimensions: +! +! dc(i)/dt = Kh*(d/dx)**2 c(i) + V*dc(i)/dx + (d/dy)(Kv(y)*dc(i)/dy) +! + Ri(c1,c2,t) for i = 1,2, where +! R1(c1,c2,t) = -q1*c1*c3 - q2*c1*c2 + 2*q3(t)*c3 + q4(t)*c2 , +! R2(c1,c2,t) = q1*c1*c3 - q2*c1*c2 - q4(t)*c2 , +! Kv(y) = Kv0*exp(y/5) , +! Kh, V, Kv0, q1, q2, and c3 are constants, and q3(t) and q4(t) +! vary diurnally. +! +! The problem is posed on the square +! 0 <= x <= 20, 30 <= y <= 50 (all in km), +! with homogeneous Neumann boundary conditions, and for time t in +! 0 <= t <= 86400 sec (1 day). +! +! The PDE system is treated by central differences on a uniform +! 10 x 10 mesh, with simple polynomial initial profiles. +! The problem is solved with ARKODE, with the DIRK/GMRES method and +! using the FARKBP banded preconditioner. +! +! Note that this problem should only work with SUNDIALS configured +! to use 'realtype' as 'double' and 'sunindextype' as '64bit' +! +! The second and third dimensions of U here must match the values of +! MX and MY, for consistency with the output statements below. +! ------------------------------------------------------------------ + +module DiurnalKryBP_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! setup and number of equations + integer(c_int), parameter :: mx = 10, my = 10 + integer(c_long), parameter :: mm = mx*my + integer(c_long), parameter :: neq = 2*mm + + ! ODE constant parameters + real(c_double), parameter :: Kh = 4.0d-6 + real(c_double), parameter :: Vel = 0.001d0 + real(c_double), parameter :: Kv0 = 1.0d-8 + real(c_double), parameter :: q1 = 1.63d-16 + real(c_double), parameter :: q2 = 4.66d-16 + real(c_double), parameter :: c3 = 3.7d16 + real(c_double), parameter :: pi = 3.1415926535898d0 + real(c_double), parameter :: halft = 4.32d4 + real(c_double), parameter :: om = pi/halft + real(c_double), parameter :: dx = 20.0d0/(mx - 1.0d0) + real(c_double), parameter :: dy = 20.0d0/(my - 1.0d0) + real(c_double), parameter :: hdco = Kh/(dx**2) + real(c_double), parameter :: haco = Vel/(2.0d0*dx) + real(c_double), parameter :: vdco = (1.0d0/(dy**2))*Kv0 + real(c_double), parameter :: a3 = 22.62d0 + real(c_double), parameter :: a4 = 7.601d0 + + ! Solving assistance fixed parameters + real(c_double), parameter :: twohr = 7200.0D0 + real(c_double), parameter :: rtol = 1.0d-5 + real(c_double), parameter :: floor = 100.0d0 + real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: atol = rtol*floor + integer(c_int), parameter :: Jpretype = 1 + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: maxL = 0 + integer(c_long), parameter :: mxsteps = 10000 + + ! ODE non-constant parameters + real(c_double) :: q3 + real(c_double) :: q4 + real(c_double) :: c1 + real(c_double) :: c2 + integer(c_int) :: jx, jy + +contains + + ! ---------------------------------------------------------------- + ! ImpRhsFn provides the right hand side implicit function for the + ! ODE: dy1/dt = f1(t,y1,y2,y3) + ! dy2/dt = f2(t,y1,y2,y3) + ! dy3/dt = f3(t,y1,y2,y3) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function ImpRhsFn(tn, sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C,name='ImpRhsFn') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + integer(c_int) :: jleft, jright, jdn, jup + real(c_double) :: c1dn, c2dn, c1up, c2up, c1lt, c2lt + real(c_double) :: c1rt, c2rt, cydn, cyup, hord1, hord2, horad1 + real(c_double) :: horad2, qq1, qq2, qq3, qq4, rkin1, rkin2, s + real(c_double) :: vertd1, vertd2, ydn, yup + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(2,mx,my) :: uvecI(:,:,:) + real(c_double), pointer, dimension(2,mx,my) :: fvecI(:,:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + fvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + + ! Set diurnal rate coefficients. + s = sin(om * tn) + if (s > 0.0d0) then + q3 = exp(-a3 / s) + q4 = exp(-a4 / s) + else + q3 = 0.0d0 + q4 = 0.0d0 + end if + + ! Loop over all grid points. + do jy = 1, my + ydn = 30.0d0 + (jy - 1.5d0) * dy + yup = ydn + dy + cydn = vdco * exp(0.2d0 * ydn) + cyup = vdco * exp(0.2d0 * yup) + jdn = jy-1 + if (jy == 1) jdn = my + jup = jy+1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvecI(1,jx,jy) + c2 = uvecI(2,jx,jy) + ! Set kinetic rate terms. + qq1 = q1 * c1 * c3 + qq2 = q2 * c1 * c2 + qq3 = q3 * c3 + qq4 = q4 * c2 + rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvecI(1,jx,jdn) + c2dn = uvecI(2,jx,jdn) + c1up = uvecI(1,jx,jup) + c2up = uvecI(2,jx,jup) + vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) + vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx-1 + if (jx == 1) jleft = mx + jright = jx+1 + if (jx == mx) jright = 1 + c1lt = uvecI(1,jleft,jy) + c2lt = uvecI(2,jleft,jy) + c1rt = uvecI(1,jright,jy) + c2rt = uvecI(2,jright,jy) + hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) + hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) + horad1 = haco * (c1rt - c1lt) + horad2 = haco * (c2rt - c2lt) + ! load all terms into fvecI. + fvecI(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 + fvecI(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 + end do + end do + + ! return success + ierr = 0 + return + + end function ImpRhsFn + ! ---------------------------------------------------------------- + +end module DiurnalKryBP_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use farkode_mod ! Fortran interface to the ARKODE module + use farkode_arkstep_mod ! Fortran interface to the ARKStep module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use DiurnalKryBP_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: ctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tout ! output time + real(c_double) :: tcur(1) ! current time + real(c_double) :: cx, cy ! initialization variables + integer(c_int) :: ierr ! error flag from C functions + integer(c_long) :: outstep ! output step + integer(c_long) :: mu, ml ! band preconditioner constants + real(c_double) :: x, y ! initialization index variables + + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(c_ptr) :: arkode_mem ! ARKODE memory + real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + + ! output statistic variables + integer(c_long) :: lnst(1), lnst_att(1) + real(c_double) :: lh(1) + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, ctx) + + ! initialize ODE + tstart = 0.0d0 + tcur = tstart + + ! create SUNDIALS N_Vectors + sunvec_u => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + + sunvec_f => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_f)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + + ! initialize and fill initial condition vector + do jy = 1,my + y = 30.0d0 + (jy - 1.0d0) * dy + cy = (0.1d0 * (y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0 * cy**2 + do jx = 1,mx + x = (jx - 1.0d0) * dx + cx = (0.1d0 * (x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0 * cx**2 + uvec(1,jx,jy) = 1.0d6 * cx * cy + uvec(2,jx,jy) = 1.0d12 * cx * cy + end do + end do + + ! create ARKStep memory + arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(ImpRhsFn), tstart, sunvec_u, ctx) + if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + + ! Tell ARKODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + stop 1 + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FARKStepSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (ierr /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, ierr = ', ierr, '; halting' + stop 1 + end if + + mu = 2 + ml = 2 + ierr = FARKBandPrecInit(arkode_mem, neq, mu, ml) + if (ierr /= 0) then + print *, 'Error in FARKBandPrecInit, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Set additional method parameters + ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + if (ierr /= 0) then + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 + end if + + ! Start time stepping + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t c1 (bottom left middle top right) | lnst lnst_att lh' + print *, ' t c2 (bottom left middle top right) | lnst lnst_att lh' + print *, ' ----------------------------------------------------------------------------------------' + tout = twohr + do outstep = 1,12 + + ! call ARKStep + ierr = FARKStepEvolve(arkode_mem, tout, sunvec_u, tcur, ARK_NORMAL) + if (ierr /= 0) then + print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ! get some solver statistics + ierr = FARKStepGetNumSteps(arkode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumStepAttempts(arkode_mem, lnst_att) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetCurrentStep(arkode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FARKStepGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lnst_att, lh + print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) + + ! update tout + tout = tout + twohr + + end do + print *, ' ----------------------------------------------------------------------------------------' + + ! diagnostics output + call ARKStepStats(arkode_mem) + + ! clean up + call FARKStepFree(arkode_mem) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_f) + ierr = FSUNLinSolFree(sunls) + ierr = FSUNContext_Free(ctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! ARKStepStats +! +! Print ARKODE statstics to standard out +! ---------------------------------------------------------------- +subroutine ARKStepStats(arkode_mem) + + !======= Inclusions =========== + use iso_c_binding + use farkode_mod + use farkode_arkstep_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: arkode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nst_a(1) ! num steps attempted + integer(c_long) :: nfe(1) ! num explicit function evals + integer(c_long) :: nfi(1) ! num implicit function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: npe(1) ! num preconditioner evals + integer(c_long) :: nps(1) ! num preconditioner solves + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nliters(1) ! linear solver iterations + integer(c_long) :: ncf(1) ! num convergence failures nonlinear + integer(c_long) :: ncfl(1) ! num convergence failures linear + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + integer(c_long) :: nfebp(1) ! num f evaluations + real(c_double) :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer(c_long) :: lenrwbp(1) ! band preconditioner real/int workspace size + integer(c_long) :: leniwbp(1) + + !======= Internals ============ + + ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumPrecEvals(arkode_mem, npe) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumPrecSolves(arkode_mem, nps) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumLinIters(arkode_mem, nliters) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 + end if + + avdim = dble(nliters)/dble(nniters) + + ierr = FARKStepGetNumLinConvFails(arkode_mem, ncfl) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncf) + if (ierr /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) + if (ierr /= 0) then + print *, 'Error in FARKStepGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + if (ierr /= 0) then + print *, 'Error in FARKStepGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKBandPrecGetWorkSpace(arkode_mem, lenrwbp, leniwbp) + if (ierr /= 0) then + print *, 'Error in FARKBandPrecGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKBandPrecGetNumRhsEvals(arkode_mem, nfebp) + if (ierr /= 0) then + print *, 'Error in FARKBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a + print '(4x,A,i9)' ,'Total rhs exp function call =',nfe + print '(4x,A,i9)' ,'Total rhs imp function call =',nfi + print '(4x,A,i9)' ,'Total num preconditioner evals =',npe + print '(4x,A,i9)' ,'Total num preconditioner solves =',nps + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num linear solver iters =',nliters + print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim + print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf + print '(4x,A,i9)' ,'Num linear solver fails =',ncfl + print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw + print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls + print '(4x,A,2(i9,3x))' ,'ARKBandPre real/int workspace sizes =',lenrwbp,leniwbp + print '(4x,A,i9)' ,'ARKBandPre number of f evaluations =',nfebp + print *, ' ' + + return + +end subroutine ARKStepStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out new file mode 100644 index 0000000000..4bc5495c61 --- /dev/null +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out @@ -0,0 +1,50 @@ + + Finished initialization, starting time steps + + t c1 (bottom left middle top right) | lnst lnst_att lh + t c2 (bottom left middle top right) | lnst lnst_att lh + ---------------------------------------------------------------------------------------- + 7.200000E+03 1.839613E+04 3.009247E+04 1.582872E+04 990 994 3.027601E+00 + 4.440310E+11 7.263637E+11 3.820591E+11 + 1.440000E+04 1.149716E+07 1.249098E+07 1.329954E+07 2780 2784 1.022085E+01 + 4.473684E+11 4.862283E+11 5.178450E+11 + 2.160000E+04 2.525270E+07 7.837587E+07 3.018990E+07 3325 3329 1.467507E+01 + 2.824256E+11 9.233209E+11 3.419869E+11 + 2.880000E+04 1.189287E+07 2.395791E+07 1.042605E+07 3816 3820 1.467507E+01 + 4.627840E+11 9.345089E+11 4.054359E+11 + 3.600000E+04 2.342948E+04 2.291472E+04 2.522324E+04 4629 4633 4.334128E+00 + 5.651673E+11 5.527495E+11 6.084385E+11 + 4.320000E+04 1.194709E-04 5.892092E-05 -1.674879E-04 5635 5639 6.277419E+02 + 3.689222E+11 8.238330E+11 4.623703E+11 + 5.040000E+04 -8.456488E-06 -9.187620E-06 3.659273E-05 5647 5651 6.277419E+02 + 3.862510E+11 1.017897E+12 3.536889E+11 + 5.760000E+04 -1.301882E-05 -3.846503E-06 5.896852E-06 5658 5662 6.277419E+02 + 5.832932E+11 6.187928E+11 5.788981E+11 + 6.480000E+04 3.467015E-05 1.276786E-05 -3.337236E-05 5670 5674 6.277419E+02 + 4.274401E+11 6.788806E+11 5.386844E+11 + 7.200000E+04 -7.456958E-06 8.227805E-17 3.511631E-10 5681 5685 6.277419E+02 + 3.453624E+11 1.030182E+12 3.448304E+11 + 7.920000E+04 -1.368994E-06 2.401515E-15 -7.272100E-13 5693 5697 6.277419E+02 + 5.450919E+11 7.330919E+11 5.109883E+11 + 8.640000E+04 8.946777E-06 2.191861E-15 1.700622E-10 5704 5708 6.277419E+02 + 5.090704E+11 5.755864E+11 5.984224E+11 + ---------------------------------------------------------------------------------------- + + General Solver Stats: + Total internal steps taken = 5704 + Total internal steps attempts = 5708 + Total rhs exp function call = 0 + Total rhs imp function call = 59357 + Total num preconditioner evals = 96 + Total num preconditioner solves = 89026 + Num error test failures = 4 + Num nonlinear solver iters = 30814 + Num linear solver iters = 59967 + Avg Krylov subspace dim = 1.946096E+00 + Num nonlinear solver fails = 0 + Num linear solver fails = 0 + main solver real/int workspace sizes = 3702 133 + linear solver real/int workspace sizes = 2455 42 + ARKBandPre real/int workspace sizes = 2800 622 + ARKBandPre number of f evaluations = 480 + diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index 23a92487f9..b925a5ab76 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -69,9 +69,9 @@ ! This program solves the problem with the MRI stepper. Outputs are ! printed at equal intervals of 0.1 and run statistics are printed ! at the end. -!-------------------------------------------------------------------- +! ------------------------------------------------------------------- -module ode_mod +module kpr_mod use, intrinsic :: iso_c_binding use fsundials_core_mod @@ -119,14 +119,14 @@ integer(c_int) function ff(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: ydotarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: ydotarr(:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(yvec) @@ -148,7 +148,8 @@ integer(c_int) function ff(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function ff + ! ---------------------------------------------------------------- ! fs routine to compute the slow portion of the ODE RHS. integer(c_int) function fs(t, yvec, ydotvec, user_data) & @@ -159,14 +160,14 @@ integer(c_int) function fs(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: ydotarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: ydotarr(:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(yvec) @@ -188,7 +189,8 @@ integer(c_int) function fs(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function fs + ! ---------------------------------------------------------------- ! fse routine to compute the slow portion of the ODE RHS. integer(c_int) function fse(t, yvec, ydotvec, user_data) & @@ -199,13 +201,13 @@ integer(c_int) function fse(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data real(c_double) :: u, v - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: ydotarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: ydotarr(:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(yvec) @@ -225,7 +227,8 @@ integer(c_int) function fse(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function fse + ! ---------------------------------------------------------------- ! fsi routine to compute the slow portion of the ODE RHS.(currently same as fse) integer(c_int) function fsi(t, yvec, ydotvec, user_data) & @@ -236,14 +239,14 @@ integer(c_int) function fsi(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: ydotarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: ydotarr(:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(yvec) @@ -265,7 +268,8 @@ integer(c_int) function fsi(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function fsi + ! ---------------------------------------------------------------- integer(c_int) function fn(t, yvec, ydotvec, user_data) & result(ierr) bind(C) @@ -275,14 +279,14 @@ integer(c_int) function fn(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: ydotarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: ydotarr(:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(yvec) @@ -304,7 +308,8 @@ integer(c_int) function fn(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function fn + ! ---------------------------------------------------------------- integer(c_int) function f0(t, yvec, ydotvec, user_data) & result(ierr) bind(C) @@ -314,9 +319,9 @@ integer(c_int) function f0(t, yvec, ydotvec, user_data) & implicit none real(c_double), value :: t - type(N_Vector) :: yvec - type(N_Vector) :: ydotvec - type(c_ptr) :: user_data + type(N_Vector) :: yvec + type(N_Vector) :: ydotvec + type(c_ptr), value :: user_data call FN_VConst(ZERO, ydotvec) @@ -324,7 +329,8 @@ integer(c_int) function f0(t, yvec, ydotvec, user_data) & ierr = 0 return - end function + end function f0 + ! ---------------------------------------------------------------- ! ! Jacobian functions @@ -336,22 +342,22 @@ integer(c_int) function Js(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & use, intrinsic :: iso_c_binding implicit none - real(c_double), value :: t - type(N_Vector) :: y - type(N_Vector) :: fy - type(SUNMatrix) :: J - type(c_ptr) :: user_data - type(N_Vector) :: tmp1, tmp2, tmp3 + real(c_double), value :: t + type(N_Vector) :: y + type(N_Vector) :: fy + type(SUNMatrix) :: J + type(c_ptr), value :: user_data + type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: Jarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -360,16 +366,17 @@ integer(c_int) function Js(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (w*(1+r(t))-rdot(t))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] ! [ 0 0 ] - Jarr(1) = G/TWO + (G*(ONE+r(t))-rdot(t))/(2*u*u) - Jarr(2) = ZERO - Jarr(3) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(4) = ZERO + Jarr(1,1) = G/TWO + (G*(ONE+r(t))-rdot(t))/(2*u*u) + Jarr(2,1) = ZERO + Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) + Jarr(2,2) = ZERO ! return success ierr = 0 return - end function + end function Js + ! ---------------------------------------------------------------- integer(c_int) function Jsi(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & result(ierr) bind(C) @@ -378,21 +385,21 @@ integer(c_int) function Jsi(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & implicit none real(c_double), value :: t - type(N_Vector) :: y - type(N_Vector) :: fy - type(SUNMatrix) :: J - type(c_ptr) :: user_data - type(N_Vector) :: tmp1, tmp2, tmp3 + type(N_Vector) :: y + type(N_Vector) :: fy + type(SUNMatrix) :: J + type(c_ptr), value :: user_data + type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: Jarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) ! get N_Vector data array yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -401,16 +408,17 @@ integer(c_int) function Jsi(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (G*(1+r(t)))/(2*u^2) e/2+e*(2+s(t))/(2*v^2)] ! [ 0 0 ] - Jarr(1) = G/TWO + (G*(ONE+r(t)))/(2*u*u) - Jarr(2) = ZERO - Jarr(3) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(4) = ZERO + Jarr(1,1) = G/TWO + (G*(ONE+r(t)))/(2*u*u) + Jarr(2,1) = ZERO + Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) + Jarr(2,2) = ZERO ! return success ierr = 0 return - end function + end function Jsi + ! ---------------------------------------------------------------- integer(c_int) function Jn(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & result(ierr) bind(C) @@ -418,22 +426,22 @@ integer(c_int) function Jn(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & use, intrinsic :: iso_c_binding implicit none - real(c_double), value :: t - type(N_Vector) :: y - type(N_Vector) :: fy - type(SUNMatrix) :: J - type(c_ptr) :: user_data - type(N_Vector) :: tmp1, tmp2, tmp3 + real(c_double), value :: t + type(N_Vector) :: y + type(N_Vector) :: fy + type(SUNMatrix) :: J + type(c_ptr), value :: user_data + type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v - real(c_double), pointer :: yarr(:) - real(c_double), pointer :: Jarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) + real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) ! get N_Vector data array yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -442,16 +450,17 @@ integer(c_int) function Jn(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (G*(1+r(t))-rdot(t))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] ! [e/2 + e*(1+r(t))/(2*u^2) -1/2 - (2+s(t))/(2*v^2)] - Jarr(1) = G/TWO + (G*(1+r(t))-rdot(t))/(TWO*u*u) - Jarr(2) = e/TWO + e*(ONE+r(t))/(TWO*u*u) - Jarr(3) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(4) = -ONE/TWO - (TWO+s(t))/(TWO*v*v) + Jarr(1,1) = G/TWO + (G*(1+r(t))-rdot(t))/(TWO*u*u) + Jarr(2,1) = e/TWO + e*(ONE+r(t))/(TWO*u*u) + Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) + Jarr(2,2) = -ONE/TWO - (TWO+s(t))/(TWO*v*v) ! return success ierr = 0 return - end function + end function Jn + ! ---------------------------------------------------------------- ! Helper functions real(c_double) function r(t) & @@ -464,7 +473,8 @@ real(c_double) function r(t) & result = 0.5d0*cos(t) return - end function + end function r + ! ---------------------------------------------------------------- real(c_double) function s(t) & result(result) @@ -477,7 +487,8 @@ real(c_double) function s(t) & result = cos(w*t) return - end function + end function s + ! ---------------------------------------------------------------- real(c_double) function rdot(t) & result(result) @@ -490,7 +501,8 @@ real(c_double) function rdot(t) & result = -0.5d0*sin(t) return - end function + end function rdot + ! ---------------------------------------------------------------- real(c_double) function sdot(t) & result(result) @@ -503,7 +515,8 @@ real(c_double) function sdot(t) & result = -w*sin(w*t) return - end function + end function sdot + ! ---------------------------------------------------------------- real(c_double) function utrue(t) & result(result) @@ -516,7 +529,8 @@ real(c_double) function utrue(t) & result = sqrt(ONE+r(t)) return - end function + end function utrue + ! ---------------------------------------------------------------- real(c_double) function vtrue(t) & result(result) @@ -529,7 +543,8 @@ real(c_double) function vtrue(t) & result = sqrt(TWO+s(t)) return - end function + end function vtrue + ! ---------------------------------------------------------------- integer(c_int) function Ytrue(t, y) & result(ierr) @@ -540,7 +555,7 @@ integer(c_int) function Ytrue(t, y) & real(c_double), value :: t type(N_Vector) :: y - real(c_double), pointer :: yarr(:) + real(c_double), pointer, dimension(NEQ) :: yarr(:) yarr => FN_VGetArrayPointer(y) @@ -550,31 +565,37 @@ integer(c_int) function Ytrue(t, y) & ierr = 0 return - end function + end function Ytrue + ! ---------------------------------------------------------------- + +end module kpr_mod +! ------------------------------------------------------------------ -end module +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ program main - use ode_mod + use kpr_mod implicit none ! general problem variables - type(c_ptr) sunctx ! SUNDIALS simulation context - integer(c_int) :: retval ! reusable error-checking flag - type(N_Vector), pointer :: y ! vector for the solution - real(c_double), pointer :: yarr(:) ! array of data for y vector - type(c_ptr) :: arkode_mem ! ARKODE memory structure - type(c_ptr) :: inner_arkode_mem ! ARKODE memory structure - type(c_ptr) :: inner_stepper ! inner stepper - type(c_ptr) :: BTf, BTs ! fast/slow method Butcher table - type(c_ptr) :: SC ! slow coupling coefficients - type(SUNMatrix), pointer :: MATf ! matrix for fast solver - type(SUNLinearSolver), pointer :: LSf ! fast linear solver object - type(SUNMatrix), pointer :: MATs ! matrix for slow solver - type(SUNLinearSolver), pointer :: LSs ! slow linear solver object - integer(c_int) :: solve_type = 0 ! problem configuration type + type(c_ptr) sunctx ! SUNDIALS simulation context + integer(c_int) :: retval ! reusable error-checking flag + type(N_Vector), pointer :: y ! vector for the solution + real(c_double), pointer, dimension(NEQ) :: yarr(:) ! array of data for y vector + type(c_ptr) :: arkode_mem ! ARKODE memory structure + type(c_ptr) :: inner_arkode_mem ! ARKODE memory structure + type(c_ptr) :: inner_stepper ! inner stepper + type(c_ptr) :: BTf, BTs ! fast/slow method Butcher table + type(c_ptr) :: SC ! slow coupling coefficients + type(SUNMatrix), pointer :: MATf ! matrix for fast solver + type(SUNLinearSolver), pointer :: LSf ! fast linear solver object + type(SUNMatrix), pointer :: MATs ! matrix for slow solver + type(SUNLinearSolver), pointer :: LSs ! slow linear solver object + integer(c_int) :: solve_type = 0 ! problem configuration type logical :: implicit_slow logical :: imex_slow = .FALSE. real(c_double) :: hf, gamma, beta, t, tret(1), tout @@ -1100,7 +1121,8 @@ program main call FMRIStepFree(arkode_mem) ! Free slow integrator memory retval = FSUNContext_Free(sunctx) ! Free context -end program +end program main +! ---------------------------------------------------------------- subroutine check_retval(retval, name) use, intrinsic :: iso_c_binding @@ -1112,4 +1134,5 @@ subroutine check_retval(retval, name) write(*,'(A,A,A)') 'ERROR: ', name,' returned nonzero' stop 1 end if -end subroutine +end subroutine check_retval +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 new file mode 100644 index 0000000000..e9f0d6cc4d --- /dev/null +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -0,0 +1,654 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for ARKODE, due to Robertson, +! is from chemical kinetics, and consists of the following three +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1e-4 or at which +! y3 = 0.01. +! +! The problem is solved with ARKODE using the LAPACK DENSE linear +! solver, with a user-supplied Jacobian. Output is printed at +! t = .4, 4, 40, ..., 4e10. +! ------------------------------------------------------------------ + +module dnsL_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_long), parameter :: neq = 3 + integer(c_long), parameter :: nout = 12 + +contains + + ! ---------------------------------------------------------------- + ! fcnirob: The implicit RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnirob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnirob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(tn, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 0.0001d0 + gout(2) = yval(3) - 0.01d0 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The ODE Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! residual N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1,1) = -0.04d0 + J(2,1) = 0.04d0 + J(3,1) = 0.d0 + J(1,2) = 1.d4*yval(3) + J(2,2) = -1.d4*yval(3) - 6.0d7*yval(2) + J(3,2) = 6.d7*yval(2) + J(1,3) = 1.d4*yval(2) + J(2,3) = -1.d4*yval(2) + J(3,3) = 0.d0 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module dnsL_mod +! ------------------------------------------------------------------ + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use farkode_mod ! Fortran interface to ARKODE + use farkode_arkstep_mod ! Fortran interface to the ARKStep module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_lapackdense_mod ! Fortran interface to LAPACK SUNLinearSolver + use fsunnonlinsol_newton_mod ! Fortran interface to Newton SUNNonlinearSolver + use dnsL_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout1, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_f ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(SUNNonLinearSolver), pointer :: sunnonlin_NLS ! sundials nonlinear solver + type(c_ptr) :: arkode_mem ! ARKODE memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the dnsL_mod module + real(c_double) :: yval(neq), fval(neq), avtol(neq), dkyval(neq) + + ! fine-tuning initialized here + real(c_double) :: initsize, nlscoef + integer(c_long) :: mxsteps + integer(c_int) :: nliters, pmethod, maxetf + + !======= Internals ============ + + ! create the SUNDIALS context + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + fval = 0.d0 + rtol = 1.d-4 + avtol(1) = 1.d-8 + avtol(2) = 1.d-11 + avtol(3) = 1.d-8 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_f => FN_VMake_Serial(neq, fval, sunctx) + if (.not. associated(sunvec_f)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set integration limits + t0 = 0.d0 + tout1 = 0.4d0 + + call PrintHeader(rtol, avtol, yval) + + ! Call FARKStepCreate to initialize ARKODE memory + arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' + + ! Call FARKStepSVtolerances to set tolerances + retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FARKStepRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FARKStepRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create dense SUNMatrix for use in linear solves + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create dense SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_LapackDense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + ! Set additional method parameters + mxsteps = 10000 + retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 + end if + + initsize = 1.d-4 * rtol + retval = FARKStepSetInitStep(arkode_mem, initsize) + if (retval /= 0) then + print *, 'Error in FARKStepSetInitStep' + stop 1 + end if + + nlscoef = 1.d-7 + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + if (retval /= 0) then + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 + end if + + nliters = 8 + retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxNonlinIters' + stop 1 + end if + + pmethod = 1 + retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) + if (retval /= 0) then + print *, 'Error in FARKStepSetPredictorMethod' + stop 1 + end if + + maxetf = 20 + retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxErrTestFails' + stop 1 + end if + + ! Create Newton SUNNonlinearSolver object. ARKODE uses a + ! Newton SUNNonlinearSolver by default, so it is not necessary + ! to create it and attach it. It is done in this example code + ! solely for demonstration purposes. + sunnonlin_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) + if (.not. associated(sunnonlin_NLS)) then + print *, 'ERROR: sunnonlinsol = NULL' + stop 1 + end if + + ! Attach the nonlinear solver + retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) + if (retval /= 0) then + print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call ARKStepEvolve, print results, and test for error. + iout = 0 + tout = tout1 + do while(iout < nout) + + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' + stop 1 + endif + + call PrintOutput(arkode_mem, tret(1), yval) + + if (retval .eq. ARK_ROOT_RETURN) then + retvalr = FARKStepGetRootInfo(arkode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FARKStepGetRootInfo, retval = ', retval, '; halting' + stop 1 + endif + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. ARK_SUCCESS) then + iout = iout + 1 + tout = tout * 10.d0 + end if + end do + + ! find and print derivative at tret(1) + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in ARKStepGetDky' + stop 1 + end if + print *, " " + print *, "------------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "------------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + ! diagnostics output + call PrintFinalStats(arkode_mem) + + ! free memory + call FARKStepFree(arkode_mem) + retval = FSUNNonlinSolFree(sunnonlin_NLS) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use dnsL_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq) + + !======= Internals ============ + + print *, " " + print *, "ark_roberts_dnsL_f2003.f90: Robertson ARK ODE serial example problem for ARKODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: LAPACK DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print *, "Constraints not used." + print *, " " + print *, "----------------------------------------------------------------------" + print *, " t y1 y2 y3 | nst h" + print *, "----------------------------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(arkode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use farkode_mod + use farkode_arkstep_mod + use dnsL_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: arkode_mem + real(c_double) :: t, y(neq) + + ! internal variables + integer(c_int) :: retval + integer(c_long) :: nst(1) + real(c_double) :: hused(1) + + !======= Internals ============ + + retval = FARKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetLastStep(arkode_mem, hused) + if (retval /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 + end if + + print '(es12.4,1x,3(es12.4,1x),a,i3,2x,es12.4)', & + t, y(1), y(2), y(3), "| ", nst, hused(1) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print ARKSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(arkode_mem) + + !======= Inclusions =========== + use iso_c_binding + use farkode_mod + use farkode_arkstep_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: arkode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nst_a(1) ! num steps attempted + integer(c_long) :: nfe(1) ! num explicit function evals + integer(c_long) :: nfi(1) ! num implicit function evals + integer(c_long) :: nlinsetups(1) ! num linear solver setups + integer(c_long) :: netfails(1) ! num error test fails + + real(c_double) :: hinused(1) ! initial step size + real(c_double) :: hlast(1) ! last step size + real(c_double) :: hcur(1) ! step size for next step + real(c_double) :: tcur(1) ! internal time reached + + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + + !======= Internals ============ + + retval = FARKStepGetNumSteps(arkode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetActualInitStep(arkode_mem, hinused) + if (retval /= 0) then + print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetLastStep(arkode_mem, hlast) + if (retval /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetCurrentStep(arkode_mem, hcur) + if (retval /= 0) then + print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetCurrentTime(arkode_mem, tcur) + if (retval /= 0) then + print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a + print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe + print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,es12.5)','First internal step size =',hinused + print '(4x,A,es12.5)','Last internal step size =',hlast + print '(4x,A,es12.5)','Next internal step size =',hcur + print '(4x,A,es12.5)','Current internal time =',tcur + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.out b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.out new file mode 100644 index 0000000000..6a9f8895cf --- /dev/null +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.out @@ -0,0 +1,49 @@ + + ark_roberts_dnsL_f2003.f90: Robertson ARK ODE serial example problem for ARKODE + Three equation chemical kinetics problem. + + Linear solver: LAPACK DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-08 1.E-11 1.E-08 +Initial conditions y0 = ( 1.00 0.00 0.00 ) + Constraints not used. + + ---------------------------------------------------------------------- + t y1 y2 y3 | nst h + ---------------------------------------------------------------------- + 2.6402E-01 9.8997E-01 3.4706E-05 1.0000E-02 | 31 4.4841E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8517E-01 3.3864E-05 1.4794E-02 | 34 4.4841E-02 + 4.0000E+00 9.0552E-01 2.2405E-05 9.4459E-02 | 87 1.0144E-01 + 4.0000E+01 7.1583E-01 9.1856E-06 2.8416E-01 | 217 7.7919E-01 + 4.0000E+02 4.5052E-01 3.2229E-06 5.4948E-01 | 356 6.0414E+00 + 4.0000E+03 1.8320E-01 8.9423E-07 8.1680E-01 | 445 1.1101E+02 + 4.0000E+04 3.8983E-02 1.6218E-07 9.6102E-01 | 526 1.5172E+03 + 4.0000E+05 4.9383E-03 1.9850E-08 9.9506E-01 | 636 1.9756E+04 + 4.0000E+06 5.1681E-04 2.0697E-09 9.9948E-01 | 684 4.5207E+05 + 2.0796E+07 1.0000E-04 3.9890E-10 9.9990E-01 | 698 1.9815E+06 + rootsfound[] = -1 0 + 4.0000E+07 5.2031E-05 2.0772E-10 9.9995E-01 | 706 4.6796E+06 + 4.0000E+08 5.2076E-06 2.0797E-11 9.9999E-01 | 723 9.4158E+07 + 4.0000E+09 5.2075E-07 3.2084E-12 1.0000E+00 | 745 1.0086E+09 + 4.0000E+10 5.2091E-08 2.6736E-13 1.0000E+00 | 763 6.5712E+09 + + ------------------------------------------------------ + Final y1' y2' y3' + ------------------------------------------------------ + -1.3017E-18 -3.7935E-22 1.3021E-18 + + General Solver Stats: + Total internal steps taken = 763 + Total internal steps attempts = 828 + Total rhs exp function calls = 0 + Total rhs imp function calls = 25799 + Total Jacobian function calls = 59 + Num lin solver setup calls = 250 + Num error test failures = 56 + First internal step size = 1.00000E-08 + Last internal step size = 6.57116E+09 + Next internal step size = 6.57116E+09 + Current internal time = 4.01503E+10 + Num nonlinear solver iters = 21678 + Num nonlinear solver fails = 52 + diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 new file mode 100644 index 0000000000..2cad00ef0d --- /dev/null +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -0,0 +1,657 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for ARKODE, due to Robertson, +! is from chemical kinetics, and consists of the following three +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1e-4 or at which +! y3 = 0.01. +! +! The problem is solved with ARKODE using the DENSE linear +! solver, with a user-supplied Jacobian. Output is printed at +! t = .4, 4, 40, ..., 4e10. +! ------------------------------------------------------------------ + +module dns_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_long), parameter :: neq = 3 + integer(c_long), parameter :: nout = 12 + +contains + + ! ---------------------------------------------------------------- + ! fcnirob: The implicit RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnirob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnirob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(tn, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fnvector_serial_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 0.0001d0 + gout(2) = yval(3) - 0.01d0 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The ODE Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fnvector_serial_mod + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! residual N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1,1) = -0.04d0 + J(2,1) = 0.04d0 + J(3,1) = 0.d0 + J(1,2) = 1.d4*yval(3) + J(2,2) = -1.d4*yval(3) - 6.0d7*yval(2) + J(3,2) = 6.d7*yval(2) + J(1,3) = 1.d4*yval(2) + J(2,3) = -1.d4*yval(2) + J(3,3) = 0.d0 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module dns_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use farkode_mod ! Fortran interface to ARKODE + use farkode_arkstep_mod ! Fortran interface to the ARKStep module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver + use fsunnonlinsol_newton_mod ! Fortran interface to Newton SUNNonlinearSolver + use dns_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout1, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_f ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(SUNNonLinearSolver), pointer :: sunnonlin_NLS ! sundials nonlinear solver + type(c_ptr) :: arkode_mem ! ARKODE memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the dns_mod module + real(c_double) :: yval(neq), fval(neq), avtol(neq), dkyval(neq) + + ! fine-tuning initialized here + real(c_double) :: initsize, nlscoef + integer(c_long) :: mxsteps + integer(c_int) :: nliters, pmethod, maxetf + + !======= Internals ============ + + ! create the SUNDIALS context + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + fval = 0.d0 + rtol = 1.d-4 + avtol(1) = 1.d-8 + avtol(2) = 1.d-11 + avtol(3) = 1.d-8 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_f => FN_VMake_Serial(neq, fval, sunctx) + if (.not. associated(sunvec_f)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set integration limits + t0 = 0.d0 + tout1 = 0.4d0 + + call PrintHeader(rtol, avtol, yval) + + ! Call FARKStepCreate to initialize ARKODE memory + arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' + + ! Call FARKStepSVtolerances to set tolerances + retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FARKStepRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FARKStepRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create dense SUNMatrix for use in linear solves + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create dense SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + ! Set additional method parameters + mxsteps = 10000 + retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxNumSteps' + stop 1 + end if + + initsize = 1.d-4 * rtol + retval = FARKStepSetInitStep(arkode_mem, initsize) + if (retval /= 0) then + print *, 'Error in FARKStepSetInitStep' + stop 1 + end if + + nlscoef = 1.d-7 + retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + if (retval /= 0) then + print *, 'Error in FARKStepSetNonlinConvCoef' + stop 1 + end if + + nliters = 8 + retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxNonlinIters' + stop 1 + end if + + pmethod = 1 + retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) + if (retval /= 0) then + print *, 'Error in FARKStepSetPredictorMethod' + stop 1 + end if + + maxetf = 20 + retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) + if (retval /= 0) then + print *, 'Error in FARKStepSetMaxErrTestFails' + stop 1 + end if + + ! Create Newton SUNNonlinearSolver object. ARKODE uses a + ! Newton SUNNonlinearSolver by default, so it is not necessary + ! to create it and attach it. It is done in this example code + ! solely for demonstration purposes. + sunnonlin_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) + if (.not. associated(sunnonlin_NLS)) then + print *, 'ERROR: sunnonlinsol = NULL' + stop 1 + end if + + ! Attach the nonlinear solver + retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) + if (retval /= 0) then + print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call ARKStepEvolve, print results, and test for error. + iout = 0 + tout = tout1 + do while(iout < nout) + + retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' + stop 1 + endif + + call PrintOutput(arkode_mem, tret(1), yval) + + if (retval .eq. ARK_ROOT_RETURN) then + retvalr = FARKStepGetRootInfo(arkode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FARKStepGetRootInfo, retval = ', retval, '; halting' + stop 1 + endif + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. ARK_SUCCESS) then + iout = iout + 1 + tout = tout * 10.d0 + end if + end do + + ! find and print derivative at tret(1) + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in ARKStepGetDky' + stop 1 + end if + print *, " " + print *, "------------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "------------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + ! diagnostics output + call PrintFinalStats(arkode_mem) + + ! free memory + call FARKStepFree(arkode_mem) + retval = FSUNNonlinSolFree(sunnonlin_NLS) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use dns_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq) + + !======= Internals ============ + + print *, " " + print *, "ark_roberts_dns_f2003.f90: Robertson ARK ODE serial example problem for ARKODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print *, "Constraints not used." + print *, " " + print *, "----------------------------------------------------------------------" + print *, " t y1 y2 y3 | nst h" + print *, "----------------------------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(arkode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use farkode_mod + use farkode_arkstep_mod + use dns_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: arkode_mem + real(c_double) :: t, y(neq) + + ! internal variables + integer(c_int) :: retval + integer(c_long) :: nst(1) + real(c_double) :: hused(1) + + !======= Internals ============ + + retval = FARKStepGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetLastStep(arkode_mem, hused) + if (retval /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 + end if + + print '(es12.4,1x,3(es12.4,1x),a,i3,2x,es12.4)', & + t, y(1), y(2), y(3), "| ", nst, hused(1) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print ARKStep statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(arkode_mem) + + !======= Inclusions =========== + use iso_c_binding + use farkode_mod + use farkode_arkstep_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: arkode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nst_a(1) ! num steps attempted + integer(c_long) :: nfe(1) ! num explicit function evals + integer(c_long) :: nfi(1) ! num implicit function evals + integer(c_long) :: nlinsetups(1) ! num linear solver setups + integer(c_long) :: netfails(1) ! num error test fails + + real(c_double) :: hinused(1) ! initial step size + real(c_double) :: hlast(1) ! last step size + real(c_double) :: hcur(1) ! step size for next step + real(c_double) :: tcur(1) ! internal time reached + + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + + !======= Internals ============ + + retval = FARKStepGetNumSteps(arkode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumStepAttempts, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetActualInitStep(arkode_mem, hinused) + if (retval /= 0) then + print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetLastStep(arkode_mem, hlast) + if (retval /= 0) then + print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetCurrentStep(arkode_mem, hcur) + if (retval /= 0) then + print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetCurrentTime(arkode_mem, tcur) + if (retval /= 0) then + print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FARKStepGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a + print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe + print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,es12.5)','First internal step size =',hinused + print '(4x,A,es12.5)','Last internal step size =',hlast + print '(4x,A,es12.5)','Next internal step size =',hcur + print '(4x,A,es12.5)','Current internal time =',tcur + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.out b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.out new file mode 100644 index 0000000000..94280bc886 --- /dev/null +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.out @@ -0,0 +1,49 @@ + + ark_roberts_dns_f2003.f90: Robertson ARK ODE serial example problem for ARKODE + Three equation chemical kinetics problem. + + Linear solver: DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-08 1.E-11 1.E-08 +Initial conditions y0 = ( 1.00 0.00 0.00 ) + Constraints not used. + + ---------------------------------------------------------------------- + t y1 y2 y3 | nst h + ---------------------------------------------------------------------- + 2.6402E-01 9.8997E-01 3.4706E-05 1.0000E-02 | 31 4.4841E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8517E-01 3.3864E-05 1.4794E-02 | 34 4.4841E-02 + 4.0000E+00 9.0552E-01 2.2405E-05 9.4459E-02 | 87 1.0144E-01 + 4.0000E+01 7.1583E-01 9.1856E-06 2.8416E-01 | 217 7.7919E-01 + 4.0000E+02 4.5052E-01 3.2229E-06 5.4948E-01 | 356 6.0414E+00 + 4.0000E+03 1.8320E-01 8.9423E-07 8.1680E-01 | 445 1.1101E+02 + 4.0000E+04 3.8983E-02 1.6218E-07 9.6102E-01 | 526 1.5172E+03 + 4.0000E+05 4.9383E-03 1.9849E-08 9.9506E-01 | 622 3.2703E+04 + 4.0000E+06 5.1679E-04 2.0689E-09 9.9948E-01 | 668 6.7110E+05 + 2.0796E+07 1.0000E-04 3.9998E-10 9.9990E-01 | 681 2.5236E+06 + rootsfound[] = -1 0 + 4.0000E+07 5.2028E-05 2.0644E-10 9.9995E-01 | 685 7.2040E+06 + 4.0000E+08 5.2075E-06 2.0694E-11 9.9999E-01 | 699 9.3020E+07 + 4.0000E+09 5.2087E-07 2.2947E-12 1.0000E+00 | 714 4.1703E+08 + 4.0000E+10 5.2085E-08 2.0139E-13 1.0000E+00 | 747 4.5921E+09 + + ------------------------------------------------------ + Final y1' y2' y3' + ------------------------------------------------------ + -1.3023E-18 -3.1154E-23 1.3023E-18 + + General Solver Stats: + Total internal steps taken = 747 + Total internal steps attempts = 807 + Total rhs exp function calls = 0 + Total rhs imp function calls = 25557 + Total Jacobian function calls = 61 + Num lin solver setup calls = 239 + Num error test failures = 45 + First internal step size = 1.00000E-08 + Last internal step size = 4.59208E+09 + Next internal step size = 4.59208E+09 + Current internal time = 4.43176E+10 + Num nonlinear solver iters = 21568 + Num nonlinear solver fails = 56 + diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index ca1cc591a8..30eb91a532 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -77,6 +77,7 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) + add_subdirectory(F2003_parallel) endif() # CUDA examples diff --git a/examples/cvode/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt new file mode 100644 index 0000000000..c2b894d375 --- /dev/null +++ b/examples/cvode/F2003_parallel/CMakeLists.txt @@ -0,0 +1,150 @@ +# --------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# modified by Daniel M. Margolis @ 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the CVode F2003 module parallel examples +# --------------------------------------------------------------- + +# Example lists are tuples "name\;nodes\;tasks\;type" where the +# type is develop for examples excluded from 'make test' in releases +if(MPI_ENABLED) + set(FCVODE_examples + "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "cv_diag_kry_f2003\;\;1\;4\;develop\;2" + "cv_diag_non_p_f2003\;\;1\;4\;develop\;2") +endif() + +# Specify libraries to link against +set(CVODE_LIBS + sundials_cvode + sundials_fcvode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod) + +# Set-up linker flags and link libraries +set(SUNDIALS_LIBS ${CVODE_LIBS} ${EXE_EXTRA_LINK_LIBS}) + +# Add the build and install targets for each example +foreach(example_tuple ${FCVODE_examples}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 number_of_nodes) + list(GET example_tuple 3 number_of_tasks) + list(GET example_tuple 4 example_type) + list(GET example_tuple 5 example_precision) + + if(NOT TARGET ${example}) + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + + # example source files + add_executable(${example} ${example}.f90) + + # libraries to link against + target_link_libraries(${example} MPI::MPI_Fortran ${SUNDIALS_LIBS}) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + endif() + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example}) + else() + string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test(${test_name} ${example} + TEST_ARGS ${example_args} + MPI_NPROCS ${number_of_tasks} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + EXAMPLE_TYPE ${example_type} + FLOAT_PRECISION ${example_precision}) + + # find all .out files for this example + file(GLOB example_out ${example}*.out) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example_out} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + endif() + +endforeach(example_tuple ${FCVODE_examples}) + + +# create Makfile and CMakeLists.txt for examples +if(EXAMPLES_INSTALL) + + # Install the extra files + foreach(extrafile ${CVODE_extras}) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + endforeach() + + # Prepare substitution variables for Makefile and/or CMakeLists templates + set(SOLVER "CVODE") + + # Makefile: convert semi-colon separated target list to space separated string + list2string(CVODE_LIBS EXAMPLE_LIBS) + + # CMakeLists: replace sundials_ prefix and convert to space separted string + list(TRANSFORM CVODE_LIBS REPLACE "sundials_" "SUNDIALS::" + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) + + examples2string(FCVODE_examples EXAMPLES) + + # Regardless of the platform we're on, we will generate and install + # CMakeLists.txt file for building the examples. This file can then + # be used as a template for the user's own programs. + + # generate CMakelists.txt in the binary directory + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt + @ONLY + ) + + # install CMakelists.txt + install( + FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel + ) + + # On UNIX-type platforms, we also generate and install a makefile for + # building the examples. This makefile can then be used as a template + # for the user's own programs. + + if(UNIX) + # generate Makefile and place it in the binary dir + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex + @ONLY + ) + # install the configured Makefile_ex as Makefile + install( + FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel + RENAME Makefile + ) + endif() + + # add test_install target + sundials_add_test_install(cvode F2003_parallel) + +endif() diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 new file mode 100644 index 0000000000..6bec77fed7 --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -0,0 +1,512 @@ +!----------------------------------------------------------------- +! Programmer(s): Daniel M. Margolis @ SMU +! modified from previous ARKODE examples +!----------------------------------------------------------------- +! 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 +!----------------------------------------------------------------- +! Example problem: +! +! Diagonal ODE example. Stiff case, with diagonal preconditioner. +! Uses FCVODE interfaces and FCVBBD interfaces. +! Solves problem twice -- with left and right preconditioning. +! +!----------------------------------------------------------------- + +module DiagkrybbdData + !--------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + !--------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 + integer(c_long), parameter :: nlocal = 10 + integer(c_long) :: neq, mu, ml, mudq, mldq + integer(c_int) :: iPretype + real(c_double) :: alpha + + contains + + + + !----------------------------------------------------------------- + ! ODE RHS function f(t,y) (implicit). + !----------------------------------------------------------------- + integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr) :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer :: y(:) + real(c_double), pointer :: ydot(:) + + ! local data + integer :: i + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Fill ydot with rhs function + do i = 1,nlocal + ydot(i) = -alpha * (myid * nlocal + i) * y(i) + end do + + retval = 0 ! Return with success + return + end function firhs + !----------------------------------------------------------------- + + !----------------------------------------------------------------- + ! ODE RHS function used for BBD preconditioner. + !----------------------------------------------------------------- + integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + integer(c_long) :: nnlocal ! local space + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_g ! output g N_Vector + type(c_ptr) :: user_data ! user-defined data + + ! local data + integer :: ierr + + ierr = firhs(t, sunvec_y, sunvec_g, user_data) + if (ierr /= 0) then + write(0,*) "Error in firhs user-defined function, ierr = ", ierr + stop 1 + end if + + retval = 0 ! Return with success + return + end function LocalgFn + !----------------------------------------------------------------- + + end module DiagkrybbdData + !----------------------------------------------------------------- + + + !----------------------------------------------------------------- + ! Main driver program + !----------------------------------------------------------------- + program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use fsundials_futils_mod ! Fortran utilities + use fcvode_mod ! Access CVode + use fsundials_types_mod ! sundials defined types + use fsundials_matrix_mod ! Fortran interface to generic SUNMatrix + use fsundials_nvector_mod ! Access generic N_Vector + use fnvector_parallel_mod ! Access parallel N_Vector + use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use fsundials_context_mod ! Access sundials context + + use DiagkrybbdData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer :: y(:) ! vector data + type(c_ptr) :: cvode_mem ! CVODE memory + integer(c_long) :: N, Ntot + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nfe(1) ! number of RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: ncfn(1) ! number of nonlinear convergence fails + integer(c_long) :: ncfl(1) ! number of linear convergence fails + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + integer(c_long) :: ngebbd(1) ! num g evaluations + double precision :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer(c_long) :: lenrwbbd(1) ! band preconditioner real/int workspace size + integer(c_long) :: leniwbbd(1) + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "Diagonal test problem:"; + write(6,'(A,i4)') " neq = " , neq + write(6,'(A,i4)') " nlocal = " , nlocal + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,es9.2)') " alpha = ", alpha + write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write(6,*) " Method is BDF/NEWTON/SPGMR" + write(6,*) " Precond is band-block-diagonal, using CVBBDPRE" + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create the CVode timestepper module + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) then + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) + if (retval /= 0) then + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Tell CVODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FCVodeSStolerances(cvode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + mu = 0 + ml = 0 + mudq = 0 + mldq = 0 + retval = FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & + c_funloc(LocalgFn), c_null_ptr) + if (retval /= 0) then + print *, "Error: FCVBBDPrecInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + do iPretype = 1,2 + + if (iPretype == 2) then + + y = 1.d0 + + retval = FCVodeReInit(cvode_mem, t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FCVodeReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVBBDPrecReInit(cvode_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error in FCVBBDPrecReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + if (outproc) write(6,*) " Preconditioning on right:" + + end if + + if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" + + ! Main time-stepping loop: calls CVode to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0+dTout + if (outproc) then + write(6,*) " t steps fe" + write(6,*) " --------------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write(6,'(3x,f10.6,3(3x,i6))') t, nst, nfe + tout = min(tout + dTout, Tf) + + end do + if (outproc) then + write(6,*) " --------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1,nlocal + erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecEvals(cvode_mem, npre) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinIters(cvode_mem, nli) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + avdim = dble(nli) / dble(nni) + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FCVodeGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FCVodeGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbd, leniwbbd) + if (retval /= 0) then + print *, "Error: FCVBBDPrecGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVBBDPrecGetNumGfnEvals(cvode_mem, ngebbd) + if (retval /= 0) then + print *, "Error: FCVBBDPrecGetNumGfnEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(A,i6)') " Internal solver steps = ", nst + write(6,'(A,i6)') " Total RHS evals = ", nfe + write(6,'(A,i6)') " Total preconditioner setups = ", npre + write(6,'(A,i6)') " Total preconditioner solves = ", npsol + write(6,'(A,i6)') " Total nonlinear iterations = ", nni + write(6,'(A,i6)') " Total linear iterations = ", nli + write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write(6,'(A,i6)') " - Linear = ", ncfl + write(6,'(A,i6)') " Total number of error test failures = ", netf + write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write(6,'(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd + write(6,'(A,i6)') " Total number of g evals = ", ngebbd + write(6,'(A)') " " + write(6,'(A)') " " + write(6,'(A)') " " + end if + end do + + ! Clean up and return with successful completion + call FCVodeFree(cvode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + + end program driver + !----------------------------------------------------------------- diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.out b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.out new file mode 100644 index 0000000000..5df8a6eb7f --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.out @@ -0,0 +1,80 @@ + + Diagonal test problem: + neq = 40 + nlocal = 10 + nprocs = 4 + rtol = 1.00E-05 + atol = 1.00E-10 + alpha = 1.00E+01 + ydot_i = -alpha*i * y_i (i = 1,...,neq) + Method is BDF/NEWTON/SPGMR + Precond is band-block-diagonal, using CVBBDPRE + + Preconditioning on left: + t steps fe + -------------------------------- + 0.100000 221 261 + 0.200000 265 307 + 0.300000 290 333 + 0.400000 306 350 + 0.500000 319 364 + 0.600000 329 374 + 0.700000 339 385 + 0.800000 345 391 + 0.900000 352 398 + 1.000000 359 405 + -------------------------------- +Max. absolute error is 2.83E-09 + + Final Solver Statistics: + Internal solver steps = 359 + Total RHS evals = 405 + Total preconditioner setups = 7 + Total preconditioner solves = 728 + Total nonlinear iterations = 402 + Total linear iterations = 364 + Average Krylov subspace dimension = 0.9055 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 5 + Main solver real/int workspace sizes = 609 144 + Linear solver real/int workspace sizes = 534 126 + BBD preconditioner real/int workspace sizes = 160 72 + Total number of g evals = 14 + + + + Preconditioning on right: + t steps fe + -------------------------------- + 0.100000 221 261 + 0.200000 265 307 + 0.300000 290 333 + 0.400000 306 350 + 0.500000 319 364 + 0.600000 329 374 + 0.700000 339 385 + 0.800000 345 391 + 0.900000 352 398 + 1.000000 359 405 + -------------------------------- +Max. absolute error is 2.83E-09 + + Final Solver Statistics: + Internal solver steps = 359 + Total RHS evals = 405 + Total preconditioner setups = 7 + Total preconditioner solves = 728 + Total nonlinear iterations = 402 + Total linear iterations = 364 + Average Krylov subspace dimension = 0.9055 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 5 + Main solver real/int workspace sizes = 609 144 + Linear solver real/int workspace sizes = 534 126 + BBD preconditioner real/int workspace sizes = 160 72 + Total number of g evals = 14 + + + diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 new file mode 100644 index 0000000000..1d657e245f --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -0,0 +1,507 @@ +! ---------------------------------------------------------------- +! Programmer(s): Daniel M. Margolis @ SMU +! modified from previous ARKODE examples +! ---------------------------------------------------------------- +! 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 +! ---------------------------------------------------------------- +! Example problem: +! +! Diagonal ODE example. Stiff case, with BDF/SPGMR, diagonal +! preconditioner. Solved with preconditioning on left, then with +! preconditioning on right. +! +! ---------------------------------------------------------------- + +module DiagkryData + ! -------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + ! -------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 + integer(c_long), parameter :: nlocal = 10 + integer(c_long) :: neq + integer(c_int) :: iPretype + real(c_double) :: alpha + +contains + + ! ---------------------------------------------------------------- + ! ODE RHS function f(t,y) (implicit). + ! ---------------------------------------------------------------- + integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: y(:) + real(c_double), pointer, dimension(nlocal) :: ydot(:) + + ! local data + integer :: i + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Fill ydot with rhs function + do i = 1,nlocal + ydot(i) = -alpha * (myid * nlocal + i) * y(i) + end do + + retval = 0 ! Return with success + return + end function firhs + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Routine to solve preconditioner linear system + ! This routine uses a diagonal preconditioner P = I - gamma*J, + ! where J is a diagonal approximation to the true Jacobian, given by: + ! J = diag(0, 0, 0, -4*alpha, ..., -N*alpha). + ! The vector r is copied to z, and the inverse of P (restricted to the + ! local vector segment) is applied to the vector z. + ! ---------------------------------------------------------------- + integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & + gamma, delta, lr, user_data) result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(N_Vector) :: sunvec_r ! rhs N_Vector + type(N_Vector) :: sunvec_z ! rhs N_Vector + real(c_double), value :: gamma ! current gamma value + real(c_double), value :: delta ! current delta value + integer(c_int), value :: lr ! left or right preconditioning + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: z(:) + real(c_double), pointer, dimension(nlocal) :: r(:) + + ! local data + integer(c_long) :: i, ibase, istart + real(c_double) :: psubi, pj + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + z(1:nlocal) => FN_VGetArrayPointer(sunvec_z) + r(1:nlocal) => FN_VGetArrayPointer(sunvec_r) + + ! Copy r into z + z = r + + ! Calculate Jacobian here + ibase = myid * nlocal + istart = max(1, 4 - ibase) + do i = istart,nlocal + pj = dble(ibase + i) + psubi = 1.d0 + gamma * alpha * pj + z(i) = z(i) / psubi + end do + + retval = 0 ! Return with success + return + end function Psolve + ! ---------------------------------------------------------------- + +end module DiagkryData +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use fsundials_futils_mod ! Fortran utilities + use fcvode_mod ! Access CVode + use fsundials_types_mod ! sundials defined types + use fsundials_matrix_mod ! Fortran interface to generic SUNMatrix + use fsundials_nvector_mod ! Access generic N_Vector + use fnvector_parallel_mod ! Access parallel N_Vector + use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use fsundials_context_mod ! Access sundials context + use DiagkryData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data + type(c_ptr) :: cvode_mem ! CVODE memory + integer(c_long) :: N, Ntot + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nfe(1) ! number of RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: ncfn(1) ! number of nonlinear convergence fails + integer(c_long) :: ncfl(1) ! number of linear convergence fails + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + real(c_double) :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "Diagonal test problem:"; + write(6,'(A,i4)') " neq = " , neq + write(6,'(A,i4)') " nlocal = " , nlocal + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,es9.2)') " alpha = ", alpha + write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write(6,*) " Method is BDF/NEWTON/SPGMR" + write(6,*) " Diagonal preconditioner uses approximate Jacobian" + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create the CVode timestepper module + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) then + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) + if (retval /= 0) then + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Tell CVODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FCVodeSStolerances(cvode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeSetPreconditioner(cvode_mem, c_null_ptr, c_funloc(Psolve)) + if (retval /= 0) then + print *, "Error: FCVodeSetPreconditioner returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + do iPretype = 1,2 + + if (iPretype == 2) then + + y = 1.d0 + + retval = FCVodeReInit(cvode_mem, t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FCVodeReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if + + if (outproc) write(6,*) " Preconditioning on right:" + + end if + + if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" + + ! Main time-stepping loop: calls CVode to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0+dTout + if (outproc) then + write(6,*) " t steps fe" + write(6,*) " --------------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write(6,'(3x,f10.6,3(3x,i6))') t, nst, nfe + tout = min(tout + dTout, Tf) + + end do + if (outproc) then + write(6,*) " --------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1,nlocal + erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecEvals(cvode_mem, npre) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinIters(cvode_mem, nli) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + avdim = dble(nli) / dble(nni) + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FCVodeGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FCVodeGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(A,i6)') " Internal solver steps = ", nst + write(6,'(A,i6)') " Total RHS evals = ", nfe + write(6,'(A,i6)') " Total preconditioner setups = ", npre + write(6,'(A,i6)') " Total preconditioner solves = ", npsol + write(6,'(A,i6)') " Total nonlinear iterations = ", nni + write(6,'(A,i6)') " Total linear iterations = ", nli + write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write(6,'(A,i6)') " - Linear = ", ncfl + write(6,'(A,i6)') " Total number of error test failures = ", netf + write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write(6,'(A)') " " + write(6,'(A)') " " + write(6,'(A)') " " + end if + end do + + ! Clean up and return with successful completion + call FCVodeFree(cvode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out new file mode 100644 index 0000000000..04ba4dc843 --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out @@ -0,0 +1,76 @@ + + Diagonal test problem: + neq = 40 + nlocal = 10 + nprocs = 4 + rtol = 1.00E-05 + atol = 1.00E-10 + alpha = 1.00E+01 + ydot_i = -alpha*i * y_i (i = 1,...,neq) + Method is BDF/NEWTON/SPGMR + Diagonal preconditioner uses approximate Jacobian + + Preconditioning on left: + t steps fe + -------------------------------- + 0.100000 221 261 + 0.200000 265 307 + 0.300000 290 333 + 0.400000 306 350 + 0.500000 319 364 + 0.600000 329 374 + 0.700000 339 384 + 0.800000 346 392 + 0.900000 351 399 + 1.000000 355 403 + -------------------------------- +Max. absolute error is 1.46E-08 + + Final Solver Statistics: + Internal solver steps = 355 + Total RHS evals = 403 + Total preconditioner setups = 7 + Total preconditioner solves = 727 + Total nonlinear iterations = 400 + Total linear iterations = 367 + Average Krylov subspace dimension = 0.9175 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 5 + Main solver real/int workspace sizes = 609 144 + Linear solver real/int workspace sizes = 534 126 + + + + Preconditioning on right: + t steps fe + -------------------------------- + 0.100000 221 261 + 0.200000 265 307 + 0.300000 290 333 + 0.400000 306 350 + 0.500000 319 364 + 0.600000 329 374 + 0.700000 339 384 + 0.800000 345 391 + 0.900000 352 398 + 1.000000 358 404 + -------------------------------- +Max. absolute error is 2.09E-09 + + Final Solver Statistics: + Internal solver steps = 358 + Total RHS evals = 404 + Total preconditioner setups = 6 + Total preconditioner solves = 730 + Total nonlinear iterations = 401 + Total linear iterations = 367 + Average Krylov subspace dimension = 0.9152 + Total Convergence Failures - Nonlinear = 0 + - Linear = 0 + Total number of error test failures = 5 + Main solver real/int workspace sizes = 609 144 + Linear solver real/int workspace sizes = 534 126 + + + diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 new file mode 100644 index 0000000000..c390f65de3 --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 @@ -0,0 +1,329 @@ +! ---------------------------------------------------------------- +! Programmer(s): Daniel M. Margolis @ SMU +! modified from previous ARKODE examples +! ---------------------------------------------------------------- +! 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 +! ---------------------------------------------------------------- +! Example problem: +! +! Diagonal ODE example. Nonstiff case: alpha = 10/NEQ. +! +! ---------------------------------------------------------------- + +module DiagnonData + ! -------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + ! -------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_long), parameter :: nlocal = 2 + integer(c_long) :: neq + real(c_double) :: alpha + +contains + + ! ---------------------------------------------------------------- + ! ODE RHS function f(t,y). + ! ---------------------------------------------------------------- + integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: y(:) + real(c_double), pointer, dimension(nlocal) :: ydot(:) + + ! local data + integer :: i, ierr + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) + + ! Initialize ydot to zero + ydot = 0.d0 + + ! Fill ydot with rhs function + do i = 1,nlocal + ydot(i) = -alpha * (myid * nlocal + i) * y(i) + end do + + retval = 0 ! Return with success + return + end function frhs + ! ---------------------------------------------------------------- + + +end module DiagnonData +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! Main driver program +! ---------------------------------------------------------------- +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use fsundials_futils_mod ! Fortran utilities + use fcvode_mod ! Access CVode + use fsundials_types_mod ! sundials defined types + use fsundials_nvector_mod ! Access generic N_Vector + use fnvector_parallel_mod ! Access parallel N_Vector + use fsundials_context_mod ! Access sundials context + use fsundials_nonlinearsolver_mod ! Access generic nonlinear SUNDIALS solver + use fsunnonlinsol_fixedpoint_mod ! Access fixed-point nonlinear SUNDIALS solver + + use DiagnonData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(SUNNonlinearSolver), pointer :: sunnls ! sundials nonlinear solver + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data + type(c_ptr) :: cvode_mem ! CVODE memory + integer(c_long) :: N, Ntot + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nfe(1) ! number of RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs * nlocal + alpha = 10.0d0 / neq + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "Diagonal test problem:"; + write(6,'(A,i4)') " neq = " , neq + write(6,'(A,i4)') " nlocal = " , nlocal + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,es9.2)') " alpha = ", alpha + write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write(6,*) " Method is ADAMS/FIXED-POINT" + write(6,*) " " + endif + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create and Initialize the CVode timestepper module + cvode_mem = FCVodeCreate(CV_ADAMS, sunctx) + if (.not. c_associated(cvode_mem)) then + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeInit(cvode_mem, c_funloc(frhs), t0, sunvec_y) + if (retval /= 0) then + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Assign and Setup SUNDIALS Nonlinear solver + sunnls => FSUNNonlinSol_FixedPoint(sunvec_y, 0, sunctx) + if (.not. associated(sunnls)) then + print *, 'ERROR: sunnls = NULL' + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeSetNonlinearSolver(cvode_mem, sunnls) + if (retval /= 0) then + print *, 'Error in FCVodeSetNonlinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FCVodeSStolerances(cvode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Main time-stepping loop: calls CVode to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0+dTout + if (outproc) then + write(6,*) " t steps fe" + write(6,*) " ----------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write(6,'(3x,f10.6,2(3x,i5))') t, nst, nfe + tout = min(tout + dTout, Tf) + + end do + if (outproc) then + write(6,*) " --------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1,nlocal + erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(A,i6)') " Internal solver steps = ", nst + write(6,'(A,i6)') " Total RHS evals = ", nfe + write(6,'(A,i6)') " Total number of error test failures = ", netf + endif + + ! Clean up and return with successful completion + call FCVodeFree(cvode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out new file mode 100644 index 0000000000..bef79307c7 --- /dev/null +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out @@ -0,0 +1,30 @@ + + Diagonal test problem: + neq = 8 + nlocal = 2 + nprocs = 4 + rtol = 1.00E-05 + atol = 1.00E-10 + alpha = 1.25E+00 + ydot_i = -alpha*i * y_i (i = 1,...,neq) + Method is ADAMS/FIXED-POINT/SPGMR + + t steps fe + ---------------------------- + 0.100000 14 31 + 0.200000 22 39 + 0.300000 29 46 + 0.400000 37 54 + 0.500000 44 61 + 0.600000 51 68 + 0.700000 59 77 + 0.800000 66 84 + 0.900000 74 92 + 1.000000 81 99 + -------------------------------- +Max. absolute error is 4.07E-08 + + Final Solver Statistics: + Internal solver steps = 81 + Total RHS evals = 99 + Total number of error test failures = 3 diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 85e14c482d..555ce99c6a 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -1,5 +1,6 @@ # --------------------------------------------------------------- # Programmer(s): Cody J. Balos @ LLNL +# modified by Daniel M. Margolis @ SMU # --------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security @@ -19,15 +20,25 @@ # Examples using SUNDIALS linear solvers set(FCVODE_examples + "cv_advdiff_bnd_f2003\;develop" "cv_analytic_fp_f2003\;develop" "cv_analytic_sys_dns_f2003\;develop" "cv_analytic_sys_dns_jac_f2003\;develop" "cv_brusselator_dns_f2003\;develop" + "cv_diurnal_kry_f2003\;develop" + "cv_diurnal_kry_bp_f2003\;develop" + "cv_roberts_dns_constraints_f2003\;develop" + "cv_roberts_dns_f2003\;develop" ) # Examples using LAPACK linear solvers -set(FCVODE_examples_BL - ) +if(SUNDIALS_INDEX_SIZE MATCHES "64") + + set(FCVODE_examples_LAPACK + "cv_roberts_dnsL_f2003\;develop" + ) + +endif() # Add sparse solvers examples for 64-bit indextype configurations only, # not compatible with 32-bit indextype @@ -35,6 +46,7 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using KLU linear solver set(FCVODE_examples_KLU "cv_analytic_sys_klu_f2003\;develop" + "cv_roberts_klu_f2003\;develop" ) endif() @@ -117,12 +129,50 @@ if(BUILD_SUNLINSOL_KLU) endif() +# Add the build and install targets for each LAPACK example (if needed) +if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) + + # Sundials LAPACK linear solver modules + set(SUNLINSOLLAPACK_LIBS + sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) + + # LAPACK libraries + list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) + + foreach(example_tuple ${FCVODE_examples_LAPACK}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_type) + + # example source files + add_executable(${example} ${example}.f90) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + + # add example to regression tests + sundials_add_test(${example} ${example} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${example}.out + EXAMPLE_TYPE ${example_type}) + + # libraries to link against + target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example}.out + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + endif() + + endforeach(example_tuple ${FCVODE_examples_LAPACK}) + +endif() + # create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) - # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODE") set(SOLVER_LIB "sundials_cvode") diff --git a/examples/cvode/F2003_serial/README b/examples/cvode/F2003_serial/README deleted file mode 100644 index af3d0036a0..0000000000 --- a/examples/cvode/F2003_serial/README +++ /dev/null @@ -1,40 +0,0 @@ -List of serial CVODE F2003 examples - - cv_analytic_fp_f2003.f90 : simple example problem with an analytical solution (fixedpoint) - cv_analytic_sys_dns_f2003.f90 : simple example problem with an analytical solution (newton, dense) - cv_analytic_sys_dns_jac_f2003.f90 : simple example problem with an analytical solution (newton, dense, user-supplied jacobian) - cv_analytic_sys_klu_f2003.f90 : simple example problem with an analytical solution (newton, KLU) - cv_brusselator_dns_f2003.f90 : brusselator problem from chemical kinetics (newton, dense) - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=ON \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_ENABLE_F2003=ON \ --DEXAMPLES_INSTALL=ON \ --DBUILD_FORTRAN_MODULE_INTERFACE=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 - diff --git a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 new file mode 100644 index 0000000000..fe37cc6da7 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 @@ -0,0 +1,446 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel M. Margolis @ SMU +! based off the previous Fortran-77 example program, +! cvode/fcmix_serial/fcvAdvDiff_bnd.f +! ------------------------------------------------------------------ +! 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 +! ------------------------------------------------------------------ +! The following is a simple example problem with a banded +! Jacobian. The problem is the semi-discrete form of the +! advection-diffusion equation in 2D: +! du/dt = d^2 u / dx^2 + .5 du/dx + d^2 u / dy^2 +! on the rectangle 0 <= x <= 2, 0 <= y <= 1, and the time +! interval 0 <= t <= 1. Homogeneous Dirichlet boundary conditions +! are posed, and the initial condition is the following: +! +! u(x, y, t = 0) = x*(2 - x)*y*(1 - y)*exp(5*x*y) . +! +! The PDE is discretized on a uniform MX+2 by MY+2 grid with +! central differencing, and with boundary values eliminated, +! leaving an ODE system of size NEQ = MX*MY. +! This program solves this problem with CVODE, using the Fortran/C +! interface routine package. This solution uses the BDF method, +! a user-supplied banded Jacobian routine, and scalar relative and +! absolute tolerances. It prints results at t = .1, .2, ..., 1.0. +! At the end of the run, various counters of interest are printed. +! ------------------------------------------------------------------ + +module advdiff_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! setup and number of equations + integer(c_int), parameter :: mx = 10, my = 5 + integer(c_int), parameter :: mxmy = mx*my + integer(c_long), parameter :: neq = mxmy + + ! ODE constant parameters + real(c_double), parameter :: xmax = 2.0d0, ymax = 1.0d0 + real(c_double), parameter :: dtout = 0.1d0 + real(c_double), parameter :: dx = xmax / (mx + 1) + real(c_double), parameter :: dy = ymax / (my + 1) + real(c_double), parameter :: hdcoef = 1.0d0 / (dx * dx) + real(c_double), parameter :: hacoef = 0.5d0 / (2.0d0 * dx) + real(c_double), parameter :: vdcoef = 1.0d0 / (dy * dy) + + ! Solving assistance fixed parameters + real(c_double), parameter :: rtol = 0.0d0 + real(c_double), parameter :: atol = 1.0d-5 + + ! ODE non-constant parameters + integer(c_int) :: i, j ! index variables + integer(c_int) :: mu, ml ! band preconditioner constants + real(c_double) :: x, y ! initialization index variables + real(c_double) :: unorm ! solution output variable + +contains + + ! ---------------------------------------------------------------- + ! RhsFn provides the right hand side implicit function for the ODE. + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C,name='RhsFn') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + real(c_double) :: uij, udn, uup, ult, urt, hdiff, hadv, vdiff + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(mx,my) :: uvec(:,:) + real(c_double), pointer, dimension(mx,my) :: fvec(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uvec(1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + fvec(1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + + ! Loop over all grid points + do i = 1, mx + do j = 1, my + + ! Extract u at x_i, y_j and four neighboring points. + uij = uvec(i,j) + udn = 0.0d0 + if (j .ne. 1) udn = uvec(i, j-1) + uup = 0.0d0 + if (j .ne. my) uup = uvec(i, j+1) + ult = 0.0d0 + if (i .ne. 1) ult = uvec(i-1, j) + urt = 0.0d0 + if (i .ne. mx) urt = uvec(i+1, j) + + ! Set diffusion and advection terms and load into fvec. + hdiff = hdcoef * (ult - 2.0d0 * uij + urt) + hadv = hacoef * (urt - ult) + vdiff = vdcoef * (uup - 2.0d0 * uij + udn) + fvec(i,j) = hdiff + hadv + vdiff + + end do + end do + + ! return success + ierr = 0 + return + + end function RhsFn + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! JacFn provides the user-supplied banded Jacobian + ! function for the ODE. + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function JacFn(t, sunvec_u, sunvec_f, sunmat_J, & + user_data, sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) & + bind(C,name='JacFn') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_band_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t + type(N_Vector) :: sunvec_u + type(N_Vector) :: sunvec_f + type(SUNMatrix) :: sunmat_J + type(c_ptr), value :: user_data + type(N_Vector) :: sunvec_t1 + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! local data + integer(c_int) :: mband, k, ioff, mu1, mu2, smu, mdim + integer(c_int) :: start + real(c_double), pointer, dimension(mdim,neq) :: Jmat(:,:) + + smu = int(FSUNBandMatrix_StoredUpperBandwidth(sunmat_J), c_int) + mdim = smu + 1 + ml + Jmat(1:mdim,1:neq) => FSUNBandMatrix_Data(sunmat_J) + + mu1 = smu + 1 + mu2 = smu + 2 + mband = smu + 1 + ml + start = smu-mu+1 + + ! Loop over all grid points + do i = 1, mx + ioff = (i - 1) * my + do j = 1, my + k = j + ioff + + ! Set Jacobian elements in column k of J. + Jmat(mu1,k) = -2.0d0 * (vdcoef + hdcoef) + if (i /= 1) Jmat(start,k) = hdcoef + hacoef + if (i /= mx) Jmat(mband,k) = hdcoef - hacoef + if (j /= 1) Jmat(smu,k) = vdcoef + if (j /= my) Jmat(mu2,k) = vdcoef + + end do + end do + + ! return success + ierr = 0 + return + + end function JacFn + ! ---------------------------------------------------------------- + +end module advdiff_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to the CVode module + use fsunmatrix_band_mod ! Fortran interface to banded SUNMatrix + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunlinsol_band_mod ! Fortran interface to banded SUNLinearSolver + use advdiff_mod ! Advection Diffusion functions + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: ctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tout ! output time + real(c_double) :: tcur(1) ! current time + integer(c_int) :: ierr ! error flag from C functions + integer(c_long) :: outstep ! output step + + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(c_ptr) :: cvode_mem ! CVODE memory + real(c_double), pointer, dimension(mx,my) :: u(:,:) ! underlying vector + + ! output statistic variables + integer(c_long) :: lnst(1) + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, ctx) + + ! initialize ODE + tstart = 0.0d0 + tcur = tstart + mu = my + ml = my + + ! create SUNDIALS N_Vector + sunvec_u => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + u(1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + + ! initialize and fill initial condition vector + do i = 1, mx + x = i * dx + do j = 1, my + y = j * dy + u(i,j) = x * (xmax - x) * y * (ymax - y) * exp(5.0d0 * x * y) + end do + end do + + ! create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, ctx) + if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + + ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) + if (ierr /= 0) then + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Tell CVODE to use a Band linear solver. + sunmat_A => FSUNBandMatrix(neq, int(mu,c_long), int(ml,c_long), ctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + sunls => FSUNLinSol_Band(sunvec_u, sunmat_A, ctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + stop 1 + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSStolerances(cvode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSetJacFn(cvode_mem, c_funloc(JacFn)) + if (ierr /= 0) then + print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Start time stepping + print *, ' ' + print *, 'Band example problem:' + print '(a,i2)', ' Advection-diffusion, NEQ = ', neq + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t max.norm(u) | lnst' + print *, ' ------------------------------' + + unorm = maxval(abs(u)) + print '(2x,f6.2,2x,es14.6,2x,i5)', tcur, unorm, lnst + + tout = dtout + do outstep = 1, 10 + + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + unorm = maxval(abs(u)) + print '(2x,f6.2,2x,es14.6,2x,i5)', tcur, unorm, lnst + + ! update tout + tout = tout + dtout + + end do + print *, ' ------------------------------' + + ! diagnostics output + call CVodeStats(cvode_mem) + + ! clean up + call FCVodeFree(cvode_mem) + call FN_VDestroy(sunvec_u) + call FSUNMatDestroy(sunmat_A) + ierr = FSUNLinSolFree(sunls) + ierr = FSUNContext_Free(ctx) + +end program main +! ---------------------------------------------------------------- + +! ---------------------------------------------------------------- +! CVodeStats +! +! Print CVODE statstics to stdandard out +! ---------------------------------------------------------------- +subroutine CVodeStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nliters(1) ! linear solver iterations + integer(c_long) :: ncf(1) ! num convergence failures nonlinear + integer(c_long) :: ncfl(1) ! num convergence failures linear + + !======= Internals ============ + + ierr = FCVodeGetNumSteps(cvode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumLinIters(cvode_mem, nliters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function call =',nfe + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num linear solver iters =',nliters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf + print '(4x,A,i9)' ,'Num linear solver fails =',ncfl + print *, ' ' + + return + +end subroutine CVodeStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out new file mode 100644 index 0000000000..b4fd7acec7 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out @@ -0,0 +1,30 @@ + + Band example problem: + Advection-diffusion, NEQ = 50 + + Finished initialization, starting time steps + + t max.norm(u) | lnst + ------------------------------ + 0.00 8.954716E+01 0 + 0.10 4.132887E+00 83 + 0.20 1.039298E+00 113 + 0.30 2.980039E-01 142 + 0.40 8.771443E-02 172 + 0.50 2.623286E-02 201 + 0.60 7.797329E-03 231 + 0.70 2.306253E-03 261 + 0.80 6.869357E-04 292 + 0.90 2.170255E-04 332 + 1.00 7.858554E-05 372 + ------------------------------ + + General Solver Stats: + Total internal steps taken = 372 + Total rhs function call = 452 + Num error test failures = 3 + Num nonlinear solver iters = 449 + Num linear solver iters = 0 + Num nonlinear solver fails = 0 + Num linear solver fails = 0 + diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 new file mode 100644 index 0000000000..69b4016927 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 @@ -0,0 +1,523 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel M. Margolis @ SMU +! based off the previous Fortran-77 example program, +! cvode/fcmix_serial/fcvDiurnal_kry_bp.f +! ------------------------------------------------------------------ +! 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 +! ------------------------------------------------------------------ +! FCVODE Example Problem: 2D kinetics-transport, +! precond. Krylov solver. +! +! An ODE system is generated from the following 2-species diurnal +! kinetics advection-diffusion PDE system in 2 space dimensions: +! +! dc(i)/dt = Kh*(d/dx)**2 c(i) + V*dc(i)/dx + (d/dy)(Kv(y)*dc(i)/dy) +! + Ri(c1,c2,t) for i = 1,2, where +! R1(c1,c2,t) = -q1*c1*c3 - q2*c1*c2 + 2*q3(t)*c3 + q4(t)*c2 , +! R2(c1,c2,t) = q1*c1*c3 - q2*c1*c2 - q4(t)*c2 , +! Kv(y) = Kv0*exp(y/5) , +! Kh, V, Kv0, q1, q2, and c3 are constants, and q3(t) and q4(t) +! vary diurnally. +! +! The problem is posed on the square +! 0 <= x <= 20, 30 <= y <= 50 (all in km), +! with homogeneous Neumann boundary conditions, and for time t in +! 0 <= t <= 86400 sec (1 day). +! +! The PDE system is treated by central differences on a uniform +! 10 x 10 mesh, with simple polynomial initial profiles. +! The problem is solved with CVODE, with the BDF/GMRES method and +! using the FCVBP banded preconditioner. +! +! Note that this problem should only work with SUNDIALS configured +! to use 'realtype' as 'double' and 'sunindextype' as '64bit' +! +! The second and third dimensions of U here must match the values of +! MX and MY, for consistency with the output statements below. +! ------------------------------------------------------------------ + +module diurnal_bp_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! setup and number of equations + integer(c_int), parameter :: mx = 10, my = 10 + integer(c_long), parameter :: mm = mx*my + integer(c_long), parameter :: neq = 2*mm + + ! ODE constant parameters + real(c_double), parameter :: Kh = 4.0d-6 + real(c_double), parameter :: Vel = 0.001d0 + real(c_double), parameter :: Kv0 = 1.0d-8 + real(c_double), parameter :: q1 = 1.63d-16 + real(c_double), parameter :: q2 = 4.66d-16 + real(c_double), parameter :: c3 = 3.7d16 + real(c_double), parameter :: pi = 3.1415926535898d0 + real(c_double), parameter :: halft = 4.32d4 + real(c_double), parameter :: om = pi/halft + real(c_double), parameter :: dx = 20.0d0/(mx - 1.0d0) + real(c_double), parameter :: dy = 20.0d0/(my - 1.0d0) + real(c_double), parameter :: hdco = Kh/(dx**2) + real(c_double), parameter :: haco = Vel/(2.0d0*dx) + real(c_double), parameter :: vdco = (1.0d0/(dy**2))*Kv0 + real(c_double), parameter :: a3 = 22.62d0 + real(c_double), parameter :: a4 = 7.601d0 + + ! Solving assistance fixed parameters + real(c_double), parameter :: twohr = 7200.0D0 + real(c_double), parameter :: rtol = 1.0d-5 + real(c_double), parameter :: floor = 100.0d0 + real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: atol = rtol*floor + integer(c_int), parameter :: Jpretype = 1 + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: maxL = 0 + integer(c_long), parameter :: mxsteps = 10000 + + ! ODE non-constant parameters + real(c_double) :: q3 + real(c_double) :: q4 + real(c_double) :: c1 + real(c_double) :: c2 + integer(c_int) :: jx, jy + +contains + + ! ---------------------------------------------------------------- + ! RhsFn provides the right hand side implicit function for the + ! ODE: dy1/dt = f1(t,y1,y2,y3) + ! dy2/dt = f2(t,y1,y2,y3) + ! dy3/dt = f3(t,y1,y2,y3) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C,name='RhsFn') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + integer(c_int) :: jleft, jright, jup, jdn + real(c_double) :: c1dn, c2dn, c1up, c2up, c1lt, c2lt + real(c_double) :: c1rt, c2rt, cydn, cyup, hord1, hord2, horad1 + real(c_double) :: horad2, qq1, qq2, qq3, qq4, rkin1, rkin2, s + real(c_double) :: vertd1, vertd2, ydn, yup + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(2,mx,my) :: uvecI(:,:,:) + real(c_double), pointer, dimension(2,mx,my) :: fvecI(:,:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + fvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + + ! Set diurnal rate coefficients. + s = sin(om * tn) + if (s > 0.0d0) then + q3 = exp(-a3 / s) + q4 = exp(-a4 / s) + else + q3 = 0.0d0 + q4 = 0.0d0 + end if + + ! Loop over all grid points. + do jy = 1, my + ydn = 30.0d0 + (jy - 1.5d0) * dy + yup = ydn + dy + cydn = vdco * exp(0.2d0 * ydn) + cyup = vdco * exp(0.2d0 * yup) + jdn = jy-1 + if (jy == 1) jdn = my + jup = jy+1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvecI(1,jx,jy) + c2 = uvecI(2,jx,jy) + ! Set kinetic rate terms. + qq1 = q1 * c1 * c3 + qq2 = q2 * c1 * c2 + qq3 = q3 * c3 + qq4 = q4 * c2 + rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvecI(1,jx,jdn) + c2dn = uvecI(2,jx,jdn) + c1up = uvecI(1,jx,jup) + c2up = uvecI(2,jx,jup) + vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) + vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx-1 + if (jx == 1) jleft = mx + jright = jx+1 + if (jx == mx) jright = 1 + c1lt = uvecI(1,jleft,jy) + c2lt = uvecI(2,jleft,jy) + c1rt = uvecI(1,jright,jy) + c2rt = uvecI(2,jright,jy) + hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) + hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) + horad1 = haco * (c1rt - c1lt) + horad2 = haco * (c2rt - c2lt) + ! load all terms into fvecI. + fvecI(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 + fvecI(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 + end do + end do + + ! return success + ierr = 0 + return + + end function RhsFn + ! ---------------------------------------------------------------- + +end module diurnal_bp_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to the CVode module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use diurnal_bp_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: ctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tout ! output time + real(c_double) :: tcur(1) ! current time + real(c_double) :: cx, cy ! initialization variables + integer(c_int) :: ierr ! error flag from C functions + integer(c_long) :: outstep ! output step + integer(c_long) :: mu, ml ! band preconditioner constants + real(c_double) :: x, y ! initialization index variables + + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(c_ptr) :: cvode_mem ! CVODE memory + real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + + ! output statistic variables + integer(c_long) :: lnst(1) + real(c_double) :: lh(1) + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, ctx) + + ! initialize ODE + tstart = 0.0d0 + tcur = tstart + + ! create SUNDIALS N_Vector + sunvec_u => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_f => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_f)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + + ! initialize and fill initial condition vector + do jy = 1,my + y = 30.0d0 + (jy - 1.0d0) * dy + cy = (0.1d0 * (y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0 * cy**2 + do jx = 1,mx + x = (jx - 1.0d0) * dx + cx = (0.1d0 * (x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0 * cx**2 + uvec(1,jx,jy) = 1.0d6 * cx * cy + uvec(2,jx,jy) = 1.0d12 * cx * cy + end do + end do + + ! create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, ctx) + if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + + ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) + if (ierr /= 0) then + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Tell CVODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + stop 1 + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (ierr /= 0) then + print *, 'Error in FCVodeSetLinearSolver' + stop 1 + end if + + ierr = FCVodeSStolerances(cvode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) + if (ierr /= 0) then + print *, 'Error in FCVodeSetMaxNumSteps' + stop 1 + end if + + mu = 2 + ml = 2 + ierr = FCVBandPrecInit(cvode_mem, neq, mu, ml) + if (ierr /= 0) then + print *, 'Error in FCVBandPrecInit, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Start time stepping + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t c1 (bottom left middle top right) | lnst lh' + print *, ' t c2 (bottom left middle top right) | lnst lh' + print *, ' -----------------------------------------------------------------------------------' + tout = twohr + do outstep = 1,12 + + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetCurrentStep(cvode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lh + print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) + + ! update tout + tout = tout + twohr + + end do + print *, ' -----------------------------------------------------------------------------------' + + ! diagnostics output + call CVodeStats(cvode_mem) + + ! clean up + call FCVodeFree(cvode_mem) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_f) + ierr = FSUNLinSolFree(sunls) + ierr = FSUNContext_Free(ctx) + +end program main + +! ---------------------------------------------------------------- +! CVodeStats +! +! Print CVODE statstics to stdandard out +! ---------------------------------------------------------------- +subroutine CVodeStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: npe(1) ! num preconditioner evals + integer(c_long) :: nps(1) ! num preconditioner solves + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nliters(1) ! linear solver iterations + integer(c_long) :: ncf(1) ! num convergence failures nonlinear + integer(c_long) :: ncfl(1) ! num convergence failures linear + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + integer(c_long) :: nfebp(1) ! num f evaluations + real(c_double) :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer(c_long) :: lenrwbp(1) + integer(c_long) :: leniwbp(1) + + !======= Internals ============ + + ierr = FCVodeGetNumSteps(cvode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumPrecEvals(cvode_mem, npe) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumPrecSolves(cvode_mem, nps) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumLinIters(cvode_mem, nliters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 + end if + + avdim = dble(nliters)/dble(nniters) + + ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (ierr /= 0) then + print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + if (ierr /= 0) then + print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVBandPrecGetWorkSpace(cvode_mem, lenrwbp, leniwbp) + if (ierr /= 0) then + print *, 'Error in FCVBandPrecGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVBandPrecGetNumRhsEvals(cvode_mem, nfebp) + if (ierr /= 0) then + print *, 'Error in FCVBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function call =',nfe + print '(4x,A,i9)' ,'Total num preconditioner evals =',npe + print '(4x,A,i9)' ,'Total num preconditioner solves =',nps + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num linear solver iters =',nliters + print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim + print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf + print '(4x,A,i9)' ,'Num linear solver fails =',ncfl + print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw + print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls + print '(4x,A,2(i9,3x))' ,'CVBandPre real/int workspace sizes =',lenrwbp,leniwbp + print '(4x,A,i9)' ,'CVBandPre number of f evaluations =',nfebp + print *, ' ' + + return + +end subroutine CVodeStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out new file mode 100644 index 0000000000..4eb0e6fa74 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out @@ -0,0 +1,48 @@ + + Finished initialization, starting time steps + + t c1 (bottom left middle top right) | lnst lh + t c2 (bottom left middle top right) | lnst lh + ----------------------------------------------------------------------------------- + 7.200000E+03 1.839583E+04 3.009343E+04 1.582817E+04 191 1.632687E+02 + 4.440237E+11 7.263870E+11 3.820457E+11 + 1.440000E+04 1.149769E+07 1.249023E+07 1.329996E+07 223 3.726109E+02 + 4.473889E+11 4.861995E+11 5.178613E+11 + 2.160000E+04 2.525181E+07 7.837545E+07 3.019017E+07 242 3.726109E+02 + 2.824148E+11 9.233155E+11 3.419900E+11 + 2.880000E+04 1.189262E+07 2.395873E+07 1.042564E+07 262 3.726109E+02 + 4.627736E+11 9.345413E+11 4.054191E+11 + 3.600000E+04 2.342995E+04 2.291401E+04 2.522350E+04 285 1.992953E+02 + 5.651797E+11 5.527335E+11 6.084463E+11 + 4.320000E+04 2.608063E-04 4.048821E-05 -4.802744E-04 336 5.653068E+02 + 3.689229E+11 8.238195E+11 4.623800E+11 + 5.040000E+04 1.817289E-04 -1.516970E-06 3.755188E-04 349 5.653068E+02 + 3.862522E+11 1.017917E+12 3.536680E+11 + 5.760000E+04 3.523733E-10 1.237556E-11 -3.779706E-10 362 5.653068E+02 + 5.833332E+11 6.187025E+11 5.789597E+11 + 6.480000E+04 1.065643E-13 -1.378092E-13 -2.363348E-12 374 5.653068E+02 + 4.273617E+11 6.789731E+11 5.386164E+11 + 7.200000E+04 -2.565418E-14 -7.919368E-14 -2.889844E-13 387 5.653068E+02 + 3.453809E+11 1.030257E+12 3.448164E+11 + 7.920000E+04 -7.212118E-14 1.770733E-13 1.512967E-12 400 5.653068E+02 + 5.451911E+11 7.328821E+11 5.110635E+11 + 8.640000E+04 5.298797E-14 -2.802708E-14 2.918795E-13 413 5.653068E+02 + 5.089882E+11 5.756321E+11 5.984473E+11 + ----------------------------------------------------------------------------------- + + General Solver Stats: + Total internal steps taken = 413 + Total rhs function call = 502 + Total num preconditioner evals = 7 + Total num preconditioner solves = 937 + Num error test failures = 16 + Num nonlinear solver iters = 499 + Num linear solver iters = 491 + Avg Krylov subspace dim = 9.839679E-01 + Num nonlinear solver fails = 0 + Num linear solver fails = 0 + main solver real/int workspace sizes = 2689 53 + linear solver real/int workspace sizes = 2454 42 + CVBandPre real/int workspace sizes = 2800 622 + CVBandPre number of f evaluations = 35 + diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 new file mode 100644 index 0000000000..d9267480ac --- /dev/null +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 @@ -0,0 +1,749 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel M. Margolis @ SMU +! based off the previous Fortran-77 example program, +! cvode/fcmix_serial/fcvDiurnal_kry.f +! ------------------------------------------------------------------ +! 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 +! ------------------------------------------------------------------ +! FCVODE Example Problem: 2D kinetics-transport, +! precond. Krylov solver. +! +! An ODE system is generated from the following 2-species diurnal +! kinetics advection-diffusion PDE system in 2 space dimensions: +! +! dc(i)/dt = Kh*(d/dx)**2 c(i) + V*dc(i)/dx + (d/dy)(Kv(y)*dc(i)/dy) +! + Ri(c1,c2,t) for i = 1,2, where +! R1(c1,c2,t) = -q1*c1*c3 - q2*c1*c2 + 2*q3(t)*c3 + q4(t)*c2 , +! R2(c1,c2,t) = q1*c1*c3 - q2*c1*c2 - q4(t)*c2 , +! Kv(y) = Kv0*exp(y/5) , +! Kh, V, Kv0, q1, q2, and c3 are constants, and q3(t) and q4(t) +! vary diurnally. +! +! The problem is posed on the square +! 0 <= x <= 20, 30 <= y <= 50 (all in km), +! with homogeneous Neumann boundary conditions, and for time t in +! 0 <= t <= 86400 sec (1 day). +! +! The PDE system is treated by central differences on a uniform +! 10 x 10 mesh, with simple polynomial initial profiles. +! The problem is solved with CVODE, with the BDF/GMRES method and +! and the block-diagonal part of the Jacobian as a left preconditioner. +! +! Note that this problem should only work with SUNDIALS configured +! to use 'realtype' as 'double' and 'sunindextype' as '64bit' +! +! The second and third dimensions of U here must match the values of +! MX and MY, for consistency with the output statements below. +! ------------------------------------------------------------------ + +module diurnal_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! setup and number of equations + integer(c_int), parameter :: mx = 10, my = 10 + integer(c_long), parameter :: mm = mx*my + integer(c_long), parameter :: neq = 2*mm + + ! ODE constant parameters + real(c_double), parameter :: Kh = 4.0d-6 + real(c_double), parameter :: Vel = 0.001d0 + real(c_double), parameter :: Kv0 = 1.0d-8 + real(c_double), parameter :: q1 = 1.63d-16 + real(c_double), parameter :: q2 = 4.66d-16 + real(c_double), parameter :: c3 = 3.7d16 + real(c_double), parameter :: pi = 3.1415926535898d0 + real(c_double), parameter :: halft = 4.32d4 + real(c_double), parameter :: om = pi/halft + real(c_double), parameter :: dx = 20.0d0/(mx - 1.0d0) + real(c_double), parameter :: dy = 20.0d0/(my - 1.0d0) + real(c_double), parameter :: hdco = Kh/(dx**2) + real(c_double), parameter :: haco = Vel/(2.0d0*dx) + real(c_double), parameter :: vdco = (1.0d0/(dy**2))*Kv0 + real(c_double), parameter :: a3 = 22.62d0 + real(c_double), parameter :: a4 = 7.601d0 + + ! Solving assistance fixed parameters + real(c_double), parameter :: twohr = 7200.0D0 + real(c_double), parameter :: rtol = 1.0d-5 + real(c_double), parameter :: floor = 100.0d0 + real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: atol = rtol*floor + integer(c_int), parameter :: Jpretype = 1 + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: maxL = 0 + integer(c_long), parameter :: mxsteps = 1000 + real(c_double) :: p_p(2,2,mx,my) + + ! ODE non-constant parameters + real(c_double) :: q3 + real(c_double) :: q4 + real(c_double) :: c1 + real(c_double) :: c2 + integer(c_int) :: jx, jy + +contains + + ! ---------------------------------------------------------------- + ! RhsFn provides the right hand side implicit function for the + ! ODE: dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C,name='RhsFn') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tn ! current time + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! rhs N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! local data + integer(c_int) :: jleft, jright, jup, jdn + real(c_double) :: c1dn, c2dn, c1up, c2up, c1lt, c2lt + real(c_double) :: c1rt, c2rt, cydn, cyup, hord1, hord2, horad1 + real(c_double) :: horad2, qq1, qq2, qq3, qq4, rkin1, rkin2, s + real(c_double) :: vertd1, vertd2, ydn, yup + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) + real(c_double), pointer, dimension(2,mx,my) :: fvec(:,:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + fvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + + ! Set diurnal rate coefficients. + s = sin(om * tn) + if (s > 0.0d0) then + q3 = exp(-a3 / s) + q4 = exp(-a4 / s) + else + q3 = 0.0d0 + q4 = 0.0d0 + end if + + ! Loop over all grid points. + do jy = 1, my + ydn = 30.0d0 + (jy - 1.5d0) * dy + yup = ydn + dy + cydn = vdco * exp(0.2d0 * ydn) + cyup = vdco * exp(0.2d0 * yup) + jdn = jy-1 + if (jy == 1) jdn = my + jup = jy+1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvec(1,jx,jy) + c2 = uvec(2,jx,jy) + ! Set kinetic rate terms. + qq1 = q1 * c1 * c3 + qq2 = q2 * c1 * c2 + qq3 = q3 * c3 + qq4 = q4 * c2 + rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvec(1,jx,jdn) + c2dn = uvec(2,jx,jdn) + c1up = uvec(1,jx,jup) + c2up = uvec(2,jx,jup) + vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) + vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx-1 + if (jx == 1) jleft = mx + jright = jx+1 + if (jx == mx) jright = 1 + c1lt = uvec(1,jleft,jy) + c2lt = uvec(2,jleft,jy) + c1rt = uvec(1,jright,jy) + c2rt = uvec(2,jright,jy) + hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) + hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) + horad1 = haco * (c1rt - c1lt) + horad2 = haco * (c2rt - c2lt) + ! load all terms into fvec. + fvec(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 + fvec(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 + end do + end do + + ! return success + ierr = 0 + return + + end function RhsFn + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! PreSet provides the setup function for the Preconditioner of the + ! ODE: dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function PreSet(t, sunvec_u, sunvec_f, jok, jcur, gamma, user_data) & + result(ierr) bind(C,name='PreSet') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! f-value N_Vector + integer(c_int), value :: jok + integer(c_int) :: jcur + real(c_double), value :: gamma + type(c_ptr), value :: user_data + + ! temporary variables + real(c_double), pointer, dimension(2,mx,my) :: u(:,:,:) + real(c_double) :: p_bd(2,2,mx,my) + u(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + + ! initialize return value to success + ierr = 0 + + ! if needed, recompute bd + if (jok == 1) then + ! jok = 1. reuse saved bd + jcur = 0 + else + ! jok = 0. compute diagonal jacobian blocks. + ! (using q4 value computed on last fcvfun call). + call Prec_Jac(mx, my, u, p_bd, q1, q2, q3, q4, & + c3, dy, hdco, vdco, ierr) + jcur = 1 + endif + + ! copy bd to p and scale by -gamma + p_p = -gamma * p_bd + + ! Perform LU decomposition + call Prec_LU(mm, p_p, ierr) + + ! return success + ierr = 0 + return + + end function PreSet + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! PreSolve provides the solver function for the Preconditioner of + ! the ODE: dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function PreSolve(t, sunvec_u, sunvec_f, sunvec_r, sunvec_z, & + gamma, delta, lr, user_data) result(ierr) bind(C,name='PreSolve') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! f-value N_Vector + type(N_Vector) :: sunvec_r ! rhs N_Vector + type(N_Vector) :: sunvec_z ! output N_Vector + real(c_double) :: gamma, delta + integer(c_int) :: lr + type(c_ptr), value :: user_data + + ! temporary variables + real(c_double), pointer, dimension(2,mx,my) :: z(:,:,:), r(:,:,:) + z(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_z) + r(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_r) + + ! copy rhs into z + z = r + + ! solve the block-diagonal system px = r using lu factors stored in p + ! and pivot data in ipp, and return the solution in z. + call Prec_Sol(mx, my, p_p, z) + + ! return success + ierr = 0 + return + + end function PreSolve + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Prec_Jac provides the Jacobian routine for the Preconditioner of + ! the ODE, specifically the PreSet function, where the ODE is: + ! dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + subroutine Prec_Jac(mmx, mmy, u, bd, qq1, qq2, qq3, qq4, cc3, & + ddy, hhdco, vvdco, ierr) + + implicit none + + integer(c_int), intent(in) :: mmx, mmy + real(c_double), intent(in) :: u(2,mmx,mmy) + real(c_double), intent(out) :: bd(2,2,mmx,mmy) + real(c_double), intent(in) :: qq1, qq2, qq3, qq4, cc3, ddy, hhdco, vvdco + integer(c_int), intent(out) :: ierr + + ! local variables + real(c_double) :: cydn, cyup, diag, ydn, yup + + do jy = 1, mmy + ydn = 30.0d0 + (jy - 1.5d0) * ddy + yup = ydn + ddy + cydn = vvdco * exp(0.2d0 * ydn) + cyup = vvdco * exp(0.2d0 * yup) + diag = -(cydn + cyup + 2.0d0 * hhdco) + do jx = 1, mmx + c1 = u(1,jx,jy) + c2 = u(2,jx,jy) + bd(1,1,jx,jy) = (-qq1 * cc3 - qq2 * c2) + diag + bd(1,2,jx,jy) = -qq2 * c1 + qq4 + bd(2,1,jx,jy) = qq1 * cc3 - qq2 * c2 + bd(2,2,jx,jy) = (-qq2 * c1 - qq4) + diag + end do + end do + + ! return success + ierr = 0 + return + + end subroutine Prec_Jac + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Prec_LU provides the LU Decomposition (2 x 2 inverse) routine + ! for the Preconditioner of the ODE, specifically the PreSet + ! function, where the ODE is: dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + subroutine Prec_LU(mmm, p, ierr) + + implicit none + + integer(c_int), intent(out) :: ierr + integer(c_long), intent(in) :: mmm + real(c_double), intent(inout) :: p(2,2,mmm) + + ! local variable + integer(c_long) :: i + real(c_double) :: p11, p12, p21, p22, det + + ! initialize return value to success + ierr = 0 + + ! add identity matrix and do lu decompositions on blocks, in place. + do i = 1,mmm + p11 = p(1,1,i) + 1.0d0 + p22 = p(2,2,i) + 1.0d0 + p12 = p(1,2,i) + p21 = p(1,2,i) + det = p11*p22 - p12*p21 + if (det == 0.d0) return + + p(1,1,i) = p22/det + p(2,2,i) = p11/det + p(1,2,i) = -p21/det + p(2,1,i) = -p12/det + end do + + return + + end subroutine Prec_LU + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! Prec_Sol provides the Solver routine for the Preconditioner of + ! the ODE (functionally matrix-vector multiplication of our 2 x 2 + ! matrix), specifically the PreSolve function, where the ODE is: + ! dc1/dt = f1(t,c1,c2) + ! dc2/dt = f2(t,c1,c2) + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + subroutine Prec_Sol(mx,my, p, z) + + implicit none + + integer(c_int), intent(in) :: mx, my + real(c_double), dimension(2,2,mx,my), intent(inout) :: p(:,:,:,:) + real(c_double), dimension(2,mx,my), intent(inout) :: z(:,:,:) + + ! local variable + integer(c_long) :: i, j + real(c_double) :: z1, z2 + + + do i = 1,mx + do j = 1,my + z1 = z(1,i,j) + z2 = z(2,i,j) + z(1,i,j) = p(1,1,i,j) * z1 + p(1,2,i,j) * z2 + z(2,i,j) = p(2,1,i,j) * z1 + p(2,2,i,j) * z2 + end do + end do + + return + + end subroutine Prec_Sol + ! ---------------------------------------------------------------- + +end module diurnal_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to the ARKode module + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use diurnal_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + type(c_ptr) :: ctx ! SUNDIALS context for the simulation + real(c_double) :: tstart ! initial time + real(c_double) :: tout ! output time + real(c_double) :: tcur(1) ! current time + real(c_double) :: cx, cy ! initialization variables + integer(c_int) :: ierr ! error flag from C functions + integer(c_long) :: outstep ! output step + real(c_double) :: x, y ! initialization index variables + + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(c_ptr) :: cvode_mem ! CVODE memory + real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + + ! output statistic variables + integer(c_long) :: lnst(1) + real(c_double) :: lh(1) + + !======= Internals ============ + + ! create the SUNDIALS context + ierr = FSUNContext_Create(SUN_COMM_NULL, ctx) + + ! initialize ODE + tstart = 0.0d0 + tcur = tstart + + ! create SUNDIALS N_Vector + sunvec_u => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_f => FN_VNew_Serial(neq, ctx) + if (.not. associated(sunvec_f)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + + ! initialize and fill initial condition vector + do jy = 1,my + y = 30.0d0 + (jy - 1.0d0) * dy + cy = (0.1d0 * (y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0 * cy**2 + do jx = 1,mx + x = (jx - 1.0d0) * dx + cx = (0.1d0 * (x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0 * cx**2 + uvec(1,jx,jy) = 1.0d6 * cx * cy + uvec(2,jx,jy) = 1.0d12 * cx * cy + end do + end do + + ! create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, ctx) + if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + + ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) + if (ierr /= 0) then + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) + if (ierr /= 0) then + print *, 'Error in FCVodeSetMaxNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSStolerances(cvode_mem, rtol, atol) + if (ierr /= 0) then + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Tell CVODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + stop 1 + end if + + ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (ierr /= 0) then + print *, 'Error in FCVodeSetLinearSolver' + stop 1 + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (ierr /= 0) then + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeSetPreconditioner(cvode_mem, c_funloc(PreSet), c_funloc(PreSolve)) + if (ierr /= 0) then + print *, 'Error in FCVodeSetPreconditioner, ierr = ', ierr, '; halting' + stop 1 + end if + + ! Start time stepping + print *, ' ' + print *, 'Finished initialization, starting time steps' + print *, ' ' + print *, ' t c1 (bottom left middle top right) | lnst lh' + print *, ' t c2 (bottom left middle top right) | lnst lh' + print *, ' -----------------------------------------------------------------------------------' + tout = twohr + do outstep = 1,12 + + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVode, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetCurrentStep(cvode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lh + print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) + + ! update tout + tout = tout + twohr + + end do + print *, ' -----------------------------------------------------------------------------------' + + ! diagnostics output + call CVodeStats(cvode_mem) + + ! clean up + call FCVodeFree(cvode_mem) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_f) + ierr = FSUNLinSolFree(sunls) + ierr = FSUNContext_Free(ctx) + +end program main +! ---------------------------------------------------------------- + +! ---------------------------------------------------------------- +! CVodeStats +! +! Print CVODE statstics to stdandard out +! ---------------------------------------------------------------- +subroutine CVodeStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: ierr ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: npe(1) ! num preconditioner evals + integer(c_long) :: nps(1) ! num preconditioner solves + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nliters(1) ! linear solver iterations + integer(c_long) :: ncf(1) ! num convergence failures nonlinear + integer(c_long) :: ncfl(1) ! num convergence failures linear + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + real(c_double) :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + + !======= Internals ============ + + ierr = FCVodeGetNumSteps(cvode_mem, nsteps) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumPrecEvals(cvode_mem, npe) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumPrecSolves(cvode_mem, nps) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumLinIters(cvode_mem, nliters) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 + end if + + avdim = dble(nliters)/dble(nniters) + + ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (ierr /= 0) then + print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + if (ierr /= 0) then + print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function call =',nfe + print '(4x,A,i9)' ,'Total num preconditioner evals =',npe + print '(4x,A,i9)' ,'Total num preconditioner solves =',nps + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num linear solver iters =',nliters + print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim + print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf + print '(4x,A,i9)' ,'Num linear solver fails =',ncfl + print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw + print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls + print *, ' ' + + return + +end subroutine CVodeStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.out b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.out new file mode 100644 index 0000000000..c795a3f956 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.out @@ -0,0 +1,46 @@ + + Finished initialization, starting time steps + + t c1 (bottom left middle top right) | lnst lh + t c2 (bottom left middle top right) | lnst lh + ----------------------------------------------------------------------------------- + 7.200000E+03 1.839591E+04 3.009355E+04 1.582807E+04 220 1.471813E+02 + 4.440256E+11 7.263896E+11 3.820433E+11 + 1.440000E+04 1.149781E+07 1.248992E+07 1.330010E+07 251 3.393888E+02 + 4.473937E+11 4.861874E+11 5.178666E+11 + 2.160000E+04 2.525117E+07 7.837531E+07 3.019003E+07 273 3.393888E+02 + 2.824072E+11 9.233129E+11 3.419886E+11 + 2.880000E+04 1.189255E+07 2.395900E+07 1.042540E+07 294 3.393888E+02 + 4.627711E+11 9.345518E+11 4.054103E+11 + 3.600000E+04 2.342993E+04 2.291370E+04 2.522348E+04 318 1.824177E+02 + 5.651802E+11 5.527262E+11 6.084465E+11 + 4.320000E+04 1.056286E-06 1.419210E-06 1.303552E-06 374 1.880511E+02 + 3.689281E+11 8.238008E+11 4.623838E+11 + 5.040000E+04 -4.908995E-09 -2.678148E-09 -2.964936E-09 387 6.366726E+02 + 3.862586E+11 1.017917E+12 3.536566E+11 + 5.760000E+04 -2.802667E-12 -4.033809E-13 -7.939800E-13 398 6.366726E+02 + 5.833440E+11 6.186405E+11 5.790094E+11 + 6.480000E+04 -3.960979E-16 -4.688990E-17 -1.039471E-16 409 6.366726E+02 + 4.273158E+11 6.790339E+11 5.385536E+11 + 7.200000E+04 -3.517091E-19 -1.092965E-19 -1.465617E-19 421 6.366726E+02 + 3.453981E+11 1.030299E+12 3.448146E+11 + 7.920000E+04 -2.182503E-22 4.319341E-23 -1.981237E-24 432 6.366726E+02 + 5.452334E+11 7.327463E+11 5.111093E+11 + 8.640000E+04 -3.382282E-26 4.678058E-26 3.177913E-26 443 6.366726E+02 + 5.089344E+11 5.756561E+11 5.984629E+11 + ----------------------------------------------------------------------------------- + + General Solver Stats: + Total internal steps taken = 443 + Total rhs function call = 617 + Total num preconditioner evals = 67 + Total num preconditioner solves = 1458 + Num error test failures = 21 + Num nonlinear solver iters = 614 + Num linear solver iters = 903 + Avg Krylov subspace dim = 1.470684E+00 + Num nonlinear solver fails = 66 + Num linear solver fails = 67 + main solver real/int workspace sizes = 2689 53 + linear solver real/int workspace sizes = 2454 42 + diff --git a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 new file mode 100644 index 0000000000..2563680cba --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 @@ -0,0 +1,533 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel M. Margolis @ SMU +! based off the previous Fortran-77 example program, +! cvode/fcmix_serial/fcvRoberts_dnsL.f +! ------------------------------------------------------------------ +! 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for CVODE, due to Robertson, +! is from chemical kinetics, and consists of the following three rate +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1.e-4 or at which +! y3 = 0.01. +! +! The problem is solved with CVODE using the DENSE LAPACK linear +! solver, with a user-supplied Jacobian. Output is printed at +! t = .4, 4, 40, ..., 4e10. It uses ATOL much smaller for y2 +! than y1 or y3 because y2 has much smaller values. At the end +! of the run, various counters of interest are printed. +! ------------------------------------------------------------------ + +module robertsDnsL_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_int), parameter :: nout = 12 + integer(c_long), parameter :: neq = 3 + +contains + + ! ---------------------------------------------------------------- + ! fcnrob: The CVODE RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnrob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(t, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 1.0d-4 + gout(2) = yval(3) - 1.0d-2 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! residual N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1,1) = -0.04d0 + J(2,1) = 0.04d0 + J(3,1) = 0.0d0 + J(1,2) = 1.0d4*yval(3) + J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3,2) = 6.0d7*yval(2) + J(1,3) = 1.0d4*yval(2) + J(2,3) = -1.0d4*yval(2) + J(3,3) = 0.0d0 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module robertsDnsL_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to CVODE + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_lapackdense_mod ! Fortran interface to LAPACK dense SUNLinearSolver + use robertsDnsL_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(c_ptr) :: cvode_mem ! CVode memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the robertsDnsL_mod module + real(c_double) :: yval(neq), avtol(neq), dkyval(neq) + + !======= Internals ============ + + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + + rtol = 1.d-4 + + avtol(1) = 1.d-6 + avtol(2) = 1.d-11 + avtol(3) = 1.d-5 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set limits + t0 = 0.0d0 + tout = 0.4d0 + + call PrintHeader(rtol, avtol, yval) + + ! Call FCVodeCreate and FCVodeInit to create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' + + retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) + if (retval /= 0) then + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeSVtolerances to set tolerances + retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create dense SUNMatrix for use in linear solves + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create dense SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_LapackDense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call FCVode, print results, and test for error. + + iout = 0 + do while(iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval .eq. CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + stop 1 + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. CV_SUCCESS) then + iout = iout + 1 + tout = tout * 10.0d0 + end if + end do + + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! find and print derivative at tret(1) + retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in CVodeGetDky' + stop 1 + end if + print *, " " + print *, "------------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "------------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + call PrintFinalStats(cvode_mem) + + ! free memory + call FCVodeFree(cvode_mem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use robertsDnsL_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq) + + !======= Internals ============ + + print *, " " + print *, "cv_roberts_dnsL_f2003.f90: Robertson CV ODE serial example problem for CVODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: LAPACK DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print *, " " + print *, "---------------------------------------------------" + print *, " t y1 y2 y3" + print *, "---------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(cvode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use robertsDnsL_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: cvode_mem + real(c_double) :: t, y(neq) + + !======= Internals ============ + + print '(es12.4,1x,3(es12.4,1x))', t, y(1), y(2), y(3) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print ARKSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + integer(c_long) :: nluevals(1) ! number of LU evals + integer(c_long) :: ngevals(1) ! number of root evals + + !======= Internals ============ + + retval = FCVodeGetNumSteps(cvode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumGEvals(cvode_mem, ngevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function calls =',nfe + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Total root function calls =',ngevals + print '(4x,A,i9)' ,'Total LU function calls =',nluevals + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.out b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.out new file mode 100644 index 0000000000..1accffe897 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.out @@ -0,0 +1,43 @@ + + cv_roberts_dnsL_f2003.f90: Robertson CV ODE serial example problem for CVODE + Three equation chemical kinetics problem. + + Linear solver: LAPACK DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-06 1.E-11 1.E-05 +Initial conditions y0 = ( 1.00 0.00 0.00 ) + + --------------------------------------------------- + t y1 y2 y3 + --------------------------------------------------- + 2.6391E-01 9.8997E-01 3.4706E-05 1.0000E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8517E-01 3.3863E-05 1.4801E-02 + 4.0000E+00 9.0553E-01 2.2406E-05 9.4449E-02 + 4.0000E+01 7.1587E-01 9.1872E-06 2.8412E-01 + 4.0000E+02 4.5055E-01 3.2230E-06 5.4945E-01 + 4.0000E+03 1.8323E-01 8.9439E-07 8.1677E-01 + 4.0000E+04 3.8986E-02 1.6219E-07 9.6101E-01 + 4.0000E+05 4.9340E-03 1.9833E-08 9.9507E-01 + 4.0000E+06 5.1653E-04 2.0672E-09 9.9948E-01 + 1.9818E+07 1.0000E-04 4.0007E-10 9.9990E-01 + rootsfound[] = -1 0 + 4.0000E+07 4.4844E-05 1.7938E-10 9.9996E-01 + 4.0000E+08 6.8491E-06 2.7396E-11 9.9999E-01 + 4.0000E+09 -6.8850E+05 -4.0000E-06 6.8850E+05 + 4.0000E+10 -1.7968E+07 -4.0000E-06 1.7968E+07 + + ------------------------------------------------------ + Final y1' y2' y3' + ------------------------------------------------------ + -4.7999E-04 1.4590E-21 4.7999E-04 + + General Solver Stats: + Total internal steps taken = 745 + Total rhs function calls = 1206 + Total Jacobian function calls = 45 + Total root function calls = 781 + Total LU function calls = 190 + Num error test failures = 46 + Num nonlinear solver iters = 1203 + Num nonlinear solver fails = 38 + diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 new file mode 100644 index 0000000000..3e6a9901ad --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 @@ -0,0 +1,556 @@ +! ------------------------------------------------------------------ +! Programmer(s): Jimmy Almgren-Bell @ LLNL +! Based on prior version by: Scott D. Cohen, Alan C. Hindmarsh and +! Radu Serban @ LLNL +! +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for CVODE, due to Robertson, +! is from chemical kinetics, and consists of the following three rate +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1.e-4 or at which +! y3 = 0.01. +! +! The problem is solved with CVODE using the DENSE linear +! solver, with a user-supplied Jacobian. Output is printed at +! t = .4, 4, 40, ..., 4e10. It uses ATOL much smaller for y2 +! than y1 or y3 because y2 has much smaller values. The +! constraint y_i >= 0 is posed for all components. At the end +! of the run, various counters of interest are printed. +! ------------------------------------------------------------------ + +module RobertsDnsConstr_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_int), parameter :: nout = 12 + integer(c_long), parameter :: neq = 3 + +contains + + ! ---------------------------------------------------------------- + ! fcnrob: The CVODE RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnrob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(t, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 1.0d-4 + gout(2) = yval(3) - 1.0d-2 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! residual N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1,1) = -0.04d0 + J(2,1) = 0.04d0 + J(3,1) = 0.0d0 + J(1,2) = 1.0d4*yval(3) + J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3,2) = 6.0d7*yval(2) + J(1,3) = 1.0d4*yval(2) + J(2,3) = -1.0d4*yval(2) + J(3,3) = 0.0d0 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module RobertsDnsConstr_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to CVODE + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver + use RobertsDnsConstr_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_c ! sundials constraint vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(c_ptr) :: cvode_mem ! CVode memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the RobertsDnsConstr_mod module + real(c_double), dimension(neq) :: yval, cval, avtol, dkyval + + !======= Internals ============ + + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + cval(1) = 1.d0 + cval(2) = 1.d0 + cval(3) = 1.d0 + + rtol = 1.d-4 + + avtol(1) = 1.d-6 + avtol(2) = 1.d-11 + avtol(3) = 1.d-5 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_c => FN_VMake_Serial(neq, cval, sunctx) + if (.not. associated(sunvec_c)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set limits + t0 = 0.0d0 + tout = 0.4d0 + + call PrintHeader(rtol, avtol, yval, cval) + + ! Call FCVodeCreate and FCVodeInit to create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' + + retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) + if (retval /= 0) then + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeSVtolerances to set tolerances + retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create dense SUNMatrix for use in linear solves + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create dense SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeSetConstraints(cvode_mem, sunvec_c) + if (retval /= 0) then + print *, 'Error in FCVodeSetConstraints, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call FCVode, print results, and test for error. + + iout = 0 + do while(iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval .eq. CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + stop 1 + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. CV_SUCCESS) then + iout = iout + 1 + tout = tout * 10.0d0 + end if + end do + + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! find and print derivative at tret(1) + retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in CVodeGetDky' + stop 1 + end if + print *, " " + print *, "---------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "---------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + call PrintFinalStats(cvode_mem) + + ! free memory + call FCVodeFree(cvode_mem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_c) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y, c) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use RobertsDnsConstr_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq), c(neq) + + !======= Internals ============ + + print *, " " + print *, "cv_roberts_dns_constraints_f2003.f90: Robertson CV ODE serial example problem for CVODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,3(f5.2,1x),a)', "Constraints cval = (",c,")" + print *, " " + print *, "---------------------------------------------------" + print *, " t y1 y2 y3" + print *, "---------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(cvode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fcvode_mod + use RobertsDnsConstr_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: cvode_mem + real(c_double) :: t, y(neq) + + !======= Internals ============ + + print '(es12.4,1x,3(es12.4,1x))', t, y(1), y(2), y(3) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print ARKSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + integer(c_long) :: nluevals(1) ! number of LU evals + integer(c_long) :: ngevals(1) ! number of root evals + + !======= Internals ============ + + retval = FCVodeGetNumSteps(cvode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumGEvals(cvode_mem, ngevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function calls =',nfe + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Total root function calls =',ngevals + print '(4x,A,i9)' ,'Total LU function calls =',nluevals + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.out b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.out new file mode 100644 index 0000000000..36da8d04ff --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.out @@ -0,0 +1,44 @@ + + cv_roberts_dns_constraints_f2003.f90: Robertson CV ODE serial example problem for CVODE + Three equation chemical kinetics problem. + + Linear solver: DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-06 1.E-11 1.E-05 +Initial conditions y0 = ( 1.00 0.00 0.00 ) +Constraints cval = ( 1.00 1.00 1.00 ) + + --------------------------------------------------- + t y1 y2 y3 + --------------------------------------------------- + 2.6391E-01 9.8997E-01 3.4706E-05 1.0000E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8517E-01 3.3863E-05 1.4801E-02 + 4.0000E+00 9.0553E-01 2.2406E-05 9.4449E-02 + 4.0000E+01 7.1587E-01 9.1872E-06 2.8412E-01 + 4.0000E+02 4.5055E-01 3.2230E-06 5.4945E-01 + 4.0000E+03 1.8323E-01 8.9439E-07 8.1677E-01 + 4.0000E+04 3.8986E-02 1.6219E-07 9.6101E-01 + 4.0000E+05 4.9340E-03 1.9833E-08 9.9507E-01 + 4.0000E+06 5.1659E-04 2.0675E-09 9.9948E-01 + 1.9607E+07 1.0000E-04 4.0004E-10 9.9990E-01 + rootsfound[] = -1 0 + 4.0000E+07 5.1479E-05 2.0593E-10 9.9995E-01 + 4.0000E+08 6.0238E-06 2.4095E-11 9.9999E-01 + 4.0000E+09 4.6711E-07 1.8685E-12 1.0000E+00 + 4.0000E+10 3.4054E-09 1.3622E-14 1.0000E+00 + + --------------------------------------------------- + Final y1' y2' y3' + --------------------------------------------------- + 7.4513E-20 2.9805E-25 -7.4513E-20 + + General Solver Stats: + Total internal steps taken = 387 + Total rhs function calls = 561 + Total Jacobian function calls = 12 + Total root function calls = 425 + Total LU function calls = 95 + Num error test failures = 15 + Num nonlinear solver iters = 558 + Num nonlinear solver fails = 6 + diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 new file mode 100644 index 0000000000..751a2f2807 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 @@ -0,0 +1,531 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel M. Margolis @ SMU +! based off the previous Fortran-77 example program, +! cvode/fcmix_serial/fcvRoberts_dns.f +! ------------------------------------------------------------------ +! 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for CVODE, due to Robertson, +! is from chemical kinetics, and consists of the following three rate +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1.e-4 or at which +! y3 = 0.01. +! +! The problem is solved with CVODE using the DENSE linear +! solver, with a user-supplied Jacobian. Output is printed at +! t = .4, 4, 40, ..., 4e10. It uses ATOL much smaller for y2 +! than y1 or y3 because y2 has much smaller values. At the end +! of the run, various counters of interest are printed. +! ------------------------------------------------------------------ + +module robertsDns_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_int), parameter :: nout = 12 + integer(c_long), parameter :: neq = 3 + +contains + + ! ---------------------------------------------------------------- + ! fcnrob: The CVODE RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnrob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(t, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 1.0d-4 + gout(2) = yval(3) - 1.0d-2 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsunmatrix_dense_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! residual N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq,neq) :: J(:,:) + + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval => FN_VGetArrayPointer(sunvec_y) + J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) + + ! fill Jacobian entries + J(1,1) = -0.04d0 + J(2,1) = 0.04d0 + J(3,1) = 0.0d0 + J(1,2) = 1.0d4*yval(3) + J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3,2) = 6.0d7*yval(2) + J(1,3) = 1.0d4*yval(2) + J(2,3) = -1.0d4*yval(2) + J(3,3) = 0.0d0 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module robertsDns_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fcvode_mod ! Fortran interface to CVODE + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_dense_mod ! Fortran interface to dense SUNMatrix + use fsunlinsol_dense_mod ! Fortran interface to dense SUNLinearSolver + use robertsDns_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(c_ptr) :: cvode_mem ! CVode memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the robertsDns_mod module + real(c_double) :: yval(neq), avtol(neq), dkyval(neq) + + !======= Internals ============ + + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.0d0 + yval(2) = 0.0d0 + yval(3) = 0.0d0 + + rtol = 1.0d-4 + + avtol(1) = 1.0d-8 + avtol(2) = 1.0d-14 + avtol(3) = 1.0d-6 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set limits + t0 = 0.0d0 + tout = 0.4d0 + + call PrintHeader(rtol, avtol, yval) + + ! Call FCVodeCreate and FCVodeInit to create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' + + retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) + if (retval /= 0) then + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeSVtolerances to set tolerances + retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create dense SUNMatrix for use in linear solves + sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create dense SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call FCVode, print results, and test for error. + + iout = 0 + do while(iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval .eq. CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + stop 1 + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. CV_SUCCESS) then + iout = iout + 1 + tout = tout * 10.0d0 + end if + end do + + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! find and print derivative at tret(1) + retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in CVodeGetDky' + stop 1 + end if + print *, " " + print *, "---------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "---------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + call PrintFinalStats(cvode_mem) + + ! free memory + call FCVodeFree(cvode_mem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use robertsDns_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq) + + !======= Internals ============ + + print *, " " + print *, "cv_roberts_dns_f2003.f90: Robertson CV ODE serial example problem for CVODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print *, "Constraints not used." + print *, " " + print *, "---------------------------------------------------" + print *, " t y1 y2 y3" + print *, "---------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(cvode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use robertsDns_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: cvode_mem + real(c_double) :: t, y(neq) + + !======= Internals ============ + + print '(es12.4,1x,3(es12.4,1x))', t, y(1), y(2), y(3) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print ARKSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + integer(c_long) :: nluevals(1) ! number of LU evals + integer(c_long) :: ngevals(1) ! number of root evals + + !======= Internals ============ + + retval = FCVodeGetNumSteps(cvode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumGEvals(cvode_mem, ngevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function calls =',nfe + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Total root function calls =',ngevals + print '(4x,A,i9)' ,'Total LU function calls =',nluevals + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.out b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.out new file mode 100644 index 0000000000..5d72f8e9fd --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.out @@ -0,0 +1,44 @@ + + cv_roberts_dns_f2003.f90: Robertson CV ODE serial example problem for CVODE + Three equation chemical kinetics problem. + + Linear solver: DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-08 1.E-14 1.E-06 +Initial conditions y0 = ( 1.00 0.00 0.00 ) + Constraints not used. + + --------------------------------------------------- + t y1 y2 y3 + --------------------------------------------------- + 2.6391E-01 9.8997E-01 3.4706E-05 1.0000E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8516E-01 3.3862E-05 1.4802E-02 + 4.0000E+00 9.0551E-01 2.2403E-05 9.4468E-02 + 4.0000E+01 7.1580E-01 9.1850E-06 2.8419E-01 + 4.0000E+02 4.5054E-01 3.2233E-06 5.4946E-01 + 4.0000E+03 1.8324E-01 8.9447E-07 8.1676E-01 + 4.0000E+04 3.8983E-02 1.6217E-07 9.6102E-01 + 4.0000E+05 4.9397E-03 1.9856E-08 9.9506E-01 + 4.0000E+06 5.1710E-04 2.0695E-09 9.9948E-01 + 2.0803E+07 1.0000E-04 4.0004E-10 9.9990E-01 + rootsfound[] = -1 0 + 4.0000E+07 5.1996E-05 2.0800E-10 9.9995E-01 + 4.0000E+08 5.2109E-06 2.0844E-11 9.9999E-01 + 4.0000E+09 5.2178E-07 2.0871E-12 1.0000E+00 + 4.0000E+10 5.2696E-08 2.1079E-13 1.0000E+00 + + --------------------------------------------------- + Final y1' y2' y3' + --------------------------------------------------- + -1.2358E-18 -4.9433E-24 1.2358E-18 + + General Solver Stats: + Total internal steps taken = 503 + Total rhs function calls = 706 + Total Jacobian function calls = 11 + Total root function calls = 531 + Total LU function calls = 98 + Num error test failures = 17 + Num nonlinear solver iters = 703 + Num nonlinear solver fails = 4 + diff --git a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 new file mode 100644 index 0000000000..eef7aeab8e --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 @@ -0,0 +1,586 @@ +! ------------------------------------------------------------------ +! Programmer(s): Ting Yan @ SMU +! Based on cvRoberts_klu.c and modified to Fortran 77 +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! The following is a simple example problem for CVODE, due to Robertson, +! is from chemical kinetics, and consists of the following three rate +! equations: +! +! dy1/dt = -.04*y1 + 1.e4*y2*y3 +! dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 +! dy3/dt = 3.e7*y2**2 +! +! on the interval from t = 0.0 to t = 4.e10, with initial +! conditions: y1 = 1, y2 = y3 = 0. +! +! While integrating the system, we also use the rootfinding +! feature to find the points at which y1 = 1.e-4 or at which +! y3 = 0.01. +! +! The problem is solved with CVODE using the KLU sparse direct +! linear solver, with a user-supplied Jacobian. Output is +! printed at t = .4, 4, 40, ..., 4e10. It uses ATOL much smaller +! for y2 than y1 or y3 because y2 has much smaller values. At +! the end of the run, various counters of interest are printed. +! ------------------------------------------------------------------ + +module roberts_klu_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_int), parameter :: nout = 12 + integer(c_long), parameter :: neq = 3 + integer(c_long), parameter :: nnz = neq * neq + +contains + + ! ---------------------------------------------------------------- + ! fcnrob: The CVODE RHS operator function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & + result(ierr) bind(C,name='fcnrob') + + !======= Inclusions =========== + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! function N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(neq) :: fval(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval(1:neq) => FN_VGetArrayPointer(sunvec_y) + fval(1:neq) => FN_VGetArrayPointer(sunvec_f) + + ! fill residual vector + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) + + ! return success + ierr = 0 + return + + end function fcnrob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! grob: The root function routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function grob(t, sunvec_y, gout, user_data) & + result(ierr) bind(C,name='grob') + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + real(c_double) :: gout(2) ! root function values + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: yval(:) + + !======= Internals ============ + + ! get data array from SUNDIALS vector + yval(1:neq) => FN_VGetArrayPointer(sunvec_y) + + ! fill root vector + gout(1) = yval(1) - 1.0d-4 + gout(2) = yval(3) - 1.0d-2 + + ! return success + ierr = 0 + return + + end function grob + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! jacrob: The Jacobian function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C,name='jacrob') + + !======= Inclusions =========== + use fsunmatrix_sparse_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_f ! unused N_Vector + type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix + type(c_ptr), value :: user_data ! user-defined data + type(N_Vector) :: sunvec_t1 ! temporary N_Vectors + type(N_Vector) :: sunvec_t2 + type(N_Vector) :: sunvec_t3 + + ! pointers to data in SUNDIALS vector and matrix + real(c_double), pointer, dimension(neq) :: yval(:) + real(c_double), pointer, dimension(nnz) :: Jdata(:) + integer(c_long), pointer, dimension(nnz) :: Jrvals(:) + integer(c_long), pointer, dimension(neq+1) :: Jcptrs(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + yval(1:neq) => FN_VGetArrayPointer(sunvec_y) + Jcptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_J) + Jrvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) + Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) + + ! fill Jacobian sparse pointers + Jcptrs(1) = 0 + Jcptrs(2) = 3 + Jcptrs(3) = 6 + Jcptrs(4) = 9 + + ! fill Jacobian entries + Jdata(1) = -0.04d0 + Jrvals(1) = 0 + + Jdata(2) = 0.04d0 + Jrvals(2) = 1 + + Jdata(3) = 0.0d0 + Jrvals(3) = 2 + + + Jdata(4) = 1.0d4*yval(3) + Jrvals(4) = 0 + + Jdata(5) = -1.0d4*yval(3) - 6.0d7*yval(2) + Jrvals(5) = 1 + + Jdata(6) = 6.0d7*yval(2) + Jrvals(6) = 2 + + + Jdata(7) = 1.0d4*yval(2) + Jrvals(7) = 0 + + Jdata(8) = -1.0d4*yval(2) + Jrvals(8) = 1 + + Jdata(9) = 0.0d0 + Jrvals(9) = 2 + + ! return success + ierr = 0 + return + + end function jacrob + ! ---------------------------------------------------------------- + +end module roberts_klu_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fcvode_mod ! Fortran interface to CVODE + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunmatrix_sparse_mod ! Fortran interface to sparse SUNMatrix + use fsunlinsol_klu_mod ! Fortran interface to KLU sparse SUNLinearSolver + use roberts_klu_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, t0, tout, tret(1) + integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) + + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(c_ptr) :: cvode_mem ! CVode memory + type(c_ptr) :: sunctx ! SUNDIALS simulation context + + ! solution and tolerance vectors, neq is set in the roberts_klu_mod module + real(c_double), target :: yval(neq), avtol(neq), dkyval(neq) + + ! fine-tuning initialized here + real(c_double) :: initsize, nlscoef + integer(c_long), parameter :: mxsteps = 1000 + integer(c_int), parameter :: maxetf = 20 + + !======= Internals ============ + + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! initialize solution vectors and tolerances + yval(1) = 1.0d0 + yval(2) = 0.0d0 + yval(3) = 0.0d0 + + rtol = 1.0d-4 + + avtol(1) = 1.0d-6 + avtol(2) = 1.0d-12 + avtol(3) = 1.0d-4 + + initsize = 1.0d-4 * rtol + nlscoef = 1.0d-4 + + ! create serial vectors + sunvec_y => FN_VMake_Serial(neq, yval, sunctx) + if (.not. associated(sunvec_y)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) + if (.not. associated(sunvec_av)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! set limits + t0 = 0.0d0 + tout = 0.4d0 + + call PrintHeader(rtol, avtol, yval) + + ! Call FCVodeCreate and FCVodeInit to create and initialize CVode memory + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' + + retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) + if (retval /= 0) then + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeSVtolerances to set tolerances + retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) + if (retval /= 0) then + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Call FCVodeRootInit to specify the root function grob with 2 components + nrtfn = 2 + retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) + if (retval /= 0) then + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 + end if + + ! Create sparse SUNMatrix for use in linear solves + sunmat_A => FSUNSparseMatrix(neq, neq, nnz, CSC_MAT, sunctx) + if (.not. associated(sunmat_A)) then + print *, 'ERROR: sunmat = NULL' + stop 1 + end if + + ! Create KLU sparse SUNLinearSolver object + sunlinsol_LS => FSUNLinSol_KLU(sunvec_y, sunmat_A, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + retval = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) + if (retval /= 0) then + print *, 'Error in FCVodeSetMaxNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeSetMaxErrTestFails(cvode_mem, maxetf) + if (retval /= 0) then + print *, 'Error in FCVodeSetMaxErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeSetInitStep(cvode_mem, initsize) + if (retval /= 0) then + print *, 'Error in FCVodeSetInitStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeSetNonlinConvCoef(cvode_mem, nlscoef) + if (retval /= 0) then + print *, 'Error in FCVodeSetNonlinConvCoef, retval = ', retval, '; halting' + stop 1 + end if + + ! Attach the matrix and linear solver + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the user-supplied Jacobian routine + retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) + if (retval /= 0) then + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 + end if + + ! In loop, call FCVode, print results, and test for error. + + iout = 0 + do while(iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval .eq. CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' + stop 1 + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval .eq. CV_SUCCESS) then + iout = iout + 1 + tout = tout * 10.0d0 + end if + end do + + sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) + if (.not. associated(sunvec_dky)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! find and print derivative at tret(1) + retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) + if (retval /= 0) then + print *, 'Error in CVodeGetDky' + stop 1 + end if + print *, " " + print *, "---------------------------------------------------" + print *, " Final y1' y2' y3'" + print *, "---------------------------------------------------" + print '(13x,3(es12.4,1x))', dkyval + + call PrintFinalStats(cvode_mem) + + ! free memory + call FCVodeFree(cvode_mem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FSUNMatDestroy(sunmat_A) + call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_dky) + call FN_VDestroy(sunvec_av) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, avtol, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use roberts_klu_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol + real(c_double) :: avtol(neq) + real(c_double) :: y(neq) + + !======= Internals ============ + + print *, " " + print *, "cv_roberts_klu_f2003.f90: Robertson CV ODE serial example problem for CVODE" + print *, " Three equation chemical kinetics problem." + print *, " " + print *, "Linear solver: DENSE, with user-supplied Jacobian." + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print *, "Constraints not used." + print *, " " + print *, "---------------------------------------------------" + print *, " t y1 y2 y3" + print *, "---------------------------------------------------" + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(cvode_mem, t, y) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use roberts_klu_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: cvode_mem + real(c_double) :: t, y(neq) + + !======= Internals ============ + + print '(es12.4,1x,3(es12.4,1x))', t, y(1), y(2), y(3) + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print CVode statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(cvode_mem) + + !======= Inclusions =========== + use iso_c_binding + use fcvode_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: cvode_mem ! solver memory structure + + integer(c_int) :: retval ! error flag + + integer(c_long) :: nsteps(1) ! num steps + integer(c_long) :: nfe(1) ! num function evals + integer(c_long) :: netfails(1) ! num error test fails + integer(c_long) :: nniters(1) ! nonlinear solver iterations + integer(c_long) :: nncfails(1) ! nonlinear solver fails + integer(c_long) :: njacevals(1) ! number of Jacobian evaluations + integer(c_long) :: nluevals(1) ! number of LU evals + integer(c_long) :: ngevals(1) ! number of root evals + + !======= Internals ============ + + retval = FCVodeGetNumSteps(cvode_mem, nsteps) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FCVodeGetNumGEvals(cvode_mem, ngevals) + if (retval /= 0) then + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, ' General Solver Stats:' + print '(4x,A,i9)' ,'Total internal steps taken =',nsteps + print '(4x,A,i9)' ,'Total rhs function calls =',nfe + print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals + print '(4x,A,i9)' ,'Total root function calls =',ngevals + print '(4x,A,i9)' ,'Total LU function calls =',nluevals + print '(4x,A,i9)' ,'Num error test failures =',netfails + print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters + print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print *, ' ' + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.out b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.out new file mode 100644 index 0000000000..5ec1165cb9 --- /dev/null +++ b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.out @@ -0,0 +1,44 @@ + + cv_roberts_klu_f2003.f90: Robertson CV ODE serial example problem for CVODE + Three equation chemical kinetics problem. + + Linear solver: DENSE, with user-supplied Jacobian. +Tolerance parameters: rtol = 0.0001 atol = 1.E-06 1.E-12 1.E-04 +Initial conditions y0 = ( 1.00 0.00 0.00 ) + Constraints not used. + + --------------------------------------------------- + t y1 y2 y3 + --------------------------------------------------- + 2.6357E-01 9.8997E-01 3.4705E-05 1.0000E-02 + rootsfound[] = 0 1 + 4.0000E-01 9.8514E-01 3.3859E-05 1.4822E-02 + 4.0000E+00 9.0543E-01 2.2394E-05 9.4551E-02 + 4.0000E+01 7.1583E-01 9.1857E-06 2.8416E-01 + 4.0000E+02 4.5056E-01 3.2234E-06 5.4944E-01 + 4.0000E+03 1.8324E-01 8.9446E-07 8.1676E-01 + 4.0000E+04 3.8981E-02 1.6217E-07 9.6102E-01 + 4.0000E+05 4.9378E-03 1.9848E-08 9.9506E-01 + 4.0000E+06 5.1595E-04 2.0648E-09 9.9948E-01 + 2.0821E+07 1.0000E-04 4.0004E-10 9.9990E-01 + rootsfound[] = -1 0 + 4.0000E+07 5.1479E-05 2.0592E-10 9.9995E-01 + 4.0000E+08 5.4266E-06 2.1707E-11 9.9999E-01 + 4.0000E+09 4.6488E-07 1.8595E-12 1.0000E+00 + 4.0000E+10 4.8655E-08 1.9462E-13 1.0000E+00 + + --------------------------------------------------- + Final y1' y2' y3' + --------------------------------------------------- + -8.8151E-19 -3.5260E-24 8.8151E-19 + + General Solver Stats: + Total internal steps taken = 317 + Total rhs function calls = 941 + Total Jacobian function calls = 40 + Total root function calls = 357 + Total LU function calls = 117 + Num error test failures = 11 + Num nonlinear solver iters = 940 + Num nonlinear solver fails = 40 + diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index ca87306afe..517d64133c 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -77,9 +77,6 @@ endforeach(example_tuple ${FCVODES_examples}) # create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) - # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODES") set(SOLVER_LIB "sundials_cvodes") diff --git a/examples/cvodes/F2003_serial/README b/examples/cvodes/F2003_serial/README deleted file mode 100644 index 0b86b16740..0000000000 --- a/examples/cvodes/F2003_serial/README +++ /dev/null @@ -1,42 +0,0 @@ -List of serial CVODES F2003 examples - -(1) Simulation - - cvs_analytic_fp_f2003.f90 : simple example problem with an analytical solution (fixedpoint) - -(2) Forward sensitivity - - cvsAdvDiff_FSA_non_f2003.f90 : 1-D advection difusion PDE - Adams with Functional iteration - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=ON \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_ENABLE_F2003=ON \ --DEXAMPLES_INSTALL=ON \ --DBUILD_FORTRAN_MODULE_INTERFACE=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 - diff --git a/examples/ida/CMakeLists.txt b/examples/ida/CMakeLists.txt index 432f8fe8ef..60b3867f90 100644 --- a/examples/ida/CMakeLists.txt +++ b/examples/ida/CMakeLists.txt @@ -45,6 +45,12 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) + if(ENABLE_MPI) + add_subdirectory(F2003_parallel) + endif() + if(ENABLE_OPENMP AND OPENMP_FOUND) + add_subdirectory(F2003_openmp) + endif() endif() # cuda examples diff --git a/examples/ida/F2003_openmp/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt new file mode 100644 index 0000000000..215563c7a4 --- /dev/null +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -0,0 +1,131 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# modified by Daniel M. Margolis @ 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 IDA OpenMP examples +# --------------------------------------------------------------- + +# Example lists are tuples "name\;args\;type" where the type is +# 'develop' for examples excluded from 'make test' in releases + +# Examples using SUNDIALS linear solvers +set(FIDA_examples_OMP + "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" + "idaHeat2D_kry_omp_f2003.f90\;8\;exclude" + ) + +# Specify libraries to link against +set(IDA_LIB sundials_fida_mod) + +# Set-up linker flags and link libraries +set(SUNDIALS_LIBS ${IDA_LIB} ${EXE_EXTRA_LINK_LIBS}) + +# Add the build and install targets for each example +foreach(example_tuple ${FIDA_examples_OMP}) + # parse the example tuple + list(GET example_tuple 0 example_file) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 example_type) + + # extract the file name without extension + get_filename_component(example ${example_file} NAME_WE) + + if(NOT TARGET ${example}) + add_executable(${example} ${example_file}) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + + # libraries to link against + target_link_libraries(${example} + sundials_ida + sundials_fida_mod + sundials_nvecopenmp + sundials_fnvecopenmp_mod + ${SUNDIALS_LIBS}) + + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + + endif() + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example}) + else() + string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test(${test_name} ${example} + TEST_ARGS ${example_args} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + EXAMPLE_TYPE ${example_type}) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${test_name}.out + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) + endif() +endforeach(example_tuple ${FIDA_examples_OMP}) + +# create Makefile and CMakeLists.txt for examples +if(EXAMPLES_INSTALL) + + # Prepare substitution variables for Makefile and/or CMakeLists templates + set(SOLVER "IDA") + set(SOLVER_LIB "sundials_ida") + set(SOLVER_FLIB "sundials_fida_mod") + + examples2string(FIDA_examples_OMP EXAMPLES) + + # Regardless of the platform we're on, we will generate and install + # CMakeLists.txt file for building the examples. This file can then + # be used as a template for the user's own programs. + + # generate CMakelists.txt in the binary directory + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt + @ONLY + ) + + # install CMakelists.txt + install( + FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp + ) + + # On UNIX-type platforms, we also generate and install a makefile for + # building the examples. This makefile can then be used as a template + # for the user's own programs. + + if(UNIX) + # generate Makefile and place it in the binary dir + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex + @ONLY + ) + # install the configured Makefile_ex as Makefile + install( + FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp + RENAME Makefile + ) + endif() + + # add test_install target + sundials_add_test_install(ida F2003_openmp) + +endif() diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 new file mode 100644 index 0000000000..790b62326c --- /dev/null +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 @@ -0,0 +1,697 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! Example problem for IDA: 2D heat equation, OpenMP, GMRES. +! +! This example solves a discretized 2D heat equation problem. +! This version uses the Krylov solver Spgmr. +! +! The DAE system solved is a spatial discretization of the PDE +! du/dt = d^2u/dx^2 + d^2u/dy^2 +! on the unit square. The boundary condition is u = 0 on all edges. +! Initial conditions are given by u = 16 x (1 - x) y (1 - y). The +! PDE is treated with central differences on a uniform M x M grid. +! The values of u at the interior points satisfy ODEs, and +! equations u = 0 at the boundaries are appended, to form a DAE +! system of size N = M^2. Here M = 100. +! +! The system is solved with IDA using the Krylov linear solver +! SPGMR. The preconditioner uses the diagonal elements of the +! Jacobian only. Routines for preconditioning, required by +! SPGMR, are supplied here. The constraints u >= 0 are posed +! for all components. Output is taken at t = 0, .01, .02, .04, +! ..., 10.24. Two cases are run -- with the Gram-Schmidt type +! being Modified in the first case, and Classical in the second. +! The second run uses IDAReInit. +! ------------------------------------------------------------------ + +module idaHeat2DKryOMP_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use, intrinsic :: omp_lib + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_int), parameter :: nout = 11 + integer(c_int), parameter :: mgrid = 100 + integer(c_long), parameter :: neq = mgrid*mgrid + + real(c_double) :: dx + real(c_double) :: coeff + real(c_double) :: pp(mgrid,mgrid) + +contains + + ! ---------------------------------------------------------------- + ! resHeat: The DAE residual function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) & + result(ierr) bind(C,name='resHeat') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: tres ! current time + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_up ! derivative N_Vector + type(N_Vector) :: sunvec_r ! residual N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(mgrid,mgrid) :: u(:,:) + real(c_double), pointer, dimension(mgrid,mgrid) :: up(:,:) + real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) + + ! local variables + integer(c_long) :: i, j + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) + up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + + ! Initialize r to u, to take care of boundary equations + !$omp parallel + !$omp workshare + r = u + !$omp end workshare + + ! Loop over interior points; set res = up - (central difference) + !$omp do collapse(2) private(i,j) + do j = 2,mgrid-1 + do i = 2,mgrid-1 + r(i,j) = up(i,j) - coeff*( u(i-1,j) + u(i+1,j) + u(i,j-1) + u(i,j+1) - 4.d0*u(i,j)) + end do + end do + !$omp end do + !$omp end parallel + + ! return success + ierr = 0 + return + + end function resHeat + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! PsetupHeat: Preconditioner setup routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_data) & + result(ierr) bind(C,name='PSetupHeat') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + real(c_double), value :: cj ! step size scaling factor + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_up ! derivative N_Vector + type(N_Vector) :: sunvec_r ! residual N_Vector + type(c_ptr), value :: prec_data ! preconditioner data + + ! local variables + real(c_double) :: pelinv + + !======= Internals ============ + + ! initialize pp to 1 + pp = 1.d0 + + ! Compute the inverse of the preconditioner diagonal elements + pelinv = 1.d0/(cj + 4.d0*coeff) + + ! set the interior points to the correct value for preconditioning + !$omp parallel workshare + pp(2:mgrid-1, 2:mgrid-1) = pelinv + !$omp end parallel workshare + + ! return success + ierr = 0 + return + + end function PSetupHeat + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! PsolveHeat: Preconditioner solve routine + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, & + sunvec_sol, cj, delta, prec_data) result(ierr) bind(C,name='PSolveHeat') + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + real(c_double), value :: cj ! step size scaling factor + real(c_double), value :: delta ! desired preconditioner solve accuracy + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_up ! derivative N_Vector + type(N_Vector) :: sunvec_r ! residual N_Vector + type(N_Vector) :: sunvec_rhs ! rhs N_Vector + type(N_Vector) :: sunvec_sol ! solution N_Vector + type(c_ptr), value :: prec_data ! preconditioner data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(mgrid,mgrid) :: rhs(:,:) + real(c_double), pointer, dimension(mgrid,mgrid) :: sol(:,:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + rhs(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_rhs) + sol(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_sol) + + ! Apply preconditioner to rhs to create sol + !$omp parallel workshare + sol = rhs * pp + !$omp end parallel workshare + + ! return success + ierr = 0 + return + + end function PSolveHeat + ! ---------------------------------------------------------------- + +end module idaHeat2DKryOMP_mod +! ------------------------------------------------------------------ + + +program main + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fida_mod ! Fortran interface to IDA + use fnvector_openmp_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + use idaHeat2DKryOMP_mod ! ODE functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: rtol, atol, t0, t1, tout, tret(1) + integer(c_int) :: retval, iout + integer(c_long) :: netf(1), ncfn(1), ncfl(1) + + type(N_Vector), pointer :: sunvec_u ! sundials solution vector + type(N_Vector), pointer :: sunvec_up ! sundials derivative vector + type(N_Vector), pointer :: sunvec_c ! sundials constraints vector + type(N_Vector), pointer :: sunvec_r ! sundials residual vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(c_ptr) :: ida_mem ! IDA memory + type(c_ptr) :: sunctx ! sundials simulation context + integer :: nargs, nthreads, length, status + character(len=32) :: arg ! input arg + + ! solution, residual and constraints vectors, mgrid is set in the idaHeat2DKryOMP_mod module + real(c_double), dimension(mgrid,mgrid) :: uu, up, res, constraints + + !======= Internals ============ + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + + ! get the number of threads passed in as a command line argument (if applicable) + nargs = command_argument_count() + if (nargs > 0) then + call get_command_argument(1, arg, length, status) + read(arg,*) nthreads + else + nthreads = 6 + endif + call omp_set_num_threads(nthreads) + + ! Assign parameters in idaHeat2DKryOMP_mod + dx = 1.d0/(mgrid-1) + coeff = 1.d0/(dx * dx) + + ! create N_Vectors + sunvec_u => FN_VMake_OpenMP(neq, uu, nthreads, sunctx) + if (.not. associated(sunvec_u)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_up => FN_VMake_OpenMP(neq, up, nthreads, sunctx) + if (.not. associated(sunvec_up)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_r => FN_VMake_OpenMP(neq, res, nthreads, sunctx) + if (.not. associated(sunvec_r)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + sunvec_c => FN_VMake_OpenMP(neq, constraints, nthreads, sunctx) + if (.not. associated(sunvec_c)) then + print *, 'ERROR: sunvec = NULL' + stop 1 + end if + + ! Initialize solution vectors + call SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) + + ! Set constraints to all 1's for nonnegative solution values + constraints = 1.d0 + + ! Assign various parameters + t0 = 0.d0 + t1 = 0.01d0 + rtol = 0.d0 + atol = 1.d-3 + + ! Call FIDACreate and FIDAInit to initialize solution + ida_mem = FIDACreate(sunctx) + if (.not. c_associated(ida_mem)) then + print *, 'ERROR: ida_mem = NULL' + stop 1 + end if + + retval = FIDASetConstraints(ida_mem, sunvec_c) + if (retval /= 0) then + print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAInit(ida_mem, c_funloc(resHeat), t0, sunvec_u, sunvec_up) + if (retval /= 0) then + print *, 'Error in FIDAInit, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDASStolerances(ida_mem, rtol, atol) + if (retval /= 0) then + print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' + stop 1 + end if + + ! Create the linear solver SUNLinSol_SPGMR with left preconditioning + ! and the default Krylov dimension + sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, SUN_PREC_LEFT, 0, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *, 'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! IDA recommends allowing up to 5 restarts (default is 0) + retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, 5) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 + end if + + ! Attach the linear solver (will NULL SUNMatrix object) + sunmat_A => null() + retval = FIDASetLinearSolver(ida_mem, sunlinsol_LS, sunmat_A) + if (retval /= 0) then + print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! Set the preconditioner solve and setup functions */ + retval = FIDASetPreconditioner(ida_mem, c_funloc(PsetupHeat), c_funloc(PsolveHeat)) + if (retval /= 0) then + print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' + stop 1 + end if + + ! Print output heading + call PrintHeader(rtol, atol) + + !------------------------------------- + ! CASE I + !------------------------------------- + + ! Print case number, output table heading, and initial line of table + + print *, " " + print *, " " + print *, "Case 1: gsytpe = SUN_MODIFIED_GS" + print *, " " + print *, " Output Summary (umax = max-norm of solution)" + print *, " " + print *, " time umax k nst nni nje nre nreLS h npe nps" + print *, "----------------------------------------------------------------------" + + ! Loop over output times, call IDASolve, and print results + + tout = t1 + do iout = 1,NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout + end do + + ! Print remaining counters + retval = FIDAGetNumErrTestFails(ida_mem, netf) + if (retval /= 0) then + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) + if (retval /= 0) then + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumLinConvFails(ida_mem, ncfl) + if (retval /= 0) then + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 + end if + + print *, " " + print '(a,i1)', "Error test failures = ", netf + print '(a,i1)', "Nonlinear convergence failures = ", ncfn + print '(a,i1)', "Linear convergence failures = ", ncfl + + !------------------------------------- + ! CASE II + !------------------------------------- + + ! Re-initialize uu, up + + call SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) + + ! Re-initialize IDA and SPGMR + + retval = FIDAReInit(ida_mem, t0, sunvec_u, sunvec_up) + if (retval /= 0) then + print *, 'Error in FIDAReInit, retval = ', retval, '; halting' + stop 1 + end if + + retval = FSUNLinSol_SPGMRSetGSType(sunlinsol_LS, SUN_CLASSICAL_GS) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' + stop 1 + end if + + ! Print case number, output table heading, and initial line of table + + print *, " " + print *, " " + print *, "Case 2: gsytpe = SUN_CLASSICAL_GS" + print *, " " + print *, " Output Summary (umax = max-norm of solution)" + print *, " " + print *, " time umax k nst nni nje nre nreLS h npe nps" + print *, "----------------------------------------------------------------------" + + ! Loop over output times, call IDASolve, and print results + tout = t1 + do iout = 1,NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout + end do + + ! Print remaining counters + + retval = FIDAGetNumErrTestFails(ida_mem, netf) + if (retval /= 0) then + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) + if (retval /= 0) then + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumLinConvFails(ida_mem, ncfl) + if (retval /= 0) then + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 + end if + + print *, " " + print '(a,i1)', "Error test failures = ", netf + print '(a,i1)', "Nonlinear convergence failures = ", ncfn + print '(a,i1)', "Linear convergence failures = ", ncfl + + ! free memory + call FIDAFree(ida_mem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_up) + call FN_VDestroy(sunvec_r) + call FN_VDestroy(sunvec_c) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! SetInitialProfile: routine to initialize u and up vectors. +! ---------------------------------------------------------------- +subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use idaHeat2DKryOMP_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_up ! derivative N_Vector + type(N_Vector) :: sunvec_r ! residual N_Vector + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(mgrid,mgrid) :: uu(:,:) + real(c_double), pointer, dimension(mgrid,mgrid) :: up(:,:) + real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) + + ! local variables + integer(c_long) :: i, j + real(c_double) :: xfact, yfact + integer(c_int) :: retval + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uu(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) + up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + + !======= Internals ============ + + ! Initialize uu on all grid points + !$omp parallel do collapse(2) private(yfact,xfact,i,j) + do j = 1,mgrid + do i = 1,mgrid + yfact = dx * (j-1) + xfact = dx * (i-1) + uu(i,j) = 16.d0 * xfact * (1.d0 - xfact) * yfact * (1.d0 - yfact) + end do + end do + !$omp end parallel do + + ! Initialize up vector to 0 + up = 0.d0 + + ! resHeat sets res to negative of ODE RHS values at interior points + retval = resHeat(0.d0, sunvec_u, sunvec_up, sunvec_r, C_NULL_PTR) + + ! Copy -r into up to get correct interior initial up values + !$omp parallel workshare + up = -r + !$omp end parallel workshare + + ! Set up at boundary points to zero + up(1,:) = 0.d0 + up(mgrid,:) = 0.d0 + up(:,1) = 0.d0 + up(:,mgrid) = 0.d0 + + return +end subroutine SetInitialProfile +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintHeader: prints first lines of output (problem description) +! ---------------------------------------------------------------- +subroutine PrintHeader(rtol, atol) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use idaHeat2DKryOMP_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double) :: rtol, atol + + !======= Internals ============ + + print *, " " + print *, "idaHeat2D_kry: Heat equation, OpenMP example problem for IDA" + print *, " Discretized heat equation on 2D unit square." + print *, " Zero boundary conditions, polynomial initial conditions." + print '(2(a,i4),a,i8)', " Mesh dimensions: ", mgrid, " x ", mgrid, & + " Total system size: ", neq + print *, " " + print *, " Number of OpenMP threads = ", omp_get_max_threads() + print *, " " + print '(2(a,es8.1))', "Tolerance parameters: rtol = ", rtol," atol = ", atol + print *, "Constraints set to force all solution components >= 0." + print *, "Linear solver: SPGMR, preconditioner using diagonal elements." + + return +end subroutine PrintHeader +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput +! ---------------------------------------------------------------- +subroutine PrintOutput(ida_mem, t, uu) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fida_mod + use idaHeat2DKryOMP_mod + + !======= Declarations ========= + implicit none + + ! calling variable + type(c_ptr) :: ida_mem + real(c_double) :: t, uu(mgrid,mgrid) + + ! internal variables + integer(c_int) :: retval, kused(1) + integer(c_long) :: nst(1), nni(1), nje(1), nre(1), nreLS(1), nli(1), npe(1), nps(1) + real(c_double) :: hused(1), umax + + !======= Internals ============ + + umax = maxval(abs(uu)) + + retval = FIDAGetLastOrder(ida_mem, kused) + if (retval /= 0) then + print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumSteps(ida_mem, nst) + if (retval /= 0) then + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) + if (retval /= 0) then + print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumResEvals(ida_mem, nre) + if (retval /= 0) then + print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetLastStep(ida_mem, hused) + if (retval /= 0) then + print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumJtimesEvals(ida_mem, nje) + if (retval /= 0) then + print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumLinIters(ida_mem, nli) + if (retval /= 0) then + print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumLinResEvals(ida_mem, nreLS) + if (retval /= 0) then + print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumPrecEvals(ida_mem, npe) + if (retval /= 0) then + print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FIDAGetNumPrecSolves(ida_mem, nps) + if (retval /= 0) then + print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 + end if + + + print '(f5.2,1x,es13.5,4x,i1,2x,3(i3,2x),2(i4,2x),es9.2,2x,2(i3,1x))', & + t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps + +end subroutine PrintOutput +! ---------------------------------------------------------------- diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out new file mode 100644 index 0000000000..bac15b817b --- /dev/null +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out @@ -0,0 +1,57 @@ + + idaHeat2D_kry: Heat equation, OpenMP example problem for IDA + Discretized heat equation on 2D unit square. + Zero boundary conditions, polynomial initial conditions. + Mesh dimensions: 100 x 100 Total system size: 10000 + + Number of OpenMP threads = 4 + +Tolerance parameters: rtol = 0.0E+00 atol = 1.0E-03 + Constraints set to force all solution components >= 0. + Linear solver: SPGMR, preconditioner using diagonal elements. + + + Case 1: gsytpe = SUN_MODIFIED_GS + + Output Summary (umax = max-norm of solution) + + time umax k nst nni nje nre nreLS h npe nps + ---------------------------------------------------------------------- + 0.01 8.45000E-01 1 17 24 44 24 44 1.28E-03 8 68 + 0.02 7.01828E-01 1 22 34 96 34 96 1.99E-03 9 130 + 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 + 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 + 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 + 0.32 1.41347E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41330E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82940E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11146E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16022E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.33003E-02 1 100 171 691 171 691 9.06E-01 46 862 + +Error test failures = 3 +Nonlinear convergence failures = 5 +Linear convergence failures = 2 + + + Case 2: gsytpe = SUN_CLASSICAL_GS + + Output Summary (umax = max-norm of solution) + + time umax k nst nni nje nre nreLS h npe nps + ---------------------------------------------------------------------- + 0.01 8.45000E-01 1 17 24 44 24 44 1.28E-03 8 68 + 0.02 7.01828E-01 1 22 34 96 34 96 1.99E-03 9 130 + 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 + 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 + 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 + 0.32 1.41348E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41341E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82948E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11155E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16043E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.32890E-02 1 100 171 691 171 691 9.06E-01 46 862 + +Error test failures = 3 +Nonlinear convergence failures = 5 +Linear convergence failures = 2 diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out new file mode 100644 index 0000000000..a981fa9d2c --- /dev/null +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out @@ -0,0 +1,57 @@ + + idaHeat2D_kry: Heat equation, OpenMP example problem for IDA + Discretized heat equation on 2D unit square. + Zero boundary conditions, polynomial initial conditions. + Mesh dimensions: 100 x 100 Total system size: 10000 + + Number of OpenMP threads = 8 + +Tolerance parameters: rtol = 0.0E+00 atol = 1.0E-03 + Constraints set to force all solution components >= 0. + Linear solver: SPGMR, preconditioner using diagonal elements. + + + Case 1: gsytpe = SUN_MODIFIED_GS + + Output Summary (umax = max-norm of solution) + + time umax k nst nni nje nre nreLS h npe nps + ---------------------------------------------------------------------- + 0.01 8.45000E-01 1 17 24 44 24 44 1.28E-03 8 68 + 0.02 7.01828E-01 1 22 34 96 34 96 1.99E-03 9 130 + 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 + 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 + 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 + 0.32 1.41348E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41358E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82960E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11169E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16076E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.32728E-02 1 100 171 691 171 691 9.06E-01 46 862 + +Error test failures = 3 +Nonlinear convergence failures = 5 +Linear convergence failures = 2 + + + Case 2: gsytpe = SUN_CLASSICAL_GS + + Output Summary (umax = max-norm of solution) + + time umax k nst nni nje nre nreLS h npe nps + ---------------------------------------------------------------------- + 0.01 8.45000E-01 1 17 24 44 24 44 1.28E-03 8 68 + 0.02 7.01828E-01 1 22 34 96 34 96 1.99E-03 9 130 + 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 + 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 + 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 + 0.32 1.41347E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41321E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82934E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11140E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16006E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.33084E-02 1 100 171 691 171 691 9.06E-01 46 862 + +Error test failures = 3 +Nonlinear convergence failures = 5 +Linear convergence failures = 2 diff --git a/examples/ida/F2003_parallel/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt new file mode 100644 index 0000000000..908a89cc9b --- /dev/null +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -0,0 +1,149 @@ +# --------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# modified by Daniel M. Margolis @ 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the IDA F2003 module parallel examples +# --------------------------------------------------------------- + +# Example lists are tuples "name\;nodes\;tasks\;type" where the +# type is develop for examples excluded from 'make test' in releases +if(MPI_ENABLED) + set(FIDA_examples + "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") +endif() + + +# Specify libraries to link against +set(IDA_LIBS + sundials_ida + sundials_fida_mod + sundials_nvecparallel + sundials_fnvecparallel_mod) + +# Set-up linker flags and link libraries +set(SUNDIALS_LIBS ${IDA_LIBS} ${EXE_EXTRA_LINK_LIBS}) + +# Add the build and install targets for each example +foreach(example_tuple ${FIDA_examples}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 number_of_nodes) + list(GET example_tuple 3 number_of_tasks) + list(GET example_tuple 4 example_type) + list(GET example_tuple 5 example_precision) + + if(NOT TARGET ${example}) + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + + # example source files + add_executable(${example} ${example}.f90) + + # libraries to link against + target_link_libraries(${example} MPI::MPI_Fortran ${SUNDIALS_LIBS}) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + endif() + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example}) + else() + string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test(${test_name} ${example} + TEST_ARGS ${example_args} + MPI_NPROCS ${number_of_tasks} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + EXAMPLE_TYPE ${example_type} + FLOAT_PRECISION ${example_precision}) + + # find all .out files for this example + file(GLOB example_out ${example}*.out) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example_out} + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + endif() + +endforeach(example_tuple ${FIDA_examples}) + + +# create Makfile and CMakeLists.txt for examples +if(EXAMPLES_INSTALL) + + # Install the extra files + foreach(extrafile ${IDA_extras}) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + endforeach() + + # Prepare substitution variables for Makefile and/or CMakeLists templates + set(SOLVER "IDA") + + # Makefile: convert semi-colon separated target list to space separated string + list2string(IDA_LIBS EXAMPLE_LIBS) + + # CMakeLists: replace sundials_ prefix and convert to space separted string + list(TRANSFORM IDA_LIBS REPLACE "sundials_" "SUNDIALS::" + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) + + examples2string(FIDA_examples EXAMPLES) + + # Regardless of the platform we're on, we will generate and install + # CMakeLists.txt file for building the examples. This file can then + # be used as a template for the user's own programs. + + # generate CMakelists.txt in the binary directory + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt + @ONLY + ) + + # install CMakelists.txt + install( + FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel + ) + + # On UNIX-type platforms, we also generate and install a makefile for + # building the examples. This makefile can then be used as a template + # for the user's own programs. + + if(UNIX) + # generate Makefile and place it in the binary dir + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex + @ONLY + ) + # install the configured Makefile_ex as Makefile + install( + FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel + RENAME Makefile + ) + endif() + + # add test_install target + sundials_add_test_install(ida F2003_parallel) + +endif() diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 new file mode 100644 index 0000000000..b3ee8dbff4 --- /dev/null +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 @@ -0,0 +1,1045 @@ +! ---------------------------------------------------------------- +! Programmer(s): Daniel R. Reynolds @ SMU +! Radu Serban and Alan C. Hindmarsh @ LLNL +! modified by Daniel M. Margolis @ 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 +! ---------------------------------------------------------------- +! Example problem for FIDA: 2D heat equation, parallel, GMRES, +! IDABBDPRE. +! +! This example solves a discretized 2D heat equation problem. +! This version uses the Krylov solver SUNSPGMR and BBD +! preconditioning. +! +! The DAE system solved is a spatial discretization of the PDE +! du/dt = d^2u/dx^2 + d^2u/dy^2 +! on the unit square. The boundary condition is u = 0 on all edges. +! Initial conditions are given by u = 16 x (1 - x) y (1 - y). The +! PDE is treated with central differences on a uniform MX x MY +! grid. The values of u at the interior points satisfy ODEs, and +! equations u = 0 at the boundaries are appended, to form a DAE +! system of size N = MX * MY. Here MX = MY = 10. +! +! The system is actually implemented on submeshes, processor by +! processor, with an MXSUB by MYSUB mesh on each of NPEX * NPEY +! processors. +! +! The system is solved with FIDA using the Krylov linear solver +! SUNSPGMR in conjunction with the preconditioner module IDABBDPRE. +! The preconditioner uses a tridiagonal approximation +! (half-bandwidths = 1). The constraints u >= 0 are posed for all +! components. Local error testing on the boundary values is +! suppressed. Output is taken at t = 0, .01, .02, .04, ..., 10.24. +! ---------------------------------------------------------------- + +module Heat2DKryBBD_mod + ! -------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters, as well as + ! data buffers for MPI exchanges with neighboring processes. + ! Also contains routines to: + ! (a) initialize the module + ! (b) perform exchanges + ! (c) free module data. + ! -------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! Grid and MPI domain decomposition information + integer :: nx ! global number of x grid points + integer :: ny ! global number of y grid points + integer :: is ! global x indices of this subdomain + integer :: ie + integer :: js ! global y indices of this subdomain + integer :: je + integer :: nxl ! local number of x grid points + integer :: nyl ! local number of y grid points + integer(c_long) :: N, Ntot + real(c_double) :: dx ! x-directional mesh spacing + real(c_double) :: dy ! y-directional mesh spacing + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + logical :: HaveNbor(2,2) ! flags denoting neighbor on boundary + real(c_double), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange + real(c_double), dimension(:), allocatable :: Wrecv + real(c_double), dimension(:), allocatable :: Nrecv + real(c_double), dimension(:), allocatable :: Srecv + real(c_double), dimension(:), allocatable :: Esend ! send buffers for neighbor exchange + real(c_double), dimension(:), allocatable :: Wsend + real(c_double), dimension(:), allocatable :: Nsend + real(c_double), dimension(:), allocatable :: Ssend + + ! Problem parameters + integer(c_long) :: mudq, mldq, mu, ml + integer(c_int) :: maxl + real(c_double) :: kx ! x-directional diffusion coefficient + real(c_double) :: ky ! y-directional diffusion coefficient + + ! Printed parameters + real(c_double) :: h(1) ! size of last step + integer(c_int) :: k(1) ! number of last order + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nre(1) ! number of residual evals + integer(c_long) :: nreLS(1) ! number of residual linear solver evals + integer(c_long) :: nge(1) ! number of implicit RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nncf(1) ! number of nonlinear convergence fails + integer(c_long) :: nlcf(1) ! number of linear convergence fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + +contains + + ! -------------------------------------------------------------- + ! Initialize memory allocated within Userdata (set to defaults) + ! -------------------------------------------------------------- + subroutine InitHeat2DData() + implicit none + nx = 0 + ny = 0 + is = 0 + ie = 0 + js = 0 + je = 0 + nxl = 0 + nyl = 0 + dx = 0.d0 + dy = 0.d0 + kx = 0.d0 + ky = 0.d0 + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + HaveNbor = .false. + if (allocated(Erecv)) deallocate(Erecv) + if (allocated(Wrecv)) deallocate(Wrecv) + if (allocated(Nrecv)) deallocate(Nrecv) + if (allocated(Srecv)) deallocate(Srecv) + if (allocated(Esend)) deallocate(Esend) + if (allocated(Wsend)) deallocate(Wsend) + if (allocated(Nsend)) deallocate(Nsend) + if (allocated(Ssend)) deallocate(Ssend) + end subroutine InitHeat2DData + ! -------------------------------------------------------------- + + + ! -------------------------------------------------------------- + ! Set up parallel decomposition + ! -------------------------------------------------------------- + subroutine SetupDecomp(ierr) + ! declarations + implicit none + + integer, intent(out) :: ierr + integer :: dims(2), periods(2), coords(2) + + ! internals + + ! get suggested parallel decomposition + dims = (/0, 0/) + call MPI_Comm_size(MPI_COMM_WORLD, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = " , ierr + return + end if + call MPI_Dims_create(nprocs, 2, dims, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Dims_create = " , ierr + return + end if + + ! set up 2D Cartesian communicator + periods = (/0, 0/) + call MPI_Cart_create(MPI_COMM_WORLD, 2, dims, periods, 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_create = " , ierr + return + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = " , ierr + return + end if + + ! determine local extents + call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_get = " , ierr + return + end if + is = nx*coords(1)/dims(1) + 1 + ie = nx*(coords(1)+1)/dims(1) + js = ny*coords(2)/dims(2) + 1 + je = ny*(coords(2)+1)/dims(2) + nxl = ie-is+1 + nyl = je-js+1 + + ! determine if I have neighbors, and allocate exchange buffers + HaveNbor(1,1) = (is /= 1) + HaveNbor(1,2) = (ie /= nx) + HaveNbor(2,1) = (js /= 1) + HaveNbor(2,2) = (je /= ny) + if (HaveNbor(1,1)) then + allocate(Wrecv(nyl)) + allocate(Wsend(nyl)) + end if + if (HaveNbor(1,2)) then + allocate(Erecv(nyl)) + allocate(Esend(nyl)) + end if + if (HaveNbor(2,1)) then + allocate(Srecv(nxl)) + allocate(Ssend(nxl)) + end if + if (HaveNbor(2,2)) then + allocate(Nrecv(nxl)) + allocate(Nsend(nxl)) + end if + + ierr = 0 ! return with success flag + return + end subroutine SetupDecomp + ! -------------------------------------------------------------- + + ! -------------------------------------------------------------- + ! Free memory allocated within Userdata + ! -------------------------------------------------------------- + subroutine FreeHeat2DData(ierr) + implicit none + integer, intent(out) :: ierr + if (allocated(Wrecv)) deallocate(Wrecv) + if (allocated(Wsend)) deallocate(Wsend) + if (allocated(Erecv)) deallocate(Erecv) + if (allocated(Esend)) deallocate(Esend) + if (allocated(Srecv)) deallocate(Srecv) + if (allocated(Ssend)) deallocate(Ssend) + if (allocated(Nrecv)) deallocate(Nrecv) + if (allocated(Nsend)) deallocate(Nsend) + ierr = 0 ! return with success flag + return + end subroutine FreeHeat2DData + ! -------------------------------------------------------------- + + subroutine InitProfile(sunvec_y, sunvec_ydot, sunvec_id, & + sunvec_res, sunvec_c, ierr) + use fnvector_parallel_mod + implicit none + type(N_Vector), pointer, intent(inout) :: sunvec_y + type(N_Vector), pointer, intent(inout) :: sunvec_ydot + type(N_Vector), pointer, intent(inout) :: sunvec_id + type(N_Vector), pointer, intent(inout) :: sunvec_res + type(N_Vector), pointer, intent(inout) :: sunvec_c + integer(c_int), intent(in) :: ierr + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:), ydot(:,:), id(:,:), res(:,:), cstr(:,:) + real(c_double) :: xreal, yreal + integer(c_int) :: retval + type(c_ptr), value :: user_data + integer :: i, j + ! Create solution vector, point at its data, and set initial condition + N = nxl*nyl + Ntot = nx*ny + sunvec_y => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_ydot => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_id => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_res => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_c => FN_VNew_Parallel(comm, N, Ntot, sunctx) + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + id(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_id) + res(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_res) + cstr(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_c) + id = 1.d0 + do i = 1,nxl + xreal = dx*dble(is+i-2) + do j = 1,nyl + yreal = dy*dble(js+j-2) + if (.not. HaveNbor(1,1) .and. i == 1) then + id(i,j) = 0.d0 + end if + if (.not. HaveNbor(1,2) .and. i == nxl) then + id(i,j) = 0.d0 + end if + if (.not. HaveNbor(2,1) .and. j == 1) then + id(i,j) = 0.d0 + end if + if (.not. HaveNbor(2,2) .and. j == nyl) then + id(i,j) = 0.d0 + end if + y(i,j) = 16.d0*xreal*(1.d0-xreal)*yreal*(1.d0-yreal) + end do + end do + ydot = 0.d0 + cstr = 1.d0 + retval = resfn(0.d0, sunvec_y, sunvec_ydot, sunvec_res, user_data) + if (retval /= 0) then + print *, "Error: resfn in InitProfile returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + ydot = -1.d0*res + + return + end subroutine InitProfile + ! -------------------------------------------------------------- + + subroutine getStats(ida_mem, retval, ierr) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fida_mod + use fsundials_futils_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(c_ptr), intent(in) :: ida_mem + integer(c_int), intent(in) :: ierr + integer(c_int), intent(out) :: retval + + retval = FIDAGetLastOrder(ida_mem, k) + if (retval /= 0) then + print *, "Error: FIDAGetLastOrder returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumSteps(ida_mem, nst) + if (retval /= 0) then + print *, "Error: FIDAGetNumSteps returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) + if (retval /= 0) then + print *, "Error: FIDAGetNumNonlinSolvIters returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumLinIters(ida_mem, nli) + if (retval /= 0) then + print *, "Error: FIDAGetNumLinIters returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumResEvals(ida_mem, nre) + if (retval /= 0) then + print *, "Error: FIDAGetNumResEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumLinResEvals(ida_mem, nreLS) + if (retval /= 0) then + print *, "Error: FIDAGetNumLinResEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDABBDPrecGetNumGfnEvals(ida_mem, nge) + if (retval /= 0) then + print *, "Error: FIDABBDPrecGetNumGfnEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetLastStep(ida_mem, h) + if (retval /= 0) then + print *, "Error: FIDAGetLastStep returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumPrecEvals(ida_mem, npre) + if (retval /= 0) then + print *, "Error: FIDAGetNumPrecEvals returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumPrecSolves(ida_mem, npsol) + if (retval /= 0) then + print *, "Error: FIDAGetNumPrecSolves returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + end subroutine getStats + ! -------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! DAE residual function r(t,y). + ! ---------------------------------------------------------------- + integer(c_int) function resfn(t, sunvec_y, sunvec_ydot, sunvec_res, & + user_data) result(retval) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(N_Vector) :: sunvec_res ! residual N_Vector + type(c_ptr), value :: user_data ! user-defined data + + !======= Internals ============ + + ! Exchange boundary data with neighbors + retval = Exchange(N, t, sunvec_y, sunvec_ydot, sunvec_res, user_data) + if (retval /= MPI_SUCCESS) then + write(0,*) "Error in Exchange = " , retval + return + end if + + retval = LocalFn(N, t, sunvec_y, sunvec_ydot, sunvec_res, user_data) + if (retval /= MPI_SUCCESS) then + write(0,*) "Error in LocalFn = " , retval + return + end if + + retval = 0 ! Return with success + return + end function resfn + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Perform neighbor exchange (Communication function) + ! ---------------------------------------------------------------- + integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & + sunvec_g, user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + integer(c_long), value :: Nloc + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(N_Vector) :: sunvec_g ! evaluated N_Vector + type(c_ptr), value :: user_data ! user-defined data + + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) + integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; + integer :: stat(MPI_STATUS_SIZE) + integer :: i, ipW, ipE, ipS, ipN + integer :: coords(2), dims(2), periods(2), nbcoords(2) + + ! internals + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + + ! MPI neighborhood information + call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_get = ", ierr + return + end if + if (HaveNbor(1,1)) then + nbcoords = (/ coords(1)-1, coords(2) /) + call MPI_Cart_rank(comm, nbcoords, ipW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(1,2)) then + nbcoords = (/ coords(1)+1, coords(2) /) + call MPI_Cart_rank(comm, nbcoords, ipE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(2,1)) then + nbcoords = (/ coords(1), coords(2)-1 /) + call MPI_Cart_rank(comm, nbcoords, ipS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(2,2)) then + nbcoords = (/ coords(1), coords(2)+1 /) + call MPI_Cart_rank(comm, nbcoords, ipN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + + ! open Irecv buffers + if (HaveNbor(1,1)) then + call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & + MPI_ANY_TAG, comm, reqRW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(1,2)) then + call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & + MPI_ANY_TAG, comm, reqRE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(2,1)) then + call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & + MPI_ANY_TAG, comm, reqRS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(2,2)) then + call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & + MPI_ANY_TAG, comm, reqRN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Irecv = ", ierr + return + end if + end if + + ! send data + if (HaveNbor(1,1)) then + do i=1,nyl + Wsend(i) = y(1,i) + end do + call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & + comm, reqSW, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(1,2)) then + do i=1,nyl + Esend(i) = y(nxl,i) + end do + call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & + comm, reqSE, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(2,1)) then + do i=1,nxl + Ssend(i) = y(i,1) + end do + call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & + comm, reqSS, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(2,2)) then + do i=1,nxl + Nsend(i) = y(i,nyl) + end do + call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & + comm, reqSN, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Isend = ", ierr + return + end if + end if + + ! wait for messages to finish + if (HaveNbor(1,1)) then + call MPI_Wait(reqRW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(1,2)) then + call MPI_Wait(reqRE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(2,1)) then + call MPI_Wait(reqRS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(2,2)) then + call MPI_Wait(reqRN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Wait = ", ierr + return + end if + end if + + ierr = MPI_SUCCESS ! return with success flag + return + end function Exchange + ! ---------------------------------------------------------------- + + + ! ---------------------------------------------------------------- + ! Processor-local portion of the DAE residual function. + ! ---------------------------------------------------------------- + integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & + user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + integer(c_long), value :: Nloc + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(N_Vector) :: sunvec_g ! evaluated N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) + real(c_double), pointer, dimension(nxl,nyl) :: ydot(:,:) + real(c_double), pointer, dimension(nxl,nyl) :: res(:,:) + + ! local data + real(c_double) :: c1, c2, c3 + integer :: i, j + + !======= Internals ============ + + ! Get data arrays from SUNDIALS vectors + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + res(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_g) + + ! set constants + c1 = kx/dx/dx + c2 = ky/dy/dy + c3 = -2.d0*(c1 + c2) + + ! Copy y NVector into res NVector + res = y + + ! iterate over subdomain boundaries (if not at overall domain boundary) + do i = 1,nxl + do j = 1,nyl + if (i == 1 .and. j == 1) then + if (HaveNbor(1,1) .and. HaveNbor(2,1)) then ! South-West corner + res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + end if + else if (i == 1 .and. j == nyl) then + if (HaveNbor(1,1) .and. HaveNbor(2,2)) then ! North-West corner + res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + end if + else if (i == nxl .and. j == 1) then + if (HaveNbor(1,2) .and. HaveNbor(2,1)) then ! South-East corner + res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + end if + else if (i == nxl .and. j == nyl) then + if (HaveNbor(1,2) .and. HaveNbor(2,2)) then ! North-East corner + res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + end if + else if (i == 1) then + if (HaveNbor(1,1)) then ! West face + res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + end if + else if (i == nxl) then + if (HaveNbor(1,2)) then ! East face + res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + end if + else if (j == 1) then + if (HaveNbor(2,1)) then ! South face + res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) + end if + else if (j == nyl) then + if (HaveNbor(2,2)) then ! North face + res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) + end if + else + res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + end if + res(i,j) = ydot(i,j) - res(i,j) + end do + end do + + ierr = 0 ! Return with success + return + end function LocalFn + ! ---------------------------------------------------------------- + +end module Heat2DKryBBD_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use fsundials_futils_mod ! Fortran utilities + use fida_mod ! Access IDA + use fsundials_types_mod ! sundials defined types + use fsundials_nvector_mod ! Access generic N_Vector + use fnvector_parallel_mod ! Access parallel N_Vector + use fsundials_context_mod ! Access sundials context + use fsundials_matrix_mod ! Access generic SUNMatrix + use fsundials_linearsolver_mod ! Access generic SUNLinearSolver + use fsunlinsol_spgmr_mod ! Access GMRES SUNLinearSolver + + use Heat2DKryBBD_mod + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 11 ! total number of output times + integer, parameter :: nx_ = 100 ! spatial mesh size + integer, parameter :: ny_ = 100 + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: T1 = 0.01d0 ! final time + real(c_double), parameter :: rtol = 0.d0 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-3 + real(c_double), parameter :: kx_ = 1.0d0 ! heat conductivity coefficients + real(c_double), parameter :: ky_ = 1.0d0 + + ! solution vector and other local variables + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + type(N_Vector), pointer :: sunvec_f ! derivative N_Vector + type(N_Vector), pointer :: sunvec_id ! derivative N_Vector + type(N_Vector), pointer :: sunvec_res ! derivative N_Vector + type(N_Vector), pointer :: sunvec_c ! constraint N_Vector + real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) ! vector data + real(c_double), pointer, dimension(nxl,nyl) :: f(:,:) ! vector data + type(SUNLinearSolver), pointer :: sun_LS ! linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(c_ptr) :: ida_mem ! IDA memory + integer(c_int) :: retval + integer :: ierr, case + logical :: outproc + real(c_double) :: t(1), dTout, tout, ymax + integer :: i, j, ioutput + character*100 :: outname + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Initialize Heat2DData module + call InitHeat2DData() + nx = nx_ + ny = ny_ + kx = kx_ + ky = ky_ + dx = 1.d0/dble(nx-1) ! x mesh spacing + dy = 1.d0/dble(ny-1) ! x mesh spacing + + ! Set up parallel decomposition (computes local mesh sizes) + call SetupDecomp(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in SetupDecomp = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write(6,*) " " + write(6,*) "2D Heat PDE test problem:"; + write(6,'(A,i4)') " nprocs = " , nprocs + write(6,'(A,i4)') " nx = ", nx + write(6,'(A,i4)') " ny = ", ny + write(6,'(A,f5.2)') " kx = ", kx + write(6,'(A,f5.2)') " ky = ", ky + write(6,'(A,es9.2)') " rtol = ", rtol + write(6,'(A,es9.2)') " atol = ", atol + write(6,'(A,i4)') " nxl (proc 0) = ", nxl + write(6,'(A,i4)') " nyl (proc 0) = ", nyl + write(6,*) " " + end if + + ! Create the IDA timestepper module + ida_mem = FIDACreate(sunctx) + if (.not. c_associated(ida_mem)) then + print *, "Error: FIDACreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + call InitProfile(sunvec_y, sunvec_f, sunvec_id, sunvec_res, sunvec_c, ierr) + + retval = FIDAInit(ida_mem, c_funloc(resfn), t0, sunvec_y, sunvec_f) + if (retval /= 0) then + print *, "Error: FIDAInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Create linear solver + maxl = 0 + sun_LS => FSUNLinSol_SPGMR(sunvec_y, SUN_PREC_LEFT, maxl, sunctx) + if (.not. associated(sun_LS)) then + print *, "Error: FSUNLinSol_PCG returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach linear solver + sunmat_A => null() + retval = FIDASetLinearSolver(ida_mem, sun_LS, sunmat_A) + if (retval /= 0) then + print *, "Error: FIDASetLinearSolver returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetMaxRestarts(sun_LS, 5) + if (retval /= 0) then + print *, "Error: FSUNLinSol_SPGMRSetMaxRestarts returned",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach preconditioner + mudq = nxl + mldq = nxl + mu = 1 + ml = 1 + retval = FIDABBDPrecInit(ida_mem, N, mudq, mldq, mu, ml, 0.d0, & + c_funloc(LocalFn), c_funloc(Exchange)) + if (retval /= 0) then + print *, "Error: FIDASetPreconditioner returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FIDASStolerances(ida_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FIDASStolerances returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDASetSuppressAlg(ida_mem, SUNTRUE) + if (retval /= 0) then + print *, "Error: FIDASetSuppressAlg returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDASetId(ida_mem, sunvec_id) + if (retval /= 0) then + print *, "Error: FIDASetId returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDASetConstraints(ida_mem, sunvec_c) + if (retval /= 0) then + print *, "Error: FIDASetConstraints returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Each processor outputs subdomain information + write(outname,'(16Hheat2d_subdomain,f4.3,4H.txt)') myid/1000.0 + open(100, file=outname) + write(100,'(6(i9,1x))') nx, ny, is, ie, js, je + close(100) + + ! Open output streams for results, access data array + write(outname,'(6Hheat2d,f4.3,4H.txt)') myid/1000.0 + open(101, file=outname) + + ! Output initial condition to disk + y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + do j=1,nyl + do i=1,nxl + write(101,'(es25.16)',advance='no') y(i,j) + end do + end do + write(101,*) " " + + do case = 1,2 + if (case == 2) then + mudq = 5 + mldq = 5 + call InitProfile(sunvec_y, sunvec_f, sunvec_id, sunvec_res, sunvec_c, ierr) + retval = FIDAReInit(ida_mem, t0, sunvec_y, sunvec_f) + if (retval /= 0) then + print *, "Error: FIDAReInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + retval = FIDABBDPrecReInit(ida_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error: FIDABBDPrecReInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + if(outproc) then + write(6,*) " " + write(6,*) "Case ", case + write(6,*) " Difference quotient half-bandwidths = ", mudq + write(6,*) " Retained matrix half-bandwidths = ", mu + write(6,*) " " + write(6,*) "Output Summary" + write(6,*) " umax = max-norm of solution" + write(6,*) " nre = nre + nreLS (total number of RES evals.)" + end if + end if + if (case == 1) then + if(outproc) then + write(6,*) " " + write(6,*) "Case ", case + write(6,*) " Difference quotient half-bandwidths = ", mudq + write(6,*) " Retained matrix half-bandwidths = ", mu + write(6,*) " " + write(6,*) "Output Summary" + write(6,*) " umax = max-norm of solution" + write(6,*) " nre = nre + nreLS (total number of RES evals.)" + end if + end if + ! Main time-stepping loop: calls IDA to perform the integration, then + ! prints results. Stops when the final time has been reached + t = T0 + tout = T1 + if (outproc) then + write(6,*) " " + write(6,*) " t ||u||_max k nst nni nli nre nge h npe nps" + write(6,*) " ------------------------------------------------------------------------------------" + end if + do ioutput=1,Nt + + ! Integrate to output time + retval = FIDASolve(ida_mem, tout, t, sunvec_y, sunvec_f, IDA_NORMAL) + if (retval /= 0) then + print *, "Error: FIDASolve returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + ymax = FN_VMaxNorm(sunvec_y) + call getStats(ida_mem, retval, ierr) + if (outproc) write(6,'(2x,f10.6,2x,es13.5,3x,i1,3x,i2,3x,i3,3x,i3,3x,i3,a,i3,3x,i4,3x,es9.2,3x,i2,3x,i3)') & + t, ymax, k, nst, nni, nli, nre, "+", nreLS, nge, h, npre, npsol + tout = 2.0d0 * tout + + ! output results to disk + do j=1,nyl + do i=1,nxl + write(101,'(es25.16)',advance='no') y(i,j) + end do + end do + write(101,*) " " + + end do + if (outproc) then + write(6,*) " ------------------------------------------------------------------------------------" + end if + close(101) + + retval = FIDAGetNumErrTestFails(ida_mem, netf) + if (retval /= 0) then + print *, "Error: FIDAGetNumErrTestFails returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumNonlinSolvConvFails(ida_mem, nncf) + if (retval /= 0) then + print *, "Error: FIDAInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FIDAGetNumLinConvFails(ida_mem, nlcf) + if (retval /= 0) then + print *, "Error: FIDAInit returned ",retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write(6,*) " " + write(6,*) "Final Solver Statistics:" + write(6,'(A,i6)') " Total number of error test failures = ", netf + write(6,'(A,i6)') " Total number of nonlinear conv. failures = ", nncf + write(6,'(A,i6)') " Total number of linear conv. failures = ", nlcf + end if + end do + + ! Clean up and return with successful completion + call FIDAFree(ida_mem) ! free integrator memory + call FN_VDestroy_Parallel(sunvec_y) ! free vector memory + call FN_VDestroy_Parallel(sunvec_f) + call FN_VDestroy_Parallel(sunvec_id) + call FN_VDestroy_Parallel(sunvec_res) + call FN_VDestroy_Parallel(sunvec_c) + retval = FSUNLinSolFree(sun_LS) ! free linear solver + call FreeHeat2DData(ierr) ! free user data + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program driver +! ---------------------------------------------------------------- diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003_4.out b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003_4.out new file mode 100644 index 0000000000..393585907b --- /dev/null +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003_4.out @@ -0,0 +1,68 @@ + + 2D Heat PDE test problem: + nprocs = 4 + nx = 100 + ny = 100 + kx = 1.00 + ky = 1.00 + rtol = 0.00E+00 + atol = 1.00E-03 + nxl (proc 0) = 50 + nyl (proc 0) = 50 + + + Case 1 + Difference quotient half-bandwidths = 50 + Retained matrix half-bandwidths = 1 + + Output Summary + umax = max-norm of solution + nre = nre + nreLS (total number of RES evals.) + + t ||u||_max k nst nni nli nre nge h npe nps + ------------------------------------------------------------------------------------ + 0.010000 8.46213E-01 2 15 20 32 20+ 32 816 2.56E-03 8 52 + 0.020000 7.05517E-01 2 18 24 47 24+ 47 918 5.12E-03 9 71 + 0.040000 4.83694E-01 3 22 29 73 29+ 73 918 5.12E-03 9 102 + 0.080000 2.15365E-01 3 28 38 143 38+143 918 6.97E-03 9 181 + 0.160000 6.15447E-02 2 36 48 211 48+211 1020 1.39E-02 10 259 + 0.320000 1.63800E-02 2 48 69 393 69+393 1428 1.88E-02 14 462 + 0.640000 1.06183E-02 1 84 125 603 125+603 2958 5.52E-02 29 728 + 1.280000 1.98532E-02 1 88 131 621 131+621 3162 2.21E-01 31 752 + 2.560000 3.00701E-02 1 92 138 651 138+651 3264 3.52E-01 32 789 + 5.120000 2.46999E-02 1 96 147 670 147+670 3570 1.07E+00 35 817 + 10.240000 1.82570E-02 1 98 150 682 150+682 3672 2.14E+00 36 832 + ------------------------------------------------------------------------------------ + + Final Solver Statistics: + Total number of error test failures = 1 + Total number of nonlinear conv. failures = 3 + Total number of linear conv. failures = 2 + + Case 2 + Difference quotient half-bandwidths = 5 + Retained matrix half-bandwidths = 1 + + Output Summary + umax = max-norm of solution + nre = nre + nreLS (total number of RES evals.) + + t ||u||_max k nst nni nli nre nge h npe nps + ------------------------------------------------------------------------------------ + 0.010000 8.46213E-01 2 15 20 32 20+ 32 96 2.56E-03 8 52 + 0.020000 7.05517E-01 2 18 24 47 24+ 47 108 5.12E-03 9 71 + 0.040000 4.83694E-01 3 22 29 73 29+ 73 108 5.12E-03 9 102 + 0.080000 2.15365E-01 3 28 38 143 38+143 108 6.97E-03 9 181 + 0.160000 6.15447E-02 2 36 48 211 48+211 120 1.39E-02 10 259 + 0.320000 1.63800E-02 2 48 69 393 69+393 168 1.88E-02 14 462 + 0.640000 1.06183E-02 1 84 125 603 125+603 348 5.52E-02 29 728 + 1.280000 1.98532E-02 1 88 131 621 131+621 372 2.21E-01 31 752 + 2.560000 3.00701E-02 1 92 138 651 138+651 384 3.52E-01 32 789 + 5.120000 2.46999E-02 1 96 147 670 147+670 420 1.07E+00 35 817 + 10.240000 1.82570E-02 1 98 150 682 150+682 432 2.14E+00 36 832 + ------------------------------------------------------------------------------------ + + Final Solver Statistics: + Total number of error test failures = 1 + Total number of nonlinear conv. failures = 3 + Total number of linear conv. failures = 2 diff --git a/examples/ida/F2003_serial/CMakeLists.txt b/examples/ida/F2003_serial/CMakeLists.txt index 5cc316461b..637c5c2139 100644 --- a/examples/ida/F2003_serial/CMakeLists.txt +++ b/examples/ida/F2003_serial/CMakeLists.txt @@ -62,9 +62,6 @@ endforeach(example_tuple ${FIDA_examples}) # create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) - # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "IDA") set(SOLVER_LIB "sundials_ida") diff --git a/examples/ida/F2003_serial/README b/examples/ida/F2003_serial/README deleted file mode 100644 index a3fb25e405..0000000000 --- a/examples/ida/F2003_serial/README +++ /dev/null @@ -1,37 +0,0 @@ -List of serial IDA F2003 examples - - idaHeat2D_kry_f2003.f90 : 2-D heat equation, diagonal preconditioner - idaRoberts_dns_f2003.f90 : 3-species Robertson kinetics system - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=ON \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_ENABLE_F2003=ON \ --DEXAMPLES_INSTALL=ON \ --DBUILD_FORTRAN_MODULE_INTERFACE=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 - diff --git a/examples/idas/F2003_serial/CMakeLists.txt b/examples/idas/F2003_serial/CMakeLists.txt index 71c50e9ad7..6d409c2857 100644 --- a/examples/idas/F2003_serial/CMakeLists.txt +++ b/examples/idas/F2003_serial/CMakeLists.txt @@ -62,9 +62,6 @@ endforeach(example_tuple ${FIDAS_examples}) # create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) - # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "IDAS") set(SOLVER_LIB "sundials_idas") diff --git a/examples/idas/F2003_serial/README b/examples/idas/F2003_serial/README deleted file mode 100644 index 6bb2b4b32d..0000000000 --- a/examples/idas/F2003_serial/README +++ /dev/null @@ -1,37 +0,0 @@ -List of serial IDAS F2003 examples - - idasAkzoNob_ASAi_dns : adjoint sensitivity for the chemical Akzo-Nobel problem - idaHeat2D_kry_f2003.f90 : 2-D heat equation, diagonal preconditioner - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=ON \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_ENABLE_F2003=ON \ --DEXAMPLES_INSTALL=ON \ --DBUILD_FORTRAN_MODULE_INTERFACE=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 - diff --git a/examples/kinsol/CMakeLists.txt b/examples/kinsol/CMakeLists.txt index b8f0a9af18..c41e93d845 100644 --- a/examples/kinsol/CMakeLists.txt +++ b/examples/kinsol/CMakeLists.txt @@ -47,4 +47,5 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) + add_subdirectory(F2003_parallel) endif() diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt new file mode 100644 index 0000000000..8ba5706a32 --- /dev/null +++ b/examples/kinsol/F2003_parallel/CMakeLists.txt @@ -0,0 +1,148 @@ +# --------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# modified by Daniel M. Margolis @ 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the KINsol F2003 module parallel examples +# --------------------------------------------------------------- + +# Example lists are tuples "name\;nodes\;tasks\;type" where the +# type is develop for examples excluded from 'make test' in releases +if(MPI_ENABLED) + set(FKINSOL_examples + "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") +endif() + +# Specify libraries to link against +set(KINSOL_LIBS + sundials_kinsol + sundials_fkinsol_mod + sundials_nvecparallel + sundials_fnvecparallel_mod) + +# Set-up linker flags and link libraries +set(SUNDIALS_LIBS ${KINSOL_LIBS} ${EXE_EXTRA_LINK_LIBS}) + +# Add the build and install targets for each example +foreach(example_tuple ${FKINSOL_examples}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 number_of_nodes) + list(GET example_tuple 3 number_of_tasks) + list(GET example_tuple 4 example_type) + list(GET example_tuple 5 example_precision) + + if(NOT TARGET ${example}) + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + + # example source files + add_executable(${example} ${example}.f90) + + # libraries to link against + target_link_libraries(${example} MPI::MPI_Fortran ${SUNDIALS_LIBS}) + + set_target_properties(${example} PROPERTIES FOLDER "Examples") + endif() + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example}) + else() + string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test(${test_name} ${example} + TEST_ARGS ${example_args} + MPI_NPROCS ${number_of_tasks} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + EXAMPLE_TYPE ${example_type} + FLOAT_PRECISION ${example_precision}) + + # find all .out files for this example + file(GLOB example_out ${example}*.out) + + # install example source and out files + if(EXAMPLES_INSTALL) + install(FILES ${example}.f90 ${example_out} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + endif() + +endforeach(example_tuple ${FKINSOL_examples}) + + +# create Makfile and CMakeLists.txt for examples +if(EXAMPLES_INSTALL) + + # Install the extra files + foreach(extrafile ${KINSOL_extras}) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + endforeach() + + # Prepare substitution variables for Makefile and/or CMakeLists templates + set(SOLVER "KINSOL") + + # Makefile: convert semi-colon separated target list to space separated string + list2string(KINSOL_LIBS EXAMPLE_LIBS) + + # CMakeLists: replace sundials_ prefix and convert to space separted string + list(TRANSFORM KINSOL_LIBS REPLACE "sundials_" "SUNDIALS::" + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) + + examples2string(FKINSOL_examples EXAMPLES) + + # Regardless of the platform we're on, we will generate and install + # CMakeLists.txt file for building the examples. This file can then + # be used as a template for the user's own programs. + + # generate CMakelists.txt in the binary directory + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt + @ONLY + ) + + # install CMakelists.txt + install( + FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel + ) + + # On UNIX-type platforms, we also generate and install a makefile for + # building the examples. This makefile can then be used as a template + # for the user's own programs. + + if(UNIX) + # generate Makefile and place it in the binary dir + configure_file( + ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex + @ONLY + ) + # install the configured Makefile_ex as Makefile + install( + FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel + RENAME Makefile + ) + endif() + + # add test_install target + sundials_add_test_install(kinsol F2003_parallel) + +endif() diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 new file mode 100644 index 0000000000..dcc6b09bbb --- /dev/null +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 @@ -0,0 +1,564 @@ +! ------------------------------------------------------------------ +! Programmer(s): Allan G. Taylor, Alan C. Hindmarsh and Radu Serban @ LLNL +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! Simple diagonal test with Fortran interface, using user-supplied +! preconditioner setup and solve routines (supplied in Fortran). +! +! This example does a basic test of the solver by solving the +! system: +! f(u) = 0 for +! f(u) = u(i)^2 - i^2 +! +! No scaling is done. +! An approximate diagonal preconditioner is used. +! +! ------------------------------------------------------------------ + +module kinDiagonKry_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + integer(c_long), parameter :: neq = 128 + + integer(c_int) :: ierr, retval, nprint + integer(c_long) :: i, nlocal + real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) + real(c_double) :: p(neq) + integer(c_int), parameter :: prectype = 2 + integer(c_int), parameter :: maxl = 10 + integer(c_int), parameter :: maxlrst = 2 + integer(c_long), parameter :: msbpre = 5 + real(c_double), parameter :: fnormtol = 1.0d-5 + real(c_double), parameter :: scsteptol = 1.0d-4 + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + +contains + + ! ---------------------------------------------------------------- + ! init: Initializes variables u, scale, constr + ! ---------------------------------------------------------------- + subroutine init(sunvec_u, sunvec_s, sunvec_c) + + !======= Inclusions =========== + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_c ! constraint N_Vector + + ! local variables + integer(c_long) :: ii + + u(1:nlocal) => FN_VGetArrayPointer(sunvec_u) + scale(1:nlocal) => FN_VGetArrayPointer(sunvec_s) + constr(1:nlocal) => FN_VGetArrayPointer(sunvec_c) + + ! ------------------------- + ! Set initial guess, and disable scaling + + do i = 1,nlocal + ii = i + myid * nlocal + u(i) = 2.0d0 * dble(ii) + end do + scale = 1.0d0 + constr = 0.0d0 + + end subroutine init + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! func: The nonlinear residual function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function func(sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C) + + !======= Inclusions =========== + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: uu(:), ff(:) + + ! local variables + integer(c_long) :: ii + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uu(1:nlocal) => FN_VGetArrayPointer(sunvec_u) + ff(1:nlocal) => FN_VGetArrayPointer(sunvec_f) + + ! loop over domain, computing our system f(u) = 0 + do i = 1,nlocal + ! set local variables + ii = i + myid * nlocal + + ! applying the constraint f(u) = u(i)^2 - i^2 + ff(i) = uu(i)*uu(i) - dble(ii*ii) + end do + + + ! return success + ierr = 0 + return + + end function func + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! kpsetup: The KINSOL Preconditioner setup function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & + sunvec_fs, user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(N_Vector) :: sunvec_fs ! LHS scaling N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: udata(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + udata(1:nlocal) => FN_VGetArrayPointer(sunvec_u) + + ! loop over domain + do i = 1,nlocal + + ! setup preconditioner + p(i) = 0.5d0 / (udata(i) + 5.0d0) + end do + + + ! return success + ierr = 0 + return + + end function kpsetup + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! kpsolve: The KINSOL Preconditioner solve function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & + sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) + + !======= Inclusions =========== + use fsundials_nvector_mod + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(N_Vector) :: sunvec_fs ! LHS scaling N_Vector + type(N_Vector) :: sunvec_v ! LHS scaling N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(nlocal) :: v(:) + + !======= Internals ============ + ! get data arrays from SUNDIALS vectors + v(1:nlocal) => FN_VGetArrayPointer(sunvec_v) + + ! loop over domain + do i = 1,nlocal + + ! preconditioner solver + v(i) = v(i) * p(i) + end do + + + ! return success + ierr = 0 + return + + end function kpsolve + ! ---------------------------------------------------------------- + +end module kinDiagonKry_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use fsundials_context_mod + use fkinsol_mod ! Fortran interface to KINSOL + use fsundials_nvector_mod ! Fortran interface to generic N_Vector + use fnvector_parallel_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to SPGMR SUNLinearSolver + use fsundials_matrix_mod ! Fortran interface to generic SUNmatrix + use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver + use kinDiagonKry_mod ! problem-defining functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: ftol, fnorm(1) + + type(c_ptr) :: sunctx ! sundials context + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s ! sundials vectors + type(N_Vector), pointer :: sunvec_c ! sundials vectors + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + + type(c_ptr) :: kmem ! KINSOL memory + logical :: outproc + + !======= Internals ============ + + ! ------------------------- + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + if (popcnt(nprocs) /= 1 .or. nprocs > neq) then + write(0,*) "Error nprocs must equal a power of 2^n <= neq for functionality." + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write(0,*) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + outproc = (myid == 0) + + ! Print problem description + + if (outproc) then + print *, " " + print *, "Example program kinDiagon_kry_f2003:" + print *, " This FKINSOL example solves a 128 eqn diagonal algebraic system." + print *, " Its purpose is to demonstrate the use of the Fortran interface in" + print *, " a parallel environment." + print *, " " + print *, "Solution method: KIN_none" + print '(a,i3)', "Problem size: neq = ", neq + print '(a,i3)', "Number of procs: nprocs = ", nprocs + end if + + ! ------------------------- + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + if (retval /= 0) then + print *, 'ERROR in FSUNContext_Create' + stop 1 + end if + + ! ------------------------- + ! Create vectors for solution and scales + nlocal = neq / nprocs + + sunvec_u => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + sunvec_s => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + sunvec_c => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + + call init(sunvec_u, sunvec_s, sunvec_c) + + ! ------------------------- + ! Initialize and allocate memory for KINSOL + + kmem = FKINCreate(sunctx) + if (.not. c_associated(kmem)) then + print *, 'ERROR: kmem = NULL' + stop 1 + end if + + ! sunvec_u is used as a template + + retval = FKINInit(kmem, c_funloc(func), sunvec_u) + if (retval /= 0) then + print *, 'Error in FKINInit, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set optional inputs + + retval = FKINSetMaxSetupCalls(kmem, msbpre) + if (retval /= 0) then + print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' + stop 1 + end if + + ftol = fnormtol + retval = FKINSetFuncNormTol(kmem, ftol) + if (retval /= 0) then + print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINSetScaledStepTol(kmem, scsteptol) + if (retval /= 0) then + print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINSetConstraints(kmem, sunvec_c) + if (retval /= 0) then + print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Create a SPGMR linear solver + + sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, prectype, maxl, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *,'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! ------------------------- + ! Attach linear solver + + sunmat_J => null() + + retval = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) + if (retval /= 0) then + print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set more optional SPGMR inputs + + retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, maxlrst) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set preconditioner functions + + retval = FKINSetPreconditioner(kmem, c_funloc(kpsetup), c_funloc(kpsolve)) + if (retval /= 0) then + print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Call KINSol to solve problem + ! + ! arguments: KINSol memory block + ! Initial guess on input, solution on output + ! Globalization strategy choice + ! Scaling vector for the solution + ! Scaling vector for the residual + + retval = FKINSol(kmem, sunvec_u, KIN_NONE, sunvec_s, sunvec_s) + if (retval /= 0) then + print *, 'Error in FKINSol, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Print solution and solver statistics + + if (outproc) then + print *, " " + end if + do nprint = 0,nprocs-1 + if (nprint == myid) then + call PrintOutput(u) + end if + call MPI_Barrier(comm, ierr) + end do + call MPI_Barrier(comm, ierr) + call PrintFinalStats(kmem, outproc) + + ! clean up + call FKINFree(kmem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_s) + call FN_VDestroy(sunvec_c) + retval = FSUNContext_Free(sunctx) + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput: prints solution at selected points +! ---------------------------------------------------------------- +subroutine PrintOutput(uu) + + !======= Inclusions =========== + use kinDiagonKry_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double), dimension(neq) :: uu + integer(c_long) :: ii + + !======= Internals ============ + + do i = 1,nlocal,4 + ii = i + nlocal * myid + print '(i4, 4(1x, f10.6))', ii, uu(i), uu(i+1), uu(i+2), uu(i+3) + end do + + return + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print KINSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(kmemo, outproc) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fkinsol_mod + + !======= Declarations ========= + implicit none + + type(c_ptr), intent(in) :: kmemo + logical, intent(in) :: outproc + + integer(c_int) :: retval + integer(c_long) :: nni(1), nli(1), nfe(1), npe(1), nps(1), ncfl(1) + + !======= Internals ============ + + ! Main solver statistics + + retval = FKINGetNumNonlinSolvIters(kmemo, nni) + if (retval /= 0) then + print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumLinIters(kmemo, nli) + if (retval /= 0) then + print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumFuncEvals(kmemo, nfe) + if (retval /= 0) then + print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumPrecEvals(kmemo, npe) + if (retval /= 0) then + print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumPrecSolves(kmemo, nps) + if (retval /= 0) then + print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumLinConvFails(kmemo, ncfl) + if (retval /= 0) then + print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 + end if + + if (outproc) then + print *, ' ' + print *, 'Final Statistics..' + print *, ' ' + print '(2(A,i6))' ,'nni =', nni, ' nli =', nli + print '(2(A,i6))' ,'nfe =', nfe, ' npe =', npe + print '(2(A,i6))' ,'nps =', nps, ' nlcf =', ncfl + end if + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003_8.out b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003_8.out new file mode 100644 index 0000000000..8f264dbfa2 --- /dev/null +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003_8.out @@ -0,0 +1,48 @@ + + Example program kinDiagon_kry_f2003: + This FKINSOL example solves a 128 eqn diagonal algebraic system. + Its purpose is to demonstrate the use of the Fortran interface in + a parallel environment. + + Solution method: KIN_none +Problem size: neq = 128 +Number of procs: nprocs = 8 + + 1 1.000000 2.000000 3.000000 4.000000 + 5 5.000000 6.000000 7.000000 8.000000 + 9 9.000000 10.000000 11.000000 12.000000 + 13 13.000000 14.000000 15.000000 16.000000 + 17 17.000000 18.000000 19.000000 20.000000 + 21 21.000000 22.000000 23.000000 24.000000 + 25 25.000000 26.000000 27.000000 28.000000 + 29 29.000000 30.000000 31.000000 32.000000 + 33 33.000000 34.000000 35.000000 36.000000 + 37 37.000000 38.000000 39.000000 40.000000 + 41 41.000000 42.000000 43.000000 44.000000 + 45 45.000000 46.000000 47.000000 48.000000 + 49 49.000000 50.000000 51.000000 52.000000 + 53 53.000000 54.000000 55.000000 56.000000 + 57 57.000000 58.000000 59.000000 60.000000 + 61 61.000000 62.000000 63.000000 64.000000 + 65 65.000000 66.000000 67.000000 68.000000 + 69 69.000000 70.000000 71.000000 72.000000 + 73 73.000000 74.000000 75.000000 76.000000 + 77 77.000000 78.000000 79.000000 80.000000 + 81 81.000000 82.000000 83.000000 84.000000 + 85 85.000000 86.000000 87.000000 88.000000 + 89 89.000000 90.000000 91.000000 92.000000 + 93 93.000000 94.000000 95.000000 96.000000 + 97 97.000000 98.000000 99.000000 100.000000 + 101 101.000000 102.000000 103.000000 104.000000 + 105 105.000000 106.000000 107.000000 108.000000 + 109 109.000000 110.000000 111.000000 112.000000 + 113 113.000000 114.000000 115.000000 116.000000 + 117 117.000000 118.000000 119.000000 120.000000 + 121 121.000000 122.000000 123.000000 124.000000 + 125 125.000000 126.000000 127.000000 128.000000 + + Final Statistics.. + +nni = 7 nli = 21 +nfe = 8 npe = 2 +nps = 28 nlcf = 0 diff --git a/examples/kinsol/F2003_serial/CMakeLists.txt b/examples/kinsol/F2003_serial/CMakeLists.txt index 558d05d528..8908285b85 100644 --- a/examples/kinsol/F2003_serial/CMakeLists.txt +++ b/examples/kinsol/F2003_serial/CMakeLists.txt @@ -19,9 +19,10 @@ # Examples using SUNDIALS linear solvers set(FKINSOL_examples - "kinRoboKin_dns_f2003\;develop" - "kinLaplace_bnd_f2003\;develop" - "kinLaplace_picard_kry_f2003\;develop" + "kinDiagon_kry_f2003\;\;develop" + "kinRoboKin_dns_f2003\;\;develop" + "kinLaplace_bnd_f2003\;\;develop" + "kinLaplace_picard_kry_f2003\;\;develop" ) # Specify libraries to link against @@ -34,7 +35,8 @@ set(SUNDIALS_LIBS ${KINSOL_LIB} ${EXE_EXTRA_LINK_LIBS}) foreach(example_tuple ${FKINSOL_examples}) # parse the example tuple list(GET example_tuple 0 example) - list(GET example_tuple 1 example_type) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 example_type) # Install fortran modules to a unique directory to avoid naming collisions set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) @@ -46,6 +48,7 @@ foreach(example_tuple ${FKINSOL_examples}) # add example to regression tests sundials_add_test(${example} ${example} + TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -63,9 +66,6 @@ endforeach(example_tuple ${FKINSOL_examples}) # create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) - # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "KINSOL") set(SOLVER_LIB "sundials_kinsol") diff --git a/examples/kinsol/F2003_serial/README b/examples/kinsol/F2003_serial/README deleted file mode 100644 index d485f85cc0..0000000000 --- a/examples/kinsol/F2003_serial/README +++ /dev/null @@ -1,37 +0,0 @@ -List of serial KINSOL F2003 examples - - kinLaplace_bnd_f2003.f90 : 2-D elliptic PDE (BAND) - kinRoboKin_dns_f2003.f90 : Robot kinematics problem (DENSE) - -The following CMake command was used to configure SUNDIALS: - - cmake \ --DCMAKE_BUILD_TYPE=DEBUG \ --DBUILD_ARKODE=ON \ --DBUILD_CVODE=ON \ --DBUILD_CVODES=ON \ --DBUILD_IDA=ON \ --DBUILD_IDAS=ON \ --DBUILD_KINSOL=ON \ --DCMAKE_INSTALL_PREFIX=/home/user1/sundials/build/install \ --DEXAMPLES_INSTALL_PATH=/home/user1/sundials/build/install/examples \ --DBUILD_SHARED_LIBS=ON \ --DBUILD_STATIC_LIBS=ON \ --DEXAMPLES_ENABLE_C=ON \ --DEXAMPLES_ENABLE_CXX=ON \ --DEXAMPLES_ENABLE_F2003=ON \ --DEXAMPLES_INSTALL=ON \ --DBUILD_FORTRAN_MODULE_INTERFACE=ON \ --DENABLE_KLU=ON \ --DKLU_INCLUDE_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/include \ --DKLU_LIBRARY_DIR=/usr/casc/sundials/apps/rh6/suitesparse/4.5.3/lib \ --DENABLE_OPENMP=ON \ --DENABLE_PTHREAD=ON \ -../sundials - - System Architecture: x86_64 - Processor Type: Intel(R) Xeon(R) CPU E31230 @ 3.20GHz - Operating System: Red Hat 6.8 - C/Fortran Compilers: gcc/gfortran v4.4.7 - MPI: Open MPI v1.8.8 - diff --git a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 new file mode 100644 index 0000000000..83cdef8caa --- /dev/null +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 @@ -0,0 +1,484 @@ +! ------------------------------------------------------------------ +! Programmer(s): Daniel R. Reynolds @ SMU +! modified by Daniel M. Margolis @ 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 +! ------------------------------------------------------------------ +! Simple diagonal test with Fortran interface, using user-supplied +! preconditioner setup and solve routines (supplied in Fortran). +! +! This example does a basic test of the solver by solving the +! system: +! f(u) = 0 for +! f(u) = u(i)^2 - i^2 +! +! No scaling is done. +! An approximate diagonal preconditioner is used. +! +! ------------------------------------------------------------------ + +module kinDiagonKry_mod + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + integer(c_long), parameter :: neq = 128 + + integer(c_int) :: ierr, retval + integer(c_long) :: i + real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) + real(c_double) :: p(neq) + integer(c_int), parameter :: prectype = 2 + integer(c_int), parameter :: maxl = 10 + integer(c_int), parameter :: maxlrst = 2 + integer(c_long), parameter :: msbpre = 5 + real(c_double), parameter :: fnormtol = 1.0d-5 + real(c_double), parameter :: scsteptol = 1.0d-4 + +contains + + ! ---------------------------------------------------------------- + ! init: Initializes variables u, scale, constr + ! ---------------------------------------------------------------- + subroutine init(sunvec_u, sunvec_s, sunvec_c) + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_c ! constraint N_Vector + + u(1:neq) => FN_VGetArrayPointer(sunvec_u) + scale(1:neq) => FN_VGetArrayPointer(sunvec_s) + constr(1:neq) => FN_VGetArrayPointer(sunvec_c) + + ! ------------------------- + ! Set initial guess, and disable scaling + + do i = 1,neq + u(i) = 2.0d0 * dble(i) + end do + scale = 1.0d0 + constr = 0.0d0 + + end subroutine init + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! func: The nonlinear residual function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function func(sunvec_u, sunvec_f, user_data) & + result(ierr) bind(C) + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: uu(:), ff(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + uu(1:neq) => FN_VGetArrayPointer(sunvec_u) + ff(1:neq) => FN_VGetArrayPointer(sunvec_f) + + ! loop over domain, computing our system f(u) = 0 + do i = 1,neq + + ! applying the constraint f(u) = u(i)^2 - i^2 + ff(i) = uu(i)*uu(i) - dble(i*i) + end do + + + ! return success + ierr = 0 + return + + end function func + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! kpsetup: The KINSOL Preconditioner setup function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & + sunvec_fs, user_data) result(ierr) bind(C) + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(N_Vector) :: sunvec_fs ! LHS scaling N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: udata(:) + + !======= Internals ============ + + ! get data arrays from SUNDIALS vectors + udata(1:neq) => FN_VGetArrayPointer(sunvec_u) + + ! loop over domain + do i = 1,neq + + ! setup preconditioner + p(i) = 0.5d0 / (udata(i) + 5.0d0) + end do + + + ! return success + ierr = 0 + return + + end function kpsetup + ! ---------------------------------------------------------------- + + ! ---------------------------------------------------------------- + ! kpsolve: The KINSOL Preconditioner solve function + ! + ! Return values: + ! 0 = success, + ! 1 = recoverable error, + ! -1 = non-recoverable error + ! ---------------------------------------------------------------- + integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & + sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) + + !======= Declarations ========= + implicit none + + ! calling variables + type(N_Vector) :: sunvec_u ! solution N_Vector + type(N_Vector) :: sunvec_s ! scaling N_Vector + type(N_Vector) :: sunvec_f ! LHS N_Vector + type(N_Vector) :: sunvec_fs ! LHS scaling N_Vector + type(N_Vector) :: sunvec_v ! LHS scaling N_Vector + type(c_ptr), value :: user_data ! user-defined data + + ! pointers to data in SUNDIALS vectors + real(c_double), pointer, dimension(neq) :: v(:) + + !======= Internals ============ + ! get data arrays from SUNDIALS vectors + v(1:neq) => FN_VGetArrayPointer(sunvec_v) + + ! loop over domain + do i = 1,neq + + ! preconditioner solver + v(i) = v(i) * p(i) + end do + + + ! return success + ierr = 0 + return + + end function kpsolve + ! ---------------------------------------------------------------- + +end module kinDiagonKry_mod +! ------------------------------------------------------------------ + + +! ------------------------------------------------------------------ +! Main driver program +! ------------------------------------------------------------------ +program main + + !======= Inclusions =========== + use fkinsol_mod ! Fortran interface to KINSOL + use fnvector_serial_mod ! Fortran interface to serial N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to SPGMR SUNLinearSolver + use kinDiagonKry_mod ! problem-defining functions + + !======= Declarations ========= + implicit none + + ! local variables + real(c_double) :: ftol + + type(c_ptr) :: sunctx ! sundials context + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s ! sundials vectors + type(N_Vector), pointer :: sunvec_c ! sundials vectors + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + + type(c_ptr) :: kmem ! KINSOL memory + + !======= Internals ============ + + ! ------------------------- + ! Print problem description + + print *, " " + print *, "Example program fkinDiagon_kry:" + print *, " This FKINSOL example solves a 128 eqn diagonal algebraic system." + print *, " Its purpose is to demonstrate the use of the Fortran interface in" + print *, " a serial environment." + print *, " " + print *, "Solution method: KIN_none" + print '(a,i3)', "Problem size: neq = ", neq + + ! ------------------------- + retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) + if (retval /= 0) then + print *, 'ERROR in FSUNContext_Create' + stop 1 + end if + + ! ------------------------- + ! Create vectors for solution and scales + + sunvec_u => FN_VNew_Serial(neq, sunctx) + sunvec_s => FN_VNew_Serial(neq, sunctx) + sunvec_c => FN_VNew_Serial(neq, sunctx) + + call init(sunvec_u, sunvec_s, sunvec_c) + + ! ------------------------- + ! Initialize and allocate memory for KINSOL + + kmem = FKINCreate(sunctx) + if (.not. c_associated(kmem)) then + print *, 'ERROR: kmem = NULL' + stop 1 + end if + + ! sunvec_u is used as a template + + retval = FKINInit(kmem, c_funloc(func), sunvec_u) + if (retval /= 0) then + print *, 'Error in FKINInit, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set optional inputs + + retval = FKINSetMaxSetupCalls(kmem, msbpre) + if (retval /= 0) then + print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' + stop 1 + end if + + ftol = fnormtol + retval = FKINSetFuncNormTol(kmem, ftol) + if (retval /= 0) then + print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINSetScaledStepTol(kmem, scsteptol) + if (retval /= 0) then + print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINSetConstraints(kmem, sunvec_c) + if (retval /= 0) then + print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Create a SPGMR linear solver + + sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, prectype, maxl, sunctx) + if (.not. associated(sunlinsol_LS)) then + print *,'ERROR: sunlinsol = NULL' + stop 1 + end if + + ! ------------------------- + ! Attach linear solver + + sunmat_J => null() + + retval = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) + if (retval /= 0) then + print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set more optional SPGMR inputs + + retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, maxlrst) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Set preconditioner functions + + retval = FKINSetPreconditioner(kmem, c_funloc(kpsetup), c_funloc(kpsolve)) + if (retval /= 0) then + print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Call KINSol to solve problem + ! + ! arguments: KINSol memory block + ! Initial guess on input, solution on output + ! Globalization strategy choice + ! Scaling vector for the solution + ! Scaling vector for the residual + + retval = FKINSol(kmem, sunvec_u, KIN_NONE, sunvec_s, sunvec_s) + if (retval /= 0) then + print *, 'Error in FKINSol, retval = ', retval, '; halting' + stop 1 + end if + + ! ------------------------- + ! Print solution and solver statistics + + print *, " " + call PrintOutput(u) + call PrintFinalStats(kmem) + + ! clean up + call FKINFree(kmem) + retval = FSUNLinSolFree(sunlinsol_LS) + call FN_VDestroy(sunvec_u) + call FN_VDestroy(sunvec_s) + call FN_VDestroy(sunvec_c) + retval = FSUNContext_Free(sunctx) + +end program main +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintOutput: prints solution at selected points +! ---------------------------------------------------------------- +subroutine PrintOutput(uu) + + !======= Inclusions =========== + use kinDiagonKry_mod + + !======= Declarations ========= + implicit none + + ! calling variable + real(c_double), dimension(neq) :: uu + + !======= Internals ============ + + do i = 1,neq,4 + print '(i4, 4(1x, f10.6))', i, uu(i), uu(i+1), uu(i+2), uu(i+3) + end do + + return + +end subroutine PrintOutput +! ---------------------------------------------------------------- + + +! ---------------------------------------------------------------- +! PrintFinalStats +! +! Print KINSOL statstics to standard out +! ---------------------------------------------------------------- +subroutine PrintFinalStats(kmemo) + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fkinsol_mod + + !======= Declarations ========= + implicit none + + type(c_ptr) :: kmemo + + integer(c_int) :: retval + integer(c_long) :: nni(1), nli(1), nfe(1), npe(1), nps(1), ncfl(1) + + !======= Internals ============ + + ! Main solver statistics + + retval = FKINGetNumNonlinSolvIters(kmemo, nni) + if (retval /= 0) then + print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumLinIters(kmemo, nli) + if (retval /= 0) then + print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumFuncEvals(kmemo, nfe) + if (retval /= 0) then + print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumPrecEvals(kmemo, npe) + if (retval /= 0) then + print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumPrecSolves(kmemo, nps) + if (retval /= 0) then + print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 + end if + + retval = FKINGetNumLinConvFails(kmemo, ncfl) + if (retval /= 0) then + print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 + end if + + print *, ' ' + print *, 'Final Statistics..' + print *, ' ' + print '(2(A,i6))' ,'nni =', nni, ' nli =', nli + print '(2(A,i6))' ,'nfe =', nfe, ' npe =', npe + print '(2(A,i6))' ,'nps =', nps, ' nlcf =', ncfl + + return + +end subroutine PrintFinalStats +! ---------------------------------------------------------------- diff --git a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.out b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.out new file mode 100644 index 0000000000..e4399f1518 --- /dev/null +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.out @@ -0,0 +1,47 @@ + + Example program fkinDiagon_kry: + This FKINSOL example solves a 128 eqn diagonal algebraic system. + Its purpose is to demonstrate the use of the Fortran interface in + a serial environment. + + Solution method: KIN_none +Problem size: neq = 128 + + 1 1.000000 2.000000 3.000000 4.000000 + 5 5.000000 6.000000 7.000000 8.000000 + 9 9.000000 10.000000 11.000000 12.000000 + 13 13.000000 14.000000 15.000000 16.000000 + 17 17.000000 18.000000 19.000000 20.000000 + 21 21.000000 22.000000 23.000000 24.000000 + 25 25.000000 26.000000 27.000000 28.000000 + 29 29.000000 30.000000 31.000000 32.000000 + 33 33.000000 34.000000 35.000000 36.000000 + 37 37.000000 38.000000 39.000000 40.000000 + 41 41.000000 42.000000 43.000000 44.000000 + 45 45.000000 46.000000 47.000000 48.000000 + 49 49.000000 50.000000 51.000000 52.000000 + 53 53.000000 54.000000 55.000000 56.000000 + 57 57.000000 58.000000 59.000000 60.000000 + 61 61.000000 62.000000 63.000000 64.000000 + 65 65.000000 66.000000 67.000000 68.000000 + 69 69.000000 70.000000 71.000000 72.000000 + 73 73.000000 74.000000 75.000000 76.000000 + 77 77.000000 78.000000 79.000000 80.000000 + 81 81.000000 82.000000 83.000000 84.000000 + 85 85.000000 86.000000 87.000000 88.000000 + 89 89.000000 90.000000 91.000000 92.000000 + 93 93.000000 94.000000 95.000000 96.000000 + 97 97.000000 98.000000 99.000000 100.000000 + 101 101.000000 102.000000 103.000000 104.000000 + 105 105.000000 106.000000 107.000000 108.000000 + 109 109.000000 110.000000 111.000000 112.000000 + 113 113.000000 114.000000 115.000000 116.000000 + 117 117.000000 118.000000 119.000000 120.000000 + 121 121.000000 122.000000 123.000000 124.000000 + 125 125.000000 126.000000 127.000000 128.000000 + + Final Statistics.. + +nni = 7 nli = 21 +nfe = 8 npe = 2 +nps = 28 nlcf = 0 diff --git a/examples/templates/cmakelists_openmp_F2003_ex.in b/examples/templates/cmakelists_openmp_F2003_ex.in new file mode 100644 index 0000000000..cf351be2a7 --- /dev/null +++ b/examples/templates/cmakelists_openmp_F2003_ex.in @@ -0,0 +1,153 @@ +# ----------------------------------------------------------------- +# 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 +# ----------------------------------------------------------------- +# CMakeLists.txt for @SOLVER@ Fortran 2003 OpenMP examples. +# +# This file is generated from a template using variables +# set at configuration time. It can be used as a template for +# other user CMakeLists configuration files. +# ----------------------------------------------------------------- + +# Set the minimum required cmake version +cmake_minimum_required(VERSION @CMAKE_VERSION@) + +# Set cache variables for compilers and flags +set(CMAKE_Fortran_COMPILER + @_EXAMPLES_Fortran_COMPILER@ + CACHE FILEPATH "Fortran compiler") + +set(CMAKE_Fortran_FLAGS + "@CMAKE_Fortran_FLAGS@" + CACHE STRING "Fortran compiler flags") + +# Specify project name and languages +project(@SOLVER@_F2003_openmp_examples Fortran) + +# Enable testing +include(CTest) + +# ------------------------------------------------------------------------------ + +# find OpenMP +find_package(OpenMP REQUIRED) + +# Update Fortran compiler and linker flags +set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_Fortran_FLAGS}") + +# ------------------------------------------------------------------------------ + +# Set cmake variables from template inputsd +set(SUNLS_LIB "@SUNLS_LIB@" CACHE STRING "SUNLinearSolver library") +set(SUNLS_FLIB "@SUNLS_FLIB@" CACHE STRING "SUNLinearSolver library") + +# Specify the path to SUNDIALS Fortran modules +set(SUNDIALS_INCLUDE_DIR + @CMAKE_INSTALL_PREFIX@/@Fortran_INSTALL_MODDIR@ + CACHE PATH "Location of SUNDIALS Fortran module files") + +# Specify the path to SUNDIALS libraries +set(SUNDIALS_LIBRARY_DIR + @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ + CACHE PATH "Location of SUNDIALS libraries") + +find_library(SUNDIALS_CORE_LIB + sundials_core ${SUNDIALS_LIBRARY_DIR} + DOC "SUNDIALS core library") + +find_library(SUNDIALS_FCORE_LIB + sundials_fcore_mod ${SUNDIALS_LIBRARY_DIR} + DOC "SUNDIALS Fortran core library") + +# Find the SUNDIALS libraries +find_library(SUNDIALS_SOLVER_LIB + @SOLVER_LIB@ ${SUNDIALS_LIBRARY_DIR} + DOC "@SOLVER@ library") + +find_library(SUNDIALS_SOLVER_FLIB + @SOLVER_FLIB@ ${SUNDIALS_LIBRARY_DIR} + DOC "@SOLVER@ Fortran-C library") + +find_library(SUNDIALS_NVEC_LIB + sundials_nvecopenmp ${SUNDIALS_LIBRARY_DIR} + DOC "NVECTOR_OPENMP library") + +find_library(SUNDIALS_NVEC_FLIB + sundials_fnvecopenmp_mod ${SUNDIALS_LIBRARY_DIR} + DOC "NVECTOR_OPENMP library") + +if("${SUNLS_LIB}" STREQUAL "") + # No additional SUNLinearSolver library necessary +else() + # Find the additional SUNLinearSolver library + find_library(SUNDIALS_SUNLS_LIB + @SUNLS_LIB@ ${SUNDIALS_LIBRARY_DIR} + DOC "SUNLinearSolver library") + + find_library(SUNDIALS_SUNLS_FLIB + @SUNLS_FLIB@ ${SUNDIALS_LIBRARY_DIR} + DOC "SUNLinearSolver library") +endif() + +# Set additional libraries +set(SUNDIALS_EXTRA_LIBS @LIBS@ CACHE STRING "Additional libraries") + +# For SUNDIALS module examples the solver library is not needed +if(NOT SUNDIALS_SOLVER_LIB) + set(SUNDIALS_SOLVER_LIB "") +endif() + +# List of SUNDIALS libraries +set(SUNDIALS_LIBRARIES + -L${SUNDIALS_LIBRARY_DIR} + ${SUNDIALS_SOLVER_FLIB} + ${SUNDIALS_NVEC_FLIB} + ${SUNDIALS_SUNLS_FLIB} + ${SUNDIALS_SOLVER_LIB} + ${SUNDIALS_NVEC_LIB} + ${SUNDIALS_SUNLS_LIB} + ${SUNDIALS_FCORE_LIB} + ${SUNDIALS_CORE_LIB} + ${SUNDIALS_EXTRA_LIBS}) + +# ------------------------------------------------------------------------------ + +# Set the names of the examples to be built and their dependencies +set(examples @EXAMPLES@) +set(examples_dependencies @EXAMPLES_DEPENDENCIES@) +if(examples) + list(REMOVE_DUPLICATES examples) +endif() + +# Create targets for each example +foreach(example ${examples}) + + # extract the file name without extension + get_filename_component(example_target ${example} NAME_WE) + + # Keep fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example_target}.dir) + + # example source files + add_executable(${example_target} ${example} ${examples_dependencies}) + + # directories to include + target_include_directories(${example_target} PRIVATE ${SUNDIALS_INCLUDE_DIR}) + + # libraries to link against + target_link_libraries(${example_target} ${SUNDIALS_LIBRARIES}) + + # add the example to ctest + add_test(NAME ${example_target} COMMAND ${example_target}) + +endforeach() diff --git a/examples/templates/makefile_openmp_F2003_ex.in b/examples/templates/makefile_openmp_F2003_ex.in new file mode 100644 index 0000000000..16ca3499cf --- /dev/null +++ b/examples/templates/makefile_openmp_F2003_ex.in @@ -0,0 +1,69 @@ +# -*- mode: makefile -*- +# ----------------------------------------------------------------- +# 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 +# ----------------------------------------------------------------- +# Makefile for @SOLVER@ OpenMP examples +# +# This file is generated from a template using variables +# set at configuration time. It can be used as a template for +# other user Makefiles. +# ----------------------------------------------------------------- + +SHELL = @SHELL@ + +prefix = @CMAKE_INSTALL_PREFIX@ +includedir = ${prefix}/@Fortran_INSTALL_MODDIR@ +libdir = ${prefix}/@CMAKE_INSTALL_LIBDIR@ + +F90 = @_EXAMPLES_Fortran_COMPILER@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ @OpenMP_Fortran_FLAGS@ +F90LIBS = @LIBS@ + +# ----------------------------------------------------------------------------------------- + +INCLUDES = -I${includedir} +LIBRARIES = -l@SOLVER_FLIB@ -l@SOLVER_LIB@ -lsundials_nvecopenmp \ + -lsundials_fnvecopenmp_mod ${F90LIBS} +LINKFLAGS = -Wl,-rpath,@libdir@ + +# ----------------------------------------------------------------------------------------- + +EXAMPLES = @EXAMPLES@ +EXAMPLES_DEPENDENCIES = @EXAMPLES_DEPENDENCIES@ + +OBJECTS = ${EXAMPLES:=.o} +OBJECTS_DEPENDENCIES = ${EXAMPLES_DEPENDENCIES:=.o} + +# ----------------------------------------------------------------------------------------- + +.SUFFIXES : .o .f90 + +.f90.o : + ${F90} ${F90FLAGS} ${INCLUDES} -c $< + +# ----------------------------------------------------------------------------------------- + +all: examples + +examples: ${OBJECTS_DEPENDENCIES} ${OBJECTS} + @for i in ${EXAMPLES} ; do \ + echo "${F90} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${F90FLAGS} ${INCLUDES} -L${libdir} ${LIBRARIES} ${LINKFLAGS}" ; \ + ${F90} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${F90FLAGS} ${INCLUDES} -L${libdir} ${LIBRARIES} ${LINKFLAGS} ; \ + done + +clean: + rm -f *.o *.mod + rm -f ${OBJECTS} + rm -f ${EXAMPLES} + +# ----------------------------------------------------------------------------------------- diff --git a/test/answers b/test/answers index b90293b66f..1ab057ec30 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit b90293b66ffe96c0b3842c2ba758cac4cfec1c29 +Subproject commit 1ab057ec30477fd531d4cc16c6b9bb0cd55ebd45 From a472fb52aab969cc9609d8a3bcd87038cc3100d2 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Wed, 21 Feb 2024 22:12:46 -0800 Subject: [PATCH 003/137] CMake: Fix CMP0135 warning, remove old CMake workarounds (#424) * Fix warning from [CMP0135](https://cmake.org/cmake/help/latest/policy/CMP0135.html) * Remove `cmake_minimum_required` with CUDA, 3.18 is now the minimum for all of SUNDIALS * Remove workarounds for CMake < 3.18 --------- Co-authored-by: Cody Balos --- CMakeLists.txt | 5 +++++ cmake/SundialsSetupCuda.cmake | 17 ----------------- cmake/SundialsSetupFortran.cmake | 7 ++----- cmake/macros/SundialsAddLibrary.cmake | 8 +------- 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e289936394..5a0870e035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,11 @@ cmake_minimum_required(VERSION 3.18) +# Address DOWNLOAD_EXTRACT_TIMESTAMP warning with CMake 3.24+ +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") + cmake_policy(SET CMP0135 NEW) +endif() + # Project SUNDIALS (initially only C supported) # sets PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR variables. project(SUNDIALS C) diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index f5b9d4acb3..f971e691a6 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -14,11 +14,6 @@ # Setup the CUDA languge and CUDA libraries. # --------------------------------------------------------------- -# For CUDA support, require CMake 3.18 so we can use FindCUDAToolkit -# FindCUDAToolkit was introduced in 3.17, but 3.18 fixes a lot -# of issues with it and CUDA as a native language. -cmake_minimum_required(VERSION 3.18.0) - # =============================================================== # Configure options needed prior to enabling the CUDA language # =============================================================== @@ -45,18 +40,6 @@ message(STATUS "CUDA standard set to ${CMAKE_CUDA_STANDARD}") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") -if(${CMAKE_VERSION} VERSION_LESS "3.18.0") - if(CMAKE_CUDA_ARCHITECTURES) - foreach(arch ${CMAKE_CUDA_ARCHITECTURES}) - # Remove real/virtual specifiers - string(REGEX MATCH "[0-9]+" arch_name "${arch}") - string(APPEND _nvcc_arch_flags " -gencode=arch=compute_${arch_name},code=sm_${arch_name}") - endforeach() - - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${_nvcc_arch_flags}") - endif() -endif() - if( (CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang) AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le) ) diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index a56ce213a4..ff07ff42c8 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -44,11 +44,8 @@ endif() enable_language(Fortran) set(Fortran_FOUND TRUE) -# Enable preprocessing Fortran code. With older versions of CMake is this -# handled in SundialsAddLibrary.cmake by adding a compiler option. -if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") - set(CMAKE_Fortran_PREPROCESS ON) -endif() +# Enable preprocessing Fortran code +set(CMAKE_Fortran_PREPROCESS ON) # ----------------------------------------------------------------------------- # Check if Fortran 2003 is supported diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index bafe3a7e18..dcf7edd1cb 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -439,12 +439,6 @@ macro(sundials_add_f2003_library target) string(REPLACE "sundials_f" "sundials_" _clib_name "${target}") string(REPLACE "_mod" "" _clib_name "${_clib_name}") - # If SundialsSetupFortran.cmake did not set CMAKE_Fortran_PREPROCESS to ON, - # then add a compiler flag to preprocess Fortran code. - if(CMAKE_VERSION VERSION_LESS "3.18") - set(_preprocess PRIVATE -cpp) - endif() - sundials_add_library(${target} SOURCES ${sundials_add_f2003_library_SOURCES} OBJECT_LIBRARIES ${sundials_add_f2003_library_OBJECT_LIBRARIES} @@ -455,7 +449,7 @@ macro(sundials_add_f2003_library target) ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} ${_includes} COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} - COMPILE_OPTIONS ${sundials_add_f2003_library_COMPILE_OPTIONS} ${_preprocess} + COMPILE_OPTIONS ${sundials_add_f2003_library_COMPILE_OPTIONS} PROPERTIES ${sundials_add_f2003_library_PROPERTIES} ${_properties} OUTPUT_NAME ${sundials_add_f2003_library_OUTPUT_NAME} VERSION ${sundials_add_f2003_library_VERSION} From 5a18589f94cb7c5a5e25a0bf526fa151104ce48a Mon Sep 17 00:00:00 2001 From: David Gardner Date: Mon, 26 Feb 2024 18:47:25 -0800 Subject: [PATCH 004/137] Maintenance: Remove unused F77 macro (#425) Remove unused `SUNDIALS_MPI_COMM_F2C` macro (originally needed in F77 interfaces). --- include/sundials/sundials_config.in | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index 25d2fe8e78..1d55b02fea 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -294,14 +294,6 @@ */ @F77_MANGLE_MACRO2@ -/* Allow user to specify different MPI communicator - * If it was found that the MPI implementation supports MPI_Comm_f2c, then - * #define SUNDIALS_MPI_COMM_F2C 1 - * otherwise - * #define SUNDIALS_MPI_COMM_F2C 0 - */ -@F77_MPI_COMM_F2C@ - /* ------------------------------------------------------------------ * SUNDIALS __builtin_expect related macros. * These macros provide hints to the compiler that the condition From bf2673df04124093e7368da227ee85e50812698f Mon Sep 17 00:00:00 2001 From: David Gardner Date: Mon, 26 Feb 2024 21:31:23 -0800 Subject: [PATCH 005/137] Maintenance: update citation (#428) Add volume, number, and pages to 2022 TOMS citation --- CITATIONS.md | 3 +++ doc/shared/cite_sundials.rst | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CITATIONS.md b/CITATIONS.md index 0872f96156..fbd2483ef3 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -9,6 +9,9 @@ reporting work done with SUNDIALS: author = {Gardner, David J and Reynolds, Daniel R and Woodward, Carol S and Balos, Cody J}, journal = {ACM Transactions on Mathematical Software (TOMS)}, publisher = {ACM}, + volume = {48}, + number = {3}, + pages = {1--24}, year = {2022}, doi = {10.1145/3539801} } diff --git a/doc/shared/cite_sundials.rst b/doc/shared/cite_sundials.rst index 95e6e1f82f..60fc943471 100644 --- a/doc/shared/cite_sundials.rst +++ b/doc/shared/cite_sundials.rst @@ -20,6 +20,9 @@ reporting work done with SUNDIALS: author = {Gardner, David J and Reynolds, Daniel R and Woodward, Carol S and Balos, Cody J}, journal = {ACM Transactions on Mathematical Software (TOMS)}, publisher = {ACM}, + volume = {48}, + number = {3}, + pages = {1--24}, year = {2022}, doi = {10.1145/3539801} } From 2470547af3119a58b1d534057f022677c149aafe Mon Sep 17 00:00:00 2001 From: David Gardner Date: Tue, 27 Feb 2024 02:22:04 -0800 Subject: [PATCH 006/137] Maintenance: Python3 (#427) Consistently use Python3, fixes unexpected `make test` failures with dev tests enabled on systems with `python3` but not `python`. --- benchmarks/advection_reaction_3D/scripts/compare_error.py | 2 +- benchmarks/advection_reaction_3D/scripts/compute_error.py | 2 +- benchmarks/advection_reaction_3D/scripts/make_plots.py | 2 +- .../advection_reaction_3D/scripts/pickle_solution_output.py | 2 +- benchmarks/nvector/plot_nvector_performance_results.py | 2 +- benchmarks/nvector/plot_nvector_performance_speedup.py | 2 +- examples/arkode/CXX_parallel/plot_brusselator1D.py | 2 +- examples/arkode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/arkode/CXX_parhyp/plot_heat2D_p.py | 2 +- examples/arkode/CXX_serial/plot_heat2D.py | 2 +- examples/arkode/CXX_serial/plot_sol.py | 2 +- examples/arkode/CXX_xbraid/plot_heat2D.py | 2 +- examples/arkode/C_manyvector/plot_brusselator1D.py | 2 +- examples/arkode/C_openmp/plot_brusselator1D.py | 2 +- examples/arkode/C_parallel/plot_brusselator1D.py | 2 +- examples/arkode/C_serial/ark_kepler_plot.py | 2 +- examples/arkode/C_serial/plot_brusselator1D.py | 2 +- examples/arkode/C_serial/plot_brusselator1D_FEM.py | 2 +- examples/arkode/C_serial/plot_heat1D.py | 2 +- examples/arkode/C_serial/plot_heat1D_adapt.py | 2 +- examples/arkode/C_serial/plot_sol.py | 2 +- examples/arkode/C_serial/plot_sol_log.py | 2 +- examples/cvode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/cvode/CXX_parhyp/plot_heat2D_p.py | 2 +- examples/cvode/CXX_serial/plot_heat2D.py | 2 +- examples/cvode/serial/plot_cvParticle.py | 2 +- examples/cvode/serial/plot_cvPendulum.py | 2 +- examples/cvodes/serial/plot_cvsParticle.py | 2 +- examples/cvodes/serial/plot_cvsPendulum.py | 2 +- scripts/countlines.py | 2 +- scripts/findlines.py | 2 +- test/cron/sunbuild.py | 2 +- test/notify.py | 2 +- test/testRunner | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/benchmarks/advection_reaction_3D/scripts/compare_error.py b/benchmarks/advection_reaction_3D/scripts/compare_error.py index d4164ec842..2dc66d23fa 100755 --- a/benchmarks/advection_reaction_3D/scripts/compare_error.py +++ b/benchmarks/advection_reaction_3D/scripts/compare_error.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security diff --git a/benchmarks/advection_reaction_3D/scripts/compute_error.py b/benchmarks/advection_reaction_3D/scripts/compute_error.py index 9a928a9b56..2c01826b29 100755 --- a/benchmarks/advection_reaction_3D/scripts/compute_error.py +++ b/benchmarks/advection_reaction_3D/scripts/compute_error.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security diff --git a/benchmarks/advection_reaction_3D/scripts/make_plots.py b/benchmarks/advection_reaction_3D/scripts/make_plots.py index f58a263080..69a0168d79 100755 --- a/benchmarks/advection_reaction_3D/scripts/make_plots.py +++ b/benchmarks/advection_reaction_3D/scripts/make_plots.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # ------------------------------------------------------------------------------ diff --git a/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py b/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py index 269353c2e0..407c34921a 100755 --- a/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py +++ b/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # SUNDIALS Copyright Start # Copyright (c) 2002-2024, Lawrence Livermore National Security diff --git a/benchmarks/nvector/plot_nvector_performance_results.py b/benchmarks/nvector/plot_nvector_performance_results.py index e3ddea8dde..02c45665e6 100755 --- a/benchmarks/nvector/plot_nvector_performance_results.py +++ b/benchmarks/nvector/plot_nvector_performance_results.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/benchmarks/nvector/plot_nvector_performance_speedup.py b/benchmarks/nvector/plot_nvector_performance_speedup.py index db433bdb39..fb421f5573 100755 --- a/benchmarks/nvector/plot_nvector_performance_speedup.py +++ b/benchmarks/nvector/plot_nvector_performance_speedup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/examples/arkode/CXX_parallel/plot_brusselator1D.py b/examples/arkode/CXX_parallel/plot_brusselator1D.py index 8add8b8c5d..2bcc7d1af7 100755 --- a/examples/arkode/CXX_parallel/plot_brusselator1D.py +++ b/examples/arkode/CXX_parallel/plot_brusselator1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/CXX_parallel/plot_heat2D_p.py b/examples/arkode/CXX_parallel/plot_heat2D_p.py index 3cf737a741..7b7f83d929 100755 --- a/examples/arkode/CXX_parallel/plot_heat2D_p.py +++ b/examples/arkode/CXX_parallel/plot_heat2D_p.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/arkode/CXX_parhyp/plot_heat2D_p.py b/examples/arkode/CXX_parhyp/plot_heat2D_p.py index 3cf737a741..7b7f83d929 100755 --- a/examples/arkode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/arkode/CXX_parhyp/plot_heat2D_p.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/arkode/CXX_serial/plot_heat2D.py b/examples/arkode/CXX_serial/plot_heat2D.py index cdf36b8764..6c97cdc112 100755 --- a/examples/arkode/CXX_serial/plot_heat2D.py +++ b/examples/arkode/CXX_serial/plot_heat2D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/arkode/CXX_serial/plot_sol.py b/examples/arkode/CXX_serial/plot_sol.py index 0d559e2bb6..ab463fac6c 100755 --- a/examples/arkode/CXX_serial/plot_sol.py +++ b/examples/arkode/CXX_serial/plot_sol.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/CXX_xbraid/plot_heat2D.py b/examples/arkode/CXX_xbraid/plot_heat2D.py index 125d4063ee..72aaa2adea 100755 --- a/examples/arkode/CXX_xbraid/plot_heat2D.py +++ b/examples/arkode/CXX_xbraid/plot_heat2D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/arkode/C_manyvector/plot_brusselator1D.py b/examples/arkode/C_manyvector/plot_brusselator1D.py index 476df7009c..3cc29051e5 100755 --- a/examples/arkode/C_manyvector/plot_brusselator1D.py +++ b/examples/arkode/C_manyvector/plot_brusselator1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_openmp/plot_brusselator1D.py b/examples/arkode/C_openmp/plot_brusselator1D.py index 476df7009c..3cc29051e5 100755 --- a/examples/arkode/C_openmp/plot_brusselator1D.py +++ b/examples/arkode/C_openmp/plot_brusselator1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_parallel/plot_brusselator1D.py b/examples/arkode/C_parallel/plot_brusselator1D.py index 8add8b8c5d..2bcc7d1af7 100755 --- a/examples/arkode/C_parallel/plot_brusselator1D.py +++ b/examples/arkode/C_parallel/plot_brusselator1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/ark_kepler_plot.py b/examples/arkode/C_serial/ark_kepler_plot.py index 3ca55e941c..2d499d850e 100755 --- a/examples/arkode/C_serial/ark_kepler_plot.py +++ b/examples/arkode/C_serial/ark_kepler_plot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Cody J. Balos @ LLNL # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/plot_brusselator1D.py b/examples/arkode/C_serial/plot_brusselator1D.py index 476df7009c..3cc29051e5 100755 --- a/examples/arkode/C_serial/plot_brusselator1D.py +++ b/examples/arkode/C_serial/plot_brusselator1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/plot_brusselator1D_FEM.py b/examples/arkode/C_serial/plot_brusselator1D_FEM.py index 719780307b..d47bf2b40e 100755 --- a/examples/arkode/C_serial/plot_brusselator1D_FEM.py +++ b/examples/arkode/C_serial/plot_brusselator1D_FEM.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # ------------------------------------------------------------ diff --git a/examples/arkode/C_serial/plot_heat1D.py b/examples/arkode/C_serial/plot_heat1D.py index cd9ebee783..d1c8e2bfdf 100755 --- a/examples/arkode/C_serial/plot_heat1D.py +++ b/examples/arkode/C_serial/plot_heat1D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/plot_heat1D_adapt.py b/examples/arkode/C_serial/plot_heat1D_adapt.py index 613883808f..fa813fff04 100755 --- a/examples/arkode/C_serial/plot_heat1D_adapt.py +++ b/examples/arkode/C_serial/plot_heat1D_adapt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/plot_sol.py b/examples/arkode/C_serial/plot_sol.py index cccefe4712..af783fb053 100755 --- a/examples/arkode/C_serial/plot_sol.py +++ b/examples/arkode/C_serial/plot_sol.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/arkode/C_serial/plot_sol_log.py b/examples/arkode/C_serial/plot_sol_log.py index e57e8690bb..ca27f9eb59 100755 --- a/examples/arkode/C_serial/plot_sol_log.py +++ b/examples/arkode/C_serial/plot_sol_log.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ---------------------------------------------------------------- # Programmer(s): Daniel R. Reynolds @ SMU # ---------------------------------------------------------------- diff --git a/examples/cvode/CXX_parallel/plot_heat2D_p.py b/examples/cvode/CXX_parallel/plot_heat2D_p.py index 5868e03f45..5e5357873a 100755 --- a/examples/cvode/CXX_parallel/plot_heat2D_p.py +++ b/examples/cvode/CXX_parallel/plot_heat2D_p.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/cvode/CXX_parhyp/plot_heat2D_p.py b/examples/cvode/CXX_parhyp/plot_heat2D_p.py index 695bf967c8..58673d17b2 100755 --- a/examples/cvode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/cvode/CXX_parhyp/plot_heat2D_p.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/cvode/CXX_serial/plot_heat2D.py b/examples/cvode/CXX_serial/plot_heat2D.py index 0213525848..bbadc4de32 100755 --- a/examples/cvode/CXX_serial/plot_heat2D.py +++ b/examples/cvode/CXX_serial/plot_heat2D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): Daniel R. Reynolds @ SMU # David J. Gardner @ LLNL diff --git a/examples/cvode/serial/plot_cvParticle.py b/examples/cvode/serial/plot_cvParticle.py index 8589734f8c..6557000a0a 100755 --- a/examples/cvode/serial/plot_cvParticle.py +++ b/examples/cvode/serial/plot_cvParticle.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/examples/cvode/serial/plot_cvPendulum.py b/examples/cvode/serial/plot_cvPendulum.py index c017a8037c..07314f2936 100755 --- a/examples/cvode/serial/plot_cvPendulum.py +++ b/examples/cvode/serial/plot_cvPendulum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/examples/cvodes/serial/plot_cvsParticle.py b/examples/cvodes/serial/plot_cvsParticle.py index 42242a76cd..fb0c66da1c 100755 --- a/examples/cvodes/serial/plot_cvsParticle.py +++ b/examples/cvodes/serial/plot_cvsParticle.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/examples/cvodes/serial/plot_cvsPendulum.py b/examples/cvodes/serial/plot_cvsPendulum.py index 2a3d08341d..0376a755bb 100755 --- a/examples/cvodes/serial/plot_cvsPendulum.py +++ b/examples/cvodes/serial/plot_cvsPendulum.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/scripts/countlines.py b/scripts/countlines.py index e24544415a..80e4456bb1 100644 --- a/scripts/countlines.py +++ b/scripts/countlines.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): David J. Gardner @ LLNL # ------------------------------------------------------------------------------ diff --git a/scripts/findlines.py b/scripts/findlines.py index 1a1360fe13..03199df3c7 100755 --- a/scripts/findlines.py +++ b/scripts/findlines.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ------------------------------------------------------------------------------ # Programmer(s): David J. Gardner @ LLNL # ------------------------------------------------------------------------------ diff --git a/test/cron/sunbuild.py b/test/cron/sunbuild.py index fd6d948493..baa94f6617 100755 --- a/test/cron/sunbuild.py +++ b/test/cron/sunbuild.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # ------------------------------------------------------------------------------- # Programmer(s): Eddy Banks and David J. Gardner @ LLNL # ------------------------------------------------------------------------------- diff --git a/test/notify.py b/test/notify.py index bb1c6c693f..88c1ab2a16 100755 --- a/test/notify.py +++ b/test/notify.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # Programmer(s): David J. Gardner @ LLNL # ----------------------------------------------------------------------------- diff --git a/test/testRunner b/test/testRunner index f0d41d6520..5a18d9b420 100755 --- a/test/testRunner +++ b/test/testRunner @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # --------------------------------------------------------------- # Programmer(s): Steven Smith @ LLNL # David J. Gardner @ LLNL From 00e6f8987fbd8fce6c5a4bab94522f0d2b432c09 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Tue, 27 Feb 2024 20:27:22 -0800 Subject: [PATCH 007/137] Maintenance: update changelog (#429) * Note a subset of C99 is now required * Move addition to F2003 examples to v7 --- CHANGELOG.md | 14 +++++++++----- doc/arkode/guide/source/Introduction.rst | 16 ++++++++++------ doc/cvode/guide/source/Introduction.rst | 16 ++++++++++------ doc/cvodes/guide/source/Introduction.rst | 16 ++++++++++------ doc/ida/guide/source/Introduction.rst | 16 ++++++++++------ doc/idas/guide/source/Introduction.rst | 16 ++++++++++------ doc/kinsol/guide/source/Introduction.rst | 16 ++++++++++------ test/notify.py | 17 ++++++++--------- 8 files changed, 77 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31ba6903fc..36df2dc4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,5 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release X.X.X - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - ## Changes to SUNDIALS in release 7.0.0-rc.1 ⚠️ This is a release candidate. @@ -18,6 +13,12 @@ section in the user guide for details. ### Breaking Changes +#### Minimum C Standard + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with [Visual Studio 2015](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1). + #### Deprecated Types and Functions Removed The previously deprecated types `realtype` and `booleantype` were removed from @@ -166,6 +167,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves [#409](https://github.com/LLNL/sundials/issues/409) and [#249](https://github.com/LLNL/sundials/issues/249) +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + ## Changes to SUNDIALS in release 6.7.0 Added the `SUNAdaptController` base class, ported ARKODE's internal diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 621855c4e2..7e301a294d 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -130,12 +130,6 @@ provided with SUNDIALS, or again may utilize a user-supplied module. Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v6.0.0-rc.1 ---------------------- @@ -147,6 +141,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -323,6 +324,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v5.7.0 ----------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 5f01fb5398..a234d2218d 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -111,12 +111,6 @@ implementations. Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v7.0.0-rc.1 ---------------------- @@ -128,6 +122,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -293,6 +294,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v6.7.0 ----------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index bde9ca1895..4ea759ff7c 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -111,12 +111,6 @@ Fortran. Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v7.0.0-rc.1 ---------------------- @@ -128,6 +122,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -293,6 +294,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v6.7.0 ----------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 39530a20dd..c5ef6450dd 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -72,12 +72,6 @@ systems. Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v7.0.0-rc.1 ---------------------- @@ -89,6 +83,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -254,6 +255,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v6.7.0 ----------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 082ddfc796..9859a35a0c 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -86,12 +86,6 @@ integrate any final-condition ODE dependent on the solution of the original IVP Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v6.0.0-rc.1 ---------------------- @@ -103,6 +97,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -268,6 +269,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v5.7.0 ----------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 0ef7e5e9a7..0a1be734a5 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -88,12 +88,6 @@ applications written in Fortran. Changes from previous versions ============================== -Changes in vX.X.X ------------------ - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' current -Fortran 2003 interface. - Changes in v7.0.0-rc.1 ---------------------- @@ -105,6 +99,13 @@ for details. **Breaking Changes** +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with +`Visual Studio 2015 `_. + *Deprecated Types and Functions Removed* The previously deprecated types ``realtype`` and ``booleantype`` were removed @@ -249,6 +250,9 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + Changes in v6.7.0 ----------------- diff --git a/test/notify.py b/test/notify.py index 88c1ab2a16..befdd721ab 100755 --- a/test/notify.py +++ b/test/notify.py @@ -61,12 +61,12 @@ def main(): else: # author of most recent commit cmd = "git log --format='%ae' -1" - recipient = runCommand(cmd).rstrip() + recipient = runCommand(cmd).rstrip().decode('UTF-8') # check if the last commit was a CI merge if (recipient == 'nobody@nowhere'): cmd = "git log HEAD~1 --pretty=format:'%ae' -1" - recipient = runCommand(cmd).rstrip() + recipient = runCommand(cmd).rstrip().decode('UTF-8') # send notification if tests fail, log file not found, or fixed if (args.teststatus == 'failed'): @@ -103,15 +103,14 @@ def runCommand(cmd): def sendEmail(recipient, subject, message): import smtplib - from email.MIMEText import MIMEText + from email.message import EmailMessage # Open a plain text file for reading. Assumed that # the text file contains only ASCII characters. - fp = open(message, 'rb') - - # Create a text/plain message - msg = MIMEText(fp.read()) - fp.close() + with open(message) as fp: + # Create a text/plain message + msg = EmailMessage() + msg.set_content(fp.read()) # sender's email address sender = "SUNDIALS.suntest@llnl.gov" @@ -124,7 +123,7 @@ def sendEmail(recipient, subject, message): # Send the message via our own SMTP server, but don't include the # envelope header. s = smtplib.SMTP('smtp.llnl.gov') - s.sendmail(sender, [recipient], msg.as_string()) + s.send_message(msg) s.quit() From 612b2becae7033e974c011891c417384e671a158 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Wed, 28 Feb 2024 08:40:23 -0800 Subject: [PATCH 008/137] Maintenance: move LAPACK FC macros (#426) Fortran-C name mangling macros are now only used for LAPACK. * Rename macros and CMake options from `F77` to `LAPACK` * Move most name mangling determination logic to LAPACK CMake file * Move name mangling macros to implementation header --- CHANGELOG.md | 5 + cmake/SundialsSetupCompilers.cmake | 77 +++--- cmake/SundialsSetupFortran.cmake | 219 ---------------- cmake/macros/SundialsAddLibrary.cmake | 6 +- cmake/tpl/SundialsLapack.cmake | 234 +++++++++++++++++- doc/arkode/guide/source/Introduction.rst | 5 + doc/cvode/guide/source/Introduction.rst | 5 + doc/cvodes/guide/source/Introduction.rst | 5 + doc/ida/guide/source/Introduction.rst | 5 + doc/idas/guide/source/Introduction.rst | 5 + doc/kinsol/guide/source/Introduction.rst | 5 + doc/shared/sundials/Install.rst | 8 +- include/sundials/sundials_config.in | 23 -- ...apack_defs.h => sundials_lapack_defs.h.in} | 35 ++- 14 files changed, 340 insertions(+), 297 deletions(-) rename src/sundials/{sundials_lapack_defs.h => sundials_lapack_defs.h.in} (75%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36df2dc4fe..4db76e0318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -167,6 +167,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves [#409](https://github.com/LLNL/sundials/issues/409) and [#249](https://github.com/LLNL/sundials/issues/249) +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from `SUNDIALS_F77_FUNC_CASE` and +`SUNDIALS_F77_FUNC_UNDERSCORES` to `SUNDIALS_LAPACK_CASE` and +`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 1d2873b6e7..36f10b44c1 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -240,71 +240,76 @@ endif() # ------------------------------------------------------------------------------ # The case to use in the name-mangling scheme -sundials_option(SUNDIALS_F77_FUNC_CASE STRING - "case of Fortran function names (lower/upper)" +sundials_option(SUNDIALS_LAPACK_CASE STRING + "case of LAPACK function names (lower/upper)" "" ADVANCED) # The number of underscores of appended in the name-mangling scheme -sundials_option(SUNDIALS_F77_FUNC_UNDERSCORES STRING - "number of underscores appended to Fortran function names (none/one/two)" +sundials_option(SUNDIALS_LAPACK_UNDERSCORES STRING + "number of underscores appended to LAPACK function names (none/one/two)" "" ADVANCED) # If used, both case and underscores must be set -if((NOT SUNDIALS_F77_FUNC_CASE) AND SUNDIALS_F77_FUNC_UNDERSCORES) - print_error("If SUNDIALS_F77_FUNC_UNDERSCORES is set, " - "SUNDIALS_F77_FUNC_CASE must also be set.") +if((NOT SUNDIALS_LAPACK_CASE) AND SUNDIALS_LAPACK_UNDERSCORES) + print_error("If SUNDIALS_LAPACK_UNDERSCORES is set, " + "SUNDIALS_LAPACK_CASE must also be set.") endif() -if(SUNDIALS_F77_FUNC_CASE AND (NOT SUNDIALS_F77_FUNC_UNDERSCORES)) - print_error("If SUNDIALS_F77_FUNC_CASE is set, " - "SUNDIALS_F77_FUNC_UNDERSCORES must also be set.") +if(SUNDIALS_LAPACK_CASE AND (NOT SUNDIALS_LAPACK_UNDERSCORES)) + print_error("If SUNDIALS_LAPACK_CASE is set, " + "SUNDIALS_LAPACK_UNDERSCORES must also be set.") endif() # Did the user provide a name-mangling scheme? -if(SUNDIALS_F77_FUNC_CASE AND SUNDIALS_F77_FUNC_UNDERSCORES) +if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) - string(TOUPPER ${SUNDIALS_F77_FUNC_CASE} SUNDIALS_F77_FUNC_CASE) - string(TOUPPER ${SUNDIALS_F77_FUNC_UNDERSCORES} SUNDIALS_F77_FUNC_UNDERSCORES) + string(TOUPPER ${SUNDIALS_LAPACK_CASE} SUNDIALS_LAPACK_CASE) + string(TOUPPER ${SUNDIALS_LAPACK_UNDERSCORES} SUNDIALS_LAPACK_UNDERSCORES) # Based on the given case and number of underscores, set the C preprocessor # macro definitions. Since SUNDIALS never uses symbols names containing # underscores we set the name-mangling schemes to be the same. In general, # names of symbols with and without underscore may be mangled differently # (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__) - if(SUNDIALS_F77_FUNC_CASE MATCHES "LOWER") - if(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "NONE") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name") - elseif(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "ONE") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## _") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## _") - elseif(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "TWO") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## __") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## __") + if(SUNDIALS_LAPACK_CASE MATCHES "LOWER") + if(SUNDIALS_LAPACK_UNDERSCORES MATCHES "NONE") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") + elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") else() - print_error("Invalid SUNDIALS_F77_FUNC_UNDERSCORES option.") + print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() - elseif(SUNDIALS_F77_FUNC_CASE MATCHES "UPPER") - if(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "NONE") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME") - elseif(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "ONE") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## _") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## _") - elseif(SUNDIALS_F77_FUNC_UNDERSCORES MATCHES "TWO") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## __") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## __") + elseif(SUNDIALS_LAPACK_CASE MATCHES "UPPER") + if(SUNDIALS_LAPACK_UNDERSCORES MATCHES "NONE") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") + elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") else() - print_error("Invalid SUNDIALS_F77_FUNC_UNDERSCORES option.") + print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() else() - print_error("Invalid SUNDIALS_F77_FUNC_CASE option.") + print_error("Invalid SUNDIALS_LAPACK_CASE option.") endif() # name-mangling scheme has been manually set set(NEED_FORTRAN_NAME_MANGLING FALSE) + configure_file( + ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h + ) + endif() # Do we need a Fortran compiler? diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index ff07ff42c8..2e6e8c4de0 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -101,222 +101,3 @@ endif() # Put all F2003 modules into one build directory set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/fortran") - -# --------------------------------------------------------------- -# Determining the name-mangling scheme if needed -# --------------------------------------------------------------- -# In general, names of symbols with and without underscore may be mangled -# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), -# we have to consider both cases. -# -# Method: -# 1) create a library from a Fortran source file which defines a function "mysub" -# 2) attempt to link with this library a C source file which calls the "mysub" -# function using various possible schemes (6 different schemes, corresponding -# to all combinations lower/upper case and none/one/two underscores). -# 3) define the name-mangling scheme based on the test that was successful. -# -# On exit, if we were able to infer the scheme, the variables -# CMAKE_Fortran_SCHEME_NO_UNDERSCORES and CMAKE_Fortran_SCHEME_WITH_UNDERSCORES -# contain the mangled names for "mysub" and "my_sub", respectively. -# --------------------------------------------------------------- -if(NEED_FORTRAN_NAME_MANGLING) - - set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "") - set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES "") - - # Create the FortranTest directory - set(FortranTest_DIR ${PROJECT_BINARY_DIR}/FortranTest) - file(MAKE_DIRECTORY ${FortranTest_DIR}) - - # Create a CMakeLists.txt file which will generate the "flib" library - # and an executable "ftest" - file(WRITE ${FortranTest_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ftest Fortran)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_Fortran_COMPILER \"${CMAKE_Fortran_COMPILER}\")\n" - "SET(CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS}\")\n" - "SET(CMAKE_Fortran_FLAGS_RELEASE \"${CMAKE_Fortran_FLAGS_RELEASE}\")\n" - "SET(CMAKE_Fortran_FLAGS_DEBUG \"${CMAKE_Fortran_FLAGS_DEBUG}\")\n" - "SET(CMAKE_Fortran_FLAGS_RELWITHDEBUGINFO \"${CMAKE_Fortran_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_Fortran_FLAGS_MINSIZE \"${CMAKE_Fortran_FLAGS_MINSIZE}\")\n" - "ADD_LIBRARY(flib flib.f)\n" - "ADD_EXECUTABLE(ftest ftest.f)\n" - "TARGET_LINK_LIBRARIES(ftest flib)\n") - - # Create the Fortran source flib.f which defines two subroutines, "mysub" and "my_sub" - file(WRITE ${FortranTest_DIR}/flib.f - " SUBROUTINE mysub\n" - " RETURN\n" - " END\n" - " SUBROUTINE my_sub\n" - " RETURN\n" - " END\n") - - # Create the Fortran source ftest.f which calls "mysub" and "my_sub" - file(WRITE ${FortranTest_DIR}/ftest.f - " PROGRAM ftest\n" - " CALL mysub()\n" - " CALL my_sub()\n" - " END\n") - - # Use TRY_COMPILE to make the targets "flib" and "ftest" - try_compile(FTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ftest OUTPUT_VARIABLE MY_OUTPUT) - - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. - file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) - - # Proceed based on test results - if(FTEST_OK) - - # Infer Fortran name-mangling scheme for symbols WITHOUT underscores. - # Overwrite CMakeLists.txt with one which will generate the "ctest1" executable - file(WRITE ${FortranTest_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ctest1 C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "ADD_EXECUTABLE(ctest1 ctest1.c)\n" - "FIND_LIBRARY(FLIB flib \"${FortranTest_DIR}\")\n" - "TARGET_LINK_LIBRARIES(ctest1 \${FLIB})\n") - - # Define the list "options" of all possible schemes that we want to consider - # Get its length and initialize the counter "iopt" to zero - set(options mysub mysub_ mysub__ MYSUB MYSUB_ MYSUB__) - list(LENGTH options imax) - set(iopt 0) - - # We will attempt to sucessfully generate the "ctest1" executable as long as - # there still are entries in the "options" list - while(${iopt} LESS ${imax}) - # Get the current list entry (current scheme) - list(GET options ${iopt} opt) - # Generate C source which calls the "mysub" function using the current scheme - file(WRITE ${FortranTest_DIR}/ctest1.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - # Use TRY_COMPILE to make the "ctest1" executable from the current C source - # and linking to the previously created "flib" library. - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest1 OUTPUT_VARIABLE MY_OUTPUT) - # Write output compiling the test code - file(WRITE ${FortranTest_DIR}/ctest1_${opt}.out "${MY_OUTPUT}") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. - file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) - # Test if we successfully created the "ctest" executable. - # If yes, save the current scheme, and set the counter "iopt" to "imax" - # so that we exit the while loop. - # Otherwise, increment the counter "iopt" and go back in the while loop. - if(CTEST_OK) - set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES ${opt}) - set(iopt ${imax}) - else(CTEST_OK) - math(EXPR iopt ${iopt}+1) - endif() - endwhile(${iopt} LESS ${imax}) - - # Infer Fortran name-mangling scheme for symbols WITH underscores. - # Practically a duplicate of the previous steps. - file(WRITE ${FortranTest_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ctest2 C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "ADD_EXECUTABLE(ctest2 ctest2.c)\n" - "FIND_LIBRARY(FLIB flib \"${FortranTest_DIR}\")\n" - "TARGET_LINK_LIBRARIES(ctest2 \${FLIB})\n") - - set(options my_sub my_sub_ my_sub__ MY_SUB MY_SUB_ MY_SUB__) - list(LENGTH options imax) - set(iopt 0) - while(${iopt} LESS ${imax}) - list(GET options ${iopt} opt) - file(WRITE ${FortranTest_DIR}/ctest2.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest2 OUTPUT_VARIABLE MY_OUTPUT) - file(WRITE ${FortranTest_DIR}/ctest2_${opt}.out "${MY_OUTPUT}") - file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) - if(CTEST_OK) - set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES ${opt}) - set(iopt ${imax}) - else(CTEST_OK) - math(EXPR iopt ${iopt}+1) - endif() - endwhile(${iopt} LESS ${imax}) - - # If a name-mangling scheme was found set the C preprocessor macros to use - # that scheme. Otherwise default to lower case with one underscore. - if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) - message(STATUS "Determining Fortran name-mangling scheme... OK") - else() - message(STATUS "Determining Fortran name-mangling scheme... DEFAULT") - set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "mysub_") - set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES "my_sub_") - endif() - - # Symbols NO underscores - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name") - endif() - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## _") - endif() - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) name ## __") - endif() - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME") - endif() - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## _") - endif() - if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__") - set(F77_MANGLE_MACRO1 "#define SUNDIALS_F77_FUNC(name,NAME) NAME ## __") - endif() - - # Symbols WITH underscores - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name") - endif() - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub_") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## _") - endif() - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub__") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) name ## __") - endif() - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME") - endif() - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB_") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## _") - endif() - if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB__") - set(F77_MANGLE_MACRO2 "#define SUNDIALS_F77_FUNC_(name,NAME) NAME ## __") - endif() - - # name-mangling scheme has been set - set(NEED_FORTRAN_NAME_MANGLING FALSE) - else(FTEST_OK) - message(STATUS "Determining Fortran name-mangling scheme... FAILED") - endif() - -endif() diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index dcf7edd1cb..ca0d226191 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -190,7 +190,8 @@ macro(sundials_add_library target) PUBLIC $ $ - $ + $ + $ ) if(sundials_add_library_INCLUDE_DIRECTORIES) string(REPLACE "{{libtype}}" "${_libtype}" _includes "${sundials_add_library_INCLUDE_DIRECTORIES}") @@ -283,7 +284,8 @@ macro(sundials_add_library target) target_include_directories(${_actual_target_name} PUBLIC $ $ - $ + $ + $ $) # add all other includes diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index fb7f8fa6af..63b8514520 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -65,6 +65,231 @@ message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}") # Section 4: Test the TPL # ----------------------------------------------------------------------------- +# --------------------------------------------------------------- +# Determining the name-mangling scheme if needed +# --------------------------------------------------------------- +# In general, names of symbols with and without underscore may be mangled +# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), +# we have to consider both cases. +# +# Method: +# 1) create a library from a Fortran source file which defines a function "mysub" +# 2) attempt to link with this library a C source file which calls the "mysub" +# function using various possible schemes (6 different schemes, corresponding +# to all combinations lower/upper case and none/one/two underscores). +# 3) define the name-mangling scheme based on the test that was successful. +# +# On exit, if we were able to infer the scheme, the variables +# CMAKE_Fortran_SCHEME_NO_UNDERSCORES and CMAKE_Fortran_SCHEME_WITH_UNDERSCORES +# contain the mangled names for "mysub" and "my_sub", respectively. +# --------------------------------------------------------------- +if(NEED_FORTRAN_NAME_MANGLING) + + set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "") + set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES "") + + # Create the FortranTest directory + set(FortranTest_DIR ${PROJECT_BINARY_DIR}/FortranTest) + file(MAKE_DIRECTORY ${FortranTest_DIR}) + + # Create a CMakeLists.txt file which will generate the "flib" library + # and an executable "ftest" + file(WRITE ${FortranTest_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ftest Fortran)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_Fortran_COMPILER \"${CMAKE_Fortran_COMPILER}\")\n" + "SET(CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS}\")\n" + "SET(CMAKE_Fortran_FLAGS_RELEASE \"${CMAKE_Fortran_FLAGS_RELEASE}\")\n" + "SET(CMAKE_Fortran_FLAGS_DEBUG \"${CMAKE_Fortran_FLAGS_DEBUG}\")\n" + "SET(CMAKE_Fortran_FLAGS_RELWITHDEBUGINFO \"${CMAKE_Fortran_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_Fortran_FLAGS_MINSIZE \"${CMAKE_Fortran_FLAGS_MINSIZE}\")\n" + "ADD_LIBRARY(flib flib.f)\n" + "ADD_EXECUTABLE(ftest ftest.f)\n" + "TARGET_LINK_LIBRARIES(ftest flib)\n") + + # Create the Fortran source flib.f which defines two subroutines, "mysub" and "my_sub" + file(WRITE ${FortranTest_DIR}/flib.f + " SUBROUTINE mysub\n" + " RETURN\n" + " END\n" + " SUBROUTINE my_sub\n" + " RETURN\n" + " END\n") + + # Create the Fortran source ftest.f which calls "mysub" and "my_sub" + file(WRITE ${FortranTest_DIR}/ftest.f + " PROGRAM ftest\n" + " CALL mysub()\n" + " CALL my_sub()\n" + " END\n") + + # Use TRY_COMPILE to make the targets "flib" and "ftest" + try_compile(FTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} + ftest OUTPUT_VARIABLE MY_OUTPUT) + + # To ensure we do not use stuff from the previous attempts, + # we must remove the CMakeFiles directory. + file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) + + # Proceed based on test results + if(FTEST_OK) + + # Infer Fortran name-mangling scheme for symbols WITHOUT underscores. + # Overwrite CMakeLists.txt with one which will generate the "ctest1" executable + file(WRITE ${FortranTest_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ctest1 C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "ADD_EXECUTABLE(ctest1 ctest1.c)\n" + "FIND_LIBRARY(FLIB flib \"${FortranTest_DIR}\")\n" + "TARGET_LINK_LIBRARIES(ctest1 \${FLIB})\n") + + # Define the list "options" of all possible schemes that we want to consider + # Get its length and initialize the counter "iopt" to zero + set(options mysub mysub_ mysub__ MYSUB MYSUB_ MYSUB__) + list(LENGTH options imax) + set(iopt 0) + + # We will attempt to sucessfully generate the "ctest1" executable as long as + # there still are entries in the "options" list + while(${iopt} LESS ${imax}) + # Get the current list entry (current scheme) + list(GET options ${iopt} opt) + # Generate C source which calls the "mysub" function using the current scheme + file(WRITE ${FortranTest_DIR}/ctest1.c + "extern void ${opt}();\n" + "int main(void){${opt}();return(0);}\n") + # Use TRY_COMPILE to make the "ctest1" executable from the current C source + # and linking to the previously created "flib" library. + try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} + ctest1 OUTPUT_VARIABLE MY_OUTPUT) + # Write output compiling the test code + file(WRITE ${FortranTest_DIR}/ctest1_${opt}.out "${MY_OUTPUT}") + # To ensure we do not use stuff from the previous attempts, + # we must remove the CMakeFiles directory. + file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) + # Test if we successfully created the "ctest" executable. + # If yes, save the current scheme, and set the counter "iopt" to "imax" + # so that we exit the while loop. + # Otherwise, increment the counter "iopt" and go back in the while loop. + if(CTEST_OK) + set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES ${opt}) + set(iopt ${imax}) + else(CTEST_OK) + math(EXPR iopt ${iopt}+1) + endif() + endwhile(${iopt} LESS ${imax}) + + # Infer Fortran name-mangling scheme for symbols WITH underscores. + # Practically a duplicate of the previous steps. + file(WRITE ${FortranTest_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ctest2 C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "ADD_EXECUTABLE(ctest2 ctest2.c)\n" + "FIND_LIBRARY(FLIB flib \"${FortranTest_DIR}\")\n" + "TARGET_LINK_LIBRARIES(ctest2 \${FLIB})\n") + + set(options my_sub my_sub_ my_sub__ MY_SUB MY_SUB_ MY_SUB__) + list(LENGTH options imax) + set(iopt 0) + while(${iopt} LESS ${imax}) + list(GET options ${iopt} opt) + file(WRITE ${FortranTest_DIR}/ctest2.c + "extern void ${opt}();\n" + "int main(void){${opt}();return(0);}\n") + try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} + ctest2 OUTPUT_VARIABLE MY_OUTPUT) + file(WRITE ${FortranTest_DIR}/ctest2_${opt}.out "${MY_OUTPUT}") + file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) + if(CTEST_OK) + set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES ${opt}) + set(iopt ${imax}) + else(CTEST_OK) + math(EXPR iopt ${iopt}+1) + endif() + endwhile(${iopt} LESS ${imax}) + + # If a name-mangling scheme was found set the C preprocessor macros to use + # that scheme. Otherwise default to lower case with one underscore. + if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) + message(STATUS "Determining Fortran name-mangling scheme... OK") + else() + message(STATUS "Determining Fortran name-mangling scheme... DEFAULT") + set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES "mysub_") + set(CMAKE_Fortran_SCHEME_WITH_UNDERSCORES "my_sub_") + endif() + + # Symbols NO underscores + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") + endif() + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + endif() + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + endif() + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") + endif() + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + endif() + if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__") + set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + endif() + + # Symbols WITH underscores + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") + endif() + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub_") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + endif() + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub__") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") + endif() + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") + endif() + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB_") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + endif() + if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB__") + set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") + endif() + + # name-mangling scheme has been set + set(NEED_FORTRAN_NAME_MANGLING FALSE) + + configure_file( + ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h + ) + + else(FTEST_OK) + message(STATUS "Determining Fortran name-mangling scheme... FAILED") + endif() + +endif() + # If we have the LAPACK libraries, determine if they work. if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) # Create the LapackTest directory @@ -89,14 +314,15 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) # Create a C source file which calls a Blas function (dcopy) and an Lapack function (dgetrf) file(WRITE ${LapackTest_DIR}/ltest.c - "${F77_MANGLE_MACRO1}\n" - "#define dcopy_f77 SUNDIALS_F77_FUNC(dcopy, DCOPY)\n" - "#define dgetrf_f77 SUNDIALS_F77_FUNC(dgetrf, DGETRF)\n" + "${LAPACK_MANGLE_MACRO1}\n" + "#define dcopy_f77 SUNDIALS_LAPACK_FUNC(dcopy, DCOPY)\n" + "#define dgetrf_f77 SUNDIALS_LAPACK_FUNC(dgetrf, DGETRF)\n" "extern void dcopy_f77(int *n, const double *x, const int *inc_x, double *y, const int *inc_y);\n" "extern void dgetrf_f77(const int *m, const int *n, double *a, int *lda, int *ipiv, int *info);\n" "int main(void) {\n" "int n=1;\n" - "double x, y;\n" + "double x=1.0;\n" + "double y=1.0;\n" "dcopy_f77(&n, &x, &n, &y, &n);\n" "dgetrf_f77(&n, &n, &x, &n, &n, &n);\n" "return(0);\n" diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 7e301a294d..bf144299d1 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -324,6 +324,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index a234d2218d..9c18a04bca 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -294,6 +294,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 4ea759ff7c..6aed46fe5c 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -294,6 +294,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index c5ef6450dd..6a7cfea007 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -255,6 +255,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 9859a35a0c..ba0031cca2 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -269,6 +269,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 0a1be734a5..9ba90013e2 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -250,6 +250,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 interface. diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 04095bbd8d..bd2fcff513 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -1059,7 +1059,7 @@ illustration only. Default: None -.. cmakeoption:: SUNDIALS_F77_FUNC_CASE +.. cmakeoption:: SUNDIALS_LAPACK_CASE Specify the case to use in the Fortran name-mangling scheme, options are: ``lower`` or ``upper`` @@ -1072,9 +1072,9 @@ illustration only. using the Fortran compiler. This option should only be used if a Fortran compiler is not available or to override the inferred or default (``lower``) scheme if one can not be determined. If used, - ``SUNDIALS_F77_FUNC_UNDERSCORES`` must also be set. + ``SUNDIALS_LAPACK_UNDERSCORES`` must also be set. -.. cmakeoption:: SUNDIALS_F77_FUNC_UNDERSCORES +.. cmakeoption:: SUNDIALS_LAPACK_UNDERSCORES Specify the number of underscores to append in the Fortran name-mangling scheme, options are: ``none``, ``one``, or ``two`` @@ -1086,7 +1086,7 @@ illustration only. The build system will attempt to infer the Fortran name-mangling scheme using the Fortran compiler. This option should only be used if a Fortran compiler is not available or to override the inferred or default (``one``) - scheme if one can not be determined. If used, ``SUNDIALS_F77_FUNC_CASE`` + scheme if one can not be determined. If used, ``SUNDIALS_LAPACK_CASE`` must also be set. .. cmakeoption:: SUNDIALS_INDEX_TYPE diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index 1d55b02fea..72e03b6904 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -271,29 +271,6 @@ @SUNDIALS_CONFIGH_BUILDS@ - -/* ------------------------------------------------------------------ - * SUNDIALS fortran configuration - * -----------------------------------------------------------------*/ - - -/* Define Fortran name-mangling macro for C identifiers. - * Depending on the inferred scheme, one of the following six - * macros will be defined: - * #define SUNDIALS_F77_FUNC(name,NAME) name - * #define SUNDIALS_F77_FUNC(name,NAME) name ## _ - * #define SUNDIALS_F77_FUNC(name,NAME) name ## __ - * #define SUNDIALS_F77_FUNC(name,NAME) NAME - * #define SUNDIALS_F77_FUNC(name,NAME) NAME ## _ - * #define SUNDIALS_F77_FUNC(name,NAME) NAME ## __ - */ -@F77_MANGLE_MACRO1@ - -/* Define Fortran name-mangling macro for C identifiers - * which contain underscores. - */ -@F77_MANGLE_MACRO2@ - /* ------------------------------------------------------------------ * SUNDIALS __builtin_expect related macros. * These macros provide hints to the compiler that the condition diff --git a/src/sundials/sundials_lapack_defs.h b/src/sundials/sundials_lapack_defs.h.in similarity index 75% rename from src/sundials/sundials_lapack_defs.h rename to src/sundials/sundials_lapack_defs.h.in index 974b6b7066..1e6a0c01a7 100644 --- a/src/sundials/sundials_lapack_defs.h +++ b/src/sundials/sundials_lapack_defs.h.in @@ -21,23 +21,40 @@ extern "C" { #endif +/* Define LAPACK name-mangling macros. Depending on the inferred scheme, one of + * the following six macros will be defined: + * + * #define SUNDIALS_LAPACK_FUNC(name,NAME) name + * #define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _ + * #define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __ + * #define SUNDIALS_LAPACK_FUNC(name,NAME) NAME + * #define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _ + * #define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __ + */ +@LAPACK_MANGLE_MACRO1@ + +/* Define LAPACK name-mangling macro for C identifiers + * which contain underscores. + */ +@LAPACK_MANGLE_MACRO2@ + /* * ================================================================== * Blas and Lapack functions * ================================================================== */ -#if defined(SUNDIALS_F77_FUNC) +#if defined(SUNDIALS_LAPACK_FUNC) -#define dgbtrf_f77 SUNDIALS_F77_FUNC(dgbtrf, DGBTRF) -#define dgbtrs_f77 SUNDIALS_F77_FUNC(dgbtrs, DGBTRS) -#define dgetrf_f77 SUNDIALS_F77_FUNC(dgetrf, DGETRF) -#define dgetrs_f77 SUNDIALS_F77_FUNC(dgetrs, DGETRS) +#define dgbtrf_f77 SUNDIALS_LAPACK_FUNC(dgbtrf, DGBTRF) +#define dgbtrs_f77 SUNDIALS_LAPACK_FUNC(dgbtrs, DGBTRS) +#define dgetrf_f77 SUNDIALS_LAPACK_FUNC(dgetrf, DGETRF) +#define dgetrs_f77 SUNDIALS_LAPACK_FUNC(dgetrs, DGETRS) -#define sgbtrf_f77 SUNDIALS_F77_FUNC(sgbtrf, SGBTRF) -#define sgbtrs_f77 SUNDIALS_F77_FUNC(sgbtrs, SGBTRS) -#define sgetrf_f77 SUNDIALS_F77_FUNC(sgetrf, SGETRF) -#define sgetrs_f77 SUNDIALS_F77_FUNC(sgetrs, SGETRS) +#define sgbtrf_f77 SUNDIALS_LAPACK_FUNC(sgbtrf, SGBTRF) +#define sgbtrs_f77 SUNDIALS_LAPACK_FUNC(sgbtrs, SGBTRS) +#define sgetrf_f77 SUNDIALS_LAPACK_FUNC(sgetrf, SGETRF) +#define sgetrs_f77 SUNDIALS_LAPACK_FUNC(sgetrs, SGETRS) #else From 0f2d49d62be4af9f2770c90ad489dec4c2235202 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Wed, 28 Feb 2024 10:56:51 -0800 Subject: [PATCH 009/137] CMake: Change default build type to RelWithDebInfo (#422) Build with optimizations and debugging symbols by default --------- Co-authored-by: David Gardner --- CHANGELOG.md | 7 ++- CMakeLists.txt | 10 ++++ cmake/SundialsBuildOptionsPre.cmake | 7 --- doc/arkode/guide/source/Introduction.rst | 5 ++ doc/cvode/guide/source/Introduction.rst | 5 ++ doc/cvodes/guide/source/Introduction.rst | 5 ++ doc/ida/guide/source/Introduction.rst | 5 ++ doc/idas/guide/source/Introduction.rst | 5 ++ doc/kinsol/guide/source/Introduction.rst | 5 ++ doc/shared/sundials/Errors.rst | 29 +++++----- doc/shared/sundials/Install.rst | 18 +++--- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 5 +- examples/sunlinsol/test_sunlinsol.f90 | 32 +---------- include/sundials/priv/sundials_errors_impl.h | 57 +++++++++++++++++-- include/sundials/sundials_config.in | 44 -------------- test/config_cmake.py | 3 +- test/env/default.sh | 2 + 17 files changed, 133 insertions(+), 111 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4db76e0318..bd2eb33aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -165,7 +165,12 @@ Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregat Fixed integer overflow in the internal SUNDIALS hashmap. This resolves [#409](https://github.com/LLNL/sundials/issues/409) and -[#249](https://github.com/LLNL/sundials/issues/249) +[#249](https://github.com/LLNL/sundials/issues/249). + +The `CMAKE_BUILD_TYPE` defaults to `RelWithDebInfo` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from `SUNDIALS_F77_FUNC_CASE` and diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a0870e035..3a31694bf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,6 +144,16 @@ set(_SHARED_LIB_SUFFIX set(_SUNDIALS_ALIAS_TARGETS "" CACHE INTERNAL "" FORCE) +# We default to release builds +set(_DEFAULT_CMAKE_BUILD_TYPE RelWithDebInfo) +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified.") + set(CMAKE_BUILD_TYPE "${_DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +else() + message(STATUS "Building SUNDIALS in '${CMAKE_BUILD_TYPE}' mode.") +endif() + # =============================================================== # Build options to be processed first # =============================================================== diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b9c9d2e98d..56629de067 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -24,13 +24,6 @@ sundials_option(USE_XSDK_DEFAULTS BOOL "Enable default xSDK settings" OFF) if(USE_XSDK_DEFAULTS) message(STATUS "Enabling xSDK defaults:") - - # set the CMake build type, SUNDIALS does not set a build type by default - if(NOT CMAKE_BUILD_TYPE) - message(STATUS " Setting build type to Debug") - set(DOCSTR "Choose the type of build: None Debug Release RelWithDebInfo MinSizeRel") - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "${DOCSTR}" FORCE) - endif() endif() # --------------------------------------------------------------- diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index bf144299d1..3ef7d5ddc1 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -324,6 +324,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 9c18a04bca..d45714fbb7 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -294,6 +294,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 6aed46fe5c..dea01e0ee5 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -294,6 +294,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 6a7cfea007..3a5452a18b 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -255,6 +255,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index ba0031cca2..79aeefbcae 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -269,6 +269,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 9ba90013e2..9acc9c4644 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -250,6 +250,11 @@ Fixed integer overflow in the internal SUNDIALS hashmap. This resolves `GitHub Issues #409 `_ and `#249 `_. +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + The advanced CMake options to override the inferred LAPACK name-mangling scheme have been updated from ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and diff --git a/doc/shared/sundials/Errors.rst b/doc/shared/sundials/Errors.rst index 7473e9154a..3b5c6a8748 100644 --- a/doc/shared/sundials/Errors.rst +++ b/doc/shared/sundials/Errors.rst @@ -24,18 +24,18 @@ SUNDIALS core API (i.e., ``SUN`` or ``N_V`` functions only) either return a :c:t occurs) within the :c:type:`SUNContext` for the execution stream. This "last error" is accessible via the :c:func:`SUNContext_GetLastError` or :c:func:`SUNContext_PeekLastError` functions. -.. c:type:: int SUNErrCode +.. c:type:: int SUNErrCode Thus, in user code, SUNDIALS core API functions can be checked for errors in one of two ways: .. code-block:: C SUNContext sunctx; - SUNErrCode sunerr; + SUNErrCode sunerr; N_Vector v; int length; sunrealtype dotprod; - + // Every code that uses SUNDIALS must create a SUNContext. sunctx = SUNContext_Create(...); @@ -54,8 +54,8 @@ Thus, in user code, SUNDIALS core API functions can be checked for errors in one // Another function that does not return a SUNErrCode. dotprod = N_VDotProd(...); SUNContext_GetLastError(sunctx); - if (sunerr) { - /* an error occured, do something */ + if (sunerr) { + /* an error occured, do something */ } else { print("dotprod = %.2f\n", dotprod); } @@ -80,9 +80,9 @@ The function :c:func:`SUNGetErrMsg` can be used to get a message describing the .. warning:: - If a function returns a :c:type:`SUNErrCode` then the return value is the only place the error is available - i.e., these functions do not store their error code as the "last error" so it is invalid to use - :c:func:`SUNContext_GetLastError` to check these functions for errors. + If a function returns a :c:type:`SUNErrCode` then the return value is the only place the error is available + i.e., these functions do not store their error code as the "last error" so it is invalid to use + :c:func:`SUNContext_GetLastError` to check these functions for errors. .. _SUNDIALS.Errors.Handlers: @@ -90,8 +90,11 @@ The function :c:func:`SUNGetErrMsg` can be used to get a message describing the Error Handler Functions ----------------------- -Errors that occur internally to SUNDIALS result in an error handler function being called. -These error handler functions have the type +When an error occurs in SUNDIALS, it calls error handler functions that have +been pushed onto the error handler stack in last-in first-out order. +Specific error handlers can be enabled by pushing them onto the error handler stack +with the function :c:func:`SUNContext_PushErrHandler`. They may disabled by calling :c:func:`SUNContext_PopErrHandler` or :c:func:`SUNContext_ClearErrHandlers`. +A SUNDIALS error handler function has the type .. c:type:: int (*SUNErrHandlerFn)(int line, const char* func, const char* file, \ const char* msg, SUNErrCode err_code, \ @@ -113,7 +116,7 @@ The error handlers provided in SUNDIALS are: :param line: the line number at which the error occured :param func: the function in which the error occured - :param file: the file in which the error occured + :param file: the file in which the error occured :param msg: the message to log, if this is ``NULL`` then the default error message for the error code will be used :param err_code: the error code for the error that occured :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` @@ -129,7 +132,7 @@ The error handlers provided in SUNDIALS are: :param line: the line number at which the error occured :param func: the function in which the error occured - :param file: the file in which the error occured + :param file: the file in which the error occured :param msg: this parameter is ignored :param err_code: the error code for the error that occured :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` @@ -146,7 +149,7 @@ The error handlers provided in SUNDIALS are: :param line: the line number at which the error occured :param func: the function in which the error occured - :param file: the file in which the error occured + :param file: the file in which the error occured :param msg: this parameter is ignored :param err_code: the error code for the error that occured :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index bd2fcff513..6843e2c376 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -27,8 +27,8 @@ source. One option is to use the `Spack HPC package manager ` The second supported option for building and installing SUNDIALS is with CMake. Before proceeding with CMake, the source code must be downloaded. This can be done by cloning the `SUNDIALS GitHub repository `_ -(run ``git clone https://github.com/LLNL/sundials``), or by downloading the -SUNDIALS release compressed archives (``.tar.gz``) from the SUNDIALS +(run ``git clone https://github.com/LLNL/sundials``), or by downloading the +SUNDIALS release compressed archives (``.tar.gz``) from the SUNDIALS `website `_. The compressed archives allow for downloading of indvidual SUNDIALS packages. @@ -36,7 +36,7 @@ The name of the distribution archive is of the form ``SOLVER-X.Y.Z.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, ``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``X.Y.Z`` represents the version number (of the SUNDIALS suite or of the individual -solver). After downloading the relevant archives, uncompress and expand the sources, +solver). After downloading the relevant archives, uncompress and expand the sources, by running .. code-block:: bash @@ -353,9 +353,9 @@ illustration only. .. cmakeoption:: CMAKE_BUILD_TYPE Choose the type of build, options are: - ``None``, ``Debug``, ``Release``, ``RelWithDebInfo``, and ``MinSizeRel`` + ``Debug``, ``Release``, ``RelWithDebInfo``, and ``MinSizeRel`` - Default: + Default: ``RelWithDebInfo`` .. note:: @@ -630,8 +630,8 @@ illustration only. .. cmakeoption:: SUNDIALS_ENABLE_ERROR_CHECKS - Build SUNDIALS with more extensive checks for unrecoverable errors. - + Build SUNDIALS with more extensive checks for unrecoverable errors. + Default: ``OFF`` when ``CMAKE_BUILD_TYPE=Release|RelWithDebInfo `` and ``ON`` otherwise. .. warning:: @@ -1048,7 +1048,7 @@ illustration only. Default: None .. cmakeoption:: ENABLE_ADIAK - + Enable Adiak support Default: OFF @@ -1675,7 +1675,7 @@ header files. SUNDIALS installs some header files to ``INSTDIR/include/sundials/priv``. All of the header files in this directory are private and **should not be included in user code**. The private headers are subject to change - without any notice and relying on them may break your code. + without any notice and relying on them may break your code. Using SUNDIALS in your prpject diff --git a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 index 8ebe3a1841..8f47e8a72b 100644 --- a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 @@ -195,7 +195,8 @@ program main type(c_ptr) :: cvodes_mem type(N_Vector), pointer :: u, uiS type(c_ptr) :: uS - type(SUNNonlinearSolver), pointer :: NLS, NLSsens + type(SUNNonlinearSolver), pointer :: NLS + type(SUNNonlinearSolver), pointer :: NLSsens => null() integer(c_int) :: iout, retval real(c_double) :: reltol, abstol, tout, t(1) integer(c_int) :: is @@ -381,7 +382,7 @@ program main call FCVodeFree(cvodes_mem) retval = FSUNNonlinSolFree(NLS) - if (sensi /= 0) then + if (associated(NLSsens)) then retval = FSUNNonlinSolFree(NLSsens) endif diff --git a/examples/sunlinsol/test_sunlinsol.f90 b/examples/sunlinsol/test_sunlinsol.f90 index 8b21d09c6a..ffdb50250c 100644 --- a/examples/sunlinsol/test_sunlinsol.f90 +++ b/examples/sunlinsol/test_sunlinsol.f90 @@ -21,9 +21,6 @@ module test_sunlinsol use, intrinsic :: iso_c_binding - - - use test_utilities implicit none @@ -35,20 +32,19 @@ module test_sunlinsol integer(C_INT) function Test_FSUNLinSolGetType(S, mysunid, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S integer(SUNLinearSolver_Type) :: mysunid, sunid integer(C_INT) :: myid + failure = 0 + sunid = FSUNLinSolGetType(S) if (sunid /= mysunid) then failure = 1 write(*,*) ">>> FAILED test -- FSUNLinSolGetType, Proc", myid else if (myid == 0) then - failure = 0 write(*,*) " PASSED test -- FSUNLinSolGetType" end if end function Test_FSUNLinSolGetType @@ -56,8 +52,6 @@ end function Test_FSUNLinSolGetType integer(C_INT) function Test_FSUNLinSolLastFlag(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -77,8 +71,6 @@ end function Test_FSUNLinSolLastFlag integer(C_INT) function Test_FSUNLinSolSpace(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -101,8 +93,6 @@ end function Test_FSUNLinSolSpace integer(C_INT) function Test_FSUNLinSolNumIters(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -123,8 +113,6 @@ end function Test_FSUNLinSolNumIters integer(C_INT) function Test_FSUNLinSolResNorm(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -172,8 +160,6 @@ end function Test_FSUNLinSolResid integer(C_INT) function Test_FSUNLinSolSetATimes(S, ATdata, ATimes, myid) & result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -200,8 +186,6 @@ end function Test_FSUNLinSolSetATimes integer(C_INT) function Test_FSUNLinSolSetPreconditioner(S, Pdata, PSetup, PSolve, myid) & result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S @@ -226,9 +210,6 @@ end function Test_FSUNLinSolSetPreconditioner integer(C_INT) function Test_FSUNLinSolSetScalingVectors(S, s1, s2, myid) & result(failure) use, intrinsic :: iso_c_binding - - - implicit none type(SUNLinearSolver) :: S @@ -253,8 +234,6 @@ end function Test_FSUNLinSolSetScalingVectors integer(C_INT) function Test_FSUNLinSolInitialize(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver) :: S @@ -276,9 +255,6 @@ end function Test_FSUNLinSolInitialize integer(C_INT) function Test_FSUNLinSolSetup(S, A, myid) result(failure) use, intrinsic :: iso_c_binding - - - implicit none type(SUNLinearSolver) :: S @@ -309,10 +285,6 @@ end function Test_FSUNLinSolSetup ! ---------------------------------------------------------------------- integer(C_INT) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failure) use, intrinsic :: iso_c_binding - - - - implicit none type(SUNLinearSolver) :: S diff --git a/include/sundials/priv/sundials_errors_impl.h b/include/sundials/priv/sundials_errors_impl.h index 7e83cc62b4..115b5eefd9 100644 --- a/include/sundials/priv/sundials_errors_impl.h +++ b/include/sundials/priv/sundials_errors_impl.h @@ -22,6 +22,7 @@ #include +#include "sundials/sundials_config.h" #include "sundials/sundials_context.h" #include "sundials/sundials_export.h" #include "sundials/sundials_logger.h" @@ -31,6 +32,54 @@ extern "C" { #endif +/* ---------------------------------------------------------------------------- + * Macros used in error handling + * ---------------------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + * SUNDIALS __builtin_expect related macros. + * These macros provide hints to the compiler that the condition + * is typically false (or true) which may allow the compiler to + * optimize. + * -----------------------------------------------------------------*/ + +/* Hint to the compiler that the branch is unlikely to be taken */ +#ifdef SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT +#define SUNHintFalse(cond) __builtin_expect((cond), 0) +#else +#define SUNHintFalse(cond) (cond) +#endif + +/* Hint to the compiler that the branch is likely to be taken */ +#ifdef SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT +#define SUNHintTrue(cond) __builtin_expect((cond), 1) +#else +#define SUNHintTrue(cond) (cond) +#endif + +/* ------------------------------------------------------------------ + * SUNAssume + * + * This macro tells the compiler that the condition should be assumed + * to be true. The consequence is that what happens if the assumption + * is violated is undefined. If there is not compiler support for + * assumptions, then we dont do anything as there is no reliable + * way to avoid the condition being executed in all cases (such as + * the condition being an opaque function call, which we have a lot of). + * -----------------------------------------------------------------*/ + +#if __cplusplus >= 202302L +#define SUNAssume(...) [[assume(__VA_ARGS__)]] +#elif defined(SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) +#define SUNAssume(...) __attribute__((assume(__VA_ARGS__))) +#elif defined(SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) +#define SUNAssume(...) __builtin_assume(__VA_ARGS__) +#elif defined(SUNDIALS_C_COMPILER_HAS_ASSUME) +#define SUNAssume(...) __assume(__VA_ARGS__) +#else +#define SUNAssume(...) +#endif + /* ---------------------------------------------------------------------------- * SUNErrHandler_ definition. * ---------------------------------------------------------------------------*/ @@ -455,7 +504,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, #if defined(SUNDIALS_ENABLE_ERROR_CHECKS) #define SUNAssert(expr, code) SUNCheck(expr, code) #else -#define SUNAssert(expr, code) SUNAssume(expr) +#define SUNAssert(expr, code) #endif /* @@ -470,7 +519,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, #if defined(SUNDIALS_ENABLE_ERROR_CHECKS) #define SUNAssertNoRet(expr, code) SUNCheckNoRet(expr, code) #else -#define SUNAssertNoRet(expr, code) SUNAssume(expr) +#define SUNAssertNoRet(expr, code) #endif /* @@ -484,7 +533,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, #if defined(SUNDIALS_ENABLE_ERROR_CHECKS) #define SUNAssertNull(expr, code) SUNCheckNull(expr, code) #else -#define SUNAssertNull(expr, code) SUNAssume(expr) +#define SUNAssertNull(expr, code) #endif /* @@ -498,7 +547,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, #if defined(SUNDIALS_ENABLE_ERROR_CHECKS) #define SUNAssertVoid(expr, code) SUNCheckVoid(expr, code) #else -#define SUNAssertVoid(expr, code) SUNAssume(expr) +#define SUNAssertVoid(expr, code) #endif #ifdef __cplusplus diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index 72e03b6904..b56ae8fa86 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -271,48 +271,4 @@ @SUNDIALS_CONFIGH_BUILDS@ -/* ------------------------------------------------------------------ - * SUNDIALS __builtin_expect related macros. - * These macros provide hints to the compiler that the condition - * is typically false (or true) which may allow the compiler to - * optimize. - * -----------------------------------------------------------------*/ - -/* Hint to the compiler that the branch is unlikely to be taken */ -#ifdef SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT -#define SUNHintFalse(cond) __builtin_expect((cond), 0) -#else -#define SUNHintFalse(cond) (cond) -#endif - -/* Hint to the compiler that the branch is likely to be taken */ -#ifdef SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT -#define SUNHintTrue(cond) __builtin_expect((cond), 1) -#else -#define SUNHintTrue(cond) (cond) -#endif - -/* ------------------------------------------------------------------ - * SUNAssume - * - * This macro tells the compiler that the condition should be assumed - * to be true. The consequence is that what happens if the assumption - * is violated is undefined. If there is not compiler support for - * assumptions, then we dont do anything as there is no reliable - * way to avoid the condition being executed in all cases (such as - * the condition being an opaque function call, which we have a lot of). - * -----------------------------------------------------------------*/ - -#if __cplusplus >= 202302L -#define SUNAssume(...) [[assume(__VA_ARGS__)]] -#elif defined(SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) -#define SUNAssume(...) __attribute__((assume(__VA_ARGS__))) -#elif defined(SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) -#define SUNAssume(...) __builtin_assume(__VA_ARGS__) -#elif defined(SUNDIALS_C_COMPILER_HAS_ASSUME) -#define SUNAssume(...) __assume(__VA_ARGS__) -#else -#define SUNAssume(...) -#endif - #endif /* _SUNDIALS_CONFIG_H */ diff --git a/test/config_cmake.py b/test/config_cmake.py index 90cc2aed38..e916d1bcc0 100644 --- a/test/config_cmake.py +++ b/test/config_cmake.py @@ -50,7 +50,8 @@ def main(): Fortran, and CUDA compiler and flags.''') # Build type - add_arg(group, '--build-type', 'CMAKE_BUILD_TYPE', 'CMAKE_BUILD_TYPE', 'Debug', 'STRING', + add_arg(group, '--build-type', 'CMAKE_BUILD_TYPE', 'CMAKE_BUILD_TYPE', + 'RelWithDebInfo', 'STRING', 'CMake build type (Debug, RelWithDebInfo, Release)') # C compiler diff --git a/test/env/default.sh b/test/env/default.sh index e5fe0070fd..fb6ed34802 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -174,6 +174,8 @@ fi # Verbose build export CMAKE_VERBOSE_MAKEFILE=OFF +export CMAKE_BUILD_TYPE=Debug + # Number of build and test jobs export SUNDIALS_BUILD_JOBS=6 export SUNDIALS_TEST_JOBS=1 From 6f7f5911fc308971e2af71284cdfe0abd9b41350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 28 Feb 2024 23:01:20 +0100 Subject: [PATCH 010/137] CMake: Import installed CMake target for KLU from SuiteSparse (#407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer versions of SuiteSparse install import targets for its libraries. Use the import target of KLU as installed by SuiteSparse if it is available and the user didn't set flags to select a different one. This fixes an issue if the SuiteSparse headers are installed at their new default location `$prefix/include/suitesparse`. --------- Signed-off-by: Markus Mützel Co-authored-by: Daniel R. Reynolds Co-authored-by: Cody Balos Co-authored-by: David Gardner --- cmake/SUNDIALSConfig.cmake.in | 10 +++++++--- cmake/tpl/FindKLU.cmake | 15 +++++++++++++++ doc/shared/sundials/Install.rst | 15 +++++++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/cmake/SUNDIALSConfig.cmake.in b/cmake/SUNDIALSConfig.cmake.in index 58bbe448e5..9cbe9e6c23 100644 --- a/cmake/SUNDIALSConfig.cmake.in +++ b/cmake/SUNDIALSConfig.cmake.in @@ -91,9 +91,13 @@ if("@ENABLE_HYPRE@" AND NOT TARGET SUNDIALS::HYPRE) endif() if("@ENABLE_KLU@" AND NOT TARGET SUNDIALS::KLU) - add_library(SUNDIALS::KLU INTERFACE IMPORTED) - target_link_libraries(SUNDIALS::KLU INTERFACE "@KLU_LIBRARIES@") - set_target_properties(SUNDIALS::KLU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@KLU_INCLUDE_DIR@") + if("@KLU_SUITESPARSE_TARGET@") + find_dependency(KLU) + else() + add_library(SUNDIALS::KLU INTERFACE IMPORTED) + target_link_libraries(SUNDIALS::KLU INTERFACE "@KLU_LIBRARIES@") + set_target_properties(SUNDIALS::KLU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@KLU_INCLUDE_DIR@") + endif() endif() if("@ENABLE_KOKKOS@" AND NOT TARGET Kokkos::kokkos) diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index cad926d4b8..96b9d7343b 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -30,6 +30,21 @@ # KLU_LIBRARIES - all of the libraries needed for KLU # --------------------------------------------------------------- +if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) + # Prefer the import target from upstream SuiteSparse if it is available + # and the user didn't point to a specific (different) version. + find_package(KLU CONFIG) + + if(TARGET SuiteSparse::KLU) + if(NOT TARGET SUNDIALS::KLU) + add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU) + set(KLU_SUITESPARSE_TARGET ON) + mark_as_advanced(KLU_SUITESPARSE_TARGET) + endif() + return() + endif() +endif() + # Set library prefixes for Windows if(WIN32) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 6843e2c376..aad89e575d 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -1336,11 +1336,22 @@ Texas A&M University and is available from the `SuiteSparse GitHub repository To enable KLU, set ``ENABLE_KLU`` to ``ON``, set ``KLU_INCLUDE_DIR`` to the ``include`` path of the KLU installation and set ``KLU_LIBRARY_DIR`` -to the ``lib`` path of the KLU installation. The CMake configure will -result in populating the following variables: ``AMD_LIBRARY``, +to the ``lib`` path of the KLU installation. In that case, the CMake configure +will result in populating the following variables: ``AMD_LIBRARY``, ``AMD_LIBRARY_DIR``, ``BTF_LIBRARY``, ``BTF_LIBRARY_DIR``, ``COLAMD_LIBRARY``, ``COLAMD_LIBRARY_DIR``, and ``KLU_LIBRARY``. +For SuiteSparse 7.4.0 and newer, the necessary information can also be gathered +from a CMake import target. If SuiteSparse is installed in a non-default +prefix, the path to the CMake Config file can be set using +``CMAKE_PREFIX_PATH``. In that case, the CMake configure step won't populate +the previously mentioned variables. It is still possible to set +``KLU_INCLUDE_DIR`` and ``KLU_LIBRARY_DIR`` which take precedence over a +potentially installed CMake import target file. + +In either case, a CMake target ``SUNDIALS::KLU`` will be created if the KLU +library could be found. Dependent targets should link to that target. + SUNDIALS has been tested with SuiteSparse version 5.10.1. From 2abd63bd6cbc354fb4861bba8e98d0b95d65e24a Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Thu, 29 Feb 2024 12:05:19 -0800 Subject: [PATCH 011/137] Release/v7.0.0 (#431) SUNDIALS release v7.0.0 --- CHANGELOG.md | 6 ++---- CITATIONS.md | 12 +++++------ CMakeLists.txt | 24 +++++++++++----------- README.md | 2 +- 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 ++-- doc/shared/History.rst | 2 +- doc/shared/sundials.bib | 24 +++++++++++----------- doc/shared/versions.py | 14 ++++++------- doc/sundials/biblio.bib | 24 +++++++++++----------- doc/sundials/ug.tex | 14 ++++++------- scripts/tarscript | 14 ++++++------- scripts/updateVersion.sh | 26 ++++++++++++------------ src/arkode/README.md | 10 ++++----- src/cvode/README.md | 10 ++++----- src/cvodes/README.md | 10 ++++----- src/ida/README.md | 10 ++++----- src/idas/README.md | 10 ++++----- src/kinsol/README.md | 10 ++++----- 23 files changed, 122 insertions(+), 124 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2eb33aac..0f955cff01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,6 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release 7.0.0-rc.1 - -⚠️ This is a release candidate. +## Changes to SUNDIALS in release v7.0.0 ### Major Feature @@ -97,7 +95,7 @@ and a typedef to a `MPI_Comm` in builds with MPI. As a result: `SUNLogger_Create` or `SUNProfiler_Create`. - Some users will need to update their calls to `N_VGetCommunicator`, and - update any custom `N_Vector` implementations tht provide + update any custom `N_Vector` implementations that provide `N_VGetCommunicator`, since it now returns a `SUNComm`. The change away from type-erased pointers for `SUNComm` fixes problems like the diff --git a/CITATIONS.md b/CITATIONS.md index fbd2483ef3..bdbe0f33e1 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -69,7 +69,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Cody J. Balos}, title = {User Documentation for ARKODE}, year = {2024}, - note = {v6.0.0-rc.1} + note = {v6.0.0} } ``` @@ -78,7 +78,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODE}, year = {2024}, - note = {v7.0.0-rc.1} + note = {v7.0.0} } ``` @@ -87,7 +87,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODES}, year = {2024}, - note = {v7.0.0-rc.1} + note = {v7.0.0} } ``` @@ -96,7 +96,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDA}, year = {2024}, - note = {v7.0.0-rc.1} + note = {v7.0.0} } ``` @@ -105,7 +105,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDAS}, year = {2024}, - note = {v6.0.0-rc.1} + note = {v6.0.0} } ``` @@ -114,6 +114,6 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for KINSOL}, year = {2024}, - note = {v7.0.0-rc.1} + note = {v7.0.0} } ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a31694bf7..dc07466ff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ include(FindPackageHandleStandardArgs) # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") -set(PACKAGE_STRING "SUNDIALS 7.0.0-rc.1") +set(PACKAGE_STRING "SUNDIALS 7.0.0") set(PACKAGE_TARNAME "sundials") # Set SUNDIALS version numbers @@ -59,7 +59,7 @@ message(STATUS "SUNDIALS_GIT_VERSION: ${SUNDIALS_GIT_VERSION}") set(PACKAGE_VERSION_MAJOR "7") set(PACKAGE_VERSION_MINOR "0") set(PACKAGE_VERSION_PATCH "0") -set(PACKAGE_VERSION_LABEL "rc.1") +set(PACKAGE_VERSION_LABEL "") if(PACKAGE_VERSION_LABEL) set(PACKAGE_VERSION @@ -73,37 +73,37 @@ endif() # Specify the VERSION and SOVERSION for shared libraries -set(arkodelib_VERSION "6.0.0-rc.1") +set(arkodelib_VERSION "6.0.0") set(arkodelib_SOVERSION "6") -set(cvodelib_VERSION "7.0.0-rc.1") +set(cvodelib_VERSION "7.0.0") set(cvodelib_SOVERSION "7") -set(cvodeslib_VERSION "7.0.0-rc.1") +set(cvodeslib_VERSION "7.0.0") set(cvodeslib_SOVERSION "7") -set(idalib_VERSION "7.0.0-rc.1") +set(idalib_VERSION "7.0.0") set(idalib_SOVERSION "7") -set(idaslib_VERSION "6.0.0-rc.1") +set(idaslib_VERSION "6.0.0") set(idaslib_SOVERSION "6") -set(kinsollib_VERSION "7.0.0-rc.1") +set(kinsollib_VERSION "7.0.0") set(kinsollib_SOVERSION "7") set(cpodeslib_VERSION "0.0.0") set(cpodeslib_SOVERSION "0") -set(nveclib_VERSION "7.0.0-rc.1") +set(nveclib_VERSION "7.0.0") set(nveclib_SOVERSION "7") -set(sunmatrixlib_VERSION "5.0.0-rc.1") +set(sunmatrixlib_VERSION "5.0.0") set(sunmatrixlib_SOVERSION "5") -set(sunlinsollib_VERSION "5.0.0-rc.1") +set(sunlinsollib_VERSION "5.0.0") set(sunlinsollib_SOVERSION "5") -set(sunnonlinsollib_VERSION "4.0.0-rc.1") +set(sunnonlinsollib_VERSION "4.0.0") set(sunnonlinsollib_SOVERSION "4") set(sundialslib_VERSION diff --git a/README.md b/README.md index 583315eac0..d143fbbc69 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic equation Solvers # -### Version 7.0.0-rc.1 (Jan 2024) ### +### Version 7.0.0 (Feb 2024) ### **Center for Applied Scientific Computing, Lawrence Livermore National Laboratory** diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 3ef7d5ddc1..691bdae1fa 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -130,7 +130,7 @@ provided with SUNDIALS, or again may utilize a user-supplied module. Changes from previous versions ============================== -Changes in v6.0.0-rc.1 +Changes in v6.0.0 ---------------------- **Major Features** @@ -252,7 +252,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index d45714fbb7..7cb0942de1 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -111,7 +111,7 @@ implementations. Changes from previous versions ============================== -Changes in v7.0.0-rc.1 +Changes in v7.0.0 ---------------------- **Major Features** @@ -223,7 +223,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index dea01e0ee5..7691faa06b 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -111,7 +111,7 @@ Fortran. Changes from previous versions ============================== -Changes in v7.0.0-rc.1 +Changes in v7.0.0 ---------------------- **Major Features** @@ -223,7 +223,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 3a5452a18b..789dc13cfa 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -72,7 +72,7 @@ systems. Changes from previous versions ============================== -Changes in v7.0.0-rc.1 +Changes in v7.0.0 ---------------------- **Major Features** @@ -184,7 +184,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 79aeefbcae..eea9c17f32 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -86,7 +86,7 @@ integrate any final-condition ODE dependent on the solution of the original IVP Changes from previous versions ============================== -Changes in v6.0.0-rc.1 +Changes in v6.0.0 ---------------------- **Major Features** @@ -198,7 +198,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 9acc9c4644..36878b4a32 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -88,7 +88,7 @@ applications written in Fortran. Changes from previous versions ============================== -Changes in v7.0.0-rc.1 +Changes in v7.0.0 ---------------------- **Major Features** @@ -200,7 +200,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations tht provide + update any custom ``N_Vector`` implementations that provide ``N_VGetCommunicator``, since it now returns a ``SUNComm``. The change away from type-erased pointers for :c:type:`SUNComm` fixes problems diff --git a/doc/shared/History.rst b/doc/shared/History.rst index 44fe42dc6b..cfdee0c931 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -21,7 +21,7 @@ Release History +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Date | SUNDIALS | ARKODE | CVODE | CVODES | IDA | IDAS | KINSOL | +==========+===================+===================+===================+===================+===================+===================+===================+ -| Jan 2024 | 7.0.0-rc.1 | 6.0.0-rc.1 | 7.0.0-rc.1 | 7.0.0-rc.1 | 7.0.0-rc.1 | 6.0.0-rc.1 | 7.0.0-rc.1 | +| Feb 2024 | 7.0.0 | 6.0.0 | 7.0.0 | 7.0.0 | 7.0.0 | 6.0.0 | 7.0.0 | +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Dec 2023 | 6.7.0 | 5.7.0 | 6.7.0 | 6.7.0 | 6.7.0 | 5.7.0 | 6.7.0 | +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index f34bfee014..3516b83111 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -27,7 +27,7 @@ % @techreport{arkode_ug, author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Rujeko Chinomona and Cody J. Balos}, -title = {{User Documentation for ARKODE v6.0.0-rc.1}}, +title = {{User Documentation for ARKODE v6.0.0}}, institution = {LLNL}, number = {LLNL-SM-668082}, year = 2024 @@ -37,7 +37,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author = {Daniel R. Reynolds}, -title = {{Example Programs for ARKODE v6.0.0-rc.1}}, +title = {{Example Programs for ARKODE v6.0.0}}, institution = {Southern Methodist University}, year = 2024 } @@ -46,7 +46,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODE v7.0.0-rc.1}}, +title = {{User Documentation for CVODE v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208108}, year = 2024 @@ -56,7 +56,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author = {Alan C. Hindmarsh and Radu Serban}, -title = {{Example Programs for CVODE v7.0.0-rc.1}}, +title = {{Example Programs for CVODE v7.0.0}}, institution = {LLNL}, note = {UCRL-SM-208110}, year = 2024 @@ -66,7 +66,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODES v7.0.0-rc.1}}, +title = {{User Documentation for CVODES v7.0.0}}, institution = {LLNL}, note = {UCRL-SM-208111}, year = 2024 @@ -76,7 +76,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for CVODES v7.0.0-rc.1}}, +title = {{Example Programs for CVODES v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208115}, year = 2024 @@ -86,7 +86,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDA v7.0.0-rc.1}}, +title = {{User Documentation for IDA v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208112}, year = 2024 @@ -96,7 +96,7 @@ @techreport{ida_ug % @techreport{ida_ex, author = {Alan C. Hindmarsh and Radu Serban and Aaron Collier}, -title = {{Example Programs for IDA v7.0.0-rc.1}}, +title = {{Example Programs for IDA v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208113}, year = 2024 @@ -106,7 +106,7 @@ @techreport{ida_ex % @techreport{idas_ug, author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDAS v6.0.0-rc.1}}, +title = {{User Documentation for IDAS v6.0.0}}, institution = {LLNL}, number = {UCRL-SM-234051}, year = 2024 @@ -116,7 +116,7 @@ @techreport{idas_ug % @techreport{idas_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for IDAS v6.0.0-rc.1}}, +title = {{Example Programs for IDAS v6.0.0}}, institution = {LLNL}, number = {LLNL-TR-437091}, year = 2024 @@ -126,7 +126,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for KINSOL v7.0.0-rc.1}}, +title = {{User Documentation for KINSOL v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208116}, year = 2024 @@ -136,7 +136,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author = {Aaron M. Collier and Radu Serban}, -title = {{Example Programs for KINSOL v7.0.0-rc.1}}, +title = {{Example Programs for KINSOL v7.0.0}}, institution = {LLNL}, number = {UCRL-SM-208114}, year = 2024 diff --git a/doc/shared/versions.py b/doc/shared/versions.py index f6275383ce..9870094c67 100644 --- a/doc/shared/versions.py +++ b/doc/shared/versions.py @@ -9,11 +9,11 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -sundials_version = 'v7.0.0-rc.1' -arkode_version = 'v6.0.0-rc.1' -cvode_version = 'v7.0.0-rc.1' -cvodes_version = 'v7.0.0-rc.1' -ida_version = 'v7.0.0-rc.1' -idas_version = 'v6.0.0-rc.1' -kinsol_version = 'v7.0.0-rc.1' +sundials_version = 'v7.0.0' +arkode_version = 'v6.0.0' +cvode_version = 'v7.0.0' +cvodes_version = 'v7.0.0' +ida_version = 'v7.0.0' +idas_version = 'v6.0.0' +kinsol_version = 'v7.0.0' year = '2024' diff --git a/doc/sundials/biblio.bib b/doc/sundials/biblio.bib index 9ce46ce593..ad0b7f6bec 100644 --- a/doc/sundials/biblio.bib +++ b/doc/sundials/biblio.bib @@ -16,7 +16,7 @@ @techreport{arkode_ug, author={Daniel R. Reynolds and David J. Gardner and Alan C. Hindmarsh and Carol S. Woodward and Jean M. Sexton}, -title={{User Documentation for ARKODE v6.0.0-rc.1}}, +title={{User Documentation for ARKODE v6.0.0}}, institution={LLNL}, number={LLNL-SM-668082}, year = 2024 @@ -26,7 +26,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author={Daniel R. Reynolds}, -title={{Example Programs for ARKODE v6.0.0-rc.1}}, +title={{Example Programs for ARKODE v6.0.0}}, institution={Southern Methodist University}, year = 2024 } @@ -35,7 +35,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODE v7.0.0-rc.1}}, +title={{User Documentation for CVODE v7.0.0}}, institution={LLNL}, number={UCRL-SM-208108}, year = 2024 @@ -45,7 +45,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author={A. C. Hindmarsh and R. Serban and D. R. Reynolds}, -title={{Example Programs for CVODE v7.0.0-rc.1}}, +title={{Example Programs for CVODE v7.0.0}}, institution={LLNL}, note={UCRL-SM-208110}, year = 2024 @@ -55,7 +55,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODES v7.0.0-rc.1}}, +title={{User Documentation for CVODES v7.0.0}}, institution={LLNL}, note={UCRL-SM-208111}, year = 2024 @@ -65,7 +65,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for CVODES v7.0.0-rc.1}}, +title={{Example Programs for CVODES v7.0.0}}, institution={LLNL}, number={UCRL-SM-208115}, year = 2024 @@ -75,7 +75,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{User Documentation for IDA v7.0.0-rc.1}}, +title={{User Documentation for IDA v7.0.0}}, institution={LLNL}, number={UCRL-SM-208112}, year = 2024 @@ -85,7 +85,7 @@ @techreport{ida_ug % @techreport{ida_ex, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{Example Programs for IDA v7.0.0-rc.1}}, +title={{Example Programs for IDA v7.0.0}}, institution={LLNL}, number={UCRL-SM-208113}, year = 2024 @@ -95,7 +95,7 @@ @techreport{ida_ex % @techreport{idas_ug, author={R. Serban and C. Petra and A. C. Hindmarsh}, -title={{User Documentation for IDAS v6.0.0-rc.1}}, +title={{User Documentation for IDAS v6.0.0}}, institution={LLNL}, number={UCRL-SM-234051}, year = 2024 @@ -105,7 +105,7 @@ @techreport{idas_ug % @techreport{idas_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for IDAS v6.0.0-rc.1}}, +title={{Example Programs for IDAS v6.0.0}}, institution={LLNL}, number={LLNL-TR-437091}, year = 2024 @@ -115,7 +115,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author={A. M. Collier and A. C. Hindmarsh and R. Serban and C.S. Woodward}, -title={{User Documentation for KINSOL v7.0.0-rc.1}}, +title={{User Documentation for KINSOL v7.0.0}}, institution={LLNL}, number={UCRL-SM-208116}, year = 2024 @@ -125,7 +125,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author={A. M. Collier and R. Serban}, -title={{Example Programs for KINSOL v7.0.0-rc.1}}, +title={{Example Programs for KINSOL v7.0.0}}, institution={LLNL}, number={UCRL-SM-208114}, year = 2024 diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index 033d1df46c..26724bb6ab 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -59,29 +59,29 @@ %----- VERSIONS AND UCRL NUMBERS OF SUNDIALS CODES -\newcommand{\sunrelease}{v7.0.0-rc.1} +\newcommand{\sunrelease}{v7.0.0} -\newcommand{\cvrelease}{v7.0.0-rc.1} +\newcommand{\cvrelease}{v7.0.0} \newcommand{\cvucrlug}{UCRL-SM-208108} \newcommand{\cvucrlex}{UCRL-SM-208110} -\newcommand{\cvsrelease}{v7.0.0-rc.1} +\newcommand{\cvsrelease}{v7.0.0} \newcommand{\cvsucrlug}{UCRL-SM-208111} \newcommand{\cvsucrlex}{UCRL-SM-208115} -\newcommand{\idarelease}{v7.0.0-rc.1} +\newcommand{\idarelease}{v7.0.0} \newcommand{\idaucrlug}{UCRL-SM-208112} \newcommand{\idaucrlex}{UCRL-SM-208113} -\newcommand{\idasrelease}{v6.0.0-rc.1} +\newcommand{\idasrelease}{v6.0.0} \newcommand{\idasucrlug}{UCRL-SM-234051} \newcommand{\idasucrlex}{LLNL-TR-437091} -\newcommand{\kinrelease}{v7.0.0-rc.1} +\newcommand{\kinrelease}{v7.0.0} \newcommand{\kinucrlug}{UCRL-SM-208116} \newcommand{\kinucrlex}{UCRL-SM-208114} -\newcommand{\arkrelease}{v6.0.0-rc.1} +\newcommand{\arkrelease}{v6.0.0} \newcommand{\arkucrlug}{LLNL-SM-668082} \newcommand{\arkucrlex}{????-??-??????} diff --git a/scripts/tarscript b/scripts/tarscript index 21f2b9ef7f..2e80dd084f 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -57,13 +57,13 @@ function print_usage # VERSION NUMBERS #--------------------------------------------------------- -SUN_VER="7.0.0-rc.1" -CV_VER="7.0.0-rc.1" -CVS_VER="7.0.0-rc.1" -IDA_VER="7.0.0-rc.1" -IDAS_VER="6.0.0-rc.1" -KIN_VER="7.0.0-rc.1" -ARK_VER="6.0.0-rc.1" +SUN_VER="7.0.0" +CV_VER="7.0.0" +CVS_VER="7.0.0" +IDA_VER="7.0.0" +IDAS_VER="6.0.0" +KIN_VER="7.0.0" +ARK_VER="6.0.0" #--------------------------------------------------------- # Test if the script is executed from within its directory diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index 2ef8856dfd..fa3958b75b 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -21,7 +21,7 @@ sun_major=${1:-7} sun_minor=${2:-0} sun_patch=${3:-0} -sun_label=${4:-"rc.1"} +sun_label=${4:-""} month=${5:-$(date +"%b")} year=${6:-$(date +"%Y")} @@ -352,18 +352,18 @@ sedi '23 a\ # Update CITATIONS.md fn="../CITATIONS.md" -sedi '68s/.*/\ \ year = {'${year}'},/' $fn -sedi '69s/.*/\ \ note = {v'${ark_ver}'}/' $fn -sedi '77s/.*/\ \ year = {'${year}'},/' $fn -sedi '78s/.*/\ \ note = {v'${cv_ver}'}/' $fn -sedi '86s/.*/\ \ year = {'${year}'},/' $fn -sedi '87s/.*/\ \ note = {v'${cvs_ver}'}/' $fn -sedi '95s/.*/\ \ year = {'${year}'},/' $fn -sedi '96s/.*/\ \ note = {v'${ida_ver}'}/' $fn -sedi '104s/.*/\ \ year = {'${year}'},/' $fn -sedi '105s/.*/\ \ note = {v'${idas_ver}'}/' $fn -sedi '113s/.*/\ \ year = {'${year}'},/' $fn -sedi '114s/.*/\ \ note = {v'${kin_ver}'}/' $fn +sedi '71s/.*/\ \ year = {'${year}'},/' $fn +sedi '72s/.*/\ \ note = {v'${ark_ver}'}/' $fn +sedi '80s/.*/\ \ year = {'${year}'},/' $fn +sedi '81s/.*/\ \ note = {v'${cv_ver}'}/' $fn +sedi '89s/.*/\ \ year = {'${year}'},/' $fn +sedi '90s/.*/\ \ note = {v'${cvs_ver}'}/' $fn +sedi '98s/.*/\ \ year = {'${year}'},/' $fn +sedi '99s/.*/\ \ note = {v'${ida_ver}'}/' $fn +sedi '107s/.*/\ \ year = {'${year}'},/' $fn +sedi '108s/.*/\ \ note = {v'${idas_ver}'}/' $fn +sedi '116s/.*/\ \ year = {'${year}'},/' $fn +sedi '117s/.*/\ \ note = {v'${kin_ver}'}/' $fn # Update all occurrences of x.x.x and X.X.X to the current version number fn="../CHANGELOG.md" diff --git a/src/arkode/README.md b/src/arkode/README.md index 8d3c35826f..fd825b9dbb 100644 --- a/src/arkode/README.md +++ b/src/arkode/README.md @@ -1,5 +1,5 @@ # ARKODE -### Version 6.0.0-rc.1 (Jan 2024) +### Version 6.0.0 (Feb 2024) **Daniel R. Reynolds, Department of Mathematics, SMU** @@ -44,8 +44,8 @@ the "SUNDIALS Release History" appendix of the ARKODE User Guide. ## References * D. R. Reynolds, D. J. Gardner, C. S. Woodward, and C. J. Balos, - "User Documentation for ARKODE v6.0.0-rc.1," LLNL technical report - LLNL-SM-668082, Jan 2024. + "User Documentation for ARKODE v6.0.0," LLNL technical report + LLNL-SM-668082, Feb 2024. -* D. R. Reynolds, "Example Programs for ARKODE v6.0.0-rc.1," Technical Report, - Southern Methodist University Center for Scientific Computation, Jan 2024. +* D. R. Reynolds, "Example Programs for ARKODE v6.0.0," Technical Report, + Southern Methodist University Center for Scientific Computation, Feb 2024. diff --git a/src/cvode/README.md b/src/cvode/README.md index 57f2fc72af..fbc0a5e9d4 100644 --- a/src/cvode/README.md +++ b/src/cvode/README.md @@ -1,5 +1,5 @@ # CVODE -### Version 7.0.0-rc.1 (Jan 2024) +### Version 7.0.0 (Feb 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the CVODE User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODE v7.0.0-rc.1," - LLNL technical report UCRL-SM-208108, Jan 2024. + and C. S. Woodward, "User Documentation for CVODE v7.0.0," + LLNL technical report UCRL-SM-208108, Feb 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.0.0-rc.1," - LLNL technical report UCRL-SM-208110, Jan 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.0.0," + LLNL technical report UCRL-SM-208110, Feb 2024. * S.D. Cohen and A.C. Hindmarsh, "CVODE, a Stiff/nonstiff ODE Solver in C," Computers in Physics, 10(2), pp. 138-143, 1996. diff --git a/src/cvodes/README.md b/src/cvodes/README.md index a99a3ce040..a5cf70488b 100644 --- a/src/cvodes/README.md +++ b/src/cvodes/README.md @@ -1,5 +1,5 @@ # CVODES -### Version 7.0.0-rc.1 (Jan 2024) +### Version 7.0.0 (Feb 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -44,11 +44,11 @@ the "SUNDIALS Release History" appendix of the CVODES User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODES v7.0.0-rc.1," - LLNL technical report UCRL-SM-208111, Jan 2024. + and C. S. Woodward, "User Documentation for CVODES v7.0.0," + LLNL technical report UCRL-SM-208111, Feb 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.0.0-rc.1," - LLNL technical report UCRL-SM-208115, Jan 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.0.0," + LLNL technical report UCRL-SM-208115, Feb 2024. * R. Serban and A. C. Hindmarsh, "CVODES: the Sensitivity-Enabled ODE solver in SUNDIALS," Proceedings of IDETC/CIE 2005, Sept. 2005, diff --git a/src/ida/README.md b/src/ida/README.md index 6508644991..325acccc19 100644 --- a/src/ida/README.md +++ b/src/ida/README.md @@ -1,5 +1,5 @@ # IDA -### Version 7.0.0-rc.1 (Jan 2024) +### Version 7.0.0 (Feb 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the IDA User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for IDA v7.0.0-rc.1," - LLNL technical report UCRL-SM-208112, Jan 2024. + and C. S. Woodward, "User Documentation for IDA v7.0.0," + LLNL technical report UCRL-SM-208112, Feb 2024. -* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.0.0-rc.1," - LLNL technical report UCRL-SM-208113, Jan 2024. +* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.0.0," + LLNL technical report UCRL-SM-208113, Feb 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/idas/README.md b/src/idas/README.md index 496733aa24..7fd2909139 100644 --- a/src/idas/README.md +++ b/src/idas/README.md @@ -1,5 +1,5 @@ # IDAS -### Version 6.0.0-rc.1 (Jan 2024) +### Version 6.0.0 (Feb 2024) **Radu Serban, Cosmin Petra, Alan C. Hindmarsh, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -43,11 +43,11 @@ the "SUNDIALS Release History" appendix of the IDAS User Guide. ## References * R. Serban, C. Petra, A. C. Hindmarsh, C. J. Balos, D. J. Gardner, - D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.0.0-rc.1," - LLNL technical report UCRL-SM-234051, Jan 2024. + D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.0.0," + LLNL technical report UCRL-SM-234051, Feb 2024. -* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.0.0-rc.1," - LLNL technical report LLNL-TR-437091, Jan 2024. +* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.0.0," + LLNL technical report LLNL-TR-437091, Feb 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/kinsol/README.md b/src/kinsol/README.md index 02b3146fa0..6433b7c77b 100644 --- a/src/kinsol/README.md +++ b/src/kinsol/README.md @@ -1,5 +1,5 @@ # KINSOL -### Version 7.0.0-rc.1 (Jan 2024) +### Version 7.0.0 (Feb 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -48,11 +48,11 @@ the "SUNDIALS Release History" appendix of the KINSOL User Guide. * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds and C. S. Woodward, - "User Documentation for KINSOL v7.0.0-rc.1," LLNL technical report - UCRL-SM-208116, Jan 2024. + "User Documentation for KINSOL v7.0.0," LLNL technical report + UCRL-SM-208116, Feb 2024. -* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.0.0-rc.1," - LLNL technical report UCRL-SM-208114, Jan 2024. +* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.0.0," + LLNL technical report UCRL-SM-208114, Feb 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and From b685654c6958699821fc68a822b66076fec8cae7 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Wed, 15 May 2024 12:28:34 -0700 Subject: [PATCH 012/137] Maintenance: GitHub Issues and PR Templates (#478) Adds templates for issues and PRs. --------- Co-authored-by: Daniel R. Reynolds --- .github/ISSUE_TEMPLATE/bug.md | 40 +++++++++++++++++++ .github/ISSUE_TEMPLATE/general.md | 8 ++++ .github/PULL_REQUEST_TEMPLATE.md | 10 +++++ .../pull_request_template.md | 0 4 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.md create mode 100644 .github/ISSUE_TEMPLATE/general.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000000..1cdc3dfbcb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,40 @@ +--- +name: Bug +about: File a bug report +title: '[BUG] ' +labels: bug, triage +assignees: '' + +--- + +<!-- +Note: Please search to see if an issue already exists for the bug you encountered. +--> + +### Current Behavior: +<!-- A concise description of what you're experiencing. --> + +### Expected Behavior: +<!-- A concise description of what you expected to happen. --> + +### Steps To Reproduce: +<!-- +Example: steps to reproduce the behavior: +1. In this environment... +2. With this config... +3. Run '...' +4. See error... +--> + +### Environment: +<!-- +Example: +- SUNDIALS version: 7.0.0 +- OS: Ubuntu 20.04 +- Compiler: gcc 8.5.0 +--> + +### Anything else: +<!-- +Links? References? Anything that will give us more context about the issue that you are encountering! +--> diff --git a/.github/ISSUE_TEMPLATE/general.md b/.github/ISSUE_TEMPLATE/general.md new file mode 100644 index 0000000000..2d8ea7ab65 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general.md @@ -0,0 +1,8 @@ +--- +name: General/Question +about: File an issue for something that is not a bug +title: '<title>' +labels: triage +assignees: '' + +--- \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..4080b9fd5f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ + +<!-- SUNDIALS developers only: remove the checklist before opening a PR and refer to the developer's guide instructions. --> +<!-- Thank you for your interest in contributing to SUNDIALS. A pull request to SUNDIALS requires the following steps to be completed: --> + +- [ ] Please target the `develop` branch not `main`. +- [ ] Review our [Contributing Guide](https://github.com/LLNL/sundials/blob/main/CONTRIBUTING.md), and ensure that you sign your last commit (at minimum) as per the guide. +- [ ] Provide a concise description of what your pull request does, and why it is needed/benefical. +- [ ] Add a note about your change to the `CHANGELOG.md` and `docs/shared/RecentChanges.rst` files. Notice that the former is a markdown file and the latter is reStructuredText, so the formatting is slightly different. +- [ ] After your PR is opened, ensure that all of the tests are passing (a SUNDIALS developer will have to allow the testing to run). + diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index e69de29bb2..0000000000 From 3c3b96100310d80c5676b9c1eafa4902af8ef7b0 Mon Sep 17 00:00:00 2001 From: ashesh2512 <36968394+ashesh2512@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:48:27 -0600 Subject: [PATCH 013/137] Bugfix: Update HIP_PLATFORM macros in sundials_hip_policies.hpp (#434) ROCm 6.0 removed the deprecated macros __HIP_PLATFORM_HCC__ and __HIP_PLATFORM_NVCC__. The macros __HIP_PLATFORM_AMD__ and __HIP_PLATFORM_NVIDIA__ should be used instead otherwise WRAP_SIZE is undefined. --------- Signed-off-by: Ashesh Sharma <ashesh.sharma@hpe.com> --- include/sundials/sundials_hip_policies.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sundials/sundials_hip_policies.hpp b/include/sundials/sundials_hip_policies.hpp index d5592ae780..8360661ea6 100644 --- a/include/sundials/sundials_hip_policies.hpp +++ b/include/sundials/sundials_hip_policies.hpp @@ -27,9 +27,9 @@ namespace sundials { namespace hip { -#if defined(__HIP_PLATFORM_HCC__) +#if defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__) constexpr const sunindextype WARP_SIZE = 64; -#elif defined(__HIP_PLATFORM_NVCC__) +#elif defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVDIA__) constexpr const sunindextype WARP_SIZE = 32; #endif constexpr const sunindextype MAX_BLOCK_SIZE = 1024; From bdcddbfc0dd9e26f1c5347c8bf29b0f10eb1261a Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 13 Mar 2024 15:37:13 -0700 Subject: [PATCH 014/137] Bugfix: HIP_PLATFORM default (#437) Update `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- CHANGELOG.md | 9 +++++++++ cmake/SundialsSetupHIP.cmake | 4 ++-- doc/arkode/guide/source/Introduction.rst | 11 +++++++++++ doc/cvode/guide/source/Introduction.rst | 11 +++++++++++ doc/cvodes/guide/source/Introduction.rst | 11 +++++++++++ doc/ida/guide/source/Introduction.rst | 11 +++++++++++ doc/idas/guide/source/Introduction.rst | 11 +++++++++++ doc/kinsol/guide/source/Introduction.rst | 11 +++++++++++ include/sundials/sundials_hip_policies.hpp | 2 ++ 9 files changed, 79 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f955cff01..475b82113c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # SUNDIALS Changelog +## Changes to SUNDIALS in release X.X.X + +Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous +default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default +is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where `WARP_SIZE` would not be set +with ROCm 6.0.0 or newer. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/cmake/SundialsSetupHIP.cmake b/cmake/SundialsSetupHIP.cmake index 0d7b9681a1..7c147019a7 100644 --- a/cmake/SundialsSetupHIP.cmake +++ b/cmake/SundialsSetupHIP.cmake @@ -32,9 +32,9 @@ endif() if(NOT DEFINED HIP_PLATFORM) if(NOT DEFINED ENV{HIP_PLATFORM}) - set(HIP_PLATFORM "hcc" CACHE STRING "HIP platform (hcc, nvcc)") + set(HIP_PLATFORM "amd" CACHE STRING "HIP platform (amd, nvidia)") else() - set(HIP_PLATFORM "$ENV{HIP_PLATFORM}" CACHE STRING "HIP platform (hcc, nvcc)") + set(HIP_PLATFORM "$ENV{HIP_PLATFORM}" CACHE STRING "HIP platform (amd, nvidia)") endif() endif() diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 691bdae1fa..76f5372f5d 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -130,6 +130,17 @@ provided with SUNDIALS, or again may utilize a user-supplied module. Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v6.0.0 ---------------------- diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 7cb0942de1..33b3f87c12 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -111,6 +111,17 @@ implementations. Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v7.0.0 ---------------------- diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 7691faa06b..388a4164f1 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -111,6 +111,17 @@ Fortran. Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v7.0.0 ---------------------- diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 789dc13cfa..16d601e49d 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -72,6 +72,17 @@ systems. Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v7.0.0 ---------------------- diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index eea9c17f32..7c4d03bee8 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -86,6 +86,17 @@ integrate any final-condition ODE dependent on the solution of the original IVP Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v6.0.0 ---------------------- diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 36878b4a32..82e654e5a0 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -88,6 +88,17 @@ applications written in Fortran. Changes from previous versions ============================== +Changes in vX.X.X +------------------ + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + + Changes in v7.0.0 ---------------------- diff --git a/include/sundials/sundials_hip_policies.hpp b/include/sundials/sundials_hip_policies.hpp index 8360661ea6..f7950f8c35 100644 --- a/include/sundials/sundials_hip_policies.hpp +++ b/include/sundials/sundials_hip_policies.hpp @@ -31,6 +31,8 @@ namespace hip { constexpr const sunindextype WARP_SIZE = 64; #elif defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVDIA__) constexpr const sunindextype WARP_SIZE = 32; +#else +#error "Unknown HIP_PLATFORM, report to github.com/LLNL/sundials/issues" #endif constexpr const sunindextype MAX_BLOCK_SIZE = 1024; constexpr const sunindextype MAX_WARPS = MAX_BLOCK_SIZE / WARP_SIZE; From 392ddba1fb502f3affd839e574a7d183f6bea4ce Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Sun, 17 Mar 2024 09:49:26 -0700 Subject: [PATCH 015/137] Docs: Fix broken Sphinx links (#440) Fixes broken links in the documentation identified with the `--nitpicky` option of `sphinx-build`. --------- Co-authored-by: David J. Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 6 ++--- doc/arkode/guide/source/Butcher.rst | 3 ++- doc/arkode/guide/source/Introduction.rst | 10 ++++---- .../ARKStep_c_interface/Preconditioners.rst | 6 ++--- .../Usage/ARKStep_c_interface/Relaxation.rst | 5 ++-- .../ARKStep_c_interface/User_callable.rst | 2 +- .../Usage/ARKStep_c_interface/XBraid.rst | 4 ++-- .../Usage/ERKStep_c_interface/Relaxation.rst | 5 ++-- .../ERKStep_c_interface/User_callable.rst | 2 +- .../MRIStep_c_interface/User_callable.rst | 10 ++++---- .../SPRKStep_c_interface/User_callable.rst | 4 +--- doc/cvode/guide/source/Introduction.rst | 14 +++++------ doc/cvode/guide/source/Usage/index.rst | 8 +++---- .../source/nvectors/CVODE_requirements.rst | 2 +- doc/cvodes/guide/source/Introduction.rst | 14 +++++------ doc/cvodes/guide/source/Usage/ADJ.rst | 18 +++++++------- doc/cvodes/guide/source/Usage/FSA.rst | 22 ++++++++--------- doc/cvodes/guide/source/Usage/SIM.rst | 8 +++---- .../source/nvectors/CVODES_requirements.rst | 2 +- doc/ida/guide/source/Introduction.rst | 24 +++++++++---------- doc/ida/guide/source/Usage/index.rst | 4 ++-- doc/idas/guide/source/Introduction.rst | 24 +++++++++---------- doc/idas/guide/source/Usage/ADJ.rst | 18 +++++++------- doc/idas/guide/source/Usage/FSA.rst | 19 +++++++-------- doc/idas/guide/source/Usage/SIM.rst | 4 ++-- doc/kinsol/guide/source/Introduction.rst | 10 ++++---- doc/kinsol/guide/source/Usage/index.rst | 12 ++++------ doc/shared/nvectors/NVector_Operations.rst | 4 ++-- doc/shared/sunlinsol/SUNLinSol_API.rst | 4 ++-- doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst | 8 +++---- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 8 +++---- .../sunnonlinsol/SUNNonlinSol_FixedPoint.rst | 12 +++++----- .../sunnonlinsol/SUNNonlinSol_Newton.rst | 2 +- .../sunnonlinsol/SUNNonlinSol_PetscSNES.rst | 2 +- .../source/developers/testing/Answers.rst | 6 ++--- src/cvodes/cvodes.c | 2 +- 36 files changed, 153 insertions(+), 155 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475b82113c..1e0c138a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,7 +79,7 @@ SUNDIALSFileOpen SUNDIALSFileClose // From sundials_memory.h -SUNMemorNewEmpty +SUNMemoryNewEmpty SUNMemoryHelper_Alias SUNMemoryHelper_Wrap @@ -661,7 +661,7 @@ functions should be used instead. The previously deprecated constructor `N_VMakeWithManagedAllocator_Cuda` and the function `N_VSetCudaStream_Cuda` have been removed and replaced with -`N_VNewWithMemHelp_Cuda` and `N_VSetKerrnelExecPolicy_Cuda` respectively. +`N_VNewWithMemHelp_Cuda` and `N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros `PVEC_REAL_MPI_TYPE` and `PVEC_INTEGER_MPI_TYPE` have been removed and replaced with @@ -1040,7 +1040,7 @@ linear systems. This module is experimental and is subject to change from version to version. Added a new *optional* function to the SUNLinearSolver API, -`SUNLinSolSetZeroGuess`, to indicate that the next call to `SUNlinSolSolve` will +`SUNLinSolSetZeroGuess`, to indicate that the next call to `SUNLinSolSolve` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the `SUNLinSolNewEmpty` constructor will, at a minimum, need set the `setzeroguess` function pointer in the linear solver `ops` structure to diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index c0087ddf4b..ef4d59a139 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -339,7 +339,8 @@ Knoth-Wolke-3-3 .. index:: Knoth-Wolke-3-3 ERK method Accessible via the constant ``ARKODE_KNOTH_WOLKE_3_3`` to -:c:func:`MRIStepSetMRITableNum` or :c:func:`ARKodeButcherTable_LoadERK`. +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadERK`. Accessible via the string ``"ARKODE_KNOTH_WOLKE_3_3"`` to :c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or :c:func:`ARKodeButcherTable_LoadERKByName`. diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 76f5372f5d..b2532f614a 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -238,7 +238,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -612,7 +612,7 @@ Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and counters to zero. Added the functions :c:func:`ARKStepPrintAllStats`, -:c:func:`ERKStepPrintAllStats`, and :c:func:`MRIStepPrintAll` to output all of +:c:func:`ERKStepPrintAllStats`, and :c:func:`MRIStepPrintAllStats` to output all of the integrator, nonlinear solver, linear solver, and other statistics in one call. The file ``scripts/sundials_csv.py`` contains functions for parsing the comma-separated value output files. @@ -626,9 +626,9 @@ optimization. Added the function :c:func:`MRIStepSetOrder` to select the default MRI method of a given order. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -772,7 +772,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst index 0fa312e455..d772f5ad4a 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst @@ -189,7 +189,7 @@ the ARKBANDPRE module: object, and temporary vectors). The workspaces referred to here exist in addition to those given by - the corresponding function :c:func:`ARKStepGetLSWorkspace()`. + the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. @@ -213,7 +213,7 @@ the ARKBANDPRE module: **Notes:** The counter *nfevalsBP* is distinct from the counter *nfevalsLS* returned by the corresponding function - :c:func:`ARKStepGetNumLSRhsEvals()` and also from *nfi_evals* returned by + :c:func:`ARKStepGetNumLinRhsEvals()` and also from *nfi_evals* returned by :c:func:`ARKStepGetNumRhsEvals()`. The total number of right-hand side function evaluations is the sum of all three of these counters, plus the *nfe_evals* counter for :math:`f^E` calls @@ -620,7 +620,7 @@ the ARKBBDPRE module: object, temporary vectors). These values are local to each process. The workspaces referred to here exist in addition to those given by - the corresponding function :c:func:`ARKStepGetLSWorkSpace()`. + the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst index 00792724b0..38e66f0e36 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst @@ -204,7 +204,7 @@ relaxation. :eq:`ARKODE_RELAX_NLS`. If the residual or iteration update tolerance (see - :c:func:`ARKStepSetRelaxMaxIter`) is not reached within the maximum number of + :c:func:`ARKStepSetRelaxMaxIters`) is not reached within the maximum number of iterations (determined by :c:func:`ARKStepSetRelaxMaxIters`), the step will be repeated with a smaller step size (determined by :c:func:`ARKStepSetRelaxEtaFail`). @@ -289,7 +289,8 @@ about the performance of the relaxation method. The counter includes the sum of the number of nonlinear solver failures (see :c:func:`ARKStepGetNumRelaxSolveFails`) and the number of failures due - an unacceptable relaxation value (see :c:func:`ARKStepSetRelaxBoundFactor`). + an unacceptable relaxation value (see :c:func:`ARKStepSetRelaxLowerBound` and + :c:func:`ARKStepSetRelaxUpperBound`). :param arkode_mem: the ARKStep memory structure :param fails: the total number of failed relaxation attempts 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 ddd4fd856f..4da2461e96 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 @@ -4434,7 +4434,7 @@ Last return from a mass matrix solver function :c:func:`ARKS **Notes:** The values of *msflag* for each of the various solvers will match those described above for the function - :c:func:`ARKStepGetLastLSFlag()`. + :c:func:`ARKStepGetLastLinFlag()`. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst index 9b62139c07..ffc80e5901 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst @@ -639,7 +639,7 @@ error occurred. The possible return codes are given in .. c:function:: int ARKBraid_SetSpatialNormFn(braid_App app, braid_PtFcnSpatialNorm snorm) This function sets the spatial norm function provided to XBraid (default - :c:func:`SUNBraid_SpatialNorm()`). + :c:func:`SUNBraidVector_SpatialNorm()`). **Arguments:** * *app* -- input, an ARKBraid instance. @@ -695,7 +695,7 @@ error occurred. The possible return codes are given in This function returns a vector from the ARKStep memory to use as a template for creating new vectors with :c:func:`N_VClone()` i.e., this is the ARKBraid - implementation of :c:func:`SUNBraidVector_GetVecTmpl()`. + implementation of :c:func:`SUNBraidApp_GetVecTmpl()`. **Arguments:** * *app* -- input, an ARKBraid instance. diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst index f67f0e75ae..605a5493ea 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst @@ -192,7 +192,7 @@ relaxation. Sets the nonlinear solver residual tolerance to use when solving :eq:`ARKODE_RELAX_NLS`. - If the residual or solution tolerance (see :c:func:`ERKStepSetRelaxMaxIter`) + If the residual or solution tolerance (see :c:func:`ERKStepSetRelaxMaxIters`) is not reached within the maximum number of iterations (determined by :c:func:`ERKStepSetRelaxMaxIters`), the step will be repeated with a smaller step size (determined by :c:func:`ERKStepSetRelaxEtaFail`). @@ -278,7 +278,8 @@ about the performance of the relaxation method. The counter includes the sum of the number of nonlinear solver failures (see :c:func:`ERKStepGetNumRelaxSolveFails`) and the number of failures due - an unacceptable relaxation value (see :c:func:`ERKStepSetRelaxBoundFactor`). + an unacceptable relaxation value (see :c:func:`ERKStepSetRelaxLowerBound` and + :c:func:`ERKStepSetRelaxUpperBound`). :param arkode_mem: the ERKStep memory structure :param fails: the total number of failed relaxation attempts 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 38a4b16d15..16bfba3761 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 @@ -491,7 +491,7 @@ Optional inputs for ERKStep +----------------------------------------------------+-------------------------------------------+------------------------+ | Set a value for :math:`t_{stop}` | :c:func:`ERKStepSetStopTime()` | undefined | +----------------------------------------------------+-------------------------------------------+------------------------+ - | Interpolate at :math:`t_{stop}` | :c:func:`ERKStepInterpolateSetStopTime()` | ``SUNFALSE`` | + | Interpolate at :math:`t_{stop}` | :c:func:`ERKStepSetInterpolateStopTime()` | ``SUNFALSE`` | +----------------------------------------------------+-------------------------------------------+------------------------+ | Disable the stop time | :c:func:`ERKStepClearStopTime` | N/A | +----------------------------------------------------+-------------------------------------------+------------------------+ diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index 6bbcac2b87..dbb44c425c 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -3483,8 +3483,11 @@ via a call to :c:func:`MRIStepSetStopTime()`. Following a successful call to :c:func:`MRIStepReset()`, call :c:func:`MRIStepEvolve()` again to continue solving the problem. By default the next call to :c:func:`MRIStepEvolve()` will use the step size computed by MRIStep prior to calling :c:func:`MRIStepReset()`. -To set a different step size or have MRIStep estimate a new step size use -:c:func:`MRIStepSetInitStep()`. +To set a different step size use :c:func:`MRIStepSetFixedStep`. + +.. + To set a different step size or have MRIStep estimate a new step size use + :c:func:`MRIStepSetInitStep()`. One important use of the :c:func:`MRIStepReset()` function is in the treating of jump discontinuities in the RHS functions. Except in cases @@ -3621,8 +3624,7 @@ vector. vector will be invalid after the call to :c:func:`MRIStepResize()`, so the new absolute tolerance vector should be re-set **following** each call to :c:func:`MRIStepResize()` through a new call to - :c:func:`MRIStepSVtolerances()` and possibly - :c:func:`MRIStepResVtolerance()` if applicable. + :c:func:`MRIStepSVtolerances()`. If scalar-valued tolerances or a tolerance function was specified through either :c:func:`MRIStepSStolerances()` or diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst index 3f5097c0c9..9dc6d5f359 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst @@ -269,8 +269,6 @@ Optional inputs for SPRKStep +-----------------------------------------------------+------------------------------------------+------------------------+ | Set dense output polynomial degree | :c:func:`SPRKStepSetInterpolantDegree()` | 5 | +-----------------------------------------------------+------------------------------------------+------------------------+ - | Supply a pointer to a diagnostics output file | :c:func:`SPRKStepSetDiagnostics()` | ``NULL`` | - +-----------------------------------------------------+------------------------------------------+------------------------+ | Set fixed step size (required user input) | :c:func:`SPRKStepSetFixedStep()` | user defined | +-----------------------------------------------------+------------------------------------------+------------------------+ | Maximum no. of internal steps before *tout* | :c:func:`SPRKStepSetMaxNumSteps()` | 500 | @@ -501,7 +499,7 @@ Optional inputs for IVP method selection .. warning:: This overrides any previously set method so it should not be used with - :c:func:`SPRKStepSetMethod` or :c:func:`SPRKStepMethodByName`. + :c:func:`SPRKStepSetMethod` or :c:func:`SPRKStepSetMethodName`. .. c:function:: int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_table) diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 33b3f87c12..43df0d16c2 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -209,7 +209,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -509,9 +509,9 @@ Added the functions :c:func:`CVodeSetDeltaGammaMaxLSetup` and thresholds to require a linear solver setup or Jacobian/precondition update, respectively. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -640,7 +640,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and @@ -942,7 +942,7 @@ This module is experimental and is subject to change from version to version. Added a new *optional* function to the SUNLinearSolver API, :c:func:`SUNLinSolSetZeroGuess()`, to indicate that the next call to -:c:func:`SUNlinSolSolve()` will be made with a zero initial guess. SUNLinearSolver +:c:func:`SUNLinSolSolve()` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the :c:func:`SUNLinSolNewEmpty` constructor will, at a minimum, need set the ``setzeroguess`` function pointer in the linear solver ``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver @@ -1335,7 +1335,7 @@ Changes in v5.0.0 **SUNNonlinearSolver module changes** - A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolSetConvTestFN` allocates an + objects. The constructor :c:func:`SUNNonlinSolSetConvTestFn` allocates an “empty” generic ``SUNNonlinearSolver`` with the object’s content pointer and the function pointers in the operations structure initialized to . When used in the constructor for custom objects this function will ease the @@ -1558,7 +1558,7 @@ Support for optional inequality constraints on individual components of the solution vector has been added to CVODE and CVODES. See :numref:`CVODE.Mathematics` and the description of in :numref:`CVODE.Usage.CC.optional_input` for more details. Use of :c:func:`CVodeSetConstraints` requires the ``N_Vector`` -operations :c:func:`N_VMinQuotient`, :c:func:`N_VConstMask`, and +operations :c:func:`N_VMinQuotient`, :c:func:`N_VConstrMask`, and :c:func:`N_VCompare` that were not previously required by CVODE and CVODES. Fixed a problem with setting which would occur with some compilers (e.g. diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index e9394753df..2384ad9b31 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -623,7 +623,7 @@ attaches the nonlinear solver to the main CVODE integrator. .. c:function:: int CVodeSetNonlinearSolver(void* cvode_mem, SUNNonlinearSolver NLS) - The function ``CVodeSetNonLinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODE. + The function ``CVodeSetNonlinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODE. **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. @@ -2313,7 +2313,7 @@ the preconditioner. +-------------------------------------------------+------------------------------------------+ | No. of Jacobian-vector product evaluations | :c:func:`CVodeGetNumJtimesEvals` | +-------------------------------------------------+------------------------------------------+ - | Get all linear solver statistics in one | :c:func:`CVodeGetLinSolvStats` | + | Get all linear solver statistics in one | :c:func:`CVodeGetLinSolveStats` | | function call | | +-------------------------------------------------+------------------------------------------+ | Last return from a linear solver function | :c:func:`CVodeGetLastLinFlag` | @@ -3039,9 +3039,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. -.. c:function:: int CVodeGetLinSolvStats(void* cvode_mem, long int* njevals, long int* nfevalsLS, long int* nliters, long int* nlcfails, long int* npevals, long int* npsolves, long int* njtsetups, long int* njtimes) +.. c:function:: int CVodeGetLinSolveStats(void* cvode_mem, long int* njevals, long int* nfevalsLS, long int* nliters, long int* nlcfails, long int* npevals, long int* npsolves, long int* njtsetups, long int* njtimes) - The function ``CVodeGetLinSolvStats`` returns CVODE linear solver statistics. + The function ``CVodeGetLinSolveStats`` returns CVODE linear solver statistics. **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. diff --git a/doc/cvode/guide/source/nvectors/CVODE_requirements.rst b/doc/cvode/guide/source/nvectors/CVODE_requirements.rst index da689397b9..67c24cd3b9 100644 --- a/doc/cvode/guide/source/nvectors/CVODE_requirements.rst +++ b/doc/cvode/guide/source/nvectors/CVODE_requirements.rst @@ -121,6 +121,6 @@ CVODE are: :c:func:`N_VWL2Norm`, :c:func:`N_VDotProd`, :c:func:`N_VL1Norm`, :c:func:`N_VWrmsNormMask`, and :c:func:`N_VGetCommunicator`. Therefore, a user-supplied NVECTOR module for CVODE could omit these functions (although some may be needed by SUNNONLINSOL or SUNLINSOL modules). The functions -:c:func:`N_MinQuotient`, :c:func:`N_VConstrMask`, and :c:func:`N_VCompare` +:c:func:`N_VMinQuotient`, :c:func:`N_VConstrMask`, and :c:func:`N_VCompare` are only used when constraint checking is enabled and may be omitted if this feature is not used. diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 388a4164f1..ee0cc10a21 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -209,7 +209,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -515,9 +515,9 @@ Added the functions :c:func:`CVodeSetDeltaGammaMaxLSetup` and thresholds to require a linear solver setup or Jacobian/precondition update, respectively. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -663,7 +663,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and @@ -987,7 +987,7 @@ details. This module is experimental and is subject to change from version to version. Added a new *optional* function to the SUNLinearSolver API, -``SUNLinSolSetZeroGuess``, to indicate that the next call to ``SUNlinSolSolve`` +``SUNLinSolSetZeroGuess``, to indicate that the next call to ``SUNLinSolSolve`` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the ``SUNLinSolNewEmpty`` constructor will, at a minimum, need set the ``setzeroguess`` function pointer in the linear solver ``ops`` structure to @@ -1330,7 +1330,7 @@ Changes in v5.0.0 **SUNNonlinearSolver module changes** - A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolSetConvTestFN` allocates an + objects. The constructor :c:func:`SUNNonlinSolSetConvTestFn` allocates an “empty” generic ``SUNNonlinearSolver`` with the object’s content pointer and the function pointers in the operations structure initialized to . When used in the constructor for custom objects this function will ease the @@ -1571,7 +1571,7 @@ Support for optional inequality constraints on individual components of the solution vector has been added to CVODE and CVODES. See Chapter :numref:`CVODES.Mathematics` and the description of :c:func:`CVodeSetConstraints` for more details. Use of ``CVodeSetConstraints`` -requires the ``N_Vector`` operations ``N_MinQuotient``, ``N_VConstrMask``, and +requires the ``N_Vector`` operations ``N_VMinQuotient``, ``N_VConstrMask``, and ``N_VCompare`` that were not previously required by CVODE and CVODES. Fixed a thread-safety issue when using ajdoint sensitivity analysis. diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index b65eccf85b..038019c16f 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -585,15 +585,15 @@ call to :c:func:`CVodeInitB` or :c:func:`CVodeInitBS`. * ``CV_ILL_INPUT`` -- One of the input tolerances was negative. -.. c:function:: int CVodeSVtolerancesB(void * cvode_mem, int which, reltolBabstolB) +.. c:function:: int CVodeSVtolerancesB(void * cvode_mem, int which, sunrealtype reltolB, N_Vector abstolB) The function :c:func:`CVodeSVtolerancesB` specifies scalar relative tolerance and vector absolute tolerances. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block returned by :c:func:`CVodeCreate`. * ``which`` -- represents the identifier of the backward problem. - * ``reltol`` -- is the scalar relative error tolerance. - * ``abstol`` -- is the vector of absolute error tolerances. + * ``reltolB`` -- is the scalar relative error tolerance. + * ``abstolB`` -- is the vector of absolute error tolerances. **Return value:** * ``CV_SUCCESS`` -- The call to :c:func:`CVodeSVtolerancesB` was successful. @@ -698,7 +698,7 @@ correctly before any subsequent calls to :c:func:`CVodeB`. .. c:function:: int CVodeSetNonlinearSolverB(void * cvode_mem, int which, SUNNonlinearSolver NLS) - The function :c:func:`CVodeSetNonLinearSolverB` attaches a + The function :c:func:`CVodeSetNonlinearSolverB` attaches a ``SUNNONLINEARSOLVER`` object (``NLS``) to CVODES for the solution of the backward problem. @@ -1053,7 +1053,7 @@ potentially non-differentiable factor. .. c:function:: int CVodeSetJacTimesRhsFnB(void * cvode_mem, int which, CVRhsFn jtimesRhsFn) - The function :c:func:`CVodeSetJacTimesRhsFn` specifies an alternative ODE + The function :c:func:`CVodeSetJacTimesRhsFnB` specifies an alternative ODE right-hand side function for use in the internal Jacobian-vector product difference quotient approximation. @@ -1077,9 +1077,9 @@ potentially non-differentiable factor. initialized through a call to :c:func:`CVodeSetLinearSolverB`. -.. c:function:: int CVodeSetPreconditionerB(void * cvode_mem, int which, CVLPrecSetupFnB psetupB, CVLsPrecSolveFnB psolveB) +.. c:function:: int CVodeSetPreconditionerB(void * cvode_mem, int which, CVLsPrecSetupFnB psetupB, CVLsPrecSetupFnB psolveB) - The function :c:func:`CVodeSetPrecSolveFnB` specifies the preconditioner + The function :c:func:`CVodeSetPreconditionerB` specifies the preconditioner setup and solve functions for the backward integration. **Arguments:** @@ -1101,7 +1101,7 @@ potentially non-differentiable factor. .. c:function:: int CVodeSetPreconditionerBS(void * cvode_mem, int which, CVLsPrecSetupFnBS psetupBS, CVLsPrecSolveFnBS psolveBS) - The function :c:func:`CVodeSetPrecSolveFnBS` specifies the preconditioner + The function :c:func:`CVodeSetPreconditionerBS` specifies the preconditioner setup and solve functions for the backward integration, in the case where the backward problem depends on the forward sensitivities. @@ -1152,7 +1152,7 @@ potentially non-differentiable factor. .. c:function:: int CVodeSetLSNormFactorB(void * cvode_mem, int which, sunrealtype nrmfac) - The function :c:func:`CVodeSetLSNormFactor` specifies the factor to use when + The function :c:func:`CVodeSetLSNormFactorB` specifies the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. This routine can be used in both the cases wherethe backward diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index 53e57efb94..5a9e74a97c 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -165,7 +165,7 @@ sensitivity analysis beyond those for IVP solution #. **Set sensitivity tolerances** Call :c:func:`CVodeSensSStolerances`, :c:func:`CVodeSensSVtolerances` or - :c:func:`CVodeEEtolerances`. + :c:func:`CVodeSensEEtolerances`. #. **Set sensitivity analysis optional inputs** @@ -502,8 +502,8 @@ corrector option, or :c:func:`CVodeSetNonlinearSolver` and When changing the nonlinear solver in CVODES, :c:func:`CVodeSetNonlinearSolver` must be called after :c:func:`CVodeInit`; similarly -:c:func:`CVodeSetNonlinearSolverSensSim`, :c:func:`CVodeSetNonlinearSolverStg`, -and :c:func:`CVodeSetNonlinearSolverStg1` must be called after +:c:func:`CVodeSetNonlinearSolverSensSim`, :c:func:`CVodeSetNonlinearSolverSensStg`, +and :c:func:`CVodeSetNonlinearSolverSensStg1` must be called after :c:func:`CVodeSensInit`. If any calls to :c:func:`CVode` have been made, then CVODES will need to be reinitialized by calling :c:func:`CVodeReInit` to ensure that the nonlinear solver is initialized correctly before any subsequent calls to @@ -521,7 +521,7 @@ to the main CVODES integrator. .. c:function:: int CVodeSetNonlinearSolverSensSim(void * cvode_mem, SUNNonlinearSolver NLS) - The function :c:func:`CVodeSetNonLinearSolverSensSim` attaches a + The function :c:func:`CVodeSetNonlinearSolverSensSim` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODES when using the ``CV_SIMULTANEOUS`` approach to correct the state and sensitivity variables at the same time. @@ -538,7 +538,7 @@ to the main CVODES integrator. .. c:function:: int CVodeSetNonlinearSolverSensStg(void * cvode_mem, SUNNonlinearSolver NLS) - The function :c:func:`CVodeSetNonLinearSolverSensStg` attaches a + The function :c:func:`CVodeSetNonlinearSolverSensStg` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODES when using the ``CV_STAGGERED`` approach to correct all the sensitivity variables after the correction of the state variables. @@ -560,7 +560,7 @@ to the main CVODES integrator. .. c:function:: int CVodeSetNonlinearSolverSensStg1(void * cvode_mem, SUNNonlinearSolver NLS) - The function :c:func:`CVodeSetNonLinearSolverSensStg1` attaches a + The function :c:func:`CVodeSetNonlinearSolverSensStg1` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODES when using the ``CV_STAGGERED1`` approach to correct the sensitivity variables one at a time after the correction of the state variables. @@ -611,7 +611,7 @@ Forward sensitivity extraction functions If forward sensitivity computations have been initialized by a call to :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`, or reinitialized by a call -to :c:func:`CVSensReInit`, then CVODES computes both a solution and +to :c:func:`CVodeSensReInit`, then CVODES computes both a solution and sensitivities at time ``t``. However, :c:func:`CVode` will still return only the solution :math:`y` in ``yout``. Solution sensitivities can be obtained through one of the following functions: @@ -900,7 +900,7 @@ detail in the remainder of this section. .. c:function:: int CVodeGetNumRhsEvalsSens(void * cvode_mem, long int nfevalsS) - The function :c:func:`CVodeGetNumRhsEvalsSEns` returns the number of calls to the + The function :c:func:`CVodeGetNumRhsEvalsSens` returns the number of calls to the user's right-hand side function due to the internal finite difference approximation of the sensitivity right-hand sides. @@ -1073,7 +1073,7 @@ detail in the remainder of this section. ``CV_STAGGERED1``. In the ``CV_STAGGERED1`` case, the value of ``nSncfails`` is the sum of the number of nonlinear convergence failures that occurred for each sensitivity equation. These individual counters - can be obtained through a call to :c:func:`CVodeGetStgrSensNumNonlinConvFails` + can be obtained through a call to :c:func:`CVodeGetStgrSensNumNonlinSolvConvFails` (see below). @@ -1192,7 +1192,7 @@ defined by: * ``yS`` -- contains the current values of the sensitivity vectors. * ``ySdot`` -- is the output of :c:type:`CVSensRhsFn` . On exit it must contain the sensitivity right-hand side vectors. * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData` . - * ``tmp1``, ``tmp2`` -- are ``N_Vectors`` of length :math:`N` which can be used as temporary storage. + * ``tmp1``, ``tmp2`` -- are vectors of length :math:`N` which can be used as temporary storage. **Return value:** A :c:type:`CVSensRhsFn` should return 0 if successful, a positive value if a recoverable @@ -1243,7 +1243,7 @@ sensitivity parameter at a time, through a function of type * ``yS`` -- contains the current value of the ``iS`` -th sensitivity vector. * ``ySdot`` -- is the output of :c:type:`CVSensRhs1Fn` . On exit it must contain the ``iS`` -th sensitivity right-hand side vector. * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData` . - * ``tmp1``, ``tmp2`` -- are ``N_Vectors`` of length :math:`N` which can be used as temporary storage. + * ``tmp1``, ``tmp2`` -- are vectors of length :math:`N` which can be used as temporary storage. **Return value:** A :c:type:`CVSensRhs1Fn` should return 0 if successful, a positive value if a recoverable diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index b0f6c8db94..449bb24857 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -626,7 +626,7 @@ attaches the nonlinear solver to the main CVODES integrator. .. c:function:: int CVodeSetNonlinearSolver(void* cvode_mem, SUNNonlinearSolver NLS) - The function ``CVodeSetNonLinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODES. + The function ``CVodeSetNonlinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to CVODES. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. @@ -2310,7 +2310,7 @@ the preconditioner. +-------------------------------------------------+------------------------------------------+ | No. of Jacobian-vector product evaluations | :c:func:`CVodeGetNumJtimesEvals` | +-------------------------------------------------+------------------------------------------+ - | Get all linear solver statistics in one | :c:func:`CVodeGetLinSolvStats` | + | Get all linear solver statistics in one | :c:func:`CVodeGetLinSolveStats` | | function call | | +-------------------------------------------------+------------------------------------------+ | Last return from a linear solver function | :c:func:`CVodeGetLastLinFlag` | @@ -3034,9 +3034,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. -.. c:function:: int CVodeGetLinSolvStats(void* cvode_mem, long int* njevals, long int* nfevalsLS, long int* nliters, long int* nlcfails, long int* npevals, long int* npsolves, long int* njtsetups, long int* njtimes) +.. c:function:: int CVodeGetLinSolveStats(void* cvode_mem, long int* njevals, long int* nfevalsLS, long int* nliters, long int* nlcfails, long int* npevals, long int* npsolves, long int* njtsetups, long int* njtimes) - The function ``CVodeGetLinSolvStats`` returns CVODES linear solver statistics. + The function ``CVodeGetLinSolveStats`` returns CVODES linear solver statistics. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. diff --git a/doc/cvodes/guide/source/nvectors/CVODES_requirements.rst b/doc/cvodes/guide/source/nvectors/CVODES_requirements.rst index f12623d67a..716bd75f17 100644 --- a/doc/cvodes/guide/source/nvectors/CVODES_requirements.rst +++ b/doc/cvodes/guide/source/nvectors/CVODES_requirements.rst @@ -57,7 +57,7 @@ interested reader. :c:func:`N_VMaxNorm` x :c:func:`N_VWrmsNorm` x x x x :c:func:`N_VMin` x - :c:func:`N_MinQuotient` x + :c:func:`N_VMinQuotient` x :c:func:`N_VConstrMask` x :c:func:`N_VCompare` x x :c:func:`N_VInvTest` x diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 16d601e49d..2d54657a91 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -170,7 +170,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -449,9 +449,9 @@ in step size. Added the function :c:func:`IDASetMinStep` to set a minimum step size. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -580,7 +580,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and @@ -948,7 +948,7 @@ CMake variable. This module remains experimental and is subject to change from version to version. A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the -``N_Vector`` API. This operation is useful for :c:type:`N_Vectors` that utilize +``N_Vector`` API. This operation is useful for :c:type:`N_Vector` that utilize dual memory spaces, e.g. the native SUNDIALS CUDA ``N_Vector``. The :ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` and @@ -1451,12 +1451,12 @@ to complete the computation. Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: -* Changed :c:func:`N_VGetLength_Cuda` to return the global vector length instead +* Changed ``N_VGetLength_Cuda`` to return the global vector length instead of the local vector length. -* Added :c:func:`N_VGetLocalLength_Cuda` to return the local vector length. +* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. -* Added :c:func:`N_VGetMPIComm_Cuda` to return the MPI communicator used. +* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. * Removed the accessor functions in the namespace ``suncudavec``. @@ -1465,7 +1465,7 @@ Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: * Added the ability to set the ``cudaStream_t`` used for execution of the :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels. See the function - :c:func:`N_VSetCudaStreams_Cuda`. + ``N_VSetCudaStreams_Cuda``. * Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and :c:func:`N_VIsManagedMemory_Cuda` functions to accommodate using managed @@ -1473,12 +1473,12 @@ Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: Multiple changes to :ref:`NVECTOR_RAJA <NVectors.RAJA>` were made: -* Changed :c:func:`N_VGetLength_Raja` to return the global vector length instead +* Changed ``N_VGetLength_Raja`` to return the global vector length instead of the local vector length. -* Added :c:func:`N_VGetLocalLength_Raja` to return the local vector length. +* Added ``N_VGetLocalLength_Raja`` to return the local vector length. -* Added :c:func:`N_VGetMPIComm_Raja` to return the MPI communicator used. +* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. * Removed the accessor functions in the namespace ``suncudavec``. diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 441679139e..02bf3732d1 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -623,7 +623,7 @@ IDA integrator. We note that at present, the ``SUNNonlinearSolver`` object .. c:function:: int IDASetNonlinearSolver(void* ida_mem, SUNNonlinearSolver NLS) - The function ``IDASetNonLinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDA. + The function ``IDASetNonlinearSolver`` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDA. **Arguments:** * ``ida_mem`` -- pointer to the IDA solver object. @@ -3480,7 +3480,7 @@ Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`IDALsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); +.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, sunrealtype cj, void *user_data); This function setups any data needed by :math:`Jv` product function (see :c:type:`IDALsJacTimesVecFn`). diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 7c4d03bee8..ebdcb5fa82 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -184,7 +184,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -466,9 +466,9 @@ in step size. Added the function :c:func:`IDASetMinStep` to set a minimum step size. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -605,7 +605,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and @@ -987,7 +987,7 @@ CMake variable. This module remains experimental and is subject to change from version to version. A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the -``N_Vector`` API. This operation is useful for :c:type:`N_Vectors` that utilize +``N_Vector`` API. This operation is useful for :c:type:`N_Vector` that utilize dual memory spaces, e.g. the native SUNDIALS CUDA ``N_Vector``. The :ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` and @@ -1513,12 +1513,12 @@ to complete the computation. Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: -* Changed :c:func:`N_VGetLength_Cuda` to return the global vector length instead +* Changed ``N_VGetLength_Cuda`` to return the global vector length instead of the local vector length. -* Added :c:func:`N_VGetLocalLength_Cuda` to return the local vector length. +* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. -* Added :c:func:`N_VGetMPIComm_Cuda` to return the MPI communicator used. +* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. * Removed the accessor functions in the namespace ``suncudavec``. @@ -1527,7 +1527,7 @@ Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: * Added the ability to set the ``cudaStream_t`` used for execution of the :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels. See the function - :c:func:`N_VSetCudaStreams_Cuda`. + ``N_VSetCudaStreams_Cuda``. * Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and :c:func:`N_VIsManagedMemory_Cuda` functions to accommodate using managed @@ -1535,12 +1535,12 @@ Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: Multiple changes to :ref:`NVECTOR_RAJA <NVectors.RAJA>` were made: -* Changed :c:func:`N_VGetLength_Raja` to return the global vector length instead +* Changed ``N_VGetLength_Raja`` to return the global vector length instead of the local vector length. -* Added :c:func:`N_VGetLocalLength_Raja` to return the local vector length. +* Added ``N_VGetLocalLength_Raja`` to return the local vector length. -* Added :c:func:`N_VGetMPIComm_Raja` to return the MPI communicator used. +* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. * Removed the accessor functions in the namespace ``suncudavec``. diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 935b7ebd9f..0d89e5b895 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -718,7 +718,7 @@ correctly before any subsequent calls to :c:func:`IDASolveB`. .. c:function:: int IDASetNonlinearSolverB(void * ida_mem, int which, SUNNonlinearSolver NLS) - The function :c:func:`IDASetNonLinearSolverB` attaches a + The function :c:func:`IDASetNonlinearSolverB` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDAS for the solution of the backward problem. @@ -778,7 +778,7 @@ Both functions require forward solutions at the final time ``tB0``. :c:func:`IDACalcICB` will correct the values of :math:`yB(tB_0)` and :math:`\dot{y}B(tB_0)` which were specified in the previous call to :c:func:`IDAInitB` or :c:func:`IDAReInitB`. To obtain the corrected values, - call :c:func:`IDAGetconsistentICB` (see + call :c:func:`IDAGetConsistentICB` (see :numref:`IDAS.Usage.ADJ.user_callable.optional_ouput_b.iccalcB`). :c:func:`IDACalcICB` will correct the values of :math:`yB(tB_0)` and @@ -807,7 +807,7 @@ conditions: **Return value:** * ``IDA_NO_ADJ`` -- :c:func:`IDAAdjInit` has not been previously called. - * ``IDA_ILL_INPUT`` -- Parameter ``which`` represented an invalid identifier, sensitivities were not active during forward integration, or :c:func:`IDAInitBS` or :c:func:`IDAReInitBS` has not been previously called. + * ``IDA_ILL_INPUT`` -- Parameter ``which`` represented an invalid identifier, sensitivities were not active during forward integration, or :c:func:`IDAInitBS` or :c:func:`IDAReInitB` has not been previously called. **Notes:** @@ -815,13 +815,13 @@ conditions: 0` will trap all :c:func:`IDACalcICBS` failures. Note that :c:func:`IDACalcICBS` will correct the values of :math:`yB(tB_0)` and :math:`\dot{y}B(tB_0)` which were specified in the previous call to - :c:func:`IDAInitBS` or :c:func:`IDAReInitBS`. To obtain the corrected values, + :c:func:`IDAInitBS` or :c:func:`IDAReInitB`. To obtain the corrected values, call :c:func:`IDAGetConsistentICB` (see :numref:`IDAS.Usage.ADJ.user_callable.optional_ouput_b.iccalcB`). :c:func:`IDACalcICBS` will correct the values of :math:`yB(tB_0)` and :math:`\dot{y}B(tB_0)` which were specified in the previous call to - :c:func:`IDAInitBS` or :c:func:`IDAReInitBS`. To obtain the corrected values, + :c:func:`IDAInitBS` or :c:func:`IDAReInitB`. To obtain the corrected values, :call :c:func:`IDAGetConsistentICB`. @@ -842,7 +842,7 @@ interpolation to provide the solution of the IVP to the backward problem. The function :c:func:`IDASolveB` does not return the solution ``yB`` itself. To obtain that, call the function :c:func:`IDAGetB`, which is also described below. -The :c:func:`IDASolveB` function does not support rootfinding, unlike :c:func:`IDASoveF`, +The :c:func:`IDASolveB` function does not support rootfinding, unlike :c:func:`IDASolveF`, which supports the finding of roots of functions of :math:`(t,y,\dot{y})`. If rootfinding was performed by :c:func:`IDASolveF`, then for the sake of efficiency, it should be disabled for :c:func:`IDASolveB` by first calling :c:func:`IDARootInit` with @@ -1012,7 +1012,7 @@ backward problem depends on the forward sensitivities. * ``IDALS_SUCCESS`` -- :c:func:`IDASetJacFnBS` succeeded. * ``IDALS_MEM_NULL`` -- The ``ida_mem`` was ``NULL``. * ``IDALS_NO_ADJ`` -- The function :c:func:`IDAAdjInit` has not been previously called. - * ``IDALS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`IDASetLinearSolverBS`. + * ``IDALS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`IDASetLinearSolverB`. * ``IDALS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. **Notes:** @@ -1183,7 +1183,7 @@ These may be accomplished through calling the following functions: .. c:function:: int IDASetPreconditionerB(void * ida_mem, int which, IDALsPrecSetupFnB psetupB, IDALsPrecSolveFnB psolveB) - The function :c:func:`IDASetPrecSolveFnB` specifies the preconditioner setup + The function :c:func:`IDASetPreconditionerB` specifies the preconditioner setup and solve functions for the backward integration. **Arguments:** @@ -1210,7 +1210,7 @@ These may be accomplished through calling the following functions: .. c:function:: int IDASetPreconditionerBS(void * ida_mem, int which, IDALsPrecSetupFnBS psetupBS, IDALsPrecSolveFnBS psolveBS) - The function :c:func:`IDASetPrecSolveFnBS` specifies the preconditioner + The function :c:func:`IDASetPreconditionerBS` specifies the preconditioner setup and solve functions for the backward integration, in the case where the backward problem depends on the forward sensitivities. diff --git a/doc/idas/guide/source/Usage/FSA.rst b/doc/idas/guide/source/Usage/FSA.rst index 1e9111451a..6309026184 100644 --- a/doc/idas/guide/source/Usage/FSA.rst +++ b/doc/idas/guide/source/Usage/FSA.rst @@ -219,9 +219,7 @@ Forward sensitivity initialization and deallocation functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Activation of forward sensitivity computation is done by calling -:c:func:`IDASensInit` or :c:func:`IDASensInit1`, depending on whether the -sensitivity residual function returns all sensitivities at once or one by -one, respectively. The form of the call to each of these routines is as follows: +:c:func:`IDASensInit`. The form of the call is as follows: .. c:function:: int IDASensInit(void * ida_mem, int Ns, int ism, IDASensResFn fS, N_Vector * yS0, N_Vector * ypS0) @@ -430,13 +428,12 @@ by calling the appropriate constructor routine. The user must then attach the ``SUNNonlinearSolver`` object to IDAS by calling :c:func:`IDASetNonlinearSolverSensSim` when using the ``IDA_SIMULTANEOUS`` corrector option, or :c:func:`IDASetNonlinearSolver` and -:c:func:`IDASetNonlinearSolverSensStg` or -:c:func:`IDASetNonlinearSolverSensStg1` when using the ``IDA_STAGGERED`` -as documented below. +:c:func:`IDASetNonlinearSolverSensStg` when using the ``IDA_STAGGERED`` +corrector option as documented below. When changing the nonlinear solver in IDAS, :c:func:`IDASetNonlinearSolver` must be called after :c:func:`IDAInit`; similarly -:c:func:`IDASetNonlinearSolverSensSim`, :c:func:`IDASetNonlinearSolverStg`, must +:c:func:`IDASetNonlinearSolverSensSim`, :c:func:`IDASetNonlinearSolverSensStg`, must be called after :c:func:`IDASensInit`. If any calls to :c:func:`IDASolve` have been made, then IDAS will need to be reinitialized by calling :c:func:`IDAReInit` to ensure that the nonlinear solver is initialized correctly before any subsequent @@ -452,7 +449,7 @@ attaches the nonlinear solver to the main IDAS integrator. .. c:function:: int IDASetNonlinearSolverSensSim(void * ida_mem, SUNNonlinearSolver NLS) - The function :c:func:`IDASetNonLinearSolverSensSim` attaches a + The function :c:func:`IDASetNonlinearSolverSensSim` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDAS when using the ``IDA_SIMULTANEOUS`` approach to correct the state and sensitivity variables at the same time. @@ -470,7 +467,7 @@ attaches the nonlinear solver to the main IDAS integrator. .. c:function:: int IDASetNonlinearSolverSensStg(void * ida_mem, SUNNonlinearSolver NLS) - The function :c:func:`IDASetNonLinearSolverSensStg` attaches a + The function :c:func:`IDASetNonlinearSolverSensStg` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDAS when using the ``IDA_STAGGERED`` approach to correct all the sensitivity variables after the correction of the state variables. @@ -823,7 +820,7 @@ detail in the remainder of this section. Sensitivity-related statistics as a group :c:func:`IDAGetSensStats` No. of sens. nonlinear solver iterations :c:func:`IDAGetSensNumNonlinSolvIters` No. of sens. convergence failures :c:func:`IDAGetSensNumNonlinSolvConvFails` - Sens. nonlinear solver statistics as a group :c:func:`IDAGetSensNonlinSolveStats` + Sens. nonlinear solver statistics as a group :c:func:`IDAGetSensNonlinSolvStats` ================================================================ ================================================ @@ -844,7 +841,7 @@ detail in the remainder of this section. .. c:function:: int IDAGetNumResEvalsSens(void * ida_mem, long int * nfevalsS) - The function :c:func:`IDAGetNumResEvalsSEns` returns the number of calls to the + The function :c:func:`IDAGetNumResEvalsSens` returns the number of calls to the user's residual function due to the internal finite difference approximation of the sensitivity residuals. diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index a948afc5ca..69f3e29842 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -621,7 +621,7 @@ IDAS integrator. We note that at present, the ``SUNNonlinearSolver`` object .. c:function:: int IDASetNonlinearSolver(void* ida_mem, SUNNonlinearSolver NLS) - The function :c:func:`IDASetNonLinearSolver` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDAS. + The function :c:func:`IDASetNonlinearSolver` attaches a ``SUNNonlinearSolver`` object (``NLS``) to IDAS. **Arguments:** * ``ida_mem`` -- pointer to the IDAS solver object. @@ -3516,7 +3516,7 @@ Jacobian-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`IDALsJacTimesSetupFn`, defined as follows: -.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, ealtype cj, void *user_data); +.. c:type:: int (*IDALsJacTimesSetupFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, sunrealtype cj, void *user_data); This function setups any data needed by :math:`Jv` product function (see :c:type:`IDALsJacTimesVecFn`). diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 82e654e5a0..f9125ae927 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -186,7 +186,7 @@ leverage the new SUNDIALS error handling capabilities. * From ``sundials_memory.h`` - * :c:func:`SUNMemorNewEmpty` + * :c:func:`SUNMemoryNewEmpty` * :c:func:`SUNMemoryHelper_Alias` * :c:func:`SUNMemoryHelper_Wrap` @@ -419,9 +419,9 @@ solver, linear solver, and other statistics in one call. The file ``scripts/sundials_csv.py`` contains functions for parsing the comma-separated value output files. -The behavior of :c:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :c:func:`N_VSetKernelExecPolicy_Sycl`. +cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. @@ -536,7 +536,7 @@ deprecated. The generic :c:func:`N_VCloneVectorArray` and The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKerrnelExecPolicy_Cuda` +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and @@ -831,7 +831,7 @@ linear systems. See :numref:`SUNLinSol.OneMklDense` for more details. This modu experimental and is subject to change from version to version. Added a new *optional* function to the SUNLinearSolver API, ``SUNLinSolSetZeroGuess``, to indicate that the next call to -``SUNlinSolSolve`` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the +``SUNLinSolSolve`` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the ``SUNLinSolNewEmpty`` constructor will, at a minimum, need set the ``setzeroguess`` function pointer in the linear solver ``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver implementations have been updated to leverage this new set function to remove one dot product per solve. diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index ad1123393a..1079ea0b25 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -458,8 +458,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error. +========================================================+==================================+==============================+ | **KINSOL main solver** | | | +--------------------------------------------------------+----------------------------------+------------------------------+ - | Info handler function | :c:func:`KINSetInfoHandlerFn` | internal fn. | - +--------------------------------------------------------+----------------------------------+------------------------------+ | Data for problem-defining function | :c:func:`KINSetUserData` | ``NULL`` | +--------------------------------------------------------+----------------------------------+------------------------------+ | Max. number of nonlinear iterations | :c:func:`KINSetNumMaxIters` | 200 | @@ -1164,7 +1162,7 @@ difference quotient approximation that comes with the KINLS solver interface. A user-defined Jacobian-vector function must be of type :c:type:`KINLsJacTimesVecFn` -and can be specified through a call to :c:func:`KINLsSetJacTimesVecFn` (see +and can be specified through a call to :c:func:`KINSetJacTimesVecFn` (see :numref:`KINSOL.Usage.CC.user_fct_sim.jtimesFn` for specification details). The pointer ``user_data`` received through :c:func:`KINSetUserData` (or a pointer to ``NULL`` if ``user_data`` was not specified) is passed to the Jacobian-times-vector function @@ -1593,7 +1591,7 @@ The following optional outputs are available from the KINLS modules: .. c:function:: int KINGetNumLinFuncEvals(void * kin_mem, long int * nrevalsLS) - The function :c:func:`KINGetNumLinResEvals` returns the cumulative number of + The function :c:func:`KINGetNumLinFuncEvals` returns the cumulative number of calls to the user residual function due to the finite difference Jacobian approximation or finite difference Jacobian-vector product approximation. @@ -1724,7 +1722,7 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. **Notes:** - If the KINLS setup function failed (i.e., :c:func:`KINSolve` returned + If the KINLS setup function failed (i.e., :c:func:`KINSol` returned ``KIN_LSETUP_FAIL``) when using the :ref:`SUNLINSOL_DENSE <SUNLinSol_Dense>` or :ref:`SUNLINSOL_BAND <SUNLinSol_Band>` modules, then the value of ``lsflag`` is equal to the column index (numbered from one) at which a zero @@ -1735,7 +1733,7 @@ The following optional outputs are available from the KINLS modules: object, then ``lsflag`` will be ``SUNLS_PSET_FAIL_UNREC``, ``SUNLS_ASET_FAIL_UNREC``, or ``SUN_ERR_EXT_FAIL``. - If the KINLS solve function failed (:c:func:`KINSolve` returned ``KIN_LSOLVE_FAIL``), + If the KINLS solve function failed (:c:func:`KINSol` returned ``KIN_LSOLVE_FAIL``), ``lsflag`` contains the error return flag from the ``SUNLinearSolver`` object, which will be one of: ``SUN_ERR_ARG_CORRUPTRRUPT``, indicating that the ``SUNLinearSolver`` memory is ``NULL``; ``SUNLS_ATIMES_FAIL_UNREC``, @@ -2245,7 +2243,7 @@ user main program presented in :numref:`KINSOL.Usage.CC.skeleton_sim` are not bo The user-callable functions that initialize or re-initialize the KINBBDPRE preconditioner module are described next. -.. c:function:: int KINBBDPrecInit(void* kin_mem, sunindextype Nlocal, sunindextype mudq, sunindexype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dq_rel_u, KINBBDLocalFn Gloc, KINBBDCommFn Gcomm) +.. c:function:: int KINBBDPrecInit(void* kin_mem, sunindextype Nlocal, sunindextype mudq, sunindextype mldq, sunindextype mukeep, sunindextype mlkeep, sunrealtype dq_rel_u, KINBBDLocalFn Gloc, KINBBDCommFn Gcomm) The function :c:func:`KINBBDPrecInit` initializes and allocates memory for the KINBBDPRE preconditioner. diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index d1131ecd43..e9321ad9cd 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -326,7 +326,7 @@ operations below. .. c:function:: sunrealtype N_VDotProd(N_Vector x, N_Vector z) - Returns the value of the dot-product of the ``N_Vectors`` *x* and *y*: + Returns the value of the dot-product of the vectors *x* and *y*: .. math:: d = \sum_{i=0}^{n-1} x_i y_i. @@ -399,7 +399,7 @@ operations below. m = N_VMin(x); -.. c:function:: sunrealtype N_VWl2Norm(N_Vector x, N_Vector w) +.. c:function:: sunrealtype N_VWL2Norm(N_Vector x, N_Vector w) Returns the weighted Euclidean :math:`l_2` norm of the ``N_Vector`` *x* with ``sunrealtype`` weight vector *w*: diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index acc8036257..3f6436d249 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -282,7 +282,7 @@ function pointer ``NULL`` instead of supplying a dummy routine. .. c:function:: SUNErrCode SUNLinSolSetScalingVectors(SUNLinearSolver LS, N_Vector s1, N_Vector s2) This *optional* routine provides left/right scaling vectors for the - linear system solve. Here, *s1* and *s2* are ``N_Vectors`` of positive + linear system solve. Here, *s1* and *s2* are vectors of positive scale factors containing the diagonal of the matrices :math:`S_1` and :math:`S_2` from :eq:`eq:transformed_linear_system_components`, respectively. Neither vector needs to be tested for positivity, and a ``NULL`` argument for either @@ -302,7 +302,7 @@ function pointer ``NULL`` instead of supplying a dummy routine. .. c:function:: SUNErrCode SUNLinSolSetZeroGuess(SUNLinearSolver LS, sunbooleantype onoff) - This *optional* routine indicates if the upcoming :c:func:`SUNlinSolSolve` call + This *optional* routine indicates if the upcoming :c:func:`SUNLinSolSolve` call will be made with a zero initial guess (``SUNTRUE``) or a non-zero initial guess (``SUNFALSE``). diff --git a/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst b/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst index 91da9e8245..b003e26039 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst @@ -44,10 +44,10 @@ The SUNMATRIX_GINKGO module is defined by the ``sundials::ginkgo::Matrix`` templ .. _SUNMatrix.Ginkgo.CompatibleNVectors: -Compatible ``N_Vectors`` ------------------------- +Compatible Vectors +------------------ -The ``N_Vector`` to use with the SUNLINEARSOLVER_GINKGO module depends on the ``gko::Executor`` +The :c:type:`N_Vector` to use with the SUNLINEARSOLVER_GINKGO module depends on the ``gko::Executor`` utilized. That is, when using the ``gko::CudaExecutor`` you should use a CUDA capable ``N_Vector`` (e.g., :numref:`NVectors.CUDA`), ``gko::HipExecutor`` goes with a HIP capable ``N_Vector`` (e.g., :numref:`NVectors.HIP`), ``gko::DpcppExecutor`` goes with a DPC++/SYCL capable ``N_Vector`` (e.g., @@ -57,7 +57,7 @@ executors is where they store the data. The GPU enabled Ginkgo executors need th the GPU, so the ``N_Vector`` must implement :c:func:`N_VGetDeviceArrayPointer` and keep the data in GPU memory. The CPU-only enabled Ginkgo executors (e.g, ``gko::OmpExecutor`` and ``gko::ReferenceExecutor``) need data to reside on the CPU and will use -:c:func:`N_VGetArraryPointer` to access the ``N_Vector`` data. +:c:func:`N_VGetArrayPointer` to access the ``N_Vector`` data. .. _SUNMatrix.Ginkgo.Usage: diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index 244a553215..6a21325a19 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -36,9 +36,9 @@ SUNNonlinearSolver core functions ----------------------------------------------------- The core nonlinear solver functions consist of two required functions to get the -nonlinear solver type (:c:func:`SUNNonlinsSolGetType`) and solve the nonlinear system +nonlinear solver type (:c:func:`SUNNonlinSolGetType`) and solve the nonlinear system (:c:func:`SUNNonlinSolSolve`). The remaining three functions for nonlinear solver -initialization (:c:func:`SUNNonlinSolInitialization`), setup +initialization (:c:func:`SUNNonlinSolInitialize`), setup (:c:func:`SUNNonlinSolSetup`), and destruction (:c:func:`SUNNonlinSolFree`) are optional. @@ -92,7 +92,7 @@ initialization (:c:func:`SUNNonlinSolInitialization`), setup A :c:type:`SUNErrCode`. **Notes:** - SUNDIALS integrators call :c:func:`SUNonlinSolSetup` before + SUNDIALS integrators call :c:func:`SUNNonlinSolSetup` before each step attempt. SUNNonlinSol implementations that do not require setup may set this operation to ``NULL``. @@ -582,7 +582,7 @@ A SUNNonlinSol implementation *must* do the following: To aid in the creation of custom ``SUNNonlinearSolver`` modules, the generic ``SUNNonlinearSolver`` module provides the utility functions -:c:func:`SUNNonlinSolNewEmpty` and :c:func:`SUNNonlinsolFreeEmpty`. When used +:c:func:`SUNNonlinSolNewEmpty` and :c:func:`SUNNonlinSolFreeEmpty`. When used in custom ``SUNNonlinearSolver`` constructors these functions will ease the introduction of any new optional nonlinear solver operations to the ``SUNNonlinearSolver`` API by ensuring that only required operations need to diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst index 7822e0d298..09185168a0 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_FixedPoint.rst @@ -253,9 +253,9 @@ allocated within the *content* field: * ``R`` -- small matrix used in acceleration algorithm (length ``m*m``), * ``gamma`` -- small vector used in acceleration algorithm (length ``m``), * ``cvals`` -- small vector used in acceleration algorithm (length ``m+1``), -* ``df`` -- array of ``N_Vectors`` used in acceleration algorithm (length ``m``), -* ``dg`` -- array of ``N_Vectors`` used in acceleration algorithm (length ``m``), -* ``q`` -- array of ``N_Vectors`` used in acceleration algorithm (length ``m``), -* ``Xvecs`` -- ``N_Vector`` pointer array used in acceleration algorithm (length ``m+1``), -* ``fold`` -- ``N_Vector`` used in acceleration algorithm, and -* ``gold`` -- ``N_Vector`` used in acceleration algorithm. +* ``df`` -- array of vectors used in acceleration algorithm (length ``m``), +* ``dg`` -- array of vectors used in acceleration algorithm (length ``m``), +* ``q`` -- array of vectors used in acceleration algorithm (length ``m``), +* ``Xvecs`` -- vector pointer array used in acceleration algorithm (length ``m+1``), +* ``fold`` -- vector used in acceleration algorithm, and +* ``gold`` -- vector used in acceleration algorithm. diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst index 8ab1a265db..55192f4485 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_Newton.rst @@ -81,7 +81,7 @@ solvers). Specifically, SUNNonlinSol_Newton will call the :c:type:`SUNNonlinSolLSetupFn()` function. Whether the Jacobian matrix :math:`A` is fully or partially updated depends -on logic unique to each integrator-supplied :c:type:`SUNNonlinSolSetupFn` +on logic unique to each integrator-supplied :c:type:`SUNNonlinSolLSetupFn` routine. We refer to the discussion of nonlinear solver strategies provided in the package-specific Mathematics section of the documentation for details. diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst index e0217dd4de..e9d9c856f1 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst @@ -127,7 +127,7 @@ user-callable functions. A :c:type:`SUNErrCode` -.. c:function:: SUNErrCode SUNNonlinSolGetPetscError_PetscSNES(SUNNonlinearSolver NLS, PestcErrorCode* error) +.. c:function:: SUNErrCode SUNNonlinSolGetPetscError_PetscSNES(SUNNonlinearSolver NLS, PetscErrorCode* error) This gets the last error code returned by the last internal call to a PETSc API function. diff --git a/doc/superbuild/source/developers/testing/Answers.rst b/doc/superbuild/source/developers/testing/Answers.rst index 493ed9ed58..e04b9278c2 100644 --- a/doc/superbuild/source/developers/testing/Answers.rst +++ b/doc/superbuild/source/developers/testing/Answers.rst @@ -67,9 +67,9 @@ is expected/desired. Changing output files requires careful verification that th machines by going to `<https://github.com/LLNL/sundials/actions>`_ finding your failing test, clicking it, then at the bottom downloading the "output_files" artifact (you can also find your failing test at the bottom of a PR). The downloaded zip file will be the SUNDIALS build - directory. To update just the failed files you can use ``scripts/updateOutFiles.py ``e.g., + directory. To update just the failed files you can use ``scripts/updateOutFiles.py`` e.g., - .. code:: + .. code:: console cd scripts ./updateOutFiles.py <source path> <destination path> @@ -85,7 +85,7 @@ is expected/desired. Changing output files requires careful verification that th #. If you need to use ssh authentication for pushing to GitHub, then you may need to update the remote for the submodule: - .. code:: + .. code:: console git remote set-url origin git@github.com:sundials-codes/answers.git diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index d1e994f05d..ec31375447 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -2057,7 +2057,7 @@ int CVodeSensReInit(void* cvode_mem, int ism, N_Vector* yS0) * CVodeSensSVtolerances specifies scalar relative tolerance and a vector * absolute tolerance for each sensitivity vector (a potentially different * absolute tolerance for each vector component). - * CVodeEEtolerances specifies that tolerances for sensitivity variables + * CVodeSensEEtolerances specifies that tolerances for sensitivity variables * should be estimated from those provided for the state variables. */ From 402b8e604360985eff7091af15f6e3a48001d2f7 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Tue, 19 Mar 2024 09:39:09 -0700 Subject: [PATCH 016/137] Docs: Add missing version to SUNAdaptController (#442) Correct `versionadded` in SUNAdaptController docs --------- Co-authored-by: David J. Gardner <gardner48@llnl.gov> --- .../sunadaptcontroller/SUNAdaptController_Description.rst | 2 +- scripts/updateVersion.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index 87fc04c6e0..c5c02ceb44 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -16,7 +16,7 @@ The SUNAdaptController API ========================== -.. versionadded:: x.x.x +.. versionadded:: 6.7.0 The SUNAdaptController base class provides a common API for accuracy-based adaptivity controllers to be used by SUNDIALS integrators. These controllers estimate step diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index fa3958b75b..ef73961ecc 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -369,6 +369,11 @@ sedi '117s/.*/\ \ note = {v'${kin_ver}'}/' $fn fn="../CHANGELOG.md" sedi "s/x.x.x/${sun_ver}/gI" $fn +for fn in $(grep -Iirl "x.x.x" ../doc/shared/*) +do + sedi "s/x.x.x/${sun_ver}/gI" $fn +done + for fn in $(grep -Iirl "x.x.x" ../doc/arkode/guide/source/*) do sedi "s/x.x.x/${ark_ver}/gI" $fn From 1c83b63c84887944a671ca64b3f8f45751cf520f Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 21 Mar 2024 08:03:41 -0700 Subject: [PATCH 017/137] Docs: Combine RST Changelogs (#441) * Combine the package "Changes in" sections into a single shared RST changelog. * Move the most recent changes to a separate file that can be included in the Introduction chapter of each package with the rest of the changelog (including the recent changes) as an appendix. * Use the `intersphinx` package to make links to other package functions and sections work with the combined changelog i.e., references to other package functions and sections will link to the online documentation. This should help with converting the latex example docs to RST. Note, that `:ref:` must be used when referring to Chapters/Sections as `:numref:` does not work in this case. * Sync `CHANGELOG.md` and `Changelog.rst` to make them consistent * Add a `Makefile` to build all the RST docs at once * Add a script to start a new release cycle, copies recent changes into the changelog and clears the recent changes file. * Builds the docs for PRs --------- Co-authored-by: Balos, Cody, J <balos1@llnl.gov> --- CHANGELOG.md | 2689 +++++++++----- doc/Makefile | 44 + doc/arkode/guide/source/Changelog_link.rst | 13 + doc/arkode/guide/source/Introduction.rst | 2166 +---------- .../guide/source/RecentChanges_link.rst | 13 + doc/arkode/guide/source/conf.py | 6 +- doc/arkode/guide/source/index.rst | 1 + doc/cvode/guide/source/Changelog_link.rst | 13 + doc/cvode/guide/source/Introduction.rst | 1860 +--------- doc/cvode/guide/source/RecentChanges_link.rst | 13 + doc/cvode/guide/source/conf.py | 6 +- doc/cvode/guide/source/index.rst | 1 + doc/cvodes/guide/source/Changelog_link.rst | 13 + doc/cvodes/guide/source/Introduction.rst | 1939 +--------- .../guide/source/RecentChanges_link.rst | 13 + doc/cvodes/guide/source/conf.py | 6 +- doc/cvodes/guide/source/index.rst | 1 + doc/ida/guide/source/Changelog_link.rst | 13 + doc/ida/guide/source/Introduction.rst | 1865 +--------- doc/ida/guide/source/RecentChanges_link.rst | 13 + doc/ida/guide/source/conf.py | 6 +- doc/ida/guide/source/index.rst | 1 + doc/idas/guide/source/Changelog_link.rst | 13 + doc/idas/guide/source/Introduction.rst | 1818 +-------- doc/idas/guide/source/RecentChanges_link.rst | 13 + doc/idas/guide/source/conf.py | 6 +- doc/idas/guide/source/index.rst | 1 + doc/kinsol/guide/source/Changelog_link.rst | 13 + doc/kinsol/guide/source/Introduction.rst | 1478 +------- .../guide/source/RecentChanges_link.rst | 13 + doc/kinsol/guide/source/conf.py | 6 +- doc/kinsol/guide/source/index.rst | 1 + doc/shared/Changelog.rst | 3277 +++++++++++++++++ doc/shared/RecentChanges.rst | 10 + doc/shared/versions.py | 1 + doc/superbuild/Makefile | 2 +- doc/superbuild/source/Changelog_link.rst | 13 + doc/superbuild/source/RecentChanges_link.rst | 13 + .../source/developers/testing/Answers.rst | 22 +- doc/superbuild/source/index.rst | 1 + scripts/startReleaseCycle.sh | 98 + scripts/tarscript | 9 + scripts/updateVersion.sh | 36 +- 43 files changed, 5424 insertions(+), 12115 deletions(-) create mode 100644 doc/Makefile create mode 100644 doc/arkode/guide/source/Changelog_link.rst create mode 100644 doc/arkode/guide/source/RecentChanges_link.rst create mode 100644 doc/cvode/guide/source/Changelog_link.rst create mode 100644 doc/cvode/guide/source/RecentChanges_link.rst create mode 100644 doc/cvodes/guide/source/Changelog_link.rst create mode 100644 doc/cvodes/guide/source/RecentChanges_link.rst create mode 100644 doc/ida/guide/source/Changelog_link.rst create mode 100644 doc/ida/guide/source/RecentChanges_link.rst create mode 100644 doc/idas/guide/source/Changelog_link.rst create mode 100644 doc/idas/guide/source/RecentChanges_link.rst create mode 100644 doc/kinsol/guide/source/Changelog_link.rst create mode 100644 doc/kinsol/guide/source/RecentChanges_link.rst create mode 100644 doc/shared/Changelog.rst create mode 100644 doc/shared/RecentChanges.rst create mode 100644 doc/superbuild/source/Changelog_link.rst create mode 100644 doc/superbuild/source/RecentChanges_link.rst create mode 100755 scripts/startReleaseCycle.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e0c138a0f..6d1f5716a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release X.X.X +## Changes to SUNDIALS in release X.Y.Z Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default @@ -26,6 +26,10 @@ SUNDIALS now requires using a compiler that supports a subset of the C99 standard. Note with the Microsoft C/C++ compiler the subset of C99 features utilized by SUNDIALS are available starting with [Visual Studio 2015](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1). +#### Minimum CMake Version + +CMake 3.18 or newer is now required when building SUNDIALS. + #### Deprecated Types and Functions Removed The previously deprecated types `realtype` and `booleantype` were removed from @@ -47,9 +51,9 @@ and [Logging](https://sundials.readthedocs.io/en/latest/sundials/Logging_link.html) sections in the documentation. -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: +In addition the following names/symbols were replaced by `SUN_ERR_*` codes: -| Removed | Replaced with ``SUNErrCode`` | +| Removed | Replaced with `SUNErrCode` | |:-------------------------------|:----------------------------------| | `SUNLS_SUCCESS` | `SUN_SUCCESS` | | `SUNLS_UNRECOV_FAILURE` | no replacement (value was unused) | @@ -94,6 +98,10 @@ communicator in place of `MPI_Comm` throughout the SUNDIALS API with a `SUNComm`, which is just a typedef to an `int` in builds without MPI and a typedef to a `MPI_Comm` in builds with MPI. As a result: +- When MPI is enabled, all SUNDIALS libraries will include MPI symbols and + applications will need to include the path for MPI headers and link against + the corresponding MPI library. + - All users will need to update their codes because the call to `SUNContext_Create` now takes a `SUNComm` instead of type-erased pointer to a communicator. For non-MPI codes, @@ -143,8 +151,38 @@ fsundials_profiler_mod fsundials_types_mod ``` +### Minor Changes + +The `CMAKE_BUILD_TYPE` defaults to `RelWithDebInfo` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from `SUNDIALS_F77_FUNC_CASE` and +`SUNDIALS_F77_FUNC_UNDERSCORES` to `SUNDIALS_LAPACK_CASE` and +`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + +As a subset of C99 is now required the CMake option `USE_GENERIC_MATH` as been +removed. + +The C++ convenience classes (e.g., `sundials::Context`) have been moved to +from SUNDIALS `.h` headers to corresponding `.hpp` headers (e.g., +`sundials/sundials_context.hpp`) so C++ codes do not need to compile with +C++14 support when using the C API. -### Deprecation notice +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + +### Bug Fixes + +Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregate initialization can be used. + +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +[#409](https://github.com/LLNL/sundials/issues/409) and +[#249](https://github.com/LLNL/sundials/issues/249). + +### Deprecation Notice The functions in `sundials_math.h` will be deprecated in the next release. @@ -166,29 +204,10 @@ sundials_dense.h sundials_band.h ``` -### Minor Changes - -Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -[#409](https://github.com/LLNL/sundials/issues/409) and -[#249](https://github.com/LLNL/sundials/issues/249). - -The `CMAKE_BUILD_TYPE` defaults to `RelWithDebInfo` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from `SUNDIALS_F77_FUNC_CASE` and -`SUNDIALS_F77_FUNC_UNDERSCORES` to `SUNDIALS_LAPACK_CASE` and -`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - ## Changes to SUNDIALS in release 6.7.0 +### Major Feature + 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. @@ -196,6 +215,13 @@ Added `ARKStepSetAdaptController` and `ERKStepSetAdaptController` routines so that users can modify controller parameters, or even provide custom implementations. +### New Features + +Improved computational complexity of `SUNMatScaleAddI_Sparse` from `O(M*N)` to +`O(NNZ)`. + +Added Fortran support for the LAPACK dense `SUNLinearSolver` implementation. + Added the routines `ARKStepSetAdaptivityAdjustment` and `ERKStepSetAdaptivityAdjustment`, that allow users to adjust the value for the method order supplied to the temporal adaptivity controllers. @@ -215,10 +241,15 @@ 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. -Improved computational complexity of `SUNMatScaleAddI_Sparse` from `O(M*N)` to -`O(NNZ)`. +The `MRIStepInnerStepper` class in MRIStep was updated to make supplying an +`MRIStepInnerFullRhsFn` optional. -Added Fortran support for the LAPACK dense `SUNLinearSolver` implementation. +### Bug Fixes + +Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case. +This fixes [GitHub Issue #312](https://github.com/LLNL/sundials/issues/312). + +Fixed scaling bug in `SUNMatScaleAddI_Sparse` for non-square matrices. 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 @@ -239,14 +270,6 @@ Runge--Kutta Butcher table pair. Fixed a bug in `MRIStepCoupling_Write` where explicit coupling tables were not written to the output file pointer. -The `MRIStepInnerStepper` class in MRIStep was updated to make supplying an -`MRIStepInnerFullRhsFn` optional. - -Fixed scaling bug in `SUNMatScaleAddI_Sparse` for non-square matrices. - -Changed the `SUNProfiler` so that it does not rely on `MPI_WTime` in any case. -This fixes [GitHub Issue #312](https://github.com/LLNL/sundials/issues/312). - Fixed missing soversions in some `SUNLinearSolver` and `SUNNonlinearSolver` CMake targets. @@ -255,13 +278,17 @@ built together in the same binary. ## Changes to SUNDIALS in release 6.6.2 -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. +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. ## Changes to SUNDIALS in release 6.6.1 +### New Features + Updated the Tpetra NVector interface to support Trilinos 14. +### Bug Fixes + Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper object. @@ -273,16 +300,16 @@ this case. ## Changes to SUNDIALS in release 6.6.0 +### Major Features + A new time-stepping module, `SPRKStep`, was added to ARKODE. This time-stepper provides explicit symplectic partitioned Runge-Kutta methods up to order 10 for separable Hamiltonian systems. -Added support for relaxation Runge-Kutta methods to ERKStep and ARKStep in +Added support for relaxation Runge-Kutta methods in ERKStep and ARKStep in ARKODE. -Added the second order IMEX method from Giraldo, Kelly, and Constantinescu 2013 -as the default second order IMEX method in ARKStep. The explicit table is given -by `ARKODE_ARK2_ERK_3_1_2` and the implicit table by `ARKODE_ARK2_DIRK_3_1_2`. +### New Features Updated CVODE, CVODES and ARKODE default behavior when returning the solution when the internal time has reached a user-specified stop time. Previously, the output @@ -291,26 +318,30 @@ internal solution vector. Users who wish to revert to interpolation may call a routine `CVodeSetInterpolateStopTime`, `ARKStepSetInterpolateStopTime`, `ERKStepSetInterpolateStopTime`, or `MRIStepSetInterpolateStopTime`. +Added the second order IMEX method from Giraldo, Kelly, and Constantinescu 2013 +as the default second order IMEX method in ARKStep. The explicit table is given +by `ARKODE_ARK2_ERK_3_1_2` and the implicit table by `ARKODE_ARK2_DIRK_3_1_2`. + +Updated the F2003 utility routines `SUNDIALSFileOpen` and `SUNDIALSFileClose` +to support user specification of `stdout` and `stderr` strings for the output +file names. + +## Bug Fixes + A potential bug was fixed when using inequality constraint handling and calling `ARKStepGetEstLocalErrors` or `ERKStepGetEstLocalErrors` after a failed step in which an inequality constraint violation occurred. In this case, the values returned by `ARKStepGetEstLocalErrors` or `ERKStepGetEstLocalErrors` may have been invalid. -Updated the F2003 utility routines `SUNDIALSFileOpen` and `SUNDIALSFileClose` -to support user specification of `stdout` and `stderr` strings for the output -file names. - ## Changes to SUNDIALS in release 6.5.1 +### New Features + Added the functions `ARKStepClearStopTime`, `ERKStepClearStopTime`, `MRIStepClearStopTime`, `CVodeClearStopTime`, and `IDAClearStopTime` to disable a previously set stop time. -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the `icx` compiler. - The default interpolant in ARKODE when using a first order method has been updated to a linear interpolant to ensure values obtained by the integrator are returned at the ends of the time interval. To restore the previous behavior of @@ -318,8 +349,21 @@ using a constant interpolant call `ARKStepSetInterpolantDegree`, `ERKStepSetInterpolantDegree`, or `MRIStepSetInterpolantDegree` and set the interpolant degree to zero before evolving the problem. +### Bug Fixes + +Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. + +Fixed compilation errors in some SYCL examples when using the `icx` compiler. + ## Changes to SUNDIALS in release 6.5.0 +### New Features + +A new capability to keep track of memory allocations made through the `SUNMemoryHelper` +classes has been added. Memory allocation stats can be accessed through the +`SUNMemoryHelper_GetAllocStats` function. See the documentation for +the `SUNMemoryHelper` classes for more details. + Added the functions `ARKStepGetJac`, `ARKStepGetJacTime`, `ARKStepGetJacNumSteps`, `MRIStepGetJac`, `MRIStepGetJacTime`, `MRIStepGetJacNumSteps`, `CVodeGetJac`, `CVodeGetJacTime`, @@ -327,10 +371,14 @@ Added the functions `ARKStepGetJac`, `ARKStepGetJacTime`, `IDAGetJacNumSteps`, `KINGetJac`, `KINGetJacNumIters` to assist in debugging simulations utilizing a matrix-based linear solver. +Added support for CUDA 12. + Added support for the SYCL backend with RAJA 2022.x.y. +### Bug Fixes + Fixed an underflow bug during root finding in ARKODE, CVODE, CVODES, IDA and -IDAS. +IDAS. This fixes [GitHub Issue #57](https://github.com/LLNL/sundials/issues/57>). Fixed an issue with finding oneMKL when using the `icpx` compiler with the `-fsycl` flag as the C++ compiler instead of `dpcpp`. @@ -343,13 +391,6 @@ bounds checking will now work. Fixed an implicit conversion error in the Butcher table for ESDIRK5(4)7L[2]SA2. -A new capability to keep track of memory allocations made through the `SUNMemoryHelper` -classes has been added. Memory allocation stats can be accessed through the -`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the `SUNMemoryHelper` classes for more details. - -Added support for CUDA 12. - ## Changes to SUNDIALS in release 6.4.1 Fixed a bug with the Kokkos interfaces that would arise when using clang. @@ -362,14 +403,14 @@ which would cause the tests to fail on some platforms. ## Changes to SUNDIALS in release 6.4.0 +### New Requirements + CMake 3.18.0 or newer is now required for CUDA support. A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. +e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, Ginkgo, and Kokkos. -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. +### Major Features Added support for the [Ginkgo](https://ginkgo-project.github.io/) linear algebra library. This support includes new `SUNMatrix` and `SUNLinearSolver` @@ -382,10 +423,18 @@ performance portability, see the `NVECTOR_KOKKOS`, `SUNMATRIX_KOKKOSDENSE` and `SUNLINEARSOLVER_KOKKOSDENSE` sections in the documentation for more information. +### New Features + +Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed +support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and +declaration bug in SuperLU_DIST matrix constructor. + Added the functions `ARKStepSetTableName`, `ERKStepSetTableName`, `MRIStepCoupling_LoadTableByName`, `ARKodeButcherTable_LoadDIRKByName`, and `ARKodeButcherTable_LoadERKByName` to load a table from a string. +### Bug Fixes + Fixed a bug in the CUDA and HIP vectors where `N_VMaxNorm` would return the minimum positive floating-point value for the zero vector. @@ -398,15 +447,16 @@ deallocated when calling `CVodeFree`. ## Changes to SUNDIALS in release 6.3.0 +### New Features + Added `GetUserData` functions in each package to retrieve the user data pointer provided to `SetUserData` functions. See `ARKStepGetUserData`, `ERKStepGetUserData`, `MRIStepGetUserData`, `CVodeGetUserData`, `IDAGetUserData`, or `KINGetUserData` for more information. -Fixed a bug in `ERKStepReset`, `ERKStepReInit`, `ARKStepReset`, `ARKStepReInit`, -`MRIStepReset`, and `MRIStepReInit` where a previously-set value of *tstop* (from -a call to `ERKStepSetStopTime`, `ARKStepSetStopTime`, or `MRIStepSetStopTime`, -respectively) would not be cleared. +Added a variety of embedded DIRK methods from [Kennedy & Carpenter, +NASA TM-2016-219173, 2016] and [Kennedy & Carpenter, Appl. Numer. Math., 146, 2019] to +ARKODE. Updated `MRIStepReset` to call the corresponding `MRIStepInnerResetFn` with the same (*tR*,*yR*) arguments for the `MRIStepInnerStepper` object that is used to evolve the @@ -416,9 +466,12 @@ Added a new [example](examples/cvode/serial/cvRocket_dns.c) which demonstrates using CVODE with a discontinuous right-hand-side function and rootfinding. -Added a variety of embedded DIRK methods from [Kennedy & Carpenter, -NASA TM-2016-219173, 2016] and [Kennedy & Carpenter, Appl. Numer. Math., 146, 2019] to -ARKODE. +### Bug Fixes + +Fixed a bug in `ERKStepReset`, `ERKStepReInit`, `ARKStepReset`, `ARKStepReInit`, +`MRIStepReset`, and `MRIStepReInit` where a previously-set value of *tstop* (from +a call to `ERKStepSetStopTime`, `ARKStepSetStopTime`, or `MRIStepSetStopTime`, +respectively) would not be cleared. Fixed the unituitive behavior of the `USE_GENERIC_MATH` CMake option which caused the double precision math functions to be used regardless of the value of @@ -426,48 +479,39 @@ caused the double precision math functions to be used regardless of the value of functions when they are available and the user may provide the math library to link to via the advanced CMake option `SUNDIALS_MATH_LIBRARY`. -Changed `SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. +Changed `SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. This +fixes [GitHub Issue #177](https://github.com/LLNL/sundials/issues/177). ## Changes to SUNDIALS in release 6.2.0 +### Major Features + Added the `SUNLogger` API which provides a SUNDIALS-wide mechanism for logging of errors, warnings, informational output, and debugging output. -Deprecated the following functions, it is recommended to use the `SUNLogger` API -instead. - -* `ARKStepSetDiagnostics` -* `ERKStepSetDiagnostics` -* `MRIStepSetDiagnostics` -* `KINSetInfoFile` -* `SUNNonlinSolSetPrintLevel_Newton` -* `SUNNonlinSolSetInfoFile_Newton` -* `SUNNonlinSolSetPrintLevel_FixedPoint` -* `SUNNonlinSolSetInfoFile_FixedPoint` -* `SUNLinSolSetInfoFile_PCG` -* `SUNLinSolSetPrintLevel_PCG` -* `SUNLinSolSetInfoFile_SPGMR` -* `SUNLinSolSetPrintLevel_SPGMR` -* `SUNLinSolSetInfoFile_SPFGMR` -* `SUNLinSolSetPrintLevel_SPFGMR` -* `SUNLinSolSetInfoFile_SPTFQM` -* `SUNLinSolSetPrintLevel_SPTFQMR` -* `SUNLinSolSetInfoFile_SPBCGS` -* `SUNLinSolSetPrintLevel_SPBCGS` +Added support to CVODES for integrating IVPs with constraints using BDF methods +and projecting the solution onto the constraint manifold with a user defined +projection function. This implementation is accompanied by additions to the +CVODES user documentation and examples. -The `SUNLinSolSetInfoFile_**` and `SUNNonlinSolSetInfoFile_*` family of -functions are now enabled by setting the CMake option `SUNDIALS_LOGGING_LEVEL` -to a value `>= 3`. +### New Features Added the function `SUNProfiler_Reset` to reset the region timings and counters to zero. -Added the functions `ARKStepPrintAllStats`, `ERKStepPrintAllStats`, -`MRIStepPrintAll`, `CVodePrintAllStats`, `IDAPrintAllStats`, and -`KINPrintAllStats` to output all of the integrator, nonlinear solver, linear -solver, and other statistics in one call. The file `scripts/sundials_csv.py` -contains functions for parsing the comma-separated value output files. +Added the following functions to output all of the integrator, nonlinear solver, +linear solver, and other statistics in one call: + +* `ARKStepPrintAllStats` +* `ERKStepPrintAllStats` +* `MRIStepPrintAllStats` +* `CVodePrintAllStats` +* `IDAPrintAllStats` +* `KINPrintAllStats` + +The file `scripts/sundials_csv.py` contains functions for parsing the +comma-separated value (CSV) output files when using the CSV output format. Added functions to CVODE, CVODES, IDA, and IDAS to change the default step size adaptivity parameters. For more information see the documentation for: @@ -489,6 +533,15 @@ adaptivity parameters. For more information see the documentation for: * `IDASetEtaMinErrFail` * `IDASetEtaConvFail` +Added the functions `ARKStepSetDeduceImplicitRhs` and +`MRIStepSetDeduceImplicitRhs` to optionally remove an evaluation of the implicit +right-hand side function after nonlinear solves. See the mathematical +considerations section of the user guide for information on using this +optimization. + +Added the function `MRIStepSetOrder` to select the default MRI method of a given +order. + Added the functions `CVodeSetDeltaGammaMaxLSetup` and `CVodeSetDeltaGammaMaxBadJac` in CVODE and CVODES to adjust the `gamma` change thresholds to require a linear solver setup or Jacobian/precondition update, @@ -498,13 +551,12 @@ Added the function `IDASetDetlaCjLSetup` in IDA and IDAS to adjust the parameter that determines when a change in `c_j` requires calling the linear solver setup function. -Added the function `MRIStepSetOrder` to select the default MRI method of a given -order. +Added the function `IDASetMinStep` to set a minimum step size. -Added support to CVODES for integrating IVPs with constraints using BDF methods -and projecting the solution onto the constraint manifold with a user defined -projection function. This implementation is accompanied by additions to the -CVODES user documentation and examples. +### Bug Fixes + +Fixed the `SUNContext` convenience class for C++ users to disallow copy +construction and allow move construction. The behavior of `N_VSetKernelExecPolicy_Sycl` has been updated to be consistent with the CUDA and HIP vectors. The input execution policies are now cloned and @@ -512,26 +564,20 @@ may be freed after calling `N_VSetKernelExecPolicy_Sycl`. Additionally, `NULL` inputs are now allowed and, if provided, will reset the vector execution policies to the defaults. -Fixed the `SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. +A memory leak in the SYCL vector was fixed where the execution policies were not +freed when the vector was destroyed. The include guard in `nvector_mpimanyvector.h` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same +using both the ManyVector and MPIManyVector vector implementations in the same simulation. -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the integrator functions to retrieve the number of nonlinear -solver failures. The failure count returned was the number of failed *steps* due -to a nonlinear solver failure i.e., if a nonlinear solve failed with a stale -Jacobian or preconditioner but succeeded after updating the Jacobian or -preconditioner, the initial failure was not included in the nonlinear solver -failure count. The following functions have been updated to return the total -number of nonlinear solver failures: +A bug was fixed in the ARKODE, CVODE(S), and IDA(S) functions to retrieve the +number of nonlinear solver failures. The failure count returned was the number +of failed *steps* due to a nonlinear solver failure i.e., if a nonlinear solve +failed with a stale Jacobian or preconditioner but succeeded after updating the +Jacobian or preconditioner, the initial failure was not included in the +nonlinear solver failure count. The following functions have been updated to +return the total number of nonlinear solver failures: * `ARKStepGetNumNonlinSolvConvFails` * `ARKStepGetNonlinSolvStats` @@ -548,10 +594,10 @@ number of nonlinear solver failures: * `IDAGetSensNumNonlinSolvConvFails` * `IDAGetSensNonlinSolvStats` -As such users may see an increase in the number of failures reported from the -above functions. The following functions have been added to retrieve the number -of failed steps due to a nonlinear solver failure i.e., the counts previously -returned by the above functions: +As a result of this change users may see an increase in the number of failures +reported from the above functions. The following functions have been added to +retrieve the number of failed steps due to a nonlinear solver failure i.e., the +counts previously returned by the above functions: * `ARKStepGetNumStepSolveFails` * `MRIStepGetNumStepSolveFails` @@ -561,20 +607,57 @@ returned by the above functions: * `IDAGetNumStepSolveFails` * `IDAGetNumStepSensSolveFails` -## Changes to SUNDIALS in release 6.1.1 +Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead +of UNKNOWN IMPORTED. -Fixed exported `SUNDIALSConfig.cmake`. +### Deprecation Notice -Fixed Fortran interface to `MRIStepInnerStepper` and `MRIStepCoupling` -structures and functions. +Deprecated the following functions, it is recommended to use the `SUNLogger` API +instead. + +* `ARKStepSetDiagnostics` +* `ERKStepSetDiagnostics` +* `MRIStepSetDiagnostics` +* `KINSetInfoFile` +* `SUNNonlinSolSetPrintLevel_Newton` +* `SUNNonlinSolSetInfoFile_Newton` +* `SUNNonlinSolSetPrintLevel_FixedPoint` +* `SUNNonlinSolSetInfoFile_FixedPoint` +* `SUNLinSolSetInfoFile_PCG` +* `SUNLinSolSetPrintLevel_PCG` +* `SUNLinSolSetInfoFile_SPGMR` +* `SUNLinSolSetPrintLevel_SPGMR` +* `SUNLinSolSetInfoFile_SPFGMR` +* `SUNLinSolSetPrintLevel_SPFGMR` +* `SUNLinSolSetInfoFile_SPTFQM` +* `SUNLinSolSetPrintLevel_SPTFQMR` +* `SUNLinSolSetInfoFile_SPBCGS` +* `SUNLinSolSetPrintLevel_SPBCGS` + +The `SUNLinSolSetInfoFile_*` and `SUNNonlinSolSetInfoFile_*` family of +functions are now enabled by setting the CMake option `SUNDIALS_LOGGING_LEVEL` +to a value `>= 3`. + +## Changes to SUNDIALS in release 6.1.1 + +### New Features Added new Fortran example program, `examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90` demonstrating MRI capabilities. +### Bug Fixes + +Fixed exported `SUNDIALSConfig.cmake`. + +Fixed Fortran interface to `MRIStepInnerStepper` and `MRIStepCoupling` +structures and functions. + ## Changes to SUNDIALS in release 6.1.0 -Added new reduction implementations for the CUDA and HIP NVECTORs that use +### New Features + +Added new reduction implementations for the CUDA and HIP vectors that use shared memory (local data storage) instead of atomics. These new implementations are recommended when the target hardware does not provide atomic support for the floating point precision that SUNDIALS is being built with. The HIP vector uses @@ -587,15 +670,19 @@ within the build directory (this mirrors the targets exported on installation). `CMAKE_C_STANDARD` is now set to 99 by default. +### Bug Fixes + Fixed exported `SUNDIALSConfig.cmake` when profiling is enabled without Caliper. Fixed `sundials_export.h` include in `sundials_config.h`. -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. +Fixed memory leaks in the SuperLU_MT linear solver interface. ## Changes to SUNDIALS in release 6.0.0 -### SUNContext +### Breaking Changes + +#### SUNContext Object Added SUNDIALS v6.0.0 introduces a new `SUNContext` object on which all other SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, vectors, @@ -608,8 +695,8 @@ SUNDIALS to provide new features, such as the profiling/instrumentation also introduced in this release, while maintaining thread-safety. See the documentation section on the `SUNContext` for more details. -A script `upgrade-to-sundials-6-from-5.sh` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to +The script `upgrade-to-sundials-6-from-5.sh` has been provided with this release +(and obtainable from the GitHub release page) to help ease the transition to SUNDIALS v6.0.0. The script will add a `SUNCTX_PLACEHOLDER` argument to all of the calls to SUNDIALS constructors that now require a `SUNContext` object. It can also update deprecated SUNDIALS constants/types to the new names. It can be @@ -619,17 +706,7 @@ run like this: > ./upgrade-to-sundials-6-from-5.sh <files to update> ``` -### SUNProfiler - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option `SUNDIALS_BUILD_WITH_PROFILING`. A built-in -profiler will be used by default, but the -[Caliper](https://github.com/LLNL/Caliper) library can also be used instead with -the CMake option `ENABLE_CALIPER`. See the documentation section on profiling -for more details. **WARNING**: Profiling will impact performance, and should be -enabled judiciously. - -### SUNMemoryHelper +#### Updated SUNMemoryHelper Function Signatures The `SUNMemoryHelper` functions `Alloc`, `Dealloc`, and `Copy` have been updated to accept an opaque handle as the last input. At a minimum, existing @@ -640,35 +717,16 @@ CUDA/HIP stream or SYCL queue) for the operation. The CUDA, HIP, and SYCL the constructor for the SYCL implementation has been updated to remove the SYCL queue as an input. -### NVector +#### Deprecated Functions Removed -Two new optional vector operations, `N_VDotProdMultiLocal` and -`N_VDotProdMultiAllReduce`, have been added to support low-synchronization -methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the `sundials` -namespace to the `sundials::cuda`, `sundials::hip`, and `sundials::sycl` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The `Sundials` namespace used by the Trilinos Tpetra NVector has been replaced -with the `sundials::trilinos::nvector_tpetra` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions `N_VCloneVectorArray_*` and `N_VDestroyVectorArray_*` have been -deprecated. The generic `N_VCloneVectorArray` and `N_VDestroyVectorArray` -functions should be used instead. - -The previously deprecated constructor `N_VMakeWithManagedAllocator_Cuda` and -the function `N_VSetCudaStream_Cuda` have been removed and replaced with -`N_VNewWithMemHelp_Cuda` and `N_VSetKernelExecPolicy_Cuda` respectively. +The previously deprecated constructor `N_VMakeWithManagedAllocator_Cuda` and +the function `N_VSetCudaStream_Cuda` have been removed and replaced with +`N_VNewWithMemHelp_Cuda` and `N_VSetKernelExecPolicy_Cuda` respectively. The previously deprecated macros `PVEC_REAL_MPI_TYPE` and `PVEC_INTEGER_MPI_TYPE` have been removed and replaced with `MPI_SUNREALTYPE` and `MPI_SUNINDEXTYPE` respectively. -### SUNLinearSolver - The following previously deprecated functions have been removed | Removed | Replaced with | @@ -700,14 +758,47 @@ The following previously deprecated functions have been removed | `SUNSuperLUMT` | `SUNLinSol_SuperLUMT` | | `SUNSuperLUMTSetOrdering` | `SUNLinSol_SuperLUMTSetOrdering` | -### Fortran Interfaces +The deprecated functions `MRIStepGetCurrentButcherTables` and +`MRIStepWriteButcher` and the utility functions `MRIStepSetTable` and +`MRIStepSetTableNum` have been removed. Users wishing to create an MRI-GARK +method from a Butcher table should use `MRIStepCoupling_MIStoMRI` to create +the corresponding MRI coupling table and attach it with `MRIStepSetCoupling`. + +The previously deprecated functions `ARKStepSetMaxStepsBetweenLSet` and +`ARKStepSetMaxStepsBetweenJac` have been removed and replaced with +`ARKStepSetLSetupFrequency` and `ARKStepSetMaxStepsBetweenJac` respectively. + +The previously deprecated function `CVodeSetMaxStepsBetweenJac` has been removed +and replaced with `CVodeSetJacEvalFrequency`. The ARKODE, CVODE, IDA, and KINSOL Fortran 77 interfaces have been removed. See the "SUNDIALS Fortran Interface" section in the user guides and the F2003 example programs for more details using the SUNDIALS Fortran 2003 module interfaces. -### ARKODE +#### Namespace Changes + +The CUDA, HIP, and SYCL execution policies have been moved from the `sundials` +namespace to the `sundials::cuda`, `sundials::hip`, and `sundials::sycl` +namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" +have been removed from the execution policy classes and methods. + +The `Sundials` namespace used by the Trilinos Tpetra NVector has been replaced +with the `sundials::trilinos::nvector_tpetra` namespace. + +### Major Features + +#### SUNProfiler + +A capability to profile/instrument SUNDIALS library code has been added. This +can be enabled with the CMake option `SUNDIALS_BUILD_WITH_PROFILING`. A built-in +profiler will be used by default, but the +[Caliper](https://github.com/LLNL/Caliper) library can also be used instead with +the CMake option `ENABLE_CALIPER`. See the documentation section on profiling +for more details. **WARNING**: Profiling will impact performance, and should be +enabled judiciously. + +#### IMEX MRI Methods and MRIStepInnerStepper Object The ARKODE MRIStep module has been extended to support implicit-explicit (IMEX) multirate infinitesimal generalized additive Runge-Kutta (MRI-GARK) methods. As @@ -726,33 +817,16 @@ evaluations. The coupling table structure `MRIStepCouplingMem` and the functions `MRIStepCoupling_Alloc` and `MRIStepCoupling_Create` have also been updated to support IMEX-MRI-GARK methods. -The deprecated functions `MRIStepGetCurrentButcherTables` and -`MRIStepWriteButcher` and the utility functions `MRIStepSetTable` and -`MRIStepSetTableNum` have been removed. Users wishing to create an MRI-GARK -method from a Butcher table should use `MRIStepCoupling_MIStoMRI` to create -the corresponding MRI coupling table and attach it with `MRIStepSetCoupling`. +### New Features + +Two new optional vector operations, `N_VDotProdMultiLocal` and +`N_VDotProdMultiAllReduce`, have been added to support low-synchronization +methods for Anderson acceleration. The implementation of solve-decoupled implicit MRI-GARK methods has been updated to remove extraneous slow implicit function calls and reduce the memory requirements. -Deprecated ARKODE nonlinear solver predictors: specification of the ARKStep -"bootstrap" or "minimum correction" predictors (options 4 and 5 from -`ARKStepSetPredictorMethod`), or MRIStep "bootstrap" predictor (option 4 from -`MRIStepSetPredictorMethod`), will output a deprecation warning message. -These options will be removed in a future release. - -The previously deprecated functions `ARKStepSetMaxStepsBetweenLSet` and -`ARKStepSetMaxStepsBetweenJac` have been removed and replaced with -`ARKStepSetLSetupFrequency` and `ARKStepSetMaxStepsBetweenJac` respectively. - -### CVODE - -The previously deprecated function `CVodeSetMaxStepsBetweenJac` has been removed -and replaced with `CVodeSetJacEvalFrequency`. - -### CVODES - Added a new function `CVodeGetLinSolveStats` to get the CVODES linear solver statistics as a group. @@ -761,23 +835,23 @@ to be called by CVODES after every `nst` successfully completed time-steps. This is intended to provide a way of monitoring the CVODES statistics throughout the simulation. -The previously deprecated function `CVodeSetMaxStepsBetweenJac` has been removed -and replaced with `CVodeSetJacEvalFrequency`. - -### KINSOL - New orthogonalization methods were added for use within Anderson acceleration in KINSOL. See the "Anderson Acceleration QR Factorization" subsection within the mathematical considerations chapter of the user guide and the `KINSetOrthAA` function documentation for more details. -### Deprecations +### Deprecation Notice + +The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector +functions `N_VCloneVectorArray_*` and `N_VDestroyVectorArray_*` have been +deprecated. The generic `N_VCloneVectorArray` and `N_VDestroyVectorArray` +functions should be used instead. -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. +Many constants, types, and functions have been renamed so that they are properly +namespaced. The old names have been deprecated and will be removed in SUNDIALS +v7.0.0. -The following constants, macros, and typedefs are now deprecated: +The following constants, macros, and typedefs are now deprecated: | Deprecated Name | New Name | |:---------------------------|:----------------------------------| @@ -878,7 +952,7 @@ The following constants, macros, and typedefs are now deprecated: | `DEFAULT_ERK_8` | `ERKSTEP_DEFAULT_8` | In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): +will be printed if supported by the compiler): | Deprecated Name | New Name | |:------------------------------|:-----------------------------| @@ -1026,17 +1100,25 @@ In addition, the entire `sundials_lapack.h` header file is now deprecated for removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the SUNDIALS LAPACK linear solvers. +Deprecated ARKODE nonlinear solver predictors: specification of the ARKStep +"bootstrap" or "minimum correction" predictors (options 4 and 5 from +`ARKStepSetPredictorMethod`), or MRIStep "bootstrap" predictor (option 4 from +`MRIStepSetPredictorMethod`), will output a deprecation warning message. +These options will be removed in a future release. + ## Changes to SUNDIALS in release 5.8.0 -The RAJA NVECTOR implementation has been updated to support the SYCL backend -in addition to the CUDA and HIP backend. Users can choose the backend when +### New Features + +The RAJA vector implementation has been updated to support the SYCL backend in +addition to the CUDA and HIP backend. Users can choose the backend when configuring SUNDIALS by using the `SUNDIALS_RAJA_BACKENDS` CMake variable. This module remains experimental and is subject to change from version to version. A new SUNMatrix and SUNLinearSolver implementation were added to interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix and the linear solver support general dense linear systems as well as block diagonal -linear systems. This module is experimental and is subject to change from +linear systems. This matrix is experimental and is subject to change from version to version. Added a new *optional* function to the SUNLinearSolver API, @@ -1056,7 +1138,12 @@ package. Added functions to ARKODE and CVODE(S) for supplying an alternative right-hand side function and to IDA(S) for supplying an alternative residual for use within -nonlinear system function evaluations. +nonlinear system function evaluations: + +* `ARKStepSetNlsRhsFn` +* `MRIStepSetNlsRhsFn` +* `CVodeSetNlsRhsFn` +* `IDASetNlsResFn` Support for user-defined inner (fast) integrators has been to the MRIStep module in ARKODE. See the "MRIStep Custom Inner Steppers" section in the user guide for @@ -1074,9 +1161,11 @@ Anderson acceleration with the fixed point and Picard iterations (see `KINSetDelayAA`), and to return the newest solution with the fixed point iteration (see `KINSetReturnNewest`). -The installed SUNDIALSConfig.cmake file now supports the `COMPONENTS` option +The installed `SUNDIALSConfig.cmake` file now supports the `COMPONENTS` option to `find_package`. The exported targets no longer have IMPORTED_GLOBAL set. +### Bug Fixes + A bug was fixed in `SUNMatCopyOps` where the matrix-vector product setup function pointer was not copied. @@ -1117,18 +1206,18 @@ Fixed some compiler warnings when using the IBM XL compilers. ## Changes to SUNDIALS in release 5.6.0 -A new NVECTOR implementation based on the AMD ROCm HIP platform has been added. -This vector can target NVIDIA or AMD GPUs. See HIP NVECTOR section in the user -guide for more details. This module is considered experimental and is subject to -change from version to version. +A new `N_Vector` implementation based on the AMD ROCm HIP platform has been +added. This vector can target NVIDIA or AMD GPUs. See the HIP vector section in +the user guide for more details. This vector is considered experimental and is +subject to change from version to version. -The RAJA NVECTOR implementation has been updated to support the HIP backend +The RAJA `N_Vector` implementation has been updated to support the HIP backend in addition to the CUDA backend. Users can choose the backend when configuring -SUNDIALS by using the `SUNDIALS_RAJA_BACKENDS` CMake variable. This module +SUNDIALS by using the `SUNDIALS_RAJA_BACKENDS` CMake variable. This vector remains experimental and is subject to change from version to version. A new optional operation, `N_VGetDeviceArrayPointer`, was added to the N_Vector -API. This operation is useful for N_Vectors that utilize dual memory spaces, +API. This operation is useful for vectors that utilize dual memory spaces, e.g. the native SUNDIALS CUDA N_Vector. The SUNMATRIX_CUSPARSE and SUNLINEARSOLVER_CUSOLVERSP_BATCHQR implementations @@ -1147,10 +1236,17 @@ Added support for SuperLU DIST 6.3.0 or newer. ## Changes to SUNDIALS in release 5.4.0 +### Major Features + +A new class, `SUNMemoryHelper`, was added to support **GPU users** who have +complex memory management needs such as using memory pools. This is paired with +new constructors for the `NVECTOR_CUDA` and `NVECTOR_RAJA` modules that accept a +`SUNMemoryHelper` object. Refer to "The SUNMemoryHelper API", "NVECTOR CUDA" and +"NVECTOR RAJA" sections in the documentation for more information. + Added full support for time-dependent mass matrices in ARKStep, and expanded existing non-identity mass matrix infrastructure to support use of the -fixed point nonlinear solver. Fixed bug for ERK method integration with -static mass matrices. +fixed point nonlinear solver. An interface between ARKStep and the XBraid multigrid reduction in time (MGRIT) library has been added to enable parallel-in-time integration. See the ARKStep @@ -1160,15 +1256,7 @@ computational nodes, see `N_VBufSize`, `N_VBufPack`, and `N_VBufUnpack`. These N_Vector operations are only used within the XBraid interface and need not be implemented for any other context. -Updated the MRIStep time-stepping module in ARKODE to support higher-order -MRI-GARK methods [Sandu, SIAM J. Numer. Anal., 57, 2019], including methods that -involve solve-decoupled, diagonally-implicit treatment of the slow time scale. - -A new API, `SUNMemoryHelper`, was added to support **GPU users** who have -complex memory management needs such as using memory pools. This is paired with -new constructors for the `NVECTOR_CUDA` and `NVECTOR_RAJA` modules that accept a -`SUNMemoryHelper` object. Refer to "The SUNMemoryHelper API", "NVECTOR CUDA" and -"NVECTOR RAJA" sections in the documentation for more information. +### New Features The `NVECTOR_RAJA` module has been updated to mirror the `NVECTOR_CUDA` module. Notably, the update adds managed memory support to the `NVECTOR_RAJA` module. @@ -1176,9 +1264,49 @@ Users of the module will need to update any calls to the `N_VMake_Raja` function because that signature was changed. This module remains experimental and is subject to change from version to version. -Added new `SetLSNormFactor` functions to CVODE(S), ARKODE, and IDA(S) to -to specify the factor for converting between integrator tolerances (WRMS norm) -and linear solver tolerances (L2 norm) i.e., `tol_L2 = nrmfac * tol_WRMS`. +The expected behavior of `SUNNonlinSolGetNumIters` and +`SUNNonlinSolGetNumConvFails` in the SUNNonlinearSolver API have been updated to +specify that they should return the number of nonlinear solver iterations and +convergence failures in the most recent solve respectively rather than the +cumulative number of iterations and failures across all solves respectively. The +API documentation and SUNDIALS provided SUNNonlinearSolver implementations and +have been updated accordingly. As before, the cumulative number of nonlinear +iterations and failures may be retrieved by calling the integrator provided get +functions: + +* `ARKStepGetNumNonlinSolvIters` +* `ARKStepGetNumNonlinSolvConvFails` +* `ARKStepGetNonlinSolvStats` +* `MRIStepGetNumNonlinSolvIters` +* `MRIStepGetNumNonlinSolvConvFails` +* `MRIStepGetNonlinSolvStats` +* `CVodeGetNumNonlinSolvIters` +* `CVodeGetNumNonlinSolvConvFails` +* `CVodeGetNonlinSolvStats` +* `IDAGetNumNonlinSolvIters` +* `IDAGetNumNonlinSolvConvFails` +* `IDAGetNonlinSolvStats` + +Added the following the following functions that advanced users might find +useful when providing a custom `SUNNonlinSolSysFn`: + +* `ARKStepComputeState` +* `ARKStepGetNonlinearSystemData` +* `MRIStepComputeState` +* `MRIStepGetNonlinearSystemData` +* `CVodeComputeState` +* `CVodeGetNonlinearSystemData` +* `IDAGetNonlinearSystemData` + +Added new functions to CVODE(S), ARKODE, and IDA(S) to to specify the factor for +converting between integrator tolerances (WRMS norm) and linear solver tolerances +(L2 norm) i.e., `tol_L2 = nrmfac * tol_WRMS`: + +* `ARKStepSetLSNormFactor` +* `ARKStepSetMassLSNormFactor` +* `MRIStepSetLSNormFactor` +* `CVodeSetLSNormFactor` +* `IDASetLSNormFactor` Added new reset functions `ARKStepReset`, `ERKStepReset`, and `MRIStepReset` to reset the stepper time and state vector to user-provided @@ -1188,80 +1316,81 @@ integration history. These function complement the reinitialization functions the stepper so that the problem integration should resume as if started from scratch. -Added new functions for advanced users providing a custom `SUNNonlinSolSysFn`. +Updated the MRIStep time-stepping module in ARKODE to support higher-order +MRI-GARK methods [Sandu, SIAM J. Numer. Anal., 57, 2019], including methods that +involve solve-decoupled, diagonally-implicit treatment of the slow time scale. -The expected behavior of `SUNNonlinSolGetNumIters` and -`SUNNonlinSolGetNumConvFails` in the SUNNonlinearSolver API have been updated to -specify that they should return the number of nonlinear solver iterations and -convergence failures in the most recent solve respectively rather than the -cumulative number of iterations and failures across all solves respectively. The -API documentation and SUNDIALS provided SUNNonlinearSolver implementations and -have been updated accordingly. As before, the cumulative number of nonlinear -iterations and failures may be retrieved by calling the integrator provided get -functions. +The function `CVodeSetLSetupFrequency` has been added to CVODE(S) to set +the frequency of calls to the linear solver setup function. + +The Trilinos Tpetra `N_Vector` interface has been updated to work with Trilinos +12.18+. This update changes the local ordinal type to always be an `int`. + +Added support for CUDA 11. + +### Bug Fixes + +A minor inconsistency in CVODE(S) and a bug ARKODE when checking the Jacobian +evaluation frequency has been fixed. As a result codes using using a +non-default Jacobian update frequency through a call to +`CVodeSetMaxStepsBetweenJac` or `ARKStepSetMaxStepsBetweenJac` will need to +increase the provided value by 1 to achieve the same behavior as before. -**This change may cause a runtime error in existing user code**. In IDAS and CVODES, the functions for forward integration with checkpointing (`IDASolveF`, `CVodeF`) are now subject to a restriction on the number of time steps allowed to reach the output time. This is the same restriction applied to the `IDASolve` and `CVode` functions. The default maximum number of steps is 500, but this may be changed using the `<IDA|CVode>SetMaxNumSteps` function. This change fixes a bug that could cause an infinite loop in the `IDASolveF` -and `CVodeF` and functions. +and `CVodeF` and functions. **This change may cause a runtime error in existing user code**. -A minor inconsistency in CVODE(S) and a bug ARKODE when checking the Jacobian -evaluation frequency has been fixed. As a result codes using using a -non-default Jacobian update frequency through a call to -`CVodeSetMaxStepsBetweenJac` or `ARKStepSetMaxStepsBetweenJac` will need to -increase the provided value by 1 to achieve the same behavior as before. For -greater clarity the functions `CVodeSetMaxStepsBetweenJac`, -`ARKStepSetMaxStepsBetweenJac`, and `ARKStepSetMaxStepsBetweenLSet` have been -deprecated and replaced with `CVodeSetJacEvalFrequency`, -`ARKStepSetJacEvalFrequency`, and `ARKStepSetLSetupFrequency` respectively. -Additionally, the function `CVodeSetLSetupFrequency` has been added to CVODE(S) -to set the frequency of calls to the linear solver setup function. +Fixed bug in using ERK method integration with static mass matrices. -The `NVECTOR_TRILINOS` module has been updated to work with Trilinos 12.18+. -This update changes the local ordinal type to always be an `int`. +### Deprecation Notice -Added support for CUDA v11. +For greater clarity the following functions have been deprecated: -## Changes to SUNDIALS in release 5.3.0 +* `CVodeSetMaxStepsBetweenJac` +* `ARKStepSetMaxStepsBetweenJac` +* `ARKStepSetMaxStepsBetweenLSet` -Fixed a bug in ARKODE where the prototypes for `ERKStepSetMinReduction` and -`ARKStepSetMinReduction` were not included in `arkode_erkstep.h` and -`arkode_arkstep.h` respectively. +The following functions should be used instead: -Fixed a bug in ARKODE where inequality constraint checking would need to be -disabled and then re-enabled to update the inequality constraint values after -resizing a problem. Resizing a problem will now disable constraints and a call -to `ARKStepSetConstraints` or `ERKStepSetConstraints` is required to re-enable -constraint checking for the new problem size. +* `CVodeSetJacEvalFrequency` +* `ARKStepSetJacEvalFrequency` +* `ARKStepSetLSetupFrequency` -Fixed a bug in the iterative linear solver modules where an error is not -returned if the Atimes function is `NULL` or, if preconditioning is enabled, the -PSolve function is `NULL`. +## Changes to SUNDIALS in release 5.3.0 -Added specialized fused CUDA kernels to CVODE which may offer better -performance on smaller problems when using CVODE with the `NVECTOR_CUDA` -module. See the optional input function `CVodeSetUseIntegratorFusedKernels` -for more information. As with other SUNDIALS CUDA features, this is -feature is experimental and may change from version to version. +### Major Feature -Added the ability to control the CUDA kernel launch parameters for the -`NVECTOR_CUDA` and `SUNMATRIX_CUSPARSE` modules. These modules remain -experimental and are subject to change from version to version. -In addition, the `NVECTOR_CUDA` kernels were rewritten to be more flexible. -Most users should see equivalent performance or some improvement, but a select -few may observe minor performance degradation with the default settings. Users -are encouraged to contact the SUNDIALS team about any performance changes -that they notice. - -Added new capabilities for monitoring the solve phase in the -`SUNNONLINSOL_NEWTON` and `SUNNONLINSOL_FIXEDPOINT` modules, and the SUNDIALS -iterative linear solver modules. SUNDIALS must be built with the CMake option +Added support to CVODE for integrating IVPs with constraints using BDF methods +and projecting the solution onto the constraint manifold with a user defined +projection function. This implementation is accompanied by additions to user +documentation and CVODE examples. See the `CVodeSetProjFn` function +documentation for more information. + +### New Features + +Added the ability to control the CUDA kernel launch parameters for the CUDA +vector and spare matrix implementations. These implementations remain +experimental and are subject to change from version to version. In addition, the +CUDA vector kernels were rewritten to be more flexible. Most users should see +equivalent performance or some improvement, but a select few may observe minor +performance degradation with the default settings. Users are encouraged to +contact the SUNDIALS team about any performance changes that they notice. + +Added new capabilities for monitoring the solve phase in the Newton and +fixed-point `SUNNonlinearSolver`, and the SUNDIALS iterative linear +solvers. SUNDIALS must be built with the CMake option `SUNDIALS_BUILD_WITH_MONITORING` to use these capabilities. +Added specialized fused CUDA kernels to CVODE which may offer better performance +on smaller problems when using CVODE with the CUDA vector. See the optional +input function `CVodeSetUseIntegratorFusedKernels` for more +information. As with other SUNDIALS CUDA features, this is feature is +experimental and may change from version to version. + Added a new function, `CVodeSetMonitorFn`, that takes a user-function to be called by CVODE after every `nst` successfully completed time-steps. This is intended to provide a way of monitoring the CVODE statistics @@ -1270,18 +1399,78 @@ throughout the simulation. Added a new function `CVodeGetLinSolveStats` to get the CVODE linear solver statistics as a group. -Added optional set functions to provide an alternative ODE right-hand side -function (ARKODE and CVODE(S)), DAE residual function (IDA(S)), or nonlinear +Added the following optional functions to provide an alternative ODE right-hand +side function (ARKODE and CVODE(S)), DAE residual function (IDA(S)), or nonlinear system function (KINSOL) for use when computing Jacobian-vector products with -the internal difference quotient approximation. +the internal difference quotient approximation: -Added support to CVODE for integrating IVPs with constraints using BDF methods -and projecting the solution onto the constraint manifold with a user defined -projection function. This implementation is accompanied by additions to the -CVODE user documentation and examples. +* `ARKStepSetJacTimesRhsFn` +* `CVodeSetJacTimesRhsFn` +* `CVodeSetJacTimesRhsFnB` +* `IDASetJacTimesResFn` +* `IDASetJacTimesResFnB` +* `KINSetJacTimesVecSysFn` + +### Bug Fixes + +Fixed a bug in the iterative linear solvers where an error is not returned if +the `Atimes` function is `NULL` or, if preconditioning is enabled, the +`PSolve` function is `NULL`. + +Fixed a bug in ARKODE where the prototypes for `ERKStepSetMinReduction` and +`ARKStepSetMinReduction` were not included in `arkode_erkstep.h` and +`arkode_arkstep.h` respectively. + +Fixed a bug in ARKODE where inequality constraint checking would need to be +disabled and then re-enabled to update the inequality constraint values after +resizing a problem. Resizing a problem will now disable constraints and a call +to `ARKStepSetConstraints` or `ERKStepSetConstraints` is required to re-enable +constraint checking for the new problem size. ## Changes to SUNDIALS in release 5.2.0 +### New Features + +The following functions were added to each of the time integration packages to +enable or disable the scaling applied to linear system solutions with +matrix-based linear solvers to account for lagged matrix information: + +* `ARKStepSetLinearSolutionScaling` +* `CVodeSetLinearSolutionScaling` +* `CVodeSetLinearSolutionScalingB` +* `IDASetLinearSolutionScaling` +* `IDASetLinearSolutionScalingB` + +When using a matrix-based linear solver with ARKODE, IDA(S), or BDF methods in +CVODE(S) scaling is enabled by default. + +Added a new `SUNMatrix` implementation that interfaces to the sparse matrix +implementation from the NVIDIA cuSPARSE library. In addition, the CUDA Sparse +linear solver has been updated to use the new matrix, as such, users of this +matrix will need to update their code. This implementations are still considered +to be experimental, thus they are subject to breaking changes even in minor +releases. + +Added a new "stiff" interpolation module to ARKODE, based on Lagrange polynomial +interpolation, that is accessible to each of the ARKStep, ERKStep and MRIStep +time-stepping modules. This module is designed to provide increased +interpolation accuracy when integrating stiff problems, as opposed to the ARKODE +standard Hermite interpolation module that can suffer when the IVP right-hand +side has large Lipschitz constant. While the Hermite module remains the default, +the new Lagrange module may be enabled using one of the routines +`ARKStepSetInterpolantType`, `ERKStepSetInterpolantType`, or +`MRIStepSetInterpolantType`. The serial example problem `ark_brusselator.c` has +been converted to use this Lagrange interpolation module. Created accompanying +routines `ARKStepSetInterpolantDegree`, `ARKStepSetInterpolantDegree` and +`ARKStepSetInterpolantDegree` to provide user control over these interpolating +polynomials. + +Added two new functions, `ARKStepSetMinReduction` and `ERKStepSetMinReduction` +to change the minimum allowed step size reduction factor after an error test +failure. + +### Bug Fixes + Fixed a build system bug related to the Fortran 2003 interfaces when using the IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler it is recommended to set `CMAKE_Fortran_COMPILER` to `f2003`, `xlf2003`, or @@ -1303,41 +1492,20 @@ Fixed a memory leak in CVODES and IDAS from not deallocating the `atolSmin0` and Fixed a bug where a non-default value for the maximum allowed growth factor after the first step would be ignored. -Functions were added to each of the time integration packages to enable or -disable the scaling applied to linear system solutions with matrix-based linear -solvers to account for lagged matrix information. - -Added two new functions, `ARKStepSetMinReduction` and `ERKStepSetMinReduction` -to change the minimum allowed step size reduction factor after an error test -failure. - -Added a new `SUNMatrix` implementation, `SUNMATRIX_CUSPARSE`, that interfaces to -the sparse matrix implementation from the NVIDIA cuSPARSE library. In addition, -the `SUNLINSOL_CUSOLVER_BATCHQR` linear solver has been updated to use this -matrix, therefore, users of this module will need to update their code. These -modules are still considered to be experimental, thus they are subject to -breaking changes even in minor releases. +### Deprecation Notice -Added a new "stiff" interpolation module to ARKODE, based on Lagrange polynomial -interpolation, that is accessible to each of the ARKStep, ERKStep and MRIStep -time-stepping modules. This module is designed to provide increased -interpolation accuracy when integrating stiff problems, as opposed to the ARKODE -standard Hermite interpolation module that can suffer when the IVP right-hand -side has large Lipschitz constant. While the Hermite module remains the default, -the new Lagrange module may be enabled using one of the routines -`ARKStepSetInterpolantType`, `ERKStepSetInterpolantType`, or -`MRIStepSetInterpolantType`. The serial example problem `ark_brusselator.c` has -been converted to use this Lagrange interpolation module. Created accompanying -routines `ARKStepSetInterpolantDegree`, `ARKStepSetInterpolantDegree` and -`ARKStepSetInterpolantDegree` to provide user control over these interpolating -polynomials. While the routines `ARKStepSetDenseOrder`, `ARKStepSetDenseOrder` -and `ARKStepSetDenseOrder` still exist, these have been deprecated and will be -removed in a future release. +The routines `ARKStepSetDenseOrder`, `ARKStepSetDenseOrder` and +`ARKStepSetDenseOrder` have been deprecated and will be removed in a +future release. The new functions `ARKStepSetInterpolantDegree`, +`ARKStepSetInterpolantDegree`, and `ARKStepSetInterpolantDegree` +should be used instead. ## Changes to SUNDIALS in release 5.1.0 +### New Features + Added support for a user-supplied function to update the prediction for each -implicit stage solution in ARKStep. If supplied, this routine will be called +implicit stage solution in ARKStep. If supplied, this routine will be called *after* any existing ARKStep predictor algorithm completes, so that the predictor may be modified by the user as desired. The new user-supplied routine has type `ARKStepStagePredictFn`, and may be set by calling @@ -1354,10 +1522,19 @@ Added support for damping when using Anderson acceleration in KINSOL. See the mathematical considerations section of the user guide and the description of the `KINSetDampingAA` function for more details. -Added support for damping to the `SUNNonlinearSolver_FixedPoint` module when -using Anderson acceleration. See the `SUNNonlinearSolver_FixedPoint` section in -the user guides and the description of the `SUNNonlinSolSetDamping_FixedPoint` -function for more details. +Added support for constant damping to the `SUNNonlinearSolver_FixedPoint` module +when using Anderson acceleration. See the `SUNNonlinearSolver_FixedPoint` +section in the user guides and the description of the +`SUNNonlinSolSetDamping_FixedPoint` function for more details. + +Added two utility functions, `SUNDIALSFileOpen` and `SUNDIALSFileClose` for +creating/destroying file pointers. These are useful when using the Fortran 2003 +interfaces. + +Added a new build system option, `CUDA_ARCH`, to specify the CUDA architecture +to target. + +### Bug Fixes Fixed a build system bug related to finding LAPACK/BLAS. @@ -1366,17 +1543,10 @@ Fixed a build system bug related to checking if the KLU library works. Fixed a build system bug related to finding PETSc when using the CMake variables `PETSC_INCLUDES` and `PETSC_LIBRARIES` instead of `PETSC_DIR`. -Added a new build system option, `CUDA_ARCH`, to specify the CUDA architecture -to target. - Fixed a bug in the Fortran 2003 interfaces to the ARKODE Butcher table routines and structure. This includes changing the `ARKodeButcherTable` type to be a `type(c_ptr)` in Fortran. -Added two utility functions, `SUNDIALSFileOpen` and `SUNDIALSFileClose` for -creating/destroying file pointers. These are useful when using the Fortran 2003 -interfaces. - ## Changes to SUNDIALS in release 5.0.0 ### Build System @@ -1390,93 +1560,90 @@ third party libraries that require linking to BLAS, the path to the BLAS library should be included in the `_LIBRARIES` variable for the third party library e.g., `SUPERLUDIST_LIBRARIES` when enabling SuperLU_DIST. -Fixed a bug in the build system that prevented the PThreads NVECTOR module from -being built. - ### NVector -Two new functions were added to aid in creating custom NVECTOR objects. The -constructor `N_VNewEmpty` allocates an "empty" generic NVECTOR with the object's -content pointer and the function pointers in the operations structure -initialized to NULL. When used in the constructor for custom objects this -function will ease the introduction of any new optional operations to the -NVECTOR API by ensuring only required operations need to be set. Additionally, -the function `N_VCopyOps(w, v)` has been added to copy the operation function -pointers between vector objects. When used in clone routines for custom vector -objects these functions also will ease the introduction of any new optional -operations to the NVECTOR API by ensuring all operations are copied when cloning -objects. - -Two new NVECTOR implementations, NVECTOR_MANYVECTOR and NVECTOR_MPIMANYVECTOR, -have been created to support flexible partitioning of solution data among -different processing elements (e.g., CPU + GPU) or for multi-physics problems -that couple distinct MPI-based simulations together (see the NVECTOR_MANYVECTOR -and NVECTOR_MPIMANYVECTOR sections in the user guides for more details). This -implementation is accompanied by additions to user documentation and SUNDIALS -examples. - -An additional NVECTOR implementation, NVECTOR_MPIPLUSX, has been created to -support the MPI+X paradigm where X is a type of on-node parallelism (e.g., -OpenMP, CUDA). The implementation is accompanied by additions to user -documentation and SUNDIALS examples. +Two new functions were added to aid in creating custom `N_Vector` +objects. The constructor `N_VNewEmpty` allocates an "empty" generic +`N_Vector` with the object's content pointer and the function pointers +in the operations structure initialized to `NULL`. When used in the +constructor for custom objects this function will ease the introduction of any +new optional operations to the `N_Vector` API by ensuring only required +operations need to be set. Additionally, the function `N_VCopyOps` has +been added to copy the operation function pointers between vector objects. When +used in clone routines for custom vector objects these functions also will ease +the introduction of any new optional operations to the `N_Vector` API by +ensuring all operations are copied when cloning objects. + +Added new `N_Vector` implementations, `ManyVector` and `MPIManyVector`, to +support flexible partitioning of solution data among different processing +elements (e.g., CPU + GPU) or for multi-physics problems that couple distinct +MPI-based simulations together (see the the `ManyVector` and `MPIManyVector` +section in the user guide for more details). This implementation is accompanied +by additions to user documentation and SUNDIALS examples. + +Additionally, an `MPIPlusX` vector implementation has been created to support +the MPI+X paradigm where X is a type of on-node parallelism (e.g., OpenMP, CUDA, +etc.). The implementation is accompanied by additions to user documentation and +SUNDIALS examples. One new required vector operation and ten new optional vector operations have -been added to the NVECTOR API. The new required operation, `N_VGetLength`, -returns the global length of an N_Vector. The optional operations have been -added to support the new NVECTOR_MPIMANYVECTOR implementation. The operation -`N_VGetCommunicator` must be implemented by subvectors that are combined to -create an NVECTOR_MPIMANYVECTOR, but is not used outside of this context. The -remaining nine operations are optional local reduction operations intended to -eliminate unnecessary latency when performing vector reduction operations -(norms, etc.) on distributed memory systems. The optional local reduction vector -operations are `N_VDotProdLocal`, `N_VMaxNormLocal`, `N_VMinLocal`, -`N_VL1NormLocal`, `N_VWSqrSumLocal`, `N_VWSqrSumMaskLocal`, `N_VInvTestLocal`, -`N_VConstrMaskLocal`, and `N_VMinQuotientLocal`. If an NVECTOR implementation -defines any of the local operations as NULL, then the NVECTOR_MPIMANYVECTOR will -call standard NVECTOR operations to complete the computation. - -The `*_MPICuda` and `*_MPIRaja` functions have been removed from the -NVECTOR_CUDA and NVECTOR_RAJA implementations respectively. Accordingly, the -`nvector_mpicuda.h`, `nvector_mpiraja.h`, `libsundials_nvecmpicuda.lib`, and -`libsundials_nvecmpicudaraja.lib` files have been removed. Users should use the -NVECTOR_MPIPLUSX module in conjunction with the NVECTOR_CUDA or NVECTOR_RAJA -modules to replace the functionality. The necessary changes are minimal and -should require few code modifications. - -Fixed a memory leak in the NVECTOR_PETSC clone function. - -Made performance improvements to the CUDA NVECTOR. Users who utilize a +been added to the `N_Vector` API. The new required operation, `N_VGetLength`, +returns the global vector length. The optional operations have been added to +support the new MPIManyVector implementation. The operation `N_VGetCommunicator` +must be implemented by subvectors that are combined to create an MPIManyVector, +but is not used outside of this context. The remaining nine operations are +optional local reduction operations intended to eliminate unnecessary latency +when performing vector reduction operations (norms, etc.) on distributed memory +systems. The optional local reduction vector operations are `N_VDotProdLocal`, +`N_VMaxNormLocal`, `N_VMinLocal`, `N_VL1NormLocal`, `N_VWSqrSumLocal`, +`N_VWSqrSumMaskLocal`, `N_VInvTestLocal`, `N_VConstrMaskLocal`, and +`N_VMinQuotientLocal`. If an `N_Vector` implementation defines any of the local +operations as `NULL`, then the MPIManyVector will call standard `N_Vector` +operations to complete the computation. + +The `*_MPICuda` and `*_MPIRaja` functions have been removed from the CUDA +and RAJA vector implementations respectively. Accordingly, the +`nvector_mpicuda.h`, `nvector_mpiraja.h`, `libsundials_nvecmpicuda.lib`, +and `libsundials_nvecmpicudaraja.lib` files have been removed. Users should +use the MPI+X vector in conjunction with the CUDA and RAJA vectors to replace +the functionality. The necessary changes are minimal and should require few code +modifications. See the example programs in `examples/ida/mpicuda` and +`examples/ida/mpiraja` for examples of how to use the MPI+X vector with the +CUDA and RAJA vectors, respectively. + +Made performance improvements to the CUDA vector. Users who utilize a non-default stream should no longer see default stream synchronizations after memory transfers. -Added a new constructor to the CUDA NVECTOR that allows a user to provide -custom allocate and free functions for the vector data array and internal -reduction buffer. +Added a new constructor to the CUDA vector that allows a user to provide custom +allocate and free functions for the vector data array and internal reduction +buffer. -Added new Fortran 2003 interfaces for most NVECTOR modules. See NEVTOR section -in the user guides for more details on how to use the interfaces. - -Added three new NVECTOR utility functions, `FN_VGetVecAtIndexVectorArray`, -`FN_VSetVecAtIndexVectorArray`, and `FN_VNewVectorArray`, for working with +Added three new `N_Vector` utility functions, `N_VGetVecAtIndexVectorArray`, +`N_VSetVecAtIndexVectorArray`, and `N_VNewVectorArray`, for working with `N_Vector` arrays when using the Fortran 2003 interfaces. ### SUNMatrix -Two new functions were added to aid in creating custom SUNMATRIX objects. The -constructor `SUNMatNewEmpty` allocates an "empty" generic SUNMATRIX with the +Two new functions were added to aid in creating custom SUNMatrix objects. The +constructor `SUNMatNewEmpty` allocates an "empty" generic SUNMatrix with the object's content pointer and the function pointers in the operations structure -initialized to NULL. When used in the constructor for custom objects this +initialized to `NULL`. When used in the constructor for custom objects this function will ease the introduction of any new optional operations to the -SUNMATRIX API by ensuring only required operations need to be set. Additionally, +SUNMatrix API by ensuring only required operations need to be set. Additionally, the function `SUNMatCopyOps(A, B)` has been added to copy the operation function pointers between matrix objects. When used in clone routines for custom matrix objects these functions also will ease the introduction of any new optional -operations to the SUNMATRIX API by ensuring all operations are copied when +operations to the SUNMatrix API by ensuring all operations are copied when cloning objects. -A new operation, `SUNMatMatvecSetup`, was added to the SUNMatrix API. Users -who have implemented custom SUNMatrix modules will need to at least update -their code to set the corresponding ops structure member, matvecsetup, to NULL. +A new operation, `SUNMatMatvecSetup`, was added to the `SUNMatrix` API to +perform any setup necessary for computing a matrix-vector product. This +operation is useful for `SUNMatrix` implementations which need to prepare the +matrix itself, or communication structures before performing the matrix-vector +product. Users who have implemented a custom `SUNMatrix` will need to at least +update their code to set the corresponding `ops` structure member, +`matvecsetup`, to `NULL`. The generic SUNMatrix API now defines error codes to be returned by SUNMatrix operations. Operations which return an integer flag indiciating success/failure @@ -1485,21 +1652,19 @@ may return different values than previously. A new SUNMatrix (and SUNLinearSolver) implementation was added to facilitate the use of the SuperLU_DIST library with SUNDIALS. -Added new Fortran 2003 interfaces for most SUNMATRIX modules. See SUNMATRIX -section in the user guides for more details on how to use the interfaces. - ### SUNLinearSolver -A new function was added to aid in creating custom SUNLINEARSOLVER objects. The -constructor `SUNLinSolNewEmpty` allocates an "empty" generic SUNLINEARSOLVER -with the object's content pointer and the function pointers in the operations -structure initialized to NULL. When used in the constructor for custom objects -this function will ease the introduction of any new optional operations to the -SUNLINEARSOLVER API by ensuring only required operations need to be set. +A new function was added to aid in creating custom `SUNLinearSolver` +objects. The constructor `SUNLinSolNewEmpty` allocates an "empty" generic +`SUNLinearSolver` with the object's content pointer and the function pointers in +the operations structure initialized to `NULL`. When used in the constructor for +custom objects this function will ease the introduction of any new optional +operations to the `SUNLinearSolver` API by ensuring only required operations +need to be set. -The return type of the SUNLinearSolver API function `SUNLinSolLastFlag` has -changed from `long int` to `sunindextype` to be consistent with the type -used to store row indices in dense and banded linear solver modules. +The return type of the `SUNLinSolLastFlag` in the `SUNLinearSolver` has changed +from `long int` to `sunindextype` to be consistent with the type used to store +row indices in dense and banded linear solver modules. Added a new optional operation to the SUNLINEARSOLVER API, `SUNLinSolGetID`, that returns a `SUNLinearSolver_ID` for identifying the linear solver module. @@ -1520,18 +1685,14 @@ Added three new accessor functions to the SUNLinSol_KLU module, `SUNLinSol_KLUGetCommon`, to provide user access to the underlying KLU solver structures. -Added new Fortran 2003 interfaces for most SUNLINEARSOLVER modules. See -SUNLINEARSOLVER section in the user guides for more details on how to use -the interfaces. - ### SUNNonlinearSolver -A new function was added to aid in creating custom SUNNONLINEARSOLVER objects. -The constructor `SUNNonlinSolNewEmpty` allocates an "empty" generic -SUNNONLINEARSOLVER with the object's content pointer and the function pointers -in the operations structure initialized to NULL. When used in the constructor +A new function was added to aid in creating custom `SUNNonlinearSolver` +objects. The constructor `SUNNonlinSolNewEmpty` allocates an "empty" generic +`SUNNonlinearSolver` with the object's content pointer and the function pointers +in the operations structure initialized to `NULL`. When used in the constructor for custom objects this function will ease the introduction of any new optional -operations to the SUNNONLINEARSOLVER API by ensuring only required operations +operations to the `SUNNonlinearSolver` API by ensuring only required operations need to be set. To facilitate the use of user supplied nonlinear solver convergence test @@ -1541,71 +1702,89 @@ pointer will be passed to the nonlinear solver convergence test function on each call. The inputs values passed to the first two inputs of the `SUNNonlinSolSolve` -function in the SUNNONLINEARSOLVER have been changed to be the predicted -state and the initial guess for the correction to that state. Additionally, -the definitions of `SUNNonlinSolLSetupFn` and `SUNNonlinSolLSolveFn` in the -SUNNonlinearSolver API have been updated to remove unused input parameters. -For more information on the nonlinear system formulation and the API functions -see the SUNNONLINEARSOLVER chapter in the user guides. +function in the `SUNNonlinearSolver` have been changed to be the predicted state +and the initial guess for the correction to that state. Additionally, the +definitions of `SUNNonlinSolLSetupFn` and `SUNNonlinSolLSolveFn` in the +SUNNonlinearSolver API have been updated to remove unused input parameters. For +more information on the nonlinear system formulation and the API functions see +the `SUNNonlinearSolver` chapter in the user guides. + +Added a new `SUNNonlinearSolver` implementation for interfaces to the PETSc SNES +nonlinear solver. + +### New Features + +A new linear solver interface functions, `ARKLsLinSysFn` and `CVLsLinSysFn`, as +added as an alternative method for evaluating the linear systems `M - \gamma J` +or `I - \gamma J`. + +Added the following functions to get the current state and gamma value to +ARKStep, CVODE and CVODES that may be useful to users who choose to provide +their own nonlinear solver implementation: + +* `ARKStepGetCurrentState` +* `ARKStepGetCurrentGamma` +* `CVodeGetCurrentGamma` +* `CVodeGetCurrentState` +* `CVodeGetCurrentGamma` +* `CVodeGetCurrentStateSens` +* `CVodeGetCurrentSensSolveIndex` +* `IDAGetCurrentCj` +* `IDAGetCurrentY` +* `IDAGetCurrentYp` +* `IDAComputeY` +* `IDAComputeYp` + +Removed extraneous calls to `N_VMin` for simulations where the scalar +valued absolute tolerance, or all entries of the vector-valued absolute +tolerance array, are strictly positive. In this scenario ARKODE, CVODE(S), and +IDA(S) steppers will remove at least one global reduction per time step. + +The ARKODE, CVODE(S), IDA(S), and KINSOL linear solver interfaces have been +updated to only zero the Jacobian matrix before calling a user-supplied Jacobian +evaluation function when the attached linear solver has type +`SUNLINEARSOLVER_DIRECT`. + +Added new Fortran 2003 interfaces to all of the SUNDIALS packages (ARKODE, +CVODE(S), IDA(S), and KINSOL as well as most of the `N_Vector`, `SUNMatrix`, +`SUNLinearSolver`, and `SUNNonlinearSolver` implementations. See "Fortran" +section for more details. These new interfaces were generated with SWIG-Fortran +and provide a user an idiomatic Fortran 2003 interface to most of the SUNDIALS C +API. -Added a new `SUNNonlinearSolver` implementation, `SUNNonlinsol_PetscSNES`, -which interfaces to the PETSc SNES nonlinear solver API. +The MRIStep module has been updated to support explicit, implicit, or IMEX +methods as the fast integrator using the ARKStep module. As a result some +function signatures have been changed including MRIStepCreate which now +takes an ARKStep memory structure for the fast integration as an input. -Added new Fortran 2003 interfaces for most SUNNONLINEARSOLVER modules. See -SUNNONLINEARSOLVER section in the user guides for more details on how to use -the interfaces. +The reinitialization functions `ERKStepReInit`, `ARKStepReInit`, and +`MRIStepReInit` have been updated to retain the minimum and maxiumum step +size values from before reinitialization rather than resetting them to the +default values. -### CVODE and CVODES +Added two new embedded ARK methods of orders 4 and 5 to ARKODE (from +Kennedy & Carpenter, Appl. Numer. Math., 136:183--205, 2019). -Fixed a bug in the CVODE and CVODES constraint handling where the step size -could be set below the minimum step size. - -Fixed a bug in the CVODE and CVODES nonlinear solver interfaces where the norm -of the accumulated correction was not updated when using a non-default -convergence test function. - -Fixed a bug in the CVODES `cvRescale` function where the loops to compute the -array of scalars for the fused vector scale operation stopped one iteration -early. - -Fixed a bug in CVODES where CVodeF would return the wrong flag under certain -cirumstances. - -Fixed a bug in CVODES where CVodeF would not return a root in NORMAL_STEP mode -if the root occurred after the desired output time. - -Fixed a memeory leak in FCVODE when not using the default nonlinear solver. - -Removed extraneous calls to `N_VMin` for simulations where the scalar valued -absolute tolerance, or all entries of the vector-valued absolute tolerance -array, are strictly positive. In this scenario CVODE and CVODES will remove -at least one global reduction per time step. - -The CVLS interface has been updated to only zero the Jacobian matrix before -calling a user-supplied Jacobian evaluation function when the attached linear -solver has type `SUNLINEARSOLVER_DIRECT`. +Support for optional inequality constraints on individual components of the +solution vector has been added the ARKODE ERKStep and ARKStep modules. See +the descriptions of `ERKStepSetConstraints` and `ARKStepSetConstraints` for +more details. Note that enabling constraint handling requires the `N_Vector` +operations `N_VMinQuotient`, `N_VConstrMask`, and `N_VCompare` that were not +previously required by ARKODE. -A new linear solver interface function, `CVLsLinSysFn`, was added as an -alternative method for evaluating the linear systems I - gamma J. +Add two new 'Set' functions to MRIStep, `MRIStepSetPreInnerFn` and +`MRIStepSetPostInnerFn`, for performing communication or memory +transfers needed before or after the inner integration. -Added functions to get the current state and gamma value to CVODE and CVODES. -These functions may be useful to users who chose to provide their own nonlinear -solver implementation. +### Bug Fixes -Added New Fortran 2003 interfaces to CVODE and CVODES were added. These new -interfaces were generated with SWIG-Fortran and provide a user an idiomatic -Fortran 2003 interface to most of the SUNDIALS C API. The existing CVODE F2003 -interface, and all module implementations with existing Fortran 2003 interfaces -were updated accordingly. See the section "Using CVODE for Fortran -Applications" and "Using CVODES for Fortran Applications" in the appropriate -user guide for more details on how to use the interfaces. +Fixed a bug in the build system that prevented the PThreads NVECTOR module from +being built. -### ARKODE +Fixed a memory leak in the PETSc `N_Vector` clone function. -The MRIStep module has been updated to support explicit, implicit, or IMEX -methods as the fast integrator using the ARKStep module. As a result some -function signatures have been changed including MRIStepCreate which now -takes an ARKStep memory structure for the fast integration as an input. +Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +the default nonlinear solver. Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in an infinite loop if the nonlinear solver failed to converge more than the @@ -1621,127 +1800,71 @@ Fixed a minor bug in ARKStep where an incorrect flag is reported when an error occurs in the mass matrix setup or Jacobian-vector product setup functions. -Fixed a memeory leak in FARKODE when not using the default nonlinear solver. - -The reinitialization functions `ERKStepReInit`, `ARKStepReInit`, and -`MRIStepReInit` have been updated to retain the minimum and maxiumum step -size values from before reinitialization rather than resetting them to the -default values. - -Removed extraneous calls to `N_VMin` for simulations where the scalar valued -absolute tolerance, or all entries of the vector-valued absolute tolerance -array, are strictly positive. In this scenario ARKODE steppers will remove -at least one global reduction per time step. - -The ARKLS interface has been updated to only zero the Jacobian matrix before -calling a user-supplied Jacobian evaluation function when the attached linear -solver has type `SUNLINEARSOLVER_DIRECT`. - -A new linear solver interface function, `ARKLsLinSysFn`, was added as an -alternative method for evaluating the linear systems M - gamma J and -I - gamma J. - -Added two new embedded ARK methods of orders 4 and 5 to ARKODE (from -Kennedy & Carpenter, Appl. Numer. Math., 136:183--205, 2019). - -Support for optional inequality constraints on individual components of the -solution vector has been added the ARKODE ERKStep and ARKStep modules. See -the descriptions of `ERKStepSetConstraints` and `ARKStepSetConstraints` for -more details. Note that enabling constraint handling requires the NVECTOR -operations `N_VMinQuotient`, `N_VConstrMask`, and `N_VCompare` that were not -previously required by ARKODE. +Fixed a bug in the CVODE and CVODES constraint handling where the step size +could be set below the minimum step size. -Added functions to get the current state and gamma value to the ARKStep module. -These functions may be useful to users who chose to provide their own nonlinear -solver implementation. +Fixed a bug in the CVODE and CVODES nonlinear solver interfaces where the norm +of the accumulated correction was not updated when using a non-default +convergence test function. -Add two new 'Set' functions to MRIStep, `MRIStepSetPreInnerFn` and -`MRIStepSetPostInnerFn` for performing communication or memory -transfers needed before or after the inner integration. +Fixed a bug in the CVODES `cvRescale` function where the loops to compute the +array of scalars for the fused vector scale operation stopped one iteration +early. -Added new Fortran 2003 interfaces to all ARKODE stepper modules. These new -interfaces were generated with SWIG-Fortran and provide a user an idiomatic -Fortran 2003 interface to most of the SUNDIALS C API. See the section "Using -ARKODE for Fortran Applications" in the user guide for more details on how -to use the interfaces. +Fixed a bug in CVODES and IDAS where `CVodeF` and `IDASolveF` would return the +wrong flag under certain circumstances. -### IDA and IDAS +Fixed a bug in CVODES and IDAS where `CVodeF` and `IDASolveF` would not return a +root in `NORMAL_STEP` mode if the root occurred after the desired output time. -A bug was fixed in the IDA and IDAS linear solver interfaces where an incorrect +Fixed a bug in the IDA and IDAS linear solver interfaces where an incorrect Jacobian-vector product increment was used with iterative solvers other than SPGMR and SPFGMR. -Fixed a bug in IDAS where IDASolveF would return the wrong flag under certain -cirumstances. - -Fixed a bug in IDAS where IDASolveF would not return a root in NORMAL_STEP mode -if the root occurred after the desired output time. - -Fixed a bug the IDAS IDAQuadReInitB function where an incorrect memory structure -was passed to IDAQuadReInit. - -Fixed a memeory leak in FIDA when not using the default nonlinear solver. - -Removed extraneous calls to `N_VMin` for simulations where the scalar valued -absolute tolerance, or all entries of the vector-valued absolute tolerance -array, are strictly positive. In this scenario IDA and IDAS will remove -at least one global reduction per time step. - -The IDALS interface has been updated to only zero the Jacobian matrix before -calling a user-supplied Jacobian evaluation function when the attached linear -solver has type SUNLINEARSOLVER_DIRECT. - -Added new Fortran 2003 interfaces to IDA and IDAS. These new interfaces were -generated with SWIG-Fortran and provide a user an idiomatic Fortran 2003 -interface to most of the SUNDIALS C API. See the section "Using IDA for Fortran -Applications" and "Using IDAS for Fortran Applications" in the appropriate -user guide for more details on how to use the interfaces. - -### KINSOL +Fixed a bug the IDAS `IDAQuadReInitB` function where an incorrect memory +structure was passed to `IDAQuadReInit`. Fixed a bug in the KINSOL linear solver interface where the auxiliary scalar `sJpnorm` was not computed when necessary with the Picard iteration and the auxiliary scalar `sFdotJp` was unnecessarily computed in some cases. -The KINLS interface has been updated to only zero the Jacobian matrix before -calling a user-supplied Jacobian evaluation function when the attached linear -solver has type SUNLINEARSOLVER_DIRECT. +## Changes to SUNDIALS in release 4.1.0 -Added new Fortran 2003 interfaces to KINSOL. These new interfaces were -generated with SWIG-Fortran and provide a user an idiomatic Fortran 2003 -interface to most of the SUNDIALS C API. See the section "Using KINSOL for -Fortran Applications" for more details on how to use the interfaces. +### Removed Implementation Headers -## Changes to SUNDIALS in release 4.1.0 +The implementation header files (`*_impl.h`) are no longer installed. This +means users who are directly accessing or manipulating package memory structures +will need to update their code to use the package's public API. -An additional N_Vector implementation was added for Tpetra vector from -Trilinos library to facilitate interoperability between SUNDIALS and Trilinos. -This implementation is accompanied by additions to user documentation and -SUNDIALS examples. +### New Features -A bug was fixed where a nonlinear solver object could be freed twice in some use -cases. +An additional `N_Vector` implementation was added for interfacing with +the Tpetra vector from Trilinos library to facilitate interoperability between +SUNDIALS and Trilinos. This implementation is accompanied by additions to user +documentation and SUNDIALS examples. -The EXAMPLES_ENABLE_RAJA CMake option has been removed. The option -`EXAMPLES_ENABLE_CUDA` enables all examples that use CUDA including the RAJA -examples with a CUDA back end (if the RAJA NVECTOR is enabled). +### Bug Fixes -The implementation header files (e.g. `arkode_impl.h`) are no longer installed. -This means users who are directly manipulating package memory structures will -need to update their code to use the package's public API. +The `EXAMPLES_ENABLE_RAJA` CMake option has been removed. The option +`EXAMPLES_ENABLE_CUDA` enables all examples that use CUDA including the RAJA +examples with a CUDA back end (if RAJA is enabled). Python is no longer required to run `make test` and `make test_install`. -Fixed a bug in `ARKodeButcherTable_Write` when printing a Butcher table -without an embedding. +A bug was fixed where a nonlinear solver object could be freed twice in some use +cases. + +Fixed a bug in `ARKodeButcherTable_Write` when printing a Butcher table without +an embedding. ## Changes to SUNDIALS in release 4.0.2 Added information on how to contribute to SUNDIALS and a contributing agreement. -Moved definitions of DLS and SPILS backwards compatibility functions to a source -file. The symbols are now included in the appropriate package library, e.g. -`libsundials_cvode.lib`. +Moved the definitions of backwards compatibility functions for the prior direct +linear solver (DLS) and scaled preconditioned iterarive linear solvers (SPILS) +to a source file. The symbols are now included in the appropriate package +library, e.g. `libsundials_cvode.lib`. ## Changes to SUNDIALS in release 4.0.1 @@ -1752,51 +1875,110 @@ fixed. The direct and iterative linear solver interfaces in all SUNDIALS packages have been merged into a single unified linear solver interface to support any valid -SUNLINSOL module. This includes the DIRECT and ITERATIVE types as well as the -new MATRIX_ITERATIVE type. Details regarding how SUNDIALS packages utilize -linear solvers of each type as well as discussion regarding intended use cases -for user-supplied SUNLINSOL implementations are included in the SUNLINSOL -chapter of the user guides. All example programs have been updated to use the -new unified interfaces. - -The unified interface is very similar to the previous DLS and SPILS interfaces. -To minimize challenges in user migration to the unified linear solver interface, -the previous DLS and SPILS routines for all packages may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. Additionally, we note that Fortran users will need to enlarge -their iout array of optional integer outputs, and update the indices that they -query for certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided SUNLinSol -implementations have been updated to follow the naming convention SUNLinSol_* -where * is the name of the linear solver e.g., Dense, KLU, SPGMR, PCG, etc. -Solver-specific "set" routine names have been similarly standardized. To -minimize challenges in user migration to the new names, the previous routine -names may still be used; these will be deprecated in future releases, so we -recommend that users migrate to the new names soon. All example programs have -been updated to used the new naming convention. - -The SUNBandMatrix constructor has been simplified to remove the storage upper -bandwidth argument. - -SUNDIALS integrators (ARKODE, CVODE, CVODES, IDA, and IDAS) have been updated to -utilize generic nonlinear solver modules through the SUNNONLINSOL API. This API -will ease the addition of new nonlinear solver options and allow for external or -user-supplied nonlinear solvers. The SUNNONLINSOL API and provided SUNNONLINSOL -modules are described in a new user guide chapter and follow the same object -oriented design and implementation used by the NVECTOR, SUNMATRIX, and -SUNLINSOL modules. All integrator example programs have also been updated to -used the new nonlinear solver API. +`SUNLinearSolver`. This includes the `DIRECT` and `ITERATIVE` types +as well as the new `MATRIX_ITERATIVE` type. Details regarding how SUNDIALS +packages utilize linear solvers of each type as well as a discussion regarding +the intended use cases for user-supplied linear solver implementations are +included the user guide. All example programs have been updated to use +the new unified linear solver interfaces. + +The unified linear solver interface is very similar to the previous DLS (direct +linear solver) and SPILS (scaled preconditioned iterative linear solver) +interface in each package. To minimize challenges in user migration to the +unified linear solver interfaces, the previous DLS and SPILS functions may still +be used however, these are now deprecated and will be removed in a future +release. Additionally, that Fortran users will need to enlarge their array of +optional integer outputs, and update the indices that they query for certain +linear solver related statistics. + +The names of all SUNDIALS-provided `SUNLinearSolver` constructors have have been +updated to follow the naming convention `SUNLinSol_*` where `*` is the name +of the linear solver. The new constructor names are: + +* `SUNLinSol_Band` +* `SUNLinSol_Dense` +* `SUNLinSol_KLU` +* `SUNLinSol_LapackBand` +* `SUNLinSol_LapackDense` +* `SUNLinSol_PCG` +* `SUNLinSol_SPBCGS` +* `SUNLinSol_SPFGMR` +* `SUNLinSol_SPGMR` +* `SUNLinSol_SPTFQMR` +* `SUNLinSol_SuperLUMT` + +Linear solver-specific "set" routine names have been similarly standardized. To +minimize challenges in user migration to the new names, the previous function +names may still be used however, these are now deprecated and will be removed in +a future release. All example programs and the standalone linear solver examples +have been updated to use the new naming convention. + +The `SUNLinSol_Band` constructor has been simplified to remove the +storage upper bandwidth argument. + +SUNDIALS integrators (ARKODE, CVODE(S), and IDA(S)) have been updated to utilize +generic nonlinear solvers defined by the `SUNNonlinearSolver` API. This enables +the addition of new nonlinear solver options and allows for external or +user-supplied nonlinear solvers. The nonlinear solver API and SUNDIALS provided +implementations are described in the user guide and follow the same object +oriented design used by the `N_Vector`, `SUNMatrix`, and `SUNLinearSolver` +classes. Currently two nonlinear solver implementations are provided, Newton and +fixed-point. These replicate the previous integrator-specific implementations of +Newton's method and a fixed-point iteration (previously referred to as a +functional iteration), respectively. Note the new fixed-point implementation can +optionally utilize Anderson's method to accelerate convergence. Example programs +using each of these nonlinear solvers in a standalone manner have been added and +all example programs have been updated accordingly. + +The SUNDIALS integrators (ARKODE, CVODE(S), and IDA(S)) all now use the Newton +`SUNNonlinearSolver` by default. Users that wish to use the fixed-point +`SUNNonlinearSolver` will need to create the corresponding nonlinear solver +object and attach it to the integrator with the appropriate set function: + +* `ARKStepSetNonlinearSolver` +* `CVodeSetNonlinearSolver` +* `IDASetNonlinearSolver` + +Functions for setting the nonlinear solver options or getting nonlinear solver +statistics remain unchanged and internally call generic `SUNNonlinearSolver` +functions as needed. + +With the introduction of the `SUNNonlinearSolver` class, the input parameter +`iter` to `CVodeCreate` has been removed along with the function +`CVodeSetIterType` and the constants `CV_NEWTON` and `CV_FUNCTIONAL`. While +SUNDIALS includes a fixed-point nonlinear solver, it is not currently supported +in IDA. Three fused vector operations and seven vector array operations have been added -to the NVECTOR API. These optional operations are disabled by default and may be -activated by calling vector specific routines after creating an NVECTOR. See the -NVECTOR chapter in the user guides for more information on the new operations. +to the `N_Vector` API. These *optional* operations are disabled by default and +may be activated by calling vector specific routines after creating a vector +(see the `N_Vector` chapter for more details). The new operations are intended +to increase data reuse in vector operations, reduce parallel communication on +distributed memory systems, and lower the number of kernel launches on systems +with accelerators. The fused operations are: + +* `N_VLinearCombination` +* `N_VScaleAddMulti` +* `N_VDotProdMulti` + +and the vector array operations are: + +* `N_VLinearCombinationVectorArray` +* `N_VScaleVectorArray` +* `N_VConstVectorArray` +* `N_VWrmsNormVectorArray` +* `N_VWrmsNormMaskVectorArray` +* `N_VScaleAddMultiVectorArray` +* `N_VLinearCombinationVectorArray` + +If an `N_Vector` implementation defines the implementation any of these +operations as `NULL`, then standard vector operations will automatically be +called as necessary to complete the computation. -Added a new NVECTOR (NVECTOR_OPENMPDEV) which leverages OpenMP 4.5+ device -offloading. +A new `N_Vector` implementation, `OpenMPDEV`, leveraging OpenMP device +offloading has been added. -Multiple updates to the CUDA NVECTOR were made: +Multiple updates to the CUDA vector were made: * Changed the `N_VMake_Cuda` function to take a host data pointer and a device data pointer instead of an `N_VectorContent_Cuda` object. @@ -1808,16 +1990,16 @@ Multiple updates to the CUDA NVECTOR were made: * Added `N_VGetMPIComm_Cuda` to return the MPI communicator used. -* Removed the accessor functions in the namespace suncudavec. +* Removed the accessor functions in the `suncudavec` namespace. * Added the ability to set the `cudaStream_t` used for execution of the CUDA - NVECTOR kernels. See the function `N_VSetCudaStreams_Cuda`. + vector kernels. See the function `N_VSetCudaStreams_Cuda`. * Added `N_VNewManaged_Cuda`, `N_VMakeManaged_Cuda`, and `N_VIsManagedMemory_Cuda` functions to accommodate using managed memory with - the CUDA NVECTOR. + the CUDA vector. -Multiple updates to the RAJA NVECTOR were made: +Multiple updates to the RAJA vector were made: * Changed `N_VGetLength_Raja` to return the global vector length instead of the local vector length. @@ -1826,27 +2008,48 @@ Multiple updates to the RAJA NVECTOR were made: * Added `N_VGetMPIComm_Raja` to return the MPI communicator used. -* Removed the accessor functions in the namespace sunrajavec. +* Removed the accessor functions in the `sunrajavec` namespace. -Two changes were made in the CVODE/CVODES/ARKODE initial step size algorithm: +Two changes were made in the ARKODE and CVODE(S) initial step size algorithm: - * Fixed an efficiency bug where an extra call to the RHS function was made. +* Fixed an efficiency bug where an extra call to the RHS function was made. - * Changed the behavior of the algorithm if the max-iterations case is hit. - Before the algorithm would exit with the step size calculated on the - penultimate iteration. Now it will exit with the step size calculated - on the final iteration. +* Changed the behavior of the algorithm if the max-iterations case is hit. + Before the algorithm would exit with the step size calculated on the + penultimate iteration. Now it will exit with the step size calculated + on the final iteration. Fortran 2003 interfaces to CVODE, the fixed-point and Newton nonlinear solvers, the dense, band, KLU, PCG, SPBCGS, SPFGMR, SPGMR, and SPTFQMR linear solvers, -and the serial, PThreads, and OpenMP NVECTORs have been added. +and the serial, PThreads, and OpenMP vectors have been added. The ARKODE library has been entirely rewritten to support a modular approach to -one-step methods, which should allow for rapid research and development of novel -integration methods without affecting existing solver functionality. - -A new ARKODE stepper, MRIStep, has been added for two rate explicit-explicit -multirate infinitesimal step methods. +one-step methods, which should allow rapid research and development of novel +integration methods without affecting existing solver functionality. To support +this, the existing ARK-based methods have been encapsulated inside the new +`ARKStep` time-stepping module. Two new time-stepping modules have been added: + +* The `ERKStep` module provides an optimized implementation for explicit + Runge--Kutta methods with reduced storage and number of calls to the ODE + right-hand side function. + +* The `MRIStep` module implements two-rate explicit-explicit multirate + infinitesimal step methods utilizing different step sizes for slow and fast + processes in an additive splitting. + +This restructure has resulted in numerous small changes to the user interface, +particularly the suite of "Set" routines for user-provided solver parameters and +"Get" routines to access solver statistics, that are now prefixed with the name +of time-stepping module (e.g., `ARKStep` or `ERKStep`) instead of +`ARKODE`. Aside from affecting the names of these routines, user-level changes +have been kept to a minimum. However, we recommend that users consult both this +documentation and the ARKODE example programs for further details on the updated +infrastructure. + +As part of the ARKODE restructuring an `ARKodeButcherTable` structure +has been added for storing Butcher tables. Functions for creating new Butcher +tables and checking their analytic order are provided along with other utility +routines. For more details see the Butcher Table section in the user guide. ARKODE's dense output infrastructure has been improved to support higher-degree Hermite polynomial interpolants (up to degree 5) over the last successful time @@ -1854,92 +2057,131 @@ step. ## Changes to SUNDIALS in release 3.2.1 -Fixed a bug in the CUDA NVECTOR where the `N_VInvTest` operation could write +Fixed a bug in the CUDA vector where the `N_VInvTest` operation could write beyond the allocated vector data. -Fixed library installation path for multiarch systems. This fix changes the -default library installation path to `CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR` -from `CMAKE_INSTALL_PREFIX/lib`. `CMAKE_INSTALL_LIBDIR` is automatically set, -but is available as a CMAKE option that can modified. +Fixed the library installation path for multiarch systems. This fix changes the +default library installation path from `CMAKE_INSTALL_PREFIX/lib` to +`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`. The default value library directory +name is automatically set to `lib`, `lib64`, or `lib/<multiarch-tuple>` +depending on the system, but maybe be overridden by setting +`CMAKE_INSTALL_LIBDIR`. ## Changes to SUNDIALS in release 3.2.0 -Fixed problem with index types which would occur with some compilers (e.g. -armclang) that did not define `__STDC_VERSION__`. The fix includes a -depcrecation of the current behavior of the `SUNDIALS_INDEX_TYPE` CMake option. - -Fixed a thread-safety issue in CVODES and IDAS when using adjoint sensitivity -analysis. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than one MPI -rank when using a GPU system. The vectors assume one GPU device per MPI rank. +### Library Name Change Changed the name of the RAJA nvector library to `libsundials_nveccudaraja.lib` from `libsundials_nvecraja.lib` to better reflect that we only support CUDA as a backend for RAJA currently. -Increased CMake minimum version to 3.1.3 +### New Features + +Added hybrid MPI+CUDA and MPI+RAJA vectors to allow use of more than one MPI +rank when using a GPU system. The vectors assume one GPU device per MPI rank. + +Support for optional inequality constraints on individual components of the +solution vector has been added to CVODE and CVODES. For more details see the +Mathematical Considerations and Optional Input sections of the user guide. Use +of `CVodeSetConstraints` requires the `N_Vector` operations `N_VMinQuotient`, +`N_VConstrMask`, and `N_VCompare` that were not previously required by CVODE and +CVODES. + +### CMake Updates -Add constraint handling feature to CVODE and CVODES. +CMake 3.1.3 is now the minimum required CMake version. + +Deprecated the behavior of the `SUNDIALS_INDEX_TYPE` CMake option and added the +`SUNDIALS_INDEX_SIZE` CMake option to select the `sunindextype` integer size. + +The native CMake FindMPI module is now used to locate an MPI installation. + +If MPI is enabled and MPI compiler wrappers are not set, the build system will +check if `CMAKE_<language>_COMPILER` can compile MPI programs before trying to +locate and use an MPI installation. + +The previous options for setting MPI compiler wrappers and the executable for +running MPI programs have been have been deprecated. The new options that align +with those used in native CMake FindMPI module are `MPI_C_COMPILER`, +`MPI_CXX_COMPILER`, `MPI_Fortran_COMPILER`, and `MPIEXEC_EXECUTABLE`. + +When a Fortran name-mangling scheme is needed (e.g., `ENABLE_LAPACK` is `ON`) +the build system will infer the scheme from the Fortran compiler. If a Fortran +compiler is not available or the inferred or default scheme needs to be +overridden, the advanced options `SUNDIALS_F77_FUNC_CASE` and +`SUNDIALS_F77_FUNC_UNDERSCORES` can be used to manually set the name-mangling +scheme and bypass trying to infer the scheme. + +Parts of the main `CMakeLists.txt` file were moved to new files in the `src` and +`example` directories to make the CMake configuration file structure more +modular. + +### Bug Fixes + +Fixed a problem with setting `sunindextype` which would occur with some +compilers (e.g. `armclang`) that do not define `__STDC_VERSION__`. + +Fixed a thread-safety issue in CVODES and IDAS when using adjoint sensitivity +analysis. Fixed a bug in IDAS where the saved residual value used in the nonlinear solve for consistent initial conditions was passed as temporary workspace and could be overwritten. -Several changes were made to the build system. If MPI is enabled and MPI -compiler wrappers are not set, the build system will check if -`CMAKE_<language>_COMPILER` can compile MPI programs before trying to locate and -use an MPI installation. The native CMake FindMPI module is now used to locate -an MPI installation. The options for setting MPI compiler wrappers and the -executable for running MPI programs have been updated to align with those in -native CMake FindMPI module. This included changing `MPI_MPICC` to -`MPI_C_COMPILER`, `MPI_MPICXX` to `MPI_CXX_COMPILER` combining `MPI_MPIF77` and -`MPI_MPIF90` to `MPI_Fortran_COMPILER`, and changing `MPI_RUN_COMMAND` to -`MPIEXEC_EXECUTABLE`. When a Fortran name-mangling scheme is needed (e.g., -`LAPACK_ENABLE` is `ON`) the build system will infer the scheme from the Fortran -compiler. If a Fortran compiler is not available or the inferred or default -scheme needs to be overridden, the advanced options `SUNDIALS_F77_FUNC_CASE` and -`SUNDIALS_F77_FUNC_UNDERSCORES` can be used to manually set the name-mangling -scheme and bypass trying to infer the scheme. Additionally, parts of the main -`CMakeLists.txt` file were moved to new files in the src and example directories -to make the CMake configuration file structure more modular. - ## Changes to SUNDIALS in release 3.1.2 -Fixed Windows specific problem where `sunindextype` was not correctly defined -when using 64-bit integers. On Windows `sunindextype` is now defined as the MSVC -basic type `__int64`. - -Changed LICENSE install path to `instdir/include/sundials`. +### CMake Updates Updated the minimum required version of CMake to 2.8.12 and enabled using rpath by default to locate shared libraries on OSX. -The misnamed function `CVSpilsSetJacTimesSetupFnBS` in cvodes has been -deprecated and replaced by `CVSpilsSetJacTimesBS`. The deprecated function -`CVSpilsSetJacTimesSetupFnBS` will be removed in the next major release. - -Added and updated usage-notes examples from the SUNDIALS website to work with -SUNDIALS 3.x. The new examples are `cvode/cvDisc_dns.c`, -`cvode/cvRoberts_dns_negsol.c`, and `cvodes/cvsRoberts_FSA_dns_Switch.c`. +### New Features -Added sparse SUNMatrix "Reallocate" routine to allow specification of the -nonzero storage. +Added the function `SUNSparseMatrix_Reallocate` to allow specification of the +matrix nonzero storage. -Updated the KLU SUNLinearSolver module to set constants for the two -reinitialization types, and fixed a bug in the full reinitialization approach -where the sparse SUNMatrix pointer would go out of scope on some architectures. +Added named constants for the two reinitialization types for the KLU +SUNLinearSolver. -Updated the "ScaleAdd" and "ScaleAddI" implementations in the sparse SUNMatrix -module to more optimally handle the case where the target matrix contained +Updated the `SUNMatScaleAdd` and `SUNMatScaleAddI` implementations in the sparse +SUNMatrix to more optimally handle the case where the target matrix contained sufficient storage for the sum, but had the wrong sparsity pattern. The sum now -occurs in-place, by performing the sum backwards in the existing storage. -However, it is still more efficient if the user-supplied Jacobian routine -allocates storage for the sum I + gamma J or M + gamma J manually (with zero -entries if needed). +occurs in-place, by performing the sum backwards in the existing +storage. However, it is still more efficient if the user-supplied Jacobian +routine allocates storage for the sum `M + gamma J` or `M + gamma J` manually +(with zero entries if needed). + +The following examples from the usage notes page of the SUNDIALS website, and +updated them to work with SUNDIALS 3.x: + +* `cvDisc_dns.c` demonstrates using CVODE with discontinuous solutions or RHS. + +* `cvRoberts_dns_negsol.c` illustrates the use of the RHS function return + value to control unphysical negative concentrations. + +* `cvRoberts_FSA_dns_Switch.c` demonstrates switching on/off forward + sensitivity computations. This example came from the usage notes page of the + SUNDIALS website. + +### Bug Fixes + +Fixed a Windows specific problem where `sunindextype` was not correctly defined +when using 64-bit integers. On Windows `sunindextype` is now defined as the MSVC +basic type `__int64`. + +Fixed a bug in the full KLU SUNLinearSolver reinitialization approach where the +sparse SUNMatrix pointer would go out of scope on some architectures. + +The misnamed function `CVSpilsSetJacTimesSetupFnBS` has been deprecated and +replaced by `CVSpilsSetJacTimesBS`. The deprecated function +`CVSpilsSetJacTimesSetupFnBS` will be removed in the next major release. + +Changed LICENSE install path to `instdir/include/sundials`. ## Changes to SUNDIALS in release 3.1.1 +### Bug Fixes + Fixed a minor bug in the CVODE and CVODES `cvSLdet` routine, where a return was missing in the error check for three inconsistent roots. @@ -1947,373 +2189,840 @@ Fixed a potential memory leak in the SPGMR and SPFGMR linear solvers: if "Initialize" was called multiple times then the solver memory was reallocated (without being freed). -Fixed a minor bug in the `ARKReInit` routine, where a flag was incorrectly set -to indicate that the problem had been resized (instead of just re-initialized). +Fixed a minor bug in `ARKReInit`, where a flag was incorrectly set to indicate +that the problem had been resized (instead of just re-initialized). Fixed C++11 compiler errors/warnings about incompatible use of string literals. -Updated KLU SUNLinearSolver module to use a typedef for the precision-specific -solve function to be used (to avoid compiler warnings). +Updated the KLU SUNLinearSolver to use a typedef for the precision-specific +solve functions to avoid compiler warnings. Added missing typecasts for some (`void*`) pointers to avoid compiler warnings. -Bugfix in `sunmatrix_sparse.c` where `int` was used instead of `sunindextype` in -one location. +Fixed bug in the sparse SUNMatrix where `int` was used instead of +`sunindextype` in one location. Fixed a minor bug in `KINPrintInfo` where a case was missing for `KIN_REPTD_SYSFUNC_ERR` leading to an undefined info message. -Added missing `#include <stdio.h>` in NVECTOR and SUNMATRIX header files. +Added missing `#include <stdio.h>` in `N_Vector` and `SUNMatrix` header files. Added missing prototypes for `ARKSpilsGetNumMTSetups` in ARKODE and `IDASpilsGetNumJTSetupEvals` in IDA and IDAS. -Fixed an indexing bug in the CUDA NVECTOR implementation of `N_VWrmsNormMask` -and revised the RAJA NVECTOR implementation of `N_VWrmsNormMask` to work with -mask arrays using values other than zero or one. Replaced `double` with -`realtype` in the RAJA vector test functions. +Fixed an indexing bug in the CUDA vector implementation of `N_VWrmsNormMask` and +revised the RAJA vector implementation of `N_VWrmsNormMask` to work with mask +arrays using values other than zero or one. Replaced `double` with `realtype` in +the RAJA vector test functions. Fixed compilation issue with GCC 7.3.0 and Fortran programs that do not require -a SUNMatrix or SUNLinearSolver module (e.g. iterative linear solvers, explicit -methods in ARKODE, functional iteration in CVODE, etc.). +a `SUNMatrix` or `SUNLinearSolver` e.g., iterative linear solvers, explicit +methods in ARKODE, functional iteration in CVODE, etc. ## Changes to SUNDIALS in release 3.1.0 -Added NVECTOR print functions that write vector data to a specified file (e.g., -`N_VPrintFile_Serial`). +Added `N_Vector` print functions that write vector data to a specified file +(e.g., `N_VPrintFile_Serial`). Added `make test` and `make test_install` options to the build system for testing SUNDIALS after building with `make` and installing with `make install` respectively. -Added "Changes in ..." (latest version) to all User Guides. - ## Changes to SUNDIALS in release 3.0.0 +### Major Feature + Added new linear solver and matrix interfaces for all SUNDIALS packages and -updated the existing linear solver and matrix modules. The goal of the redesign -is to provide greater encapsulation and ease interfacing custom linear solvers -with linear solver libraries. Specific changes include: - - * Added generic SUNMATRIX module with three provided implementations: - dense, banded and sparse. These replicate previous SUNDIALS Dls and - Sls matrix structures in a single object-oriented API. - - * Added example problems demonstrating use of generic SUNMATRIX modules. - - * Added generic SUNLINEARSOLVER module with eleven provided - implementations: dense, banded, LAPACK dense, LAPACK band, KLU, - SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, PCG. These replicate - previous SUNDIALS generic linear solvers in a single object-oriented - API. - - * Added example problems demonstrating use of generic SUNLINEARSOLVER - modules. - - * Expanded package-provided direct linear solver (Dls) interfaces and - scaled, preconditioned, iterative linear solver (Spils) interfaces - to utilize generic SUNMATRIX and SUNLINEARSOLVER objects. - - * Removed package-specific, linear solver-specific, solver modules - (e.g. CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since their functionality - is entirely replicated by the generic Dls/Spils interfaces and - SUNLINEARSOLVER/SUNMATRIX modules. The exception is CVDIAG, a - diagonal approximate Jacobian solver available to CVODE and CVODES. - - * Converted all SUNDIALS example problems to utilize new generic - SUNMATRIX and SUNLINEARSOLVER objects, along with updated Dls and - Spils linear solver interfaces. - - * Added Spils interface routines to ARKODE, CVODE, CVODES, IDA and - IDAS to allow specification of a user-provided "JTSetup" routine. - This change supports users who wish to set up data structures for - the user-provided Jacobian-times-vector ("JTimes") routine, and - where the cost of one JTSetup setup per Newton iteration can be - amortized between multiple JTimes calls. +updated the existing linear solver and matrix implementations. The goal of the +redesign is to provide greater encapsulation and ease interfacing custom linear +solvers with linear solver libraries. Specific changes include: -Corresponding updates were made to all the example programs. +* Added a `SUNMatrix` interface with three provided implementations: + dense, banded, and sparse. These replicate previous SUNDIALS direct (Dls) and + sparse (Sls) matrix structures. -Two new NVECTOR modules added: for CUDA and RAJA support for GPU systems -(Information on RAJA: <https://software.llnl.gov/RAJA/> ) -These vectors are supplied to provide very basic support for running -on GPU architectures. Users are advised that these vectors both move all data -to the GPU device upon construction, and speedup will only be realized if the -user also conducts the right-hand-side function evaluation on the device. -In addition, these vectors assume the problem fits on one GPU. -For further information about RAJA, users are referred to the web site, -<https://software.llnl.gov/RAJA/.> +* Added example problems demonstrating use of the matrices. -Addition of sunindextype option for 32-bit or 64-bit integer data index types -within all SUNDIALS structures +* Added a `SUNLinearSolver` interface with eleven provided implementations: + dense, banded, LAPACK dense, LAPACK band, KLU, SuperLU_MT, SPGMR, SPBCGS, + SPTFQMR, SPFGMR, PCG. These replicate previous SUNDIALS generic linear + solvers. - * sunindextype is defined to be int32_t or int64_t when portable types are - supported, otherwise it is defined as int or long int. +* Added example problems demonstrating use of the linear solvers. - * The Fortran interfaces continue to use `long int` for indices, except for - their sparse matrix interface that now uses the new sunindextype. +* Expanded package-provided direct linear solver (Dls) interfaces and scaled, + preconditioned, iterative linear solver (Spils) interfaces to utilize + `SUNMatrix` and `SUNLinearSolver` objects. - * Includes interfaces to PETSc, hypre, SuperLU_MT, and KLU with either 32-bit - or 64-bit capabilities depending how the user configures SUNDIALS. +* Removed package-specific, linear solver-specific, solver modules (e.g., + CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since their functionality is entirely + replicated by the generic Dls/Spils interfaces and `SUNLinearSolver` / + `SUNMatrix` classes. The exception is `CVDIAG`, a diagonal + approximate Jacobian solver available to CVODE and CVODES. -To avoid potential namespace conflicts, the macros defining booleantype -values TRUE and FALSE have been changed to SUNTRUE and SUNFALSE respectively. +* Converted all SUNDIALS example problems to utilize new the new matrix and + linear solver objects, along with updated Dls and Spils linear solver + interfaces. -Temporary vectors were removed from preconditioner setup and solve -routines for all packages. It is assumed that all necessary data -for user-provided preconditioner operations will be allocated and -stored in user-provided data structures. +* Added Spils interface routines to ARKODE, CVODE, CVODES, IDA and IDAS to allow + specification of a user-provided `JTSetup` routine. This change supports + users who wish to set up data structures for the user-provided + Jacobian-times-vector (`JTimes`) routine, and where the cost of one + `JTSetup` setup per Newton iteration can be amortized between multiple + `JTimes` calls. -The file include/sundials\_fconfig.h was added. This file contains -SUNDIALS type information for use in Fortran programs. +Corresponding updates were made to all the example programs. -Added support for many xSDK-compliant build system keys -(Information on xSDK compliance: <https://xsdk.info/policies/> ) -The xSDK is a movement in scientific software to provide a foundation for the -rapid and efficient production of high-quality, -sustainable extreme-scale scientific applications. More information can -be found at <https://xsdk.info.> +### New Features + +CUDA and RAJA `N_Vector` implementations to support GPU systems. These vectors +are supplied to provide very basic support for running on GPU architectures. +Users are advised that these vectors both move all data to the GPU device upon +construction, and speedup will only be realized if the user also conducts the +right-hand-side function evaluation on the device. In addition, these vectors +assume the problem fits on one GPU. For further information about RAJA, users +are referred to the [RAJA web site](https://software.llnl.gov/RAJA/). + +Added the type `sunindextype` to support using 32-bit or 64-bit integer types +for indexing arrays within all SUNDIALS structures. `sunindextype` is defined to +`int32_t` or `int64_t` when portable types are supported, otherwise it is +defined as `int` or `long int`. The Fortran interfaces continue to use `long +int` for indices, except for the sparse matrix interface that now uses +`sunindextype`. Interfaces to PETSc, hypre, SuperLU_MT, and KLU have been +updated with 32-bit or 64-bit capabilities depending how the user configures +SUNDIALS. + +To avoid potential namespace conflicts, the macros defining `booleantype` values +`TRUE` and `FALSE` have been changed to `SUNTRUE` and `SUNFALSE` respectively. + +Temporary vectors were removed from preconditioner setup and solve routines for +all packages. It is assumed that all necessary data for user-provided +preconditioner operations will be allocated and stored in user-provided data +structures. + +The file `include/sundials_fconfig.h` was added. This file contains SUNDIALS +type information for use in Fortran programs. + +Added support for many xSDK-compliant build system keys. For more information on +on xSDK compliance the [xSDK policies](https://xsdk.info/policies/). The xSDK +is a movement in scientific software to provide a foundation for the rapid and +efficient production of high-quality, sustainable extreme-scale scientific +applications. For more information visit the +[xSDK web site](https://xsdk.info). + +Added functions `SUNDIALSGetVersion` and `SUNDIALSGetVersionNumber` to get +SUNDIALS release version information at runtime. -Added functions SUNDIALSGetVersion and SUNDIALSGetVersionNumber to -get SUNDIALS release version information at runtime. +Added comments to `arkode_butcher.c` regarding which methods should have +coefficients accurate enough for use in quad precision. ### Build System -Renamed CMake options to enable/disable examples for greater clarity -and added option to enable/disable Fortran 77 examples: +Renamed CMake options to enable/disable examples for greater clarity and added +option to enable/disable Fortran 77 examples: - * Changed `EXAMPLES_ENABLE` to `EXAMPLES_ENABLE_C` - * Changed `CXX_ENABLE` to `EXAMPLES_ENABLE_CXX` - * Changed `F90_ENABLE` to `EXAMPLES_ENABLE_F90` - * Added `EXAMPLES_ENABLE_F77` option +* Changed `EXAMPLES_ENABLE` to `EXAMPLES_ENABLE_C` +* Changed `CXX_ENABLE` to `EXAMPLES_ENABLE_CXX` +* Changed `F90_ENABLE` to `EXAMPLES_ENABLE_F90` +* Added `EXAMPLES_ENABLE_F77` option -Added separate `BLAS_ENABLE` and `BLAS_LIBRARIES` CMake variables +Added separate `BLAS_ENABLE` and `BLAS_LIBRARIES` CMake variables. Fixed minor CMake bugs and included additional error checking during CMake -configuration - -Corrections and additions to all User Guides. +configuration. -Added "Changes in ..." (latest version) section to the introduction to in all -User Guides. +### Bug Fixes -### ARKODE - -Added comments to `arkode_butcher.c` regarding which methods should have -coefficients accurate enough for use in quad precision. +#### ARKODE Fixed `RCONST` usage in `arkode_butcher.c`. Fixed bug in `arkInitialSetup` to ensure the mass matrix vector product is set up before the "msetup" routine is called. -Fixed ARKODE printf-related compiler warnings when building SUNDIALS +Fixed ARKODE `printf`-related compiler warnings when building SUNDIALS with extended precision. -### CVODE and CVODES +#### CVODE and CVODES -In `CVodeFree`, now call `lfree` unconditionally (if non-NULL). +In `CVodeFree` now calls `lfree` unconditionally (if non-NULL). -### IDA and IDAS +#### IDA and IDAS Added missing prototype for `IDASetMaxBacksIC` in `ida.h` and `idas.h`. -### KINSOL +#### KINSOL -Corrected KINSOL fcmix name translation for `FKIN_SPFGMR`. +Corrected KINSOL Fortran name translation for `FKIN_SPFGMR`. Renamed `KINLocalFn` and `KINCommFn` to `KINBBDLocalFn` and `KINBBDCommFn` respectively in the BBD preconditioner module for consistency with other SUNDIALS solvers. -## Changes to SUNDIALS in release v2.7.0 - -- Two new NVECTOR modules added: for _hypre_ ParVector and PETSC. -- In vector API, added new required function, N\_VGetVectorID. -- Upgrades to sparse solver interfaces; now support CSR matrix type with KLU solver. -- In all packages, example codes were changed from using NV\_DATA macro to using N\_VGetArrayPointer\_\* when using the native vectors shipped with SUNDIALS -- In all packages, fixed memory leak in banded preconditioner interface. -- Fixed some examples w.r.t. switch to new macro/function names SUNRexp etc. -- Various minor fixes to installation-related files. -- Corrected name N\_VCloneEmptyVectorArray to N\_VCloneVectorArrayEmpty in all documentation files. -- Updated all packages to return integers from linear solver and preconditioner 'free' functions. -- Removed Matlab interface from distribution as it has not been updated since 2009. We expect to update this interface soon. -- In FKINSOL, FCVODE, and FIDA, added missing Fortran interface routines so that users can supply the sparse Jacobian routine. -- Minor corrections and additions to all User Guides, including removal of references to specific NVECTOR names in usage skeletons. -- Additional example programs added throughout. -- In CVODE - - in FCVODE, fixed argument order bugs in FCVKLU and FCVSUPERLUMT linear solver interfaces. -- In CVODES - - changed each \*\*FreeB() to type int; added return(0) to each. - - in interpolation routines for backward problems, added logic to bypass sensitivity interpolation if input sensitivity argument is NULL. -- In ARKODE - - updated linear and mass matrix solvers so that 'free' routines return integer instead of void; updated documentation accordingly. - - fixed initialization of linear solver performance counters. - - method and embedding for Billington and TRBDF2 explicit Runge-Kutta methods were swapped. - - fix for user specification of absolute tolerance array along with vector Resize() functionality. - - fix for user-supplied Butcher tables without embeddings (if fixed time steps or manual adaptivity are employed). - - multiple documentation updates. - - added missing ARKSpilsGetNumMtimesEvals() function. - - implicit predictor algorithms were updated: methods 2 and 3 were improved, a new predictor approach was added, and the default choice was modified. - - revised handling of integer codes for specifying built-in Butcher tables: a global numbering system is still used, but methods now have #defined names to simplify the user interface. - - maximum number of Butcher table stages was increased from 8 to 15 to accommodate very high-order methods, and an 8th-order adaptive ERK method was added. - - added support for the explicit and implicit methods in an additive Runge-Kutta method to utilize different stage times, solution and embedding coefficients, to support new SSP-ARK methods. - - extended FARKODE interface to include a routine to set scalar/array-valued residual tolerances, to support Fortran applications with non-identity mass-matrices. -- In IDA - - corrected example idaFoodWeb\_bnd.c in PrintOutput (wrong component printed). - - added optional input function IDASetMaxBacksIC to limit number of linesearch backtrack operations in IDACalcIC. User guides amended accordingly. -- In IDAS - - added optional input function IDASetMaxBacksIC to limit number of linesearch backtrack operations in IDACalcIC. User guides amended accordingly. - - changed each \*\*FreeB() to type int; added return(0) to each. - - in interpolation routines for backward problems, added logic to bypass sensitivity interpolation if input sensitivity argument is NULL. -- In KINSOL - - minor bug fix in Picard iteration. - - minor bug fix in line search to prevent infinite loop when beta condition fails and lambda is below minimum size. - -## Changes to SUNDIALS in release v2.6.2 - -- In IDAS, added missing backward problem support functions: IDALapackDenseB, IDALapackDenseFreeB, IDALapackBandB, IDALapackBandFreeB -- In KINSOL and ARKode, updated Anderson acceleration implementation with QR updating. -- Updated BiCGStab solver to remove redundant dot product call. -- Minor corrections and additions to all User Guides. -- In CVODES and IDAS header files, corrected documentation of backward integration functions, especially the 'which' argument. -- In CVODES, added DVKLUB prototype and corrected CVSuperLUMTB prototype. -- In IDAS, made SuperLUMT call for backward problem consistent with CVODES. -- In CVODES and IDAS, added ReInit and SetOrdering wrappers for backward problems. Fixed potential memory leak in KLU ReInit functions in all solvers. -- In CVODE, IDA, and ARKode, fixed Fortran interfaces to enable calls to \*GetErrWeights, \*GetEstLocalErrors, and \*GetDky within a time step. In ARKode, fixed a bug in one Butcher table. -- In ARKode, fixed error in arkDoErrorTest in recovery after failure. -- In IDAS, fixed for-loop bugs in IDAAckpntAllocVectors Various minor fixes to installation-related files. - -## Changes to SUNDIALS in release v2.6.1 - -- Fixed loop limit bug in SlsAddMat function. -- In all six solver interfaces to KLU and SuperLUMT, added #include lines, and removed redundant KLU structure allocations. -- Numerous minor documentation improvements -- Minor bug fixes in ARKode - -## Changes to SUNDIALS in release v2.6.0 - -- Addition of ARKode package of explicit, implicit, and additive Runge-Kutta methods for ODES. This package API is close to CVODE so switching between the two should be straightforward. Thanks go to Daniel Reynolds for the addition of this package. -- Addition of support for two sparse direct solver packages when using the serial vector structure, KLU and SuperLU\_MT. exploits highly sparse systems. SuperLU\_MT supports multithreading in the factorization. -- Addition of openMP and PThreads vector kernels. -- Addition of fixed point and Picard iterative solvers within KINSOL. These are both optionally accelerated with Anderson acceleration. -- Addition of FGMRES support for KINSOL. -- Removal of autotools configuration support. We now exclusively use CMake. -- Numerous bug fixes throughout. - -## Changes to SUNDIALS in release v2.5.0 - -- Changes to user interface - - Problem size and related integers (bandwidth parameters etc.) all have type long int, except in BLAS and LAPACK routines. Function NewIntArray is replaced by a pair NewIntArray/NewLintArray, for int and long int arrays, respectively. - -## Changes to SUNDIALS in release v2.4.0 - -- New features - - new linear solver module, based on Blas and Lapack for both dense and banded matrices. -- Changes to user interface - - reorganization of all linear solver modules into two families (besides the existing family of scaled preconditioned iterative linear solvers, the direct solvers, including the new Lapack-based ones, were also organized into a direct family). -- Changes related to the build system - - provide CMake-based build option, in addition to that based on autotools. - -## Changes to SUNDIALS in release v2.3.0 - -- Changes to the user interface - - modified the functions in the generic dense linear solver (sundials\_dense and sundials\_smalldense) to work for rectangular m by n matrices (m ≤ n). - - renamed the factorization and solution functions in the generic dense linear solver to DenseGETRF/denGETRF and DenseGETRS/denGETRS, respectively. - - renamed the factorization and solution functions in the generic band linear solver to BandGBTRF and BandGBTRS, respectively. -- Changes related to the build system - - rearranged the entire SUNDIALS source tree - - all exported header files are now installed in separate subdirectories of the installation include directory - - header files are included now by specifying the relative path (e.g., #include \<sundials/sundials\_types.h\>) - -## Changes to SUNDIALS in release v2.2.0 - -- New features - - added SPBCG (scaled preconditioned Bi-CGStab) linear solver module - - added SPTFQMR (scaled preconditioned TFQMR) linear solver module -- Changes related to the build system - - updated configure script and Makefiles for Fortran examples to avoid C++ compiler errors (now use CC and MPICC to link only if necessary) - - SUNDIALS shared header files are installed under a sundials subdirectory of the installation include directory - - the shared object files are now linked into each SUNDIALS library rather than into a separate libsundials\_shared library -- Changes to the user interface - - added prefix sundials\_ to all shared header files - -## Changes to SUNDIALS in release v2.1.1 - -- Changes to the generic NVECTOR module - - N\_VCloneEmpty was added to the global vector operations table - -## Changes to SUNDIALS in release v2.0.2 - -- Changes related to the build system - - fixed autoconf-related bug to allow configuration with the PGI Fortran compiler - - modified to use customized detection of the Fortran name mangling scheme (autoconf's AC\_F77\_WRAPPERS routine is problematic on some platforms) - -## Changes to SUNDIALS in release v2.0.1 - -- Changes related to the build system - - changed order of compiler directives in header files to avoid compilation errors when using a C++ compiler. - - changed method of generating sundials\_config.h to avoid potential warnings of redefinition of preprocessor symbols. - -## Changes to SUNDIALS in release v2.0.0 - -- Changes to the generic NVECTOR module - - removed machEnv, redefined table of vector operations (now contained in the N\_Vector structure itself). - - all SUNDIALS functions create new N\_Vector variables through cloning, using an N\_Vector passed by the user as a template. - - a particular NVECTOR implementation is supposed to provide user-callable constructor and destructor functions. - - removed from structure of vector operations the following functions: N\_VNew, N\_VNew\_S, N\_VFree, N\_VFree\_S, N\_VMake, N\_VDispose, N\_VGetData, N\_VSetData, N\_VConstrProdPos, and N\_VOneMask. - - added in structure of vector operations the following functions: N\_VClone, N\_VDestroy, N\_VSpace, N\_VGetArrayPointer, N\_VSetArrayPointer, and N\_VWrmsNormMask. - - Note that nvec\_ser and nvec\_par are now separate modules outside the shared SUNDIALS module. -- Changes to the generic linear solvers - - in SPGMR, added a dummy N\_Vector argument to be used as a template for cloning. - - in SPGMR, removed N (problem dimension) from argument list of SpgmrMalloc. - - iterative.{c,h} replace iterativ.{c,h} - - modified constant names in iterative.h (preconditioner types are prefixed with 'PREC\_'). - - changed numerical values for MODIFIED\_GS (from 0 to 1) and CLASSICAL\_GS (from 1 to 2). -- Changes to sundialsmath submodule - - replaced internal routine for estimation of unit roundoff with definition of unit roundoff from float.h - - modified functions to call appropriate math routines given the precision level specified by the user. -- Changes to sundialstypes submodule - - removed type 'integertype'. - - added definitions for 'BIG\_REAL', 'SMALL\_REAL', and 'UNIT\_ROUNDOFF' using values from float.h based on the precision. - - changed definition of macro RCONST to depend on precision. - -# sundialsTB - -sundialsTB is no longer distributed as of sundials v. 2.7.0 as it has not been updated in many years. - -## What's new in v2.5.0? - -- Bug fixes - - fixed lines setting etachoice in kimOpts.c - - in cvm.c and idm.c, fixed size of rootsfound array; added lines to free rootsfound and ckpnt arrays when done using each -- What's new in v2.4.0? -- New Features - - the Matlab interface to IDAS was extended to provide sensitivity analysis capabilities. -- Changes to user interface - - the API for adjoint sensitivity analysis (cvodes and idas) was modified to support simultaneous integration of multiple backward problems. - -## What's new in v2.3.0? - -- New features - - added Matlab interface to IDA (named idas) - - on platforms which support configure scripts, installation of sundialsTB can now be enabled while configuring SUNDIALS and installed through make and make install (provided a working MEX compiler is found). -- Bug fixes - - the installation script install\_STB.m was modified to increase robustness on various platforms (related to path and file names). -- Changes to user interface - - (cvodes) for improved legibility, some of the keys for forward sensitivity optional inputs were renamed. - - (cvodes) removed xaxis type option for the internal monitoring function CVodeMonitor. - -## What's new in v2.2.0? - -- New features - - modified installation procedure to use a Matlab script - - added sample Matlab startup file - - (cvodes) expanded CVodeMonitor - - (kinsol) added interface to KINSOL's performance monitoring function ('Verbose' option to KINSetOptions) -- Bug fixes - - (cvodes) fixed bug in interface to quadrature integration which was causing a segmentation violation when monitoring was turned on. -- Changes to user interface - - updated to reflect changes to the SUNDIALS libraries in v.2.2.0 - - (cvodes) changed the interface for sensitivity analysis (both forward and adjoint) to follow more closely the CVODES calling sequence - - (cvodes) optional inputs for forward sensitivity analysis are now provided through a separate function, CVodeSensSetOptions - - removed NVM mex interface +## Changes to SUNDIALS in release 2.7.0 + +### New Features and Enhancements + +Two additional `N_Vector` implementations were added -- one for hypre parallel +vectors and one for PETSc vectors. These additions are accompanied by additions +to various interface functions and to user documentation. + +Added a new `N_Vector` function, `N_VGetVectorID`, that returns +an identifier for the vector. + +The sparse matrix structure was enhanced to support both CSR and CSC matrix +storage formats. + +Various additions were made to the KLU and SuperLU_MT sparse linear solver +interfaces, including support for the CSR matrix format when using KLU. + +In all packages, the linear solver and preconditioner `free` routines were +updated to return an integer. + +In all packages, example codes were updated to use `N_VGetArrayPointer_*` +rather than the `NV_DATA` macro when using the native vectors shipped with +SUNDIALS. + +Additional example programs were added throughout including new examples +utilizing the OpenMP vector. + +#### ARKODE + +The ARKODE implicit predictor algorithms were updated: methods 2 and 3 were +improved slightly, a new predictor approach was added, and the default choice +was modified. + +The handling of integer codes for specifying built-in ARKODE Butcher tables was +enhanced. While a global numbering system is still used, methods now have +`#defined` names to simplify the user interface and to streamline +incorporation of new Butcher tables into ARKODE. + +The maximum number of Butcher table stages was increased from 8 to 15 to +accommodate very high order methods, and an 8th-order adaptive ERK method was +added. + +Support was added for the explicit and implicit methods in an additive +Runge--Kutta method with different stage times to support new SSP-ARK methods. + +The FARKODE interface was extended to include a routine to set +scalar/array-valued residual tolerances, to support Fortran applications with +non-identity mass-matrices. + +#### IDA and IDAS + +The optional input function `IDASetMaxBacksIC` was added to set the +maximum number of linesearch backtracks in the initial condition calculation. + +### Bug Fixes + +Various minor fixes to installation-related files. + +Fixed some examples with respect to the change to use new macro/function names +e.g., `SUNRexp`, etc. + +In all packages, a memory leak was fixed in the banded preconditioner and +banded-block-diagonal preconditioner interfaces. + +Corrected name `N_VCloneEmptyVectorArray` to `N_VCloneVectorArrayEmpty` in +all documentation files. + +Various corrections were made to the interfaces to the sparse solvers KLU and +SuperLU_MT. + +For each linear solver, the various solver performance counters are now +initialized to 0 in both the solver specification function and in the solver +`linit` function. This ensures that these solver counters are initialized upon +linear solver instantiation as well as at the beginning of the problem solution. + +#### ARKODE + +The missing `ARKSpilsGetNumMtimesEvals` function was added -- this had been +included in the previous documentation but had not been implemented. + +The choice of the method vs embedding the Billington and TRBDF2 explicit +Runge--Kutta methods were swapped, since in those the lower-order coefficients +result in an A-stable method, while the higher-order coefficients do not. This +change results in significantly improved robustness when using those methods. + +A bug was fixed for the situation where a user supplies a vector of absolute +tolerances, and also uses the vector Resize functionality. + +A bug was fixed wherein a user-supplied Butcher table without an embedding is +supplied, and the user is running with either fixed time steps (or they do +adaptivity manually); previously this had resulted in an error since the +embedding order was below 1. + +#### CVODE + +Corrections were made to three Fortran interface functions. + +In FCVODE, fixed argument order bugs in the `FCVKLU` and `FCVSUPERLUMT` +linear solver interfaces. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +#### CVODES + +A bug was fixed in the interpolation functions used in solving backward problems +for adjoint sensitivity analysis. + +In the interpolation routines for backward problems, added logic to bypass +sensitivity interpolation if input sensitivity argument is `NULL`. + +Changed each the return type of `*FreeB` functions to `int` and added +`return(0)` to each. + +#### IDA + +Corrections were made to three Fortran interface functions. + +Corrected the output from the `idaFoodWeb_bnd.c` example, the wrong component +was printed in `PrintOutput`. + +#### IDAS + +In the interpolation routines for backward problems, added logic to bypass +sensitivity interpolation if input sensitivity argument is `NULL`. + +Changed each the return type of `*FreeB` functions to `int` and added +`return(0)` to each. + +Corrections were made to three Fortran interface functions. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +#### KINSOL + +The Picard iteration return was chanegd to always return the newest iterate upon +success. + +A minor bug in the line search was fixed to prevent an infinite loop when the +beta condition fails and lambda is below the minimum size. + +Corrections were made to three Fortran interface functions. + +The functions `FKINCREATE` and `FKININIT` were added to split the +`FKINMALLOC` routine into two pieces. `FKINMALLOC` remains for backward +compatibility, but documentation for it has been removed. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +### Matlab Interfaces Removed + +Removed the Matlab interface from distribution as it has not been updated since +2009. + +## Changes to SUNDIALS in release 2.6.2 + +### New Features and Enhancements + +Various minor fixes to installation-related files + +In KINSOL and ARKODE, updated the Anderson acceleration implementation with QR +updating. + +In CVODES and IDAS, added `ReInit` and `SetOrdering` wrappers for backward +problems. + +In IDAS, fixed for-loop bugs in `IDAAckpntAllocVectors` that could lead to a +memory leak. + +### Bug Fixes + +Updated the BiCGStab linear solver to remove a redundant dot product call. + +Fixed potential memory leak in KLU `ReInit` functions in all solvers. + +In ARKODE, fixed a bug in the Cash-Karp Butcher table where the method and +embedding coefficient were swapped. + +In ARKODE, fixed error in `arkDoErrorTest` in recovery after failure. + +In CVODES, added `CVKLUB` prototype and corrected `CVSuperLUMTB` prototype. + +In the CVODES and IDAS header files, corrected documentation of backward +integration functions, especially the `which` argument. + +In IDAS, added missing backward problem support functions `IDALapackDenseB`, +`IDALapackDenseFreeB`, `IDALapackBandB`, and `IDALapackBandFreeB`. + +In IDAS, made SuperLUMT call for backward problem consistent with CVODES. + +In CVODE, IDA, and ARKODE, fixed Fortran interfaces to enable calls to +`GetErrWeights`, `GetEstLocalErrors`, and `GetDky` within a time step. + +## Changes to SUNDIALS in release 2.6.1 + +Fixed loop limit bug in `SlsAddMat` function. + +In all six solver interfaces to KLU and SuperLUMT, added `#include` lines, and +removed redundant KLU structure allocations. + +Minor bug fixes in ARKODE. + +## Changes to SUNDIALS in release 2.6.0 + +### Autotools Build Option Removed + +With this version of SUNDIALS, support and documentation of the Autotools mode +of installation is being dropped, in favor of the CMake mode, which is +considered more widely portable. + +### New Package: ARKODE + +Addition of ARKODE package of explicit, implicit, and additive Runge-Kutta +methods for ODEs. This package API is close to CVODE so switching between the +two should be straightforward. Thanks go to Daniel Reynolds for the addition +of this package. + +### New Features and Enhancements + +Added OpenMP and Pthreads `N_Vector` implementations for thread-parallel +computing environments. + +Two major additions were made to the linear system solvers available in all +packages. First, in the serial case, an interface to the sparse direct solver +KLU was added. Second, an interface to SuperLU_MT, the multi-threaded version +of SuperLU, was added as a thread-parallel sparse direct solver option, to be +used with the serial version of the `N_Vector` module. As part of these +additions, a sparse matrix (CSC format) structure was added to CVODE. + +#### KINSOL + +Two major additions were made to the globalization strategy options (`KINSol` +argument `strategy`). One is fixed-point iteration, and the other is Picard +iteration. Both can be accelerated by use of the Anderson acceleration +method. See the relevant paragraphs in the Mathematical Considerations chapter +is the user guide. + +An interface to the Flexible GMRES iterative linear solver was added. + +### Bug Fixes + +In order to avoid possible name conflicts, the mathematical macro and function +names `MIN`, `MAX`, `SQR`, `RAbs`, `RSqrt`, `RExp`, `RPowerI`, and +`RPowerR` were changed to `SUNMIN`, `SUNMAX`, `SUNSQR`, `SUNRabs`, +`SUNRsqrt`, `SUNRexp`, `SRpowerI`, and `SUNRpowerR`, respectively. These +names occur in both the solver and example programs. + +In the LAPACK banded linear solver interfaces, the line `smu = MIN(N-1,mu+ml)` +was changed to `smu = mu + ml` to correct an illegal input error for to +`DGBTRF` and `DGBTRS`. + +In all Fortran examples, integer declarations were revised so that those which +must match a C type `long int` are declared `INTEGER*8`, and a comment was +added about the type match. All other integer declarations are just +`INTEGER`. Corresponding minor corrections were made to the user guide. + +#### CVODE and CVODES + +In `cvRootFind`, a minor bug was corrected, where the input array was ignored, +and a line was added to break out of root-search loop if the initial interval +size is below the tolerance `ttol`. + +Two minor bugs were fixed regarding the testing of input on the first call to +`CVode` -- one involving `tstop` and one involving the initialization of +`*tret`. + +The example program `cvAdvDiff_diag_p` was added to illustrate the use of in +parallel. + +In the FCVODE optional input routines `FCVSETIIN` and `FCVSETRIN`, the +optional fourth argument `key_length` was removed, with hardcoded key string +lengths passed to all tests. + +In order to eliminate or minimize the differences between the sources for +private functions in CVODE and CVODES, the names of many private functions were +changed from `CV*` to `cv*` and a few other names were also changed. + +An option was added in the case of Adjoint Sensitivity Analysis with dense or +banded Jacobian. With a call to `CVDlsSetDenseJacFnBS` or +`CVDlsSetBandJacFnBS`, the user can specify a user-supplied Jacobian function +of type `CVDls***JacFnBS`, for the case where the backward problem depends on +the forward sensitivities. + +In `CVodeQuadSensInit`, the line `cv_mem->cv_fQS_data = ...` was corrected +(missing `Q`). + +In the CVODES User Guide, a paragraph was added in Section 6.2.1 on +`CVodeAdjReInit`, and a paragraph was added in Section 6.2.9 on +`CVodeGetAdjY`. In the example `cvsRoberts_ASAi_dns`, the output was revised +to include the use of `CVodeGetAdjY`. + +For the Adjoint Sensitivity Analysis case in which the backward problem depends +on the forward sensitivities, options have been added to allow for user-supplied +`pset`, `psolve`, and `jtimes` functions. + +In the example `cvsHessian_ASA_FSA`, an error was corrected in the function +`fB2`, `y2` in place of `y3` in the third term of `Ith(yBdot,6)`. + +#### IDA and IDAS + +In `IDARootfind`, a minor bug was corrected, where the input array `rootdir` +was ignored, and a line was added to break out of root-search loop if the +initial interval size is below the tolerance `ttol`. + +A minor bug was fixed regarding the testing of the input `tstop` on the first +call to `IDASolve`. + +In the FIDA optional input routines `FIDASETIIN`, `FIDASETRIN`, and +`FIDASETVIN`, the optional fourth argument `key_length` was removed, with +hardcoded key string lengths passed to all `strncmp` tests. + +An option was added in the case of Adjoint Sensitivity Analysis with dense or +banded Jacobian. With a call to `IDADlsSetDenseJacFnBS` or +`IDADlsSetBandJacFnBS`, the user can specify a user-supplied Jacobian function +of type `IDADls***JacFnBS`, for the case where the backward problem depends on +the forward sensitivities. + +#### KINSOL + +In function `KINStop`, two return values were corrected to make the values of +`uu` and `fval` consistent. + +A bug involving initialization of `mxnewtstep` was fixed. The error affects +the case of repeated user calls to `KINSol` with no intervening call to +`KINSetMaxNewtonStep`. + +A bug in the increments for difference quotient Jacobian approximations was +fixed in function `kinDlsBandDQJac`. + +In the FKINSOL module, an incorrect return value `ier` in `FKINfunc` was +fixed. + +In the FKINSOL optional input routines `FKINSETIIN`, `FKINSETRIN`, and +`FKINSETVIN`, the optional fourth argument `key_length` was removed, with +hardcoded key string lengths passed to all `strncmp` tests. + +## Changes to SUNDIALS in release 2.5.0 + +### Integer Type Change + +One significant design change was made with this release, the problem size and +its relatives, bandwidth parameters, related internal indices, pivot arrays, and +the optional output `lsflag` have all been changed from type `int` to type +`long int`, except for the problem size and bandwidths in user calls to +routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The +function `NewIntArray` is replaced by a pair `NewIntArray` / +`NewLintArray`, for `int` and `long int` arrays, respectively. + +### Bug Fixes + +In the installation files, we modified the treatment of the macro +`SUNDIALS_USE_GENERIC_MATH`, so that the parameter `GENERIC_MATH_LIB` is +either defined (with no value) or not defined. + +In all packages, after the solver memory is created, it is set to zero before +being filled. + +In each linear solver interface function, the linear solver memory is freed on +an error return, and the function now includes a line setting to `NULL` the +main memory pointer to the linear solver memory. + +#### Rootfinding + +In CVODE(S) and IDA(S), in the functions `Rcheck1` and `Rcheck2`, when an +exact zero is found, the array `glo` of `g` values at the left endpoint +is adjusted, instead of shifting the `t` location `tlo` slightly. + +#### CVODE and CVODES + +In `CVSetTqBDF`, the logic was changed to avoid a divide by zero. + +In a minor change to the CVODES user interface, the type of the index `which` +was changed from `long int` to `int`. + +Errors in the logic for the integration of backward problems in CVODES were +identified and fixed. + +#### IDA and IDAS + +To be consistent with IDAS, IDA uses the function `IDAGetDky` for optional +output retrieval. + +A memory leak was fixed in two of the `IDASp***Free` functions. + +A missing vector pointer setting was added in `IDASensLineSrch`. + +In `IDACompleteStep`, conditionals around lines loading a new column of three +auxiliary divided difference arrays, for a possible order increase, were fixed. + +#### KINSOL + +Three major logic bugs were fixed - involving updating the solution vector, +updating the linesearch parameter, and a missing error return. + +Three minor errors were fixed - involving setting `etachoice` in the +Matlab/KINSOL interface, a missing error case in `KINPrintInfo`, and avoiding +an exponential overflow in the evaluation of `omega`. + +## Changes to SUNDIALS in release 2.4.0 + +Added a CMake-based build option in addition to the one based on autotools. + +The user interface has been further refined. Some of the API changes involve: + +(a) a reorganization of all linear solver modules into two families (besides the + existing family of scaled preconditioned iterative linear solvers, the + direct solvers, including new LAPACK-based ones, were also organized into a + *direct* family); + +(b) maintaining a single pointer to user data, optionally specified through a + `Set`-type function; and + +(c) a general streamlining of the preconditioner modules distributed with the + solvers. + +Added interfaces to LAPACK linear solvers for dense and banded matrices to all +packages. + +An option was added to specify which direction of zero-crossing is to be +monitored while performing rootfinding in CVODE(S) and IDA(S). + +CVODES includes several new features related to sensitivity analysis, among +which are: + +(a) support for integration of quadrature equations depending on both the states + and forward sensitivity (and thus support for forward sensitivity analysis + of quadrature equations), + +(b) support for simultaneous integration of multiple backward problems based on + the same underlying ODE (e.g., for use in an *forward-over-adjoint* method + for computing second order derivative information), + +(c) support for backward integration of ODEs and quadratures depending on both + forward states and sensitivities (e.g., for use in computing second-order + derivative information), and + +(d) support for reinitialization of the adjoint module. + +Moreover, the prototypes of all functions related to integration of backward +problems were modified to support the simultaneous integration of multiple +problems. + +All backward problems defined by the user are internally managed through a +linked list and identified in the user interface through a unique identifier. + +## Changes to SUNDIALS in release 2.3.0 + +### New Features and Enhancements + +The main changes in this release involve a rearrangement of the entire +SUNDIALS source tree. At the user interface level, the main impact is in the +mechanism of including SUNDIALS header files which must now include the relative +path e.g., `#include <cvode/cvode.h>` as all exported header files are now +installed in separate subdirectories of the installation *include* directory. + +The functions in the generic dense linear solver (`sundials_dense` and +`sundials_smalldense`) were modified to work for rectangular `m x n` (`m <= n`), +while the factorization and solution functions were renamed to `DenseGETRF` / +`denGETRF` and `DenseGETRS` / `denGETRS`, respectively. The factorization and +solution functions in the generic band linear solver were renamed `BandGBTRF` +and `BandGBTRS`, respectively. + +In IDA, the user interface to the consistent initial conditions calculations was +modified. The `IDACalcIC` arguments `t0`, `yy0`, and `yp0` were +removed and a new function, `IDAGetConsistentIC` is provided. + +### Bug Fixes + +In the CVODES adjoint solver module, the following two bugs were fixed: + +* In `CVodeF` the solver was sometimes incorrectly taking an additional step + before returning control to the user (in `CV_NORMAL` mode) thus leading to + a failure in the interpolated output function. + +* In `CVodeB`, while searching for the current check point, the solver was + sometimes reaching outside the integration interval resulting in a + segmentation fault. + +In IDA, a bug was fixed in the internal difference-quotient dense and banded +Jacobian approximations, related to the estimation of the perturbation (which +could have led to a failure of the linear solver when zero components with +sufficiently small absolute tolerances were present). + +## Changes to SUNDIALS in release 2.2.0 + +### New Header Files Names + +To reduce the possibility of conflicts, the names of all header files have been +changed by adding unique prefixes (e.g., `cvode_` and `sundials_`). When +using the default installation procedure, the header files are exported under +various subdirectories of the target `include` directory. For more details see +Appendix the installation chapter in the user guide. + +### Build System Changes + +Updated configure script and Makefiles for Fortran examples to avoid C++ +compiler errors (now use `CC` and `MPICC` to link only if necessary). + +The shared object files are now linked into each SUNDIALS library rater than +into a separate `libsundials_shared` library. + +### New Features and Enhancements + +Deallocation functions now take the address of the respective memory block +pointer as the input argument. + +Interfaces to the Scaled Preconditioned Bi-CGstab (SPBCG) and Scaled +Preconditioned Transpose-Free Quasi-Minimal Residual (SPTFQMR) linear solver +modules have been added to all packages. At the same time, function type names +for Scaled Preconditioned Iterative Linear Solvers were added for the +user-supplied Jacobian-times-vector and preconditioner setup and solve +functions. Additionally, in KINSOL interfaces have been added to the SUNDIALS +DENSE, and BAND linear solvers and include support for nonlinear residual +monitoring which can be used to control Jacobian updating. + +A new interpolation method was added to the CVODES adjoint module. The function +`CVadjMalloc` has an additional argument which can be used to select the +desired interpolation scheme. + +FIDA, a Fortran-C interface module, was added. + +The rootfinding feature was added to IDA, whereby the roots of a set of given +functions may be computed during the integration of the DAE system. + +In IDA a user-callable routine was added to access the estimated local error +vector. + +In the KINSOL Fortran interface module, FKINSOL, optional inputs are now set +using `FKINSETIIN` (integer inputs), `FKINSETRIN` (real inputs), and +`FKINSETVIN` (vector inputs). Optional outputs are still obtained from the +`IOUT` and `ROUT` arrays which are owned by the user and passed as arguments +to `FKINMALLOC`. + +## Changes to SUNDIALS in release 2.1.1 + +The function `N_VCloneEmpty` was added to the global vector operations table. + +A minor bug was fixed in the interpolation functions of the adjoint CVODES +module. + +## Changes to SUNDIALS in release 2.1.0 + +The user interface has been further refined. Several functions used for setting +optional inputs were combined into a single one. + +In CVODE(S) and IDA, an optional user-supplied routine for setting the error +weight vector was added. + +Additionally, to resolve potential variable scope issues, all SUNDIALS solvers +release user data right after its use. + +The build systems has been further improved to make it more robust. + +## Changes to SUNDIALS in release 2.0.2 + +Fixed autoconf-related bug to allow configuration with the PGI Fortran compiler. + +Modified the build system to use customized detection of the Fortran name +mangling scheme (autoconf's `AC_F77_WRAPPERS` routine is problematic on some +platforms). + +A bug was fixed in the `CVode` function that was potentially leading to +erroneous behavior of the rootfinding procedure on the integration first step. + +A new chapter in the User Guide was added - with constants that appear in the +user interface. + +## Changes to SUNDIALS in release 2.0.1 + +### Build System + +Changed the order of compiler directives in header files to avoid compilation +errors when using a C++ compiler. + +Changed the method of generating `sundials_config.h` to avoid potential +warnings of redefinition of preprocessor symbols. + +### New Features + +In CVODES the option of activating and deactivating forward sensitivity +calculations on successive runs without memory allocation and deallocation. + +### Bug Fixes + +In CVODES bug fixes related to forward sensitivity computations (possible loss +of accuracy on a BDF order increase and incorrect logic in testing user-supplied +absolute tolerances) were made. + +## Changes to SUNDIALS in release 2.0.0 + +Installation of all of SUNDIALS packages has been completely redesigned and is +now based on configure scripts. + +The major changes from the previous version involve a redesign of the user +interface across the entire SUNDIALS suite. We have eliminated the mechanism of +providing optional inputs and extracting optional statistics from the solver +through the `iopt` and `ropt` arrays. Instead, packages now provide `Set` +functions to change the default values for various quantities controlling the +solver and `Get` functions to extract statistics after return from the main +solver routine. + +Additionally, the interfaces to several user-supplied routines (such as those +providing Jacobians and preconditioner information) were simplified by reducing +the number of arguments. The same information that was previously accessible +through such arguments can now be obtained through `Get`-type functions. + +In CVODE and CVODES a rootfinding feature was added, whereby the roots of a set +of given functions may be computed during the integration of the ODE system. + +Changes to the NVector: + +* Removed `machEnv`, redefined table of vector operations (now contained in + the `N_Vector` structure itself). + +* All SUNDIALS functions create new `N_Vector` variables through + cloning, using an `N_Vector` passed by the user as a template. + +* A particular vector implementation is supposed to provide user-callable + constructor and destructor functions. + +* Removed the following functions from the structure of vector operations: + `N_VNew`, `N_VNew_S`, `N_VFree`, `N_VFree_S`, `N_VMake`, + `N_VDispose`, `N_VGetData`, `N_VSetData`, `N_VConstrProdPos`, and + `N_VOneMask`. + +* Added the following functions to the structure of vector operations: + `N_VClone`, `N_VDestroy`, `N_VSpace`, `N_VGetArrayPointer`, + `N_VSetArrayPointer`, and `N_VWrmsNormMask`. + +* Note that `nvec_ser` and `nvec_par` are now separate modules outside the + shared SUNDIALS module. + +Changes to the linear solvers: + +* In SPGMR, added a dummy `N_Vector` argument to be used as a template for + cloning. + +* In SPGMR, removed `N` (problem dimension) from the argument list of + `SpgmrMalloc`. + +* Replaced `iterativ.{c,h}` with `iterative.{c,h}`. + +* Modified constant names in `iterative.h` (preconditioner types are prefixed + with `PREC_`). + +* Changed numerical values for `MODIFIED_GS` (from `0` to `1`) and + `CLASSICAL_GS` (from `1` to `2`). + +Changes to `sundialsmath` submodule: + +* Replaced the internal routine for estimating unit roundoff with definition of + unit roundoff from `float.h`. + +* Modified functions to call the appropriate math routines given the precision + level specified by the user. + +Changes to `sundialstypes` submodule: + +* Removed `integertype`. + +* Added definitions for `BIG_REAL`, `SMALL_REAL`, and `UNIT_ROUNDOFF` + using values from `float.h` based on the precision. + +* Changed definition of macro `RCONST` to depend on the precision level + specified by the user. diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000..3788c1d82a --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,44 @@ +# ------------------------------------------------------------------------------ +# Programmer(s): David J. Gardner @ LLNL +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ +# Makefile to build or clean all RST package docs at once +# ------------------------------------------------------------------------------ + +DIRS = arkode/guide arkode/examples \ + cvode/guide \ + cvodes/guide \ + ida/guide \ + idas/guide \ + kinsol/guide + +# prefix with desired command to create unique dependencies/targets +LATEXDIRS = $(DIRS:%=latexpdf-%) +HTMLDIRS = $(DIRS:%=html-%) html-superbuild +CLEANDIRS = $(DIRS:%=clean-%) clean-superbuild + +latexpdf: $(LATEXDIRS) +$(LATEXDIRS): + $(MAKE) -C $(@:latexpdf-%=%) latexpdf + +html: $(HTMLDIRS) +$(HTMLDIRS): + $(MAKE) -C $(@:html-%=%) html + +clean: $(CLEANDIRS) +$(CLEANDIRS): + $(MAKE) -C $(@:clean-%=%) clean + +.PHONY: $(LATEXDIRS) +.PHONY: $(HTMLDIRS) +.PHONY: $(CLEANDIRS) +.PHONY: latexpdf html clean diff --git a/doc/arkode/guide/source/Changelog_link.rst b/doc/arkode/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/arkode/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index b2532f614a..77da7231de 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -126,2170 +126,12 @@ require a linear solver, ARKODE may use a variety of SUNLinearSolver modules provided with SUNDIALS, or again may utilize a user-supplied module. +Changes to SUNDIALS in release X.Y.Z +==================================== -Changes from previous versions -============================== +.. include:: ../../../shared/RecentChanges.rst -Changes in vX.X.X ------------------- - -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). - -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - - -Changes in v6.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the following functions -have been removed - -* ``ARKStepSetErrHandlerFn`` -* ``ARKStepSetErrFile`` -* ``ERKStepSetErrHandlerFn`` -* ``ERKStepSetErrFile`` -* ``MRIStepSetErrHandlerFn`` -* ``MRIStepSetErrFile`` -* ``SPRKStepSetErrHandlerFn`` -* ``SPRKStepSetErrFile`` - -Users of these functions can use the functions :c:func:`SUNContext_PushErrHandler`, -and :c:func:`SUNLogger_SetErrorFilename` instead. For further details see -Sections :numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -*Fortran Interface Modules Streamlined* - -We have streamlined the Fortran modules that need to be included by users by combining -the SUNDIALS core into one Fortran module, ``fsundials_core_mod``. Modules for -implementations of the core APIs still exist (e.g., for the Dense linear solver there -is ``fsunlinsol_dense_mod``) as do the modules for the SUNDIALS packages (e.g., ``fcvode_mod``). -The following modules are the ones that have been consolidated into ``fsundials_core_mod``: - -.. code-block:: - - fsundials_adaptcontroller_mod - fsundials_context_mod - fsundials_futils_mod - fsundials_linearsolver_mod - fsundials_logger_mod - fsundials_matrix_mod - fsundials_nonlinearsolver_mod - fsundials_nvector_mod - fsundials_profiler_mod - fsundials_types_mod - - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be deprecated -- users who -rely on these are recommended to transition to the corresponding :c:type:`SUNMatrix` and -:c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v5.7.0 ------------------ - -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. - -Added the third order ERK method ``ARKODE_SHU_OSHER_3_2_3``, the fourth order -ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``, the sixth order ERK method -``ARKODE_VERNER_9_5_6``, the seventh order ERK method ``ARKODE_VERNER_10_6_7``, -the eighth order ERK method ``ARKODE_VERNER_13_7_8``, and the ninth order ERK -method ``ARKODE_VERNER_16_8_9``. - -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. - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` -to ``O(NNZ)``. - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Fixed a regression introduced by the stop time bug fix in v6.6.1 where ARKODE -steppers 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 output time was passed. - -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 ARKODE where :c:func:`ARKStepSetInterpolateStopTime` would return -an interpolated solution at the stop time in some cases when interpolation was -disabled. - -Fixed a bug in :c:func:`ARKStepSetTableNum` wherein it did not recognize -`ARKODE_ARK2_ERK_3_1_2` and `ARKODE_ARK2_DIRK_3_1_2` as a valid additive -Runge--Kutta Butcher table pair. - -Fixed a bug in :c:func:`MRIStepCoupling_Write` where explicit coupling tables -were not written to the output file pointer. - -The :c:type:`MRIStepInnerStepper` class in MRIStep was updated to make supplying -an :c:func:`MRIStepInnerFullRhsFn` optional. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Changes in v5.6.2 ------------------ - -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. - -Changes in v5.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Fixed a bug where the stop time may not be cleared when using normal mode if the -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. - -Changes in v5.6.0 ------------------ - -A new time-stepping module, :ref:`SPRKStep <ARKODE.Mathematics.SPRKStep>`, was -added to ARKODE. This time-stepper provides explicit symplectic partitioned -Runge-Kutta methods up to order 10 for separable Hamiltonian systems. - -Added support for relaxation Runge-Kutta methods in ERKStep and ARKStep, see -:numref:`ARKODE.Mathematics.Relaxation`, :numref:`ARKODE.Usage.ERKStep.Relaxation`, -and :numref:`ARKODE.Usage.ARKStep.Relaxation` for more information. - -Added the second order IMEX method from :cite:p:`giraldo2013implicit` as the -default second order IMEX method in ARKStep. The explicit table is given by -``ARKODE_ARK2_ERK_3_1_2`` (see :numref:`Butcher.ARK2_ERK`) and the implicit -table by ``ARKODE_ARK2_DIRK_3_1_2`` (see :numref:`Butcher.ARK2_DIRK`). - -Updated the default ARKODE behavior when returning the solution when -the internal time has reached a user-specified stop time. Previously, the output -solution was interpolated to the value of ``tstop``; the default is now to copy the -internal solution vector. Users who wish to revert to interpolation may call a new -routine :c:func:`ARKStepSetInterpolateStopTime`, -:c:func:`ERKStepSetInterpolateStopTime`, or :c:func:`MRIStepSetInterpolateStopTime`. - -A potential bug was fixed when using inequality constraint handling and -calling :c:func:`ARKStepGetEstLocalErrors` or :c:func:`ERKStepGetEstLocalErrors` -after a failed step in which an inequality constraint violation occurred. In -this case, the values returned by :c:func:`ARKStepGetEstLocalErrors` or -:c:func:`ERKStepGetEstLocalErrors` may have been invalid. - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v5.5.1 ------------------ - -Added the functions :c:func:`ARKStepClearStopTime`, -:c:func:`ERKStepClearStopTime`, and :c:func:`MRIStepClearStopTime` to disable a -previously set stop time. - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -The default interpolant in ARKODE when using a first order method has been -updated to a linear interpolant to ensure values obtained by the integrator are -returned at the ends of the time interval. To restore the previous behavior of -using a constant interpolant call :c:func:`ARKStepSetInterpolantDegree`, -:c:func:`ERKStepSetInterpolantDegree`, or :c:func:`MRIStepSetInterpolantDegree` -and set the interpolant degree to zero before evolving the problem. - -Changes in v5.5.0 ------------------ - -Added the functions :c:func:`ARKStepGetJac`, :c:func:`ARKStepGetJacTime`, -:c:func:`ARKStepGetJacNumSteps`, :c:func:`MRIStepGetJac`, -:c:func:`MRIStepGetJacTime`, and :c:func:`MRIStepGetJacNumSteps` to assist in -debugging simulations utilizing a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an underflow bug during root finding. - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added support for CUDA v12. - -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Fixed an implicit conversion error in the Butcher table for ESDIRK5(4)7L[2]SA2. - -Changes in v5.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v5.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Added the functions :c:func:`ARKStepSetTableName`, -:c:func:`ERKStepSetTableName`, :c:func:`MRIStepCoupling_LoadTableByName`, -:c:func:`ARKodeButcherTable_LoadDIRKByName`, and -:c:func:`ARKodeButcherTable_LoadERKByName` to load a table from a string. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector. - -Fixed memory leaks/out of bounds memory accesses in the ARKODE MRIStep module -that could occur when attaching a coupling table after reinitialization with a -different number of stages than originally selected. - -Changes in v5.3.0 ------------------ - -Added the functions :c:func:`ARKStepGetUserData`, :c:func:`ERKStepGetUserData`, -and :c:func:`MRIStepGetUserData` to retrieve the user data pointer provided to -:c:func:`ARKStepSetUserData`, :c:func:`ERKStepSetUserData`, and -:c:func:`MRIStepSetUserData`, respectively. - -Fixed a bug in :c:func:`ERKStepReset()`, :c:func:`ERKStepReInit()`, -:c:func:`ARKStepReset()`, :c:func:`ARKStepReInit()`, :c:func:`MRIStepReset()`, and -:c:func:`MRIStepReInit()` where a previously-set value of *tstop* (from a call to -:c:func:`ERKStepSetStopTime()`, :c:func:`ARKStepSetStopTime()`, or -:c:func:`MRIStepSetStopTime()`, respectively) would not be cleared. - -Updated :c:func:`MRIStepReset()` to call the corresponding -:c:type:`MRIStepInnerResetFn` with the same :math:`(t_R,y_R)` arguments for the -:c:type:`MRIStepInnerStepper` object that is used to evolve the MRI "fast" time -scale subproblems. - -Added a variety of embedded DIRK methods from :cite:p:`KenCarp:16` and :cite:p:`KenCarp:19b`. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v5.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`ARKStepSetDiagnostics`, -:c:func:`MRIStepSetDiagnostics`, :c:func:`ERKStepSetDiagnostics`, -:c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the functions :c:func:`ARKStepPrintAllStats`, -:c:func:`ERKStepPrintAllStats`, and :c:func:`MRIStepPrintAllStats` to output all of -the integrator, nonlinear solver, linear solver, and other statistics in one -call. The file ``scripts/sundials_csv.py`` contains functions for parsing the -comma-separated value output files. - -Added the functions :c:func:`ARKStepSetDeduceImplicitRhs` and -:c:func:`MRIStepSetDeduceImplicitRhs` to optionally remove an evaluation of the -implicit right-hand side function after nonlinear solves. See -:numref:`ARKODE.Mathematics.Nonlinear`, for considerations on using this -optimization. - -Added the function :c:func:`MRIStepSetOrder` to select the default MRI method of -a given order. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the functions -:c:func:`ARKStepGetNumNonlinSolvConvFails`, -:c:func:`ARKStepGetNonlinSolvStats`, -:c:func:`MRIStepGetNumNonlinSolvConvFails`, and -:c:func:`MRIStepGetNonlinSolvStats` -where the number of nonlinear solver failures returned was the number of failed -*steps* due to a nonlinear solver failure i.e., if a nonlinear solve failed with -a stale Jacobian or preconditioner but succeeded after updating the Jacobian or -preconditioner, the initial failure was not included in the nonlinear solver -failure count. These functions have been updated to return the total number of -nonlinear solver failures. As such users may see an increase in the number of -failures reported. - -The functions :c:func:`ARKStepGetNumStepSolveFails` and -:c:func:`MRIStepGetNumStepSolveFails` have been added to retrieve the number of -failed steps due to a nonlinear solver failure. The counts returned from these -functions will match those previously returned by -:c:func:`ARKStepGetNumNonlinSolvConvFails`, -:c:func:`ARKStepGetNonlinSolvStats`, -:c:func:`MRIStepGetNumNonlinSolvConvFails`, and -:c:func:`MRIStepGetNonlinSolvStats`. - -Changes in v5.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Fixed Fortran interface to :c:type:`MRIStepInnerStepper` and :c:type:`MRIStepCoupling` -structures and functions. - -Added new Fortran example program, -``examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90`` demonstrating MRI -capabilities. - -Changes in v5.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v5.0.0 ------------------ - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**ARKODE** - -The MRIStep module has been extended to support implicit-explicit (ImEx) -multirate infinitesimal generalized additive Runge--Kutta (MRI-GARK) methods. As -such, :c:func:`MRIStepCreate` has been updated to include arguments for the slow -explicit and slow implicit ODE right-hand side functions. -:c:func:`MRIStepCreate` has also been updated to require attaching an -MRIStepInnerStepper for evolving the fast time scale. :c:func:`MRIStepReInit` -has been similarly updated to take explicit and implicit right-hand side -functions as input. Codes using explicit or implicit MRI methods will need to -update :c:func:`MRIStepCreate` and :c:func:`MRIStepReInit` calls to pass -``NULL`` for either the explicit or implicit right-hand side function as -appropriate. If ARKStep is used as the fast time scale integrator, codes will -need to call :c:func:`ARKStepCreateMRIStepInnerStepper` to wrap the ARKStep -memory as an MRIStepInnerStepper object. Additionally, -:c:func:`MRIStepGetNumRhsEvals` has been updated to return the number of slow -implicit and explicit function evaluations. The coupling table structure -:c:type:`MRIStepCouplingMem` and the functions :c:func:`MRIStepCoupling_Alloc` -and :c:func:`MRIStepCoupling_Create` have also been updated to support -IMEX-MRI-GARK methods. - -The deprecated functions ``MRIStepGetCurrentButcherTables`` and -``MRIStepWriteButcher`` and the utility functions ``MRIStepSetTable`` and -``MRIStepSetTableNum`` have been removed. Users wishing to create an MRI-GARK -method from a Butcher table should use :c:func:`MRIStepCoupling_MIStoMRI` to -create the corresponding MRI coupling table and attach it with -:c:func:`MRIStepSetCoupling`. - -The implementation of solve-decoupled implicit MRI-GARK methods has been updated -to remove extraneous slow implicit function calls and reduce the memory -requirements. - -The previously deprecated functions ``ARKStepSetMaxStepsBetweenLSet`` and -``ARKStepSetMaxStepsBetweenJac`` have been removed and replaced with -:c:func:`ARKStepSetLSetupFrequency` and :c:func:`ARKStepSetMaxStepsBetweenJac` -respectively. - -The ARKODE Fortran 77 interface has been removed. See :numref:`SUNDIALS.Fortran` -and the F2003 example programs for more details using the SUNDIALS Fortran 2003 -module interfaces. - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ -| ``SDIRK_2_1_2`` | ``ARKODE_SDIRK_2_1_2`` | -+------------------------------+-------------------------------------+ -| ``BILLINGTON_3_3_2`` | ``ARKODE_BILLINGTON_3_3_2`` | -+------------------------------+-------------------------------------+ -| ``TRBDF2_3_3_2`` | ``ARKODE_TRBDF2_3_3_2`` | -+------------------------------+-------------------------------------+ -| ``KVAERNO_4_2_3`` | ``ARKODE_KVAERNO_4_2_3`` | -+------------------------------+-------------------------------------+ -| ``ARK324L2SA_DIRK_4_2_3`` | ``ARKODE_ARK324L2SA_DIRK_4_2_3`` | -+------------------------------+-------------------------------------+ -| ``CASH_5_2_4`` | ``ARKODE_CASH_5_2_4`` | -+------------------------------+-------------------------------------+ -| ``CASH_5_3_4`` | ``ARKODE_CASH_5_3_4`` | -+------------------------------+-------------------------------------+ -| ``SDIRK_5_3_4`` | ``ARKODE_SDIRK_5_3_4`` | -+------------------------------+-------------------------------------+ -| ``KVAERNO_5_3_4`` | ``ARKODE_KVAERNO_5_3_4`` | -+------------------------------+-------------------------------------+ -| ``ARK436L2SA_DIRK_6_3_4`` | ``ARKODE_ARK436L2SA_DIRK_6_3_4`` | -+------------------------------+-------------------------------------+ -| ``KVAERNO_7_4_5`` | ``ARKODE_KVAERNO_7_4_5`` | -+------------------------------+-------------------------------------+ -| ``ARK548L2SA_DIRK_8_4_5`` | ``ARKODE_ARK548L2SA_DIRK_8_4_5`` | -+------------------------------+-------------------------------------+ -| ``ARK437L2SA_DIRK_7_3_4`` | ``ARKODE_ARK437L2SA_DIRK_7_3_4`` | -+------------------------------+-------------------------------------+ -| ``ARK548L2SAb_DIRK_8_4_5`` | ``ARKODE_ARK548L2SAb_DIRK_8_4_5`` | -+------------------------------+-------------------------------------+ -| ``MIN_DIRK_NUM`` | ``ARKODE_MIN_DIRK_NUM`` | -+------------------------------+-------------------------------------+ -| ``MAX_DIRK_NUM`` | ``ARKODE_MAX_DIRK_NUM`` | -+------------------------------+-------------------------------------+ -| ``MIS_KW3`` | ``ARKODE_MIS_KW3`` | -+------------------------------+-------------------------------------+ -| ``MRI_GARK_ERK33a`` | ``ARKODE_MRI_GARK_ERK33a`` | -+------------------------------+-------------------------------------+ -| ``MRI_GARK_ERK45a`` | ``ARKODE_MRI_GARK_ERK45a`` | -+------------------------------+-------------------------------------+ -| ``MRI_GARK_IRK21a`` | ``ARKODE_MRI_GARK_IRK21a`` | -+------------------------------+-------------------------------------+ -| ``MRI_GARK_ESDIRK34a`` | ``ARKODE_MRI_GARK_ESDIRK34a`` | -+------------------------------+-------------------------------------+ -| ``MRI_GARK_ESDIRK46a`` | ``ARKODE_MRI_GARK_ESDIRK46a`` | -+------------------------------+-------------------------------------+ -| ``IMEX_MRI_GARK3a`` | ``ARKODE_IMEX_MRI_GARK3a`` | -+------------------------------+-------------------------------------+ -| ``IMEX_MRI_GARK3b`` | ``ARKODE_IMEX_MRI_GARK3b`` | -+------------------------------+-------------------------------------+ -| ``IMEX_MRI_GARK4`` | ``ARKODE_IMEX_MRI_GARK4`` | -+------------------------------+-------------------------------------+ -| ``MIN_MRI_NUM`` | ``ARKODE_MIN_MRI_NUM`` | -+------------------------------+-------------------------------------+ -| ``MAX_MRI_NUM`` | ``ARKODE_MAX_MRI_NUM`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_MRI_TABLE_3`` | ``MRISTEP_DEFAULT_TABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_EXPL_MRI_TABLE_3`` | ``MRISTEP_DEFAULT_EXPL_TABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_EXPL_MRI_TABLE_4`` | ``MRISTEP_DEFAULT_EXPL_TABLE_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_IMPL_SD_TABLE_2`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_2`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_IMPL_SD_TABLE_3`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_IMPL_SD_TABLE_4`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_IMEX_SD_TABLE_3`` | ``MRISTEP_DEFAULT_IMEX_SD_TABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_IMEX_SD_TABLE_4`` | ``MRISTEP_DEFAULT_IMEX_SD_TABLE_4`` | -+------------------------------+-------------------------------------+ -| ``HEUN_EULER_2_1_2`` | ``ARKODE_HEUN_EULER_2_1_2`` | -+------------------------------+-------------------------------------+ -| ``BOGACKI_SHAMPINE_4_2_3`` | ``ARKODE_BOGACKI_SHAMPINE_4_2_3`` | -+------------------------------+-------------------------------------+ -| ``ARK324L2SA_ERK_4_2_3`` | ``ARKODE_ARK324L2SA_ERK_4_2_3`` | -+------------------------------+-------------------------------------+ -| ``ZONNEVELD_5_3_4`` | ``ARKODE_ZONNEVELD_5_3_4`` | -+------------------------------+-------------------------------------+ -| ``ARK436L2SA_ERK_6_3_4`` | ``ARKODE_ARK436L2SA_ERK_6_3_4`` | -+------------------------------+-------------------------------------+ -| ``SAYFY_ABURUB_6_3_4`` | ``ARKODE_SAYFY_ABURUB_6_3_4`` | -+------------------------------+-------------------------------------+ -| ``CASH_KARP_6_4_5`` | ``ARKODE_CASH_KARP_6_4_5`` | -+------------------------------+-------------------------------------+ -| ``FEHLBERG_6_4_5`` | ``ARKODE_FEHLBERG_6_4_5`` | -+------------------------------+-------------------------------------+ -| ``DORMAND_PRINCE_7_4_5`` | ``ARKODE_DORMAND_PRINCE_7_4_5`` | -+------------------------------+-------------------------------------+ -| ``ARK548L2SA_ERK_8_4_5`` | ``ARKODE_ARK548L2SA_ERK_8_4_5`` | -+------------------------------+-------------------------------------+ -| ``VERNER_8_5_6`` | ``ARKODE_VERNER_8_5_6`` | -+------------------------------+-------------------------------------+ -| ``FEHLBERG_13_7_8`` | ``ARKODE_FEHLBERG_13_7_8`` | -+------------------------------+-------------------------------------+ -| ``KNOTH_WOLKE_3_3`` | ``ARKODE_KNOTH_WOLKE_3_3`` | -+------------------------------+-------------------------------------+ -| ``ARK437L2SA_ERK_7_3_4`` | ``ARKODE_ARK437L2SA_ERK_7_3_4`` | -+------------------------------+-------------------------------------+ -| ``ARK548L2SAb_ERK_8_4_5`` | ``ARKODE_ARK548L2SAb_ERK_8_4_5`` | -+------------------------------+-------------------------------------+ -| ``MIN_ERK_NUM`` | ``ARKODE_MIN_ERK_NUM`` | -+------------------------------+-------------------------------------+ -| ``MAX_ERK_NUM`` | ``ARKODE_MAX_ERK_NUM`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_2`` | ``ARKSTEP_DEFAULT_ERK_2`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_3`` | ``ARKSTEP_DEFAULT_ERK_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_4`` | ``ARKSTEP_DEFAULT_ERK_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_5`` | ``ARKSTEP_DEFAULT_ERK_5`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_6`` | ``ARKSTEP_DEFAULT_ERK_6`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_8`` | ``ARKSTEP_DEFAULT_ERK_8`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_DIRK_2`` | ``ARKSTEP_DEFAULT_DIRK_2`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_DIRK_3`` | ``ARKSTEP_DEFAULT_DIRK_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_DIRK_4`` | ``ARKSTEP_DEFAULT_DIRK_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_DIRK_5`` | ``ARKSTEP_DEFAULT_DIRK_5`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ETABLE_3`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ETABLE_4`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ETABLE_5`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ITABLE_3`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ITABLE_4`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ARK_ITABLE_5`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_5`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_2`` | ``ERKSTEP_DEFAULT_2`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_3`` | ``ERKSTEP_DEFAULT_3`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_4`` | ``ERKSTEP_DEFAULT_4`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_5`` | ``ERKSTEP_DEFAULT_5`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_6`` | ``ERKSTEP_DEFAULT_6`` | -+------------------------------+-------------------------------------+ -| ``DEFAULT_ERK_8`` | ``ERKSTEP_DEFAULT_8`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v4.8.0 ------------------ - -The RAJA NVECTOR implementation has been updated to support the SYCL backend -in addition to the CUDA and HIP backend. Users can choose the backend when -configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. -This module remains experimental and is subject to change from version to -version. - -A new SUNMatrix and SUNLinearSolver implementation were added to interface with -the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix and the linear -solver support general dense linear systems as well as block diagonal linear -systems. See :numref:`SUNLinSol.OneMklDense` for more details. This module is -experimental and is subject to change from version to version. - -Added a new *optional* function to the SUNLinearSolver API, -:c:func:`SUNLinSolSetZeroGuess`, to indicate that the next call to -:c:func:`SUNLinSolSolve` will be made with a zero initial guess. SUNLinearSolver -implementations that do not use the :c:func:`SUNLinSolNewEmpty` constructor -will, at a minimum, need set the ``setzeroguess`` function pointer in the linear -solver ``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver -implementations have been updated to leverage this new set function to remove -one dot product per solve. - -ARKODE now supports a new "matrix-embedded" SUNLinearSolver type. This type -supports user-supplied SUNLinearSolver implementations that set up and solve -the specified linear system at each linear solve call. Any matrix-related data -structures are held internally to the linear solver itself, and are not -provided by the SUNDIALS package. - -Support for user-defined inner (fast) integrators has been to the MRIStep -module. See :numref:`ARKODE.Usage.MRIStep.CustomInnerStepper` for more information on providing -a user-defined integration method. - -Added the functions :c:func:`ARKStepSetNlsRhsFn()` and -:c:func:`MRIStepSetNlsRhsFn()` to supply an alternative implicit right-hand side -function for use within nonlinear system function evaluations. - -The installed SUNDIALSConfig.cmake file now supports the ``COMPONENTS`` option -to ``find_package``. The exported targets no longer have IMPORTED_GLOBAL set. - -A bug was fixed in :c:func:`SUNMatCopyOps` where the matrix-vector product setup -function pointer was not copied. - -A bug was fixed in the SPBCGS and SPTFQMR solvers for the case where a non-zero -initial guess and a solution scaling vector are provided. This fix only impacts -codes using SPBCGS or SPTFQMR as standalone solvers as all SUNDIALS packages -utilize a zero initial guess. - -A bug was fixed in the ARKODE stepper modules where the stop time may be passed -after resetting the integrator. - -Changes in v4.7.0 ------------------ - -A new NVECTOR implementation based on the SYCL abstraction layer has been added -targeting Intel GPUs. At present the only SYCL compiler supported is the DPC++ -(Intel oneAPI) compiler. See :numref:`NVectors.SYCL` for more details. This module -is considered experimental and is subject to major changes even in minor -releases. - -A new SUNMatrix and SUNLinearSolver implementation were added to interface -with the MAGMA linear algebra library. Both the matrix and the linear solver -support general dense linear systems as well as block diagonal linear systems, -and both are targeted at GPUs (AMD or NVIDIA). See :numref:`SUNLinSol.MagmaDense` -for more details. - -Changes in v4.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error -if the CMAKE_CXX_STANDARD and SUNDIALS_RAJA_BACKENDS options -were not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v4.6.0 ------------------ - -A new NVECTOR implementation based on the AMD ROCm HIP platform has been added. -This vector can target NVIDIA or AMD GPUs. See :numref:`NVectors.HIP` for more -details. This module is considered experimental and is subject to change from -version to version. - -The RAJA NVECTOR implementation has been updated to support the HIP backend -in addition to the CUDA backend. Users can choose the backend when configuring -SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. This module -remains experimental and is subject to change from version to version. - -A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the -N_Vector API. This operation is useful for N_Vectors that utilize dual memory -spaces, e.g. the native SUNDIALS CUDA N_Vector. - -The SUNMATRIX_CUSPARSE and SUNLINEARSOLVER_CUSOLVERSP_BATCHQR implementations -no longer require the SUNDIALS CUDA N_Vector. Instead, they require that the -vector utilized provides the :c:func:`N_VGetDeviceArrayPointer` operation, and -that the pointer returned by :c:func:`N_VGetDeviceArrayPointer` is a valid CUDA -device pointer. - -Changes in v4.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. -Users will likely see deprecation warnings, but otherwise the changes -should be fully backwards compatible for almost all users. SUNDIALS -now exports CMake targets and installs a SUNDIALSConfig.cmake file. - -Added support for SuperLU DIST 6.3.0 or newer. - -Changes in v4.4.0 ------------------ - -Added full support for time-dependent mass matrices in ARKStep, and expanded -existing non-identity mass matrix infrastructure to support use of the -fixed point nonlinear solver. Fixed bug for ERK method integration with -static mass matrices. - -An interface between ARKStep and the XBraid multigrid reduction in time (MGRIT) -library :cite:p:`xbraid` has been added to enable parallel-in-time integration. See the -:numref:`ARKODE.Usage.ARKStep.XBraid` section for more information and the example -codes in ``examples/arkode/CXX_xbraid``. This interface required the addition of -three new N_Vector operations to exchange vector data between computational -nodes, see :c:func:`N_VBufSize()`, :c:func:`N_VBufPack()`, and -:c:func:`N_VBufUnpack()`. These N_Vector operations are only used within the -XBraid interface and need not be implemented for any other context. - -Updated the MRIStep time-stepping module in ARKODE to support -higher-order MRI-GARK methods :cite:p:`Sandu:19`, including methods that -involve solve-decoupled, diagonally-implicit treatment of the -slow time scale. - -Added the functions :c:func:`ARKStepSetLSNormFactor()`, -:c:func:`ARKStepSetMassLSNormFactor()`, and :c:func:`MRIStepSetLSNormFactor()` -to specify the factor for converting between integrator tolerances (WRMS norm) -and linear solver tolerances (L2 norm) i.e., -``tol_L2 = nrmfac * tol_WRMS``. - -Added new reset functions :c:func:`ARKStepReset()`, :c:func:`ERKStepReset()`, -and :c:func:`MRIStepReset()` to reset the stepper time and state vector to -user-provided values for continuing the integration from that point while -retaining the integration history. These function complement the -reinitialization functions :c:func:`ARKStepReInit()`, :c:func:`ERKStepReInit()`, -and :c:func:`MRIStepReInit()` which reinitialize the stepper so that the problem -integration should resume as if started from scratch. - -Added new functions :c:func:`ARKStepComputeState`, -:c:func:`ARKStepGetNonlinearSystemData`, :c:func:`MRIStepComputeState`, and -:c:func:`MRIStepGetNonlinearSystemData` which advanced users might find useful -if providing a custom :c:func:`SUNNonlinSolSysFn`. - -The expected behavior of :c:func:`SUNNonlinSolGetNumIters()` and -:c:func:`SUNNonlinSolGetNumConvFails()` in the SUNNonlinearSolver API have been -updated to specify that they should return the number of nonlinear solver -iterations and convergence failures in the most recent solve respectively rather -than the cumulative number of iterations and failures across all solves -respectively. The API documentation and SUNDIALS provided SUNNonlinearSolver -implementations have been updated accordingly. As before, the cumulative number -of nonlinear iterations may be retrieved by calling -:c:func:`ARKStepGetNumNonlinSolvIters()`, the cumulative number of failures with -:c:func:`ARKStepGetNumNonlinSolvConvFails()`, or both with -:c:func:`ARKStepGetNonlinSolvStats()`. - -A minor bug in checking the Jacobian evaluation frequency has been fixed. As a -result codes using using a non-default Jacobian update frequency through a call -to :c:func:`ARKStepSetMaxStepsBetweenJac()` will need to increase the provided -value by 1 to achieve the same behavior as before. Additionally, for greater -clarity the functions :c:func:`ARKStepSetMaxStepsBetweenLSet()` and -:c:func:`ARKStepSetMaxStepsBetweenJac()` have been deprecated and replaced with -:c:func:`ARKStepSetLSetupFrequency()` and :c:func:`ARKStepSetJacEvalFrequency()` -respectively. - -The ``NVECTOR_RAJA`` module has been updated to mirror the ``NVECTOR_CUDA`` module. -Notably, the update adds managed memory support to the ``NVECTOR_RAJA`` module. -Users of the module will need to update any calls to the ``N_VMake_Raja`` function -because that signature was changed. This module remains experimental and is -subject to change from version to version. - -The ``NVECTOR_TRILINOS`` module has been updated to work with Trilinos 12.18+. -This update changes the local ordinal type to always be an ``int``. - -Added support for CUDA v11. - - -Changes in v4.3.0 ------------------ - -Fixed a bug in ARKODE where the prototypes for :c:func:`ERKStepSetMinReduction()` -and :c:func:`ARKStepSetMinReduction()` were not included in ``arkode_erkstep.h`` -and ``arkode_arkstep.h`` respectively. - -Fixed a bug where inequality constraint checking would need to be disabled and -then re-enabled to update the inequality constraint values after resizing a -problem. Resizing a problem will now disable constraints and a call to -:c:func:`ARKStepSetConstraints()` or :c:func:`ERKStepSetConstraints()` is -required to re-enable constraint checking for the new problem size. - -Fixed a bug in the iterative linear solver modules where an error is not -returned if the Atimes function is ``NULL`` or, if preconditioning is enabled, -the PSolve function is ``NULL``. - -Added the ability to control the CUDA kernel launch parameters for the -``NVECTOR_CUDA`` and ``SUNMATRIX_CUSPARSE`` modules. These modules remain -experimental and are subject to change from version to version. -In addition, the ``NVECTOR_CUDA`` kernels were rewritten to be more flexible. -Most users should see equivalent performance or some improvement, but a select -few may observe minor performance degradation with the default settings. Users -are encouraged to contact the SUNDIALS team about any perfomance changes -that they notice. - -Added the optional function :c:func:`ARKStepSetJacTimesRhsFn()` to specify an -alternative implicit right-hand side function for computing Jacobian-vector -products with the internal difference quotient approximation. - -Added new capabilities for monitoring the solve phase in the ``SUNNONLINSOL_NEWTON`` -and ``SUNNONLINSOL_FIXEDPOINT`` modules, and the SUNDIALS iterative linear solver -modules. SUNDIALS must be built with the CMake option -``SUNDIALS_BUILD_WITH_MONITORING`` to use these capabilties. - - -Changes in v4.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the -IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler -it is recommended to set ``CMAKE_Fortran_COMPILER`` to ``f2003``, ``xlf2003``, -or ``xlf2003_r``. - -Fixed a bug in how ARKODE interfaces with a user-supplied, iterative, unscaled linear solver. -In this case, ARKODE adjusts the linear solver tolerance in an attempt to account for the -lack of support for left/right scaling matrices. Previously, ARKODE computed this scaling -factor using the error weight vector, ``ewt``; this fix changes that to the residual weight vector, -``rwt``, that can differ from ``ewt`` when solving problems with non-identity mass matrix. - -Fixed a similar bug in how ARKODE interfaces with scaled linear solvers when solving problems -with non-identity mass matrices. Here, the left scaling matrix should correspond with ``rwt`` -and the right scaling matrix with ``ewt``; these were reversed but are now correct. - -Fixed a bug where a non-default value for the maximum allowed growth factor -after the first step would be ignored. - -The function :c:func:`ARKStepSetLinearSolutionScaling()` was added to -enable or disable the scaling applied to linear system solutions with -matrix-based linear solvers to account for a lagged value of :math:`\gamma` in -the linear system matrix e.g., :math:`M - \gamma J` or :math:`I - \gamma J`. -Scaling is enabled by default when using a matrix-based linear solver. - -Added two new functions, :c:func:`ARKStepSetMinReduction()` and -:c:func:`ERKStepSetMinReduction()`, to change the minimum allowed step size -reduction factor after an error test failure. - -Added a new ``SUNMatrix`` implementation, :numref:`SUNMatrix.cuSparse`, that interfaces -to the sparse matrix implementation from the NVIDIA cuSPARSE library. In addition, -the :numref:`SUNLinSol.cuSolverSp` ``SUNLinearSolver`` has been updated to -use this matrix, as such, users of this module will need to update their code. -These modules are still considered to be experimental, thus they are subject to -breaking changes even in minor releases. - -Added a new "stiff" interpolation module, based on Lagrange polynomial interpolation, -that is accessible to each of the ARKStep, ERKStep and MRIStep time-stepping modules. -This module is designed to provide increased interpolation accuracy when integrating -stiff problems, as opposed to the ARKODE-standard Hermite interpolation module that -can suffer when the IVP right-hand side has large Lipschitz constant. While the -Hermite module remains the default, the new Lagrange module may be enabled using one -of the routines :c:func:`ARKStepSetInterpolantType()`, :c:func:`ERKStepSetInterpolantType()`, -or :c:func:`MRIStepSetInterpolantType()`. The serial example problem ``ark_brusselator.c`` -has been converted to use this Lagrange interpolation module. Created accompanying routines -:c:func:`ARKStepSetInterpolantDegree()`, :c:func:`ARKStepSetInterpolantDegree()` and -:c:func:`ARKStepSetInterpolantDegree()` to provide user control over these -interpolating polynomials. While the routines :c:func:`ARKStepSetDenseOrder()`, -:c:func:`ARKStepSetDenseOrder()` and :c:func:`ARKStepSetDenseOrder()` still exist, -these have been deprecated and will be removed in a future release. - - - -Changes in v4.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake -variables ``PETSC_INCLUDES`` and ``PETSC_LIBRARIES`` instead of -``PETSC_DIR``. - -Added a new build system option, ``CUDA_ARCH``, that can be used to specify -the CUDA architecture to compile for. - -Fixed a bug in the Fortran 2003 interfaces to the ARKODE Butcher table routines and structure. -This includes changing the ``ARKodeButcherTable`` type to be a ``type(c_ptr)`` in Fortran. - -Added two utility functions, ``SUNDIALSFileOpen`` and ``SUNDIALSFileClose`` -for creating/destroying file pointers that are useful when using the Fortran -2003 interfaces. - -Added support for a user-supplied function to update the prediction for each -implicit stage solution in ARKStep. If supplied, this routine will be called -*after* any existing ARKStep predictor algorithm completes, so that the -predictor may be modified by the user as desired. The new user-supplied routine -has type :c:type:`ARKStepStagePredictFn`, and may be set by calling -:c:func:`ARKStepSetStagePredictFn()`. - -The MRIStep module has been updated to support attaching different user data -pointers to the inner and outer integrators. If applicable, user codes will -need to add a call to :c:func:`ARKStepSetUserData()` to attach their user data -pointer to the inner integrator memory as :c:func:`MRIStepSetUserData()` will -not set the pointer for both the inner and outer integrators. The MRIStep -examples have been updated to reflect this change. - -Added support for constant damping to the ``SUNNonlinearSolver_FixedPoint`` -module when using Anderson acceleration. See :numref:`SUNNonlinSol.FixedPoint.Math` -and the :c:func:`SUNNonlinSolSetDamping_FixedPoint()` for more details. - -Changes in v4.0.0 ------------------ - -**Build system changes** - -Increased the minimum required CMake version to 3.5 for most SUNDIALS -configurations, and 3.10 when CUDA or OpenMP with device offloading are enabled. - -The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been -removed to simplify builds as SUNDIALS packages do not use BLAS directly. For -third party libraries that require linking to BLAS, the path to the BLAS -library should be included in the ``_LIBRARIES`` variable for the third party -library e.g., ``SUPERLUDIST_LIBRARIES`` when enabling SuperLU_DIST. - -Fixed a bug in the build system that prevented the PThreads NVECTOR module from -being built. - -**NVECTOR module changes** - -Two new functions were added to aid in creating custom NVECTOR objects. The -constructor :c:func:`N_VNewEmpty` allocates an "empty" generic NVECTOR with -the object's content pointer and the function pointers in the operations -structure initialized to ``NULL``. When used in the constructor for custom -objects this function will ease the introduction of any new optional operations -to the NVECTOR API by ensuring only required operations need to be set. -Additionally, the function :c:func:`N_VCopyOps()` has been added to copy the -operation function pointers between vector objects. When used in clone routines -for custom vector objects these functions also will ease the introduction of -any new optional operations to the NVECTOR API by ensuring all operations -are copied when cloning objects. - -Two new NVECTOR implementations, NVECTOR_MANYVECTOR and -NVECTOR_MPIMANYVECTOR, have been created to support flexible partitioning -of solution data among different processing elements (e.g., CPU + GPU) or for -multi-physics problems that couple distinct MPI-based simulations together. This -implementation is accompanied by additions to user documentation and SUNDIALS -examples. - -One new required vector operation and ten new optional vector operations have -been added to the NVECTOR API. The new required operation, :c:func:`N_VGetLength()`, -returns the global length of an ``N_Vector``. The optional operations have -been added to support the new NVECTOR_MPIMANYVECTOR implementation. The -operation :c:func:`N_VGetCommunicator()` must be implemented by subvectors that are -combined to create an NVECTOR_MPIMANYVECTOR, but is not used outside of -this context. The remaining nine operations are optional local reduction -operations intended to eliminate unnecessary latency when performing vector -reduction operations (norms, etc.) on distributed memory systems. The optional -local reduction vector operations are -:c:func:`N_VDotProdLocal`, -:c:func:`N_VMaxNormLocal`, -:c:func:`N_VMinLocal`, -:c:func:`N_VL1NormLocal`, -:c:func:`N_VWSqrSumLocal`, -:c:func:`N_VWSqrSumMaskLocal`, -:c:func:`N_VInvTestLocal`, -:c:func:`N_VConstrMaskLocal`, and -:c:func:`N_VMinQuotientLocal`. -If an NVECTOR implementation defines any of the local operations as -``NULL``, then the NVECTOR_MPIMANYVECTOR will call standard NVECTOR -operations to complete the computation. - -An additional NVECTOR implementation, NVECTOR_MPIPLUSX, has been created to -support the MPI+X paradigm where X is a type of on-node parallelism -(*e.g.*, OpenMP, CUDA). The implementation is accompanied by additions to -user documentation and SUNDIALS examples. - -The ``*_MPICuda`` and ``*_MPIRaja`` functions have been removed from the -NVECTOR_CUDA and NVECTOR_RAJA implementations respectively. Accordingly, the -``nvector_mpicuda.h``, ``nvector_mpiraja.h``, ``libsundials_nvecmpicuda.lib``, -and ``libsundials_nvecmpicudaraja.lib`` files have been removed. Users should -use the NVECTOR_MPIPLUSX module coupled in conjunction with the NVECTOR_CUDA -or NVECTOR_RAJA modules to replace the functionality. The necessary changes are -minimal and should require few code modifications. See the programs in -``examples/ida/mpicuda`` and ``examples/ida/mpiraja`` for examples of how to -use the NVECTOR_MPIPLUSX module with the NVECTOR_CUDA and NVECTOR_RAJA modules -respectively. - -Fixed a memory leak in the NVECTOR_PETSC module clone function. - -Made performance improvements to the NVECTOR_CUDA module. Users who utilize a -non-default stream should no longer see default stream synchronizations -after memory transfers. - -Added a new constructor to the NVECTOR_CUDA module that allows a user to provide -custom allocate and free functions for the vector data array and internal -reduction buffer. - -Added new Fortran 2003 interfaces for most NVECTOR modules. See the -:numref:`SUNDIALS.Fortran` section for more details. - -Added three new NVECTOR utility functions, -:c:func:`N_VGetVecAtIndexVectorArray()` -:c:func:`N_VSetVecAtIndexVectorArray()`, and -:c:func:`N_VNewVectorArray`, -for working with ``N_Vector`` arrays when using the Fortran 2003 interfaces. - -**SUNMatrix module changes** - -Two new functions were added to aid in creating custom SUNMATRIX objects. The -constructor :c:func:`SUNMatNewEmpty` allocates an "empty" generic SUNMATRIX with -the object's content pointer and the function pointers in the operations -structure initialized to ``NULL``. When used in the constructor for custom -objects this function will ease the introduction of any new optional operations -to the SUNMATRIX API by ensuring only required operations need to be set. -Additionally, the function :c:func:`SUNMatCopyOps()` has been added to copy the -operation function pointers between matrix objects. When used in clone routines -for custom matrix objects these functions also will ease the introduction of any -new optional operations to the SUNMATRIX API by ensuring all operations are -copied when cloning objects. - -A new operation, :c:func:`SUNMatMatvecSetup()`, was added to the SUNMATRIX API. -Users who have implemented custom SUNMATRIX modules will need to at least -update their code to set the corresponding ``ops`` structure member, -``matvecsetup``, to ``NULL``. - -A new operation, :c:func:`SUNMatMatvecSetup()`, was added to the SUNMATRIX API -to perform any setup necessary for computing a matrix-vector product. This -operation is useful for SUNMATRIX implementations which need to prepare the -matrix itself, or communication structures before performing the matrix-vector -product. Users who have implemented custom SUNMATRIX modules will need to at -least update their code to set the corresponding ``ops`` structure member, -``matvecsetup``, to ``NULL``. - -The generic SUNMATRIX API now defines error codes to be returned by -SUNMATRIX operations. Operations which return an integer flag indiciating -success/failure may return different values than previously. - -A new SUNMATRIX (and SUNLINEARSOLVER) implementation was added to -facilitate the use of the SuperLU_DIST library with SUNDIALS. - -Added new Fortran 2003 interfaces for most SUNMATRIX modules. See the -:numref:`SUNDIALS.Fortran` section for more details. - -**SUNLinearSolver module changes** - -A new function was added to aid in creating custom SUNLINEARSOLVER objects. -The constructor :c:func:`SUNLinSolNewEmpty` allocates an "empty" generic -SUNLINEARSOLVER with the object's content pointer and the function pointers -in the operations structure initialized to ``NULL``. When used in the -constructor for custom objects this function will ease the introduction of any -new optional operations to the SUNLINEARSOLVER API by ensuring only required -operations need to be set. - -The return type of the SUNLINEARSOLVER API function :c:func:`SUNLinSolLastFlag()` -has changed from ``long int`` to ``sunindextype`` to be consistent with the -type used to store row indices in dense and banded linear solver modules. - -Added a new optional operation to the SUNLINEARSOLVER API, -:c:func:`SUNLinSolGetID`, that returns a ``SUNLinearSolver_ID`` for identifying -the linear solver module. - -The SUNLINEARSOLVER API has been updated to make the initialize and setup -functions optional. - -A new SUNLINEARSOLVER (and SUNMATRIX) implementation was added to -facilitate the use of the SuperLU_DIST library with SUNDIALS. - -Added a new SUNLinearSolver implementation, ``SUNLinearSolver_cuSolverSp_batchQR``, -which leverages the NVIDIA cuSOLVER sparse batched QR method for efficiently -solving block diagonal linear systems on NVIDIA GPUs. - - -Added three new accessor functions to the SUNLinSol_KLU module, -:c:func:`SUNLinSol_KLUGetSymbolic()`, :c:func:`SUNLinSol_KLUGetNumeric()`, and -:c:func:`SUNLinSol_KLUGetCommon()`, to provide user access to the underlying -KLU solver structures. - -Added new Fortran 2003 interfaces for most SUNLINEARSOLVER modules. See the -:numref:`SUNDIALS.Fortran` section for more details. - -**SUNNonlinearSolver module changes** - -A new function was added to aid in creating custom SUNNONLINEARSOLVER -objects. The constructor :c:func:`SUNNonlinSolNewEmpty` allocates an "empty" -generic SUNNONLINEARSOLVER with the object's content pointer and the function -pointers in the operations structure initialized to ``NULL``. When used in the -constructor for custom objects this function will ease the introduction of any -new optional operations to the SUNNONLINEARSOLVER API by ensuring only -required operations need to be set. - -To facilitate the use of user supplied nonlinear solver convergence test -functions the :c:func:`SUNNonlinSolSetConvTestFn()` function in the -SUNNONLINEARSOLVER API has been updated to take a ``void*`` data pointer as -input. The supplied data pointer will be passed to the nonlinear solver -convergence test function on each call. - -The inputs values passed to the first two inputs of the :c:func:`SUNNonlinSolSolve()` -function in the SUNNONLINEARSOLVER have been changed to be the predicted -state and the initial guess for the correction to that state. Additionally, -the definitions of :c:type:`SUNNonlinSolLSetupFn` and :c:type:`SUNNonlinSolLSolveFn` -in the SUNNONLINEARSOLVER API have been updated to remove unused input -parameters. - -Added a new ``SUNNonlinearSolver`` implementation, ``SUNNonlinsol_PetscSNES``, -which interfaces to the PETSc SNES nonlinear solver API. - -Added new Fortran 2003 interfaces for most SUNNONLINEARSOLVER modules. See the -:numref:`SUNDIALS.Fortran` section for more details. - -**ARKODE changes** - -The MRIStep module has been updated to support explicit, implicit, or ImEx -methods as the fast integrator using the ARKStep module. As a result some -function signatures have been changed including :c:func:`MRIStepCreate` which -now takes an ARKStep memory structure for the fast integration as an input. - -Fixed a bug in the ARKStep time-stepping module that would result in an infinite -loop if the nonlinear solver failed to converge more than the maximum allowed times -during a single step. - -Fixed a bug that would result in a "too much accuracy requested" error when -using fixed time step sizes with explicit methods in some cases. - -Fixed a bug in ARKStep where the mass matrix linear solver setup function was -not called in the Matrix-free case. - -Fixed a minor bug in ARKStep where an incorrect flag is reported when an -error occurs in the mass matrix setup or Jacobian-vector product setup -functions. - -Fixed a memeory leak in FARKODE when not using the default nonlinear solver. - -The reinitialization functions :c:func:`ERKStepReInit()`, -:c:func:`ARKStepReInit()`, and :c:func:`MRIStepReInit()` have been updated to -retain the minimum and maxiumum step size values from before reinitialization -rather than resetting them to the default values. - -Removed extraneous calls to :c:func:`N_VMin()` for simulations where -the scalar valued absolute tolerance, or all entries of the -vector-valued absolute tolerance array, are strictly positive. In -this scenario, ARKODE will remove at least one global reduction per -time step. - -The ARKLS interface has been updated to only zero the Jacobian matrix before -calling a user-supplied Jacobian evaluation function when the attached linear -solver has type ``SUNLINEARSOLVER_DIRECT``. - -A new linear solver interface function :c:func:`ARKLsLinSysFn` was added as an -alternative method for evaluating the linear system :math:`A = M - \gamma J`. - -Added two new embedded ARK methods of orders 4 and 5 to ARKODE (from :cite:p:`KenCarp:19`). - -Support for optional inequality constraints on individual components of the -solution vector has been added the ARKODE ERKStep and ARKStep modules. See -the descriptions of :c:func:`ERKStepSetConstraints()` and -:c:func:`ARKStepSetConstraints()` for more details. Note that enabling -constraint handling requires the NVECTOR operations :c:func:`N_VMinQuotient()`, -:c:func:`N_VConstrMask()`, and :c:func:`N_VCompare()` that were not previously -required by ARKODE. - -Added two new 'Get' functions to ARKStep, :c:func:`ARKStepGetCurrentGamma()`, -and :c:func:`ARKStepGetCurrentState`, that may be useful to users who choose -to provide their own nonlinear solver implementation. - -Add two new 'Set' functions to MRIStep, :c:func:`MRIStepSetPreInnerFn()` and -:c:func:`MRIStepSetPostInnerFn()` for performing communication or memory -transfers needed before or after the inner integration. - -A new Fortran 2003 interface to ARKODE was added. This includes Fortran 2003 interfaces -to the ARKStep, ERKStep, and MRIStep time-stepping modules. See the -:numref:`SUNDIALS.Fortran` section for more details. - - - -Changes in v3.1.0 ------------------ - -An additional NVECTOR implementation was added for the -Tpetra vector from the Trilinos library to facilitate interoperability -between SUNDIALS and Trilinos. This implementation is accompanied by -additions to user documentation and SUNDIALS examples. - -A bug was fixed where a nonlinear solver object could be freed twice in some use -cases. - -The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option ``EXAMPLES_ENABLE_CUDA`` -enables all examples that use CUDA including the RAJA examples with a CUDA back end -(if the RAJA NVECTOR is enabled). - -The implementation header file `arkode_impl.h` is no longer installed. This means users -who are directly manipulating the ``ARKodeMem`` structure will need to update their code -to use ARKODE's public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Fixed a bug in ``ARKodeButcherTable_Write`` when printing a Butcher table -without an embedding. - -Changes in v3.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a contributing agreement. - -Changes in v3.0.1 ------------------ - -A bug in ARKODE where single precision builds would fail to compile has been fixed. - - -Changes in v3.0.0 ------------------ - -The ARKODE library has been entirely rewritten to support a modular -approach to one-step methods, which should allow rapid research and -development of novel integration methods without affecting existing -solver functionality. To support this, the existing ARK-based methods -have been encapsulated inside the new ``ARKStep`` time-stepping -module. Two new time-stepping modules have been added: - -* The ``ERKStep`` module provides an optimized implementation for explicit - Runge--Kutta methods with reduced storage and number of calls to the ODE - right-hand side function. - -* The ``MRIStep`` module implements two-rate explicit-explicit multirate - infinitesimal step methods utilizing different step sizes for slow - and fast processes in an additive splitting. - -This restructure has resulted in numerous small changes to the user -interface, particularly the suite of "Set" routines for user-provided -solver parameters and "Get" routines to access solver statistics, -that are now prefixed with the name of time-stepping module (e.g., ``ARKStep`` -or ``ERKStep``) instead of ``ARKODE``. Aside from affecting the names of these -routines, user-level changes have been kept to a minimum. However, we recommend -that users consult both this documentation and the ARKODE example programs for -further details on the updated infrastructure. - -As part of the ARKODE restructuring an :c:type:`ARKodeButcherTable` structure -has been added for storing Butcher tables. Functions for creating new Butcher -tables and checking their analytic order are provided along with other utility -routines. For more details see :numref:`ARKodeButcherTable`. - -Two changes were made in the initial step size algorithm: - -* Fixed an efficiency bug where an extra call to the right hand side function was made. - -* Changed the behavior of the algorithm if the max-iterations case is hit. - Before the algorithm would exit with the step size calculated on the - penultimate iteration. Now it will exit with the step size calculated - on the final iteration. - -ARKODE's dense output infrastructure has been improved to support -higher-degree Hermite polynomial interpolants (up to degree 5) over -the last successful time step. - -ARKODE's previous direct and iterative linear solver interfaces, ARKDLS and -ARKSPILS, have been merged into a single unified linear solver interface, ARKLS, -to support any valid SUNLINSOL module. This includes ``DIRECT`` and -``ITERATIVE`` types as well as the new ``MATRIX_ITERATIVE`` type. Details -regarding how ARKLS utilizes linear solvers of each type as well as discussion -regarding intended use cases for user-supplied SUNLinSol implementations are -included in the chapter :numref:`SUNLinSol`. All ARKODE examples programs and the -standalone linear solver examples have been updated to use the unified linear -solver interface. - -The user interface for the new ARKLS module is very similar to the previous -ARKDLS and ARKSPILS interfaces. Additionally, we note that Fortran users will -need to enlarge their ``iout`` array of optional integer outputs, and update the -indices that they query for certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided SUNLinSol -implementations have been updated to follow the naming convention -``SUNLinSol_*`` where ``*`` is the name of the linear solver. The new names are -``SUNLinSol_Band``, ``SUNLinSol_Dense``, ``SUNLinSol_KLU``, -``SUNLinSol_LapackBand``, ``SUNLinSol_LapackDense``, ``SUNLinSol_PCG``, -``SUNLinSol_SPBCGS``, ``SUNLinSol_SPFGMR``, ``SUNLinSol_SPGMR``, -``SUNLinSol_SPTFQMR``, and ``SUNLinSol_SuperLUMT``. Solver-specific "set" -routine names have been similarly standardized. To minimize challenges in user -migration to the new names, the previous routine names may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. All ARKODE example programs and the standalone linear solver -examples have been updated to use the new naming convention. - -The ``SUNBandMatrix`` constructor has been simplified to remove the -storage upper bandwidth argument. - -SUNDIALS integrators have been updated to utilize generic nonlinear solver -modules defined through the SUNNONLINSOL API. This API will ease the addition of -new nonlinear solver options and allow for external or user-supplied nonlinear -solvers. The SUNNONLINSOL API and SUNDIALS provided modules are described in -:numref:`SUNNonlinSol` and follow the same object oriented design and -implementation used by the NVector, SUNMatrix, and SUNLinSol modules. Currently -two SUNNONLINSOL implementations are provided, SUNNonlinSol_Newton and -SUNNonlinSol_FixedPoint. These replicate the previous integrator specific -implementations of a Newton iteration and an accelerated fixed-point iteration, -respectively. Example programs using each of these nonlinear solver modules in a -standalone manner have been added and all ARKODE example programs have been -updated to use generic SUNNonlinSol modules. - -As with previous versions, ARKODE will use the Newton solver (now -provided by SUNNonlinSol_Newton) by default. Use of the -:c:func:`ARKStepSetLinear()` routine (previously named -``ARKodeSetLinear``) will indicate that the problem is -linearly-implicit, using only a single Newton iteration per implicit -stage. Users wishing to switch to the accelerated fixed-point solver -are now required to create a SUNNonlinSol_FixedPoint object and attach -that to ARKODE, instead of calling the previous -``ARKodeSetFixedPoint`` routine. See the documentation sections -:numref:`ARKODE.Usage.ARKStep.Skeleton`, -:numref:`ARKODE.Usage.ARKStep.NonlinearSolvers`, and -:numref:`SUNNonlinSol.FixedPoint` for further details, or the serial C -example program ``ark_brusselator_fp.c`` for an example. - -Three fused vector operations and seven vector array operations have been added -to the NVECTOR API. These *optional* operations are disabled by default and may -be activated by calling vector specific routines after creating an NVector (see -:numref:`NVectors.Description` for more details). The new operations are intended -to increase data reuse in vector operations, reduce parallel communication on -distributed memory systems, and lower the number of kernel launches on systems -with accelerators. The fused operations are ``N_VLinearCombination``, -``N_VScaleAddMulti``, and ``N_VDotProdMulti``, and the vector array operations -are ``N_VLinearCombinationVectorArray``, ``N_VScaleVectorArray``, -``N_VConstVectorArray``, ``N_VWrmsNormVectorArray``, -``N_VWrmsNormMaskVectorArray``, ``N_VScaleAddMultiVectorArray``, and -``N_VLinearCombinationVectorArray``. If an NVector implementation defines any of -these operations as ``NULL``, then standard NVector operations will -automatically be called as necessary to complete the computation. - -Multiple changes to the CUDA NVECTOR were made: - -* Changed the ``N_VMake_Cuda`` function to take a host data pointer and a device - data pointer instead of an ``N_VectorContent_Cuda`` object. - -* Changed ``N_VGetLength_Cuda`` to return the global vector length instead of - the local vector length. - -* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. - -* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``suncudavec``. - -* Added the ability to set the ``cudaStream_t`` used for execution of the CUDA - NVECTOR kernels. See the function ``N_VSetCudaStreams_Cuda``. - -* Added ``N_VNewManaged_Cuda``, ``N_VMakeManaged_Cuda``, and ``N_VIsManagedMemory_Cuda`` - functions to accommodate using managed memory with the CUDA NVECTOR. - -Multiple changes to the RAJA NVECTOR were made: - -* Changed ``N_VGetLength_Raja`` to return the global vector length instead of - the local vector length. - -* Added ``N_VGetLocalLength_Raja`` to return the local vector length. - -* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``sunrajavec``. - -A new NVECTOR implementation for leveraging OpenMP 4.5+ device offloading has -been added, NVECTOR_OpenMPDEV. See :numref:`NVectors.OpenMPDEV` for more details. - - -Changes in v2.2.1 ------------------ - -Fixed a bug in the CUDA NVECTOR where the ``N_VInvTest`` operation could -write beyond the allocated vector data. - -Fixed library installation path for multiarch systems. This fix changes the default -library installation path to ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` -from ``CMAKE_INSTALL_PREFIX/lib``. ``CMAKE_INSTALL_LIBDIR`` is automatically -set, but is available as a CMAKE option that can modified. - - -Changes in v2.2.0 ------------------ - -Fixed a problem with setting ``sunindextype`` which would occur with -some compilers (e.g. armclang) that did not define ``__STDC_VERSION__``. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than -one MPI rank when using a GPU system. The vectors assume one GPU -device per MPI rank. - -Changed the name of the RAJA NVECTOR library to -``libsundials_nveccudaraja.lib`` from -``libsundials_nvecraja.lib`` to better reflect that we only support CUDA -as a backend for RAJA currently. - -Several changes were made to the build system: - -* CMake 3.1.3 is now the minimum required CMake version. - -* Deprecate the behavior of the ``SUNDIALS_INDEX_TYPE`` CMake option and - added the ``SUNDIALS_INDEX_SIZE`` CMake option to select the ``sunindextype`` - integer size. - -* The native CMake FindMPI module is now used to locate an MPI - installation. - -* If MPI is enabled and MPI compiler wrappers are not set, the build system - will check if ``CMAKE_<language>_COMPILER`` can compile MPI programs before - trying to locate and use an MPI installation. - -* The previous options for setting MPI compiler wrappers and the executable - for running MPI programs have been have been depreated. The new options that - align with those used in native CMake FindMPI module are - ``MPI_C_COMPILER``, ``MPI_CXX_COMPILER``, ``MPI_Fortran_COMPILER``, - and ``MPIEXEC_EXECUTABLE``. - -* When a Fortran name-mangling scheme is needed (e.g., ``ENABLE_LAPACK`` - is ``ON``) the build system will infer the scheme from the Fortran - compiler. If a Fortran compiler is not available or the inferred or default - scheme needs to be overridden, the advanced options - ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` can - be used to manually set the name-mangling scheme and bypass trying to infer - the scheme. - -* Parts of the main CMakeLists.txt file were moved to new files in the - ``src`` and ``example`` directories to make the CMake configuration file - structure more modular. - - - -Changes in v2.1.2 ------------------ - -Updated the minimum required version of CMake to 2.8.12 and enabled -using rpath by default to locate shared libraries on OSX. - -Fixed Windows specific problem where sunindextype was not correctly -defined when using 64-bit integers for the SUNDIALS index type. On Windows -sunindextype is now defined as the MSVC basic type ``__int64``. - -Added sparse SUNMatrix "Reallocate" routine to allow specification of -the nonzero storage. - -Updated the KLU SUNLinearSolver module to set constants for the two -reinitialization types, and fixed a bug in the full reinitialization -approach where the sparse SUNMatrix pointer would go out of scope on -some architectures. - -Updated the "ScaleAdd" and "ScaleAddI" implementations in the -sparse SUNMatrix module to more optimally handle the case where the -target matrix contained sufficient storage for the sum, but had the -wrong sparsity pattern. The sum now occurs in-place, by performing -the sum backwards in the existing storage. However, it is still more -efficient if the user-supplied Jacobian routine allocates storage for -the sum :math:`I+\gamma J` or :math:`M+\gamma J` manually (with zero -entries if needed). - -Changed LICENSE install path to ``instdir/include/sundials``. - - - -Changes in v2.1.1 ------------------ - -Fixed a potential memory leak in the SPGMR and SPFGMR linear solvers: -if "Initialize" was called multiple times then the solver memory was -reallocated (without being freed). - -Fixed a minor bug in the ARKReInit routine, where a flag was -incorrectly set to indicate that the problem had been resized (instead -of just re-initialized). - -Fixed C++11 compiler errors/warnings about incompatible use of string -literals. - -Updated KLU SUNLinearSolver module to use a ``typedef`` for the -precision-specific solve function to be used (to avoid compiler -warnings). - -Added missing typecasts for some ``(void*)`` pointers (again, to avoid -compiler warnings). - -Bugfix in ``sunmatrix_sparse.c`` where we had used ``int`` instead of -``sunindextype`` in one location. - -Added missing ``#include <stdio.h>`` in NVECTOR and SUNMATRIX header files. - -Added missing prototype for ``ARKSpilsGetNumMTSetups``. - -Fixed an indexing bug in the CUDA NVECTOR implementation of -``N_VWrmsNormMask`` and revised the RAJA NVECTOR implementation of -``N_VWrmsNormMask`` to work with mask arrays using values other than -zero or one. Replaced ``double`` with ``realtype`` in the RAJA vector -test functions. - -Fixed compilation issue with GCC 7.3.0 and Fortran programs that do -not require a SUNMatrix or SUNLinearSolver module (e.g. iterative -linear solvers, explicit methods, fixed point solver, etc.). - - -Changes in v2.1.0 ------------------ - -Added NVECTOR print functions that write vector data to a specified -file (e.g. ``N_VPrintFile_Serial``). - -Added ``make test`` and ``make test_install`` options to the build -system for testing SUNDIALS after building with ``make`` and -installing with ``make install`` respectively. - - -Changes in v2.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been -reworked, and all example programs have been updated. The goal of the -redesign of these interfaces was to provide more encapsulation and -ease in interfacing custom linear solvers and interoperability with -linear solver libraries. - -Specific changes include: - -* Added generic SUNMATRIX module with three provided implementations: - dense, banded and sparse. These replicate previous SUNDIALS Dls and - Sls matrix structures in a single object-oriented API. - -* Added example problems demonstrating use of generic SUNMATRIX modules. - -* Added generic SUNLINEARSOLVER module with eleven provided - implementations: dense, banded, LAPACK dense, LAPACK band, KLU, - SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, PCG. These replicate - previous SUNDIALS generic linear solvers in a single object-oriented - API. - -* Added example problems demonstrating use of generic SUNLINEARSOLVER modules. - -* Expanded package-provided direct linear solver (Dls) interfaces and - scaled, preconditioned, iterative linear solver (Spils) interfaces - to utilize generic SUNMATRIX and SUNLINEARSOLVER objects. - -* Removed package-specific, linear solver-specific, solver modules - (e.g. CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since their functionality - is entirely replicated by the generic Dls/Spils interfaces and - SUNLINEARSOLVER/SUNMATRIX modules. The exception is CVDIAG, a - diagonal approximate Jacobian solver available to CVODE and CVODES. - -* Converted all SUNDIALS example problems to utilize new generic - SUNMATRIX and SUNLINEARSOLVER objects, along with updated Dls and - Spils linear solver interfaces. - -* Added Spils interface routines to ARKODE, CVODE, CVODES, IDA and - IDAS to allow specification of a user-provided "JTSetup" routine. - This change supports users who wish to set up data structures for - the user-provided Jacobian-times-vector ("JTimes") routine, and - where the cost of one JTSetup setup per Newton iteration can be - amortized between multiple JTimes calls. - -Two additional NVECTOR implementations were added -- one for CUDA and -one for RAJA vectors. These vectors are supplied to provide very -basic support for running on GPU architectures. Users are advised -that these vectors both move all data to the GPU device upon -construction, and speedup will only be realized if the user also -conducts the right-hand-side function evaluation on the device. In -addition, these vectors assume the problem fits on one GPU. Further -information about RAJA, users are referred to the web site, -`https://software.llnl.gov/RAJA/ <https://software.llnl.gov/RAJA/>`_. -These additions are accompanied by additions to various interface -functions and to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` -that can be configured to be a 32- or 64-bit integer data index type. -``sunindextype`` is defined to be ``int32_t`` or ``int64_t`` when -portable types are supported, otherwise it is defined as ``int`` or -``long int``. The Fortran interfaces continue to use ``long int`` for -indices, except for their sparse matrix interface that now uses the -new ``sunindextype``. This new flexible capability for index types -includes interfaces to PETSc, *hypre*, SuperLU_MT, and KLU with either -32-bit or 64-bit capabilities depending how the user configures -SUNDIALS. - -To avoid potential namespace conflicts, the macros defining -``booleantype`` values ``TRUE`` and ``FALSE`` have been changed to -``SUNTRUE`` and ``SUNFALSE`` respectively. - -Temporary vectors were removed from preconditioner setup and solve -routines for all packages. It is assumed that all necessary data -for user-provided preconditioner operations will be allocated and -stored in user-provided data structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains -SUNDIALS type information for use in Fortran programs. - -Added functions SUNDIALSGetVersion and SUNDIALSGetVersionNumber to get -SUNDIALS release version information at runtime. - -The build system was expanded to support many of the xSDK-compliant keys. -The xSDK is a movement in scientific software to provide a foundation for the -rapid and efficient production of high-quality, -sustainable extreme-scale scientific applications. More information can -be found at, `https://xsdk.info <https://xsdk.info>`_. - -In addition, numerous changes were made to the build system. -These include the addition of separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` -CMake variables, additional error checking during CMake configuration, -minor bug fixes, and renaming CMake options to enable/disable examples -for greater clarity and an added option to enable/disable Fortran 77 examples. -These changes included changing ``ENABLE_EXAMPLES`` to ``ENABLE_EXAMPLES_C``, -changing ``CXX_ENABLE`` to ``EXAMPLES_ENABLE_CXX``, changing ``F90_ENABLE`` to -``EXAMPLES_ENABLE_F90``, and adding an ``EXAMPLES_ENABLE_F77`` option. - -Corrections and additions were made to the examples, to -installation-related files, and to the user documentation. - - - - -Changes in v1.1.0 ------------------ - -We have included numerous bugfixes and enhancements since the -v1.0.2 release. - -The bugfixes include: - -* For each linear solver, the various solver performance counters are - now initialized to 0 in both the solver specification function and - in the solver's ``linit`` function. This ensures that these solver - counters are initialized upon linear solver instantiation as well as - at the beginning of the problem solution. - -* The choice of the method vs embedding the Billington and TRBDF2 - explicit Runge--Kutta methods were swapped, since in those the - lower-order coefficients result in an A-stable method, while the - higher-order coefficients do not. This change results in - significantly improved robustness when using those methods. - -* A bug was fixed for the situation where a user supplies a vector of - absolute tolerances, and also uses the vector Resize() functionality. - -* A bug was fixed wherein a user-supplied Butcher table without an - embedding is supplied, and the user is running with either fixed - time steps (or they do adaptivity manually); previously this had - resulted in an error since the embedding order was below 1. - -* Numerous aspects of the documentation were fixed and/or clarified. - - -The feature changes/enhancements include: - -* Two additional NVECTOR implementations were added -- one for Hypre - (parallel) ParVector vectors, and one for PETSc vectors. These - additions are accompanied by additions to various interface - functions and to user documentation. - -* Each NVECTOR module now includes a function, ``N_VGetVectorID``, - that returns the NVECTOR module name. - -* A memory leak was fixed in the banded preconditioner and - banded-block-diagonal preconditioner interfaces. In addition, - updates were done to return integers from linear solver and - preconditioner 'free' routines. - -* The Krylov linear solver Bi-CGstab was enhanced by removing a - redundant dot product. Various additions and corrections were made - to the interfaces to the sparse solvers KLU and SuperLU_MT, - including support for CSR format when using KLU. - -* The ARKODE implicit predictor algorithms were updated: methods 2 and - 3 were improved slightly, a new predictor approach was added, and - the default choice was modified. - -* The underlying sparse matrix structure was enhanced to allow both - CSR and CSC matrices, with CSR supported by the KLU linear solver - interface. ARKODE interfaces to the KLU solver from both C and - Fortran were updated to enable selection of sparse matrix type, and a - Fortran-90 CSR example program was added. - -* The missing :c:func:`ARKSpilsGetNumMtimesEvals()` function was added - -- this had been included in the previous documentation but had not - been implemented. - -* The handling of integer codes for specifying built-in ARKODE Butcher - tables was enhanced. While a global numbering system is still used, - methods now have #defined names to simplify the user interface and to - streamline incorporation of new Butcher tables into ARKODE. - -* The maximum number of Butcher table stages was increased from 8 to - 15 to accommodate very high order methods, and an 8th-order adaptive - ERK method was added. - -* Support was added for the explicit and implicit methods in an - additive Runge--Kutta method to utilize different stage times, - solution and embedding coefficients, to support new SSP-ARK - methods. - -* The FARKODE interface was extended to include a routine to set - scalar/array-valued residual tolerances, to support Fortran - applications with non-identity mass-matrices. +For changes in prior versions of SUNDIALS see :numref:`Changelog`. Reading this User Guide diff --git a/doc/arkode/guide/source/RecentChanges_link.rst b/doc/arkode/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/arkode/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/arkode/guide/source/conf.py b/doc/arkode/guide/source/conf.py index f2a4c90455..db90126fc6 100644 --- a/doc/arkode/guide/source/conf.py +++ b/doc/arkode/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/arkode/guide/source/index.rst b/doc/arkode/guide/source/index.rst index 17978427b0..809a408329 100644 --- a/doc/arkode/guide/source/index.rst +++ b/doc/arkode/guide/source/index.rst @@ -70,6 +70,7 @@ with support by the `US Department of Energy <http://www.doe.gov>`_, Constants Butcher History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/cvode/guide/source/Changelog_link.rst b/doc/cvode/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/cvode/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 43df0d16c2..957a43e04e 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -108,1864 +108,12 @@ implementations. .. efficiency of C, and the greater ease of interfacing the solver to .. applications written in extended Fortran. -Changes from previous versions -============================== +Changes to SUNDIALS in release X.Y.Z +==================================== -Changes in vX.X.X ------------------- +.. include:: ../../../shared/RecentChanges.rst -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). - -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - - -Changes in v7.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the functions -``CVodeSetErrFile`` and ``CVodeSetHandlerErrFn`` have been removed. Users of -these functions can use the functions :c:func:`SUNContext_PushErrHandler`, and -:c:func:`SUNLogger_SetErrorFilename` instead. For further details see Sections -:numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -*Fortran Interface Modules Streamlined* - -We have streamlined the Fortran modules that need to be included by users by combining -the SUNDIALS core into one Fortran module, ``fsundials_core_mod``. Modules for -implementations of the core APIs still exist (e.g., for the Dense linear solver there -is ``fsunlinsol_dense_mod``) as do the modules for the SUNDIALS packages (e.g., ``fcvode_mod``). -The following modules are the ones that have been consolidated into ``fsundials_core_mod``: - -.. code-block:: - - fsundials_adaptcontroller_mod - fsundials_context_mod - fsundials_futils_mod - fsundials_linearsolver_mod - fsundials_logger_mod - fsundials_matrix_mod - fsundials_nonlinearsolver_mod - fsundials_nvector_mod - fsundials_profiler_mod - fsundials_types_mod - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be -deprecated -- users who rely on these are recommended to transition to the -corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v6.7.0 ------------------ - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` -to ``O(NNZ)``. - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Fixed a regression introduced by the stop time bug fix in v6.6.1 where CVODE -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 output time was passed. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Changes in v6.6.2 ------------------ - -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. - -Changes in v6.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Fixed a bug where the stop time may not be cleared when using normal mode if the -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. - -Changes in v6.6.0 ------------------ - -Updated the default CVODE behavior when returning the solution when -the internal time has reached a user-specified stop time. Previously, the output -solution was interpolated to the value of ``tstop``; the default is now to copy the -internal solution vector. Users who wish to revert to interpolation may call the -routine :c:func:`CVodeSetInterpolateStopTime`. - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v6.5.1 ------------------ - -Added the function :c:func:`CVodeClearStopTime` to disable a previously set stop -time. - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -Changes in v6.5.0 ------------------ - -Added the functions :c:func:`CVodeGetJac`, :c:func:`CVodeGetJacTime`, -:c:func:`CVodeGetJacNumSteps` to assist in debugging simulations utilizing -a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an underflow bug during root finding. - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added support for CUDA v12. -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Changes in v6.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v6.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector. - -Fixed a memory leak where the projection memory would not be deallocated when -calling :c:func:`CVodeFree`. - -Changes in v6.3.0 ------------------ - -Added the function :c:func:`CVodeGetUserData` to retrieve the user data pointer -provided to :c:func:`CVodeSetUserData`. - -Added a new example, ``examples/cvode/serial/cvRocket_dns.c,`` which -demonstrates using CVODE with a discontinuous right-hand-side function -and rootfinding. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v6.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the function :c:func:`CVodePrintAllStats` to output all of the integrator, -nonlinear solver, linear solver, and other statistics in one call. The file -``scripts/sundials_csv.py`` contains functions for parsing the comma-separated -value output files. - -Added the functions -:c:func:`CVodeSetEtaFixedStepBounds`, -:c:func:`CVodeSetEtaMaxFirstStep`, -:c:func:`CVodeSetEtaMaxEarlyStep`, -:c:func:`CVodeSetNumStepsEtaMaxEarlyStep`, -:c:func:`CVodeSetEtaMax`, -:c:func:`CVodeSetEtaMin`, -:c:func:`CVodeSetEtaMinErrFail`, -:c:func:`CVodeSetEtaMaxErrFail`, -:c:func:`CVodeSetNumFailsEtaMaxErrFail`, and -:c:func:`CVodeSetEtaConvFail` to adjust various parameters controlling changes -in step size. - -Added the functions :c:func:`CVodeSetDeltaGammaMaxLSetup` and -:c:func:`CVodeSetDeltaGammaMaxBadJac` to adjust the :math:`\gamma` change -thresholds to require a linear solver setup or Jacobian/precondition update, -respectively. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the functions :c:func:`CVodeGetNumNonlinSolvConvFails` and -:c:func:`CVodeGetNonlinSolvStats` where the number of nonlinear solver failures -returned was the number of failed *steps* due to a nonlinear solver failure -i.e., if a nonlinear solve failed with a stale Jacobian or preconditioner but -succeeded after updating the Jacobian or preconditioner, the initial failure was -not included in the nonlinear solver failure count. These functions have been -updated to return the total number of nonlinear solver failures. As such users -may see an increase in the number of failures reported. - -The function :c:func:`CVodeGetNumStepSolveFails` has been added to retrieve the -number of failed steps due to a nonlinear solver failure. The count returned by -this function will match those previously returned by -:c:func:`CVodeGetNumNonlinSolvConvFails` and :c:func:`CVodeGetNonlinSolvStats`. - -Changes in v6.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Changes in v6.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v6.0.0 ------------------ - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**CVODE** - -The previously deprecated function ``CVodeSetMaxStepsBetweenJac`` has been -removed and replaced with :c:func:`CVodeSetJacEvalFrequency`. - -The CVODE Fortran 77 interface has been removed. See :numref:`SUNDIALS.Fortran` -and the F2003 example programs for more details using the SUNDIALS Fortran 2003 -module interfaces. - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``CVSpilsSetLinearSolver`` | ``CVodeSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetEpsLin`` | ``CVodeSetEpsLin`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetPreconditioner`` | ``CVodeSetPreconditioner`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetJacTimes`` | ``CVodeSetJacTimes`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetWorkSpace`` | ``CVodeGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumPrecEvals`` | ``CVodeGetNumPrecEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumPrecSolves`` | ``CVodeGetNumPrecSolves`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumLinIters`` | ``CVodeGetNumLinIters`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumConvFails`` | ``CVodeGetNumConvFails`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumJTSetupEvals`` | ``CVodeGetNumJTSetupEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumJtimesEvals`` | ``CVodeGetNumJtimesEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumRhsEvals`` | ``CVodeGetNumLinRhsEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetLastFlag`` | ``CVodeGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetReturnFlagName`` | ``CVodeGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetLinearSolver`` | ``CVodeSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetJacFn`` | ``CVodeSetJacFn`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetWorkSpace`` | ``CVodeGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetNumJacEvals`` | ``CVodeGetNumJacEvals`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetNumRhsEvals`` | ``CVodeGetNumLinRhsEvals`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetLastFlag`` | ``CVodeGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetReturnFlagName`` | ``CVodeGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v5.8.0 ------------------ - -The :ref:`RAJA N_Vector <NVectors.RAJA>` implementation has been updated to -support the SYCL backend in addition to the CUDA and HIP backend. Users can -choose the backend when configuring SUNDIALS by using the -``SUNDIALS_RAJA_BACKENDS`` CMake variable. This module remains experimental -and is subject to change from version to version. - -New :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` implementations were added to -interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix -and the linear solver support general dense linear systems as well as block -diagonal linear systems. See :numref:`SUNLinSol.OneMklDense` for more details. -This module is experimental and is subject to change from version to version. - -Added a new *optional* function to the SUNLinearSolver API, -:c:func:`SUNLinSolSetZeroGuess()`, to indicate that the next call to -:c:func:`SUNLinSolSolve()` will be made with a zero initial guess. SUNLinearSolver -implementations that do not use the :c:func:`SUNLinSolNewEmpty` constructor will, -at a minimum, need set the ``setzeroguess`` function pointer in the linear solver -``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver -implementations have been updated to leverage this new set function to remove -one dot product per solve. - -CVODE now supports a new "matrix-embedded" :c:type:`SUNLinearSolver` type. This -type supports user-supplied :c:type:`SUNLinearSolver` implementations that set up -and solve the specified linear system at each linear solve call. Any -matrix-related data structures are held internally to the linear solver itself, -and are not provided by the SUNDIALS package. - -Added specialized fused HIP kernels to CVODE which may offer better -performance on smaller problems when using CVODE with the -:ref:`N_Vector HIP <NVectors.HIP>` module. See the optional input function -:c:func:`CVodeSetUseIntegratorFusedKernels()` for more information. As with -other SUNDIALS HIP features, this capability is considered experimental and may -change from version to version. - -Added the function :c:func:`CVodeSetNlsRhsFn()` to supply an alternative right-hand -side function for use within nonlinear system function evaluations. - -The installed ``SUNDIALSConfig.cmake`` file now supports the ``COMPONENTS`` option -to ``find_package``. The exported targets no longer have ``IMPORTED_GLOBAL`` -set. - -A bug was fixed in :c:func:`SUNMatCopyOps()` where the matrix-vector product setup -function pointer was not copied. - -A bug was fixed in the :c:ref:`SPBCGS <SUNLinSol.SPBCGS>` and -:c:ref:`SPTFQMR <SUNLinSol.SPTFQMR>` solvers for the case where a non-zero -initial guess and a solution scaling vector are provided. This fix only impacts -codes using :c:ref:`SPBCGS <SUNLinSol.SPBCGS>` or :c:ref:`SPTFQMR <SUNLinSol.SPTFQMR>` -as standalone solvers as all SUNDIALS packages utilize a zero initial guess. - -Changes in v5.7.0 ------------------ - -A new :c:type:`N_Vector` implementation based on the SYCL abstraction layer -has been added targeting Intel GPUs. At present the only SYCL -compiler supported is the DPC++ (Intel oneAPI) compiler. See -:numref:`NVectors.sycl` for more details. This module is -considered experimental and is subject to major changes even in minor -releases. - -New ``SUNMatrix`` and ``SUNLinearSolver`` implementations were added to -interface with the MAGMA linear algebra library. Both the matrix and the -linear solver support general dense linear systems as well as block -diagonal linear systems, and both are targeted at GPUs (AMD or NVIDIA). -See :numref:`SUNLinSol.MagmaDense` for more details. - -Changes in v5.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error if the -``CMAKE_CXX_STANDARD`` and ``SUNDIALS_RAJA_BACKENDS`` options were not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v5.6.0 ------------------ - -A new :c:type:`N_Vector` implementation based on the AMD ROCm HIP platform has -been added. This vector can target NVIDIA or AMD GPUs. See -:numref:`NVectors.hip` for more details. This module is -considered experimental and is subject to change from version to -version. - -The :ref:`RAJA N_Vector <NVectors.RAJA>` implementation has been updated to support the HIP -backend in addition to the CUDA backend. Users can choose the backend -when configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. This module -remains experimental and is subject to change from version to version. - -A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the N_Vector API. This -operation is useful for N_Vectors that utilize dual memory spaces, e.g. -the native SUNDIALS CUDA N_Vector. - -The :ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` and -:ref:`SUNLINEARSOLVER_CUSOLVERSP_BATCHQR <SUNLinSol.cuSolverSp>` -implementations no longer require the SUNDIALS :ref:`CUDA N_Vector <NVectors.CUDA>`. Instead, -they require that the vector utilized provides the :c:func:`N_VGetDeviceArrayPointer` operation, and that -the pointer returned by :c:func:`N_VGetDeviceArrayPointer` is a valid CUDA device pointer. - -Changes in v5.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now -required. Users will likely see deprecation warnings, but otherwise the -changes should be fully backwards compatible for almost all users. -SUNDIALS now exports CMake targets and installs a -SUNDIALSConfig.cmake file. - -Added support for SuperLU DIST 6.3.0 or newer. - -Changes in v5.4.0 ------------------ - -Added new functions :c:func:`CVodeComputeState`, and -:c:func:`CVodeGetNonlinearSystemData` which advanced users might find useful if -providing a custom :c:type:`SUNNonlinSolSysFn`. - -Added the function :c:func:`CVodeSetLSNormFactor` to specify the factor for -converting between integrator tolerances (WRMS norm) and linear solver -tolerances (L2 norm) i.e., ``tol_L2 = nrmfac * tol_WRMS``. - -The expected behavior of :c:func:`SUNNonlinSolGetNumIters` and -:c:func:`SUNNonlinSolGetNumConvFails` in the :c:type:`SUNNonlinearSolver` API have -been updated to specify that they should return the number of nonlinear solver -iterations and convergence failures in the most recent solve respectively rather -than the cumulative number of iterations and failures across all solves -respectively. The API documentation and SUNDIALS provided :c:type:`SUNNonlinearSolver` -implementations have been updated accordingly. As before, the cumulative number -of nonlinear iterations may be retreived by calling -:c:func:`CVodeGetNumNonlinSolvIters`, the cumulative number of failures with -:c:func:`CVodeGetNumNonlinSolvConvFails`, or both with -:c:func:`CVodeGetNonlinSolvStats`. - -A minor inconsistency in checking the Jacobian evaluation frequency has -been fixed. As a result codes using using a non-default Jacobian update -frequency through a call to :c:func:`CVodeSetMaxStepsBetweenJac` will need to increase the provided value by -1 to achieve the same behavior as before. For greater clarity the -function has been deprecated and replaced with :c:func:`CVodeSetJacEvalFrequency`. Additionally, the -function :c:func:`CVodeSetLSetupFrequency` has been added to set the frequency of calls to the linear -solver setup function. - -A new class, :ref:`SUNMemoryHelper <SUNMemory>`, was added to support **GPU -users** who have complex memory management needs such as using memory pools. -This is paired with new constructors for the ``NVECTOR_CUDA`` and -``NVECTOR_RAJA`` modules that accept a ``SUNMemoryHelper`` object. Refer to -:numref:`SUNDIALS.GPU`, :numref:`SUNMemory`, :numref:`NVectors.cuda` and -:numref:`NVectors.raja` for more information. - -The ``NVECTOR_RAJA`` vector implementation has been updated to mirror the -``NVECTOR_CUDA`` implementation. Notably, the update adds managed memory -support. Users of the vector will need to update any calls to the function -because that signature was changed. This vector remains experimental and is -subject to change from version to version. - -The ``NVECTOR_TRILINOS`` vector implementation has been updated to work with -Trilinos 12.18+. This update changes the local ordinal type to always be an -``int``. - -Changes in v5.3.0 ------------------ - -Fixed a bug in the iterative linear solver modules where an error is not -returned if the Atimes function is ``NULL`` or, if preconditioning is enabled, -the PSolve function is ``NULL``. - -Added specialized fused CUDA kernels to CVODE which may offer -better performance on smaller problems when using CVODE with the -``NVECTOR_CUDA`` module. See the optional input function for more -information. As with other SUNDIALS CUDA features, this -capability is considered experimental and may change from version to -version. - -Added the ability to control the CUDA kernel launch parameters for the -``NVECTOR_CUDA`` and ``SUNMATRIX_CUSPARSE`` modules. These modules remain -experimental and are subject to change from version to version. In addition, the -kernels were rewritten to be more flexible. Most users should see equivalent -performance or some improvement, but a select few may observe minor performance -degradation with the default settings. Users are encouraged to contact the -SUNDIALS team about any perfomance changes that they notice. - -Added new capabilities for monitoring the solve phase in the -``SUNNONLINSOL_NEWTON`` and ``SUNNONLINSOL_FIXEDPOINT`` modules, and the -SUNDIALS iterative linear solver modules. SUNDIALS must be built -with the ``SUNDIALS_BUILD_WITH_MONITORING`` CMake option set to ``TRUE`` to use these capabilties. - -Added a new function, :c:func:`CVodeSetMonitorFn`, that takes a user-function to be called by -CVODE after every :math:`nst` succesfully completed time-steps. This -is intended to provide a way of monitoring the CVODE statistics -throughout the simulation. - -Added a new function :c:func:`CVodeGetLinSolveStats` to get the CVODE linear solver statistics as a -group. - -Added the optional function :c:func:`CVodeSetJacTimsRhsFn` to specify an alternative right-hand side -function for computing Jacobian-vector products with the internal -difference quotient approximation. - -Added support for integrating IVPs with constraints using BDF methods -and projecting the solution onto the constraint manifold with a user -defined projection function. This implementation is accompanied by -additions to user documentation and CVODE examples. See -:c:func:`CVodeSetProjFn` for more information. - -Added support for CUDA v11. - -Changes in v5.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the -IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler -it is recommended to set ``CMAKE_Fortran_COMPILER`` to ``f2003``, ``xlf2003``, -or ``xlf2003_r``. - -Fixed a linkage bug affecting Windows users that stemmed from -dllimport/dllexport attributes missing on some SUNDIALS API functions. - -Added a new ``SUNMatrix`` implementation, ``SUNMATRIX_CUSPARSE``, that -interfaces to the sparse matrix implementation from the NVIDIA cuSPARSE library. -In addition, the linear solver has been updated to use this matrix, therefore, -users of this module will need to update their code. These modules are still -considered to be experimental, thus they are subject to breaking changes even in -minor releases. - -The function :c:func:`CVodeSetLinearSolutionScaling` was added to enable or -disable the scaling applied to linear system solutions with matrix-based linear -solvers to account for a lagged value of :math:`\gamma` in the linear system -matrix :math:`I - \gamma J`. Scaling is enabled by default when using a -matrix-based linear solver with BDF methods. - -Changes in v5.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake -variables ``PETSC_INCLUDES`` and ``PETSC_LIBRARIES`` instead of ``PETSC_DIR``. - -Added a new build system option, ``CUDA_ARCH``, that can be used to specify the CUDA -architecture to compile for. - -Added two utility functions, :c:func:`SUNDIALSFileOpen` and -:c:func:`SUNDIALSFileClose` for creating/destroying file pointers that are -useful when using the Fortran 2003 interfaces. - -Added support for constant damping to the :ref:`SUNNonlinearSolver_FixedPoint -<SUNNonlinSol.FixedPoint>` module when using Anderson acceleration. - -Changes in v5.0.0 ------------------ - -**Build system changes** - -- Increased the minimum required CMake version to 3.5 for most - SUNDIALS configurations, and 3.10 when CUDA or OpenMP with device - offloading are enabled. - -- The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been removed to simplify - builds as SUNDIALS packages do not use BLAS directly. For third - party libraries that require linking to BLAS, the path to the BLAS - library should be included in the variable for the third party - library *e.g.*, ``SUPERLUDIST_LIBRARIES`` when enabling SuperLU_DIST. - -- Fixed a bug in the build system that prevented the ``NVECTOR_PTHREADS`` - module from being built. - -**NVECTOR module changes** - -- Two new functions were added to aid in creating custom ``N_Vector`` - objects. The constructor :c:func:`N_VNewEmpty` allocates an “empty” generic ``N_Vector`` - with the object’s content pointer and the function pointers in the - operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any - new optional operations to the ``N_Vector`` API by ensuring only - required operations need to be set. Additionally, the function :c:func:`N_VCopyOps` has - been added to copy the operation function pointers between vector - objects. When used in clone routines for custom vector objects these - functions also will ease the introduction of any new optional - operations to the ``N_Vector`` API by ensuring all operations are - copied when cloning objects. See :numref:`NVectors.Description.custom_implementation` for more details. - -- Two new ``N_Vector`` implementations, ``NVECTOR_MANYVECTOR`` and - ``NVECTOR_MPIMANYVECTOR``, have been created to support flexible - partitioning of solution data among different processing elements - (e.g., CPU + GPU) or for multi-physics problems that couple distinct - MPI-based simulations together. This implementation is accompanied by - additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.manyvector` and :numref:`NVectors.mpimanyvector` for more - details. - -- One new required vector operation and ten new optional vector - operations have been added to the ``N_Vector`` API. The new required - operation, , returns the global length of an . The optional operations have - been added to support the new ``NVECTOR_MPIMANYVECTOR`` implementation. The - operation must be implemented by subvectors that are combined to create an - ``NVECTOR_MPIMANYVECTOR``, but is not used outside of this context. The - remaining nine operations are optional local reduction operations intended to - eliminate unnecessary latency when performing vector reduction operations - (norms, etc.) on distributed memory systems. The optional local reduction - vector operations are :c:func:`N_VDotProdLocal`, :c:func:`N_VMaxNormLocal`, - :c:func:`N_VL1NormLocal`, :c:func:`N_VWSqrSumLocal`, - :c:func:`N_VWSqrSumMaskLocal`, :c:func:`N_VInvTestLocal`, - :c:func:`N_VConstrMaskLocal`, :c:func:`N_VMinLocal`, and - :c:func:`N_VMinQuotientLocal`. If an ``N_Vector`` implementation defines any - of the local operations as , then the ``NVECTOR_MPIMANYVECTOR`` will call - standard ``N_Vector`` operations to complete the computation. - -- An additional ``N_Vector`` implementation, ``NVECTOR_MPIPLUSX``, has been - created to support the MPI+X paradigm where X is a type of on-node - parallelism (*e.g.*, OpenMP, CUDA). The implementation is accompanied - by additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.mpiplusx` for more details. - -- The and functions have been removed from the ``NVECTOR_CUDA`` and - ``NVECTOR_RAJA`` implementations respectively. Accordingly, the - ``nvector_mpicuda.h``, ``libsundials_nvecmpicuda.lib``, - ``libsundials_nvecmpicudaraja.lib``, and files have been removed. Users - should use the ``NVECTOR_MPIPLUSX`` module coupled in conjunction with the - ``NVECTOR_CUDA`` or ``NVECTOR_RAJA`` modules to replace the functionality. - The necessary changes are minimal and should require few code modifications. - See the programs in and for examples of how to use the ``NVECTOR_MPIPLUSX`` - module with the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` modules respectively. - -- Fixed a memory leak in the ``NVECTOR_PETSC`` module clone function. - -- Made performance improvements to the ``NVECTOR_CUDA`` module. Users who - utilize a non-default stream should no longer see default stream - synchronizations after memory transfers. - -- Added a new constructor to the ``NVECTOR_CUDA`` module that allows a user - to provide custom allocate and free functions for the vector data - array and internal reduction buffer. See :numref:`NVectors.Cuda` for more details. - -- Added new Fortran 2003 interfaces for most ``N_Vector`` modules. See - :numref:`NVectors` for more details on how to use - the interfaces. - -- Added three new ``N_Vector`` utility functions :c:func:`N_VGetVecAtIndexVectorArray`, - :c:func:`N_VSetVecAtIndexVectorArray`, and :c:func:`N_VNewVectorArray` for working - with arrays when using the Fortran 2003 interfaces. - -**SUNMatrix module changes** - -- Two new functions were added to aid in creating custom ``SUNMatrix`` - objects. The constructor :c:func:`SUNMatNewEmpty` allocates an “empty” generic ``SUNMatrix`` - with the object’s content pointer and the function pointers in the - operations structure initialized to . When used in the constructor - for custom objects this function will ease the introduction of any - new optional operations to the ``SUNMatrix`` API by ensuring only - required operations need to be set. Additionally, the function :c:func:`SUNMatCopyOps` has - been added to copy the operation function pointers between matrix - objects. When used in clone routines for custom matrix objects these - functions also will ease the introduction of any new optional - operations to the ``SUNMatrix`` API by ensuring all operations are - copied when cloning objects. See :numref:`SUNMatrix` for more - details. -- A new operation, :c:func:`SUNMatMatvecSetup`, was added to the ``SUNMatrix`` API to perform any - setup necessary for computing a matrix-vector product. This operation - is useful for ``SUNMatrix`` implementations which need to prepare the - matrix itself, or communication structures before performing the - matrix-vector product. Users who have implemented custom - ``SUNMatrix`` modules will need to at least update their code to set - the corresponding structure member to ``NULL``. See :numref:`SUNMatrix.Ops` - for more details. -- The generic ``SUNMatrix`` API now defines error codes to be returned - by ``SUNMatrix`` operations. Operations which return an integer flag - indiciating success/failure may return different values than - previously. -- A new ``SUNMatrix`` (and ``SUNLinearSolver``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNMatrix.SLUNRloc` for more details. -- Added new Fortran 2003 interfaces for most ``SUNMatrix`` modules. See - :numref:`SUNMatrix` for more details on how to - use the interfaces. - -**SUNLinearSolver module changes** - -- A new function was added to aid in creating custom ``SUNLinearSolver`` - objects. The constructor allocates an “empty” generic ``SUNLinearSolver`` - with the object’s content pointer and the function pointers in the operations - structure initialized to . When used in the constructor for custom objects - this function will ease the introduction of any new optional operations to - the ``SUNLinearSolver`` API by ensuring only required operations need to be - set. See :numref:`SUNLinSol.API.Custom` for more details. -- The return type of the ``SUNLinearSolver`` API function has changed from to - to be consistent with the type used to store row indices in dense and banded - linear solver modules. -- Added a new optional operation to the ``SUNLinearSolver`` API, - :c:func:`SUNLinSolLastFlag`, that returns a for identifying the linear solver module. -- The ``SUNLinearSolver`` API has been updated to make the initialize and - setup functions optional. -- A new ``SUNLinearSolver`` (and ``SUNMatrix``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNLinSol.SuperLUDIST` for more details. -- Added a new ``SUNLinearSolver`` implementation, :ref:`SUNLINEARSOLVER_CUSOLVERSP <SUNLinSol.cuSolverSp>`, - which leverages the NVIDIA cuSOLVER sparse batched QR method for efficiently solving block - diagonal linear systems on NVIDIA GPUs. -- Added three new accessor functions to the ``SUNLINSOL_KLU`` module, :c:func:`SUNLinSol_KLUGetSymbolic`, - , :c:func:`SUNLinSol_KLUGetNumeric` and :c:func:`SUNLinSol_KLUGetCommon`, to - provide user access to the underlying KLU solver structures. See - :numref:`SUNLinSol.KLU` for more details. -- Added new Fortran 2003 interfaces for most ``SUNLinearSolver`` modules. See - :numref:`SUNLinSol` for more details on how to use the interfaces. - -**SUNNonlinearSolver module changes** - -- A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolSetConvTestFn` allocates an - “empty” generic ``SUNNonlinearSolver`` with the object’s content pointer and - the function pointers in the operations structure initialized to . When used - in the constructor for custom objects this function will ease the - introduction of any new optional operations to the ``SUNNonlinearSolver`` API - by ensuring only required operations need to be set. See - :numref:`SUNNonlinSol.API.Custom` for more details. -- To facilitate the use of user supplied nonlinear solver convergence - test functions the function in the ``SUNNonlinearSolver`` API has been - updated to take a data pointer as input. The supplied data pointer will be - passed to the nonlinear solver convergence test function on each call. -- The inputs values passed to the first two inputs of the function - :c:func:`SUNNonlinSolSolve` in the ``SUNNonlinearSolver`` have been changed to - be the predicted state and the initial guess for the correction to that state. Additionally, the - definitions of :c:func:`SUNNonlinSolLSetupFn` and - :c:func:`SUNNonlinSolLSolveFn` in the ``SUNNonlinearSolver`` API have been - updated to remove unused input parameters. For more information on the - nonlinear system formulation see :numref:`SUNNonlinSol.CVODE` and for more - details on the API functions see :numref:`SUNNonlinSol`. -- Added a new ``SUNNonlinearSolver`` implementation, ``SUNNONLINSOL_PETSC``, - which interfaces to the PETSc SNES nonlinear solver API. See - :numref:`SUNNonlinSol.PetscSNES` for more details. -- Added new Fortran 2003 interfaces for most ``SUNNonlinearSolver`` modules. - See :numref:`SUNDIALS.Fortran` for more details on how to use the - interfaces. - -**CVODE changes** - -- Fixed a bug in the CVODE constraint handling where the step size - could be set below the minimum step size. -- Fixed a bug in the CVODE nonlinear solver interface where the - norm of the accumulated correction was not updated when using a non-default - convergence test function. -- Fixed a memeory leak in FCVODE when not using the default - nonlinear solver. -- Removed extraneous calls to for simulations where the scalar valued - absolute tolerance, or all entries of the vector-valued absolute tolerance - array, are strictly positive. In this scenario, CVODE will remove at least - one global reduction per time step. -- The CVLS interface has been updated to only zero the Jacobian matrix - before calling a user-supplied Jacobian evaluation function when the attached - linear solver has type ``SUNLINEARSOLVER_DIRECT``. -- A new linear solver interface function :c:func:`CVLsLinSysFn` was added as an - alternative method for evaluating the linear system :math:`M = I - \gamma J`. -- Added two new functions, :c:func:`CVodeGetCurrentGamma` and :c:func:`CVodeGetCurrentState`, which may be useful to users who - choose to provide their own nonlinear solver implementations. -- The CVODE Fortran 2003 interface was completely redone to be more - sustainable and to allow users to write more idiomatic Fortran. See - :numref:`SUNDIALS.Fortran` for more details. - -Changes in v4.1.0 ------------------ - -An additional ``N_Vector`` implementation was added for the Tpetra -vector from the Trilinos library to facilitate interoperability -between SUNDIALS and Trilinos. This implementation is accompanied -by additions to user documentation and SUNDIALS examples. - -A bug was fixed where a nonlinear solver object could be freed twice in -some use cases. - -The CMake option ``EXAMPLES_ENABLE_RAJA`` has been removed. The option enables all examples that -use CUDA including the RAJA examples with a CUDA back end (if the RAJA -``N_Vector`` is enabled). - -The implementation header file is no longer installed. This means users -who are directly manipulating the structure will need to update their -code to use CVODE’s public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Changes in v4.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a -contributing agreement. - -Moved definitions of DLS and SPILS backwards compatibility functions to -a source file. The symbols are now included in the CVODE library, ``libsundials_cvode``. - -Changes in v4.0.1 ------------------ - -No changes were made in this release. - -Changes in v4.0.0 ------------------ - -CVODE’s previous direct and iterative linear solver interfaces, -CVDLS and CVSPILS, have been merged into a single unified linear -solver interface, CVLS, to support any valid ``SUNLinearSolver`` module. -This includes the “DIRECT” and “ITERATIVE” types as well as the new -“MATRIX_ITERATIVE” type. Details regarding how CVLS utilizes linear -solvers of each type as well as discussion regarding intended use cases -for user-supplied ``SUNLinearSolver`` implementations are included in -:numref:`SUNLinSol`. All CVODE example programs -and the standalone linear solver examples have been updated to use the -unified linear solver interface. - -The unified interface for the new CVLS module is very similar to the -previous CVDLS and CVSPILS interfaces. To minimize challenges in -user migration to the new names, the previous C and Fortran routine -names may still be used; these will be deprecated in future releases, so -we recommend that users migrate to the new names soon. Additionally, we -note that Fortran users, however, may need to enlarge their array of -optional integer outputs, and update the indices that they query for -certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided ``SUNLinearSolver`` -implementations have been updated to follow the naming convention -``SUNLinSol_*`` where is the name of the linear solver. Solver-specific “set” -routine names have been similarly standardized. To minimize challenges in user -migration to the new names, the previous routine names may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. All CVODE example programs and the standalone linear solver -examples have been updated to use the new naming convention. - -The :ref:`SUNMATRIX_BAND <SUNMatrix.Band>` constructor has been simplified to remove the storage upper -bandwidth argument. - -SUNDIALS integrators have been updated to utilize generic nonlinear -solver modules defined through the ``SUNNonlinearSolver`` API. This API will -ease the addition of new nonlinear solver options and allow for external -or user-supplied nonlinear solvers. The ``SUNNonlinearSolver`` API and -SUNDIALS provided modules are described in -:numref:`SUNNonlinSol` and follow the same -object oriented design and implementation used by the ``N_Vector``, -``SUNMatrix``, and ``SUNLinearSolver`` modules. Currently two ``SUNNonlinearSolver`` -implementations are provided, ``SUNNONLINSOL_NEWTON`` and -``SUNNONLINSOL_FIXEDPOINT``. These replicate the previous integrator -specific implementations of a Newton iteration and a fixed-point -iteration (previously referred to as a functional iteration), -respectively. Note the ``SUNNONLINSOL_FIXEDPOINT`` module can optionally -utilize Anderson’s method to accelerate convergence. Example programs -using each of these nonlinear solver modules in a standalone manner have -been added and all CVODE example programs have been updated to use -generic ``SUNNonlinearSolver`` modules. - -With the introduction of ``SUNNonlinearSolver`` modules, the ``iter`` input -parameter to :c:func:`CVodeCreate` has been removed along with the function -:c:func:`CVodeSetIterType` and the constants ``CV_NEWTON`` and -``CV_FUNCTIONAL``. Similarly, the parameter has been removed from the Fortran -interface function ``FCVMALLOC``. Instead of specifying the nonlinear iteration -type when creating the CVODE memory structure, CVODE uses the -``SUNNONLINSOL_NEWTON`` module implementation of a Newton iteration by default. -For details on using a non-default or user-supplied nonlinear solver see -:numref:CVODE.Usage.CC. CVODE functions for setting the nonlinear solver options -(e.g., :c:func:`CVodeSetMaxNonlinIters`) or getting nonlinear solver statistics -(e.g., :c:func:`CVodeGetNumNonlinSolvIters`) remain unchanged and internally -call generic ``SUNNonlinearSolver`` functions as needed. - -Three fused vector operations and seven vector array operations have been added -to the ``N_Vector`` API. These *optional* operations are disabled by default and -may be activated by calling vector specific routines after creating an -``N_Vector`` (see :numref:`NVectors` for more details). The new operations -are intended to increase data reuse in vector operations, reduce parallel -communication on distributed memory systems, and lower the number of kernel -launches on systems with accelerators. The fused operations are -:c:func:`N_VLinearCombination`, :c:func:`N_VScaleAddMulti`, and -:c:func:`N_VDotProdMulti` and the vector array operations are -:c:func:`N_VLinearCombinationVectorArray`, :c:func:`N_VScaleVectorArray`, -:c:func:`N_VConstVectorArray`, :c:func:`N_VWrmsNormVectorArray`, -:c:func:`N_VWrmsNormMaskVectorArray`, and :c:func:`N_VScaleAddMultiVectorArray`. -If an ``N_Vector`` implementation defines any of these operations as, then -standard ``N_Vector`` operations will automatically be called as necessary to -complete the computation. - -Multiple updates to ``NVECTOR_CUDA`` were made: - -* Changed to return the global vector length instead of the local - vector length. -* Added to return the local vector length. -* Added to return the MPI communicator used. -* Removed the accessor functions in the namespace suncudavec. -* Changed the function to take a host data pointer and a device data - pointer instead of an object. -* Added the ability to set the used for execution of the ``NVECTOR_CUDA`` - kernels. See the function :c:func:`N_VSetCudaStream_Cuda()`. -* Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and - :c:func:`N_VIsManagedMemory_Cuda()` functions to accommodate using managed - memory with ``NVECTOR_CUDA``. - -Multiple changes to ``NVECTOR_RAJA`` were made: - - - Changed to return the global vector length instead of the local vector length. - - Added to return the local vector length. - - Added to return the MPI communicator used. - - Removed the accessor functions in the namespace suncudavec. - - A new ``N_Vector`` implementation for leveraging OpenMP 4.5+ device - offloading has been added, ``NVECTOR_OPENMPDEV``. - - Two changes were made in the CVODE/CVODES/ARKODE initial step size algorithm: - - - Fixed an efficiency bug where an extra call to the right hand side function was made. - - Changed the behavior of the algorithm if the max-iterations case is hit. Before the algorithm would exit with the step size calculated on the penultimate iteration. Now it will exit with the step size calculated on the final iteration. - -A Fortran 2003 interface to CVODE has been added along with Fortran 2003 -interfaces to the following shared SUNDIALS modules: - - - ``SUNNONLINSOL_FIXEDPOINT`` and ``SUNNONLINSOL_NEWTON`` nonlinear solver modules - - ``SUNLINSOL_BAND``, ``SUNLINSOL_DENSE``, ``SUNLINSOL_KLU``, ``SUNLINSOL_PCG``, ``SUNLINSOL_SPBCGS``, ``SUNLINSOL_SPFGMR``, ``SUNLINSOL_SPGMR``, and ``SUNLINSOL_SPTFQMR`` linear solver modules - - ``NVECTOR_SERIAL``, ``NVECTOR_PTHREADS``, and ``NVECTOR_OPENMP`` vector modules - -Changes in v3.2.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a bug in the CUDA ``N_Vector`` where the operation could - write beyond the allocated vector data. - -- Fixed library installation path for multiarch systems. This fix - changes the default library installation path to - ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` from - ``CMAKE_INSTALL_PREFIX/lib``. ``CMAKE_INSTALL_LIBDIR`` is automatically set, - but is available as a CMake option that can modified. - -Changes in v3.2.0 ------------------ - -Support for optional inequality constraints on individual components of the -solution vector has been added to CVODE and CVODES. See -:numref:`CVODE.Mathematics` and the description of in :numref:`CVODE.Usage.CC.optional_input` for -more details. Use of :c:func:`CVodeSetConstraints` requires the ``N_Vector`` -operations :c:func:`N_VMinQuotient`, :c:func:`N_VConstrMask`, and -:c:func:`N_VCompare` that were not previously required by CVODE and CVODES. - -Fixed a problem with setting which would occur with some compilers (e.g. -armclang) that did not define ``__STDC_VERSION__``. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than one MPI -rank when using a GPU system. The vectors assume one GPU device per MPI rank. - -Changed the name of the RAJA ``N_Vector`` library to from to better reflect that -we only support CUDA as a backend for RAJA currently. - -Several changes were made to the build system: - - - CMake 3.1.3 is now the minimum required CMake version. - - Deprecate the behavior of the CMake option and added the CMake option to select the integer size. - - The native CMake FindMPI module is now used to locate an MPI installation. - - If MPI is enabled and MPI compiler wrappers are not set, the build system will - check if can compile MPI programs before trying to locate and use an MPI - installation. - - The previous options for setting MPI compiler wrappers and the executable for - running MPI programs have been have been depreated. The new options that align - with those used in native CMake FindMPI module are ``MPI_C_COMPILER``, - ``MPO_CXX_COMPILER``, ``MPI_Fortran_COMPILER``, and ``MPIEXEC_EXECUTABLE``. - - When a Fortran name-mangling scheme is needed (e.g., is ) the build system will - infer the scheme from the Fortran compiler. If a Fortran compiler is not - available or the inferred or default scheme needs to be overridden, the advanced - options and can be used to manually set the name-mangling scheme and bypass - trying to infer the scheme. - - Parts of the main CMakeLists.txt file were moved to new files in the and - directories to make the CMake configuration file structure more modular. - -Changes in v3.1.2 ------------------ - -The changes in this minor release include the following: - -- Updated the minimum required version of CMake to 2.8.12 and enabled - using rpath by default to locate shared libraries on OSX. -- Fixed Windows specific problem where was not correctly defined when - using 64-bit integers for the SUNDIALS index type. On Windows ``sunindextype`` is - now defined as the MSVC basic type ``__int64``. -- Added sparse SUNMatrix “Reallocate” routine to allow specification of - the nonzero storage. -- Updated the KLU SUNLinearSolver module to set constants for the two - reinitialization types, and fixed a bug in the full reinitialization - approach where the sparse SUNMatrix pointer would go out of scope on - some architectures. -- Updated the “ScaleAdd” and “ScaleAddI” implementations in the sparse - SUNMatrix module to more optimally handle the case where the target - matrix contained sufficient storage for the sum, but had the wrong - sparsity pattern. The sum now occurs in-place, by performing the sum - backwards in the existing storage. However, it is still more - efficient if the user-supplied Jacobian routine allocates storage for - the sum :math:`I+\gamma J` manually (with zero entries if needed). -- Added the following examples from the usage notes page of the - SUNDIALS website, and updated them to work with SUNDIALS 3.x: - - - ``cvDisc_dns.c``, which demonstrates using CVODE with discontinuous solutions or RHS. - - ``cvRoberts_dns_negsol.c``, which illustrates the use of the RHS function return value to - control unphysical negative concentrations. - -- Changed the LICENSE install path to `instdir/icnlude/sundials`. - -Changes in v3.1.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a minor bug in the cvSLdet routine, where a return was missing - in the error check for three inconsistent roots. -- Fixed a potential memory leak in the SPGMR and SPFGMR linear - solvers: if “Initialize” was called multiple times then the solver - memory was reallocated (without being freed). -- Updated KLU ``SUNLinearSolver`` module to use a for the precision-specific - solve function to be used (to avoid compiler warnings). -- Added missing typecasts for some pointers (again, to avoid compiler - warnings). -- Bugfix in ``sunmatric_sparse.c`` where we had used instead of in one location. -- Added missing ``#include <stio.h>`` in ``N_Vector`` and ``SUNMatrix`` header files. -- Fixed an indexing bug in the CUDA ``N_Vector`` implementation of - and revised the RAJA ``N_Vector`` implementation of :c:func:`N_VWrmsNormMask` to work with - mask arrays using values other than zero or one. Replaced ``double`` with ``realtype`` in the - RAJA vector test functions. -- Fixed compilation issue with GCC 7.3.0 and Fortran programs that do - not require a ``SUNMatrix`` or ``SUNLinearSolver`` module (e.g., iterative - linear solvers or fixed-point iteration). - -In addition to the changes above, minor corrections were also made to -the example programs, build system, and user documentation. - -Changes in v3.1.0 ------------------ - -Added ``N_Vector`` print functions that write vector data to a specified -file (e.g., :c:func:`N_VPrintFile_Serial`). - -Added ``make test`` and ``make test_install`` options to the build system for testing SUNDIALS after -building with and installing with respectively. - -Changes in v3.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been reworked, and -all example programs have been updated. The goal of the redesign of these -interfaces was to provide more encapsulation and ease in interfacing custom -linear solvers and interoperability with linear solver libraries. Specific -changes include: - -- Added generic SUNMATRIX module with three provided implementations: - dense, banded and sparse. These replicate previous SUNDIALS Dls and Sls - matrix structures in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNMATRIX - modules. - -- Added generic SUNLINEARSOLVER module with eleven provided - implementations: dense, banded, LAPACK dense, LAPACK band, KLU, SuperLU_MT, - SPGMR, SPBCGS, SPTFQMR, SPFGMR, PCG. These replicate previous SUNDIALS - generic linear solvers in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNLINEARSOLVER - modules. - -- Expanded package-provided direct linear solver (Dls) interfaces and - scaled, preconditioned, iterative linear solver (Spils) interfaces to utilize - generic SUNMATRIX and SUNLINEARSOLVER objects. - -- Removed package-specific, linear solver-specific, solver modules - (e.g. CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since their functionality is - entirely replicated by the generic Dls/Spils interfaces and - SUNLINEARSOLVER/SUNMATRIX modules. The exception is CVDIAG, a diagonal - approximate Jacobian solver available to CVODE and CVODES. - -- Converted all SUNDIALS example problems to utilize new generic - SUNMATRIX and SUNLINEARSOLVER objects, along with updated Dls and Spils - linear solver interfaces. - -- Added Spils interface routines to ARKode, CVODE, CVODES, IDA and IDAS - to allow specification of a user-provided "JTSetup" routine. This change - supports users who wish to set up data structures for the user-provided - Jacobian-times-vector ("JTimes") routine, and where the cost of one JTSetup - setup per Newton iteration can be amortized between multiple JTimes calls. - -Two additional ``N_Vector`` implementations were added – one for CUDA and one -for RAJA vectors. These vectors are supplied to provide very basic support for -running on GPU architectures. Users are advised that these vectors both move all -data to the GPU device upon construction, and speedup will only be realized if -the user also conducts the right-hand-side function evaluation on the device. In -addition, these vectors assume the problem fits on one GPU. Further information -about RAJA, users are referred to th web site, https://software.llnl.gov/RAJA/. -These additions are accompanied by additions to various interface functions and -to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` that can -be configured to be a 32- or 64-bit integer data index type. ``sunindextype`` is -defined to be ``int32_t`` or ``int64_t`` when portable types are supported, -otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces -continue to use for indices, except for their sparse matrix interface that now -uses the new . This new flexible capability for index types includes interfaces -to PETSc, hypre, SuperLU_MT, and KLU with either 32-bit or 64-bit capabilities -depending how the user configures SUNDIALS. - -To avoid potential namespace conflicts, the macros defining ``booleantype`` -values ``TRUE`` and ``FALSE`` have been changed to ``SUNTRUE`` and ``SUNFALSE`` -respectively. - -Temporary vectors were removed from preconditioner setup and solve routines for -all packages. It is assumed that all necessary data for user-provided -preconditioner operations will be allocated and stored in user-provided data -structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS -type information for use in Fortran programs. - -Added functions :c:func:`SUNDIALSGetVersion` and -:c:func:`SUNDIALSGetVersionNumber` to get SUNDIALS release version information -at runtime. - -The build system was expanded to support many of the xSDK-compliant keys. The -xSDK is a movement in scientific software to provide a foundation for the rapid -and efficient production of high-quality, sustainable extreme-scale scientific -applications. More information can be found at, https://xsdk.info. - -In addition, numerous changes were made to the build system. These include the -addition of separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` CMake variables, -additional error checking during CMake configuration, minor bug fixes, and -renaming CMake options to enable/disable examples for greater clarity and an -added option to enable/disable Fortran 77 examples. These changes included -changing ``EXAMPLES_ENABLE`` to ``EXAMPLES_ENABLE_C``, changing ``CXX_ENABLE`` -to ``EXAMPLES_ENABLE_CXX``, changing ``F90_ENABLE`` to ``EXAMPLES_ENABLE_F90``, -and adding an ``EXAMPLES_ENABLE_F77`` option. - -A bug fix was made in :c:func:`CVodeFree` to call ``lfree`` unconditionally (if -non-NULL). - -Corrections and additions were made to the examples, to installation-related -files, and to the user documentation. - -Changes in v2.9.0 ------------------ - -Two additional ``N_Vector`` implementations were added – one for Hypre -(parallel) ParVector vectors, and one for PETSc vectors. These -additions are accompanied by additions to various interface functions -and to user documentation. - -Each ``N_Vector`` module now includes a function, :c:func:`N_VGetVectorID`, that returns the -``N_Vector`` module name. - -For each linear solver, the various solver performance counters are now -initialized to 0 in both the solver specification function and in solver -``linit`` function. This ensures that these solver counters are initialized upon -linear solver instantiation as well as at the beginning of the problem -solution. - -In FCVODE, corrections were made to three Fortran interface -functions. Missing Fortran interface routines were added so that users -can supply the sparse Jacobian routine when using sparse direct solvers. - -A memory leak was fixed in the banded preconditioner interface. In -addition, updates were done to return integers from linear solver and -preconditioner ’free’ functions. - -The Krylov linear solver Bi-CGstab was enhanced by removing a redundant -dot product. Various additions and corrections were made to the -interfaces to the sparse solvers KLU and SuperLU_MT, including support -for CSR format when using KLU. - -New examples were added for use of the OpenMP vector and for use of -sparse direct solvers from Fortran. - -Minor corrections and additions were made to the CVODE solver, to -the Fortran interfaces, to the examples, to installation-related files, -and to the user documentation. - -Changes in v2.8.0 ------------------ - -Two major additions were made to the linear system solvers that are available -for use with the CVODE solver. First, in the serial case, an interface to the -sparse direct solver KLU was added. Second, an interface to SuperLU_MT, the -multi-threaded version of SuperLU, was added as a thread-parallel sparse direct -solver option, to be used with the serial version of the ``N_Vector`` module. As -part of these additions, a sparse matrix (CSC format) structure was added to -CVODE. - -Otherwise, only relatively minor modifications were made to the CVODE solver: - -In ``cvRootFind``, a minor bug was corrected, where the input array was ignored, -and a line was added to break out of root-search loop if the initial interval -size is below the tolerance ``ttol``. - -In ``CVLapackBand``, the line ``smu = MIN(N-1,mu+ml)`` was changed to to correct -an illegal input error for ``DGBTRF/DGBTRS``. - -In order to eliminate or minimize the differences between the sources for -private functions in CVODE and CVODES, the names of 48 private functions were -changed from to , and a few other names were also changed. - -Two minor bugs were fixed regarding the testing of input on the first call to – -one involving and one involving the initialization of ``*tret``. - -In order to avoid possible name conflicts, the mathematical macro and function -names ``MIN``, ``MAX``, ``SQR``, ``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and -were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, ``SUNRabs``, ``SUNRsqrt``, -``SUNRexp``, ``SUNRpowerI``, and ``SUNRPowerR`` respectively. These names occur -in both the solver and in various example programs. - -The example program ``cvAdvDiff_diag_p`` was added to illustrate the use of in -parallel. - -In the FCVODE optional input routines ``FCVSETIIN`` and ``FCVSETRIN``, the -optional fourth argument ``key_length`` was removed, with hardcoded key string -lengths passed to all tests. - -In all FCVODE examples, integer declarations were revised so that those which -must match a C type ``long int`` are declared ``INTEGER*8``, and a comment was -added about the type match. All other integer declarations are just ``INTEGER``. -Corresponding minor corrections were made to the user guide. - -Two new ``N_Vector`` modules have been added for thread-parallel computing -environments — one for OpenMP, denoted ``NVECTOR_OPENMP``, and one for Pthreads, -denoted ``NVECTOR_PTHREADS``. - -With this version of SUNDIALS, support and documentation of the Autotools mode -of installation is being dropped, in favor of the CMake mode, which is -considered more widely portable. - -Changes in v2.7.0 ------------------ - -One significant design change was made with this release: The problem size and -its relatives, bandwidth parameters, related internal indices, pivot arrays, and -the optional output ``lsflag`` have all been changed from type ``int`` to type -``long int``, except for the problem size and bandwidths in user calls to -routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The -function ``NewIntArray`` is replaced by a pair ``NewIntArray`` / -``NewLintArray``, for ``int`` and ``long int`` arrays, respectively. - -A large number of minor errors have been fixed. Among these are the following: -In , the logic was changed to avoid a divide by zero. After the solver memory is -created, it is set to zero before being filled. In ``CVSetTqBDF`` each linear -solver interface function, the linear solver memory is freed on an error return, -and the function now includes a line setting to NULL the main memory pointer to -the linear solver memory. In the rootfinding functions ``CVRcheck1``/ -``CVRcheck2``, when an exact zero is found, the array ``glo`` of :math:`g` -values at the left endpoint is adjusted, instead of shifting the :math:`t` -location slightly. In the installation files, we modified the treatment of the -macro SUNDIALS_USE_GENERIC_MATH, so that the parameter GENERIC_MATH_LIB is -either defined (with no value) or not defined. - -Changes in v2.6.0 ------------------ - -Two new features were added in this release: (a) a new linear solver -module, based on BLAS and LAPACK for both dense and banded matrices, and -(b) an option to specify which direction of zero-crossing is to be -monitored while performing rootfinding. - -The user interface has been further refined. Some of the API changes -involve: (a) a reorganization of all linear solver modules into two -families (besides the existing family of scaled preconditioned iterative -linear solvers, the direct solvers, including the new LAPACK-based ones, -were also organized into a *direct* family); (b) maintaining a single -pointer to user data, optionally specified through a -type function; and -(c) a general streamlining of the preconditioner modules distributed -with the solver. - -Changes in v2.5.0 ------------------ - -The main changes in this release involve a rearrangement of the entire -:ref:`SUNDIALS source tree <CVODE.Organization>`. At the user interface -level, the main impact is in the mechanism of including SUNDIALS header files -which must now include the relative path (e.g. ``#include <cvode/cvode.h>``). Additional changes were made to -the build system: all exported header files are now installed in separate -subdirectories of the instaltion *include* directory. - -The functions in the generic dense linear solver (``sundials_dense`` and -``sundials_smalldense``) were modified to work for rectangular :math:`m \times -n` matrices (:math:`m \le n`), while the factorization and solution functions -were renamed to ``DenseGETRF`` / ``denGETRF`` and ``DenseGETRS`` / ``denGETRS``, -respectively. The factorization and solution functions in the generic band -linear solver were renamed ``BandGBTRF`` and ``BandGBTRS``, respectively. - -Changes in v2.4.0 ------------------ - -CVSPBCG and CVSPTFQMR modules have been added to interface with -the Scaled Preconditioned Bi-CGstab (SPBCG) and Scaled Preconditioned -Transpose-Free Quasi-Minimal Residual (SPTFQMR) linear solver modules, -respectively (for details see :numref:`CVODE.Usage.CC`). Corresponding additions were made -to the Fortran interface module FCVODE. At the same time, function type -names for Scaled Preconditioned Iterative Linear Solvers were added for -the user-supplied Jacobian-times-vector and preconditioner setup and -solve functions. - -The deallocation functions now take as arguments the address of the -respective memory block pointer. - -To reduce the possibility of conflicts, the names of all header files -have been changed by adding unique prefixes (``cvode_`` and ``sundials_``). When using the -default installation procedure, the header files are exported under -various subdirectories of the target directory. For more details see -:numref:`Installation`. - -Changes in v2.3.0 ------------------ - -The user interface has been further refined. Several functions used for -setting optional inputs were combined into a single one. An optional -user-supplied routine for setting the error weight vector was added. -Additionally, to resolve potential variable scope issues, all SUNDIALS -solvers release user data right after its use. The build systems has -been further improved to make it more robust. - -Changes in v2.2.1 ------------------ - -The changes in this minor SUNDIALS release affect only the build -system. - -Changes in v2.2.0 ------------------ - -The major changes from the previous version involve a redesign of the -user interface across the entire SUNDIALS suite. We have eliminated -the mechanism of providing optional inputs and extracting optional -statistics from the solver through the and arrays. Instead, CVODE -now provides a set of routines (with prefix ``CVodeSet``) to change the default -values for various quantities controlling the solver and a set of -extraction routines (with prefix ``CVodeGet``) to extract statistics after return -from the main solver routine. Similarly, each linear solver module -provides its own set of - and -type routines. For more details see -:numref:`CVODE.Usage.CC.optional_input` and :numref:`CVODE.Usage.CC.optional_output`. - -Additionally, the interfaces to several user-supplied routines (such as -those providing Jacobians and preconditioner information) were -simplified by reducing the number of arguments. The same information -that was previously accessible through such arguments can now be -obtained through -type functions. - -The rootfinding feature was added, whereby the roots of a set of given -functions may be computed during the integration of the ODE system. - -Installation of CVODE (and all of SUNDIALS) has been completely -redesigned and is now based on configure scripts. +For changes in prior versions of SUNDIALS see :numref:`Changelog`. .. _CVODE.Introduction.reading: diff --git a/doc/cvode/guide/source/RecentChanges_link.rst b/doc/cvode/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/cvode/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/cvode/guide/source/conf.py b/doc/cvode/guide/source/conf.py index 7d76751a19..403ce410fd 100644 --- a/doc/cvode/guide/source/conf.py +++ b/doc/cvode/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/cvode/guide/source/index.rst b/doc/cvode/guide/source/index.rst index 38580bce12..f853e52579 100644 --- a/doc/cvode/guide/source/index.rst +++ b/doc/cvode/guide/source/index.rst @@ -37,6 +37,7 @@ CVODE Documentation sundials/Install_link.rst Constants History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/cvodes/guide/source/Changelog_link.rst b/doc/cvodes/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/cvodes/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index ee0cc10a21..a8ce879e7d 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -63,7 +63,7 @@ failures with GMRES. Bi-CGStab and TFQMR have an advantage in storage requirements, in that the number of workspace vectors they require is fixed, while that number for GMRES depends on the desired Krylov subspace size. FGMRES has an advantage in that it is designed to support preconditioners that vary -between iterations (e.g. iterative methods). PCG exhibits rapid convergence and +between iterations (e.g., iterative methods). PCG exhibits rapid convergence and minimal workspace vectors, but only works for symmetric linear systems. In the process of translating the VODE and VODPK algorithms into C, the overall @@ -108,1930 +108,15 @@ availability of C compilers, the potentially greater efficiency of C, and the greater ease of interfacing the solver to applications written in extended Fortran. -Changes from previous versions -============================== -Changes in vX.X.X ------------------- +Changes to SUNDIALS in release X.Y.Z +==================================== -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). +.. include:: ../../../shared/RecentChanges.rst -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. +For changes in prior versions of SUNDIALS see :numref:`Changelog`. -Changes in v7.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the functions -``CVodeSetErrFile`` and ``CVodeSetHandlerErrFn`` have been removed. Users of -these functions can use the functions :c:func:`SUNContext_PushErrHandler`, and -:c:func:`SUNLogger_SetErrorFilename` instead. For further details see Sections -:numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -*Fortran Interface Modules Streamlined* - -We have streamlined the Fortran modules that need to be included by users by combining -the SUNDIALS core into one Fortran module, ``fsundials_core_mod``. Modules for -implementations of the core APIs still exist (e.g., for the Dense linear solver there -is ``fsunlinsol_dense_mod``) as do the modules for the SUNDIALS packages (e.g., ``fcvode_mod``). -The following modules are the ones that have been consolidated into ``fsundials_core_mod``: - -.. code-block:: - - fsundials_adaptcontroller_mod - fsundials_context_mod - fsundials_futils_mod - fsundials_linearsolver_mod - fsundials_logger_mod - fsundials_matrix_mod - fsundials_nonlinearsolver_mod - fsundials_nvector_mod - fsundials_profiler_mod - fsundials_types_mod - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be -deprecated -- users who rely on these are recommended to transition to the -corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v6.7.0 ------------------ - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` -to ``O(NNZ)``. - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Fixed a regression introduced by the stop time bug fix in v6.6.1 where CVODE -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 output time was passed. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Renamed some internal types in CVODES and IDAS to allow both packages to be -built together in the same binary. - -Changes in v6.6.2 ------------------ - -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. - -Changes in v6.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Fixed a bug where the stop time may not be cleared when using normal mode if the -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. - -Changes in v6.6.0 ------------------ - -Updated the default CVODES behavior when returning the solution when -the internal time has reached a user-specified stop time. Previously, the output -solution was interpolated to the value of ``tstop``; the default is now to copy the -internal solution vector. Users who wish to revert to interpolation may call the -routine :c:func:`CVodeSetInterpolateStopTime`. - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v6.5.1 ------------------ - -Added the function :c:func:`CVodeClearStopTime` to disable a previously set stop -time. - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -Changes in v6.5.0 ------------------ - -Added the functions :c:func:`CVodeGetJac`, :c:func:`CVodeGetJacTime`, -:c:func:`CVodeGetJacNumSteps` to assist in debugging simulations utilizing -a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an underflow bug during root finding. - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added support for CUDA v12. - -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Changes in v6.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v6.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector. - -Fixed a memory leak where the projection memory would not be deallocated when -calling :c:func:`CVodeFree`. - -Changes in v6.3.0 ------------------ - -Added the function :c:func:`CVodeGetUserData` to retrieve the user data pointer -provided to :c:func:`CVodeSetUserData`. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v6.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the function :c:func:`CVodePrintAllStats` to output all of the integrator, -nonlinear solver, linear solver, and other statistics in one call. The file -``scripts/sundials_csv.py`` contains functions for parsing the comma-separated -value output files. - -Added support for integrating IVPs with constraints using BDF methods -and projecting the solution onto the constraint manifold with a user -defined projection function. This implementation is accompanied by -additions to user documentation and CVODES examples. See -:c:func:`CVodeSetProjFn` for more information. - -Added the functions -:c:func:`CVodeSetEtaFixedStepBounds`, -:c:func:`CVodeSetEtaMaxFirstStep`, -:c:func:`CVodeSetEtaMaxEarlyStep`, -:c:func:`CVodeSetNumStepsEtaMaxEarlyStep`, -:c:func:`CVodeSetEtaMax`, -:c:func:`CVodeSetEtaMin`, -:c:func:`CVodeSetEtaMinErrFail`, -:c:func:`CVodeSetEtaMaxErrFail`, -:c:func:`CVodeSetNumFailsEtaMaxErrFail`, and -:c:func:`CVodeSetEtaConvFail` to adjust various parameters controlling changes -in step size. - -Added the functions :c:func:`CVodeSetDeltaGammaMaxLSetup` and -:c:func:`CVodeSetDeltaGammaMaxBadJac` to adjust the :math:`\gamma` change -thresholds to require a linear solver setup or Jacobian/precondition update, -respectively. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the functions -:c:func:`CVodeGetNumNonlinSolvConvFails`, -:c:func:`CVodeGetNonlinSolvStats`, -:c:func:`CVodeGetSensNumNonlinSolvConvFails`, -:c:func:`CVodeGetSensNonlinSolvStats`, -:c:func:`CVodeGetStgrSensNumNonlinSolvConvFails`, and -:c:func:`CVodeGetStgrSensNonlinSolvStats` -where the number of nonlinear solver failures returned was the number of failed -*steps* due to a nonlinear solver failure i.e., if a nonlinear solve failed -with a stale Jacobian or preconditioner but succeeded after updating the -Jacobian or preconditioner, the initial failure was not included in the -nonlinear solver failure count. These functions have been updated to return the -total number of nonlinear solver failures. As such users may see an increase in -the number of failures reported. - -The functions -:c:func:`CVodeGetNumStepSolveFails`, -:c:func:`CVodeGetNumStepSensSolveFails`, and -:c:func:`CVodeGetNumStepStgrSensSolveFails` -have been added to retrieve the number of failed steps due to a nonlinear solver -failure. The counts returned from these functions will match those previously -returned by -:c:func:`CVodeGetNumNonlinSolvConvFails`, -:c:func:`CVodeGetNonlinSolvStats`, -:c:func:`CVodeGetSensNumNonlinSolvConvFails`, -:c:func:`CVodeGetSensNonlinSolvStats`, -:c:func:`CVodeGetStgrSensNumNonlinSolvConvFails`, and -:c:func:`CVodeGetStgrSensNonlinSolvStats`. - - -Changes in v6.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Changes in v6.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v6.0.0 ------------------ - - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**CVODES** - -Added a new function :c:func:`CVodeGetLinSolveStats` to get the CVODES linear -solver statistics as a group. - -Added a new function, :c:func:`CVodeSetMonitorFn`, that takes a user-function -to be called by CVODES after every `nst` successfully completed time-steps. -This is intended to provide a way of monitoring the CVODES statistics -throughout the simulation. - -The previously deprecated function ``CVodeSetMaxStepsBetweenJac`` has been -removed and replaced with :c:func:`CVodeSetJacEvalFrequency`. - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``CVSpilsSetLinearSolver`` | ``CVodeSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetEpsLin`` | ``CVodeSetEpsLin`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetPreconditioner`` | ``CVodeSetPreconditioner`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetJacTimes`` | ``CVodeSetJacTimes`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetWorkSpace`` | ``CVodeGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumPrecEvals`` | ``CVodeGetNumPrecEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumPrecSolves`` | ``CVodeGetNumPrecSolves`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumLinIters`` | ``CVodeGetNumLinIters`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumConvFails`` | ``CVodeGetNumConvFails`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumJTSetupEvals`` | ``CVodeGetNumJTSetupEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumJtimesEvals`` | ``CVodeGetNumJtimesEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetNumRhsEvals`` | ``CVodeGetNumLinRhsEvals`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetLastFlag`` | ``CVodeGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsGetReturnFlagName`` | ``CVodeGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetLinearSolverB`` | ``CVodeSetLinearSolverB`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetEpsLinB`` | ``CVodeSetEpsLinB`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetPreconditionerB`` | ``CVodeSetPreconditionerB`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetPreconditionerBS`` | ``CVodeSetPreconditionerBS`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetJacTimesB`` | ``CVodeSetJacTimesB`` | -+---------------------------------+--------------------------------+ -| ``CVSpilsSetJacTimesBS`` | ``CVodeSetJacTimesBS`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetLinearSolver`` | ``CVodeSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetJacFn`` | ``CVodeSetJacFn`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetWorkSpace`` | ``CVodeGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetNumJacEvals`` | ``CVodeGetNumJacEvals`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetNumRhsEvals`` | ``CVodeGetNumLinRhsEvals`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetLastFlag`` | ``CVodeGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``CVDlsGetReturnFlagName`` | ``CVodeGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetLinearSolverB`` | ``CVodeSetLinearSolverB`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetJacFnB`` | ``CVodeSetJacFnB`` | -+---------------------------------+--------------------------------+ -| ``CVDlsSetJacFnBS`` | ``CVodeSetJacFnBS`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v5.8.0 ------------------ - -The RAJA ``N_Vector`` implementation has been updated to support the SYCL -backend in addition to the CUDA and HIP backend. Users can choose the backend -when configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake -variable. This module remains experimental and is subject to change from version -to version. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to -interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix -and the linear solver support general dense linear systems as well as block -diagonal linear systems. See Chapter :numref:`SUNLinSol.OneMklDense` for more -details. This module is experimental and is subject to change from version to -version. - -Added a new *optional* function to the SUNLinearSolver API, -``SUNLinSolSetZeroGuess``, to indicate that the next call to ``SUNLinSolSolve`` -will be made with a zero initial guess. SUNLinearSolver implementations that do -not use the ``SUNLinSolNewEmpty`` constructor will, at a minimum, need set the -``setzeroguess`` function pointer in the linear solver ``ops`` structure to -``NULL``. The SUNDIALS iterative linear solver implementations have been updated -to leverage this new set function to remove one dot product per solve. - -CVODES now supports a new “matrix-embedded” ``SUNLinearSolver`` type. This type -supports user-supplied ``SUNLinearSolver`` implementations that set up and solve -the specified linear system at each linear solve call. Any matrix-related data -structures are held internally to the linear solver itself, and are not provided -by the SUNDIALS package. - -Added the function ``CVodeSetNlsRhsFn`` to supply an alternative right-hand side -function for use within nonlinear system function evaluations. - -The installed SUNDIALSConfig.cmake file now supports the ``COMPONENTS`` option -to ``find_package``. The exported targets no longer have ``IMPORTED_GLOBAL`` -set. - -A bug was fixed in ``SUNMatCopyOps`` where the matrix-vector product setup -function pointer was not copied. - -A bug was fixed in the SPBCGS and SPTFQMR solvers for the case where a non-zero -initial guess and a solution scaling vector are provided. This fix only impacts -codes using SPBCGS or SPTFQMR as standalone solvers as all SUNDIALS packages -utilize a zero initial guess. - -Changes in v5.7.0 ------------------ - -A new ``N_Vector`` implementation based on the SYCL abstraction layer has been added targeting Intel GPUs. At -present the only SYCL compiler supported is the DPC++ (Intel oneAPI) compiler. See Section -:numref:`NVectors.sycl` for more details. This module is considered experimental and is subject to major -changes even in minor releases. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to interface with the MAGMA linear algebra library. -Both the matrix and the linear solver support general dense linear systems as well as block diagonal linear systems, and -both are targeted at GPUs (AMD or NVIDIA). See Section :numref:`SUNLinSol.magmadense` for more -details. - -Changes in v5.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error if the CMAKE_CXX_STANDARD and SUNDIALS_RAJA_BACKENDS -options were not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v5.6.0 ------------------ - -A new ``N_Vector`` implementation based on the AMD ROCm HIP platform has been added. This vector can target NVIDIA or -AMD GPUs. See :numref:`NVectors.hip` for more details. This module is considered experimental and is subject -to change from version to version. - -The RAJA ``N_Vector`` implementation has been updated to support the HIP backend in addition to the CUDA backend. Users -can choose the backend when configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. This module -remains experimental and is subject to change from version to version. - -A new optional operation, ``N_VGetDeviceArrayPointer``, was added to the N_Vector API. This operation is useful for -N_Vectors that utilize dual memory spaces, e.g. the native SUNDIALS CUDA N_Vector. - -The SUNMATRIX_CUSPARSE and SUNLINEARSOLVER_CUSOLVERSP_BATCHQR implementations no longer require the SUNDIALS CUDA -N_Vector. Instead, they require that the vector utilized provides the ``N_VGetDeviceArrayPointer`` operation, and that -the pointer returned by ``N_VGetDeviceArrayPointer`` is a valid CUDA device pointer. - -Changes in v5.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. Users will likely see deprecation -warnings, but otherwise the changes should be fully backwards compatible for almost all users. SUNDIALS now -exports CMake targets and installs a SUNDIALSConfig.cmake file. - -Added support for SuperLU DIST 6.3.0 or newer. - -Changes in v5.4.0 ------------------ - -Added the function ``CVodeSetLSNormFactor`` to specify the factor for converting between integrator tolerances (WRMS -norm) and linear solver tolerances (L2 norm) i.e., ``tol_L2 = nrmfac * tol_WRMS``. - -Added new functions ``CVodeComputeState``, and ``CVodeGetNonlinearSystemData`` which advanced users might find useful if -providing a custom ``SUNNonlinSolSysFn``. - -**This change may cause an error in existing user code**. The ``CVodeF`` function for forward integration with -checkpointing is now subject to a restriction on the number of time steps allowed to reach the output time. This is the -same restriction applied to the ``CVode`` function. The default maximum number of steps is 500, but this may be changed -using the ``CVodeSetMaxNumSteps`` function. This change fixes a bug that could cause an infinite loop in the ``CVodeF`` -function. - -The expected behavior of ``SUNNonlinSolGetNumIters`` and ``SUNNonlinSolGetNumConvFails`` in the ``SUNNonlinearSolver`` API -have been updated to specify that they should return the number of nonlinear solver iterations and convergence failures -in the most recent solve respectively rather than the cumulative number of iterations and failures across all solves -respectively. The API documentation and SUNDIALS provided ``SUNNonlinearSolver`` implementations have been updated -accordingly. As before, the cumulative number of nonlinear iterations may be retreived by calling -``CVodeGetNumNonlinSolvIters``, ``CVodeGetSensNumNonlinSolvIters``, ``CVodeGetStgrSensNumNonlinSolvIters``, the -cumulative number of failures with ``CVodeGetNumNonlinSolvConvFails``, ``CVodeGetSensNumNonlinSolvConvFails``, -``CVodeGetStgrSensNumNonlinSolvConvFails``, or both with ``CVodeGetNonlinSolvStats``, ``CVodeGetSensNonlinSolvStats``, -``CVodeGetStgrSensNonlinSolvStats``. - -A minor inconsistency in checking the Jacobian evaluation frequency has been fixed. As a result codes using using a -non-default Jacobian update frequency through a call to ``CVodeSetMaxStepsBetweenJac`` will need to increase the -provided value by 1 to achieve the same behavior as before. For greater clarity the function -``CVodeSetMaxStepsBetweenJac`` has been deprecated and replaced with ``CVodeSetJacEvalFrequency``. Additionally, the -function ``CVodeSetLSetupFrequency`` has been added to set the frequency of calls to the linear solver setup function. - -A new API, ``SUNMemoryHelper``, was added to support **GPU users** who have complex memory management needs such as -using memory pools. This is paired with new constructors for the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` modules that accept a -``SUNMemoryHelper`` object. Refer to :numref:`SUNDIALS.GPU.Model`, :numref:`SUNMemory`, -:numref:`NVectors.cuda` and :numref:`NVectors.raja` for more information. - -The ``NVECTOR_RAJA`` module has been updated to mirror the ``NVECTOR_CUDA`` module. Notably, the update adds managed -memory support to the ``NVECTOR_RAJA`` module. Users of the module will need to update any calls to the ``N_VMake_Raja`` -function because that signature was changed. This module remains experimental and is subject to change from version to -version. - -The ``NVECTOR_TRILINOS`` module has been updated to work with Trilinos 12.18+. This update changes the local ordinal -type to always be an ``int``. - -Added support for CUDA v11. - -Changes in v5.3.0 ------------------ - -Fixed a bug in the iterative linear solver modules where an error is not returned if the Atimes function is ``NULL`` or, -if preconditioning is enabled, the PSolve function is ``NULL``. - -Added the ability to control the CUDA kernel launch parameters for the ``NVECTOR_CUDA`` and ``SUNMATRIX_CUSPARSE`` -modules. These modules remain experimental and are subject to change from version to version. In addition, the -``NVECTOR_CUDA`` kernels were rewritten to be more flexible. Most users should see equivalent performance or some -improvement, but a select few may observe minor performance degradation with the default settings. Users are encouraged -to contact the SUNDIALS team about any perfomance changes that they notice. - -Added new capabilities for monitoring the solve phase in the ``SUNNONLINSOL_NEWTON`` and ``SUNNONLINSOL_FIXEDPOINT`` -modules, and the SUNDIALS iterative linear solver modules. SUNDIALS must be built with the CMake option -``SUNDIALS_BUILD_WITH_MONITORING`` to use these capabilties. - -Added the optional functions ``CVodeSetJacTimesRhsFn`` and ``CVodeSetJacTimesRhsFnB`` to specify an alternative -right-hand side function for computing Jacobian-vector products with the internal difference quotient approximation. - -Changes in v5.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the IBM XL compiler. When building the -Fortran 2003 interfaces with an XL compiler it is recommended to set ``CMAKE_Fortran_COMPILER`` to ``f2003``, -``xlf2003``, or ``xlf2003_r``. - -Fixed a linkage bug affecting Windows users that stemmed from dllimport/dllexport attributes missing on some -SUNDIALS API functions. - -Fixed a memory leak from not deallocating the ``atolSmin0`` and ``atolQSmin0`` arrays. - -Added a new ``SUNMatrix`` implementation, ``SUNMATRIX_CUSPARSE``, that interfaces to the sparse matrix implementation -from the NVIDIA cuSPARSE library. In addition, the ``SUNLINSOL_CUSOLVER_BATCHQR`` linear solver has been updated to use -this matrix, therefore, users of this module will need to update their code. These modules are still considered to be -experimental, thus they are subject to breaking changes even in minor releases. - -The functions ``CVodeSetLinearSolutionScaling`` and ``CVodeSetLinearSolutionScalingB`` were added to enable or disable -the scaling applied to linear system solutions with matrix-based linear solvers to account for a lagged value of -:math:`\gamma` in the linear system matrix :math:`I - \gamma J`. Scaling is enabled by default when using a matrix-based -linear solver with BDF methods. - - -Changes in v5.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake -variables ``PETSC_INCLUDES`` and ``PETSC_LIBRARIES`` instead of ``PETSC_DIR``. - -Added a new build system option, ``CUDA_ARCH``, that can be used to specify the CUDA -architecture to compile for. - -Added two utility functions, :c:func:`SUNDIALSFileOpen` and -:c:func:`SUNDIALSFileClose` for creating/destroying file pointers that are -useful when using the Fortran 2003 interfaces. - -Added support for constant damping to the :ref:`SUNNonlinearSolver_FixedPoint -<SUNNonlinSol.FixedPoint>` module when using Anderson acceleration. - -Changes in v5.0.0 ------------------ - -**Build system changes** - -- Increased the minimum required CMake version to 3.5 for most - SUNDIALS configurations, and 3.10 when CUDA or OpenMP with device - offloading are enabled. - -- The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been removed to simplify - builds as SUNDIALS packages do not use BLAS directly. For third - party libraries that require linking to BLAS, the path to the BLAS - library should be included in the variable for the third party - library *e.g.*, ``SUPERLUDIST_LIBRARIES`` when enabling SuperLU_DIST. - -- Fixed a bug in the build system that prevented the ``NVECTOR_PTHREADS`` - module from being built. - -**NVECTOR module changes** - -- Two new functions were added to aid in creating custom ``N_Vector`` - objects. The constructor :c:func:`N_VNewEmpty` allocates an “empty” generic ``N_Vector`` - with the object’s content pointer and the function pointers in the - operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any - new optional operations to the ``N_Vector`` API by ensuring only - required operations need to be set. Additionally, the function :c:func:`N_VCopyOps` has - been added to copy the operation function pointers between vector - objects. When used in clone routines for custom vector objects these - functions also will ease the introduction of any new optional - operations to the ``N_Vector`` API by ensuring all operations are - copied when cloning objects. See :numref:`NVectors.Description.custom_implementation` for more details. - -- Two new ``N_Vector`` implementations, ``NVECTOR_MANYVECTOR`` and - ``NVECTOR_MPIMANYVECTOR``, have been created to support flexible - partitioning of solution data among different processing elements - (e.g., CPU + GPU) or for multi-physics problems that couple distinct - MPI-based simulations together. This implementation is accompanied by - additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.manyvector` and :numref:`NVectors.mpimanyvector` for more - details. - -- One new required vector operation and ten new optional vector - operations have been added to the ``N_Vector`` API. The new required - operation, , returns the global length of an . The optional operations have - been added to support the new ``NVECTOR_MPIMANYVECTOR`` implementation. The - operation must be implemented by subvectors that are combined to create an - ``NVECTOR_MPIMANYVECTOR``, but is not used outside of this context. The - remaining nine operations are optional local reduction operations intended to - eliminate unnecessary latency when performing vector reduction operations - (norms, etc.) on distributed memory systems. The optional local reduction - vector operations are :c:func:`N_VDotProdLocal`, :c:func:`N_VMaxNormLocal`, - :c:func:`N_VL1NormLocal`, :c:func:`N_VWSqrSumLocal`, - :c:func:`N_VWSqrSumMaskLocal`, :c:func:`N_VInvTestLocal`, - :c:func:`N_VConstrMaskLocal`, :c:func:`N_VMinLocal`, and - :c:func:`N_VMinQuotientLocal`. If an ``N_Vector`` implementation defines any - of the local operations as , then the ``NVECTOR_MPIMANYVECTOR`` will call - standard ``N_Vector`` operations to complete the computation. - -- An additional ``N_Vector`` implementation, ``NVECTOR_MPIPLUSX``, has been - created to support the MPI+X paradigm where X is a type of on-node - parallelism (*e.g.*, OpenMP, CUDA). The implementation is accompanied - by additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.mpiplusx` for more details. - -- The and functions have been removed from the ``NVECTOR_CUDA`` and - ``NVECTOR_RAJA`` implementations respectively. Accordingly, the - ``nvector_mpicuda.h``, ``libsundials_nvecmpicuda.lib``, - ``libsundials_nvecmpicudaraja.lib``, and files have been removed. Users - should use the ``NVECTOR_MPIPLUSX`` module coupled in conjunction with the - ``NVECTOR_CUDA`` or ``NVECTOR_RAJA`` modules to replace the functionality. - The necessary changes are minimal and should require few code modifications. - See the programs in and for examples of how to use the ``NVECTOR_MPIPLUSX`` - module with the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` modules respectively. - -- Fixed a memory leak in the ``NVECTOR_PETSC`` module clone function. - -- Made performance improvements to the ``NVECTOR_CUDA`` module. Users who - utilize a non-default stream should no longer see default stream - synchronizations after memory transfers. - -- Added a new constructor to the ``NVECTOR_CUDA`` module that allows a user - to provide custom allocate and free functions for the vector data - array and internal reduction buffer. See :numref:`NVectors.Cuda` for more details. - -- Added new Fortran 2003 interfaces for most ``N_Vector`` modules. See - :numref:`NVectors` for more details on how to use - the interfaces. - -- Added three new ``N_Vector`` utility functions :c:func:`N_VGetVecAtIndexVectorArray`, - :c:func:`N_VSetVecAtIndexVectorArray`, and :c:func:`N_VNewVectorArray` for working - with arrays when using the Fortran 2003 interfaces. - -**SUNMatrix module changes** - -- Two new functions were added to aid in creating custom ``SUNMatrix`` - objects. The constructor :c:func:`SUNMatNewEmpty` allocates an “empty” generic ``SUNMatrix`` - with the object’s content pointer and the function pointers in the - operations structure initialized to . When used in the constructor - for custom objects this function will ease the introduction of any - new optional operations to the ``SUNMatrix`` API by ensuring only - required operations need to be set. Additionally, the function :c:func:`SUNMatCopyOps` has - been added to copy the operation function pointers between matrix - objects. When used in clone routines for custom matrix objects these - functions also will ease the introduction of any new optional - operations to the ``SUNMatrix`` API by ensuring all operations are - copied when cloning objects. See :numref:`SUNMatrix` for more - details. -- A new operation, :c:func:`SUNMatMatvecSetup`, was added to the ``SUNMatrix`` API to perform any - setup necessary for computing a matrix-vector product. This operation - is useful for ``SUNMatrix`` implementations which need to prepare the - matrix itself, or communication structures before performing the - matrix-vector product. Users who have implemented custom - ``SUNMatrix`` modules will need to at least update their code to set - the corresponding structure member to ``NULL``. See :numref:`SUNMatrix.Ops` - for more details. -- The generic ``SUNMatrix`` API now defines error codes to be returned - by ``SUNMatrix`` operations. Operations which return an integer flag - indiciating success/failure may return different values than - previously. -- A new ``SUNMatrix`` (and ``SUNLinearSolver``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNMatrix.SLUNRloc` for more details. -- Added new Fortran 2003 interfaces for most ``SUNMatrix`` modules. See - :numref:`SUNMatrix` for more details on how to - use the interfaces. - -**SUNLinearSolver module changes** - -- A new function was added to aid in creating custom ``SUNLinearSolver`` - objects. The constructor allocates an “empty” generic ``SUNLinearSolver`` - with the object’s content pointer and the function pointers in the operations - structure initialized to . When used in the constructor for custom objects - this function will ease the introduction of any new optional operations to - the ``SUNLinearSolver`` API by ensuring only required operations need to be - set. See :numref:`SUNLinSol.API.Custom` for more details. -- The return type of the ``SUNLinearSolver`` API function has changed from to - to be consistent with the type used to store row indices in dense and banded - linear solver modules. -- Added a new optional operation to the ``SUNLinearSolver`` API, - :c:func:`SUNLinSolLastFlag`, that returns a for identifying the linear solver module. -- The ``SUNLinearSolver`` API has been updated to make the initialize and - setup functions optional. -- A new ``SUNLinearSolver`` (and ``SUNMatrix``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNLinSol.SuperLUDIST` for more details. -- Added a new ``SUNLinearSolver`` implementation, :ref:`SUNLINEARSOLVER_CUSOLVERSP <SUNLinSol.cuSolverSp>`, - which leverages the NVIDIA cuSOLVER sparse batched QR method for efficiently solving block - diagonal linear systems on NVIDIA GPUs. -- Added three new accessor functions to the ``SUNLINSOL_KLU`` module, :c:func:`SUNLinSol_KLUGetSymbolic`, - , :c:func:`SUNLinSol_KLUGetNumeric` and :c:func:`SUNLinSol_KLUGetCommon`, to - provide user access to the underlying KLU solver structures. See - :numref:`SUNLinSol.KLU` for more details. -- Added new Fortran 2003 interfaces for most ``SUNLinearSolver`` modules. See - :numref:`SUNLinSol` for more details on how to use the interfaces. - -**SUNNonlinearSolver module changes** - -- A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolSetConvTestFn` allocates an - “empty” generic ``SUNNonlinearSolver`` with the object’s content pointer and - the function pointers in the operations structure initialized to . When used - in the constructor for custom objects this function will ease the - introduction of any new optional operations to the ``SUNNonlinearSolver`` API - by ensuring only required operations need to be set. See - :numref:`SUNNonlinSol.API.Custom` for more details. -- To facilitate the use of user supplied nonlinear solver convergence - test functions the function in the ``SUNNonlinearSolver`` API has been - updated to take a data pointer as input. The supplied data pointer will be - passed to the nonlinear solver convergence test function on each call. -- The inputs values passed to the first two inputs of the function - :c:func:`SUNNonlinSolSolve` in the ``SUNNonlinearSolver`` have been changed to - be the predicted state and the initial guess for the correction to that state. Additionally, the - definitions of :c:func:`SUNNonlinSolLSetupFn` and - :c:func:`SUNNonlinSolLSolveFn` in the ``SUNNonlinearSolver`` API have been - updated to remove unused input parameters. For more information on the - nonlinear system formulation see :numref:`SUNNonlinSol.CVODES` and for more - details on the API functions see :numref:`SUNNonlinSol`. -- Added a new ``SUNNonlinearSolver`` implementation, ``SUNNONLINSOL_PETSC``, - which interfaces to the PETSc SNES nonlinear solver API. See - :numref:`SUNNonlinSol.PetscSNES` for more details. -- Added new Fortran 2003 interfaces for most ``SUNNonlinearSolver`` modules. - See :numref:`SUNDIALS.Fortran` for more details on how to use the - interfaces. - - -CVODES changes -^^^^^^^^^^^^^^ - -- Fixed a bug in the CVODES constraint handling where the step size could be - set below the minimum step size. - -- Fixed a bug in the CVODES nonlinear solver interface where the norm of the - accumulated correction was not updated when using a non-default convergence - test function. - -- Fixed a bug in the CVODES ``cvRescale`` function where the loops to compute - the array of scalars for the fused vector scale operation stopped one - iteration early. - -- Fixed a bug where the ``CVodeF`` function would return the wrong flag under - certrain cirumstances. - -- Fixed a bug where the ``CVodeF`` function would not return a root in - ``CV_NORMAL_STEP`` mode if the root occurred after the desired output time. - -- Removed extraneous calls to ``N_VMin`` for simulations where the scalar - valued absolute tolerance, or all entries of the vector-valued absolute - tolerance array, are strictly positive. In this scenario, CVODES will remove - at least one global reduction per time step. - -- The CVLS interface has been updated to only zero the Jacobian matrix before - calling a user-supplied Jacobian evaluation function when the attached linear - solver has type ``SUNLINEARSOLVER_DIRECT``. - -- A new linear solver interface function ``CVLsLinSysFn`` was added as an - alternative method for evaluating the linear system :math:`M = I - \gamma J`. - -- Added new functions, ``CVodeGetCurrentGamma``, ``CVodeGetCurrentState``, - ``CVodeGetCurrentStateSens``, and ``CVodeGetCurrentSensSolveIndex`` which may - be useful to users who choose to provide their own nonlinear solver - implementations. - -- Added a Fortran 2003 interface to CVODES. See - Chapter :numref:`SUNDIALS.Fortran` for more details. - - -Changes in v4.1.0 ------------------ - -An additional ``N_Vector`` implementation was added for the TPETRA vector from -the Trilinos library to facilitate interoperability between SUNDIALS and -Trilinos. This implementation is accompanied by additions to user documentation -and SUNDIALS examples. - -A bug was fixed where a nonlinear solver object could be freed twice in some use -cases. - -The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option -``EXAMPLES_ENABLE_CUDA`` enables all examples that use CUDA including the RAJA -examples with a CUDA back end (if the RAJA ``N_Vector`` is enabled). - -The implementation header file ``cvodes_impl.h`` is no longer installed. This -means users who are directly manipulating the ``CVodeMem`` structure will need -to update their code to use CVODES’s public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Changes in v4.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a contributing agreement. - -Moved definitions of DLS and SPILS backwards compatibility functions to a source -file. The symbols are now included in the CVODES library, -``libsundials_cvodes``. - -Changes in v4.0.1 ------------------ - -No changes were made in this release. - -Changes in v4.0.0 ------------------ - -CVODES’ previous direct and iterative linear solver interfaces, CVDLS and -CVSPILS, have been merged into a single unified linear solver interface, -CVLS, to support any valid ``SUNLinearSolver`` module. This includes the -“DIRECT” and “ITERATIVE” types as well as the new “MATRIX_ITERATIVE” type. -Details regarding how CVLS utilizes linear solvers of each type as well as -discussion regarding intended use cases for user-supplied ``SUNLinearSolver`` -implementations are included in Chapter :numref:`SUNLinSol`. All CVODES example -programs and the standalone linear solver examples have been updated to use the -unified linear solver interface. - -The unified interface for the new CVLS module is very similar to the previous -CVDLS and CVSPILS interfaces. To minimize challenges in user -migration to the new names, the previous C routine names may still be used; -these will be deprecated in future releases, so we recommend that users migrate -to the new names soon. - -The names of all constructor routines for SUNDIALS-provided ``SUNLinearSolver`` -implementations have been updated to follow the naming convention -``SUNLinSol_*`` where ``*`` is the name of the linear solver. The new names are -``SUNLinSol_Band``, ``SUNLinSol_Dense``, ``SUNLinSol_KLU``, -``SUNLinSol_LapackBand``, ``SUNLinSol_LapackDense``, ``SUNLinSol_PCG``, -``SUNLinSol_SPBCGS``, ``SUNLinSol_SPFGMR``, ``SUNLinSol_SPGMR``, -``SUNLinSol_SPTFQMR``, and ``SUNLinSol_SuperLUMT``. Solver-specific “set” -routine names have been similarly standardized. To minimize challenges in user -migration to the new names, the previous routine names may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. All CVODES example programs and the standalone linear solver -examples have been updated to use the new naming convention. - -The ``SUNBandMatrix`` constructor has been simplified to remove the storage -upper bandwidth argument. - -SUNDIALS integrators have been updated to utilize generic nonlinear solver -modules defined through the ``SUNNonlinearSolver`` API. This API will ease the -addition of new nonlinear solver options and allow for external or user-supplied -nonlinear solvers. The ``SUNNonlinearSolver`` API and SUNDIALS provided modules -are described in Chapter :numref:`SUNNonlinSol` and follow the same object -oriented design and implementation used by the ``N_Vector``, ``SUNMatrix``, and -``SUNLinearSolver`` modules. Currently two ``SUNNonlinearSolver`` -implementations are provided, ``SUNNONLINSOL_NEWTON`` and -``SUNNONLINSOL_FIXEDPOINT``. These replicate the previous integrator specific -implementations of a Newton iteration and a fixed-point iteration (previously -referred to as a functional iteration), respectively. Note the -``SUNNONLINSOL_FIXEDPOINT`` module can optionally utilize Anderson’s method to -accelerate convergence. Example programs using each of these nonlinear solver -modules in a standalone manner have been added and all CVODES example programs -have been updated to use generic ``SUNNonlinearSolver`` modules. - -With the introduction of ``SUNNonlinearSolver`` modules, the input parameter -``iter`` to ``CVodeCreate`` has been removed along with the function -``CVodeSetIterType`` and the constants ``CV_NEWTON`` and ``CV_FUNCTIONAL``. -Instead of specifying the nonlinear iteration type when creating the CVODES -memory structure, CVODES uses the ``SUNNONLINSOL_NEWTON`` module implementation -of a Newton iteration by default. For details on using a non-default or -user-supplied nonlinear solver see Chapters :numref:`CVODES.Usage.SIM`, -:numref:`CVODES.Usage.FSA`, and :numref:`CVODES.Usage.ADJ`. CVODES functions for -setting the nonlinear solver options (e.g., ``CVodeSetMaxNonlinIters``) or -getting nonlinear solver statistics (e.g., ``CVodeGetNumNonlinSolvIters``) -remain unchanged and internally call generic ``SUNNonlinearSolver`` functions as -needed. - -Three fused vector operations and seven vector array operations have been added -to the ``N_Vector`` API. These *optional* operations are disabled by default and -may be activated by calling vector specific routines after creating an -``N_Vector`` (see Chapter :numref:`NVectors` for more details). The -new operations are intended to increase data reuse in vector operations, reduce -parallel communication on distributed memory systems, and lower the number of -kernel launches on systems with accelerators. The fused operations are -``N_VLinearCombination``, ``N_VScaleAddMulti``, and ``N_VDotProdMulti`` and the -vector array operations are ``N_VLinearCombinationVectorArray``, -``N_VScaleVectorArray``, ``N_VConstVectorArray``, ``N_VWrmsNormVectorArray``, -``N_VWrmsNormMaskVectorArray``, ``N_VScaleAddMultiVectorArray``, and -``N_VLinearCombinationVectorArray``. If an ``N_Vector`` implementation defines -any of these operations as ``NULL``, then standard ``N_Vector`` operations will -automatically be called as necessary to complete the computation. Multiple -updates to ``NVECTOR_CUDA`` were made: - -- Changed ``N_VGetLength_Cuda`` to return the global vector length instead of the local vector length. - -- Added ``N_VGetLocalLength_Cuda`` to return the local vector length. - -- Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. - -- Removed the accessor functions in the namespace suncudavec. - -- Changed the ``N_VMake_Cuda`` function to take a host data pointer and a device data pointer instead of an - ``N_VectorContent_Cuda`` object. - -- Added the ability to set the ``cudaStream_t`` used for execution of the ``NVECTOR_CUDA`` kernels. See the function - ``N_VSetCudaStreams_Cuda``. - -- Added ``N_VNewManaged_Cuda``, ``N_VMakeManaged_Cuda``, and ``N_VIsManagedMemory_Cuda`` functions to accommodate using - managed memory with the ``NVECTOR_CUDA``. - -Multiple changes to ``NVECTOR_RAJA`` were made: - -- Changed ``N_VGetLength_Raja`` to return the global vector length instead of the local vector length. - -- Added ``N_VGetLocalLength_Raja`` to return the local vector length. - -- Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. - -- Removed the accessor functions in the namespace suncudavec. - -A new ``N_Vector`` implementation for leveraging OpenMP 4.5+ device offloading -has been added, ``NVECTOR_OPENMPDEV``. See :numref:`NVectors.openmpdev` for more -details. Two changes were made in the CVODE/CVODES/ARKODE initial step size -algorithm: - -#. Fixed an efficiency bug where an extra call to the right hand side function was made. - -#. Changed the behavior of the algorithm if the max-iterations case is hit. Before the algorithm would exit with the - step size calculated on the penultimate iteration. Now it will exit with the step size calculated on the final - iteration. - -Changes in v3.2.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a bug in the CUDA ``N_Vector`` where the ``N_VInvTest`` operation could - write beyond the allocated vector data. - -- Fixed library installation path for multiarch systems. This fix changes the default library installation path to - ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` from - ``CMAKE_INSTALL_PREFIX/lib``. ``CMAKE_INSTALL_LIBDIR`` is automatically set, - but is available as a CMake option that can modified. - -Changes in v3.2.0 ------------------ - -Support for optional inequality constraints on individual components of the -solution vector has been added to CVODE and CVODES. See Chapter -:numref:`CVODES.Mathematics` and the description of -:c:func:`CVodeSetConstraints` for more details. Use of ``CVodeSetConstraints`` -requires the ``N_Vector`` operations ``N_VMinQuotient``, ``N_VConstrMask``, and -``N_VCompare`` that were not previously required by CVODE and CVODES. - -Fixed a thread-safety issue when using ajdoint sensitivity analysis. - -Fixed a problem with setting ``sunindextype`` which would occur with some -compilers (e.g. armclang) that did not define ``__STDC_VERSION__``. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than one MPI -rank when using a GPU system. The vectors assume one GPU device per MPI rank. - -Changed the name of the RAJA ``N_Vector`` library to -``libsundials_nveccudaraja.lib`` from ``libsundials_nvecraja.lib`` to better -reflect that we only support CUDA as a backend for RAJA currently. - - -Several changes were made to the build system: - -- CMake 3.1.3 is now the minimum required CMake version. - -- Deprecate the behavior of the ``SUNDIALS_INDEX_TYPE`` CMake option and added the ``SUNDIALS_INDEX_SIZE`` CMake option - to select the ``sunindextype`` integer size. - -- The native CMake FindMPI module is now used to locate an MPI installation. - -- If MPI is enabled and MPI compiler wrappers are not set, the build system will check if ``CMAKE_<language>_COMPILER`` - can compile MPI programs before trying to locate and use an MPI installation. - -- The previous options for setting MPI compiler wrappers and the executable for running MPI programs have been have - been depreated. The new options that align with those used in native CMake FindMPI module are ``MPI_C_COMPILER``, - ``MPI_CXX_COMPILER``, ``MPI_Fortran_COMPILER``, and ``MPIEXEC_EXECUTABLE``. - -- When a Fortran name-mangling scheme is needed (e.g., ``ENABLE_LAPACK`` is ``ON``) the build system will infer the - scheme from the Fortran compiler. If a Fortran compiler is not available or the inferred or default scheme needs to - be overridden, the advanced options ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` can be used to - manually set the name-mangling scheme and bypass trying to infer the scheme. - -- Parts of the main CMakeLists.txt file were moved to new files in the ``src`` and ``example`` directories to make the - CMake configuration file structure more modular. - -Changes in v3.1.2 ------------------ - -The changes in this minor release include the following: - -- Updated the minimum required version of CMake to 2.8.12 and enabled using rpath by default to locate shared libraries - on OSX. - -- Fixed Windows specific problem where ``sunindextype`` was not correctly defined when using 64-bit integers for the - SUNDIALS index type. On Windows ``sunindextype`` is now defined as the MSVC basic type ``__int64``. - -- Added sparse SUNMatrix “Reallocate” routine to allow specification of the nonzero storage. - -- Updated the KLU SUNLinearSolver module to set constants for the two reinitialization types, and fixed a bug in the - full reinitialization approach where the sparse SUNMatrix pointer would go out of scope on some architectures. - -- Updated the “ScaleAdd” and “ScaleAddI” implementations in the sparse SUNMatrix module to more optimally handle the - case where the target matrix contained sufficient storage for the sum, but had the wrong sparsity pattern. The sum - now occurs in-place, by performing the sum backwards in the existing storage. However, it is still more efficient if - the user-supplied Jacobian routine allocates storage for the sum :math:`I+\gamma J` manually (with zero entries if - needed). - -- Added new example, ``cvRoberts_FSA_dns_Switch.c``, which demonstrates switching on/off forward sensitivity - computations. This example came from the usage notes page of the SUNDIALS website. - -- The misnamed function ``CVSpilsSetJacTimesSetupFnBS`` has been deprecated and replaced by ``CVSpilsSetJacTimesBS``. - The deprecated function ``CVSpilsSetJacTimesSetupFnBS`` will be removed in the next major release. - -- Changed the LICENSE install path to ``instdir/include/sundials``. - -Changes in v3.1.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a minor bug in the cvSLdet routine, where a return was missing in the error check for three inconsistent roots. - -- Fixed a potential memory leak in the SPGMR and SPFGMR linear solvers: if “Initialize” was called multiple - times then the solver memory was reallocated (without being freed). - -- Updated KLU ``SUNLinearSolver`` module to use a ``typedef`` for the precision-specific solve function to be used (to - avoid compiler warnings). - -- Added missing typecasts for some ``(void*)`` pointers (again, to avoid compiler warnings). - -- Bugfix in ``sunmatrix_sparse.c`` where we had used ``int`` instead of ``sunindextype`` in one location. - -- Added missing ``#include <stdio.h>`` in ``N_Vector`` and ``SUNMatrix`` header files. - -- Fixed an indexing bug in the CUDA ``N_Vector`` implementation of ``N_VWrmsNormMask`` and revised the - RAJA ``N_Vector`` implementation of ``N_VWrmsNormMask`` to work with mask arrays using values other than zero - or one. Replaced ``double`` with ``realtype`` in the RAJA vector test functions. - -In addition to the changes above, minor corrections were also made to the -example programs, build system, and user documentation. - -Changes in v3.1.0 ------------------ - -Added ``N_Vector`` print functions that write vector data to a specified file -(e.g., ``N_VPrintFile_Serial``). - -Added ``make test`` and ``make test_install`` options to the build system for -testing SUNDIALS after building with ``make`` and installing with ``make -install`` respectively. - -Changes in v3.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been reworked, and -all example programs have been updated. The goal of the redesign of these -interfaces was to provide more encapsulation and ease in interfacing custom -linear solvers and interoperability with linear solver libraries. Specific -changes include: - -- Added generic SUNMATRIX module with three provided implementations: dense, banded and sparse. These replicate - previous SUNDIALS Dls and Sls matrix structures in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNMATRIX modules. - -- Added generic SUNLINEARSOLVER module with eleven provided implementations: dense, banded, LAPACK dense, LAPACK band, - KLU, SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, PCG. These replicate previous SUNDIALS generic linear solvers - in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNLINEARSOLVER modules. - -- Expanded package-provided direct linear solver (Dls) interfaces and scaled, preconditioned, iterative linear solver - (Spils) interfaces to utilize generic SUNMATRIX and SUNLINEARSOLVER objects. - -- Removed package-specific, linear solver-specific, solver modules (e.g. CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since - their functionality is entirely replicated by the generic Dls/Spils interfaces and SUNLINEARSOLVER/SUNMATRIX modules. - The exception is CVDIAG, a diagonal approximate Jacobian solver available to CVODE and CVODES. - -- Converted all SUNDIALS example problems to utilize new generic SUNMATRIX and SUNLINEARSOLVER objects, along - with updated Dls and Spils linear solver interfaces. - -- Added Spils interface routines to ARKode, CVODE, CVODES, IDA and IDAS to allow specification of a user-provided - "JTSetup" routine. This change supports users who wish to set up data structures for the user-provided - Jacobian-times-vector ("JTimes") routine, and where the cost of one JTSetup setup per Newton iteration can be - amortized between multiple JTimes calls. - -Two additional ``N_Vector`` implementations were added – one for CUDA and one -for RAJA vectors. These vectors are supplied to provide very basic support for -running on GPU architectures. Users are advised that these vectors both move all -data to the GPU device upon construction, and speedup will only be realized if -the user also conducts the right-hand-side function evaluation on the device. In -addition, these vectors assume the problem fits on one GPU. Further information -about RAJA, users are referred to th web site, https://software.llnl.gov/RAJA/. -These additions are accompanied by additions to various interface functions and -to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` that can -be configured to be a 32- or 64-bit integer data index type. ``sunindextype`` is -defined to be ``int32_t`` or ``int64_t`` when portable types are supported, -otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces -continue to use ``long int`` for indices, except for their sparse matrix -interface that now uses the new ``sunindextype``. This new flexible capability -for index types includes interfaces to PETSc, hypre, SuperLU_MT, and KLU with -either 32-bit or 64-bit capabilities depending how the user configures SUNDIALS. - -To avoid potential namespace conflicts, the macros defining ``booleantype`` -values ``TRUE`` and ``FALSE`` have been changed to ``SUNTRUE`` and ``SUNFALSE`` -respectively. - -Temporary vectors were removed from preconditioner setup and solve routines for -all packages. It is assumed that all necessary data for user-provided -preconditioner operations will be allocated and stored in user-provided data -structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS -type information for use in Fortran programs. - -Added functions ``SUNDIALSGetVersion`` and ``SUNDIALSGetVersionNumber`` to get -SUNDIALS release version information at runtime. - -The build system was expanded to support many of the xSDK-compliant keys. The -xSDK is a movement in scientific software to provide a foundation for the rapid -and efficient production of high-quality, sustainable extreme-scale scientific -applications. More information can be found at, https://xsdk.info. - -In addition, numerous changes were made to the build system. These include the -addition of separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` CMake variables, -additional error checking during CMake configuration, minor bug fixes, and -renaming CMake options to enable/disable examples for greater clarity and an -added option to enable/disable Fortran 77 examples. These changes included -changing ``EXAMPLES_ENABLE`` to ``EXAMPLES_ENABLE_C``, changing ``CXX_ENABLE`` -to ``EXAMPLES_ENABLE_CXX``, changing ``F90_ENABLE`` to ``EXAMPLES_ENABLE_F90``, -and adding an ``EXAMPLES_ENABLE_F77`` option. - -A bug fix was made in ``CVodeFree`` to call ``lfree`` unconditionally (if -non-NULL). - -Corrections and additions were made to the examples, to installation-related -files, and to the user documentation. - -Changes in v2.9.0 ------------------ - -Two additional ``N_Vector`` implementations were added – one for Hypre -(parallel) ParVector vectors, and one for PETSc vectors. These additions are -accompanied by additions to various interface functions and to user -documentation. - -Each ``N_Vector`` module now includes a function, ``N_VGetVectorID``, that -returns the ``N_Vector`` module name. - -A bug was fixed in the interpolation functions used in solving backward problems -for adjoint sensitivity analysis. - -For each linear solver, the various solver performance counters are now -initialized to 0 in both the solver specification function and in solver -``linit`` function. This ensures that these solver counters are initialized upon -linear solver instantiation as well as at the beginning of the problem solution. - -A memory leak was fixed in the banded preconditioner interface. In addition, -updates were done to return integers from linear solver and preconditioner -’free’ functions. - -The Krylov linear solver Bi-CGstab was enhanced by removing a redundant dot -product. Various additions and corrections were made to the interfaces to the -sparse solvers KLU and SuperLU_MT, including support for CSR format when using -KLU. - -In interpolation routines for backward problems, added logic to bypass -sensitivity interpolation if input sensitivity argument is NULL. - -New examples were added for use of sparse direct solvers within sensitivity -integrations and for use of OpenMP. - -Minor corrections and additions were made to the CVODES solver, to the examples, -to installation-related files, and to the user documentation. - -Changes in v2.8.0 ------------------ - -Two major additions were made to the linear system solvers that are available -for use with the CVODES solver. First, in the serial case, an interface to the -sparse direct solver KLU was added. Second, an interface to SuperLU_MT, the -multi-threaded version of SuperLU, was added as a thread-parallel sparse direct -solver option, to be used with the serial version of the ``N_Vector`` module. As -part of these additions, a sparse matrix (CSC format) structure was added to -CVODES. - -Otherwise, only relatively minor modifications were made to the CVODES solver: - -In ``cvRootfind``, a minor bug was corrected, where the input array ``rootdir`` -was ignored, and a line was added to break out of root-search loop if the -initial interval size is below the tolerance ``ttol``. - -In ``CVLapackBand``, the line ``smu = MIN(N-1,mu+ml)`` was changed to ``smu = mu -+ ml`` to correct an illegal input error for ``DGBTRF/DGBTRS``. - -Some minor changes were made in order to minimize the differences between the -sources for private functions in CVODES and CVODE. - -An option was added in the case of Adjoint Sensitivity Analysis with dense or -banded Jacobian: With a call to ``CVDlsSetDenseJacFnBS`` or -``CVDlsSetBandJacFnBS``, the user can specify a user-supplied Jacobian function -of type ``CVDls***JacFnBS``, for the case where the backward problem depends on -the forward sensitivities. - -In ``CVodeQuadSensInit``, the line ``cv_mem->cv_fQS_data = ...`` was corrected -(missing ``Q``). - -In the User Guide, a paragraph was added in Section 6.2.1 on ``CVodeAdjReInit``, -and a paragraph was added in Section 6.2.9 on ``CVodeGetAdjY``. In the example -``cvsRoberts_ASAi_dns``, the output was revised to include the use of -``CVodeGetAdjY``. - -Two minor bugs were fixed regarding the testing of input on the first call to -``CVode`` – one involving ``tstop`` and one involving the initialization of -``*tret``. - -For the Adjoint Sensitivity Analysis case in which the backward problem depends -on the forward sensitivities, options have been added to allow for user-supplied -``pset``, ``psolve``, and ``jtimes`` functions. - -In order to avoid possible name conflicts, the mathematical macro and function -names ``MIN``, ``MAX``, ``SQR``, ``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and -``RPowerR`` were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, ``SUNRabs``, -``SUNRsqrt``, ``SUNRexp``, ``SRpowerI``, and ``SUNRpowerR``, respectively. These -names occur in both the solver and example programs. - -In the example ``cvsHessian_ASA_FSA``, an error was corrected in the function -``fB2``: ``y2`` in place of ``y3`` in the third term of ``Ith(yBdot,6)``. - -Two new ``N_Vector`` modules have been added for thread-parallel computing -environments — one for OpenMP, denoted ``NVECTOR_OPENMP``, and one for Pthreads, -denoted ``NVECTOR_PTHREADS``. - -With this version of SUNDIALS, support and documentation of the Autotools mode -of installation is being dropped, in favor of the CMake mode, which is -considered more widely portable. - -Changes in v2.7.0 ------------------ - -One significant design change was made with this release: The problem size and -its relatives, bandwidth parameters, related internal indices, pivot arrays, and -the optional output ``lsflag`` have all been changed from type ``int`` to type -``long int``, except for the problem size and bandwidths in user calls to -routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The -function ``NewIntArray`` is replaced by a pair ``NewIntArray`` / ``NewLintArray``, -for ``int`` and ``long int`` arrays, respectively. In a minor change to the user -interface, the type of the index ``which`` in CVODES was changed from ``long -int`` to ``int``. - -Errors in the logic for the integration of backward problems were identified and -fixed. - -A large number of minor errors have been fixed. Among these are the following: -In ``CVSetTqBDF``, the logic was changed to avoid a divide by zero. After the -solver memory is created, it is set to zero before being filled. In each linear -solver interface function, the linear solver memory is freed on an error return, -and the ``**Free`` function now includes a line setting to NULL the main memory -pointer to the linear solver memory. In the rootfinding functions -``CVRcheck1`` / ``CVRcheck2``, when an exact zero is found, the array ``glo`` of -:math:`g` values at the left endpoint is adjusted, instead of shifting the -:math:`t` location ``tlo`` slightly. In the installation files, we modified the -treatment of the macro SUNDIALS_USE_GENERIC_MATH, so that the parameter -GENERIC_MATH_LIB is either defined (with no value) or not defined. - -Changes in v2.6.0 ------------------ - -Two new features related to the integration of ODE IVP problems were added in -this release: (a) a new linear solver module, based on BLAS and LAPACK for both -dense and banded matrices, and (b) an option to specify which direction of -zero-crossing is to be monitored while performing rootfinding. - -This version also includes several new features related to sensitivity analysis, -among which are: (a) support for integration of quadrature equations depending -on both the states and forward sensitivity (and thus support for forward -sensitivity analysis of quadrature equations), (b) support for simultaneous -integration of multiple backward problems based on the same underlying ODE -(e.g., for use in an *forward-over-adjoint* method for computing second order -derivative information), (c) support for backward integration of ODEs and -quadratures depending on both forward states and sensitivities (e.g., for use in -computing second-order derivative information), and (d) support for -reinitialization of the adjoint module. - -The user interface has been further refined. Some of the API changes involve: -(a) a reorganization of all linear solver modules into two families (besides the -existing family of scaled preconditioned iterative linear solvers, the direct -solvers, including the new LAPACK-based ones, were also organized into a -*direct* family); (b) maintaining a single pointer to user data, optionally -specified through a ``Set``-type function; and (c) a general streamlining of the -preconditioner modules distributed with the solver. Moreover, the prototypes of -all functions related to integration of backward problems were modified to -support the simultaneous integration of multiple problems. All backward problems -defined by the user are internally managed through a linked list and identified -in the user interface through a unique identifier. - -Changes in v2.5.0 ------------------ - -The main changes in this release involve a rearrangement of the entire SUNDIALS -source tree (see :numref:`CVODES.Organization`). At the user interface level, -the main impact is in the mechanism of including SUNDIALS header files which -must now include the relative path (e.g. ``#include <cvode/cvode.h>``). -Additional changes were made to the build system: all exported header files are -now installed in separate subdirectories of the instaltion *include* directory. - -In the adjoint solver module, the following two bugs were fixed: in ``CVodeF`` -the solver was sometimes incorrectly taking an additional step before returning -control to the user (in ``CV_NORMAL`` mode) thus leading to a failure in the -interpolated output function; in ``CVodeB``, while searching for the current -check point, the solver was sometimes reaching outside the integration interval -resulting in a segmentation fault. - -The functions in the generic dense linear solver (``sundials_dense`` and -``sundials_smalldense``) were modified to work for rectangular :math:`m \times -n` matrices (:math:`m \le n`), while the factorization and solution functions -were renamed to ``DenseGETRF`` / ``denGETRF`` and ``DenseGETRS`` / ``denGETRS``, -respectively. The factorization and solution functions in the generic band -linear solver were renamed ``BandGBTRF`` and ``BandGBTRS``, respectively. - -Changes in v2.4.0 ------------------ - -CVSPBCG and CVSPTFQMR modules have been added to interface with the Scaled -Preconditioned Bi-CGstab (SPBCG) and Scaled Preconditioned Transpose-Free -Quasi-Minimal Residual (SPTFQMR) linear solver modules, respectively (for -details see Chapter :numref:`CVODES.Usage.SIM`). At the same time, -function type names for Scaled Preconditioned Iterative Linear Solvers were -added for the user-supplied Jacobian-times-vector and preconditioner setup and -solve functions. - -A new interpolation method was added to the CVODES adjoint module. The function -``CVadjMalloc`` has an additional argument which can be used to select the -desired interpolation scheme. - -The deallocation functions now take as arguments the address of the respective -memory block pointer. - -To reduce the possibility of conflicts, the names of all header files have been -changed by adding unique prefixes (``cvodes_`` and ``sundials_``). When using -the default installation procedure, the header files are exported under various -subdirectories of the target ``include`` directory. For more details see -Appendix :numref:`Installation`. - -Changes in v2.3.0 ------------------ - -A minor bug was fixed in the interpolation functions of the adjoint CVODES -module. - -Changes in v2.2.0 ------------------ - -The user interface has been further refined. Several functions used for setting -optional inputs were combined into a single one. An optional user-supplied -routine for setting the error weight vector was added. Additionally, to resolve -potential variable scope issues, all SUNDIALS solvers release user data right -after its use. The build systems has been further improved to make it more -robust. - -Changes in v2.1.2 ------------------ - -A bug was fixed in the ``CVode`` function that was potentially leading to -erroneous behaviour of the rootfinding procedure on the integration first step. - -Changes in v2.1.1 ------------------ - -This CVODES release includes bug fixes related to forward sensitivity -computations (possible loss of accuray on a BDF order increase and incorrect -logic in testing user-supplied absolute tolerances). In addition, we have added -the option of activating and deactivating forward sensitivity calculations on -successive CVODES runs without memory allocation/deallocation. - -Other changes in this minor SUNDIALS release affect the build system. - -Changes in v2.1.0 ------------------ - -The major changes from the previous version involve a redesign of the user -interface across the entire SUNDIALS suite. We have eliminated the mechanism of -providing optional inputs and extracting optional statistics from the solver -through the ``iopt`` and ``ropt`` arrays. Instead, CVODES now provides a set of -routines (with prefix ``CVodeSet``) to change the default values for various -quantities controlling the solver and a set of extraction routines (with prefix -``CVodeGet``) to extract statistics after return from the main solver routine. -Similarly, each linear solver module provides its own set of ``Set``- and -``Get``-type routines. For more details see -:numref:`CVODES.Usage.SIM.optional_input` and -:numref:`CVODES.Usage.SIM.optional_output`. - -Additionally, the interfaces to several user-supplied routines (such as those -providing Jacobians, preconditioner information, and sensitivity right hand -sides) were simplified by reducing the number of arguments. The same information -that was previously accessible through such arguments can now be obtained -through ``Get``-type functions. - -The rootfinding feature was added, whereby the roots of a set of given functions -may be computed during the integration of the ODE system. - -Installation of CVODES (and all of SUNDIALS) has been completely redesigned and -is now based on configure scripts. - .. _CVODES.Introduction.Reading: Reading this User Guide @@ -2102,7 +187,7 @@ The structure of this document is as follows: - Chapter :numref:`CVODES.Usage.ADJ` describes the usage of CVODES for adjoint sensitivity analysis. We begin by describing the CVODES checkpointing implementation for interpolation of the original IVP solution during integration of the adjoint system backward - in time, and with an overview of a user’s main program. Following that we + in time, and with an overview of a user's main program. Following that we provide complete descriptions of the user-callable interface routines for adjoint sensitivity analysis as well as descriptions of the required additional user-defined routines. @@ -2110,12 +195,12 @@ The structure of this document is as follows: - Chapter :numref:`NVectors` gives a brief overview of the generic ``N_Vector`` module shared among the various components of SUNDIALS, and details on the ``N_Vector`` implementations provided with SUNDIALS. -- Chapter :numref:`SUNMatrix` gives a brief overview of the generic ``SUNMatrix`` module shared among - the various components of SUNDIALS, and details on the ``SUNMatrix`` - implementations provided with SUNDIALS: a dense implementation (§\ - :numref:`SUNMatrix.Dense`), a banded implementation (§\ - :numref:`SUNMatrix.Band`) and a sparse implementation (§\ - :numref:`SUNMatrix.Sparse`). +- Chapter :numref:`SUNMatrix` gives a brief overview of the generic + ``SUNMatrix`` module shared among the various components of SUNDIALS, and + details on the ``SUNMatrix`` implementations provided with SUNDIALS: a dense + implementation (:numref:`SUNMatrix.Dense`), a banded implementation + (:numref:`SUNMatrix.Band`) and a sparse implementation + (:numref:`SUNMatrix.Sparse`). - Chapter :numref:`SUNLinSol` gives a brief overview of the generic ``SUNLinearSolver`` module shared among the various components of SUNDIALS. This chapter contains details on the diff --git a/doc/cvodes/guide/source/RecentChanges_link.rst b/doc/cvodes/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/cvodes/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/cvodes/guide/source/conf.py b/doc/cvodes/guide/source/conf.py index 915d1ba438..6ed2b1895e 100644 --- a/doc/cvodes/guide/source/conf.py +++ b/doc/cvodes/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/cvodes/guide/source/index.rst b/doc/cvodes/guide/source/index.rst index 431e4e7cc9..c6324802e5 100644 --- a/doc/cvodes/guide/source/index.rst +++ b/doc/cvodes/guide/source/index.rst @@ -38,6 +38,7 @@ CVODES Documentation sundials/Install_link.rst Constants History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/ida/guide/source/Changelog_link.rst b/doc/ida/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/ida/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 2d54657a91..2c4a52402f 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -69,1870 +69,13 @@ systems. the greater ease of interfacing the solver to applications written in extended Fortran. -Changes from previous versions -============================== +Changes to SUNDIALS in release X.Y.Z +==================================== -Changes in vX.X.X ------------------- +.. include:: ../../../shared/RecentChanges.rst -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). +For changes in prior versions of SUNDIALS see :numref:`Changelog`. -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - - -Changes in v7.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the functions -``IDASetErrFile`` and ``IDASetHandlerErrFn`` have been removed. Users of these -functions can use the functions :c:func:`SUNContext_PushErrHandler`, and -:c:func:`SUNLogger_SetErrorFilename` instead. For further details see Sections -:numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -*Fortran Interface Modules Streamlined* - -We have streamlined the Fortran modules that need to be included by users by combining -the SUNDIALS core into one Fortran module, ``fsundials_core_mod``. Modules for -implementations of the core APIs still exist (e.g., for the Dense linear solver there -is ``fsunlinsol_dense_mod``) as do the modules for the SUNDIALS packages (e.g., ``fcvode_mod``). -The following modules are the ones that have been consolidated into ``fsundials_core_mod``: - -.. code-block:: - - fsundials_adaptcontroller_mod - fsundials_context_mod - fsundials_futils_mod - fsundials_linearsolver_mod - fsundials_logger_mod - fsundials_matrix_mod - fsundials_nonlinearsolver_mod - fsundials_nvector_mod - fsundials_profiler_mod - fsundials_types_mod - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be -deprecated -- users who rely on these are recommended to transition to the -corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v6.7.0 ------------------ - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` -to ``O(NNZ)``. - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Fixed a regression introduced by the stop time bug fix in v6.6.1 where CVODE -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 output time was passed. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Changes in v6.6.2 ------------------ - -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. - -Changes in v6.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Fixed a bug where the stop time may not be cleared when using normal mode if the -requested output time is the same as the stop time. - -Changes in v6.6.0 ------------------ - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v6.5.1 ------------------ - -Added the function :c:func:`IDAClearStopTime` to disable a previously set stop -time. - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -Changes in v6.5.0 ------------------ - -Added the functions :c:func:`IDAGetJac`, :c:func:`IDAGetJacCj`, -:c:func:`IDAGetJacTime`, :c:func:`IDAGetJacNumSteps` to assist in debugging -simulations utilizing a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an underflow bug during root finding. - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added support for CUDA v12. - -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Changes in v6.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v6.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector. - -Changes in v6.3.0 ------------------ - -Added the function :c:func:`IDAGetUserData` to retrieve the user data pointer -provided to :c:func:`IDASetUserData`. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v6.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the function :c:func:`IDAPrintAllStats` to output all of the integrator, -nonlinear solver, linear solver, and other statistics in one call. The file -``scripts/sundials_csv.py`` contains functions for parsing the comma-separated -value output files. - -Added the function :c:func:`IDASetDetlaCjLSetup` to adjust the parameter that -determines when a change in :math:`c_j` requires calling the linear solver setup -function. - -Added the functions :c:func:`IDASetEtaFixedStepBounds`, :c:func:`IDASetEtaMax`, -:c:func:`IDASetEtaMin`, :c:func:`IDASetEtaLow`, :c:func:`IDASetEtaMinErrFail`, -and :c:func:`IDASetEtaConvFail` to adjust various parameters controlling changes -in step size. - -Added the function :c:func:`IDASetMinStep` to set a minimum step size. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the functions :c:func:`IDAGetNumNonlinSolvConvFails` and -:c:func:`IDAGetNonlinSolvStats` where the number of nonlinear solver failures -returned was the number of failed *steps* due to a nonlinear solver failure -i.e., if a nonlinear solve failed with a stale Jacobian or preconditioner but -succeeded after updating the Jacobian or preconditioner, the initial failure was -not included in the nonlinear solver failure count. These functions have been -updated to return the total number of nonlinear solver failures. As such users -may see an increase in the number of failures reported. - -The function :c:func:`IDAGetNumStepSolveFails` has been added to retrieve the -number of failed steps due to a nonlinear solver failure. The count returned by -this function will match those previously returned by -:c:func:`IDAGetNumNonlinSolvConvFails` and :c:func:`IDAGetNonlinSolvStats`. - -Changes in v6.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Changes in v6.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v6.0.0 ------------------ - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**IDA** - -The IDA Fortran 77 interface has been removed. See :numref:`SUNDIALS.Fortran` -and the F2003 example programs for more details using the SUNDIALS Fortran 2003 -module interfaces. - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``IDASpilsSetLinearSolver`` | ``IDASetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetPreconditioner`` | ``IDASetPreconditioner`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetJacTimes`` | ``IDASetJacTimes`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetEpsLin`` | ``IDASetEpsLin`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetIncrementFactor`` | ``IDASetIncrementFactor`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetWorkSpace`` | ``IDAGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumPrecEvals`` | ``IDAGetNumPrecEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumPrecSolves`` | ``IDAGetNumPrecSolves`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumLinIters`` | ``IDAGetNumLinIters`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumConvFails`` | ``IDAGetNumLinConvFails`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumJTSetupEvals`` | ``IDAGetNumJTSetupEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumJtimesEvals`` | ``IDAGetNumJtimesEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumResEvals`` | ``IDAGetNumLinResEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetLastFlag`` | ``IDAGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetReturnFlagName`` | ``IDAGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetLinearSolver`` | ``IDASetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetJacFn`` | ``IDASetJacFn`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetWorkSpace`` | ``IDAGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetNumJacEvals`` | ``IDAGetNumJacEvals`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetNumResEvals`` | ``IDAGetNumLinResEvals`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetLastFlag`` | ``IDAGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetReturnFlagName`` | ``IDAGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v5.8.0 ------------------ - -The :ref:`RAJA N_Vector <NVectors.RAJA>` implementation has been updated to -support the SYCL backend in addition to the CUDA and HIP backends. Users can -choose the backend when configuring SUNDIALS by using the -:cmakeop:`SUNDIALS_RAJA_BACKENDS` CMake variable. This module remains -experimental and is subject to change from version to version. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to -interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix -and the linear solver support general dense linear systems as well as block -diagonal linear systems. See :numref:`SUNLinSol.OneMklDense` for more -details. This module is experimental and is subject to change from version to -version. - -Added a new *optional* function to the ``SUNLinearSolver`` API, -:c:func:`SUNLinSolSetZeroGuess`, to indicate that the next call to -:c:func:`SUNLinSolSolve` will be made with a zero initial guess. -``SUNLinearSolver`` implementations that do not use the -:c:func:`SUNLinSolNewEmpty` constructor will, at a minimum, need set the -``setzeroguess`` function pointer in the linear solver ``ops`` structure to -``NULL``. The SUNDIALS iterative linear solver implementations have been updated -to leverage this new set function to remove one dot product per solve. - -IDA now supports a new "matrix-embedded" ``SUNLinearSolver`` type. This type -supports user-supplied ``SUNLinearSolver`` implementations that set up and solve -the specified linear system at each linear solve call. Any matrix-related data -structures are held internally to the linear solver itself, and are not provided -by the SUNDIALS package. - -Added the function :c:func:`IDASetNlsResFn` to supply an alternative residual -side function for use within nonlinear system function evaluations. - -The installed ``SUNDIALSConfig.cmake`` file now supports the ``COMPONENTS`` -option to ``find_package``. - -A bug was fixed in :c:func:`SUNMatCopyOps` where the matrix-vector product setup -function pointer was not copied. - -A bug was fixed in the SPBCGS and SPTFQMR solvers for the case where a non-zero -initial guess and a solution scaling vector are provided. This fix only impacts -codes using SPBCGS or SPTFQMR as standalone solvers as all SUNDIALS packages -utilize a zero initial guess. - -Changes in v5.7.0 ------------------ - -A new ``N_Vector`` implementation based on the SYCL abstraction layer has been -added targeting Intel GPUs. At present the only SYCL compiler supported is the -DPC++ (Intel oneAPI) compiler. See :numref:`NVectors.SYCL` for more details. -This module is considered experimental and is subject to major changes even in -minor releases. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to -interface with the MAGMA linear algebra library. Both the matrix and the linear -solver support general dense linear systems as well as block diagonal linear -systems, and both are targeted at GPUs (AMD or NVIDIA). See -:numref:`SUNLinSol.MagmaDense` for more details. - -Changes in v5.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error if the -:cmakeop:`CMAKE_CXX_STANDARD` and :cmakeop:`SUNDIALS_RAJA_BACKENDS` options were -not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v5.6.0 ------------------ - -A new ``N_Vector`` implementation based on the AMD ROCm HIP platform has been -added. This vector can target NVIDIA or AMD GPUs. See :numref:`NVectors.Hip` for -more details. This module is considered experimental and is subject to change -from version to version. - -The :ref:`NVECTOR_RAJA <NVectors.RAJA>` implementation has been updated to -support the HIP backend in addition to the CUDA backend. Users can choose the -backend when configuring SUNDIALS by using the :cmakeop:`SUNDIALS_RAJA_BACKENDS` -CMake variable. This module remains experimental and is subject to change from -version to version. - -A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the -``N_Vector`` API. This operation is useful for :c:type:`N_Vector` that utilize -dual memory spaces, e.g. the native SUNDIALS CUDA ``N_Vector``. - -The :ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` and -:ref:`SUNLINEARSOLVER_CUSOLVERSP_BATCHQR <SUNLinSol.cuSolverSp>` implementations -no longer require the SUNDIALS CUDA ``N_Vector``. Instead, they require that the -vector utilized provides the :c:func:`N_VGetDeviceArrayPointer` operation, and -that the pointer returned by :c:func:`N_VGetDeviceArrayPointer` is a valid CUDA -device pointer. - -Changes in v5.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. -Users will likely see deprecation warnings, but otherwise the changes should be -fully backwards compatible for almost all users. SUNDIALS now exports CMake -targets and installs a ``SUNDIALSConfig.cmake`` file. - -Added support for SuperLU_DIST 6.3.0 or newer. - -Changes in v5.4.0 ------------------ - -Added the function :c:func:`IDASetLSNormFactor` to specify the factor for -converting between integrator tolerances (WRMS norm) and linear solver -tolerances (L2 norm) i.e., ``tol_L2 = nrmfac * tol_WRMS``. - -The expected behavior of :c:func:`SUNNonlinSolGetNumIters` and -:c:func:`SUNNonlinSolGetNumConvFails` in the ``SUNNonlinearSolver`` API have -been updated to specify that they should return the number of nonlinear solver -iterations and convergence failures in the most recent solve respectively rather -than the cumulative number of iterations and failures across all solves -respectively. The API documentation and SUNDIALS provided ``SUNNonlinearSolver`` -implementations have been updated accordingly. As before, the cumulative number -of nonlinear iterations may be retreived by calling -:c:func:`IDAGetNumNonlinSolvIters`, the cumulative number of failures with -:c:func:`IDAGetNumNonlinSolvConvFails`, or both with -:c:func:`IDAGetNonlinSolvStats`. - -A new API, ``SUNMemoryHelper``, was added to support **GPU users** who have -complex memory management needs such as using memory pools. This is paired with -new constructors for the :ref:`NVECTOR_CUDA <NVectors.CUDA>` and -:ref:`NVECTOR_RAJA <NVectors.RAJA>` modules that accept a ``SUNMemoryHelper`` -object. Refer to :numref:`SUNDIALS.GPU` and :numref:`SUNMemory` for more -information. - -The :ref:`NVECTOR_RAJA <NVectors.RAJA>` module has been updated to mirror the -:ref:`NVECTOR_CUDA <NVectors.CUDA>` module. Notably, the update adds managed -memory support to the :ref:`NVECTOR_RAJA <NVectors.RAJA>` module. Users of the -module will need to update any calls to the :c:func:`N_VMake_Raja` function -because that signature was changed. This module remains experimental and is -subject to change from version to version. - -The :ref:`NVECTOR_TRILINOS <NVectors.NVTrilinos>` module has been updated to -work with Trilinos 12.18+. This update changes the local ordinal type to always -be an ``int``. - -Added support for CUDA v11. - -Changes in v5.3.0 ------------------ - -Fixed a bug in the iterative linear solver modules where an error is not -returned if the ATimes function is ``NULL`` or, if preconditioning is enabled, -the PSolve function is ``NULL``. - -Added a new function :c:func:`IDAGetNonlinearSystemData` which advanced users -might find useful if providing a custom :c:type:`SUNNonlinSolSysFn`. - -Added the ability to control the CUDA kernel launch parameters for the -:ref:`NVECTOR_CUDA <NVectors.CUDA>` and -:ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` modules. These modules remain -experimental and are subject to change from version to version. In addition, -the :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels were rewritten to be more -flexible. Most users should see equivalent performance or some improvement, but -a select few may observe minor performance degradation with the default -settings. Users are encouraged to contact the SUNDIALS team about any -performance changes that they notice. - -Added new capabilities for monitoring the solve phase in the -:ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -and :ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>` modules, and the -SUNDIALS iterative linear solver modules. SUNDIALS must be built with the CMake -option :cmakeop:`SUNDIALS_BUILD_WITH_MONITORING` to use these capabilities. - -Added the optional function :c:func:`IDASetJacTimesResFn` to specify an -alternative residual function for computing Jacobian-vector products with the -internal difference quotient approximation. - -Changes in v5.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the -IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler -it is recommended to set :cmakeop:`CMAKE_Fortran_COMPILER` to ``f2003``, -``xlf2003``, or ``xlf2003_r``. - -Fixed a linkage bug affecting Windows users that stemmed from -dllimport/dllexport attributes missing on some SUNDIALS API functions. - -Added a new ``SUNMatrix`` implementation, :ref:`SUNMATRIX_CUSPARSE -<SUNMatrix.cuSparse>`, that interfaces to the sparse matrix implementation from -the NVIDIA cuSPARSE library. In addition, the :ref:`SUNLINSOL_CUSOLVER_BATCHQR -<SUNLinSol.cuSolverSp>` linear solver has been updated to use this matrix, -therefore, users of this module will need to update their code. These modules -are still considered to be experimental, thus they are subject to breaking -changes even in minor releases. - -The function :c:func:`IDASetLinearSolutionScaling` was added to enable or -disable the scaling applied to linear system solutions with matrix-based linear -solvers to account for a lagged value of :math:`\alpha` in the linear system -matrix :math:`J = \frac{\partial F}{\partial y} + \alpha\frac{\partial -F}{\partial \dot{y}}`. Scaling is enabled by default when using a matrix-based -linear solver. - -Changes in v5.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake variables -:cmakeop:`PETSC_INCLUDES` and :cmakeop:`PETSC_LIBRARIES` instead of -:cmakeop:`PETSC_DIR`. - -Added a new build system option, :cmakeop:`CUDA_ARCH`, that can be used to -specify the CUDA architecture to compile for. - -Added two utility functions, :f:func:`FSUNDIALSFileOpen` and -:f:subr:`FSUNDIALSFileClose` for creating/destroying file pointers that are -useful when using the Fortran 2003 interfaces. - -Changes in v5.0.0 ------------------ - -Build system changes -^^^^^^^^^^^^^^^^^^^^ - -* Increased the minimum required CMake version to 3.5 for most SUNDIALS - configurations, and 3.10 when CUDA or OpenMP with device offloading are - enabled. - -* The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been - removed to simplify builds as SUNDIALS packages do not use BLAS directly. For - third party libraries that require linking to BLAS, the path to the BLAS - library should be included in the ``*_LIBRARIES`` variable for the third party - library *e.g.*, :cmakeop:`SUPERLUDIST_LIBRARIES` when enabling SuperLU_DIST. - -* Fixed a bug in the build system that prevented the - :ref:`NVECTOR_PTHREADS <NVectors.Pthreads>` module from being built. - -NVECTOR module changes -^^^^^^^^^^^^^^^^^^^^^^ - -* Two new functions were added to aid in creating custom ``N_Vector`` - objects. The constructor :c:func:`N_VNewEmpty` allocates an "empty" generic - ``N_Vector`` with the object’s content pointer and the function pointers in - the operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any new - optional operations to the ``N_Vector`` API by ensuring only required - operations need to be set. Additionally, the function :c:func:`N_VCopyOps` - has been added to copy the operation function pointers between vector - objects. When used in clone routines for custom vector objects these functions - also will ease the introduction of any new optional operations to the - ``N_Vector`` API by ensuring all operations are copied when cloning - objects. See :numref:`NVectors.Description.utilities` for more details. - -* Two new ``N_Vector`` implementations, - :ref:`NVECTOR_MANYVECTOR <NVectors.ManyVector>` and - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>`, have been created to - support flexible partitioning of solution data among different processing - elements (e.g., CPU + GPU) or for multi-physics problems that couple distinct - MPI-based simulations together. This implementation is accompanied by - additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.ManyVector` and :numref:`NVectors.MPIManyVector` for more - details. - -* One new required vector operation and ten new optional vector operations have - been added to the ``N_Vector`` API. The new required operation, - :c:func:`N_VGetLength`, returns the global length of an ``N_Vector``. The - optional operations have been added to support the new - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>` implementation. The - operation :c:func:`N_VGetCommunicator` must be implemented by subvectors that - are combined to create an - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>`, but is not used outside - of this context. The remaining nine operations are optional local reduction - operations intended to eliminate unnecessary latency when performing vector - reduction operations (norms, etc.) on distributed memory systems. The optional - local reduction vector operations are :c:func:`N_VDotProdLocal`, - :c:func:`N_VMaxNormLocal`, :c:func:`N_VMinLocal`, :c:func:`N_VL1NormLocal`, - :c:func:`N_VWSqrSumLocal`, :c:func:`N_VWSqrSumMaskLocal`, - :c:func:`N_VInvTestLocal`, :c:func:`N_VConstrMaskLocal`, and - :c:func:`N_VMinQuotientLocal`. If an ``N_Vector`` implementation defines any - of the local operations as ``NULL``, then the - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>` will call standard - ``N_Vector`` operations to complete the computation. See - :numref:`NVectors.Ops.Local` for more details. - -* An additional ``N_Vector`` implementation, :ref:`NVECTOR_MPIPLUSX - <NVectors.MPIPlusX>`, has been created to support the MPI+X paradigm where X - is a type of on-node parallelism (*e.g.*, OpenMP, CUDA). The implementation is - accompanied by additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.MPIPlusX` for more details. - -* The ``*_MPICuda`` and ``*_MPIRaja`` functions have been removed from the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` and :ref:`NVECTOR_RAJA <NVectors.RAJA>` - implementations respectively. Accordingly, the ``nvector_mpicuda.h``, - ``nvector_mpiraja.h``, ``libsundials_nvecmpicuda.lib``, and - ``libsundials_nvecmpicudaraja.lib`` files have been removed. Users should use - the :ref:`NVECTOR_MPIPLUSX <NVectors.MPIPlusX>` module coupled in conjunction - with the :ref:`NVECTOR_CUDA <NVectors.CUDA>` or :ref:`NVECTOR_RAJA - <NVectors.RAJA>` modules to replace the functionality. The necessary changes - are minimal and should require few code modifications. See the programs in - ``examples/ida/mpicuda`` and ``examples/ida/mpiraja`` for examples of how to - use the :ref:`NVECTOR_MPIPLUSX <NVectors.MPIPlusX>` module with the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` and :ref:`NVECTOR_RAJA <NVectors.RAJA>` - modules respectively. - -* Fixed a memory leak in the :ref:`NVECTOR_PETSC <NVectors.NVPETSc>` module - clone function. - -* Made performance improvements to the :ref:`NVECTOR_CUDA <NVectors.CUDA>` - module. Users who utilize a non-default stream should no longer see default - stream synchronizations after memory transfers. - -* Added a new constructor to the :ref:`NVECTOR_CUDA <NVectors.CUDA>` module that - allows a user to provide custom allocate and free functions for the vector - data array and internal reduction buffer. See :numref:`NVectors.CUDA` for more - details. - -* Added new Fortran 2003 interfaces for most ``N_Vector`` modules. See - :numref:`NVectors` for more details on how to use the interfaces. - -* Added three new ``N_Vector`` utility functions, - :c:func:`FN_VGetVecAtIndexVectorArray`, - :c:func:`FN_VSetVecAtIndexVectorArray`, and :c:func:`FN_VNewVectorArray`, for - working with ``N_Vector`` arrays when using the Fortran 2003 interfaces. See - :numref:`NVectors.Description.utilities` for more details. - -SUNMatrix module changes -^^^^^^^^^^^^^^^^^^^^^^^^ - -* Two new functions were added to aid in creating custom ``SUNMatrix`` - objects. The constructor :c:func:`SUNMatNewEmpty` allocates an "empty" generic - ``SUNMatrix`` with the object’s content pointer and the function pointers in - the operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any new - optional operations to the ``SUNMatrix`` API by ensuring only required - operations need to be set. Additionally, the function :c:func:`SUNMatCopyOps` - has been added to copy the operation function pointers between matrix - objects. When used in clone routines for custom matrix objects these functions - also will ease the introduction of any new optional operations to the - ``SUNMatrix`` API by ensuring all operations are copied when cloning - objects. See :numref:`SUNMatrix.Description` for more details. - -* A new operation, :c:func:`SUNMatMatvecSetup`, was added to the ``SUNMatrix`` - API to perform any setup necessary for computing a matrix-vector product. This - operation is useful for ``SUNMatrix`` implementations which need to prepare - the matrix itself, or communication structures before performing the - matrix-vector product. Users who have implemented custom ``SUNMatrix`` modules - will need to at least update their code to set the corresponding ``ops`` - structure member, ``matvecsetup``, to ``NULL``. See - :numref:`SUNMatrix.Description` for more details. - -* The generic ``SUNMatrix`` API now defines error codes to be returned by - ``SUNMatrix`` operations. Operations which return an integer flag indicating - success/failure may return different values than previously. - -* A new ``SUNMatrix`` (and ``SUNLinearSolver``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNMatrix.SLUNRloc` for more details. - -* Added new Fortran 2003 interfaces for most ``SUNMatrix`` modules. See - :numref:`SUNMatrix` for more details on how to use the interfaces. - -SUNLinearSolver module changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* A new function was added to aid in creating custom ``SUNLinearSolver`` - objects. The constructor :c:func:`SUNLinSolNewEmpty` allocates an "empty" - generic ``SUNLinearSolver`` with the object’s content pointer and the function - pointers in the operations structure initialized to ``NULL``. When used in the - constructor for custom objects this function will ease the introduction of any - new optional operations to the ``SUNLinearSolver`` API by ensuring only - required operations need to be set. See :numref:`SUNLinSol.API.Custom` for - more details. - -* The return type of the ``SUNLinearSolver`` API function - :c:func:`SUNLinSolLastFlag` has changed from ``long int`` to ``sunindextype`` - to be consistent with the type used to store row indices in dense and banded - linear solver modules. - -* Added a new optional operation to the ``SUNLinearSolver`` API, - :c:func:`SUNLinSolGetID`, that returns a ``SUNLinearSolver_ID`` for - identifying the linear solver module. - -* The ``SUNLinearSolver`` API has been updated to make the initialize and setup - functions optional. - -* A new ``SUNLinearSolver`` (and ``SUNMatrix``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNLinSol.SuperLUDIST` for more details. - -* Added a new ``SUNLinearSolver`` implementation, - SUNLinearSolver_cuSolverSp_batchQR, which leverages the NVIDIA cuSOLVER sparse - batched QR method for efficiently solving block diagonal linear systems on - NVIDIA GPUs. See :numref:`SUNLinSol.cuSolverSp` for more details. - -* Added three new accessor functions to the SUNLINSOL_KLU module, - :c:func:`SUNLinSol_KLUGetSymbolic`, :c:func:`SUNLinSol_KLUGetNumeric`, and - :c:func:`SUNLinSol_KLUGetCommon`, to provide user access to the underlying KLU - solver structures. See :numref:`SUNLinSol.KLU` for more details. - -* Added new Fortran 2003 interfaces for most ``SUNLinearSolver`` modules. See - :numref:`SUNLinSol` for more details on how to use the interfaces. - -SUNNonlinearSolver module changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolNewEmpty` allocates an "empty" - generic ``SUNNonlinearSolver`` with the object’s content pointer and the - function pointers in the operations structure initialized to ``NULL``. When - used in the constructor for custom objects this function will ease the - introduction of any new optional operations to the ``SUNNonlinearSolver`` API - by ensuring only required operations need to be set. See - :numref:`SUNNonlinSol.API.Custom` for more details. - -* To facilitate the use of user supplied nonlinear solver convergence test - functions the :c:type:`SUNNonlinSolSetConvTestFn` function in the - ``SUNNonlinearSolver`` API has been updated to take a ``void*`` data pointer - as input. The supplied data pointer will be passed to the nonlinear solver - convergence test function on each call. - -* The inputs values passed to the first two inputs of the - :c:func:`SUNNonlinSolSolve` function in the ``SUNNonlinearSolver`` have been - changed to be the predicted state and the initial guess for the correction to - that state. Additionally, the definitions of :c:type:`SUNNonlinSolLSetupFn` - and :c:type:`SUNNonlinSolLSolveFn` in the ``SUNNonlinearSolver`` API have been - updated to remove unused input parameters. For more information see - :numref:`SUNNonlinSol`. - -* Added a new ``SUNNonlinearSolver`` implementation, - :ref:`SUNNONLINSOL_PETSC <SUNNonlinSol.PetscSNES>`, which interfaces to the - PETSc SNES nonlinear solver API. See :numref:`SUNNonlinSol.PetscSNES` for more - details. - -* Added new Fortran 2003 interfaces for most ``SUNNonlinearSolver`` modules. See - :numref:`SUNNonlinSol` for more details on how to use the interfaces. - -IDA changes -^^^^^^^^^^^ - -* A bug was fixed in the IDA linear solver interface where an incorrect - Jacobian-vector product increment was used with iterative solvers other than - :ref:`SUNLINSOL_SPGMR <SUNLinSol.SPGMR>` and - :ref:`SUNLINSOL_SPFGMR <SUNLinSol.SPFGMR>`. - -* Fixed a memeory leak in FIDA when not using the default nonlinear solver. - -* Removed extraneous calls to :c:func:`N_VMin` for simulations where the scalar - valued absolute tolerance, or all entries of the vector-valued absolute - tolerance array, are strictly positive. In this scenario, IDA will remove at - least one global reduction per time step. - -* The IDALS interface has been updated to only zero the Jacobian matrix before - calling a user-supplied Jacobian evaluation function when the attached linear - solver has type ``SUNLINEARSOLVER_DIRECT``. - -* Added the new functions, :c:func:`IDAGetCurrentCj`, :c:func:`IDAGetCurrentY`, - :c:func:`IDAGetCurrentYp`, :c:func:`IDAComputeY`, and :c:func:`IDAComputeYp` - which may be useful to users who choose to provide their own nonlinear solver - implementations. - -* Added a Fortran 2003 interface to IDA. See :numref:`SUNDIALS.Fortran` for more - details. - -Changes in v4.1.0 ------------------ - -An additional ``N_Vector`` implementation was added for the TPETRA vector from -the TRILINOS library to facilitate interoperability between SUNDIALS and -TRILINOS. This implementation is accompanied by additions to user documentation -and SUNDIALS examples. - -A bug was fixed where a nonlinear solver object could be freed twice in some use -cases. - -The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option -:cmakeop:`EXAMPLES_ENABLE_CUDA` enables all examples that use CUDA including the -RAJA examples with a CUDA back end (if the RAJA ``N_Vector`` is enabled). - -The implementation header file ``ida_impl.h`` is no longer installed. This means -users who are directly manipulating the ``IDAMem`` structure will need to update -their code to use IDA’s public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Changes in v4.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a contributing agreement. - -Moved definitions of DLS and SPILS backwards compatibility functions to a source -file. The symbols are now included in the IDA library, ``libsundials_ida``. - -Changes in v4.0.1 ------------------ - -No changes were made in this release. - -Changes in v4.0.0 ------------------ - -IDA’s previous direct and iterative linear solver interfaces, IDADLS and -IDASPILS, have been merged into a single unified linear solver interface, IDALS, -to support any valid ``SUNLinearSolver`` module. This includes the "DIRECT" and -"ITERATIVE" types as well as the new "MATRIX_ITERATIVE" type. Details regarding -how IDALS utilizes linear solvers of each type as well as discussion regarding -intended use cases for user-supplied ``SUNLinearSolver`` implementations are -included in :numref:`SUNLinSol`. All IDA example programs and the standalone -linear solver examples have been updated to use the unified linear solver -interface. - -The unified interface for the new IDALS module is very similar to the previous -IDADLS and IDASPILS interfaces. To minimize challenges in user migration to the -new names, the previous C and Fortran routine names may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. Additionally, we note that Fortran users, however, may need to -enlarge their ``iout`` array of optional integer outputs, and update the indices -that they query for certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided ``SUNLinearSolver`` -implementations have been updated to follow the naming convention ``SUNLinSol_`` -where ``*`` is the name of the linear solver. The new names are -:c:func:`SUNLinSol_Band`, :c:func:`SUNLinSol_Dense`, :c:func:`SUNLinSol_KLU`, -:c:func:`SUNLinSol_LapackBand`, :c:func:`SUNLinSol_LapackDense`, -:c:func:`SUNLinSol_PCG`, :c:func:`SUNLinSol_SPBCGS`, :c:func:`SUNLinSol_SPFGMR`, -:c:func:`SUNLinSol_SPGMR`, :c:func:`SUNLinSol_SPTFQMR`, and -:c:func:`SUNLinSol_SuperLUMT`. Solver-specific "set" routine names have been -similarly standardized. To minimize challenges in user migration to the new -names, the previous routine names may still be used; these will be deprecated in -future releases, so we recommend that users migrate to the new names soon. All -IDA example programs and the standalone linear solver examples have been updated -to use the new naming convention. - -The ``SUNBandMatrix`` constructor has been simplified to remove the storage -upper bandwidth argument. - -SUNDIALS integrators have been updated to utilize generic nonlinear solver -modules defined through the ``SUNNonlinearSolver`` API. This API will ease the -addition of new nonlinear solver options and allow for external or user-supplied -nonlinear solvers. The ``SUNNonlinearSolver`` API and SUNDIALS provided modules -are described in :numref:`SUNNonlinSol` and follow the same object oriented -design and implementation used by the ``N_Vector``, ``SUNMatrix``, and -``SUNLinearSolver`` modules. Currently two ``SUNNonlinearSolver`` -implementations are provided, :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -and -:ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>`. These replicate the -previous integrator specific implementations of a Newton iteration and a -fixed-point iteration (previously referred to as a functional iteration), -respectively. Note the :ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>` -module can optionally utilize Anderson’s method to accelerate -convergence. Example programs using each of these nonlinear solver modules in a -standalone manner have been added and all IDA example programs have been updated -to use generic ``SUNNonlinearSolver`` modules. - -By default IDA uses the :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -module. Since IDA previously only used an internal implementation of a Newton -iteration no changes are required to user programs and functions for setting the -nonlinear solver options (e.g., :c:func:`IDASetMaxNonlinIters`) or getting -nonlinear solver statistics (e.g., :c:func:`IDAGetNumNonlinSolvIters`) remain -unchanged and internally call generic ``SUNNonlinearSolver`` functions as -needed. While SUNDIALS includes a fixed-point nonlinear solver module, it is not -currently supported in IDA. For details on attaching a user-supplied nonlinear -solver to IDA see :numref:IDA.Usage.CC. Additionally, the example program -``idaRoberts_dns.c`` explicitly creates an attaches a :ref:`SUNNONLINSOL_NEWTON -<SUNNonlinSol.Newton>` object to demonstrate the process of creating and -attaching a nonlinear solver module (note this is not necessary in general as -IDA uses the :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` module by -default). - -Three fused vector operations and seven vector array operations have been added -to the ``N_Vector`` API. These *optional* operations are disabled by default and -may be activated by calling vector specific routines after creating an -``N_Vector`` (see :numref:`NVectors` for more details). The new operations are -intended to increase data reuse in vector operations, reduce parallel -communication on distributed memory systems, and lower the number of kernel -launches on systems with accelerators. The fused operations are -:c:func:`N_VLinearCombination`, :c:func:`N_VScaleAddMulti`, and -:c:func:`N_VDotProdMulti` and the vector array operations are -:c:func:`N_VLinearCombinationVectorArray`, :c:func:`N_VScaleVectorArray`, -:c:func:`N_VConstVectorArray`, :c:func:`N_VWrmsNormVectorArray`, -:c:func:`N_VWrmsNormMaskVectorArray`, :c:func:`N_VScaleAddMultiVectorArray`, and -:c:func:`N_VLinearCombinationVectorArray`. - -If an ``N_Vector`` implementation defines any of these operations as ``NULL``, -then standard ``N_Vector`` operations will automatically be called as necessary -to complete the computation. - -Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: - -* Changed ``N_VGetLength_Cuda`` to return the global vector length instead - of the local vector length. - -* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. - -* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``suncudavec``. - -* Changed the :c:func:`N_VMake_Cuda` function to take a host data pointer and a - device data pointer instead of an ``N_VectorContent_Cuda`` object. - -* Added the ability to set the ``cudaStream_t`` used for execution of the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels. See the function - ``N_VSetCudaStreams_Cuda``. - -* Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and - :c:func:`N_VIsManagedMemory_Cuda` functions to accommodate using managed - memory with the :ref:`NVECTOR_CUDA <NVectors.CUDA>`. - -Multiple changes to :ref:`NVECTOR_RAJA <NVectors.RAJA>` were made: - -* Changed ``N_VGetLength_Raja`` to return the global vector length instead - of the local vector length. - -* Added ``N_VGetLocalLength_Raja`` to return the local vector length. - -* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``suncudavec``. - -A new ``N_Vector`` implementation for leveraging OpenMP 4.5+ device offloading -has been added, :ref:`NVECTOR_OPENMPDEV <NVectors.OpenMPDEV>`. See -:numref:`NVectors.OpenMPDEV` for more details. - -Changes in v3.2.1 ------------------ - -The changes in this minor release include the following: - -* Fixed a bug in the :ref:`CUDA N_Vector <NVectors.CUDA>` where the - :c:func:`N_VInvTest` operation could write beyond the allocated vector data. - -* Fixed library installation path for multiarch systems. This fix changes the - default library installation path to - ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` from - ``CMAKE_INSTALL_PREFIX/lib``. Note :cmakeop:`CMAKE_INSTALL_LIBDIR` is - automatically set, but is available as a CMake option that can be modified. - -Changes in v3.2.0 ------------------ - -Fixed a problem with setting ``sunindextype`` which would occur with some -compilers (e.g. armclang) that did not define ``__STDC_VERSION__``. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than one MPI -rank when using a GPU system. The vectors assume one GPU device per MPI rank. - -Changed the name of the RAJA ``N_Vector`` library to -``libsundials_nveccudaraja.lib`` from ``libsundials_nvecraja.lib`` to better -reflect that we only support CUDA as a backend for RAJA currently. - -Several changes were made to the build system: - -* CMake 3.1.3 is now the minimum required CMake version. - -* Deprecate the behavior of the :cmakeop:`SUNDIALS_INDEX_TYPE` CMake option and - added the :cmakeop:`SUNDIALS_INDEX_SIZE` CMake option to select the - ``sunindextype`` integer size. - -* The native CMake FindMPI module is now used to locate an MPI installation. - -* If MPI is enabled and MPI compiler wrappers are not set, the build system will - check if ``CMAKE_<language>_COMPILER`` can compile MPI programs before trying - to locate and use an MPI installation. - -* The previous options for setting MPI compiler wrappers and the executable for - running MPI programs have been have been depreated. The new options that align - with those used in native CMake FindMPI module are :cmakeop:`MPI_C_COMPILER`, - :cmakeop:`MPI_CXX_COMPILER`, :cmakeop:`MPI_Fortran_COMPILER`, and - :cmakeop:`MPIEXEC_EXECUTABLE`. - -* When a Fortran name-mangling scheme is needed (e.g., :cmakeop:`ENABLE_LAPACK` - is ``ON``) the build system will infer the scheme from the Fortran compiler. - If a Fortran compiler is not available or the inferred or default scheme needs - to be overridden, the advanced options :cmakeop:`SUNDIALS_F77_FUNC_CASE` and - :cmakeop:`SUNDIALS_F77_FUNC_UNDERSCORES` can be used to manually set the - name-mangling scheme and bypass trying to infer the scheme. - -* Parts of the main CMakeLists.txt file were moved to new files in the ``src`` - and ``example`` directories to make the CMake configuration file structure - more modular. - -Changes in v3.1.2 ------------------ - -The changes in this minor release include the following: - -* Updated the minimum required version of CMake to 2.8.12 and enabled using - rpath by default to locate shared libraries on OSX. - -* Fixed Windows specific problem where ``sunindextype`` was not correctly - defined when using 64-bit integers for the SUNDIALS index type. On Windows - ``sunindextype`` is now defined as the MSVC basic type ``__int64``. - -* Added sparse SUNMatrix "Reallocate" routine to allow specification of the - nonzero storage. - -* Updated the KLU SUNLinearSolver module to set constants for the two - reinitialization types, and fixed a bug in the full reinitialization approach - where the sparse SUNMatrix pointer would go out of scope on some - architectures. - -* Updated the :c:func:`SUNMatScaleAdd` and :c:func:`SUNMatScaleAddI` - implementations in the sparse SUNMatrix module to more optimally handle the - case where the target matrix contained sufficient storage for the sum, but had - the wrong sparsity pattern. The sum now occurs in-place, by performing the sum - backwards in the existing storage. However, it is still more efficient if the - user-supplied Jacobian routine allocates storage for the sum - :math:`I+\gamma J` manually (with zero entries if needed). - -* Changed the LICENSE install path to ``instdir/include/sundials``. - -Changes in v3.1.1 ------------------ - -The changes in this minor release include the following: - -* Fixed a potential memory leak in the :ref:`SUNLINSOL_SPGMR <SUNLinSol.SPGMR>` - and :ref:`SUNLINSOL_SPFGMR <SUNLinSol.SPFGMR>` linear solvers: if - "Initialize" was called multiple times then the solver memory was reallocated - (without being freed). - -* Updated KLU ``SUNLinearSolver`` module to use a ``typedef`` for the - precision-specific solve function to be used (to avoid compiler warnings). - -* Added missing typecasts for some ``(void*)`` pointers (again, to avoid - compiler warnings). - -* Bugfix in ``sunmatrix_sparse.c`` where we had used ``int`` instead of - ``sunindextype`` in one location. - -* Added missing ``#include <stdio.h>`` in ``N_Vector`` and ``SUNMatrix`` header - files. - -* Added missing prototype for :c:func:`IDASpilsGetNumJTSetupEvals`. - -* Fixed an indexing bug in the CUDA ``N_Vector`` implementation of - :c:func:`N_VWrmsNormMask` and revised the RAJA ``N_Vector`` implementation of - :c:func:`N_VWrmsNormMask` to work with mask arrays using values other than - zero or one. Replaced ``double`` with ``realtype`` in the RAJA vector test - functions. - -* Fixed compilation issue with GCC 7.3.0 and Fortran programs that do not - require a ``SUNMatrix`` module (e.g., iterative linear solvers). - -In addition to the changes above, minor corrections were also made to the -example programs, build system, and user documentation. - -Changes in v3.1.0 ------------------ - -Added ``N_Vector`` print functions that write vector data to a specified file -(e.g., :c:func:`N_VPrintFile_Serial`). - -Added ``make test`` and ``make test_install`` options to the build system for -testing SUNDIALS after building with ``make`` and installing with ``make -install`` respectively. - -Changes in v3.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been reworked, and -all example programs have been updated. The goal of the redesign of these -interfaces was to provide more encapsulation and to ease interfacing of custom -linear solvers and interoperability with linear solver libraries. Specific -changes include: - -* Added generic ``SUNMatrix`` module with three provided implementations: dense, - banded, and sparse. These replicate previous SUNDIALS Dls and Sls matrix - structures in a single object-oriented API. - -* Added example problems demonstrating use of generic ``SUNMatrix`` modules. - -* Added generic ``SUNLinearSolver`` module with eleven provided implementations: - SUNDIALS native dense, SUNDIALS native banded, LAPACK dense, LAPACK band, KLU, - SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, and PCG. These replicate previous - SUNDIALS generic linear solvers in a single object-oriented API. - -* Added example problems demonstrating use of generic ``SUNLinearSolver`` - modules. - -* Expanded package-provided direct linear solver (Dls) interfaces and scaled, - preconditioned, iterative linear solver (Spils) interfaces to utilize generic - ``SUNMatrix`` and ``SUNLinearSolver`` objects. - -* Removed package-specific, linear solver-specific, solver modules - (e.g. ``CVDENSE``, ``KINBAND``, ``IDAKLU``, ``ARKSPGMR``) since their - functionality is entirely replicated by the generic Dls/Spils interfaces and - ``SUNLinearSolver`` and ``SUNMatrix`` modules. The exception is ``CVDIAG``, a - diagonal approximate Jacobian solver available to CVODE and CVODES. - -* Converted all SUNDIALS example problems and files to utilize the new generic - ``SUNMatrix`` and ``SUNLinearSolver`` objects, along with updated Dls and - Spils linear solver interfaces. - -* Added Spils interface routines to ARKODE, CVODE, CVODES, IDA, and IDAS to - allow specification of a user-provided "JTSetup" routine. This change - supports users who wish to set up data structures for the user-provided - Jacobian-times-vector ("JTimes") routine, and where the cost of one JTSetup - setup per Newton iteration can be amortized between multiple JTimes calls. - -Two additional ``N_Vector`` implementations were added – one for CUDA and one -for RAJA vectors. These vectors are supplied to provide very basic support for -running on GPU architectures. Users are advised that these vectors both move all -data to the GPU device upon construction, and speedup will only be realized if -the user also conducts the right-hand-side or residual function evaluation on -the device. In addition, these vectors assume the problem fits on one GPU. -For further information about RAJA, users are referred to the web site, -https://software.llnl.gov/RAJA/. These additions are accompanied by updates -to various interface functions and to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` that can -be configured to be a 32- or 64-bit integer data index type. ``sunindextype`` -is defined to be ``int32_t`` or ``int64_t`` when portable types are supported, -otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces -continue to use ``long int`` for indices, except for their sparse matrix -interface that now uses the new ``sunindextype``. This new flexible capability -for index types includes interfaces to PETSc, hypre, SuperLU_MT, and KLU with -either 32-bit or 64-bit capabilities depending how the user configures SUNDIALS. - -To avoid potential namespace conflicts, the macros defining ``booleantype`` -values ``TRUE`` and ``FALSE`` have been changed to ``SUNTRUE`` and ``SUNFALSE`` -respectively. - -Temporary vectors were removed from preconditioner setup and solve routines for -all packages. It is assumed that all necessary data for user-provided -preconditioner operations will be allocated and stored in user-provided data -structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS -type information for use in Fortran programs. - -The build system was expanded to support many of the xSDK-compliant keys. The -xSDK is a movement in scientific software to provide a foundation for the rapid -and efficient production of high-quality, sustainable extreme-scale scientific -applications. More information can be found at, https://xsdk.info. - -Added functions :c:func:`SUNDIALSGetVersion` and -:c:func:`SUNDIALSGetVersionNumber` to get SUNDIALS release version information -at runtime. - -In addition, numerous changes were made to the build system. These include the -addition of separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` CMake variables, -additional error checking during CMake configuration, minor bug fixes, and -renaming CMake options to enable/disable examples for greater clarity and an -added option to enable/disable Fortran 77 examples. These changes included -changing ``EXAMPLES_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_C`, changing -``CXX_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_CXX`, changing ``F90_ENABLE`` to -:cmakeop:`EXAMPLES_ENABLE_F90`, and adding an :cmakeop:`EXAMPLES_ENABLE_F77` -option. - -A bug fix was done to add a missing prototype for :c:func:`IDASetMaxBacksIC` in -``ida.h``. - -Corrections and additions were made to the examples, to installation-related -files, and to the user documentation. - -Changes in v2.9.0 ------------------ - -Two additional ``N_Vector`` implementations were added – one for Hypre -(parallel) ParVector vectors, and one for PETSc vectors. These additions are -accompanied by additions to various interface functions and to user -documentation. - -Each ``N_Vector`` module now includes a function, :c:func:`N_VGetVectorID`, that -returns the ``N_Vector`` module name. - -An optional input function was added to set a maximum number of linesearch -backtracks in the initial condition calculation. Also, corrections were made to -three Fortran interface functions. - -For each linear solver, the various solver performance counters are now -initialized to 0 in both the solver specification function and in solver -``linit`` function. This ensures that these solver counters are initialized upon -linear solver instantiation as well as at the beginning of the problem solution. - -A memory leak was fixed in the banded preconditioner interface. In addition, -updates were done to return integers from linear solver and preconditioner -"free" functions. - -The Krylov linear solver Bi-CGstab was enhanced by removing a redundant dot -product. Various additions and corrections were made to the interfaces to the -sparse solvers KLU and SuperLU_MT, including support for CSR format when using -KLU. - -New examples were added for use of the OpenMP vector. - -Minor corrections and additions were made to the IDA solver, to the Fortran -interfaces, to the examples, to installation-related files, and to the user -documentation. - -Changes in v2.8.0 ------------------ - -Two major additions were made to the linear system solvers that are available -for use with the IDA solver. First, in the serial case, an interface to the -sparse direct solver KLU was added. Second, an interface to SuperLU_MT, the -multi-threaded version of SuperLU, was added as a thread-parallel sparse direct -solver option, to be used with the serial version of the ``N_Vector`` module. -As part of these additions, a sparse matrix (CSC format) structure was added to -IDA. - -Otherwise, only relatively minor modifications were made to IDA: - -In :c:func:`IDARootfind`, a minor bug was corrected, where the input array -``rootdir`` was ignored, and a line was added to break out of root-search loop -if the initial interval size is below the tolerance ``ttol``. - -In ``IDALapackBand``, the line ``smu = MIN(N-1,mu+ml)`` was changed to ``smu = -mu + ml`` to correct an illegal input error for ``DGBTRF/DGBTRS``. - -A minor bug was fixed regarding the testing of the input ``tstop`` on the first -call to :c:func:`IDASolve`. - -In order to avoid possible name conflicts, the mathematical macro and function -names ``MIN``, ``MAX``, ``SQR``, ``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and -``RPowerR`` were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, ``SUNRabs``, -``SUNRsqrt``, ``SUNRexp``, ``SRpowerI``, and ``SUNRpowerR``, respectively. -These names occur in both the solver and in various example programs. - -In the FIDA optional input routines ``FIDASETIIN``, ``FIDASETRIN``, and -``FIDASETVIN``, the optional fourth argument ``key_length`` was removed, with -hardcoded key string lengths passed to all ``strncmp`` tests. - -In all FIDA examples, integer declarations were revised so that those which must -match a C type ``long int`` are declared ``INTEGER*8``, and a comment was added -about the type match. All other integer declarations are just -``INTEGER``. Corresponding minor corrections were made to the user guide. - -Two new ``N_Vector`` modules have been added for thread-parallel computing -environments — one for OpenMP, denoted :ref:`NVECTOR_OPENMP <NVectors.OpenMP>`, -and one for Pthreads, denoted :ref:`NVECTOR_PTHREADS <NVectors.Pthreads>`. - -With this version of SUNDIALS, support and documentation of the Autotools mode -of installation is being dropped, in favor of the CMake mode, which is -considered more widely portable. - -Changes in v2.7.0 ------------------ - -One significant design change was made with this release: The problem size and -its relatives, bandwidth parameters, related internal indices, pivot arrays, and -the optional output ``lsflag`` have all been changed from type ``int`` to type -``long int``, except for the problem size and bandwidths in user calls to -routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The -function ``NewIntArray`` is replaced by a pair ``NewIntArray`` and -``NewLintArray``, for ``int`` and ``long int`` arrays, respectively. - -A large number of minor errors have been fixed. Among these are the following: -After the solver memory is created, it is set to zero before being filled. To -be consistent with IDAS, IDA uses the function ``IDAGetDky`` for optional output -retrieval. In each linear solver interface function, the linear solver memory -is freed on an error return, and the ``**Free`` function now includes a line -setting to NULL the main memory pointer to the linear solver memory. A memory -leak was fixed in two of the ``IDASp***Free`` functions. In the rootfinding -functions ``IDARcheck1`` and ``IDARcheck2``, when an exact zero is found, the -array ``glo`` of :math:`g` values at the left endpoint is adjusted, instead of -shifting the :math:`t` location ``tlo`` slightly. In the installation files, we -modified the treatment of the macro SUNDIALS_USE_GENERIC_MATH, so that the -parameter GENERIC_MATH_LIB is either defined (with no value) or not defined. - -Changes in v2.6.0 ------------------ - -Two new features were added in this release: (a) a new linear solver module, -based on BLAS and LAPACK for both dense and banded matrices, and (b) option to -specify which direction of zero-crossing is to be monitored while performing -rootfinding. - -The user interface has been further refined. Some of the API changes involve: -(a) a reorganization of all linear solver modules into two families (besides the -already present family of scaled preconditioned iterative linear solvers, the -direct solvers, including the new LAPACK-based ones, were also organized into a -*direct* family); (b) maintaining a single pointer to user data, optionally -specified through a ``Set``-type function; (c) a general streamlining of the -band-block-diagonal preconditioner module distributed with the solver. - -Changes in v2.5.0 ------------------ - -The main changes in this release involve a rearrangement of the entire SUNDIALS -source tree (see :numref:`IDA.Organization`). At the user interface level, the main -impact is in the mechanism of including SUNDIALS header files which must now -include the relative path (e.g. ``#include <cvode/cvode.h>``). Additional -changes were made to the build system: all exported header files are now -installed in separate subdirectories of the installation *include* directory. - -A bug was fixed in the internal difference-quotient dense and banded Jacobian -approximations, related to the estimation of the perturbation (which could have -led to a failure of the linear solver when zero components with sufficiently -small absolute tolerances were present). - -The user interface to the consistent initial conditions calculations was -modified. The :c:func:`IDACalcIC` arguments ``t0``, ``yy0``, and ``yp0`` were -removed and a new function, :c:func:`IDAGetConsistentIC` is provided. - -The functions in the generic dense linear solver (``sundials_dense`` and -``sundials_smalldense``) were modified to work for rectangular :math:`m \times -n` matrices (:math:`m \le n`), while the factorization and solution functions -were renamed to ``DenseGETRF / denGETRF`` and ``DenseGETRS / denGETRS``, -respectively. The factorization and solution functions in the generic band -linear solver were renamed ``BandGBTRF`` and ``BandGBTRS``, respectively. - -Changes in v2.4.0 ------------------ - -FIDA, a Fortran-C interface module, was added. - -IDASPBCG and IDASPTFQMR modules have been added to interface with the Scaled -Preconditioned Bi-CGstab (SPBCG) and Scaled Preconditioned Transpose-Free -Quasi-Minimal Residual (SPTFQMR) linear solver modules, respectively (for -details see :numref:IDA.Usage.CC). At the same time, function type names for Scaled -Preconditioned Iterative Linear Solvers were added for the user-supplied -Jacobian-times-vector and preconditioner setup and solve functions. - -The rootfinding feature was added, whereby the roots of a set of given functions -may be computed during the integration of the DAE system. - -A user-callable routine was added to access the estimated local error vector. - -The deallocation functions now take as arguments the address of the respective -memory block pointer. - -To reduce the possibility of conflicts, the names of all header files have been -changed by adding unique prefixes (``ida_`` and ``sundials_``). When using the -default installation procedure, the header files are exported under various -subdirectories of the target ``include`` directory. For more details see -Appendix :numref:`Installation`. - -Changes in v2.3.0 ------------------ - -The user interface has been further refined. Several functions used for setting -optional inputs were combined into a single one. An optional user-supplied -routine for setting the error weight vector was added. Additionally, to resolve -potential variable scope issues, all SUNDIALS solvers release user data right -after its use. The build systems has been further improved to make it more -robust. - -Changes in v2.2.2 ------------------ - -Minor corrections and improvements were made to the build system. A new chapter -in the User Guide was added — with constants that appear in the user interface. - -Changes in v2.2.1 ------------------ - -The changes in this minor SUNDIALS release affect only the build system. - -Changes in v2.2.0 ------------------ - -The major changes from the previous version involve a redesign of the user -interface across the entire SUNDIALS suite. We have eliminated the mechanism of -providing optional inputs and extracting optional statistics from the solver -through the ``iopt`` and ``ropt`` arrays. Instead, IDA now provides a set of -routines (with prefix ``IDASet``) to change the default values for various -quantities controlling the solver and a set of extraction routines (with prefix -``IDAGet``) to extract statistics after return from the main solver routine. -Similarly, each linear solver module provides its own set of ``Set``- and -``Get``-type routines. For more details see :numref:`IDA.Usage.CC.optional_output`. - -Additionally, the interfaces to several user-supplied routines (such as those -providing Jacobians and preconditioner information) were simplified by reducing -the number of arguments. The same information that was previously accessible -through such arguments can now be obtained through ``Get``-type functions. - -Installation of IDA (and all of SUNDIALS) has been completely redesigned and is -now based on configure scripts. .. _IDA.Introduction.Reading: diff --git a/doc/ida/guide/source/RecentChanges_link.rst b/doc/ida/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/ida/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/ida/guide/source/conf.py b/doc/ida/guide/source/conf.py index 2dc3a41a63..847aabc2da 100644 --- a/doc/ida/guide/source/conf.py +++ b/doc/ida/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/ida/guide/source/index.rst b/doc/ida/guide/source/index.rst index 61eefa79fc..572bcdd863 100644 --- a/doc/ida/guide/source/index.rst +++ b/doc/ida/guide/source/index.rst @@ -38,6 +38,7 @@ IDA Documentation sundials/Install_link.rst Constants History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/idas/guide/source/Changelog_link.rst b/doc/idas/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/idas/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index ebdcb5fa82..8a1bb7ff2a 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -83,1820 +83,12 @@ integrate any final-condition ODE dependent on the solution of the original IVP the greater ease of interfacing the solver to applications written in extended Fortran. -Changes from previous versions -============================== +Changes to SUNDIALS in release X.Y.Z +==================================== -Changes in vX.X.X ------------------- +.. include:: ../../../shared/RecentChanges.rst -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). - -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - - -Changes in v6.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the functions -``IDASetErrFile`` and ``IDASetHandlerErrFn`` have been removed. Users of these -functions can use the functions :c:func:`SUNContext_PushErrHandler`, and -:c:func:`SUNLogger_SetErrorFilename` instead. For further details see Sections -:numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -*Fortran Interface Modules Streamlined* - -We have streamlined the Fortran modules that need to be included by users by combining -the SUNDIALS core into one Fortran module, ``fsundials_core_mod``. Modules for -implementations of the core APIs still exist (e.g., for the Dense linear solver there -is ``fsunlinsol_dense_mod``) as do the modules for the SUNDIALS packages (e.g., ``fcvode_mod``). -The following modules are the ones that have been consolidated into ``fsundials_core_mod``: - -.. code-block:: - - fsundials_adaptcontroller_mod - fsundials_context_mod - fsundials_futils_mod - fsundials_linearsolver_mod - fsundials_logger_mod - fsundials_matrix_mod - fsundials_nonlinearsolver_mod - fsundials_nvector_mod - fsundials_profiler_mod - fsundials_types_mod - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be -deprecated -- users who rely on these are recommended to transition to the -corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v5.7.0 ------------------ - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` -to ``O(NNZ)``. - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Fixed a regression introduced by the stop time bug fix in v6.6.1 where CVODE -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 output time was passed. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Renamed some internal types in CVODES and IDAS to allow both packages to be -built together in the same binary. - -Changes in v5.6.2 ------------------ - -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. - -Changes in v5.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Fixed a bug where the stop time may not be cleared when using normal mode if the -requested output time is the same as the stop time. - -Changes in v5.6.0 ------------------ - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v5.5.1 ------------------ - -Added the function :c:func:`IDAClearStopTime` to disable a previously set stop -time. - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -Changes in v5.5.0 ------------------ - -Added the functions :c:func:`IDAGetJac`, :c:func:`IDAGetJacCj`, -:c:func:`IDAGetJacTime`, :c:func:`IDAGetJacNumSteps` to assist in debugging -simulations utilizing a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an underflow bug during root finding. - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added support for CUDA v12. - -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Changes in v5.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v5.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector.k - -Changes in v5.3.0 ------------------ - -Added the function :c:func:`IDAGetUserData` to retrieve the user data pointer -provided to :c:func:`IDASetUserData`. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v5.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the function :c:func:`IDAPrintAllStats` to output all of the integrator, -nonlinear solver, linear solver, and other statistics in one call. The file -``scripts/sundials_csv.py`` contains functions for parsing the comma-separated -value output files. - -Added the function :c:func:`IDASetDetlaCjLSetup` to adjust the parameter that -determines when a change in :math:`c_j` requires calling the linear solver setup -function. - -Added the functions :c:func:`IDASetEtaFixedStepBounds`, :c:func:`IDASetEtaMax`, -:c:func:`IDASetEtaMin`, :c:func:`IDASetEtaLow`, :c:func:`IDASetEtaMinErrFail`, -and :c:func:`IDASetEtaConvFail` to adjust various parameters controlling changes -in step size. - -Added the function :c:func:`IDASetMinStep` to set a minimum step size. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -A bug was fixed in the functions -:c:func:`IDAGetNumNonlinSolvConvFails`, -:c:func:`IDAGetNonlinSolvStats`, -:c:func:`IDAGetSensNumNonlinSolvConvFails`, and -:c:func:`IDAGetSensNonlinSolvStats` -where the number of nonlinear solver failures returned was the number of failed -*steps* due to a nonlinear solver failure i.e., if a nonlinear solve failed -with a stale Jacobian or preconditioner but succeeded after updating the -Jacobian or preconditioner, the initial failure was not included in the -nonlinear solver failure count. These functions have been updated to return the -total number of nonlinear solver failures. As such users may see an increase in -the number of failures reported. - -The functions :c:func:`IDAGetNumStepSolveFails` and -:c:func:`IDAGetNumStepSensSolveFails` have been added to retrieve the number of -failed steps due to a nonlinear solver failure. The counts returned from these -functions will match those previously returned by -:c:func:`IDAGetNumNonlinSolvConvFails`, -:c:func:`IDAGetNonlinSolvStats`, -:c:func:`IDAGetSensNumNonlinSolvConvFails`, and -:c:func:`IDAGetSensNonlinSolvStats`. - -Changes in v5.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Changes in v5.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v5.0.0 ------------------ - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``IDASpilsSetLinearSolver`` | ``IDASetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetPreconditioner`` | ``IDASetPreconditioner`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetJacTimes`` | ``IDASetJacTimes`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetEpsLin`` | ``IDASetEpsLin`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetIncrementFactor`` | ``IDASetIncrementFactor`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetWorkSpace`` | ``IDAGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumPrecEvals`` | ``IDAGetNumPrecEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumPrecSolves`` | ``IDAGetNumPrecSolves`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumLinIters`` | ``IDAGetNumLinIters`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumConvFails`` | ``IDAGetNumLinConvFails`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumJTSetupEvals`` | ``IDAGetNumJTSetupEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumJtimesEvals`` | ``IDAGetNumJtimesEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetNumResEvals`` | ``IDAGetNumLinResEvals`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetLastFlag`` | ``IDAGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsGetReturnFlagName`` | ``IDAGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetLinearSolverB`` | ``IDASetLinearSolverB`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetEpsLinB`` | ``IDASetEpsLinB`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetIncrementFactorB`` | ``IDASetIncrementFactorB`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetPreconditionerB`` | ``IDASetPreconditionerB`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetPreconditionerBS`` | ``IDASetPreconditionerBS`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetJacTimesB`` | ``IDASetJacTimesB`` | -+---------------------------------+--------------------------------+ -| ``IDASpilsSetJacTimesBS`` | ``IDASetJacTimesBS`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetLinearSolver`` | ``IDASetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetJacFn`` | ``IDASetJacFn`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetWorkSpace`` | ``IDAGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetNumJacEvals`` | ``IDAGetNumJacEvals`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetNumResEvals`` | ``IDAGetNumLinResEvals`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetLastFlag`` | ``IDAGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``IDADlsGetReturnFlagName`` | ``IDAGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetLinearSolverB`` | ``IDASetLinearSolverB`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetJacFnB`` | ``IDASetJacFnB`` | -+---------------------------------+--------------------------------+ -| ``IDADlsSetJacFnBS`` | ``IDASetJacFnBS`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v4.8.0 ------------------ - -The :ref:`RAJA N_Vector <NVectors.RAJA>` implementation has been updated to -support the SYCL backend in addition to the CUDA and HIP backends. Users can -choose the backend when configuring SUNDIALS by using the -:cmakeop:`SUNDIALS_RAJA_BACKENDS` CMake variable. This module remains -experimental and is subject to change from version to version. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to -interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix -and the linear solver support general dense linear systems as well as block -diagonal linear systems. See :numref:`SUNLinSol.OneMklDense` for more -details. This module is experimental and is subject to change from version to -version. - -Added a new *optional* function to the ``SUNLinearSolver`` API, -:c:func:`SUNLinSolSetZeroGuess`, to indicate that the next call to -:c:func:`SUNLinSolSolve` will be made with a zero initial guess. -``SUNLinearSolver`` implementations that do not use the -:c:func:`SUNLinSolNewEmpty` constructor will, at a minimum, need set the -``setzeroguess`` function pointer in the linear solver ``ops`` structure to -``NULL``. The SUNDIALS iterative linear solver implementations have been updated -to leverage this new set function to remove one dot product per solve. - -IDAS now supports a new "matrix-embedded" ``SUNLinearSolver`` type. This type -supports user-supplied ``SUNLinearSolver`` implementations that set up and solve -the specified linear system at each linear solve call. Any matrix-related data -structures are held internally to the linear solver itself, and are not provided -by the SUNDIALS package. - -Added the function :c:func:`IDASetNlsResFn` to supply an alternative residual -side function for use within nonlinear system function evaluations. - -The installed ``SUNDIALSConfig.cmake`` file now supports the ``COMPONENTS`` -option to ``find_package``. - -A bug was fixed in :c:func:`SUNMatCopyOps` where the matrix-vector product setup -function pointer was not copied. - -A bug was fixed in the SPBCGS and SPTFQMR solvers for the case where a non-zero -initial guess and a solution scaling vector are provided. This fix only impacts -codes using SPBCGS or SPTFQMR as standalone solvers as all SUNDIALS packages -utilize a zero initial guess. - -Changes in v4.7.0 ------------------ - -A new ``N_Vector`` implementation based on the SYCL abstraction layer has been -added targeting Intel GPUs. At present the only SYCL compiler supported is the -DPC++ (Intel oneAPI) compiler. See :numref:`NVectors.SYCL` for more details. -This module is considered experimental and is subject to major changes even in -minor releases. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to -interface with the MAGMA linear algebra library. Both the matrix and the linear -solver support general dense linear systems as well as block diagonal linear -systems, and both are targeted at GPUs (AMD or NVIDIA). See -:numref:`SUNLinSol.MagmaDense` for more details. - -Changes in v4.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error if the -:cmakeop:`CMAKE_CXX_STANDARD` and :cmakeop:`SUNDIALS_RAJA_BACKENDS` options were -not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v4.6.0 ------------------ - -A new ``N_Vector`` implementation based on the AMD ROCm HIP platform has been -added. This vector can target NVIDIA or AMD GPUs. See :numref:`NVectors.Hip` for -more details. This module is considered experimental and is subject to change -from version to version. - -The :ref:`NVECTOR_RAJA <NVectors.RAJA>` implementation has been updated to -support the HIP backend in addition to the CUDA backend. Users can choose the -backend when configuring SUNDIALS by using the :cmakeop:`SUNDIALS_RAJA_BACKENDS` -CMake variable. This module remains experimental and is subject to change from -version to version. - -A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the -``N_Vector`` API. This operation is useful for :c:type:`N_Vector` that utilize -dual memory spaces, e.g. the native SUNDIALS CUDA ``N_Vector``. - -The :ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` and -:ref:`SUNLINEARSOLVER_CUSOLVERSP_BATCHQR <SUNLinSol.cuSolverSp>` implementations -no longer require the SUNDIALS CUDA ``N_Vector``. Instead, they require that the -vector utilized provides the :c:func:`N_VGetDeviceArrayPointer` operation, and -that the pointer returned by :c:func:`N_VGetDeviceArrayPointer` is a valid CUDA -device pointer. - -Changes in v4.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. -Users will likely see deprecation warnings, but otherwise the changes should be -fully backwards compatible for almost all users. SUNDIALS now exports CMake -targets and installs a ``SUNDIALSConfig.cmake`` file. - -Added support for SuperLU_DIST 6.3.0 or newer. - -Changes in v4.4.0 ------------------ - -Added the function :c:func:`IDASetLSNormFactor` to specify the factor for -converting between integrator tolerances (WRMS norm) and linear solver -tolerances (L2 norm) i.e., ``tol_L2 = nrmfac * tol_WRMS``. - -Added a new function :c:func:`IDAGetNonlinearSystemData` which advanced users might -find useful if providing a custom :c:type:`SUNNonlinSolSysFn`. - -**This change may cause an error in existing user code**. The :c:func:`IDASolveF` function for forward integration with -checkpointing is now subject to a restriction on the number of time steps -allowed to reach the output time. This is the same restriction applied to the -:c:func:`IDASolve` function. The default maximum number of steps is 500, but -this may be changed using the :c:func:`IDASetMaxNumSteps` function. This change -fixes a bug that could cause an infinite loop in the :c:func:`IDASolveF` -function. - - -The expected behavior of :c:func:`SUNNonlinSolGetNumIters` and -:c:func:`SUNNonlinSolGetNumConvFails` in the ``SUNNonlinearSolver`` API have -been updated to specify that they should return the number of nonlinear solver -iterations and convergence failures in the most recent solve respectively rather -than the cumulative number of iterations and failures across all solves -respectively. The API documentation and SUNDIALS provided ``SUNNonlinearSolver`` -implementations have been updated accordingly. As before, the cumulative number -of nonlinear iterations may be retreived by calling -:c:func:`IDAGetNumNonlinSolvIters`, the cumulative number of failures with -:c:func:`IDAGetNumNonlinSolvConvFails`, or both with -:c:func:`IDAGetNonlinSolvStats`. - -A new API, ``SUNMemoryHelper``, was added to support **GPU users** who have -complex memory management needs such as using memory pools. This is paired with -new constructors for the :ref:`NVECTOR_CUDA <NVectors.CUDA>` and -:ref:`NVECTOR_RAJA <NVectors.RAJA>` modules that accept a ``SUNMemoryHelper`` -object. Refer to :numref:`SUNDIALS.GPU` and :numref:`SUNMemory` for more -information. - -The :ref:`NVECTOR_RAJA <NVectors.RAJA>` module has been updated to mirror the -:ref:`NVECTOR_CUDA <NVectors.CUDA>` module. Notably, the update adds managed -memory support to the :ref:`NVECTOR_RAJA <NVectors.RAJA>` module. Users of the -module will need to update any calls to the :c:func:`N_VMake_Raja` function -because that signature was changed. This module remains experimental and is -subject to change from version to version. - -The :ref:`NVECTOR_TRILINOS <NVectors.NVTrilinos>` module has been updated to -work with Trilinos 12.18+. This update changes the local ordinal type to always -be an ``int``. - -Added support for CUDA v11. - -Changes in v4.3.0 ------------------ - -Fixed a bug in the iterative linear solver modules where an error is not -returned if the ATimes function is ``NULL`` or, if preconditioning is enabled, -the PSolve function is ``NULL``. - -Added a new function :c:func:`IDAGetNonlinearSystemData` which advanced users -might find useful if providing a custom :c:type:`SUNNonlinSolSysFn`. - -Added the ability to control the CUDA kernel launch parameters for the -:ref:`NVECTOR_CUDA <NVectors.CUDA>` and -:ref:`SUNMATRIX_CUSPARSE <SUNMatrix.cuSparse>` modules. These modules remain -experimental and are subject to change from version to version. In addition, -the :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels were rewritten to be more -flexible. Most users should see equivalent performance or some improvement, but -a select few may observe minor performance degradation with the default -settings. Users are encouraged to contact the SUNDIALS team about any -performance changes that they notice. - -Added new capabilities for monitoring the solve phase in the -:ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -and :ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>` modules, and the -SUNDIALS iterative linear solver modules. SUNDIALS must be built with the CMake -option :cmakeop:`SUNDIALS_BUILD_WITH_MONITORING` to use these capabilities. - -Added the optional functions :c:func:`IDASetJacTimesResFn` and -:c:func:`IDASetJacTimesResFnB` to specify an alternative residual function for -computing Jacobian-vector products with the internal difference quotient -approximation. - -Changes in v4.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the -IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler -it is recommended to set :cmakeop:`CMAKE_Fortran_COMPILER` to ``f2003``, -``xlf2003``, or ``xlf2003_r``. - -Fixed a linkage bug affecting Windows users that stemmed from -dllimport/dllexport attributes missing on some SUNDIALS API functions. - -Added a new ``SUNMatrix`` implementation, :ref:`SUNMATRIX_CUSPARSE -<SUNMatrix.cuSparse>`, that interfaces to the sparse matrix implementation from -the NVIDIA cuSPARSE library. In addition, the :ref:`SUNLINSOL_CUSOLVER_BATCHQR -<SUNLinSol.cuSolverSp>` linear solver has been updated to use this matrix, -therefore, users of this module will need to update their code. These modules -are still considered to be experimental, thus they are subject to breaking -changes even in minor releases. - -The function :c:func:`IDASetLinearSolutionScaling` and -``IDASetLinearSolutionScalingB`` was added to enable or disable the scaling -applied to linear system solutions with matrix-based linear solvers to account -for a lagged value of :math:`\alpha` in the linear system matrix -:math:`J = \frac{\partial F}{\partial y} + \alpha\frac{\partial F}{\partial \dot{y}}`. -Scaling is enabled by default when using a matrix-based linear solver. - -Changes in v4.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake variables -:cmakeop:`PETSC_INCLUDES` and :cmakeop:`PETSC_LIBRARIES` instead of -:cmakeop:`PETSC_DIR`. - -Added a new build system option, :cmakeop:`CUDA_ARCH`, that can be used to -specify the CUDA architecture to compile for. - -Added two utility functions, :f:func:`FSUNDIALSFileOpen` and -:f:subr:`FSUNDIALSFileClose` for creating/destroying file pointers that are -useful when using the Fortran 2003 interfaces. - -Changes in v4.0.0 ------------------ - -Build system changes -^^^^^^^^^^^^^^^^^^^^ - -* Increased the minimum required CMake version to 3.5 for most SUNDIALS - configurations, and 3.10 when CUDA or OpenMP with device offloading are - enabled. - -* The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been - removed to simplify builds as SUNDIALS packages do not use BLAS directly. For - third party libraries that require linking to BLAS, the path to the BLAS - library should be included in the ``*_LIBRARIES`` variable for the third party - library *e.g.*, :cmakeop:`SUPERLUDIST_LIBRARIES` when enabling SuperLU_DIST. - -* Fixed a bug in the build system that prevented the - :ref:`NVECTOR_PTHREADS <NVectors.Pthreads>` module from being built. - -NVECTOR module changes -^^^^^^^^^^^^^^^^^^^^^^ - -* Two new functions were added to aid in creating custom ``N_Vector`` - objects. The constructor :c:func:`N_VNewEmpty` allocates an "empty" generic - ``N_Vector`` with the object’s content pointer and the function pointers in - the operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any new - optional operations to the ``N_Vector`` API by ensuring only required - operations need to be set. Additionally, the function :c:func:`N_VCopyOps` - has been added to copy the operation function pointers between vector - objects. When used in clone routines for custom vector objects these functions - also will ease the introduction of any new optional operations to the - ``N_Vector`` API by ensuring all operations are copied when cloning - objects. See :numref:`NVectors.Description.utilities` for more details. - -* Two new ``N_Vector`` implementations, - :ref:`NVECTOR_MANYVECTOR <NVectors.ManyVector>` and - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>`, have been created to - support flexible partitioning of solution data among different processing - elements (e.g., CPU + GPU) or for multi-physics problems that couple distinct - MPI-based simulations together. This implementation is accompanied by - additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.ManyVector` and :numref:`NVectors.MPIManyVector` for more - details. - -* One new required vector operation and ten new optional vector operations have - been added to the ``N_Vector`` API. The new required operation, - :c:func:`N_VGetLength`, returns the global length of an ``N_Vector``. The - optional operations have been added to support the new - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>` implementation. The - operation :c:func:`N_VGetCommunicator` must be implemented by subvectors that - are combined to create an - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>`, but is not used outside - of this context. The remaining nine operations are optional local reduction - operations intended to eliminate unnecessary latency when performing vector - reduction operations (norms, etc.) on distributed memory systems. The optional - local reduction vector operations are :c:func:`N_VDotProdLocal`, - :c:func:`N_VMaxNormLocal`, :c:func:`N_VMinLocal`, :c:func:`N_VL1NormLocal`, - :c:func:`N_VWSqrSumLocal`, :c:func:`N_VWSqrSumMaskLocal`, - :c:func:`N_VInvTestLocal`, :c:func:`N_VConstrMaskLocal`, and - :c:func:`N_VMinQuotientLocal`. If an ``N_Vector`` implementation defines any - of the local operations as ``NULL``, then the - :ref:`NVECTOR_MPIMANYVECTOR <NVectors.MPIManyVector>` will call standard - ``N_Vector`` operations to complete the computation. See - :numref:`NVectors.Ops.Local` for more details. - -* An additional ``N_Vector`` implementation, :ref:`NVECTOR_MPIPLUSX - <NVectors.MPIPlusX>`, has been created to support the MPI+X paradigm where X - is a type of on-node parallelism (*e.g.*, OpenMP, CUDA). The implementation is - accompanied by additions to user documentation and SUNDIALS examples. See - :numref:`NVectors.MPIPlusX` for more details. - -* The ``*_MPICuda`` and ``*_MPIRaja`` functions have been removed from the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` and :ref:`NVECTOR_RAJA <NVectors.RAJA>` - implementations respectively. Accordingly, the ``nvector_mpicuda.h``, - ``nvector_mpiraja.h``, ``libsundials_nvecmpicuda.lib``, and - ``libsundials_nvecmpicudaraja.lib`` files have been removed. Users should use - the :ref:`NVECTOR_MPIPLUSX <NVectors.MPIPlusX>` module coupled in conjunction - with the :ref:`NVECTOR_CUDA <NVectors.CUDA>` or :ref:`NVECTOR_RAJA - <NVectors.RAJA>` modules to replace the functionality. The necessary changes - are minimal and should require few code modifications. See the programs in - ``examples/ida/mpicuda`` and ``examples/ida/mpiraja`` for examples of how to - use the :ref:`NVECTOR_MPIPLUSX <NVectors.MPIPlusX>` module with the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` and :ref:`NVECTOR_RAJA <NVectors.RAJA>` - modules respectively. - -* Fixed a memory leak in the :ref:`NVECTOR_PETSC <NVectors.NVPETSc>` module - clone function. - -* Made performance improvements to the :ref:`NVECTOR_CUDA <NVectors.CUDA>` - module. Users who utilize a non-default stream should no longer see default - stream synchronizations after memory transfers. - -* Added a new constructor to the :ref:`NVECTOR_CUDA <NVectors.CUDA>` module that - allows a user to provide custom allocate and free functions for the vector - data array and internal reduction buffer. See :numref:`NVectors.CUDA` for more - details. - -* Added new Fortran 2003 interfaces for most ``N_Vector`` modules. See - :numref:`NVectors` for more details on how to use the interfaces. - -* Added three new ``N_Vector`` utility functions, - :c:func:`FN_VGetVecAtIndexVectorArray`, - :c:func:`FN_VSetVecAtIndexVectorArray`, and :c:func:`FN_VNewVectorArray`, for - working with ``N_Vector`` arrays when using the Fortran 2003 interfaces. See - :numref:`NVectors.Description.utilities` for more details. - -SUNMatrix module changes -^^^^^^^^^^^^^^^^^^^^^^^^ - -* Two new functions were added to aid in creating custom ``SUNMatrix`` - objects. The constructor :c:func:`SUNMatNewEmpty` allocates an "empty" generic - ``SUNMatrix`` with the object’s content pointer and the function pointers in - the operations structure initialized to ``NULL``. When used in the constructor - for custom objects this function will ease the introduction of any new - optional operations to the ``SUNMatrix`` API by ensuring only required - operations need to be set. Additionally, the function :c:func:`SUNMatCopyOps` - has been added to copy the operation function pointers between matrix - objects. When used in clone routines for custom matrix objects these functions - also will ease the introduction of any new optional operations to the - ``SUNMatrix`` API by ensuring all operations are copied when cloning - objects. See :numref:`SUNMatrix.Description` for more details. - -* A new operation, :c:func:`SUNMatMatvecSetup`, was added to the ``SUNMatrix`` - API to perform any setup necessary for computing a matrix-vector product. This - operation is useful for ``SUNMatrix`` implementations which need to prepare - the matrix itself, or communication structures before performing the - matrix-vector product. Users who have implemented custom ``SUNMatrix`` modules - will need to at least update their code to set the corresponding ``ops`` - structure member, ``matvecsetup``, to ``NULL``. See - :numref:`SUNMatrix.Description` for more details. - -* The generic ``SUNMatrix`` API now defines error codes to be returned by - ``SUNMatrix`` operations. Operations which return an integer flag indicating - success/failure may return different values than previously. - -* A new ``SUNMatrix`` (and ``SUNLinearSolver``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNMatrix.SLUNRloc` for more details. - -* Added new Fortran 2003 interfaces for most ``SUNMatrix`` modules. See - :numref:`SUNMatrix` for more details on how to use the interfaces. - -SUNLinearSolver module changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* A new function was added to aid in creating custom ``SUNLinearSolver`` - objects. The constructor :c:func:`SUNLinSolNewEmpty` allocates an "empty" - generic ``SUNLinearSolver`` with the object’s content pointer and the function - pointers in the operations structure initialized to ``NULL``. When used in the - constructor for custom objects this function will ease the introduction of any - new optional operations to the ``SUNLinearSolver`` API by ensuring only - required operations need to be set. See :numref:`SUNLinSol.API.Custom` for - more details. - -* The return type of the ``SUNLinearSolver`` API function - :c:func:`SUNLinSolLastFlag` has changed from ``long int`` to ``sunindextype`` - to be consistent with the type used to store row indices in dense and banded - linear solver modules. - -* Added a new optional operation to the ``SUNLinearSolver`` API, - :c:func:`SUNLinSolGetID`, that returns a ``SUNLinearSolver_ID`` for - identifying the linear solver module. - -* The ``SUNLinearSolver`` API has been updated to make the initialize and setup - functions optional. - -* A new ``SUNLinearSolver`` (and ``SUNMatrix``) implementation was added to - facilitate the use of the SuperLU_DIST library with SUNDIALS. See - :numref:`SUNLinSol.SuperLUDIST` for more details. - -* Added a new ``SUNLinearSolver`` implementation, - SUNLinearSolver_cuSolverSp_batchQR, which leverages the NVIDIA cuSOLVER sparse - batched QR method for efficiently solving block diagonal linear systems on - NVIDIA GPUs. See :numref:`SUNLinSol.cuSolverSp` for more details. - -* Added three new accessor functions to the SUNLINSOL_KLU module, - :c:func:`SUNLinSol_KLUGetSymbolic`, :c:func:`SUNLinSol_KLUGetNumeric`, and - :c:func:`SUNLinSol_KLUGetCommon`, to provide user access to the underlying KLU - solver structures. See :numref:`SUNLinSol.KLU` for more details. - -* Added new Fortran 2003 interfaces for most ``SUNLinearSolver`` modules. See - :numref:`SUNLinSol` for more details on how to use the interfaces. - -SUNNonlinearSolver module changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -* A new function was added to aid in creating custom ``SUNNonlinearSolver`` - objects. The constructor :c:func:`SUNNonlinSolNewEmpty` allocates an "empty" - generic ``SUNNonlinearSolver`` with the object’s content pointer and the - function pointers in the operations structure initialized to ``NULL``. When - used in the constructor for custom objects this function will ease the - introduction of any new optional operations to the ``SUNNonlinearSolver`` API - by ensuring only required operations need to be set. See - :numref:`SUNNonlinSol.API.Custom` for more details. - -* To facilitate the use of user supplied nonlinear solver convergence test - functions the :c:type:`SUNNonlinSolSetConvTestFn` function in the - ``SUNNonlinearSolver`` API has been updated to take a ``void*`` data pointer - as input. The supplied data pointer will be passed to the nonlinear solver - convergence test function on each call. - -* The inputs values passed to the first two inputs of the - :c:func:`SUNNonlinSolSolve` function in the ``SUNNonlinearSolver`` have been - changed to be the predicted state and the initial guess for the correction to - that state. Additionally, the definitions of :c:type:`SUNNonlinSolLSetupFn` - and :c:type:`SUNNonlinSolLSolveFn` in the ``SUNNonlinearSolver`` API have been - updated to remove unused input parameters. For more information see - :numref:`SUNNonlinSol`. - -* Added a new ``SUNNonlinearSolver`` implementation, - :ref:`SUNNONLINSOL_PETSC <SUNNonlinSol.PetscSNES>`, which interfaces to the - PETSc SNES nonlinear solver API. See :numref:`SUNNonlinSol.PetscSNES` for more - details. - -* Added new Fortran 2003 interfaces for most ``SUNNonlinearSolver`` modules. See - :numref:`SUNNonlinSol` for more details on how to use the interfaces. - -IDAS changes -^^^^^^^^^^^^ - -* A bug was fixed in the IDAS linear solver interface where an incorrect - Jacobian-vector product increment was used with iterative solvers other than - :ref:`SUNLINSOL_SPGMR <SUNLinSol.SPGMR>` and - :ref:`SUNLINSOL_SPFGMR <SUNLinSol.SPFGMR>`. - -* Fixed a memeory leak in FIDA when not using the default nonlinear solver. - -* Fixed a bug where the :c:func:`IDASolveF` function would not return a root in - ``IDA_NORMAL_STEP`` mode if the root occurred - after the desired output time. - -* Fixed a bug where the :c:func:`IDASolveF` function would return the wrong flag - under certrain cirumstances. - -* Fixed a bug in :c:func:`IDAQuadReInitB` where an incorrect memory structure was - passed to :c:func:`IDAQuadReInit`. - -* Removed extraneous calls to :c:func:`N_VMin` for simulations where the scalar - valued absolute tolerance, or all entries of the vector-valued absolute - tolerance array, are strictly positive. In this scenario, IDAS will remove at - least one global reduction per time step. - -* The IDALS interface has been updated to only zero the Jacobian matrix before - calling a user-supplied Jacobian evaluation function when the attached linear - solver has type ``SUNLINEARSOLVER_DIRECT``. - -* Added the new functions, :c:func:`IDAGetCurrentCj`, :c:func:`IDAGetCurrentY`, - :c:func:`IDAGetCurrentYp`, :c:func:`IDAComputeY`, and :c:func:`IDAComputeYp` - which may be useful to users who choose to provide their own nonlinear solver - implementations. - -* Added a Fortran 2003 interface to IDAS. See :numref:`SUNDIALS.Fortran` for more - details. - -Changes in v3.1.0 ------------------ - -An additional ``N_Vector`` implementation was added for the TPETRA vector from -the TRILINOS library to facilitate interoperability between SUNDIALS and -TRILINOS. This implementation is accompanied by additions to user documentation -and SUNDIALS examples. - -A bug was fixed where a nonlinear solver object could be freed twice in some use -cases. - -The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option -:cmakeop:`EXAMPLES_ENABLE_CUDA` enables all examples that use CUDA including the -RAJA examples with a CUDA back end (if the RAJA ``N_Vector`` is enabled). - -The implementation header file ``idas_impl.h`` is no longer installed. This means -users who are directly manipulating the ``IDAMem`` structure will need to update -their code to use IDAS’s public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Changes in v3.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a contributing agreement. - -Moved definitions of DLS and SPILS backwards compatibility functions to a source -file. The symbols are now included in the IDAS library, ``libsundials_idas``. - -Changes in v3.0.1 ------------------ - -No changes were made in this release. - -Changes in v3.0.0 ------------------ - -IDA’s previous direct and iterative linear solver interfaces, IDADLS and -IDASPILS, have been merged into a single unified linear solver interface, IDALS, -to support any valid ``SUNLinearSolver`` module. This includes the "DIRECT" and -"ITERATIVE" types as well as the new "MATRIX_ITERATIVE" type. Details regarding -how IDALS utilizes linear solvers of each type as well as discussion regarding -intended use cases for user-supplied ``SUNLinearSolver`` implementations are -included in :numref:`SUNLinSol`. All IDAS example programs and the standalone -linear solver examples have been updated to use the unified linear solver -interface. - -The unified interface for the new IDALS module is very similar to the previous -IDADLS and IDASPILS interfaces. To minimize challenges in user migration to the -new names, the previous C and Fortran routine names may still be used; these -will be deprecated in future releases, so we recommend that users migrate to the -new names soon. Additionally, we note that Fortran users, however, may need to -enlarge their ``iout`` array of optional integer outputs, and update the indices -that they query for certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided ``SUNLinearSolver`` -implementations have been updated to follow the naming convention ``SUNLinSol_`` -where ``*`` is the name of the linear solver. The new names are -:c:func:`SUNLinSol_Band`, :c:func:`SUNLinSol_Dense`, :c:func:`SUNLinSol_KLU`, -:c:func:`SUNLinSol_LapackBand`, :c:func:`SUNLinSol_LapackDense`, -:c:func:`SUNLinSol_PCG`, :c:func:`SUNLinSol_SPBCGS`, :c:func:`SUNLinSol_SPFGMR`, -:c:func:`SUNLinSol_SPGMR`, :c:func:`SUNLinSol_SPTFQMR`, and -:c:func:`SUNLinSol_SuperLUMT`. Solver-specific "set" routine names have been -similarly standardized. To minimize challenges in user migration to the new -names, the previous routine names may still be used; these will be deprecated in -future releases, so we recommend that users migrate to the new names soon. All -IDAS example programs and the standalone linear solver examples have been updated -to use the new naming convention. - -The ``SUNBandMatrix`` constructor has been simplified to remove the storage -upper bandwidth argument. - -SUNDIALS integrators have been updated to utilize generic nonlinear solver -modules defined through the ``SUNNonlinearSolver`` API. This API will ease the -addition of new nonlinear solver options and allow for external or user-supplied -nonlinear solvers. The ``SUNNonlinearSolver`` API and SUNDIALS provided modules -are described in :numref:`SUNNonlinSol` and follow the same object oriented -design and implementation used by the ``N_Vector``, ``SUNMatrix``, and -``SUNLinearSolver`` modules. Currently two ``SUNNonlinearSolver`` -implementations are provided, :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -and -:ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>`. These replicate the -previous integrator specific implementations of a Newton iteration and a -fixed-point iteration (previously referred to as a functional iteration), -respectively. Note the :ref:`SUNNONLINSOL_FIXEDPOINT <SUNNonlinSol.FixedPoint>` -module can optionally utilize Anderson’s method to accelerate -convergence. Example programs using each of these nonlinear solver modules in a -standalone manner have been added and all IDAS example programs have been updated -to use generic ``SUNNonlinearSolver`` modules. - -By default IDAS uses the :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` -module. Since IDAS previously only used an internal implementation of a Newton -iteration no changes are required to user programs and functions for setting the -nonlinear solver options (e.g., :c:func:`IDASetMaxNonlinIters`) or getting -nonlinear solver statistics (e.g., :c:func:`IDAGetNumNonlinSolvIters`) remain -unchanged and internally call generic ``SUNNonlinearSolver`` functions as -needed. While SUNDIALS includes a fixed-point nonlinear solver module, it is not -currently supported in IDAS. For details on attaching a user-supplied nonlinear -solver to IDAS see :numref:`IDAS.Usage`. Additionally, the example program -``idaRoberts_dns.c`` explicitly creates an attaches a :ref:`SUNNONLINSOL_NEWTON -<SUNNonlinSol.Newton>` object to demonstrate the process of creating and -attaching a nonlinear solver module (note this is not necessary in general as -IDAS uses the :ref:`SUNNONLINSOL_NEWTON <SUNNonlinSol.Newton>` module by -default). - -Three fused vector operations and seven vector array operations have been added -to the ``N_Vector`` API. These *optional* operations are disabled by default and -may be activated by calling vector specific routines after creating an -``N_Vector`` (see :numref:`NVectors` for more details). The new operations are -intended to increase data reuse in vector operations, reduce parallel -communication on distributed memory systems, and lower the number of kernel -launches on systems with accelerators. The fused operations are -:c:func:`N_VLinearCombination`, :c:func:`N_VScaleAddMulti`, and -:c:func:`N_VDotProdMulti` and the vector array operations are -:c:func:`N_VLinearCombinationVectorArray`, :c:func:`N_VScaleVectorArray`, -:c:func:`N_VConstVectorArray`, :c:func:`N_VWrmsNormVectorArray`, -:c:func:`N_VWrmsNormMaskVectorArray`, :c:func:`N_VScaleAddMultiVectorArray`, and -:c:func:`N_VLinearCombinationVectorArray`. - -If an ``N_Vector`` implementation defines any of these operations as ``NULL``, -then standard ``N_Vector`` operations will automatically be called as necessary -to complete the computation. - -Multiple updates to :ref:`NVECTOR_CUDA <NVectors.CUDA>` were made: - -* Changed ``N_VGetLength_Cuda`` to return the global vector length instead - of the local vector length. - -* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. - -* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``suncudavec``. - -* Changed the :c:func:`N_VMake_Cuda` function to take a host data pointer and a - device data pointer instead of an ``N_VectorContent_Cuda`` object. - -* Added the ability to set the ``cudaStream_t`` used for execution of the - :ref:`NVECTOR_CUDA <NVectors.CUDA>` kernels. See the function - ``N_VSetCudaStreams_Cuda``. - -* Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and - :c:func:`N_VIsManagedMemory_Cuda` functions to accommodate using managed - memory with the :ref:`NVECTOR_CUDA <NVectors.CUDA>`. - -Multiple changes to :ref:`NVECTOR_RAJA <NVectors.RAJA>` were made: - -* Changed ``N_VGetLength_Raja`` to return the global vector length instead - of the local vector length. - -* Added ``N_VGetLocalLength_Raja`` to return the local vector length. - -* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. - -* Removed the accessor functions in the namespace ``suncudavec``. - -A new ``N_Vector`` implementation for leveraging OpenMP 4.5+ device offloading -has been added, :ref:`NVECTOR_OPENMPDEV <NVectors.OpenMPDEV>`. See -:numref:`NVectors.OpenMPDEV` for more details. - -Changes in v2.2.1 ------------------ - -The changes in this minor release include the following: - -* Fixed a bug in the :ref:`CUDA N_Vector <NVectors.CUDA>` where the - :c:func:`N_VInvTest` operation could write beyond the allocated vector data. - -* Fixed library installation path for multiarch systems. This fix changes the - default library installation path to - ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` from - ``CMAKE_INSTALL_PREFIX/lib``. Note :cmakeop:`CMAKE_INSTALL_LIBDIR` is - automatically set, but is available as a CMake option that can be modified. - -Changes in v2.2.0 ------------------ - -Fixed a problem with setting ``sunindextype`` which would occur with some -compilers (e.g. armclang) that did not define ``__STDC_VERSION__``. - -Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than one MPI -rank when using a GPU system. The vectors assume one GPU device per MPI rank. - -Changed the name of the RAJA ``N_Vector`` library to -``libsundials_nveccudaraja.lib`` from ``libsundials_nvecraja.lib`` to better -reflect that we only support CUDA as a backend for RAJA currently. - -Several changes were made to the build system: - -* CMake 3.1.3 is now the minimum required CMake version. - -* Deprecate the behavior of the :cmakeop:`SUNDIALS_INDEX_TYPE` CMake option and - added the :cmakeop:`SUNDIALS_INDEX_SIZE` CMake option to select the - ``sunindextype`` integer size. - -* The native CMake FindMPI module is now used to locate an MPI installation. - -* If MPI is enabled and MPI compiler wrappers are not set, the build system will - check if ``CMAKE_<language>_COMPILER`` can compile MPI programs before trying - to locate and use an MPI installation. - -* The previous options for setting MPI compiler wrappers and the executable for - running MPI programs have been have been depreated. The new options that align - with those used in native CMake FindMPI module are :cmakeop:`MPI_C_COMPILER`, - :cmakeop:`MPI_CXX_COMPILER`, :cmakeop:`MPI_Fortran_COMPILER`, and - :cmakeop:`MPIEXEC_EXECUTABLE`. - -* When a Fortran name-mangling scheme is needed (e.g., :cmakeop:`ENABLE_LAPACK` - is ``ON``) the build system will infer the scheme from the Fortran compiler. - If a Fortran compiler is not available or the inferred or default scheme needs - to be overridden, the advanced options :cmakeop:`SUNDIALS_F77_FUNC_CASE` and - :cmakeop:`SUNDIALS_F77_FUNC_UNDERSCORES` can be used to manually set the - name-mangling scheme and bypass trying to infer the scheme. - -* Parts of the main CMakeLists.txt file were moved to new files in the ``src`` - and ``example`` directories to make the CMake configuration file structure - more modular. - -Changes in v2.1.2 ------------------ - -The changes in this minor release include the following: - -* Updated the minimum required version of CMake to 2.8.12 and enabled using - rpath by default to locate shared libraries on OSX. - -* Fixed Windows specific problem where ``sunindextype`` was not correctly - defined when using 64-bit integers for the SUNDIALS index type. On Windows - ``sunindextype`` is now defined as the MSVC basic type ``__int64``. - -* Added sparse SUNMatrix "Reallocate" routine to allow specification of the - nonzero storage. - -* Updated the KLU SUNLinearSolver module to set constants for the two - reinitialization types, and fixed a bug in the full reinitialization approach - where the sparse SUNMatrix pointer would go out of scope on some - architectures. - -* Updated the :c:func:`SUNMatScaleAdd` and :c:func:`SUNMatScaleAddI` - implementations in the sparse SUNMatrix module to more optimally handle the - case where the target matrix contained sufficient storage for the sum, but had - the wrong sparsity pattern. The sum now occurs in-place, by performing the sum - backwards in the existing storage. However, it is still more efficient if the - user-supplied Jacobian routine allocates storage for the sum - :math:`I+\gamma J` manually (with zero entries if needed). - -* Changed the LICENSE install path to ``instdir/include/sundials``. - -Changes in v2.1.1 ------------------ - -The changes in this minor release include the following: - -* Fixed a potential memory leak in the :ref:`SUNLINSOL_SPGMR <SUNLinSol.SPGMR>` - and :ref:`SUNLINSOL_SPFGMR <SUNLinSol.SPFGMR>` linear solvers: if - "Initialize" was called multiple times then the solver memory was reallocated - (without being freed). - -* Updated KLU ``SUNLinearSolver`` module to use a ``typedef`` for the - precision-specific solve function to be used (to avoid compiler warnings). - -* Added missing typecasts for some ``(void*)`` pointers (again, to avoid - compiler warnings). - -* Bugfix in ``sunmatrix_sparse.c`` where we had used ``int`` instead of - ``sunindextype`` in one location. - -* Added missing ``#include <stdio.h>`` in ``N_Vector`` and ``SUNMatrix`` header - files. - -* Added missing prototype for :c:func:`IDASpilsGetNumJTSetupEvals`. - -* Fixed an indexing bug in the CUDA ``N_Vector`` implementation of - :c:func:`N_VWrmsNormMask` and revised the RAJA ``N_Vector`` implementation of - :c:func:`N_VWrmsNormMask` to work with mask arrays using values other than - zero or one. Replaced ``double`` with ``realtype`` in the RAJA vector test - functions. - -* Fixed compilation issue with GCC 7.3.0 and Fortran programs that do not - require a ``SUNMatrix`` module (e.g., iterative linear solvers). - -In addition to the changes above, minor corrections were also made to the -example programs, build system, and user documentation. - -Changes in v2.1.0 ------------------ - -Added ``N_Vector`` print functions that write vector data to a specified file -(e.g., :c:func:`N_VPrintFile_Serial`). - -Added ``make test`` and ``make test_install`` options to the build system for -testing SUNDIALS after building with ``make`` and installing with ``make -install`` respectively. - -Changes in v2.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been reworked, and -all example programs have been updated. The goal of the redesign of these -interfaces was to provide more encapsulation and to ease interfacing of custom -linear solvers and interoperability with linear solver libraries. Specific -changes include: - -* Added generic ``SUNMatrix`` module with three provided implementations: dense, - banded, and sparse. These replicate previous SUNDIALS Dls and Sls matrix - structures in a single object-oriented API. - -* Added example problems demonstrating use of generic ``SUNMatrix`` modules. - -* Added generic ``SUNLinearSolver`` module with eleven provided implementations: - SUNDIALS native dense, SUNDIALS native banded, LAPACK dense, LAPACK band, KLU, - SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, and PCG. These replicate previous - SUNDIALS generic linear solvers in a single object-oriented API. - -* Added example problems demonstrating use of generic ``SUNLinearSolver`` - modules. - -* Expanded package-provided direct linear solver (Dls) interfaces and scaled, - preconditioned, iterative linear solver (Spils) interfaces to utilize generic - ``SUNMatrix`` and ``SUNLinearSolver`` objects. - -* Removed package-specific, linear solver-specific, solver modules - (e.g. ``CVDENSE``, ``KINBAND``, ``IDAKLU``, ``ARKSPGMR``) since their - functionality is entirely replicated by the generic Dls/Spils interfaces and - ``SUNLinearSolver`` and ``SUNMatrix`` modules. The exception is ``CVDIAG``, a - diagonal approximate Jacobian solver available to CVODE and CVODES. - -* Converted all SUNDIALS example problems and files to utilize the new generic - ``SUNMatrix`` and ``SUNLinearSolver`` objects, along with updated Dls and - Spils linear solver interfaces. - -* Added Spils interface routines to ARKODE, CVODE, CVODES, IDAS, and IDAS to - allow specification of a user-provided "JTSetup" routine. This change - supports users who wish to set up data structures for the user-provided - Jacobian-times-vector ("JTimes") routine, and where the cost of one JTSetup - setup per Newton iteration can be amortized between multiple JTimes calls. - -Two additional ``N_Vector`` implementations were added – one for CUDA and one -for RAJA vectors. These vectors are supplied to provide very basic support for -running on GPU architectures. Users are advised that these vectors both move all -data to the GPU device upon construction, and speedup will only be realized if -the user also conducts the right-hand-side or residual function evaluation on -the device. In addition, these vectors assume the problem fits on one GPU. -For further information about RAJA, users are referred to the web site, -https://software.llnl.gov/RAJA/. These additions are accompanied by updates -to various interface functions and to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` that can -be configured to be a 32- or 64-bit integer data index type. ``sunindextype`` -is defined to be ``int32_t`` or ``int64_t`` when portable types are supported, -otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces -continue to use ``long int`` for indices, except for their sparse matrix -interface that now uses the new ``sunindextype``. This new flexible capability -for index types includes interfaces to PETSc, hypre, SuperLU_MT, and KLU with -either 32-bit or 64-bit capabilities depending how the user configures SUNDIALS. - -To avoid potential namespace conflicts, the macros defining ``booleantype`` -values ``TRUE`` and ``FALSE`` have been changed to ``SUNTRUE`` and ``SUNFALSE`` -respectively. - -Temporary vectors were removed from preconditioner setup and solve routines for -all packages. It is assumed that all necessary data for user-provided -preconditioner operations will be allocated and stored in user-provided data -structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS -type information for use in Fortran programs. - -The build system was expanded to support many of the xSDK-compliant keys. The -xSDK is a movement in scientific software to provide a foundation for the rapid -and efficient production of high-quality, sustainable extreme-scale scientific -applications. More information can be found at, https://xsdk.info. - -Added functions :c:func:`SUNDIALSGetVersion` and -:c:func:`SUNDIALSGetVersionNumber` to get SUNDIALS release version information -at runtime. - -In addition, numerous changes were made to the build system. These include the -addition of separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` CMake variables, -additional error checking during CMake configuration, minor bug fixes, and -renaming CMake options to enable/disable examples for greater clarity and an -added option to enable/disable Fortran 77 examples. These changes included -changing ``EXAMPLES_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_C`, changing -``CXX_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_CXX`, changing ``F90_ENABLE`` to -:cmakeop:`EXAMPLES_ENABLE_F90`, and adding an :cmakeop:`EXAMPLES_ENABLE_F77` -option. - -A bug fix was done to add a missing prototype for :c:func:`IDASetMaxBacksIC` in -``idas.h``. - -Corrections and additions were made to the examples, to installation-related -files, and to the user documentation. - -Changes in v1.3.0 ------------------ - -Two additional ``N_Vector`` implementations were added – one for Hypre -(parallel) ParVector vectors, and one for PETSc vectors. These additions are -accompanied by additions to various interface functions and to user -documentation. - -Each ``N_Vector`` module now includes a function, :c:func:`N_VGetVectorID`, that -returns the ``N_Vector`` module name. - -An optional input function was added to set a maximum number of linesearch -backtracks in the initial condition calculation. Also, corrections were made to -three Fortran interface functions. - -For each linear solver, the various solver performance counters are now -initialized to 0 in both the solver specification function and in solver -``linit`` function. This ensures that these solver counters are initialized upon -linear solver instantiation as well as at the beginning of the problem solution. - -A bug in for-loop indices was fixed in :c:func:`IDAAckpntAllocVectors`. A bug -was fixed in the interpolation functions used in solving backward problems. - -A memory leak was fixed in the banded preconditioner interface. In addition, -updates were done to return integers from linear solver and preconditioner -"free" functions. - -The Krylov linear solver Bi-CGstab was enhanced by removing a redundant dot -product. Various additions and corrections were made to the interfaces to the -sparse solvers KLU and SuperLU_MT, including support for CSR format when using -KLU. - -New examples were added for use of the OpenMP vector. - -Minor corrections and additions were made to the IDAS solver, to the examples, -to installation-related files, and to the user documentation. - -Changes in v1.2.0 ------------------ - -Two major additions were made to the linear system solvers that are available -for use with the IDAS solver. First, in the serial case, an interface to the -sparse direct solver KLU was added. Second, an interface to SuperLU_MT, the -multi-threaded version of SuperLU, was added as a thread-parallel sparse direct -solver option, to be used with the serial version of the ``N_Vector`` module. -As part of these additions, a sparse matrix (CSC format) structure was added to -IDAS. - -Otherwise, only relatively minor modifications were made to IDAS: - -In :c:func:`IDARootfind`, a minor bug was corrected, where the input array -``rootdir`` was ignored, and a line was added to break out of root-search loop -if the initial interval size is below the tolerance ``ttol``. - -In ``IDALapackBand``, the line ``smu = MIN(N-1,mu+ml)`` was changed to ``smu = -mu + ml`` to correct an illegal input error for ``DGBTRF/DGBTRS``. - -An option was added in the case of Adjoint Sensitivity Analysis with dense or -banded Jacobian: With a call to ``IDADlsSetDenseJacFnBS`` or -``IDADlsSetBandJacFnBS``, the user can specify a user-supplied Jacobian function -of type ``IDADls***JacFnBS``, for the case where the backward problem depends on -the forward sensitivities. - -A minor bug was fixed regarding the testing of the input ``tstop`` on the first -call to :c:func:`IDASolve`. - -In order to avoid possible name conflicts, the mathematical macro and function -names ``MIN``, ``MAX``, ``SQR``, ``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and -``RPowerR`` were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, ``SUNRabs``, -``SUNRsqrt``, ``SUNRexp``, ``SRpowerI``, and ``SUNRpowerR``, respectively. -These names occur in both the solver and in various example programs. - -In the FIDA optional input routines ``FIDASETIIN``, ``FIDASETRIN``, and -``FIDASETVIN``, the optional fourth argument ``key_length`` was removed, with -hardcoded key string lengths passed to all ``strncmp`` tests. - -In all FIDA examples, integer declarations were revised so that those which must -match a C type ``long int`` are declared ``INTEGER*8``, and a comment was added -about the type match. All other integer declarations are just -``INTEGER``. Corresponding minor corrections were made to the user guide. - -Two new ``N_Vector`` modules have been added for thread-parallel computing -environments — one for OpenMP, denoted :ref:`NVECTOR_OPENMP <NVectors.OpenMP>`, -and one for Pthreads, denoted :ref:`NVECTOR_PTHREADS <NVectors.Pthreads>`. - -With this version of SUNDIALS, support and documentation of the Autotools mode -of installation is being dropped, in favor of the CMake mode, which is -considered more widely portable. - -Changes in v1.1.0 ------------------ - -One significant design change was made with this release: The problem size and -its relatives, bandwidth parameters, related internal indices, pivot arrays, and -the optional output ``lsflag`` have all been changed from type ``int`` to type -``long int``, except for the problem size and bandwidths in user calls to -routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The -function ``NewIntArray`` is replaced by a pair ``NewIntArray`` and -``NewLintArray``, for ``int`` and ``long int`` arrays, respectively. - -Errors in the logic for the integration of backward problems were identified and -fixed. A large number of minor errors have been fixed. Among these are the -following: A missing vector pointer setting was added in -:c:func:`IDASensLineSrch`. In :c:func:`IDACompleteStep`, conditionals around -lines loading a new column of three auxiliary divided difference arrays, for a -possible order increase, were fixed. After the solver memory is created, it is -set to zero before being filled. In each linear solver interface function, the -linear solver memory is freed on an error return, and the ``**Free`` function -now includes a line setting to ``NULL`` the main memory pointer to the linear -solver memory. A memory leak was fixed in two of the ``IDASp***Free`` functions. -In the rootfinding functions ``IDARcheck1`` and ``IDARcheck2``, when an exact -zero is found, the array ``glo`` of ``g`` values at the left endpoint is -adjusted, instead of shifting the ``t`` location ``tlo`` slightly. In the -installation files, we modified the treatment of the macro -``SUNDIALS_USE_GENERIC_MATH``, so that the parameter ``GENERIC_MATH_LIB`` is -either defined (with no value) or not defined. +For changes in prior versions of SUNDIALS see :numref:`Changelog`. .. _IDAS.Introduction.Reading: @@ -1934,7 +126,7 @@ The structure of this document is as follows: sensitivity analysis. We begin by describing the IDAS checkpointing implementation for interpolation of the original IVP solution during integration of the adjoint system backward in time, and with an overview of a - user’s main program. Following that we provide complete descriptions of the + user's main program. Following that we provide complete descriptions of the user-callable interface routines for adjoint sensitivity analysis as well as descriptions of the required additional user-defined routines. diff --git a/doc/idas/guide/source/RecentChanges_link.rst b/doc/idas/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/idas/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/idas/guide/source/conf.py b/doc/idas/guide/source/conf.py index b5078a60a2..701f4d9e22 100644 --- a/doc/idas/guide/source/conf.py +++ b/doc/idas/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/idas/guide/source/index.rst b/doc/idas/guide/source/index.rst index 402670ef48..5ba30f86aa 100644 --- a/doc/idas/guide/source/index.rst +++ b/doc/idas/guide/source/index.rst @@ -38,6 +38,7 @@ IDAS Documentation sundials/Install_link.rst Constants History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/kinsol/guide/source/Changelog_link.rst b/doc/kinsol/guide/source/Changelog_link.rst new file mode 100644 index 0000000000..2951551136 --- /dev/null +++ b/doc/kinsol/guide/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index f9125ae927..9665273e59 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -30,14 +30,14 @@ Historical Background The first nonlinear solver packages based on Newton-Krylov methods were written in Fortran. In particular, the NKSOL package, written at LLNL, was the first Newton-Krylov solver package written for solution of systems arising in the -solution of partial differential equations :cite:p:`BrSa:90`. This Fortran code made use of Newton’s method to +solution of partial differential equations :cite:p:`BrSa:90`. This Fortran code made use of Newton's method to solve the discrete nonlinear systems and applied a preconditioned Krylov linear solver for solution of the Jacobian system at each nonlinear iteration. The key to the Newton-Krylov method was that the matrix-vector multiplies required by the Krylov method could effectively be approximated by a finite difference of the nonlinear system-defining function, avoiding a requirement for the formation of the actual Jacobian matrix. Significantly less memory was required for the solver as a result. -In the late 1990’s, there was a push at LLNL to rewrite the nonlinear solver in C and port it to distributed +In the late 1990s, there was a push at LLNL to rewrite the nonlinear solver in C and port it to distributed memory parallel machines. Both Newton and Krylov methods are easily implemented in parallel, and this effort gave rise to the KINSOL package. KINSOL is similar to NKSOL in functionality, except that it provides for more options in the choice of linear system methods and tolerances, and has a more modular design to provide flexibility for future @@ -85,1478 +85,12 @@ applications written in Fortran. .. _KINSOL.Introduction.Changes: -Changes from previous versions -============================== +Changes to SUNDIALS in release X.Y.Z +==================================== -Changes in vX.X.X ------------------- +.. include:: ../../../shared/RecentChanges.rst -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). - -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - - -Changes in v7.0.0 ----------------------- - -**Major Features** - -SUNDIALS now has more robust and uniform error handling. Non-release builds will -be built with additional error checking by default. See :numref:`SUNDIALS.Errors` -for details. - -**Breaking Changes** - -*Minimum C Standard* - -SUNDIALS now requires using a compiler that supports a subset of the C99 -standard. Note with the Microsoft C/C++ compiler the subset of C99 features -utilized by SUNDIALS are available starting with -`Visual Studio 2015 <https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. - -*Deprecated Types and Functions Removed* - -The previously deprecated types ``realtype`` and ``booleantype`` were removed -from ``sundials_types.h`` and replaced with ``sunrealtype`` and -``sunbooleantype``. The deprecated names for these types can be used by -including the header file ``sundials_types_deprecated.h`` but will be fully -removed in the next major release. Functions, types, and header files that were -previously deprecated have also been removed. - -*Error Handling Changes* - -With the addition of the new error handling capability, the functions -``KINSetErrFile`` and ``KINSetHandlerErrFn`` have been removed. Users of these -functions can use the functions :c:func:`SUNContext_PushErrHandler`, and -:c:func:`SUNLogger_SetErrorFilename` instead. For further details see Sections -:numref:`SUNDIALS.Errors` and :numref:`SUNDIALS.Logging`. - -In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: - -+-------------------------------+-----------------------------------+ -| Removed | Replaced with ``SUNErrCode`` | -+===============================+===================================+ -| SUNLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNLS_UNRECOV_FAILURE | no replacement (value was unused) | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUNLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_PACKAGE_FAIL_UNREC | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_NULL | SUN_ERR_ARG_CORRUPT | -+-------------------------------+-----------------------------------+ -| SUN_NLS_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUN_NLS_VECTOROP_ERR | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUN_NLS_EXT_FAIL | SUN_ERR_EXT_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_SUCCESS | SUN_SUCCESS | -+-------------------------------+-----------------------------------+ -| SUNMAT_ILL_INPUT | SUN_ERR_ARG_* | -+-------------------------------+-----------------------------------+ -| SUNMAT_MEM_FAIL | SUN_ERR_MEM_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_OPERATION_FAIL | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ -| SUNMAT_MATVEC_SETUP_REQUIRED | SUN_ERR_OP_FAIL | -+-------------------------------+-----------------------------------+ - -The following functions have had their signature updated to ensure they can -leverage the new SUNDIALS error handling capabilities. - -* From ``sundials_futils.h`` - - * :c:func:`SUNDIALSFileOpen` - * :c:func:`SUNDIALSFileClose` - -* From ``sundials_memory.h`` - - * :c:func:`SUNMemoryNewEmpty` - * :c:func:`SUNMemoryHelper_Alias` - * :c:func:`SUNMemoryHelper_Wrap` - -* From ``sundials_nvector.h`` - - * :c:func:`N_VNewVectorArray` - -*SUNComm Type Added* - -We have replaced the use of a type-erased (i.e., ``void*``) pointer to a -communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a -:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI -and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: - -- All users will need to update their codes because the call to - :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead - of type-erased pointer to a communicator. For non-MPI codes, - pass :c:type:`SUN_COMM_NULL` to the ``comm`` argument instead of - ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. - -- The same change must be made for calls to - :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. - -- Some users will need to update their calls to ``N_VGetCommunicator``, and - update any custom ``N_Vector`` implementations that provide - ``N_VGetCommunicator``, since it now returns a ``SUNComm``. - -The change away from type-erased pointers for :c:type:`SUNComm` fixes problems -like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. - -The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the -``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed -accordingly. - -*SUNDIALS Core Library* - -Users now need to link to ``sundials_core`` in addition to the libraries already -linked to. This will be picked up automatically in projects that use the -SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by -``sundials_core`` and is no longer available. This fixes some duplicate symbol -errors on Windows when linking to multiple SUNDIALS libraries. - -**Deprecation notice** - -The functions in ``sundials_math.h`` will be deprecated in the next release. - -.. code-block:: c - - sunrealtype SUNRpowerI(sunrealtype base, int exponent); - sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); - sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); - sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); - sunrealtype SUNStrToReal(const char* str); - -Additionally, the following header files (and everything in them) will be -deprecated -- users who rely on these are recommended to transition to the -corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules: - -.. code-block:: c - - sundials_direct.h - sundials_dense.h - sundials_band.h - -**Minor changes** - -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so -that C++20 aggregate initialization can be used. - -Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. - -The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS -will be built with optimizations and debugging symbols enabled by default. -Previously the build type was unset by default so no optimization or debugging -flags were set. - -The advanced CMake options to override the inferred LAPACK name-mangling scheme -have been updated from ``SUNDIALS_F77_FUNC_CASE`` and -``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and -:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. - -Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 -interface. - -Changes in v6.7.0 ------------------ - -Added Fortran support for the LAPACK dense ``SUNLinearSolver`` implementation. - -Improved computational complexity of ``SUNMatScaleAddI_Sparse`` from ``O(M*N)`` to -``O(NNZ)``. - -Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. - -Fixed missing soversions in some ``SUNLinearSolver`` and ``SUNNonlinearSolver`` -CMake targets. - -Changes in v6.6.2 ------------------ - -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. - -Changes in v6.6.1 ------------------ - -Updated the Tpetra NVector interface to support Trilinos 14. - -Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system SUNMemoryHelper -object. - -Changed the ``SUNProfiler`` so that it does not rely on ``MPI_WTime`` in any case. -This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. - -Changes in v6.6.0 ------------------ - -Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and :c:func:`SUNDIALSFileClose` -to support user specification of ``stdout`` and ``stderr`` strings for the output -file names. - -Changes in v6.5.1 ------------------ - -Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. - -Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. - -Changes in v6.5.0 ------------------ - -A new capability to keep track of memory allocations made through the ``SUNMemoryHelper`` -classes has been added. Memory allocation stats can be accessed through the -:c:func:`SUNMemoryHelper_GetAllocStats` function. See the documentation for -the ``SUNMemoryHelper`` classes for more details. - -Added the functions :c:func:`KINGetJac` and :c:func:`KINGetJacNumIters` to -assist in debugging simulations utilizing a matrix-based linear solver. - -Added support for the SYCL backend with RAJA 2022.x.y. - -Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the -``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. - -Fixed the shape of the arrays returned by ``FN_VGetArrayPointer`` functions as well -as the ``FSUNDenseMatrix_Data``, ``FSUNBandMatrix_Data``, ``FSUNSparseMatrix_Data``, -``FSUNSparseMatrix_IndexValues``, and ``FSUNSparseMatrix_IndexPointers`` functions. -Compiling and running code that uses the SUNDIALS Fortran interfaces with -bounds checking will now work. - -Changes in v6.4.1 ------------------ - -Fixed a bug with the Kokkos interfaces that would arise when using clang. - -Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the -Fortran 2003 interface test for the serial ``N_Vector``. - -Fixed a bug in the SUNLINSOL_LAPACKBAND and SUNLINSOL_LAPACKDENSE modules -which would cause the tests to fail on some platforms. - -Changes in v6.4.0 ------------------ - -CMake 3.18.0 or newer is now required for CUDA support. - -A C++14 compliant compiler is now required for C++ based features and examples -e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, GINKGO, and KOKKOS. - -Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed -support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and -declaration bug in SuperLU_DIST matrix constructor. - -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear -algebra library. This support includes new ``SUNMatrix`` and ``SUNLinearSolver`` -implementations, see the sections :numref:`SUNMatrix.Ginkgo` and -:numref:`SUNLinSol.Ginkgo`. - -Added new ``NVector``, dense ``SUNMatrix``, and dense ``SUNLinearSolver`` -implementations utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for -performance portability, see sections :numref:`NVectors.Kokkos`, -:numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. - -Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return -the minimum positive floating-point value for the zero vector. - -Changes in v6.3.0 ------------------ - -Added the function :c:func:`KINGetUserData` to retrieve the user data pointer -provided to :c:func:`KINSetUserData`. - -Fixed the unituitive behavior of the :cmakeop:`USE_GENERIC_MATH` CMake option which -caused the double precision math functions to be used regardless of the value of -:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math -functions when they are available and the user may provide the math library to -link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. - -Changed :cmakeop:`SUNDIALS_LOGGING_ENABLE_MPI` CMake option default to be 'OFF'. - -Changes in v6.2.0 ------------------ - -Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide -mechanism for logging of errors, warnings, informational output, -and debugging output. - -Deprecated :c:func:`KINSetInfoFile`, :c:func:`KINSetDebugFile`, -:c:func:`SUNNonlinSolSetPrintLevel_Newton`, -:c:func:`SUNNonlinSolSetInfoFile_Newton`, -:c:func:`SUNNonlinSolSetPrintLevel_FixedPoint`, -:c:func:`SUNNonlinSolSetInfoFile_FixedPoint`, -:c:func:`SUNLinSolSetInfoFile_PCG`, :c:func:`SUNLinSolSetPrintLevel_PCG`, -:c:func:`SUNLinSolSetInfoFile_SPGMR`, :c:func:`SUNLinSolSetPrintLevel_SPGMR`, -:c:func:`SUNLinSolSetInfoFile_SPFGMR`, :c:func:`SUNLinSolSetPrintLevel_SPFGMR`, -:c:func:`SUNLinSolSetInfoFile_SPTFQM`, :c:func:`SUNLinSolSetPrintLevel_SPTFQMR`, -:c:func:`SUNLinSolSetInfoFile_SPBCGS`, :c:func:`SUNLinSolSetPrintLevel_SPBCGS` -it is recommended to use the `SUNLogger` API instead. The ``SUNLinSolSetInfoFile_**`` -and ``SUNNonlinSolSetInfoFile_*`` family of functions are now enabled -by setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. - -Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and -counters to zero. - -Added the function :c:func:`KINPrintAllStats` to output all of the nonlinear -solver, linear solver, and other statistics in one call. The file -``scripts/sundials_csv.py`` contains functions for parsing the comma-separated -value output files. - -The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be -consistent with the CUDA and HIP vectors. The input execution policies are now -cloned and may be freed after calling :cpp:func:`N_VSetKernelExecPolicy_Sycl`. -Additionally, ``NULL`` inputs are now allowed and, if provided, will reset the -vector execution policies to the defaults. - -Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy -construction and allow move construction. - -A memory leak in the SYCL vector was fixed where the execution policies were -not freed when the vector was destroyed. - -The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable -using both the ManyVector and MPIManyVector NVector implementations in the same -simulation. - -Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead -of UNKNOWN IMPORTED. - -Changes in v6.1.1 ------------------ - -Fixed exported ``SUNDIALSConfig.cmake``. - -Changes in v6.1.0 ------------------ - -Added new reduction implementations for the CUDA and HIP NVECTORs that use -shared memory (local data storage) instead of atomics. These new implementations -are recommended when the target hardware does not provide atomic support for the -floating point precision that SUNDIALS is being built with. The HIP vector uses -these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and -:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between -different reduction implementations. - -``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use -within the build directory (this mirrors the targets exported on installation). - -:cmakeop:`CMAKE_C_STANDARD` is now set to 99 by default. - -Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without Caliper. - -Fixed ``sundials_export.h`` include in ``sundials_config.h``. - -Fixed memory leaks in the SUNLINSOL_SUPERLUMT linear solver. - -Changes in v6.0.0 ------------------ - -**SUNContext** - -SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other -SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, -vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have -been updated to accept a context as the last input. Users upgrading to SUNDIALS -v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object -with before calling any other SUNDIALS library function, and then provide this -object to other SUNDIALS constructors. The context object has been introduced to -allow SUNDIALS to provide new features, such as the profiling/instrumentation -also introduced in this release, while maintaining thread-safety. See the -documentation section on the :c:type:`SUNContext` for more details. - -A script ``upgrade-to-sundials-6-from-5.sh`` has been provided with the release -(obtainable from the GitHub release page) to help ease the transition to -SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` argument to all of -the calls to SUNDIALS constructors that now require a ``SUNContext`` object. It -can also update deprecated SUNDIALS constants/types to the new names. It can be -run like this: - -.. code-block:: - - > ./upgrade-to-sundials-6-from-5.sh <files to update> - -**SUNProfiler** - -A capability to profile/instrument SUNDIALS library code has been added. This -can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A -built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the -CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on -profiling for more details. **WARNING**: Profiling will impact performance, and -should be enabled judiciously. - -**SUNMemoryHelper** - -The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, -:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been -updated to accept an opaque handle as the last input. At a minimum, user-defined -:c:type:`SUNMemoryHelper` implementations will need to update these functions to -accept the additional argument. Typically, this handle is the execution stream -(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The :ref:`CUDA -<SUNMemory.CUDA>`, :ref:`HIP <SUNMemory.HIP>`, and :ref:`SYCL <SUNMemory.SYCL>` -implementations have been updated accordingly. Additionally, the constructor -:c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL queue as an -input. - -**NVector** - -Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and -:c:func:`N_VDotProdMultiAllReduce`, have been added to support -low-synchronization methods for Anderson acceleration. - -The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` -namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` -namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" -have been removed from the execution policy classes and methods. - -The ``Sundials`` namespace used by the Trilinos Tpetra NVector has been replaced -with the ``sundials::trilinos::nvector_tpetra`` namespace. - -The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector -functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been -deprecated. The generic :c:func:`N_VCloneVectorArray` and -:c:func:`N_VDestroyVectorArray` functions should be used instead. - -The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and -the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with -:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` -respectively. - -The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and -``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with -``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. - -**SUNLinearSolver** - -The following previously deprecated functions have been removed: - -+-----------------------------+------------------------------------------+ -| Removed | Replacement | -+=============================+==========================================+ -| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | -+-----------------------------+------------------------------------------+ -| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | -+-----------------------------+------------------------------------------+ -| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | -+-----------------------------+------------------------------------------+ -| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | -+-----------------------------+------------------------------------------+ -| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | -+-----------------------------+------------------------------------------+ -| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | -+-----------------------------+------------------------------------------+ -| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | -+-----------------------------+------------------------------------------+ -| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | -+-----------------------------+------------------------------------------+ - -**KINSOL** - -New orthogonalization methods were added for use within the KINSOL Anderson -acceleration routine. See :numref:`Anderson_QR` and :c:func:`KINSetOrthAA` -for more details. - -The KINSOL Fortran 77 interface has been removed. See :numref:`SUNDIALS.Fortran` -and the F2003 example programs for more details using the SUNDIALS Fortran 2003 -module interfaces. - -**Deprecations** - -In addition to the deprecations noted elsewhere, many constants, types, and -functions have been renamed so that they are properly namespaced. The old names -have been deprecated and will be removed in SUNDIALS v7.0.0. - -The following constants, macros, and typedefs are now deprecated: - -+------------------------------+-------------------------------------+ -| Deprecated Name | New Name | -+==============================+=====================================+ -| ``realtype`` | ``sunrealtype`` | -+------------------------------+-------------------------------------+ -| ``booleantype`` | ``sunbooleantype`` | -+------------------------------+-------------------------------------+ -| ``RCONST`` | ``SUN_RCONST`` | -+------------------------------+-------------------------------------+ -| ``BIG_REAL`` | ``SUN_BIG_REAL`` | -+------------------------------+-------------------------------------+ -| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | -+------------------------------+-------------------------------------+ -| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | -+------------------------------+-------------------------------------+ -| ``PREC_NONE`` | ``SUN_PREC_NONE`` | -+------------------------------+-------------------------------------+ -| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | -+------------------------------+-------------------------------------+ -| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | -+------------------------------+-------------------------------------+ -| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | -+------------------------------+-------------------------------------+ -| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | -+------------------------------+-------------------------------------+ -| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | -+------------------------------+-------------------------------------+ -| ``ATimesFn`` | ``SUNATimesFn`` | -+------------------------------+-------------------------------------+ -| ``PSetupFn`` | ``SUNPSetupFn`` | -+------------------------------+-------------------------------------+ -| ``PSolveFn`` | ``SUNPSolveFn`` | -+------------------------------+-------------------------------------+ -| ``DlsMat`` | ``SUNDlsMat`` | -+------------------------------+-------------------------------------+ -| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | -+------------------------------+-------------------------------------+ -| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | -+------------------------------+-------------------------------------+ -| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | -+------------------------------+-------------------------------------+ -| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | -+------------------------------+-------------------------------------+ - -In addition, the following functions are now deprecated (compile-time warnings -will be thrown if supported by the compiler): - -+---------------------------------+--------------------------------+ -| Deprecated Name | New Name | -+=================================+================================+ -| ``KINDlsSetLinearSolver`` | ``KINSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``KINDlsSetJacFn`` | ``KINSetJacFn`` | -+---------------------------------+--------------------------------+ -| ``KINDlsGetWorkSpace`` | ``KINGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``KINDlsGetNumJacEvals`` | ``KINGetNumJacEvals`` | -+---------------------------------+--------------------------------+ -| ``KINDlsGetNumFuncEvals`` | ``KINGetNumLinFuncEvals`` | -+---------------------------------+--------------------------------+ -| ``KINDlsGetLastFlag`` | ``KINGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``KINDlsGetReturnFlagName`` | ``KINGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsSetLinearSolver`` | ``KINSetLinearSolver`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsSetPreconditioner`` | ``KINSetPreconditioner`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsSetJacTimesVecFn`` | ``KINSetJacTimesVecFn`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetWorkSpace`` | ``KINGetLinWorkSpace`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumPrecEvals`` | ``KINGetNumPrecEvals`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumPrecSolves`` | ``KINGetNumPrecSolves`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumLinIters`` | ``KINGetNumLinIters`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumConvFails`` | ``KINGetNumLinConvFails`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumJtimesEvals`` | ``KINGetNumJtimesEvals`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetNumFuncEvals`` | ``KINGetNumLinFuncEvals`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetLastFlag`` | ``KINGetLastLinFlag`` | -+---------------------------------+--------------------------------+ -| ``KINSpilsGetReturnFlagName`` | ``KINGetLinReturnFlagName`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | -+---------------------------------+--------------------------------+ -| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | -+---------------------------------+--------------------------------+ -| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | -+---------------------------------+--------------------------------+ -| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | -+---------------------------------+--------------------------------+ -| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | -+---------------------------------+--------------------------------+ -| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | -+---------------------------------+--------------------------------+ -| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | -+---------------------------------+--------------------------------+ -| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | -+---------------------------------+--------------------------------+ -| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | -+---------------------------------+--------------------------------+ -| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | -+---------------------------------+--------------------------------+ -| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | -+---------------------------------+--------------------------------+ -| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | -+---------------------------------+--------------------------------+ -| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | -+---------------------------------+--------------------------------+ -| ``denseScale`` | ``SUNDlsMat_denseScale`` | -+---------------------------------+--------------------------------+ -| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | -+---------------------------------+--------------------------------+ -| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | -+---------------------------------+--------------------------------+ -| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | -+---------------------------------+--------------------------------+ -| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | -+---------------------------------+--------------------------------+ -| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | -+---------------------------------+--------------------------------+ -| ``BandScale`` | ``SUNDlsMat_BandScale`` | -+---------------------------------+--------------------------------+ -| ``bandScale`` | ``SUNDlsMat_bandScale`` | -+---------------------------------+--------------------------------+ -| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | -+---------------------------------+--------------------------------+ -| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | -+---------------------------------+--------------------------------+ -| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | -+---------------------------------+--------------------------------+ -| ``ModifiedGS`` | ``SUNModifiedGS`` | -+---------------------------------+--------------------------------+ -| ``ClassicalGS`` | ``SUNClassicalGS`` | -+---------------------------------+--------------------------------+ -| ``QRfact`` | ``SUNQRFact`` | -+---------------------------------+--------------------------------+ -| ``QRsol`` | ``SUNQRsol`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | -+---------------------------------+--------------------------------+ -| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | -+---------------------------------+--------------------------------+ -| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | -+---------------------------------+--------------------------------+ -| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | -+---------------------------------+--------------------------------+ -| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | -+---------------------------------+--------------------------------+ -| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | -+---------------------------------+--------------------------------+ -| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | -+---------------------------------+--------------------------------+ -| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | -+---------------------------------+--------------------------------+ -| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | -+---------------------------------+--------------------------------+ -| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | -+---------------------------------+--------------------------------+ -| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | -+---------------------------------+--------------------------------+ -| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | -+---------------------------------+--------------------------------+ -| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | -+---------------------------------+--------------------------------+ -| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | -+---------------------------------+--------------------------------+ -| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | -+---------------------------------+--------------------------------+ -| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | -+---------------------------------+--------------------------------+ -| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | -+---------------------------------+--------------------------------+ - -In addition, the entire ``sundials_lapack.h`` header file is now deprecated for -removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the -SUNDIALS LAPACK linear solvers. - -Changes in v5.8.0 ------------------ - -The RAJA ``N_Vector`` implementation has been updated to support the SYCL backend in addition to the CUDA and HIP -backend. Users can choose the backend when configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. -This module remains experimental and is subject to change from version to version. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to interface with the Intel oneAPI Math Kernel -Library (oneMKL). Both the matrix and the linear solver support general dense linear systems as well as block diagonal -linear systems. See :numref:`SUNLinSol.OneMklDense` for more details. This module is -experimental and is subject to change from version to version. - -Added a new *optional* function to the SUNLinearSolver API, ``SUNLinSolSetZeroGuess``, to indicate that the next call to -``SUNLinSolSolve`` will be made with a zero initial guess. SUNLinearSolver implementations that do not use the -``SUNLinSolNewEmpty`` constructor will, at a minimum, need set the ``setzeroguess`` function pointer in the linear -solver ``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver implementations have been updated to leverage -this new set function to remove one dot product per solve. - -New KINSOL options have been added to apply a constant damping in the fixed point and Picard iterations (see -``KINSetDamping``), to delay the start of Anderson acceleration with the fixed point and Picard iterations (see -``KINSetDelayAA``), and to return the newest solution with the fixed point iteration (see ``KINSetReturnNewest``). - -The installed SUNDIALSConfig.cmake file now supports the ``COMPONENTS`` option to ``find_package``. The exported targets -no longer have ``IMPORTED_GLOBAL`` set. - -A bug was fixed in ``SUNMatCopyOps`` where the matrix-vector product setup function pointer was not copied. - -A bug was fixed in the SPBCGS and SPTFQMR solvers for the case where a non-zero initial guess and a solution scaling -vector are provided. This fix only impacts codes using SPBCGS or SPTFQMR as standalone solvers as all SUNDIALS -packages utilize a zero initial guess. - -A bug was fixed in the Picard iteration where the value of ``KINSetMaxSetupCalls`` would be ignored. - -Changes in v5.7.0 ------------------ - -A new ``N_Vector`` implementation based on the SYCL abstraction layer has been added targeting Intel GPUs. At -present the only SYCL compiler supported is the DPC++ (Intel oneAPI) compiler. See :numref:`NVectors.SYCL` for more details. This module is considered experimental and is subject to major -changes even in minor releases. - -A new ``SUNMatrix`` and ``SUNLinearSolver`` implementation were added to interface with the MAGMA linear algebra library. -Both the matrix and the linear solver support general dense linear systems as well as block diagonal linear systems, and -both are targeted at GPUs (AMD or NVIDIA). See :numref:`SUNLinSol.MagmaDense` for more -details. - -Changes in v5.6.1 ------------------ - -Fixed a bug in the SUNDIALS CMake which caused an error if the CMAKE_CXX_STANDARD and SUNDIALS_RAJA_BACKENDS -options were not provided. - -Fixed some compiler warnings when using the IBM XL compilers. - -Changes in v5.6.0 ------------------ - -A new ``N_Vector`` implementation based on the AMD ROCm HIP platform has been added. This vector can target NVIDIA or -AMD GPUs. See :numref:`NVectors.HIP` for more details. This module is considered experimental and is subject -to change from version to version. - -The RAJA ``N_Vector`` implementation has been updated to support the HIP backend in addition to the CUDA backend. Users -can choose the backend when configuring SUNDIALS by using the ``SUNDIALS_RAJA_BACKENDS`` CMake variable. This module -remains experimental and is subject to change from version to version. - -A new optional operation, ``N_VGetDeviceArrayPointer``, was added to the N_Vector API. This operation is useful for -N_Vectors that utilize dual memory spaces, e.g. the native SUNDIALS CUDA N_Vector. - -The SUNMATRIX_CUSPARSE and SUNLINEARSOLVER_CUSOLVERSP_BATCHQR implementations no longer require the SUNDIALS CUDA -N_Vector. Instead, they require that the vector utilized provides the ``N_VGetDeviceArrayPointer`` operation, and that -the pointer returned by ``N_VGetDeviceArrayPointer`` is a valid CUDA device pointer. - -Changes in v5.5.0 ------------------ - -Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. Users will likely see deprecation -warnings, but otherwise the changes should be fully backwards compatible for almost all users. SUNDIALS now -exports CMake targets and installs a SUNDIALSConfig.cmake file. - -Added support for SuperLU DIST 6.3.0 or newer. - -Changes in v5.4.0 ------------------ - -A new API, ``SUNMemoryHelper``, was added to support **GPU users** who have complex memory management needs such as -using memory pools. This is paired with new constructors for the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` modules that accept a -``SUNMemoryHelper`` object. Refer to :numref:`SUNDIALS.GPU.Model`, :numref:`NVectors.CUDA`, :numref:`NVectors.RAJA`, and :numref:`SUNMemory` for more information. - -The ``NVECTOR_RAJA`` module has been updated to mirror the ``NVECTOR_CUDA`` module. Notably, the update adds managed -memory support to the ``NVECTOR_RAJA`` module. Users of the module will need to update any calls to the ``N_VMake_Raja`` -function because that signature was changed. This module remains experimental and is subject to change from version to -version. - -The ``NVECTOR_TRILINOS`` module has been updated to work with Trilinos 12.18+. This update changes the local ordinal -type to always be an ``int``. - -Added support for CUDA v11. - -Changes in v5.3.0 ------------------ - -Fixed a bug in the iterative linear solver modules where an error is not returned if the Atimes function is ``NULL`` or, -if preconditioning is enabled, the PSolve function is ``NULL``. - -Added the ability to control the CUDA kernel launch parameters for the ``NVECTOR_CUDA`` and ``SUNMATRIX_CUSPARSE`` -modules. These modules remain experimental and are subject to change from version to version. In addition, the -``NVECTOR_CUDA`` kernels were rewritten to be more flexible. Most users should see equivalent performance or some -improvement, but a select few may observe minor performance degradation with the default settings. Users are encouraged -to contact the SUNDIALS team about any perfomance changes that they notice. - -Added new capabilities for monitoring the solve phase in the ``SUNNONLINSOL_NEWTON`` and ``SUNNONLINSOL_FIXEDPOINT`` -modules, and the SUNDIALS iterative linear solver modules. SUNDIALS must be built with the CMake option -``SUNDIALS_BUILD_WITH_MONITORING`` to use these capabilties. - -Added the optional function ``KINSetJacTimesVecSysFn`` to specify an alternative system function for computing -Jacobian-vector products with the internal difference quotient approximation. - -Changes in v5.2.0 ------------------ - -Fixed a build system bug related to the Fortran 2003 interfaces when using the IBM XL compiler. When building the -Fortran 2003 interfaces with an XL compiler it is recommended to set ``CMAKE_Fortran_COMPILER`` to ``f2003``, -``xlf2003``, or ``xlf2003_r``. - -Fixed a linkage bug affecting Windows users that stemmed from dllimport/dllexport attributes missing on some -SUNDIALS API functions. - -Added a new ``SUNMatrix`` implementation, ``SUNMATRIX_CUSPARSE``, that interfaces to the sparse matrix implementation -from the NVIDIA cuSPARSE library. In addition, the ``SUNLINSOL_CUSOLVER_BATCHQR`` linear solver has been updated to use -this matrix, therefore, users of this module will need to update their code. These modules are still considered to be -experimental, thus they are subject to breaking changes even in minor releases. - -Changes in v5.1.0 ------------------ - -Fixed a build system bug related to finding LAPACK/BLAS. - -Fixed a build system bug related to checking if the KLU library works. - -Fixed a build system bug related to finding PETSc when using the CMake variables ``PETSC_INCLUDES`` and -``PETSC_LIBRARIES`` instead of ``PETSC_DIR``. - -Added a new build system option, ``CUDA_ARCH``, that can be used to specify the CUDA architecture to compile for. - -Added two utility functions, ``SUNDIALSFileOpen`` and ``SUNDIALSFileClose`` for creating/destroying file pointers that -are useful when using the Fortran 2003 interfaces. - -Added support for constant damping when using Anderson acceleration. See :numref:`KINSOL.Mathematics` and the -description of the ``KINSetDampingAA`` function for more details. - -Changes in v5.0.0 ------------------ - -Build system changes -^^^^^^^^^^^^^^^^^^^^ - -- Increased the minimum required CMake version to 3.5 for most SUNDIALS configurations, and 3.10 when CUDA or - OpenMP with device offloading are enabled. - -- The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been removed to simplify builds as - SUNDIALS packages do not use BLAS directly. For third party libraries that require linking to BLAS, the path to - the BLAS library should be included in the ``_LIBRARIES`` variable for the third party library *e.g.*, - ``SUPERLUDIST_LIBRARIES`` when enabling SuperLU_DIST. - -- Fixed a bug in the build system that prevented the ``NVECTOR_PTHREADS`` module from being built. - -NVECTOR module changes -^^^^^^^^^^^^^^^^^^^^^^ - -- Two new functions were added to aid in creating custom ``N_Vector`` objects. The constructor ``N_VNewEmpty`` - allocates an “empty” generic ``N_Vector`` with the object’s content pointer and the function pointers in the - operations structure initialized to ``NULL``. When used in the constructor for custom objects this function will ease - the introduction of any new optional operations to the ``N_Vector`` API by ensuring only required operations need to - be set. Additionally, the function ``N_VCopyOps(w, v)`` has been added to copy the operation function pointers - between vector objects. When used in clone routines for custom vector objects these functions also will ease the - introduction of any new optional operations to the ``N_Vector`` API by ensuring all operations are copied when - cloning objects. See :numref:`NVectors.Description.utilities` for more details. - -- Two new ``N_Vector`` implementations, ``NVECTOR_MANYVECTOR`` and ``NVECTOR_MPIMANYVECTOR``, have been created to support - flexible partitioning of solution data among different processing elements (e.g., CPU + GPU) or for multi-physics - problems that couple distinct MPI-based simulations together. This implementation is accompanied by additions to user - documentation and SUNDIALS examples. See :numref:`NVectors.ManyVector` and :numref:`NVectors.MPIManyVector` for more details. - -- One new required vector operation and ten new optional vector operations have been added to the ``N_Vector`` API. - The new required operation, ``N_VGetLength``, returns the global length of an ``N_Vector``. The optional operations - have been added to support the new ``NVECTOR_MPIMANYVECTOR`` implementation. The operation ``N_VGetCommunicator`` must - be implemented by subvectors that are combined to create an ``NVECTOR_MPIMANYVECTOR``, but is not used outside of this - context. The remaining nine operations are optional local reduction operations intended to eliminate unnecessary - latency when performing vector reduction operations (norms, etc.) on distributed memory systems. The optional local - reduction vector operations are ``N_VDotProdLocal``, ``N_VMaxNormLocal``, ``N_VMinLocal``, ``N_VL1NormLocal``, - ``N_VWSqrSumLocal``, ``N_VWSqrSumMaskLocal``, ``N_VInvTestLocal``, ``N_VConstrMaskLocal``, and - ``N_VMinQuotientLocal``. If an ``N_Vector`` implementation defines any of the local operations as ``NULL``, then the - ``NVECTOR_MPIMANYVECTOR`` will call standard ``N_Vector`` operations to complete the computation. See - :numref:`NVectors.Ops.Local` for more details. - -- An additional ``N_Vector`` implementation, ``NVECTOR_MPIPLUSX``, has been created to support the MPI+X paradigm where - X is a type of on-node parallelism (*e.g.*, OpenMP, CUDA). The implementation is accompanied by additions to user - documentation and SUNDIALS examples. See :numref:`NVectors.MPIPlusX` for more details. - -- The ``*_MPICuda`` and ``*_MPIRaja`` functions have been removed from the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` - implementations respectively. Accordingly, the ``nvector_mpicuda.h``, ``nvector_mpiraja.h``, - ``libsundials_nvecmpicuda.lib``, and ``libsundials_nvecmpicudaraja.lib`` files have been removed. Users should use - the ``NVECTOR_MPIPLUSX`` module coupled in conjunction with the ``NVECTOR_CUDA`` or ``NVECTOR_RAJA`` modules to replace the - functionality. The necessary changes are minimal and should require few code modifications. See the programs in - ``examples/ida/mpicuda`` and ``examples/ida/mpiraja`` for examples of how to use the ``NVECTOR_MPIPLUSX`` module with - the ``NVECTOR_CUDA`` and ``NVECTOR_RAJA`` modules respectively. - -- Fixed a memory leak in the ``NVECTOR_PETSC`` module clone function. - -- Made performance improvements to the ``NVECTOR_CUDA`` module. Users who utilize a non-default stream should no longer - see default stream synchronizations after memory transfers. - -- Added a new constructor to the ``NVECTOR_CUDA`` module that allows a user to provide custom allocate and free functions - for the vector data array and internal reduction buffer. See - :numref:`NVectors.CUDA.Functions` for more details. - -- Added new Fortran 2003 interfaces for most ``N_Vector`` modules. See Chapter :numref:`NVectors` for more - details on how to use the interfaces. - -- Added three new ``N_Vector`` utility functions, ``FN_VGetVecAtIndexVectorArray``, ``FN_VSetVecAtIndexVectorArray``, - and ``FN_VNewVectorArray``, for working with ``N_Vector`` arrays when using the Fortran - 2003 interfaces. See :numref:`NVectors.Description.utilities` for more details. - -SUNMatrix module changes -^^^^^^^^^^^^^^^^^^^^^^^^ - -- Two new functions were added to aid in creating custom ``SUNMatrix`` objects. The constructor ``SUNMatNewEmpty`` - allocates an “empty” generic ``SUNMatrix`` with the object’s content pointer and the function pointers in the - operations structure initialized to ``NULL``. When used in the constructor for custom objects this function will ease - the introduction of any new optional operations to the ``SUNMatrix`` API by ensuring only required operations need - to be set. Additionally, the function ``SUNMatCopyOps(A, B)`` has been added to copy the operation function pointers - between matrix objects. When used in clone routines for custom matrix objects these functions also will ease the - introduction of any new optional operations to the ``SUNMatrix`` API by ensuring all operations are copied when - cloning objects. See :numref:`SUNMatrix.Description` for more details. - -- A new operation, ``SUNMatMatvecSetup``, was added to the ``SUNMatrix`` API to perform any setup necessary for - computing a matrix-vector product. This operation is useful for ``SUNMatrix`` implementations which need to prepare - the matrix itself, or communication structures before performing the matrix-vector product. Users who have - implemented custom ``SUNMatrix`` modules will need to at least update their code to set the corresponding ``ops`` - structure member, ``matvecsetup``, to ``NULL``. See :numref:`SUNMatrix.Ops` for - more details. - -- The generic ``SUNMatrix`` API now defines error codes to be returned by ``SUNMatrix`` operations. Operations - which return an integer flag indiciating success/failure may return different values than previously. See - "SUNMatrix Error Codes" for more details. - -- A new ``SUNMatrix`` (and ``SUNLinearSolver``) implementation was added to facilitate the use of the SuperLU_DIST - library with SUNDIALS. See :numref:`SUNMatrix.SLUNRloc` for more details. - -- Added new Fortran 2003 interfaces for most ``SUNMatrix`` modules. See Chapter :numref:`SUNMatrix` for - more details on how to use the interfaces. - -SUNLinearSolver module changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -- A new function was added to aid in creating custom ``SUNLinearSolver`` objects. The constructor ``SUNLinSolNewEmpty`` - allocates an “empty” generic ``SUNLinearSolver`` with the object’s content pointer and the function pointers in the - operations structure initialized to ``NULL``. When used in the constructor for custom objects this function will ease - the introduction of any new optional operations to the ``SUNLinearSolver`` API by ensuring only required operations need - to be set. See :numref:`SUNLinSol.API.Custom` for more details. - -- The return type of the ``SUNLinearSolver`` API function ``SUNLinSolLastFlag`` has changed from ``long int`` to - ``sunindextype`` to be consistent with the type used to store row indices in dense and banded linear solver modules. - -- Added a new optional operation to the ``SUNLinearSolver`` API, ``SUNLinSolGetID``, that returns a ``SUNLinearSolver_ID`` - for identifying the linear solver module. - -- The ``SUNLinearSolver`` API has been updated to make the initialize and setup functions optional. - -- A new ``SUNLinearSolver`` (and ``SUNMatrix``) implementation was added to facilitate the use of the SuperLU_DIST - library with SUNDIALS. See :numref:`SUNLinSol.SuperLUDIST` for more details. - -- Added a new ``SUNLinearSolver`` implementation, ``SUNLinearSolver_cuSolverSp_batchQR``, which leverages the NVIDIA - cuSOLVER sparse batched QR method for efficiently solving block diagonal linear systems on NVIDIA GPUs. See :numref:`SUNLinSol.cuSolverSp` for more details. - -- Added three new accessor functions to the ``SUNLINSOL_KLU`` module, ``SUNLinSol_KLUGetSymbolic``, - ``SUNLinSol_KLUGetNumeric``, and ``SUNLinSol_KLUGetCommon``, to provide user access to the underlying KLU solver - structures. See :numref:`SUNLinSol.KLU.Usage` for more details. - -- Added new Fortran 2003 interfaces for most ``SUNLinearSolver`` modules. See Chapter :numref:`SUNLinSol` for - more details on how to use the interfaces. - -KINSOL changes -^^^^^^^^^^^^^^ - -- Fixed a bug in the KINSOL linear solver interface where the auxiliary scalar ``sJpnorm`` was not computed when - necessary with the Picard iteration and the auxiliary scalar ``sFdotJp`` was unnecessarily computed in some cases. - -- The KINLS interface has been updated to only zero the Jacobian matrix before calling a user-supplied Jacobian - evaluation function when the attached linear solver has type ``SUNLINEARSOLVER_DIRECT``. - -- Added a Fortran 2003 interface to KINSOL. See :numref:`SUNDIALS.Fortran` for more details. - -Changes in v4.1.0 ------------------ - -An additional ``N_Vector`` implementation was added for the TPetra vector from the Trilinos library to -facilitate interoperability between SUNDIALS and Trilinos. This implementation is accompanied by additions -to user documentation and SUNDIALS examples. - -The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option ``EXAMPLES_ENABLE_CUDA`` enables all examples -that use CUDA including the RAJA examples with a CUDA back end (if the RAJA ``N_Vector`` is enabled). - -The implementation header file ``kin_impl.h`` is no longer installed. This means users who are directly manipulating the -``KINMem`` structure will need to update their code to use KINSOL’s public API. - -Python is no longer required to run ``make test`` and ``make test_install``. - -Changes in v4.0.2 ------------------ - -Added information on how to contribute to SUNDIALS and a contributing agreement. - -Moved definitions of DLS and SPILS backwards compatibility functions to a source file. The symbols are now included in -the KINSOL library, ``libsundials_kinsol``. - -Changes in v4.0.1 ------------------ - -No changes were made in this release. - -Changes in v4.0.0 ------------------ - -KINSOL’s previous direct and iterative linear solver interfaces, KINDls and KINSpils, have been merged -into a single unified linear solver interface, KINLs, to support any valid ``SUNLinearSolver`` module. This includes -the “DIRECT” and “ITERATIVE” types as well as the new “MATRIX_ITERATIVE” type. Details regarding how KINLs -utilizes linear solvers of each type as well as discussion regarding intended use cases for user-supplied -``SUNLinearSolver`` implementations are included in Chapter :numref:`SUNLinSol`. All KINSOL example -programs and the standalone linear solver examples have been updated to use the unified linear solver interface. - -The unified interface for the new KINLs module is very similar to the previous KINDls and KINSpils -interfaces. To minimize challenges in user migration to the new names, the previous C and Fortran routine names -may still be used; these will be deprecated in future releases, so we recommend that users migrate to the new names -soon. Additionally, we note that Fortran users, however, may need to enlarge their ``iout`` array of optional integer -outputs, and update the indices that they query for certain linear-solver-related statistics. - -The names of all constructor routines for SUNDIALS-provided ``SUNLinearSolver`` implementations have been updated to -follow the naming convention ``SUNLinSol_*`` where ``*`` is the name of the linear solver. The new names are -``SUNLinSol_Band``, ``SUNLinSol_Dense``, ``SUNLinSol_KLU``, ``SUNLinSol_LapackBand``, ``SUNLinSol_LapackDense``, -``SUNLinSol_PCG``, ``SUNLinSol_SPBCGS``, ``SUNLinSol_SPFGMR``, ``SUNLinSol_SPGMR``, ``SUNLinSol_SPTFQMR``, and -``SUNLinSol_SuperLUMT``. Solver-specific “set” routine names have been similarly standardized. To minimize challenges in -user migration to the new names, the previous routine names may still be used; these will be deprecated in future -releases, so we recommend that users migrate to the new names soon. All KINSOL example programs and the standalone -linear solver examples have been updated to use the new naming convention. - -The ``SUNBandMatrix`` constructor has been simplified to remove the storage upper bandwidth argument. - -Three fused vector operations and seven vector array operations have been added to the ``N_Vector`` API. -These *optional* operations are disabled by default and may be activated by calling vector specific -routines after creating an ``N_Vector`` (see Chapter :numref:`NVectors` for more details). The new -operations are intended to increase data reuse in vector operations, reduce parallel communication on -distributed memory systems, and lower the number of kernel launches on systems with accelerators. The -fused operations are ``N_VLinearCombination``, ``N_VScaleAddMulti``, and ``N_VDotProdMulti`` and the -vector array operations are ``N_VLinearCombinationVectorArray``, ``N_VScaleVectorArray``, -``N_VConstVectorArray``, ``N_VWrmsNormVectorArray``, ``N_VWrmsNormMaskVectorArray``, -``N_VScaleAddMultiVectorArray``, and ``N_VLinearCombinationVectorArray``. If an ``N_Vector`` -implementation defines any of these operations as ``NULL``, then standard ``N_Vector`` operations will -automatically be called as necessary to complete the computation. Multiple updates to ``NVECTOR_CUDA`` -were made: - -- Changed ``N_VGetLength_Cuda`` to return the global vector length instead of the local vector length. - -- Added ``N_VGetLocalLength_Cuda`` to return the local vector length. - -- Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. - -- Removed the accessor functions in the namespace suncudavec. - -- Changed the ``N_VMake_Cuda`` function to take a host data pointer and a device data pointer instead of an - ``N_VectorContent_Cuda`` object. - -- Added the ability to set the ``cudaStream_t`` used for execution of the ``NVECTOR_CUDA`` kernels. See the function - ``N_VSetCudaStreams_Cuda``. - -- Added ``N_VNewManaged_Cuda``, ``N_VMakeManaged_Cuda``, and ``N_VIsManagedMemory_Cuda`` functions to accommodate using - managed memory with the ``NVECTOR_CUDA``. - -Multiple changes to ``NVECTOR_RAJA`` were made: - -- Changed ``N_VGetLength_Raja`` to return the global vector length instead of the local vector length. - -- Added ``N_VGetLocalLength_Raja`` to return the local vector length. - -- Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. - -- Removed the accessor functions in the namespace suncudavec. - -A new ``N_Vector`` implementation for leveraging OpenMP 4.5+ device offloading has been added, ``NVECTOR_OPENMPDEV``. See -:numref:`NVectors.OpenMPDEV` for more details. - -Changes in v3.2.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a bug in the CUDA ``N_Vector`` where the ``N_VInvTest`` operation could write beyond the allocated - vector data. - -- Fixed library installation path for multiarch systems. This fix changes the default library - installation path to ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` from ``CMAKE_INSTALL_PREFIX/lib``. - ``CMAKE_INSTALL_LIBDIR`` is automatically set, but is available as a CMake option that can modified. - -Changes in v3.2.0 ------------------ - -Fixed a problem with setting ``sunindextype`` which would occur with some compilers (e.g. armclang) that -did not define ``__STDC_VERSION__``. Added hybrid MPI/CUDA and MPI/RAJA vectors to allow use of more than -one MPI rank when using a GPU system. The vectors assume one GPU device per MPI rank. Changed the name -of the RAJA ``N_Vector`` library to ``libsundials_nveccudaraja.lib`` from ``libsundials_nvecraja.lib`` to -better reflect that we only support CUDA as a backend for RAJA currently. Several changes were made to -the build system: - -- CMake 3.1.3 is now the minimum required CMake version. - -- Deprecate the behavior of the ``SUNDIALS_INDEX_TYPE`` CMake option and added the ``SUNDIALS_INDEX_SIZE`` CMake option - to select the ``sunindextype`` integer size. - -- The native CMake FindMPI module is now used to locate an MPI installation. - -- If MPI is enabled and MPI compiler wrappers are not set, the build system will check if ``CMAKE_<language>_COMPILER`` - can compile MPI programs before trying to locate and use an MPI installation. - -- The previous options for setting MPI compiler wrappers and the executable for running MPI programs have been have - been depreated. The new options that align with those used in native CMake FindMPI module are ``MPI_C_COMPILER``, - ``MPI_CXX_COMPILER``, ``MPI_Fortran_COMPILER``, and ``MPIEXEC_EXECUTABLE``. - -- When a Fortran name-mangling scheme is needed (e.g., ``ENABLE_LAPACK`` is ``ON``) the build system will infer the - scheme from the Fortran compiler. If a Fortran compiler is not available or the inferred or default scheme needs to - be overridden, the advanced options ``SUNDIALS_F77_FUNC_CASE`` and ``SUNDIALS_F77_FUNC_UNDERSCORES`` can be used to - manually set the name-mangling scheme and bypass trying to infer the scheme. - -- Parts of the main CMakeLists.txt file were moved to new files in the ``src`` and ``example`` directories to make the - CMake configuration file structure more modular. - -Changes in v3.1.2 ------------------ - -The changes in this minor release include the following: - -- Updated the minimum required version of CMake to 2.8.12 and enabled using rpath by default to locate shared libraries - on OSX. - -- Fixed Windows specific problem where ``sunindextype`` was not correctly defined when using 64-bit integers for the - SUNDIALS index type. On Windows ``sunindextype`` is now defined as the MSVC basic type ``__int64``. - -- Added sparse SUNMatrix “Reallocate” routine to allow specification of the nonzero storage. - -- Updated the KLU SUNLinearSolver module to set constants for the two reinitialization types, and fixed a bug in the - full reinitialization approach where the sparse SUNMatrix pointer would go out of scope on some architectures. - -- Updated the “ScaleAdd” and “ScaleAddI” implementations in the sparse SUNMatrix module to more optimally handle the - case where the target matrix contained sufficient storage for the sum, but had the wrong sparsity pattern. The sum - now occurs in-place, by performing the sum backwards in the existing storage. However, it is still more efficient if - the user-supplied Jacobian routine allocates storage for the sum :math:`I+\gamma J` manually (with zero entries if - needed). - -- Changed the LICENSE install path to ``instdir/include/sundials``. - -Changes in v3.1.1 ------------------ - -The changes in this minor release include the following: - -- Fixed a potential memory leak in the SPGMR and SPFGMR linear solvers: if “Initialize” was called multiple - times then the solver memory was reallocated (without being freed). - -- Updated KLU SUNLinearSolver module to use a ``typedef`` for the precision-specific solve function to be used (to - avoid compiler warnings). - -- Added missing typecasts for some ``(void*)`` pointers (again, to avoid compiler warnings). - -- Bugfix in ``sunmatrix_sparse.c`` where we had used ``int`` instead of ``sunindextype`` in one location. - -- Fixed a minor bug in ``KINPrintInfo`` where a case was missing for ``KIN_REPTD_SYSFUNC_ERR`` leading to an undefined - info message. - -- Added missing ``#include <stdio.h>`` in ``N_Vector`` and ``SUNMatrix`` header files. - -- Fixed an indexing bug in the CUDA ``N_Vector`` implementation of ``N_VWrmsNormMask`` and revised the - RAJA ``N_Vector`` implementation of ``N_VWrmsNormMask`` to work with mask arrays using values other than zero - or one. Replaced ``double`` with ``realtype`` in the RAJA vector test functions. - -- Fixed compilation issue with GCC 7.3.0 and Fortran programs that do not require a ``SUNMatrix`` or ``SUNLinearSolver`` - module (e.g., iterative linear solvers or fixed pointer solver). - -In addition to the changes above, minor corrections were also made to the example programs, build system, and user -documentation. - -Changes in v3.1.0 ------------------ - -Added ``N_Vector`` print functions that write vector data to a specified file (e.g., ``N_VPrintFile_Serial``). - -Added ``make test`` and ``make test_install`` options to the build system for testing SUNDIALS after building with -``make`` and installing with ``make install`` respectively. - -Changes in v3.0.0 ------------------ - -All interfaces to matrix structures and linear solvers have been reworked, and all example programs have been updated. -The goal of the redesign of these interfaces was to provide more encapsulation and ease in the interfacing of custom -linear solvers and interoperability with linear solver libraries. Specific changes include: - -- Added generic SUNMATRIX module with three provided implementations: dense, banded and sparse. These replicate - previous SUNDIALS Dls and Sls matrix structures in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNMATRIX modules. - -- Added generic ``SUNLinearSolver`` module with eleven provided implementations: SUNDIALS native dense, - SUNDIALS native banded, LAPACK dense, LAPACK band, KLU, SuperLU_MT, SPGMR, SPBCGS, SPTFQMR, SPFGMR, and PCG. - These replicate previous SUNDIALS generic linear solvers in a single object-oriented API. - -- Added example problems demonstrating use of generic SUNLINEARSOLVER modules. - -- Expanded package-provided direct linear solver (Dls) interfaces and scaled, preconditioned, iterative linear solver - (Spils) interfaces to utilize generic SUNMATRIX and SUNLINEARSOLVER objects. - -- Removed package-specific, linear solver-specific, solver modules (e.g. CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since - their functionality is entirely replicated by the generic Dls/Spils interfaces and SUNLINEARSOLVER/SUNMATRIX modules. - The exception is CVDIAG, a diagonal approximate Jacobian solver available to CVODE and CVODES. - -- Converted all SUNDIALS example problems to utilize new generic SUNMATRIX and SUNLINEARSOLVER objects, along - with updated Dls and Spils linear solver interfaces. - -- Added Spils interface routines to ARKode, CVODE, CVODES, IDA and IDAS to allow specification of a user-provided - "JTSetup" routine. This change supports users who wish to set up data structures for the user-provided - Jacobian-times-vector ("JTimes") routine, and where the cost of one JTSetup setup per Newton iteration can be - amortized between multiple JTimes calls. - -Two additional ``N_Vector`` implementations were added – one for CUDA and one for RAJA vectors. These -vectors are supplied to provide very basic support for running on GPU architectures. Users are advised that these -vectors both move all data to the GPU device upon construction, and speedup will only be realized if the user also -conducts the right-hand-side function evaluation on the device. In addition, these vectors assume the problem fits on -one GPU. Further information about RAJA, users are referred to th web site, https://software.llnl.gov/RAJA/. These -additions are accompanied by additions to various interface functions and to user documentation. - -All indices for data structures were updated to a new ``sunindextype`` that can be configured to be a 32- or 64-bit -integer data index type. ``sunindextype`` is defined to be ``int32_t`` or ``int64_t`` when portable types are supported, -otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces continue to use ``long int`` for indices, -except for their sparse matrix interface that now uses the new ``sunindextype``. This new flexible capability for index -types includes interfaces to PETSc, hypre, SuperLU_MT, and KLU with either 32-bit or 64-bit capabilities depending how -the user configures SUNDIALS. - -To avoid potential namespace conflicts, the macros defining ``booleantype`` values ``TRUE`` and ``FALSE`` have been -changed to ``SUNTRUE`` and ``SUNFALSE`` respectively. - -Temporary vectors were removed from preconditioner setup and solve routines for all packages. It is assumed that all -necessary data for user-provided preconditioner operations will be allocated and stored in user-provided data -structures. - -The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS type information for use in Fortran -programs. - -The build system was expanded to support many of the xSDK-compliant keys. The xSDK is a movement in scientific software -to provide a foundation for the rapid and efficient production of high-quality, sustainable extreme-scale scientific -applications. More information can be found at, https://xsdk.info. - -Added functions ``SUNDIALSGetVersion`` and ``SUNDIALSGetVersionNumber`` to get SUNDIALS release version -information at runtime. - -In addition, numerous changes were made to the build system. These include the addition of separate ``BLAS_ENABLE`` and -``BLAS_LIBRARIES`` CMake variables, additional error checking during CMake configuration, minor bug fixes, and renaming -CMake options to enable/disable examples for greater clarity and an added option to enable/disable Fortran 77 examples. -These changes included changing ``EXAMPLES_ENABLE`` to ``EXAMPLES_ENABLE_C``, changing ``CXX_ENABLE`` to -``EXAMPLES_ENABLE_CXX``, changing ``F90_ENABLE`` to ``EXAMPLES_ENABLE_F90``, and adding an ``EXAMPLES_ENABLE_F77`` -option. - -A bug fix was done to correct the fcmix name translation for ``FKIN_SPFGMR``. - -Corrections and additions were made to the examples, to installation-related files, and to the user documentation. - -Changes in v2.9.0 ------------------ - -Two additional ``N_Vector`` implementations were added – one for Hypre (parallel) vectors, and one for PETSc vectors. -These additions are accompanied by additions to various interface functions and to user documentation. - -Each ``N_Vector`` module now includes a function, ``N_VGetVectorID``, that returns the ``N_Vector`` module name. - -The Picard iteration return was chanegd to always return the newest iterate upon success. A minor bug in the line search -was fixed to prevent an infinite loop when the beta condition fails and lamba is below the minimum size. - -For each linear solver, the various solver performance counters are now initialized to 0 in both the solver -specification function and in solver ``linit`` function. This ensures that these solver counters are initialized upon -linear solver instantiation as well as at the beginning of the problem solution. - -A memory leak was fixed in the banded preconditioner interface. In addition, updates were done to return integers from -linear solver and preconditioner ’free’ functions. - -Corrections were made to three Fortran interface functions. The Anderson acceleration scheme was enhanced by use of QR -updating. - -The Krylov linear solver Bi-CGstab was enhanced by removing a redundant dot product. Various additions and corrections -were made to the interfaces to the sparse solvers KLU and SuperLU_MT, including support for CSR format when using KLU. - -The functions FKINCREATE and FKININIT were added to split the FKINMALLOC routine into two pieces. FKINMALLOC remains for -backward compatibility, but documentation for it has been removed. - -A new examples was added for use of the OpenMP vector. - -Minor corrections and additions were made to the KINSOL solver, to the Fortran interfaces, to the examples, to -installation-related files, and to the user documentation. - -Changes in v2.8.0 ------------------ - -Two major additions were made to the globalization strategy options (``KINSol`` argument ``strategy``). One is -fixed-point iteration, and the other is Picard iteration. Both can be accelerated by use of the Anderson acceleration -method. See the relevant paragraphs in Chapter :numref:`KINSOL.Mathematics`. - -Three additions were made to the linear system solvers that are available for use with the KINSOL solver. First, -in the serial case, an interface to the sparse direct solver KLU was added. Second, an interface to SuperLU_MT, the -multi-threaded version of SuperLU, was added as a thread-parallel sparse direct solver option, to be used with the -serial version of the ``N_Vector`` module. As part of these additions, a sparse matrix (CSC format) structure was added -to KINSOL. Finally, a variation of GMRES called Flexible GMRES was added. - -Otherwise, only relatively minor modifications were made to KINSOL: - -In function ``KINStop``, two return values were corrected to make the values of ``uu`` and ``fval`` consistent. - -A bug involving initialization of ``mxnewtstep`` was fixed. The error affects the case of repeated user calls to -``KINSol`` with no intervening call to ``KINSetMaxNewtonStep``. - -A bug in the increments for difference quotient Jacobian approximations was fixed in function ``kinDlsBandDQJac``. - -In ``KINLapackBand``, the line ``smu = MIN(N-1,mu+ml)`` was changed to ``smu = mu + ml`` to correct an illegal input -error for ``DGBTRF/DGBTRS``. - -In order to avoid possible name conflicts, the mathematical macro and function names ``MIN``, ``MAX``, ``SQR``, -``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and ``RPowerR`` were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, -``SUNRabs``, ``SUNRsqrt``, ``SUNRexp``, ``SRpowerI``, and ``SUNRpowerR``, respectively. These names occur in both the -solver and in various example programs. - -In the FKINSOL module, an incorrect return value ``ier`` in ``FKINfunc`` was fixed. - -In the FKINSOL optional input routines ``FKINSETIIN``, ``FKINSETRIN``, and ``FKINSETVIN``, the optional fourth argument -``key_length`` was removed, with hardcoded key string lengths passed to all ``strncmp`` tests. - -In all FKINSOL examples, integer declarations were revised so that those which must match a C type ``long int`` are -declared ``INTEGER*8``, and a comment was added about the type match. All other integer declarations are just -``INTEGER``. Corresponding minor corrections were made to the user guide. - -Two new ``N_Vector`` modules have been added for thread-parallel computing environments — one for OpenMP, denoted -``NVECTOR_OPENMP``, and one for Pthreads, denoted ``NVECTOR_PTHREADS``. - -With this version of SUNDIALS, support and documentation of the Autotools mode of installation is being dropped, -in favor of the CMake mode, which is considered more widely portable. - -Changes in v2.7.0 ------------------ - -One significant design change was made with this release: The problem size and its relatives, bandwidth parameters, -related internal indices, pivot arrays, and the optional output ``lsflag`` have all been changed from type ``int`` to -type ``long int``, except for the problem size and bandwidths in user calls to routines specifying BLAS/LAPACK routines -for the dense/band linear solvers. The function ``NewIntArray`` is replaced by a pair ``NewIntArray``/``NewLintArray``, -for ``int`` and ``long int`` arrays, respectively. - -A large number of errors have been fixed. Three major logic bugs were fixed – involving updating the solution vector, -updating the linesearch parameter, and a missing error return. Three minor errors were fixed – involving setting -``etachoice`` in the Matlab/KINSOL interface, a missing error case in ``KINPrintInfo``, and avoiding an -exponential overflow in the evaluation of ``omega``. In each linear solver interface function, the linear solver memory -is freed on an error return, and the ``**Free`` function now includes a line setting to NULL the main memory pointer to -the linear solver memory. In the installation files, we modified the treatment of the macro SUNDIALS_USE_GENERIC_MATH, -so that the parameter GENERIC_MATH_LIB is either defined (with no value) or not defined. - -Changes in v2.6.0 ------------------ - -This release introduces a new linear solver module, based on BLAS and LAPACK for both dense and banded matrices. - -The user interface has been further refined. Some of the API changes involve: (a) a reorganization of all linear solver -modules into two families (besides the already present family of scaled preconditioned iterative linear solvers, the -direct solvers, including the new LAPACK-based ones, were also organized into a *direct* family); (b) maintaining a -single pointer to user data, optionally specified through a ``Set``-type function; (c) a general streamlining of the -band-block-diagonal preconditioner module distributed with the solver. - -Changes in v2.5.0 ------------------ - -The main changes in this release involve a rearrangement of the entire SUNDIALS source tree (see -:numref:`KINSOL.Organization`). At the user interface level, the main impact is in the mechanism of including -SUNDIALS header files which must now include the relative path (e.g. ``#include <cvode/cvode.h>``). Additional -changes were made to the build system: all exported header files are now installed in separate subdirectories of the -installation *include* directory. - -The functions in the generic dense linear solver (``sundials_dense`` and ``sundials_smalldense``) were modified to work -for rectangular :math:`m \times n` matrices (:math:`m \le n`), while the factorization and solution functions were -renamed to ``DenseGETRF``/``denGETRF`` and ``DenseGETRS``/``denGETRS``, respectively. The factorization and solution -functions in the generic band linear solver were renamed ``BandGBTRF`` and ``BandGBTRS``, respectively. - -Changes in v2.4.0 ------------------ - -KINSPBCG, KINSPTFQMR, KINDENSE, and KINBAND modules have been added to interface with the Scaled -Preconditioned Bi-CGStab (SPBCG), Scaled Preconditioned Transpose-Free Quasi-Minimal Residual (SPTFQMR), -DENSE, and BAND linear solver modules, respectively. (For details see Chapter :numref:KINSOL.Usage.CC.) -Corresponding additions were made to the Fortran interface module FKINSOL. At the same time, function type names -for Scaled Preconditioned Iterative Linear Solvers were added for the user-supplied Jacobian-times-vector and -preconditioner setup and solve functions. - -Regarding the Fortran interface module FKINSOL, optional inputs are now set using ``FKINSETIIN`` (integer inputs), -``FKINSETRIN`` (real inputs), and ``FKINSETVIN`` (vector inputs). Optional outputs are still obtained from the ``IOUT`` -and ``ROUT`` arrays which are owned by the user and passed as arguments to ``FKINMALLOC``. - -The KINDENSE and KINBAND linear solver modules include support for nonlinear residual monitoring which can -be used to control Jacobian updating. - -To reduce the possibility of conflicts, the names of all header files have been changed by adding unique prefixes -(``kinsol_`` and ``sundials_``). When using the default installation procedure, the header files are exported under -various subdirectories of the target ``include`` directory. For more details see Appendix :numref:`Installation`. - -Changes in v2.3.0 ------------------ - -The user interface has been further refined. Several functions used for setting optional inputs were combined into a -single one. Additionally, to resolve potential variable scope issues, all SUNDIALS solvers release user data right -after its use. The build system has been further improved to make it more robust. - -Changes in v2.2.1 ------------------ - -The changes in this minor SUNDIALS release affect only the build system. - -Changes in v2.2.0 ------------------ - -The major changes from the previous version involve a redesign of the user interface across the entire SUNDIALS -suite. We have eliminated the mechanism of providing optional inputs and extracting optional statistics from the solver -through the ``iopt`` and ``ropt`` arrays. Instead, KINSOL now provides a set of routines (with prefix ``KINSet``) -to change the default values for various quantities controlling the solver and a set of extraction routines (with prefix -``KINGet``) to extract statistics after return from the main solver routine. Similarly, each linear solver module -provides its own set of ``Set``- and ``Get``-type routines. For more details see Chapter :numref:KINSOL.Usage.CC. - -Additionally, the interfaces to several user-supplied routines (such as those providing Jacobian-vector products and -preconditioner information) were simplified by reducing the number of arguments. The same information that was -previously accessible through such arguments can now be obtained through ``Get``-type functions. - -Installation of KINSOL (and all of SUNDIALS) has been completely redesigned and is now based on configure -scripts. +For changes in prior versions of SUNDIALS see :numref:`Changelog`. .. _KINSOL.Introduction.reading: diff --git a/doc/kinsol/guide/source/RecentChanges_link.rst b/doc/kinsol/guide/source/RecentChanges_link.rst new file mode 100644 index 0000000000..0eb6be0ebc --- /dev/null +++ b/doc/kinsol/guide/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/kinsol/guide/source/conf.py b/doc/kinsol/guide/source/conf.py index e5261db082..366c1af7d6 100644 --- a/doc/kinsol/guide/source/conf.py +++ b/doc/kinsol/guide/source/conf.py @@ -26,10 +26,14 @@ # 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', +extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx_sundials'] +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../../superbuild/build/html/objects.inv', None))} + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/kinsol/guide/source/index.rst b/doc/kinsol/guide/source/index.rst index ad6aca8371..2d3d1a6dbb 100644 --- a/doc/kinsol/guide/source/index.rst +++ b/doc/kinsol/guide/source/index.rst @@ -37,6 +37,7 @@ KINSOL Documentation sundials/Install_link.rst Constants History_link.rst + Changelog_link.rst References .. only:: html diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst new file mode 100644 index 0000000000..136e910f4a --- /dev/null +++ b/doc/shared/Changelog.rst @@ -0,0 +1,3277 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + For package-specific references use :ref: rather than :numref: + so intersphinx links to the appropriate place on read the docs + ---------------------------------------------------------------- + +.. _Changelog: + +********* +Changelog +********* + +.. SED_REPLACEMENT_KEY + +Changes to SUNDIALS in release X.Y.Z +==================================== + +.. include:: RecentChanges_link.rst + +Changes to SUNDIALS in release 7.0.0 +==================================== + +**Major Feature** + +SUNDIALS now has more robust and uniform error handling. Non-release builds will +be built with additional error checking by default. See +:numref:`SUNDIALS.Errors` for details. + +**Breaking Changes** + +*Minimum C Standard* + +SUNDIALS now requires using a compiler that supports a subset of the C99 +standard. Note with the Microsoft C/C++ compiler the subset of C99 features +utilized by SUNDIALS are available starting with `Visual Studio 2015 +<https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. + +*Minimum CMake Version* + +CMake 3.18 or newer is now required when building SUNDIALS. + +*Deprecated Types and Functions Removed* + +The previously deprecated types ``realtype`` and ``booleantype`` were removed +from ``sundials_types.h`` and replaced with :c:type:`sunrealtype` and +:c:type:`sunbooleantype`. The deprecated names for these types can be used by +including the header file ``sundials_types_deprecated.h`` but will be fully +removed in the next major release. Functions, types and header files that were +previously deprecated have also been removed. + +*Error Handling Changes* + +With the addition of the new error handling capability, the ``*SetErrHandlerFn`` +and ``*SetErrFile`` functions in CVODE(S), IDA(S), ARKODE, and KINSOL have been +removed. Users of these functions can use the functions +:c:func:`SUNContext_PushErrHandler`, and :c:func:`SUNLogger_SetErrorFilename` +instead. For further details see Sections :numref:`SUNDIALS.Errors` and +:numref:`SUNDIALS.Logging`. + +In addition the following names/symbols were replaced by ``SUN_ERR_*`` codes: + ++----------------------------------+-----------------------------------+ +| Removed | Replaced with ``SUNErrCode`` | ++==================================+===================================+ +| ``SUNLS_SUCCESS`` | ``SUN_SUCCESS`` | ++----------------------------------+-----------------------------------+ +| ``SUNLS_UNRECOV_FAILURE`` | no replacement (value was unused) | ++----------------------------------+-----------------------------------+ +| ``SUNLS_MEM_NULL`` | ``SUN_ERR_ARG_CORRUPT`` | ++----------------------------------+-----------------------------------+ +| ``SUNLS_ILL_INPUT`` | ``SUN_ERR_ARG_*`` | ++----------------------------------+-----------------------------------+ +| ``SUNLS_MEM_FAIL`` | ``SUN_ERR_MEM_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUNLS_PACKAGE_FAIL_UNREC`` | ``SUN_ERR_EXT_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUNLS_VECTOROP_ERR`` | ``SUN_ERR_OP_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_SUCCESS`` | ``SUN_SUCCESS`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_MEM_NULL`` | ``SUN_ERR_ARG_CORRUPT`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_MEM_FAIL`` | ``SUN_ERR_MEM_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_ILL_INPUT`` | ``SUN_ERR_ARG_*`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_VECTOROP_ERR`` | ``SUN_ERR_OP_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUN_NLS_EXT_FAIL`` | ``SUN_ERR_EXT_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUNMAT_SUCCESS`` | ``SUN_SUCCESS`` | ++----------------------------------+-----------------------------------+ +| ``SUNMAT_ILL_INPUT`` | ``SUN_ERR_ARG_*`` | ++----------------------------------+-----------------------------------+ +| ``SUNMAT_MEM_FAIL`` | ``SUN_ERR_MEM_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUNMAT_OPERATION_FAIL`` | ``SUN_ERR_OP_FAIL`` | ++----------------------------------+-----------------------------------+ +| ``SUNMAT_MATVEC_SETUP_REQUIRED`` | ``SUN_ERR_OP_FAIL`` | ++----------------------------------+-----------------------------------+ + +The following functions have had their signature updated to ensure they can +leverage the new SUNDIALS error handling capabilities. + +* From ``sundials_futils.h`` + + * :c:func:`SUNDIALSFileOpen` + * :c:func:`SUNDIALSFileClose` + +* From ``sundials_memory.h`` + + * :c:func:`SUNMemoryNewEmpty` + * :c:func:`SUNMemoryHelper_Alias` + * :c:func:`SUNMemoryHelper_Wrap` + +* From ``sundials_nvector.h`` + + * :c:func:`N_VNewVectorArray` + +*SUNComm Type Added* + +We have replaced the use of a type-erased (i.e., ``void*``) pointer to a +communicator in place of ``MPI_Comm`` throughout the SUNDIALS API with a +:c:type:`SUNComm`, which is just a typedef to an ``int`` in builds without MPI +and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: + +- When MPI is enabled, all SUNDIALS libraries will include MPI symbols and + applications will need to include the path for MPI headers and link against + the corresponding MPI library. + +- All users will need to update their codes because the call to + :c:func:`SUNContext_Create` now takes a :c:type:`SUNComm` instead + of type-erased pointer to a communicator. For non-MPI codes, + pass :c:macro:`SUN_COMM_NULL` to the ``comm`` argument instead of + ``NULL``. For MPI codes, pass the ``MPI_Comm`` directly. + +- The same change must be made for calls to + :c:func:`SUNLogger_Create` or :c:func:`SUNProfiler_Create`. + +- Some users will need to update their calls to :c:func:`N_VGetCommunicator`, + and update any custom :c:type:`N_Vector` implementations that provide + :c:func:`N_VGetCommunicator`, since it now returns a :c:type:`SUNComm`. + +The change away from type-erased pointers for :c:type:`SUNComm` fixes problems +like the one described in +`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. + +The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the +``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed +accordingly. + +*SUNDIALS Core Library* + +Users now need to link to ``sundials_core`` in addition to the libraries already +linked to. This will be picked up automatically in projects that use the +SUNDIALS CMake target. The library ``sundials_generic`` has been superseded by +``sundials_core`` and is no longer available. This fixes some duplicate symbol +errors on Windows when linking to multiple SUNDIALS libraries. + +*Fortran Interface Modules Streamlined* + +We have streamlined the Fortran modules that need to be included by users by +combining the SUNDIALS core into one Fortran module, +``fsundials_core_mod``. Modules for implementations of the core APIs still exist +(e.g., for the Dense linear solver there is ``fsunlinsol_dense_mod``) as do the +modules for the SUNDIALS packages (e.g., ``fcvode_mod``). The following modules +are the ones that have been consolidated into ``fsundials_core_mod``: + +.. code-block:: fortran + + fsundials_adaptcontroller_mod + fsundials_context_mod + fsundials_futils_mod + fsundials_linearsolver_mod + fsundials_logger_mod + fsundials_matrix_mod + fsundials_nonlinearsolver_mod + fsundials_nvector_mod + fsundials_profiler_mod + fsundials_types_mod + +**Minor Changes** + +The ``CMAKE_BUILD_TYPE`` defaults to ``RelWithDebInfo`` mode now i.e., SUNDIALS +will be built with optimizations and debugging symbols enabled by default. +Previously the build type was unset by default so no optimization or debugging +flags were set. + +The advanced CMake options to override the inferred LAPACK name-mangling scheme +have been updated from ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` to :cmakeop:`SUNDIALS_LAPACK_CASE` and +:cmakeop:`SUNDIALS_LAPACK_UNDERSCORES`, respectively. + +As a subset of C99 is now required the CMake option ``USE_GENERIC_MATH`` as been +removed. + +The C++ convenience classes (e.g., ``sundials::Context``) have been moved to +from SUNDIALS ``.h`` headers to corresponding ``.hpp`` headers (e.g., +``sundials/sundials_context.hpp``) so C++ codes do not need to compile with +C++14 support when using the C API. + +Converted most previous Fortran 77 and 90 examples to use SUNDIALS' Fortran 2003 +interface. + +**Bug Fixes** + +Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so +that C++20 aggregate initialization can be used. + +Fixed integer overflow in the internal SUNDIALS hashmap. This resolves +`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and +`#249 <https://github.com/LLNL/sundials/issues/249>`_. + +**Deprecation Notice** + +The functions in ``sundials_math.h`` will be deprecated in the next release. + +.. code-block:: c + + sunrealtype SUNRpowerI(sunrealtype base, int exponent); + sunrealtype SUNRpowerR(sunrealtype base, sunrealtype exponent); + sunbooleantype SUNRCompare(sunrealtype a, sunrealtype b); + sunbooleantype SUNRCompareTol(sunrealtype a, sunrealtype b, sunrealtype tol); + sunrealtype SUNStrToReal(const char* str); + +Additionally, the following header files (and everything in them) will be deprecated -- users who +rely on these are recommended to transition to the corresponding :c:type:`SUNMatrix` and +:c:type:`SUNLinearSolver` modules: + +.. code-block:: c + + sundials_direct.h + sundials_dense.h + sundials_band.h + +Changes to SUNDIALS in release 6.7.0 +==================================== + +**Major Feature** + +Added the :c:type:`SUNAdaptController` base class, ported ARKODE's internal +implementations of time step controllers to 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. + +**New Features** + +Improved the computational complexity of the sparse matrix ``ScaleAddI`` +function from :math:`\mathcal{O}(M * N)` to :math:`\mathcal{O}(\mathrm{NNZ})`. + +Added Fortran support for the LAPACK dense linear solver implementation. + +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. + +Added the third order ERK method ``ARKODE_SHU_OSHER_3_2_3``, the fourth order +ERK method ``ARKODE_SOFRONIOU_SPALETTA_5_3_4``, the sixth order ERK method +``ARKODE_VERNER_9_5_6``, the seventh order ERK method ``ARKODE_VERNER_10_6_7``, +the eighth order ERK method ``ARKODE_VERNER_13_7_8``, and the ninth order ERK +method ``ARKODE_VERNER_16_8_9``. + +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:type:`MRIStepInnerFullRhsFn` optional. + +**Bug Fixes** + +Changed the :c:type:`SUNProfiler` so that it does not rely on ``MPI_WTime`` in +any case. This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. + +Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. + +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 +output time was passed. + +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 ARKODE where :c:func:`ARKStepSetInterpolateStopTime` would return +an interpolated solution at the stop time in some cases when interpolation was +disabled. + +Fixed a bug in :c:func:`ARKStepSetTableNum` wherein it did not recognize +``ARKODE_ARK2_ERK_3_1_2`` and ``ARKODE_ARK2_DIRK_3_1_2`` as a valid additive +Runge--Kutta Butcher table pair. + +Fixed a bug in :c:func:`MRIStepCoupling_Write` where explicit coupling tables +were not written to the output file pointer. + +Fixed missing soversions in some :c:type:`SUNLinearSolver` and +:c:type:`SUNNonlinearSolver` CMake targets. + +Renamed some internal types in CVODES and IDAS to allow both packages to be +built together in the same binary. + +Changes to SUNDIALS in release 6.6.2 +==================================== + +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. + +Changes to SUNDIALS in release 6.6.1 +==================================== + +**New Features** + +Updated the Trilinos Tpetra :c:type:`N_Vector` interface to support Trilinos 14. + +**Bug Fixes** + +Fixed a memory leak when destroying a CUDA, HIP, SYCL, or system +:c:type:`SUNMemoryHelper` object. + +Fixed a bug in ARKODE, CVODE, CVODES, IDA, and IDAS where the stop time may not +be cleared when using normal mode if the requested output time is the same as +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. + +Changes to SUNDIALS in release 6.6.0 +==================================== + +**Major Features** + +A new time-stepping module, :ref:`SPRKStep <ARKODE.Mathematics.SPRKStep>`, was +added to ARKODE. This time-stepper provides explicit symplectic partitioned +Runge-Kutta methods up to order 10 for separable Hamiltonian systems. + +Added support for relaxation Runge-Kutta methods in ERKStep and ARKStep, see +:ref:`ARKODE.Mathematics.Relaxation`, :ref:`ARKODE.Usage.ERKStep.Relaxation`, +and :ref:`ARKODE.Usage.ARKStep.Relaxation` for more information. + +**New Features** + +Updated the default ARKODE, CVODE, and CVODES behavior when returning the +solution when the internal time has reached a user-specified stop time. +Previously, the output solution was interpolated to the value of ``tstop``; the +default is now to copy the internal solution vector. Users who wish to revert to +interpolation may call a new routine :c:func:`CVodeSetInterpolateStopTime`, +:c:func:`ARKStepSetInterpolateStopTime`, :c:func:`ERKStepSetInterpolateStopTime`, +or :c:func:`MRIStepSetInterpolateStopTime`. + +Added the second order IMEX method from :cite:p:`giraldo2013implicit` as the +default second order IMEX method in ARKStep. The explicit table is given by +``ARKODE_ARK2_ERK_3_1_2`` (see :ref:`Butcher.ARK2_ERK`) and the implicit +table by ``ARKODE_ARK2_DIRK_3_1_2`` (see :ref:`Butcher.ARK2_DIRK`). + +Updated the F2003 utility routines :c:func:`SUNDIALSFileOpen` and +:c:func:`SUNDIALSFileClose` to support user specification of ``stdout`` and +``stderr`` strings for the output file names. + +**Bug Fixes** + +A potential bug was fixed when using inequality constraint handling and +calling :c:func:`ARKStepGetEstLocalErrors` or :c:func:`ERKStepGetEstLocalErrors` +after a failed step in which an inequality constraint violation occurred. In +this case, the values returned by :c:func:`ARKStepGetEstLocalErrors` or +:c:func:`ERKStepGetEstLocalErrors` may have been invalid. + +Changes to SUNDIALS in release 6.5.1 +==================================== + +**New Features** + +Added the following functions to disable a previously set stop time: + +* :c:func:`ARKStepClearStopTime` +* :c:func:`ERKStepClearStopTime` +* :c:func:`MRIStepClearStopTime` +* :c:func:`CVodeClearStopTime` +* :c:func:`IDAClearStopTime` + +The default interpolant in ARKODE when using a first order method has been +updated to a linear interpolant to ensure values obtained by the integrator are +returned at the ends of the time interval. To restore the previous behavior of +using a constant interpolant call :c:func:`ARKStepSetInterpolantDegree`, +:c:func:`ERKStepSetInterpolantDegree`, or :c:func:`MRIStepSetInterpolantDegree` +and set the interpolant degree to zero before evolving the problem. + +**Bug Fixes** + +Fixed build errors when using SuperLU_DIST with ROCM enabled to target AMD GPUs. + +Fixed compilation errors in some SYCL examples when using the ``icx`` compiler. + +Changes to SUNDIALS in release 6.5.0 +==================================== + +**New Features** + +A new capability to keep track of memory allocations made through the +:c:type:`SUNMemoryHelper` classes has been added. Memory allocation stats can be +accessed through the :c:func:`SUNMemoryHelper_GetAllocStats` function. See +:numref:`SUNMemory.Description` for more details. + +Added the following functions to assist in debugging simulations utilizing +matrix-based linear solvers: + +* :c:func:`ARKStepGetJac` +* :c:func:`ARKStepGetJacTime` +* :c:func:`ARKStepGetJacNumSteps` +* :c:func:`MRIStepGetJac` +* :c:func:`MRIStepGetJacTime` +* :c:func:`MRIStepGetJacNumSteps` +* :c:func:`CVodeGetJac` +* :c:func:`CVodeGetJacTime` +* :c:func:`CVodeGetJacNumSteps` +* :c:func:`IDAGetJac` +* :c:func:`IDAGetJacCj` +* :c:func:`IDAGetJacTime` +* :c:func:`IDAGetJacNumSteps` +* :c:func:`KINGetJac` +* :c:func:`KINGetJacNumIters` + +Added support for CUDA 12. + +Added support for the SYCL backend with RAJA 2022.x.y. + +**Bug Fixes** + +Fixed an underflow bug during root finding in ARKODE, CVODE, CVODES, IDA and +IDAS. This fixes `GitHub Issue #57 <https://github.com/LLNL/sundials/issues/57>`_. + +Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the +``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. + +Fixed the shape of the arrays returned by the Fortran interfaces to +:c:func:`N_VGetArrayPointer`, :c:func:`SUNDenseMatrix_Data`, +:c:func:`SUNBandMatrix_Data`, :c:func:`SUNSparseMatrix_Data`, +:c:func:`SUNSparseMatrix_IndexValues`, and +:c:func:`SUNSparseMatrix_IndexPointers`. Compiling and running code that uses +the SUNDIALS Fortran interfaces with bounds checking will now work. + +Fixed an implicit conversion error in the Butcher table for ESDIRK5(4)7L[2]SA2. + +Changes to SUNDIALS in release 6.4.1 +==================================== + +Fixed a bug with the Kokkos interfaces that would arise when using clang. + +Fixed a compilation error with the Intel oneAPI 2022.2 Fortran compiler in the +Fortran 2003 interface test for the serial :c:type:`N_Vector`. + +Fixed a bug in the LAPACK band and dense linear solvers which would cause the +tests to fail on some platforms. + +Changes to SUNDIALS in release 6.4.0 +==================================== + +**New Requirements** + +CMake 3.18.0 or newer is now required for CUDA support. + +A C++14 compliant compiler is now required for C++ based features and examples +e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, Ginkgo, and Kokkos. + +**Major Features** + +Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear +algebra library. This support includes new SUNDIALS matrix and linear solver +implementations, see the sections :numref:`SUNMatrix.Ginkgo` and +:numref:`SUNLinSol.Ginkgo`. + +Added new SUNDIALS vector, dense matrix, and dense linear solver implementations +utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for performance +portability, see sections :numref:`NVectors.Kokkos`, :numref:`SUNMatrix.Kokkos`, +and :numref:`SUNLinSol.Kokkos` for more information. + +**New Features** + +Added support for GPU enabled SuperLU_DIST and SuperLU_DIST v8.x.x. Removed +support for SuperLU_DIST v6.x.x or older. Fix mismatched definition and +declaration bug in SuperLU_DIST matrix constructor. + +Added the functions following functions to load a Butcher table from a string: + +* :c:func:`ARKStepSetTableName` +* :c:func:`ERKStepSetTableName` +* :c:func:`MRIStepCoupling_LoadTableByName` +* :c:func:`ARKodeButcherTable_LoadDIRKByName` +* :c:func:`ARKodeButcherTable_LoadERKByName` + +**Bug Fixes** + +Fixed a bug in the CUDA and HIP vectors where :c:func:`N_VMaxNorm` would return +the minimum positive floating-point value for the zero vector. + +Fixed memory leaks/out of bounds memory accesses in the ARKODE MRIStep module +that could occur when attaching a coupling table after reinitialization with a +different number of stages than originally selected. + +Fixed a memory leak where the projection memory would not be deallocated when +calling :c:func:`CVodeFree`. + +Changes to SUNDIALS in release 6.3.0 +==================================== + +**New Features** + +Added the following functions to retrieve the user data pointer provided with +``SetUserData`` functions: + +* :c:func:`ARKStepGetUserData` +* :c:func:`ERKStepGetUserData` +* :c:func:`MRIStepGetUserData` +* :c:func:`CVodeGetUserData` +* :c:func:`IDAGetUserData` +* :c:func:`KINGetUserData` + +Added a variety of embedded DIRK methods from :cite:p:`KenCarp:16` and +:cite:p:`KenCarp:19b`. + +Updated :c:func:`MRIStepReset` to call the corresponding +:c:type:`MRIStepInnerResetFn` with the same ``tR`` and ``yR`` arguments for the +:c:type:`MRIStepInnerStepper` object that is used to evolve the MRI "fast" time +scale subproblems. + +Added a new example (``examples/cvode/serial/cvRocket_dns.c``) which +demonstrates using CVODE with a discontinuous right-hand-side function and +rootfinding. + +**Bug Fixes** + +Fixed a bug in :c:func:`ERKStepReset`, :c:func:`ERKStepReInit`, +:c:func:`ARKStepReset`, :c:func:`ARKStepReInit`, :c:func:`MRIStepReset`, and +:c:func:`MRIStepReInit` where a previously-set value of ``tstop`` (from +a call to :c:func:`ERKStepSetStopTime`, :c:func:`ARKStepSetStopTime`, or +:c:func:`MRIStepSetStopTime`, respectively) would not be cleared. + +Fixed the unituitive behavior of the ``USE_GENERIC_MATH`` CMake option which +caused the double precision math functions to be used regardless of the value of +:cmakeop:`SUNDIALS_PRECISION`. Now, SUNDIALS will use precision appropriate math +functions when they are available and the user may provide the math library to +link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. + +Changed ``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option default to be ``OFF``. This +fixes `GitHub Issue #177 <https://github.com/LLNL/sundials/issues/177>`_. + +Changes to SUNDIALS in release 6.2.0 +==================================== + +**Major Features** + +Added the :c:type:`SUNLogger` API which provides a SUNDIALS-wide mechanism for +logging of errors, warnings, informational output, and debugging output. + +Added support to CVODES for integrating IVPs with constraints using BDF methods +and projecting the solution onto the constraint manifold with a user defined +projection function. This implementation is accompanied by additions to the +CVODES user documentation and examples. + +**New Features** + +Added the function :c:func:`SUNProfiler_Reset` to reset the region timings and +counters to zero. + +Added the following functions to output all of the integrator, nonlinear solver, +linear solver, and other statistics in one call: + +* :c:func:`ARKStepPrintAllStats` +* :c:func:`ERKStepPrintAllStats` +* :c:func:`MRIStepPrintAllStats` +* :c:func:`CVodePrintAllStats` +* :c:func:`IDAPrintAllStats` +* :c:func:`KINPrintAllStats` + +The file ``scripts/sundials_csv.py`` contains functions for parsing the +comma-separated value (CSV) output files when using the CSV output format. + +Added functions to CVODE, CVODES, IDA, and IDAS to change the default step size +adaptivity parameters. For more information see the documentation for: + +* :c:func:`CVodeSetEtaFixedStepBounds` +* :c:func:`CVodeSetEtaMaxFirstStep` +* :c:func:`CVodeSetEtaMaxEarlyStep` +* :c:func:`CVodeSetNumStepsEtaMaxEarlyStep` +* :c:func:`CVodeSetEtaMax` +* :c:func:`CVodeSetEtaMin` +* :c:func:`CVodeSetEtaMinErrFail` +* :c:func:`CVodeSetEtaMaxErrFail` +* :c:func:`CVodeSetNumFailsEtaMaxErrFail` +* :c:func:`CVodeSetEtaConvFail` +* :c:func:`IDASetEtaFixedStepBounds` +* :c:func:`IDASetEtaMax` +* :c:func:`IDASetEtaMin` +* :c:func:`IDASetEtaLow` +* :c:func:`IDASetEtaMinErrFail` +* :c:func:`IDASetEtaConvFail` + +Added the functions :c:func:`ARKStepSetDeduceImplicitRhs` and +:c:func:`MRIStepSetDeduceImplicitRhs` to optionally remove an evaluation of the +implicit right-hand side function after nonlinear solves. See +:ref:`ARKODE.Mathematics.Nonlinear`, for considerations on using this +optimization. + +Added the function :c:func:`MRIStepSetOrder` to select the default MRI method of +a given order. + +Added the functions :c:func:`CVodeSetDeltaGammaMaxLSetup` and +:c:func:`CVodeSetDeltaGammaMaxBadJac` in CVODE and CVODES to adjust the +:math:`\gamma` change thresholds to require a linear solver setup or +Jacobian/precondition update, respectively. + +Added the function :c:func:`IDASetDeltaCjLSetup` in IDA and IDAS to adjust the +parameter that determines when a change in :math:`c_j` requires calling the +linear solver setup function. + +Added the function :c:func:`IDASetMinStep` to set a minimum step size. + +**Bug Fixes** + +Fixed the :c:type:`SUNContext` convenience class for C++ users to disallow copy +construction and allow move construction. + +The behavior of :cpp:func:`N_VSetKernelExecPolicy_Sycl` has been updated to be +consistent with the CUDA and HIP vectors. The input execution policies are now +cloned and may be freed after calling +:cpp:func:`N_VSetKernelExecPolicy_Sycl`. Additionally, ``NULL`` inputs are now +allowed and, if provided, will reset the vector execution policies to the +defaults. + +A memory leak in the SYCL vector was fixed where the execution policies were not +freed when the vector was destroyed. + +The include guard in ``nvector_mpimanyvector.h`` has been corrected to enable +using both the ManyVector and MPIManyVector vector implementations +in the same simulation. + +A bug was fixed in the ARKODE, CVODE(S), and IDA(S) functions to retrieve the +number of nonlinear solver failures. The failure count returned was the number +of failed *steps* due to a nonlinear solver failure i.e., if a nonlinear solve +failed with a stale Jacobian or preconditioner but succeeded after updating the +Jacobian or preconditioner, the initial failure was not included in the +nonlinear solver failure count. The following functions have been updated to +return the total number of nonlinear solver failures: + +* :c:func:`ARKStepGetNumNonlinSolvConvFails` +* :c:func:`ARKStepGetNonlinSolvStats` +* :c:func:`MRIStepGetNumNonlinSolvConvFails` +* :c:func:`MRIStepGetNonlinSolvStats` +* :c:func:`CVodeGetNumNonlinSolvConvFails` +* :c:func:`CVodeGetNonlinSolvStats` +* :c:func:`CVodeGetSensNumNonlinSolvConvFails` +* :c:func:`CVodeGetSensNonlinSolvStats` +* :c:func:`CVodeGetStgrSensNumNonlinSolvConvFails` +* :c:func:`CVodeGetStgrSensNonlinSolvStats` +* :c:func:`IDAGetNumNonlinSolvConvFails` +* :c:func:`IDAGetNonlinSolvStats` +* :c:func:`IDAGetSensNumNonlinSolvConvFails` +* :c:func:`IDAGetSensNonlinSolvStats` + +As a result of this change users may see an increase in the number of failures +reported from the above functions. The following functions have been added to +retrieve the number of failed steps due to a nonlinear solver failure i.e., the +counts previously returned by the above functions: + +* :c:func:`ARKStepGetNumStepSolveFails` +* :c:func:`MRIStepGetNumStepSolveFails` +* :c:func:`CVodeGetNumStepSolveFails` +* :c:func:`CVodeGetNumStepSensSolveFails` +* :c:func:`CVodeGetNumStepStgrSensSolveFails` +* :c:func:`IDAGetNumStepSolveFails` +* :c:func:`IDAGetNumStepSensSolveFails` + +Changed exported SUNDIALS PETSc CMake targets to be INTERFACE IMPORTED instead +of UNKNOWN IMPORTED. + +**Deprecation Notice** + +Deprecated the following functions, it is recommended to use the +:c:type:`SUNLogger` API instead. + +* ``ARKStepSetDiagnostics`` +* ``ERKStepSetDiagnostics`` +* ``MRIStepSetDiagnostics`` +* ``KINSetInfoFile`` +* ``SUNNonlinSolSetPrintLevel_Newton`` +* ``SUNNonlinSolSetInfoFile_Newton`` +* ``SUNNonlinSolSetPrintLevel_FixedPoint`` +* ``SUNNonlinSolSetInfoFile_FixedPoint`` +* ``SUNLinSolSetInfoFile_PCG`` +* ``SUNLinSolSetPrintLevel_PCG`` +* ``SUNLinSolSetInfoFile_SPGMR`` +* ``SUNLinSolSetPrintLevel_SPGMR`` +* ``SUNLinSolSetInfoFile_SPFGMR`` +* ``SUNLinSolSetPrintLevel_SPFGMR`` +* ``SUNLinSolSetInfoFile_SPTFQM`` +* ``SUNLinSolSetPrintLevel_SPTFQMR`` +* ``SUNLinSolSetInfoFile_SPBCGS`` +* ``SUNLinSolSetPrintLevel_SPBCGS`` + +The ``SUNLinSolSetInfoFile_*`` and ``SUNNonlinSolSetInfoFile_*`` family of +functions are now enabled by setting the CMake option +:cmakeop:`SUNDIALS_LOGGING_LEVEL` to a value ``>= 3``. + +Changes to SUNDIALS in release 6.1.1 +==================================== + +**New Feature** + +Added new Fortran example program, +``examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90`` demonstrating MRI +capabilities. + +**Bug Fixes** + +Fixed exported ``SUNDIALSConfig.cmake``. + +Fixed Fortran interface to :c:type:`MRIStepInnerStepper` and +:c:type:`MRIStepCoupling` structures and functions. + +Changes to SUNDIALS in release 6.1.0 +==================================== + +**New Features** + +Added new reduction implementations for the CUDA and HIP vectors that use +shared memory (local data storage) instead of atomics. These new implementations +are recommended when the target hardware does not provide atomic support for the +floating point precision that SUNDIALS is being built with. The HIP vector uses +these by default, but the :c:func:`N_VSetKernelExecPolicy_Cuda` and +:c:func:`N_VSetKernelExecPolicy_Hip` functions can be used to choose between +different reduction implementations. + +``SUNDIALS::<lib>`` targets with no static/shared suffix have been added for use +within the build directory (this mirrors the targets exported on installation). + +:cmakeop:`CMAKE_C_STANDARD` is now set to ``99`` by default. + +**Bug Fixes** + +Fixed exported ``SUNDIALSConfig.cmake`` when profiling is enabled without +Caliper. + +Fixed ``sundials_export.h`` include in ``sundials_config.h``. + +Fixed memory leaks in the SuperLU_MT linear solver interface. + +Changes to SUNDIALS in release 6.0.0 +==================================== + +**Breaking Changes** + +*SUNContext Object Added* + +SUNDIALS v6.0.0 introduces a new :c:type:`SUNContext` object on which all other +SUNDIALS objects depend. As such, the constructors for all SUNDIALS packages, +vectors, matrices, linear solvers, nonlinear solvers, and memory helpers have +been updated to accept a context as the last input. Users upgrading to SUNDIALS +v6.0.0 will need to call :c:func:`SUNContext_Create` to create a context object +with before calling any other SUNDIALS library function, and then provide this +object to other SUNDIALS constructors. The context object has been introduced to +allow SUNDIALS to provide new features, such as the profiling/instrumentation +also introduced in this release, while maintaining thread-safety. See the +:numref:`SUNDIALS.SUNContext` for more details. + +The script ``scripts/upgrade-to-sundials-6-from-5.sh`` has been provided with +this release (and obtainable from the GitHub release page) to help ease the +transition to SUNDIALS v6.0.0. The script will add a ``SUNCTX_PLACEHOLDER`` +argument to all of the calls to SUNDIALS constructors that now require a +:c:type:`SUNContext` object. It can also update deprecated SUNDIALS +constants/types to the new names. It can be run like this: + +.. code-block:: console + + ./upgrade-to-sundials-6-from-5.sh <files to update> + +*Updated SUNMemoryHelper Function Signatures* + +The :c:type:`SUNMemoryHelper` functions :c:func:`SUNMemoryHelper_Alloc`, +:c:func:`SUNMemoryHelper_Dealloc`, and :c:func:`SUNMemoryHelper_Copy` have been +updated to accept an opaque handle as the last input. At a minimum, user-defined +:c:type:`SUNMemoryHelper` implementations will need to update these functions to +accept the additional argument. Typically, this handle is the execution stream +(e.g., a CUDA/HIP stream or SYCL queue) for the operation. The CUDA, HIP, and +SYCL implementations have been updated accordingly. Additionally, the +constructor :c:func:`SUNMemoryHelper_Sycl` has been updated to remove the SYCL +queue as an input. + +*Deprecated Functions Removed* + +The previously deprecated constructor ``N_VMakeWithManagedAllocator_Cuda`` and +the function ``N_VSetCudaStream_Cuda`` have been removed and replaced with +:c:func:`N_VNewWithMemHelp_Cuda` and :c:func:`N_VSetKernelExecPolicy_Cuda` +respectively. + +The previously deprecated macros ``PVEC_REAL_MPI_TYPE`` and +``PVEC_INTEGER_MPI_TYPE`` have been removed and replaced with +``MPI_SUNREALTYPE`` and ``MPI_SUNINDEXTYPE`` respectively. + +The following previously deprecated :c:type:`SUNLinearSolver` functions have +been removed: + ++-----------------------------+------------------------------------------+ +| Removed | Replacement | ++=============================+==========================================+ +| ``SUNBandLinearSolver`` | :c:func:`SUNLinSol_Band` | ++-----------------------------+------------------------------------------+ +| ``SUNDenseLinearSolver`` | :c:func:`SUNLinSol_Dense` | ++-----------------------------+------------------------------------------+ +| ``SUNKLU`` | :c:func:`SUNLinSol_KLU` | ++-----------------------------+------------------------------------------+ +| ``SUNKLUReInit`` | :c:func:`SUNLinSol_KLUReInit` | ++-----------------------------+------------------------------------------+ +| ``SUNKLUSetOrdering`` | :c:func:`SUNLinSol_KLUSetOrdering` | ++-----------------------------+------------------------------------------+ +| ``SUNLapackBand`` | :c:func:`SUNLinSol_LapackBand` | ++-----------------------------+------------------------------------------+ +| ``SUNLapackDense`` | :c:func:`SUNLinSol_LapackDense` | ++-----------------------------+------------------------------------------+ +| ``SUNPCG`` | :c:func:`SUNLinSol_PCG` | ++-----------------------------+------------------------------------------+ +| ``SUNPCGSetPrecType`` | :c:func:`SUNLinSol_PCGSetPrecType` | ++-----------------------------+------------------------------------------+ +| ``SUNPCGSetMaxl`` | :c:func:`SUNLinSol_PCGSetMaxl` | ++-----------------------------+------------------------------------------+ +| ``SUNSPBCGS`` | :c:func:`SUNLinSol_SPBCGS` | ++-----------------------------+------------------------------------------+ +| ``SUNSPBCGSSetPrecType`` | :c:func:`SUNLinSol_SPBCGSSetPrecType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPBCGSSetMaxl`` | :c:func:`SUNLinSol_SPBCGSSetMaxl` | ++-----------------------------+------------------------------------------+ +| ``SUNSPFGMR`` | :c:func:`SUNLinSol_SPFGMR` | ++-----------------------------+------------------------------------------+ +| ``SUNSPFGMRSetPrecType`` | :c:func:`SUNLinSol_SPFGMRSetPrecType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPFGMRSetGSType`` | :c:func:`SUNLinSol_SPFGMRSetGSType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPFGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPFGMRSetMaxRestarts` | ++-----------------------------+------------------------------------------+ +| ``SUNSPGMR`` | :c:func:`SUNLinSol_SPGMR` | ++-----------------------------+------------------------------------------+ +| ``SUNSPGMRSetPrecType`` | :c:func:`SUNLinSol_SPGMRSetPrecType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPGMRSetGSType`` | :c:func:`SUNLinSol_SPGMRSetGSType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPGMRSetMaxRestarts`` | :c:func:`SUNLinSol_SPGMRSetMaxRestarts` | ++-----------------------------+------------------------------------------+ +| ``SUNSPTFQMR`` | :c:func:`SUNLinSol_SPTFQMR` | ++-----------------------------+------------------------------------------+ +| ``SUNSPTFQMRSetPrecType`` | :c:func:`SUNLinSol_SPTFQMRSetPrecType` | ++-----------------------------+------------------------------------------+ +| ``SUNSPTFQMRSetMaxl`` | :c:func:`SUNLinSol_SPTFQMRSetMaxl` | ++-----------------------------+------------------------------------------+ +| ``SUNSuperLUMT`` | :c:func:`SUNLinSol_SuperLUMT` | ++-----------------------------+------------------------------------------+ +| ``SUNSuperLUMTSetOrdering`` | :c:func:`SUNLinSol_SuperLUMTSetOrdering` | ++-----------------------------+------------------------------------------+ + +The deprecated functions ``MRIStepGetCurrentButcherTables`` and +``MRIStepWriteButcher`` and the utility functions ``MRIStepSetTable`` and +``MRIStepSetTableNum`` have been removed. Users wishing to create an MRI-GARK +method from a Butcher table should use :c:func:`MRIStepCoupling_MIStoMRI` to +create the corresponding MRI coupling table and attach it with +:c:func:`MRIStepSetCoupling`. + +The previously deprecated functions ``ARKStepSetMaxStepsBetweenLSet`` and +``ARKStepSetMaxStepsBetweenJac`` have been removed and replaced with +:c:func:`ARKStepSetLSetupFrequency` and :c:func:`ARKStepSetJacEvalFrequency` +respectively. + +The previously deprecated function ``CVodeSetMaxStepsBetweenJac`` has been +removed and replaced with :c:func:`CVodeSetJacEvalFrequency`. + +The ARKODE, CVODE, IDA, and KINSOL Fortran 77 interfaces has been removed. See +:numref:`SUNDIALS.Fortran` and the F2003 example programs for more details using +the SUNDIALS Fortran 2003 module interfaces. + +*Namespace Changes* + +The CUDA, HIP, and SYCL execution policies have been moved from the ``sundials`` +namespace to the ``sundials::cuda``, ``sundials::hip``, and ``sundials::sycl`` +namespaces respectively. Accordingly, the prefixes "Cuda", "Hip", and "Sycl" +have been removed from the execution policy classes and methods. + +The ``Sundials`` namespace used by the Trilinos Tpetra :c:type:`N_Vector` +implementation has been replaced with the ``sundials::trilinos::nvector_tpetra`` +namespace. + +**Major Features** + +*Profiling Capability* + +A capability to profile/instrument SUNDIALS library code has been added. This +can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A +built-in profiler will be used by default, but the `Caliper +<https://github.com/LLNL/Caliper>`_ library can also be used instead with the +CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on +profiling for more details. + +.. warning:: + + Profiling will impact performance, and should be enabled judiciously. + +*IMEX MRI Methods and MRIStepInnerStepper Object* + +The MRIStep module has been extended to support implicit-explicit (ImEx) +multirate infinitesimal generalized additive Runge--Kutta (MRI-GARK) methods. As +such, :c:func:`MRIStepCreate` has been updated to include arguments for the slow +explicit and slow implicit ODE right-hand side functions. +:c:func:`MRIStepCreate` has also been updated to require attaching an +MRIStepInnerStepper for evolving the fast time scale. :c:func:`MRIStepReInit` +has been similarly updated to take explicit and implicit right-hand side +functions as input. Codes using explicit or implicit MRI methods will need to +update :c:func:`MRIStepCreate` and :c:func:`MRIStepReInit` calls to pass +``NULL`` for either the explicit or implicit right-hand side function as +appropriate. If ARKStep is used as the fast time scale integrator, codes will +need to call :c:func:`ARKStepCreateMRIStepInnerStepper` to wrap the ARKStep +memory as an MRIStepInnerStepper object. Additionally, +:c:func:`MRIStepGetNumRhsEvals` has been updated to return the number of slow +implicit and explicit function evaluations. The coupling table, +:c:type:`MRIStepCoupling`, and the functions :c:func:`MRIStepCoupling_Alloc` +and :c:func:`MRIStepCoupling_Create` have also been updated to support +IMEX-MRI-GARK methods. + +**New Features** + +Two new optional vector operations, :c:func:`N_VDotProdMultiLocal` and +:c:func:`N_VDotProdMultiAllReduce`, have been added to support +low-synchronization methods for Anderson acceleration. + +The implementation of solve-decoupled implicit MRI-GARK methods has been updated +to remove extraneous slow implicit function calls and reduce the memory +requirements. + +Added a new function :c:func:`CVodeGetLinSolveStats` to get the CVODES linear +solver statistics as a group. + +Added a new function, :c:func:`CVodeSetMonitorFn`, that takes a user-function +to be called by CVODES after every ``nst`` successfully completed time-steps. +This is intended to provide a way of monitoring the CVODES statistics +throughout the simulation. + +New orthogonalization methods were added for use within the KINSOL Anderson +acceleration routine. See :ref:`Anderson_QR` and :c:func:`KINSetOrthAA` +for more details. + +**Deprecation Notice** + +The serial, PThreads, PETSc, *hypre*, Parallel, OpenMP_DEV, and OpenMP vector +functions ``N_VCloneVectorArray_*`` and ``N_VDestroyVectorArray_*`` have been +deprecated. The generic :c:func:`N_VCloneVectorArray` and +:c:func:`N_VDestroyVectorArray` functions should be used instead. + +Many constants, types, and functions have been renamed so that they are properly +namespaced. The old names have been deprecated and will be removed in SUNDIALS +v7.0.0. + +The following constants, macros, and typedefs are now deprecated: + ++------------------------------+-------------------------------------+ +| Deprecated Name | New Name | ++==============================+=====================================+ +| ``realtype`` | ``sunrealtype`` | ++------------------------------+-------------------------------------+ +| ``booleantype`` | ``sunbooleantype`` | ++------------------------------+-------------------------------------+ +| ``RCONST`` | ``SUN_RCONST`` | ++------------------------------+-------------------------------------+ +| ``BIG_REAL`` | ``SUN_BIG_REAL`` | ++------------------------------+-------------------------------------+ +| ``SMALL_REAL`` | ``SUN_SMALL_REAL`` | ++------------------------------+-------------------------------------+ +| ``UNIT_ROUNDOFF`` | ``SUN_UNIT_ROUNDOFF`` | ++------------------------------+-------------------------------------+ +| ``PREC_NONE`` | ``SUN_PREC_NONE`` | ++------------------------------+-------------------------------------+ +| ``PREC_LEFT`` | ``SUN_PREC_LEFT`` | ++------------------------------+-------------------------------------+ +| ``PREC_RIGHT`` | ``SUN_PREC_RIGHT`` | ++------------------------------+-------------------------------------+ +| ``PREC_BOTH`` | ``SUN_PREC_BOTH`` | ++------------------------------+-------------------------------------+ +| ``MODIFIED_GS`` | ``SUN_MODIFIED_GS`` | ++------------------------------+-------------------------------------+ +| ``CLASSICAL_GS`` | ``SUN_CLASSICAL_GS`` | ++------------------------------+-------------------------------------+ +| ``ATimesFn`` | ``SUNATimesFn`` | ++------------------------------+-------------------------------------+ +| ``PSetupFn`` | ``SUNPSetupFn`` | ++------------------------------+-------------------------------------+ +| ``PSolveFn`` | ``SUNPSolveFn`` | ++------------------------------+-------------------------------------+ +| ``DlsMat`` | ``SUNDlsMat`` | ++------------------------------+-------------------------------------+ +| ``DENSE_COL`` | ``SUNDLS_DENSE_COL`` | ++------------------------------+-------------------------------------+ +| ``DENSE_ELEM`` | ``SUNDLS_DENSE_ELEM`` | ++------------------------------+-------------------------------------+ +| ``BAND_COL`` | ``SUNDLS_BAND_COL`` | ++------------------------------+-------------------------------------+ +| ``BAND_COL_ELEM`` | ``SUNDLS_BAND_COL_ELEM`` | ++------------------------------+-------------------------------------+ +| ``BAND_ELEM`` | ``SUNDLS_BAND_ELEM`` | ++------------------------------+-------------------------------------+ +| ``SDIRK_2_1_2`` | ``ARKODE_SDIRK_2_1_2`` | ++------------------------------+-------------------------------------+ +| ``BILLINGTON_3_3_2`` | ``ARKODE_BILLINGTON_3_3_2`` | ++------------------------------+-------------------------------------+ +| ``TRBDF2_3_3_2`` | ``ARKODE_TRBDF2_3_3_2`` | ++------------------------------+-------------------------------------+ +| ``KVAERNO_4_2_3`` | ``ARKODE_KVAERNO_4_2_3`` | ++------------------------------+-------------------------------------+ +| ``ARK324L2SA_DIRK_4_2_3`` | ``ARKODE_ARK324L2SA_DIRK_4_2_3`` | ++------------------------------+-------------------------------------+ +| ``CASH_5_2_4`` | ``ARKODE_CASH_5_2_4`` | ++------------------------------+-------------------------------------+ +| ``CASH_5_3_4`` | ``ARKODE_CASH_5_3_4`` | ++------------------------------+-------------------------------------+ +| ``SDIRK_5_3_4`` | ``ARKODE_SDIRK_5_3_4`` | ++------------------------------+-------------------------------------+ +| ``KVAERNO_5_3_4`` | ``ARKODE_KVAERNO_5_3_4`` | ++------------------------------+-------------------------------------+ +| ``ARK436L2SA_DIRK_6_3_4`` | ``ARKODE_ARK436L2SA_DIRK_6_3_4`` | ++------------------------------+-------------------------------------+ +| ``KVAERNO_7_4_5`` | ``ARKODE_KVAERNO_7_4_5`` | ++------------------------------+-------------------------------------+ +| ``ARK548L2SA_DIRK_8_4_5`` | ``ARKODE_ARK548L2SA_DIRK_8_4_5`` | ++------------------------------+-------------------------------------+ +| ``ARK437L2SA_DIRK_7_3_4`` | ``ARKODE_ARK437L2SA_DIRK_7_3_4`` | ++------------------------------+-------------------------------------+ +| ``ARK548L2SAb_DIRK_8_4_5`` | ``ARKODE_ARK548L2SAb_DIRK_8_4_5`` | ++------------------------------+-------------------------------------+ +| ``MIN_DIRK_NUM`` | ``ARKODE_MIN_DIRK_NUM`` | ++------------------------------+-------------------------------------+ +| ``MAX_DIRK_NUM`` | ``ARKODE_MAX_DIRK_NUM`` | ++------------------------------+-------------------------------------+ +| ``MIS_KW3`` | ``ARKODE_MIS_KW3`` | ++------------------------------+-------------------------------------+ +| ``MRI_GARK_ERK33a`` | ``ARKODE_MRI_GARK_ERK33a`` | ++------------------------------+-------------------------------------+ +| ``MRI_GARK_ERK45a`` | ``ARKODE_MRI_GARK_ERK45a`` | ++------------------------------+-------------------------------------+ +| ``MRI_GARK_IRK21a`` | ``ARKODE_MRI_GARK_IRK21a`` | ++------------------------------+-------------------------------------+ +| ``MRI_GARK_ESDIRK34a`` | ``ARKODE_MRI_GARK_ESDIRK34a`` | ++------------------------------+-------------------------------------+ +| ``MRI_GARK_ESDIRK46a`` | ``ARKODE_MRI_GARK_ESDIRK46a`` | ++------------------------------+-------------------------------------+ +| ``IMEX_MRI_GARK3a`` | ``ARKODE_IMEX_MRI_GARK3a`` | ++------------------------------+-------------------------------------+ +| ``IMEX_MRI_GARK3b`` | ``ARKODE_IMEX_MRI_GARK3b`` | ++------------------------------+-------------------------------------+ +| ``IMEX_MRI_GARK4`` | ``ARKODE_IMEX_MRI_GARK4`` | ++------------------------------+-------------------------------------+ +| ``MIN_MRI_NUM`` | ``ARKODE_MIN_MRI_NUM`` | ++------------------------------+-------------------------------------+ +| ``MAX_MRI_NUM`` | ``ARKODE_MAX_MRI_NUM`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_MRI_TABLE_3`` | ``MRISTEP_DEFAULT_TABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_EXPL_MRI_TABLE_3`` | ``MRISTEP_DEFAULT_EXPL_TABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_EXPL_MRI_TABLE_4`` | ``MRISTEP_DEFAULT_EXPL_TABLE_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_IMPL_SD_TABLE_2`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_2`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_IMPL_SD_TABLE_3`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_IMPL_SD_TABLE_4`` | ``MRISTEP_DEFAULT_IMPL_SD_TABLE_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_IMEX_SD_TABLE_3`` | ``MRISTEP_DEFAULT_IMEX_SD_TABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_IMEX_SD_TABLE_4`` | ``MRISTEP_DEFAULT_IMEX_SD_TABLE_4`` | ++------------------------------+-------------------------------------+ +| ``HEUN_EULER_2_1_2`` | ``ARKODE_HEUN_EULER_2_1_2`` | ++------------------------------+-------------------------------------+ +| ``BOGACKI_SHAMPINE_4_2_3`` | ``ARKODE_BOGACKI_SHAMPINE_4_2_3`` | ++------------------------------+-------------------------------------+ +| ``ARK324L2SA_ERK_4_2_3`` | ``ARKODE_ARK324L2SA_ERK_4_2_3`` | ++------------------------------+-------------------------------------+ +| ``ZONNEVELD_5_3_4`` | ``ARKODE_ZONNEVELD_5_3_4`` | ++------------------------------+-------------------------------------+ +| ``ARK436L2SA_ERK_6_3_4`` | ``ARKODE_ARK436L2SA_ERK_6_3_4`` | ++------------------------------+-------------------------------------+ +| ``SAYFY_ABURUB_6_3_4`` | ``ARKODE_SAYFY_ABURUB_6_3_4`` | ++------------------------------+-------------------------------------+ +| ``CASH_KARP_6_4_5`` | ``ARKODE_CASH_KARP_6_4_5`` | ++------------------------------+-------------------------------------+ +| ``FEHLBERG_6_4_5`` | ``ARKODE_FEHLBERG_6_4_5`` | ++------------------------------+-------------------------------------+ +| ``DORMAND_PRINCE_7_4_5`` | ``ARKODE_DORMAND_PRINCE_7_4_5`` | ++------------------------------+-------------------------------------+ +| ``ARK548L2SA_ERK_8_4_5`` | ``ARKODE_ARK548L2SA_ERK_8_4_5`` | ++------------------------------+-------------------------------------+ +| ``VERNER_8_5_6`` | ``ARKODE_VERNER_8_5_6`` | ++------------------------------+-------------------------------------+ +| ``FEHLBERG_13_7_8`` | ``ARKODE_FEHLBERG_13_7_8`` | ++------------------------------+-------------------------------------+ +| ``KNOTH_WOLKE_3_3`` | ``ARKODE_KNOTH_WOLKE_3_3`` | ++------------------------------+-------------------------------------+ +| ``ARK437L2SA_ERK_7_3_4`` | ``ARKODE_ARK437L2SA_ERK_7_3_4`` | ++------------------------------+-------------------------------------+ +| ``ARK548L2SAb_ERK_8_4_5`` | ``ARKODE_ARK548L2SAb_ERK_8_4_5`` | ++------------------------------+-------------------------------------+ +| ``MIN_ERK_NUM`` | ``ARKODE_MIN_ERK_NUM`` | ++------------------------------+-------------------------------------+ +| ``MAX_ERK_NUM`` | ``ARKODE_MAX_ERK_NUM`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_2`` | ``ARKSTEP_DEFAULT_ERK_2`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_3`` | ``ARKSTEP_DEFAULT_ERK_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_4`` | ``ARKSTEP_DEFAULT_ERK_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_5`` | ``ARKSTEP_DEFAULT_ERK_5`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_6`` | ``ARKSTEP_DEFAULT_ERK_6`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_8`` | ``ARKSTEP_DEFAULT_ERK_8`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_DIRK_2`` | ``ARKSTEP_DEFAULT_DIRK_2`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_DIRK_3`` | ``ARKSTEP_DEFAULT_DIRK_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_DIRK_4`` | ``ARKSTEP_DEFAULT_DIRK_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_DIRK_5`` | ``ARKSTEP_DEFAULT_DIRK_5`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ETABLE_3`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ETABLE_4`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ETABLE_5`` | ``ARKSTEP_DEFAULT_ARK_ETABLE_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ITABLE_3`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ITABLE_4`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ARK_ITABLE_5`` | ``ARKSTEP_DEFAULT_ARK_ITABLE_5`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_2`` | ``ERKSTEP_DEFAULT_2`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_3`` | ``ERKSTEP_DEFAULT_3`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_4`` | ``ERKSTEP_DEFAULT_4`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_5`` | ``ERKSTEP_DEFAULT_5`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_6`` | ``ERKSTEP_DEFAULT_6`` | ++------------------------------+-------------------------------------+ +| ``DEFAULT_ERK_8`` | ``ERKSTEP_DEFAULT_8`` | ++------------------------------+-------------------------------------+ + +In addition, the following functions are now deprecated (compile-time warnings +will be printed if supported by the compiler): + ++---------------------------------+--------------------------------+ +| Deprecated Name | New Name | ++=================================+================================+ +| ``DenseGETRF`` | ``SUNDlsMat_DenseGETRF`` | ++---------------------------------+--------------------------------+ +| ``DenseGETRS`` | ``SUNDlsMat_DenseGETRS`` | ++---------------------------------+--------------------------------+ +| ``denseGETRF`` | ``SUNDlsMat_denseGETRF`` | ++---------------------------------+--------------------------------+ +| ``denseGETRS`` | ``SUNDlsMat_denseGETRS`` | ++---------------------------------+--------------------------------+ +| ``DensePOTRF`` | ``SUNDlsMat_DensePOTRF`` | ++---------------------------------+--------------------------------+ +| ``DensePOTRS`` | ``SUNDlsMat_DensePOTRS`` | ++---------------------------------+--------------------------------+ +| ``densePOTRF`` | ``SUNDlsMat_densePOTRF`` | ++---------------------------------+--------------------------------+ +| ``densePOTRS`` | ``SUNDlsMat_densePOTRS`` | ++---------------------------------+--------------------------------+ +| ``DenseGEQRF`` | ``SUNDlsMat_DenseGEQRF`` | ++---------------------------------+--------------------------------+ +| ``DenseORMQR`` | ``SUNDlsMat_DenseORMQR`` | ++---------------------------------+--------------------------------+ +| ``denseGEQRF`` | ``SUNDlsMat_denseGEQRF`` | ++---------------------------------+--------------------------------+ +| ``denseORMQR`` | ``SUNDlsMat_denseORMQR`` | ++---------------------------------+--------------------------------+ +| ``DenseCopy`` | ``SUNDlsMat_DenseCopy`` | ++---------------------------------+--------------------------------+ +| ``denseCopy`` | ``SUNDlsMat_denseCopy`` | ++---------------------------------+--------------------------------+ +| ``DenseScale`` | ``SUNDlsMat_DenseScale`` | ++---------------------------------+--------------------------------+ +| ``denseScale`` | ``SUNDlsMat_denseScale`` | ++---------------------------------+--------------------------------+ +| ``denseAddIdentity`` | ``SUNDlsMat_denseAddIdentity`` | ++---------------------------------+--------------------------------+ +| ``DenseMatvec`` | ``SUNDlsMat_DenseMatvec`` | ++---------------------------------+--------------------------------+ +| ``denseMatvec`` | ``SUNDlsMat_denseMatvec`` | ++---------------------------------+--------------------------------+ +| ``BandGBTRF`` | ``SUNDlsMat_BandGBTRF`` | ++---------------------------------+--------------------------------+ +| ``bandGBTRF`` | ``SUNDlsMat_bandGBTRF`` | ++---------------------------------+--------------------------------+ +| ``BandGBTRS`` | ``SUNDlsMat_BandGBTRS`` | ++---------------------------------+--------------------------------+ +| ``bandGBTRS`` | ``SUNDlsMat_bandGBTRS`` | ++---------------------------------+--------------------------------+ +| ``BandCopy`` | ``SUNDlsMat_BandCopy`` | ++---------------------------------+--------------------------------+ +| ``bandCopy`` | ``SUNDlsMat_bandCopy`` | ++---------------------------------+--------------------------------+ +| ``BandScale`` | ``SUNDlsMat_BandScale`` | ++---------------------------------+--------------------------------+ +| ``bandScale`` | ``SUNDlsMat_bandScale`` | ++---------------------------------+--------------------------------+ +| ``bandAddIdentity`` | ``SUNDlsMat_bandAddIdentity`` | ++---------------------------------+--------------------------------+ +| ``BandMatvec`` | ``SUNDlsMat_BandMatvec`` | ++---------------------------------+--------------------------------+ +| ``bandMatvec`` | ``SUNDlsMat_bandMatvec`` | ++---------------------------------+--------------------------------+ +| ``ModifiedGS`` | ``SUNModifiedGS`` | ++---------------------------------+--------------------------------+ +| ``ClassicalGS`` | ``SUNClassicalGS`` | ++---------------------------------+--------------------------------+ +| ``QRfact`` | ``SUNQRFact`` | ++---------------------------------+--------------------------------+ +| ``QRsol`` | ``SUNQRsol`` | ++---------------------------------+--------------------------------+ +| ``DlsMat_NewDenseMat`` | ``SUNDlsMat_NewDenseMat`` | ++---------------------------------+--------------------------------+ +| ``DlsMat_NewBandMat`` | ``SUNDlsMat_NewBandMat`` | ++---------------------------------+--------------------------------+ +| ``DestroyMat`` | ``SUNDlsMat_DestroyMat`` | ++---------------------------------+--------------------------------+ +| ``NewIntArray`` | ``SUNDlsMat_NewIntArray`` | ++---------------------------------+--------------------------------+ +| ``NewIndexArray`` | ``SUNDlsMat_NewIndexArray`` | ++---------------------------------+--------------------------------+ +| ``NewRealArray`` | ``SUNDlsMat_NewRealArray`` | ++---------------------------------+--------------------------------+ +| ``DestroyArray`` | ``SUNDlsMat_DestroyArray`` | ++---------------------------------+--------------------------------+ +| ``AddIdentity`` | ``SUNDlsMat_AddIdentity`` | ++---------------------------------+--------------------------------+ +| ``SetToZero`` | ``SUNDlsMat_SetToZero`` | ++---------------------------------+--------------------------------+ +| ``PrintMat`` | ``SUNDlsMat_PrintMat`` | ++---------------------------------+--------------------------------+ +| ``newDenseMat`` | ``SUNDlsMat_newDenseMat`` | ++---------------------------------+--------------------------------+ +| ``newBandMat`` | ``SUNDlsMat_newBandMat`` | ++---------------------------------+--------------------------------+ +| ``destroyMat`` | ``SUNDlsMat_destroyMat`` | ++---------------------------------+--------------------------------+ +| ``newIntArray`` | ``SUNDlsMat_newIntArray`` | ++---------------------------------+--------------------------------+ +| ``newIndexArray`` | ``SUNDlsMat_newIndexArray`` | ++---------------------------------+--------------------------------+ +| ``newRealArray`` | ``SUNDlsMat_newRealArray`` | ++---------------------------------+--------------------------------+ +| ``destroyArray`` | ``SUNDlsMat_destroyArray`` | ++---------------------------------+--------------------------------+ + +In addition, the entire ``sundials_lapack.h`` header file is now deprecated for +removal in SUNDIALS v7.0.0. Note, this header file is not needed to use the +SUNDIALS LAPACK linear solvers. + +Deprecated "bootstrap" and "minimum correction" predictors in ARKStep (options 4 +and 5 to :c:func:`ARKStepSetPredictorMethod`) and the "bootstrap" predictor in +MRIStep (option 4 to :c:func:`MRIStepSetPredictorMethod`). These functions will +output a deprecation warning message and will be removed in a future release. + +Changes to SUNDIALS in release 5.8.0 +==================================== + +**New Features** + +The :ref:`RAJA vector <NVectors.RAJA>` implementation has been updated to +support the SYCL backend in addition to the CUDA and HIP backend. Users can +choose the backend when configuring SUNDIALS by using the +:cmakeop:`SUNDIALS_RAJA_BACKENDS` CMake variable. This vector remains +experimental and is subject to change from version to version. + +New :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` implementation were added +to interface with the Intel oneAPI Math Kernel Library (oneMKL). Both the matrix +and the linear solver support general dense linear systems as well as block +diagonal linear systems. See :numref:`SUNLinSol.OneMklDense` for more +details. This matrix is experimental and is subject to change from version to +version. + +Added a new *optional* function to the SUNLinearSolver API, +:c:func:`SUNLinSolSetZeroGuess`, to indicate that the next call to +:c:func:`SUNLinSolSolve` will be made with a zero initial guess. SUNLinearSolver +implementations that do not use the :c:func:`SUNLinSolNewEmpty` constructor +will, at a minimum, need set the ``setzeroguess`` function pointer in the linear +solver ``ops`` structure to ``NULL``. The SUNDIALS iterative linear solver +implementations have been updated to leverage this new set function to remove +one dot product per solve. + +The time integrator packages (ARKODE, CVODE(S), and IDA(S)) all now support a +new "matrix-embedded" :c:type:`SUNLinearSolver` type. This type supports +user-supplied SUNLinearSolver implementations that set up and solve the +specified linear system at each linear solve call. Any matrix-related data +structures are held internally to the linear solver itself, and are not provided +by the SUNDIALS package. + +Added functions to ARKODE and CVODE(S) for supplying an alternative right-hand +side function and to IDA(S) for supplying an alternative residual for use within +nonlinear system function evaluations: + +* :c:func:`ARKStepSetNlsRhsFn` +* :c:func:`MRIStepSetNlsRhsFn` +* :c:func:`CVodeSetNlsRhsFn` +* :c:func:`IDASetNlsResFn` + +Support for user-defined inner (fast) integrators has been to the MRIStep +module. See :ref:`ARKODE.Usage.MRIStep.CustomInnerStepper` for more information on providing +a user-defined integration method. + +Added specialized fused HIP kernels to CVODE which may offer better performance +on smaller problems when using CVODE with the HIP vector. See the optional input +function :c:func:`CVodeSetUseIntegratorFusedKernels` for more information. As +with other SUNDIALS HIP features, this capability is considered experimental and +may change from version to version. + +New KINSOL options have been added to apply a constant damping factor in the +fixed point and Picard iterations (see :c:func:`KINSetDamping`), to delay the +start of Anderson acceleration with the fixed point and Picard iterations (see +:c:func:`KINSetDelayAA`), and to return the newest solution with the fixed point +iteration (see :c:func:`KINSetReturnNewest`). + +The installed ``SUNDIALSConfig.cmake`` file now supports the ``COMPONENTS`` +option to ``find_package``. The exported targets no longer have IMPORTED_GLOBAL +set. + +**Bug Fixes** + +A bug was fixed in :c:func:`SUNMatCopyOps` where the matrix-vector product setup +function pointer was not copied. + +A bug was fixed in the :ref:`SPBCGS <SUNLinSol.SPBCGS>` and :ref:`SPTFQMR +<SUNLinSol.SPTFQMR>` solvers for the case where a non-zero initial guess and a +solution scaling vector are provided. This fix only impacts codes using SPBCGS +or SPTFQMR as standalone solvers as all SUNDIALS packages utilize a zero initial +guess. + +A bug was fixed in the ARKODE stepper modules where the stop time may be passed +after resetting the integrator. + +A bug was fixed in :c:func:`IDASetJacTimesResFn` in IDAS where the supplied +function was used in the dense finite difference Jacobian computation rather +than the finite difference Jacobian-vector product approximation. + +A bug was fixed in the KINSOL Picard iteration where the value of +:c:func:`KINSetMaxSetupCalls` would be ignored. + +Changes to SUNDIALS in release 5.7.0 +==================================== + +A new :c:type:`N_Vector` implementation based on the SYCL abstraction layer has +been added targeting Intel GPUs. At present the only SYCL compiler supported is +the DPC++ (Intel oneAPI) compiler. See :numref:`NVectors.SYCL` for more +details. This vector is considered experimental and is subject to major changes +even in minor releases. + +A new :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` implementation were +added to interface with the MAGMA linear algebra library. Both the matrix and +the linear solver support general dense linear systems as well as block diagonal +linear systems, and both are targeted at GPUs (AMD or NVIDIA). See +:numref:`SUNLinSol.MagmaDense` for more details. + +Changes to SUNDIALS in release 5.6.1 +==================================== + +Fixed a CMake bug which caused an error if the :cmakeop:`CMAKE_CXX_STANDARD` and +:cmakeop:`SUNDIALS_RAJA_BACKENDS` options were not provided. + +Fixed some compiler warnings when using the IBM XL compilers. + +Changes to SUNDIALS in release 5.6.0 +==================================== + +A new :c:type:`N_Vector` implementation based on the AMD ROCm HIP platform has +been added. This vector can target NVIDIA or AMD GPUs. See +:numref:`NVectors.hip` for more details. This vector is considered experimental +and is subject to change from version to version. + +The :ref:`RAJA vector <NVectors.RAJA>` implementation has been updated to +support the HIP backend in addition to the CUDA backend. Users can choose the +backend when configuring SUNDIALS by using the :cmakeop:`SUNDIALS_RAJA_BACKENDS` +CMake variable. This vector remains experimental and is subject to change from +version to version. + +A new optional operation, :c:func:`N_VGetDeviceArrayPointer`, was added to the +N_Vector API. This operation is useful for vectors that utilize dual memory +spaces, e.g. the native SUNDIALS CUDA N_Vector. + +The SUNDIALS matrix and linear solver interfaces to the :ref:`cuSparse matrix +<SUNMatrix.cuSparse>` and :ref:`cuSolver batched QR solver +<SUNLinSol.cuSolverSp>` no longer require using the CUDA +:c:type:`N_Vector`. Instead, they require that the vector utilized provides the +:c:func:`N_VGetDeviceArrayPointer` operation, and that the pointer returned by +:c:func:`N_VGetDeviceArrayPointer` is a valid CUDA device pointer. + +Changes to SUNDIALS in release 5.5.0 +==================================== + +Refactored the SUNDIALS build system. CMake 3.12.0 or newer is now required. +Users will likely see deprecation warnings, but otherwise the changes +should be fully backwards compatible for almost all users. SUNDIALS +now exports CMake targets and installs a ``SUNDIALSConfig.cmake`` file. + +Added support for SuperLU DIST 6.3.0 or newer. + +Changes to SUNDIALS in release 5.4.0 +==================================== + +**Major Features** + +A new class, :c:type:`SUNMemoryHelper`, was added to support **GPU users** who +have complex memory management needs such as using memory pools. This is paired +with new constructors for the CUDA and RAJA vectors that accept a +:c:type:`SUNMemoryHelper` object. Refer to :numref:`SUNDIALS.GPU`, +:numref:`SUNMemory`, :numref:`NVectors.cuda` and :numref:`NVectors.raja` for +more information. + +Added full support for time-dependent mass matrices in ARKStep, and expanded +existing non-identity mass matrix infrastructure to support use of the +fixed point nonlinear solver. + +An interface between ARKStep and the XBraid multigrid reduction in time (MGRIT) +library :cite:p:`xbraid` has been added to enable parallel-in-time integration. See the +:ref:`ARKODE.Usage.ARKStep.XBraid` section for more information and the example +codes in ``examples/arkode/CXX_xbraid``. This interface required the addition of +three new N_Vector operations to exchange vector data between computational +nodes, see :c:func:`N_VBufSize`, :c:func:`N_VBufPack`, and +:c:func:`N_VBufUnpack`. These N_Vector operations are only used within the +XBraid interface and need not be implemented for any other context. + +**New Features** + +The :ref:`RAJA vector <NVectors.RAJA>` has been updated to mirror the CUDA +vector. Notably, the update adds managed memory support to the RAJA vector. +Users of the vector will need to update any calls to the :c:func:`N_VMake_Raja` +function because that signature was changed. This vector remains experimental +and is subject to change from version to version. + +The expected behavior of :c:func:`SUNNonlinSolGetNumIters` and +:c:func:`SUNNonlinSolGetNumConvFails` in the :c:type:`SUNNonlinearSolver` API +have been updated to specify that they should return the number of nonlinear +solver iterations and convergence failures in the most recent solve respectively +rather than the cumulative number of iterations and failures across all solves +respectively. The API documentation and SUNDIALS provided +:c:type:`SUNNonlinearSolver` implementations have been updated accordingly. As +before, the cumulative number of nonlinear iterations and failures may be +retrieved with the following functions: + +* :c:func:`ARKStepGetNumNonlinSolvIters` +* :c:func:`ARKStepGetNumNonlinSolvConvFails` +* :c:func:`ARKStepGetNonlinSolvStats` +* :c:func:`MRIStepGetNumNonlinSolvIters` +* :c:func:`MRIStepGetNumNonlinSolvConvFails` +* :c:func:`MRIStepGetNonlinSolvStats` +* :c:func:`CVodeGetNumNonlinSolvIters` +* :c:func:`CVodeGetNumNonlinSolvConvFails` +* :c:func:`CVodeGetNonlinSolvStats` +* :c:func:`IDAGetNumNonlinSolvIters` +* :c:func:`IDAGetNumNonlinSolvConvFails` +* :c:func:`IDAGetNonlinSolvStats` + +Added the following the following functions that advanced users might find +useful when providing a custom :c:func:`SUNNonlinSolSysFn`: + +* :c:func:`ARKStepComputeState` +* :c:func:`ARKStepGetNonlinearSystemData` +* :c:func:`MRIStepComputeState` +* :c:func:`MRIStepGetNonlinearSystemData` +* :c:func:`CVodeComputeState` +* :c:func:`CVodeGetNonlinearSystemData` +* :c:func:`IDAGetNonlinearSystemData` + +Added new functions to CVODE(S), ARKODE, and IDA(S) to to specify the factor for +converting between integrator tolerances (WRMS norm) and linear solver tolerances +(L2 norm) i.e., ``tol_L2 = nrmfac * tol_WRMS``: + +* :c:func:`ARKStepSetLSNormFactor` +* :c:func:`ARKStepSetMassLSNormFactor` +* :c:func:`MRIStepSetLSNormFactor` +* :c:func:`CVodeSetLSNormFactor` +* :c:func:`IDASetLSNormFactor` + +Added new reset functions :c:func:`ARKStepReset`, :c:func:`ERKStepReset`, +and :c:func:`MRIStepReset` to reset the stepper time and state vector to +user-provided values for continuing the integration from that point while +retaining the integration history. These function complement the +reinitialization functions :c:func:`ARKStepReInit`, :c:func:`ERKStepReInit`, +and :c:func:`MRIStepReInit` which reinitialize the stepper so that the problem +integration should resume as if started from scratch. + +Updated the MRIStep time-stepping module in ARKODE to support higher-order +MRI-GARK methods :cite:p:`Sandu:19`, including methods that involve +solve-decoupled, diagonally-implicit treatment of the slow time scale. + +The function :c:func:`CVodeSetLSetupFrequency` has been added to CVODE(S) to set +the frequency of calls to the linear solver setup function. + +The Trilinos Tpetra :c:type:`N_Vector` interface has been updated to work with +Trilinos 12.18+. This update changes the local ordinal type to always be an +``int``. + +Added support for CUDA 11. + +**Bug Fixes** + +A minor inconsistency in CVODE(S) and a bug ARKODE when checking the Jacobian +evaluation frequency has been fixed. As a result codes using using a non-default +Jacobian update frequency through a call to ``CVodeSetMaxStepsBetweenJac`` +or ``ARKStepSetMaxStepsBetweenJac`` will need to increase the provided +value by 1 to achieve the same behavior as before. + +In IDAS and CVODES, the functions for forward integration with checkpointing +(:c:func:`IDASolveF`, :c:func:`CVodeF`) are now subject to a restriction on the +number of time steps allowed to reach the output time. This is the same +restriction applied to :c:func:`IDASolve` and :c:func:`CVode`. The default +maximum number of steps is ``500``, but this may be changed using the +:c:func:`CVodeSetMaxNumSteps` and :c:func:`IDASetMaxNumSteps` function. This +change fixes a bug that could cause an infinite loop in :c:func:`IDASolveF` and +:c:func:`CVodeF`. **This change may cause a runtime error in existing user +code**. + +Fixed bug in using ERK method integration with static mass matrices. + +**Deprecation Notice** + +For greater clarity the following functions have been deprecated: + +* ``CVodeSetMaxStepsBetweenJac`` +* ``ARKStepSetMaxStepsBetweenJac`` +* ``ARKStepSetMaxStepsBetweenLSet`` + +The following functions should be used instead: + +* :c:func:`CVodeSetJacEvalFrequency` +* :c:func:`ARKStepSetJacEvalFrequency` +* :c:func:`ARKStepSetLSetupFrequency` + +Changes to SUNDIALS in release 5.3.0 +==================================== + +**Major Feature** + +Added support to CVODE for integrating IVPs with constraints using BDF methods +and projecting the solution onto the constraint manifold with a user defined +projection function. This implementation is accompanied by additions to user +documentation and CVODE examples. See :c:func:`CVodeSetProjFn` for more +information. + +**New Features** + +Added the ability to control the CUDA kernel launch parameters for the CUDA +vector and spare matrix implementations. These implementations remain +experimental and are subject to change from version to version. In addition, the +CUDA vector kernels were rewritten to be more flexible. Most users should see +equivalent performance or some improvement, but a select few may observe minor +performance degradation with the default settings. Users are encouraged to +contact the SUNDIALS team about any performance changes that they notice. + +Added new capabilities for monitoring the solve phase in the Newton and +fixed-point :c:type:`SUNNonlinearSolver`, and the SUNDIALS iterative linear +solvers. SUNDIALS must be built with the CMake option +:cmakeop:`SUNDIALS_BUILD_WITH_MONITORING` to use these capabilities. + +Added specialized fused CUDA kernels to CVODE which may offer better performance +on smaller problems when using CVODE with the CUDA vector. See the optional +input function :c:func:`CVodeSetUseIntegratorFusedKernels` for more +information. As with other SUNDIALS CUDA features, this is feature is +experimental and may change from version to version. + +Added a new function, :c:func:`CVodeSetMonitorFn`, that takes a user-function +to be called by CVODE after every ``nst`` successfully completed time-steps. +This is intended to provide a way of monitoring the CVODE statistics +throughout the simulation. + +Added a new function :c:func:`CVodeGetLinSolveStats` to get the CVODE linear solver +statistics as a group. + +Added the following optional functions to provide an alternative ODE right-hand +side function (ARKODE and CVODE(S)), DAE residual function (IDA(S)), or nonlinear +system function (KINSOL) for use when computing Jacobian-vector products with +the internal difference quotient approximation: + +* :c:func:`ARKStepSetJacTimesRhsFn` +* :c:func:`CVodeSetJacTimesRhsFn` +* :c:func:`CVodeSetJacTimesRhsFnB` +* :c:func:`IDASetJacTimesResFn` +* :c:func:`IDASetJacTimesResFnB` +* :c:func:`KINSetJacTimesVecSysFn` + +**Bug Fixes** + +Fixed a bug in the iterative linear solvers where an error is not returned if +the ``Atimes`` function is ``NULL`` or, if preconditioning is enabled, the +``PSolve`` function is ``NULL``. + +Fixed a bug in ARKODE where the prototypes for :c:func:`ERKStepSetMinReduction` +and :c:func:`ARKStepSetMinReduction` were not included in ``arkode_erkstep.h`` +and ``arkode_arkstep.h`` respectively. + +Fixed a bug in ARKODE where inequality constraint checking would need to be +disabled and then re-enabled to update the inequality constraint values after +resizing a problem. Resizing a problem will now disable constraints and a call +to :c:func:`ARKStepSetConstraints` or :c:func:`ERKStepSetConstraints` is +required to re-enable constraint checking for the new problem size. + +Changes to SUNDIALS in release 5.2.0 +==================================== + +**New Features** + +The following functions were added to each of the time integration packages to +enable or disable the scaling applied to linear system solutions with +matrix-based linear solvers to account for lagged matrix information: + +* :c:func:`ARKStepSetLinearSolutionScaling` +* :c:func:`CVodeSetLinearSolutionScaling` +* :c:func:`CVodeSetLinearSolutionScalingB` +* :c:func:`IDASetLinearSolutionScaling` +* :c:func:`IDASetLinearSolutionScalingB` + +When using a matrix-based linear solver with ARKODE, IDA(S), or BDF methods in +CVODE(S) scaling is enabled by default. + +Added a new :c:type:`SUNMatrix` implementation that interfaces to the sparse +matrix implementation from the NVIDIA cuSPARSE library, see +:numref:`SUNMatrix.cuSparse` for more details. In addition, the CUDA Sparse +linear solver has been updated to use the new matrix, as such, users of this +matrix will need to update their code. This implementations are still considered +to be experimental, thus they are subject to breaking changes even in minor +releases. + +Added a new "stiff" interpolation module to ARKODE, based on Lagrange polynomial +interpolation, that is accessible to each of the ARKStep, ERKStep and MRIStep +time-stepping modules. This module is designed to provide increased +interpolation accuracy when integrating stiff problems, as opposed to the +ARKODE-standard Hermite interpolation module that can suffer when the IVP +right-hand side has large Lipschitz constant. While the Hermite module remains +the default, the new Lagrange module may be enabled using one of the routines +:c:func:`ARKStepSetInterpolantType`, :c:func:`ERKStepSetInterpolantType`, or +:c:func:`MRIStepSetInterpolantType`. The serial example problem +``ark_brusselator.c`` has been converted to use this Lagrange interpolation +module. Created accompanying routines :c:func:`ARKStepSetInterpolantDegree`, +:c:func:`ARKStepSetInterpolantDegree` and :c:func:`ARKStepSetInterpolantDegree` +to provide user control over these interpolating polynomials. + +Added two new functions, :c:func:`ARKStepSetMinReduction` and +:c:func:`ERKStepSetMinReduction`, to change the minimum allowed step size +reduction factor after an error test failure. + +**Bug Fixes** + +Fixed a build system bug related to the Fortran 2003 interfaces when using the +IBM XL compiler. When building the Fortran 2003 interfaces with an XL compiler +it is recommended to set :cmakeop:`CMAKE_Fortran_COMPILER` to ``f2003``, +``xlf2003``, or ``xlf2003_r``. + +Fixed a bug in how ARKODE interfaces with a user-supplied, iterative, unscaled +linear solver. In this case, ARKODE adjusts the linear solver tolerance in an +attempt to account for the lack of support for left/right scaling matrices. +Previously, ARKODE computed this scaling factor using the error weight vector, +``ewt``; this fix changes that to the residual weight vector, ``rwt``, that can +differ from ``ewt`` when solving problems with non-identity mass matrix. + +Fixed a linkage bug affecting Windows users that stemmed from +dllimport/dllexport attribute missing on some SUNDIALS API functions. + +Fixed a memory leak in CVODES and IDAS from not deallocating the ``atolSmin0`` +and ``atolQSmin0`` arrays. + +Fixed a bug where a non-default value for the maximum allowed growth factor +after the first step would be ignored. + +**Deprecation Notice** + +The routines :c:func:`ARKStepSetDenseOrder`, :c:func:`ARKStepSetDenseOrder` and +:c:func:`ARKStepSetDenseOrder` have been deprecated and will be removed in a +future release. The new functions :c:func:`ARKStepSetInterpolantDegree`, +:c:func:`ARKStepSetInterpolantDegree`, and :c:func:`ARKStepSetInterpolantDegree` +should be used instead. + +Changes to SUNDIALS in release 5.1.0 +==================================== + +**New Features** + +Added support for a user-supplied function to update the prediction for each +implicit stage solution in ARKStep. If supplied, this routine will be called +*after* any existing ARKStep predictor algorithm completes, so that the +predictor may be modified by the user as desired. The new user-supplied routine +has type :c:type:`ARKStagePredictFn`, and may be set by calling +:c:func:`ARKStepSetStagePredictFn`. + +The MRIStep module has been updated to support attaching different user data +pointers to the inner and outer integrators. If applicable, user codes will need +to add a call to :c:func:`ARKStepSetUserData` to attach their user data pointer +to the inner integrator memory as :c:func:`MRIStepSetUserData` will not set the +pointer for both the inner and outer integrators. The MRIStep examples have been +updated to reflect this change. + +Added support for damping when using Anderson acceleration in KINSOL. See the +:ref:`KINSOL.Mathematics` and the description of the +:c:func:`KINSetDampingAA` function for more details. + +Added support for constant damping to the fixed-point +:c:type:`SUNNonlinearSolver` when using Anderson acceleration. See +:ref:`SUNNonlinSol.FixedPoint.Math` and the +:c:func:`SUNNonlinSolSetDamping_FixedPoint` for more details. + +Added two utility functions, :c:func:`SUNDIALSFileOpen` and +:c:func:`SUNDIALSFileClose` for creating/destroying file pointers. These are +useful when using the Fortran 2003 interfaces. + +Added a new build system option, ``CUDA_ARCH``, to specify the CUDA +architecture to target. + +**Bug Fixes** + +Fixed a build system bug related to finding LAPACK/BLAS. + +Fixed a build system bug related to checking if the KLU library works. + +Fixed a build system bug related to finding PETSc when using the CMake +variables :cmakeop:`PETSC_INCLUDES` and :cmakeop:`PETSC_LIBRARIES` instead of +:cmakeop:`PETSC_DIR`. + +Fixed a bug in the Fortran 2003 interfaces to the ARKODE Butcher table routines +and structure. This includes changing the :c:type:`ARKodeButcherTable` type to +be a ``type(c_ptr)`` in Fortran. + +Changes to SUNDIALS in release 5.0.0 +==================================== + +**Build System** + +Increased the minimum required CMake version to 3.5 for most SUNDIALS +configurations, and 3.10 when CUDA or OpenMP with device offloading are enabled. + +The CMake option ``BLAS_ENABLE`` and the variable ``BLAS_LIBRARIES`` have been +removed to simplify builds as SUNDIALS packages do not use BLAS directly. For +third party libraries that require linking to BLAS, the path to the BLAS library +should be included in the ``_LIBRARIES`` variable for the third party library +e.g., :cmakeop:`SUPERLUDIST_LIBRARIES` when enabling SuperLU_DIST. + +**NVector** + +Two new functions were added to aid in creating custom :c:type:`N_Vector` +objects. The constructor :c:func:`N_VNewEmpty` allocates an "empty" generic +:c:type:`N_Vector` with the object's content pointer and the function pointers +in the operations structure initialized to ``NULL``. When used in the +constructor for custom objects this function will ease the introduction of any +new optional operations to the :c:type:`N_Vector` API by ensuring only required +operations need to be set. Additionally, the function :c:func:`N_VCopyOps` has +been added to copy the operation function pointers between vector objects. When +used in clone routines for custom vector objects these functions also will ease +the introduction of any new optional operations to the :c:type:`N_Vector` API by +ensuring all operations are copied when cloning objects. + +Added new :c:type:`N_Vector` implementations, :ref:`ManyVector +<NVectors.ManyVector>` and :ref:`MPIManyVector <NVectors.MPIManyVector>`, to +support flexible partitioning of solution data among different processing +elements (e.g., CPU + GPU) or for multi-physics problems that couple distinct +MPI-based simulations together (see the :numref:`NVectors.ManyVector` and +:numref:`NVectors.MPIManyVector` for more details). This implementation is +accompanied by additions to user documentation and SUNDIALS examples. + +Additionally, an :ref:`MPIPlusX vector <NVectors.MPIPlusX>` implementation has been +created to support the MPI+X paradigm where X is a type of on-node parallelism +(e.g., OpenMP, CUDA, etc.). The implementation is accompanied by additions to +user documentation and SUNDIALS examples. + +One new required vector operation and ten new optional vector operations have +been added to the :c:type:`N_Vector` API. The new required operation, +:c:func:`N_VGetLength`, returns the global vector length. The optional +operations have been added to support the new MPIManyVector implementation. The +operation :c:func:`N_VGetCommunicator` must be implemented by subvectors that +are combined to create an MPIManyVector, but is not used outside of this +context. The remaining nine operations are optional local reduction operations +intended to eliminate unnecessary latency when performing vector reduction +operations (norms, etc.) on distributed memory systems. The optional local +reduction vector operations are :c:type:`N_VDotProdLocal`, +:c:type:`N_VMaxNormLocal`, :c:type:`N_VMinLocal`, :c:type:`N_VL1NormLocal`, +:c:type:`N_VWSqrSumLocal`, :c:type:`N_VWSqrSumMaskLocal`, +:c:type:`N_VInvTestLocal`, :c:type:`N_VConstrMaskLocal`, and +:c:type:`N_VMinQuotientLocal`. If an :c:type:`N_Vector` implementation defines +any of the local operations as ``NULL``, then the MPIManyVector will call +standard :c:type:`N_Vector` operations to complete the computation. + +The ``*_MPICuda`` and ``*_MPIRaja`` functions have been removed from the CUDA +and RAJA vector implementations respectively. Accordingly, the +``nvector_mpicuda.h``, ``nvector_mpiraja.h``, ``libsundials_nvecmpicuda.lib``, +and ``libsundials_nvecmpicudaraja.lib`` files have been removed. Users should +use the MPI+X vector in conjunction with the CUDA and RAJA vectors to replace +the functionality. The necessary changes are minimal and should require few code +modifications. See the example programs in ``examples/ida/mpicuda`` and +``examples/ida/mpiraja`` for examples of how to use the MPI+X vector with the +CUDA and RAJA vectors, respectively. + +Made performance improvements to the CUDA vector. Users who utilize a +non-default stream should no longer see default stream synchronizations after +memory transfers. + +Added a new constructor to the CUDA vector that allows a user to provide custom +allocate and free functions for the vector data array and internal reduction +buffer. + +Added three new :c:type:`N_Vector` utility functions, +:c:func:`N_VGetVecAtIndexVectorArray`, :c:func:`N_VSetVecAtIndexVectorArray`, +and :c:func:`N_VNewVectorArray`, for working with :c:type:`N_Vector` arrays when +using the Fortran 2003 interfaces. + +**SUNMatrix** + +Two new functions were added to aid in creating custom :c:type:`SUNMatrix` +objects. The constructor :c:func:`SUNMatNewEmpty` allocates an "empty" generic +:c:type:`SUNMatrix` with the object's content pointer and the function pointers +in the operations structure initialized to ``NULL``. When used in the +constructor for custom objects this function will ease the introduction of any +new optional operations to the :c:type:`SUNMatrix` API by ensuring only required +operations need to be set. Additionally, the function :c:func:`SUNMatCopyOps` +has been added to copy the operation function pointers between matrix +objects. When used in clone routines for custom matrix objects these functions +also will ease the introduction of any new optional operations to the +:c:type:`SUNMatrix` API by ensuring all operations are copied when cloning +objects. + +A new operation, :c:func:`SUNMatMatvecSetup`, was added to the +:c:type:`SUNMatrix` API to perform any setup necessary for computing a +matrix-vector product. This operation is useful for :c:type:`SUNMatrix` +implementations which need to prepare the matrix itself, or communication +structures before performing the matrix-vector product. Users who have +implemented a custom :c:type:`SUNMatrix` will need to at least update their code +to set the corresponding ``ops`` structure member, ``matvecsetup``, to ``NULL``. + +The generic :c:type:`SUNMatrix` API now defines error codes to be returned by +matrix operations. Operations which return an integer flag indiciating +success/failure may return different values than previously. + +A new :c:type:`SUNMatrix` (and :c:type:`SUNLinearSolver`) implementation was +added to facilitate the use of the SuperLU_DIST library with SUNDIALS. + +**SUNLinearSolver** + +A new function was added to aid in creating custom :c:type:`SUNLinearSolver` +objects. The constructor :c:func:`SUNLinSolNewEmpty` allocates an "empty" +generic :c:type:`SUNLinearSolver` with the object's content pointer and the +function pointers in the operations structure initialized to ``NULL``. When used +in the constructor for custom objects this function will ease the introduction +of any new optional operations to the :c:type:`SUNLinearSolver` API by ensuring +only required operations need to be set. + +The return type of the :c:type:`SUNLinSolLastFlag` in the +:c:type:`SUNLinearSolver` has changed from ``long int`` to +:c:type:`sunindextype` to be consistent with the type used to store row indices +in dense and banded linear solver modules. + +Added a new optional operation to the :c:type:`SUNLinearSolver` API, +:c:func:`SUNLinSolGetID`, that returns a :c:enum:`SUNLinearSolver_ID` for +identifying the linear solver module. + +The :c:type:`SUNLinearSolver` API has been updated to make the initialize and +setup functions optional. + +A new :c:type:`SUNLinearSolver` (and :c:type:`SUNMatrix`) implementation was +added to facilitate the use of the SuperLU_DIST library with SUNDIALS. + +Added a new :c:type:`SUNLinearSolver` implementation, :ref:`cuSolverSp_batchQR +<SUNLinSol.cuSolverSp>`, which leverages the NVIDIA cuSOLVER sparse batched QR +method for efficiently solving block diagonal linear systems on NVIDIA GPUs. + +Added three new accessor functions to the KLU linear solver to provide user +access to the underlying KLU solver structures: +:c:func:`SUNLinSol_KLUGetSymbolic`, :c:func:`SUNLinSol_KLUGetNumeric`, and +:c:func:`SUNLinSol_KLUGetCommon`. + +**SUNNonlinearSolver** + +A new function was added to aid in creating custom :c:type:`SUNNonlinearSolver` +objects. The constructor :c:func:`SUNNonlinSolNewEmpty` allocates an "empty" +generic :c:type:`SUNNonlinearSolver` with the object's content pointer and the +function pointers in the operations structure initialized to ``NULL``. When used +in the constructor for custom objects this function will ease the introduction +of any new optional operations to the :c:type:`SUNNonlinearSolver` API by +ensuring only required operations need to be set. + +To facilitate the use of user supplied nonlinear solver convergence test +functions the :c:func:`SUNNonlinSolSetConvTestFn` function in the +:c:type:`SUNNonlinearSolver` API has been updated to take a ``void*`` data +pointer as input. The supplied data pointer will be passed to the nonlinear +solver convergence test function on each call. + +The inputs values passed to the first two inputs of the :c:func:`SUNNonlinSolSolve` +function in the :c:type:`SUNNonlinearSolver` have been changed to be the predicted +state and the initial guess for the correction to that state. Additionally, +the definitions of :c:func:`SUNNonlinSolLSetupFn` and :c:func:`SUNNonlinSolLSolveFn` in the +:c:type:`SUNNonlinearSolver` API have been updated to remove unused input parameters. +For more information on the nonlinear system formulation and the API functions +see :ref:`SUNNonlinSol`. + +Added a new :c:type:`SUNNonlinearSolver` implementation for interfacing with the +:ref:`PETSc SNES <SUNNonlinSol.PetscSNES>` nonlinear solver. + +**New Features** + +A new linear solver interface functions, :c:type:`ARKLsLinSysFn` and +:c:type:`CVLsLinSysFn`, as added as an alternative method for evaluating the +linear systems :math:`M - \gamma J` or :math:`I - \gamma J`. + +Added the following functions to get the current state and gamma value to +ARKStep, CVODE and CVODES that may be useful to users who choose to provide +their own nonlinear solver implementation: + +* :c:func:`ARKStepGetCurrentState` +* :c:func:`ARKStepGetCurrentGamma` +* :c:func:`CVodeGetCurrentGamma` +* :c:func:`CVodeGetCurrentState` +* :c:func:`CVodeGetCurrentGamma` +* :c:func:`CVodeGetCurrentStateSens` +* :c:func:`CVodeGetCurrentSensSolveIndex` +* :c:func:`IDAGetCurrentCj` +* :c:func:`IDAGetCurrentY` +* :c:func:`IDAGetCurrentYp` +* :c:func:`IDAComputeY` +* :c:func:`IDAComputeYp` + +Removed extraneous calls to :c:func:`N_VMin` for simulations where the scalar +valued absolute tolerance, or all entries of the vector-valued absolute +tolerance array, are strictly positive. In this scenario ARKODE, CVODE(S), and +IDA(S) steppers will remove at least one global reduction per time step. + +The ARKODE, CVODE(S), IDA(S), and KINSOL linear solver interfaces have been +updated to only zero the Jacobian matrix before calling a user-supplied Jacobian +evaluation function when the attached linear solver has type +:c:type:`SUNLINEARSOLVER_DIRECT`. + +Added new Fortran 2003 interfaces to all of the SUNDIALS packages (ARKODE, +CVODE(S), IDA(S), and KINSOL as well as most of the :c:type:`N_Vector`, +:c:type:`SUNMatrix`, :c:type:`SUNLinearSolver`, and :c:type:`SUNNonlinearSolver` +implementations. See :numref:`SUNDIALS.Fortran` section for more details. +These new interfaces were generated with SWIG-Fortran and provide a user an +idiomatic Fortran 2003 interface to most of the SUNDIALS C API. + +The MRIStep module has been updated to support explicit, implicit, or IMEX +methods as the fast integrator using the ARKStep module. As a result some +function signatures have been changed including :c:func:`MRIStepCreate` which +now takes an ARKStep memory structure for the fast integration as an input. + +The reinitialization functions :c:func:`ERKStepReInit`, :c:func:`ARKStepReInit`, +and :c:func:`MRIStepReInit` have been updated to retain the minimum and maxiumum +step size values from before reinitialization rather than resetting them to the +default values. + +Added two new embedded ARK methods of orders 4 and 5 to ARKODE (from +:cite:p:`KenCarp:19`). + +Support for optional inequality constraints on individual components of the +solution vector has been added the ARKODE ERKStep and ARKStep modules. See the +descriptions of :c:func:`ERKStepSetConstraints` and +:c:func:`ARKStepSetConstraints` for more details. Note that enabling constraint +handling requires the :c:type:`N_Vector` operations :c:func:`N_VMinQuotient`, +:c:func:`N_VConstrMask`, and :c:func:`N_VCompare` that were not previously +required by ARKODE. + +Add two new 'Set' functions to MRIStep, :c:func:`MRIStepSetPreInnerFn` and +:c:func:`MRIStepSetPostInnerFn`, for performing communication or memory transfers +needed before or after the inner integration. + +**Bug Fixes** + +Fixed a bug in the build system that prevented the PThreads NVECTOR module from +being built. + +Fixed a memory leak in the PETSc :c:type:`N_Vector` clone function. + +Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +the default nonlinear solver. + +Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in +an infinite loop if the nonlinear solver failed to converge more than the +maximum allowed times during a single step. + +Fixed a bug in ARKODE that would result in a "too much accuracy requested" error +when using fixed time step sizes with explicit methods in some cases. + +Fixed a bug in ARKStep where the mass matrix linear solver setup function was +not called in the Matrix-free case. + +Fixed a minor bug in ARKStep where an incorrect flag is reported when an +error occurs in the mass matrix setup or Jacobian-vector product setup +functions. + +Fixed a bug in the CVODE and CVODES constraint handling where the step size +could be set below the minimum step size. + +Fixed a bug in the CVODE and CVODES nonlinear solver interfaces where the norm +of the accumulated correction was not updated when using a non-default +convergence test function. + +Fixed a bug in the CVODES ``cvRescale`` function where the loops to compute the +array of scalars for the fused vector scale operation stopped one iteration +early. + +Fixed a bug in CVODES and IDAS where :c:func:`CVodeF` and :c:func:`IDASolveF` +would return the wrong flag under certain circumstances. + +Fixed a bug in CVODES and IDAS where :c:func:`CVodeF` and :c:func:`IDASolveF` +would not return a root in ``NORMAL_STEP`` mode if the root occurred after the +desired output time. + +Fixed a bug in the IDA and IDAS linear solver interfaces where an incorrect +Jacobian-vector product increment was used with iterative solvers other than +SPGMR and SPFGMR. + +Fixed a bug the IDAS :c:func:`IDAQuadReInitB` function where an incorrect memory +structure was passed to :c:func:`IDAQuadReInit`. + +Fixed a bug in the KINSOL linear solver interface where the auxiliary scalar +``sJpnorm`` was not computed when necessary with the Picard iteration and the +auxiliary scalar ``sFdotJp`` was unnecessarily computed in some cases. + +Changes to SUNDIALS in release 4.1.0 +==================================== + +**Removed Implementation Headers** + +The implementation header files (``*_impl.h``) are no longer installed. This +means users who are directly accessing or manipulating package memory structures +will need to update their code to use the package's public API. + +**New Features** + +An additional :c:type:`N_Vector` implementation was added for interfacing with +the Tpetra vector from Trilinos library to facilitate interoperability between +SUNDIALS and Trilinos. This implementation is accompanied by additions to user +documentation and SUNDIALS examples. + +**Bug Fixes** + +The ``EXAMPLES_ENABLE_RAJA`` CMake option has been removed. The option +:cmakeop:`EXAMPLES_ENABLE_CUDA` enables all examples that use CUDA including the +RAJA examples with a CUDA back end (if RAJA is enabled). + +Python is no longer required to run ``make test`` and ``make test_install``. + +A bug was fixed where a nonlinear solver object could be freed twice in some use +cases. + +Fixed a bug in :c:func:`ARKodeButcherTable_Write` when printing a Butcher table +without an embedding. + +Changes to SUNDIALS in release 4.0.2 +==================================== + +Added information on how to contribute to SUNDIALS and a contributing agreement. + +Moved the definitions of backwards compatibility functions for the prior direct +linear solver (DLS) and scaled preconditioned iterarive linear solvers (SPILS) +to a source file. The symbols are now included in the appropriate package +library, e.g. ``libsundials_cvode.lib``. + +Changes to SUNDIALS in release 4.0.1 +==================================== + +A bug in ARKODE where single precision builds would fail to compile has been +fixed. + +Changes to SUNDIALS in release 4.0.0 +==================================== + +The direct and iterative linear solver interfaces in all SUNDIALS packages have +been merged into a single unified linear solver interface to support any valid +:c:type:`SUNLinearSolver`. This includes the ``DIRECT`` and ``ITERATIVE`` types +as well as the new ``MATRIX_ITERATIVE`` type. Details regarding how SUNDIALS +packages utilize linear solvers of each type as well as a discussion regarding +the intended use cases for user-supplied linear solver implementations are +included in :numref:`SUNLinSol`. All example programs have been updated to use +the new unified linear solver interfaces. + +The unified linear solver interface is very similar to the previous DLS (direct +linear solver) and SPILS (scaled preconditioned iterative linear solver) +interface in each package. To minimize challenges in user migration to the +unified linear solver interfaces, the previous DLS and SPILS functions may still +be used however, these are now deprecated and will be removed in a future +release. Additionally, that Fortran users will need to enlarge their array of +optional integer outputs, and update the indices that they query for certain +linear solver related statistics. + +The names of all SUNDIALS-provided :c:type:`SUNLinearSolver` constructors have +have been updated to follow the naming convention ``SUNLinSol_*`` where ``*`` is +the name of the linear solver. The new constructor names are: + +* :c:func:`SUNLinSol_Band` +* :c:func:`SUNLinSol_Dense` +* :c:func:`SUNLinSol_KLU` +* :c:func:`SUNLinSol_LapackBand` +* :c:func:`SUNLinSol_LapackDense` +* :c:func:`SUNLinSol_PCG` +* :c:func:`SUNLinSol_SPBCGS` +* :c:func:`SUNLinSol_SPFGMR` +* :c:func:`SUNLinSol_SPGMR` +* :c:func:`SUNLinSol_SPTFQMR` +* :c:func:`SUNLinSol_SuperLUMT` + +Linear solver-specific "set" routine names have been similarly standardized. To +minimize challenges in user migration to the new names, the previous function +names may still be used however, these are now deprecated and will be removed in +a future release. All example programs and the standalone linear solver examples +have been updated to use the new naming convention. + +The :c:func:`SUNLinSol_Band` constructor has been simplified to remove the +storage upper bandwidth argument. + +SUNDIALS integrators (ARKODE, CVODE(S), and IDA(S)) have been updated to utilize +generic nonlinear solvers defined by the :c:type:`SUNNonlinearSolver` API. This +enables the addition of new nonlinear solver options and allows for external or +user-supplied nonlinear solvers. The nonlinear solver API and SUNDIALS provided +implementations are described in :ref:`SUNNonlinSol` and follow the same +object oriented design used by the :c:type:`N_Vector`, :c:type:`SUNMatrix`, and +:c:type:`SUNLinearSolver` classes. Currently two nonlinear solver +implementations are provided, :ref:`Newton <SUNNonlinSol.Newton>` and +:ref:`fixed-point <SUNNonlinSol.FixedPoint>`. These replicate the previous +integrator-specific implementations of Newton's method and a fixed-point +iteration (previously referred to as a functional iteration), respectively. Note +the new :ref:`fixed-point <SUNNonlinSol.FixedPoint>` implementation can +optionally utilize Anderson's method to accelerate convergence. Example programs +using each of these nonlinear solvers in a standalone manner have been added and +all example programs have been updated accordingly. + +The SUNDIALS integrators (ARKODE, CVODE(S), and IDA(S)) all now use the +:ref:`Newton <SUNNonlinSol.Newton>` :c:type:`SUNNonlinearSolver` by default. +Users that wish to use the :ref:`fixed-point <SUNNonlinSol.FixedPoint>` +:c:type:`SUNNonlinearSolver` will need to create the corresponding nonlinear +solver object and attach it to the integrator with the appropriate set function: + +* :c:func:`ARKStepSetNonlinearSolver` +* :c:func:`CVodeSetNonlinearSolver` +* :c:func:`IDASetNonlinearSolver` + +Functions for setting the nonlinear solver options or getting nonlinear solver +statistics remain unchanged and internally call generic ``SUNNonlinearSolver`` +functions as needed. + +With the introduction of the :c:type:`SUNNonlinearSolver` class, the input +parameter ``iter`` to :c:func:`CVodeCreate` has been removed along with the +function ``CVodeSetIterType`` and the constants ``CV_NEWTON`` and +``CV_FUNCTIONAL``. While SUNDIALS includes a fixed-point nonlinear solver, it is +not currently supported in IDA. + +Three fused vector operations and seven vector array operations have been added +to the :c:type:`N_Vector` API. These *optional* operations are disabled by +default and may be activated by calling vector specific routines after creating +a vector (see :numref:`NVectors.Description` for more details). The new +operations are intended to increase data reuse in vector operations, reduce +parallel communication on distributed memory systems, and lower the number of +kernel launches on systems with accelerators. The fused operations are: + +* :c:func:`N_VLinearCombination` +* :c:func:`N_VScaleAddMulti` +* :c:func:`N_VDotProdMulti` + +and the vector array operations are: + +* :c:func:`N_VLinearCombinationVectorArray` +* :c:func:`N_VScaleVectorArray` +* :c:func:`N_VConstVectorArray` +* :c:func:`N_VWrmsNormVectorArray` +* :c:func:`N_VWrmsNormMaskVectorArray` +* :c:func:`N_VScaleAddMultiVectorArray` +* :c:func:`N_VLinearCombinationVectorArray` + +If an :c:type:`N_Vector` implementation defines the implementation any of these +operations as ``NULL``, then standard vector operations will automatically be +called as necessary to complete the computation. + +A new :c:type:`N_Vector` implementation, :ref:`OpenMPDEV <NVectors.OpenMPDEV>`, +leveraging OpenMP device offloading has been added. + +Multiple updates to the :ref:`CUDA <NVectors.CUDA>` vector were made: + +* Changed the :c:func:`N_VMake_Cuda` function to take a host data pointer and a + device data pointer instead of an ``N_VectorContent_Cuda`` object. + +* Changed ``N_VGetLength_Cuda`` to return the global vector length instead + of the local vector length. + +* Added ``N_VGetLocalLength_Cuda`` to return the local vector length. + +* Added ``N_VGetMPIComm_Cuda`` to return the MPI communicator used. + +* Removed the accessor functions in the ``suncudavec`` namespace. + +* Added the ability to set the ``cudaStream_t`` used for execution of the CUDA + kernels. See the function ``N_VSetCudaStreams_Cuda``. + +* Added :c:func:`N_VNewManaged_Cuda`, :c:func:`N_VMakeManaged_Cuda`, and + :c:func:`N_VIsManagedMemory_Cuda` functions to accommodate using managed + memory with the CUDA vector. + +Multiple updates to the :ref:`RAJA <NVectors.RAJA>` vector were made: + +* Changed ``N_VGetLength_Raja`` to return the global vector length instead + of the local vector length. + +* Added ``N_VGetLocalLength_Raja`` to return the local vector length. + +* Added ``N_VGetMPIComm_Raja`` to return the MPI communicator used. + +* Removed the accessor functions in the ``sunrajavec`` namespace. + +Two changes were made in the ARKODE and CVODE(S) initial step size algorithm: + +* Fixed an efficiency bug where an extra call to the RHS function was made. + +* Changed the behavior of the algorithm if the max-iterations case is hit. + Before the algorithm would exit with the step size calculated on the + penultimate iteration. Now it will exit with the step size calculated + on the final iteration. + +Fortran 2003 interfaces to CVODE, the fixed-point and Newton nonlinear solvers, +the dense, band, KLU, PCG, SPBCGS, SPFGMR, SPGMR, and SPTFQMR linear solvers, +and the serial, PThreads, and OpenMP vectors have been added. + +The ARKODE library has been entirely rewritten to support a modular approach to +one-step methods, which should allow rapid research and development of novel +integration methods without affecting existing solver functionality. To support +this, the existing ARK-based methods have been encapsulated inside the new +``ARKStep`` time-stepping module. Two new time-stepping modules have been added: + +* The ``ERKStep`` module provides an optimized implementation for explicit + Runge--Kutta methods with reduced storage and number of calls to the ODE + right-hand side function. + +* The ``MRIStep`` module implements two-rate explicit-explicit multirate + infinitesimal step methods utilizing different step sizes for slow and fast + processes in an additive splitting. + +This restructure has resulted in numerous small changes to the user interface, +particularly the suite of "Set" routines for user-provided solver parameters and +"Get" routines to access solver statistics, that are now prefixed with the name +of time-stepping module (e.g., ``ARKStep`` or ``ERKStep``) instead of +``ARKODE``. Aside from affecting the names of these routines, user-level changes +have been kept to a minimum. However, we recommend that users consult both this +documentation and the ARKODE example programs for further details on the updated +infrastructure. + +As part of the ARKODE restructuring an :c:type:`ARKodeButcherTable` structure +has been added for storing Butcher tables. Functions for creating new Butcher +tables and checking their analytic order are provided along with other utility +routines. For more details see the :ref:`ARKodeButcherTable` section. + +ARKODE's dense output infrastructure has been improved to support higher-degree +Hermite polynomial interpolants (up to degree 5) over the last successful time +step. + +Changes to SUNDIALS in release 3.2.1 +==================================== + +Fixed a bug in the :ref:`CUDA <NVectors.CUDA>` vector where the +:c:func:`N_VInvTest` operation could write beyond the allocated vector data. + +Fixed the library installation path for multiarch systems. This fix changes the +default library installation path from ``CMAKE_INSTALL_PREFIX/lib`` to +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR``. The default value library +directory name is automatically set to ``lib``, ``lib64``, or +``lib/<multiarch-tuple>`` depending on the system, but maybe be overridden by +setting :cmakeop:`CMAKE_INSTALL_LIBDIR`. + +Changes to SUNDIALS in release 3.2.0 +==================================== + +**Library Name Change** + +Changed the name of the RAJA nvector library from ``libsundials_nvecraja.lib`` +to ``libsundials_nveccudaraja.lib`` to better reflect that the RAJA vector only +support the CUDA backend currently. + +**New Features** + +Added hybrid MPI+CUDA and MPI+RAJA vectors to allow use of more than one MPI +rank when using a GPU system. The vectors assume one GPU device per MPI rank. + +Support for optional inequality constraints on individual components of the +solution vector has been added to CVODE and CVODES. For more details see the +:ref:`CVODE.Mathematics` and :ref:`CVODE.Usage.CC.optional_input` sections. Use +of :c:func:`CVodeSetConstraints` requires the :c:type:`N_Vector` operations +:c:func:`N_VMinQuotient`, :c:func:`N_VConstrMask`, and :c:func:`N_VCompare` that +were not previously required by CVODE and CVODES. + +**CMake Updates** + +CMake 3.1.3 is now the minimum required CMake version. + +Deprecated the behavior of the :cmakeop:`SUNDIALS_INDEX_TYPE` CMake option and +added the :cmakeop:`SUNDIALS_INDEX_SIZE` CMake option to select the +:c:type:`sunindextype` integer size. + +The native CMake FindMPI module is now used to locate an MPI installation. + +If MPI is enabled and MPI compiler wrappers are not set, the build system will +check if ``CMAKE_<language>_COMPILER`` can compile MPI programs before trying +to locate and use an MPI installation. + +The previous options for setting MPI compiler wrappers and the executable for +running MPI programs have been have been deprecated. The new options that align +with those used in native CMake FindMPI module are :cmakeop:`MPI_C_COMPILER`, +:cmakeop:`MPI_CXX_COMPILER`, :cmakeop:`MPI_Fortran_COMPILER`, and +:cmakeop:`MPIEXEC_EXECUTABLE`. + +When a Fortran name-mangling scheme is needed (e.g., :cmakeop:`ENABLE_LAPACK` is +``ON``) the build system will infer the scheme from the Fortran compiler. If a +Fortran compiler is not available or the inferred or default scheme needs to be +overridden, the advanced options ``SUNDIALS_F77_FUNC_CASE`` and +``SUNDIALS_F77_FUNC_UNDERSCORES`` can be used to manually set the name-mangling +scheme and bypass trying to infer the scheme. + +Parts of the main ``CMakeLists.txt`` file were moved to new files in the ``src`` +and ``example`` directories to make the CMake configuration file structure more +modular. + +**Bug Fixes** + +Fixed a problem with setting :c:type:`sunindextype` which would occur with some +compilers (e.g. ``armclang``) that do not define ``__STDC_VERSION__``. + +Fixed a thread-safety issue in CVODES and IDAS when using adjoint sensitivity +analysis. + +Fixed a bug in IDAS where the saved residual value used in the nonlinear solve +for consistent initial conditions was passed as temporary workspace and could be +overwritten. + +Changes to SUNDIALS in release 3.1.2 +==================================== + +**CMake Updates** + +Updated the minimum required version of CMake to 2.8.12 and enabled using rpath +by default to locate shared libraries on OSX. + +**New Features** + +Added the function :c:func:`SUNSparseMatrix_Reallocate` to allow specification +of the matrix nonzero storage. + +Added named constants for the two reinitialization types for the KLU +SUNLinearSolver. + +Updated the :c:func:`SUNMatScaleAdd` and :c:func:`SUNMatScaleAddI` +implementations in the sparse SUNMatrix to more optimally handle the case where +the target matrix contained sufficient storage for the sum, but had the wrong +sparsity pattern. The sum now occurs in-place, by performing the sum backwards +in the existing storage. However, it is still more efficient if the +user-supplied Jacobian routine allocates storage for the sum +:math:`M + \gamma J` or :math:`M + \gamma J` manually (with zero entries if +needed). + +The following examples from the usage notes page of the SUNDIALS website, and +updated them to work with SUNDIALS 3.x: + +* ``cvDisc_dns.c`` demonstrates using CVODE with discontinuous solutions or RHS. + +* ``cvRoberts_dns_negsol.c`` illustrates the use of the RHS function return + value to control unphysical negative concentrations. + +* ``cvRoberts_FSA_dns_Switch.c`` demonstrates switching on/off forward + sensitivity computations. This example came from the usage notes page of the + SUNDIALS website. + +**Bug Fixes** + +Fixed a Windows specific problem where :c:type:`sunindextype` was not correctly +defined when using 64-bit integers. On Windows :c:type:`sunindextype` is now +defined as the MSVC basic type ``__int64``. + +Fixed a bug in the full KLU SUNLinearSolver reinitialization approach where the +sparse SUNMatrix pointer would go out of scope on some architectures. + +The misnamed function ``CVSpilsSetJacTimesSetupFnBS`` has been deprecated and +replaced by ``CVSpilsSetJacTimesBS``. The deprecated function +``CVSpilsSetJacTimesSetupFnBS`` will be removed in the next major release. + +Changed LICENSE install path to ``instdir/include/sundials``. + +Changes to SUNDIALS in release 3.1.1 +==================================== + +**Bug Fixes** + +Fixed a minor bug in the CVODE and CVODES ``cvSLdet``, where a return was +missing in the error check for three inconsistent roots. + +Fixed a potential memory leak in the :ref:`SPGMR <SUNLinSol.SPGMR>` and +:ref:`SPFGMR <SUNLinSol.SPFGMR>` linear solvers. If "Initialize" was called +multiple times then the solver memory was reallocated (without being freed). + +Fixed a minor bug in ``ARKReInit``, where a flag was incorrectly set to indicate +that the problem had been resized (instead of just re-initialized). + +Fixed C++11 compiler errors/warnings about incompatible use of string literals. + +Updated the KLU SUNLinearSolver to use a typedef for the precision-specific +solve functions to avoid compiler warnings. + +Added missing typecasts for some (``void*``) pointers to avoid compiler +warnings. + +Fixed bug in the sparse SUNMatrix where ``int`` was used instead of +``sunindextype`` in one location. + +Fixed a minor bug in ``KINPrintInfo`` where a case was missing for +``KIN_REPTD_SYSFUNC_ERR`` leading to an undefined info message. + +Added missing ``#include <stdio.h>`` in :c:type:`N_Vector` and +:c:type:`SUNMatrix` header files. + +Added missing prototypes for ``ARKSpilsGetNumMTSetups`` in ARKODE and +``IDASpilsGetNumJTSetupEvals`` in IDA and IDAS. + +Fixed an indexing bug in the CUDA vector implementation of +:c:func:`N_VWrmsNormMask` and revised the RAJA vector implementation of +:c:func:`N_VWrmsNormMask` to work with mask arrays using values other than zero +or one. Replaced ``double`` with ``realtype`` in the RAJA vector test functions. + +Fixed compilation issue with GCC 7.3.0 and Fortran programs that do not require +a :c:type:`SUNMatrix` or :c:type:`SUNLinearSolver` e.g., iterative linear +solvers, explicit methods in ARKODE, functional iteration in CVODE, etc. + +Changes to SUNDIALS in release 3.1.0 +==================================== + +Added :c:type:`N_Vector` print functions that write vector data to a specified +file (e.g., :c:func:`N_VPrintFile_Serial`). + +Added ``make test`` and ``make test_install`` options to the build system for +testing SUNDIALS after building with ``make`` and installing with ``make +install`` respectively. + +Changes to SUNDIALS in release 3.0.0 +==================================== + +**Major Feature** + +Added new linear solver and matrix interfaces for all SUNDIALS packages and +updated the existing linear solver and matrix implementations. The goal of the +redesign is to provide greater encapsulation and ease interfacing custom linear +solvers with linear solver libraries. Specific changes include: + +* Added a :c:type:`SUNMatrix` interface with three provided implementations: + dense, banded, and sparse. These replicate previous SUNDIALS direct (Dls) and + sparse (Sls) matrix structures. + +* Added example problems demonstrating use of the matrices. + +* Added a :c:type:`SUNLinearSolver` interface with eleven provided + implementations: dense, banded, LAPACK dense, LAPACK band, KLU, SuperLU_MT, + SPGMR, SPBCGS, SPTFQMR, SPFGMR, PCG. These replicate previous SUNDIALS generic + linear solvers. + +* Added example problems demonstrating use of the linear solvers. + +* Expanded package-provided direct linear solver (Dls) interfaces and scaled, + preconditioned, iterative linear solver (Spils) interfaces to utilize + :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` objects. + +* Removed package-specific, linear solver-specific, solver modules (e.g., + CVDENSE, KINBAND, IDAKLU, ARKSPGMR) since their functionality is entirely + replicated by the generic Dls/Spils interfaces and :c:type:`SUNLinearSolver` / + :c:type:`SUNMatrix` classes. The exception is ``CVDIAG``, a diagonal + approximate Jacobian solver available to CVODE and CVODES. + +* Converted all SUNDIALS example problems to utilize new the new matrix and + linear solver objects, along with updated Dls and Spils linear solver + interfaces. + +* Added Spils interface routines to ARKODE, CVODE, CVODES, IDA and IDAS to allow + specification of a user-provided ``JTSetup`` routine. This change supports + users who wish to set up data structures for the user-provided + Jacobian-times-vector (``JTimes``) routine, and where the cost of one + ``JTSetup`` setup per Newton iteration can be amortized between multiple + ``JTimes`` calls. + +Corresponding updates were made to all the example programs. + +**New Features** + +:ref:`CUDA <NVectors.CUDA>` and :ref:`RAJA <NVectors.RAJA>` :c:type:`N_Vector` +implementations to support GPU systems. These vectors are supplied to provide +very basic support for running on GPU architectures. Users are advised that +these vectors both move all data to the GPU device upon construction, and +speedup will only be realized if the user also conducts the right-hand-side +function evaluation on the device. In addition, these vectors assume the problem +fits on one GPU. For further information about RAJA, users are referred to the +`RAJA web site <https://software.llnl.gov/RAJA/>`_. + +Added the type :c:type:`sunindextype` to support using 32-bit or 64-bit integer +types for indexing arrays within all SUNDIALS structures. :c:type:`sunindextype` +is defined to ``int32_t`` or ``int64_t`` when portable types are supported, +otherwise it is defined as ``int`` or ``long int``. The Fortran interfaces +continue to use ``long int`` for indices, except for the sparse matrix interface +that now uses :c:type:`sunindextype`. Interfaces to PETSc, hypre, SuperLU_MT, +and KLU have been updated with 32-bit or 64-bit capabilities depending how the +user configures SUNDIALS. + +To avoid potential namespace conflicts, the macros defining +``booleantype`` values ``TRUE`` and ``FALSE`` have been changed to +:c:macro:`SUNTRUE` and :c:macro:`SUNFALSE` respectively. + +Temporary vectors were removed from preconditioner setup and solve routines for +all packages. It is assumed that all necessary data for user-provided +preconditioner operations will be allocated and stored in user-provided data +structures. + +The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS +type information for use in Fortran programs. + +Added support for many xSDK-compliant build system keys. For more information on +on xSDK compliance the `xSDK policies <https://xsdk.info/policies/>`_. The xSDK +is a movement in scientific software to provide a foundation for the rapid and +efficient production of high-quality, sustainable extreme-scale scientific +applications. For more information visit the +`xSDK web site <https://xsdk.info>`_. + +Added functions :c:func:`SUNDIALSGetVersion` and +:c:func:`SUNDIALSGetVersionNumber` to get SUNDIALS release version information +at runtime. + +Added comments to ``arkode_butcher.c`` regarding which methods should have +coefficients accurate enough for use in quad precision. + +**Build System** + +Renamed CMake options to enable/disable examples for greater clarity and added +option to enable/disable Fortran 77 examples: + + - Changed ``EXAMPLES_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_C` + + - Changed ``CXX_ENABLE`` to :cmakeop:`EXAMPLES_ENABLE_CXX` + + - Changed ``F90_ENABLE`` to ``EXAMPLES_ENABLE_F90`` + + - Added ``EXAMPLES_ENABLE_F77`` option + +Added separate ``BLAS_ENABLE`` and ``BLAS_LIBRARIES`` CMake variables. + +Fixed minor CMake bugs and included additional error checking during CMake +configuration. + +**Bug Fixes** + +*ARKODE* + +Fixed ``RCONST`` usage in ``arkode_butcher.c``. + +Fixed bug in ``arkInitialSetup`` to ensure the mass matrix vector product is +set up before the "msetup" routine is called. + +Fixed ARKODE ``printf``-related compiler warnings when building SUNDIALS +with extended precision. + +*CVODE and CVODES* + +:c:func:`CVodeFree` now calls ``lfree`` unconditionally (if non-NULL). + +*IDA and IDAS* + +Added missing prototype for :c:func:`IDASetMaxBacksIC` in ``ida.h`` and +``idas.h``. + +*KINSOL* + +Corrected KINSOL Fortran name translation for ``FKIN_SPFGMR``. + +Renamed ``KINLocalFn`` and ``KINCommFn`` to :c:type:`KINBBDLocalFn` and +:c:type:`KINBBDCommFn` respectively in the BBD preconditioner module for +consistency with other SUNDIALS solvers. + +Changes to SUNDIALS in release 2.7.0 +==================================== + +**New Features and Enhancements** + +Two additional :c:type:`N_Vector` implementations were added -- one for +:ref:`hypre parallel vectors <NVectors.ParHyp>` and one for :ref:`PETSc +vectors <NVectors.NVPETSc>`. These additions are accompanied by additions to +various interface functions and to user documentation. + +Added a new :c:type:`N_Vector` function, :c:func:`N_VGetVectorID`, that returns +an identifier for the vector. + +The sparse matrix structure was enhanced to support both CSR and CSC matrix +storage formats. + +Various additions were made to the KLU and SuperLU_MT sparse linear solver +interfaces, including support for the CSR matrix format when using KLU. + +In all packages, the linear solver and preconditioner ``free`` routines were +updated to return an integer. + +In all packages, example codes were updated to use ``N_VGetArrayPointer_*`` +rather than the ``NV_DATA`` macro when using the native vectors shipped with +SUNDIALS. + +Additional example programs were added throughout including new examples +utilizing the OpenMP vector. + +*ARKODE* + +The ARKODE implicit predictor algorithms were updated: methods 2 and 3 were +improved slightly, a new predictor approach was added, and the default choice +was modified. + +The handling of integer codes for specifying built-in ARKODE Butcher tables was +enhanced. While a global numbering system is still used, methods now have +``#defined`` names to simplify the user interface and to streamline +incorporation of new Butcher tables into ARKODE. + +The maximum number of Butcher table stages was increased from 8 to 15 to +accommodate very high order methods, and an 8th-order adaptive ERK method was +added. + +Support was added for the explicit and implicit methods in an additive +Runge--Kutta method with different stage times to support new SSP-ARK methods. + +The FARKODE interface was extended to include a routine to set +scalar/array-valued residual tolerances, to support Fortran applications with +non-identity mass-matrices. + +*IDA and IDAS* + +The optional input function :c:func:`IDASetMaxBacksIC` was added to set the +maximum number of linesearch backtracks in the initial condition calculation. + +**Bug Fixes** + +Various minor fixes to installation-related files. + +Fixed some examples with respect to the change to use new macro/function names +e.g., ``SUNRexp``, etc. + +In all packages, a memory leak was fixed in the banded preconditioner and +banded-block-diagonal preconditioner interfaces. + +Corrected name ``N_VCloneEmptyVectorArray`` to ``N_VCloneVectorArrayEmpty`` in +all documentation files. + +Various corrections were made to the interfaces to the sparse solvers KLU and +SuperLU_MT. + +For each linear solver, the various solver performance counters are now +initialized to 0 in both the solver specification function and in the solver +``linit`` function. This ensures that these solver counters are initialized upon +linear solver instantiation as well as at the beginning of the problem solution. + +*ARKODE* + +The missing ``ARKSpilsGetNumMtimesEvals`` function was added -- this had been +included in the previous documentation but had not been implemented. + +The choice of the method vs embedding the Billington and TRBDF2 explicit +Runge--Kutta methods were swapped, since in those the lower-order coefficients +result in an A-stable method, while the higher-order coefficients do not. This +change results in significantly improved robustness when using those methods. + +A bug was fixed for the situation where a user supplies a vector of absolute +tolerances, and also uses the vector Resize functionality. + +A bug was fixed wherein a user-supplied Butcher table without an embedding is +supplied, and the user is running with either fixed time steps (or they do +adaptivity manually); previously this had resulted in an error since the +embedding order was below 1. + +*CVODE* + +Corrections were made to three Fortran interface functions. + +In FCVODE, fixed argument order bugs in the ``FCVKLU`` and ``FCVSUPERLUMT`` +linear solver interfaces. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +*CVODES* + +A bug was fixed in the interpolation functions used in solving backward problems +for adjoint sensitivity analysis. + +In the interpolation routines for backward problems, added logic to bypass +sensitivity interpolation if input sensitivity argument is ``NULL``. + +Changed each the return type of ``*FreeB`` functions to ``int`` and added +``return(0)`` to each. + +*IDA* + +Corrections were made to three Fortran interface functions. + +Corrected the output from the ``idaFoodWeb_bnd.c`` example, the wrong component +was printed in ``PrintOutput``. + +*IDAS* + +In the interpolation routines for backward problems, added logic to bypass +sensitivity interpolation if input sensitivity argument is ``NULL``. + +Changed each the return type of ``*FreeB`` functions to ``int`` and added +``return(0)`` to each. + +Corrections were made to three Fortran interface functions. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +*KINSOL* + +The Picard iteration return was chanegd to always return the newest iterate upon +success. + +A minor bug in the line search was fixed to prevent an infinite loop when the +beta condition fails and lambda is below the minimum size. + +Corrections were made to three Fortran interface functions. + +The functions ``FKINCREATE`` and ``FKININIT`` were added to split the +``FKINMALLOC`` routine into two pieces. ``FKINMALLOC`` remains for backward +compatibility, but documentation for it has been removed. + +Added missing Fortran interface routines for supplying a sparse Jacobian routine +with sparse direct solvers. + +**Matlab Interfaces Removed** + +Removed the Matlab interface from distribution as it has not been updated since +2009. + +Changes to SUNDIALS in release 2.6.2 +==================================== + +**New Features and Enhancements** + +Various minor fixes to installation-related files + +In KINSOL and ARKODE, updated the Anderson acceleration implementation with QR +updating. + +In CVODES and IDAS, added ``ReInit`` and ``SetOrdering`` wrappers for backward +problems. + +In IDAS, fixed for-loop bugs in ``IDAAckpntAllocVectors`` that could lead to a +memory leak. + +**Bug Fixes** + +Updated the BiCGStab linear solver to remove a redundant dot product call. + +Fixed potential memory leak in KLU ``ReInit`` functions in all solvers. + +In ARKODE, fixed a bug in the Cash-Karp Butcher table where the method and +embedding coefficient were swapped. + +In ARKODE, fixed error in ``arkDoErrorTest`` in recovery after failure. + +In CVODES, added ``CVKLUB`` prototype and corrected ``CVSuperLUMTB`` prototype. + +In the CVODES and IDAS header files, corrected documentation of backward +integration functions, especially the ``which`` argument. + +In IDAS, added missing backward problem support functions ``IDALapackDenseB``, +``IDALapackDenseFreeB``, ``IDALapackBandB``, and ``IDALapackBandFreeB``. + +In IDAS, made SuperLUMT call for backward problem consistent with CVODES. + +In CVODE, IDA, and ARKODE, fixed Fortran interfaces to enable calls to +``GetErrWeights``, ``GetEstLocalErrors``, and ``GetDky`` within a time step. + +Changes to SUNDIALS in release 2.6.1 +==================================== + +Fixed loop limit bug in ``SlsAddMat`` function. + +In all six solver interfaces to KLU and SuperLUMT, added ``#include`` lines, and +removed redundant KLU structure allocations. + +Minor bug fixes in ARKODE. + +Changes to SUNDIALS in release 2.6.0 +==================================== + +**Autotools Build Option Removed** + +With this version of SUNDIALS, support and documentation of the Autotools mode +of installation is being dropped, in favor of the CMake mode, which is +considered more widely portable. + +**New Package: ARKODE** + +Addition of ARKODE package of explicit, implicit, and additive Runge-Kutta +methods for ODEs. This package API is close to CVODE so switching between the +two should be straightforward. Thanks go to Daniel Reynolds for the addition +of this package. + +**New Features and Enhancements** + +Added :ref:`OpenMP <NVectors.OpenMP>` and :ref:`Pthreads <NVectors.Pthreads>` +:c:type:`N_Vector` implementations for thread-parallel computing environments. + +Two major additions were made to the linear system solvers available in all +packages. First, in the serial case, an interface to the sparse direct solver +KLU was added. Second, an interface to SuperLU_MT, the multi-threaded version +of SuperLU, was added as a thread-parallel sparse direct solver option, to be +used with the serial version of the ``N_Vector`` module. As part of these +additions, a sparse matrix (CSC format) structure was added to CVODE. + +*KINSOL* + +Two major additions were made to the globalization strategy options (``KINSol`` +argument ``strategy``). One is fixed-point iteration, and the other is Picard +iteration. Both can be accelerated by use of the Anderson acceleration +method. See the relevant paragraphs in Chapter :ref:`KINSOL.Mathematics`. + +An interface to the Flexible GMRES iterative linear solver was added. + +**Bug Fixes** + +In order to avoid possible name conflicts, the mathematical macro and function +names ``MIN``, ``MAX``, ``SQR``, ``RAbs``, ``RSqrt``, ``RExp``, ``RPowerI``, and +``RPowerR`` were changed to ``SUNMIN``, ``SUNMAX``, ``SUNSQR``, ``SUNRabs``, +``SUNRsqrt``, ``SUNRexp``, ``SRpowerI``, and ``SUNRpowerR``, respectively. These +names occur in both the solver and example programs. + +In the LAPACK banded linear solver interfaces, the line ``smu = MIN(N-1,mu+ml)`` +was changed to ``smu = mu + ml`` to correct an illegal input error for to +``DGBTRF`` and ``DGBTRS``. + +In all Fortran examples, integer declarations were revised so that those which +must match a C type ``long int`` are declared ``INTEGER*8``, and a comment was +added about the type match. All other integer declarations are just +``INTEGER``. Corresponding minor corrections were made to the user guide. + +*CVODE and CVODES* + +In ``cvRootFind``, a minor bug was corrected, where the input array was ignored, +and a line was added to break out of root-search loop if the initial interval +size is below the tolerance ``ttol``. + +Two minor bugs were fixed regarding the testing of input on the first call to +``CVode`` -- one involving ``tstop`` and one involving the initialization of +``*tret``. + +The example program ``cvAdvDiff_diag_p`` was added to illustrate the use of in +parallel. + +In the FCVODE optional input routines ``FCVSETIIN`` and ``FCVSETRIN``, the +optional fourth argument ``key_length`` was removed, with hardcoded key string +lengths passed to all tests. + +In order to eliminate or minimize the differences between the sources for +private functions in CVODE and CVODES, the names of many private functions were +changed from ``CV*`` to ``cv*`` and a few other names were also changed. + +An option was added in the case of Adjoint Sensitivity Analysis with dense or +banded Jacobian. With a call to ``CVDlsSetDenseJacFnBS`` or +``CVDlsSetBandJacFnBS``, the user can specify a user-supplied Jacobian function +of type ``CVDls***JacFnBS``, for the case where the backward problem depends on +the forward sensitivities. + +In ``CVodeQuadSensInit``, the line ``cv_mem->cv_fQS_data = ...`` was corrected +(missing ``Q``). + +In the CVODES User Guide, a paragraph was added in Section 6.2.1 on +``CVodeAdjReInit``, and a paragraph was added in Section 6.2.9 on +``CVodeGetAdjY``. In the example ``cvsRoberts_ASAi_dns``, the output was revised +to include the use of ``CVodeGetAdjY``. + +For the Adjoint Sensitivity Analysis case in which the backward problem depends +on the forward sensitivities, options have been added to allow for user-supplied +``pset``, ``psolve``, and ``jtimes`` functions. + +In the example ``cvsHessian_ASA_FSA``, an error was corrected in the function +``fB2``, ``y2`` in place of ``y3`` in the third term of ``Ith(yBdot,6)``. + +*IDA and IDAS* + +In ``IDARootfind``, a minor bug was corrected, where the input array ``rootdir`` +was ignored, and a line was added to break out of root-search loop if the +initial interval size is below the tolerance ``ttol``. + +A minor bug was fixed regarding the testing of the input ``tstop`` on the first +call to :c:func:`IDASolve`. + +In the FIDA optional input routines ``FIDASETIIN``, ``FIDASETRIN``, and +``FIDASETVIN``, the optional fourth argument ``key_length`` was removed, with +hardcoded key string lengths passed to all ``strncmp`` tests. + +An option was added in the case of Adjoint Sensitivity Analysis with dense or +banded Jacobian. With a call to ``IDADlsSetDenseJacFnBS`` or +``IDADlsSetBandJacFnBS``, the user can specify a user-supplied Jacobian function +of type ``IDADls***JacFnBS``, for the case where the backward problem depends on +the forward sensitivities. + +*KINSOL* + +In function ``KINStop``, two return values were corrected to make the values of +``uu`` and ``fval`` consistent. + +A bug involving initialization of ``mxnewtstep`` was fixed. The error affects +the case of repeated user calls to ``KINSol`` with no intervening call to +``KINSetMaxNewtonStep``. + +A bug in the increments for difference quotient Jacobian approximations was +fixed in function ``kinDlsBandDQJac``. + +In the FKINSOL module, an incorrect return value ``ier`` in ``FKINfunc`` was +fixed. + +In the FKINSOL optional input routines ``FKINSETIIN``, ``FKINSETRIN``, and +``FKINSETVIN``, the optional fourth argument ``key_length`` was removed, with +hardcoded key string lengths passed to all ``strncmp`` tests. + +Changes to SUNDIALS in release 2.5.0 +==================================== + +**Integer Type Change** + +One significant design change was made with this release, the problem size and +its relatives, bandwidth parameters, related internal indices, pivot arrays, and +the optional output ``lsflag`` have all been changed from type ``int`` to type +``long int``, except for the problem size and bandwidths in user calls to +routines specifying BLAS/LAPACK routines for the dense/band linear solvers. The +function ``NewIntArray`` is replaced by a pair ``NewIntArray`` / +``NewLintArray``, for ``int`` and ``long int`` arrays, respectively. + +**Bug Fixes** + +In the installation files, we modified the treatment of the macro +``SUNDIALS_USE_GENERIC_MATH``, so that the parameter ``GENERIC_MATH_LIB`` is +either defined (with no value) or not defined. + +In all packages, after the solver memory is created, it is set to zero before +being filled. + +In each linear solver interface function, the linear solver memory is freed on +an error return, and the function now includes a line setting to ``NULL`` the +main memory pointer to the linear solver memory. + +*Rootfinding* + +In CVODE(S) and IDA(S), in the functions ``Rcheck1`` and ``Rcheck2``, when an +exact zero is found, the array ``glo`` of :math:`g` values at the left endpoint +is adjusted, instead of shifting the :math:`t` location ``tlo`` slightly. + +*CVODE and CVODES* + +In ``CVSetTqBDF``, the logic was changed to avoid a divide by zero. + +In a minor change to the CVODES user interface, the type of the index ``which`` +was changed from ``long int`` to ``int``. + +Errors in the logic for the integration of backward problems in CVODES were +identified and fixed. + +*IDA and IDAS* + +To be consistent with IDAS, IDA uses the function ``IDAGetDky`` for optional +output retrieval. + +A memory leak was fixed in two of the ``IDASp***Free`` functions. + +A missing vector pointer setting was added in ``IDASensLineSrch``. + +In ``IDACompleteStep``, conditionals around lines loading a new column of three +auxiliary divided difference arrays, for a possible order increase, were fixed. + +*KINSOL* + +Three major logic bugs were fixed - involving updating the solution vector, +updating the linesearch parameter, and a missing error return. + +Three minor errors were fixed - involving setting ``etachoice`` in the +Matlab/KINSOL interface, a missing error case in ``KINPrintInfo``, and avoiding +an exponential overflow in the evaluation of ``omega``. + +Changes to SUNDIALS in release 2.4.0 +==================================== + +Added a CMake-based build option in addition to the one based on autotools. + +The user interface has been further refined. Some of the API changes involve: + +(a) a reorganization of all linear solver modules into two families (besides the + existing family of scaled preconditioned iterative linear solvers, the + direct solvers, including new LAPACK-based ones, were also organized into a + *direct* family); + +(b) maintaining a single pointer to user data, optionally specified through a + ``Set``-type function; and + +(c) a general streamlining of the preconditioner modules distributed with the + solvers. + +Added interfaces to LAPACK linear solvers for dense and banded matrices to all +packages. + +An option was added to specify which direction of zero-crossing is to be +monitored while performing rootfinding in CVODE(S) and IDA(S). + +CVODES includes several new features related to sensitivity analysis, among +which are: + +(a) support for integration of quadrature equations depending on both the states + and forward sensitivity (and thus support for forward sensitivity analysis + of quadrature equations), + +(b) support for simultaneous integration of multiple backward problems based on + the same underlying ODE (e.g., for use in an *forward-over-adjoint* method + for computing second order derivative information), + +(c) support for backward integration of ODEs and quadratures depending on both + forward states and sensitivities (e.g., for use in computing second-order + derivative information), and + +(d) support for reinitialization of the adjoint module. + +Moreover, the prototypes of all functions related to integration of backward +problems were modified to support the simultaneous integration of multiple +problems. + +All backward problems defined by the user are internally managed through a +linked list and identified in the user interface through a unique identifier. + +Changes to SUNDIALS in release 2.3.0 +==================================== + +**New Features and Enhancements** + +The main changes in this release involve a rearrangement of the entire +SUNDIALS source tree. At the user interface level, the main impact is in the +mechanism of including SUNDIALS header files which must now include the relative +path e.g., ``#include <cvode/cvode.h>`` as all exported header files are now +installed in separate subdirectories of the installation *include* directory. + +The functions in the generic dense linear solver (``sundials_dense`` and +``sundials_smalldense``) were modified to work for rectangular :math:`m \times +n` matrices (:math:`m \le n`), while the factorization and solution functions +were renamed to ``DenseGETRF`` / ``denGETRF`` and ``DenseGETRS`` / ``denGETRS``, +respectively. The factorization and solution functions in the generic band +linear solver were renamed ``BandGBTRF`` and ``BandGBTRS``, respectively. + +In IDA, the user interface to the consistent initial conditions calculations was +modified. The :c:func:`IDACalcIC` arguments ``t0``, ``yy0``, and ``yp0`` were +removed and a new function, :c:func:`IDAGetConsistentIC` is provided. + +**Bug Fixes** + +In the CVODES adjoint solver module, the following two bugs were fixed: + +* In ``CVodeF`` the solver was sometimes incorrectly taking an additional step + before returning control to the user (in ``CV_NORMAL`` mode) thus leading to + a failure in the interpolated output function. + +* In ``CVodeB``, while searching for the current check point, the solver was + sometimes reaching outside the integration interval resulting in a + segmentation fault. + +In IDA, a bug was fixed in the internal difference-quotient dense and banded +Jacobian approximations, related to the estimation of the perturbation (which +could have led to a failure of the linear solver when zero components with +sufficiently small absolute tolerances were present). + +Changes to SUNDIALS in release 2.2.0 +==================================== + +**New Header Files Names** + +To reduce the possibility of conflicts, the names of all header files have been +changed by adding unique prefixes (e.g., ``cvode_`` and ``sundials_``). When +using the default installation procedure, the header files are exported under +various subdirectories of the target ``include`` directory. For more details see +Appendix :numref:`Installation`. + +**Build System Changes** + +Updated configure script and Makefiles for Fortran examples to avoid C++ +compiler errors (now use ``CC`` and ``MPICC`` to link only if necessary). + +The shared object files are now linked into each SUNDIALS library rater than +into a separate ``libsundials_shared`` library. + +**New Features and Enhancements** + +Deallocation functions now take the address of the respective memory block +pointer as the input argument. + +Interfaces to the Scaled Preconditioned Bi-CGstab (SPBCG) and Scaled +Preconditioned Transpose-Free Quasi-Minimal Residual (SPTFQMR) linear solver +modules have been added to all packages. At the same time, function type names +for Scaled Preconditioned Iterative Linear Solvers were added for the +user-supplied Jacobian-times-vector and preconditioner setup and solve +functions. Additionally, in KINSOL interfaces have been added to the SUNDIALS +DENSE, and BAND linear solvers and include support for nonlinear residual +monitoring which can be used to control Jacobian updating. + +A new interpolation method was added to the CVODES adjoint module. The function +``CVadjMalloc`` has an additional argument which can be used to select the +desired interpolation scheme. + +FIDA, a Fortran-C interface module, was added. + +The rootfinding feature was added to IDA, whereby the roots of a set of given +functions may be computed during the integration of the DAE system. + +In IDA a user-callable routine was added to access the estimated local error +vector. + +In the KINSOL Fortran interface module, FKINSOL, optional inputs are now set +using ``FKINSETIIN`` (integer inputs), ``FKINSETRIN`` (real inputs), and +``FKINSETVIN`` (vector inputs). Optional outputs are still obtained from the +``IOUT`` and ``ROUT`` arrays which are owned by the user and passed as arguments +to ``FKINMALLOC``. + +Changes to SUNDIALS in release 2.1.1 +==================================== + +The function ``N_VCloneEmpty`` was added to the global vector operations table. + +A minor bug was fixed in the interpolation functions of the adjoint CVODES +module. + +Changes to SUNDIALS in release 2.1.0 +==================================== + +The user interface has been further refined. Several functions used for setting +optional inputs were combined into a single one. + +In CVODE(S) and IDA, an optional user-supplied routine for setting the error +weight vector was added. + +Additionally, to resolve potential variable scope issues, all SUNDIALS solvers +release user data right after its use. + +The build systems has been further improved to make it more robust. + +Changes to SUNDIALS in release 2.0.2 +==================================== + +Fixed autoconf-related bug to allow configuration with the PGI Fortran compiler. + +Modified the build system to use customized detection of the Fortran name +mangling scheme (autoconf's ``AC_F77_WRAPPERS`` routine is problematic on some +platforms). + +A bug was fixed in the ``CVode`` function that was potentially leading to +erroneous behavior of the rootfinding procedure on the integration first step. + +A new chapter in the User Guide was added - with constants that appear in the +user interface. + +Changes to SUNDIALS in release 2.0.1 +==================================== + +**Build System** + +Changed the order of compiler directives in header files to avoid compilation +errors when using a C++ compiler. + +Changed the method of generating ``sundials_config.h`` to avoid potential +warnings of redefinition of preprocessor symbols. + +**New Features** + +In CVODES the option of activating and deactivating forward sensitivity +calculations on successive runs without memory allocation and deallocation. + +**Bug Fixes** + +In CVODES bug fixes related to forward sensitivity computations (possible loss +of accuracy on a BDF order increase and incorrect logic in testing user-supplied +absolute tolerances) were made. + +Changes to SUNDIALS in release 2.0.0 +==================================== + +Installation of all of SUNDIALS packages has been completely redesigned and is +now based on configure scripts. + +The major changes from the previous version involve a redesign of the user +interface across the entire SUNDIALS suite. We have eliminated the mechanism of +providing optional inputs and extracting optional statistics from the solver +through the ``iopt`` and ``ropt`` arrays. Instead, packages now provide ``Set`` +functions to change the default values for various quantities controlling the +solver and ``Get`` functions to extract statistics after return from the main +solver routine. + +Additionally, the interfaces to several user-supplied routines (such as those +providing Jacobians and preconditioner information) were simplified by reducing +the number of arguments. The same information that was previously accessible +through such arguments can now be obtained through ``Get``-type functions. + +In CVODE and CVODES a rootfinding feature was added, whereby the roots of a set +of given functions may be computed during the integration of the ODE system. + +Changes to the NVector: + +* Removed ``machEnv``, redefined table of vector operations (now contained in + the :c:type:`N_Vector` structure itself). + +* All SUNDIALS functions create new :c:type:`N_Vector` variables through + cloning, using an :c:type:`N_Vector` passed by the user as a template. + +* A particular vector implementation is supposed to provide user-callable + constructor and destructor functions. + +* Removed the following functions from the structure of vector operations: + ``N_VNew``, ``N_VNew_S``, ``N_VFree``, ``N_VFree_S``, ``N_VMake``, + ``N_VDispose``, ``N_VGetData``, ``N_VSetData``, ``N_VConstrProdPos``, and + ``N_VOneMask``. + +* Added the following functions to the structure of vector operations: + ``N_VClone``, ``N_VDestroy``, ``N_VSpace``, ``N_VGetArrayPointer``, + ``N_VSetArrayPointer``, and ``N_VWrmsNormMask``. + +* Note that ``nvec_ser`` and ``nvec_par`` are now separate modules outside the + shared SUNDIALS module. + +Changes to the linear solvers: + +* In SPGMR, added a dummy ``N_Vector`` argument to be used as a template for + cloning. + +* In SPGMR, removed ``N`` (problem dimension) from the argument list of + ``SpgmrMalloc``. + +* Replaced ``iterativ.{c,h}`` with ``iterative.{c,h}``. + +* Modified constant names in ``iterative.h`` (preconditioner types are prefixed + with ``PREC_``). + +* Changed numerical values for ``MODIFIED_GS`` (from ``0`` to ``1``) and + ``CLASSICAL_GS`` (from ``1`` to ``2``). + +Changes to ``sundialsmath`` submodule: + +* Replaced the internal routine for estimating unit roundoff with definition of + unit roundoff from ``float.h``. + +* Modified functions to call the appropriate math routines given the precision + level specified by the user. + +Changes to ``sundialstypes`` submodule: + +* Removed ``integertype``. + +* Added definitions for ``BIG_REAL``, ``SMALL_REAL``, and ``UNIT_ROUNDOFF`` + using values from ``float.h`` based on the precision. + +* Changed definition of macro ``RCONST`` to depend on the precision level + specified by the user. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst new file mode 100644 index 0000000000..da28369ce1 --- /dev/null +++ b/doc/shared/RecentChanges.rst @@ -0,0 +1,10 @@ +**New Features** + +**Bug Fixes** + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. diff --git a/doc/shared/versions.py b/doc/shared/versions.py index 9870094c67..1845394297 100644 --- a/doc/shared/versions.py +++ b/doc/shared/versions.py @@ -9,6 +9,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- +doc_version = 'develop' sundials_version = 'v7.0.0' arkode_version = 'v6.0.0' cvode_version = 'v7.0.0' diff --git a/doc/superbuild/Makefile b/doc/superbuild/Makefile index 6f5edc188b..c609249981 100644 --- a/doc/superbuild/Makefile +++ b/doc/superbuild/Makefile @@ -16,4 +16,4 @@ all: html: all clean: Makefile - @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" \ No newline at end of file + @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" diff --git a/doc/superbuild/source/Changelog_link.rst b/doc/superbuild/source/Changelog_link.rst new file mode 100644 index 0000000000..1065050dc2 --- /dev/null +++ b/doc/superbuild/source/Changelog_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/Changelog.rst diff --git a/doc/superbuild/source/RecentChanges_link.rst b/doc/superbuild/source/RecentChanges_link.rst new file mode 100644 index 0000000000..855e44fd60 --- /dev/null +++ b/doc/superbuild/source/RecentChanges_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/RecentChanges.rst diff --git a/doc/superbuild/source/developers/testing/Answers.rst b/doc/superbuild/source/developers/testing/Answers.rst index e04b9278c2..ecefcfbd4d 100644 --- a/doc/superbuild/source/developers/testing/Answers.rst +++ b/doc/superbuild/source/developers/testing/Answers.rst @@ -33,7 +33,7 @@ possible that the output generated on one machine may differ from the output gen As such, we specify that the the answer files that are embedded in ``examples/`` (the ``.out`` files) should match what is produced on the Jenkins CI machine. We also have a `separate git repostiory <https://github.com/sundials-codes/answers>`_ which holds answers for other machines, -such as the GitHub Actions virtual machines. +such as the GitHub Actions virtual machines. Updating and Adding Answer Files for Existing Machines @@ -52,28 +52,28 @@ is expected/desired. Changing output files requires careful verification that th #. Navigate to `test/answers` in the sundials repository. If there is nothing in this directory, you need to run `git submodule init && git submodule update`. Alternatively clone the answers - repository outside of the SUNDIALS source tree. + repository outside of the SUNDIALS source tree. - #. Checkout the main branch: ``git checkout main``. + #. Checkout the main branch: ``git checkout main``. #. Create a new branch off of main. It is ideal if you use a branch name that matches the name of the branch that you are developing in sundials on: ``git checkout -b <branch name>``. #. Update the relevant ``.out`` files in ``test/answers/linux-ubuntu20.04-x86_64/gcc-9.4.0/<double|single|extended>`` (this is the files - used for the GitHub Actions CI). Like with the embedded `.out` files, you can try and use the + used for the GitHub Actions CI). Like with the embedded ``.out`` files, you can try and use the output generated on your machine, but it may be different enough from what is produced on the GitHub actions to trigger a failure. You can download the output files generated on the GitHub machines by going to `<https://github.com/LLNL/sundials/actions>`_ finding your failing test, clicking it, then at the bottom downloading the "output_files" artifact (you can also find your failing test at the bottom of a PR). The downloaded zip file will be the SUNDIALS build directory. To update just the failed files you can use ``scripts/updateOutFiles.py`` e.g., - + .. code:: console - cd scripts - ./updateOutFiles.py <source path> <destination path> - + cd scripts + ./updateOutFiles.py <source path> <destination path> + When updating files in the answers repo the source path is the path to the build directory downloaded from GitHub and the destination path is ``<path to answers repo>/linux-ubuntu20.04-x86_64/gcc-9.4.0/<double|single|extended>``. When updating with output @@ -82,15 +82,15 @@ is expected/desired. Changing output files requires careful verification that th will automatically traverse the examples and test/unit_test directories to update output files for failed tests. - #. If you need to use ssh authentication for pushing to GitHub, then you may need to update the + #. If you need to use ssh authentication for pushing to GitHub, then you may need to update the remote for the submodule: .. code:: console - git remote set-url origin git@github.com:sundials-codes/answers.git + git remote set-url origin git@github.com:sundials-codes/answers.git #. Create a pull-request in `sundials-codes/answers <https://github.com/sundials-codes/answers>`_ - with your updates. + with your updates. Adding Answer Files for a New Machine diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 750b54e925..4985f44530 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -42,6 +42,7 @@ SUNDIALS is developed on `GitHub <https://github.com/LLNL/sundials>`_. sunadaptcontroller/index.rst sunmemory/index.rst History_link.rst + Changelog_link.rst developers/index.rst References diff --git a/scripts/startReleaseCycle.sh b/scripts/startReleaseCycle.sh new file mode 100755 index 0000000000..042e4a251f --- /dev/null +++ b/scripts/startReleaseCycle.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# ------------------------------------------------------------------------------ +# Programmer(s): David J. Gardner @ LLNL +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ +# Update files to start new release cycle +# ------------------------------------------------------------------------------ + +set -e +set -o pipefail + +# Wrapper for editing inplace with different sed implementations +sedi() { + case $(uname) in + Darwin*) sedi=('-i' '') ;; + *) sedi='-i' ;; + esac + sed "${sedi[@]}" "$@" +} + +# ------------------------------------------------------------------------------ +# Update versions +# ------------------------------------------------------------------------------ + +fn="../doc/shared/versions.py" +sedi "s/doc_version =.*/doc_version = \'develop\'/" $fn + +# ------------------------------------------------------------------------------ +# Update Markdown changelog +# ------------------------------------------------------------------------------ + +fn="../CHANGELOG.md" + +# Add new entry to changelog +cat > tmp.txt <<HEREDOC +# SUNDIALS Changelog + +## Changes to SUNDIALS in release X.Y.Z + +### New Features + +### Bug Fixes +HEREDOC + +sedi -e '/SUNDIALS Changelog/ {' \ + -e 'r tmp.txt' \ + -e 'd' \ + -e '}' \ + $fn + +rm -f tmp.txt + +# ------------------------------------------------------------------------------ +# Update RST changelog +# ------------------------------------------------------------------------------ + +fn="../doc/shared/Changelog.rst" + +# Move recent changes to changelog +sedi -e '/RecentChanges_link.rst/ {' \ + -e 'r ../doc/shared/RecentChanges.rst' \ + -e 'd' \ + -e '}' \ + $fn + +# Clear recent changes file +cat > ../doc/shared/RecentChanges.rst <<HEREDOC +**New Features** + +**Bug Fixes** +HEREDOC + +# Add new entry to changelog +cat > tmp.txt <<HEREDOC +.. SED_REPLACEMENT_KEY + +Changes to SUNDIALS in release X.Y.Z +==================================== + +.. include:: RecentChanges_link.rst +HEREDOC + +sedi -e '/SED_REPLACEMENT_KEY/ {' \ + -e 'r tmp.txt' \ + -e 'd' \ + -e '}' \ + $fn + +rm -f tmp.txt diff --git a/scripts/tarscript b/scripts/tarscript index 2e80dd084f..ef9aa85f1e 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -274,6 +274,15 @@ for f in $(git ls-files --others --directory benchmarks cmake doc examples inclu done cd - +# Make superbuild for cross-package references +if [ $doc = "T" ]; then + echo -e "--- SUNDIALS Superbuild documentation" + cd $sundialsdir/doc/superbuild + make clean + make html + cd - +fi + # Make install guide and copy to $tmpdir if [ $doc = "T" ]; then echo -e "--- SUNDIALS Common Installation documentation" diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index ef73961ecc..6089b1b723 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -335,6 +335,7 @@ sedi "s/ida_version =.*/ida_version = \'v${ida_ver}\'/" $fn sedi "s/idas_version =.*/idas_version = \'v${idas_ver}\'/" $fn sedi "s/kinsol_version =.*/kinsol_version = \'v${kin_ver}\'/" $fn sedi "s/sundials_version =.*/sundials_version = \'v${sun_ver}\'/" $fn +sedi "s/doc_version =.*/doc_version = \'v${sun_ver}\'/" $fn sedi "s/year =.*/year = \'${year}\'/" $fn # release history table @@ -365,41 +366,44 @@ sedi '108s/.*/\ \ note = {v'${idas_ver}'}/' $fn sedi '116s/.*/\ \ year = {'${year}'},/' $fn sedi '117s/.*/\ \ note = {v'${kin_ver}'}/' $fn -# Update all occurrences of x.x.x and X.X.X to the current version number +# Update all occurrences of x.y.z and X.Y.Z to the current version number fn="../CHANGELOG.md" -sedi "s/x.x.x/${sun_ver}/gI" $fn +sedi "s/x.y.z/${sun_ver}/gI" $fn -for fn in $(grep -Iirl "x.x.x" ../doc/shared/*) +fn="../doc/shared/Changelog.rst" +sedi "s/x.y.z/${sun_ver}/gI" $fn + +for fn in $(grep -Iirl "x.y.z" ../doc/shared/*) do - sedi "s/x.x.x/${sun_ver}/gI" $fn + sedi "s/x.y.z/${sun_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/arkode/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/arkode/guide/source/*) do - sedi "s/x.x.x/${ark_ver}/gI" $fn + sedi "s/x.y.z/${ark_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/cvode/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/cvode/guide/source/*) do - sedi "s/x.x.x/${cv_ver}/gI" $fn + sedi "s/x.y.z/${cv_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/cvodes/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/cvodes/guide/source/*) do - sedi "s/x.x.x/${cvs_ver}/gI" $fn + sedi "s/x.y.z/${cvs_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/ida/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/ida/guide/source/*) do - sedi "s/x.x.x/${ida_ver}/gI" $fn + sedi "s/x.y.z/${ida_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/idas/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/idas/guide/source/*) do - sedi "s/x.x.x/${idas_ver}/gI" $fn + sedi "s/x.y.z/${idas_ver}/gI" $fn done -for fn in $(grep -Iirl "x.x.x" ../doc/kinsol/guide/source/*) +for fn in $(grep -Iirl "x.y.z" ../doc/kinsol/guide/source/*) do - sedi "s/x.x.x/${kin_ver}/gI" $fn + sedi "s/x.y.z/${kin_ver}/gI" $fn done From a288c0e81532545e6e2321269b4b0d4e6d168a31 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 22 Mar 2024 20:14:02 -0700 Subject: [PATCH 018/137] Bugfix: Inclusion of manyvector examples (#446) Fixes inclusion of manyvector examples when cmake option is disabled Co-authored-by: David Gardner <gardner48@llnl.gov> --- examples/arkode/CMakeLists.txt | 4 +++- examples/cvode/CMakeLists.txt | 4 +++- examples/nvector/CMakeLists.txt | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/arkode/CMakeLists.txt b/examples/arkode/CMakeLists.txt index e7e064d327..defe97ed7c 100644 --- a/examples/arkode/CMakeLists.txt +++ b/examples/arkode/CMakeLists.txt @@ -17,7 +17,9 @@ # C examples if(EXAMPLES_ENABLE_C) add_subdirectory(C_serial) - add_subdirectory(C_manyvector) + if(BUILD_NVECTOR_MANYVECTOR) + add_subdirectory(C_manyvector) + endif() if(ENABLE_OPENMP AND OPENMP_FOUND) add_subdirectory(C_openmp) endif() diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index 30eb91a532..f5bdfb8d78 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -26,7 +26,9 @@ if(EXAMPLES_ENABLE_C) endif() if(ENABLE_MPI AND MPI_C_FOUND) add_subdirectory(parallel) - add_subdirectory(C_mpimanyvector) + if(BUILD_NVECTOR_MPIMANYVECTOR) + add_subdirectory(C_mpimanyvector) + endif() endif() if(ENABLE_HYPRE AND HYPRE_FOUND) add_subdirectory(parhyp) diff --git a/examples/nvector/CMakeLists.txt b/examples/nvector/CMakeLists.txt index 4c954a351e..54aa22f08d 100644 --- a/examples/nvector/CMakeLists.txt +++ b/examples/nvector/CMakeLists.txt @@ -34,7 +34,9 @@ target_link_libraries(test_nvector_obj PRIVATE sundials_nvecserial) if(ENABLE_MPI AND MPI_C_FOUND) add_subdirectory(parallel) - add_subdirectory(mpimanyvector) + if(BUILD_NVECTOR_MPIMANYVECTOR) + add_subdirectory(mpimanyvector) + endif() add_subdirectory(mpiplusx) # Build the mpi nvector test utilities add_library(test_nvectormpi_obj OBJECT test_mpinvector.c) @@ -43,7 +45,9 @@ if(ENABLE_MPI AND MPI_C_FOUND) endif() target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C sundials_nvecparallel) endif() -add_subdirectory(manyvector) +if(BUILD_NVECTOR_MANYVECTOR) + add_subdirectory(manyvector) +endif() if(BUILD_NVECTOR_PARHYP) add_subdirectory(parhyp) From 7bf737f7db2cc5ef15414d4c6c837216c6f37194 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Mon, 25 Mar 2024 11:55:31 -0700 Subject: [PATCH 019/137] Bugfix: CMake config file version compatibility (#445) Changed the CMake version compatibility mode for SUNDIALS to `AnyNewerVersion` instead of `SameMajorVersion`. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 4 ++++ CMakeLists.txt | 2 +- doc/shared/RecentChanges.rst | 4 ++++ doc/shared/sundials/Install.rst | 20 +++++++++++++++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d1f5716a3..f8c355ad73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ is also valid in older version of ROCm (at least back to version 4.3.1). Fixed a bug in the HIP execution policies where `WARP_SIZE` would not be set with ROCm 6.0.0 or newer. +Changed the CMake version compatibility mode for SUNDIALS to `AnyNewerVersion` +instead of `SameMajorVersion`. This fixes the issue seen +[here](https://github.com/AMReX-Codes/amrex/pull/3835). + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/CMakeLists.txt b/CMakeLists.txt index dc07466ff4..edffa9b2a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,7 @@ include(CMakePackageConfigHelpers) write_basic_package_version_file( SUNDIALSConfigVersion.cmake VERSION ${PACKAGE_VERSION} - COMPATIBILITY SameMajorVersion + COMPATIBILITY AnyNewerVersion ) # install targets diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index da28369ce1..b57a0aed10 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -8,3 +8,7 @@ default is also valid in older version of ROCm (at least back to version 4.3.1). Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set with ROCm 6.0.0 or newer. + +Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` +instead of ``SameMajorVersion``. This fixes the issue seen +`here <https://github.com/AMReX-Codes/amrex/pull/3835>`_. diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index aad89e575d..b51343eae4 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -1729,7 +1729,7 @@ Using SUNDIALS as a Third Party Library in other CMake Projects --------------------------------------------------------------- The ``make install`` command will also install a `CMake package configuration file -<https://cmake.org/cmake/help/v3.12/manual/cmake-packages.7.html\#package-configuration-file>`_ +<https://cmake.org/cmake/help/v3.18/manual/cmake-packages.7.html>`_ that other CMake projects can load to get all the information needed to build against SUNDIALS. In the consuming project's CMake code, the ``find_package`` command may be used to search for the configuration file, which will be @@ -1751,8 +1751,15 @@ configuration file to build against SUNDIALS in their own CMake project. # When using the cmake CLI command, this can be done like so: # cmake -D SUNDIALS_DIR=/path/to/sundials/installation + # Find any SUNDIALS version... find_package(SUNDIALS REQUIRED) + # ... or find any version newer than some minimum... + find_package(SUNDIALS 7.1.0 REQUIRED) + + # ... or find a version in a range + find_package(SUNDIALS 7.0.0...7.1.0 REQUIRED) + add_executable(myexec main.c) # Link to SUNDIALS libraries through the exported targets. @@ -1761,6 +1768,17 @@ configuration file to build against SUNDIALS in their own CMake project. target_link_libraries(myexec PUBLIC SUNDIALS::cvode SUNDIALS::nvecpetsc) +.. note:: + + .. versionchanged:: x.y.z + + A single version provided to ``find_package`` denotes the minimum version + of SUNDIALS to look for, and any version equal or newer than what is + specified will match. In prior versions ``SUNDIALSConfig.cmake`` required + the version found to have the same major version number as the single + version provided to ``find_package``. + + Table of SUNDIALS libraries and header files -------------------------------------------- From c90678af2d87fe4987a8b4c850a7b788933ece13 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 27 Mar 2024 13:32:10 -0700 Subject: [PATCH 020/137] Bugfix: Fix c_null_ptr bug in some Fortran examples (#449) Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argument to a function pointer instead of `c_null_funptr`. --- CHANGELOG.md | 8 ++++++-- doc/shared/RecentChanges.rst | 8 ++++++-- examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 | 2 +- .../arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 | 2 +- examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 2 +- examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 | 2 +- examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 | 2 +- examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 2 +- examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 | 2 +- 9 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8c355ad73..62512bb8b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,12 @@ Fixed a bug in the HIP execution policies where `WARP_SIZE` would not be set with ROCm 6.0.0 or newer. Changed the CMake version compatibility mode for SUNDIALS to `AnyNewerVersion` -instead of `SameMajorVersion`. This fixes the issue seen -[here](https://github.com/AMReX-Codes/amrex/pull/3835). +instead of `SameMajorVersion`. This fixes the issue seen +[here](https://github.com/AMReX-Codes/amrex/pull/3835). + +Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argument +to a function pointer instead of `c_null_funptr`. This caused compilation issues +with the Cray Fortran compiler. ## Changes to SUNDIALS in release v7.0.0 diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index b57a0aed10..7dc83fc3a4 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -10,5 +10,9 @@ Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set with ROCm 6.0.0 or newer. Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` -instead of ``SameMajorVersion``. This fixes the issue seen -`here <https://github.com/AMReX-Codes/amrex/pull/3835>`_. +instead of ``SameMajorVersion``. This fixes the issue seen +`here <https://github.com/AMReX-Codes/amrex/pull/3835>`_. + +Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an argument +to a function pointer instead of ``c_null_funptr``. This caused compilation issues +with the Cray Fortran compiler. diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index 18fb0f4600..50c54e0211 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -751,7 +751,7 @@ program driver y = 0.d0 ! Create the ARKStep timestepper module - arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(frhs), t0, sunvec_y, sunctx) + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(frhs), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then print *, "Error: FARKStepCreate returned NULL" call MPI_Abort(comm, 1, ierr) diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 index 8adb2d54bc..6389a9e7de 100644 --- a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -1143,7 +1143,7 @@ program main end do ! create ARKStep memory - arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(ImpRhsFn), tstart, sunvec_y, ctx) + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(ImpRhsFn), tstart, sunvec_y, ctx) if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a sparse linear solver for both Newton and mass matrix systems. diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index 2f8fdd3aa8..372cbf1642 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -283,7 +283,7 @@ program main end do ! create ARKStep memory - arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(ImpRhsFn), tstart, sunvec_u, ctx) + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(ImpRhsFn), tstart, sunvec_u, ctx) if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a SPGMR linear solver. diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 index e9f0d6cc4d..a57dd5f9c6 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -272,7 +272,7 @@ program main call PrintHeader(rtol, avtol, yval) ! Call FARKStepCreate to initialize ARKODE memory - arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Call FARKStepSVtolerances to set tolerances diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index 2cad00ef0d..30b41329ee 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -275,7 +275,7 @@ program main call PrintHeader(rtol, avtol, yval) ! Call FARKStepCreate to initialize ARKODE memory - arkode_mem = FARKStepCreate(c_null_ptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) + arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Call FARKStepSVtolerances to set tolerances diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 index 6bec77fed7..1710a0d061 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -304,7 +304,7 @@ program driver mudq = 0 mldq = 0 retval = FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & - c_funloc(LocalgFn), c_null_ptr) + c_funloc(LocalgFn), c_null_funptr) if (retval /= 0) then print *, "Error: FCVBBDPrecInit returned ", retval call MPI_Abort(comm, 1, ierr) diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 index 1d657e245f..9061936dfa 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -319,7 +319,7 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FCVodeSetPreconditioner(cvode_mem, c_null_ptr, c_funloc(Psolve)) + retval = FCVodeSetPreconditioner(cvode_mem, c_null_funptr, c_funloc(Psolve)) if (retval /= 0) then print *, "Error: FCVodeSetPreconditioner returned ", retval call MPI_Abort(comm, 1, ierr) From 52041244dd47948cf4afb4b733b150b08bad373b Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 27 Mar 2024 22:18:31 -0700 Subject: [PATCH 021/137] Docs: Installation procedure for Frontier (#448) Add a section to the install guide on how to build sundials on Frontier. --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: David Gardner <gardner48@llnl.gov> --- doc/shared/sundials/Install.rst | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index b51343eae4..d6d4435f45 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -2112,3 +2112,68 @@ Table of SUNDIALS libraries and header files | | +----------------------------------------------+ | | | ``kinsol/kinsol_ls.h`` | +------------------------------+--------------+----------------------------------------------+ + + +Installing SUNDIALS on HPC Clusters +----------------------------------- + +.. _Installation.HPC: + +This section is a guide for installing SUNDIALS on specific HPC clusters. +In general, the procedure is the same as described previously for Linux machines. +The main differences are in the modules and environment variables that are specific +to different HPC clusters. We aim to keep this section as up to date as possible, +but it may lag the latest software updates to each cluster. + +Frontier +^^^^^^^^ + +`Frontier <https://www.olcf.ornl.gov/frontier/>`_ is an Exascale supercomputer at the Oak Ridge +Leadership Computing Facility. If you are new to this system, then we recommend that you review the +`Frontier user guide <https://docs.olcf.ornl.gov/systems/frontier_user_guide.html>`_. + +**A Standard Installation** + +Clone SUNDIALS: + +.. code-block:: bash + + git clone https://github.com/LLNL/sundials.git && cd sundials + +Next we load the modules and set the environment variables needed to build SUNDIALS. +This configuration enables both MPI and HIP support for distributed and GPU parallelism. +It uses the HIP compiler for C and C++ and the Cray Fortran compiler. Other configurations +are possible. + +.. code-block:: bash + + # required dependencies + module load PrgEnv-cray-amd/8.5.0 + module load craype-accel-amd-gfx90a + module load rocm/5.3.0 + module load cmake/3.23.2 + + # GPU-aware MPI + export MPICH_GPU_SUPPORT_ENABLED=1 + + # compiler environment hints + export CC=$(which hipcc) + export CXX=$(which hipcc) + export FC=$(which ftn) + export CFLAGS="-I${ROCM_PATH}/include" + export CXXFLAGS="-I${ROCM_PATH}/include -Wno-pass-failed" + export LDFLAGS="-L${ROCM_PATH}/lib -lamdhip64 ${PE_MPICH_GTL_DIR_amd_gfx90a} -lmpi_gtl_hsa" + +Now we can build SUNDIALS. In general, this is the same procedure described in the previous sections. +The following command builds and installs SUNDIALS with MPI, HIP, and the Fortran interface enabled, where `<install path>` is your desired installation location, and `<account>` is your allocation account on Frontier: + +.. code-block:: bash + + cmake -S . -B builddir -DCMAKE_INSTALL_PREFIX=<install path> -DAMDGPU_TARGETS=gfx90a \ + -DENABLE_HIP=ON -DENABLE_MPI=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON + cd builddir + make -j8 install + # Need an allocation to run the tests: + salloc -A <account> -t 10 -N 1 -p batch + make test + make test_install_all \ No newline at end of file From 4c06c76f4ecd55d3152c65f1f660f86be5a3f947 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 28 Mar 2024 06:56:55 -0700 Subject: [PATCH 022/137] Docs: Updating landing page, remove file tree figure (#450) * Move high level description of SUNDIALS to docs landing page * Remove file tree figure from docs (addresses #443) * Remove organization section in shared docs --- doc/arkode/guide/source/Introduction.rst | 4 +- doc/arkode/guide/source/Organization.rst | 10 ---- doc/arkode/guide/source/sundials/index.rst | 14 +++-- doc/cvode/guide/source/Introduction.rst | 5 +- doc/cvode/guide/source/Organization.rst | 10 ---- doc/cvode/guide/source/sundials/index.rst | 14 +++-- doc/cvodes/guide/source/Introduction.rst | 7 ++- doc/cvodes/guide/source/Organization.rst | 10 ---- doc/cvodes/guide/source/sundials/index.rst | 14 +++-- doc/ida/guide/source/Introduction.rst | 5 +- doc/ida/guide/source/Organization.rst | 10 ---- doc/ida/guide/source/sundials/index.rst | 14 +++-- doc/idas/guide/source/Introduction.rst | 5 +- doc/idas/guide/source/Organization.rst | 10 ---- doc/idas/guide/source/sundials/index.rst | 13 +++-- doc/kinsol/guide/source/Introduction.rst | 5 +- doc/kinsol/guide/source/Organization.rst | 10 ---- doc/kinsol/guide/source/sundials/index.rst | 14 +++-- doc/shared/SundialsOrganization.rst | 58 --------------------- doc/superbuild/source/Organization_link.rst | 19 ------- doc/superbuild/source/arkode/index.rst | 2 + doc/superbuild/source/cvode/index.rst | 2 + doc/superbuild/source/cvodes/index.rst | 2 + doc/superbuild/source/ida/index.rst | 2 + doc/superbuild/source/idas/index.rst | 2 + doc/superbuild/source/index.rst | 58 ++++++++++++++------- doc/superbuild/source/kinsol/index.rst | 2 + doc/superbuild/source/sundials/index.rst | 16 ++++-- 28 files changed, 129 insertions(+), 208 deletions(-) delete mode 100644 doc/shared/SundialsOrganization.rst delete mode 100644 doc/superbuild/source/Organization_link.rst diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 77da7231de..6461cbf0d6 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -149,8 +149,8 @@ The structure of this document is as follows: underlying :ref:`mathematical algorithms <ARKODE.Mathematics>` used within the ARKODE family of solvers. -* We follow this with an overview of how the source code for both - SUNDIALS and ARKODE are :ref:`organized <ARKODE.Organization>`. +* We follow this with an overview of how the source code for + ARKODE is :ref:`organized <ARKODE.Organization>`. * The largest section follows, providing a full account of how to use ARKODE's time-stepping modules, :ref:`ARKStep <ARKODE.Usage.ARKStep>`, diff --git a/doc/arkode/guide/source/Organization.rst b/doc/arkode/guide/source/Organization.rst index 79f05c4a4e..8ab599ff2d 100644 --- a/doc/arkode/guide/source/Organization.rst +++ b/doc/arkode/guide/source/Organization.rst @@ -18,16 +18,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _ARKODE.Organization.ARKODE: - -ARKODE organization -=================== - The ARKODE package is written in the ANSI C language. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/arkode/guide/source/sundials/index.rst b/doc/arkode/guide/source/sundials/index.rst index d7c16389b6..98fee06255 100644 --- a/doc/arkode/guide/source/sundials/index.rst +++ b/doc/arkode/guide/source/sundials/index.rst @@ -16,11 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`ARKODE.Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 957a43e04e..c0025d1f07 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -154,9 +154,8 @@ The structure of this document is as follows: detection (:numref:`CVODE.Mathematics.stablimit`), and rootfinding (:numref:`CVODE.Mathematics.rootfinding`). -- The following chapter describes the structure of the SUNDIALS - suite of solvers (:numref:`CVODE.Organization`) and the software - organization of the CVODE solver (:numref:`CVODE.Organization.CVODE`). +- The following chapter describes the software organization of the CVODE + solver (:numref:`CVODE.Organization`). - :numref:`CVODE.Usage.CC` is the main usage document for CVODE for C applications. It includes a complete diff --git a/doc/cvode/guide/source/Organization.rst b/doc/cvode/guide/source/Organization.rst index 728cd7c68f..8b08601005 100644 --- a/doc/cvode/guide/source/Organization.rst +++ b/doc/cvode/guide/source/Organization.rst @@ -16,16 +16,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _CVODE.Organization.CVODE: - -CVODE organization -================== - The CVODE package is written in ANSI C. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/cvode/guide/source/sundials/index.rst b/doc/cvode/guide/source/sundials/index.rst index a17f99cc80..98fee06255 100644 --- a/doc/cvode/guide/source/sundials/index.rst +++ b/doc/cvode/guide/source/sundials/index.rst @@ -16,11 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`CVODE.Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index a8ce879e7d..55ea22f2cd 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -167,9 +167,8 @@ The structure of this document is as follows: (:numref:`CVODES.Mathematics.FSA`) and adjoint (:numref:`CVODES.Mathematics.ASA`). -- The following chapter describes the structure of the SUNDIALS suite of solvers - (:numref:`CVODES.Organization`) and the software organization of the CVODES solver - (:numref:`CVODES.Organization.CVODES`). +- The following chapter describes the software organization of the CVODES + solver (:numref:`CVODES.Organization`). - Chapter :numref:`CVODES.Usage.SIM` is the main usage document for CVODES for simulation applications. It includes a complete description of the user interface for the integration @@ -195,7 +194,7 @@ The structure of this document is as follows: - Chapter :numref:`NVectors` gives a brief overview of the generic ``N_Vector`` module shared among the various components of SUNDIALS, and details on the ``N_Vector`` implementations provided with SUNDIALS. -- Chapter :numref:`SUNMatrix` gives a brief overview of the generic +- Chapter :numref:`SUNMatrix` gives a brief overview of the generic ``SUNMatrix`` module shared among the various components of SUNDIALS, and details on the ``SUNMatrix`` implementations provided with SUNDIALS: a dense implementation (:numref:`SUNMatrix.Dense`), a banded implementation diff --git a/doc/cvodes/guide/source/Organization.rst b/doc/cvodes/guide/source/Organization.rst index 2f40641a5a..c57ba3077f 100644 --- a/doc/cvodes/guide/source/Organization.rst +++ b/doc/cvodes/guide/source/Organization.rst @@ -16,16 +16,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _CVODES.Organization.CVODES: - -CVODES organization -=================== - The CVODES package is written in ANSI C. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/cvodes/guide/source/sundials/index.rst b/doc/cvodes/guide/source/sundials/index.rst index 6c6a8aa481..98fee06255 100644 --- a/doc/cvodes/guide/source/sundials/index.rst +++ b/doc/cvodes/guide/source/sundials/index.rst @@ -16,11 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`CVODES.Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 2c4a52402f..19dfc9a9d3 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -90,9 +90,8 @@ The structure of this document is as follows: (:numref:`IDA.Mathematics.Preconditioning`) and rootfinding (:numref:`IDA.Mathematics.rootfinding`). -* The following chapter describes the structure of the SUNDIALS suite of solvers - (:numref:`IDA.Organization`) and the software organization of the IDA solver - (:numref:`IDA.Organization.IDA`). +* The following chapter describes the software organization of the IDA + solver (:numref:`IDA.Organization`). * Chapter :numref:`IDA.Usage.CC` is the main usage document for IDA for C and C++ applications. It includes a complete description of the user interface for the diff --git a/doc/ida/guide/source/Organization.rst b/doc/ida/guide/source/Organization.rst index 6cdc5ea7a5..9243f13584 100644 --- a/doc/ida/guide/source/Organization.rst +++ b/doc/ida/guide/source/Organization.rst @@ -16,16 +16,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _IDA.Organization.IDA: - -IDA organization -================ - The IDA package is written in ANSI C. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/ida/guide/source/sundials/index.rst b/doc/ida/guide/source/sundials/index.rst index c108f28a68..98fee06255 100644 --- a/doc/ida/guide/source/sundials/index.rst +++ b/doc/ida/guide/source/sundials/index.rst @@ -16,11 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`IDA.Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 8a1bb7ff2a..a67642229c 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -104,9 +104,8 @@ The structure of this document is as follows: (:numref:`IDAS.Mathematics.Preconditioning`) and rootfinding (:numref:`IDAS.Mathematics.rootfinding`). -* The following chapter describes the structure of the SUNDIALS suite of solvers - (:numref:`IDAS.Organization`) and the software organization of the IDAS solver - (:numref:`IDAS.Organization.IDAS`). +* The following chapter describes the software organization of the IDAS + solver (:numref:`IDAS.Organization`). * Chapter :numref:`IDAS.Usage.SIM` is the main usage document for IDAS for simulation applications. It includes a complete description of the user diff --git a/doc/idas/guide/source/Organization.rst b/doc/idas/guide/source/Organization.rst index b46169ef10..0d590660c0 100644 --- a/doc/idas/guide/source/Organization.rst +++ b/doc/idas/guide/source/Organization.rst @@ -16,16 +16,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _IDAS.Organization.IDAS: - -IDAS organization -================= - The IDAS package is written in ANSI C. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/idas/guide/source/sundials/index.rst b/doc/idas/guide/source/sundials/index.rst index c4a8968b29..98fee06255 100644 --- a/doc/idas/guide/source/sundials/index.rst +++ b/doc/idas/guide/source/sundials/index.rst @@ -16,10 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`IDAS.Organization`, the all SUNDIALS packages are built upon -a common set of interfaces for vectors, matrices, and algebraic solvers. In -addition, the packages all leverage some other common infrastructure discussed -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 9665273e59..6961e9da38 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -115,9 +115,8 @@ The structure of this document is as follows: - In Chapter :numref:`KINSOL.Mathematics`, we provide short descriptions of the numerical methods implemented by KINSOL for the solution of nonlinear systems. -- The following chapter describes the structure of the SUNDIALS suite of solvers - (:numref:`KINSOL.Organization`) and the software organization of the KINSOL solver - (:numref:`KINSOL.Organization.KINSOL`). +- The following chapter describes the software organization of the KINSOL + solver (:numref:`KINSOL.Organization`). - Chapter :numref:KINSOL.Usage.CC is the main usage document for KINSOL for C applications. It includes a complete description of the user interface for the solution of nonlinear algebraic systems. diff --git a/doc/kinsol/guide/source/Organization.rst b/doc/kinsol/guide/source/Organization.rst index 04fb8804bc..02b3634a64 100644 --- a/doc/kinsol/guide/source/Organization.rst +++ b/doc/kinsol/guide/source/Organization.rst @@ -16,16 +16,6 @@ Code Organization ***************** -.. ifconfig:: package_name != 'super' - - .. include:: ../../../shared/SundialsOrganization.rst - - -.. _KINSOL.Organization.KINSOL: - -KINSOL organization -=================== - The KINSOL package is written in ANSI C. The following summarizes the basic structure of the package, although knowledge of this structure is not necessary for its use. diff --git a/doc/kinsol/guide/source/sundials/index.rst b/doc/kinsol/guide/source/sundials/index.rst index 35c8fa2cf5..98fee06255 100644 --- a/doc/kinsol/guide/source/sundials/index.rst +++ b/doc/kinsol/guide/source/sundials/index.rst @@ -16,11 +16,15 @@ Using SUNDIALS ************** -As discussed in :numref:`KINSOL.Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. .. toctree:: Types_link diff --git a/doc/shared/SundialsOrganization.rst b/doc/shared/SundialsOrganization.rst deleted file mode 100644 index 6185413bd9..0000000000 --- a/doc/shared/SundialsOrganization.rst +++ /dev/null @@ -1,58 +0,0 @@ -.. ---------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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 consists of the solvers CVODE and ARKODE for ordinary differential -equation (ODE) systems, IDA for differential-algebraic (DAE) systems, and KINSOL -for nonlinear algebraic systems. In addition, SUNDIALS also includes variants of -CVODE and IDA with sensitivity analysis capabilities (using either forward or -adjoint methods), called CVODES and IDAS, respectively. The following is a list -summarizes the basic functionality of each SUNDIALS package: - -* CVODE, a solver for stiff and nonstiff ODE systems :math:`\dot{y} = f(t,y)` - based on Adams and BDF methods; - -* CVODES, a solver for stiff and nonstiff ODE systems with sensitivity analysis - capabilities; - -* ARKODE, a solver for stiff, nonstiff, mixed stiff-nonstiff, and multirate ODE - systems :math:`M(t)\, \dot{y} = f_1(t,y) + f_2(t,y)` based on Runge-Kutta - methods; - -* IDA, a solver for differential-algebraic systems :math:`F(t,y,\dot{y}) = 0` - based on BDF methods; - -* IDAS, a solver for differential-algebraic systems with sensitivity analysis - capabilities; - -* KINSOL, a solver for nonlinear algebraic systems :math:`F(u) = 0`. - -The various packages in the suite share many common components and are organized -as a family. :numref:`Organization.Sundials.HighLevelDiagram` gives a high-level -overview of solver packages, the shared vector, matrix, linear solver, and -nonlinear solver interfaces (abstract base classes), and the corresponding class -implementations provided with SUNDIALS. For classes that provide interfaces to -third-party libraries (i.e., LAPACK, KLU, SuperLU_MT, SuperLU_DIST, *hypre*, -PETSc, Trilinos, and Raja) users will need to download and compile those -packages independently of SUNDIALS. The directory structure is shown in -:numref:`Organization.Sundials.DirectoryStructure`. - -.. _Organization.Sundials.HighLevelDiagram: -.. figure:: /figs/sunorg1.png - :align: center - - High-level diagram of the SUNDIALS suite. - -.. _Organization.Sundials.DirectoryStructure: -.. figure:: /figs/sunorg2.png - :align: center - - Directory structure of the SUNDIALS source tree. diff --git a/doc/superbuild/source/Organization_link.rst b/doc/superbuild/source/Organization_link.rst deleted file mode 100644 index 30ff84dfcc..0000000000 --- a/doc/superbuild/source/Organization_link.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. ---------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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 - ---------------------------------------------------------------- - -.. _Organization: - -##################### -SUNDIALS organization -##################### - -.. include:: ../../shared/SundialsOrganization.rst diff --git a/doc/superbuild/source/arkode/index.rst b/doc/superbuild/source/arkode/index.rst index 8d0740ae2f..712f1d76c1 100644 --- a/doc/superbuild/source/arkode/index.rst +++ b/doc/superbuild/source/arkode/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _ARKODE: + ******************** ARKODE Documentation ******************** diff --git a/doc/superbuild/source/cvode/index.rst b/doc/superbuild/source/cvode/index.rst index ec01e68183..e6017c4689 100644 --- a/doc/superbuild/source/cvode/index.rst +++ b/doc/superbuild/source/cvode/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _CVODE: + ******************* CVODE Documentation ******************* diff --git a/doc/superbuild/source/cvodes/index.rst b/doc/superbuild/source/cvodes/index.rst index c4467aeed1..afac39fa5c 100644 --- a/doc/superbuild/source/cvodes/index.rst +++ b/doc/superbuild/source/cvodes/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _CVODES: + ******************** CVODES Documentation ******************** diff --git a/doc/superbuild/source/ida/index.rst b/doc/superbuild/source/ida/index.rst index 7ba8a7212e..55bcc14622 100644 --- a/doc/superbuild/source/ida/index.rst +++ b/doc/superbuild/source/ida/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _IDA: + ******************* IDA Documentation ******************* diff --git a/doc/superbuild/source/idas/index.rst b/doc/superbuild/source/idas/index.rst index 444af39b05..2c2fe9c616 100644 --- a/doc/superbuild/source/idas/index.rst +++ b/doc/superbuild/source/idas/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _IDAS: + ****************** IDAS Documentation ****************** diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 4985f44530..64b32504a0 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -16,18 +16,11 @@ SUNDIALS Documentation ###################### -This is the documentation for the `SUNDIALS -<https://computing.llnl.gov/projects/sundials>`_ suite of -nonlinear and differential/algebraic equation solvers. - -SUNDIALS is developed on `GitHub <https://github.com/LLNL/sundials>`_. - .. toctree:: :maxdepth: 1 :numbered: :hidden: - Organization_link.rst sundials/index.rst arkode/index.rst cvode/index.rst @@ -46,22 +39,35 @@ SUNDIALS is developed on `GitHub <https://github.com/LLNL/sundials>`_. developers/index.rst References +The `SUNDIALS <https://computing.llnl.gov/projects/sundials>`_ library of time +integrators and nonlinear solvers provides robust and efficient numerical +methods for ordinary differential equations (ODEs), differential-algebraic +equations (DAEs), and nonlinear algebraic systems. SUNDIALS is freely available +and developed on `GitHub <https://github.com/LLNL/sundials>`_. -Contributors -============ +SUNDIALS is comprised of following packages: -The SUNDIALS library has been developed over many years by a number of -contributors. The current SUNDIALS team consists of Cody J. Balos, -David J. Gardner, Alan C. Hindmarsh, Daniel R. Reynolds, and Carol S. -Woodward. We thank Radu Serban for significant and critical past contributions. +* :ref:`ARKODE <ARKODE>`, a solver with one-step methods for stiff, nonstiff, + mixed stiff-nonstiff, and multirate ODE systems. -Other contributors to SUNDIALS include: James Almgren-Bell, Lawrence E. Banks, -Peter N. Brown, George Byrne, Rujeko Chinomona, Scott D. Cohen, Aaron Collier, -Keith E. Grant, Steven L. Lee, Shelby L. Lockhart, John Loffeld, Daniel McGreer, -Yu Pan, Slaven Peles, Cosmin Petra, Steven B. Roberts, H. Hunter Schwartz, -Jean M. Sexton, Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, -Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang. +* :ref:`CVODE <CVODE>`, a solver with Adams and BDF methods for stiff and + nonstiff ODE systems. + +* :ref:`CVODES <CVODES>`, an extension of CVODE with forward and adjoint + sensitivity analysis capabilities for stiff and nonstiff ODE systems. + +* :ref:`IDA <IDA>`, a solver with BDF methods for DAE systems. +* :ref:`IDAS <IDAS>`, an extension of IDA with forward and adjoint sensitivity + analysis capabilities for DAE systems. + +* :ref:`KINSOL <KINSOL>`, a solver for nonlinear algebraic systems. + +The SUNDIALS packages share many components and are organized as a family built +on a common infrastructure including abstract interfaces for vectors, matrices, +and algebraic solvers. Several implementations of these interfaces are provided +with SUNDIALS supporting a range of parallel computing paradigms including +shared-memory, distributed memory, and GPU computing. Citing ====== @@ -152,6 +158,20 @@ they are using rather than the combined SUNDIALS online guide: howpublished = {\url{https://sundials.readthedocs.io/en/latest/kinsol}} } +Contributors +============ + +The SUNDIALS library has been developed over many years by a number of +contributors. The current SUNDIALS team consists of Cody J. Balos, +David J. Gardner, Alan C. Hindmarsh, Daniel R. Reynolds, and Carol S. +Woodward. We thank Radu Serban for significant and critical past contributions. + +Other contributors to SUNDIALS include: James Almgren-Bell, Lawrence E. Banks, +Peter N. Brown, George Byrne, Rujeko Chinomona, Scott D. Cohen, Aaron Collier, +Keith E. Grant, Steven L. Lee, Shelby L. Lockhart, John Loffeld, Daniel McGreer, +Yu Pan, Slaven Peles, Cosmin Petra, Steven B. Roberts, H. Hunter Schwartz, +Jean M. Sexton, Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, +Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang. SUNDIALS License and Notices ============================ diff --git a/doc/superbuild/source/kinsol/index.rst b/doc/superbuild/source/kinsol/index.rst index 80ceaaa4da..ed709dab52 100644 --- a/doc/superbuild/source/kinsol/index.rst +++ b/doc/superbuild/source/kinsol/index.rst @@ -10,6 +10,8 @@ SUNDIALS Copyright End ---------------------------------------------------------------- +.. _KINSOL: + ******************** KINSOL Documentation ******************** diff --git a/doc/superbuild/source/sundials/index.rst b/doc/superbuild/source/sundials/index.rst index de2874f18a..9ae91fe09a 100644 --- a/doc/superbuild/source/sundials/index.rst +++ b/doc/superbuild/source/sundials/index.rst @@ -16,11 +16,17 @@ Using SUNDIALS ************** -As discussed in :numref:`Organization`, the six solvers packages -(CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common -classes/modules for vectors, matrices, and algebraic solvers. In addition, the -six packages all leverage some other common infrastructure, which we discuss -in this section. +The packages that make up SUNDIALS are built upon shared classes for vectors, +matrices, and algebraic solvers. In addition, the packages all leverage some +other common infrastructure, which we discuss in this section. + +.. _Organization.Sundials.HighLevelDiagram: +.. figure:: ../figs/sunorg1.png + :align: center + + High-level diagram of the SUNDIALS suite. + +**Table of Contents**: .. toctree:: :maxdepth: 1 From f22b6ba84910846cd7c9e43702305460e4cc1d32 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 29 Mar 2024 14:16:58 -0700 Subject: [PATCH 023/137] Split hashmap into .c and .h file (#451) This fixes compilation warnings I had with `gcc` 8.5 using `-Wall`. Many of the static functions in `sundials_hashmap.h` were unused by files that included the header. After discussion with @balos1 moving the implementations into a .c file made more sense than adding the `inline` keyword to all the functions. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> Co-authored-by: Cody Balos <balos1@llnl.gov> --- src/sundials/CMakeLists.txt | 1 + ...{sundials_hashmap.h => sundials_hashmap.c} | 57 ++++++------------- src/sundials/sundials_hashmap_impl.h | 56 ++++++++++++++++++ src/sundials/sundials_logger_impl.h | 2 +- src/sundials/sundials_profiler.c | 3 +- 5 files changed, 76 insertions(+), 43 deletions(-) rename src/sundials/{sundials_hashmap.h => sundials_hashmap.c} (84%) create mode 100644 src/sundials/sundials_hashmap_impl.h diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index c7f1f90ee0..46bab728ef 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -88,6 +88,7 @@ set(sundials_SOURCES sundials_dense.c sundials_direct.c sundials_errors.c + sundials_hashmap.c sundials_iterative.c sundials_linearsolver.c sundials_logger.c diff --git a/src/sundials/sundials_hashmap.h b/src/sundials/sundials_hashmap.c similarity index 84% rename from src/sundials/sundials_hashmap.h rename to src/sundials/sundials_hashmap.c index 3da8ae6e02..55c786b34f 100644 --- a/src/sundials/sundials_hashmap.h +++ b/src/sundials/sundials_hashmap.c @@ -11,21 +11,19 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * A simple header-only hashmap implementation for char* keys and + * A simple hashmap implementation for char* keys and * void* values. Uses linear probing to resolve collisions. * The values can be anything, but will be freed by * the hash map upon its destruction. * -----------------------------------------------------------------*/ -#ifndef _SUNDIALS_HASHMAP_H -#define _SUNDIALS_HASHMAP_H - #include <stdint.h> #include <stdlib.h> #include <string.h> #include "sundials/sundials_errors.h" #include "sundials/sundials_types.h" +#include "sundials_hashmap_impl.h" static const uint64_t HASH_PRIME = 14695981039346656037U; static const uint64_t HASH_OFFSET_BASIS = 1099511628211U; @@ -45,23 +43,6 @@ static uint64_t fnv1a_hash(const char* str) return hash; } -typedef struct _SUNHashMapKeyValue* SUNHashMapKeyValue; - -struct _SUNHashMapKeyValue -{ - const char* key; - void* value; -}; - -typedef struct _SUNHashMap* SUNHashMap; - -struct _SUNHashMap -{ - int size; /* current number of entries */ - int max_size; /* max number of entries */ - SUNHashMapKeyValue* buckets; -}; - /* This function creates a new SUNHashMap object allocated to hold up to 'max_size' entries. @@ -74,14 +55,14 @@ struct _SUNHashMap **Returns:** * A SUNErrCode indicating success or a failure */ -static SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map) +SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map) { int i; if (max_size <= 0) { return SUN_ERR_ARG_OUTOFRANGE; } *map = NULL; - *map = (SUNHashMap)malloc(sizeof(struct _SUNHashMap)); + *map = (SUNHashMap)malloc(sizeof(**map)); if (!map) { return SUN_ERR_MALLOC_FAIL; } @@ -90,7 +71,7 @@ static SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map) (*map)->buckets = NULL; (*map)->buckets = - (SUNHashMapKeyValue*)malloc(max_size * sizeof(SUNHashMapKeyValue)); + (SUNHashMapKeyValue*)malloc(max_size * sizeof(*((*map)->buckets))); if (!(*map)->buckets) { @@ -115,8 +96,7 @@ static SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map) **Returns:** * A SUNErrCode indicating success or a failure */ -static SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, - void (*freevalue)(void* ptr)) +SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, void (*freevalue)(void* ptr)) { int i; @@ -159,9 +139,8 @@ static SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, * ``>=0`` -- the index at which the iteration stopped * ``<-1`` -- an error occurred */ -static int SUNHashMap_Iterate(SUNHashMap map, int start, - int (*yieldfn)(int, SUNHashMapKeyValue, void*), - void* ctx) +int SUNHashMap_Iterate(SUNHashMap map, int start, + int (*yieldfn)(int, SUNHashMapKeyValue, void*), void* ctx) { int i; @@ -201,7 +180,7 @@ static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, void* ctx * ``-1`` -- an error occurred * ``-2`` -- the map is full */ -static int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value) +int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value) { int idx; int retval; @@ -224,7 +203,7 @@ static int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value) } /* Create the key-value pair */ - kvp = (SUNHashMapKeyValue)malloc(sizeof(struct _SUNHashMapKeyValue)); + kvp = (SUNHashMapKeyValue)malloc(sizeof(*kvp)); if (kvp == NULL) { return (-1); } kvp->key = key; @@ -264,7 +243,7 @@ static int sunHashMapLinearProbeGet(int idx, SUNHashMapKeyValue kv, void* key) * ``-1`` -- an error occurred * ``-2`` -- key not found */ -static int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value) +int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value) { int idx; int retval; @@ -308,15 +287,14 @@ static int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value) **Returns:** * A SUNErrCode indicating success or a failure */ -static SUNErrCode SUNHashMap_Sort(SUNHashMap map, SUNHashMapKeyValue** sorted, - int (*compar)(const void*, const void*)) +SUNErrCode SUNHashMap_Sort(SUNHashMap map, SUNHashMapKeyValue** sorted, + int (*compar)(const void*, const void*)) { int i; if (!map || !compar) { return SUN_ERR_ARG_CORRUPT; } - *sorted = - (SUNHashMapKeyValue*)malloc(map->max_size * sizeof(SUNHashMapKeyValue)); + *sorted = (SUNHashMapKeyValue*)malloc(map->max_size * sizeof(**sorted)); if (!(*sorted)) { return SUN_ERR_MALLOC_FAIL; } /* Copy the buckets into a new array */ @@ -339,15 +317,14 @@ static SUNErrCode SUNHashMap_Sort(SUNHashMap map, SUNHashMapKeyValue** sorted, * A SUNErrCode indicating success or a failure */ #if SUNDIALS_MPI_ENABLED -static SUNErrCode SUNHashMap_Values(SUNHashMap map, void*** values, - size_t value_size) +SUNErrCode SUNHashMap_Values(SUNHashMap map, void*** values, size_t value_size) { int i; int count = 0; if (!map) { return SUN_ERR_ARG_CORRUPT; } - *values = (void**)malloc(map->size * sizeof(value_size)); + *values = (void**)malloc(map->size * value_size); if (!values) { return SUN_ERR_MALLOC_FAIL; } /* Copy the values into a new array */ @@ -359,5 +336,3 @@ static SUNErrCode SUNHashMap_Values(SUNHashMap map, void*** values, return SUN_SUCCESS; } #endif - -#endif diff --git a/src/sundials/sundials_hashmap_impl.h b/src/sundials/sundials_hashmap_impl.h new file mode 100644 index 0000000000..7fc743a2f3 --- /dev/null +++ b/src/sundials/sundials_hashmap_impl.h @@ -0,0 +1,56 @@ +/* ----------------------------------------------------------------- + * Programmer: Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------- + * A simple hashmap implementation for char* keys and + * void* values. Uses linear probing to resolve collisions. + * The values can be anything, but will be freed by + * the hash map upon its destruction. + * -----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_HASHMAP_IMPL_H +#define _SUNDIALS_HASHMAP_IMPL_H + +#include <stdlib.h> +#include <sundials/sundials_types.h> + +typedef struct SUNHashMapKeyValue_* SUNHashMapKeyValue; + +struct SUNHashMapKeyValue_ +{ + const char* key; + void* value; +}; + +typedef struct SUNHashMap_* SUNHashMap; + +struct SUNHashMap_ +{ + int size; /* current number of entries */ + int max_size; /* max number of entries */ + SUNHashMapKeyValue* buckets; +}; + +SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map); +SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, void (*freevalue)(void* ptr)); +int SUNHashMap_Iterate(SUNHashMap map, int start, + int (*yieldfn)(int, SUNHashMapKeyValue, void*), void* ctx); +int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value); +int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value); +SUNErrCode SUNHashMap_Sort(SUNHashMap map, SUNHashMapKeyValue** sorted, + int (*compar)(const void*, const void*)); + +#if SUNDIALS_MPI_ENABLED +SUNErrCode SUNHashMap_Values(SUNHashMap map, void*** values, size_t value_size); +#endif + +#endif diff --git a/src/sundials/sundials_logger_impl.h b/src/sundials/sundials_logger_impl.h index 7cecc00b60..6fbb7cac49 100644 --- a/src/sundials/sundials_logger_impl.h +++ b/src/sundials/sundials_logger_impl.h @@ -21,7 +21,7 @@ #include <sundials/sundials_logger.h> #include <sundials/sundials_types.h> -#include "sundials_hashmap.h" +#include "sundials_hashmap_impl.h" #include "sundials_utils.h" #define SUNDIALS_LOGGING_ERROR 1 diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index bfc7196e3e..4a2e12e783 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -12,6 +12,7 @@ * SUNDIALS Copyright End * -----------------------------------------------------------------*/ +#include <string.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_config.h> @@ -39,7 +40,7 @@ #include <sundials/sundials_types.h> #include "sundials_debug.h" -#include "sundials_hashmap.h" +#include "sundials_hashmap_impl.h" #define SUNDIALS_ROOT_TIMER ((const char*)"From profiler epoch") From 931254b65b9aae19379b141b7f99c0d282cb9738 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Sat, 30 Mar 2024 20:34:07 -0700 Subject: [PATCH 024/137] Bugfix: Add missing include guards to header files (#452) --- examples/arkode/CXX_parallel/ark_brusselator1D.h | 5 +++++ examples/nvector/test_nvector.h | 5 +++++ examples/utilities/custom_memory_helper_gpu.h | 5 +++++ examples/utilities/custom_memory_helper_sycl.h | 5 +++++ src/sundials/sundials_adiak_metadata.h | 5 +++++ src/sundials/sundials_iterative_impl.h | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index 38cc6ee7a4..b95390bc4a 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -12,6 +12,9 @@ * SUNDIALS Copyright End * ---------------------------------------------------------------------------*/ +#ifndef _ARK_BRUSSELATOR1D_H +#define _ARK_BRUSSELATOR1D_H + #include <cmath> #include <cstdio> #include <cstdlib> @@ -266,3 +269,5 @@ static int check_retval(void* returnvalue, const char* funcname, int opt); static void gpuAssert(GPU_PREFIX(Error_t) code, const char* file, int line, int abort); #endif + +#endif diff --git a/examples/nvector/test_nvector.h b/examples/nvector/test_nvector.h index 9ff1c6163e..7984712649 100644 --- a/examples/nvector/test_nvector.h +++ b/examples/nvector/test_nvector.h @@ -15,6 +15,9 @@ * test an NVECTOR module implementation. * -----------------------------------------------------------------*/ +#ifndef _TEST_NVECTOR_H +#define _TEST_NVECTOR_H + #include <math.h> #include <sundials/sundials_types.h> @@ -146,3 +149,5 @@ void SetTiming(int onoff, int myid); #ifdef __cplusplus } #endif + +#endif diff --git a/examples/utilities/custom_memory_helper_gpu.h b/examples/utilities/custom_memory_helper_gpu.h index ca5950a7f9..08872f983e 100644 --- a/examples/utilities/custom_memory_helper_gpu.h +++ b/examples/utilities/custom_memory_helper_gpu.h @@ -15,6 +15,9 @@ * unmanaged memory only and synchronous copies. * -----------------------------------------------------------------*/ +#ifndef _CUSTOM_MEMORY_HELPER_GPU_H +#define _CUSTOM_MEMORY_HELPER_GPU_H + #include <assert.h> #include <string.h> #if defined(__NVCC__) @@ -157,3 +160,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx) return helper; } + +#endif diff --git a/examples/utilities/custom_memory_helper_sycl.h b/examples/utilities/custom_memory_helper_sycl.h index 6af7c0d435..3135f3ad5d 100644 --- a/examples/utilities/custom_memory_helper_sycl.h +++ b/examples/utilities/custom_memory_helper_sycl.h @@ -15,6 +15,9 @@ * unmanaged memory only and synchronous copies. * -----------------------------------------------------------------*/ +#ifndef _CUSTOM_MEMORY_HELPER_SYCL_H +#define _CUSTOM_MEMORY_HELPER_SYCL_H + #include <cstdlib> #include <sundials/sundials_memory.h> #include <sycl/sycl.hpp> @@ -116,3 +119,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx) return helper; } + +#endif diff --git a/src/sundials/sundials_adiak_metadata.h b/src/sundials/sundials_adiak_metadata.h index 8013dbdc6b..4e7e908a66 100644 --- a/src/sundials/sundials_adiak_metadata.h +++ b/src/sundials/sundials_adiak_metadata.h @@ -12,6 +12,9 @@ * SUNDIALS Copyright End * ----------------------------------------------------------------*/ +#ifndef _SUNDIALS_ADIAK_METADATA_H +#define _SUNDIALS_ADIAK_METADATA_H + #ifdef SUNDIALS_ADIAK_ENABLED #include <adiak.h> @@ -142,3 +145,5 @@ static void sunAdiakCollectMetadata() #endif } #endif + +#endif diff --git a/src/sundials/sundials_iterative_impl.h b/src/sundials/sundials_iterative_impl.h index 5ebf796761..ea6c17c10e 100644 --- a/src/sundials/sundials_iterative_impl.h +++ b/src/sundials/sundials_iterative_impl.h @@ -15,6 +15,9 @@ * different iterative solvers. * ---------------------------------------------------------------------------*/ +#ifndef _SUNDIALS_ITERATIVE_IMPL_H +#define _SUNDIALS_ITERATIVE_IMPL_H + #include <sundials/sundials_iterative.h> /* ----------------------------------------------------------------------------- @@ -33,3 +36,5 @@ struct _SUNQRData N_Vector vtemp2; sunrealtype* temp_array; }; + +#endif From 9c79858f4734ba3256c7d974caba41c05db44463 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Sun, 31 Mar 2024 12:31:37 -0700 Subject: [PATCH 025/137] Bugfix: Add missing frees on error (#453) Add missing arkFree if arkCreate fails Add missing ARKStepFree if ARKStepCreate fails Add missing ERKStepFree if ERKStepCreate fails ---------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- src/arkode/arkode.c | 3 +++ src/arkode/arkode_arkstep.c | 1 + src/arkode/arkode_erkstep.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 69ec2d37fe..eac2af4222 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -133,6 +133,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Allocation of step adaptivity structure failed"); + arkFree((void**)&ark_mem); return (NULL); } ark_mem->lrw += ARK_ADAPT_LRW; @@ -144,6 +145,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Allocation of step controller object failed"); + arkFree((void**)&ark_mem); return (NULL); } ark_mem->hadapt_mem->owncontroller = SUNTRUE; @@ -180,6 +182,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, "Error setting default solver options"); + arkFree((void**)&ark_mem); return (NULL); } diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 7e4361c516..0d7fc94394 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -89,6 +89,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); + ARKStepFree((void**)&ark_mem); return (NULL); } memset(step_mem, 0, sizeof(struct ARKodeARKStepMemRec)); diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 1e80ea0f20..8fec869acf 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -85,6 +85,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); + ERKStepFree((void**)&ark_mem); return (NULL); } memset(step_mem, 0, sizeof(struct ARKodeERKStepMemRec)); @@ -101,6 +102,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); + ERKStepFree((void**)&ark_mem); return (NULL); } @@ -124,6 +126,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); + ERKStepFree((void**)&ark_mem); return (NULL); } From 503c7eeed291a8363d0f8914ec81cc8bc886a569 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Tue, 16 Apr 2024 21:32:12 -0700 Subject: [PATCH 026/137] Feature: sundials addons (#444) Added CMake infrastructure that enables externally maintained addons to be optionally built with SUNDIALS. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- .github/workflows/check-clang-format.yml | 12 +- .gitmodules | 3 + CHANGELOG.md | 4 + CMakeLists.txt | 4 + CONTRIBUTING.md | 54 ++++-- cmake/SundialsBuildOptionsPre.cmake | 10 ++ doc/README.md | 31 +++- doc/arkode/guide/source/Butcher.rst | 6 +- doc/arkode/guide/source/Constants.rst | 6 +- doc/arkode/guide/source/sundials/index.rst | 6 +- doc/cvode/guide/source/sundials/index.rst | 6 +- doc/cvodes/guide/source/sundials/index.rst | 6 +- doc/ida/guide/source/sundials/index.rst | 6 +- doc/idas/guide/source/sundials/index.rst | 6 +- doc/install_guide/source/conf.py | 5 +- doc/kinsol/guide/source/sundials/index.rst | 6 +- doc/shared/RecentChanges.rst | 3 + doc/shared/sundials/Install.rst | 36 +++- doc/shared/sundials/index.rst | 6 +- doc/superbuild/source/contributing/index.rst | 156 ++++++++++++++++++ .../source/developers/development/index.rst | 23 --- .../Checklist.rst | 0 .../developers/getting_started/index.rst | 1 + doc/superbuild/source/developers/index.rst | 9 +- .../developers/pull_requests/OpenPR.rst | 9 +- .../developers/style_guide/SourceCode.rst | 53 ++---- .../source/developers/testing/Spot.rst | 70 ++++---- doc/superbuild/source/index.rst | 67 +++++--- doc/superbuild/source/sundials/index.rst | 6 +- external/CMakeLists.txt | 31 ++++ external/README.md | 6 + external/sundials-addon-example | 1 + scripts/shared | 3 + scripts/tarscript | 2 + 34 files changed, 483 insertions(+), 170 deletions(-) create mode 100644 doc/superbuild/source/contributing/index.rst delete mode 100644 doc/superbuild/source/developers/development/index.rst rename doc/superbuild/source/developers/{development => getting_started}/Checklist.rst (100%) create mode 100644 external/CMakeLists.txt create mode 100644 external/README.md create mode 160000 external/sundials-addon-example diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 7d5feae1cf..8da2ebd3f9 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -12,7 +12,7 @@ jobs: image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack steps: - name: Install git - run: | + run: | apt update apt install -y git @@ -26,18 +26,18 @@ jobs: - name: Print clang-format version run: clang-format --version - + - name: Run checker on code run: | - ./scripts/format.sh . - + ./scripts/format.sh benchmarks examples include src test + - name: Run git diff to see if anything changed run: /usr/bin/git diff --name-only --exit-code - + - name: Run git diff if we failed if: failure() run: /usr/bin/git diff > diff - + - name: Archive diff if we failed uses: actions/upload-artifact@v3 if: failure() diff --git a/.gitmodules b/.gitmodules index f12a7cce09..659855b75f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "test/answers"] path = test/answers url = https://github.com/sundials-codes/answers.git +[submodule "external/sundials-addon-example"] + path = external/sundials-addon-example + url = https://github.com/sundials-codes/sundials-addon-example.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 62512bb8b0..696e4b908a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argumen to a function pointer instead of `c_null_funptr`. This caused compilation issues with the Cray Fortran compiler. +Added CMake infrastructure that enables externally maintained addons/plugins +to be *optionally* built with SUNDIALS. See the [Contributing Guide](./CONTRIBUTING.md) +for more details. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/CMakeLists.txt b/CMakeLists.txt index edffa9b2a2..9c2279f4e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,10 @@ if(SUNDIALS_TEST_UNITTESTS) add_subdirectory(test/unit_tests) endif() +if(SUNDIALS_ENABLE_EXTERNAL_ADDONS) + add_subdirectory(external) +endif() + # =============================================================== # Install configuration header files and license file. # =============================================================== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ea2f6f9c6..4106e3738b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,16 @@ # Contributing to SUNDIALS -At this time, the SUNDIALS team does not have the resources to review and take -in large additions to the code or significant new features. Contributions -addressing bug fixes or minor changes are preferred via a pull request to the -[SUNDIALS GitHub repository](https://github.com/LLNL/sundials). +There are two primary ways of contributing to SUNDIALS. The first way is by particpating +in the development of SUNDIALS directly through contributions of code to the primary +[SUNDIALS repository](https://github.com/LLNL/sundials). This is the best way to contribute +bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources +to review and take in large additions to the code or significant new features. +Larger additions can be contributed as a SUNDIALS "addon" which is a component that may be +optionally downloaded by users and then compiled and installed with SUNDIALS. + +## Direct Contributions via Pull Requests + +Direct contributions to SUNDIALS are made by opening a Pull Request. All new contributions to SUNDIALS must be made under the BSD 3-clause license. See the [LICENSE](./LICENSE) and [NOTICE](./NOTICE) files for details. The @@ -62,12 +69,11 @@ By making a contribution to this project, I certify that: this project or the open source license(s) involved. ``` -As discussed in the [Docker software project blog](https://blog.docker.com/2014/01/docker-code-contributions-require-developer-certificate-of-origin/) -this DCO "lets us know that you are entitled to contribute this code to -[SUNDIALS] and that you are willing to have it used in distributions and -derivative works." +The DCO lets us know that you are entitled to contribute this code to +SUNDIALS and that you are willing to have it used in distributions and +derivative works. -"By including the DCO signature, you are stating that one or +By including the DCO signature, you are stating that one or more of the following is true of your contribution: 1. You created this contribution/change and have the right to submit it @@ -77,7 +83,7 @@ more of the following is true of your contribution: 3. This contribution/change has been provided to you by someone who did 1 or 2 and you are submitting the contribution unchanged. 4. You understand this contribution is public and may be redistributed as - open source software" under the BSD license. + open source software under the BSD license. All commits submitted to the SUNDIALS project need to have the following sign off line in the commit message: @@ -89,3 +95,31 @@ Replacing Jane Doe’s details with your name and email address. If you've set `user.name` and `user.email` in your Git configuration, you can automatically add a sign off line at the end of the commit message by using the `-s` option (e.g., `git commit -s`). + +## Contributions via SUNDIALS Addons + +SUNDIALS "addons" are community developed code additions for SUNDIALS that can be subsumed by the +SUNDIALS build system so that they have full access to all internal SUNDIALS symbols. +The intent is for SUNDIALS addons to function as if they are part of the SUNDIALS library, +while allowing them to potentially have different licenses +(although we encourage BSD-3-Clause still), code style +(although we encourage them to follow the SUNDIALS style outlined :ref:`here <Style>`), +and they **are not maintained by the SUNDIALS team**. + +### Creating an addon + +To create a SUNDIALS addon and use it there are a few things you need to do: + +1. In your addon project, ensure that you have a `CMakeLists.txt` that uses the + `sundials_add_library` CMake macro to create the library target. The best thing to do is simply + copy from, or refer to, a `CMakeLists.txt` in the SUNDIALS `src` directory. +2. Follow the steps in the `README.md` file in the `external/` directory in the root of the SUNDIALS + source code. + +An example addon is available [here](https://github.com/sundials-codes/sundials-addon-example). + +### Friends of SUNDIALS + +The SUNDIALS team maintains a list of some SUNDIALS addons in our [Friends of SUNDIALS](https://github.com/sundials-codes/friends-of-sundials>) repository. These addons are not +maintained by the SUNDIALS team, but have been developed in consultation with us. +**Currently we are only adding projects for existing collaborations**. Please contact the development team if you are interested in collaborating on an addon. diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 56629de067..d4defde798 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -272,6 +272,16 @@ if(SUNDIALS_DEBUG_PRINTVEC AND SUNDIALS_LOGGING_LEVEL LESS 5) set(SUNDIALS_LOGGING_LEVEL "5" CACHE STRING "${DOCSTR}" FORCE) endif() +# --------------------------------------------------------------- +# Options for SUNDIALS external +# --------------------------------------------------------------- + +sundials_option(SUNDIALS_ENABLE_EXTERNAL_ADDONS BOOL + "Enables including EXTERNALLY MAINTAINED addons in the SUNDIALS build." OFF) +if(SUNDIALS_ENABLE_EXTERNAL_ADDONS) + message(WARNING "SUNDIALS_ENABLE_EXTERNAL_ADDONS=TRUE. External addons are not maintained by the SUNDIALS team. Use at your own risk.") +endif() + # --------------------------------------------------------------- # Options for SUNDIALS testing # --------------------------------------------------------------- diff --git a/doc/README.md b/doc/README.md index 3fe743f033..6711fab890 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,10 +1,35 @@ # SUNDIALS Documentation The SUNDIALS documentation is written using reStructuredText and -[Sphinx](https://www.sphinx-doc.org/). +[Sphinx](https://www.sphinx-doc.org/). We host the generated HTML documentation +at https://sundials.readthedocs.io. 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 +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. + +Once you have the dependencies installed, you can choose what you want to build. +To build the so-called "superbuild" of HTML docs that includes everything +(like our readthedocs) then do + +```bash +cd superbuild +make -j4 +``` + +If you want to build the docs separately for each of the individual SUNDIALS packages, +then you should run + +```bash +make -j4 html|latexpdf # build HTML docs or PDF (using latex) +``` + +Finally, if you just want to build the docs for one SUNDIALS package, then you can +run + +```bash +cd <package> +make -j4 html|latexpdf # build HTML docs or PDF (using latex) +``` diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index ef4d59a139..015b500a04 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -14,9 +14,9 @@ .. _Butcher: -========================= -Appendix: Butcher tables -========================= +============== +Butcher Tables +============== Here we catalog the full set of Butcher tables included in ARKODE. We group these into four categories: *explicit*, *implicit*, *additive* and diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 764242be56..c4cad94a8d 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -14,9 +14,9 @@ .. _ARKODE.Constants: -=========================== -Appendix: ARKODE Constants -=========================== +================ +ARKODE Constants +================ Below we list all input and output constants used by the main solver, timestepper, and linear solver modules, together with a short diff --git a/doc/arkode/guide/source/sundials/index.rst b/doc/arkode/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/arkode/guide/source/sundials/index.rst +++ b/doc/arkode/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/cvode/guide/source/sundials/index.rst b/doc/cvode/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/cvode/guide/source/sundials/index.rst +++ b/doc/cvode/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/cvodes/guide/source/sundials/index.rst b/doc/cvodes/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/cvodes/guide/source/sundials/index.rst +++ b/doc/cvodes/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/ida/guide/source/sundials/index.rst b/doc/ida/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/ida/guide/source/sundials/index.rst +++ b/doc/ida/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/idas/guide/source/sundials/index.rst b/doc/idas/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/idas/guide/source/sundials/index.rst +++ b/doc/idas/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/install_guide/source/conf.py b/doc/install_guide/source/conf.py index 26dddc12fb..211d28657c 100644 --- a/doc/install_guide/source/conf.py +++ b/doc/install_guide/source/conf.py @@ -29,7 +29,10 @@ # 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', 'sphinx_sundials'] + 'sphinx_copybutton', 'sphinx_sundials', 'sphinx.ext.intersphinx'] + +intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', + ('../../superbuild/build/html/objects.inv', None))} # References bibtex_bibfiles = ['../../shared/sundials.bib'] diff --git a/doc/kinsol/guide/source/sundials/index.rst b/doc/kinsol/guide/source/sundials/index.rst index 98fee06255..7d6842a46d 100644 --- a/doc/kinsol/guide/source/sundials/index.rst +++ b/doc/kinsol/guide/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 7dc83fc3a4..728d85a90a 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,5 +1,8 @@ **New Features** +Added CMake infrastructure that enables externally maintained addons/plugins +to be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. + **Bug Fixes** Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index d6d4435f45..8c2ed50c2e 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -639,6 +639,17 @@ illustration only. Error checks will impact performance, but can be helpful for debugging. +.. cmakeoption:: SUNDIALS_ENABLE_EXTERNAL_ADDONS + + Build SUNDIALS with any external addons that you have put in ``sundials/external``. + + Default: ``OFF`` + + .. warning:: + + Addons are not maintained by the SUNDIALS team. Use at your own risk. + + .. cmakeoption:: ENABLE_GINKGO Enable interfaces to the Ginkgo linear algebra library. @@ -2176,4 +2187,27 @@ The following command builds and installs SUNDIALS with MPI, HIP, and the Fortra # Need an allocation to run the tests: salloc -A <account> -t 10 -N 1 -p batch make test - make test_install_all \ No newline at end of file + make test_install_all + + +Building with SUNDIALS Addons +----------------------------- + +SUNDIALS "addons" are community developed code additions for SUNDIALS that can be subsumed by the +SUNDIALS build system so that they have full access to all internal SUNDIALS symbols. The intent is +for SUNDIALS addons to function as if they are part of the SUNDIALS library, while allowing them to +potentially have different licenses (although we encourage BSD-3-Clause still), code style (although +we encourage them to follow the SUNDIALS style outlined :ref:`here <Style>`). + +.. warning:: + + SUNDIALS addons are not maintained by the SUNDIALS team and may come with different + licenses. Use them at your own risk. + +To build with SUNDIALS addons, + +1. Clone/copy the addon(s) into ``<sundials root>/external/`` +2. Copy the ``sundials-addon-example`` block in the ``<sundials root>/external/CMakeLists.txt``, + paste it below the example block, and modify the path listed for your own external addon(s). +3. When building SUNDIALS, set the CMake option :cmakeop:`SUNDIALS_ENABLE_EXTERNAL_ADDONS` to `ON` +4. Build SUNDIALS as usual. diff --git a/doc/shared/sundials/index.rst b/doc/shared/sundials/index.rst index 712b2ca6c2..a38f7068e2 100644 --- a/doc/shared/sundials/index.rst +++ b/doc/shared/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -============== -Using SUNDIALS -============== +=============== +Getting Started +=============== As discussed in :numref:`Organization`, the six solver packages (CVODE(S), IDA(S), ARKODE, KINSOL) that make up SUNDIALS are built upon common diff --git a/doc/superbuild/source/contributing/index.rst b/doc/superbuild/source/contributing/index.rst new file mode 100644 index 0000000000..947443d9f5 --- /dev/null +++ b/doc/superbuild/source/contributing/index.rst @@ -0,0 +1,156 @@ +.. + ----------------------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ----------------------------------------------------------------------------- + +.. _Contributing: + +Contributing +============ + +There are two primary ways of contributing to SUNDIALS. The first way is by particpating +in the development of SUNDIALS directly through contributions of code to the primary +`SUNDIALS repository <https://github.com/LLNL/sundials>`_. This is the best way to contribute +bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources +to review and take in large additions to the code or significant new features. +Larger additions can be contributed as a SUNDIALS "addon" which is a component that may be +optionally downloaded by users and then compiled and installed with SUNDIALS. + +.. note:: + + New SUNDIALS developers should read the :ref:`Developer` guide for information on + how to participate in SUNDIALS development. + + +Direct Contributions via Pull Requests +-------------------------------------- + +Direct contributions to SUNDIALS are made by opening a :ref:`Pull Request <OpenPR>`. + +All new contributions to SUNDIALS must be made under the BSD 3-clause license. +The SUNDIALS team will not accept any file previously released under any other open +source license. By submitting code, the contributor gives irreversible consent +to the redistribution and/or modification of the contributed source code. + +Please ensure that any pull request includes user guide additions or changes as +appropriate, has been tested, and includes a test for any added features. + +Any added files submitted with a pull request must contain a header section at +the top including the originating author's name and file origin date as well as +a pointer to the SUNDIALS LICENSE and NOTICE files. + +The act of submitting a pull request (with or without an explicit Signed-off-by +tag) will be understood as an affirmation of the following `Developer's +Certificate of Origin (DCO) <http://developercertificate.org/>`_. + +.. code-block:: text + + Developer Certificate of Origin + Version 1.1 + + Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + 1 Letterman Drive + Suite D4700 + San Francisco, CA, 94129 + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + + + Developer's Certificate of Origin 1.1 + + By making a contribution to this project, I certify that: + + (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + + (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + + (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + + +The DCO lets us know that you are entitled to contribute this code to SUNDIALS and that you are +willing to have it used in distributions and derivative works. + +By including the DCO signature, you are stating that one or +more of the following is true of your contribution: + +1. You created this contribution/change and have the right to submit it + to SUNDIALS; or +2. You created this contribution/change based on a previous work with a + compatible open source license; or +3. This contribution/change has been provided to you by someone who did + 1 or 2 and you are submitting the contribution unchanged. +4. You understand this contribution is public and may be redistributed as + open source software under the BSD license. + +All commits submitted to the SUNDIALS project need to have the following sign +off line in the commit message: + +.. code-block:: text + + Signed-off-by: Jane Doe <jdoe@address.com> + + +Replacing Jane Doe’s details with your name and email address. + +If you've set ``user.name`` and ``user.email`` in your Git configuration, you can +automatically add a sign off line at the end of the commit message by using the +``-s`` option (e.g., ``git commit -s``). + + +Contributions via SUNDIALS Addons +--------------------------------- + +SUNDIALS "addons" are community developed code additions for SUNDIALS that can be subsumed by the +SUNDIALS build system so that they have full access to all internal SUNDIALS symbols. +The intent is for SUNDIALS addons to function as if they are part of the SUNDIALS library, +while allowing them to potentially have different licenses +(although we encourage BSD-3-Clause still), code style +(although we encourage them to follow the SUNDIALS style outlined :ref:`here <Style>`), +and they **are not maintained by the SUNDIALS team**. + +Creating an addon +^^^^^^^^^^^^^^^^^ + +To create a SUNDIALS addon and use it there are a few things you need to do: + +1. In your addon project, ensure that you have a ``CMakeLists.txt`` that uses the + ``sundials_add_library`` CMake macro to create the library target. The best thing to do is simply + copy from, or refer to, a ``CMakeLists.txt`` in the SUNDIALS ``src`` directory. +2. Follow the steps in the ``README.md`` file in the ``external/`` directory in the root of the SUNDIALS + source code. + +An example addon is available `here <https://github.com/sundials-codes/sundials-addon-example>`_. + +Friends of SUNDIALS +^^^^^^^^^^^^^^^^^^^ + +The SUNDIALS team maintains a list of some SUNDIALS addons in our `Friends of SUNDIALS +<https://github.com/sundials-codes/friends-of-sundials>`_ repository. These addons are not +maintained by the SUNDIALS team, but have been developed in consultation with us. +**Currently we are only adding projects for existing collaborations**. +Please contact the development team if you are interested in collaborating on an addon. diff --git a/doc/superbuild/source/developers/development/index.rst b/doc/superbuild/source/developers/development/index.rst deleted file mode 100644 index 9cf0a9e58b..0000000000 --- a/doc/superbuild/source/developers/development/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. - Author(s): David J. Gardner @ LLNL - ----------------------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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 - ----------------------------------------------------------------------------- - -.. _Development: - -Development -=========== - -.. toctree:: - :maxdepth: 1 - - Checklist diff --git a/doc/superbuild/source/developers/development/Checklist.rst b/doc/superbuild/source/developers/getting_started/Checklist.rst similarity index 100% rename from doc/superbuild/source/developers/development/Checklist.rst rename to doc/superbuild/source/developers/getting_started/Checklist.rst diff --git a/doc/superbuild/source/developers/getting_started/index.rst b/doc/superbuild/source/developers/getting_started/index.rst index 8893285692..8e9c004751 100644 --- a/doc/superbuild/source/developers/getting_started/index.rst +++ b/doc/superbuild/source/developers/getting_started/index.rst @@ -29,5 +29,6 @@ cloning the SUNDIALS repository. A list of helpful commands can be found in the Setup Workflow Documentation + Checklist .. Environment \ No newline at end of file diff --git a/doc/superbuild/source/developers/index.rst b/doc/superbuild/source/developers/index.rst index 7684262e78..f88f57bb12 100644 --- a/doc/superbuild/source/developers/index.rst +++ b/doc/superbuild/source/developers/index.rst @@ -12,9 +12,11 @@ SUNDIALS Copyright End ----------------------------------------------------------------------------- -**************** -Developers Guide -**************** +.. _Developer: + +*************** +Developer Guide +*************** The SUite of Nonlinear and DIfferential/ALgebraic equation Solvers (SUNDIALS) consists of the time integration packages CVODE, IDA, and ARKODE, the sensitivity analysis enabled variants CVODES and @@ -27,7 +29,6 @@ meant for SUNDIALS developers. History getting_started/index style_guide/index - development/index testing/index benchmarks/index pull_requests/index diff --git a/doc/superbuild/source/developers/pull_requests/OpenPR.rst b/doc/superbuild/source/developers/pull_requests/OpenPR.rst index fb0c5e3d7c..71ddd39ee1 100644 --- a/doc/superbuild/source/developers/pull_requests/OpenPR.rst +++ b/doc/superbuild/source/developers/pull_requests/OpenPR.rst @@ -17,7 +17,7 @@ Opening a Pull Request ====================== -When a branch is ready to be reviewed for integration into the ``master`` or +When a branch is ready to be reviewed for integration into the ``main`` or ``develop`` branches follow the steps below to open a pull request: #. Browse to `https://github.com/LLNL/sundials <https://github.com/LLNL/sundials>`_ @@ -43,3 +43,10 @@ merged, delete the local copy the branch: $ git checkout PARENT $ git branch -D <branch-name> + + +.. warning:: + + Almost all pull requests should be issued against the ``develop`` branch. + Generally, the only branches we merge to ``main`` are special PRs to synchronize + ``develop`` and ``main``. \ No newline at end of file diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 28e6196c47..7c7b84e0ae 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -20,13 +20,18 @@ Naming All exported symbols that will be publically available must be namespaced appropriately! -- ``SUN_`` or ``SUNDIALS_`` for macros -- ``sun`` for typedef's to native types (e.g., ``sunindextype``) -- ``SUN`` for public functions that are not class functions (see - :numref:`Style.Classes` for class/struct naming conventions) -- ``sun`` for private functions that are non-native. -- ``sundials::`` for C++ code (nesting under `sundials::` is OK) -- ``sundials::<somename>::impl`` for C++ code that is private (implementation +* ``SUN_`` or ``SUNDIALS_`` for macros + +* ``sun`` for typedef's to native types (e.g., ``sunindextype``) + +* ``SUN`` for public functions that are not class functions (see + below for class/struct naming conventions) + +* ``sun`` for private functions that are non-native. + +* ``sundials::`` for C++ code (nesting under `sundials::` is OK) + +* ``sundials::<somename>::impl`` for C++ code that is private (implementation only) Generally Pascal case (e.g. ``DoSomething``) is used for public names and @@ -184,8 +189,9 @@ Coding Conventions and Rules #. Comments should use proper spelling and grammar. -#. Following the Google Style Guide [GoogleStyle]_, TODO comments are used to note - code that is "temporary, a short-term solution, or good-enough but not perfect." +#. Following the `Google Style Guide <https://google.github.io/styleguide/cppguide.html>`_, + TODO comments are used to note code that is "temporary, a short-term solution, + or good-enough but not perfect." A consistent TODO comment format provides an easy to search for keyword with details on how to get more information. TODO comments should start with ``TODO`` @@ -369,7 +375,7 @@ Clang-format might produce something like: MyObject::callAFunctionOfSorts().doSomething().doAnotherThing() .doSomethingElse(); -``` + unless you add the `//`. @@ -402,30 +408,3 @@ There are other scenarios (e.g., a function call with a lot of parameters) where .. }; .. See the clang-tidy documentation for more details. - -Indentation -^^^^^^^^^^^ - -Spaces not tabs - -Comments --------- - -TODO Comments -^^^^^^^^^^^^^ - -Following the `Google Style Guide <https://google.github.io/styleguide/>`_ , TODO comments are used -to note code that is "temporary, a short-term solution, or good-enough but not perfect." - -A consistent TODO comment format provides an easy to search for keyword with details on how to get -more information. TODO comments should start with ``TODO`` followed by a unique identifier, enclosed -in parentheses, for the person most knowledgeable about the issue and a brief description of the -TODO item. Generally, these comments should be used sparingly and are not a substitute for creating -an issue or bug report. When applicable, the comment should include the relevant issue or bug report -number. - -Examples: - -.. code-block:: c - - /* TODO(DJG): Update to new API in the next major release (Issue #256) */ diff --git a/doc/superbuild/source/developers/testing/Spot.rst b/doc/superbuild/source/developers/testing/Spot.rst index f051e8f94e..35d807e462 100644 --- a/doc/superbuild/source/developers/testing/Spot.rst +++ b/doc/superbuild/source/developers/testing/Spot.rst @@ -64,45 +64,59 @@ true sum of the results. **Advection Reaction 3D** -- `All configurations <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D&ch_executable=1&ch_launchdate=1&groupby=cmdline&yaxis=Max%20time%2Frank&aggregate=avg>`_ - -- By configuration - - - Serial - - `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_arkdirk_newton&ch_executable=1&ch_launchdate=1&aggregate=&yaxis=Max%20time%2Frank&groupby=cluster>`_ - - `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`_ - - `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`_ - - `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`_ - - CUDA - - `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_arkdirk_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - HIP - - `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_arkdirk_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ - - `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ +* `All configurations <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D&ch_executable=1&ch_launchdate=1&groupby=cmdline&yaxis=Max%20time%2Frank&aggregate=avg>`__ + +* By configuration + + * Serial + + * `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_arkdirk_newton&ch_executable=1&ch_launchdate=1&aggregate=&yaxis=Max%20time%2Frank&groupby=cluster>`__ + + * `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`__ + + * `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`__ + + * `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank&groupby=cluster>`__ + + * CUDA + + * `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_arkdirk_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpicuda_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * HIP + + * `ARK-DIRK, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_arkdirk_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `ARK-IMEX, TL-Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_arkimex_tlnewton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `CV-BDF, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_cvbdf_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ + + * `IDA, Newton <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/advection_reaction_3D/advection_reaction_3D_raja_mpihip_ida_newton&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ **Diffusion 2D** Note: CUDA Diffusion 2D visualizations are not available as the benchmark errors out before completion. -- `All configurations <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D&ch_executable=1&ch_launchdate=1&groupby=executable&yaxis=Max%20time%2Frank&aggregate=avg>`_ +* `All configurations <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D&ch_executable=1&ch_launchdate=1&groupby=executable&yaxis=Max%20time%2Frank&aggregate=avg>`__ -- MPI + Serial +* MPI + Serial - - `ARKODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/arkode_diffusion_2D_mpi_d2d_arkode_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ + * `ARKODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/arkode_diffusion_2D_mpi_d2d_arkode_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ - - `CVODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/cvode_diffusion_2D_mpi_d2d_cvode_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ + * `CVODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/cvode_diffusion_2D_mpi_d2d_cvode_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ - - `IDA <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/ida_diffusion_2D_mpi_d2d_ida_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`_ + * `IDA <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/ida_diffusion_2D_mpi_d2d_ida_serial&ch_executable=1&ch_launchdate=1&yaxis=Max%20time%2Frank>`__ -- MPI + HIP +* MPI + HIP - - `ARKODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/arkode_diffusion_2D_mpihip_d2d_arkode_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`_ + * `ARKODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/arkode_diffusion_2D_mpihip_d2d_arkode_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`__ - - `CVODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/cvode_diffusion_2D_mpihip_d2d_cvode_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`_ + * `CVODE <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/cvode_diffusion_2D_mpihip_d2d_cvode_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`__ - - `IDA <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/ida_diffusion_2D_mpihip_d2d_ida_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`_ \ No newline at end of file + * `IDA <https://lc.llnl.gov/spot2/?sf=/usr/workspace/sundials/califiles/Benchmarking/diffusion_2D/ida_diffusion_2D_mpihip_d2d_ida_hip&ch_executable=1&ch_launchdate=1&aggregate=max>`__ diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 64b32504a0..a69c0c8ed7 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -12,32 +12,9 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -###################### -SUNDIALS Documentation -###################### - -.. toctree:: - :maxdepth: 1 - :numbered: - :hidden: - - sundials/index.rst - arkode/index.rst - cvode/index.rst - cvodes/index.rst - ida/index.rst - idas/index.rst - kinsol/index.rst - nvectors/index.rst - sunmatrix/index.rst - sunlinsol/index.rst - sunnonlinsol/index.rst - sunadaptcontroller/index.rst - sunmemory/index.rst - History_link.rst - Changelog_link.rst - developers/index.rst - References +######## +SUNDIALS +######## The `SUNDIALS <https://computing.llnl.gov/projects/sundials>`_ library of time integrators and nonlinear solvers provides robust and efficient numerical @@ -177,3 +154,41 @@ SUNDIALS License and Notices ============================ .. include:: ../../shared/LicenseReleaseNumbers.rst + + +.. toctree:: + :caption: USAGE + :maxdepth: 1 + :numbered: + :hidden: + + sundials/index.rst + arkode/index.rst + cvode/index.rst + cvodes/index.rst + ida/index.rst + idas/index.rst + kinsol/index.rst + nvectors/index.rst + sunmatrix/index.rst + sunlinsol/index.rst + sunnonlinsol/index.rst + sunadaptcontroller/index.rst + sunmemory/index.rst + History_link.rst + Changelog_link.rst + +.. toctree:: + :caption: DEVELOPMENT + :maxdepth: 1 + :hidden: + + developers/index.rst + contributing/index.rst + +.. toctree:: + :caption: REFERENCES + :maxdepth: 1 + :hidden: + + References \ No newline at end of file diff --git a/doc/superbuild/source/sundials/index.rst b/doc/superbuild/source/sundials/index.rst index 9ae91fe09a..37384a534e 100644 --- a/doc/superbuild/source/sundials/index.rst +++ b/doc/superbuild/source/sundials/index.rst @@ -12,9 +12,9 @@ .. _SUNDIALS: -************** -Using SUNDIALS -************** +*************** +Getting Started +*************** The packages that make up SUNDIALS are built upon shared classes for vectors, matrices, and algebraic solvers. In addition, the packages all leverage some diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 0000000000..4f4bc0edb5 --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- + +# Steps to add an external addon to SUNDIALS: +# WARNING: external addons are not maintained by the SUNDIALS team +# and may come with their own license with different rules. +# +# 1. Clone/copy the addon into <sundials root>/external/ +# (the same directory as this file you are reading). +# 2. Copy the sundials-addon-example block for your own external project. +# 3. When building SUNDIALS, set the CMake option SUNDIALS_ENABLE_EXTERNAL_ADDONS to ON +# 4. Build SUNDIALS as usual. + +include(FetchContent) + +# COPY THE FetchContent BLOCK BELOW FOR YOUR OWN EXTERNAL ADDON +# COMMENT THESE LINES OUT TO DISABLE THE EXAMPLE ADDON +FetchContent_Declare(sundials-addon-example + SOURCE_DIR ${PROJECT_SOURCE_DIR}/external/sundials-addon-example +) +FetchContent_MakeAvailable(sundials-addon-example) +# COPY THE BLOCK ABOVE FOR YOUR OWN EXTERNAL ADDON diff --git a/external/README.md b/external/README.md new file mode 100644 index 0000000000..4733dcfe50 --- /dev/null +++ b/external/README.md @@ -0,0 +1,6 @@ +External Addons for SUNDIALS +============================ + +This directory is a place to clone in externally maintained addons for SUNDIALS, such as the ones in [Friends of SUNDIALS](https://github.com/sundials-codes/friends-of-sundials). + +Codes in this directory are not maintained by the SUNDIALS team. Consult with the maintainers of the external package for licensure information, documentation, and help with the package. diff --git a/external/sundials-addon-example b/external/sundials-addon-example new file mode 160000 index 0000000000..ff9a45d82c --- /dev/null +++ b/external/sundials-addon-example @@ -0,0 +1 @@ +Subproject commit ff9a45d82c12f24c9363185e4149a9ca97906ed1 diff --git a/scripts/shared b/scripts/shared index 458d14a380..fb6a1e0079 100755 --- a/scripts/shared +++ b/scripts/shared @@ -101,3 +101,6 @@ $tar $tarfile $distrobase/test/unit_tests/CMakeLists.txt $tar $tarfile $distrobase/test/unit_tests/profiling $tar $tarfile $distrobase/test/unit_tests/sunmemory $tar $tarfile $distrobase/test/unit_tests/sundials + +echo " --- Add external files to $tarfile" +$tar $tarfile $distrobase/external diff --git a/scripts/tarscript b/scripts/tarscript index ef9aa85f1e..8b64d9dd16 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -260,6 +260,8 @@ cp -r $sundialsdir/src/sunadaptcontroller $tmpdir/src/ cp $sundialsdir/test/testRunner $tmpdir/test/ cp -r $sundialsdir/test/unit_tests $tmpdir/test/ +cp -r $sundialsdir/external $tmpdir/ + # Clean up tmpdir rm -rf $tmpdir/doc/shared/__pycache__ find $tmpdir -name "*~" -delete From d6380baf49abda062249b449afc5ce2d1564061d Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Wed, 17 Apr 2024 07:16:09 -0700 Subject: [PATCH 027/137] Bugfix: Make MRI step fail when inner stepper has a recoverable error (#456) Fixes a bug where an MRI method would use the (likely corrupted) result of an inner stepper which returned with a recoverable error. Once adaptivity is supported, this could be handled similarly to ARK methods. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/arkode/arkode_mristep.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 696e4b908a..588038928e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argumen to a function pointer instead of `c_null_funptr`. This caused compilation issues with the Cray Fortran compiler. +Fixed a bug where `MRIStepEvolve` would not handle a recoverable error produced +from evolving the inner stepper. + Added CMake infrastructure that enables externally maintained addons/plugins to be *optionally* built with SUNDIALS. See the [Contributing Guide](./CONTRIBUTING.md) for more details. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 728d85a90a..f8e4a1c045 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -19,3 +19,6 @@ instead of ``SameMajorVersion``. This fixes the issue seen Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an argument to a function pointer instead of ``c_null_funptr``. This caused compilation issues with the Cray Fortran compiler. + +Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error +produced from evolving the inner stepper. diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 25d1620834..c637516aa8 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -2139,7 +2139,7 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) /* advance inner method in time */ retval = mriStepInnerStepper_Evolve(step_mem->stepper, t0, ark_mem->tcur, ark_mem->ycur); - if (retval < 0) { return (ARK_INNERSTEP_FAIL); } + if (retval != 0) { return (ARK_INNERSTEP_FAIL); } /* post inner evolve function (if supplied) */ if (step_mem->post_inner_evolve) From 4ee5757b046b3dfbea94e496b72e94e5a4b196f6 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 19 Apr 2024 11:09:48 -0700 Subject: [PATCH 028/137] Add ARKODE unit test for number of mass matrix solves (#458) Replaces #375 which has become too outdated to easily merge develop into. --- .../unit_tests/arkode/C_serial/CMakeLists.txt | 1 + .../arkode/C_serial/ark_test_mass.c | 380 ++++++++++++++++++ 2 files changed, 381 insertions(+) create mode 100644 test/unit_tests/arkode/C_serial/ark_test_mass.c diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index 8f537fc83b..720e4e6019 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -30,6 +30,7 @@ set(ARKODE_unit_tests "ark_test_interp\;-100" "ark_test_interp\;-10000" "ark_test_interp\;-1000000" + "ark_test_mass\;" "ark_test_reset\;" "ark_test_tstop\;" ) diff --git a/test/unit_tests/arkode/C_serial/ark_test_mass.c b/test/unit_tests/arkode/C_serial/ark_test_mass.c new file mode 100644 index 0000000000..586028cd1c --- /dev/null +++ b/test/unit_tests/arkode/C_serial/ark_test_mass.c @@ -0,0 +1,380 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Steven Roberts @ 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 that checks the number of mass matrix solves taken in 1 step of an + * ARKODE integrator. + * ---------------------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> + +#include "arkode/arkode_arkstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_math.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunmatrix/sunmatrix_dense.h" +#include "sunnonlinsol/sunnonlinsol_newton.h" + +/* A simple nonlinear RHS function */ +static int f_explicit(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VProd(y, y, ydot); + return 0; +} + +/* A simple nonlinear RHS function */ +static int f_implicit(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VInv(y, ydot); + return 0; +} + +/* A simple mass matrix which can be fixed or time-dependent based on user + * data */ +static int mass(sunrealtype t, SUNMatrix mass, void* user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3) +{ + sunbooleantype time_dep = *(sunbooleantype*)user_data; + SM_ELEMENT_D(mass, 0, 0) = time_dep ? SUNRexp(t) : 2.0; + return 0; +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a value so check if + retval >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +int solve(const char* im, const char* ex, int steps, sunbooleantype time_dep, + sunbooleantype deduce_implicit_rhs, long int expected_mass_solves) +{ + int retval = 0; + int s; + sunrealtype t = 1.0; + SUNContext sunctx = NULL; + N_Vector y = NULL; + SUNMatrix jacobian_mat = NULL; + SUNMatrix mass_mat = NULL; + SUNLinearSolver jacobian_ls = NULL; + SUNLinearSolver mass_ls = NULL; + SUNNonlinearSolver nls = NULL; + void* arkode_mem = NULL; + long int actual_mass_solves; + + /* Create the SUNDIALS context object for this simulation. */ + retval = SUNContext_Create(SUN_COMM_NULL, &sunctx); + if (check_retval(&retval, "SUNContext_Create", 1)) return 1; + + /* Create solution vector */ + y = N_VNew_Serial(1, sunctx); + if (check_retval(y, "N_VNew_Serial", 0)) return 1; + N_VConst(1.0, y); + + /* Create the matrices */ + jacobian_mat = SUNDenseMatrix(1, 1, sunctx); + if (check_retval(jacobian_mat, "N_VNew_Serial", 0)) return 1; + + mass_mat = SUNDenseMatrix(1, 1, sunctx); + if (check_retval(mass_mat, "N_VNew_Serial", 0)) return 1; + + /* Create ARKODE mem structure */ + arkode_mem = ARKStepCreate(f_explicit, f_implicit, 0.0, y, sunctx); + if (check_retval(arkode_mem, "ARKStepCreate", 0)) return 1; + + retval = ARKStepSetTableName(arkode_mem, im, ex); + if (check_retval(&retval, "ARKStepSetTableNum", 1)) return 1; + + retval = ARKStepSetUserData(arkode_mem, &time_dep); + if (check_retval(&retval, "ARKStepSetUserData", 1)) return 1; + + /* Specify a time step so no extra mass evaluations occur from initial step + * size procedure */ + retval = ARKStepSetInitStep(arkode_mem, 0.01); + if (check_retval(&retval, "ARKStepSetInitStep", 1)) return 1; + + /* Use Lagrange interpolation because Hermite may need addition mass matrix + * solves to compute the interpolant */ + retval = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + if (check_retval(&retval, "ARKStepSetInterpolantType", 1)) return 1; + + /* Configure the solvers */ + jacobian_ls = SUNLinSol_Dense(y, jacobian_mat, sunctx); + if (check_retval(jacobian_ls, "SUNLinSol_Dense", 0)) return 1; + + retval = ARKStepSetLinearSolver(arkode_mem, jacobian_ls, jacobian_mat); + if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) return 1; + + mass_ls = SUNLinSol_Dense(y, mass_mat, sunctx); + if (check_retval(mass_ls, "SUNLinSol_Dense", 0)) return 1; + + retval = ARKStepSetMassLinearSolver(arkode_mem, mass_ls, mass_mat, time_dep); + if (check_retval(&retval, "ARKStepSetMassLinearSolver", 0)) return 1; + + nls = SUNNonlinSol_Newton(y, sunctx); + if (check_retval(nls, "SUNNonlinSol_Newton", 0)) return 1; + + retval = ARKStepSetDeduceImplicitRhs(arkode_mem, deduce_implicit_rhs); + if (check_retval(&retval, "ARKStepSetDeduceImplicitRhs", 1)) return 1; + + /* Let ARKODE estimate the Jacobian with finite differences */ + retval = ARKStepSetJacFn(arkode_mem, NULL); + if (check_retval(&retval, "ARKStepSetJacFn", 1)) return 1; + + retval = ARKStepSetMassFn(arkode_mem, mass); + if (check_retval(&retval, "ARKStepSetMassFn", 1)) return 1; + + /* Take time step(s) */ + for (s = 0; s < steps; s++) + { + retval = ARKStepEvolve(arkode_mem, t, y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKStepEvolve", 1)) return 1; + } + + retval = ARKStepGetNumMassSolves(arkode_mem, &actual_mass_solves); + if (check_retval(&retval, "ARKStepGetNumMassSolves", 1)) return 1; + + /* Free integrator memory */ + ARKStepFree(&arkode_mem); + + /* Clean up */ + N_VDestroy(y); + SUNMatDestroy(jacobian_mat); + SUNMatDestroy(mass_mat); + SUNLinSolFree(jacobian_ls); + SUNLinSolFree(mass_ls); + SUNNonlinSolFree(nls); + SUNContext_Free(&sunctx); + + retval = actual_mass_solves != expected_mass_solves; + printf("%6s | %-29s| %-30s| %-6d| %-9s| %-14s| %-7ld| %-9ld\n", + retval ? "Fail" : "Pass", im, ex, steps, time_dep ? "Yes" : "No ", + deduce_implicit_rhs ? "Yes" : "No ", actual_mass_solves, + expected_mass_solves); + return retval; +} + +/* Main program */ +int main(int argc, char* argv[]) +{ + int retval = 0; + + printf("Mass Matrix Solve Count Test\n\n"); + printf("Result | Implicit Method | Explicit Method " + " | Steps | Time-Dep | Deduce Im RHS | Actual | Expected\n"); + printf("-------+------------------------------+------------------------------" + "-+-------+----------+---------------+--------+---------\n"); + + /* Tests taking 1 timestep */ + + /* SDIRK */ + /* 1 for primary and 1 for embedded solution. Optimally, could be 0 solves */ + retval += solve("ARKODE_SDIRK_2_1_2", "ARKODE_ERK_NONE", 1, SUNFALSE, + SUNFALSE, 2); + /* 1 for primary and 1 for embedded solution. Optimally, could be 0 solves */ + retval += solve("ARKODE_SDIRK_2_1_2", "ARKODE_ERK_NONE", 1, SUNFALSE, SUNTRUE, + 2); + /* 1 per stage */ + retval += solve("ARKODE_SDIRK_2_1_2", "ARKODE_ERK_NONE", 1, SUNTRUE, SUNFALSE, + 2); + /* Optimal */ + retval += solve("ARKODE_SDIRK_2_1_2", "ARKODE_ERK_NONE", 1, SUNTRUE, SUNTRUE, + 0); + + /* Stiffly-accurate SDIRK */ + /* 1 for embedded solution. 0 needed for primary due to stiff accuracy + * property. Optimally, could be 0 solves */ + retval += solve("ARKODE_SDIRK_5_3_4", "ARKODE_ERK_NONE", 1, SUNFALSE, + SUNFALSE, 1); + /* 1 for embedded solution. 0 needed for primary due to stiff accuracy + * property. Optimally, could be 0 solves */ + retval += solve("ARKODE_SDIRK_5_3_4", "ARKODE_ERK_NONE", 1, SUNFALSE, SUNTRUE, + 1); + /* 1 per stage */ + retval += solve("ARKODE_SDIRK_5_3_4", "ARKODE_ERK_NONE", 1, SUNTRUE, SUNFALSE, + 5); + /* Optimal */ + retval += solve("ARKODE_SDIRK_5_3_4", "ARKODE_ERK_NONE", 1, SUNTRUE, SUNTRUE, + 0); + + /* FSAL ESDIRK */ + /* 1 for embedded solution. 0 needed for primary due to FSAL property. The + * first step is computing y'_0 = M^{-1} f(y_0), which is needed for Hermite + * interpolation, but not Lagrange. Practically, could be 1 solve. Technically + * the optimal is 0 solves if we express embedded solution as linear + * combination of Y_i. This requires d to be in the rowspace of A. Since this + * method has the FSAL property this small optimization would only save 1 + * solve on the first step. */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 1, SUNFALSE, + SUNFALSE, 2); + /* Same comment as previous */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 1, SUNFALSE, + SUNTRUE, 2); + /* 1 per stage */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 1, SUNTRUE, + SUNFALSE, 4); + /* Optimal */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 1, SUNTRUE, + SUNTRUE, 1); + + /* ERK */ + /* 1 per stage, 1 for primary solution, and 1 for embedded solution. + * Optimally, could be 3 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_SHU_OSHER_3_2_3", 1, SUNFALSE, + SUNFALSE, 5); + /* 1 per stage, 1 for primary solution, and 1 for embedded solution. + * Optimally, could be 3 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_SHU_OSHER_3_2_3", 1, SUNFALSE, + SUNTRUE, 5); + /* 1 per stage. Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_SHU_OSHER_3_2_3", 1, SUNTRUE, + SUNFALSE, 3); + /* 1 per stage. Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_SHU_OSHER_3_2_3", 1, SUNTRUE, + SUNTRUE, 3); + + /* FSAL ERK */ + /* 1 per stage and 1 for embedded solution. 0 needed for primary due to FSAL + * property. Optimally, could be 4 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 1, + SUNFALSE, SUNFALSE, 5); + /* 1 per stage and 1 for embedded solution. 0 needed for primary due to FSAL + * property. Optimally, could be 4 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 1, + SUNFALSE, SUNTRUE, 5); + /* 1 per stage. Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 1, + SUNTRUE, SUNFALSE, 4); + /* 1 per stage. Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 1, + SUNTRUE, SUNTRUE, 4); + + /* IMEX 1 */ + /* 1 for primary solution and 1 for embedded solution. The first step is + * computing y'_0 = M^{-1} f(y_0), which is needed for Hermite interpolation, + * but not Lagrange. Optimally, could be 2 solves */ + retval += solve("ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ARK2_ERK_3_1_2", 1, + SUNFALSE, SUNFALSE, 3); + /* Same comment as previous */ + retval += solve("ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ARK2_ERK_3_1_2", 1, + SUNFALSE, SUNTRUE, 3); + /* 1 per implicit and explicit stage */ + retval += solve("ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ARK2_ERK_3_1_2", 1, SUNTRUE, + SUNFALSE, 6); + /* 1 per explicit stage and 1 for the first stage of implicit method. + * Optimal */ + retval += solve("ARKODE_ARK2_DIRK_3_1_2", "ARKODE_ARK2_ERK_3_1_2", 1, SUNTRUE, + SUNTRUE, 4); + + /* IMEX 2 */ + /* 1 for primary solution and 1 for embedded solution. The first step is + * computing y'_0 = M^{-1} f(y_0), which is needed for Hermite interpolation, + * but not Lagrange. Optimally, could be 2 solves */ + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 1, SUNFALSE, SUNFALSE, 3); + /* Same comment as previous */ + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 1, SUNFALSE, SUNTRUE, 3); + /* 1 per implicit and explicit stage */ + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 1, SUNTRUE, SUNFALSE, 16); + /* 1 per explicit stage and 1 for the first stage of implicit method. + * Optimal */ + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 1, SUNTRUE, SUNTRUE, 9); + + /* 2 timestep tests to check FSAL optimizations. This assumes there are no + * rejected steps */ + + /* FSAL ESDIRK */ + /* 2 per step. The fixed mass matrix implementation cannot benefit from the + * FSAL property */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 2, SUNFALSE, + SUNFALSE, 4); + /* 2 per step. The fixed mass matrix implementation cannot benefit from the + * FSAL property */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 2, SUNFALSE, + SUNTRUE, 4); + /* 1 per stage except the first stage of step 2 due to FSAL optimization */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 2, SUNTRUE, + SUNFALSE, 7); + /* Optimal */ + retval += solve("ARKODE_ESDIRK324L2SA_4_2_3", "ARKODE_ERK_NONE", 2, SUNTRUE, + SUNTRUE, 1); + + /* FSAL ERK */ + /* 1 per stage and 1 for embedded solution. 0 needed for primary due to FSAL + * property. Optimally, could be 7 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 2, + SUNFALSE, SUNFALSE, 10); + /* 1 per stage and 1 for embedded solution. 0 needed for primary due to FSAL + * property. Optimally, could be 7 solves */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 2, + SUNFALSE, SUNTRUE, 10); + /* Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 2, + SUNTRUE, SUNFALSE, 7); + /* Optimal */ + retval += solve("ARKODE_DIRK_NONE", "ARKODE_BOGACKI_SHAMPINE_4_2_3", 2, + SUNTRUE, SUNTRUE, 7); + + /* IMEX */ + /* While the implicit part has the FSAL property, the overall IMEX method does + * not. The mass solves are all double the 1 step results */ + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 2, SUNFALSE, SUNFALSE, 6); + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 2, SUNFALSE, SUNTRUE, 6); + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 2, SUNTRUE, SUNFALSE, 32); + retval += solve("ARKODE_ARK548L2SA_DIRK_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + 2, SUNTRUE, SUNTRUE, 18); + + return retval; +} From a576a5b4284bae13ae09f440e07909a705ebf72c Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 24 Apr 2024 13:43:32 -0700 Subject: [PATCH 029/137] Feature: Support Kokkos Kernels v4 (#460) --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 2 ++ include/sunmatrix/sunmatrix_kokkosdense.hpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 588038928e..405fa61008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ Added CMake infrastructure that enables externally maintained addons/plugins to be *optionally* built with SUNDIALS. See the [Contributing Guide](./CONTRIBUTING.md) for more details. +Added support for Kokkos Kernels v4. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index f8e4a1c045..6787821567 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -22,3 +22,5 @@ with the Cray Fortran compiler. Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error produced from evolving the inner stepper. + +Added support for Kokkos Kernels v4. diff --git a/include/sunmatrix/sunmatrix_kokkosdense.hpp b/include/sunmatrix/sunmatrix_kokkosdense.hpp index b2b82adc57..d172ba73df 100644 --- a/include/sunmatrix/sunmatrix_kokkosdense.hpp +++ b/include/sunmatrix/sunmatrix_kokkosdense.hpp @@ -210,7 +210,11 @@ SUNErrCode SUNMatMatvec_KokkosDense(SUNMatrix A, N_Vector x, N_Vector y) Kokkos::subview(y_data, Kokkos::pair<size_type, size_type>(idx * rows, (idx + 1) * rows)); +#if KOKKOSKERNELS_VERSION_MAJOR > 3 + KokkosBlas::TeamVectorGemv< +#else KokkosBatched::TeamVectorGemv< +#endif member_type, KokkosBatched::Trans::NoTranspose, KokkosBatched::Algo::Gemv::Unblocked>::invoke(team_member, SUN_RCONST(1.0), From 9d1ac8cafd99bc13ee5daac1279e54786f0db3e1 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Fri, 26 Apr 2024 12:34:10 -0700 Subject: [PATCH 030/137] Bugfix: Truncated error messages (#462) Fixed a bug that caused error messages to be cut off in some cases. Fixes #461 --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 2 ++ src/arkode/arkode.c | 13 ++++++++----- src/cvode/cvode.c | 13 ++++++++----- src/cvodes/cvodes.c | 13 ++++++++----- src/ida/ida.c | 13 ++++++++----- src/idas/idas.c | 13 ++++++++----- src/kinsol/kinsol.c | 13 ++++++++----- 8 files changed, 52 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 405fa61008..3535e8202d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ for more details. Added support for Kokkos Kernels v4. +Fixed a bug that caused error messages to be cut off in some cases. Fixes [GitHub Issue #461](https://github.com/LLNL/sundials/issues/461). + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 6787821567..b6b4fb00b3 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -24,3 +24,5 @@ Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error produced from evolving the inner stepper. Added support for Kokkos Kernels v4. + +Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index eac2af4222..ad7e70e554 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -3325,15 +3325,20 @@ int arkAccessHAdaptMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, void arkProcessError(ARKodeMem ark_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to arkProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (ark_mem == NULL) @@ -3361,8 +3366,6 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, int line, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 1bb942b264..379c0fa0c2 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -4824,15 +4824,20 @@ static int cvEwtSetSV(CVodeMem cv_mem, N_Vector ycur, N_Vector weight) void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to cvProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (cv_mem == NULL) @@ -4860,8 +4865,6 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index ec31375447..4e2ac40d00 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -9908,15 +9908,20 @@ static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, sunrealtype t, void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to cvProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (cv_mem == NULL) @@ -9944,8 +9949,6 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; diff --git a/src/ida/ida.c b/src/ida/ida.c index 523675422e..ea06a7a0b3 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -3992,15 +3992,20 @@ static int IDARootfind(IDAMem IDA_mem) void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to IDAProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (IDA_mem == NULL) @@ -4028,8 +4033,6 @@ void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; diff --git a/src/idas/idas.c b/src/idas/idas.c index d42aebab2c..1cf688a5d0 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -8756,15 +8756,20 @@ static int IDAQuadSensRhs1InternalDQ(IDAMem IDA_mem, int is, sunrealtype t, void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to IDAProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (IDA_mem == NULL) @@ -8792,8 +8797,6 @@ void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 205ffbc8f0..982e9e9f2e 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -2563,15 +2563,20 @@ void KINPrintInfo(KINMem kin_mem, int info_code, const char* module, void KINProcessError(KINMem kin_mem, int error_code, int line, const char* func, const char* file, const char* msgfmt, ...) { - /* Initialize the argument pointer variable + /* We initialize the argument pointer variable before each vsnprintf call to avoid undefined behavior (msgfmt is the last required argument to KINProcessError) */ va_list ap; - va_start(ap, msgfmt); /* Compose the message */ + va_start(ap, msgfmt); size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; - char* msg = (char*)malloc(msglen); + va_end(ap); + + char* msg = (char*)malloc(msglen); + + va_start(ap, msgfmt); vsnprintf(msg, msglen, msgfmt, ap); + va_end(ap); do { if (kin_mem == NULL) @@ -2599,8 +2604,6 @@ void KINProcessError(KINMem kin_mem, int error_code, int line, const char* func, } while (0); - /* Finalize argument processing */ - va_end(ap); free(msg); return; From 15c94cf61e99ba5e3e7a4d589db2ce5f59323cfe Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 3 May 2024 00:11:23 -0400 Subject: [PATCH 031/137] Docs: Fix signature of SUNErrHandlerFn (#465) --- doc/shared/sundials/Errors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/sundials/Errors.rst b/doc/shared/sundials/Errors.rst index 3b5c6a8748..20cbcc5405 100644 --- a/doc/shared/sundials/Errors.rst +++ b/doc/shared/sundials/Errors.rst @@ -96,7 +96,7 @@ Specific error handlers can be enabled by pushing them onto the error handler st with the function :c:func:`SUNContext_PushErrHandler`. They may disabled by calling :c:func:`SUNContext_PopErrHandler` or :c:func:`SUNContext_ClearErrHandlers`. A SUNDIALS error handler function has the type -.. c:type:: int (*SUNErrHandlerFn)(int line, const char* func, const char* file, \ +.. c:type:: void (*SUNErrHandlerFn)(int line, const char* func, const char* file, \ const char* msg, SUNErrCode err_code, \ void* err_user_data, SUNContext sunctx) From 149d3b316b4646a55fe7937c43e56565cc054fe8 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 3 May 2024 12:11:00 -0400 Subject: [PATCH 032/137] Bugfix: Fix error handler memory leak (#467) Fixes memory leak when multiple error handlers are attached. Fixes #446 --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 3 +++ src/sundials/sundials_context.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3535e8202d..d62bdf8087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ Added support for Kokkos Kernels v4. Fixed a bug that caused error messages to be cut off in some cases. Fixes [GitHub Issue #461](https://github.com/LLNL/sundials/issues/461). +Fixed a memory leak when an error handler was added to a `SUNContext`. Fixes [GitHub Issue #466](https://github.com/LLNL/sundials/issues/466). + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index b6b4fb00b3..7d204c8189 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -26,3 +26,6 @@ produced from evolving the inner stepper. Added support for Kokkos Kernels v4. Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. + +Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 <https://github.com/LLNL/sundials/issues/466>`_. + diff --git a/src/sundials/sundials_context.c b/src/sundials/sundials_context.c index f031dea4f0..b3c847e682 100644 --- a/src/sundials/sundials_context.c +++ b/src/sundials/sundials_context.c @@ -285,7 +285,7 @@ SUNErrCode SUNContext_Free(SUNContext* sunctx) SUNLogger_Destroy(&(*sunctx)->logger); } - SUNErrHandler_Destroy(&(*sunctx)->err_handler); + SUNContext_ClearErrHandlers(*sunctx); free(*sunctx); *sunctx = NULL; From c73781ce55de9a09abdc7bc693dae47adbe12154 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Mon, 6 May 2024 19:15:01 -0700 Subject: [PATCH 033/137] Bugfix: C++ MPI linking errors (#469) Fix a CMake bug that causes an MPI linking error in some C++ examples. Fixes #464 --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 1 + src/sundials/CMakeLists.txt | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d62bdf8087..5dbe1e2ec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Fixed a bug that caused error messages to be cut off in some cases. Fixes [GitHu Fixed a memory leak when an error handler was added to a `SUNContext`. Fixes [GitHub Issue #466](https://github.com/LLNL/sundials/issues/466). +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes [GitHub Issue #464](https://github.com/LLNL/sundials/issues/464). + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 7d204c8189..ccf3d01e17 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -29,3 +29,4 @@ Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHu Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 <https://github.com/LLNL/sundials/issues/466>`_. +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 <https://github.com/LLNL/sundials/issues/464>`_. \ No newline at end of file diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index 46bab728ef..8c91a3fd6d 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -114,9 +114,12 @@ endif() add_prefix(${SUNDIALS_SOURCE_DIR}/src/sundials/ sundials_SOURCES) if(ENABLE_MPI) - set(_link_mpi_if_needed PUBLIC MPI::MPI_C) + set(_link_mpi_if_needed PUBLIC + MPI::MPI_C + $<$<LINK_LANGUAGE:CXX>:MPI::MPI_CXX>) endif() + if(SUNDIALS_BUILD_WITH_PROFILING) if(ENABLE_CALIPER) set(_link_caliper_if_needed PUBLIC caliper) From 4c2b34f085a9933d8374cee013136371cb832b75 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Tue, 7 May 2024 00:32:00 -0500 Subject: [PATCH 034/137] Feature: Unify ARKODE UI for common stepper functions (#459) Create a shared UI for all ARKODE steppers. --------- Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 11 + .../kokkos/arkode_driver.cpp | 200 +- .../raja/arkode_driver.cpp | 200 +- benchmarks/diffusion_2D/main_arkode.cpp | 58 +- doc/arkode/guide/source/Constants.rst | 3 + doc/arkode/guide/source/Introduction.rst | 12 +- doc/arkode/guide/source/Mathematics.rst | 46 +- doc/arkode/guide/source/Organization.rst | 34 +- .../Usage/ARKStep_c_interface/Relaxation.rst | 86 +- .../ARKStep_c_interface/User_callable.rst | 1564 +++--- .../Usage/ARKStep_c_interface/XBraid.rst | 585 +-- .../Usage/ARKStep_c_interface/index.rst | 40 +- .../Usage/ERKStep_c_interface/Relaxation.rst | 83 +- .../Usage/ERKStep_c_interface/Skeleton.rst | 146 - .../ERKStep_c_interface/User_callable.rst | 786 +-- .../Usage/ERKStep_c_interface/index.rst | 24 +- .../Usage/MRIStep_c_interface/Skeleton.rst | 254 +- .../MRIStep_c_interface/User_callable.rst | 1439 ++--- .../Usage/MRIStep_c_interface/index.rst | 22 +- .../Preconditioners.rst | 420 +- doc/arkode/guide/source/Usage/Relaxation.rst | 359 ++ .../Usage/SPRKStep_c_interface/Skeleton.rst | 143 - .../SPRKStep_c_interface/User_callable.rst | 365 +- .../Usage/SPRKStep_c_interface/index.rst | 24 +- .../{ARKStep_c_interface => }/Skeleton.rst | 92 +- .../guide/source/Usage/User_callable.rst | 4588 ++++++++++++++++ .../guide/source/Usage/User_supplied.rst | 932 ++-- doc/arkode/guide/source/Usage/index.rst | 65 +- doc/arkode/guide/source/index.rst | 2 +- .../source/sunnonlinsol/ARKODE_interface.rst | 147 +- doc/shared/RecentChanges.rst | 11 + .../ark_brusselator1D_task_local_nls.cpp | 112 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 313 +- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 112 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 102 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 116 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 102 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 162 +- .../ark_advection_diffusion_reaction.cpp | 273 +- .../ark_advection_diffusion_reaction.hpp | 108 +- .../arkode/CXX_serial/ark_analytic_sys.cpp | 70 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 112 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 150 +- examples/arkode/CXX_serial/ark_pendulum.cpp | 92 +- .../ark_brusselator1D_FEM_sludist.cpp | 85 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 106 +- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 102 +- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 104 +- .../C_manyvector/ark_brusselator1D_manyvec.c | 74 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 68 +- examples/arkode/C_openmp/ark_heat1D_omp.c | 88 +- .../C_openmpdev/ark_analytic_nonlin_ompdev.c | 28 +- .../C_openmpdev/ark_heat1D_adapt_ompdev.c | 90 +- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 88 +- .../ark_brusselator1D_task_local_nls.c | 116 +- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 92 +- .../C_parallel/ark_diurnal_kry_bbd_p.out | 104 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 96 +- .../arkode/C_parallel/ark_diurnal_kry_p.out | 47 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 92 +- .../arkode/C_parhyp/ark_diurnal_kry_ph.out | 46 +- examples/arkode/C_petsc/ark_petsc_ex25.c | 52 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 108 +- .../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 +- examples/arkode/C_serial/ark_analytic.c | 72 +- examples/arkode/C_serial/ark_analytic_mels.c | 75 +- .../arkode/C_serial/ark_analytic_nonlin.c | 20 +- examples/arkode/C_serial/ark_brusselator.c | 83 +- examples/arkode/C_serial/ark_brusselator1D.c | 68 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 85 +- .../C_serial/ark_brusselator1D_imexmri.c | 138 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 60 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 70 +- examples/arkode/C_serial/ark_brusselator_fp.c | 50 +- .../arkode/C_serial/ark_brusselator_mri.c | 34 +- .../C_serial/ark_conserved_exp_entropy_ark.c | 92 +- .../C_serial/ark_conserved_exp_entropy_erk.c | 60 +- .../C_serial/ark_damped_harmonic_symplectic.c | 20 +- .../C_serial/ark_dissipated_exp_entropy.c | 92 +- .../arkode/C_serial/ark_harmonic_symplectic.c | 24 +- examples/arkode/C_serial/ark_heat1D.c | 86 +- examples/arkode/C_serial/ark_heat1D_adapt.c | 82 +- examples/arkode/C_serial/ark_kepler.c | 59 +- examples/arkode/C_serial/ark_kpr_mri.c | 114 +- .../arkode/C_serial/ark_onewaycouple_mri.c | 26 +- .../C_serial/ark_reaction_diffusion_mri.c | 38 +- examples/arkode/C_serial/ark_robertson.c | 64 +- .../C_serial/ark_robertson_constraints.c | 106 +- examples/arkode/C_serial/ark_robertson_root.c | 106 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 26 +- .../ark_analytic_complex_f2003.f90 | 14 +- .../F2003_custom/ark_brusselator1D_f2003.f90 | 40 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 112 +- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 68 +- .../F2003_parallel/ark_diag_kry_bbd_f2003.out | 21 +- .../F2003_parallel/ark_diag_non_f2003.f90 | 32 +- .../F2003_parallel/ark_heat2D_f2003.f90 | 62 +- .../F2003_serial/ark_analytic_f2003.f90 | 66 +- .../ark_bruss1D_FEM_klu_f2003.f90 | 88 +- .../arkode/F2003_serial/ark_bruss_f2003.f90 | 72 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 76 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.out | 9 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 98 +- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 116 +- .../F2003_serial/ark_roberts_dns_f2003.f90 | 116 +- include/arkode/arkode.h | 224 + include/arkode/arkode_arkstep.h | 556 +- include/arkode/arkode_erkstep.h | 283 +- include/arkode/arkode_ls.h | 36 + include/arkode/arkode_mristep.h | 303 +- include/arkode/arkode_sprkstep.h | 95 +- include/arkode/arkode_xbraid.h | 10 +- src/arkode/arkode.c | 314 +- src/arkode/arkode_adapt.c | 12 +- src/arkode/arkode_adapt_impl.h | 4 +- src/arkode/arkode_arkstep.c | 447 +- src/arkode/arkode_arkstep_impl.h | 64 +- src/arkode/arkode_arkstep_io.c | 735 +-- src/arkode/arkode_arkstep_nls.c | 153 +- src/arkode/arkode_bandpre.c | 15 +- src/arkode/arkode_bbdpre.c | 18 +- src/arkode/arkode_erkstep.c | 260 +- src/arkode/arkode_erkstep_impl.h | 24 +- src/arkode/arkode_erkstep_io.c | 330 +- src/arkode/arkode_impl.h | 221 +- src/arkode/arkode_interp.c | 140 +- src/arkode/arkode_interp_impl.h | 29 +- src/arkode/arkode_io.c | 1324 ++++- src/arkode/arkode_ls.c | 1204 ++++- src/arkode/arkode_ls_impl.h | 87 +- src/arkode/arkode_mristep.c | 353 +- src/arkode/arkode_mristep_impl.h | 56 +- src/arkode/arkode_mristep_io.c | 582 ++- src/arkode/arkode_mristep_nls.c | 49 +- src/arkode/arkode_relaxation.c | 177 +- src/arkode/arkode_relaxation_impl.h | 18 +- src/arkode/arkode_root.c | 30 +- src/arkode/arkode_sprkstep.c | 226 +- src/arkode/arkode_sprkstep_impl.h | 24 +- src/arkode/arkode_sprkstep_io.c | 213 +- src/arkode/fmod/farkode_erkstep_mod.c | 8 +- src/arkode/fmod/farkode_erkstep_mod.f90 | 26 +- src/arkode/fmod/farkode_mod.c | 2248 +++++++- src/arkode/fmod/farkode_mod.f90 | 4614 +++++++++++++++-- src/arkode/xbraid/arkode_xbraid.c | 20 +- test/answers | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 176 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 150 +- .../CXX_serial/ark_test_dahlquist_ark.cpp | 70 +- .../CXX_serial/ark_test_dahlquist_erk.cpp | 42 +- .../CXX_serial/ark_test_dahlquist_mri.cpp | 71 +- .../arkode/CXX_serial/ark_test_getjac.cpp | 30 +- .../arkode/CXX_serial/ark_test_getjac_mri.cpp | 36 +- .../C_serial/ark_test_arkstepsetforcing.c | 102 +- .../arkode/C_serial/ark_test_getuserdata.c | 34 +- .../arkode/C_serial/ark_test_innerstepper.c | 16 +- .../arkode/C_serial/ark_test_interp.c | 136 +- .../arkode/C_serial/ark_test_mass.c | 42 +- .../arkode/C_serial/ark_test_reset.c | 218 +- .../arkode/C_serial/ark_test_tstop.c | 20 +- .../gtest/test_arkode_error_handling.cpp | 4 +- 163 files changed, 23658 insertions(+), 11938 deletions(-) delete mode 100644 doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => }/Preconditioners.rst (61%) create mode 100644 doc/arkode/guide/source/Usage/Relaxation.rst delete mode 100644 doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => }/Skeleton.rst (73%) create mode 100644 doc/arkode/guide/source/Usage/User_callable.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dbe1e2ec5..8ab881dfd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## Changes to SUNDIALS in release X.Y.Z +Created shared user interface for ARKODE user-callable routines, to allow more +uniform control over time-stepping algorithms, improved extensibility, and +simplified code maintenance. Marked the corresponding stepper-specific +user-callable routines as deprecated; these will be removed in a future major +release. + +Added "Resize" capability to ARKODE's SPRKStep time-stepping module. + +Deprecated `ARKStepSetOptimalParams` function; added instructions to user guide +for users who wish to retain the current functionality. + Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 0acdc8625e..49dcc6d8cf 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -71,26 +71,20 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -106,8 +100,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -121,15 +115,15 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) + retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) { return 1; } @@ -144,8 +138,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -177,8 +171,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -192,24 +186,24 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1, udata->myid); if (uopt->nls == "newton") { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -230,7 +224,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -265,26 +259,20 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -300,8 +288,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -314,15 +302,15 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) + retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) { return 1; } @@ -338,8 +326,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -354,8 +342,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -387,8 +375,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -402,24 +390,24 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1, udata->myid); if (uopt->nls == "newton") { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -440,7 +428,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); if (NLS) { SUNNonlinSolFree(NLS); } if (LS) { SUNLinSolFree(LS); } @@ -470,33 +458,27 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ERKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ERKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ERKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ERKStepSetUserData", 1, udata->myid)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ERKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } /* Set fixed step size */ - retval = ERKStepSetFixedStep(arkode_mem, 1e-5); - if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetFixedStep(arkode_mem, 1e-5); + if (check_retval(&retval, "ARKodeSetFixedStep", 1, udata->myid)) { return 1; } /* Output initial condition */ if (uopt->nout > 0) @@ -518,8 +500,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -533,14 +515,14 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ERKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ERKStepGetNumSteps", 1, udata->myid); - retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ERKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); - retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ERKStepGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); /* Print final statistics */ if (udata->myid == 0) @@ -552,7 +534,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* Return success */ return (0); @@ -575,8 +557,8 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) sunrealtype tcur, gamma; void* user_data; - ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; /* update 'z' value as stored predictor + current corrector */ @@ -615,8 +597,8 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) sunrealtype tcur, gamma; void* user_data = NULL; - ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; SUNDIALS_CXX_MARK_FUNCTION(udata->prof); diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 0acdc8625e..49dcc6d8cf 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -71,26 +71,20 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -106,8 +100,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -121,15 +115,15 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) + retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) { return 1; } @@ -144,8 +138,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -177,8 +171,8 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -192,24 +186,24 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1, udata->myid); if (uopt->nls == "newton") { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -230,7 +224,7 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -265,26 +259,20 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData*", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData*", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } @@ -300,8 +288,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -314,15 +302,15 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1, udata->myid)) + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1, udata->myid)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1, udata->myid)) + retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1, udata->myid)) { return 1; } @@ -338,8 +326,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -354,8 +342,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1, udata->myid)) + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1, udata->myid)) { return 1; } @@ -387,8 +375,8 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -402,24 +390,24 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1, udata->myid); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1, udata->myid); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1, udata->myid); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1, udata->myid); if (uopt->nls == "newton") { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1, udata->myid); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1, udata->myid); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1, udata->myid); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1, udata->myid); } /* Print final statistics */ @@ -440,7 +428,7 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); if (NLS) { SUNNonlinSolFree(NLS); } if (LS) { SUNLinSolFree(LS); } @@ -470,33 +458,27 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Select the method order */ - retval = ERKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ERKStepSetOrder", 1, udata->myid)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1, udata->myid)) { return 1; } /* Attach user data */ - retval = ERKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ERKStepSetUserData", 1, udata->myid)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1, udata->myid)) { return 1; } /* Specify tolerances */ - retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ERKStepSStolerances", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1, udata->myid)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1, udata->myid)) + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1, udata->myid)) { return 1; } /* Set fixed step size */ - retval = ERKStepSetFixedStep(arkode_mem, 1e-5); - if (check_retval(&retval, "ERKStepSetFixedStep", 1, udata->myid)) - { - return 1; - } + retval = ARKodeSetFixedStep(arkode_mem, 1e-5); + if (check_retval(&retval, "ARKodeSetFixedStep", 1, udata->myid)) { return 1; } /* Output initial condition */ if (uopt->nout > 0) @@ -518,8 +500,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) do { /* Integrate to output time */ - retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1, udata->myid)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1, udata->myid)) { break; } /* Output state */ if (uopt->nout > 0) { WriteOutput(t, y, udata, uopt); } @@ -533,14 +515,14 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) while (iout < uopt->nout); /* Get final statistics */ - retval = ERKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ERKStepGetNumSteps", 1, udata->myid); - retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ERKStepGetNumStepAttempts", 1, udata->myid); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); - retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ERKStepGetNumErrTestFails", 1, udata->myid); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); /* Print final statistics */ if (udata->myid == 0) @@ -552,7 +534,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) } /* Clean up */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* Return success */ return (0); @@ -575,8 +557,8 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) sunrealtype tcur, gamma; void* user_data; - ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; /* update 'z' value as stored predictor + current corrector */ @@ -615,8 +597,8 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) sunrealtype tcur, gamma; void* user_data = NULL; - ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, - &sdata, &user_data); + ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, &gamma, + &sdata, &user_data); udata = (UserData*)user_data; SUNDIALS_CXX_MARK_FUNCTION(udata->prof); diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index e3f8962ad8..c35bf9e9c7 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -245,49 +245,49 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)&udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)&udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } #if defined(USE_SUPERLU_DIST) if (uopts.ls == "sludist") { - ARKStepSetJacFn(arkode_mem, diffusion_jac); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) return 1; + ARKodeSetJacFn(arkode_mem, diffusion_jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) return 1; } #endif if (uopts.preconditioning) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, uopts.msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, uopts.msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, uopts.epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, uopts.epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order - flag = ARKStepSetOrder(arkode_mem, uopts.order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, uopts.order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (uopts.hfixed > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, uopts.hfixed); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, uopts.hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -299,17 +299,17 @@ int main(int argc, char* argv[]) // Specify linearly implicit non-time-dependent RHS if (uopts.linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, uopts.maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, uopts.maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -341,8 +341,8 @@ int main(int argc, char* argv[]) SUNDIALS_MARK_BEGIN(prof, "Evolve"); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, stepmode); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, stepmode); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } SUNDIALS_MARK_END(prof, "Evolve"); @@ -367,8 +367,8 @@ int main(int argc, char* argv[]) if (outproc) { cout << "Final integrator statistics:" << endl; - flag = ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - if (check_flag(&flag, "ARKStepPrintAllStats", 1)) { return 1; } + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } } // --------- @@ -378,7 +378,7 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); // Free the SuperLU_DIST structures (also frees user allocated arrays diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index c4cad94a8d..69affcfaa9 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -470,6 +470,9 @@ contains the ARKODE output constants. +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_CONTROLLER_ERR` | -47 | An error with a SUNAdaptController object was encountered. | +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_STEPPER_UNSUPPORTED` | -48 | An operation was not supported by the current | + | | | time-stepping module. | + +-------------------------------------+------+------------------------------------------------------------+ | :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 6461cbf0d6..a8e4d53d20 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -153,12 +153,12 @@ The structure of this document is as follows: ARKODE is :ref:`organized <ARKODE.Organization>`. * The largest section follows, providing a full account of how to use - ARKODE's time-stepping modules, :ref:`ARKStep <ARKODE.Usage.ARKStep>`, - :ref:`ERKStep <ARKODE.Usage.ERKStep>`, and :ref:`MRIStep <ARKODE.Usage.MRIStep>`, - within C and C++ applications. This section then includes additional - information on how to use ARKODE from applications written in - :ref:`Fortran <SUNDIALS.Fortran>`, as well as information on how to - leverage :ref:`GPU accelerators within ARKODE <SUNDIALS.GPU>`. + ARKODE within C and C++ applications, including any instructions that are + specific to a given time-stepping modules, :ref:`ARKStep <ARKODE.Usage.ARKStep>`, + :ref:`ERKStep <ARKODE.Usage.ERKStep>`, or :ref:`MRIStep <ARKODE.Usage.MRIStep>`. + This section then includes additional information on how to use ARKODE from + applications written in :ref:`Fortran <SUNDIALS.Fortran>`, as well as information + on how to leverage :ref:`GPU accelerators within ARKODE <SUNDIALS.GPU>`. * A much smaller section follows, describing ARKODE's :ref:`Butcher table structure <ARKodeButcherTable>`, that is used by diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index 8da6d2735a..ddbd7c4122 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -70,8 +70,8 @@ discussion of our choice of norms for measuring errors within various components of the solver. We then discuss the nonlinear and linear solver strategies used by -ARKODE's time-stepping modules for solving implicit algebraic systems -that arise in computing each stage and/or step: +ARKODE for solving implicit algebraic systems that arise in computing each +stage and/or step: :ref:`nonlinear solvers <ARKODE.Mathematics.Nonlinear>`, :ref:`linear solvers <ARKODE.Mathematics.Linear>`, :ref:`preconditioners <ARKODE.Mathematics.Preconditioning>`, @@ -109,7 +109,7 @@ The choice of step size :math:`h_n` is determined by the time-stepping method (based on user-provided inputs, typically accuracy requirements). However, users may place minimum/maximum bounds on :math:`h_n` if desired. -ARKODE's time stepping modules may be run in a variety of "modes": +ARKODE may be run in a variety of "modes": * **NORMAL** -- The solver will take internal steps until it has just overtaken a user-specified output time, :math:`t_\text{out}`, in the @@ -151,7 +151,7 @@ may be used. Interpolation =============== -As mentioned above, the time-stepping modules in ARKODE support +As mentioned above, the ARKODE supports interpolation of solutions :math:`y(t_\text{out})` and derivatives :math:`y^{(d)}(t_\text{out})`, where :math:`t_\text{out}` occurs within a completed time step from :math:`t_{n-1} \to t_n`. @@ -162,13 +162,12 @@ ARKODE currently supports construction of polynomial interpolants :math:`p_q(t)` of polynomial degree up to :math:`q=5`, although users may select interpolants of lower degree. -ARKODE provides two complementary interpolation approaches, -both of which are accessible from any of the -time-stepping modules: "Hermite" and "Lagrange". The former approach +ARKODE provides two complementary interpolation approaches: +"Hermite" and "Lagrange". The former approach has been included with ARKODE since its inception, and is more -suitable for non-stiff problems; the latter is a new approach that is -designed to provide increased accuracy when integrating stiff problems. -Both are described in detail below. +suitable for non-stiff problems; the latter is a more recent approach +that is designed to provide increased accuracy when integrating stiff +problems. Both are described in detail below. .. _ARKODE.Mathematics.Interpolation.Hermite: @@ -565,7 +564,8 @@ form is used to compute a time step: #. 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. +conservation property :cite:p:`HaWa:06`, SPRKStep requires that ARKODE be run +using a fixed time-step size. .. However, it is possible for a user to provide a .. problem-specific adaptivity controller such as the one described in :cite:p:`HaSo:05`. @@ -1014,11 +1014,8 @@ information. In this mode, all internal time step adaptivity is disabled: Fixed-step mode is currently required for the slow time scale in the MRIStep module. -Additional information on this mode is provided in the sections -:ref:`ARKStep Optional Inputs <ARKODE.Usage.ARKStep.OptionalInputs>`, -:ref:`ERKStep Optional Inputs <ARKODE.Usage.ERKStep.OptionalInputs>`, -:ref:`SPRKStep Optional Inputs <ARKODE.Usage.SPRKStep.OptionalInputs>`, and -:ref:`MRIStep Optional Inputs <ARKODE.Usage.MRIStep.OptionalInputs>`. +Additional information on this mode is provided in the section +:ref:`ARKODE Optional Inputs <ARKODE.Usage.OptionalInputs>`. .. _ARKODE.Mathematics.AlgebraicSolvers: @@ -1140,8 +1137,7 @@ Consider, for example, :eq:`ARKODE_Residual_MeqI` which implies :label: ARKODE_Implicit_Stage_Eval when :math:`z_i` is the exact root, and similar relations hold for non-identity -mass matrices. This optimization can be enabled by -:c:func:`ARKStepSetDeduceImplicitRhs` and :c:func:`MRIStepSetDeduceImplicitRhs` +mass matrices. This optimization can be enabled by :c:func:`ARKodeSetDeduceImplicitRhs` with the second argument in either function set to SUNTRUE. Another factor to consider when using this option is the amplification of errors from the nonlinear solver to the stages. In :eq:`ARKODE_Implicit_Stage_Eval`, nonlinear @@ -1948,10 +1944,9 @@ step (but zero linear solves with the system Jacobian). Rootfinding =============== -All of the time-stepping modules in ARKODE also support a rootfinding -feature. This means that, while integrating the IVP :eq:`ARKODE_IVP`, these -can also find the roots of a set of user-defined functions -:math:`g_i(t,y)` that depend on :math:`t` and the solution vector +ARKODE also supports a rootfinding feature, in that while integrating the +IVP :eq:`ARKODE_IVP`, these can also find the roots of a set of user-defined +functions :math:`g_i(t,y)` that depend on :math:`t` and the solution vector :math:`y = y(t)`. The number of these root functions is arbitrary, and if more than one :math:`g_i` is found to have a root in any given interval, the various root locations are found and reported in the @@ -2065,8 +2060,8 @@ factor of 0.9 to cover the strict inequality case). If a step fails to satisfy the constraints 10 times (a value which may be modified by the user) within a step attempt, or fails with the minimum step size, then the integration is halted and an error is returned. In this case the user may need to employ other -strategies as discussed in :numref:`ARKODE.Usage.ARKStep.Tolerances` and -:numref:`ARKODE.Usage.ERKStep.Tolerances` to satisfy the inequality constraints. +strategies as discussed in :numref:`ARKODE.Usage.Tolerances` to satisfy the +inequality constraints. .. _ARKODE.Mathematics.Relaxation: @@ -2130,5 +2125,4 @@ relaxation application and the step will is repeated with the step size reduced by :math:`\eta_\text{rf}`. For more information on utilizing relaxation Runge--Kutta methods, see -:numref:`ARKODE.Usage.ERKStep.Relaxation` and -:numref:`ARKODE.Usage.ARKStep.Relaxation`. +:numref:`ARKODE.Usage.Relaxation`. diff --git a/doc/arkode/guide/source/Organization.rst b/doc/arkode/guide/source/Organization.rst index 8ab599ff2d..204ed9a999 100644 --- a/doc/arkode/guide/source/Organization.rst +++ b/doc/arkode/guide/source/Organization.rst @@ -25,29 +25,29 @@ knowledge of this structure is not necessary for its use. The overall organization of the ARKODE package is shown in :numref:`ARKODE.Organization.ARKODE.Figure`. The central integration modules, implemented in the files ``arkode.h``, ``arkode_impl.h``, ``arkode_butcher.h``, -``arkode.c``, ``arkode_arkstep.c`` , ``arkode_erkstep.c``, ``arkode_mristep.h``, -and ``arkode_butcher.c``, deal with the evaluation of integration stages, the -nonlinear solvers, estimation of the local truncation error, selection of step -size, and interpolation to user output points, among other issues. ARKODE -supports SUNNonlinearSolver modules in either root-finding or fixed-point form -(see section :numref:`SUNNonlinSol`) for any nonlinearly implicit problems that -arise in computing each internal stage. When using Newton-based nonlinear -solvers, or when using a non-identity mass matrix :math:`M\ne I`, ARKODE has -flexibility in the choice of method used to solve the linear sub-systems that -arise. Therefore, for any user problem invoking the Newton solvers, or any user -problem with :math:`M\ne I`, one (or more) of the linear system solver modules -should be specified by the user; this/these are then invoked as needed during -the integration process. +``arkode.c``, ``arkode_arkstep.c`` , ``arkode_erkstep.c``, ``arkode_mristep.c``, +``arkode_sprkstep.c``, and ``arkode_butcher.c``, deal with the evaluation of +integration stages, the nonlinear solvers, estimation of the local truncation +error, selection of step size, and interpolation to user output points, among +other issues. ARKODE supports SUNNonlinearSolver modules in either root-finding +or fixed-point form (see section :numref:`SUNNonlinSol`) for any nonlinearly +implicit problems that arise in computing each internal stage. When using +Newton-based nonlinear solvers, or when using a non-identity mass matrix +:math:`M\ne I`, ARKODE has flexibility in the choice of method used to solve the +linear sub-systems that arise. Therefore, for any user problem invoking the +Newton solvers, or any user problem with :math:`M\ne I`, one (or more) of the +linear system solver modules should be specified by the user; this/these are +then invoked as needed during the integration process. .. _ARKODE.Organization.ARKODE.Figure: .. figure:: /figs/arkode/arkorg.png :align: center *ARKODE organization*: Overall structure of the ARKODE package. - Modules specific to ARKODE are the timesteppers (ARKODE), linear solver - interfaces (ARKLS), nonlinear solver interfaces (ARKNLS), and preconditioners - (ARKBANDPRE and ARKBBDPRE); all other items correspond to generic SUNDIALS - vector, matrix, and solver modules. + Modules specific to ARKODE are the core infrastructure and timesteppers + (ARKODE), linear solver interfaces (ARKLS), nonlinear solver interfaces + (ARKNLS), and preconditioners (ARKBANDPRE and ARKBBDPRE); all other items + correspond to generic SUNDIALS vector, matrix, and solver modules. For solving these linear systems, ARKODE's linear solver interface supports both direct and iterative linear solvers adhering to the diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst index 38e66f0e36..3a2d7611db 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst @@ -17,15 +17,12 @@ Relaxation Methods ================== -This section describes user-callable functions for applying relaxation methods -with ARKStep. For more information on relaxation Runge--Kutta methods see -:numref:`ARKODE.Mathematics.Relaxation`. +This section describes ARKStep-specific user-callable functions for applying +relaxation methods with ARKStep. All of these routines have been deprecated in +favor of :ref:`shared ARKODE-level routines <ARKODE.Usage.Relaxation>`, but +this documentation will be retained for as long as these functions are present +in the library. -.. note:: - - Relaxation support as not been evaluated with non-identity mass matrices. - While this usage mode is supported, feedback from users who explore this - combination would be appreciated. Enabling or Disabling Relaxation -------------------------------- @@ -72,6 +69,11 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxFn` instead. + + Optional Input Functions ------------------------ @@ -96,6 +98,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxEtaFail` instead. + + .. c:function:: int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) Sets the smallest acceptable value for the relaxation parameter. @@ -117,6 +124,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxLowerBound` instead. + + .. c:function:: int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) Sets the largest acceptable value for the relaxation parameter. @@ -138,6 +150,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxUpperBound` instead. + + .. c:function:: int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) Sets the maximum number of times applying relaxation can fail within a step @@ -157,6 +174,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxMaxFails` instead. + + .. c:function:: int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) Sets the maximum number of nonlinear iterations allowed when solving for the @@ -180,6 +202,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxMaxIters` instead. + + .. c:function:: int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) Sets the nonlinear solver method used to compute the relaxation parameter. @@ -198,6 +225,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxSolver` instead. + + .. c:function:: int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) Sets the nonlinear solver residual tolerance to use when solving @@ -223,6 +255,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxResTol` instead. + + .. c:function:: int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) Sets the nonlinear solver relative and absolute tolerance on changes in @@ -249,6 +286,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxTol` instead. + + Optional Output Functions ------------------------- @@ -269,6 +311,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxFnEvals` instead. + + .. c:function:: int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) Get the number of times the user's relaxation Jacobian was evaluated. @@ -283,6 +330,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. + + .. c:function:: int ARKStepGetNumRelaxFails(void* arkode_mem, long int* fails) Get the total number of times applying relaxation failed. @@ -302,6 +354,10 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxFails` instead. + .. c:function:: int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) @@ -318,6 +374,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxBoundFails` instead. + + .. c:function:: int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) Get the number of times the relaxation parameter nonlinear solver failed. @@ -332,6 +393,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. + + .. c:function:: int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) Get the number of relaxation parameter nonlinear solver iterations. @@ -345,3 +411,7 @@ about the performance of the relaxation method. ``NULL`` .. versionadded:: 5.6.0 + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxSolveIters` instead. 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 4da2461e96..dcd7339a97 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 @@ -17,22 +17,23 @@ ARKStep User-callable functions ================================ -This section describes the functions that are called by the user to -setup and then solve an IVP using the ARKStep time-stepping -module. Some of these are required; however, starting with -:numref:`ARKODE.Usage.ARKStep.OptionalInputs`, the functions listed involve -optional inputs/outputs or restarting, and those paragraphs may be -skipped for a casual use of ARKODE's ARKStep module. In any case, -refer to the preceding section, :numref:`ARKODE.Usage.ARKStep.Skeleton`, -for the correct order of these calls. +This section describes the ARKStep-specific functions that may be called +by the user to setup and then solve an IVP using the ARKStep time-stepping +module. The large majority of these routines merely wrap :ref:`underlying +ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated +-- each of these are clearly marked. However, some +of these user-callable functions are specific to ARKStep, as explained +below. -On an error, each user-callable function returns a negative value (or -``NULL`` if the function returns a pointer) and sends an error message -to the error handler routine, which prints the message to ``stderr`` -by default. However, the user can set a file as error output or can -provide their own error handler function (see -:numref:`ARKODE.Usage.ARKStep.OptionalInputs` for details). +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +ARKStep supports *all categories*: +* temporal adaptivity +* implicit nonlinear and/or linear solvers +* non-identity mass matrices +* relaxation Runge--Kutta methods .. _ARKODE.Usage.ARKStep.Initialization: @@ -73,6 +74,9 @@ ARKStep initialization and deallocation functions **Return value:** None + .. deprecated:: x.y.z + + Use :c:func:`ARKodeFree` instead. .. _ARKODE.Usage.ARKStep.Tolerances: @@ -80,39 +84,6 @@ ARKStep initialization and deallocation functions ARKStep tolerance specification functions ------------------------------------------------------ -These functions specify the integration tolerances. One of them -**should** be called before the first call to -:c:func:`ARKStepEvolve()`; otherwise default values of ``reltol = -1e-4`` and ``abstol = 1e-9`` will be used, which may be entirely -incorrect for a specific problem. - -The integration tolerances ``reltol`` and ``abstol`` define a vector -of error weights, ``ewt``. In the case of -:c:func:`ARKStepSStolerances()`, this vector has components - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol); - -whereas in the case of :c:func:`ARKStepSVtolerances()` the vector components -are given by - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol[i]); - -This vector is used in all error and convergence tests, which use a -weighted RMS norm on all error-like vectors :math:`v`: - -.. math:: - \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; ewt_i)^2 \right)^{1/2}, - -where :math:`N` is the problem dimension. - -Alternatively, the user may supply a custom function to supply the -``ewt`` vector, through a call to :c:func:`ARKStepWFtolerances()`. - - .. c:function:: int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) @@ -129,6 +100,9 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSStolerances` instead. .. c:function:: int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -149,6 +123,9 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSVtolerances` instead. .. c:function:: int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -166,44 +143,9 @@ Alternatively, the user may supply a custom function to supply the * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module + .. deprecated:: x.y.z - -Moreover, for problems involving a non-identity mass matrix -:math:`M \ne I`, the units of the solution vector :math:`y` may differ -from the units of the IVP, posed for the vector :math:`My`. When this -occurs, iterative solvers for the Newton linear systems and the mass -matrix linear systems may require a different set of tolerances. -Since the relative tolerance is dimensionless, but the absolute -tolerance encodes a measure of what is "small" in the units of the -respective quantity, a user may optionally define absolute tolerances -in the equation units. In this case, ARKStep defines a vector of residual -weights, ``rwt`` for measuring convergence of these iterative solvers. -In the case of :c:func:`ARKStepResStolerance()`, this vector has components - -.. code-block:: c - - rwt[i] = 1.0/(reltol*abs(My[i]) + rabstol); - -whereas in the case of :c:func:`ARKStepResVtolerance()` the vector components -are given by - -.. code-block:: c - - rwt[i] = 1.0/(reltol*abs(My[i]) + rabstol[i]); - -This residual weight vector is used in all iterative solver -convergence tests, which similarly use a weighted RMS norm on all -residual-like vectors :math:`v`: - -.. math:: - \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; rwt_i)^2 \right)^{1/2}, - -where :math:`N` is the problem dimension. - -As with the error weight vector, the user may supply a custom function -to supply the ``rwt`` vector, through a call to -:c:func:`ARKStepResFtolerance()`. Further information on all three of -these functions is provided below. + Use :c:func:`ARKodeWFtolerances` instead. @@ -221,6 +163,9 @@ these functions is provided below. * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeResStolerance` instead. .. c:function:: int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) @@ -238,6 +183,9 @@ these functions is provided below. * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeResVtolerance` instead. .. c:function:: int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) @@ -255,117 +203,9 @@ these functions is provided below. * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module + .. deprecated:: x.y.z - -General advice on the choice of tolerances -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For many users, the appropriate choices for tolerance values in -``reltol``, ``abstol``, and ``rabstol`` are a concern. The following pieces -of advice are relevant. - -(1) The scalar relative tolerance ``reltol`` is to be set to control - relative errors. So a value of :math:`10^{-4}` means that errors - are controlled to .01%. We do not recommend using ``reltol`` larger - than :math:`10^{-3}`. On the other hand, ``reltol`` should not be so - small that it is comparable to the unit roundoff of the machine - arithmetic (generally around :math:`10^{-15}` for double-precision). - -(2) The absolute tolerances ``abstol`` (whether scalar or vector) need - to be set to control absolute errors when any components of the - solution vector :math:`y` may be so small that pure relative error - control is meaningless. For example, if :math:`y_i` starts at some - nonzero value, but in time decays to zero, then pure relative - error control on :math:`y_i` makes no sense (and is overly costly) - after :math:`y_i` is below some noise level. Then ``abstol`` (if - scalar) or ``abstol[i]`` (if a vector) needs to be set to that - noise level. If the different components have different noise - levels, then ``abstol`` should be a vector. For example, see the - example problem ``ark_robertson.c``, and the discussion - of it in the ARKODE Examples Documentation :cite:p:`arkode_ex`. In that - problem, the three components vary between 0 and 1, and have - different noise levels; hence the ``atols`` vector therein. It is - impossible to give any general advice on ``abstol`` values, - because the appropriate noise levels are completely - problem-dependent. The user or modeler hopefully has some idea as - to what those noise levels are. - -(3) The residual absolute tolerances ``rabstol`` (whether scalar or - vector) follow a similar explanation as for ``abstol``, except - that these should be set to the noise level of the equation - components, i.e. the noise level of :math:`My`. For problems in - which :math:`M=I`, it is recommended that ``rabstol`` be left - unset, which will default to the already-supplied ``abstol`` - values. - -(4) Finally, it is important to pick all the tolerance values - conservatively, because they control the error committed on each - individual step. The final (global) errors are an accumulation of - those per-step errors, where that accumulation factor is - problem-dependent. A general rule of thumb is to reduce the - tolerances by a factor of 10 from the actual desired limits on - errors. So if you want .01% relative accuracy (globally), a good - choice for ``reltol`` is :math:`10^{-5}`. In any case, it is - a good idea to do a few experiments with the tolerances to see how - the computed solution values vary as tolerances are reduced. - - - -Advice on controlling nonphysical negative values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In many applications, some components in the true solution are always -positive or non-negative, though at times very small. In the -numerical solution, however, small negative (nonphysical) values -can then occur. In most cases, these values are harmless, and simply -need to be controlled, not eliminated, but in other cases any value -that violates a constraint may cause a simulation to halt. For both of -these scenarios the following pieces of advice are relevant. - -(1) The best way to control the size of unwanted negative computed - values is with tighter absolute tolerances. Again this requires - some knowledge of the noise level of these components, which may - or may not be different for different components. Some - experimentation may be needed. - -(2) If output plots or tables are being generated, and it is important - to avoid having negative numbers appear there (for the sake of - avoiding a long explanation of them, if nothing else), then - eliminate them, but only in the context of the output medium. Then - the internal values carried by the solver are unaffected. Remember - that a small negative value in :math:`y` returned by ARKStep, with - magnitude comparable to ``abstol`` or less, is equivalent to zero - as far as the computation is concerned. - -(3) The user's right-hand side routines :math:`f^E` and :math:`f^I` - should never change a negative value in the solution vector :math:`y` - to a non-negative value in attempt to "fix" this problem, - since this can lead to numerical instability. If the :math:`f^E` - or :math:`f^I` routines cannot tolerate a zero or negative value - (e.g. because there is a square root or log), then the offending - value should be changed to zero or a tiny positive number in a - temporary variable (not in the input :math:`y` vector) for the - purposes of computing :math:`f^E(t, y)` or :math:`f^I(t, y)`. - -(4) ARKStep supports component-wise constraints on solution components, - :math:`y_i < 0`, :math:`y_i \le 0`, , :math:`y_i > 0`, or - :math:`y_i \ge 0`, through the user-callable function - :c:func:`ARKStepSetConstraints`. At each internal time step, if any - constraint is violated then ARKStep will attempt a smaller time step - that should not violate this constraint. This reduced step size is - chosen such that the step size is the largest possible but where the - solution component satisfies the constraint. - -(5) Positivity and non-negativity constraints on components can also be - enforced by use of the recoverable error return feature in the - user-supplied right-hand side functions, :math:`f^E` and - :math:`f^I`. When a recoverable error is encountered, ARKStep will - retry the step with a smaller step size, which typically - alleviates the problem. However, since this reduced step size is - chosen without knowledge of the solution constraint, it may be - overly conservative. Thus this option involves some additional - overhead cost, and should only be exercised if the above recommendations - are unsuccessful. + Use :c:func:`ARKodeResFtolerance` instead. @@ -374,74 +214,6 @@ these scenarios the following pieces of advice are relevant. Linear solver interface functions ------------------------------------------- -As previously explained, the Newton iterations used in solving -implicit systems within ARKStep require the solution of linear -systems of the form - -.. math:: - \mathcal{A}\left(z_i^{(m)}\right) \delta^{(m+1)} = -G\left(z_i^{(m)}\right) - -where - -.. math:: - \mathcal{A} \approx M - \gamma J, \qquad J = \frac{\partial f^I}{\partial y}. - -ARKODE's ARKLS linear solver interface supports all valid -``SUNLinearSolver`` modules for this task. - -Matrix-based ``SUNLinearSolver`` modules utilize ``SUNMatrix`` objects -to store the approximate Jacobian matrix :math:`J`, the Newton matrix -:math:`\mathcal{A}`, the mass matrix :math:`M`, and, when using direct -solvers, the factorizations used throughout the solution process. - -Matrix-free ``SUNLinearSolver`` modules instead use iterative methods -to solve the Newton systems of equations, and only require the -*action* of the matrix on a vector, :math:`\mathcal{A}v`. With most -of these methods, preconditioning can be done on the left only, on the -right only, on both the left and the right, or not at all. The -exceptions to this rule are SPFGMR that supports right preconditioning -only and PCG that performs symmetric preconditioning. For the -specification of a preconditioner, see the iterative linear solver -portions of :numref:`ARKODE.Usage.ARKStep.OptionalInputs` and -:numref:`ARKODE.Usage.UserSupplied`. - -If preconditioning is done, user-supplied functions should be used to -define left and right preconditioner matrices :math:`P_1` and -:math:`P_2` (either of which could be the identity matrix), such that -the product :math:`P_{1}P_{2}` approximates the Newton matrix -:math:`\mathcal{A} = M - \gamma J`. - -To specify a generic linear solver for ARKStep to use for the Newton -systems, after the call to :c:func:`ARKStepCreate` but before any -calls to :c:func:`ARKStepEvolve()`, the user's program must create the -appropriate ``SUNLinearSolver`` object and call the function -:c:func:`ARKStepSetLinearSolver()`, as documented below. To create -the ``SUNLinearSolver`` object, the user may call one of the -SUNDIALS-packaged SUNLinSol module constructor routines via a call of -the form - -.. code:: c - - SUNLinearSolver LS = SUNLinSol_*(...); - -The current list of SUNDIALS-packaged SUNLinSol modules, and their -constructor routines, may be found in chapter :numref:`SUNLinSol`. -Alternately, a user-supplied ``SUNLinearSolver`` module may be created -and used. Specific information on how to create such user-provided -modules may be found in :numref:`SUNLinSol.API.Custom`. - -Once this solver object has been constructed, the user should attach -it to ARKStep via a call to :c:func:`ARKStepSetLinearSolver()`. The -first argument passed to this function is the ARKStep memory pointer -returned by :c:func:`ARKStepCreate`; the second argument is the -``SUNLinearSolver`` object created above. The third argument is an -optional ``SUNMatrix`` object to accompany matrix-based -``SUNLinearSolver`` inputs (for matrix-free linear solvers, the third -argument should be ``NULL``). A call to this function initializes the -ARKLS linear solver interface, linking it to the ARKStep integrator, -and allows the user to specify additional parameters and routines -pertinent to their choice of linear solver. - .. c:function:: int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix J) This function specifies the ``SUNLinearSolver`` object that ARKStep @@ -484,8 +256,9 @@ pertinent to their choice of linear solver. insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by ARKStep. + .. deprecated:: x.y.z - + Use :c:func:`ARKodeSetLinearSolver` instead. @@ -494,57 +267,6 @@ pertinent to their choice of linear solver. Mass matrix solver specification functions ------------------------------------------- -As discussed in :numref:`ARKODE.Mathematics.MassSolve`, if the ODE -system involves a non-identity mass matrix :math:`M\ne I`, then ARKStep -must solve linear systems of the form - -.. math:: - M x = b. - -ARKODE's ARKLS mass-matrix linear solver interface supports all valid -``SUNLinearSolver`` modules for this task. For iterative linear -solvers, user-supplied preconditioning can be applied. For the -specification of a preconditioner, see the iterative linear solver -portions of :numref:`ARKODE.Usage.ARKStep.OptionalInputs` and -:numref:`ARKODE.Usage.UserSupplied`. If preconditioning is to be -performed, user-supplied functions should be used to define left and -right preconditioner matrices :math:`P_1` and :math:`P_2` (either of -which could be the identity matrix), such that the product -:math:`P_{1}P_{2}` approximates the mass matrix :math:`M`. - -To specify a generic linear solver for ARKStep to use for mass matrix -systems, after the call to :c:func:`ARKStepCreate` but before any -calls to :c:func:`ARKStepEvolve()`, the user's program must create the -appropriate ``SUNLinearSolver`` object and call the function -:c:func:`ARKStepSetMassLinearSolver()`, as documented below. The -first argument passed to this function is the ARKStep memory -pointer returned by :c:func:`ARKStepCreate`; the second argument is -the desired ``SUNLinearSolver`` object to use for solving mass matrix -systems. The third object is a template ``SUNMatrix`` to use with the -provided ``SUNLinearSolver`` (if applicable). The fourth input is a -flag to indicate whether the mass matrix is time-dependent, -i.e. :math:`M = M(t)`, or not. A call to this function initializes the -ARKLS mass matrix linear solver interface, linking this to the main -ARKStep integrator, and allows the user to specify additional -parameters and routines pertinent to their choice of linear solver. - -Note: if the user program includes linear solvers for *both* the -Newton and mass matrix systems, these must have the same type: - -* If both are matrix-based, then they must utilize the same - ``SUNMatrix`` type, since these will be added when forming the - Newton system matrix :math:`\mathcal{A}`. In this case, both the - Newton and mass matrix linear solver interfaces can use the same - ``SUNLinearSolver`` object, although different solver objects - (e.g. with different solver parameters) are also allowed. - -* If both are matrix-free, then the Newton and mass matrix - ``SUNLinearSolver`` objects must be different. These may even use - different solver algorithms (SPGMR, SPBCGS, etc.), if desired. - For example, if the mass matrix is symmetric but the Jacobian is not, - then PCG may be used for the mass matrix systems and SPGMR for the - Newton systems. - .. c:function:: int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep) @@ -596,7 +318,9 @@ Newton and mass matrix systems, these must have the same type: mass-matrix-times-vector product routine (see :c:type:`ARKLsMassTimesVecFn` and :c:func:`ARKStepSetMassTimes()`). + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetMassLinearSolver` instead. .. _ARKODE.Usage.ARKStep.NonlinearSolvers: @@ -604,23 +328,6 @@ Newton and mass matrix systems, these must have the same type: Nonlinear solver interface functions ------------------------------------------- -When changing the nonlinear solver in ARKStep, after the -call to :c:func:`ARKStepCreate` but before any calls to -:c:func:`ARKStepEvolve()`, the user's program must create the -appropriate ``SUNNonlinearSolver`` object and call -:c:func:`ARKStepSetNonlinearSolver()`, as documented below. If any -calls to :c:func:`ARKStepEvolve()` have been made, then ARKStep will -need to be reinitialized by calling :c:func:`ARKStepReInit()` to -ensure that the nonlinear solver is initialized correctly before any -subsequent calls to :c:func:`ARKStepEvolve()`. - -The first argument passed to the routine -:c:func:`ARKStepSetNonlinearSolver()` is the ARKStep memory pointer -returned by :c:func:`ARKStepCreate`; the second argument passed -to this function is the desired ``SUNNonlinearSolver`` object to use for -solving the nonlinear system for each implicit stage. A call to this -function attaches the nonlinear solver to the main ARKStep integrator. - .. c:function:: int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) @@ -643,7 +350,9 @@ function attaches the nonlinear solver to the main ARKStep integrator. default; a call to this routine replaces that module with the supplied *NLS* object. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetNonlinearSolver` instead. .. _ARKODE.Usage.ARKStep.RootFinding: @@ -651,15 +360,6 @@ function attaches the nonlinear solver to the main ARKStep integrator. Rootfinding initialization function -------------------------------------- -As described in :numref:`ARKODE.Mathematics.Rootfinding`, while -solving the IVP, ARKODE's time-stepping modules have the capability to -find the roots of a set of user-defined functions. To activate the -root-finding algorithm, call the following function. This is normally -called only once, prior to the first call to -:c:func:`ARKStepEvolve()`, but if the rootfinding problem is to be -changed during the solution, :c:func:`ARKStepRootInit()` can also be -called prior to a continuation call to :c:func:`ARKStepEvolve()`. - .. c:function:: int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) @@ -689,7 +389,9 @@ called prior to a continuation call to :c:func:`ARKStepEvolve()`. problem but the prior one did, then call *ARKStepRootInit* with *nrtfn = 0*. + .. deprecated:: x.y.z + Use :c:func:`ARKodeRootInit` instead. .. _ARKODE.Usage.ARKStep.Integration: @@ -697,12 +399,6 @@ called prior to a continuation call to :c:func:`ARKStepEvolve()`. ARKStep solver function ------------------------- -This is the central step in the solution process -- the call to perform -the integration of the IVP. The input argument *itask* specifies one of two -modes as to where ARKStep is to return a solution. These modes are modified if -the user has set a stop time (with a call to the optional input function -:c:func:`ARKStepSetStopTime()`) or has requested rootfinding. - .. c:function:: int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) @@ -812,7 +508,9 @@ the user has set a stop time (with a call to the optional input function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. + .. deprecated:: x.y.z + Use :c:func:`ARKodeEvolve` instead. .. _ARKODE.Usage.ARKStep.OptionalInputs: @@ -820,68 +518,12 @@ the user has set a stop time (with a call to the optional input function Optional input functions ------------------------- -There are numerous optional input parameters that control the behavior -of ARKStep, each of which may be modified from its default value through -calling an appropriate input function. The following tables list all -optional input functions, grouped by which aspect of ARKStep they control. -Detailed information on the calling syntax and arguments for each -function are then provided following each table. - -The optional inputs are grouped into the following categories: - -* General ARKStep options (:ref:`ARKODE.Usage.ARKStep.ARKStepInputTable`), -* IVP method solver options (:ref:`ARKODE.Usage.ARKStep.ARKStepMethodInputTable`), -* Step adaptivity solver options (:ref:`ARKODE.Usage.ARKStep.ARKStepAdaptivityInputTable`), -* Implicit stage solver options (:ref:`ARKODE.Usage.ARKStep.ARKStepSolverInputTable`), -* Linear solver interface options (:ref:`ARKODE.Usage.ARKStep.ARKLsInputs`), and -* Rootfinding options (:ref:`ARKODE.Usage.ARKStep.ARKStepRootfindingInputTable`). - -For the most casual use of ARKStep, relying on the default set of -solver parameters, the reader can skip to section on user-supplied -functions, :numref:`ARKODE.Usage.UserSupplied`. - -We note that, on an error return, all of the optional input functions send an -error message to the error handler function. All error return values are -negative, so a test on the return arguments for negative values will catch all -errors. Finally, a call to an ``ARKStepSet***`` function can generally be made -from the user's calling program at any time and, if successful, takes effect -immediately. ``ARKStepSet***`` functions that cannot be called at any time note -this in the "**Notes**:" section of the function documentation. - - .. _ARKODE.Usage.ARKStep.ARKStepInputTable: Optional inputs for ARKStep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. cssclass:: table-bordered - -================================================ ======================================= ======================= -Optional input Function name Default -================================================ ======================================= ======================= -Return ARKStep parameters to their defaults :c:func:`ARKStepSetDefaults` internal -Set dense output interpolation type :c:func:`ARKStepSetInterpolantType` ``ARK_INTERP_HERMITE`` -Set dense output polynomial degree :c:func:`ARKStepSetInterpolantDegree` 5 -Supply a pointer to a diagnostics output file :c:func:`ARKStepSetDiagnostics` ``NULL`` -Disable time step adaptivity (fixed-step mode) :c:func:`ARKStepSetFixedStep` disabled -Supply an initial step size to attempt :c:func:`ARKStepSetInitStep` estimated -Maximum no. of warnings for :math:`t_n+h = t_n` :c:func:`ARKStepSetMaxHnilWarns` 10 -Maximum no. of internal steps before *tout* :c:func:`ARKStepSetMaxNumSteps` 500 -Maximum absolute step size :c:func:`ARKStepSetMaxStep` :math:`\infty` -Minimum absolute step size :c:func:`ARKStepSetMinStep` 0.0 -Set a value for :math:`t_{stop}` :c:func:`ARKStepSetStopTime` undefined -Interpolate at :math:`t_{stop}` :c:func:`ARKStepSetInterpolateStopTime` ``SUNFALSE`` -Disable the stop time :c:func:`ARKStepClearStopTime` N/A -Supply a pointer for user data :c:func:`ARKStepSetUserData` ``NULL`` -Maximum no. of ARKStep error test failures :c:func:`ARKStepSetMaxErrTestFails` 7 -Set 'optimal' adaptivity params. for a method :c:func:`ARKStepSetOptimalParams` internal -Set inequality constraints on solution :c:func:`ARKStepSetConstraints` ``NULL`` -Set max number of constraint failures :c:func:`ARKStepSetMaxNumConstrFails` 10 -================================================ ======================================= ======================= - - - .. c:function:: int ARKStepSetDefaults(void* arkode_mem) @@ -903,6 +545,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`ARKStepRootInit()`). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDefaults` instead. .. c:function:: int ARKStepSetInterpolantType(void* arkode_mem, int itype) @@ -937,6 +582,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst If this routine is not called, the Hermite interpolation module will be used. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantType` instead. .. c:function:: int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) @@ -979,14 +627,16 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst obtained by the integrator are returned at the ends of the time interval. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int ARKStepSetDenseOrder(void* arkode_mem, int dord) - *This function is deprecated, and will be removed in a future release. - Users should transition to calling* :c:func:`ARKStepSetInterpolantDegree()` - *instead.* + .. deprecated:: 5.2.0 + Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int ARKStepSetDiagnostics(void* arkode_mem, FILE* diagfp) @@ -1073,7 +723,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst routines will provide no useful information to the solver, and at worst they may interfere with the desired fixed step size. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetFixedStep` instead. @@ -1101,7 +753,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst This routine will also reset the step size and error history. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetInitStep` instead. .. c:function:: int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) @@ -1125,7 +779,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst A negative value indicates that no warning messages should be issued. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetMaxHnilWarns` instead. .. c:function:: int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) @@ -1149,6 +805,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst Passing *mxsteps* < 0 disables the test (not recommended). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNumSteps` instead. .. c:function:: int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) @@ -1167,6 +826,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxStep` instead. .. c:function:: int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) @@ -1185,6 +847,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMinStep` instead. .. c:function:: int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -1212,6 +877,10 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst :c:func:`ARKStepReset` will remain active but can be disabled by calling :c:func:`ARKStepClearStopTime`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStopTime` instead. + .. c:function:: int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -1229,6 +898,10 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolateStopTime` instead. + .. c:function:: int ARKStepClearStopTime(void* arkode_mem) @@ -1247,6 +920,10 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst .. versionadded:: 5.5.1 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeClearStopTime` instead. + .. c:function:: int ARKStepSetUserData(void* arkode_mem, void* user_data) @@ -1271,6 +948,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst this function must be made *before* any calls to :c:func:`ARKStepSetLinearSolver()` and/or :c:func:`ARKStepSetMassLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetUserData` instead. .. c:function:: int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) @@ -1291,6 +971,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst The default value is 7; set *maxnef* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxErrTestFails` instead. .. c:function:: int ARKStepSetOptimalParams(void* arkode_mem) @@ -1314,6 +997,148 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst all problems are different, so these values may not be optimal for all users. + .. deprecated:: x.y.z + + Adjust solver parameters individually instead. For reference, this routine + sets the following non-default parameters: + + * Explicit methods: + + * :c:func:`SUNAdaptController_PI` with :c:func:`SUNAdaptController_SetErrorBias` of 1.2 and :c:func:`SUNAdaptController_SetParams_PI` of :math:`k_1=0.8` and :math:`k_2=-0.31` + + * :c:func:`ARKodeSetSafetyFactor` of 0.99 + + * :c:func:`ARKodeSetMaxGrowth` of 25.0 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.3 + + * Implicit methods: + + * Order 3: + + * :c:func:`SUNAdaptController_I` with :c:func:`SUNAdaptController_SetErrorBias` of 1.9 + + * :c:func:`ARKodeSetSafetyFactor` of 0.957 + + * :c:func:`ARKodeSetMaxGrowth` of 17.6 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.45 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.22 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.17 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.19 + + * Order 4: + + * :c:func:`SUNAdaptController_PID` with :c:func:`SUNAdaptController_SetErrorBias` of 1.2 and :c:func:`SUNAdaptController_SetParams_PID` of :math:`k_1=0.535`, :math:`k_2=-0.209`, and :math:`k_3=0.148` + + * :c:func:`ARKodeSetSafetyFactor` of 0.988 + + * :c:func:`ARKodeSetMaxGrowth` of 31.5 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.33 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.24 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.26 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.16 + + * :c:func:`ARKodeSetLSetupFrequency` of 31 + + * Order 5: + + * :c:func:`SUNAdaptController_PID` with :c:func:`SUNAdaptController_SetErrorBias` of 3.3 and :c:func:`SUNAdaptController_SetParams_PID` of :math:`k_1=0.56`, :math:`k_2=-0.338`, and :math:`k_3=0.14` + + * :c:func:`ARKodeSetSafetyFactor` of 0.937 + + * :c:func:`ARKodeSetMaxGrowth` of 22.0 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.44 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.25 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.4 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.32 + + * :c:func:`ARKodeSetLSetupFrequency` of 31 + + * ImEx methods: + + * Order 2: + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.001 + + * :c:func:`ARKodeSetMaxNonlinIters` of 5 + + * Order 3: + + * :c:func:`SUNAdaptController_PID` with :c:func:`SUNAdaptController_SetErrorBias` of 1.42 and :c:func:`SUNAdaptController_SetParams_PID` of :math:`k_1=0.54`, :math:`k_2=-0.36`, and :math:`k_3=0.14` + + * :c:func:`ARKodeSetSafetyFactor` of 0.965 + + * :c:func:`ARKodeSetMaxGrowth` of 28.7 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.46 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.22 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.17 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.19 + + * :c:func:`ARKodeSetLSetupFrequency` of 60 + + * Order 4: + + * :c:func:`SUNAdaptController_PID` with :c:func:`SUNAdaptController_SetErrorBias` of 1.35 and :c:func:`SUNAdaptController_SetParams_PID` of :math:`k_1=0.543`, :math:`k_2=-0.297`, and :math:`k_3=0.14` + + * :c:func:`ARKodeSetSafetyFactor` of 0.97 + + * :c:func:`ARKodeSetMaxGrowth` of 25.0 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.47 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.24 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.26 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.16 + + * :c:func:`ARKodeSetLSetupFrequency` of 31 + + * Order 5: + + * :c:func:`SUNAdaptController_PI` with :c:func:`SUNAdaptController_SetErrorBias` of 1.15 and :c:func:`SUNAdaptController_SetParams_PI` of :math:`k_1=0.8` and :math:`k_2=-0.35` + + * :c:func:`ARKodeSetSafetyFactor` of 0.993 + + * :c:func:`ARKodeSetMaxGrowth` of 28.5 + + * :c:func:`ARKodeSetMaxEFailGrowth` of 0.3 + + * :c:func:`ARKodeSetNonlinConvCoef` of 0.25 + + * :c:func:`ARKodeSetNonlinCRDown` of 0.4 + + * :c:func:`ARKodeSetNonlinRDiv` of 2.3 + + * :c:func:`ARKodeSetDeltaGammaMax` of 0.32 + + * :c:func:`ARKodeSetLSetupFrequency` of 31 .. c:function:: int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) @@ -1358,6 +1183,10 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst and :c:func:`ARKStepSetFixedStep()` are incompatible, and should not be used simultaneously. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetConstraints` instead. + .. c:function:: int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) @@ -1376,6 +1205,9 @@ Set max number of constraint failures :c:func:`ARKStepSetMaxNumConst Passing *maxfails* <= 0 results in ARKStep using the default value (10). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNumConstrFails` instead. .. _ARKODE.Usage.ARKStep.ARKStepMethodInputTable: @@ -1424,6 +1256,9 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int ARKStep memory block, it cannot be changed after the first call to :c:func:`ARKStepEvolve()`, unless :c:func:`ARKStepReInit()` is called. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetOrder` instead. .. c:function:: int ARKStepSetImEx(void* arkode_mem) @@ -1542,6 +1377,8 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int :c:func:`ARKStepSetFixedStep()` to enable fixed-step mode and set the desired time step size. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. @@ -1581,6 +1418,9 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int In all cases, error-checking is performed to ensure that the tables exist. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. + @@ -1621,6 +1461,9 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int In all cases, error-checking is performed to ensure that the tables exist. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. + @@ -1629,34 +1472,6 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int Optional inputs for time step adaptivity ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The mathematical explanation of ARKODE's time step adaptivity -algorithm, including how each of the parameters below is used within -the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. - - -.. cssclass:: table-bordered - -========================================================= ========================================== ======== -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) @@ -1673,6 +1488,10 @@ Explicit stability function :c:func:`ARKStepSetS .. versionadded:: 5.7.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetAdaptController` instead. + .. c:function:: int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) @@ -1767,6 +1586,12 @@ Explicit stability function :c:func:`ARKStepSetS .. versionadded:: 5.7.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetAdaptivityAdjustment` instead. + + + .. c:function:: int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1784,6 +1609,9 @@ Explicit stability function :c:func:`ARKStepSetS Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetCFLFraction` instead. .. c:function:: int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) @@ -1830,6 +1658,9 @@ Explicit stability function :c:func:`ARKStepSetS **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetFixedStepBounds` instead. .. c:function:: int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) @@ -1851,6 +1682,9 @@ Explicit stability function :c:func:`ARKStepSetS **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxCFailGrowth` instead. .. c:function:: int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) @@ -1870,6 +1704,9 @@ Explicit stability function :c:func:`ARKStepSetS **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxEFailGrowth` instead. .. c:function:: int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) @@ -1890,6 +1727,9 @@ Explicit stability function :c:func:`ARKStepSetS **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxFirstGrowth` instead. .. c:function:: int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) @@ -1910,6 +1750,9 @@ Explicit stability function :c:func:`ARKStepSetS Any value :math:`\le 1.0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxGrowth` instead. .. c:function:: int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) @@ -1932,6 +1775,9 @@ Explicit stability function :c:func:`ARKStepSetS Any value outside the interval :math:`(0,1)` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMinReduction` instead. .. c:function:: int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) @@ -1952,6 +1798,9 @@ Explicit stability function :c:func:`ARKStepSetS Any value :math:`\le 0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetSafetyFactor` instead. .. c:function:: int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) @@ -1972,6 +1821,9 @@ Explicit stability function :c:func:`ARKStepSetS **Notes:** Any value :math:`\le 0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetSmallNumEFails` instead. .. c:function:: int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) @@ -1998,6 +1850,9 @@ Explicit stability function :c:func:`ARKStepSetS be quite useful for problems where the explicit right-hand side function :math:`f^E(t,y)` contains stiff terms. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStabilityFn` instead. @@ -2006,32 +1861,6 @@ Explicit stability function :c:func:`ARKStepSetS Optional inputs for implicit stage solves ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The mathematical explanation for the nonlinear solver strategies used -by ARKStep, including how each of the parameters below is used within -the code, is provided in :numref:`ARKODE.Mathematics.Nonlinear`. - - -.. cssclass:: table-bordered - -========================================================= ========================================= ============ -Optional input Function name Default -========================================================= ========================================= ============ -Specify that :math:`f^I` is linearly implicit :c:func:`ARKStepSetLinear()` ``SUNFALSE`` -Specify that :math:`f^I` is nonlinearly implicit :c:func:`ARKStepSetNonlinear()` ``SUNTRUE`` -Implicit predictor method :c:func:`ARKStepSetPredictorMethod()` 0 -User-provided implicit stage predictor :c:func:`ARKStepSetStagePredictFn()` ``NULL`` -RHS function for nonlinear system evaluations :c:func:`ARKStepSetNlsRhsFn()` ``NULL`` -Maximum number of nonlinear iterations :c:func:`ARKStepSetMaxNonlinIters()` 3 -Coefficient in the nonlinear convergence test :c:func:`ARKStepSetNonlinConvCoef()` 0.1 -Nonlinear convergence rate constant :c:func:`ARKStepSetNonlinCRDown()` 0.3 -Nonlinear residual divergence ratio :c:func:`ARKStepSetNonlinRDiv()` 2.3 -Maximum number of convergence failures :c:func:`ARKStepSetMaxConvFails()` 10 -Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDeduceImplicitRhs` ``SUNFALSE`` -========================================================= ========================================= ============ - - - - .. c:function:: int ARKStepSetLinear(void* arkode_mem, int timedepend) @@ -2061,6 +1890,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe stage. Thus one must balance the relative costs of such recomputation against the benefits of requiring only a single Newton linear solve. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinear` instead. .. c:function:: int ARKStepSetNonlinear(void* arkode_mem) @@ -2082,6 +1914,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe :c:func:`ARKStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinear` instead. .. c:function:: int ARKStepSetPredictorMethod(void* arkode_mem, int method) @@ -2127,6 +1962,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe instead default to the trivial predictor (*method* 0). **Both of these options have been deprecated, and will be removed from a future release.** + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetPredictorMethod` instead. .. c:function:: int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) @@ -2147,6 +1985,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStagePredictFn` instead. .. c:function:: int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) @@ -2172,6 +2013,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe When using a non-default nonlinear solver, this function must be called *after* :c:func:`ARKStepSetNonlinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNlsRhsFn` instead. .. c:function:: int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) @@ -2193,6 +2037,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe The default value is 3; set *maxcor* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNonlinIters` instead. .. c:function:: int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) @@ -2213,6 +2060,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinConvCoef` instead. .. c:function:: int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) @@ -2231,6 +2081,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinCRDown` instead. .. c:function:: int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) @@ -2251,6 +2104,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinRDiv` instead. .. c:function:: int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) @@ -2279,6 +2135,9 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe convergence failure still occurs, the time step size is reduced by the factor *etacf* (set within :c:func:`ARKStepSetMaxCFailGrowth()`). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxConvFails` instead. .. c:function:: int ARKStepSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) @@ -2299,6 +2158,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe .. versionadded:: 5.2.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDeduceImplicitRhs` instead. + .. _ARKODE.Usage.ARKStep.ARKLsInputs: @@ -2306,81 +2169,13 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`ARKStepSetDe Linear solver interface optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The mathematical explanation of the linear solver methods -available to ARKStep is provided in :numref:`ARKODE.Mathematics.Linear`. We group -the user-callable routines into four categories: general routines concerning -the update frequency for matrices and/or preconditioners, optional inputs for -matrix-based linear solvers, optional inputs for matrix-free linear solvers, -and optional inputs for iterative linear solvers. We note that the -matrix-based and matrix-free groups are mutually exclusive, whereas the -"iterative" tag can apply to either case. - - .. _ARKODE.Usage.ARKStep.ARKLsInputs.General: -.. index:: - single: optional input; generic linear solver interface (ARKStep) Optional inputs for the ARKLS linear solver interface """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -As discussed in :numref:`ARKODE.Mathematics.Linear.Setup`, ARKODE -strives to reuse matrix and preconditioner data for as many solves as -possible to amortize the high costs of matrix construction and -factorization. To that end, ARKStep provides user-callable -routines to modify this behavior. Recall that the -Newton system matrices that arise within an implicit stage solve are -:math:`\mathcal{A}(t,z) \approx M(t) - \gamma J(t,z)`, where the -implicit right-hand side function has Jacobian matrix -:math:`J(t,z) = \frac{\partial f^I(t,z)}{\partial z}`. - -The matrix or preconditioner for :math:`\mathcal{A}` can only be -updated within a call to the linear solver "setup" routine. In -general, the frequency with which the linear solver setup routine is -called may be controlled with the *msbp* argument to -:c:func:`ARKStepSetLSetupFrequency()`. When this occurs, the -validity of :math:`\mathcal{A}` for successive time steps -intimately depends on whether the corresponding :math:`\gamma` and -:math:`J` inputs remain valid. - -At each call to the linear solver setup routine the decision to update -:math:`\mathcal{A}` with a new value of :math:`\gamma`, and to reuse -or reevaluate Jacobian information, depends on several factors including: - -* the success or failure of previous solve attempts, -* the success or failure of the previous time step attempts, -* the change in :math:`\gamma` from the value used when constructing :math:`\mathcal{A}`, and -* the number of steps since Jacobian information was last evaluated. - -Jacobian information is considered out-of-date when :math:`msbj` or more steps -have been completed since the last update, in which case it will be recomputed during the next -linear solver setup call. The value of :math:`msbj` is controlled with the -``msbj`` argument to :c:func:`ARKStepSetJacEvalFrequency()`. - -For linear-solvers with user-supplied preconditioning the above factors are used -to determine whether to recommend updating the Jacobian information in the -preconditioner (i.e., whether to set *jok* to ``SUNFALSE`` in calling the -user-supplied :c:type:`ARKLsPrecSetupFn()`). For matrix-based linear solvers -these factors determine whether the matrix :math:`J(t,y) = \frac{\partial f^I(t,y)}{\partial y}` -should be updated (either with an internal finite difference approximation or -a call to the user-supplied :c:type:`ARKLsJacFn`); if not then the previous -value is reused and the system matrix :math:`\mathcal{A}(t,y) \approx M(t) - \gamma J(t,y)` -is recomputed using the current :math:`\gamma` value. - - - -.. _ARKODE.Usage.ARKStep.ARKLsInputs.General.Table: -.. table:: Optional inputs for the ARKLS linear solver interface - - ============================================= ========================================= ============ - Optional input Function name Default - ============================================= ========================================= ============ - Max change in step signaling new :math:`J` :c:func:`ARKStepSetDeltaGammaMax()` 0.2 - Linear solver setup frequency :c:func:`ARKStepSetLSetupFrequency()` 20 - Jacobian / preconditioner update frequency :c:func:`ARKStepSetJacEvalFrequency()` 51 - ============================================= ========================================= ============ - .. c:function:: int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) @@ -2401,9 +2196,11 @@ is recomputed using the current :math:`\gamma` value. **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDeltaGammaMax` instead. + -.. index:: - single: optional input; linear solver setup frequency (ARKStep) .. c:function:: int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) @@ -2425,10 +2222,10 @@ is recomputed using the current :math:`\gamma` value. step. If **msbp** is 0, the default value of 20 will be used. A negative value forces a linear solver step at each implicit stage. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLSetupFrequency` instead. -.. index:: - single: optional input; Jacobian update frequency (ARKStep) - single: optional input; preconditioner update frequency (ARKStep) .. c:function:: int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) @@ -2462,7 +2259,9 @@ is recomputed using the current :math:`\gamma` value. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetJacEvalFrequency` instead. @@ -2473,59 +2272,6 @@ is recomputed using the current :math:`\gamma` value. Optional inputs for matrix-based ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -========================================= =========================================== ============= -Optional input Function name Default -========================================= =========================================== ============= -Jacobian function :c:func:`ARKStepSetJacFn()` ``DQ`` -Linear system function :c:func:`ARKStepSetLinSysFn()` internal -Mass matrix function :c:func:`ARKStepSetMassFn()` none -Enable or disable linear solution scaling :c:func:`ARKStepSetLinearSolutionScaling()` on -========================================= =========================================== ============= - -When using matrix-based linear solver modules, the ARKLS solver interface needs -a function to compute an approximation to the Jacobian matrix :math:`J(t,y)` or -the linear system :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)`. - -For :math:`J(t,y)`, the ARKLS interface is packaged with a routine that can approximate -:math:`J` if the user has selected either the :ref:`SUNMATRIX_DENSE <SUNMatrix.Dense>` or -:ref:`SUNMATRIX_BAND <SUNMatrix.Band>` objects. Alternatively, -the user can supply a custom Jacobian function of type :c:func:`ARKLsJacFn()` -- this is -*required* when the user selects other matrix formats. To specify a user-supplied -Jacobian function, ARKStep provides the function :c:func:`ARKStepSetJacFn()`. - -Alternatively, a function of type :c:func:`ARKLsLinSysFn()` can be provided to -evaluate the matrix :math:`\mathcal{A}(t,y)`. By default, ARKLS uses an -internal linear system function leveraging the SUNMATRIX API to form the matrix -:math:`\mathcal{A}(t,y)` by combining the matrices :math:`M(t)` and :math:`J(t,y)`. -To specify a user-supplied linear system function instead, ARKStep provides the function -:c:func:`ARKStepSetLinSysFn()`. - -If the ODE system involves a non-identity mass matrix, :math:`M\ne I`, matrix-based linear -solver modules require a function to compute an approximation to the mass matrix :math:`M(t)`. -There is no default difference quotient approximation (for any matrix type), so this -routine must be supplied by the user. This function must be of type -:c:func:`ARKLsMassFn()`, and should be set using the function -:c:func:`ARKStepSetMassFn()`. - -In either case (:math:`J(t,y)` versus :math:`\mathcal{A}(t,y)` is supplied) the matrix -information will be updated infrequently to reduce matrix construction and, with direct -solvers, factorization costs. As a result the value of :math:`\gamma` may not be current -and a scaling factor is applied to the solution of the linear system to account for -the lagged value of :math:`\gamma`. See :numref:`SUNLinSol.Lagged_matrix` for more details. -The function :c:func:`ARKStepSetLinearSolutionScaling()` can be used to disable this -scaling when necessary, e.g., when providing a custom linear solver that updates the -matrix using the current :math:`\gamma` as part of the solve. - -The ARKLS interface passes the user data pointer to the Jacobian, linear -system, and mass matrix functions. This allows the user to create an arbitrary -structure with relevant problem data and access it during the execution of the -user-supplied Jacobian, linear system or mass matrix functions, without using global -data in the program. The user data pointer may be specified through -:c:func:`ARKStepSetUserData()`. - - .. c:function:: int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) @@ -2555,6 +2301,10 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetJacFn` instead. + .. c:function:: int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) @@ -2582,6 +2332,10 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinSysFn` instead. + .. c:function:: int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) @@ -2609,6 +2363,10 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsMassFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMassFn` instead. + .. c:function:: int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) @@ -2630,47 +2388,16 @@ data in the program. The user data pointer may be specified through Linear solution scaling is enabled by default when a matrix-based linear solver is attached. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinearSolutionScaling` instead. + .. _ARKODE.Usage.ARKStep.ARKLsInputs.MatrixFree: Optional inputs for matrix-free ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -================================================== ========================================= ================== -Optional input Function name Default -================================================== ========================================= ================== -:math:`Jv` functions (*jtimes* and *jtsetup*) :c:func:`ARKStepSetJacTimes()` DQ, none -:math:`Jv` DQ rhs function (*jtimesRhsFn*) :c:func:`ARKStepSetJacTimesRhsFn()` fi -:math:`Mv` functions (*mtimes* and *mtsetup*) :c:func:`ARKStepSetMassTimes()` none, none -================================================== ========================================= ================== - - -As described in :numref:`ARKODE.Mathematics.Linear`, when solving -the Newton linear systems with matrix-free methods, the ARKLS -interface requires a *jtimes* function to compute an approximation to -the product between the Jacobian matrix -:math:`J(t,y)` and a vector :math:`v`. The user can supply a custom -Jacobian-times-vector approximation function, or use the default -internal difference quotient function that comes with the ARKLS -interface. - -A user-defined Jacobian-vector function must be of type -:c:type:`ARKLsJacTimesVecFn` and can be specified through a call -to :c:func:`ARKStepSetJacTimes()` (see :numref:`ARKODE.Usage.UserSupplied` -for specification details). As with the -user-supplied preconditioner functions, the evaluation and -processing of any Jacobian-related data needed by the user's -Jacobian-times-vector function is done in the optional user-supplied -function of type :c:type:`ARKLsJacTimesSetupFn` (see -:numref:`ARKODE.Usage.UserSupplied` for specification details). As with -the preconditioner functions, a pointer to the user-defined -data structure, *user_data*, specified through -:c:func:`ARKStepSetUserData()` (or a ``NULL`` pointer otherwise) is -passed to the Jacobian-times-vector setup and product functions each -time they are called. - .. c:function:: int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, ARKLsJacTimesVecFn jtimes) @@ -2705,19 +2432,10 @@ time they are called. :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetJacTimes` instead. -When using the internal difference quotient the user may optionally supply -an alternative implicit right-hand side function for use in the Jacobian-vector -product approximation by calling :c:func:`ARKStepSetJacTimesRhsFn()`. The -alternative implicit right-hand side function should compute a suitable (and -differentiable) approximation to the :math:`f^I` function provided to -:c:func:`ARKStepCreate`. For example, as done in :cite:p:`dorr2010numerical`, -the alternative function may use lagged values when evaluating a nonlinearity -in :math:`f^I` to avoid differencing a potentially non-differentiable factor. -We note that in many instances this same :math:`f^I` routine would also have -been desirable for the nonlinear solver, in which case the user should specify -this through calls to *both* :c:func:`ARKStepSetJacTimesRhsFn()` and -:c:func:`ARKStepSetNlsRhsFn()`. .. c:function:: int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) @@ -2744,21 +2462,9 @@ this through calls to *both* :c:func:`ARKStepSetJacTimesRhsFn()` and This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. + .. deprecated:: x.y.z - -Similarly, if a problem involves a non-identity mass matrix, -:math:`M\ne I`, then matrix-free solvers require a *mtimes* function -to compute an approximation to the product between the mass matrix -:math:`M(t)` and a vector :math:`v`. This function must be -user-supplied since there is no default value, it must be -of type :c:func:`ARKLsMassTimesVecFn()`, and can be specified -through a call to the :c:func:`ARKStepSetMassTimes()` routine. -Similarly to the user-supplied preconditioner functions, any evaluation -and processing of any mass matrix-related data needed by the user's -mass-matrix-times-vector function may be done in an optional user-supplied -function of type :c:type:`ARKLsMassTimesSetupFn` (see -:numref:`ARKODE.Usage.UserSupplied` for specification details). - + Use :c:func:`ARKodeSetJacTimesRhsFn` instead. .. c:function:: int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, ARKLsMassTimesVecFn mtimes, void* mtimes_data) @@ -2797,6 +2503,9 @@ function of type :c:type:`ARKLsMassTimesSetupFn` (see :c:type:`ARKLsMassTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMassTimes` instead. @@ -2805,51 +2514,6 @@ function of type :c:type:`ARKLsMassTimesSetupFn` (see Optional inputs for iterative ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -==================================================== ========================================= ================== -Optional input Function name Default -==================================================== ========================================= ================== -Newton preconditioning functions :c:func:`ARKStepSetPreconditioner()` ``NULL``, ``NULL`` -Mass matrix preconditioning functions :c:func:`ARKStepSetMassPreconditioner()` ``NULL``, ``NULL`` -Newton linear and nonlinear tolerance ratio :c:func:`ARKStepSetEpsLin()` 0.05 -Mass matrix linear and nonlinear tolerance ratio :c:func:`ARKStepSetMassEpsLin()` 0.05 -Newton linear solve tolerance conversion factor :c:func:`ARKStepSetLSNormFactor()` vector length -Mass matrix linear solve tolerance conversion factor :c:func:`ARKStepSetMassLSNormFactor()` vector length -==================================================== ========================================= ================== - - -As described in :numref:`ARKODE.Mathematics.Linear`, when using -an iterative linear solver the user may supply a preconditioning -operator to aid in solution of the system. This operator consists of -two user-supplied functions, *psetup* and *psolve*, that are supplied -to ARKStep using either the function -:c:func:`ARKStepSetPreconditioner()` (for preconditioning the -Newton system), or the function -:c:func:`ARKStepSetMassPreconditioner()` (for preconditioning the -mass matrix system). The *psetup* function supplied to these routines -should handle evaluation and preprocessing of any Jacobian or -mass-matrix data needed by the user's preconditioner solve function, -*psolve*. The user data pointer received through -:c:func:`ARKStepSetUserData()` (or a pointer to ``NULL`` if user data -was not specified) is passed to the *psetup* and *psolve* functions. -This allows the user to create an arbitrary -structure with relevant problem data and access it during the -execution of the user-supplied preconditioner functions without using -global data in the program. If preconditioning is supplied for both -the Newton and mass matrix linear systems, it is expected that the -user will supply different *psetup* and *psolve* function for each. - -Also, as described in :numref:`ARKODE.Mathematics.Error.Linear`, the -ARKLS interface requires that iterative linear solvers stop when -the norm of the preconditioned residual satisfies - -.. math:: - \|r\| \le \frac{\epsilon_L \epsilon}{10} - -where the default :math:`\epsilon_L = 0.05` may be modified by -the user through the :c:func:`ARKStepSetEpsLin()` function. - .. c:function:: int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) @@ -2882,6 +2546,10 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetPreconditioner` instead. + .. c:function:: int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, ARKLsMassPrecSolveFn psolve) @@ -2914,6 +2582,9 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. :c:func:`ARKLsMassPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMassPreconditioner` instead. .. c:function:: int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2940,6 +2611,9 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetEpsLin` instead. .. c:function:: int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2966,20 +2640,9 @@ the user through the :c:func:`ARKStepSetEpsLin()` function. Passing a value *eplifac* :math:`\le 0` indicates to use the default value of 0.05. + .. deprecated:: x.y.z -Since iterative linear solver libraries typically consider linear residual -tolerances using the :math:`L_2` norm, whereas ARKODE focuses on errors -measured in the WRMS norm :eq:`ARKODE_WRMS_NORM`, the ARKLS interface internally -converts between these quantities when interfacing with linear solvers, - -.. math:: - \text{tol}_{L2} = \text{\em nrmfac}\; \text{tol}_{WRMS}. - :label: ARKODE_NRMFAC - -Prior to the introduction of :c:func:`N_VGetLength` in SUNDIALS v5.0.0 the -value of :math:`nrmfac` was computed using the vector dot product. Now, the -functions :c:func:`ARKStepSetLSNormFactor()` and :c:func:`ARKStepSetMassLSNormFactor()` -allow for additional user control over these conversion factors. + Use :c:func:`ARKodeSetMassEpsLin` instead. .. c:function:: int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -3009,6 +2672,9 @@ allow for additional user control over these conversion factors. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLSNormFactor` instead. .. c:function:: int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -3038,31 +2704,15 @@ allow for additional user control over these conversion factors. This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKStepSetMassLinearSolver()`. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetMassLSNormFactor` instead. -.. _ARKODE.Usage.ARKStep.ARKStepRootfindingInputTable: - Rootfinding optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following functions can be called to set optional inputs to -control the rootfinding algorithm, the mathematics of which are -described in :numref:`ARKODE.Mathematics.Rootfinding`. - - -.. cssclass:: table-bordered - -====================================== ======================================== ================== -Optional input Function name Default -====================================== ======================================== ================== -Direction of zero-crossings to monitor :c:func:`ARKStepSetRootDirection()` both -Disable inactive root warnings :c:func:`ARKStepSetNoInactiveRootWarn()` enabled -====================================== ======================================== ================== - - - .. c:function:: int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) Specifies the direction of zero-crossings to be located and returned. @@ -3085,6 +2735,9 @@ Disable inactive root warnings :c:func:`ARKStepSetNoInactiveRootWarn()` **Notes:** The default behavior is to monitor for both zero-crossing directions. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRootDirection` instead. .. c:function:: int ARKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -3108,7 +2761,9 @@ Disable inactive root warnings :c:func:`ARKStepSetNoInactiveRootWarn()` first step), ARKStep will issue a warning which can be disabled with this optional input function. + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -3117,19 +2772,6 @@ Disable inactive root warnings :c:func:`ARKStepSetNoInactiveRootWarn()` Interpolated output function -------------------------------- -An optional function :c:func:`ARKStepGetDky()` is available to obtain -additional values of solution-related quantities. This function -should only be called after a successful return from -:c:func:`ARKStepEvolve()`, as it provides interpolated values either of -:math:`y` or of its derivatives (up to the 5th derivative) -interpolated to any value of :math:`t` in the last internal step taken -by :c:func:`ARKStepEvolve()`. Internally, this "dense output" or -"continuous extension" algorithm is identical to the algorithm used for -the maximum order implicit predictors, described in -:numref:`ARKODE.Mathematics.Predictors.Max`, except that derivatives of the -polynomial model may be evaluated upon request. - - .. c:function:: int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) @@ -3168,6 +2810,9 @@ polynomial model may be evaluated upon request. functions :c:func:`ARKStepGetCurrentTime()` and :c:func:`ARKStepGetLastStep()`, respectively. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetDky` instead. @@ -3176,101 +2821,11 @@ polynomial model may be evaluated upon request. Optional output functions ------------------------------ -ARKStep provides an extensive set of functions that can be used to -obtain solver performance information. We organize these into groups: - -#. General ARKStep output routines are in - :numref:`ARKODE.Usage.ARKStep.ARKStepMainOutputs`, -#. ARKStep implicit solver output routines are in - :numref:`ARKODE.Usage.ARKStep.ARKStepImplicitSolverOutputs`, -#. Output routines regarding root-finding results are in - :numref:`ARKODE.Usage.ARKStep.ARKStepRootOutputs`, -#. Linear solver output routines are in - :numref:`ARKODE.Usage.ARKStep.ARKLsOutputs` and -#. General usability routines (e.g. to print the current ARKStep - parameters, or output the current Butcher table(s)) are in - :numref:`ARKODE.Usage.ARKStep.ARKStepExtraOutputs`. - -Following each table, we elaborate on each function. - -Some of the optional outputs, especially the various counters, can be -very useful in determining the efficiency of various methods inside -ARKStep. For example: - -* The counters *nsteps*, *nfe_evals* and *nfi_evals* - provide a rough measure of the overall cost of a given run, and can - be compared between runs with different solver options to suggest - which set of options is the most efficient. - -* The ratio *nniters/nsteps* measures the performance of the - nonlinear iteration in solving the nonlinear systems at each stage, - providing a measure of the degree of nonlinearity in the problem. - Typical values of this for a Newton solver on a general problem - range from 1.1 to 1.8. - -* When using a Newton nonlinear solver, the ratio *njevals/nniters* - (when using a direct linear solver), and the ratio - *nliters/nniters* (when using an iterative linear solver) can - indicate the quality of the approximate Jacobian or preconditioner being - used. For example, if this ratio is larger for a user-supplied - Jacobian or Jacobian-vector product routine than for the - difference-quotient routine, it can indicate that the user-supplied - Jacobian is inaccurate. - -* The ratio *expsteps/accsteps* can measure the quality of the ImEx - splitting used, since a higher-quality splitting will be dominated - by accuracy-limited steps, and hence a lower ratio. - -* The ratio *nsteps/step_attempts* can measure the quality of the - time step adaptivity algorithm, since a poor algorithm will result - in more failed steps, and hence a lower ratio. - -It is therefore recommended that users retrieve and output these -statistics following each run, and take some time to investigate -alternate solver options that will be more optimal for their -particular problem of interest. - - - .. _ARKODE.Usage.ARKStep.ARKStepMainOutputs: Main solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. cssclass:: table-bordered - -===================================================== ============================================ -Optional output Function name -===================================================== ============================================ -Size of ARKStep real and integer workspaces :c:func:`ARKStepGetWorkSpace()` -Cumulative number of internal steps :c:func:`ARKStepGetNumSteps()` -Actual initial time step size used :c:func:`ARKStepGetActualInitStep()` -Step size used for the last successful step :c:func:`ARKStepGetLastStep()` -Step size to be attempted on the next step :c:func:`ARKStepGetCurrentStep()` -Current internal time reached by the solver :c:func:`ARKStepGetCurrentTime()` -Current internal solution reached by the solver :c:func:`ARKStepGetCurrentState()` -Current :math:`\gamma` value used by the solver :c:func:`ARKStepGetCurrentGamma()` -Suggested factor for tolerance scaling :c:func:`ARKStepGetTolScaleFactor()` -Error weight vector for state variables :c:func:`ARKStepGetErrWeights()` -Residual weight vector :c:func:`ARKStepGetResWeights()` -Single accessor to many statistics at once :c:func:`ARKStepGetStepStats()` -Print all statistics :c:func:`ARKStepPrintAllStats` -Name of constant associated with a return flag :c:func:`ARKStepGetReturnFlagName()` -No. of explicit stability-limited steps :c:func:`ARKStepGetNumExpSteps()` -No. of accuracy-limited steps :c:func:`ARKStepGetNumAccSteps()` -No. of attempted steps :c:func:`ARKStepGetNumStepAttempts()` -No. of calls to *fe* and *fi* functions :c:func:`ARKStepGetNumRhsEvals()` -No. of local error test failures that have occurred :c:func:`ARKStepGetNumErrTestFails()` -No. of failed steps due to a nonlinear solver failure :c:func:`ARKStepGetNumStepSolveFails()` -Current ERK and DIRK Butcher tables :c:func:`ARKStepGetCurrentButcherTables()` -Estimated local truncation error vector :c:func:`ARKStepGetEstLocalErrors()` -Single accessor to many statistics at once :c:func:`ARKStepGetTimestepperStats()` -Number of constraint test failures :c:func:`ARKStepGetNumConstrFails()` -Retrieve a pointer for user data :c:func:`ARKStepGetUserData` -===================================================== ============================================ - - - .. c:function:: int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) @@ -3285,6 +2840,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetWorkSpace` instead. .. c:function:: int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) @@ -3300,6 +2858,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumSteps` instead. .. c:function:: int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) @@ -3323,6 +2884,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa local error test condition, or to ensure convergence of the nonlinear solver. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetActualInitStep` instead. .. c:function:: int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -3338,6 +2902,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLastStep` instead. .. c:function:: int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -3352,6 +2919,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentStep` instead. .. c:function:: int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -3366,6 +2936,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentTime` instead. .. c:function:: int ARKStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -3385,6 +2958,10 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentState` instead. + .. c:function:: int ARKStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) @@ -3399,6 +2976,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentGamma` instead. .. c:function:: int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -3415,6 +2995,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetTolScaleFactor` instead. .. c:function:: int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -3433,6 +3016,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa The user must allocate space for *eweight*, that will be filled in by this function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetErrWeights` instead. .. c:function:: int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) @@ -3451,6 +3037,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa The user must allocate space for *rweight*, that will be filled in by this function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetResWeights` instead. .. c:function:: int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -3469,6 +3058,10 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetStepStats` instead. + .. c:function:: int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -3497,8 +3090,12 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa .. versionadded:: 5.2.0 + .. deprecated:: x.y.z -.. c:function:: char *ARKStepGetReturnFlagName(long int flag) + Use :c:func:`ARKodePrintAllStats` instead. + + +.. c:function:: char* ARKStepGetReturnFlagName(long int flag) Returns the name of the ARKStep constant corresponding to *flag*. See :ref:`ARKODE.Constants`. @@ -3510,7 +3107,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa The return value is a string containing the name of the corresponding constant. + .. deprecated:: x.y.z + Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -3527,6 +3126,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumExpSteps` instead. .. c:function:: int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps) @@ -3542,6 +3144,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumAccSteps` instead. .. c:function:: int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -3556,6 +3161,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumStepAttempts` instead. .. c:function:: int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, long int* nfi_evals) @@ -3591,6 +3199,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumErrTestFails` instead. .. c:function:: int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* ncnf) @@ -3605,6 +3216,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumStepSolveFails` instead. .. c:function:: int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable *Bi, ARKodeButcherTable *Be) @@ -3670,6 +3284,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetEstLocalErrors` instead. .. c:function:: int ARKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, long int* accsteps, long int* step_attempts, long int* nfe_evals, long int* nfi_evals, long int* nlinsetups, long int* netfails) @@ -3704,6 +3321,9 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumConstrFails` instead. .. c:function:: int ARKStepGetUserData(void* arkode_mem, void** user_data) @@ -3721,26 +3341,16 @@ Retrieve a pointer for user data :c:func:`ARKStepGetUserDa .. versionadded:: 5.3.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetUserData` instead. + .. _ARKODE.Usage.ARKStep.ARKStepImplicitSolverOutputs: Implicit solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. cssclass:: table-bordered - -=================================================== ============================================ -Optional output Function name -=================================================== ============================================ -No. of calls to linear solver setup function :c:func:`ARKStepGetNumLinSolvSetups()` -No. of nonlinear solver iterations :c:func:`ARKStepGetNumNonlinSolvIters()` -No. of nonlinear solver convergence failures :c:func:`ARKStepGetNumNonlinSolvConvFails()` -Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSolvStats()` -=================================================== ============================================ - - - - .. c:function:: int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) Returns the number of calls made to the linear solver's @@ -3758,6 +3368,10 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSo solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinSolvSetups` instead. + .. c:function:: int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) @@ -3777,6 +3391,9 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSo solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. .. c:function:: int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) @@ -3796,6 +3413,9 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSo solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. .. c:function:: int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) @@ -3816,6 +3436,9 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSo solver object; the counters are reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinSolvStats` instead. @@ -3824,17 +3447,6 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKStepGetNonlinSo Rootfinding optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. cssclass:: table-bordered - -=================================================== ========================================== -Optional output Function name -=================================================== ========================================== -Array showing roots found :c:func:`ARKStepGetRootInfo()` -No. of calls to user root function :c:func:`ARKStepGetNumGEvals()` -=================================================== ========================================== - - - .. c:function:: int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) Returns an array showing which functions were found to @@ -3862,6 +3474,9 @@ No. of calls to user root function :c:func:`ARKStepGetNumGEval zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetRootInfo` instead. .. c:function:: int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -3877,7 +3492,9 @@ No. of calls to user root function :c:func:`ARKStepGetNumGEval * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + Use :c:func:`ARKodeGetNumGEvals` instead. .. _ARKODE.Usage.ARKStep.ARKLsOutputs: @@ -3885,47 +3502,6 @@ No. of calls to user root function :c:func:`ARKStepGetNumGEval Linear solver interface optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -A variety of optional outputs are available from the ARKLS interface, -as listed in the following table and elaborated below. We note that -where the name of an output would otherwise conflict with the -name of an optional output from the main solver, a suffix LS (for -Linear Solver) or MLS (for Mass Linear Solver) has been added here -(e.g. *lenrwLS*). - - - -.. cssclass:: table-bordered - -================================================================= ======================================== -Optional output Function name -================================================================= ======================================== -Stored Jacobian of the ODE RHS function :c:func:`ARKStepGetJac` -Time at which the Jacobian was evaluated :c:func:`ARKStepGetJacTime` -Step number at which the Jacobian was evaluated :c:func:`ARKStepGetJacNumSteps` -Size of real and integer workspaces :c:func:`ARKStepGetLinWorkSpace()` -No. of Jacobian evaluations :c:func:`ARKStepGetNumJacEvals()` -No. of preconditioner evaluations :c:func:`ARKStepGetNumPrecEvals()` -No. of preconditioner solves :c:func:`ARKStepGetNumPrecSolves()` -No. of linear iterations :c:func:`ARKStepGetNumLinIters()` -No. of linear convergence failures :c:func:`ARKStepGetNumLinConvFails()` -No. of Jacobian-vector setup evaluations :c:func:`ARKStepGetNumJTSetupEvals()` -No. of Jacobian-vector product evaluations :c:func:`ARKStepGetNumJtimesEvals()` -No. of *fi* calls for finite diff. :math:`J` or :math:`Jv` evals. :c:func:`ARKStepGetNumLinRhsEvals()` -Last return from a linear solver function :c:func:`ARKStepGetLastLinFlag()` -Name of constant associated with a return flag :c:func:`ARKStepGetLinReturnFlagName()` -Size of real and integer mass matrix solver workspaces :c:func:`ARKStepGetMassWorkSpace()` -No. of mass matrix solver setups (incl. :math:`M` evals.) :c:func:`ARKStepGetNumMassSetups()` -No. of mass matrix multiply setups :c:func:`ARKStepGetNumMassMultSetups()` -No. of mass matrix multiplies :c:func:`ARKStepGetNumMassMult()` -No. of mass matrix solves :c:func:`ARKStepGetNumMassSolves()` -No. of mass matrix preconditioner evaluations :c:func:`ARKStepGetNumMassPrecEvals()` -No. of mass matrix preconditioner solves :c:func:`ARKStepGetNumMassPrecSolves()` -No. of mass matrix linear iterations :c:func:`ARKStepGetNumMassIters()` -No. of mass matrix solver convergence failures :c:func:`ARKStepGetNumMassConvFails()` -No. of mass-matrix-vector setup evaluations :c:func:`ARKStepGetNumMTSetups()` -Last return from a mass matrix solver function :c:func:`ARKStepGetLastMassFlag()` -================================================================= ======================================== - .. c:function:: int ARKStepGetJac(void* arkode_mem, SUNMatrix* J) Returns the internally stored copy of the Jacobian matrix of the ODE @@ -3943,6 +3519,11 @@ Last return from a mass matrix solver function :c:func:`ARKS This function is provided for debugging purposes and the values in the returned matrix should not be altered. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJac` instead. + + .. c:function:: int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J) Returns the time at which the internally stored copy of the Jacobian matrix @@ -3955,6 +3536,11 @@ Last return from a mass matrix solver function :c:func:`ARKS :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJacTime` instead. + + .. c:function:: int ARKStepGetJacNumSteps(void* arkode_mem, long int* nst_J) Returns the value of the internal step counter at which the internally stored copy of the @@ -3967,6 +3553,11 @@ Last return from a mass matrix solver function :c:func:`ARKS :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJacNumSteps` instead. + + .. c:function:: int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) Returns the real and integer workspace used by the ARKLS linear solver interface. @@ -3991,6 +3582,10 @@ Last return from a mass matrix solver function :c:func:`ARKS In a parallel setting, the above values are global (i.e. summed over all processors). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLinWorkSpace` instead. + .. c:function:: int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) @@ -4009,6 +3604,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJacEvals` instead. + .. c:function:: int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) @@ -4029,6 +3628,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumPrecEvals` instead. + .. c:function:: int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) @@ -4048,6 +3651,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumPrecSolves` instead. + .. c:function:: int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) @@ -4066,6 +3673,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinIters` instead. + .. c:function:: int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) @@ -4084,6 +3695,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinConvFails` instead. + .. c:function:: int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) @@ -4103,6 +3718,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJTSetupEvals` instead. + .. c:function:: int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) @@ -4122,6 +3741,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJtimesEvals` instead. + .. c:function:: int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) @@ -4147,6 +3770,10 @@ Last return from a mass matrix solver function :c:func:`ARKS solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinRhsEvals` instead. + .. c:function:: int ARKStepGetLastLinFlag(void* arkode_mem, long int* lsflag) @@ -4198,8 +3825,12 @@ Last return from a mass matrix solver function :c:func:`ARKS *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLastLinFlag` instead. + -.. c:function:: char *ARKStepGetLinReturnFlagName(long int lsflag) +.. c:function:: char* ARKStepGetLinReturnFlagName(long int lsflag) Returns the name of the ARKLS constant corresponding to *lsflag*. @@ -4211,6 +3842,9 @@ Last return from a mass matrix solver function :c:func:`ARKS ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` :math:`\le n` (LU factorization failed), this routine returns "NONE". + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLinReturnFlagName` instead. @@ -4238,6 +3872,10 @@ Last return from a mass matrix solver function :c:func:`ARKS In a parallel setting, the above values are global (i.e. summed over all processors). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetMassWorkSpace` instead. + .. c:function:: int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) @@ -4259,6 +3897,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassSetups` instead. + .. c:function:: int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) @@ -4279,6 +3921,11 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassMultSetups` instead. + + .. c:function:: int ARKStepGetNumMassMult(void* arkode_mem, long int* nmmults) Returns the number of calls made to the ARKLS mass matrix 'matvec' @@ -4299,6 +3946,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassMult` instead. + .. c:function:: int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) @@ -4318,6 +3969,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassSolves` instead. + .. c:function:: int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) @@ -4338,6 +3993,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassPrecEvals` instead. + .. c:function:: int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) @@ -4358,6 +4017,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassPrecSolves` instead. + .. c:function:: int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) @@ -4377,6 +4040,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassIters` instead. + .. c:function:: int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) @@ -4396,6 +4063,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMassConvFails` instead. + .. c:function:: int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetup) @@ -4416,6 +4087,10 @@ Last return from a mass matrix solver function :c:func:`ARKS linear solver module is "attached" to ARKStep, or when ARKStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumMTSetups` instead. + .. c:function:: int ARKStepGetLastMassFlag(void* arkode_mem, long int* mlsflag) @@ -4436,7 +4111,9 @@ Last return from a mass matrix solver function :c:func:`ARKS will match those described above for the function :c:func:`ARKStepGetLastLinFlag()`. + .. deprecated:: x.y.z + Use :c:func:`ARKodeGetLastMassFlag` instead. @@ -4445,24 +4122,6 @@ Last return from a mass matrix solver function :c:func:`ARKS General usability functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following optional routines may be called by a user to inquire -about existing solver parameters or write the current Butcher table(s). While -neither of these would typically be called during the course of solving an -initial value problem, they may be useful for users wishing to better -understand ARKStep and/or specific Runge--Kutta methods. - - -.. cssclass:: table-bordered - -===================================== =================================== -Optional routine Function name -===================================== =================================== -Output all ARKStep solver parameters :c:func:`ARKStepWriteParameters()` -Output the current Butcher table(s) :c:func:`ARKStepWriteButcher()` -===================================== =================================== - - - .. c:function:: int ARKStepWriteParameters(void* arkode_mem, FILE *fp) @@ -4484,6 +4143,10 @@ Output the current Butcher table(s) :c:func:`ARKStepWriteButcher()` for this pointer, since parameters for all processes would be identical. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeWriteParameters` instead. + .. c:function:: int ARKStepWriteButcher(void* arkode_mem, FILE *fp) @@ -4509,8 +4172,10 @@ Output the current Butcher table(s) :c:func:`ARKStepWriteButcher()` for this pointer, since tables for all processes would be identical. + .. deprecated:: x.y.z - + Use :c:func:`ARKStepGetCurrentButcherTables` and :c:func:`ARKodeButcherTable_Write` + instead. @@ -4604,44 +4269,6 @@ vector. ARKStep reset function ---------------------- -To reset the ARKStep module to a particular state :math:`(t_R,y(t_R))` for the -continued solution of a problem, where a prior -call to :c:func:`ARKStepCreate` has been made, the user must call the function -:c:func:`ARKStepReset()`. Like :c:func:`ARKStepReInit()` this routine retains -the current settings for all ARKStep module options and performs no memory -allocations but, unlike :c:func:`ARKStepReInit()`, this routine performs only a -*subset* of the input checking and initializations that are done in -:c:func:`ARKStepCreate`. In particular this routine retains all internal -counter values and the step size/error history and does not reinitialize the -linear and/or nonlinear solver but it does indicate that a linear solver setup -is necessary in the next step. Like :c:func:`ARKStepReInit()`, a call to -:c:func:`ARKStepReset()` will delete any previously-set *tstop* value specified -via a call to :c:func:`ARKStepSetStopTime()`. Following a successful call to -:c:func:`ARKStepReset()`, call :c:func:`ARKStepEvolve()` again to continue -solving the problem. By default the next call to :c:func:`ARKStepEvolve()` will -use the step size computed by ARKStep prior to calling :c:func:`ARKStepReset()`. -To set a different step size or have ARKStep estimate a new step size use -:c:func:`ARKStepSetInitStep()`. - -One important use of the :c:func:`ARKStepReset()` function is in the -treating of jump discontinuities in the RHS functions. Except in cases -of fairly small jumps, it is usually more efficient to stop at each -point of discontinuity and restart the integrator with a readjusted -ODE model, using a call to :c:func:`ARKStepReset()`. To stop when -the location of the discontinuity is known, simply make that location -a value of ``tout``. To stop when the location of the discontinuity -is determined by the solution, use the rootfinding feature. In either -case, it is critical that the RHS functions *not* incorporate the -discontinuity, but rather have a smooth extension over the -discontinuity, so that the step across it (and subsequent rootfinding, -if used) can be done efficiently. Then use a switch within the RHS -functions (communicated through ``user_data``) that can be flipped -between the stopping of the integration and the restart, so that the -restarted problem uses the new values (which have jumped). Similar -comments apply if there is to be a jump in the dependent variable -vector. - - .. c:function:: int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current ARKStep time-stepper module state to the provided @@ -4670,6 +4297,9 @@ vector. If an error occurred, :c:func:`ARKStepReset()` also sends an error message to the error handler function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeReset` instead. @@ -4678,36 +4308,6 @@ vector. ARKStep system resize function ------------------------------------- -For simulations involving changes to the number of equations and -unknowns in the ODE system (e.g. when using spatially-adaptive -PDE simulations under a method-of-lines approach), the ARKStep -integrator may be "resized" between integration steps, through calls -to the :c:func:`ARKStepResize()` function. This function modifies -ARKStep's internal memory structures to use the new problem size, -without destruction of the temporal adaptivity heuristics. It is -assumed that the dynamical time scales before and after the vector -resize will be comparable, so that all time-stepping heuristics prior -to calling :c:func:`ARKStepResize()` remain valid after the call. If -instead the dynamics should be recomputed from scratch, the ARKStep -memory structure should be deleted with a call to -:c:func:`ARKStepFree()`, and recreated with a calls to -:c:func:`ARKStepCreate`. - -To aid in the vector resize operation, the user can supply a vector -resize function that will take as input a vector with the previous -size, and transform it in-place to return a corresponding vector of -the new size. If this function (of type :c:func:`ARKVecResizeFn()`) -is not supplied (i.e., is set to ``NULL``), then all existing vectors -internal to ARKStep will be destroyed and re-cloned from the new input -vector. - -In the case that the dynamical time scale should be modified slightly -from the previous time scale, an input *hscale* is allowed, that will -rescale the upcoming time step by the specified factor. If a value -*hscale* :math:`\le 0` is specified, the default of 1.0 will be used. - - - .. c:function:: int ARKStepResize(void* arkode_mem, N_Vector yR, sunrealtype hscale, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) Re-sizes ARKStep with a different state vector but with comparable @@ -4775,6 +4375,10 @@ rescale the upcoming time step by the specified factor. If a value **Example codes:** * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeResize` instead. + .. _ARKStep_CInterface.MRIStepInterface: diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst index ffc80e5901..24633e9fb4 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst @@ -17,13 +17,13 @@ Multigrid Reduction in Time with XBraid ======================================= -The prior sections discuss using ARKStep in a traditional sequential +The prior sections discuss using ARKODE in a traditional sequential time integration setting i.e., the solution is advanced from one time to the next where all parallelism resides within the evaluation of a step e.g., the computation of the right-hand side, (non)linear solves, vector operations etc. For example, when discretizing a partial differential equation using a method of lines approach the spatially-discretized equations comprise a large set -of ordinary differential equations that can be evolved with ARKStep. In this +of ordinary differential equations that can be evolved with ARKODE. In this case the parallelization lies in decomposing the spatial domain unknowns across distributed computational nodes. Considering the strong scaling case at a given spatial resolution, as the problem is spread across greater numbers of @@ -54,9 +54,9 @@ multilevel algorithm. The XBraid library :cite:p:`xbraid` implements the MGRIT algorithm in a non-intrusive manner, enabling the reuse of existing software for sequential -time integration. The following sections describe the ARKStep + XBraid interface -and the steps necessary to modify an existing code that already uses ARKStep to -also use XBraid. +time integration. The following sections describe the ARKODE + XBraid interface +and the steps necessary to modify an existing code that already uses ARKODE's +ARKStep time-stepping module to also use XBraid. @@ -65,7 +65,7 @@ also use XBraid. SUNBraid Interface ------------------ -Interfacing ARKStep with XBraid requires defining two data structures. The +Interfacing ARKODE with XBraid requires defining two data structures. The first is the XBraid application data structure that contains the data necessary for carrying out a time step and is passed to every interface function (much like the user data pointer in SUNDIALS packages). For this structure the @@ -79,9 +79,9 @@ operations (e.g., computing vector sums or norms) as well as functions to initialize the problem state, access the current solution, and take a time step. The ARKBraid interface, built on the SUNBraidApp and SUNBraidVector structures, -provides all the functionaly needed combine ARKStep and XBraid for +provides all the functionaly needed combine ARKODE and XBraid for parallel-in-time integration. As such, only a minimal number of changes are -necessary to update an exsting code that uses ARKStep to also use XBraid. +necessary to update an exsting code that uses ARKODE to also use XBraid. @@ -156,25 +156,21 @@ example usage of the function. This function returns a vector to use as a template for creating new vectors with :c:func:`N_VClone()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *y* -- output, the template vector. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param y: output, the template vector. - **Return value:** - If this function is not implemented by the SUNBraidApp - implementation (i.e., the function pointer is ``NULL``) then this function - will return *SUNBRAID_OPNULL*. Otherwise the return value depends on the - particular SUNBraidApp implementation. Users are encouraged to utilize the - return codes defined in ``sundials/sundials_xbraid.h`` and listed in - :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. + :return: If this function is not implemented by the SUNBraidApp + implementation (i.e., the function pointer is ``NULL``) then this function + will return *SUNBRAID_OPNULL*. Otherwise the return value depends on the + particular SUNBraidApp implementation. Users are encouraged to utilize the + return codes defined in ``sundials/sundials_xbraid.h`` and listed in + :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. - **Usage:** + .. code-block:: C - .. code-block:: C - - /* Get template vector */ - flag = SUNBraidApp_GetVecTmpl(app, y_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + /* Get template vector */ + flag = SUNBraidApp_GetVecTmpl(app, y_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; @@ -192,20 +188,16 @@ instance. This function creates a new SUNBraidApp instance with the content and operations initialized to ``NULL``. - **Arguments:** - * *app* -- output, an empty SUNBraidApp instance (XBraid app structure). - - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ALLOCFAIL* if a memory allocation failed. + :param app: output, an empty SUNBraidApp instance (XBraid app structure). - **Usage:** + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation failed. - .. code-block:: C + .. code-block:: C - /* Create empty XBraid interface object */ - flag = SUNBraidApp_NewEmpty(app_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + /* Create empty XBraid interface object */ + flag = SUNBraidApp_NewEmpty(app_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; @@ -213,18 +205,14 @@ instance. This function destroys an empty SUNBraidApp instance. - **Arguments:** - * *app* -- input, an empty SUNBraidApp instance (XBraid app structure). + :param app: input, an empty SUNBraidApp instance (XBraid app structure). - **Return value:** - * *SUNBRAID_SUCCESS* if successful. + :retval SUNBRAID_SUCCESS: if successful. - **Usage:** + .. code-block:: C - .. code-block:: C - - /* Free empty XBraid interface object */ - flag = SUNBraidApp_FreeEmpty(app_ptr); + /* Free empty XBraid interface object */ + flag = SUNBraidApp_FreeEmpty(app_ptr); .. warning:: @@ -263,22 +251,18 @@ utility functions are provided. This function creates a new SUNBraidVector wrapping the N_Vector y. - **Arguments:** - * *y* -- input, the N_Vector to wrap. - * *u* -- output, the SUNBraidVector wrapping *y*. - - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *y* is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if a memory allocation fails. + :param y: input, the N_Vector to wrap. + :param u: output, the SUNBraidVector wrapping *y*. - **Usage:** + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *y* is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation fails. - .. code-block:: C + .. code-block:: C - /* Create new vector wrapper */ - flag = SUNBraidVector_New(y, u_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + /* Create new vector wrapper */ + flag = SUNBraidVector_New(y, u_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; .. warning:: @@ -292,22 +276,18 @@ utility functions are provided. This function retrieves the wrapped N_Vector from the SUNBraidVector. - **Arguments:** - * *u* -- input, the SUNBraidVector wrapping *y*. - * *y* -- output, the wrapped N_Vector. + :param u: input, the SUNBraidVector wrapping *y*. + :param y: output, the wrapped N_Vector. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. - * *SUNBRAID_MEMFAIL* if *y* is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if *y* is ``NULL``. - **Usage:** + .. code-block:: C - .. code-block:: C - - /* Create new vector wrapper */ - flag = SUNBraidVector_GetNVector(u, y_ptr); - if (flag != SUNBRAID_SUCCESS) return flag; + /* Create new vector wrapper */ + flag = SUNBraidVector_GetNVector(u, y_ptr); + if (flag != SUNBRAID_SUCCESS) return flag; @@ -321,16 +301,14 @@ N_Vector operations. values of the input vector *u* into the output vector *v_ptr* using :c:func:`N_VClone()` and :c:func:`N_VScale()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *u* -- input, the SUNBraidVector to clone. - * *v_ptr* -- output, the new SUNBraidVector. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param u: input, the SUNBraidVector to clone. + :param v_ptr: output, the new SUNBraidVector. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the N_Vector *y* wrapped by *u* is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if a memory allocation fails. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the N_Vector *y* wrapped by *u* is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation fails. @@ -339,12 +317,10 @@ N_Vector operations. This function destroys the SUNBraidVector and the wrapped N_Vector using :c:func:`N_VDestroy()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *u* -- input, the SUNBraidVector to destroy. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param u: input, the SUNBraidVector to destroy. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. + :retval SUNBRAID_SUCCESS: if successful. @@ -353,17 +329,15 @@ N_Vector operations. This function computes the vector sum :math:`\alpha x + \beta y \rightarrow y` using :c:func:`N_VLinearSum()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *alpha* -- input, the constant :math:`\alpha`. - * *x* -- input, the vector :math:`x`. - * *beta* -- input, the constant :math:`\beta`. - * *y* -- input/output, the vector :math:`y`. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param alpha: input, the constant :math:`\alpha`. + :param x: input, the vector :math:`x`. + :param beta: input, the constant :math:`\beta`. + :param y: input/output, the vector :math:`y`. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *x* or *y* is ``NULL``. - * *SUNBRAID_MEMFAIL* if either of the wrapped N_Vectors are ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *x* or *y* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if either of the wrapped N_Vectors are ``NULL``. @@ -372,15 +346,13 @@ N_Vector operations. This function computes the 2-norm of the vector *u* using :c:func:`N_VDotProd()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *u* -- input, the vector *u*. - * *norm_ptr* -- output, the L2 norm of *u*. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param u: input, the vector *u*. + :param norm_ptr: output, the L2 norm of *u*. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the wrapped N_Vector is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the wrapped N_Vector is ``NULL``. @@ -389,16 +361,14 @@ N_Vector operations. This function returns the buffer size for messages to exchange vector data using :c:func:`SUNBraidApp_GetVecTmpl` and :c:func:`N_VBufSize()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *size_ptr* -- output, the buffer size. - * *bstatus* -- input, a status object to query for information on the message - type. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param size_ptr: output, the buffer size. + :param bstatus: input, a status object to query for information on the message + type. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * An error flag from :c:func:`SUNBraidApp_GetVecTmpl` or - :c:func:`N_VBufSize()`. + :retval SUNBRAID_SUCCESS: if successful + :retval otherwise: an error flag from :c:func:`SUNBraidApp_GetVecTmpl` + or :c:func:`N_VBufSize()`. @@ -407,17 +377,15 @@ N_Vector operations. This function packs the message buffer for exchanging vector data using :c:func:`N_VBufPack()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *u* -- input, the vector to pack into the exchange buffer. - * *buffer* -- output, the packed exchange buffer to pack. - * *bstatus* -- input, a status object to query for information on the message - type. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param u: input, the vector to pack into the exchange buffer. + :param buffer: output, the packed exchange buffer to pack. + :param bstatus: input, a status object to query for information on the message + type. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *u* is ``NULL``. - * An error flag from :c:func:`N_VBufPack()`. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *u* is ``NULL``. + :retval otherwise: An error flag from :c:func:`N_VBufPack()`. @@ -427,19 +395,17 @@ N_Vector operations. SUNBraidVector with the buffer data using :c:func:`N_VBufUnpack()`, :c:func:`SUNBraidApp_GetVecTmpl`, and :c:func:`N_VClone()`. - **Arguments:** - * *app* -- input, a SUNBraidApp instance (XBraid app structure). - * *buffer* -- input, the exchange buffer to unpack. - * *u_ptr* -- output, a new SUNBraidVector containing the buffer data. - * *bstatus* -- input, a status object to query for information on the message - type. + :param app: input, a SUNBraidApp instance (XBraid app structure). + :param buffer: input, the exchange buffer to unpack. + :param u_ptr: output, a new SUNBraidVector containing the buffer data. + :param bstatus: input, a status object to query for information on the message + type. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *buffer* is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if a memory allocation fails. - * An error flag from :c:func:`SUNBraidApp_GetVecTmpl` and - :c:func:`N_VBufUnpack()`. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *buffer* is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation fails. + :retval otherwise: an error flag from :c:func:`SUNBraidApp_GetVecTmpl` and + :c:func:`N_VBufUnpack()`. @@ -480,9 +446,9 @@ ARKBraid Interface ------------------ This section describes the ARKBraid implementation of a SUNBraidApp for using -the ARKStep integration module with XBraid. The following section +the ARKODE's ARKStep time-stepping module with XBraid. The following section :numref:`ARKODE.Usage.ARKStep.ARKBraid_InitDealloc` describes routines for creating, -initializing, and destroying the ARKStep + XBraid interface, routines for +initializing, and destroying the ARKODE + XBraid interface, routines for setting optional inputs, and routines for retrieving data from an ARKBraid instance. As noted above, interfacing with XBraid requires providing functions to initialize the problem state, access the current solution, and take a time @@ -490,7 +456,7 @@ step. The default ARKBraid functions for each of these actions are defined in :n user-defined if desired. A skeleton of the user's main or calling program for using the ARKBraid interface is given in :numref:`ARKODE.Usage.ARKStep.ARKBraid_Skeleton`. Finally, for advanced users that -wish to create their own SUNBraidApp implementation using ARKStep, +wish to create their own SUNBraidApp implementation using ARKODE, :numref:`ARKODE.Usage.ARKStep.ARKBraid_Utility` describes some helpful functions available to the user. @@ -515,20 +481,19 @@ if an error occurred. The possible return codes are given in private ARKBraid interface structure, and attaches the necessary SUNBraidOps implementations. - **Arguments:** - * *arkode_mem* -- input, a pointer to an ARKStep memory structure. - * *app* -- output, an ARKBraid instance (XBraid app structure). + :param arkode_mem: input, a pointer to an ARKODE memory structure. + :param app: output, an ARKBraid instance (XBraid app structure). - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* *arkode_mem* is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if a memory allocation failed. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: *arkode_mem* is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation failed. .. warning:: The ARKBraid interface is ARKStep-specific. Although one could eventually - construct an XBraid interface to either ERKStep or MRIStep, those are not - supported by this implementation. + construct an XBraid interface to other of ARKODE time-stepping modules + (e.g., ERKStep or MRIStep), those are not currently supported by this + implementation. @@ -538,21 +503,19 @@ if an error occurred. The possible return codes are given in XBraid core memory structure and initializes XBraid with the ARKBraid and SUNBraidVector interface functions. - **Arguments:** - * *comm_w* -- input, the global MPI communicator for space and time. - * *comm_t* -- input, the MPI communicator for the time dimension. - * *tstart* -- input, the initial time value. - * *tstop* -- input, the final time value. - * *ntime* -- input, the initial number of grid points in time. - * *app* -- input, an ARKBraid instance. - * *core* -- output, the XBraid core memory structure. - - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if either MPI communicator is ``MPI_COMM_NULL``, - if *ntime* < 2, or if *app* or its content is ``NULL``. - * *SUNBRAID_BRAIDFAIL* if the ``braid_Init()`` call fails. The XBraid return - value can be retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. + :param comm_w: input, the global MPI communicator for space and time. + :param comm_t: input, the MPI communicator for the time dimension. + :param tstart: input, the initial time value. + :param tstop: input, the final time value. + :param ntime: input, the initial number of grid points in time. + :param app: input, an ARKBraid instance. + :param core: output, the XBraid core memory structure. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if either MPI communicator is ``MPI_COMM_NULL``, + if *ntime* < 2, or if *app* or its content is ``NULL``. + :retval SUNBRAID_BRAIDFAIL: if the ``braid_Init()`` call fails. The XBraid return + value can be retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. .. note:: @@ -572,11 +535,9 @@ if an error occurred. The possible return codes are given in This function deallocates an ARKBraid instance. - **Arguments:** - * *app* -- input, a pointer to an ARKBraid instance. + :param app: input, a pointer to an ARKBraid instance. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. + :retval SUNBRAID_SUCCESS: if successful. @@ -599,15 +560,13 @@ error occurred. The possible return codes are given in This function sets the step function provided to XBraid (default :c:func:`ARKBraid_Step()`). - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *step* -- input, an XBraid step function. If *step* is ``NULL``, the - default function will be used. + :param app: input, an ARKBraid instance. + :param step: input, an XBraid step function. If *step* is ``NULL``, the + default function will be used. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. .. note:: @@ -620,15 +579,13 @@ error occurred. The possible return codes are given in This function sets the vector initialization function provided to XBraid (default :c:func:`ARKBraid_Init()`). - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *init* -- input, an XBraid vector initialization function. If *init* is - ``NULL``, the default function will be used. + :param app: input, an ARKBraid instance. + :param init: input, an XBraid vector initialization function. If *init* is + ``NULL``, the default function will be used. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. .. note:: @@ -641,15 +598,13 @@ error occurred. The possible return codes are given in This function sets the spatial norm function provided to XBraid (default :c:func:`SUNBraidVector_SpatialNorm()`). - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *snorm* -- input, an XBraid spatial norm function. If *snorm* is ``NULL``, - the default function will be used. + :param app: input, an ARKBraid instance. + :param snorm: input, an XBraid spatial norm function. If *snorm* is ``NULL``, + the default function will be used. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. .. note:: @@ -662,15 +617,13 @@ error occurred. The possible return codes are given in This function sets the user access function provided to XBraid (default :c:func:`ARKBraid_Access()`). - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *init* -- input, an XBraid user access function. If *access* is ``NULL``, - the default function will be used. + :param app: input, an ARKBraid instance. + :param init: input, an XBraid user access function. If *access* is ``NULL``, + the default function will be used. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. .. note:: @@ -693,18 +646,30 @@ error occurred. The possible return codes are given in .. c:function:: int ARKBraid_GetVecTmpl(braid_App app, N_Vector *tmpl) - This function returns a vector from the ARKStep memory to use as a template + This function returns a vector from the ARKODE memory to use as a template for creating new vectors with :c:func:`N_VClone()` i.e., this is the ARKBraid implementation of :c:func:`SUNBraidApp_GetVecTmpl()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *tmpl* -- output, a template vector. + :param app: input, an ARKBraid instance. + :param tmpl: output, a template vector. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKODE memory is ``NULL``. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. + + +.. c:function:: int ARKBraid_GetARKodeMem(braid_App app, void **arkode_mem) + + This function returns the ARKODE memory structure pointer attached with + :c:func:`ARKBraid_Create()`. + + :param app: input, an ARKBraid instance. + :param arkode_mem: output, a pointer to the ARKODE memory structure. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKODE memory is ``NULL``. @@ -713,30 +678,29 @@ error occurred. The possible return codes are given in This function returns the ARKStep memory structure pointer attached with :c:func:`ARKBraid_Create()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *arkode_mem* -- output, a pointer to the ARKStep memory structure. + :param app: input, an ARKBraid instance. + :param arkode_mem: output, a pointer to the ARKStep memory structure. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKStep memory is ``NULL``. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. + .. deprecated:: x.y.z + Use :c:func:`ARKBraid_GetARKodeMem` instead. .. c:function:: int ARKBraid_GetUserData(braid_App app, void **user_data) This function returns the user data pointer attached with - :c:func:`ARKStepSetUserData()`. + :c:func:`ARKodeSetUserData()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *user_data* -- output, a pointer to the user data structure. + :param app: input, an ARKBraid instance. + :param user_data: output, a pointer to the user data structure. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKODE memory is ``NULL``. @@ -745,14 +709,26 @@ error occurred. The possible return codes are given in This function returns the return value from the most recent XBraid function call. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *last_flag* -- output, the XBraid return value. + :param app: input, an ARKBraid instance. + :param last_flag: output, the XBraid return value. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + + + +.. c:function:: int ARKBraid_GetLastARKodeFlag(braid_App app, int *last_flag) + + This function returns the return value from the most recent ARKODE function + call. + + :param app: input, an ARKBraid instance. + :param last_flag: output, the ARKODE return value. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. @@ -761,14 +737,16 @@ error occurred. The possible return codes are given in This function returns the return value from the most recent ARKStep function call. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *last_flag* -- output, the ARKStep return value. + :param app: input, an ARKBraid instance. + :param last_flag: output, the ARKStep return value. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. + + .. deprecated:: x.y.z + + Use :c:func:`ARKBraid_GetLastARKodeFlag` instead. .. c:function:: int ARKBraid_GetSolution(braid_App app, sunrealtype *tout, N_Vector yout) @@ -776,22 +754,20 @@ error occurred. The possible return codes are given in This function returns final time and state stored with the default access function :c:func:`ARKBraid_Access()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *last_flag* -- output, the ARKStep return value. + :param app: input, an ARKBraid instance. + :param last_flag: output, the ARKODE return value. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or the stored vector is ``NULL``. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or the stored vector is ``NULL``. .. warning:: If providing a non-default access function the final time and state are not stored within the ARKBraid structure and this function will return an error. In this case the user should allocate space to store any desired - output within the user data pointer attached to ARKStep with - :c:func:`ARKStepSetUserData()`. This user data pointer can be retrieved + output within the user data pointer attached to ARKODE with + :c:func:`ARKodeSetUserData()`. This user data pointer can be retrieved from the ARKBraid structure with :c:func:`ARKBraid_GetUserData()`. @@ -819,23 +795,21 @@ in :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. the ARStep memory structure provided to :c:func:`ARKBraid_Create()`. A user-defined step function may be set with :c:func:`ARKBraid_SetStepFn()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *ustop* -- input, *u* vector at the new time *tstop*. - * *fstop* -- input, the right-hand side vector at the new time *tstop*. - * *u* - input/output, on input the vector at the start time and on return the - vector at the new time. - * *status* -- input, a status object to query for information about *u* and - to steer XBraid e.g., for temporal refinement. - - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. - * *SUNBRAID_BRAIDFAIL* if an XBraid function fails. The return value can be - retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. - * *SUNBRAID_SUNFAIL* if a SUNDIALS function fails. The return value can be - retrieved with :c:func:`ARKBraid_GetLastARKStepFlag()`. + :param app: input, an ARKBraid instance. + :param ustop: input, *u* vector at the new time *tstop*. + :param fstop: input, the right-hand side vector at the new time *tstop*. + :param u: input/output, on input the vector at the start time and on return the + vector at the new time. + :param status: input, a status object to query for information about *u* and + to steer XBraid e.g., for temporal refinement. + + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKODE memory is ``NULL``. + :retval SUNBRAID_BRAIDFAIL: if an XBraid function fails. The return value can be + retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. + :retval SUNBRAID_SUNFAIL: if a SUNDIALS function fails. The return value can be + retrieved with :c:func:`ARKBraid_GetLastARKStepFlag()`. .. note:: @@ -854,16 +828,14 @@ in :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. provided to :c:func:`ARKStepCreate`. A user-defined init function may be set with :c:func:`ARKBraid_SetInitFn()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *t* -- input, the initialization time for the output vector. - * *u_ptr* -- output, the new and initialized SUNBraidVector. + :param app: input, an ARKBraid instance. + :param t: input, the initialization time for the output vector. + :param u_ptr: output, the new and initialized SUNBraidVector. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if *app* is ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content or ARKStep memory is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if a memory allocation failed. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content or ARKODE memory is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if a memory allocation failed. .. note:: @@ -883,19 +855,17 @@ in :numref:`ARKODE.Usage.ARKStep.SUNBraidReturnCodes.Table`. :c:func:`ARKBraid_GetSolution()`. A user-defined access function may be set with :c:func:`ARKBraid_SetAccessFn()`. - **Arguments:** - * *app* -- input, an ARKBraid instance. - * *u* -- input, the vector to be accessed. - * *status* -- input, a status object to query for information about *u*. + :param app: input, an ARKBraid instance. + :param u: input, the vector to be accessed. + :param status: input, a status object to query for information about *u*. - **Return value:** - * *SUNBRAID_SUCCESS* if successful. - * *SUNBRAID_ILLINPUT* if any of the inputs are ``NULL``. - * *SUNBRAID_MEMFAIL* if the *app* content, the wrapped N_Vector, or the - ARKStep memory is ``NULL``. - * *SUNBRAID_ALLOCFAIL* if allocating storage for the final solution fails. - * *SUNBRAID_BRAIDFAIL* if an XBraid function fails. The return value can be - retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. + :retval SUNBRAID_SUCCESS: if successful. + :retval SUNBRAID_ILLINPUT: if any of the inputs are ``NULL``. + :retval SUNBRAID_MEMFAIL: if the *app* content, the wrapped N_Vector, or the + ARKODE memory is ``NULL``. + :retval SUNBRAID_ALLOCFAIL: if allocating storage for the final solution fails. + :retval SUNBRAID_BRAIDFAIL: if an XBraid function fails. The return value can be + retrieved with :c:func:`ARKBraid_GetLastBraidFlag()`. @@ -910,9 +880,10 @@ interace, the user's program must include the header file ``arkode/arkode_xbraid.h`` which declares the needed function prototypes. The following is a skeleton of the user's main program (or calling program) for -the integration of an ODE IVP using ARKStep with XBraid for parallel-in-time -integration. Most steps are unchanged from the skeleton program presented in -:numref:`ARKODE.Usage.ARKStep.Skeleton`. New or updated steps are **bold**. +the integration of an ODE IVP using ARKODE's ARKStep time-stepping module with +XBraid for parallel-in-time integration. Most steps are unchanged from the +skeleton program presented in :numref:`ARKODE.Usage.Skeleton`. New or updated +steps are **bold**. #. **Initialize MPI** @@ -991,7 +962,7 @@ integration. Most steps are unchanged from the skeleton program presented in Advanced ARKBraid Utility Functions ----------------------------------- -This section describes utility functions utilized in the ARKStep + XBraid +This section describes utility functions utilized in the ARKODE + XBraid interfacing. These functions are used internally by the above ARKBraid interface functions but are exposed to the user to assist in advanced usage of ARKODE and XBraid that requries defining a custom SUNBraidApp implementation. @@ -1001,27 +972,25 @@ ARKODE and XBraid that requries defining a custom SUNBraidApp implementation. .. c:function:: int ARKBraid_TakeStep(void *arkode_mem, sunrealtype tstart, sunrealtype tstop, N_Vector y, int *ark_flag) This function advances the vector *y* from *tstart* to *tstop* using a - single ARKStep time step with step size *h = tstop - start*. - - **Arguments:** - * *arkode_mem* -- input, the ARKStep memory structure pointer. - * *tstart* -- input, the step start time. - * *tstop* -- input, the step stop time. - * *y* -- input/output, on input the solution a *tstop* and on return, the - solution at time *tstop* if the step was successful (*ark_flag* - :math:`\geq 0`) or the solution at time *tstart* if the step failed - (*ark_flag* < 0). - * *ark_flag* -- output, the step status flag. If *ark_flag* is: - - :math:`= 0` then the step succeeded and, if applicable, met the - requested temporal accuracy. - - :math:`> 0` then the step succeeded but failed to meet the requested - temporal accuracy. - - :math:`< 0` then the step failed e.g., a solver failure occurred. - - **Return value:** - If all ARKStep function calls are successful the return - value is *ARK_SUCCESS*, otherwise the return value is the error flag - returned from the function that failed. + single ARKODE time step with step size *h = tstop - start*. + + :param arkode_mem: input, the ARKODE memory structure pointer. + :param tstart: input, the step start time. + :param tstop: input, the step stop time. + :param y: input/output, on input the solution a *tstop* and on return, the + solution at time *tstop* if the step was successful (*ark_flag* + :math:`\geq 0`) or the solution at time *tstart* if the step failed + (*ark_flag* < 0). + :param ark_flag: output, the step status flag. If *ark_flag* is: + + :math:`= 0` then the step succeeded and, if applicable, met the + requested temporal accuracy. + + :math:`> 0` then the step succeeded but failed to meet the requested + temporal accuracy. + + :math:`< 0` then the step failed e.g., a solver failure occurred. + + :return: If all ARKODE function calls are successful the return + value is *ARK_SUCCESS*, otherwise the return value is the error flag + returned from the function that failed. diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst index b7ba4f3b02..3edc8baf51 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst +++ b/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst @@ -18,47 +18,15 @@ Using the ARKStep time-stepping module ====================================== -This chapter is concerned with the use of the ARKStep time-stepping +This section is concerned with the use of the ARKStep time-stepping module for the solution of initial value problems (IVPs) 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 -ARKStep user-callable functions and user-supplied functions. - -The example programs located in the source code ``examples/arkode`` -folder, including those described in the companion document :cite:p:`arkode_ex`, -may be helpful as templates for new codes. - -Users with applications written in Fortran should see the chapter -:numref:`SUNDIALS.Fortran`, which describes the Fortran/C interface -module for ARKStep, and may look to the Fortran example programs also -provided in the ARKODE ``examples`` directory. - -The user should be aware that not all SUNLINSOL, SUNMATRIX, and -preconditioning modules are compatible with all NVECTOR -implementations. Details on compatibility are given in the -documentation for each SUNMATRIX (see :numref:`SUNMatrix`) and each -SUNLINSOL module (see :numref:`SUNLinSol`). For example, NVECTOR_PARALLEL -is not compatible with the dense, banded, or sparse SUNMATRIX types, -or with the corresponding dense, banded, or sparse SUNLINSOL modules. -Please check :numref:`SUNMatrix` and :numref:`SUNLinSol` to -verify compatibility between these modules. In addition to that -documentation, we note that the ARKBANDPRE preconditioning module is -only compatible with the NVECTOR_SERIAL, NVECTOR_OPENMP or -NVECTOR_PTHREADS vector implementations, and the preconditioner module -ARKBBDPRE can only be used with NVECTOR_PARALLEL. - -ARKStep uses various input and output constants from the shared ARKODE -infrastructure. These are defined as needed in this chapter, but for -convenience the full list is provided separately in :numref:`ARKODE.Constants`. - -The relevant information on using ARKStep's C and C++ interfaces is -detailed in the following subsections. +language setting. Usage of ARKStep follows that of the rest of ARKODE, +and so in this section we primarily focus on those usage aspects that +are specific to ARKStep. .. toctree:: :maxdepth: 1 - Skeleton User_callable Relaxation - Preconditioners XBraid diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst index 605a5493ea..72af9b9c82 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst @@ -17,9 +17,11 @@ Relaxation Methods ================== -This section describes user-callable functions for applying relaxation methods -with ERKStep. For more information on relaxation Runge--Kutta methods see -:numref:`ARKODE.Mathematics.Relaxation`. +This section describes ERKStep-specific user-callable functions for applying +relaxation methods with ERKStep. All of these routines have been deprecated in +favor of :ref:`shared ARKODE-level routines <ARKODE.Usage.Relaxation>`, but +this documentation will be retained for as long as these functions are present + Enabling or Disabling Relaxation -------------------------------- @@ -61,6 +63,11 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxFn` instead. + + Optional Input Functions ------------------------ @@ -85,6 +92,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxEtaFail` instead. + + .. c:function:: int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) Sets the smallest acceptable value for the relaxation parameter. @@ -106,6 +118,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxLowerBound` instead. + + .. c:function:: int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) Sets the largest acceptable value for the relaxation parameter. @@ -127,6 +144,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxUpperBound` instead. + + .. c:function:: int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) Sets the maximum number of times applying relaxation can fail within a step @@ -146,6 +168,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxMaxFails` instead. + + .. c:function:: int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) Sets the maximum number of nonlinear iterations allowed when solving for the @@ -169,6 +196,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxMaxIters` instead. + + .. c:function:: int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) Sets the nonlinear solver method used to compute the relaxation parameter. @@ -187,6 +219,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxSolver` instead. + + .. c:function:: int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) Sets the nonlinear solver residual tolerance to use when solving @@ -211,6 +248,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxResTol` instead. + + .. c:function:: int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) Sets the nonlinear solver relative and absolute tolerance on changes in @@ -238,6 +280,11 @@ relaxation. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRelaxTol` instead. + + Optional Output Functions ------------------------- @@ -258,6 +305,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxFnEvals` instead. + + .. c:function:: int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) Get the number of times the user's relaxation Jacobian was evaluated. @@ -272,6 +324,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. + + .. c:function:: int ERKStepGetNumRelaxFails(void* arkode_mem, long int* fails) Get the total number of times applying relaxation failed. @@ -291,6 +348,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxFails` instead. + + .. c:function:: int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) @@ -307,6 +369,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxBoundFails` instead. + + .. c:function:: int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) Get the number of times the relaxation parameter nonlinear solver failed. @@ -321,6 +388,11 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. + + .. c:function:: int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) Get the number of relaxation parameter nonlinear solver iterations. @@ -334,3 +406,8 @@ about the performance of the relaxation method. ``NULL`` .. versionadded:: 5.6.0 + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRelaxSolveIters` instead. + diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst deleted file mode 100644 index 308cff4b50..0000000000 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Skeleton.rst +++ /dev/null @@ -1,146 +0,0 @@ -.. ---------------------------------------------------------------- - Programmer(s): Daniel R. Reynolds @ SMU - ---------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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.Usage.ERKStep.Skeleton: - -A skeleton of the user's main program -============================================ - -The following is a skeleton of the user's main program (or calling -program) for the integration of an ODE IVP using the ERKStep module. -Most of the steps are independent of the NVECTOR implementation used. -For the steps that are not, refer to :numref:`NVectors` for -the specific name of the function to be called or macro to be -referenced. - -.. index:: User main program - -#. Initialize parallel or multi-threaded environment, if appropriate. - - For example, call ``MPI_Init`` to initialize MPI if used, or set - ``num_threads``, the number of threads to use within the threaded - vector functions, if used. - -#. Create the SUNDIALS simulation context object. - - Call :c:func:`SUNContext_Create` to allocate the ``SUNContext`` object. - -#. Set problem dimensions, etc. - - This generally includes the problem size, ``N``, and may include - the local vector length ``Nlocal``. - - .. note:: - - The variables ``N`` and ``Nlocal`` should be of type - ``sunindextype``. - -#. Set vector of initial values - - To set the vector ``y0`` of initial values, use the appropriate - functions defined by the particular NVECTOR implementation. - - For native SUNDIALS vector implementations (except the CUDA and - RAJA based ones), use a call of the form - - .. code-block:: c - - y0 = N_VMake_***(..., ydata); - - if the ``sunrealtype`` array ``ydata`` containing the initial values of - :math:`y` already exists. Otherwise, create a new vector by making - a call of the form - - .. code-block:: c - - y0 = N_VNew_***(...); - - and then set its elements by accessing the underlying data where it - is located with a call of the form - - .. code-block:: c - - ydata = N_VGetArrayPointer_***(y0); - - For details on each of SUNDIALS' provided vector implementations, see - the corresponding sections in :numref:`NVectors` for details. - -#. Create ERKStep object - - Call ``arkode_mem = ERKStepCreate(...)`` to create the ERKStep memory - block. :c:func:`ERKStepCreate` returns a ``void*`` pointer to - this memory structure. See :numref:`ARKODE.Usage.ERKStep.Initialization` for - details. - -#. Specify integration tolerances - - Call :c:func:`ERKStepSStolerances()` or - :c:func:`ERKStepSVtolerances()` to specify either a scalar relative - tolerance and scalar absolute tolerance, or a scalar relative - tolerance and a vector of absolute tolerances, - respectively. Alternatively, call :c:func:`ERKStepWFtolerances()` - to specify a function which sets directly the weights used in - evaluating WRMS vector norms. See :numref:`ARKODE.Usage.ERKStep.Tolerances` - for details. - -#. Set optional inputs - - Call ``ERKStepSet*`` functions to change any optional inputs that - control the behavior of ERKStep from their default values. See - :numref:`ARKODE.Usage.ERKStep.OptionalInputs` for details. - -#. Specify rootfinding problem - - Optionally, call :c:func:`ERKStepRootInit()` to initialize a rootfinding - problem to be solved during the integration of the ODE system. See - :numref:`ARKODE.Usage.ERKStep.RootFinding` for general details, and - :numref:`ARKODE.Usage.ERKStep.OptionalInputs` for relevant optional - input calls. - -#. Advance solution in time - - For each point at which output is desired, call - - .. code-block:: c - - ier = ERKStepEvolve(arkode_mem, tout, yout, &tret, itask); - - Here, ``itask`` specifies the return mode. The vector ``yout`` - (which can be the same as the vector ``y0`` above) will contain - :math:`y(t_\text{out})`. See :numref:`ARKODE.Usage.ERKStep.Integration` - for details. - -#. Get optional outputs - - Call ``ERKStepGet*`` functions to obtain optional output. See - :numref:`ARKODE.Usage.ERKStep.OptionalOutputs` for details. - -#. Deallocate memory for solution vector - - Upon completion of the integration, deallocate memory for the - vector ``y`` (or ``yout``) by calling the NVECTOR destructor - function: - - .. code-block:: c - - N_VDestroy(y); - -#. Free solver memory - - Call :c:func:`ERKStepFree()` to free the memory allocated for - the ERKStep module. - -#. Finalize MPI, if used - - Call ``MPI_Finalize`` to terminate MPI. 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 16bfba3761..8984b67a9b 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 @@ -17,21 +17,21 @@ ERKStep User-callable functions ================================== -This section describes the functions that are called by the -user to setup and then solve an IVP using the ERKStep time-stepping -module. Some of these are required; however, starting with -:numref:`ARKODE.Usage.ERKStep.OptionalInputs`, the functions listed involve -optional inputs/outputs or restarting, and those paragraphs may be -skipped for a casual use of ARKODE's ERKStep module. In any case, -refer to the preceding section, :numref:`ARKODE.Usage.ERKStep.Skeleton`, -for the correct order of these calls. +This section describes the ERKStep-specific functions that may be called +by the user to setup and then solve an IVP using the ERKStep time-stepping +module. The large majority of these routines merely wrap :ref:`underlying +ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated +-- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained +below. -On an error, each user-callable function returns a negative value (or -``NULL`` if the function returns a pointer) and sends an error message -to the error handler routine, which prints the message to ``stderr`` -by default. However, the user can set a file as error output or can -provide their own error handler function (see -:numref:`ARKODE.Usage.ERKStep.OptionalInputs` for details). +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +ERKStep supports the following categories: + +* temporal adaptivity +* relaxation Runge--Kutta methods @@ -71,6 +71,10 @@ ERKStep initialization and deallocation functions **Return value:** None + .. deprecated:: x.y.z + + Use :c:func:`ARKodeFree` instead. + .. _ARKODE.Usage.ERKStep.Tolerances: @@ -78,40 +82,6 @@ ERKStep initialization and deallocation functions ERKStep tolerance specification functions ------------------------------------------------------ -These functions specify the integration tolerances. One of them -**should** be called before the first call to -:c:func:`ERKStepEvolve()`; otherwise default values of ``reltol = -1e-4`` and ``abstol = 1e-9`` will be used, which may be entirely -incorrect for a specific problem. - -The integration tolerances ``reltol`` and ``abstol`` define a vector -of error weights, ``ewt``. In the case of -:c:func:`ERKStepSStolerances()`, this vector has components - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol); - -whereas in the case of :c:func:`ERKStepSVtolerances()` the vector components -are given by - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol[i]); - -This vector is used in all error tests, which use a weighted RMS norm -on all error-like vectors v: - -.. math:: - \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; ewt_i)^2 \right)^{1/2}, - -where :math:`N` is the problem dimension. - -Alternatively, the user may supply a custom function to supply the -``ewt`` vector, through a call to :c:func:`ERKStepWFtolerances()`. - - - .. c:function:: int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) This function specifies scalar relative and absolute tolerances. @@ -127,6 +97,10 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSStolerances` instead. + .. c:function:: int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -147,6 +121,10 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSVtolerances` instead. + .. c:function:: int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -164,108 +142,9 @@ Alternatively, the user may supply a custom function to supply the * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module + .. deprecated:: x.y.z - - -General advice on the choice of tolerances -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For many users, the appropriate choices for tolerance values in -``reltol`` and ``abstol`` are a concern. The following pieces -of advice are relevant. - -(1) The scalar relative tolerance ``reltol`` is to be set to control - relative errors. So a value of :math:`10^{-4}` means that errors - are controlled to .01%. We do not recommend using ``reltol`` larger - than :math:`10^{-3}`. On the other hand, ``reltol`` should not be so - small that it is comparable to the unit roundoff of the machine - arithmetic (generally around :math:`10^{-15}` for double-precision). - -(2) The absolute tolerances ``abstol`` (whether scalar or vector) need - to be set to control absolute errors when any components of the - solution vector :math:`y` may be so small that pure relative error - control is meaningless. For example, if :math:`y_i` starts at some - nonzero value, but in time decays to zero, then pure relative - error control on :math:`y_i` makes no sense (and is overly costly) - after :math:`y_i` is below some noise level. Then ``abstol`` (if - scalar) or ``abstol[i]`` (if a vector) needs to be set to that - noise level. If the different components have different noise - levels, then ``abstol`` should be a vector. For example, see the - example problem ``ark_robertson.c``, and the discussion - of it in the ARKODE Examples Documentation :cite:p:`arkode_ex`. In that - problem, the three components vary between 0 and 1, and have - different noise levels; hence the ``atols`` vector therein. It is - impossible to give any general advice on ``abstol`` values, - because the appropriate noise levels are completely - problem-dependent. The user or modeler hopefully has some idea as - to what those noise levels are. - -(3) Finally, it is important to pick all the tolerance values - conservatively, because they control the error committed on each - individual step. The final (global) errors are an accumulation of - those per-step errors, where that accumulation factor is - problem-dependent. A general rule of thumb is to reduce the - tolerances by a factor of 10 from the actual desired limits on - errors. So if you want .01% relative accuracy (globally), a good - choice for ``reltol`` is :math:`10^{-5}`. In any case, it is - a good idea to do a few experiments with the tolerances to see how - the computed solution values vary as tolerances are reduced. - - - -Advice on controlling nonphysical negative values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In many applications, some components in the true solution are always -positive or non-negative, though at times very small. In the -numerical solution, however, small negative (nonphysical) values -can then occur. In most cases, these values are harmless, and simply -need to be controlled, not eliminated, but in other cases any value -that violates a constraint may cause a simulation to halt. For both of -these scenarios the following pieces of advice are relevant. - -(1) The best way to control the size of unwanted negative computed - values is with tighter absolute tolerances. Again this requires - some knowledge of the noise level of these components, which may - or may not be different for different components. Some - experimentation may be needed. - -(2) If output plots or tables are being generated, and it is important - to avoid having negative numbers appear there (for the sake of - avoiding a long explanation of them, if nothing else), then - eliminate them, but only in the context of the output medium. Then - the internal values carried by the solver are unaffected. Remember - that a small negative value in :math:`y` returned by ERKStep, with - magnitude comparable to ``abstol`` or less, is equivalent to zero - as far as the computation is concerned. - -(3) The user's right-hand side routine :math:`f` - should never change a negative value in the solution vector :math:`y` - to a non-negative value in attempt to "fix" this problem, - since this can lead to numerical instability. If the :math:`f` - routine cannot tolerate a zero or negative value (e.g. because - there is a square root or log), then the offending value should be - changed to zero or a tiny positive number in a temporary variable - (not in the input :math:`y` vector) for the purposes of computing - :math:`f(t, y)`. - -(4) ERKStep supports component-wise constraints on solution components, - :math:`y_i < 0`, :math:`y_i \le 0`, , :math:`y_i > 0`, or - :math:`y_i \ge 0`, through the user-callable function - :c:func:`ERKStepSetConstraints`. At each internal time step, if any - constraint is violated then ERKStep will attempt a smaller time step - that should not violate this constraint. This reduced step size is - chosen such that the step size is the largest possible but where the - solution component satisfies the constraint. - -(5) Positivity and non-negativity constraints on components can be - enforced by use of the recoverable error return feature in the - user-supplied right-hand side function, :math:`f`. When a - recoverable error is encountered, ERKStep will retry the step with - a smaller step size, which typically alleviates the problem. - However, because this option involves some additional overhead - cost, it should only be exercised if the use of absolute - tolerances to control the computed values is unsuccessful. + Use :c:func:`ARKodeWFtolerances` instead. @@ -274,16 +153,6 @@ these scenarios the following pieces of advice are relevant. Rootfinding initialization function -------------------------------------- -As described in :numref:`ARKODE.Mathematics.Rootfinding`, while -solving the IVP, ARKODE's time-stepping modules have the capability to -find the roots of a set of user-defined functions. To activate the -root-finding algorithm, call the following function. This is normally -called only once, prior to the first call to -:c:func:`ERKStepEvolve()`, but if the rootfinding problem is to be -changed during the solution, :c:func:`ERKStepRootInit()` can also be -called prior to a continuation call to :c:func:`ERKStepEvolve()`. - - .. c:function:: int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) Initializes a rootfinding problem to be solved during the @@ -312,6 +181,10 @@ called prior to a continuation call to :c:func:`ERKStepEvolve()`. problem but the prior one did, then call *ERKStepRootInit* with *nrtfn = 0*. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeRootInit` instead. + @@ -320,15 +193,6 @@ called prior to a continuation call to :c:func:`ERKStepEvolve()`. ERKStep solver function ------------------------- -This is the central step in the solution process -- the call to perform -the integration of the IVP. One of the input arguments (*itask*) -specifies one of two modes as to where ERKStep is to return a -solution. These modes are modified if the user has set a stop time -(with a call to the optional input function :c:func:`ERKStepSetStopTime()`) or -has requested rootfinding. - - - .. c:function:: int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -419,6 +283,10 @@ has requested rootfinding. On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeEvolve` instead. + @@ -427,85 +295,12 @@ has requested rootfinding. Optional input functions ------------------------- -There are numerous optional input parameters that control the behavior -of ERKStep, each of which may be modified from its default value through -calling an appropriate input function. The following tables list all -optional input functions, grouped by which aspect of ERKStep they control. -Detailed information on the calling syntax and arguments for each -function are then provided following each table. - -The optional inputs are grouped into the following categories: - -* General ERKStep options (:numref:`ARKODE.Usage.ERKStep.ERKStepInputTable`), - -* IVP method solver options (:numref:`ARKODE.Usage.ERKStep.ERKStepMethodInputTable`), - -* Step adaptivity solver options (:numref:`ARKODE.Usage.ERKStep.ERKStepAdaptivityInputTable`), and - -* Rootfinding options (:numref:`ARKODE.Usage.ERKStep.ERKStepRootfindingInputTable`). - -For the most casual use of ERKStep, relying on the default set of -solver parameters, the reader can skip to section on user-supplied -functions, :numref:`ARKODE.Usage.UserSupplied`. - -We note that, on an error return, all of the optional input functions send an -error message to the error handler function. All error return values are -negative, so a test on the return arguments for negative values will catch all -errors. Finally, a call to an ``ERKStepSet***`` function can generally be made -from the user's calling program at any time and, if successful, takes effect -immediately. ``ERKStepSet***`` functions that cannot be called at any time note -this in the "**Notes**:" section of the function documentation. - - .. _ARKODE.Usage.ERKStep.ERKStepInput: Optional inputs for ERKStep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.ERKStep.ERKStepInputTable: -.. table:: Optional inputs for ERKStep - - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Optional input | Function name | Default | - +====================================================+===========================================+========================+ - | Return ERKStep solver parameters to their defaults | :c:func:`ERKStepSetDefaults()` | internal | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Set dense output interpolation type | :c:func:`ERKStepSetInterpolantType()` | ``ARK_INTERP_HERMITE`` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Set dense output polynomial degree | :c:func:`ERKStepSetInterpolantDegree()` | 5 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a pointer to a diagnostics output file | :c:func:`ERKStepSetDiagnostics()` | ``NULL`` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Disable time step adaptivity (fixed-step mode) | :c:func:`ERKStepSetFixedStep()` | disabled | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Supply an initial step size to attempt | :c:func:`ERKStepSetInitStep()` | estimated | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum no. of warnings for :math:`t_n+h = t_n` | :c:func:`ERKStepSetMaxHnilWarns()` | 10 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum no. of internal steps before *tout* | :c:func:`ERKStepSetMaxNumSteps()` | 500 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum absolute step size | :c:func:`ERKStepSetMaxStep()` | :math:`\infty` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Minimum absolute step size | :c:func:`ERKStepSetMinStep()` | 0.0 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Set a value for :math:`t_{stop}` | :c:func:`ERKStepSetStopTime()` | undefined | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Interpolate at :math:`t_{stop}` | :c:func:`ERKStepSetInterpolateStopTime()` | ``SUNFALSE`` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Disable the stop time | :c:func:`ERKStepClearStopTime` | N/A | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a pointer for user data | :c:func:`ERKStepSetUserData()` | ``NULL`` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum no. of ERKStep error test failures | :c:func:`ERKStepSetMaxErrTestFails()` | 7 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Set inequality constraints on solution | :c:func:`ERKStepSetConstraints()` | ``NULL`` | - +----------------------------------------------------+-------------------------------------------+------------------------+ - | Set max number of constraint failures | :c:func:`ERKStepSetMaxNumConstrFails()` | 10 | - +----------------------------------------------------+-------------------------------------------+------------------------+ - - - .. c:function:: int ERKStepSetDefaults(void* arkode_mem) Resets all optional input parameters to ERKStep's original @@ -526,6 +321,10 @@ Optional inputs for ERKStep Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`ERKStepRootInit()`). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDefaults` instead. + .. c:function:: int ERKStepSetInterpolantType(void* arkode_mem, int itype) @@ -560,6 +359,10 @@ Optional inputs for ERKStep If this routine is not called, the Hermite interpolation module will be used. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantType` instead. + .. c:function:: int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) @@ -602,13 +405,17 @@ Optional inputs for ERKStep obtained by the integrator are returned at the ends of the time interval. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantDegree` instead. + .. c:function:: int ERKStepSetDenseOrder(void* arkode_mem, int dord) - *This function is deprecated, and will be removed in a future release. - Users should transition to calling* :c:func:`ERKStepSetInterpolantDegree()` - *instead.* + .. deprecated:: 5.2.0 + + Use :c:func:`ARKodeSetInterpolantDegree` instead. @@ -695,6 +502,9 @@ Optional inputs for ERKStep routines will provide no useful information to the solver, and at worst they may interfere with the desired fixed step size. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetFixedStep` instead. @@ -722,6 +532,10 @@ Optional inputs for ERKStep This routine will also reset the step size and error history. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInitStep` instead. + .. c:function:: int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) @@ -745,6 +559,9 @@ Optional inputs for ERKStep A negative value indicates that no warning messages should be issued. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -769,6 +586,10 @@ Optional inputs for ERKStep Passing *mxsteps* < 0 disables the test (not recommended). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNumSteps` instead. + .. c:function:: int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) @@ -787,6 +608,10 @@ Optional inputs for ERKStep **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxStep` instead. + .. c:function:: int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) @@ -805,6 +630,10 @@ Optional inputs for ERKStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMinStep` instead. + .. c:function:: int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -832,6 +661,11 @@ Optional inputs for ERKStep :c:func:`ERKStepReset` will remain active but can be disabled by calling :c:func:`ERKStepClearStopTime`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStopTime` instead. + + .. c:function:: int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -849,6 +683,11 @@ Optional inputs for ERKStep .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolateStopTime` instead. + + .. c:function:: int ERKStepClearStopTime(void* arkode_mem) @@ -867,6 +706,11 @@ Optional inputs for ERKStep .. versionadded:: 5.5.1 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeClearStopTime` instead. + + .. c:function:: int ERKStepSetUserData(void* arkode_mem, void* user_data) @@ -887,6 +731,9 @@ Optional inputs for ERKStep user-supplied functions for which it is an argument; otherwise ``NULL`` is passed. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetUserData` instead. @@ -908,6 +755,10 @@ Optional inputs for ERKStep The default value is 7; set *maxnef* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxErrTestFails` instead. + .. c:function:: int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) @@ -952,6 +803,11 @@ Optional inputs for ERKStep and :c:func:`ERKStepSetFixedStep()` are incompatible, and should not be used simultaneously. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetConstraints` instead. + + .. c:function:: int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) @@ -970,6 +826,10 @@ Optional inputs for ERKStep Passing *maxfails* <= 0 results in ERKStep using the default value (10). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNumConstrFails` instead. + .. _ARKODE.Usage.ERKStep.ERKStepMethodInput: @@ -1015,6 +875,10 @@ Optional inputs for IVP method selection ERKStep memory block, it cannot be changed after the first call to :c:func:`ERKStepEvolve()`, unless :c:func:`ERKStepReInit()` is called. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetOrder` instead. + .. c:function:: int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) @@ -1046,6 +910,8 @@ Optional inputs for IVP method selection :c:func:`ERKStepSetFixedStep()` to enable fixed-step mode and set the desired time step size. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. .. c:function:: int ERKStepSetTableNum(void* arkode_mem, ARKODE_ERKTableID etable) @@ -1066,6 +932,9 @@ Optional inputs for IVP method selection :numref:`Butcher.explicit`. Error-checking is performed to ensure that the table exists, and is not implicit. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. + .. c:function:: int ERKStepSetTableName(void* arkode_mem, const char *etable) @@ -1087,6 +956,8 @@ Optional inputs for IVP method selection to ensure that the table exists, and is not implicit. This function is case sensitive. + **Warning:** + This should not be used with :c:func:`ARKodeSetOrder`. @@ -1101,43 +972,6 @@ algorithm, including how each of the parameters below is used within 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 | - +-----------------------------------------------------------+--------------------------------------------+-----------+ - | 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. @@ -1158,6 +992,11 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetAdaptController` instead. + + .. c:function:: int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) @@ -1218,7 +1057,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. a custom function through a call to :c:func:`ERKStepSetAdaptivityFn()`. .. versionchanged:: 5.7.0 - + Prior to version 5.7.0, any nonzero value for *pq* would result in use of the embedding order of accuracy. @@ -1249,6 +1088,12 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetAdaptivityAdjustment` instead. + + + .. c:function:: int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) Specifies the fraction of the estimated explicitly stable step to use. @@ -1266,6 +1111,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetCFLFraction` instead. + .. c:function:: int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) @@ -1313,6 +1162,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetFixedStepBounds` instead. + .. c:function:: int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) @@ -1332,6 +1185,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxEFailGrowth` instead. + .. c:function:: int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) @@ -1352,6 +1209,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxFirstGrowth` instead. + .. c:function:: int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) @@ -1372,6 +1233,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any value :math:`\le 1.0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxGrowth` instead. + .. c:function:: int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) @@ -1394,6 +1259,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any value :math:`\ge 1.0` or :math:`\le 0.0` will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMinReduction` instead. + .. c:function:: int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) @@ -1414,6 +1283,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetSafetyFactor` instead. + .. c:function:: int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) @@ -1434,6 +1307,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetSmallNumEFails` instead. + .. c:function:: int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) @@ -1460,6 +1337,10 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. where the right-hand side function :math:`f(t,y)` contains stiff terms. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStabilityFn` instead. + @@ -1469,24 +1350,6 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Rootfinding optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following functions can be called to set optional inputs to -control the rootfinding algorithm, the mathematics of which are -described in :numref:`ARKODE.Mathematics.Rootfinding`. - - -.. _ARKODE.Usage.ERKStep.ERKStepRootfindingInputTable: -.. table:: Rootfinding optional input functions - - +-----------------------------------------+------------------------------------------+----------+ - | Optional input | Function name | Default | - +-----------------------------------------+------------------------------------------+----------+ - | Direction of zero-crossings to monitor | :c:func:`ERKStepSetRootDirection()` | both | - +-----------------------------------------+------------------------------------------+----------+ - | Disable inactive root warnings | :c:func:`ERKStepSetNoInactiveRootWarn()` | enabled | - +-----------------------------------------+------------------------------------------+----------+ - - - .. c:function:: int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) Specifies the direction of zero-crossings to be located and returned. @@ -1509,6 +1372,10 @@ described in :numref:`ARKODE.Mathematics.Rootfinding`. **Notes:** The default behavior is to monitor for both zero-crossing directions. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRootDirection` instead. + .. c:function:: int ERKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -1532,6 +1399,9 @@ described in :numref:`ARKODE.Mathematics.Rootfinding`. first step), ERKStep will issue a warning which can be disabled with this optional input function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -1541,20 +1411,6 @@ described in :numref:`ARKODE.Mathematics.Rootfinding`. Interpolated output function -------------------------------- -An optional function :c:func:`ERKStepGetDky()` is available to obtain -additional values of solution-related quantities. This function -should only be called after a successful return from -:c:func:`ERKStepEvolve()`, as it provides interpolated values either of -:math:`y` or of its derivatives (up to the 5th derivative) -interpolated to any value of :math:`t` in the last internal step taken -by :c:func:`ERKStepEvolve()`. Internally, this "dense output" or -"continuous extension" algorithm is identical to the algorithm used for -the maximum order implicit predictors, described in -:numref:`ARKODE.Mathematics.Predictors.Max`, except that -derivatives of the polynomial model may be evaluated upon request. - - - .. c:function:: int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function @@ -1592,6 +1448,9 @@ derivatives of the polynomial model may be evaluated upon request. functions :c:func:`ERKStepGetCurrentTime()` and :c:func:`ERKStepGetLastStep()`, respectively. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetDky` instead. @@ -1600,96 +1459,12 @@ derivatives of the polynomial model may be evaluated upon request. Optional output functions ------------------------------ -ERKStep provides an extensive set of functions that can be used to -obtain solver performance information. We organize these into groups: - -#. General ERKStep output routines are in - :numref:`ARKODE.Usage.ERKStep.ERKStepMainOutputs`, - -#. Output routines regarding root-finding results are in - :numref:`ARKODE.Usage.ERKStep.ERKStepRootOutputs`, - -#. General usability routines (e.g. to print the current ERKStep - parameters, or output the current Butcher table) are in - :numref:`ARKODE.Usage.ERKStep.ERKStepExtraOutputs`. - -Following each table, we elaborate on each function. - -Some of the optional outputs, especially the various counters, can be -very useful in determining the efficiency of various methods inside -ERKStep. For example: - -* The counters *nsteps* and *nf_evals* provide a rough measure of the - overall cost of a given run, and can be compared between runs with - different solver options to suggest which set of options is the most - efficient. - -* The ratio *nsteps/step_attempts* can measure the quality of the - time step adaptivity algorithm, since a poor algorithm will result - in more failed steps, and hence a lower ratio. - -It is therefore recommended that users retrieve and output these -statistics following each run, and take some time to investigate -alternate solver options that will be more optimal for their -particular problem of interest. - - .. _ARKODE.Usage.ERKStep.ERKStepMainOutputs: Main solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.ERKStep.ERKStepMainOutputsTable: -.. table:: Main solver optional output functions - - +------------------------------------------------------+-------------------------------------------+ - | Optional output | Function name | - +------------------------------------------------------+-------------------------------------------+ - | Size of ERKStep real and integer workspaces | :c:func:`ERKStepGetWorkSpace()` | - +------------------------------------------------------+-------------------------------------------+ - | Cumulative number of internal steps | :c:func:`ERKStepGetNumSteps()` | - +------------------------------------------------------+-------------------------------------------+ - | Actual initial time step size used | :c:func:`ERKStepGetActualInitStep()` | - +------------------------------------------------------+-------------------------------------------+ - | Step size used for the last successful step | :c:func:`ERKStepGetLastStep()` | - +------------------------------------------------------+-------------------------------------------+ - | Step size to be attempted on the next step | :c:func:`ERKStepGetCurrentStep()` | - +------------------------------------------------------+-------------------------------------------+ - | Current internal time reached by the solver | :c:func:`ERKStepGetCurrentTime()` | - +------------------------------------------------------+-------------------------------------------+ - | Suggested factor for tolerance scaling | :c:func:`ERKStepGetTolScaleFactor()` | - +------------------------------------------------------+-------------------------------------------+ - | Error weight vector for state variables | :c:func:`ERKStepGetErrWeights()` | - +------------------------------------------------------+-------------------------------------------+ - | Single accessor to many statistics at once | :c:func:`ERKStepGetStepStats()` | - +------------------------------------------------------+-------------------------------------------+ - | Print all statistics | :c:func:`ERKStepPrintAllStats` | - +------------------------------------------------------+-------------------------------------------+ - | Name of constant associated with a return flag | :c:func:`ERKStepGetReturnFlagName()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of explicit stability-limited steps | :c:func:`ERKStepGetNumExpSteps()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of accuracy-limited steps | :c:func:`ERKStepGetNumAccSteps()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of attempted steps | :c:func:`ERKStepGetNumStepAttempts()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of calls to *f* function | :c:func:`ERKStepGetNumRhsEvals()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of local error test failures that have occurred | :c:func:`ERKStepGetNumErrTestFails()` | - +------------------------------------------------------+-------------------------------------------+ - | Current ERK Butcher table | :c:func:`ERKStepGetCurrentButcherTable()` | - +------------------------------------------------------+-------------------------------------------+ - | Estimated local truncation error vector | :c:func:`ERKStepGetEstLocalErrors()` | - +------------------------------------------------------+-------------------------------------------+ - | Single accessor to many statistics at once | :c:func:`ERKStepGetTimestepperStats()` | - +------------------------------------------------------+-------------------------------------------+ - | Number of constraint test failures | :c:func:`ERKStepGetNumConstrFails()` | - +------------------------------------------------------+-------------------------------------------+ - | Retrieve a pointer for user data | :c:func:`ERKStepGetUserData` | - +------------------------------------------------------+-------------------------------------------+ - - .. c:function:: int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) @@ -1704,6 +1479,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetWorkSpace` instead. + .. c:function:: int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) @@ -1719,6 +1498,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumSteps` instead. + .. c:function:: int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) @@ -1741,6 +1524,10 @@ Main solver optional output functions bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to satisfy the local error test condition. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetActualInitStep` instead. + .. c:function:: int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -1756,6 +1543,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLastStep` instead. + .. c:function:: int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -1770,6 +1561,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentStep` instead. + .. c:function:: int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -1784,6 +1579,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentTime` instead. + .. c:function:: int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -1800,6 +1599,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetTolScaleFactor` instead. + .. c:function:: int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -1818,6 +1621,10 @@ Main solver optional output functions The user must allocate space for *eweight*, that will be filled in by this function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetErrWeights` instead. + .. c:function:: int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -1836,6 +1643,11 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetStepStats` instead. + + .. c:function:: int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -1863,9 +1675,13 @@ Main solver optional output functions .. versionadded:: 5.2.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodePrintAllStats` instead. + -.. c:function:: char *ERKStepGetReturnFlagName(long int flag) +.. c:function:: char* ERKStepGetReturnFlagName(long int flag) Returns the name of the ERKStep constant corresponding to *flag*. See :ref:`ARKODE.Constants`. @@ -1877,6 +1693,10 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetReturnFlagName` instead. + .. c:function:: int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps) @@ -1892,6 +1712,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumExpSteps` instead. + .. c:function:: int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps) @@ -1907,6 +1731,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumAccSteps` instead. + .. c:function:: int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -1921,6 +1749,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumStepAttempts` instead. + .. c:function:: int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nf_evals) @@ -1951,6 +1783,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumErrTestFails` instead. + .. c:function:: int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable *B) @@ -2014,6 +1850,10 @@ Main solver optional output functions failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetEstLocalErrors` instead. + .. c:function:: int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, long int* accsteps, long int* step_attempts, long int* nf_evals, long int* netfails) @@ -2046,6 +1886,10 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumConstrFails` instead. + .. c:function:: int ERKStepGetUserData(void* arkode_mem, void** user_data) @@ -2063,25 +1907,16 @@ Main solver optional output functions .. versionadded:: 5.3.0 + .. deprecated:: x.y.z -.. _ARKODE.Usage.ERKStep.ERKStepRootOutputs: - -Rootfinding optional output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - + Use :c:func:`ARKodeGetUserData` instead. -.. _ARKODE.Usage.ERKStep.ERKStepRootOutputsTable: -.. table:: Rootfinding optional output functions - +--------------------------------------------------+---------------------------------+ - | Optional output | Function name | - +--------------------------------------------------+---------------------------------+ - | Array showing roots found | :c:func:`ERKStepGetRootInfo()` | - +--------------------------------------------------+---------------------------------+ - | No. of calls to user root function | :c:func:`ERKStepGetNumGEvals()` | - +--------------------------------------------------+---------------------------------+ +.. _ARKODE.Usage.ERKStep.ERKStepRootOutputs: +Rootfinding optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. c:function:: int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) @@ -2110,6 +1945,10 @@ Rootfinding optional output functions zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetRootInfo` instead. + .. c:function:: int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -2125,6 +1964,9 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumGEvals` instead. @@ -2133,28 +1975,6 @@ Rootfinding optional output functions General usability functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following optional routines may be called by a user to inquire -about existing solver parameters, to retrieve stored Butcher tables, -write the current Butcher table, or even to test a provided Butcher -table to determine its analytical order of accuracy. While none of -these would typically be called during the course of solving an -initial value problem, these may be useful for users wishing to better -understand ERKStep and/or specific Runge--Kutta methods. - - -.. _ARKODE.Usage.ERKStep.ERKStepExtraOutputsTable: -.. table:: General usability functions - - +----------------------------------------+------------------------------------+ - | Optional routine | Function name | - +----------------------------------------+------------------------------------+ - | Output all ERKStep solver parameters | :c:func:`ERKStepWriteParameters()` | - +----------------------------------------+------------------------------------+ - | Output the current Butcher table | :c:func:`ERKStepWriteButcher()` | - +----------------------------------------+------------------------------------+ - - - .. c:function:: int ERKStepWriteParameters(void* arkode_mem, FILE *fp) @@ -2176,6 +1996,11 @@ understand ERKStep and/or specific Runge--Kutta methods. for this pointer, since parameters for all processes would be identical. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeWriteParameters` instead. + + .. c:function:: int ERKStepWriteButcher(void* arkode_mem, FILE *fp) @@ -2197,6 +2022,10 @@ understand ERKStep and/or specific Runge--Kutta methods. for this pointer, since tables for all processes would be identical. + .. deprecated:: x.y.z + + Use :c:func:`ERKStepGetCurrentButcherTable` and :c:func:`ARKodeButcherTable_Write` + instead. @@ -2279,40 +2108,6 @@ vector. ERKStep reset function ---------------------- -To reset the ERKStep module to a particular state :math:`(t_R,y(t_R))` for the -continued solution of a problem, where a prior -call to :c:func:`ERKStepCreate` has been made, the user must call the function -:c:func:`ERKStepReset()`. Like :c:func:`ERKStepReInit()` this routine retains -the current settings for all ERKStep module options and performs no memory -allocations but, unlike :c:func:`ERKStepReInit()`, this routine performs only a -*subset* of the input checking and initializations that are done in -:c:func:`ERKStepCreate`. In particular this routine retains all internal -counter values and the step size/error history. Like :c:func:`ERKStepReInit()`, a call to -:c:func:`ERKStepReset()` will delete any previously-set *tstop* value specified -via a call to :c:func:`ERKStepSetStopTime()`. Following a successful call to -:c:func:`ERKStepReset()`, call :c:func:`ERKStepEvolve()` again to continue -solving the problem. By default the next call to :c:func:`ERKStepEvolve()` will -use the step size computed by ERKStep prior to calling :c:func:`ERKStepReset()`. -To set a different step size or have ERKStep estimate a new step size use -:c:func:`ERKStepSetInitStep()`. - -One important use of the :c:func:`ERKStepReset()` function is in the -treating of jump discontinuities in the RHS functions. Except in cases -of fairly small jumps, it is usually more efficient to stop at each -point of discontinuity and restart the integrator with a readjusted -ODE model, using a call to :c:func:`ERKStepReset()`. To stop when -the location of the discontinuity is known, simply make that location -a value of ``tout``. To stop when the location of the discontinuity -is determined by the solution, use the rootfinding feature. In either -case, it is critical that the RHS functions *not* incorporate the -discontinuity, but rather have a smooth extension over the -discontinuity, so that the step across it (and subsequent rootfinding, -if used) can be done efficiently. Then use a switch within the RHS -functions (communicated through ``user_data``) that can be flipped -between the stopping of the integration and the restart, so that the -restarted problem uses the new values (which have jumped). Similar -comments apply if there is to be a jump in the dependent variable -vector. .. c:function:: int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) @@ -2342,6 +2137,10 @@ vector. If an error occurred, :c:func:`ERKStepReset()` also sends an error message to the error handler function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeReset` instead. + @@ -2350,35 +2149,6 @@ vector. ERKStep system resize function ------------------------------------- -For simulations involving changes to the number of equations and -unknowns in the ODE system (e.g. when using spatially-adaptive -PDE simulations under a method-of-lines approach), the ERKStep -integrator may be "resized" between integration steps, through calls -to the :c:func:`ERKStepResize()` function. This function modifies -ERKStep's internal memory structures to use the new problem size, -without destruction of the temporal adaptivity heuristics. It is -assumed that the dynamical time scales before and after the vector -resize will be comparable, so that all time-stepping heuristics prior -to calling :c:func:`ERKStepResize()` remain valid after the call. If -instead the dynamics should be recomputed from scratch, the ERKStep -memory structure should be deleted with a call to -:c:func:`ERKStepFree()`, and recreated with a call to -:c:func:`ERKStepCreate`. - -To aid in the vector resize operation, the user can supply a vector -resize function that will take as input a vector with the previous -size, and transform it in-place to return a corresponding vector of -the new size. If this function (of type :c:func:`ARKVecResizeFn()`) -is not supplied (i.e., is set to ``NULL``), then all existing vectors -internal to ERKStep will be destroyed and re-cloned from the new input -vector. - -In the case that the dynamical time scale should be modified slightly -from the previous time scale, an input *hscale* is allowed, that will -rescale the upcoming time step by the specified factor. If a value -*hscale* :math:`\le 0` is specified, the default of 1.0 will be used. - - .. c:function:: int ERKStepResize(void* arkode_mem, N_Vector yR, sunrealtype hscale, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) @@ -2413,22 +2183,6 @@ rescale the upcoming time step by the specified factor. If a value to :c:func:`ERKStepSetConstraints()` is required to re-enable constraint checking. + .. deprecated:: x.y.z -Resizing the absolute tolerance array -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -If using array-valued absolute tolerances, the absolute tolerance -vector will be invalid after the call to :c:func:`ERKStepResize()`, so -the new absolute tolerance vector should be re-set **following** each -call to :c:func:`ERKStepResize()` through a new call to -:c:func:`ERKStepSVtolerances()`. - -If scalar-valued tolerances or a tolerance function was specified -through either :c:func:`ERKStepSStolerances()` or -:c:func:`ERKStepWFtolerances()`, then these will remain valid and no -further action is necessary. - - -.. note:: For an example showing usage of the similar - :c:func:`ARKStepResize()` routine, see the supplied serial C - example problem, ``ark_heat1D_adapt.c``. + Use :c:func:`ARKodeResize` instead. diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst index d4b2498243..d799e0bc86 100644 --- a/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst +++ b/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst @@ -18,28 +18,14 @@ Using the ERKStep time-stepping module ====================================== -This chapter is concerned with the use of the ERKStep time-stepping -module for the solution of nonstiff initial value problems (IVPs) 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 ERKStep user-callable functions and user-supplied -functions. - -The example programs described in the companion document :cite:p:`arkode_ex` may -be helpful. Those codes may be used as templates for new codes and are -included in the ARKODE package ``examples`` subdirectory. - -ERKStep 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 provided separately in -:numref:`ARKODE.Constants`. - -The relevant information on using ERKStep's C and C++ interfaces is -detailed in the following sub-sections. +This section is concerned with the use of the ERKStep time-stepping +module for the solution of initial value problems (IVPs) in a C or C++ +language setting. Usage of ERKStep follows that of the rest of ARKODE, +and so in this section we primarily focus on those usage aspects that +are specific to ERKStep. .. toctree:: :maxdepth: 1 - Skeleton User_callable Relaxation diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst index a4a079570b..f1275b0ae3 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst @@ -20,71 +20,30 @@ A skeleton of the user's main program ============================================ -The following is a skeleton of the user's main program (or calling program) for -the integration of an ODE IVP using the MRIStep module. Most of the steps are -independent of the NVECTOR, SUNMATRIX, SUNLINSOL and SUNNONLINSOL -implementations used. For the steps that are not, refer to :numref:`NVectors`, -:numref:`SUNMatrix`, :numref:`SUNLinSol`, and :numref:`SUNNonlinSol` for the -specific name of the function to be called or macro to be referenced. +While MRIStep usage generally follows the same pattern as the rest of +ARKODE, since it involves the solution of both MRIStep for the slow +time scale and another time integrator for the fast time scale, we +summarize the differences in using MRIStep here. Steps that are +unchanged from the skeleton program presented in +:numref:`ARKODE.Usage.Skeleton` are *italicized*. -.. index:: User main program +.. index:: MRIStep user main program -#. Initialize parallel or multi-threaded environment, if appropriate. +#. *Initialize parallel or multi-threaded environment, if appropriate.* - For example, call ``MPI_Init`` to initialize MPI if used, or set - ``num_threads``, the number of threads to use within the threaded - vector functions, if used. +#. *Create the SUNDIALS simulation context object* -#. Create the SUNDIALS context object +#. *Set problem dimensions, etc.* - Call :c:func:`SUNContext_Create` to allocate the ``SUNContext`` object. - -#. Set problem dimensions, etc. - - This generally includes the problem size, ``N``, and may include - the local vector length ``Nlocal``. - - .. note:: - - The variables ``N`` and ``Nlocal`` should be of type - ``sunindextype``. - -#. Set vector of initial values - - To set the vector ``y0`` of initial values, use the appropriate - functions defined by the particular NVECTOR implementation. - - For native SUNDIALS vector implementations (except the CUDA and - RAJA based ones), use a call of the form - - .. code-block:: c - - y0 = N_VMake_***(..., ydata); - - if the ``sunrealtype`` array ``ydata`` containing the initial values of - :math:`y` already exists. Otherwise, create a new vector by making - a call of the form - - .. code-block:: c - - y0 = N_VNew_***(...); - - and then set its elements by accessing the underlying data where it - is located with a call of the form - - .. code-block:: c - - ydata = N_VGetArrayPointer_***(y0); - - For details on each of SUNDIALS' provided vector implementations, see - the corresponding sections in :numref:`NVectors` for details. +#. *Set vector of initial values* #. Create an inner stepper object to solve the fast (inner) IVP * If using ARKStep as the fast (inner) integrator, create the ARKStep object with :c:func:`ARKStepCreate` and configure the integrator as desired for - evolving the fast time scale. See sections :numref:`ARKODE.Usage.ARKStep.Skeleton` - and :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for details on configuring + evolving the fast time scale. See sections :numref:`ARKODE.Usage.Skeleton`, + :numref:`ARKODE.Usage.OptionalInputs`, and + :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for details on configuring ARKStep. Once the ARKStep object is setup, create an ``MRIStepInnerStepper`` object @@ -109,18 +68,18 @@ specific name of the function to be called or macro to be referenced. If a *user_data* pointer needs to be passed to user functions called by the fast (inner) integrator then it should be attached here by calling - :c:func:`ARKStepSetUserData()`. This *user_data* pointer will only be + :c:func:`ARKodeSetUserData()`. This *user_data* pointer will only be passed to user-supplied functions that are attached to the fast (inner) integrator. To supply a *user_data* pointer to user-supplied functions called by the slow (outer) integrator the desired pointer should be - attached by calling :c:func:`MRIStepSetUserData()` after creating the + attached by calling :c:func:`ARKodeSetUserData()` after creating the MRIStep memory below. The *user_data* pointers attached to the inner and outer integrators may be the same or different depending on what is required by the user code. Specifying a rootfinding problem for the fast integration is not supported. Rootfinding problems should be created and initialized with - the slow integrator. See the steps below and :c:func:`MRIStepRootInit()` + the slow integrator. See the steps below and :c:func:`ARKodeRootInit()` for more details. #. Create an MRIStep object for the slow (outer) integration @@ -131,192 +90,57 @@ specific name of the function to be called or macro to be referenced. #. Set the slow step size - Call :c:func:`MRIStepSetFixedStep()` to specify the slow time step - size. + Call :c:func:`ARKodeSetFixedStep()` on the MRIStep object to specify the + slow time step size. #. Create and configure implicit solvers (*as appropriate*) Specifically, if MRIStep is configured with an implicit slow right-hand side function in the prior step, then the following steps are recommended: - #. Specify integration tolerances - - Call :c:func:`MRIStepSStolerances()` or :c:func:`MRIStepSVtolerances()` to - specify either a scalar relative tolerance and scalar absolute tolerance, - or a scalar relative tolerance and a vector of absolute tolerances, - respectively. Alternatively, call :c:func:`MRIStepWFtolerances()` - to specify a function which sets directly the weights used in - evaluating WRMS vector norms. See :numref:`ARKODE.Usage.MRIStep.Tolerances` for - details. - - #. Create nonlinear solver object - - If a non-default nonlinear solver object is desired for implicit - MRI stage solves (see :numref:`ARKODE.Usage.MRIStep.NonlinearSolvers`), - then that nonlinear solver object must be created by using - the appropriate functions defined by the particular SUNNONLINSOL - implementation (e.g., ``NLS = SUNNonlinSol_***(...);`` where - ``***`` is the name of the nonlinear solver (see - :numref:`SUNNonlinSol` for details). - - For the SUNDIALS-supplied SUNNONLINSOL implementations, the - nonlinear solver object may be created using a call of the form - - .. code-block:: c - - SUNNonlinearSolver NLS = SUNNonlinSol_*(...); - - where ``*`` can be replaced with "Newton", "FixedPoint", or other - options, as discussed in the sections - :numref:`ARKODE.Usage.ARKStep.NonlinearSolvers` and :numref:`SUNNonlinSol`. - - Note: by default, MRIStep will use the Newton nonlinear solver - (see section :numref:`SUNNonlinSol.Newton`), so a custom nonlinear solver - object is only needed when using a *different* solver, or for the user - to exercise additional controls over the Newton solver. - - #. Attach nonlinear solver module - - If a nonlinear solver object was created above, then it must be - attached to MRIStep using the call (for details see - :numref:`ARKODE.Usage.MRIStep.NonlinearSolvers`): - - .. code-block:: c + #. *Specify integration tolerances* - ier = MRIStepSetNonlinearSolver(...); + #. *Create matrix object* - #. Set nonlinear solver optional inputs + #. *Create linear solver object* - Call the appropriate set functions for the selected nonlinear - solver module to change optional inputs specific to that nonlinear - solver. These *must* be called after attaching the nonlinear - solver to MRIStep, otherwise the optional inputs will be - overridden by MRIStep defaults. See :numref:`SUNNonlinSol` for more - information on optional inputs. + #. *Set linear solver optional inputs* - #. Create matrix object + #. *Attach linear solver module* - If a nonlinear solver requiring a linear solver will be used (e.g., - a Newton iteration) and if that linear solver will be matrix-based, - then a template Jacobian matrix must be created by using the - appropriate functions defined by the particular SUNMATRIX - implementation. + #. *Create nonlinear solver object* - For the SUNDIALS-supplied SUNMATRIX implementations, the - matrix object may be created using a call of the form + #. *Attach nonlinear solver module* - .. code-block:: c + #. *Set nonlinear solver optional inputs* - SUNMatrix A = SUNBandMatrix(...); +#. *Set optional inputs* - or similar for other matrix modules (see :numref:`SUNMatrix` for - further information). +#. *Specify rootfinding problem* - #. Create linear solver object +#. *Advance solution in time* - If a nonlinear solver requiring a linear solver will be used (e.g., - a Newton iteration), then the desired linear solver object(s) must be - created by using the appropriate functions defined by the particular - SUNLINSOL implementation. +#. *Get optional outputs* - For any of the SUNDIALS-supplied SUNLINSOL implementations, the - linear solver object may be created using a call of the form - - .. code-block:: c - - SUNLinearSolver LS = SUNLinSol_*(...); - - where ``*`` can be replaced with "Dense", "SPGMR", or other - options, as discussed in :numref:`SUNLinSol`. - - #. Set linear solver optional inputs - - Call ``*Set*`` functions from the selected linear solver module - to change optional inputs specific to that linear solver. See the - documentation for each SUNLINSOL module in :numref:`SUNLinSol` for details. - - #. Attach linear solver module - - If a linear solver was created above for implicit MRI stage solves, - initialize the ARKLS linear solver interface by attaching the - linear solver object (and Jacobian matrix object, if applicable) - with the call (for details see :numref:`ARKODE.Usage.MRIStep.LinearSolvers`): - - .. code-block:: c - - ier = MRIStepSetLinearSolver(...); - -#. Set optional inputs - - Call ``MRIStepSet*`` functions to change any optional inputs that - control the behavior of MRIStep from their default values. See - :numref:`ARKODE.Usage.MRIStep.OptionalInputs` for details. - -#. Specify rootfinding problem - - Optionally, call :c:func:`MRIStepRootInit()` to initialize a rootfinding - problem to be solved during the integration of the ODE system. See - :numref:`ARKODE.Usage.MRIStep.RootFinding` for general details, and - :numref:`ARKODE.Usage.MRIStep.OptionalInputs` for relevant optional input calls. - -#. Advance solution in time - - For each point at which output is desired, call - - .. code-block:: c - - ier = MRIStepEvolve(arkode_mem, tout, yout, &tret, itask); - - Here, ``itask`` specifies the return mode. The vector ``yout`` - (which can be the same as the vector ``y0`` above) will contain - :math:`y(t_\text{out})`. See :numref:`ARKODE.Usage.MRIStep.Integration` for details. - -#. Get optional outputs - - Call ``MRIStepGet*`` and/or ``ARKStepGet*`` functions to obtain optional - output from the slow or fast integrators respectively. See - :numref:`ARKODE.Usage.MRIStep.OptionalOutputs` and - :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` for details. - -#. Deallocate memory for solution vector - - Upon completion of the integration, deallocate memory for the - vector ``y`` (or ``yout``) by calling the NVECTOR destructor - function: - - .. code-block:: c - - N_VDestroy(y); +#. *Deallocate memory for solution vector* #. Free solver memory * If ARKStep was used as the fast (inner) IVP integrator, call - :c:func:`MRIStepInnerStepper_Free` and :c:func:`ARKStepFree` to free the + :c:func:`MRIStepInnerStepper_Free` and :c:func:`ARKodeFree` to free the memory allocated for the fast (inner) integrator. * If a user-defined fast (inner) integrator was supplied, free the integrator content and call :c:func:`MRIStepInnerStepper_Free` to free the ``MRIStepInnerStepper`` object. - * Call :c:func:`MRIStepFree` to free the memory allocated for the slow - integration object. - -#. Free linear solver and matrix memory (*as appropriate*) - - Call :c:func:`SUNLinSolFree()` and (possibly) - :c:func:`SUNMatDestroy()` to free any memory allocated for any - linear solver and/or matrix objects created above for either the fast or - slow integrators. - -#. Free nonlinear solver memory (*as appropriate*) + * Call :c:func:`ARKodeFree` to free the memory allocated for the MRIStep + slow integration object. - If a user-supplied ``SUNNonlinearSolver`` was provided to MRIStep, - then call :c:func:`SUNNonlinSolFree()` to free any memory allocated - for the nonlinear solver object created above. +#. *Free linear solver and matrix memory (as appropriate)* -#. **Free the SUNContext object** - Call :c:func:`SUNContext_Free` to free the memory allocated for the ``SUNContext`` object. +#. *Free nonlinear solver memory (as appropriate)* - #. Finalize MPI, if used +#. *Free the SUNContext object* - Call ``MPI_Finalize`` to terminate MPI. +#. *Finalize MPI, if used* diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst index dbb44c425c..3719395f66 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst @@ -18,21 +18,20 @@ MRIStep User-callable functions ================================== -This section describes the functions that are called by the -user to setup and then solve an IVP using the MRIStep time-stepping -module. Some of these are required; however, starting with -:numref:`ARKODE.Usage.MRIStep.OptionalInputs`, the functions listed involve -optional inputs/outputs or restarting, and those paragraphs may be -skipped for a casual use of ARKODE's MRIStep module. In any case, -refer to the preceding section, :numref:`ARKODE.Usage.MRIStep.Skeleton`, -for the correct order of these calls. +This section describes the MRIStep-specific functions that may be called +by the user to setup and then solve an IVP using the MRIStep time-stepping +module. The large majority of these routines merely wrap :ref:`underlying +ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated +-- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained +below. -On an error, each user-callable function returns a negative value (or -``NULL`` if the function returns a pointer) and sends an error message -to the error handler routine, which prints the message to ``stderr`` -by default. However, the user can set a file as error output or can -provide their own error handler function (see -:numref:`ARKODE.Usage.MRIStep.OptionalInputs` for details). +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +MRIStep supports the following categories: + +* implicit nonlinear and/or linear solvers @@ -111,6 +110,10 @@ MRIStep initialization and deallocation functions **Return value:** None + .. deprecated:: x.y.z + + Use :c:func:`ARKodeFree` instead. + .. _ARKODE.Usage.MRIStep.Tolerances: @@ -118,40 +121,6 @@ MRIStep initialization and deallocation functions MRIStep tolerance specification functions ------------------------------------------------------ -These functions specify the integration tolerances. One of them -**should** be called before the first call to -:c:func:`MRIStepEvolve()`; otherwise default values of ``reltol = -1e-4`` and ``abstol = 1e-9`` will be used, which may be entirely -incorrect for a specific problem. - -The integration tolerances ``reltol`` and ``abstol`` define a vector -of error weights, ``ewt``. In the case of -:c:func:`MRIStepSStolerances()`, this vector has components - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol); - -whereas in the case of :c:func:`MRIStepSVtolerances()` the vector components -are given by - -.. code-block:: c - - ewt[i] = 1.0/(reltol*abs(y[i]) + abstol[i]); - -This vector is used in all error tests, which use a weighted RMS norm -on all error-like vectors :math:`v`: - -.. math:: - \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; ewt_i)^2 \right)^{1/2}, - -where :math:`N` is the problem dimension. - -Alternatively, the user may supply a custom function to supply the -``ewt`` vector, through a call to :c:func:`MRIStepWFtolerances()`. - - - .. c:function:: int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) This function specifies scalar relative and absolute tolerances. @@ -167,6 +136,10 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSStolerances` instead. + .. c:function:: int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -187,6 +160,10 @@ Alternatively, the user may supply a custom function to supply the * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSVtolerances` instead. + .. c:function:: int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -204,100 +181,9 @@ Alternatively, the user may supply a custom function to supply the * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module + .. deprecated:: x.y.z - - -General advice on the choice of tolerances -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For many users, the appropriate choices for tolerance values in -``reltol`` and ``abstol`` are a concern. The following pieces -of advice are relevant. - -(1) The scalar relative tolerance ``reltol`` is to be set to control - relative errors. So a value of :math:`10^{-4}` means that errors - are controlled to .01%. We do not recommend using ``reltol`` larger - than :math:`10^{-3}`. On the other hand, ``reltol`` should not be so - small that it is comparable to the unit roundoff of the machine - arithmetic (generally around :math:`10^{-15}` for double-precision). - -(2) The absolute tolerances ``abstol`` (whether scalar or vector) need - to be set to control absolute errors when any components of the - solution vector :math:`y` may be so small that pure relative error - control is meaningless. For example, if :math:`y_i` starts at some - nonzero value, but in time decays to zero, then pure relative - error control on :math:`y_i` makes no sense (and is overly costly) - after :math:`y_i` is below some noise level. Then ``abstol`` (if - scalar) or ``abstol[i]`` (if a vector) needs to be set to that - noise level. If the different components have different noise - levels, then ``abstol`` should be a vector. For example, see the - example problem ``ark_robertson.c``, and the discussion - of it in the ARKODE Examples Documentation :cite:p:`arkode_ex`. In that - problem, the three components vary between 0 and 1, and have - different noise levels; hence the ``atols`` vector therein. It is - impossible to give any general advice on ``abstol`` values, - because the appropriate noise levels are completely - problem-dependent. The user or modeler hopefully has some idea as - to what those noise levels are. - -(3) Finally, it is important to pick all the tolerance values - conservatively, because they control the error committed on each - individual step. The final (global) errors are an accumulation of - those per-step errors, where that accumulation factor is - problem-dependent. A general rule of thumb is to reduce the - tolerances by a factor of 10 from the actual desired limits on - errors. So if you want .01% relative accuracy (globally), a good - choice for ``reltol`` is :math:`10^{-5}`. In any case, it is - a good idea to do a few experiments with the tolerances to see how - the computed solution values vary as tolerances are reduced. - - - -Advice on controlling nonphysical negative values -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In many applications, some components in the true solution are always -positive or non-negative, though at times very small. In the -numerical solution, however, small negative (nonphysical) values -can then occur. In most cases, these values are harmless, and simply -need to be controlled, not eliminated, but in other cases any value -that violates a constraint may cause a simulation to halt. For both of -these scenarios the following pieces of advice are relevant. - -(1) The best way to control the size of unwanted negative computed - values is with tighter absolute tolerances. Again this requires - some knowledge of the noise level of these components, which may - or may not be different for different components. Some - experimentation may be needed. - -(2) If output plots or tables are being generated, and it is important - to avoid having negative numbers appear there (for the sake of - avoiding a long explanation of them, if nothing else), then - eliminate them, but only in the context of the output medium. Then - the internal values carried by the solver are unaffected. Remember - that a small negative value in :math:`y` returned by MRIStep, with - magnitude comparable to ``abstol`` or less, is equivalent to zero - as far as the computation is concerned. - -(3) The user's right-hand side routine :math:`f^I` - should never change a negative value in the solution vector :math:`y` - to a non-negative value in attempt to "fix" this problem, - since this can lead to numerical instability. If the :math:`f^I` - routine cannot tolerate a zero or negative value (e.g. because - there is a square root or log), then the offending value should be - changed to zero or a tiny positive number in a temporary variable - (not in the input :math:`y` vector) for the purposes of computing - :math:`f^I(t, y)`. - -.. - (4) Positivity and non-negativity constraints on components can be - enforced by use of the recoverable error return feature in the - user-supplied right-hand side function, :math:`f^I`. When a - recoverable error is encountered, MRIStep will retry the step with - a smaller step size, which typically alleviates the problem. - However, because this option involves some additional overhead - cost, it should only be exercised if the use of absolute - tolerances to control the computed values is unsuccessful. + Use :c:func:`ARKodeWFtolerances` instead. @@ -306,74 +192,6 @@ these scenarios the following pieces of advice are relevant. Linear solver interface functions ------------------------------------------- -As previously explained, the Newton iterations used in solving -implicit systems within MRIStep require the solution of linear -systems of the form - -.. math:: - \mathcal{A}\left(z_i^{(m)}\right) \delta^{(m+1)} = -G\left(z_i^{(m)}\right) - -where - -.. math:: - \mathcal{A} \approx I - \gamma J, \qquad J = \frac{\partial f^I}{\partial y}. - -ARKODE's ARKLS linear solver interface supports all valid -``SUNLinearSolver`` modules for this task. - -Matrix-based ``SUNLinearSolver`` modules utilize ``SUNMatrix`` objects -to store the approximate Jacobian matrix :math:`J`, the Newton matrix -:math:`\mathcal{A}`, and, when using direct solvers, the factorizations -used throughout the solution process. - -Matrix-free ``SUNLinearSolver`` modules instead use iterative methods -to solve the Newton systems of equations, and only require the -*action* of the matrix on a vector, :math:`\mathcal{A}v`. With most -of these methods, preconditioning can be done on the left only, on the -right only, on both the left and the right, or not at all. The -exceptions to this rule are SPFGMR that supports right preconditioning -only and PCG that performs symmetric preconditioning. For the -specification of a preconditioner, see the iterative linear solver -portions of :numref:`ARKODE.Usage.MRIStep.OptionalInputs` and -:numref:`ARKODE.Usage.UserSupplied`. - -If preconditioning is done, user-supplied functions should be used to -define left and right preconditioner matrices :math:`P_1` and -:math:`P_2` (either of which could be the identity matrix), such that -the product :math:`P_{1}P_{2}` approximates the Newton matrix -:math:`\mathcal{A} = I - \gamma J`. - -To specify a generic linear solver for MRIStep to use for the Newton -systems, after the call to :c:func:`MRIStepCreate()` but before any -calls to :c:func:`MRIStepEvolve()`, the user's program must create the -appropriate ``SUNLinearSolver`` object and call the function -:c:func:`MRIStepSetLinearSolver()`, as documented below. To create -the ``SUNLinearSolver`` object, the user may call one of the -SUNDIALS-packaged SUNLinSol module constructor routines via a call of -the form - -.. code:: c - - SUNLinearSolver LS = SUNLinSol_*(...); - -The current list of SUNDIALS-packaged SUNLinSol modules, and their -constructor routines, may be found in chapter :numref:`SUNLinSol`. -Alternately, a user-supplied ``SUNLinearSolver`` module may be created -and used. Specific information on how to create such user-provided -modules may be found in :numref:`SUNLinSol.API.Custom`. - -Once this solver object has been constructed, the user should attach -it to MRIStep via a call to :c:func:`MRIStepSetLinearSolver()`. The -first argument passed to this function is the MRIStep memory pointer -returned by :c:func:`MRIStepCreate()`; the second argument is the -``SUNLinearSolver`` object created above. The third argument is an -optional ``SUNMatrix`` object to accompany matrix-based -``SUNLinearSolver`` inputs (for matrix-free linear solvers, the third -argument should be ``NULL``). A call to this function initializes the -ARKLS linear solver interface, linking it to the MRIStep integrator, -and allows the user to specify additional parameters and routines -pertinent to their choice of linear solver. - .. c:function:: int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix J) This function specifies the ``SUNLinearSolver`` object that MRIStep @@ -415,6 +233,10 @@ pertinent to their choice of linear solver. insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by MRIStep. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinearSolver` instead. + .. _ARKODE.Usage.MRIStep.NonlinearSolvers: @@ -422,24 +244,6 @@ pertinent to their choice of linear solver. Nonlinear solver interface functions ------------------------------------------- -When changing the nonlinear solver in MRIStep, after the -call to :c:func:`MRIStepCreate()` but before any calls to -:c:func:`MRIStepEvolve()`, the user's program must create the -appropriate SUNNonlinSol object and call -:c:func:`MRIStepSetNonlinearSolver()`, as documented below. If any -calls to :c:func:`MRIStepEvolve()` have been made, then MRIStep will -need to be reinitialized by calling :c:func:`MRIStepReInit()` to -ensure that the nonlinear solver is initialized correctly before any -subsequent calls to :c:func:`MRIStepEvolve()`. - -The first argument passed to the routine -:c:func:`MRIStepSetNonlinearSolver()` is the MRIStep memory pointer -returned by :c:func:`MRIStepCreate()`; the second argument passed -to this function is the desired ``SUNNonlinearSolver`` object to use for -solving the nonlinear system for each implicit stage. A call to this -function attaches the nonlinear solver to the main MRIStep integrator. - - .. c:function:: int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) This function specifies the ``SUNNonlinearSolver`` object @@ -460,6 +264,10 @@ function attaches the nonlinear solver to the main MRIStep integrator. default; a call to this routine replaces that module with the supplied *NLS* object. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinearSolver` instead. + .. _ARKODE.Usage.MRIStep.RootFinding: @@ -467,18 +275,6 @@ function attaches the nonlinear solver to the main MRIStep integrator. Rootfinding initialization function -------------------------------------- -As described in the section :numref:`ARKODE.Mathematics.Rootfinding`, while -solving the IVP, ARKODE's time-stepping modules have the capability to -find the roots of a set of user-defined functions. In the MRIStep module root -finding is performed between slow solution time steps only (i.e., it is not -performed within the sub-stepping a fast time scales). To activate the -root-finding algorithm, call the following function. This is normally -called only once, prior to the first call to -:c:func:`MRIStepEvolve()`, but if the rootfinding problem is to be -changed during the solution, :c:func:`MRIStepRootInit()` can also be -called prior to a continuation call to :c:func:`MRIStepEvolve()`. - - .. c:function:: int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) Initializes a rootfinding problem to be solved during the @@ -509,6 +305,10 @@ called prior to a continuation call to :c:func:`MRIStepEvolve()`. Rootfinding is only supported for the slow (outer) integrator and should not be actived for the fast (inner) integrator. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeRootInit` instead. + .. _ARKODE.Usage.MRIStep.Integration: @@ -516,13 +316,6 @@ called prior to a continuation call to :c:func:`MRIStepEvolve()`. MRIStep solver function ------------------------- -This is the central step in the solution process -- the call to perform -the integration of the IVP. The input argument *itask* specifies one of two -modes as to where MRIStep is to return a solution. These modes are modified if -the user has set a stop time (with a call to the optional input function -:c:func:`MRIStepSetStopTime()`) or has requested rootfinding. - - .. c:function:: int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) Integrates the ODE over an interval in :math:`t`. @@ -621,6 +414,10 @@ the user has set a stop time (with a call to the optional input function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeEvolve` instead. + .. _ARKODE.Usage.MRIStep.OptionalInputs: @@ -628,79 +425,12 @@ the user has set a stop time (with a call to the optional input function Optional input functions ------------------------- -There are numerous optional input parameters that control the behavior -of MRIStep, each of which may be modified from its default value through -calling an appropriate input function. The following tables list all -optional input functions, grouped by which aspect of MRIStep they control. -Detailed information on the calling syntax and arguments for each -function are then provided following each table. - -The optional inputs are grouped into the following categories: - -* General MRIStep options (:numref:`ARKODE.Usage.MRIStep.MRIStepInput`), - -* IVP method solver options (:numref:`ARKODE.Usage.MRIStep.MRIStepMethodInput`), - -* Implicit stage solver options (:numref:`ARKODE.Usage.MRIStep.MRIStepSolverInput`), - -* Linear solver interface options (:numref:`ARKODE.Usage.MRIStep.ARKLsInputs`), and - -* Rootfinding options (:numref:`ARKODE.Usage.MRIStep.MRIStepRootfindingInput`). - -For the most casual use of MRIStep, relying on the default set of -solver parameters, the reader can skip to the section on user-supplied -functions, :numref:`ARKODE.Usage.UserSupplied`. - -We note that, on an error return, all of the optional input functions send an -error message to the error handler function. All error return values are -negative, so a test on the return arguments for negative values will catch all -errors. Finally, a call to an ``MRIStepSet***`` function can generally be made -from the user's calling program at any time and, if successful, takes effect -immediately. ``MRIStepSet***`` functions that cannot be called at any time note -this in the "**Notes**:" section of the function documentation. - - .. _ARKODE.Usage.MRIStep.MRIStepInput: Optional inputs for MRIStep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.MRIStep.MRIStepInput.Table: -.. table:: Optional inputs for MRIStep - - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Optional input | Function name | Default | - +===============================================================+===========================================+========================+ - | Return MRIStep solver parameters to their defaults | :c:func:`MRIStepSetDefaults()` | internal | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Set dense output interpolation type | :c:func:`MRIStepSetInterpolantType()` | ``ARK_INTERP_HERMITE`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Set dense output polynomial degree | :c:func:`MRIStepSetInterpolantDegree()` | 5 | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a pointer to a diagnostics output file | :c:func:`MRIStepSetDiagnostics()` | ``NULL`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Run with fixed-step sizes | :c:func:`MRIStepSetFixedStep()` | required | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum no. of warnings for :math:`t_n+h = t_n` | :c:func:`MRIStepSetMaxHnilWarns()` | 10 | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Maximum no. of internal steps before *tout* | :c:func:`MRIStepSetMaxNumSteps()` | 500 | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Set a value for :math:`t_{stop}` | :c:func:`MRIStepSetStopTime()` | undefined | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Interpolate at :math:`t_{stop}` | :c:func:`MRIStepSetInterpolateStopTime()` | ``SUNFALSE`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Disable the stop time | :c:func:`MRIStepClearStopTime` | N/A | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a pointer for user data | :c:func:`MRIStepSetUserData()` | ``NULL`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a function to be called prior to the inner integration | :c:func:`MRIStepSetPreInnerFn()` | ``NULL`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - | Supply a function to be called after the inner integration | :c:func:`MRIStepSetPostInnerFn()` | ``NULL`` | - +---------------------------------------------------------------+-------------------------------------------+------------------------+ - - - .. c:function:: int MRIStepSetDefaults(void* arkode_mem) @@ -719,10 +449,14 @@ Optional inputs for MRIStep * *ARK_ILL_INPUT* if an argument has an illegal value - **Notes:** This function does not change problem-defining function pointers - *fs* and *ff* or the *user_data* pointer. It also does not affect any data - structures or options related to root-finding (those can be reset using - :c:func:`MRIStepRootInit()`). + **Notes:** This function does not change problem-defining function pointers + *fs* and *ff* or the *user_data* pointer. It also does not affect any data + structures or options related to root-finding (those can be reset using + :c:func:`MRIStepRootInit()`). + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDefaults` instead. @@ -763,6 +497,10 @@ Optional inputs for MRIStep If this routine is not called, the Hermite interpolation module will be used. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantType` instead. + .. c:function:: int MRIStepSetInterpolantDegree(void* arkode_mem, int degree) @@ -810,14 +548,17 @@ Optional inputs for MRIStep When :math:`q=1`, a linear interpolant is the default to ensure values obtained by the integrator are returned at the ends of the time interval. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantDegree` instead. + .. c:function:: int MRIStepSetDenseOrder(void* arkode_mem, int dord) - *This function is deprecated, and will be removed in a future release. - Users should transition to calling* :c:func:`MRIStepSetInterpolantDegree()` - *instead.* + .. deprecated:: 5.2.0 + Use :c:func:`ARKodeSetInterpolantDegree` instead. .. c:function:: int MRIStepSetDiagnostics(void* arkode_mem, FILE* diagfp) @@ -877,35 +618,9 @@ Optional inputs for MRIStep The step sizes used by the inner (fast) stepper may be controlled through calling the appropriate "Set" routines on the inner integrator. + .. deprecated:: x.y.z - -.. - .. c:function:: int MRIStepSetInitStep(void* arkode_mem, sunrealtype hin) - - Specifies the initial time step size MRIStep should use after - initialization or re-initialization. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hin* -- value of the initial step to be attempted :math:`(\ne 0)`. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument has an illegal value - - **Notes:** Pass 0.0 to use the default value. - - By default, MRIStep estimates the initial step size to be the - solution :math:`h` of the equation :math:`\left\| \frac{h^2 - \ddot{y}}{2}\right\| = 1`, where :math:`\ddot{y}` is an estimated - value of the second derivative of the solution at *t0*. - + Use :c:func:`ARKodeSetFixedStep` instead. @@ -934,6 +649,9 @@ Optional inputs for MRIStep A negative value indicates that no warning messages should be issued. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -962,51 +680,10 @@ Optional inputs for MRIStep Passing *mxsteps* < 0 disables the test (not recommended). + .. deprecated:: x.y.z + Use :c:func:`ARKodeSetMaxNumSteps` instead. -.. - .. c:function:: int MRIStepSetMaxStep(void* arkode_mem, sunrealtype hmax) - - Specifies the upper bound on the magnitude of the time step size. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hmax* -- maximum absolute value of the time step size :math:`(\ge 0)`. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument has an illegal value - - **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - - - -.. - .. c:function:: int MRIStepSetMinStep(void* arkode_mem, sunrealtype hmin) - - Specifies the lower bound on the magnitude of the time step size. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hmin* -- minimum absolute value of the time step size :math:`(\ge 0)`. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument has an illegal value - - **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. .. c:function:: int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -1040,6 +717,11 @@ Optional inputs for MRIStep :c:func:`MRIStepReset` will remain active but can be disabled by calling :c:func:`MRIStepClearStopTime`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStopTime` instead. + + .. c:function:: int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -1057,6 +739,11 @@ Optional inputs for MRIStep .. versionadded:: 5.6.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolateStopTime` instead. + + .. c:function:: int MRIStepClearStopTime(void* arkode_mem) @@ -1075,6 +762,11 @@ Optional inputs for MRIStep .. versionadded:: 5.5.1 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeClearStopTime` instead. + + .. c:function:: int MRIStepSetUserData(void* arkode_mem, void* user_data) @@ -1105,6 +797,11 @@ Optional inputs for MRIStep may be the same as or different from the pointer attached to the outer integrator depending on what is required by the user code. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetUserData` instead. + + .. c:function:: int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) @@ -1124,6 +821,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + .. c:function:: int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) Specifies the function called *after* each inner integration. @@ -1141,28 +839,6 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` -.. - .. c:function:: int MRIStepSetMaxErrTestFails(void* arkode_mem, int maxnef) - - Specifies the maximum number of error test failures - permitted in attempting one step, before returning with an error. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *maxnef* -- maximum allowed number of error test failures :math:`(>0)`. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument has an illegal value - - **Notes:** The default value is 7; set *maxnef* :math:`\le 0` - to specify this default. @@ -1203,6 +879,11 @@ Optional inputs for IVP method selection * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetOrder` instead. + + .. c:function:: int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling C) @@ -1227,6 +908,10 @@ Optional inputs for IVP method selection For a description of the :c:type:`MRIStepCoupling` type and related functions for creating Butcher tables see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. + **Warning:** + + This should not be used with :c:func:`ARKodeSetOrder`. + .. _ARKODE.Usage.MRIStep.MRIStepSolverInput: @@ -1234,31 +919,6 @@ Optional inputs for IVP method selection Optional inputs for implicit stage solves ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The mathematical explanation for the nonlinear solver strategies used -by MRIStep, including how each of the parameters below is used within -the code, is provided in :numref:`ARKODE.Mathematics.Nonlinear`. - - -.. cssclass:: table-bordered - -========================================================= ========================================= ============ -Optional input Function name Default -========================================================= ========================================= ============ -Specify linearly implicit :math:`f^I` :c:func:`MRIStepSetLinear()` ``SUNFALSE`` -Specify nonlinearly implicit :math:`f^I` :c:func:`MRIStepSetNonlinear()` ``SUNTRUE`` -Implicit predictor method :c:func:`MRIStepSetPredictorMethod()` 0 -Maximum number of nonlinear iterations :c:func:`MRIStepSetMaxNonlinIters()` 3 -Coefficient in the nonlinear convergence test :c:func:`MRIStepSetNonlinConvCoef()` 0.1 -Nonlinear convergence rate constant :c:func:`MRIStepSetNonlinCRDown()` 0.3 -Nonlinear residual divergence ratio :c:func:`MRIStepSetNonlinRDiv()` 2.3 -User-provided implicit stage predictor :c:func:`MRIStepSetStagePredictFn()` ``NULL`` -RHS function for nonlinear system evaluations :c:func:`MRIStepSetNlsRhsFn()` ``NULL`` -Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDeduceImplicitRhs` ``SUNFALSE`` -========================================================= ========================================= ============ - - - - .. c:function:: int MRIStepSetLinear(void* arkode_mem, int timedepend) Specifies that the implicit slow right-hand side function, :math:`f^I(t,y)` @@ -1287,6 +947,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe The only SUNDIALS-provided SUNNonlinearSolver module that is compatible with the :c:func:`MRIStepSetLinear()` option is the Newton solver. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinear` instead. + .. c:function:: int MRIStepSetNonlinear(void* arkode_mem) @@ -1308,6 +972,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe :c:func:`MRIStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinear` instead. + .. c:function:: int MRIStepSetPredictorMethod(void* arkode_mem, int method) @@ -1344,6 +1012,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **The "bootstrap" predictor (option 4 above) has been deprecated, and will be removed from a future release.** + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetPredictorMethod` instead. + .. c:function:: int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) @@ -1364,6 +1036,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **Notes:** The default value is 3; set *maxcor* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNonlinIters` instead. + .. c:function:: int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) @@ -1382,6 +1058,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinConvCoef` instead. + .. c:function:: int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) @@ -1399,6 +1079,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinCRDown` instead. + .. c:function:: int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) @@ -1418,6 +1102,10 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNonlinRDiv` instead. + .. c:function:: int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) @@ -1437,6 +1125,11 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe **Notes:** See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStagePredictFn` instead. + + .. c:function:: int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs) @@ -1460,6 +1153,11 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe When using a non-default nonlinear solver, this function must be called *after* :c:func:`MRIStepSetNonlinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNlsRhsFn` instead. + + .. c:function:: int MRIStepSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) @@ -1479,87 +1177,23 @@ Specify if :math:`f^I` is deduced after a nonlinear solve :c:func:`MRIStepSetDe .. versionadded:: 5.2.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDeduceImplicitRhs` instead. + + .. _ARKODE.Usage.MRIStep.ARKLsInputs: Linear solver interface optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The mathematical explanation of the linear solver methods -available to MRIStep is provided in :numref:`ARKODE.Mathematics.Linear`. We -group the user-callable routines into -four categories: general routines concerning the update frequency for -matrices and/or preconditioners, optional inputs for matrix-based -linear solvers, optional inputs for matrix-free linear solvers, and -optional inputs for iterative linear solvers. We note that the -matrix-based and matrix-free groups are mutually exclusive, whereas the -"iterative" tag can apply to either case. - - .. _ARKODE.Usage.MRIStep.ARKLsInputs.General: -.. index:: - single: optional input; generic linear solver interface (MRIStep) - Optional inputs for the ARKLS linear solver interface """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -As discussed in :numref:`ARKODE.Mathematics.Linear.Setup`, ARKODE -strives to reuse matrix and preconditioner data for as many solves as -possible to amortize the high costs of matrix construction and -factorization. To that end, MRIStep provides user-callable -routines to modify this behavior. Recall that the -Newton system matrices that arise within an implicit stage solve are -:math:`{\mathcal A}(t,z) \approx I - \gamma J(t,z)`, where the -implicit right-hand side function has Jacobian matrix -:math:`J(t,z) = \frac{\partial f^I(t,z)}{\partial z}`. - -The matrix or preconditioner for :math:`{\mathcal A}` can only be -updated within a call to the linear solver 'setup' routine. In -general, the frequency with which the linear solver setup routine is -called may be controlled with the *msbp* argument to -:c:func:`MRIStepSetLSetupFrequency()`. When this occurs, the -validity of :math:`{\mathcal A}` for successive time steps -intimately depends on whether the corresponding :math:`\gamma` and -:math:`J` inputs remain valid. - -At each call to the linear solver setup routine the decision to update -:math:`\mathcal{A}` with a new value of :math:`\gamma`, and to reuse -or reevaluate Jacobian information, depends on several factors including: - -* the success or failure of previous solve attempts, -* the success or failure of the previous time step attempts, -* the change in :math:`\gamma` from the value used when constructing :math:`\mathcal{A}`, and -* the number of steps since Jacobian information was last evaluated. - -The frequency with which to update Jacobian information can be controlled -with the *msbj* argument to :c:func:`MRIStepSetJacEvalFrequency()`. -We note that this is only checked *within* calls to the linear solver setup -routine, so values *msbj* :math:`<` *msbp* do not make sense. For -linear-solvers with user-supplied preconditioning the above factors are used -to determine whether to recommend updating the Jacobian information in the -preconditioner (i.e., whether to set *jok* to ``SUNFALSE`` in calling the -user-supplied :c:type:`ARKLsPrecSetupFn()`). For matrix-based linear solvers -these factors determine whether the matrix :math:`J(t,y) = \frac{\partial f^I(t,y)}{\partial y}` -should be updated (either with an internal finite difference approximation or -a call to the user-supplied :c:type:`ARKLsJacFn`); if not then the previous -value is reused and the system matrix :math:`{\mathcal A}(t,y) \approx I - \gamma J(t,y)` -is recomputed using the current :math:`\gamma` value. - - - -.. cssclass:: table-bordered - -============================================= ========================================= ============ -Optional input Function name Default -============================================= ========================================= ============ -Max change in step signaling new :math:`J` :c:func:`MRIStepSetDeltaGammaMax()` 0.2 -Linear solver setup frequency :c:func:`MRIStepSetLSetupFrequency()` 20 -Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequency()` 51 -============================================= ========================================= ============ - - .. c:function:: int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) Specifies a scaled step size ratio tolerance, beyond which the @@ -1577,9 +1211,11 @@ Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequen **Notes:** Any non-positive parameter will imply a reset to the default value. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDeltaGammaMax` instead. + -.. index:: - single: optional input; linear solver setup frequency (MRIStep) .. c:function:: int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) @@ -1601,10 +1237,11 @@ Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequen step. If **msbp** is 0, the default value of 20 will be used. A negative value forces a linear solver step at each implicit stage. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLSetupFrequency` instead. + -.. index:: - single: optional input; Jacobian update frequency (MRIStep) - single: optional input; preconditioner update frequency (MRIStep) .. c:function:: int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj) @@ -1633,8 +1270,9 @@ Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequen This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + .. deprecated:: x.y.z - + Use :c:func:`ARKodeSetJacEvalFrequency` instead. @@ -1644,48 +1282,6 @@ Jacobian / preconditioner update frequency :c:func:`MRIStepSetJacEvalFrequen Optional inputs for matrix-based ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -========================================= =========================================== ============= -Optional input Function name Default -========================================= =========================================== ============= -Jacobian function :c:func:`MRIStepSetJacFn()` ``DQ`` -Linear system function :c:func:`MRIStepSetLinSysFn()` internal -Enable or disable linear solution scaling :c:func:`MRIStepSetLinearSolutionScaling()` on -========================================= =========================================== ============= - -When using matrix-based linear solver modules, the ARKLS solver interface needs -a function to compute an approximation to the Jacobian matrix :math:`J(t,y)` or -the linear system :math:`I - \gamma J`. The function to evaluate the Jacobian -must be of type :c:func:`ARKLsJacFn()`. The user can supply a custom Jacobian -function, or if using a dense or banded :math:`J` can use the default internal -difference quotient approximation that comes with the ARKLS interface. At -present, we do not supply a corresponding routine to approximate Jacobian -entries in sparse matrices :math:`J`. To specify a user-supplied Jacobian -function *jac*, MRIStep provides the function :c:func:`MRIStepSetJacFn()`. -Alternatively, a function of type :c:func:`ARKLsLinSysFn()` can be provided to -evaluate the matrix :math:`I - \gamma J`. By default, ARKLS uses an -internal linear system function leveraging the SUNMATRIX API to form the matrix -:math:`I - \gamma J`. To specify a user-supplied linear system function -*linsys*, MRIStep provides the function :c:func:`MRIStepSetLinSysFn()`. In -either case the matrix information will be updated infrequently to reduce matrix -construction and, with direct solvers, factorization costs. As a result the -value of :math:`\gamma` may not be current and a scaling factor is applied to the -solution of the linear system to account for lagged value of :math:`\gamma`. See -:numref:`SUNLinSol.Lagged_matrix` for more details. The function -:c:func:`MRIStepSetLinearSolutionScaling()` can be used to disable this scaling -when necessary, e.g., when providing a custom linear solver that updates the -matrix using the current :math:`\gamma` as part of the solve. - -The ARKLS interface passes the user data pointer to the Jacobian and linear -system functions. This allows the user to create an arbitrary structure with -relevant problem data and access it during the execution of the user-supplied -Jacobian or linear system functions, without using global data in the -program. The user data pointer may be specified through -:c:func:`MRIStepSetUserData()`. - - - .. c:function:: int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) Specifies the Jacobian approximation routine to @@ -1712,6 +1308,11 @@ program. The user data pointer may be specified through The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetJacFn` instead. + + .. c:function:: int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) @@ -1738,6 +1339,11 @@ program. The user data pointer may be specified through The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinSysFn` instead. + + .. c:function:: int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) @@ -1758,47 +1364,17 @@ program. The user data pointer may be specified through **Notes:** Linear solution scaling is enabled by default when a matrix-based linear solver is attached. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLinearSolutionScaling` instead. + + .. _ARKODE.Usage.MRIStep.ARKLsInputs.MatrixFree: Optional inputs for matrix-free ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -================================================== ========================================= ================== -Optional input Function name Default -================================================== ========================================= ================== -:math:`Jv` functions (*jtimes* and *jtsetup*) :c:func:`MRIStepSetJacTimes()` DQ, none -:math:`Jv` DQ rhs function (*jtimesRhsFn*) :c:func:`MRIStepSetJacTimesRhsFn()` fs -================================================== ========================================= ================== - - -As described in :numref:`ARKODE.Mathematics.Linear`, when solving -the Newton linear systems with matrix-free methods, the ARKLS -interface requires a *jtimes* function to compute an approximation to -the product between the Jacobian matrix -:math:`J(t,y)` and a vector :math:`v`. The user can supply a custom -Jacobian-times-vector approximation function, or use the default -internal difference quotient function that comes with the ARKLS -interface. - -A user-defined Jacobian-vector function must be of type -:c:type:`ARKLsJacTimesVecFn` and can be specified through a call -to :c:func:`MRIStepSetJacTimes()` (see -:numref:`ARKODE.Usage.UserSupplied` for specification details). As with the -user-supplied preconditioner functions, the evaluation and -processing of any Jacobian-related data needed by the user's -Jacobian-times-vector function is done in the optional user-supplied -function of type :c:type:`ARKLsJacTimesSetupFn` (see -:numref:`ARKODE.Usage.UserSupplied` for specification details). As with -the preconditioner functions, a pointer to the user-defined -data structure, *user_data*, specified through -:c:func:`MRIStepSetUserData()` (or a ``NULL`` pointer otherwise) is -passed to the Jacobian-times-vector setup and product functions each -time they are called. - - .. c:function:: int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, ARKLsJacTimesVecFn jtimes) Specifies the Jacobian-times-vector setup and product functions. @@ -1831,15 +1407,9 @@ time they are called. :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z -When using the internal difference quotient the user may optionally supply -an alternative implicit right-hand side function for use in the Jacobian-vector -product approximation by calling :c:func:`MRIStepSetJacTimesRhsFn()`. The -alternative implicit right-hand side function should compute a suitable (and -differentiable) approximation to the :math:`f^I` function provided to -:c:func:`MRIStepCreate()`. For example, as done in :cite:p:`dorr2010numerical`, the alternative -function may use lagged values when evaluating a nonlinearity in :math:`f^I` to -avoid differencing a potentially non-differentiable factor. + Use :c:func:`ARKodeSetJacTimes` instead. .. c:function:: int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) @@ -1865,6 +1435,10 @@ avoid differencing a potentially non-differentiable factor. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetJacTimesRhsFn` instead. + @@ -1874,44 +1448,6 @@ avoid differencing a potentially non-differentiable factor. Optional inputs for iterative ``SUNLinearSolver`` modules """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. cssclass:: table-bordered - -=============================================== ========================================= ================== -Optional input Function name Default -=============================================== ========================================= ================== -Newton preconditioning functions :c:func:`MRIStepSetPreconditioner()` ``NULL``, ``NULL`` -Newton linear and nonlinear tolerance ratio :c:func:`MRIStepSetEpsLin()` 0.05 -Newton linear solve tolerance conversion factor :c:func:`MRIStepSetLSNormFactor()` vector length -=============================================== ========================================= ================== - - -As described in :numref:`ARKODE.Mathematics.Linear`, when using -an iterative linear solver the user may supply a preconditioning -operator to aid in solution of the system. This operator consists of -two user-supplied functions, *psetup* and *psolve*, that are supplied -to MRIStep using the function :c:func:`MRIStepSetPreconditioner()`. -The *psetup* function supplied to these routines -should handle evaluation and preprocessing of any Jacobian data -needed by the user's preconditioner solve function, -*psolve*. The user data pointer received through -:c:func:`MRIStepSetUserData()` (or a pointer to ``NULL`` if user data -was not specified) is passed to the *psetup* and *psolve* functions. -This allows the user to create an arbitrary -structure with relevant problem data and access it during the -execution of the user-supplied preconditioner functions without using -global data in the program. - -Also, as described in :numref:`ARKODE.Mathematics.Error.Linear`, the -ARKLS interface requires that iterative linear solvers stop when -the norm of the preconditioned residual satisfies - -.. math:: - \|r\| \le \frac{\epsilon_L \epsilon}{10} - -where the default :math:`\epsilon_L = 0.05`, which may be modified by -the user through the :c:func:`MRIStepSetEpsLin()` function. - - .. c:function:: int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) Specifies the user-supplied preconditioner setup and solve functions. @@ -1942,6 +1478,11 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetPreconditioner` instead. + + .. c:function:: int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -1966,6 +1507,11 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetEpsLin` instead. + + .. c:function:: int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -1994,6 +1540,10 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetLSNormFactor` instead. + .. _ARKODE.Usage.MRIStep.MRIStepRootfindingInput: @@ -2001,22 +1551,6 @@ the user through the :c:func:`MRIStepSetEpsLin()` function. Rootfinding optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following functions can be called to set optional inputs to -control the rootfinding algorithm, the mathematics of which are -described in the section :numref:`ARKODE.Mathematics.Rootfinding`. - - -.. cssclass:: table-bordered - -====================================== ======================================== ================== -Optional input Function name Default -====================================== ======================================== ================== -Direction of zero-crossings to monitor :c:func:`MRIStepSetRootDirection()` both -Disable inactive root warnings :c:func:`MRIStepSetNoInactiveRootWarn()` enabled -====================================== ======================================== ================== - - - .. c:function:: int MRIStepSetRootDirection(void* arkode_mem, int* rootdir) Specifies the direction of zero-crossings to be located and returned. @@ -2038,6 +1572,10 @@ Disable inactive root warnings :c:func:`MRIStepSetNoInactiveRootWarn()` **Notes:** The default behavior is to monitor for both zero-crossing directions. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRootDirection` instead. + .. c:function:: int MRIStepSetNoInactiveRootWarn(void* arkode_mem) @@ -2060,6 +1598,10 @@ Disable inactive root warnings :c:func:`MRIStepSetNoInactiveRootWarn()` first step), MRIStep will issue a warning which can be disabled with this optional input function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. + .. _ARKODE.Usage.MRIStep.InterpolatedOutput: @@ -2067,20 +1609,6 @@ Disable inactive root warnings :c:func:`MRIStepSetNoInactiveRootWarn()` Interpolated output function -------------------------------- -An optional function :c:func:`MRIStepGetDky()` is available to obtain -additional values of solution-related quantities. This function -should only be called after a successful return from -:c:func:`MRIStepEvolve()`, as it provides interpolated values either of -:math:`y` or of its derivatives (up to the 3rd derivative) -interpolated to any value of :math:`t` in the last internal step taken -by :c:func:`MRIStepEvolve()`. Internally, this "dense output" or -"continuous extension" algorithm is identical to the algorithm used for -the maximum order implicit predictors, described in -:numref:`ARKODE.Mathematics.Predictors.Max`, except that derivatives of the -polynomial model may be evaluated upon request. - - - .. c:function:: int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function @@ -2126,6 +1654,10 @@ polynomial model may be evaluated upon request. functions :c:func:`MRIStepGetCurrentTime()` and :c:func:`MRIStepGetLastStep()`, respectively. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetDky` instead. + .. _ARKODE.Usage.MRIStep.OptionalOutputs: @@ -2133,57 +1665,6 @@ polynomial model may be evaluated upon request. Optional output functions ------------------------------ -MRIStep provides an extensive set of functions that can be used to -obtain solver performance information. We organize these into groups: - -#. General MRIStep output routines are in - :numref:`ARKODE.Usage.MRIStep.MRIStepMainOutputs`, - -#. MRIStep implicit solver output routines are in - :numref:`ARKODE.Usage.MRIStep.MRIStepImplicitSolverOutputs`, - -#. Linear solver output routines are in - :numref:`ARKODE.Usage.MRIStep.ARKLsOutputs` and - -#. General usability routines (e.g. to print the current MRIStep - parameters, or output the current coupling table) are in - :numref:`ARKODE.Usage.MRIStep.MRIStepExtraOutputs`. - -#. Output routines regarding root-finding results are in - :numref:`ARKODE.Usage.MRIStep.MRIStepRootOutputs`, - -Following each table, we elaborate on each function. - -Some of the optional outputs, especially the various counters, can be -very useful in determining the efficiency of various methods inside -MRIStep. For example: - -* The number of steps and right-hand side evaluations at both the slow and fast - time scales provide a rough measure of the overall cost of a given run, and can - be compared between runs with different solver options to suggest which set of - options is the most efficient. - -* The ratio *nniters/nsteps* measures the performance of the - nonlinear iteration in solving the nonlinear systems at each implicit stage, - providing a measure of the degree of nonlinearity in the problem. - Typical values of this for a Newton solver on a general problem - range from 1.1 to 1.8. - -* When using a Newton nonlinear solver, the ratio *njevals/nniters* - (when using a direct linear solver), and the ratio - *nliters/nniters* (when using an iterative linear solver) can - indicate the quality of the approximate Jacobian or preconditioner being - used. For example, if this ratio is larger for a user-supplied - Jacobian or Jacobian-vector product routine than for the - difference-quotient routine, it can indicate that the user-supplied - Jacobian is inaccurate. - -It is therefore recommended that users retrieve and output these -statistics following each run, and take some time to investigate -alternate solver options that will be more optimal for their -particular problem of interest. - - .. _ARKODE.Usage.MRIStep.MRIStepMainOutputs: @@ -2191,56 +1672,6 @@ Main solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.MRIStep.MRIStepMainOutputs.Table: -.. table:: Main solver optional output functions - - +------------------------------------------------------+-------------------------------------------+ - | Optional output | Function name | - +------------------------------------------------------+-------------------------------------------+ - | Size of MRIStep real and integer workspaces | :c:func:`MRIStepGetWorkSpace()` | - +------------------------------------------------------+-------------------------------------------+ - | Cumulative number of internal steps | :c:func:`MRIStepGetNumSteps()` | - +------------------------------------------------------+-------------------------------------------+ - | Step size used for the last successful step | :c:func:`MRIStepGetLastStep()` | - +------------------------------------------------------+-------------------------------------------+ - | Current internal time reached by the solver | :c:func:`MRIStepGetCurrentTime()` | - +------------------------------------------------------+-------------------------------------------+ - | Current internal solution reached by the solver | :c:func:`MRIStepGetCurrentState()` | - +------------------------------------------------------+-------------------------------------------+ - | Current :math:`\gamma` value used by the solver | :c:func:`MRIStepGetCurrentGamma()` | - +------------------------------------------------------+-------------------------------------------+ - | Error weight vector for state variables | :c:func:`MRIStepGetErrWeights()` | - +------------------------------------------------------+-------------------------------------------+ - | Suggested factor for tolerance scaling | :c:func:`MRIStepGetTolScaleFactor()` | - +------------------------------------------------------+-------------------------------------------+ - | Print all statistics | :c:func:`MRIStepPrintAllStats` | - +------------------------------------------------------+-------------------------------------------+ - | Name of constant associated with a return flag | :c:func:`MRIStepGetReturnFlagName()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of calls to the :math:`f^E` and :math:`f^I` | :c:func:`MRIStepGetNumRhsEvals()` | - +------------------------------------------------------+-------------------------------------------+ - | No. of failed steps due to a nonlinear solver | :c:func:`MRIStepGetNumStepSolveFails()` | - | failure | | - +------------------------------------------------------+-------------------------------------------+ - | Current MRI coupling tables | :c:func:`MRIStepGetCurrentCoupling()` | - +------------------------------------------------------+-------------------------------------------+ - | Last inner stepper return value | :c:func:`MRIStepGetLastInnerStepFlag()` | - +------------------------------------------------------+-------------------------------------------+ - | Retrieve a pointer for user data | :c:func:`MRIStepGetUserData` | - +------------------------------------------------------+-------------------------------------------+ - -.. Functions not currently provided by MRIStep -.. No. of explicit stability-limited steps :c:func:`MRIStepGetNumExpSteps()` -.. No. of accuracy-limited steps :c:func:`MRIStepGetNumAccSteps()` -.. No. of attempted steps :c:func:`MRIStepGetNumStepAttempts()` -.. No. of local error test failures that have occurred :c:func:`MRIStepGetNumErrTestFails()` -.. Estimated local truncation error vector :c:func:`MRIStepGetEstLocalErrors()` -.. Single accessor to many statistics at once :c:func:`MRIStepGetTimestepperStats()` -.. Actual initial time step size used :c:func:`MRIStepGetActualInitStep()` -.. Step size to be attempted on the next step :c:func:`MRIStepGetCurrentStep()` -.. Single accessor to many statistics at once :c:func:`MRIStepGetStepStats()` - - .. c:function:: int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) Returns the MRIStep real and integer workspace sizes. @@ -2259,6 +1690,11 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetWorkSpace` instead. + + .. c:function:: int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps, long int* nfsteps) @@ -2279,23 +1715,10 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z -.. - .. c:function:: int MRIStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) - - Returns the value of the integration step size used on the first step. - - **Arguments:** + Use :c:func:`ARKodeGetNumSteps` instead. - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hinused* -- actual value of initial step size. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` .. c:function:: int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -2315,23 +1738,10 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z -.. - .. c:function:: int MRIStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) + Use :c:func:`ARKodeGetLastStep` instead. - Returns the integration step size to be attempted on the next internal step. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hcur* -- step size to be attempted on the next internal step. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` .. c:function:: int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -2350,6 +1760,10 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentTime` instead. + .. c:function:: int MRIStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -2371,6 +1785,10 @@ Main solver optional output functions as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentState` instead. + .. c:function:: int MRIStepGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) @@ -2389,6 +1807,9 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentGamma` instead. .. c:function:: int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -2409,6 +1830,10 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetTolScaleFactor` instead. + .. c:function:: int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -2429,29 +1854,9 @@ Main solver optional output functions **Notes:** The user must allocate space for *eweight*, that will be filled in by this function. + .. deprecated:: x.y.z -.. - .. c:function:: int MRIStepGetStepStats(void* arkode_mem, long int* nssteps, long int* nfsteps, sunrealtype* hlast, sunrealtype* tcur) - - Returns many of the most useful optional outputs in a single call. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *nssteps* -- number of slow steps taken in the solver. - - * *nfsteps* -- number of fast steps taken in the solver. - - * *hlast* -- step size taken on the last internal step. - - * *tcur* -- current internal time reached. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + Use :c:func:`ARKodeGetErrWeights` instead. .. c:function:: int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -2481,8 +1886,12 @@ Main solver optional output functions .. versionadded:: 5.2.0 + .. deprecated:: x.y.z + + Use :c:func:`ARKodePrintAllStats` instead. -.. c:function:: char *MRIStepGetReturnFlagName(long int flag) + +.. c:function:: char* MRIStepGetReturnFlagName(long int flag) Returns the name of the MRIStep constant corresponding to *flag*. See :ref:`ARKODE.Constants`. @@ -2495,62 +1904,11 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. + .. deprecated:: x.y.z -.. - .. c:function:: int MRIStepGetNumExpSteps(void* arkode_mem, long int* expsteps) - - Returns the cumulative number of stability-limited steps - taken by the solver (so far). - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *expsteps* -- number of stability-limited steps taken in the solver. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - -.. - .. c:function:: int MRIStepGetNumAccSteps(void* arkode_mem, long int* accsteps) - - Returns the cumulative number of accuracy-limited steps - taken by the solver (so far). - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *accsteps* -- number of accuracy-limited steps taken in the solver. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + Use :c:func:`ARKodeGetReturnFlagName` instead. -.. - .. c:function:: int MRIStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) - - Returns the cumulative number of steps attempted by the solver (so far). - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *step_attempts* -- number of steps attempted by solver. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. c:function:: int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, long int* nfsi_evals) @@ -2572,24 +1930,6 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` -.. - .. c:function:: int MRIStepGetNumErrTestFails(void* arkode_mem, long int* netfails) - - Returns the number of local error test failures that - have occurred (so far). - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *netfails* -- number of error test failures. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. c:function:: int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* ncnf) @@ -2607,6 +1947,10 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumStepSolveFails` instead. + .. c:function:: int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling *C) @@ -2645,65 +1989,6 @@ Main solver optional output functions For more details see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. -.. - .. c:function:: int MRIStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) - - Returns the vector of estimated local truncation errors - for the current step. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *ele* -- vector of estimated local truncation errors. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - **Notes:** The user must allocate space for *ele*, that will be - filled in by this function. - - The values returned in *ele* are valid only after a successful call - to :c:func:`MRIStepEvolve()` (i.e., it returned a non-negative value). - - The *ele* vector, together with the *eweight* vector from - :c:func:`MRIStepGetErrWeights()`, can be used to determine how the - various components of the system contributed to the estimated local - error test. Specifically, that error test uses the WRMS norm of a - vector whose components are the products of the components of these - two vectors. Thus, for example, if there were recent error test - failures, the components causing the failures are those with largest - values for the products, denoted loosely as ``eweight[i]*ele[i]``. - - -.. - .. c:function:: int MRIStepGetTimestepperStats(void* arkode_mem, long int* expsteps, long int* accsteps, long int* step_attempts, long int* nf_evals, long int* netfails) - - Returns many of the most useful time-stepper statistics in a single call. - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *expsteps* -- number of stability-limited steps taken in the solver. - - * *accsteps* -- number of accuracy-limited steps taken in the solver. - - * *step_attempts* -- number of steps attempted by the solver. - - * *nf_evals* -- number of calls to the user's :math:`f(t,y)` function. - - * *netfails* -- number of error test failures. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. c:function:: int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) Returns the last return value from the inner stepper. @@ -2720,6 +2005,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. c:function:: int MRIStepGetUserData(void* arkode_mem, void** user_data) Returns the user data pointer previously set with @@ -2739,29 +2025,16 @@ Main solver optional output functions .. versionadded:: 5.3.0 + .. deprecated:: x.y.z -.. _ARKODE.Usage.MRIStep.MRIStepImplicitSolverOutputs: + Use :c:func:`ARKodeGetUserData` instead. -Implicit solver optional output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. _ARKODE.Usage.MRIStep.MRIStepImplicitSolverOutputs.Table: -.. table:: Implicit solver optional output functions - - +------------------------------------------------------+----------------------------------------------+ - | Optional output | Function name | - +------------------------------------------------------+----------------------------------------------+ - | No. of calls to linear solver setup function | :c:func:`MRIStepGetNumLinSolvSetups()` | - +------------------------------------------------------+----------------------------------------------+ - | No. of nonlinear solver iterations | :c:func:`MRIStepGetNumNonlinSolvIters()` | - +------------------------------------------------------+----------------------------------------------+ - | No. of nonlinear solver convergence failures | :c:func:`MRIStepGetNumNonlinSolvConvFails()` | - +------------------------------------------------------+----------------------------------------------+ - | Single accessor to all nonlinear solver statistics | :c:func:`MRIStepGetNonlinSolvStats()` | - +------------------------------------------------------+----------------------------------------------+ +.. _ARKODE.Usage.MRIStep.MRIStepImplicitSolverOutputs: +Implicit solver optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. c:function:: int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) @@ -2784,6 +2057,10 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinSolvSetups` instead. + .. c:function:: int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) @@ -2807,6 +2084,10 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. + .. c:function:: int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) @@ -2830,6 +2111,10 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. + .. c:function:: int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) @@ -2856,6 +2141,10 @@ Implicit solver optional output functions nonlinear solver object; the counters are reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinSolvStats` instead. + .. _ARKODE.Usage.MRIStep.MRIStepRootOutputs: @@ -2863,17 +2152,6 @@ Implicit solver optional output functions Rootfinding optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. cssclass:: table-bordered - -=================================================== ========================================== -Optional output Function name -=================================================== ========================================== -Array showing roots found :c:func:`MRIStepGetRootInfo()` -No. of calls to user root function :c:func:`MRIStepGetNumGEvals()` -=================================================== ========================================== - - - .. c:function:: int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound) Returns an array showing which functions were found to @@ -2900,6 +2178,10 @@ No. of calls to user root function :c:func:`MRIStepGetNumGEval zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetRootInfo` instead. + .. c:function:: int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -2915,6 +2197,10 @@ No. of calls to user root function :c:func:`MRIStepGetNumGEval * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumGEvals` instead. + .. _ARKODE.Usage.MRIStep.ARKLsOutputs: @@ -2922,48 +2208,6 @@ No. of calls to user root function :c:func:`MRIStepGetNumGEval Linear solver interface optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -A variety of optional outputs are available from the ARKLS interface, as -listed in the following table and elaborated below. We note that where the -name of an output would otherwise conflict with the -name of an optional output from the main solver, a suffix LS (for -Linear Solver) has been added here (e.g. *lenrwLS*). - - -.. _ARKODE.Usage.MRIStep.ARKLsOutputs.Table: -.. table:: Linear solver interface optional output functions - - +--------------------------------------------------------------------+------------------------------------------+ - | Optional output | Function name | - +--------------------------------------------------------------------+------------------------------------------+ - | Stored Jacobian of the ODE RHS function | :c:func:`MRIStepGetJac` | - +--------------------------------------------------------------------+------------------------------------------+ - | Time at which the Jacobian was evaluated | :c:func:`MRIStepGetJacTime` | - +--------------------------------------------------------------------+------------------------------------------+ - | Step number at which the Jacobian was evaluated | :c:func:`MRIStepGetJacNumSteps` | - +--------------------------------------------------------------------+------------------------------------------+ - | Size of real and integer workspaces | :c:func:`MRIStepGetLinWorkSpace()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of Jacobian evaluations | :c:func:`MRIStepGetNumJacEvals()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of preconditioner evaluations | :c:func:`MRIStepGetNumPrecEvals()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of preconditioner solves | :c:func:`MRIStepGetNumPrecSolves()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of linear iterations | :c:func:`MRIStepGetNumLinIters()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of linear convergence failures | :c:func:`MRIStepGetNumLinConvFails()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of Jacobian-vector setup evaluations | :c:func:`MRIStepGetNumJTSetupEvals()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of Jacobian-vector product evaluations | :c:func:`MRIStepGetNumJtimesEvals()` | - +--------------------------------------------------------------------+------------------------------------------+ - | No. of *fs* calls for finite diff. :math:`J` or :math:`Jv` evals. | :c:func:`MRIStepGetNumLinRhsEvals()` | - +--------------------------------------------------------------------+------------------------------------------+ - | Last return from a linear solver function | :c:func:`MRIStepGetLastLinFlag()` | - +--------------------------------------------------------------------+------------------------------------------+ - | Name of constant associated with a return flag | :c:func:`MRIStepGetLinReturnFlagName()` | - +--------------------------------------------------------------------+------------------------------------------+ - .. c:function:: int MRIStepGetJac(void* arkode_mem, SUNMatrix* J) Returns the internally stored copy of the Jacobian matrix of the ODE @@ -2981,6 +2225,11 @@ Linear Solver) has been added here (e.g. *lenrwLS*). This function is provided for debugging purposes and the values in the returned matrix should not be altered. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJac` instead. + + .. c:function:: int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J) Returns the time at which the internally stored copy of the Jacobian matrix @@ -2993,6 +2242,11 @@ Linear Solver) has been added here (e.g. *lenrwLS*). :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJacTime` instead. + + .. c:function:: int MRIStepGetJacNumSteps(void* arkode_mem, long int* nst_J) Returns the value of the internal step counter at which the internally stored copy of the @@ -3006,6 +2260,11 @@ Linear Solver) has been added here (e.g. *lenrwLS*). :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetJacNumSteps` instead. + + .. c:function:: int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) Returns the real and integer workspace used by the ARKLS linear solver interface. @@ -3035,6 +2294,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). In a parallel setting, the above values are global (i.e., summed over all processors). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLinWorkSpace` instead. + .. c:function:: int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) @@ -3058,6 +2321,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJacEvals` instead. + .. c:function:: int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) @@ -3083,6 +2350,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumPrecEvals` instead. + .. c:function:: int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) @@ -3107,6 +2378,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumPrecSolves` instead. + .. c:function:: int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) @@ -3130,6 +2405,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinIters` instead. + .. c:function:: int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) @@ -3153,6 +2432,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinConvFails` instead. + .. c:function:: int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) @@ -3177,6 +2460,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJTSetupEvals` instead. + .. c:function:: int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) @@ -3201,6 +2488,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumJtimesEvals` instead. + .. c:function:: int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) @@ -3230,6 +2521,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumLinRhsEvals` instead. + .. c:function:: int MRIStepGetLastLinFlag(void* arkode_mem, long int* lsflag) @@ -3285,8 +2580,12 @@ Linear Solver) has been added here (e.g. *lenrwLS*). *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLastLinFlag` instead. -.. c:function:: char *MRIStepGetLinReturnFlagName(long int lsflag) + +.. c:function:: char* MRIStepGetLinReturnFlagName(long int lsflag) Returns the name of the ARKLS constant corresponding to *lsflag*. @@ -3299,6 +2598,10 @@ Linear Solver) has been added here (e.g. *lenrwLS*). ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` :math:`\le n` (LU factorization failed), this routine returns "NONE". + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLinReturnFlagName` instead. + @@ -3307,25 +2610,6 @@ Linear Solver) has been added here (e.g. *lenrwLS*). General usability functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following optional routines may be called by a user to inquire -about existing solver parameters or write the current MRI coupling table. While -neither of these would typically be called during the course of solving an -initial value problem, these may be useful for users wishing to better -understand MRIStep. - - -.. _ARKODE.Usage.MRIStep.MRIStepExtraOutputs.Table: -.. table:: General usability functions - - +-----------------------------------------------+-------------------------------------------+ - | Optional routine | Function name | - +-----------------------------------------------+-------------------------------------------+ - | Output all MRIStep solver parameters | :c:func:`MRIStepWriteParameters()` | - +-----------------------------------------------+-------------------------------------------+ - | Output the current MRI coupling table | :c:func:`MRIStepWriteCoupling()` | - +-----------------------------------------------+-------------------------------------------+ - - .. c:function:: int MRIStepWriteParameters(void* arkode_mem, FILE *fp) Outputs all MRIStep solver parameters to the provided file pointer. @@ -3349,6 +2633,10 @@ understand MRIStep. for this pointer, since parameters for all processes would be identical. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeWriteParameters` instead. + .. c:function:: int MRIStepWriteCoupling(void* arkode_mem, FILE *fp) @@ -3373,6 +2661,10 @@ understand MRIStep. for this pointer, since tables for all processes would be identical. + .. deprecated:: x.y.z + + Use :c:func:`MRIStepGetCurrentCoupling` and :c:func:`MRIStepCoupling_Write` + instead. .. _ARKODE.Usage.MRIStep.Reinitialization: @@ -3467,47 +2759,6 @@ vector. MRIStep reset function ---------------------- -To reset the MRIStep module to a particular state :math:`(t_R,y(t_R))` for the -continued solution of a problem, where a prior -call to :c:func:`MRIStepCreate()` has been made, the user must call the function -:c:func:`MRIStepReset()`. Like :c:func:`MRIStepReInit()` this routine retains -the current settings for all MRIStep module options and performs no memory -allocations but, unlike :c:func:`MRIStepReInit()`, this routine performs only a -*subset* of the input checking and initializations that are done in -:c:func:`MRIStepCreate()`. In particular this routine retains all internal -counter values and the step size/error history and does not reinitialize the -linear and/or nonlinear solver but it does indicate that a linear solver setup -is necessary in the next step. Like :c:func:`MRIStepReInit()`, a call to -:c:func:`MRIStepReset()` will delete any previously-set *tstop* value specified -via a call to :c:func:`MRIStepSetStopTime()`. Following a successful call to -:c:func:`MRIStepReset()`, call :c:func:`MRIStepEvolve()` again to continue -solving the problem. By default the next call to :c:func:`MRIStepEvolve()` will -use the step size computed by MRIStep prior to calling :c:func:`MRIStepReset()`. -To set a different step size use :c:func:`MRIStepSetFixedStep`. - -.. - To set a different step size or have MRIStep estimate a new step size use - :c:func:`MRIStepSetInitStep()`. - -One important use of the :c:func:`MRIStepReset()` function is in the -treating of jump discontinuities in the RHS functions. Except in cases -of fairly small jumps, it is usually more efficient to stop at each -point of discontinuity and restart the integrator with a readjusted -ODE model, using a call to :c:func:`MRIStepReset()`. To stop when -the location of the discontinuity is known, simply make that location -a value of ``tout``. To stop when the location of the discontinuity -is determined by the solution, use the rootfinding feature. In either -case, it is critical that the RHS functions *not* incorporate the -discontinuity, but rather have a smooth extension over the -discontinuity, so that the step across it (and subsequent rootfinding, -if used) can be done efficiently. Then use a switch within the RHS -functions (communicated through ``user_data``) that can be flipped -between the stopping of the integration and the restart, so that the -restarted problem uses the new values (which have jumped). Similar -comments apply if there is to be a jump in the dependent variable -vector. - - .. c:function:: int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current MRIStep outer (slow) time-stepper module state to the @@ -3547,6 +2798,10 @@ vector. (*tR*, *yR*) arguments for the :c:type:`MRIStepInnerStepper` object that is used to evolve the MRI "fast" time scale subproblems. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeReset` instead. + .. _ARKODE.Usage.MRIStep.Resizing: @@ -3554,22 +2809,6 @@ vector. MRIStep system resize function ------------------------------------- -For simulations involving changes to the number of equations and -unknowns in the ODE system (e.g. when using spatially-adaptive -PDE simulations under a method-of-lines approach), the MRIStep -integrator may be "resized" between *slow* integration steps, through calls -to the :c:func:`MRIStepResize()` function. This function modifies -MRIStep's internal memory structures to use the new problem size. - -To aid in the vector resize operation, the user can supply a vector -resize function that will take as input a vector with the previous -size, and transform it in-place to return a corresponding vector of -the new size. If this function (of type :c:func:`ARKVecResizeFn()`) -is not supplied (i.e., is set to ``NULL``), then all existing vectors -internal to MRIStep will be destroyed and re-cloned from the new input -vector. - - .. c:function:: int MRIStepResize(void* arkode_mem, N_Vector yR, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) Re-initializes MRIStep with a different state vector. @@ -3636,3 +2875,7 @@ vector. For an example showing usage of the similar :c:func:`ARKStepResize()` routine, see the supplied serial C example problem, ``ark_heat1D_adapt.c``. + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeResize` instead. diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst index d22e91746f..a1d91c144b 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst @@ -19,23 +19,11 @@ Using the MRIStep time-stepping module ========================================== -This chapter is concerned with the use of the MRIStep time-stepping module for -the solution of multirate initial value problems (IVPs) of the form -:eq:`ARKODE_IVP_two_rate` 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 MRIStep user-callable functions and user-supplied functions. - -The example programs located in the source code ``examples/arkode`` -folder, including those described in the companion document :cite:p:`arkode_ex`, -may be helpful as templates for new codes. - -MRIStep 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 provided separately in -:numref:`ARKODE.Constants`. - -The relevant information on using MRIStep's C and C++ interfaces is -detailed in the following subsections. +This section is concerned with the use of the MRIStep time-stepping +module for the solution of initial value problems (IVPs) in a C or C++ +language setting. Usage of MRIStep follows that of the rest of ARKODE, +and so in this section we primarily focus on those usage aspects that +are specific to MRIStep. .. toctree:: :maxdepth: 1 diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst b/doc/arkode/guide/source/Usage/Preconditioners.rst similarity index 61% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst rename to doc/arkode/guide/source/Usage/Preconditioners.rst index d772f5ad4a..62bdb966b0 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Preconditioners.rst +++ b/doc/arkode/guide/source/Usage/Preconditioners.rst @@ -12,7 +12,7 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -.. _ARKODE.Usage.ARKStep.PreconditionerModules: +.. _ARKODE.Usage.PreconditionerModules: Preconditioner modules ============================ @@ -20,13 +20,12 @@ Preconditioner modules The efficiency of Krylov iterative methods for the solution of linear systems can be greatly enhanced through preconditioning. For problems in which the user cannot define a more effective, problem-specific -preconditioner, ARKODE provides two internal preconditioner modules -that may be used by ARKStep: a banded preconditioner for serial and -threaded problems (ARKBANDPRE) and a band-block-diagonal -preconditioner for parallel problems (ARKBBDPRE). +preconditioner, ARKODE provides two internal preconditioner modules: +a banded preconditioner for serial and threaded problems (ARKBANDPRE) +and a band-block-diagonal preconditioner for parallel problems (ARKBBDPRE). -.. _ARKODE.Usage.ARKStep.BandPre: +.. _ARKODE.Usage.BandPre: A serial banded preconditioner module ------------------------------------------- @@ -63,66 +62,70 @@ for the integration of the ODE problem (see program must include the header file ``arkode_bandpre.h`` which declares the needed function prototypes. The following is a summary of the usage of this module. Steps that are unchanged from the -skeleton program presented in :numref:`ARKODE.Usage.ARKStep.Skeleton` are +skeleton program presented in :numref:`ARKODE.Usage.Skeleton` are *italicized*. -1. *Initialize multi-threaded environment (if appropriate)* +#. *Initialize multi-threaded environment (if appropriate)* -2. *Set problem dimensions* +#. *Create the SUNDIALS simulation context object.* -3. *Set vector of initial values* +#. *Set problem dimensions* -4. *Create ARKStep object* +#. *Set vector of initial values* -5. *Specify integration tolerances* +#. *Create ARKODE object* -6. Create iterative linear solver object +#. *Specify integration tolerances* + +#. Create iterative linear solver object When creating the iterative linear solver object, specify the type of preconditioning (``SUN_PREC_LEFT`` or ``SUN_PREC_RIGHT``) to use. -7. *Set linear solver optional inputs* +#. *Set linear solver optional inputs* + +#. *Attach linear solver module* -8. *Attach linear solver module* +#. Initialize the ARKBANDPRE preconditioner module -9. Initialize the ARKBANDPRE preconditioner module + Specify the upper and lower half-bandwidths (``mu`` and ``ml``, + respectively) and call - Specify the upper and lower half-bandwidths (``mu`` and ``ml``, - respectively) and call + ``ier = ARKBandPrecInit(arkode_mem, N, mu, ml);`` - ``ier = ARKBandPrecInit(arkode_mem, N, mu, ml);`` + to allocate memory and initialize the internal preconditioner + data. - to allocate memory and initialize the internal preconditioner - data. +#. *Create nonlinear solver object* -10. *Set optional inputs* +#. *Attach nonlinear solver module* - Note that the user should not call - :c:func:`ARKStepSetPreconditioner()` as it will overwrite the - preconditioner setup and solve functions. +#. *Set nonlinear solver optional inputs* -11. *Create nonlinear solver object* +#. *Set optional inputs* -12. *Attach nonlinear solver module* + Note that the user should not call + :c:func:`ARKodeSetPreconditioner()` as it will overwrite the + preconditioner setup and solve functions. -13. *Set nonlinear solver optional inputs* +#. *Specify rootfinding problem* -14. *Specify rootfinding problem* +#. *Advance solution in time* -15. *Advance solution in time* +#. Get optional outputs -16. Get optional outputs + Additional optional outputs associated with ARKBANDPRE are + available by way of the two routines described below, + :c:func:`ARKBandPrecGetWorkSpace()` and + :c:func:`ARKBandPrecGetNumRhsEvals()`. - Additional optional outputs associated with ARKBANDPRE are - available by way of the two routines described below, - :c:func:`ARKBandPrecGetWorkSpace()` and - :c:func:`ARKBandPrecGetNumRhsEvals()`. +#. *Deallocate memory for solution vector* -17. *Deallocate memory for solution vector* +#. *Free solver memory* -18. *Free solver memory* +#. *Free linear solver memory* -19. *Free linear solver memory* +#. *Free nonlinear solver memory* @@ -141,20 +144,19 @@ by calling the following function: Initializes the ARKBANDPRE preconditioner and allocates required (internal) memory for it. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *N* -- problem dimension (size of ODE system). - * *mu* -- upper half-bandwidth of the Jacobian approximation. - * *ml* -- lower half-bandwidth of the Jacobian approximation. + :param arkode_mem: pointer to the ARKODE memory block. + :param N: problem dimension (size of ODE system). + :param mu: upper half-bandwidth of the Jacobian approximation. + :param ml: lower half-bandwidth of the Jacobian approximation. - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_ILL_INPUT* if an input has an illegal value - * *ARKLS_MEM_FAIL* if a memory allocation request failed + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_MEM_FAIL: a memory allocation request failed. + + .. note:: - **Notes:** The banded approximate Jacobian will have nonzero elements only in locations :math:`(i,j)` with *ml* :math:`\le j-i \le` *mu*. @@ -170,26 +172,25 @@ the ARKBANDPRE module: Returns the sizes of the ARKBANDPRE real and integer workspaces. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwLS* -- the number of ``sunrealtype`` values in the - ARKBANDPRE workspace. - * *leniwLS* -- the number of integer values in the ARKBANDPRE workspace. + :param arkode_mem: pointer to the ARKODE memory block. + :param lenrwLS: the number of ``sunrealtype`` values in the + ARKBANDPRE workspace. + :param leniwLS: the number of integer values in the ARKBANDPRE workspace. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_PMEM_NULL: the preconditioner memory was ``NULL``. - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_PMEM_NULL* if the preconditioner memory is ``NULL`` + .. note:: - **Notes:** The workspace requirements reported by this routine correspond only to memory allocated within the ARKBANDPRE module (the banded matrix approximation, banded ``SUNLinearSolver`` object, and temporary vectors). The workspaces referred to here exist in addition to those given by - the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. + the corresponding function :c:func:`ARKodeGetLinWorkSpace()`. @@ -200,30 +201,29 @@ the ARKBANDPRE module: finite-difference banded Jacobian approximation used within the preconditioner setup function. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *nfevalsBP* -- number of calls to :math:`f^I`. + :param arkode_mem: pointer to the ARKODE memory block. + :param nfevalsBP: number of calls to :math:`f^I`. - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_PMEM_NULL* if the preconditioner memory is ``NULL`` + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_PMEM_NULL: the preconditioner memory was ``NULL``. + + .. note:: - **Notes:** The counter *nfevalsBP* is distinct from the counter *nfevalsLS* returned by the corresponding function - :c:func:`ARKStepGetNumLinRhsEvals()` and also from *nfi_evals* returned by - :c:func:`ARKStepGetNumRhsEvals()`. The total number of right-hand - side function evaluations is the sum of all three of these - counters, plus the *nfe_evals* counter for :math:`f^E` calls - returned by :c:func:`ARKStepGetNumRhsEvals()`. + :c:func:`ARKodeGetNumLinRhsEvals()` and also from the number of + evaluations returned by the time-stepping module (e.g., *nfi_evals* + returned by :c:func:`ARKStepGetNumRhsEvals()`). The total number of + right-hand side function evaluations is the sum of all three of these + counters. -.. _ARKODE.Usage.ARKStep.BBDPre: +.. _ARKODE.Usage.BBDPre: A parallel band-block-diagonal preconditioner module --------------------------------------------------------- @@ -242,9 +242,8 @@ preconditioner must be problem-specific. However, we have developed one type of preconditioner that treats a rather broad class of PDE-based problems. It has been successfully -used with CVODE for several realistic, large-scale problems :cite:p:`HiTa:98`. -It is included in a software module within the ARKODE package, and is -accessible within the ARKStep time stepping module. This +used with CVODE for several realistic, large-scale problems :cite:p:`HiTa:98`, +and is included in a software module within the ARKODE package. This preconditioning module works with the parallel vector module NVECTOR_PARALLEL and is usable with any of the Krylov iterative linear solvers through the ARKLS interface. It generates a preconditioner @@ -339,7 +338,7 @@ communication necessary to evaluate the approximate right-hand side :math:`g`. These are in addition to the user-supplied right-hand side function :math:`f^I`. Both functions take as input the same pointer *user_data* that is passed by the user to -:c:func:`ARKStepSetUserData()` and that was passed to the user's +:c:func:`ARKodeSetUserData()` and that was passed to the user's function :math:`f^I`. The user is responsible for providing space (presumably within *user_data*) for components of :math:`y` that are communicated between processes by *cfn*, and that are then used by @@ -352,22 +351,21 @@ communicated between processes by *cfn*, and that are then used by This *gloc* function computes :math:`g(t,y)`. It fills the vector *glocal* as a function of *t* and *y*. - **Arguments:** - * *Nlocal* -- the local vector length. - * *t* -- the value of the independent variable. - * *y* -- the value of the dependent variable vector on this process. - * *glocal* -- the output vector of :math:`g(t,y)` on this process. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter passed to :c:func:`ARKStepSetUserData()`. - - **Return value:** - An *ARKLocalFn* should return 0 if successful, a positive value if - a recoverable error occurred (in which case ARKStep will attempt to - correct), or a negative value if it failed unrecoverably (in which - case the integration is halted and :c:func:`ARKStepEvolve()` will return - *ARK_LSETUP_FAIL*). - - **Notes:** + :param Nlocal: the local vector length. + :param t: the value of the independent variable. + :param y: the value of the dependent variable vector on this process. + :param glocal: the output vector of :math:`g(t,y)` on this process. + :param user_data: a pointer to user data, the same as the + *user_data* parameter passed to :c:func:`ARKodeSetUserData()`. + + :return: An *ARKLocalFn* should return 0 if successful, a positive value if + a recoverable error occurred (in which case ARKODE will attempt to + correct), or a negative value if it failed unrecoverably (in which + case the integration is halted and :c:func:`ARKodeEvolve()` will return + *ARK_LSETUP_FAIL*). + + .. note:: + This function should assume that all inter-process communication of data needed to calculate *glocal* has already been done, and that this data is accessible within user data. @@ -383,21 +381,20 @@ communicated between processes by *cfn*, and that are then used by communication necessary for the execution of the *gloc* function above, using the input vector *y*. - **Arguments:** - * *Nlocal* -- the local vector length. - * *t* -- the value of the independent variable. - * *y* -- the value of the dependent variable vector on this process. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter passed to :c:func:`ARKStepSetUserData()`. - - **Return value:** - An *ARKCommFn* should return 0 if successful, a positive value if a - recoverable error occurred (in which case ARKStep will attempt to - correct), or a negative value if it failed unrecoverably (in which - case the integration is halted and :c:func:`ARKStepEvolve()` will return - *ARK_LSETUP_FAIL*). - - **Notes:** + :param Nlocal: the local vector length. + :param t: the value of the independent variable. + :param y: the value of the dependent variable vector on this process. + :param user_data: a pointer to user data, the same as the + *user_data* parameter passed to :c:func:`ARKodeSetUserData()`. + + :return: An *ARKCommFn* should return 0 if successful, a positive value if a + recoverable error occurred (in which case ARKODE will attempt to + correct), or a negative value if it failed unrecoverably (in which + case the integration is halted and :c:func:`ARKodeEvolve()` will return + *ARK_LSETUP_FAIL*). + + .. note:: + The *cfn* function is expected to save communicated data in space defined within the data structure *user_data*. @@ -422,28 +419,30 @@ ARKBBDPRE module, the user's program must include the header file The following is a summary of the proper usage of this module. Steps that are unchanged from the skeleton program presented in -:numref:`ARKODE.Usage.ARKStep.Skeleton` are *italicized*. +:numref:`ARKODE.Usage.Skeleton` are *italicized*. + +#. *Initialize MPI* -1. *Initialize MPI* +#. *Create the SUNDIALS simulation context object* -2. *Set problem dimensions* +#. *Set problem dimensions* -3. *Set vector of initial values* +#. *Set vector of initial values* -4. *Create ARKStep object* +#. *Create ARKODE object* -5. *Specify integration tolerances* +#. *Specify integration tolerances* -6. Create iterative linear solver object +#. Create iterative linear solver object When creating the iterative linear solver object, specify the type of preconditioning (``SUN_PREC_LEFT`` or ``SUN_PREC_RIGHT``) to use. -7. *Set linear solver optional inputs* +#. *Set linear solver optional inputs* -8. *Attach linear solver module* +#. *Attach linear solver module* -9. Initialize the ARKBBDPRE preconditioner module +#. Initialize the ARKBBDPRE preconditioner module Specify the upper and lower half-bandwidths for computation ``mudq`` and ``mldq``, the upper and lower half-bandwidths for @@ -456,36 +455,38 @@ that are unchanged from the skeleton program presented in two user-supplied functions of type :c:func:`ARKLocalFn()` and :c:func:`ARKCommFn()` described above, respectively. -10. *Set optional inputs* +#. *Create nonlinear solver object* - Note that the user should not call - :c:func:`ARKStepSetPreconditioner()` as it will overwrite the - preconditioner setup and solve functions. +#. *Attach nonlinear solver module* -11. *Create nonlinear solver object* +#. *Set nonlinear solver optional inputs* -12. *Attach nonlinear solver module* +#. *Set optional inputs* -13. *Set nonlinear solver optional inputs* + Note that the user should not call + :c:func:`ARKodeSetPreconditioner()` as it will overwrite the + preconditioner setup and solve functions. -14. *Specify rootfinding problem* +#. *Specify rootfinding problem* -15. *Advance solution in time* +#. *Advance solution in time* -16. *Get optional outputs* +#. *Get optional outputs* - Additional optional outputs associated with ARKBBDPRE are - available through the routines - :c:func:`ARKBBDPrecGetWorkSpace()` and - :c:func:`ARKBBDPrecGetNumGfnEvals()`. + Additional optional outputs associated with ARKBBDPRE are + available through the routines + :c:func:`ARKBBDPrecGetWorkSpace()` and + :c:func:`ARKBBDPrecGetNumGfnEvals()`. -17. *Deallocate memory for solution vector* +#. *Deallocate memory for solution vector* -18. *Free solver memory* +#. *Free solver memory* -19. *Free linear solver memory* +#. *Free linear solver memory* -20. *Finalize MPI* +#. *Free nonlinear solver memory* + +#. *Finalize MPI* @@ -502,35 +503,34 @@ and attached to the integrator by calling the following functions: Initializes and allocates (internal) memory for the ARKBBDPRE preconditioner. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *Nlocal* -- local vector length. - * *mudq* -- upper half-bandwidth to be used in the difference - quotient Jacobian approximation. - * *mldq* -- lower half-bandwidth to be used in the difference - quotient Jacobian approximation. - * *mukeep* -- upper half-bandwidth of the retained banded - approximate Jacobian block. - * *mlkeep* -- lower half-bandwidth of the retained banded - approximate Jacobian block. - * *dqrely* -- the relative increment in components of *y* used in - the difference quotient approximations. The default is *dqrely* - = :math:`\sqrt{\text{unit roundoff}}`, which can be specified by - passing *dqrely* = 0.0. - * *gloc* -- the name of the C function (of type :c:func:`ARKLocalFn()`) - which computes the approximation :math:`g(t,y) \approx f^I(t,y)`. - * *cfn* -- the name of the C function (of type :c:func:`ARKCommFn()`) which - performs all inter-process communication required for the - computation of :math:`g(t,y)`. - - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_ILL_INPUT* if an input has an illegal value - * *ARKLS_MEM_FAIL* if a memory allocation request failed - - **Notes:** + :param arkode_mem: pointer to the ARKODE memory block. + :param Nlocal: local vector length. + :param mudq: upper half-bandwidth to be used in the difference + quotient Jacobian approximation. + :param mldq: lower half-bandwidth to be used in the difference + quotient Jacobian approximation. + :param mukeep: upper half-bandwidth of the retained banded + approximate Jacobian block. + :param mlkeep: lower half-bandwidth of the retained banded + approximate Jacobian block. + :param dqrely: the relative increment in components of *y* used in + the difference quotient approximations. The default is *dqrely* + = :math:`\sqrt{\text{unit roundoff}}`, which can be specified by + passing *dqrely* = 0.0. + :param gloc: the name of the C function (of type :c:func:`ARKLocalFn()`) + which computes the approximation :math:`g(t,y) \approx f^I(t,y)`. + :param cfn: the name of the C function (of type :c:func:`ARKCommFn()`) which + performs all inter-process communication required for the + computation of :math:`g(t,y)`. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_MEM_FAIL: a memory allocation request failed. + + .. note:: + If one of the half-bandwidths *mudq* or *mldq* to be used in the difference quotient calculation of the approximate Jacobian is negative or exceeds the value *Nlocal*-1, it is replaced by 0 or @@ -554,7 +554,7 @@ The ARKBBDPRE module also provides a re-initialization function to allow solving a sequence of problems of the same size, with the same linear solver choice, provided there is no change in *Nlocal*, *mukeep*, or *mlkeep*. After solving one problem, and after -calling :c:func:`ARKStepReInit()` to re-initialize ARKStep for a +calling ``*StepReInit`` to re-initialize ARKODE for a subsequent problem, a call to :c:func:`ARKBBDPrecReInit()` can be made to change any of the following: the half-bandwidths *mudq* and *mldq* used in the difference-quotient Jacobian approximations, the @@ -562,31 +562,30 @@ relative increment *dqrely*, or one of the user-supplied functions *gloc* and *cfn*. If there is a change in any of the linear solver inputs, an additional call to the "Set" routines provided by the SUNLINSOL module, and/or one or more of the corresponding -``ARKStepSet***`` functions, must also be made (in the proper order). +``ARKodeSet***`` functions, must also be made (in the proper order). .. c:function:: int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq, sunindextype mldq, sunrealtype dqrely) Re-initializes the ARKBBDPRE preconditioner module. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *mudq* -- upper half-bandwidth to be used in the difference - quotient Jacobian approximation. - * *mldq* -- lower half-bandwidth to be used in the difference - quotient Jacobian approximation. - * *dqrely* -- the relative increment in components of *y* used in - the difference quotient approximations. The default is *dqrely* - = :math:`\sqrt{\text{unit roundoff}}`, which can be specified by - passing *dqrely* = 0.0. - - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_PMEM_NULL* if the preconditioner memory is ``NULL`` - - **Notes:** + :param arkode_mem: pointer to the ARKODE memory block. + :param mudq: upper half-bandwidth to be used in the difference + quotient Jacobian approximation. + :param mldq: lower half-bandwidth to be used in the difference + quotient Jacobian approximation. + :param dqrely: the relative increment in components of *y* used in + the difference quotient approximations. The default is *dqrely* + = :math:`\sqrt{\text{unit roundoff}}`, which can be specified by + passing *dqrely* = 0.0. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_PMEM_NULL: the preconditioner memory was ``NULL``. + + .. note:: + If one of the half-bandwidths *mudq* or *mldq* is negative or exceeds the value *Nlocal*-1, it is replaced by 0 or *Nlocal*-1 accordingly. @@ -601,26 +600,25 @@ the ARKBBDPRE module: Returns the processor-local ARKBBDPRE real and integer workspace sizes. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *lenrwBBDP* -- the number of ``sunrealtype`` values in the - ARKBBDPRE workspace. - * *leniwBBDP* -- the number of integer values in the ARKBBDPRE workspace. + :param arkode_mem: pointer to the ARKODE memory block. + :param lenrwBBDP: the number of ``sunrealtype`` values in the + ARKBBDPRE workspace. + :param leniwBBDP: the number of integer values in the ARKBBDPRE workspace. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_PMEM_NULL: the preconditioner memory was ``NULL``. - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_PMEM_NULL* if the preconditioner memory is ``NULL`` + .. note:: - **Notes:** The workspace requirements reported by this routine correspond only to memory allocated within the ARKBBDPRE module (the banded matrix approximation, banded ``SUNLinearSolver`` object, temporary vectors). These values are local to each process. The workspaces referred to here exist in addition to those given by - the corresponding function :c:func:`ARKStepGetLinWorkSpace()`. + the corresponding function :c:func:`ARKodeGetLinWorkSpace()`. @@ -631,22 +629,20 @@ the ARKBBDPRE module: difference approximation of the Jacobian blocks used within the preconditioner setup function. - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *ngevalsBBDP* -- the number of calls made to the user-supplied - *gloc* function. + :param arkode_mem: pointer to the ARKODE memory block. + :param ngevalsBBDP: the number of calls made to the user-supplied + *gloc* function. - **Return value:** - * *ARKLS_SUCCESS* if no errors occurred - * *ARKLS_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory is ``NULL`` - * *ARKLS_PMEM_NULL* if the preconditioner memory is ``NULL`` + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_PMEM_NULL: the preconditioner memory was ``NULL``. In addition to the *ngevalsBBDP* *gloc* evaluations, the costs associated with ARKBBDPRE also include *nlinsetups* LU factorizations, *nlinsetups* calls to *cfn*, *npsolves* banded backsolve calls, and *nfevalsLS* right-hand side function -evaluations, where *nlinsetups* is an optional ARKStep output and +evaluations, where *nlinsetups* is an optional ARKODE output and *npsolves* and *nfevalsLS* are linear solver optional outputs (see -the table :numref:`ARKODE.Usage.ARKStep.ARKLsOutputs`). +the table :numref:`ARKODE.Usage.ARKLsOutputs`). diff --git a/doc/arkode/guide/source/Usage/Relaxation.rst b/doc/arkode/guide/source/Usage/Relaxation.rst new file mode 100644 index 0000000000..f69c60e392 --- /dev/null +++ b/doc/arkode/guide/source/Usage/Relaxation.rst @@ -0,0 +1,359 @@ +.. ----------------------------------------------------------------------------- + Programmer(s): David J. Gardner @ LLNL + ----------------------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.Relaxation: + +Relaxation Methods +================== + +This section describes user-callable functions for applying relaxation methods +with ARKODE. For more information on relaxation Runge--Kutta methods see +:numref:`ARKODE.Mathematics.Relaxation`. + +.. warning:: + + Relaxation support as not been evaluated with non-identity mass matrices. + While this usage mode is supported, feedback from users who explore this + combination would be appreciated. + +Enabling or Disabling Relaxation +-------------------------------- + +.. c:function:: int ARKodeSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) + + Attaches the user supplied functions for evaluating the relaxation function + (``rfn``) and its Jacobian (``rjac``). + + Both ``rfn`` and ``rjac`` are required and an error will be returned if only + one of the functions is ``NULL``. If both ``rfn`` and ``rjac`` are ``NULL``, + relaxation is disabled. + + With DIRK and IMEX-ARK methods or when a fixed mass matrix is present, + applying relaxation requires allocating :math:`s` additional state vectors + (where :math:`s` is the number of stages in the method). + + :param arkode_mem: the ARKODE memory structure + :param rfn: the user-defined function to compute the relaxation function + :math:`\xi(y)` + :param rjac: the user-defined function to compute the relaxation Jacobian + :math:`\xi'(y)` + + :retval ARK_SUCCESS: the function exited successfully + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_ILL_INPUT: an invalid input combination was provided (see the + output error message for more details) + :retval ARK_MEM_FAIL: a memory allocation failed + + .. warning:: + + Applying relaxation requires using a method of at least second order with + :math:`b^E_i \geq 0` and :math:`b^I_i \geq 0`. If these conditions are not + satisfied, :c:func:`ARKodeEvolve` will return with an error during + initialization. + + .. note:: + + When combined with fixed time step sizes, ARKODE will attempt each step + using the specified step size. If the step is successful, relaxation will + be applied, effectively modifying the step size for the current step. If + the step fails or applying relaxation fails, :c:func:`ARKodeEvolve` will + return with an error. + + .. versionadded:: x.y.z + +Optional Input Functions +------------------------ + +This section describes optional input functions used to control applying +relaxation. + +.. c:function:: int ARKodeSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) + + Sets the step size reduction factor applied after a failed relaxation + application. + + The default value is 0.25. Input values :math:`\leq 0` or :math:`\geq 1` will + result in the default value being used. + + :param arkode_mem: the ARKODE memory structure + :param eta_rf: the step size reduction factor + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) + + Sets the smallest acceptable value for the relaxation parameter. + + Values smaller than the lower bound will result in a failed relaxation + application and the step will be repeated with a smaller step size + (determined by :c:func:`ARKodeSetRelaxEtaFail`). + + The default value is 0.8. Input values :math:`\leq 0` or :math:`\geq 1` will + result in the default value being used. + + :param arkode_mem: the ARKODE memory structure + :param lower: the relaxation parameter lower bound + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) + + Sets the largest acceptable value for the relaxation parameter. + + Values larger than the upper bound will result in a failed relaxation + application and the step will be repeated with a smaller step size + (determined by :c:func:`ARKodeSetRelaxEtaFail`). + + The default value is 1.2. Input values :math:`\leq 1` will result in the + default value being used. + + :param arkode_mem: the ARKODE memory structure + :param upper: the relaxation parameter upper bound + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxMaxFails(void* arkode_mem, int max_fails) + + Sets the maximum number of times applying relaxation can fail within a step + attempt before the integration is halted with an error. + + The default value is 10. Input values :math:`\leq 0` will result in the + default value being used. + + :param arkode_mem: the ARKODE memory structure + :param max_fails: the maximum number of failed relaxation applications + allowed in a step + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxMaxIters(void* arkode_mem, int max_iters) + + Sets the maximum number of nonlinear iterations allowed when solving for the + relaxation parameter. + + If the maximum number of iterations is reached before meeting the solve + tolerance (determined by :c:func:`ARKodeSetRelaxResTol` and + :c:func:`ARKodeSetRelaxTol`), the step will be repeated with a smaller + step size (determined by :c:func:`ARKodeSetRelaxEtaFail`). + + The default value is 10. Input values :math:`\leq 0` will result in the + default value being used. + + :param arkode_mem: the ARKODE memory structure + :param max_iters: the maximum number of solver iterations allowed + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) + + Sets the nonlinear solver method used to compute the relaxation parameter. + + The default value is ``ARK_RELAX_NEWTON``. + + :param arkode_mem: the ARKODE memory structure + :param solver: the nonlinear solver to use: ``ARK_RELAX_BRENT`` or + ``ARK_RELAX_NEWTON`` + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + :retval ARK_ILL_INPUT: an invalid solver option was provided + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) + + Sets the nonlinear solver residual tolerance to use when solving + :eq:`ARKODE_RELAX_NLS`. + + If the residual or iteration update tolerance (see + :c:func:`ARKodeSetRelaxMaxIters`) is not reached within the maximum number of + iterations (determined by :c:func:`ARKodeSetRelaxMaxIters`), the step will + be repeated with a smaller step size (determined by + :c:func:`ARKodeSetRelaxEtaFail`). + + The default value is :math:`4 \epsilon` where :math:`\epsilon` is + floating-point precision. Input values :math:`\leq 0` will result in the + default value being used. + + :param arkode_mem: the ARKODE memory structure + :param res_tol: the nonlinear solver residual tolerance to use + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) + + Sets the nonlinear solver relative and absolute tolerance on changes in + :math:`r` iterates when solving :eq:`ARKODE_RELAX_NLS`. + + If the residual (see :c:func:`ARKodeSetRelaxResTol`) or iterate update + tolerance is not reached within the maximum number of iterations (determined + by :c:func:`ARKodeSetRelaxMaxIters`), the step will be repeated with a + smaller step size (determined by :c:func:`ARKodeSetRelaxEtaFail`). + + The default relative and absolute tolerances are :math:`4 \epsilon` and + :math:`10^{-14}`, respectively, where :math:`\epsilon` is floating-point + precision. Input values :math:`\leq 0` will result in the default value being + used. + + :param arkode_mem: the ARKODE memory structure + :param rel_tol: the nonlinear solver relative solution tolerance to use + :param abs_tol: the nonlinear solver absolute solution tolerance to use + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +Optional Output Functions +------------------------- + +This section describes optional output functions used to retrieve information +about the performance of the relaxation method. + +.. c:function:: int ARKodeGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) + + Get the number of times the user's relaxation function was evaluated. + + :param arkode_mem: the ARKODE memory structure + :param r_evals: the number of relaxation function evaluations + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) + + Get the number of times the user's relaxation Jacobian was evaluated. + + :param arkode_mem: the ARKODE memory structure + :param J_evals: the number of relaxation Jacobian evaluations + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumRelaxFails(void* arkode_mem, long int* fails) + + Get the total number of times applying relaxation failed. + + The counter includes the sum of the number of nonlinear solver failures + (see :c:func:`ARKodeGetNumRelaxSolveFails`) and the number of failures due + an unacceptable relaxation value (see :c:func:`ARKodeSetRelaxLowerBound` and + :c:func:`ARKodeSetRelaxUpperBound`). + + :param arkode_mem: the ARKODE memory structure + :param fails: the total number of failed relaxation attempts + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumRelaxBoundFails(void* arkode_mem, long int* fails) + + Get the number of times the relaxation parameter was deemed unacceptable. + + :param arkode_mem: the ARKODE memory structure + :param fails: the number of failures due to an unacceptable relaxation + parameter value + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumRelaxSolveFails(void* arkode_mem, long int* fails) + + Get the number of times the relaxation parameter nonlinear solver failed. + + :param arkode_mem: the ARKODE memory structure + :param fails: the number of relaxation nonlinear solver failures + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) + + Get the number of relaxation parameter nonlinear solver iterations. + + :param arkode_mem: the ARKODE memory structure + :param iters: the number of relaxation nonlinear solver iterations + + :retval ARK_SUCCESS: the value was successfully set + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was + ``NULL`` + + .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst deleted file mode 100644 index 2cf457359c..0000000000 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/Skeleton.rst +++ /dev/null @@ -1,143 +0,0 @@ -.. ---------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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.Usage.SPRKStep.Skeleton: - -A skeleton of the user's main program -============================================ - -The following is a skeleton of the user's main program (or calling -program) for the integration of an ODE IVP using the SPRKStep module. -Most of the steps are independent of the NVECTOR implementation used. -For the steps that are not, refer to :numref:`NVectors` for -the specific name of the function to be called or macro to be -referenced. - -.. index:: User main program - -#. Initialize parallel or multi-threaded environment, if appropriate. - - For example, call ``MPI_Init`` to initialize MPI if used, or set - ``num_threads``, the number of threads to use within the threaded - vector functions, if used. - -#. Create the SUNDIALS simulation context object. - - Call :c:func:`SUNContext_Create` to allocate the ``SUNContext`` object. - -#. Set problem dimensions, etc. - - This generally includes the problem size, ``N``, and may include - the local vector length ``Nlocal``. The problem size ``N`` is the - size including both the ``q`` and ``p`` variables. - - .. note:: - - The variables ``N`` and ``Nlocal`` should be of type - ``sunindextype``. - -#. Set vector of initial values - - To set the vector ``y0`` of initial values, use the appropriate - functions defined by the particular NVECTOR implementation. - The vector should include both the ``q`` and ``p`` variables. - - For most native SUNDIALS vector implementations, use a call of the form - - .. code-block:: c - - y0 = N_VMake_***(..., ydata); - - if the ``sunrealtype`` array ``ydata`` containing the initial values of - :math:`y` already exists. For some GPU-enabled vectors, a similar constructor - can be used to provide host and device data pointers. If the data array - does not already exist, create a new vector by making a call of the form - - .. code-block:: c - - y0 = N_VNew_***(...); - - and then set its elements by accessing the underlying data where it - is located with a call of the form - - .. code-block:: c - - ydata = N_VGetArrayPointer_***(y0); - - For details on each of SUNDIALS' provided vector implementations, see - the corresponding sections in :numref:`NVectors` for details. - -#. Create SPRKStep object - - Call ``arkode_mem = SPRKStepCreate(...)`` to create the SPRKStep memory - block. :c:func:`SPRKStepCreate` returns a ``void*`` pointer to - this memory structure. See :numref:`ARKODE.Usage.SPRKStep.Initialization` for - details. - -#. Specify time step size - - Call :c:func:`SPRKStepSetFixedStep()` to set the fixed time step size. - .. or :c:func:`SPRKStepAdaptivityFn()` to specify either a fixed time-step - .. size or a callback function that adapts the time-step size. SPRKStep - .. does not support error-based adaptivity like other ARKODE time-stepper - .. modules due to the incompatibility with symplectic methods. - -#. Set optional inputs - - Call ``SPRKStepSet*`` functions to change any optional inputs that - control the behavior of SPRKStep from their default values. See - :numref:`ARKODE.Usage.SPRKStep.OptionalInputs` for details. - -#. Specify rootfinding problem - - Optionally, call :c:func:`SPRKStepRootInit()` to initialize a rootfinding - problem to be solved during the integration of the ODE system. See - :numref:`ARKODE.Usage.SPRKStep.RootFinding` for general details, and - :numref:`ARKODE.Usage.SPRKStep.OptionalInputs` for relevant optional - input calls. - -#. Advance solution in time - - For each point at which output is desired, call - - .. code-block:: c - - ier = SPRKStepEvolve(arkode_mem, tout, yout, &tret, itask); - - Here, ``itask`` specifies the return mode. The vector ``yout`` - (which can be the same as the vector ``y0`` above) will contain - :math:`y(t_\text{out})`. See :numref:`ARKODE.Usage.SPRKStep.Integration` - for details. - -#. Get optional outputs - - Call ``SPRKStepGet*`` functions to obtain optional output. See - :numref:`ARKODE.Usage.SPRKStep.OptionalOutputs` for details. - -#. Deallocate memory for solution vector - - Upon completion of the integration, deallocate memory for the - vector ``y`` (or ``yout``) by calling the NVECTOR destructor - function: - - .. code-block:: c - - N_VDestroy(y); - -#. Free solver memory - - Call :c:func:`SPRKStepFree()` to free the memory allocated for - the SPRKStep module. - -#. Finalize MPI, if used - - Call ``MPI_Finalize`` to terminate MPI. diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst index 9dc6d5f359..45996860cf 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst @@ -15,22 +15,20 @@ SPRKStep User-callable functions ================================== -This section describes the functions that are called by the -user to setup and then solve an IVP using the SPRKStep time-stepping -module. Some of these are required; however, starting with -:numref:`ARKODE.Usage.SPRKStep.OptionalInputs`, the functions listed involve -optional inputs/outputs or restarting, and those paragraphs may be -skipped for a casual use of ARKODE's SPRKStep module. In any case, -refer to the preceding section, :numref:`ARKODE.Usage.SPRKStep.Skeleton`, -for the correct order of these calls. - -On an error, each user-callable function returns a negative value (or -``NULL`` if the function returns a pointer) and sends an error message -to the error handler routine, which prints the message to ``stderr`` -by default. However, the user can set a file as error output or can -provide their own error handler function (see -:numref:`ARKODE.Usage.SPRKStep.OptionalInputs` for details). - +This section describes the SPRKStep-specific functions that may be called +by the user to setup and then solve an IVP using the SPRKStep time-stepping +module. The large majority of these routines merely wrap :ref:`underlying +ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated +-- each of these are clearly marked. However, some +of these user-callable functions are specific to ERKStep, as explained +below. + +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +SPRKStep supports only the basic set of user-callable functions, and +does not support any of the restricted groups (time adaptivity, implicit +solvers, etc.). .. _ARKODE.Usage.SPRKStep.Initialization: @@ -72,26 +70,16 @@ SPRKStep initialization and deallocation functions :param arkode_mem: pointer to the SPRKStep memory block. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeFree` instead. + .. _ARKODE.Usage.SPRKStep.RootFinding: Rootfinding initialization function -------------------------------------- -As described in :numref:`ARKODE.Mathematics.Rootfinding`, while -solving the IVP, ARKODE's time-stepping modules have the capability to -find the roots of a set of user-defined functions. To activate the -root-finding algorithm, call the following function. This is normally -called only once, prior to the first call to -:c:func:`SPRKStepEvolve()`, but if the rootfinding problem is to be -changed during the solution, :c:func:`SPRKStepRootInit()` can also be -called prior to a continuation call to :c:func:`SPRKStepEvolve()`. - -.. note:: - - The solution is interpolated to the times at which roots are found. - - .. c:function:: int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) Initializes a rootfinding problem to be solved during the @@ -116,20 +104,16 @@ called prior to a continuation call to :c:func:`SPRKStepEvolve()`. :retval ARK_MEM_FAIL: if there was a memory allocation failure :retval ARK_ILL_INPUT: if *nrtfn* is greater than zero but *g* = ``NULL``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeRootInit` instead. + .. _ARKODE.Usage.SPRKStep.Integration: SPRKStep solver function ------------------------- -This is the central step in the solution process -- the call to perform -the integration of the IVP. One of the input arguments (*itask*) -specifies one of two modes as to where SPRKStep is to return a -solution. These modes are modified if the user has set a stop time -(with a call to the optional input function :c:func:`SPRKStepSetStopTime()`) or -has requested rootfinding. - - .. c:function:: int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) @@ -215,6 +199,10 @@ has requested rootfinding. On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeEvolve` instead. + @@ -223,63 +211,12 @@ has requested rootfinding. Optional input functions ------------------------- -There are numerous optional input parameters that control the behavior -of SPRKStep, each of which may be modified from its default value through -calling an appropriate input function. The following tables list all -optional input functions, grouped by which aspect of SPRKStep they control. -Detailed information on the calling syntax and arguments for each -function are then provided following each table. - -The optional inputs are grouped into the following categories: - -* General SPRKStep options (:numref:`ARKODE.Usage.SPRKStep.SPRKStepInputTable`), - -* IVP method solver options (:numref:`ARKODE.Usage.SPRKStep.SPRKStepMethodInputTable`), - -* Rootfinding options (:numref:`ARKODE.Usage.SPRKStep.SPRKStepRootfindingInputTable`). - -For the most casual use of SPRKStep, relying on the default set of -solver parameters, the reader can skip to section on user-supplied -functions, :numref:`ARKODE.Usage.UserSupplied`. - -We note that, on an error return, all of the optional input functions send an -error message to the error handler function. All error return values are -negative, so a test on the return arguments for negative values will catch all -errors. Finally, a call to a ``SPRKStepSet***`` function can generally be made -from the user's calling program at any time and, if successful, takes effect -immediately. For ``SPRKStepSet***`` functions that cannot be called at any time, -this is explicitly noted in the function documentation. - - .. _ARKODE.Usage.SPRKStep.SPRKStepInput: Optional inputs for SPRKStep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.SPRKStep.SPRKStepInputTable: -.. table:: Optional inputs for SPRKStep - - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Optional input | Function name | Default | - +=====================================================+==========================================+========================+ - | Return SPRKStep solver parameters to their defaults | :c:func:`SPRKStepSetDefaults()` | internal | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Set dense output interpolation type | :c:func:`SPRKStepSetInterpolantType()` | ``ARK_INTERP_LAGRANGE``| - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Set dense output polynomial degree | :c:func:`SPRKStepSetInterpolantDegree()` | 5 | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Set fixed step size (required user input) | :c:func:`SPRKStepSetFixedStep()` | user defined | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Maximum no. of internal steps before *tout* | :c:func:`SPRKStepSetMaxNumSteps()` | 500 | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Set a value for :math:`t_{stop}` | :c:func:`SPRKStepSetStopTime()` | undefined | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Disable the stop time | :c:func:`SPRKStepClearStopTime` | N/A | - +-----------------------------------------------------+------------------------------------------+------------------------+ - | Supply a pointer for user data | :c:func:`SPRKStepSetUserData()` | ``NULL`` | - +-----------------------------------------------------+------------------------------------------+------------------------+ - .. c:function:: int SPRKStepSetDefaults(void* arkode_mem) @@ -300,6 +237,10 @@ Optional inputs for SPRKStep Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`SPRKStepRootInit()`). + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetDefaults` instead. + .. c:function:: int SPRKStepSetInterpolantType(void* arkode_mem, int itype) @@ -336,6 +277,9 @@ Optional inputs for SPRKStep has shown that Lagrange interpolation typically performs well in this regard, while Hermite interpolation does not. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantType` instead. .. c:function:: int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) @@ -372,6 +316,10 @@ Optional inputs for SPRKStep When `q = 1`, a linear interpolant is the default to ensure values obtained by the integrator are returned at the ends of the time interval. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetInterpolantDegree` instead. + .. c:function:: int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) @@ -384,6 +332,10 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetFixedStep` instead. + .. c:function:: int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) @@ -403,6 +355,10 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetMaxNumSteps` instead. + .. c:function:: int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -426,6 +382,10 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetStopTime` instead. + .. c:function:: int SPRKStepClearStopTime(void* arkode_mem) @@ -439,6 +399,10 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeClearStopTime` instead. + .. c:function:: int SPRKStepSetUserData(void* arkode_mem, void* user_data) @@ -456,6 +420,10 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetUserData` instead. + .. _ARKODE.Usage.SPRKStep.SPRKStepMethodInput: @@ -501,6 +469,10 @@ Optional inputs for IVP method selection This overrides any previously set method so it should not be used with :c:func:`SPRKStepSetMethod` or :c:func:`SPRKStepSetMethodName`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetOrder` instead. + .. c:function:: int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_table) @@ -518,6 +490,10 @@ Optional inputs for IVP method selection No error checking is performed on the coefficients contained in the table to ensure its declared order of accuracy. + .. warning:: + + This should not be used with :c:func:`ARKodeSetOrder`. + .. c:function:: int SPRKStepSetMethodName(void* arkode_mem, const char* method) @@ -530,6 +506,10 @@ Optional inputs for IVP method selection :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. warning:: + + This should not be used with :c:func:`ARKodeSetOrder`. + .. c:function:: int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) @@ -549,29 +529,13 @@ Optional inputs for IVP method selection :retval ARK_ILL_INPUT: if an argument has an illegal value + .. _ARKODE.Usage.SPRKStep.SPRKStepRootfindingInput: Rootfinding optional input functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following functions can be called to set optional inputs to -control the rootfinding algorithm, the mathematics of which are -described in :numref:`ARKODE.Mathematics.Rootfinding`. - - -.. _ARKODE.Usage.SPRKStep.SPRKStepRootfindingInputTable: -.. table:: Rootfinding optional input functions - - +-----------------------------------------+-------------------------------------------+----------+ - | Optional input | Function name | Default | - +=========================================+===========================================+==========+ - | Direction of zero-crossings to monitor | :c:func:`SPRKStepSetRootDirection()` | both | - +-----------------------------------------+-------------------------------------------+----------+ - | Disable inactive root warnings | :c:func:`SPRKStepSetNoInactiveRootWarn()` | enabled | - +-----------------------------------------+-------------------------------------------+----------+ - - .. c:function:: int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir) @@ -592,6 +556,10 @@ described in :numref:`ARKODE.Mathematics.Rootfinding`. :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetRootDirection` instead. + .. c:function:: int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) @@ -610,22 +578,16 @@ described in :numref:`ARKODE.Mathematics.Rootfinding`. :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. + .. _ARKODE.Usage.SPRKStep.InterpolatedOutput: Interpolated output function -------------------------------- -An optional function :c:func:`SPRKStepGetDky()` is available to obtain -additional values of solution-related quantities. This function -should only be called after a successful return from -:c:func:`SPRKStepEvolve()`, as it provides interpolated values either of -:math:`y` or of its derivatives. -interpolated to any value of :math:`t` in the last internal step taken -by :c:func:`SPRKStepEvolve()`. - - - .. c:function:: int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) Computes the *k*-th derivative of the function :math:`y` at the time *t*, @@ -666,84 +628,22 @@ by :c:func:`SPRKStepEvolve()`. It is only legal to call this function after a successful return from :c:func:`SPRKStepEvolve()`. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetDky` instead. + .. _ARKODE.Usage.SPRKStep.OptionalOutputs: Optional output functions ------------------------------ -SPRKStep provides an extensive set of functions that can be used to -obtain solver performance information. We organize these into groups: - -#. General SPRKStep output routines are in - :numref:`ARKODE.Usage.SPRKStep.SPRKStepMainOutputs`, - -#. Output routines regarding root-finding results are in - :numref:`ARKODE.Usage.SPRKStep.SPRKStepRootOutputs`, - -#. General usability routines (e.g. to print the current SPRKStep - parameters, or output the current Butcher tables) are in - :numref:`ARKODE.Usage.SPRKStep.SPRKStepExtraOutputs`. - -Following each table, we elaborate on each function. - -Some of the optional outputs, especially the various counters, can be -very useful in determining the efficiency of various methods inside -SPRKStep. For example: - -* The counters *nsteps* and *nf_evals* provide a rough measure of the - overall cost of a given run, and can be compared between runs with - different solver options to suggest which set of options is the most - efficient. - -.. * The ratio *nsteps/step_attempts* can measure the quality of the -.. time step adaptivity algorithm, since a poor algorithm will result -.. in more failed steps, and hence a lower ratio. - -It is therefore recommended that users retrieve and output these -statistics following each run, and take some time to investigate -alternate solver options that will be more optimal for their -particular problem of interest. - - .. _ARKODE.Usage.SPRKStep.SPRKStepMainOutputs: Main solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. _ARKODE.Usage.SPRKStep.SPRKStepMainOutputsTable: -.. table:: Main solver optional output functions - - +-----------------------------------------------------+--------------------------------------------+ - | Optional output | Function name | - +=====================================================+============================================+ - | Cumulative number of internal steps | :c:func:`SPRKStepGetNumSteps` | - +-----------------------------------------------------+--------------------------------------------+ - | Step size used for the last successful step | :c:func:`SPRKStepGetLastStep` | - +-----------------------------------------------------+--------------------------------------------+ - | Step size to be attempted on the next step | :c:func:`SPRKStepGetCurrentStep` | - +-----------------------------------------------------+--------------------------------------------+ - | Current internal time reached by the solver | :c:func:`SPRKStepGetCurrentTime` | - +-----------------------------------------------------+--------------------------------------------+ - | Current internal state reached by the solver | :c:func:`SPRKStepGetCurrentState` | - +-----------------------------------------------------+--------------------------------------------+ - | Single accessor to many statistics at once | :c:func:`SPRKStepGetStepStats` | - +-----------------------------------------------------+--------------------------------------------+ - | Print all statistics | :c:func:`SPRKStepPrintAllStats` | - +-----------------------------------------------------+--------------------------------------------+ - | Name of constant associated with a return flag | :c:func:`SPRKStepGetReturnFlagName` | - +-----------------------------------------------------+--------------------------------------------+ - | No. of attempted steps | :c:func:`SPRKStepGetNumStepAttempts` | - +-----------------------------------------------------+--------------------------------------------+ - | No. of calls to right-hand side functions | :c:func:`SPRKStepGetNumRhsEvals` | - +-----------------------------------------------------+--------------------------------------------+ - | Current method table | :c:func:`SPRKStepGetCurrentMethod` | - +-----------------------------------------------------+--------------------------------------------+ - | Retrieve a pointer for user data | :c:func:`SPRKStepGetUserData` | - +-----------------------------------------------------+--------------------------------------------+ - - .. c:function:: int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) @@ -756,6 +656,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumSteps` instead. + .. c:function:: int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -768,6 +672,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetLastStep` instead. + .. c:function:: int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -779,6 +687,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentStep` instead. + .. c:function:: int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -790,6 +702,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentTime` instead. + .. c:function:: int SPRKStepGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -807,6 +723,10 @@ Main solver optional output functions as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentState` instead. + .. c:function:: int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -822,6 +742,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetStepStats` instead. + .. c:function:: int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -845,6 +769,9 @@ Main solver optional output functions read and output the data from a SUNDIALS CSV output file using the key and value pair format. + .. deprecated:: x.y.z + + Use :c:func:`ARKodePrintAllStats` instead. .. c:function:: char *SPRKStepGetReturnFlagName(long int flag) @@ -857,6 +784,10 @@ Main solver optional output functions :returns: The return value is a string containing the name of the corresponding constant. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetReturnFlagName` instead. + .. c:function:: int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -868,6 +799,10 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumStepAttempts` instead. + .. c:function:: int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) @@ -905,26 +840,16 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the ARKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetUserData` instead. + .. _ARKODE.Usage.SPRKStep.SPRKStepRootOutputs: Rootfinding optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. _ARKODE.Usage.SPRKStep.SPRKStepRootOutputsTable: -.. table:: Rootfinding optional output functions - - +--------------------------------------------------+---------------------------------+ - | Optional output | Function name | - +==================================================+=================================+ - | Array showing roots found | :c:func:`SPRKStepGetRootInfo()` | - +--------------------------------------------------+---------------------------------+ - | No. of calls to user root function | :c:func:`SPRKStepGetNumGEvals()`| - +--------------------------------------------------+---------------------------------+ - - - .. c:function:: int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) Returns an array showing which functions were found to have a root. @@ -947,6 +872,10 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetRootInfo` instead. + .. c:function:: int SPRKStepGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -959,28 +888,16 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumGEvals` instead. + .. _ARKODE.Usage.SPRKStep.SPRKStepExtraOutputs: General usability functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The following optional routine may be called by a user to inquire -about existing solver parameters. While it would not typically be called -during the course of solving an initial value problem, it may be useful -for users wishing to better understand SPRKStep. - - -.. _ARKODE.Usage.SPRKStep.SPRKStepExtraOutputsTable: -.. table:: General usability functions - - +----------------------------------------+--------------------------------------+ - | Optional routine | Function name | - +----------------------------------------+--------------------------------------+ - | Output all SPRKStep solver parameters | :c:func:`SPRKStepWriteParameters()` | - +----------------------------------------+--------------------------------------+ - - .. c:function:: int SPRKStepWriteParameters(void* arkode_mem, FILE *fp) Outputs all SPRKStep solver parameters to the provided file pointer. @@ -997,6 +914,10 @@ for users wishing to better understand SPRKStep. :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeWriteParameters` instead. + .. _ARKODE.Usage.SPRKStep.Reinitialization: @@ -1061,22 +982,6 @@ the RHS function should not incorporate the discontinuity. SPRKStep reset function ----------------------- -To reset the SPRKStep module to a particular state :math:`(t_R,y(t_R))` for the -continued solution of a problem, where a prior -call to :c:func:`SPRKStepCreate` has been made, the user must call the function -:c:func:`SPRKStepReset()`. Like :c:func:`SPRKStepReInit()` this routine retains -the current settings for all SPRKStep module options and performs no memory -allocations but, unlike :c:func:`SPRKStepReInit()`, this routine performs only a -*subset* of the input checking and initializations that are done in -:c:func:`SPRKStepCreate`. In particular this routine retains all internal -counter values. Like :c:func:`SPRKStepReInit()`, a call to -:c:func:`SPRKStepReset()` will delete any previously-set *tstop* value specified -via a call to :c:func:`SPRKStepSetStopTime()`. Following a successful call to -:c:func:`SPRKStepReset()`, call :c:func:`SPRKStepEvolve()` again to continue -solving the problem. By default the next call to :c:func:`SPRKStepEvolve()` will -use the step size computed by SPRKStep prior to calling :c:func:`SPRKStepReset()`. - - .. c:function:: int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) Resets the current SPRKStep time-stepper module state to the provided @@ -1101,3 +1006,7 @@ use the step size computed by SPRKStep prior to calling :c:func:`SPRKStepReset() By default the next call to :c:func:`SPRKStepEvolve()` will use the step size computed by SPRKStep prior to calling :c:func:`SPRKStepReset()`. + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeReset` instead. 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 536d94391c..ec3dbdc935 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst @@ -16,30 +16,20 @@ Using the SPRKStep time-stepping module ========================================== -This chapter is concerned with the use of the SPRKStep time-stepping module for -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. +This section is concerned with the use of the SPRKStep time-stepping +module for the solution of initial value problems (IVPs) in a C or C++ +language setting. Usage of SPRKStep follows that of the rest of ARKODE, +and so in this section we primarily focus on those usage aspects that +are specific to SPRKStep. -The example programs located in the source code ``examples/arkode`` folder, may -be helpful as templates for new codes. In particular, +We note that of the ARKODE example programs located in the source code +``examples/arkode`` folder, the following demonstrate ``SPRKStep`` usage: * ``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. - -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 -provided separately in :numref:`ARKODE.Constants`. - -The relevant information on using SPRKStep's C and C++ interfaces is -detailed in the following subsections. - .. toctree:: :maxdepth: 1 - Skeleton User_callable diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/Skeleton.rst similarity index 73% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst rename to doc/arkode/guide/source/Usage/Skeleton.rst index daa3586143..5909007646 100644 --- a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/Skeleton.rst @@ -12,13 +12,13 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -.. _ARKODE.Usage.ARKStep.Skeleton: +.. _ARKODE.Usage.Skeleton: A skeleton of the user's main program ============================================ The following is a skeleton of the user's main program (or calling -program) for the integration of an ODE IVP using the ARKStep module. +program) for the integration of an ODE IVP using ARKODE. Most of the steps are independent of the NVECTOR, SUNMATRIX, SUNLINSOL and SUNNONLINSOL implementations used. For the steps that are not, refer to :numref:`NVectors`, :numref:`SUNMatrix`, @@ -77,30 +77,32 @@ the function to be called or macro to be referenced. For details on each of SUNDIALS' provided vector implementations, see the corresponding sections in :numref:`NVectors` for details. -#. Create ARKStep object +#. Create ARKODE object - Call ``arkode_mem = ARKStepCreate(...)`` to create the - ARKStep memory block. :c:func:`ARKStepCreate` returns a ``void*`` pointer to - this memory structure. See :numref:`ARKODE.Usage.ARKStep.Initialization` for - details. + Call a stepper-specific constructor, ``arkode_mem = *StepCreate(...)``, to + create the ARKODE memory block. These routines return a ``void*`` pointer to + this memory structure. See :numref:`ARKODE.Usage.ARKStep.Initialization`, + :numref:`ARKODE.Usage.ERKStep.Initialization`, + :numref:`ARKODE.Usage.MRIStep.Initialization`, or + :numref:`ARKODE.Usage.SPRKStep.Initialization` for details. #. Specify integration tolerances - Call :c:func:`ARKStepSStolerances()` or - :c:func:`ARKStepSVtolerances()` to specify either a scalar relative + Call :c:func:`ARKodeSStolerances()` or + :c:func:`ARKodeSVtolerances()` to specify either a scalar relative tolerance and scalar absolute tolerance, or a scalar relative tolerance and a vector of absolute tolerances, - respectively. Alternatively, call :c:func:`ARKStepWFtolerances()` + respectively. Alternatively, call :c:func:`ARKodeWFtolerances()` to specify a function which sets directly the weights used in evaluating WRMS vector norms. See - :numref:`ARKODE.Usage.ARKStep.Tolerances` for details. + :numref:`ARKODE.Usage.Tolerances` for details. If a problem with non-identity mass matrix is used, and the solution units differ considerably from the equation units, absolute tolerances for the equation residuals (nonlinear and linear) may be specified separately through calls to - :c:func:`ARKStepResStolerance()`, :c:func:`ARKStepResVtolerance()`, or - :c:func:`ARKStepResFtolerance()`. + :c:func:`ARKodeResStolerance()`, :c:func:`ARKodeResVtolerance()`, or + :c:func:`ARKodeResFtolerance()`. #. Create matrix object @@ -156,27 +158,27 @@ the function to be called or macro to be referenced. If a linear solver was created above for implicit stage solves, initialize the ARKLS linear solver interface by attaching the linear solver object (and Jacobian matrix object, if applicable) - with the call (for details see :numref:`ARKODE.Usage.ARKStep.LinearSolvers`): + with the call (for details see :numref:`ARKODE.Usage.LinearSolvers`): .. code-block:: c - ier = ARKStepSetLinearSolver(...); + ier = ARKodeSetLinearSolver(...); Similarly, if the problem involves a non-identity mass matrix, initialize the ARKLS mass matrix linear solver interface by attaching the mass linear solver object (and mass matrix object, if applicable) with the call (for details see - :numref:`ARKODE.Usage.ARKStep.LinearSolvers`): + :numref:`ARKODE.Usage.LinearSolvers`): .. code-block:: c - ier = ARKStepSetMassLinearSolver(...); + ier = ARKodeSetMassLinearSolver(...); #. Create nonlinear solver object If the problem involves an implicit component, and if a non-default nonlinear solver object will be used for implicit stage solves - (see :numref:`ARKODE.Usage.ARKStep.NonlinearSolvers`), + (see :numref:`ARKODE.Usage.NonlinearSolvers`), then the desired nonlinear solver object must be created by using the appropriate functions defined by the particular SUNNONLINSOL implementation (e.g., ``NLS = SUNNonlinSol_***(...);`` where @@ -196,34 +198,41 @@ the function to be called or macro to be referenced. #. Attach nonlinear solver module If a nonlinear solver object was created above, then it must be - attached to ARKStep using the call (for details see - :numref:`ARKODE.Usage.ARKStep.NonlinearSolvers`): + attached to ARKODE using the call (for details see + :numref:`ARKODE.Usage.NonlinearSolvers`): .. code-block:: c - ier = ARKStepSetNonlinearSolver(...); + ier = ARKodeSetNonlinearSolver(...); #. Set nonlinear solver optional inputs Call the appropriate set functions for the selected nonlinear solver module to change optional inputs specific to that nonlinear solver. These *must* be called after attaching the nonlinear - solver to ARKStep, otherwise the optional inputs will be - overridden by ARKStep defaults. See + solver to ARKODE, otherwise the optional inputs will be + overridden by ARKODE defaults. See :numref:`SUNNonlinSol` for more information on optional inputs. #. Set optional inputs - Call ``ARKStepSet*`` functions to change any optional inputs that - control the behavior of ARKStep from their default values. See - :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for details. + Call ``ARKodeSet*`` functions to change any optional inputs that + control the behavior of ARKODE from their default values. See + :numref:`ARKODE.Usage.OptionalInputs` for details. + + Additionally, call ``*StepSet*`` routines to change any + stepper-specific optional inputs from their default values. See + :numref:`ARKODE.Usage.ARKStep.OptionalInputs`, + :numref:`ARKODE.Usage.ERKStep.OptionalInputs`, + :numref:`ARKODE.Usage.MRIStep.OptionalInputs`, or + :numref:`ARKODE.Usage.SPRKStep.OptionalInputs` for details. #. Specify rootfinding problem - Optionally, call :c:func:`ARKStepRootInit()` to initialize a rootfinding + Optionally, call :c:func:`ARKodeRootInit()` to initialize a rootfinding problem to be solved during the integration of the ODE system. See - :numref:`ARKODE.Usage.ARKStep.RootFinding` for general details, and - :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for relevant optional + :numref:`ARKODE.Usage.RootFinding` for general details, and + :numref:`ARKODE.Usage.OptionalInputs` for relevant optional input calls. #. Advance solution in time @@ -232,17 +241,24 @@ the function to be called or macro to be referenced. .. code-block:: c - ier = ARKStepEvolve(arkode_mem, tout, yout, &tret, itask); + ier = ARKodeEvolve(arkode_mem, tout, yout, &tret, itask); Here, ``itask`` specifies the return mode. The vector ``yout`` (which can be the same as the vector ``y0`` above) will contain :math:`y(t_\text{out})`. See - :numref:`ARKODE.Usage.ARKStep.Integration` for details. + :numref:`ARKODE.Usage.Integration` for details. #. Get optional outputs - Call ``ARKStepGet*`` functions to obtain optional output. See - :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` for details. + Call ``ARKodeGet*`` functions to obtain optional output. See + :numref:`ARKODE.Usage.OptionalOutputs` for details. + + Additionally, call ``*StepGet*`` routines to retrieve any + stepper-specific optional outputs. See + :numref:`ARKODE.Usage.ARKStep.OptionalOutputs`, + :numref:`ARKODE.Usage.ERKStep.OptionalOutputs`, + :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`, or + :numref:`ARKODE.Usage.SPRKStep.OptionalOutputs` for details. #. Deallocate memory for solution vector @@ -255,8 +271,8 @@ the function to be called or macro to be referenced. #. Free solver memory - Call :c:func:`ARKStepFree()` to free the memory allocated for - the ARKStep module (and any nonlinear solver module). + Call :c:func:`ARKodeFree()` to free the memory allocated for + the ARKODE module (and any nonlinear solver module). #. Free linear solver and matrix memory @@ -266,10 +282,14 @@ the function to be called or macro to be referenced. #. Free nonlinear solver memory - If a user-supplied ``SUNNonlinearSolver`` was provided to ARKStep, + If a user-supplied ``SUNNonlinearSolver`` was provided to ARKODE, then call :c:func:`SUNNonlinSolFree()` to free any memory allocated for the nonlinear solver object created above. +#. Free the SUNContext object + + Call :c:func:`SUNContext_Free` to free the memory allocated for the ``SUNContext`` object. + #. Finalize MPI, if used Call ``MPI_Finalize`` to terminate MPI. diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst new file mode 100644 index 0000000000..96d4f5eddd --- /dev/null +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -0,0 +1,4588 @@ +.. ---------------------------------------------------------------- + Programmer(s): Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.UserCallable: + +ARKODE User-callable functions +================================ + +This section describes the shared ARKODE functions that are called by +the user to setup and then solve an IVP. Some of these are required; +however, starting with :numref:`ARKODE.Usage.OptionalInputs`, +the functions listed involve optional inputs/outputs or restarting, +and those paragraphs may be skipped for a casual use of ARKODE. +In any case, refer to the preceding section, +:numref:`ARKODE.Usage.Skeleton`, for the correct order of these calls. + +On an error, each user-callable function returns a negative value (or +``NULL`` if the function returns a pointer) and sends an error message +to the error handler, which prints the message to ``stderr`` by default. +However, the user can set a file as error output or can +provide their own error handler (see :numref:`SUNDIALS.Errors` for details). + +We note that depending on the choice of time-stepping module, only a +subset of ARKODE's user-callable functions will be applicable/supported. +We thus categorize the functions below into five groups: + +A. functions that apply for all time-stepping modules, + +B. functions that apply for time-stepping modules that allow temporal adaptivity, + +C. functions that apply for time-stepping modules that utilize implicit solvers (nonlinear or linear), + +D. functions that apply for time-stepping modules that support non-identity mass matrices, and + +E. functions that apply for time-stepping modules that support relaxation Runge--Kutta methods. + +In the function descriptions below, we identify those that have any of the restrictions B-E above. +Then in the introduction for each of the stepper-specific documentation sections +(:numref:`ARKODE.Usage.ARKStep.UserCallable`, :numref:`ARKODE.Usage.ERKStep.UserCallable`, +:numref:`ARKODE.Usage.MRIStep.UserCallable`, and :numref:`ARKODE.Usage.SPRKStep.UserCallable`) +we clarify the categories of these functions that are supported. + + + +.. _ARKODE.Usage.Tolerances: + +ARKODE tolerance specification functions +------------------------------------------------------ + +These functions specify the integration tolerances. One of them +**should** be called before the first call to +:c:func:`ARKodeEvolve`; otherwise default values of ``reltol = +1e-4`` and ``abstol = 1e-9`` will be used, which may be entirely +incorrect for a specific problem. + +The integration tolerances ``reltol`` and ``abstol`` define a vector +of error weights, ``ewt``. In the case of +:c:func:`ARKodeSStolerances`, this vector has components + +.. code-block:: c + + ewt[i] = 1.0/(reltol*abs(y[i]) + abstol); + +whereas in the case of :c:func:`ARKodeSVtolerances` the vector components +are given by + +.. code-block:: c + + ewt[i] = 1.0/(reltol*abs(y[i]) + abstol[i]); + +This vector is used in all error and convergence tests, which use a +weighted RMS norm on all error-like vectors :math:`v`: + +.. math:: + \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; ewt_i)^2 \right)^{1/2}, + +where :math:`N` is the problem dimension. + +Alternatively, the user may supply a custom function to supply the +``ewt`` vector, through a call to :c:func:`ARKodeWFtolerances`. + + + +.. c:function:: int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) + + This function specifies scalar relative and absolute tolerances. + + :param arkode_mem: pointer to the ARKODE memory block. + :param reltol: scalar relative tolerance. + :param abstol: scalar absolute tolerance. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) + + This function specifies a scalar relative tolerance and a vector + absolute tolerance (a potentially different absolute tolerance for + each vector component). + + :param arkode_mem: pointer to the ARKODE memory block. + :param reltol: scalar relative tolerance. + :param abstol: vector containing the absolute tolerances for each + solution component. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) + + This function specifies a user-supplied function *efun* to compute + the error weight vector ``ewt``. + + :param arkode_mem: pointer to the ARKODE memory block. + :param efun: the name of the function (of type :c:func:`ARKEwtFn`) + that implements the error weight vector computation. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + + .. versionadded:: x.y.z + + +Moreover, for problems involving a non-identity mass matrix +:math:`M \ne I`, the units of the solution vector :math:`y` may differ +from the units of the IVP, posed for the vector :math:`My`. When this +occurs, iterative solvers for the Newton linear systems and the mass +matrix linear systems may require a different set of tolerances. +Since the relative tolerance is dimensionless, but the absolute +tolerance encodes a measure of what is "small" in the units of the +respective quantity, a user may optionally define absolute tolerances +in the equation units. In this case, ARKODE defines a vector of residual +weights, ``rwt`` for measuring convergence of these iterative solvers. +In the case of :c:func:`ARKodeResStolerance`, this vector has components + +.. code-block:: c + + rwt[i] = 1.0/(reltol*abs(My[i]) + rabstol); + +whereas in the case of :c:func:`ARKodeResVtolerance` the vector components +are given by + +.. code-block:: c + + rwt[i] = 1.0/(reltol*abs(My[i]) + rabstol[i]); + +This residual weight vector is used in all iterative solver +convergence tests, which similarly use a weighted RMS norm on all +residual-like vectors :math:`v`: + +.. math:: + \|v\|_{WRMS} = \left( \frac{1}{N} \sum_{i=1}^N (v_i\; rwt_i)^2 \right)^{1/2}, + +where :math:`N` is the problem dimension. + +As with the error weight vector, the user may supply a custom function +to supply the ``rwt`` vector, through a call to +:c:func:`ARKodeResFtolerance`. Further information on all three of +these functions is provided below. + + + +.. c:function:: int ARKodeResStolerance(void* arkode_mem, sunrealtype rabstol) + + This function specifies a scalar absolute residual tolerance. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rabstol: scalar absolute residual tolerance. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol) + + This function specifies a vector of absolute residual tolerances. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rabstol: vector containing the absolute residual + tolerances for each solution component. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) + + This function specifies a user-supplied function *rfun* to compute + the residual weight vector ``rwt``. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rfun: the name of the function (of type :c:func:`ARKRwtFn`) + that implements the residual weight vector computation. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + + .. versionadded:: x.y.z + + +General advice on the choice of tolerances +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For many users, the appropriate choices for tolerance values in +``reltol``, ``abstol``, and ``rabstol`` are a concern. The following pieces +of advice are relevant. + +(1) The scalar relative tolerance ``reltol`` is to be set to control + relative errors. So a value of :math:`10^{-4}` means that errors + are controlled to .01%. We do not recommend using ``reltol`` larger + than :math:`10^{-3}`. On the other hand, ``reltol`` should not be so + small that it is comparable to the unit roundoff of the machine + arithmetic (generally around :math:`10^{-15}` for double-precision). + +(2) The absolute tolerances ``abstol`` (whether scalar or vector) need + to be set to control absolute errors when any components of the + solution vector :math:`y` may be so small that pure relative error + control is meaningless. For example, if :math:`y_i` starts at some + nonzero value, but in time decays to zero, then pure relative + error control on :math:`y_i` makes no sense (and is overly costly) + after :math:`y_i` is below some noise level. Then ``abstol`` (if + scalar) or ``abstol[i]`` (if a vector) needs to be set to that + noise level. If the different components have different noise + levels, then ``abstol`` should be a vector. For example, see the + example problem ``ark_robertson.c``, and the discussion + of it in the ARKODE Examples Documentation :cite:p:`arkode_ex`. In that + problem, the three components vary between 0 and 1, and have + different noise levels; hence the ``atols`` vector therein. It is + impossible to give any general advice on ``abstol`` values, + because the appropriate noise levels are completely + problem-dependent. The user or modeler hopefully has some idea as + to what those noise levels are. + +(3) The residual absolute tolerances ``rabstol`` (whether scalar or + vector) follow a similar explanation as for ``abstol``, except + that these should be set to the noise level of the equation + components, i.e. the noise level of :math:`My`. For problems in + which :math:`M=I`, it is recommended that ``rabstol`` be left + unset, which will default to the already-supplied ``abstol`` + values. + +(4) Finally, it is important to pick all the tolerance values + conservatively, because they control the error committed on each + individual step. The final (global) errors are an accumulation of + those per-step errors, where that accumulation factor is + problem-dependent. A general rule of thumb is to reduce the + tolerances by a factor of 10 from the actual desired limits on + errors. So if you want .01% relative accuracy (globally), a good + choice for ``reltol`` is :math:`10^{-5}`. In any case, it is + a good idea to do a few experiments with the tolerances to see how + the computed solution values vary as tolerances are reduced. + + + +Advice on controlling nonphysical negative values +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In many applications, some components in the true solution are always +positive or non-negative, though at times very small. In the +numerical solution, however, small negative (nonphysical) values +can then occur. In most cases, these values are harmless, and simply +need to be controlled, not eliminated, but in other cases any value +that violates a constraint may cause a simulation to halt. For both of +these scenarios the following pieces of advice are relevant. + +(1) The best way to control the size of unwanted negative computed + values is with tighter absolute tolerances. Again this requires + some knowledge of the noise level of these components, which may + or may not be different for different components. Some + experimentation may be needed. + +(2) If output plots or tables are being generated, and it is important + to avoid having negative numbers appear there (for the sake of + avoiding a long explanation of them, if nothing else), then + eliminate them, but only in the context of the output medium. Then + the internal values carried by the solver are unaffected. Remember + that a small negative value in :math:`y` returned by ARKODE, with + magnitude comparable to ``abstol`` or less, is equivalent to zero + as far as the computation is concerned. + +(3) The user's right-hand side routines :math:`f^E` and :math:`f^I` + should never change a negative value in the solution vector :math:`y` + to a non-negative value in attempt to "fix" this problem, + since this can lead to numerical instability. If the :math:`f^E` + or :math:`f^I` routines cannot tolerate a zero or negative value + (e.g. because there is a square root or log), then the offending + value should be changed to zero or a tiny positive number in a + temporary variable (not in the input :math:`y` vector) for the + purposes of computing :math:`f^E(t, y)` or :math:`f^I(t, y)`. + +(4) Some of ARKODE's time stepping modules support component-wise + constraints on solution components, :math:`y_i < 0`, + :math:`y_i \le 0`, :math:`y_i > 0`, or :math:`y_i \ge 0`, through + the user-callable function :c:func:`ARKodeSetConstraints`. At each + internal time step, if any constraint is violated then ARKODE will + attempt a smaller time step that should not violate this constraint. + This reduced step size is chosen such that the step size is the + largest possible but where the solution component satisfies the + constraint. + +(5) For time-stepping modules that support temporal adaptivity, + positivity and non-negativity constraints on components can also be + enforced by use of the recoverable error return feature in the + user-supplied right-hand side function(s). When a recoverable error + is encountered, ARKODE will retry the step with a smaller step size, + which typically alleviates the problem. However, since this reduced + step size is chosen without knowledge of the solution constraint, it + may be overly conservative. Thus this option involves some additional + overhead cost, and should only be exercised if the above recommendations + are unsuccessful. + + + +.. _ARKODE.Usage.LinearSolvers: + +Linear solver interface functions +------------------------------------------- + +As previously explained, the Newton iterations used in solving +implicit systems within ARKODE require the solution of linear +systems of the form + +.. math:: + \mathcal{A}\left(z_i^{(m)}\right) \delta^{(m+1)} = -G\left(z_i^{(m)}\right) + +where + +.. math:: + \mathcal{A} \approx M - \gamma J, \qquad J = \frac{\partial f^I}{\partial y}. + +ARKODE's ARKLS linear solver interface supports all valid +``SUNLinearSolver`` modules for this task. + +Matrix-based ``SUNLinearSolver`` modules utilize ``SUNMatrix`` objects +to store the approximate Jacobian matrix :math:`J`, the Newton matrix +:math:`\mathcal{A}`, the mass matrix :math:`M`, and, when using direct +solvers, the factorizations used throughout the solution process. + +Matrix-free ``SUNLinearSolver`` modules instead use iterative methods +to solve the Newton systems of equations, and only require the +*action* of the matrix on a vector, :math:`\mathcal{A}v`. With most +of these methods, preconditioning can be done on the left only, on the +right only, on both the left and the right, or not at all. The +exceptions to this rule are SPFGMR that supports right preconditioning +only and PCG that performs symmetric preconditioning. For the +specification of a preconditioner, see the iterative linear solver +portions of :numref:`ARKODE.Usage.OptionalInputs` and +:numref:`ARKODE.Usage.UserSupplied`. + +If preconditioning is done, user-supplied functions should be used to +define left and right preconditioner matrices :math:`P_1` and +:math:`P_2` (either of which could be the identity matrix), such that +the product :math:`P_{1}P_{2}` approximates the Newton matrix +:math:`\mathcal{A} = M - \gamma J`. + +To specify a generic linear solver for ARKODE to use for the Newton +systems, after the call to ``*StepCreate`` but before any +calls to :c:func:`ARKodeEvolve`, the user's program must create the +appropriate ``SUNLinearSolver`` object and call the function +:c:func:`ARKodeSetLinearSolver`, as documented below. To create +the ``SUNLinearSolver`` object, the user may call one of the +SUNDIALS-packaged SUNLinSol module constructor routines via a call of +the form + +.. code:: c + + SUNLinearSolver LS = SUNLinSol_*(...); + +The current list of SUNDIALS-packaged SUNLinSol modules, and their +constructor routines, may be found in chapter :numref:`SUNLinSol`. +Alternately, a user-supplied ``SUNLinearSolver`` module may be created +and used. Specific information on how to create such user-provided +modules may be found in :numref:`SUNLinSol.API.Custom`. + +Once this solver object has been constructed, the user should attach +it to ARKODE via a call to :c:func:`ARKodeSetLinearSolver`. The +first argument passed to this function is the ARKODE memory pointer +returned by ``*StepCreate``; the second argument is the +``SUNLinearSolver`` object created above. The third argument is an +optional ``SUNMatrix`` object to accompany matrix-based +``SUNLinearSolver`` inputs (for matrix-free linear solvers, the third +argument should be ``NULL``). A call to this function initializes the +ARKLS linear solver interface, linking it to the ARKODE integrator, +and allows the user to specify additional parameters and routines +pertinent to their choice of linear solver. + +.. c:function:: int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix J) + + This function specifies the ``SUNLinearSolver`` object that ARKODE + should use, as well as a template Jacobian ``SUNMatrix`` object (if + applicable). + + :param arkode_mem: pointer to the ARKODE memory block. + :param LS: the ``SUNLinearSolver`` object to use. + :param J: the template Jacobian ``SUNMatrix`` object to use (or + ``NULL`` if not applicable). + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_MEM_FAIL: there was a memory allocation failure. + :retval ARKLS_ILL_INPUT: ARKLS is incompatible with the + provided *LS* or *J* input objects, or the current + ``N_Vector`` module. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + If *LS* is a matrix-free linear solver, then the *J* + argument should be ``NULL``. + + If *LS* is a matrix-based linear solver, then the template Jacobian + matrix *J* will be used in the solve process, so if additional + storage is required within the ``SUNMatrix`` object (e.g. for + factorization of a banded matrix), ensure that the input object is + allocated with sufficient size (see the documentation of + the particular SUNMATRIX type in the :numref:`SUNMatrix` for + further information). + + When using sparse linear solvers, it is typically much more + efficient to supply *J* so that it includes the full sparsity + pattern of the Newton system matrices :math:`\mathcal{A} = + M-\gamma J`, even if *J* itself has zeros in nonzero + locations of :math:`M`. The reasoning for this is + that :math:`\mathcal{A}` is constructed in-place, on top of the + user-specified values of *J*, so if the sparsity pattern in *J* is + insufficient to store :math:`\mathcal{A}` then it will need to be + resized internally by ARKODE. + + .. versionadded:: x.y.z + + + + + +.. _ARKODE.Usage.MassMatrixSolvers: + +Mass matrix solver specification functions +------------------------------------------- + +As discussed in :numref:`ARKODE.Mathematics.MassSolve`, if the ODE +system involves a non-identity mass matrix :math:`M\ne I`, then ARKODE +must solve linear systems of the form + +.. math:: + M x = b. + +ARKODE's ARKLS mass-matrix linear solver interface supports all valid +``SUNLinearSolver`` modules for this task. For iterative linear +solvers, user-supplied preconditioning can be applied. For the +specification of a preconditioner, see the iterative linear solver +portions of :numref:`ARKODE.Usage.OptionalInputs` and +:numref:`ARKODE.Usage.UserSupplied`. If preconditioning is to be +performed, user-supplied functions should be used to define left and +right preconditioner matrices :math:`P_1` and :math:`P_2` (either of +which could be the identity matrix), such that the product +:math:`P_{1}P_{2}` approximates the mass matrix :math:`M`. + +To specify a generic linear solver for ARKODE to use for mass matrix +systems, after the call to ``*StepCreate`` but before any +calls to :c:func:`ARKodeEvolve`, the user's program must create the +appropriate ``SUNLinearSolver`` object and call the function +:c:func:`ARKodeSetMassLinearSolver`, as documented below. The +first argument passed to this function is the ARKODE memory +pointer returned by ``*StepCreate``; the second argument is +the desired ``SUNLinearSolver`` object to use for solving mass matrix +systems. The third object is a template ``SUNMatrix`` to use with the +provided ``SUNLinearSolver`` (if applicable). The fourth input is a +flag to indicate whether the mass matrix is time-dependent, +i.e. :math:`M = M(t)`, or not. A call to this function initializes the +ARKLS mass matrix linear solver interface, linking this to the main +ARKODE integrator, and allows the user to specify additional +parameters and routines pertinent to their choice of linear solver. + +Note: if the user program includes linear solvers for *both* the +Newton and mass matrix systems, these must have the same type: + +* If both are matrix-based, then they must utilize the same + ``SUNMatrix`` type, since these will be added when forming the + Newton system matrix :math:`\mathcal{A}`. In this case, both the + Newton and mass matrix linear solver interfaces can use the same + ``SUNLinearSolver`` object, although different solver objects + (e.g. with different solver parameters) are also allowed. + +* If both are matrix-free, then the Newton and mass matrix + ``SUNLinearSolver`` objects must be different. These may even use + different solver algorithms (SPGMR, SPBCGS, etc.), if desired. + For example, if the mass matrix is symmetric but the Jacobian is not, + then PCG may be used for the mass matrix systems and SPGMR for the + Newton systems. + + +.. c:function:: int ARKodeSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep) + + This function specifies the ``SUNLinearSolver`` object + that ARKODE should use for mass matrix systems, as well as a + template ``SUNMatrix`` object. + + :param arkode_mem: pointer to the ARKODE memory block. + :param LS: the ``SUNLinearSolver`` object to use. + :param M: the template mass ``SUNMatrix`` object to use. + :param time_dep: flag denoting whether the mass matrix depends on + the independent variable (:math:`M = M(t)`) or not (:math:`M + \ne M(t)`). ``SUNTRUE`` indicates time-dependence of the + mass matrix. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_MEM_FAIL: there was a memory allocation failure. + :retval ARKLS_ILL_INPUT: ARKLS is incompatible with the + provided *LS* or *M* input objects, or the current + ``N_Vector`` module. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + If *LS* is a matrix-free linear solver, then the *M* + argument should be ``NULL``. + + If *LS* is a matrix-based linear solver, then the template mass + matrix *M* will be used in the solve process, so if additional + storage is required within the ``SUNMatrix`` object (e.g. for + factorization of a banded matrix), ensure that the input object is + allocated with sufficient size. + + If called with *time_dep* set to ``SUNFALSE``, then the mass matrix is + only computed and factored once (or when either ``*StepReInit`` + or :c:func:`ARKodeResize` are called), with the results reused + throughout the entire ARKODE simulation. + + Unlike the system Jacobian, the system mass matrix is not approximated + using finite-differences of any functions provided to ARKODE. Hence, + use of the a matrix-based *LS* requires the user to provide a + mass-matrix constructor routine (see :c:type:`ARKLsMassFn` and + :c:func:`ARKodeSetMassFn`). + + Similarly, the system mass matrix-vector-product is not approximated + using finite-differences of any functions provided to ARKODE. Hence, + use of a matrix-free *LS* requires the user to provide a + mass-matrix-times-vector product routine (see + :c:type:`ARKLsMassTimesVecFn` and :c:func:`ARKodeSetMassTimes`). + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.NonlinearSolvers: + +Nonlinear solver interface functions +------------------------------------------- + +When changing the nonlinear solver in ARKODE, after the +call to ``*StepCreate`` but before any calls to +:c:func:`ARKodeEvolve`, the user's program must create the +appropriate ``SUNNonlinearSolver`` object and call +:c:func:`ARKodeSetNonlinearSolver`, as documented below. If any +calls to :c:func:`ARKodeEvolve` have been made, then ARKODE will +need to be reinitialized by calling ``*StepReInit`` to +ensure that the nonlinear solver is initialized correctly before any +subsequent calls to :c:func:`ARKodeEvolve`. + +The first argument passed to the routine +:c:func:`ARKodeSetNonlinearSolver` is the ARKODE memory pointer +returned by ``*StepCreate``; the second argument passed +to this function is the desired ``SUNNonlinearSolver`` object to use for +solving the nonlinear system for each implicit stage. A call to this +function attaches the nonlinear solver to the main ARKODE integrator. + + +.. c:function:: int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) + + This function specifies the ``SUNNonlinearSolver`` object + that ARKODE should use for implicit stage solves. + + :param arkode_mem: pointer to the ARKODE memory block. + :param NLS: the ``SUNNonlinearSolver`` object to use. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_MEM_FAIL: there was a memory allocation failure. + :retval ARK_ILL_INPUT: ARKODE is incompatible with the + provided *NLS* input object. + :retval ARK_STEPPER_UNSUPPORTED: nonlinear solvers are not supported by + the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + ARKODE will use the Newton ``SUNNonlinearSolver`` module by + default; a call to this routine replaces that module with the + supplied *NLS* object. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.RootFinding: + +Rootfinding initialization function +-------------------------------------- + +As described in :numref:`ARKODE.Mathematics.Rootfinding`, while +solving the IVP, ARKODE's time-stepping modules have the capability to +find the roots of a set of user-defined functions. To activate the +root-finding algorithm, call the following function. This is normally +called only once, prior to the first call to +:c:func:`ARKodeEvolve`, but if the rootfinding problem is to be +changed during the solution, :c:func:`ARKodeRootInit` can also be +called prior to a continuation call to :c:func:`ARKodeEvolve`. + +.. note:: + + The solution is interpolated to the times at which roots are found. + + +.. c:function:: int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) + + Initializes a rootfinding problem to be solved during the + integration of the ODE system. It must be called after + ``*StepCreate``, and before :c:func:`ARKodeEvolve`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nrtfn: number of functions :math:`g_i`, an integer :math:`\ge` 0. + :param g: name of user-supplied function, of type :c:func:`ARKRootFn`, + defining the functions :math:`g_i` whose roots are sought. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_MEM_FAIL: there was a memory allocation failure. + :retval ARK_ILL_INPUT: *nrtfn* is greater than zero but *g* is ``NULL``. + + .. note:: + + To disable the rootfinding feature after it has already + been initialized, or to free memory associated with ARKODE's + rootfinding module, call *ARKodeRootInit* with *nrtfn = 0*. + + Similarly, if a new IVP is to be solved with a call to + ``*StepReInit``, where the new IVP has no rootfinding + problem but the prior one did, then call *ARKodeRootInit* with + *nrtfn = 0*. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.Integration: + +ARKODE solver function +------------------------- + +This is the central step in the solution process -- the call to perform +the integration of the IVP. The input argument *itask* specifies one of two +modes as to where ARKODE is to return a solution. These modes are modified if +the user has set a stop time (with a call to the optional input function +:c:func:`ARKodeSetStopTime`) or has requested rootfinding. + + +.. c:function:: int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype *tret, int itask) + + Integrates the ODE over an interval in :math:`t`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param tout: the next time at which a computed solution is desired. + :param yout: the computed solution vector. + :param tret: the time corresponding to *yout* (output). + :param itask: a flag indicating the job of the solver for the next + user step. + + The *ARK_NORMAL* option causes the solver to take internal + steps until it has just overtaken a user-specified output + time, *tout*, in the direction of integration, + i.e. :math:`t_{n-1} <` *tout* :math:`\le t_{n}` for forward + integration, or :math:`t_{n} \le` *tout* :math:`< t_{n-1}` for + backward integration. It will then compute an approximation + to the solution :math:`y(tout)` by interpolation (as described + in :numref:`ARKODE.Mathematics.Interpolation`). + + The *ARK_ONE_STEP* option tells the solver to only take a + single internal step, :math:`y_{n-1} \to y_{n}`, and return the solution + at that point, :math:`y_{n}`, in the vector *yout*. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_ROOT_RETURN: :c:func:`ARKodeEvolve` succeeded, and + found one or more roots. If the number of root functions, + *nrtfn*, is greater than 1, call + :c:func:`ARKodeGetRootInfo` to see which :math:`g_i` were + found to have a root at (*\*tret*). + :retval ARK_TSTOP_RETURN: :c:func:`ARKodeEvolve` succeeded and + returned at *tstop*. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: one of the inputs to :c:func:`ARKodeEvolve` + is illegal, or some other input to the solver was + either illegal or missing. Details will be + provided in the error message. Typical causes of + this failure: + + (a) A component of the error weight vector became + zero during internal time-stepping. + + (b) The linear solver initialization function (called + by the user after calling ``*StepCreate``) failed + to set the linear solver-specific *lsolve* field in + ``arkode_mem``. + + (c) A root of one of the root functions was found both at a + point :math:`t` and also very near :math:`t`. + + (d) The initial condition violates the inequality constraints. + + :retval ARK_TOO_MUCH_WORK: the solver took *mxstep* internal steps + but could not reach *tout*. The default value for + *mxstep* is *MXSTEP_DEFAULT = 500*. + :retval ARK_TOO_MUCH_ACC: the solver could not satisfy the accuracy + demanded by the user for some internal step. + :retval ARK_ERR_FAILURE: error test failures occurred either too many + times (*ark_maxnef*) during one internal time step + or occurred with :math:`|h| = h_{min}`. + :retval ARK_CONV_FAILURE: either convergence test failures occurred too many + times (*ark_maxncf*) during one internal time step + or occurred with :math:`|h| = h_{min}`. + :retval ARK_LINIT_FAIL: the linear solver's initialization function failed. + :retval ARK_LSETUP_FAIL: the linear solver's setup routine failed in + an unrecoverable manner. + :retval ARK_LSOLVE_FAIL: the linear solver's solve routine failed in + an unrecoverable manner. + :retval ARK_MASSINIT_FAIL: the mass matrix solver's + initialization function failed. + :retval ARK_MASSSETUP_FAIL: the mass matrix solver's setup routine failed. + :retval ARK_MASSSOLVE_FAIL: the mass matrix solver's solve routine failed. + :retval ARK_VECTOROP_ERR: a vector operation error occurred. + + .. note:: + + The input vector *yout* can use the same memory as the + vector *y0* of initial conditions that was passed to + ``*StepCreate``. + + In *ARK_ONE_STEP* mode, *tout* is used only on the first call, and + only to get the direction and a rough scale of the independent + variable. + + All failure return values are negative and so testing the return argument + for negative values will trap all :c:func:`ARKodeEvolve` failures. + + Since interpolation may reduce the accuracy in the reported + solution, if full method accuracy is desired the user should issue + a call to :c:func:`ARKodeSetStopTime` before the call to + :c:func:`ARKodeEvolve` to specify a fixed stop time to + end the time step and return to the user. Upon return from + :c:func:`ARKodeEvolve`, a copy of the internal solution + :math:`y_{n}` will be returned in the vector *yout*. Once the + integrator returns at a *tstop* time, any future testing for + *tstop* is disabled (and can be re-enabled only though a new call + to :c:func:`ARKodeSetStopTime`). + + On any error return in which one or more internal steps were taken + by :c:func:`ARKodeEvolve`, the returned values of *tret* and + *yout* correspond to the farthest point reached in the integration. + On all other error returns, *tret* and *yout* are left unchanged + from those provided to the routine. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.OptionalInputs: + +Optional input functions +------------------------- + +There are numerous optional input parameters that control the behavior +of ARKODE, each of which may be modified from its default value through +calling an appropriate input function. The following tables list all +optional input functions, grouped by which aspect of ARKODE they control. +Detailed information on the calling syntax and arguments for each +function are then provided following each table. + +The optional inputs are grouped into the following categories: + +* General ARKODE options (:ref:`ARKODE.Usage.ARKodeInputTable`), +* Step adaptivity solver options (:ref:`ARKODE.Usage.ARKodeAdaptivityInputTable`), +* Implicit stage solver options (:ref:`ARKODE.Usage.ARKodeSolverInputTable`), +* Linear solver interface options (:ref:`ARKODE.Usage.ARKLsInputs`), and +* Rootfinding options (:ref:`ARKODE.Usage.ARKodeRootfindingInputTable`). + +For the most casual use of ARKODE, relying on the default set of +solver parameters, the reader can skip to section on user-supplied +functions, :numref:`ARKODE.Usage.UserSupplied`. + +We note that, on an error return, all of the optional input functions send an +error message to the error handler function. All error return values are +negative, so a test on the return arguments for negative values will catch all +errors. Finally, a call to an ``ARKodeSet***`` function can generally be made +from the user's calling program at any time *after* creation of the ARKODE +solver via ``*StepCreate``, and, the function exited successfully, takes effect immediately. +``ARKodeSet***`` functions that cannot be called at any time note +this in the "notes" section of the function documentation. + + + +.. _ARKODE.Usage.ARKodeInputTable: + +Optional inputs for ARKODE +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. cssclass:: table-bordered + +================================================ ======================================= ======================= +Optional input Function name Default +================================================ ======================================= ======================= +Return ARKODE parameters to their defaults :c:func:`ARKodeSetDefaults` internal +Set integrator method order :c:func:`ARKodeSetOrder` 4 +Set dense output interpolation type (SPRKStep) :c:func:`ARKodeSetInterpolantType` ``ARK_INTERP_LAGRANGE`` +Set dense output interpolation type (others) :c:func:`ARKodeSetInterpolantType` ``ARK_INTERP_HERMITE`` +Set dense output polynomial degree :c:func:`ARKodeSetInterpolantDegree` 5 +Supply a pointer to a diagnostics output file :c:func:`ARKodeSetDiagnostics` ``NULL`` +Disable time step adaptivity (fixed-step mode) :c:func:`ARKodeSetFixedStep` disabled +Supply an initial step size to attempt :c:func:`ARKodeSetInitStep` estimated +Maximum no. of warnings for :math:`t_n+h = t_n` :c:func:`ARKodeSetMaxHnilWarns` 10 +Maximum no. of internal steps before *tout* :c:func:`ARKodeSetMaxNumSteps` 500 +Maximum absolute step size :c:func:`ARKodeSetMaxStep` :math:`\infty` +Minimum absolute step size :c:func:`ARKodeSetMinStep` 0.0 +Set a value for :math:`t_{stop}` :c:func:`ARKodeSetStopTime` undefined +Interpolate at :math:`t_{stop}` :c:func:`ARKodeSetInterpolateStopTime` ``SUNFALSE`` +Disable the stop time :c:func:`ARKodeClearStopTime` N/A +Supply a pointer for user data :c:func:`ARKodeSetUserData` ``NULL`` +Maximum no. of ARKODE error test failures :c:func:`ARKodeSetMaxErrTestFails` 7 +Set inequality constraints on solution :c:func:`ARKodeSetConstraints` ``NULL`` +Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstrFails` 10 +================================================ ======================================= ======================= + + + + +.. c:function:: int ARKodeSetDefaults(void* arkode_mem) + + Resets all optional input parameters to ARKODE's original + default values. + + :param arkode_mem: pointer to the ARKODE memory block. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + Does not change the *user_data* pointer or any + parameters within the specified time-stepping module. + + Also leaves alone any data structures or options related to + root-finding (those can be reset using :c:func:`ARKodeRootInit`). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetOrder(void* arkode_mem, int ord) + + Specifies the order of accuracy for the IVP integration method. + + :param arkode_mem: pointer to the ARKODE memory block. + :param ord: requested order of accuracy. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: this option is not supported by the time-stepping module. + + .. note:: + + For explicit methods, the allowed values are :math:`2 \le` + *ord* :math:`\le 8`. For implicit methods, the allowed values are + :math:`2\le` *ord* :math:`\le 5`, and for ImEx methods the allowed + values are :math:`2 \le` *ord* :math:`\le 5`. Any illegal input + will result in the default value of 4. + + Since *ord* affects the memory requirements for the internal + ARKODE memory block, it cannot be changed after the first call to + :c:func:`ARKodeEvolve`, unless ``*StepReInit`` is called. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetInterpolantType(void* arkode_mem, int itype) + + Specifies use of the Lagrange or Hermite interpolation modules (used for + dense output -- interpolation of solution output values and implicit + method predictors). + + :param arkode_mem: pointer to the ARKODE memory block. + :param itype: requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_MEM_FAIL: the interpolation module could not be allocated. + :retval ARK_ILL_INPUT: the *itype* argument is not recognized or the + interpolation module has already been initialized. + + .. note:: + + The Hermite interpolation module is described in + :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module + is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. + + This routine frees any previously-allocated interpolation module, and re-creates + one according to the specified argument. Thus any previous calls to + :c:func:`ARKodeSetInterpolantDegree` will be nullified. + + After the first call to :c:func:`ARKodeEvolve` the interpolation type may + not be changed without first calling ``*StepReInit``. + + If this routine is not called, the Hermite interpolation module will be used. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) + + Specifies the degree of the polynomial interpolant + used for dense output (i.e. interpolation of solution output values + and implicit method predictors). + + :param arkode_mem: pointer to the ARKODE memory block. + :param degree: requested polynomial degree. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` or the interpolation module are ``NULL``. + :retval ARK_INTERP_FAIL: this was called after :c:func:`ARKodeEvolve`. + :retval ARK_ILL_INPUT: an argument had an illegal value or the + interpolation module has already been initialized. + + .. note:: + + Allowed values are between 0 and 5. + + This routine should be called *before* :c:func:`ARKodeEvolve`. After the + first call to :c:func:`ARKodeEvolve` the interpolation degree may not be + changed without first calling ``*StepReInit``. + + If a user calls both this routine and :c:func:`ARKodeSetInterpolantType`, then + :c:func:`ARKodeSetInterpolantType` must be called first. + + Since the accuracy of any polynomial interpolant is limited by the + accuracy of the time-step solutions on which it is based, the *actual* + polynomial degree that is used by ARKODE will be the minimum of + :math:`q-1` and the input *degree*, for :math:`q > 1` where :math:`q` is + the order of accuracy for the time integration method. + + When :math:`q=1`, a linear interpolant is the default to ensure values + obtained by the integrator are returned at the ends of the time + interval. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed) + + Disables time step adaptivity within ARKODE, and specifies the + fixed time step size to use for the following internal step(s). + + :param arkode_mem: pointer to the ARKODE memory block. + :param hfixed: value of the fixed step size to use. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + Pass 0.0 to return ARKODE to the default (adaptive-step) mode -- this is only + allowed when using a time-stepping module that supports temporal adaptivity. + + Use of this function is not generally recommended, since it gives no + assurance of the validity of the computed solutions. It is + primarily provided for code-to-code verification testing purposes. + + When using :c:func:`ARKodeSetFixedStep`, any values provided to + the functions + :c:func:`ARKodeSetInitStep`, + :c:func:`ARKodeSetMaxErrTestFails`, + :c:func:`ARKodeSetCFLFraction`, + :c:func:`ARKodeSetErrorBias`, + :c:func:`ARKodeSetFixedStepBounds`, + :c:func:`ARKodeSetMaxCFailGrowth`, + :c:func:`ARKodeSetMaxEFailGrowth`, + :c:func:`ARKodeSetMaxFirstGrowth`, + :c:func:`ARKodeSetMaxGrowth`, + :c:func:`ARKodeSetMinReduction`, + :c:func:`ARKodeSetSafetyFactor`, + :c:func:`ARKodeSetSmallNumEFails`, + :c:func:`ARKodeSetStabilityFn`, and + :c:func:`ARKodeSetAdaptController` + will be ignored, since temporal adaptivity is disabled. + + If both :c:func:`ARKodeSetFixedStep` and + :c:func:`ARKodeSetStopTime` are used, then the fixed step size + will be used for all steps until the final step preceding the + provided stop time (which may be shorter). To resume use of the + previous fixed step size, another call to + :c:func:`ARKodeSetFixedStep` must be made prior to calling + :c:func:`ARKodeEvolve` to resume integration. + + It is *not* recommended that :c:func:`ARKodeSetFixedStep` be used + in concert with :c:func:`ARKodeSetMaxStep` or + :c:func:`ARKodeSetMinStep`, since at best those latter two + routines will provide no useful information to the solver, and at + worst they may interfere with the desired fixed step size. + + .. versionadded:: x.y.z + + + +.. c:function:: int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) + + Specifies the initial time step size ARKODE should use after + initialization, re-initialization, or resetting. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hin: value of the initial step to be attempted :math:`(\ne 0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + Pass 0.0 to use the default value -- this is only + allowed when using a time-stepping module that supports temporal adaptivity. + + By default, ARKODE estimates the initial step size to be + :math:`h = \sqrt{\dfrac{2}{\left\| \ddot{y}\right\|}}`, where + :math:`\ddot{y}` is estimate of the second derivative of the solution + at :math:`t_0`. + + This routine will also reset the step size and error history. + + .. versionadded:: x.y.z + + + +.. c:function:: int ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil) + + Specifies the maximum number of messages issued by the + solver to warn that :math:`t+h=t` on the next internal step, before + ARKODE will instead return with an error. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mxhnil: maximum allowed number of warning messages :math:`(>0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + The default value is 10; set *mxhnil* to zero to specify + this default. + + A negative value indicates that no warning messages should be issued. + + .. versionadded:: x.y.z + + + +.. c:function:: int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps) + + Specifies the maximum number of steps to be taken by the + solver in its attempt to reach the next output time, before ARKODE + will return with an error. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mxsteps: maximum allowed number of internal steps. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + Passing *mxsteps* = 0 results in ARKODE using the + default value (500). + + Passing *mxsteps* < 0 disables the test (not recommended). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax) + + Specifies the upper bound on the magnitude of the time step size. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hmax: maximum absolute value of the time step size :math:`(\ge 0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin) + + Specifies the lower bound on the magnitude of the time step size. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hmin: minimum absolute value of the time step size :math:`(\ge 0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Pass *hmin* :math:`\le 0.0` to set the default value of 0. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop) + + Specifies the value of the independent variable + :math:`t` past which the solution is not to proceed. + + :param arkode_mem: pointer to the ARKODE memory block. + :param tstop: stopping time for the integrator. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + The default is that no stop time is imposed. + + Once the integrator returns at a stop time, any future testing for + ``tstop`` is disabled (and can be reenabled only though a new call to + :c:func:`ARKodeSetStopTime`). + + A stop time not reached before a call to ``*StepReInit`` or + :c:func:`ARKodeReset` will remain active but can be disabled by calling + :c:func:`ARKodeClearStopTime`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) + + Specifies that the output solution should be interpolated when the current + :math:`t` equals the specified ``tstop`` (instead of merely copying the + internal solution :math:`y_n`). + + :param arkode_mem: pointer to the ARKODE memory block. + :param interp: flag indicating to use interpolation (1) or copy (0). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeClearStopTime(void* arkode_mem) + + Disables the stop time set with :c:func:`ARKodeSetStopTime`. + + :param arkode_mem: pointer to the ARKODE memory block. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + The stop time can be reenabled though a new call to + :c:func:`ARKodeSetStopTime`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetUserData(void* arkode_mem, void* user_data) + + Specifies the user data block *user_data* and + attaches it to the main ARKODE memory block. + + :param arkode_mem: pointer to the ARKODE memory block. + :param user_data: pointer to the user data. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + If specified, the pointer to *user_data* is passed to all + user-supplied functions for which it is an argument; otherwise + ``NULL`` is passed. + + If *user_data* is needed in user preconditioner functions, the call to + this function must be made *before* any calls to + :c:func:`ARKodeSetLinearSolver` and/or :c:func:`ARKodeSetMassLinearSolver`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef) + + Specifies the maximum number of error test failures + permitted in attempting one step, before returning with an error. + + :param arkode_mem: pointer to the ARKODE memory block. + :param maxnef: maximum allowed number of error test failures :math:`(>0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + The default value is 7; set *maxnef* :math:`\le 0` + to specify this default. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints) + + Specifies a vector defining inequality constraints for each component of the + solution vector :math:`y`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param constraints: vector of constraint flags. Each component specifies + the type of solution constraint: + + .. math:: + + \texttt{constraints[i]} = \left\{ \begin{array}{rcl} + 0.0 &\Rightarrow\;& \text{no constraint is imposed on}\; y_i,\\ + 1.0 &\Rightarrow\;& y_i \geq 0,\\ + -1.0 &\Rightarrow\;& y_i \leq 0,\\ + 2.0 &\Rightarrow\;& y_i > 0,\\ + -2.0 &\Rightarrow\;& y_i < 0.\\ + \end{array}\right. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: the constraints vector contains illegal values. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + The presence of a non-``NULL`` constraints vector that is not 0.0 + in all components will cause constraint checking to be performed. However, a + call with 0.0 in all components of ``constraints`` will result in an illegal + input return. A ``NULL`` constraints vector will disable constraint checking. + + After a call to :c:func:`ARKodeResize` inequality constraint checking + will be disabled and a call to :c:func:`ARKodeSetConstraints` is + required to re-enable constraint checking. + + Since constraint-handling is performed through cutting time steps that would + violate the constraints, it is possible that this feature will cause some + problems to fail due to an inability to enforce constraints even at the + minimum time step size. Additionally, the features :c:func:`ARKodeSetConstraints` + and :c:func:`ARKodeSetFixedStep` are incompatible, and should not be used + simultaneously. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) + + Specifies the maximum number of constraint failures in a step before ARKODE + will return with an error. + + :param arkode_mem: pointer to the ARKODE memory block. + :param maxfails: maximum allowed number of constrain failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Passing *maxfails* <= 0 results in ARKODE using the + default value (10). + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.ARKodeAdaptivityInputTable: + +Optional inputs for time step adaptivity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The mathematical explanation of ARKODE's time step adaptivity +algorithm, including how each of the parameters below is used within +the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. + + +.. cssclass:: table-bordered + +========================================================= ========================================== ======== +Optional input Function name Default +========================================================= ========================================== ======== +Provide a :c:type:`SUNAdaptController` for ARKODE to use :c:func:`ARKodeSetAdaptController` PID +Adjust the method order used in the controller :c:func:`ERKStepSetAdaptivityAdjustment` -1 +Explicit stability safety factor :c:func:`ARKodeSetCFLFraction` 0.5 +Time step error bias factor :c:func:`ARKodeSetErrorBias` 1.5 +Bounds determining no change in step size :c:func:`ARKodeSetFixedStepBounds` 1.0 1.5 +Maximum step growth factor on convergence fail :c:func:`ARKodeSetMaxCFailGrowth` 0.25 +Maximum step growth factor on error test fail :c:func:`ARKodeSetMaxEFailGrowth` 0.3 +Maximum first step growth factor :c:func:`ARKodeSetMaxFirstGrowth` 10000.0 +Maximum allowed general step growth factor :c:func:`ARKodeSetMaxGrowth` 20.0 +Minimum allowed step reduction factor on error test fail :c:func:`ARKodeSetMinReduction` 0.1 +Time step safety factor :c:func:`ARKodeSetSafetyFactor` 0.96 +Error fails before MaxEFailGrowth takes effect :c:func:`ARKodeSetSmallNumEFails` 2 +Explicit stability function :c:func:`ARKodeSetStabilityFn` none +========================================================= ========================================== ======== + + + +.. c:function:: int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) + + Sets a user-supplied time-step controller object. + + :param arkode_mem: pointer to the ARKODE memory block. + :param C: user-supplied time adaptivity controller. If ``NULL`` then the PID controller + will be created (see :numref:`SUNAdaptController.Soderlind`). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_MEM_FAIL: *C* was ``NULL`` and the PID controller could not be allocated. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetAdaptivityAdjustment(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`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param adjust: adjustment factor (default is -1). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + This should be called prior to calling :c:func:`ARKodeEvolve`, and can only be + reset following a call to ``*StepReInit``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) + + Specifies the fraction of the estimated explicitly stable step to use. + + :param arkode_mem: pointer to the ARKODE memory block. + :param cfl_frac: maximum allowed fraction of explicitly stable step (default is 0.5). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any non-positive parameter will imply a reset to the default + value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) + + Specifies the bias to be applied to the error estimates within + accuracy-based adaptivity strategies. + + :param arkode_mem: pointer to the ARKODE memory block. + :param bias: bias applied to error in accuracy-based time + step estimation (default is 1.5). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value below 1.0 will imply a reset to the default value. + + If both this and one of :c:func:`ARKodeSetAdaptivityMethod` or + :c:func:`ARKodeSetAdaptController` will be called, then this routine must be called + *second*. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) + + Specifies the step growth interval in which the step size will remain unchanged. + + :param arkode_mem: pointer to the ARKODE memory block. + :param lb: lower bound on window to leave step size fixed (default is 1.0). + :param ub: upper bound on window to leave step size fixed (default is 1.5). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any interval *not* containing 1.0 will imply a reset to the default values. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) + + Specifies the maximum step size growth factor upon an algebraic + solver convergence failure on a stage solve within a step, :math:`\eta_{cf}` from + :numref:`ARKODE.Mathematics.Error.Nonlinear`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param etacf: time step reduction factor on a nonlinear solver + convergence failure (default is 0.25). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value outside the interval :math:`(0,1]` will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) + + Specifies the maximum step size growth factor upon multiple successive + accuracy-based error failures in the solver. + + :param arkode_mem: pointer to the ARKODE memory block. + :param etamxf: time step reduction factor on multiple error fails (default is 0.3). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value outside the interval :math:`(0,1]` will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) + + Specifies the maximum allowed growth factor in step size following the very + first integration step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param etamx1: maximum allowed growth factor after the first time + step (default is 10000.0). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value :math:`\le 1.0` will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) + + Specifies the maximum allowed growth factor in step size between + consecutive steps in the integration process. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mx_growth: maximum allowed growth factor between consecutive time steps (default is 20.0). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value :math:`\le 1.0` will imply a reset to the default + value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min) + + Specifies the minimum allowed reduction factor in step size between + step attempts, resulting from a temporal error failure in the integration + process. + + :param arkode_mem: pointer to the ARKODE memory block. + :param eta_min: minimum allowed reduction factor in time step after an error + test failure (default is 0.1). + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value outside the interval :math:`(0,1)` will imply a reset to + the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety) + + Specifies the safety factor to be applied to the accuracy-based + estimated step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param safety: safety factor applied to accuracy-based time step (default is 0.96). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value :math:`\le 0` will imply a reset to the default + value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef) + + Specifies the threshold for "multiple" successive error failures + before the *etamxf* parameter from + :c:func:`ARKodeSetMaxEFailGrowth` is applied. + + :param arkode_mem: pointer to the ARKODE memory block. + :param small_nef: bound to determine 'multiple' for *etamxf* (default is 2). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + Any value :math:`\le 0` will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) + + Sets the problem-dependent function to estimate a stable + time step size for the explicit portion of the ODE system. + + :param arkode_mem: pointer to the ARKODE memory block. + :param EStab: name of user-supplied stability function. + :param estab_data: pointer to user data passed to *EStab* every time + it is called. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + This function should return an estimate of the absolute + value of the maximum stable time step for the explicit portion of + the ODE system. It is not required, since accuracy-based + adaptivity may be sufficient for retaining stability, but this can + be quite useful for problems where the explicit right-hand side + function :math:`f^E(t,y)` contains stiff terms. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.ARKodeSolverInputTable: + +Optional inputs for implicit stage solves +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The mathematical explanation for the nonlinear solver strategies used +by ARKODE, including how each of the parameters below is used within +the code, is provided in :numref:`ARKODE.Mathematics.Nonlinear`. + + +.. cssclass:: table-bordered + +============================================================== ====================================== ============ +Optional input Function name Default +============================================================== ====================================== ============ +Specify that the implicit RHS is linear :c:func:`ARKodeSetLinear` ``SUNFALSE`` +Specify that the implicit RHS nonlinear :c:func:`ARKodeSetNonlinear` ``SUNTRUE`` +Implicit predictor method :c:func:`ARKodeSetPredictorMethod` 0 +User-provided implicit stage predictor :c:func:`ARKodeSetStagePredictFn` ``NULL`` +RHS function for nonlinear system evaluations :c:func:`ARKodeSetNlsRhsFn` ``NULL`` +Maximum number of nonlinear iterations :c:func:`ARKodeSetMaxNonlinIters` 3 +Coefficient in the nonlinear convergence test :c:func:`ARKodeSetNonlinConvCoef` 0.1 +Nonlinear convergence rate constant :c:func:`ARKodeSetNonlinCRDown` 0.3 +Nonlinear residual divergence ratio :c:func:`ARKodeSetNonlinRDiv` 2.3 +Maximum number of convergence failures :c:func:`ARKodeSetMaxConvFails` 10 +Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeSetDeduceImplicitRhs` ``SUNFALSE`` +============================================================== ====================================== ============ + + + + + +.. c:function:: int ARKodeSetLinear(void* arkode_mem, int timedepend) + + Specifies that the implicit portion of the problem is linear. + + :param arkode_mem: pointer to the ARKODE memory block. + :param timedepend: flag denoting whether the Jacobian of + :math:`f^I(t,y)` is time-dependent (1) or not (0). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Tightens the linear solver tolerances and takes only a + single Newton iteration. Calls :c:func:`ARKodeSetDeltaGammaMax` + to enforce Jacobian recomputation when the step size ratio changes + by more than 100 times the unit roundoff (since nonlinear + convergence is not tested). Only applicable when used in + combination with the modified or inexact Newton iteration (not the + fixed-point solver). + + When :math:`f^I(t,y)` is time-dependent, all linear solver structures + (Jacobian, preconditioner) will be updated preceding *each* implicit + stage. Thus one must balance the relative costs of such recomputation + against the benefits of requiring only a single Newton linear solve. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNonlinear(void* arkode_mem) + + Specifies that the implicit portion of the problem is nonlinear. + + :param arkode_mem: pointer to the ARKODE memory block. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is the default behavior of ARKODE, so the function + is primarily useful to undo a previous call to + :c:func:`ARKodeSetLinear`. Calls + :c:func:`ARKodeSetDeltaGammaMax` to reset the step size ratio + threshold to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetPredictorMethod(void* arkode_mem, int method) + + Specifies the method from :numref:`ARKODE.Mathematics.Predictors` to use + for predicting implicit solutions. + + :param arkode_mem: pointer to the ARKODE memory block. + :param method: method choice (0 :math:`\le` *method* :math:`\le` 4): + + * 0 is the trivial predictor, + + * 1 is the maximum order (dense output) predictor, + + * 2 is the variable order predictor, that decreases the + polynomial degree for more distant RK stages, + + * 3 is the cutoff order predictor, that uses the maximum order + for early RK stages, and a first-order predictor for distant + RK stages, + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default value is 0. If *method* is set to an + undefined value, this default predictor will be used. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) + + Sets the user-supplied function to update the implicit stage predictor prior to + execution of the nonlinear or linear solver algorithms that compute the implicit stage solution. + + :param arkode_mem: pointer to the ARKODE memory block. + :param PredictStage: name of user-supplied predictor function. If ``NULL``, then any + previously-provided stage prediction function will be disabled. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + See :numref:`ARKODE.Usage.StagePredictFn` for more information on + this user-supplied routine. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) + + Specifies an alternative implicit right-hand side function for evaluating + :math:`f^I(t,y)` within nonlinear system function evaluations + :eq:`ARKODE_Residual_MeqI` - :eq:`ARKODE_Residual_MTimeDep`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nls_fi: the alternative C function for computing the right-hand side + function :math:`f^I(t,y)` in the ODE. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default is to use the implicit right-hand side function + provided to :c:func:`ARKodeCreate` in nonlinear system functions. If the + input implicit right-hand side function is ``NULL``, the default is used. + + When using a non-default nonlinear solver, this function must be called + *after* :c:func:`ARKodeSetNonlinearSolver`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) + + Specifies the maximum number of nonlinear solver + iterations permitted per implicit stage solve within each time step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param maxcor: maximum allowed solver iterations per stage :math:`(>0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value or if the SUNNONLINSOL module is ``NULL``. + :retval ARK_NLS_OP_ERR: the SUNNONLINSOL object returned a failure flag. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default value is 3; set *maxcor* :math:`\le 0` + to specify this default. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) + + Specifies the safety factor :math:`\epsilon` used within the nonlinear + solver convergence test :eq:`ARKODE_NonlinearTolerance`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nlscoef: coefficient in nonlinear solver convergence test :math:`(>0.0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default value is 0.1; set *nlscoef* :math:`\le 0` + to specify this default. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) + + Specifies the constant :math:`c_r` used in estimating the nonlinear solver convergence rate :eq:`ARKODE_NonlinearCRate`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param crdown: nonlinear convergence rate estimation constant (default is 0.3). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Any non-positive parameter will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) + + Specifies the nonlinear correction threshold :math:`r_{div}` from + :eq:`ARKODE_NonlinearDivergence`, beyond which the iteration will be declared divergent. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rdiv: tolerance on nonlinear correction size ratio to + declare divergence (default is 2.3). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Any non-positive parameter will imply a reset to the default value. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) + + Specifies the maximum number of nonlinear solver convergence + failures permitted during one step, :math:`max_{ncf}` from + :numref:`ARKODE.Mathematics.Error.Nonlinear`, before ARKODE will return with + an error. + + :param arkode_mem: pointer to the ARKODE memory block. + :param maxncf: maximum allowed nonlinear solver convergence failures + per step :math:`(>0)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default value is 10; set *maxncf* :math:`\le 0` + to specify this default. + + Upon each convergence failure, ARKODE will first call the Jacobian + setup routine and try again (if a Newton method is used). If a + convergence failure still occurs, the time step size is reduced by + the factor *etacf* (set within :c:func:`ARKodeSetMaxCFailGrowth`). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) + + Specifies if implicit stage derivatives are deduced without evaluating + :math:`f^I`. See :numref:`ARKODE.Mathematics.Nonlinear` for more details. + + :param arkode_mem: pointer to the ARKODE memory block. + :param deduce: if ``SUNFALSE`` (default), the stage derivative is obtained + by evaluating :math:`f^I` with the stage solution returned from the + nonlinear solver. If ``SUNTRUE``, the stage derivative is deduced + without an additional evaluation of :math:`f^I`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.ARKLsInputs: + + +Linear solver interface optional input functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The mathematical explanation of the linear solver methods +available to ARKODE is provided in :numref:`ARKODE.Mathematics.Linear`. We group +the user-callable routines into four categories: general routines concerning +the update frequency for matrices and/or preconditioners, optional inputs for +matrix-based linear solvers, optional inputs for matrix-free linear solvers, +and optional inputs for iterative linear solvers. We note that the +matrix-based and matrix-free groups are mutually exclusive, whereas the +"iterative" tag can apply to either case. + + + +.. _ARKODE.Usage.ARKLsInputs.General: + +.. index:: + single: optional input; generic linear solver interface (ARKODE) + +Optional inputs for the ARKLS linear solver interface +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +As discussed in :numref:`ARKODE.Mathematics.Linear.Setup`, ARKODE +strives to reuse matrix and preconditioner data for as many solves as +possible to amortize the high costs of matrix construction and +factorization. To that end, ARKODE provides user-callable +routines to modify this behavior. Recall that the +Newton system matrices that arise within an implicit stage solve are +:math:`\mathcal{A}(t,z) \approx M(t) - \gamma J(t,z)`, where the +implicit right-hand side function has Jacobian matrix +:math:`J(t,z) = \frac{\partial f^I(t,z)}{\partial z}`. + +The matrix or preconditioner for :math:`\mathcal{A}` can only be +updated within a call to the linear solver "setup" routine. In +general, the frequency with which the linear solver setup routine is +called may be controlled with the *msbp* argument to +:c:func:`ARKodeSetLSetupFrequency`. When this occurs, the +validity of :math:`\mathcal{A}` for successive time steps +intimately depends on whether the corresponding :math:`\gamma` and +:math:`J` inputs remain valid. + +At each call to the linear solver setup routine the decision to update +:math:`\mathcal{A}` with a new value of :math:`\gamma`, and to reuse +or reevaluate Jacobian information, depends on several factors including: + +* the success or failure of previous solve attempts, +* the success or failure of the previous time step attempts, +* the change in :math:`\gamma` from the value used when constructing :math:`\mathcal{A}`, and +* the number of steps since Jacobian information was last evaluated. + +Jacobian information is considered out-of-date when :math:`msbj` or more steps +have been completed since the last update, in which case it will be recomputed during the next +linear solver setup call. The value of :math:`msbj` is controlled with the +``msbj`` argument to :c:func:`ARKodeSetJacEvalFrequency`. + +For linear-solvers with user-supplied preconditioning the above factors are used +to determine whether to recommend updating the Jacobian information in the +preconditioner (i.e., whether to set *jok* to ``SUNFALSE`` in calling the +user-supplied :c:type:`ARKLsPrecSetupFn`). For matrix-based linear solvers +these factors determine whether the matrix :math:`J(t,y) = \frac{\partial f^I(t,y)}{\partial y}` +should be updated (either with an internal finite difference approximation or +a call to the user-supplied :c:type:`ARKLsJacFn`); if not then the previous +value is reused and the system matrix :math:`\mathcal{A}(t,y) \approx M(t) - \gamma J(t,y)` +is recomputed using the current :math:`\gamma` value. + + + +.. _ARKODE.Usage.ARKLsInputs.General.Table: +.. table:: Optional inputs for the ARKLS linear solver interface + + ============================================= ==================================== ============ + Optional input Function name Default + ============================================= ==================================== ============ + Max change in step signaling new :math:`J` :c:func:`ARKodeSetDeltaGammaMax` 0.2 + Linear solver setup frequency :c:func:`ARKodeSetLSetupFrequency` 20 + Jacobian / preconditioner update frequency :c:func:`ARKodeSetJacEvalFrequency` 51 + ============================================= ==================================== ============ + + +.. c:function:: int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) + + Specifies a scaled step size ratio tolerance, :math:`\Delta\gamma_{max}` from + :numref:`ARKODE.Mathematics.Linear.Setup`, beyond which the linear solver + setup routine will be signaled. + + :param arkode_mem: pointer to the ARKODE memory block. + :param dgmax: tolerance on step size ratio change before calling + linear solver setup routine (default is 0.2). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Any non-positive parameter will imply a reset to the default value. + + .. versionadded:: x.y.z + +.. index:: + single: optional input; linear solver setup frequency (ARKODE) + +.. c:function:: int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) + + Specifies the frequency of calls to the linear solver setup + routine, :math:`msbp` from :numref:`ARKODE.Mathematics.Linear.Setup`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param msbp: the linear solver setup frequency. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Positive values of **msbp** specify the linear solver setup frequency. For + example, an input of 1 means the setup function will be called every time + step while an input of 2 means it will be called called every other time + step. If **msbp** is 0, the default value of 20 will be used. A negative + value forces a linear solver step at each implicit stage. + + .. versionadded:: x.y.z + + +.. index:: + single: optional input; Jacobian update frequency (ARKODE) + single: optional input; preconditioner update frequency (ARKODE) + +.. c:function:: int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj) + + Specifies the number of steps after which the Jacobian information is + considered out-of-date, :math:`msbj` from :numref:`ARKODE.Mathematics.Linear.Setup`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param msbj: the Jacobian re-computation or preconditioner update frequency. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + If ``nstlj`` is the step number at which the Jacobian information was + lasted updated and ``nst`` is the current step number, + ``nst - nstlj >= msbj`` indicates that the Jacobian information will be updated + during the next linear solver setup call. + + As the Jacobian update frequency is only checked *within* calls to the + linear solver setup routine, Jacobian information may be more than + ``msbj`` steps old when updated depending on when a linear solver setup + call occurs. See :numref:`ARKODE.Mathematics.Linear.Setup` + for more information on when linear solver setups are performed. + + Passing a value *msbj* :math:`\le 0` indicates to use the + default value of 51. + + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`ARKodeSetLinearSolver`. + + .. versionadded:: x.y.z + + + + + + +.. _ARKODE.Usage.ARKLsInputs.MatrixBased: + +Optional inputs for matrix-based ``SUNLinearSolver`` modules +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +.. cssclass:: table-bordered + +========================================= ======================================== ============= +Optional input Function name Default +========================================= ======================================== ============= +Jacobian function :c:func:`ARKodeSetJacFn` ``DQ`` +Linear system function :c:func:`ARKodeSetLinSysFn` internal +Mass matrix function :c:func:`ARKodeSetMassFn` none +Enable or disable linear solution scaling :c:func:`ARKodeSetLinearSolutionScaling` on +========================================= ======================================== ============= + +When using matrix-based linear solver modules, the ARKLS solver interface needs +a function to compute an approximation to the Jacobian matrix :math:`J(t,y)` or +the linear system :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)`. + +For :math:`J(t,y)`, the ARKLS interface is packaged with a routine that can approximate +:math:`J` if the user has selected either the :ref:`SUNMATRIX_DENSE <SUNMatrix.Dense>` or +:ref:`SUNMATRIX_BAND <SUNMatrix.Band>` objects. Alternatively, +the user can supply a custom Jacobian function of type :c:func:`ARKLsJacFn` -- this is +*required* when the user selects other matrix formats. To specify a user-supplied +Jacobian function, ARKODE provides the function :c:func:`ARKodeSetJacFn`. + +Alternatively, a function of type :c:func:`ARKLsLinSysFn` can be provided to +evaluate the matrix :math:`\mathcal{A}(t,y)`. By default, ARKLS uses an +internal linear system function leveraging the SUNMATRIX API to form the matrix +:math:`\mathcal{A}(t,y)` by combining the matrices :math:`M(t)` and :math:`J(t,y)`. +To specify a user-supplied linear system function instead, ARKODE provides the function +:c:func:`ARKodeSetLinSysFn`. + +If the ODE system involves a non-identity mass matrix, :math:`M\ne I`, matrix-based linear +solver modules require a function to compute an approximation to the mass matrix :math:`M(t)`. +There is no default difference quotient approximation (for any matrix type), so this +routine must be supplied by the user. This function must be of type +:c:func:`ARKLsMassFn`, and should be set using the function +:c:func:`ARKodeSetMassFn`. + +In either case (:math:`J(t,y)` versus :math:`\mathcal{A}(t,y)` is supplied) the matrix +information will be updated infrequently to reduce matrix construction and, with direct +solvers, factorization costs. As a result the value of :math:`\gamma` may not be current +and a scaling factor is applied to the solution of the linear system to account for +the lagged value of :math:`\gamma`. See :numref:`SUNLinSol.Lagged_matrix` for more details. +The function :c:func:`ARKodeSetLinearSolutionScaling` can be used to disable this +scaling when necessary, e.g., when providing a custom linear solver that updates the +matrix using the current :math:`\gamma` as part of the solve. + +The ARKLS interface passes the user data pointer to the Jacobian, linear +system, and mass matrix functions. This allows the user to create an arbitrary +structure with relevant problem data and access it during the execution of the +user-supplied Jacobian, linear system or mass matrix functions, without using global +data in the program. The user data pointer may be specified through +:c:func:`ARKodeSetUserData`. + + + +.. c:function:: int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac) + + Specifies the Jacobian approximation routine to + be used for the matrix-based solver with the ARKLS interface. + + :param arkode_mem: pointer to the ARKODE memory block. + :param jac: name of user-supplied Jacobian approximation function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This routine must be called after the ARKLS linear + solver interface has been initialized through a call to + :c:func:`ARKodeSetLinearSolver`. + + By default, ARKLS uses an internal difference quotient function for + the :ref:`SUNMATRIX_DENSE <SUNMatrix.Dense>` and + :ref:`SUNMATRIX_BAND <SUNMatrix.Band>` modules. If ``NULL`` is passed + in for *jac*, this default is used. An error will occur if no *jac* is + supplied when using other matrix types. + + The function type :c:func:`ARKLsJacFn` is described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) + + Specifies the linear system approximation routine to be used for the + matrix-based solver with the ARKLS interface. + + :param arkode_mem: pointer to the ARKODE memory block. + :param linsys: name of user-supplied linear system approximation function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This routine must be called after the ARKLS linear + solver interface has been initialized through a call to + :c:func:`ARKodeSetLinearSolver`. + + By default, ARKLS uses an internal linear system function that leverages the + SUNMATRIX API to form the system :math:`M - \gamma J`. If ``NULL`` is passed + in for *linsys*, this default is used. + + The function type :c:func:`ARKLsLinSysFn` is described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass) + + Specifies the mass matrix approximation routine to be used for the + matrix-based solver with the ARKLS interface. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mass: name of user-supplied mass matrix approximation function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_MASSMEM_NULL: the mass matrix solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This routine must be called after the ARKLS mass matrix + solver interface has been initialized through a call to + :c:func:`ARKodeSetMassLinearSolver`. + + Since there is no default difference quotient function for mass + matrices, *mass* must be non-``NULL``. + + The function type :c:func:`ARKLsMassFn` is described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) + + Enables or disables scaling the linear system solution to account for a + change in :math:`\gamma` in the linear system. For more details see + :numref:`SUNLinSol.Lagged_matrix`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param onoff: flag to enable (``SUNTRUE``) or disable (``SUNFALSE``) + scaling. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_ILL_INPUT: the attached linear solver is not matrix-based. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Linear solution scaling is enabled by default when a matrix-based + linear solver is attached. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.ARKLsInputs.MatrixFree: + +Optional inputs for matrix-free ``SUNLinearSolver`` modules +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +.. cssclass:: table-bordered + +================================================== ================================= ================== +Optional input Function name Default +================================================== ================================= ================== +:math:`Jv` functions (*jtimes* and *jtsetup*) :c:func:`ARKodeSetJacTimes` DQ, none +:math:`Jv` DQ rhs function (*jtimesRhsFn*) :c:func:`ARKodeSetJacTimesRhsFn` fi +:math:`Mv` functions (*mtimes* and *mtsetup*) :c:func:`ARKodeSetMassTimes` none, none +================================================== ================================= ================== + + +As described in :numref:`ARKODE.Mathematics.Linear`, when solving +the Newton linear systems with matrix-free methods, the ARKLS +interface requires a *jtimes* function to compute an approximation to +the product between the Jacobian matrix +:math:`J(t,y)` and a vector :math:`v`. The user can supply a custom +Jacobian-times-vector approximation function, or use the default +internal difference quotient function that comes with the ARKLS +interface. + +A user-defined Jacobian-vector function must be of type +:c:type:`ARKLsJacTimesVecFn` and can be specified through a call +to :c:func:`ARKodeSetJacTimes` (see :numref:`ARKODE.Usage.UserSupplied` +for specification details). As with the +user-supplied preconditioner functions, the evaluation and +processing of any Jacobian-related data needed by the user's +Jacobian-times-vector function is done in the optional user-supplied +function of type :c:type:`ARKLsJacTimesSetupFn` (see +:numref:`ARKODE.Usage.UserSupplied` for specification details). As with +the preconditioner functions, a pointer to the user-defined +data structure, *user_data*, specified through +:c:func:`ARKodeSetUserData` (or a ``NULL`` pointer otherwise) is +passed to the Jacobian-times-vector setup and product functions each +time they are called. + + +.. c:function:: int ARKodeSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, ARKLsJacTimesVecFn jtimes) + + Specifies the Jacobian-times-vector setup and product functions. + + :param arkode_mem: pointer to the ARKODE memory block. + :param jtsetup: user-defined Jacobian-vector setup function. + Pass ``NULL`` if no setup is necessary. + :param jtimes: user-defined Jacobian-vector product function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_SUNLS_FAIL: an error occurred when setting up + the Jacobian-vector product in the ``SUNLinearSolver`` + object used by the ARKLS interface. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default is to use an internal finite difference + quotient for *jtimes* and to leave out *jtsetup*. If ``NULL`` is + passed to *jtimes*, these defaults are used. A user may + specify non-``NULL`` *jtimes* and ``NULL`` *jtsetup* inputs. + + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`ARKodeSetLinearSolver`. + + The function types :c:type:`ARKLsJacTimesSetupFn` and + :c:type:`ARKLsJacTimesVecFn` are described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +When using the internal difference quotient the user may optionally supply +an alternative implicit right-hand side function for use in the Jacobian-vector +product approximation by calling :c:func:`ARKodeSetJacTimesRhsFn`. The +alternative implicit right-hand side function should compute a suitable (and +differentiable) approximation to the :math:`f^I` function provided to +``*StepCreate``. For example, as done in :cite:p:`dorr2010numerical`, +the alternative function may use lagged values when evaluating a nonlinearity +in :math:`f^I` to avoid differencing a potentially non-differentiable factor. +We note that in many instances this same :math:`f^I` routine would also have +been desirable for the nonlinear solver, in which case the user should specify +this through calls to *both* :c:func:`ARKodeSetJacTimesRhsFn` and +:c:func:`ARKodeSetNlsRhsFn`. + + +.. c:function:: int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) + + Specifies an alternative implicit right-hand side function for use in the + internal Jacobian-vector product difference quotient approximation. + + :param arkode_mem: pointer to the ARKODE memory block. + :param jtimesRhsFn: the name of the C function (of type + :c:func:`ARKRhsFn`) defining the alternative right-hand side function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default is to use the implicit right-hand side function + provided to ``*StepCreate`` in the internal difference quotient. If + the input implicit right-hand side function is ``NULL``, the default is used. + + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`ARKodeSetLinearSolver`. + + .. versionadded:: x.y.z + + +Similarly, if a problem involves a non-identity mass matrix, +:math:`M\ne I`, then matrix-free solvers require a *mtimes* function +to compute an approximation to the product between the mass matrix +:math:`M(t)` and a vector :math:`v`. This function must be +user-supplied since there is no default value, it must be +of type :c:func:`ARKLsMassTimesVecFn`, and can be specified +through a call to the :c:func:`ARKodeSetMassTimes` routine. +Similarly to the user-supplied preconditioner functions, any evaluation +and processing of any mass matrix-related data needed by the user's +mass-matrix-times-vector function may be done in an optional user-supplied +function of type :c:type:`ARKLsMassTimesSetupFn` (see +:numref:`ARKODE.Usage.UserSupplied` for specification details). + + + +.. c:function:: int ARKodeSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, ARKLsMassTimesVecFn mtimes, void* mtimes_data) + + Specifies the mass matrix-times-vector setup and product functions. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mtsetup: user-defined mass matrix-vector setup function. + Pass ``NULL`` if no setup is necessary. + :param mtimes: user-defined mass matrix-vector product function. + :param mtimes_data: a pointer to user data, that will be supplied + to both the *mtsetup* and *mtimes* functions. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_MASSMEM_NULL: the mass matrix solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_SUNLS_FAIL: an error occurred when setting up + the mass-matrix-vector product in the ``SUNLinearSolver`` + object used by the ARKLS interface. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + There is no default finite difference quotient for + *mtimes*, so if using the ARKLS mass matrix solver interface with + NULL-valued SUNMATRIX input :math:`M`, and this routine is called + with NULL-valued *mtimes*, an error will occur. A user may + specify ``NULL`` for *mtsetup*. + + This function must be called *after* the ARKLS mass + matrix solver interface has been initialized through a call to + :c:func:`ARKodeSetMassLinearSolver`. + + The function types :c:type:`ARKLsMassTimesSetupFn` and + :c:type:`ARKLsMassTimesVecFn` are described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.ARKLsInputs.Iterative: + +Optional inputs for iterative ``SUNLinearSolver`` modules +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +.. cssclass:: table-bordered + +==================================================== ====================================== ================== +Optional input Function name Default +==================================================== ====================================== ================== +Newton preconditioning functions :c:func:`ARKodeSetPreconditioner` ``NULL``, ``NULL`` +Mass matrix preconditioning functions :c:func:`ARKodeSetMassPreconditioner` ``NULL``, ``NULL`` +Newton linear and nonlinear tolerance ratio :c:func:`ARKodeSetEpsLin` 0.05 +Mass matrix linear and nonlinear tolerance ratio :c:func:`ARKodeSetMassEpsLin` 0.05 +Newton linear solve tolerance conversion factor :c:func:`ARKodeSetLSNormFactor` vector length +Mass matrix linear solve tolerance conversion factor :c:func:`ARKodeSetMassLSNormFactor` vector length +==================================================== ====================================== ================== + + +As described in :numref:`ARKODE.Mathematics.Linear`, when using +an iterative linear solver the user may supply a preconditioning +operator to aid in solution of the system. This operator consists of +two user-supplied functions, *psetup* and *psolve*, that are supplied +to ARKODE using either the function +:c:func:`ARKodeSetPreconditioner` (for preconditioning the +Newton system), or the function +:c:func:`ARKodeSetMassPreconditioner` (for preconditioning the +mass matrix system). The *psetup* function supplied to these routines +should handle evaluation and preprocessing of any Jacobian or +mass-matrix data needed by the user's preconditioner solve function, +*psolve*. The user data pointer received through +:c:func:`ARKodeSetUserData` (or a pointer to ``NULL`` if user data +was not specified) is passed to the *psetup* and *psolve* functions. +This allows the user to create an arbitrary +structure with relevant problem data and access it during the +execution of the user-supplied preconditioner functions without using +global data in the program. If preconditioning is supplied for both +the Newton and mass matrix linear systems, it is expected that the +user will supply different *psetup* and *psolve* function for each. + +Also, as described in :numref:`ARKODE.Mathematics.Error.Linear`, the +ARKLS interface requires that iterative linear solvers stop when +the norm of the preconditioned residual satisfies + +.. math:: + \|r\| \le \frac{\epsilon_L \epsilon}{10} + +where the default :math:`\epsilon_L = 0.05` may be modified by +the user through the :c:func:`ARKodeSetEpsLin` function. + + +.. c:function:: int ARKodeSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) + + Specifies the user-supplied preconditioner setup and solve functions. + + :param arkode_mem: pointer to the ARKODE memory block. + :param psetup: user defined preconditioner setup function. Pass + ``NULL`` if no setup is needed. + :param psolve: user-defined preconditioner solve function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_SUNLS_FAIL: an error occurred when setting up preconditioning + in the ``SUNLinearSolver`` object used + by the ARKLS interface. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The default is ``NULL`` for both arguments (i.e., no + preconditioning). + + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`ARKodeSetLinearSolver`. + + Both of the function types :c:func:`ARKLsPrecSetupFn` and + :c:func:`ARKLsPrecSolveFn` are described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, ARKLsMassPrecSolveFn psolve) + + Specifies the mass matrix preconditioner setup and solve functions. + + :param arkode_mem: pointer to the ARKODE memory block. + :param psetup: user defined preconditioner setup function. Pass + ``NULL`` if no setup is to be done. + :param psolve: user-defined preconditioner solve function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARKLS_SUNLS_FAIL: an error occurred when setting up preconditioning + in the ``SUNLinearSolver`` object used + by the ARKLS interface. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This function must be called *after* the ARKLS mass + matrix solver interface has been initialized through a call to + :c:func:`ARKodeSetMassLinearSolver`. + + The default is ``NULL`` for both arguments (i.e. no + preconditioning). + + Both of the function types :c:func:`ARKLsMassPrecSetupFn` and + :c:func:`ARKLsMassPrecSolveFn` are described in + :numref:`ARKODE.Usage.UserSupplied`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac) + + Specifies the factor :math:`\epsilon_L` by which the tolerance on + the nonlinear iteration is multiplied to get a tolerance on the + linear iteration. + + :param arkode_mem: pointer to the ARKODE memory block. + :param eplifac: linear convergence safety factor. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + Passing a value *eplifac* :math:`\le 0` indicates to use the + default value of 0.05. + + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`ARKodeSetLinearSolver`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) + + Specifies the factor by which the tolerance on the nonlinear + iteration is multiplied to get a tolerance on the mass matrix + linear iteration. + + :param arkode_mem: pointer to the ARKODE memory block. + :param eplifac: linear convergence safety factor. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_MASSMEM_NULL: the mass matrix solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: an input had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This function must be called *after* the ARKLS mass + matrix solver interface has been initialized through a call to + :c:func:`ARKodeSetMassLinearSolver`. + + Passing a value *eplifac* :math:`\le 0` indicates to use the default value + of 0.05. + + .. versionadded:: x.y.z + + +Since iterative linear solver libraries typically consider linear residual +tolerances using the :math:`L_2` norm, whereas ARKODE focuses on errors +measured in the WRMS norm :eq:`ARKODE_WRMS_NORM`, the ARKLS interface internally +converts between these quantities when interfacing with linear solvers, + +.. math:: + \text{tol}_{L2} = \textit{nrmfac}\ \ \text{tol}_{WRMS}. + :label: ARKODE_NRMFAC + +Prior to the introduction of :c:func:`N_VGetLength` in SUNDIALS v5.0.0 the +value of :math:`nrmfac` was computed using the vector dot product. Now, the +functions :c:func:`ARKodeSetLSNormFactor` and :c:func:`ARKodeSetMassLSNormFactor` +allow for additional user control over these conversion factors. + + +.. c:function:: int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) + + Specifies the factor to use when converting from the integrator tolerance + (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system + solves. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nrmfac: the norm conversion factor. If *nrmfac* is: + + :math:`> 0` then the provided value is used. + + :math:`= 0` then the conversion factor is computed using the vector + length i.e., ``nrmfac = sqrt(N_VGetLength(y))`` (*default*). + + :math:`< 0` then the conversion factor is computed using the vector dot + product i.e., ``nrmfac = sqrt(N_VDotProd(v,v))`` where all the entries + of ``v`` are one. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`ARKodeSetLinearSolver`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) + + Specifies the factor to use when converting from the integrator tolerance + (WRMS norm) to the linear solver tolerance (L2 norm) for mass matrix linear + system solves. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nrmfac: the norm conversion factor. If *nrmfac* is: + + :math:`> 0` then the provided value is used. + + :math:`= 0` then the conversion factor is computed using the vector + length i.e., ``nrmfac = sqrt(N_VGetLength(y))`` (*default*). + + :math:`< 0` then the conversion factor is computed using the vector dot + product i.e., ``nrmfac = sqrt(N_VDotProd(v,v))`` where all the entries + of ``v`` are one. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This function must be called *after* the ARKLS mass matrix solver interface + has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.ARKodeRootfindingInputTable: + + +Rootfinding optional input functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The following functions can be called to set optional inputs to +control the rootfinding algorithm, the mathematics of which are +described in :numref:`ARKODE.Mathematics.Rootfinding`. + + +.. cssclass:: table-bordered + +====================================== ===================================== ================== +Optional input Function name Default +====================================== ===================================== ================== +Direction of zero-crossings to monitor :c:func:`ARKodeSetRootDirection` both +Disable inactive root warnings :c:func:`ARKodeSetNoInactiveRootWarn` enabled +====================================== ===================================== ================== + + + +.. c:function:: int ARKodeSetRootDirection(void* arkode_mem, int* rootdir) + + Specifies the direction of zero-crossings to be located and returned. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rootdir: state array of length *nrtfn*, the number of root + functions :math:`g_i` (the value of *nrtfn* was supplied in + the call to :c:func:`ARKodeRootInit`). If ``rootdir[i] == + 0`` then crossing in either direction for :math:`g_i` should be + reported. A value of +1 or -1 indicates that the solver + should report only zero-crossings where :math:`g_i` is + increasing or decreasing, respectively. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + The default behavior is to monitor for both zero-crossing directions. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeSetNoInactiveRootWarn(void* arkode_mem) + + Disables issuing a warning if some root function appears + to be identically zero at the beginning of the integration. + + :param arkode_mem: pointer to the ARKODE memory block. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + ARKODE will not report the initial conditions as a + possible zero-crossing (assuming that one or more components + :math:`g_i` are zero at the initial time). However, if it appears + that some :math:`g_i` is identically zero at the initial time + (i.e., :math:`g_i` is zero at the initial time *and* after the + first step), ARKODE will issue a warning which can be disabled with + this optional input function. + + .. versionadded:: x.y.z + + + + +.. _ARKODE.Usage.InterpolatedOutput: + +Interpolated output function +-------------------------------- + +An optional function :c:func:`ARKodeGetDky` is available to obtain +additional values of solution-related quantities. This function +should only be called after a successful return from +:c:func:`ARKodeEvolve`, as it provides interpolated values either of +:math:`y` or of its derivatives (up to the 5th derivative) +interpolated to any value of :math:`t` in the last internal step taken +by :c:func:`ARKodeEvolve`. Internally, this "dense output" or +"continuous extension" algorithm is identical to the algorithm used for +the maximum order implicit predictors, described in +:numref:`ARKODE.Mathematics.Predictors.Max`, except that derivatives of the +polynomial model may be evaluated upon request. + + + +.. c:function:: int ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) + + Computes the *k*-th derivative of the function + :math:`y` at the time *t*, + i.e. :math:`y^{(k)}(t)`, for values of the + independent variable satisfying :math:`t_n-h_n \le t \le t_n`, with + :math:`t_n` as current internal time reached, and :math:`h_n` is + the last internal step size successfully used by the solver. This + routine uses an interpolating polynomial of degree *min(degree, 5)*, + where *degree* is the argument provided to + :c:func:`ARKodeSetInterpolantDegree`. The user may request *k* in the + range {0,..., *min(degree, kmax)*} where *kmax* depends on the choice of + interpolation module. For Hermite interpolants *kmax = 5* and for Lagrange + interpolants *kmax = 3*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param t: the value of the independent variable at which the + derivative is to be evaluated. + :param k: the derivative order requested. + :param dky: output vector (must be allocated by the user). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_BAD_K: *k* is not in the range {0,..., *min(degree, kmax)*}. + :retval ARK_BAD_T: *t* is not in the interval :math:`[t_n-h_n, t_n]`. + :retval ARK_BAD_DKY: the *dky* vector was ``NULL``. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + It is only legal to call this function after a successful + return from :c:func:`ARKodeEvolve`. + + A user may access the values :math:`t_n` and :math:`h_n` via the + functions :c:func:`ARKodeGetCurrentTime` and + :c:func:`ARKodeGetLastStep`, respectively. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.OptionalOutputs: + +Optional output functions +------------------------------ + +ARKODE provides an extensive set of functions that can be used to +obtain solver performance information. We organize these into groups: + +#. General ARKODE output routines are in + :numref:`ARKODE.Usage.ARKodeMainOutputs`, +#. ARKODE implicit solver output routines are in + :numref:`ARKODE.Usage.ARKodeImplicitSolverOutputs`, +#. Output routines regarding root-finding results are in + :numref:`ARKODE.Usage.ARKodeRootOutputs`, +#. Linear solver output routines are in + :numref:`ARKODE.Usage.ARKLsOutputs` and +#. General usability routines (e.g. to print the current ARKODE + parameters, or output the current Butcher table(s)) are in + :numref:`ARKODE.Usage.ARKodeExtraOutputs`. + +Following each table, we elaborate on each function. + +Some of the optional outputs, especially the various counters, can be +very useful in determining the efficiency of various methods inside +ARKODE. For example: + +* The counters *nsteps*, *nfe_evals* and *nfi_evals* + provide a rough measure of the overall cost of a given run, and can + be compared between runs with different solver options to suggest + which set of options is the most efficient. + +* The ratio *nniters/nsteps* measures the performance of the + nonlinear iteration in solving the nonlinear systems at each stage, + providing a measure of the degree of nonlinearity in the problem. + Typical values of this for a Newton solver on a general problem + range from 1.1 to 1.8. + +* When using a Newton nonlinear solver, the ratio *njevals/nniters* + (when using a direct linear solver), and the ratio + *nliters/nniters* (when using an iterative linear solver) can + indicate the quality of the approximate Jacobian or preconditioner being + used. For example, if this ratio is larger for a user-supplied + Jacobian or Jacobian-vector product routine than for the + difference-quotient routine, it can indicate that the user-supplied + Jacobian is inaccurate. + +* The ratio *expsteps/accsteps* can measure the quality of the ImEx + splitting used, since a higher-quality splitting will be dominated + by accuracy-limited steps, and hence a lower ratio. + +* The ratio *nsteps/step_attempts* can measure the quality of the + time step adaptivity algorithm, since a poor algorithm will result + in more failed steps, and hence a lower ratio. + +It is therefore recommended that users retrieve and output these +statistics following each run, and take some time to investigate +alternate solver options that will be more optimal for their +particular problem of interest. + + + +.. _ARKODE.Usage.ARKodeMainOutputs: + +Main solver optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. cssclass:: table-bordered + +===================================================== ============================================ +Optional output Function name +===================================================== ============================================ +Size of ARKODE real and integer workspaces :c:func:`ARKodeGetWorkSpace` +Cumulative number of internal steps :c:func:`ARKodeGetNumSteps` +Actual initial time step size used :c:func:`ARKodeGetActualInitStep` +Step size used for the last successful step :c:func:`ARKodeGetLastStep` +Step size to be attempted on the next step :c:func:`ARKodeGetCurrentStep` +Current internal time reached by the solver :c:func:`ARKodeGetCurrentTime` +Current internal solution reached by the solver :c:func:`ARKodeGetCurrentState` +Current :math:`\gamma` value used by the solver :c:func:`ARKodeGetCurrentGamma` +Suggested factor for tolerance scaling :c:func:`ARKodeGetTolScaleFactor` +Error weight vector for state variables :c:func:`ARKodeGetErrWeights` +Residual weight vector :c:func:`ARKodeGetResWeights` +Single accessor to many statistics at once :c:func:`ARKodeGetStepStats` +Print all statistics :c:func:`ARKodePrintAllStats` +Name of constant associated with a return flag :c:func:`ARKodeGetReturnFlagName` +No. of explicit stability-limited steps :c:func:`ARKodeGetNumExpSteps` +No. of accuracy-limited steps :c:func:`ARKodeGetNumAccSteps` +No. of attempted steps :c:func:`ARKodeGetNumStepAttempts` +No. of local error test failures that have occurred :c:func:`ARKodeGetNumErrTestFails` +No. of failed steps due to a nonlinear solver failure :c:func:`ARKodeGetNumStepSolveFails` +Estimated local truncation error vector :c:func:`ARKodeGetEstLocalErrors` +Number of constraint test failures :c:func:`ARKodeGetNumConstrFails` +Retrieve a pointer for user data :c:func:`ARKodeGetUserData` +===================================================== ============================================ + + + + +.. c:function:: int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) + + Returns the ARKODE real and integer workspace sizes. + + :param arkode_mem: pointer to the ARKODE memory block. + :param lenrw: the number of ``sunrealtype`` values in the ARKODE workspace. + :param leniw: the number of integer values in the ARKODE workspace. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps) + + Returns the cumulative number of internal steps taken by + the solver (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nsteps: number of steps taken in the solver. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetActualInitStep(void* arkode_mem, sunrealtype* hinused) + + Returns the value of the integration step size used on the first step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hinused: actual value of initial step size. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + Even if the value of the initial integration step was + specified by the user through a call to + :c:func:`ARKodeSetInitStep`, this value may have been changed by + ARKODE to ensure that the step size fell within the prescribed + bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to satisfy the + local error test condition, or to ensure convergence of the + nonlinear solver. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast) + + Returns the integration step size taken on the last successful + internal step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hlast: step size taken on the last internal step. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) + + Returns the integration step size to be attempted on the next internal step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param hcur: step size to be attempted on the next internal step. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) + + Returns the current internal time reached by the solver. + + :param arkode_mem: pointer to the ARKODE memory block. + :param tcur: current internal time reached. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetCurrentState(void *arkode_mem, N_Vector *ycur) + + Returns the current internal solution reached by the solver. + + :param arkode_mem: pointer to the ARKODE memory block. + :param ycur: current internal solution. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + Users should exercise extreme caution when using this function, + as altering values of *ycur* may lead to undesirable behavior, depending + on the particular use case and on when this routine is called. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) + + Returns the current internal value of :math:`\gamma` used in the implicit + solver Newton matrix (see equation :eq:`ARKODE_NewtonMatrix`). + + :param arkode_mem: pointer to the ARKODE memory block. + :param gamma: current step size scaling factor in the Newton system. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) + + Returns a suggested factor by which the user's + tolerances should be scaled when too much accuracy has been + requested for some internal step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param tolsfac: suggested scaling factor for user-supplied tolerances. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight) + + Returns the current error weight vector. + + :param arkode_mem: pointer to the ARKODE memory block. + :param eweight: solution error weights at the current time. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + The user must allocate space for *eweight*, that will be + filled in by this function. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) + + Returns the current residual weight vector. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rweight: residual error weights at the current time. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + The user must allocate space for *rweight*, that will be + filled in by this function. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) + + Returns many of the most useful optional outputs in a single call. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nsteps: number of steps taken in the solver. + :param hinused: actual value of initial step size. + :param hlast: step size taken on the last internal step. + :param hcur: step size to be attempted on the next internal step. + :param tcur: current internal time reached. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) + + Outputs all of the integrator, nonlinear solver, linear solver, and other + statistics. + + :param arkode_mem: pointer to the ARKODE memory block. + :param outfile: pointer to output file. + :param fmt: the output format: + + * :c:enumerator:`SUN_OUTPUTFORMAT_TABLE` -- prints a table of values + + * :c:enumerator:`SUN_OUTPUTFORMAT_CSV` -- prints a comma-separated list + of key and value pairs e.g., ``key1,value1,key2,value2,...`` + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an invalid formatting option was provided. + + .. note:: + + The file ``scripts/sundials_csv.py`` provides python utility functions to + read and output the data from a SUNDIALS CSV output file using the key + and value pair format. + + .. versionadded:: x.y.z + + +.. c:function:: char* ARKodeGetReturnFlagName(long int flag) + + Returns the name of the ARKODE constant corresponding to *flag*. + See :ref:`ARKODE.Constants`. + + :param flag: a return flag from an ARKODE function. + + :return: The return value is a string containing the name of + the corresponding constant. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps) + + Returns the cumulative number of stability-limited steps + taken by the solver (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param expsteps: number of stability-limited steps taken in the solver. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumAccSteps(void* arkode_mem, long int* accsteps) + + Returns the cumulative number of accuracy-limited steps + taken by the solver (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param accsteps: number of accuracy-limited steps taken in the solver. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumStepAttempts(void* arkode_mem, long int* step_attempts) + + Returns the cumulative number of steps attempted by the solver (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param step_attempts: number of steps attempted by solver. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) + + Returns the number of local error test failures that + have occurred (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param netfails: number of error test failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* ncnf) + + Returns the number of failed steps due to a nonlinear solver failure (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param ncnf: number of step failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele) + + Returns the vector of estimated local truncation errors + for the current step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param ele: vector of estimated local truncation errors. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + The user must allocate space for *ele*, that will be + filled in by this function. + + The values returned in *ele* are valid only after a successful call + to :c:func:`ARKodeEvolve` (i.e., it returned a non-negative value). + + The *ele* vector, together with the *eweight* vector from + :c:func:`ARKodeGetErrWeights`, can be used to determine how the + various components of the system contributed to the estimated local + error test. Specifically, that error test uses the WRMS norm of a + vector whose components are the products of the components of these + two vectors. Thus, for example, if there were recent error test + failures, the components causing the failures are those with largest + values for the products, denoted loosely as ``eweight[i]*ele[i]``. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) + + Returns the cumulative number of constraint test failures (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nconstrfails: number of constraint test failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: adaptive step sizes are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support temporal adaptivity. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetUserData(void* arkode_mem, void** user_data) + + Returns the user data pointer previously set with + :c:func:`ARKodeSetUserData`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param user_data: memory reference to a user data pointer. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.ARKodeImplicitSolverOutputs: + +Implicit solver optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. cssclass:: table-bordered + +=================================================== ============================================ +Optional output Function name +=================================================== ============================================ +Computes state given a correction :c:func:`ARKodeComputeState` +Access data to compute the nonlin. sys. function :c:func:`ARKodeGetNonlinearSystemData` +No. of calls to linear solver setup function :c:func:`ARKodeGetNumLinSolvSetups` +No. of nonlinear solver iterations :c:func:`ARKodeGetNumNonlinSolvIters` +No. of nonlinear solver iterations :c:func:`ARKodeGetNumNonlinSolvIters` +No. of nonlinear solver convergence failures :c:func:`ARKodeGetNumNonlinSolvConvFails` +Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSolvStats` +=================================================== ============================================ + + + + +.. c:function:: int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) + + Returns the number of calls made to the linear solver's + setup routine (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nlinsetups: number of linear solver setup calls made. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) + + Returns the number of nonlinear solver iterations + performed (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nniters: number of nonlinear iterations performed. + :retval ARK_STEPPER_UNSUPPORTED: nonlinear solvers are not supported + by the current time-stepping module. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NLS_OP_ERR: the SUNNONLINSOL object returned a failure flag. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) + + Returns the number of nonlinear solver convergence + failures that have occurred (so far). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nncfails: number of nonlinear convergence failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: nonlinear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) + + Returns all of the nonlinear solver statistics in a single call. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nniters: number of nonlinear iterations performed. + :param nncfails: number of nonlinear convergence failures. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NLS_OP_ERR: the SUNNONLINSOL object returned a failure flag. + :retval ARK_STEPPER_UNSUPPORTED: nonlinear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the nonlinear + solver object; the counters are reset whenever a new nonlinear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.ARKodeRootOutputs: + +Rootfinding optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. cssclass:: table-bordered + +=================================================== ========================================== +Optional output Function name +=================================================== ========================================== +Array showing roots found :c:func:`ARKodeGetRootInfo` +No. of calls to user root function :c:func:`ARKodeGetNumGEvals` +=================================================== ========================================== + + + +.. c:function:: int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) + + Returns an array showing which functions were found to + have a root. + + :param arkode_mem: pointer to the ARKODE memory block. + :param rootsfound: array of length *nrtfn* with the indices of the + user functions :math:`g_i` found to have a root (the value of + *nrtfn* was supplied in the call to + :c:func:`ARKodeRootInit`). For :math:`i = 0 \ldots` + *nrtfn*-1, ``rootsfound[i]`` is nonzero if :math:`g_i` has a + root, and 0 if not. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + The user must allocate space for *rootsfound* prior to + calling this function. + + For the components of :math:`g_i` for which a root was found, the + sign of ``rootsfound[i]`` indicates the direction of + zero-crossing. A value of +1 indicates that :math:`g_i` is + increasing, while a value of -1 indicates a decreasing :math:`g_i`. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) + + Returns the cumulative number of calls made to the + user's root function :math:`g`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param ngevals: number of calls made to :math:`g` so far. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.ARKLsOutputs: + +Linear solver interface optional output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A variety of optional outputs are available from the ARKLS interface, +as listed in the following table and elaborated below. We note that +where the name of an output would otherwise conflict with the +name of an optional output from the main solver, a suffix LS (for +Linear Solver) or MLS (for Mass Linear Solver) has been added here +(e.g. *lenrwLS*). + + + +.. cssclass:: table-bordered + +================================================================= ======================================== +Optional output Function name +================================================================= ======================================== +Stored Jacobian of the ODE RHS function :c:func:`ARKodeGetJac` +Time at which the Jacobian was evaluated :c:func:`ARKodeGetJacTime` +Step number at which the Jacobian was evaluated :c:func:`ARKodeGetJacNumSteps` +Size of real and integer workspaces :c:func:`ARKodeGetLinWorkSpace` +No. of Jacobian evaluations :c:func:`ARKodeGetNumJacEvals` +No. of preconditioner evaluations :c:func:`ARKodeGetNumPrecEvals` +No. of preconditioner solves :c:func:`ARKodeGetNumPrecSolves` +No. of linear iterations :c:func:`ARKodeGetNumLinIters` +No. of linear convergence failures :c:func:`ARKodeGetNumLinConvFails` +No. of Jacobian-vector setup evaluations :c:func:`ARKodeGetNumJTSetupEvals` +No. of Jacobian-vector product evaluations :c:func:`ARKodeGetNumJtimesEvals` +No. of *fi* calls for finite diff. :math:`J` or :math:`Jv` evals. :c:func:`ARKodeGetNumLinRhsEvals` +Last return from a linear solver function :c:func:`ARKodeGetLastLinFlag` +Name of constant associated with a return flag :c:func:`ARKodeGetLinReturnFlagName` +Size of real and integer mass matrix solver workspaces :c:func:`ARKodeGetMassWorkSpace` +No. of mass matrix solver setups (incl. :math:`M` evals.) :c:func:`ARKodeGetNumMassSetups` +No. of mass matrix multiply setups :c:func:`ARKodeGetNumMassMultSetups` +No. of mass matrix multiplies :c:func:`ARKodeGetNumMassMult` +No. of mass matrix solves :c:func:`ARKodeGetNumMassSolves` +No. of mass matrix preconditioner evaluations :c:func:`ARKodeGetNumMassPrecEvals` +No. of mass matrix preconditioner solves :c:func:`ARKodeGetNumMassPrecSolves` +No. of mass matrix linear iterations :c:func:`ARKodeGetNumMassIters` +No. of mass matrix solver convergence failures :c:func:`ARKodeGetNumMassConvFails` +No. of mass-matrix-vector setup evaluations :c:func:`ARKodeGetNumMTSetups` +Last return from a mass matrix solver function :c:func:`ARKodeGetLastMassFlag` +================================================================= ======================================== + +.. c:function:: int ARKodeGetJac(void* arkode_mem, SUNMatrix* J) + + Returns the internally stored copy of the Jacobian matrix of the ODE + implicit right-hand side function. + + :param arkode_mem: the ARKODE memory structure. + :param J: the Jacobian matrix. + + :retval ARKLS_SUCCESS: the output value has been successfully set. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. warning:: + + This function is provided for debugging purposes and the values in the + returned matrix should not be altered. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J) + + Returns the time at which the internally stored copy of the Jacobian matrix + of the ODE implicit right-hand side function was evaluated. + + :param arkode_mem: the ARKODE memory structure. + :param t_J: the time at which the Jacobian was evaluated. + + :retval ARKLS_SUCCESS: the output value has been successfully set. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + +.. c:function:: int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J) + + Returns the value of the internal step counter at which the internally stored copy of the + Jacobian matrix of the ODE implicit right-hand side function was evaluated. + + :param arkode_mem: the ARKODE memory structure. + :param nst_J: the value of the internal step counter at which the Jacobian was evaluated. + + :retval ARKLS_SUCCESS: the output value has been successfully set. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) + + Returns the real and integer workspace used by the ARKLS linear solver interface. + + :param arkode_mem: pointer to the ARKODE memory block. + :param lenrwLS: the number of ``sunrealtype`` values in the ARKLS workspace. + :param leniwLS: the number of integer values in the ARKLS workspace. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The workspace requirements reported by this routine + correspond only to memory allocated within this interface and to + memory allocated by the ``SUNLinearSolver`` object attached + to it. The template Jacobian matrix allocated by the user outside + of ARKLS is not included in this report. + + In a parallel setting, the above values are global (i.e. summed over all + processors). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals) + + Returns the number of Jacobian evaluations. + + :param arkode_mem: pointer to the ARKODE memory block. + :param njevals: number of Jacobian evaluations. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals) + + Returns the total number of preconditioner evaluations, + i.e. the number of calls made to *psetup* with ``jok`` = ``SUNFALSE`` and + that returned ``*jcurPtr`` = ``SUNTRUE``. + + :param arkode_mem: pointer to the ARKODE memory block. + :param npevals: the current number of calls to *psetup*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves) + + Returns the number of calls made to the preconditioner + solve function, *psolve*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param npsolves: the number of calls to *psolve*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters) + + Returns the cumulative number of linear iterations. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nliters: the current number of linear iterations. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumLinConvFails(void* arkode_mem, long int* nlcfails) + + Returns the cumulative number of linear convergence failures. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nlcfails: the current number of linear convergence failures. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) + + Returns the cumulative number of calls made to the user-supplied + Jacobian-vector setup function, *jtsetup*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param njtsetup: the current number of calls to *jtsetup*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals) + + Returns the cumulative number of calls made to the + Jacobian-vector product function, *jtimes*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param njvevals: the current number of calls to *jtimes*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) + + Returns the number of calls to the user-supplied implicit + right-hand side function :math:`f^I` for finite difference + Jacobian or Jacobian-vector product approximation. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nfevalsLS: the number of calls to the user implicit + right-hand side function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + The value *nfevalsLS* is incremented only if the default + internal difference quotient function is used. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to ARKODE, or when ARKODE is resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetLastLinFlag(void* arkode_mem, long int* lsflag) + + Returns the last return value from an ARKLS routine. + + :param arkode_mem: pointer to the ARKODE memory block. + :param lsflag: the value of the last return flag from an + ARKLS function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: linear solvers are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + If the ARKLS setup function failed when using the + ``SUNLINSOL_DENSE`` or ``SUNLINSOL_BAND`` modules, then the value + of *lsflag* is equal to the column index (numbered from one) at + which a zero diagonal element was encountered during the LU + factorization of the (dense or banded) Jacobian matrix. For all + other failures, *lsflag* is negative. + + Otherwise, if the ARKLS setup function failed + (:c:func:`ARKodeEvolve` returned *ARK_LSETUP_FAIL*), then + *lsflag* will be *SUNLS_PSET_FAIL_UNREC*, *SUNLS_ASET_FAIL_UNREC* + or *SUN_ERR_EXT_FAIL*. + + If the ARKLS solve function failed (:c:func:`ARKodeEvolve` + returned *ARK_LSOLVE_FAIL*), then *lsflag* contains the error + return flag from the ``SUNLinearSolver`` object, which will + be one of: + *SUN_ERR_ARG_CORRUPTRRUPT*, indicating that the ``SUNLinearSolver`` + memory is ``NULL``; + *SUNLS_ATIMES_NULL*, indicating that a matrix-free iterative solver + was provided, but is missing a routine for the matrix-vector product + approximation, + *SUNLS_ATIMES_FAIL_UNREC*, indicating an unrecoverable failure in + the :math:`Jv` function; + *SUNLS_PSOLVE_NULL*, indicating that an iterative linear solver was + configured to use preconditioning, but no preconditioner solve + routine was provided, + *SUNLS_PSOLVE_FAIL_UNREC*, indicating that the preconditioner solve + function failed unrecoverably; + *SUNLS_GS_FAIL*, indicating a failure in the Gram-Schmidt procedure + (SPGMR and SPFGMR only); + *SUNLS_QRSOL_FAIL*, indicating that the matrix :math:`R` was found + to be singular during the QR solve phase (SPGMR and SPFGMR only); or + *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in + an external iterative linear solver package. + + .. versionadded:: x.y.z + + +.. c:function:: char* ARKodeGetLinReturnFlagName(long int lsflag) + + Returns the name of the ARKLS constant corresponding to *lsflag*. + + :param lsflag: a return flag from an ARKLS function. + + :returns: The return value is a string containing the name of + the corresponding constant. If using the ``SUNLINSOL_DENSE`` or + ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` + :math:`\le n` (LU factorization failed), this routine returns "NONE". + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, long int* leniwMLS) + + Returns the real and integer workspace used by the ARKLS mass matrix linear solver interface. + + :param arkode_mem: pointer to the ARKODE memory block. + :param lenrwMLS: the number of ``sunrealtype`` values in the ARKLS mass solver workspace. + :param leniwMLS: the number of integer values in the ARKLS mass solver workspace. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + The workspace requirements reported by this routine + correspond only to memory allocated within this interface and to + memory allocated by the ``SUNLinearSolver`` object attached + to it. The template mass matrix allocated by the user outside + of ARKLS is not included in this report. + + In a parallel setting, the above values are global (i.e. summed over all + processors). + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups) + + Returns the number of calls made to the ARKLS mass matrix solver + 'setup' routine; these include all calls to the user-supplied + mass-matrix constructor function. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmsetups: number of calls to the mass matrix solver setup routine. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) + + Returns the number of calls made to the ARKLS mass matrix 'matvec setup' + (matrix-based solvers) routine. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmvsetups: number of calls to the mass matrix matrix-times-vector setup routine. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassMult(void* arkode_mem, long int* nmmults) + + Returns the number of calls made to the ARKLS mass matrix 'matvec' + routine (matrix-based solvers) or the user-supplied *mtimes* + routine (matris-free solvers). + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmmults: number of calls to the mass matrix solver matrix-times-vector routine. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassSolves(void* arkode_mem, long int* nmsolves) + + Returns the number of calls made to the ARKLS mass matrix solver 'solve' routine. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmsolves: number of calls to the mass matrix solver solve routine. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) + + Returns the total number of mass matrix preconditioner evaluations, + i.e. the number of calls made to *psetup*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmpevals: the current number of calls to *psetup*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) + + Returns the number of calls made to the mass matrix preconditioner + solve function, *psolve*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmpsolves: the number of calls to *psolve*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassIters(void* arkode_mem, long int* nmiters) + + Returns the cumulative number of mass matrix solver iterations. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmiters: the current number of mass matrix solver linear iterations. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMassConvFails(void* arkode_mem, long int* nmcfails) + + Returns the cumulative number of mass matrix solver convergence failures. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmcfails: the current number of mass matrix solver convergence failures. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetup) + + Returns the cumulative number of calls made to the user-supplied + mass-matrix-vector product setup function, *mtsetup*. + + :param arkode_mem: pointer to the ARKODE memory block. + :param nmtsetup: the current number of calls to *mtsetup*. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new mass-matrix + linear solver module is "attached" to ARKODE, or when ARKODE is + resized. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeGetLastMassFlag(void* arkode_mem, long int* mlsflag) + + Returns the last return value from an ARKLS mass matrix interface routine. + + :param arkode_mem: pointer to the ARKODE memory block. + :param mlsflag: the value of the last return flag from an ARKLS + mass matrix solver interface function. + + :retval ARKLS_SUCCESS: the function exited successfully. + :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARKLS_LMEM_NULL: the linear solver memory was ``NULL``. + :retval ARK_STEPPER_UNSUPPORTED: non-identity mass matrices are not supported + by the current time-stepping module. + + .. note:: + + This is only compatible with time-stepping modules that support non-identity mass matrices. + + The values of *msflag* for each of the various solvers + will match those described above for the function + :c:func:`ARKodeGetLastLinFlag`. + + .. versionadded:: x.y.z + + + + +.. _ARKODE.Usage.ARKodeExtraOutputs: + +General usability functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The following optional routine may be called by a user to inquire +about existing solver parameters. While this would not typically be +called during the course of solving an initial value problem, it may +be useful for users wishing to better understand ARKODE. + + +.. cssclass:: table-bordered + +==================================== =================================== +Optional routine Function name +==================================== =================================== +Output all ARKODE solver parameters :c:func:`ARKodeWriteParameters` +==================================== =================================== + + + + +.. c:function:: int ARKodeWriteParameters(void* arkode_mem, FILE *fp) + + Outputs all ARKODE solver parameters to the provided file pointer. + + :param arkode_mem: pointer to the ARKODE memory block. + :param fp: pointer to use for printing the solver parameters. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. note:: + + The *fp* argument can be ``stdout`` or ``stderr``, or it + may point to a specific file created using ``fopen``. + + When run in parallel, only one process should set a non-NULL value + for this pointer, since parameters for all processes would be + identical. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.Reset: + +ARKODE reset function +---------------------- + +To reset the ARKODE module to a particular state :math:`(t_R,y(t_R))` for the +continued solution of a problem, where a prior +call to ``*StepCreate`` has been made, the user must call the function +:c:func:`ARKodeReset`. Like the stepper-specific ``*StepReInit`` functions, +this routine retains the current settings for all solver options and +performs no memory allocations but, unlike ``*StepReInit``, this routine +performs only a *subset* of the input checking and initializations that are +done in ``*StepCreate``. In particular this routine retains all internal +counter values and the step size/error history and does not reinitialize the +linear and/or nonlinear solver but it does indicate that a linear solver setup +is necessary in the next step. Like ``*StepReInit``, a call to +:c:func:`ARKodeReset` will delete any previously-set *tstop* value specified +via a call to :c:func:`ARKodeSetStopTime`. Following a successful call to +:c:func:`ARKodeReset`, call :c:func:`ARKodeEvolve` again to continue +solving the problem. By default the next call to :c:func:`ARKodeEvolve` will +use the step size computed by ARKODE prior to calling :c:func:`ARKodeReset`. +To set a different step size or have ARKODE estimate a new step size use +:c:func:`ARKodeSetInitStep`. + +One important use of the :c:func:`ARKodeReset` function is in the +treating of jump discontinuities in the RHS functions. Except in cases +of fairly small jumps, it is usually more efficient to stop at each +point of discontinuity and restart the integrator with a readjusted +ODE model, using a call to :c:func:`ARKodeReset`. To stop when +the location of the discontinuity is known, simply make that location +a value of ``tout``. To stop when the location of the discontinuity +is determined by the solution, use the rootfinding feature. In either +case, it is critical that the RHS functions *not* incorporate the +discontinuity, but rather have a smooth extension over the +discontinuity, so that the step across it (and subsequent rootfinding, +if used) can be done efficiently. Then use a switch within the RHS +functions (communicated through ``user_data``) that can be flipped +between the stopping of the integration and the restart, so that the +restarted problem uses the new values (which have jumped). Similar +comments apply if there is to be a jump in the dependent variable +vector. + + +.. c:function:: int ARKodeReset(void* arkode_mem, sunrealtype tR, N_Vector yR) + + Resets the current ARKODE time-stepper module state to the provided + independent variable value and dependent variable vector. + + :param arkode_mem: pointer to the ARKODE memory block. + :param tR: the value of the independent variable :math:`t`. + :param yR: the value of the dependent variable vector :math:`y(t_R)`. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_MEM_FAIL: a memory allocation failed. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + By default the next call to :c:func:`ARKodeEvolve` will use the step size + computed by ARKODE prior to calling :c:func:`ARKodeReset`. To set a + different step size or have ARKODE estimate a new step size use + :c:func:`ARKodeSetInitStep`. + + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. + + If an error occurred, :c:func:`ARKodeReset` also sends an error message to + the error handler function. + + .. versionadded:: x.y.z + + + +.. _ARKODE.Usage.Resizing: + +ARKODE system resize function +------------------------------------- + +For simulations involving changes to the number of equations and +unknowns in the ODE system (e.g. when using spatially-adaptive +PDE simulations under a method-of-lines approach), the ARKODE +integrator may be "resized" between integration steps, through calls +to the :c:func:`ARKodeResize` function. This function modifies +ARKODE's internal memory structures to use the new problem size, +without destruction of the temporal adaptivity heuristics. It is +assumed that the dynamical time scales before and after the vector +resize will be comparable, so that all time-stepping heuristics prior +to calling :c:func:`ARKodeResize` remain valid after the call. If +instead the dynamics should be recomputed from scratch, the ARKODE +memory structure should be deleted with a call to +:c:func:`ARKodeFree`, and recreated with a calls to +``*StepCreate``. + +To aid in the vector resize operation, the user can supply a vector +resize function that will take as input a vector with the previous +size, and transform it in-place to return a corresponding vector of +the new size. If this function (of type :c:func:`ARKVecResizeFn`) +is not supplied (i.e., is set to ``NULL``), then all existing vectors +internal to ARKODE will be destroyed and re-cloned from the new input +vector. + +In the case that the dynamical time scale should be modified slightly +from the previous time scale, an input *hscale* is allowed, that will +rescale the upcoming time step by the specified factor. If a value +*hscale* :math:`\le 0` is specified, the default of 1.0 will be used. + + + +.. c:function:: int ARKodeResize(void* arkode_mem, N_Vector yR, sunrealtype hscale, sunrealtype tR, ARKVecResizeFn resize, void* resize_data) + + Re-sizes ARKODE with a different state vector but with comparable + dynamical time scale. + + :param arkode_mem: pointer to the ARKODE memory block. + :param yR: the newly-sized state vector, holding the current + dependent variable values :math:`y(t_R)`. + :param hscale: the desired time step scaling factor (i.e. the next + step will be of size *h\*hscale*). + :param tR: the current value of the independent variable + :math:`t_R` (this must be consistent with *yR*). + :param resize: the user-supplied vector resize function (of type + :c:func:`ARKVecResizeFn`. + :param resize_data: the user-supplied data structure to be passed + to *resize* when modifying internal ARKODE vectors. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + If an error occurred, :c:func:`ARKodeResize` also sends an error + message to the error handler function. + + If inequality constraint checking is enabled a call to + :c:func:`ARKodeResize` will disable constraint checking. A call + to :c:func:`ARKodeSetConstraints` is required to re-enable constraint + checking. + + **Resizing the linear solver:** + + When using any of the SUNDIALS-provided linear solver modules, the + linear solver memory structures must also be resized. At present, + none of these include a solver-specific "resize" function, so the linear + solver memory must be destroyed and re-allocated **following** each + call to :c:func:`ARKodeResize`. Moreover, the existing ARKLS + interface should then be deleted and recreated by attaching the + updated ``SUNLinearSolver`` (and possibly ``SUNMatrix``) object(s) + through calls to + :c:func:`ARKodeSetLinearSolver`, and + :c:func:`ARKodeSetMassLinearSolver`. + + If any user-supplied routines are provided to aid the linear solver + (e.g. Jacobian construction, Jacobian-vector product, + mass-matrix-vector product, preconditioning), then the corresponding + "set" routines must be called again **following** the solver + re-specification. + + **Resizing the absolute tolerance array:** + + If using array-valued absolute tolerances, the absolute tolerance + vector will be invalid after the call to :c:func:`ARKodeResize`, so + the new absolute tolerance vector should be re-set **following** each + call to :c:func:`ARKodeResize` through a new call to + :c:func:`ARKodeSVtolerances` and possibly + :c:func:`ARKodeResVtolerance` if applicable. + + If scalar-valued tolerances or a tolerance function was specified + through either :c:func:`ARKodeSStolerances` or + :c:func:`ARKodeWFtolerances`, then these will remain valid and no + further action is necessary. + + **Example codes:** + + * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` + + .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/Usage/User_supplied.rst b/doc/arkode/guide/source/Usage/User_supplied.rst index 88942bff99..cb27409c48 100644 --- a/doc/arkode/guide/source/Usage/User_supplied.rst +++ b/doc/arkode/guide/source/Usage/User_supplied.rst @@ -20,52 +20,60 @@ User-supplied functions The user-supplied functions for ARKODE consist of: -* at least one function defining the ODE (required), +* at least one function :ref:`defining the ODE <ARKODE.Usage.ODERHS>` + (required), -* a function that handles error and warning messages (optional), +* a function that + :ref:`provides the error weight vector <ARKODE.Usage.ErrorWeight>` (optional), -* a function that provides the error weight vector (optional), +* a function that + :ref:`provides the residual weight vector <ARKODE.Usage.ResidualWeight>` (optional), -* a function that provides the residual weight vector (optional, ARKStep only), +* a function that + :ref:`handles explicit time step stability <ARKODE.Usage.StabilityFn>` (optional), -* a function that handles adaptive time step error control (optional, ARKStep/ERKStep only), +* a function that + :ref:`updates the implicit stage prediction <ARKODE.Usage.StagePredictFn>` (optional), -* a function that handles explicit time step stability (optional, ARKStep/ERKStep only), +* a function that + :ref:`defines auxiliary temporal root-finding problem(s) to solve <ARKODE.Usage.RootfindingFn>` (optional), -* a function that updates the implicit stage prediction (optional, ARKStep/MRIStep only), +* one or two functions that + :ref:`provide Jacobian-related information <ARKODE.Usage.JacobianFn>` + for the linear solver, if a component is treated implicitly and a + Newton-based nonlinear iteration is chosen (optional), -* a function that defines the root-finding problem(s) to solve (optional), - -* one or two functions that provide Jacobian-related information for - the linear solver, if a component is treated implicitly and a - Newton-based nonlinear iteration is chosen (optional, ARKStep/MRIStep only), - -* one or two functions that define the preconditioner for use in any - of the Krylov iterative algorithms, if linear systems of equations are to - be solved using an iterative method (optional, ARKStep/MRIStep only), +* one or two functions that :ref:`define the preconditioner <ARKODE.Usage.PrecSolveFn>` + for use in any of the Krylov iterative algorithms, if linear systems of + equations are to be solved using an iterative method (optional), * if the problem involves a non-identity mass matrix :math:`M\ne I` with ARKStep: - * one or two functions that provide mass-matrix-related information + * one or two functions that + :ref:`provide mass-matrix-related information <ARKODE.Usage.MassFn>` for the linear and mass matrix solvers (required), - * one or two functions that define the mass matrix preconditioner + * one or two functions that + :ref:`define the mass matrix preconditioner <ARKODE.Usage.MassPrecSolveFn>` for use if an iterative mass matrix solver is chosen (optional), and -* a function that handles vector resizing operations, if the +* a function that + :ref:`handles vector resizing operations <ARKODE.Usage.VecResizeFn>`, if the underlying vector structure supports resizing (as opposed to deletion/recreation), and if the user plans to call - :c:func:`ARKStepResize`, :c:func:`ERKStepResize`, or - :c:func:`MRIStepResize` (optional). + :c:func:`ARKodeResize` (optional). -* MRIStep only: functions to be called before and after each inner integration to - perform any communication or memory transfers of forcing data supplied +* MRIStep only: functions to be + :ref:`called before and after each inner integration <ARKODE.Usage.PreInnerFn>` + to perform any communication or memory transfers of forcing data supplied by the outer integrator to the inner integrator, or state data supplied by the inner integrator to the outer integrator. -* if relaxation is enabled (optional), a function that evaluates the - conservative or dissipative function :math:`\xi(y(t))` (required) and a - function to evaluate its Jacobian :math:`\xi'(y(t))` (required). +* if relaxation is enabled (optional), a function that + :ref:`evaluates the conservative or dissipative function <ARKODE.Usage.RelaxFn>` + :math:`\xi(y(t))` (required) and a function to + :ref:`evaluate its Jacobian <ARKODE.Usage.RelaxJacFn>` + :math:`\xi'(y(t))` (required). .. _ARKODE.Usage.ODERHS: @@ -74,31 +82,26 @@ ODE right-hand side ----------------------------- The user must supply at least one function of type :c:type:`ARKRhsFn` to -specify the explicit and/or implicit portions of the ODE system to ARKStep, -the ODE system function to ERKStep, or the "slow" right-hand side of the -ODE system to MRIStep: - +specify the IVP-defininig right-hand side function(s) when creating the +ARKODE time-stepping module: .. c:type:: int (*ARKRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) These functions compute the ODE right-hand side for a given value of the independent variable :math:`t` and state vector :math:`y`. - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *ydot* -- the output vector that forms [a portion of] the ODE RHS :math:`f(t,y)`. - * *user_data* -- the `user_data` pointer that was passed to - :c:func:`ARKStepSetUserData`, :c:func:`ERKStepSetUserData`, or :c:func:`MRIStepSetUserData`. + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param ydot: the output vector that forms [a portion of] the ODE RHS :math:`f(t,y)`. + :param user_data: the `user_data` pointer that was passed to + :c:func:`ARKodeSetUserData`. - **Return value:** + :return: An *ARKRhsFn* should return 0 if successful, a positive value if a + recoverable error occurred (in which case ARKODE will attempt to + correct), or a negative value if it failed unrecoverably (in which + case the integration is halted and *ARK_RHSFUNC_FAIL* is returned). - An *ARKRhsFn* should return 0 if successful, a positive value if a - recoverable error occurred (in which case ARKODE will attempt to - correct), or a negative value if it failed unrecoverably (in which - case the integration is halted and *ARK_RHSFUNC_FAIL* is returned). - - **Notes:** + .. note:: Allocation of memory for `ydot` is handled within ARKODE. @@ -110,18 +113,17 @@ ODE system to MRIStep: "illegal" in some way (e.g., negative where only a non-negative value is physically meaningful). If such a return is made, ARKODE will attempt to recover (possibly repeating the - nonlinear iteration, or reducing the step size in ARKStep or ERKStep) + nonlinear iteration, or reducing the step size in ARKodeEvolve) in order to avoid this recoverable error return. There are some situations in which recovery is not possible even if the right-hand side function returns a recoverable error flag. One is when this occurs at the very first call to the *ARKRhsFn* (in which case ARKODE returns *ARK_FIRST_RHSFUNC_ERR*). Another is when a - recoverable error is reported by *ARKRhsFn* after the ARKStep - integrator completes a successful stage, in which case ARKStep returns - *ARK_UNREC_RHSFUNC_ERR*). Similarly, since MRIStep does not currently - support adaptive time stepping at the slow time scale, it may - halt on a recoverable error flag that would normally have resulted - in a stepsize reduction. + recoverable error is reported by *ARKRhsFn* after the time-stepping + module completes a successful stage, in which case ARKodeEvolve returns + *ARK_UNREC_RHSFUNC_ERR*). Finally, when ARKODE is run in fixed-step + mode, it may halt on a recoverable error flag that would normally have + resulted in a stepsize reduction. @@ -144,18 +146,16 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. This function computes the WRMS error weights for the vector :math:`y`. - **Arguments:** - * *y* -- the dependent variable vector at which the - weight vector is to be computed. - * *ewt* -- the output vector containing the error weights. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to the ``SetUserData`` function + :param y: the dependent variable vector at which the weight vector is to be computed. + :param ewt: the output vector containing the error weights. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData` function + + :return: An *ARKEwtFn* function must return 0 if it + successfully set the error weights, and -1 otherwise. - **Return value:** - An *ARKEwtFn* function must return 0 if it - successfully set the error weights, and -1 otherwise. + .. note:: - **Notes:** Allocation of memory for *ewt* is handled within ARKODE. The error weight vector must have all components positive. It is @@ -166,8 +166,14 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. .. _ARKODE.Usage.ResidualWeight: -Residual weight function (ARKStep only) ----------------------------------------- +Residual weight function +------------------------ + +.. warning:: + + The functions in this section are specific to time-stepping modules + that support non-identity mass matrices. + As an alternative to providing the scalar or vector absolute residual tolerances (when the IVP units differ from the solution units), the @@ -184,19 +190,18 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. This function computes the WRMS residual weights for the vector :math:`y`. - **Arguments:** - * *y* -- the dependent variable vector at which the - weight vector is to be computed. - * *rwt* -- the output vector containing the residual weights. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData()`. + :param y: the dependent variable vector at which the + weight vector is to be computed. + :param rwt: the output vector containing the residual weights. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: An *ARKRwtFn* function must return 0 if it + successfully set the residual weights, and -1 otherwise. - **Return value:** - An *ARKRwtFn* function must return 0 if it - successfully set the residual weights, and -1 otherwise. + .. note:: - **Notes:** - Allocation of memory for *rwt* is handled within ARKStep. + Allocation of memory for *rwt* is handled within ARKODE. The residual weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it @@ -206,9 +211,15 @@ in :numref:`ARKODE.Mathematics.Error.Norm`. .. _ARKODE.Usage.AdaptivityFn: -Time step adaptivity function (ARKStep and ERKStep only) +Time step adaptivity function -------------------------------------------------------- +.. warning:: + + The function in this section is only used in now-deprecated functions + in ARKStep and ERKStep, and will be removed in a future release. + + As an alternative to using one of the built-in time step adaptivity methods for controlling solution error, the user may provide a function of type :c:type:`ARKAdaptFn` to compute a target step size @@ -222,41 +233,48 @@ such that the error estimate for the next time step remains below 1. This function implements a time step adaptivity algorithm that chooses :math:`h` to satisfy the error tolerances. - **Arguments:** - * *y* -- the current value of the dependent variable vector. - * *t* -- the current value of the independent variable. - * *h1* -- the current step size, :math:`t_n - t_{n-1}`. - * *h2* -- the previous step size, :math:`t_{n-1} - t_{n-2}`. - * *h3* -- the step size :math:`t_{n-2}-t_{n-3}`. - * *e1* -- the error estimate from the current step, :math:`n`. - * *e2* -- the error estimate from the previous step, :math:`n-1`. - * *e3* -- the error estimate from the step :math:`n-2`. - * *q* -- the global order of accuracy for the method. - * *p* -- the global order of accuracy for the embedded method. - * *hnew* -- the output value of the next step size. - * *user_data* -- a pointer to user data, the same as the - *h_data* parameter that was passed to :c:func:`ARKStepSetAdaptivityFn` - or :c:func:`ERKStepSetAdaptivityFn`. + :param y: the current value of the dependent variable vector. + :param t: the current value of the independent variable. + :param h1: the current step size, :math:`t_n - t_{n-1}`. + :param h2: the previous step size, :math:`t_{n-1} - t_{n-2}`. + :param h3: the step size :math:`t_{n-2}-t_{n-3}`. + :param e1: the error estimate from the current step, :math:`n`. + :param e2: the error estimate from the previous step, :math:`n-1`. + :param e3: the error estimate from the step :math:`n-2`. + :param q: the global order of accuracy for the method. + :param p: the global order of accuracy for the embedded method. + :param hnew: the output value of the next step size. + :param user_data: a pointer to user data, the same as the + *h_data* parameter that was passed to :c:func:`ARKStepSetAdaptivityFn` + or :c:func:`ERKStepSetAdaptivityFn`. - **Return value:** - An *ARKAdaptFn* function should return 0 if it - successfully set the next step size, and a non-zero value otherwise. + :return: An *ARKAdaptFn* function should return 0 if it + successfully set the next step size, and a non-zero value otherwise. + .. deprecated:: 5.7.0 + + Use the SUNAdaptController infrastructure instead (see + :numref:`SUNAdaptController.Description`). .. _ARKODE.Usage.StabilityFn: -Explicit stability function (ARKStep and ERKStep only) ------------------------------------------------------- +Explicit stability function +--------------------------- + +.. warning:: + + The functions in this section are specific to time-stepping modules + that support temporal adaptivity. + A user may supply a function to predict the maximum stable step size -for the explicit portion of the problem, :math:`f^E(t,y)` in ARKStep -or the full :math:`f(t,y)` in ERKStep. While -the accuracy-based time step adaptivity algorithms may be sufficient -for retaining a stable solution to the ODE system, these may be -inefficient if the explicit right-hand side function contains moderately stiff terms. In -this scenario, a user may provide a function of type :c:type:`ARKExpStabFn` +for an explicit portion of their IVP. While the accuracy-based time step +adaptivity algorithms may be sufficient for retaining a stable solution to +the ODE system, these may be inefficient if the explicit right-hand side +function contains moderately stiff terms. In this scenario, a user may +provide a function of type :c:type:`ARKExpStabFn` to provide this stability information to ARKODE. This function must set the scalar step size satisfying the stability restriction for the upcoming time step. This value will subsequently be bounded by @@ -270,21 +288,19 @@ step, and the accuracy-based time step. This function predicts the maximum stable step size for the explicit portion of the ODE system. - **Arguments:** - * *y* -- the current value of the dependent variable vector. - * *t* -- the current value of the independent variable. - * *hstab* -- the output value with the absolute value of the - maximum stable step size. - * *user_data* -- a pointer to user data, the same as the - *estab_data* parameter that was passed to :c:func:`ARKStepSetStabilityFn` - or :c:func:`ERKStepSetStabilityFn`. - - **Return value:** - An *ARKExpStabFn* function should return 0 if it - successfully set the upcoming stable step size, and a non-zero - value otherwise. - - **Notes:** + :param y: the current value of the dependent variable vector. + :param t: the current value of the independent variable. + :param hstab: the output value with the absolute value of the + maximum stable step size. + :param user_data: a pointer to user data, the same as the *estab_data* + parameter that was passed to :c:func:`ARKodeSetStabilityFn`. + + :return: An *ARKExpStabFn* function should return 0 if it + successfully set the upcoming stable step size, and a non-zero + value otherwise. + + .. note:: + If this function is not supplied, or if it returns *hstab* :math:`\le 0.0`, then ARKODE will assume that there is no explicit stability restriction on the time step size. @@ -294,19 +310,19 @@ step, and the accuracy-based time step. .. _ARKODE.Usage.StagePredictFn: -Implicit stage prediction function (ARKStep and MRIStep only) -------------------------------------------------------------- +Implicit stage prediction function +---------------------------------- A user may supply a function to update the prediction for each implicit stage solution. -If supplied, this routine will be called *after* any existing ARKStep or MRIStep predictor +If supplied, this routine will be called *after* any existing ARKODE predictor algorithm completes, so that the predictor may be modified by the user as desired. In this scenario, a user may provide a function of type :c:type:`ARKStagePredictFn` to provide this implicit predictor to ARKODE. This function takes as input the already-predicted implicit stage solution and the corresponding "time" for that prediction; it then updates the prediction vector as desired. If the user-supplied routine will construct a full prediction (and thus the ARKODE prediction is irrelevant), it is -recommended that the user *not* call :c:func:`ARKStepSetPredictorMethod` or -:c:func:`MRIStepSetPredictorMethod`, thereby leaving the default trivial predictor in place. +recommended that the user *not* call :c:func:`ARKodeSetPredictorMethod`, thereby leaving +the default trivial predictor in place. @@ -314,27 +330,25 @@ recommended that the user *not* call :c:func:`ARKStepSetPredictorMethod` or This function updates the prediction for the implicit stage solution. - **Arguments:** - * *t* -- the current value of the independent variable containing the - "time" corresponding to the predicted solution. - * *zpred* -- the ARKStep-predicted stage solution on input, and the - user-modified predicted stage solution on output. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - - **Return value:** - An *ARKStagePredictFn* function should return 0 if it - successfully set the upcoming stable step size, and a non-zero - value otherwise. - - **Notes:** + :param t: the current value of the independent variable containing the + "time" corresponding to the predicted solution. + :param zpred: the ARKODE-predicted stage solution on input, and the + user-modified predicted stage solution on output. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: An *ARKStagePredictFn* function should return 0 if it + successfully set the upcoming stable step size, and a non-zero + value otherwise. + + .. note:: + This may be useful if there are bound constraints on the solution, and these should be enforced prior to beginning the nonlinear or linear implicit solver algorithm. This routine is incompatible with the "minimum correction predictor" -- option 5 to the - routine :c:func:`ARKStepSetPredictorMethod()`. If both are selected, then ARKStep will + routine :c:func:`ARKodeSetPredictorMethod`. If both are selected, then ARKODE will override its built-in implicit predictor routine to instead use option 0 (trivial predictor). @@ -354,65 +368,60 @@ ODE system, the user must supply a function of type :c:type:`ARKRootFn`. :math:`g(t,y)` such that roots are sought for the components :math:`g_i(t,y)`, :math:`i=0,\ldots,` *nrtfn*-1. - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *gout* -- the output array, of length *nrtfn*, with components :math:`g_i(t,y)`. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to the ``SetUserData`` function + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param gout: the output array, of length *nrtfn*, with components :math:`g_i(t,y)`. + :param user_data: a pointer to user data, the same as the + *user_data* parameter that was passed to the ``SetUserData`` function + + :return: An *ARKRootFn* function should return 0 if successful + or a non-zero value if an error occurred (in which case the + integration is halted and ARKODE returns *ARK_RTFUNC_FAIL*). - **Return value:** - An *ARKRootFn* function should return 0 if successful - or a non-zero value if an error occurred (in which case the - integration is halted and ARKODE returns *ARK_RTFUNC_FAIL*). + .. note:: - **Notes:** Allocation of memory for *gout* is handled within ARKODE. .. _ARKODE.Usage.JacobianFn: -Jacobian construction (matrix-based linear solvers, ARKStep and MRIStep only) ------------------------------------------------------------------------------ +Jacobian construction +--------------------- If a matrix-based linear solver module is used (i.e., a non-NULL ``SUNMatrix`` -object was supplied to :c:func:`ARKStepSetLinearSolver` or -:c:func:`MRIStepSetLinearSolver`, the user may provide a function of type -:c:type:`ARKLsJacFn` to provide the Jacobian approximation or +object was supplied to :c:func:`ARKodeSetLinearSolver`, the user may provide a +function of type :c:type:`ARKLsJacFn` to provide the Jacobian approximation or :c:type:`ARKLsLinSysFn` to provide an approximation of the linear system :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)`. - .. c:type:: int (*ARKLsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) This function computes the Jacobian matrix :math:`J(t,y) = \dfrac{\partial f^I}{\partial y}(t,y)` (or an approximation to it). - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector, namely - the predicted value of :math:`y(t)`. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *Jac* -- the output Jacobian matrix. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - * *tmp1*, *tmp2*, *tmp3* -- pointers to memory allocated to - variables of type ``N_Vector`` which can be used by an - ARKLsJacFn as temporary storage or work space. - - **Return value:** - An *ARKLsJacFn* function should return 0 if successful, a positive - value if a recoverable error occurred (in which case ARKODE will - attempt to correct, while ARKLS sets *last_flag* to - *ARKLS_JACFUNC_RECVR*), or a negative value if it failed - unrecoverably (in which case the integration is halted, - :c:func:`ARKStepEvolve` or :c:func:`MRIStepEvolve` returns - *ARK_LSETUP_FAIL* and ARKLS sets *last_flag* to *ARKLS_JACFUNC_UNRECVR*). - - **Notes:** + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector, namely + the predicted value of :math:`y(t)`. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param Jac: the output Jacobian matrix. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + :param tmp*: pointers to memory allocated to + variables of type ``N_Vector`` which can be used by an + ARKLsJacFn as temporary storage or work space. + + :return: An *ARKLsJacFn* function should return 0 if successful, a positive + value if a recoverable error occurred (in which case ARKODE will + attempt to correct, while ARKLS sets *last_flag* to + *ARKLS_JACFUNC_RECVR*), or a negative value if it failed + unrecoverably (in which case the integration is halted, + :c:func:`ARKodeEvolve` returns *ARK_LSETUP_FAIL* and + ARKLS sets *last_flag* to *ARKLS_JACFUNC_UNRECVR*). + + .. note:: + Information regarding the specific ``SUNMatrix`` structure (e.g.~number of rows, upper/lower bandwidth, sparsity type) may be obtained through using the @@ -439,9 +448,8 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or in the argument list, including the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to the ``ark_mem`` structure to their ``user_data``, and - then use the ``ARKStepGet*`` or ``MRIStepGet*`` functions listed in - :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or - :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be + then use the ``ARKSodeGet*`` functions listed in + :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. @@ -478,51 +486,47 @@ object was supplied to :c:func:`ARKStepSetLinearSolver` or This function computes the linear system matrix :math:`\mathcal{A}(t,y) = M(t) - \gamma J(t,y)` (or an approximation to it). - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector, namely the - predicted value of :math:`y(t)`. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *A* -- the output linear system matrix. - * *M* -- the current mass matrix (this input is ``NULL`` if :math:`M = I`). - * *jok* -- is an input flag indicating whether the Jacobian-related data - needs to be updated. The *jok* argument provides for the reuse of - Jacobian data. When *jok* = ``SUNFALSE``, the Jacobian-related data - should be recomputed from scratch. When *jok* = ``SUNTRUE`` the Jacobian - data, if saved from the previous call to this function, can be reused - (with the current value of *gamma*). A call with *jok* = ``SUNTRUE`` can - only occur after a call with *jok* = ``SUNFALSE``. - * *jcur* -- is a pointer to a flag which should be set to ``SUNTRUE`` if - Jacobian data was recomputed, or set to ``SUNFALSE`` if Jacobian data - was not recomputed, but saved data was still reused. - * *gamma* -- the scalar :math:`\gamma` appearing in the Newton system matrix - :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. - * *user_data* -- a pointer to user data, the same as the *user_data* - parameter that was passed to :c:func:`ARKStepSetUserData` or - :c:func:`MRIStepSetUserData`. - * *tmp1*, *tmp2*, *tmp3* -- pointers to memory allocated to variables of - type ``N_Vector`` which can be used by an ARKLsLinSysFn as temporary - storage or work space. - - **Return value:** - An *ARKLsLinSysFn* function should return 0 if successful, a positive value - if a recoverable error occurred (in which case ARKODE will attempt to - correct, while ARKLS sets *last_flag* to *ARKLS_JACFUNC_RECVR*), or a - negative value if it failed unrecoverably (in which case the integration is - halted, :c:func:`ARKStepEvolve` or :c:func:`MRIStepEvolve` returns - *ARK_LSETUP_FAIL* and ARKLS sets *last_flag* to *ARKLS_JACFUNC_UNRECVR*). + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector, namely the + predicted value of :math:`y(t)`. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param A: the output linear system matrix. + :param M: the current mass matrix (this input is ``NULL`` if :math:`M = I`). + :param jok: is an input flag indicating whether the Jacobian-related data + needs to be updated. The *jok* argument provides for the reuse of + Jacobian data. When *jok* = ``SUNFALSE``, the Jacobian-related data + should be recomputed from scratch. When *jok* = ``SUNTRUE`` the Jacobian + data, if saved from the previous call to this function, can be reused + (with the current value of *gamma*). A call with *jok* = ``SUNTRUE`` can + only occur after a call with *jok* = ``SUNFALSE``. + :param jcur: is a pointer to a flag which should be set to ``SUNTRUE`` if + Jacobian data was recomputed, or set to ``SUNFALSE`` if Jacobian data + was not recomputed, but saved data was still reused. + :param gamma: the scalar :math:`\gamma` appearing in the Newton system matrix + :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + :param tmp*: pointers to memory allocated to variables of + type ``N_Vector`` which can be used by an ARKLsLinSysFn as temporary + storage or work space. + + :return: An *ARKLsLinSysFn* function should return 0 if successful, a positive value + if a recoverable error occurred (in which case ARKODE will attempt to + correct, while ARKLS sets *last_flag* to *ARKLS_JACFUNC_RECVR*), or a + negative value if it failed unrecoverably (in which case the integration is + halted, :c:func:`ARKodeEvolve` returns *ARK_LSETUP_FAIL* and ARKLS sets + *last_flag* to *ARKLS_JACFUNC_UNRECVR*). .. _ARKODE.Usage.JTimesFn: -Jacobian-vector product (matrix-free linear solvers, ARKStep and MRIStep only) ------------------------------------------------------------------------------- +Jacobian-vector product +----------------------- When using a matrix-free linear solver module for the implicit stage solves (i.e., a NULL-valued SUNMATRIX argument was supplied to -:c:func:`ARKStepSetLinearSolver` or :c:func:`MRIStepSetLinearSolver`, -the user may provide a function +:c:func:`ARKodeSetLinearSolver`, the user may provide a function of type :c:type:`ARKLsJacTimesVecFn` in the following form, to compute matrix-vector products :math:`Jv`. If such a function is not supplied, the default is a difference quotient approximation to these products. @@ -533,43 +537,40 @@ the default is a difference quotient approximation to these products. This function computes the product :math:`Jv` where :math:`J(t,y) \approx \dfrac{\partial f^I}{\partial y}(t,y)` (or an approximation to it). - **Arguments:** - * *v* -- the vector to multiply. - * *Jv* -- the output vector computed. - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - * *tmp* -- pointer to memory allocated to a variable of type - ``N_Vector`` which can be used as temporary storage or work space. - - **Return value:** - The value to be returned by the Jacobian-vector product - function should be 0 if successful. Any other return value will - result in an unrecoverable error of the generic Krylov solver, - in which case the integration is halted. - - **Notes:** + :param v: the vector to multiply. + :param Jv: the output vector computed. + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + :param tmp: pointer to memory allocated to a variable of type + ``N_Vector`` which can be used as temporary storage or work space. + + :return: The value to be returned by the Jacobian-vector product + function should be 0 if successful. Any other return value will + result in an unrecoverable error of the generic Krylov solver, + in which case the integration is halted. + + .. note:: + If the user's :c:type:`ARKLsJacTimesVecFn` function uses difference quotient approximations, it may need to access quantities not in the argument list. These include the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to the ``ark_mem`` structure to - their ``user_data``, and then use the ``ARKStepGet*`` or ``MRIStepGet*`` - functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or - :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header - file ``sundials_types.h``. + their ``user_data``, and then use the ``ARKodeGet*`` functions + listed in :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff + can be accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the + header file ``sundials_types.h``. .. _ARKODE.Usage.JTSetupFn: -Jacobian-vector product setup (matrix-free linear solvers, ARKStep and MRIStep only) ------------------------------------------------------------------------------------- +Jacobian-vector product setup +----------------------------- If the user's Jacobian-times-vector routine requires that any Jacobian-related data be preprocessed or evaluated, then this needs to be done in a @@ -582,21 +583,19 @@ defined as follows: This function preprocesses and/or evaluates any Jacobian-related data needed by the Jacobian-times-vector routine. - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - - **Return value:** - The value to be returned by the Jacobian-vector setup - function should be 0 if successful, positive for a recoverable - error (in which case the step will be retried), or negative for an - unrecoverable error (in which case the integration is halted). - - **Notes:** + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: The value to be returned by the Jacobian-vector setup + function should be 0 if successful, positive for a recoverable + error (in which case the step will be retried), or negative for an + unrecoverable error (in which case the integration is halted). + + .. note:: + Each call to the Jacobian-vector setup function is preceded by a call to the implicit :c:type:`ARKRhsFn` user function with the same :math:`(t,y)` arguments. Thus, the setup @@ -608,20 +607,18 @@ defined as follows: quantities not in the argument list. These include the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to the ``ark_mem`` structure to - their ``user_data``, and then use the ``ARKStepGet*`` or - ``MRIStepGet*`` functions listed in - :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or - :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be - accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header - file ``sundials_types.h``. + their ``user_data``, and then use the ``ARKodeGet*`` functions + listed in :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff + can be accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the + header file ``sundials_types.h``. .. _ARKODE.Usage.PrecSolveFn: -Preconditioner solve (iterative linear solvers, ARKStep and MRIStep only) -------------------------------------------------------------------------- +Preconditioner solve +-------------------- If a user-supplied preconditioner is to be used with a SUNLinSol solver module, then the user must provide a function of type @@ -639,44 +636,41 @@ preconditioner matrices should approximate :math:`\mathcal{A}`. This function solves the preconditioner system :math:`Pz=r`. - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *r* -- the right-hand side vector of the linear system. - * *z* -- the computed output solution vector. - * *gamma* -- the scalar :math:`\gamma` appearing in the Newton - matrix given by :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. - * *delta* -- an input tolerance to be used if an iterative method - is employed in the solution. In that case, the residual vector - :math:`Res = r-Pz` of the system should be made to be less than *delta* - in the weighted :math:`l_2` norm, i.e. :math:`\left(\displaystyle \sum_{i=1}^n - \left(Res_i * ewt_i\right)^2 \right)^{1/2} < \delta`, where :math:`\delta =` - `delta`. To obtain the ``N_Vector`` *ewt*, call - :c:func:`ARKStepGetErrWeights` or :c:func:`MRIStepGetErrWeights`. - * *lr* -- an input flag indicating whether the preconditioner - solve is to use the left preconditioner (*lr* = 1) or the right - preconditioner (*lr* = 2). - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - - **Return value:** - The value to be returned by the preconditioner solve - function is a flag indicating whether it was successful. This value - should be 0 if successful, positive for a recoverable error (in - which case the step will be retried), or negative for an - unrecoverable error (in which case the integration is halted). + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param r: the right-hand side vector of the linear system. + :param z: the computed output solution vector. + :param gamma: the scalar :math:`\gamma` appearing in the Newton + matrix given by :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. + :param delta: an input tolerance to be used if an iterative method + is employed in the solution. In that case, the residual vector + :math:`Res = r-Pz` of the system should be made to be less than *delta* + in the weighted :math:`l_2` norm, i.e. :math:`\left(\displaystyle \sum_{i=1}^n + \left(Res_i * ewt_i\right)^2 \right)^{1/2} < \delta`, where :math:`\delta =` + `delta`. To obtain the ``N_Vector`` *ewt*, call + :c:func:`ARKodeGetErrWeights`. + :param lr: an input flag indicating whether the preconditioner + solve is to use the left preconditioner (*lr* = 1) or the right + preconditioner (*lr* = 2). + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: The value to be returned by the preconditioner solve + function is a flag indicating whether it was successful. This value + should be 0 if successful, positive for a recoverable error (in + which case the step will be retried), or negative for an + unrecoverable error (in which case the integration is halted). .. _ARKODE.Usage.PrecSetupFn: -Preconditioner setup (iterative linear solvers, ARKStep and MRIStep only) -------------------------------------------------------------------------- +Preconditioner setup +-------------------- -If the user's preconditioner routine requires that any data be +If the user's preconditioner routine above requires that any data be preprocessed or evaluated, then these actions need to occur within a user-supplied function of type :c:type:`ARKLsPrecSetupFn`. @@ -686,35 +680,33 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. This function preprocesses and/or evaluates Jacobian-related data needed by the preconditioner. - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *fy* -- the current value of the vector :math:`f^I(t,y)`. - * *jok* -- is an input flag indicating whether the Jacobian-related - data needs to be updated. The *jok* argument provides for the - reuse of Jacobian data in the preconditioner solve function. When - *jok* = ``SUNFALSE``, the Jacobian-related data should be recomputed - from scratch. When *jok* = ``SUNTRUE`` the Jacobian data, if saved from the - previous call to this function, can be reused (with the current - value of *gamma*). A call with *jok* = ``SUNTRUE`` can only occur - after a call with *jok* = ``SUNFALSE``. - * *jcurPtr* -- is a pointer to a flag which should be set to - ``SUNTRUE`` if Jacobian data was recomputed, or set to ``SUNFALSE`` if - Jacobian data was not recomputed, but saved data was still reused. - * *gamma* -- the scalar :math:`\gamma` appearing in the Newton - matrix given by :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData` - or :c:func:`MRIStepSetUserData`. - - **Return value:** - The value to be returned by the preconditioner setup - function is a flag indicating whether it was successful. This value - should be 0 if successful, positive for a recoverable error (in - which case the step will be retried), or negative for an - unrecoverable error (in which case the integration is halted). - - **Notes:** + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param fy: the current value of the vector :math:`f^I(t,y)`. + :param jok: is an input flag indicating whether the Jacobian-related + data needs to be updated. The *jok* argument provides for the + reuse of Jacobian data in the preconditioner solve function. When + *jok* = ``SUNFALSE``, the Jacobian-related data should be recomputed + from scratch. When *jok* = ``SUNTRUE`` the Jacobian data, if saved from the + previous call to this function, can be reused (with the current + value of *gamma*). A call with *jok* = ``SUNTRUE`` can only occur + after a call with *jok* = ``SUNFALSE``. + :param jcurPtr: is a pointer to a flag which should be set to + ``SUNTRUE`` if Jacobian data was recomputed, or set to ``SUNFALSE`` if + Jacobian data was not recomputed, but saved data was still reused. + :param gamma: the scalar :math:`\gamma` appearing in the Newton + matrix given by :math:`\mathcal{A}=M(t)-\gamma J(t,y)`. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: The value to be returned by the preconditioner setup + function is a flag indicating whether it was successful. This value + should be 0 if successful, positive for a recoverable error (in + which case the step will be retried), or negative for an + unrecoverable error (in which case the integration is halted). + + .. note:: + The operations performed by this function might include forming a crude approximate Jacobian, and performing an LU factorization of the resulting approximation to :math:`\mathcal{A} = M(t) - @@ -739,9 +731,8 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. quantities not in the call list. These include the current step size, the error weights, etc. To obtain these, the user will need to add a pointer to the ``ark_mem`` structure to their - ``user_data``, and then use the ``ARKStepGet*`` or ``MRIStepGet*`` - functions listed in :numref:`ARKODE.Usage.ARKStep.OptionalOutputs` or - :numref:`ARKODE.Usage.MRIStep.OptionalOutputs`. The unit roundoff can be + ``user_data``, and then use the ``ARKodeGet*`` functions listed in + :numref:`ARKODE.Usage.OptionalOutputs`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF``, which is defined in the header file ``sundials_types.h``. @@ -749,11 +740,12 @@ user-supplied function of type :c:type:`ARKLsPrecSetupFn`. .. _ARKODE.Usage.MassFn: -Mass matrix construction (matrix-based linear solvers, ARKStep only) --------------------------------------------------------------------- +Mass matrix construction +------------------------ -If a matrix-based mass-matrix linear solver is used (i.e., a non-NULL -SUNMATRIX was supplied to :c:func:`ARKStepSetMassLinearSolver`, the +For problems involving a non-identity mass matrix, if a matrix-based +mass-matrix linear solver is used (i.e., a non-NULL SUNMATRIX was +supplied to :c:func:`ARKodeSetMassLinearSolver`, the user must provide a function of type :c:type:`ARKLsMassFn` to provide the mass matrix approximation. @@ -763,23 +755,22 @@ the mass matrix approximation. This function computes the mass matrix :math:`M(t)` (or an approximation to it). - **Arguments:** - * *t* -- the current value of the independent variable. - * *M* -- the output mass matrix. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData()`. - * *tmp1*, *tmp2*, *tmp3* -- pointers to memory allocated to - variables of type ``N_Vector`` which can be used by an - ARKLsMassFn as temporary storage or work space. - - **Return value:** - An *ARKLsMassFn* function should return 0 if successful, or a - negative value if it failed unrecoverably (in which case the - integration is halted, :c:func:`ARKStepEvolve()` returns - *ARK_MASSSETUP_FAIL* and ARKLS sets *last_flag* to - *ARKLS_MASSFUNC_UNRECVR*). - - **Notes:** + :param t: the current value of the independent variable. + :param M: the output mass matrix. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + :param tmp1*: pointers to memory allocated to + variables of type ``N_Vector`` which can be used by an + ARKLsMassFn as temporary storage or work space. + + :return: An *ARKLsMassFn* function should return 0 if successful, or a + negative value if it failed unrecoverably (in which case the + integration is halted, :c:func:`ARKodeEvolve` returns + *ARK_MASSSETUP_FAIL* and ARKLS sets *last_flag* to + *ARKLS_MASSFUNC_UNRECVR*). + + .. note:: + Information regarding the structure of the specific ``SUNMatrix`` structure (e.g.~number of rows, upper/lower bandwidth, sparsity type) may be obtained through using the @@ -818,13 +809,14 @@ the mass matrix approximation. .. _ARKODE.Usage.MTimesFn: -Mass matrix-vector product (matrix-free linear solvers, ARKStep only) ---------------------------------------------------------------------- +Mass matrix-vector product +-------------------------- -If a matrix-free linear solver is to be used for mass-matrix linear -systems (i.e., a NULL-valued SUNMATRIX argument was supplied to -:c:func:`ARKStepSetMassLinearSolver()` in -:numref:`ARKODE.Usage.ARKStep.Skeleton`), the user *must* provide a +For problems involving a non-identity mass matrix, if a matrix-free +linear solver is to be used for mass-matrix linear systems (i.e., a +NULL-valued SUNMATRIX argument was supplied to +:c:func:`ARKodeSetMassLinearSolver` in +:numref:`ARKODE.Usage.Skeleton`), the user *must* provide a function of type :c:type:`ARKLsMassTimesVecFn` in the following form, to compute matrix-vector products :math:`M(t)\, v`. @@ -834,28 +826,27 @@ compute matrix-vector products :math:`M(t)\, v`. This function computes the product :math:`M(t)\, v` (or an approximation to it). - **Arguments:** - * *v* -- the vector to multiply. - * *Mv* -- the output vector computed. - * *t* -- the current value of the independent variable. - * *mtimes_data* -- a pointer to user data, the same as the - *mtimes_data* parameter that was passed to :c:func:`ARKStepSetMassTimes()`. + :param v: the vector to multiply. + :param Mv: the output vector computed. + :param t: the current value of the independent variable. + :param mtimes_data: a pointer to user data, the same as the *mtimes_data* + parameter that was passed to :c:func:`ARKodeSetMassTimes`. - **Return value:** - The value to be returned by the mass-matrix-vector product - function should be 0 if successful. Any other return value will - result in an unrecoverable error of the generic Krylov solver, - in which case the integration is halted. + :return: The value to be returned by the mass-matrix-vector product + function should be 0 if successful. Any other return value will + result in an unrecoverable error of the generic Krylov solver, + in which case the integration is halted. .. _ARKODE.Usage.MTSetupFn: -Mass matrix-vector product setup (matrix-free linear solvers, ARKStep only) ---------------------------------------------------------------------------- +Mass matrix-vector product setup +-------------------------------- -If the user's mass-matrix-times-vector routine requires that any mass -matrix-related data be preprocessed or evaluated, then this needs to +For problems involving a non-identity mass matrix and a matrix-free linear +solver, if the user's mass-matrix-times-vector routine requires that any +mass matrix-related data be preprocessed or evaluated, then this needs to be done in a user-supplied function of type :c:type:`ARKLsMassTimesSetupFn`, defined as follows: @@ -866,25 +857,24 @@ be done in a user-supplied function of type This function preprocesses and/or evaluates any mass-matrix-related data needed by the mass-matrix-times-vector routine. - **Arguments:** - * *t* -- the current value of the independent variable. - * *mtimes_data* -- a pointer to user data, the same as the - *mtimes_data* parameter that was passed to :c:func:`ARKStepSetMassTimes()`. + :param t: the current value of the independent variable. + :param mtimes_data: a pointer to user data, the same as the *mtimes_data* + parameter that was passed to :c:func:`ARKodeSetMassTimes`. - **Return value:** - The value to be returned by the mass-matrix-vector setup - function should be 0 if successful. Any other return value will - result in an unrecoverable error of the ARKLS mass matrix solver - interface, in which case the integration is halted. + :return: The value to be returned by the mass-matrix-vector setup + function should be 0 if successful. Any other return value will + result in an unrecoverable error of the ARKLS mass matrix solver + interface, in which case the integration is halted. .. _ARKODE.Usage.MassPrecSolveFn: -Mass matrix preconditioner solve (iterative linear solvers, ARKStep only) -------------------------------------------------------------------------- +Mass matrix preconditioner solve +-------------------------------- -If a user-supplied preconditioner is to be used with a SUNLINEAR +For problems involving a non-identity mass matrix and an iterative linear +solver, if a user-supplied preconditioner is to be used with a SUNLINEAR solver module for mass matrix linear systems, then the user must provide a function of type :c:type:`ARKLsMassPrecSolveFn` to solve the linear system :math:`Pz=r`, where :math:`P` may be either a left or right @@ -898,39 +888,38 @@ approximate :math:`M(t)`. This function solves the preconditioner system :math:`Pz=r`. - **Arguments:** - * *t* -- the current value of the independent variable. - * *r* -- the right-hand side vector of the linear system. - * *z* -- the computed output solution vector. - * *delta* -- an input tolerance to be used if an iterative method - is employed in the solution. In that case, the residual vector - :math:`Res = r-Pz` of the system should be made to be less than *delta* - in the weighted :math:`l_2` norm, i.e. :math:`\left(\displaystyle \sum_{i=1}^n - \left(Res_i * ewt_i\right)^2 \right)^{1/2} < \delta`, where :math:`\delta =` - *delta*. To obtain the ``N_Vector`` *ewt*, call - :c:func:`ARKStepGetErrWeights()`. - * *lr* -- an input flag indicating whether the preconditioner - solve is to use the left preconditioner (*lr* = 1) or the right - preconditioner (*lr* = 2). - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData()`. - - **Return value:** - The value to be returned by the preconditioner solve - function is a flag indicating whether it was successful. This value - should be 0 if successful, positive for a recoverable error (in - which case the step will be retried), or negative for an - unrecoverable error (in which case the integration is halted). + :param t: the current value of the independent variable. + :param r: the right-hand side vector of the linear system. + :param z: the computed output solution vector. + :param delta: an input tolerance to be used if an iterative method + is employed in the solution. In that case, the residual vector + :math:`Res = r-Pz` of the system should be made to be less than *delta* + in the weighted :math:`l_2` norm, i.e. :math:`\left(\displaystyle \sum_{i=1}^n + \left(Res_i * ewt_i\right)^2 \right)^{1/2} < \delta`, where :math:`\delta =` + *delta*. To obtain the ``N_Vector`` *ewt*, call + :c:func:`ARKodeGetErrWeights`. + :param lr: an input flag indicating whether the preconditioner + solve is to use the left preconditioner (*lr* = 1) or the right + preconditioner (*lr* = 2). + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. + + :return: The value to be returned by the preconditioner solve + function is a flag indicating whether it was successful. This value + should be 0 if successful, positive for a recoverable error (in + which case the step will be retried), or negative for an + unrecoverable error (in which case the integration is halted). .. _ARKODE.Usage.MassPrecSetupFn: -Mass matrix preconditioner setup (iterative linear solvers, ARKStep only) -------------------------------------------------------------------------- +Mass matrix preconditioner setup +-------------------------------- -If the user's mass matrix preconditioner above requires that any +For problems involving a non-identity mass matrix and an iterative linear +solver, if the user's mass matrix preconditioner above requires that any problem data be preprocessed or evaluated, then these actions need to occur within a user-supplied function of type :c:type:`ARKLsMassPrecSetupFn`. @@ -942,19 +931,18 @@ occur within a user-supplied function of type This function preprocesses and/or evaluates mass-matrix-related data needed by the preconditioner. - **Arguments:** - * *t* -- the current value of the independent variable. - * *user_data* -- a pointer to user data, the same as the - *user_data* parameter that was passed to :c:func:`ARKStepSetUserData()`. + :param t: the current value of the independent variable. + :param user_data: a pointer to user data, the same as the *user_data* + parameter that was passed to :c:func:`ARKodeSetUserData`. - **Return value:** - The value to be returned by the mass matrix preconditioner setup - function is a flag indicating whether it was successful. This value - should be 0 if successful, positive for a recoverable error (in - which case the step will be retried), or negative for an - unrecoverable error (in which case the integration is halted). + :return: The value to be returned by the mass matrix preconditioner setup + function is a flag indicating whether it was successful. This value + should be 0 if successful, positive for a recoverable error (in + which case the step will be retried), or negative for an + unrecoverable error (in which case the integration is halted). + + .. note:: - **Notes:** The operations performed by this function might include forming a mass matrix and performing an incomplete factorization of the result. Although such operations would @@ -976,8 +964,7 @@ Vector resize function For simulations involving changes to the number of equations and unknowns in the ODE system (e.g. when using spatial adaptivity in a PDE simulation), the ARKODE integrator may be "resized" between -integration steps, through calls to the :c:func:`ARKStepResize`, -:c:func:`ERKStepResize`, or :c:func:`MRIStepResize` +integration steps, through calls to the :c:func:`ARKodeResize` function. Typically, when performing adaptive simulations the solution is stored in a customized user-supplied data structure, to enable adaptivity without repeated allocation/deallocation of memory. In @@ -985,8 +972,7 @@ these scenarios, it is recommended that the user supply a customized vector kernel to interface between SUNDIALS and their problem-specific data structure. If this vector kernel includes a function of type :c:type:`ARKVecResizeFn` to resize a given vector implementation, then -this function may be supplied to :c:func:`ARKStepResize`, -:c:func:`ERKStepResize`, or :c:func:`MRIStepResize`, so that all +this function may be supplied to :c:func:`ARKodeResize` so that all internal ARKODE vectors may be resized, instead of deleting and re-creating them at each call. This resize function should have the following form: @@ -997,18 +983,16 @@ following form: This function resizes the vector *y* to match the dimensions of the supplied vector, *ytemplate*. - **Arguments:** - * *y* -- the vector to resize. - * *ytemplate* -- a vector of the desired size. - * *user_data* -- a pointer to user data, the same as the - *resize_data* parameter that was passed to :c:func:`ARKStepResize`, - :c:func:`ERKStepResize`, or :c:func:`MRIStepResize`. + :param y: the vector to resize. + :param ytemplate: a vector of the desired size. + :param user_data: a pointer to user data, the same as the *resize_data* + parameter that was passed to :c:func:`ARKodeResize`. + + :return: An *ARKVecResizeFn* function should return 0 if it successfully + resizes the vector *y*, and a non-zero value otherwise. - **Return value:** - An *ARKVecResizeFn* function should return 0 if it successfully - resizes the vector *y*, and a non-zero value otherwise. + .. note:: - **Notes:** If this function is not supplied, then ARKODE will instead destroy the vector *y* and clone a new vector *y* off of *ytemplate*. @@ -1029,20 +1013,19 @@ integrator for the inner integration. .. c:type:: int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector* f, int num_vecs, void* user_data) - **Arguments:** - * *t* -- the current value of the independent variable. - * *f* -- an ``N_Vector`` array of outer forcing vectors. - * *num_vecs* -- the number of vectors in the ``N_Vector`` array. - * *user_data* -- the `user_data` pointer that was passed to - :c:func:`MRIStepSetUserData()`. + :param t: the current value of the independent variable. + :param f: an ``N_Vector`` array of outer forcing vectors. + :param num_vecs: the number of vectors in the ``N_Vector`` array. + :param user_data: the `user_data` pointer that was passed to + :c:func:`MRIStepSetUserData`. + + :return: An *MRIStepPreInnerFn* function should return 0 if successful, a positive value + if a recoverable error occurred, or a negative value if an unrecoverable + error occurred. As the MRIStep module only supports fixed step sizes at this + time any non-zero return value will halt the integration. - **Return value:** - An *MRIStepPreInnerFn* function should return 0 if successful, a positive value - if a recoverable error occurred, or a negative value if an unrecoverable - error occurred. As the MRIStep module only supports fixed step sizes at this - time any non-zero return value will halt the integration. + .. note:: - **Notes:** In a heterogeneous computing environment if any data copies between the host and device vector data are necessary, this is where that should occur. @@ -1060,19 +1043,18 @@ outer integrator for the outer integration. .. c:type:: int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data) - **Arguments:** - * *t* -- the current value of the independent variable. - * *y* -- the current value of the dependent variable vector. - * *user_data* -- the ``user_data`` pointer that was passed to - :c:func:`MRIStepSetUserData`. + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param user_data: the ``user_data`` pointer that was passed to + :c:func:`MRIStepSetUserData`. - **Return value:** - An :c:func:`MRIStepPostInnerFn` function should return 0 if successful, a - positive value if a recoverable error occurred, or a negative value if an - unrecoverable error occurred. As the MRIStep module only supports fixed step - sizes at this time any non-zero return value will halt the integration. + :return: An :c:func:`MRIStepPostInnerFn` function should return 0 if successful, a + positive value if a recoverable error occurred, or a negative value if an + unrecoverable error occurred. As the MRIStep module only supports fixed step + sizes at this time any non-zero return value will halt the integration. + + .. note:: - **Notes:** In a heterogeneous computing environment if any data copies between the host and device vector data are necessary, this is where that should occur. @@ -1087,17 +1069,15 @@ Relaxation function When applying relaxation, an :c:func:`ARKRelaxFn` function is required to compute the conservative or dissipative function :math:`\xi(y)`. - **Arguments:** - * *y* -- the current value of the dependent variable vector. - * *r* -- the value of :math:`\xi(y)`. - * *user_data* -- the ``user_data`` pointer that was passed to - :c:func:`ARKStepSetUserData`. + :param y: the current value of the dependent variable vector. + :param r: the value of :math:`\xi(y)`. + :param user_data: the ``user_data`` pointer that was passed to + :c:func:`ARKodeSetUserData`. - **Return value:** - An :c:func:`ARKRelaxFn` function should return 0 if successful, a positive - value if a recoverable error occurred, or a negative value if an - unrecoverable error occurred. If a recoverable error occurs, the step size - will be reduced and the step repeated. + :return: An :c:func:`ARKRelaxFn` function should return 0 if successful, a positive + value if a recoverable error occurred, or a negative value if an + unrecoverable error occurred. If a recoverable error occurs, the step size + will be reduced and the step repeated. .. _ARKODE.Usage.RelaxJacFn: @@ -1110,14 +1090,12 @@ Relaxation Jacobian function compute the Jacobian :math:`\xi'(y)` of the :c:func:`ARKRelaxFn` :math:`\xi(y)`. - **Arguments:** - * *y* -- the current value of the dependent variable vector. - * *J* -- the Jacobian vector :math:`\xi'(y)`. - * *user_data* -- the ``user_data`` pointer that was passed to - :c:func:`ARKStepSetUserData`. - - **Return value:** - An :c:func:`ARKRelaxJacFn` function should return 0 if successful, a - positive value if a recoverable error occurred, or a negative value if an - unrecoverable error occurred. If a recoverable error occurs, the step size - will be reduced and the step repeated. + :param y: the current value of the dependent variable vector. + :param J: the Jacobian vector :math:`\xi'(y)`. + :param user_data: the ``user_data`` pointer that was passed to + :c:func:`ARKodeSetUserData`. + + :return: An :c:func:`ARKRelaxJacFn` function should return 0 if successful, a + positive value if a recoverable error occurred, or a negative value if an + unrecoverable error occurred. If a recoverable error occurs, the step size + will be reduced and the step repeated. diff --git a/doc/arkode/guide/source/Usage/index.rst b/doc/arkode/guide/source/Usage/index.rst index fba04368cd..2ecc9a671c 100644 --- a/doc/arkode/guide/source/Usage/index.rst +++ b/doc/arkode/guide/source/Usage/index.rst @@ -16,23 +16,66 @@ Using ARKODE ************ -This chapter discusses usage for ARKODE from C, C++ and Fortran applications. -The chapter builds upon :numref:`SUNDIALS`. We first discuss commonalities to -each of ARKODE's time-stepping modules, including locations and naming -conventions for the library and header files, and discussion of data types in -SUNDIALS. We then separately discuss the C and C++ interfaces to each of -ARKODE's time stepping modules: :ref:`ARKStep <ARKODE.Usage.ARKStep>`, +This chapter discusses usage of ARKODE for the solution of initial value +problems (IVPs) in C, C++ and Fortran applications. The chapter builds upon +:numref:`SUNDIALS`. Unlike other packages in SUNDIALS, ARKODE provides an +infrastructure for one-step methods. However, ARKODE's individual +time-stepping methods, including definition of the IVP itself, are handled +by time-stepping modules that sit on top of ARKODE. While most of the +routines to use ARKODE generally apply to all of its time-stepping modules, +some of these apply to only a subset of these "steppers," while others are +specific to a given stepper. + +Thus, we organize this chapter as follows. We first discuss commonalities +to each of ARKODE's time-stepping modules. These commonalities include the +locations and naming conventions for the library and header files, data types +in SUNDIALS, the layout of the user's main program, and a variety of +user-callable and user-supplied functions. For these user-callable routines, +we distinguish those that apply for only a subset of ARKODE's time-stepping +modules. We then describe shared utilities that are supported by some of +ARKODE's time stepping modules, including "relaxation" methods and +preconitioners. Following our discussion of these commonalities, we +separately discuss the usage details that that are specific to each of ARKODE's +time stepping modules: :ref:`ARKStep <ARKODE.Usage.ARKStep>`, :ref:`ERKStep <ARKODE.Usage.ERKStep>`, :ref:`SPRKStep <ARKODE.Usage.SPRKStep>` -and :ref:`MRIStep <ARKODE.Usage.MRIStep>`. Following these, we describe the set of -:ref:`user-supplied routines <ARKODE.Usage.UserSupplied>` -(both required and optional) that can be supplied to ARKODE. +and :ref:`MRIStep <ARKODE.Usage.MRIStep>`. + +ARKODE also uses various input and output constants; these are defined as +needed throughout this chapter, but for convenience the full list is provided +separately in :numref:`ARKODE.Constants`. + +The example programs for ARKODE are located in the source code ``examples/arkode`` +folder. We note that these may be helpful as templates for new codes. Users +with applications written in Fortran should see the chapter +:numref:`SUNDIALS.Fortran`, which describes the Fortran interfaces for +SUNDIALS, and we additionally include multiple Fortran example programs +in the ARKODE ``examples`` directory. + +When solving problems with an implicit component, we note that not all +SUNLINSOL, SUNMATRIX, and preconditioning modules are compatible with +all NVECTOR implementations. Details on compatibility are given in the +documentation for each SUNMATRIX (see :numref:`SUNMatrix`) and each +SUNLINSOL module (see :numref:`SUNLinSol`). For example, NVECTOR_PARALLEL +is not compatible with the dense, banded, or sparse SUNMATRIX types, +or with the corresponding dense, banded, or sparse SUNLINSOL modules. +Please check :numref:`SUNMatrix` and :numref:`SUNLinSol` to +verify compatibility between these modules. In addition to that +documentation, we note that the ARKBANDPRE preconditioning module is +only compatible with the NVECTOR_SERIAL, NVECTOR_OPENMP or +NVECTOR_PTHREADS vector implementations, and the preconditioner module +ARKBBDPRE can only be used with NVECTOR_PARALLEL. + .. toctree:: :maxdepth: 1 - General.rst + General + Skeleton + User_callable + User_supplied + Relaxation + Preconditioners ARKStep_c_interface/index.rst ERKStep_c_interface/index.rst SPRKStep_c_interface/index.rst MRIStep_c_interface/index.rst - User_supplied.rst diff --git a/doc/arkode/guide/source/index.rst b/doc/arkode/guide/source/index.rst index 809a408329..e809010fd0 100644 --- a/doc/arkode/guide/source/index.rst +++ b/doc/arkode/guide/source/index.rst @@ -19,7 +19,7 @@ ARKODE Documentation This is the documentation for ARKODE, an adaptive step time integration package for stiff, nonstiff and mixed stiff/nonstiff systems of ordinary differential equations (ODEs) using Runge--Kutta -(i.e. one-step, multi-stage) methods. The ARKODE solver is a +(i.e., one-step, multi-stage) methods. The ARKODE solver is a component of the `SUNDIALS <https://computing.llnl.gov/projects/sundials>`_ suite of nonlinear and differential/algebraic equation solvers. It is designed diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index 5607ca9084..fe7f768419 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -74,8 +74,128 @@ access to the internal integrator data required to evaluate :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`. -ARKStep advanced output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +ARKODE advanced output functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Two notable functions were already listed in :numref:`ARKODE.Usage.ARKodeMainOutputs`: + +* :c:func:`ARKodeGetCurrentState` -- returns the current state vector. + When called within the computation of a step (i.e., during a nonlinear solve) + this is the current stage state vector :math:`z_i = z_{pred} + z_{cor}`. + Otherwise this is the current internal solution state vector :math:`y(t)`. In + either case the corresponding stage or solution time can be obtained from + :c:func:`ARKodeGetCurrentTime`. + +* :c:func:`ARKodeGetCurrentGamma` -- returns the current value of the scalar :math:`\gamma`. + + +Additional advanced output functions that are provided to aid in the construction +of user-supplied SUNNonlinSol modules are as follows. + +.. c:function:: int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) + + Returns the current mass matrix. For a time dependent mass matrix the + corresponding time can be obtained from :c:func:`ARKodeGetCurrentTime`. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *M* -- SUNMatrix pointer that will get set to the current mass matrix + :math:`M(t)`. If a matrix-free method is used the output is ``NULL``. + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + +.. c:function:: int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) + + Returns all internal data required to construct the current nonlinear + implicit system :eq:`ARKODE_Residual_corrector` or :eq:`ARKODE_FixedPt_corrector`: + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *tcur* -- value of the independent variable corresponding to implicit + stage, :math:`t^I_{n,i}`. + * *zpred* -- the predicted stage vector :math:`z_{pred}` at + :math:`t^I_{n,i}`. This vector must not be changed. + * *z* -- the stage vector :math:`z_{i}` above. This vector may be not + current and may need to be filled (see the note below). + * *Fi* -- the implicit function evaluated at the current time and state, + :math:`f^I(t^I_{n,i}, z_{i})`. This vector may be not current and may + need to be filled (see the note below). + * *gamma* -- current :math:`\gamma` for implicit stage calculation. + * *sdata* -- accumulated data from previous solution and stages, + :math:`\tilde{a}_i`. This vector must not be changed. + * *user_data* -- pointer to the user-defined data structure (as specified + through :c:func:`ARKodeSetUserData`, or ``NULL`` otherwise) + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKODE memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + This routine is intended for users who whish to attach a custom + :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object + (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to + nonlinear system data to compute the nonlinear system function as part of + a custom ``SUNNonlinearSolver`` object. + + When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing + ``SUNNonlinearSolver`` object, the user should call + :c:func:`ARKodeGetNonlinearSystemData()` **inside** the nonlinear system + function to access the requisite data for evaluting the nonlinear systen + function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object + (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or + :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKODE (through + calls to :c:func:`SUNNonlinSolSetLSetupFn()` and + :c:func:`SUNNonlinSolSetLSolveFn()` respectively) the vectors *z* and *Fi* + **must be filled** in by the user's :c:type:`SUNNonlinSolSysFn` with the + current state and corresponding evaluation of the right-hand side function + respectively i.e., + + .. math:: + z &= z_{pred} + z_{cor}, \\ + Fi &= f^I\left(t^I_{n,i}, z_i\right), + + where :math:`z_{cor}` was the first argument supplied to the + :c:type:`SUNNonlinSolSysFn`. + + If this function is called as part of a custom linear solver (i.e., the + default :c:type:`SUNNonlinSolSysFn` is used) then the vectors *z* and + *Fi* are only current when :c:func:`ARKodeGetNonlinearSystemData()` is + called after an evaluation of the nonlinear system function. + + +.. c:function:: int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) + + Computes the current stage state vector using the stored prediction and the + supplied correction from the nonlinear solver i.e., + :math:`z_i(t) = z_{pred} + z_{cor}`. + + **Arguments:** + * *arkode_mem* -- pointer to the ARKODE memory block. + * *zcor* -- the correction from the nonlinear solver. + * *z* -- on output, the current stage state vector :math:`z_i`. + + **Return value:** + * ``ARK_SUCCESS`` if successful. + * ``ARK_MEM_NULL`` if the ARKODE memory was ``NULL``. + + .. note:: + + This is only compatible with time-stepping modules that support implicit algebraic solvers. + + + +ARKStep advanced output functions (deprecated) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.ARKStep.ARKStepMainOutputs`: @@ -106,6 +226,10 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetCurrentMassMatrix` instead. + .. c:function:: int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype *tcur, N_Vector *zpred, N_Vector *z, N_Vector *Fi, sunrealtype *gamma, N_Vector *sdata, void **user_data) @@ -166,6 +290,10 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`ARKStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinearSystemData` instead. + .. c:function:: int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -182,10 +310,13 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeComputeState` instead. -MRIStep advanced output functions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +MRIStep advanced output functions (deprecated) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Two notable functions were already listed in :numref:`ARKODE.Usage.MRIStep.MRIStepMainOutputs`: @@ -262,6 +393,10 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`MRIStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNonlinearSystemData` instead. + .. c:function:: int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) @@ -277,3 +412,7 @@ of user-supplied SUNNonlinSol modules are as follows. **Return value:** * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the MRIStep memory was ``NULL``. + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeComputeState` instead. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ccf3d01e17..57674c7f94 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,5 +1,16 @@ **New Features** +Created shared user interface for ARKODE user-callable routines, to allow more +uniform control over time-stepping algorithms, improved extensibility, and +simplified code maintenance. Marked the corresponding stepper-specific +user-callable routines as deprecated; these will be removed in a future major +release. + +Added "Resize" capability to ARKODE's SPRKStep time-stepping module. + +Deprecated ``ARKStepSetOptimalParams`` function; added instructions to user guide +for users who wish to retain the current functionality. + Added CMake infrastructure that enables externally maintained addons/plugins to be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. 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 a1f583cbd7..8bee143d0b 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -246,20 +246,20 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData*", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData*", 1)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Create the (non)linear solver */ if (uopt->global) @@ -269,20 +269,20 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, if (check_retval((void*)NLS, "SUNNonlinSol_Newton", 0)) { return 1; } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } /* Create linear solver */ LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, ctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, NULL, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1)) { return 1; } + retval = ARKodeSetPreconditioner(arkode_mem, NULL, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1)) { return 1; } } else { @@ -292,8 +292,8 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, if (check_retval((void*)NLS, "TaskLocalNewton", 0)) { return 1; } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } } /* Output initial condition */ @@ -313,8 +313,8 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* Output state */ WriteOutput(t, y, udata, uopt); @@ -328,24 +328,24 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); if (uopt->global) { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1); } /* Print final statistics */ @@ -366,7 +366,7 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -390,20 +390,20 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, if (check_retval((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } /* Select the method order */ - retval = ERKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ERKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ERKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) @@ -422,8 +422,8 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, do { /* Integrate to output time */ - retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* Output state */ WriteOutput(t, y, udata, uopt); @@ -437,14 +437,14 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, while (iout < uopt->nout); /* Get final statistics */ - retval = ERKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ERKStepGetNumSteps", 1); - retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ERKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1); - retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ERKStepGetNumErrTestFails", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); /* Print final statistics */ if (udata->myid == 0) @@ -456,7 +456,7 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, } /* Clean up */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* Return success */ return (0); @@ -911,9 +911,9 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) double tcur, gamma; void* user_data; - retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) + retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) { return (-1); } @@ -956,9 +956,9 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) double tcur, gamma; void* user_data = NULL; - retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) + retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) { return (-1); } diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index d70b4d680c..63108a9bd2 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -611,16 +611,8 @@ int main(int argc, char* argv[]) udata.evolve.start(); // Evolve - if (udata.integrator) - { - flag = MRIStepEvolve(arkode_mem, tout, u, &t, stepmode); - if (check_flag(&flag, "MRIStepEvolve", 1)) { break; } - } - else - { - flag = ARKStepEvolve(arkode_mem, tout, u, &t, stepmode); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } - } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, stepmode); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer udata.evolve.stop(); @@ -678,14 +670,14 @@ int main(int argc, char* argv[]) switch (udata.integrator) { - case (0): ARKStepFree(&arkode_mem); break; + case (0): ARKodeFree(&arkode_mem); break; case (1): { void* inner_arkode_mem = NULL; MRIStepInnerStepper_GetContent(stepper, &inner_arkode_mem); - ARKStepFree(&inner_arkode_mem); + ARKodeFree(&inner_arkode_mem); MRIStepInnerStepper_Free(&stepper); - MRIStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); break; } case (2): @@ -698,7 +690,7 @@ int main(int argc, char* argv[]) delete content; MRIStepInnerStepper_Free(&stepper); SUNNonlinSolFree(NLS); - MRIStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); break; } default: cerr << "Invalid integrator option" << endl; break; @@ -928,51 +920,51 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, if (check_flag((void*)*arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(*arkode_mem, udata->rtol_imex, udata->atol_imex); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(*arkode_mem, udata->rtol_imex, udata->atol_imex); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } if (udata->diffusion) { // Attach linear solver - flag = ARKStepSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } } // Select method order - flag = ARKStepSetOrder(*arkode_mem, udata->order_imex); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(*arkode_mem, udata->order_imex); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata->h_imex > ZERO) { - flag = ARKStepSetFixedStep(*arkode_mem, udata->h_imex); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, udata->h_imex); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -985,17 +977,17 @@ static int SetupARK(SUNContext ctx, UserData* udata, N_Vector u, 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; } + flag = ARKodeSetAdaptController(*arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } return 0; } @@ -1015,23 +1007,22 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, if (check_flag((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(inner_arkode_mem, udata->rtol_fast, - udata->atol_fast); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(inner_arkode_mem, udata->rtol_fast, udata->atol_fast); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(inner_arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(inner_arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Select method order - flag = ARKStepSetOrder(inner_arkode_mem, udata->order_fast); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(inner_arkode_mem, udata->order_fast); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata->h_fast > ZERO) { - flag = ARKStepSetFixedStep(inner_arkode_mem, udata->h_fast); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(inner_arkode_mem, udata->h_fast); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -1044,13 +1035,13 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, 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; } + flag = ARKodeSetAdaptController(inner_arkode_mem, *Ctrl); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(inner_arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, stepper); @@ -1075,50 +1066,50 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, MRIStepCoupling_Free(C); // Set the slow step size - flag = MRIStepSetFixedStep(*arkode_mem, udata->h_slow); - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, udata->h_slow); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = MRIStepSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = MRIStepSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = MRIStepSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = MRIStepSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = MRIStepSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "MRIStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = MRIStepSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = MRIStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = MRIStepSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } return 0; } @@ -1219,50 +1210,50 @@ static int SetupMRICVODE(SUNContext ctx, UserData* udata, N_Vector y, MRIStepCoupling_Free(C); // Set the slow step size - flag = MRIStepSetFixedStep(*arkode_mem, udata->h_slow); - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, udata->h_slow); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(*arkode_mem, udata->rtol_slow, udata->atol_slow); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = MRIStepSetUserData(*arkode_mem, (void*)udata); - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = MRIStepSetLinearSolver(*arkode_mem, LS, NULL); - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = MRIStepSetPreconditioner(*arkode_mem, NULL, PSolve); - if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(*arkode_mem, NULL, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = MRIStepSetLSetupFrequency(*arkode_mem, udata->msbp); - if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = MRIStepSetEpsLin(*arkode_mem, udata->epslin); - if (check_flag(&flag, "MRIStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(*arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = MRIStepSetLinear(*arkode_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = MRIStepSetMaxNumSteps(*arkode_mem, udata->maxsteps); - if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = MRIStepSetStopTime(*arkode_mem, udata->tf); - if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } return 0; } @@ -2603,31 +2594,31 @@ static int OutputStatsIMEX(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } if (udata->diffusion) { - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } } cout << fixed; @@ -2663,10 +2654,10 @@ static int OutputStatsIMEX(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; @@ -2685,24 +2676,24 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, // Get slow integrator and solver stats long int nsts, nfse, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = MRIStepGetNumSteps(arkode_mem, &nsts); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nsts); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "MRIStepGetNumLinIters", 1)) { return -1; } - flag = MRIStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "MRIStepGetNumLinConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return -1; } - flag = MRIStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1)) { return -1; } - flag = MRIStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "MRIStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2731,10 +2722,10 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, if (udata->prec) { long int npe, nps; - flag = MRIStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "MRIStepGetNumPrecEvals", 1)) { return -1; } - flag = MRIStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "MRIStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; @@ -2747,12 +2738,12 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, long int nstf, nstf_a, netff, nffe, nffi; - flag = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(inner_arkode_mem, &nstf_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(inner_arkode_mem, &netff); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(inner_arkode_mem, &nstf_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(inner_arkode_mem, &netff); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } @@ -2773,24 +2764,24 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, // Get slow integrator and solver stats long int nsts, nfse, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = MRIStepGetNumSteps(arkode_mem, &nsts); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nsts); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "MRIStepGetNumLinIters", 1)) { return -1; } - flag = MRIStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "MRIStepGetNumLinConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return -1; } - flag = MRIStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1)) { return -1; } - flag = MRIStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "MRIStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2819,10 +2810,10 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, if (udata->prec) { long int npe, nps; - flag = MRIStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "MRIStepGetNumPrecEvals", 1)) { return -1; } - flag = MRIStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "MRIStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 5c1a264c8f..78a25fa210 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -41,7 +41,7 @@ * problem is advanced in time with a diagonally implicit Runge-Kutta method * using an inexact Newton method paired with the PCG or SPGMR linear solver. * Several command line options are available to change the problem parameters - * and ARKStep settings. Use the flag --help for more information. + * and ARKODE settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <cmath> @@ -382,7 +382,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -390,38 +390,38 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -445,8 +445,8 @@ int main(int argc, char* argv[]) // Set fixed step size or adaptivity method if (udata->hfixed > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -459,24 +459,24 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -499,8 +499,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -560,10 +560,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + 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 @@ -1820,28 +1820,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -1870,10 +1870,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index 7b2031e540..09e95bc328 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -41,7 +41,7 @@ * problem is advanced in time with a diagonally implicit Runge-Kutta method * using an inexact Newton method paired with the hypre's PCG or GMRES linear * solver and PFMG preconditioner. Several command line options are available - * to change the problem parameters and ARKStep settings. Use the flag --help + * to change the problem parameters and ARKODE settings. Use the flag --help * for more information. * ---------------------------------------------------------------------------*/ @@ -439,7 +439,7 @@ int main(int argc, char* argv[]) if (check_flag((void*)LS, "HypreLS", 0)) { return 1; } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -447,35 +447,35 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } // Specify the Jacobian evaluation function - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } // Set linear solver setup frequency (update linear system matrix) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -499,8 +499,8 @@ int main(int argc, char* argv[]) // Set fixed step size or adaptivity method if (udata->hfixed > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -513,24 +513,24 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -553,8 +553,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -614,11 +614,11 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - SUNMatDestroy(A); // Free matrix - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + SUNMatDestroy(A); // Free matrix + 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 @@ -2120,26 +2120,26 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJeval; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumJacEvals(arkode_mem, &nJeval); - if (check_flag(&flag, "ARKStepGetNumJacEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumJacEvals(arkode_mem, &nJeval); + if (check_flag(&flag, "ARKodeGetNumJacEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index eeb61d0af4..bb541e41d6 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -41,7 +41,7 @@ * problem is advanced in time with a diagonally implicit Runge-Kutta method * using an inexact Newton method paired with the PCG or SPGMR linear solver * using hypre's PFMG preconditioner. Several command line options are available - * to change the problem parameters and ARKStep settings. Use the flag --help + * to change the problem parameters and ARKODE settings. Use the flag --help * for more information. * ---------------------------------------------------------------------------*/ @@ -412,7 +412,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -420,45 +420,45 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->matvec) { // Attach Jacobian-vector product function - flag = ARKStepSetJacTimes(arkode_mem, NULL, JTimes); - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, JTimes); + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -482,8 +482,8 @@ int main(int argc, char* argv[]) // Set fixed step size or adaptivity method if (udata->hfixed > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -496,24 +496,24 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -536,8 +536,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -597,10 +597,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + 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 @@ -2634,28 +2634,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2684,10 +2684,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; 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 b36045a68d..8410570911 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -41,7 +41,7 @@ * If the requested accuracy is 5th order, the problem is treated implicitly. * This option is included for computing a reference solution. * Several command line options are available to - * change the problem parameters and ARKStep settings. Use the flag --help for + * change the problem parameters and ARKODE settings. Use the flag --help for * more information. * ---------------------------------------------------------------------------*/ @@ -391,7 +391,7 @@ int main(int argc, char* argv[]) } // ---------------------------------------------- - // Setup ARKStep integrator and set options + // Setup ARKODE integrator and set options // ---------------------------------------------- // Create integrator @@ -407,37 +407,37 @@ int main(int argc, char* argv[]) } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata.prectype != SUN_PREC_NONE) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set max steps between linear solver (preconditioner) setup calls - flag = ARKStepSetLSetupFrequency(arkode_mem, udata.msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata.msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata.epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata.epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata.order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata.order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata.hf > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, udata.hf); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata.hf); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -450,28 +450,28 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata.linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Attach user data - flag = ARKStepSetUserData(arkode_mem, &udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, udata.maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata.maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -494,8 +494,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -539,7 +539,7 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory + ARKodeFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors FreeUserData(&udata); // Free user data @@ -2720,26 +2720,26 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2767,10 +2767,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prectype != SUN_PREC_NONE) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; 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 9cd4b0eab9..1f90ddcc7a 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -39,7 +39,7 @@ * an inexact Newton method paired with the PCG linear solver using hypre's PFMG * preconditioner for the slow-implicit nonlinear solve and inexact Newton with * GMRES for the fast nonlinear solve. Several command line options are - * available to change the problem parameters and ARKStep settings. Use the flag + * available to change the problem parameters and ARKODE settings. Use the flag * --help for more information. * ---------------------------------------------------------------------------*/ @@ -413,26 +413,26 @@ int main(int argc, char* argv[]) if (check_flag((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(inner_arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(inner_arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(inner_arkode_mem, LSf, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(inner_arkode_mem, LSf, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(inner_arkode_mem, udata.epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(inner_arkode_mem, udata.epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Use an ARKode provided table - flag = ARKStepSetOrder(inner_arkode_mem, udata.forder); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(inner_arkode_mem, udata.forder); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata.hf > ZERO) { - flag = ARKStepSetFixedStep(inner_arkode_mem, udata.hf); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(inner_arkode_mem, udata.hf); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -447,17 +447,17 @@ int main(int argc, char* argv[]) Ctrl = SUNAdaptController_ImExGus(sunctx); break; } - flag = ARKStepSetAdaptController(inner_arkode_mem, Ctrl); - if (check_flag(&flag, "ARKStepSetAdaptController", 1)) { return 1; } + flag = ARKodeSetAdaptController(inner_arkode_mem, Ctrl); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Attach user data - flag = ARKStepSetUserData(inner_arkode_mem, &udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(inner_arkode_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(inner_arkode_mem, udata.maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(inner_arkode_mem, udata.maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Create inner stepper flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -475,27 +475,27 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(arkode_mem, udata.rtol, udata.atol); - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata.rtol, udata.atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach linear solver - flag = MRIStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata.prectype != SUN_PREC_NONE) { // Attach preconditioner - flag = MRIStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set max steps between linear solver (preconditioner) setup calls - flag = MRIStepSetLSetupFrequency(arkode_mem, udata.msbp); - if (check_flag(&flag, "MRIStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata.msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = MRIStepSetEpsLin(arkode_mem, udata.epslin); - if (check_flag(&flag, "MRIStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata.epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } if (udata.sorder == 3) { @@ -513,27 +513,27 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "MRIStepSetCoupling", 1)) { return 1; } // Set fixed step size - flag = MRIStepSetFixedStep(arkode_mem, udata.hs); - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata.hs); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } // Specify linearly implicit non-time-dependent RHS if (udata.linear) { - flag = MRIStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Attach user data - flag = MRIStepSetUserData(arkode_mem, &udata); - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Set max steps between outputs - flag = MRIStepSetMaxNumSteps(arkode_mem, udata.maxsteps); - if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata.maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = MRIStepSetStopTime(arkode_mem, udata.tf); - if (check_flag(&flag, "MRIStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata.tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -556,8 +556,8 @@ int main(int argc, char* argv[]) t1 = MPI_Wtime(); // Evolve in time - flag = MRIStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "MRIStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = MPI_Wtime(); @@ -605,8 +605,8 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - MRIStepFree(&arkode_mem); // Free slow integrator memory - ARKStepFree(&inner_arkode_mem); // Free fast integrator memory + ARKodeFree(&arkode_mem); // Free slow integrator memory + ARKodeFree(&inner_arkode_mem); // Free fast integrator memory MRIStepInnerStepper_Free(&inner_stepper); // Free inner stepper MRIStepCoupling_Free(C); // Free coupling coefficients SUNLinSolFree(LS); // Free linear solver @@ -2695,26 +2695,26 @@ static int OutputFastStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2742,10 +2742,10 @@ static int OutputFastStats(void* arkode_mem, UserData* udata) if (udata->prectype != SUN_PREC_NONE) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; @@ -2763,22 +2763,22 @@ static int OutputSlowStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; - flag = MRIStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "MRIStepGetNumLinIters", 1)) { return -1; } - flag = MRIStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "MRIStepGetNumLinConvFails", 1)) { return -1; } - flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return -1; } - flag = MRIStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "MRIStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -2802,10 +2802,10 @@ static int OutputSlowStats(void* arkode_mem, UserData* udata) if (udata->prectype != SUN_PREC_NONE) { long int npe, nps; - flag = MRIStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "MRIStepGetNumPrecEvals", 1)) { return -1; } - flag = MRIStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "MRIStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index fc403e7404..9afe3e1ac3 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) // Setup the integrator // -------------------- - // ERKStep, ARKStep, or MRIStep memory structure + // ARKODE memory structure void* arkode_mem = nullptr; // Matrix and linear solver for DIRK, IMEX, or MRI slow integrators @@ -234,55 +234,16 @@ int main(int argc, char* argv[]) for (int iout = 0; iout < uopts.nout; iout++) { // Evolve - switch (uopts.integrator) + if (uopts.output == 3) { - case (0): - if (uopts.output == 3) - { - // Stop at output time (do not interpolate output) - flag = ERKStepSetStopTime(arkode_mem, tout); - if (check_flag(flag, "ARKStepSetStopTime")) { return 1; } - } - - // Advance in time - flag = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - break; - case (1): - if (uopts.output == 3) - { - // Stop at output time (do not interpolate output) - flag = ARKStepSetStopTime(arkode_mem, tout); - if (check_flag(flag, "ARKStepSetStopTime")) { return 1; } - } - - // Advance in time - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - break; - case (2): - if (uopts.output == 3) - { - // Stop at output time (do not interpolate output) - flag = MRIStepSetStopTime(arkode_mem, tout); - if (check_flag(flag, "MRIStepSetStopTime")) { return 1; } - } - - // Advance in time - flag = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - break; - case (3): - if (uopts.output == 3) - { - // Stop at output time (do not interpolate output) - flag = MRIStepSetStopTime(arkode_mem, tout); - if (check_flag(flag, "MRIStepSetStopTime")) { return 1; } - } - - // Advance in time - flag = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - break; - default: flag = -1; + // Stop at output time (do not interpolate output) + flag = ARKodeSetStopTime(arkode_mem, tout); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } } - if (check_flag(flag, "Evolve")) { break; } + + // Advance in time + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_flag(flag, "ARKodeEvolve")) { break; } // Output solution flag = WriteOutput(t, y, udata, uopts); @@ -321,15 +282,15 @@ int main(int argc, char* argv[]) switch (uopts.integrator) { - case (0): ERKStepFree(&arkode_mem); break; - case (1): ARKStepFree(&arkode_mem); break; + case (0): ARKodeFree(&arkode_mem); break; + case (1): ARKodeFree(&arkode_mem); break; case (2): { void* inner_arkode_mem = nullptr; MRIStepInnerStepper_GetContent(fast_mem, &inner_arkode_mem); - ARKStepFree(&inner_arkode_mem); + ARKodeFree(&inner_arkode_mem); MRIStepInnerStepper_Free(&fast_mem); - MRIStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); break; } case (3): @@ -340,7 +301,7 @@ int main(int argc, char* argv[]) CVodeFree(&(content->cvode_mem)); delete content; MRIStepInnerStepper_Free(&fast_mem); - MRIStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); break; } } @@ -391,22 +352,22 @@ int SetupERK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ERKStepCreate")) { return 1; } // Specify tolerances - int flag = ERKStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ERKStepSStolerances")) { return 1; } + int flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } // Attach user data - flag = ERKStepSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ERKStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // Select method order - flag = ERKStepSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ERKStepSetOrder")) { return 1; } + flag = ARKodeSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ARKodeSetOrder")) { return 1; } // Set fixed step size or adaptivity method if (uopts.fixed_h > ZERO) { - flag = ERKStepSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "ERKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } else if (uopts.controller >= 0) { @@ -419,17 +380,17 @@ int SetupERK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, 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; } + flag = ARKodeSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ERKStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ERKStepSetMaxNumSteps")) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ERKStepSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ERKStepSetStopTime")) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } return 0; } @@ -583,12 +544,12 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } // Specify tolerances - int flag = ARKStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + int flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } // Attach user data - flag = ARKStepSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "ARKStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // If implicit, setup solvers if (fi_RHS) @@ -602,26 +563,26 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKStepSetJacFn(*arkode_mem, Ji_RHS); - if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(*arkode_mem, Ji_RHS); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } // Set the predictor method - flag = ARKStepSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "ARKStepSetPredictorMethod")) { return 1; } + flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } // Set linear solver setup frequency - flag = ARKStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "ARKStepSetLSetupFrequency")) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = ARKStepSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "ARKStepSetLinear")) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "ARKodeSetLinear")) { return 1; } } } @@ -653,15 +614,15 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, else { // Select default method of a given order - flag = ARKStepSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "ARKStepSetOrder")) { return 1; } + flag = ARKodeSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ARKodeSetOrder")) { return 1; } } // Set fixed step size or adaptivity method if (uopts.fixed_h > ZERO) { - flag = ARKStepSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } else if (uopts.controller >= 0) { @@ -674,17 +635,17 @@ int SetupARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, 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; } + flag = ARKodeSetAdaptController(*arkode_mem, *C); + if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKStepSetMaxNumSteps")) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "ARKStepSetStopTime")) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } return 0; } @@ -756,13 +717,13 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } // Specify tolerances - int flag = ARKStepSStolerances(fast_arkode_mem, uopts.rtol_fast, - uopts.atol_fast); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + int flag = ARKodeSStolerances(fast_arkode_mem, uopts.rtol_fast, + uopts.atol_fast); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } // Attach user data - flag = ARKStepSetUserData(fast_arkode_mem, &udata); - if (check_flag(flag, "ARKStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(fast_arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // If implicit, setup solvers if (ffi_RHS) @@ -776,31 +737,31 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*LS_fast, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(fast_arkode_mem, *LS_fast, *A_fast); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(fast_arkode_mem, *LS_fast, *A_fast); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = ARKStepSetJacFn(fast_arkode_mem, Jfi_RHS); - if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(fast_arkode_mem, Jfi_RHS); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } // Set the predictor method - flag = ARKStepSetPredictorMethod(fast_arkode_mem, uopts.predictor_fast); - if (check_flag(flag, "ARKStepSetPredictorMethod")) { return 1; } + flag = ARKodeSetPredictorMethod(fast_arkode_mem, uopts.predictor_fast); + if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } // Set linear solver setup frequency - flag = ARKStepSetLSetupFrequency(fast_arkode_mem, uopts.ls_setup_freq_fast); - if (check_flag(flag, "ARKStepSetLSetupFrequency")) { return 1; } + flag = ARKodeSetLSetupFrequency(fast_arkode_mem, uopts.ls_setup_freq_fast); + if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } } // Select method order - flag = ARKStepSetOrder(fast_arkode_mem, uopts.order_fast); - if (check_flag(flag, "ARKStepSetOrder")) { return 1; } + flag = ARKodeSetOrder(fast_arkode_mem, uopts.order_fast); + if (check_flag(flag, "ARKodeSetOrder")) { return 1; } // Set fixed step size or adaptivity method if (uopts.fixed_h_fast > ZERO) { - flag = ARKStepSetFixedStep(fast_arkode_mem, uopts.fixed_h_fast); - if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(fast_arkode_mem, uopts.fixed_h_fast); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } else if (uopts.controller_fast >= 0) { @@ -813,13 +774,13 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, 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; } + flag = ARKodeSetAdaptController(fast_arkode_mem, *C); + if (check_flag(flag, "ARKodeSetAdaptController")) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(fast_arkode_mem, uopts.maxsteps); - if (check_flag(flag, "ARKStepSetMaxNumSteps")) { return 1; } + flag = ARKodeSetMaxNumSteps(fast_arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper flag = ARKStepCreateMRIStepInnerStepper(fast_arkode_mem, fast_mem); @@ -834,16 +795,16 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*arkode_mem, "MRIStepCreate")) { return 1; } // Set the slow step size - flag = MRIStepSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "MRIStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "MRIStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } // Attach user data - flag = MRIStepSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "MRIStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // If implicit, setup solvers if (fsi_RHS) @@ -857,40 +818,40 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = MRIStepSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = MRIStepSetJacFn(*arkode_mem, Jsi_RHS); - if (check_flag(flag, "MRIStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(*arkode_mem, Jsi_RHS); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } // Set linear solver setup frequency - flag = MRIStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "MRIStepSetLSetupFrequency")) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } // Set the predictor method - flag = MRIStepSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "MRIStepSetPredictorMethod")) { return 1; } + flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = MRIStepSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "MRIStepSetLinear")) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "ARKodeSetLinear")) { return 1; } } } // Select method order - flag = MRIStepSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "MRIStepSetOrder")) { return 1; } + flag = ARKodeSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ARKodeSetOrder")) { return 1; } // Set max steps between outputs - flag = MRIStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "MRIStepSetMaxNumSteps")) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Set stopping time - flag = MRIStepSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "MRIStepSetStopTime")) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } return 0; } @@ -1025,16 +986,16 @@ int SetupMRICVODE(SUNContext ctx, UserData& udata, UserOptions& uopts, if (check_ptr(*arkode_mem, "MRIStepCreate")) { return 1; } // Set the slow step size - flag = MRIStepSetFixedStep(*arkode_mem, uopts.fixed_h); - if (check_flag(flag, "MRIStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(*arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(*arkode_mem, uopts.rtol, uopts.atol); - if (check_flag(flag, "MRIStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(*arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } // Attach user data - flag = MRIStepSetUserData(*arkode_mem, &udata); - if (check_flag(flag, "MRIStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(*arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // If implicit, setup solvers if (fsi_RHS) @@ -1048,40 +1009,40 @@ int SetupMRICVODE(SUNContext ctx, UserData& udata, UserOptions& uopts, if (check_ptr(*LS, "SUNLinSol_Band")) { return 1; } // Attach linear solver - flag = MRIStepSetLinearSolver(*arkode_mem, *LS, *A); - if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(*arkode_mem, *LS, *A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } // Attach Jacobian function - flag = MRIStepSetJacFn(*arkode_mem, Jsi_RHS); - if (check_flag(flag, "MRIStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(*arkode_mem, Jsi_RHS); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } // Set linear solver setup frequency - flag = MRIStepSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); - if (check_flag(flag, "MRIStepSetLSetupFrequency")) { return 1; } + flag = ARKodeSetLSetupFrequency(*arkode_mem, uopts.ls_setup_freq); + if (check_flag(flag, "ARKodeSetLSetupFrequency")) { return 1; } // Set the predictor method - flag = MRIStepSetPredictorMethod(*arkode_mem, uopts.predictor); - if (check_flag(flag, "MRIStepSetPredictorMethod")) { return 1; } + flag = ARKodeSetPredictorMethod(*arkode_mem, uopts.predictor); + if (check_flag(flag, "ARKodeSetPredictorMethod")) { return 1; } if (uopts.linear) { // Specify linearly implicit non-time-dependent RHS - flag = MRIStepSetLinear(*arkode_mem, SUNFALSE); - if (check_flag(flag, "MRIStepSetLinear")) { return 1; } + flag = ARKodeSetLinear(*arkode_mem, SUNFALSE); + if (check_flag(flag, "ARKodeSetLinear")) { return 1; } } } // Select method order - flag = MRIStepSetOrder(*arkode_mem, uopts.order); - if (check_flag(flag, "MRIStepSetOrder")) { return 1; } + flag = ARKodeSetOrder(*arkode_mem, uopts.order); + if (check_flag(flag, "ARKodeSetOrder")) { return 1; } // Set max steps between outputs - flag = MRIStepSetMaxNumSteps(*arkode_mem, uopts.maxsteps); - if (check_flag(flag, "MRIStepSetMaxNumSteps")) { return 1; } + flag = ARKodeSetMaxNumSteps(*arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Set stopping time - flag = MRIStepSetStopTime(*arkode_mem, udata.tf); - if (check_flag(flag, "MRIStepSetStopTime")) { return 1; } + flag = ARKodeSetStopTime(*arkode_mem, udata.tf); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } return 0; } diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index 293cf06d48..6d0bc8a09d 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -291,12 +291,12 @@ int OutputStatsERK(void* arkode_mem, UserData& udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe; - flag = ERKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(flag, "ERKStepGetNumSteps")) { return -1; } - flag = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(flag, "ERKStepGetNumStepAttempts")) { return -1; } - flag = ERKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(flag, "ERKStepGetNumErrTestFails")) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); if (check_flag(flag, "ERKStepGetNumRhsEvals")) { return -1; } @@ -315,12 +315,12 @@ int OutputStatsARK(void* arkode_mem, UserData& udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(flag, "ARKStepGetNumSteps")) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(flag, "ARKStepGetNumStepAttempts")) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(flag, "ARKStepGetNumErrTestFails")) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } @@ -334,16 +334,16 @@ int OutputStatsARK(void* arkode_mem, UserData& udata) if (udata.splitting) { long int nni, ncfn; - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "ARKStepGetNumNonlinSolvIters")) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "ARKStepGetNumNonlinSolvConvFails")) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "ARKStepGetNumLinSolvSetups")) { return -1; } - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "ARKStepGetNumJacEvals")) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -369,8 +369,8 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, // Get slow integrator and solver stats long int nst, nst_a, netf, nfe, nfi; - flag = MRIStepGetNumSteps(arkode_mem, &nst); - if (check_flag(flag, "MRIStepGetNumSteps")) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } @@ -383,16 +383,16 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, if (udata.diffusion) { long int nni, ncfn; - flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "MRIStepGetNumNonlinSolvIters")) { return -1; } - flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "MRIStepGetNumNonlinSolvConvFails")) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "MRIStepGetNumLinSolvSetups")) { return -1; } - flag = MRIStepGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "MRIStepGetNumJacEvals")) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -413,12 +413,12 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, MRIStepInnerStepper_GetContent(fast_mem, &fast_arkode_mem); // Get fast integrator and solver stats - flag = ARKStepGetNumSteps(fast_arkode_mem, &nst); - if (check_flag(flag, "ARKStepGetNumSteps")) { return -1; } - flag = ARKStepGetNumStepAttempts(fast_arkode_mem, &nst_a); - if (check_flag(flag, "ARKStepGetNumStepAttempts")) { return -1; } - flag = ARKStepGetNumErrTestFails(fast_arkode_mem, &netf); - if (check_flag(flag, "ARKStepGetNumErrTestFails")) { return -1; } + flag = ARKodeGetNumSteps(fast_arkode_mem, &nst); + if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } + flag = ARKodeGetNumStepAttempts(fast_arkode_mem, &nst_a); + if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } + flag = ARKodeGetNumErrTestFails(fast_arkode_mem, &netf); + if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } flag = ARKStepGetNumRhsEvals(fast_arkode_mem, &nfe, &nfi); if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } @@ -433,16 +433,16 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, if (udata.splitting) { long int nni, ncfn; - flag = ARKStepGetNumNonlinSolvIters(fast_arkode_mem, &nni); - if (check_flag(flag, "ARKStepGetNumNonlinSolvIters")) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(fast_arkode_mem, &ncfn); - if (check_flag(flag, "ARKStepGetNumNonlinSolvConvFails")) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(fast_arkode_mem, &nni); + if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(fast_arkode_mem, &ncfn); + if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = ARKStepGetNumLinSolvSetups(fast_arkode_mem, &nsetups); - if (check_flag(flag, "ARKStepGetNumLinSolvSetups")) { return -1; } - flag = ARKStepGetNumJacEvals(fast_arkode_mem, &nje); - if (check_flag(flag, "ARKStepGetNumJacEvals")) { return -1; } + flag = ARKodeGetNumLinSolvSetups(fast_arkode_mem, &nsetups); + if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } + flag = ARKodeGetNumJacEvals(fast_arkode_mem, &nje); + if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; @@ -505,22 +505,22 @@ int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, // Get slow integrator and solver stats long int nsts, nfse, nfsi; - flag = MRIStepGetNumSteps(arkode_mem, &nsts); - if (check_flag(flag, "MRIStepGetNumSteps")) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nsts); + if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } long int nni, ncfn; - flag = MRIStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(flag, "MRIStepGetNumNonlinSolvIters")) { return -1; } - flag = MRIStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(flag, "MRIStepGetNumNonlinSolvConvFails")) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(flag, "ARKodeGetNumNonlinSolvIters")) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(flag, "ARKodeGetNumNonlinSolvConvFails")) { return -1; } long int nsetups, nje; - flag = MRIStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(flag, "MRIStepGetNumLinSolvSetups")) { return -1; } - flag = MRIStepGetNumJacEvals(arkode_mem, &nje); - if (check_flag(flag, "MRIStepGetNumJacEvals")) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(flag, "ARKodeGetNumLinSolvSetups")) { return -1; } + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + if (check_flag(flag, "ARKodeGetNumJacEvals")) { return -1; } cout << fixed << setprecision(6); cout << endl << "Slow Integrator:" << endl; diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index ffcad8e516..e0a668f025 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -173,22 +173,22 @@ int main() if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Set routines - flag = ARKStepSetUserData(arkode_mem, - (void*)&lamda); // Pass lamda to user functions - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); // Specify tolerances - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)&lamda); // Pass lamda to user functions + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); // Specify tolerances + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Linear solver interface - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); // Attach matrix and linear solver - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); // Set Jacobian routine - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); // Attach matrix and linear solver + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); // Set Jacobian routine + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } // Open output stream for results, output comment line FILE* UFID = fopen("solution.txt", "w"); @@ -198,7 +198,7 @@ int main() fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ sunrealtype t = T0; sunrealtype tout = T0 + dTout; @@ -206,8 +206,8 @@ int main() cout << " --------------------------------------\n"; while (Tf - t > 1.0e-15) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); // call integrator - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); // call integrator + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %8.4" FSYM " %8.5" FSYM " %8.5" FSYM " %8.5" FSYM "\n", // access/print solution t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -229,24 +229,24 @@ int main() // Print some final statistics long int nst, nst_a, nfe, nfi, nsetups, nje, nfeLS, nni, ncfn, netf; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); cout << "\nFinal Solver Statistics:\n"; cout << " Internal solver steps = " << nst << " (attempted = " << nst_a @@ -262,10 +262,10 @@ int main() cout << " Total number of error test failures = " << netf << "\n\n"; // Clean up and return with successful completion - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - SUNMatDestroy(A); // Free A matrix - N_VDestroy(y); // Free y vector + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + SUNMatDestroy(A); // Free A matrix + N_VDestroy(y); // Free y vector if (logger) { SUNLogger_Destroy(&logger); // Free logger diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 414bbff076..bf18a6fbb0 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -41,7 +41,7 @@ * problem is advanced in time with a diagonally implicit Runge-Kutta method * using an inexact Newton method paired with the PCG or SPGMR linear solver. * Several command line options are available to change the problem parameters - * and ARKStep settings. Use the flag --help for more information. + * and ARKODE settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <chrono> @@ -290,7 +290,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -298,38 +298,38 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -353,8 +353,8 @@ int main(int argc, char* argv[]) // Set fixed step size or adaptivity method if (udata->hfixed > ZERO) { - flag = ARKStepSetFixedStep(arkode_mem, udata->hfixed); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } } else { @@ -367,24 +367,24 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set max steps between outputs - flag = ARKStepSetMaxNumSteps(arkode_mem, udata->maxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Set stopping time - flag = ARKStepSetStopTime(arkode_mem, udata->tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } // ----------------------- // Loop over output times @@ -407,8 +407,8 @@ int main(int argc, char* argv[]) t1 = chrono::steady_clock::now(); // Evolve in time - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } // Stop timer t2 = chrono::steady_clock::now(); @@ -465,10 +465,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // Free linear solver + 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 @@ -1087,28 +1087,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } cout << fixed; cout << setprecision(6); @@ -1137,10 +1137,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } cout << " Preconditioner setups = " << npe << endl; cout << " Preconditioner solves = " << nps << endl; diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index 6a32290cca..ff1d6daa05 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) // general problem variables int retval; // reusable error-checking flag N_Vector y = NULL; // empty vector for the computed solution - void* arkode_mem = NULL; // empty ARKStep memory structure + void* arkode_mem = NULL; // empty ARKODE memory structure SUNMatrix A = NULL; // empty system matrix SUNMatrix M = NULL; // empty mass matrix SUNLinearSolver LS = NULL; // empty system linear solver object @@ -269,34 +269,34 @@ int main(int argc, char* argv[]) NLS = SUNNonlinSol_Newton(y, ctx); if (check_retval((void*)NLS, "SUNNonlinSol_Newton", 0)) { return 1; } - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return (1); } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return (1); } A = SUNDenseMatrix(NEQ, NEQ, ctx); if (check_retval((void*)A, "SUNDenseMatrix", 0)) { return 1; } LS = SUNLinSol_Dense(y, A, ctx); if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return (1); } - if (rk_type == 0) { retval = ARKStepSetJacFn(arkode_mem, Ji); } - else { retval = ARKStepSetJacFn(arkode_mem, Jn); } - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return (1); } + if (rk_type == 0) { retval = ARKodeSetJacFn(arkode_mem, Ji); } + else { retval = ARKodeSetJacFn(arkode_mem, Jn); } + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } } else { // Fixed-point NLS = SUNNonlinSol_FixedPoint(y, 4, ctx); if (check_retval((void*)NLS, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return (1); } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return (1); } } } // Set maximum stepsize for ERK run if (rk_type == 2) { - retval = ARKStepSetMaxStep(arkode_mem, ONE / SUNRabs(udata.G)); - if (check_retval(&retval, "ARKStepSetMaxStep", 1)) { return (1); } + retval = ARKodeSetMaxStep(arkode_mem, ONE / SUNRabs(udata.G)); + if (check_retval(&retval, "ARKodeSetMaxStep", 1)) { return (1); } } // Initialize/attach mass matrix solver @@ -304,21 +304,21 @@ int main(int argc, char* argv[]) if (check_retval((void*)M, "SUNDenseMatrix", 0)) { return 1; } MLS = SUNLinSol_Dense(y, M, ctx); if (check_retval((void*)MLS, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKStepSetMassLinearSolver(arkode_mem, MLS, M, SUNTRUE); - if (check_retval(&retval, "ARKStepSetMassLinearSolver", 1)) { return (1); } - retval = ARKStepSetMassFn(arkode_mem, MassMatrix); - if (check_retval(&retval, "ARKStepSetMassFn", 1)) { return (1); } + retval = ARKodeSetMassLinearSolver(arkode_mem, MLS, M, SUNTRUE); + if (check_retval(&retval, "ARKodeSetMassLinearSolver", 1)) { return (1); } + retval = ARKodeSetMassFn(arkode_mem, MassMatrix); + if (check_retval(&retval, "ARKodeSetMassFn", 1)) { return (1); } // Set desired solver order - retval = ARKStepSetOrder(arkode_mem, order); - if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } - retval = ARKStepSetDeduceImplicitRhs(arkode_mem, deduce); - if (check_retval(&retval, "ARKStepSetDeduceImplicitRhs", 1)) { return 1; } + retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce); + if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } // Set the user data pointer - retval = ARKStepSetUserData(arkode_mem, (void*)&udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } // Integrate ODE, based on run type if (adaptive) @@ -334,13 +334,13 @@ int main(int argc, char* argv[]) } // Clean up and return - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // free system linear solver - SUNLinSolFree(MLS); // free mass linear solver - SUNNonlinSolFree(NLS); // free nonlinear solver - SUNMatDestroy(A); // free system matrix - SUNMatDestroy(M); // free mass matrix - N_VDestroy(y); // Free y vector + ARKodeFree(&arkode_mem); // Free integrator memory + SUNLinSolFree(LS); // free system linear solver + SUNLinSolFree(MLS); // free mass linear solver + SUNNonlinSolFree(NLS); // free nonlinear solver + SUNMatDestroy(A); // free system matrix + SUNMatDestroy(M); // free mass matrix + N_VDestroy(y); // Free y vector return 0; } @@ -509,10 +509,10 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, int retval; // Set tolerances - retval = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } - retval = ARKStepResStolerance(arkode_mem, abstol); - if (check_retval(&retval, "ARKStepResStolerance", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKodeResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKodeResStolerance", 1)) { return 1; } // Open output stream for results, output comment line FILE* UFID = fopen("ark_kpr_Mt_solution.txt", "w"); @@ -524,7 +524,7 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), SUNRabs(NV_Ith_S(y, 0) - utrue(T0)), SUNRabs(NV_Ith_S(y, 1) - vtrue(T0))); - // Main time-stepping loop: calls ARKStepEvolve to perform integration, + // Main time-stepping loop: calls ARKodeEvolve to perform integration, // then prints results. Stops when the final time has been reached int Nt = (int)ceil((Tf - T0) / dTout); sunrealtype t = T0; @@ -543,8 +543,8 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, for (int iout = 0; iout < Nt; iout++) { // call integrator - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } // access/print solution and error uerr = SUNRabs(NV_Ith_S(y, 0) - utrue(t)); @@ -571,30 +571,30 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, // Get integrator statistics long int nst, nst_a, nfe, nfi, nni, nnc, nje, nsetups, netf, nmset, nms, nMv; - retval = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_retval(&retval, "ARKStepGetNumSteps", 1)) { return 1; } - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_retval(&retval, "ARKStepGetNumStepAttempts", 1)) { return 1; } + retval = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) { return 1; } + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_retval(&retval, "ARKodeGetNumStepAttempts", 1)) { return 1; } retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_retval(&retval, "ARKStepGetNumRhsEvals", 1)) { return 1; } - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_retval(&retval, "ARKStepGetNumErrTestFails", 1)) { return 1; } - retval = ARKStepGetNumMassSetups(arkode_mem, &nmset); - if (check_retval(&retval, "ARKStepGetNumMassSetups", 1)) { return 1; } - retval = ARKStepGetNumMassSolves(arkode_mem, &nms); - if (check_retval(&retval, "ARKStepGetNumMassSolves", 1)) { return 1; } - retval = ARKStepGetNumMassMult(arkode_mem, &nMv); - if (check_retval(&retval, "ARKStepGetNumMassMult", 1)) { return 1; } + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_retval(&retval, "ARKodeGetNumErrTestFails", 1)) { return 1; } + retval = ARKodeGetNumMassSetups(arkode_mem, &nmset); + if (check_retval(&retval, "ARKodeGetNumMassSetups", 1)) { return 1; } + retval = ARKodeGetNumMassSolves(arkode_mem, &nms); + if (check_retval(&retval, "ARKodeGetNumMassSolves", 1)) { return 1; } + retval = ARKodeGetNumMassMult(arkode_mem, &nMv); + if (check_retval(&retval, "ARKodeGetNumMassMult", 1)) { return 1; } if (rk_type < 2) { - retval = ARKStepGetNonlinSolvStats(arkode_mem, &nni, &nnc); - if (check_retval(&retval, "ARKStepGetNonlinSolvStats", 1)) { return 1; } - retval = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_retval(&retval, "ARKStepGetNumLinSolvSetups", 1)) { return 1; } + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nni, &nnc); + if (check_retval(&retval, "ARKodeGetNonlinSolvStats", 1)) { return 1; } + retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } if (nls_type == 0) { - retval = ARKStepGetNumJacEvals(arkode_mem, &nje); - if (check_retval(&retval, "ARKStepGetNumJacEvals", 1)) { return 1; } + retval = ARKodeGetNumJacEvals(arkode_mem, &nje); + if (check_retval(&retval, "ARKodeGetNumJacEvals", 1)) { return 1; } } else { nje = 0; } } @@ -632,22 +632,22 @@ static int check_order(void* arkode_mem, N_Vector y, sunrealtype T0, a11 = a12 = a21 = a22 = b1 = b2 = ZERO; // Tighten implicit solver to accommodate fixed step sizes - retval = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } - retval = ARKStepResStolerance(arkode_mem, abstol); - if (check_retval(&retval, "ARKStepResStolerance", 1)) { return (1); } - retval = ARKStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return (1); } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKodeResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKodeResStolerance", 1)) { return (1); } + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return (1); } if (rk_type < 2) { - retval = ARKStepSetJacEvalFrequency(arkode_mem, 1); - if (check_retval(&retval, "ARKStepSetJacEvalFrequency", 1)) { return 1; } - retval = ARKStepSetLSetupFrequency(arkode_mem, 1); - 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; } + retval = ARKodeSetJacEvalFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) { return 1; } + retval = ARKodeSetLSetupFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) { return 1; } + retval = ARKodeSetMaxNonlinIters(arkode_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + retval = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_retval(&retval, "ARKodeSetNonlinConvCoef", 1)) { return 1; } } // Set array of fixed step sizes to use, storage for corresponding errors/orders @@ -667,13 +667,13 @@ static int check_order(void* arkode_mem, N_Vector y, sunrealtype T0, cout << " -----------------------------------------------------\n"; for (size_t ih = 0; ih < hvals.size(); ih++) { - // Reset ARKStep for this run + // Reset ARKODE for this run retval = Ytrue(T0, y); if (check_retval(&retval, "Ytrue", 1)) { return 1; } - retval = ARKStepReset(arkode_mem, T0, y); - if (check_retval(&retval, "ARKStepReset", 1)) { return 1; } - retval = ARKStepSetFixedStep(arkode_mem, hvals[ih]); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, T0, y); + if (check_retval(&retval, "ARKodeReset", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } // Main time-stepping loop: run for Nout periods, accumulating overall error sunrealtype t = T0; @@ -685,8 +685,8 @@ static int check_order(void* arkode_mem, N_Vector y, sunrealtype T0, for (size_t iout = 0; iout < Nout; iout++) { // call integrator and update output time - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } tout += dTout; tout = (tout > Tf) ? Tf : tout; diff --git a/examples/arkode/CXX_serial/ark_pendulum.cpp b/examples/arkode/CXX_serial/ark_pendulum.cpp index 776dc831d8..be36be088c 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.cpp +++ b/examples/arkode/CXX_serial/ark_pendulum.cpp @@ -139,14 +139,14 @@ int main(int argc, char* argv[]) if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } if (relax) { // Enable relaxation methods - flag = ARKStepSetRelaxFn(arkode_mem, Eng, JacEng); - if (check_flag(flag, "ARKStepSetRelaxFn")) { return 1; } + flag = ARKodeSetRelaxFn(arkode_mem, Eng, JacEng); + if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } } SUNMatrix A = nullptr; @@ -162,12 +162,12 @@ int main(int argc, char* argv[]) if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } // Attach the matrix and linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } // Set Jacobian routine - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } if (fixed_h > SUN_RCONST(0.0)) { @@ -206,12 +206,12 @@ int main(int argc, char* argv[]) if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKStepSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } - flag = ARKStepSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); - if (check_flag(flag, "ARKStepSetNonlinConvCoef")) { return 1; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } /* --------------- * * Advance in Time * @@ -248,8 +248,8 @@ int main(int argc, char* argv[]) while (t < tf) { // Evolve in time - flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKStepEvolve")) { break; } + flag = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { break; } // Output solution and errors sunrealtype eng; @@ -260,8 +260,8 @@ int main(int argc, char* argv[]) /* Output to the screen periodically */ long int nst; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); if (nst % 1000 == 0) { @@ -288,14 +288,14 @@ int main(int argc, char* argv[]) long int nst, nst_a, netf, nfe, nfi; // Get final statistics on how the solve progressed - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKStepGetNumStepAttempts"); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKodeGetNumStepAttempts"); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKStepGetNumErrTestFails"); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKodeGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -311,20 +311,20 @@ int main(int argc, char* argv[]) { long int nsetups, nje, nfeLS, nni, ncfn; - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKStepGetNumNonlinSolvIters"); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKodeGetNumNonlinSolvIters"); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKStepGetNumLinSolvSetups"); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKodeGetNumLinSolvSetups"); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKStepGetNumJacEvals"); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKodeGetNumJacEvals"); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKStepGetNumLinRhsEvals"); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKodeGetNumLinRhsEvals"); std::cout << " Total number of Newton iterations = " << nni << "\n"; std::cout << " Total number of linear solver convergence failures = " << ncfn @@ -339,23 +339,23 @@ int main(int argc, char* argv[]) { long int nre, nrje, nrf, nrbf, nrnlsi, nrnlsf; - flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKStepGetNumRelaxFnEvals"); + flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKodeGetNumRelaxFnEvals"); - flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKStepGetNumRelaxJacEvals"); + flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKodeGetNumRelaxJacEvals"); - flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKStepGetNumRelaxFails"); + flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKodeGetNumRelaxFails"); - flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKStepGetNumRelaxBoundFails"); + flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKodeGetNumRelaxBoundFails"); - flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKStepGetNumRelaxSolveFails"); + flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKodeGetNumRelaxSolveFails"); - flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKStepGetNumRelaxSolveIters"); + flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKodeGetNumRelaxSolveIters"); std::cout << " Total Relaxation Fn evals = " << nre << "\n"; std::cout << " Total Relaxation Jac evals = " << nrje << "\n"; @@ -370,8 +370,8 @@ int main(int argc, char* argv[]) * Clean up * * -------- */ - // Free ARKStep integrator and SUNDIALS objects - ARKStepFree(&arkode_mem); + // Free ARKODE integrator and SUNDIALS objects + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); SUNMatDestroy(A); N_VDestroy(y); diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 67d2b9db30..25b366c677 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -342,22 +342,22 @@ int main(int argc, char* argv[]) /* Set routines */ /* Pass udata to user functions */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { MPI_Abort(grid.comm, 1); } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { MPI_Abort(grid.comm, 1); } /* Specify residual tolerance */ - retval = ARKStepResStolerance(arkode_mem, abstol); - if (check_retval(&retval, "ARKStepResStolerance", 1)) + retval = ARKodeResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKodeResStolerance", 1)) { MPI_Abort(grid.comm, 1); } @@ -481,28 +481,28 @@ int main(int argc, char* argv[]) MPI_Abort(grid.comm, 1); } - /* Attach the matrix, linear solver, and Jacobian construction routine to ARKStep */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) + /* Attach the matrix, linear solver, and Jacobian construction routine to ARKODE */ + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { MPI_Abort(grid.comm, 1); } /* Supply Jac routine */ - retval = ARKStepSetJacFn(arkode_mem, Jac); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { MPI_Abort(grid.comm, 1); } + retval = ARKodeSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { MPI_Abort(grid.comm, 1); } - /* Attach the mass matrix, linear solver and construction routines to ARKStep; - notify ARKStep that the mass matrix is not time-dependent */ - retval = ARKStepSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); - if (check_retval(&retval, "ARKStepSetMassLinearSolver", 1)) + /* Attach the mass matrix, linear solver and construction routines to ARKODE; + notify ARKode that the mass matrix is not time-dependent */ + retval = ARKodeSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); + if (check_retval(&retval, "ARKodeSetMassLinearSolver", 1)) { MPI_Abort(grid.comm, 1); } /* Supply M routine */ - retval = ARKStepSetMassFn(arkode_mem, MassMatrix); - if (check_retval(&retval, "ARKStepSetMassFn", 1)) { MPI_Abort(grid.comm, 1); } + retval = ARKodeSetMassFn(arkode_mem, MassMatrix); + if (check_retval(&retval, "ARKodeSetMassFn", 1)) { MPI_Abort(grid.comm, 1); } /* output mesh to disk */ FID = fopen("bruss_FEM_mesh.txt", "w"); @@ -527,7 +527,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -536,9 +536,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - retval = ARKStepEvolve(arkode_mem, tout, y, &t, - ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -572,28 +571,28 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_retval(&retval, "ARKStepGetNumLinSolvSetups", 1); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); - retval = ARKStepGetNumMassSetups(arkode_mem, &nmset); - check_retval(&retval, "ARKStepGetNumMassSetups", 1); - retval = ARKStepGetNumMassSolves(arkode_mem, &nms); - check_retval(&retval, "ARKStepGetNumMassSolves", 1); - retval = ARKStepGetNumMassMult(arkode_mem, &nMv); - check_retval(&retval, "ARKStepGetNumMassMult", 1); - retval = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); + retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumMassSetups(arkode_mem, &nmset); + check_retval(&retval, "ARKodeGetNumMassSetups", 1); + retval = ARKodeGetNumMassSolves(arkode_mem, &nms); + check_retval(&retval, "ARKodeGetNumMassSolves", 1); + retval = ARKodeGetNumMassMult(arkode_mem, &nMv); + check_retval(&retval, "ARKodeGetNumMassMult", 1); + retval = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -613,8 +612,8 @@ int main(int argc, char* argv[]) N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solvers */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solvers */ SUNLinSolFree(MLS); SUNMatDestroy(A); /* Free matrices */ SUNMatDestroy(M); 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 e1a02fed2f..3d11f6a539 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -448,7 +448,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -456,45 +456,45 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->matvec) { // Attach Jacobian-vector product function - flag = ARKStepSetJacTimes(arkode_mem, NULL, JTimes); - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, JTimes); + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -518,8 +518,8 @@ int main(int argc, char* argv[]) // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set adaptive stepping (XBraid with temporal refinement) options @@ -528,16 +528,16 @@ int main(int argc, char* argv[]) // 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } + flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -701,10 +701,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&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 @@ -2889,28 +2889,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } // Reduce stats across time MPI_Allreduce(MPI_IN_PLACE, &nst, 1, MPI_LONG, MPI_MAX, udata->comm_w); @@ -2955,10 +2955,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } MPI_Allreduce(MPI_IN_PLACE, &npe, 1, MPI_LONG, MPI_MAX, udata->comm_w); MPI_Allreduce(MPI_IN_PLACE, &nps, 1, MPI_LONG, MPI_MAX, udata->comm_w); diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 0fb944fdfa..686862ea5a 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -402,7 +402,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -410,38 +410,38 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -465,8 +465,8 @@ int main(int argc, char* argv[]) // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set adaptive stepping (XBraid with temporal refinement) options @@ -475,16 +475,16 @@ int main(int argc, char* argv[]) // 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } + flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -648,10 +648,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&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 @@ -2053,28 +2053,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } // Reduce stats across time MPI_Allreduce(MPI_IN_PLACE, &nst, 1, MPI_LONG, MPI_MAX, udata->comm_w); @@ -2119,10 +2119,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } MPI_Allreduce(MPI_IN_PLACE, &npe, 1, MPI_LONG, MPI_MAX, udata->comm_w); MPI_Allreduce(MPI_IN_PLACE, &nps, 1, MPI_LONG, MPI_MAX, udata->comm_w); diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index cfddfbbdd7..3ca94f8fcf 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -41,7 +41,7 @@ * with a diagonally implicit Runge-Kutta method from the ARKODE ARKStep module * using an inexact Newton method paired with the PCG or SPGMR linear solver. * Several command line options are available to change the problem parameters - * and ARKStep settings. Use the flag --help for more information. + * and ARKODE settings. Use the flag --help for more information. * ---------------------------------------------------------------------------*/ #include <chrono> @@ -340,7 +340,7 @@ int main(int argc, char* argv[]) } // -------------- - // Setup ARKStep + // Setup ARKODE // -------------- // Create integrator @@ -348,38 +348,38 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkode_mem, udata->rtol, udata->atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Attach user data - flag = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Attach linear solver - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } if (udata->prec) { // Attach preconditioner - flag = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Set linear solver setup frequency (update preconditioner) - flag = ARKStepSetLSetupFrequency(arkode_mem, udata->msbp); - if (check_flag(&flag, "ARKStepSetLSetupFrequency", 1)) { return 1; } + flag = ARKodeSetLSetupFrequency(arkode_mem, udata->msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } } // Set linear solver tolerance factor - flag = ARKStepSetEpsLin(arkode_mem, udata->epslin); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return 1; } + flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } // Select method order if (udata->order > 1) { // Use an ARKode provided table - flag = ARKStepSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } } else { @@ -403,8 +403,8 @@ int main(int argc, char* argv[]) // Specify linearly implicit non-time-dependent RHS if (udata->linear) { - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // Set adaptive stepping (XBraid with temporal refinement) options @@ -413,16 +413,16 @@ int main(int argc, char* argv[]) // 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } // Set the step size reduction factor limit (1 / refinement factor limit) - flag = ARKStepSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); - if (check_flag(&flag, "ARKStepSetMinReduction", 1)) { return 1; } + flag = ARKodeSetMinReduction(arkode_mem, ONE / udata->x_rfactor_limit); + if (check_flag(&flag, "ARKodeSetMinReduction", 1)) { return 1; } // Set the failed solve step size reduction factor (1 / refinement factor) - flag = ARKStepSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); - if (check_flag(&flag, "ARKStepSetMaxCFailGrowth", 1)) { return 1; } + flag = ARKodeSetMaxCFailGrowth(arkode_mem, ONE / udata->x_rfactor_fail); + if (check_flag(&flag, "ARKodeSetMaxCFailGrowth", 1)) { return 1; } } // ------------------------ @@ -586,10 +586,10 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- - ARKStepFree(&arkode_mem); // Free integrator memory - SUNLinSolFree(LS); // Free linear solver - N_VDestroy(u); // Free vectors - FreeUserData(udata); // Free user data + ARKodeFree(&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 @@ -1352,28 +1352,28 @@ static int OutputStats(void* arkode_mem, UserData* udata) // Get integrator and solver stats long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return -1; } - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - if (check_flag(&flag, "ARKStepGetNumStepAttempts", 1)) { return -1; } - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - if (check_flag(&flag, "ARKStepGetNumErrTestFails", 1)) { return -1; } + flag = ARKodeGetNumSteps(arkode_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return -1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return -1; } - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return -1; } - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return -1; } - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfi_ls); - if (check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1)) { return -1; } - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return -1; } + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return -1; } + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return -1; } + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfi_ls); + if (check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return -1; } // Reduce stats across time MPI_Allreduce(MPI_IN_PLACE, &nst, 1, MPI_LONG, MPI_MAX, udata->comm_w); @@ -1418,10 +1418,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (udata->prec) { long int npe, nps; - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return -1; } - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return -1; } + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return -1; } + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return -1; } MPI_Allreduce(MPI_IN_PLACE, &npe, 1, MPI_LONG, MPI_MAX, udata->comm_w); MPI_Allreduce(MPI_IN_PLACE, &nps, 1, MPI_LONG, MPI_MAX, udata->comm_w); diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c index ff80e737d2..dca37e62d8 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c @@ -201,22 +201,22 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)userdata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)userdata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize spgmr solver */ LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 10, ctx); if (check_flag((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, - JacVI); /* Set the Jacobian-vector product */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, + JacVI); /* Set the Jacobian-vector product */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -239,7 +239,7 @@ int main(void) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -249,8 +249,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } /* print solution statistics */ unorm = N_VDotProd(u, u); @@ -288,28 +288,28 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1); - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1); - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - check_flag(&flag, "ARKStepGetNumJtimesEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1); + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1); + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + check_flag(&flag, "ARKodeGetNumJtimesEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -329,10 +329,10 @@ int main(void) N_VDestroy(u); N_VDestroy(v); N_VDestroy(w); - free(userdata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + free(userdata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 8a57f87c5f..2dde9c37ee 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -236,18 +236,18 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Linear solver specification */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -269,7 +269,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -278,8 +278,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -313,24 +313,24 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -344,11 +344,11 @@ int main(int argc, char* argv[]) printf(" Total number of error test failures = %li\n\n", netf); /* Clean up and return with successful completion */ - free(udata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free matrix */ - N_VDestroy(y); /* Free vectors */ + free(udata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free matrix */ + N_VDestroy(y); /* Free vectors */ N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); diff --git a/examples/arkode/C_openmp/ark_heat1D_omp.c b/examples/arkode/C_openmp/ark_heat1D_omp.c index e59b1f03d0..4fc8eb998b 100644 --- a/examples/arkode/C_openmp/ark_heat1D_omp.c +++ b/examples/arkode/C_openmp/ark_heat1D_omp.c @@ -97,7 +97,7 @@ int main(int argc, char* argv[]) int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNLinearSolver LS = NULL; /* empty linear solver object */ - void* arkode_mem = NULL; /* empty ARKStep memory structure */ + void* arkode_mem = NULL; /* empty ARKODE memory structure */ FILE *FID, *UFID; sunrealtype t, dTout, tout; int iout, num_threads; @@ -139,31 +139,31 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize PCG solver -- no preconditioning, with up to N iterations */ LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } /* Linear solver interface -- set user-supplied J*v routine (no 'jtsetup' required) */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - NULL); /* Attach linear solver to ARKStep */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + NULL); /* Attach linear solver to ARKODE */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* output mesh to disk */ FID = fopen("heat_mesh.txt", "w"); @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) for (i = 0; i < N; i++) { fprintf(UFID, " %.16" ESYM "", data[i]); } fprintf(UFID, "\n"); - /* Main time-stepping loop: calls ARKStep to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -188,8 +188,8 @@ int main(int argc, char* argv[]) printf(" %10.6" FSYM " %10.6f\n", t, sqrt(N_VDotProd(y, y) / N)); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6f\n", t, sqrt(N_VDotProd(y, y) / N)); /* print solution stats */ if (flag >= 0) @@ -211,26 +211,26 @@ int main(int argc, char* argv[]) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1); - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - check_flag(&flag, "ARKStepGetNumJtimesEvals", 1); - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1); + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + check_flag(&flag, "ARKodeGetNumJtimesEvals", 1); + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -245,11 +245,11 @@ int main(int argc, char* argv[]) printf(" Total number of error test failures = %li\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free vectors */ - free(udata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free vectors */ + free(udata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c index 83d89bfc0f..1f847e9dfe 100644 --- a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c @@ -96,8 +96,8 @@ int main(void) if (check_flag((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } /* Specify tolerances */ - flag = ERKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ERKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -107,7 +107,7 @@ int main(void) N_VCopyFromDevice_OpenMPDEV(y); fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, y_data[0]); - /* Main time-stepping loop: calls ERKStep to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -115,8 +115,8 @@ int main(void) printf(" ---------------------\n"); while (Tf - t > 1.0e-15) { - flag = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ERKStep", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } N_VCopyFromDevice_OpenMPDEV(y); printf(" %10.6" FSYM " %10.6" FSYM "\n", t, y_data[0]); /* access/print solution */ @@ -136,14 +136,14 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ERKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ERKStepGetNumSteps", 1); - flag = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ERKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_flag(&flag, "ERKStepGetNumRhsEvals", 1); - flag = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ERKStepGetNumErrTestFails", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -151,9 +151,9 @@ int main(void) printf(" Total number of error test failures = %li\n\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ERKStepFree(&arkode_mem); /* Free integrator memory */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNContext_Free(&ctx); /* Free context */ 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 ec98fbcd5a..7d12f225f8 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c @@ -184,41 +184,41 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetAdaptivityMethod(arkode_mem, 2, 1, 0, - NULL); /* Set adaptivity method */ - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetAdaptivityMethod(arkode_mem, 2, 1, 0, + NULL); /* Set adaptivity method */ + if (check_flag(&flag, "ARKodeSetAdaptivityMethod", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 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; } + flag = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } /* Specify linearly implicit RHS, with time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 1); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 1); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* Initialize PCG solver -- no preconditioning, with up to N iterations */ LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } /* Linear solver interface -- set user-supplied J*v routine (no 'jtsetup' required) */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - NULL); /* Attach linear solver to ARKStep */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + NULL); /* Attach linear solver to ARKODE */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; olddt = ZERO; @@ -234,24 +234,24 @@ int main(void) while (t < Tf) { /* "set" routines */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } - flag = ARKStepSetInitStep(arkode_mem, newdt); - if (check_flag(&flag, "ARKStepSetInitStep", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKodeSetInitStep(arkode_mem, newdt); + if (check_flag(&flag, "ARKodeSetInitStep", 1)) { return 1; } /* call integrator */ - flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } + flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } /* "get" routines */ - flag = ARKStepGetLastStep(arkode_mem, &olddt); - if (check_flag(&flag, "ARKStepGetLastStep", 1)) { return 1; } - flag = ARKStepGetCurrentStep(arkode_mem, &newdt); - if (check_flag(&flag, "ARKStepGetCurrentStep", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return 1; } + flag = ARKodeGetLastStep(arkode_mem, &olddt); + if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } + flag = ARKodeGetCurrentStep(arkode_mem, &newdt); + if (check_flag(&flag, "ARKodeGetCurrentStep", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return 1; } /* print current solution stats */ iout++; @@ -307,18 +307,18 @@ int main(void) y = y2; y2 = yt; - /* call ARKStepResize to notify integrator of change in mesh */ - flag = ARKStepResize(arkode_mem, y, hscale, t, NULL, NULL); - if (check_flag(&flag, "ARKStepResize", 1)) { return 1; } + /* call ARKodeResize to notify integrator of change in mesh */ + flag = ARKodeResize(arkode_mem, y, hscale, t, NULL, NULL); + if (check_flag(&flag, "ARKodeResize", 1)) { return 1; } - /* destroy and re-allocate linear solver memory; reattach to ARKStep interface */ + /* destroy and re-allocate linear solver memory; reattach to ARKODE interface */ SUNLinSolFree(LS); LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } } printf(" --------------------------------------------------------------------" "--------------------\n"); @@ -336,7 +336,7 @@ int main(void) free(udata->x_host); /* Free user data */ omp_target_free(udata->x_dev, dev); free(udata); - ARKStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ SUNLinSolFree(LS); /* Free linear solver */ (void)SUNAdaptController_Destroy(C); /* Free time adaptivity controller */ SUNContext_Free(&ctx); /* Free context */ diff --git a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c index f85ec24efb..82e13c66a7 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c @@ -97,7 +97,7 @@ int main(void) int flag; /* reusable error-checking flag */ N_Vector y = NULL; /* empty vector for storing solution */ SUNLinearSolver LS = NULL; /* empty linear solver object */ - void* arkode_mem = NULL; /* empty ARKStep memory structure */ + void* arkode_mem = NULL; /* empty ARKODE memory structure */ FILE *FID, *UFID; sunrealtype t, dTout, tout; int iout; @@ -132,31 +132,31 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize PCG solver -- no preconditioning, with up to N iterations */ LS = SUNLinSol_PCG(y, 0, N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } /* Linear solver interface -- set user-supplied J*v routine (no 'jtsetup' required) */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - NULL); /* Attach linear solver to ARKStep */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + NULL); /* Attach linear solver to ARKStep */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* output mesh to disk */ FID = fopen("heat_mesh.txt", "w"); @@ -172,7 +172,7 @@ int main(void) for (i = 0; i < N; i++) { fprintf(UFID, " %.16" ESYM "", data[i]); } fprintf(UFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -182,8 +182,8 @@ int main(void) printf(" %10.6" FSYM " %10.6" FSYM "\n", t, SUNRsqrt(N_VDotProd(y, y) / N)); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStep", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM "\n", t, SUNRsqrt(N_VDotProd(y, y) / N)); /* print solution stats */ if (flag >= 0) @@ -207,26 +207,26 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1); - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - check_flag(&flag, "ARKStepGetNumJtimesEvals", 1); - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1); + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + check_flag(&flag, "ARKodeGetNumJtimesEvals", 1); + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -241,11 +241,11 @@ int main(void) printf(" Total number of error test failures = %li\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free vectors */ - free(udata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free vectors */ + free(udata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free context */ return 0; } 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 ab26d152eb..73825d1221 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -371,20 +371,20 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Select the method order */ - retval = ARKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Create the (non)linear solver */ if (uopt->global) @@ -394,20 +394,20 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c if (check_retval((void*)NLS, "SUNNonlinSol_Newton", 0)) { return 1; } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } /* Create linear solver */ LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, ctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; } /* Attach linear solver */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Attach preconditioner */ - retval = ARKStepSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_retval(&retval, "ARKStepSetPreconditioner", 1)) { return 1; } + retval = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_retval(&retval, "ARKodeSetPreconditioner", 1)) { return 1; } } else { @@ -417,8 +417,8 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c if (check_retval((void*)NLS, "TaskLocalNewton", 0)) { return 1; } /* Attach nonlinear solver */ - retval = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&retval, "ARKStepSetNonlinearSolver", 1)) { return 1; } + retval = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&retval, "ARKodeSetNonlinearSolver", 1)) { return 1; } } /* Output initial condition */ @@ -438,8 +438,8 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c do { /* Integrate to output time */ - retval = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* Output state */ WriteOutput(t, y, udata, uopt); @@ -453,26 +453,26 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c while (iout < uopt->nout); /* Get final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncnf); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncnf); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); if (uopt->global) { - retval = ARKStepGetNumLinIters(arkode_mem, &nli); - check_retval(&retval, "ARKStepGetNumLinIters", 1); - retval = ARKStepGetNumPrecEvals(arkode_mem, &npre); - check_retval(&retval, "ARKStepGetNumPrecEvals", 1); - retval = ARKStepGetNumPrecSolves(arkode_mem, &npsol); - check_retval(&retval, "ARKStepGetNumPrecSolves", 1); + retval = ARKodeGetNumLinIters(arkode_mem, &nli); + check_retval(&retval, "ARKodeGetNumLinIters", 1); + retval = ARKodeGetNumPrecEvals(arkode_mem, &npre); + check_retval(&retval, "ARKodeGetNumPrecEvals", 1); + retval = ARKodeGetNumPrecSolves(arkode_mem, &npsol); + check_retval(&retval, "ARKodeGetNumPrecSolves", 1); } /* Print final statistics */ @@ -494,7 +494,7 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c } /* Clean up */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNNonlinSolFree(NLS); if (LS) { SUNLinSolFree(LS); } @@ -518,20 +518,20 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, if (check_retval((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } /* Select the method order */ - retval = ERKStepSetOrder(arkode_mem, uopt->order); - if (check_retval(&retval, "ERKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, uopt->order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } /* Attach user data */ - retval = ERKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Specify tolerances */ - retval = ERKStepSStolerances(arkode_mem, uopt->rtol, uopt->atol); - if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, uopt->rtol, uopt->atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Increase the max number of steps allowed between outputs */ - retval = ERKStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "ERKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Output initial condition */ if (udata->myid == 0 && uopt->monitor) @@ -550,8 +550,8 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, do { /* Integrate to output time */ - retval = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* Output state */ WriteOutput(t, y, udata, uopt); @@ -565,14 +565,14 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, while (iout < uopt->nout); /* Get final statistics */ - retval = ERKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ERKStepGetNumSteps", 1); - retval = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ERKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_retval(&retval, "ERKStepGetNumRhsEvals", 1); - retval = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ERKStepGetNumErrTestFails", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); /* Print final statistics */ if (udata->myid == 0) @@ -584,7 +584,7 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, } /* Clean up */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* Return success */ return 0; @@ -892,9 +892,9 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) double tcur, gamma; void* user_data; - retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) + retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) { return (-1); } @@ -948,9 +948,9 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) double tcur, gamma; void* user_data = NULL; - retval = ARKStepGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) + retval = ARKodeGetNonlinearSystemData(arkode_mem, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) { return (-1); } 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 46eeb4b865..97802077ee 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -229,21 +229,21 @@ int main(int argc, char* argv[]) } /* Set the pointer to user-defined data */ - flag = ARKStepSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKodeSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKStepSetMaxNumSteps to increase default */ - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKodeSetMaxNumSteps to increase default */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKStepSStolerances to specify the scalar relative tolerance + /* Call ARKodeSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKStep interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKODE interface */ + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) { MPI_Abort(comm, 1); } @@ -256,8 +256,8 @@ int main(int argc, char* argv[]) 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)) + flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1, my_pe)) { MPI_Abort(comm, 1); } @@ -302,11 +302,11 @@ int main(int argc, char* argv[]) (jpre == SUN_PREC_LEFT) ? "SUN_PREC_LEFT" : "SUN_PREC_RIGHT"); } - /* In loop over output points, call ARKStepEvolve, print results, test for error */ + /* In loop over output points, call ARKodeEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1, my_pe)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } PrintOutput(arkode_mem, my_pe, comm, u, t); } @@ -318,7 +318,7 @@ int main(int argc, char* argv[]) /* Free memory */ N_VDestroy(u); free(data); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); SUNContext_Free(&ctx); MPI_Finalize(); @@ -447,10 +447,10 @@ static void PrintOutput(void* arkode_mem, int my_pe, MPI_Comm comm, N_Vector u, { MPI_Recv(&tempu[0], 2, MPI_SUNREALTYPE, npelast, 0, comm, &status); } - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); - flag = ARKStepGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKStepGetLastStep", 1, my_pe); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); + flag = ARKodeGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); #if defined(SUNDIALS_EXTENDED_PRECISION) printf("t = %.2Le no. steps = %ld stepsize = %.2Le\n", t, nst, hu); printf("At bottom left: c1, c2 = %12.3Le %12.3Le \n", uarray[0], uarray[1]); @@ -477,33 +477,33 @@ static void PrintFinalStats(void* arkode_mem) long int nli, npe, nps, ncfl, nfeLS, ngevalsBBDP; int flag; - flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, 0); + flag = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1, 0); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1, 0); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1, 0); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1, 0); - - flag = ARKStepGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); - check_flag(&flag, "ARKStepGetLinWorkSpace", 1, 0); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1, 0); - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - check_flag(&flag, "ARKStepGetNumPrecEvals", 1, 0); - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - check_flag(&flag, "ARKStepGetNumPrecSolves", 1, 0); - flag = ARKStepGetNumLinConvFails(arkode_mem, &ncfl); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1, 0); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1, 0); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1, 0); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1, 0); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1, 0); + + flag = ARKodeGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); + check_flag(&flag, "ARKodeGetLinWorkSpace", 1, 0); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1, 0); + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + check_flag(&flag, "ARKodeGetNumPrecEvals", 1, 0); + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + check_flag(&flag, "ARKodeGetNumPrecSolves", 1, 0); + flag = ARKodeGetNumLinConvFails(arkode_mem, &ncfl); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1, 0); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1, 0); printf("\nFinal Statistics: \n\n"); printf("lenrw = %5ld leniw = %5ld\n", lenrw, leniw); 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 df7478fcae..6ec12802af 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out @@ -8,57 +8,57 @@ Preconditioner type is: jpre = SUN_PREC_LEFT 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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.15e+02 -At bottom left: c1, c2 = 2.038e-08 3.334e+11 -At top right: c1, c2 = -2.330e-18 4.120e+11 +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.15e+02 -At bottom left: c1, c2 = -3.746e-21 3.352e+11 -At top right: c1, c2 = -2.537e-27 4.163e+11 +At bottom left: c1, c2 = -3.746e-21 3.352e+11 +At top right: c1, c2 = -2.537e-27 4.163e+11 -Final Statistics: +Final Statistics: -lenrw = 3902 leniw = 267 +lenrw = 3902 leniw = 279 lenrwls = 2455 leniwls = 126 nst = 7252 nfe = 0 nfe = 76929 nfels = 102816 @@ -77,57 +77,57 @@ In ARKBBDPRE: real/integer local work space sizes = 1300, 192 Preconditioner type is: jpre = SUN_PREC_RIGHT 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +At bottom left: c1, c2 = 1.538e-27 3.352e+11 +At top right: c1, c2 = -5.134e-07 4.163e+11 -Final Statistics: +Final Statistics: -lenrw = 3902 leniw = 272 +lenrw = 3902 leniw = 284 lenrwls = 2455 leniwls = 126 nst = 7427 nfe = 0 nfe = 78794 nfels = 111450 diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index 3fc249d26b..b7b08ab4c3 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -243,36 +243,36 @@ int main(int argc, char* argv[]) } /* Set the pointer to user-defined data */ - flag = ARKStepSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKodeSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKStepSetMaxNumSteps to increase default */ - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKodeSetMaxNumSteps to increase default */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKStepSStolerances to specify the scalar relative tolerance + /* Call ARKodeSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKStep interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKODE interface */ + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) { MPI_Abort(comm, 1); } /* Set preconditioner setup and solve routines Precond and PSolve, and the pointer to the user-defined block data */ - flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1, my_pe)) + flag = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 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)) + flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1, my_pe)) { MPI_Abort(comm, 1); } @@ -283,11 +283,11 @@ int main(int argc, char* argv[]) printf("\n2-species diurnal advection-diffusion problem\n\n"); } - /* In loop over output points, call ARKStepEvolve, print results, test for error */ + /* In loop over output points, call ARKodeEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1, my_pe)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } PrintOutput(arkode_mem, my_pe, comm, u, t); } @@ -296,7 +296,7 @@ int main(int argc, char* argv[]) /* Free memory */ FreeUserData(data); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); N_VDestroy(u); SUNContext_Free(&ctx); @@ -440,10 +440,10 @@ static void PrintOutput(void* arkode_mem, int my_pe, MPI_Comm comm, N_Vector u, { MPI_Recv(&tempu[0], 2, MPI_SUNREALTYPE, npelast, 0, comm, &status); } - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); - flag = ARKStepGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKStepGetLastStep", 1, my_pe); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); + flag = ARKodeGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); #if defined(SUNDIALS_EXTENDED_PRECISION) printf("t = %.2Le no. steps = %ld stepsize = %.2Le\n", t, nst, hu); @@ -470,33 +470,33 @@ static void PrintFinalStats(void* arkode_mem) long int nli, npe, nps, ncfl, nfeLS; int flag; - flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, 0); + flag = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1, 0); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1, 0); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1, 0); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1, 0); - - flag = ARKStepGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); - check_flag(&flag, "ARKStepGetLinWorkSpace", 1, 0); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1, 0); - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - check_flag(&flag, "ARKStepGetNumPrecEvals", 1, 0); - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - check_flag(&flag, "ARKStepGetNumPrecSolves", 1, 0); - flag = ARKStepGetNumLinConvFails(arkode_mem, &ncfl); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1, 0); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1, 0); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1, 0); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1, 0); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1, 0); + + flag = ARKodeGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); + check_flag(&flag, "ARKodeGetLinWorkSpace", 1, 0); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1, 0); + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + check_flag(&flag, "ARKodeGetNumPrecEvals", 1, 0); + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + check_flag(&flag, "ARKodeGetNumPrecSolves", 1, 0); + flag = ARKodeGetNumLinConvFails(arkode_mem, &ncfl); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1, 0); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1, 0); printf("\nFinal Statistics: \n\n"); printf("lenrw = %5ld leniw = %5ld\n", lenrw, leniw); diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_p.out index a2db3d9006..b2a0ee2812 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.out @@ -2,57 +2,57 @@ 2-species diurnal advection-diffusion problem 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 +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 = 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 +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 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 3302 leniw = 243 +lenrw = 3302 leniw = 255 lenrwls = 2455 leniwls = 126 nst = 7447 nfe = 0 nfi = 79041 nfels = 108536 @@ -60,4 +60,3 @@ 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.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index 0f1585c26b..ab5090e86f 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -251,29 +251,29 @@ int main(int argc, char* argv[]) } /* Set the pointer to user-defined data */ - flag = ARKStepSetUserData(arkode_mem, data); - if (check_flag(&flag, "ARKStepSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } + flag = ARKodeSetUserData(arkode_mem, data); + if (check_flag(&flag, "ARKodeSetUserData", 1, my_pe)) { MPI_Abort(comm, 1); } - /* Call ARKStepSetMaxNumSteps to increase default */ - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1, my_pe)) { return (1); } + /* Call ARKodeSetMaxNumSteps to increase default */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1, my_pe)) { return (1); } - /* Call ARKStepSStolerances to specify the scalar relative tolerance + /* Call ARKodeSStolerances to specify the scalar relative tolerance and scalar absolute tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1, my_pe)) { return (1); } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1, my_pe)) { return (1); } - /* Attach SPGMR solver structure to ARKStep interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1, my_pe)) + /* Attach SPGMR solver structure to ARKODE interface */ + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1, my_pe)) { MPI_Abort(comm, 1); } /* Set preconditioner setup and solve routines Precond and PSolve, and the pointer to the user-defined block data */ - flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1, my_pe)) + flag = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1, my_pe)) { MPI_Abort(comm, 1); } @@ -284,11 +284,11 @@ int main(int argc, char* argv[]) printf("\n2-species diurnal advection-diffusion problem\n\n"); } - /* In loop over output points, call ARKStepEvolve, print results, test for error */ + /* In loop over output points, call ARKodeEvolve, print results, test for error */ for (iout = 1, tout = TWOHR; iout <= NOUT; iout++, tout += TWOHR) { - flag = ARKStepEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1, my_pe)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1, my_pe)) { break; } PrintOutput(arkode_mem, my_pe, comm, u, t); } @@ -299,7 +299,7 @@ int main(int argc, char* argv[]) N_VDestroy(u); /* Free hypre vector wrapper */ HYPRE_IJVectorDestroy(Uij); /* Free the underlying hypre vector */ FreeUserData(data); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); SUNContext_Free(&sunctx); /* Free context */ MPI_Finalize(); @@ -452,10 +452,10 @@ static void PrintOutput(void* arkode_mem, int my_pe, MPI_Comm comm, N_Vector u, { MPI_Recv(&tempu[0], 2, MPI_SUNREALTYPE, npelast, 0, comm, &status); } - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, my_pe); - flag = ARKStepGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKStepGetLastStep", 1, my_pe); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, my_pe); + flag = ARKodeGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKodeGetLastStep", 1, my_pe); #if defined(SUNDIALS_EXTENDED_PRECISION) printf("t = %.2Le no. steps = %ld stepsize = %.2Le\n", t, nst, hu); @@ -482,33 +482,33 @@ static void PrintFinalStats(void* arkode_mem) long int nli, npe, nps, ncfl, nfeLS; int flag; - flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKStepGetWorkSpace", 1, 0); - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1, 0); + flag = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1, 0); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1, 0); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1, 0); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1, 0); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1, 0); - - flag = ARKStepGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); - check_flag(&flag, "ARKStepGetLinWorkSpace", 1, 0); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1, 0); - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - check_flag(&flag, "ARKStepGetNumPrecEvals", 1, 0); - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - check_flag(&flag, "ARKStepGetNumPrecSolves", 1, 0); - flag = ARKStepGetNumLinConvFails(arkode_mem, &ncfl); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1, 0); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1, 0); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1, 0); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1, 0); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1, 0); + + flag = ARKodeGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); + check_flag(&flag, "ARKodeGetLinWorkSpace", 1, 0); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1, 0); + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + check_flag(&flag, "ARKodeGetNumPrecEvals", 1, 0); + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + check_flag(&flag, "ARKodeGetNumPrecSolves", 1, 0); + flag = ARKodeGetNumLinConvFails(arkode_mem, &ncfl); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1, 0); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1, 0); printf("\nFinal Statistics: \n\n"); printf("lenrw = %5ld leniw = %5ld\n", lenrw, leniw); diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out index ffb0e71104..a6c5f580fa 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out @@ -6,53 +6,53 @@ 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 -At top right: c1, c2 = 7.301e+06 2.833e+11 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 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 +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 = 3302 leniw = 243 +lenrw = 3302 leniw = 255 lenrwls = 2455 leniwls = 126 nst = 7102 nfe = 0 nfi = 74579 nfels = 87090 diff --git a/examples/arkode/C_petsc/ark_petsc_ex25.c b/examples/arkode/C_petsc/ark_petsc_ex25.c index 47373cb11f..0c0bf03fba 100644 --- a/examples/arkode/C_petsc/ark_petsc_ex25.c +++ b/examples/arkode/C_petsc/ark_petsc_ex25.c @@ -60,7 +60,7 @@ static PetscErrorCode FormIFunction(PetscReal, Vec, Vec, Vec, void*); static PetscErrorCode FormIJacobian(SNES, Vec, Mat, Mat, void*); static PetscErrorCode FormInitialSolution(Vec, void*); -/* User-supplied Functions called by ARKStep */ +/* User-supplied Functions called by ARKODE */ static int f_I(PetscReal, N_Vector, N_Vector, void*); static int f_E(PetscReal, N_Vector, N_Vector, void*); @@ -188,7 +188,7 @@ int main(int argc, char** argv) dt = 0.4 * PetscSqr(hx) / user.alpha; /* Diffusive stability limit */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create ARKStep time stepper + Create ARKODE time stepper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Call ARKStepCreate to initialize the ARK timestepper module and @@ -225,28 +225,28 @@ int main(int argc, char** argv) CHKERRQ(ierr); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set ARKStep options + Set ARKODE options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - ierr = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_retval(&ierr, "ARKStepSStolerances", 1)) { return 1; } + ierr = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_retval(&ierr, "ARKodeSStolerances", 1)) { return 1; } - ierr = ARKStepSetOrder(arkode_mem, 3); - if (check_retval(&ierr, "ARKStepSetOrder", 1)) { return 1; } + ierr = ARKodeSetOrder(arkode_mem, 3); + if (check_retval(&ierr, "ARKodeSetOrder", 1)) { return 1; } - ierr = ARKStepSetUserData(arkode_mem, (void*)&user); - if (check_retval(&ierr, "ARKStepSetUserData", 1)) { return 1; } + ierr = ARKodeSetUserData(arkode_mem, (void*)&user); + if (check_retval(&ierr, "ARKodeSetUserData", 1)) { return 1; } - ierr = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_retval(&ierr, "ARKStepSetNonlinearSolver", 1)) { return 1; } + ierr = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_retval(&ierr, "ARKodeSetNonlinearSolver", 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 = ARKodeSetAdaptController(arkode_mem, C); + if (check_retval(&ierr, "ARKodeSetAdaptController", 1)) { return 1; } - ierr = ARKStepSetInitStep(arkode_mem, dt); - if (check_retval(&ierr, "ARKStepSetInitStep", 1)) { return 1; } + ierr = ARKodeSetInitStep(arkode_mem, dt); + if (check_retval(&ierr, "ARKodeSetInitStep", 1)) { return 1; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Perform the integration @@ -265,18 +265,18 @@ int main(int argc, char** argv) /* Advance time */ tstop += dtout; - ierr = ARKStepSetStopTime(arkode_mem, tstop); - if (check_retval(&ierr, "ARKStepSetStopTime", 1)) { return 1; } + ierr = ARKodeSetStopTime(arkode_mem, tstop); + if (check_retval(&ierr, "ARKodeSetStopTime", 1)) { return 1; } /* Evolve solution in time */ - ierr = ARKStepEvolve(arkode_mem, ftime, nvecx, &t, ARK_NORMAL); - if (check_retval(&ierr, "ARKStepEvolve", 1)) { return 1; } + ierr = ARKodeEvolve(arkode_mem, ftime, nvecx, &t, ARK_NORMAL); + if (check_retval(&ierr, "ARKodeEvolve", 1)) { return 1; } /* Get statistics */ - ierr = ARKStepGetCurrentStep(arkode_mem, &dt); - if (check_retval(&ierr, "ARKStepGetCurrntStep", 1)) { return 1; } - ierr = ARKStepGetNumSteps(arkode_mem, &steps); - if (check_retval(&ierr, "ARKStepGetNumSteps", 1)) { return 1; } + ierr = ARKodeGetCurrentStep(arkode_mem, &dt); + if (check_retval(&ierr, "ARKodeGetCurrntStep", 1)) { return 1; } + ierr = ARKodeGetNumSteps(arkode_mem, &steps); + if (check_retval(&ierr, "ARKodeGetNumSteps", 1)) { return 1; } } printf("Converged at time %g after %ld steps.\n", t, steps); @@ -288,7 +288,7 @@ int main(int argc, char** argv) /* Free SUNDIALS data structures */ N_VDestroy(nvecx); /* Free x nvector */ SUNNonlinSolFree(NLS); /* Free nonlinear solver */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ (void)SUNAdaptController_Destroy(C); /* Free time adaptivity controller */ /* Free petsc data structures */ @@ -305,7 +305,7 @@ int main(int argc, char** argv) } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - User provided functions in ARKStep format + User provided functions in ARKODE format - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Implicit component of RHS */ @@ -459,7 +459,7 @@ PetscErrorCode FormIJacobian(SNES snes, Vec X, Mat J, Mat Jpre, void* ptr) hx = 1.0 / (PetscReal)(info.mx - 1); /* Get current gamma value from ARKode */ - ierr = ARKStepGetCurrentGamma(user->arkode_mem, &gamma); + ierr = ARKodeGetCurrentGamma(user->arkode_mem, &gamma); /* Get pointers to vector data */ ierr = DMDAVecGetArrayRead(user->da, X, &x); diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index 7bbbd42a6d..26774ead15 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -68,7 +68,7 @@ * preconditoner is applied on the left and on the right. In each * case, both the modified and classical Gram-Schmidt options are * tested. In the series of runs, ARKStepCreate, SUNLinSol_SPGMR and - * ARKStepSetLinearSolver are called only for the first run, whereas + * ARKodeSetLinearSolver are called only for the first run, whereas * ARKStepReInit, SUNLinSol_SPGMRSetPrecType, and * SUNLinSol_SPGMRSetGSType are called for each of the remaining * three runs. @@ -294,32 +294,32 @@ int main(int argc, char* argv[]) wdata->arkode_mem = arkode_mem; - flag = ARKStepSetUserData(arkode_mem, wdata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return (1); } + flag = ARKodeSetUserData(arkode_mem, wdata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return (1); } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return (1); } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return (1); } - flag = ARKStepSetMaxNumSteps(arkode_mem, 1000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return (1); } + flag = ARKodeSetMaxNumSteps(arkode_mem, 1000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return (1); } - flag = ARKStepSetNonlinConvCoef(arkode_mem, 1.e-3); - if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return (1); } + flag = ARKodeSetNonlinConvCoef(arkode_mem, 1.e-3); + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return (1); } LS = SUNLinSol_SPGMR(c, jpre, MAXL, ctx); if (check_flag((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } flag = SUNLinSol_SPGMRSetGSType(LS, gstype); if (check_flag(&flag, "SUNLinSol_SPGMRSetGSType", 1)) { return (1); } - flag = ARKStepSetEpsLin(arkode_mem, DELT); - if (check_flag(&flag, "ARKStepSetEpsLin", 1)) { return (1); } + flag = ARKodeSetEpsLin(arkode_mem, DELT); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return (1); } - flag = ARKStepSetPreconditioner(arkode_mem, Precond, PSolve); - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return (1); } + flag = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return (1); } /* Set the linear solver tolerance conversion factor */ switch (nrmfactor) @@ -338,8 +338,8 @@ int main(int argc, char* argv[]) break; } - flag = ARKStepSetLSNormFactor(arkode_mem, nrmfac); - if (check_flag(&flag, "ARKStepSetLSNormFactor", 1)) { return (1); } + flag = ARKodeSetLSNormFactor(arkode_mem, nrmfac); + if (check_flag(&flag, "ARKodeSetLSNormFactor", 1)) { return (1); } } else { @@ -356,14 +356,14 @@ int main(int argc, char* argv[]) /* Print initial values */ if (firstrun) { PrintAllSpecies(c, ns, mxns, T0); } - /* Loop over output points, call ARKStepEvolve, print sample solution values. */ + /* Loop over output points, call ARKodeEvolve, print sample solution values. */ tout = T1; for (iout = 1; iout <= NOUT; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, c, &t, ARK_NORMAL); + flag = ARKodeEvolve(arkode_mem, tout, c, &t, ARK_NORMAL); PrintOutput(arkode_mem, t); if (firstrun && (iout % 3 == 0)) { PrintAllSpecies(c, ns, mxns, t); } - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } if (tout > SUN_RCONST(0.9)) { tout += DTOUT; } else { tout *= TOUT_MULT; } } @@ -374,7 +374,7 @@ int main(int argc, char* argv[]) } /* Free all memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); N_VDestroy(c); SUNLinSolFree(LS); FreeUserData(wdata); @@ -624,14 +624,14 @@ static void PrintOutput(void* arkode_mem, sunrealtype t) int flag; sunrealtype hu; - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetLastStep(arkode_mem, &hu); - check_flag(&flag, "ARKStepGetLastStep", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetLastStep(arkode_mem, &hu); + check_flag(&flag, "ARKodeGetLastStep", 1); #if defined(SUNDIALS_EXTENDED_PRECISION) printf("t = %10.2Le nst = %ld nfe = %ld nfi = %ld nni = %ld", t, nst, nfe, @@ -657,33 +657,33 @@ static void PrintFinalStats(void* arkode_mem) int flag; sunrealtype avdim; - flag = ARKStepGetWorkSpace(arkode_mem, &lenrw, &leniw); - check_flag(&flag, "ARKStepGetWorkSpace", 1); - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKodeGetWorkSpace(arkode_mem, &lenrw, &leniw); + check_flag(&flag, "ARKodeGetWorkSpace", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - - flag = ARKStepGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); - check_flag(&flag, "ARKStepGetLinWorkSpace", 1); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1); - flag = ARKStepGetNumPrecEvals(arkode_mem, &npe); - check_flag(&flag, "ARKStepGetNumPrecEvals", 1); - flag = ARKStepGetNumPrecSolves(arkode_mem, &nps); - check_flag(&flag, "ARKStepGetNumPrecSolves", 1); - flag = ARKStepGetNumLinConvFails(arkode_mem, &ncfl); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + + flag = ARKodeGetLinWorkSpace(arkode_mem, &lenrwLS, &leniwLS); + check_flag(&flag, "ARKodeGetLinWorkSpace", 1); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1); + flag = ARKodeGetNumPrecEvals(arkode_mem, &npe); + check_flag(&flag, "ARKodeGetNumPrecEvals", 1); + flag = ARKodeGetNumPrecSolves(arkode_mem, &nps); + check_flag(&flag, "ARKodeGetNumPrecSolves", 1); + flag = ARKodeGetNumLinConvFails(arkode_mem, &ncfl); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\n\n Final statistics for this run:\n\n"); printf(" ARKStep real workspace length = %4ld \n", lenrw); @@ -846,8 +846,8 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, arkode_mem = wdata->arkode_mem; cdata = N_VGetArrayPointer(c); rewt = wdata->rewt; - flag = ARKStepGetErrWeights(arkode_mem, rewt); - if (check_flag(&flag, "ARKStepGetErrWeights", 1)) { return (1); } + flag = ARKodeGetErrWeights(arkode_mem, rewt); + if (check_flag(&flag, "ARKodeGetErrWeights", 1)) { return (1); } rewtdata = N_VGetArrayPointer(rewt); uround = SUN_UNIT_ROUNDOFF; diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.out b/examples/arkode/C_serial/ark_KrylovDemo_prec.out index 79d7c4a86f..e60c62304f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.out @@ -419,7 +419,7 @@ Species 6 Final statistics for this run: ARKStep real workspace length = 3558 - ARKStep integer workspace length = 131 + ARKStep integer workspace length = 143 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -488,7 +488,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 = 3558 - ARKStep integer workspace length = 136 + ARKStep integer workspace length = 148 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -557,7 +557,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 = 3558 - ARKStep integer workspace length = 141 + ARKStep integer workspace length = 153 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 @@ -626,7 +626,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 = 3558 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 158 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out index 79d7c4a86f..e60c62304f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_1.out @@ -419,7 +419,7 @@ Species 6 Final statistics for this run: ARKStep real workspace length = 3558 - ARKStep integer workspace length = 131 + ARKStep integer workspace length = 143 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -488,7 +488,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 = 3558 - ARKStep integer workspace length = 136 + ARKStep integer workspace length = 148 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -557,7 +557,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 = 3558 - ARKStep integer workspace length = 141 + ARKStep integer workspace length = 153 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 @@ -626,7 +626,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 = 3558 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 158 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out index 79d7c4a86f..e60c62304f 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec_2.out @@ -419,7 +419,7 @@ Species 6 Final statistics for this run: ARKStep real workspace length = 3558 - ARKStep integer workspace length = 131 + ARKStep integer workspace length = 143 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -488,7 +488,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 = 3558 - ARKStep integer workspace length = 136 + ARKStep integer workspace length = 148 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 190 @@ -557,7 +557,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 = 3558 - ARKStep integer workspace length = 141 + ARKStep integer workspace length = 153 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 @@ -626,7 +626,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 = 3558 - ARKStep integer workspace length = 146 + ARKStep integer workspace length = 158 ARKLS real workspace length = 2647 ARKLS integer workspace length = 42 Number of steps = 349 diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index eb1a7cd934..c13bd87b15 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -107,11 +107,11 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)&lamda); /* Pass lamda to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)&lamda); /* Pass lamda to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); @@ -120,15 +120,15 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -137,7 +137,7 @@ int main(void) /* output initial condition to disk */ fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -145,8 +145,8 @@ int main(void) printf(" ---------------------\n"); while (Tf - t > 1.0e-15) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM "\n", t, NV_Ith_S(y, 0)); /* access/print solution */ fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", t, NV_Ith_S(y, 0)); @@ -165,24 +165,24 @@ int main(void) fclose(UFID); /* Get/print some final statistics on how the solve progressed */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -198,11 +198,11 @@ int main(void) flag = check_ans(y, t, reltol, abstol); /* Clean up and return */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return flag; } diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index e1dd476909..08d0fa5884 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -46,7 +46,7 @@ #define FSYM "f" #endif -/* User-supplied functions called by ARKStep */ +/* User-supplied functions called by ARKODE */ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); /* Custom linear solver data structure, accessor macros, and routines */ @@ -107,23 +107,23 @@ int main(void) if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - retval = ARKStepSetUserData(arkode_mem, - (void*)&lamda); /* Pass lamda to user functions */ - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } - retval = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, + (void*)&lamda); /* Pass lamda to user functions */ + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Initialize custom matrix-embedded linear solver */ LS = MatrixEmbeddedLS(arkode_mem, ctx); if (check_retval((void*)LS, "MatrixEmbeddedLS", 0)) { return 1; } - retval = ARKStepSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LS, NULL); /* Attach linear solver */ + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - retval = ARKStepSetLinear(arkode_mem, 0); - if (check_retval(&retval, "ARKStepSetLinear", 1)) { return 1; } + retval = ARKodeSetLinear(arkode_mem, 0); + if (check_retval(&retval, "ARKodeSetLinear", 1)) { return 1; } - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached. */ t = T0; tout = T0 + dTout; @@ -131,9 +131,8 @@ int main(void) printf(" ---------------------\n"); while (Tf - t > 1.0e-15) { - retval = ARKStepEvolve(arkode_mem, tout, y, &t, - ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM "\n", t, NV_Ith_S(y, 0)); /* access/print solution */ if (retval >= 0) @@ -150,24 +149,24 @@ int main(void) printf(" ---------------------\n"); /* Get/print some final statistics on how the solve progressed */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_retval(&retval, "ARKStepGetNumLinSolvSetups", 1); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); - retval = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); - retval = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_retval(&retval, "ARKStepGetNumLinRhsEvals", 1); + retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_retval(&retval, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -183,10 +182,10 @@ int main(void) retval = check_ans(y, t, reltol, abstol); /* Clean up and return */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free the SUNContext */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free the SUNContext */ return retval; } @@ -250,10 +249,10 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype* rdata; sunrealtype lamda; - /* retrieve implicit system data from ARKStep */ - retval = ARKStepGetNonlinearSystemData(LS->content, &tcur, &zpred, &z, &Fi, - &gamma, &sdata, &user_data); - if (check_retval((void*)&retval, "ARKStepGetNonlinearSystemData", 1)) + /* retrieve implicit system data from ARKODE */ + retval = ARKodeGetNonlinearSystemData(LS->content, &tcur, &zpred, &z, &Fi, + &gamma, &sdata, &user_data); + if (check_retval((void*)&retval, "ARKodeGetNonlinearSystemData", 1)) { return (-1); } diff --git a/examples/arkode/C_serial/ark_analytic_nonlin.c b/examples/arkode/C_serial/ark_analytic_nonlin.c index f8a4565c55..1bb5f99987 100644 --- a/examples/arkode/C_serial/ark_analytic_nonlin.c +++ b/examples/arkode/C_serial/ark_analytic_nonlin.c @@ -89,8 +89,8 @@ int main(void) if (check_flag((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } /* Specify tolerances */ - flag = ERKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ERKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -99,7 +99,7 @@ int main(void) /* output initial condition to disk */ fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0)); - /* Main time-stepping loop: calls ERKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -107,8 +107,8 @@ int main(void) printf(" ---------------------\n"); while (Tf - t > 1.0e-15) { - flag = ERKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ERKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM "\n", t, NV_Ith_S(y, 0)); /* access/print solution */ fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", t, NV_Ith_S(y, 0)); @@ -128,17 +128,17 @@ int main(void) /* Print final statistics */ printf("\nFinal Statistics:\n"); - flag = ERKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); /* Print final statistics to a file in CSV format */ FID = fopen("ark_analytic_nonlin_stats.csv", "w"); - flag = ERKStepPrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ERKStepFree(&arkode_mem); /* Free integrator memory */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index 9dc799d308..927c3e57da 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -168,17 +168,16 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)rdata); /* Pass rdata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetInterpolantType(arkode_mem, - ARK_INTERP_LAGRANGE); /* Specify stiff interpolant */ - if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } - flag = ARKStepSetDeduceImplicitRhs(arkode_mem, - 1); /* Avoid eval of f after stage */ - if (check_flag(&flag, "ARKStepSetDeduceImplicitRhs", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)rdata); /* Pass rdata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetInterpolantType(arkode_mem, + ARK_INTERP_LAGRANGE); /* Specify stiff interpolant */ + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } + flag = ARKodeSetDeduceImplicitRhs(arkode_mem, 1); /* Avoid eval of f after stage */ + if (check_flag(&flag, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); @@ -187,11 +186,11 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -201,7 +200,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -212,8 +211,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM "\n", /* access/print solution */ t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -234,26 +233,26 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumStepSolveFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumStepSolveFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &nnf); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumStepSolveFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumStepSolveFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &nnf); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -267,11 +266,11 @@ int main(void) printf(" Total number of failed steps from solver failure = %li\n", ncfn); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index abd7399099..6857fab6d0 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -207,11 +207,11 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize band matrix data structure and solver -- A will be factored, so set smu to ml+mu */ A = SUNBandMatrix(NEQ, 4, 4, ctx); @@ -220,11 +220,11 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Band", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -246,7 +246,7 @@ int main(void) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -255,8 +255,8 @@ int main(void) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -290,24 +290,24 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -325,11 +325,11 @@ int main(void) N_VDestroy(umask); N_VDestroy(vmask); N_VDestroy(wmask); - free(udata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + free(udata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index 11d9dbab40..a79e142eea 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -285,16 +285,16 @@ int main(int argc, char* argv[]) /* Set routines */ /* Pass udata to user functions */ - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return (1); } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return (1); } /* Specify tolerances */ - retval = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return (1); } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return (1); } /* Specify residual tolerance */ - retval = ARKStepResStolerance(arkode_mem, abstol); - if (check_retval(&retval, "ARKStepResStolerance", 1)) { return (1); } + retval = ARKodeResStolerance(arkode_mem, abstol); + if (check_retval(&retval, "ARKodeResStolerance", 1)) { return (1); } /* Initialize sparse matrix data structure and linear solvers (system and mass) */ NNZ = 15 * NEQ; @@ -311,26 +311,26 @@ int main(int argc, char* argv[]) MLS = SUNLinSol_SuperLUMT(y, M, num_threads, ctx); if (check_retval((void*)MLS, "SUNLinSol_SuperLUMT", 0)) { return (1); } - /* Attach the matrix, linear solver, and Jacobian construction routine to ARKStep */ + /* Attach the matrix, linear solver, and Jacobian construction routine to ARKODE */ /* Attach matrix and LS */ - retval = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return (1); } + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return (1); } /* Supply Jac routine */ - retval = ARKStepSetJacFn(arkode_mem, Jac); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return (1); } + retval = ARKodeSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return (1); } - /* Attach the mass matrix, linear solver and construction routines to ARKStep; - notify ARKStep that the mass matrix is not time-dependent */ + /* Attach the mass matrix, linear solver and construction routines to ARKode; + notify ARKode that the mass matrix is not time-dependent */ /* Attach matrix and LS */ - retval = ARKStepSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); - if (check_retval(&retval, "ARKStepSetMassLinearSolver", 1)) { return (1); } + retval = ARKodeSetMassLinearSolver(arkode_mem, MLS, M, SUNFALSE); + if (check_retval(&retval, "ARKodeSetMassLinearSolver", 1)) { return (1); } /* Supply M routine */ - retval = ARKStepSetMassFn(arkode_mem, MassMatrix); - if (check_retval(&retval, "ARKStepSetMassFn", 1)) { return (1); } + retval = ARKodeSetMassFn(arkode_mem, MassMatrix); + if (check_retval(&retval, "ARKodeSetMassFn", 1)) { return (1); } /* output mesh to disk */ FID = fopen("bruss_FEM_mesh.txt", "w"); @@ -352,7 +352,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -361,9 +361,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - retval = ARKStepEvolve(arkode_mem, tout, y, &t, - ARK_NORMAL); /* call integrator */ - if (check_retval(&retval, "ARKStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } u = N_VWL2Norm(y, umask); /* access/print solution statistics */ u = sqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -397,28 +396,28 @@ int main(int argc, char* argv[]) fclose(WFID); /* Print some final statistics */ - retval = ARKStepGetNumSteps(arkode_mem, &nst); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nst); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_retval(&retval, "ARKStepGetNumLinSolvSetups", 1); - retval = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); - retval = ARKStepGetNumMassSetups(arkode_mem, &nmset); - check_retval(&retval, "ARKStepGetNumMassSetups", 1); - retval = ARKStepGetNumMassSolves(arkode_mem, &nms); - check_retval(&retval, "ARKStepGetNumMassSolves", 1); - retval = ARKStepGetNumMassMult(arkode_mem, &nMv); - check_retval(&retval, "ARKStepGetNumMassMult", 1); - retval = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); + retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumMassSetups(arkode_mem, &nmset); + check_retval(&retval, "ARKodeGetNumMassSetups", 1); + retval = ARKodeGetNumMassSolves(arkode_mem, &nms); + check_retval(&retval, "ARKodeGetNumMassSolves", 1); + retval = ARKodeGetNumMassMult(arkode_mem, &nMv); + check_retval(&retval, "ARKodeGetNumMassMult", 1); + retval = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -442,8 +441,8 @@ int main(int argc, char* argv[]) N_VDestroy(udata->tmp); free(udata->x); free(udata); - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solvers */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solvers */ SUNLinSolFree(MLS); SUNMatDestroy(A); /* Free matrices */ SUNMatDestroy(M); diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index 7a557fa22a..c1245a4f4e 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -400,28 +400,28 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSf, "SUNLinSol_Band", 0)) { return 1; } /* Specify fast tolerances */ - retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set max number of nonlinear iters */ - retval = ARKStepSetMaxNonlinIters(inner_arkode_mem, 10); - if (check_retval(&retval, "ARKStepSetMaxNonlinIters", 1)) { return 1; } + retval = ARKodeSetMaxNonlinIters(inner_arkode_mem, 10); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKStepSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; case (1): /*dirk 5th order fast solver (full problem) */ inner_arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set method order to use */ - retval = ARKStepSetOrder(inner_arkode_mem, 5); - if (check_retval(&retval, "ARKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(inner_arkode_mem, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } /* Initialize matrix and linear solver data structures */ Af = SUNBandMatrix(NEQ, 4, 4, ctx); @@ -431,16 +431,16 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSf, "SUNLinSol_Band", 0)) { return 1; } /* Specify fast tolerances */ - retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKStepSetJacFn(inner_arkode_mem, Jac); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; case (2): /* erk-3-3 fast solver */ case (4): @@ -497,30 +497,30 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSf, "SUNLinSol_Band", 0)) { return 1; } /* Specify fast tolerances */ - retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set max number of nonlinear iters */ - retval = ARKStepSetMaxNonlinIters(inner_arkode_mem, 10); - if (check_retval(&retval, "ARKStepSetMaxNonlinIters", 1)) { return 1; } + retval = ARKodeSetMaxNonlinIters(inner_arkode_mem, 10); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKStepSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; } /* Attach user data to fast integrator */ - retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -576,16 +576,16 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSs, "SUNLinSol_Band", 0)) { return 1; } /* Specify tolerances */ - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = MRIStepSetJacFn(arkode_mem, Js); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Js); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; case (4): case (5): /* IMEX-MRI-GARK3b, solve-decoupled slow solver */ @@ -606,16 +606,16 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSs, "SUNLinSol_Band", 0)) { return 1; } /* Specify tolerances */ - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = MRIStepSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; case (6): case (7): /* IMEX-MRI-GARK4, solve-decoupled slow solver */ @@ -636,30 +636,30 @@ int main(int argc, char* argv[]) if (check_retval((void*)LSs, "SUNLinSol_Band", 0)) { return 1; } /* Specify tolerances */ - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = MRIStepSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } break; } /* Pass udata to user functions */ - retval = MRIStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Set maximum number of steps taken by solver */ - retval = MRIStepSetMaxNumSteps(arkode_mem, 1000000); - if (check_retval(&retval, "MRIStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* * Integrate ODE @@ -706,7 +706,7 @@ int main(int argc, char* argv[]) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls MRIStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -715,8 +715,8 @@ int main(int argc, char* argv[]) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* access/print solution statistics */ u = N_VWL2Norm(y, umask); @@ -750,14 +750,14 @@ int main(int argc, char* argv[]) */ /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); @@ -801,10 +801,10 @@ int main(int argc, char* argv[]) /* Get/print slow integrator decoupled implicit solver statistics */ if (solve_type > 1) { - retval = MRIStepGetNonlinSolvStats(arkode_mem, &nnis, &nncs); - check_retval(&retval, "MRIStepGetNonlinSolvStats", 1); - retval = MRIStepGetNumJacEvals(arkode_mem, &njes); - check_retval(&retval, "MRIStepGetNumJacEvals", 1); + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); + retval = ARKodeGetNumJacEvals(arkode_mem, &njes); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf(" Slow Newton iters = %li\n", nnis); printf(" Slow Newton conv fails = %li\n", nncs); printf(" Slow Jacobian evals = %li\n", njes); @@ -814,10 +814,10 @@ int main(int argc, char* argv[]) if ((solve_type == 0) || (solve_type == 1) || (solve_type == 3) || (solve_type == 5) || (solve_type == 7)) { - retval = ARKStepGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); - check_retval(&retval, "ARKStepGetNonlinSolvStats", 1); - retval = ARKStepGetNumJacEvals(inner_arkode_mem, &njef); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); + retval = ARKodeGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); + check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); + retval = ARKodeGetNumJacEvals(inner_arkode_mem, &njef); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf(" Fast Newton iters = %li\n", nnif); printf(" Fast Newton conv fails = %li\n", nncf); printf(" Fast Jacobian evals = %li\n", njef); @@ -825,9 +825,9 @@ int main(int argc, char* argv[]) /* Clean up and return with successful completion */ free(udata); /* Free user data */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ ARKodeButcherTable_Free(B); /* Free Butcher table */ MRIStepCoupling_Free(C); /* Free coupling coefficients */ SUNMatDestroy(Af); /* Free fast matrix */ diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index 1c34e56c3c..208acb9a92 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -223,11 +223,11 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize sparse matrix data structure and KLU solver */ NNZ = 5 * NEQ; @@ -236,11 +236,11 @@ int main(void) LS = SUNLinSol_KLU(y, A, ctx); if (check_flag((void*)LS, "SUNLinSol_KLU", 0)) { return 1; } - /* Attach the matrix, linear solver, and Jacobian construction routine to ARKStep */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and LS */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Supply Jac routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + /* Attach the matrix, linear solver, and Jacobian construction routine to ARKODE */ + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and LS */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Supply Jac routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); @@ -262,7 +262,7 @@ int main(void) fprintf(VFID, "\n"); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = Tf / Nt; @@ -271,7 +271,7 @@ int main(void) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ u = N_VWL2Norm(y, umask); u = SUNRsqrt(u * u / N); v = N_VWL2Norm(y, vmask); @@ -305,22 +305,22 @@ int main(void) fclose(WFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -339,10 +339,10 @@ int main(void) N_VDestroy(wmask); SUNMatDestroy(udata->R); /* Free user data */ free(udata); - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index 57171864e9..ba858f7a0e 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -228,24 +228,24 @@ int main(int argc, char* argv[]) if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Attach user data to fast integrator */ - retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the fast method */ retval = ARKStepSetTableNum(inner_arkode_mem, ARKODE_ARK324L2SA_DIRK_4_2_3, -1); if (check_retval(&retval, "ARKStepSetTableNum", 1)) { return 1; } /* Specify fast tolerances */ - retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Attach matrix and linear solver */ - retval = ARKStepSetLinearSolver(inner_arkode_mem, LS, A); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set the Jacobian routine */ - retval = ARKStepSetJacFn(inner_arkode_mem, Jf); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -265,12 +265,12 @@ int main(int argc, char* argv[]) if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } /* Pass udata to user functions */ - retval = MRIStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* output spatial mesh to disk (add extra point for periodic BC) */ FID = fopen("mesh.txt", "w"); @@ -301,7 +301,7 @@ int main(int argc, char* argv[]) fprintf(WFID, " %.16" ESYM, data[IDX(0, 2)]); fprintf(WFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -311,8 +311,8 @@ int main(int argc, char* argv[]) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* access/print solution statistics */ u = N_VWL2Norm(y, umask); @@ -347,30 +347,30 @@ int main(int argc, char* argv[]) fclose(WFID); /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); - retval = ARKStepGetNumStepAttempts(inner_arkode_mem, &nstf_a); - check_retval(&retval, "ARKStepGetNumStepAttempts", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); + retval = ARKodeGetNumStepAttempts(inner_arkode_mem, &nstf_a); + check_retval(&retval, "ARKodeGetNumStepAttempts", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); - retval = ARKStepGetNumLinSolvSetups(inner_arkode_mem, &nsetups); - check_retval(&retval, "ARKStepGetNumLinSolvSetups", 1); - retval = ARKStepGetNumErrTestFails(inner_arkode_mem, &netf); - check_retval(&retval, "ARKStepGetNumErrTestFails", 1); - retval = ARKStepGetNumNonlinSolvIters(inner_arkode_mem, &nni); - check_retval(&retval, "ARKStepGetNumNonlinSolvIters", 1); - retval = ARKStepGetNumNonlinSolvConvFails(inner_arkode_mem, &ncfn); - check_retval(&retval, "ARKStepGetNumNonlinSolvConvFails", 1); - retval = ARKStepGetNumJacEvals(inner_arkode_mem, &nje); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); - retval = ARKStepGetNumLinRhsEvals(inner_arkode_mem, &nfeLS); - check_retval(&retval, "ARKStepGetNumLinRhsEvals", 1); + retval = ARKodeGetNumLinSolvSetups(inner_arkode_mem, &nsetups); + check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); + retval = ARKodeGetNumErrTestFails(inner_arkode_mem, &netf); + check_retval(&retval, "ARKodeGetNumErrTestFails", 1); + retval = ARKodeGetNumNonlinSolvIters(inner_arkode_mem, &nni); + check_retval(&retval, "ARKodeGetNumNonlinSolvIters", 1); + retval = ARKodeGetNumNonlinSolvConvFails(inner_arkode_mem, &ncfn); + check_retval(&retval, "ARKodeGetNumNonlinSolvConvFails", 1); + retval = ARKodeGetNumJacEvals(inner_arkode_mem, &nje); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); + retval = ARKodeGetNumLinRhsEvals(inner_arkode_mem, &nfeLS); + check_retval(&retval, "ARKodeGetNumLinRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); @@ -387,9 +387,9 @@ int main(int argc, char* argv[]) /* Clean up and return with successful completion */ free(udata); /* Free user data */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ SUNLinSolFree(LS); /* Free linear solver */ SUNMatDestroy(A); /* Free matrix */ N_VDestroy(y); /* Free vectors */ diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index 012acd329e..96b6e2fff6 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -185,22 +185,22 @@ int main(int argc, char* argv[]) arkode_mem = ARKStepCreate(fe, fi, T0, y, ctx); if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } - /* Initialize fixed-point nonlinear solver and attach to ARKStep */ + /* Initialize fixed-point nonlinear solver and attach to ARKODE */ NLS = SUNNonlinSol_FixedPoint(y, fp_m, ctx); if (check_flag((void*)NLS, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - flag = ARKStepSetNonlinearSolver(arkode_mem, NLS); - if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) { return 1; } + flag = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)rdata); /* Pass rdata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetMaxNonlinIters(arkode_mem, - maxcor); /* Increase default iterations */ - if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)rdata); /* Pass rdata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetMaxNonlinIters(arkode_mem, + maxcor); /* Increase default iterations */ + if (check_flag(&flag, "ARKodeSetMaxNonlinIters", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -210,7 +210,7 @@ int main(int argc, char* argv[]) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -218,8 +218,8 @@ int main(int argc, char* argv[]) printf(" ----------------------------------------------\n"); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM "\n", /* access/print solution */ t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -240,18 +240,18 @@ int main(int argc, char* argv[]) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -263,7 +263,7 @@ int main(int argc, char* argv[]) /* Clean up and return with successful completion */ N_VDestroy(y); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNNonlinSolFree(NLS); SUNLogger_Destroy(&logger); SUNContext_Free(&ctx); diff --git a/examples/arkode/C_serial/ark_brusselator_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 0fbca635e7..0b636fd3a7 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_mri.c @@ -135,16 +135,16 @@ int main(void) if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Attach user data to fast integrator */ - retval = ARKStepSetUserData(inner_arkode_mem, (void*)rdata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(inner_arkode_mem, (void*)rdata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the fast method */ retval = ARKStepSetTableNum(inner_arkode_mem, -1, ARKODE_KNOTH_WOLKE_3_3); if (check_retval(&retval, "ARKStepSetTableNum", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -164,12 +164,12 @@ int main(void) if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } /* Pass rdata to user functions */ - retval = MRIStepSetUserData(arkode_mem, (void*)rdata); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)rdata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* * Integrate ODE @@ -183,7 +183,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls MRIStepEvolve to perform the + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; @@ -196,8 +196,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* access/print solution */ printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM "\n", t, @@ -217,14 +217,14 @@ int main(void) */ /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); @@ -235,9 +235,9 @@ int main(void) /* Clean up and return */ N_VDestroy(y); /* Free y vector */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ SUNContext_Free(&ctx); /* Free context */ return 0; 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 4ef129b9d3..c9570e8bec 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c @@ -215,14 +215,14 @@ int main(int argc, char* argv[]) if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } /* Specify tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ARKStepSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ARKStepSetRelaxFn")) { return 1; } + flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } } if (implicit) @@ -235,12 +235,12 @@ int main(int argc, char* argv[]) if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } /* Attach the matrix and linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } /* Set Jacobian routine */ - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } /* Select a Butcher table with non-negative b values */ flag = ARKStepSetTableName(arkode_mem, "ARKODE_ARK2_DIRK_3_1_2", @@ -248,14 +248,14 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKStepSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } /* Open output stream for results, output comment line */ @@ -290,8 +290,8 @@ int main(int argc, char* argv[]) while (t < tf) { /* Evolve in time */ - flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKStepEvolve")) { break; } + flag = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { break; } /* Output solution and errors */ flag = Ent(y, &ent, NULL); @@ -305,8 +305,8 @@ int main(int argc, char* argv[]) v_err = ydata[1] - ytdata[1]; /* Output to the screen periodically */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); if (nst % 40 == 0) { @@ -331,14 +331,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKStepGetNumStepAttempts"); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKodeGetNumStepAttempts"); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKStepGetNumErrTestFails"); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKodeGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -350,20 +350,20 @@ int main(int argc, char* argv[]) if (implicit) { - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKStepGetNumNonlinSolvIters"); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKodeGetNumNonlinSolvIters"); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKStepGetNumLinSolvSetups"); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKodeGetNumLinSolvSetups"); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKStepGetNumJacEvals"); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKodeGetNumJacEvals"); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKStepGetNumLinRhsEvals"); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKodeGetNumLinRhsEvals"); printf(" Total number of Newton iterations = %li\n", nni); printf(" Total number of linear solver convergence failures = %li\n", ncfn); @@ -374,23 +374,23 @@ int main(int argc, char* argv[]) if (relax) { - flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKStepGetNumRelaxFnEvals"); + flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKodeGetNumRelaxFnEvals"); - flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKStepGetNumRelaxJacEvals"); + flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKodeGetNumRelaxJacEvals"); - flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKStepGetNumRelaxFails"); + flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKodeGetNumRelaxFails"); - flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKStepGetNumRelaxBoundFails"); + flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKodeGetNumRelaxBoundFails"); - flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKStepGetNumRelaxSolveFails"); + flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKodeGetNumRelaxSolveFails"); - flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKStepGetNumRelaxSolveIters"); + flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKodeGetNumRelaxSolveIters"); printf(" Total Relaxation Fn evals = %li\n", nre); printf(" Total Relaxation Jac evals = %li\n", nrje); @@ -405,8 +405,8 @@ int main(int argc, char* argv[]) * Clean up * * -------- */ - /* Free ARKStep integrator and SUNDIALS objects */ - ARKStepFree(&arkode_mem); + /* Free ARKode integrator and SUNDIALS objects */ + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); SUNMatDestroy(A); N_VDestroy(y); diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c index e78a50e9bc..6b73b0d999 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c @@ -202,20 +202,20 @@ int main(int argc, char* argv[]) if (check_ptr(arkode_mem, "ERKStepCreate")) { return 1; } /* Specify tolerances */ - flag = ERKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ERKStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ERKStepSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ERKStepSetRelaxFn")) { return 1; } + flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ERKStepSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ERKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } /* Open output stream for results, output comment line */ @@ -250,8 +250,8 @@ int main(int argc, char* argv[]) while (t < tf) { /* Evolve in time */ - flag = ERKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ERKStepEvolve")) { break; } + flag = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { break; } /* Output solution and errors */ flag = Ent(y, &ent, NULL); @@ -265,8 +265,8 @@ int main(int argc, char* argv[]) v_err = ydata[1] - ytdata[1]; /* Output to the screen periodically */ - flag = ERKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ERKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); if (nst % 40 == 0) { @@ -291,14 +291,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ERKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ERKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); - flag = ERKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ERKStepGetNumStepAttempts"); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKodeGetNumStepAttempts"); - flag = ERKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ERKStepGetNumErrTestFails"); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKodeGetNumErrTestFails"); flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); check_flag(flag, "ERKStepGetNumRhsEvals"); @@ -310,23 +310,23 @@ int main(int argc, char* argv[]) if (relax) { - flag = ERKStepGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ERKStepGetNumRelaxFnEvals"); + flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKodeGetNumRelaxFnEvals"); - flag = ERKStepGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ERKStepGetNumRelaxJacEvals"); + flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKodeGetNumRelaxJacEvals"); - flag = ERKStepGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ERKStepGetNumRelaxFails"); + flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKodeGetNumRelaxFails"); - flag = ERKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ERKStepGetNumRelaxBoundFails"); + flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKodeGetNumRelaxBoundFails"); - flag = ERKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ERKStepGetNumRelaxSolveFails"); + flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKodeGetNumRelaxSolveFails"); - flag = ERKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ERKStepGetNumRelaxSolveIters"); + flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKodeGetNumRelaxSolveIters"); printf(" Total Relaxation Fn evals = %li\n", nre); printf(" Total Relaxation Jac evals = %li\n", nrje); @@ -341,8 +341,8 @@ int main(int argc, char* argv[]) * Clean up * * -------- */ - /* Free ERKStep integrator and SUNDIALS objects */ - ERKStepFree(&arkode_mem); + /* Free ARKode integrator and SUNDIALS objects */ + ARKodeFree(&arkode_mem); N_VDestroy(y); N_VDestroy(ytrue); SUNContext_Free(&ctx); diff --git a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c index 79e6310538..8bfca224ed 100644 --- a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c +++ b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c @@ -106,17 +106,17 @@ int main(int argc, char* argv[]) /* Create SPRKStep integrator */ arkode_mem = SPRKStepCreate(qdot, pdot, T0, y, sunctx); - retval = SPRKStepSetOrder(arkode_mem, order); - if (check_retval(&retval, "SPRKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } retval = SPRKStepSetUseCompensatedSums(arkode_mem, use_compsums); if (check_retval(&retval, "SPRKStepSetUseCompensatedSums", 1)) { return 1; } - retval = SPRKStepSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } - retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); - if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Print out starting Hamiltonian before integrating */ tret = T0; @@ -128,8 +128,8 @@ int main(int argc, char* argv[]) /* Do integration */ for (iout = 0; iout < num_output_times; iout++) { - if (args.use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } - retval = SPRKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args.use_tstop) { ARKodeSetStopTime(arkode_mem, tout); } + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); /* Output current integration status */ fprintf(stdout, "t = %.6Lf, q(t) = %.6Lf, H = %.6Lf\n", (long double)tret, @@ -149,9 +149,9 @@ int main(int argc, char* argv[]) } fprintf(stdout, "\n"); - SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); N_VDestroy(y); - SPRKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); SUNContext_Free(&sunctx); return 0; diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c index 7f6db669c1..5b071b61ae 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c @@ -195,14 +195,14 @@ int main(int argc, char* argv[]) if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } /* Specify tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } if (relax) { /* Enable relaxation methods */ - flag = ARKStepSetRelaxFn(arkode_mem, Ent, JacEnt); - if (check_flag(flag, "ARKStepSetRelaxFn")) { return 1; } + flag = ARKodeSetRelaxFn(arkode_mem, Ent, JacEnt); + if (check_flag(flag, "ARKodeSetRelaxFn")) { return 1; } } if (implicit) @@ -215,12 +215,12 @@ int main(int argc, char* argv[]) if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } /* Attach the matrix and linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } /* Set Jacobian routine */ - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(flag, "ARKStepSetJacFn")) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } /* Select a Butcher table with non-negative b values */ flag = ARKStepSetTableName(arkode_mem, "ARKODE_ARK2_DIRK_3_1_2", @@ -228,14 +228,14 @@ int main(int argc, char* argv[]) 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; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); + if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } } if (fixed_h > SUN_RCONST(0.0)) { - flag = ARKStepSetFixedStep(arkode_mem, fixed_h); - if (check_flag(flag, "ARKStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } } /* Open output stream for results, output comment line */ @@ -269,8 +269,8 @@ int main(int argc, char* argv[]) while (t < tf) { /* Evolve in time */ - flag = ARKStepEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(flag, "ARKStepEvolve")) { break; } + flag = ARKodeEvolve(arkode_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { break; } /* Output solution and errors */ flag = Ent(y, &ent, NULL); @@ -283,8 +283,8 @@ int main(int argc, char* argv[]) u_err = ydata[0] - ytdata[0]; /* Output to the screen periodically */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); if (nst % 40 == 0) { @@ -309,14 +309,14 @@ int main(int argc, char* argv[]) * ------------ */ /* Get final statistics on how the solve progressed */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(flag, "ARKStepGetNumSteps"); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(flag, "ARKodeGetNumSteps"); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(flag, "ARKStepGetNumStepAttempts"); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(flag, "ARKodeGetNumStepAttempts"); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(flag, "ARKStepGetNumErrTestFails"); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(flag, "ARKodeGetNumErrTestFails"); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(flag, "ARKStepGetNumRhsEvals"); @@ -328,20 +328,20 @@ int main(int argc, char* argv[]) if (implicit) { - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(flag, "ARKStepGetNumNonlinSolvIters"); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(flag, "ARKodeGetNumNonlinSolvIters"); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(flag, "ARKStepGetNumNonlinSolvConvFails"); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(flag, "ARKodeGetNumNonlinSolvConvFails"); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(flag, "ARKStepGetNumLinSolvSetups"); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(flag, "ARKodeGetNumLinSolvSetups"); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(flag, "ARKStepGetNumJacEvals"); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(flag, "ARKodeGetNumJacEvals"); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(flag, "ARKStepGetNumLinRhsEvals"); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(flag, "ARKodeGetNumLinRhsEvals"); printf(" Total number of Newton iterations = %li\n", nni); printf(" Total number of linear solver convergence failures = %li\n", ncfn); @@ -352,23 +352,23 @@ int main(int argc, char* argv[]) if (relax) { - flag = ARKStepGetNumRelaxFnEvals(arkode_mem, &nre); - check_flag(flag, "ARKStepGetNumRelaxFnEvals"); + flag = ARKodeGetNumRelaxFnEvals(arkode_mem, &nre); + check_flag(flag, "ARKodeGetNumRelaxFnEvals"); - flag = ARKStepGetNumRelaxJacEvals(arkode_mem, &nrje); - check_flag(flag, "ARKStepGetNumRelaxJacEvals"); + flag = ARKodeGetNumRelaxJacEvals(arkode_mem, &nrje); + check_flag(flag, "ARKodeGetNumRelaxJacEvals"); - flag = ARKStepGetNumRelaxFails(arkode_mem, &nrf); - check_flag(flag, "ARKStepGetNumRelaxFails"); + flag = ARKodeGetNumRelaxFails(arkode_mem, &nrf); + check_flag(flag, "ARKodeGetNumRelaxFails"); - flag = ARKStepGetNumRelaxBoundFails(arkode_mem, &nrbf); - check_flag(flag, "ARKStepGetNumRelaxBoundFails"); + flag = ARKodeGetNumRelaxBoundFails(arkode_mem, &nrbf); + check_flag(flag, "ARKodeGetNumRelaxBoundFails"); - flag = ARKStepGetNumRelaxSolveFails(arkode_mem, &nrnlsf); - check_flag(flag, "ARKStepGetNumRelaxSolveFails"); + flag = ARKodeGetNumRelaxSolveFails(arkode_mem, &nrnlsf); + check_flag(flag, "ARKodeGetNumRelaxSolveFails"); - flag = ARKStepGetNumRelaxSolveIters(arkode_mem, &nrnlsi); - check_flag(flag, "ARKStepGetNumRelaxSolveIters"); + flag = ARKodeGetNumRelaxSolveIters(arkode_mem, &nrnlsi); + check_flag(flag, "ARKodeGetNumRelaxSolveIters"); printf(" Total Relaxation Fn evals = %li\n", nre); printf(" Total Relaxation Jac evals = %li\n", nrje); @@ -383,8 +383,8 @@ int main(int argc, char* argv[]) * Clean up * * -------- */ - /* Free ARKStep integrator and SUNDIALS objects */ - ARKStepFree(&arkode_mem); + /* Free ARKODE integrator and SUNDIALS objects */ + ARKodeFree(&arkode_mem); SUNLinSolFree(LS); SUNMatDestroy(A); N_VDestroy(y); diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.c b/examples/arkode/C_serial/ark_harmonic_symplectic.c index 411c49ea63..72ddfa656c 100644 --- a/examples/arkode/C_serial/ark_harmonic_symplectic.c +++ b/examples/arkode/C_serial/ark_harmonic_symplectic.c @@ -125,20 +125,20 @@ int main(int argc, char* argv[]) /* Create SPRKStep integrator */ arkode_mem = SPRKStepCreate(xdot, vdot, T0, y, sunctx); - retval = SPRKStepSetOrder(arkode_mem, order); - if (check_retval(&retval, "SPRKStepSetOrder", 1)) { return 1; } + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) { return 1; } - retval = SPRKStepSetUserData(arkode_mem, &udata); - if (check_retval(&retval, "SPRKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, &udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } retval = SPRKStepSetUseCompensatedSums(arkode_mem, use_compsums); if (check_retval(&retval, "SPRKStepSetUseCompensatedSums", 1)) { return 1; } - retval = SPRKStepSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } - retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); - if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 2); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Print out starting energy, momentum before integrating */ tret = T0; @@ -150,8 +150,8 @@ int main(int argc, char* argv[]) /* Do integration */ for (iout = 0; iout < num_output_times; iout++) { - if (args.use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } - retval = SPRKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args.use_tstop) { ARKodeSetStopTime(arkode_mem, tout); } + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); /* Compute the anaytical solution */ Solution(tret, y, solution, &udata); @@ -188,8 +188,8 @@ int main(int argc, char* argv[]) fprintf(stdout, "\n"); N_VDestroy(y); N_VDestroy(solution); - SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - SPRKStepFree(&arkode_mem); + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + ARKodeFree(&arkode_mem); SUNContext_Free(&sunctx); return 0; diff --git a/examples/arkode/C_serial/ark_heat1D.c b/examples/arkode/C_serial/ark_heat1D.c index eb6609029d..c5e7597ecb 100644 --- a/examples/arkode/C_serial/ark_heat1D.c +++ b/examples/arkode/C_serial/ark_heat1D.c @@ -124,31 +124,31 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize PCG solver -- no preconditioning, with up to N iterations */ LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } /* Linear solver interface -- set user-supplied J*v routine (no 'jtsetup' required) */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - NULL); /* Attach linear solver to ARKStep */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + NULL); /* Attach linear solver to ARKODE */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* output mesh to disk */ FID = fopen("heat_mesh.txt", "w"); @@ -163,7 +163,7 @@ int main(void) for (i = 0; i < N; i++) { fprintf(UFID, " %.16" ESYM "", data[i]); } fprintf(UFID, "\n"); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -173,8 +173,8 @@ int main(void) printf(" %10.6" FSYM " %10.6f\n", t, sqrt(N_VDotProd(y, y) / N)); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.6" FSYM " %10.6f\n", t, sqrt(N_VDotProd(y, y) / N)); /* print solution stats */ if (flag >= 0) @@ -196,26 +196,26 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - check_flag(&flag, "ARKStepGetNumLinIters", 1); - flag = ARKStepGetNumJtimesEvals(arkode_mem, &nJv); - check_flag(&flag, "ARKStepGetNumJtimesEvals", 1); - flag = ARKStepGetNumLinConvFails(arkode_mem, &nlcf); - check_flag(&flag, "ARKStepGetNumLinConvFails", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + check_flag(&flag, "ARKodeGetNumLinIters", 1); + flag = ARKodeGetNumJtimesEvals(arkode_mem, &nJv); + check_flag(&flag, "ARKodeGetNumJtimesEvals", 1); + flag = ARKodeGetNumLinConvFails(arkode_mem, &nlcf); + check_flag(&flag, "ARKodeGetNumLinConvFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -230,11 +230,11 @@ int main(void) printf(" Total number of error test failures = %li\n", netf); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free vectors */ - free(udata); /* Free user data */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free vectors */ + free(udata); /* Free user data */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_heat1D_adapt.c b/examples/arkode/C_serial/ark_heat1D_adapt.c index 2852bffc4a..3f9e349073 100644 --- a/examples/arkode/C_serial/ark_heat1D_adapt.c +++ b/examples/arkode/C_serial/ark_heat1D_adapt.c @@ -161,35 +161,35 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetUserData(arkode_mem, - (void*)udata); /* Pass udata to user functions */ - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, + (void*)udata); /* Pass udata to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 10000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } flag = ARKStepSetAdaptivityMethod(arkode_mem, 2, 1, 0, NULL); /* Set adaptivity method */ - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } + if (check_flag(&flag, "ARKodeSetAdaptivityMethod", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, 0); /* Set predictor method */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } /* Specify linearly implicit RHS, with time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 1); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 1); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* Initialize PCG solver -- no preconditioning, with up to N iterations */ LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } /* Linear solver interface -- set user-supplied J*v routine (no 'jtsetup' required) */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - NULL); /* Attach linear solver to ARKStep */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + NULL); /* Attach linear solver to ARKODE */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; olddt = ZERO; @@ -204,22 +204,22 @@ int main(void) while (t < Tf) { /* "set" routines */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } /* call integrator */ - flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } + flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } /* "get" routines */ - flag = ARKStepGetLastStep(arkode_mem, &olddt); - if (check_flag(&flag, "ARKStepGetLastStep", 1)) { return 1; } - flag = ARKStepGetCurrentStep(arkode_mem, &newdt); - if (check_flag(&flag, "ARKStepGetCurrentStep", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = ARKStepGetNumLinIters(arkode_mem, &nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return 1; } + flag = ARKodeGetLastStep(arkode_mem, &olddt); + if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } + flag = ARKodeGetCurrentStep(arkode_mem, &newdt); + if (check_flag(&flag, "ARKodeGetCurrentStep", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumLinIters(arkode_mem, &nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return 1; } /* print current solution stats */ iout++; @@ -262,18 +262,18 @@ int main(void) y = y2; y2 = yt; - /* call ARKStepResize to notify integrator of change in mesh */ - flag = ARKStepResize(arkode_mem, y, hscale, t, NULL, NULL); - if (check_flag(&flag, "ARKStepResize", 1)) { return 1; } + /* call ARKodeResize to notify integrator of change in mesh */ + flag = ARKodeResize(arkode_mem, y, hscale, t, NULL, NULL); + if (check_flag(&flag, "ARKodeResize", 1)) { return 1; } - /* destroy and re-allocate linear solver memory; reattach to ARKStep interface */ + /* destroy and re-allocate linear solver memory; reattach to ARKODE interface */ SUNLinSolFree(LS); LS = SUNLinSol_PCG(y, 0, (int)N, ctx); if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } - flag = ARKStepSetLinearSolver(arkode_mem, LS, NULL); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacTimes(arkode_mem, NULL, Jac); - if (check_flag(&flag, "ARKStepSetJacTimes", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, NULL); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacTimes(arkode_mem, NULL, Jac); + if (check_flag(&flag, "ARKodeSetJacTimes", 1)) { return 1; } } printf(" --------------------------------------------------------------------" "--------------------\n"); @@ -290,9 +290,9 @@ int main(void) N_VDestroy(y); /* Free vectors */ free(udata->x); /* Free user data */ free(udata); - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNContext_Free(&ctx); /* Free context */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_kepler.c b/examples/arkode/C_serial/ark_kepler.c index f6fd9982d5..5492d040fd 100644 --- a/examples/arkode/C_serial/ark_kepler.c +++ b/examples/arkode/C_serial/ark_kepler.c @@ -161,8 +161,8 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) /* Optional: enable temporal root-finding */ if (count_orbits) { - SPRKStepRootInit(arkode_mem, 1, rootfn); - if (check_retval(&retval, "SPRKStepRootInit", 1)) { return 1; } + ARKodeRootInit(arkode_mem, 1, rootfn); + if (check_retval(&retval, "ARKodeRootInit", 1)) { return 1; } } retval = SPRKStepSetMethodName(arkode_mem, method_name); @@ -173,11 +173,11 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) if (step_mode == 0) { - retval = SPRKStepSetFixedStep(arkode_mem, dt); - if (check_retval(&retval, "SPRKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, dt); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } - retval = SPRKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); - if (check_retval(&retval, "SPRKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } } else { @@ -186,8 +186,8 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) return 1; } - retval = SPRKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "SPRKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } } else if (stepper == 1) { @@ -198,21 +198,21 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) if (count_orbits) { - ARKStepRootInit(arkode_mem, 1, rootfn); - if (check_retval(&retval, "ARKStepRootInit", 1)) { return 1; } + ARKodeRootInit(arkode_mem, 1, rootfn); + if (check_retval(&retval, "ARKodeRootInit", 1)) { return 1; } } - retval = ARKStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } - retval = ARKStepSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); - if (check_retval(&retval, "ARKStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, ((long int)ceil(Tf / dt)) + 1); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } - if (step_mode == 0) { retval = ARKStepSetFixedStep(arkode_mem, dt); } + if (step_mode == 0) { retval = ARKodeSetFixedStep(arkode_mem, dt); } else { - retval = ARKStepSStolerances(arkode_mem, dt, dt); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, dt, dt); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } } } @@ -264,15 +264,15 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) exact requested output time will not be hit (even with a fixed time-step due to roundoff error accumulation) and interpolation will be used to get the solution at the output time. */ - if (args->use_tstop) { SPRKStepSetStopTime(arkode_mem, tout); } - retval = SPRKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args->use_tstop) { ARKodeSetStopTime(arkode_mem, tout); } + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval == ARK_ROOT_RETURN) { num_orbits += SUN_RCONST(0.5); fprintf(stdout, "ROOT RETURN:\t"); - SPRKStepGetRootInfo(arkode_mem, &rootsfound); + ARKodeGetRootInfo(arkode_mem, &rootsfound); fprintf(stdout, " g[0] = %3d, y[0] = %3Lg, y[1] = %3Lg, num. orbits is now %.2Lf\n", rootsfound, (long double)ydata[0], (long double)ydata[1], (long double)num_orbits); @@ -311,15 +311,15 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) exact requested output time will not be hit (even with a fixed time-step due to roundoff error accumulation) and interpolation will be used to get the solution at the output time. */ - if (args->use_tstop) { ARKStepSetStopTime(arkode_mem, tout); } - retval = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (args->use_tstop) { ARKodeSetStopTime(arkode_mem, tout); } + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval == ARK_ROOT_RETURN) { num_orbits += SUN_RCONST(0.5); fprintf(stdout, "ROOT RETURN:\t"); - ARKStepGetRootInfo(arkode_mem, &rootsfound); + ARKodeGetRootInfo(arkode_mem, &rootsfound); fprintf(stdout, " g[0] = %3d, y[0] = %3Lg, y[1] = %3Lg, num. orbits is now %.2Lf\n", rootsfound, (long double)ydata[0], (long double)ydata[1], (long double)num_orbits); @@ -361,17 +361,8 @@ int SolveProblem(ProgramArgs* args, ProblemResult* result, SUNContext sunctx) fclose(solution_fp); if (NLS) { SUNNonlinSolFree(NLS); } N_VDestroy(y); - if (stepper == 0) - { - SPRKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - SPRKStepFree(&arkode_mem); - } - else - { - ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); - ARKStepFree(&arkode_mem); - } - + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + ARKodeFree(&arkode_mem); return 0; } diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index af9fad93a0..6ba73c89ae 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -378,12 +378,12 @@ int main(int argc, char* argv[]) if (check_retval((void*)Af, "SUNDenseMatrix", 0)) { return 1; } LSf = SUNLinSol_Dense(y, Af, ctx); if (check_retval((void*)LSf, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKStepSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } - retval = ARKStepSetJacFn(inner_arkode_mem, Jn); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } - retval = ARKStepSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } ARKodeButcherTable_Free(B); break; case (3): /* no fast dynamics ('evolve' explicitly w/ erk-3-3) */ @@ -409,12 +409,12 @@ int main(int argc, char* argv[]) } /* Set the user data pointer */ - retval = ARKStepSetUserData(inner_arkode_mem, (void*)rpar); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(inner_arkode_mem, (void*)rpar); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -485,12 +485,12 @@ int main(int argc, char* argv[]) if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } LSs = SUNLinSol_Dense(y, As, ctx); if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } - retval = MRIStepSetJacFn(arkode_mem, Jn); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; case (7): /* MRI-GARK-ESDIRK34a, solve-decoupled slow solver */ arkode_mem = MRIStepCreate(NULL, fs, T0, y, inner_stepper, ctx); @@ -503,12 +503,12 @@ int main(int argc, char* argv[]) if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } LSs = SUNLinSol_Dense(y, As, ctx); if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } - retval = MRIStepSetJacFn(arkode_mem, Js); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Js); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; case (8): /* IMEX-MRI-GARK3b, solve-decoupled slow solver */ arkode_mem = MRIStepCreate(fse, fsi, T0, y, inner_stepper, ctx); @@ -521,12 +521,12 @@ int main(int argc, char* argv[]) if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } LSs = SUNLinSol_Dense(y, As, ctx); if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } - retval = MRIStepSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; case (9): /* IMEX-MRI-GARK4, solve-decoupled slow solver */ arkode_mem = MRIStepCreate(fse, fsi, T0, y, inner_stepper, ctx); @@ -539,25 +539,25 @@ int main(int argc, char* argv[]) if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } LSs = SUNLinSol_Dense(y, As, ctx); if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = MRIStepSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } - retval = MRIStepSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } - retval = MRIStepSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "MRIStepSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; } /* Set the user data pointer */ - retval = MRIStepSetUserData(arkode_mem, (void*)rpar); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)rpar); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } - retval = MRIStepSetDeduceImplicitRhs(arkode_mem, deduce); - if (check_retval(&retval, "MRIStepSetDeduceImplicitRhs", 1)) { return 1; } + retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce); + if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* * Integrate ODE @@ -574,7 +574,7 @@ int main(int argc, char* argv[]) SUNRabs(NV_Ith_S(y, 0) - utrue(T0, rpar)), SUNRabs(NV_Ith_S(y, 1) - vtrue(T0, rpar))); - /* Main time-stepping loop: calls MRIStepEvolve to perform the + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; @@ -593,8 +593,8 @@ int main(int argc, char* argv[]) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* access/print solution and error */ uerr = SUNRabs(NV_Ith_S(y, 0) - utrue(t, rpar)); @@ -624,14 +624,14 @@ int main(int argc, char* argv[]) */ /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); @@ -656,10 +656,10 @@ int main(int argc, char* argv[]) if ((solve_type == 4) || (solve_type == 7) || (solve_type == 8) || (solve_type == 9)) { - retval = MRIStepGetNonlinSolvStats(arkode_mem, &nnis, &nncs); - check_retval(&retval, "MRIStepGetNonlinSolvStats", 1); - retval = MRIStepGetNumJacEvals(arkode_mem, &njes); - check_retval(&retval, "MRIStepGetNumJacEvals", 1); + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); + retval = ARKodeGetNumJacEvals(arkode_mem, &njes); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf(" Slow Newton iters = %li\n", nnis); printf(" Slow Newton conv fails = %li\n", nncs); printf(" Slow Jacobian evals = %li\n", njes); @@ -668,10 +668,10 @@ int main(int argc, char* argv[]) /* Get/print fast integrator implicit solver statistics */ if (solve_type == 2) { - retval = ARKStepGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); - check_retval(&retval, "ARKStepGetNonlinSolvStats", 1); - retval = ARKStepGetNumJacEvals(inner_arkode_mem, &njef); - check_retval(&retval, "ARKStepGetNumJacEvals", 1); + retval = ARKodeGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); + check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); + retval = ARKodeGetNumJacEvals(inner_arkode_mem, &njef); + check_retval(&retval, "ARKodeGetNumJacEvals", 1); printf(" Fast Newton iters = %li\n", nnif); printf(" Fast Newton conv fails = %li\n", nncf); printf(" Fast Jacobian evals = %li\n", njef); @@ -684,9 +684,9 @@ int main(int argc, char* argv[]) SUNLinSolFree(LSf); /* free fast linear solver */ SUNMatDestroy(As); /* free fast matrix */ SUNLinSolFree(LSs); /* free fast linear solver */ - ARKStepFree(&inner_arkode_mem); /* Free fast integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free fast integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free slow integrator memory */ + ARKodeFree(&arkode_mem); /* Free slow integrator memory */ SUNContext_Free(&ctx); /* Free context */ return 0; diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index a0842f2736..d6993383fe 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -144,8 +144,8 @@ int main(void) if (check_retval(&retval, "ARKStepSetTableNum", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -165,8 +165,8 @@ int main(void) if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* * Integrate ODE @@ -181,7 +181,7 @@ int main(void) " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2), error); - /* Main time-stepping loop: calls MRIStepEvolve to perform the + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; @@ -195,8 +195,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* compute the analytic solution */ retval = ans(t, ytrue, NULL); @@ -226,14 +226,14 @@ int main(void) */ /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); @@ -245,9 +245,9 @@ int main(void) /* Clean up and return */ N_VDestroy(y); /* Free y vector */ N_VDestroy(ytrue); /* Free ytrue vector */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ SUNContext_Free(&ctx); /* Free context */ return 0; diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index b11cc23b61..65a4ca73bf 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -145,16 +145,16 @@ int main(void) if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Attach user data to fast integrator */ - retval = ARKStepSetUserData(inner_arkode_mem, (void*)udata); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(inner_arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the fast method */ retval = ARKStepSetTableNum(inner_arkode_mem, -1, ARKODE_KNOTH_WOLKE_3_3); if (check_retval(&retval, "ARKStepSetTableNum", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -174,16 +174,16 @@ int main(void) if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } /* Pass udata to user functions */ - retval = MRIStepSetUserData(arkode_mem, (void*)udata); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } + retval = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Increase max num steps */ - retval = MRIStepSetMaxNumSteps(arkode_mem, 10000); - if (check_retval(&retval, "MRIStepSetMaxNumSteps", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 10000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* * Integrate ODE @@ -202,7 +202,7 @@ int main(void) for (i = 0; i < N; i++) { fprintf(UFID, " %.16" ESYM "", data[i]); } fprintf(UFID, "\n"); - /* Main time-stepping loop: calls MRIStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; dTout = (Tf - T0) / Nt; @@ -213,8 +213,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* print solution stats and output results to disk */ printf(" %10.6" FSYM " %10.6f\n", t, sqrt(N_VDotProd(y, y) / N)); @@ -230,23 +230,23 @@ int main(void) /* Print final statistics to the screen */ printf("\nFinal Slow Statistics:\n"); - retval = MRIStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + retval = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); printf("\nFinal Fast Statistics:\n"); - retval = ARKStepPrintAllStats(inner_arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + retval = ARKodePrintAllStats(inner_arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); /* Print final statistics to a file in CSV format */ FID = fopen("ark_reaction_diffusion_mri_slow_stats.csv", "w"); - retval = MRIStepPrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + retval = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); FID = fopen("ark_reaction_diffusion_mri_fast_stats.csv", "w"); - retval = ARKStepPrintAllStats(inner_arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + retval = ARKodePrintAllStats(inner_arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); /* Clean up and return */ N_VDestroy(y); /* Free y vector */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ free(udata); /* Free user data */ SUNContext_Free(&ctx); /* Free context */ diff --git a/examples/arkode/C_serial/ark_robertson.c b/examples/arkode/C_serial/ark_robertson.c index b4e47e214d..833861243d 100644 --- a/examples/arkode/C_serial/ark_robertson.c +++ b/examples/arkode/C_serial/ark_robertson.c @@ -117,23 +117,23 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetInitStep(arkode_mem, h0); /* Set custom initial step */ - if (check_flag(&flag, "ARKStepSetInitStep", 1)) { return 1; } - flag = ARKStepSetMaxErrTestFails(arkode_mem, - 20); /* Increase max error test fails */ - if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) { return 1; } - flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ - if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) { return 1; } - flag = ARKStepSetNonlinConvCoef(arkode_mem, - SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ - if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetInitStep(arkode_mem, h0); /* Set custom initial step */ + if (check_flag(&flag, "ARKodeSetInitStep", 1)) { return 1; } + flag = ARKodeSetMaxErrTestFails(arkode_mem, + 20); /* Increase max error test fails */ + if (check_flag(&flag, "ARKodeSetMaxErrTestFails", 1)) { return 1; } + flag = ARKodeSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ + if (check_flag(&flag, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, + SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); @@ -142,11 +142,11 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -156,7 +156,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -166,8 +166,8 @@ int main(void) NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.3" ESYM " %12.5" ESYM " %12.5" ESYM " %12.5" ESYM "\n", /* access/print solution */ t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -189,22 +189,22 @@ int main(void) /* Print final statistics to the screen */ printf("\nFinal Statistics:\n"); - flag = ARKStepPrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); /* Print final statistics to a file in CSV format */ FID = fopen("ark_robertson_stats.csv", "w"); - flag = ARKStepPrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); fclose(FID); /* check the solution error */ flag = check_ans(y, t, reltol, abstol); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return flag; } diff --git a/examples/arkode/C_serial/ark_robertson_constraints.c b/examples/arkode/C_serial/ark_robertson_constraints.c index 43b4718ebc..8c247dbf28 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.c +++ b/examples/arkode/C_serial/ark_robertson_constraints.c @@ -127,25 +127,25 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetInitStep(arkode_mem, h0); /* Set custom initial step */ - if (check_flag(&flag, "ARKStepSetInitStep", 1)) { return 1; } - flag = ARKStepSetMaxErrTestFails(arkode_mem, - 20); /* Increase max error test fails */ - if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) { return 1; } - flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ - if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) { return 1; } - flag = ARKStepSetNonlinConvCoef(arkode_mem, - SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ - if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetConstraints(arkode_mem, constraints); /* Set constraints */ - if (check_flag(&flag, "ARKStepSetConstraints", 1)) { return 1; } + flag = ARKodeSetInitStep(arkode_mem, h0); /* Set custom initial step */ + if (check_flag(&flag, "ARKodeSetInitStep", 1)) { return 1; } + flag = ARKodeSetMaxErrTestFails(arkode_mem, + 20); /* Increase max error test fails */ + if (check_flag(&flag, "ARKodeSetMaxErrTestFails", 1)) { return 1; } + flag = ARKodeSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ + if (check_flag(&flag, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, + SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetConstraints(arkode_mem, constraints); /* Set constraints */ + if (check_flag(&flag, "ARKodeSetConstraints", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); @@ -154,11 +154,11 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -168,7 +168,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; tout = T0 + dTout; @@ -178,8 +178,8 @@ int main(void) NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); for (iout = 0; iout < Nt; iout++) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %10.3" ESYM " %12.5" ESYM " %12.5" ESYM " %12.5" ESYM "\n", /* access/print solution */ t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -200,28 +200,28 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumStepSolveFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumStepSolveFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &nnf); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); - flag = ARKStepGetNumConstrFails(arkode_mem, &nctf); - check_flag(&flag, "ARKStepGetNumConstrFails", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumStepSolveFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumStepSolveFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &nnf); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); + flag = ARKodeGetNumConstrFails(arkode_mem, &nctf); + check_flag(&flag, "ARKodeGetNumConstrFails", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -239,12 +239,12 @@ int main(void) flag = check_ans(y, t, reltol, abstol); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - N_VDestroy(constraints); /* Free constraints vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + N_VDestroy(constraints); /* Free constraints vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return flag; } diff --git a/examples/arkode/C_serial/ark_robertson_root.c b/examples/arkode/C_serial/ark_robertson_root.c index be0782279c..a4aa8fb066 100644 --- a/examples/arkode/C_serial/ark_robertson_root.c +++ b/examples/arkode/C_serial/ark_robertson_root.c @@ -129,25 +129,25 @@ int main(void) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Set routines */ - flag = ARKStepSetMaxErrTestFails(arkode_mem, - 20); /* Increase max error test fails */ - if (check_flag(&flag, "ARKStepSetMaxErrTestFails", 1)) { return 1; } - flag = ARKStepSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ - if (check_flag(&flag, "ARKStepSetMaxNonlinIters", 1)) { return 1; } - flag = ARKStepSetNonlinConvCoef(arkode_mem, - SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ - if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - flag = ARKStepSetPredictorMethod(arkode_mem, - 1); /* Specify maximum-order predictor */ - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } - flag = ARKStepSVtolerances(arkode_mem, reltol, atols); /* Specify tolerances */ - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSetMaxErrTestFails(arkode_mem, + 20); /* Increase max error test fails */ + if (check_flag(&flag, "ARKodeSetMaxErrTestFails", 1)) { return 1; } + flag = ARKodeSetMaxNonlinIters(arkode_mem, 8); /* Increase max nonlin iters */ + if (check_flag(&flag, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + flag = ARKodeSetNonlinConvCoef(arkode_mem, + SUN_RCONST(1.e-7)); /* Set nonlinear convergence coeff. */ + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); /* Increase max num steps */ + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkode_mem, + 1); /* Specify maximum-order predictor */ + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSVtolerances(arkode_mem, reltol, atols); /* Specify tolerances */ + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Specify the root-finding function, having 2 equations */ - flag = ARKStepRootInit(arkode_mem, 2, g); - if (check_flag(&flag, "ARKStepRootInit", 1)) { return 1; } + flag = ARKodeRootInit(arkode_mem, 2, g); + if (check_flag(&flag, "ARKodeRootInit", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); @@ -156,11 +156,11 @@ int main(void) if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Linear solver interface */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, - A); /* Attach matrix and linear solver */ - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, + A); /* Attach matrix and linear solver */ + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); @@ -170,7 +170,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls ARKStepEvolve to perform the integration, then + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; printf(" t u v w\n"); @@ -181,8 +181,8 @@ int main(void) iout = 0; while (1) { - flag = ARKStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ - if (check_flag(&flag, "ARKStepEvolve", 1)) { break; } + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } printf(" %12.5" ESYM " %12.5" ESYM " %12.5" ESYM " %12.5" ESYM "\n", /* access/print solution */ t, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); @@ -190,8 +190,8 @@ int main(void) NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); if (flag == ARK_ROOT_RETURN) { /* check if a root was found */ - rtflag = ARKStepGetRootInfo(arkode_mem, rootsfound); - if (check_flag(&rtflag, "ARKStepGetRootInfo", 1)) { return 1; } + rtflag = ARKodeGetRootInfo(arkode_mem, rootsfound); + if (check_flag(&rtflag, "ARKodeGetRootInfo", 1)) { return 1; } printf(" rootsfound[] = %3d %3d\n", rootsfound[0], rootsfound[1]); } if (flag >= 0) @@ -210,28 +210,28 @@ int main(void) fclose(UFID); /* Print some final statistics */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); check_flag(&flag, "ARKStepGetNumRhsEvals", 1); - flag = ARKStepGetNumLinSolvSetups(arkode_mem, &nsetups); - check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1); - flag = ARKStepGetNumErrTestFails(arkode_mem, &netf); - check_flag(&flag, "ARKStepGetNumErrTestFails", 1); - flag = ARKStepGetNumStepSolveFails(arkode_mem, &ncfn); - check_flag(&flag, "ARKStepGetNumStepSolveFails", 1); - flag = ARKStepGetNumNonlinSolvIters(arkode_mem, &nni); - check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1); - flag = ARKStepGetNumNonlinSolvConvFails(arkode_mem, &nnf); - check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1); - flag = ARKStepGetNumJacEvals(arkode_mem, &nje); - check_flag(&flag, "ARKStepGetNumJacEvals", 1); - flag = ARKStepGetNumLinRhsEvals(arkode_mem, &nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); - flag = ARKStepGetNumGEvals(arkode_mem, &nge); - check_flag(&flag, "ARKStepGetNumGEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); + check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); + flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); + check_flag(&flag, "ARKodeGetNumErrTestFails", 1); + flag = ARKodeGetNumStepSolveFails(arkode_mem, &ncfn); + check_flag(&flag, "ARKodeGetNumStepSolveFails", 1); + flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); + check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); + flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &nnf); + check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1); + flag = ARKodeGetNumJacEvals(arkode_mem, &nje); + check_flag(&flag, "ARKodeGetNumJacEvals", 1); + flag = ARKodeGetNumLinRhsEvals(arkode_mem, &nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); + flag = ARKodeGetNumGEvals(arkode_mem, &nge); + check_flag(&flag, "ARKodeGetNumGEvals", 1); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); @@ -246,12 +246,12 @@ int main(void) printf(" Total number of failed steps from solver failure = %li\n", ncfn); /* Clean up and return with successful completion */ - N_VDestroy(y); /* Free y vector */ - N_VDestroy(atols); /* Free atols vector */ - ARKStepFree(&arkode_mem); /* Free integrator memory */ - SUNLinSolFree(LS); /* Free linear solver */ - SUNMatDestroy(A); /* Free A matrix */ - SUNContext_Free(&ctx); /* Free context */ + N_VDestroy(y); /* Free y vector */ + N_VDestroy(atols); /* Free atols vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNLinSolFree(LS); /* Free linear solver */ + SUNMatDestroy(A); /* Free A matrix */ + SUNContext_Free(&ctx); /* Free context */ return 0; } diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index ec05170aec..d44204d38f 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -123,8 +123,8 @@ int main(void) if (check_retval(&retval, "ARKStepSetTableNum", 1)) { return 1; } /* Set the fast step size */ - retval = ARKStepSetFixedStep(inner_arkode_mem, hf); - if (check_retval(&retval, "ARKStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(inner_arkode_mem, hf); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); @@ -144,8 +144,8 @@ int main(void) if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } /* Set the slow step size */ - retval = MRIStepSetFixedStep(arkode_mem, hs); - if (check_retval(&retval, "MRIStepSetFixedStep", 1)) { return 1; } + retval = ARKodeSetFixedStep(arkode_mem, hs); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* * Integrate ODE @@ -159,7 +159,7 @@ int main(void) fprintf(UFID, " %.16" ESYM " %.16" ESYM " %.16" ESYM " %.16" ESYM "\n", T0, NV_Ith_S(y, 0), NV_Ith_S(y, 1), NV_Ith_S(y, 2)); - /* Main time-stepping loop: calls MRIStepEvolve to perform the + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then prints results. Stops when the final time has been reached */ t = T0; @@ -172,8 +172,8 @@ int main(void) for (iout = 0; iout < Nt; iout++) { /* call integrator */ - retval = MRIStepEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { break; } + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { break; } /* access/print solution and error */ printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM "\n", t, @@ -193,14 +193,14 @@ int main(void) */ /* Get some slow integrator statistics */ - retval = MRIStepGetNumSteps(arkode_mem, &nsts); - check_retval(&retval, "MRIStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); check_retval(&retval, "MRIStepGetNumRhsEvals", 1); /* Get some fast integrator statistics */ - retval = ARKStepGetNumSteps(inner_arkode_mem, &nstf); - check_retval(&retval, "ARKStepGetNumSteps", 1); + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); check_retval(&retval, "ARKStepGetNumRhsEvals", 1); @@ -211,9 +211,9 @@ int main(void) /* Clean up and return */ N_VDestroy(y); /* Free y vector */ - ARKStepFree(&inner_arkode_mem); /* Free integrator memory */ + ARKodeFree(&inner_arkode_mem); /* Free integrator memory */ MRIStepInnerStepper_Free(&inner_stepper); /* Free inner stepper */ - MRIStepFree(&arkode_mem); /* Free integrator memory */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ SUNContext_Free(&ctx); /* Free context */ return 0; diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index fc1e3c3c5d..4a0a8a5911 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 @@ -167,7 +167,7 @@ program main stop 1 end if - ! main time-stepping loop: calls FARKStepEvolve to perform the integration, then + ! main time-stepping loop: calls FARKodeEvolve to perform the integration, then ! prints results. Stops when the final time has been reached tcur(1) = T0 dTout = (Tf-T0)/Nt @@ -181,9 +181,9 @@ program main do iout = 1,Nt ! call integrator - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) if (ierr /= 0) then - write(*,*) 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' stop 1 endif @@ -208,7 +208,7 @@ program main print *, ' ' ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_y) ierr = FSUNContext_Free(sunctx) @@ -241,10 +241,10 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) print *, ' ' print *, 'Final Solver Statistics:' diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 index 86a7d97447..579d70479c 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -328,13 +328,13 @@ program main end if ! set routines - ierr = FARKStepSStolerances(arkode_mem, reltol, abstol) + ierr = FARKodeSStolerances(arkode_mem, reltol, abstol) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSStolerances' + write(*,*) 'Error in FARKodeSStolerances' stop 1 end if - ! initialize custom matrix data structure and solver; attach to ARKStep + ! initialize custom matrix data structure and solver; attach to ARKODE sunmat_A => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sunmat_A)) then print *,'ERROR: sunmat = NULL' @@ -348,19 +348,19 @@ program main end if ! Attach matrix, linear solver, and Jacobian routine to linear solver interface - ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetLinearSolver' + write(*,*) 'Error in FARKodeSetLinearSolver' stop 1 end if - ierr = FARKStepSetJacFn(arkode_mem, c_funloc(JacFn)) + ierr = FARKodeSetJacFn(arkode_mem, c_funloc(JacFn)) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetJacFn' + write(*,*) 'Error in FARKodeSetJacFn' stop 1 end if - ! main time-stepping loop: calls FARKStepEvolve to perform the integration, then + ! main time-stepping loop: calls FARKodeEvolve to perform the integration, then ! prints results. Stops when the final time has been reached tcur(1) = T0 dTout = (Tf-T0)/Nt @@ -370,9 +370,9 @@ program main do iout = 1,Nt ! call integrator - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) if (ierr /= 0) then - write(*,*) 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' stop 1 endif @@ -390,7 +390,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -432,16 +432,16 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - ierr = FARKStepGetNumLinRhsEvals(arkode_mem, nfeLS) - ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) - ierr = FARKStepGetNumJacEvals(arkode_mem, nje) - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) - ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) - ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) - ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKodeGetNumLinRhsEvals(arkode_mem, nfeLS) + ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKodeGetNumJacEvals(arkode_mem, nje) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) print *, ' ' print *, 'Final Solver Statistics:' 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 5e83ff44c7..cc1e51b503 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 @@ -545,9 +545,9 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) !======= Inclusions =========== use, intrinsic :: iso_c_binding + use farkode_mod use farkode_arkstep_mod - use ode_mod, only : Neq, Reaction !======= Declarations ========= @@ -585,10 +585,10 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) !======= Internals ============ ! get nonlinear residual data - ierr = FARKStepGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & + ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKStepGetNonlinearSystemData returned ",ierr + print *, "Error: FARKodeGetNonlinearSystemData returned ",ierr return end if @@ -639,12 +639,10 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & !======= Inclusions =========== use, intrinsic :: iso_c_binding + use farkode_mod use farkode_arkstep_mod - - use fsunmatrix_dense_mod - use ode_mod, only : Nvar, Npts, k2, k3, k4, k6 !======= Declarations ========= @@ -674,10 +672,10 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & !======= Internals ============ ! get nonlinear residual data - ierr = FARKStepGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & + ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKStepGetNonlinearSystemData returned ",ierr + print *, "Error: FARKodeGetNonlinearSystemData returned ",ierr return end if @@ -1239,23 +1237,23 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Select the method order - retval = FARKStepSetOrder(arkode_mem, order) + retval = FARKodeSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FARKStepSetOrder returned ",retval + print *, "Error: FARKodeSetOrder returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKStepSStolerances(arkode_mem, rtol, atol) + retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKStepSStolerances returned ",retval + print *, "Error: FARKodeSStolerances returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Increase the max number of steps allowed between outputs - retval = FARKStepSetMaxNumSteps(arkode_mem, int(100000, c_long)) + retval = FARKodeSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FARKStepMaxNumSteps returned ",retval + print *, "Error: FARKodeMaxNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1270,9 +1268,9 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Attach nonlinear solver - retval = FARKStepSetNonlinearSolver(arkode_mem, sun_NLS) + retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) if (retval /= 0) then - print *, "Error: FARKStepSetNonlinearSolver returned ",retval + print *, "Error: FARKodeSetNonlinearSolver returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1285,17 +1283,17 @@ subroutine EvolveProblemIMEX(sunvec_y) ! Attach linear solver sunmat_A => null() - retval = FARKStepSetLinearSolver(arkode_mem, sun_LS, sunmat_A) + retval = FARKodeSetLinearSolver(arkode_mem, sun_LS, sunmat_A) if (retval /= 0) then - print *, "Error: FARKStepSetLinearSolver returned ",retval + print *, "Error: FARKodeSetLinearSolver returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Attach preconditioner - retval = FARKStepSetPreconditioner(arkode_mem, c_funloc(PSetup), & + retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & c_funloc(PSolve)) if (retval /= 0) then - print *, "Error: FARKStepSetPreconditioner returned ",retval + print *, "Error: FARKodeSetPreconditioner returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1314,9 +1312,9 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Attach nonlinear solver - retval = FARKStepSetNonlinearSolver(arkode_mem, sun_NLS) + retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) if (retval /= 0) then - print *, "Error: FARKStepSetNonlinearSolver returned ",retval + print *, "Error: FARKodeSetNonlinearSolver returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1343,9 +1341,9 @@ subroutine EvolveProblemIMEX(sunvec_y) do while (iout < max(nout,1)) ! Integrate to output time - retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) if (retval /= 0) then - print *, "Error: FARKStepEvolve returned ",retval + print *, "Error: FARKodeEvolve returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1369,15 +1367,15 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Get final statistics - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1387,41 +1385,41 @@ subroutine EvolveProblemIMEX(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumErrTestFails(arkode_mem, netf) + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKStepGetNumErrTestFails returned ",retval + print *, "Error: FARKodeGetNumErrTestFails returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKStepGetNumNonlinSolvIters returned ",retval + print *, "Error: FARKodeGetNumNonlinSolvIters returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncfn) + retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKStepGetNumNonlinSolvConvFails returned ",retval + print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ",retval call MPI_Abort(comm, 1, ierr) end if if (global) then - retval = FARKStepGetNumLinIters(arkode_mem, nli) + retval = FARKodeGetNumLinIters(arkode_mem, nli) if (retval /= 0) then - print *, "Error: FARKStepGetNumLinIters returned ",retval + print *, "Error: FARKodeGetNumLinIters returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + retval = FARKodeGetNumPrecEvals(arkode_mem, npre) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecEvals returned ",retval + print *, "Error: FARKodeGetNumPrecEvals returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecSolves returned ",retval + print *, "Error: FARKodeGetNumPrecSolves returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1455,7 +1453,7 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) ! Free nonlinear solver retval = FSUNNonlinSolFree(sun_NLS) @@ -1527,23 +1525,23 @@ subroutine EvolveProblemExplicit(sunvec_y) end if ! Select the method order - retval = FERKStepSetOrder(arkode_mem, order) + retval = FARKodeSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FERKStepSetOrder returned ",retval + print *, "Error: FARKodeSetOrder returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FERKStepSStolerances(arkode_mem, rtol, atol) + retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FERKStepSStolerances returned ",retval + print *, "Error: FARKodeSStolerances returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Increase the max number of steps allowed between outputs - retval = FERKStepSetMaxNumSteps(arkode_mem, int(100000, c_long)) + retval = FARKodeSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FERKStepMaxNumSteps returned ",retval + print *, "Error: FARKodeMaxNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1568,9 +1566,9 @@ subroutine EvolveProblemExplicit(sunvec_y) do while (iout < nout) ! Integrate to output time - retval = FERKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) if (retval /= 0) then - print *, "Error: FERKStepEvolve returned ",retval + print *, "Error: FARKodeEvolve returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1594,15 +1592,15 @@ subroutine EvolveProblemExplicit(sunvec_y) end if ! Get final statistics - retval = FERKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FERKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FERKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1612,9 +1610,9 @@ subroutine EvolveProblemExplicit(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumErrTestFails(arkode_mem, netf) + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FERKStepGetNumErrTestFails returned ",retval + print *, "Error: FARKodeGetNumErrTestFails returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -1628,7 +1626,7 @@ subroutine EvolveProblemExplicit(sunvec_y) end if ! Clean up - call FERKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) end subroutine EvolveProblemExplicit @@ -1640,8 +1638,6 @@ subroutine WriteOutput(t, sunvec_y) use, intrinsic :: iso_c_binding use fsundials_core_mod use farkode_mod ! Access ARKode - use farkode_erkstep_mod ! Access ERKStep - use ode_mod, only : Nvar, nprocs, myid, Erecv, Nx, Npts, monitor, nout, & umask, vmask, wmask diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 index 7e849b7830..7cf6efd0f9 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -268,9 +268,9 @@ program driver ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() - retval = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + retval = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (retval /= 0) then - print *, 'Error in FARKStepSetLinearSolver, retval = ', retval + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval call MPI_Abort(comm, 1, ierr) end if @@ -281,9 +281,9 @@ program driver end if ! Specify tolerances - retval = FARKStepSStolerances(arkode_mem, rtol, atol) + retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKStepSStolerances returned ",retval + print *, "Error: FARKodeSStolerances returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -330,7 +330,7 @@ program driver if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" - ! Main time-stepping loop: calls FARKStepEvolve to perform the integration, + ! Main time-stepping loop: calls FARKodeEvolve to perform the integration, ! then prints results. Stops when the final time has been reached t(1) = T0 dTout = 0.1d0 @@ -342,22 +342,22 @@ program driver do ioutput=1,Nt ! Integrate to output time - retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) if (retval /= 0) then - print *, "Error: FARKStepEvolve returned ",retval + print *, "Error: FARKodeEvolve returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Retrieve solver statistics - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -395,15 +395,15 @@ program driver if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax ! Get final statistics - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKStepGetNumStepAttempts returned ", retval + print *, "Error: FARKodeGetNumStepAttempts returned ", retval call MPI_Abort(comm, 1, ierr) end if @@ -413,59 +413,59 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + retval = FARKodeGetNumPrecEvals(arkode_mem, npre) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecEvals returned ", retval + print *, "Error: FARKodeGetNumPrecEvals returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecSolves returned ", retval + print *, "Error: FARKodeGetNumPrecSolves returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKStepGetNumNonlinSolvIters returned ", retval + print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumLinIters(arkode_mem, nli) + retval = FARKodeGetNumLinIters(arkode_mem, nli) if (retval /= 0) then - print *, "Error: FARKStepGetNumLinIters returned ", retval + print *, "Error: FARKodeGetNumLinIters returned ", retval call MPI_Abort(comm, 1, ierr) end if avdim = dble(nli) / dble(nni) - retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncfn) + retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKStepGetNumNonlinSolvConvFails returned ", retval + print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumLinConvFails(arkode_mem, ncfl) + retval = FARKodeGetNumLinConvFails(arkode_mem, ncfl) if (retval /= 0) then - print *, "Error: FARKStepGetNumLinSolvConvFails returned ", retval + print *, "Error: FARKodeGetNumLinSolvConvFails returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumErrTestFails(arkode_mem, netf) + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKStepGetNumErrTestFails returned ",retval + print *, "Error: FARKodeGetNumErrTestFails returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) + retval = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) if (retval /= 0) then - print *, "Error: FARKStepGetWorkSpace returned ", retval + print *, "Error: FARKodeGetWorkSpace returned ", retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + retval = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) if (retval /= 0) then - print *, "Error: FARKStepGetLinWorkSpace returned ", retval + print *, "Error: FARKodeGetLinWorkSpace returned ", retval call MPI_Abort(comm, 1, ierr) end if @@ -508,7 +508,7 @@ program driver end do ! Clean up and return with successful completion - call FARKStepFree(arkode_mem) ! free integrator memory + call FARKodeFree(arkode_mem) ! free integrator memory call FN_VDestroy(sunvec_y) ! free vector memory call MPI_Barrier(comm, ierr) call MPI_Finalize(ierr) ! Finalize MPI diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out index 537ef428b9..0e09570888 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.out @@ -1,4 +1,4 @@ - + Diagonal test problem: neq = 40 nlocal = 10 @@ -9,7 +9,7 @@ ydot_i = -alpha*i * y_i (i = 1,...,neq) Method is DIRK/NEWTON/SPGMR Precond is band-block-diagonal, using ARKBBDPRE - + Preconditioning on left: t steps steps att. fe fi ------------------------------------------------- @@ -25,7 +25,7 @@ 1.000000 319 319 0 3410 ------------------------------------------------- Max. absolute error is 7.52E-11 - + Final Solver Statistics: Internal solver steps = 319 (attempted = 319) Total explicit RHS evals = 0 @@ -38,13 +38,13 @@ Max. absolute error is 7.52E-11 Total Convergence Failures - Nonlinear = 0 - Linear = 0 Total number of error test failures = 0 - Main solver real/int workspace sizes = 862 267 + Main solver real/int workspace sizes = 862 279 Linear solver real/int workspace sizes = 535 126 BBD preconditioner real/int workspace sizes = 160 72 Total number of g evals = 12 - - - + + + Preconditioning on right: t steps steps att. fe fi ------------------------------------------------- @@ -60,7 +60,7 @@ Max. absolute error is 7.52E-11 1.000000 319 319 0 3410 ------------------------------------------------- Max. absolute error is 7.52E-11 - + Final Solver Statistics: Internal solver steps = 319 (attempted = 319) Total explicit RHS evals = 0 @@ -73,10 +73,7 @@ Max. absolute error is 7.52E-11 Total Convergence Failures - Nonlinear = 0 - Linear = 0 Total number of error test failures = 0 - Main solver real/int workspace sizes = 862 272 + Main solver real/int workspace sizes = 862 284 Linear solver real/int workspace sizes = 535 126 BBD preconditioner real/int workspace sizes = 160 72 Total number of g evals = 12 - - - diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 index 0ddb06d0d1..edfcf0d3b5 100644 --- a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -202,13 +202,13 @@ program driver end if ! Specify tolerances - retval = FERKStepSStolerances(arkode_mem, rtol, atol) + retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FERKStepSStolerances returned ",retval + print *, "Error: FARKodeSStolerances returned ",retval call MPI_Abort(comm, 1, ierr) end if - ! Main time-stepping loop: calls FERKStepEvolve to perform the + ! Main time-stepping loop: calls FARKodeEvolve to perform the ! integration, then prints results. Stops when the final time ! has been reached. t(1) = T0 @@ -221,21 +221,21 @@ program driver do ioutput=1,Nt ! Integrate to output time - retval = FERKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) if (retval /= 0) then - print *, "Error: FERKStepEvolve returned ",retval + print *, "Error: FARKodeEvolve returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FERKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FERKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -273,15 +273,15 @@ program driver if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax ! Get final statistics - retval = FERKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FERKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FERKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -291,9 +291,9 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumErrTestFails(arkode_mem, netf) + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FERKStepGetNumErrTestFails returned ",retval + print *, "Error: FARKodeGetNumErrTestFails returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -308,7 +308,7 @@ program driver endif ! Clean up and return with successful completion - call FERKStepFree(arkode_mem) ! free integrator memory + call FARKodeFree(arkode_mem) ! free integrator memory call FN_VDestroy(sunvec_y) ! free vector memory call MPI_Barrier(comm, ierr) call MPI_Finalize(ierr) ! Finalize MPI diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index 50c54e0211..a58e0ad2d8 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -766,45 +766,45 @@ program driver ! Attach linear solver sunmat_A => null() - retval = FARKStepSetLinearSolver(arkode_mem, sun_LS, sunmat_A) + retval = FARKodeSetLinearSolver(arkode_mem, sun_LS, sunmat_A) if (retval /= 0) then - print *, "Error: FARKStepSetLinearSolver returned ",retval + print *, "Error: FARKodeSetLinearSolver returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Attach preconditioner - retval = FARKStepSetPreconditioner(arkode_mem, c_funloc(PSetup), & + retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & c_funloc(PSolve)) if (retval /= 0) then - print *, "Error: FARKStepSetPreconditioner returned ",retval + print *, "Error: FARKodeSetPreconditioner returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances - retval = FARKStepSStolerances(arkode_mem, rtol, atol) + retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKStepSStolerances returned ",retval + print *, "Error: FARKodeSStolerances returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver convergence coefficient - retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + print *, "Error: FARKodeSetNonlinConvCoef returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver predictor method - retval = FARKStepSetPredictorMethod(arkode_mem, int(1, c_int)) + retval = FARKodeSetPredictorMethod(arkode_mem, int(1, c_int)) if (retval /= 0) then - print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + print *, "Error: FARKodeSetNonlinConvCoef returned ",retval call MPI_Abort(comm, 1, ierr) end if ! Specify that problem is linearly implicit - retval = FARKStepSetLinear(arkode_mem, int(0, c_int)) + retval = FARKodeSetLinear(arkode_mem, int(0, c_int)) if (retval /= 0) then - print *, "Error: FARKStepSetNonlinConvCoef returned ",retval + print *, "Error: FARKodeSetNonlinConvCoef returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -852,9 +852,9 @@ program driver do ioutput=1,Nt ! Integrate to output time - retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) if (retval /= 0) then - print *, "Error: FARKStepEvolve returned ",retval + print *, "Error: FARKodeEvolve returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -878,15 +878,15 @@ program driver close(101) ! Get final statistics - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKStepGetNumSteps returned ",retval + print *, "Error: FARKodeGetNumSteps returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKStepGetNumStepAttempts returned ",retval + print *, "Error: FARKodeGetNumStepAttempts returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -896,39 +896,39 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumErrTestFails(arkode_mem, netf) + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKStepGetNumErrTestFails returned ",retval + print *, "Error: FARKodeGetNumErrTestFails returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nni) + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKStepGetNumNonlinSolvIters returned ",retval + print *, "Error: FARKodeGetNumNonlinSolvIters returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumLinConvFails(arkode_mem, ncfn) + retval = FARKodeGetNumLinConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKStepGetNumLinConvFails returned ",retval + print *, "Error: FARKodeGetNumLinConvFails returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumLinIters(arkode_mem, nli) + retval = FARKodeGetNumLinIters(arkode_mem, nli) if (retval /= 0) then - print *, "Error: FARKStepGetNumLinIters returned ",retval + print *, "Error: FARKodeGetNumLinIters returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecEvals(arkode_mem, npre) + retval = FARKodeGetNumPrecEvals(arkode_mem, npre) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecEvals returned ",retval + print *, "Error: FARKodeGetNumPrecEvals returned ",retval call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumPrecSolves(arkode_mem, npsol) + retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) if (retval /= 0) then - print *, "Error: FARKStepGetNumPrecSolves returned ",retval + print *, "Error: FARKodeGetNumPrecSolves returned ",retval call MPI_Abort(comm, 1, ierr) end if @@ -949,7 +949,7 @@ program driver endif ! Clean up and return with successful completion - call FARKStepFree(arkode_mem) ! free integrator memory + call FARKodeFree(arkode_mem) ! free integrator memory call FN_VDestroy(sunvec_y) ! free vector memory call FN_VDestroy(sunvec_ones) retval = FSUNLinSolFree(sun_LS) ! free linear solver diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 877d76062b..d7378eabd0 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -169,9 +169,9 @@ program main stop 1 end if - ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetLinearSolver' + write(*,*) 'Error in FARKodeSetLinearSolver' stop 1 end if @@ -179,9 +179,9 @@ program main rtol = 1.0d-6 atol = 1.0d-10 - ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' stop 1 end if @@ -190,15 +190,15 @@ program main print *, 'ERROR: sunCtrl = NULL' stop 1 end if - ierr = FARKStepSetAdaptController(arkode_mem, sunCtrl) + ierr = FARKodeSetAdaptController(arkode_mem, sunCtrl) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetAdaptController, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKodeSetAdaptController, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepSetNonlinConvCoef(arkode_mem, 0.01d0) + ierr = FARKodeSetNonlinConvCoef(arkode_mem, 0.01d0) if (ierr /= 0) then - write(*,*) 'Error in FARKStepSetNonlinConvCoef, ierr = ', ierr, '; halting' + write(*,*) 'Error in FARKodeSetNonlinConvCoef, ierr = ', ierr, '; halting' stop 1 end if @@ -211,9 +211,9 @@ program main print '(2x,2(es12.5,1x))', tcur, yvec(1) do outstep = 1,nout - ! call ARKStep + ! call ARKodeEvolve tout = min(tout + dtout, tend) - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) if (ierr /= 0) then write(*,*) 'Error in FARKODE, ierr = ', ierr, '; halting' stop 1 @@ -228,7 +228,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -277,15 +277,15 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' stop 1 end if @@ -296,57 +296,57 @@ subroutine ARKStepStats(arkode_mem) end if nfevals=nfe+nfi - ierr = FARKStepGetActualInitStep(arkode_mem, hinused) + ierr = FARKodeGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKStepGetActualInitStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetLastStep(arkode_mem, hlast) + ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentStep(arkode_mem, hcur) + ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentTime(arkode_mem, tcur) + ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 index 6389a9e7de..f272a56644 100644 --- a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -1166,15 +1166,15 @@ program main stop 1 end if - ierr = FARKStepSetLinearSolver(arkode_mem, sunls_A, sunmat_A) + ierr = FARKodeSetLinearSolver(arkode_mem, sunls_A, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKStepSetLinearSolver' + print *, 'Error in FARKodeSetLinearSolver' stop 1 end if - ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) + ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKStepSetJacFn' + print *, 'Error in FARKodeSetJacFn' stop 1 end if @@ -1185,15 +1185,15 @@ program main end if time_dep = 0 - ierr = FARKStepSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) + ierr = FARKodeSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) if (ierr /= 0) then - print *, 'Error in FARKStepSetMassLinearSolver' + print *, 'Error in FARKodeSetMassLinearSolver' stop 1 end if - ierr = FARKStepSetMassFn(arkode_mem, c_funloc(Mass)) + ierr = FARKodeSetMassFn(arkode_mem, c_funloc(Mass)) if (ierr /= 0) then - print *, 'Error in FARKStepSetMassFn' + print *, 'Error in FARKodeSetMassFn' stop 1 end if @@ -1201,24 +1201,24 @@ program main rtol = 1.0d-6 atol = 1.0d-11 - ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' stop 1 end if ! set residual tolerance with the same atol as above - ierr = FARKStepResStolerance(arkode_mem, atol) + ierr = FARKodeResStolerance(arkode_mem, atol) if (ierr /= 0) then - print *, 'Error in FARKStepResStolerance, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeResStolerance, ierr = ', ierr, '; halting' stop 1 end if ! Set maximum number of internal time steps mxsteps = 1000 - ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKStepSetNonlinConvCoef' + print *, 'Error in FARKodeSetNonlinConvCoef' stop 1 end if @@ -1238,9 +1238,9 @@ program main print *, 'Error in FSUNDIALSFileOpen' stop 1 end if - ierr = FARKStepWriteParameters(arkode_mem, outstr) + ierr = FARKodeWriteParameters(arkode_mem, outstr) if (ierr /= 0) then - print *, 'Error in FARKStepWriteParameters' + print *, 'Error in FARKodeWriteParameters' stop 1 end if ierr = FSUNDIALSFileClose(outstr) @@ -1262,16 +1262,16 @@ program main ! set the next output time tout = min(tout + dtout, tend) - ierr = FARKStepSetStopTime(arkode_mem, tout) + ierr = FARKodeSetStopTime(arkode_mem, tout) if (ierr /= 0) then - print *, 'Error in FARKStepSetStopTime, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeSetStopTime, ierr = ', ierr, '; halting' stop 1 end if - ! call ARKStep - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + ! call ARKodeEvolve + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) if (ierr < 0) then - print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' stop 1 end if @@ -1292,7 +1292,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_y) call FN_VDestroy(sunvec_u) call FN_VDestroy(sunvec_v) @@ -1344,15 +1344,15 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' stop 1 end if @@ -1362,57 +1362,57 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetLastStep(arkode_mem, hlast) + ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentStep(arkode_mem, hcur) + ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentTime(arkode_mem, tcur) + ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumMassSetups(arkode_mem, nmassevals) + ierr = FARKodeGetNumMassSetups(arkode_mem, nmassevals) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumMassSetups, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumMassSetups, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 index cdf1ebdb0b..52a7121a88 100644 --- a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -303,15 +303,15 @@ program main stop 1 end if - ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKStepSetLinearSolver' + print *, 'Error in FARKodeSetLinearSolver' stop 1 end if - ierr = FARKStepSetJacFn(arkode_mem, c_funloc(Jac)) + ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKStepSetJacFn' + print *, 'Error in FARKodeSetJacFn' stop 1 end if @@ -319,22 +319,22 @@ program main rtol = 1.0d-6 atol = 1.0d-10 - ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' stop 1 end if ! Set additional method parameters - ierr = FARKStepSetOrder(arkode_mem, order) + ierr = FARKodeSetOrder(arkode_mem, order) if (ierr /= 0) then - print *, 'Error in FARKStepSetOrder' + print *, 'Error in FARKodeSetOrder' stop 1 end if - ierr = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + ierr = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (ierr /= 0) then - print *, 'Error in FARKStepSetNonlinConvCoef' + print *, 'Error in FARKodeSetNonlinConvCoef' stop 1 end if @@ -364,11 +364,11 @@ program main print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) do outstep = 1,nout - ! call ARKStepEvolve + ! call ARKodeEvolve tout = min(tout + dtout, tend) - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) if (ierr /= 0) then - print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' stop 1 endif @@ -384,7 +384,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_y) call FSUNMatDestroy(sunmat_A) ierr = FSUNLinSolFree(sunls) @@ -431,15 +431,15 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' stop 1 end if @@ -449,57 +449,57 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetActualInitStep(arkode_mem, hinused) + ierr = FARKodeGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKStepGetActualInitStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetLastStep(arkode_mem, hlast) + ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentStep(arkode_mem, hcur) + ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentStep, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentTime(arkode_mem, tcur) + ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentTime, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumJacEvals(arkode_mem, njacevals) + ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumJacEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index 372cbf1642..c87583eb23 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -295,9 +295,9 @@ program main ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() - ierr = FARKStepSetLinearSolver(arkode_mem, sunls, sunmat_A) + ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKStepSetLinearSolver, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeSetLinearSolver, ierr = ', ierr, '; halting' stop 1 end if @@ -316,15 +316,15 @@ program main end if ! Set additional method parameters - ierr = FARKStepSStolerances(arkode_mem, rtol, atol) + ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKStepSStolerances, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKStepSetMaxNumSteps' + print *, 'Error in FARKodeSetMaxNumSteps' stop 1 end if @@ -338,29 +338,29 @@ program main tout = twohr do outstep = 1,12 - ! call ARKStep - ierr = FARKStepEvolve(arkode_mem, tout, sunvec_u, tcur, ARK_NORMAL) + ! call ARKodeEvolve + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_u, tcur, ARK_NORMAL) if (ierr /= 0) then - print *, 'Error in FARKStepEvolve, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' stop 1 end if ! get some solver statistics - ierr = FARKStepGetNumSteps(arkode_mem, lnst) + ierr = FARKodeGetNumSteps(arkode_mem, lnst) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumSteps, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumStepAttempts(arkode_mem, lnst_att) + ierr = FARKodeGetNumStepAttempts(arkode_mem, lnst_att) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetCurrentStep(arkode_mem, lh) + ierr = FARKodeGetCurrentStep(arkode_mem, lh) if (ierr /= 0) then - print *, 'Error in FARKStepGetCurrentStep, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetCurrentStep, ierr = ', ierr, '; halting' stop 1 end if @@ -378,7 +378,7 @@ program main call ARKStepStats(arkode_mem) ! clean up - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) call FN_VDestroy(sunvec_u) call FN_VDestroy(sunvec_f) ierr = FSUNLinSolFree(sunls) @@ -429,15 +429,15 @@ subroutine ARKStepStats(arkode_mem) !======= Internals ============ - ierr = FARKStepGetNumSteps(arkode_mem, nsteps) + ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumSteps, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' stop 1 end if @@ -447,59 +447,59 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetNumErrTestFails(arkode_mem, netfails) + ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumPrecEvals(arkode_mem, npe) + ierr = FARKodeGetNumPrecEvals(arkode_mem, npe) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumPrecEvals, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumPrecEvals, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumPrecSolves(arkode_mem, nps) + ierr = FARKodeGetNumPrecSolves(arkode_mem, nps) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumPrecSolves, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumPrecSolves, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumLinIters(arkode_mem, nliters) + ierr = FARKodeGetNumLinIters(arkode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumLinIters, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumLinIters, ierr = ', ierr, '; halting' stop 1 end if avdim = dble(nliters)/dble(nniters) - ierr = FARKStepGetNumLinConvFails(arkode_mem, ncfl) + ierr = FARKodeGetNumLinConvFails(arkode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumLinConvFails, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumLinConvFails, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetNumNonlinSolvConvFails(arkode_mem, ncf) + ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) + ierr = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FARKStepGetWorkSpace, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetWorkSpace, ierr = ', ierr, '; halting' stop 1 end if - ierr = FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + ierr = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) if (ierr /= 0) then - print *, 'Error in FARKStepGetLinWorkSpace, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetLinWorkSpace, ierr = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out index 4bc5495c61..68e0609dbb 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out @@ -1,6 +1,6 @@ - + Finished initialization, starting time steps - + t c1 (bottom left middle top right) | lnst lnst_att lh t c2 (bottom left middle top right) | lnst lnst_att lh ---------------------------------------------------------------------------------------- @@ -29,7 +29,7 @@ 8.640000E+04 8.946777E-06 2.191861E-15 1.700622E-10 5704 5708 6.277419E+02 5.090704E+11 5.755864E+11 5.984224E+11 ---------------------------------------------------------------------------------------- - + General Solver Stats: Total internal steps taken = 5704 Total internal steps attempts = 5708 @@ -43,8 +43,7 @@ Avg Krylov subspace dim = 1.946096E+00 Num nonlinear solver fails = 0 Num linear solver fails = 0 - main solver real/int workspace sizes = 3702 133 + main solver real/int workspace sizes = 3702 145 linear solver real/int workspace sizes = 2455 42 ARKBandPre real/int workspace sizes = 2800 622 ARKBandPre number of f evaluations = 480 - diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index b925a5ab76..929844e792 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -842,12 +842,12 @@ program main call check_retval(retval, "FARKStepSetTables") MATf => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSf => FSUNLinSol_Dense(y, MATf, sunctx) - retval = FARKStepSetLinearSolver(inner_arkode_mem, LSf, MATf) - call check_retval(retval, "FARKStepSetLinearSolver") - retval = FARKStepSetJacFn(inner_arkode_mem, c_funloc(Jn)) - call check_retval(retval, "FARKStepSetJacFn") - retval = FARKStepSStolerances(inner_arkode_mem, reltol, abstol) - call check_retval(retval, "FARKStepSStolerances") + retval = FARKodeSetLinearSolver(inner_arkode_mem, LSf, MATf) + call check_retval(retval, "FARKodeSetLinearSolver") + retval = FARKodeSetJacFn(inner_arkode_mem, c_funloc(Jn)) + call check_retval(retval, "FARKodeSetJacFn") + retval = FARKodeSStolerances(inner_arkode_mem, reltol, abstol) + call check_retval(retval, "FARKodeSStolerances") call FARKodeButcherTable_Free(BTf) else if (solve_type == 3 .or. solve_type == 4) then ! no fast dynamics ('evolve' explicitly w/ erk-3-3) @@ -881,9 +881,9 @@ program main end if ! Set the fast step size */ - retval = FARKStepSetFixedStep(inner_arkode_mem, hf) + retval = FARKodeSetFixedStep(inner_arkode_mem, hf) if (retval /= 0) then - print *, 'ERROR: FARKStepSetFixedStep failed' + print *, 'ERROR: FARKodeSetFixedStep failed' stop 1 end if @@ -951,12 +951,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - retval = FMRIStepSetLinearSolver(arkode_mem, LSs, MATs) - call check_retval(retval, "FMRIStepSetLinearSolver") - retval = FMRIStepSetJacFn(arkode_mem, c_funloc(Jn)) - call check_retval(retval, "FMRIStepSetJacFn") - retval = FMRIStepSStolerances(arkode_mem, reltol, abstol) - call check_retval(retval, "FMRIStepSStolerances") + retval = FARKodeSetLinearSolver(arkode_mem, LSs, MATs) + call check_retval(retval, "FARKodeSetLinearSolver") + retval = FARKodeSetJacFn(arkode_mem, c_funloc(Jn)) + call check_retval(retval, "FARKodeSetJacFn") + retval = FARKodeSStolerances(arkode_mem, reltol, abstol) + call check_retval(retval, "FARKodeSStolerances") else if (solve_type == 7) then ! MRI-GARK-ESDIRK34a, solve-decoupled slow solver arkode_mem = FMRIStepCreate(c_null_funptr, c_funloc(fs), T0, y, inner_stepper, sunctx) @@ -965,12 +965,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - retval = FMRIStepSetLinearSolver(arkode_mem, LSs, MATs) - call check_retval(retval, "FMRIStepSetLinearSolver") - retval = FMRIStepSetJacFn(arkode_mem, c_funloc(Js)) - call check_retval(retval, "FMRIStepSetJacFn") - retval = FMRIStepSStolerances(arkode_mem, reltol, abstol) - call check_retval(retval, "FMRIStepSStolerances") + retval = FARKodeSetLinearSolver(arkode_mem, LSs, MATs) + call check_retval(retval, "FARKodeSetLinearSolver") + retval = FARKodeSetJacFn(arkode_mem, c_funloc(Js)) + call check_retval(retval, "FARKodeSetJacFn") + retval = FARKodeSStolerances(arkode_mem, reltol, abstol) + call check_retval(retval, "FARKodeSStolerances") else if (solve_type == 8) then ! IMEX-MRI-GARK3b, solve-decoupled slow solver arkode_mem = FMRIStepCreate(c_funloc(fse), c_funloc(fsi), T0, y, inner_stepper, sunctx) @@ -979,12 +979,12 @@ program main call check_retval(retval, "FMRIStepSetCoupling") MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - retval = FMRIStepSetLinearSolver(arkode_mem, LSs, MATs) - call check_retval(retval, "FMRIStepSetLinearSolver") - retval = FMRIStepSetJacFn(arkode_mem, c_funloc(Jsi)) - call check_retval(retval, "FMRIStepSetJacFn") - retval = FMRIStepSStolerances(arkode_mem, reltol, abstol) - call check_retval(retval, "FMRIStepSStolerances") + retval = FARKodeSetLinearSolver(arkode_mem, LSs, MATs) + call check_retval(retval, "FARKodeSetLinearSolver") + retval = FARKodeSetJacFn(arkode_mem, c_funloc(Jsi)) + call check_retval(retval, "FARKodeSetJacFn") + retval = FARKodeSStolerances(arkode_mem, reltol, abstol) + call check_retval(retval, "FARKodeSStolerances") else if (solve_type == 9) then ! IMEX-MRI-GARK4, solve-decoupled slow solver arkode_mem = FMRIStepCreate(c_funloc(fse), c_funloc(fsi), T0, y, inner_stepper, sunctx) @@ -992,12 +992,12 @@ program main retval = FMRIStepSetCoupling(arkode_mem, SC) MATs => FSUNDenseMatrix(NEQ, NEQ, sunctx) LSs => FSUNLinSol_Dense(y, MATs, sunctx) - retval = FMRIStepSetLinearSolver(arkode_mem, LSs, MATs) - call check_retval(retval, "FMRIStepSetLinearSolver") - retval = FMRIStepSetJacFn(arkode_mem, c_funloc(Jsi)) - call check_retval(retval, "FMRIStepSetJacFn") - retval = FMRIStepSStolerances(arkode_mem, reltol, abstol) - call check_retval(retval, "FMRIStepSStolerances") + retval = FARKodeSetLinearSolver(arkode_mem, LSs, MATs) + call check_retval(retval, "FARKodeSetLinearSolver") + retval = FARKodeSetJacFn(arkode_mem, c_funloc(Jsi)) + call check_retval(retval, "FARKodeSetJacFn") + retval = FARKodeSStolerances(arkode_mem, reltol, abstol) + call check_retval(retval, "FARKodeSStolerances") end if if (.not. c_associated(arkode_mem)) then @@ -1006,14 +1006,14 @@ program main end if ! Set the slow step size - retval = FMRIStepSetFixedStep(arkode_mem, hs) - call check_retval(retval, "FMRIStepSetFixedStep") + retval = FARKodeSetFixedStep(arkode_mem, hs) + call check_retval(retval, "FARKodeSetFixedStep") ! ! Integrate ODE ! - ! Main time-stepping loop: calls MRIStepEvolve to perform the + ! Main time-stepping loop: calls ARKodeEvolve to perform the ! integration, then prints results. Stops when the final time ! has been reached t = T0 @@ -1030,8 +1030,8 @@ program main do iout = 1, Nt ! call integrator - retval = FMRIStepEvolve(arkode_mem, tout, y, tret, ARK_NORMAL) - call check_retval(retval, "FMRIStepEvolve") + retval = FARKodeEvolve(arkode_mem, tout, y, tret, ARK_NORMAL) + call check_retval(retval, "FARKodeEvolve") ! access/print solution and error uerr = abs(yarr(1)-utrue(tret(1))) @@ -1058,11 +1058,11 @@ program main ! ! Get some slow integrator statistics - retval = FMRIStepGetNumSteps(arkode_mem, nsts) + retval = FARKodeGetNumSteps(arkode_mem, nsts) retval = FMRIStepGetNumRhsEvals(arkode_mem, nfse, nfsi) ! Get some fast integrator statistics - retval = FARKStepGetNumSteps(inner_arkode_mem, nstf) + retval = FARKodeGetNumSteps(inner_arkode_mem, nstf) retval = FARKStepGetNumRhsEvals(inner_arkode_mem, nff, tmp) ! Print some final statistics @@ -1080,10 +1080,10 @@ program main ! Get/print slow integrator decoupled implicit solver statistics if ((solve_type == 4) .or. (solve_type == 7) .or. & (solve_type == 8) .or. (solve_type == 9)) then - retval = FMRIStepGetNonlinSolvStats(arkode_mem, nnis, nncs) - call check_retval(retval, "MRIStepGetNonlinSolvStats") - retval = FMRIStepGetNumJacEvals(arkode_mem, njes) - call check_retval(retval, "MRIStepGetNumJacEvals") + retval = FARKodeGetNonlinSolvStats(arkode_mem, nnis, nncs) + call check_retval(retval, "ARKodeGetNonlinSolvStats") + retval = FARKodeGetNumJacEvals(arkode_mem, njes) + call check_retval(retval, "ARKodeGetNumJacEvals") print '(A, I7)', " Slow Newton iters = ", nnis print '(A, I7)', " Slow Newton conv fails = ", nncs print '(A, I7)', " Slow Jacobian evals = ", njes @@ -1091,10 +1091,10 @@ program main ! Get/print fast integrator implicit solver statistics if (solve_type == 2) then - retval = FARKStepGetNonlinSolvStats(inner_arkode_mem, nnif, nncf) - call check_retval(retval, "ARKStepGetNonlinSolvStats") - retval = FARKStepGetNumJacEvals(inner_arkode_mem, njef) - call check_retval(retval, "ARKStepGetNumJacEvals") + retval = FARKodeGetNonlinSolvStats(inner_arkode_mem, nnif, nncf) + call check_retval(retval, "ARKodeGetNonlinSolvStats") + retval = FARKodeGetNumJacEvals(inner_arkode_mem, njef) + call check_retval(retval, "ARKodeGetNumJacEvals") print '(A, I7)', " Fast Newton iters = ", nnif print '(A, I7)', " Fast Newton conv fails = ", nncf print '(A, I7)', " Fast Jacobian evals = ", njef @@ -1116,9 +1116,9 @@ program main if (associated(LSf)) retval = FSUNLinSolFree(LSf) ! Free fast linear solver if (associated(MATs)) call FSUNMatDestroy(MATs) ! Free slow matrix if (associated(LSs)) retval = FSUNLinSolFree(LSs) ! Free slow linear solver - call FARKStepFree(inner_arkode_mem) ! Free fast integrator memory + call FARKodeFree(inner_arkode_mem) ! Free fast integrator memory retval = FMRIStepInnerStepper_Free(inner_stepper) ! Free inner stepper - call FMRIStepFree(arkode_mem) ! Free slow integrator memory + call FARKodeFree(arkode_mem) ! Free slow integrator memory retval = FSUNContext_Free(sunctx) ! Free context end program main diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 index a57dd5f9c6..fb58aee07f 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -275,18 +275,18 @@ program main arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' - ! Call FARKStepSVtolerances to set tolerances - retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) + ! Call FARKodeSVtolerances to set tolerances + retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' stop 1 end if - ! Call FARKStepRootInit to specify the root function grob with 2 components + ! Call FARKodeRootInit to specify the root function grob with 2 components nrtfn = 2 - retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) + retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKStepRootInit, retval = ', retval, '; halting' + print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' stop 1 end if @@ -305,59 +305,59 @@ program main end if ! Attach the matrix and linear solver - retval = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' stop 1 end if ! Set the user-supplied Jacobian routine - retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) + retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' stop 1 end if ! Set additional method parameters mxsteps = 10000 - retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxNumSteps' + print *, 'Error in FARKodeSetMaxNumSteps' stop 1 end if initsize = 1.d-4 * rtol - retval = FARKStepSetInitStep(arkode_mem, initsize) + retval = FARKodeSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKStepSetInitStep' + print *, 'Error in FARKodeSetInitStep' stop 1 end if nlscoef = 1.d-7 - retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKStepSetNonlinConvCoef' + print *, 'Error in FARKodeSetNonlinConvCoef' stop 1 end if nliters = 8 - retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) + retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxNonlinIters' + print *, 'Error in FARKodeSetMaxNonlinIters' stop 1 end if pmethod = 1 - retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) + retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKStepSetPredictorMethod' + print *, 'Error in FARKodeSetPredictorMethod' stop 1 end if maxetf = 20 - retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) + retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxErrTestFails' + print *, 'Error in FARKodeSetMaxErrTestFails' stop 1 end if @@ -372,29 +372,29 @@ program main end if ! Attach the nonlinear solver - retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) + retval = FARKodeSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' stop 1 end if - ! In loop, call ARKStepEvolve, print results, and test for error. + ! In loop, call ARKodeEvolve, print results, and test for error. iout = 0 tout = tout1 do while(iout < nout) - retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) if (retval < 0) then - print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' + print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' stop 1 endif call PrintOutput(arkode_mem, tret(1), yval) if (retval .eq. ARK_ROOT_RETURN) then - retvalr = FARKStepGetRootInfo(arkode_mem, rootsfound) + retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) if (retvalr < 0) then - print *, 'Error in FARKStepGetRootInfo, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' stop 1 endif print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) @@ -413,9 +413,9 @@ program main stop 1 end if - retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) + retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKStepGetDky' + print *, 'Error in ARKodeGetDky' stop 1 end if print *, " " @@ -428,7 +428,7 @@ program main call PrintFinalStats(arkode_mem) ! free memory - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) retval = FSUNNonlinSolFree(sunnonlin_NLS) retval = FSUNLinSolFree(sunlinsol_LS) call FSUNMatDestroy(sunmat_A) @@ -503,15 +503,15 @@ subroutine PrintOutput(arkode_mem, t, y) !======= Internals ============ - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetLastStep(arkode_mem, hused) + retval = FARKodeGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' stop 1 end if @@ -559,15 +559,15 @@ subroutine PrintFinalStats(arkode_mem) !======= Internals ============ - retval = FARKStepGetNumSteps(arkode_mem, nsteps) + retval = FARKodeGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' stop 1 end if @@ -577,57 +577,57 @@ subroutine PrintFinalStats(arkode_mem) stop 1 end if - retval = FARKStepGetActualInitStep(arkode_mem, hinused) + retval = FARKodeGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetLastStep(arkode_mem, hlast) + retval = FARKodeGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetCurrentStep(arkode_mem, hcur) + retval = FARKodeGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetCurrentTime(arkode_mem, tcur) + retval = FARKodeGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) + retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) + retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKStepGetNumJacEvals, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index 30b41329ee..379f7a23ea 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -278,18 +278,18 @@ program main arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(fcnirob), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' - ! Call FARKStepSVtolerances to set tolerances - retval = FARKStepSVtolerances(arkode_mem, rtol, sunvec_av) + ! Call FARKodeSVtolerances to set tolerances + retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKStepSVtolerances, retval = ', retval, '; halting' + print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' stop 1 end if - ! Call FARKStepRootInit to specify the root function grob with 2 components + ! Call FARKodeRootInit to specify the root function grob with 2 components nrtfn = 2 - retval = FARKStepRootInit(arkode_mem, nrtfn, c_funloc(grob)) + retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKStepRootInit, retval = ', retval, '; halting' + print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' stop 1 end if @@ -308,59 +308,59 @@ program main end if ! Attach the matrix and linear solver - retval = FARKStepSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKStepSetLinearSolver, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' stop 1 end if ! Set the user-supplied Jacobian routine - retval = FARKStepSetJacFn(arkode_mem, c_funloc(jacrob)) + retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKStepSetJacFn, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' stop 1 end if ! Set additional method parameters mxsteps = 10000 - retval = FARKStepSetMaxNumSteps(arkode_mem, mxsteps) + retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxNumSteps' + print *, 'Error in FARKodeSetMaxNumSteps' stop 1 end if initsize = 1.d-4 * rtol - retval = FARKStepSetInitStep(arkode_mem, initsize) + retval = FARKodeSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKStepSetInitStep' + print *, 'Error in FARKodeSetInitStep' stop 1 end if nlscoef = 1.d-7 - retval = FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) + retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKStepSetNonlinConvCoef' + print *, 'Error in FARKodeSetNonlinConvCoef' stop 1 end if nliters = 8 - retval = FARKStepSetMaxNonlinIters(arkode_mem, nliters) + retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxNonlinIters' + print *, 'Error in FARKodeSetMaxNonlinIters' stop 1 end if pmethod = 1 - retval = FARKStepSetPredictorMethod(arkode_mem, pmethod) + retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKStepSetPredictorMethod' + print *, 'Error in FARKodeSetPredictorMethod' stop 1 end if maxetf = 20 - retval = FARKStepSetMaxErrTestFails(arkode_mem, maxetf) + retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKStepSetMaxErrTestFails' + print *, 'Error in FARKodeSetMaxErrTestFails' stop 1 end if @@ -375,29 +375,29 @@ program main end if ! Attach the nonlinear solver - retval = FARKStepSetNonlinearSolver(arkode_mem, sunnonlin_NLS) + retval = FARKodeSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKStepSetNonlinearSolver, retval = ', retval, '; halting' + print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' stop 1 end if - ! In loop, call ARKStepEvolve, print results, and test for error. + ! In loop, call ARKodeEvolve, print results, and test for error. iout = 0 tout = tout1 do while(iout < nout) - retval = FARKStepEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) if (retval < 0) then - print *, 'Error in FARKStepEvolve, retval = ', retval, '; halting' + print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' stop 1 endif call PrintOutput(arkode_mem, tret(1), yval) if (retval .eq. ARK_ROOT_RETURN) then - retvalr = FARKStepGetRootInfo(arkode_mem, rootsfound) + retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) if (retvalr < 0) then - print *, 'Error in FARKStepGetRootInfo, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' stop 1 endif print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) @@ -416,9 +416,9 @@ program main stop 1 end if - retval = FARKStepGetDky(arkode_mem, tret(1), 1, sunvec_dky) + retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKStepGetDky' + print *, 'Error in ARKodeGetDky' stop 1 end if print *, " " @@ -431,7 +431,7 @@ program main call PrintFinalStats(arkode_mem) ! free memory - call FARKStepFree(arkode_mem) + call FARKodeFree(arkode_mem) retval = FSUNNonlinSolFree(sunnonlin_NLS) retval = FSUNLinSolFree(sunlinsol_LS) call FSUNMatDestroy(sunmat_A) @@ -506,15 +506,15 @@ subroutine PrintOutput(arkode_mem, t, y) !======= Internals ============ - retval = FARKStepGetNumSteps(arkode_mem, nst) + retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetLastStep(arkode_mem, hused) + retval = FARKodeGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' stop 1 end if @@ -562,15 +562,15 @@ subroutine PrintFinalStats(arkode_mem) !======= Internals ============ - retval = FARKStepGetNumSteps(arkode_mem, nsteps) + retval = FARKodeGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKStepGetNumSteps, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumStepAttempts(arkode_mem, nst_a) + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKStepGetNumStepAttempts, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' stop 1 end if @@ -580,57 +580,57 @@ subroutine PrintFinalStats(arkode_mem) stop 1 end if - retval = FARKStepGetActualInitStep(arkode_mem, hinused) + retval = FARKodeGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKStepGetActualInitStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetLastStep(arkode_mem, hlast) + retval = FARKodeGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKStepGetLastStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetCurrentStep(arkode_mem, hcur) + retval = FARKodeGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKStepGetCurrentStep, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetCurrentTime(arkode_mem, tcur) + retval = FARKodeGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKStepGetCurrentTime, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) + retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKStepGetNumLinSolvSetups, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumErrTestFails(arkode_mem, netfails) + retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKStepGetNumErrTestFails, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvIters, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) + retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKStepGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' stop 1 end if - retval = FARKStepGetNumJacEvals(arkode_mem, njacevals) + retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKStepGetNumJacEvals, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' stop 1 end if diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index f0265db008..14027693af 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -137,6 +137,8 @@ extern "C" { #define ARK_CONTROLLER_ERR -47 +#define ARK_STEPPER_UNSUPPORTED -48 + #define ARK_UNRECOGNIZED_ERROR -99 /* ------------------------------ @@ -187,6 +189,228 @@ typedef enum ARK_RELAX_NEWTON } ARKRelaxSolver; +/* -------------------------- + * Shared API routines + * -------------------------- */ + +/* Resize and Reset functions */ +SUNDIALS_EXPORT int ARKodeResize(void* arkode_mem, N_Vector ynew, + sunrealtype hscale, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data); +SUNDIALS_EXPORT int ARKodeReset(void* arkode_mem, sunrealtype tR, N_Vector yR); + +/* Tolerance input functions */ +SUNDIALS_EXPORT int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, + sunrealtype abstol); +SUNDIALS_EXPORT int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, + N_Vector abstol); +SUNDIALS_EXPORT int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun); + +/* Residual tolerance input functions */ +SUNDIALS_EXPORT int ARKodeResStolerance(void* arkode_mem, sunrealtype rabstol); +SUNDIALS_EXPORT int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol); +SUNDIALS_EXPORT int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun); + +/* Rootfinding */ +SUNDIALS_EXPORT int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_EXPORT int ARKodeSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_EXPORT int ARKodeSetNoInactiveRootWarn(void* arkode_mem); + +/* Optional input functions */ +SUNDIALS_EXPORT int ARKodeSetDefaults(void* arkode_mem); +SUNDIALS_EXPORT int ARKodeSetOrder(void* arkode_mem, int maxord); +SUNDIALS_EXPORT int ARKodeSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_EXPORT int ARKodeSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_EXPORT int ARKodeSetNonlinearSolver(void* arkode_mem, + SUNNonlinearSolver NLS); +SUNDIALS_EXPORT int ARKodeSetLinear(void* arkode_mem, int timedepend); +SUNDIALS_EXPORT int ARKodeSetNonlinear(void* arkode_mem); +SUNDIALS_EXPORT int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); +SUNDIALS_EXPORT int ARKodeSetDeduceImplicitRhs(void* arkode_mem, + sunbooleantype deduce); +SUNDIALS_EXPORT int ARKodeSetAdaptController(void* arkode_mem, + SUNAdaptController C); +SUNDIALS_EXPORT int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust); +SUNDIALS_EXPORT int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); +SUNDIALS_EXPORT int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias); +SUNDIALS_EXPORT int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety); +SUNDIALS_EXPORT int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); +SUNDIALS_EXPORT int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min); +SUNDIALS_EXPORT int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, + sunrealtype ub); +SUNDIALS_EXPORT int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); +SUNDIALS_EXPORT int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); +SUNDIALS_EXPORT int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef); +SUNDIALS_EXPORT int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); +SUNDIALS_EXPORT int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_EXPORT int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_EXPORT int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_EXPORT int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_EXPORT int ARKodeSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_EXPORT int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, + void* estab_data); +SUNDIALS_EXPORT int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef); +SUNDIALS_EXPORT int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_EXPORT int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf); +SUNDIALS_EXPORT int ARKodeSetNonlinConvCoef(void* arkode_mem, + sunrealtype nlscoef); +SUNDIALS_EXPORT int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints); +SUNDIALS_EXPORT int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_EXPORT int ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_EXPORT int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin); +SUNDIALS_EXPORT int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin); +SUNDIALS_EXPORT int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax); +SUNDIALS_EXPORT int ARKodeSetInterpolateStopTime(void* arkode_mem, + sunbooleantype interp); +SUNDIALS_EXPORT int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); +SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_EXPORT int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails); + +SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); + +SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, + ARKPostProcessFn ProcessStep); +SUNDIALS_EXPORT int ARKodeSetPostprocessStageFn(void* arkode_mem, + ARKPostProcessFn ProcessStage); +SUNDIALS_EXPORT int ARKodeSetStagePredictFn(void* arkode_mem, + ARKStagePredictFn PredictStage); + +/* Integrate the ODE over an interval in t */ +SUNDIALS_EXPORT int ARKodeEvolve(void* arkode_mem, sunrealtype tout, + N_Vector yout, sunrealtype* tret, int itask); + +/* Computes the kth derivative of the y function at time t */ +SUNDIALS_EXPORT int ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, + N_Vector dky); + +/* Utility function to update/compute y based on zcor */ +SUNDIALS_EXPORT int ARKodeComputeState(void* arkode_mem, N_Vector zcor, + N_Vector z); + +/* Optional output functions */ +SUNDIALS_EXPORT int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_EXPORT int ARKodeGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_EXPORT int ARKodeGetNumStepAttempts(void* arkode_mem, + long int* step_attempts); +SUNDIALS_EXPORT int ARKodeGetNumLinSolvSetups(void* arkode_mem, + long int* nlinsetups); +SUNDIALS_EXPORT int ARKodeGetNumErrTestFails(void* arkode_mem, + long int* netfails); +SUNDIALS_EXPORT int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_EXPORT int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, + long int* leniw); +SUNDIALS_EXPORT int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_EXPORT int ARKodeGetActualInitStep(void* arkode_mem, + sunrealtype* hinused); +SUNDIALS_EXPORT int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_EXPORT int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_EXPORT int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_EXPORT int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_EXPORT int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); +SUNDIALS_EXPORT int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); +SUNDIALS_EXPORT int ARKodeGetTolScaleFactor(void* arkode_mem, + sunrealtype* tolsfac); +SUNDIALS_EXPORT int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_EXPORT int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight); +SUNDIALS_EXPORT int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_EXPORT int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_EXPORT int ARKodeGetNumConstrFails(void* arkode_mem, + long int* nconstrfails); +SUNDIALS_EXPORT int ARKodeGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_EXPORT int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, + SUNOutputFormat fmt); +SUNDIALS_EXPORT char* ARKodeGetReturnFlagName(long int flag); + +SUNDIALS_EXPORT int ARKodeWriteParameters(void* arkode_mem, FILE* fp); + +/* Grouped optional output functions */ +SUNDIALS_EXPORT int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); + +/* Nonlinear solver optional output functions */ +SUNDIALS_EXPORT int ARKodeGetNonlinearSystemData( + void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, + N_Vector* Fi, sunrealtype* gamma, N_Vector* sdata, void** user_data); + +SUNDIALS_EXPORT int ARKodeGetNumNonlinSolvIters(void* arkode_mem, + long int* nniters); +SUNDIALS_EXPORT int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, + long int* nnfails); +SUNDIALS_EXPORT int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails); +SUNDIALS_EXPORT int ARKodeGetNumStepSolveFails(void* arkode_mem, + long int* nncfails); + +/* Linear solver optional output functions */ +SUNDIALS_EXPORT int ARKodeGetJac(void* arkode_mem, SUNMatrix* J); +SUNDIALS_EXPORT int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J); +SUNDIALS_EXPORT int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J); +SUNDIALS_EXPORT int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, + long int* leniwLS); +SUNDIALS_EXPORT int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals); +SUNDIALS_EXPORT int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals); +SUNDIALS_EXPORT int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves); +SUNDIALS_EXPORT int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters); +SUNDIALS_EXPORT int ARKodeGetNumLinConvFails(void* arkode_mem, + long int* nlcfails); +SUNDIALS_EXPORT int ARKodeGetNumJTSetupEvals(void* arkode_mem, + long int* njtsetups); +SUNDIALS_EXPORT int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals); +SUNDIALS_EXPORT int ARKodeGetNumLinRhsEvals(void* arkode_mem, + long int* nfevalsLS); +SUNDIALS_EXPORT int ARKodeGetLastLinFlag(void* arkode_mem, long int* flag); + +SUNDIALS_EXPORT int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, + long int* leniwMLS); +SUNDIALS_EXPORT int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups); +SUNDIALS_EXPORT int ARKodeGetNumMassMultSetups(void* arkode_mem, + long int* nmvsetups); +SUNDIALS_EXPORT int ARKodeGetNumMassMult(void* arkode_mem, long int* nmvevals); +SUNDIALS_EXPORT int ARKodeGetNumMassSolves(void* arkode_mem, long int* nmsolves); +SUNDIALS_EXPORT int ARKodeGetNumMassPrecEvals(void* arkode_mem, + long int* nmpevals); +SUNDIALS_EXPORT int ARKodeGetNumMassPrecSolves(void* arkode_mem, + long int* nmpsolves); +SUNDIALS_EXPORT int ARKodeGetNumMassIters(void* arkode_mem, long int* nmiters); +SUNDIALS_EXPORT int ARKodeGetNumMassConvFails(void* arkode_mem, + long int* nmcfails); +SUNDIALS_EXPORT int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetups); +SUNDIALS_EXPORT int ARKodeGetLastMassFlag(void* arkode_mem, long int* flag); + +SUNDIALS_EXPORT char* ARKodeGetLinReturnFlagName(long int flag); + +/* Free function */ +SUNDIALS_EXPORT void ARKodeFree(void** arkode_mem); + +/* Output the ARKode memory structure (useful when debugging) */ +SUNDIALS_EXPORT void ARKodePrintMem(void* arkode_mem, FILE* outfile); + +/* Relaxation functions */ +SUNDIALS_EXPORT int ARKodeSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, + ARKRelaxJacFn rjac); +SUNDIALS_EXPORT int ARKodeSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); +SUNDIALS_EXPORT int ARKodeSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); +SUNDIALS_EXPORT int ARKodeSetRelaxMaxFails(void* arkode_mem, int max_fails); +SUNDIALS_EXPORT int ARKodeSetRelaxMaxIters(void* arkode_mem, int max_iters); +SUNDIALS_EXPORT int ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); +SUNDIALS_EXPORT int ARKodeSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); +SUNDIALS_EXPORT int ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, + sunrealtype abs_tol); +SUNDIALS_EXPORT int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); +SUNDIALS_EXPORT int ARKodeGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); +SUNDIALS_EXPORT int ARKodeGetNumRelaxJacEvals(void* arkode_mem, + long int* J_evals); +SUNDIALS_EXPORT int ARKodeGetNumRelaxFails(void* arkode_mem, + long int* relax_fails); +SUNDIALS_EXPORT int ARKodeGetNumRelaxBoundFails(void* arkode_mem, + long int* fails); +SUNDIALS_EXPORT int ARKodeGetNumRelaxSolveFails(void* arkode_mem, + long int* fails); +SUNDIALS_EXPORT int ARKodeGetNumRelaxSolveIters(void* arkode_mem, + long int* iters); + #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index c4eb064935..10477c033b 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -68,54 +68,69 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; SUNDIALS_EXPORT void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, SUNContext sunctx); -SUNDIALS_EXPORT int ARKStepResize(void* arkode_mem, N_Vector ynew, - sunrealtype hscale, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int ARKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); SUNDIALS_EXPORT int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ -SUNDIALS_EXPORT int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, - sunrealtype abstol); -SUNDIALS_EXPORT int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, - N_Vector abstol); -SUNDIALS_EXPORT int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); /* Residual tolerance input functions */ -SUNDIALS_EXPORT int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol); -SUNDIALS_EXPORT int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol); -SUNDIALS_EXPORT int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResStolerance instead") +int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResVtolerance instead") +int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResFtolerance instead") +int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun); /* Linear solver set functions */ -SUNDIALS_EXPORT int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix A); -SUNDIALS_EXPORT int ARKStepSetMassLinearSolver(void* arkode_mem, - SUNLinearSolver LS, SUNMatrix M, - sunbooleantype time_dep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") +int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLinearSolver instead") +int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix M, sunbooleantype time_dep); /* Rootfinding initialization */ -SUNDIALS_EXPORT int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); /* Optional input functions -- must be called AFTER ARKStepCreate */ -SUNDIALS_EXPORT int ARKStepSetDefaults(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetOptimalParams(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_EXPORT int ARKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_EXPORT int ARKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_EXPORT int ARKStepSetDenseOrder(void* arkode_mem, int dord); -SUNDIALS_EXPORT int ARKStepSetNonlinearSolver(void* arkode_mem, - SUNNonlinearSolver NLS); -SUNDIALS_EXPORT int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); -SUNDIALS_EXPORT int ARKStepSetLinear(void* arkode_mem, int timedepend); -SUNDIALS_EXPORT int ARKStepSetNonlinear(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int ARKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("adjust parameters individually instead") +int ARKStepSetOptimalParams(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int ARKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int ARKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ARKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ARKStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") +int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") +int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") +int ARKStepSetLinear(void* arkode_mem, int timedepend); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") +int ARKStepSetNonlinear(void* arkode_mem); SUNDIALS_EXPORT int ARKStepSetExplicit(void* arkode_mem); SUNDIALS_EXPORT int ARKStepSetImplicit(void* arkode_mem); SUNDIALS_EXPORT int ARKStepSetImEx(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetDeduceImplicitRhs(void* arkode_mem, - sunbooleantype deduce); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") +int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); SUNDIALS_EXPORT int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, ARKodeButcherTable Be); @@ -124,248 +139,329 @@ SUNDIALS_EXPORT int ARKStepSetTableNum(void* arkode_mem, 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, sunrealtype cfl_frac); -SUNDIALS_EXPORT int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") +int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") +int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") +int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") +int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias); -SUNDIALS_EXPORT int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); -SUNDIALS_EXPORT int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); -SUNDIALS_EXPORT int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, - sunrealtype ub); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") +int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") +int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") +int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype 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, - sunrealtype etamx1); -SUNDIALS_EXPORT int ARKStepSetMaxEFailGrowth(void* arkode_mem, - sunrealtype etamxf); -SUNDIALS_EXPORT int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef); -SUNDIALS_EXPORT int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); -SUNDIALS_EXPORT int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); -SUNDIALS_EXPORT int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); -SUNDIALS_EXPORT int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); -SUNDIALS_EXPORT int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp); -SUNDIALS_EXPORT int ARKStepSetPredictorMethod(void* arkode_mem, int method); -SUNDIALS_EXPORT int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, - void* estab_data); -SUNDIALS_EXPORT int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_EXPORT int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor); -SUNDIALS_EXPORT int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf); -SUNDIALS_EXPORT int ARKStepSetNonlinConvCoef(void* arkode_mem, - sunrealtype nlscoef); -SUNDIALS_EXPORT int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_EXPORT int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_EXPORT int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_EXPORT int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin); -SUNDIALS_EXPORT int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin); -SUNDIALS_EXPORT int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); -SUNDIALS_EXPORT int ARKStepSetInterpolateStopTime(void* arkode_mem, - sunbooleantype interp); -SUNDIALS_EXPORT int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int ARKStepClearStopTime(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_EXPORT int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); - -SUNDIALS_EXPORT int ARKStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_EXPORT int ARKStepSetNoInactiveRootWarn(void* arkode_mem); - -SUNDIALS_EXPORT int ARKStepSetUserData(void* arkode_mem, void* user_data); - -SUNDIALS_EXPORT int ARKStepSetPostprocessStepFn(void* arkode_mem, - ARKPostProcessFn ProcessStep); -SUNDIALS_EXPORT int ARKStepSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); -SUNDIALS_EXPORT int ARKStepSetStagePredictFn(void* arkode_mem, - ARKStagePredictFn PredictStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") +int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") +int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") +int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxCFailGrowth instead") +int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") +int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") +int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") +int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") +int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") +int ARKStepSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") +int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") +int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") +int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxConvFails instead") +int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") +int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") +int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") +int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") +int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") +int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int ARKStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") +int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int ARKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int ARKStepSetNoInactiveRootWarn(void* arkode_mem); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int ARKStepSetUserData(void* arkode_mem, void* user_data); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") +int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); /* Linear solver interface optional input functions -- must be called AFTER ARKStepSetLinearSolver and/or ARKStepSetMassLinearSolver */ -SUNDIALS_EXPORT int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); -SUNDIALS_EXPORT int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass); -SUNDIALS_EXPORT int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj); -SUNDIALS_EXPORT int ARKStepSetLinearSolutionScaling(void* arkode_mem, - sunbooleantype onoff); -SUNDIALS_EXPORT int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_EXPORT int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_EXPORT int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); -SUNDIALS_EXPORT int ARKStepSetMassLSNormFactor(void* arkode_mem, - sunrealtype nrmfac); -SUNDIALS_EXPORT int ARKStepSetPreconditioner(void* arkode_mem, - ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve); -SUNDIALS_EXPORT int ARKStepSetMassPreconditioner(void* arkode_mem, - ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve); -SUNDIALS_EXPORT int ARKStepSetJacTimes(void* arkode_mem, - ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes); -SUNDIALS_EXPORT int ARKStepSetJacTimesRhsFn(void* arkode_mem, - ARKRhsFn jtimesRhsFn); -SUNDIALS_EXPORT int ARKStepSetMassTimes(void* arkode_mem, - ARKLsMassTimesSetupFn msetup, - ARKLsMassTimesVecFn mtimes, - void* mtimes_data); -SUNDIALS_EXPORT int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") +int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassFn instead") +int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") +int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") +int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") +int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassEpsLin instead") +int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") +int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLSNormFactor instead") +int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") +int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassPreconditioner instead") +int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") +int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") +int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassTimes instead") +int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, + ARKLsMassTimesVecFn mtimes, void* mtimes_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") +int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int ARKStepEvolve(void* arkode_mem, sunrealtype tout, - N_Vector yout, sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, - N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); /* Utility function to update/compute y based on zcor */ -SUNDIALS_EXPORT int ARKStepComputeState(void* arkode_mem, N_Vector zcor, - N_Vector z); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") +int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); /* Optional output functions */ -SUNDIALS_EXPORT int ARKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_EXPORT int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); -SUNDIALS_EXPORT int ARKStepGetNumStepAttempts(void* arkode_mem, - long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") +int ARKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") +int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") +int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); SUNDIALS_EXPORT int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, long int* nfi_evals); -SUNDIALS_EXPORT int ARKStepGetNumLinSolvSetups(void* arkode_mem, - long int* nlinsetups); -SUNDIALS_EXPORT int ARKStepGetNumErrTestFails(void* arkode_mem, - long int* netfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") +int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") +int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); SUNDIALS_EXPORT int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, ARKodeButcherTable* Be); -SUNDIALS_EXPORT int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); -SUNDIALS_EXPORT int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, - long int* leniw); -SUNDIALS_EXPORT int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_EXPORT int ARKStepGetActualInitStep(void* arkode_mem, - sunrealtype* hinused); -SUNDIALS_EXPORT int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_EXPORT int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_EXPORT int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_EXPORT int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_EXPORT int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); -SUNDIALS_EXPORT int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); -SUNDIALS_EXPORT int ARKStepGetTolScaleFactor(void* arkode_mem, - sunrealtype* tolsfac); -SUNDIALS_EXPORT int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_EXPORT int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight); -SUNDIALS_EXPORT int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_EXPORT int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_EXPORT int ARKStepGetNumConstrFails(void* arkode_mem, - long int* nconstrfails); -SUNDIALS_EXPORT int ARKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_EXPORT int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, - SUNOutputFormat fmt); -SUNDIALS_EXPORT char* ARKStepGetReturnFlagName(long int flag); - -SUNDIALS_EXPORT int ARKStepWriteParameters(void* arkode_mem, FILE* fp); - -SUNDIALS_EXPORT int ARKStepWriteButcher(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") +int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") +int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") +int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") +int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") +int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentMassMatrix instead") +int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetResWeights instead") +int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") +int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int ARKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* ARKStepGetReturnFlagName(long int flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int ARKStepWriteParameters(void* arkode_mem, FILE* fp); + +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use ARKStepGetCurrentButcherTables and ARKodeButcherTable_Write instead") +int ARKStepWriteButcher(void* arkode_mem, FILE* fp); /* Grouped optional output functions */ SUNDIALS_EXPORT int ARKStepGetTimestepperStats( void* arkode_mem, long int* expsteps, long int* accsteps, long int* step_attempts, long int* nfe_evals, long int* nfi_evals, long int* nlinsetups, long int* netfails); -SUNDIALS_EXPORT int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") +int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); /* Nonlinear solver optional output functions */ -SUNDIALS_EXPORT int ARKStepGetNonlinearSystemData( - void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, - N_Vector* Fi, sunrealtype* gamma, N_Vector* sdata, void** user_data); - -SUNDIALS_EXPORT int ARKStepGetNumNonlinSolvIters(void* arkode_mem, - long int* nniters); -SUNDIALS_EXPORT int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, - long int* nnfails); -SUNDIALS_EXPORT int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails); -SUNDIALS_EXPORT int ARKStepGetNumStepSolveFails(void* arkode_mem, - long int* nncfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") +int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") +int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") +int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") +int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") +int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); /* Linear solver optional output functions */ -SUNDIALS_EXPORT int ARKStepGetJac(void* arkode_mem, SUNMatrix* J); -SUNDIALS_EXPORT int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J); -SUNDIALS_EXPORT int ARKStepGetJacNumSteps(void* arkode_mem, long int* nst_J); -SUNDIALS_EXPORT int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, - long int* leniwLS); -SUNDIALS_EXPORT int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals); -SUNDIALS_EXPORT int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals); -SUNDIALS_EXPORT int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); -SUNDIALS_EXPORT int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters); -SUNDIALS_EXPORT int ARKStepGetNumLinConvFails(void* arkode_mem, - long int* nlcfails); -SUNDIALS_EXPORT int ARKStepGetNumJTSetupEvals(void* arkode_mem, - long int* njtsetups); -SUNDIALS_EXPORT int ARKStepGetNumJtimesEvals(void* arkode_mem, - long int* njvevals); -SUNDIALS_EXPORT int ARKStepGetNumLinRhsEvals(void* arkode_mem, - long int* nfevalsLS); -SUNDIALS_EXPORT int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag); - -SUNDIALS_EXPORT int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, - long int* leniwMLS); -SUNDIALS_EXPORT int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups); -SUNDIALS_EXPORT int ARKStepGetNumMassMultSetups(void* arkode_mem, - long int* nmvsetups); -SUNDIALS_EXPORT int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals); -SUNDIALS_EXPORT int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves); -SUNDIALS_EXPORT int ARKStepGetNumMassPrecEvals(void* arkode_mem, - long int* nmpevals); -SUNDIALS_EXPORT int ARKStepGetNumMassPrecSolves(void* arkode_mem, - long int* nmpsolves); -SUNDIALS_EXPORT int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters); -SUNDIALS_EXPORT int ARKStepGetNumMassConvFails(void* arkode_mem, - long int* nmcfails); -SUNDIALS_EXPORT int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups); -SUNDIALS_EXPORT int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag); - -SUNDIALS_EXPORT char* ARKStepGetLinReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") +int ARKStepGetJac(void* arkode_mem, SUNMatrix* J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") +int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") +int ARKStepGetJacNumSteps(void* arkode_mem, long int* nst_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinWorkSpace instead") +int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, + long int* leniwLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") +int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") +int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") +int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") +int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") +int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") +int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") +int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") +int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") +int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetMassWorkSpace instead") +int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, + long int* leniwMLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSetups instead") +int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMultSetups instead") +int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMult instead") +int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSolves instead") +int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecEvals instead") +int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecSolves instead") +int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassIters instead") +int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassConvFails instead") +int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMTSetups instead") +int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastMassFlag instead") +int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") +char* ARKStepGetLinReturnFlagName(long int flag); /* Free function */ -SUNDIALS_EXPORT void ARKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void ARKStepFree(void** arkode_mem); /* Output the ARKStep memory structure (useful when debugging) */ -SUNDIALS_EXPORT void ARKStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void ARKStepPrintMem(void* arkode_mem, FILE* outfile); /* MRIStep interface functions */ SUNDIALS_EXPORT int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, MRIStepInnerStepper* stepper); /* Relaxation functions */ -SUNDIALS_EXPORT int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, - ARKRelaxJacFn rjac); -SUNDIALS_EXPORT int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); -SUNDIALS_EXPORT int ARKStepSetRelaxLowerBound(void* arkode_mem, - sunrealtype lower); -SUNDIALS_EXPORT int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); -SUNDIALS_EXPORT int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); -SUNDIALS_EXPORT int ARKStepSetRelaxSolver(void* arkode_mem, - ARKRelaxSolver solver); -SUNDIALS_EXPORT int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); -SUNDIALS_EXPORT int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, - sunrealtype abs_tol); -SUNDIALS_EXPORT int ARKStepSetRelaxUpperBound(void* arkode_mem, - sunrealtype upper); -SUNDIALS_EXPORT int ARKStepGetNumRelaxFnEvals(void* arkode_mem, - long int* r_evals); -SUNDIALS_EXPORT int ARKStepGetNumRelaxJacEvals(void* arkode_mem, - long int* J_evals); -SUNDIALS_EXPORT int ARKStepGetNumRelaxFails(void* arkode_mem, - long int* relax_fails); -SUNDIALS_EXPORT int ARKStepGetNumRelaxBoundFails(void* arkode_mem, - long int* fails); -SUNDIALS_EXPORT int ARKStepGetNumRelaxSolveFails(void* arkode_mem, - long int* fails); -SUNDIALS_EXPORT int ARKStepGetNumRelaxSolveIters(void* arkode_mem, - long int* iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") +int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") +int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") +int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") +int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") +int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") +int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") +int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") +int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, + sunrealtype abs_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") +int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") +int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") +int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") +int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") +int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") +int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") +int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); #ifdef __cplusplus } diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index 6fc507c4f2..847a2b4447 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -49,122 +49,164 @@ static const int ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9; SUNDIALS_EXPORT void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx); -SUNDIALS_EXPORT int ERKStepResize(void* arkode_mem, N_Vector ynew, - sunrealtype hscale, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int ERKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); SUNDIALS_EXPORT int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ -SUNDIALS_EXPORT int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, - sunrealtype abstol); -SUNDIALS_EXPORT int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, - N_Vector abstol); -SUNDIALS_EXPORT int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); /* Rootfinding initialization */ -SUNDIALS_EXPORT int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); /* Optional input functions -- must be called AFTER ERKStepCreate */ -SUNDIALS_EXPORT int ERKStepSetDefaults(void* arkode_mem); -SUNDIALS_EXPORT int ERKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_EXPORT int ERKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_EXPORT int ERKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_EXPORT int ERKStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int ERKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int ERKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int ERKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ERKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ERKStepSetDenseOrder(void* arkode_mem, int dord); 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, sunrealtype cfl_frac); -SUNDIALS_EXPORT int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") +int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") +int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") +int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") +int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias); -SUNDIALS_EXPORT int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); -SUNDIALS_EXPORT int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); -SUNDIALS_EXPORT int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, - sunrealtype ub); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") +int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") +int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetFiARKodeBounds instead") +int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype 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, - sunrealtype etamx1); -SUNDIALS_EXPORT int ERKStepSetMaxEFailGrowth(void* arkode_mem, - sunrealtype etamxf); -SUNDIALS_EXPORT int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef); -SUNDIALS_EXPORT int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, - void* estab_data); -SUNDIALS_EXPORT int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_EXPORT int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_EXPORT int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_EXPORT int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_EXPORT int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin); -SUNDIALS_EXPORT int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin); -SUNDIALS_EXPORT int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); -SUNDIALS_EXPORT int ERKStepSetInterpolateStopTime(void* arkode_mem, - sunbooleantype interp); -SUNDIALS_EXPORT int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int ERKStepClearStopTime(void* arkode_mem); -SUNDIALS_EXPORT int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_EXPORT int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); - -SUNDIALS_EXPORT int ERKStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_EXPORT int ERKStepSetNoInactiveRootWarn(void* arkode_mem); - -SUNDIALS_EXPORT int ERKStepSetUserData(void* arkode_mem, void* user_data); - -SUNDIALS_EXPORT int ERKStepSetPostprocessStepFn(void* arkode_mem, - ARKPostProcessFn ProcessStep); -SUNDIALS_EXPORT int ERKStepSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") +int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") +int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") +int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") +int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") +int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") +int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetMaxARKodes instead") +int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetIARKode instead") +int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetARKode instead") +int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetARKode instead") +int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int ERKStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetFiARKode instead") +int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") +int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int ERKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int ERKStepSetNoInactiveRootWarn(void* arkode_mem); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int ERKStepSetUserData(void* arkode_mem, void* user_data); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetPostprocARKodeFn instead") +int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int ERKStepEvolve(void* arkode_mem, sunrealtype tout, - N_Vector yout, sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, - N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ -SUNDIALS_EXPORT int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_EXPORT int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); -SUNDIALS_EXPORT int ERKStepGetNumStepAttempts(void* arkode_mem, - long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") +int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") +int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetARKodeAttempts instead") +int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") +int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); SUNDIALS_EXPORT int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); -SUNDIALS_EXPORT int ERKStepGetNumErrTestFails(void* arkode_mem, - long int* netfails); SUNDIALS_EXPORT int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B); -SUNDIALS_EXPORT int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); -SUNDIALS_EXPORT int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, - long int* leniw); -SUNDIALS_EXPORT int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_EXPORT int ERKStepGetActualInitStep(void* arkode_mem, - sunrealtype* hinused); -SUNDIALS_EXPORT int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_EXPORT int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_EXPORT int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_EXPORT int ERKStepGetTolScaleFactor(void* arkode_mem, - sunrealtype* tolsfac); -SUNDIALS_EXPORT int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_EXPORT int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_EXPORT int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_EXPORT int ERKStepGetNumConstrFails(void* arkode_mem, - long int* nconstrfails); -SUNDIALS_EXPORT int ERKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_EXPORT int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, - SUNOutputFormat fmt); -SUNDIALS_EXPORT char* ERKStepGetReturnFlagName(long int flag); - -SUNDIALS_EXPORT int ERKStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") +int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") +int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetARKodes instead") +int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetActualIARKode instead") +int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetLARKode instead") +int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetCurrARKode instead") +int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") +int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int ERKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* ERKStepGetReturnFlagName(long int flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int ERKStepWriteParameters(void* arkode_mem, FILE* fp); SUNDIALS_EXPORT int ERKStepWriteButcher(void* arkode_mem, FILE* fp); @@ -172,43 +214,50 @@ SUNDIALS_EXPORT int ERKStepWriteButcher(void* arkode_mem, FILE* fp); SUNDIALS_EXPORT int ERKStepGetTimestepperStats( void* arkode_mem, long int* expsteps, long int* accsteps, long int* step_attempts, long int* nfevals, long int* netfails); -SUNDIALS_EXPORT int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepARKodeStats instead") +int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); /* Free function */ -SUNDIALS_EXPORT void ERKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void ERKStepFree(void** arkode_mem); /* Output the ERKStep memory structure (useful when debugging) */ -SUNDIALS_EXPORT void ERKStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void ERKStepPrintMem(void* arkode_mem, FILE* outfile); /* Relaxation functions */ -SUNDIALS_EXPORT int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, - ARKRelaxJacFn rjac); -SUNDIALS_EXPORT int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); -SUNDIALS_EXPORT int ERKStepSetRelaxLowerBound(void* arkode_mem, - sunrealtype lower); -SUNDIALS_EXPORT int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); -SUNDIALS_EXPORT int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); -SUNDIALS_EXPORT int ERKStepSetRelaxSolver(void* arkode_mem, - ARKRelaxSolver solver); -SUNDIALS_EXPORT int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); -SUNDIALS_EXPORT int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, - sunrealtype abs_tol); -SUNDIALS_EXPORT int ERKStepSetRelaxUpperBound(void* arkode_mem, - sunrealtype upper); -SUNDIALS_EXPORT int ERKStepGetNumRelaxFnEvals(void* arkode_mem, - long int* r_evals); -SUNDIALS_EXPORT int ERKStepGetNumRelaxJacEvals(void* arkode_mem, - long int* J_evals); -SUNDIALS_EXPORT int ERKStepGetNumRelaxFails(void* arkode_mem, - long int* relax_fails); -SUNDIALS_EXPORT int ERKStepGetNumRelaxBoundFails(void* arkode_mem, - long int* fails); -SUNDIALS_EXPORT int ERKStepGetNumRelaxSolveFails(void* arkode_mem, - long int* fails); -SUNDIALS_EXPORT int ERKStepGetNumRelaxSolveIters(void* arkode_mem, - long int* iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") +int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") +int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") +int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") +int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") +int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") +int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") +int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") +int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, + sunrealtype abs_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") +int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") +int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") +int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") +int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") +int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") +int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") +int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); #ifdef __cplusplus } diff --git a/include/arkode/arkode_ls.h b/include/arkode/arkode_ls.h index 8973e53ea5..ce5a6928fa 100644 --- a/include/arkode/arkode_ls.h +++ b/include/arkode/arkode_ls.h @@ -87,6 +87,42 @@ typedef int (*ARKLsMassPrecSetupFn)(sunrealtype t, void* user_data); typedef int (*ARKLsMassPrecSolveFn)(sunrealtype t, N_Vector r, N_Vector z, sunrealtype delta, int lr, void* user_data); +/* Linear solver set functions */ +SUNDIALS_EXPORT int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix A); +SUNDIALS_EXPORT int ARKodeSetMassLinearSolver(void* arkode_mem, + SUNLinearSolver LS, SUNMatrix M, + sunbooleantype time_dep); + +/* Linear solver interface optional input functions -- must be called + AFTER ARKodeSetLinearSolver and/or ARKodeSetMassLinearSolver */ +SUNDIALS_EXPORT int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac); +SUNDIALS_EXPORT int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass); +SUNDIALS_EXPORT int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj); +SUNDIALS_EXPORT int ARKodeSetLinearSolutionScaling(void* arkode_mem, + sunbooleantype onoff); +SUNDIALS_EXPORT int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_EXPORT int ARKodeSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_EXPORT int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_EXPORT int ARKodeSetMassLSNormFactor(void* arkode_mem, + sunrealtype nrmfac); +SUNDIALS_EXPORT int ARKodeSetPreconditioner(void* arkode_mem, + ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve); +SUNDIALS_EXPORT int ARKodeSetMassPreconditioner(void* arkode_mem, + ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve); +SUNDIALS_EXPORT int ARKodeSetJacTimes(void* arkode_mem, + ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes); +SUNDIALS_EXPORT int ARKodeSetJacTimesRhsFn(void* arkode_mem, + ARKRhsFn jtimesRhsFn); +SUNDIALS_EXPORT int ARKodeSetMassTimes(void* arkode_mem, + ARKLsMassTimesSetupFn msetup, + ARKLsMassTimesVecFn mtimes, + void* mtimes_data); +SUNDIALS_EXPORT int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); + #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index d4451e64c2..b4cb0c8101 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -135,170 +135,229 @@ SUNDIALS_EXPORT void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx); -SUNDIALS_EXPORT int MRIStepResize(void* arkode_mem, N_Vector ynew, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int MRIStepResize(void* arkode_mem, N_Vector ynew, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data); SUNDIALS_EXPORT int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Tolerance input functions */ -SUNDIALS_EXPORT int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, - sunrealtype abstol); -SUNDIALS_EXPORT int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, - N_Vector abstol); -SUNDIALS_EXPORT int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun); /* Linear solver set function */ -SUNDIALS_EXPORT int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix A); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") +int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); /* Rootfinding initialization */ -SUNDIALS_EXPORT int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); /* Optional input functions -- must be called AFTER MRIStepCreate */ -SUNDIALS_EXPORT int MRIStepSetDefaults(void* arkode_mem); -SUNDIALS_EXPORT int MRIStepSetOrder(void* arkode_mem, int ord); -SUNDIALS_EXPORT int MRIStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_EXPORT int MRIStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_EXPORT int MRIStepSetDenseOrder(void* arkode_mem, int dord); -SUNDIALS_EXPORT int MRIStepSetNonlinearSolver(void* arkode_mem, - SUNNonlinearSolver NLS); -SUNDIALS_EXPORT int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs); -SUNDIALS_EXPORT int MRIStepSetLinear(void* arkode_mem, int timedepend); -SUNDIALS_EXPORT int MRIStepSetNonlinear(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int MRIStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int MRIStepSetOrder(void* arkode_mem, int ord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int MRIStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int MRIStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int MRIStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") +int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") +int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") +int MRIStepSetLinear(void* arkode_mem, int timedepend); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") +int MRIStepSetNonlinear(void* arkode_mem); SUNDIALS_EXPORT int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC); -SUNDIALS_EXPORT int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_EXPORT int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); -SUNDIALS_EXPORT int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); -SUNDIALS_EXPORT int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); -SUNDIALS_EXPORT int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp); -SUNDIALS_EXPORT int MRIStepSetPredictorMethod(void* arkode_mem, int method); -SUNDIALS_EXPORT int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor); -SUNDIALS_EXPORT int MRIStepSetNonlinConvCoef(void* arkode_mem, - sunrealtype nlscoef); -SUNDIALS_EXPORT int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_EXPORT int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int MRIStepSetInterpolateStopTime(void* arkode_mem, - sunbooleantype interp); -SUNDIALS_EXPORT int MRIStepClearStopTime(void* arkode_mem); -SUNDIALS_EXPORT int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed); -SUNDIALS_EXPORT int MRIStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_EXPORT int MRIStepSetNoInactiveRootWarn(void* arkode_mem); -SUNDIALS_EXPORT int MRIStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_EXPORT int MRIStepSetPostprocessStepFn(void* arkode_mem, - ARKPostProcessFn ProcessStep); -SUNDIALS_EXPORT int MRIStepSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetMaxARKodes instead") +int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") +int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") +int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") +int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") +int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") +int MRIStepSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") +int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") +int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int MRIStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetFiARKode instead") +int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int MRIStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int MRIStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int MRIStepSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetPostprocARKodeFn instead") +int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); SUNDIALS_EXPORT int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn); SUNDIALS_EXPORT int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn); -SUNDIALS_EXPORT int MRIStepSetStagePredictFn(void* arkode_mem, - ARKStagePredictFn PredictStage); -SUNDIALS_EXPORT int MRIStepSetDeduceImplicitRhs(void* arkode_mem, - sunbooleantype deduce); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") +int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") +int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); /* Linear solver interface optional input functions -- must be called AFTER MRIStepSetLinearSolver */ -SUNDIALS_EXPORT int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); -SUNDIALS_EXPORT int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj); -SUNDIALS_EXPORT int MRIStepSetLinearSolutionScaling(void* arkode_mem, - sunbooleantype onoff); -SUNDIALS_EXPORT int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_EXPORT int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); -SUNDIALS_EXPORT int MRIStepSetPreconditioner(void* arkode_mem, - ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve); -SUNDIALS_EXPORT int MRIStepSetJacTimes(void* arkode_mem, - ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes); -SUNDIALS_EXPORT int MRIStepSetJacTimesRhsFn(void* arkode_mem, - ARKRhsFn jtimesRhsFn); -SUNDIALS_EXPORT int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") +int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") +int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") +int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") +int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") +int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") +int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") +int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") +int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") +int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int MRIStepEvolve(void* arkode_mem, sunrealtype tout, - N_Vector yout, sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, - N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); /* Utility function to update/compute y based on zcor */ -SUNDIALS_EXPORT int MRIStepComputeState(void* arkode_mem, N_Vector zcor, - N_Vector z); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") +int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); /* Optional output functions */ SUNDIALS_EXPORT int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, long int* nfsi_evals); -SUNDIALS_EXPORT int MRIStepGetNumLinSolvSetups(void* arkode_mem, - long int* nlinsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") +int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); SUNDIALS_EXPORT int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC); -SUNDIALS_EXPORT int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, - long int* leniw); -SUNDIALS_EXPORT int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps); -SUNDIALS_EXPORT int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_EXPORT int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_EXPORT int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_EXPORT int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); -SUNDIALS_EXPORT int MRIStepGetTolScaleFactor(void* arkode_mem, - sunrealtype* tolsfac); -SUNDIALS_EXPORT int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_EXPORT int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_EXPORT int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_EXPORT int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); -SUNDIALS_EXPORT int MRIStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_EXPORT int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, - SUNOutputFormat fmt); -SUNDIALS_EXPORT char* MRIStepGetReturnFlagName(long int flag); - -SUNDIALS_EXPORT int MRIStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") +int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodes instead") +int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetLARKode instead") +int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") +int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetLastInARKodeFlag instead") +int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int MRIStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* MRIStepGetReturnFlagName(long int flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int MRIStepWriteParameters(void* arkode_mem, FILE* fp); SUNDIALS_EXPORT int MRIStepWriteCoupling(void* arkode_mem, FILE* fp); /* Nonlinear solver optional output functions */ -SUNDIALS_EXPORT int MRIStepGetNonlinearSystemData( - void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, - N_Vector* F, sunrealtype* gamma, N_Vector* sdata, void** user_data); -SUNDIALS_EXPORT int MRIStepGetNumNonlinSolvIters(void* arkode_mem, - long int* nniters); -SUNDIALS_EXPORT int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, - long int* nnfails); -SUNDIALS_EXPORT int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails); -SUNDIALS_EXPORT int MRIStepGetNumStepSolveFails(void* arkode_mem, - long int* nncfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") +int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* F, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") +int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") +int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") +int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodeSolveFails instead") +int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); /* Linear solver optional output functions */ -SUNDIALS_EXPORT int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); -SUNDIALS_EXPORT int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J); -SUNDIALS_EXPORT int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J); -SUNDIALS_EXPORT int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, - long int* leniwLS); -SUNDIALS_EXPORT int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals); -SUNDIALS_EXPORT int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals); -SUNDIALS_EXPORT int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); -SUNDIALS_EXPORT int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters); -SUNDIALS_EXPORT int MRIStepGetNumLinConvFails(void* arkode_mem, - long int* nlcfails); -SUNDIALS_EXPORT int MRIStepGetNumJTSetupEvals(void* arkode_mem, - long int* njtsetups); -SUNDIALS_EXPORT int MRIStepGetNumJtimesEvals(void* arkode_mem, - long int* njvevals); -SUNDIALS_EXPORT int MRIStepGetNumLinRhsEvals(void* arkode_mem, - long int* nfevalsLS); -SUNDIALS_EXPORT int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag); - -SUNDIALS_EXPORT char* MRIStepGetLinReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") +int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") +int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetJacARKodes instead") +int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinWorkSpace instead") +int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, + long int* leniwLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") +int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") +int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") +int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") +int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") +int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") +int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") +int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") +int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") +int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") +char* MRIStepGetLinReturnFlagName(long int flag); /* Free function */ -SUNDIALS_EXPORT void MRIStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void MRIStepFree(void** arkode_mem); /* Output the MRIStep memory structure (useful when debugging) */ -SUNDIALS_EXPORT void MRIStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void MRIStepPrintMem(void* arkode_mem, FILE* outfile); /* Custom inner stepper functions */ SUNDIALS_EXPORT int MRIStepInnerStepper_Create(SUNContext sunctx, diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index a8f6c3a4df..f3e8f333b2 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -48,67 +48,90 @@ SUNDIALS_EXPORT void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, SUNDIALS_EXPORT int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); /* Rootfinding functions */ /* Rootfinding initialization */ -SUNDIALS_EXPORT int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); /* Optional input functions -- must be called AFTER SPRKStepCreate */ -SUNDIALS_EXPORT int SPRKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int SPRKStepSetDefaults(void* arkode_mem); SUNDIALS_EXPORT int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage); SUNDIALS_EXPORT int SPRKStepSetMethodName(void* arkode_mem, const char* method); -SUNDIALS_EXPORT int SPRKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_EXPORT int SPRKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_EXPORT int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_EXPORT int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_EXPORT int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_EXPORT int SPRKStepSetUserData(void* arkode_mem, void* user_data); - -SUNDIALS_EXPORT int SPRKStepSetPostprocessStepFn(void* arkode_mem, - ARKPostProcessFn ProcessStep); -SUNDIALS_EXPORT int SPRKStepSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int SPRKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int SPRKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int SPRKStepSetUserData(void* arkode_mem, void* user_data); + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int SPRKStepSetPostprocessStageFn(void* arkode_mem, + ARKPostProcessFn ProcessStage); /* Integrate the ODE over an interval in t */ -SUNDIALS_EXPORT int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, - N_Vector yout, sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); /* Computes the kth derivative of the y function at time t */ -SUNDIALS_EXPORT int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, - N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); /* Optional output functions */ -SUNDIALS_EXPORT char* SPRKStepGetReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* SPRKStepGetReturnFlagName(long int flag); SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage); -SUNDIALS_EXPORT int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_EXPORT int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_EXPORT int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_EXPORT int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") +int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); SUNDIALS_EXPORT int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); -SUNDIALS_EXPORT int SPRKStepGetNumStepAttempts(void* arkode_mem, - long int* step_attempts); -SUNDIALS_EXPORT int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_EXPORT int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_EXPORT int SPRKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_EXPORT int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, - SUNOutputFormat fmt); -SUNDIALS_EXPORT int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") +int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int SPRKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); /* Grouped optional output functions */ -SUNDIALS_EXPORT int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") +int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); /* Free function */ -SUNDIALS_EXPORT void SPRKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void SPRKStepFree(void** arkode_mem); #ifdef __cplusplus } diff --git a/include/arkode/arkode_xbraid.h b/include/arkode/arkode_xbraid.h index e3cf93c213..6ce4df639d 100644 --- a/include/arkode/arkode_xbraid.h +++ b/include/arkode/arkode_xbraid.h @@ -57,13 +57,19 @@ SUNDIALS_EXPORT int ARKBraid_SetAccessFn(braid_App app, braid_PtFcnAccess access SUNDIALS_EXPORT int ARKBraid_GetVecTmpl(braid_App app, N_Vector* tmpl); -SUNDIALS_EXPORT int ARKBraid_GetARKStepMem(braid_App app, void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKBraid_GetARKodeMem instead") +int ARKBraid_GetARKStepMem(braid_App app, void** arkode_mem); + +SUNDIALS_EXPORT int ARKBraid_GetARKodeMem(braid_App app, void** arkode_mem); SUNDIALS_EXPORT int ARKBraid_GetUserData(braid_App app, void** user_data); SUNDIALS_EXPORT int ARKBraid_GetLastBraidFlag(braid_App app, int* last_flag); -SUNDIALS_EXPORT int ARKBraid_GetLastARKStepFlag(braid_App app, int* last_flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKBraid_GetLastARKodeFlag instead") +int ARKBraid_GetLastARKStepFlag(braid_App app, int* last_flag); + +SUNDIALS_EXPORT int ARKBraid_GetLastARKodeFlag(braid_App app, int* last_flag); SUNDIALS_EXPORT int ARKBraid_GetSolution(braid_App app, sunrealtype* tout, N_Vector yout); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index ad7e70e554..17ea0a0531 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -83,19 +83,54 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->uround = SUN_UNIT_ROUNDOFF; /* Initialize time step module to NULL */ - ark_mem->step_attachlinsol = NULL; - ark_mem->step_attachmasssol = NULL; - ark_mem->step_disablelsetup = NULL; - ark_mem->step_disablemsetup = NULL; - ark_mem->step_getlinmem = NULL; - ark_mem->step_getmassmem = NULL; - ark_mem->step_getimplicitrhs = NULL; - ark_mem->step_mmult = NULL; - ark_mem->step_getgammas = NULL; - ark_mem->step_init = NULL; - ark_mem->step_fullrhs = NULL; - ark_mem->step = NULL; - ark_mem->step_mem = NULL; + ark_mem->step_attachlinsol = NULL; + ark_mem->step_attachmasssol = NULL; + ark_mem->step_disablelsetup = NULL; + ark_mem->step_disablemsetup = NULL; + ark_mem->step_getlinmem = NULL; + ark_mem->step_getmassmem = NULL; + ark_mem->step_getimplicitrhs = NULL; + ark_mem->step_mmult = NULL; + ark_mem->step_getgammas = NULL; + ark_mem->step_init = NULL; + ark_mem->step_fullrhs = NULL; + ark_mem->step = NULL; + ark_mem->step_setuserdata = NULL; + ark_mem->step_printallstats = NULL; + ark_mem->step_writeparameters = NULL; + ark_mem->step_resize = NULL; + ark_mem->step_reset = NULL; + ark_mem->step_free = NULL; + ark_mem->step_printmem = NULL; + ark_mem->step_setdefaults = NULL; + ark_mem->step_computestate = NULL; + ark_mem->step_setrelaxfn = NULL; + ark_mem->step_setorder = NULL; + ark_mem->step_setnonlinearsolver = NULL; + ark_mem->step_setlinear = NULL; + ark_mem->step_setnonlinear = NULL; + ark_mem->step_setnlsrhsfn = NULL; + ark_mem->step_setdeduceimplicitrhs = NULL; + ark_mem->step_setnonlincrdown = NULL; + ark_mem->step_setnonlinrdiv = NULL; + ark_mem->step_setdeltagammamax = NULL; + ark_mem->step_setlsetupfrequency = NULL; + ark_mem->step_setpredictormethod = NULL; + ark_mem->step_setmaxnonliniters = NULL; + ark_mem->step_setnonlinconvcoef = NULL; + ark_mem->step_setstagepredictfn = NULL; + ark_mem->step_getnumlinsolvsetups = NULL; + ark_mem->step_getestlocalerrors = NULL; + ark_mem->step_getcurrentgamma = NULL; + ark_mem->step_getnonlinearsystemdata = NULL; + ark_mem->step_getnumnonlinsolviters = NULL; + ark_mem->step_getnumnonlinsolvconvfails = NULL; + ark_mem->step_getnonlinsolvstats = NULL; + ark_mem->step_mem = NULL; + ark_mem->step_supports_adaptive = SUNFALSE; + ark_mem->step_supports_implicit = SUNFALSE; + ark_mem->step_supports_massmatrix = SUNFALSE; + ark_mem->step_supports_relaxation = SUNFALSE; /* Initialize root finding variables */ ark_mem->root_mem = NULL; @@ -110,7 +145,7 @@ ARKodeMem arkCreate(SUNContext sunctx) /* Initialize lrw and liw */ ark_mem->lrw = 18; - ark_mem->liw = 41; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ + ark_mem->liw = 53; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ /* No mallocs have been done yet */ ark_mem->VabstolMallocDone = SUNFALSE; @@ -133,7 +168,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Allocation of step adaptivity structure failed"); - arkFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } ark_mem->lrw += ARK_ADAPT_LRW; @@ -145,7 +180,7 @@ ARKodeMem arkCreate(SUNContext sunctx) { arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Allocation of step controller object failed"); - arkFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } ark_mem->hadapt_mem->owncontroller = SUNTRUE; @@ -177,12 +212,12 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->h0u = ZERO; /* Set default values for integrator optional inputs */ - iret = arkSetDefaults(ark_mem); + iret = ARKodeSetDefaults(ark_mem); if (iret != ARK_SUCCESS) { arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, "Error setting default solver options"); - arkFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -191,15 +226,15 @@ ARKodeMem arkCreate(SUNContext sunctx) } /*--------------------------------------------------------------- - arkResize: + ARKodeResize: - arkResize re-initializes ARKODE's memory for a problem with a + ARKodeResize re-initializes ARKODE's memory for a problem with a changing vector size. It is assumed that the problem dynamics before and after the vector resize will be comparable, so that - all time-stepping heuristics prior to calling arkResize + all time-stepping heuristics prior to calling ARKodeResize remain valid after the call. If instead the dynamics should be re-calibrated, the ARKODE memory structure should be deleted - with a call to *StepFree, and re-created with a call to + with a call to ARKodeFree, and re-created with a call to *StepCreate. To aid in the vector-resize operation, the user can supply a @@ -227,20 +262,22 @@ ARKodeMem arkCreate(SUNContext sunctx) The return value is ARK_SUCCESS = 0 if no errors occurred, or a negative value otherwise. ---------------------------------------------------------------*/ -int arkResize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int ARKodeResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { sunbooleantype resizeOK; sunindextype lrw1, liw1, lrw_diff, liw_diff; int retval; + ARKodeMem ark_mem; /* Check ark_mem */ - if (ark_mem == NULL) + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; /* Check if ark_mem was allocated */ if (ark_mem->MallocDone == SUNFALSE) @@ -327,37 +364,81 @@ int arkResize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, ark_mem->init_type = RESIZE_INIT; ark_mem->firststage = SUNTRUE; + /* Call the stepper-specific resize (if provided) */ + if (ark_mem->step_resize) + { + return (ark_mem->step_resize(ark_mem, y0, hscale, t0, resize, resize_data)); + } + /* Problem has been successfully re-sized */ return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkSStolerances, arkSVtolerances, arkWFtolerances: + ARKodeReset: + + This routine resets an ARKode module to solve the same + problem from the given time with the input state (all counter + values are retained). + ---------------------------------------------------------------*/ +int ARKodeReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + ARKodeMem ark_mem; + int retval; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Reset main ARKODE infrastructure */ + retval = arkInit(ark_mem, tR, yR, RESET_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "ARKode reset failure"); + return (retval); + } + + /* Call stepper routine to perform remaining reset operations (if provided) */ + if (ark_mem->step_reset) { return (ark_mem->step_reset(ark_mem, tR, yR)); } + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeSStolerances, ARKodeSVtolerances, ARKodeWFtolerances: These functions specify the integration tolerances. One of them - SHOULD be called before the first call to arkEvolve; otherwise + SHOULD be called before the first call to ARKodeEvolve; otherwise default values of reltol=1e-4 and abstol=1e-9 will be used, which may be entirely incorrect for a specific problem. - arkSStolerances specifies scalar relative and absolute + ARKodeSStolerances specifies scalar relative and absolute tolerances. - arkSVtolerances specifies scalar relative tolerance and a + ARKodeSVtolerances specifies scalar relative tolerance and a vector absolute tolerance (a potentially different absolute tolerance for each vector component). - arkWFtolerances specifies a user-provides function (of type + ARKodeWFtolerances specifies a user-provides function (of type ARKEwtFn) which will be called to set the error weight vector. ---------------------------------------------------------------*/ -int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol) +int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) { - /* Check inputs */ - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Check inputs */ if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -393,18 +474,22 @@ int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol) return (ARK_SUCCESS); } -int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol) +int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) { /* local variables */ sunrealtype abstolmin; - /* Check inputs */ - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Check inputs */ if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -463,14 +548,18 @@ int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol) return (ARK_SUCCESS); } -int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun) +int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) { - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -488,7 +577,7 @@ int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun) } /*--------------------------------------------------------------- - arkResStolerance, arkResVtolerance, arkResFtolerance: + ARKodeResStolerance, ARKodeResVtolerance, ARKodeResFtolerance: These functions specify the absolute residual tolerance. Specification of the absolute residual tolerance is only @@ -499,25 +588,37 @@ int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun) ARKODE; otherwise the default value of rabstol=1e-9 will be used, which may be entirely incorrect for a specific problem. - arkResStolerances specifies a scalar residual tolerance. + ARKodeResStolerances specifies a scalar residual tolerance. - arkResVtolerances specifies a vector residual tolerance + ARKodeResVtolerances specifies a vector residual tolerance (a potentially different absolute residual tolerance for each vector component). - arkResFtolerances specifies a user-provides function (of + ARKodeResFtolerances specifies a user-provides function (of type ARKRwtFn) which will be called to set the residual weight vector. ---------------------------------------------------------------*/ -int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol) +int ARKodeResStolerance(void* arkode_mem, sunrealtype rabstol) { - /* Check inputs */ - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Check inputs */ if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -559,18 +660,30 @@ int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol) return (ARK_SUCCESS); } -int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol) +int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol) { /* local variables */ sunrealtype rabstolmin; - /* Check inputs */ - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Check inputs */ if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -635,14 +748,26 @@ int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol) return (ARK_SUCCESS); } -int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun) +int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) { - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (ark_mem->MallocDone == SUNFALSE) { arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, @@ -673,17 +798,17 @@ int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun) } /*--------------------------------------------------------------- - arkEvolve: + ARKodeEvolve: This routine is the main driver of ARKODE-based integrators. It integrates over a time interval defined by the user, by calling the time step module to do internal time steps. - The first time that arkEvolve is called for a successfully + The first time that ARKodeEvolve is called for a successfully initialized problem, it computes a tentative initial step size. - arkEvolve supports two modes as specified by itask: ARK_NORMAL and + ARKodeEvolve supports two modes as specified by itask: ARK_NORMAL and ARK_ONE_STEP. In the ARK_NORMAL mode, the solver steps until it reaches or passes tout and then interpolates to obtain y(tout). In the ARK_ONE_STEP mode, it takes one internal step @@ -694,8 +819,8 @@ int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun) exactly the specified stop time, and hence interpolation of y(tout) is not required. ---------------------------------------------------------------*/ -int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) +int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) { long int nstloc; int retval, kflag, istate, ir; @@ -705,16 +830,18 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, sunrealtype dsm; int nflag, attempts, ncf, nef, constrfails; int relax_fails; + ARKodeMem ark_mem; /* Check and process inputs */ /* Check if ark_mem exists */ - if (ark_mem == NULL) + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; /* Check if ark_mem was allocated */ if (ark_mem->MallocDone == SUNFALSE) @@ -748,6 +875,9 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, return (ARK_ILL_INPUT); } + /* start profiler */ + SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); + /* store copy of itask if using root-finding */ if (ark_mem->root_mem != NULL) { @@ -762,7 +892,11 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, { ark_mem->tretlast = *tret = ark_mem->tcur; retval = arkInitialSetup(ark_mem, tout); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); + return (retval); + } } /* perform stopping tests */ @@ -770,6 +904,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, { if (arkStopTests(ark_mem, tout, yout, tret, itask, &retval)) { + SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); return (retval); } } @@ -923,7 +1058,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, ark_mem->nst_attempts++; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkEvolve", + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::ARKodeEvolve", "start-step", "step = %li, attempt = %i, h = %" RSYM ", tcur = %" RSYM, @@ -988,6 +1123,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, /* unsuccessful step, if |h| = hmin, return ARK_ERR_FAILURE */ if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) { + SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); return (ARK_ERR_FAILURE); } @@ -1072,7 +1208,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, { if (ark_mem->tstopinterp) { - retval = arkGetDky(ark_mem, ark_mem->tstop, 0, yout); + retval = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, @@ -1101,7 +1237,7 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, /* In NORMAL mode, check if tout reached */ if ((itask == ARK_NORMAL) && (ark_mem->tcur - tout) * ark_mem->h >= ZERO) { - retval = arkGetDky(ark_mem, tout, 0, yout); + retval = ARKodeGetDky(ark_mem, tout, 0, yout); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, @@ -1127,11 +1263,13 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, } /* end looping for internal steps */ + /* stop profiler and return */ + SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); return (istate); } /*--------------------------------------------------------------- - arkGetDky: + ARKodeGetDky: This routine computes the k-th derivative of the interpolating polynomial at the time t and stores the result in the vector @@ -1143,25 +1281,29 @@ int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, the user through deg, unless higher-order derivatives are requested. - This function is called by arkEvolve with k=0 and t=tout to + This function is called by ARKodeEvolve with k=0 and t=tout to perform interpolation of outputs, but may also be called indirectly by the user via time step module *StepGetDky calls. Note: in all cases it will be called after ark_tcur has been updated to correspond with the end time of the last successful step. ---------------------------------------------------------------*/ -int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky) +int ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) { sunrealtype s, tfuzz, tp, tn1; int retval; + ARKodeMem ark_mem; - /* Check all inputs for legality */ - if (ark_mem == NULL) + /* Check if ark_mem exists */ + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; + + /* Check all inputs for legality */ if (dky == NULL) { arkProcessError(ark_mem, ARK_BAD_DKY, __LINE__, __func__, __FILE__, @@ -1203,11 +1345,11 @@ int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky) } /*--------------------------------------------------------------- - arkFree: + ARKodeFree: This routine frees the ARKODE infrastructure memory. ---------------------------------------------------------------*/ -void arkFree(void** arkode_mem) +void ARKodeFree(void** arkode_mem) { ARKodeMem ark_mem; @@ -1215,6 +1357,9 @@ void arkFree(void** arkode_mem) ark_mem = (ARKodeMem)(*arkode_mem); + /* free the time-stepper module memory (if provided) */ + if (ark_mem->step_free) { ark_mem->step_free(ark_mem); } + /* free vector storage */ arkFreeVectors(ark_mem); @@ -1241,7 +1386,7 @@ void arkFree(void** arkode_mem) /* free the root-finding module */ if (ark_mem->root_mem != NULL) { - (void)arkRootFree(*arkode_mem); + (void)arkRootFree(ark_mem); ark_mem->root_mem = NULL; } @@ -1324,7 +1469,7 @@ int arkRwtSet(N_Vector y, N_Vector weight, void* data) initialization, an error flag is returned. Otherwise, it returns ARK_SUCCESS. This routine should be called by an ARKODE timestepper module (not by the user). This routine must be - called prior to calling arkEvolve to evolve the problem. The + called prior to calling ARKodeEvolve to evolve the problem. The initialization type indicates if the values of internal counters should be reinitialized (FIRST_INIT) or retained (RESET_INIT). ---------------------------------------------------------------*/ @@ -1476,13 +1621,27 @@ int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) } /*--------------------------------------------------------------- - arkPrintMem: + ARKodePrintMem: This routine outputs the ark_mem structure to a specified file pointer. ---------------------------------------------------------------*/ -void arkPrintMem(ARKodeMem ark_mem, FILE* outfile) +void ARKodePrintMem(void* arkode_mem, FILE* outfile) { + ARKodeMem ark_mem; + + /* Check if ark_mem exists */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return; + } + ark_mem = (ARKodeMem)arkode_mem; + + /* if outfile==NULL, set it to stdout */ + if (outfile == NULL) { outfile = stdout; } + /* output general values */ fprintf(outfile, "itol = %i\n", ark_mem->itol); fprintf(outfile, "ritol = %i\n", ark_mem->ritol); @@ -1576,6 +1735,9 @@ void arkPrintMem(ARKodeMem ark_mem, FILE* outfile) fprintf(outfile, "constraints:\n"); N_VPrintFile(ark_mem->constraints, outfile); #endif + + /* Call stepper PrintMem function (if provided) */ + if (ark_mem->step_printmem) { ark_mem->step_printmem(ark_mem, outfile); } } /*--------------------------------------------------------------- @@ -2311,7 +2473,7 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, { if (ark_mem->tstopinterp) { - *ier = arkGetDky(ark_mem, ark_mem->tstop, 0, yout); + *ier = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); if (*ier != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -2341,7 +2503,7 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, if ((itask == ARK_NORMAL) && ((ark_mem->tcur - tout) * ark_mem->h >= ZERO)) { ark_mem->tretlast = *tret = tout; - *ier = arkGetDky(ark_mem, tout, 0, yout); + *ier = ARKodeGetDky(ark_mem, tout, 0, yout); if (*ier != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -2372,7 +2534,7 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, This routine computes a tentative initial step size h0. If tout is too close to tn (= t0), then arkHin returns ARK_TOO_CLOSE and h remains uninitialized. Note that here tout - is either the value passed to arkEvolve at the first call or the + is either the value passed to ARKodeEvolve at the first call or the value of tstop (if tstop is enabled and it is closer to t0=tn than tout). If the RHS function fails unrecoverably, arkHin returns ARK_RHSFUNC_FAIL. If the RHS function fails recoverably @@ -3250,8 +3412,8 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, larger/smaller than current step, depending on dsm) */ ttmp = (dsm <= ONE) ? ark_mem->tn + ark_mem->h : ark_mem->tn; nsttmp = (dsm <= ONE) ? ark_mem->nst + 1 : ark_mem->nst; - retval = arkAdapt((void*)ark_mem, hadapt_mem, ark_mem->ycur, ttmp, ark_mem->h, - dsm, nsttmp); + retval = arkAdapt(ark_mem, hadapt_mem, ark_mem->ycur, ttmp, 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 diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index e10db72d5a..5d6896a46f 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -37,7 +37,7 @@ ARKodeHAdaptMem arkAdaptInit(void) hadapt_mem = (ARKodeHAdaptMem)malloc(sizeof(struct ARKodeHAdaptMemRec)); if (hadapt_mem == NULL) { return (NULL); } - /* initialize values (default parameters are set in arkSetDefaults) */ + /* initialize values (default parameters are set in ARKodeSetDefaults) */ memset(hadapt_mem, 0, sizeof(struct ARKodeHAdaptMemRec)); hadapt_mem->nst_acc = 0; hadapt_mem->nst_exp = 0; @@ -91,20 +91,12 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE* outfile) computes and sets the value of ark_eta inside of the ARKodeMem data structure. ---------------------------------------------------------------*/ -int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, +int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, sunrealtype tcur, sunrealtype hcur, sunrealtype dsm, long int nst) { int retval; sunrealtype h_acc, h_cfl, int_dir; - ARKodeMem ark_mem; int controller_order; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; /* Request error-based step size from adaptivity controller */ if (hadapt_mem->pq == 0) diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 9f96027ca4..757be20da1 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -22,6 +22,8 @@ #include <stdarg.h> #include <sundials/sundials_adaptcontroller.h> +#include "arkode_types_impl.h" + #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { #endif @@ -108,7 +110,7 @@ typedef struct ARKodeHAdaptMemRec ARKodeHAdaptMem arkAdaptInit(void); void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE* outfile); -int arkAdapt(void* arkode_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, +int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, sunrealtype tcur, sunrealtype hcur, sunrealtype dsm, long int nst); #ifdef __cplusplus diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 0d7fc94394..81a4a12b3f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -89,33 +89,67 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } memset(step_mem, 0, sizeof(struct ARKodeARKStepMemRec)); /* Attach step_mem structure and function pointers to ark_mem */ - ark_mem->step_attachlinsol = arkStep_AttachLinsol; - ark_mem->step_attachmasssol = arkStep_AttachMasssol; - ark_mem->step_disablelsetup = arkStep_DisableLSetup; - ark_mem->step_disablemsetup = arkStep_DisableMSetup; - ark_mem->step_getlinmem = arkStep_GetLmem; - ark_mem->step_getmassmem = arkStep_GetMassMem; - ark_mem->step_getimplicitrhs = arkStep_GetImplicitRHS; - ark_mem->step_mmult = NULL; - ark_mem->step_getgammas = arkStep_GetGammas; - ark_mem->step_init = arkStep_Init; - ark_mem->step_fullrhs = arkStep_FullRHS; - ark_mem->step = arkStep_TakeStep_Z; - ark_mem->step_mem = (void*)step_mem; - - /* Set default values for ARKStep optional inputs */ - retval = ARKStepSetDefaults((void*)ark_mem); + ark_mem->step_attachlinsol = arkStep_AttachLinsol; + ark_mem->step_attachmasssol = arkStep_AttachMasssol; + ark_mem->step_disablelsetup = arkStep_DisableLSetup; + ark_mem->step_disablemsetup = arkStep_DisableMSetup; + ark_mem->step_getlinmem = arkStep_GetLmem; + ark_mem->step_getmassmem = arkStep_GetMassMem; + ark_mem->step_getimplicitrhs = arkStep_GetImplicitRHS; + ark_mem->step_mmult = NULL; + ark_mem->step_getgammas = arkStep_GetGammas; + ark_mem->step_init = arkStep_Init; + ark_mem->step_fullrhs = arkStep_FullRHS; + ark_mem->step = arkStep_TakeStep_Z; + ark_mem->step_setuserdata = arkStep_SetUserData; + ark_mem->step_printallstats = arkStep_PrintAllStats; + ark_mem->step_writeparameters = arkStep_WriteParameters; + ark_mem->step_resize = arkStep_Resize; + ark_mem->step_free = arkStep_Free; + ark_mem->step_printmem = arkStep_PrintMem; + ark_mem->step_setdefaults = arkStep_SetDefaults; + ark_mem->step_computestate = arkStep_ComputeState; + ark_mem->step_setrelaxfn = arkStep_SetRelaxFn; + ark_mem->step_setorder = arkStep_SetOrder; + ark_mem->step_setnonlinearsolver = arkStep_SetNonlinearSolver; + ark_mem->step_setlinear = arkStep_SetLinear; + ark_mem->step_setnonlinear = arkStep_SetNonlinear; + ark_mem->step_setnlsrhsfn = arkStep_SetNlsRhsFn; + ark_mem->step_setdeduceimplicitrhs = arkStep_SetDeduceImplicitRhs; + ark_mem->step_setnonlincrdown = arkStep_SetNonlinCRDown; + ark_mem->step_setnonlinrdiv = arkStep_SetNonlinRDiv; + ark_mem->step_setdeltagammamax = arkStep_SetDeltaGammaMax; + ark_mem->step_setlsetupfrequency = arkStep_SetLSetupFrequency; + ark_mem->step_setpredictormethod = arkStep_SetPredictorMethod; + ark_mem->step_setmaxnonliniters = arkStep_SetMaxNonlinIters; + ark_mem->step_setnonlinconvcoef = arkStep_SetNonlinConvCoef; + ark_mem->step_setstagepredictfn = arkStep_SetStagePredictFn; + ark_mem->step_getnumlinsolvsetups = arkStep_GetNumLinSolvSetups; + ark_mem->step_getcurrentgamma = arkStep_GetCurrentGamma; + ark_mem->step_getestlocalerrors = arkStep_GetEstLocalErrors; + ark_mem->step_getnonlinearsystemdata = arkStep_GetNonlinearSystemData; + ark_mem->step_getnumnonlinsolviters = arkStep_GetNumNonlinSolvIters; + ark_mem->step_getnumnonlinsolvconvfails = arkStep_GetNumNonlinSolvConvFails; + ark_mem->step_getnonlinsolvstats = arkStep_GetNonlinSolvStats; + ark_mem->step_supports_adaptive = SUNTRUE; + ark_mem->step_supports_implicit = SUNTRUE; + ark_mem->step_supports_massmatrix = SUNTRUE; + ark_mem->step_supports_relaxation = SUNTRUE; + ark_mem->step_mem = (void*)step_mem; + + /* Set default values for optional inputs */ + retval = arkStep_SetDefaults((void*)ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -130,17 +164,17 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, /* Clone the input vector to create sdata, zpred and zcor */ if (!arkAllocVec(ark_mem, y0, &(step_mem->sdata))) { - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } if (!arkAllocVec(ark_mem, y0, &(step_mem->zpred))) { - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } if (!arkAllocVec(ark_mem, y0, &(step_mem->zcor))) { - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -161,15 +195,15 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error creating default Newton solver"); - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } - retval = ARKStepSetNonlinearSolver(ark_mem, NLS); + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error attaching default Newton solver"); - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } step_mem->ownNLS = SUNTRUE; @@ -221,7 +255,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - ARKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -229,26 +263,23 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, } /*--------------------------------------------------------------- - ARKStepResize: + arkStep_Resize: This routine resizes the memory within the ARKStep module. - It first resizes the main ARKODE infrastructure memory, and - then resizes its own data. ---------------------------------------------------------------*/ -int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; SUNNonlinearSolver NLS; sunindextype lrw1, liw1, lrw_diff, liw_diff; int i, retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Determing change in vector sizes */ + /* Determine change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -256,15 +287,6 @@ int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, ark_mem->lrw1 = lrw1; ark_mem->liw1 = liw1; - /* resize ARKODE infrastructure memory */ - retval = arkResize(ark_mem, y0, hscale, t0, resize, resize_data); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to resize main ARKODE infrastructure"); - return (retval); - } - /* Resize the sdata, zpred and zcor vectors */ if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, &step_mem->sdata)) @@ -339,8 +361,8 @@ int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, return (ARK_MEM_FAIL); } - /* attach new Newton NLS object to ARKStep */ - retval = ARKStepSetNonlinearSolver(ark_mem, NLS); + /* attach new Newton NLS object */ + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, @@ -374,8 +396,8 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -432,209 +454,17 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, } /*--------------------------------------------------------------- - ARKStepReset: - - This routine resets the ARKStep module state to solve the same - problem from the given time with the input state (all counter - values are retained). - ---------------------------------------------------------------*/ -int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Initialize main ARKODE infrastructure */ - retval = arkInit(ark_mem, tR, yR, RESET_INIT); - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to initialize main ARKODE infrastructure"); - return (retval); - } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSStolerances, ARKStepSVtolerances, ARKStepWFtolerances, - ARKStepResStolerance, ARKStepResVtolerance, ARKStepResFtolerance: - - These routines set integration tolerances (wrappers for general - ARKODE utility routines) - ---------------------------------------------------------------*/ -int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - /* unpack ark_mem, call arkSStolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSStolerances(ark_mem, reltol, abstol)); -} - -int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - /* unpack ark_mem, call arkSVtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSVtolerances(ark_mem, reltol, abstol)); -} - -int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - /* unpack ark_mem, call arkWFtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkWFtolerances(ark_mem, efun)); -} - -int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) -{ - /* unpack ark_mem, call arkResStolerance, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkResStolerance(ark_mem, rabstol)); -} - -int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) -{ - /* unpack ark_mem, call arkResVtolerance, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkResVtolerance(ark_mem, rabstol)); -} - -int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) -{ - /* unpack ark_mem, call arkResFtolerance, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkResFtolerance(ark_mem, rfun)); -} - -/*--------------------------------------------------------------- - ARKStepRootInit: - - Initialize (attach) a rootfinding problem to the stepper - (wrappers for general ARKODE utility routine) - ---------------------------------------------------------------*/ -int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - /* unpack ark_mem, call arkRootInit, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkRootInit(ark_mem, nrtfn, g)); -} - -/*--------------------------------------------------------------- - ARKStepEvolve: - - This is the main time-integration driver (wrappers for general - ARKODE utility routine) - ---------------------------------------------------------------*/ -int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - /* unpack ark_mem, call arkEvolve, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkEvolve(ark_mem, tout, yout, tret, itask); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - ARKStepGetDky: - - This returns interpolated output of the solution or its - derivatives over the most-recently-computed step (wrapper for - generic ARKODE utility routine) - ---------------------------------------------------------------*/ -int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - /* unpack ark_mem, call arkGetDky, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkGetDky(ark_mem, t, k, dky); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - ARKStepComputeState: + arkStep_ComputeState: Computes y based on the current prediction and given correction. ---------------------------------------------------------------*/ -int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +int arkStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) { int retval; - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, z); @@ -643,21 +473,18 @@ int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) } /*--------------------------------------------------------------- - ARKStepFree frees all ARKStep memory, and then calls an ARKODE - utility routine to free the ARKODE infrastructure memory. + arkStep_Free frees all ARKStep memory. ---------------------------------------------------------------*/ -void ARKStepFree(void** arkode_mem) +void arkStep_Free(ARKodeMem ark_mem) { int j; sunindextype Bliw, Blrw; - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - /* nothing to do if arkode_mem is already NULL */ - if (*arkode_mem == NULL) { return; } + /* nothing to do if ark_mem is already NULL */ + if (ark_mem == NULL) { return; } /* conditional frees on non-NULL ARKStep module */ - ark_mem = (ARKodeMem)(*arkode_mem); if (ark_mem->step_mem != NULL) { step_mem = (ARKodeARKStepMem)ark_mem->step_mem; @@ -787,21 +614,16 @@ void ARKStepFree(void** arkode_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } - - /* free memory for overall ARKODE infrastructure */ - arkFree(arkode_mem); } /*--------------------------------------------------------------- - ARKStepPrintMem: + arkStep_PrintMem: - This routine outputs the memory from the ARKStep structure and - the main ARKODE infrastructure to a specified file pointer - (useful when debugging). + This routine outputs the memory from the ARKStep structure to + a specified file pointer (useful when debugging). ---------------------------------------------------------------*/ -void ARKStepPrintMem(void* arkode_mem, FILE* outfile) +void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; @@ -810,15 +632,9 @@ void ARKStepPrintMem(void* arkode_mem, FILE* outfile) #endif /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return; } - /* if outfile==NULL, set it to stdout */ - if (outfile == NULL) { outfile = stdout; } - - /* output data from main ARKODE infrastructure */ - arkPrintMem(ark_mem, outfile); - /* output integer quantities */ fprintf(outfile, "ARKStep: q = %i\n", step_mem->q); fprintf(outfile, "ARKStep: p = %i\n", step_mem->p); @@ -904,21 +720,20 @@ void ARKStepPrintMem(void* arkode_mem, FILE* outfile) interface routines, data structure, and solver type to the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, +int arkStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing system solver */ - if (step_mem->lfree != NULL) { step_mem->lfree(arkode_mem); } + if (step_mem->lfree != NULL) { step_mem->lfree(ark_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->linit = linit; @@ -942,22 +757,21 @@ int arkStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, interface routines, data structure, and solver type to the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_AttachMasssol(void* arkode_mem, ARKMassInitFn minit, +int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void* mass_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing mass matrix solver */ - if (step_mem->mfree != NULL) { step_mem->mfree(arkode_mem); } + if (step_mem->mfree != NULL) { step_mem->mfree(ark_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->minit = minit; @@ -981,14 +795,11 @@ int arkStep_AttachMasssol(void* arkode_mem, ARKMassInitFn minit, This routine NULLifies the lsetup function pointer in the ARKStep module. ---------------------------------------------------------------*/ -void arkStep_DisableLSetup(void* arkode_mem) +void arkStep_DisableLSetup(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; /* access ARKodeARKStepMem structure */ - if (arkode_mem == NULL) { return; } - ark_mem = (ARKodeMem)arkode_mem; if (ark_mem->step_mem == NULL) { return; } step_mem = (ARKodeARKStepMem)ark_mem->step_mem; @@ -1002,14 +813,11 @@ void arkStep_DisableLSetup(void* arkode_mem) This routine NULLifies the msetup function pointer in the ARKStep module. ---------------------------------------------------------------*/ -void arkStep_DisableMSetup(void* arkode_mem) +void arkStep_DisableMSetup(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; /* access ARKodeARKStepMem structure */ - if (arkode_mem == NULL) { return; } - ark_mem = (ARKodeMem)arkode_mem; if (ark_mem->step_mem == NULL) { return; } step_mem = (ARKodeARKStepMem)ark_mem->step_mem; @@ -1023,14 +831,13 @@ void arkStep_DisableMSetup(void* arkode_mem) This routine returns the system linear solver interface memory structure, lmem. ---------------------------------------------------------------*/ -void* arkStep_GetLmem(void* arkode_mem) +void* arkStep_GetLmem(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return lmem */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->lmem); } @@ -1041,14 +848,13 @@ void* arkStep_GetLmem(void* arkode_mem) This routine returns the mass matrix solver interface memory structure, mass_mem. ---------------------------------------------------------------*/ -void* arkStep_GetMassMem(void* arkode_mem) +void* arkStep_GetMassMem(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return mass_mem */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->mass_mem); } @@ -1058,14 +864,13 @@ void* arkStep_GetMassMem(void* arkode_mem) This routine returns the implicit RHS function pointer, fi. ---------------------------------------------------------------*/ -ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem) +ARKRhsFn arkStep_GetImplicitRHS(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure, and return fi */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->fi); } @@ -1076,15 +881,14 @@ ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int arkStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, +int arkStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set outputs */ @@ -1131,15 +935,14 @@ int arkStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, With initialization type RESET_INIT, this routine does nothing. ---------------------------------------------------------------*/ -int arkStep_Init(void* arkode_mem, int init_type) +int arkStep_Init(ARKodeMem ark_mem, int init_type) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int j, retval; sunbooleantype reset_efun; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -1445,10 +1248,9 @@ int arkStep_Init(void* arkode_mem, int init_type) 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, sunrealtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int nvec, retval; sunbooleantype recomputeRHS; @@ -1457,7 +1259,7 @@ int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, sunrealtype stage_coefs = ONE; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* local shortcuts for use with fused vector operations */ @@ -1815,19 +1617,18 @@ int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) +int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { int retval, is, is_start, mode; sunbooleantype implicit_stage; sunbooleantype deduce_stage; sunbooleantype save_stages; sunbooleantype stiffly_accurate; - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; N_Vector zcor0; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if problem will involve no algebraic solvers, initialize nflagPtr to success */ @@ -2190,13 +1991,13 @@ int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - arkStep_AccessStepMem: + arkStep_AccessARKODEStepMem: Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int arkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem) +int arkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -2206,6 +2007,8 @@ int arkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; + + /* access ARKodeARKStepMem structure */ if ((*ark_mem)->step_mem == NULL) { arkProcessError(*ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, @@ -2216,6 +2019,26 @@ int arkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + arkStep_AccessStepMem: + + Shortcut routine to unpack ark_mem and step_mem structures from + void* pointer. If either is missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int arkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeARKStepMem* step_mem) +{ + /* access ARKodeARKStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_ARKSTEP_NO_MEM); + return (ARK_MEM_NULL); + } + *step_mem = (ARKodeARKStepMem)ark_mem->step_mem; + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- arkStep_CheckNVector: @@ -3236,9 +3059,9 @@ int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - retval = arkStep_AccessStepMem(inner_arkode_mem, - "ARKStepCreateMRIStepInnerStepper", &ark_mem, - &step_mem); + retval = arkStep_AccessARKODEStepMem(inner_arkode_mem, + "ARKStepCreateMRIStepInnerStepper", + &ark_mem, &step_mem); if (retval) { arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -3296,11 +3119,11 @@ int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, if (retval != ARK_SUCCESS) { return (retval); } /* set the stop time */ - retval = ARKStepSetStopTime(arkode_mem, tout); + retval = ARKodeSetStopTime(arkode_mem, tout); if (retval != ARK_SUCCESS) { return (retval); } /* evolve inner ODE */ - retval = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (retval < 0) { return (retval); } /* disable inner forcing */ @@ -3347,7 +3170,7 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); if (retval != ARK_SUCCESS) { return (retval); } - return (ARKStepReset(arkode_mem, tR, yR)); + return (ARKodeReset(arkode_mem, tR, yR)); } /*------------------------------------------------------------------------------ @@ -3433,8 +3256,8 @@ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (nvecs > 0) diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 2d472ecde2..f1e2fb1715 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -166,30 +166,67 @@ typedef struct ARKodeARKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int arkStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, +int arkStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); -int arkStep_AttachMasssol(void* arkode_mem, ARKMassInitFn minit, +int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn lfree, sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void* mass_mem); -void arkStep_DisableLSetup(void* arkode_mem); -void arkStep_DisableMSetup(void* arkode_mem); -int arkStep_Init(void* arkode_mem, int init_type); -void* arkStep_GetLmem(void* arkode_mem); -void* arkStep_GetMassMem(void* arkode_mem); -ARKRhsFn arkStep_GetImplicitRHS(void* arkode_mem); -int arkStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, +void arkStep_DisableLSetup(ARKodeMem ark_mem); +void arkStep_DisableMSetup(ARKodeMem ark_mem); +int arkStep_Init(ARKodeMem ark_mem, int init_type); +void* arkStep_GetLmem(ARKodeMem ark_mem); +void* arkStep_GetMassMem(ARKodeMem ark_mem); +ARKRhsFn arkStep_GetImplicitRHS(ARKodeMem ark_mem); +int arkStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail); -int arkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int arkStep_TakeStep_Z(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); +int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data); +int arkStep_SetDefaults(ARKodeMem ark_mem); +int arkStep_SetOrder(ARKodeMem ark_mem, int ord); +int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS); +int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi); +int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend); +int arkStep_SetNonlinear(ARKodeMem ark_mem); +int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown); +int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv); +int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax); +int arkStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp); +int arkStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method); +int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor); +int arkStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef); +int arkStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); +int arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce); +int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); +int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma); +int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); +int arkStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups); +int arkStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters); +int arkStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails); +int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, + long int* nnfails); +int arkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); +int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp); +int arkStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); +int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +int arkStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z); +void arkStep_Free(ARKodeMem ark_mem); +void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); /* Internal utility routines */ -int arkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem); +int arkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeARKStepMem* step_mem); +int arkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeARKStepMem* step_mem); sunbooleantype arkStep_CheckNVector(N_Vector tmpl); int arkStep_SetButcherTables(ARKodeMem ark_mem); int arkStep_CheckButcherTables(ARKodeMem ark_mem); @@ -226,6 +263,7 @@ int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); /* private functions for relaxation */ +int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); 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 58f78862c3..66e1a5bb87 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -30,165 +30,309 @@ ARKStep Optional input functions (wrappers for generic ARKODE utility routines). All are documented in arkode_io.c. ===============================================================*/ + +int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); +} + +int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +void ARKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void ARKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +{ + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); +} + +int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +{ + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); +} + +int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + return (ARKodeWFtolerances(arkode_mem, efun)); +} + +int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) +{ + return (ARKodeResStolerance(arkode_mem, rabstol)); +} + +int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) +{ + return (ARKodeResVtolerance(arkode_mem, rabstol)); +} + +int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) +{ + return (ARKodeResFtolerance(arkode_mem, rfun)); +} + int ARKStepSetDenseOrder(void* arkode_mem, int dord) { - return (ARKStepSetInterpolantDegree(arkode_mem, dord)); + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); } int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) { - if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } - return (arkSetInterpolantDegree(arkode_mem, degree)); + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); } int ARKStepSetInterpolantType(void* arkode_mem, int itype) { - return (arkSetInterpolantType(arkode_mem, itype)); + return (ARKodeSetInterpolantType(arkode_mem, itype)); } int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - return (arkSetMaxNumSteps(arkode_mem, mxsteps)); + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); } int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) { - return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); } int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin) { - return (arkSetInitStep(arkode_mem, hin)); + return (ARKodeSetInitStep(arkode_mem, hin)); } int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) { - return (arkSetMinStep(arkode_mem, hmin)); + return (ARKodeSetMinStep(arkode_mem, hmin)); } int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) { - return (arkSetMaxStep(arkode_mem, hmax)); + return (ARKodeSetMaxStep(arkode_mem, hmax)); } int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - return (arkSetStopTime(arkode_mem, tstop)); + return (ARKodeSetStopTime(arkode_mem, tstop)); } int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { - return (arkSetInterpolateStopTime(arkode_mem, interp)); + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); } int ARKStepClearStopTime(void* arkode_mem) { - return (arkClearStopTime(arkode_mem)); + return (ARKodeClearStopTime(arkode_mem)); } int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) { - return (arkSetRootDirection(arkode_mem, rootdir)); + return (ARKodeSetRootDirection(arkode_mem, rootdir)); } int ARKStepSetNoInactiveRootWarn(void* arkode_mem) { - return (arkSetNoInactiveRootWarn(arkode_mem)); + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) { - return (arkSetConstraints(arkode_mem, constraints)); + return (ARKodeSetConstraints(arkode_mem, constraints)); } int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) { - return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); } int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); } int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { - return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); } int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) { - return (arkSetAdaptivityAdjustment(arkode_mem, adjust)); + return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); } int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { - return (arkSetCFLFraction(arkode_mem, cfl_frac)); + return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); } int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) { - return (arkSetSafetyFactor(arkode_mem, safety)); + return (ARKodeSetSafetyFactor(arkode_mem, safety)); } int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) { - return (arkSetMaxGrowth(arkode_mem, mx_growth)); + return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); } int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) { - return (arkSetMinReduction(arkode_mem, eta_min)); + return (ARKodeSetMinReduction(arkode_mem, eta_min)); } int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) { - return (arkSetFixedStepBounds(arkode_mem, lb, ub)); + return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); } int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { - return (arkSetMaxFirstGrowth(arkode_mem, etamx1)); + return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); } int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) { - return (arkSetMaxEFailGrowth(arkode_mem, etamxf)); + return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); } int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) { - return (arkSetSmallNumEFails(arkode_mem, small_nef)); + return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); } int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) { - return (arkSetMaxCFailGrowth(arkode_mem, etacf)); + return (ARKodeSetMaxCFailGrowth(arkode_mem, etacf)); } int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) { - return (arkSetStabilityFn(arkode_mem, EStab, estab_data)); + return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); } int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) { - return (arkSetMaxErrTestFails(arkode_mem, maxnef)); + return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); } int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) { - return (arkSetMaxConvFails(arkode_mem, maxncf)); + return (ARKodeSetMaxConvFails(arkode_mem, maxncf)); } int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) { - return (arkSetAdaptController(arkode_mem, C)); + return (ARKodeSetAdaptController(arkode_mem, C)); } int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { - return (arkSetFixedStep(arkode_mem, hfixed)); + return (ARKodeSetFixedStep(arkode_mem, hfixed)); +} + +int ARKStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} + +int ARKStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int ARKStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} + +int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +{ + return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); +} + +int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +{ + return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); +} + +int ARKStepSetLinear(void* arkode_mem, int timedepend) +{ + return (ARKodeSetLinear(arkode_mem, timedepend)); +} + +int ARKStepSetNonlinear(void* arkode_mem) +{ + return (ARKodeSetNonlinear(arkode_mem)); +} + +int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +{ + return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); +} + +int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +{ + return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); +} + +int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +{ + return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); +} + +int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) +{ + return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); +} + +int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) +{ + return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); +} + +int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +{ + return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); +} + +int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +{ + return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); +} + +int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +{ + return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); +} + +int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +{ + return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); } /*--------------------------------------------------------------- @@ -197,87 +341,87 @@ int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) ---------------------------------------------------------------*/ int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) { - return (arkLSSetLinearSolver(arkode_mem, LS, A)); + return (ARKodeSetLinearSolver(arkode_mem, LS, A)); } int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep) { - return (arkLSSetMassLinearSolver(arkode_mem, LS, M, time_dep)); + return (ARKodeSetMassLinearSolver(arkode_mem, LS, M, time_dep)); } int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) { - return (arkLSSetJacFn(arkode_mem, jac)); + return (ARKodeSetJacFn(arkode_mem, jac)); } int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) { - return (arkLSSetMassFn(arkode_mem, mass)); + return (ARKodeSetMassFn(arkode_mem, mass)); } int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) { - return (arkLSSetJacEvalFrequency(arkode_mem, msbj)); + return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); } int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) { - return (arkLSSetLinearSolutionScaling(arkode_mem, onoff)); + return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); } int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) { - return (arkLSSetEpsLin(arkode_mem, eplifac)); + return (ARKodeSetEpsLin(arkode_mem, eplifac)); } int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) { - return (arkLSSetMassEpsLin(arkode_mem, eplifac)); + return (ARKodeSetMassEpsLin(arkode_mem, eplifac)); } int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { - return (arkLSSetNormFactor(arkode_mem, nrmfac)); + return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); } int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { - return (arkLSSetMassNormFactor(arkode_mem, nrmfac)); + return (ARKodeSetMassLSNormFactor(arkode_mem, nrmfac)); } int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) { - return (arkLSSetPreconditioner(arkode_mem, psetup, psolve)); + return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); } int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, ARKLsMassPrecSolveFn psolve) { - return (arkLSSetMassPreconditioner(arkode_mem, psetup, psolve)); + return (ARKodeSetMassPreconditioner(arkode_mem, psetup, psolve)); } int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, ARKLsJacTimesVecFn jtimes) { - return (arkLSSetJacTimes(arkode_mem, jtsetup, jtimes)); + return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); } int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) { - return (arkLSSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); + return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); } int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, ARKLsMassTimesVecFn mtimes, void* mtimes_data) { - return (arkLSSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); + return (ARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); } int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) { - return (arkLSSetLinSysFn(arkode_mem, linsys)); + return (ARKodeSetLinSysFn(arkode_mem, linsys)); } /*=============================================================== @@ -286,108 +430,153 @@ int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) ===============================================================*/ int ARKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) { - return (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); } int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumSteps(arkode_mem, nsteps)); + return (ARKodeGetNumSteps(arkode_mem, nsteps)); } int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) { - return (arkGetActualInitStep(arkode_mem, hinused)); + return (ARKodeGetActualInitStep(arkode_mem, hinused)); } int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) { - return (arkGetLastStep(arkode_mem, hlast)); + return (ARKodeGetLastStep(arkode_mem, hlast)); } int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { - return (arkGetCurrentStep(arkode_mem, hcur)); + return (ARKodeGetCurrentStep(arkode_mem, hcur)); } int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - return (arkGetCurrentTime(arkode_mem, tcur)); + return (ARKodeGetCurrentTime(arkode_mem, tcur)); } int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state) { - return (arkGetCurrentState(arkode_mem, state)); + return (ARKodeGetCurrentState(arkode_mem, state)); +} + +int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +{ + return (ARKodeComputeState(arkode_mem, zcor, z)); } int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { - return (arkGetTolScaleFactor(arkode_mem, tolsfact)); + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); } int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) { - return (arkGetErrWeights(arkode_mem, eweight)); + return (ARKodeGetErrWeights(arkode_mem, eweight)); } int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) { - return (arkGetResWeights(arkode_mem, rweight)); + return (ARKodeGetResWeights(arkode_mem, rweight)); } int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { - return (arkGetWorkSpace(arkode_mem, lenrw, leniw)); + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); } int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) { - return (arkGetNumGEvals(arkode_mem, ngevals)); + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); } int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) { - return (arkGetRootInfo(arkode_mem, rootsfound)); + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); } int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { - return (arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { - return (arkGetNumConstrFails(arkode_mem, nconstrfails)); + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); } int ARKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumExpSteps(arkode_mem, nsteps)); + return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); } int ARKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumAccSteps(arkode_mem, nsteps)); + return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); } int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) { - return (arkGetNumErrTestFails(arkode_mem, netfails)); + return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); +} + +int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, + sdata, user_data)); } int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) { - return (arkGetNumStepSolveFails(arkode_mem, nncfails)); + return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); } int ARKStepGetUserData(void* arkode_mem, void** user_data) { - return (arkGetUserData(arkode_mem, user_data)); + return (ARKodeGetUserData(arkode_mem, user_data)); } char* ARKStepGetReturnFlagName(long int flag) { - return (arkGetReturnFlagName(flag)); + return (ARKodeGetReturnFlagName(flag)); +} + +int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +{ + return (ARKodeGetCurrentGamma(arkode_mem, gamma)); +} + +int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +{ + return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); +} + +int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) +{ + return (ARKodeGetEstLocalErrors(arkode_mem, ele)); +} + +int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +{ + return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); +} + +int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +{ + return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); +} + +int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) +{ + return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); } /*--------------------------------------------------------------- @@ -396,213 +585,229 @@ char* ARKStepGetReturnFlagName(long int flag) ---------------------------------------------------------------*/ int ARKStepGetJac(void* arkode_mem, SUNMatrix* J) { - return arkLSGetJac(arkode_mem, J); + return (ARKodeGetJac(arkode_mem, J)); } int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J) { - return arkLSGetJacTime(arkode_mem, t_J); + return (ARKodeGetJacTime(arkode_mem, t_J)); } int ARKStepGetJacNumSteps(void* arkode_mem, long* nst_J) { - return arkLSGetJacNumSteps(arkode_mem, nst_J); + return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); } int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) { - return (arkLSGetWorkSpace(arkode_mem, lenrwLS, leniwLS)); + return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); } int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) { - return (arkLSGetNumJacEvals(arkode_mem, njevals)); + return (ARKodeGetNumJacEvals(arkode_mem, njevals)); } int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) { - return (arkLSGetNumPrecEvals(arkode_mem, npevals)); + return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); } int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) { - return (arkLSGetNumPrecSolves(arkode_mem, npsolves)); + return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); } int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) { - return (arkLSGetNumLinIters(arkode_mem, nliters)); + return (ARKodeGetNumLinIters(arkode_mem, nliters)); } int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) { - return (arkLSGetNumConvFails(arkode_mem, nlcfails)); + return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); } int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) { - return (arkLSGetNumJTSetupEvals(arkode_mem, njtsetups)); + return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); } int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) { - return (arkLSGetNumJtimesEvals(arkode_mem, njvevals)); + return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); } int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) { - return (arkLSGetNumRhsEvals(arkode_mem, nfevalsLS)); + return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); } int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag) { - return (arkLSGetLastFlag(arkode_mem, flag)); + return (ARKodeGetLastLinFlag(arkode_mem, flag)); } int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, long int* leniwMLS) { - return (arkLSGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS)); + return (ARKodeGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS)); } int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) { - return (arkLSGetNumMassSetups(arkode_mem, nmsetups)); + return (ARKodeGetNumMassSetups(arkode_mem, nmsetups)); } int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) { - return (arkLSGetNumMassMatvecSetups(arkode_mem, nmvsetups)); + return (ARKodeGetNumMassMultSetups(arkode_mem, nmvsetups)); } int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals) { - return (arkLSGetNumMassMult(arkode_mem, nmvevals)); + return (ARKodeGetNumMassMult(arkode_mem, nmvevals)); } int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) { - return (arkLSGetNumMassSolves(arkode_mem, nmsolves)); + return (ARKodeGetNumMassSolves(arkode_mem, nmsolves)); } int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) { - return (arkLSGetNumMassPrecEvals(arkode_mem, nmpevals)); + return (ARKodeGetNumMassPrecEvals(arkode_mem, nmpevals)); } int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) { - return (arkLSGetNumMassPrecSolves(arkode_mem, nmpsolves)); + return (ARKodeGetNumMassPrecSolves(arkode_mem, nmpsolves)); } int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) { - return (arkLSGetNumMassIters(arkode_mem, nmiters)); + return (ARKodeGetNumMassIters(arkode_mem, nmiters)); } int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) { - return (arkLSGetNumMassConvFails(arkode_mem, nmcfails)); + return (ARKodeGetNumMassConvFails(arkode_mem, nmcfails)); } int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups) { - return (arkLSGetNumMTSetups(arkode_mem, nmtsetups)); + return (ARKodeGetNumMTSetups(arkode_mem, nmtsetups)); } int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) { - return (arkLSGetCurrentMassMatrix(arkode_mem, M)); + return (ARKodeGetCurrentMassMatrix(arkode_mem, M)); } int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag) { - return (arkLSGetLastMassFlag(arkode_mem, flag)); + return (ARKodeGetLastMassFlag(arkode_mem, flag)); } char* ARKStepGetLinReturnFlagName(long int flag) { - return (arkLSGetReturnFlagName(flag)); + return (ARKodeGetLinReturnFlagName(flag)); } /* ----------------------------------------------------------------------------- * Wrappers for the ARKODE relaxation module * ---------------------------------------------------------------------------*/ +/* ARKStep-specific utility routine */ +int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + return ( + arkRelaxCreate(ark_mem, rfn, rjac, arkStep_RelaxDeltaE, arkStep_GetOrder)); +} + int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return arkRelaxCreate(arkode_mem, rfn, rjac, arkStep_RelaxDeltaE, - arkStep_GetOrder); + return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); } int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) { - return arkRelaxSetEtaFail(arkode_mem, eta_rf); + return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); } int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) { - return arkRelaxSetLowerBound(arkode_mem, lower); + return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); } int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) { - return arkRelaxSetMaxFails(arkode_mem, max_fails); + return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); } int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) { - return arkRelaxSetMaxIters(arkode_mem, max_iters); + return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); } int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) { - return arkRelaxSetSolver(arkode_mem, solver); + return (ARKodeSetRelaxSolver(arkode_mem, solver)); } int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) { - return arkRelaxSetResTol(arkode_mem, res_tol); + return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); } int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) { - return arkRelaxSetTol(arkode_mem, rel_tol, abs_tol); + return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); } int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) { - return arkRelaxSetUpperBound(arkode_mem, upper); + return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); } int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) { - return arkRelaxGetNumRelaxFnEvals(arkode_mem, r_evals); + return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); } int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) { - return arkRelaxGetNumRelaxJacEvals(arkode_mem, J_evals); + return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); } int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) { - return arkRelaxGetNumRelaxFails(arkode_mem, relax_fails); + return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); } int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) { - return arkRelaxGetNumRelaxBoundFails(arkode_mem, fails); + return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); } int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) { - return arkRelaxGetNumRelaxSolveFails(arkode_mem, fails); + return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); } int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) { - return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); + return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); +} + +int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} + +int ARKStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); } /*=============================================================== @@ -634,44 +839,33 @@ int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) ---------------------------------------------------------------*/ int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) { - return (arkSetErrorBias(arkode_mem, bias)); + return (ARKodeSetErrorBias(arkode_mem, bias)); } /*=============================================================== ARKStep optional input functions -- stepper-specific ===============================================================*/ -/*--------------------------------------------------------------- - ARKStepSetUserData: - - Wrapper for generic arkSetUserData and arkLSSetUserData - routines. - ---------------------------------------------------------------*/ -int ARKStepSetUserData(void* arkode_mem, void* user_data) +int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set user_data in ARKODE mem */ - retval = arkSetUserData(arkode_mem, user_data); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set user data in ARKODE LS mem */ if (step_mem->lmem != NULL) { - retval = arkLSSetUserData(arkode_mem, user_data); + retval = arkLSSetUserData(ark_mem, user_data); if (retval != ARKLS_SUCCESS) { return (retval); } } /* set user data in ARKODE LSMass mem */ if (step_mem->mass_mem != NULL) { - retval = arkLSSetMassUserData(arkode_mem, user_data); + retval = arkLSSetMassUserData(ark_mem, user_data); if (retval != ARKLS_SUCCESS) { return (retval); } } @@ -679,7 +873,7 @@ int ARKStepSetUserData(void* arkode_mem, void* user_data) } /*--------------------------------------------------------------- - ARKStepSetDefaults: + arkStep_SetDefaults: Resets all ARKStep optional inputs to their default values. Does not change problem-defining function pointers or @@ -687,25 +881,15 @@ int ARKStepSetUserData(void* arkode_mem, void* user_data) structures/options related to the ARKODE infrastructure itself (e.g., root-finding and post-process step). ---------------------------------------------------------------*/ -int ARKStepSetDefaults(void* arkode_mem) +int arkStep_SetDefaults(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Set default ARKODE infrastructure parameters */ - retval = arkSetDefaults(ark_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting ARKODE infrastructure defaults"); - return (retval); - } - /* Set default values for integrator optional inputs */ step_mem->q = Q_DEFAULT; /* method order */ step_mem->p = 0; /* embedding order */ @@ -750,8 +934,8 @@ int ARKStepSetOptimalParams(void* arkode_mem) int retval; long int lenrw, leniw; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* access ARKodeHAdaptMem structure */ @@ -1022,25 +1206,18 @@ int ARKStepSetOptimalParams(void* arkode_mem) } /*--------------------------------------------------------------- - ARKStepSetOrder: + arkStep_SetOrder: Specifies the method order - - ** Note in documentation that this should not be called along - with ARKStepSetTable or ARKStepSetTableNum. This routine - is used to specify a desired method order using default Butcher - tables, whereas any user-supplied table will have their own - order associated with them. ---------------------------------------------------------------*/ -int ARKStepSetOrder(void* arkode_mem, int ord) +int arkStep_SetOrder(ARKodeMem ark_mem, int ord) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; sunindextype Blrw, Bliw; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set user-provided value, or default, depending on argument */ @@ -1069,7 +1246,7 @@ int ARKStepSetOrder(void* arkode_mem, int ord) } /*--------------------------------------------------------------- - ARKStepSetLinear: + arkStep_SetLinear: Specifies that the implicit portion of the problem is linear, and to tighten the linear solver tolerances while taking only @@ -1083,14 +1260,13 @@ int ARKStepSetOrder(void* arkode_mem, int ord) using an iterative linear solver this flag denotes time dependence of the preconditioner. ---------------------------------------------------------------*/ -int ARKStepSetLinear(void* arkode_mem, int timedepend) +int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -1102,20 +1278,19 @@ int ARKStepSetLinear(void* arkode_mem, int timedepend) } /*--------------------------------------------------------------- - ARKStepSetNonlinear: + arkStep_SetNonlinear: Specifies that the implicit portion of the problem is nonlinear. - Used to undo a previous call to ARKStepSetLinear. Automatically + Used to undo a previous call to arkStep_SetLinear. Automatically loosens DeltaGammaMax back to default value. ---------------------------------------------------------------*/ -int ARKStepSetNonlinear(void* arkode_mem) +int arkStep_SetNonlinear(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -1138,8 +1313,8 @@ int ARKStepSetExplicit(void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* ensure that fe is defined */ @@ -1169,8 +1344,8 @@ int ARKStepSetImplicit(void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* ensure that fi is defined */ @@ -1190,11 +1365,11 @@ int ARKStepSetImplicit(void* arkode_mem) { if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) { - retval = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); } else { - retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); } if (retval != ARK_SUCCESS) { return (retval); } } @@ -1214,8 +1389,8 @@ int ARKStepSetImEx(void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* ensure that fe and fi are defined */ @@ -1241,11 +1416,11 @@ int ARKStepSetImEx(void* arkode_mem) { if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) { - retval = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); } else { - retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); } if (retval != ARK_SUCCESS) { return (retval); } } @@ -1272,8 +1447,8 @@ int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, ARKodeARKStepMem step_mem; sunindextype Blrw, Bliw; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check for illegal inputs */ @@ -1429,6 +1604,9 @@ int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, If either argument is negative (illegal), then this disables the corresponding table (e.g. itable = -1 -> explicit) + + Note: this routine should NOT be used in conjunction with + ARKodeSetOrder. ---------------------------------------------------------------*/ int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, ARKODE_ERKTableID etable) @@ -1438,8 +1616,8 @@ int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, ARKodeARKStepMem step_mem; sunindextype Blrw, Bliw; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* clear any existing parameters and Butcher tables */ @@ -1608,20 +1786,19 @@ int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable } /*--------------------------------------------------------------- - ARKStepSetNonlinCRDown: + arkStep_SetNonlinCRDown: Specifies the user-provided nonlinear convergence constant crdown. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -1632,20 +1809,19 @@ int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) } /*--------------------------------------------------------------- - ARKStepSetNonlinRDiv: + arkStep_SetNonlinRDiv: Specifies the user-provided nonlinear convergence constant rdiv. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -1656,20 +1832,19 @@ int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) } /*--------------------------------------------------------------- - ARKStepSetDeltaGammaMax: + arkStep_SetDeltaGammaMax: Specifies the user-provided linear setup decision constant dgmax. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -1680,21 +1855,20 @@ int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) } /*--------------------------------------------------------------- - ARKStepSetLSetupFrequency: + arkStep_SetLSetupFrequency: Specifies the user-provided linear setup decision constant msbp. Positive values give the frequency for calling lsetup; negative values imply recomputation of lsetup at each nonlinear solve; a zero value implies a reset to the default. ---------------------------------------------------------------*/ -int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) +int arkStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -1705,20 +1879,19 @@ int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) } /*--------------------------------------------------------------- - ARKStepSetPredictorMethod: + arkStep_SetPredictorMethod: Specifies the method to use for predicting implicit solutions. Non-default choices are {1,2,3,4}, all others will use default (trivial) predictor. ---------------------------------------------------------------*/ -int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) +int arkStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameter */ @@ -1728,20 +1901,19 @@ int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) } /*--------------------------------------------------------------- - ARKStepSetMaxNonlinIters: + arkStep_SetMaxNonlinIters: Specifies the maximum number of nonlinear iterations during one solve. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } SUNFunctionBegin(ark_mem->sunctx); @@ -1771,19 +1943,18 @@ int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) } /*--------------------------------------------------------------- - ARKStepSetNonlinConvCoef: + arkStep_SetNonlinConvCoef: Specifies the coefficient in the nonlinear solver convergence test. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +int arkStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* argument <= 0 sets default, otherwise set input */ @@ -1794,18 +1965,17 @@ int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) } /*--------------------------------------------------------------- - ARKStepSetStagePredictFn: Specifies a user-provided step + arkStep_SetStagePredictFn: Specifies a user-provided step predictor function having type ARKStagePredictFn. A NULL input function disables calls to this routine. ---------------------------------------------------------------*/ -int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +int arkStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->stage_predict = PredictStage; @@ -1813,7 +1983,7 @@ int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) } /*--------------------------------------------------------------- - ARKStepSetDeduceImplicitRhs: + arkStep_SetDeduceImplicitRhs: Specifies if an optimization is used to avoid an evaluation of fi after a nonlinear solve for an implicit stage. If stage @@ -1824,14 +1994,13 @@ int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) fi(z_i), and SUNFALSE indicates that fi(z_i) is computed with an additional evaluation of fi. ---------------------------------------------------------------*/ -int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +int arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->deduce_rhs = deduce; @@ -1843,19 +2012,37 @@ int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) ===============================================================*/ /*--------------------------------------------------------------- - ARKStepGetCurrentGamma: Returns the current value of gamma + arkStep_GetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) { int retval; - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *gamma = step_mem->gamma; return (retval); } +/*--------------------------------------------------------------- + arkStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector + ---------------------------------------------------------------*/ +int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) +{ + int retval; + ARKodeARKStepMem step_mem; + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* return an error if local truncation error is not computed */ + if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- ARKStepGetNumRhsEvals: @@ -1867,8 +2054,8 @@ int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_eva ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get values from step_mem */ @@ -1879,18 +2066,17 @@ int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_eva } /*--------------------------------------------------------------- - ARKStepGetNumLinSolvSetups: + arkStep_GetNumLinSolvSetups: Returns the current number of calls to the lsetup routine ---------------------------------------------------------------*/ -int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +int arkStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get value from step_mem */ @@ -1912,8 +2098,8 @@ int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get tables from step_mem */ @@ -1922,31 +2108,6 @@ int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKStepGetEstLocalErrors: (updated to the correct vector, but - need to verify that it is unchanged between filling the - estimated error and the end of the time step) - - Returns an estimate of the local error - ---------------------------------------------------------------*/ -int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - SUNFunctionBegin(ark_mem->sunctx); - - /* copy vector to output */ - N_VScale(ONE, ark_mem->tempv1, ele); - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- ARKStepGetTimestepperStats: @@ -1961,8 +2122,8 @@ int ARKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set expsteps and accsteps from adaptivity structure */ @@ -1980,18 +2141,17 @@ int ARKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, } /*--------------------------------------------------------------- - ARKStepGetNumNonlinSolvIters: + arkStep_GetNumNonlinSolvIters: Returns the current number of nonlinear solver iterations ---------------------------------------------------------------*/ -int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +int arkStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -2000,18 +2160,17 @@ int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) } /*--------------------------------------------------------------- - ARKStepGetNumNonlinSolvConvFails: + arkStep_GetNumNonlinSolvConvFails: Returns the current number of nonlinear solver convergence fails ---------------------------------------------------------------*/ -int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +int arkStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set output from step_mem */ @@ -2021,19 +2180,18 @@ int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) } /*--------------------------------------------------------------- - ARKStepGetNonlinSolvStats: + arkStep_GetNonlinSolvStats: Returns nonlinear solver statistics ---------------------------------------------------------------*/ -int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails) +int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, + long int* nnfails) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -2043,24 +2201,19 @@ int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, } /*--------------------------------------------------------------- - ARKStepPrintAllStats: + arkStep_PrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int arkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; ARKLsMem arkls_mem; ARKLsMassMem arklsm_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* step and rootfinding stats */ - retval = arkPrintAllStats(arkode_mem, outfile, fmt); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -2081,9 +2234,9 @@ int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, "LS setups = %ld\n", step_mem->nsetups); - if (ark_mem->step_getlinmem(arkode_mem)) + if (ark_mem->step_getlinmem(ark_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); fprintf(outfile, "Jac fn evals = %ld\n", arkls_mem->nje); fprintf(outfile, "LS RHS fn evals = %ld\n", arkls_mem->nfeDQ); fprintf(outfile, "Prec setup evals = %ld\n", arkls_mem->npe); @@ -2106,9 +2259,9 @@ int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) } /* mass solve stats */ - if (ark_mem->step_getmassmem(arkode_mem)) + if (ark_mem->step_getmassmem(ark_mem)) { - arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(arkode_mem)); + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); fprintf(outfile, "Mass setups = %ld\n", arklsm_mem->nmsetups); fprintf(outfile, "Mass solves = %ld\n", @@ -2141,9 +2294,9 @@ int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, ",LS setups,%ld", step_mem->nsetups); - if (ark_mem->step_getlinmem(arkode_mem)) + if (ark_mem->step_getlinmem(ark_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); fprintf(outfile, ",Jac fn evals,%ld", arkls_mem->nje); fprintf(outfile, ",LS RHS fn evals,%ld", arkls_mem->nfeDQ); fprintf(outfile, ",Prec setup evals,%ld", arkls_mem->npe); @@ -2170,9 +2323,9 @@ int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) } /* mass solve stats */ - if (ark_mem->step_getmassmem(arkode_mem)) + if (ark_mem->step_getmassmem(ark_mem)) { - arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(arkode_mem)); + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); fprintf(outfile, ",Mass setups,%ld", arklsm_mem->nmsetups); fprintf(outfile, ",Mass solves,%ld", arklsm_mem->nmsolves); fprintf(outfile, ",Mass Prec setup evals,%ld", arklsm_mem->npe); @@ -2199,29 +2352,19 @@ int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) ===============================================================*/ /*--------------------------------------------------------------- - ARKStepWriteParameters: + arkStep_WriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int ARKStepWriteParameters(void* arkode_mem, FILE* fp) +int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - int flag, retval; + int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* output ARKODE infrastructure parameters first */ - flag = arkWriteParameters(ark_mem, fp); - if (flag != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error writing ARKODE infrastructure parameters"); - return (flag); - } - /* print integrator parameters to file */ fprintf(fp, "ARKStep time step module parameters:\n"); fprintf(fp, " Method order %i\n", step_mem->q); @@ -2270,8 +2413,8 @@ int ARKStepWriteButcher(void* arkode_mem, FILE* fp) ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that Butcher table is non-NULL (otherwise report error) */ diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index f52325b487..d6105f8ed4 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -24,23 +24,22 @@ #include "arkode_impl.h" /*=============================================================== - Exported functions + Utility routines ===============================================================*/ /*--------------------------------------------------------------- - ARKStepSetNonlinearSolver: + arkStep_SetNonlinearSolver: This routine attaches a SUNNonlinearSolver object to the ARKStep module. ---------------------------------------------------------------*/ -int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; int retval; /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if NLS input is NULL */ @@ -101,63 +100,6 @@ int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKStepSetNlsRhsFn: - - This routine sets an alternative user-supplied implicit ODE - right-hand side function to use in the evaluation of nonlinear - system functions. - ---------------------------------------------------------------*/ -int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - if (nls_fi) { step_mem->nls_fi = nls_fi; } - else { step_mem->nls_fi = step_mem->fi; } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepGetNonlinearSystemData: - - This routine provides access to the relevant data needed to - compute the nonlinear system function. - ---------------------------------------------------------------*/ -int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - *tcur = ark_mem->tcur; - *zpred = step_mem->zpred; - *z = ark_mem->ycur; - *Fi = step_mem->Fi[step_mem->istage]; - *gamma = step_mem->gamma; - *sdata = step_mem->sdata; - *user_data = ark_mem->user_data; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - Utility routines called by ARKStep - ---------------------------------------------------------------*/ - /*--------------------------------------------------------------- arkStep_NlsInit: @@ -388,6 +330,57 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) return (retval); } +/*--------------------------------------------------------------- + arkStep_SetNlsRhsFn: + + This routine sets an alternative user-supplied implicit ODE + right-hand side function to use in the evaluation of nonlinear + system functions. + ---------------------------------------------------------------*/ +int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + if (nls_fi) { step_mem->nls_fi = nls_fi; } + else { step_mem->nls_fi = step_mem->fi; } + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkStep_GetNonlinearSystemData: + + This routine provides access to the relevant data needed to + compute the nonlinear system function. + ---------------------------------------------------------------*/ +int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + *tcur = ark_mem->tcur; + *zpred = step_mem->zpred; + *z = ark_mem->ycur; + *Fi = step_mem->Fi[step_mem->istage]; + *gamma = step_mem->gamma; + *sdata = step_mem->sdata; + *user_data = ark_mem->user_data; + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- Interface routines supplied to the SUNNonlinearSolver module ---------------------------------------------------------------*/ @@ -404,8 +397,8 @@ int arkStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_me ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update convfail based on jbad flag */ @@ -446,8 +439,8 @@ int arkStep_NlsLSolve(N_Vector b, void* arkode_mem) ARKodeARKStepMem step_mem; int retval, nonlin_iter; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* retrieve nonlinear solver iteration from module */ @@ -501,8 +494,8 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -563,8 +556,8 @@ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -631,8 +624,8 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -696,8 +689,8 @@ int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -759,8 +752,8 @@ int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -828,8 +821,8 @@ int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeARKStepMem step_mem; int retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -884,8 +877,8 @@ int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype delnrm, dcon; int m, retval; - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if the problem is linearly implicit, just return success */ diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index 6eb5f576da..ad1d72e2b1 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -62,8 +62,8 @@ int ARKBandPrecInit(void* arkode_mem, sunindextype N, sunindextype mu, sunindextype mup, mlp, storagemu; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Test compatibility of NVECTOR package with the BAND preconditioner */ @@ -187,7 +187,8 @@ int ARKBandPrecInit(void* arkode_mem, sunindextype N, sunindextype mu, arkls_mem->pfree = ARKBandPrecFree; /* Attach preconditioner solve and setup functions */ - retval = arkLSSetPreconditioner(arkode_mem, ARKBandPrecSetup, ARKBandPrecSolve); + retval = ARKodeSetPreconditioner(arkode_mem, ARKBandPrecSetup, + ARKBandPrecSolve); return (retval); } @@ -200,8 +201,8 @@ int ARKBandPrecGetWorkSpace(void* arkode_mem, long int* lenrwBP, long int* leniw long int lrw, liw; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBandPrecData is NULL */ @@ -260,8 +261,8 @@ int ARKBandPrecGetNumRhsEvals(void* arkode_mem, long int* nfevalsBP) ARKBandPrecData pdata; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBandPrecData is NULL */ diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index 52f2ee29d9..aa2c2fb652 100644 --- a/src/arkode/arkode_bbdpre.c +++ b/src/arkode/arkode_bbdpre.c @@ -60,8 +60,8 @@ int ARKBBDPrecInit(void* arkode_mem, sunindextype Nlocal, sunindextype mudq, long int lrw, liw; int retval; - /* access ARKMilsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structure */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Test compatibility of NVECTOR package with the BBD preconditioner */ @@ -282,7 +282,7 @@ int ARKBBDPrecInit(void* arkode_mem, sunindextype Nlocal, sunindextype mudq, arkls_mem->pfree = ARKBBDPrecFree; /* Attach preconditioner solve and setup functions */ - retval = arkLSSetPreconditioner(arkode_mem, ARKBBDPrecSetup, ARKBBDPrecSolve); + retval = ARKodeSetPreconditioner(arkode_mem, ARKBBDPrecSetup, ARKBBDPrecSolve); return (retval); } @@ -297,8 +297,8 @@ int ARKBBDPrecReInit(void* arkode_mem, sunindextype mudq, sunindextype mldq, sunindextype Nlocal; int retval; - /* access ARKMilsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structure */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately ARKBBDPrecData is NULL */ @@ -333,8 +333,8 @@ int ARKBBDPrecGetWorkSpace(void* arkode_mem, long int* lenrwBBDP, ARKBBDPrecData pdata; int retval; - /* access ARKMilsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structure */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately ARKBBDPrecData is NULL */ @@ -361,8 +361,8 @@ int ARKBBDPrecGetNumGfnEvals(void* arkode_mem, long int* ngevalsBBDP) ARKBBDPrecData pdata; int retval; - /* access ARKMilsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structure */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if ARKBBDPrecData is NULL */ diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 8fec869acf..d9fa09c041 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -85,24 +85,35 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - ERKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } memset(step_mem, 0, sizeof(struct ARKodeERKStepMemRec)); /* Attach step_mem structure and function pointers to ark_mem */ - ark_mem->step_init = erkStep_Init; - ark_mem->step_fullrhs = erkStep_FullRHS; - ark_mem->step = erkStep_TakeStep; - ark_mem->step_mem = (void*)step_mem; - - /* Set default values for ERKStep optional inputs */ - retval = ERKStepSetDefaults((void*)ark_mem); + ark_mem->step_init = erkStep_Init; + ark_mem->step_fullrhs = erkStep_FullRHS; + ark_mem->step = erkStep_TakeStep; + ark_mem->step_printallstats = erkStep_PrintAllStats; + ark_mem->step_writeparameters = erkStep_WriteParameters; + ark_mem->step_resize = erkStep_Resize; + ark_mem->step_free = erkStep_Free; + ark_mem->step_printmem = erkStep_PrintMem; + ark_mem->step_setdefaults = erkStep_SetDefaults; + ark_mem->step_setrelaxfn = erkStep_SetRelaxFn; + ark_mem->step_setorder = erkStep_SetOrder; + ark_mem->step_getestlocalerrors = erkStep_GetEstLocalErrors; + ark_mem->step_supports_adaptive = SUNTRUE; + ark_mem->step_supports_relaxation = SUNTRUE; + ark_mem->step_mem = (void*)step_mem; + + /* Set default values for optional inputs */ + retval = erkStep_SetDefaults((void*)ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - ERKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -126,7 +137,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - ERKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -134,25 +145,22 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) } /*--------------------------------------------------------------- - ERKStepResize: + erkStep_Resize: This routine resizes the memory within the ERKStep module. - It first resizes the main ARKODE infrastructure memory, and - then resizes its own data. ---------------------------------------------------------------*/ -int ERKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; sunindextype lrw1, liw1, lrw_diff, liw_diff; int i, retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Determing change in vector sizes */ + /* Determine change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -160,15 +168,6 @@ int ERKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, ark_mem->lrw1 = lrw1; ark_mem->liw1 = liw1; - /* resize ARKODE infrastructure memory */ - retval = arkResize(ark_mem, y0, hscale, t0, resize, resize_data); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to resize main ARKODE infrastructure"); - return (retval); - } - /* Resize the RHS vectors */ for (i = 0; i < step_mem->stages; i++) { @@ -202,7 +201,7 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -248,150 +247,18 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) } /*--------------------------------------------------------------- - ERKStepReset: - - This routine resets the ERKStep module state to solve the same - problem from the given time with the input state (all counter - values are retained). - ---------------------------------------------------------------*/ -int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; - - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Initialize main ARKODE infrastructure */ - retval = arkInit(ark_mem, tR, yR, RESET_INIT); - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to initialize main ARKODE infrastructure"); - return (retval); - } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ERKStepSStolerances, ERKStepSVtolerances, ERKStepWFtolerances: - - These routines set integration tolerances (wrappers for general - ARKODE utility routines) - ---------------------------------------------------------------*/ -int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - /* unpack ark_mem, call arkSStolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSStolerances(ark_mem, reltol, abstol)); -} - -int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - /* unpack ark_mem, call arkSVtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSVtolerances(ark_mem, reltol, abstol)); -} - -int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - /* unpack ark_mem, call arkWFtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkWFtolerances(ark_mem, efun)); -} - -int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - /* unpack ark_mem, call arkRootInit, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkRootInit(ark_mem, nrtfn, g)); -} - -int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - /* unpack ark_mem, call arkEvolve, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkEvolve(ark_mem, tout, yout, tret, itask); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - /* unpack ark_mem, call arkGetDky, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkGetDky(ark_mem, t, k, dky); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - ERKStepFree frees all ERKStep memory, and then calls an ARKODE - utility routine to free the ARKODE infrastructure memory. + erkStep_Free frees all ERKStep memory. ---------------------------------------------------------------*/ -void ERKStepFree(void** arkode_mem) +void erkStep_Free(ARKodeMem ark_mem) { int j; sunindextype Bliw, Blrw; - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - /* nothing to do if arkode_mem is already NULL */ - if (*arkode_mem == NULL) { return; } + /* nothing to do if ark_mem is already NULL */ + if (ark_mem == NULL) { return; } /* conditional frees on non-NULL ERKStep module */ - ark_mem = (ARKodeMem)(*arkode_mem); if (ark_mem->step_mem != NULL) { step_mem = (ARKodeERKStepMem)ark_mem->step_mem; @@ -436,21 +303,16 @@ void ERKStepFree(void** arkode_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } - - /* free memory for overall ARKODE infrastructure */ - arkFree(arkode_mem); } /*--------------------------------------------------------------- - ERKStepPrintMem: + erkStep_PrintMem: - This routine outputs the memory from the ERKStep structure and - the main ARKODE infrastructure to a specified file pointer - (useful when debugging). + This routine outputs the memory from the ERKStep structure to + a specified file pointer (useful when debugging). ---------------------------------------------------------------*/ -void ERKStepPrintMem(void* arkode_mem, FILE* outfile) +void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; @@ -459,12 +321,9 @@ void ERKStepPrintMem(void* arkode_mem, FILE* outfile) #endif /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return; } - /* output data from main ARKODE infrastructure */ - arkPrintMem(ark_mem, outfile); - /* output integer quantities */ fprintf(outfile, "ERKStep: q = %i\n", step_mem->q); fprintf(outfile, "ERKStep: p = %i\n", step_mem->p); @@ -510,14 +369,13 @@ void ERKStepPrintMem(void* arkode_mem, FILE* outfile) With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int erkStep_Init(void* arkode_mem, int init_type) +int erkStep_Init(ARKodeMem ark_mem, int init_type) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval, j; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if resize or reset */ @@ -654,16 +512,15 @@ int erkStep_Init(void* arkode_mem, int init_type) 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, sunrealtype t, N_Vector y, N_Vector f, +int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval; - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; sunbooleantype recomputeRHS; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform RHS functions contingent on 'mode' argument */ @@ -764,19 +621,18 @@ int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int erkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) +int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { int retval, is, js, nvec, mode; sunrealtype* cvals; N_Vector* Xvecs; - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; /* initialize algebraic solver convergence flag to success */ *nflagPtr = ARK_SUCCESS; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* local shortcuts for fused vector operations */ @@ -891,13 +747,13 @@ int erkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - erkStep_AccessStepMem: + erkStep_AccessARKODEStepMem: - Shortcut routine to unpack ark_mem and step_mem structures from - void* pointer. If either is missing it returns ARK_MEM_NULL. + Shortcut routine to unpack both ark_mem and step_mem structures + from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int erkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem) +int erkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -907,6 +763,8 @@ int erkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; + + /* access ARKodeERKStepMem structure */ if ((*ark_mem)->step_mem == NULL) { arkProcessError(*ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, @@ -917,6 +775,26 @@ int erkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + erkStep_AccessStepMem: + + Shortcut routine to unpack the step_mem structure from + ark_mem. If missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int erkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeERKStepMem* step_mem) +{ + /* access ARKodeERKStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_ERKSTEP_NO_MEM); + return (ARK_MEM_NULL); + } + *step_mem = (ARKodeERKStepMem)ark_mem->step_mem; + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- erkStep_CheckNVector: diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index ef84f748ef..794f112550 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -68,20 +68,34 @@ typedef struct ARKodeERKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int erkStep_Init(void* arkode_mem, int init_type); -int erkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int erkStep_Init(ARKodeMem ark_mem, int init_type); +int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int erkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); +int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int erkStep_SetUserData(ARKodeMem ark_mem, void* user_data); +int erkStep_SetDefaults(ARKodeMem ark_mem); +int erkStep_SetOrder(ARKodeMem ark_mem, int ord); +int erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); +int erkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp); +int erkStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); +int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +void erkStep_Free(ARKodeMem ark_mem); +void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); /* Internal utility routines */ -int erkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem); +int erkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeERKStepMem* step_mem); +int erkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeERKStepMem* step_mem); sunbooleantype erkStep_CheckNVector(N_Vector tmpl); int erkStep_SetButcherTable(ARKodeMem ark_mem); int erkStep_CheckButcherTable(ARKodeMem ark_mem); int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsm); /* private functions for relaxation */ +int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); 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 15904203a0..f8c1711228 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -30,160 +30,218 @@ ERKStep Optional input functions (wrappers for generic ARKODE utility routines). All are documented in arkode_io.c. ===============================================================*/ +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int ERKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); +} + +int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +void ERKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void ERKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +{ + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); +} + +int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +{ + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); +} + +int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + return (ARKodeWFtolerances(arkode_mem, efun)); +} + int ERKStepSetDenseOrder(void* arkode_mem, int dord) { - return (ERKStepSetInterpolantDegree(arkode_mem, dord)); + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); } int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) { - if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } - return (arkSetInterpolantDegree(arkode_mem, degree)); + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); } int ERKStepSetInterpolantType(void* arkode_mem, int itype) { - return (arkSetInterpolantType(arkode_mem, itype)); + return (ARKodeSetInterpolantType(arkode_mem, itype)); } int ERKStepSetUserData(void* arkode_mem, void* user_data) { - return (arkSetUserData(arkode_mem, user_data)); + return (ARKodeSetUserData(arkode_mem, user_data)); } int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - return (arkSetMaxNumSteps(arkode_mem, mxsteps)); + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); } int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) { - return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); } int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) { - return (arkSetInitStep(arkode_mem, hin)); + return (ARKodeSetInitStep(arkode_mem, hin)); } int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) { - return (arkSetMinStep(arkode_mem, hmin)); + return (ARKodeSetMinStep(arkode_mem, hmin)); } int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) { - return (arkSetMaxStep(arkode_mem, hmax)); + return (ARKodeSetMaxStep(arkode_mem, hmax)); } int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - return (arkSetStopTime(arkode_mem, tstop)); + return (ARKodeSetStopTime(arkode_mem, tstop)); } int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { - return (arkSetInterpolateStopTime(arkode_mem, interp)); + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); } int ERKStepClearStopTime(void* arkode_mem) { - return (arkClearStopTime(arkode_mem)); + return (ARKodeClearStopTime(arkode_mem)); } int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) { - return (arkSetRootDirection(arkode_mem, rootdir)); + return (ARKodeSetRootDirection(arkode_mem, rootdir)); } int ERKStepSetNoInactiveRootWarn(void* arkode_mem) { - return (arkSetNoInactiveRootWarn(arkode_mem)); + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) { - return (arkSetConstraints(arkode_mem, constraints)); + return (ARKodeSetConstraints(arkode_mem, constraints)); } int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) { - return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); } int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); } int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { - return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); } int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) { - return (arkSetAdaptivityAdjustment(arkode_mem, adjust)); + return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); } int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { - return (arkSetCFLFraction(arkode_mem, cfl_frac)); + return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); } int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) { - return (arkSetSafetyFactor(arkode_mem, safety)); + return (ARKodeSetSafetyFactor(arkode_mem, safety)); } int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) { - return (arkSetMaxGrowth(arkode_mem, mx_growth)); + return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); } int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) { - return (arkSetMinReduction(arkode_mem, eta_min)); + return (ARKodeSetMinReduction(arkode_mem, eta_min)); } int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) { - return (arkSetFixedStepBounds(arkode_mem, lb, ub)); + return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); } int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { - return (arkSetMaxFirstGrowth(arkode_mem, etamx1)); + return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); } int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) { - return (arkSetMaxEFailGrowth(arkode_mem, etamxf)); + return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); } int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) { - return (arkSetSmallNumEFails(arkode_mem, small_nef)); + return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); } int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) { - return (arkSetStabilityFn(arkode_mem, EStab, estab_data)); + return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); } int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) { - return (arkSetMaxErrTestFails(arkode_mem, maxnef)); + return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); } int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { - return (arkSetFixedStep(arkode_mem, hfixed)); + return (ARKodeSetFixedStep(arkode_mem, hfixed)); } int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) { - return (arkSetAdaptController(arkode_mem, C)); + return (ARKodeSetAdaptController(arkode_mem, C)); +} + +int ERKStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int ERKStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); } /*=============================================================== @@ -193,173 +251,194 @@ int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) int ERKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) { - return (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); } int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumSteps(arkode_mem, nsteps)); + return (ARKodeGetNumSteps(arkode_mem, nsteps)); } int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) { - return (arkGetActualInitStep(arkode_mem, hinused)); + return (ARKodeGetActualInitStep(arkode_mem, hinused)); } int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) { - return (arkGetLastStep(arkode_mem, hlast)); + return (ARKodeGetLastStep(arkode_mem, hlast)); } int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { - return (arkGetCurrentStep(arkode_mem, hcur)); + return (ARKodeGetCurrentStep(arkode_mem, hcur)); } int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - return (arkGetCurrentTime(arkode_mem, tcur)); + return (ARKodeGetCurrentTime(arkode_mem, tcur)); } int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { - return (arkGetTolScaleFactor(arkode_mem, tolsfact)); + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); } int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) { - return (arkGetErrWeights(arkode_mem, eweight)); + return (ARKodeGetErrWeights(arkode_mem, eweight)); } int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { - return (arkGetWorkSpace(arkode_mem, lenrw, leniw)); + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); } int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) { - return (arkGetNumGEvals(arkode_mem, ngevals)); + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); } int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) { - return (arkGetRootInfo(arkode_mem, rootsfound)); + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); } int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { - return (arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { - return (arkGetNumConstrFails(arkode_mem, nconstrfails)); + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); } int ERKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumExpSteps(arkode_mem, nsteps)); + return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); } int ERKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumAccSteps(arkode_mem, nsteps)); + return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); } int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) { - return (arkGetNumErrTestFails(arkode_mem, netfails)); + return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); } int ERKStepGetUserData(void* arkode_mem, void** user_data) { - return (arkGetUserData(arkode_mem, user_data)); + return (ARKodeGetUserData(arkode_mem, user_data)); } char* ERKStepGetReturnFlagName(long int flag) { - return (arkGetReturnFlagName(flag)); + return (ARKodeGetReturnFlagName(flag)); +} + +int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) +{ + return (ARKodeGetEstLocalErrors(arkode_mem, ele)); } /* ----------------------------------------------------------------------------- * Wrappers for the ARKODE relaxation module * ---------------------------------------------------------------------------*/ +/* ERKStep-specific utility routine */ +int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + return ( + arkRelaxCreate(ark_mem, rfn, rjac, erkStep_RelaxDeltaE, erkStep_GetOrder)); +} + int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return arkRelaxCreate(arkode_mem, rfn, rjac, erkStep_RelaxDeltaE, - erkStep_GetOrder); + return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); } int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) { - return arkRelaxSetEtaFail(arkode_mem, eta_rf); + return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); } int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) { - return arkRelaxSetLowerBound(arkode_mem, lower); + return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); } int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) { - return arkRelaxSetMaxFails(arkode_mem, max_fails); + return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); } int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) { - return arkRelaxSetMaxIters(arkode_mem, max_iters); + return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); } int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) { - return arkRelaxSetSolver(arkode_mem, solver); + return (ARKodeSetRelaxSolver(arkode_mem, solver)); } int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) { - return arkRelaxSetResTol(arkode_mem, res_tol); + return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); } int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) { - return arkRelaxSetTol(arkode_mem, rel_tol, abs_tol); + return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); } int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) { - return arkRelaxSetUpperBound(arkode_mem, upper); + return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); } int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) { - return arkRelaxGetNumRelaxFnEvals(arkode_mem, r_evals); + return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); } int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) { - return arkRelaxGetNumRelaxJacEvals(arkode_mem, J_evals); + return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); } int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) { - return arkRelaxGetNumRelaxFails(arkode_mem, relax_fails); + return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); } int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) { - return arkRelaxGetNumRelaxBoundFails(arkode_mem, fails); + return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); } int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) { - return arkRelaxGetNumRelaxSolveFails(arkode_mem, fails); + return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); } int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) { - return arkRelaxGetNumRelaxSolveIters(arkode_mem, iters); + return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); +} + +int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} + +int ERKStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); } /*=============================================================== @@ -391,7 +470,7 @@ int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) ---------------------------------------------------------------*/ int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) { - return (arkSetErrorBias(arkode_mem, bias)); + return (ARKodeSetErrorBias(arkode_mem, bias)); } /*=============================================================== @@ -399,32 +478,22 @@ int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) ===============================================================*/ /*--------------------------------------------------------------- - ERKStepSetDefaults: + erkStep_SetDefaults: Resets all ERKStep optional inputs to their default values. Does not change problem-defining function pointers or user_data pointer. ---------------------------------------------------------------*/ -int ERKStepSetDefaults(void* arkode_mem) +int erkStep_SetDefaults(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; long int lenrw, leniw; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Set default ARKODE infrastructure parameters */ - retval = arkSetDefaults(arkode_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting ARKODE infrastructure defaults"); - return (retval); - } - /* Remove current SUNAdaptController object, and replace with "PI" */ retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw); @@ -478,19 +547,18 @@ int ERKStepSetDefaults(void* arkode_mem) } /*--------------------------------------------------------------- - ERKStepSetOrder: + erkStep_SetOrder: Specifies the method order ---------------------------------------------------------------*/ -int ERKStepSetOrder(void* arkode_mem, int ord) +int erkStep_SetOrder(ARKodeMem ark_mem, int ord) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; sunindextype Blrw, Bliw; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set user-provided value, or default, depending on argument */ @@ -529,8 +597,8 @@ int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) sunindextype Blrw, Bliw; int retval; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check for legal inputs */ @@ -587,8 +655,8 @@ int ERKStepSetTableNum(void* arkode_mem, ARKODE_ERKTableID etable) sunindextype Blrw, Bliw; int retval; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that argument specifies an explicit table */ @@ -646,66 +714,62 @@ int ERKStepSetTableName(void* arkode_mem, const char* etable) ===============================================================*/ /*--------------------------------------------------------------- - ERKStepGetNumRhsEvals: - - Returns the current number of calls to fe and fi + erkStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector ---------------------------------------------------------------*/ -int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) +int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; int retval; - - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + ARKodeERKStepMem step_mem; + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* get values from step_mem */ - *fevals = step_mem->nfe; + /* return an error if local truncation error is not computed */ + if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ERKStepGetCurrentButcherTable: + ERKStepGetNumRhsEvals: - Sets pointers to the Butcher table currently in use. + Returns the current number of calls to f ---------------------------------------------------------------*/ -int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* get tables from step_mem */ - *B = step_mem->B; + /* get values from step_mem */ + *fevals = step_mem->nfe; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ERKStepGetEstLocalErrors: (updated to the correct vector, but - need to verify that it is unchanged between filling the - estimated error and the end of the time step) + ERKStepGetCurrentButcherTable: - Returns an estimate of the local error + Sets pointers to the Butcher table currently in use. ---------------------------------------------------------------*/ -int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) +int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) { ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* copy vector to output */ - N_VScale(ONE, ark_mem->tempv1, ele); - + /* get tables from step_mem */ + *B = step_mem->B; return (ARK_SUCCESS); } @@ -722,8 +786,8 @@ int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, ARKodeERKStepMem step_mem; int retval; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set expsteps and accsteps from adaptivity structure */ @@ -739,21 +803,17 @@ int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, } /*--------------------------------------------------------------- - ERKStepPrintAllStats: + erkStep_PrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = arkPrintAllStats(arkode_mem, outfile, fmt); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -779,29 +839,19 @@ int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) ===============================================================*/ /*--------------------------------------------------------------- - ERKStepWriteParameters: + erkStep_WriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int ERKStepWriteParameters(void* arkode_mem, FILE* fp) +int erkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) { - ARKodeMem ark_mem; ARKodeERKStepMem step_mem; int retval; /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* output ARKODE infrastructure parameters first */ - retval = arkWriteParameters(arkode_mem, fp); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error writing ARKODE infrastructure parameters"); - return (retval); - } - /* print integrator parameters to file */ fprintf(fp, "ERKStep time step module parameters:\n"); fprintf(fp, " Method order %i\n", step_mem->q); @@ -821,8 +871,8 @@ int ERKStepWriteButcher(void* arkode_mem, FILE* fp) ARKodeMem ark_mem; ARKodeERKStepMem step_mem; - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that Butcher table is non-NULL (otherwise report error) */ diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 54065a7fcb..271ca1b309 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -147,48 +147,94 @@ extern "C" { located at the end of this file */ /* linear solver interface functions */ -typedef int (*ARKLinsolInitFn)(void* arkode_mem); -typedef int (*ARKLinsolSetupFn)(void* arkode_mem, int convfail, +typedef int (*ARKLinsolInitFn)(ARKodeMem ark_mem); +typedef int (*ARKLinsolSetupFn)(ARKodeMem ark_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); -typedef int (*ARKLinsolSolveFn)(void* arkode_mem, N_Vector b, sunrealtype tcur, +typedef int (*ARKLinsolSolveFn)(ARKodeMem ark_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, N_Vector fcur, sunrealtype client_tol, int mnewt); -typedef int (*ARKLinsolFreeFn)(void* arkode_mem); +typedef int (*ARKLinsolFreeFn)(ARKodeMem ark_mem); /* mass-matrix solver interface functions */ -typedef int (*ARKMassInitFn)(void* arkode_mem); -typedef int (*ARKMassSetupFn)(void* arkode_mem, sunrealtype t, N_Vector vtemp1, +typedef int (*ARKMassInitFn)(ARKodeMem ark_mem); +typedef int (*ARKMassSetupFn)(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); typedef int (*ARKMassMultFn)(void* arkode_mem, N_Vector v, N_Vector Mv); -typedef int (*ARKMassSolveFn)(void* arkode_mem, N_Vector b, +typedef int (*ARKMassSolveFn)(ARKodeMem ark_mem, N_Vector b, sunrealtype client_tol); -typedef int (*ARKMassFreeFn)(void* arkode_mem); +typedef int (*ARKMassFreeFn)(ARKodeMem ark_mem); /* time stepper interface functions */ -typedef int (*ARKTimestepInitFn)(void* arkode_mem, int init_type); -typedef int (*ARKTimestepAttachLinsolFn)(void* arkode_mem, ARKLinsolInitFn linit, +typedef int (*ARKTimestepInitFn)(ARKodeMem ark_mem, int init_type); +typedef int (*ARKTimestepAttachLinsolFn)(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); typedef int (*ARKTimestepAttachMasssolFn)( - void* arkode_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, + ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void* mass_mem); -typedef void (*ARKTimestepDisableLSetup)(void* arkode_mem); -typedef void (*ARKTimestepDisableMSetup)(void* arkode_mem); -typedef void* (*ARKTimestepGetLinMemFn)(void* arkode_mem); -typedef void* (*ARKTimestepGetMassMemFn)(void* arkode_mem); -typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(void* arkode_mem); -typedef int (*ARKTimestepGetGammasFn)(void* arkode_mem, sunrealtype* gamma, +typedef void (*ARKTimestepDisableLSetup)(ARKodeMem ark_mem); +typedef void (*ARKTimestepDisableMSetup)(ARKodeMem ark_mem); +typedef void* (*ARKTimestepGetLinMemFn)(ARKodeMem ark_mem); +typedef void* (*ARKTimestepGetMassMemFn)(ARKodeMem ark_mem); +typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(ARKodeMem ark_mem); +typedef int (*ARKTimestepGetGammasFn)(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail); -typedef int (*ARKTimestepFullRHSFn)(void* arkode_mem, sunrealtype t, N_Vector y, - N_Vector f, int mode); -typedef int (*ARKTimestepStepFn)(void* arkode_mem, sunrealtype* dsm, int* nflag); +typedef int (*ARKTimestepFullRHSFn)(ARKodeMem ark_mem, sunrealtype t, + N_Vector y, N_Vector f, int mode); +typedef int (*ARKTimestepStepFn)(ARKodeMem ark_mem, sunrealtype* dsm, int* nflag); +typedef int (*ARKTimetepSetUserDataFn)(ARKodeMem ark_mem, void* user_data); +typedef int (*ARKTimestepPrintAllStats)(ARKodeMem ark_mem, FILE* outfile, + SUNOutputFormat fmt); +typedef int (*ARKTimestepWriteParameters)(ARKodeMem ark_mem, FILE* fp); +typedef int (*ARKTimestepResize)(ARKodeMem ark_mem, N_Vector ynew, + sunrealtype hscale, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data); +typedef int (*ARKTimestepReset)(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); +typedef void (*ARKTimestepFree)(ARKodeMem ark_mem); +typedef void (*ARKTimestepPrintMem)(ARKodeMem ark_mem, FILE* outfile); +typedef int (*ARKTimestepSetDefaults)(ARKodeMem ark_mem); +typedef int (*ARKTimestepComputeState)(ARKodeMem ark_mem, N_Vector zcor, + N_Vector z); +typedef int (*ARKTimestepSetRelaxFn)(ARKodeMem ark_mem, ARKRelaxFn rfn, + ARKRelaxJacFn rjac); +typedef int (*ARKTimestepSetOrder)(ARKodeMem ark_mem, int maxord); +typedef int (*ARKTimestepSetNonlinearSolver)(ARKodeMem ark_mem, + SUNNonlinearSolver NLS); +typedef int (*ARKTimestepSetLinear)(ARKodeMem ark_mem, int timedepend); +typedef int (*ARKTimestepSetNonlinear)(ARKodeMem ark_mem); +typedef int (*ARKTimestepSetNlsRhsFn)(ARKodeMem ark_mem, ARKRhsFn nls_fi); +typedef int (*ARKTimestepSetDeduceImplicitRhs)(ARKodeMem ark_mem, + sunbooleantype deduce); +typedef int (*ARKTimestepSetNonlinCRDown)(ARKodeMem ark_mem, sunrealtype crdown); +typedef int (*ARKTimestepSetNonlinRDiv)(ARKodeMem ark_mem, sunrealtype rdiv); +typedef int (*ARKTimestepSetDeltaGammaMax)(ARKodeMem ark_mem, sunrealtype dgmax); +typedef int (*ARKTimestepSetLSetupFrequency)(ARKodeMem ark_mem, int msbp); +typedef int (*ARKTimestepSetPredictorMethod)(ARKodeMem ark_mem, int method); +typedef int (*ARKTimestepSetMaxNonlinIters)(ARKodeMem ark_mem, int maxcor); +typedef int (*ARKTimestepSetNonlinConvCoef)(ARKodeMem ark_mem, + sunrealtype nlscoef); +typedef int (*ARKTimestepSetStagePredictFn)(ARKodeMem ark_mem, + ARKStagePredictFn PredictStage); +typedef int (*ARKTimestepGetNumLinSolvSetups)(ARKodeMem ark_mem, + long int* nlinsetups); +typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); +typedef int (*ARKTimestepGetCurrentGamma)(ARKodeMem ark_mem, sunrealtype* gamma); +typedef int (*ARKTimestepGetNonlinearSystemData)( + ARKodeMem ark_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, + N_Vector* Fi, sunrealtype* gamma, N_Vector* sdata, void** user_data); +typedef int (*ARKTimestepGetNumNonlinSolvIters)(ARKodeMem ark_mem, + long int* nniters); +typedef int (*ARKTimestepGetNumNonlinSolvConvFails)(ARKodeMem ark_mem, + long int* nnfails); +typedef int (*ARKTimestepGetNonlinSolvStats)(ARKodeMem ark_mem, long int* nniters, + long int* nnfails); /*=============================================================== ARKODE interpolation module definition @@ -203,15 +249,15 @@ typedef struct _generic_ARKInterp* ARKInterp; /* Structure containing function pointers to interpolation operations */ struct _generic_ARKInterpOps { - int (*resize)(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, + int (*resize)(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); - void (*free)(void* arkode_mem, ARKInterp interp); + void (*free)(ARKodeMem ark_mem, ARKInterp interp); void (*print)(ARKInterp interp, FILE* outfile); - int (*setdegree)(void* arkode_mem, ARKInterp interp, int degree); - int (*init)(void* arkode_mem, ARKInterp interp, sunrealtype tnew); - int (*update)(void* arkode_mem, ARKInterp interp, sunrealtype tnew); - int (*evaluate)(void* arkode_mem, ARKInterp interp, sunrealtype tau, int d, + int (*setdegree)(ARKodeMem ark_mem, ARKInterp interp, int degree); + int (*init)(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); + int (*update)(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); + int (*evaluate)(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout); }; @@ -224,15 +270,15 @@ struct _generic_ARKInterp }; /* ARKInterp module functions */ -int arkInterpResize(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, +int arkInterpResize(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree(void* arkode_mem, ARKInterp interp); +void arkInterpFree(ARKodeMem ark_mem, ARKInterp interp); void arkInterpPrintMem(ARKInterp interp, FILE* outfile); -int arkInterpSetDegree(void* arkode_mem, ARKInterp interp, int degree); -int arkInterpInit(void* arkode_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpUpdate(void* arkode_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, sunrealtype tau, +int arkInterpSetDegree(ARKodeMem ark_mem, ARKInterp interp, int degree); +int arkInterpInit(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); +int arkInterpUpdate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); +int arkInterpEvaluate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout); /*=============================================================== @@ -308,6 +354,41 @@ struct ARKodeMemRec ARKTimestepInitFn step_init; ARKTimestepFullRHSFn step_fullrhs; ARKTimestepStepFn step; + ARKTimetepSetUserDataFn step_setuserdata; + ARKTimestepPrintAllStats step_printallstats; + ARKTimestepWriteParameters step_writeparameters; + ARKTimestepResize step_resize; + ARKTimestepReset step_reset; + ARKTimestepFree step_free; + ARKTimestepPrintMem step_printmem; + ARKTimestepSetDefaults step_setdefaults; + ARKTimestepComputeState step_computestate; + ARKTimestepSetRelaxFn step_setrelaxfn; + ARKTimestepSetOrder step_setorder; + ARKTimestepSetNonlinearSolver step_setnonlinearsolver; + ARKTimestepSetLinear step_setlinear; + ARKTimestepSetNonlinear step_setnonlinear; + ARKTimestepSetNlsRhsFn step_setnlsrhsfn; + ARKTimestepSetDeduceImplicitRhs step_setdeduceimplicitrhs; + ARKTimestepSetNonlinCRDown step_setnonlincrdown; + ARKTimestepSetNonlinRDiv step_setnonlinrdiv; + ARKTimestepSetDeltaGammaMax step_setdeltagammamax; + ARKTimestepSetLSetupFrequency step_setlsetupfrequency; + ARKTimestepSetPredictorMethod step_setpredictormethod; + ARKTimestepSetMaxNonlinIters step_setmaxnonliniters; + ARKTimestepSetNonlinConvCoef step_setnonlinconvcoef; + ARKTimestepSetStagePredictFn step_setstagepredictfn; + ARKTimestepGetEstLocalErrors step_getestlocalerrors; + ARKTimestepGetNumLinSolvSetups step_getnumlinsolvsetups; + ARKTimestepGetCurrentGamma step_getcurrentgamma; + ARKTimestepGetNonlinearSystemData step_getnonlinearsystemdata; + ARKTimestepGetNumNonlinSolvIters step_getnumnonlinsolviters; + ARKTimestepGetNumNonlinSolvConvFails step_getnumnonlinsolvconvfails; + ARKTimestepGetNonlinSolvStats step_getnonlinsolvstats; + sunbooleantype step_supports_adaptive; + sunbooleantype step_supports_implicit; + sunbooleantype step_supports_massmatrix; + sunbooleantype step_supports_relaxation; void* step_mem; /* N_Vector storage */ @@ -887,7 +968,6 @@ sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void* resize_data, int count, N_Vector tmpl, N_Vector** v, sunindextype lrw_diff, long int* lrw, sunindextype liw_diff, long int* liw); -void arkPrintMem(ARKodeMem ark_mem, FILE* outfile); sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem); sunbooleantype arkCheckNvector(N_Vector tmpl); sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl); @@ -913,21 +993,7 @@ int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight); int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight); ARKodeMem arkCreate(SUNContext sunctx); -int arkResize(ARKodeMem ark_mem, N_Vector ynew, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data); -int arkSStolerances(ARKodeMem ark_mem, sunrealtype reltol, sunrealtype abstol); -int arkSVtolerances(ARKodeMem ark_mem, sunrealtype reltol, N_Vector abstol); -int arkWFtolerances(ARKodeMem ark_mem, ARKEwtFn efun); -int arkResStolerance(ARKodeMem ark_mem, sunrealtype rabstol); -int arkResVtolerance(ARKodeMem ark_mem, N_Vector rabstol); -int arkResFtolerance(ARKodeMem ark_mem, ARKRwtFn rfun); -int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g); -int arkEvolve(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -int arkGetDky(ARKodeMem ark_mem, sunrealtype t, int k, N_Vector dky); -void arkFree(void** arkode_mem); - -int arkWriteParameters(ARKodeMem ark_mem, FILE* fp); + int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); @@ -941,68 +1007,9 @@ 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); -int arkSetInterpolantDegree(void* arkode_mem, int degree); -int arkSetUserData(void* arkode_mem, void* user_data); -int arkSetMaxNumSteps(void* arkode_mem, long int mxsteps); -int arkSetMaxHnilWarns(void* arkode_mem, int mxhnil); -int arkSetInitStep(void* arkode_mem, sunrealtype hin); -int arkSetMinStep(void* arkode_mem, sunrealtype hmin); -int arkSetMaxStep(void* arkode_mem, sunrealtype hmax); -int arkSetStopTime(void* arkode_mem, sunrealtype tstop); -int arkSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); -int arkClearStopTime(void* arkode_mem); -int arkSetFixedStep(void* arkode_mem, sunrealtype hfixed); -int arkSetRootDirection(void* arkode_mem, int* rootdir); -int arkSetNoInactiveRootWarn(void* arkode_mem); -int arkSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); -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, sunrealtype cfl_frac); -int arkSetSafetyFactor(void* arkode_mem, sunrealtype safety); -int arkSetErrorBias(void* arkode_mem, sunrealtype bias); -int arkSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); -int arkSetMinReduction(void* arkode_mem, sunrealtype eta_min); -int arkSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype adapt_params[3]); int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); -int arkSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); -int arkSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); -int arkSetSmallNumEFails(void* arkode_mem, int small_nef); -int arkSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); -int arkSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); -int arkSetMaxErrTestFails(void* arkode_mem, int maxnef); -int arkSetMaxConvFails(void* arkode_mem, int maxncf); -int arkSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff); -int arkGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -int arkGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts); -int arkGetNumSteps(void* arkode_mem, long int* nsteps); -int arkGetActualInitStep(void* arkode_mem, sunrealtype* hinused); -int arkGetLastStep(void* arkode_mem, sunrealtype* hlast); -int arkGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -int arkGetCurrentState(void* arkode_mem, N_Vector* ycur); -int arkGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -int arkGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); -int arkGetErrWeights(void* arkode_mem, N_Vector eweight); -int arkGetResWeights(void* arkode_mem, N_Vector rweight); -int arkGetNumGEvals(void* arkode_mem, long int* ngevals); -int arkGetRootInfo(void* arkode_mem, int* rootsfound); -int arkGetNumConstrFails(void* arkode_mem, long int* nconstrfails); -int arkGetNumExpSteps(void* arkode_mem, long int* nsteps); -int arkGetNumAccSteps(void* arkode_mem, long int* nsteps); -int arkGetNumErrTestFails(void* arkode_mem, long int* netfails); -int arkGetNumStepSolveFails(void* arkode_mem, long int* nncfails); -int arkGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -int arkGetUserData(void* arkode_mem, void** user_data); -int arkPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); -char* arkGetReturnFlagName(long int flag); ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index c481e465df..2d61283c7a 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -31,19 +31,19 @@ interpolation modules ---------------------------------------------------------------*/ -int arkInterpResize(void* arkode_mem, ARKInterp interp, ARKVecResizeFn resize, +int arkInterpResize(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->resize(arkode_mem, interp, resize, resize_data, + return ((int)interp->ops->resize(ark_mem, interp, resize, resize_data, lrw_diff, liw_diff, tmpl)); } -void arkInterpFree(void* arkode_mem, ARKInterp interp) +void arkInterpFree(ARKodeMem ark_mem, ARKInterp interp) { if (interp == NULL) { return; } - interp->ops->free(arkode_mem, interp); + interp->ops->free(ark_mem, interp); return; } @@ -54,29 +54,29 @@ void arkInterpPrintMem(ARKInterp interp, FILE* outfile) return; } -int arkInterpSetDegree(void* arkode_mem, ARKInterp interp, int degree) +int arkInterpSetDegree(ARKodeMem ark_mem, ARKInterp interp, int degree) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->setdegree(arkode_mem, interp, degree)); + return ((int)interp->ops->setdegree(ark_mem, interp, degree)); } -int arkInterpInit(void* arkode_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpInit(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->init(arkode_mem, interp, tnew)); + return ((int)interp->ops->init(ark_mem, interp, tnew)); } -int arkInterpUpdate(void* arkode_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpUpdate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->update(arkode_mem, interp, tnew)); + return ((int)interp->ops->update(ark_mem, interp, tnew)); } -int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, sunrealtype tau, +int arkInterpEvaluate(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout) { if (interp == NULL) { return (ARK_SUCCESS); } - return ((int)interp->ops->evaluate(arkode_mem, interp, tau, d, order, yout)); + return ((int)interp->ops->evaluate(ark_mem, interp, tau, d, order, yout)); } /*--------------------------------------------------------------- @@ -90,16 +90,11 @@ int arkInterpEvaluate(void* arkode_mem, ARKInterp interp, sunrealtype tau, cloning an input template N_Vector. This returns a non-NULL structure if no errors occurred, or a NULL value otherwise. ---------------------------------------------------------------*/ -ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree) +ARKInterp arkInterpCreate_Hermite(ARKodeMem ark_mem, int degree) { ARKInterp interp; ARKInterpContent_Hermite content; ARKInterpOps ops; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (NULL); } - ark_mem = (ARKodeMem)arkode_mem; /* check for valid degree */ if (degree < 0 || degree > ARK_INTERP_MAX_DEGREE) { return (NULL); } @@ -168,17 +163,11 @@ ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree) This routine resizes the internal vectors. ---------------------------------------------------------------*/ -int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, +int arkInterpResize_Hermite(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector y0) { - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* resize vectors */ if (interp == NULL) { return (ARK_SUCCESS); } @@ -219,14 +208,8 @@ int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, This routine frees the Hermite ARKInterp structure. ---------------------------------------------------------------*/ -void arkInterpFree_Hermite(void* arkode_mem, ARKInterp interp) +void arkInterpFree_Hermite(ARKodeMem ark_mem, ARKInterp interp) { - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return; } - ark_mem = (ARKodeMem)arkode_mem; - /* if interpolation structure is NULL, just return */ if (interp == NULL) { return; } @@ -321,20 +304,13 @@ void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile) polynomial]. Return values: - ARK_MEM_NULL -- if either arkode_mem or interp are NULL ARK_ILL_INPUT -- if the input is outside of allowable bounds ARK_INTERP_FAIL -- if the interpolation module has already been initialized, ARK_SUCCESS -- successful completion. ---------------------------------------------------------------*/ -int arkInterpSetDegree_Hermite(void* arkode_mem, ARKInterp interp, int degree) +int arkInterpSetDegree_Hermite(ARKodeMem ark_mem, ARKInterp interp, int degree) { - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* if this degree is already stored, just return */ if (abs(degree) == HINT_DEGREE(interp)) { return (ARK_SUCCESS); } @@ -370,14 +346,8 @@ int arkInterpSetDegree_Hermite(void* arkode_mem, ARKInterp interp, int degree) 4. Calls the full RHS routine to fill fnew 5. Copies fnew into fold ---------------------------------------------------------------*/ -int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpInit_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew) { - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* initialize time values */ HINT_TOLD(interp) = tnew; HINT_TNEW(interp) = tnew; @@ -430,14 +400,9 @@ int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew) This routine copies ynew into yold, and fnew into fold, so that yold and fold contain the previous values. ---------------------------------------------------------------*/ -int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew) +int arkInterpUpdate_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype 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 */ @@ -491,7 +456,7 @@ int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew where h = tnew-told, i.e. values -1<tau<0 provide interpolation, other values result in extrapolation. ---------------------------------------------------------------*/ -int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, +int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout) { /* local variables */ @@ -500,11 +465,6 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype h, h2, h3, h4, h5; sunrealtype a[6]; N_Vector X[6]; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; /* set constants */ tau2 = tau * tau; @@ -641,7 +601,7 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, /* first, evaluate cubic interpolant at tau=-1/3 */ tval = -ONE / THREE; - retval = arkInterpEvaluate(arkode_mem, interp, tval, 0, 3, yout); + retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 3, yout); if (retval != 0) { return (ARK_RHSFUNC_FAIL); } /* second, evaluate RHS at tau=-1/3, storing the result in fa */ @@ -711,7 +671,7 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, /* first, evaluate quartic interpolant at tau=-1/3 */ tval = -ONE / THREE; - retval = arkInterpEvaluate(arkode_mem, interp, tval, 0, 4, yout); + retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 4, yout); if (retval != 0) { return (ARK_RHSFUNC_FAIL); } /* second, evaluate RHS at tau=-1/3, storing the result in fa */ @@ -722,7 +682,7 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, /* third, evaluate quartic interpolant at tau=-2/3 */ tval = -TWO / THREE; - retval = arkInterpEvaluate(arkode_mem, interp, tval, 0, 4, yout); + retval = arkInterpEvaluate(ark_mem, interp, tval, 0, 4, yout); if (retval != 0) { return (ARK_RHSFUNC_FAIL); } /* fourth, evaluate RHS at tau=-2/3, storing the result in fb */ @@ -855,16 +815,11 @@ int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, cloning an input template N_Vector. This returns a non-NULL structure if no errors occurred, or a NULL value otherwise. ---------------------------------------------------------------*/ -ARKInterp arkInterpCreate_Lagrange(void* arkode_mem, int degree) +ARKInterp arkInterpCreate_Lagrange(ARKodeMem ark_mem, int degree) { ARKInterp interp; ARKInterpContent_Lagrange content; ARKInterpOps ops; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (NULL); } - ark_mem = (ARKodeMem)arkode_mem; /* check for valid degree */ if (degree < 0 || degree > ARK_INTERP_MAX_DEGREE) { return (NULL); } @@ -932,16 +887,12 @@ ARKInterp arkInterpCreate_Lagrange(void* arkode_mem, int degree) This routine resizes the internal vectors. ---------------------------------------------------------------*/ -int arkInterpResize_Lagrange(void* arkode_mem, ARKInterp I, ARKVecResizeFn resize, - void* resize_data, sunindextype lrw_diff, - sunindextype liw_diff, N_Vector y0) +int arkInterpResize_Lagrange(ARKodeMem ark_mem, ARKInterp I, + ARKVecResizeFn resize, void* resize_data, + sunindextype lrw_diff, sunindextype liw_diff, + N_Vector y0) { int i; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; /* resize vectors */ if (I == NULL) { return (ARK_SUCCESS); } @@ -968,14 +919,9 @@ int arkInterpResize_Lagrange(void* arkode_mem, ARKInterp I, ARKVecResizeFn resiz This routine frees the Lagrange ARKInterp structure. ---------------------------------------------------------------*/ -void arkInterpFree_Lagrange(void* arkode_mem, ARKInterp I) +void arkInterpFree_Lagrange(ARKodeMem ark_mem, ARKInterp I) { int i; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return; } - ark_mem = (ARKodeMem)arkode_mem; /* if interpolation structure is NULL, just return */ if (I == NULL) { return; } @@ -1083,20 +1029,13 @@ void arkInterpPrintMem_Lagrange(ARKInterp I, FILE* outfile) polynomial]. Return values: - ARK_MEM_NULL -- if either arkode_mem or interp are NULL ARK_ILL_INPUT -- if the input is outside of allowable bounds ARK_INTERP_FAIL -- if the interpolation module has already been initialized, ARK_SUCCESS -- successful completion. ---------------------------------------------------------------*/ -int arkInterpSetDegree_Lagrange(void* arkode_mem, ARKInterp I, int degree) +int arkInterpSetDegree_Lagrange(ARKodeMem ark_mem, ARKInterp I, int degree) { - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* if this degree is already stored, just return */ if (abs(degree) + 1 == LINT_NMAX(I)) { return (ARK_SUCCESS); } @@ -1131,14 +1070,9 @@ int arkInterpSetDegree_Lagrange(void* arkode_mem, ARKInterp I, int degree) 3. copies current (t,y) from main ARKODE memory into history 4. updates the 'active' history counter to 1 ---------------------------------------------------------------*/ -int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tnew) +int arkInterpInit_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) { int i; - ARKodeMem ark_mem; - - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; /* check if storage has increased since the last init */ if (LINT_NMAX(I) > LINT_NMAXALLOC(I)) @@ -1224,20 +1158,15 @@ int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tnew) into the first history vector Otherwise it just returns with success. ---------------------------------------------------------------*/ -int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tnew) +int arkInterpUpdate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) { int i; - ARKodeMem ark_mem; sunrealtype tdiff; N_Vector ytmp; int nhist, nmax; sunrealtype* thist; N_Vector* yhist; - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* set readability shortcuts */ nhist = LINT_NHIST(I); nmax = LINT_NMAX(I); @@ -1298,7 +1227,7 @@ int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tnew) fixed step sizes, otherwise the stated lower bound is only approximate). ---------------------------------------------------------------*/ -int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tau, +int arkInterpEvaluate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tau, int deriv, int degree, N_Vector yout) { /* local variables */ @@ -1306,15 +1235,10 @@ int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp I, sunrealtype tau, sunrealtype tval; sunrealtype a[6]; N_Vector X[6]; - ARKodeMem ark_mem; int nhist; sunrealtype* thist; N_Vector* yhist; - /* access ARKodeMem structure */ - if (arkode_mem == NULL) { return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; - /* set readability shortcuts */ nhist = LINT_NHIST(I); thist = LINT_THIST(I); diff --git a/src/arkode/arkode_interp_impl.h b/src/arkode/arkode_interp_impl.h index 502817746e..7222259942 100644 --- a/src/arkode/arkode_interp_impl.h +++ b/src/arkode/arkode_interp_impl.h @@ -71,18 +71,19 @@ typedef struct _ARKInterpContent_Hermite* ARKInterpContent_Hermite; /* Hermite structure operations */ -ARKInterp arkInterpCreate_Hermite(void* arkode_mem, int degree); +ARKInterp arkInterpCreate_Hermite(ARKodeMem ark_mem, int degree); -int arkInterpResize_Hermite(void* arkode_mem, ARKInterp interp, +int arkInterpResize_Hermite(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree_Hermite(void* arkode_mem, ARKInterp interp); +void arkInterpFree_Hermite(ARKodeMem ark_mem, ARKInterp interp); void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile); -int arkInterpSetDegree_Hermite(void* arkode_mem, ARKInterp interp, int degree); -int arkInterpInit_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpUpdate_Hermite(void* arkode_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpEvaluate_Hermite(void* arkode_mem, ARKInterp interp, +int arkInterpSetDegree_Hermite(ARKodeMem ark_mem, ARKInterp interp, int degree); +int arkInterpInit_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); +int arkInterpUpdate_Hermite(ARKodeMem ark_mem, ARKInterp interp, + sunrealtype tnew); +int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout); /*=============================================================== @@ -117,19 +118,19 @@ typedef struct _ARKInterpContent_Lagrange* ARKInterpContent_Lagrange; /* Lagrange structure operations */ -ARKInterp arkInterpCreate_Lagrange(void* arkode_mem, int degree); +ARKInterp arkInterpCreate_Lagrange(ARKodeMem ark_mem, int degree); -int arkInterpResize_Lagrange(void* arkode_mem, ARKInterp interp, +int arkInterpResize_Lagrange(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, N_Vector tmpl); -void arkInterpFree_Lagrange(void* arkode_mem, ARKInterp interp); +void arkInterpFree_Lagrange(ARKodeMem ark_mem, ARKInterp interp); void arkInterpPrintMem_Lagrange(ARKInterp interp, FILE* outfile); -int arkInterpSetDegree_Lagrange(void* arkode_mem, ARKInterp interp, int degree); -int arkInterpInit_Lagrange(void* arkode_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpUpdate_Lagrange(void* arkode_mem, ARKInterp interp, +int arkInterpSetDegree_Lagrange(ARKodeMem ark_mem, ARKInterp interp, int degree); +int arkInterpInit_Lagrange(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); +int arkInterpUpdate_Lagrange(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tnew); -int arkInterpEvaluate_Lagrange(void* arkode_mem, ARKInterp interp, +int arkInterpEvaluate_Lagrange(ARKodeMem ark_mem, ARKInterp interp, sunrealtype tau, int d, int order, N_Vector yout); /* Lagrange structure utility routines */ diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 1f0bb406e8..98dc8b2cb1 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -34,7 +34,7 @@ ===============================================================*/ /*--------------------------------------------------------------- - arkSetDefaults: + ARKodeSetDefaults: Resets all optional inputs to ARKODE default values. Does not change problem-defining function pointers fe and fi or @@ -42,9 +42,10 @@ structures/options related to root-finding (those can be reset using ARKodeRootInit) or post-processing a step (ProcessStep). ---------------------------------------------------------------*/ -int arkSetDefaults(void* arkode_mem) +int ARKodeSetDefaults(void* arkode_mem) { ARKodeMem ark_mem; + int retval; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -53,6 +54,13 @@ int arkSetDefaults(void* arkode_mem) } ark_mem = (ARKodeMem)arkode_mem; + /* Set stepper defaults (if provided) */ + if (ark_mem->step_setdefaults) + { + retval = ark_mem->step_setdefaults(arkode_mem); + if (retval != ARK_SUCCESS) { return retval; } + } + /* Set default values for integrator optional inputs */ ark_mem->use_compensated_sums = SUNFALSE; ark_mem->fixedstep = SUNFALSE; /* default to use adaptive steps */ @@ -101,7 +109,37 @@ int arkSetDefaults(void* arkode_mem) } /*--------------------------------------------------------------- - arkSetInterpolantType: + ARKodeSetOrder: + + Specifies the method order + ---------------------------------------------------------------*/ +int ARKodeSetOrder(void* arkode_mem, int ord) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setorder) + { + return (ark_mem->step_setorder(arkode_mem, ord)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetInterpolantType: Specifies use of the Lagrange or Hermite interpolation modules. itype == ARK_INTERP_HERMITE specifies the Hermite (nonstiff) @@ -115,7 +153,7 @@ int arkSetDefaults(void* arkode_mem) ARK_MEM_FAIL if the interpolation module cannot be allocated. ARK_ILL_INPUT if the itype argument is not recognized. ---------------------------------------------------------------*/ -int arkSetInterpolantType(void* arkode_mem, int itype) +int ARKodeSetInterpolantType(void* arkode_mem, int itype) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -177,7 +215,7 @@ int arkSetInterpolantType(void* arkode_mem, int itype) } /*--------------------------------------------------------------- - arkSetInterpolantDegree: + ARKodeSetInterpolantDegree: Specifies the polynomial degree for the dense output interpolation module. @@ -190,7 +228,7 @@ int arkSetInterpolantType(void* arkode_mem, int itype) initialized. ARK_ILL_INPUT if the degree is illegal. ---------------------------------------------------------------*/ -int arkSetInterpolantDegree(void* arkode_mem, int degree) +int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -217,15 +255,543 @@ int arkSetInterpolantDegree(void* arkode_mem, int degree) } /* pass 'degree' to interpolation module, returning its value */ + if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } return (arkInterpSetDegree(ark_mem, ark_mem->interp, degree)); } /*--------------------------------------------------------------- - arkSetUserData: + ARKodeSetNonlinearSolver: + + This routine attaches a SUNNonlinearSolver object to the + time-stepping module. + ---------------------------------------------------------------*/ +int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnonlinearsolver) + { + return (ark_mem->step_setnonlinearsolver(arkode_mem, NLS)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetLinear: + + Specifies that the implicit portion of the problem is linear, + and to tighten the linear solver tolerances while taking only + one Newton iteration. DO NOT USE IN COMBINATION WITH THE + FIXED-POINT SOLVER. Automatically tightens DeltaGammaMax + to ensure that step size changes cause Jacobian recomputation. + + The argument should be 1 or 0, where 1 indicates that the + Jacobian of fi with respect to y depends on time, and + 0 indicates that it is not time dependent. Alternately, when + using an iterative linear solver this flag denotes time + dependence of the preconditioner. + ---------------------------------------------------------------*/ +int ARKodeSetLinear(void* arkode_mem, int timedepend) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setlinear) + { + return (ark_mem->step_setlinear(arkode_mem, timedepend)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetNonlinear: + + Specifies that the implicit portion of the problem is nonlinear. + Used to undo a previous call to ARKodeSetLinear. + ---------------------------------------------------------------*/ +int ARKodeSetNonlinear(void* arkode_mem) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnonlinear) + { + return (ark_mem->step_setnonlinear(arkode_mem)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetNlsRhsFn: + + This routine sets an alternative user-supplied implicit ODE + right-hand side function to use in the evaluation of nonlinear + system functions. + ---------------------------------------------------------------*/ +int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnlsrhsfn) + { + return (ark_mem->step_setnlsrhsfn(arkode_mem, nls_fi)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetDeduceImplicitRhs: + + Specifies if an optimization is used to avoid an evaluation of + fi after a nonlinear solve for an implicit stage. If stage + postprocessecing in enabled, this option is ignored, and the + RHS is never deduced. + + An argument of SUNTRUE indicates that the RHS should be deduced, + and SUNFALSE indicates that the RHS should be computed with + an additional evaluation. + ---------------------------------------------------------------*/ +int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setdeduceimplicitrhs) + { + return (ark_mem->step_setdeduceimplicitrhs(arkode_mem, deduce)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetNonlinCRDown: + + Specifies the user-provided nonlinear convergence constant + crdown. Legal values are strictly positive; illegal values + imply a reset to the default. + ---------------------------------------------------------------*/ +int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnonlincrdown) + { + return (ark_mem->step_setnonlincrdown(arkode_mem, crdown)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetNonlinRDiv: + + Specifies the user-provided nonlinear convergence constant + rdiv. Legal values are strictly positive; illegal values + imply a reset to the default. + ---------------------------------------------------------------*/ +int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnonlinrdiv) + { + return (ark_mem->step_setnonlinrdiv(arkode_mem, rdiv)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetDeltaGammaMax: + + Specifies the user-provided linear setup decision constant + dgmax. Legal values are strictly positive; illegal values imply + a reset to the default. + ---------------------------------------------------------------*/ +int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setdeltagammamax) + { + return (ark_mem->step_setdeltagammamax(arkode_mem, dgmax)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetLSetupFrequency: + + Specifies the user-provided linear setup decision constant + msbp. Positive values give the frequency for calling lsetup; + negative values imply recomputation of lsetup at each nonlinear + solve; a zero value implies a reset to the default. + ---------------------------------------------------------------*/ +int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setlsetupfrequency) + { + return (ark_mem->step_setlsetupfrequency(arkode_mem, msbp)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetPredictorMethod: + + Specifies the method to use for predicting implicit solutions. + ---------------------------------------------------------------*/ +int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setpredictormethod) + { + return (ark_mem->step_setpredictormethod(arkode_mem, pred_method)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetMaxNonlinIters: + + Specifies the maximum number of nonlinear iterations during + one solve. A non-positive input implies a reset to the + default value. + ---------------------------------------------------------------*/ +int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setmaxnonliniters) + { + return (ark_mem->step_setmaxnonliniters(arkode_mem, maxcor)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetNonlinConvCoef: + + Specifies the coefficient in the nonlinear solver convergence + test. A non-positive input implies a reset to the default value. + ---------------------------------------------------------------*/ +int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setnonlinconvcoef) + { + return (ark_mem->step_setnonlinconvcoef(arkode_mem, nlscoef)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetStagePredictFn: Specifies a user-provided step + predictor function having type ARKStagePredictFn. A + NULL input function disables calls to this routine. + ---------------------------------------------------------------*/ +int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setstagepredictfn) + { + return (ark_mem->step_setstagepredictfn(arkode_mem, PredictStage)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeSetUserData: Specifies the user data pointer for f ---------------------------------------------------------------*/ -int arkSetUserData(void* arkode_mem, void* user_data) +int ARKodeSetUserData(void* arkode_mem, void* user_data) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -249,17 +815,23 @@ int arkSetUserData(void* arkode_mem, void* user_data) /* Set data for post-processing a step */ if (ark_mem->ProcessStep != NULL) { ark_mem->ps_data = user_data; } + /* Set user data into stepper (if provided) */ + if (ark_mem->step_setuserdata) + { + return (ark_mem->step_setuserdata(arkode_mem, user_data)); + } + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkSetAdaptController: + ARKodeSetAdaptController: 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 ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) { int retval; long int lenrw, leniw; @@ -272,6 +844,14 @@ int arkSetAdaptController(void* arkode_mem, SUNAdaptController C) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Remove current SUNAdaptController object (delete if owned, and then nullify pointer) */ retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, @@ -321,11 +901,11 @@ int arkSetAdaptController(void* arkode_mem, SUNAdaptController C) } /*--------------------------------------------------------------- - arkSetMaxNumSteps: + ARKodeSetMaxNumSteps: Specifies the maximum number of integration steps ---------------------------------------------------------------*/ -int arkSetMaxNumSteps(void* arkode_mem, long int mxsteps) +int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -344,11 +924,11 @@ int arkSetMaxNumSteps(void* arkode_mem, long int mxsteps) } /*--------------------------------------------------------------- - arkSetMaxHnilWarns: + ARKodeSetMaxHnilWarns: Specifies the maximum number of warnings for small h ---------------------------------------------------------------*/ -int arkSetMaxHnilWarns(void* arkode_mem, int mxhnil) +int ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -359,6 +939,14 @@ int arkSetMaxHnilWarns(void* arkode_mem, int mxhnil) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing mxhnil=0 sets the default, otherwise use input. */ if (mxhnil == 0) { ark_mem->mxhnil = 10; } else { ark_mem->mxhnil = mxhnil; } @@ -367,11 +955,11 @@ int arkSetMaxHnilWarns(void* arkode_mem, int mxhnil) } /*--------------------------------------------------------------- - arkSetInitStep: + ARKodeSetInitStep: Specifies the initial step size ---------------------------------------------------------------*/ -int arkSetInitStep(void* arkode_mem, sunrealtype hin) +int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) { ARKodeMem ark_mem; int retval; @@ -383,6 +971,14 @@ int arkSetInitStep(void* arkode_mem, sunrealtype hin) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against hin==0 for non-adaptive time stepper modules */ + if ((!ark_mem->step_supports_adaptive) && (hin == ZERO)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing hin=0 sets the default, otherwise use input. */ if (hin == ZERO) { ark_mem->hin = ZERO; } else { ark_mem->hin = hin; } @@ -398,11 +994,11 @@ int arkSetInitStep(void* arkode_mem, sunrealtype hin) } /*--------------------------------------------------------------- - arkSetMinStep: + ARKodeSetMinStep: Specifies the minimum step size ---------------------------------------------------------------*/ -int arkSetMinStep(void* arkode_mem, sunrealtype hmin) +int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -413,6 +1009,14 @@ int arkSetMinStep(void* arkode_mem, sunrealtype hmin) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing a value <= 0 sets hmin = 0 */ if (hmin <= ZERO) { @@ -435,11 +1039,11 @@ int arkSetMinStep(void* arkode_mem, sunrealtype hmin) } /*--------------------------------------------------------------- - arkSetMaxStep: + ARKodeSetMaxStep: Specifies the maximum step size ---------------------------------------------------------------*/ -int arkSetMaxStep(void* arkode_mem, sunrealtype hmax) +int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax) { sunrealtype hmax_inv; ARKodeMem ark_mem; @@ -451,6 +1055,14 @@ int arkSetMaxStep(void* arkode_mem, sunrealtype hmax) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing a value <= 0 sets hmax = infinity */ if (hmax <= ZERO) { @@ -474,11 +1086,11 @@ int arkSetMaxStep(void* arkode_mem, sunrealtype hmax) } /*--------------------------------------------------------------- - arkSetStopTime: + ARKodeSetStopTime: Specifies the time beyond which the integration is not to proceed. ---------------------------------------------------------------*/ -int arkSetStopTime(void* arkode_mem, sunrealtype tstop) +int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -491,7 +1103,7 @@ int arkSetStopTime(void* arkode_mem, sunrealtype tstop) /* If ARKODE was called at least once, test if tstop is legal (i.e. if it was not already passed). - If arkSetStopTime is called before the first call to ARKODE, + If ARKodeSetStopTime is called before the first call to ARKODE, tstop will be checked in ARKODE. */ if (ark_mem->nst > 0) { @@ -510,12 +1122,12 @@ int arkSetStopTime(void* arkode_mem, sunrealtype tstop) } /*--------------------------------------------------------------- - arkSetInterpolateStopTime: + ARKodeSetInterpolateStopTime: Specifies to use interpolation to fill the solution output at the stop time (instead of a copy). ---------------------------------------------------------------*/ -int arkSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +int ARKodeSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -530,11 +1142,11 @@ int arkSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) } /*--------------------------------------------------------------- - arkClearStopTime: + ARKodeClearStopTime: Disable the stop time. ---------------------------------------------------------------*/ -int arkClearStopTime(void* arkode_mem) +int ARKodeClearStopTime(void* arkode_mem) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -551,7 +1163,7 @@ int arkClearStopTime(void* arkode_mem) } /*--------------------------------------------------------------- - arkSetFixedStep: + ARKodeSetFixedStep: Specifies to use a fixed time step size instead of performing any form of temporal adaptivity. ARKODE will use this step size @@ -564,7 +1176,7 @@ int arkClearStopTime(void* arkode_mem) Any nonzero argument will result in the use of that fixed step size; an argument of 0 will re-enable temporal adaptivity. ---------------------------------------------------------------*/ -int arkSetFixedStep(void* arkode_mem, sunrealtype hfixed) +int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed) { int retval; ARKodeMem ark_mem; @@ -574,18 +1186,26 @@ int arkSetFixedStep(void* arkode_mem, sunrealtype hfixed) MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - ark_mem = (ARKodeMem)arkode_mem; + ark_mem = (ARKodeMem)arkode_mem; + + /* ensure that when hfixed=0, the time step module supports adaptivity */ + if ((hfixed == ZERO) && (!ark_mem->step_supports_adaptive)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "temporal adaptivity is not supported by this time step module"); + return (ARK_STEPPER_UNSUPPORTED); + } /* re-attach internal error weight functions if necessary */ if ((hfixed == ZERO) && (!ark_mem->user_efun)) { if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) { - retval = arkSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); } else { - retval = arkSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); } if (retval != ARK_SUCCESS) { return (retval); } } @@ -599,18 +1219,18 @@ int arkSetFixedStep(void* arkode_mem, sunrealtype hfixed) else { ark_mem->fixedstep = SUNFALSE; } /* Notify ARKODE to use hfixed as the initial step size, and return */ - retval = arkSetInitStep(arkode_mem, hfixed); + retval = ARKodeSetInitStep(arkode_mem, hfixed); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkSetRootDirection: + ARKodeSetRootDirection: Specifies the direction of zero-crossings to be monitored. The default is to monitor both crossings. ---------------------------------------------------------------*/ -int arkSetRootDirection(void* arkode_mem, int* rootdir) +int ARKodeSetRootDirection(void* arkode_mem, int* rootdir) { ARKodeMem ark_mem; ARKodeRootMem ark_root_mem; @@ -645,12 +1265,12 @@ int arkSetRootDirection(void* arkode_mem, int* rootdir) } /*--------------------------------------------------------------- - arkSetNoInactiveRootWarn: + ARKodeSetNoInactiveRootWarn: Disables issuing a warning if some root function appears to be identically zero at the beginning of the integration ---------------------------------------------------------------*/ -int arkSetNoInactiveRootWarn(void* arkode_mem) +int ARKodeSetNoInactiveRootWarn(void* arkode_mem) { ARKodeMem ark_mem; ARKodeRootMem ark_root_mem; @@ -673,7 +1293,7 @@ int arkSetNoInactiveRootWarn(void* arkode_mem) } /*--------------------------------------------------------------- - arkSetPostprocessStepFn: + ARKodeSetPostprocessStepFn: Specifies a user-provided step postprocessing function having type ARKPostProcessFn. A NULL input function disables step @@ -683,7 +1303,7 @@ int arkSetNoInactiveRootWarn(void* arkode_mem) THEN ALL THEORETICAL GUARANTEES OF SOLUTION ACCURACY AND STABILITY ARE LOST. ---------------------------------------------------------------*/ -int arkSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +int ARKodeSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -702,7 +1322,7 @@ int arkSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) } /*--------------------------------------------------------------- - arkSetPostprocessStageFn: + ARKodeSetPostprocessStageFn: Specifies a user-provided stage postprocessing function having type ARKPostProcessFn. A NULL input function disables @@ -713,13 +1333,13 @@ int arkSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) STABILITY ARE LOST. While it is possible to perform postprocessing when - ARKStepSetDeduceImplicitRhs is enabled, this can cause implicit + ARKodeSetDeduceImplicitRhs is enabled, this can cause implicit RHS evaluations to be inconsistent with the postprocessed stage values. It is strongly recommended to disable - ARKStepSetDeduceImplicitRhs in order to guarantee + ARKodeSetDeduceImplicitRhs in order to guarantee postprocessing constraints are enforced. ---------------------------------------------------------------*/ -int arkSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +int ARKodeSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -737,11 +1357,11 @@ int arkSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) } /*--------------------------------------------------------------- - arkSetConstraints: + ARKodeSetConstraints: Activates or Deactivates inequality constraint checking. ---------------------------------------------------------------*/ -int arkSetConstraints(void* arkode_mem, N_Vector constraints) +int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints) { sunrealtype temptest; ARKodeMem ark_mem; @@ -753,6 +1373,14 @@ int arkSetConstraints(void* arkode_mem, N_Vector constraints) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive && (constraints != NULL)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* If there are no constraints, destroy data structures */ if (constraints == NULL) { @@ -795,12 +1423,12 @@ int arkSetConstraints(void* arkode_mem, N_Vector constraints) } /*--------------------------------------------------------------- - arkSetMaxNumConstrFails: + ARKodeSetMaxNumConstrFails: Set max number of allowed constraint failures in a step before returning an error ---------------------------------------------------------------*/ -int arkSetMaxNumConstrFails(void* arkode_mem, int maxfails) +int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -811,6 +1439,14 @@ int arkSetMaxNumConstrFails(void* arkode_mem, int maxfails) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* Passing maxfails = 0 sets the default, otherwise set to input */ if (maxfails <= 0) { ark_mem->maxconstrfails = MAXCONSTRFAILS; } else { ark_mem->maxconstrfails = maxfails; } @@ -1113,14 +1749,14 @@ int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) } /*--------------------------------------------------------------- - arkSetCFLFraction: + ARKodeSetCFLFraction: Specifies the safety factor to use on the maximum explicitly- stable step size. Allowable values must be within the open interval (0,1). A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) +int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1128,6 +1764,14 @@ int arkSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* check for allowable parameters */ if (cfl_frac >= ONE) { @@ -1144,7 +1788,7 @@ int arkSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) } /*--------------------------------------------------------------- - arkSetAdaptivityAdjustment: + ARKodeSetAdaptivityAdjustment: Adjusts the method order supplied to the temporal adaptivity controller. For example, if the user expects order reduction @@ -1152,7 +1796,7 @@ int arkSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) assume a reduced order of accuracy for the method by specifying a value adjust < 0. ---------------------------------------------------------------*/ -int arkSetAdaptivityAdjustment(void* arkode_mem, int adjust) +int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1160,20 +1804,28 @@ int arkSetAdaptivityAdjustment(void* arkode_mem, int adjust) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* store requested adjustment */ hadapt_mem->adjust = adjust; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkSetSafetyFactor: + ARKodeSetSafetyFactor: Specifies the safety factor to use on the error-based predicted time step size. Allowable values must be within the open interval (0,1). A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetSafetyFactor(void* arkode_mem, sunrealtype safety) +int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1181,6 +1833,14 @@ int arkSetSafetyFactor(void* arkode_mem, sunrealtype safety) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* check for allowable parameters */ if (safety >= ONE) { @@ -1197,13 +1857,13 @@ int arkSetSafetyFactor(void* arkode_mem, sunrealtype safety) } /*--------------------------------------------------------------- - arkSetErrorBias: + ARKodeSetErrorBias: Specifies the error bias to use when performing adaptive-step error control. Allowable values must be >= 1.0. Any illegal value implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetErrorBias(void* arkode_mem, sunrealtype bias) +int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1211,6 +1871,14 @@ int arkSetErrorBias(void* arkode_mem, sunrealtype bias) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* set allowed value, otherwise set default */ if (bias < ONE) { @@ -1230,14 +1898,14 @@ int arkSetErrorBias(void* arkode_mem, sunrealtype bias) } /*--------------------------------------------------------------- - arkSetMaxGrowth: + ARKodeSetMaxGrowth: Specifies the maximum step size growth factor to be allowed between successive integration steps. Note: the first step uses a separate maximum growth factor. Allowable values must be > 1.0. Any illegal value implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) +int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1245,6 +1913,14 @@ int arkSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* set allowed value, otherwise set default */ if (mx_growth <= ONE) { hadapt_mem->growth = GROWTH; } else { hadapt_mem->growth = mx_growth; } @@ -1253,14 +1929,14 @@ int arkSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) } /*--------------------------------------------------------------- - arkSetMinReduction: + ARKodeSetMinReduction: Specifies the minimum possible step size reduction factor to be allowed between successive integration steps. Allowable values must be > 0.0 and < 1.0. Any illegal value implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetMinReduction(void* arkode_mem, sunrealtype eta_min) +int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1268,6 +1944,14 @@ int arkSetMinReduction(void* arkode_mem, sunrealtype eta_min) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* set allowed value, otherwise set default */ if (eta_min >= ONE || eta_min <= ZERO) { hadapt_mem->etamin = ETAMIN; } else { hadapt_mem->etamin = eta_min; } @@ -1276,13 +1960,13 @@ int arkSetMinReduction(void* arkode_mem, sunrealtype eta_min) } /*--------------------------------------------------------------- - arkSetFixedStepBounds: + ARKodeSetFixedStepBounds: Specifies the step size growth interval within which the step size will remain unchanged. Allowable values must enclose the value 1.0. Any illegal interval implies a reset to the default. ---------------------------------------------------------------*/ -int arkSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) +int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1290,6 +1974,14 @@ int arkSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* set allowable interval, otherwise set defaults */ if ((lb <= ONE) && (ub >= ONE)) { @@ -1306,13 +1998,13 @@ int arkSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) } /*--------------------------------------------------------------- - arkSetMaxFirstGrowth: + ARKodeSetMaxFirstGrowth: Specifies the user-provided time step adaptivity constant etamx1. Legal values are greater than 1.0. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) +int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1320,6 +2012,14 @@ int arkSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* if argument legal set it, otherwise set default */ if (etamx1 <= ONE) { hadapt_mem->etamx1 = ETAMX1; } else { hadapt_mem->etamx1 = etamx1; } @@ -1328,13 +2028,13 @@ int arkSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) } /*--------------------------------------------------------------- - arkSetMaxEFailGrowth: + ARKodeSetMaxEFailGrowth: Specifies the user-provided time step adaptivity constant etamxf. Legal values are in the interval (0,1]. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) +int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1342,6 +2042,14 @@ int arkSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* if argument legal set it, otherwise set default */ if ((etamxf <= ZERO) || (etamxf > ONE)) { hadapt_mem->etamxf = ETAMXF; } else { hadapt_mem->etamxf = etamxf; } @@ -1350,13 +2058,13 @@ int arkSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) } /*--------------------------------------------------------------- - arkSetSmallNumEFails: + ARKodeSetSmallNumEFails: Specifies the user-provided time step adaptivity constant small_nef. Legal values are > 0. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetSmallNumEFails(void* arkode_mem, int small_nef) +int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1364,6 +2072,14 @@ int arkSetSmallNumEFails(void* arkode_mem, int small_nef) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* if argument legal set it, otherwise set default */ if (small_nef <= 0) { hadapt_mem->small_nef = SMALL_NEF; } else { hadapt_mem->small_nef = small_nef; } @@ -1372,13 +2088,13 @@ int arkSetSmallNumEFails(void* arkode_mem, int small_nef) } /*--------------------------------------------------------------- - arkSetMaxCFailGrowth: + ARKodeSetMaxCFailGrowth: Specifies the user-provided time step adaptivity constant etacf. Legal values are in the interval (0,1]. Illegal values imply a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) +int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1386,6 +2102,14 @@ int arkSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* if argument legal set it, otherwise set default */ if ((etacf <= ZERO) || (etacf > ONE)) { hadapt_mem->etacf = ETACF; } else { hadapt_mem->etacf = etacf; } @@ -1394,13 +2118,13 @@ int arkSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) } /*--------------------------------------------------------------- - arkSetStabilityFn: + ARKodeSetStabilityFn: Specifies the user-provided explicit time step stability function to use. A NULL input function implies a reset to the default function (empty). ---------------------------------------------------------------*/ -int arkSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) +int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) { int retval; ARKodeHAdaptMem hadapt_mem; @@ -1408,6 +2132,14 @@ int arkSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) retval = arkAccessHAdaptMem(arkode_mem, __func__, &ark_mem, &hadapt_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* NULL argument sets default, otherwise set inputs */ if (EStab == NULL) { @@ -1424,13 +2156,13 @@ int arkSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) } /*--------------------------------------------------------------- - arkSetMaxErrTestFails: + ARKodeSetMaxErrTestFails: Specifies the maximum number of error test failures during one step try. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxErrTestFails(void* arkode_mem, int maxnef) +int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1441,6 +2173,14 @@ int arkSetMaxErrTestFails(void* arkode_mem, int maxnef) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* argument <= 0 sets default, otherwise set input */ if (maxnef <= 0) { ark_mem->maxnef = MAXNEF; } else { ark_mem->maxnef = maxnef; } @@ -1448,13 +2188,13 @@ int arkSetMaxErrTestFails(void* arkode_mem, int maxnef) } /*--------------------------------------------------------------- - arkSetMaxConvFails: + ARKodeSetMaxConvFails: Specifies the maximum number of nonlinear convergence failures during one step try. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int arkSetMaxConvFails(void* arkode_mem, int maxncf) +int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1465,32 +2205,17 @@ int arkSetMaxConvFails(void* arkode_mem, int maxncf) } ark_mem = (ARKodeMem)arkode_mem; - /* argument <= 0 sets default, otherwise set input */ - if (maxncf <= 0) { ark_mem->maxncf = MAXNCF; } - else { ark_mem->maxncf = maxncf; } - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkSetUseCompensatedSums: - - Specifies that ARKODE should use compensated (Kahan) summation - where relevant to mitigate roundoff error. - ---------------------------------------------------------------*/ -int arkSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); } - ark_mem = (ARKodeMem)arkode_mem; - - if (onoff) { ark_mem->use_compensated_sums = SUNTRUE; } - else { ark_mem->use_compensated_sums = SUNFALSE; } + /* argument <= 0 sets default, otherwise set input */ + if (maxncf <= 0) { ark_mem->maxncf = MAXNCF; } + else { ark_mem->maxncf = maxncf; } return (ARK_SUCCESS); } @@ -1499,11 +2224,11 @@ int arkSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) ===============================================================*/ /*--------------------------------------------------------------- - arkGetNumStepAttempts: + ARKodeGetNumStepAttempts: Returns the current number of steps attempted by the solver ---------------------------------------------------------------*/ -int arkGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +int ARKodeGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1519,11 +2244,11 @@ int arkGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) } /*--------------------------------------------------------------- - arkGetNumSteps: + ARKodeGetNumSteps: Returns the current number of integration steps ---------------------------------------------------------------*/ -int arkGetNumSteps(void* arkode_mem, long int* nsteps) +int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1539,11 +2264,11 @@ int arkGetNumSteps(void* arkode_mem, long int* nsteps) } /*--------------------------------------------------------------- - arkGetActualInitStep: + ARKodeGetActualInitStep: Returns the step size used on the first step ---------------------------------------------------------------*/ -int arkGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +int ARKodeGetActualInitStep(void* arkode_mem, sunrealtype* hinused) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1559,11 +2284,11 @@ int arkGetActualInitStep(void* arkode_mem, sunrealtype* hinused) } /*--------------------------------------------------------------- - arkGetLastStep: + ARKodeGetLastStep: Returns the step size used on the last successful step ---------------------------------------------------------------*/ -int arkGetLastStep(void* arkode_mem, sunrealtype* hlast) +int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1579,11 +2304,11 @@ int arkGetLastStep(void* arkode_mem, sunrealtype* hlast) } /*--------------------------------------------------------------- - arkGetCurrentStep: + ARKodeGetCurrentStep: Returns the step size to be attempted on the next step ---------------------------------------------------------------*/ -int arkGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1599,12 +2324,12 @@ int arkGetCurrentStep(void* arkode_mem, sunrealtype* hcur) } /*--------------------------------------------------------------- - arkGetCurrentState: + ARKodeGetCurrentState: Returns the current solution (before or after as step) or stage value (during step solve). ---------------------------------------------------------------*/ -int arkGetCurrentState(void* arkode_mem, N_Vector* state) +int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1620,11 +2345,40 @@ int arkGetCurrentState(void* arkode_mem, N_Vector* state) } /*--------------------------------------------------------------- - arkGetCurrentTime: + ARKodeGetEstLocalErrors: + + Returns an estimate of the local error + ---------------------------------------------------------------*/ +int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper-specific routine (if provided); otherwise return an error */ + if (ark_mem->step_getestlocalerrors) + { + return (ark_mem->step_getestlocalerrors(ark_mem, ele)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does provide a temporal error estimate"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeGetCurrentTime: Returns the current value of the independent variable ---------------------------------------------------------------*/ -int arkGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1640,11 +2394,47 @@ int arkGetCurrentTime(void* arkode_mem, sunrealtype* tcur) } /*--------------------------------------------------------------- - arkGetTolScaleFactor: + ARKodeGetCurrentGamma: Returns the current value of gamma + ---------------------------------------------------------------*/ +int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getcurrentgamma) + { + return (ark_mem->step_getcurrentgamma(ark_mem, gamma)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeGetTolScaleFactor: Returns a suggested factor for scaling tolerances ---------------------------------------------------------------*/ -int arkGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +int ARKodeGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1655,16 +2445,25 @@ int arkGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not use tolerances + (i.e., neither supports adaptivity nor needs an algebraic solver) */ + if ((!ark_mem->step_supports_implicit) && (!ark_mem->step_supports_adaptive)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not use tolerances"); + return (ARK_STEPPER_UNSUPPORTED); + } + *tolsfact = ark_mem->tolsf; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkGetErrWeights: + ARKodeGetErrWeights: This routine returns the current error weight vector. ---------------------------------------------------------------*/ -int arkGetErrWeights(void* arkode_mem, N_Vector eweight) +int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1675,16 +2474,25 @@ int arkGetErrWeights(void* arkode_mem, N_Vector eweight) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not use tolerances + (i.e., neither supports adaptivity nor needs an algebraic solver) */ + if ((!ark_mem->step_supports_implicit) && (!ark_mem->step_supports_adaptive)) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not use tolerances"); + return (ARK_STEPPER_UNSUPPORTED); + } + N_VScale(ONE, ark_mem->ewt, eweight); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkGetResWeights: + ARKodeGetResWeights: This routine returns the current residual weight vector. ---------------------------------------------------------------*/ -int arkGetResWeights(void* arkode_mem, N_Vector rweight) +int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1695,16 +2503,24 @@ int arkGetResWeights(void* arkode_mem, N_Vector rweight) } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + N_VScale(ONE, ark_mem->rwt, rweight); return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkGetWorkSpace: + ARKodeGetWorkSpace: Returns integrator work space requirements ---------------------------------------------------------------*/ -int arkGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1721,11 +2537,11 @@ int arkGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } /*--------------------------------------------------------------- - arkGetNumGEvals: + ARKodeGetNumGEvals: Returns the current number of calls to g (for rootfinding) ---------------------------------------------------------------*/ -int arkGetNumGEvals(void* arkode_mem, long int* ngevals) +int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) { ARKodeMem ark_mem; ARKodeRootMem ark_root_mem; @@ -1748,11 +2564,11 @@ int arkGetNumGEvals(void* arkode_mem, long int* ngevals) } /*--------------------------------------------------------------- - arkGetRootInfo: + ARKodeGetRootInfo: Returns pointer to array rootsfound showing roots found ---------------------------------------------------------------*/ -int arkGetRootInfo(void* arkode_mem, int* rootsfound) +int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) { int i; ARKodeMem ark_mem; @@ -1779,12 +2595,12 @@ int arkGetRootInfo(void* arkode_mem, int* rootsfound) } /*--------------------------------------------------------------- - arkGetStepStats: + ARKodeGetStepStats: Returns step statistics ---------------------------------------------------------------*/ -int arkGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1804,11 +2620,11 @@ int arkGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, } /*--------------------------------------------------------------- - arkGetNumConstrFails: + ARKodeGetNumConstrFails: Returns the current number of constraint fails ---------------------------------------------------------------*/ -int arkGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1824,11 +2640,11 @@ int arkGetNumConstrFails(void* arkode_mem, long int* nconstrfails) } /*--------------------------------------------------------------- - arkGetNumExpSteps: + ARKodeGetNumExpSteps: Returns the current number of stability-limited steps ---------------------------------------------------------------*/ -int arkGetNumExpSteps(void* arkode_mem, long int* nsteps) +int ARKodeGetNumExpSteps(void* arkode_mem, long int* nsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1844,11 +2660,11 @@ int arkGetNumExpSteps(void* arkode_mem, long int* nsteps) } /*--------------------------------------------------------------- - arkGetNumAccSteps: + ARKodeGetNumAccSteps: Returns the current number of accuracy-limited steps ---------------------------------------------------------------*/ -int arkGetNumAccSteps(void* arkode_mem, long int* nsteps) +int ARKodeGetNumAccSteps(void* arkode_mem, long int* nsteps) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1864,11 +2680,11 @@ int arkGetNumAccSteps(void* arkode_mem, long int* nsteps) } /*--------------------------------------------------------------- - arkGetNumErrTestFails: + ARKodeGetNumErrTestFails: Returns the current number of error test failures ---------------------------------------------------------------*/ -int arkGetNumErrTestFails(void* arkode_mem, long int* netfails) +int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1884,12 +2700,181 @@ int arkGetNumErrTestFails(void* arkode_mem, long int* netfails) } /*--------------------------------------------------------------- - arkGetNumStepSolveFails: + ARKodeComputeState: + + Computes y based on the current prediction and a given + correction. + ---------------------------------------------------------------*/ +int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_computestate) + { + return (ark_mem->step_computestate(ark_mem, zcor, z)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeGetNonlinearSystemData: + + This routine provides access to the relevant data needed to + compute the nonlinear system function. + ---------------------------------------------------------------*/ +int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnonlinearsystemdata) + { + return (ark_mem->step_getnonlinearsystemdata(ark_mem, tcur, zpred, z, Fi, + gamma, sdata, user_data)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +/*--------------------------------------------------------------- + ARKodeGetNumNonlinSolvIters: + + Returns the current number of nonlinear solver iterations + ---------------------------------------------------------------*/ +int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumnonlinsolviters) + { + return (ark_mem->step_getnumnonlinsolviters(ark_mem, nniters)); + } + else + { + *nniters = 0; + return (ARK_SUCCESS); + } +} + +/*--------------------------------------------------------------- + ARKodeGetNumNonlinSolvConvFails: + + Returns the current number of nonlinear solver convergence fails + ---------------------------------------------------------------*/ +int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumnonlinsolvconvfails) + { + return (ark_mem->step_getnumnonlinsolvconvfails(ark_mem, nnfails)); + } + else + { + *nnfails = 0; + return (ARK_SUCCESS); + } +} + +/*--------------------------------------------------------------- + ARKodeGetNonlinSolvStats: + + Returns nonlinear solver statistics + ---------------------------------------------------------------*/ +int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnonlinsolvstats) + { + return (ark_mem->step_getnonlinsolvstats(ark_mem, nniters, nnfails)); + } + else + { + *nniters = *nnfails = 0; + return (ARK_SUCCESS); + } +} + +/*--------------------------------------------------------------- + ARKodeGetNumStepSolveFails: Returns the current number of failed steps due to an algebraic solver convergence failure. ---------------------------------------------------------------*/ -int arkGetNumStepSolveFails(void* arkode_mem, long int* nncfails) +int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1905,11 +2890,39 @@ int arkGetNumStepSolveFails(void* arkode_mem, long int* nncfails) } /*--------------------------------------------------------------- - arkGetUserData: + ARKodeGetNumLinSolvSetups: + + Returns the current number of calls to the lsetup routine + ---------------------------------------------------------------*/ +int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumlinsolvsetups) + { + return (ark_mem->step_getnumlinsolvsetups(ark_mem, nlinsetups)); + } + else + { + *nlinsetups = 0; + return (ARK_SUCCESS); + } +} + +/*--------------------------------------------------------------- + ARKodeGetUserData: Returns the user data pointer ---------------------------------------------------------------*/ -int arkGetUserData(void* arkode_mem, void** user_data) +int ARKodeGetUserData(void* arkode_mem, void** user_data) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -1926,12 +2939,12 @@ int arkGetUserData(void* arkode_mem, void** user_data) } /*----------------------------------------------------------------- - arkPrintAllStats + ARKodePrintAllStats Prints the current value of all statistics ---------------------------------------------------------------*/ -int arkPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { int retval; ARKodeMem ark_mem; @@ -1998,16 +3011,22 @@ int arkPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* Print relaxation stats */ if (ark_mem->relax_enabled) { - retval = arkRelaxPrintAllStats(arkode_mem, outfile, fmt); + retval = arkRelaxPrintAllStats(ark_mem, outfile, fmt); if (retval != ARK_SUCCESS) { return (retval); } } + /* Print stepper stats (if provided) */ + if (ark_mem->step_printallstats) + { + return (ark_mem->step_printallstats(ark_mem, outfile, fmt)); + } + return (ARK_SUCCESS); } /*-----------------------------------------------------------------*/ -char* arkGetReturnFlagName(long int flag) +char* ARKodeGetReturnFlagName(long int flag) { char* name; name = (char*)malloc(27 * sizeof(char)); @@ -2066,7 +3085,12 @@ char* arkGetReturnFlagName(long int flag) 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_RELAX_FAIL: sprintf(name, "ARK_RELAX_FAIL"); break; + case ARK_RELAX_MEM_NULL: sprintf(name, "ARK_RELAX_MEM_NULL"); break; + case ARK_RELAX_FUNC_FAIL: sprintf(name, "ARK_RELAX_FUNC_FAIL"); break; + case ARK_RELAX_JAC_FAIL: sprintf(name, "ARK_RELAX_JAC_FAIL"); break; case ARK_CONTROLLER_ERR: sprintf(name, "ARK_CONTROLLER_ERR"); break; + case ARK_STEPPER_UNSUPPORTED: sprintf(name, "ARK_STEPPER_UNSUPPORTED"); break; case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; default: sprintf(name, "NONE"); } @@ -2079,18 +3103,20 @@ char* arkGetReturnFlagName(long int flag) ===============================================================*/ /*--------------------------------------------------------------- - arkodeWriteParameters: + ARKodeWriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int arkWriteParameters(ARKodeMem ark_mem, FILE* fp) +int ARKodeWriteParameters(void* arkode_mem, FILE* fp) { - if (ark_mem == NULL) + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } + ark_mem = (ARKodeMem)arkode_mem; /* print integrator parameters to file */ fprintf(fp, "ARKODE solver parameters:\n"); @@ -2165,6 +3191,12 @@ int arkWriteParameters(ARKodeMem ark_mem, FILE* fp) fprintf(fp, " Maximum number of convergence test failures = %i\n", ark_mem->maxncf); + /* Call stepper routine (if provided) */ + if (ark_mem->step_writeparameters) + { + return (ark_mem->step_writeparameters(ark_mem, fp)); + } + return (ARK_SUCCESS); } diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index bf43998744..352fe183cc 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -35,7 +35,7 @@ /* Prototypes for internal functions */ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, sunbooleantype jok, sunbooleantype* jcur, - sunrealtype gamma, void* user_data, N_Vector tmp1, + sunrealtype gamma, void* arkode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /*=============================================================== @@ -43,9 +43,9 @@ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, ===============================================================*/ /*--------------------------------------------------------------- - arkLSSetLinearSolver specifies the linear solver. + ARKodeSetLinearSolver specifies the linear solver. ---------------------------------------------------------------*/ -int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) +int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -57,12 +57,20 @@ int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { - arkProcessError(NULL, ARKLS_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_LS_ARKMEM_NULL); - return (ARKLS_MEM_NULL); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (LS == NULL) { arkProcessError(ark_mem, ARKLS_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -181,7 +189,7 @@ int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) arkls_mem->jtsetup = NULL; arkls_mem->jtimes = arkLsDQJtimes; arkls_mem->Jt_data = ark_mem; - arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(ark_mem); if (arkls_mem->Jt_f == NULL) { @@ -277,7 +285,7 @@ int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) else { arkls_mem->scalesol = SUNFALSE; } /* Attach ARKLs interface to time stepper module */ - retval = ark_mem->step_attachlinsol(arkode_mem, arkLsInitialize, arkLsSetup, + retval = ark_mem->step_attachlinsol(ark_mem, arkLsInitialize, arkLsSetup, arkLsSolve, arkLsFree, LSType, arkls_mem); if (retval != ARK_SUCCESS) { @@ -298,8 +306,8 @@ int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) linear solver and user-supplied routine to perform the mass-matrix-vector product. ---------------------------------------------------------------*/ -int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, - sunbooleantype time_dep) +int ARKodeSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, + sunbooleantype time_dep) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -311,12 +319,20 @@ int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, /* Return immediately if either arkode_mem or LS inputs are NULL */ if (arkode_mem == NULL) { - arkProcessError(NULL, ARKLS_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_LS_ARKMEM_NULL); - return (ARKLS_MEM_NULL); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } ark_mem = (ARKodeMem)arkode_mem; + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (LS == NULL) { arkProcessError(ark_mem, ARKLS_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -502,7 +518,7 @@ int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, if (iterative) { arkls_mem->nrmfac = SUNRsqrt(N_VGetLength(arkls_mem->x)); } /* Attach ARKLs interface to time stepper module */ - retval = ark_mem->step_attachmasssol(arkode_mem, arkLsMassInitialize, + retval = ark_mem->step_attachmasssol(ark_mem, arkLsMassInitialize, arkLsMassSetup, arkLsMTimes, arkLsMassSolve, arkLsMassFree, time_dep, LSType, arkls_mem); @@ -525,16 +541,33 @@ int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, ===============================================================*/ /*--------------------------------------------------------------- - arkLSSetJacFn specifies the Jacobian function. + ARKodeSetJacFn specifies the Jacobian function. ---------------------------------------------------------------*/ -int arkLSSetJacFn(void* arkode_mem, ARKLsJacFn jac) +int ARKodeSetJacFn(void* arkode_mem, ARKLsJacFn jac) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* return with failure if jac cannot be used */ @@ -568,16 +601,33 @@ int arkLSSetJacFn(void* arkode_mem, ARKLsJacFn jac) } /*--------------------------------------------------------------- - arkLSSetMassFn specifies the mass matrix function. + ARKodeSetMassFn specifies the mass matrix function. ---------------------------------------------------------------*/ -int arkLSSetMassFn(void* arkode_mem, ARKLsMassFn mass) +int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* return with failure if mass cannot be used */ @@ -602,38 +652,75 @@ int arkLSSetMassFn(void* arkode_mem, ARKLsMassFn mass) } /*--------------------------------------------------------------- - arkLSSetEpsLin specifies the nonlinear -> linear tolerance + ARKodeSetEpsLin specifies the nonlinear -> linear tolerance scale factor. ---------------------------------------------------------------*/ -int arkLSSetEpsLin(void* arkode_mem, sunrealtype eplifac) +int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; store input and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* store input and return */ arkls_mem->eplifac = (eplifac <= ZERO) ? ARKLS_EPLIN : eplifac; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSSetNormFactor sets or computes the factor to use when + ARKodeSetLSNormFactor sets or computes the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac) +int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; store input and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* store input and return */ if (nrmfac > ZERO) { /* set user-provided factor */ @@ -655,35 +742,71 @@ int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac) } /*--------------------------------------------------------------- - arkLSSetJacEvalFrequency specifies the frequency for + ARKodeSetJacEvalFrequency specifies the frequency for recomputing the Jacobian matrix and/or preconditioner. ---------------------------------------------------------------*/ -int arkLSSetJacEvalFrequency(void* arkode_mem, long int msbj) +int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; store input and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* store input and return */ arkls_mem->msbj = (msbj <= ZERO) ? ARKLS_MSBJ : msbj; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSSetLinearSolutionScaling enables or disables scaling the + ARKodeSetLinearSolutionScaling enables or disables scaling the linear solver solution to account for changes in gamma. ---------------------------------------------------------------*/ -int arkLSSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; store input and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check for valid solver type */ @@ -696,11 +819,11 @@ int arkLSSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) } /*--------------------------------------------------------------- - arkLSSetPreconditioner specifies the user-supplied + ARKodeSetPreconditioner specifies the user-supplied preconditioner setup and solve routines. ---------------------------------------------------------------*/ -int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve) +int ARKodeSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -708,8 +831,25 @@ int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, SUNPSolveFn arkls_psolve; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied preconditioning */ @@ -741,18 +881,35 @@ int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, } /*--------------------------------------------------------------- - arkLSSetJacTimes specifies the user-supplied Jacobian-vector + ARKodeSetJacTimes specifies the user-supplied Jacobian-vector product setup and multiply routines. ---------------------------------------------------------------*/ -int arkLSSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes) +int ARKodeSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied ATimes */ @@ -778,7 +935,7 @@ int arkLSSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, arkls_mem->jtsetup = NULL; arkls_mem->jtimes = arkLsDQJtimes; arkls_mem->Jt_data = ark_mem; - arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(ark_mem); if (arkls_mem->Jt_f == NULL) { @@ -792,18 +949,35 @@ int arkLSSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, } /*--------------------------------------------------------------- - arkLSSetJacTimesRhsFn specifies an alternative user-supplied + ARKodeSetJacTimesRhsFn specifies an alternative user-supplied ODE right-hand side function to use in the internal finite difference Jacobian-vector product. ---------------------------------------------------------------*/ -int arkLSSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +int ARKodeSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check if using internal finite difference approximation */ @@ -818,7 +992,7 @@ int arkLSSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) if (jtimesRhsFn != NULL) { arkls_mem->Jt_f = jtimesRhsFn; } else { - arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(arkode_mem); + arkls_mem->Jt_f = ark_mem->step_getimplicitrhs(ark_mem); if (arkls_mem->Jt_f == NULL) { @@ -831,15 +1005,32 @@ int arkLSSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) return (ARKLS_SUCCESS); } -/* arkLSSetLinSysFn specifies the linear system setup function. */ -int arkLSSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +/* ARKodeSetLinSysFn specifies the linear system setup function. */ +int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* return with failure if linsys cannot be used */ @@ -868,14 +1059,13 @@ int arkLSSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) } /* arkLSSetUserData sets user_data pointers in arkLS */ -int arkLSSetUserData(void* arkode_mem, void* user_data) +int arkLSSetUserData(ARKodeMem ark_mem, void* user_data) { - ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* Set data for Jacobian */ @@ -894,53 +1084,108 @@ int arkLSSetUserData(void* arkode_mem, void* user_data) } /*=============================================================== - Optional Get functions (called by time-stepper modules) + Optional Get functions ===============================================================*/ -int arkLSGetJac(void* arkode_mem, SUNMatrix* J) +int ARKodeGetJac(void* arkode_mem, SUNMatrix* J) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return NULL for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *J = NULL; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return retval; } + + /* set output and return */ *J = arkls_mem->savedJ; return ARKLS_SUCCESS; } -int arkLSGetJacTime(void* arkode_mem, sunrealtype* t_J) +int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return an error for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return retval; } + + /* set output and return */ *t_J = arkls_mem->tnlj; return ARKLS_SUCCESS; } -int arkLSGetJacNumSteps(void* arkode_mem, long int* nst_J) +int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *nst_J = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return retval; } + + /* set output and return */ *nst_J = arkls_mem->nstlj; return ARKLS_SUCCESS; } /*--------------------------------------------------------------- - arkLSGetWorkSpace returns the length of workspace allocated for + ARKodeGetLinWorkSpace returns the length of workspace allocated for the ARKLS linear solver interface. ---------------------------------------------------------------*/ -int arkLSGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -948,8 +1193,24 @@ int arkLSGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) long int lrw, liw; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *lenrw = *leniw = 0; + return (ARK_SUCCESS); + } + /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* start with fixed sizes plus vector/matrix pointers */ @@ -993,181 +1254,361 @@ int arkLSGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } /*--------------------------------------------------------------- - arkLSGetNumJacEvals returns the number of Jacobian evaluations + ARKodeGetNumJacEvals returns the number of Jacobian evaluations ---------------------------------------------------------------*/ -int arkLSGetNumJacEvals(void* arkode_mem, long int* njevals) +int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *njevals = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *njevals = arkls_mem->nje; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumRhsEvals returns the number of calls to the ODE + ARKodeGetNumLinRhsEvals returns the number of calls to the ODE function needed for the DQ Jacobian approximation or J*v product approximation. ---------------------------------------------------------------*/ -int arkLSGetNumRhsEvals(void* arkode_mem, long int* nfevalsLS) +int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *nfevalsLS = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nfevalsLS = arkls_mem->nfeDQ; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumPrecEvals returns the number of calls to the + ARKodeGetNumPrecEvals returns the number of calls to the user- or ARKODE-supplied preconditioner setup routine. ---------------------------------------------------------------*/ -int arkLSGetNumPrecEvals(void* arkode_mem, long int* npevals) +int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *npevals = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *npevals = arkls_mem->npe; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumPrecSolves returns the number of calls to the + ARKodeGetNumPrecSolves returns the number of calls to the user- or ARKODE-supplied preconditioner solve routine. ---------------------------------------------------------------*/ -int arkLSGetNumPrecSolves(void* arkode_mem, long int* npsolves) +int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *npsolves = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *npsolves = arkls_mem->nps; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumLinIters returns the number of linear iterations + ARKodeGetNumLinIters returns the number of linear iterations (if accessible from the LS object). ---------------------------------------------------------------*/ -int arkLSGetNumLinIters(void* arkode_mem, long int* nliters) +int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *nliters = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nliters = arkls_mem->nli; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumConvFails returns the number of linear solver + ARKodeGetNumLinConvFails returns the number of linear solver convergence failures (as reported by the LS object). ---------------------------------------------------------------*/ -int arkLSGetNumConvFails(void* arkode_mem, long int* nlcfails) +int ARKodeGetNumLinConvFails(void* arkode_mem, long int* nlcfails) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *nlcfails = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nlcfails = arkls_mem->ncfl; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumJTSetupEvals returns the number of calls to the + ARKodeGetNumJTSetupEvals returns the number of calls to the user-supplied Jacobian-vector product setup routine. ---------------------------------------------------------------*/ -int arkLSGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +int ARKodeGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *njtsetups = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *njtsetups = arkls_mem->njtsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumJtimesEvals returns the number of calls to the + ARKodeGetNumJtimesEvals returns the number of calls to the Jacobian-vector product multiply routine. ---------------------------------------------------------------*/ -int arkLSGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *njvevals = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structures */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *njvevals = arkls_mem->njtimes; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassMatvecSetups returns the number of calls to the + ARKodeGetNumMassMultSetups returns the number of calls to the mass matrix-vector setup routine. ---------------------------------------------------------------*/ -int arkLSGetNumMassMatvecSetups(void* arkode_mem, long int* nmvsetups) +int ARKodeGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmvsetups = 0; + return (ARK_SUCCESS); + } + + /* access ARKMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmvsetups = arkls_mem->nmvsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetLastFlag returns the last flag set in a ARKLS + ARKodeGetLastLinFlag returns the last flag set in a ARKLS function. ---------------------------------------------------------------*/ -int arkLSGetLastFlag(void* arkode_mem, long int* flag) +int ARKodeGetLastLinFlag(void* arkode_mem, long int* flag) { ARKodeMem ark_mem; ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure; set output value and return */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return success for incompatible steppers */ + if (!ark_mem->step_supports_implicit) + { + *flag = ARKLS_SUCCESS; + return (ARK_SUCCESS); + } + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *flag = arkls_mem->last_flag; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetReturnFlagName translates from the integer error code + ARKodeGetLinReturnFlagName translates from the integer error code returned by an ARKLs routine to the corresponding string equivalent for that flag ---------------------------------------------------------------*/ -char* arkLSGetReturnFlagName(long int flag) +char* ARKodeGetLinReturnFlagName(long int flag) { char* name = (char*)malloc(30 * sizeof(char)); @@ -1192,38 +1633,75 @@ char* arkLSGetReturnFlagName(long int flag) } /*--------------------------------------------------------------- - arkLSSetMassEpsLin specifies the nonlinear -> linear tolerance + ARKodeSetMassEpsLin specifies the nonlinear -> linear tolerance scale factor for mass matrix linear systems. ---------------------------------------------------------------*/ -int arkLSSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) +int ARKodeSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; store input and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* store input and return */ arkls_mem->eplifac = (eplifac <= ZERO) ? ARKLS_EPLIN : eplifac; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSSetMassNormFactor sets or computes the factor to use when + ARKodeSetMassLSNormFactor sets or computes the factor to use when converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm). ---------------------------------------------------------------*/ -int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac) +int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMem structure; store input and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* access ARKLsMem structures */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* store input and return */ if (nrmfac > ZERO) { /* set user-provided factor */ @@ -1245,11 +1723,11 @@ int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac) } /*--------------------------------------------------------------- - arkLSSetMassPreconditioner specifies the user-supplied + ARKodeSetMassPreconditioner specifies the user-supplied preconditioner setup and solve routines. ---------------------------------------------------------------*/ -int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve) +int ARKodeSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1257,8 +1735,25 @@ int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, SUNPSolveFn arkls_mpsolve; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if LS object does not allow user-supplied preconditioning */ @@ -1290,18 +1785,35 @@ int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, } /*--------------------------------------------------------------- - arkLSSetMassTimes specifies the user-supplied mass + ARKodeSetMassTimes specifies the user-supplied mass matrix-vector product setup and multiply routines. ---------------------------------------------------------------*/ -int arkLSSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data) +int ARKodeSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, + ARKLsMassTimesVecFn mtimes, void* mtimes_data) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* issue error if mtimes function is unusable */ @@ -1339,14 +1851,13 @@ int arkLSSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, } /* arkLSMassSetUserData sets user_data pointers in arkLSMass */ -int arkLSSetMassUserData(void* arkode_mem, void* user_data) +int arkLSSetMassUserData(ARKodeMem ark_mem, void* user_data) { - ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* Set data for mass matrix */ @@ -1361,9 +1872,9 @@ int arkLSSetMassUserData(void* arkode_mem, void* user_data) } /*--------------------------------------------------------------- - arkLSGetMassWorkSpace + ARKodeGetMassWorkSpace ---------------------------------------------------------------*/ -int arkLSGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; @@ -1371,8 +1882,24 @@ int arkLSGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) long int lrw, liw; int retval; + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *lenrw = *leniw = 0; + return (ARK_SUCCESS); + } + /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* start with fixed sizes plus vector/matrix pointers */ @@ -1416,170 +1943,350 @@ int arkLSGetMassWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } /*--------------------------------------------------------------- - arkLSGetNumMassSetups returns the number of mass matrix + ARKodeGetNumMassSetups returns the number of mass matrix solver 'setup' calls ---------------------------------------------------------------*/ -int arkLSGetNumMassSetups(void* arkode_mem, long int* nmsetups) +int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmsetups = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmsetups = arkls_mem->nmsetups; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassMult returns the number of calls to the user- + ARKodeGetNumMassMult returns the number of calls to the user- supplied or internal mass matrix-vector product multiply routine. ---------------------------------------------------------------*/ -int arkLSGetNumMassMult(void* arkode_mem, long int* nmvevals) +int ARKodeGetNumMassMult(void* arkode_mem, long int* nmvevals) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmvevals = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmvevals = arkls_mem->nmtimes; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassSolves returns the number of mass matrix + ARKodeGetNumMassSolves returns the number of mass matrix solver 'solve' calls ---------------------------------------------------------------*/ -int arkLSGetNumMassSolves(void* arkode_mem, long int* nmsolves) +int ARKodeGetNumMassSolves(void* arkode_mem, long int* nmsolves) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmsolves = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmsolves = arkls_mem->nmsolves; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassPrecEvals returns the number of calls to the + ARKodeGetNumMassPrecEvals returns the number of calls to the user- or ARKODE-supplied preconditioner setup routine. ---------------------------------------------------------------*/ -int arkLSGetNumMassPrecEvals(void* arkode_mem, long int* npevals) +int ARKodeGetNumMassPrecEvals(void* arkode_mem, long int* npevals) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *npevals = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *npevals = arkls_mem->npe; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassPrecSolves returns the number of calls to the + ARKodeGetNumMassPrecSolves returns the number of calls to the user- or ARKODE-supplied preconditioner solve routine. ---------------------------------------------------------------*/ -int arkLSGetNumMassPrecSolves(void* arkode_mem, long int* npsolves) +int ARKodeGetNumMassPrecSolves(void* arkode_mem, long int* npsolves) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *npsolves = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *npsolves = arkls_mem->nps; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassIters returns the number of mass matrix solver + ARKodeGetNumMassIters returns the number of mass matrix solver linear iterations (if accessible from the LS object). ---------------------------------------------------------------*/ -int arkLSGetNumMassIters(void* arkode_mem, long int* nmiters) +int ARKodeGetNumMassIters(void* arkode_mem, long int* nmiters) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmiters = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmiters = arkls_mem->nli; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMassConvFails returns the number of linear solver + ARKodeGetNumMassConvFails returns the number of linear solver convergence failures (as reported by the LS object). ---------------------------------------------------------------*/ -int arkLSGetNumMassConvFails(void* arkode_mem, long int* nmcfails) +int ARKodeGetNumMassConvFails(void* arkode_mem, long int* nmcfails) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmcfails = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *nmcfails = arkls_mem->ncfl; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetMassMatrix returns the current mass matrix. + ARKodeGetCurrentMassMatrix returns the current mass matrix. ---------------------------------------------------------------*/ -int arkLSGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) +int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return NULL for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *M = NULL; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *M = arkls_mem->M; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetNumMTSetups returns the number of calls to the + ARKodeGetNumMTSetups returns the number of calls to the user-supplied mass matrix-vector product setup routine. ---------------------------------------------------------------*/ -int arkLSGetNumMTSetups(void* arkode_mem, long int* nmtsetups) +int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetups) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return 0 for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *nmtsetups = 0; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output value and return */ *nmtsetups = arkls_mem->nmtsetup; return (ARKLS_SUCCESS); } /*--------------------------------------------------------------- - arkLSGetLastMassFlag returns the last flag set in a ARKLS + ARKodeGetLastMassFlag returns the last flag set in a ARKLS function. ---------------------------------------------------------------*/ -int arkLSGetLastMassFlag(void* arkode_mem, long int* flag) +int ARKodeGetLastMassFlag(void* arkode_mem, long int* flag) { ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure; set output value and return */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* Return immediately if arkode_mem is NULL */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return ARKLS_SUCCESS for incompatible steppers */ + if (!ark_mem->step_supports_massmatrix) + { + *flag = ARKLS_SUCCESS; + return (ARK_SUCCESS); + } + + /* access ARKLsMassMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } + + /* set output and return */ *flag = arkls_mem->last_flag; return (ARKLS_SUCCESS); } @@ -1608,8 +2315,8 @@ int arkLsATimes(void* arkode_mem, N_Vector v, N_Vector z) sunrealtype gamma, gamrat; sunbooleantype dgamma_fail, *jcur; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Access mass matrix solver (if it exists) */ @@ -1667,8 +2374,8 @@ int arkLsPSetup(void* arkode_mem) sunbooleantype dgamma_fail, *jcur; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get gamma values from time step module */ @@ -1708,8 +2415,8 @@ int arkLsPSolve(void* arkode_mem, N_Vector r, N_Vector z, sunrealtype tol, int l sunbooleantype dgamma_fail, *jcur; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get gamma values from time step module */ @@ -1743,8 +2450,8 @@ int arkLsMTimes(void* arkode_mem, N_Vector v, N_Vector z) ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMassMem structures */ + retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform multiply by either calling the user-supplied routine @@ -1799,8 +2506,8 @@ int arkLsMPSetup(void* arkode_mem) ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMassMem structures */ + retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* only proceed if the mass matrix is time-independent or if @@ -1830,8 +2537,8 @@ int arkLsMPSolve(void* arkode_mem, N_Vector r, N_Vector z, sunrealtype tol, int ARKLsMassMem arkls_mem; int retval; - /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMassMem structures */ + retval = arkLs_AccessARKODEMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* call the user-supplied psolve routine, and accumulate count */ @@ -1855,8 +2562,8 @@ int arkLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, ARKRhsFn fi; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* verify that Jac is non-NULL */ @@ -2129,8 +2836,8 @@ int arkLsDQJtimes(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector y, sunrealtype sig, siginv; int iter, retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Initialize perturbation to 1/||v|| */ @@ -2175,8 +2882,8 @@ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, ARKLsMem arkls_mem; int retval; - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + /* access ARKodeMem and ARKLsMem structures */ + retval = arkLs_AccessARKODELMem(arkode_mem, __func__, &ark_mem, &arkls_mem); if (retval != ARKLS_SUCCESS) { return (retval); } /* Check if Jacobian needs to be updated */ @@ -2260,25 +2967,23 @@ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, arkLsInitialize performs remaining initializations specific to the linear solver interface (and solver itself) ---------------------------------------------------------------*/ -int arkLsInitialize(void* arkode_mem) +int arkLsInitialize(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKLsMem arkls_mem; ARKLsMassMem arkls_massmem; int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* access ARKLsMassMem (if applicable) */ arkls_massmem = NULL; if (ark_mem->step_getmassmem != NULL) { - if (ark_mem->step_getmassmem(arkode_mem) != NULL) + if (ark_mem->step_getmassmem(ark_mem) != NULL) { - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, - &arkls_massmem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_massmem); if (retval != ARK_SUCCESS) { return (retval); } } } @@ -2419,13 +3124,13 @@ int arkLsInitialize(void* arkode_mem) if ((arkls_mem->A == NULL) && (arkls_mem->pset == NULL) && (ark_mem->step_disablelsetup != NULL)) { - ark_mem->step_disablelsetup(arkode_mem); + ark_mem->step_disablelsetup(ark_mem); } /* When using a matrix-embedded linear solver, disable lsetup call and solution scaling */ if (SUNLinSolGetType(arkls_mem->LS) == SUNLINEARSOLVER_MATRIX_EMBEDDED) { - ark_mem->step_disablelsetup(arkode_mem); + ark_mem->step_disablelsetup(ark_mem); arkls_mem->scalesol = SUNFALSE; } @@ -2447,11 +3152,10 @@ int arkLsInitialize(void* arkode_mem) This routine then calls the LS 'setup' routine with A. ---------------------------------------------------------------*/ -int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, +int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { - ARKodeMem ark_mem = NULL; ARKLsMem arkls_mem = NULL; void* ark_step_massmem = NULL; SUNMatrix M = NULL; @@ -2460,7 +3164,7 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, int retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Immediately return when using matrix-embedded linear solver */ @@ -2477,7 +3181,7 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, arkls_mem->fcur = fpred; /* get gamma values from time step module */ - arkls_mem->last_flag = ark_mem->step_getgammas(arkode_mem, &gamma, &gamrat, + arkls_mem->last_flag = ark_mem->step_getgammas(ark_mem, &gamma, &gamrat, &jcur, &dgamma_fail); if (arkls_mem->last_flag) { @@ -2498,7 +3202,7 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, /* Check for mass matrix module and setup mass matrix */ if (ark_mem->step_getmassmem) { - ark_step_massmem = ark_mem->step_getmassmem(arkode_mem); + ark_step_massmem = ark_mem->step_getmassmem(ark_mem); } if (ark_step_massmem) @@ -2507,8 +3211,7 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, M = ((ARKLsMassMem)ark_step_massmem)->M; /* Setup mass matrix linear solver (including recomputation of mass matrix) */ - arkls_mem->last_flag = arkLsMassSetup(arkode_mem, tpred, vtemp1, vtemp2, - vtemp3); + arkls_mem->last_flag = arkLsMassSetup(ark_mem, tpred, vtemp1, vtemp2, vtemp3); if (arkls_mem->last_flag) { arkProcessError(ark_mem, ARKLS_SUNMAT_FAIL, __LINE__, __func__, __FILE__, @@ -2591,11 +3294,10 @@ int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, When using a non-NULL SUNMatrix, this will additionally scale the solution appropriately when gamrat != 1. ---------------------------------------------------------------*/ -int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, +int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, N_Vector fnow, sunrealtype eRNrm, int mnewt) { sunrealtype bnorm, resnorm; - ARKodeMem ark_mem; ARKLsMem arkls_mem; sunrealtype gamma, gamrat, delta, deltar, rwt_mean; sunbooleantype dgamma_fail, *jcur; @@ -2603,7 +3305,7 @@ int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, int nli_inc, retval; /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set scalar tcur and vectors ycur and fcur for use by the @@ -2697,7 +3399,7 @@ int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, account for change in gamma (this is only beneficial if M==I) */ if (arkls_mem->scalesol) { - arkls_mem->last_flag = ark_mem->step_getgammas(arkode_mem, &gamma, &gamrat, + arkls_mem->last_flag = ark_mem->step_getgammas(ark_mem, &gamma, &gamrat, &jcur, &dgamma_fail); if (arkls_mem->last_flag != ARK_SUCCESS) { @@ -2787,16 +3489,14 @@ int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, arkLsFree frees memory associates with the ARKLs system solver interface. ---------------------------------------------------------------*/ -int arkLsFree(void* arkode_mem) +int arkLsFree(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKLsMem arkls_mem; void* ark_step_lmem; /* Return immediately if ARKodeMem, ARKLsMem are NULL */ - if (arkode_mem == NULL) { return (ARKLS_SUCCESS); } - ark_mem = (ARKodeMem)arkode_mem; - ark_step_lmem = ark_mem->step_getlinmem(arkode_mem); + if (ark_mem == NULL) { return (ARKLS_SUCCESS); } + ark_step_lmem = ark_mem->step_getlinmem(ark_mem); if (ark_step_lmem == NULL) { return (ARKLS_SUCCESS); } arkls_mem = (ARKLsMem)ark_step_lmem; @@ -2839,14 +3539,13 @@ int arkLsFree(void* arkode_mem) arkLsMassInitialize performs remaining initializations specific to the mass matrix solver interface (and solver itself) ---------------------------------------------------------------*/ -int arkLsMassInitialize(void* arkode_mem) +int arkLsMassInitialize(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKLsMassMem arkls_mem; int retval; /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* reset counters */ @@ -2898,13 +3597,13 @@ int arkLsMassInitialize(void* arkode_mem) if ((arkls_mem->M == NULL) && (arkls_mem->pset == NULL) && (arkls_mem->mtsetup == NULL) && (ark_mem->step_disablemsetup != NULL)) { - ark_mem->step_disablemsetup(arkode_mem); + ark_mem->step_disablemsetup(ark_mem); } /* When using a matrix-embedded linear solver, disable lsetup call */ if (SUNLinSolGetType(arkls_mem->LS) == SUNLINEARSOLVER_MATRIX_EMBEDDED) { - ark_mem->step_disablemsetup(arkode_mem); + ark_mem->step_disablemsetup(ark_mem); } /* Call LS initialize routine */ @@ -2915,16 +3614,15 @@ int arkLsMassInitialize(void* arkode_mem) /*--------------------------------------------------------------- arkLsMassSetup calls the LS 'setup' routine. ---------------------------------------------------------------*/ -int arkLsMassSetup(void* arkode_mem, sunrealtype t, N_Vector vtemp1, +int arkLsMassSetup(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) { - ARKodeMem ark_mem; ARKLsMassMem arkls_mem; sunbooleantype call_mtsetup, call_mvsetup, call_lssetup; int retval; /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Immediately return when using matrix-embedded linear solver */ @@ -3069,16 +3767,15 @@ int arkLsMassSetup(void* arkode_mem, sunrealtype t, N_Vector vtemp1, and scaling vectors, calling the solver, and accumulating statistics from the solve for use/reporting by ARKODE. ---------------------------------------------------------------*/ -int arkLsMassSolve(void* arkode_mem, N_Vector b, sunrealtype nlscoef) +int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) { sunrealtype resnorm, delta, rwt_mean; - ARKodeMem ark_mem; ARKLsMassMem arkls_mem; long int nps_inc; int nli_inc, retval; /* access ARKLsMassMem structure */ - retval = arkLs_AccessMassMem(arkode_mem, __func__, &ark_mem, &arkls_mem); + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set input tolerance for iterative solvers (in 2-norm) */ @@ -3214,16 +3911,14 @@ int arkLsMassSolve(void* arkode_mem, N_Vector b, sunrealtype nlscoef) arkLsMassFree frees memory associates with the ARKLs mass matrix solver interface. ---------------------------------------------------------------*/ -int arkLsMassFree(void* arkode_mem) +int arkLsMassFree(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKLsMassMem arkls_mem; void* ark_step_massmem; /* Return immediately if ARKodeMem, ARKLsMassMem are NULL */ - if (arkode_mem == NULL) { return (ARKLS_SUCCESS); } - ark_mem = (ARKodeMem)arkode_mem; - ark_step_massmem = ark_mem->step_getmassmem(arkode_mem); + if (ark_mem == NULL) { return (ARKLS_SUCCESS); } + ark_step_massmem = ark_mem->step_getmassmem(ark_mem); if (ark_step_massmem == NULL) { return (ARKLS_SUCCESS); } arkls_mem = (ARKLsMassMem)ark_step_massmem; @@ -3309,14 +4004,16 @@ int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem) } /*--------------------------------------------------------------- - arkLs_AccessLMem and arkLs_AccessMassMem: + arkLs_AccessARKODELMem, arkLs_AccessLMem, + arkLs_AccessARKODEMassMem and arkLs_AccessMassMem: Shortcut routines to unpack ark_mem, ls_mem and mass_mem - structures from void* pointer. If any is missing it returns - ARKLS_MEM_NULL, ARKLS_LMEM_NULL or ARKLS_MASSMEM_NULL. + structures from void* pointer and ark_mem structure. If any + is missing it returns ARKLS_MEM_NULL, ARKLS_LMEM_NULL or + ARKLS_MASSMEM_NULL. ---------------------------------------------------------------*/ -int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, - ARKLsMem* arkls_mem) +int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKLsMem* arkls_mem) { void* ark_step_lmem; if (arkode_mem == NULL) @@ -3326,7 +4023,7 @@ int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, return (ARKLS_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; - ark_step_lmem = (*ark_mem)->step_getlinmem(arkode_mem); + ark_step_lmem = (*ark_mem)->step_getlinmem(*ark_mem); if (ark_step_lmem == NULL) { arkProcessError(*ark_mem, ARKLS_LMEM_NULL, __LINE__, fname, __FILE__, @@ -3337,8 +4034,22 @@ int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, return (ARKLS_SUCCESS); } -int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, - ARKLsMassMem* arkls_mem) +int arkLs_AccessLMem(ARKodeMem ark_mem, const char* fname, ARKLsMem* arkls_mem) +{ + void* ark_step_lmem; + ark_step_lmem = ark_mem->step_getlinmem(ark_mem); + if (ark_step_lmem == NULL) + { + arkProcessError(ark_mem, ARKLS_LMEM_NULL, __LINE__, fname, __FILE__, + MSG_LS_LMEM_NULL); + return (ARKLS_LMEM_NULL); + } + *arkls_mem = (ARKLsMem)ark_step_lmem; + return (ARKLS_SUCCESS); +} + +int arkLs_AccessARKODEMassMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKLsMassMem* arkls_mem) { void* ark_step_massmem; if (arkode_mem == NULL) @@ -3348,7 +4059,7 @@ int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, return (ARKLS_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; - ark_step_massmem = (*ark_mem)->step_getmassmem(arkode_mem); + ark_step_massmem = (*ark_mem)->step_getmassmem(*ark_mem); if (ark_step_massmem == NULL) { arkProcessError(*ark_mem, ARKLS_MASSMEM_NULL, __LINE__, fname, __FILE__, @@ -3359,6 +4070,21 @@ int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, return (ARKLS_SUCCESS); } +int arkLs_AccessMassMem(ARKodeMem ark_mem, const char* fname, + ARKLsMassMem* arkls_mem) +{ + void* ark_step_massmem; + ark_step_massmem = ark_mem->step_getmassmem(ark_mem); + if (ark_step_massmem == NULL) + { + arkProcessError(ark_mem, ARKLS_MASSMEM_NULL, __LINE__, fname, __FILE__, + MSG_LS_MASSMEM_NULL); + return (ARKLS_MASSMEM_NULL); + } + *arkls_mem = (ARKLsMassMem)ark_step_massmem; + return (ARKLS_SUCCESS); +} + /*--------------------------------------------------------------- EOF ---------------------------------------------------------------*/ diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index 8dc2723c2f..21c869536e 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -217,97 +217,56 @@ int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, N_Vector tmp1, N_Vector tmp2); /* Generic linit/lsetup/lsolve/lfree interface routines for ARKODE to call */ -int arkLsInitialize(void* arkode_mem); +int arkLsInitialize(ARKodeMem ark_mem); -int arkLsSetup(void* arkode_mem, int convfail, sunrealtype tpred, +int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); -int arkLsSolve(void* arkode_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, +int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, N_Vector fcur, sunrealtype eRnrm, int mnewt); -int arkLsFree(void* arkode_mem); +int arkLsFree(ARKodeMem ark_mem); /* Generic minit/msetup/mmult/msolve/mfree routines for ARKODE to call */ -int arkLsMassInitialize(void* arkode_mem); +int arkLsMassInitialize(ARKodeMem ark_mem); -int arkLsMassSetup(void* arkode_mem, sunrealtype t, N_Vector vtemp1, +int arkLsMassSetup(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); int arkLsMassMult(void* arkode_mem, N_Vector v, N_Vector Mv); -int arkLsMassSolve(void* arkode_mem, N_Vector b, sunrealtype nlscoef); +int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef); -int arkLsMassFree(void* arkode_mem); +int arkLsMassFree(ARKodeMem ark_mem); /* Auxilliary functions */ int arkLsInitializeCounters(ARKLsMem arkls_mem); int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem); -int arkLs_AccessLMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, - ARKLsMem* arkls_mem); +int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKLsMem* arkls_mem); -int arkLs_AccessMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, +int arkLs_AccessLMem(ARKodeMem ark_mem, const char* fname, ARKLsMem* arkls_mem); + +int arkLs_AccessARKODEMassMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKLsMassMem* arkls_mem); + +int arkLs_AccessMassMem(ARKodeMem ark_mem, const char* fname, ARKLsMassMem* arkls_mem); /* Set/get routines called by time-stepper module */ -int arkLSSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); +int arkLSSetLinearSolver(ARKodeMem ark_mem, SUNLinearSolver LS, SUNMatrix A); -int arkLSSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, +int arkLSSetMassLinearSolver(ARKodeMem ark_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep); -int arkLSSetJacFn(void* arkode_mem, ARKLsJacFn jac); -int arkLSSetMassFn(void* arkode_mem, ARKLsMassFn mass); -int arkLSSetEpsLin(void* arkode_mem, sunrealtype eplifac); -int arkLSSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); -int arkLSSetNormFactor(void* arkode_mem, sunrealtype nrmfac); -int arkLSSetMassNormFactor(void* arkode_mem, sunrealtype nrmfac); -int arkLSSetJacEvalFrequency(void* arkode_mem, long int msbj); -int arkLSSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); -int arkLSSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve); -int arkLSSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve); -int arkLSSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes); -int arkLSSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); -int arkLSSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data); -int arkLSSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); - -int arkLSSetUserData(void* arkode_mem, void* user_data); -int arkLSSetMassUserData(void* arkode_mem, void* user_data); - -int arkLSGetJac(void* arkode_mem, SUNMatrix* J); -int arkLSGetJacTime(void* arkode_mem, sunrealtype* t_J); -int arkLSGetJacNumSteps(void* arkode_mem, long int* nst_J); -int arkLSGetWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS); -int arkLSGetNumJacEvals(void* arkode_mem, long int* njevals); -int arkLSGetNumPrecEvals(void* arkode_mem, long int* npevals); -int arkLSGetNumPrecSolves(void* arkode_mem, long int* npsolves); -int arkLSGetNumLinIters(void* arkode_mem, long int* nliters); -int arkLSGetNumConvFails(void* arkode_mem, long int* nlcfails); -int arkLSGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); -int arkLSGetNumJtimesEvals(void* arkode_mem, long int* njvevals); -int arkLSGetNumRhsEvals(void* arkode_mem, long int* nfevalsLS); -int arkLSGetLastFlag(void* arkode_mem, long int* flag); - -int arkLSGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, - long int* leniwMLS); -int arkLSGetNumMassSetups(void* arkode_mem, long int* nmsetups); -int arkLSGetNumMassMult(void* arkode_mem, long int* nmvevals); -int arkLSGetNumMassMatvecSetups(void* arkode_mem, long int* nmvsetups); -int arkLSGetNumMassSolves(void* arkode_mem, long int* nmsolves); -int arkLSGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals); -int arkLSGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves); -int arkLSGetNumMassIters(void* arkode_mem, long int* nmiters); -int arkLSGetNumMassConvFails(void* arkode_mem, long int* nmcfails); -int arkLSGetNumMTSetups(void* arkode_mem, long int* nmtsetups); -int arkLSGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); -int arkLSGetLastMassFlag(void* arkode_mem, long int* flag); - -char* arkLSGetReturnFlagName(long int flag); +int arkLSSetUserData(ARKodeMem ark_mem, void* user_data); + +int arkLSSetMassUserData(ARKodeMem ark_mem, void* user_data); + +int arkLSGetCurrentMassMatrix(ARKodeMem ark_mem, SUNMatrix* M); /*--------------------------------------------------------------- Error Messages diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index c637516aa8..b84e417e99 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -99,29 +99,59 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_ARKMEM_FAIL); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } memset(step_mem, 0, sizeof(struct ARKodeMRIStepMemRec)); /* Attach step_mem structure and function pointers to ark_mem */ - ark_mem->step_attachlinsol = mriStep_AttachLinsol; - ark_mem->step_disablelsetup = mriStep_DisableLSetup; - ark_mem->step_getlinmem = mriStep_GetLmem; - ark_mem->step_getimplicitrhs = mriStep_GetImplicitRHS; - ark_mem->step_getgammas = mriStep_GetGammas; - ark_mem->step_init = mriStep_Init; - ark_mem->step_fullrhs = mriStep_FullRHS; - ark_mem->step = mriStep_TakeStep; - ark_mem->step_mem = (void*)step_mem; - - /* Set default values for MRIStep optional inputs */ - retval = MRIStepSetDefaults((void*)ark_mem); + ark_mem->step_attachlinsol = mriStep_AttachLinsol; + ark_mem->step_disablelsetup = mriStep_DisableLSetup; + ark_mem->step_getlinmem = mriStep_GetLmem; + ark_mem->step_getimplicitrhs = mriStep_GetImplicitRHS; + ark_mem->step_getgammas = mriStep_GetGammas; + ark_mem->step_init = mriStep_Init; + ark_mem->step_fullrhs = mriStep_FullRHS; + ark_mem->step = mriStep_TakeStep; + ark_mem->step_setuserdata = mriStep_SetUserData; + ark_mem->step_printallstats = mriStep_PrintAllStats; + ark_mem->step_writeparameters = mriStep_WriteParameters; + ark_mem->step_resize = mriStep_Resize; + ark_mem->step_reset = mriStep_Reset; + ark_mem->step_free = mriStep_Free; + ark_mem->step_printmem = mriStep_PrintMem; + ark_mem->step_setdefaults = mriStep_SetDefaults; + ark_mem->step_computestate = mriStep_ComputeState; + ark_mem->step_setorder = mriStep_SetOrder; + ark_mem->step_setnonlinearsolver = mriStep_SetNonlinearSolver; + ark_mem->step_setlinear = mriStep_SetLinear; + ark_mem->step_setnonlinear = mriStep_SetNonlinear; + ark_mem->step_setnlsrhsfn = mriStep_SetNlsRhsFn; + ark_mem->step_setdeduceimplicitrhs = mriStep_SetDeduceImplicitRhs; + ark_mem->step_setnonlincrdown = mriStep_SetNonlinCRDown; + ark_mem->step_setnonlinrdiv = mriStep_SetNonlinRDiv; + ark_mem->step_setdeltagammamax = mriStep_SetDeltaGammaMax; + ark_mem->step_setlsetupfrequency = mriStep_SetLSetupFrequency; + ark_mem->step_setpredictormethod = mriStep_SetPredictorMethod; + ark_mem->step_setmaxnonliniters = mriStep_SetMaxNonlinIters; + ark_mem->step_setnonlinconvcoef = mriStep_SetNonlinConvCoef; + ark_mem->step_setstagepredictfn = mriStep_SetStagePredictFn; + ark_mem->step_getnumlinsolvsetups = mriStep_GetNumLinSolvSetups; + ark_mem->step_getcurrentgamma = mriStep_GetCurrentGamma; + ark_mem->step_getnonlinearsystemdata = mriStep_GetNonlinearSystemData; + ark_mem->step_getnumnonlinsolviters = mriStep_GetNumNonlinSolvIters; + ark_mem->step_getnumnonlinsolvconvfails = mriStep_GetNumNonlinSolvConvFails; + ark_mem->step_getnonlinsolvstats = mriStep_GetNonlinSolvStats; + ark_mem->step_supports_implicit = SUNTRUE; + ark_mem->step_mem = (void*)step_mem; + + /* Set default values for optional inputs */ + retval = mriStep_SetDefaults((void*)ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -153,15 +183,15 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error creating default Newton solver"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } - retval = MRIStepSetNonlinearSolver(ark_mem, NLS); + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error attaching default Newton solver"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } step_mem->ownNLS = SUNTRUE; @@ -196,7 +226,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -209,7 +239,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, "A required inner stepper function is NULL"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -218,26 +248,23 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, } /*--------------------------------------------------------------- - MRIStepResize: + mriStep_Resize: This routine resizes the memory within the MRIStep module. - It first resizes the main ARKODE infrastructure memory, and - then resizes its own data. ---------------------------------------------------------------*/ -int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data) +int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; SUNNonlinearSolver NLS; sunindextype lrw1, liw1, lrw_diff, liw_diff; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Determing change in vector sizes */ + /* Determine change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -245,15 +272,6 @@ int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, ark_mem->lrw1 = lrw1; ark_mem->liw1 = liw1; - /* resize ARKODE infrastructure memory (use hscale = 1.0) */ - retval = arkResize(ark_mem, y0, SUN_RCONST(1.0), t0, resize, resize_data); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to resize main ARKODE infrastructure"); - return (retval); - } - /* Resize Fse */ if (step_mem->Fse) { @@ -331,8 +349,8 @@ int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, return (ARK_MEM_FAIL); } - /* attach new Newton NLS object to MRIStep */ - retval = MRIStepSetNonlinearSolver(ark_mem, NLS); + /* attach new Newton NLS object */ + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, @@ -376,8 +394,8 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, SUNNonlinearSolver NLS; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -417,15 +435,15 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error creating default Newton solver"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (ARK_MEM_FAIL); } - retval = MRIStepSetNonlinearSolver(ark_mem, NLS); + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Error attaching default Newton solver"); - MRIStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (ARK_MEM_FAIL); } step_mem->ownNLS = SUNTRUE; @@ -455,32 +473,22 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, } /*--------------------------------------------------------------- - MRIStepReset: + mriStep_Reset: This routine resets the MRIStep module state to solve the same problem from the given time with the input state (all counter - values are retained). + values are retained). It is called after the main ARKODE + infrastructure is reset. ---------------------------------------------------------------*/ -int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +int mriStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Initialize main ARKODE infrastructure */ - retval = arkInit(ark_mem, tR, yR, RESET_INIT); - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to initialize main ARKODE infrastructure"); - return (retval); - } - /* Reset the inner integrator with this same state */ retval = mriStepInnerStepper_Reset(step_mem->stepper, tR, yR); if (retval != ARK_SUCCESS) { return (ARK_INNERSTEP_FAIL); } @@ -489,136 +497,17 @@ int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) } /*--------------------------------------------------------------- - MRIStepSStolerances, MRIStepSVtolerances, MRIStepWFtolerances: - - These routines set integration tolerances (wrappers for general - ARKODE utility routines) - ---------------------------------------------------------------*/ -int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - /* unpack ark_mem, call arkSStolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSStolerances(ark_mem, reltol, abstol)); -} - -int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - /* unpack ark_mem, call arkSVtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkSVtolerances(ark_mem, reltol, abstol)); -} - -int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - /* unpack ark_mem, call arkWFtolerances, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkWFtolerances(ark_mem, efun)); -} - -/*--------------------------------------------------------------- - MRIStepRootInit: - - Initialize (attach) a rootfinding problem to the stepper - (wrappers for general ARKODE utility routine) - ---------------------------------------------------------------*/ -int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - /* unpack ark_mem, call arkRootInit, and return */ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkRootInit(ark_mem, nrtfn, g)); -} - -/*--------------------------------------------------------------- - MRIStepEvolve: - - This is the main time-integration driver (wrappers for general - ARKODE utility routine) - ---------------------------------------------------------------*/ -int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - /* unpack ark_mem, call arkEvolve, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkEvolve(ark_mem, tout, yout, tret, itask); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - MRIStepGetDky: - - This returns interpolated output of the solution or its - derivatives over the most-recently-computed step (wrapper for - generic ARKODE utility routine) - ---------------------------------------------------------------*/ -int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - /* unpack ark_mem, call arkGetDky, and return */ - int retval; - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkGetDky(ark_mem, t, k, dky); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - MRIStepComputeState: + mriStep_ComputeState: Computes y based on the current prediction and given correction. ---------------------------------------------------------------*/ -int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +int mriStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z) { int retval; - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, z); @@ -627,20 +516,17 @@ int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) } /*--------------------------------------------------------------- - MRIStepFree frees all MRIStep memory, and then calls an ARKODE - utility routine to free the ARKODE infrastructure memory. + mriStep_Free frees all MRIStep memory. ---------------------------------------------------------------*/ -void MRIStepFree(void** arkode_mem) +void mriStep_Free(ARKodeMem ark_mem) { sunindextype Cliw, Clrw; - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; - /* nothing to do if arkode_mem is already NULL */ - if (*arkode_mem == NULL) { return; } + /* nothing to do if ark_mem is already NULL */ + if (ark_mem == NULL) { return; } /* conditional frees on non-NULL MRIStep module */ - ark_mem = (ARKodeMem)(*arkode_mem); if (ark_mem->step_mem != NULL) { step_mem = (ARKodeMRIStepMem)ark_mem->step_mem; @@ -745,35 +631,23 @@ void MRIStepFree(void** arkode_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } - - /* free memory for overall ARKODE infrastructure */ - arkFree(arkode_mem); } /*--------------------------------------------------------------- - MRIStepPrintMem: + mriStep_PrintMem: - This routine outputs the memory from the MRIStep structure and - the main ARKODE infrastructure to a specified file pointer - (useful when debugging). + This routine outputs the memory from the MRIStep structure to + a specified file pointer (useful when debugging). ---------------------------------------------------------------*/ -void MRIStepPrintMem(void* arkode_mem, FILE* outfile) +void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int i, retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return; } - /* if outfile==NULL, set it to stdout */ - if (outfile == NULL) { outfile = stdout; } - - /* output data from main ARKODE infrastructure */ - fprintf(outfile, "MRIStep Slow Stepper Mem:\n"); - arkPrintMem(ark_mem, outfile); - /* output integer quantities */ fprintf(outfile, "MRIStep: q = %i\n", step_mem->q); fprintf(outfile, "MRIStep: p = %i\n", step_mem->p); @@ -857,7 +731,6 @@ void MRIStepPrintMem(void* arkode_mem, FILE* outfile) /* print the inner stepper memory */ mriStepInnerStepper_PrintMem(step_mem->stepper, outfile); - return; } @@ -876,21 +749,20 @@ void MRIStepPrintMem(void* arkode_mem, FILE* outfile) interface routines, data structure, and solver type to the MRIStep module. ---------------------------------------------------------------*/ -int mriStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, +int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* free any existing system solver */ - if (step_mem->lfree != NULL) { step_mem->lfree(arkode_mem); } + if (step_mem->lfree != NULL) { step_mem->lfree(ark_mem); } /* Attach the provided routines, data structure and solve type */ step_mem->linit = linit; @@ -912,14 +784,13 @@ int mriStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, This routine NULLifies the lsetup function pointer in the MRIStep module. ---------------------------------------------------------------*/ -void mriStep_DisableLSetup(void* arkode_mem) +void mriStep_DisableLSetup(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return; } /* nullify the lsetup function pointer */ @@ -932,14 +803,13 @@ void mriStep_DisableLSetup(void* arkode_mem) This routine returns the system linear solver interface memory structure, lmem. ---------------------------------------------------------------*/ -void* mriStep_GetLmem(void* arkode_mem) +void* mriStep_GetLmem(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure, and return lmem */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } return (step_mem->lmem); } @@ -949,14 +819,13 @@ void* mriStep_GetLmem(void* arkode_mem) This routine returns the implicit RHS function pointer, fi. ---------------------------------------------------------------*/ -ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem) +ARKRhsFn mriStep_GetImplicitRHS(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure, and return fi */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (NULL); } if (step_mem->implicit_rhs) { return (step_mem->fsi); } else { return (NULL); } @@ -968,15 +837,14 @@ ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem) This routine fills the current value of gamma, and states whether the gamma ratio fails the dgmax criteria. ---------------------------------------------------------------*/ -int mriStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, +int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set outputs */ @@ -1002,15 +870,14 @@ int mriStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int mriStep_Init(void* arkode_mem, int init_type) +int mriStep_Init(ARKodeMem ark_mem, int init_type) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval, j; sunbooleantype reset_efun; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -1302,15 +1169,14 @@ int mriStep_Init(void* arkode_mem, int init_type) Presently ff(t,y) is always called with ARK_FULLRHS_OTHER mode. ----------------------------------------------------------------------------*/ -int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* ensure that inner stepper provides fullrhs function */ @@ -1541,9 +1407,8 @@ int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, reduce step and retry (if possible) <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int mriStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) +int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { - ARKodeMem ark_mem; /* outer ARKODE memory */ ARKodeMRIStepMem step_mem; /* outer stepper memory */ int is; /* current stage index */ int retval; /* reusable return flag */ @@ -1554,7 +1419,7 @@ int mriStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) *dsmPtr = ZERO; /* access the MRIStep mem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* call nonlinear solver setup if it exists */ @@ -1760,13 +1625,13 @@ int mriStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - mriStep_AccessStepMem: + mriStep_AccessARKODEStepMem: Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int mriStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem) +int mriStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -1776,6 +1641,8 @@ int mriStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; + + /* access ARKodeMRIStepMem structure */ if ((*ark_mem)->step_mem == NULL) { arkProcessError(*ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, @@ -1786,6 +1653,26 @@ int mriStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + mriStep_AccessStepMem: + + Shortcut routine to unpack step_mem structure from ark_mem. + If missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int mriStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeMRIStepMem* step_mem) +{ + /* access ARKodeMRIStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_MRISTEP_NO_MEM); + return (ARK_MEM_NULL); + } + *step_mem = (ARKodeMRIStepMem)ark_mem->step_mem; + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- mriStep_CheckNVector: diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index e3e1a6e990..f875810246 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -186,23 +186,59 @@ struct _MRIStepInnerStepper ===============================================================*/ /* Interface routines supplied to ARKODE */ -int mriStep_AttachLinsol(void* arkode_mem, ARKLinsolInitFn linit, +int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); -void mriStep_DisableLSetup(void* arkode_mem); -int mriStep_Init(void* arkode_mem, int init_type); -void* mriStep_GetLmem(void* arkode_mem); -ARKRhsFn mriStep_GetImplicitRHS(void* arkode_mem); -int mriStep_GetGammas(void* arkode_mem, sunrealtype* gamma, sunrealtype* gamrat, +void mriStep_DisableLSetup(ARKodeMem ark_mem); +int mriStep_Init(ARKodeMem ark_mem, int init_type); +void* mriStep_GetLmem(ARKodeMem ark_mem); +ARKRhsFn mriStep_GetImplicitRHS(ARKodeMem ark_mem); +int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail); -int mriStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int mriStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); +int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data); +int mriStep_SetDefaults(ARKodeMem ark_mem); +int mriStep_SetOrder(ARKodeMem ark_mem, int ord); +int mriStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS); +int mriStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi); +int mriStep_SetLinear(ARKodeMem ark_mem, int timedepend); +int mriStep_SetNonlinear(ARKodeMem ark_mem); +int mriStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown); +int mriStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv); +int mriStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax); +int mriStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp); +int mriStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method); +int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor); +int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef); +int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); +int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce); +int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma); +int mriStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); +int mriStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups); +int mriStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters); +int mriStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails); +int mriStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, + long int* nnfails); +int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); +int mriStep_WriteParameters(ARKodeMem ark_mem, FILE* fp); +int mriStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); +int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +int mriStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z); +void mriStep_Free(ARKodeMem ark_mem); +void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); /* Internal utility routines */ -int mriStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem); +int mriStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeMRIStepMem* step_mem); +int mriStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeMRIStepMem* step_mem); sunbooleantype mriStep_CheckNVector(N_Vector tmpl); int mriStep_SetCoupling(ARKodeMem ark_mem); int mriStep_CheckCoupling(ARKodeMem ark_mem); diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 376bcb2385..116266fea1 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -27,65 +27,203 @@ MRIStep Optional input functions (wrappers for generic ARKODE utility routines). All are documented in arkode_io.c. ===============================================================*/ +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data) +{ + return (ARKodeResize(arkode_mem, y0, ONE, t0, resize, resize_data)); +} + +int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +void MRIStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void MRIStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +{ + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); +} + +int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +{ + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); +} + +int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + return (ARKodeWFtolerances(arkode_mem, efun)); +} + +int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (ARKodeSetFixedStep(arkode_mem, hfixed)); +} + +int MRIStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} + +int MRIStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int MRIStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} + int MRIStepSetDenseOrder(void* arkode_mem, int dord) { - return (MRIStepSetInterpolantDegree(arkode_mem, dord)); + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); +} + +int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +{ + return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); +} + +int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +{ + return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); +} + +int MRIStepSetLinear(void* arkode_mem, int timedepend) +{ + return (ARKodeSetLinear(arkode_mem, timedepend)); +} + +int MRIStepSetNonlinear(void* arkode_mem) +{ + return (ARKodeSetNonlinear(arkode_mem)); +} + +int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +{ + return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); +} + +int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +{ + return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); +} + +int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +{ + return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); +} + +int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) +{ + return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); +} + +int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) +{ + return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); +} + +int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +{ + return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); +} + +int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +{ + return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); +} + +int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +{ + return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); +} + +int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +{ + return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); +} + +int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); } int MRIStepSetInterpolantDegree(void* arkode_mem, int degree) { - if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } - return (arkSetInterpolantDegree(arkode_mem, degree)); + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); } int MRIStepSetInterpolantType(void* arkode_mem, int itype) { - return (arkSetInterpolantType(arkode_mem, itype)); + return (ARKodeSetInterpolantType(arkode_mem, itype)); } int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - return (arkSetMaxNumSteps(arkode_mem, mxsteps)); + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); } int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) { - return (arkSetMaxHnilWarns(arkode_mem, mxhnil)); + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); } int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - return (arkSetStopTime(arkode_mem, tstop)); + return (ARKodeSetStopTime(arkode_mem, tstop)); } int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { - return (arkSetInterpolateStopTime(arkode_mem, interp)); + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); } int MRIStepClearStopTime(void* arkode_mem) { - return (arkClearStopTime(arkode_mem)); + return (ARKodeClearStopTime(arkode_mem)); } int MRIStepSetRootDirection(void* arkode_mem, int* rootdir) { - return (arkSetRootDirection(arkode_mem, rootdir)); + return (ARKodeSetRootDirection(arkode_mem, rootdir)); } int MRIStepSetNoInactiveRootWarn(void* arkode_mem) { - return (arkSetNoInactiveRootWarn(arkode_mem)); + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); } int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { - return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); } /*--------------------------------------------------------------- @@ -94,54 +232,54 @@ int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage ---------------------------------------------------------------*/ int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) { - return (arkLSSetLinearSolver(arkode_mem, LS, A)); + return (ARKodeSetLinearSolver(arkode_mem, LS, A)); } int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) { - return (arkLSSetJacFn(arkode_mem, jac)); + return (ARKodeSetJacFn(arkode_mem, jac)); } int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj) { - return (arkLSSetJacEvalFrequency(arkode_mem, msbj)); + return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); } int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) { - return (arkLSSetLinearSolutionScaling(arkode_mem, onoff)); + return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); } int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) { - return (arkLSSetEpsLin(arkode_mem, eplifac)); + return (ARKodeSetEpsLin(arkode_mem, eplifac)); } int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { - return (arkLSSetNormFactor(arkode_mem, nrmfac)); + return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); } int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, ARKLsPrecSolveFn psolve) { - return (arkLSSetPreconditioner(arkode_mem, psetup, psolve)); + return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); } int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, ARKLsJacTimesVecFn jtimes) { - return (arkLSSetJacTimes(arkode_mem, jtsetup, jtimes)); + return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); } int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) { - return (arkLSSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); + return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); } int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) { - return (arkLSSetLinSysFn(arkode_mem, linsys)); + return (ARKodeSetLinSysFn(arkode_mem, linsys)); } /*=============================================================== @@ -150,57 +288,107 @@ int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) ===============================================================*/ int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps) { - return (arkGetNumSteps(arkode_mem, nssteps)); + return (ARKodeGetNumSteps(arkode_mem, nssteps)); } int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) { - return (arkGetLastStep(arkode_mem, hlast)); + return (ARKodeGetLastStep(arkode_mem, hlast)); } int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - return (arkGetCurrentTime(arkode_mem, tcur)); + return (ARKodeGetCurrentTime(arkode_mem, tcur)); } int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state) { - return (arkGetCurrentState(arkode_mem, state)); + return (ARKodeGetCurrentState(arkode_mem, state)); +} + +int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +{ + return (ARKodeComputeState(arkode_mem, zcor, z)); } int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) { - return (arkGetTolScaleFactor(arkode_mem, tolsfact)); + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); } int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) { - return (arkGetErrWeights(arkode_mem, eweight)); + return (ARKodeGetErrWeights(arkode_mem, eweight)); } int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) { - return (arkGetNumGEvals(arkode_mem, ngevals)); + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); } int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound) { - return (arkGetRootInfo(arkode_mem, rootsfound)); + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); +} + +int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, + sdata, user_data)); } int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) { - return (arkGetNumStepSolveFails(arkode_mem, nncfails)); + return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); } int MRIStepGetUserData(void* arkode_mem, void** user_data) { - return (arkGetUserData(arkode_mem, user_data)); + return (ARKodeGetUserData(arkode_mem, user_data)); } char* MRIStepGetReturnFlagName(long int flag) { - return (arkGetReturnFlagName(flag)); + return (ARKodeGetReturnFlagName(flag)); +} + +int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +{ + return (ARKodeGetCurrentGamma(arkode_mem, gamma)); +} + +int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +{ + return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); +} + +int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +{ + return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); +} + +int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +{ + return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); +} + +int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) +{ + return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); +} + +int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} + +int MRIStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); } /*--------------------------------------------------------------- @@ -209,102 +397,91 @@ char* MRIStepGetReturnFlagName(long int flag) ---------------------------------------------------------------*/ int MRIStepGetJac(void* arkode_mem, SUNMatrix* J) { - return arkLSGetJac(arkode_mem, J); + return (ARKodeGetJac(arkode_mem, J)); } int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J) { - return arkLSGetJacTime(arkode_mem, t_J); + return (ARKodeGetJacTime(arkode_mem, t_J)); } int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J) { - return arkLSGetJacNumSteps(arkode_mem, nst_J); + return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); } int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) { - return (arkLSGetWorkSpace(arkode_mem, lenrwLS, leniwLS)); + return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); } int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) { - return (arkLSGetNumJacEvals(arkode_mem, njevals)); + return (ARKodeGetNumJacEvals(arkode_mem, njevals)); } int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) { - return (arkLSGetNumPrecEvals(arkode_mem, npevals)); + return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); } int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) { - return (arkLSGetNumPrecSolves(arkode_mem, npsolves)); + return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); } int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) { - return (arkLSGetNumLinIters(arkode_mem, nliters)); + return (ARKodeGetNumLinIters(arkode_mem, nliters)); } int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) { - return (arkLSGetNumConvFails(arkode_mem, nlcfails)); + return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); } int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) { - return (arkLSGetNumJTSetupEvals(arkode_mem, njtsetups)); + return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); } int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) { - return (arkLSGetNumJtimesEvals(arkode_mem, njvevals)); + return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); } int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) { - return (arkLSGetNumRhsEvals(arkode_mem, nfevalsLS)); + return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); } int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag) { - return (arkLSGetLastFlag(arkode_mem, flag)); + return (ARKodeGetLastLinFlag(arkode_mem, flag)); } char* MRIStepGetLinReturnFlagName(long int flag) { - return (arkLSGetReturnFlagName(flag)); + return (ARKodeGetLinReturnFlagName(flag)); } /*=============================================================== MRIStep optional input functions -- stepper-specific ===============================================================*/ -/*--------------------------------------------------------------- - MRIStepSetUserData: - - Wrapper for generic arkSetUserData and arkLSSetUserData - routines. - ---------------------------------------------------------------*/ -int MRIStepSetUserData(void* arkode_mem, void* user_data) +int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set user_data in ARKODE mem */ - retval = arkSetUserData(arkode_mem, user_data); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set user data in ARKODELS mem */ if (step_mem->lmem != NULL) { - retval = arkLSSetUserData(arkode_mem, user_data); + retval = arkLSSetUserData(ark_mem, user_data); if (retval != ARKLS_SUCCESS) { return (retval); } } @@ -312,20 +489,19 @@ int MRIStepSetUserData(void* arkode_mem, void* user_data) } /*--------------------------------------------------------------- - MRIStepSetDefaults: + mriStep_SetDefaults: Resets all MRIStep optional inputs to their default values. Does not change problem-defining function pointers or user_data pointer. ---------------------------------------------------------------*/ -int MRIStepSetDefaults(void* arkode_mem) +int mriStep_SetDefaults(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set default values for integrator optional inputs */ @@ -348,14 +524,13 @@ int MRIStepSetDefaults(void* arkode_mem) step_mem->jcur = SUNFALSE; step_mem->convfail = ARK_NO_FAILURES; step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ - return (ARK_SUCCESS); } /*--------------------------------------------------------------- - MRIStepSetLinear: + mriStep_SetLinear: - Specifies that the implicit slow function, fs(t,y), is linear + Specifies that the implicit slow function, fsi(t,y), is linear in y, and to tighten the linear solver tolerances while taking only one Newton iteration. DO NOT USE IN COMBINATION WITH THE FIXED-POINT SOLVER. Automatically tightens DeltaGammaMax @@ -367,14 +542,13 @@ int MRIStepSetDefaults(void* arkode_mem) using an iterative linear solver this flag denotes time dependence of the preconditioner. ---------------------------------------------------------------*/ -int MRIStepSetLinear(void* arkode_mem, int timedepend) +int mriStep_SetLinear(ARKodeMem ark_mem, int timedepend) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -386,21 +560,20 @@ int MRIStepSetLinear(void* arkode_mem, int timedepend) } /*--------------------------------------------------------------- - MRIStepSetNonlinear: + mriStep_SetNonlinear: - Specifies that the implicit slow function, fs(t,y), is + Specifies that the implicit slow function, fsi(t,y), is nonlinear in y. Used to undo a previous call to - MRIStepSetLinear. Automatically loosens DeltaGammaMax back to + mriStep_SetLinear. Automatically loosens DeltaGammaMax back to default value. ---------------------------------------------------------------*/ -int MRIStepSetNonlinear(void* arkode_mem) +int mriStep_SetNonlinear(ARKodeMem ark_mem) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameters */ @@ -412,22 +585,18 @@ int MRIStepSetNonlinear(void* arkode_mem) } /*--------------------------------------------------------------- - MRIStepSetOrder: + mriStep_SetOrder: Specifies the method order - - NOTE: This should not be called along with MRIStepSetCoupling. - Any user-supplied coupling table will specify the order. ---------------------------------------------------------------*/ -int MRIStepSetOrder(void* arkode_mem, int ord) +int mriStep_SetOrder(ARKodeMem ark_mem, int ord) { int retval; - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; sunindextype Tlrw, Tliw; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval) { return (retval); } /* check for illegal inputs */ @@ -460,8 +629,8 @@ int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC) ARKodeMRIStepMem step_mem; sunindextype Tlrw, Tliw; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check for illegal inputs */ @@ -513,8 +682,8 @@ int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set pre inner evolve function */ @@ -534,8 +703,8 @@ int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Set pre inner evolve function */ @@ -545,48 +714,19 @@ int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) } /*--------------------------------------------------------------- - MRIStepSetFixedStep: - - Wrapper for generic arkSetFixedStep routine. Additionally - enforces current MRIStep constraint for fixed time-stepping. - ---------------------------------------------------------------*/ -int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - - if (hsfixed == ZERO) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "MRIStep does not support adaptive steps at this time."); - return (ARK_ILL_INPUT); - } - - /* call generic routine for remaining work */ - return (arkSetFixedStep(ark_mem, hsfixed)); -} - -/*--------------------------------------------------------------- - MRIStepSetNonlinCRDown: + mriStep_SetNonlinCRDown: Specifies the user-provided nonlinear convergence constant crdown. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +int mriStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -597,20 +737,19 @@ int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) } /*--------------------------------------------------------------- - MRIStepSetNonlinRDiv: + mriStep_SetNonlinRDiv: Specifies the user-provided nonlinear convergence constant rdiv. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +int mriStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -621,20 +760,19 @@ int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) } /*--------------------------------------------------------------- - MRIStepSetDeltaGammaMax: + mriStep_SetDeltaGammaMax: Specifies the user-provided linear setup decision constant dgmax. Legal values are strictly positive; illegal values imply a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +int mriStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -645,21 +783,20 @@ int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) } /*--------------------------------------------------------------- - MRIStepSetLSetupFrequency: + mriStep_SetLSetupFrequency: Specifies the user-provided linear setup decision constant msbp. Positive values give the frequency for calling lsetup; negative values imply recomputation of lsetup at each nonlinear solve; a zero value implies a reset to the default. ---------------------------------------------------------------*/ -int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) +int mriStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if argument legal set it, otherwise set default */ @@ -670,20 +807,19 @@ int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) } /*--------------------------------------------------------------- - MRIStepSetPredictorMethod: + mriStep_SetPredictorMethod: Specifies the method to use for predicting implicit solutions. Non-default choices are {1,2,3,4}, all others will use default (trivial) predictor. ---------------------------------------------------------------*/ -int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) +int mriStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set parameter */ @@ -693,20 +829,19 @@ int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) } /*--------------------------------------------------------------- - MRIStepSetMaxNonlinIters: + mriStep_SetMaxNonlinIters: Specifies the maximum number of nonlinear iterations during one solve. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return error message if no NLS module is present */ @@ -734,19 +869,18 @@ int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) } /*--------------------------------------------------------------- - MRIStepSetNonlinConvCoef: + mriStep_SetNonlinConvCoef: Specifies the coefficient in the nonlinear solver convergence test. A non-positive input implies a reset to the default value. ---------------------------------------------------------------*/ -int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* argument <= 0 sets default, otherwise set input */ @@ -757,18 +891,17 @@ int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) } /*--------------------------------------------------------------- - MRIStepSetStagePredictFn: Specifies a user-provided step + mriStep_SetStagePredictFn: Specifies a user-provided step predictor function having type ARKStagePredictFn. A NULL input function disables calls to this routine. ---------------------------------------------------------------*/ -int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure and set function pointer */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->stage_predict = PredictStage; @@ -776,7 +909,7 @@ int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) } /*--------------------------------------------------------------- - MRIStepSetDeduceImplicitRhs: + mriStep_SetDeduceImplicitRhs: Specifies if an optimization is used to avoid an evaluation of fi after a nonlinear solve for an implicit stage. If stage @@ -787,14 +920,13 @@ int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) fi(z_i), and SUNFALSE indicates that fi(z_i) is computed with an additional evaluation of fi. ---------------------------------------------------------------*/ -int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure and set function pointer */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } step_mem->deduce_rhs = deduce; @@ -805,27 +937,6 @@ int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) MRIStep optional output functions -- stepper-specific ===============================================================*/ -int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Get ARKODE workspace */ - retval = arkGetWorkSpace(arkode_mem, lenrw, leniw); - if (retval) { return retval; } - - /* Get the inner stepper workspace */ - *lenrw += step_mem->stepper->lrw; - *leniw += step_mem->stepper->liw; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- MRIStepGetLastInnerStepFlag: @@ -837,8 +948,8 @@ int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get the last return value from the inner stepper */ @@ -848,14 +959,13 @@ int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) } /*--------------------------------------------------------------- - MRIStepGetCurrentGamma: Returns the current value of gamma + mriStep_GetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) { int retval; - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *gamma = step_mem->gamma; return (retval); @@ -873,8 +983,8 @@ int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get number of fse and fsi evals from step_mem */ @@ -885,18 +995,17 @@ int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, } /*--------------------------------------------------------------- - MRIStepGetNumLinSolvSetups: + mriStep_GetNumLinSolvSetups: Returns the current number of calls to the lsetup routine ---------------------------------------------------------------*/ -int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +int mriStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get value from step_mem */ @@ -906,18 +1015,17 @@ int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) } /*--------------------------------------------------------------- - MRIStepGetNumNonlinSolvIters: + mriStep_GetNumNonlinSolvIters: Returns the current number of nonlinear solver iterations ---------------------------------------------------------------*/ -int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +int mriStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -926,18 +1034,17 @@ int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) } /*--------------------------------------------------------------- - MRIStepGetNumNonlinSolvConvFails: + mriStep_GetNumNonlinSolvConvFails: Returns the current number of nonlinear solver convergence fails ---------------------------------------------------------------*/ -int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +int mriStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* set output from step_mem */ @@ -947,19 +1054,18 @@ int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) } /*--------------------------------------------------------------- - MRIStepGetNonlinSolvStats: + mriStep_GetNonlinSolvStats: Returns nonlinear solver statistics ---------------------------------------------------------------*/ -int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails) +int mriStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, + long int* nnfails) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nniters = step_mem->nls_iters; @@ -979,8 +1085,8 @@ int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* get coupling structure from step_mem */ @@ -990,23 +1096,18 @@ int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC) } /*--------------------------------------------------------------- - MRIStepPrintAllStats: + mriStep_PrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; ARKLsMem arkls_mem; int retval; /* access ARKode MRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* step and rootfinding stats */ - retval = arkPrintAllStats(arkode_mem, outfile, fmt); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -1027,9 +1128,9 @@ int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, "LS setups = %ld\n", step_mem->nsetups); - if (ark_mem->step_getlinmem(arkode_mem)) + if (ark_mem->step_getlinmem(ark_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); fprintf(outfile, "Jac fn evals = %ld\n", arkls_mem->nje); fprintf(outfile, "LS RHS fn evals = %ld\n", arkls_mem->nfeDQ); fprintf(outfile, "Prec setup evals = %ld\n", arkls_mem->npe); @@ -1069,9 +1170,9 @@ int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) /* linear solver stats */ fprintf(outfile, ",LS setups,%ld", step_mem->nsetups); - if (ark_mem->step_getlinmem(arkode_mem)) + if (ark_mem->step_getlinmem(ark_mem)) { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(arkode_mem)); + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); fprintf(outfile, ",Jac fn evals,%ld", arkls_mem->nje); fprintf(outfile, ",LS RHS fn evals,%ld", arkls_mem->nfeDQ); fprintf(outfile, ",Prec setup evals,%ld", arkls_mem->npe); @@ -1113,28 +1214,55 @@ int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) ===============================================================*/ /*--------------------------------------------------------------- - MRIStepWriteParameters: + mriStep_WriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int MRIStepWriteParameters(void* arkode_mem, FILE* fp) +int mriStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* output ARKODE infrastructure parameters first */ - retval = arkWriteParameters(arkode_mem, fp); - if (retval != ARK_SUCCESS) + /* print integrator parameters to file */ + fprintf(fp, "MRIStep time step module parameters:\n"); + fprintf(fp, " Method order %i\n", step_mem->q); + if (step_mem->linear) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error writing ARKODE infrastructure parameters"); - return (retval); + fprintf(fp, " Linear implicit problem"); + if (step_mem->linear_timedep) + { + fprintf(fp, " (time-dependent Jacobian)\n"); + } + else { fprintf(fp, " (time-independent Jacobian)\n"); } + } + if (step_mem->explicit_rhs && step_mem->implicit_rhs) + { + fprintf(fp, " ImEx slow time scale\n"); + } + else if (step_mem->implicit_rhs) + { + fprintf(fp, " Implicit slow time scale\n"); } + else { fprintf(fp, " Explicit slow time scale\n"); } + + if (step_mem->implicit_rhs) + { + fprintf(fp, " Implicit predictor method = %i\n", step_mem->predictor); + fprintf(fp, " Implicit solver tolerance coefficient = %" RSYM "\n", + step_mem->nlscoef); + fprintf(fp, " Maximum number of nonlinear corrections = %i\n", + step_mem->maxcor); + fprintf(fp, " Nonlinear convergence rate constant = %" RSYM "\n", + step_mem->crdown); + fprintf(fp, " Nonlinear divergence tolerance = %" RSYM "\n", step_mem->rdiv); + fprintf(fp, " Gamma factor LSetup tolerance = %" RSYM "\n", step_mem->dgmax); + fprintf(fp, " Number of steps between LSetup calls = %i\n", step_mem->msbp); + } + fprintf(fp, "\n"); return (ARK_SUCCESS); } @@ -1150,8 +1278,8 @@ int MRIStepWriteCoupling(void* arkode_mem, FILE* fp) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* check that coupling structure is non-NULL (otherwise report error) */ diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index a48ae86d56..aeb450b95a 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -28,19 +28,18 @@ ===============================================================*/ /*--------------------------------------------------------------- - MRIStepSetNonlinearSolver: + mriStep_SetNonlinearSolver: This routine attaches a SUNNonlinearSolver object to the MRIStep module. ---------------------------------------------------------------*/ -int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +int mriStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Return immediately if NLS input is NULL */ @@ -94,7 +93,7 @@ int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) /* set convergence test function */ retval = SUNNonlinSolSetConvTestFn(step_mem->NLS, mriStep_NlsConvTest, - arkode_mem); + (void*)ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -129,20 +128,19 @@ int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) } /*--------------------------------------------------------------- - MRIStepSetNlsRhsFn: + mriStep_SetNlsRhsFn: This routine sets an alternative user-supplied slow ODE right-hand side function to use in the evaluation of nonlinear system functions. ---------------------------------------------------------------*/ -int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fsi) +int mriStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fsi) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (nls_fsi) { step_mem->nls_fsi = nls_fsi; } @@ -152,22 +150,21 @@ int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fsi) } /*--------------------------------------------------------------- - MRIStepGetNonlinearSystemData: + mriStep_GetNonlinearSystemData: This routine provides access to the relevant data needed to compute the nonlinear system function. ---------------------------------------------------------------*/ -int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* F, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) +int mriStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* F, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) { - ARKodeMem ark_mem; ARKodeMRIStepMem step_mem; int retval; /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *tcur = ark_mem->tcur; @@ -372,8 +369,8 @@ int mriStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_me ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update convfail based on jbad flag */ @@ -415,8 +412,8 @@ int mriStep_NlsLSolve(N_Vector b, void* arkode_mem) ARKodeMRIStepMem step_mem; int retval, nonlin_iter; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* retrieve nonlinear solver iteration from module */ @@ -462,8 +459,8 @@ int mriStep_NlsResidual(N_Vector zcor, N_Vector r, void* arkode_mem) sunrealtype c[3]; N_Vector X[3]; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -517,8 +514,8 @@ int mriStep_NlsFPFunction(N_Vector zcor, N_Vector g, void* arkode_mem) ARKodeMRIStepMem step_mem; int retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* update 'ycur' value as stored predictor + current corrector */ @@ -568,8 +565,8 @@ int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype delnrm, dcon; int m, retval; - /* access ARKodeMRIStepMem structure */ - retval = mriStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* if the problem is linearly implicit, just return success */ diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index f9de44e45c..d5619e7757 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -415,7 +415,31 @@ int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, * Set functions * ---------------------------------------------------------------------------*/ -int arkRelaxSetEtaFail(void* arkode_mem, sunrealtype eta_fail) +int ARKodeSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper-specific routine (if it exists) */ + if (ark_mem->step_setrelaxfn) + { + return ark_mem->step_setrelaxfn(arkode_mem, rfn, rjac); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } +} + +int ARKodeSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_fail) { int retval; ARKodeMem ark_mem; @@ -424,13 +448,21 @@ int arkRelaxSetEtaFail(void* arkode_mem, sunrealtype eta_fail) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (eta_fail > ZERO && eta_fail < ONE) { relax_mem->eta_fail = eta_fail; } else { relax_mem->eta_fail = ARK_RELAX_DEFAULT_ETA_FAIL; } return ARK_SUCCESS; } -int arkRelaxSetLowerBound(void* arkode_mem, sunrealtype lower) +int ARKodeSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) { int retval; ARKodeMem ark_mem; @@ -439,13 +471,21 @@ int arkRelaxSetLowerBound(void* arkode_mem, sunrealtype lower) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (lower > ZERO && lower < ONE) { relax_mem->lower_bound = lower; } else { relax_mem->lower_bound = ARK_RELAX_DEFAULT_LOWER_BOUND; } return ARK_SUCCESS; } -int arkRelaxSetMaxFails(void* arkode_mem, int max_fails) +int ARKodeSetRelaxMaxFails(void* arkode_mem, int max_fails) { int retval; ARKodeMem ark_mem; @@ -454,13 +494,21 @@ int arkRelaxSetMaxFails(void* arkode_mem, int max_fails) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (max_fails > 0) { relax_mem->max_fails = max_fails; } else { relax_mem->max_fails = ARK_RELAX_DEFAULT_MAX_FAILS; } return ARK_SUCCESS; } -int arkRelaxSetMaxIters(void* arkode_mem, int max_iters) +int ARKodeSetRelaxMaxIters(void* arkode_mem, int max_iters) { int retval; ARKodeMem ark_mem; @@ -469,13 +517,21 @@ int arkRelaxSetMaxIters(void* arkode_mem, int max_iters) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (max_iters > 0) { relax_mem->max_iters = max_iters; } else { relax_mem->max_iters = ARK_RELAX_DEFAULT_MAX_ITERS; } return ARK_SUCCESS; } -int arkRelaxSetSolver(void* arkode_mem, ARKRelaxSolver solver) +int ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) { int retval; ARKodeMem ark_mem; @@ -484,6 +540,14 @@ int arkRelaxSetSolver(void* arkode_mem, ARKRelaxSolver solver) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (solver != ARK_RELAX_BRENT && solver != ARK_RELAX_NEWTON) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -496,7 +560,7 @@ int arkRelaxSetSolver(void* arkode_mem, ARKRelaxSolver solver) return ARK_SUCCESS; } -int arkRelaxSetResTol(void* arkode_mem, sunrealtype res_tol) +int ARKodeSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) { int retval; ARKodeMem ark_mem; @@ -505,13 +569,21 @@ int arkRelaxSetResTol(void* arkode_mem, sunrealtype res_tol) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (res_tol > ZERO) { relax_mem->res_tol = res_tol; } else { relax_mem->res_tol = ARK_RELAX_DEFAULT_RES_TOL; } return ARK_SUCCESS; } -int arkRelaxSetTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +int ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) { int retval; ARKodeMem ark_mem; @@ -520,6 +592,14 @@ int arkRelaxSetTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (rel_tol > ZERO) { relax_mem->rel_tol = rel_tol; } else { relax_mem->rel_tol = ARK_RELAX_DEFAULT_REL_TOL; } @@ -529,7 +609,7 @@ int arkRelaxSetTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) return ARK_SUCCESS; } -int arkRelaxSetUpperBound(void* arkode_mem, sunrealtype upper) +int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) { int retval; ARKodeMem ark_mem; @@ -538,6 +618,14 @@ int arkRelaxSetUpperBound(void* arkode_mem, sunrealtype upper) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + if (upper > ONE) { relax_mem->upper_bound = upper; } else { relax_mem->upper_bound = ARK_RELAX_DEFAULT_UPPER_BOUND; } @@ -548,7 +636,7 @@ int arkRelaxSetUpperBound(void* arkode_mem, sunrealtype upper) * Get functions * ---------------------------------------------------------------------------*/ -int arkRelaxGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +int ARKodeGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) { int retval; ARKodeMem ark_mem; @@ -557,12 +645,20 @@ int arkRelaxGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *r_evals = relax_mem->num_relax_fn_evals; return ARK_SUCCESS; } -int arkRelaxGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +int ARKodeGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) { int retval; ARKodeMem ark_mem; @@ -571,12 +667,20 @@ int arkRelaxGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *J_evals = relax_mem->num_relax_jac_evals; return ARK_SUCCESS; } -int arkRelaxGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +int ARKodeGetNumRelaxFails(void* arkode_mem, long int* relax_fails) { int retval; ARKodeMem ark_mem; @@ -585,12 +689,20 @@ int arkRelaxGetNumRelaxFails(void* arkode_mem, long int* relax_fails) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *relax_fails = relax_mem->num_fails; return ARK_SUCCESS; } -int arkRelaxGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +int ARKodeGetNumRelaxSolveFails(void* arkode_mem, long int* fails) { int retval; ARKodeMem ark_mem; @@ -599,12 +711,20 @@ int arkRelaxGetNumRelaxSolveFails(void* arkode_mem, long int* fails) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *fails = relax_mem->nls_fails; return ARK_SUCCESS; } -int arkRelaxGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +int ARKodeGetNumRelaxBoundFails(void* arkode_mem, long int* fails) { int retval; ARKodeMem ark_mem; @@ -613,12 +733,20 @@ int arkRelaxGetNumRelaxBoundFails(void* arkode_mem, long int* fails) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *fails = relax_mem->bound_fails; return ARK_SUCCESS; } -int arkRelaxGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) { int retval; ARKodeMem ark_mem; @@ -627,6 +755,14 @@ int arkRelaxGetNumRelaxSolveIters(void* arkode_mem, long int* iters) retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); if (retval) { return retval; } + /* Guard against use for time steppers that do not allow relaxation */ + if (!ark_mem->step_supports_relaxation) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support relaxation"); + return (ARK_STEPPER_UNSUPPORTED); + } + *iters = relax_mem->nls_iters; return ARK_SUCCESS; @@ -679,21 +815,10 @@ int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) * ===========================================================================*/ /* Constructor called by stepper */ -int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, +int arkRelaxCreate(ARKodeMem ark_mem, ARKRelaxFn relax_fn, ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaEFn delta_e_fn, ARKRelaxGetOrderFn get_order_fn) { - ARKodeMem ark_mem; - - /* Check inputs */ - if (!arkode_mem) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return ARK_MEM_NULL; - } - ark_mem = (ARKodeMem)arkode_mem; - /* Disable relaxation if both user inputs are NULL */ if (!relax_fn && !relax_jac_fn) { diff --git a/src/arkode/arkode_relaxation_impl.h b/src/arkode/arkode_relaxation_impl.h index c52cb2521c..a8c9001ed0 100644 --- a/src/arkode/arkode_relaxation_impl.h +++ b/src/arkode/arkode_relaxation_impl.h @@ -99,7 +99,7 @@ struct ARKodeRelaxMemRec * ---------------------------------------------------------------------------*/ /* Driver and Stepper Functions */ -int arkRelaxCreate(void* arkode_mem, ARKRelaxFn relax_fn, +int arkRelaxCreate(ARKodeMem ark_mem, ARKRelaxFn relax_fn, ARKRelaxJacFn relax_jac_fn, ARKRelaxDeltaEFn delta_e_fn, ARKRelaxGetOrderFn get_order_fn); int arkRelaxDestroy(ARKodeRelaxMem relax_mem); @@ -107,22 +107,6 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, int* nflag_out); /* User Functions */ -int arkRelaxSetEtaFail(void* arkode_mem, sunrealtype eta_fail); -int arkRelaxSetLowerBound(void* arkode_mem, sunrealtype lower); -int arkRelaxSetMaxFails(void* arkode_mem, int max_fails); -int arkRelaxSetMaxIters(void* arkode_mem, int max_iters); -int arkRelaxSetSolver(void* arkode_mem, ARKRelaxSolver solver); -int arkRelaxSetResTol(void* arkode_mem, sunrealtype res_tol); -int arkRelaxSetTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol); -int arkRelaxSetUpperBound(void* arkode_mem, sunrealtype upper); - -int arkRelaxGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); -int arkRelaxGetNumRelaxJacEvals(void* arkode_mem, long int* j_evals); -int arkRelaxGetNumRelaxFails(void* arkode_mem, long int* relax_fails); -int arkRelaxGetNumRelaxBoundFails(void* arkode_mem, long int* fails); -int arkRelaxGetNumRelaxSolveFails(void* arkode_mem, long int* fails); -int arkRelaxGetNumRelaxSolveIters(void* arkode_mem, long int* iters); - int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); /* ----------------------------------------------------------------------------- diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index a0e02df7e7..3ea456cc32 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -25,27 +25,29 @@ #include "arkode_impl.h" /*--------------------------------------------------------------- - arkRootInit: + ARKodeRootInit: - arkRootInit initializes a rootfinding problem to be solved + ARKodeRootInit 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, 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. ---------------------------------------------------------------*/ -int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) +int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) { int i, nrt; - /* Check ark_mem pointer */ - if (ark_mem == NULL) + /* unpack ark_mem */ + ARKodeMem ark_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, MSG_ARK_NO_MEM); return (ARK_MEM_NULL); } - nrt = (nrtfn < 0) ? 0 : nrtfn; + ark_mem = (ARKodeMem)arkode_mem; + nrt = (nrtfn < 0) ? 0 : nrtfn; /* Ensure that stepper provides fullrhs function */ if (nrt > 0) @@ -91,7 +93,7 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) ark_mem->liw += ARK_ROOT_LIW; } - /* If rerunning arkRootInit() with a different number of root + /* If rerunning ARKodeRootInit() with a different number of root functions (changing number of gfun components), then free currently held memory resources */ if ((nrt != ark_mem->root_mem->nrtfn) && (ark_mem->root_mem->nrtfn > 0)) @@ -113,7 +115,7 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) ark_mem->liw -= 3 * (ark_mem->root_mem->nrtfn); } - /* If arkRootInit() was called with nrtfn == 0, then set + /* If ARKodeRootInit() was called with nrtfn == 0, then set nrtfn to zero and gfun to NULL before returning */ if (nrt == 0) { @@ -122,7 +124,7 @@ int arkRootInit(ARKodeMem ark_mem, int nrtfn, ARKRootFn g) return (ARK_SUCCESS); } - /* If rerunning arkRootInit() with the same number of root + /* If rerunning ARKodeRootInit() with the same number of root functions (not changing number of gfun components), then check if the root function argument has changed */ /* If g != NULL then return as currently reserved memory @@ -499,7 +501,7 @@ int arkRootCheck2(void* arkode_mem) if (rootmem->irfnd == 0) { return (ARK_SUCCESS); } /* Set ark_ycur = y(tlo) */ - (void)arkGetDky(ark_mem, rootmem->tlo, 0, ark_mem->ycur); + (void)ARKodeGetDky(ark_mem, rootmem->tlo, 0, ark_mem->ycur); /* Evaluate root-finding function: glo = g(tlo, y(tlo)) */ retval = rootmem->gfun(rootmem->tlo, ark_mem->ycur, rootmem->glo, @@ -539,7 +541,7 @@ int arkRootCheck2(void* arkode_mem) else { /* set ark_ycur = y(tplus) via interpolation */ - (void)arkGetDky(ark_mem, tplus, 0, ark_mem->ycur); + (void)ARKodeGetDky(ark_mem, tplus, 0, ark_mem->ycur); } /* set ghi = g(tplus,y(tplus)) */ retval = rootmem->gfun(tplus, ark_mem->ycur, rootmem->ghi, rootmem->root_data); @@ -609,7 +611,7 @@ int arkRootCheck3(void* arkode_mem) else { rootmem->thi = rootmem->toutc; - (void)arkGetDky(ark_mem, rootmem->thi, 0, ark_mem->ycur); + (void)ARKodeGetDky(ark_mem, rootmem->thi, 0, ark_mem->ycur); } } @@ -637,7 +639,7 @@ int arkRootCheck3(void* arkode_mem) if (ier == ARK_SUCCESS) { return (ARK_SUCCESS); } /* If a root was found, interpolate to get y(trout) and return. */ - (void)arkGetDky(ark_mem, rootmem->trout, 0, ark_mem->ycur); + (void)ARKodeGetDky(ark_mem, rootmem->trout, 0, ark_mem->ycur); return (RTFOUND); } @@ -826,7 +828,7 @@ int arkRootfind(void* arkode_mem) tmid = rootmem->thi - fracsub * (rootmem->thi - rootmem->tlo); } - (void)arkGetDky(ark_mem, tmid, 0, ark_mem->ycur); + (void)ARKodeGetDky(ark_mem, tmid, 0, ark_mem->ycur); retval = rootmem->gfun(tmid, ark_mem->ycur, rootmem->grout, rootmem->root_data); rootmem->nge++; diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 7ac45ee764..4cf245d5e0 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -103,7 +103,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, /* Allocate vectors in stepper mem */ if (!arkAllocVec(ark_mem, y0, &(step_mem->sdata))) { - SPRKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -111,23 +111,29 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, { if (!arkAllocVec(ark_mem, y0, &(step_mem->yerr))) { - SPRKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } } else { step_mem->yerr = NULL; } - ark_mem->step_init = sprkStep_Init; - ark_mem->step_fullrhs = sprkStep_FullRHS; - ark_mem->step = sprkStep_TakeStep; - ark_mem->step_mem = (void*)step_mem; - - /* Set default values for SPRKStep optional inputs */ - retval = SPRKStepSetDefaults((void*)ark_mem); + ark_mem->step_init = sprkStep_Init; + ark_mem->step_fullrhs = sprkStep_FullRHS; + ark_mem->step = sprkStep_TakeStep; + ark_mem->step_printallstats = sprkStep_PrintAllStats; + ark_mem->step_writeparameters = sprkStep_WriteParameters; + ark_mem->step_resize = sprkStep_Resize; + ark_mem->step_free = sprkStep_Free; + ark_mem->step_setdefaults = sprkStep_SetDefaults; + ark_mem->step_setorder = sprkStep_SetOrder; + ark_mem->step_mem = (void*)step_mem; + + /* Set default values for optional inputs */ + retval = sprkStep_SetDefaults((void*)ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Error setting default solver options"); - SPRKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } @@ -145,7 +151,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, /* SPRKStep uses Lagrange interpolation by default, since Hermite is less compatible with these methods. */ - arkSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); /* Initialize main ARKODE infrastructure */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); @@ -153,13 +159,60 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, { arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, "Unable to initialize main ARKODE infrastructure"); - SPRKStepFree((void**)&ark_mem); + ARKodeFree((void**)&ark_mem); return (NULL); } return ((void*)ark_mem); } +/*--------------------------------------------------------------- + sprkStep_Resize: + + This routine resizes the memory within the SPRKStep module. + ---------------------------------------------------------------*/ +int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + ARKodeSPRKStepMem step_mem = NULL; + sunindextype lrw1, liw1, lrw_diff, liw_diff; + int retval; + + /* access ARKodeSPRKStepMem structure */ + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Determine change in vector sizes */ + lrw1 = liw1 = 0; + if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } + lrw_diff = lrw1 - ark_mem->lrw1; + liw_diff = liw1 - ark_mem->liw1; + ark_mem->lrw1 = lrw1; + ark_mem->liw1 = liw1; + + /* Resize the local vectors */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->sdata)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + + if (step_mem->yerr) + { + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->yerr)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- SPRKStepReInit: @@ -178,8 +231,9 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Check if ark_mem was allocated */ @@ -231,101 +285,36 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, } /*--------------------------------------------------------------- - SPRKStepReset: + sprkStep_Reset: This routine resets the SPRKStep module state to solve the same problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +int sprkStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Initialize main ARKODE infrastructure */ - retval = arkInit(ark_mem, tR, yR, RESET_INIT); - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to initialize main ARKODE infrastructure"); - return (retval); - } - N_VConst(SUN_RCONST(0.0), step_mem->yerr); - return (ARK_SUCCESS); } /*--------------------------------------------------------------- - SPRKStepEvolve: - - This is the main time-integration driver (wrappers for general - ARKODE utility routine) + sprkStep_Free frees all SPRKStep memory. ---------------------------------------------------------------*/ -int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) +void sprkStep_Free(ARKodeMem ark_mem) { - /* unpack ark_mem, call arkEvolve, and return */ - ARKodeMem ark_mem = NULL; - int retval = 0; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkEvolve(ark_mem, tout, yout, tret, itask); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - SPRKStepGetDky: - - This returns interpolated output of the solution or its - derivatives over the most-recently-computed step (wrapper for - generic ARKODE utility routine) - ---------------------------------------------------------------*/ -int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - /* unpack ark_mem, call arkGetDky, and return */ - ARKodeMem ark_mem = NULL; - int retval = 0; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - SUNDIALS_MARK_FUNCTION_BEGIN(ARK_PROFILER); - retval = arkGetDky(ark_mem, t, k, dky); - SUNDIALS_MARK_FUNCTION_END(ARK_PROFILER); - return (retval); -} - -/*--------------------------------------------------------------- - SPRKStepFree frees all SPRKStep memory, and then calls an ARKODE - utility routine to free the ARKODE infrastructure memory. - ---------------------------------------------------------------*/ -void SPRKStepFree(void** arkode_mem) -{ - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - /* nothing to do if arkode_mem is already NULL */ - if (*arkode_mem == NULL) { return; } + /* nothing to do if ark_mem is already NULL */ + if (ark_mem == NULL) { return; } /* conditional frees on non-NULL SPRKStep module */ - ark_mem = (ARKodeMem)(*arkode_mem); if (ark_mem->step_mem != NULL) { step_mem = (ARKodeSPRKStepMem)ark_mem->step_mem; @@ -347,9 +336,6 @@ void SPRKStepFree(void** arkode_mem) free(ark_mem->step_mem); ark_mem->step_mem = NULL; } - - /* free memory for overall ARKODE infrastructure */ - arkFree(arkode_mem); } /*=============================================================== @@ -376,14 +362,13 @@ void SPRKStepFree(void** arkode_mem) With initialization type RESET_INIT, this routine does nothing. ---------------------------------------------------------------*/ -int sprkStep_Init(void* arkode_mem, int init_type) +int sprkStep_Init(ARKodeMem ark_mem, int init_type) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* immediately return if reset */ @@ -458,20 +443,6 @@ int sprkStep_Init(void* arkode_mem, int init_type) return (ARK_SUCCESS); } -int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - /* unpack ark_mem, call arkRootInit, and return */ - ARKodeMem ark_mem = NULL; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - return (arkRootInit(ark_mem, nrtfn, g)); -} - /* Utility to call f1 and increment the counter */ inline int sprkStep_f1(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, N_Vector f1, void* user_data) @@ -511,15 +482,14 @@ inline int sprkStep_f2(ARKodeSPRKStepMem step_mem, sunrealtype tcur, Since RHS values are not stored in SPRKStep we evaluate the RHS functions for all modes. ----------------------------------------------------------------------------*/ -int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int sprkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { int retval = 0; - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* perform RHS functions contingent on 'mode' argument */ @@ -564,9 +534,8 @@ int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, This requires only 2 vectors in principle, but we use three since we persist the stage data. Only the stage data vector belongs to SPRKStep, the other two are reused from the ARKODE core. */ -int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) +int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; N_Vector prev_stage = NULL; N_Vector curr_stage = NULL; @@ -576,7 +545,7 @@ int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } prev_stage = ark_mem->yn; @@ -640,10 +609,9 @@ int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Increment SPRK algorithm with compensated summation. This algorithm requires 6 vectors, but 5 of them are reused from the ARKODE core. */ -int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, +int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; N_Vector delta_Yi = NULL; N_Vector yn_plus_delta_Yi = NULL; @@ -654,7 +622,7 @@ int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Vector shortcuts */ @@ -746,13 +714,13 @@ int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, ---------------------------------------------------------------*/ /*--------------------------------------------------------------- - sprkStep_AccessStepMem: + sprkStep_AccessARKODEStepMem: Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. If either is missing it returns ARK_MEM_NULL. ---------------------------------------------------------------*/ -int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem) +int sprkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem) { /* access ARKodeMem structure */ if (arkode_mem == NULL) @@ -762,6 +730,8 @@ int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_MEM_NULL); } *ark_mem = (ARKodeMem)arkode_mem; + + /* access ARKodeSPRKStepMem structure */ if ((*ark_mem)->step_mem == NULL) { arkProcessError(*ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, @@ -772,6 +742,26 @@ int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + sprkStep_AccessStepMem: + + Shortcut routine to unpack step_mem structure from ark_mem. + If missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int sprkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeSPRKStepMem* step_mem) +{ + /* access ARKodeSPRKStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_SPRKSTEP_NO_MEM); + return (ARK_MEM_NULL); + } + *step_mem = (ARKodeSPRKStepMem)ark_mem->step_mem; + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- sprkStep_CheckNVector: diff --git a/src/arkode/arkode_sprkstep_impl.h b/src/arkode/arkode_sprkstep_impl.h index 720e9732ee..3f7928dbc7 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -66,16 +66,28 @@ typedef struct ARKodeSPRKStepMemRec SPRK time step module private function prototypes ===============================================================*/ -int sprkStep_Init(void* arkode_mem, int init_type); -int sprkStep_FullRHS(void* arkode_mem, sunrealtype t, N_Vector y, N_Vector f, +int sprkStep_Init(ARKodeMem ark_mem, int init_type); +int sprkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int sprkStep_TakeStep(void* arkode_mem, sunrealtype* dsmPtr, int* nflagPtr); -int sprkStep_TakeStep_Compensated(void* arkode_mem, sunrealtype* dsmPtr, +int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int sprkStep_SetUserData(ARKodeMem ark_mem, void* user_data); +int sprkStep_SetDefaults(ARKodeMem ark_mem); +int sprkStep_SetOrder(ARKodeMem ark_mem, int ord); +int sprkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); +int sprkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp); +int sprkStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); +int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +void sprkStep_Free(ARKodeMem ark_mem); +void sprkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); /* Internal utility routines */ -int sprkStep_AccessStepMem(void* arkode_mem, const char* fname, - ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem); +int sprkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeSPRKStepMem* step_mem); +int sprkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeSPRKStepMem* step_mem); sunbooleantype sprkStep_CheckNVector(N_Vector tmpl); /* f1 = p' (Force evaluation) */ int sprkStep_f1(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index d26c5410eb..0d4760fd17 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -32,55 +32,98 @@ SPRKStep Optional input functions (wrappers for generic ARKODE utility routines). All are documented in arkode_io.c. ===============================================================*/ +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int SPRKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); +} + +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +void SPRKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void SPRKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int SPRKStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} + +int SPRKStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int SPRKStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} + int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) { - if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } - return (arkSetInterpolantDegree(arkode_mem, degree)); + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); } int SPRKStepSetInterpolantType(void* arkode_mem, int itype) { - return (arkSetInterpolantType(arkode_mem, itype)); + return (ARKodeSetInterpolantType(arkode_mem, itype)); } int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - return (arkSetMaxNumSteps(arkode_mem, mxsteps)); + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); } int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - return (arkSetStopTime(arkode_mem, tstop)); + return (ARKodeSetStopTime(arkode_mem, tstop)); } int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir) { - return (arkSetRootDirection(arkode_mem, rootdir)); + return (ARKodeSetRootDirection(arkode_mem, rootdir)); } int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) { - return (arkSetNoInactiveRootWarn(arkode_mem)); + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) { - return (arkSetMaxNumConstrFails(arkode_mem, maxfails)); + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); } int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - return (arkSetPostprocessStepFn(arkode_mem, ProcessStep)); + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); } int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) { - return (arkSetPostprocessStageFn(arkode_mem, ProcessStage)); + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); } int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { - return (arkSetFixedStep(arkode_mem, hfixed)); + return (ARKodeSetFixedStep(arkode_mem, hfixed)); } /*=============================================================== @@ -89,78 +132,82 @@ int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) ===============================================================*/ int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) { - return (arkGetNumStepAttempts(arkode_mem, nstep_attempts)); + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); } int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) { - return (arkGetNumSteps(arkode_mem, nsteps)); + return (ARKodeGetNumSteps(arkode_mem, nsteps)); } int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) { - return (arkGetLastStep(arkode_mem, hlast)); + return (ARKodeGetLastStep(arkode_mem, hlast)); } int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { - return (arkGetCurrentStep(arkode_mem, hcur)); + return (ARKodeGetCurrentStep(arkode_mem, hcur)); } int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) { - return (arkGetCurrentTime(arkode_mem, tcur)); + return (ARKodeGetCurrentTime(arkode_mem, tcur)); } int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state) { - return (arkGetCurrentState(arkode_mem, state)); + return (ARKodeGetCurrentState(arkode_mem, state)); +} + +int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); } int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) { - return (arkGetRootInfo(arkode_mem, rootsfound)); + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); } int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) { - return (arkGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { - return (arkGetNumConstrFails(arkode_mem, nconstrfails)); + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); } int SPRKStepGetUserData(void* arkode_mem, void** user_data) { - return (arkGetUserData(arkode_mem, user_data)); + return (ARKodeGetUserData(arkode_mem, user_data)); } char* SPRKStepGetReturnFlagName(long int flag) { - return (arkGetReturnFlagName(flag)); + return (ARKodeGetReturnFlagName(flag)); } -/*=============================================================== - SPRKStep optional input functions -- stepper-specific - ===============================================================*/ - -/*--------------------------------------------------------------- - SPRKStepSetUserData: +int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} - Wrapper for generic arkSetUserData and arkLSSetUserData - routines. - ---------------------------------------------------------------*/ -int SPRKStepSetUserData(void* arkode_mem, void* user_data) +int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) { - return (arkSetUserData(arkode_mem, user_data)); + return (ARKodeWriteParameters(arkode_mem, fp)); } +/*=============================================================== + SPRKStep optional input functions -- stepper-specific + ===============================================================*/ + /*--------------------------------------------------------------- - SPRKStepSetDefaults: + sprkStep_SetDefaults: Resets all SPRKStep optional inputs to their default values. Does not change problem-defining function pointers or @@ -168,29 +215,10 @@ int SPRKStepSetUserData(void* arkode_mem, void* user_data) structures/options related to the ARKODE infrastructure itself (e.g., root-finding and post-process step). ---------------------------------------------------------------*/ -int SPRKStepSetDefaults(void* arkode_mem) +int sprkStep_SetDefaults(ARKodeMem ark_mem) { - ARKodeMem ark_mem = NULL; - ARKodeSPRKStepMem step_mem = NULL; - int retval = 0; - - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Set default ARKODE infrastructure parameters */ - retval = arkSetDefaults(ark_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting ARKODE infrastructure defaults"); - return (retval); - } - /* use the default method order */ - SPRKStepSetOrder(arkode_mem, 0); - - return (ARK_SUCCESS); + return (sprkStep_SetOrder(ark_mem, 0)); } /*--------------------------------------------------------------- @@ -204,14 +232,15 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (onoff) { - arkSetUseCompensatedSums(arkode_mem, SUNTRUE); - ark_mem->step = sprkStep_TakeStep_Compensated; + ark_mem->use_compensated_sums = SUNTRUE; + ark_mem->step = sprkStep_TakeStep_Compensated; if (!step_mem->yerr) { if (!arkAllocVec(ark_mem, ark_mem->yn, &(step_mem->yerr))) @@ -222,11 +251,11 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) } else { - arkSetUseCompensatedSums(arkode_mem, SUNFALSE); - ark_mem->step = sprkStep_TakeStep; + ark_mem->use_compensated_sums = SUNFALSE; + ark_mem->step = sprkStep_TakeStep; } - return (ARK_SUCCESS); + return (retval); } /*--------------------------------------------------------------- @@ -235,7 +264,7 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) Specifies the SPRK method ** Note in documentation that this should not be called along - with SPRKStepSetOrder. ** + with ARKodeSetOrder. ** ---------------------------------------------------------------*/ int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage) { @@ -243,8 +272,9 @@ int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage) ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (step_mem->method) @@ -269,8 +299,9 @@ int SPRKStepSetMethodName(void* arkode_mem, const char* method) ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } if (step_mem->method) @@ -285,21 +316,17 @@ int SPRKStepSetMethodName(void* arkode_mem, const char* method) } /*--------------------------------------------------------------- - SPRKStepSetOrder: + sprkStep_SetOrder: Specifies the method order - - ** Note in documentation that this should not be called along - with SPRKStepSetMethod. ** ---------------------------------------------------------------*/ -int SPRKStepSetOrder(void* arkode_mem, int ord) +int sprkStep_SetOrder(ARKodeMem ark_mem, int ord) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } /* Invalid orders result in the default order being used. */ @@ -333,8 +360,9 @@ int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *nf1 = step_mem->nf1; @@ -354,8 +382,9 @@ int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } *sprk_storage = step_mem->method; @@ -364,22 +393,17 @@ int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) } /*--------------------------------------------------------------- - SPRKStepPrintAllStats: + sprkStep_PrintAllStats: Prints integrator statistics ---------------------------------------------------------------*/ -int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int sprkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* step and rootfinding stats */ - retval = arkPrintAllStats(arkode_mem, outfile, fmt); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } switch (fmt) @@ -408,30 +432,19 @@ int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) ===============================================================*/ /*--------------------------------------------------------------- - SPRKStepWriteParameters: + sprkStep_WriteParameters: Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) +int sprkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - int flag = 0; int retval = 0; /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* output ARKODE infrastructure parameters first */ - flag = arkWriteParameters(ark_mem, fp); - if (flag != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error writing ARKODE infrastructure parameters"); - return (flag); - } - /* print integrator parameters to file */ fprintf(fp, "SPRKStep time step module parameters:\n"); fprintf(fp, " Method order %i\n", step_mem->method->q); diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod/farkode_erkstep_mod.c index c401460048..fab7db1d84 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -1001,7 +1001,7 @@ SWIGEXPORT int _wrap_FERKStepGetNumStepAttempts(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; @@ -1009,13 +1009,13 @@ SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { arg1 = (void *)(farg1); arg2 = (long *)(farg2); - result = (int)ERKStepGetNumRhsEvals(arg1,arg2); + result = (int)ERKStepGetNumErrTestFails(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; @@ -1023,7 +1023,7 @@ SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { arg1 = (void *)(farg1); arg2 = (long *)(farg2); - result = (int)ERKStepGetNumErrTestFails(arg1,arg2); + result = (int)ERKStepGetNumRhsEvals(arg1,arg2); fresult = (int)(result); return fresult; } diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 98a6a5f817..e75d960ae4 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -90,8 +90,8 @@ module farkode_erkstep_mod public :: FERKStepGetNumExpSteps public :: FERKStepGetNumAccSteps public :: FERKStepGetNumStepAttempts - public :: FERKStepGetNumRhsEvals public :: FERKStepGetNumErrTestFails + public :: FERKStepGetNumRhsEvals public :: FERKStepGetCurrentButcherTable public :: FERKStepGetEstLocalErrors public :: FERKStepGetWorkSpace @@ -621,8 +621,8 @@ function swigc_FERKStepGetNumStepAttempts(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetNumRhsEvals") & +function swigc_FERKStepGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumErrTestFails") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -630,8 +630,8 @@ function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetNumErrTestFails(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetNumErrTestFails") & +function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRhsEvals") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1900,35 +1900,35 @@ function FERKStepGetNumStepAttempts(arkode_mem, step_attempts) & swig_result = fresult end function -function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & +function FERKStepGetNumErrTestFails(arkode_mem, netfails) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_LONG), dimension(*), target, intent(inout) :: netfails integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(nfevals(1)) -fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) +farg2 = c_loc(netfails(1)) +fresult = swigc_FERKStepGetNumErrTestFails(farg1, farg2) swig_result = fresult end function -function FERKStepGetNumErrTestFails(arkode_mem, netfails) & +function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(netfails(1)) -fresult = swigc_FERKStepGetNumErrTestFails(farg1, farg2) +farg2 = c_loc(nfevals(1)) +fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) swig_result = fresult end function diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index a66b1b0dcd..1d9bf58f1f 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -242,6 +242,34 @@ enum { #include "arkode/arkode_ls.h" +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + + typedef struct { void* cptr; int cmemflags; @@ -256,65 +284,1945 @@ SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { } -#include <stdlib.h> -#ifdef _MSC_VER -# ifndef strtoull -# define strtoull _strtoui64 -# endif -# ifndef strtoll -# define strtoll _strtoi64 -# endif -#endif - - -#include <string.h> +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT int _wrap_FARKodeResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ARKodeResize(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeWFtolerances(void *farg1, ARKEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKEwtFn arg2 = (ARKEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKEwtFn)(farg2); + result = (int)ARKodeWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResStolerance(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeResStolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResVtolerance(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeResVtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResFtolerance(void *farg1, ARKRwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRwtFn arg2 = (ARKRwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRwtFn)(farg2); + result = (int)ARKodeResFtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)ARKodeRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKodeSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)ARKodeSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinear(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLinear(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinear(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetNonlinear(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKodeSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDeduceImplicitRhs(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetDeduceImplicitRhs(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetAdaptController(void *farg1, SUNAdaptController farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdaptController)(farg2); + result = (int)ARKodeSetAdaptController(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetAdaptivityAdjustment(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetAdaptivityAdjustment(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetCFLFraction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetCFLFraction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetErrorBias(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetErrorBias(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMinReduction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMinReduction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSetFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxFirstGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxFirstGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxEFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxEFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetSmallNumEFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetSmallNumEFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxCFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxCFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinCRDown(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinCRDown(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinRDiv(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinRDiv(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDeltaGammaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetDeltaGammaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLSetupFrequency(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPredictorMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetPredictorMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKExpStabFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ARKodeSetStabilityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKodeSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)ARKodeSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKStagePredictFn)(farg2); + result = (int)ARKodeSetStagePredictFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)ARKodeEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ARKodeGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumExpSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumExpSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumAccSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumAccSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumStepAttempts(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)ARKodeGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentMassMatrix(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKodeGetCurrentMassMatrix(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetResWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetResWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKodeGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumConstrFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)ARKodeGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodePrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)ARKodePrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ARKodeWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)ARKodeGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (void **)(farg8); + result = (int)ARKodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKodeGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetMassWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetMassWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassMultSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassMultSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassMult(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassMult(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMTSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMTSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastMassFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetLastMassFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FARKodeFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + ARKodeFree(arg1); +} + + +SWIGEXPORT void _wrap_FARKodePrintMem(void *farg1, void *farg2) { + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + ARKodePrintMem(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxFn arg2 = (ARKRelaxFn) 0 ; + ARKRelaxJacFn arg3 = (ARKRelaxJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxFn)(farg2); + arg3 = (ARKRelaxJacFn)(farg3); + result = (int)ARKodeSetRelaxFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxEtaFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxEtaFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxLowerBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxLowerBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxMaxFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetRelaxMaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxMaxIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetRelaxMaxIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxSolver(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxSolver arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxSolver)(*farg2); + result = (int)ARKodeSetRelaxSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxResTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxResTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxTol(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSetRelaxTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxUpperBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxUpperBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxFnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxFnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} -SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { - if (self->cptr == NULL) { - /* LHS is unassigned */ - if (other.cmemflags & SWIG_MEM_RVALUE) { - /* Capture pointer from RHS, clear 'moving' flag */ - self->cptr = other.cptr; - self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); - } else { - /* Become a reference to the other object */ - self->cptr = other.cptr; - self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); - } - } else if (other.cptr == NULL) { - /* Replace LHS with a null pointer */ - free(self->cptr); - *self = SwigClassWrapper_uninitialized(); - } else { - if (self->cmemflags & SWIG_MEM_OWN) { - free(self->cptr); - } - self->cptr = other.cptr; - if (other.cmemflags & SWIG_MEM_RVALUE) { - /* Capture RHS */ - self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; - } else { - /* Point to RHS */ - self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; - } - } +SWIGEXPORT int _wrap_FARKodeGetNumRelaxBoundFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxBoundFails(arg1,arg2); + fresult = (int)(result); + return fresult; } -typedef struct { - void* data; - size_t size; -} SwigArrayWrapper; +SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} -SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { - SwigArrayWrapper result; - result.data = NULL; - result.size = 0; - return result; +SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxSolveIters(arg1,arg2); + fresult = (int)(result); + return fresult; } + SWIGEXPORT int _wrap_FARKBandPrecInit(void *farg1, int64_t const *farg2, int64_t const *farg3, int64_t const *farg4) { int fresult ; void *arg1 = (void *) 0 ; @@ -1055,4 +2963,244 @@ SWIGEXPORT int _wrap_FARKodeSPRKTable_ToButcher(void *farg1, void *farg2, void * } +SWIGEXPORT int _wrap_FARKodeSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)ARKodeSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3, int const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + arg4 = (int)(*farg4); + result = (int)ARKodeSetMassLinearSolver(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacFn(void *farg1, ARKLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacFn arg2 = (ARKLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacFn)(farg2); + result = (int)ARKodeSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassFn(void *farg1, ARKLsMassFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassFn arg2 = (ARKLsMassFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassFn)(farg2); + result = (int)ARKodeSetMassFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKodeSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMassEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMassLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPreconditioner(void *farg1, ARKLsPrecSetupFn farg2, ARKLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsPrecSetupFn arg2 = (ARKLsPrecSetupFn) 0 ; + ARKLsPrecSolveFn arg3 = (ARKLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsPrecSetupFn)(farg2); + arg3 = (ARKLsPrecSolveFn)(farg3); + result = (int)ARKodeSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassPreconditioner(void *farg1, ARKLsMassPrecSetupFn farg2, ARKLsMassPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassPrecSetupFn arg2 = (ARKLsMassPrecSetupFn) 0 ; + ARKLsMassPrecSolveFn arg3 = (ARKLsMassPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassPrecSetupFn)(farg2); + arg3 = (ARKLsMassPrecSolveFn)(farg3); + result = (int)ARKodeSetMassPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacTimes(void *farg1, ARKLsJacTimesSetupFn farg2, ARKLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacTimesSetupFn arg2 = (ARKLsJacTimesSetupFn) 0 ; + ARKLsJacTimesVecFn arg3 = (ARKLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacTimesSetupFn)(farg2); + arg3 = (ARKLsJacTimesVecFn)(farg3); + result = (int)ARKodeSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacTimesRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKodeSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassTimes(void *farg1, ARKLsMassTimesSetupFn farg2, ARKLsMassTimesVecFn farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassTimesSetupFn arg2 = (ARKLsMassTimesSetupFn) 0 ; + ARKLsMassTimesVecFn arg3 = (ARKLsMassTimesVecFn) 0 ; + void *arg4 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassTimesSetupFn)(farg2); + arg3 = (ARKLsMassTimesVecFn)(farg3); + arg4 = (void *)(farg4); + result = (int)ARKodeSetMassTimes(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsLinSysFn arg2 = (ARKLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsLinSysFn)(farg2); + result = (int)ARKodeSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 7724193873..71bfe0e030 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -92,6 +92,7 @@ module farkode_mod 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_STEPPER_UNSUPPORTED = -48_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -100,6 +101,143 @@ module farkode_mod end enum integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON + public :: FARKodeResize + public :: FARKodeReset + public :: FARKodeSStolerances + public :: FARKodeSVtolerances + public :: FARKodeWFtolerances + public :: FARKodeResStolerance + public :: FARKodeResVtolerance + public :: FARKodeResFtolerance + public :: FARKodeRootInit + public :: FARKodeSetRootDirection + public :: FARKodeSetNoInactiveRootWarn + public :: FARKodeSetDefaults + public :: FARKodeSetOrder + public :: FARKodeSetInterpolantType + public :: FARKodeSetInterpolantDegree + public :: FARKodeSetNonlinearSolver + public :: FARKodeSetLinear + public :: FARKodeSetNonlinear + public :: FARKodeSetNlsRhsFn + public :: FARKodeSetDeduceImplicitRhs + public :: FARKodeSetAdaptController + public :: FARKodeSetAdaptivityAdjustment + public :: FARKodeSetCFLFraction + public :: FARKodeSetErrorBias + public :: FARKodeSetSafetyFactor + public :: FARKodeSetMaxGrowth + public :: FARKodeSetMinReduction + public :: FARKodeSetFixedStepBounds + public :: FARKodeSetMaxFirstGrowth + public :: FARKodeSetMaxEFailGrowth + public :: FARKodeSetSmallNumEFails + public :: FARKodeSetMaxCFailGrowth + public :: FARKodeSetNonlinCRDown + public :: FARKodeSetNonlinRDiv + public :: FARKodeSetDeltaGammaMax + public :: FARKodeSetLSetupFrequency + public :: FARKodeSetPredictorMethod + public :: FARKodeSetStabilityFn + public :: FARKodeSetMaxErrTestFails + public :: FARKodeSetMaxNonlinIters + public :: FARKodeSetMaxConvFails + public :: FARKodeSetNonlinConvCoef + public :: FARKodeSetConstraints + public :: FARKodeSetMaxNumSteps + public :: FARKodeSetMaxHnilWarns + public :: FARKodeSetInitStep + public :: FARKodeSetMinStep + public :: FARKodeSetMaxStep + public :: FARKodeSetInterpolateStopTime + public :: FARKodeSetStopTime + public :: FARKodeClearStopTime + public :: FARKodeSetFixedStep + public :: FARKodeSetMaxNumConstrFails + public :: FARKodeSetUserData + public :: FARKodeSetPostprocessStepFn + public :: FARKodeSetPostprocessStageFn + public :: FARKodeSetStagePredictFn + public :: FARKodeEvolve + public :: FARKodeGetDky + public :: FARKodeComputeState + public :: FARKodeGetNumExpSteps + public :: FARKodeGetNumAccSteps + public :: FARKodeGetNumStepAttempts + public :: FARKodeGetNumLinSolvSetups + public :: FARKodeGetNumErrTestFails + public :: FARKodeGetEstLocalErrors + public :: FARKodeGetWorkSpace + public :: FARKodeGetNumSteps + public :: FARKodeGetActualInitStep + public :: FARKodeGetLastStep + public :: FARKodeGetCurrentStep + public :: FARKodeGetCurrentTime + public :: FARKodeGetCurrentState + public :: FARKodeGetCurrentGamma + public :: FARKodeGetCurrentMassMatrix + public :: FARKodeGetTolScaleFactor + public :: FARKodeGetErrWeights + public :: FARKodeGetResWeights + public :: FARKodeGetNumGEvals + public :: FARKodeGetRootInfo + public :: FARKodeGetNumConstrFails + public :: FARKodeGetUserData + public :: FARKodePrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FARKodeGetReturnFlagName + public :: FARKodeWriteParameters + public :: FARKodeGetStepStats + public :: FARKodeGetNonlinearSystemData + public :: FARKodeGetNumNonlinSolvIters + public :: FARKodeGetNumNonlinSolvConvFails + public :: FARKodeGetNonlinSolvStats + public :: FARKodeGetNumStepSolveFails + public :: FARKodeGetJac + public :: FARKodeGetJacTime + public :: FARKodeGetJacNumSteps + public :: FARKodeGetLinWorkSpace + public :: FARKodeGetNumJacEvals + public :: FARKodeGetNumPrecEvals + public :: FARKodeGetNumPrecSolves + public :: FARKodeGetNumLinIters + public :: FARKodeGetNumLinConvFails + public :: FARKodeGetNumJTSetupEvals + public :: FARKodeGetNumJtimesEvals + public :: FARKodeGetNumLinRhsEvals + public :: FARKodeGetLastLinFlag + public :: FARKodeGetMassWorkSpace + public :: FARKodeGetNumMassSetups + public :: FARKodeGetNumMassMultSetups + public :: FARKodeGetNumMassMult + public :: FARKodeGetNumMassSolves + public :: FARKodeGetNumMassPrecEvals + public :: FARKodeGetNumMassPrecSolves + public :: FARKodeGetNumMassIters + public :: FARKodeGetNumMassConvFails + public :: FARKodeGetNumMTSetups + public :: FARKodeGetLastMassFlag + public :: FARKodeGetLinReturnFlagName + public :: FARKodeFree + public :: FARKodePrintMem + public :: FARKodeSetRelaxFn + public :: FARKodeSetRelaxEtaFail + public :: FARKodeSetRelaxLowerBound + public :: FARKodeSetRelaxMaxFails + public :: FARKodeSetRelaxMaxIters + public :: FARKodeSetRelaxSolver + public :: FARKodeSetRelaxResTol + public :: FARKodeSetRelaxTol + public :: FARKodeSetRelaxUpperBound + public :: FARKodeGetNumRelaxFnEvals + public :: FARKodeGetNumRelaxJacEvals + public :: FARKodeGetNumRelaxFails + public :: FARKodeGetNumRelaxBoundFails + public :: FARKodeGetNumRelaxSolveFails + public :: FARKodeGetNumRelaxSolveIters public :: FARKBandPrecInit public :: FARKBandPrecGetWorkSpace public :: FARKBandPrecGetNumRhsEvals @@ -188,10 +326,6 @@ module farkode_mod ARKODE_ESDIRK437L2SA_7_3_4, ARKODE_ESDIRK547L2SA_7_4_5, ARKODE_ESDIRK547L2SA2_7_4_5, ARKODE_ARK2_DIRK_3_1_2, & ARKODE_MAX_DIRK_NUM public :: FARKodeButcherTable_LoadDIRK - type, bind(C) :: SwigArrayWrapper - type(C_PTR), public :: data = C_NULL_PTR - integer(C_SIZE_T), public :: size = 0 - end type public :: FARKodeButcherTable_LoadDIRKByName ! typedef enum ARKODE_ERKTableID enum, bind(c) @@ -294,78 +428,88 @@ module farkode_mod integer(C_INT), parameter, public :: ARKLS_MASSFUNC_RECVR = -10_C_INT integer(C_INT), parameter, public :: ARKLS_SUNMAT_FAIL = -11_C_INT integer(C_INT), parameter, public :: ARKLS_SUNLS_FAIL = -12_C_INT + public :: FARKodeSetLinearSolver + public :: FARKodeSetMassLinearSolver + public :: FARKodeSetJacFn + public :: FARKodeSetMassFn + public :: FARKodeSetJacEvalFrequency + public :: FARKodeSetLinearSolutionScaling + public :: FARKodeSetEpsLin + public :: FARKodeSetMassEpsLin + public :: FARKodeSetLSNormFactor + public :: FARKodeSetMassLSNormFactor + public :: FARKodeSetPreconditioner + public :: FARKodeSetMassPreconditioner + public :: FARKodeSetJacTimes + public :: FARKodeSetJacTimesRhsFn + public :: FARKodeSetMassTimes + public :: FARKodeSetLinSysFn ! WRAPPER DECLARATIONS interface -function swigc_FARKBandPrecInit(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FARKBandPrecInit") & +function swigc_FARKodeResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKodeResize") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT64_T), intent(in) :: farg2 -integer(C_INT64_T), intent(in) :: farg3 -integer(C_INT64_T), intent(in) :: farg4 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function -function swigc_FARKBandPrecGetWorkSpace(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKBandPrecGetWorkSpace") & +function swigc_FARKodeReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeReset") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 type(C_PTR), value :: farg3 integer(C_INT) :: fresult end function -function swigc_FARKBandPrecGetNumRhsEvals(farg1, farg2) & -bind(C, name="_wrap_FARKBandPrecGetNumRhsEvals") & +function swigc_FARKodeSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSStolerances") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 integer(C_INT) :: fresult end function -function swigc_FARKBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & -bind(C, name="_wrap_FARKBBDPrecInit") & +function swigc_FARKodeSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSVtolerances") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT64_T), intent(in) :: farg2 -integer(C_INT64_T), intent(in) :: farg3 -integer(C_INT64_T), intent(in) :: farg4 -integer(C_INT64_T), intent(in) :: farg5 -integer(C_INT64_T), intent(in) :: farg6 -real(C_DOUBLE), intent(in) :: farg7 -type(C_FUNPTR), value :: farg8 -type(C_FUNPTR), value :: farg9 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 integer(C_INT) :: fresult end function -function swigc_FARKBBDPrecReInit(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FARKBBDPrecReInit") & +function swigc_FARKodeWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FARKodeWFtolerances") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT64_T), intent(in) :: farg2 -integer(C_INT64_T), intent(in) :: farg3 -real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKBBDPrecGetWorkSpace(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKBBDPrecGetWorkSpace") & +function swigc_FARKodeResStolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResStolerance") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKBBDPrecGetNumGfnEvals(farg1, farg2) & -bind(C, name="_wrap_FARKBBDPrecGetNumGfnEvals") & +function swigc_FARKodeResVtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResVtolerance") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -373,436 +517,4034 @@ function swigc_FARKBBDPrecGetNumGfnEvals(farg1, farg2) & integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_q_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_q_set") -use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - -function swigc_ARKodeButcherTableMem_q_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_q_get") & +function swigc_FARKodeResFtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResFtolerance") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_p_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_p_set") +function swigc_FARKodeRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeRootInit") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 -end subroutine +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function -function swigc_ARKodeButcherTableMem_p_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_p_get") & +function swigc_FARKodeSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRootDirection") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_stages_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_stages_set") -use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -integer(C_INT), intent(in) :: farg2 -end subroutine - -function swigc_ARKodeButcherTableMem_stages_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_stages_get") & +function swigc_FARKodeSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FARKodeSetNoInactiveRootWarn") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_A_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_A_set") -use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR), value :: farg2 -end subroutine - -function swigc_ARKodeButcherTableMem_A_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_A_get") & +function swigc_FARKodeSetDefaults(farg1) & +bind(C, name="_wrap_FARKodeSetDefaults") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_c_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_c_set") -use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR), value :: farg2 -end subroutine - -function swigc_ARKodeButcherTableMem_c_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_c_get") & +function swigc_FARKodeSetOrder(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetOrder") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_b_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_b_set") +function swigc_FARKodeSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolantType") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR), value :: farg2 -end subroutine +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -function swigc_ARKodeButcherTableMem_b_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_b_get") & +function swigc_FARKodeSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolantDegree") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_ARKodeButcherTableMem_d_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_d_set") +function swigc_FARKodeSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinearSolver") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 -end subroutine +integer(C_INT) :: fresult +end function -function swigc_ARKodeButcherTableMem_d_get(farg1) & -bind(C, name="_wrap_ARKodeButcherTableMem_d_get") & +function swigc_FARKodeSetLinear(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinear") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -function swigc_new_ARKodeButcherTableMem() & -bind(C, name="_wrap_new_ARKodeButcherTableMem") & +function swigc_FARKodeSetNonlinear(farg1) & +bind(C, name="_wrap_FARKodeSetNonlinear") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult end function -subroutine swigc_delete_ARKodeButcherTableMem(farg1) & -bind(C, name="_wrap_delete_ARKodeButcherTableMem") -use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper), intent(inout) :: farg1 -end subroutine - -subroutine swigc_ARKodeButcherTableMem_op_assign__(farg1, farg2) & -bind(C, name="_wrap_ARKodeButcherTableMem_op_assign__") +function swigc_FARKodeSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNlsRhsFn") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper), intent(inout) :: farg1 -type(SwigClassWrapper) :: farg2 -end subroutine +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function -function swigc_FARKodeButcherTable_Alloc(farg1, farg2) & -bind(C, name="_wrap_FARKodeButcherTable_Alloc") & +function swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetDeduceImplicitRhs") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 -type(C_PTR) :: fresult +integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FARKodeButcherTable_Create") & +function swigc_FARKodeSetAdaptController(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptController") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT), intent(in) :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_Copy(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_Copy") & +function swigc_FARKodeSetAdaptivityAdjustment(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptivityAdjustment") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR) :: fresult +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_FARKodeButcherTable_Space(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeButcherTable_Space") +function swigc_FARKodeSetCFLFraction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetCFLFraction") & +result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -end subroutine +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -subroutine swigc_FARKodeButcherTable_Free(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_Free") +function swigc_FARKodeSetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetErrorBias") & +result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -end subroutine +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -subroutine swigc_FARKodeButcherTable_Write(farg1, farg2) & -bind(C, name="_wrap_FARKodeButcherTable_Write") +function swigc_FARKodeSetSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSafetyFactor") & +result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -end subroutine +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -function swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_IsStifflyAccurate") & +function swigc_FARKodeSetMaxGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxGrowth") & 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_FARKodeButcherTable_CheckOrder(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FARKodeButcherTable_CheckOrder") & +function swigc_FARKodeSetMinReduction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinReduction") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_CheckARKOrder(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FARKodeButcherTable_CheckARKOrder") & +function swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetFixedStepBounds") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_LoadDIRK(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_LoadDIRK") & +function swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxFirstGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_LoadDIRKByName(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_LoadDIRKByName") & +function swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxEFailGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -type(SwigArrayWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_LoadERK(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_LoadERK") & +function swigc_FARKodeSetSmallNumEFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSmallNumEFails") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -function swigc_FARKodeButcherTable_LoadERKByName(farg1) & -bind(C, name="_wrap_FARKodeButcherTable_LoadERKByName") & +function swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxCFailGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -type(SwigArrayWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_ARKodeSPRKTableMem_q_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeSPRKTableMem_q_set") +function swigc_FARKodeSetNonlinCRDown(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinCRDown") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetNonlinRDiv(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinRDiv") & +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_FARKodeSetDeltaGammaMax(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetDeltaGammaMax") & +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_FARKodeSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLSetupFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 -end subroutine +integer(C_INT) :: fresult +end function -function swigc_ARKodeSPRKTableMem_q_get(farg1) & -bind(C, name="_wrap_ARKodeSPRKTableMem_q_get") & +function swigc_FARKodeSetPredictorMethod(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPredictorMethod") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -subroutine swigc_ARKodeSPRKTableMem_stages_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeSPRKTableMem_stages_set") +function swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetStabilityFn") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxErrTestFails") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 -end subroutine +integer(C_INT) :: fresult +end function -function swigc_ARKodeSPRKTableMem_stages_get(farg1) & -bind(C, name="_wrap_ARKodeSPRKTableMem_stages_get") & +function swigc_FARKodeSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNonlinIters") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -subroutine swigc_ARKodeSPRKTableMem_a_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeSPRKTableMem_a_set") +function swigc_FARKodeSetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxConvFails") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR), value :: farg2 -end subroutine +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -function swigc_ARKodeSPRKTableMem_a_get(farg1) & -bind(C, name="_wrap_ARKodeSPRKTableMem_a_get") & +function swigc_FARKodeSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinConvCoef") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_ARKodeSPRKTableMem_ahat_set(farg1, farg2) & -bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_set") +function swigc_FARKodeSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetConstraints") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 -end subroutine +integer(C_INT) :: fresult +end function -function swigc_ARKodeSPRKTableMem_ahat_get(farg1) & -bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_get") & +function swigc_FARKodeSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumSteps") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult end function -function swigc_new_ARKodeSPRKTableMem() & -bind(C, name="_wrap_new_ARKodeSPRKTableMem") & +function swigc_FARKodeSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxHnilWarns") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: fresult +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult end function -subroutine swigc_delete_ARKodeSPRKTableMem(farg1) & -bind(C, name="_wrap_delete_ARKodeSPRKTableMem") +function swigc_FARKodeSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInitStep") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper), intent(inout) :: farg1 -end subroutine +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -subroutine swigc_ARKodeSPRKTableMem_op_assign__(farg1, farg2) & -bind(C, name="_wrap_ARKodeSPRKTableMem_op_assign__") +function swigc_FARKodeSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinStep") & +result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper), intent(inout) :: farg1 -type(SwigClassWrapper) :: farg2 -end subroutine +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function -function swigc_FARKodeSPRKTable_Create(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FARKodeSPRKTable_Create") & +function swigc_FARKodeSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxStep") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolateStopTime") & +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_FARKodeSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStopTime") & +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_FARKodeClearStopTime(farg1) & +bind(C, name="_wrap_FARKodeClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetFixedStep") & +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_FARKodeSetMaxNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumConstrFails") & +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_FARKodeSetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetUserData") & +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_FARKodeSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetStagePredictFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStagePredictFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKodeEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 type(C_PTR), value :: farg3 type(C_PTR), value :: farg4 -type(C_PTR) :: fresult +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult end function -function swigc_FARKodeSPRKTable_Alloc(farg1) & -bind(C, name="_wrap_FARKodeSPRKTable_Alloc") & +function swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeGetDky") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult end function -function swigc_FARKodeSPRKTable_Load(farg1) & -bind(C, name="_wrap_FARKodeSPRKTable_Load") & +function swigc_FARKodeComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeComputeState") & result(fresult) use, intrinsic :: ISO_C_BINDING -integer(C_INT), intent(in) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult end function -function swigc_FARKodeSPRKTable_LoadByName(farg1) & -bind(C, name="_wrap_FARKodeSPRKTable_LoadByName") & +function swigc_FARKodeGetNumExpSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumExpSteps") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -type(SwigArrayWrapper) :: farg1 -type(C_PTR) :: fresult +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetNumAccSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumAccSteps") & +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_FARKodeGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumStepAttempts") & +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_FARKodeGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & +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_FARKodeGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumErrTestFails") & +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_FARKodeGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetEstLocalErrors") & +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_FARKodeGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetWorkSpace") & +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_FARKodeGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumSteps") & +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_FARKodeGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetActualInitStep") & +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_FARKodeGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastStep") & +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_FARKodeGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentStep") & +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_FARKodeGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentTime") & +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_FARKodeGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentState") & +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_FARKodeGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentGamma") & +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_FARKodeGetCurrentMassMatrix(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentMassMatrix") & +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_FARKodeGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetTolScaleFactor") & +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_FARKodeGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetErrWeights") & +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_FARKodeGetResWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetResWeights") & +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_FARKodeGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumGEvals") & +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_FARKodeGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetRootInfo") & +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_FARKodeGetNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumConstrFails") & +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_FARKodeGetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetUserData") & +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_FARKodePrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodePrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FARKodeGetReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FARKodeWriteParameters") & +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_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKodeGetStepStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FARKodeGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumNonlinSolvIters") & +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_FARKodeGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumNonlinSolvConvFails") & +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_FARKodeGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetNonlinSolvStats") & +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_FARKodeGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumStepSolveFails") & +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_FARKodeGetJac(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJac") & +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_FARKodeGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJacTime") & +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_FARKodeGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJacNumSteps") & +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_FARKodeGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetLinWorkSpace") & +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_FARKodeGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJacEvals") & +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_FARKodeGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumPrecEvals") & +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_FARKodeGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumPrecSolves") & +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_FARKodeGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinIters") & +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_FARKodeGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinConvFails") & +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_FARKodeGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJTSetupEvals") & +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_FARKodeGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJtimesEvals") & +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_FARKodeGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinRhsEvals") & +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_FARKodeGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastLinFlag") & +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_FARKodeGetMassWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetMassWorkSpace") & +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_FARKodeGetNumMassSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassSetups") & +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_FARKodeGetNumMassMultSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassMultSetups") & +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_FARKodeGetNumMassMult(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassMult") & +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_FARKodeGetNumMassSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassSolves") & +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_FARKodeGetNumMassPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassPrecEvals") & +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_FARKodeGetNumMassPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassPrecSolves") & +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_FARKodeGetNumMassIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassIters") & +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_FARKodeGetNumMassConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassConvFails") & +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_FARKodeGetNumMTSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMTSetups") & +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_FARKodeGetLastMassFlag(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastMassFlag") & +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_FARKodeGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FARKodeFree(farg1) & +bind(C, name="_wrap_FARKodeFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FARKodePrintMem(farg1, farg2) & +bind(C, name="_wrap_FARKodePrintMem") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FARKodeSetRelaxFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetRelaxFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetRelaxEtaFail(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxEtaFail") & +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_FARKodeSetRelaxLowerBound(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxLowerBound") & +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_FARKodeSetRelaxMaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxMaxFails") & +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_FARKodeSetRelaxMaxIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxMaxIters") & +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_FARKodeSetRelaxSolver(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxSolver") & +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_FARKodeSetRelaxResTol(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxResTol") & +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_FARKodeSetRelaxTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetRelaxTol") & +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_FARKodeSetRelaxUpperBound(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxUpperBound") & +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_FARKodeGetNumRelaxFnEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxFnEvals") & +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_FARKodeGetNumRelaxJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxJacEvals") & +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_FARKodeGetNumRelaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxFails") & +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_FARKodeGetNumRelaxBoundFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxBoundFails") & +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_FARKodeGetNumRelaxSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxSolveFails") & +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_FARKodeGetNumRelaxSolveIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxSolveIters") & +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_FARKBandPrecInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKBandPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT64_T), intent(in) :: farg2 +integer(C_INT64_T), intent(in) :: farg3 +integer(C_INT64_T), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKBandPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKBandPrecGetWorkSpace") & +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_FARKBandPrecGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FARKBandPrecGetNumRhsEvals") & +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_FARKBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FARKBBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT64_T), intent(in) :: farg2 +integer(C_INT64_T), intent(in) :: farg3 +integer(C_INT64_T), intent(in) :: farg4 +integer(C_INT64_T), intent(in) :: farg5 +integer(C_INT64_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FARKBBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKBBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT64_T), intent(in) :: farg2 +integer(C_INT64_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKBBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKBBDPrecGetWorkSpace") & +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_FARKBBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FARKBBDPrecGetNumGfnEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_q_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_q_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_q_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_q_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_p_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_p_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_p_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_p_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_stages_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_A_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_A_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_A_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_A_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_c_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_c_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_c_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_c_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_b_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_b_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_b_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_b_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_d_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_d_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_d_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_d_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_new_ARKodeButcherTableMem() & +bind(C, name="_wrap_new_ARKodeButcherTableMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_ARKodeButcherTableMem(farg1) & +bind(C, name="_wrap_delete_ARKodeButcherTableMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_ARKodeButcherTableMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FARKodeButcherTable_Alloc(farg1, farg2) & +bind(C, name="_wrap_FARKodeButcherTable_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FARKodeButcherTable_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_Copy(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FARKodeButcherTable_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeButcherTable_Space") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FARKodeButcherTable_Free(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_Free") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FARKodeButcherTable_Write(farg1, farg2) & +bind(C, name="_wrap_FARKodeButcherTable_Write") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_IsStifflyAccurate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_CheckOrder(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeButcherTable_CheckOrder") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_CheckARKOrder(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKodeButcherTable_CheckARKOrder") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadDIRK(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadDIRK") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadDIRKByName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadDIRKByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadERK(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadERK") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadERKByName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadERKByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_q_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_q_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_q_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_q_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_stages_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_a_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_a_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_a_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_a_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_ahat_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_ahat_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_new_ARKodeSPRKTableMem() & +bind(C, name="_wrap_new_ARKodeSPRKTableMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_ARKodeSPRKTableMem(farg1) & +bind(C, name="_wrap_delete_ARKodeSPRKTableMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_ARKodeSPRKTableMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FARKodeSPRKTable_Create(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSPRKTable_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Alloc(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Load(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Load") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_LoadByName(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_LoadByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Copy(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FARKodeSPRKTable_Write(farg1, farg2) & +bind(C, name="_wrap_FARKodeSPRKTable_Write") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FARKodeSPRKTable_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSPRKTable_Space") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FARKodeSPRKTable_Free(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Free") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FARKodeSPRKTable_ToButcher(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSPRKTable_ToButcher") & +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_FARKodeSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetLinearSolver") & +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_FARKodeSetMassLinearSolver(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSetMassLinearSolver") & +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), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinearSolutionScaling") & +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_FARKodeSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetEpsLin") & +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_FARKodeSetMassEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassEpsLin") & +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_FARKodeSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLSNormFactor") & +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_FARKodeSetMassLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassLSNormFactor") & +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_FARKodeSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetMassPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassTimes(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSetMassTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FARKodeResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: hscale +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_FUNPTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(ynew) +farg3 = hscale +farg4 = t0 +farg5 = resize +farg6 = resize_data +fresult = swigc_FARKodeResize(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKodeReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FARKodeReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSStolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FARKodeSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSVtolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FARKodeSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeWFtolerances(arkode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = efun +fresult = swigc_FARKodeWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResStolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rabstol +fresult = swigc_FARKodeResStolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResVtolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rabstol) +fresult = swigc_FARKodeResVtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResFtolerance(arkode_mem, rfun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = rfun +fresult = swigc_FARKodeResFtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FARKodeRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FARKodeSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FARKodeSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetDefaults(farg1) +swig_result = fresult +end function + +function FARKodeSetOrder(arkode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxord +fresult = swigc_FARKodeSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FARKodeSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FARKodeSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinearSolver(arkode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nls) +fresult = swigc_FARKodeSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLinear(arkode_mem, timedepend) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: timedepend +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = timedepend +fresult = swigc_FARKodeSetLinear(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinear(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetNonlinear(farg1) +swig_result = fresult +end function + +function FARKodeSetNlsRhsFn(arkode_mem, nls_fi) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: nls_fi +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = nls_fi +fresult = swigc_FARKodeSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetDeduceImplicitRhs(arkode_mem, deduce) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: deduce +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = deduce +fresult = swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetAdaptController(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_FARKodeSetAdaptController(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetAdaptivityAdjustment(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_FARKodeSetAdaptivityAdjustment(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetCFLFraction(arkode_mem, cfl_frac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: cfl_frac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = cfl_frac +fresult = swigc_FARKodeSetCFLFraction(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetErrorBias(arkode_mem, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = bias +fresult = swigc_FARKodeSetErrorBias(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetSafetyFactor(arkode_mem, safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = safety +fresult = swigc_FARKodeSetSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxGrowth(arkode_mem, mx_growth) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: mx_growth +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = mx_growth +fresult = swigc_FARKodeSetMaxGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMinReduction(arkode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_min +fresult = swigc_FARKodeSetMinReduction(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetFixedStepBounds(arkode_mem, lb, ub) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lb +real(C_DOUBLE), intent(in) :: ub +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = lb +farg3 = ub +fresult = swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMaxFirstGrowth(arkode_mem, etamx1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamx1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamx1 +fresult = swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxEFailGrowth(arkode_mem, etamxf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamxf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamxf +fresult = swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetSmallNumEFails(arkode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = small_nef +fresult = swigc_FARKodeSetSmallNumEFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxCFailGrowth(arkode_mem, etacf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etacf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etacf +fresult = swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinCRDown(arkode_mem, crdown) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: crdown +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = crdown +fresult = swigc_FARKodeSetNonlinCRDown(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinRDiv(arkode_mem, rdiv) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rdiv +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rdiv +fresult = swigc_FARKodeSetNonlinRDiv(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetDeltaGammaMax(arkode_mem, dgmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dgmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dgmax +fresult = swigc_FARKodeSetDeltaGammaMax(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLSetupFrequency(arkode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = msbp +fresult = swigc_FARKodeSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPredictorMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FARKodeSetPredictorMethod(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStabilityFn(arkode_mem, estab, estab_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: estab +type(C_PTR) :: estab_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = estab +farg3 = estab_data +fresult = swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMaxErrTestFails(arkode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxnef +fresult = swigc_FARKodeSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNonlinIters(arkode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxcor +fresult = swigc_FARKodeSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxConvFails(arkode_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxncf +fresult = swigc_FARKodeSetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nlscoef +fresult = swigc_FARKodeSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetConstraints(arkode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(constraints) +fresult = swigc_FARKodeSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FARKodeSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxHnilWarns(arkode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = mxhnil +fresult = swigc_FARKodeSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInitStep(arkode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hin +fresult = swigc_FARKodeSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMinStep(arkode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmin +fresult = swigc_FARKodeSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxStep(arkode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmax +fresult = swigc_FARKodeSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolateStopTime(arkode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = interp +fresult = swigc_FARKodeSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FARKodeSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeClearStopTime(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeClearStopTime(farg1) +swig_result = fresult +end function + +function FARKodeSetFixedStep(arkode_mem, hfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hfixed +fresult = swigc_FARKodeSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxfails +fresult = swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FARKodeSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FARKodeSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FARKodeSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStagePredictFn(arkode_mem, predictstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: predictstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = predictstage +fresult = swigc_FARKodeSetStagePredictFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKodeGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeComputeState(arkode_mem, zcor, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: zcor +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(zcor) +farg3 = c_loc(z) +fresult = swigc_FARKodeComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumExpSteps(arkode_mem, expsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +fresult = swigc_FARKodeGetNumExpSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumAccSteps(arkode_mem, accsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accsteps(1)) +fresult = swigc_FARKodeGetNumAccSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(step_attempts(1)) +fresult = swigc_FARKodeGetNumStepAttempts(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumErrTestFails(arkode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FARKodeGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetEstLocalErrors(arkode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ele) +fresult = swigc_FARKodeGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +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 = arkode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FARKodeGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumSteps(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FARKodeGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetActualInitStep(arkode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FARKodeGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FARKodeGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentStep(arkode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FARKodeGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentState(arkode_mem, state) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: state +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = state +fresult = swigc_FARKodeGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentGamma(arkode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FARKodeGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentMassMatrix(arkode_mem, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(m) +fresult = swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetTolScaleFactor(arkode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FARKodeGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetErrWeights(arkode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(eweight) +fresult = swigc_FARKodeGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetResWeights(arkode_mem, rweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rweight) +fresult = swigc_FARKodeGetResWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumGEvals(arkode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FARKodeGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FARKodeGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumConstrFails(arkode_mem, nconstrfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nconstrfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nconstrfails(1)) +fresult = swigc_FARKodeGetNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FARKodeGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKodePrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FARKodePrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FARKodeGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FARKodeWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, fi, gamma, sdata, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: zpred +type(C_PTR) :: z +type(C_PTR) :: fi +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +type(C_PTR) :: sdata +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +farg3 = zpred +farg4 = z +farg5 = fi +farg6 = c_loc(gamma(1)) +farg7 = sdata +farg8 = c_loc(user_data) +fresult = swigc_FARKodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FARKodeGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FARKodeGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FARKodeGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumStepSolveFails(arkode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FARKodeGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJac(arkode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j) +fresult = swigc_FARKodeGetJac(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJacTime(arkode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FARKodeGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJacNumSteps(arkode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FARKodeGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FARKodeGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumJacEvals(arkode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FARKodeGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumPrecEvals(arkode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FARKodeGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumPrecSolves(arkode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FARKodeGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinIters(arkode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FARKodeGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinConvFails(arkode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FARKodeGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumJTSetupEvals(arkode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FARKodeGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumJtimesEvals(arkode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FARKodeGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinRhsEvals(arkode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FARKodeGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastLinFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKodeGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetMassWorkSpace(arkode_mem, lenrwmls, leniwmls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwmls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwmls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwmls(1)) +farg3 = c_loc(leniwmls(1)) +fresult = swigc_FARKodeGetMassWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumMassSetups(arkode_mem, nmsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsetups(1)) +fresult = swigc_FARKodeGetNumMassSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassMultSetups(arkode_mem, nmvsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvsetups(1)) +fresult = swigc_FARKodeGetNumMassMultSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassMult(arkode_mem, nmvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvevals(1)) +fresult = swigc_FARKodeGetNumMassMult(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassSolves(arkode_mem, nmsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsolves(1)) +fresult = swigc_FARKodeGetNumMassSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassPrecEvals(arkode_mem, nmpevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpevals(1)) +fresult = swigc_FARKodeGetNumMassPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassPrecSolves(arkode_mem, nmpsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpsolves(1)) +fresult = swigc_FARKodeGetNumMassPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassIters(arkode_mem, nmiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmiters(1)) +fresult = swigc_FARKodeGetNumMassIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassConvFails(arkode_mem, nmcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmcfails(1)) +fresult = swigc_FARKodeGetNumMassConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMTSetups(arkode_mem, nmtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmtsetups(1)) +fresult = swigc_FARKodeGetNumMTSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastMassFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKodeGetLastMassFlag(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FARKodeFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FARKodeFree(farg1) +end subroutine + +subroutine FARKodePrintMem(arkode_mem, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = outfile +call swigc_FARKodePrintMem(farg1, farg2) +end subroutine + +function FARKodeSetRelaxFn(arkode_mem, rfn, rjac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfn +type(C_FUNPTR), intent(in), value :: rjac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = rfn +farg3 = rjac +fresult = swigc_FARKodeSetRelaxFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRelaxEtaFail(arkode_mem, eta_rf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_rf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_rf +fresult = swigc_FARKodeSetRelaxEtaFail(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxLowerBound(arkode_mem, lower) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lower +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = lower +fresult = swigc_FARKodeSetRelaxLowerBound(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxMaxFails(arkode_mem, max_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_fails +fresult = swigc_FARKodeSetRelaxMaxFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxMaxIters(arkode_mem, max_iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_iters +fresult = swigc_FARKodeSetRelaxMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxSolver(arkode_mem, solver) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKRelaxSolver), intent(in) :: solver +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = solver +fresult = swigc_FARKodeSetRelaxSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxResTol(arkode_mem, res_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: res_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = res_tol +fresult = swigc_FARKodeSetRelaxResTol(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rel_tol +real(C_DOUBLE), intent(in) :: abs_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = rel_tol +farg3 = abs_tol +fresult = swigc_FARKodeSetRelaxTol(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRelaxUpperBound(arkode_mem, upper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: upper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = upper +fresult = swigc_FARKodeSetRelaxUpperBound(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxFnEvals(arkode_mem, r_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: r_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(r_evals(1)) +fresult = swigc_FARKodeGetNumRelaxFnEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxJacEvals(arkode_mem, j_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: j_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j_evals(1)) +fresult = swigc_FARKodeGetNumRelaxJacEvals(farg1, farg2) +swig_result = fresult end function -function swigc_FARKodeSPRKTable_Copy(farg1) & -bind(C, name="_wrap_FARKodeSPRKTable_Copy") & -result(fresult) +function FARKodeGetNumRelaxFails(arkode_mem, relax_fails) & +result(swig_result) use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR) :: fresult +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: relax_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(relax_fails(1)) +fresult = swigc_FARKodeGetNumRelaxFails(farg1, farg2) +swig_result = fresult end function -subroutine swigc_FARKodeSPRKTable_Write(farg1, farg2) & -bind(C, name="_wrap_FARKodeSPRKTable_Write") +function FARKodeGetNumRelaxBoundFails(arkode_mem, fails) & +result(swig_result) use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -end subroutine +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 -subroutine swigc_FARKodeSPRKTable_Space(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeSPRKTable_Space") -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -end subroutine +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKodeGetNumRelaxBoundFails(farg1, farg2) +swig_result = fresult +end function -subroutine swigc_FARKodeSPRKTable_Free(farg1) & -bind(C, name="_wrap_FARKodeSPRKTable_Free") +function FARKodeGetNumRelaxSolveFails(arkode_mem, fails) & +result(swig_result) use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -end subroutine +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 -function swigc_FARKodeSPRKTable_ToButcher(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeSPRKTable_ToButcher") & -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 +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKodeGetNumRelaxSolveFails(farg1, farg2) +swig_result = fresult end function -end interface +function FARKodeGetNumRelaxSolveIters(arkode_mem, iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +farg1 = arkode_mem +farg2 = c_loc(iters(1)) +fresult = swigc_FARKodeGetNumRelaxSolveIters(farg1, farg2) +swig_result = fresult +end function -contains - ! MODULE SUBPROGRAMS function FARKBandPrecInit(arkode_mem, n, mu, ml) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1661,5 +5403,285 @@ function FARKodeSPRKTable_ToButcher(sprk_storage, a_ptr, b_ptr) & swig_result = fresult end function +function FARKodeSetLinearSolver(arkode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FARKodeSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMassLinearSolver(arkode_mem, ls, m, time_dep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: m +integer(C_INT), intent(in) :: time_dep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(m) +farg4 = time_dep +fresult = swigc_FARKodeSetMassLinearSolver(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeSetJacFn(arkode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jac +fresult = swigc_FARKodeSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassFn(arkode_mem, mass) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: mass +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = mass +fresult = swigc_FARKodeSetMassFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetJacEvalFrequency(arkode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = msbj +fresult = swigc_FARKodeSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLinearSolutionScaling(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FARKodeSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKodeSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKodeSetMassEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKodeSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKodeSetMassLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKodeSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMassPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKodeSetMassPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetJacTimes(arkode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FARKodeSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetJacTimesRhsFn(arkode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jtimesrhsfn +fresult = swigc_FARKodeSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: msetup +type(C_FUNPTR), intent(in), value :: mtimes +type(C_PTR) :: mtimes_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = msetup +farg3 = mtimes +farg4 = mtimes_data +fresult = swigc_FARKodeSetMassTimes(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeSetLinSysFn(arkode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = linsys +fresult = swigc_FARKodeSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index fd98282db7..67e20edf1f 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -215,6 +215,11 @@ int ARKBraid_GetVecTmpl(braid_App app, N_Vector* tmpl) } int ARKBraid_GetARKStepMem(braid_App app, void** arkode_mem) +{ + return (ARKBraid_GetARKodeMem(app, arkode_mem)); +} + +int ARKBraid_GetARKodeMem(braid_App app, void** arkode_mem) { ARKBraidContent content; if (app == NULL) { return SUNBRAID_ILLINPUT; } @@ -247,6 +252,11 @@ int ARKBraid_GetLastBraidFlag(braid_App app, int* last_flag) } int ARKBraid_GetLastARKStepFlag(braid_App app, int* last_flag) +{ + return (ARKBraid_GetLastARKodeFlag(app, last_flag)); +} + +int ARKBraid_GetLastARKodeFlag(braid_App app, int* last_flag) { ARKBraidContent content; if (app == NULL) { return SUNBRAID_ILLINPUT; } @@ -321,7 +331,7 @@ int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, { /* Get the suggested step size. The rfac value is given by ETACF on a solver failure and limited by ETAMIN on an error test failure */ - flag = ARKStepGetCurrentStep((void*)(content->ark_mem), &hacc); + flag = ARKodeGetCurrentStep((void*)(content->ark_mem), &hacc); CHECK_ARKODE_RETURN(content->last_flag_arkode, flag); /* Set the refinement factor */ @@ -446,12 +456,12 @@ int ARKBraid_TakeStep(void* arkode_mem, sunrealtype tstart, sunrealtype tstop, if (arkode_mem == NULL) { return ARK_MEM_NULL; } if (y == NULL) { return ARK_ILL_INPUT; } - /* Reset ARKStep state */ - flag = ARKStepReset(arkode_mem, tstart, y); + /* Reset ARKODE state */ + flag = ARKodeReset(arkode_mem, tstart, y); if (flag != ARK_SUCCESS) { return flag; } /* Set the time step size */ - flag = ARKStepSetInitStep(arkode_mem, tstop - tstart); + flag = ARKodeSetInitStep(arkode_mem, tstop - tstart); if (flag != ARK_SUCCESS) { return flag; } /* Ignore temporal error test result and force step to pass */ @@ -459,7 +469,7 @@ int ARKBraid_TakeStep(void* arkode_mem, sunrealtype tstart, sunrealtype tstop, if (flag != ARK_SUCCESS) { return flag; } /* Take step, check flag below */ - tmp_flag = ARKStepEvolve(arkode_mem, tstop, y, &tret, ARK_ONE_STEP); + tmp_flag = ARKodeEvolve(arkode_mem, tstop, y, &tret, ARK_ONE_STEP); /* Re-enable temporal error test check */ flag = arkSetForcePass(arkode_mem, SUNFALSE); diff --git a/test/answers b/test/answers index 1ab057ec30..ea6ac15fdc 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 1ab057ec30477fd531d4cc16c6b9bb0cd55ebd45 +Subproject commit ea6ac15fdcd8615e25e52692bcd453e2f003f46b 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 8a60b4801e..86b8efb0d3 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 @@ -258,86 +258,86 @@ int main(int argc, char* argv[]) if (check_flag((void*)C, "MRIStepCoupling_MIStoMRI", 0)) { return 1; } // Set routines - flag = ARKStepSetUserData(arkstep_mem, - (void*)udata); // Pass udata to user functions - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSetNonlinConvCoef(arkstep_mem, - SUN_RCONST(1.e-7)); // Update solver convergence coeff. - if (check_flag(&flag, "ARKStepSetNonlinConvCoef", 1)) { return 1; } - flag = ARKStepSStolerances(arkstep_mem, rtol, atol); // Specify tolerances - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetFixedStep(arkstep_mem, Tf / Nt); // Specify fixed time step size - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetUserData(arkstep_mem, + (void*)udata); // Pass udata to user functions + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetNonlinConvCoef(arkstep_mem, + SUN_RCONST(1.e-7)); // Update solver convergence coeff. + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return 1; } + flag = ARKodeSStolerances(arkstep_mem, rtol, atol); // Specify tolerances + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkstep_mem, Tf / Nt); // Specify fixed time step size + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } flag = ARKStepSetTables(arkstep_mem, 2, 0, B, NULL); // Specify Butcher table if (check_flag(&flag, "ARKStepSetTables", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkstep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - - flag = MRIStepSetUserData(mristep_mem, - (void*)udata); // Pass udata to user functions - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } - flag = MRIStepSetNonlinConvCoef(mristep_mem, - SUN_RCONST(1.e-7)); // Update solver convergence coeff. - if (check_flag(&flag, "MRIStepSetNonlinConvCoef", 1)) { return 1; } - flag = MRIStepSStolerances(mristep_mem, rtol, atol); // Specify tolerances - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } - flag = MRIStepSetFixedStep(mristep_mem, Tf / Nt); // Specify fixed time step sizes - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } - flag = ARKStepSetFixedStep(inner_mem, Tf / Nt / 10); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } - flag = MRIStepSetCoupling(mristep_mem, C); // Specify Butcher table + flag = ARKodeSetMaxNumSteps(arkstep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + flag = ARKodeSetUserData(mristep_mem, + (void*)udata); // Pass udata to user functions + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSetNonlinConvCoef(mristep_mem, + SUN_RCONST(1.e-7)); // Update solver convergence coeff. + if (check_flag(&flag, "ARKodeSetNonlinConvCoef", 1)) { return 1; } + flag = ARKodeSStolerances(mristep_mem, rtol, atol); // Specify tolerances + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetFixedStep(mristep_mem, Tf / Nt); // Specify fixed time step sizes + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(inner_mem, Tf / Nt / 10); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetCoupling(mristep_mem, C); // Specify coupling table if (check_flag(&flag, "MRIStepSetCoupling", 1)) { return 1; } - flag = MRIStepSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Linear solver interface - flag = ARKStepSetLinearSolver(arkstep_mem, LSa, NULL); // Attach linear solver - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetPreconditioner(arkstep_mem, PSet, - PSol); // Specify the Preconditoner - if (check_flag(&flag, "ARKStepSetPreconditioner", 1)) { return 1; } - - flag = MRIStepSetLinearSolver(mristep_mem, LSm, NULL); // Attach linear solver - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } - flag = MRIStepSetPreconditioner(mristep_mem, PSet, - PSol); // Specify the Preconditoner - if (check_flag(&flag, "MRIStepSetPreconditioner", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkstep_mem, LSa, NULL); // Attach linear solver + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetPreconditioner(arkstep_mem, PSet, + PSol); // Specify the Preconditoner + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + + flag = ARKodeSetLinearSolver(mristep_mem, LSm, NULL); // Attach linear solver + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetPreconditioner(mristep_mem, PSet, + PSol); // Specify the Preconditoner + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Optionally specify linearly implicit RHS, with non-time-dependent preconditioner if (linear) { - flag = ARKStepSetLinear(arkstep_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } - flag = MRIStepSetLinear(mristep_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(mristep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } - // First call ARKStep to evolve the full problem, and print results + // First call ARKodeEvolve to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - flag = ARKStepEvolve(arkstep_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } - flag = ARKStepGetNumSteps(arkstep_mem, &ark_nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return 1; } + flag = ARKodeEvolve(arkstep_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKodeGetNumSteps(arkstep_mem, &ark_nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } flag = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return 1; } - flag = ARKStepGetNumLinSolvSetups(arkstep_mem, &ark_nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvIters(arkstep_mem, &ark_nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkstep_mem, &ark_ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return 1; } - flag = ARKStepGetNumLinIters(arkstep_mem, &ark_nli); - if (check_flag(&flag, "ARKStepGetNumLinIters", 1)) { return 1; } - flag = ARKStepGetNumJtimesEvals(arkstep_mem, &ark_nJv); - if (check_flag(&flag, "ARKStepGetNumJtimesEvals", 1)) { return 1; } - flag = ARKStepGetNumLinConvFails(arkstep_mem, &ark_nlcf); - if (check_flag(&flag, "ARKStepGetNumLinConvFails", 1)) { return 1; } - flag = ARKStepGetNumPrecEvals(arkstep_mem, &ark_npe); - if (check_flag(&flag, "ARKStepGetNumPrecEvals", 1)) { return 1; } - flag = ARKStepGetNumPrecSolves(arkstep_mem, &ark_nps); - if (check_flag(&flag, "ARKStepGetNumPrecSolves", 1)) { return 1; } + flag = ARKodeGetNumLinSolvSetups(arkstep_mem, &ark_nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &ark_nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkstep_mem, &ark_ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } + flag = ARKodeGetNumLinIters(arkstep_mem, &ark_nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return 1; } + flag = ARKodeGetNumJtimesEvals(arkstep_mem, &ark_nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return 1; } + flag = ARKodeGetNumLinConvFails(arkstep_mem, &ark_nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return 1; } + flag = ARKodeGetNumPrecEvals(arkstep_mem, &ark_npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return 1; } + flag = ARKodeGetNumPrecSolves(arkstep_mem, &ark_nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return 1; } if (outproc) { cout << "\nARKStep Solver Statistics:\n"; @@ -356,31 +356,31 @@ int main(int argc, char* argv[]) << ark_ncfn << "\n"; } - // Second call MRIStep to evolve the full problem, and print results + // Second call ARKodeEvolve to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - flag = MRIStepEvolve(mristep_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "MRIStepEvolve", 1)) { return 1; } - flag = MRIStepGetNumSteps(mristep_mem, &mri_nst); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return 1; } + flag = ARKodeEvolve(mristep_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } - flag = MRIStepGetNumLinSolvSetups(mristep_mem, &mri_nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return 1; } - flag = MRIStepGetNumNonlinSolvIters(mristep_mem, &mri_nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = MRIStepGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) { return 1; } - flag = MRIStepGetNumLinIters(mristep_mem, &mri_nli); - if (check_flag(&flag, "MRIStepGetNumLinIters", 1)) { return 1; } - flag = MRIStepGetNumJtimesEvals(mristep_mem, &mri_nJv); - if (check_flag(&flag, "MRIStepGetNumJtimesEvals", 1)) { return 1; } - flag = MRIStepGetNumLinConvFails(mristep_mem, &mri_nlcf); - if (check_flag(&flag, "MRIStepGetNumLinConvFails", 1)) { return 1; } - flag = MRIStepGetNumPrecEvals(mristep_mem, &mri_npe); - if (check_flag(&flag, "MRIStepGetNumPrecEvals", 1)) { return 1; } - flag = MRIStepGetNumPrecSolves(mristep_mem, &mri_nps); - if (check_flag(&flag, "MRIStepGetNumPrecSolves", 1)) { return 1; } + flag = ARKodeGetNumLinSolvSetups(mristep_mem, &mri_nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } + flag = ARKodeGetNumLinIters(mristep_mem, &mri_nli); + if (check_flag(&flag, "ARKodeGetNumLinIters", 1)) { return 1; } + flag = ARKodeGetNumJtimesEvals(mristep_mem, &mri_nJv); + if (check_flag(&flag, "ARKodeGetNumJtimesEvals", 1)) { return 1; } + flag = ARKodeGetNumLinConvFails(mristep_mem, &mri_nlcf); + if (check_flag(&flag, "ARKodeGetNumLinConvFails", 1)) { return 1; } + flag = ARKodeGetNumPrecEvals(mristep_mem, &mri_npe); + if (check_flag(&flag, "ARKodeGetNumPrecEvals", 1)) { return 1; } + flag = ARKodeGetNumPrecSolves(mristep_mem, &mri_nps); + if (check_flag(&flag, "ARKodeGetNumPrecSolves", 1)) { return 1; } if (outproc) { cout << "\nMRIStep Solver Statistics:\n"; @@ -491,9 +491,9 @@ int main(int argc, char* argv[]) ARKodeButcherTable_Free(B); // Free Butcher table ARKodeButcherTable_Free(Bc); // Free Butcher table MRIStepCoupling_Free(C); // Free MRI coupling table - ARKStepFree(&arkstep_mem); // Free integrator memory - MRIStepFree(&mristep_mem); - ARKStepFree(&inner_mem); + ARKodeFree(&arkstep_mem); // Free integrator memory + ARKodeFree(&mristep_mem); + ARKodeFree(&inner_mem); MRIStepInnerStepper_Free(&inner_stepper); SUNLinSolFree(LSa); // Free linear solver SUNLinSolFree(LSm); 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 1a6cbe642a..e2cb57a011 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 @@ -162,31 +162,31 @@ int main(int argc, char* argv[]) if (check_flag((void*)C, "MRIStepCoupling_MIStoMRI", 0)) { return 1; } // Set routines - flag = ARKStepSetUserData(arkstep_mem, - (void*)&lamda); // Pass lamda to user functions - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } - flag = ARKStepSStolerances(arkstep_mem, reltol, abstol); // Specify tolerances - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } - flag = ARKStepSetFixedStep(arkstep_mem, Tf / Nt); // Specify fixed time step size - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetUserData(arkstep_mem, + (void*)&lamda); // Pass lamda to user functions + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkstep_mem, reltol, abstol); // Specify tolerances + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkstep_mem, Tf / Nt); // Specify fixed time step size + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } flag = ARKStepSetTables(arkstep_mem, 2, 0, B, NULL); // Specify Butcher table if (check_flag(&flag, "ARKStepSetTables", 1)) { return 1; } - flag = ARKStepSetMaxNumSteps(arkstep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } - - flag = MRIStepSetUserData(mristep_mem, - (void*)&lamda); // Pass lamda to user functions - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } - flag = MRIStepSStolerances(mristep_mem, reltol, abstol); // Specify tolerances - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } - flag = MRIStepSetFixedStep(mristep_mem, Tf / Nt); // Specify fixed time step sizes - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } - flag = ARKStepSetFixedStep(inner_mem, Tf / Nt / 10); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } - flag = MRIStepSetCoupling(mristep_mem, C); // Specify Butcher table + flag = ARKodeSetMaxNumSteps(arkstep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + flag = ARKodeSetUserData(mristep_mem, + (void*)&lamda); // Pass lamda to user functions + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(mristep_mem, reltol, abstol); // Specify tolerances + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetFixedStep(mristep_mem, Tf / Nt); // Specify fixed time step sizes + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(inner_mem, Tf / Nt / 10); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + flag = MRIStepSetCoupling(mristep_mem, C); // Specify coupling table if (check_flag(&flag, "MRIStepSetCoupling", 1)) { return 1; } - flag = MRIStepSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps - if (check_flag(&flag, "MRIStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(mristep_mem, 2 * Nt); // Increase num internal steps + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Initialize implicit solver data structures if (fixedpoint) @@ -194,13 +194,13 @@ int main(int argc, char* argv[]) // Initialize fixed-point solvers and attach to integrators NLSa = SUNNonlinSol_FixedPoint(y, 50, sunctx); if (check_flag((void*)NLSa, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - flag = ARKStepSetNonlinearSolver(arkstep_mem, NLSa); - if (check_flag(&flag, "ARKStepSetNonlinearSolver", 1)) { return 1; } + flag = ARKodeSetNonlinearSolver(arkstep_mem, NLSa); + if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } NLSm = SUNNonlinSol_FixedPoint(y, 50, sunctx); if (check_flag((void*)NLSm, "SUNNonlinSol_FixedPoint", 0)) { return 1; } - flag = MRIStepSetNonlinearSolver(mristep_mem, NLSm); - if (check_flag(&flag, "MRIStepSetNonlinearSolver", 1)) { return 1; } + flag = ARKodeSetNonlinearSolver(mristep_mem, NLSm); + if (check_flag(&flag, "ARKodeSetNonlinearSolver", 1)) { return 1; } } else { @@ -216,47 +216,47 @@ int main(int argc, char* argv[]) if (check_flag((void*)LSm, "SUNLinSol_Dense", 0)) { return 1; } // Linear solver interface - flag = ARKStepSetLinearSolver(arkstep_mem, LSa, Aa); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } - flag = ARKStepSetJacFn(arkstep_mem, Jac); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkstep_mem, LSa, Aa); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkstep_mem, Jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } - flag = MRIStepSetLinearSolver(mristep_mem, LSm, Am); - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } - flag = MRIStepSetJacFn(mristep_mem, Jac); - if (check_flag(&flag, "MRIStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetLinearSolver(mristep_mem, LSm, Am); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(mristep_mem, Jac); + if (check_flag(&flag, "ARKodeSetJacFn", 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; } + flag = ARKodeSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } - flag = MRIStepSetLinear(mristep_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(mristep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } - // First call ARKStep to evolve the full problem, and print results + // First call ARKodeEvolve to evolve the full problem, and print results t = T0; N_VConst(ONE, y); - flag = ARKStepEvolve(arkstep_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } - flag = ARKStepGetCurrentTime(arkstep_mem, &tcur); - if (check_flag(&flag, "ARKStepGetCurrentTime", 1)) { return 1; } - flag = ARKStepGetNumSteps(arkstep_mem, &ark_nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return 1; } + flag = ARKodeEvolve(arkstep_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKodeGetCurrentTime(arkstep_mem, &tcur); + if (check_flag(&flag, "ARKodeGetCurrentTime", 1)) { return 1; } + flag = ARKodeGetNumSteps(arkstep_mem, &ark_nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } flag = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvIters(arkstep_mem, &ark_nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = ARKStepGetNumNonlinSolvConvFails(arkstep_mem, &ark_ncfn); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvConvFails", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &ark_nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvConvFails(arkstep_mem, &ark_ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } if (!fixedpoint) { - flag = ARKStepGetNumLinSolvSetups(arkstep_mem, &ark_nsetups); - if (check_flag(&flag, "ARKStepGetNumLinSolvSetups", 1)) { return 1; } - flag = ARKStepGetNumJacEvals(arkstep_mem, &ark_nje); - if (check_flag(&flag, "ARKStepGetNumJacEvals", 1)) { return 1; } - flag = ARKStepGetNumLinRhsEvals(arkstep_mem, &ark_nfeLS); - check_flag(&flag, "ARKStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(arkstep_mem, &ark_nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } + flag = ARKodeGetNumJacEvals(arkstep_mem, &ark_nje); + if (check_flag(&flag, "ARKodeGetNumJacEvals", 1)) { return 1; } + flag = ARKodeGetNumLinRhsEvals(arkstep_mem, &ark_nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); } cout << "\nARKStep Solver Statistics:\n"; cout << " Return time = " << t << "\n"; @@ -275,29 +275,29 @@ int main(int argc, char* argv[]) cout << " Total number of Jacobian evaluations = " << ark_nje << "\n"; } - // Second call MRIStep to evolve the full problem, and print results + // Second call ARKodeEvolve to evolve the full problem, and print results t = T0; N_VConst(ZERO, y); - flag = MRIStepEvolve(mristep_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "MRIStepEvolve", 1)) { return 1; } - flag = MRIStepGetCurrentTime(arkstep_mem, &tcur); - if (check_flag(&flag, "MRIStepGetCurrentTime", 1)) { return 1; } - flag = MRIStepGetNumSteps(mristep_mem, &mri_nst); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return 1; } + flag = ARKodeEvolve(mristep_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + flag = ARKodeGetCurrentTime(arkstep_mem, &tcur); + if (check_flag(&flag, "ARKodeGetCurrentTime", 1)) { return 1; } + flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } - flag = MRIStepGetNumNonlinSolvIters(mristep_mem, &mri_nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return 1; } - flag = MRIStepGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } if (!fixedpoint) { - flag = MRIStepGetNumLinSolvSetups(mristep_mem, &mri_nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return 1; } - flag = MRIStepGetNumJacEvals(mristep_mem, &mri_nje); - if (check_flag(&flag, "MRIStepGetNumJacEvals", 1)) { return 1; } - flag = MRIStepGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); - check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinSolvSetups(mristep_mem, &mri_nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } + flag = ARKodeGetNumJacEvals(mristep_mem, &mri_nje); + if (check_flag(&flag, "ARKodeGetNumJacEvals", 1)) { return 1; } + flag = ARKodeGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); } cout << "\nMRIStep Solver Statistics:\n"; cout << " Return time = " << t << "\n"; @@ -369,9 +369,9 @@ int main(int argc, char* argv[]) ARKodeButcherTable_Free(B); // Free Butcher table ARKodeButcherTable_Free(Bc); // Free Butcher table MRIStepCoupling_Free(C); // Free MRI coupling table - ARKStepFree(&arkstep_mem); // Free integrator memory - MRIStepFree(&mristep_mem); - ARKStepFree(&inner_mem); + ARKodeFree(&arkstep_mem); // Free integrator memory + ARKodeFree(&mristep_mem); + ARKodeFree(&inner_mem); MRIStepInnerStepper_Free(&inner_stepper); if (fixedpoint) { 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 index d08ddf3a30..6a98c79797 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp @@ -468,16 +468,16 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, 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; } + flag = ARKodeSetUserData(arkstep_mem, &prob_data); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ARKStepSetFixedStep(arkstep_mem, prob_opts.h); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkstep_mem, prob_opts.h); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } // Attach Butcher tables (ignore actual method order) flag = ARKStepSetTables(arkstep_mem, 1, 0, Bi, Be); @@ -486,8 +486,8 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, // 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; } + flag = ARKodeSetInterpolantType(arkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } } // Create matrix and linear solver (if necessary) @@ -504,20 +504,20 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, 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; } + flag = ARKodeSetLinearSolver(arkstep_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } // Set Jacobian function - flag = ARKStepSetJacFn(arkstep_mem, Ji); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetJacFn(arkstep_mem, Ji); + if (check_flag(&flag, "ARKodeSetJacFn", 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; } + flag = ARKodeSetLinear(arkstep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } // Specify implicit predictor method - flag = ARKStepSetPredictorMethod(arkstep_mem, prob_opts.p_type); - if (check_flag(&flag, "ARKStepSetPredictorMethod", 1)) { return 1; } + flag = ARKodeSetPredictorMethod(arkstep_mem, prob_opts.p_type); + if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } } // Create mass matrix and linear solver (if necessary) @@ -536,11 +536,11 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, int time_dep = 0; if (prob_data.m_type == mass_matrix_type::time_dependent) { time_dep = 1; } - flag = ARKStepSetMassLinearSolver(arkstep_mem, MLS, M, time_dep); - if (check_flag(&flag, "ARKStepSetMassLinearSolver", 1)) { return 1; } + flag = ARKodeSetMassLinearSolver(arkstep_mem, MLS, M, time_dep); + if (check_flag(&flag, "ARKodeSetMassLinearSolver", 1)) { return 1; } - flag = ARKStepSetMassFn(arkstep_mem, MassMatrix); - if (check_flag(&flag, "ARKStepSetMassFn", 1)) { return 1; } + flag = ARKodeSetMassFn(arkstep_mem, MassMatrix); + if (check_flag(&flag, "ARKodeSetMassFn", 1)) { return 1; } } // -------------- @@ -557,8 +557,8 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, 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; } + flag = ARKodeEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -592,11 +592,11 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, std::cout << "Dense Output" << std::endl; sunrealtype h_last; - flag = ARKStepGetLastStep(arkstep_mem, &h_last); - if (check_flag(&flag, "ARKStepGetLastStep", 1)) { return 1; } + flag = ARKodeGetLastStep(arkstep_mem, &h_last); + if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } - flag = ARKStepGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKodeGetDky", 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 @@ -652,8 +652,8 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, 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; } + flag = ARKodeEvolve(arkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -675,7 +675,7 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, // Clean up // -------- - ARKStepFree(&arkstep_mem); + ARKodeFree(&arkstep_mem); SUNLinSolFree(LS); SUNMatDestroy(A); SUNLinSolFree(MLS); @@ -746,8 +746,8 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, // 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; } + flag = ARKodeGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } long int nni = 0; long int extra_fe_evals = 0; @@ -755,8 +755,8 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, if (prob_opts.r_type == rk_type::impl || prob_opts.r_type == rk_type::imex) { - flag = ARKStepGetNumNonlinSolvIters(arkstep_mem, &nni); - if (check_flag(&flag, "ARKStepGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } } // Expected number of explicit functions evaluations @@ -829,8 +829,8 @@ int check_rhs_evals(rk_type r_type, void* arkstep_mem, long int nfe_expected, int flag = 0; long int nst; - flag = ARKStepGetNumSteps(arkstep_mem, &nst); - if (check_flag(&flag, "ARKStepGetNumSteps", 1)) { return 1; } + flag = ARKodeGetNumSteps(arkstep_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } long int nfe, nfi; flag = ARKStepGetNumRhsEvals(arkstep_mem, &nfe, &nfi); 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 index 9338d33550..a97e27ecd8 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp @@ -234,22 +234,22 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, 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; } + flag = ARKodeSetUserData(erkstep_mem, &prob_data); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = ERKStepSStolerances(erkstep_mem, prob_opts.reltol, prob_opts.abstol); - if (check_flag(&flag, "ERKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(erkstep_mem, prob_opts.reltol, prob_opts.abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ERKStepSetFixedStep(erkstep_mem, prob_opts.h); - if (check_flag(&flag, "ERKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(erkstep_mem, prob_opts.h); + if (check_flag(&flag, "ARKodeSetFixedStep", 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; } + flag = ARKodeSetInterpolantType(erkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } } // Attach Butcher tables @@ -270,8 +270,8 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, 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; } + flag = ARKodeEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -302,11 +302,11 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, std::cout << "Dense Output" << std::endl; sunrealtype h_last; - flag = ERKStepGetLastStep(erkstep_mem, &h_last); - if (check_flag(&flag, "ERKStepGetLastStep", 1)) { return 1; } + flag = ARKodeGetLastStep(erkstep_mem, &h_last); + if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } - flag = ERKStepGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); - if (check_flag(&flag, "ERKStepGetDky", 1)) { return 1; } + flag = ARKodeGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKodeGetDky", 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 @@ -342,8 +342,8 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, 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; } + flag = ARKodeEvolve(erkstep_mem, t_out, y, &t_ret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time t_out += prob_opts.h; @@ -362,7 +362,7 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, // Clean up // -------- - ERKStepFree(&erkstep_mem); + ARKodeFree(&erkstep_mem); N_VDestroy(y); return numfails; @@ -409,8 +409,8 @@ int expected_rhs_evals(interp_type i_type, int stages, // 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; } + flag = ARKodeGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } // Expected number of explicit functions evaluations nfe_expected = 0; @@ -445,8 +445,8 @@ 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; } + flag = ARKodeGetNumSteps(erkstep_mem, &nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } long int nfe; flag = ERKStepGetNumRhsEvals(erkstep_mem, &nfe); 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 06546062e5..579e76ddef 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 @@ -173,16 +173,16 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (check_flag((void*)arkstep_mem, "ARKStepCreate", 0)) { return 1; } // Set user data - flag = ARKStepSetUserData(arkstep_mem, udata); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkstep_mem, udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKStepSStolerances(arkstep_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkstep_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ARKStepSetFixedStep(arkstep_mem, hf); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkstep_mem, hf); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } // Wrap ARKStep integrator as fast integrator object MRIStepInnerStepper inner_stepper = nullptr; @@ -212,30 +212,30 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (check_flag((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } // Set user data - flag = MRIStepSetUserData(mristep_mem, udata); - if (check_flag(&flag, "MRIStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(mristep_mem, udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = MRIStepSStolerances(mristep_mem, reltol, abstol); - if (check_flag(&flag, "MRIStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(mristep_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step sizes - flag = MRIStepSetFixedStep(mristep_mem, hs); - if (check_flag(&flag, "MRIStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(mristep_mem, hs); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { // Attach linear solver - flag = MRIStepSetLinearSolver(mristep_mem, LS, A); - if (check_flag(&flag, "MRIStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(mristep_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } // Set Jacobian function - flag = MRIStepSetJacFn(mristep_mem, Ji); - if (check_flag(&flag, "MRIStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetJacFn(mristep_mem, Ji); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } // Specify linearly implicit RHS, with non-time-dependent Jacobian - flag = MRIStepSetLinear(mristep_mem, 0); - if (check_flag(&flag, "MRIStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(mristep_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } // ------------------------------------ @@ -338,8 +338,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, for (int i = 0; i < nsteps; i++) { // Advance in time - flag = MRIStepEvolve(mristep_mem, tf, y, &t, ARK_ONE_STEP); - if (check_flag(&flag, "MRIStepEvolve", 1)) { return 1; } + flag = ARKodeEvolve(mristep_mem, tf, y, &t, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time tf += hs; @@ -353,31 +353,28 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, long int mri_nni, mri_ncfn; // nonlinear solver long int mri_nsetups, mri_nje, mri_nfeLS; // linear solver - flag = MRIStepGetNumSteps(mristep_mem, &mri_nst); - if (check_flag(&flag, "MRIStepGetNumSteps", 1)) { return 1; } + flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); + if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - flag = MRIStepGetNumNonlinSolvIters(mristep_mem, &mri_nni); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvIters", 1)) { return 1; } + flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } - flag = MRIStepGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); - if (check_flag(&flag, "MRIStepGetNumNonlinSolvConvFails", 1)) - { - return 1; - } + flag = ARKodeGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); + if (check_flag(&flag, "ARKodeGetNumNonlinSolvConvFails", 1)) { return 1; } - flag = MRIStepGetNumLinSolvSetups(mristep_mem, &mri_nsetups); - if (check_flag(&flag, "MRIStepGetNumLinSolvSetups", 1)) { return 1; } + flag = ARKodeGetNumLinSolvSetups(mristep_mem, &mri_nsetups); + if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } - flag = MRIStepGetNumJacEvals(mristep_mem, &mri_nje); - if (check_flag(&flag, "MRIStepGetNumJacEvals", 1)) { return 1; } + flag = ARKodeGetNumJacEvals(mristep_mem, &mri_nje); + if (check_flag(&flag, "ARKodeGetNumJacEvals", 1)) { return 1; } - flag = MRIStepGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); - check_flag(&flag, "MRIStepGetNumLinRhsEvals", 1); + flag = ARKodeGetNumLinRhsEvals(mristep_mem, &mri_nfeLS); + check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); } sunrealtype pow = udata->lambda_f; @@ -488,8 +485,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, // Clean up MRIStepInnerStepper_Free(&inner_stepper); - MRIStepFree(&mristep_mem); - ARKStepFree(&arkstep_mem); + ARKodeFree(&mristep_mem); + ARKodeFree(&arkstep_mem); if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { SUNLinSolFree(LS); diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp index 7dee98545f..7b3598451d 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp @@ -214,8 +214,8 @@ int main(int argc, char* argv[]) void* arkode_mem = ARKStepCreate(nullptr, f, ZERO, y, sunctx); if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } - flag = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_flag(flag, "ARKStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } SUNMatrix A = SUNDenseMatrix(2, 2, sunctx); if (check_ptr(A, "SUNDenseMatrix")) { return 1; } @@ -223,35 +223,35 @@ int main(int argc, char* argv[]) SUNLinearSolver LS = SUNLinSol_Dense(y, A, sunctx); if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "ARKStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; - flag = ARKStepSetUserData(arkode_mem, udata); - if (check_flag(flag, "ARKStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(arkode_mem, udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // Initial time and fist output time sunrealtype tret = ZERO; sunrealtype tout = tret + SUN_RCONST(0.1); // Advance one step in time - flag = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); - if (check_flag(flag, "ARKStep")) { return 1; } + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKode")) { return 1; } // Get the internal finite difference approximation to J SUNMatrix Jdq; - flag = ARKStepGetJac(arkode_mem, &Jdq); - if (check_flag(flag, "ARKStepGetJac")) { return 1; } + flag = ARKodeGetJac(arkode_mem, &Jdq); + if (check_flag(flag, "ARKodeGetJac")) { return 1; } // Get the step and time at which the approximation was computed long int nst_Jdq; - flag = ARKStepGetJacNumSteps(arkode_mem, &nst_Jdq); - if (check_flag(flag, "ARKStepGetJacNumSteps")) { return 1; } + flag = ARKodeGetJacNumSteps(arkode_mem, &nst_Jdq); + if (check_flag(flag, "ARKodeGetJacNumSteps")) { return 1; } sunrealtype t_Jdq; - flag = ARKStepGetJacTime(arkode_mem, &t_Jdq); - if (check_flag(flag, "ARKStepGetJacTime")) { return 1; } + flag = ARKodeGetJacTime(arkode_mem, &t_Jdq); + if (check_flag(flag, "ARKodeGetJacTime")) { return 1; } // Compute the true Jacobian SUNMatrix Jtrue = SUNDenseMatrix(2, 2, sunctx); @@ -302,7 +302,7 @@ int main(int argc, char* argv[]) SUNMatDestroy(A); SUNMatDestroy(Jtrue); SUNLinSolFree(LS); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); return result; } diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp index 4ad57a55e4..af9168d5fd 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp @@ -233,11 +233,11 @@ int main(int argc, char* argv[]) void* arkode_mem = MRIStepCreate(nullptr, f, ZERO, y, inner_stepper, sunctx); if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } - flag = MRIStepSStolerances(arkode_mem, rtol, atol); - if (check_flag(flag, "MRIStepSStolerances")) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } - flag = MRIStepSetFixedStep(arkode_mem, SUN_RCONST(1.0e-5)); - if (check_flag(flag, "MRIStepSetFixedStep")) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, SUN_RCONST(1.0e-5)); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } SUNMatrix A = SUNDenseMatrix(2, 2, sunctx); if (check_ptr(A, "SUNDenseMatrix")) { return 1; } @@ -245,35 +245,35 @@ int main(int argc, char* argv[]) SUNLinearSolver LS = SUNLinSol_Dense(y, A, sunctx); if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } - flag = MRIStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(flag, "MRIStepSetLinearSolver")) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } sunrealtype udata[4] = {-TWO, HALF, HALF, -ONE}; - flag = MRIStepSetUserData(arkode_mem, udata); - if (check_flag(flag, "MRIStepSetUserData")) { return 1; } + flag = ARKodeSetUserData(arkode_mem, udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } // Initial time and fist output time sunrealtype tret = ZERO; sunrealtype tout = tret + SUN_RCONST(0.1); // Advance one step in time - flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); - if (check_flag(flag, "MRIStep")) { return 1; } + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKode")) { return 1; } // Get the internal finite difference approximation to J SUNMatrix Jdq; - flag = MRIStepGetJac(arkode_mem, &Jdq); - if (check_flag(flag, "MRIStepGetJac")) { return 1; } + flag = ARKodeGetJac(arkode_mem, &Jdq); + if (check_flag(flag, "ARKodeGetJac")) { return 1; } // Get the step and time at which the approximation was computed long int nst_Jdq; - flag = MRIStepGetJacNumSteps(arkode_mem, &nst_Jdq); - if (check_flag(flag, "MRIStepGetJacNumSteps")) { return 1; } + flag = ARKodeGetJacNumSteps(arkode_mem, &nst_Jdq); + if (check_flag(flag, "ARKodeGetJacNumSteps")) { return 1; } sunrealtype t_Jdq; - flag = MRIStepGetJacTime(arkode_mem, &t_Jdq); - if (check_flag(flag, "MRIStepGetJacTime")) { return 1; } + flag = ARKodeGetJacTime(arkode_mem, &t_Jdq); + if (check_flag(flag, "ARKodeGetJacTime")) { return 1; } // Compute the true Jacobian SUNMatrix Jtrue = SUNDenseMatrix(2, 2, sunctx); @@ -325,8 +325,8 @@ int main(int argc, char* argv[]) SUNMatDestroy(Jtrue); SUNLinSolFree(LS); MRIStepInnerStepper_Free(&inner_stepper); - ARKStepFree(&inner_arkode_mem); - MRIStepFree(&arkode_mem); + ARKodeFree(&inner_arkode_mem); + ARKodeFree(&arkode_mem); return result; } diff --git a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c index 6ea963f176..7fdb34daf2 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c +++ b/test/unit_tests/arkode/C_serial/ark_test_arkstepsetforcing.c @@ -212,43 +212,43 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Specify tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Set forcing */ flag = arkStep_SetInnerForcing(arkode_mem, tshift, tscale, forcing, order + 1); if (check_flag(&flag, "arkStep_SetInnerForcing", 1)) { return 1; } /* Integrate the problem */ - flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKStep failure, flag = %d\n", flag); + fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); printf("Explicit stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /* print solution */ @@ -272,55 +272,55 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Specify tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Attach matrix and linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set Jacobian routine */ - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* Set forcing */ flag = arkStep_SetInnerForcing(arkode_mem, tshift, tscale, forcing, order + 1); if (check_flag(&flag, "arkStep_SetInnerForcing", 1)) { return 1; } /* Integrate the problem */ - flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKStep failure, flag = %d\n", flag); + fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); printf("Implicit stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /* print solution */ @@ -344,55 +344,55 @@ int main(int argc, char* argv[]) if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } /* Specify tolerances */ - flag = ARKStepSStolerances(arkode_mem, reltol, abstol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* Set stop time */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } /* Set max steps before output */ - flag = ARKStepSetMaxNumSteps(arkode_mem, mxsteps); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, mxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* Attach matrix and linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } /* Set Jacobian routine */ - flag = ARKStepSetJacFn(arkode_mem, Jac); - if (check_flag(&flag, "ARKStepSetJacFn", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } /* Specify linearly implicit RHS, with non-time-dependent Jacobian */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* Set forcing */ flag = arkStep_SetInnerForcing(arkode_mem, tshift, tscale, forcing, order + 1); if (check_flag(&flag, "arkStep_SetInnerForcing", 1)) { return 1; } /* Integrate the problem */ - flag = ARKStepEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); + flag = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_NORMAL); /* check for errors */ if (flag < 0) { - fprintf(stderr, "ARKStep failure, flag = %d\n", flag); + fprintf(stderr, "ARKodeEvolve failure, flag = %d\n", flag); return 1; } /* get some integrator stats */ - flag = ARKStepGetNumSteps(arkode_mem, &nst); - check_flag(&flag, "ARKStepGetNumSteps", 1); + flag = ARKodeGetNumSteps(arkode_mem, &nst); + check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKStepGetNumStepAttempts(arkode_mem, &nst_a); - check_flag(&flag, "ARKStepGetNumStepAttempts", 1); + flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); + check_flag(&flag, "ARKodeGetNumStepAttempts", 1); printf("IMEX stats:\n"); printf("Steps = %li (attempted = %li)\n\n", nst, nst_a); /* Free integrator memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /* print solution */ diff --git a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c index 1f57ea41fd..25c5de6982 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c +++ b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c @@ -73,18 +73,18 @@ int main(int argc, char* argv[]) } /* Set user data */ - retval = ARKStepSetUserData(arkode_mem, &udata_in); + retval = ARKodeSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ARKStepSetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = ARKStepGetUserData(arkode_mem, &udata_out); + retval = ARKodeGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ARKStepGetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); return 1; } @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* ------------ * * Test ERKStep * @@ -119,18 +119,18 @@ int main(int argc, char* argv[]) } /* Set user data */ - retval = ERKStepSetUserData(arkode_mem, &udata_in); + retval = ARKodeSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ERKStepSetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = ERKStepGetUserData(arkode_mem, &udata_out); + retval = ARKodeGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ERKStepGetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); return 1; } @@ -150,7 +150,7 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* ------------ * * Test MRIStep * @@ -176,23 +176,23 @@ int main(int argc, char* argv[]) arkode_mem = MRIStepCreate(f, NULL, ZERO, y, inner_stepper, sunctx); if (!arkode_mem) { - fprintf(stderr, "ARKStepCreate returned NULL\n"); + fprintf(stderr, "MRIStepCreate returned NULL\n"); return 1; } /* Set user data */ - retval = MRIStepSetUserData(arkode_mem, &udata_in); + retval = ARKodeSetUserData(arkode_mem, &udata_in); if (retval) { - fprintf(stderr, "ARKStepSetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeSetUserData returned %i\n", retval); return 1; } /* Get user data */ - retval = MRIStepGetUserData(arkode_mem, &udata_out); + retval = ARKodeGetUserData(arkode_mem, &udata_out); if (retval) { - fprintf(stderr, "ARKStepGetUserData returned %i\n", retval); + fprintf(stderr, "ARKodeGetUserData returned %i\n", retval); return 1; } @@ -212,8 +212,8 @@ int main(int argc, char* argv[]) udata_out = NULL; /* Free integrator memory */ - MRIStepFree(&arkode_mem); - ARKStepFree(&arkode_inner_mem); + ARKodeFree(&arkode_mem); + ARKodeFree(&arkode_inner_mem); MRIStepInnerStepper_Free(&inner_stepper); /* Clean up */ diff --git a/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c index 315f819089..f79566aa6f 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c +++ b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c @@ -96,10 +96,10 @@ int main(int argc, char* argv[]) 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)); + flag = ARKodeSetFixedStep(arkode_mem, SUN_RCONST(0.01)); if (flag) { return 1; } - flag = MRIStepSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); if (flag) { return 1; } /* --------------- @@ -107,8 +107,8 @@ int main(int argc, char* argv[]) * --------------- */ /* 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); + arkode_flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("ARKodeEvolve returned %i\n", arkode_flag); if (arkode_flag != ARK_RHSFUNC_FAIL) { return 1; } /* ----------------------- @@ -120,7 +120,7 @@ int main(int argc, char* argv[]) flag = MRIStepReInit(arkode_mem, ode_slow_rhs, NULL, ZERO, y); if (flag) { return 1; } - flag = MRIStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); if (flag) { return 1; } /* --------------- @@ -128,8 +128,8 @@ int main(int argc, char* argv[]) * --------------- */ /* Evolve should succeed when using Lagrange interpolation */ - arkode_flag = MRIStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); - printf("MRIStepEvolve returned %i\n", arkode_flag); + arkode_flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + printf("ARKodeEvolve returned %i\n", arkode_flag); if (arkode_flag != ARK_SUCCESS) { return 1; } /* -------- @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) * -------- */ MRIStepInnerStepper_Free(&fast_mem); - MRIStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); N_VDestroy(y); SUNContext_Free(&sunctx); diff --git a/test/unit_tests/arkode/C_serial/ark_test_interp.c b/test/unit_tests/arkode/C_serial/ark_test_interp.c index 88d0636954..00eff80a35 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_interp.c +++ b/test/unit_tests/arkode/C_serial/ark_test_interp.c @@ -206,46 +206,46 @@ int main(int argc, char* argv[]) if (check_flag(arkode_mem, "ARKStepCreate", 0)) { return 1; } /* pass lambda to RHS routine */ - flag = ARKStepSetUserData(arkode_mem, &lambda); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, &lambda); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } /* select Hermite interpolation module */ - flag = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); - if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } /* set dense output polynomial degree */ - flag = ARKStepSetInterpolantDegree(arkode_mem, ideg); - if (check_flag(&flag, "ARKStepSetInterpolantDegree", 1)) { return 1; } + flag = ARKodeSetInterpolantDegree(arkode_mem, ideg); + if (check_flag(&flag, "ARKodeSetInterpolantDegree", 1)) { return 1; } /* set fixed time-stepping with desired time step size */ - flag = ARKStepSetFixedStep(arkode_mem, hvals[ih]); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } /* set solver tolerances */ - flag = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* indicate linearity of problem */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* attach linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } /* increase maximum number of time steps */ - flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* set RK order to highest available value */ - flag = ARKStepSetOrder(arkode_mem, 5); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, 5); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } /* evolve to Tf to prepare interpolation structure */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } - flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } /* loop over 100 evenly-spaced values within interior of preceding step to accumulate errors */ @@ -254,19 +254,19 @@ int main(int argc, char* argv[]) /* set test time */ t_test = t - hvals[ih] + (itest + 1) * hvals[ih] / (nttest + 2); - /* call ARKStepGetDky to evaluate solution and derivatives at t_test */ - flag = ARKStepGetDky(arkode_mem, t_test, 0, ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 1, dytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 2, d2ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 3, d3ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 4, d4ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 5, d5ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } + /* call ARKodeGetDky to evaluate solution and derivatives at t_test */ + flag = ARKodeGetDky(arkode_mem, t_test, 0, ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 1, dytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 2, d2ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 3, d3ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 4, d4ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 5, d5ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } /* set error values */ /* y */ @@ -318,8 +318,8 @@ int main(int argc, char* argv[]) } /* end itest loop */ - /* free ARKStep memory (to prepare for next call) */ - ARKStepFree(&arkode_mem); + /* free ARKode memory (to prepare for next call) */ + ARKodeFree(&arkode_mem); arkode_mem = NULL; } /* end ih loop */ @@ -444,46 +444,46 @@ int main(int argc, char* argv[]) if (check_flag(arkode_mem, "ARKStepCreate", 0)) { return 1; } /* pass lambda to RHS routine */ - flag = ARKStepSetUserData(arkode_mem, &lambda); - if (check_flag(&flag, "ARKStepSetUserData", 1)) { return 1; } + flag = ARKodeSetUserData(arkode_mem, &lambda); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } /* select Lagrange interpolation module */ - flag = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); - if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } /* set dense output polynomial degree */ - flag = ARKStepSetInterpolantDegree(arkode_mem, ideg); - if (check_flag(&flag, "ARKStepSetInterpolantDegree", 1)) { return 1; } + flag = ARKodeSetInterpolantDegree(arkode_mem, ideg); + if (check_flag(&flag, "ARKodeSetInterpolantDegree", 1)) { return 1; } /* set fixed time-stepping with desired time step size */ - flag = ARKStepSetFixedStep(arkode_mem, hvals[ih]); - if (check_flag(&flag, "ARKStepSetFixedStep", 1)) { return 1; } + flag = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } /* set solver tolerances */ - flag = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } /* indicate linearity of problem */ - flag = ARKStepSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKStepSetLinear", 1)) { return 1; } + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } /* attach linear solver */ - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKStepSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } /* increase maximum number of time steps */ - flag = ARKStepSetMaxNumSteps(arkode_mem, 100000); - if (check_flag(&flag, "ARKStepSetMaxNumSteps", 1)) { return 1; } + flag = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } /* set RK order to highest available value */ - flag = ARKStepSetOrder(arkode_mem, 5); - if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + flag = ARKodeSetOrder(arkode_mem, 5); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } /* evolve to Tf to prepare interpolation structure */ - flag = ARKStepSetStopTime(arkode_mem, Tf); - if (check_flag(&flag, "ARKStepSetStopTime", 1)) { return 1; } - flag = ARKStepEvolve(arkode_mem, Tf, y, &t, ARK_NORMAL); - if (check_flag(&flag, "ARKStepEvolve", 1)) { return 1; } + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + flag = ARKodeEvolve(arkode_mem, Tf, y, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } /* loop over 100 evenly-spaced values within interior of this step to accumulate errors */ for (itest = 0; itest < nttest; itest++) @@ -491,13 +491,13 @@ int main(int argc, char* argv[]) /* set test time */ t_test = t - hvals[ih] + (itest + 1) * hvals[ih] / (nttest + 2); - /* call ARKStepGetDky to evaluate solution and derivatives at t_test */ - flag = ARKStepGetDky(arkode_mem, t_test, 0, ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 1, dytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } - flag = ARKStepGetDky(arkode_mem, t_test, 2, d2ytest); - if (check_flag(&flag, "ARKStepGetDky", 1)) { return 1; } + /* call ARKodeGetDky to evaluate solution and derivatives at t_test */ + flag = ARKodeGetDky(arkode_mem, t_test, 0, ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 1, dytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + flag = ARKodeGetDky(arkode_mem, t_test, 2, d2ytest); + if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } /* set error values */ /* y */ @@ -525,8 +525,8 @@ int main(int argc, char* argv[]) } /* end itest loop */ - /* free ARKStep memory (to prepare for next call) */ - ARKStepFree(&arkode_mem); + /* free ARKode memory (to prepare for next call) */ + ARKodeFree(&arkode_mem); arkode_mem = NULL; } /* end ih loop */ diff --git a/test/unit_tests/arkode/C_serial/ark_test_mass.c b/test/unit_tests/arkode/C_serial/ark_test_mass.c index 586028cd1c..c011d11209 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_mass.c +++ b/test/unit_tests/arkode/C_serial/ark_test_mass.c @@ -131,57 +131,57 @@ int solve(const char* im, const char* ex, int steps, sunbooleantype time_dep, retval = ARKStepSetTableName(arkode_mem, im, ex); if (check_retval(&retval, "ARKStepSetTableNum", 1)) return 1; - retval = ARKStepSetUserData(arkode_mem, &time_dep); - if (check_retval(&retval, "ARKStepSetUserData", 1)) return 1; + retval = ARKodeSetUserData(arkode_mem, &time_dep); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; /* Specify a time step so no extra mass evaluations occur from initial step * size procedure */ - retval = ARKStepSetInitStep(arkode_mem, 0.01); - if (check_retval(&retval, "ARKStepSetInitStep", 1)) return 1; + retval = ARKodeSetInitStep(arkode_mem, 0.01); + if (check_retval(&retval, "ARKodeSetInitStep", 1)) return 1; /* Use Lagrange interpolation because Hermite may need addition mass matrix * solves to compute the interpolant */ - retval = ARKStepSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); - if (check_retval(&retval, "ARKStepSetInterpolantType", 1)) return 1; + retval = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); + if (check_retval(&retval, "ARKodeSetInterpolantType", 1)) return 1; /* Configure the solvers */ jacobian_ls = SUNLinSol_Dense(y, jacobian_mat, sunctx); if (check_retval(jacobian_ls, "SUNLinSol_Dense", 0)) return 1; - retval = ARKStepSetLinearSolver(arkode_mem, jacobian_ls, jacobian_mat); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, jacobian_ls, jacobian_mat); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return 1; mass_ls = SUNLinSol_Dense(y, mass_mat, sunctx); if (check_retval(mass_ls, "SUNLinSol_Dense", 0)) return 1; - retval = ARKStepSetMassLinearSolver(arkode_mem, mass_ls, mass_mat, time_dep); - if (check_retval(&retval, "ARKStepSetMassLinearSolver", 0)) return 1; + retval = ARKodeSetMassLinearSolver(arkode_mem, mass_ls, mass_mat, time_dep); + if (check_retval(&retval, "ARKodeSetMassLinearSolver", 0)) return 1; nls = SUNNonlinSol_Newton(y, sunctx); if (check_retval(nls, "SUNNonlinSol_Newton", 0)) return 1; - retval = ARKStepSetDeduceImplicitRhs(arkode_mem, deduce_implicit_rhs); - if (check_retval(&retval, "ARKStepSetDeduceImplicitRhs", 1)) return 1; + retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce_implicit_rhs); + if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) return 1; /* Let ARKODE estimate the Jacobian with finite differences */ - retval = ARKStepSetJacFn(arkode_mem, NULL); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) return 1; + retval = ARKodeSetJacFn(arkode_mem, NULL); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; - retval = ARKStepSetMassFn(arkode_mem, mass); - if (check_retval(&retval, "ARKStepSetMassFn", 1)) return 1; + retval = ARKodeSetMassFn(arkode_mem, mass); + if (check_retval(&retval, "ARKodeSetMassFn", 1)) return 1; /* Take time step(s) */ for (s = 0; s < steps; s++) { - retval = ARKStepEvolve(arkode_mem, t, y, &t, ARK_ONE_STEP); - if (check_retval(&retval, "ARKStepEvolve", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t, y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; } - retval = ARKStepGetNumMassSolves(arkode_mem, &actual_mass_solves); - if (check_retval(&retval, "ARKStepGetNumMassSolves", 1)) return 1; + retval = ARKodeGetNumMassSolves(arkode_mem, &actual_mass_solves); + if (check_retval(&retval, "ARKodeGetNumMassSolves", 1)) return 1; /* Free integrator memory */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); /* Clean up */ N_VDestroy(y); diff --git a/test/unit_tests/arkode/C_serial/ark_test_reset.c b/test/unit_tests/arkode/C_serial/ark_test_reset.c index 529c2879cd..445850399f 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -11,8 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End *--------------------------------------------------------------- - * Routine to test that ARKStepReset, ERKStepReset and - * MRIStepReset function correctly. + * Routine to test that ARKodeReset functions correctly. * * This runs the same test problem as in * examples/arkode/C_serial/ark_analytic.c: @@ -107,196 +106,199 @@ int main(void) if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /******* Part I: ERKStep *******/ + printf("Testing ERKStep:\n"); /* Set initial condition, and construct stepper */ t = T0; N_VConst(ytrue(t), y); arkode_mem = ERKStepCreate(f, t, y, ctx); if (check_retval((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } - retval = ERKStepSetUserData(arkode_mem, (void*)&lambda); - if (check_retval(&retval, "ERKStepSetUserData", 1)) { return 1; } - retval = ERKStepSStolerances(arkode_mem, rtol, atol); - if (check_retval(&retval, "ERKStepSStolerances", 1)) { return 1; } - retval = ERKStepSetMaxNumSteps(arkode_mem, 1000); - check_retval(&retval, "ERKStepSetMaxNumSteps", 1); + retval = ARKodeSetUserData(arkode_mem, (void*)&lambda); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000); + check_retval(&retval, "ARKodeSetMaxNumSteps", 1); /* Initially evolve to dTout, and check result */ - retval = ERKStepSetStopTime(arkode_mem, t + dTout); - check_retval(&retval, "ERKStepSetStopTime", 1); - retval = ERKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { return 1; } + retval = ARKodeSetStopTime(arkode_mem, t + dTout); + check_retval(&retval, "ARKodeSetStopTime", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial ERKStepEvolve had insufficient accuracy\n"); + printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Initial ERKStepEvolve call successful\n"); } + else { printf(" Initial ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = ERKStepReset(arkode_mem, t, y); - check_retval(&retval, "ERKStepReset", 1); - retval = ERKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second ERKStepEvolve call had insufficient accuracy\n"); + printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Second ERKStepEvolve call successful\n"); } + else { printf(" Second ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at 3*dTout, evolve to 4*dTout and check result */ t = T0 + SUN_RCONST(3.0) * dTout; N_VConst(ytrue(t), y); - retval = ERKStepReset(arkode_mem, t, y); - check_retval(&retval, "ERKStepReset", 1); - retval = ERKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third ERKStepEvolve call had insufficient accuracy\n"); + printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Third ERKStepEvolve call successful\n"); } + else { printf(" Third ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = ERKStepReset(arkode_mem, t, y); - check_retval(&retval, "ERKStepReset", 1); - retval = ERKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ERKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth ERKStepEvolve call had insufficient accuracy\n"); + printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Fourth ERKStepEvolve call successful\n"); } + else { printf(" Fourth ARKodeEvolve call successful\n"); } /* Free ERKStep memory structure */ - ERKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /******* Part II: ARKStep *******/ + printf("Testing ARKStep:\n"); /* Set initial condition, and construct stepper */ t = T0; N_VConst(ytrue(t), y); arkode_mem = ARKStepCreate(NULL, f, t, y, ctx); if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } - retval = ARKStepSetUserData(arkode_mem, (void*)&lambda); - if (check_retval(&retval, "ARKStepSetUserData", 1)) { return 1; } - retval = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } - retval = ARKStepSetLinearSolver(arkode_mem, LS, A); - if (check_retval(&retval, "ARKStepSetLinearSolver", 1)) { return 1; } - retval = ARKStepSetJacFn(arkode_mem, Jac); - if (check_retval(&retval, "ARKStepSetJacFn", 1)) { return 1; } - retval = ARKStepSetLinear(arkode_mem, 0); - if (check_retval(&retval, "ARKStepSetLinear", 1)) { return 1; } - retval = ARKStepSetMaxNumSteps(arkode_mem, 100); - check_retval(&retval, "ARKStepSetMaxNumSteps", 1); + retval = ARKodeSetUserData(arkode_mem, (void*)&lambda); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSetLinear(arkode_mem, 0); + if (check_retval(&retval, "ARKodeSetLinear", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 100); + check_retval(&retval, "ARKodeSetMaxNumSteps", 1); /* Initially evolve to dTout, and check result */ - retval = ARKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { return 1; } + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial ARKStepEvolve had insufficient accuracy\n"); + printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Initial ARKStepEvolve call successful\n"); } + else { printf(" Initial ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = ARKStepReset(arkode_mem, t, y); - check_retval(&retval, "ARKStepReset", 1); - retval = ARKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second ARKStepEvolve call had insufficient accuracy\n"); + printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Second ARKStepEvolve call successful\n"); } + else { printf(" Second ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at 3*dTout, evolve to 4*dTout and check result */ t = T0 + SUN_RCONST(3.0) * dTout; N_VConst(ytrue(t), y); - retval = ARKStepReset(arkode_mem, t, y); - check_retval(&retval, "ARKStepReset", 1); - retval = ARKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third ARKStepEvolve call had insufficient accuracy\n"); + printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Third ARKStepEvolve call successful\n"); } + else { printf(" Third ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = ARKStepReset(arkode_mem, t, y); - check_retval(&retval, "ARKStepReset", 1); - retval = ARKStepEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "ARKStepEvolve", 1)) { return 1; } + retval = ARKodeReset(arkode_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth ARKStepEvolve call had insufficient accuracy\n"); + printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Fourth ARKStepEvolve call successful\n"); } + else { printf(" Fourth ARKodeEvolve call successful\n"); } /* Free ARKStep memory structure */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /******* Part III: MRIStep *******/ + printf("Testing MRIStep:\n"); /* Set initial condition, and construct stepper */ t = T0; N_VConst(ytrue(t), y); arkode_mem = ARKStepCreate(f0, NULL, t, y, ctx); if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } - retval = ARKStepSStolerances(arkode_mem, rtol, atol); - if (check_retval(&retval, "ARKStepSStolerances", 1)) { return 1; } - retval = ARKStepSetMaxNumSteps(arkode_mem, 100); - check_retval(&retval, "ARKStepSetMaxNumSteps", 1); + retval = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(arkode_mem, 100); + check_retval(&retval, "ARKodeSetMaxNumSteps", 1); retval = ARKStepCreateMRIStepInnerStepper(arkode_mem, &inner_stepper); if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) { @@ -304,91 +306,91 @@ int main(void) } mristep_mem = MRIStepCreate(NULL, f, t, y, inner_stepper, ctx); if (check_retval((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } - retval = MRIStepSetUserData(mristep_mem, (void*)&lambda); - if (check_retval(&retval, "MRIStepSetUserData", 1)) { return 1; } - retval = MRIStepSetLinearSolver(mristep_mem, LS, A); - if (check_retval(&retval, "MRIStepSetLinearSolver", 1)) { return 1; } - retval = MRIStepSetJacFn(mristep_mem, Jac); - if (check_retval(&retval, "MRIStepSetJacFn", 1)) { return 1; } - retval = MRIStepSetLinear(mristep_mem, 0); - if (check_retval(&retval, "MRIStepSetLinear", 1)) { return 1; } - retval = MRIStepSetMaxNumSteps(mristep_mem, 100); - check_retval(&retval, "MRIStepSetMaxNumSteps", 1); - retval = MRIStepSetFixedStep(mristep_mem, dTout * SUN_RCONST(0.105)); - check_retval(&retval, "MRIStepSetFixedStep", 1); + retval = ARKodeSetUserData(mristep_mem, (void*)&lambda); + if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } + retval = ARKodeSetLinearSolver(mristep_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(mristep_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + retval = ARKodeSetLinear(mristep_mem, 0); + if (check_retval(&retval, "ARKodeSetLinear", 1)) { return 1; } + retval = ARKodeSetMaxNumSteps(mristep_mem, 100); + check_retval(&retval, "ARKodeSetMaxNumSteps", 1); + retval = ARKodeSetFixedStep(mristep_mem, dTout * SUN_RCONST(0.105)); + check_retval(&retval, "ARKodeSetFixedStep", 1); /* Initially evolve to dTout, and check result */ - retval = MRIStepEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { return 1; } + retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Initial MRIStepEvolve had insufficient accuracy\n"); + printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Initial MRIStepEvolve call successful\n"); } + else { printf(" Initial ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = MRIStepReset(mristep_mem, t, y); - check_retval(&retval, "MRIStepReset", 1); - retval = MRIStepEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { return 1; } + retval = ARKodeReset(mristep_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Second MRIStepEvolve call had insufficient accuracy\n"); + printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Second MRIStepEvolve call successful\n"); } + else { printf(" Second ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at 3*dTout, evolve to 4*dTout and check result */ t = T0 + SUN_RCONST(3.0) * dTout; N_VConst(ytrue(t), y); - retval = MRIStepReset(mristep_mem, t, y); - check_retval(&retval, "MRIStepReset", 1); - retval = MRIStepEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { return 1; } + retval = ARKodeReset(mristep_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Third MRIStepEvolve call had insufficient accuracy\n"); + printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Third MRIStepEvolve call successful\n"); } + else { printf(" Third ARKodeEvolve call successful\n"); } /* Reset state to analytical solution at dTout, evolve to 2*dTout and check result */ t = T0 + dTout; N_VConst(ytrue(t), y); - retval = MRIStepReset(mristep_mem, t, y); - check_retval(&retval, "MRIStepReset", 1); - retval = MRIStepEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); - if (check_retval(&retval, "MRIStepEvolve", 1)) { return 1; } + retval = ARKodeReset(mristep_mem, t, y); + check_retval(&retval, "ARKodeReset", 1); + retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) { - printf(" Fourth MRIStepEvolve call had insufficient accuracy\n"); + printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); printf(" y = %" GSYM "\n", NV_Ith_S(y, 0)); printf(" ytrue = %" GSYM "\n", ytrue(t)); printf(" |y-ytrue| = %" GSYM "\n", SUNRabs(ytrue(t) - NV_Ith_S(y, 0))); return 1; } - else { printf(" Fourth MRIStepEvolve call successful\n"); } + else { printf(" Fourth ARKodeEvolve call successful\n"); } /* Free MRIStep and ARKStep memory structures */ - MRIStepFree(&mristep_mem); + ARKodeFree(&mristep_mem); MRIStepInnerStepper_Free(&inner_stepper); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); arkode_mem = NULL; /* Clean up and return with success */ diff --git a/test/unit_tests/arkode/C_serial/ark_test_tstop.c b/test/unit_tests/arkode/C_serial/ark_test_tstop.c index 7e952e8a42..7498e251bb 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_tstop.c +++ b/test/unit_tests/arkode/C_serial/ark_test_tstop.c @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) arkode_mem = ARKStepCreate(NULL, ode_rhs, ZERO, y, sunctx); if (!arkode_mem) { return 1; } - flag = ARKStepSStolerances(arkode_mem, SUN_RCONST(1.0e-4), SUN_RCONST(1.0e-8)); + flag = ARKodeSStolerances(arkode_mem, SUN_RCONST(1.0e-4), SUN_RCONST(1.0e-8)); if (flag) { return 1; } A = SUNDenseMatrix(1, 1, sunctx); @@ -101,16 +101,16 @@ int main(int argc, char* argv[]) LS = SUNLinSol_Dense(y, A, sunctx); if (!LS) { return 1; } - flag = ARKStepSetLinearSolver(arkode_mem, LS, A); + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); if (flag) { return 1; } - flag = ARKStepSetJacFn(arkode_mem, ode_jac); + flag = ARKodeSetJacFn(arkode_mem, ode_jac); if (flag) { return 1; } - flag = ARKStepSetOrder(arkode_mem, 2); + flag = ARKodeSetOrder(arkode_mem, 2); if (flag) { return 1; } - flag = ARKStepSetStopTime(arkode_mem, tstop); + flag = ARKodeSetStopTime(arkode_mem, tstop); if (flag) { return 1; } /* --------------- @@ -123,14 +123,14 @@ int main(int argc, char* argv[]) for (i = 1; i <= 6; i++) { - arkode_flag = ARKStepEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + arkode_flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); if (arkode_flag < 0) { flag = 1; break; } - flag = ARKStepGetCurrentTime(arkode_mem, &tcur); + flag = ARKodeGetCurrentTime(arkode_mem, &tcur); if (flag) { break; } printf("%i: tout = %" GSYM ", tstop = %" GSYM ", tret = %" GSYM @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) /* Update stop time */ tstop += dt_tstop; - flag = ARKStepSetStopTime(arkode_mem, tstop); + flag = ARKodeSetStopTime(arkode_mem, tstop); if (flag) { break; } } @@ -173,7 +173,7 @@ int main(int argc, char* argv[]) /* Update stop time */ tstop += dt_tstop; - flag = ARKStepSetStopTime(arkode_mem, tstop); + flag = ARKodeSetStopTime(arkode_mem, tstop); if (flag) { break; } } @@ -217,7 +217,7 @@ int main(int argc, char* argv[]) * Clean up * -------- */ - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); N_VDestroy(y); SUNMatDestroy(A); SUNLinSolFree(LS); diff --git a/test/unit_tests/arkode/gtest/test_arkode_error_handling.cpp b/test/unit_tests/arkode/gtest/test_arkode_error_handling.cpp index 44bfcc9c5c..96099d427f 100644 --- a/test/unit_tests/arkode/gtest/test_arkode_error_handling.cpp +++ b/test/unit_tests/arkode/gtest/test_arkode_error_handling.cpp @@ -45,7 +45,7 @@ class ARKodeErrConditionTest : public testing::Test ~ARKodeErrConditionTest() { N_VDestroy(v); - ARKStepFree(&arkode_mem); + ARKodeFree(&arkode_mem); } void* arkode_mem; @@ -70,7 +70,7 @@ TEST_F(ARKodeErrConditionTest, ErrorIsPrinted) { SUNLogger_SetErrorFilename(logger, errfile.c_str()); // negative reltol is illegal - ARKStepSStolerances(arkode_mem, /* reltol= */ -1e-4, /* abstol= */ 1e-4); + ARKodeSStolerances(arkode_mem, /* reltol= */ -1e-4, /* abstol= */ 1e-4); std::string output = dumpstderr(sunctx, errfile); EXPECT_THAT(output, testing::AllOf(testing::StartsWith("[ERROR]"), testing::HasSubstr("[rank 0]"), From 4ab42fa857b93fd3098e8a9d9f9df4f83efa56a1 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Tue, 7 May 2024 19:16:43 -0400 Subject: [PATCH 035/137] Docs: Add missing SUNContext argument to *NewEmpty docs (#471) --- doc/shared/nvectors/NVector_Description.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_API.rst | 2 +- doc/shared/sunmatrix/SUNMatrix_Description.rst | 2 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/shared/nvectors/NVector_Description.rst b/doc/shared/nvectors/NVector_Description.rst index 8c197fd7b6..f9ca95f18c 100644 --- a/doc/shared/nvectors/NVector_Description.rst +++ b/doc/shared/nvectors/NVector_Description.rst @@ -329,7 +329,7 @@ routines these functions will ease the introduction of any new optional vector operations to the NVECTOR API by ensuring that only required operations need to be set, and that all operations are copied when cloning a vector. -.. c:function:: N_Vector N_VNewEmpty() +.. c:function:: N_Vector N_VNewEmpty(SUNContext sunctx) This allocates a new generic ``N_Vector`` object and initializes its content pointer and the function pointers in the operations structure to ``NULL``. diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 3f6436d249..ad1be8c5ae 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -765,7 +765,7 @@ constructors this function will ease the introduction of any new optional linear solver operations to the ``SUNLinearSolver`` API by ensuring that only required operations need to be set. -.. c:function:: SUNLinearSolver SUNLinSolNewEmpty() +.. c:function:: SUNLinearSolver SUNLinSolNewEmpty(SUNContext sunctx) This function allocates a new generic ``SUNLinearSolver`` object and initializes its content pointer and the function pointers in the operations diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index b74555c31d..e60b31e097 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -118,7 +118,7 @@ routines these functions will ease the introduction of any new optional matrix operations to the SUNMATRIX API by ensuring only required operations need to be set and all operations are copied when cloning a matrix. -.. c:function:: SUNMatrix SUNMatNewEmpty() +.. c:function:: SUNMatrix SUNMatNewEmpty(SUNContext sunctx) This function allocates a new generic ``SUNMatrix`` object and initializes its content pointer and the function pointers in the operations structure to ``NULL``. diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index 6a21325a19..aef87888b2 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -588,7 +588,7 @@ introduction of any new optional nonlinear solver operations to the ``SUNNonlinearSolver`` API by ensuring that only required operations need to be set. -.. c:function:: SUNNonlinearSolver SUNNonlinSolNewEmpty() +.. c:function:: SUNNonlinearSolver SUNNonlinSolNewEmpty(SUNContext sunctx) This function allocates a new generic ``SUNNonlinearSolver`` object and initializes its content pointer and the function pointers in the operations From 78257f4bb7b15c6294de0f86df410b1b6d847025 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Sat, 11 May 2024 13:34:49 -0500 Subject: [PATCH 036/137] Maintenance: ARKODE cleanup (#470) Cleaned up ARKODE source code files so that function declarations/implementations are in more logical locations (following the restructuring of ARKODE's user-interface). --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 +- doc/shared/RecentChanges.rst | 5 +- include/arkode/arkode.h | 122 +- include/arkode/arkode_arkstep.h | 106 +- include/arkode/arkode_erkstep.h | 69 +- include/arkode/arkode_mristep.h | 125 +- include/arkode/arkode_sprkstep.h | 52 +- src/arkode/arkode.c | 1789 +++++----- src/arkode/arkode_adapt_impl.h | 38 +- src/arkode/arkode_arkstep.c | 263 +- src/arkode/arkode_arkstep_impl.h | 18 +- src/arkode/arkode_arkstep_io.c | 3839 +++++++++++----------- src/arkode/arkode_arkstep_nls.c | 112 +- src/arkode/arkode_butcher.c | 1161 ++++--- src/arkode/arkode_erkstep.c | 102 +- src/arkode/arkode_erkstep_io.c | 1202 ++++--- src/arkode/arkode_impl.h | 1324 +++++--- src/arkode/arkode_interp_impl.h | 2 - src/arkode/arkode_io.c | 1514 ++++----- src/arkode/arkode_ls.c | 108 +- src/arkode/arkode_ls_impl.h | 19 +- src/arkode/arkode_mristep.c | 223 +- src/arkode/arkode_mristep_impl.h | 18 +- src/arkode/arkode_mristep_io.c | 1172 ++++--- src/arkode/arkode_mristep_nls.c | 10 +- src/arkode/arkode_relaxation.c | 85 +- src/arkode/arkode_root.c | 8 + src/arkode/arkode_root_impl.h | 4 +- src/arkode/arkode_sprkstep.c | 116 +- src/arkode/arkode_sprkstep_impl.h | 3 + src/arkode/arkode_sprkstep_io.c | 440 ++- src/arkode/arkode_user_controller.c | 2 +- src/arkode/fmod/farkode_arkstep_mod.c | 356 +- src/arkode/fmod/farkode_arkstep_mod.f90 | 736 ++--- src/arkode/fmod/farkode_erkstep_mod.c | 216 +- src/arkode/fmod/farkode_erkstep_mod.f90 | 456 +-- src/arkode/fmod/farkode_mod.c | 622 ++-- src/arkode/fmod/farkode_mod.f90 | 1260 +++---- src/arkode/fmod/farkode_mristep_mod.c | 492 +-- src/arkode/fmod/farkode_mristep_mod.f90 | 918 +++--- src/arkode/fmod/farkode_sprkstep_mod.c | 134 +- src/arkode/fmod/farkode_sprkstep_mod.f90 | 296 +- 42 files changed, 9917 insertions(+), 9623 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab881dfd0..45619e61e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ simplified code maintenance. Marked the corresponding stepper-specific user-callable routines as deprecated; these will be removed in a future major release. -Added "Resize" capability to ARKODE's SPRKStep time-stepping module. +Added "Resize" capability, as well as missing `SetRootDirection` and +`SetNoInactiveRootWarn` functions, to ARKODE's SPRKStep time-stepping module. Deprecated `ARKStepSetOptimalParams` function; added instructions to user guide for users who wish to retain the current functionality. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 57674c7f94..9212d1ff37 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -6,7 +6,8 @@ simplified code maintenance. Marked the corresponding stepper-specific user-callable routines as deprecated; these will be removed in a future major release. -Added "Resize" capability to ARKODE's SPRKStep time-stepping module. +Added "Resize" capability, as well as missing ``SetRootDirection`` and +``SetNoInactiveRootWarn`` functions, to ARKODE's SPRKStep time-stepping module. Deprecated ``ARKStepSetOptimalParams`` function; added instructions to user guide for users who wish to retain the current functionality. @@ -40,4 +41,4 @@ Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHu Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 <https://github.com/LLNL/sundials/issues/466>`_. -Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 <https://github.com/LLNL/sundials/issues/464>`_. \ No newline at end of file +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 <https://github.com/LLNL/sundials/issues/464>`_. diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 14027693af..a656411f3f 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -11,17 +11,17 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * This is the header file for the main ARKode infrastructure. + * This is the header file for the main ARKODE infrastructure. * ----------------------------------------------------------------- - * ARKode is used to numerically solve the ordinary initial value - * problems using one-step methods. Users do not call ARKode + * ARKODE is used to numerically solve the ordinary initial value + * problems using one-step methods. Users do not call ARKODE * infrastructure routines directly; they instead interact with - * one of the time stepping modules built on top of ARKode. + * one of the time stepping modules built on top of ARKODE. * These time step modules define their supported problem types, * solver options, etc. * * This file serves to define constants and provide function - * prototypes for use across ARKode-based time integration + * prototypes for use across ARKODE-based time integration * modules. * -----------------------------------------------------------------*/ @@ -37,7 +37,7 @@ extern "C" { #endif /* ----------------- - * ARKode Constants + * ARKODE Constants * ----------------- */ /* usage modes (itask) */ @@ -173,9 +173,9 @@ typedef int (*ARKRelaxFn)(N_Vector y, sunrealtype* r, void* user_data); typedef int (*ARKRelaxJacFn)(N_Vector y, N_Vector J, void* user_data); -/* -------------------------- - * MRIStep Inner Stepper Type - * -------------------------- */ +/* ------------------------------------------------ + * MRIStep Inner Stepper Type (forward declaration) + * ------------------------------------------------ */ typedef _SUNDIALS_STRUCT_ _MRIStepInnerStepper* MRIStepInnerStepper; @@ -216,11 +216,24 @@ SUNDIALS_EXPORT int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); SUNDIALS_EXPORT int ARKodeSetRootDirection(void* arkode_mem, int* rootdir); SUNDIALS_EXPORT int ARKodeSetNoInactiveRootWarn(void* arkode_mem); -/* Optional input functions */ +/* Optional input functions (general) */ SUNDIALS_EXPORT int ARKodeSetDefaults(void* arkode_mem); SUNDIALS_EXPORT int ARKodeSetOrder(void* arkode_mem, int maxord); SUNDIALS_EXPORT int ARKodeSetInterpolantType(void* arkode_mem, int itype); SUNDIALS_EXPORT int ARKodeSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_EXPORT int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_EXPORT int ARKodeSetInterpolateStopTime(void* arkode_mem, + sunbooleantype interp); +SUNDIALS_EXPORT int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); +SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, + ARKPostProcessFn ProcessStep); +SUNDIALS_EXPORT int ARKodeSetPostprocessStageFn(void* arkode_mem, + ARKPostProcessFn ProcessStage); + +/* Optional input functions (implicit solver) */ SUNDIALS_EXPORT int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); SUNDIALS_EXPORT int ARKodeSetLinear(void* arkode_mem, int timedepend); @@ -228,6 +241,19 @@ SUNDIALS_EXPORT int ARKodeSetNonlinear(void* arkode_mem); SUNDIALS_EXPORT int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); SUNDIALS_EXPORT int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); +SUNDIALS_EXPORT int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_EXPORT int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_EXPORT int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_EXPORT int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_EXPORT int ARKodeSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_EXPORT int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_EXPORT int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf); +SUNDIALS_EXPORT int ARKodeSetNonlinConvCoef(void* arkode_mem, + sunrealtype nlscoef); +SUNDIALS_EXPORT int ARKodeSetStagePredictFn(void* arkode_mem, + ARKStagePredictFn PredictStage); + +/* Optional input functions (temporal adaptivity) */ SUNDIALS_EXPORT int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C); SUNDIALS_EXPORT int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust); @@ -242,40 +268,16 @@ SUNDIALS_EXPORT int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1 SUNDIALS_EXPORT int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); SUNDIALS_EXPORT int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef); SUNDIALS_EXPORT int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); -SUNDIALS_EXPORT int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); -SUNDIALS_EXPORT int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); -SUNDIALS_EXPORT int ARKodeSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); -SUNDIALS_EXPORT int ARKodeSetLSetupFrequency(void* arkode_mem, int msbp); -SUNDIALS_EXPORT int ARKodeSetPredictorMethod(void* arkode_mem, int method); SUNDIALS_EXPORT int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); SUNDIALS_EXPORT int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_EXPORT int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor); -SUNDIALS_EXPORT int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf); -SUNDIALS_EXPORT int ARKodeSetNonlinConvCoef(void* arkode_mem, - sunrealtype nlscoef); SUNDIALS_EXPORT int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_EXPORT int ARKodeSetMaxNumSteps(void* arkode_mem, long int mxsteps); SUNDIALS_EXPORT int ARKodeSetMaxHnilWarns(void* arkode_mem, int mxhnil); SUNDIALS_EXPORT int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin); SUNDIALS_EXPORT int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin); SUNDIALS_EXPORT int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax); -SUNDIALS_EXPORT int ARKodeSetInterpolateStopTime(void* arkode_mem, - sunbooleantype interp); -SUNDIALS_EXPORT int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); -SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_EXPORT int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails); -SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); - -SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, - ARKPostProcessFn ProcessStep); -SUNDIALS_EXPORT int ARKodeSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); -SUNDIALS_EXPORT int ARKodeSetStagePredictFn(void* arkode_mem, - ARKStagePredictFn PredictStage); - /* Integrate the ODE over an interval in t */ SUNDIALS_EXPORT int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); @@ -288,52 +290,48 @@ SUNDIALS_EXPORT int ARKodeGetDky(void* arkode_mem, sunrealtype t, int k, SUNDIALS_EXPORT int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); -/* Optional output functions */ -SUNDIALS_EXPORT int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_EXPORT int ARKodeGetNumAccSteps(void* arkode_mem, long int* accsteps); +/* Optional output functions (general) */ SUNDIALS_EXPORT int ARKodeGetNumStepAttempts(void* arkode_mem, long int* step_attempts); -SUNDIALS_EXPORT int ARKodeGetNumLinSolvSetups(void* arkode_mem, - long int* nlinsetups); -SUNDIALS_EXPORT int ARKodeGetNumErrTestFails(void* arkode_mem, - long int* netfails); -SUNDIALS_EXPORT int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele); SUNDIALS_EXPORT int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); SUNDIALS_EXPORT int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_EXPORT int ARKodeGetActualInitStep(void* arkode_mem, - sunrealtype* hinused); SUNDIALS_EXPORT int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast); SUNDIALS_EXPORT int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_EXPORT int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_EXPORT int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_EXPORT int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); -SUNDIALS_EXPORT int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); -SUNDIALS_EXPORT int ARKodeGetTolScaleFactor(void* arkode_mem, - sunrealtype* tolsfac); SUNDIALS_EXPORT int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_EXPORT int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight); SUNDIALS_EXPORT int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals); SUNDIALS_EXPORT int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_EXPORT int ARKodeGetNumConstrFails(void* arkode_mem, - long int* nconstrfails); SUNDIALS_EXPORT int ARKodeGetUserData(void* arkode_mem, void** user_data); SUNDIALS_EXPORT int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); SUNDIALS_EXPORT char* ARKodeGetReturnFlagName(long int flag); - SUNDIALS_EXPORT int ARKodeWriteParameters(void* arkode_mem, FILE* fp); -/* Grouped optional output functions */ +/* Optional output functions (temporal adaptivity) */ +SUNDIALS_EXPORT int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_EXPORT int ARKodeGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_EXPORT int ARKodeGetNumErrTestFails(void* arkode_mem, + long int* netfails); +SUNDIALS_EXPORT int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_EXPORT int ARKodeGetActualInitStep(void* arkode_mem, + sunrealtype* hinused); +SUNDIALS_EXPORT int ARKodeGetTolScaleFactor(void* arkode_mem, + sunrealtype* tolsfac); +SUNDIALS_EXPORT int ARKodeGetNumConstrFails(void* arkode_mem, + long int* nconstrfails); SUNDIALS_EXPORT int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -/* Nonlinear solver optional output functions */ +/* Optional output functions (implicit solver) */ +SUNDIALS_EXPORT int ARKodeGetNumLinSolvSetups(void* arkode_mem, + long int* nlinsetups); +SUNDIALS_EXPORT int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_EXPORT int ARKodeGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_EXPORT int ARKodeGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); SUNDIALS_EXPORT int ARKodeGetNonlinearSystemData( void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, N_Vector* Fi, sunrealtype* gamma, N_Vector* sdata, void** user_data); - SUNDIALS_EXPORT int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); SUNDIALS_EXPORT int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, @@ -342,8 +340,6 @@ SUNDIALS_EXPORT int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters long int* nnfails); SUNDIALS_EXPORT int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails); - -/* Linear solver optional output functions */ SUNDIALS_EXPORT int ARKodeGetJac(void* arkode_mem, SUNMatrix* J); SUNDIALS_EXPORT int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J); SUNDIALS_EXPORT int ARKodeGetJacNumSteps(void* arkode_mem, long int* nst_J); @@ -361,7 +357,11 @@ SUNDIALS_EXPORT int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals SUNDIALS_EXPORT int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); SUNDIALS_EXPORT int ARKodeGetLastLinFlag(void* arkode_mem, long int* flag); +SUNDIALS_EXPORT char* ARKodeGetLinReturnFlagName(long int flag); +/* Optional output functions (non-identity mass matrices) */ +SUNDIALS_EXPORT int ARKodeGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); +SUNDIALS_EXPORT int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight); SUNDIALS_EXPORT int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, long int* leniwMLS); SUNDIALS_EXPORT int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups); @@ -379,12 +379,10 @@ SUNDIALS_EXPORT int ARKodeGetNumMassConvFails(void* arkode_mem, SUNDIALS_EXPORT int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetups); SUNDIALS_EXPORT int ARKodeGetLastMassFlag(void* arkode_mem, long int* flag); -SUNDIALS_EXPORT char* ARKodeGetLinReturnFlagName(long int flag); - /* Free function */ SUNDIALS_EXPORT void ARKodeFree(void** arkode_mem); -/* Output the ARKode memory structure (useful when debugging) */ +/* Output the ARKODE memory structure (useful when debugging) */ SUNDIALS_EXPORT void ARKodePrintMem(void* arkode_mem, FILE* outfile); /* Relaxation functions */ diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 10477c033b..8c43ee198b 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * This is the header file for the ARKode ARKStep module. + * This is the header file for the ARKODE ARKStep module. * -----------------------------------------------------------------*/ #ifndef _ARKSTEP_H @@ -64,48 +64,68 @@ static const int ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5; * Exported Functions * ------------------- */ -/* Create, Resize, and Reinitialization functions */ +/* Creation and Reinitialization functions */ SUNDIALS_EXPORT void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, SUNContext sunctx); +SUNDIALS_EXPORT int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, + sunrealtype t0, N_Vector y0); + +/* Optional input functions -- must be called AFTER ARKStepCreate */ +SUNDIALS_EXPORT int ARKStepSetExplicit(void* arkode_mem); +SUNDIALS_EXPORT int ARKStepSetImplicit(void* arkode_mem); +SUNDIALS_EXPORT int ARKStepSetImEx(void* arkode_mem); +SUNDIALS_EXPORT int ARKStepSetTables(void* arkode_mem, int q, int p, + ARKodeButcherTable Bi, + ARKodeButcherTable Be); +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); + +/* Optional output functions */ +SUNDIALS_EXPORT int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, + long int* nfi_evals); +SUNDIALS_EXPORT int ARKStepGetCurrentButcherTables(void* arkode_mem, + ARKodeButcherTable* Bi, + ARKodeButcherTable* Be); +SUNDIALS_EXPORT int ARKStepGetTimestepperStats( + void* arkode_mem, long int* expsteps, long int* accsteps, + long int* step_attempts, long int* nfe_evals, long int* nfi_evals, + long int* nlinsetups, long int* netfails); + +/* MRIStep interface functions */ +SUNDIALS_EXPORT int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, + MRIStepInnerStepper* stepper); + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") int ARKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); - -SUNDIALS_EXPORT int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, - sunrealtype t0, N_Vector y0); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); - -/* Tolerance input functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); - -/* Residual tolerance input functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResStolerance instead") int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResVtolerance instead") int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResFtolerance instead") int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun); - -/* Linear solver set functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLinearSolver instead") int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep); - -/* Rootfinding initialization */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); - -/* Optional input functions -- must be called AFTER ARKStepCreate */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") int ARKStepSetDefaults(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("adjust parameters individually instead") @@ -126,19 +146,8 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") int ARKStepSetLinear(void* arkode_mem, int timedepend); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") int ARKStepSetNonlinear(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetExplicit(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetImplicit(void* arkode_mem); -SUNDIALS_EXPORT int ARKStepSetImEx(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); -SUNDIALS_EXPORT int ARKStepSetTables(void* arkode_mem, int q, int p, - ARKodeButcherTable Bi, - ARKodeButcherTable Be); -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_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") @@ -210,24 +219,18 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") int ARKStepSetRootDirection(void* arkode_mem, int* rootdir); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") int ARKStepSetNoInactiveRootWarn(void* arkode_mem); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") int ARKStepSetUserData(void* arkode_mem, void* user_data); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); - -/* Linear solver interface optional input functions -- must be called - AFTER ARKStepSetLinearSolver and/or ARKStepSetMassLinearSolver */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassFn instead") @@ -260,36 +263,23 @@ int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, ARKLsMassTimesVecFn mtimes, void* mtimes_data); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); - -/* Integrate the ODE over an interval in t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); - -/* Computes the kth derivative of the y function at time t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); - -/* Utility function to update/compute y based on zcor */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); - -/* Optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") int ARKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); -SUNDIALS_EXPORT int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, - long int* nfi_evals); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); -SUNDIALS_EXPORT int ARKStepGetCurrentButcherTables(void* arkode_mem, - ARKodeButcherTable* Bi, - ARKodeButcherTable* Be); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") @@ -328,30 +318,19 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") char* ARKStepGetReturnFlagName(long int flag); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") int ARKStepWriteParameters(void* arkode_mem, FILE* fp); - SUNDIALS_DEPRECATED_EXPORT_MSG( "use ARKStepGetCurrentButcherTables and ARKodeButcherTable_Write instead") int ARKStepWriteButcher(void* arkode_mem, FILE* fp); - -/* Grouped optional output functions */ -SUNDIALS_EXPORT int ARKStepGetTimestepperStats( - void* arkode_mem, long int* expsteps, long int* accsteps, - long int* step_attempts, long int* nfe_evals, long int* nfi_evals, - long int* nlinsetups, long int* netfails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); - -/* Nonlinear solver optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, N_Vector* Fi, sunrealtype* gamma, N_Vector* sdata, void** user_data); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") @@ -361,8 +340,6 @@ int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nnfails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); - -/* Linear solver optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") int ARKStepGetJac(void* arkode_mem, SUNMatrix* J); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") @@ -414,23 +391,12 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMTSetups instead") int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastMassFlag instead") int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") char* ARKStepGetLinReturnFlagName(long int flag); - -/* Free function */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void ARKStepFree(void** arkode_mem); - -/* Output the ARKStep memory structure (useful when debugging) */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") void ARKStepPrintMem(void* arkode_mem, FILE* outfile); - -/* MRIStep interface functions */ -SUNDIALS_EXPORT int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, - MRIStepInnerStepper* stepper); - -/* Relaxation functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index 847a2b4447..73f2a474c6 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * This is the header file for the ARKode ERKStep module. + * This is the header file for the ARKODE ERKStep module. * -----------------------------------------------------------------*/ #ifndef _ERKSTEP_H @@ -45,33 +45,45 @@ static const int ERKSTEP_DEFAULT_9 = ARKODE_VERNER_16_8_9; * Exported Functions * ------------------- */ -/* Create, Resize, and Reinitialization functions */ +/* Creation and Reinitialization functions */ SUNDIALS_EXPORT void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx); +SUNDIALS_EXPORT int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, + N_Vector y0); + +/* Optional input functions -- must be called AFTER ERKStepCreate */ +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); + +/* Optional output functions */ +SUNDIALS_EXPORT int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); +SUNDIALS_EXPORT int ERKStepGetCurrentButcherTable(void* arkode_mem, + ARKodeButcherTable* B); + +/* Grouped optional output functions */ +SUNDIALS_EXPORT int ERKStepGetTimestepperStats( + void* arkode_mem, long int* expsteps, long int* accsteps, + long int* step_attempts, long int* nfevals, long int* netfails); + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") int ERKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); - -SUNDIALS_EXPORT int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, - N_Vector y0); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); - -/* Tolerance input functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); - -/* Rootfinding initialization */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); - -/* Optional input functions -- must be called AFTER ERKStepCreate */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") int ERKStepSetDefaults(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") @@ -82,10 +94,6 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") int ERKStepSetInterpolantDegree(void* arkode_mem, int degree); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") int ERKStepSetDenseOrder(void* arkode_mem, int dord); -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_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") @@ -139,30 +147,21 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetFiARKode instead") int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") int ERKStepSetRootDirection(void* arkode_mem, int* rootdir); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") int ERKStepSetNoInactiveRootWarn(void* arkode_mem); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") int ERKStepSetUserData(void* arkode_mem, void* user_data); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetPostprocARKodeFn instead") int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); - -/* Integrate the ODE over an interval in t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); - -/* Computes the kth derivative of the y function at time t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); - -/* Optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") @@ -171,9 +170,6 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetARKodeAttempts instead") int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); -SUNDIALS_EXPORT int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); -SUNDIALS_EXPORT int ERKStepGetCurrentButcherTable(void* arkode_mem, - ARKodeButcherTable* B); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") @@ -204,29 +200,18 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") char* ERKStepGetReturnFlagName(long int flag); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") int ERKStepWriteParameters(void* arkode_mem, FILE* fp); - -SUNDIALS_EXPORT int ERKStepWriteButcher(void* arkode_mem, FILE* fp); - -/* Grouped optional output functions */ -SUNDIALS_EXPORT int ERKStepGetTimestepperStats( - void* arkode_mem, long int* expsteps, long int* accsteps, - long int* step_attempts, long int* nfevals, long int* netfails); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use ERKStepGetCurrentButcherTable and ARKodeButcherTable_Write instead") +int ERKStepWriteButcher(void* arkode_mem, FILE* fp); SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepARKodeStats instead") int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); - -/* Free function */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void ERKStepFree(void** arkode_mem); - -/* Output the ERKStep memory structure (useful when debugging) */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") void ERKStepPrintMem(void* arkode_mem, FILE* outfile); - -/* Relaxation functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index b4cb0c8101..1191e0a39d 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -12,7 +12,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * This is the header file for the ARKode MRIStep module. + * This is the header file for the ARKODE MRIStep module. * -----------------------------------------------------------------*/ #ifndef _MRISTEP_H @@ -130,38 +130,66 @@ typedef int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data); * Exported Functions * ------------------- */ -/* Create, Resize, and Reinitialization functions */ +/* Creation and Reinitialization functions */ SUNDIALS_EXPORT void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx); +SUNDIALS_EXPORT int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, + sunrealtype t0, N_Vector y0); + +/* Optional input functions -- must be called AFTER MRIStepCreate */ +SUNDIALS_EXPORT int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC); +SUNDIALS_EXPORT int MRIStepSetPreInnerFn(void* arkode_mem, + MRIStepPreInnerFn prefn); +SUNDIALS_EXPORT int MRIStepSetPostInnerFn(void* arkode_mem, + MRIStepPostInnerFn postfn); + +/* Optional output functions */ +SUNDIALS_EXPORT int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, + long int* nfsi_evals); +SUNDIALS_EXPORT int MRIStepGetCurrentCoupling(void* arkode_mem, + MRIStepCoupling* MRIC); +SUNDIALS_EXPORT int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); + +/* Custom inner stepper functions */ +SUNDIALS_EXPORT int MRIStepInnerStepper_Create(SUNContext sunctx, + MRIStepInnerStepper* stepper); +SUNDIALS_EXPORT int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetContent(MRIStepInnerStepper stepper, + void* content); +SUNDIALS_EXPORT int MRIStepInnerStepper_GetContent(MRIStepInnerStepper stepper, + void** content); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetEvolveFn(MRIStepInnerStepper stepper, + MRIStepInnerEvolveFn fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetFullRhsFn(MRIStepInnerStepper stepper, + MRIStepInnerFullRhsFn fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, + MRIStepInnerResetFn fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, + sunrealtype t, N_Vector f); +SUNDIALS_EXPORT int MRIStepInnerStepper_GetForcingData( + MRIStepInnerStepper stepper, sunrealtype* tshift, sunrealtype* tscale, + N_Vector** forcing, int* nforcing); + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") int MRIStepResize(void* arkode_mem, N_Vector ynew, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); - -SUNDIALS_EXPORT int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, - sunrealtype t0, N_Vector y0); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); - -/* Tolerance input functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun); - -/* Linear solver set function */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); - -/* Rootfinding initialization */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); - -/* Optional input functions -- must be called AFTER MRIStepCreate */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") int MRIStepSetDefaults(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") @@ -180,7 +208,6 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") int MRIStepSetLinear(void* arkode_mem, int timedepend); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") int MRIStepSetNonlinear(void* arkode_mem); -SUNDIALS_EXPORT int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC); SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetMaxARKodes instead") int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") @@ -199,10 +226,10 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") -int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") int MRIStepClearStopTime(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetFiARKode instead") @@ -217,17 +244,10 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetPostprocARKodeFn instead") int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); -SUNDIALS_EXPORT int MRIStepSetPreInnerFn(void* arkode_mem, - MRIStepPreInnerFn prefn); -SUNDIALS_EXPORT int MRIStepSetPostInnerFn(void* arkode_mem, - MRIStepPostInnerFn postfn); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); - -/* Linear solver interface optional input functions -- must be called - AFTER MRIStepSetLinearSolver */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") @@ -248,27 +268,15 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); - -/* Integrate the ODE over an interval in t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); - -/* Computes the kth derivative of the y function at time t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); - -/* Utility function to update/compute y based on zcor */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); - -/* Optional output functions */ -SUNDIALS_EXPORT int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, - long int* nfsi_evals); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); -SUNDIALS_EXPORT int MRIStepGetCurrentCoupling(void* arkode_mem, - MRIStepCoupling* MRIC); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodes instead") @@ -289,21 +297,17 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetLastInARKodeFlag instead") -int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") int MRIStepGetUserData(void* arkode_mem, void** user_data); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") char* MRIStepGetReturnFlagName(long int flag); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") int MRIStepWriteParameters(void* arkode_mem, FILE* fp); - -SUNDIALS_EXPORT int MRIStepWriteCoupling(void* arkode_mem, FILE* fp); - -/* Nonlinear solver optional output functions */ +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use MRIStepGetCurrentCoupling and MRIStepCoupling_Write instead") +int MRIStepWriteCoupling(void* arkode_mem, FILE* fp); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, N_Vector* F, @@ -318,8 +322,6 @@ int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nnfails); SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodeSolveFails instead") int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); - -/* Linear solver optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") @@ -347,46 +349,13 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") char* MRIStepGetLinReturnFlagName(long int flag); - -/* Free function */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void MRIStepFree(void** arkode_mem); - -/* Output the MRIStep memory structure (useful when debugging) */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") void MRIStepPrintMem(void* arkode_mem, FILE* outfile); -/* Custom inner stepper functions */ -SUNDIALS_EXPORT int MRIStepInnerStepper_Create(SUNContext sunctx, - MRIStepInnerStepper* stepper); - -SUNDIALS_EXPORT int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper); - -SUNDIALS_EXPORT int MRIStepInnerStepper_SetContent(MRIStepInnerStepper stepper, - void* content); - -SUNDIALS_EXPORT int MRIStepInnerStepper_GetContent(MRIStepInnerStepper stepper, - void** content); - -SUNDIALS_EXPORT int MRIStepInnerStepper_SetEvolveFn(MRIStepInnerStepper stepper, - MRIStepInnerEvolveFn fn); - -SUNDIALS_EXPORT int MRIStepInnerStepper_SetFullRhsFn(MRIStepInnerStepper stepper, - MRIStepInnerFullRhsFn fn); - -SUNDIALS_EXPORT int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, - MRIStepInnerResetFn fn); - -SUNDIALS_EXPORT int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, - sunrealtype t, N_Vector f); - -SUNDIALS_EXPORT int MRIStepInnerStepper_GetForcingData( - MRIStepInnerStepper stepper, sunrealtype* tshift, sunrealtype* tscale, - N_Vector** forcing, int* nforcing); - #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index f3e8f333b2..3e4519cd40 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * This is the header file for the ARKode SPRKStep module. + * This is the header file for the ARKODE SPRKStep module. * -----------------------------------------------------------------*/ #ifndef _ARKODE_SPRKSTEP_H @@ -41,30 +41,39 @@ static const int SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36; * Exported Functions * ------------------- */ -/* Create, Resize, and Reinitialization functions */ +/* Creation and Reinitialization functions */ SUNDIALS_EXPORT void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, SUNContext sunctx); - SUNDIALS_EXPORT int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); - -/* Rootfinding functions */ - -/* Rootfinding initialization */ -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); - /* Optional input functions -- must be called AFTER SPRKStepCreate */ -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") -int SPRKStepSetDefaults(void* arkode_mem); SUNDIALS_EXPORT int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage); SUNDIALS_EXPORT int SPRKStepSetMethodName(void* arkode_mem, const char* method); + +/* Optional output functions */ +SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, + ARKodeSPRKTable* sprk_storage); +SUNDIALS_EXPORT int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, + long int* nf2); + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int SPRKStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int SPRKStepSetDefaults(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") int SPRKStepSetOrder(void* arkode_mem, int maxord); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") @@ -79,27 +88,18 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") int SPRKStepSetUserData(void* arkode_mem, void* user_data); - SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); - -/* Integrate the ODE over an interval in t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); - -/* Computes the kth derivative of the y function at time t */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); - -/* Optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") char* SPRKStepGetReturnFlagName(long int flag); -SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, - ARKodeSPRKTable* sprk_storage); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") @@ -108,8 +108,6 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_EXPORT int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, - long int* nf2); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") @@ -122,14 +120,10 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); - -/* Grouped optional output functions */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); - -/* Free function */ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void SPRKStepFree(void** arkode_mem); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 17ea0a0531..098d0756c6 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -17,9 +17,6 @@ * use. *--------------------------------------------------------------*/ -/*=============================================================== - Import Header Files - ===============================================================*/ #include "arkode/arkode.h" #include <stdarg.h> @@ -39,192 +36,9 @@ #include "sundials_utils.h" /*=============================================================== - EXPORTED FUNCTIONS + Exported functions ===============================================================*/ -/*--------------------------------------------------------------- - arkCreate: - - arkCreate creates an internal memory block for a problem to - be solved by a time step module built on ARKODE. If successful, - arkCreate returns a pointer to the problem memory. If an - initialization error occurs, arkCreate prints an error message - to standard err and returns NULL. - ---------------------------------------------------------------*/ -ARKodeMem arkCreate(SUNContext sunctx) -{ - int iret; - long int lenrw, leniw; - ARKodeMem ark_mem; - - if (!sunctx) - { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_SUNCTX); - return (NULL); - } - - ark_mem = NULL; - ark_mem = (ARKodeMem)malloc(sizeof(struct ARKodeMemRec)); - if (ark_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_ARKMEM_FAIL); - return (NULL); - } - - /* Zero out ark_mem */ - memset(ark_mem, 0, sizeof(struct ARKodeMemRec)); - - /* Set the context */ - ark_mem->sunctx = sunctx; - - /* Set uround */ - ark_mem->uround = SUN_UNIT_ROUNDOFF; - - /* Initialize time step module to NULL */ - ark_mem->step_attachlinsol = NULL; - ark_mem->step_attachmasssol = NULL; - ark_mem->step_disablelsetup = NULL; - ark_mem->step_disablemsetup = NULL; - ark_mem->step_getlinmem = NULL; - ark_mem->step_getmassmem = NULL; - ark_mem->step_getimplicitrhs = NULL; - ark_mem->step_mmult = NULL; - ark_mem->step_getgammas = NULL; - ark_mem->step_init = NULL; - ark_mem->step_fullrhs = NULL; - ark_mem->step = NULL; - ark_mem->step_setuserdata = NULL; - ark_mem->step_printallstats = NULL; - ark_mem->step_writeparameters = NULL; - ark_mem->step_resize = NULL; - ark_mem->step_reset = NULL; - ark_mem->step_free = NULL; - ark_mem->step_printmem = NULL; - ark_mem->step_setdefaults = NULL; - ark_mem->step_computestate = NULL; - ark_mem->step_setrelaxfn = NULL; - ark_mem->step_setorder = NULL; - ark_mem->step_setnonlinearsolver = NULL; - ark_mem->step_setlinear = NULL; - ark_mem->step_setnonlinear = NULL; - ark_mem->step_setnlsrhsfn = NULL; - ark_mem->step_setdeduceimplicitrhs = NULL; - ark_mem->step_setnonlincrdown = NULL; - ark_mem->step_setnonlinrdiv = NULL; - ark_mem->step_setdeltagammamax = NULL; - ark_mem->step_setlsetupfrequency = NULL; - ark_mem->step_setpredictormethod = NULL; - ark_mem->step_setmaxnonliniters = NULL; - ark_mem->step_setnonlinconvcoef = NULL; - ark_mem->step_setstagepredictfn = NULL; - ark_mem->step_getnumlinsolvsetups = NULL; - ark_mem->step_getestlocalerrors = NULL; - ark_mem->step_getcurrentgamma = NULL; - ark_mem->step_getnonlinearsystemdata = NULL; - ark_mem->step_getnumnonlinsolviters = NULL; - ark_mem->step_getnumnonlinsolvconvfails = NULL; - ark_mem->step_getnonlinsolvstats = NULL; - ark_mem->step_mem = NULL; - ark_mem->step_supports_adaptive = SUNFALSE; - ark_mem->step_supports_implicit = SUNFALSE; - ark_mem->step_supports_massmatrix = SUNFALSE; - ark_mem->step_supports_relaxation = SUNFALSE; - - /* Initialize root finding variables */ - ark_mem->root_mem = NULL; - - /* Initialize inequality constraints variables */ - ark_mem->constraintsSet = SUNFALSE; - ark_mem->constraints = NULL; - - /* Initialize relaxation variables */ - ark_mem->relax_enabled = SUNFALSE; - ark_mem->relax_mem = NULL; - - /* Initialize lrw and liw */ - ark_mem->lrw = 18; - ark_mem->liw = 53; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ - - /* No mallocs have been done yet */ - ark_mem->VabstolMallocDone = SUNFALSE; - ark_mem->VRabstolMallocDone = SUNFALSE; - ark_mem->MallocDone = SUNFALSE; - - /* No user-supplied step postprocessing function yet */ - ark_mem->ProcessStep = NULL; - ark_mem->ps_data = NULL; - - /* No user-supplied stage postprocessing function yet */ - ark_mem->ProcessStage = NULL; - - /* No user_data pointer yet */ - ark_mem->user_data = NULL; - - /* Allocate step adaptivity structure and note storage */ - ark_mem->hadapt_mem = arkAdaptInit(); - if (ark_mem->hadapt_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Allocation of step adaptivity structure failed"); - ARKodeFree((void**)&ark_mem); - return (NULL); - } - 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, __LINE__, __func__, __FILE__, - "Allocation of step controller object failed"); - ARKodeFree((void**)&ark_mem); - 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; - - /* Initially, rwt should point to ewt */ - ark_mem->rwt_is_ewt = SUNTRUE; - - /* 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 */ - ark_mem->initsetup = SUNTRUE; - ark_mem->init_type = FIRST_INIT; - ark_mem->firststage = SUNTRUE; - ark_mem->initialized = SUNFALSE; - - /* Initial step size has not been determined yet */ - ark_mem->h = ZERO; - ark_mem->h0u = ZERO; - - /* Set default values for integrator optional inputs */ - iret = ARKodeSetDefaults(ark_mem); - if (iret != ARK_SUCCESS) - { - arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, - "Error setting default solver options"); - ARKodeFree((void**)&ark_mem); - return (NULL); - } - - /* Return pointer to ARKODE memory block */ - return (ark_mem); -} - /*--------------------------------------------------------------- ARKodeResize: @@ -1401,246 +1215,27 @@ void ARKodeFree(void** arkode_mem) *arkode_mem = NULL; } -/*=============================================================== - Internal functions that may be replaced by the user - ===============================================================*/ - /*--------------------------------------------------------------- - arkRwtSet - - This routine is responsible for setting the residual weight - vector rwt, according to tol_type, as follows: - - (1) rwt[i] = 1 / (reltol * SUNRabs(M*ycur[i]) + rabstol), i=0,...,neq-1 - if tol_type = ARK_SS - (2) rwt[i] = 1 / (reltol * SUNRabs(M*ycur[i]) + rabstol[i]), i=0,...,neq-1 - if tol_type = ARK_SV - (3) unset if tol_type is any other value (occurs rwt=ewt) - - arkRwtSet returns 0 if rwt is successfully set as above to a - positive vector and -1 otherwise. In the latter case, rwt is - considered undefined. + ARKodePrintMem: - All the real work is done in the routines arkRwtSetSS, arkRwtSetSV. + This routine outputs the ark_mem structure to a specified file + pointer. ---------------------------------------------------------------*/ -int arkRwtSet(N_Vector y, N_Vector weight, void* data) +void ARKodePrintMem(void* arkode_mem, FILE* outfile) { ARKodeMem ark_mem; - N_Vector My; - int flag = 0; - - /* data points to ark_mem here */ - ark_mem = (ARKodeMem)data; - - /* return if rwt is just ewt */ - if (ark_mem->rwt_is_ewt) { return (0); } - - /* put M*y into ark_tempv1 */ - My = ark_mem->tempv1; - if (ark_mem->step_mmult != NULL) - { - flag = ark_mem->step_mmult((void*)ark_mem, y, My); - if (flag != ARK_SUCCESS) { return (ARK_MASSMULT_FAIL); } - } - else - { /* this condition should not apply, but just in case */ - N_VScale(ONE, y, My); - } - /* call appropriate routine to fill rwt */ - switch (ark_mem->ritol) + /* Check if ark_mem exists */ + if (arkode_mem == NULL) { - case ARK_SS: flag = arkRwtSetSS(ark_mem, My, weight); break; - case ARK_SV: flag = arkRwtSetSV(ark_mem, My, weight); break; + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return; } + ark_mem = (ARKodeMem)arkode_mem; - return (flag); -} - -/*=============================================================== - Private Helper Functions - ===============================================================*/ - -/*--------------------------------------------------------------- - arkInit: - - arkInit allocates and initializes memory for a problem. All - inputs are checked for errors. If any error occurs during - initialization, an error flag is returned. Otherwise, it returns - ARK_SUCCESS. This routine should be called by an ARKODE - timestepper module (not by the user). This routine must be - called prior to calling ARKodeEvolve to evolve the problem. The - initialization type indicates if the values of internal counters - should be reinitialized (FIRST_INIT) or retained (RESET_INIT). - ---------------------------------------------------------------*/ -int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) -{ - sunbooleantype stepperOK, nvectorOK, allocOK; - int retval; - sunindextype lrw1, liw1; - - /* Check ark_mem */ - if (ark_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* Check for legal input parameters */ - if (y0 == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_Y0); - return (ARK_ILL_INPUT); - } - - /* Check if reset was called before the first Evolve call */ - if (init_type == RESET_INIT && !(ark_mem->initialized)) - { - init_type = FIRST_INIT; - } - - /* Check if allocations have been done i.e., is this first init call */ - if (ark_mem->MallocDone == SUNFALSE) - { - /* Test if all required time stepper operations are implemented */ - stepperOK = arkCheckTimestepper(ark_mem); - if (!stepperOK) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Time stepper module is missing required functionality"); - return (ARK_ILL_INPUT); - } - - /* Test if all required vector operations are implemented */ - nvectorOK = arkCheckNvector(y0); - if (!nvectorOK) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_NVECTOR); - return (ARK_ILL_INPUT); - } - - /* Set space requirements for one N_Vector */ - if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } - else - { - lrw1 = 0; - liw1 = 0; - } - ark_mem->lrw1 = lrw1; - ark_mem->liw1 = liw1; - - /* Allocate the solver vectors (using y0 as a template) */ - allocOK = arkAllocVectors(ark_mem, y0); - if (!allocOK) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_MEM_FAIL); - return (ARK_MEM_FAIL); - } - - /* Create default Hermite interpolation module */ - 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, __LINE__, __func__, __FILE__, - "Unable to allocate interpolation module"); - return (ARK_MEM_FAIL); - } - ark_mem->interp_type = ARK_INTERP_HERMITE; - } - - /* All allocations are complete */ - ark_mem->MallocDone = SUNTRUE; - } - - /* All allocation and error checking is complete at this point */ - - /* Copy the input parameters into ARKODE state */ - ark_mem->tcur = t0; - ark_mem->tn = t0; - - /* Initialize yn */ - N_VScale(ONE, y0, ark_mem->yn); - ark_mem->fn_is_current = SUNFALSE; - - /* Clear any previous 'tstop' */ - ark_mem->tstopset = SUNFALSE; - - /* Initializations on (re-)initialization call, skip on reset */ - if (init_type == FIRST_INIT) - { - /* Counters */ - ark_mem->nst_attempts = 0; - ark_mem->nst = 0; - ark_mem->nhnil = 0; - ark_mem->ncfn = 0; - ark_mem->netf = 0; - ark_mem->nconstrfails = 0; - - /* Initial, old, and next step sizes */ - ark_mem->h0u = ZERO; - ark_mem->hold = ZERO; - ark_mem->next_h = ZERO; - - /* Tolerance scale factor */ - ark_mem->tolsf = ONE; - - /* Reset error controller object */ - retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); - if (retval != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, - "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; - - /* 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 */ - ark_mem->initialized = SUNFALSE; - } - - /* Indicate initialization is needed */ - ark_mem->initsetup = SUNTRUE; - ark_mem->init_type = init_type; - ark_mem->firststage = SUNTRUE; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKodePrintMem: - - This routine outputs the ark_mem structure to a specified file - pointer. - ---------------------------------------------------------------*/ -void ARKodePrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodeMem ark_mem; - - /* Check if ark_mem exists */ - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return; - } - ark_mem = (ARKodeMem)arkode_mem; - - /* if outfile==NULL, set it to stdout */ - if (outfile == NULL) { outfile = stdout; } + /* if outfile==NULL, set it to stdout */ + if (outfile == NULL) { outfile = stdout; } /* output general values */ fprintf(outfile, "itol = %i\n", ark_mem->itol); @@ -1740,361 +1335,439 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) if (ark_mem->step_printmem) { ark_mem->step_printmem(ark_mem, outfile); } } +/*=============================================================== + Private internal functions + ===============================================================*/ + /*--------------------------------------------------------------- - arkCheckTimestepper: + arkCreate: - This routine checks if all required time stepper function - pointers have been supplied. If any of them is missing it - returns SUNFALSE. + arkCreate creates an internal memory block for a problem to + be solved by a time step module built on ARKODE. If successful, + arkCreate returns a pointer to the problem memory. If an + initialization error occurs, arkCreate prints an error message + to standard err and returns NULL. ---------------------------------------------------------------*/ -sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem) +ARKodeMem arkCreate(SUNContext sunctx) { - if ((ark_mem->step_init == NULL) || (ark_mem->step == NULL) || - (ark_mem->step_mem == NULL)) + int iret; + long int lenrw, leniw; + ARKodeMem ark_mem; + + if (!sunctx) { - return (SUNFALSE); + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_SUNCTX); + return (NULL); } - return (SUNTRUE); -} - -/*--------------------------------------------------------------- - arkCheckNvector: - This routine checks if all required vector operations are - present. If any of them is missing it returns SUNFALSE. - ---------------------------------------------------------------*/ -sunbooleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ -{ - if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || - (tmpl->ops->nvlinearsum == NULL) || (tmpl->ops->nvconst == NULL) || - (tmpl->ops->nvdiv == NULL) || (tmpl->ops->nvscale == NULL) || - (tmpl->ops->nvabs == NULL) || (tmpl->ops->nvinv == NULL) || - (tmpl->ops->nvaddconst == NULL) || (tmpl->ops->nvmaxnorm == NULL) || - (tmpl->ops->nvwrmsnorm == NULL)) + ark_mem = NULL; + ark_mem = (ARKodeMem)malloc(sizeof(struct ARKodeMemRec)); + if (ark_mem == NULL) { - return (SUNFALSE); + arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_ARKMEM_FAIL); + return (NULL); } - else { return (SUNTRUE); } -} -/*--------------------------------------------------------------- - arkAllocVec and arkAllocVecArray: + /* Zero out ark_mem */ + memset(ark_mem, 0, sizeof(struct ARKodeMemRec)); - These routines allocate (respectively) single vector or a vector - array based on a template vector. If the target vector or vector - array already exists it is left alone; otherwise it is allocated - by cloning the input vector. + /* Set the context */ + ark_mem->sunctx = sunctx; - This routine also updates the optional outputs lrw and liw, which - are (respectively) the lengths of the overall ARKODE real and - integer work spaces. + /* Set uround */ + ark_mem->uround = SUN_UNIT_ROUNDOFF; - SUNTRUE is returned if the allocation is successful (or if the - target vector or vector array already exists) otherwise SUNFALSE - is retured. - ---------------------------------------------------------------*/ -sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v) -{ - /* allocate the new vector if necessary */ - if (*v == NULL) - { - *v = N_VClone(tmpl); - if (*v == NULL) - { - arkFreeVectors(ark_mem); - return (SUNFALSE); - } - else - { - ark_mem->lrw += ark_mem->lrw1; - ark_mem->liw += ark_mem->liw1; - } - } - return (SUNTRUE); -} + /* Initialize time step module to NULL */ + ark_mem->step_attachlinsol = NULL; + ark_mem->step_attachmasssol = NULL; + ark_mem->step_disablelsetup = NULL; + ark_mem->step_disablemsetup = NULL; + ark_mem->step_getlinmem = NULL; + ark_mem->step_getmassmem = NULL; + ark_mem->step_getimplicitrhs = NULL; + ark_mem->step_mmult = NULL; + ark_mem->step_getgammas = NULL; + ark_mem->step_init = NULL; + ark_mem->step_fullrhs = NULL; + ark_mem->step = NULL; + ark_mem->step_setuserdata = NULL; + ark_mem->step_printallstats = NULL; + ark_mem->step_writeparameters = NULL; + ark_mem->step_resize = NULL; + ark_mem->step_reset = NULL; + ark_mem->step_free = NULL; + ark_mem->step_printmem = NULL; + ark_mem->step_setdefaults = NULL; + ark_mem->step_computestate = NULL; + ark_mem->step_setrelaxfn = NULL; + ark_mem->step_setorder = NULL; + ark_mem->step_setnonlinearsolver = NULL; + ark_mem->step_setlinear = NULL; + ark_mem->step_setnonlinear = NULL; + ark_mem->step_setnlsrhsfn = NULL; + ark_mem->step_setdeduceimplicitrhs = NULL; + ark_mem->step_setnonlincrdown = NULL; + ark_mem->step_setnonlinrdiv = NULL; + ark_mem->step_setdeltagammamax = NULL; + ark_mem->step_setlsetupfrequency = NULL; + ark_mem->step_setpredictormethod = NULL; + ark_mem->step_setmaxnonliniters = NULL; + ark_mem->step_setnonlinconvcoef = NULL; + ark_mem->step_setstagepredictfn = NULL; + ark_mem->step_getnumlinsolvsetups = NULL; + ark_mem->step_getestlocalerrors = NULL; + ark_mem->step_getcurrentgamma = NULL; + ark_mem->step_getnonlinearsystemdata = NULL; + ark_mem->step_getnumnonlinsolviters = NULL; + ark_mem->step_getnumnonlinsolvconvfails = NULL; + ark_mem->step_getnonlinsolvstats = NULL; + ark_mem->step_mem = NULL; + ark_mem->step_supports_adaptive = SUNFALSE; + ark_mem->step_supports_implicit = SUNFALSE; + ark_mem->step_supports_massmatrix = SUNFALSE; + ark_mem->step_supports_relaxation = SUNFALSE; -sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector** v, - sunindextype lrw1, long int* lrw, - sunindextype liw1, long int* liw) -{ - /* allocate the new vector array if necessary */ - if (*v == NULL) - { - *v = N_VCloneVectorArray(count, tmpl); - if (*v == NULL) { return (SUNFALSE); } - *lrw += count * lrw1; - *liw += count * liw1; - } - return (SUNTRUE); -} + /* Initialize root finding variables */ + ark_mem->root_mem = NULL; -/*--------------------------------------------------------------- - arkFreeVec and arkFreeVecArray: + /* Initialize inequality constraints variables */ + ark_mem->constraintsSet = SUNFALSE; + ark_mem->constraints = NULL; - These routines (respectively) free a single vector or a vector - array. If the target vector or vector array is already NULL it - is left alone; otherwise it is freed and the optional outputs - lrw and liw are updated accordingly. - ---------------------------------------------------------------*/ -void arkFreeVec(ARKodeMem ark_mem, N_Vector* v) -{ - if (*v != NULL) + /* Initialize relaxation variables */ + ark_mem->relax_enabled = SUNFALSE; + ark_mem->relax_mem = NULL; + + /* Initialize lrw and liw */ + ark_mem->lrw = 18; + ark_mem->liw = 53; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ + + /* No mallocs have been done yet */ + ark_mem->VabstolMallocDone = SUNFALSE; + ark_mem->VRabstolMallocDone = SUNFALSE; + ark_mem->MallocDone = SUNFALSE; + + /* No user-supplied step postprocessing function yet */ + ark_mem->ProcessStep = NULL; + ark_mem->ps_data = NULL; + + /* No user-supplied stage postprocessing function yet */ + ark_mem->ProcessStage = NULL; + + /* No user_data pointer yet */ + ark_mem->user_data = NULL; + + /* Allocate step adaptivity structure and note storage */ + ark_mem->hadapt_mem = arkAdaptInit(); + if (ark_mem->hadapt_mem == NULL) { - N_VDestroy(*v); - *v = NULL; - ark_mem->lrw -= ark_mem->lrw1; - ark_mem->liw -= ark_mem->liw1; + arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Allocation of step adaptivity structure failed"); + ARKodeFree((void**)&ark_mem); + return (NULL); } -} + ark_mem->lrw += ARK_ADAPT_LRW; + ark_mem->liw += ARK_ADAPT_LIW; -void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, - sunindextype liw1, long int* liw) -{ - if (*v != NULL) + /* Allocate default step controller (PID) and note storage */ + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) { - N_VDestroyVectorArray(*v, count); - *v = NULL; - *lrw -= count * lrw1; - *liw -= count * liw1; + arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Allocation of step controller object failed"); + ARKodeFree((void**)&ark_mem); + 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; -/*--------------------------------------------------------------- - arkResizeVec and arkResizeVecArray: + /* Initialize the interpolation structure to NULL */ + ark_mem->interp = NULL; + ark_mem->interp_type = -1; - This routines (respectively) resize a single vector or a vector - array based on a template vector. If the ARKVecResizeFn function - is non-NULL, then it calls that routine to perform the resize; - otherwise it deallocates and reallocates the target vector or - vector array based on the template vector. These routines also - updates the optional outputs lrw and liw, which are - (respectively) the lengths of the overall ARKODE real and - integer work spaces. + /* Initially, rwt should point to ewt */ + ark_mem->rwt_is_ewt = SUNTRUE; - SUNTRUE is returned if the resize is successful otherwise - SUNFALSE is retured. - ---------------------------------------------------------------*/ -sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, - void* resize_data, sunindextype lrw_diff, - sunindextype liw_diff, N_Vector tmpl, N_Vector* v) -{ - if (*v != NULL) - { - if (resize == NULL) - { - N_VDestroy(*v); - *v = NULL; - *v = N_VClone(tmpl); - if (*v == NULL) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to clone vector"); - return (SUNFALSE); - } - } - else - { - if (resize(*v, tmpl, resize_data)) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_RESIZE_FAIL); - return (SUNFALSE); - } - } - ark_mem->lrw += lrw_diff; - ark_mem->liw += liw_diff; - } - return (SUNTRUE); -} + /* 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; -sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void* resize_data, - int count, N_Vector tmpl, N_Vector** v, - sunindextype lrw_diff, long int* lrw, - sunindextype liw_diff, long int* liw) -{ - int i; + /* Indicate that the problem needs to be initialized */ + ark_mem->initsetup = SUNTRUE; + ark_mem->init_type = FIRST_INIT; + ark_mem->firststage = SUNTRUE; + ark_mem->initialized = SUNFALSE; - if (*v != NULL) + /* Initial step size has not been determined yet */ + ark_mem->h = ZERO; + ark_mem->h0u = ZERO; + + /* Set default values for integrator optional inputs */ + iret = ARKodeSetDefaults(ark_mem); + if (iret != ARK_SUCCESS) { - if (resize == NULL) - { - N_VDestroyVectorArray(*v, count); - *v = NULL; - *v = N_VCloneVectorArray(count, tmpl); - if (*v == NULL) { return (SUNFALSE); } - } - else - { - for (i = 0; i < count; i++) - { - if (resize((*v)[i], tmpl, resize_data)) { return (SUNFALSE); } - } - } - *lrw += count * lrw_diff; - *liw += count * liw_diff; + arkProcessError(NULL, 0, __LINE__, __func__, __FILE__, + "Error setting default solver options"); + ARKodeFree((void**)&ark_mem); + return (NULL); } - return (SUNTRUE); + + /* Return pointer to ARKODE memory block */ + return (ark_mem); } /*--------------------------------------------------------------- - arkAllocVectors: + arkRwtSet - This routine allocates the ARKODE vectors ewt, yn, tempv* and - ftemp. If any of these vectors already exist, they are left - alone. Otherwise, it will allocate each vector by cloning the - input vector. This routine also updates the optional outputs - lrw and liw, which are (respectively) the lengths of the real - and integer work spaces. + This routine is responsible for setting the residual weight + vector rwt, according to tol_type, as follows: - If all memory allocations are successful, arkAllocVectors - returns SUNTRUE, otherwise it returns SUNFALSE. - ---------------------------------------------------------------*/ -sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) -{ - /* Allocate ewt if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->ewt)) { return (SUNFALSE); } + (1) rwt[i] = 1 / (reltol * SUNRabs(M*ycur[i]) + rabstol), i=0,...,neq-1 + if tol_type = ARK_SS + (2) rwt[i] = 1 / (reltol * SUNRabs(M*ycur[i]) + rabstol[i]), i=0,...,neq-1 + if tol_type = ARK_SV + (3) unset if tol_type is any other value (occurs rwt=ewt) - /* Set rwt to point at ewt */ - if (ark_mem->rwt_is_ewt) { ark_mem->rwt = ark_mem->ewt; } + arkRwtSet returns 0 if rwt is successfully set as above to a + positive vector and -1 otherwise. In the latter case, rwt is + considered undefined. - /* Allocate yn if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->yn)) { return (SUNFALSE); } + All the real work is done in the routines arkRwtSetSS, arkRwtSetSV. + ---------------------------------------------------------------*/ +int arkRwtSet(N_Vector y, N_Vector weight, void* data) +{ + ARKodeMem ark_mem; + N_Vector My; + int flag = 0; - /* Allocate tempv1 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv1)) { return (SUNFALSE); } + /* data points to ark_mem here */ + ark_mem = (ARKodeMem)data; - /* Allocate tempv2 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv2)) { return (SUNFALSE); } + /* return if rwt is just ewt */ + if (ark_mem->rwt_is_ewt) { return (0); } - /* Allocate tempv3 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv3)) { return (SUNFALSE); } + /* put M*y into ark_tempv1 */ + My = ark_mem->tempv1; + if (ark_mem->step_mmult != NULL) + { + flag = ark_mem->step_mmult((void*)ark_mem, y, My); + if (flag != ARK_SUCCESS) { return (ARK_MASSMULT_FAIL); } + } + else + { /* this condition should not apply, but just in case */ + N_VScale(ONE, y, My); + } - /* Allocate tempv4 if needed */ - if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv4)) { return (SUNFALSE); } + /* call appropriate routine to fill rwt */ + switch (ark_mem->ritol) + { + case ARK_SS: flag = arkRwtSetSS(ark_mem, My, weight); break; + case ARK_SV: flag = arkRwtSetSV(ark_mem, My, weight); break; + } - return (SUNTRUE); + return (flag); } /*--------------------------------------------------------------- - arkResizeVectors: - - This routine resizes all ARKODE vectors if they exist, - otherwise they are left alone. If a resize function is provided - it is called to resize the vectors otherwise the vector is - freed and a new vector is created by cloning in input vector. - This routine also updates the optional outputs lrw and liw, - which are (respectively) the lengths of the real and integer - work spaces. + arkInit: - If all memory allocations are successful, arkResizeVectors - returns SUNTRUE, otherwise it returns SUNFALSE. + arkInit allocates and initializes memory for a problem. All + inputs are checked for errors. If any error occurs during + initialization, an error flag is returned. Otherwise, it returns + ARK_SUCCESS. This routine should be called by an ARKODE + timestepper module (not by the user). This routine must be + called prior to calling ARKodeEvolve to evolve the problem. The + initialization type indicates if the values of internal counters + should be reinitialized (FIRST_INIT) or retained (RESET_INIT). ---------------------------------------------------------------*/ -sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, - void* resize_data, sunindextype lrw_diff, - sunindextype liw_diff, N_Vector tmpl) +int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) { - /* Vabstol */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->Vabstol)) + sunbooleantype stepperOK, nvectorOK, allocOK; + int retval; + sunindextype lrw1, liw1; + + /* Check ark_mem */ + if (ark_mem == NULL) { - return (SUNFALSE); + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); } - /* VRabstol */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->VRabstol)) + /* Check for legal input parameters */ + if (y0 == NULL) { - return (SUNFALSE); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return (ARK_ILL_INPUT); } - /* ewt */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->ewt)) + /* Check if reset was called before the first Evolve call */ + if (init_type == RESET_INIT && !(ark_mem->initialized)) { - return (SUNFALSE); + init_type = FIRST_INIT; } - /* rwt */ - if (ark_mem->rwt_is_ewt) - { /* update pointer to ewt */ - ark_mem->rwt = ark_mem->ewt; - } - else - { /* resize if distinct from ewt */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->rwt)) + /* Check if allocations have been done i.e., is this first init call */ + if (ark_mem->MallocDone == SUNFALSE) + { + /* Test if all required time stepper operations are implemented */ + stepperOK = arkCheckTimestepper(ark_mem); + if (!stepperOK) { - return (SUNFALSE); + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Time stepper module is missing required functionality"); + return (ARK_ILL_INPUT); } - } - /* yn */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->yn)) - { - return (SUNFALSE); - } + /* Test if all required vector operations are implemented */ + nvectorOK = arkCheckNvector(y0); + if (!nvectorOK) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_NVECTOR); + return (ARK_ILL_INPUT); + } - /* fn */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->fn)) - { - return (SUNFALSE); - } + /* Set space requirements for one N_Vector */ + if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } + else + { + lrw1 = 0; + liw1 = 0; + } + ark_mem->lrw1 = lrw1; + ark_mem->liw1 = liw1; - /* tempv* */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv1)) - { - return (SUNFALSE); - } + /* Allocate the solver vectors (using y0 as a template) */ + allocOK = arkAllocVectors(ark_mem, y0); + if (!allocOK) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv2)) - { - return (SUNFALSE); - } + /* Create default Hermite interpolation module */ + 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, __LINE__, __func__, __FILE__, + "Unable to allocate interpolation module"); + return (ARK_MEM_FAIL); + } + ark_mem->interp_type = ARK_INTERP_HERMITE; + } - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv3)) - { - return (SUNFALSE); + /* All allocations are complete */ + ark_mem->MallocDone = SUNTRUE; } - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->tempv4)) + /* All allocation and error checking is complete at this point */ + + /* Copy the input parameters into ARKODE state */ + ark_mem->tcur = t0; + ark_mem->tn = t0; + + /* Initialize yn */ + N_VScale(ONE, y0, ark_mem->yn); + ark_mem->fn_is_current = SUNFALSE; + + /* Clear any previous 'tstop' */ + ark_mem->tstopset = SUNFALSE; + + /* Initializations on (re-)initialization call, skip on reset */ + if (init_type == FIRST_INIT) { - return (SUNFALSE); + /* Counters */ + ark_mem->nst_attempts = 0; + ark_mem->nst = 0; + ark_mem->nhnil = 0; + ark_mem->ncfn = 0; + ark_mem->netf = 0; + ark_mem->nconstrfails = 0; + + /* Initial, old, and next step sizes */ + ark_mem->h0u = ZERO; + ark_mem->hold = ZERO; + ark_mem->next_h = ZERO; + + /* Tolerance scale factor */ + ark_mem->tolsf = ONE; + + /* Reset error controller object */ + retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, + "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; + + /* 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 */ + ark_mem->initialized = SUNFALSE; } - /* constraints */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, - &ark_mem->constraints)) + /* Indicate initialization is needed */ + ark_mem->initsetup = SUNTRUE; + ark_mem->init_type = init_type; + ark_mem->firststage = SUNTRUE; + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkCheckTimestepper: + + This routine checks if all required time stepper function + pointers have been supplied. If any of them is missing it + returns SUNFALSE. + ---------------------------------------------------------------*/ +sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem) +{ + if ((ark_mem->step_init == NULL) || (ark_mem->step == NULL) || + (ark_mem->step_mem == NULL)) { return (SUNFALSE); } - return (SUNTRUE); } /*--------------------------------------------------------------- - arkFreeVectors + arkCheckNvector: - This routine frees the ARKODE vectors allocated in both - arkAllocVectors and arkAllocRKVectors. + This routine checks if all required vector operations are + present. If any of them is missing it returns SUNFALSE. ---------------------------------------------------------------*/ -void arkFreeVectors(ARKodeMem ark_mem) +sunbooleantype arkCheckNvector(N_Vector tmpl) /* to be updated?? */ { - arkFreeVec(ark_mem, &ark_mem->ewt); - if (!ark_mem->rwt_is_ewt) { arkFreeVec(ark_mem, &ark_mem->rwt); } - arkFreeVec(ark_mem, &ark_mem->tempv1); - arkFreeVec(ark_mem, &ark_mem->tempv2); - arkFreeVec(ark_mem, &ark_mem->tempv3); - arkFreeVec(ark_mem, &ark_mem->tempv4); - arkFreeVec(ark_mem, &ark_mem->yn); - arkFreeVec(ark_mem, &ark_mem->fn); - arkFreeVec(ark_mem, &ark_mem->Vabstol); - arkFreeVec(ark_mem, &ark_mem->constraints); + if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || + (tmpl->ops->nvlinearsum == NULL) || (tmpl->ops->nvconst == NULL) || + (tmpl->ops->nvdiv == NULL) || (tmpl->ops->nvscale == NULL) || + (tmpl->ops->nvabs == NULL) || (tmpl->ops->nvinv == NULL) || + (tmpl->ops->nvaddconst == NULL) || (tmpl->ops->nvmaxnorm == NULL) || + (tmpl->ops->nvwrmsnorm == NULL)) + { + return (SUNFALSE); + } + else { return (SUNTRUE); } } /*--------------------------------------------------------------- @@ -3180,277 +2853,597 @@ int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess ---------------------------------------------------------------*/ int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { - int ord; - sunrealtype tau_tol = 0.5; + int ord; + sunrealtype tau_tol = 0.5; + + /* verify that ark_mem and interpolation structure are provided */ + if (ark_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeMem structure is NULL"); + return (ARK_MEM_NULL); + } + if (ark_mem->interp == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeInterpMem structure is NULL"); + return (ARK_MEM_NULL); + } + + /* set the polynomial order based on tau input */ + if (tau <= tau_tol) { ord = ARK_INTERP_MAX_DEGREE; } + else { ord = 1; } + + /* call the interpolation module to do the work */ + return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, ord, yguess)); +} + +/*--------------------------------------------------------------- + arkPredict_Bootstrap + + This routine predicts the nonlinear implicit stage solution + using a quadratic Hermite interpolating polynomial, based on + the data {y_n, f(t_n,y_n), f(t_n+hj,z_j)}. + + Note: we assume that ftemp = f(t_n+hj,z_j) can be computed via + N_VLinearCombination(nvec, cvals, Xvecs, ftemp), + i.e. the inputs cvals[0:nvec-1] and Xvecs[0:nvec-1] may be + combined to form f(t_n+hj,z_j). + ---------------------------------------------------------------*/ +int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, sunrealtype tau, + int nvec, sunrealtype* cvals, N_Vector* Xvecs, + N_Vector yguess) +{ + sunrealtype a0, a1, a2; + int i, retval; + + /* verify that ark_mem and interpolation structure are provided */ + if (ark_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeMem structure is NULL"); + return (ARK_MEM_NULL); + } + if (ark_mem->interp == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "ARKodeInterpMem structure is NULL"); + return (ARK_MEM_NULL); + } + + /* set coefficients for Hermite interpolant */ + a0 = ONE; + a2 = tau * tau / TWO / hj; + a1 = tau - a2; + + /* set arrays for fused vector operation; shift inputs for + f(t_n+hj,z_j) to end of queue */ + for (i = 0; i < nvec; i++) + { + cvals[2 + i] = a2 * cvals[i]; + Xvecs[2 + i] = Xvecs[i]; + } + cvals[0] = a0; + Xvecs[0] = ark_mem->yn; + cvals[1] = a1; + Xvecs[1] = ark_mem->fn; + + /* call fused vector operation to compute prediction */ + retval = N_VLinearCombination(nvec + 2, cvals, Xvecs, yguess); + if (retval != 0) { return (ARK_VECTOROP_ERR); } + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkCheckConvergence + + This routine checks the return flag from the time-stepper's + "step" routine for algebraic solver convergence issues. + + Returns ARK_SUCCESS (0) if successful, PREDICT_AGAIN (>0) + on a recoverable convergence failure, or a relevant + nonrecoverable failure flag (<0). + --------------------------------------------------------------*/ +int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr) +{ + ARKodeHAdaptMem hadapt_mem; + + if (*nflagPtr == ARK_SUCCESS) { return (ARK_SUCCESS); } + + /* The nonlinear soln. failed; increment ncfn */ + ark_mem->ncfn++; + + /* If fixed time stepping, then return with convergence failure */ + if (ark_mem->fixedstep) { return (ARK_CONV_FAILURE); } + + /* Otherwise, access adaptivity structure */ + if (ark_mem->hadapt_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); + return (ARK_MEM_NULL); + } + hadapt_mem = ark_mem->hadapt_mem; + + /* Return if lsetup, lsolve, or rhs failed unrecoverably */ + if (*nflagPtr < 0) + { + if (*nflagPtr == ARK_LSETUP_FAIL) { return (ARK_LSETUP_FAIL); } + else if (*nflagPtr == ARK_LSOLVE_FAIL) { return (ARK_LSOLVE_FAIL); } + else if (*nflagPtr == ARK_RHSFUNC_FAIL) { return (ARK_RHSFUNC_FAIL); } + else { return (ARK_NLS_OP_ERR); } + } + + /* At this point, nflag = CONV_FAIL or RHSFUNC_RECVR; increment ncf */ + (*ncfPtr)++; + hadapt_mem->etamax = ONE; + + /* If we had maxncf failures, or if |h| = hmin, + return ARK_CONV_FAILURE or ARK_REPTD_RHSFUNC_ERR. */ + if ((*ncfPtr == ark_mem->maxncf) || + (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM)) + { + if (*nflagPtr == CONV_FAIL) { return (ARK_CONV_FAILURE); } + if (*nflagPtr == RHSFUNC_RECVR) { return (ARK_REPTD_RHSFUNC_ERR); } + } + + /* Reduce step size due to convergence failure */ + ark_mem->eta = hadapt_mem->etacf; + + /* Signal for Jacobian/preconditioner setup */ + *nflagPtr = PREV_CONV_FAIL; + + /* Return to reattempt the step */ + return (PREDICT_AGAIN); +} + +/*--------------------------------------------------------------- + arkCheckConstraints + + This routine determines if the constraints of the problem + are satisfied by the proposed step + + Returns ARK_SUCCESS if successful, otherwise CONSTR_RECVR + --------------------------------------------------------------*/ +int arkCheckConstraints(ARKodeMem ark_mem, int* constrfails, int* nflag) +{ + sunbooleantype constraintsPassed; + N_Vector mm = ark_mem->tempv4; + N_Vector tmp = ark_mem->tempv3; + + /* Check constraints and get mask vector mm for where constraints failed */ + constraintsPassed = N_VConstrMask(ark_mem->constraints, ark_mem->ycur, mm); + if (constraintsPassed) { return (ARK_SUCCESS); } + + /* Constraints not met */ + + /* Update total fails and fails in current step */ + ark_mem->nconstrfails++; + (*constrfails)++; + + /* Return with error if reached max fails in a step */ + if (*constrfails == ark_mem->maxconstrfails) { return (ARK_CONSTR_FAIL); } + + /* Return with error if using fixed step sizes */ + if (ark_mem->fixedstep) { return (ARK_CONSTR_FAIL); } + + /* Return with error if |h| == hmin */ + if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) + { + return (ARK_CONSTR_FAIL); + } + + /* Reduce h by computing eta = h'/h */ + N_VLinearSum(ONE, ark_mem->yn, -ONE, ark_mem->ycur, tmp); + N_VProd(mm, tmp, tmp); + ark_mem->eta = SUN_RCONST(0.9) * N_VMinQuotient(ark_mem->yn, tmp); + ark_mem->eta = SUNMAX(ark_mem->eta, TENTH); + + /* Signal for Jacobian/preconditioner setup */ + *nflag = PREV_CONV_FAIL; + + /* Return to reattempt the step */ + return (CONSTR_RECVR); +} + +/*--------------------------------------------------------------- + arkCheckTemporalError + + This routine performs the local error test for the method. + The weighted local error norm dsm is passed in. This value is + used to predict the next step to attempt based on dsm. + The test dsm <= 1 is made, and if this fails then additional + checks are performed based on the number of successive error + test failures. + + Returns ARK_SUCCESS if the test passes. + + If the test fails: + - if maxnef error test failures have occurred or if + SUNRabs(h) = hmin, we return ARK_ERR_FAILURE. + - otherwise: set *nflagPtr to PREV_ERR_FAIL, and + return TRY_AGAIN. + --------------------------------------------------------------*/ +int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, + sunrealtype dsm) +{ + int retval; + sunrealtype ttmp; + long int nsttmp; + ARKodeHAdaptMem hadapt_mem; - /* verify that ark_mem and interpolation structure are provided */ - if (ark_mem == NULL) + /* Access hadapt_mem structure */ + if (ark_mem->hadapt_mem == NULL) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "ARKodeMem structure is NULL"); + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); return (ARK_MEM_NULL); } - if (ark_mem->interp == NULL) + hadapt_mem = ark_mem->hadapt_mem; + + /* consider change of step size for next step attempt (may be + larger/smaller than current step, depending on dsm) */ + ttmp = (dsm <= ONE) ? ark_mem->tn + ark_mem->h : ark_mem->tn; + nsttmp = (dsm <= ONE) ? ark_mem->nst + 1 : ark_mem->nst; + retval = arkAdapt(ark_mem, hadapt_mem, ark_mem->ycur, ttmp, 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); } + + /* Test failed; increment counters, set nflag */ + (*nefPtr)++; + ark_mem->netf++; + *nflagPtr = PREV_ERR_FAIL; + + /* At maxnef failures, return ARK_ERR_FAILURE */ + if (*nefPtr == ark_mem->maxnef) { return (ARK_ERR_FAILURE); } + + /* Set etamax=1 to prevent step size increase at end of this step */ + hadapt_mem->etamax = ONE; + + /* Enforce failure bounds on eta */ + if (*nefPtr >= hadapt_mem->small_nef) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "ARKodeInterpMem structure is NULL"); - return (ARK_MEM_NULL); + ark_mem->eta = SUNMIN(ark_mem->eta, hadapt_mem->etamxf); } - /* set the polynomial order based on tau input */ - if (tau <= tau_tol) { ord = ARK_INTERP_MAX_DEGREE; } - else { ord = 1; } + /* 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); - /* call the interpolation module to do the work */ - return (arkInterpEvaluate(ark_mem, ark_mem->interp, tau, 0, ord, yguess)); + return (TRY_AGAIN); } /*--------------------------------------------------------------- - arkPredict_Bootstrap + arkAllocVec and arkAllocVecArray: - This routine predicts the nonlinear implicit stage solution - using a quadratic Hermite interpolating polynomial, based on - the data {y_n, f(t_n,y_n), f(t_n+hj,z_j)}. + These routines allocate (respectively) single vector or a vector + array based on a template vector. If the target vector or vector + array already exists it is left alone; otherwise it is allocated + by cloning the input vector. - Note: we assume that ftemp = f(t_n+hj,z_j) can be computed via - N_VLinearCombination(nvec, cvals, Xvecs, ftemp), - i.e. the inputs cvals[0:nvec-1] and Xvecs[0:nvec-1] may be - combined to form f(t_n+hj,z_j). + This routine also updates the optional outputs lrw and liw, which + are (respectively) the lengths of the overall ARKODE real and + integer work spaces. + + SUNTRUE is returned if the allocation is successful (or if the + target vector or vector array already exists) otherwise SUNFALSE + is retured. ---------------------------------------------------------------*/ -int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, sunrealtype tau, - int nvec, sunrealtype* cvals, N_Vector* Xvecs, - N_Vector yguess) +sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v) { - sunrealtype a0, a1, a2; - int i, retval; - - /* verify that ark_mem and interpolation structure are provided */ - if (ark_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "ARKodeMem structure is NULL"); - return (ARK_MEM_NULL); - } - if (ark_mem->interp == NULL) + /* allocate the new vector if necessary */ + if (*v == NULL) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "ARKodeInterpMem structure is NULL"); - return (ARK_MEM_NULL); + *v = N_VClone(tmpl); + if (*v == NULL) + { + arkFreeVectors(ark_mem); + return (SUNFALSE); + } + else + { + ark_mem->lrw += ark_mem->lrw1; + ark_mem->liw += ark_mem->liw1; + } } + return (SUNTRUE); +} - /* set coefficients for Hermite interpolant */ - a0 = ONE; - a2 = tau * tau / TWO / hj; - a1 = tau - a2; - - /* set arrays for fused vector operation; shift inputs for - f(t_n+hj,z_j) to end of queue */ - for (i = 0; i < nvec; i++) +sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector** v, + sunindextype lrw1, long int* lrw, + sunindextype liw1, long int* liw) +{ + /* allocate the new vector array if necessary */ + if (*v == NULL) { - cvals[2 + i] = a2 * cvals[i]; - Xvecs[2 + i] = Xvecs[i]; + *v = N_VCloneVectorArray(count, tmpl); + if (*v == NULL) { return (SUNFALSE); } + *lrw += count * lrw1; + *liw += count * liw1; } - cvals[0] = a0; - Xvecs[0] = ark_mem->yn; - cvals[1] = a1; - Xvecs[1] = ark_mem->fn; - - /* call fused vector operation to compute prediction */ - retval = N_VLinearCombination(nvec + 2, cvals, Xvecs, yguess); - if (retval != 0) { return (ARK_VECTOROP_ERR); } - return (ARK_SUCCESS); + return (SUNTRUE); } /*--------------------------------------------------------------- - arkCheckConvergence - - This routine checks the return flag from the time-stepper's - "step" routine for algebraic solver convergence issues. + arkFreeVec and arkFreeVecArray: - Returns ARK_SUCCESS (0) if successful, PREDICT_AGAIN (>0) - on a recoverable convergence failure, or a relevant - nonrecoverable failure flag (<0). - --------------------------------------------------------------*/ -int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr) + These routines (respectively) free a single vector or a vector + array. If the target vector or vector array is already NULL it + is left alone; otherwise it is freed and the optional outputs + lrw and liw are updated accordingly. + ---------------------------------------------------------------*/ +void arkFreeVec(ARKodeMem ark_mem, N_Vector* v) { - ARKodeHAdaptMem hadapt_mem; - - if (*nflagPtr == ARK_SUCCESS) { return (ARK_SUCCESS); } - - /* The nonlinear soln. failed; increment ncfn */ - ark_mem->ncfn++; - - /* If fixed time stepping, then return with convergence failure */ - if (ark_mem->fixedstep) { return (ARK_CONV_FAILURE); } - - /* Otherwise, access adaptivity structure */ - if (ark_mem->hadapt_mem == NULL) + if (*v != NULL) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARKADAPT_NO_MEM); - return (ARK_MEM_NULL); + N_VDestroy(*v); + *v = NULL; + ark_mem->lrw -= ark_mem->lrw1; + ark_mem->liw -= ark_mem->liw1; } - hadapt_mem = ark_mem->hadapt_mem; +} - /* Return if lsetup, lsolve, or rhs failed unrecoverably */ - if (*nflagPtr < 0) +void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, + sunindextype liw1, long int* liw) +{ + if (*v != NULL) { - if (*nflagPtr == ARK_LSETUP_FAIL) { return (ARK_LSETUP_FAIL); } - else if (*nflagPtr == ARK_LSOLVE_FAIL) { return (ARK_LSOLVE_FAIL); } - else if (*nflagPtr == ARK_RHSFUNC_FAIL) { return (ARK_RHSFUNC_FAIL); } - else { return (ARK_NLS_OP_ERR); } + N_VDestroyVectorArray(*v, count); + *v = NULL; + *lrw -= count * lrw1; + *liw -= count * liw1; } +} - /* At this point, nflag = CONV_FAIL or RHSFUNC_RECVR; increment ncf */ - (*ncfPtr)++; - hadapt_mem->etamax = ONE; +/*--------------------------------------------------------------- + arkResizeVec and arkResizeVecArray: - /* If we had maxncf failures, or if |h| = hmin, - return ARK_CONV_FAILURE or ARK_REPTD_RHSFUNC_ERR. */ - if ((*ncfPtr == ark_mem->maxncf) || - (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM)) + This routines (respectively) resize a single vector or a vector + array based on a template vector. If the ARKVecResizeFn function + is non-NULL, then it calls that routine to perform the resize; + otherwise it deallocates and reallocates the target vector or + vector array based on the template vector. These routines also + updates the optional outputs lrw and liw, which are + (respectively) the lengths of the overall ARKODE real and + integer work spaces. + + SUNTRUE is returned if the resize is successful otherwise + SUNFALSE is retured. + ---------------------------------------------------------------*/ +sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, + void* resize_data, sunindextype lrw_diff, + sunindextype liw_diff, N_Vector tmpl, N_Vector* v) +{ + if (*v != NULL) { - if (*nflagPtr == CONV_FAIL) { return (ARK_CONV_FAILURE); } - if (*nflagPtr == RHSFUNC_RECVR) { return (ARK_REPTD_RHSFUNC_ERR); } + if (resize == NULL) + { + N_VDestroy(*v); + *v = NULL; + *v = N_VClone(tmpl); + if (*v == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to clone vector"); + return (SUNFALSE); + } + } + else + { + if (resize(*v, tmpl, resize_data)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RESIZE_FAIL); + return (SUNFALSE); + } + } + ark_mem->lrw += lrw_diff; + ark_mem->liw += liw_diff; } + return (SUNTRUE); +} - /* Reduce step size due to convergence failure */ - ark_mem->eta = hadapt_mem->etacf; - - /* Signal for Jacobian/preconditioner setup */ - *nflagPtr = PREV_CONV_FAIL; +sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void* resize_data, + int count, N_Vector tmpl, N_Vector** v, + sunindextype lrw_diff, long int* lrw, + sunindextype liw_diff, long int* liw) +{ + int i; - /* Return to reattempt the step */ - return (PREDICT_AGAIN); + if (*v != NULL) + { + if (resize == NULL) + { + N_VDestroyVectorArray(*v, count); + *v = NULL; + *v = N_VCloneVectorArray(count, tmpl); + if (*v == NULL) { return (SUNFALSE); } + } + else + { + for (i = 0; i < count; i++) + { + if (resize((*v)[i], tmpl, resize_data)) { return (SUNFALSE); } + } + } + *lrw += count * lrw_diff; + *liw += count * liw_diff; + } + return (SUNTRUE); } /*--------------------------------------------------------------- - arkCheckConstraints + arkAllocVectors: - This routine determines if the constraints of the problem - are satisfied by the proposed step + This routine allocates the ARKODE vectors ewt, yn, tempv* and + ftemp. If any of these vectors already exist, they are left + alone. Otherwise, it will allocate each vector by cloning the + input vector. This routine also updates the optional outputs + lrw and liw, which are (respectively) the lengths of the real + and integer work spaces. - Returns ARK_SUCCESS if successful, otherwise CONSTR_RECVR - --------------------------------------------------------------*/ -int arkCheckConstraints(ARKodeMem ark_mem, int* constrfails, int* nflag) + If all memory allocations are successful, arkAllocVectors + returns SUNTRUE, otherwise it returns SUNFALSE. + ---------------------------------------------------------------*/ +sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl) { - sunbooleantype constraintsPassed; - N_Vector mm = ark_mem->tempv4; - N_Vector tmp = ark_mem->tempv3; - - /* Check constraints and get mask vector mm for where constraints failed */ - constraintsPassed = N_VConstrMask(ark_mem->constraints, ark_mem->ycur, mm); - if (constraintsPassed) { return (ARK_SUCCESS); } - - /* Constraints not met */ + /* Allocate ewt if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->ewt)) { return (SUNFALSE); } - /* Update total fails and fails in current step */ - ark_mem->nconstrfails++; - (*constrfails)++; + /* Set rwt to point at ewt */ + if (ark_mem->rwt_is_ewt) { ark_mem->rwt = ark_mem->ewt; } - /* Return with error if reached max fails in a step */ - if (*constrfails == ark_mem->maxconstrfails) { return (ARK_CONSTR_FAIL); } + /* Allocate yn if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->yn)) { return (SUNFALSE); } - /* Return with error if using fixed step sizes */ - if (ark_mem->fixedstep) { return (ARK_CONSTR_FAIL); } + /* Allocate tempv1 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv1)) { return (SUNFALSE); } - /* Return with error if |h| == hmin */ - if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) - { - return (ARK_CONSTR_FAIL); - } + /* Allocate tempv2 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv2)) { return (SUNFALSE); } - /* Reduce h by computing eta = h'/h */ - N_VLinearSum(ONE, ark_mem->yn, -ONE, ark_mem->ycur, tmp); - N_VProd(mm, tmp, tmp); - ark_mem->eta = SUN_RCONST(0.9) * N_VMinQuotient(ark_mem->yn, tmp); - ark_mem->eta = SUNMAX(ark_mem->eta, TENTH); + /* Allocate tempv3 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv3)) { return (SUNFALSE); } - /* Signal for Jacobian/preconditioner setup */ - *nflag = PREV_CONV_FAIL; + /* Allocate tempv4 if needed */ + if (!arkAllocVec(ark_mem, tmpl, &ark_mem->tempv4)) { return (SUNFALSE); } - /* Return to reattempt the step */ - return (CONSTR_RECVR); + return (SUNTRUE); } /*--------------------------------------------------------------- - arkCheckTemporalError - - This routine performs the local error test for the method. - The weighted local error norm dsm is passed in. This value is - used to predict the next step to attempt based on dsm. - The test dsm <= 1 is made, and if this fails then additional - checks are performed based on the number of successive error - test failures. + arkResizeVectors: - Returns ARK_SUCCESS if the test passes. + This routine resizes all ARKODE vectors if they exist, + otherwise they are left alone. If a resize function is provided + it is called to resize the vectors otherwise the vector is + freed and a new vector is created by cloning in input vector. + This routine also updates the optional outputs lrw and liw, + which are (respectively) the lengths of the real and integer + work spaces. - If the test fails: - - if maxnef error test failures have occurred or if - SUNRabs(h) = hmin, we return ARK_ERR_FAILURE. - - otherwise: set *nflagPtr to PREV_ERR_FAIL, and - return TRY_AGAIN. - --------------------------------------------------------------*/ -int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, - sunrealtype dsm) + If all memory allocations are successful, arkResizeVectors + returns SUNTRUE, otherwise it returns SUNFALSE. + ---------------------------------------------------------------*/ +sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, + void* resize_data, sunindextype lrw_diff, + sunindextype liw_diff, N_Vector tmpl) { - int retval; - sunrealtype ttmp; - long int nsttmp; - ARKodeHAdaptMem hadapt_mem; + /* Vabstol */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->Vabstol)) + { + return (SUNFALSE); + } - /* Access hadapt_mem structure */ - if (ark_mem->hadapt_mem == NULL) + /* VRabstol */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->VRabstol)) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARKADAPT_NO_MEM); - return (ARK_MEM_NULL); + return (SUNFALSE); } - hadapt_mem = ark_mem->hadapt_mem; - /* consider change of step size for next step attempt (may be - larger/smaller than current step, depending on dsm) */ - ttmp = (dsm <= ONE) ? ark_mem->tn + ark_mem->h : ark_mem->tn; - nsttmp = (dsm <= ONE) ? ark_mem->nst + 1 : ark_mem->nst; - retval = arkAdapt(ark_mem, hadapt_mem, ark_mem->ycur, ttmp, ark_mem->h, dsm, - nsttmp); - if (retval != ARK_SUCCESS) { return (ARK_ERR_FAILURE); } + /* ewt */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->ewt)) + { + return (SUNFALSE); + } - /* 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); + /* rwt */ + if (ark_mem->rwt_is_ewt) + { /* update pointer to ewt */ + ark_mem->rwt = ark_mem->ewt; + } + else + { /* resize if distinct from ewt */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->rwt)) + { + return (SUNFALSE); + } + } - /* If est. local error norm dsm passes test, return ARK_SUCCESS */ - if (dsm <= ONE) { return (ARK_SUCCESS); } + /* yn */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->yn)) + { + return (SUNFALSE); + } - /* Test failed; increment counters, set nflag */ - (*nefPtr)++; - ark_mem->netf++; - *nflagPtr = PREV_ERR_FAIL; + /* fn */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->fn)) + { + return (SUNFALSE); + } - /* At maxnef failures, return ARK_ERR_FAILURE */ - if (*nefPtr == ark_mem->maxnef) { return (ARK_ERR_FAILURE); } + /* tempv* */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv1)) + { + return (SUNFALSE); + } - /* Set etamax=1 to prevent step size increase at end of this step */ - hadapt_mem->etamax = ONE; + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv2)) + { + return (SUNFALSE); + } - /* Enforce failure bounds on eta */ - if (*nefPtr >= hadapt_mem->small_nef) + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv3)) { - ark_mem->eta = SUNMIN(ark_mem->eta, hadapt_mem->etamxf); + return (SUNFALSE); } - /* 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); + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv4)) + { + return (SUNFALSE); + } - return (TRY_AGAIN); + /* constraints */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->constraints)) + { + return (SUNFALSE); + } + + return (SUNTRUE); +} + +/*--------------------------------------------------------------- + arkFreeVectors + + This routine frees the ARKODE vectors allocated in both + arkAllocVectors and arkAllocRKVectors. + ---------------------------------------------------------------*/ +void arkFreeVectors(ARKodeMem ark_mem) +{ + arkFreeVec(ark_mem, &ark_mem->ewt); + if (!ark_mem->rwt_is_ewt) { arkFreeVec(ark_mem, &ark_mem->rwt); } + arkFreeVec(ark_mem, &ark_mem->tempv1); + arkFreeVec(ark_mem, &ark_mem->tempv2); + arkFreeVec(ark_mem, &ark_mem->tempv3); + arkFreeVec(ark_mem, &ark_mem->tempv4); + arkFreeVec(ark_mem, &ark_mem->yn); + arkFreeVec(ark_mem, &ark_mem->fn); + arkFreeVec(ark_mem, &ark_mem->Vabstol); + arkFreeVec(ark_mem, &ark_mem->constraints); } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 757be20da1..3d86d9e385 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -43,26 +43,24 @@ extern "C" { #define HFIXED_LB SUN_RCONST(1.0) /* CVODE uses 1.0 */ #define HFIXED_UB SUN_RCONST(1.5) /* CVODE uses 1.5 */ -#define ETAMX1 SUN_RCONST(10000.0) /* maximum step size change on first step */ -#define ETAMXF \ - SUN_RCONST(0.3) /* step size reduction factor on multiple error - test failures (multiple implies >= SMALL_NEF) */ -#define ETAMIN \ - SUN_RCONST(0.1) /* smallest allowable step size reduction factor - on an error test failure */ -#define ETACF \ - SUN_RCONST(0.25) /* step size reduction factor on nonlinear - 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 */ +/* maximum step size change on first step */ +#define ETAMX1 SUN_RCONST(10000.0) +/* step size reduction factor on multiple error test failures (multiple implies >= SMALL_NEF) */ +#define ETAMXF SUN_RCONST(0.3) +/* smallest allowable step size reduction factor on an error test failure */ +#define ETAMIN SUN_RCONST(0.1) +/* step size reduction factor on nonlinear convergence failure */ +#define ETACF SUN_RCONST(0.25) +/* if an error failure occurs and SMALL_NEF <= nef, then reset eta = MIN(eta, ETAMXF) */ +#define SMALL_NEF 2 +/* order to use for controller: + 0=embedding, + 1=method, + otherwise min(method,embedding) + DEPRECATED, REMOVE AT SAME TIME AS ARKStepSetAdaptivityMethod */ +#define PQ 0 +/* adjustment to apply within controller to method order of accuracy */ +#define ADJUST -1 /*=============================================================== ARKODE Time Step Adaptivity Data Structure diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 81a4a12b3f..5e181982c1 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -29,7 +29,7 @@ #define FIXED_LIN_TOL /*=============================================================== - ARKStep Exported functions -- Required + Exported functions ===============================================================*/ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, @@ -262,6 +262,126 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, return ((void*)ark_mem); } +/*--------------------------------------------------------------- + ARKStepReInit: + + This routine re-initializes the ARKStep module to solve a new + problem of the same size as was previously solved. This routine + should also be called when the problem dynamics or desired solvers + have changed dramatically, so that the problem integration should + resume as if started from scratch. + + Note all internal counters are set to 0 on re-initialization. + ---------------------------------------------------------------*/ +int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, + N_Vector y0) +{ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Check if ark_mem was allocated */ + if (ark_mem->MallocDone == SUNFALSE) + { + arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MALLOC); + return (ARK_NO_MALLOC); + } + + /* Check that at least one of fe, fi is supplied and is to be used */ + if (fe == NULL && fi == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_F); + return (ARK_ILL_INPUT); + } + + /* Check that y0 is supplied */ + if (y0 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return (ARK_ILL_INPUT); + } + + /* Set implicit/explicit problem based on function pointers */ + step_mem->explicit = (fe == NULL) ? SUNFALSE : SUNTRUE; + step_mem->implicit = (fi == NULL) ? SUNFALSE : SUNTRUE; + + /* Copy the input parameters into ARKODE state */ + step_mem->fe = fe; + step_mem->fi = fi; + + /* Initialize initial error norm */ + step_mem->eRNrm = ONE; + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to reinitialize main ARKODE infrastructure"); + return (retval); + } + + /* Initialize all the counters */ + step_mem->nfe = 0; + step_mem->nfi = 0; + step_mem->nsetups = 0; + step_mem->nstlp = 0; + + return (ARK_SUCCESS); +} + +/*------------------------------------------------------------------------------ + ARKStepCreateMRIStepInnerStepper + + Wraps an ARKStep memory structure as an MRIStep inner stepper. + ----------------------------------------------------------------------------*/ +int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, + MRIStepInnerStepper* stepper) +{ + int retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + + retval = arkStep_AccessARKODEStepMem(inner_arkode_mem, + "ARKStepCreateMRIStepInnerStepper", + &ark_mem, &step_mem); + if (retval) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "The ARKStep memory pointer is NULL"); + return ARK_ILL_INPUT; + } + + retval = MRIStepInnerStepper_Create(ark_mem->sunctx, stepper); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetContent(*stepper, inner_arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetEvolveFn(*stepper, arkStep_MRIStepInnerEvolve); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, + arkStep_MRIStepInnerFullRhs); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetResetFn(*stepper, arkStep_MRIStepInnerReset); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARK_SUCCESS); +} + +/*=============================================================== + Interface routines supplied to ARKODE + ===============================================================*/ + /*--------------------------------------------------------------- arkStep_Resize: @@ -378,81 +498,6 @@ int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKStepReInit: - - This routine re-initializes the ARKStep module to solve a new - problem of the same size as was previously solved. This routine - should also be called when the problem dynamics or desired solvers - have changed dramatically, so that the problem integration should - resume as if started from scratch. - - Note all internal counters are set to 0 on re-initialization. - ---------------------------------------------------------------*/ -int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, - N_Vector y0) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Check if ark_mem was allocated */ - if (ark_mem->MallocDone == SUNFALSE) - { - arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MALLOC); - return (ARK_NO_MALLOC); - } - - /* Check that at least one of fe, fi is supplied and is to be used */ - if (fe == NULL && fi == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_F); - return (ARK_ILL_INPUT); - } - - /* Check that y0 is supplied */ - if (y0 == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_Y0); - return (ARK_ILL_INPUT); - } - - /* Set implicit/explicit problem based on function pointers */ - step_mem->explicit = (fe == NULL) ? SUNFALSE : SUNTRUE; - step_mem->implicit = (fi == NULL) ? SUNFALSE : SUNTRUE; - - /* Copy the input parameters into ARKODE state */ - step_mem->fe = fe; - step_mem->fi = fi; - - /* Initialize initial error norm */ - step_mem->eRNrm = ONE; - - /* Initialize main ARKODE infrastructure */ - retval = arkInit(ark_mem, t0, y0, FIRST_INIT); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to reinitialize main ARKODE infrastructure"); - return (retval); - } - - /* Initialize all the counters */ - step_mem->nfe = 0; - step_mem->nfi = 0; - step_mem->nsetups = 0; - step_mem->nstlp = 0; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- arkStep_ComputeState: @@ -705,14 +750,6 @@ void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif } -/*=============================================================== - ARKStep Private functions - ===============================================================*/ - -/*--------------------------------------------------------------- - Interface routines supplied to ARKODE - ---------------------------------------------------------------*/ - /*--------------------------------------------------------------- arkStep_AttachLinsol: @@ -1986,9 +2023,9 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== Internal utility routines - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- arkStep_AccessARKODEStepMem: @@ -3042,51 +3079,9 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsmPtr) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - Utility routines for interfacing with MRIStep - ---------------------------------------------------------------*/ - -/*------------------------------------------------------------------------------ - ARKStepCreateMRIStepInnerStepper - - Wraps an ARKStep memory structure as an MRIStep inner stepper. - ----------------------------------------------------------------------------*/ - -int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, - MRIStepInnerStepper* stepper) -{ - int retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - - retval = arkStep_AccessARKODEStepMem(inner_arkode_mem, - "ARKStepCreateMRIStepInnerStepper", - &ark_mem, &step_mem); - if (retval) - { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "The ARKStep memory pointer is NULL"); - return ARK_ILL_INPUT; - } - - retval = MRIStepInnerStepper_Create(ark_mem->sunctx, stepper); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetContent(*stepper, inner_arkode_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetEvolveFn(*stepper, arkStep_MRIStepInnerEvolve); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, - arkStep_MRIStepInnerFullRhs); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetResetFn(*stepper, arkStep_MRIStepInnerReset); - if (retval != ARK_SUCCESS) { return (retval); } - - return (ARK_SUCCESS); -} +/*=============================================================== + Internal utility routines for interacting with MRIStep + ===============================================================*/ /*------------------------------------------------------------------------------ arkStep_MRIStepInnerEvolve @@ -3331,6 +3326,10 @@ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, return (0); } +/*=============================================================== + Internal utility routines for relaxation + ===============================================================*/ + /* ----------------------------------------------------------------------------- * arkStep_RelaxDeltaE * @@ -3349,7 +3348,6 @@ int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, * be necessary to compute the delta_e estimate along the way with explicit * methods to avoid storing additional RHS or stage values. * ---------------------------------------------------------------------------*/ - int arkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* num_relax_jac_evals, sunrealtype* delta_e_out) { @@ -3470,7 +3468,6 @@ int arkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, * * Returns the method order * ---------------------------------------------------------------------------*/ - int arkStep_GetOrder(ARKodeMem ark_mem) { ARKodeARKStepMem step_mem = (ARKodeARKStepMem)(ark_mem->step_mem); diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index f1e2fb1715..5a020b32a7 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -19,7 +19,6 @@ #define _ARKODE_ARKSTEP_IMPL_H #include <arkode/arkode_arkstep.h> -/* access to MRIStepInnerStepper_Create */ #include <arkode/arkode_mristep.h> #include "arkode_impl.h" @@ -33,13 +32,16 @@ extern "C" { ARK time step module constants ===============================================================*/ -#define MAXCOR 3 /* max number of nonlinear iterations */ -#define CRDOWN \ - SUN_RCONST(0.3) /* constant to estimate the convergence - rate for the nonlinear equation */ -#define DGMAX SUN_RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ -#define RDIV SUN_RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ -#define MSBP 20 /* max no. of steps between lsetup calls */ +/* max number of nonlinear iterations */ +#define MAXCOR 3 +/* constant to estimate the convergence rate for the nonlinear equation */ +#define CRDOWN SUN_RCONST(0.3) +/* if |gamma/gammap-1| > DGMAX then call lsetup */ +#define DGMAX SUN_RCONST(0.2) +/* declare divergence if ratio del/delp > RDIV */ +#define RDIV SUN_RCONST(2.3) +/* max no. of steps between lsetup calls */ +#define MSBP 20 /* Default solver tolerance factor */ /* #define NLSCOEF SUN_RCONST(0.003) */ /* Hairer & Wanner constant */ diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 66e1a5bb87..a95ddf9f30 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -27,826 +27,1020 @@ #include "arkode_arkstep_impl.h" /*=============================================================== - ARKStep Optional input functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. + Exported optional input functions. ===============================================================*/ -int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} - -int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) -{ - return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); -} - -int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} +/*--------------------------------------------------------------- + ARKStepSetExplicit: -int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) + Specifies that the implicit portion of the problem is disabled, + and to use an explicit RK method. + ---------------------------------------------------------------*/ +int ARKStepSetExplicit(void* arkode_mem) { - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -void ARKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + /* ensure that fe is defined */ + if (step_mem->fe == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FE); + return (ARK_ILL_INPUT); + } -void ARKStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} + /* set the relevant parameters */ + step_mem->explicit = SUNTRUE; + step_mem->implicit = SUNFALSE; -int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - return (ARKodeSStolerances(arkode_mem, reltol, abstol)); + return (ARK_SUCCESS); } -int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); -} +/*--------------------------------------------------------------- + ARKStepSetImplicit: -int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) + Specifies that the explicit portion of the problem is disabled, + and to use an implicit RK method. + ---------------------------------------------------------------*/ +int ARKStepSetImplicit(void* arkode_mem) { - return (ARKodeWFtolerances(arkode_mem, efun)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) -{ - return (ARKodeResStolerance(arkode_mem, rabstol)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) -{ - return (ARKodeResVtolerance(arkode_mem, rabstol)); -} + /* ensure that fi is defined */ + if (step_mem->fi == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FI); + return (ARK_ILL_INPUT); + } -int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) -{ - return (ARKodeResFtolerance(arkode_mem, rfun)); -} + /* set the relevant parameters */ + step_mem->implicit = SUNTRUE; + step_mem->explicit = SUNFALSE; -int ARKStepSetDenseOrder(void* arkode_mem, int dord) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, dord)); -} + /* re-attach internal error weight functions if necessary */ + if (!ark_mem->user_efun) + { + if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) + { + retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + } + else + { + retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + } + if (retval != ARK_SUCCESS) { return (retval); } + } -int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, degree)); + return (ARK_SUCCESS); } -int ARKStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} +/*--------------------------------------------------------------- + ARKStepSetImEx: -int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) + Specifies that the specifies that problem has both implicit and + explicit parts, and to use an ARK method (this is the default). + ---------------------------------------------------------------*/ +int ARKStepSetImEx(void* arkode_mem) { - return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) -{ - return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin) -{ - return (ARKodeSetInitStep(arkode_mem, hin)); -} + /* ensure that fe and fi are defined */ + if (step_mem->fe == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FE); + return (ARK_ILL_INPUT); + } + if (step_mem->fi == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_FI); + return (ARK_ILL_INPUT); + } -int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) -{ - return (ARKodeSetMinStep(arkode_mem, hmin)); -} + /* set the relevant parameters */ + step_mem->explicit = SUNTRUE; + step_mem->implicit = SUNTRUE; -int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) -{ - return (ARKodeSetMaxStep(arkode_mem, hmax)); -} + /* re-attach internal error weight functions if necessary */ + if (!ark_mem->user_efun) + { + if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) + { + retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); + } + else + { + retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); + } + if (retval != ARK_SUCCESS) { return (retval); } + } -int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); + return (ARK_SUCCESS); } -int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) -{ - return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); -} +/*--------------------------------------------------------------- + ARKStepSetTables: -int ARKStepClearStopTime(void* arkode_mem) -{ - return (ARKodeClearStopTime(arkode_mem)); -} + Specifies to use customized Butcher tables for the system. -int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) -{ - return (ARKodeSetRootDirection(arkode_mem, rootdir)); -} + If Bi is NULL, then this sets the integrator in 'explicit' mode. -int ARKStepSetNoInactiveRootWarn(void* arkode_mem) -{ - return (ARKodeSetNoInactiveRootWarn(arkode_mem)); -} + If Be is NULL, then this sets the integrator in 'implicit' mode. -int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) + Returns ARK_ILL_INPUT if both Butcher tables are not supplied. + ---------------------------------------------------------------*/ +int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, + ARKodeButcherTable Be) { - return (ARKodeSetConstraints(arkode_mem, constraints)); -} + int retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; -int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) -{ - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); -} + /* check for illegal inputs */ + if ((Bi == NULL) && (Be == NULL)) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "At least one complete table must be supplied"); + return (ARK_ILL_INPUT); + } -int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) -{ - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} + /* if both tables are set, check that they have the same number of stages */ + if ((Bi != NULL) && (Be != NULL)) + { + if (Bi->stages != Be->stages) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Both tables must have the same number of stages"); + return (ARK_ILL_INPUT); + } + } -int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) -{ - return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) -{ - return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); -} - -int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) -{ - return (ARKodeSetSafetyFactor(arkode_mem, safety)); -} - -int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) -{ - return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); -} + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Be); + step_mem->Be = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) -{ - return (ARKodeSetMinReduction(arkode_mem, eta_min)); -} + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Bi); + step_mem->Bi = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) -{ - return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); -} + /* + * determine mode (implicit/explicit/ImEx), and perform appropriate actions + */ -int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) -{ - return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); -} + /* explicit */ + if (Bi == NULL) + { + /* set the relevant parameters (use table q and p) */ + step_mem->stages = Be->stages; + step_mem->q = Be->q; + step_mem->p = Be->p; -int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) -{ - return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); -} + /* copy the table in step memory */ + step_mem->Be = ARKodeButcherTable_Copy(Be); + if (step_mem->Be == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) -{ - return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); -} + /* set method as purely explicit */ + retval = ARKStepSetExplicit(arkode_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetExplicit"); + return (retval); + } -int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) -{ - return (ARKodeSetMaxCFailGrowth(arkode_mem, etacf)); -} + /* implicit */ + } + else if (Be == NULL) + { + /* set the relevant parameters (use table q and p) */ + step_mem->stages = Bi->stages; + step_mem->q = Bi->q; + step_mem->p = Bi->p; -int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) -{ - return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); -} + /* copy the table in step memory */ + step_mem->Bi = ARKodeButcherTable_Copy(Bi); + if (step_mem->Bi == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) -{ - return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); -} + /* set method as purely implicit */ + retval = ARKStepSetImplicit(arkode_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetImplicit"); + return (ARK_ILL_INPUT); + } -int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) -{ - return (ARKodeSetMaxConvFails(arkode_mem, maxncf)); -} + /* ImEx */ + } + else + { + /* set the relevant parameters (use input q and p) */ + step_mem->stages = Bi->stages; + step_mem->q = q; + step_mem->p = p; -int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) -{ - return (ARKodeSetAdaptController(arkode_mem, C)); -} + /* copy the explicit table into step memory */ + step_mem->Be = ARKodeButcherTable_Copy(Be); + if (step_mem->Be == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) -{ - return (ARKodeSetFixedStep(arkode_mem, hfixed)); -} + /* copy the implicit table into step memory */ + step_mem->Bi = ARKodeButcherTable_Copy(Bi); + if (step_mem->Bi == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -int ARKStepSetUserData(void* arkode_mem, void* user_data) -{ - return (ARKodeSetUserData(arkode_mem, user_data)); -} + /* set method as ImEx */ + retval = ARKStepSetImEx(arkode_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetImEx"); + return (ARK_ILL_INPUT); + } + } -int ARKStepSetDefaults(void* arkode_mem) -{ - return (ARKodeSetDefaults(arkode_mem)); -} + /* note Butcher table space requirements */ + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ark_mem->liw += Bliw; + ark_mem->lrw += Blrw; -int ARKStepSetOrder(void* arkode_mem, int ord) -{ - return (ARKodeSetOrder(arkode_mem, ord)); -} + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ark_mem->liw += Bliw; + ark_mem->lrw += Blrw; -int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) -{ - return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); + return (ARK_SUCCESS); } -int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) -{ - return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); -} +/*--------------------------------------------------------------- + ARKStepSetTableNum: -int ARKStepSetLinear(void* arkode_mem, int timedepend) -{ - return (ARKodeSetLinear(arkode_mem, timedepend)); -} + Specifies to use pre-existing Butcher tables for the system, + based on the integer flags passed to + ARKodeButcherTable_LoadERK() and ARKodeButcherTable_LoadDIRK() + within the files arkode_butcher_erk.c and arkode_butcher_dirk.c + (automatically calls ARKStepSetImEx). -int ARKStepSetNonlinear(void* arkode_mem) -{ - return (ARKodeSetNonlinear(arkode_mem)); -} + If either argument is negative (illegal), then this disables the + corresponding table (e.g. itable = -1 -> explicit) -int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) + Note: this routine should NOT be used in conjunction with + ARKodeSetOrder. + ---------------------------------------------------------------*/ +int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, + ARKODE_ERKTableID etable) { - return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); -} + int flag, retval; + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; -int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) -{ - return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) -{ - return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) -{ - return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); -} + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Be); + step_mem->Be = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) -{ - return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); -} + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Bi); + step_mem->Bi = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) -{ - return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); -} + /* determine mode (implicit/explicit/ImEx), and perform + appropriate actions */ -int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) -{ - return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); -} + /* illegal inputs */ + if ((itable < 0) && (etable < 0)) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "At least one valid table number must be supplied"); + return (ARK_ILL_INPUT); -int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) -{ - return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); -} + /* explicit */ + } + else if (itable < 0) + { + /* check that argument specifies an explicit table */ + if (etable < ARKODE_MIN_ERK_NUM || etable > ARKODE_MAX_ERK_NUM) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal ERK table number"); + return (ARK_ILL_INPUT); + } -int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) -{ - return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); -} + /* fill in table based on argument */ + step_mem->Be = ARKodeButcherTable_LoadERK(etable); + if (step_mem->Be == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Error setting explicit table with that index"); + return (ARK_ILL_INPUT); + } + step_mem->stages = step_mem->Be->stages; + step_mem->q = step_mem->Be->q; + step_mem->p = step_mem->Be->p; -/*--------------------------------------------------------------- - These wrappers for ARKLs module 'set' routines all are - documented in arkode_arkstep.h. - ---------------------------------------------------------------*/ -int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) -{ - return (ARKodeSetLinearSolver(arkode_mem, LS, A)); -} + /* set method as purely explicit */ + flag = ARKStepSetExplicit(arkode_mem); + if (flag != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetExplicit"); + return (flag); + } -int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix M, sunbooleantype time_dep) -{ - return (ARKodeSetMassLinearSolver(arkode_mem, LS, M, time_dep)); -} + /* implicit */ + } + else if (etable < 0) + { + /* check that argument specifies an implicit table */ + if (itable < ARKODE_MIN_DIRK_NUM || itable > ARKODE_MAX_DIRK_NUM) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal IRK table number"); + return (ARK_ILL_INPUT); + } -int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) -{ - return (ARKodeSetJacFn(arkode_mem, jac)); -} + /* fill in table based on argument */ + step_mem->Bi = ARKodeButcherTable_LoadDIRK(itable); + if (step_mem->Bi == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Error setting table with that index"); + return (ARK_ILL_INPUT); + } + step_mem->stages = step_mem->Bi->stages; + step_mem->q = step_mem->Bi->q; + step_mem->p = step_mem->Bi->p; -int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) -{ - return (ARKodeSetMassFn(arkode_mem, mass)); -} + /* set method as purely implicit */ + flag = ARKStepSetImplicit(arkode_mem); + if (flag != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Error in ARKStepSetImplicit"); + return (flag); + } -int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) -{ - return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); -} + /* ImEx */ + } + else + { + /* ensure that tables match */ + if (!((etable == ARKODE_ARK324L2SA_ERK_4_2_3) && + (itable == ARKODE_ARK324L2SA_DIRK_4_2_3)) && + !((etable == ARKODE_ARK436L2SA_ERK_6_3_4) && + (itable == ARKODE_ARK436L2SA_DIRK_6_3_4)) && + !((etable == ARKODE_ARK437L2SA_ERK_7_3_4) && + (itable == ARKODE_ARK437L2SA_DIRK_7_3_4)) && + !((etable == ARKODE_ARK548L2SA_ERK_8_4_5) && + (itable == ARKODE_ARK548L2SA_DIRK_8_4_5)) && + !((etable == ARKODE_ARK548L2SAb_ERK_8_4_5) && + (itable == ARKODE_ARK548L2SAb_DIRK_8_4_5)) && + !((etable == ARKODE_ARK2_ERK_3_1_2) && (itable == ARKODE_ARK2_DIRK_3_1_2))) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Incompatible Butcher tables for ARK method"); + return (ARK_ILL_INPUT); + } -int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) -{ - return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); -} + /* fill in tables based on arguments */ + step_mem->Bi = ARKodeButcherTable_LoadDIRK(itable); + step_mem->Be = ARKodeButcherTable_LoadERK(etable); + if (step_mem->Bi == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal IRK table number"); + return (ARK_ILL_INPUT); + } + if (step_mem->Be == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal ERK table number"); + return (ARK_ILL_INPUT); + } + step_mem->stages = step_mem->Bi->stages; + step_mem->q = step_mem->Bi->q; + step_mem->p = step_mem->Bi->p; -int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) -{ - return (ARKodeSetEpsLin(arkode_mem, eplifac)); -} + /* set method as ImEx */ + if (ARKStepSetImEx(arkode_mem) != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_MISSING_F); + return (ARK_ILL_INPUT); + } + } -int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) -{ - return (ARKodeSetMassEpsLin(arkode_mem, eplifac)); + return (ARK_SUCCESS); } -int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) -{ - return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); -} +/*--------------------------------------------------------------- + ARKStepSetTableName: -int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) -{ - return (ARKodeSetMassLSNormFactor(arkode_mem, nrmfac)); -} + Specifies to use pre-existing Butcher tables for the system, + based on the string passed to + ARKodeButcherTable_LoadERKByName() and + ARKodeButcherTable_LoadDIRKByName() within the files + arkode_butcher_erk.c and arkode_butcher_dirk.c (automatically + calls ARKStepSetImEx). -int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve) + If itable is "ARKODE_DIRK_NONE" or etable is "ARKODE_ERK_NONE", + then this disables the corresponding table. + ---------------------------------------------------------------*/ +int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable) { - return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); + return (ARKStepSetTableNum(arkode_mem, arkButcherTableDIRKNameToID(itable), + arkButcherTableERKNameToID(etable))); } -int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve) -{ - return (ARKodeSetMassPreconditioner(arkode_mem, psetup, psolve)); -} +/*=============================================================== + Exported optional output functions. + ===============================================================*/ -int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes) -{ - return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); -} +/*--------------------------------------------------------------- + ARKStepGetNumRhsEvals: -int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) + Returns the current number of calls to fe and fi + ---------------------------------------------------------------*/ +int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_evals) { - return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data) -{ - return (ARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) -{ - return (ARKodeSetLinSysFn(arkode_mem, linsys)); -} + /* get values from step_mem */ + *fe_evals = step_mem->nfe; + *fi_evals = step_mem->nfi; -/*=============================================================== - ARKStep Optional output functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. - ===============================================================*/ -int ARKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) -{ - return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); + return (ARK_SUCCESS); } -int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumSteps(arkode_mem, nsteps)); -} +/*--------------------------------------------------------------- + ARKStepGetCurrentButcherTables: -int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) + Sets pointers to the explicit and implicit Butcher tables + currently in use. + ---------------------------------------------------------------*/ +int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, + ARKodeButcherTable* Be) { - return (ARKodeGetActualInitStep(arkode_mem, hinused)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) -{ - return (ARKodeGetLastStep(arkode_mem, hlast)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) -{ - return (ARKodeGetCurrentStep(arkode_mem, hcur)); + /* get tables from step_mem */ + *Bi = step_mem->Bi; + *Be = step_mem->Be; + return (ARK_SUCCESS); } -int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) -{ - return (ARKodeGetCurrentTime(arkode_mem, tcur)); -} +/*--------------------------------------------------------------- + ARKStepGetTimestepperStats: -int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state) -{ - return (ARKodeGetCurrentState(arkode_mem, state)); -} - -int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) + Returns integrator statistics + ---------------------------------------------------------------*/ +int ARKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, + long int* accsteps, long int* step_attempts, + long int* fe_evals, long int* fi_evals, + long int* nlinsetups, long int* netfails) { - return (ARKodeComputeState(arkode_mem, zcor, z)); -} + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) -{ - return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); -} + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) -{ - return (ARKodeGetErrWeights(arkode_mem, eweight)); -} + /* set expsteps and accsteps from adaptivity structure */ + *expsteps = ark_mem->hadapt_mem->nst_exp; + *accsteps = ark_mem->hadapt_mem->nst_acc; -int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) -{ - return (ARKodeGetResWeights(arkode_mem, rweight)); -} + /* set remaining outputs */ + *step_attempts = ark_mem->nst_attempts; + *fe_evals = step_mem->nfe; + *fi_evals = step_mem->nfi; + *nlinsetups = step_mem->nsetups; + *netfails = ark_mem->netf; -int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) -{ - return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); + return (ARK_SUCCESS); } -int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) -{ - return (ARKodeGetNumGEvals(arkode_mem, ngevals)); -} +/*=============================================================== + Private functions attached to ARKODE + ===============================================================*/ -int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} +/*--------------------------------------------------------------- + arkStep_SetRelaxFn: -int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) + Sets up the relaxation module using ARKStep's utility routines. + ---------------------------------------------------------------*/ +int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); + return ( + arkRelaxCreate(ark_mem, rfn, rjac, arkStep_RelaxDeltaE, arkStep_GetOrder)); } -int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} +/*--------------------------------------------------------------- + arkStep_SetUserData: -int ARKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) + Passes user-data pointer to attached linear solver modules. + ---------------------------------------------------------------*/ +int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) { - return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) -{ - return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); -} + /* set user data in ARKODE LS mem */ + if (step_mem->lmem != NULL) + { + retval = arkLSSetUserData(ark_mem, user_data); + if (retval != ARKLS_SUCCESS) { return (retval); } + } -int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) -{ - return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, - sdata, user_data)); -} + /* set user data in ARKODE LSMass mem */ + if (step_mem->mass_mem != NULL) + { + retval = arkLSSetMassUserData(ark_mem, user_data); + if (retval != ARKLS_SUCCESS) { return (retval); } + } -int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) -{ - return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); + return (ARK_SUCCESS); } -int ARKStepGetUserData(void* arkode_mem, void** user_data) -{ - return (ARKodeGetUserData(arkode_mem, user_data)); -} +/*--------------------------------------------------------------- + arkStep_SetDefaults: -char* ARKStepGetReturnFlagName(long int flag) + Resets all ARKStep optional inputs to their default values. + Does not change problem-defining function pointers or + user_data pointer. Also leaves alone any data + structures/options related to the ARKODE infrastructure itself + (e.g., root-finding and post-process step). + ---------------------------------------------------------------*/ +int arkStep_SetDefaults(ARKodeMem ark_mem) { - return (ARKodeGetReturnFlagName(flag)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) -{ - return (ARKodeGetCurrentGamma(arkode_mem, gamma)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) -{ - return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); + /* Set default values for integrator optional inputs */ + step_mem->q = Q_DEFAULT; /* method order */ + step_mem->p = 0; /* embedding order */ + step_mem->predictor = 0; /* trivial predictor */ + step_mem->linear = SUNFALSE; /* nonlinear problem */ + step_mem->linear_timedep = SUNTRUE; /* dfi/dy depends on t */ + step_mem->explicit = SUNTRUE; /* fe(t,y) will be used */ + step_mem->implicit = SUNTRUE; /* fi(t,y) will be used */ + step_mem->deduce_rhs = SUNFALSE; /* deduce fi on result of NLS */ + step_mem->maxcor = MAXCOR; /* max nonlinear iters/stage */ + step_mem->nlscoef = NLSCOEF; /* nonlinear tolerance coefficient */ + step_mem->crdown = CRDOWN; /* nonlinear convergence estimate coeff. */ + step_mem->rdiv = RDIV; /* nonlinear divergence tolerance */ + step_mem->dgmax = DGMAX; /* max step change before recomputing J or P */ + step_mem->msbp = MSBP; /* max steps between updates to J or P */ + step_mem->stages = 0; /* no stages */ + step_mem->istage = 0; /* current stage */ + step_mem->Be = NULL; /* no Butcher tables */ + step_mem->Bi = NULL; + step_mem->NLS = NULL; /* no nonlinear solver object */ + step_mem->jcur = SUNFALSE; + step_mem->convfail = ARK_NO_FAILURES; + step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + return (ARK_SUCCESS); } -int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) -{ - return (ARKodeGetEstLocalErrors(arkode_mem, ele)); -} +/*--------------------------------------------------------------- + arkStep_SetOrder: -int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) + Specifies the method order + ---------------------------------------------------------------*/ +int arkStep_SetOrder(ARKodeMem ark_mem, int ord) { - return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); -} + ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; + int retval; -int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) -{ - return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails) -{ - return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); + /* set user-provided value, or default, depending on argument */ + if (ord <= 0) { step_mem->q = Q_DEFAULT; } + else { step_mem->q = ord; } + + /* clear Butcher tables, since user is requesting a change in method + or a reset to defaults. Tables will be set in ARKInitialSetup. */ + step_mem->stages = 0; + step_mem->istage = 0; + step_mem->p = 0; + + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Be); + step_mem->Be = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->Bi); + step_mem->Bi = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - These wrappers for ARKLs module 'get' routines all are - documented in arkode_arkstep.h. - ---------------------------------------------------------------*/ -int ARKStepGetJac(void* arkode_mem, SUNMatrix* J) -{ - return (ARKodeGetJac(arkode_mem, J)); -} + arkStep_SetLinear: -int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J) -{ - return (ARKodeGetJacTime(arkode_mem, t_J)); -} + Specifies that the implicit portion of the problem is linear, + and to tighten the linear solver tolerances while taking only + one Newton iteration. DO NOT USE IN COMBINATION WITH THE + FIXED-POINT SOLVER. Automatically tightens DeltaGammaMax + to ensure that step size changes cause Jacobian recomputation. -int ARKStepGetJacNumSteps(void* arkode_mem, long* nst_J) + The argument should be 1 or 0, where 1 indicates that the + Jacobian of fi with respect to y depends on time, and + 0 indicates that it is not time dependent. Alternately, when + using an iterative linear solver this flag denotes time + dependence of the preconditioner. + ---------------------------------------------------------------*/ +int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend) { - return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) -{ - return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) -{ - return (ARKodeGetNumJacEvals(arkode_mem, njevals)); -} + /* set parameters */ + step_mem->linear = SUNTRUE; + step_mem->linear_timedep = (timedepend == 1); + step_mem->dgmax = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; -int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) -{ - return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); + return (ARK_SUCCESS); } -int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) -{ - return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); -} +/*--------------------------------------------------------------- + arkStep_SetNonlinear: -int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) + Specifies that the implicit portion of the problem is nonlinear. + Used to undo a previous call to arkStep_SetLinear. Automatically + loosens DeltaGammaMax back to default value. + ---------------------------------------------------------------*/ +int arkStep_SetNonlinear(ARKodeMem ark_mem) { - return (ARKodeGetNumLinIters(arkode_mem, nliters)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) -{ - return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) -{ - return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); -} + /* set parameters */ + step_mem->linear = SUNFALSE; + step_mem->linear_timedep = SUNTRUE; + step_mem->dgmax = DGMAX; -int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) -{ - return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); + return (ARK_SUCCESS); } -int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) -{ - return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); -} +/*--------------------------------------------------------------- + arkStep_SetNonlinCRDown: -int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag) + Specifies the user-provided nonlinear convergence constant + crdown. Legal values are strictly positive; illegal values + imply a reset to the default. + ---------------------------------------------------------------*/ +int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) { - return (ARKodeGetLastLinFlag(arkode_mem, flag)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, - long int* leniwMLS) -{ - return (ARKodeGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) -{ - return (ARKodeGetNumMassSetups(arkode_mem, nmsetups)); -} + /* if argument legal set it, otherwise set default */ + if (crdown <= ZERO) { step_mem->crdown = CRDOWN; } + else { step_mem->crdown = crdown; } -int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) -{ - return (ARKodeGetNumMassMultSetups(arkode_mem, nmvsetups)); + return (ARK_SUCCESS); } -int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals) -{ - return (ARKodeGetNumMassMult(arkode_mem, nmvevals)); -} +/*--------------------------------------------------------------- + arkStep_SetNonlinRDiv: -int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) + Specifies the user-provided nonlinear convergence constant + rdiv. Legal values are strictly positive; illegal values + imply a reset to the default. + ---------------------------------------------------------------*/ +int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) { - return (ARKodeGetNumMassSolves(arkode_mem, nmsolves)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) -{ - return (ARKodeGetNumMassPrecEvals(arkode_mem, nmpevals)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) -{ - return (ARKodeGetNumMassPrecSolves(arkode_mem, nmpsolves)); -} + /* if argument legal set it, otherwise set default */ + if (rdiv <= ZERO) { step_mem->rdiv = RDIV; } + else { step_mem->rdiv = rdiv; } -int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) -{ - return (ARKodeGetNumMassIters(arkode_mem, nmiters)); + return (ARK_SUCCESS); } -int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) -{ - return (ARKodeGetNumMassConvFails(arkode_mem, nmcfails)); -} +/*--------------------------------------------------------------- + arkStep_SetDeltaGammaMax: -int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups) + Specifies the user-provided linear setup decision constant + dgmax. Legal values are strictly positive; illegal values imply + a reset to the default. + ---------------------------------------------------------------*/ +int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) { - return (ARKodeGetNumMTSetups(arkode_mem, nmtsetups)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) -{ - return (ARKodeGetCurrentMassMatrix(arkode_mem, M)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag) -{ - return (ARKodeGetLastMassFlag(arkode_mem, flag)); -} + /* if argument legal set it, otherwise set default */ + if (dgmax <= ZERO) { step_mem->dgmax = DGMAX; } + else { step_mem->dgmax = dgmax; } -char* ARKStepGetLinReturnFlagName(long int flag) -{ - return (ARKodeGetLinReturnFlagName(flag)); + return (ARK_SUCCESS); } -/* ----------------------------------------------------------------------------- - * Wrappers for the ARKODE relaxation module - * ---------------------------------------------------------------------------*/ - -/* ARKStep-specific utility routine */ -int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) -{ - return ( - arkRelaxCreate(ark_mem, rfn, rjac, arkStep_RelaxDeltaE, arkStep_GetOrder)); -} +/*--------------------------------------------------------------- + arkStep_SetLSetupFrequency: -int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) + Specifies the user-provided linear setup decision constant + msbp. Positive values give the frequency for calling lsetup; + negative values imply recomputation of lsetup at each nonlinear + solve; a zero value implies a reset to the default. + ---------------------------------------------------------------*/ +int arkStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) { - return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) -{ - return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) -{ - return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); -} + /* if argument legal set it, otherwise set default */ + if (msbp == 0) { step_mem->msbp = MSBP; } + else { step_mem->msbp = msbp; } -int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) -{ - return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); + return (ARK_SUCCESS); } -int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) -{ - return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); -} +/*--------------------------------------------------------------- + arkStep_SetPredictorMethod: -int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) + Specifies the method to use for predicting implicit solutions. + Non-default choices are {1,2,3,4}, all others will use default + (trivial) predictor. + ---------------------------------------------------------------*/ +int arkStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) { - return (ARKodeSetRelaxSolver(arkode_mem, solver)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) -{ - return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) -{ - return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); -} + /* set parameter */ + step_mem->predictor = pred_method; -int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) -{ - return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); + return (ARK_SUCCESS); } -int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) -{ - return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); -} +/*--------------------------------------------------------------- + arkStep_SetMaxNonlinIters: -int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) + Specifies the maximum number of nonlinear iterations during + one solve. A non-positive input implies a reset to the + default value. + ---------------------------------------------------------------*/ +int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) { - return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); -} + ARKodeARKStepMem step_mem; + int retval; -int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) -{ - return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); -} + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) -{ - return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); -} + SUNFunctionBegin(ark_mem->sunctx); -int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) -{ - return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); -} + /* Return error message if no NLS module is present */ + if (step_mem->NLS == NULL) + { + arkProcessError(ark_mem, ARK_NLS_OP_ERR, __LINE__, __func__, __FILE__, + "No SUNNonlinearSolver object is present"); + return (ARK_ILL_INPUT); + } -int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) -{ - return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); -} + /* argument <= 0 sets default, otherwise set input */ + if (maxcor <= 0) { step_mem->maxcor = MAXCOR; } + else { step_mem->maxcor = maxcor; } -int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) -{ - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); + /* send argument to NLS structure */ + retval = SUNNonlinSolSetMaxIters(step_mem->NLS, step_mem->maxcor); + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_NLS_OP_ERR, __LINE__, __func__, __FILE__, + "Error setting maxcor in SUNNonlinearSolver object"); + return (ARK_NLS_OP_ERR); + } + + return (ARK_SUCCESS); } -int ARKStepWriteParameters(void* arkode_mem, FILE* fp) +/*--------------------------------------------------------------- + arkStep_SetNonlinConvCoef: + + Specifies the coefficient in the nonlinear solver convergence + test. A non-positive input implies a reset to the default value. + ---------------------------------------------------------------*/ +int arkStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) { - return (ARKodeWriteParameters(arkode_mem, fp)); + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* argument <= 0 sets default, otherwise set input */ + if (nlscoef <= ZERO) { step_mem->nlscoef = NLSCOEF; } + else { step_mem->nlscoef = nlscoef; } + + return (ARK_SUCCESS); } -/*=============================================================== - DEPRECATED ARKStep optional input/output functions - ===============================================================*/ +/*--------------------------------------------------------------- + arkStep_SetStagePredictFn: Specifies a user-provided step + predictor function having type ARKStagePredictFn. A + NULL input function disables calls to this routine. + ---------------------------------------------------------------*/ +int arkStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure and set function pointer */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + step_mem->stage_predict = PredictStage; + return (ARK_SUCCESS); +} /*--------------------------------------------------------------- - ARKStepSetAdaptivityMethod: user should create/attach a - specific SUNAdaptController object. + arkStep_SetDeduceImplicitRhs: + + Specifies if an optimization is used to avoid an evaluation of + fi after a nonlinear solve for an implicit stage. If stage + postprocessecing in enabled, this option is ignored, and fi is + never deduced. + + An argument of SUNTRUE indicates that fi is deduced to compute + fi(z_i), and SUNFALSE indicates that fi(z_i) is computed with + an additional evaluation of fi. ---------------------------------------------------------------*/ -int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, - int pq, sunrealtype adapt_params[3]) +int arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) { - return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure and set function pointer */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + step_mem->deduce_rhs = deduce; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKStepSetAdaptivityFn: user should create/attach a custom - SUNAdaptController object. + arkStep_GetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ -int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) +int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) { - return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); + int retval; + ARKodeARKStepMem step_mem; + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + *gamma = step_mem->gamma; + return (retval); } /*--------------------------------------------------------------- - ARKStepSetErrorBias: user should set this value directly in the - SUNAdaptController object. + arkStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector ---------------------------------------------------------------*/ -int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) +int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) { - return (ARKodeSetErrorBias(arkode_mem, bias)); + int retval; + ARKodeARKStepMem step_mem; + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* return an error if local truncation error is not computed */ + if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); + return (ARK_SUCCESS); } -/*=============================================================== - ARKStep optional input functions -- stepper-specific - ===============================================================*/ +/*--------------------------------------------------------------- + arkStep_GetNumLinSolvSetups: -int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) + Returns the current number of calls to the lsetup routine + ---------------------------------------------------------------*/ +int arkStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) { ARKodeARKStepMem step_mem; int retval; @@ -855,33 +1049,37 @@ int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* set user data in ARKODE LS mem */ - if (step_mem->lmem != NULL) - { - retval = arkLSSetUserData(ark_mem, user_data); - if (retval != ARKLS_SUCCESS) { return (retval); } - } + /* get value from step_mem */ + *nlinsetups = step_mem->nsetups; - /* set user data in ARKODE LSMass mem */ - if (step_mem->mass_mem != NULL) - { - retval = arkLSSetMassUserData(ark_mem, user_data); - if (retval != ARKLS_SUCCESS) { return (retval); } - } + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkStep_GetNumNonlinSolvIters: + + Returns the current number of nonlinear solver iterations + ---------------------------------------------------------------*/ +int arkStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + *nniters = step_mem->nls_iters; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - arkStep_SetDefaults: + arkStep_GetNumNonlinSolvConvFails: - Resets all ARKStep optional inputs to their default values. - Does not change problem-defining function pointers or - user_data pointer. Also leaves alone any data - structures/options related to the ARKODE infrastructure itself - (e.g., root-finding and post-process step). + Returns the current number of nonlinear solver convergence fails ---------------------------------------------------------------*/ -int arkStep_SetDefaults(ARKodeMem ark_mem) +int arkStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) { ARKodeARKStepMem step_mem; int retval; @@ -890,249 +1088,399 @@ int arkStep_SetDefaults(ARKodeMem ark_mem) retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Set default values for integrator optional inputs */ - step_mem->q = Q_DEFAULT; /* method order */ - step_mem->p = 0; /* embedding order */ - step_mem->predictor = 0; /* trivial predictor */ - step_mem->linear = SUNFALSE; /* nonlinear problem */ - step_mem->linear_timedep = SUNTRUE; /* dfi/dy depends on t */ - step_mem->explicit = SUNTRUE; /* fe(t,y) will be used */ - step_mem->implicit = SUNTRUE; /* fi(t,y) will be used */ - step_mem->deduce_rhs = SUNFALSE; /* deduce fi on result of NLS */ - step_mem->maxcor = MAXCOR; /* max nonlinear iters/stage */ - step_mem->nlscoef = NLSCOEF; /* nonlinear tolerance coefficient */ - step_mem->crdown = CRDOWN; /* nonlinear convergence estimate coeff. */ - step_mem->rdiv = RDIV; /* nonlinear divergence tolerance */ - step_mem->dgmax = DGMAX; /* max step change before recomputing J or P */ - step_mem->msbp = MSBP; /* max steps between updates to J or P */ - step_mem->stages = 0; /* no stages */ - step_mem->istage = 0; /* current stage */ - step_mem->Be = NULL; /* no Butcher tables */ - step_mem->Bi = NULL; - step_mem->NLS = NULL; /* no nonlinear solver object */ - step_mem->jcur = SUNFALSE; - step_mem->convfail = ARK_NO_FAILURES; - step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + /* set output from step_mem */ + *nnfails = step_mem->nls_fails; + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKStepSetOptimalParams: - - Sets all adaptivity and solver parameters to our 'best guess' - values, for a given ARKStep integration method (ERK, DIRK, ARK), - a given method order, and a given nonlinear solver type. Should - only be called after the method order, solver, and integration - method have been set, and only if time step adaptivity is - enabled. + arkStep_GetNonlinSolvStats: + + Returns nonlinear solver statistics ---------------------------------------------------------------*/ -int ARKStepSetOptimalParams(void* arkode_mem) +int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, + long int* nnfails) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - ARKodeHAdaptMem hadapt_mem; int retval; - long int lenrw, leniw; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* access ARKodeHAdaptMem structure */ - if (ark_mem->hadapt_mem == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARKADAPT_NO_MEM); - return (ARK_MEM_NULL); - } - hadapt_mem = ark_mem->hadapt_mem; + *nniters = step_mem->nls_iters; + *nnfails = step_mem->nls_fails; - /* Remove current SUNAdaptController object */ - retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); - if (retval == SUN_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 != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_Destroy failure"); - return (ARK_MEM_FAIL); - } - } - hadapt_mem->hcontroller = NULL; + return (ARK_SUCCESS); +} - /* Choose values based on method, order */ +/*--------------------------------------------------------------- + arkStep_PrintAllStats: - /* explicit */ - if (step_mem->explicit && !step_mem->implicit) + Prints integrator statistics + ---------------------------------------------------------------*/ +int arkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +{ + ARKodeARKStepMem step_mem; + ARKLsMem arkls_mem; + ARKLsMassMem arklsm_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + switch (fmt) { - hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) + case SUN_OUTPUTFORMAT_TABLE: + /* function evaluations */ + fprintf(outfile, "Explicit RHS fn evals = %ld\n", step_mem->nfe); + fprintf(outfile, "Implicit RHS fn evals = %ld\n", step_mem->nfi); + + /* nonlinear solver stats */ + fprintf(outfile, "NLS iters = %ld\n", step_mem->nls_iters); + fprintf(outfile, "NLS fails = %ld\n", step_mem->nls_fails); + if (ark_mem->nst > 0) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PI allocation failure"); - return (ARK_MEM_FAIL); + fprintf(outfile, "NLS iters per step = %" RSYM "\n", + (sunrealtype)step_mem->nls_iters / (sunrealtype)ark_mem->nst); } - (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.2)); - (void)SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, - SUN_RCONST(0.8), -SUN_RCONST(0.31)); - hadapt_mem->safety = SUN_RCONST(0.99); - hadapt_mem->growth = SUN_RCONST(25.0); - hadapt_mem->etamxf = SUN_RCONST(0.3); - hadapt_mem->pq = PQ; - /* implicit */ - } - else if (step_mem->implicit && !step_mem->explicit) - { - switch (step_mem->q) + /* linear solver stats */ + fprintf(outfile, "LS setups = %ld\n", step_mem->nsetups); + if (ark_mem->step_getlinmem(ark_mem)) { - 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, __LINE__, __func__, __FILE__, - "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 = SUN_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->hcontroller = SUNAdaptController_I(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); + fprintf(outfile, "Jac fn evals = %ld\n", arkls_mem->nje); + fprintf(outfile, "LS RHS fn evals = %ld\n", arkls_mem->nfeDQ); + fprintf(outfile, "Prec setup evals = %ld\n", arkls_mem->npe); + fprintf(outfile, "Prec solves = %ld\n", arkls_mem->nps); + fprintf(outfile, "LS iters = %ld\n", arkls_mem->nli); + fprintf(outfile, "LS fails = %ld\n", arkls_mem->ncfl); + fprintf(outfile, "Jac-times setups = %ld\n", + arkls_mem->njtsetup); + fprintf(outfile, "Jac-times evals = %ld\n", + arkls_mem->njtimes); + if (step_mem->nls_iters > 0) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_I allocation failure"); - return (ARK_MEM_FAIL); + fprintf(outfile, "LS iters per NLS iter = %" RSYM "\n", + (sunrealtype)arkls_mem->nli / (sunrealtype)step_mem->nls_iters); + fprintf(outfile, "Jac evals per NLS iter = %" RSYM "\n", + (sunrealtype)arkls_mem->nje / (sunrealtype)step_mem->nls_iters); + fprintf(outfile, "Prec evals per NLS iter = %" RSYM "\n", + (sunrealtype)arkls_mem->npe / (sunrealtype)step_mem->nls_iters); } - (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.9)); - hadapt_mem->safety = SUN_RCONST(0.957); - hadapt_mem->growth = SUN_RCONST(17.6); - hadapt_mem->etamxf = SUN_RCONST(0.45); - hadapt_mem->small_nef = SMALL_NEF; - hadapt_mem->etacf = ETACF; - hadapt_mem->pq = PQ; - step_mem->nlscoef = SUN_RCONST(0.22); - step_mem->crdown = SUN_RCONST(0.17); - step_mem->rdiv = SUN_RCONST(2.3); - step_mem->dgmax = SUN_RCONST(0.19); - step_mem->msbp = 60; - break; - case 4: - hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) + } + + /* mass solve stats */ + if (ark_mem->step_getmassmem(ark_mem)) + { + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); + fprintf(outfile, "Mass setups = %ld\n", + arklsm_mem->nmsetups); + fprintf(outfile, "Mass solves = %ld\n", + arklsm_mem->nmsolves); + fprintf(outfile, "Mass Prec setup evals = %ld\n", arklsm_mem->npe); + fprintf(outfile, "Mass Prec solves = %ld\n", arklsm_mem->nps); + fprintf(outfile, "Mass LS iters = %ld\n", arklsm_mem->nli); + fprintf(outfile, "Mass LS fails = %ld\n", arklsm_mem->ncfl); + fprintf(outfile, "Mass-times setups = %ld\n", + arklsm_mem->nmtsetup); + fprintf(outfile, "Mass-times evals = %ld\n", + arklsm_mem->nmtimes); + } + break; + + case SUN_OUTPUTFORMAT_CSV: + /* function evaluations */ + fprintf(outfile, ",Explicit RHS fn evals,%ld", step_mem->nfe); + fprintf(outfile, ",Implicit RHS fn evals,%ld", step_mem->nfi); + + /* nonlinear solver stats */ + fprintf(outfile, ",NLS iters,%ld", step_mem->nls_iters); + fprintf(outfile, ",NLS fails,%ld", step_mem->nls_fails); + if (ark_mem->nst > 0) + { + fprintf(outfile, ",NLS iters per step,%" RSYM, + (sunrealtype)step_mem->nls_iters / (sunrealtype)ark_mem->nst); + } + else { fprintf(outfile, ",NLS iters per step,0"); } + + /* linear solver stats */ + fprintf(outfile, ",LS setups,%ld", step_mem->nsetups); + if (ark_mem->step_getlinmem(ark_mem)) + { + arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); + fprintf(outfile, ",Jac fn evals,%ld", arkls_mem->nje); + fprintf(outfile, ",LS RHS fn evals,%ld", arkls_mem->nfeDQ); + fprintf(outfile, ",Prec setup evals,%ld", arkls_mem->npe); + fprintf(outfile, ",Prec solves,%ld", arkls_mem->nps); + fprintf(outfile, ",LS iters,%ld", arkls_mem->nli); + fprintf(outfile, ",LS fails,%ld", arkls_mem->ncfl); + fprintf(outfile, ",Jac-times setups,%ld", arkls_mem->njtsetup); + fprintf(outfile, ",Jac-times evals,%ld", arkls_mem->njtimes); + if (step_mem->nls_iters > 0) { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PID allocation failure"); - return (ARK_MEM_FAIL); + fprintf(outfile, ",LS iters per NLS iter,%" RSYM, + (sunrealtype)arkls_mem->nli / (sunrealtype)step_mem->nls_iters); + fprintf(outfile, ",Jac evals per NLS iter,%" RSYM, + (sunrealtype)arkls_mem->nje / (sunrealtype)step_mem->nls_iters); + fprintf(outfile, ",Prec evals per NLS iter,%" RSYM, + (sunrealtype)arkls_mem->npe / (sunrealtype)step_mem->nls_iters); } - (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.2)); - (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, - SUN_RCONST(0.535), - -SUN_RCONST(0.209), - SUN_RCONST(0.148)); - hadapt_mem->safety = SUN_RCONST(0.988); - hadapt_mem->growth = SUN_RCONST(31.5); - hadapt_mem->etamxf = SUN_RCONST(0.33); - hadapt_mem->small_nef = SMALL_NEF; - hadapt_mem->etacf = ETACF; - hadapt_mem->pq = PQ; - step_mem->nlscoef = SUN_RCONST(0.24); - step_mem->crdown = SUN_RCONST(0.26); - step_mem->rdiv = SUN_RCONST(2.3); - step_mem->dgmax = SUN_RCONST(0.16); - step_mem->msbp = 31; - break; - case 5: - hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) + else { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PID allocation failure"); - return (ARK_MEM_FAIL); + fprintf(outfile, ",LS iters per NLS iter,0"); + fprintf(outfile, ",Jac evals per NLS iter,0"); + fprintf(outfile, ",Prec evals per NLS iter,0"); } - (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(3.3)); - (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, - SUN_RCONST(0.56), -SUN_RCONST(0.338), - SUN_RCONST(0.14)); - hadapt_mem->safety = SUN_RCONST(0.937); - hadapt_mem->growth = SUN_RCONST(22.0); - hadapt_mem->etamxf = SUN_RCONST(0.44); - hadapt_mem->small_nef = SMALL_NEF; - hadapt_mem->etacf = ETACF; - hadapt_mem->pq = PQ; - step_mem->nlscoef = SUN_RCONST(0.25); - step_mem->crdown = SUN_RCONST(0.4); - step_mem->rdiv = SUN_RCONST(2.3); - step_mem->dgmax = SUN_RCONST(0.32); - step_mem->msbp = 31; - break; } - /* imex */ + /* mass solve stats */ + if (ark_mem->step_getmassmem(ark_mem)) + { + arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); + fprintf(outfile, ",Mass setups,%ld", arklsm_mem->nmsetups); + fprintf(outfile, ",Mass solves,%ld", arklsm_mem->nmsolves); + fprintf(outfile, ",Mass Prec setup evals,%ld", arklsm_mem->npe); + fprintf(outfile, ",Mass Prec solves,%ld", arklsm_mem->nps); + fprintf(outfile, ",Mass LS iters,%ld", arklsm_mem->nli); + fprintf(outfile, ",Mass LS fails,%ld", arklsm_mem->ncfl); + fprintf(outfile, ",Mass-times setups,%ld", arklsm_mem->nmtsetup); + fprintf(outfile, ",Mass-times evals,%ld", arklsm_mem->nmtimes); + } + fprintf(outfile, "\n"); + break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return (ARK_ILL_INPUT); } - else + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkStep_WriteParameters: + + Outputs all solver parameters to the provided file pointer. + ---------------------------------------------------------------*/ +int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* print integrator parameters to file */ + fprintf(fp, "ARKStep time step module parameters:\n"); + fprintf(fp, " Method order %i\n", step_mem->q); + if (step_mem->linear) { - switch (step_mem->q) + fprintf(fp, " Linear implicit problem"); + if (step_mem->linear_timedep) { - 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, __LINE__, __func__, __FILE__, - "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 = SUN_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->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); - if (hadapt_mem->hcontroller == NULL) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PID allocation failure"); - return (ARK_MEM_FAIL); - } + fprintf(fp, " (time-dependent Jacobian)\n"); + } + else { fprintf(fp, " (time-independent Jacobian)\n"); } + } + if (step_mem->explicit && step_mem->implicit) + { + fprintf(fp, " ImEx integrator\n"); + } + else if (step_mem->implicit) { fprintf(fp, " Implicit integrator\n"); } + else { fprintf(fp, " Explicit integrator\n"); } + + if (step_mem->implicit) + { + fprintf(fp, " Implicit predictor method = %i\n", step_mem->predictor); + fprintf(fp, " Implicit solver tolerance coefficient = %" RSYM "\n", + step_mem->nlscoef); + fprintf(fp, " Maximum number of nonlinear corrections = %i\n", + step_mem->maxcor); + fprintf(fp, " Nonlinear convergence rate constant = %" RSYM "\n", + step_mem->crdown); + fprintf(fp, " Nonlinear divergence tolerance = %" RSYM "\n", step_mem->rdiv); + fprintf(fp, " Gamma factor LSetup tolerance = %" RSYM "\n", step_mem->dgmax); + fprintf(fp, " Number of steps between LSetup calls = %i\n", step_mem->msbp); + } + fprintf(fp, "\n"); + + return (ARK_SUCCESS); +} + +/*=============================================================== + Exported-but-deprecated user-callable functions. + ===============================================================*/ + +int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); +} + +int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +{ + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); +} + +int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +{ + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); +} + +int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + return (ARKodeWFtolerances(arkode_mem, efun)); +} + +int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol) +{ + return (ARKodeResStolerance(arkode_mem, rabstol)); +} + +int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol) +{ + return (ARKodeResVtolerance(arkode_mem, rabstol)); +} + +int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun) +{ + return (ARKodeResFtolerance(arkode_mem, rfun)); +} + +int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) +{ + return (ARKodeSetLinearSolver(arkode_mem, LS, A)); +} + +int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix M, sunbooleantype time_dep) +{ + return (ARKodeSetMassLinearSolver(arkode_mem, LS, M, time_dep)); +} + +int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int ARKStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int ARKStepSetOptimalParams(void* arkode_mem) +{ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + ARKodeHAdaptMem hadapt_mem; + int retval; + long int lenrw, leniw; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* access ARKodeHAdaptMem structure */ + if (ark_mem->hadapt_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKADAPT_NO_MEM); + return (ARK_MEM_NULL); + } + hadapt_mem = ark_mem->hadapt_mem; + + /* Remove current SUNAdaptController object */ + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUN_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 != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "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->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PI allocation failure"); + return (ARK_MEM_FAIL); + } + (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, + SUN_RCONST(1.2)); + (void)SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, + SUN_RCONST(0.8), -SUN_RCONST(0.31)); + hadapt_mem->safety = SUN_RCONST(0.99); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->etamxf = SUN_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->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "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 = SUN_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->hcontroller = SUNAdaptController_I(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_I allocation failure"); + return (ARK_MEM_FAIL); + } (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.42)); - (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, - SUN_RCONST(0.54), -SUN_RCONST(0.36), - SUN_RCONST(0.14)); - hadapt_mem->safety = SUN_RCONST(0.965); - hadapt_mem->growth = SUN_RCONST(28.7); - hadapt_mem->etamxf = SUN_RCONST(0.46); + SUN_RCONST(1.9)); + hadapt_mem->safety = SUN_RCONST(0.957); + hadapt_mem->growth = SUN_RCONST(17.6); + hadapt_mem->etamxf = SUN_RCONST(0.45); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; @@ -1151,14 +1499,14 @@ int ARKStepSetOptimalParams(void* arkode_mem) return (ARK_MEM_FAIL); } (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.35)); + SUN_RCONST(1.2)); (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, - SUN_RCONST(0.543), - -SUN_RCONST(0.297), - SUN_RCONST(0.14)); - hadapt_mem->safety = SUN_RCONST(0.97); - hadapt_mem->growth = SUN_RCONST(25.0); - hadapt_mem->etamxf = SUN_RCONST(0.47); + SUN_RCONST(0.535), + -SUN_RCONST(0.209), + SUN_RCONST(0.148)); + hadapt_mem->safety = SUN_RCONST(0.988); + hadapt_mem->growth = SUN_RCONST(31.5); + hadapt_mem->etamxf = SUN_RCONST(0.33); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; @@ -1169,20 +1517,21 @@ int ARKStepSetOptimalParams(void* arkode_mem) step_mem->msbp = 31; break; case 5: - hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); if (hadapt_mem->hcontroller == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_PI allocation failure"); + "SUNAdaptController_PID allocation failure"); return (ARK_MEM_FAIL); } (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, - SUN_RCONST(1.15)); - (void)SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, - SUN_RCONST(0.8), -SUN_RCONST(0.35)); - hadapt_mem->safety = SUN_RCONST(0.993); - hadapt_mem->growth = SUN_RCONST(28.5); - hadapt_mem->etamxf = SUN_RCONST(0.3); + SUN_RCONST(3.3)); + (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, + SUN_RCONST(0.56), -SUN_RCONST(0.338), + SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.937); + hadapt_mem->growth = SUN_RCONST(22.0); + hadapt_mem->etamxf = SUN_RCONST(0.44); hadapt_mem->small_nef = SMALL_NEF; hadapt_mem->etacf = ETACF; hadapt_mem->pq = PQ; @@ -1193,1220 +1542,588 @@ int ARKStepSetOptimalParams(void* arkode_mem) step_mem->msbp = 31; break; } - hadapt_mem->owncontroller = SUNTRUE; - retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw += leniw; - ark_mem->lrw += lenrw; - } - } - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_SetOrder: - - Specifies the method order - ---------------------------------------------------------------*/ -int arkStep_SetOrder(ARKodeMem ark_mem, int ord) -{ - ARKodeARKStepMem step_mem; - sunindextype Blrw, Bliw; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set user-provided value, or default, depending on argument */ - if (ord <= 0) { step_mem->q = Q_DEFAULT; } - else { step_mem->q = ord; } - - /* clear Butcher tables, since user is requesting a change in method - or a reset to defaults. Tables will be set in ARKInitialSetup. */ - step_mem->stages = 0; - step_mem->istage = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Be); - step_mem->Be = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Bi); - step_mem->Bi = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_SetLinear: - - Specifies that the implicit portion of the problem is linear, - and to tighten the linear solver tolerances while taking only - one Newton iteration. DO NOT USE IN COMBINATION WITH THE - FIXED-POINT SOLVER. Automatically tightens DeltaGammaMax - to ensure that step size changes cause Jacobian recomputation. - - The argument should be 1 or 0, where 1 indicates that the - Jacobian of fi with respect to y depends on time, and - 0 indicates that it is not time dependent. Alternately, when - using an iterative linear solver this flag denotes time - dependence of the preconditioner. - ---------------------------------------------------------------*/ -int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set parameters */ - step_mem->linear = SUNTRUE; - step_mem->linear_timedep = (timedepend == 1); - step_mem->dgmax = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_SetNonlinear: - - Specifies that the implicit portion of the problem is nonlinear. - Used to undo a previous call to arkStep_SetLinear. Automatically - loosens DeltaGammaMax back to default value. - ---------------------------------------------------------------*/ -int arkStep_SetNonlinear(ARKodeMem ark_mem) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set parameters */ - step_mem->linear = SUNFALSE; - step_mem->linear_timedep = SUNTRUE; - step_mem->dgmax = DGMAX; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetExplicit: - - Specifies that the implicit portion of the problem is disabled, - and to use an explicit RK method. - ---------------------------------------------------------------*/ -int ARKStepSetExplicit(void* arkode_mem) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* ensure that fe is defined */ - if (step_mem->fe == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_FE); - return (ARK_ILL_INPUT); - } - - /* set the relevant parameters */ - step_mem->explicit = SUNTRUE; - step_mem->implicit = SUNFALSE; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetImplicit: - - Specifies that the explicit portion of the problem is disabled, - and to use an implicit RK method. - ---------------------------------------------------------------*/ -int ARKStepSetImplicit(void* arkode_mem) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* ensure that fi is defined */ - if (step_mem->fi == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_FI); - return (ARK_ILL_INPUT); - } - - /* set the relevant parameters */ - step_mem->implicit = SUNTRUE; - step_mem->explicit = SUNFALSE; - - /* re-attach internal error weight functions if necessary */ - if (!ark_mem->user_efun) - { - if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) - { - retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); - } - else - { - retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); - } - if (retval != ARK_SUCCESS) { return (retval); } - } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetImEx: - - Specifies that the specifies that problem has both implicit and - explicit parts, and to use an ARK method (this is the default). - ---------------------------------------------------------------*/ -int ARKStepSetImEx(void* arkode_mem) -{ - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* ensure that fe and fi are defined */ - if (step_mem->fe == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_FE); - return (ARK_ILL_INPUT); - } - if (step_mem->fi == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_FI); - return (ARK_ILL_INPUT); - } - - /* set the relevant parameters */ - step_mem->explicit = SUNTRUE; - step_mem->implicit = SUNTRUE; - - /* re-attach internal error weight functions if necessary */ - if (!ark_mem->user_efun) - { - if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL) - { - retval = ARKodeSVtolerances(ark_mem, ark_mem->reltol, ark_mem->Vabstol); - } - else - { - retval = ARKodeSStolerances(ark_mem, ark_mem->reltol, ark_mem->Sabstol); - } - if (retval != ARK_SUCCESS) { return (retval); } - } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetTables: - - Specifies to use customized Butcher tables for the system. - - If Bi is NULL, then this sets the integrator in 'explicit' mode. - - If Be is NULL, then this sets the integrator in 'implicit' mode. - - Returns ARK_ILL_INPUT if both Butcher tables are not supplied. - ---------------------------------------------------------------*/ -int ARKStepSetTables(void* arkode_mem, int q, int p, ARKodeButcherTable Bi, - ARKodeButcherTable Be) -{ - int retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - sunindextype Blrw, Bliw; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* check for illegal inputs */ - if ((Bi == NULL) && (Be == NULL)) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "At least one complete table must be supplied"); - return (ARK_ILL_INPUT); - } - - /* if both tables are set, check that they have the same number of stages */ - if ((Bi != NULL) && (Be != NULL)) - { - if (Bi->stages != Be->stages) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Both tables must have the same number of stages"); - return (ARK_ILL_INPUT); - } - } - - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Be); - step_mem->Be = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Bi); - step_mem->Bi = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - /* - * determine mode (implicit/explicit/ImEx), and perform appropriate actions - */ - - /* explicit */ - if (Bi == NULL) - { - /* set the relevant parameters (use table q and p) */ - step_mem->stages = Be->stages; - step_mem->q = Be->q; - step_mem->p = Be->p; - - /* copy the table in step memory */ - step_mem->Be = ARKodeButcherTable_Copy(Be); - if (step_mem->Be == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* set method as purely explicit */ - retval = ARKStepSetExplicit(arkode_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Error in ARKStepSetExplicit"); - return (retval); - } - - /* implicit */ - } - else if (Be == NULL) - { - /* set the relevant parameters (use table q and p) */ - step_mem->stages = Bi->stages; - step_mem->q = Bi->q; - step_mem->p = Bi->p; - - /* copy the table in step memory */ - step_mem->Bi = ARKodeButcherTable_Copy(Bi); - if (step_mem->Bi == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* set method as purely implicit */ - retval = ARKStepSetImplicit(arkode_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Error in ARKStepSetImplicit"); - return (ARK_ILL_INPUT); - } - - /* ImEx */ - } - else - { - /* set the relevant parameters (use input q and p) */ - step_mem->stages = Bi->stages; - step_mem->q = q; - step_mem->p = p; - - /* copy the explicit table into step memory */ - step_mem->Be = ARKodeButcherTable_Copy(Be); - if (step_mem->Be == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* copy the implicit table into step memory */ - step_mem->Bi = ARKodeButcherTable_Copy(Bi); - if (step_mem->Bi == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* set method as ImEx */ - retval = ARKStepSetImEx(arkode_mem); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Error in ARKStepSetImEx"); - return (ARK_ILL_INPUT); - } - } - - /* note Butcher table space requirements */ - ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; - - ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetTableNum: - - Specifies to use pre-existing Butcher tables for the system, - based on the integer flags passed to - ARKodeButcherTable_LoadERK() and ARKodeButcherTable_LoadDIRK() - within the files arkode_butcher_erk.c and arkode_butcher_dirk.c - (automatically calls ARKStepSetImEx). - - If either argument is negative (illegal), then this disables the - corresponding table (e.g. itable = -1 -> explicit) - - Note: this routine should NOT be used in conjunction with - ARKodeSetOrder. - ---------------------------------------------------------------*/ -int ARKStepSetTableNum(void* arkode_mem, ARKODE_DIRKTableID itable, - ARKODE_ERKTableID etable) -{ - int flag, retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - sunindextype Blrw, Bliw; - - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Be); - step_mem->Be = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->Bi); - step_mem->Bi = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - /* determine mode (implicit/explicit/ImEx), and perform - appropriate actions */ - - /* illegal inputs */ - if ((itable < 0) && (etable < 0)) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "At least one valid table number must be supplied"); - return (ARK_ILL_INPUT); - - /* explicit */ - } - else if (itable < 0) - { - /* check that argument specifies an explicit table */ - if (etable < ARKODE_MIN_ERK_NUM || etable > ARKODE_MAX_ERK_NUM) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Illegal ERK table number"); - return (ARK_ILL_INPUT); - } - - /* fill in table based on argument */ - step_mem->Be = ARKodeButcherTable_LoadERK(etable); - if (step_mem->Be == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting explicit table with that index"); - return (ARK_ILL_INPUT); - } - step_mem->stages = step_mem->Be->stages; - step_mem->q = step_mem->Be->q; - step_mem->p = step_mem->Be->p; - - /* set method as purely explicit */ - flag = ARKStepSetExplicit(arkode_mem); - if (flag != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Error in ARKStepSetExplicit"); - return (flag); - } - - /* implicit */ - } - else if (etable < 0) - { - /* check that argument specifies an implicit table */ - if (itable < ARKODE_MIN_DIRK_NUM || itable > ARKODE_MAX_DIRK_NUM) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Illegal IRK table number"); - return (ARK_ILL_INPUT); - } - - /* fill in table based on argument */ - step_mem->Bi = ARKodeButcherTable_LoadDIRK(itable); - if (step_mem->Bi == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting table with that index"); - return (ARK_ILL_INPUT); - } - step_mem->stages = step_mem->Bi->stages; - step_mem->q = step_mem->Bi->q; - step_mem->p = step_mem->Bi->p; - - /* set method as purely implicit */ - flag = ARKStepSetImplicit(arkode_mem); - if (flag != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Error in ARKStepSetImplicit"); - return (flag); - } - - /* ImEx */ + /* imex */ } else { - /* ensure that tables match */ - if (!((etable == ARKODE_ARK324L2SA_ERK_4_2_3) && - (itable == ARKODE_ARK324L2SA_DIRK_4_2_3)) && - !((etable == ARKODE_ARK436L2SA_ERK_6_3_4) && - (itable == ARKODE_ARK436L2SA_DIRK_6_3_4)) && - !((etable == ARKODE_ARK437L2SA_ERK_7_3_4) && - (itable == ARKODE_ARK437L2SA_DIRK_7_3_4)) && - !((etable == ARKODE_ARK548L2SA_ERK_8_4_5) && - (itable == ARKODE_ARK548L2SA_DIRK_8_4_5)) && - !((etable == ARKODE_ARK548L2SAb_ERK_8_4_5) && - (itable == ARKODE_ARK548L2SAb_DIRK_8_4_5)) && - !((etable == ARKODE_ARK2_ERK_3_1_2) && (itable == ARKODE_ARK2_DIRK_3_1_2))) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Incompatible Butcher tables for ARK method"); - return (ARK_ILL_INPUT); - } - - /* fill in tables based on arguments */ - step_mem->Bi = ARKodeButcherTable_LoadDIRK(itable); - step_mem->Be = ARKodeButcherTable_LoadERK(etable); - if (step_mem->Bi == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Illegal IRK table number"); - return (ARK_ILL_INPUT); - } - if (step_mem->Be == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Illegal ERK table number"); - return (ARK_ILL_INPUT); - } - step_mem->stages = step_mem->Bi->stages; - step_mem->q = step_mem->Bi->q; - step_mem->p = step_mem->Bi->p; - - /* set method as ImEx */ - if (ARKStepSetImEx(arkode_mem) != ARK_SUCCESS) + switch (step_mem->q) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_MISSING_F); - return (ARK_ILL_INPUT); - } - } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - ARKStepSetTableName: - - Specifies to use pre-existing Butcher tables for the system, - based on the string passed to - ARKodeButcherTable_LoadERKByName() and - ARKodeButcherTable_LoadDIRKByName() within the files - arkode_butcher_erk.c and arkode_butcher_dirk.c (automatically - calls ARKStepSetImEx). - - If itable is "ARKODE_DIRK_NONE" or etable is "ARKODE_ERK_NONE", - then this disables the corresponding table. - ---------------------------------------------------------------*/ -int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable) -{ - return ARKStepSetTableNum(arkode_mem, arkButcherTableDIRKNameToID(itable), - arkButcherTableERKNameToID(etable)); -} - -/*--------------------------------------------------------------- - arkStep_SetNonlinCRDown: - - Specifies the user-provided nonlinear convergence constant - crdown. Legal values are strictly positive; illegal values - imply a reset to the default. - ---------------------------------------------------------------*/ -int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* if argument legal set it, otherwise set default */ - if (crdown <= ZERO) { step_mem->crdown = CRDOWN; } - else { step_mem->crdown = crdown; } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_SetNonlinRDiv: - - Specifies the user-provided nonlinear convergence constant - rdiv. Legal values are strictly positive; illegal values - imply a reset to the default. - ---------------------------------------------------------------*/ -int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* if argument legal set it, otherwise set default */ - if (rdiv <= ZERO) { step_mem->rdiv = RDIV; } - else { step_mem->rdiv = rdiv; } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_SetDeltaGammaMax: - - Specifies the user-provided linear setup decision constant - dgmax. Legal values are strictly positive; illegal values imply - a reset to the default. - ---------------------------------------------------------------*/ -int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* if argument legal set it, otherwise set default */ - if (dgmax <= ZERO) { step_mem->dgmax = DGMAX; } - else { step_mem->dgmax = dgmax; } + 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, __LINE__, __func__, __FILE__, + "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 = SUN_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->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PID allocation failure"); + return (ARK_MEM_FAIL); + } + (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, + SUN_RCONST(1.42)); + (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, + SUN_RCONST(0.54), -SUN_RCONST(0.36), + SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.965); + hadapt_mem->growth = SUN_RCONST(28.7); + hadapt_mem->etamxf = SUN_RCONST(0.46); + hadapt_mem->small_nef = SMALL_NEF; + hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; + step_mem->nlscoef = SUN_RCONST(0.22); + step_mem->crdown = SUN_RCONST(0.17); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.19); + step_mem->msbp = 60; + break; + case 4: + hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PID allocation failure"); + return (ARK_MEM_FAIL); + } + (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, + SUN_RCONST(1.35)); + (void)SUNAdaptController_SetParams_PID(hadapt_mem->hcontroller, + SUN_RCONST(0.543), + -SUN_RCONST(0.297), + SUN_RCONST(0.14)); + hadapt_mem->safety = SUN_RCONST(0.97); + hadapt_mem->growth = SUN_RCONST(25.0); + hadapt_mem->etamxf = SUN_RCONST(0.47); + hadapt_mem->small_nef = SMALL_NEF; + hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; + step_mem->nlscoef = SUN_RCONST(0.24); + step_mem->crdown = SUN_RCONST(0.26); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.16); + step_mem->msbp = 31; + break; + case 5: + hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx); + if (hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PI allocation failure"); + return (ARK_MEM_FAIL); + } + (void)SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, + SUN_RCONST(1.15)); + (void)SUNAdaptController_SetParams_PI(hadapt_mem->hcontroller, + SUN_RCONST(0.8), -SUN_RCONST(0.35)); + hadapt_mem->safety = SUN_RCONST(0.993); + hadapt_mem->growth = SUN_RCONST(28.5); + hadapt_mem->etamxf = SUN_RCONST(0.3); + hadapt_mem->small_nef = SMALL_NEF; + hadapt_mem->etacf = ETACF; + hadapt_mem->pq = PQ; + step_mem->nlscoef = SUN_RCONST(0.25); + step_mem->crdown = SUN_RCONST(0.4); + step_mem->rdiv = SUN_RCONST(2.3); + step_mem->dgmax = SUN_RCONST(0.32); + step_mem->msbp = 31; + break; + } + hadapt_mem->owncontroller = SUNTRUE; + retval = SUNAdaptController_Space(hadapt_mem->hcontroller, &lenrw, &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + } return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - arkStep_SetLSetupFrequency: +int ARKStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} - Specifies the user-provided linear setup decision constant - msbp. Positive values give the frequency for calling lsetup; - negative values imply recomputation of lsetup at each nonlinear - solve; a zero value implies a reset to the default. - ---------------------------------------------------------------*/ -int arkStep_SetLSetupFrequency(ARKodeMem ark_mem, int msbp) +int ARKStepSetInterpolantType(void* arkode_mem, int itype) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetInterpolantType(arkode_mem, itype)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); +} - /* if argument legal set it, otherwise set default */ - if (msbp == 0) { step_mem->msbp = MSBP; } - else { step_mem->msbp = msbp; } +int ARKStepSetDenseOrder(void* arkode_mem, int dord) +{ + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); +} - return (ARK_SUCCESS); +int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +{ + return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); } -/*--------------------------------------------------------------- - arkStep_SetPredictorMethod: +int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +{ + return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); +} - Specifies the method to use for predicting implicit solutions. - Non-default choices are {1,2,3,4}, all others will use default - (trivial) predictor. - ---------------------------------------------------------------*/ -int arkStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) +int ARKStepSetLinear(void* arkode_mem, int timedepend) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetLinear(arkode_mem, timedepend)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetNonlinear(void* arkode_mem) +{ + return (ARKodeSetNonlinear(arkode_mem)); +} - /* set parameter */ - step_mem->predictor = pred_method; +int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +{ + return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); +} - return (ARK_SUCCESS); +int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) +{ + return (ARKodeSetAdaptController(arkode_mem, C)); } -/*--------------------------------------------------------------- - arkStep_SetMaxNonlinIters: +int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) +{ + return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); +} - Specifies the maximum number of nonlinear iterations during - one solve. A non-positive input implies a reset to the - default value. - ---------------------------------------------------------------*/ -int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor) +int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) +{ + return (ARKodeSetSafetyFactor(arkode_mem, safety)); +} - SUNFunctionBegin(ark_mem->sunctx); +int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias) +{ + return (ARKodeSetErrorBias(arkode_mem, bias)); +} - /* Return error message if no NLS module is present */ - if (step_mem->NLS == NULL) - { - arkProcessError(ark_mem, ARK_NLS_OP_ERR, __LINE__, __func__, __FILE__, - "No SUNNonlinearSolver object is present"); - return (ARK_ILL_INPUT); - } +int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) +{ + return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); +} - /* argument <= 0 sets default, otherwise set input */ - if (maxcor <= 0) { step_mem->maxcor = MAXCOR; } - else { step_mem->maxcor = maxcor; } +int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) +{ + return (ARKodeSetMinReduction(arkode_mem, eta_min)); +} - /* send argument to NLS structure */ - retval = SUNNonlinSolSetMaxIters(step_mem->NLS, step_mem->maxcor); - if (retval != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_NLS_OP_ERR, __LINE__, __func__, __FILE__, - "Error setting maxcor in SUNNonlinearSolver object"); - return (ARK_NLS_OP_ERR); - } +int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) +{ + return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); +} - return (ARK_SUCCESS); +int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]) +{ + return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } -/*--------------------------------------------------------------- - arkStep_SetNonlinConvCoef: +int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) +{ + return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); +} - Specifies the coefficient in the nonlinear solver convergence - test. A non-positive input implies a reset to the default value. - ---------------------------------------------------------------*/ -int arkStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef) +int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) +{ + return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); +} - /* argument <= 0 sets default, otherwise set input */ - if (nlscoef <= ZERO) { step_mem->nlscoef = NLSCOEF; } - else { step_mem->nlscoef = nlscoef; } +int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef) +{ + return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); +} - return (ARK_SUCCESS); +int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) +{ + return (ARKodeSetMaxCFailGrowth(arkode_mem, etacf)); } -/*--------------------------------------------------------------- - arkStep_SetStagePredictFn: Specifies a user-provided step - predictor function having type ARKStagePredictFn. A - NULL input function disables calls to this routine. - ---------------------------------------------------------------*/ -int arkStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage) +int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); +} - /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +{ + return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); +} - step_mem->stage_predict = PredictStage; - return (ARK_SUCCESS); +int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +{ + return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); } -/*--------------------------------------------------------------- - arkStep_SetDeduceImplicitRhs: +int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp) +{ + return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); +} - Specifies if an optimization is used to avoid an evaluation of - fi after a nonlinear solve for an implicit stage. If stage - postprocessecing in enabled, this option is ignored, and fi is - never deduced. +int ARKStepSetPredictorMethod(void* arkode_mem, int pred_method) +{ + return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); +} - An argument of SUNTRUE indicates that fi is deduced to compute - fi(z_i), and SUNFALSE indicates that fi(z_i) is computed with - an additional evaluation of fi. - ---------------------------------------------------------------*/ -int arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) +int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); +} - /* access ARKodeARKStepMem structure and set function pointer */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) +{ + return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); +} - step_mem->deduce_rhs = deduce; - return (ARK_SUCCESS); +int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +{ + return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); } -/*=============================================================== - ARKStep optional output functions -- stepper-specific - ===============================================================*/ +int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf) +{ + return (ARKodeSetMaxConvFails(arkode_mem, maxncf)); +} -/*--------------------------------------------------------------- - arkStep_GetCurrentGamma: Returns the current value of gamma - ---------------------------------------------------------------*/ -int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) +int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) { - int retval; - ARKodeARKStepMem step_mem; - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - *gamma = step_mem->gamma; - return (retval); + return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); +} + +int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints) +{ + return (ARKodeSetConstraints(arkode_mem, constraints)); } -/*--------------------------------------------------------------- - arkStep_GetEstLocalErrors: Returns the current local truncation - error estimate vector - ---------------------------------------------------------------*/ -int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) +int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - int retval; - ARKodeARKStepMem step_mem; - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* return an error if local truncation error is not computed */ - if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); +} - /* otherwise, copy local truncation error vector to output */ - N_VScale(ONE, ark_mem->tempv1, ele); - return (ARK_SUCCESS); +int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) +{ + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); } -/*--------------------------------------------------------------- - ARKStepGetNumRhsEvals: +int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin) +{ + return (ARKodeSetInitStep(arkode_mem, hin)); +} - Returns the current number of calls to fe and fi - ---------------------------------------------------------------*/ -int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_evals) +int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetMinStep(arkode_mem, hmin)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) +{ + return (ARKodeSetMaxStep(arkode_mem, hmax)); +} - /* get values from step_mem */ - *fe_evals = step_mem->nfe; - *fi_evals = step_mem->nfi; +int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +{ + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); +} - return (ARK_SUCCESS); +int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (ARKodeSetStopTime(arkode_mem, tstop)); } -/*--------------------------------------------------------------- - arkStep_GetNumLinSolvSetups: +int ARKStepClearStopTime(void* arkode_mem) +{ + return (ARKodeClearStopTime(arkode_mem)); +} - Returns the current number of calls to the lsetup routine - ---------------------------------------------------------------*/ -int arkStep_GetNumLinSolvSetups(ARKodeMem ark_mem, long int* nlinsetups) +int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetFixedStep(arkode_mem, hfixed)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) +{ + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); +} - /* get value from step_mem */ - *nlinsetups = step_mem->nsetups; +int ARKStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (ARKodeSetRootDirection(arkode_mem, rootdir)); +} - return (ARK_SUCCESS); +int ARKStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } -/*--------------------------------------------------------------- - ARKStepGetCurrentButcherTables: +int ARKStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} - Sets pointers to the explicit and implicit Butcher tables - currently in use. - ---------------------------------------------------------------*/ -int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, - ARKodeButcherTable* Be) +int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); +} - /* get tables from step_mem */ - *Bi = step_mem->Bi; - *Be = step_mem->Be; - return (ARK_SUCCESS); +int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +{ + return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); } -/*--------------------------------------------------------------- - ARKStepGetTimestepperStats: +int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) +{ + return (ARKodeSetJacFn(arkode_mem, jac)); +} - Returns integrator statistics - ---------------------------------------------------------------*/ -int ARKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, - long int* accsteps, long int* step_attempts, - long int* fe_evals, long int* fi_evals, - long int* nlinsetups, long int* netfails) +int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetMassFn(arkode_mem, mass)); +} - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj) +{ + return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); +} - /* set expsteps and accsteps from adaptivity structure */ - *expsteps = ark_mem->hadapt_mem->nst_exp; - *accsteps = ark_mem->hadapt_mem->nst_acc; +int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +{ + return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); +} - /* set remaining outputs */ - *step_attempts = ark_mem->nst_attempts; - *fe_evals = step_mem->nfe; - *fi_evals = step_mem->nfi; - *nlinsetups = step_mem->nsetups; - *netfails = ark_mem->netf; +int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (ARKodeSetEpsLin(arkode_mem, eplifac)); +} - return (ARK_SUCCESS); +int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (ARKodeSetMassEpsLin(arkode_mem, eplifac)); } -/*--------------------------------------------------------------- - arkStep_GetNumNonlinSolvIters: +int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +{ + return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); +} - Returns the current number of nonlinear solver iterations - ---------------------------------------------------------------*/ -int arkStep_GetNumNonlinSolvIters(ARKodeMem ark_mem, long int* nniters) +int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetMassLSNormFactor(arkode_mem, nrmfac)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) +{ + return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); +} - *nniters = step_mem->nls_iters; +int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve) +{ + return (ARKodeSetMassPreconditioner(arkode_mem, psetup, psolve)); +} - return (ARK_SUCCESS); +int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes) +{ + return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); } -/*--------------------------------------------------------------- - arkStep_GetNumNonlinSolvConvFails: +int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +{ + return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); +} - Returns the current number of nonlinear solver convergence fails - ---------------------------------------------------------------*/ -int arkStep_GetNumNonlinSolvConvFails(ARKodeMem ark_mem, long int* nnfails) +int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, + ARKLsMassTimesVecFn mtimes, void* mtimes_data) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +{ + return (ARKodeSetLinSysFn(arkode_mem, linsys)); +} - /* set output from step_mem */ - *nnfails = step_mem->nls_fails; +int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} - return (ARK_SUCCESS); +int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); } -/*--------------------------------------------------------------- - arkStep_GetNonlinSolvStats: +int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +{ + return (ARKodeComputeState(arkode_mem, zcor, z)); +} - Returns nonlinear solver statistics - ---------------------------------------------------------------*/ -int arkStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, - long int* nnfails) +int ARKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); +} - *nniters = step_mem->nls_iters; - *nnfails = step_mem->nls_fails; +int ARKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +{ + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); +} - return (ARK_SUCCESS); +int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +{ + return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); } -/*--------------------------------------------------------------- - arkStep_PrintAllStats: +int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) +{ + return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); +} - Prints integrator statistics - ---------------------------------------------------------------*/ -int arkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) { - ARKodeARKStepMem step_mem; - ARKLsMem arkls_mem; - ARKLsMassMem arklsm_mem; - int retval; + return (ARKodeGetEstLocalErrors(arkode_mem, ele)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); +} - switch (fmt) - { - case SUN_OUTPUTFORMAT_TABLE: - /* function evaluations */ - fprintf(outfile, "Explicit RHS fn evals = %ld\n", step_mem->nfe); - fprintf(outfile, "Implicit RHS fn evals = %ld\n", step_mem->nfi); +int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumSteps(arkode_mem, nsteps)); +} - /* nonlinear solver stats */ - fprintf(outfile, "NLS iters = %ld\n", step_mem->nls_iters); - fprintf(outfile, "NLS fails = %ld\n", step_mem->nls_fails); - if (ark_mem->nst > 0) - { - fprintf(outfile, "NLS iters per step = %" RSYM "\n", - (sunrealtype)step_mem->nls_iters / (sunrealtype)ark_mem->nst); - } +int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +{ + return (ARKodeGetActualInitStep(arkode_mem, hinused)); +} - /* linear solver stats */ - fprintf(outfile, "LS setups = %ld\n", step_mem->nsetups); - if (ark_mem->step_getlinmem(ark_mem)) - { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); - fprintf(outfile, "Jac fn evals = %ld\n", arkls_mem->nje); - fprintf(outfile, "LS RHS fn evals = %ld\n", arkls_mem->nfeDQ); - fprintf(outfile, "Prec setup evals = %ld\n", arkls_mem->npe); - fprintf(outfile, "Prec solves = %ld\n", arkls_mem->nps); - fprintf(outfile, "LS iters = %ld\n", arkls_mem->nli); - fprintf(outfile, "LS fails = %ld\n", arkls_mem->ncfl); - fprintf(outfile, "Jac-times setups = %ld\n", - arkls_mem->njtsetup); - fprintf(outfile, "Jac-times evals = %ld\n", - arkls_mem->njtimes); - if (step_mem->nls_iters > 0) - { - fprintf(outfile, "LS iters per NLS iter = %" RSYM "\n", - (sunrealtype)arkls_mem->nli / (sunrealtype)step_mem->nls_iters); - fprintf(outfile, "Jac evals per NLS iter = %" RSYM "\n", - (sunrealtype)arkls_mem->nje / (sunrealtype)step_mem->nls_iters); - fprintf(outfile, "Prec evals per NLS iter = %" RSYM "\n", - (sunrealtype)arkls_mem->npe / (sunrealtype)step_mem->nls_iters); - } - } +int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (ARKodeGetLastStep(arkode_mem, hlast)); +} - /* mass solve stats */ - if (ark_mem->step_getmassmem(ark_mem)) - { - arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); - fprintf(outfile, "Mass setups = %ld\n", - arklsm_mem->nmsetups); - fprintf(outfile, "Mass solves = %ld\n", - arklsm_mem->nmsolves); - fprintf(outfile, "Mass Prec setup evals = %ld\n", arklsm_mem->npe); - fprintf(outfile, "Mass Prec solves = %ld\n", arklsm_mem->nps); - fprintf(outfile, "Mass LS iters = %ld\n", arklsm_mem->nli); - fprintf(outfile, "Mass LS fails = %ld\n", arklsm_mem->ncfl); - fprintf(outfile, "Mass-times setups = %ld\n", - arklsm_mem->nmtsetup); - fprintf(outfile, "Mass-times evals = %ld\n", - arklsm_mem->nmtimes); - } - break; +int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +{ + return (ARKodeGetCurrentStep(arkode_mem, hcur)); +} - case SUN_OUTPUTFORMAT_CSV: - /* function evaluations */ - fprintf(outfile, ",Explicit RHS fn evals,%ld", step_mem->nfe); - fprintf(outfile, ",Implicit RHS fn evals,%ld", step_mem->nfi); +int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (ARKodeGetCurrentTime(arkode_mem, tcur)); +} - /* nonlinear solver stats */ - fprintf(outfile, ",NLS iters,%ld", step_mem->nls_iters); - fprintf(outfile, ",NLS fails,%ld", step_mem->nls_fails); - if (ark_mem->nst > 0) - { - fprintf(outfile, ",NLS iters per step,%" RSYM, - (sunrealtype)step_mem->nls_iters / (sunrealtype)ark_mem->nst); - } - else { fprintf(outfile, ",NLS iters per step,0"); } +int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (ARKodeGetCurrentState(arkode_mem, state)); +} - /* linear solver stats */ - fprintf(outfile, ",LS setups,%ld", step_mem->nsetups); - if (ark_mem->step_getlinmem(ark_mem)) - { - arkls_mem = (ARKLsMem)(ark_mem->step_getlinmem(ark_mem)); - fprintf(outfile, ",Jac fn evals,%ld", arkls_mem->nje); - fprintf(outfile, ",LS RHS fn evals,%ld", arkls_mem->nfeDQ); - fprintf(outfile, ",Prec setup evals,%ld", arkls_mem->npe); - fprintf(outfile, ",Prec solves,%ld", arkls_mem->nps); - fprintf(outfile, ",LS iters,%ld", arkls_mem->nli); - fprintf(outfile, ",LS fails,%ld", arkls_mem->ncfl); - fprintf(outfile, ",Jac-times setups,%ld", arkls_mem->njtsetup); - fprintf(outfile, ",Jac-times evals,%ld", arkls_mem->njtimes); - if (step_mem->nls_iters > 0) - { - fprintf(outfile, ",LS iters per NLS iter,%" RSYM, - (sunrealtype)arkls_mem->nli / (sunrealtype)step_mem->nls_iters); - fprintf(outfile, ",Jac evals per NLS iter,%" RSYM, - (sunrealtype)arkls_mem->nje / (sunrealtype)step_mem->nls_iters); - fprintf(outfile, ",Prec evals per NLS iter,%" RSYM, - (sunrealtype)arkls_mem->npe / (sunrealtype)step_mem->nls_iters); - } - else - { - fprintf(outfile, ",LS iters per NLS iter,0"); - fprintf(outfile, ",Jac evals per NLS iter,0"); - fprintf(outfile, ",Prec evals per NLS iter,0"); - } - } +int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +{ + return (ARKodeGetCurrentGamma(arkode_mem, gamma)); +} - /* mass solve stats */ - if (ark_mem->step_getmassmem(ark_mem)) - { - arklsm_mem = (ARKLsMassMem)(ark_mem->step_getmassmem(ark_mem)); - fprintf(outfile, ",Mass setups,%ld", arklsm_mem->nmsetups); - fprintf(outfile, ",Mass solves,%ld", arklsm_mem->nmsolves); - fprintf(outfile, ",Mass Prec setup evals,%ld", arklsm_mem->npe); - fprintf(outfile, ",Mass Prec solves,%ld", arklsm_mem->nps); - fprintf(outfile, ",Mass LS iters,%ld", arklsm_mem->nli); - fprintf(outfile, ",Mass LS fails,%ld", arklsm_mem->ncfl); - fprintf(outfile, ",Mass-times setups,%ld", arklsm_mem->nmtsetup); - fprintf(outfile, ",Mass-times evals,%ld", arklsm_mem->nmtimes); - } - fprintf(outfile, "\n"); - break; +int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M) +{ + return (ARKodeGetCurrentMassMatrix(arkode_mem, M)); +} - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid formatting option."); - return (ARK_ILL_INPUT); - } +int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +{ + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); +} - return (ARK_SUCCESS); +int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (ARKodeGetErrWeights(arkode_mem, eweight)); } -/*=============================================================== - ARKStep parameter output - ===============================================================*/ +int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight) +{ + return (ARKodeGetResWeights(arkode_mem, rweight)); +} -/*--------------------------------------------------------------- - arkStep_WriteParameters: +int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); +} - Outputs all solver parameters to the provided file pointer. - ---------------------------------------------------------------*/ -int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound) { - ARKodeARKStepMem step_mem; - int retval; + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); +} - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); +} - /* print integrator parameters to file */ - fprintf(fp, "ARKStep time step module parameters:\n"); - fprintf(fp, " Method order %i\n", step_mem->q); - if (step_mem->linear) - { - fprintf(fp, " Linear implicit problem"); - if (step_mem->linear_timedep) - { - fprintf(fp, " (time-dependent Jacobian)\n"); - } - else { fprintf(fp, " (time-independent Jacobian)\n"); } - } - if (step_mem->explicit && step_mem->implicit) - { - fprintf(fp, " ImEx integrator\n"); - } - else if (step_mem->implicit) { fprintf(fp, " Implicit integrator\n"); } - else { fprintf(fp, " Explicit integrator\n"); } +int ARKStepGetUserData(void* arkode_mem, void** user_data) +{ + return (ARKodeGetUserData(arkode_mem, user_data)); +} - if (step_mem->implicit) - { - fprintf(fp, " Implicit predictor method = %i\n", step_mem->predictor); - fprintf(fp, " Implicit solver tolerance coefficient = %" RSYM "\n", - step_mem->nlscoef); - fprintf(fp, " Maximum number of nonlinear corrections = %i\n", - step_mem->maxcor); - fprintf(fp, " Nonlinear convergence rate constant = %" RSYM "\n", - step_mem->crdown); - fprintf(fp, " Nonlinear divergence tolerance = %" RSYM "\n", step_mem->rdiv); - fprintf(fp, " Gamma factor LSetup tolerance = %" RSYM "\n", step_mem->dgmax); - fprintf(fp, " Number of steps between LSetup calls = %i\n", step_mem->msbp); - } - fprintf(fp, "\n"); +int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} - return (ARK_SUCCESS); +char* ARKStepGetReturnFlagName(long int flag) +{ + return (ARKodeGetReturnFlagName(flag)); } -/*--------------------------------------------------------------- - ARKStepWriteButcher: +int ARKStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); +} - Outputs Butcher tables to the provided file pointer. - ---------------------------------------------------------------*/ int ARKStepWriteButcher(void* arkode_mem, FILE* fp) { int retval; @@ -2443,6 +2160,250 @@ int ARKStepWriteButcher(void* arkode_mem, FILE* fp) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +{ + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); +} + +int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, + sdata, user_data)); +} + +int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +{ + return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); +} + +int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +{ + return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); +} + +int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) +{ + return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); +} + +int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) +{ + return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); +} + +int ARKStepGetJac(void* arkode_mem, SUNMatrix* J) +{ + return (ARKodeGetJac(arkode_mem, J)); +} + +int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J) +{ + return (ARKodeGetJacTime(arkode_mem, t_J)); +} + +int ARKStepGetJacNumSteps(void* arkode_mem, long* nst_J) +{ + return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); +} + +int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) +{ + return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); +} + +int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals) +{ + return (ARKodeGetNumJacEvals(arkode_mem, njevals)); +} + +int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals) +{ + return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); +} + +int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) +{ + return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); +} + +int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters) +{ + return (ARKodeGetNumLinIters(arkode_mem, nliters)); +} + +int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) +{ + return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); +} + +int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +{ + return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); +} + +int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +{ + return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); +} + +int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) +{ + return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); +} + +int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag) +{ + return (ARKodeGetLastLinFlag(arkode_mem, flag)); +} + +int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, + long int* leniwMLS) +{ + return (ARKodeGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS)); +} + +int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups) +{ + return (ARKodeGetNumMassSetups(arkode_mem, nmsetups)); +} + +int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) +{ + return (ARKodeGetNumMassMultSetups(arkode_mem, nmvsetups)); +} + +int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals) +{ + return (ARKodeGetNumMassMult(arkode_mem, nmvevals)); +} + +int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves) +{ + return (ARKodeGetNumMassSolves(arkode_mem, nmsolves)); +} + +int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) +{ + return (ARKodeGetNumMassPrecEvals(arkode_mem, nmpevals)); +} + +int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) +{ + return (ARKodeGetNumMassPrecSolves(arkode_mem, nmpsolves)); +} + +int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters) +{ + return (ARKodeGetNumMassIters(arkode_mem, nmiters)); +} + +int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails) +{ + return (ARKodeGetNumMassConvFails(arkode_mem, nmcfails)); +} + +int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups) +{ + return (ARKodeGetNumMTSetups(arkode_mem, nmtsetups)); +} + +int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag) +{ + return (ARKodeGetLastMassFlag(arkode_mem, flag)); +} + +char* ARKStepGetLinReturnFlagName(long int flag) +{ + return (ARKodeGetLinReturnFlagName(flag)); +} + +void ARKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void ARKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); +} + +int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) +{ + return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); +} + +int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +{ + return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); +} + +int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) +{ + return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); +} + +int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) +{ + return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); +} + +int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +{ + return (ARKodeSetRelaxSolver(arkode_mem, solver)); +} + +int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +{ + return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); +} + +int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +{ + return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); +} + +int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) +{ + return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); +} + +int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +{ + return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); +} + +int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +{ + return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); +} + +int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +{ + return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); +} + +int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +{ + return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); +} + +int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +{ + return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); +} + +int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +{ + return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); +} + +/*=============================================================== EOF - ---------------------------------------------------------------*/ + ===============================================================*/ diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index d6105f8ed4..7cfe1f14f1 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -24,7 +24,7 @@ #include "arkode_impl.h" /*=============================================================== - Utility routines + Interface routines supplied to ARKODE ===============================================================*/ /*--------------------------------------------------------------- @@ -100,6 +100,61 @@ int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + arkStep_SetNlsRhsFn: + + This routine sets an alternative user-supplied implicit ODE + right-hand side function to use in the evaluation of nonlinear + system functions. + ---------------------------------------------------------------*/ +int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + if (nls_fi) { step_mem->nls_fi = nls_fi; } + else { step_mem->nls_fi = step_mem->fi; } + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + arkStep_GetNonlinearSystemData: + + This routine provides access to the relevant data needed to + compute the nonlinear system function. + ---------------------------------------------------------------*/ +int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + *tcur = ark_mem->tcur; + *zpred = step_mem->zpred; + *z = ark_mem->ycur; + *Fi = step_mem->Fi[step_mem->istage]; + *gamma = step_mem->gamma; + *sdata = step_mem->sdata; + *user_data = ark_mem->user_data; + + return (ARK_SUCCESS); +} + +/*=============================================================== + Utility routines called by ARKStep + ===============================================================*/ + /*--------------------------------------------------------------- arkStep_NlsInit: @@ -330,60 +385,9 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) return (retval); } -/*--------------------------------------------------------------- - arkStep_SetNlsRhsFn: - - This routine sets an alternative user-supplied implicit ODE - right-hand side function to use in the evaluation of nonlinear - system functions. - ---------------------------------------------------------------*/ -int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - if (nls_fi) { step_mem->nls_fi = nls_fi; } - else { step_mem->nls_fi = step_mem->fi; } - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkStep_GetNonlinearSystemData: - - This routine provides access to the relevant data needed to - compute the nonlinear system function. - ---------------------------------------------------------------*/ -int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) -{ - ARKodeARKStepMem step_mem; - int retval; - - /* access ARKodeARKStepMem structure */ - retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - *tcur = ark_mem->tcur; - *zpred = step_mem->zpred; - *z = ark_mem->ycur; - *Fi = step_mem->Fi[step_mem->istage]; - *gamma = step_mem->gamma; - *sdata = step_mem->sdata; - *user_data = ark_mem->user_data; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- +/*=============================================================== Interface routines supplied to the SUNNonlinearSolver module - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- arkStep_NlsLSetup: diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index 0807d05fca..a6321cf16f 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -25,102 +25,137 @@ #define TOL (SUNRsqrt(SUN_UNIT_ROUNDOFF)) /* Private utility functions for checking method order */ -static int __mv(sunrealtype** A, sunrealtype* x, int s, sunrealtype* b); -static int __vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z); -static int __vp(sunrealtype* x, int l, int s, sunrealtype* z); -static int __dot(sunrealtype* x, sunrealtype* y, int s, sunrealtype* d); -static sunbooleantype __rowsum(sunrealtype** A, sunrealtype* c, int s); -static sunbooleantype __order1(sunrealtype* b, int s); -static sunbooleantype __order2(sunrealtype* b, sunrealtype* c, int s); -static sunbooleantype __order3a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, int s); -static sunbooleantype __order3b(sunrealtype* b, sunrealtype** A, sunrealtype* c, - int s); -static sunbooleantype __order4a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order4b(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, int s); -static sunbooleantype __order4c(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, int s); -static sunbooleantype __order4d(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c, int s); -static sunbooleantype __order5a(sunrealtype* b, sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s); -static sunbooleantype __order5b(sunrealtype* b, sunrealtype* c1, sunrealtype* c2, - sunrealtype** A, sunrealtype* c3, int s); -static sunbooleantype __order5c(sunrealtype* b, sunrealtype** A1, sunrealtype* c1, - sunrealtype** A2, sunrealtype* c2, int s); -static sunbooleantype __order5d(sunrealtype* b, sunrealtype* c1, sunrealtype** A, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order5e(sunrealtype* b, sunrealtype** A, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order5f(sunrealtype* b, sunrealtype* c1, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c2, int s); -static sunbooleantype __order5g(sunrealtype* b, sunrealtype** A1, sunrealtype* c1, - sunrealtype** A2, sunrealtype* c2, int s); -static sunbooleantype __order5h(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, int s); -static sunbooleantype __order5i(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c, int s); -static sunbooleantype __order6a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype* c4, sunrealtype* c5, int s); -static sunbooleantype __order6b(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype** A, sunrealtype* c4, int s); -static sunbooleantype __order6c(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s); -static sunbooleantype __order6d(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A, - sunrealtype* c3, sunrealtype* c4, int s); -static sunbooleantype __order6e(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c3, int s); -static sunbooleantype __order6f(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s); -static sunbooleantype __order6g(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s); -static sunbooleantype __order6h(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s); -static sunbooleantype __order6i(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order6j(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, int s); -static sunbooleantype __order6k(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s); -static sunbooleantype __order6l(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s); -static sunbooleantype __order6m(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s); -static sunbooleantype __order6n(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order6o(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, int s); -static sunbooleantype __order6p(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s); -static sunbooleantype __order6q(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s); -static sunbooleantype __order6r(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c1, sunrealtype* c2, int s); -static sunbooleantype __order6s(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype** A4, sunrealtype* c, int s); +static int arkode_butcher_mv(sunrealtype** A, sunrealtype* x, int s, + sunrealtype* b); +static int arkode_butcher_vv(sunrealtype* x, sunrealtype* y, int s, + sunrealtype* z); +static int arkode_butcher_vp(sunrealtype* x, int l, int s, sunrealtype* z); +static int arkode_butcher_dot(sunrealtype* x, sunrealtype* y, int s, + sunrealtype* d); +static sunbooleantype arkode_butcher_rowsum(sunrealtype** A, sunrealtype* c, + int s); +static sunbooleantype arkode_butcher_order1(sunrealtype* b, int s); +static sunbooleantype arkode_butcher_order2(sunrealtype* b, sunrealtype* c, + int s); +static sunbooleantype arkode_butcher_order3a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, int s); +static sunbooleantype arkode_butcher_order3b(sunrealtype* b, sunrealtype** A, + sunrealtype* c, int s); +static sunbooleantype arkode_butcher_order4a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order4b(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order4c(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order4d(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c, + int s); +static sunbooleantype arkode_butcher_order5a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype* c4, int s); +static sunbooleantype arkode_butcher_order5b(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A, + sunrealtype* c3, int s); +static sunbooleantype arkode_butcher_order5c(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, int s); +static sunbooleantype arkode_butcher_order5d(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + sunrealtype* c3, int s); +static sunbooleantype arkode_butcher_order5e(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + sunrealtype* c3, int s); +static sunbooleantype arkode_butcher_order5f(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype* c2, int s); +static sunbooleantype arkode_butcher_order5g(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, int s); +static sunbooleantype arkode_butcher_order5h(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype* c2, int s); +static sunbooleantype arkode_butcher_order5i(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype* c, int s); +static sunbooleantype arkode_butcher_order6a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype* c4, sunrealtype* c5, + int s); +static sunbooleantype arkode_butcher_order6b(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype** A, sunrealtype* c4, + int s); +static sunbooleantype arkode_butcher_order6c(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6d(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A, + sunrealtype* c3, sunrealtype* c4, + int s); +static sunbooleantype arkode_butcher_order6e(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6f(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6g(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + sunrealtype* c3, sunrealtype* c4, + int s); +static sunbooleantype arkode_butcher_order6h(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6i(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype* c2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6j(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype** A3, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6k(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + sunrealtype* c3, sunrealtype* c4, + int s); +static sunbooleantype arkode_butcher_order6l(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6m(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6n(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6o(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype** A3, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6p(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + int s); +static sunbooleantype arkode_butcher_order6q(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6r(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype* c1, sunrealtype* c2, + int s); +static sunbooleantype arkode_butcher_order6s(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype** A4, sunrealtype* c, + int s); static int __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, sunrealtype* c, int s); @@ -453,7 +488,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if (outfile) { fprintf(outfile, "ARKodeButcherTable_CheckOrder:\n"); } /* row sum condition */ - if (__rowsum(A, c, s)) { (*q) = 0; } + if (arkode_butcher_rowsum(A, c, s)) { (*q) = 0; } else { (*q) = -1; @@ -462,7 +497,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 1 condition */ if ((*q) == 0) { - if (__order1(b, s)) { (*q) = 1; } + if (arkode_butcher_order1(b, s)) { (*q) = 1; } else { if (outfile) { fprintf(outfile, " method fails order 1 condition\n"); } @@ -471,7 +506,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 2 condition */ if ((*q) == 1) { - if (__order2(b, c, s)) { (*q) = 2; } + if (arkode_butcher_order2(b, c, s)) { (*q) = 2; } else { if (outfile) { fprintf(outfile, " method fails order 2 condition\n"); } @@ -481,12 +516,12 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 2) { alltrue = SUNTRUE; - if (!__order3a(b, c, c, s)) + if (!arkode_butcher_order3a(b, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 3 condition A\n"); } } - if (!__order3b(b, A, c, s)) + if (!arkode_butcher_order3b(b, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 3 condition B\n"); } @@ -497,22 +532,22 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 3) { alltrue = SUNTRUE; - if (!__order4a(b, c, c, c, s)) + if (!arkode_butcher_order4a(b, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition A\n"); } } - if (!__order4b(b, c, A, c, s)) + if (!arkode_butcher_order4b(b, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition B\n"); } } - if (!__order4c(b, A, c, c, s)) + if (!arkode_butcher_order4c(b, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition C\n"); } } - if (!__order4d(b, A, A, c, s)) + if (!arkode_butcher_order4d(b, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 4 condition D\n"); } @@ -523,47 +558,47 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 4) { alltrue = SUNTRUE; - if (!__order5a(b, c, c, c, c, s)) + if (!arkode_butcher_order5a(b, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition A\n"); } } - if (!__order5b(b, c, c, A, c, s)) + if (!arkode_butcher_order5b(b, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition B\n"); } } - if (!__order5c(b, A, c, A, c, s)) + if (!arkode_butcher_order5c(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition C\n"); } } - if (!__order5d(b, c, A, c, c, s)) + if (!arkode_butcher_order5d(b, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition D\n"); } } - if (!__order5e(b, A, c, c, c, s)) + if (!arkode_butcher_order5e(b, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition E\n"); } } - if (!__order5f(b, c, A, A, c, s)) + if (!arkode_butcher_order5f(b, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition F\n"); } } - if (!__order5g(b, A, c, A, c, s)) + if (!arkode_butcher_order5g(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition G\n"); } } - if (!__order5h(b, A, A, c, c, s)) + if (!arkode_butcher_order5h(b, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition H\n"); } } - if (!__order5i(b, A, A, A, c, s)) + if (!arkode_butcher_order5i(b, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 5 condition I\n"); } @@ -574,97 +609,97 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*q) == 5) { alltrue = SUNTRUE; - if (!__order6a(b, c, c, c, c, c, s)) + if (!arkode_butcher_order6a(b, c, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition A\n"); } } - if (!__order6b(b, c, c, c, A, c, s)) + if (!arkode_butcher_order6b(b, c, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition B\n"); } } - if (!__order6c(b, c, A, c, A, c, s)) + if (!arkode_butcher_order6c(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition C\n"); } } - if (!__order6d(b, c, c, A, c, c, s)) + if (!arkode_butcher_order6d(b, c, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition D\n"); } } - if (!__order6e(b, c, c, A, A, c, s)) + if (!arkode_butcher_order6e(b, c, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition E\n"); } } - if (!__order6f(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6f(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition F\n"); } } - if (!__order6g(b, c, A, c, c, c, s)) + if (!arkode_butcher_order6g(b, c, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition G\n"); } } - if (!__order6h(b, c, A, c, A, c, s)) + if (!arkode_butcher_order6h(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition H\n"); } } - if (!__order6i(b, c, A, A, c, c, s)) + if (!arkode_butcher_order6i(b, c, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition I\n"); } } - if (!__order6j(b, c, A, A, A, c, s)) + if (!arkode_butcher_order6j(b, c, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition J\n"); } } - if (!__order6k(b, A, c, c, c, c, s)) + if (!arkode_butcher_order6k(b, A, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition K\n"); } } - if (!__order6l(b, A, c, c, A, c, s)) + if (!arkode_butcher_order6l(b, A, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition L\n"); } } - if (!__order6m(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6m(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition M\n"); } } - if (!__order6n(b, A, c, A, c, c, s)) + if (!arkode_butcher_order6n(b, A, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition N\n"); } } - if (!__order6o(b, A, c, A, A, c, s)) + if (!arkode_butcher_order6o(b, A, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition O\n"); } } - if (!__order6p(b, A, A, c, c, c, s)) + if (!arkode_butcher_order6p(b, A, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition P\n"); } } - if (!__order6q(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6q(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition Q\n"); } } - if (!__order6r(b, A, A, A, c, c, s)) + if (!arkode_butcher_order6r(b, A, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition R\n"); } } - if (!__order6s(b, A, A, A, A, c, s)) + if (!arkode_butcher_order6s(b, A, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) { fprintf(outfile, " method fails order 6 condition S\n"); } @@ -691,7 +726,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, b = d; /* row sum condition */ - if (__rowsum(A, c, s)) { (*p) = 0; } + if (arkode_butcher_rowsum(A, c, s)) { (*p) = 0; } else { (*p) = -1; @@ -703,7 +738,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 1 condition */ if ((*p) == 0) { - if (__order1(b, s)) { (*p) = 1; } + if (arkode_butcher_order1(b, s)) { (*p) = 1; } else { if (outfile) @@ -715,7 +750,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, /* order 2 condition */ if ((*p) == 1) { - if (__order2(b, c, s)) { (*p) = 2; } + if (arkode_butcher_order2(b, c, s)) { (*p) = 2; } else { if (outfile) @@ -728,7 +763,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 2) { alltrue = SUNTRUE; - if (!__order3a(b, c, c, s)) + if (!arkode_butcher_order3a(b, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -736,7 +771,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 3 condition A\n"); } } - if (!__order3b(b, A, c, s)) + if (!arkode_butcher_order3b(b, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -750,7 +785,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 3) { alltrue = SUNTRUE; - if (!__order4a(b, c, c, c, s)) + if (!arkode_butcher_order4a(b, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -758,7 +793,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition A\n"); } } - if (!__order4b(b, c, A, c, s)) + if (!arkode_butcher_order4b(b, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -766,7 +801,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition B\n"); } } - if (!__order4c(b, A, c, c, s)) + if (!arkode_butcher_order4c(b, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -774,7 +809,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 4 condition C\n"); } } - if (!__order4d(b, A, A, c, s)) + if (!arkode_butcher_order4d(b, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -788,7 +823,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 4) { alltrue = SUNTRUE; - if (!__order5a(b, c, c, c, c, s)) + if (!arkode_butcher_order5a(b, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -796,7 +831,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition A\n"); } } - if (!__order5b(b, c, c, A, c, s)) + if (!arkode_butcher_order5b(b, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -804,7 +839,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition B\n"); } } - if (!__order5c(b, A, c, A, c, s)) + if (!arkode_butcher_order5c(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -812,7 +847,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition C\n"); } } - if (!__order5d(b, c, A, c, c, s)) + if (!arkode_butcher_order5d(b, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -820,7 +855,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition D\n"); } } - if (!__order5e(b, A, c, c, c, s)) + if (!arkode_butcher_order5e(b, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -828,7 +863,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition E\n"); } } - if (!__order5f(b, c, A, A, c, s)) + if (!arkode_butcher_order5f(b, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -836,7 +871,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition F\n"); } } - if (!__order5g(b, A, c, A, c, s)) + if (!arkode_butcher_order5g(b, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -844,7 +879,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition G\n"); } } - if (!__order5h(b, A, A, c, c, s)) + if (!arkode_butcher_order5h(b, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -852,7 +887,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 5 condition H\n"); } } - if (!__order5i(b, A, A, A, c, s)) + if (!arkode_butcher_order5i(b, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -866,7 +901,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, if ((*p) == 5) { alltrue = SUNTRUE; - if (!__order6a(b, c, c, c, c, c, s)) + if (!arkode_butcher_order6a(b, c, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -874,7 +909,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition A\n"); } } - if (!__order6b(b, c, c, c, A, c, s)) + if (!arkode_butcher_order6b(b, c, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -882,7 +917,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition B\n"); } } - if (!__order6c(b, c, A, c, A, c, s)) + if (!arkode_butcher_order6c(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -890,7 +925,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition C\n"); } } - if (!__order6d(b, c, c, A, c, c, s)) + if (!arkode_butcher_order6d(b, c, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -898,7 +933,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition D\n"); } } - if (!__order6e(b, c, c, A, A, c, s)) + if (!arkode_butcher_order6e(b, c, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -906,7 +941,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition E\n"); } } - if (!__order6f(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6f(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -914,7 +949,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition F\n"); } } - if (!__order6g(b, c, A, c, c, c, s)) + if (!arkode_butcher_order6g(b, c, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -922,7 +957,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition G\n"); } } - if (!__order6h(b, c, A, c, A, c, s)) + if (!arkode_butcher_order6h(b, c, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -930,7 +965,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition H\n"); } } - if (!__order6i(b, c, A, A, c, c, s)) + if (!arkode_butcher_order6i(b, c, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -938,7 +973,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition I\n"); } } - if (!__order6j(b, c, A, A, A, c, s)) + if (!arkode_butcher_order6j(b, c, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -946,7 +981,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition J\n"); } } - if (!__order6k(b, A, c, c, c, c, s)) + if (!arkode_butcher_order6k(b, A, c, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -954,7 +989,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition K\n"); } } - if (!__order6l(b, A, c, c, A, c, s)) + if (!arkode_butcher_order6l(b, A, c, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -962,7 +997,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition L\n"); } } - if (!__order6m(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6m(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -970,7 +1005,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition M\n"); } } - if (!__order6n(b, A, c, A, c, c, s)) + if (!arkode_butcher_order6n(b, A, c, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -978,7 +1013,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition N\n"); } } - if (!__order6o(b, A, c, A, A, c, s)) + if (!arkode_butcher_order6o(b, A, c, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -986,7 +1021,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition O\n"); } } - if (!__order6p(b, A, A, c, c, c, s)) + if (!arkode_butcher_order6p(b, A, A, c, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -994,7 +1029,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition P\n"); } } - if (!__order6q(b, A, A, c, A, c, s)) + if (!arkode_butcher_order6q(b, A, A, c, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1002,7 +1037,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition Q\n"); } } - if (!__order6r(b, A, A, A, c, c, s)) + if (!arkode_butcher_order6r(b, A, A, A, c, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1010,7 +1045,7 @@ int ARKodeButcherTable_CheckOrder(ARKodeButcherTable B, int* q, int* p, fprintf(outfile, " embedding fails order 6 condition R\n"); } } - if (!__order6s(b, A, A, A, A, c, s)) + if (!arkode_butcher_order6s(b, A, A, A, A, c, s)) { alltrue = SUNFALSE; if (outfile) @@ -1128,7 +1163,10 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B if (outfile) { fprintf(outfile, "ARKodeButcherTable_CheckARKOrder:\n"); } /* row sum conditions */ - if (__rowsum(A[0], c[0], s) && __rowsum(A[1], c[1], s)) { (*q) = 0; } + if (arkode_butcher_rowsum(A[0], c[0], s) && arkode_butcher_rowsum(A[1], c[1], s)) + { + (*q) = 0; + } else { (*q) = -1; @@ -1137,7 +1175,10 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B /* order 1 conditions */ if ((*q) == 0) { - if (__order1(b[0], s) && __order1(b[1], s)) { (*q) = 1; } + if (arkode_butcher_order1(b[0], s) && arkode_butcher_order1(b[1], s)) + { + (*q) = 1; + } else { if (outfile) { fprintf(outfile, " method fails order 1 conditions\n"); } @@ -1151,7 +1192,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (j = 0; j < 2; j++) { - alltrue = (alltrue && __order2(b[i], c[j], s)); + alltrue = (alltrue && arkode_butcher_order2(b[i], c[j], s)); } } if (alltrue) { (*q) = 2; } @@ -1170,7 +1211,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && __order3a(b[i], c[j], c[k], s)); + alltrue = (alltrue && arkode_butcher_order3a(b[i], c[j], c[k], s)); } } } @@ -1184,7 +1225,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && __order3b(b[i], A[j], c[k], s)); + alltrue = (alltrue && arkode_butcher_order3b(b[i], A[j], c[k], s)); } } } @@ -1206,7 +1247,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4a(b[i], c[j], c[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4a(b[i], c[j], c[k], c[l], s)); } } } @@ -1223,7 +1265,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4b(b[i], c[j], A[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4b(b[i], c[j], A[k], c[l], s)); } } } @@ -1240,7 +1283,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4c(b[i], A[j], c[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4c(b[i], A[j], c[k], c[l], s)); } } } @@ -1257,7 +1301,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4d(b[i], A[j], A[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4d(b[i], A[j], A[k], c[l], s)); } } } @@ -1282,7 +1327,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5a(b[i], c[j], c[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5a(b[i], c[j], c[k], + c[l], c[m], s)); } } } @@ -1302,7 +1348,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5b(b[i], c[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5b(b[i], c[j], c[k], + A[l], c[m], s)); } } } @@ -1322,7 +1369,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5c(b[i], A[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5c(b[i], A[j], c[k], + A[l], c[m], s)); } } } @@ -1342,7 +1390,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5d(b[i], c[j], A[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5d(b[i], c[j], A[k], + c[l], c[m], s)); } } } @@ -1362,7 +1411,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5e(b[i], A[j], c[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5e(b[i], A[j], c[k], + c[l], c[m], s)); } } } @@ -1382,7 +1432,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5f(b[i], c[j], A[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5f(b[i], c[j], A[k], + A[l], c[m], s)); } } } @@ -1402,7 +1453,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5g(b[i], A[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5g(b[i], A[j], c[k], + A[l], c[m], s)); } } } @@ -1422,7 +1474,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5h(b[i], A[j], A[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5h(b[i], A[j], A[k], + c[l], c[m], s)); } } } @@ -1442,7 +1495,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5i(b[i], A[j], A[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5i(b[i], A[j], A[k], + A[l], c[m], s)); } } } @@ -1470,8 +1524,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6a(b[i], c[j], c[k], c[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6a(b[i], c[j], c[k], + c[l], c[m], c[n], s)); } } } @@ -1494,8 +1548,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6b(b[i], c[j], c[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6b(b[i], c[j], c[k], + c[l], A[m], c[n], s)); } } } @@ -1518,8 +1572,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6c(b[i], c[j], A[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6c(b[i], c[j], A[k], + c[l], A[m], c[n], s)); } } } @@ -1542,8 +1596,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6d(b[i], c[j], c[k], A[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6d(b[i], c[j], c[k], + A[l], c[m], c[n], s)); } } } @@ -1566,8 +1620,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6e(b[i], c[j], c[k], A[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6e(b[i], c[j], c[k], + A[l], A[m], c[n], s)); } } } @@ -1590,8 +1644,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6f(b[i], A[j], A[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6f(b[i], A[j], A[k], + c[l], A[m], c[n], s)); } } } @@ -1614,8 +1668,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6g(b[i], c[j], A[k], c[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6g(b[i], c[j], A[k], + c[l], c[m], c[n], s)); } } } @@ -1638,8 +1692,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6h(b[i], c[j], A[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6h(b[i], c[j], A[k], + c[l], A[m], c[n], s)); } } } @@ -1662,8 +1716,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6i(b[i], c[j], A[k], A[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6i(b[i], c[j], A[k], + A[l], c[m], c[n], s)); } } } @@ -1686,8 +1740,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6j(b[i], c[j], A[k], A[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6j(b[i], c[j], A[k], + A[l], A[m], c[n], s)); } } } @@ -1710,8 +1764,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6k(b[i], A[j], c[k], c[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6k(b[i], A[j], c[k], + c[l], c[m], c[n], s)); } } } @@ -1734,8 +1788,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6l(b[i], A[j], c[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6l(b[i], A[j], c[k], + c[l], A[m], c[n], s)); } } } @@ -1758,8 +1812,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6m(b[i], A[j], A[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6m(b[i], A[j], A[k], + c[l], A[m], c[n], s)); } } } @@ -1782,8 +1836,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6n(b[i], A[j], c[k], A[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6n(b[i], A[j], c[k], + A[l], c[m], c[n], s)); } } } @@ -1806,8 +1860,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6o(b[i], A[j], c[k], A[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6o(b[i], A[j], c[k], + A[l], A[m], c[n], s)); } } } @@ -1830,8 +1884,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6p(b[i], A[j], A[k], c[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6p(b[i], A[j], A[k], + c[l], c[m], c[n], s)); } } } @@ -1854,8 +1908,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6q(b[i], A[j], A[k], c[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6q(b[i], A[j], A[k], + c[l], A[m], c[n], s)); } } } @@ -1878,8 +1932,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6r(b[i], A[j], A[k], A[l], c[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6r(b[i], A[j], A[k], + A[l], c[m], c[n], s)); } } } @@ -1902,8 +1956,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (n = 0; n < 2; n++) { - alltrue = (alltrue && - __order6s(b[i], A[j], A[k], A[l], A[m], c[n], s)); + alltrue = (alltrue && arkode_butcher_order6s(b[i], A[j], A[k], + A[l], A[m], c[n], s)); } } } @@ -1923,7 +1977,11 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B if (outfile) { fprintf(outfile, "\n"); } /* row sum conditions */ - if (__rowsum(A[0], c[0], s) && __rowsum(A[1], c[1], s)) { (*p) = 0; } + if (arkode_butcher_rowsum(A[0], c[0], s) && + arkode_butcher_rowsum(A[1], c[1], s)) + { + (*p) = 0; + } else { (*p) = -1; @@ -1935,7 +1993,10 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B /* order 1 conditions */ if ((*p) == 0) { - if (__order1(d[0], s) && __order1(d[1], s)) { (*p) = 1; } + if (arkode_butcher_order1(d[0], s) && arkode_butcher_order1(d[1], s)) + { + (*p) = 1; + } else { if (outfile) @@ -1952,7 +2013,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (j = 0; j < 2; j++) { - alltrue = (alltrue && __order2(d[i], c[j], s)); + alltrue = (alltrue && arkode_butcher_order2(d[i], c[j], s)); } } if (alltrue) { (*p) = 2; } @@ -1974,7 +2035,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && __order3a(d[i], c[j], c[k], s)); + alltrue = (alltrue && arkode_butcher_order3a(d[i], c[j], c[k], s)); } } } @@ -1988,7 +2049,7 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (k = 0; k < 2; k++) { - alltrue = (alltrue && __order3b(d[i], A[j], c[k], s)); + alltrue = (alltrue && arkode_butcher_order3b(d[i], A[j], c[k], s)); } } } @@ -2010,7 +2071,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4a(d[i], c[j], c[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4a(d[i], c[j], c[k], c[l], s)); } } } @@ -2027,7 +2089,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4b(d[i], c[j], A[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4b(d[i], c[j], A[k], c[l], s)); } } } @@ -2044,7 +2107,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4c(d[i], A[j], c[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4c(d[i], A[j], c[k], c[l], s)); } } } @@ -2061,7 +2125,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (l = 0; l < 2; l++) { - alltrue = (alltrue && __order4d(d[i], A[j], A[k], c[l], s)); + alltrue = (alltrue && + arkode_butcher_order4d(d[i], A[j], A[k], c[l], s)); } } } @@ -2086,7 +2151,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5a(d[i], c[j], c[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5a(d[i], c[j], c[k], + c[l], c[m], s)); } } } @@ -2106,7 +2172,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5b(d[i], c[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5b(d[i], c[j], c[k], + A[l], c[m], s)); } } } @@ -2126,7 +2193,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5c(d[i], A[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5c(d[i], A[j], c[k], + A[l], c[m], s)); } } } @@ -2146,7 +2214,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5d(d[i], c[j], A[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5d(d[i], c[j], A[k], + c[l], c[m], s)); } } } @@ -2166,7 +2235,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5e(d[i], A[j], c[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5e(d[i], A[j], c[k], + c[l], c[m], s)); } } } @@ -2186,7 +2256,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5f(d[i], c[j], A[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5f(d[i], c[j], A[k], + A[l], c[m], s)); } } } @@ -2206,7 +2277,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5g(d[i], A[j], c[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5g(d[i], A[j], c[k], + A[l], c[m], s)); } } } @@ -2226,7 +2298,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5h(d[i], A[j], A[k], c[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5h(d[i], A[j], A[k], + c[l], c[m], s)); } } } @@ -2246,7 +2319,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B { for (m = 0; m < 2; m++) { - alltrue = (alltrue && __order5i(d[i], A[j], A[k], A[l], c[m], s)); + alltrue = (alltrue && arkode_butcher_order5i(d[i], A[j], A[k], + A[l], c[m], s)); } } } @@ -2275,7 +2349,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6a(d[i], c[j], c[k], c[l], c[m], c[n], s)); + arkode_butcher_order6a(d[i], c[j], c[k], c[l], + c[m], c[n], s)); } } } @@ -2299,7 +2374,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6b(d[i], c[j], c[k], c[l], A[m], c[n], s)); + arkode_butcher_order6b(d[i], c[j], c[k], c[l], + A[m], c[n], s)); } } } @@ -2323,7 +2399,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6c(d[i], c[j], A[k], c[l], A[m], c[n], s)); + arkode_butcher_order6c(d[i], c[j], A[k], c[l], + A[m], c[n], s)); } } } @@ -2347,7 +2424,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6d(d[i], c[j], c[k], A[l], c[m], c[n], s)); + arkode_butcher_order6d(d[i], c[j], c[k], A[l], + c[m], c[n], s)); } } } @@ -2371,7 +2449,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6e(d[i], c[j], c[k], A[l], A[m], c[n], s)); + arkode_butcher_order6e(d[i], c[j], c[k], A[l], + A[m], c[n], s)); } } } @@ -2395,7 +2474,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6f(d[i], A[j], A[k], c[l], A[m], c[n], s)); + arkode_butcher_order6f(d[i], A[j], A[k], c[l], + A[m], c[n], s)); } } } @@ -2419,7 +2499,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6g(d[i], c[j], A[k], c[l], c[m], c[n], s)); + arkode_butcher_order6g(d[i], c[j], A[k], c[l], + c[m], c[n], s)); } } } @@ -2443,7 +2524,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6h(d[i], c[j], A[k], c[l], A[m], c[n], s)); + arkode_butcher_order6h(d[i], c[j], A[k], c[l], + A[m], c[n], s)); } } } @@ -2467,7 +2549,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6i(d[i], c[j], A[k], A[l], c[m], c[n], s)); + arkode_butcher_order6i(d[i], c[j], A[k], A[l], + c[m], c[n], s)); } } } @@ -2491,7 +2574,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6j(d[i], c[j], A[k], A[l], A[m], c[n], s)); + arkode_butcher_order6j(d[i], c[j], A[k], A[l], + A[m], c[n], s)); } } } @@ -2515,7 +2599,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6k(d[i], A[j], c[k], c[l], c[m], c[n], s)); + arkode_butcher_order6k(d[i], A[j], c[k], c[l], + c[m], c[n], s)); } } } @@ -2539,7 +2624,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6l(d[i], A[j], c[k], c[l], A[m], c[n], s)); + arkode_butcher_order6l(d[i], A[j], c[k], c[l], + A[m], c[n], s)); } } } @@ -2563,7 +2649,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6m(d[i], A[j], A[k], c[l], A[m], c[n], s)); + arkode_butcher_order6m(d[i], A[j], A[k], c[l], + A[m], c[n], s)); } } } @@ -2587,7 +2674,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6n(d[i], A[j], c[k], A[l], c[m], c[n], s)); + arkode_butcher_order6n(d[i], A[j], c[k], A[l], + c[m], c[n], s)); } } } @@ -2611,7 +2699,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6o(d[i], A[j], c[k], A[l], A[m], c[n], s)); + arkode_butcher_order6o(d[i], A[j], c[k], A[l], + A[m], c[n], s)); } } } @@ -2635,7 +2724,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6p(d[i], A[j], A[k], c[l], c[m], c[n], s)); + arkode_butcher_order6p(d[i], A[j], A[k], c[l], + c[m], c[n], s)); } } } @@ -2659,7 +2749,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6q(d[i], A[j], A[k], c[l], A[m], c[n], s)); + arkode_butcher_order6q(d[i], A[j], A[k], c[l], + A[m], c[n], s)); } } } @@ -2683,7 +2774,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6r(d[i], A[j], A[k], A[l], c[m], c[n], s)); + arkode_butcher_order6r(d[i], A[j], A[k], A[l], + c[m], c[n], s)); } } } @@ -2707,7 +2799,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B for (n = 0; n < 2; n++) { alltrue = (alltrue && - __order6s(d[i], A[j], A[k], A[l], A[m], c[n], s)); + arkode_butcher_order6s(d[i], A[j], A[k], A[l], + A[m], c[n], s)); } } } @@ -2754,7 +2847,8 @@ int ARKodeButcherTable_CheckARKOrder(ARKodeButcherTable B1, ARKodeButcherTable B Here A is (s x s), x and b are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __mv(sunrealtype** A, sunrealtype* x, int s, sunrealtype* b) +static int arkode_butcher_mv(sunrealtype** A, sunrealtype* x, int s, + sunrealtype* b) { int i, j; if ((A == NULL) || (x == NULL) || (b == NULL) || (s < 1)) { return (1); } @@ -2772,7 +2866,7 @@ static int __mv(sunrealtype** A, sunrealtype* x, int s, sunrealtype* b) Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z) +static int arkode_butcher_vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z) { int i; if ((x == NULL) || (y == NULL) || (z == NULL) || (s < 1)) { return (1); } @@ -2786,7 +2880,7 @@ static int __vv(sunrealtype* x, sunrealtype* y, int s, sunrealtype* z) Here all vectors are (s x 1). Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __vp(sunrealtype* x, int l, int s, sunrealtype* z) +static int arkode_butcher_vp(sunrealtype* x, int l, int s, sunrealtype* z) { int i; if ((x == NULL) || (z == NULL) || (s < 1) || (s < 0)) { return (1); } @@ -2800,7 +2894,8 @@ static int __vp(sunrealtype* x, int l, int s, sunrealtype* z) Here x and y are (s x 1), and d is scalar. Returns 0 on success, nonzero on failure. ---------------------------------------------------------------*/ -static int __dot(sunrealtype* x, sunrealtype* y, int s, sunrealtype* d) +static int arkode_butcher_dot(sunrealtype* x, sunrealtype* y, int s, + sunrealtype* d) { int i; if ((x == NULL) || (y == NULL) || (d == NULL) || (s < 1)) { return (1); } @@ -2812,17 +2907,17 @@ static int __dot(sunrealtype* x, sunrealtype* y, int s, sunrealtype* d) /*--------------------------------------------------------------- Utility routines to check specific order conditions. Each returns SUNTRUE on success, SUNFALSE on failure. - Order 0: __rowsum - Order 1: __order1 - Order 2: __order2 - Order 3: __order3a and __order3b - Order 4: __order4a through __order4d - Order 5: __order5a through __order5i - Order 6: __order6a through __order6s + Order 0: arkode_butcher_rowsum + Order 1: arkode_butcher_order1 + Order 2: arkode_butcher_order2 + Order 3: arkode_butcher_order3a and arkode_butcher_order3b + Order 4: arkode_butcher_order4a through arkode_butcher_order4d + Order 5: arkode_butcher_order5a through arkode_butcher_order5i + Order 6: arkode_butcher_order6a through arkode_butcher_order6s ---------------------------------------------------------------*/ /* c(i) = sum(A(i,:)) */ -static sunbooleantype __rowsum(sunrealtype** A, sunrealtype* c, int s) +static sunbooleantype arkode_butcher_rowsum(sunrealtype** A, sunrealtype* c, int s) { int i, j; sunrealtype rsum; @@ -2836,7 +2931,7 @@ static sunbooleantype __rowsum(sunrealtype** A, sunrealtype* c, int s) } /* b'*e = 1 */ -static sunbooleantype __order1(sunrealtype* b, int s) +static sunbooleantype arkode_butcher_order1(sunrealtype* b, int s) { int i; sunrealtype err = SUN_RCONST(1.0); @@ -2845,117 +2940,120 @@ static sunbooleantype __order1(sunrealtype* b, int s) } /* b'*c = 1/2 */ -static sunbooleantype __order2(sunrealtype* b, sunrealtype* c, int s) +static sunbooleantype arkode_butcher_order2(sunrealtype* b, sunrealtype* c, int s) { sunrealtype bc; - if (__dot(b, c, s, &bc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, c, s, &bc)) { return (SUNFALSE); } return (SUNRabs(bc - SUN_RCONST(0.5)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2) = 1/3 */ -static sunbooleantype __order3a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order3a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, int s) { sunrealtype bcc; sunrealtype* tmp = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp)) + if (arkode_butcher_vv(c1, c2, s, tmp)) { free(tmp); return (SUNFALSE); } - if (__dot(b, tmp, s, &bcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp, s, &bcc)) { return (SUNFALSE); } free(tmp); return (SUNRabs(bcc - SUN_RCONST(1.0) / SUN_RCONST(3.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(A*c) = 1/6 */ -static sunbooleantype __order3b(sunrealtype* b, sunrealtype** A, sunrealtype* c, - int s) +static sunbooleantype arkode_butcher_order3b(sunrealtype* b, sunrealtype** A, + sunrealtype* c, int s) { sunrealtype bAc; sunrealtype* tmp = calloc(s, sizeof(sunrealtype)); - if (__mv(A, c, s, tmp)) + if (arkode_butcher_mv(A, c, s, tmp)) { free(tmp); return (SUNFALSE); } - if (__dot(b, tmp, s, &bAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp, s, &bAc)) { return (SUNFALSE); } free(tmp); return (SUNRabs(bAc - SUN_RCONST(1.0) / SUN_RCONST(6.0)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*(c1.*c2.*c3) = 1/4 */ -static sunbooleantype __order4a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order4a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + int s) { sunrealtype bccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bccc - SUN_RCONST(0.25)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1)'*(A*c2) = 1/8 */ -static sunbooleantype __order4b(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order4b(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + int s) { sunrealtype bcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(b, c1, s, tmp1)) + if (arkode_butcher_vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, c2, s, tmp2)) + if (arkode_butcher_mv(A, c2, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(tmp1, tmp2, s, &bcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp1, tmp2, s, &bcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAc - SUN_RCONST(0.125)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*A*(c1.*c2) = 1/12 */ -static sunbooleantype __order4c(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order4c(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + int s) { sunrealtype bAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, tmp1, s, tmp2)) + if (arkode_butcher_mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcc - SUN_RCONST(1.0) / SUN_RCONST(12.0)) > TOL) ? SUNFALSE @@ -2963,25 +3061,26 @@ static sunbooleantype __order4c(sunrealtype* b, sunrealtype** A, } /* b'*A1*A2*c = 1/24 */ -static sunbooleantype __order4d(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c, int s) +static sunbooleantype arkode_butcher_order4d(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c, + int s) { sunrealtype bAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c, s, tmp1)) + if (arkode_butcher_mv(A2, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAc - SUN_RCONST(1.0) / SUN_RCONST(24.0)) > TOL) ? SUNFALSE @@ -2989,97 +3088,100 @@ static sunbooleantype __order4d(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*c2.*c3.*c4) = 1/5 */ -static sunbooleantype __order5a(sunrealtype* b, sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s) +static sunbooleantype arkode_butcher_order5a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype* c4, int s) { sunrealtype bcccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c4, tmp2, s, tmp1)) + if (arkode_butcher_vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bcccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bcccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcccc - SUN_RCONST(0.2)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1.*c2)'*(A*c3) = 1/10 */ -static sunbooleantype __order5b(sunrealtype* b, sunrealtype* c1, sunrealtype* c2, - sunrealtype** A, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order5b(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A, + sunrealtype* c3, int s) { sunrealtype bccAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(b, tmp1, s, tmp2)) + if (arkode_butcher_vv(b, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, c3, s, tmp1)) + if (arkode_butcher_mv(A, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(tmp1, tmp2, s, &bccAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp1, tmp2, s, &bccAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bccAc - SUN_RCONST(0.1)) > TOL) ? SUNFALSE : SUNTRUE; } /* b'*((A1*c1).*(A2*c2)) = 1/20 */ -static sunbooleantype __order5c(sunrealtype* b, sunrealtype** A1, sunrealtype* c1, - sunrealtype** A2, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order5c(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, int s) { sunrealtype bAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__mv(A1, c1, s, tmp1)) + if (arkode_butcher_mv(A1, c1, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A2, c2, s, tmp2)) + if (arkode_butcher_mv(A2, c2, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(tmp1, tmp2, s, tmp3)) + if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(b, tmp3, s, &bAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp3, s, &bAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3087,31 +3189,32 @@ static sunbooleantype __order5c(sunrealtype* b, sunrealtype** A1, sunrealtype* c } /* (b.*c1)'*A*(c2.*c3) = 1/15 */ -static sunbooleantype __order5d(sunrealtype* b, sunrealtype* c1, sunrealtype** A, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order5d(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + sunrealtype* c3, int s) { sunrealtype bcAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c2, c3, s, tmp1)) + if (arkode_butcher_vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, tmp1, s, tmp2)) + if (arkode_butcher_mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(b, c1, s, tmp1)) + if (arkode_butcher_vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(tmp1, tmp2, s, &bcAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp1, tmp2, s, &bcAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAcc - SUN_RCONST(1.0) / SUN_RCONST(15.0)) > TOL) ? SUNFALSE @@ -3119,62 +3222,64 @@ static sunbooleantype __order5d(sunrealtype* b, sunrealtype* c1, sunrealtype** A } /* b'*A*(c1.*c2.*c3) = 1/20 */ -static sunbooleantype __order5e(sunrealtype* b, sunrealtype** A, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order5e(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + sunrealtype* c3, int s) { sunrealtype bAccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, tmp2, s, tmp1)) + if (arkode_butcher_mv(A, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bAccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bAccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAccc - SUN_RCONST(0.05)) > TOL) ? SUNFALSE : SUNTRUE; } /* (b.*c1)'*A1*A2*c2 = 1/30 */ -static sunbooleantype __order5f(sunrealtype* b, sunrealtype* c1, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order5f(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype* c2, int s) { sunrealtype bcAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c2, s, tmp1)) + if (arkode_butcher_mv(A2, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(b, c1, s, tmp1)) + if (arkode_butcher_vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(tmp1, tmp2, s, &bcAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp1, tmp2, s, &bcAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAc - SUN_RCONST(1.0) / SUN_RCONST(30.0)) > TOL) ? SUNFALSE @@ -3182,31 +3287,32 @@ static sunbooleantype __order5f(sunrealtype* b, sunrealtype* c1, sunrealtype** A } /* b'*A1*(c1.*(A2*c2)) = 1/40 */ -static sunbooleantype __order5g(sunrealtype* b, sunrealtype** A1, sunrealtype* c1, - sunrealtype** A2, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order5g(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, int s) { sunrealtype bAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c2, s, tmp1)) + if (arkode_butcher_mv(A2, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAc - SUN_RCONST(1.0) / SUN_RCONST(40.0)) > TOL) ? SUNFALSE @@ -3214,32 +3320,32 @@ static sunbooleantype __order5g(sunrealtype* b, sunrealtype** A1, sunrealtype* c } /* b'*A1*A2*(c1.*c2) = 1/60 */ -static sunbooleantype __order5h(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order5h(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype* c2, int s) { sunrealtype bAAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bAAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAcc - SUN_RCONST(1.0) / SUN_RCONST(60.0)) > TOL) ? SUNFALSE @@ -3247,32 +3353,32 @@ static sunbooleantype __order5h(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*c = 1/120 */ -static sunbooleantype __order5i(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c, int s) +static sunbooleantype arkode_butcher_order5i(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype* c, int s) { sunrealtype bAAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A3, c, s, tmp1)) + if (arkode_butcher_mv(A3, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bAAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAc - SUN_RCONST(1.0) / SUN_RCONST(120.0)) > TOL) ? SUNFALSE @@ -3280,38 +3386,39 @@ static sunbooleantype __order5i(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*c2.*c3.*c4.*c5) = 1/6 */ -static sunbooleantype __order6a(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype* c4, sunrealtype* c5, int s) +static sunbooleantype arkode_butcher_order6a(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype* c4, sunrealtype* c5, + int s) { sunrealtype bccccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c4, tmp2, s, tmp1)) + if (arkode_butcher_vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c5, tmp1, s, tmp2)) + if (arkode_butcher_vv(c5, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bccccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bccccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bccccc - SUN_RCONST(1.0) / SUN_RCONST(6.0)) > TOL) ? SUNFALSE @@ -3319,38 +3426,39 @@ static sunbooleantype __order6a(sunrealtype* b, sunrealtype* c1, } /* (b.*c1.*c2.*c3)'*(A*c4) = 1/12 */ -static sunbooleantype __order6b(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, - sunrealtype** A, sunrealtype* c4, int s) +static sunbooleantype arkode_butcher_order6b(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + sunrealtype** A, sunrealtype* c4, + int s) { sunrealtype bcccAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(b, c1, s, tmp1)) + if (arkode_butcher_vv(b, c1, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c2, tmp1, s, tmp2)) + if (arkode_butcher_vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp2, s, tmp1)) + if (arkode_butcher_vv(c3, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, c4, s, tmp2)) + if (arkode_butcher_mv(A, c4, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(tmp1, tmp2, s, &bcccAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp1, tmp2, s, &bcccAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcccAc - SUN_RCONST(1.0) / SUN_RCONST(12.0)) > TOL) ? SUNFALSE @@ -3358,43 +3466,44 @@ static sunbooleantype __order6b(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*c2).*(A2*c3)) = 1/24 */ -static sunbooleantype __order6c(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6c(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s) { sunrealtype bcAc2; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c3, s, tmp1)) + if (arkode_butcher_mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A1, c2, s, tmp2)) + if (arkode_butcher_mv(A1, c2, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(tmp1, tmp2, s, tmp3)) + if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(c1, tmp3, s, tmp1)) + if (arkode_butcher_vv(c1, tmp3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bcAc2)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bcAc2)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3403,43 +3512,44 @@ static sunbooleantype __order6c(sunrealtype* b, sunrealtype* c1, } /* (b.*c1.*c2)'*A*(c3.*c4) = 1/18 */ -static sunbooleantype __order6d(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A, - sunrealtype* c3, sunrealtype* c4, int s) +static sunbooleantype arkode_butcher_order6d(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A, + sunrealtype* c3, sunrealtype* c4, + int s) { sunrealtype bccAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__vv(c3, c4, s, tmp1)) + if (arkode_butcher_vv(c3, c4, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A, tmp1, s, tmp2)) + if (arkode_butcher_mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(b, tmp1, s, tmp3)) + if (arkode_butcher_vv(b, tmp1, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(tmp2, tmp3, s, &bccAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp2, tmp3, s, &bccAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3448,43 +3558,44 @@ static sunbooleantype __order6d(sunrealtype* b, sunrealtype* c1, } /* (b.*(c1.*c2))'*A1*A2*c3 = 1/36 */ -static sunbooleantype __order6e(sunrealtype* b, sunrealtype* c1, - sunrealtype* c2, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6e(sunrealtype* b, sunrealtype* c1, + sunrealtype* c2, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c3, + int s) { sunrealtype bccAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(b, tmp1, s, tmp2)) + if (arkode_butcher_vv(b, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A2, c3, s, tmp1)) + if (arkode_butcher_mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp3)) + if (arkode_butcher_mv(A1, tmp1, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(tmp2, tmp3, s, &bccAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(tmp2, tmp3, s, &bccAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3493,43 +3604,44 @@ static sunbooleantype __order6e(sunrealtype* b, sunrealtype* c1, } /* b'*((A1*A2*c1).*(A3*c2)) = 1/72 */ -static sunbooleantype __order6f(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6f(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s) { sunrealtype bAAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c1, s, tmp1)) + if (arkode_butcher_mv(A2, c1, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A3, c2, s, tmp1)) + if (arkode_butcher_mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(tmp1, tmp2, s, tmp3)) + if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(b, tmp3, s, &bAAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp3, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3538,38 +3650,39 @@ static sunbooleantype __order6f(sunrealtype* b, sunrealtype** A1, } /* b'*(c1.*(A*(c2.*c3.*c4))) = 1/24 */ -static sunbooleantype __order6g(sunrealtype* b, sunrealtype* c1, - sunrealtype** A, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s) +static sunbooleantype arkode_butcher_order6g(sunrealtype* b, sunrealtype* c1, + sunrealtype** A, sunrealtype* c2, + sunrealtype* c3, sunrealtype* c4, + int s) { sunrealtype bcAccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c2, c3, s, tmp1)) + if (arkode_butcher_vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c4, tmp1, s, tmp2)) + if (arkode_butcher_vv(c4, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, tmp2, s, tmp1)) + if (arkode_butcher_mv(A, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bcAccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bcAccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAccc - SUN_RCONST(1.0) / SUN_RCONST(24.0)) > TOL) ? SUNFALSE @@ -3577,38 +3690,39 @@ static sunbooleantype __order6g(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*(c2.*(A2*c3)))) = 1/48 */ -static sunbooleantype __order6h(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6h(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s) { sunrealtype bcAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c3, s, tmp1)) + if (arkode_butcher_mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c2, tmp1, s, tmp2)) + if (arkode_butcher_vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bcAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bcAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAcAc - SUN_RCONST(1.0) / SUN_RCONST(48.0)) > TOL) ? SUNFALSE @@ -3616,38 +3730,39 @@ static sunbooleantype __order6h(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*A2*(c2.*c3))) = 1/72 */ -static sunbooleantype __order6i(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6i(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype* c2, sunrealtype* c3, + int s) { sunrealtype bcAAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c2, c3, s, tmp1)) + if (arkode_butcher_vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bcAAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bcAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAcc - SUN_RCONST(1.0) / SUN_RCONST(72.0)) > TOL) ? SUNFALSE @@ -3655,38 +3770,39 @@ static sunbooleantype __order6i(sunrealtype* b, sunrealtype* c1, } /* b'*(c1.*(A1*A2*A3*c2)) = 1/144 */ -static sunbooleantype __order6j(sunrealtype* b, sunrealtype* c1, - sunrealtype** A1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6j(sunrealtype* b, sunrealtype* c1, + sunrealtype** A1, sunrealtype** A2, + sunrealtype** A3, sunrealtype* c2, + int s) { sunrealtype bcAAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A3, c2, s, tmp1)) + if (arkode_butcher_mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp2, s, tmp1)) + if (arkode_butcher_mv(A1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bcAAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bcAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bcAAAc - SUN_RCONST(1.0) / SUN_RCONST(144.0)) > TOL) ? SUNFALSE @@ -3694,38 +3810,39 @@ static sunbooleantype __order6j(sunrealtype* b, sunrealtype* c1, } /* b'*A*(c1.*c2.*c3.*c4) = 1/30 */ -static sunbooleantype __order6k(sunrealtype* b, sunrealtype** A, - sunrealtype* c1, sunrealtype* c2, - sunrealtype* c3, sunrealtype* c4, int s) +static sunbooleantype arkode_butcher_order6k(sunrealtype* b, sunrealtype** A, + sunrealtype* c1, sunrealtype* c2, + sunrealtype* c3, sunrealtype* c4, + int s) { sunrealtype bAcccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c4, tmp2, s, tmp1)) + if (arkode_butcher_vv(c4, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A, tmp1, s, tmp2)) + if (arkode_butcher_mv(A, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAcccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAcccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcccc - SUN_RCONST(1.0) / SUN_RCONST(30.0)) > TOL) ? SUNFALSE @@ -3733,38 +3850,39 @@ static sunbooleantype __order6k(sunrealtype* b, sunrealtype** A, } /* b'*A1*(c1.*c2.*(A2*c3)) = 1/60 */ -static sunbooleantype __order6l(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype* c2, - sunrealtype** A2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6l(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype* c2, + sunrealtype** A2, sunrealtype* c3, + int s) { sunrealtype bAccAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A2, c3, s, tmp1)) + if (arkode_butcher_mv(A2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c2, tmp1, s, tmp2)) + if (arkode_butcher_vv(c2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp2, s, tmp1)) + if (arkode_butcher_vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAccAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAccAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAccAc - SUN_RCONST(1.0) / SUN_RCONST(60.0)) > TOL) ? SUNFALSE @@ -3772,42 +3890,43 @@ static sunbooleantype __order6l(sunrealtype* b, sunrealtype** A1, } /* b'*A1*((A2*c1).*(A3*c2)) = 1/120 */ -static sunbooleantype __order6m(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6m(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s) { sunrealtype bAAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp3 = calloc(s, sizeof(sunrealtype)); - if (__mv(A3, c2, s, tmp1)) + if (arkode_butcher_mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__mv(A2, c1, s, tmp2)) + if (arkode_butcher_mv(A2, c1, s, tmp2)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__vv(tmp1, tmp2, s, tmp3)) + if (arkode_butcher_vv(tmp1, tmp2, s, tmp3)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp3, s, tmp1)) + if (arkode_butcher_mv(A1, tmp3, s, tmp1)) { free(tmp1); free(tmp2); free(tmp3); return (SUNFALSE); } - if (__dot(b, tmp1, s, &bAAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp1, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); free(tmp3); @@ -3816,38 +3935,39 @@ static sunbooleantype __order6m(sunrealtype* b, sunrealtype** A1, } /* b'*A1*(c1.*(A2*(c2.*c3))) = 1/90 */ -static sunbooleantype __order6n(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6n(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype* c2, sunrealtype* c3, + int s) { sunrealtype bAcAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c2, c3, s, tmp1)) + if (arkode_butcher_vv(c2, c3, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp2, s, tmp1)) + if (arkode_butcher_vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAcAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAcAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAcc - SUN_RCONST(1.0) / SUN_RCONST(90.0)) > TOL) ? SUNFALSE @@ -3855,38 +3975,39 @@ static sunbooleantype __order6n(sunrealtype* b, sunrealtype** A1, } /* b'*A1*(c1.*(A2*A3*c2)) = 1/180 */ -static sunbooleantype __order6o(sunrealtype* b, sunrealtype** A1, - sunrealtype* c1, sunrealtype** A2, - sunrealtype** A3, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6o(sunrealtype* b, sunrealtype** A1, + sunrealtype* c1, sunrealtype** A2, + sunrealtype** A3, sunrealtype* c2, + int s) { sunrealtype bAcAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A3, c2, s, tmp1)) + if (arkode_butcher_mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp2, s, tmp1)) + if (arkode_butcher_vv(c1, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAcAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAcAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAcAAc - SUN_RCONST(1.0) / SUN_RCONST(180.0)) > TOL) ? SUNFALSE @@ -3894,38 +4015,39 @@ static sunbooleantype __order6o(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*(c1.*c2.*c3) = 1/120 */ -static sunbooleantype __order6p(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype* c2, sunrealtype* c3, int s) +static sunbooleantype arkode_butcher_order6p(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype* c2, sunrealtype* c3, + int s) { sunrealtype bAAccc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c3, tmp1, s, tmp2)) + if (arkode_butcher_vv(c3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp2, s, tmp1)) + if (arkode_butcher_mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAAccc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAAccc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAccc - SUN_RCONST(1.0) / SUN_RCONST(120.0)) > TOL) ? SUNFALSE @@ -3933,38 +4055,39 @@ static sunbooleantype __order6p(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*(c1.*(A3*c2)) = 1/240 */ -static sunbooleantype __order6q(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype* c1, - sunrealtype** A3, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6q(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype* c1, + sunrealtype** A3, sunrealtype* c2, + int s) { sunrealtype bAAcAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A3, c2, s, tmp1)) + if (arkode_butcher_mv(A3, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__vv(c1, tmp1, s, tmp2)) + if (arkode_butcher_vv(c1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp2, s, tmp1)) + if (arkode_butcher_mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAAcAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAAcAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAcAc - SUN_RCONST(1.0) / SUN_RCONST(240.0)) > TOL) ? SUNFALSE @@ -3972,38 +4095,39 @@ static sunbooleantype __order6q(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*(c1.*c2) = 1/360 */ -static sunbooleantype __order6r(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype* c1, sunrealtype* c2, int s) +static sunbooleantype arkode_butcher_order6r(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype* c1, sunrealtype* c2, + int s) { sunrealtype bAAAcc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__vv(c1, c2, s, tmp1)) + if (arkode_butcher_vv(c1, c2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A3, tmp1, s, tmp2)) + if (arkode_butcher_mv(A3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp2, s, tmp1)) + if (arkode_butcher_mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAAAcc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAAAcc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAcc - SUN_RCONST(1.0) / SUN_RCONST(360.0)) > TOL) ? SUNFALSE @@ -4011,38 +4135,39 @@ static sunbooleantype __order6r(sunrealtype* b, sunrealtype** A1, } /* b'*A1*A2*A3*A4*c = 1/720 */ -static sunbooleantype __order6s(sunrealtype* b, sunrealtype** A1, - sunrealtype** A2, sunrealtype** A3, - sunrealtype** A4, sunrealtype* c, int s) +static sunbooleantype arkode_butcher_order6s(sunrealtype* b, sunrealtype** A1, + sunrealtype** A2, sunrealtype** A3, + sunrealtype** A4, sunrealtype* c, + int s) { sunrealtype bAAAAc; sunrealtype* tmp1 = calloc(s, sizeof(sunrealtype)); sunrealtype* tmp2 = calloc(s, sizeof(sunrealtype)); - if (__mv(A4, c, s, tmp1)) + if (arkode_butcher_mv(A4, c, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A2, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A2, tmp2, s, tmp1)) + if (arkode_butcher_mv(A2, tmp2, s, tmp1)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__mv(A1, tmp1, s, tmp2)) + if (arkode_butcher_mv(A1, tmp1, s, tmp2)) { free(tmp1); free(tmp2); return (SUNFALSE); } - if (__dot(b, tmp2, s, &bAAAAc)) { return (SUNFALSE); } + if (arkode_butcher_dot(b, tmp2, s, &bAAAAc)) { return (SUNFALSE); } free(tmp1); free(tmp2); return (SUNRabs(bAAAAc - SUN_RCONST(1.0) / SUN_RCONST(720.0)) > TOL) ? SUNFALSE @@ -4065,12 +4190,12 @@ static int __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, P = 0; for (i = 1; i < 1000; i++) { - if (__vp(c, i - 1, s, tmp)) + if (arkode_butcher_vp(c, i - 1, s, tmp)) { free(tmp); return (0); } - if (__dot(b, tmp, s, &LHS)) + if (arkode_butcher_dot(b, tmp, s, &LHS)) { free(tmp); return (0); @@ -4087,12 +4212,12 @@ static int __ButcherSimplifyingAssumptions(sunrealtype** A, sunrealtype* b, alltrue = SUNTRUE; for (i = 0; i < s; i++) { - if (__vp(c, k - 1, s, tmp)) + if (arkode_butcher_vp(c, k - 1, s, tmp)) { free(tmp); return (0); } - if (__dot(A[i], tmp, s, &LHS)) + if (arkode_butcher_dot(A[i], tmp, s, &LHS)) { free(tmp); return (0); diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index d9fa09c041..adf22daadb 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -27,7 +27,7 @@ #include "arkode_interp_impl.h" /*=============================================================== - ERKStep Exported functions -- Required + Exported functions ===============================================================*/ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) @@ -144,45 +144,6 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) return ((void*)ark_mem); } -/*--------------------------------------------------------------- - erkStep_Resize: - - This routine resizes the memory within the ERKStep module. - ---------------------------------------------------------------*/ -int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) -{ - ARKodeERKStepMem step_mem; - sunindextype lrw1, liw1, lrw_diff, liw_diff; - int i, retval; - - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Determine change in vector sizes */ - lrw1 = liw1 = 0; - if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } - lrw_diff = lrw1 - ark_mem->lrw1; - liw_diff = liw1 - ark_mem->liw1; - ark_mem->lrw1 = lrw1; - ark_mem->liw1 = liw1; - - /* Resize the RHS vectors */ - for (i = 0; i < step_mem->stages; i++) - { - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->F[i])) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); - } - } - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- ERKStepReInit: @@ -246,6 +207,49 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) return (ARK_SUCCESS); } +/*=============================================================== + Interface routines supplied to ARKODE + ===============================================================*/ + +/*--------------------------------------------------------------- + erkStep_Resize: + + This routine resizes the memory within the ERKStep module. + ---------------------------------------------------------------*/ +int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + ARKodeERKStepMem step_mem; + sunindextype lrw1, liw1, lrw_diff, liw_diff; + int i, retval; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Determine change in vector sizes */ + lrw1 = liw1 = 0; + if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } + lrw_diff = lrw1 - ark_mem->lrw1; + liw_diff = liw1 - ark_mem->liw1; + ark_mem->lrw1 = lrw1; + ark_mem->liw1 = liw1; + + /* Resize the RHS vectors */ + for (i = 0; i < step_mem->stages; i++) + { + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->F[i])) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- erkStep_Free frees all ERKStep memory. ---------------------------------------------------------------*/ @@ -346,14 +350,6 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) #endif } -/*=============================================================== - ERKStep Private functions - ===============================================================*/ - -/*--------------------------------------------------------------- - Interface routines supplied to ARKODE - ---------------------------------------------------------------*/ - /*--------------------------------------------------------------- erkStep_Init: @@ -742,9 +738,9 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== Internal utility routines - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- erkStep_AccessARKODEStepMem: @@ -1061,13 +1057,16 @@ int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsmPtr) return (ARK_SUCCESS); } +/*=============================================================== + Internal utility routines for relaxation + ===============================================================*/ + /* ----------------------------------------------------------------------------- * erkStep_RelaxDeltaE * * Computes the change in the relaxation functions for use in relaxation methods * delta_e = h * sum_i b_i * <rjac(z_i), f_i> * ---------------------------------------------------------------------------*/ - int erkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, long int* num_relax_jac_evals, sunrealtype* delta_e_out) { @@ -1147,7 +1146,6 @@ int erkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, * * Returns the method order * ---------------------------------------------------------------------------*/ - int erkStep_GetOrder(ARKodeMem ark_mem) { ARKodeERKStepMem step_mem = (ARKodeERKStepMem)(ark_mem->step_mem); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index f8c1711228..ffbf9a18fb 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -27,844 +27,730 @@ #include "arkode_erkstep_impl.h" /*=============================================================== - ERKStep Optional input functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. + Exported optional input functions. ===============================================================*/ -int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} -int ERKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) -{ - return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); -} +/*--------------------------------------------------------------- + ERKStepSetTable: -int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} + Specifies to use a customized Butcher table for the explicit + portion of the system. -int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) + If d==NULL, then the method is automatically flagged as a + fixed-step method; a user MUST also call either + ERKStepSetFixedStep or ERKStepSetInitStep to set the desired + time step size. + ---------------------------------------------------------------*/ +int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) { - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + sunindextype Blrw, Bliw; + int retval; -int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -void ERKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + /* check for legal inputs */ + if (B == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -void ERKStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - return (ARKodeSStolerances(arkode_mem, reltol, abstol)); -} + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->B); + step_mem->B = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); -} + /* set the relevant parameters */ + step_mem->stages = B->stages; + step_mem->q = B->q; + step_mem->p = B->p; -int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - return (ARKodeWFtolerances(arkode_mem, efun)); -} + /* copy the table into step memory */ + step_mem->B = ARKodeButcherTable_Copy(B); + if (step_mem->B == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } -int ERKStepSetDenseOrder(void* arkode_mem, int dord) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, dord)); -} + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ark_mem->liw += Bliw; + ark_mem->lrw += Blrw; -int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, degree)); + return (ARK_SUCCESS); } -int ERKStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} +/*--------------------------------------------------------------- + ERKStepSetTableNum: -int ERKStepSetUserData(void* arkode_mem, void* user_data) + Specifies to use a pre-existing Butcher table for the problem, + based on the integer flag passed to ARKodeButcherTable_LoadERK() + within the file arkode_butcher_erk.c. + ---------------------------------------------------------------*/ +int ERKStepSetTableNum(void* arkode_mem, ARKODE_ERKTableID etable) { - return (ARKodeSetUserData(arkode_mem, user_data)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + sunindextype Blrw, Bliw; + int retval; -int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) -{ - return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); -} + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) -{ - return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); -} + /* check that argument specifies an explicit table */ + if (etable < ARKODE_MIN_ERK_NUM || etable > ARKODE_MAX_ERK_NUM) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Illegal ERK table number"); + return (ARK_ILL_INPUT); + } -int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) -{ - return (ARKodeSetInitStep(arkode_mem, hin)); -} + /* clear any existing parameters and Butcher tables */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; -int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) -{ - return (ARKodeSetMinStep(arkode_mem, hmin)); -} + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->B); + step_mem->B = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; -int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) -{ - return (ARKodeSetMaxStep(arkode_mem, hmax)); -} + /* fill in table based on argument */ + step_mem->B = ARKodeButcherTable_LoadERK(etable); + if (step_mem->B == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Error setting table with that index"); + return (ARK_ILL_INPUT); + } + step_mem->stages = step_mem->B->stages; + step_mem->q = step_mem->B->q; + step_mem->p = step_mem->B->p; -int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); -} + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ark_mem->liw += Bliw; + ark_mem->lrw += Blrw; -int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) -{ - return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); + return (ARK_SUCCESS); } -int ERKStepClearStopTime(void* arkode_mem) -{ - return (ARKodeClearStopTime(arkode_mem)); -} +/*--------------------------------------------------------------- + ERKStepSetTableName: -int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) + Specifies to use a pre-existing Butcher table for the problem, + based on the string passed to ARKodeButcherTable_LoadERKByNmae() + within the file arkode_butcher_erk.c. + ---------------------------------------------------------------*/ +int ERKStepSetTableName(void* arkode_mem, const char* etable) { - return (ARKodeSetRootDirection(arkode_mem, rootdir)); + return ERKStepSetTableNum(arkode_mem, arkButcherTableERKNameToID(etable)); } -int ERKStepSetNoInactiveRootWarn(void* arkode_mem) -{ - return (ARKodeSetNoInactiveRootWarn(arkode_mem)); -} +/*=============================================================== + Exported optional output functions. + ===============================================================*/ -int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) -{ - return (ARKodeSetConstraints(arkode_mem, constraints)); -} +/*--------------------------------------------------------------- + ERKStepGetNumRhsEvals: -int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) + Returns the current number of calls to f + ---------------------------------------------------------------*/ +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) { - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); -} + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) -{ - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} + /* get values from step_mem */ + *fevals = step_mem->nfe; -int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) -{ - return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); + return (ARK_SUCCESS); } -int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) -{ - return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); -} +/*--------------------------------------------------------------- + ERKStepGetCurrentButcherTable: -int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) + Sets pointers to the Butcher table currently in use. + ---------------------------------------------------------------*/ +int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) { - return (ARKodeSetSafetyFactor(arkode_mem, safety)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) -{ - return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); -} + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) -{ - return (ARKodeSetMinReduction(arkode_mem, eta_min)); + /* get tables from step_mem */ + *B = step_mem->B; + return (ARK_SUCCESS); } -int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) -{ - return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); -} +/*--------------------------------------------------------------- + ERKStepGetTimestepperStats: -int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) + Returns integrator statistics + ---------------------------------------------------------------*/ +int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, + long int* accsteps, long int* attempts, + long int* fevals, long int* netfails) { - return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); -} + ARKodeMem ark_mem; + ARKodeERKStepMem step_mem; + int retval; -int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) -{ - return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); -} + /* access ARKodeMem and ARKodeERKStepMem structures */ + retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) -{ - return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); + /* set expsteps and accsteps from adaptivity structure */ + *expsteps = ark_mem->hadapt_mem->nst_exp; + *accsteps = ark_mem->hadapt_mem->nst_acc; + + /* set remaining outputs */ + *attempts = ark_mem->nst_attempts; + *fevals = step_mem->nfe; + *netfails = ark_mem->netf; + + return (ARK_SUCCESS); } -int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) +/*=============================================================== + Private functions attached to ARKODE + ===============================================================*/ + +/*--------------------------------------------------------------- + erkStep_SetRelaxFn: + + Sets up the relaxation module using ERKStep's utility routines. + ---------------------------------------------------------------*/ +int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) { - return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); + return ( + arkRelaxCreate(ark_mem, rfn, rjac, erkStep_RelaxDeltaE, erkStep_GetOrder)); } -int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) +/*--------------------------------------------------------------- + erkStep_SetDefaults: + + Resets all ERKStep optional inputs to their default values. + Does not change problem-defining function pointers or + user_data pointer. + ---------------------------------------------------------------*/ +int erkStep_SetDefaults(ARKodeMem ark_mem) { - return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); + ARKodeERKStepMem step_mem; + int retval; + long int lenrw, leniw; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Remove current SUNAdaptController object, and replace with "PI" */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_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 != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "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, __LINE__, __func__, __FILE__, + "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 == SUN_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 = SUN_RCONST(0.3); /* max change on error-failed step */ + ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ + ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ + (void)SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, + SUN_RCONST(1.2)); + (void)SUNAdaptController_SetParams_PI(ark_mem->hadapt_mem->hcontroller, + SUN_RCONST(0.8), -SUN_RCONST(0.31)); + return (ARK_SUCCESS); } -int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +/*--------------------------------------------------------------- + erkStep_SetOrder: + + Specifies the method order + ---------------------------------------------------------------*/ +int erkStep_SetOrder(ARKodeMem ark_mem, int ord) { - return (ARKodeSetFixedStep(arkode_mem, hfixed)); + ARKodeERKStepMem step_mem; + sunindextype Blrw, Bliw; + int retval; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* set user-provided value, or default, depending on argument */ + if (ord <= 0) { step_mem->q = Q_DEFAULT; } + else { step_mem->q = ord; } + + /* clear Butcher tables, since user is requesting a change in method + or a reset to defaults. Tables will be set in ARKInitialSetup. */ + step_mem->stages = 0; + step_mem->p = 0; + + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ARKodeButcherTable_Free(step_mem->B); + step_mem->B = NULL; + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + + return (ARK_SUCCESS); } -int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) +/*--------------------------------------------------------------- + erkStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector + ---------------------------------------------------------------*/ +int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) { - return (ARKodeSetAdaptController(arkode_mem, C)); + int retval; + ARKodeERKStepMem step_mem; + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* return an error if local truncation error is not computed */ + if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); + return (ARK_SUCCESS); } -int ERKStepSetDefaults(void* arkode_mem) +/*--------------------------------------------------------------- + erkStep_PrintAllStats: + + Prints integrator statistics + ---------------------------------------------------------------*/ +int erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) { - return (ARKodeSetDefaults(arkode_mem)); + ARKodeERKStepMem step_mem; + int retval; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + fprintf(outfile, "RHS fn evals = %ld\n", step_mem->nfe); + break; + case SUN_OUTPUTFORMAT_CSV: + fprintf(outfile, ",RHS fn evals,%ld", step_mem->nfe); + fprintf(outfile, "\n"); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return (ARK_ILL_INPUT); + } + + return (ARK_SUCCESS); } -int ERKStepSetOrder(void* arkode_mem, int ord) +/*--------------------------------------------------------------- + erkStep_WriteParameters: + + Outputs all solver parameters to the provided file pointer. + ---------------------------------------------------------------*/ +int erkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) { - return (ARKodeSetOrder(arkode_mem, ord)); + ARKodeERKStepMem step_mem; + int retval; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* print integrator parameters to file */ + fprintf(fp, "ERKStep time step module parameters:\n"); + fprintf(fp, " Method order %i\n", step_mem->q); + fprintf(fp, "\n"); + + return (ARK_SUCCESS); } /*=============================================================== - ERKStep Optional output functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. + Exported-but-deprecated user-callable functions. ===============================================================*/ -int ERKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +int ERKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { - return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); + return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); } -int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) { - return (ARKodeGetNumSteps(arkode_mem, nsteps)); + return (ARKodeReset(arkode_mem, tR, yR)); } -int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) { - return (ARKodeGetActualInitStep(arkode_mem, hinused)); + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); } -int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) { - return (ARKodeGetLastStep(arkode_mem, hlast)); + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); } -int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun) { - return (ARKodeGetCurrentStep(arkode_mem, hcur)); + return (ARKodeWFtolerances(arkode_mem, efun)); } -int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) { - return (ARKodeGetCurrentTime(arkode_mem, tcur)); + return (ARKodeRootInit(arkode_mem, nrtfn, g)); } -int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +int ERKStepSetDefaults(void* arkode_mem) { - return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); + return (ARKodeSetDefaults(arkode_mem)); } -int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) +int ERKStepSetOrder(void* arkode_mem, int ord) { - return (ARKodeGetErrWeights(arkode_mem, eweight)); + return (ARKodeSetOrder(arkode_mem, ord)); } -int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int ERKStepSetInterpolantType(void* arkode_mem, int itype) { - return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); + return (ARKodeSetInterpolantType(arkode_mem, itype)); } -int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) +int ERKStepSetInterpolantDegree(void* arkode_mem, int degree) { - return (ARKodeGetNumGEvals(arkode_mem, ngevals)); + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); } -int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} - -int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) -{ - return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); -} - -int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} - -int ERKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); -} - -int ERKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); -} - -int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) +int ERKStepSetDenseOrder(void* arkode_mem, int dord) { - return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); } -int ERKStepGetUserData(void* arkode_mem, void** user_data) +int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C) { - return (ARKodeGetUserData(arkode_mem, user_data)); + return (ARKodeSetAdaptController(arkode_mem, C)); } -char* ERKStepGetReturnFlagName(long int flag) +int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust) { - return (ARKodeGetReturnFlagName(flag)); + return (ARKodeSetAdaptivityAdjustment(arkode_mem, adjust)); } -int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) +int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) { - return (ARKodeGetEstLocalErrors(arkode_mem, ele)); + return (ARKodeSetCFLFraction(arkode_mem, cfl_frac)); } -/* ----------------------------------------------------------------------------- - * Wrappers for the ARKODE relaxation module - * ---------------------------------------------------------------------------*/ - -/* ERKStep-specific utility routine */ -int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety) { - return ( - arkRelaxCreate(ark_mem, rfn, rjac, erkStep_RelaxDeltaE, erkStep_GetOrder)); + return (ARKodeSetSafetyFactor(arkode_mem, safety)); } -int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) { - return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); + return (ARKodeSetErrorBias(arkode_mem, bias)); } -int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) +int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) { - return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); + return (ARKodeSetMaxGrowth(arkode_mem, mx_growth)); } -int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min) { - return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); + return (ARKodeSetMinReduction(arkode_mem, eta_min)); } -int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) +int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) { - return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); + return (ARKodeSetFixedStepBounds(arkode_mem, lb, ub)); } -int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) +int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]) { - return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); + return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); } -int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) { - return (ARKodeSetRelaxSolver(arkode_mem, solver)); + return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); } -int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) { - return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); + return (ARKodeSetMaxFirstGrowth(arkode_mem, etamx1)); } -int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) { - return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); + return (ARKodeSetMaxEFailGrowth(arkode_mem, etamxf)); } -int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) +int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef) { - return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); + return (ARKodeSetSmallNumEFails(arkode_mem, small_nef)); } -int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) { - return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); + return (ARKodeSetStabilityFn(arkode_mem, EStab, estab_data)); } -int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef) { - return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); + return (ARKodeSetMaxErrTestFails(arkode_mem, maxnef)); } -int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints) { - return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); + return (ARKodeSetConstraints(arkode_mem, constraints)); } -int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) { - return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); } -int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) { - return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); } -int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin) { - return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); + return (ARKodeSetInitStep(arkode_mem, hin)); } -int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin) { - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); + return (ARKodeSetMinStep(arkode_mem, hmin)); } -int ERKStepWriteParameters(void* arkode_mem, FILE* fp) +int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax) { - return (ARKodeWriteParameters(arkode_mem, fp)); + return (ARKodeSetMaxStep(arkode_mem, hmax)); } -/*=============================================================== - 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, sunrealtype adapt_params[3]) +int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) { - return (arkSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params)); + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); } -/*--------------------------------------------------------------- - ERKStepSetAdaptivityFn: user should create/attach a custom - SUNAdaptController object. - ---------------------------------------------------------------*/ -int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) +int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop) { - return (arkSetAdaptivityFn(arkode_mem, hfun, h_data)); + return (ARKodeSetStopTime(arkode_mem, tstop)); } -/*--------------------------------------------------------------- - ERKStepSetErrorBias: user should set this value directly in the - SUNAdaptController object. - ---------------------------------------------------------------*/ -int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias) +int ERKStepClearStopTime(void* arkode_mem) { - return (ARKodeSetErrorBias(arkode_mem, bias)); + return (ARKodeClearStopTime(arkode_mem)); } -/*=============================================================== - ERKStep optional input functions -- stepper-specific - ===============================================================*/ - -/*--------------------------------------------------------------- - erkStep_SetDefaults: - - Resets all ERKStep optional inputs to their default values. - Does not change problem-defining function pointers or - user_data pointer. - ---------------------------------------------------------------*/ -int erkStep_SetDefaults(ARKodeMem ark_mem) +int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) { - ARKodeERKStepMem step_mem; - int retval; - long int lenrw, leniw; - - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Remove current SUNAdaptController object, and replace with "PI" */ - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_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 != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "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, __LINE__, __func__, __FILE__, - "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 == SUN_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 = SUN_RCONST(0.3); /* max change on error-failed step */ - ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ - ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ - (void)SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, - SUN_RCONST(1.2)); - (void)SUNAdaptController_SetParams_PI(ark_mem->hadapt_mem->hcontroller, - SUN_RCONST(0.8), -SUN_RCONST(0.31)); - return (ARK_SUCCESS); + return (ARKodeSetFixedStep(arkode_mem, hfixed)); } -/*--------------------------------------------------------------- - erkStep_SetOrder: - - Specifies the method order - ---------------------------------------------------------------*/ -int erkStep_SetOrder(ARKodeMem ark_mem, int ord) +int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) { - ARKodeERKStepMem step_mem; - sunindextype Blrw, Bliw; - int retval; - - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set user-provided value, or default, depending on argument */ - if (ord <= 0) { step_mem->q = Q_DEFAULT; } - else { step_mem->q = ord; } - - /* clear Butcher tables, since user is requesting a change in method - or a reset to defaults. Tables will be set in ARKInitialSetup. */ - step_mem->stages = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->B); - step_mem->B = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - return (ARK_SUCCESS); + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); } -/*--------------------------------------------------------------- - ERKStepSetTable: - - Specifies to use a customized Butcher table for the explicit - portion of the system. - - If d==NULL, then the method is automatically flagged as a - fixed-step method; a user MUST also call either - ERKStepSetFixedStep or ERKStepSetInitStep to set the desired - time step size. - ---------------------------------------------------------------*/ -int ERKStepSetTable(void* arkode_mem, ARKodeButcherTable B) +int ERKStepSetRootDirection(void* arkode_mem, int* rootdir) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - sunindextype Blrw, Bliw; - int retval; - - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* check for legal inputs */ - if (B == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->B); - step_mem->B = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - /* set the relevant parameters */ - step_mem->stages = B->stages; - step_mem->q = B->q; - step_mem->p = B->p; - - /* copy the table into step memory */ - step_mem->B = ARKodeButcherTable_Copy(B); - if (step_mem->B == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; - - return (ARK_SUCCESS); + return (ARKodeSetRootDirection(arkode_mem, rootdir)); } -/*--------------------------------------------------------------- - ERKStepSetTableNum: - - Specifies to use a pre-existing Butcher table for the problem, - based on the integer flag passed to ARKodeButcherTable_LoadERK() - within the file arkode_butcher_erk.c. - ---------------------------------------------------------------*/ -int ERKStepSetTableNum(void* arkode_mem, ARKODE_ERKTableID etable) +int ERKStepSetNoInactiveRootWarn(void* arkode_mem) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - sunindextype Blrw, Bliw; - int retval; - - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* check that argument specifies an explicit table */ - if (etable < ARKODE_MIN_ERK_NUM || etable > ARKODE_MAX_ERK_NUM) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Illegal ERK table number"); - return (ARK_ILL_INPUT); - } - - /* clear any existing parameters and Butcher tables */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; - - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ARKodeButcherTable_Free(step_mem->B); - step_mem->B = NULL; - ark_mem->liw -= Bliw; - ark_mem->lrw -= Blrw; - - /* fill in table based on argument */ - step_mem->B = ARKodeButcherTable_LoadERK(etable); - if (step_mem->B == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Error setting table with that index"); - return (ARK_ILL_INPUT); - } - step_mem->stages = step_mem->B->stages; - step_mem->q = step_mem->B->q; - step_mem->p = step_mem->B->p; - - ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); - ark_mem->liw += Bliw; - ark_mem->lrw += Blrw; - - return (ARK_SUCCESS); + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); } -/*--------------------------------------------------------------- - ERKStepSetTableName: - - Specifies to use a pre-existing Butcher table for the problem, - based on the string passed to ARKodeButcherTable_LoadERKByNmae() - within the file arkode_butcher_erk.c. - ---------------------------------------------------------------*/ -int ERKStepSetTableName(void* arkode_mem, const char* etable) +int ERKStepSetUserData(void* arkode_mem, void* user_data) { - return ERKStepSetTableNum(arkode_mem, arkButcherTableERKNameToID(etable)); + return (ARKodeSetUserData(arkode_mem, user_data)); } -/*=============================================================== - ERKStep optional output functions -- stepper-specific - ===============================================================*/ - -/*--------------------------------------------------------------- - erkStep_GetEstLocalErrors: Returns the current local truncation - error estimate vector - ---------------------------------------------------------------*/ -int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) +int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) { - int retval; - ARKodeERKStepMem step_mem; - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* return an error if local truncation error is not computed */ - if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } - - /* otherwise, copy local truncation error vector to output */ - N_VScale(ONE, ark_mem->tempv1, ele); - return (ARK_SUCCESS); + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); } -/*--------------------------------------------------------------- - ERKStepGetNumRhsEvals: - - Returns the current number of calls to f - ---------------------------------------------------------------*/ -int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) -{ - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get values from step_mem */ - *fevals = step_mem->nfe; - - return (ARK_SUCCESS); +int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); } -/*--------------------------------------------------------------- - ERKStepGetCurrentButcherTable: +int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} - Sets pointers to the Butcher table currently in use. - ---------------------------------------------------------------*/ -int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B) +int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetNumExpSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumExpSteps(arkode_mem, nsteps)); +} - /* get tables from step_mem */ - *B = step_mem->B; - return (ARK_SUCCESS); +int ERKStepGetNumAccSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumAccSteps(arkode_mem, nsteps)); } -/*--------------------------------------------------------------- - ERKStepGetTimestepperStats: +int ERKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +{ + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); +} - Returns integrator statistics - ---------------------------------------------------------------*/ -int ERKStepGetTimestepperStats(void* arkode_mem, long int* expsteps, - long int* accsteps, long int* attempts, - long int* fevals, long int* netfails) +int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + return (ARKodeGetNumErrTestFails(arkode_mem, netfails)); +} - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele) +{ + return (ARKodeGetEstLocalErrors(arkode_mem, ele)); +} - /* set expsteps and accsteps from adaptivity structure */ - *expsteps = ark_mem->hadapt_mem->nst_exp; - *accsteps = ark_mem->hadapt_mem->nst_acc; +int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); +} - /* set remaining outputs */ - *attempts = ark_mem->nst_attempts; - *fevals = step_mem->nfe; - *netfails = ark_mem->netf; +int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumSteps(arkode_mem, nsteps)); +} - return (ARK_SUCCESS); +int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused) +{ + return (ARKodeGetActualInitStep(arkode_mem, hinused)); } -/*--------------------------------------------------------------- - erkStep_PrintAllStats: +int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (ARKodeGetLastStep(arkode_mem, hlast)); +} - Prints integrator statistics - ---------------------------------------------------------------*/ -int erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) { - ARKodeERKStepMem step_mem; - int retval; + return (ARKodeGetCurrentStep(arkode_mem, hcur)); +} - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (ARKodeGetCurrentTime(arkode_mem, tcur)); +} - switch (fmt) - { - case SUN_OUTPUTFORMAT_TABLE: - fprintf(outfile, "RHS fn evals = %ld\n", step_mem->nfe); - break; - case SUN_OUTPUTFORMAT_CSV: - fprintf(outfile, ",RHS fn evals,%ld", step_mem->nfe); - fprintf(outfile, "\n"); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid formatting option."); - return (ARK_ILL_INPUT); - } +int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +{ + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); +} - return (ARK_SUCCESS); +int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (ARKodeGetErrWeights(arkode_mem, eweight)); } -/*=============================================================== - ERKStep parameter output - ===============================================================*/ +int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); +} -/*--------------------------------------------------------------- - erkStep_WriteParameters: +int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound) +{ + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); +} - Outputs all solver parameters to the provided file pointer. - ---------------------------------------------------------------*/ -int erkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) { - ARKodeERKStepMem step_mem; - int retval; + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); +} - /* access ARKodeERKStepMem structure */ - retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int ERKStepGetUserData(void* arkode_mem, void** user_data) +{ + return (ARKodeGetUserData(arkode_mem, user_data)); +} - /* print integrator parameters to file */ - fprintf(fp, "ERKStep time step module parameters:\n"); - fprintf(fp, " Method order %i\n", step_mem->q); - fprintf(fp, "\n"); +int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} - return (ARK_SUCCESS); +char* ERKStepGetReturnFlagName(long int flag) +{ + return (ARKodeGetReturnFlagName(flag)); } -/*--------------------------------------------------------------- - ERKStepWriteButcher: +int ERKStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); +} - Outputs Butcher tables to the provided file pointer. - ---------------------------------------------------------------*/ int ERKStepWriteButcher(void* arkode_mem, FILE* fp) { int retval; @@ -891,6 +777,94 @@ int ERKStepWriteButcher(void* arkode_mem, FILE* fp) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +{ + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); +} + +void ERKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void ERKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) +{ + return (ARKodeSetRelaxFn(arkode_mem, rfn, rjac)); +} + +int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf) +{ + return (ARKodeSetRelaxEtaFail(arkode_mem, eta_rf)); +} + +int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) +{ + return (ARKodeSetRelaxLowerBound(arkode_mem, lower)); +} + +int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails) +{ + return (ARKodeSetRelaxMaxFails(arkode_mem, max_fails)); +} + +int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters) +{ + return (ARKodeSetRelaxMaxIters(arkode_mem, max_iters)); +} + +int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) +{ + return (ARKodeSetRelaxSolver(arkode_mem, solver)); +} + +int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) +{ + return (ARKodeSetRelaxResTol(arkode_mem, res_tol)); +} + +int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) +{ + return (ARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol)); +} + +int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) +{ + return (ARKodeSetRelaxUpperBound(arkode_mem, upper)); +} + +int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals) +{ + return (ARKodeGetNumRelaxFnEvals(arkode_mem, r_evals)); +} + +int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) +{ + return (ARKodeGetNumRelaxJacEvals(arkode_mem, J_evals)); +} + +int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails) +{ + return (ARKodeGetNumRelaxFails(arkode_mem, relax_fails)); +} + +int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails) +{ + return (ARKodeGetNumRelaxBoundFails(arkode_mem, fails)); +} + +int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails) +{ + return (ARKodeGetNumRelaxSolveFails(arkode_mem, fails)); +} + +int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters) +{ + return (ARKodeGetNumRelaxSolveIters(arkode_mem, iters)); +} + +/*=============================================================== EOF - ---------------------------------------------------------------*/ + ===============================================================*/ diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 271ca1b309..4f6cad21be 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -66,23 +66,29 @@ extern "C" { ===============================================================*/ /* Basic ARKODE defaults */ -#define Q_DEFAULT 4 /* method order */ -#define MXSTEP_DEFAULT 500 /* max steps between returns */ -#define MAXNEF 7 /* max number of error failures */ -#define MAXNCF 10 /* max number of convergence failures */ -#define MAXCONSTRFAILS 10 /* max number of constraint failures */ -#define MXHNIL 10 /* max number of t+h==h warnings */ +/* method order */ +#define Q_DEFAULT 4 +/* max steps between returns */ +#define MXSTEP_DEFAULT 500 +/* max number of error failures */ +#define MAXNEF 7 +/* max number of convergence failures */ +#define MAXNCF 10 +/* max number of constraint failures */ +#define MAXCONSTRFAILS 10 +/* max number of t+h==h warnings */ +#define MXHNIL 10 /* Numeric constants */ -#define ZERO SUN_RCONST(0.0) /* real 0.0 */ -#define TINY SUN_RCONST(1.0e-10) /* small number */ -#define TENTH SUN_RCONST(0.1) /* real 0.1 */ -#define HALF SUN_RCONST(0.5) /* real 0.5 */ -#define ONE SUN_RCONST(1.0) /* real 1.0 */ -#define TWO SUN_RCONST(2.0) /* real 2.0 */ -#define THREE SUN_RCONST(3.0) /* real 3.0 */ -#define FOUR SUN_RCONST(4.0) /* real 4.0 */ -#define FIVE SUN_RCONST(5.0) /* real 5.0 */ +#define ZERO SUN_RCONST(0.0) +#define TINY SUN_RCONST(1.0e-10) +#define TENTH SUN_RCONST(0.1) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define THREE SUN_RCONST(3.0) +#define FOUR SUN_RCONST(4.0) +#define FIVE SUN_RCONST(5.0) /* Control constants for tolerances */ #define ARK_SS 0 @@ -139,12 +145,45 @@ extern "C" { #define ONEPSM SUN_RCONST(1.000001) #define ONEMSM SUN_RCONST(0.999999) +/*--------------------------------------------------------------- + Input flag to linear solver setup routine: CONVFAIL + + ARK_NO_FAILURES : Either this is the first lsetup call for + this step, or the local error test failed + on the previous attempt at this step (but + the Newton iteration converged). + + ARK_FAIL_BAD_J : This value is passed to lsetup if + + (a) The previous Newton corrector + iteration did not converge and the + linear solver's setup routine + indicated that its Jacobian-related + data is not current + or + + (b) During the previous Newton corrector + iteration, the linear solver's solve + routine failed in a recoverable manner + and the linear solver's setup routine + indicated that its Jacobian-related + data is not current. + + ARK_FAIL_OTHER : During the current internal step try, the + previous Newton iteration failed to + converge even though the linear solver was + using current Jacobian-related data. + --------------------------------------------------------------*/ +#define ARK_NO_FAILURES 0 +#define ARK_FAIL_BAD_J 1 +#define ARK_FAIL_OTHER 2 + /*=============================================================== ARKODE Interface function definitions ===============================================================*/ -/* NOTE: documentation for the purpose of these functions is - located at the end of this file */ +/* NOTE: documentation for the purpose of these internal interface + functions is located at the end of this file */ /* linear solver interface functions */ typedef int (*ARKLinsolInitFn)(ARKodeMem ark_mem); @@ -157,7 +196,7 @@ typedef int (*ARKLinsolSolveFn)(ARKodeMem ark_mem, N_Vector b, sunrealtype tcur, sunrealtype client_tol, int mnewt); typedef int (*ARKLinsolFreeFn)(ARKodeMem ark_mem); -/* mass-matrix solver interface functions */ +/* mass matrix solver interface functions */ typedef int (*ARKMassInitFn)(ARKodeMem ark_mem); typedef int (*ARKMassSetupFn)(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); @@ -166,26 +205,8 @@ typedef int (*ARKMassSolveFn)(ARKodeMem ark_mem, N_Vector b, sunrealtype client_tol); typedef int (*ARKMassFreeFn)(ARKodeMem ark_mem); -/* time stepper interface functions */ +/* time stepper interface functions -- general */ typedef int (*ARKTimestepInitFn)(ARKodeMem ark_mem, int init_type); -typedef int (*ARKTimestepAttachLinsolFn)(ARKodeMem ark_mem, ARKLinsolInitFn linit, - ARKLinsolSetupFn lsetup, - ARKLinsolSolveFn lsolve, - ARKLinsolFreeFn lfree, - SUNLinearSolver_Type lsolve_type, - void* lmem); -typedef int (*ARKTimestepAttachMasssolFn)( - ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, - ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, - sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void* mass_mem); -typedef void (*ARKTimestepDisableLSetup)(ARKodeMem ark_mem); -typedef void (*ARKTimestepDisableMSetup)(ARKodeMem ark_mem); -typedef void* (*ARKTimestepGetLinMemFn)(ARKodeMem ark_mem); -typedef void* (*ARKTimestepGetMassMemFn)(ARKodeMem ark_mem); -typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(ARKodeMem ark_mem); -typedef int (*ARKTimestepGetGammasFn)(ARKodeMem ark_mem, sunrealtype* gamma, - sunrealtype* gamrat, sunbooleantype** jcur, - sunbooleantype* dgamma_fail); typedef int (*ARKTimestepFullRHSFn)(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); typedef int (*ARKTimestepStepFn)(ARKodeMem ark_mem, sunrealtype* dsm, int* nflag); @@ -200,11 +221,30 @@ typedef int (*ARKTimestepReset)(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR); typedef void (*ARKTimestepFree)(ARKodeMem ark_mem); typedef void (*ARKTimestepPrintMem)(ARKodeMem ark_mem, FILE* outfile); typedef int (*ARKTimestepSetDefaults)(ARKodeMem ark_mem); -typedef int (*ARKTimestepComputeState)(ARKodeMem ark_mem, N_Vector zcor, - N_Vector z); +typedef int (*ARKTimestepSetOrder)(ARKodeMem ark_mem, int maxord); + +/* time stepper interface functions -- temporal adaptivity */ +typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); + +/* time stepper interface functions -- relaxation */ typedef int (*ARKTimestepSetRelaxFn)(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); -typedef int (*ARKTimestepSetOrder)(ARKodeMem ark_mem, int maxord); + +/* time stepper interface functions -- implicit solvers */ +typedef int (*ARKTimestepAttachLinsolFn)(ARKodeMem ark_mem, ARKLinsolInitFn linit, + ARKLinsolSetupFn lsetup, + ARKLinsolSolveFn lsolve, + ARKLinsolFreeFn lfree, + SUNLinearSolver_Type lsolve_type, + void* lmem); +typedef void (*ARKTimestepDisableLSetup)(ARKodeMem ark_mem); +typedef void* (*ARKTimestepGetLinMemFn)(ARKodeMem ark_mem); +typedef ARKRhsFn (*ARKTimestepGetImplicitRHSFn)(ARKodeMem ark_mem); +typedef int (*ARKTimestepGetGammasFn)(ARKodeMem ark_mem, sunrealtype* gamma, + sunrealtype* gamrat, sunbooleantype** jcur, + sunbooleantype* dgamma_fail); +typedef int (*ARKTimestepComputeState)(ARKodeMem ark_mem, N_Vector zcor, + N_Vector z); typedef int (*ARKTimestepSetNonlinearSolver)(ARKodeMem ark_mem, SUNNonlinearSolver NLS); typedef int (*ARKTimestepSetLinear)(ARKodeMem ark_mem, int timedepend); @@ -224,7 +264,6 @@ typedef int (*ARKTimestepSetStagePredictFn)(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); typedef int (*ARKTimestepGetNumLinSolvSetups)(ARKodeMem ark_mem, long int* nlinsetups); -typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); typedef int (*ARKTimestepGetCurrentGamma)(ARKodeMem ark_mem, sunrealtype* gamma); typedef int (*ARKTimestepGetNonlinearSystemData)( ARKodeMem ark_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, @@ -236,6 +275,14 @@ typedef int (*ARKTimestepGetNumNonlinSolvConvFails)(ARKodeMem ark_mem, typedef int (*ARKTimestepGetNonlinSolvStats)(ARKodeMem ark_mem, long int* nniters, long int* nnfails); +/* time stepper interface functions -- non-identity mass matrices */ +typedef int (*ARKTimestepAttachMasssolFn)( + ARKodeMem ark_mem, ARKMassInitFn minit, ARKMassSetupFn msetup, + ARKMassMultFn mmult, ARKMassSolveFn msolve, ARKMassFreeFn mfree, + sunbooleantype time_dep, SUNLinearSolver_Type msolve_type, void* mass_mem); +typedef void (*ARKTimestepDisableMSetup)(ARKodeMem ark_mem); +typedef void* (*ARKTimestepGetMassMemFn)(ARKodeMem ark_mem); + /*=============================================================== ARKODE interpolation module definition ===============================================================*/ @@ -341,16 +388,8 @@ struct ARKodeMemRec void* r_data; /* user pointer passed to rfun */ sunbooleantype constraintsSet; /* check inequality constraints */ - /* Time stepper module */ - ARKTimestepAttachLinsolFn step_attachlinsol; - ARKTimestepAttachMasssolFn step_attachmasssol; - ARKTimestepDisableLSetup step_disablelsetup; - ARKTimestepDisableMSetup step_disablemsetup; - ARKTimestepGetLinMemFn step_getlinmem; - ARKTimestepGetMassMemFn step_getmassmem; - ARKTimestepGetImplicitRHSFn step_getimplicitrhs; - ARKMassMultFn step_mmult; - ARKTimestepGetGammasFn step_getgammas; + /* Time stepper module -- general */ + void* step_mem; ARKTimestepInitFn step_init; ARKTimestepFullRHSFn step_fullrhs; ARKTimestepStepFn step; @@ -362,9 +401,24 @@ struct ARKodeMemRec ARKTimestepFree step_free; ARKTimestepPrintMem step_printmem; ARKTimestepSetDefaults step_setdefaults; - ARKTimestepComputeState step_computestate; - ARKTimestepSetRelaxFn step_setrelaxfn; ARKTimestepSetOrder step_setorder; + + /* Time stepper module -- temporal adaptivity */ + sunbooleantype step_supports_adaptive; + ARKTimestepGetEstLocalErrors step_getestlocalerrors; + + /* Time stepper module -- relaxation */ + sunbooleantype step_supports_relaxation; + ARKTimestepSetRelaxFn step_setrelaxfn; + + /* Time stepper module -- implcit solvers */ + sunbooleantype step_supports_implicit; + ARKTimestepAttachLinsolFn step_attachlinsol; + ARKTimestepDisableLSetup step_disablelsetup; + ARKTimestepGetLinMemFn step_getlinmem; + ARKTimestepGetImplicitRHSFn step_getimplicitrhs; + ARKTimestepGetGammasFn step_getgammas; + ARKTimestepComputeState step_computestate; ARKTimestepSetNonlinearSolver step_setnonlinearsolver; ARKTimestepSetLinear step_setlinear; ARKTimestepSetNonlinear step_setnonlinear; @@ -378,18 +432,19 @@ struct ARKodeMemRec ARKTimestepSetMaxNonlinIters step_setmaxnonliniters; ARKTimestepSetNonlinConvCoef step_setnonlinconvcoef; ARKTimestepSetStagePredictFn step_setstagepredictfn; - ARKTimestepGetEstLocalErrors step_getestlocalerrors; ARKTimestepGetNumLinSolvSetups step_getnumlinsolvsetups; ARKTimestepGetCurrentGamma step_getcurrentgamma; ARKTimestepGetNonlinearSystemData step_getnonlinearsystemdata; ARKTimestepGetNumNonlinSolvIters step_getnumnonlinsolviters; ARKTimestepGetNumNonlinSolvConvFails step_getnumnonlinsolvconvfails; ARKTimestepGetNonlinSolvStats step_getnonlinsolvstats; - sunbooleantype step_supports_adaptive; - sunbooleantype step_supports_implicit; + + /* Time stepper module -- non-identity mass matrices */ sunbooleantype step_supports_massmatrix; - sunbooleantype step_supports_relaxation; - void* step_mem; + ARKTimestepAttachMasssolFn step_attachmasssol; + ARKTimestepDisableMSetup step_disablemsetup; + ARKTimestepGetMassMemFn step_getmassmem; + ARKMassMultFn step_mmult; /* N_Vector storage */ N_Vector ewt; /* error weight vector */ @@ -501,152 +556,351 @@ struct ARKodeMemRec }; /*=============================================================== - Interface To Linear Solvers + ARKODE PROTOTYPE FUNCTIONS (MAY BE REPLACED BY USER) ===============================================================*/ -/*--------------------------------------------------------------- - Communication between ARKODE and a ARKODE Linear Solver - ----------------------------------------------------------------- - convfail (input to lsetup) - - ARK_NO_FAILURES : Either this is the first lsetup call for - this step, or the local error test failed on - the previous attempt at this step (but the - Newton iteration converged). - - ARK_FAIL_BAD_J : This value is passed to lsetup if - - (a) The previous Newton corrector iteration - did not converge and the linear solver's - setup routine indicated that its Jacobian- - related data is not current - or - (b) During the previous Newton corrector - iteration, the linear solver's solve - routine failed in a recoverable manner - and the linear solver's setup routine - indicated that its Jacobian-related data - is not current. - - ARK_FAIL_OTHER : During the current internal step try, the - previous Newton iteration failed to converge - even though the linear solver was using - current Jacobian-related data. - --------------------------------------------------------------*/ - -/* Constants for convfail (input to lsetup) */ -#define ARK_NO_FAILURES 0 -#define ARK_FAIL_BAD_J 1 -#define ARK_FAIL_OTHER 2 +/* Prototype of internal rwtSet function */ +int arkRwtSet(N_Vector ycur, N_Vector weight, void* data); -/*--------------------------------------------------------------- - ARKLinsolInitFn - --------------------------------------------------------------- - This function should complete initializations for a specific - ARKODE linear solver interface, such as counters and statistics. - This should return 0 if it has successfully initialized the - ARKODE linear solver interface and a negative value otherwise. - If an error does occur, an appropriate message should be sent - to the error handler function. - ---------------------------------------------------------------*/ +/* Prototype of internal explicit stability estimation function */ +int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* user_data); -/*--------------------------------------------------------------- - ARKLinsolSetupFn - --------------------------------------------------------------- - This function should prepare the linear solver interface for - subsequent calls to the ARKLinsolSolveFn routine. It may - recompute Jacobian-related data is it deems necessary. Its - parameters are as follows: +/*=============================================================== + HIGH LEVEL ERROR HANDLER, USED THROUGHOUT ARKODE + ===============================================================*/ - arkode_mem - void* problem memory pointer of type ARKodeMem. See - the typedef earlier in this file. +void arkProcessError(ARKodeMem ark_mem, int error_code, int line, + const char* func, const char* file, const char* msgfmt, ...); - convfail - a flag to indicate any problem that occurred during - the solution of the nonlinear equation on the - current time step for which the linear solver is - being used. This flag can be used to help decide - whether the Jacobian data kept by a ARKODE linear - solver needs to be updated or not. - Its possible values have been documented above. +/*=============================================================== + ARKODE PRIVATE FUNCTION PROTOTYPES + ===============================================================*/ - tpred - the time for the current ARKODE internal step. +ARKodeMem arkCreate(SUNContext sunctx); +int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type); +sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v); +sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector** v, + sunindextype lrw1, long int* lrw, + sunindextype liw1, long int* liw); +sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl); +sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, + void* resize_data, sunindextype lrw_diff, + sunindextype liw_diff, N_Vector tmpl); +sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, + void* resize_data, sunindextype lrw_diff, + sunindextype liw_diff, N_Vector tmpl, N_Vector* v); +sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void* resize_data, + int count, N_Vector tmpl, N_Vector** v, + sunindextype lrw_diff, long int* lrw, + sunindextype liw_diff, long int* liw); +void arkFreeVec(ARKodeMem ark_mem, N_Vector* v); +void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, + sunindextype liw1, long int* liw); +void arkFreeVectors(ARKodeMem ark_mem); +sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem); +sunbooleantype arkCheckNvector(N_Vector tmpl); - ypred - the predicted y vector for the current ARKODE internal - step. +int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout); +int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask, int* ier); +int arkHin(ARKodeMem ark_mem, sunrealtype tout); +sunrealtype arkUpperBoundH0(ARKodeMem ark_mem, sunrealtype tdist); +int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, sunrealtype* yddnrm); - fpred - f(tpred, ypred). +int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm); +int arkHandleFailure(ARKodeMem ark_mem, int flag); - jcurPtr - a pointer to a boolean to be filled in by lsetup. - The function should set *jcurPtr=SUNTRUE if its Jacobian - data is current after the call and should set - *jcurPtr=SUNFALSE if its Jacobian data is not current. - Note: If lsetup calls for re-evaluation of - Jacobian data (based on convfail and ARKODE state - data), it should return *jcurPtr=SUNTRUE always; - otherwise an infinite loop can result. +int arkEwtSetSS(N_Vector ycur, N_Vector weight, void* arkode_mem); +int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem); +int arkEwtSetSmallReal(N_Vector ycur, N_Vector weight, void* arkode_mem); +int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight); +int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight); - vtemp1 - temporary N_Vector provided for use by lsetup. +int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); +int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); +int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); +int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, sunrealtype tau, + int nvec, sunrealtype* cvals, N_Vector* Xvecs, + N_Vector yguess); +int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr); +int arkCheckConstraints(ARKodeMem ark_mem, int* nflag, int* constrfails); +int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, + sunrealtype dsm); +int arkAccessHAdaptMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, + ARKodeHAdaptMem* hadapt_mem); - vtemp3 - temporary N_Vector provided for use by lsetup. +int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, + sunrealtype adapt_params[3]); +int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); - vtemp3 - temporary N_Vector provided for use by lsetup. +ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); +ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); - This routine should return 0 if successful, a positive value - for a recoverable error, and a negative value for an - unrecoverable error. - ---------------------------------------------------------------*/ +/* XBraid interface functions */ +int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); +int arkGetLastKFlag(void* arkode_mem, int* last_kflag); -/*--------------------------------------------------------------- - ARKLinsolSolveFn - --------------------------------------------------------------- - This routine must solve the linear equation P x = b, where - P is some approximation to (M - gamma J), M is the system mass - matrix, J = (df/dy)(tcur,ycur), and the RHS vector b is input. The - N-vector ycur contains the solver's current approximation to - y(tcur) and the vector fcur contains the N_Vector f(tcur,ycur). - The input client_tol contains the desired accuracy (in the wrms - norm) of the routine calling the solver; the ARKDLS solver - ignores this value and the ARKSPILS solver tightens it by the - factor eplifac. The input mnewt is the current nonlinear - iteration index (ignored by ARKDLS, used by ARKSPILS). +/*=============================================================== + Reusable ARKODE Error Messages + ===============================================================*/ - Additional vectors that are set within the ARKODE memory - structure, and that may be of use within an iterative linear - solver, include: +#if defined(SUNDIALS_EXTENDED_PRECISION) - ewt - the error weight vector (scaling for solution vector) +#define MSG_TIME "t = %Lg" +#define MSG_TIME_H "t = %Lg and h = %Lg" +#define MSG_TIME_INT "t = %Lg is not between tcur - hold = %Lg and tcur = %Lg." +#define MSG_TIME_TOUT "tout = %Lg" +#define MSG_TIME_TSTOP "tstop = %Lg" - rwt - the residual weight vector (scaling for rhs vector) +#elif defined(SUNDIALS_DOUBLE_PRECISION) - The solution is to be returned in the vector b. This should - return a positive value for a recoverable error and a - negative value for an unrecoverable error. Success is - indicated by a 0 return value. - ---------------------------------------------------------------*/ +#define MSG_TIME "t = %lg" +#define MSG_TIME_H "t = %lg and h = %lg" +#define MSG_TIME_INT "t = %lg is not between tcur - hold = %lg and tcur = %lg." +#define MSG_TIME_TOUT "tout = %lg" +#define MSG_TIME_TSTOP "tstop = %lg" -/*--------------------------------------------------------------- - ARKLinsolFreeFn - --------------------------------------------------------------- - This should free up any memory allocated by the linear solver - interface. This routine is called once a problem has been - completed and the linear solver is no longer needed. It should - return 0 upon success, or a nonzero on failure. - ---------------------------------------------------------------*/ +#else + +#define MSG_TIME "t = %g" +#define MSG_TIME_H "t = %g and h = %g" +#define MSG_TIME_INT "t = %g is not between tcur - hold = %g and tcur = %g." +#define MSG_TIME_TOUT "tout = %g" +#define MSG_TIME_TSTOP "tstop = %g" + +#endif + +/* Initialization and I/O error messages */ +#define MSG_ARK_NO_MEM "arkode_mem = NULL illegal." +#define MSG_ARK_ARKMEM_FAIL "Allocation of arkode_mem failed." +#define MSG_ARK_MEM_FAIL "A memory request failed." +#define MSG_ARK_NO_MALLOC "Attempt to call before ARKodeInit." +#define MSG_ARK_BAD_HMIN_HMAX "Inconsistent step size limits: hmin > hmax." +#define MSG_ARK_BAD_RELTOL "reltol < 0 illegal." +#define MSG_ARK_BAD_ABSTOL "abstol has negative component(s) (illegal)." +#define MSG_ARK_NULL_ABSTOL "abstol = NULL illegal." +#define MSG_ARK_BAD_RABSTOL "rabstol has negative component(s) (illegal)." +#define MSG_ARK_NULL_RABSTOL "rabstol = NULL illegal." +#define MSG_ARK_NULL_Y0 "y0 = NULL illegal." +#define MSG_ARK_Y0_FAIL_CONSTR "y0 fails to satisfy constraints." +#define MSG_ARK_NULL_F "Must specify at least one of fe, fi (both NULL)." +#define MSG_ARK_NULL_G "g = NULL illegal." +#define MSG_ARK_BAD_NVECTOR "A required vector operation is not implemented." +#define MSG_ARK_BAD_CONSTR "Illegal values in constraints vector." +#define MSG_ARK_NULL_DKY "dky = NULL illegal." +#define MSG_ARK_BAD_T "Illegal value for t. " MSG_TIME_INT +#define MSG_ARK_NO_ROOT "Rootfinding was not initialized." + +/* ARKODE Error Messages */ +#define MSG_ARK_YOUT_NULL "yout = NULL illegal." +#define MSG_ARK_TRET_NULL "tret = NULL illegal." +#define MSG_ARK_BAD_EWT "Initial ewt has component(s) equal to zero (illegal)." +#define MSG_ARK_EWT_NOW_BAD \ + "At " MSG_TIME ", a component of ewt has become <= 0." +#define MSG_ARK_BAD_RWT "Initial rwt has component(s) equal to zero (illegal)." +#define MSG_ARK_RWT_NOW_BAD \ + "At " MSG_TIME ", a component of rwt has become <= 0." +#define MSG_ARK_BAD_ITASK "Illegal value for itask." +#define MSG_ARK_BAD_H0 "h0 and tout - t0 inconsistent." +#define MSG_ARK_BAD_TOUT \ + "Trouble interpolating at " MSG_TIME_TOUT \ + ". tout too far back in direction of integration" +#define MSG_ARK_EWT_FAIL "The user-provide EwtSet function failed." +#define MSG_ARK_EWT_NOW_FAIL \ + "At " MSG_TIME ", the user-provide EwtSet function failed." +#define MSG_ARK_RWT_FAIL "The user-provide RwtSet function failed." +#define MSG_ARK_RWT_NOW_FAIL \ + "At " MSG_TIME ", the user-provide RwtSet function failed." +#define MSG_ARK_LINIT_FAIL "The linear solver's init routine failed." +#define MSG_ARK_HNIL_DONE \ + "The above warning has been issued mxhnil times and will not be issued " \ + "again for this problem." +#define MSG_ARK_TOO_CLOSE "tout too close to t0 to start integration." +#define MSG_ARK_MAX_STEPS \ + "At " MSG_TIME ", mxstep steps taken before reaching tout." +#define MSG_ARK_TOO_MUCH_ACC "At " MSG_TIME ", too much accuracy requested." +#define MSG_ARK_HNIL \ + "Internal " MSG_TIME_H " are such that t + h = t on the next step. The " \ + "solver will continue anyway." +#define MSG_ARK_ERR_FAILS \ + "At " MSG_TIME_H ", the error test failed repeatedly or with |h| = hmin." +#define MSG_ARK_CONV_FAILS \ + "At " MSG_TIME_H \ + ", the solver convergence test failed repeatedly or with |h| = hmin." +#define MSG_ARK_SETUP_FAILED \ + "At " MSG_TIME ", the setup routine failed in an unrecoverable manner." +#define MSG_ARK_SOLVE_FAILED \ + "At " MSG_TIME ", the solve routine failed in an unrecoverable manner." +#define MSG_ARK_FAILED_CONSTR \ + "At " MSG_TIME ", unable to satisfy inequality constraints." +#define MSG_ARK_RHSFUNC_FAILED \ + "At " MSG_TIME \ + ", the right-hand side routine failed in an unrecoverable manner." +#define MSG_ARK_RHSFUNC_UNREC \ + "At " MSG_TIME ", the right-hand side failed in a recoverable manner, but " \ + "no recovery is possible." +#define MSG_ARK_RHSFUNC_REPTD \ + "At " MSG_TIME " repeated recoverable right-hand side function errors." +#define MSG_ARK_RTFUNC_FAILED \ + "At " MSG_TIME ", the rootfinding routine failed in an unrecoverable " \ + "manner." +#define MSG_ARK_CLOSE_ROOTS "Root found at and very near " MSG_TIME "." +#define MSG_ARK_BAD_TSTOP \ + "The value " MSG_TIME_TSTOP " is behind current " MSG_TIME \ + " in the direction of integration." +#define MSG_ARK_INACTIVE_ROOTS \ + "At the end of the first step, there are still some root functions " \ + "identically 0. This warning will not be issued again." +#define MSG_ARK_RESIZE_FAIL "Error in user-supplied resize() function." +#define MSG_ARK_MASSINIT_FAIL "The mass matrix solver's init routine failed." +#define MSG_ARK_MASSSETUP_FAIL "The mass matrix solver's setup routine failed." +#define MSG_ARK_MASSSOLVE_FAIL "The mass matrix solver failed." +#define MSG_ARK_NLS_FAIL \ + "At " MSG_TIME " the nonlinear solver failed in an unrecoverable manner." +#define MSG_ARK_USER_PREDICT_FAIL \ + "At " MSG_TIME \ + " the user-supplied predictor failed in an unrecoverable manner." +#define MSG_ARKADAPT_NO_MEM "Adaptivity memory structure not allocated." +#define MSG_ARK_VECTOROP_ERR "At " MSG_TIME ", a vector operation failed." +#define MSG_ARK_INNERSTEP_FAILED \ + "At " MSG_TIME ", the inner stepper failed in an unrecoverable manner." +#define MSG_ARK_POSTPROCESS_STEP_FAIL \ + "At " MSG_TIME \ + ", the step postprocessing routine failed in an unrecoverable manner." +#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." + +/*=============================================================== + + Documentation for internal ARKODE interfaces + + =============================================================== + + Interfaces To Implicit Solvers + + --------------------------------------------------------------- + + ARKLinsolInitFn + + This function should complete initializations for a specific + ARKODE linear solver interface, such as counters and statistics. + This should return 0 if it has successfully initialized the + ARKODE linear solver interface and a negative value otherwise. + If an error does occur, an appropriate message should be sent + to the error handler function. + + --------------------------------------------------------------- + + ARKLinsolSetupFn + + This function should prepare the linear solver interface for + subsequent calls to the ARKLinsolSolveFn routine. It may + recompute Jacobian-related data is it deems necessary. Its + parameters are as follows: + + arkode_mem - void* problem memory pointer of type ARKodeMem. See + the typedef earlier in this file. + + convfail - a flag to indicate any problem that occurred during + the solution of the nonlinear equation on the + current time step for which the linear solver is + being used. This flag can be used to help decide + whether the Jacobian data kept by a ARKODE linear + solver needs to be updated or not. + Its possible values have been documented above. + + tpred - the time for the current ARKODE internal step. + + ypred - the predicted y vector for the current ARKODE internal + step. + + fpred - f(tpred, ypred). + + jcurPtr - a pointer to a boolean to be filled in by lsetup. + The function should set *jcurPtr=SUNTRUE if its Jacobian + data is current after the call and should set + *jcurPtr=SUNFALSE if its Jacobian data is not current. + Note: If lsetup calls for re-evaluation of + Jacobian data (based on convfail and ARKODE state + data), it should return *jcurPtr=SUNTRUE always; + otherwise an infinite loop can result. + + vtemp1 - temporary N_Vector provided for use by lsetup. + + vtemp3 - temporary N_Vector provided for use by lsetup. + + vtemp3 - temporary N_Vector provided for use by lsetup. + + This routine should return 0 if successful, a positive value + for a recoverable error, and a negative value for an + unrecoverable error. + + --------------------------------------------------------------- + + ARKLinsolSolveFn + + This routine must solve the linear equation P x = b, where + P is some approximation to (M - gamma J), M is the system mass + matrix, J = (df/dy)(tcur,ycur), and the RHS vector b is input. The + N-vector ycur contains the solver's current approximation to + y(tcur) and the vector fcur contains the N_Vector f(tcur,ycur). + The input client_tol contains the desired accuracy (in the wrms + norm) of the routine calling the solver; the direct solvers + ignore this value and iterative solvers tighten it by the + factor eplifac. The input mnewt is the current nonlinear + iteration index (ignored by direct solvers, used by iterative + solvers). + + Additional vectors that are set within the ARKODE memory + structure, and that may be of use within an iterative linear + solver, include: + + ewt - the error weight vector (scaling for solution vector) + + rwt - the residual weight vector (scaling for rhs vector) + + The solution is to be returned in the vector b. This should + return a positive value for a recoverable error and a + negative value for an unrecoverable error. Success is + indicated by a 0 return value. + + --------------------------------------------------------------- + + ARKLinsolFreeFn + + This should free up any memory allocated by the linear solver + interface. This routine is called once a problem has been + completed and the linear solver is no longer needed. It should + return 0 upon success, or a nonzero on failure. + + =============================================================== + + Interfaces For Non-Identity Mass Matrix Support -/*--------------------------------------------------------------- - ARKMassInitFn --------------------------------------------------------------- + + ARKMassInitFn + This function should complete initializations for a specific mass matrix linear solver interface, such as counters and statistics. A function of this type should return 0 if it has successfully initialized the mass matrix linear solver and a negative value otherwise. If an error does occur, an appropriate message should be sent to the error handler function. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKMassSetupFn --------------------------------------------------------------- + + ARKMassSetupFn + This should prepare the mass matrix solver interface for subsequent calls to the ARKMassMultFn and ARKMassSolveFn routines. It may recompute mass matrix related data is it deems @@ -659,21 +913,21 @@ struct ARKodeMemRec This routine should return 0 if successful, and a negative value for an unrecoverable error. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKMassMultFn --------------------------------------------------------------- + + ARKMassMultFn + This must compute the matrix-vector product, z = M*v, where M is the system mass matrix the vector v is input, and the vector z is output. The mmult routine returns a positive value for a recoverable error and a negative value for an unrecoverable error. Success is indicated by a 0 return value. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKMassSolveFn --------------------------------------------------------------- + + ARKMassSolveFn + This must solve the linear equation M x = b, where M is the system mass matrix, and the RHS vector b is input. The sunrealtype client_tol contains the desired accuracy (in the wrms @@ -692,143 +946,24 @@ struct ARKodeMemRec This routine should return a positive value for a recoverable error and a negative value for an unrecoverable error. Success is indicated by a 0 return value. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKMassFreeFn --------------------------------------------------------------- + + ARKMassFreeFn + This should free up any memory allocated by the mass matrix solver interface. This routine is called once a problem has been completed and the solver is no longer needed. It should return 0 upon success, or a nonzero on failure. - ---------------------------------------------------------------*/ -/*=============================================================== - Interface to Time Steppers - ===============================================================*/ + =============================================================== + + Internal Interface to Time Steppers -- General -/*--------------------------------------------------------------- - ARKTimestepAttachLinsolFn --------------------------------------------------------------- - This routine should attach the various set of system linear - solver interface routines, linear solver interface data - structure, and system linear solver type to the ARKODE time - stepping module pointed to in ark_mem->step_mem. This will - be called by the ARKODE linear solver interface. - This routine should return 0 if it has successfully attached - these items and a negative value otherwise. If an error does - occur, an appropriate message should be sent to the ARKODE - error handler function. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepAttachMasssolFn - --------------------------------------------------------------- - This routine should attach the various set of mass matrix - linear solver interface routines, data structure, mass matrix - type, and solver type to the ARKODE time stepping module - pointed to in ark_mem->step_mem. This will be called by the - ARKODE linear solver interface. - - This routine should return 0 if it has successfully attached - these items, and a negative value otherwise. If an error does - occur, an appropriate message should be sent to the ARKODE - error handler function. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepDisableLSetup - --------------------------------------------------------------- - This routine should NULLify any ARKLinsolSetupFn function - pointer stored in the ARKODE time stepping module (initially set - in a call to ARKTimestepAttachLinsolFn). - - This routine has no return value. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepDisableMSetup - --------------------------------------------------------------- - This routine should NULLify any ARKMassSetupFn function pointer - stored in the ARKODE time stepping module (initially set in a - call to ARKTimestepAttachMasssolFn). - - This routine has no return value. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepGetLinMemFn - --------------------------------------------------------------- - This routine should return the linear solver memory structure - used by the ARKODE time stepping module pointed to in - ark_mem->step_mem. This will be called by the ARKODE linear - solver interface. - - This routine should return NULL if no linear solver memory - structure is attached. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepGetMassMemFn - --------------------------------------------------------------- - This routine should return the mass matrix linear solver memory - structure used by the ARKODE time stepping module pointed to in - ark_mem->step_mem. This will be called the ARKODE mass matrix - solver interface. - - This routine should return NULL if no mass matrix solver memory - structure is attached. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepGetImplicitRHSFn - --------------------------------------------------------------- - This routine should return the implicit RHS function pointer for - the current nonlinear solve (if there are multiple); it is used - inside the linear solver interfaces for approximation of - Jacobian matrix elements and/or matrix-vector products. - - This routine should return NULL if no implicit RHS function is - active. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- - ARKTimestepGetGammasFn - --------------------------------------------------------------- - This routine should fill the current value of gamma, the ratio - of the current gamma value to the gamma value when the - Jacobian/preconditioner was last updated, a pointer to the - time step module internal sunbooleantype variable indicating - whether the preconditioner is current, and a logic value - indicating whether the gamma value is sufficiently stale - to cause recomputation of Jacobian/preconditioner data. Here, - gamma is the coefficient preceding the RHS Jacobian - matrix, J, in the full nonlinear system Jacobian, - A = M - gamma*J. - - The time step module must contain a sunbooleantype variable to - provide for the boolentype pointer (jcur). This is only used - by iterative linear solvers, so could be NULL for time step - modules that only work with direct linear solvers. Optionally, - the value of this parameter could be set to SUNFALSE prior to - return from the ARKTimestepGetGammasFn to force recalculation - of preconditioner information. - - The value of the logic flag is used as follows: if a previous - Newton iteration failed due to a bad Jacobian/preconditioner, - and this flag is SUNFALSE, this will trigger recalculation of - the Jacobian/preconditioner. - - This routine should return 0 if it has successfully attached - these items, and a negative value otherwise. If an error does - occur, an appropriate message should be sent to the ARKODE - error handler function. - ---------------------------------------------------------------*/ - -/*--------------------------------------------------------------- ARKTimestepInitFn - --------------------------------------------------------------- + This routine is called just prior to performing internal time steps (after all user "set" routines have been called) from within arkInitialSetup. It should complete initializations for @@ -841,11 +976,11 @@ struct ARKodeMemRec the ARKODE time stepper module and a negative value otherwise. If an error does occur, an appropriate message should be sent to the error handler function. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKTimestepFullRHSFn --------------------------------------------------------------- + + ARKTimestepFullRHSFn + This routine must compute the full ODE right-hand side function at the inputs (t,y), and store the result in the N_Vector f. Depending on the type of stepper, this may be just the single @@ -878,11 +1013,11 @@ struct ARKodeMemRec 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. - ---------------------------------------------------------------*/ -/*--------------------------------------------------------------- - ARKTimestepStepFn --------------------------------------------------------------- + + ARKTimestepStepFn + This routine serves the primary purpose of any ARKODE time-stepping module: it performs a single time step of the method (with embedding, if possible). @@ -925,237 +1060,390 @@ struct ARKodeMemRec >0 => step encountered recoverable failure; reduce step and retry (if possible) <0 => step encountered unrecoverable failure - ---------------------------------------------------------------*/ -/*=============================================================== - ARKODE PROTOTYPE FUNCTIONS (MAY BE REPLACED BY USER) - ===============================================================*/ + --------------------------------------------------------------- -/* Prototype of internal rwtSet function */ -int arkRwtSet(N_Vector ycur, N_Vector weight, void* data); + ARKTimetepSetUserDataFn -/* Prototype of internal explicit stability estimation function */ -int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* user_data); + This optional routine provides the input from ARKodeSetUserData + to the stepper. -/*=============================================================== - HIGH LEVEL ERROR HANDLER, USED THROUGHOUT ARKODE - ===============================================================*/ + --------------------------------------------------------------- -void arkProcessError(ARKodeMem ark_mem, int error_code, int line, - const char* func, const char* file, const char* msgfmt, ...); + ARKTimestepPrintAllStats -/*=============================================================== - ARKODE PRIVATE FUNCTION PROTOTYPES - ===============================================================*/ -#ifdef __GNUC__ -#define SUNDIALS_UNUSED __attribute__((unused)) -#else -#define SUNDIALS_UNUSED -#endif + This optional routine allows the stepper to optionally print + out any internally-stored solver statistics when + ARKodePrintAllStats is called. -int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type); -sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v); -sunbooleantype arkAllocVecArray(int count, N_Vector tmpl, N_Vector** v, - sunindextype lrw1, long int* lrw, - sunindextype liw1, long int* liw); -void arkFreeVec(ARKodeMem ark_mem, N_Vector* v); -void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, - sunindextype liw1, long int* liw); -sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, - void* resize_data, sunindextype lrw_diff, - sunindextype liw_diff, N_Vector tmpl, N_Vector* v); -sunbooleantype arkResizeVecArray(ARKVecResizeFn resize, void* resize_data, - int count, N_Vector tmpl, N_Vector** v, - sunindextype lrw_diff, long int* lrw, - sunindextype liw_diff, long int* liw); -sunbooleantype arkCheckTimestepper(ARKodeMem ark_mem); -sunbooleantype arkCheckNvector(N_Vector tmpl); -sunbooleantype arkAllocVectors(ARKodeMem ark_mem, N_Vector tmpl); -sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, - void* resize_data, sunindextype lrw_diff, - sunindextype liw_diff, N_Vector tmpl); -void arkFreeVectors(ARKodeMem ark_mem); + --------------------------------------------------------------- -int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout); -int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask, int* ier); -int arkHin(ARKodeMem ark_mem, sunrealtype tout); -sunrealtype arkUpperBoundH0(ARKodeMem ark_mem, sunrealtype tdist); -int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, sunrealtype* yddnrm); + ARKTimestepWriteParameters -int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm); -int arkHandleFailure(ARKodeMem ark_mem, int flag); + This optional routine allows the stepper to optionally print + out any solver parameters when ARKodeWriteParameters is called. -int arkEwtSetSS(N_Vector ycur, N_Vector weight, void* arkode_mem); -int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem); -int arkEwtSetSmallReal(N_Vector ycur, N_Vector weight, void* arkode_mem); -int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight); -int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight); + --------------------------------------------------------------- -ARKodeMem arkCreate(SUNContext sunctx); + ARKTimestepResize -int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess); -int arkPredict_Bootstrap(ARKodeMem ark_mem, sunrealtype hj, sunrealtype tau, - int nvec, sunrealtype* cvals, N_Vector* Xvecs, - N_Vector yguess); -int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr); -int arkCheckConstraints(ARKodeMem ark_mem, int* nflag, int* constrfails); -int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, - sunrealtype dsm); -int arkAccessHAdaptMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, - ARKodeHAdaptMem* hadapt_mem); + This optional routine allows the stepper to optionally resize + any internal vector storage when ARKodeResize is called. -int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, - sunrealtype adapt_params[3]); -int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); + --------------------------------------------------------------- -ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); -ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); + ARKTimestepReset -/* XBraid interface functions */ -int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); -int arkGetLastKFlag(void* arkode_mem, int* last_kflag); + This optional routine allows the stepper to reset any internal + data when ARKodeReset is called. -/*=============================================================== - Reusable ARKODE Error Messages - ===============================================================*/ + --------------------------------------------------------------- -#if defined(SUNDIALS_EXTENDED_PRECISION) + ARKTimestepFree -#define MSG_TIME "t = %Lg" -#define MSG_TIME_H "t = %Lg and h = %Lg" -#define MSG_TIME_INT "t = %Lg is not between tcur - hold = %Lg and tcur = %Lg." -#define MSG_TIME_TOUT "tout = %Lg" -#define MSG_TIME_TSTOP "tstop = %Lg" + This optional routine allows the stepper the free any + interally-stored memory when ARKodeFree is called. -#elif defined(SUNDIALS_DOUBLE_PRECISION) + --------------------------------------------------------------- -#define MSG_TIME "t = %lg" -#define MSG_TIME_H "t = %lg and h = %lg" -#define MSG_TIME_INT "t = %lg is not between tcur - hold = %lg and tcur = %lg." -#define MSG_TIME_TOUT "tout = %lg" -#define MSG_TIME_TSTOP "tstop = %lg" + ARKTimestepPrintMem -#else + This optional routine allows the stepper to output any internal + memory (typically for debugging purposes) when ARKodePrintMem is + called. -#define MSG_TIME "t = %g" -#define MSG_TIME_H "t = %g and h = %g" -#define MSG_TIME_INT "t = %g is not between tcur - hold = %g and tcur = %g." -#define MSG_TIME_TOUT "tout = %g" -#define MSG_TIME_TSTOP "tstop = %g" + --------------------------------------------------------------- -#endif + ARKTimestepSetDefaults -/* Initialization and I/O error messages */ -#define MSG_ARK_NO_MEM "arkode_mem = NULL illegal." -#define MSG_ARK_ARKMEM_FAIL "Allocation of arkode_mem failed." -#define MSG_ARK_MEM_FAIL "A memory request failed." -#define MSG_ARK_NO_MALLOC "Attempt to call before ARKodeInit." -#define MSG_ARK_BAD_HMIN_HMAX "Inconsistent step size limits: hmin > hmax." -#define MSG_ARK_BAD_RELTOL "reltol < 0 illegal." -#define MSG_ARK_BAD_ABSTOL "abstol has negative component(s) (illegal)." -#define MSG_ARK_NULL_ABSTOL "abstol = NULL illegal." -#define MSG_ARK_BAD_RABSTOL "rabstol has negative component(s) (illegal)." -#define MSG_ARK_NULL_RABSTOL "rabstol = NULL illegal." -#define MSG_ARK_NULL_Y0 "y0 = NULL illegal." -#define MSG_ARK_Y0_FAIL_CONSTR "y0 fails to satisfy constraints." -#define MSG_ARK_NULL_F "Must specify at least one of fe, fi (both NULL)." -#define MSG_ARK_NULL_G "g = NULL illegal." -#define MSG_ARK_BAD_NVECTOR "A required vector operation is not implemented." -#define MSG_ARK_BAD_CONSTR "Illegal values in constraints vector." -#define MSG_ARK_NULL_DKY "dky = NULL illegal." -#define MSG_ARK_BAD_T "Illegal value for t. " MSG_TIME_INT -#define MSG_ARK_NO_ROOT "Rootfinding was not initialized." + This optional routine allows the stepper to reset any internal + solver parameters to their default values, and is called by + ARKodeSetDefaults. -/* ARKODE Error Messages */ -#define MSG_ARK_YOUT_NULL "yout = NULL illegal." -#define MSG_ARK_TRET_NULL "tret = NULL illegal." -#define MSG_ARK_BAD_EWT "Initial ewt has component(s) equal to zero (illegal)." -#define MSG_ARK_EWT_NOW_BAD \ - "At " MSG_TIME ", a component of ewt has become <= 0." -#define MSG_ARK_BAD_RWT "Initial rwt has component(s) equal to zero (illegal)." -#define MSG_ARK_RWT_NOW_BAD \ - "At " MSG_TIME ", a component of rwt has become <= 0." -#define MSG_ARK_BAD_ITASK "Illegal value for itask." -#define MSG_ARK_BAD_H0 "h0 and tout - t0 inconsistent." -#define MSG_ARK_BAD_TOUT \ - "Trouble interpolating at " MSG_TIME_TOUT \ - ". tout too far back in direction of integration" -#define MSG_ARK_EWT_FAIL "The user-provide EwtSet function failed." -#define MSG_ARK_EWT_NOW_FAIL \ - "At " MSG_TIME ", the user-provide EwtSet function failed." -#define MSG_ARK_RWT_FAIL "The user-provide RwtSet function failed." -#define MSG_ARK_RWT_NOW_FAIL \ - "At " MSG_TIME ", the user-provide RwtSet function failed." -#define MSG_ARK_LINIT_FAIL "The linear solver's init routine failed." -#define MSG_ARK_HNIL_DONE \ - "The above warning has been issued mxhnil times and will not be issued " \ - "again for this problem." -#define MSG_ARK_TOO_CLOSE "tout too close to t0 to start integration." -#define MSG_ARK_MAX_STEPS \ - "At " MSG_TIME ", mxstep steps taken before reaching tout." -#define MSG_ARK_TOO_MUCH_ACC "At " MSG_TIME ", too much accuracy requested." -#define MSG_ARK_HNIL \ - "Internal " MSG_TIME_H " are such that t + h = t on the next step. The " \ - "solver will continue anyway." -#define MSG_ARK_ERR_FAILS \ - "At " MSG_TIME_H ", the error test failed repeatedly or with |h| = hmin." -#define MSG_ARK_CONV_FAILS \ - "At " MSG_TIME_H \ - ", the solver convergence test failed repeatedly or with |h| = hmin." -#define MSG_ARK_SETUP_FAILED \ - "At " MSG_TIME ", the setup routine failed in an unrecoverable manner." -#define MSG_ARK_SOLVE_FAILED \ - "At " MSG_TIME ", the solve routine failed in an unrecoverable manner." -#define MSG_ARK_FAILED_CONSTR \ - "At " MSG_TIME ", unable to satisfy inequality constraints." -#define MSG_ARK_RHSFUNC_FAILED \ - "At " MSG_TIME \ - ", the right-hand side routine failed in an unrecoverable manner." -#define MSG_ARK_RHSFUNC_UNREC \ - "At " MSG_TIME ", the right-hand side failed in a recoverable manner, but " \ - "no recovery is possible." -#define MSG_ARK_RHSFUNC_REPTD \ - "At " MSG_TIME " repeated recoverable right-hand side function errors." -#define MSG_ARK_RTFUNC_FAILED \ - "At " MSG_TIME ", the rootfinding routine failed in an unrecoverable " \ - "manner." -#define MSG_ARK_CLOSE_ROOTS "Root found at and very near " MSG_TIME "." -#define MSG_ARK_BAD_TSTOP \ - "The value " MSG_TIME_TSTOP " is behind current " MSG_TIME \ - " in the direction of integration." -#define MSG_ARK_INACTIVE_ROOTS \ - "At the end of the first step, there are still some root functions " \ - "identically 0. This warning will not be issued again." -#define MSG_ARK_RESIZE_FAIL "Error in user-supplied resize() function." -#define MSG_ARK_MASSINIT_FAIL "The mass matrix solver's init routine failed." -#define MSG_ARK_MASSSETUP_FAIL "The mass matrix solver's setup routine failed." -#define MSG_ARK_MASSSOLVE_FAIL "The mass matrix solver failed." -#define MSG_ARK_NLS_FAIL \ - "At " MSG_TIME " the nonlinear solver failed in an unrecoverable manner." -#define MSG_ARK_USER_PREDICT_FAIL \ - "At " MSG_TIME \ - " the user-supplied predictor failed in an unrecoverable manner." -#define MSG_ARKADAPT_NO_MEM "Adaptivity memory structure not allocated." -#define MSG_ARK_VECTOROP_ERR "At " MSG_TIME ", a vector operation failed." -#define MSG_ARK_INNERSTEP_FAILED \ - "At " MSG_TIME ", the inner stepper failed in an unrecoverable manner." -#define MSG_ARK_POSTPROCESS_STEP_FAIL \ - "At " MSG_TIME \ - ", the step postprocessing routine failed in an unrecoverable manner." -#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." + --------------------------------------------------------------- + + ARKTimestepSetOrder + + This optional routine allows the stepper to accept any user- + requested method order parameter that was passed to + ARKodeSetOrder. + + =============================================================== + + Internal Interface to Time Steppers -- Temporal Adaptivity + + These should only be provided if the stepper supports temporal + adaptivity, and should be indicated by setting the flag + "step_supports_adaptive" to SUNTRUE. + + --------------------------------------------------------------- + + ARKTimestepGetEstLocalErrors + + This routine requests the stepper to copy its internal + estimate of the local trunction error to the output (called by + ARKodeGetEstLocalErrors). + + =============================================================== + + Internal Interface to Time Steppers -- Relaxation + + These should only be provided if the stepper supports + "relaxation Runge--Kutta methods" (or similar), and should be + indicated by setting the flag "step_supports_relaxation" to SUNTRUE. + + --------------------------------------------------------------- + + ARKTimestepSetRelaxFn + + This routine is called by ARKodeSetRelaxFn, and expects the + stepper to call ARKODE's "arkRelaxCreate" routine with the + appropriate stepper-specific function pointers. + + =============================================================== + + Internal Interface to Time Steppers -- Implicit Solvers + + These should only be provided if the stepper uses implicit + linear/nonlinear solvers, and should be indicated by setting + the flag "step_supports_implicit" to SUNTRUE. + + --------------------------------------------------------------- + + ARKTimestepAttachLinsolFn + + This routine should attach the various set of system linear + solver interface routines, linear solver interface data + structure, and system linear solver type to the ARKODE time + stepping module pointed to in ark_mem->step_mem. This will + be called by the ARKODE linear solver interface. + + This routine should return 0 if it has successfully attached + these items and a negative value otherwise. If an error does + occur, an appropriate message should be sent to the ARKODE + error handler function. + + --------------------------------------------------------------- + + ARKTimestepDisableLSetup + + This routine should NULLify any ARKLinsolSetupFn function + pointer stored in the ARKODE time stepping module (initially set + in a call to ARKTimestepAttachLinsolFn). + + This routine has no return value. + + --------------------------------------------------------------- + + ARKTimestepGetLinMemFn + + This routine should return the linear solver memory structure + used by the ARKODE time stepping module pointed to in + ark_mem->step_mem. This will be called by the ARKODE linear + solver interface. + + This routine should return NULL if no linear solver memory + structure is attached. + + --------------------------------------------------------------- + + ARKTimestepGetImplicitRHSFn + + This routine should return the implicit RHS function pointer for + the current nonlinear solve (if there are multiple); it is used + inside the linear solver interfaces for approximation of + Jacobian matrix elements and/or matrix-vector products. + + This routine should return NULL if no implicit RHS function is + active. + + --------------------------------------------------------------- + + ARKTimestepGetGammasFn + + This routine should fill the current value of gamma, the ratio + of the current gamma value to the gamma value when the + Jacobian/preconditioner was last updated, a pointer to the + time step module internal sunbooleantype variable indicating + whether the preconditioner is current, and a logic value + indicating whether the gamma value is sufficiently stale + to cause recomputation of Jacobian/preconditioner data. Here, + gamma is the coefficient preceding the RHS Jacobian + matrix, J, in the full nonlinear system Jacobian, + A = M - gamma*J. + + The time step module must contain a sunbooleantype variable to + provide for the boolentype pointer (jcur). This is only used + by iterative linear solvers, so could be NULL for time step + modules that only work with direct linear solvers. Optionally, + the value of this parameter could be set to SUNFALSE prior to + return from the ARKTimestepGetGammasFn to force recalculation + of preconditioner information. + + The value of the logic flag is used as follows: if a previous + Newton iteration failed due to a bad Jacobian/preconditioner, + and this flag is SUNFALSE, this will trigger recalculation of + the Jacobian/preconditioner. + + This routine should return 0 if it has successfully attached + these items, and a negative value otherwise. If an error does + occur, an appropriate message should be sent to the ARKODE + error handler function. + + --------------------------------------------------------------- + + ARKTimestepComputeState + + This routine should combine any stepper-stored prediction with + the input correction to fill the current state vector within + an implicit solve (called by ARKodeComputeState). + + --------------------------------------------------------------- + + ARKTimestepSetNonlinearSolver + + This routine is called by ARKodeSetNonlinearSolver, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetLinear + + This routine is called by ARKodeSetLinear, and allows the + stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetNonlinear + + This routine is called by ARKodeSetNonlinear, and allows the + stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetNlsRhsFn + + This routine is called by ARKodeSetNlsRhsFn, and allows the + stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetDeduceImplicitRhs + + This routine is called by ARKodeSetDeduceImplicitRhs, and + allows the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetNonlinCRDown + + This routine is called by ARKodeSetNonlinCRDown, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetNonlinRDiv + + This routine is called by ARKodeSetNonlinRDiv, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetDeltaGammaMax + + This routine is called by ARKodeSetDeltaGammaMax, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetLSetupFrequency + + This routine is called by ARKodeSetLSetupFrequency, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetPredictorMethod + + This routine is called by ARKodeSetPredictorMethod, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetMaxNonlinIters + + This routine is called by ARKodeSetMaxNonlinIters, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetNonlinConvCoef + + This routine is called by ARKodeSetNonlinConvCoef, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepSetStagePredictFn + + This routine is called by ARKodeSetStagePredictFn, and allows + the stepper to store the corresponding user input. + + --------------------------------------------------------------- + + ARKTimestepGetNumLinSolvSetups + + This routine is called by ARKodeGetNumLinSolvSetups, and + requests that the stepper return the corresponding output + value. + + --------------------------------------------------------------- + + ARKTimestepGetCurrentGamma + + This routine is called by ARKodeGetCurrentGamma, and + requests that the stepper return the corresponding output + value. + + --------------------------------------------------------------- + + ARKTimestepGetNonlinearSystemData + + This routine is called by ARKodeGetNonlinearSystemData, and + requests that the stepper return the corresponding output + values. + + --------------------------------------------------------------- + + ARKTimestepGetNumNonlinSolvIters + + This routine is called by ARKodeGetNumNonlinSolvIters, and + requests that the stepper return the corresponding output + value. + + --------------------------------------------------------------- + + ARKTimestepGetNumNonlinSolvConvFails + + This routine is called by ARKodeGetNumNonlinSolvConvFails, and + requests that the stepper return the corresponding output + value. + + --------------------------------------------------------------- + + ARKTimestepGetNonlinSolvStats + + This routine is called by ARKodeGetNonlinSolvStats, and + requests that the stepper return the corresponding output + values. + + =============================================================== + + Internal Interface to Time Steppers -- Non-identity Mass + Matrices + + These should only be provided if the stepper supports problems + with non-identity mass matrices, and should be indicated by + setting the flag "step_supports_massmatrix" to SUNTRUE. + + --------------------------------------------------------------- + + ARKTimestepAttachMasssolFn + + This routine should attach the various set of mass matrix + linear solver interface routines, data structure, mass matrix + type, and solver type to the ARKODE time stepping module + pointed to in ark_mem->step_mem. This will be called by the + ARKODE linear solver interface. + + This routine should return 0 if it has successfully attached + these items, and a negative value otherwise. If an error does + occur, an appropriate message should be sent to the ARKODE + error handler function. + + --------------------------------------------------------------- + + ARKTimestepDisableMSetup + + This routine should NULLify any ARKMassSetupFn function pointer + stored in the ARKODE time stepping module (initially set in a + call to ARKTimestepAttachMasssolFn). + + This routine has no return value. + + --------------------------------------------------------------- + + ARKTimestepGetMassMemFn + + This routine should return the mass matrix linear solver memory + structure used by the ARKODE time stepping module pointed to in + ark_mem->step_mem. This will be called the ARKODE mass matrix + solver interface. + + This routine should return NULL if no mass matrix solver memory + structure is attached. + + ===============================================================*/ #ifdef __cplusplus } diff --git a/src/arkode/arkode_interp_impl.h b/src/arkode/arkode_interp_impl.h index 7222259942..9bbe3dd505 100644 --- a/src/arkode/arkode_interp_impl.h +++ b/src/arkode/arkode_interp_impl.h @@ -72,7 +72,6 @@ typedef struct _ARKInterpContent_Hermite* ARKInterpContent_Hermite; /* Hermite structure operations */ ARKInterp arkInterpCreate_Hermite(ARKodeMem ark_mem, int degree); - int arkInterpResize_Hermite(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, @@ -119,7 +118,6 @@ typedef struct _ARKInterpContent_Lagrange* ARKInterpContent_Lagrange; /* Lagrange structure operations */ ARKInterp arkInterpCreate_Lagrange(ARKodeMem ark_mem, int degree); - int arkInterpResize_Lagrange(ARKodeMem ark_mem, ARKInterp interp, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, sunindextype liw_diff, diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 98dc8b2cb1..291a61ec35 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -30,7 +30,7 @@ #include "arkode_user_controller.h" /*=============================================================== - ARKODE optional input utility functions + ARKODE optional input functions ===============================================================*/ /*--------------------------------------------------------------- @@ -1454,300 +1454,6 @@ int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - 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, - sunrealtype adapt_params[3]) -{ - int retval; - long int lenrw, leniw; - sunrealtype k1, k2, k3; - ARKodeMem ark_mem; - SUNAdaptController C; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - 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, __LINE__, __func__, __FILE__, - "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 == SUN_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 != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_PID allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_PID(C, k1, -k2, k3); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_PI allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_PI(C, k1, -k2); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_I allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_I(C, k1); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_ExpGus allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_ExpGus(C, k1, k2); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_ImpGus allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_ImpGus(C, k1, k2); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "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, __LINE__, __func__, __FILE__, - "SUNAdaptController_ImExGus allocation failure"); - return (ARK_MEM_FAIL); - } - if (idefault != 1) - { - retval = SUNAdaptController_SetParams_ImExGus(C, k1, k2, k3, k3); - if (retval != SUN_SUCCESS) - { - (void)SUNAdaptController_Destroy(C); - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, - __FILE__, "SUNAdaptController_SetParams_ImExGus failure"); - return (ARK_CONTROLLER_ERR); - } - } - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Illegal imethod"); - return (ARK_ILL_INPUT); - } - - /* Attach new SUNAdaptController object */ - retval = SUNAdaptController_Space(C, &lenrw, &leniw); - if (retval == SUN_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, __LINE__, __func__, __FILE__, - 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 == SUN_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 != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "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, __LINE__, __func__, __FILE__, - "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, __LINE__, __func__, __FILE__, - "ARKUserControl allocation failure"); - return (ARK_MEM_FAIL); - } - } - - /* Attach new SUNAdaptController object */ - retval = SUNAdaptController_Space(C, &lenrw, &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw += leniw; - ark_mem->lrw += lenrw; - } - ark_mem->hadapt_mem->hcontroller = C; - ark_mem->hadapt_mem->owncontroller = SUNTRUE; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- ARKodeSetCFLFraction: @@ -2490,9 +2196,201 @@ int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight) /*--------------------------------------------------------------- ARKodeGetResWeights: - This routine returns the current residual weight vector. + This routine returns the current residual weight vector. + ---------------------------------------------------------------*/ +int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not support mass matrices */ + if (!ark_mem->step_supports_massmatrix) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support non-identity mass matrices"); + return (ARK_STEPPER_UNSUPPORTED); + } + + N_VScale(ONE, ark_mem->rwt, rweight); + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetWorkSpace: + + Returns integrator work space requirements + ---------------------------------------------------------------*/ +int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + *leniw = ark_mem->liw; + *lenrw = ark_mem->lrw; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetNumGEvals: + + Returns the current number of calls to g (for rootfinding) + ---------------------------------------------------------------*/ +int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + ARKodeMem ark_mem; + ARKodeRootMem ark_root_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + if (ark_mem->root_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; + *ngevals = ark_root_mem->nge; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetRootInfo: + + Returns pointer to array rootsfound showing roots found + ---------------------------------------------------------------*/ +int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) +{ + int i; + ARKodeMem ark_mem; + ARKodeRootMem ark_root_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + if (ark_mem->root_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; + for (i = 0; i < ark_root_mem->nrtfn; i++) + { + rootsfound[i] = ark_root_mem->iroots[i]; + } + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetStepStats: + + Returns step statistics + ---------------------------------------------------------------*/ +int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + *nsteps = ark_mem->nst; + *hinused = ark_mem->h0u; + *hlast = ark_mem->hold; + *hcur = ark_mem->next_h; + *tcur = ark_mem->tcur; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetNumConstrFails: + + Returns the current number of constraint fails + ---------------------------------------------------------------*/ +int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + *nconstrfails = ark_mem->nconstrfails; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetNumExpSteps: + + Returns the current number of stability-limited steps + ---------------------------------------------------------------*/ +int ARKodeGetNumExpSteps(void* arkode_mem, long int* nsteps) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + *nsteps = ark_mem->hadapt_mem->nst_exp; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetNumAccSteps: + + Returns the current number of accuracy-limited steps + ---------------------------------------------------------------*/ +int ARKodeGetNumAccSteps(void* arkode_mem, long int* nsteps) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + *nsteps = ark_mem->hadapt_mem->nst_acc; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeGetNumErrTestFails: + + Returns the current number of error test failures ---------------------------------------------------------------*/ -int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) +int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2503,24 +2401,17 @@ int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for time steppers that do not support mass matrices */ - if (!ark_mem->step_supports_massmatrix) - { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, "time-stepping module does not support non-identity mass matrices"); - return (ARK_STEPPER_UNSUPPORTED); - } - - N_VScale(ONE, ark_mem->rwt, rweight); + *netfails = ark_mem->netf; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetWorkSpace: + ARKodeComputeState: - Returns integrator work space requirements + Computes y based on the current prediction and a given + correction. ---------------------------------------------------------------*/ -int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2531,20 +2422,41 @@ int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) } ark_mem = (ARKodeMem)arkode_mem; - *leniw = ark_mem->liw; - *lenrw = ark_mem->lrw; - return (ARK_SUCCESS); + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_computestate) + { + return (ark_mem->step_computestate(ark_mem, zcor, z)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); + } } /*--------------------------------------------------------------- - ARKodeGetNumGEvals: + ARKodeGetNonlinearSystemData: - Returns the current number of calls to g (for rootfinding) + This routine provides access to the relevant data needed to + compute the nonlinear system function. ---------------------------------------------------------------*/ -int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) +int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) { ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2552,27 +2464,39 @@ int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) return (ARK_MEM_NULL); } ark_mem = (ARKodeMem)arkode_mem; - if (ark_mem->root_mem == NULL) + + /* Guard against use for incompatible time stepper modules */ + if (!ark_mem->step_supports_implicit) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support algebraic solvers"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnonlinearsystemdata) + { + return (ark_mem->step_getnonlinearsystemdata(ark_mem, tcur, zpred, z, Fi, + gamma, sdata, user_data)); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return (ARK_STEPPER_UNSUPPORTED); } - ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; - *ngevals = ark_root_mem->nge; - return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetRootInfo: + ARKodeGetNumNonlinSolvIters: - Returns pointer to array rootsfound showing roots found + Returns the current number of nonlinear solver iterations ---------------------------------------------------------------*/ -int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) +int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) { - int i; ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2580,27 +2504,25 @@ int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound) return (ARK_MEM_NULL); } ark_mem = (ARKodeMem)arkode_mem; - if (ark_mem->root_mem == NULL) + + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumnonlinsolviters) { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + return (ark_mem->step_getnumnonlinsolviters(ark_mem, nniters)); } - ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; - for (i = 0; i < ark_root_mem->nrtfn; i++) + else { - rootsfound[i] = ark_root_mem->iroots[i]; + *nniters = 0; + return (ARK_SUCCESS); } - return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetStepStats: + ARKodeGetNumNonlinSolvConvFails: - Returns step statistics + Returns the current number of nonlinear solver convergence fails ---------------------------------------------------------------*/ -int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) +int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2611,20 +2533,25 @@ int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, } ark_mem = (ARKodeMem)arkode_mem; - *nsteps = ark_mem->nst; - *hinused = ark_mem->h0u; - *hlast = ark_mem->hold; - *hcur = ark_mem->next_h; - *tcur = ark_mem->tcur; - return (ARK_SUCCESS); + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumnonlinsolvconvfails) + { + return (ark_mem->step_getnumnonlinsolvconvfails(ark_mem, nnfails)); + } + else + { + *nnfails = 0; + return (ARK_SUCCESS); + } } /*--------------------------------------------------------------- - ARKodeGetNumConstrFails: + ARKodeGetNonlinSolvStats: - Returns the current number of constraint fails + Returns nonlinear solver statistics ---------------------------------------------------------------*/ -int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2635,16 +2562,25 @@ int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) } ark_mem = (ARKodeMem)arkode_mem; - *nconstrfails = ark_mem->nconstrfails; - return (ARK_SUCCESS); + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnonlinsolvstats) + { + return (ark_mem->step_getnonlinsolvstats(ark_mem, nniters, nnfails)); + } + else + { + *nniters = *nnfails = 0; + return (ARK_SUCCESS); + } } /*--------------------------------------------------------------- - ARKodeGetNumExpSteps: + ARKodeGetNumStepSolveFails: - Returns the current number of stability-limited steps + Returns the current number of failed steps due to an algebraic + solver convergence failure. ---------------------------------------------------------------*/ -int ARKodeGetNumExpSteps(void* arkode_mem, long int* nsteps) +int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2655,16 +2591,16 @@ int ARKodeGetNumExpSteps(void* arkode_mem, long int* nsteps) } ark_mem = (ARKodeMem)arkode_mem; - *nsteps = ark_mem->hadapt_mem->nst_exp; + *nncfails = ark_mem->ncfn; return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetNumAccSteps: + ARKodeGetNumLinSolvSetups: - Returns the current number of accuracy-limited steps + Returns the current number of calls to the lsetup routine ---------------------------------------------------------------*/ -int ARKodeGetNumAccSteps(void* arkode_mem, long int* nsteps) +int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2675,16 +2611,24 @@ int ARKodeGetNumAccSteps(void* arkode_mem, long int* nsteps) } ark_mem = (ARKodeMem)arkode_mem; - *nsteps = ark_mem->hadapt_mem->nst_acc; - return (ARK_SUCCESS); + /* Call stepper routine to compute the state (if provided) */ + if (ark_mem->step_getnumlinsolvsetups) + { + return (ark_mem->step_getnumlinsolvsetups(ark_mem, nlinsetups)); + } + else + { + *nlinsetups = 0; + return (ARK_SUCCESS); + } } /*--------------------------------------------------------------- - ARKodeGetNumErrTestFails: + ARKodeGetUserData: - Returns the current number of error test failures + Returns the user data pointer ---------------------------------------------------------------*/ -int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) +int ARKodeGetUserData(void* arkode_mem, void** user_data) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2695,19 +2639,23 @@ int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) } ark_mem = (ARKodeMem)arkode_mem; - *netfails = ark_mem->netf; + *user_data = ark_mem->user_data; + return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKodeComputeState: +/*----------------------------------------------------------------- + ARKodePrintAllStats - Computes y based on the current prediction and a given - correction. + Prints the current value of all statistics ---------------------------------------------------------------*/ -int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) + +int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) { + int retval; ARKodeMem ark_mem; + ARKodeRootMem ark_root_mem; + if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2716,79 +2664,156 @@ int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) } ark_mem = (ARKodeMem)arkode_mem; - /* Guard against use for incompatible time stepper modules */ - if (!ark_mem->step_supports_implicit) + switch (fmt) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support algebraic solvers"); - return (ARK_STEPPER_UNSUPPORTED); + case SUN_OUTPUTFORMAT_TABLE: + fprintf(outfile, "Current time = %" RSYM "\n", ark_mem->tcur); + fprintf(outfile, "Steps = %ld\n", ark_mem->nst); + fprintf(outfile, "Step attempts = %ld\n", + ark_mem->nst_attempts); + fprintf(outfile, "Stability limited steps = %ld\n", + ark_mem->hadapt_mem->nst_exp); + fprintf(outfile, "Accuracy limited steps = %ld\n", + ark_mem->hadapt_mem->nst_acc); + fprintf(outfile, "Error test fails = %ld\n", ark_mem->netf); + fprintf(outfile, "NLS step fails = %ld\n", ark_mem->ncfn); + fprintf(outfile, "Inequality constraint fails = %ld\n", + ark_mem->nconstrfails); + fprintf(outfile, "Initial step size = %" RSYM "\n", ark_mem->h0u); + fprintf(outfile, "Last step size = %" RSYM "\n", ark_mem->hold); + fprintf(outfile, "Current step size = %" RSYM "\n", + ark_mem->next_h); + if (ark_mem->root_mem) + { + ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; + fprintf(outfile, "Root fn evals = %ld\n", ark_root_mem->nge); + } + break; + case SUN_OUTPUTFORMAT_CSV: + fprintf(outfile, "Time,%" RSYM, ark_mem->tcur); + fprintf(outfile, ",Steps,%ld", ark_mem->nst); + fprintf(outfile, ",Step attempts,%ld", ark_mem->nst_attempts); + fprintf(outfile, ",Stability limited steps,%ld", + ark_mem->hadapt_mem->nst_exp); + fprintf(outfile, ",Accuracy limited steps,%ld", ark_mem->hadapt_mem->nst_acc); + fprintf(outfile, ",Error test fails,%ld", ark_mem->netf); + fprintf(outfile, ",NLS step fails,%ld", ark_mem->ncfn); + fprintf(outfile, ",Inequality constraint fails,%ld", ark_mem->nconstrfails); + fprintf(outfile, ",Initial step size,%" RSYM, ark_mem->h0u); + fprintf(outfile, ",Last step size,%" RSYM, ark_mem->hold); + fprintf(outfile, ",Current step size,%" RSYM, ark_mem->next_h); + if (ark_mem->root_mem) + { + ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; + fprintf(outfile, ",Roof fn evals,%ld", ark_root_mem->nge); + } + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return (ARK_ILL_INPUT); } - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_computestate) + /* Print relaxation stats */ + if (ark_mem->relax_enabled) { - return (ark_mem->step_computestate(ark_mem, zcor, z)); + retval = arkRelaxPrintAllStats(ark_mem, outfile, fmt); + if (retval != ARK_SUCCESS) { return (retval); } } - else + + /* Print stepper stats (if provided) */ + if (ark_mem->step_printallstats) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); + return (ark_mem->step_printallstats(ark_mem, outfile, fmt)); } + + return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - ARKodeGetNonlinearSystemData: +/*-----------------------------------------------------------------*/ - This routine provides access to the relevant data needed to - compute the nonlinear system function. - ---------------------------------------------------------------*/ -int ARKodeGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) +char* ARKodeGetReturnFlagName(long int flag) { - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; + char* name; + name = (char*)malloc(27 * sizeof(char)); - /* Guard against use for incompatible time stepper modules */ - if (!ark_mem->step_supports_implicit) + switch (flag) { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support algebraic solvers"); - return (ARK_STEPPER_UNSUPPORTED); + case ARK_SUCCESS: sprintf(name, "ARK_SUCCESS"); break; + case ARK_TSTOP_RETURN: sprintf(name, "ARK_TSTOP_RETURN"); break; + 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; + case ARK_TOO_MUCH_ACC: sprintf(name, "ARK_TOO_MUCH_ACC"); break; + case ARK_ERR_FAILURE: sprintf(name, "ARK_ERR_FAILURE"); break; + case ARK_CONV_FAILURE: sprintf(name, "ARK_CONV_FAILURE"); break; + case ARK_LINIT_FAIL: sprintf(name, "ARK_LINIT_FAIL"); break; + case ARK_LSETUP_FAIL: sprintf(name, "ARK_LSETUP_FAIL"); break; + case ARK_LSOLVE_FAIL: sprintf(name, "ARK_LSOLVE_FAIL"); break; + case ARK_RHSFUNC_FAIL: sprintf(name, "ARK_RHSFUNC_FAIL"); break; + case ARK_FIRST_RHSFUNC_ERR: sprintf(name, "ARK_FIRST_RHSFUNC_ERR"); break; + case ARK_REPTD_RHSFUNC_ERR: sprintf(name, "ARK_REPTD_RHSFUNC_ERR"); break; + case ARK_UNREC_RHSFUNC_ERR: sprintf(name, "ARK_UNREC_RHSFUNC_ERR"); break; + case ARK_RTFUNC_FAIL: sprintf(name, "ARK_RTFUNC_FAIL"); break; + case ARK_LFREE_FAIL: sprintf(name, "ARK_LFREE_FAIL"); break; + case ARK_MASSINIT_FAIL: sprintf(name, "ARK_MASSINIT_FAIL"); break; + case ARK_MASSSETUP_FAIL: sprintf(name, "ARK_MASSSETUP_FAIL"); break; + case ARK_MASSSOLVE_FAIL: sprintf(name, "ARK_MASSSOLVE_FAIL"); break; + case ARK_MASSFREE_FAIL: sprintf(name, "ARK_MASSFREE_FAIL"); break; + 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; + case ARK_MEM_NULL: sprintf(name, "ARK_MEM_NULL"); break; + case ARK_ILL_INPUT: sprintf(name, "ARK_ILL_INPUT"); break; + case ARK_NO_MALLOC: sprintf(name, "ARK_NO_MALLOC"); break; + case ARK_BAD_K: sprintf(name, "ARK_BAD_K"); break; + case ARK_BAD_T: sprintf(name, "ARK_BAD_T"); break; + case ARK_BAD_DKY: sprintf(name, "ARK_BAD_DKY"); break; + case ARK_TOO_CLOSE: sprintf(name, "ARK_TOO_CLOSE"); break; + case ARK_VECTOROP_ERR: sprintf(name, "ARK_VECTOROP_ERR"); break; + case ARK_NLS_INIT_FAIL: sprintf(name, "ARK_NLS_INIT_FAIL"); break; + 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; + case ARK_INNERSTEP_ATTACH_ERR: + sprintf(name, "ARK_INNERSTEP_ATTACH_ERR"); + break; + 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_RELAX_FAIL: sprintf(name, "ARK_RELAX_FAIL"); break; + case ARK_RELAX_MEM_NULL: sprintf(name, "ARK_RELAX_MEM_NULL"); break; + case ARK_RELAX_FUNC_FAIL: sprintf(name, "ARK_RELAX_FUNC_FAIL"); break; + case ARK_RELAX_JAC_FAIL: sprintf(name, "ARK_RELAX_JAC_FAIL"); break; + case ARK_CONTROLLER_ERR: sprintf(name, "ARK_CONTROLLER_ERR"); break; + case ARK_STEPPER_UNSUPPORTED: sprintf(name, "ARK_STEPPER_UNSUPPORTED"); break; + case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; + default: sprintf(name, "NONE"); } - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_getnonlinearsystemdata) - { - return (ark_mem->step_getnonlinearsystemdata(ark_mem, tcur, zpred, z, Fi, - gamma, sdata, user_data)); - } - else - { - arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, - __FILE__, - "time-stepping module does not support this function"); - return (ARK_STEPPER_UNSUPPORTED); - } + return (name); } +/*=============================================================== + ARKODE parameter output utility routine + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodeGetNumNonlinSolvIters: + ARKodeWriteParameters: - Returns the current number of nonlinear solver iterations + Outputs all solver parameters to the provided file pointer. ---------------------------------------------------------------*/ -int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +int ARKodeWriteParameters(void* arkode_mem, FILE* fp) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2799,102 +2824,99 @@ int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) } ark_mem = (ARKodeMem)arkode_mem; - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_getnumnonlinsolviters) - { - return (ark_mem->step_getnumnonlinsolviters(ark_mem, nniters)); - } - else + /* print integrator parameters to file */ + fprintf(fp, "ARKODE solver parameters:\n"); + if (ark_mem->hmin != ZERO) { - *nniters = 0; - return (ARK_SUCCESS); + fprintf(fp, " Minimum step size = %" RSYM "\n", ark_mem->hmin); } -} - -/*--------------------------------------------------------------- - ARKodeGetNumNonlinSolvConvFails: - - Returns the current number of nonlinear solver convergence fails - ---------------------------------------------------------------*/ -int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (ark_mem->hmax_inv != ZERO) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + fprintf(fp, " Maximum step size = %" RSYM "\n", ONE / ark_mem->hmax_inv); } - ark_mem = (ARKodeMem)arkode_mem; - - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_getnumnonlinsolvconvfails) + if (ark_mem->fixedstep) { fprintf(fp, " Fixed time-stepping enabled\n"); } + if (ark_mem->itol == ARK_WF) { - return (ark_mem->step_getnumnonlinsolvconvfails(ark_mem, nnfails)); + fprintf(fp, " User provided error weight function\n"); } else { - *nnfails = 0; - return (ARK_SUCCESS); + fprintf(fp, " Solver relative tolerance = %" RSYM "\n", ark_mem->reltol); + if (ark_mem->itol == ARK_SS) + { + fprintf(fp, " Solver absolute tolerance = %" RSYM "\n", ark_mem->Sabstol); + } + else { fprintf(fp, " Vector-valued solver absolute tolerance\n"); } } -} - -/*--------------------------------------------------------------- - ARKodeGetNonlinSolvStats: - - Returns nonlinear solver statistics - ---------------------------------------------------------------*/ -int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + if (!ark_mem->rwt_is_ewt) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + if (ark_mem->ritol == ARK_WF) + { + fprintf(fp, " User provided residual weight function\n"); + } + else + { + if (ark_mem->ritol == ARK_SS) + { + fprintf(fp, " Absolute residual tolerance = %" RSYM "\n", + ark_mem->SRabstol); + } + else { fprintf(fp, " Vector-valued residual absolute tolerance\n"); } + } } - ark_mem = (ARKodeMem)arkode_mem; - - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_getnonlinsolvstats) + if (ark_mem->hin != ZERO) { - return (ark_mem->step_getnonlinsolvstats(ark_mem, nniters, nnfails)); + fprintf(fp, " Initial step size = %" RSYM "\n", ark_mem->hin); } - else + fprintf(fp, "\n"); + fprintf(fp, " Maximum step increase (first step) = %" RSYM "\n", + ark_mem->hadapt_mem->etamx1); + fprintf(fp, " Step reduction factor on multiple error fails = %" RSYM "\n", + ark_mem->hadapt_mem->etamxf); + fprintf(fp, " Minimum error fails before above factor is used = %i\n", + ark_mem->hadapt_mem->small_nef); + fprintf(fp, + " Step reduction factor on nonlinear convergence failure = %" RSYM + "\n", + ark_mem->hadapt_mem->etacf); + fprintf(fp, " Explicit safety factor = %" RSYM "\n", ark_mem->hadapt_mem->cfl); + 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) { - *nniters = *nnfails = 0; - return (ARK_SUCCESS); + 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); -/*--------------------------------------------------------------- - ARKodeGetNumStepSolveFails: + 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); - Returns the current number of failed steps due to an algebraic - solver convergence failure. - ---------------------------------------------------------------*/ -int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* nncfails) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) + /* Call stepper routine (if provided) */ + if (ark_mem->step_writeparameters) { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); + return (ark_mem->step_writeparameters(ark_mem, fp)); } - ark_mem = (ARKodeMem)arkode_mem; - *nncfails = ark_mem->ncfn; return (ARK_SUCCESS); } +/*=============================================================== + ARKODE + XBraid interface utility functions + ===============================================================*/ + /*--------------------------------------------------------------- - ARKodeGetNumLinSolvSetups: + arkSetForcePass: - Returns the current number of calls to the lsetup routine + Ignore the value of kflag after the temporal error test and + force the step to pass. ---------------------------------------------------------------*/ -int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2905,24 +2927,17 @@ int ARKodeGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) } ark_mem = (ARKodeMem)arkode_mem; - /* Call stepper routine to compute the state (if provided) */ - if (ark_mem->step_getnumlinsolvsetups) - { - return (ark_mem->step_getnumlinsolvsetups(ark_mem, nlinsetups)); - } - else - { - *nlinsetups = 0; - return (ARK_SUCCESS); - } + ark_mem->force_pass = force_pass; + + return (ARK_SUCCESS); } /*--------------------------------------------------------------- - ARKodeGetUserData: + arkGetLastKFlag: - Returns the user data pointer + The last kflag value retured by the temporal error test. ---------------------------------------------------------------*/ -int ARKodeGetUserData(void* arkode_mem, void** user_data) +int arkGetLastKFlag(void* arkode_mem, int* last_kflag) { ARKodeMem ark_mem; if (arkode_mem == NULL) @@ -2933,23 +2948,34 @@ int ARKodeGetUserData(void* arkode_mem, void** user_data) } ark_mem = (ARKodeMem)arkode_mem; - *user_data = ark_mem->user_data; + *last_kflag = ark_mem->last_kflag; return (ARK_SUCCESS); } -/*----------------------------------------------------------------- - ARKodePrintAllStats +/*=============================================================== + Deprecated functions + ===============================================================*/ - Prints the current value of all statistics - ---------------------------------------------------------------*/ +/*--------------------------------------------------------------- + arkSetAdaptivityMethod: -int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) + 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, + sunrealtype adapt_params[3]) { int retval; + long int lenrw, leniw; + sunrealtype k1, k2, k3; ARKodeMem ark_mem; - ARKodeRootMem ark_root_mem; - + SUNAdaptController C; if (arkode_mem == NULL) { arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, @@ -2958,158 +2984,207 @@ int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) } ark_mem = (ARKodeMem)arkode_mem; - switch (fmt) + /* Check for illegal inputs */ + if ((idefault != 1) && (adapt_params == NULL)) { - case SUN_OUTPUTFORMAT_TABLE: - fprintf(outfile, "Current time = %" RSYM "\n", ark_mem->tcur); - fprintf(outfile, "Steps = %ld\n", ark_mem->nst); - fprintf(outfile, "Step attempts = %ld\n", - ark_mem->nst_attempts); - fprintf(outfile, "Stability limited steps = %ld\n", - ark_mem->hadapt_mem->nst_exp); - fprintf(outfile, "Accuracy limited steps = %ld\n", - ark_mem->hadapt_mem->nst_acc); - fprintf(outfile, "Error test fails = %ld\n", ark_mem->netf); - fprintf(outfile, "NLS step fails = %ld\n", ark_mem->ncfn); - fprintf(outfile, "Inequality constraint fails = %ld\n", - ark_mem->nconstrfails); - fprintf(outfile, "Initial step size = %" RSYM "\n", ark_mem->h0u); - fprintf(outfile, "Last step size = %" RSYM "\n", ark_mem->hold); - fprintf(outfile, "Current step size = %" RSYM "\n", - ark_mem->next_h); - if (ark_mem->root_mem) + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "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 == SUN_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 != SUN_SUCCESS) { - ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; - fprintf(outfile, "Root fn evals = %ld\n", ark_root_mem->nge); + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "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, __LINE__, __func__, __FILE__, + "SUNAdaptController_PID allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_PID(C, k1, -k2, k3); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "SUNAdaptController_SetParams_PID failure"); + return (ARK_CONTROLLER_ERR); + } } break; - case SUN_OUTPUTFORMAT_CSV: - fprintf(outfile, "Time,%" RSYM, ark_mem->tcur); - fprintf(outfile, ",Steps,%ld", ark_mem->nst); - fprintf(outfile, ",Step attempts,%ld", ark_mem->nst_attempts); - fprintf(outfile, ",Stability limited steps,%ld", - ark_mem->hadapt_mem->nst_exp); - fprintf(outfile, ",Accuracy limited steps,%ld", ark_mem->hadapt_mem->nst_acc); - fprintf(outfile, ",Error test fails,%ld", ark_mem->netf); - fprintf(outfile, ",NLS step fails,%ld", ark_mem->ncfn); - fprintf(outfile, ",Inequality constraint fails,%ld", ark_mem->nconstrfails); - fprintf(outfile, ",Initial step size,%" RSYM, ark_mem->h0u); - fprintf(outfile, ",Last step size,%" RSYM, ark_mem->hold); - fprintf(outfile, ",Current step size,%" RSYM, ark_mem->next_h); - if (ark_mem->root_mem) + case (ARK_ADAPT_PI): + C = SUNAdaptController_PI(ark_mem->sunctx); + if (C == NULL) { - ark_root_mem = (ARKodeRootMem)ark_mem->root_mem; - fprintf(outfile, ",Roof fn evals,%ld", ark_root_mem->nge); + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PI allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_PI(C, k1, -k2); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "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, __LINE__, __func__, __FILE__, + "SUNAdaptController_I allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_I(C, k1); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "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, __LINE__, __func__, __FILE__, + "SUNAdaptController_ExpGus allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_ExpGus(C, k1, k2); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "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, __LINE__, __func__, __FILE__, + "SUNAdaptController_ImpGus allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_ImpGus(C, k1, k2); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "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, __LINE__, __func__, __FILE__, + "SUNAdaptController_ImExGus allocation failure"); + return (ARK_MEM_FAIL); + } + if (idefault != 1) + { + retval = SUNAdaptController_SetParams_ImExGus(C, k1, k2, k3, k3); + if (retval != SUN_SUCCESS) + { + (void)SUNAdaptController_Destroy(C); + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "SUNAdaptController_SetParams_ImExGus failure"); + return (ARK_CONTROLLER_ERR); + } } break; default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid formatting option."); - return (ARK_ILL_INPUT); - } - - /* Print relaxation stats */ - if (ark_mem->relax_enabled) - { - retval = arkRelaxPrintAllStats(ark_mem, outfile, fmt); - if (retval != ARK_SUCCESS) { return (retval); } + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Illegal imethod"); + return (ARK_ILL_INPUT); } - /* Print stepper stats (if provided) */ - if (ark_mem->step_printallstats) + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUN_SUCCESS) { - return (ark_mem->step_printallstats(ark_mem, outfile, fmt)); + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; } + ark_mem->hadapt_mem->hcontroller = C; + ark_mem->hadapt_mem->owncontroller = SUNTRUE; return (ARK_SUCCESS); } -/*-----------------------------------------------------------------*/ - -char* ARKodeGetReturnFlagName(long int flag) -{ - char* name; - name = (char*)malloc(27 * sizeof(char)); - - switch (flag) - { - case ARK_SUCCESS: sprintf(name, "ARK_SUCCESS"); break; - case ARK_TSTOP_RETURN: sprintf(name, "ARK_TSTOP_RETURN"); break; - 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; - case ARK_TOO_MUCH_ACC: sprintf(name, "ARK_TOO_MUCH_ACC"); break; - case ARK_ERR_FAILURE: sprintf(name, "ARK_ERR_FAILURE"); break; - case ARK_CONV_FAILURE: sprintf(name, "ARK_CONV_FAILURE"); break; - case ARK_LINIT_FAIL: sprintf(name, "ARK_LINIT_FAIL"); break; - case ARK_LSETUP_FAIL: sprintf(name, "ARK_LSETUP_FAIL"); break; - case ARK_LSOLVE_FAIL: sprintf(name, "ARK_LSOLVE_FAIL"); break; - case ARK_RHSFUNC_FAIL: sprintf(name, "ARK_RHSFUNC_FAIL"); break; - case ARK_FIRST_RHSFUNC_ERR: sprintf(name, "ARK_FIRST_RHSFUNC_ERR"); break; - case ARK_REPTD_RHSFUNC_ERR: sprintf(name, "ARK_REPTD_RHSFUNC_ERR"); break; - case ARK_UNREC_RHSFUNC_ERR: sprintf(name, "ARK_UNREC_RHSFUNC_ERR"); break; - case ARK_RTFUNC_FAIL: sprintf(name, "ARK_RTFUNC_FAIL"); break; - case ARK_LFREE_FAIL: sprintf(name, "ARK_LFREE_FAIL"); break; - case ARK_MASSINIT_FAIL: sprintf(name, "ARK_MASSINIT_FAIL"); break; - case ARK_MASSSETUP_FAIL: sprintf(name, "ARK_MASSSETUP_FAIL"); break; - case ARK_MASSSOLVE_FAIL: sprintf(name, "ARK_MASSSOLVE_FAIL"); break; - case ARK_MASSFREE_FAIL: sprintf(name, "ARK_MASSFREE_FAIL"); break; - 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; - case ARK_MEM_NULL: sprintf(name, "ARK_MEM_NULL"); break; - case ARK_ILL_INPUT: sprintf(name, "ARK_ILL_INPUT"); break; - case ARK_NO_MALLOC: sprintf(name, "ARK_NO_MALLOC"); break; - case ARK_BAD_K: sprintf(name, "ARK_BAD_K"); break; - case ARK_BAD_T: sprintf(name, "ARK_BAD_T"); break; - case ARK_BAD_DKY: sprintf(name, "ARK_BAD_DKY"); break; - case ARK_TOO_CLOSE: sprintf(name, "ARK_TOO_CLOSE"); break; - case ARK_VECTOROP_ERR: sprintf(name, "ARK_VECTOROP_ERR"); break; - case ARK_NLS_INIT_FAIL: sprintf(name, "ARK_NLS_INIT_FAIL"); break; - 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; - case ARK_INNERSTEP_ATTACH_ERR: - sprintf(name, "ARK_INNERSTEP_ATTACH_ERR"); - break; - 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_RELAX_FAIL: sprintf(name, "ARK_RELAX_FAIL"); break; - case ARK_RELAX_MEM_NULL: sprintf(name, "ARK_RELAX_MEM_NULL"); break; - case ARK_RELAX_FUNC_FAIL: sprintf(name, "ARK_RELAX_FUNC_FAIL"); break; - case ARK_RELAX_JAC_FAIL: sprintf(name, "ARK_RELAX_JAC_FAIL"); break; - case ARK_CONTROLLER_ERR: sprintf(name, "ARK_CONTROLLER_ERR"); break; - case ARK_STEPPER_UNSUPPORTED: sprintf(name, "ARK_STEPPER_UNSUPPORTED"); break; - case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; - default: sprintf(name, "NONE"); - } - - return (name); -} - -/*=============================================================== - ARKODE parameter output utility routine - ===============================================================*/ - /*--------------------------------------------------------------- - ARKodeWriteParameters: + arkSetAdaptivityFn: - Outputs all solver parameters to the provided file pointer. + 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 ARKodeWriteParameters(void* arkode_mem, FILE* fp) +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, __LINE__, __func__, __FILE__, @@ -3118,135 +3193,64 @@ int ARKodeWriteParameters(void* arkode_mem, FILE* fp) } ark_mem = (ARKodeMem)arkode_mem; - /* print integrator parameters to file */ - fprintf(fp, "ARKODE solver parameters:\n"); - if (ark_mem->hmin != ZERO) - { - fprintf(fp, " Minimum step size = %" RSYM "\n", ark_mem->hmin); - } - if (ark_mem->hmax_inv != ZERO) - { - fprintf(fp, " Maximum step size = %" RSYM "\n", ONE / ark_mem->hmax_inv); - } - if (ark_mem->fixedstep) { fprintf(fp, " Fixed time-stepping enabled\n"); } - if (ark_mem->itol == ARK_WF) + /* Remove current SUNAdaptController object + (delete if owned, and then nullify pointer) */ + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) { - fprintf(fp, " User provided error weight function\n"); + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; } - else + if (ark_mem->hadapt_mem->owncontroller) { - fprintf(fp, " Solver relative tolerance = %" RSYM "\n", ark_mem->reltol); - if (ark_mem->itol == ARK_SS) + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUN_SUCCESS) { - fprintf(fp, " Solver absolute tolerance = %" RSYM "\n", ark_mem->Sabstol); + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_Destroy failure"); + return (ARK_MEM_FAIL); } - else { fprintf(fp, " Vector-valued solver absolute tolerance\n"); } } - if (!ark_mem->rwt_is_ewt) + ark_mem->hadapt_mem->hcontroller = NULL; + + /* Create new SUNAdaptController object depending on NULL-ity of 'hfun' */ + C = NULL; + if (hfun == NULL) { - if (ark_mem->ritol == ARK_WF) - { - fprintf(fp, " User provided residual weight function\n"); - } - else + C = SUNAdaptController_PID(ark_mem->sunctx); + if (C == NULL) { - if (ark_mem->ritol == ARK_SS) - { - fprintf(fp, " Absolute residual tolerance = %" RSYM "\n", - ark_mem->SRabstol); - } - else { fprintf(fp, " Vector-valued residual absolute tolerance\n"); } + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_PID allocation failure"); + return (ARK_MEM_FAIL); } } - if (ark_mem->hin != ZERO) - { - fprintf(fp, " Initial step size = %" RSYM "\n", ark_mem->hin); - } - fprintf(fp, "\n"); - fprintf(fp, " Maximum step increase (first step) = %" RSYM "\n", - ark_mem->hadapt_mem->etamx1); - fprintf(fp, " Step reduction factor on multiple error fails = %" RSYM "\n", - ark_mem->hadapt_mem->etamxf); - fprintf(fp, " Minimum error fails before above factor is used = %i\n", - ark_mem->hadapt_mem->small_nef); - fprintf(fp, - " Step reduction factor on nonlinear convergence failure = %" RSYM - "\n", - ark_mem->hadapt_mem->etacf); - fprintf(fp, " Explicit safety factor = %" RSYM "\n", ark_mem->hadapt_mem->cfl); - 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) + else { - fprintf(fp, " Default explicit stability function\n"); + C = ARKUserControl(ark_mem->sunctx, arkode_mem, hfun, h_data); + if (C == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "ARKUserControl allocation failure"); + return (ARK_MEM_FAIL); + } } - 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); - /* Call stepper routine (if provided) */ - if (ark_mem->step_writeparameters) + /* Attach new SUNAdaptController object */ + retval = SUNAdaptController_Space(C, &lenrw, &leniw); + if (retval == SUN_SUCCESS) { - return (ark_mem->step_writeparameters(ark_mem, fp)); + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; } + ark_mem->hadapt_mem->hcontroller = C; + ark_mem->hadapt_mem->owncontroller = SUNTRUE; return (ARK_SUCCESS); } /*=============================================================== - ARKODE + XBraid interface utility functions - ===============================================================*/ - -/*--------------------------------------------------------------- - arkSetForcePass: - - Ignore the value of kflag after the temporal error test and - force the step to pass. - ---------------------------------------------------------------*/ -int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - - ark_mem->force_pass = force_pass; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - arkGetLastKFlag: - - The last kflag value retured by the temporal error test. - ---------------------------------------------------------------*/ -int arkGetLastKFlag(void* arkode_mem, int* last_kflag) -{ - ARKodeMem ark_mem; - if (arkode_mem == NULL) - { - arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MEM); - return (ARK_MEM_NULL); - } - ark_mem = (ARKodeMem)arkode_mem; - - *last_kflag = ark_mem->last_kflag; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- EOF - ---------------------------------------------------------------*/ + ===============================================================*/ diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 352fe183cc..7032f62e40 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -39,7 +39,7 @@ static int arkLsLinSys(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix A, N_Vector tmp2, N_Vector tmp3); /*=============================================================== - ARKLS utility routines (called by time-stepper modules) + Exported routines ===============================================================*/ /*--------------------------------------------------------------- @@ -302,7 +302,7 @@ int ARKodeSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) } /*--------------------------------------------------------------- - arkLSSetMassLinearSolver specifies the iterative mass-matrix + ARKodeSetMassLinearSolver specifies the iterative mass-matrix linear solver and user-supplied routine to perform the mass-matrix-vector product. ---------------------------------------------------------------*/ @@ -536,10 +536,6 @@ int ARKodeSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix M, return (ARKLS_SUCCESS); } -/*=============================================================== - Optional Set functions (called by time-stepper modules) - ===============================================================*/ - /*--------------------------------------------------------------- ARKodeSetJacFn specifies the Jacobian function. ---------------------------------------------------------------*/ @@ -1058,35 +1054,6 @@ int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) return (ARKLS_SUCCESS); } -/* arkLSSetUserData sets user_data pointers in arkLS */ -int arkLSSetUserData(ARKodeMem ark_mem, void* user_data) -{ - ARKLsMem arkls_mem; - int retval; - - /* access ARKLsMem structure */ - retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); - if (retval != ARKLS_SUCCESS) { return (retval); } - - /* Set data for Jacobian */ - if (!arkls_mem->jacDQ) { arkls_mem->J_data = user_data; } - - /* Set data for Jtimes */ - if (!arkls_mem->jtimesDQ) { arkls_mem->Jt_data = user_data; } - - /* Set data for LinSys */ - if (arkls_mem->user_linsys) { arkls_mem->A_data = user_data; } - - /* Set data for Preconditioner */ - arkls_mem->P_data = user_data; - - return (ARKLS_SUCCESS); -} - -/*=============================================================== - Optional Get functions - ===============================================================*/ - int ARKodeGetJac(void* arkode_mem, SUNMatrix* J) { ARKodeMem ark_mem; @@ -1850,27 +1817,6 @@ int ARKodeSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn mtsetup, return (ARKLS_SUCCESS); } -/* arkLSMassSetUserData sets user_data pointers in arkLSMass */ -int arkLSSetMassUserData(ARKodeMem ark_mem, void* user_data) -{ - ARKLsMassMem arkls_mem; - int retval; - - /* access ARKLsMem structure */ - retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); - if (retval != ARKLS_SUCCESS) { return (retval); } - - /* Set data for mass matrix */ - if (arkls_mem->mass != NULL) { arkls_mem->M_data = user_data; } - - /* Data for Mtimes is set in arkLSSetMassTimes */ - - /* Set data for Preconditioner */ - arkls_mem->P_data = user_data; - - return (ARKLS_SUCCESS); -} - /*--------------------------------------------------------------- ARKodeGetMassWorkSpace ---------------------------------------------------------------*/ @@ -2295,6 +2241,52 @@ int ARKodeGetLastMassFlag(void* arkode_mem, long int* flag) ARKLS Private functions ===============================================================*/ +/* arkLSSetUserData sets user_data pointers in arkLS */ +int arkLSSetUserData(ARKodeMem ark_mem, void* user_data) +{ + ARKLsMem arkls_mem; + int retval; + + /* access ARKLsMem structure */ + retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); + if (retval != ARKLS_SUCCESS) { return (retval); } + + /* Set data for Jacobian */ + if (!arkls_mem->jacDQ) { arkls_mem->J_data = user_data; } + + /* Set data for Jtimes */ + if (!arkls_mem->jtimesDQ) { arkls_mem->Jt_data = user_data; } + + /* Set data for LinSys */ + if (arkls_mem->user_linsys) { arkls_mem->A_data = user_data; } + + /* Set data for Preconditioner */ + arkls_mem->P_data = user_data; + + return (ARKLS_SUCCESS); +} + +/* arkLSMassSetUserData sets user_data pointers in arkLSMass */ +int arkLSSetMassUserData(ARKodeMem ark_mem, void* user_data) +{ + ARKLsMassMem arkls_mem; + int retval; + + /* access ARKLsMem structure */ + retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); + if (retval != ARKLS_SUCCESS) { return (retval); } + + /* Set data for mass matrix */ + if (arkls_mem->mass != NULL) { arkls_mem->M_data = user_data; } + + /* Data for Mtimes is set in arkLSSetMassTimes */ + + /* Set data for Preconditioner */ + arkls_mem->P_data = user_data; + + return (ARKLS_SUCCESS); +} + /*--------------------------------------------------------------- arkLsATimes: @@ -4085,6 +4077,6 @@ int arkLs_AccessMassMem(ARKodeMem ark_mem, const char* fname, return (ARKLS_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== EOF - ---------------------------------------------------------------*/ + ===============================================================*/ diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index 21c869536e..8a296d83d5 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -11,7 +11,8 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End *--------------------------------------------------------------- - * Implementation header file for ARKODE's linear solver interface. + * Implementation header file for ARKODE's linear solver + * interface. *--------------------------------------------------------------*/ #ifndef _ARKLS_IMPL_H @@ -218,54 +219,38 @@ int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, /* Generic linit/lsetup/lsolve/lfree interface routines for ARKODE to call */ int arkLsInitialize(ARKodeMem ark_mem); - int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); - int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tcur, N_Vector ycur, N_Vector fcur, sunrealtype eRnrm, int mnewt); - int arkLsFree(ARKodeMem ark_mem); /* Generic minit/msetup/mmult/msolve/mfree routines for ARKODE to call */ int arkLsMassInitialize(ARKodeMem ark_mem); - int arkLsMassSetup(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3); - int arkLsMassMult(void* arkode_mem, N_Vector v, N_Vector Mv); - int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef); - int arkLsMassFree(ARKodeMem ark_mem); /* Auxilliary functions */ int arkLsInitializeCounters(ARKLsMem arkls_mem); - int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem); - int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, ARKLsMem* arkls_mem); - int arkLs_AccessLMem(ARKodeMem ark_mem, const char* fname, ARKLsMem* arkls_mem); - int arkLs_AccessARKODEMassMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, ARKLsMassMem* arkls_mem); - int arkLs_AccessMassMem(ARKodeMem ark_mem, const char* fname, ARKLsMassMem* arkls_mem); /* Set/get routines called by time-stepper module */ int arkLSSetLinearSolver(ARKodeMem ark_mem, SUNLinearSolver LS, SUNMatrix A); - int arkLSSetMassLinearSolver(ARKodeMem ark_mem, SUNLinearSolver LS, SUNMatrix M, sunbooleantype time_dep); - int arkLSSetUserData(ARKodeMem ark_mem, void* user_data); - int arkLSSetMassUserData(ARKodeMem ark_mem, void* user_data); - int arkLSGetCurrentMassMatrix(ARKodeMem ark_mem, SUNMatrix* M); /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index b84e417e99..cea390373e 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -27,12 +27,9 @@ #include "arkode_mristep_impl.h" /*=============================================================== - MRIStep Exported functions -- Required + Exported functions ===============================================================*/ -/*--------------------------------------------------------------- - Create MRIStep integrator memory struct - ---------------------------------------------------------------*/ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, MRIStepInnerStepper stepper, SUNContext sunctx) { @@ -247,6 +244,106 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, return ((void*)ark_mem); } +/*--------------------------------------------------------------- + MRIStepReInit: + + This routine re-initializes the MRIStep module to solve a new + problem of the same size as was previously solved (all counter + values are set to 0). + + NOTE: the inner stepper needs to be reinitialized before + calling this function. + ---------------------------------------------------------------*/ +int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, + N_Vector y0) +{ + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + SUNNonlinearSolver NLS; + int retval; + + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Check if ark_mem was allocated */ + if (ark_mem->MallocDone == SUNFALSE) + { + arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MALLOC); + return (ARK_NO_MALLOC); + } + + /* Check that at least one of fse, fsi is supplied and is to be used */ + if (fse == NULL && fsi == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_F); + return (ARK_ILL_INPUT); + } + + /* Check that y0 is supplied */ + if (y0 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return (ARK_ILL_INPUT); + } + + /* Set implicit/explicit problem based on function pointers */ + step_mem->explicit_rhs = (fse == NULL) ? SUNFALSE : SUNTRUE; + step_mem->implicit_rhs = (fsi == NULL) ? SUNFALSE : SUNTRUE; + + /* Create a default Newton NLS object (just in case; will be deleted if + the user attaches a nonlinear solver) */ + if (step_mem->implicit_rhs && !(step_mem->NLS)) + { + NLS = SUNNonlinSol_Newton(y0, ark_mem->sunctx); + if (!NLS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error creating default Newton solver"); + ARKodeFree((void**)&ark_mem); + return (ARK_MEM_FAIL); + } + retval = ARKodeSetNonlinearSolver(ark_mem, NLS); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error attaching default Newton solver"); + ARKodeFree((void**)&ark_mem); + return (ARK_MEM_FAIL); + } + step_mem->ownNLS = SUNTRUE; + } + + /* ReInitialize main ARKODE infrastructure */ + retval = arkInit(arkode_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to reinitialize main ARKODE infrastructure"); + return (retval); + } + + /* Copy the input parameters into ARKODE state */ + step_mem->fse = fse; + step_mem->fsi = fsi; + + /* Initialize all the counters */ + step_mem->nfse = 0; + step_mem->nfsi = 0; + step_mem->nsetups = 0; + step_mem->nstlp = 0; + step_mem->nls_iters = 0; + + return (ARK_SUCCESS); +} + +/*=============================================================== + Interface routines supplied to ARKODE + ===============================================================*/ + /*--------------------------------------------------------------- mriStep_Resize: @@ -376,102 +473,6 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - MRIStepReInit: - - This routine re-initializes the MRIStep module to solve a new - problem of the same size as was previously solved (all counter - values are set to 0). - - NOTE: the inner stepper needs to be reinitialized before - calling this function. - ---------------------------------------------------------------*/ -int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, - N_Vector y0) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - SUNNonlinearSolver NLS; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Check if ark_mem was allocated */ - if (ark_mem->MallocDone == SUNFALSE) - { - arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, - MSG_ARK_NO_MALLOC); - return (ARK_NO_MALLOC); - } - - /* Check that at least one of fse, fsi is supplied and is to be used */ - if (fse == NULL && fsi == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_F); - return (ARK_ILL_INPUT); - } - - /* Check that y0 is supplied */ - if (y0 == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_NULL_Y0); - return (ARK_ILL_INPUT); - } - - /* Set implicit/explicit problem based on function pointers */ - step_mem->explicit_rhs = (fse == NULL) ? SUNFALSE : SUNTRUE; - step_mem->implicit_rhs = (fsi == NULL) ? SUNFALSE : SUNTRUE; - - /* Create a default Newton NLS object (just in case; will be deleted if - the user attaches a nonlinear solver) */ - if (step_mem->implicit_rhs && !(step_mem->NLS)) - { - NLS = SUNNonlinSol_Newton(y0, ark_mem->sunctx); - if (!NLS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Error creating default Newton solver"); - ARKodeFree((void**)&ark_mem); - return (ARK_MEM_FAIL); - } - retval = ARKodeSetNonlinearSolver(ark_mem, NLS); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Error attaching default Newton solver"); - ARKodeFree((void**)&ark_mem); - return (ARK_MEM_FAIL); - } - step_mem->ownNLS = SUNTRUE; - } - - /* ReInitialize main ARKODE infrastructure */ - retval = arkInit(arkode_mem, t0, y0, FIRST_INIT); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Unable to reinitialize main ARKODE infrastructure"); - return (retval); - } - - /* Copy the input parameters into ARKODE state */ - step_mem->fse = fse; - step_mem->fsi = fsi; - - /* Initialize all the counters */ - step_mem->nfse = 0; - step_mem->nfsi = 0; - step_mem->nsetups = 0; - step_mem->nstlp = 0; - step_mem->nls_iters = 0; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- mriStep_Reset: @@ -734,14 +735,6 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) return; } -/*=============================================================== - MRIStep Private functions - ===============================================================*/ - -/*--------------------------------------------------------------- - Interface routines supplied to ARKODE - ---------------------------------------------------------------*/ - /*--------------------------------------------------------------- mriStep_AttachLinsol: @@ -1620,9 +1613,9 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== Internal utility routines - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- mriStep_AccessARKODEStepMem: @@ -2573,9 +2566,9 @@ int mriStep_StageSetup(ARKodeMem ark_mem) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== User-callable functions for a custom inner integrator - ---------------------------------------------------------------*/ + ===============================================================*/ int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper) { @@ -2769,9 +2762,9 @@ int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, return ARK_SUCCESS; } -/*--------------------------------------------------------------- - Internal inner integrator functions - ---------------------------------------------------------------*/ +/*=============================================================== + Private inner integrator functions + ===============================================================*/ /* Check for required operations */ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper) diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index f875810246..29caf263c3 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -37,13 +37,17 @@ extern "C" { #define MRISTAGE_DIRK_FAST 3 /* Implicit solver constants (duplicate from arkode_arkstep_impl.h) */ -#define MAXCOR 3 /* max number of nonlinear iterations */ -#define CRDOWN \ - SUN_RCONST(0.3) /* constant to estimate the convergence - rate for the nonlinear equation */ -#define DGMAX SUN_RCONST(0.2) /* if |gamma/gammap-1| > DGMAX then call lsetup */ -#define RDIV SUN_RCONST(2.3) /* declare divergence if ratio del/delp > RDIV */ -#define MSBP 20 /* max no. of steps between lsetup calls */ +/* max number of nonlinear iterations */ +#define MAXCOR 3 +/* constant to estimate the convergence rate for the nonlinear equation */ +#define CRDOWN SUN_RCONST(0.3) +/* if |gamma/gammap-1| > DGMAX then call lsetup */ +#define DGMAX SUN_RCONST(0.2) +/* declare divergence if ratio del/delp > RDIV */ +#define RDIV SUN_RCONST(2.3) +/* max no. of steps between lsetup calls */ +#define MSBP 20 +/* default solver tolerance factor */ #define NLSCOEF SUN_RCONST(0.1) /*=============================================================== diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 116266fea1..e4ca3abaa2 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -24,451 +24,184 @@ #include "arkode_mristep_impl.h" /*=============================================================== - MRIStep Optional input functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. + Exported optional input functions. ===============================================================*/ -int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} -int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data) -{ - return (ARKodeResize(arkode_mem, y0, ONE, t0, resize, resize_data)); -} +/*--------------------------------------------------------------- + MRIStepSetCoupling: -int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) + Specifies to use a customized coupling structure for the slow + portion of the system. + ---------------------------------------------------------------*/ +int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC) { - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} + int retval; + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + sunindextype Tlrw, Tliw; -int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} + /* check for illegal inputs */ + if (MRIC == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_MRISTEP_NO_COUPLING); + return (ARK_ILL_INPUT); + } -void MRIStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + /* clear any existing parameters and coupling structure */ + step_mem->stages = 0; + step_mem->q = 0; + step_mem->p = 0; + MRIStepCoupling_Space(step_mem->MRIC, &Tliw, &Tlrw); + MRIStepCoupling_Free(step_mem->MRIC); + step_mem->MRIC = NULL; + ark_mem->liw -= Tliw; + ark_mem->lrw -= Tlrw; -void MRIStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} + /* set the relevant parameters */ + step_mem->stages = MRIC->stages; + step_mem->q = MRIC->q; + step_mem->p = MRIC->p; -int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) -{ - return (ARKodeSStolerances(arkode_mem, reltol, abstol)); -} + /* copy the coupling structure in step memory */ + step_mem->MRIC = MRIStepCoupling_Copy(MRIC); + if (step_mem->MRIC == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_MRISTEP_NO_COUPLING); + return (ARK_MEM_NULL); + } + MRIStepCoupling_Space(step_mem->MRIC, &Tliw, &Tlrw); + ark_mem->liw += Tliw; + ark_mem->lrw += Tlrw; -int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) -{ - return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); + return (ARK_SUCCESS); } -int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) -{ - return (ARKodeWFtolerances(arkode_mem, efun)); -} +/*--------------------------------------------------------------- + MRIStepSetPreInnerFn: -int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) + Sets the user-supplied function called BEFORE the inner evolve + ---------------------------------------------------------------*/ +int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) { - return (ARKodeSetFixedStep(arkode_mem, hfixed)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepSetUserData(void* arkode_mem, void* user_data) -{ - return (ARKodeSetUserData(arkode_mem, user_data)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepSetDefaults(void* arkode_mem) -{ - return (ARKodeSetDefaults(arkode_mem)); -} + /* Set pre inner evolve function */ + step_mem->pre_inner_evolve = prefn; -int MRIStepSetOrder(void* arkode_mem, int ord) -{ - return (ARKodeSetOrder(arkode_mem, ord)); + return (ARK_SUCCESS); } -int MRIStepSetDenseOrder(void* arkode_mem, int dord) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, dord)); -} +/*--------------------------------------------------------------- + MRIStepSetPostInnerFn: -int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) + Sets the user-supplied function called AFTER the inner evolve + ---------------------------------------------------------------*/ +int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) { - return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) -{ - return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepSetLinear(void* arkode_mem, int timedepend) -{ - return (ARKodeSetLinear(arkode_mem, timedepend)); -} + /* Set pre inner evolve function */ + step_mem->post_inner_evolve = postfn; -int MRIStepSetNonlinear(void* arkode_mem) -{ - return (ARKodeSetNonlinear(arkode_mem)); + return (ARK_SUCCESS); } -int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) -{ - return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); -} +/*=============================================================== + Exported optional output functions. + ===============================================================*/ -int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) -{ - return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); -} +/*--------------------------------------------------------------- + MRIStepGetNumRhsEvals: -int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) + Returns the current number of calls to fse and fsi + ---------------------------------------------------------------*/ +int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, + long int* nfsi_evals) { - return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) -{ - return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) -{ - return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); -} + /* get number of fse and fsi evals from step_mem */ + *nfse_evals = step_mem->nfse; + *nfsi_evals = step_mem->nfsi; -int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) -{ - return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); + return (ARK_SUCCESS); } -int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) -{ - return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); -} +/*--------------------------------------------------------------- + MRIStepGetCurrentCoupling: -int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) + Sets pointer to the slow coupling structure currently in use. + ---------------------------------------------------------------*/ +int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC) { - return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) -{ - return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) -{ - return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); -} + /* get coupling structure from step_mem */ + *MRIC = step_mem->MRIC; -int MRIStepSetInterpolantDegree(void* arkode_mem, int degree) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, degree)); + return (ARK_SUCCESS); } -int MRIStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} +/*--------------------------------------------------------------- + MRIStepGetLastInnerStepFlag: -int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) + Returns the last return value from the inner stepper. + ---------------------------------------------------------------*/ +int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) { - return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); -} + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; -int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) -{ - return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); -} + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } -int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); -} + /* get the last return value from the inner stepper */ + *flag = step_mem->stepper->last_flag; -int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) -{ - return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); + return (ARK_SUCCESS); } -int MRIStepClearStopTime(void* arkode_mem) -{ - return (ARKodeClearStopTime(arkode_mem)); -} - -int MRIStepSetRootDirection(void* arkode_mem, int* rootdir) -{ - return (ARKodeSetRootDirection(arkode_mem, rootdir)); -} - -int MRIStepSetNoInactiveRootWarn(void* arkode_mem) -{ - return (ARKodeSetNoInactiveRootWarn(arkode_mem)); -} - -int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); -} - -int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) -{ - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} +/*=============================================================== + Private functions attached to ARKODE + ===============================================================*/ /*--------------------------------------------------------------- - These wrappers for ARKLs module 'set' routines all are - documented in arkode_mristep.h. - ---------------------------------------------------------------*/ -int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) -{ - return (ARKodeSetLinearSolver(arkode_mem, LS, A)); -} - -int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) -{ - return (ARKodeSetJacFn(arkode_mem, jac)); -} - -int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj) -{ - return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); -} - -int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) -{ - return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); -} - -int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) -{ - return (ARKodeSetEpsLin(arkode_mem, eplifac)); -} - -int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) -{ - return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); -} - -int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve) -{ - return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); -} - -int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes) -{ - return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); -} - -int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) -{ - return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); -} - -int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) -{ - return (ARKodeSetLinSysFn(arkode_mem, linsys)); -} - -/*=============================================================== - MRIStep Optional output functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. - ===============================================================*/ -int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps) -{ - return (ARKodeGetNumSteps(arkode_mem, nssteps)); -} - -int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) -{ - return (ARKodeGetLastStep(arkode_mem, hlast)); -} - -int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) -{ - return (ARKodeGetCurrentTime(arkode_mem, tcur)); -} - -int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state) -{ - return (ARKodeGetCurrentState(arkode_mem, state)); -} - -int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) -{ - return (ARKodeComputeState(arkode_mem, zcor, z)); -} - -int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) -{ - return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); -} - -int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) -{ - return (ARKodeGetErrWeights(arkode_mem, eweight)); -} - -int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) -{ - return (ARKodeGetNumGEvals(arkode_mem, ngevals)); -} - -int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} - -int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data) -{ - return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, - sdata, user_data)); -} - -int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) -{ - return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); -} - -int MRIStepGetUserData(void* arkode_mem, void** user_data) -{ - return (ARKodeGetUserData(arkode_mem, user_data)); -} - -char* MRIStepGetReturnFlagName(long int flag) -{ - return (ARKodeGetReturnFlagName(flag)); -} - -int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) -{ - return (ARKodeGetCurrentGamma(arkode_mem, gamma)); -} - -int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) -{ - return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); -} - -int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) -{ - return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); -} - -int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) -{ - return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); -} - -int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails) -{ - return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); -} - -int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) -{ - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); -} - -int MRIStepWriteParameters(void* arkode_mem, FILE* fp) -{ - return (ARKodeWriteParameters(arkode_mem, fp)); -} + mriStep_SetUserData: -/*--------------------------------------------------------------- - These wrappers for ARKLs module 'get' routines all are - documented in arkode_mristep.h. + Passes user-data pointer to attached linear solver module. ---------------------------------------------------------------*/ -int MRIStepGetJac(void* arkode_mem, SUNMatrix* J) -{ - return (ARKodeGetJac(arkode_mem, J)); -} - -int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J) -{ - return (ARKodeGetJacTime(arkode_mem, t_J)); -} - -int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J) -{ - return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); -} - -int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) -{ - return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); -} - -int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) -{ - return (ARKodeGetNumJacEvals(arkode_mem, njevals)); -} - -int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) -{ - return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); -} - -int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) -{ - return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); -} - -int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) -{ - return (ARKodeGetNumLinIters(arkode_mem, nliters)); -} - -int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) -{ - return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); -} - -int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) -{ - return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); -} - -int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) -{ - return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); -} - -int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) -{ - return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); -} - -int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag) -{ - return (ARKodeGetLastLinFlag(arkode_mem, flag)); -} - -char* MRIStepGetLinReturnFlagName(long int flag) -{ - return (ARKodeGetLinReturnFlagName(flag)); -} - -/*=============================================================== - MRIStep optional input functions -- stepper-specific - ===============================================================*/ - int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) { ARKodeMRIStepMem step_mem; @@ -617,108 +350,11 @@ int mriStep_SetOrder(ARKodeMem ark_mem, int ord) } /*--------------------------------------------------------------- - MRIStepSetCoupling: + mriStep_SetNonlinCRDown: - Specifies to use a customized coupling structure for the slow - portion of the system. - ---------------------------------------------------------------*/ -int MRIStepSetCoupling(void* arkode_mem, MRIStepCoupling MRIC) -{ - int retval; - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - sunindextype Tlrw, Tliw; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* check for illegal inputs */ - if (MRIC == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_MRISTEP_NO_COUPLING); - return (ARK_ILL_INPUT); - } - - /* clear any existing parameters and coupling structure */ - step_mem->stages = 0; - step_mem->q = 0; - step_mem->p = 0; - MRIStepCoupling_Space(step_mem->MRIC, &Tliw, &Tlrw); - MRIStepCoupling_Free(step_mem->MRIC); - step_mem->MRIC = NULL; - ark_mem->liw -= Tliw; - ark_mem->lrw -= Tlrw; - - /* set the relevant parameters */ - step_mem->stages = MRIC->stages; - step_mem->q = MRIC->q; - step_mem->p = MRIC->p; - - /* copy the coupling structure in step memory */ - step_mem->MRIC = MRIStepCoupling_Copy(MRIC); - if (step_mem->MRIC == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_MRISTEP_NO_COUPLING); - return (ARK_MEM_NULL); - } - MRIStepCoupling_Space(step_mem->MRIC, &Tliw, &Tlrw); - ark_mem->liw += Tliw; - ark_mem->lrw += Tlrw; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - MRIStepSetPreInnerFn: - - Sets the user-supplied function called BEFORE the inner evolve - ---------------------------------------------------------------*/ -int MRIStepSetPreInnerFn(void* arkode_mem, MRIStepPreInnerFn prefn) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Set pre inner evolve function */ - step_mem->pre_inner_evolve = prefn; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - MRIStepSetPostInnerFn: - - Sets the user-supplied function called AFTER the inner evolve - ---------------------------------------------------------------*/ -int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Set pre inner evolve function */ - step_mem->post_inner_evolve = postfn; - - return (ARK_SUCCESS); -} - -/*--------------------------------------------------------------- - mriStep_SetNonlinCRDown: - - Specifies the user-provided nonlinear convergence constant - crdown. Legal values are strictly positive; illegal values - imply a reset to the default. + Specifies the user-provided nonlinear convergence constant + crdown. Legal values are strictly positive; illegal values + imply a reset to the default. ---------------------------------------------------------------*/ int mriStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown) { @@ -933,31 +569,6 @@ int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce) return (ARK_SUCCESS); } -/*=============================================================== - MRIStep optional output functions -- stepper-specific - ===============================================================*/ - -/*--------------------------------------------------------------- - MRIStepGetLastInnerStepFlag: - - Returns the last return value from the inner stepper. - ---------------------------------------------------------------*/ -int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get the last return value from the inner stepper */ - *flag = step_mem->stepper->last_flag; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- mriStep_GetCurrentGamma: Returns the current value of gamma ---------------------------------------------------------------*/ @@ -971,29 +582,6 @@ int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) return (retval); } -/*--------------------------------------------------------------- - MRIStepGetNumRhsEvals: - - Returns the current number of calls to fse and fsi - ---------------------------------------------------------------*/ -int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, - long int* nfsi_evals) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get number of fse and fsi evals from step_mem */ - *nfse_evals = step_mem->nfse; - *nfsi_evals = step_mem->nfsi; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- mriStep_GetNumLinSolvSetups: @@ -1074,27 +662,6 @@ int mriStep_GetNonlinSolvStats(ARKodeMem ark_mem, long int* nniters, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - MRIStepGetCurrentCoupling: - - Sets pointer to the slow coupling structure currently in use. - ---------------------------------------------------------------*/ -int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC) -{ - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; - - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get coupling structure from step_mem */ - *MRIC = step_mem->MRIC; - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- mriStep_PrintAllStats: @@ -1209,10 +776,6 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) return (ARK_SUCCESS); } -/*=============================================================== - MRIStep parameter output - ===============================================================*/ - /*--------------------------------------------------------------- mriStep_WriteParameters: @@ -1267,36 +830,461 @@ int mriStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - MRIStepWriteCoupling: +/*=============================================================== + Exported-but-deprecated user-callable functions. + ===============================================================*/ - Outputs coupling structure to the provided file pointer. - ---------------------------------------------------------------*/ -int MRIStepWriteCoupling(void* arkode_mem, FILE* fp) +int MRIStepResize(void* arkode_mem, N_Vector y0, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + return (ARKodeResize(arkode_mem, y0, ONE, t0, resize, resize_data)); +} - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} - /* check that coupling structure is non-NULL (otherwise report error) */ - if (step_mem->MRIC == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Coupling structure is NULL"); - return (ARK_MEM_NULL); - } +int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol) +{ + return (ARKodeSStolerances(arkode_mem, reltol, abstol)); +} - /* write coupling structure to specified file */ - fprintf(fp, "\nMRIStep coupling structure:\n"); - MRIStepCoupling_Write(step_mem->MRIC, fp); +int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) +{ + return (ARKodeSVtolerances(arkode_mem, reltol, abstol)); +} - return (ARK_SUCCESS); +int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun) +{ + return (ARKodeWFtolerances(arkode_mem, efun)); } -/*--------------------------------------------------------------- - EOF - ---------------------------------------------------------------*/ +int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A) +{ + return (ARKodeSetLinearSolver(arkode_mem, LS, A)); +} + +int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int MRIStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int MRIStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} + +int MRIStepSetInterpolantType(void* arkode_mem, int itype) +{ + return (ARKodeSetInterpolantType(arkode_mem, itype)); +} + +int MRIStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); +} + +int MRIStepSetDenseOrder(void* arkode_mem, int dord) +{ + return (ARKodeSetInterpolantDegree(arkode_mem, dord)); +} + +int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS) +{ + return (ARKodeSetNonlinearSolver(arkode_mem, NLS)); +} + +int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) +{ + return (ARKodeSetNlsRhsFn(arkode_mem, nls_fi)); +} + +int MRIStepSetLinear(void* arkode_mem, int timedepend) +{ + return (ARKodeSetLinear(arkode_mem, timedepend)); +} + +int MRIStepSetNonlinear(void* arkode_mem) +{ + return (ARKodeSetNonlinear(arkode_mem)); +} + +int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); +} + +int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) +{ + return (ARKodeSetNonlinCRDown(arkode_mem, crdown)); +} + +int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) +{ + return (ARKodeSetNonlinRDiv(arkode_mem, rdiv)); +} + +int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax) +{ + return (ARKodeSetDeltaGammaMax(arkode_mem, dgmax)); +} + +int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp) +{ + return (ARKodeSetLSetupFrequency(arkode_mem, msbp)); +} + +int MRIStepSetPredictorMethod(void* arkode_mem, int pred_method) +{ + return (ARKodeSetPredictorMethod(arkode_mem, pred_method)); +} + +int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor) +{ + return (ARKodeSetMaxNonlinIters(arkode_mem, maxcor)); +} + +int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) +{ + return (ARKodeSetNonlinConvCoef(arkode_mem, nlscoef)); +} + +int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil) +{ + return (ARKodeSetMaxHnilWarns(arkode_mem, mxhnil)); +} + +int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) +{ + return (ARKodeSetInterpolateStopTime(arkode_mem, interp)); +} + +int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (ARKodeSetStopTime(arkode_mem, tstop)); +} + +int MRIStepClearStopTime(void* arkode_mem) +{ + return (ARKodeClearStopTime(arkode_mem)); +} + +int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (ARKodeSetFixedStep(arkode_mem, hfixed)); +} + +int MRIStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (ARKodeSetRootDirection(arkode_mem, rootdir)); +} + +int MRIStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); +} + +int MRIStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} + +int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +{ + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); +} + +int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); +} + +int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) +{ + return (ARKodeSetStagePredictFn(arkode_mem, PredictStage)); +} + +int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce) +{ + return (ARKodeSetDeduceImplicitRhs(arkode_mem, deduce)); +} + +int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac) +{ + return (ARKodeSetJacFn(arkode_mem, jac)); +} + +int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj) +{ + return (ARKodeSetJacEvalFrequency(arkode_mem, msbj)); +} + +int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) +{ + return (ARKodeSetLinearSolutionScaling(arkode_mem, onoff)); +} + +int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac) +{ + return (ARKodeSetEpsLin(arkode_mem, eplifac)); +} + +int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) +{ + return (ARKodeSetLSNormFactor(arkode_mem, nrmfac)); +} + +int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve) +{ + return (ARKodeSetPreconditioner(arkode_mem, psetup, psolve)); +} + +int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes) +{ + return (ARKodeSetJacTimes(arkode_mem, jtsetup, jtimes)); +} + +int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn) +{ + return (ARKodeSetJacTimesRhsFn(arkode_mem, jtimesRhsFn)); +} + +int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) +{ + return (ARKodeSetLinSysFn(arkode_mem, linsys)); +} + +int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z) +{ + return (ARKodeComputeState(arkode_mem, zcor, z)); +} + +int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups) +{ + return (ARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups)); +} + +int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +{ + return (ARKodeGetWorkSpace(arkode_mem, lenrw, leniw)); +} + +int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps) +{ + return (ARKodeGetNumSteps(arkode_mem, nssteps)); +} + +int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (ARKodeGetLastStep(arkode_mem, hlast)); +} + +int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (ARKodeGetCurrentTime(arkode_mem, tcur)); +} + +int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (ARKodeGetCurrentState(arkode_mem, state)); +} + +int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma) +{ + return (ARKodeGetCurrentGamma(arkode_mem, gamma)); +} + +int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfact) +{ + return (ARKodeGetTolScaleFactor(arkode_mem, tolsfact)); +} + +int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight) +{ + return (ARKodeGetErrWeights(arkode_mem, eweight)); +} + +int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals) +{ + return (ARKodeGetNumGEvals(arkode_mem, ngevals)); +} + +int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound) +{ + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); +} + +int MRIStepGetUserData(void* arkode_mem, void** user_data) +{ + return (ARKodeGetUserData(arkode_mem, user_data)); +} + +int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} + +char* MRIStepGetReturnFlagName(long int flag) +{ + return (ARKodeGetReturnFlagName(flag)); +} + +int MRIStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); +} + +int MRIStepWriteCoupling(void* arkode_mem, FILE* fp) +{ + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* check that coupling structure is non-NULL (otherwise report error) */ + if (step_mem->MRIC == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + "Coupling structure is NULL"); + return (ARK_MEM_NULL); + } + + /* write coupling structure to specified file */ + fprintf(fp, "\nMRIStep coupling structure:\n"); + MRIStepCoupling_Write(step_mem->MRIC, fp); + + return (ARK_SUCCESS); +} + +int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data) +{ + return (ARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, Fi, gamma, + sdata, user_data)); +} + +int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) +{ + return (ARKodeGetNumNonlinSolvIters(arkode_mem, nniters)); +} + +int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails) +{ + return (ARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails)); +} + +int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails) +{ + return (ARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails)); +} + +int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails) +{ + return (ARKodeGetNumStepSolveFails(arkode_mem, nncfails)); +} + +int MRIStepGetJac(void* arkode_mem, SUNMatrix* J) +{ + return (ARKodeGetJac(arkode_mem, J)); +} + +int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J) +{ + return (ARKodeGetJacTime(arkode_mem, t_J)); +} + +int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J) +{ + return (ARKodeGetJacNumSteps(arkode_mem, nst_J)); +} + +int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) +{ + return (ARKodeGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS)); +} + +int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals) +{ + return (ARKodeGetNumJacEvals(arkode_mem, njevals)); +} + +int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals) +{ + return (ARKodeGetNumPrecEvals(arkode_mem, npevals)); +} + +int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves) +{ + return (ARKodeGetNumPrecSolves(arkode_mem, npsolves)); +} + +int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters) +{ + return (ARKodeGetNumLinIters(arkode_mem, nliters)); +} + +int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails) +{ + return (ARKodeGetNumLinConvFails(arkode_mem, nlcfails)); +} + +int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups) +{ + return (ARKodeGetNumJTSetupEvals(arkode_mem, njtsetups)); +} + +int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals) +{ + return (ARKodeGetNumJtimesEvals(arkode_mem, njvevals)); +} + +int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) +{ + return (ARKodeGetNumLinRhsEvals(arkode_mem, nfevalsLS)); +} + +int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag) +{ + return (ARKodeGetLastLinFlag(arkode_mem, flag)); +} + +char* MRIStepGetLinReturnFlagName(long int flag) +{ + return (ARKodeGetLinReturnFlagName(flag)); +} + +void MRIStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +void MRIStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +/*=============================================================== + EOF + ===============================================================*/ diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index aeb450b95a..4375806ade 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -24,7 +24,7 @@ #include "arkode_mristep_impl.h" /*=============================================================== - Exported functions + Interface routines supplied to ARKODE ===============================================================*/ /*--------------------------------------------------------------- @@ -178,9 +178,9 @@ int mriStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== Utility routines called by MRIStep - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- mriStep_NlsInit: @@ -353,9 +353,9 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) return (retval); } -/*--------------------------------------------------------------- +/*=============================================================== Interface routines supplied to the SUNNonlinearSolver module - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- mriStep_NlsLSetup: diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index d5619e7757..451fa6711a 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -768,48 +768,6 @@ int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) return ARK_SUCCESS; } -int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) -{ - int retval; - ARKodeMem ark_mem; - ARKodeRelaxMem relax_mem; - - retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); - if (retval) { return retval; } - - switch (fmt) - { - case SUN_OUTPUTFORMAT_TABLE: - fprintf(outfile, "Relax fn evals = %ld\n", - relax_mem->num_relax_fn_evals); - fprintf(outfile, "Relax Jac evals = %ld\n", - relax_mem->num_relax_jac_evals); - fprintf(outfile, "Relax fails = %ld\n", - relax_mem->num_fails); - fprintf(outfile, "Relax bound fails = %ld\n", - relax_mem->bound_fails); - fprintf(outfile, "Relax NLS iters = %ld\n", - relax_mem->nls_iters); - fprintf(outfile, "Relax NLS fails = %ld\n", - relax_mem->nls_fails); - break; - case SUN_OUTPUTFORMAT_CSV: - fprintf(outfile, ",Relax fn evals,%ld", relax_mem->num_relax_fn_evals); - fprintf(outfile, ",Relax Jac evals,%ld", relax_mem->num_relax_jac_evals); - fprintf(outfile, ",Relax fails,%ld", relax_mem->num_fails); - fprintf(outfile, ",Relax bound fails,%ld", relax_mem->bound_fails); - fprintf(outfile, ",Relax NLS iters,%ld", relax_mem->nls_iters); - fprintf(outfile, ",Relax NLS fails,%ld", relax_mem->nls_fails); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid formatting option."); - return ARK_ILL_INPUT; - } - - return ARK_SUCCESS; -} - /* ============================================================================= * Driver and Stepper Functions * ===========================================================================*/ @@ -966,6 +924,49 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, return ARK_SUCCESS; } +/* Print relaxation solver statistics, called by ARKODE */ +int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + int retval; + ARKodeMem ark_mem; + ARKodeRelaxMem relax_mem; + + retval = arkRelaxAccessMem(arkode_mem, __func__, &ark_mem, &relax_mem); + if (retval) { return retval; } + + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + fprintf(outfile, "Relax fn evals = %ld\n", + relax_mem->num_relax_fn_evals); + fprintf(outfile, "Relax Jac evals = %ld\n", + relax_mem->num_relax_jac_evals); + fprintf(outfile, "Relax fails = %ld\n", + relax_mem->num_fails); + fprintf(outfile, "Relax bound fails = %ld\n", + relax_mem->bound_fails); + fprintf(outfile, "Relax NLS iters = %ld\n", + relax_mem->nls_iters); + fprintf(outfile, "Relax NLS fails = %ld\n", + relax_mem->nls_fails); + break; + case SUN_OUTPUTFORMAT_CSV: + fprintf(outfile, ",Relax fn evals,%ld", relax_mem->num_relax_fn_evals); + fprintf(outfile, ",Relax Jac evals,%ld", relax_mem->num_relax_jac_evals); + fprintf(outfile, ",Relax fails,%ld", relax_mem->num_fails); + fprintf(outfile, ",Relax bound fails,%ld", relax_mem->bound_fails); + fprintf(outfile, ",Relax NLS iters,%ld", relax_mem->nls_iters); + fprintf(outfile, ",Relax NLS fails,%ld", relax_mem->nls_fails); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + /* ============================================================================= * EOF * ===========================================================================*/ diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index 3ea456cc32..05d0a4a08c 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -24,6 +24,10 @@ #include "arkode_impl.h" +/*=============================================================== + Exported functions + ===============================================================*/ + /*--------------------------------------------------------------- ARKodeRootInit: @@ -267,6 +271,10 @@ int ARKodeRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) return (ARK_SUCCESS); } +/*=============================================================== + Private functions + ===============================================================*/ + /*--------------------------------------------------------------- arkRootFree diff --git a/src/arkode/arkode_root_impl.h b/src/arkode/arkode_root_impl.h index 6b4d66704b..8e410b6927 100644 --- a/src/arkode/arkode_root_impl.h +++ b/src/arkode/arkode_root_impl.h @@ -30,10 +30,10 @@ extern "C" { ===============================================================*/ #define ARK_ROOT_LRW 5 -#define ARK_ROOT_LIW 12 /* int, ptr, etc */ +#define ARK_ROOT_LIW 12 /* Numeric constants */ -#define HUND SUN_RCONST(100.0) /* real 100.0 */ +#define HUND SUN_RCONST(100.0) /*=============================================================== ARKODE Root-finding Data Structure diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 4cf245d5e0..8537444ab6 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -30,7 +30,7 @@ #include "arkode_sprkstep_impl.h" /*=============================================================== - SPRKStep Exported functions -- Required + Exported functions ===============================================================*/ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, @@ -166,53 +166,6 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, return ((void*)ark_mem); } -/*--------------------------------------------------------------- - sprkStep_Resize: - - This routine resizes the memory within the SPRKStep module. - ---------------------------------------------------------------*/ -int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) -{ - ARKodeSPRKStepMem step_mem = NULL; - sunindextype lrw1, liw1, lrw_diff, liw_diff; - int retval; - - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* Determine change in vector sizes */ - lrw1 = liw1 = 0; - if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } - lrw_diff = lrw1 - ark_mem->lrw1; - liw_diff = liw1 - ark_mem->liw1; - ark_mem->lrw1 = lrw1; - ark_mem->liw1 = liw1; - - /* Resize the local vectors */ - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->sdata)) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); - } - - if (step_mem->yerr) - { - if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, - &step_mem->yerr)) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "Unable to resize vector"); - return (ARK_MEM_FAIL); - } - } - - return (ARK_SUCCESS); -} - /*--------------------------------------------------------------- SPRKStepReInit: @@ -284,6 +237,57 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, return (ARK_SUCCESS); } +/*=============================================================== + Interface routines supplied to ARKODE + ===============================================================*/ + +/*--------------------------------------------------------------- + sprkStep_Resize: + + This routine resizes the memory within the SPRKStep module. + ---------------------------------------------------------------*/ +int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +{ + ARKodeSPRKStepMem step_mem = NULL; + sunindextype lrw1, liw1, lrw_diff, liw_diff; + int retval; + + /* access ARKodeSPRKStepMem structure */ + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Determine change in vector sizes */ + lrw1 = liw1 = 0; + if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } + lrw_diff = lrw1 - ark_mem->lrw1; + liw_diff = liw1 - ark_mem->liw1; + ark_mem->lrw1 = lrw1; + ark_mem->liw1 = liw1; + + /* Resize the local vectors */ + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->sdata)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + + if (step_mem->yerr) + { + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, y0, + &step_mem->yerr)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to resize vector"); + return (ARK_MEM_FAIL); + } + } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- sprkStep_Reset: @@ -338,14 +342,6 @@ void sprkStep_Free(ARKodeMem ark_mem) } } -/*=============================================================== - SPRKStep Private functions - ===============================================================*/ - -/*--------------------------------------------------------------- - Interface routines supplied to ARKODE - ---------------------------------------------------------------*/ - /*--------------------------------------------------------------- sprkStep_Init: @@ -709,9 +705,9 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, return 0; } -/*--------------------------------------------------------------- +/*=============================================================== Internal utility routines - ---------------------------------------------------------------*/ + ===============================================================*/ /*--------------------------------------------------------------- sprkStep_AccessARKODEStepMem: @@ -778,3 +774,7 @@ sunbooleantype sprkStep_CheckNVector(N_Vector tmpl) } return (SUNTRUE); } + +/*=============================================================== + EOF + ===============================================================*/ diff --git a/src/arkode/arkode_sprkstep_impl.h b/src/arkode/arkode_sprkstep_impl.h index 3f7928dbc7..0493106586 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -66,6 +66,7 @@ typedef struct ARKodeSPRKStepMemRec SPRK time step module private function prototypes ===============================================================*/ +/* Interface routines supplied to ARKODE */ int sprkStep_Init(ARKodeMem ark_mem, int init_type); int sprkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); @@ -89,9 +90,11 @@ int sprkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, int sprkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, ARKodeSPRKStepMem* step_mem); sunbooleantype sprkStep_CheckNVector(N_Vector tmpl); + /* f1 = p' (Force evaluation) */ int sprkStep_f1(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, N_Vector f1, void* user_data); + /* f2 = q' (Velocity evaluation) */ int sprkStep_f2(ARKodeSPRKStepMem step_mem, sunrealtype tcur, N_Vector ycur, N_Vector f2, void* user_data); diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index 0d4760fd17..f8ccd8bfb2 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -29,198 +29,9 @@ #include "arkode_sprkstep_impl.h" /*=============================================================== - SPRKStep Optional input functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. - ===============================================================*/ -int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) -{ - return (ARKodeReset(arkode_mem, tR, yR)); -} - -int SPRKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) -{ - return (ARKodeResize(arkode_mem, y0, hscale, t0, resize, resize_data)); -} - -int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask) -{ - return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); -} - -int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) -{ - return (ARKodeGetDky(arkode_mem, t, k, dky)); -} - -void SPRKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } - -void SPRKStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} - -int SPRKStepSetUserData(void* arkode_mem, void* user_data) -{ - return (ARKodeSetUserData(arkode_mem, user_data)); -} - -int SPRKStepSetDefaults(void* arkode_mem) -{ - return (ARKodeSetDefaults(arkode_mem)); -} - -int SPRKStepSetOrder(void* arkode_mem, int ord) -{ - return (ARKodeSetOrder(arkode_mem, ord)); -} - -int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) -{ - return (ARKodeSetInterpolantDegree(arkode_mem, degree)); -} - -int SPRKStepSetInterpolantType(void* arkode_mem, int itype) -{ - return (ARKodeSetInterpolantType(arkode_mem, itype)); -} - -int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) -{ - return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); -} - -int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) -{ - return (ARKodeSetStopTime(arkode_mem, tstop)); -} - -int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir) -{ - return (ARKodeSetRootDirection(arkode_mem, rootdir)); -} - -int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) -{ - return (ARKodeSetNoInactiveRootWarn(arkode_mem)); -} - -int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) -{ - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} - -int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) -{ - return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); -} - -int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) -{ - return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); -} - -int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) -{ - return (ARKodeSetFixedStep(arkode_mem, hfixed)); -} - -/*=============================================================== - SPRKStep Optional output functions (wrappers for generic ARKODE - utility routines). All are documented in arkode_io.c. - ===============================================================*/ -int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) -{ - return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); -} - -int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) -{ - return (ARKodeGetNumSteps(arkode_mem, nsteps)); -} - -int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) -{ - return (ARKodeGetLastStep(arkode_mem, hlast)); -} - -int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) -{ - return (ARKodeGetCurrentStep(arkode_mem, hcur)); -} - -int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) -{ - return (ARKodeGetCurrentTime(arkode_mem, tcur)); -} - -int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state) -{ - return (ARKodeGetCurrentState(arkode_mem, state)); -} - -int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) -{ - return (ARKodeRootInit(arkode_mem, nrtfn, g)); -} - -int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) -{ - return (ARKodeGetRootInfo(arkode_mem, rootsfound)); -} - -int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur) -{ - return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); -} - -int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} - -int SPRKStepGetUserData(void* arkode_mem, void** user_data) -{ - return (ARKodeGetUserData(arkode_mem, user_data)); -} - -char* SPRKStepGetReturnFlagName(long int flag) -{ - return (ARKodeGetReturnFlagName(flag)); -} - -int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) -{ - return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); -} - -int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) -{ - return (ARKodeWriteParameters(arkode_mem, fp)); -} - -/*=============================================================== - SPRKStep optional input functions -- stepper-specific + Exported optional input functions. ===============================================================*/ -/*--------------------------------------------------------------- - sprkStep_SetDefaults: - - Resets all SPRKStep optional inputs to their default values. - Does not change problem-defining function pointers or - user_data pointer. Also leaves alone any data - structures/options related to the ARKODE infrastructure itself - (e.g., root-finding and post-process step). - ---------------------------------------------------------------*/ -int sprkStep_SetDefaults(ARKodeMem ark_mem) -{ - /* use the default method order */ - return (sprkStep_SetOrder(ark_mem, 0)); -} - /*--------------------------------------------------------------- SPRKStepSetUseCompensatedSums: @@ -315,40 +126,31 @@ int SPRKStepSetMethodName(void* arkode_mem, const char* method) return step_mem->method ? ARK_SUCCESS : ARK_ILL_INPUT; } +/*=============================================================== + Exported optional output functions. + ===============================================================*/ + /*--------------------------------------------------------------- - sprkStep_SetOrder: + SPRKStepGetCurrentMethod: - Specifies the method order + Returns the stepper method structure. ---------------------------------------------------------------*/ -int sprkStep_SetOrder(ARKodeMem ark_mem, int ord) +int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) { + ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeSPRKStepMem structure */ - retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + /* access ARKodeMem and ARKodeSPRKStepMem structures */ + retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Invalid orders result in the default order being used. */ - if (ord == 7 || ord == 9 || ord > 10) { ord = -1; } - - /* set user-provided value, or default, depending on argument */ - if (ord <= 0) { step_mem->q = 4; } - else { step_mem->q = ord; } - - if (step_mem->method) - { - ARKodeSPRKTable_Free(step_mem->method); - step_mem->method = NULL; - } + *sprk_storage = step_mem->method; return (ARK_SUCCESS); } -/*=============================================================== - SPRKStep optional output functions -- stepper-specific - ===============================================================*/ - /*--------------------------------------------------------------- SPRKStepGetNumRhsEvals: @@ -371,23 +173,51 @@ int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) return (ARK_SUCCESS); } +/*=============================================================== + Private functions attached to ARKODE + ===============================================================*/ + /*--------------------------------------------------------------- - SPRKStepGetCurrentMethod: + sprkStep_SetDefaults: - Returns the stepper method structure. + Resets all SPRKStep optional inputs to their default values. + Does not change problem-defining function pointers or + user_data pointer. Also leaves alone any data + structures/options related to the ARKODE infrastructure itself + (e.g., root-finding and post-process step). ---------------------------------------------------------------*/ -int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) +int sprkStep_SetDefaults(ARKodeMem ark_mem) +{ + /* use the default method order */ + return (sprkStep_SetOrder(ark_mem, 0)); +} + +/*--------------------------------------------------------------- + sprkStep_SetOrder: + + Specifies the method order + ---------------------------------------------------------------*/ +int sprkStep_SetOrder(ARKodeMem ark_mem, int ord) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; int retval = 0; - /* access ARKodeMem and ARKodeSPRKStepMem structures */ - retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, - &step_mem); + /* access ARKodeSPRKStepMem structure */ + retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - *sprk_storage = step_mem->method; + /* Invalid orders result in the default order being used. */ + if (ord == 7 || ord == 9 || ord > 10) { ord = -1; } + + /* set user-provided value, or default, depending on argument */ + if (ord <= 0) { step_mem->q = 4; } + else { step_mem->q = ord; } + + if (step_mem->method) + { + ARKodeSPRKTable_Free(step_mem->method); + step_mem->method = NULL; + } return (ARK_SUCCESS); } @@ -427,10 +257,6 @@ int sprkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt return (ARK_SUCCESS); } -/*=============================================================== - SPRKStep parameter output - ===============================================================*/ - /*--------------------------------------------------------------- sprkStep_WriteParameters: @@ -453,6 +279,170 @@ int sprkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) return (ARK_SUCCESS); } -/*--------------------------------------------------------------- +/*=============================================================== + Exported-but-deprecated user-callable functions. + ===============================================================*/ + +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR) +{ + return (ARKodeReset(arkode_mem, tR, yR)); +} + +int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g) +{ + return (ARKodeRootInit(arkode_mem, nrtfn, g)); +} + +int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir) +{ + return (ARKodeSetRootDirection(arkode_mem, rootdir)); +} + +int SPRKStepSetNoInactiveRootWarn(void* arkode_mem) +{ + return (ARKodeSetNoInactiveRootWarn(arkode_mem)); +} + +int SPRKStepSetDefaults(void* arkode_mem) +{ + return (ARKodeSetDefaults(arkode_mem)); +} + +int SPRKStepSetOrder(void* arkode_mem, int ord) +{ + return (ARKodeSetOrder(arkode_mem, ord)); +} + +int SPRKStepSetInterpolantType(void* arkode_mem, int itype) +{ + return (ARKodeSetInterpolantType(arkode_mem, itype)); +} + +int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) +{ + return (ARKodeSetInterpolantDegree(arkode_mem, degree)); +} + +int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps) +{ + return (ARKodeSetMaxNumSteps(arkode_mem, mxsteps)); +} + +int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop) +{ + return (ARKodeSetStopTime(arkode_mem, tstop)); +} + +int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed) +{ + return (ARKodeSetFixedStep(arkode_mem, hfixed)); +} + +int SPRKStepSetUserData(void* arkode_mem, void* user_data) +{ + return (ARKodeSetUserData(arkode_mem, user_data)); +} + +int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep) +{ + return (ARKodeSetPostprocessStepFn(arkode_mem, ProcessStep)); +} + +int SPRKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage) +{ + return (ARKodeSetPostprocessStageFn(arkode_mem, ProcessStage)); +} + +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask) +{ + return (ARKodeEvolve(arkode_mem, tout, yout, tret, itask)); +} + +int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky) +{ + return (ARKodeGetDky(arkode_mem, t, k, dky)); +} + +char* SPRKStepGetReturnFlagName(long int flag) +{ + return (ARKodeGetReturnFlagName(flag)); +} + +int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state) +{ + return (ARKodeGetCurrentState(arkode_mem, state)); +} + +int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur) +{ + return (ARKodeGetCurrentStep(arkode_mem, hcur)); +} + +int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur) +{ + return (ARKodeGetCurrentTime(arkode_mem, tcur)); +} + +int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast) +{ + return (ARKodeGetLastStep(arkode_mem, hlast)); +} + +int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* nstep_attempts) +{ + return (ARKodeGetNumStepAttempts(arkode_mem, nstep_attempts)); +} + +int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps) +{ + return (ARKodeGetNumSteps(arkode_mem, nsteps)); +} + +int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound) +{ + return (ARKodeGetRootInfo(arkode_mem, rootsfound)); +} + +int SPRKStepGetUserData(void* arkode_mem, void** user_data) +{ + return (ARKodeGetUserData(arkode_mem, user_data)); +} + +int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) +{ + return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); +} + +void SPRKStepPrintMem(void* arkode_mem, FILE* outfile) +{ + ARKodePrintMem(arkode_mem, outfile); +} + +int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) +{ + return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); +} + +int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) +{ + return (ARKodeWriteParameters(arkode_mem, fp)); +} + +int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur) +{ + return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); +} + +int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) +{ + return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); +} + +void SPRKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } + +/*=============================================================== EOF - ---------------------------------------------------------------*/ + ===============================================================*/ diff --git a/src/arkode/arkode_user_controller.c b/src/arkode/arkode_user_controller.c index b8cfeb3655..29167a38cb 100644 --- a/src/arkode/arkode_user_controller.c +++ b/src/arkode/arkode_user_controller.c @@ -39,7 +39,7 @@ /* ----------------------------------------------------------------- * Function to create a new ARKUserControl controller - */ + * ----------------------------------------------------------------- */ SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, ARKAdaptFn hadapt, void* hadapt_data) diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod/farkode_arkstep_mod.c index 8da0515350..4791bedcdc 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.c +++ b/src/arkode/fmod/farkode_arkstep_mod.c @@ -253,43 +253,203 @@ SWIGEXPORT void * _wrap_FARKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co } -SWIGEXPORT int _wrap_FARKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { +SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; - sunrealtype arg3 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + ARKRhsFn arg3 = (ARKRhsFn) 0 ; sunrealtype arg4 ; - ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; - void *arg6 = (void *) 0 ; + N_Vector arg5 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - arg3 = (sunrealtype)(*farg3); + arg2 = (ARKRhsFn)(farg2); + arg3 = (ARKRhsFn)(farg3); arg4 = (sunrealtype)(*farg4); - arg5 = (ARKVecResizeFn)(farg5); - arg6 = (void *)(farg6); - result = (int)ARKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); + arg5 = (N_Vector)(farg5); + result = (int)ARKStepReInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { +SWIGEXPORT int _wrap_FARKStepSetExplicit(void *farg1) { int fresult ; void *arg1 = (void *) 0 ; - ARKRhsFn arg2 = (ARKRhsFn) 0 ; - ARKRhsFn arg3 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetExplicit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetImplicit(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetImplicit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetImEx(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetImEx(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTables(void *farg1, int const *farg2, int const *farg3, void *farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + ARKodeButcherTable arg4 = (ARKodeButcherTable) 0 ; + ARKodeButcherTable arg5 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (ARKodeButcherTable)(farg4); + arg5 = (ARKodeButcherTable)(farg5); + result = (int)ARKStepSetTables(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTableNum(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_DIRKTableID arg2 ; + ARKODE_ERKTableID arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_DIRKTableID)(*farg2); + arg3 = (ARKODE_ERKTableID)(*farg3); + result = (int)ARKStepSetTableNum(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + arg3 = (char *)(farg3->data); + result = (int)ARKStepSetTableName(arg1,(char const *)arg2,(char const *)arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentButcherTables(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; + ARKodeButcherTable *arg3 = (ARKodeButcherTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable *)(farg2); + arg3 = (ARKodeButcherTable *)(farg3); + result = (int)ARKStepGetCurrentButcherTables(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6, long *farg7, long *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + long *arg7 = (long *) 0 ; + long *arg8 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + arg7 = (long *)(farg7); + arg8 = (long *)(farg8); + result = (int)ARKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepCreateMRIStepInnerStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)ARKStepCreateMRIStepInnerStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; sunrealtype arg4 ; - N_Vector arg5 = (N_Vector) 0 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKRhsFn)(farg2); - arg3 = (ARKRhsFn)(farg3); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); arg4 = (sunrealtype)(*farg4); - arg5 = (N_Vector)(farg5); - result = (int)ARKStepReInit(arg1,arg2,arg3,arg4,arg5); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ARKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; } @@ -583,42 +743,6 @@ SWIGEXPORT int _wrap_FARKStepSetNonlinear(void *farg1) { } -SWIGEXPORT int _wrap_FARKStepSetExplicit(void *farg1) { - int fresult ; - void *arg1 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - result = (int)ARKStepSetExplicit(arg1); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKStepSetImplicit(void *farg1) { - int fresult ; - void *arg1 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - result = (int)ARKStepSetImplicit(arg1); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKStepSetImEx(void *farg1) { - int fresult ; - void *arg1 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - result = (int)ARKStepSetImEx(arg1); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetDeduceImplicitRhs(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -633,58 +757,6 @@ SWIGEXPORT int _wrap_FARKStepSetDeduceImplicitRhs(void *farg1, int const *farg2) } -SWIGEXPORT int _wrap_FARKStepSetTables(void *farg1, int const *farg2, int const *farg3, void *farg4, void *farg5) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int arg3 ; - ARKodeButcherTable arg4 = (ARKodeButcherTable) 0 ; - ARKodeButcherTable arg5 = (ARKodeButcherTable) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - arg3 = (int)(*farg3); - arg4 = (ARKodeButcherTable)(farg4); - arg5 = (ARKodeButcherTable)(farg5); - result = (int)ARKStepSetTables(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKStepSetTableNum(void *farg1, int const *farg2, int const *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKODE_DIRKTableID arg2 ; - ARKODE_ERKTableID arg3 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKODE_DIRKTableID)(*farg2); - arg3 = (ARKODE_ERKTableID)(*farg3); - result = (int)ARKStepSetTableNum(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (char *)(farg2->data); - arg3 = (char *)(farg3->data); - result = (int)ARKStepSetTableName(arg1,(char const *)arg2,(char const *)arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetAdaptController(void *farg1, SUNAdaptController farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1569,22 +1641,6 @@ SWIGEXPORT int _wrap_FARKStepGetNumStepAttempts(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepGetNumLinSolvSetups(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1613,22 +1669,6 @@ SWIGEXPORT int _wrap_FARKStepGetNumErrTestFails(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FARKStepGetCurrentButcherTables(void *farg1, void *farg2, void *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; - ARKodeButcherTable *arg3 = (ARKodeButcherTable *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKodeButcherTable *)(farg2); - arg3 = (ARKodeButcherTable *)(farg3); - result = (int)ARKStepGetCurrentButcherTables(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepGetEstLocalErrors(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1926,32 +1966,6 @@ SWIGEXPORT int _wrap_FARKStepWriteButcher(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6, long *farg7, long *farg8) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - long *arg6 = (long *) 0 ; - long *arg7 = (long *) 0 ; - long *arg8 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - arg4 = (long *)(farg4); - arg5 = (long *)(farg5); - arg6 = (long *)(farg6); - arg7 = (long *)(farg7); - arg8 = (long *)(farg8); - result = (int)ARKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { int fresult ; void *arg1 = (void *) 0 ; @@ -2429,20 +2443,6 @@ SWIGEXPORT void _wrap_FARKStepPrintMem(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepCreateMRIStepInnerStepper(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (MRIStepInnerStepper *)(farg2); - result = (int)ARKStepCreateMRIStepInnerStepper(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { 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 6d065d9f19..165149355b 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -47,8 +47,22 @@ module farkode_arkstep_mod integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_4 = ARKODE_ARK436L2SA_DIRK_6_3_4 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5 public :: FARKStepCreate - public :: FARKStepResize public :: FARKStepReInit + public :: FARKStepSetExplicit + public :: FARKStepSetImplicit + public :: FARKStepSetImEx + public :: FARKStepSetTables + public :: FARKStepSetTableNum + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FARKStepSetTableName + public :: FARKStepGetNumRhsEvals + public :: FARKStepGetCurrentButcherTables + public :: FARKStepGetTimestepperStats + public :: FARKStepCreateMRIStepInnerStepper + public :: FARKStepResize public :: FARKStepReset public :: FARKStepSStolerances public :: FARKStepSVtolerances @@ -69,17 +83,7 @@ module farkode_arkstep_mod public :: FARKStepSetNlsRhsFn public :: FARKStepSetLinear public :: FARKStepSetNonlinear - public :: FARKStepSetExplicit - public :: FARKStepSetImplicit - public :: FARKStepSetImEx public :: FARKStepSetDeduceImplicitRhs - public :: FARKStepSetTables - public :: FARKStepSetTableNum - type, bind(C) :: SwigArrayWrapper - type(C_PTR), public :: data = C_NULL_PTR - integer(C_SIZE_T), public :: size = 0 - end type - public :: FARKStepSetTableName public :: FARKStepSetAdaptController public :: FARKStepSetAdaptivityAdjustment public :: FARKStepSetCFLFraction @@ -141,10 +145,8 @@ module farkode_arkstep_mod public :: FARKStepGetNumExpSteps public :: FARKStepGetNumAccSteps public :: FARKStepGetNumStepAttempts - public :: FARKStepGetNumRhsEvals public :: FARKStepGetNumLinSolvSetups public :: FARKStepGetNumErrTestFails - public :: FARKStepGetCurrentButcherTables public :: FARKStepGetEstLocalErrors public :: FARKStepGetWorkSpace public :: FARKStepGetNumSteps @@ -166,7 +168,6 @@ module farkode_arkstep_mod public :: FARKStepGetReturnFlagName public :: FARKStepWriteParameters public :: FARKStepWriteButcher - public :: FARKStepGetTimestepperStats public :: FARKStepGetStepStats public :: FARKStepGetNonlinearSystemData public :: FARKStepGetNumNonlinSolvIters @@ -200,7 +201,6 @@ module farkode_arkstep_mod public :: FARKStepGetLinReturnFlagName public :: FARKStepFree public :: FARKStepPrintMem - public :: FARKStepCreateMRIStepInnerStepper public :: FARKStepSetRelaxFn public :: FARKStepSetRelaxEtaFail public :: FARKStepSetRelaxLowerBound @@ -231,28 +231,129 @@ function swigc_FARKStepCreate(farg1, farg2, farg3, farg4, farg5) & type(C_PTR) :: fresult end function -function swigc_FARKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & -bind(C, name="_wrap_FARKStepResize") & +function swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepReInit") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -real(C_DOUBLE), intent(in) :: farg3 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 real(C_DOUBLE), intent(in) :: farg4 -type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetExplicit(farg1) & +bind(C, name="_wrap_FARKStepSetExplicit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetImplicit(farg1) & +bind(C, name="_wrap_FARKStepSetImplicit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetImEx(farg1) & +bind(C, name="_wrap_FARKStepSetImEx") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepSetTables") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTableNum(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetTableNum") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTableName(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetTableName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetNumRhsEvals") & +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_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetCurrentButcherTables") & +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_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FARKStepGetTimestepperStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 integer(C_INT) :: fresult end function -function swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FARKStepReInit") & +function swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) & +bind(C, name="_wrap_FARKStepCreateMRIStepInnerStepper") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKStepResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 real(C_DOUBLE), intent(in) :: farg4 -type(C_PTR), value :: farg5 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function @@ -440,30 +541,6 @@ function swigc_FARKStepSetNonlinear(farg1) & integer(C_INT) :: fresult end function -function swigc_FARKStepSetExplicit(farg1) & -bind(C, name="_wrap_FARKStepSetExplicit") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT) :: fresult -end function - -function swigc_FARKStepSetImplicit(farg1) & -bind(C, name="_wrap_FARKStepSetImplicit") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT) :: fresult -end function - -function swigc_FARKStepSetImEx(farg1) & -bind(C, name="_wrap_FARKStepSetImEx") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetDeduceImplicitRhs(farg1, farg2) & bind(C, name="_wrap_FARKStepSetDeduceImplicitRhs") & result(fresult) @@ -473,39 +550,6 @@ function swigc_FARKStepSetDeduceImplicitRhs(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FARKStepSetTables") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT), intent(in) :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -integer(C_INT) :: fresult -end function - -function swigc_FARKStepSetTableNum(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepSetTableNum") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT), intent(in) :: farg3 -integer(C_INT) :: fresult -end function - -function swigc_FARKStepSetTableName(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepSetTableName") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -type(C_PTR), value :: farg1 -type(SwigArrayWrapper) :: farg2 -type(SwigArrayWrapper) :: farg3 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetAdaptController(farg1, farg2) & bind(C, name="_wrap_FARKStepSetAdaptController") & result(fresult) @@ -1070,16 +1114,6 @@ function swigc_FARKStepGetNumStepAttempts(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepGetNumRhsEvals") & -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_FARKStepGetNumLinSolvSetups(farg1, farg2) & bind(C, name="_wrap_FARKStepGetNumLinSolvSetups") & result(fresult) @@ -1098,16 +1132,6 @@ function swigc_FARKStepGetNumErrTestFails(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepGetCurrentButcherTables") & -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_FARKStepGetEstLocalErrors(farg1, farg2) & bind(C, name="_wrap_FARKStepGetEstLocalErrors") & result(fresult) @@ -1304,21 +1328,6 @@ function swigc_FARKStepWriteButcher(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & -bind(C, name="_wrap_FARKStepGetTimestepperStats") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -type(C_PTR), value :: farg8 -integer(C_INT) :: fresult -end function - function swigc_FARKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & bind(C, name="_wrap_FARKStepGetStepStats") & result(fresult) @@ -1624,15 +1633,6 @@ subroutine swigc_FARKStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine -function swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) & -bind(C, name="_wrap_FARKStepCreateMRIStepInnerStepper") & -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_FARKStepSetRelaxFn(farg1, farg2, farg3) & bind(C, name="_wrap_FARKStepSetRelaxFn") & result(fresult) @@ -1791,12 +1791,248 @@ function FARKStepCreate(fe, fi, t0, y0, sunctx) & type(C_PTR) :: farg4 type(C_PTR) :: farg5 -farg1 = fe -farg2 = fi -farg3 = t0 -farg4 = c_loc(y0) -farg5 = sunctx -fresult = swigc_FARKStepCreate(farg1, farg2, farg3, farg4, farg5) +farg1 = fe +farg2 = fi +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FARKStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepReInit(arkode_mem, fe, fi, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: fe +type(C_FUNPTR), intent(in), value :: fi +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = fe +farg3 = fi +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepSetExplicit(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetExplicit(farg1) +swig_result = fresult +end function + +function FARKStepSetImplicit(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetImplicit(farg1) +swig_result = fresult +end function + +function FARKStepSetImEx(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetImEx(farg1) +swig_result = fresult +end function + +function FARKStepSetTables(arkode_mem, q, p, bi, be) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: q +integer(C_INT), intent(in) :: p +type(C_PTR) :: bi +type(C_PTR) :: be +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = q +farg3 = p +farg4 = bi +farg5 = be +fresult = swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepSetTableNum(arkode_mem, itable, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_DIRKTableID), intent(in) :: itable +integer(ARKODE_ERKTableID), intent(in) :: etable +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = itable +farg3 = etable +fresult = swigc_FARKStepSetTableNum(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FARKStepSetTableName(arkode_mem, itable, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: itable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +character(kind=C_CHAR, len=*), target :: etable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 + +farg1 = arkode_mem +call SWIG_string_to_chararray(itable, farg2_chars, farg2) +call SWIG_string_to_chararray(etable, farg3_chars, farg3) +fresult = swigc_FARKStepSetTableName(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfe_evals(1)) +farg3 = c_loc(nfi_evals(1)) +fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetCurrentButcherTables(arkode_mem, bi, be) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: bi +type(C_PTR), target, intent(inout) :: be +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(bi) +farg3 = c_loc(be) +fresult = swigc_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, & + netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +farg3 = c_loc(accsteps(1)) +farg4 = c_loc(step_attempts(1)) +farg5 = c_loc(nfe_evals(1)) +farg6 = c_loc(nfi_evals(1)) +farg7 = c_loc(nlinsetups(1)) +farg8 = c_loc(netfails(1)) +fresult = swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FARKStepCreateMRIStepInnerStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) swig_result = fresult end function @@ -1828,31 +2064,6 @@ function FARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & swig_result = fresult end function -function FARKStepReInit(arkode_mem, fe, fi, t0, y0) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: fe -type(C_FUNPTR), intent(in), value :: fi -real(C_DOUBLE), intent(in) :: t0 -type(N_Vector), target, intent(inout) :: y0 -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_FUNPTR) :: farg3 -real(C_DOUBLE) :: farg4 -type(C_PTR) :: farg5 - -farg1 = arkode_mem -farg2 = fe -farg3 = fi -farg4 = t0 -farg5 = c_loc(y0) -fresult = swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - function FARKStepReset(arkode_mem, tr, yr) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2185,45 +2396,6 @@ function FARKStepSetNonlinear(arkode_mem) & swig_result = fresult end function -function FARKStepSetExplicit(arkode_mem) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT) :: fresult -type(C_PTR) :: farg1 - -farg1 = arkode_mem -fresult = swigc_FARKStepSetExplicit(farg1) -swig_result = fresult -end function - -function FARKStepSetImplicit(arkode_mem) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT) :: fresult -type(C_PTR) :: farg1 - -farg1 = arkode_mem -fresult = swigc_FARKStepSetImplicit(farg1) -swig_result = fresult -end function - -function FARKStepSetImEx(arkode_mem) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT) :: fresult -type(C_PTR) :: farg1 - -farg1 = arkode_mem -fresult = swigc_FARKStepSetImEx(farg1) -swig_result = fresult -end function - function FARKStepSetDeduceImplicitRhs(arkode_mem, deduce) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2240,89 +2412,6 @@ function FARKStepSetDeduceImplicitRhs(arkode_mem, deduce) & swig_result = fresult end function -function FARKStepSetTables(arkode_mem, q, p, bi, be) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: q -integer(C_INT), intent(in) :: p -type(C_PTR) :: bi -type(C_PTR) :: be -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 -integer(C_INT) :: farg3 -type(C_PTR) :: farg4 -type(C_PTR) :: farg5 - -farg1 = arkode_mem -farg2 = q -farg3 = p -farg4 = bi -farg5 = be -fresult = swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - -function FARKStepSetTableNum(arkode_mem, itable, etable) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(ARKODE_DIRKTableID), intent(in) :: itable -integer(ARKODE_ERKTableID), intent(in) :: etable -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 -integer(C_INT) :: farg3 - -farg1 = arkode_mem -farg2 = itable -farg3 = etable -fresult = swigc_FARKStepSetTableNum(farg1, farg2, farg3) -swig_result = fresult -end function - - -subroutine SWIG_string_to_chararray(string, chars, wrap) - use, intrinsic :: ISO_C_BINDING - character(kind=C_CHAR, len=*), intent(IN) :: string - character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars - type(SwigArrayWrapper), intent(OUT) :: wrap - integer :: i - - allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) - do i=1,len(string) - chars(i) = string(i:i) - end do - i = len(string) + 1 - chars(i) = C_NULL_CHAR ! C string compatibility - wrap%data = c_loc(chars) - wrap%size = len(string) -end subroutine - -function FARKStepSetTableName(arkode_mem, itable, etable) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -character(kind=C_CHAR, len=*), target :: itable -character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars -character(kind=C_CHAR, len=*), target :: etable -character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(SwigArrayWrapper) :: farg2 -type(SwigArrayWrapper) :: farg3 - -farg1 = arkode_mem -call SWIG_string_to_chararray(itable, farg2_chars, farg2) -call SWIG_string_to_chararray(etable, farg3_chars, farg3) -fresult = swigc_FARKStepSetTableName(farg1, farg2, farg3) -swig_result = fresult -end function - function FARKStepSetAdaptController(arkode_mem, c) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3344,25 +3433,6 @@ function FARKStepGetNumStepAttempts(arkode_mem, step_attempts) & swig_result = fresult end function -function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfe_evals(1)) -farg3 = c_loc(nfi_evals(1)) -fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3395,25 +3465,6 @@ function FARKStepGetNumErrTestFails(arkode_mem, netfails) & swig_result = fresult end function -function FARKStepGetCurrentButcherTables(arkode_mem, bi, be) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: bi -type(C_PTR), target, intent(inout) :: be -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(bi) -farg3 = c_loc(be) -fresult = swigc_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) -swig_result = fresult -end function - function FARKStepGetEstLocalErrors(arkode_mem, ele) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3768,41 +3819,6 @@ function FARKStepWriteButcher(arkode_mem, fp) & swig_result = fresult end function -function FARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, & - netfails) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: expsteps -integer(C_LONG), dimension(*), target, intent(inout) :: accsteps -integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts -integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups -integer(C_LONG), dimension(*), target, intent(inout) :: netfails -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 -type(C_PTR) :: farg8 - -farg1 = arkode_mem -farg2 = c_loc(expsteps(1)) -farg3 = c_loc(accsteps(1)) -farg4 = c_loc(step_attempts(1)) -farg5 = c_loc(nfe_evals(1)) -farg6 = c_loc(nfi_evals(1)) -farg7 = c_loc(nlinsetups(1)) -farg8 = c_loc(netfails(1)) -fresult = swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) -swig_result = fresult -end function - function FARKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4357,22 +4373,6 @@ subroutine FARKStepPrintMem(arkode_mem, outfile) call swigc_FARKStepPrintMem(farg1, farg2) end subroutine -function FARKStepCreateMRIStepInnerStepper(arkode_mem, stepper) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: stepper -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(stepper) -fresult = swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) -swig_result = fresult -end function - function FARKStepSetRelaxFn(arkode_mem, rfn, rjac) & 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 fab7db1d84..5def57befc 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.c +++ b/src/arkode/fmod/farkode_erkstep_mod.c @@ -251,41 +251,133 @@ SWIGEXPORT void * _wrap_FERKStepCreate(ARKRhsFn farg1, double const *farg2, N_Ve } -SWIGEXPORT int _wrap_FERKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { +SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; sunrealtype arg3 ; - sunrealtype arg4 ; - ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; - void *arg6 = (void *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); + arg2 = (ARKRhsFn)(farg2); arg3 = (sunrealtype)(*farg3); - arg4 = (sunrealtype)(*farg4); - arg5 = (ARKVecResizeFn)(farg5); - arg6 = (void *)(farg6); - result = (int)ERKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); + arg4 = (N_Vector)(farg4); + result = (int)ERKStepReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { +SWIGEXPORT int _wrap_FERKStepSetTable(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - ARKRhsFn arg2 = (ARKRhsFn) 0 ; + ARKodeButcherTable arg2 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable)(farg2); + result = (int)ERKStepSetTable(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetTableNum(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_ERKTableID arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_ERKTableID)(*farg2); + result = (int)ERKStepSetTableNum(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)ERKStepSetTableName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetCurrentButcherTable(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable *)(farg2); + result = (int)ERKStepGetCurrentButcherTable(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + result = (int)ERKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; sunrealtype arg3 ; - N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg4 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKRhsFn)(farg2); + arg2 = (N_Vector)(farg2); arg3 = (sunrealtype)(*farg3); - arg4 = (N_Vector)(farg4); - result = (int)ERKStepReInit(arg1,arg2,arg3,arg4); + arg4 = (sunrealtype)(*farg4); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ERKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; } @@ -437,48 +529,6 @@ SWIGEXPORT int _wrap_FERKStepSetDenseOrder(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FERKStepSetTable(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKodeButcherTable arg2 = (ARKodeButcherTable) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKodeButcherTable)(farg2); - result = (int)ERKStepSetTable(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FERKStepSetTableNum(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKODE_ERKTableID arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKODE_ERKTableID)(*farg2); - result = (int)ERKStepSetTableNum(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - char *arg2 = (char *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (char *)(farg2->data); - result = (int)ERKStepSetTableName(arg1,(char const *)arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepSetAdaptController(void *farg1, SUNAdaptController farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1015,34 +1065,6 @@ SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ERKStepGetNumRhsEvals(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FERKStepGetCurrentButcherTable(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKodeButcherTable *)(farg2); - result = (int)ERKStepGetCurrentButcherTable(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepGetEstLocalErrors(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1284,28 +1306,6 @@ SWIGEXPORT int _wrap_FERKStepWriteButcher(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FERKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - long *arg4 = (long *) 0 ; - long *arg5 = (long *) 0 ; - long *arg6 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - arg4 = (long *)(farg4); - arg5 = (long *)(farg5); - arg6 = (long *)(farg6); - result = (int)ERKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { 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 e75d960ae4..797d0ca9ff 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -35,8 +35,18 @@ module farkode_erkstep_mod 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 + public :: FERKStepSetTable + public :: FERKStepSetTableNum + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FERKStepSetTableName + public :: FERKStepGetNumRhsEvals + public :: FERKStepGetCurrentButcherTable + public :: FERKStepGetTimestepperStats + public :: FERKStepResize public :: FERKStepReset public :: FERKStepSStolerances public :: FERKStepSVtolerances @@ -47,13 +57,6 @@ module farkode_erkstep_mod public :: FERKStepSetInterpolantType public :: FERKStepSetInterpolantDegree public :: FERKStepSetDenseOrder - public :: FERKStepSetTable - public :: FERKStepSetTableNum - type, bind(C) :: SwigArrayWrapper - type(C_PTR), public :: data = C_NULL_PTR - integer(C_SIZE_T), public :: size = 0 - end type - public :: FERKStepSetTableName public :: FERKStepSetAdaptController public :: FERKStepSetAdaptivityAdjustment public :: FERKStepSetCFLFraction @@ -91,8 +94,6 @@ module farkode_erkstep_mod public :: FERKStepGetNumAccSteps public :: FERKStepGetNumStepAttempts public :: FERKStepGetNumErrTestFails - public :: FERKStepGetNumRhsEvals - public :: FERKStepGetCurrentButcherTable public :: FERKStepGetEstLocalErrors public :: FERKStepGetWorkSpace public :: FERKStepGetNumSteps @@ -110,7 +111,6 @@ module farkode_erkstep_mod public :: FERKStepGetReturnFlagName public :: FERKStepWriteParameters public :: FERKStepWriteButcher - public :: FERKStepGetTimestepperStats public :: FERKStepGetStepStats public :: FERKStepFree public :: FERKStepPrintMem @@ -143,27 +143,86 @@ function swigc_FERKStepCreate(farg1, farg2, farg3, farg4) & type(C_PTR) :: fresult end function -function swigc_FERKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & -bind(C, name="_wrap_FERKStepResize") & +function swigc_FERKStepReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FERKStepReInit") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg2 real(C_DOUBLE), intent(in) :: farg3 -real(C_DOUBLE), intent(in) :: farg4 -type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetTable(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTable") & +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_FERKStepSetTableNum(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTableNum") & +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_FERKStepSetTableName(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTableName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRhsEvals") & +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_FERKStepGetCurrentButcherTable(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetCurrentButcherTable") & +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_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FERKStepGetTimestepperStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function -function swigc_FERKStepReInit(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FERKStepReInit") & +function swigc_FERKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FERKStepResize") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 +type(C_PTR), value :: farg2 real(C_DOUBLE), intent(in) :: farg3 -type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function @@ -260,34 +319,6 @@ function swigc_FERKStepSetDenseOrder(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepSetTable(farg1, farg2) & -bind(C, name="_wrap_FERKStepSetTable") & -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_FERKStepSetTableNum(farg1, farg2) & -bind(C, name="_wrap_FERKStepSetTableNum") & -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_FERKStepSetTableName(farg1, farg2) & -bind(C, name="_wrap_FERKStepSetTableName") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -type(C_PTR), value :: farg1 -type(SwigArrayWrapper) :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FERKStepSetAdaptController(farg1, farg2) & bind(C, name="_wrap_FERKStepSetAdaptController") & result(fresult) @@ -630,24 +661,6 @@ function swigc_FERKStepGetNumErrTestFails(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetNumRhsEvals") & -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_FERKStepGetCurrentButcherTable(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetCurrentButcherTable") & -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_FERKStepGetEstLocalErrors(farg1, farg2) & bind(C, name="_wrap_FERKStepGetEstLocalErrors") & result(fresult) @@ -808,19 +821,6 @@ function swigc_FERKStepWriteButcher(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) & -bind(C, name="_wrap_FERKStepGetTimestepperStats") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -integer(C_INT) :: fresult -end function - function swigc_FERKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & bind(C, name="_wrap_FERKStepGetStepStats") & result(fresult) @@ -1011,6 +1011,155 @@ function FERKStepCreate(f, t0, y0, sunctx) & swig_result = fresult end function +function FERKStepReInit(arkode_mem, f, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: f +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = f +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FERKStepReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FERKStepSetTable(arkode_mem, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = b +fresult = swigc_FERKStepSetTable(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetTableNum(arkode_mem, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_ERKTableID), intent(in) :: etable +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = etable +fresult = swigc_FERKStepSetTableNum(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FERKStepSetTableName(arkode_mem, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: etable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(etable, farg2_chars, farg2) +fresult = swigc_FERKStepSetTableName(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetCurrentButcherTable(arkode_mem, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(b) +fresult = swigc_FERKStepGetCurrentButcherTable(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +farg3 = c_loc(accsteps(1)) +farg4 = c_loc(step_attempts(1)) +farg5 = c_loc(nfevals(1)) +farg6 = c_loc(netfails(1)) +fresult = swigc_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + function FERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1039,28 +1188,6 @@ function FERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & swig_result = fresult end function -function FERKStepReInit(arkode_mem, f, t0, y0) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: f -real(C_DOUBLE), intent(in) :: t0 -type(N_Vector), target, intent(inout) :: y0 -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -real(C_DOUBLE) :: farg3 -type(C_PTR) :: farg4 - -farg1 = arkode_mem -farg2 = f -farg3 = t0 -farg4 = c_loc(y0) -fresult = swigc_FERKStepReInit(farg1, farg2, farg3, farg4) -swig_result = fresult -end function - function FERKStepReset(arkode_mem, tr, yr) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1230,73 +1357,6 @@ function FERKStepSetDenseOrder(arkode_mem, dord) & swig_result = fresult end function -function FERKStepSetTable(arkode_mem, b) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: b -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = b -fresult = swigc_FERKStepSetTable(farg1, farg2) -swig_result = fresult -end function - -function FERKStepSetTableNum(arkode_mem, etable) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(ARKODE_ERKTableID), intent(in) :: etable -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = arkode_mem -farg2 = etable -fresult = swigc_FERKStepSetTableNum(farg1, farg2) -swig_result = fresult -end function - - -subroutine SWIG_string_to_chararray(string, chars, wrap) - use, intrinsic :: ISO_C_BINDING - character(kind=C_CHAR, len=*), intent(IN) :: string - character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars - type(SwigArrayWrapper), intent(OUT) :: wrap - integer :: i - - allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) - do i=1,len(string) - chars(i) = string(i:i) - end do - i = len(string) + 1 - chars(i) = C_NULL_CHAR ! C string compatibility - wrap%data = c_loc(chars) - wrap%size = len(string) -end subroutine - -function FERKStepSetTableName(arkode_mem, etable) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -character(kind=C_CHAR, len=*), target :: etable -character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(SwigArrayWrapper) :: farg2 - -farg1 = arkode_mem -call SWIG_string_to_chararray(etable, farg2_chars, farg2) -fresult = swigc_FERKStepSetTableName(farg1, farg2) -swig_result = fresult -end function - function FERKStepSetAdaptController(arkode_mem, c) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1916,38 +1976,6 @@ function FERKStepGetNumErrTestFails(arkode_mem, netfails) & swig_result = fresult end function -function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfevals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(nfevals(1)) -fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) -swig_result = fresult -end function - -function FERKStepGetCurrentButcherTable(arkode_mem, b) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: b -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(b) -fresult = swigc_FERKStepGetCurrentButcherTable(farg1, farg2) -swig_result = fresult -end function - function FERKStepGetEstLocalErrors(arkode_mem, ele) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2238,34 +2266,6 @@ function FERKStepWriteButcher(arkode_mem, fp) & swig_result = fresult end function -function FERKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: expsteps -integer(C_LONG), dimension(*), target, intent(inout) :: accsteps -integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts -integer(C_LONG), dimension(*), target, intent(inout) :: nfevals -integer(C_LONG), dimension(*), target, intent(inout) :: netfails -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 - -farg1 = arkode_mem -farg2 = c_loc(expsteps(1)) -farg3 = c_loc(accsteps(1)) -farg4 = c_loc(step_attempts(1)) -farg5 = c_loc(nfevals(1)) -farg6 = c_loc(netfails(1)) -fresult = swigc_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) -swig_result = fresult -end function - function FERKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index 1d9bf58f1f..61db05f83e 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -537,61 +537,21 @@ SWIGEXPORT int _wrap_FARKodeSetInterpolantDegree(void *farg1, int const *farg2) } -SWIGEXPORT int _wrap_FARKodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (SUNNonlinearSolver)(farg2); - result = (int)ARKodeSetNonlinearSolver(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKodeSetLinear(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)ARKodeSetLinear(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKodeSetNonlinear(void *farg1) { - int fresult ; - void *arg1 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - result = (int)ARKodeSetNonlinear(arg1); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKodeSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxNumSteps(void *farg1, long const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - ARKRhsFn arg2 = (ARKRhsFn) 0 ; + long arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKRhsFn)(farg2); - result = (int)ARKodeSetNlsRhsFn(arg1,arg2); + arg2 = (long)(*farg2); + result = (int)ARKodeSetMaxNumSteps(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetDeduceImplicitRhs(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetInterpolateStopTime(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -599,41 +559,39 @@ SWIGEXPORT int _wrap_FARKodeSetDeduceImplicitRhs(void *farg1, int const *farg2) arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)ARKodeSetDeduceImplicitRhs(arg1,arg2); + result = (int)ARKodeSetInterpolateStopTime(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetAdaptController(void *farg1, SUNAdaptController farg2) { +SWIGEXPORT int _wrap_FARKodeSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - SUNAdaptController arg2 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (SUNAdaptController)(farg2); - result = (int)ARKodeSetAdaptController(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetAdaptivityAdjustment(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeClearStopTime(void *farg1) { int fresult ; void *arg1 = (void *) 0 ; - int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)ARKodeSetAdaptivityAdjustment(arg1,arg2); + result = (int)ARKodeClearStopTime(arg1); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetCFLFraction(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -641,113 +599,109 @@ SWIGEXPORT int _wrap_FARKodeSetCFLFraction(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetCFLFraction(arg1,arg2); + result = (int)ARKodeSetFixedStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetErrorBias(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + void *arg2 = (void *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetErrorBias(arg1,arg2); + arg2 = (void *)(farg2); + result = (int)ARKodeSetUserData(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetSafetyFactor(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetSafetyFactor(arg1,arg2); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStepFn(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxGrowth(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMaxGrowth(arg1,arg2); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStageFn(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMinReduction(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMinReduction(arg1,arg2); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)ARKodeSetNonlinearSolver(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { +SWIGEXPORT int _wrap_FARKodeSetLinear(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; - sunrealtype arg3 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - arg3 = (sunrealtype)(*farg3); - result = (int)ARKodeSetFixedStepBounds(arg1,arg2,arg3); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLinear(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxFirstGrowth(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetNonlinear(void *farg1) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMaxFirstGrowth(arg1,arg2); + result = (int)ARKodeSetNonlinear(arg1); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxEFailGrowth(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMaxEFailGrowth(arg1,arg2); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKodeSetNlsRhsFn(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetSmallNumEFails(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetDeduceImplicitRhs(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -755,21 +709,7 @@ SWIGEXPORT int _wrap_FARKodeSetSmallNumEFails(void *farg1, int const *farg2) { arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)ARKodeSetSmallNumEFails(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKodeSetMaxCFailGrowth(void *farg1, double const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - sunrealtype arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMaxCFailGrowth(arg1,arg2); + result = (int)ARKodeSetDeduceImplicitRhs(arg1,arg2); fresult = (int)(result); return fresult; } @@ -845,36 +785,6 @@ SWIGEXPORT int _wrap_FARKodeSetPredictorMethod(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FARKodeSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; - void *arg3 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKExpStabFn)(farg2); - arg3 = (void *)(farg3); - result = (int)ARKodeSetStabilityFn(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FARKodeSetMaxErrTestFails(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)ARKodeSetMaxErrTestFails(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKodeSetMaxNonlinIters(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -917,35 +827,35 @@ SWIGEXPORT int _wrap_FARKodeSetNonlinConvCoef(void *farg1, double const *farg2) } -SWIGEXPORT int _wrap_FARKodeSetConstraints(void *farg1, N_Vector farg2) { +SWIGEXPORT int _wrap_FARKodeSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; + ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - result = (int)ARKodeSetConstraints(arg1,arg2); + arg2 = (ARKStagePredictFn)(farg2); + result = (int)ARKodeSetStagePredictFn(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxNumSteps(void *farg1, long const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetAdaptController(void *farg1, SUNAdaptController farg2) { int fresult ; void *arg1 = (void *) 0 ; - long arg2 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (long)(*farg2); - result = (int)ARKodeSetMaxNumSteps(arg1,arg2); + arg2 = (SUNAdaptController)(farg2); + result = (int)ARKodeSetAdaptController(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxHnilWarns(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetAdaptivityAdjustment(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -953,13 +863,13 @@ SWIGEXPORT int _wrap_FARKodeSetMaxHnilWarns(void *farg1, int const *farg2) { arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)ARKodeSetMaxHnilWarns(arg1,arg2); + result = (int)ARKodeSetAdaptivityAdjustment(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetInitStep(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetCFLFraction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -967,13 +877,13 @@ SWIGEXPORT int _wrap_FARKodeSetInitStep(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetInitStep(arg1,arg2); + result = (int)ARKodeSetCFLFraction(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMinStep(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetErrorBias(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -981,13 +891,13 @@ SWIGEXPORT int _wrap_FARKodeSetMinStep(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMinStep(arg1,arg2); + result = (int)ARKodeSetErrorBias(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxStep(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetSafetyFactor(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -995,27 +905,27 @@ SWIGEXPORT int _wrap_FARKodeSetMaxStep(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetMaxStep(arg1,arg2); + result = (int)ARKodeSetSafetyFactor(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetInterpolateStopTime(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - int arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)ARKodeSetInterpolateStopTime(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxGrowth(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetStopTime(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMinReduction(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -1023,25 +933,29 @@ SWIGEXPORT int _wrap_FARKodeSetStopTime(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetStopTime(arg1,arg2); + result = (int)ARKodeSetMinReduction(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeClearStopTime(void *farg1) { +SWIGEXPORT int _wrap_FARKodeSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; int result; arg1 = (void *)(farg1); - result = (int)ARKodeClearStopTime(arg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSetFixedStepBounds(arg1,arg2,arg3); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxFirstGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; @@ -1049,13 +963,27 @@ SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - result = (int)ARKodeSetFixedStep(arg1,arg2); + result = (int)ARKodeSetMaxFirstGrowth(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxEFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxEFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetSmallNumEFails(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -1063,201 +991,203 @@ SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)ARKodeSetMaxNumConstrFails(arg1,arg2); + result = (int)ARKodeSetSmallNumEFails(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxCFailGrowth(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - void *arg2 = (void *) 0 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (void *)(farg2); - result = (int)ARKodeSetUserData(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxCFailGrowth(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { +SWIGEXPORT int _wrap_FARKodeSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; + void *arg3 = (void *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKPostProcessFn)(farg2); - result = (int)ARKodeSetPostprocessStepFn(arg1,arg2); + arg2 = (ARKExpStabFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ARKodeSetStabilityFn(arg1,arg2,arg3); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxErrTestFails(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKPostProcessFn)(farg2); - result = (int)ARKodeSetPostprocessStageFn(arg1,arg2); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxErrTestFails(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { +SWIGEXPORT int _wrap_FARKodeSetConstraints(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; - ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; + N_Vector arg2 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKStagePredictFn)(farg2); - result = (int)ARKodeSetStagePredictFn(arg1,arg2); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeSetConstraints(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { +SWIGEXPORT int _wrap_FARKodeSetMaxHnilWarns(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; - N_Vector arg3 = (N_Vector) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; - int arg5 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector)(farg3); - arg4 = (sunrealtype *)(farg4); - arg5 = (int)(*farg5); - result = (int)ARKodeEvolve(arg1,arg2,arg3,arg4,arg5); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxHnilWarns(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { +SWIGEXPORT int _wrap_FARKodeSetInitStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - int arg3 ; - N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (int)(*farg3); - arg4 = (N_Vector)(farg4); - result = (int)ARKodeGetDky(arg1,arg2,arg3,arg4); + result = (int)ARKodeSetInitStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { +SWIGEXPORT int _wrap_FARKodeSetMinStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; - N_Vector arg3 = (N_Vector) 0 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - arg3 = (N_Vector)(farg3); - result = (int)ARKodeComputeState(arg1,arg2,arg3); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMinStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumExpSteps(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxStep(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ARKodeGetNumExpSteps(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumAccSteps(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ARKodeGetNumAccSteps(arg1,arg2); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxNumConstrFails(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ARKodeGetNumStepAttempts(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)ARKodeEvolve(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ARKodeGetNumLinSolvSetups(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ARKodeGetDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumErrTestFails(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ARKodeGetNumErrTestFails(arg1,arg2); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeComputeState(arg1,arg2,arg3); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetEstLocalErrors(void *farg1, N_Vector farg2) { +SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; + long *arg2 = (long *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - result = (int)ARKodeGetEstLocalErrors(arg1,arg2); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumStepAttempts(arg1,arg2); fresult = (int)(result); return fresult; } @@ -1293,7 +1223,7 @@ SWIGEXPORT int _wrap_FARKodeGetNumSteps(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FARKodeGetActualInitStep(void *farg1, double *farg2) { +SWIGEXPORT int _wrap_FARKodeGetLastStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; @@ -1301,13 +1231,13 @@ SWIGEXPORT int _wrap_FARKodeGetActualInitStep(void *farg1, double *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetActualInitStep(arg1,arg2); + result = (int)ARKodeGetLastStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetLastStep(void *farg1, double *farg2) { +SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; @@ -1315,125 +1245,140 @@ SWIGEXPORT int _wrap_FARKodeGetLastStep(void *farg1, double *farg2) { arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetLastStep(arg1,arg2); + result = (int)ARKodeGetCurrentStep(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { +SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetCurrentStep(arg1,arg2); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetErrWeights(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetCurrentTime(void *farg1, double *farg2) { +SWIGEXPORT int _wrap_FARKodeGetNumGEvals(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + long *arg2 = (long *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetCurrentTime(arg1,arg2); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumGEvals(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetCurrentState(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FARKodeGetRootInfo(void *farg1, int *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + int *arg2 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - result = (int)ARKodeGetCurrentState(arg1,arg2); + arg2 = (int *)(farg2); + result = (int)ARKodeGetRootInfo(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetCurrentGamma(void *farg1, double *farg2) { +SWIGEXPORT int _wrap_FARKodeGetUserData(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + void **arg2 = (void **) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetCurrentGamma(arg1,arg2); + arg2 = (void **)(farg2); + result = (int)ARKodeGetUserData(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetCurrentMassMatrix(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FARKodePrintAllStats(void *farg1, void *farg2, int const *farg3) { int fresult ; void *arg1 = (void *) 0 ; - SUNMatrix *arg2 = (SUNMatrix *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; int result; arg1 = (void *)(farg1); - arg2 = (SUNMatrix *)(farg2); - result = (int)ARKodeGetCurrentMassMatrix(arg1,arg2); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)ARKodePrintAllStats(arg1,arg2,arg3); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetTolScaleFactor(void *farg1, double *farg2) { +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeWriteParameters(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + FILE *arg2 = (FILE *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - result = (int)ARKodeGetTolScaleFactor(arg1,arg2); + arg2 = (FILE *)(farg2); + result = (int)ARKodeWriteParameters(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { +SWIGEXPORT int _wrap_FARKodeGetNumExpSteps(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; + long *arg2 = (long *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - result = (int)ARKodeGetErrWeights(arg1,arg2); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumExpSteps(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetResWeights(void *farg1, N_Vector farg2) { +SWIGEXPORT int _wrap_FARKodeGetNumAccSteps(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; + long *arg2 = (long *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - result = (int)ARKodeGetResWeights(arg1,arg2); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumAccSteps(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetNumGEvals(void *farg1, long *farg2) { +SWIGEXPORT int _wrap_FARKodeGetNumErrTestFails(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; long *arg2 = (long *) 0 ; @@ -1441,21 +1386,49 @@ SWIGEXPORT int _wrap_FARKodeGetNumGEvals(void *farg1, long *farg2) { arg1 = (void *)(farg1); arg2 = (long *)(farg2); - result = (int)ARKodeGetNumGEvals(arg1,arg2); + result = (int)ARKodeGetNumErrTestFails(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetRootInfo(void *farg1, int *farg2) { +SWIGEXPORT int _wrap_FARKodeGetEstLocalErrors(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; - int *arg2 = (int *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (int *)(farg2); - result = (int)ARKodeGetRootInfo(arg1,arg2); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetTolScaleFactor(arg1,arg2); fresult = (int)(result); return fresult; } @@ -1475,80 +1448,79 @@ SWIGEXPORT int _wrap_FARKodeGetNumConstrFails(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FARKodeGetUserData(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { int fresult ; void *arg1 = (void *) 0 ; - void **arg2 = (void **) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (void **)(farg2); - result = (int)ARKodeGetUserData(arg1,arg2); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)ARKodeGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodePrintAllStats(void *farg1, void *farg2, int const *farg3) { +SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; - SUNOutputFormat arg3 ; + long *arg2 = (long *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - arg3 = (SUNOutputFormat)(*farg3); - result = (int)ARKodePrintAllStats(arg1,arg2,arg3); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinSolvSetups(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetReturnFlagName(long const *farg1) { - SwigArrayWrapper fresult ; - long arg1 ; - char *result = 0 ; +SWIGEXPORT int _wrap_FARKodeGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; - arg1 = (long)(*farg1); - result = (char *)ARKodeGetReturnFlagName(arg1); - fresult.size = strlen((const char*)(result)); - fresult.data = (char *)(result); + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentTime(arg1,arg2); + fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeWriteParameters(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FARKodeGetCurrentState(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - FILE *arg2 = (FILE *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (FILE *)(farg2); - result = (int)ARKodeWriteParameters(arg1,arg2); + arg2 = (N_Vector *)(farg2); + result = (int)ARKodeGetCurrentState(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { +SWIGEXPORT int _wrap_FARKodeGetCurrentGamma(void *farg1, double *farg2) { int fresult ; void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - result = (int)ARKodeGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentGamma(arg1,arg2); fresult = (int)(result); return fresult; } @@ -1822,6 +1794,47 @@ SWIGEXPORT int _wrap_FARKodeGetLastLinFlag(void *farg1, long *farg2) { } +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentMassMatrix(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKodeGetCurrentMassMatrix(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetResWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetResWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetMassWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -1978,19 +1991,6 @@ SWIGEXPORT int _wrap_FARKodeGetLastMassFlag(void *farg1, long *farg2) { } -SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetLinReturnFlagName(long const *farg1) { - SwigArrayWrapper fresult ; - long arg1 ; - char *result = 0 ; - - arg1 = (long)(*farg1); - result = (char *)ARKodeGetLinReturnFlagName(arg1); - fresult.size = strlen((const char*)(result)); - fresult.data = (char *)(result); - return fresult; -} - - SWIGEXPORT void _wrap_FARKodeFree(void *farg1) { void **arg1 = (void **) 0 ; diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 71bfe0e030..beac179931 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -116,11 +116,28 @@ module farkode_mod public :: FARKodeSetOrder public :: FARKodeSetInterpolantType public :: FARKodeSetInterpolantDegree + public :: FARKodeSetMaxNumSteps + public :: FARKodeSetInterpolateStopTime + public :: FARKodeSetStopTime + public :: FARKodeClearStopTime + public :: FARKodeSetFixedStep + public :: FARKodeSetUserData + public :: FARKodeSetPostprocessStepFn + public :: FARKodeSetPostprocessStageFn public :: FARKodeSetNonlinearSolver public :: FARKodeSetLinear public :: FARKodeSetNonlinear public :: FARKodeSetNlsRhsFn public :: FARKodeSetDeduceImplicitRhs + public :: FARKodeSetNonlinCRDown + public :: FARKodeSetNonlinRDiv + public :: FARKodeSetDeltaGammaMax + public :: FARKodeSetLSetupFrequency + public :: FARKodeSetPredictorMethod + public :: FARKodeSetMaxNonlinIters + public :: FARKodeSetMaxConvFails + public :: FARKodeSetNonlinConvCoef + public :: FARKodeSetStagePredictFn public :: FARKodeSetAdaptController public :: FARKodeSetAdaptivityAdjustment public :: FARKodeSetCFLFraction @@ -133,55 +150,25 @@ module farkode_mod public :: FARKodeSetMaxEFailGrowth public :: FARKodeSetSmallNumEFails public :: FARKodeSetMaxCFailGrowth - public :: FARKodeSetNonlinCRDown - public :: FARKodeSetNonlinRDiv - public :: FARKodeSetDeltaGammaMax - public :: FARKodeSetLSetupFrequency - public :: FARKodeSetPredictorMethod public :: FARKodeSetStabilityFn public :: FARKodeSetMaxErrTestFails - public :: FARKodeSetMaxNonlinIters - public :: FARKodeSetMaxConvFails - public :: FARKodeSetNonlinConvCoef public :: FARKodeSetConstraints - public :: FARKodeSetMaxNumSteps public :: FARKodeSetMaxHnilWarns public :: FARKodeSetInitStep public :: FARKodeSetMinStep public :: FARKodeSetMaxStep - public :: FARKodeSetInterpolateStopTime - public :: FARKodeSetStopTime - public :: FARKodeClearStopTime - public :: FARKodeSetFixedStep public :: FARKodeSetMaxNumConstrFails - public :: FARKodeSetUserData - public :: FARKodeSetPostprocessStepFn - public :: FARKodeSetPostprocessStageFn - public :: FARKodeSetStagePredictFn public :: FARKodeEvolve public :: FARKodeGetDky public :: FARKodeComputeState - public :: FARKodeGetNumExpSteps - public :: FARKodeGetNumAccSteps public :: FARKodeGetNumStepAttempts - public :: FARKodeGetNumLinSolvSetups - public :: FARKodeGetNumErrTestFails - public :: FARKodeGetEstLocalErrors public :: FARKodeGetWorkSpace public :: FARKodeGetNumSteps - public :: FARKodeGetActualInitStep public :: FARKodeGetLastStep public :: FARKodeGetCurrentStep - public :: FARKodeGetCurrentTime - public :: FARKodeGetCurrentState - public :: FARKodeGetCurrentGamma - public :: FARKodeGetCurrentMassMatrix - public :: FARKodeGetTolScaleFactor public :: FARKodeGetErrWeights - public :: FARKodeGetResWeights public :: FARKodeGetNumGEvals public :: FARKodeGetRootInfo - public :: FARKodeGetNumConstrFails public :: FARKodeGetUserData public :: FARKodePrintAllStats type, bind(C) :: SwigArrayWrapper @@ -190,7 +177,18 @@ module farkode_mod end type public :: FARKodeGetReturnFlagName public :: FARKodeWriteParameters + public :: FARKodeGetNumExpSteps + public :: FARKodeGetNumAccSteps + public :: FARKodeGetNumErrTestFails + public :: FARKodeGetEstLocalErrors + public :: FARKodeGetActualInitStep + public :: FARKodeGetTolScaleFactor + public :: FARKodeGetNumConstrFails public :: FARKodeGetStepStats + public :: FARKodeGetNumLinSolvSetups + public :: FARKodeGetCurrentTime + public :: FARKodeGetCurrentState + public :: FARKodeGetCurrentGamma public :: FARKodeGetNonlinearSystemData public :: FARKodeGetNumNonlinSolvIters public :: FARKodeGetNumNonlinSolvConvFails @@ -209,6 +207,9 @@ module farkode_mod public :: FARKodeGetNumJtimesEvals public :: FARKodeGetNumLinRhsEvals public :: FARKodeGetLastLinFlag + public :: FARKodeGetLinReturnFlagName + public :: FARKodeGetCurrentMassMatrix + public :: FARKodeGetResWeights public :: FARKodeGetMassWorkSpace public :: FARKodeGetNumMassSetups public :: FARKodeGetNumMassMultSetups @@ -220,7 +221,6 @@ module farkode_mod public :: FARKodeGetNumMassConvFails public :: FARKodeGetNumMTSetups public :: FARKodeGetLastMassFlag - public :: FARKodeGetLinReturnFlagName public :: FARKodeFree public :: FARKodePrintMem public :: FARKodeSetRelaxFn @@ -588,43 +588,17 @@ function swigc_FARKodeSetInterpolantDegree(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetNonlinearSolver(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetNonlinearSolver") & -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_FARKodeSetLinear(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetLinear") & -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_FARKodeSetNonlinear(farg1) & -bind(C, name="_wrap_FARKodeSetNonlinear") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT) :: fresult -end function - -function swigc_FARKodeSetNlsRhsFn(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetNlsRhsFn") & +function swigc_FARKodeSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumSteps") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 +integer(C_LONG), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetDeduceImplicitRhs") & +function swigc_FARKodeSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolateStopTime") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -632,26 +606,25 @@ function swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetAdaptController(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetAdaptController") & +function swigc_FARKodeSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStopTime") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetAdaptivityAdjustment(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetAdaptivityAdjustment") & +function swigc_FARKodeClearStopTime(farg1) & +bind(C, name="_wrap_FARKodeClearStopTime") & 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_FARKodeSetCFLFraction(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetCFLFraction") & +function swigc_FARKodeSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetFixedStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -659,72 +632,70 @@ function swigc_FARKodeSetCFLFraction(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetErrorBias(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetErrorBias") & +function swigc_FARKodeSetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetUserData") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetSafetyFactor(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetSafetyFactor") & +function swigc_FARKodeSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStepFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxGrowth(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxGrowth") & +function swigc_FARKodeSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStageFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetMinReduction(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMinReduction") & +function swigc_FARKodeSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinearSolver") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeSetFixedStepBounds") & +function swigc_FARKodeSetLinear(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinear") & 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), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxFirstGrowth") & +function swigc_FARKodeSetNonlinear(farg1) & +bind(C, name="_wrap_FARKodeSetNonlinear") & 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_FARKodeSetMaxEFailGrowth(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxEFailGrowth") & +function swigc_FARKodeSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNlsRhsFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetSmallNumEFails(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetSmallNumEFails") & +function swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetDeduceImplicitRhs") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -732,15 +703,6 @@ function swigc_FARKodeSetSmallNumEFails(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxCFailGrowth") & -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_FARKodeSetNonlinCRDown(farg1, farg2) & bind(C, name="_wrap_FARKodeSetNonlinCRDown") & result(fresult) @@ -786,25 +748,6 @@ function swigc_FARKodeSetPredictorMethod(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeSetStabilityFn") & -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_FARKodeSetMaxErrTestFails(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxErrTestFails") & -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_FARKodeSetMaxNonlinIters(farg1, farg2) & bind(C, name="_wrap_FARKodeSetMaxNonlinIters") & result(fresult) @@ -832,26 +775,26 @@ function swigc_FARKodeSetNonlinConvCoef(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetConstraints(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetConstraints") & +function swigc_FARKodeSetStagePredictFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStagePredictFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxNumSteps(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxNumSteps") & +function swigc_FARKodeSetAdaptController(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptController") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_LONG), intent(in) :: farg2 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxHnilWarns(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxHnilWarns") & +function swigc_FARKodeSetAdaptivityAdjustment(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptivityAdjustment") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -859,8 +802,8 @@ function swigc_FARKodeSetMaxHnilWarns(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetInitStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetInitStep") & +function swigc_FARKodeSetCFLFraction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetCFLFraction") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -868,8 +811,8 @@ function swigc_FARKodeSetInitStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetMinStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMinStep") & +function swigc_FARKodeSetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetErrorBias") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -877,8 +820,8 @@ function swigc_FARKodeSetMinStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxStep") & +function swigc_FARKodeSetSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSafetyFactor") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -886,17 +829,17 @@ function swigc_FARKodeSetMaxStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetInterpolateStopTime(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetInterpolateStopTime") & +function swigc_FARKodeSetMaxGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetStopTime(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetStopTime") & +function swigc_FARKodeSetMinReduction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinReduction") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -904,16 +847,18 @@ function swigc_FARKodeSetStopTime(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeClearStopTime(farg1) & -bind(C, name="_wrap_FARKodeClearStopTime") & +function swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetFixedStepBounds") & 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_FARKodeSetFixedStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetFixedStep") & +function swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxFirstGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -921,131 +866,141 @@ function swigc_FARKodeSetFixedStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetMaxNumConstrFails") & +function swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxEFailGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetUserData(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetUserData") & +function swigc_FARKodeSetSmallNumEFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSmallNumEFails") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetPostprocessStepFn(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetPostprocessStepFn") & +function swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxCFailGrowth") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeSetPostprocessStageFn(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetPostprocessStageFn") & -result(fresult) +function swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetStabilityFn") & +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_FARKodeSetStagePredictFn(farg1, farg2) & -bind(C, name="_wrap_FARKodeSetStagePredictFn") & +function swigc_FARKodeSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxErrTestFails") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FARKodeEvolve") & +function swigc_FARKodeSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetConstraints") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) & -bind(C, name="_wrap_FARKodeGetDky") & +function swigc_FARKodeSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxHnilWarns") & +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_FARKodeSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInitStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 real(C_DOUBLE), intent(in) :: farg2 -integer(C_INT), intent(in) :: farg3 -type(C_PTR), value :: farg4 integer(C_INT) :: fresult end function -function swigc_FARKodeComputeState(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodeComputeState") & +function swigc_FARKodeSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumExpSteps(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumExpSteps") & +function swigc_FARKodeSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumAccSteps(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumAccSteps") & +function swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumConstrFails") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumStepAttempts(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumStepAttempts") & +function swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKodeEvolve") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & +function swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeGetDky") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumErrTestFails(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumErrTestFails") & +function swigc_FARKodeComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeComputeState") & 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_FARKodeGetEstLocalErrors(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetEstLocalErrors") & +function swigc_FARKodeGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumStepAttempts") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1072,8 +1027,8 @@ function swigc_FARKodeGetNumSteps(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetActualInitStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetActualInitStep") & +function swigc_FARKodeGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1081,8 +1036,8 @@ function swigc_FARKodeGetActualInitStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetLastStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetLastStep") & +function swigc_FARKodeGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentStep") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1090,8 +1045,8 @@ function swigc_FARKodeGetLastStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetCurrentStep(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetCurrentStep") & +function swigc_FARKodeGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetErrWeights") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1099,8 +1054,8 @@ function swigc_FARKodeGetCurrentStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetCurrentTime(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetCurrentTime") & +function swigc_FARKodeGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumGEvals") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1108,8 +1063,8 @@ function swigc_FARKodeGetCurrentTime(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetCurrentState(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetCurrentState") & +function swigc_FARKodeGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetRootInfo") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1117,8 +1072,8 @@ function swigc_FARKodeGetCurrentState(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetCurrentGamma(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetCurrentGamma") & +function swigc_FARKodeGetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetUserData") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1126,17 +1081,32 @@ function swigc_FARKodeGetCurrentGamma(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetCurrentMassMatrix") & +function swigc_FARKodePrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodePrintAllStats") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 integer(C_INT) :: fresult end function -function swigc_FARKodeGetTolScaleFactor(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetTolScaleFactor") & + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FARKodeGetReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FARKodeWriteParameters") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1144,8 +1114,8 @@ function swigc_FARKodeGetTolScaleFactor(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetErrWeights(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetErrWeights") & +function swigc_FARKodeGetNumExpSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumExpSteps") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1153,8 +1123,8 @@ function swigc_FARKodeGetErrWeights(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetResWeights(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetResWeights") & +function swigc_FARKodeGetNumAccSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumAccSteps") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1162,8 +1132,8 @@ function swigc_FARKodeGetResWeights(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetNumGEvals(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetNumGEvals") & +function swigc_FARKodeGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumErrTestFails") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1171,8 +1141,26 @@ function swigc_FARKodeGetNumGEvals(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetRootInfo(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetRootInfo") & +function swigc_FARKodeGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetEstLocalErrors") & +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_FARKodeGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetActualInitStep") & +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_FARKodeGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetTolScaleFactor") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1189,41 +1177,39 @@ function swigc_FARKodeGetNumConstrFails(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetUserData(farg1, farg2) & -bind(C, name="_wrap_FARKodeGetUserData") & +function swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKodeGetStepStats") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function -function swigc_FARKodePrintAllStats(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKodePrintAllStats") & +function swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 -integer(C_INT), intent(in) :: farg3 integer(C_INT) :: fresult end function - subroutine SWIG_free(cptr) & - bind(C, name="free") - use, intrinsic :: ISO_C_BINDING - type(C_PTR), value :: cptr -end subroutine -function swigc_FARKodeGetReturnFlagName(farg1) & -bind(C, name="_wrap_FARKodeGetReturnFlagName") & +function swigc_FARKodeGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentTime") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -integer(C_LONG), intent(in) :: farg1 -type(SwigArrayWrapper) :: fresult +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult end function -function swigc_FARKodeWriteParameters(farg1, farg2) & -bind(C, name="_wrap_FARKodeWriteParameters") & +function swigc_FARKodeGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentState") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1231,16 +1217,12 @@ function swigc_FARKodeWriteParameters(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & -bind(C, name="_wrap_FARKodeGetStepStats") & +function swigc_FARKodeGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentGamma") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 integer(C_INT) :: fresult end function @@ -1414,6 +1396,33 @@ function swigc_FARKodeGetLastLinFlag(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentMassMatrix") & +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_FARKodeGetResWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetResWeights") & +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_FARKodeGetMassWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FARKodeGetMassWorkSpace") & result(fresult) @@ -1514,15 +1523,6 @@ function swigc_FARKodeGetLastMassFlag(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FARKodeGetLinReturnFlagName(farg1) & -bind(C, name="_wrap_FARKodeGetLinReturnFlagName") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper -integer(C_LONG), intent(in) :: farg1 -type(SwigArrayWrapper) :: fresult -end function - subroutine swigc_FARKodeFree(farg1) & bind(C, name="_wrap_FARKodeFree") use, intrinsic :: ISO_C_BINDING @@ -2589,675 +2589,675 @@ function FARKodeSetInterpolantDegree(arkode_mem, degree) & swig_result = fresult end function -function FARKodeSetNonlinearSolver(arkode_mem, nls) & +function FARKodeSetMaxNumSteps(arkode_mem, mxsteps) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), intent(in) :: mxsteps integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_PTR) :: farg2 +integer(C_LONG) :: farg2 farg1 = arkode_mem -farg2 = c_loc(nls) -fresult = swigc_FARKodeSetNonlinearSolver(farg1, farg2) +farg2 = mxsteps +fresult = swigc_FARKodeSetMaxNumSteps(farg1, farg2) swig_result = fresult end function -function FARKodeSetLinear(arkode_mem, timedepend) & +function FARKodeSetInterpolateStopTime(arkode_mem, interp) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: timedepend +integer(C_INT), intent(in) :: interp integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = timedepend -fresult = swigc_FARKodeSetLinear(farg1, farg2) +farg2 = interp +fresult = swigc_FARKodeSetInterpolateStopTime(farg1, farg2) swig_result = fresult end function -function FARKodeSetNonlinear(arkode_mem) & +function FARKodeSetStopTime(arkode_mem, tstop) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop integer(C_INT) :: fresult type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -fresult = swigc_FARKodeSetNonlinear(farg1) +farg2 = tstop +fresult = swigc_FARKodeSetStopTime(farg1, farg2) swig_result = fresult end function -function FARKodeSetNlsRhsFn(arkode_mem, nls_fi) & +function FARKodeClearStopTime(arkode_mem) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: nls_fi integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 farg1 = arkode_mem -farg2 = nls_fi -fresult = swigc_FARKodeSetNlsRhsFn(farg1, farg2) +fresult = swigc_FARKodeClearStopTime(farg1) swig_result = fresult end function -function FARKodeSetDeduceImplicitRhs(arkode_mem, deduce) & +function FARKodeSetFixedStep(arkode_mem, hfixed) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: deduce +real(C_DOUBLE), intent(in) :: hfixed integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = deduce -fresult = swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) +farg2 = hfixed +fresult = swigc_FARKodeSetFixedStep(farg1, farg2) swig_result = fresult end function -function FARKodeSetAdaptController(arkode_mem, c) & +function FARKodeSetUserData(arkode_mem, user_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: user_data integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(c) -fresult = swigc_FARKodeSetAdaptController(farg1, farg2) +farg2 = user_data +fresult = swigc_FARKodeSetUserData(farg1, farg2) swig_result = fresult end function -function FARKodeSetAdaptivityAdjustment(arkode_mem, adjust) & +function FARKodeSetPostprocessStepFn(arkode_mem, processstep) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: adjust +type(C_FUNPTR), intent(in), value :: processstep integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg2 farg1 = arkode_mem -farg2 = adjust -fresult = swigc_FARKodeSetAdaptivityAdjustment(farg1, farg2) +farg2 = processstep +fresult = swigc_FARKodeSetPostprocessStepFn(farg1, farg2) swig_result = fresult end function -function FARKodeSetCFLFraction(arkode_mem, cfl_frac) & +function FARKodeSetPostprocessStageFn(arkode_mem, processstage) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: cfl_frac +type(C_FUNPTR), intent(in), value :: processstage integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +type(C_FUNPTR) :: farg2 farg1 = arkode_mem -farg2 = cfl_frac -fresult = swigc_FARKodeSetCFLFraction(farg1, farg2) +farg2 = processstage +fresult = swigc_FARKodeSetPostprocessStageFn(farg1, farg2) swig_result = fresult end function -function FARKodeSetErrorBias(arkode_mem, bias) & +function FARKodeSetNonlinearSolver(arkode_mem, nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: bias +type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = bias -fresult = swigc_FARKodeSetErrorBias(farg1, farg2) +farg2 = c_loc(nls) +fresult = swigc_FARKodeSetNonlinearSolver(farg1, farg2) swig_result = fresult end function -function FARKodeSetSafetyFactor(arkode_mem, safety) & +function FARKodeSetLinear(arkode_mem, timedepend) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: safety +integer(C_INT), intent(in) :: timedepend integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = safety -fresult = swigc_FARKodeSetSafetyFactor(farg1, farg2) +farg2 = timedepend +fresult = swigc_FARKodeSetLinear(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxGrowth(arkode_mem, mx_growth) & +function FARKodeSetNonlinear(arkode_mem) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: mx_growth integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = mx_growth -fresult = swigc_FARKodeSetMaxGrowth(farg1, farg2) +fresult = swigc_FARKodeSetNonlinear(farg1) swig_result = fresult end function -function FARKodeSetMinReduction(arkode_mem, eta_min) & +function FARKodeSetNlsRhsFn(arkode_mem, nls_fi) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: eta_min +type(C_FUNPTR), intent(in), value :: nls_fi integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +type(C_FUNPTR) :: farg2 farg1 = arkode_mem -farg2 = eta_min -fresult = swigc_FARKodeSetMinReduction(farg1, farg2) +farg2 = nls_fi +fresult = swigc_FARKodeSetNlsRhsFn(farg1, farg2) swig_result = fresult end function -function FARKodeSetFixedStepBounds(arkode_mem, lb, ub) & +function FARKodeSetDeduceImplicitRhs(arkode_mem, deduce) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: lb -real(C_DOUBLE), intent(in) :: ub +integer(C_INT), intent(in) :: deduce integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 -real(C_DOUBLE) :: farg3 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = lb -farg3 = ub -fresult = swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) +farg2 = deduce +fresult = swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxFirstGrowth(arkode_mem, etamx1) & +function FARKodeSetNonlinCRDown(arkode_mem, crdown) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: etamx1 +real(C_DOUBLE), intent(in) :: crdown integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = etamx1 -fresult = swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) +farg2 = crdown +fresult = swigc_FARKodeSetNonlinCRDown(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxEFailGrowth(arkode_mem, etamxf) & +function FARKodeSetNonlinRDiv(arkode_mem, rdiv) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: etamxf +real(C_DOUBLE), intent(in) :: rdiv integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = etamxf -fresult = swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) +farg2 = rdiv +fresult = swigc_FARKodeSetNonlinRDiv(farg1, farg2) swig_result = fresult end function -function FARKodeSetSmallNumEFails(arkode_mem, small_nef) & +function FARKodeSetDeltaGammaMax(arkode_mem, dgmax) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: small_nef +real(C_DOUBLE), intent(in) :: dgmax integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = small_nef -fresult = swigc_FARKodeSetSmallNumEFails(farg1, farg2) +farg2 = dgmax +fresult = swigc_FARKodeSetDeltaGammaMax(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxCFailGrowth(arkode_mem, etacf) & +function FARKodeSetLSetupFrequency(arkode_mem, msbp) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: etacf +integer(C_INT), intent(in) :: msbp integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = etacf -fresult = swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) +farg2 = msbp +fresult = swigc_FARKodeSetLSetupFrequency(farg1, farg2) swig_result = fresult end function -function FARKodeSetNonlinCRDown(arkode_mem, crdown) & +function FARKodeSetPredictorMethod(arkode_mem, method) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: crdown +integer(C_INT), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = crdown -fresult = swigc_FARKodeSetNonlinCRDown(farg1, farg2) +farg2 = method +fresult = swigc_FARKodeSetPredictorMethod(farg1, farg2) swig_result = fresult end function -function FARKodeSetNonlinRDiv(arkode_mem, rdiv) & +function FARKodeSetMaxNonlinIters(arkode_mem, maxcor) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: rdiv +integer(C_INT), intent(in) :: maxcor integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = rdiv -fresult = swigc_FARKodeSetNonlinRDiv(farg1, farg2) +farg2 = maxcor +fresult = swigc_FARKodeSetMaxNonlinIters(farg1, farg2) swig_result = fresult end function -function FARKodeSetDeltaGammaMax(arkode_mem, dgmax) & +function FARKodeSetMaxConvFails(arkode_mem, maxncf) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: dgmax +integer(C_INT), intent(in) :: maxncf integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = dgmax -fresult = swigc_FARKodeSetDeltaGammaMax(farg1, farg2) +farg2 = maxncf +fresult = swigc_FARKodeSetMaxConvFails(farg1, farg2) swig_result = fresult end function -function FARKodeSetLSetupFrequency(arkode_mem, msbp) & +function FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: msbp +real(C_DOUBLE), intent(in) :: nlscoef integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = msbp -fresult = swigc_FARKodeSetLSetupFrequency(farg1, farg2) +farg2 = nlscoef +fresult = swigc_FARKodeSetNonlinConvCoef(farg1, farg2) swig_result = fresult end function -function FARKodeSetPredictorMethod(arkode_mem, method) & +function FARKodeSetStagePredictFn(arkode_mem, predictstage) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: method +type(C_FUNPTR), intent(in), value :: predictstage integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg2 farg1 = arkode_mem -farg2 = method -fresult = swigc_FARKodeSetPredictorMethod(farg1, farg2) +farg2 = predictstage +fresult = swigc_FARKodeSetStagePredictFn(farg1, farg2) swig_result = fresult end function -function FARKodeSetStabilityFn(arkode_mem, estab, estab_data) & +function FARKodeSetAdaptController(arkode_mem, c) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: estab -type(C_PTR) :: estab_data +type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_PTR) :: farg3 +type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = estab -farg3 = estab_data -fresult = swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) +farg2 = c_loc(c) +fresult = swigc_FARKodeSetAdaptController(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxErrTestFails(arkode_mem, maxnef) & +function FARKodeSetAdaptivityAdjustment(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) :: maxnef +integer(C_INT), intent(in) :: adjust integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = maxnef -fresult = swigc_FARKodeSetMaxErrTestFails(farg1, farg2) +farg2 = adjust +fresult = swigc_FARKodeSetAdaptivityAdjustment(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxNonlinIters(arkode_mem, maxcor) & +function FARKodeSetCFLFraction(arkode_mem, cfl_frac) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: maxcor +real(C_DOUBLE), intent(in) :: cfl_frac integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = maxcor -fresult = swigc_FARKodeSetMaxNonlinIters(farg1, farg2) +farg2 = cfl_frac +fresult = swigc_FARKodeSetCFLFraction(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxConvFails(arkode_mem, maxncf) & +function FARKodeSetErrorBias(arkode_mem, bias) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: maxncf +real(C_DOUBLE), intent(in) :: bias integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = maxncf -fresult = swigc_FARKodeSetMaxConvFails(farg1, farg2) +farg2 = bias +fresult = swigc_FARKodeSetErrorBias(farg1, farg2) swig_result = fresult end function -function FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) & +function FARKodeSetSafetyFactor(arkode_mem, safety) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: nlscoef +real(C_DOUBLE), intent(in) :: safety integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = nlscoef -fresult = swigc_FARKodeSetNonlinConvCoef(farg1, farg2) +farg2 = safety +fresult = swigc_FARKodeSetSafetyFactor(farg1, farg2) swig_result = fresult end function -function FARKodeSetConstraints(arkode_mem, constraints) & +function FARKodeSetMaxGrowth(arkode_mem, mx_growth) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(N_Vector), target, intent(inout) :: constraints +real(C_DOUBLE), intent(in) :: mx_growth integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = c_loc(constraints) -fresult = swigc_FARKodeSetConstraints(farg1, farg2) +farg2 = mx_growth +fresult = swigc_FARKodeSetMaxGrowth(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxNumSteps(arkode_mem, mxsteps) & +function FARKodeSetMinReduction(arkode_mem, eta_min) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), intent(in) :: mxsteps +real(C_DOUBLE), intent(in) :: eta_min integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_LONG) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = mxsteps -fresult = swigc_FARKodeSetMaxNumSteps(farg1, farg2) +farg2 = eta_min +fresult = swigc_FARKodeSetMinReduction(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxHnilWarns(arkode_mem, mxhnil) & +function FARKodeSetFixedStepBounds(arkode_mem, lb, ub) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: mxhnil +real(C_DOUBLE), intent(in) :: lb +real(C_DOUBLE), intent(in) :: ub integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 farg1 = arkode_mem -farg2 = mxhnil -fresult = swigc_FARKodeSetMaxHnilWarns(farg1, farg2) +farg2 = lb +farg3 = ub +fresult = swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) swig_result = fresult end function -function FARKodeSetInitStep(arkode_mem, hin) & +function FARKodeSetMaxFirstGrowth(arkode_mem, etamx1) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: hin +real(C_DOUBLE), intent(in) :: etamx1 integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = hin -fresult = swigc_FARKodeSetInitStep(farg1, farg2) +farg2 = etamx1 +fresult = swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) swig_result = fresult end function -function FARKodeSetMinStep(arkode_mem, hmin) & +function FARKodeSetMaxEFailGrowth(arkode_mem, etamxf) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: hmin +real(C_DOUBLE), intent(in) :: etamxf integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = hmin -fresult = swigc_FARKodeSetMinStep(farg1, farg2) +farg2 = etamxf +fresult = swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxStep(arkode_mem, hmax) & +function FARKodeSetSmallNumEFails(arkode_mem, small_nef) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: hmax +integer(C_INT), intent(in) :: small_nef integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = hmax -fresult = swigc_FARKodeSetMaxStep(farg1, farg2) +farg2 = small_nef +fresult = swigc_FARKodeSetSmallNumEFails(farg1, farg2) swig_result = fresult end function -function FARKodeSetInterpolateStopTime(arkode_mem, interp) & +function FARKodeSetMaxCFailGrowth(arkode_mem, etacf) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: interp +real(C_DOUBLE), intent(in) :: etacf integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = interp -fresult = swigc_FARKodeSetInterpolateStopTime(farg1, farg2) +farg2 = etacf +fresult = swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) swig_result = fresult end function -function FARKodeSetStopTime(arkode_mem, tstop) & +function FARKodeSetStabilityFn(arkode_mem, estab, estab_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: tstop +type(C_FUNPTR), intent(in), value :: estab +type(C_PTR) :: estab_data integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 farg1 = arkode_mem -farg2 = tstop -fresult = swigc_FARKodeSetStopTime(farg1, farg2) +farg2 = estab +farg3 = estab_data +fresult = swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) swig_result = fresult end function -function FARKodeClearStopTime(arkode_mem) & +function FARKodeSetMaxErrTestFails(arkode_mem, maxnef) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxnef integer(C_INT) :: fresult type(C_PTR) :: farg1 +integer(C_INT) :: farg2 farg1 = arkode_mem -fresult = swigc_FARKodeClearStopTime(farg1) +farg2 = maxnef +fresult = swigc_FARKodeSetMaxErrTestFails(farg1, farg2) swig_result = fresult end function -function FARKodeSetFixedStep(arkode_mem, hfixed) & +function FARKodeSetConstraints(arkode_mem, constraints) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: hfixed +type(N_Vector), target, intent(inout) :: constraints integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = hfixed -fresult = swigc_FARKodeSetFixedStep(farg1, farg2) +farg2 = c_loc(constraints) +fresult = swigc_FARKodeSetConstraints(farg1, farg2) swig_result = fresult end function -function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & +function FARKodeSetMaxHnilWarns(arkode_mem, mxhnil) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: maxfails +integer(C_INT), intent(in) :: mxhnil integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = maxfails -fresult = swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) +farg2 = mxhnil +fresult = swigc_FARKodeSetMaxHnilWarns(farg1, farg2) swig_result = fresult end function -function FARKodeSetUserData(arkode_mem, user_data) & +function FARKodeSetInitStep(arkode_mem, hin) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR) :: user_data +real(C_DOUBLE), intent(in) :: hin integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = user_data -fresult = swigc_FARKodeSetUserData(farg1, farg2) +farg2 = hin +fresult = swigc_FARKodeSetInitStep(farg1, farg2) swig_result = fresult end function -function FARKodeSetPostprocessStepFn(arkode_mem, processstep) & +function FARKodeSetMinStep(arkode_mem, hmin) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: processstep +real(C_DOUBLE), intent(in) :: hmin integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = processstep -fresult = swigc_FARKodeSetPostprocessStepFn(farg1, farg2) +farg2 = hmin +fresult = swigc_FARKodeSetMinStep(farg1, farg2) swig_result = fresult end function -function FARKodeSetPostprocessStageFn(arkode_mem, processstage) & +function FARKodeSetMaxStep(arkode_mem, hmax) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: processstage +real(C_DOUBLE), intent(in) :: hmax integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = processstage -fresult = swigc_FARKodeSetPostprocessStageFn(farg1, farg2) +farg2 = hmax +fresult = swigc_FARKodeSetMaxStep(farg1, farg2) swig_result = fresult end function -function FARKodeSetStagePredictFn(arkode_mem, predictstage) & +function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: predictstage +integer(C_INT), intent(in) :: maxfails integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = predictstage -fresult = swigc_FARKodeSetStagePredictFn(farg1, farg2) +farg2 = maxfails +fresult = swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) swig_result = fresult end function @@ -3327,38 +3327,6 @@ function FARKodeComputeState(arkode_mem, zcor, z) & swig_result = fresult end function -function FARKodeGetNumExpSteps(arkode_mem, expsteps) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: expsteps -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(expsteps(1)) -fresult = swigc_FARKodeGetNumExpSteps(farg1, farg2) -swig_result = fresult -end function - -function FARKodeGetNumAccSteps(arkode_mem, accsteps) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: accsteps -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(accsteps(1)) -fresult = swigc_FARKodeGetNumAccSteps(farg1, farg2) -swig_result = fresult -end function - function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3375,278 +3343,293 @@ function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & swig_result = fresult end function -function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(nlinsetups(1)) -fresult = swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) -swig_result = fresult -end function - -function FARKodeGetNumErrTestFails(arkode_mem, netfails) & +function FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: netfails +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 = arkode_mem -farg2 = c_loc(netfails(1)) -fresult = swigc_FARKodeGetNumErrTestFails(farg1, farg2) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FARKodeGetWorkSpace(farg1, farg2, farg3) swig_result = fresult end function -function FARKodeGetEstLocalErrors(arkode_mem, ele) & +function FARKodeGetNumSteps(arkode_mem, nsteps) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(N_Vector), target, intent(inout) :: ele +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(ele) -fresult = swigc_FARKodeGetEstLocalErrors(farg1, farg2) +farg2 = c_loc(nsteps(1)) +fresult = swigc_FARKodeGetNumSteps(farg1, farg2) swig_result = fresult end function -function FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) & +function FARKodeGetLastStep(arkode_mem, hlast) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: lenrw -integer(C_LONG), dimension(*), target, intent(inout) :: leniw +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 -type(C_PTR) :: farg3 farg1 = arkode_mem -farg2 = c_loc(lenrw(1)) -farg3 = c_loc(leniw(1)) -fresult = swigc_FARKodeGetWorkSpace(farg1, farg2, farg3) +farg2 = c_loc(hlast(1)) +fresult = swigc_FARKodeGetLastStep(farg1, farg2) swig_result = fresult end function -function FARKodeGetNumSteps(arkode_mem, nsteps) & +function FARKodeGetCurrentStep(arkode_mem, hcur) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(nsteps(1)) -fresult = swigc_FARKodeGetNumSteps(farg1, farg2) +farg2 = c_loc(hcur(1)) +fresult = swigc_FARKodeGetCurrentStep(farg1, farg2) swig_result = fresult end function -function FARKodeGetActualInitStep(arkode_mem, hinused) & +function FARKodeGetErrWeights(arkode_mem, eweight) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +type(N_Vector), target, intent(inout) :: eweight integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(hinused(1)) -fresult = swigc_FARKodeGetActualInitStep(farg1, farg2) +farg2 = c_loc(eweight) +fresult = swigc_FARKodeGetErrWeights(farg1, farg2) swig_result = fresult end function -function FARKodeGetLastStep(arkode_mem, hlast) & +function FARKodeGetNumGEvals(arkode_mem, ngevals) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(hlast(1)) -fresult = swigc_FARKodeGetLastStep(farg1, farg2) +farg2 = c_loc(ngevals(1)) +fresult = swigc_FARKodeGetNumGEvals(farg1, farg2) swig_result = fresult end function -function FARKodeGetCurrentStep(arkode_mem, hcur) & +function FARKodeGetRootInfo(arkode_mem, rootsfound) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(hcur(1)) -fresult = swigc_FARKodeGetCurrentStep(farg1, farg2) +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FARKodeGetRootInfo(farg1, farg2) swig_result = fresult end function -function FARKodeGetCurrentTime(arkode_mem, tcur) & +function FARKodeGetUserData(arkode_mem, user_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR), target, intent(inout) :: user_data integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(tcur(1)) -fresult = swigc_FARKodeGetCurrentTime(farg1, farg2) +farg2 = c_loc(user_data) +fresult = swigc_FARKodeGetUserData(farg1, farg2) swig_result = fresult end function -function FARKodeGetCurrentState(arkode_mem, state) & +function FARKodePrintAllStats(arkode_mem, outfile, fmt) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR) :: state +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 +integer(C_INT) :: farg3 farg1 = arkode_mem -farg2 = state -fresult = swigc_FARKodeGetCurrentState(farg1, farg2) +farg2 = outfile +farg3 = fmt +fresult = swigc_FARKodePrintAllStats(farg1, farg2, farg3) swig_result = fresult end function -function FARKodeGetCurrentGamma(arkode_mem, gamma) & + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FARKodeGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeWriteParameters(arkode_mem, fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +type(C_PTR) :: fp integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(gamma(1)) -fresult = swigc_FARKodeGetCurrentGamma(farg1, farg2) +farg2 = fp +fresult = swigc_FARKodeWriteParameters(farg1, farg2) swig_result = fresult end function -function FARKodeGetCurrentMassMatrix(arkode_mem, m) & +function FARKodeGetNumExpSteps(arkode_mem, expsteps) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: m +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(m) -fresult = swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) +farg2 = c_loc(expsteps(1)) +fresult = swigc_FARKodeGetNumExpSteps(farg1, farg2) swig_result = fresult end function -function FARKodeGetTolScaleFactor(arkode_mem, tolsfac) & +function FARKodeGetNumAccSteps(arkode_mem, accsteps) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(tolsfac(1)) -fresult = swigc_FARKodeGetTolScaleFactor(farg1, farg2) +farg2 = c_loc(accsteps(1)) +fresult = swigc_FARKodeGetNumAccSteps(farg1, farg2) swig_result = fresult end function -function FARKodeGetErrWeights(arkode_mem, eweight) & +function FARKodeGetNumErrTestFails(arkode_mem, netfails) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(N_Vector), target, intent(inout) :: eweight +integer(C_LONG), dimension(*), target, intent(inout) :: netfails integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(eweight) -fresult = swigc_FARKodeGetErrWeights(farg1, farg2) +farg2 = c_loc(netfails(1)) +fresult = swigc_FARKodeGetNumErrTestFails(farg1, farg2) swig_result = fresult end function -function FARKodeGetResWeights(arkode_mem, rweight) & +function FARKodeGetEstLocalErrors(arkode_mem, ele) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(N_Vector), target, intent(inout) :: rweight +type(N_Vector), target, intent(inout) :: ele integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(rweight) -fresult = swigc_FARKodeGetResWeights(farg1, farg2) +farg2 = c_loc(ele) +fresult = swigc_FARKodeGetEstLocalErrors(farg1, farg2) swig_result = fresult end function -function FARKodeGetNumGEvals(arkode_mem, ngevals) & +function FARKodeGetActualInitStep(arkode_mem, hinused) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(ngevals(1)) -fresult = swigc_FARKodeGetNumGEvals(farg1, farg2) +farg2 = c_loc(hinused(1)) +fresult = swigc_FARKodeGetActualInitStep(farg1, farg2) swig_result = fresult end function -function FARKodeGetRootInfo(arkode_mem, rootsfound) & +function FARKodeGetTolScaleFactor(arkode_mem, tolsfac) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = c_loc(rootsfound(1)) -fresult = swigc_FARKodeGetRootInfo(farg1, farg2) +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FARKodeGetTolScaleFactor(farg1, farg2) swig_result = fresult end function @@ -3666,110 +3649,95 @@ function FARKodeGetNumConstrFails(arkode_mem, nconstrfails) & swig_result = fresult end function -function FARKodeGetUserData(arkode_mem, user_data) & +function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: user_data +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 farg1 = arkode_mem -farg2 = c_loc(user_data) -fresult = swigc_FARKodeGetUserData(farg1, farg2) +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) swig_result = fresult end function -function FARKodePrintAllStats(arkode_mem, outfile, fmt) & +function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 -integer(C_INT) :: farg3 farg1 = arkode_mem -farg2 = outfile -farg3 = fmt -fresult = swigc_FARKodePrintAllStats(farg1, farg2, farg3) +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) swig_result = fresult end function - -subroutine SWIG_chararray_to_string(wrap, string) - use, intrinsic :: ISO_C_BINDING - type(SwigArrayWrapper), intent(IN) :: wrap - character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string - character(kind=C_CHAR), dimension(:), pointer :: chars - integer(kind=C_SIZE_T) :: i - call c_f_pointer(wrap%data, chars, [wrap%size]) - allocate(character(kind=C_CHAR, len=wrap%size) :: string) - do i=1, wrap%size - string(i:i) = chars(i) - end do -end subroutine - -function FARKodeGetReturnFlagName(flag) & +function FARKodeGetCurrentTime(arkode_mem, tcur) & result(swig_result) use, intrinsic :: ISO_C_BINDING -character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(C_LONG), intent(in) :: flag -type(SwigArrayWrapper) :: fresult -integer(C_LONG) :: farg1 +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 -farg1 = flag -fresult = swigc_FARKodeGetReturnFlagName(farg1) -call SWIG_chararray_to_string(fresult, swig_result) -if (.false.) call SWIG_free(fresult%data) +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetCurrentTime(farg1, farg2) +swig_result = fresult end function -function FARKodeWriteParameters(arkode_mem, fp) & +function FARKodeGetCurrentState(arkode_mem, state) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR) :: fp +type(C_PTR) :: state integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = fp -fresult = swigc_FARKodeWriteParameters(farg1, farg2) +farg2 = state +fresult = swigc_FARKodeGetCurrentState(farg1, farg2) swig_result = fresult end function -function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +function FARKodeGetCurrentGamma(arkode_mem, gamma) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nsteps -real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused -real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast -real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur -real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 farg1 = arkode_mem -farg2 = c_loc(nsteps(1)) -farg3 = c_loc(hinused(1)) -farg4 = c_loc(hlast(1)) -farg5 = c_loc(hcur(1)) -farg6 = c_loc(tcur(1)) -fresult = swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +farg2 = c_loc(gamma(1)) +fresult = swigc_FARKodeGetCurrentGamma(farg1, farg2) swig_result = fresult end function @@ -4085,6 +4053,52 @@ function FARKodeGetLastLinFlag(arkode_mem, flag) & swig_result = fresult end function +function FARKodeGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeGetCurrentMassMatrix(arkode_mem, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(m) +fresult = swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetResWeights(arkode_mem, rweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rweight) +fresult = swigc_FARKodeGetResWeights(farg1, farg2) +swig_result = fresult +end function + function FARKodeGetMassWorkSpace(arkode_mem, lenrwmls, leniwmls) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4264,20 +4278,6 @@ function FARKodeGetLastMassFlag(arkode_mem, flag) & swig_result = fresult end function -function FARKodeGetLinReturnFlagName(flag) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(C_LONG), intent(in) :: flag -type(SwigArrayWrapper) :: fresult -integer(C_LONG) :: farg1 - -farg1 = flag -fresult = swigc_FARKodeGetLinReturnFlagName(farg1) -call SWIG_chararray_to_string(fresult, swig_result) -if (.false.) call SWIG_free(fresult%data) -end function - subroutine FARKodeFree(arkode_mem) use, intrinsic :: ISO_C_BINDING type(C_PTR), target, intent(inout) :: arkode_mem diff --git a/src/arkode/fmod/farkode_mristep_mod.c b/src/arkode/fmod/farkode_mristep_mod.c index c9fc9edf0c..c2e254fa54 100644 --- a/src/arkode/fmod/farkode_mristep_mod.c +++ b/src/arkode/fmod/farkode_mristep_mod.c @@ -651,26 +651,6 @@ SWIGEXPORT void * _wrap_FMRIStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double co } -SWIGEXPORT int _wrap_FMRIStepResize(void *farg1, N_Vector farg2, double const *farg3, ARKVecResizeFn farg4, void *farg5) { - int fresult ; - void *arg1 = (void *) 0 ; - N_Vector arg2 = (N_Vector) 0 ; - sunrealtype arg3 ; - ARKVecResizeFn arg4 = (ARKVecResizeFn) 0 ; - void *arg5 = (void *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (N_Vector)(farg2); - arg3 = (sunrealtype)(*farg3); - arg4 = (ARKVecResizeFn)(farg4); - arg5 = (void *)(farg5); - result = (int)MRIStepResize(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { int fresult ; void *arg1 = (void *) 0 ; @@ -691,6 +671,244 @@ SWIGEXPORT int _wrap_FMRIStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, } +SWIGEXPORT int _wrap_FMRIStepSetCoupling(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepCoupling arg2 = (MRIStepCoupling) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepCoupling)(farg2); + result = (int)MRIStepSetCoupling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPreInnerFn(void *farg1, MRIStepPreInnerFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepPreInnerFn arg2 = (MRIStepPreInnerFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepPreInnerFn)(farg2); + result = (int)MRIStepSetPreInnerFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPostInnerFn(void *farg1, MRIStepPostInnerFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepPostInnerFn arg2 = (MRIStepPostInnerFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepPostInnerFn)(farg2); + result = (int)MRIStepSetPostInnerFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetCurrentCoupling(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepCoupling *arg2 = (MRIStepCoupling *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepCoupling *)(farg2); + result = (int)MRIStepGetCurrentCoupling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetLastInnerStepFlag(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)MRIStepGetLastInnerStepFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (SUNContext)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)MRIStepInnerStepper_Create(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_Free(void *farg1) { + int fresult ; + MRIStepInnerStepper *arg1 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper *)(farg1); + result = (int)MRIStepInnerStepper_Free(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetContent(void *farg1, void *farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (void *)(farg2); + result = (int)MRIStepInnerStepper_SetContent(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetContent(void *farg1, void *farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (void **)(farg2); + result = (int)MRIStepInnerStepper_GetContent(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetEvolveFn(void *farg1, MRIStepInnerEvolveFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerEvolveFn arg2 = (MRIStepInnerEvolveFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerEvolveFn)(farg2); + result = (int)MRIStepInnerStepper_SetEvolveFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetFullRhsFn(void *farg1, MRIStepInnerFullRhsFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerFullRhsFn arg2 = (MRIStepInnerFullRhsFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerFullRhsFn)(farg2); + result = (int)MRIStepInnerStepper_SetFullRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerResetFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerResetFn arg2 = (MRIStepInnerResetFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerResetFn)(farg2); + result = (int)MRIStepInnerStepper_SetResetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)MRIStepInnerStepper_AddForcing(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetForcingData(void *farg1, double *farg2, double *farg3, void *farg4, int *farg5) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector **arg4 = (N_Vector **) 0 ; + int *arg5 = (int *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector **)(farg4); + arg5 = (int *)(farg5); + result = (int)MRIStepInnerStepper_GetForcingData(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepResize(void *farg1, N_Vector farg2, double const *farg3, ARKVecResizeFn farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + ARKVecResizeFn arg4 = (ARKVecResizeFn) 0 ; + void *arg5 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (ARKVecResizeFn)(farg4); + arg5 = (void *)(farg5); + result = (int)MRIStepResize(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -907,20 +1125,6 @@ SWIGEXPORT int _wrap_FMRIStepSetNonlinear(void *farg1) { } -SWIGEXPORT int _wrap_FMRIStepSetCoupling(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - MRIStepCoupling arg2 = (MRIStepCoupling) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (MRIStepCoupling)(farg2); - result = (int)MRIStepSetCoupling(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepSetMaxNumSteps(void *farg1, long const *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1047,29 +1251,29 @@ SWIGEXPORT int _wrap_FMRIStepSetMaxHnilWarns(void *farg1, int const *farg2) { } -SWIGEXPORT int _wrap_FMRIStepSetStopTime(void *farg1, double const *farg2) { +SWIGEXPORT int _wrap_FMRIStepSetInterpolateStopTime(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - result = (int)MRIStepSetStopTime(arg1,arg2); + arg2 = (int)(*farg2); + result = (int)MRIStepSetInterpolateStopTime(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FMRIStepSetInterpolateStopTime(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FMRIStepSetStopTime(void *farg1, double const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - int arg2 ; + sunrealtype arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)MRIStepSetInterpolateStopTime(arg1,arg2); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetStopTime(arg1,arg2); fresult = (int)(result); return fresult; } @@ -1169,34 +1373,6 @@ SWIGEXPORT int _wrap_FMRIStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn } -SWIGEXPORT int _wrap_FMRIStepSetPreInnerFn(void *farg1, MRIStepPreInnerFn farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - MRIStepPreInnerFn arg2 = (MRIStepPreInnerFn) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (MRIStepPreInnerFn)(farg2); - result = (int)MRIStepSetPreInnerFn(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepSetPostInnerFn(void *farg1, MRIStepPostInnerFn farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - MRIStepPostInnerFn arg2 = (MRIStepPostInnerFn) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (MRIStepPostInnerFn)(farg2); - result = (int)MRIStepSetPostInnerFn(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1409,22 +1585,6 @@ SWIGEXPORT int _wrap_FMRIStepComputeState(void *farg1, N_Vector farg2, N_Vector } -SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepGetNumLinSolvSetups(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1439,20 +1599,6 @@ SWIGEXPORT int _wrap_FMRIStepGetNumLinSolvSetups(void *farg1, long *farg2) { } -SWIGEXPORT int _wrap_FMRIStepGetCurrentCoupling(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - MRIStepCoupling *arg2 = (MRIStepCoupling *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (MRIStepCoupling *)(farg2); - result = (int)MRIStepGetCurrentCoupling(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepGetWorkSpace(void *farg1, long *farg2, long *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -1595,20 +1741,6 @@ SWIGEXPORT int _wrap_FMRIStepGetRootInfo(void *farg1, int *farg2) { } -SWIGEXPORT int _wrap_FMRIStepGetLastInnerStepFlag(void *farg1, int *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int *arg2 = (int *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int *)(farg2); - result = (int)MRIStepGetLastInnerStepFlag(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepGetUserData(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1979,136 +2111,4 @@ SWIGEXPORT void _wrap_FMRIStepPrintMem(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { - int fresult ; - SUNContext arg1 = (SUNContext) 0 ; - MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; - int result; - - arg1 = (SUNContext)(farg1); - arg2 = (MRIStepInnerStepper *)(farg2); - result = (int)MRIStepInnerStepper_Create(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_Free(void *farg1) { - int fresult ; - MRIStepInnerStepper *arg1 = (MRIStepInnerStepper *) 0 ; - int result; - - arg1 = (MRIStepInnerStepper *)(farg1); - result = (int)MRIStepInnerStepper_Free(arg1); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetContent(void *farg1, void *farg2) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - void *arg2 = (void *) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (void *)(farg2); - result = (int)MRIStepInnerStepper_SetContent(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetContent(void *farg1, void *farg2) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - void **arg2 = (void **) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (void **)(farg2); - result = (int)MRIStepInnerStepper_GetContent(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetEvolveFn(void *farg1, MRIStepInnerEvolveFn farg2) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - MRIStepInnerEvolveFn arg2 = (MRIStepInnerEvolveFn) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (MRIStepInnerEvolveFn)(farg2); - result = (int)MRIStepInnerStepper_SetEvolveFn(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetFullRhsFn(void *farg1, MRIStepInnerFullRhsFn farg2) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - MRIStepInnerFullRhsFn arg2 = (MRIStepInnerFullRhsFn) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (MRIStepInnerFullRhsFn)(farg2); - result = (int)MRIStepInnerStepper_SetFullRhsFn(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerResetFn farg2) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - MRIStepInnerResetFn arg2 = (MRIStepInnerResetFn) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (MRIStepInnerResetFn)(farg2); - result = (int)MRIStepInnerStepper_SetResetFn(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - sunrealtype arg2 ; - N_Vector arg3 = (N_Vector) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector)(farg3); - result = (int)MRIStepInnerStepper_AddForcing(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - -SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetForcingData(void *farg1, double *farg2, double *farg3, void *farg4, int *farg5) { - int fresult ; - MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - N_Vector **arg4 = (N_Vector **) 0 ; - int *arg5 = (int *) 0 ; - int result; - - arg1 = (MRIStepInnerStepper)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (N_Vector **)(farg4); - arg5 = (int *)(farg5); - result = (int)MRIStepInnerStepper_GetForcingData(arg1,arg2,arg3,arg4,arg5); - fresult = (int)(result); - return fresult; -} - - diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod/farkode_mristep_mod.f90 index 163f24f8f8..1b7b8aef81 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -108,8 +108,23 @@ module farkode_mristep_mod public :: FMRIStepCoupling_Free public :: FMRIStepCoupling_Write public :: FMRIStepCreate - public :: FMRIStepResize public :: FMRIStepReInit + public :: FMRIStepSetCoupling + public :: FMRIStepSetPreInnerFn + public :: FMRIStepSetPostInnerFn + public :: FMRIStepGetNumRhsEvals + public :: FMRIStepGetCurrentCoupling + public :: FMRIStepGetLastInnerStepFlag + public :: FMRIStepInnerStepper_Create + public :: FMRIStepInnerStepper_Free + public :: FMRIStepInnerStepper_SetContent + public :: FMRIStepInnerStepper_GetContent + public :: FMRIStepInnerStepper_SetEvolveFn + public :: FMRIStepInnerStepper_SetFullRhsFn + public :: FMRIStepInnerStepper_SetResetFn + public :: FMRIStepInnerStepper_AddForcing + public :: FMRIStepInnerStepper_GetForcingData + public :: FMRIStepResize public :: FMRIStepReset public :: FMRIStepSStolerances public :: FMRIStepSVtolerances @@ -125,7 +140,6 @@ module farkode_mristep_mod public :: FMRIStepSetNlsRhsFn public :: FMRIStepSetLinear public :: FMRIStepSetNonlinear - public :: FMRIStepSetCoupling public :: FMRIStepSetMaxNumSteps public :: FMRIStepSetNonlinCRDown public :: FMRIStepSetNonlinRDiv @@ -135,8 +149,8 @@ module farkode_mristep_mod public :: FMRIStepSetMaxNonlinIters public :: FMRIStepSetNonlinConvCoef public :: FMRIStepSetMaxHnilWarns - public :: FMRIStepSetStopTime public :: FMRIStepSetInterpolateStopTime + public :: FMRIStepSetStopTime public :: FMRIStepClearStopTime public :: FMRIStepSetFixedStep public :: FMRIStepSetRootDirection @@ -144,8 +158,6 @@ module farkode_mristep_mod public :: FMRIStepSetUserData public :: FMRIStepSetPostprocessStepFn public :: FMRIStepSetPostprocessStageFn - public :: FMRIStepSetPreInnerFn - public :: FMRIStepSetPostInnerFn public :: FMRIStepSetStagePredictFn public :: FMRIStepSetDeduceImplicitRhs public :: FMRIStepSetJacFn @@ -160,9 +172,7 @@ module farkode_mristep_mod public :: FMRIStepEvolve public :: FMRIStepGetDky public :: FMRIStepComputeState - public :: FMRIStepGetNumRhsEvals public :: FMRIStepGetNumLinSolvSetups - public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetWorkSpace public :: FMRIStepGetNumSteps public :: FMRIStepGetLastStep @@ -173,7 +183,6 @@ module farkode_mristep_mod public :: FMRIStepGetErrWeights public :: FMRIStepGetNumGEvals public :: FMRIStepGetRootInfo - public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepGetUserData public :: FMRIStepPrintAllStats public :: FMRIStepGetReturnFlagName @@ -200,15 +209,6 @@ module farkode_mristep_mod public :: FMRIStepGetLinReturnFlagName public :: FMRIStepFree public :: FMRIStepPrintMem - public :: FMRIStepInnerStepper_Create - public :: FMRIStepInnerStepper_Free - public :: FMRIStepInnerStepper_SetContent - public :: FMRIStepInnerStepper_GetContent - public :: FMRIStepInnerStepper_SetEvolveFn - public :: FMRIStepInnerStepper_SetFullRhsFn - public :: FMRIStepInnerStepper_SetResetFn - public :: FMRIStepInnerStepper_AddForcing - public :: FMRIStepInnerStepper_GetForcingData ! WRAPPER DECLARATIONS interface @@ -447,26 +447,165 @@ function swigc_FMRIStepCreate(farg1, farg2, farg3, farg4, farg5, farg6) & type(C_PTR) :: fresult end function -function swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FMRIStepResize") & +function swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepReInit") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -real(C_DOUBLE), intent(in) :: farg3 -type(C_FUNPTR), value :: farg4 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 type(C_PTR), value :: farg5 integer(C_INT) :: fresult end function -function swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FMRIStepReInit") & +function swigc_FMRIStepSetCoupling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetCoupling") & +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_FMRIStepSetPreInnerFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPreInnerFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 type(C_FUNPTR), value :: farg2 -type(C_FUNPTR), value :: farg3 -real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetPostInnerFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPostInnerFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & +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_FMRIStepGetCurrentCoupling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetCurrentCoupling") & +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_FMRIStepGetLastInnerStepFlag(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetLastInnerStepFlag") & +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_FMRIStepInnerStepper_Create(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_Create") & +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_FMRIStepInnerStepper_Free(farg1) & +bind(C, name="_wrap_FMRIStepInnerStepper_Free") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetContent") & +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_FMRIStepInnerStepper_GetContent(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_GetContent") & +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_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetEvolveFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetFullRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepInnerStepper_AddForcing") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepInnerStepper_GetForcingData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_FUNPTR), value :: farg4 type(C_PTR), value :: farg5 integer(C_INT) :: fresult end function @@ -609,15 +748,6 @@ function swigc_FMRIStepSetNonlinear(farg1) & integer(C_INT) :: fresult end function -function swigc_FMRIStepSetCoupling(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetCoupling") & -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_FMRIStepSetMaxNumSteps(farg1, farg2) & bind(C, name="_wrap_FMRIStepSetMaxNumSteps") & result(fresult) @@ -699,21 +829,21 @@ function swigc_FMRIStepSetMaxHnilWarns(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepSetStopTime(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetStopTime") & +function swigc_FMRIStepSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetInterpolateStopTime") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FMRIStepSetInterpolateStopTime(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetInterpolateStopTime") & +function swigc_FMRIStepSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetStopTime") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg2 integer(C_INT) :: fresult end function @@ -778,24 +908,6 @@ function swigc_FMRIStepSetPostprocessStageFn(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepSetPreInnerFn(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetPreInnerFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepSetPostInnerFn(farg1, farg2) & -bind(C, name="_wrap_FMRIStepSetPostInnerFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FMRIStepSetStagePredictFn(farg1, farg2) & bind(C, name="_wrap_FMRIStepSetStagePredictFn") & result(fresult) @@ -930,16 +1042,6 @@ function swigc_FMRIStepComputeState(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & -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_FMRIStepGetNumLinSolvSetups(farg1, farg2) & bind(C, name="_wrap_FMRIStepGetNumLinSolvSetups") & result(fresult) @@ -949,15 +1051,6 @@ function swigc_FMRIStepGetNumLinSolvSetups(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetCurrentCoupling(farg1, farg2) & -bind(C, name="_wrap_FMRIStepGetCurrentCoupling") & -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_FMRIStepGetWorkSpace(farg1, farg2, farg3) & bind(C, name="_wrap_FMRIStepGetWorkSpace") & result(fresult) @@ -1049,17 +1142,8 @@ function swigc_FMRIStepGetRootInfo(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) & -bind(C, name="_wrap_FMRIStepGetLastInnerStepFlag") & -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_FMRIStepGetUserData(farg1, farg2) & -bind(C, name="_wrap_FMRIStepGetUserData") & +function swigc_FMRIStepGetUserData(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetUserData") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -1301,90 +1385,6 @@ subroutine swigc_FMRIStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine -function swigc_FMRIStepInnerStepper_Create(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_Create") & -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_FMRIStepInnerStepper_Free(farg1) & -bind(C, name="_wrap_FMRIStepInnerStepper_Free") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_SetContent") & -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_FMRIStepInnerStepper_GetContent(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_GetContent") & -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_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_SetEvolveFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_SetFullRhsFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) & -bind(C, name="_wrap_FMRIStepInnerStepper_SetResetFn") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) & -bind(C, name="_wrap_FMRIStepInnerStepper_AddForcing") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 -type(C_PTR), value :: farg3 -integer(C_INT) :: fresult -end function - -function swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) & -bind(C, name="_wrap_FMRIStepInnerStepper_GetForcingData") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_PTR), value :: farg2 -type(C_PTR), value :: farg3 -type(C_PTR), value :: farg4 -type(C_PTR), value :: farg5 -integer(C_INT) :: fresult -end function - end interface @@ -1793,53 +1793,305 @@ function FMRIStepCreate(fse, fsi, t0, y0, stepper, sunctx) & swig_result = fresult end function -function FMRIStepResize(arkode_mem, ynew, t0, resize, resize_data) & +function FMRIStepReInit(arkode_mem, fse, fsi, t0, y0) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(N_Vector), target, intent(inout) :: ynew +type(C_FUNPTR), intent(in), value :: fse +type(C_FUNPTR), intent(in), value :: fsi real(C_DOUBLE), intent(in) :: t0 -type(C_FUNPTR), intent(in), value :: resize -type(C_PTR) :: resize_data +type(N_Vector), target, intent(inout) :: y0 integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -real(C_DOUBLE) :: farg3 -type(C_FUNPTR) :: farg4 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 type(C_PTR) :: farg5 farg1 = arkode_mem -farg2 = c_loc(ynew) -farg3 = t0 -farg4 = resize -farg5 = resize_data -fresult = swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) +farg2 = fse +farg3 = fsi +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function -function FMRIStepReInit(arkode_mem, fse, fsi, t0, y0) & +function FMRIStepSetCoupling(arkode_mem, mric) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: fse -type(C_FUNPTR), intent(in), value :: fsi -real(C_DOUBLE), intent(in) :: t0 -type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: mric +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = mric +fresult = swigc_FMRIStepSetCoupling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPreInnerFn(arkode_mem, prefn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: prefn integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_FUNPTR) :: farg2 -type(C_FUNPTR) :: farg3 -real(C_DOUBLE) :: farg4 + +farg1 = arkode_mem +farg2 = prefn +fresult = swigc_FMRIStepSetPreInnerFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPostInnerFn(arkode_mem, postfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: postfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = postfn +fresult = swigc_FMRIStepSetPostInnerFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfse_evals(1)) +farg3 = c_loc(nfsi_evals(1)) +fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetCurrentCoupling(arkode_mem, mric) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: mric +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(mric) +fresult = swigc_FMRIStepGetCurrentCoupling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLastInnerStepFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_Create(sunctx, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_Create(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_Free(stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_Free(farg1) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = content +fresult = swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_GetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR), target, intent(inout) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(content) +fresult = swigc_FMRIStepInnerStepper_GetContent(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetEvolveFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetFullRhsFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_AddForcing(stepper, t, f) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: f +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = stepper +farg2 = t +farg3 = c_loc(f) +fresult = swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepInnerStepper_GetForcingData(stepper, tshift, tscale, forcing, nforcing) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), dimension(*), target, intent(inout) :: tshift +real(C_DOUBLE), dimension(*), target, intent(inout) :: tscale +type(C_PTR), target, intent(inout) :: forcing +integer(C_INT), dimension(*), target, intent(inout) :: nforcing +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = stepper +farg2 = c_loc(tshift(1)) +farg3 = c_loc(tscale(1)) +farg4 = c_loc(forcing) +farg5 = c_loc(nforcing(1)) +fresult = swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FMRIStepResize(arkode_mem, ynew, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_FUNPTR) :: farg4 type(C_PTR) :: farg5 farg1 = arkode_mem -farg2 = fse -farg3 = fsi -farg4 = t0 -farg5 = c_loc(y0) -fresult = swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) +farg2 = c_loc(ynew) +farg3 = t0 +farg4 = resize +farg5 = resize_data +fresult = swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function @@ -2092,22 +2344,6 @@ function FMRIStepSetNonlinear(arkode_mem) & swig_result = fresult end function -function FMRIStepSetCoupling(arkode_mem, mric) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR) :: mric -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = mric -fresult = swigc_FMRIStepSetCoupling(farg1, farg2) -swig_result = fresult -end function - function FMRIStepSetMaxNumSteps(arkode_mem, mxsteps) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2252,35 +2488,35 @@ function FMRIStepSetMaxHnilWarns(arkode_mem, mxhnil) & swig_result = fresult end function -function FMRIStepSetStopTime(arkode_mem, tstop) & +function FMRIStepSetInterpolateStopTime(arkode_mem, interp) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -real(C_DOUBLE), intent(in) :: tstop +integer(C_INT), intent(in) :: interp integer(C_INT) :: fresult type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg2 farg1 = arkode_mem -farg2 = tstop -fresult = swigc_FMRIStepSetStopTime(farg1, farg2) +farg2 = interp +fresult = swigc_FMRIStepSetInterpolateStopTime(farg1, farg2) swig_result = fresult end function -function FMRIStepSetInterpolateStopTime(arkode_mem, interp) & +function FMRIStepSetStopTime(arkode_mem, tstop) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: interp +real(C_DOUBLE), intent(in) :: tstop integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg2 farg1 = arkode_mem -farg2 = interp -fresult = swigc_FMRIStepSetInterpolateStopTime(farg1, farg2) +farg2 = tstop +fresult = swigc_FMRIStepSetStopTime(farg1, farg2) swig_result = fresult end function @@ -2390,38 +2626,6 @@ function FMRIStepSetPostprocessStageFn(arkode_mem, processstage) & swig_result = fresult end function -function FMRIStepSetPreInnerFn(arkode_mem, prefn) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: prefn -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 - -farg1 = arkode_mem -farg2 = prefn -fresult = swigc_FMRIStepSetPreInnerFn(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepSetPostInnerFn(arkode_mem, postfn) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: postfn -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 - -farg1 = arkode_mem -farg2 = postfn -fresult = swigc_FMRIStepSetPostInnerFn(farg1, farg2) -swig_result = fresult -end function - function FMRIStepSetStagePredictFn(arkode_mem, predictstage) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2670,25 +2874,6 @@ function FMRIStepComputeState(arkode_mem, zcor, z) & swig_result = fresult end function -function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfse_evals(1)) -farg3 = c_loc(nfsi_evals(1)) -fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FMRIStepGetNumLinSolvSetups(arkode_mem, nlinsetups) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2705,22 +2890,6 @@ function FMRIStepGetNumLinSolvSetups(arkode_mem, nlinsetups) & swig_result = fresult end function -function FMRIStepGetCurrentCoupling(arkode_mem, mric) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: mric -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(mric) -fresult = swigc_FMRIStepGetCurrentCoupling(farg1, farg2) -swig_result = fresult -end function - function FMRIStepGetWorkSpace(arkode_mem, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2884,22 +3053,6 @@ function FMRIStepGetRootInfo(arkode_mem, rootsfound) & swig_result = fresult end function -function FMRIStepGetLastInnerStepFlag(arkode_mem, flag) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT), dimension(*), target, intent(inout) :: flag -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(flag(1)) -fresult = swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) -swig_result = fresult -end function - function FMRIStepGetUserData(arkode_mem, user_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3342,158 +3495,5 @@ subroutine FMRIStepPrintMem(arkode_mem, outfile) call swigc_FMRIStepPrintMem(farg1, farg2) end subroutine -function FMRIStepInnerStepper_Create(sunctx, stepper) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: sunctx -type(C_PTR), target, intent(inout) :: stepper -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = sunctx -farg2 = c_loc(stepper) -fresult = swigc_FMRIStepInnerStepper_Create(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_Free(stepper) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR), target, intent(inout) :: stepper -integer(C_INT) :: fresult -type(C_PTR) :: farg1 - -farg1 = c_loc(stepper) -fresult = swigc_FMRIStepInnerStepper_Free(farg1) -swig_result = fresult -end function - -function FMRIStepInnerStepper_SetContent(stepper, content) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -type(C_PTR) :: content -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = stepper -farg2 = content -fresult = swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_GetContent(stepper, content) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -type(C_PTR), target, intent(inout) :: content -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = stepper -farg2 = c_loc(content) -fresult = swigc_FMRIStepInnerStepper_GetContent(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_SetEvolveFn(stepper, fn) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -type(C_FUNPTR), intent(in), value :: fn -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 - -farg1 = stepper -farg2 = fn -fresult = swigc_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_SetFullRhsFn(stepper, fn) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -type(C_FUNPTR), intent(in), value :: fn -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 - -farg1 = stepper -farg2 = fn -fresult = swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_SetResetFn(stepper, fn) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -type(C_FUNPTR), intent(in), value :: fn -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 - -farg1 = stepper -farg2 = fn -fresult = swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) -swig_result = fresult -end function - -function FMRIStepInnerStepper_AddForcing(stepper, t, f) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -real(C_DOUBLE), intent(in) :: t -type(N_Vector), target, intent(inout) :: f -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -real(C_DOUBLE) :: farg2 -type(C_PTR) :: farg3 - -farg1 = stepper -farg2 = t -farg3 = c_loc(f) -fresult = swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) -swig_result = fresult -end function - -function FMRIStepInnerStepper_GetForcingData(stepper, tshift, tscale, forcing, nforcing) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: stepper -real(C_DOUBLE), dimension(*), target, intent(inout) :: tshift -real(C_DOUBLE), dimension(*), target, intent(inout) :: tscale -type(C_PTR), target, intent(inout) :: forcing -integer(C_INT), dimension(*), target, intent(inout) :: nforcing -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 -type(C_PTR) :: farg4 -type(C_PTR) :: farg5 - -farg1 = stepper -farg2 = c_loc(tshift(1)) -farg3 = c_loc(tscale(1)) -farg4 = c_loc(forcing) -farg5 = c_loc(nforcing(1)) -fresult = swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) -swig_result = fresult -end function - end module diff --git a/src/arkode/fmod/farkode_sprkstep_mod.c b/src/arkode/fmod/farkode_sprkstep_mod.c index d5858a372a..28cfb297d4 100644 --- a/src/arkode/fmod/farkode_sprkstep_mod.c +++ b/src/arkode/fmod/farkode_sprkstep_mod.c @@ -273,87 +273,143 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 } -SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { +SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype arg2 ; - N_Vector arg3 = (N_Vector) 0 ; + int arg2 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector)(farg3); - result = (int)SPRKStepReset(arg1,arg2,arg3); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { +SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - int arg2 ; - ARKRootFn arg3 = (ARKRootFn) 0 ; + ARKodeSPRKTable arg2 = (ARKodeSPRKTable) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - arg3 = (ARKRootFn)(farg3); - result = (int)SPRKStepRootInit(arg1,arg2,arg3); + arg2 = (ARKodeSPRKTable)(farg2); + result = (int)SPRKStepSetMethod(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetDefaults(void *farg1) { +SWIGEXPORT int _wrap_FSPRKStepSetMethodName(void *farg1, SwigArrayWrapper *farg2) { int fresult ; void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; int result; arg1 = (void *)(farg1); - result = (int)SPRKStepSetDefaults(arg1); + arg2 = (char *)(farg2->data); + result = (int)SPRKStepSetMethodName(arg1,(char const *)arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FSPRKStepGetCurrentMethod(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeSPRKTable *arg2 = (ARKodeSPRKTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeSPRKTable *)(farg2); + result = (int)SPRKStepGetCurrentMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)SPRKStepReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); + arg3 = (ARKRootFn)(farg3); + result = (int)SPRKStepRootInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { +SWIGEXPORT int _wrap_FSPRKStepSetRootDirection(void *farg1, int *farg2) { int fresult ; void *arg1 = (void *) 0 ; - ARKodeSPRKTable arg2 = (ARKodeSPRKTable) 0 ; + int *arg2 = (int *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (ARKodeSPRKTable)(farg2); - result = (int)SPRKStepSetMethod(arg1,arg2); + arg2 = (int *)(farg2); + result = (int)SPRKStepSetRootDirection(arg1,arg2); fresult = (int)(result); return fresult; } -SWIGEXPORT int _wrap_FSPRKStepSetMethodName(void *farg1, SwigArrayWrapper *farg2) { +SWIGEXPORT int _wrap_FSPRKStepSetNoInactiveRootWarn(void *farg1) { int fresult ; void *arg1 = (void *) 0 ; - char *arg2 = (char *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (char *)(farg2->data); - result = (int)SPRKStepSetMethodName(arg1,(char const *)arg2); + result = (int)SPRKStepSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)SPRKStepSetDefaults(arg1); fresult = (int)(result); return fresult; } @@ -536,20 +592,6 @@ SWIGEXPORT SwigArrayWrapper _wrap_FSPRKStepGetReturnFlagName(long const *farg1) } -SWIGEXPORT int _wrap_FSPRKStepGetCurrentMethod(void *farg1, void *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - ARKodeSPRKTable *arg2 = (ARKodeSPRKTable *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (ARKodeSPRKTable *)(farg2); - result = (int)SPRKStepGetCurrentMethod(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepGetCurrentState(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -606,22 +648,6 @@ SWIGEXPORT int _wrap_FSPRKStepGetLastStep(void *farg1, double *farg2) { } -SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepGetNumStepAttempts(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod/farkode_sprkstep_mod.f90 b/src/arkode/fmod/farkode_sprkstep_mod.f90 index a6cc16db19..82217e7b1b 100644 --- a/src/arkode/fmod/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod/farkode_sprkstep_mod.f90 @@ -36,9 +36,6 @@ module farkode_sprkstep_mod integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36 public :: FSPRKStepCreate public :: FSPRKStepReInit - public :: FSPRKStepReset - public :: FSPRKStepRootInit - public :: FSPRKStepSetDefaults public :: FSPRKStepSetUseCompensatedSums public :: FSPRKStepSetMethod type, bind(C) :: SwigArrayWrapper @@ -46,6 +43,13 @@ module farkode_sprkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FSPRKStepSetMethodName + public :: FSPRKStepGetCurrentMethod + public :: FSPRKStepGetNumRhsEvals + public :: FSPRKStepReset + public :: FSPRKStepRootInit + public :: FSPRKStepSetRootDirection + public :: FSPRKStepSetNoInactiveRootWarn + public :: FSPRKStepSetDefaults public :: FSPRKStepSetOrder public :: FSPRKStepSetInterpolantType public :: FSPRKStepSetInterpolantDegree @@ -58,12 +62,10 @@ module farkode_sprkstep_mod public :: FSPRKStepEvolve public :: FSPRKStepGetDky public :: FSPRKStepGetReturnFlagName - public :: FSPRKStepGetCurrentMethod public :: FSPRKStepGetCurrentState public :: FSPRKStepGetCurrentStep public :: FSPRKStepGetCurrentTime public :: FSPRKStepGetLastStep - public :: FSPRKStepGetNumRhsEvals public :: FSPRKStepGetNumStepAttempts public :: FSPRKStepGetNumSteps public :: FSPRKStepGetRootInfo @@ -99,45 +101,75 @@ function swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepReset(farg1, farg2, farg3) & -bind(C, name="_wrap_FSPRKStepReset") & +function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -real(C_DOUBLE), intent(in) :: farg2 -type(C_PTR), value :: farg3 +integer(C_INT), intent(in) :: farg2 integer(C_INT) :: fresult end function -function swigc_FSPRKStepRootInit(farg1, farg2, farg3) & -bind(C, name="_wrap_FSPRKStepRootInit") & +function swigc_FSPRKStepSetMethod(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetMethod") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg2 integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetDefaults(farg1) & -bind(C, name="_wrap_FSPRKStepSetDefaults") & +function swigc_FSPRKStepSetMethodName(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetMethodName") & result(fresult) use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & +function swigc_FSPRKStepGetCurrentMethod(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetCurrentMethod") & +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_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & +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_FSPRKStepReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepRootInit") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetMethod(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetMethod") & +function swigc_FSPRKStepSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetRootDirection") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -145,13 +177,19 @@ function swigc_FSPRKStepSetMethod(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetMethodName(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetMethodName") & +function swigc_FSPRKStepSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FSPRKStepSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetDefaults(farg1) & +bind(C, name="_wrap_FSPRKStepSetDefaults") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigarraywrapper type(C_PTR), value :: farg1 -type(SwigArrayWrapper) :: farg2 integer(C_INT) :: fresult end function @@ -273,15 +311,6 @@ function swigc_FSPRKStepGetReturnFlagName(farg1) & type(SwigArrayWrapper) :: fresult end function -function swigc_FSPRKStepGetCurrentMethod(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepGetCurrentMethod") & -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_FSPRKStepGetCurrentState(farg1, farg2) & bind(C, name="_wrap_FSPRKStepGetCurrentState") & result(fresult) @@ -318,16 +347,6 @@ function swigc_FSPRKStepGetLastStep(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & -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_FSPRKStepGetNumStepAttempts(farg1, farg2) & bind(C, name="_wrap_FSPRKStepGetNumStepAttempts") & result(fresult) @@ -457,6 +476,108 @@ function FSPRKStepReInit(arkode_mem, f1, f2, t0, y0) & swig_result = fresult end function +function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetMethod(arkode_mem, sprk_storage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: sprk_storage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = sprk_storage +fresult = swigc_FSPRKStepSetMethod(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FSPRKStepSetMethodName(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: method +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(method, farg2_chars, farg2) +fresult = swigc_FSPRKStepSetMethodName(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetCurrentMethod(arkode_mem, sprk_storage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: sprk_storage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(sprk_storage) +fresult = swigc_FSPRKStepGetCurrentMethod(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nf1 +integer(C_LONG), dimension(*), target, intent(inout) :: nf2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nf1(1)) +farg3 = c_loc(nf2(1)) +fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + function FSPRKStepReset(arkode_mem, tr, yr) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -495,83 +616,45 @@ function FSPRKStepRootInit(arkode_mem, nrtfn, g) & swig_result = fresult end function -function FSPRKStepSetDefaults(arkode_mem) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT) :: fresult -type(C_PTR) :: farg1 - -farg1 = arkode_mem -fresult = swigc_FSPRKStepSetDefaults(farg1) -swig_result = fresult -end function - -function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & +function FSPRKStepSetRootDirection(arkode_mem, rootdir) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: onoff +integer(C_INT), dimension(*), target, intent(inout) :: rootdir integer(C_INT) :: fresult type(C_PTR) :: farg1 -integer(C_INT) :: farg2 +type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = onoff -fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) +farg2 = c_loc(rootdir(1)) +fresult = swigc_FSPRKStepSetRootDirection(farg1, farg2) swig_result = fresult end function -function FSPRKStepSetMethod(arkode_mem, sprk_storage) & +function FSPRKStepSetNoInactiveRootWarn(arkode_mem) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -type(C_PTR) :: sprk_storage integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(C_PTR) :: farg2 farg1 = arkode_mem -farg2 = sprk_storage -fresult = swigc_FSPRKStepSetMethod(farg1, farg2) +fresult = swigc_FSPRKStepSetNoInactiveRootWarn(farg1) swig_result = fresult end function - -subroutine SWIG_string_to_chararray(string, chars, wrap) - use, intrinsic :: ISO_C_BINDING - character(kind=C_CHAR, len=*), intent(IN) :: string - character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars - type(SwigArrayWrapper), intent(OUT) :: wrap - integer :: i - - allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) - do i=1,len(string) - chars(i) = string(i:i) - end do - i = len(string) + 1 - chars(i) = C_NULL_CHAR ! C string compatibility - wrap%data = c_loc(chars) - wrap%size = len(string) -end subroutine - -function FSPRKStepSetMethodName(arkode_mem, method) & +function FSPRKStepSetDefaults(arkode_mem) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -character(kind=C_CHAR, len=*), target :: method -character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars integer(C_INT) :: fresult type(C_PTR) :: farg1 -type(SwigArrayWrapper) :: farg2 farg1 = arkode_mem -call SWIG_string_to_chararray(method, farg2_chars, farg2) -fresult = swigc_FSPRKStepSetMethodName(farg1, farg2) +fresult = swigc_FSPRKStepSetDefaults(farg1) swig_result = fresult end function @@ -794,22 +877,6 @@ function FSPRKStepGetReturnFlagName(flag) & if (.false.) call SWIG_free(fresult%data) end function -function FSPRKStepGetCurrentMethod(arkode_mem, sprk_storage) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_PTR), target, intent(inout) :: sprk_storage -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(sprk_storage) -fresult = swigc_FSPRKStepGetCurrentMethod(farg1, farg2) -swig_result = fresult -end function - function FSPRKStepGetCurrentState(arkode_mem, state) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -874,25 +941,6 @@ function FSPRKStepGetLastStep(arkode_mem, hlast) & swig_result = fresult end function -function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nf1 -integer(C_LONG), dimension(*), target, intent(inout) :: nf2 -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nf1(1)) -farg3 = c_loc(nf2(1)) -fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FSPRKStepGetNumStepAttempts(arkode_mem, step_attempts) & result(swig_result) use, intrinsic :: ISO_C_BINDING From c64bec60e7b1fa09ca02fcd78a7f27d0738d0e59 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Sat, 11 May 2024 23:29:56 -0400 Subject: [PATCH 037/137] Feature: New Low Order Methods (#439) - Adds new 1st-3rd order MRI methods. Most are from the literature, but the rest are trivial to derive, e.g., Euler-based schemes. - Adds some of the base ERK and IRK method tables too. Note that some cannot be equipped with reasonable embeddings. - Fixes an MRI reallocation bug when switching coupling coefficients to one with more stages - Fixes a workspace size bug for MRIStep - Makes `MRIStepSetOrder` consistent with `ARKStepSetOrder` and `ERKStepSetOrder` so that a negative value sets the default order and a positive value out of range prints an error (when method initialization occurs not when `SetOrder` is called). --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 18 + doc/arkode/guide/source/Butcher.rst | 193 +++++++++++ doc/arkode/guide/source/Constants.rst | 63 ++++ .../MRIStep_c_interface/MRIStepCoupling.rst | 52 +-- doc/shared/RecentChanges.rst | 20 ++ .../backward_euler_dirk_stab_region.png | Bin 0 -> 22474 bytes ...xplicit_midpoint_euler_erk_stab_region.png | Bin 0 -> 26029 bytes .../arkode/forward_euler_erk_stab_region.png | Bin 0 -> 21530 bytes .../implicit_midpoint_dirk_stab_region.png | Bin 0 -> 17997 bytes .../implicit_trapezoidal_dirk_stab_region.png | Bin 0 -> 18255 bytes .../arkode/ralston_euler_erk_stab_region.png | Bin 0 -> 25417 bytes doc/shared/sundials.bib | 45 +++ include/arkode/arkode_arkstep.h | 2 + include/arkode/arkode_butcher_dirk.h | 5 +- include/arkode/arkode_butcher_erk.h | 5 +- include/arkode/arkode_erkstep.h | 1 + include/arkode/arkode_mristep.h | 23 +- src/arkode/arkode_arkstep.c | 2 + src/arkode/arkode_butcher_dirk.def | 46 ++- src/arkode/arkode_butcher_erk.def | 95 +++-- src/arkode/arkode_erkstep.c | 1 + src/arkode/arkode_mri_tables.def | 178 +++++++++- src/arkode/arkode_mristep.c | 185 +++++----- src/arkode/arkode_mristep_io.c | 2 +- src/arkode/fmod/farkode_mod.f90 | 15 +- src/arkode/fmod/farkode_mristep_mod.f90 | 23 +- test/answers | 2 +- .../CXX_serial/ark_test_dahlquist_ark_0_0.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_0_1.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_1_0.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_1_1.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_2_0.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_ark_2_1.out | 222 ++++++++++++ .../CXX_serial/ark_test_dahlquist_erk_0.out | 105 ++++++ .../CXX_serial/ark_test_dahlquist_erk_1.out | 105 ++++++ .../CXX_serial/ark_test_dahlquist_mri.cpp | 82 ++--- .../CXX_serial/ark_test_dahlquist_mri.out | 327 +++++++++++++++++- 37 files changed, 2706 insertions(+), 221 deletions(-) create mode 100644 doc/shared/figs/arkode/backward_euler_dirk_stab_region.png create mode 100644 doc/shared/figs/arkode/explicit_midpoint_euler_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/forward_euler_erk_stab_region.png create mode 100644 doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png create mode 100644 doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png create mode 100644 doc/shared/figs/arkode/ralston_euler_erk_stab_region.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 45619e61e3..c27937e5a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,24 @@ Added "Resize" capability, as well as missing `SetRootDirection` and Deprecated `ARKStepSetOptimalParams` function; added instructions to user guide for users who wish to retain the current functionality. +Added the following Runge-Kutta Butcher tables +* `ARKODE_FORWARD_EULER_1_1` +* `ARKODE_RALSTON_EULER_2_1_2` +* `ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2` +* `ARKODE_BACKWARD_EULER_1_1` +* `ARKODE_IMPLICIT_MIDPOINT_1_2` +* `ARKODE_IMPLICIT_TRAPEZOIDAL_2_2` + +Added the following MRI coupling tables +* `ARKODE_MRI_GARK_FORWARD_EULER` +* `ARKODE_MRI_GARK_RALSTON2` +* `ARKODE_MRI_GARK_RALSTON3` +* `ARKODE_MRI_GARK_BACKWARD_EULER` +* `ARKODE_MRI_GARK_IMPLICIT_MIDPOINT` +* `ARKODE_IMEX_MRI_GARK_EULER` +* `ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL` +* `ARKODE_IMEX_MRI_GARK_MIDPOINT` + Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index 015b500a04..3d44dbecdc 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -150,6 +150,37 @@ specified via a unique ID and name: with values specified for each method below (e.g., ``ARKODE_HEUN_EULER_2_1_2``). +.. _Butcher.Forward_Euler: + +Forward-Euler-1-1 +^^^^^^^^^^^^^^^^^ + +.. index:: Forward-Euler-1-1 ERK method + +Accessible via the constant ``ARKODE_FORWARD_EULER_1_1`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_FORWARD_EULER_1_1"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName`. +This is the default 1st order explicit method (from :cite:p:`Euler:68`). + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|c} + 0 & 0 \\ + \hline + 1 & 1 + \end{array} + +.. figure:: /figs/arkode/forward_euler_erk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the forward Euler method. + + .. _Butcher.Heun_Euler: Heun-Euler-2-1-2 @@ -184,6 +215,74 @@ This is the default 2nd order explicit method. region is outlined in blue; the embedding's region is in red. +.. _Butcher.Ralston_Euler: + +Ralston-Euler-2-1-2 +^^^^^^^^^^^^^^^^^^^^ + +.. index:: Ralston-Euler-2-1-2 ERK method + +Accessible via the constant ``ARKODE_RALSTON_EULER_2_1_2`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_RALSTON_EULER_2_1_2"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName` +(primary method from :cite:p:`Ralston:62`). + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cc} + 0 & 0 & 0 \\ + \frac{2}{3} & \frac{2}{3} & 0 \\ + \hline + 2 & \frac{1}{4} & \frac{3}{4} \\ + 1 & 1 & 0 + \end{array} + +.. figure:: /figs/arkode/ralston_euler_erk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the Ralston-Euler method. The method's + region is outlined in blue; the embedding's region is in red. + + +.. _Butcher.Explicit_Midpoint_Euler: + +Explicit-Midpoint-Euler-2-1-2 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. index:: Explicit-Midpoint-Euler-2-1-2 ERK method + +Accessible via the constant ``ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2`` to +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadERK`. +Accessible via the string ``"ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2"`` to +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadERKByName` +(primary method from :cite:p:`Runge:95`). + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cc} + 0 & 0 & 0 \\ + \frac{1}{2} & \frac{1}{2} & 0 \\ + \hline + 2 & 0 & 1 \\ + 1 & 1 & 0 + \end{array} + +.. figure:: /figs/arkode/explicit_midpoint_euler_erk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the Explicit-Midpoint-Euler method. The method's + region is outlined in blue; the embedding's region is in red. + + .. _Butcher.ARK2_ERK: ARK2-ERK-3-1-2 @@ -1123,6 +1222,37 @@ specified via a unique ID and name: with values specified for each method below (e.g., ``ARKODE_SDIRK_2_1_2``). +.. _Butcher.Backward-Euler: + +Backward-Euler-1-1 +^^^^^^^^^^^^^^^^^^ + +.. index:: Backward-Euler-1-1 method + +Accessible via the constant ``ARKODE_BACKWARD_EULER_1_1`` to +:c:func:`ARKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadDIRK`. +Accessible via the string ``"ARKODE_BACKWARD_EULER_1_1"`` to +:c:func:`ARKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadDIRKByName`. +This is the default 1st order implicit method. The method is A-, L-, and B-stable. + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|c} + 1 & 1 \\ + \hline + 1 & 1 + \end{array} + +.. figure:: /figs/arkode/backward_euler_dirk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the backward Euler method. + + .. _Butcher.SDIRK-2-1: SDIRK-2-1-2 @@ -1194,6 +1324,69 @@ implicit portion of the ARK2 method from :cite:p:`giraldo2013implicit`). region is outlined in blue; the embedding's region is in red. +.. _Butcher.Implicit_Midpoint: + +Implicit-Midpoint-1-2 +^^^^^^^^^^^^^^^^^^^^^ + +.. index:: Implicit-Midpoint-1-2 method + +Accessible via the constant ``ARKODE_IMPLICIT_MIDPOINT_1_2`` to +:c:func:`ARKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadDIRK`. +Accessible via the string ``"ARKODE_IMPLICIT_MIDPOINT_1_2"`` to +:c:func:`ARKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadDIRKByName`. +The method is A- and B-stable. + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|c} + \frac{1}{2} & \frac{1}{2} \\ + \hline + 2 & 1 + \end{array} + +.. figure:: /figs/arkode/implicit_midpoint_dirk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the implicit midpoint method. + + +.. _Butcher.Implicit_Trapezoidal: + +Implicit-Trapezoidal-2-2 +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. index:: Implicit-Trapezoidal-2-2 method + +Accessible via the constant ``ARKODE_IMPLICIT_TRAPEZOIDAL_2_2`` to +:c:func:`ARKStepSetTableNum` or +:c:func:`ARKodeButcherTable_LoadDIRK`. +Accessible via the string ``"ARKODE_IMPLICIT_TRAPEZOIDAL_2_2"`` to +:c:func:`ARKStepSetTableName` or +:c:func:`ARKodeButcherTable_LoadDIRKByName`. +The method is A-stable. + +.. math:: + + \renewcommand{\arraystretch}{1.5} + \begin{array}{r|cc} + 0 & 0 & 0 \\ + 1 & \frac{1}{2} & \frac{1}{2} \\ + \hline + 2 & \frac{1}{2} & \frac{1}{2} + \end{array} + +.. figure:: /figs/arkode/implicit_trapezoidal_dirk_stab_region.png + :scale: 50 % + :align: center + + Linear stability region for the implicit trapezoidal method. + + .. _Butcher.Billington: Billington-3-3-2 diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 69affcfaa9..088dbbdda8 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -74,8 +74,16 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | **Explicit Butcher table specification** | | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_FORWARD_EULER_1_1` | Use the Forward-Euler-1-1 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_HEUN_EULER_2_1_2` | Use the Heun-Euler-2-1-2 ERK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_RALSTON_EULER_2_1_2` | Use the Ralston-Euler-2-1-2 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2` | Use the Explicit-Midpoint-Euler-2-1-2 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_ARK2_ERK_3_1_2` | Use the ARK2-ERK-3-1-2 ERK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_BOGACKI_SHAMPINE_4_2_3` | Use the Bogacki-Shampine-4-2-3 ERK method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_ARK324L2SA_ERK_4_2_3` | Use the ARK-4-2-3 ERK method. | @@ -116,6 +124,9 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_VERNER_16_8_9` | Use the Verner-16-8-9 ERK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKSTEP_DEFAULT_ERK_1` | Use ARKStep's default first-order ERK method | + | | (ARKODE_FORWARD_EULER_1_1). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKSTEP_DEFAULT_ERK_2` | Use ARKStep's default second-order ERK method | | | (ARKODE_HEUN_EULER_2_1_2). | +-----------------------------------------------+------------------------------------------------------------+ @@ -140,6 +151,9 @@ contains the ARKODE output constants. | :index:`ARKSTEP_DEFAULT_ERK_9` | Use ARKStep's default ninth-order ERK method | | | (ARKODE_VERNER_16_8_9). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ERKSTEP_DEFAULT_1` | Use ERKStep's default first-order ERK method | + | | (ARKODE_FORWARD_EULER_1_1). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ERKSTEP_DEFAULT_2` | Use ERKStep's default second-order ERK method | | | (ARKODE_HEUN_EULER_2_1_2). | +-----------------------------------------------+------------------------------------------------------------+ @@ -168,8 +182,16 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | **Implicit Butcher table specification** | | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_BACKWARD_EULER_1_1` | Use the Backward-Euler-1-1 SDIRK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_SDIRK_2_1_2` | Use the SDIRK-2-1-2 SDIRK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_ARK2_DIRK_3_1_2` | Use the ARK2-DIRK-3-1-2 SDIRK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMPLICIT_MIDPOINT_1_2` | Use the Implicit-Midpoint-1-2 SDIRK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMPLICIT_TRAPEZOIDAL_2_2` | Use the Implicit-Trapezoidal-2-2 ESDIRK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_BILLINGTON_3_3_2` | Use the Billington-3-3-2 SDIRK method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_ESDIRK324L2SA_4_2_3` | Use the ESDIRK324L2SA-4-2-3 ESDIRK method. | @@ -214,6 +236,9 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_ESDIRK547L2SA2_7_4_5` | Use the ESDIRK547L2SA2-7-4-5 ESDIRK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKSTEP_DEFAULT_DIRK_1` | Use ARKStep's default first-order DIRK method | + | | (ARKODE_BACKWARD_EULER_1_1). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKSTEP_DEFAULT_DIRK_2` | Use ARKStep's default second-order DIRK method | | | (ARKODE_SDIRK_2_1_2). | +-----------------------------------------------+------------------------------------------------------------+ @@ -230,6 +255,9 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | **ImEx Butcher table specification** | | +-----------------------------------------------+------------------------------------------------------------+ + | ARKODE_ARK2_ERK_3_1_2 & | Use the :index:`ARK-3-1-2 ARK method`. | + | ARKODE_ARK2_DIRK_3_1_2 | | + +-----------------------------------------------+------------------------------------------------------------+ | ARKODE_ARK324L2SA_ERK_4_2_3 & | Use the :index:`ARK-4-2-3 ARK method`. | | ARKODE_ARK324L2SA_DIRK_4_2_3 | | +-----------------------------------------------+------------------------------------------------------------+ @@ -299,30 +327,59 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | **MRI coupling table specification** | | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_FORWARD_EULER` | Use the forward Euler MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_ERK22b` | Use the ERK22b MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_ERK22a` | Use the ERK22a MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_RALSTON2` | Use the second order Ralston MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MIS_MW3` | Use the Knoth-Wolke-3 MIS method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ERK33a` | Use the ERK33a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_RALSTON3` | Use the third order Ralston MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ERK45a` | Use the ERK45a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_BACKWARD_EULER` | Use the backward Euler MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_IRK21a` | Use the IRK21a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_IMPLICIT_MIDPOINT` | Use the implicit midpoint MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ESDIRK34a` | Use the ESDIRK34a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ESDIRK46a` | Use the ESDIRK46a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMEX_MRI_GARK_EULER` | Use the Euler IMEX-MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL` | Use the trapezoidal rule IMEX-MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMEX_MRI_GARK_MIDPOINT` | Use the midpoint rule IMEX-MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_IMEX_MRI_GARK3a` | Use the IMEX-MRI-GARK3a method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_IMEX_MRI_GARK3b` | Use the IMEX-MRI-GARK3b method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_IMEX_MRI_GARK4` | Use the IMEX-MRI-GARK4 method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_EXPL_TABLE_1` | Use MRIStep's default 1st-order explicit method | + | | (MRI_GARK_FORWARD_EULER). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_EXPL_TABLE_2` | Use MRIStep's default 2nd-order explicit method | + | | (MRI_GARK_ERK22b). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_DEFAULT_EXPL_TABLE_3` | Use MRIStep's default 3rd-order explicit method | | | (MIS_MW3). | +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_DEFAULT_EXPL_TABLE_4` | Use MRIStep's default 4th-order explicit method | | | (MRI_GARK_ERK45a). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_1` | Use MRIStep's default 1st-order solve-decoupled implicit | + | | method (MRI_GARK_BACKWARD_EULER). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_2` | Use MRIStep's default 2nd-order solve-decoupled implicit | | | method (MRI_GARK_IRK21a). | +-----------------------------------------------+------------------------------------------------------------+ @@ -332,6 +389,12 @@ contains the ARKODE output constants. | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_4` | Use MRIStep's default 4th-order solve-decoupled implicit | | | method (MRI_GARK_ESDIRK46a). | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_1` | Use MRIStep's default 1st-order solve-decoupled ImEx | + | | method (IMEX_MRI_GARK_EULER). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_2` | Use MRIStep's default 2nd-order solve-decoupled ImEx | + | | method (ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL). | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_3` | Use MRIStep's default 3rd-order solve-decoupled ImEx | | | method (IMEX_MRI_GARK3b). | +-----------------------------------------------+------------------------------------------------------------+ diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst index cb8a725b4d..a948bd6dbb 100644 --- a/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst @@ -304,36 +304,46 @@ with values specified for each method below (e.g., ``ARKODE_MIS_KW3``). .. table:: Explicit MRI-GARK coupling tables. The default method for each order is marked with an asterisk (:math:`^*`). - ========================== =========== ===================== - Table name Order Reference - ========================== =========== ===================== - ``ARKODE_MIS_KW3`` :math:`3^*` :cite:p:`Schlegel:09` - ``ARKODE_MRI_GARK_ERK33a`` 3 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_ERK45a`` :math:`4^*` :cite:p:`Sandu:19` - ========================== =========== ===================== + ================================= =========== ===================== + Table name Order Reference + ================================= =========== ===================== + ``ARKODE_MRI_GARK_FORWARD_EULER`` :math:`1^*` + ``ARKODE_MRI_GARK_ERK22b`` :math:`2^*` :cite:p:`Sandu:19` + ``ARKODE_MRI_GARK_ERK22a`` 2 :cite:p:`Sandu:19` + ``ARKODE_MRI_GARK_RALSTON2`` 2 :cite:p:`Roberts:22` + ``ARKODE_MIS_KW3`` :math:`3^*` :cite:p:`Schlegel:09` + ``ARKODE_MRI_GARK_ERK33a`` 3 :cite:p:`Sandu:19` + ``ARKODE_MRI_GARK_RALSTON3`` 3 :cite:p:`Roberts:22` + ``ARKODE_MRI_GARK_ERK45a`` :math:`4^*` :cite:p:`Sandu:19` + ================================= =========== ===================== .. table:: Diagonally-implicit, solve-decoupled MRI-GARK coupling tables. The default method for each order is marked with an asterisk (:math:`^*`). - ============================= =========== =============== ================== - Table name Order Implicit Solves Reference - ============================= =========== =============== ================== - ``ARKODE_MRI_GARK_IRK21a`` :math:`2^*` 1 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_ESDIRK34a`` :math:`3^*` 3 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_ESDIRK46a`` :math:`4^*` 5 :cite:p:`Sandu:19` - ============================= =========== =============== ================== + ===================================== =========== =============== ================== + Table name Order Implicit Solves Reference + ===================================== =========== =============== ================== + ``ARKODE_MRI_GARK_BACKWARD_EULER`` :math:`1^*` 1 + ``ARKODE_MRI_GARK_IRK21a`` :math:`2^*` 1 :cite:p:`Sandu:19` + ``ARKODE_MRI_GARK_IMPLICIT_MIDPOINT`` 2 2 + ``ARKODE_MRI_GARK_ESDIRK34a`` :math:`3^*` 3 :cite:p:`Sandu:19` + ``ARKODE_MRI_GARK_ESDIRK46a`` :math:`4^*` 5 :cite:p:`Sandu:19` + ===================================== =========== =============== ================== .. table:: Diagonally-implicit, solve-decoupled IMEX-MRI-GARK coupling tables. The default method for each order is marked with an asterisk (:math:`^*`). - =========================== =========== =============== =================== - Table name Order Implicit Solves Reference - =========================== =========== =============== =================== - ``ARKODE_IMEX_MRI_GARK3a`` :math:`3^*` 2 :cite:p:`ChiRen:21` - ``ARKODE_IMEX_MRI_GARK3b`` 3 2 :cite:p:`ChiRen:21` - ``ARKODE_IMEX_MRI_GARK4`` :math:`4^*` 5 :cite:p:`ChiRen:21` - =========================== =========== =============== =================== + ==================================== =========== =============== =================== + Table name Order Implicit Solves Reference + ==================================== =========== =============== =================== + ``ARKODE_IMEX_MRI_GARK_EULER`` :math:`1^*` 1 + ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` :math:`2^*` 1 + ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` 2 2 + ``ARKODE_IMEX_MRI_GARK3a`` :math:`3^*` 2 :cite:p:`ChiRen:21` + ``ARKODE_IMEX_MRI_GARK3b`` 3 2 :cite:p:`ChiRen:21` + ``ARKODE_IMEX_MRI_GARK4`` :math:`4^*` 5 :cite:p:`ChiRen:21` + ==================================== =========== =============== =================== diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 9212d1ff37..ef560561bf 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -15,6 +15,26 @@ for users who wish to retain the current functionality. Added CMake infrastructure that enables externally maintained addons/plugins to be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. +Added the following Runge-Kutta Butcher tables + +* ``ARKODE_FORWARD_EULER_1_1`` +* ``ARKODE_RALSTON_EULER_2_1_2`` +* ``ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2`` +* ``ARKODE_BACKWARD_EULER_1_1`` +* ``ARKODE_IMPLICIT_MIDPOINT_1_2`` +* ``ARKODE_IMPLICIT_TRAPEZOIDAL_2_2`` + +Added the following MRI coupling tables + +* ``ARKODE_MRI_GARK_FORWARD_EULER`` +* ``ARKODE_MRI_GARK_RALSTON2`` +* ``ARKODE_MRI_GARK_RALSTON3`` +* ``ARKODE_MRI_GARK_BACKWARD_EULER`` +* ``ARKODE_MRI_GARK_IMPLICIT_MIDPOINT`` +* ``ARKODE_IMEX_MRI_GARK_EULER`` +* ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` +* ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` + **Bug Fixes** Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous diff --git a/doc/shared/figs/arkode/backward_euler_dirk_stab_region.png b/doc/shared/figs/arkode/backward_euler_dirk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..388c85f0e0906ea013c5c301dd0859869780779a GIT binary patch literal 22474 zcmd?RbyQXB+cmriNokc3VUq?eDBT@`lpxZAgn)nu(ntu3GzbPIC7^V-Af18;NGjbe z4ezz|ob#OL_q^{I-}l!$#`o<p)D7;v)}7ZiuQ}(vp50WHCnBIBK%r1XiV89sC=}Lx z6bdsO4-<Y9y8S2<{=v6bxcv}?q9jNDU|1yf!lzKUPKq~Vap$lJ$XM9#^Pt|tub7== zb)7UH+;eg<aWqHWkknF<lwwC~S(>A7m^fMLJaD}KkR7dPcb8K{ca#b~&xm|p+R@y^ z$?Aa}TFc7T9L2-UA!+Z(ah3ZjADV|-h?if8j}Hesffj{AqZDN%wI07+8g+eqM*H2) zdX%cvc_|-#Drau{Cn(}KK{D5|8tx4~btqeTLGhTh9!*jZqHiQ2t3^ev!~Cx05;}$d z=_eDjGfW3G3TXcpY=*Y0q-Qwq<0)2*i(9AL4UNt_J<@Tp9q*13uVCvR%}~=$+~3aB z%t#rrD}}bAFlTxyk$<_V$(iAwuMCnfLJ}ALZ~PEXRZVDoJ0>PZDkv^a;cH&|wA;zi zPTDYW;ACm-k!=r&dZh@algB*XVEMyY{&5ec(UqQL=|nNlEe<ub-B?w*RbP60ESIuy zIjQMjo=N8${((}h2#X)0eU_DJCfP!f%OZz84kSF^16d;9LHEbZ^FrV7Kj6Gm!p_FF zSoZ{LdU{$aXl`x}hlpn6VYle=a49|Sy$;cx5vE*^<?q+5E-=VQNlAUwEB5soy;Eu@ z7_T~C(l=k_x_J+2n|^~!a>@H|Yn9_iD<4b8BJI>(U7haaAOBh^a!s%BUMGc`h{MtT zqv?9C+C#^lBuO&125Ayer|kvpumIvfCNZ%Z+u;)Fr>Ex!a*eQ`oBR;vEgS8fbyi;( zDx5vs+w{8>mYk)hExc-QvDmu*d2n#HL8bG_@sazlrJ-bL+{D~>9uqI9d2votP0R{5 z*6y4TUl4jhCt3jweIovb)b#jp50{uWe3etbtmlB*Y4$`nWs=Uc;<~=Fon>lKQPIQM zF0U-N-L)TW+s!YinNHY*g@vPIUyAEU;brtuw@H8H99T1W&yjUa<<(VLFBi>pl`oY7 z*94rGbe)`vc505MV~ykrsEE#A-x~k0y)s%^RKz#Zn75WdJz{rz(s|ty3(Mkd)~(?# z+=AShnHjg*@Qo+*9&1msW@&|;ZEoMb?bChTb;E4>uFgljGy_|!){}g>X3@|3wq+%A z?gJgW>yv~81Y4Z4NwmbxYd;#&hM&CkRj(9dhdIBYt*za=T)A3v5I|`dUbEw}{9Sv% z(e-=r{Q*A`vE6<hqj>{T-H@5(!yJRkm5Rlj7&aa2$3M5D)Wj5(l=P||JA~X9TmMY4 zTD2MK;j+EZA11O9bgR*4n(S23dbjuSW?{EjlwEUkGnYYyQ%4*Re4_Hv;<pmp;ZQo! z*D*0^5Aa1lfBt;9o$F0BzMq#`UoW-y3mVMiI#VIkEwb4W&LHhi3bX1x9iwyo!5BM7 zcWdk3dNcibKFg&0^Go+f${ecQwl{R+qN7vgZ}U-@3Ul?hu1_{|>6hi*AIPD&sM>O( zq^9<uC+X9B^^~vYtlFY4_r`@hsM(t-9x$wQnvX2<*xQ)C#@aG|IKz*Ost1fgF^T9_ z_;<{@E`{*#gSFnZ9_~wn`EadhyMZiiHV))vJJaz>{CGE|$bP86-1YZsLwd|@@ngt& zex=gpkn<Od@y=hj8O*=i3?YLPx<A*G+}751-S+#4*TJ&q!7tCl_2$KI9~U!3<iqHW zCh1Sg+;>(M2XZq~Q$_ZsqS}%LrGnbpl=h}%ZEThb%-auZC0Doadr-2lund>jMy;f0 zWVoL(KHA^jXuI1S8Y3m)W9{KmaCESfd%JK3#_(WgH5b<TK#qa1%gW*K_;JaNH`h0W z#yvJW*>bBGM^#l+w60gud+jE7mrfX*Zw{mP-tN~awH<bz?@cqTc1z31$Vf|bJu}l5 z!{&WBN&nE%5k~Dzf~b2a6_06es$ze&y!M^(N)e5-%cGS$^#O!YtT%)__ltHa!?DX4 zQnLnYJS(frI$vMwwMz^S&vTmBaCJpLGQ9hW-)69<(4u?cihL%F!^ZpO&<ny>c$Ewd z6W%)b9q=JzvAfnlLP$tRazV&xx-CXEUI;d>HAE(4Vj6xtU?iOHV;IfR$sL2+8gLF2 zS@lghifw<@>|H+3Z`aa(QT6Sm+WXVa5wW<(oS3<W+Lh)L5Sq3I?}lmbjHAVzjxUIL zJnqlZ?lp87wk>_MI#&H)yoQ2R<>t0xrbDh~f0z5_`zZ0Fd9|pEYMg9rQ7gzQhX_-? zTr!O5T3Z0)Bf3_H)w_HP_FP7Wa%nF7X7L+`I94CM`%->?wobcCVL^e{cDB)}jpt*J z9#7Og5kLGvBJ8|m`R&6{o=L;K&ez%*suvhO&vd?t<ua;)$xpxWCOtj9>-Dv4hsmZf zHQmV)!nL4zhVbjR$&I5}>VKK=@Kmd%-1%&Dyg^y6q^Y5im6dh);R9{=kL6L9@t9l6 z3JUM-;y-_unQq|?V?e|D-=_OeV)=#9oLY(=_x5CEI0;t$z;4D^wR`)CsPj@>;sU|X z(elxif`WoTdapr?p?4`MiS8?cuALBQHI8*4^hT>)HL1tmGiv)JO((nGZgfmeNjbZI z<w4c@(~V3eC8a81V;ETG(%qjKcP%l;_s6F94#rP%*uyr~Xt$o;ycH1ml<0ic$4#2{ zD(KXL($5^Pn>y<15gW3~N=m-jYNf*l+S=D1Eqq;|(=aq#IXXAh3}N=B;aI9-l&>$Q zl`AZ&)Bpzu2S<vC_;`-o4<i`S5U}4d7OyhaEofKX*`Kw@i^nad7ZOhyX=`tfNz;aP z@?-qu*d;6mEA!>Td+S-OObT<#q?>%l$Mm|Rwb8{_{NKZCg#jX5k_W$#kX}EjbC{5R zv2~1mvCGon`p?GThcg}Px?>-17eZ`z712fybA~hBBegBKV;+^Z9N0($fniO+3AW;m zc%kjdF!5im3b$g=@v0V%jvJ6!VaI(?QGNF88O-d<Z(3fDVPNmxz3VAfSm60W!q=&C zbhOeXR(bnqXS}`p7xMT0U(3S--lI6{D<gJ0EfGvdXVmcWjXz;pb&^t;J(6`4ir;9Y zg=pO$QWKj?f2M}q42|qPxCPxciv6c}%#t{UvrnRj)J&oS8>o5j*+68RYzl$w(Doya z?t#3vXT|8sLMR)#IQ~ZYY(f+ztP81Eru3d$>U&0z2qVsQ#qmfR4pzInxCTaqd2{F$ z;r%qg)~J?TdU<@gv_1N=<~LVC*xg0xPw_Q|NM+^aT~^0L1qE-HZ`61mOvOkKEsk6n zc3l-(f0Y%JYz6`IiAY|B_ecG54cOOj^+%;&U%Ssb9vTvIv{cxASbLv@?$O+4uTc4? zb#5ekX`U)u{>s`S@!d>u;>ODv`g8ZulGf?oC&ywgxsW27>Agj`xYP`J`T1R-Uu`vs z774ERCTm-9cjx;u+5@Ru8-pn|H8rQ@&F|e)YLB6(V~|Oa3#mEWXop<_0djkJSjTXz z{Gr8Orj%Ovld9m34wb#yw$+EqFWDnvbM?!6y&GZlqf;VauEsrgM&WA(1y`pBegdrd z`O|bqjpUx9qGDStF|#BA!_S{T#~x3HynFXfJNwq<+FeMGxAeRrbF>Y39xRu(x3_mE zh%S<8Mt@YBK;}s*C^|YCKKc<Na?=aygI~*pp3-N|oI$1u62rzm<l?B3;;-9jSzTC{ z3lr<VKIX6nhyqv1_6W+_KRn#*j_LjdQBj#JxvJ`L)%)ZiNzyM%IlOH*?(N$p^{0?l zTThVCd5J?sQBnO{_x9qzsND`SHvuqUg#S!tf0@Bl4QDZZ#lm+M^9<wQa~xCE%H{lR z<sx;~>s)KjW0k5NtP18X#*jI%T$478plR)0$jh+EGQx4M;?bh@2w#4F{<Wv~9*hxf zEc9nXn4bFbhKim(@zpC==+5oJdzUHOx+!)`2&Z&YN^Ur3+Z6Df<mqDJYw%ihCv1Dm zF2L4`Uc}`m3Ee<5)9Z<diL}kk9IV#rc*(P~vu}AR?B3hVeE&ZD4yU<}QW%}+?-0=Y zX)p{u7GI!6*PkPT>UhK7ebnbS1j7)`h8u@Aa$ml-X9Qi1idBmj($;$n2)Lav=7x&4 zc1!{8yQXi=v)^_&yW@E7iqO4peY*CZbefvKv`vU4wZrRcoYwxYWp`*gO=3pHzE(}_ z!AfOrMWDOKrReqbmCDs$3954=<qtOqcE-JHhnI7pY0eXJAvB8ZCmXS~Wuq$thVC~E z`<Mu@cR4XL4T~$MVc@U3sn>K)z)q#FkocYmIe{(F0`kB{?NoenlXd30XqN5leU<RG z9X6NQ1Mj30H@h$I0(QhEHyJJnJD)b~WeXFEwm1=V|MkJKT%_QAR+iF`@<mU1$Lw+E zC*3nln3hqaSKhFH{B9roLy4x7&-VM)#3#Si+LL3LlF|p`oN8{2cM8lDVGTisJwHKl zygM1z{*vS1XD}BrtpGZ#<W`p5hT-(K6UUvBr7tOgBWdcox`O~$P=urvadB~qQLKs$ z^{R<t)c_Su8lJ`rI7lT_|H^Ns(-g*cMX##Xpmp$)my*e(06ojmC1v)1pbZm0F7vqK z>J(A>9gysFK%25QEwMbTWC-_FiM(?kx%_X+Q7Z~u_YWjp9I5QUP*PNk&|BNs*npbh z1lG4y5OjWPd3Xo<0;oRbmZo-M+Yb4J!XA9ab#q3s6oAdikVT@aQG6f7IN_Bt>57D- z2i^y7Zgzxj^(u2I8VKAev7x?Z9qo8Jzu>Ch7@Nnf-0!0s@SPYgqj1}ivM;lz2=MXo z+eXk|4k>Y??<}N*iD`6EIvnmg>^VzHO2%>;RMD>(a9pdA?;PHPGN85e$cUagXmD^a zf=M3dv5Bd=`WGJzteWHf#l)i}3(4Ad9v9SLpTx8Smg5+;7oY_M{gNV~eLB+4zijz1 zJO9SHD{nrazuOB#RBQcV|AJoJ>u`4+Dz@R$2i*`Z+S&kg$5z!Ro*d4i?z{xBxwSaZ zJ$c6f{Z=)j*(0Pa@lEjI13{Iy0_%;GM$zAgpo)74fGE*xKl9LNdRBxKqeghz;p^m2 zEOXurMO%S*Rr5-tTtm^-N71ns-*OD@>~SRy$YED+2av+v6+hYQu8zH5$xs!bG20&_ zNJ>pjy|Mj~|G`+*&X{}JgEKn0hMsVzarafx<QlP<)y7$z?bRo^bniI{Qq$9w@C!bC zSb}0=!^G<Ad-Zr>7tTwU1}j~1cU@}ENR2o&U)Y$=mRvpCuMGpQ5mP$m*4|w_sHbjs zd3EYypL1?sUOc6EJOf*ht9IIhn`vojf`Wi{pFe+II_@RR#q|K<WB-kj;aYERLAtZ& z&iz^(Kz{WpKp~^=_GsfIES1;?2efR|Z6(?HTGvWirOczwej^EXjX*arva;T*gSo*u z{dgfW!|UW=ycTjmujBL%)yci?1P=Nukx@~+SFh?7S^lsWfC`XF{EgZMzsRe@$wn!> z6U}gcY1kvMVc6m=hXGf<;<cE<U~w67koVDi)Pm{Z0;6~K?Ac!1u)_0g4-UsTmI4SV zqg{##MtFF5#*99Bo>L>=`bOFRz|@xCzcguaMD1071)#>JFnX>XMdfBK7|wXrjKgzN z{L@BI|26ywzm;&+TnWk;kFE|8%O3O|ZjUph&%4dUnF>TSd~^NTvC-(Al~J~x=u4Gy zzGG}z*$`mN<NP<0HSIE=VBy}{QT05wbf0rKm|H#s91$aaaZc3lUdYsgo3M6|8o9g} zJY`1!aT9V?-5e!RP>tg@fg5aSVL>+uS!8ZyG|?yEnGah@X-AodlLUVWM;EUnh%zQ- z?=YYbB3T=U^28B!8|P8&(ei_h&ss2JfTh&c9k%Aw_q2-Jr!^ADHp_l-Uxiodga#lw zmlb_iz1)Qvhc%`;mjS4<_iW}}#yvAUaHjWrXKp6k*ED>??jJ7XFEvnnU#C1+N-!jE z$3U^?&bT-czdyhBBRa8-7j05O2rI$=^_xW?@dc>LnMcPeT^^t*GMYbs{&1&MmG1WT zTuRutEbaD6ChL}PhA&^f^qPoWyl64o6)zPe=DDwM64|sNzS+UMvELT^%_A4jy!3R$ zEqbBpmoWe8r1%|vCp+(Lg}tX*$fnJaq?Y`apbU0EqT9mdz3*i#$}f>xtpD0>?ZN1( zsj2Cd)rB<Dz3l-b_qWf8**Z%NNKfHawQ3xg<Udo`QMj!QKo!O`km!8Ly-u2Go+T(x z+Qx6|B=D&lqGv<}RECOKOG`@aMzb6i9x(WC;BD<M=C(JhXY^%S|6GyS^`?yUI@)iI z5^mW{1cZg_63G_sl0h4{-Nu%yU+H|K;s~bYXs_G*<q6A$iRo-be^Q85k(JnnUVGDk zNzh7jH-@5$%v#A^NruWFW{jw%pK1HHBRx#?LsC0FuoXhGk>|GdUXI7B!teXhf%f<e z@J;h+kzT2wk9SJ1B;Nc55Pt)i`_<zC@1ueJ?M2aVnFf_5Bcqij4LFyTh|gbFx#Udl z`uG;C-L2e-G1-u>D=)KXg`DOd)F_<vFG$bkr&Z|)I8L>!dhJvikNI#(7Hujy#(Qji zk%#K-CUidfF8NG%;_Act<vOSimB)B;jB0ZZ*&n~*vx;<l{uIC(5f%3YL_&*8r*6tF z{{|7yvsl?a(4V8|JJ6sDUW;qH#=wva02COd4XTsmDqj`B<-DzMs5PMGUW5E+S9(Vf zosLx0-##8p_>qXP4n=Y?Z>`9#LK=5-tB@amw&BS8F{km@38z^bQ?}XG+!u^*wxp{$ zMMYYB)0KeLpd5S*HF^wT428v|iwwabAs0m5wl27g{8)eIb?;2>N<3^NNxfZw?`*;b zfNrnbjg-N*byLw}HEPbVUOeCm3%q&Ve|WWc(0Wm1?W((`p)L(2Wo&r(#AXH2-WB!Y zZP)dmvU@)*8DyNCwgB~CR7-f9kiaS0*6k6#q4p7v!SwE3@sq=cVfEed!UHL9H&Vp` zV`_4)j#id#JdrHL{}W*QoijtL3bIHH9zB?aLhhzrCPL`|lLmx?UZwN$)_h+Yji%uQ zZJXgNaaKG@s_JL849qnzW1me)C<_2Uvjt!5Cea&}j%Lun`;va+eAwmpRePDz)0)~k z#(O<U&cl1+-`?B)#v7gD?B67Ozdn_3{~5*S9k>J+7n7e*N(_Y5KR6q8snXtqjsx25 znc%cIn4faB-zo-uR7?2E@jA8Q#Af&@q{4AgRSiwV=z=2Srs{{~^>)%oq-s5FmdvbB zI(*c0{=wr~8GZc`Sce?rF?Z;JX7F|u@h@N)@uEomE;MjO@|OHiboNK69;+?7>85{l z`kjoYsyjzDH#NB(vOkx<ll+$G%Ovv*Z?{N_hjEXsZ{mV>@g3^|gQ*y8&$+{@c)%FD z^lvF@u;-)Xg^ljUGcz+^%1Bt>tE;1!8Y;Aic_o){*xxNJQlnjB-QVUN^!18lg|?mW zN%L#;ceBzqR^?%m;A;>j)eQ}6oR`1j(tGsGs%HSW-@vX{I(6z4Qd&0Cv3u8D<>iez zvHtr03luOP4vC5uLeH6-n?rin^5UT5z4xNI%1Do;g=RcJC1FwK@ezS+$fN9Eqlz_0 zzlM>Ld{Wp{N~#{x5T{|)T>eHRi*mFP56tZfY<84)|IIxSFTHG}1i8~YH8llz=>|}Y zhVN`Vp%g!EpX8V$`jK;4vZDWM`3(M5At517&K!gmV^x9t64)%Q)t@m1`vDlqXJKJG zkCP!jDA!WX&T_Ocb@-D)FoV3jQ45t&^mfXUhep@ZCI7YKkBv#g*y1sn)}>o&+P+TN zdp&#J!Wn9b2?7r9cDlnqH#UxXpB%Ndl1ZzC!``QRM1JAIvXjtafA&DF_X+e0Azn5P zgS_ad9wVi2n=OD1(ag)gPDsOyShwgIuc?IFT^sIN-qEGdf3tMUHLho^!IVgSCDHDY z{|eA0K%$hnZl<?SXF<=QIPk4$>YR3*o|=MUDn-%{XJ_PLSXMADaE?XpJ9e?{{nhR} zYX)8C%77eeAMc;(ia)3)<nrIJc~UDJ+g|)|R@JJ^4C<f?pr{P4ja9im1OxzaYN03D z&+!TYQMrB&1V<oviUEJNB^&pDq}}=xR5d3a(J6lF&uE_(a@(?0RD1?)f<-W1<C*=Y zhWToJzRvsa9K~rr0=uRiF9<qLL4^}bGX}-t)9ngUqG4B=$HRN<5<WLxhSHzIDv<Sc zD%TGrp?^8^f=cAEy-!$MclS=*J*nO_<yg{Y;o&I9l3=JrU9&7?sLo@eNQHvCXA0f6 z7ogIkJbSh^mWNK*nZ2$#M>k(e(4yJ~XuO6%l7SCFw@RJnd!g^Z_v^jhSH<H2=2=5| zDxU#`qA7UnD`Gz(0ibttrW0t3DuDXv1QQqpI;><U_0rYnZA>7gwK?eBc+IyiNJssn z=_v|j+42+L5jenLO0JhUtyeCF;pyw?z2+>mzayuj@`6uS48RbOq@R3Gy};->1&vK& z2)@`dp~1wbHF}0Qi2FJ=N<w<y2yNv7SZbsDD<~&*KRv^fk+_vQ&INRbbRcnOON-@b zMe$ew{BIA1XZSIn&0rn?>=gLJXBpl%KLR`&)N{X9MzdYYL4w&b3*JMs^v1Q+S!@cr zZlo4e=2umD0DV6+G!#N}?R$ZFa5G8rz6S>iWo-LomLT{CyK}Kf*Dc}rF4^F7)3dXQ zBCc02Ud(8E)oNR*9H8jvcvU-#BTMU{R%XfjZu_KL#pbibOkJkg6ZQhBt?1zA&$l>( zt7T+m=MAt?s5Nhe@C5~Rxjm+pAk@K&V(8Kt_{|wgN<s#qM+>PglF&paY2PzaK|rH- zC5RqCiL(*8Iomy6=Fo7rxTB-P*VnhKtPCK4Y>5wi7{_#-&C2oN!*SQy3)7L$C@w1T z_xAMx@s~P`XcrZa?gMcN+`H=D6F_&WH*VODRy@+s&`?xtg*8S%NEkp$c#i!&fWWCS zEPue)*5ftRV`*^Z6Vr8UR~Q&1>BqLX^!4^0isT`Jz-zvtD%V0sWXdf%;v{j+rg(_2 z(w5O_{xb&2XU})yQY)&&qEJ55Lwok!0t#@!_tL)p_}ug$gguo)-hG2Pll~7ytR9;R z7a!%59F8`@eBp<Us=LW9mLh;cnZ&$(`@w}QiDkHJ_5C?~a+FVaxFEaVD%O)p_UkG> z4&f*i6#+guYaMc@(*fA{aKA?i@LSZ)Kx}*pW7>c2N=%Mgn(TPR3#|4J7_R#DDTK*E zLe9e1OnZ^?kKt$xl#duNjCnA~u+~(|*MP1A(qI^vApt`NsFmRdVb~D@2_v_Vdq~g& z^rQhX3j)tJC!Q9Q<lo&`d&9?#(IkoK6M77Y%x<`Z1NcB59tVhSpa%dm2Vr*ZYi1Pb zPhjJrMJ7NW0do(v2Mwqf9!pRniUGKUR8*#)1M?-e)guk+!OP=EKR-W%i6LMBEUyC` zvDFVO5)ricFK7XqPR<BaMJg&CP_nwMR`0l-S%N(SGdv0fAq53R)a%zmP(A1sTf2UE z2$B>;$RjBG<Aol93^Gt;y3`rMZHcS`Srkgf_X5o!+>wCcCHw8j=;$-_^yBZ<nHXe1 zaCpga2jI-y@30*k7k9}Yp{+^857FZG&<9v1WKxio5P$`k8)|8&xFe1$t^2de$^;l7 zck9>JwsP$NY;{^1<bkZCo+1b6S}G{k&`t4n7IeL-sY&iPhiKpy0~s`4)csbu>b-mE zT3?}}0dn#ke4|@*=PfCtu<-D#uy*CO<-F}|Y2VX?!mAo6V>V~YwKN4vdiq)byH<*J zb~zv?PKF9Y$77<Rm^eI^iwFEkfxV4c0mb4v4^KXfL_k15Z{&m8BSZ-Sq*&##S5P$7 z&Q*IxstWiXF(W&OSHQ8_l^#G+1fT_wuln)&yCPK+6B8#VC)imI4*5k>087qFrKYB~ zbZg$cNqXUeXY&P@x56%}dIiwzxj9SnR90B%zt`p5N`m{!E5V29PL)XDk_)-Q&i)pH z0TigI0cv7<sSw1V?swYxqek^Y#7&JFl?noxs0tu}_~BXu!nb*pLnpct#m9fx<1x_i z+Z}$@RMXbdQn08_yO^7mrC07~4zrTRGT9vFz4i%rXKAPqGM`oJ`3F_%+S=R42dnL~ zoj?`L(}}wI8=fWASH#k^=Orfh$&`_OwVNvhc|vE*b}%oQ^c^gvwg7}42%{Bb97U3$ zhldB0Q@NL+$9N2wuQDyBS|Zvi0lSe(=~ugHS5$f)IA`=-4%BG{P!Xec4As#^X6CJ> zA<goxTu?x0jA))rDAAx$eD_*&tLb7}6srAHGc?P&d3e+lM%L%PqyQp<B{Zf69Og$F zqZJGBgI7E4t)MQXM#L)hP75?PHujG8WvBt*AH5q7l1u+?FCI1o3X~<+gYjn{|Mmi~ zvLZAUaM}?&wW)+gQXU&1poIl+#wz16ggBj%5}*yG_dfh`_rj_?g8;KaoP?IvnTrJ& zb^1sWg=X)}eQBsH<aQEu|1|=`4y$y^%EzCymxSThe4l*9FeDz}?R9S5YWjR=^nD1F z!I^;ki%k#_g2GV7Lck4r149p0_QVlaX5me|FCT96GRTnD@(7r<gaeA=AA2lqsB!yt zxy?`ku*zS*YFV{H3cGUU%1bUI&fJHPv5}FtHX;=J0+A9`#BbG`3aex)M#oSPBnhT4 z5e*QUK&}A*2@LAYd`6<GvNDAfA}+#y0k$6ql*(vUM1zt@@c3S21tDS#7PA4T4uBG1 znP8`D=;{gp&jZm!c~J!d1L&WSJ)Fz+Gcz+07{~v>5D6E`$_+a?%YI0-tv5v&<a6wg zkG2P<=iPxIKiFQpsP<{nUf_7v``BV-q#Uvs7Z(>L#>JLlyGmOiYijp8A0)WWP+KW_ zcpO3*d~#5Ga>p<Oq&y?<BhY(~79o5nDmOv=fx(fd_teVfx3oCTMHmb~7D~W*1A;{) zvNyc@R7zfar?2ZyqC+@0#!sf-83xj=j}Y@eiD#{H@PC&h;z*EO!hG@Kq5(F#R{_30 z<A-gmTM|!9dcFC!O&n^S?0=V~kgp-h>+e91Bn?y&F|yuJ3;&h8kn2JCM;TxGyCHwI zDh@RX-{3w&&ir4=>(5vJy3T)PvVW4-e{_f>Hx?Ch)jX*3Id24*X~c1PvYS4?r|; ztP$GXLyupemkmh0*2_~}UESO~t!N7N`~JDs5>P<|B8X5v4)*6N^}s1{>Cz?3k+OAI z*#M75$>@=>*hgnygT)LY4b*4^48Xx{a}vWOs)wVqWv!w2YtIS?f6ouVg8v-Z27wm) zbvn6LGYOvvYLgGx)yqB+4p02a@vrK)1k;#`Dfs6!`B?fJbesvmwrM|Tv71#<1Q0?> zpRDvquw(Zi;)GmIcF*g6leZD-13-ql&o(jdv)qkJvanG&lD^o+taMh--ZE!pVqYPU z(2e*FPl|XWZ`zAod2WrJ#6fOW{J%qCTbH75kkQ))e4rr4RziJel)SYFZW9Qg+ME%q z>1k>6>Wp=-6?h}$ldwq{;Tlg#=*2vC?W>hBbSWYlZ$@vgIyCaX!SPXpPy|bc!_U&x zqd!ftgc8MqES+6T>r}bT4TUJNSggE@<jg*KXnWlkRb=yV*l0i|MY1J%B8eBGZ0zdn z{tOrm?Py3z+EUz>AzocQ@~fXICSOjSdbT5I=Zs(X9loQ*B=AmXtU7Xu*@q<pje-4K z#ix#p1>^o7P?O2^w2a|QuUNy`5uZk6oqv|Ewr>f%MRf^Z_cT7a&qZIR`oO|rA1Hh= z4(WvgNqOkhBddwIDgP|=A94>!otR0YwZ={v+aq0C=kXA*X+Vo`mYD=%pAN;wA3QTe zh9eV--Qf%G2{kwCcFVrwaEtx<`s)ef(|yUx<lOAPJ5R+}z@!pFi%&(0Po8(RfQj7? z-UABEV}<w6;Jv@}Dkkb$u!iB$6I2VXPH1i(v+H=eEow`O{`bCnl5!X4SMuqIrA-Nc z=xgwV0D(KBJZ8lN`*mZt7x-8rP4bv{{QJ<&4&2)pIAbx)^v$qj$N^_ccx=fzV|&1d zBR<`>sq-lNO0yOgT>Qj7g@l}&qC(rJ&LM(`RP4{JosySC>rN@4X$69bD9~b#YgkgB z6>TN%Fe}vcl%Y{Q1iZ&68b(RXrpB|pJ|$)KI6VlIHSQj741LZhjA_E)Szt4igL(}T zPMptZlceK!njn;*%*JgjUkQ3<WAqC*Y{q915fVKL;Xdlz3uHkea&nlTegH78+t`%s zUB#OV7G%OGp7TT2JBAD@K0;ywKAI2|=95gy_ypx}?tBmK5E(aXmnGJdBoerF^&VPK z00T$ff_Z}86IMxZh+lL%0j{yVW6%^9;bSIA%n0cLCSxHL5#rs?w{6f;0(cm#jnuYv z=aGg#aR@(bxn^vA7=3->37~K80|A9lAs_QK2OMSq_4UCfyFTXjwnS*S&X4*!`MSum z5**UEjZZJfInXlWQq|SN&uECPD*VKeyLh^E4CL44eX;rEJg{wiN%4j6(lRHpJRQU; zsV}~k$AL`GJ!;%mb?m&0>CgR%AT3gG9}6gS>0@1QKJ`8C{5~4P)_xFW6Do%)fr%$2 zce{XUnS18%*@Jv?NkD=4EK0=w$#ol8aunP%0t%2o67eGPu*jK7Ps4k0crQZEoJ6xu zCJ_SfufyW2^O;0H3qx7UNMjIA>e<BkI5bK29^grw&FOlo4J~-zV1n|w!bg+G3>UfN zRYWRbzdIzYOM(oKzeD(Ec~ml5rrs3Ufuqfm<n$Q+p``e143e1F&|;W91PtUaA?6$= zf5c4^q&cUHg0CeF2q?@<pppdd(FDToGQq5P;m0h7iAN#D%<hAYzboN^O?t~;A?^Y` z`I-#8$AI^*IlTJUpw>ZrcmS}CYQ3zj7YtlR&$gs&Y;HpEo~W);j^%{>`mN%{+C=~v z^%o1ETZ}%+g(imI)WQKRK+T{1;Y0KaPzI);Oy<_?XZ6i*oz$IWyJa(0HRQer)B_L_ zIi8a0)e24WGb<RRiW)(wLr>;)MI^zC))g-dl}803B`2+by)l%X;P-kH6;){eqkcBg zTP)ln4#0$mN0p-@e5_tmcP`ACR$_{b(M0Z?S~yqrRwSt@KyE1Y&q@{DA6Qu~9jCi$ z)&f)+u%Kgrz-ST~z-t9u!qTY#40}#|pHRFAZb~*IMW}%_Zr%)!i+e9J|290F+xqJz zhR<-z9HTEus@OArQw!86p`TeaaiK93W+o<pYaw&dwWqOJrJmqGzIylJgUWD$WK7HN zaqc0zLE6#SW|1F8FV5-z-l(>wc?0}8_zW<RSgw&!8?3@WAZ|WEKw2+eypZVfY|s~Q z#jeAH@I;aCNIwO>N`F!Wd^I~>#zd&1CJRfD=YXA(gFm3^Wb~B-Hs!h7v@}}DPn#BC zC}4|SchfT3nBdlm--oO$a;dK$?+na(8*s*+1a`j_)EpYsH8d3SK0aJpS^^QuZm57o zNa*`XLsV3h=u2?^eVCDIh+XT%ZC#T`J!O0(-AiGmGA8dVT<GZgK|A{;=}#yEpvPv^ z6q*h0I|6rrf}`Zni%v}R-k55A`}XZ8KimUv0atZtlMA?tyhL?3<L-^*RfR1%cSYY4 z3myd$m_f$MDzn*fp5`@R#cWThzy^jJIJdR5Qe`ocd26PzxLKu`Uv#(OgE{SGy^e3R zS9TsSkdh)9d>>Vy0&Yq3>#~f;prY+O^P&SjrIsj09C#N>34Xhgo1C#;+1yYs2hFl` za-NfNTKK9MMb0Q;@|q-)SON7^7VDHB(h-BoUqNI{SJ>FVNW;kmA3X-~`sd`N{0k}u zF8y-HY3L*goya9FLGR-#`IR$LX7}!$J97p&NFc?yMgjsOXC~2t-b8h~0<lC)g&Q$^ zQb9m>uMXxj@$wcH6*+-a2$&S9qyhB26?{lePCnHS+)5$TBH)t(<|V#2a%5x#Na2k1 z^b)&Kq05&uQ&Y{r9MOwvJ4JX-%f*vl<;gi}pJ!_!luc&q*h2u!f&Mk_dMgOD6TGB? zz`rsJbs)&6YbSN!^15!-D<d?{0rdDJDCcuNMX1+zQRx!=%%|D(`<90Efp;q0vs7r< zL+@QDsdKU{JKf$D=*|}A=Wh-%evno)f|~}h89!~(F+%dA^C$ktsB}3doZq0e2*z-A z9i{SohENV+W&Fj6Bgw*19ifW_CID4+>1{bt?ckb_gg`^+B!QWSdVLk@RdQC+HUWj2 zT&z5**Vm{pke`3T&&61Ir)l`8pxV0Cbczq)ld`ojHeBT#2Rn)|<(Xd%gt;e4&62$s z_;rz%BT2##K+!=C;U2=c#;$x$J!JUgFB@H)Q0L?*a6JK9NqTVM8dLDO^bjI<_zZW5 z$I26-5t<8v0F8I#k`DyUQ-$z6ni(H#WBLvv{Ay_C<)T!SO;9>Xggo@;Jq@lRE;H&* z@)tkOKfvb?2G_-9LSqb4q%e@V{td|e@v*NGBMZt|j-Q$F#lOj-vumB_QP?32jBwxJ zq&MU~onKBfMk1X-dr_W8q5P3>KH*KvJkW#k@n5te<@x8L<?FWRQ6fFujF`ynPhf!s z5TUNVmXX1Muhe<`O;<I&q5)JpL-s??*T4LWFg}XTl8OuiK@FRKRSj`I-45ZYN~kqI zIdT(OU;k$g={P8lcdjyJ09gK%9RDg6*646sADCeIcpu7LuYdlZEZ7<qZtG<m6dv}) z0<z!Gq&65JIdE-%UFh%HrOhGy#XJT|+wwXYF|@^}SwKNf7E{8<lADb6?;ieL$M}d4 zM}84Okz&)RS#rw7>Tqyzjf1g-{&+1Ah+o4RkMgQ25mwfjl3_cj490*L5d|k71dBxt zZmK9pTIRcMD2cN(XXOQCWFP0uXlAH_R}!>=onxKg;9&Qu2>Aq$4Mp%szw)(W6BOKo zdcrNX-goyJ4GIr4#3F8R&z`;<+ZC*~P#*%JP$&iV_Bf!X5ULDF{m`(mu#k{P<@!hx zf*O8fx}Ahp08Av}3Sn+b`OQ#&zG{iSDeXL#R{va%6y+;1NzLjkHX?sXa%Os3ba%q< zAEpJkx#NLaxJCxhBp}KfRXTHAzy1p}IkHQsPnW8c1EjUS);ep^NdBv7Y*t?D!A8)o z+0Ab8Tplq<?d0TMn{UP;8%}^M7#18%=sj<2dB}MkHY@qOL-=)*SuU0z4K9`_JenJp z0?@&38!?2)luyLIZHT<++6eMuF0sA?_E=#{F+5E4mo7-WZoii19m_p(*0PO`vY^5s z<2-vhIR6|Jz0VUY@)7qM2#>&Q-D<uHSCilnrI-R<C4kh*$_fPEn9xS}t<M!V))vT- zUJ#k2f*^}QmY>rlr=tB+t;Xjzs;a4Z&&Ip>lX~wq&?k89TX_;<H8@s|c1UBOk|zf8 zlR1toHp@XC=ePaN?7zF!r<OMU5!RPa#C#$;fD|}OF_1xkgWlZOfCQaYDFGV^C1)Ij zec3-KG;|D@OYkv(F7p*y3smNu0V5UOpS!0pE3_iy7h#dIvhp@3;c5T9-!-%+xf!_T z5VOXn5v;j{>$ZCS?O1TjI@vFk6vWQQncLhy^kChS5oOLSd6e;g1H=xL3=$H4*Rs&r zLXd4hF9R(bLipID0Ry+#me5q>`aY5}?@6wL;pE$g+elVAsDo9No|@{PqVS}pt&Il2 z$UE6!gr$YC64_{BLhQg?Tm#u6NWVzS3kN}Oo*Sz^;PT#UhvnU0wgGrcY=17reWlz2 z<S0m6p%Uv=(|@26@SM4|$NS(RI^G|sg)GAhR)rt+0Tt1>Fx_ZI7nU1<p}^DxR3Ddr zP)LaFmv@ceTYpM?K@YN2TpU$wJHnBHgjc=$GkDzV;G@W!ZeW7<Pmae=f>rQE58=9C z#nA;R3$gmM0P48_oq)0%rtB*S2I67Gn?2v{K?^WdqK8q_>9y?Y3OrCS3O3NtxC)*m zpxF+LI_I52!AK4K5s<bKm*WB>BO{Zg16f&FSB47Z%MZbV1a{eeV1U8!aVRp<RjCCc z9fm}ZrNT9f*#^(l+*CLpu)mO<3ko!p&JZj-z*Y-p4jnBmVBtXIfZ2e={TRjwPMd_; ze-b%!?i>LFY{2RK!<@<$gvZ@7f>Czwoz+|VBZ@#uSBupl`3(O408;p22XW{E!RF;v zLu?Lu12@i$-_|m)T~a~A4{As6mh&C1gB3t1y0z(VN@xF;wl<4DC?YxCCl&gfCnP7$ z;>Qt(4}j6=C0g%e{=8iGfQ>7KN6NLV)7I|c@Qc!zofkLh`bKZj^`#BhH^r%sltR<+ z89=^S%-2_X$-{H)>m8uGJc&PQ8<u{yy;dswwHDXse2U1(%=OZ8+nV7vcezVp^LFm^ zLuo4v?!AJN2|(p}pX_))7_FGztOY_b%-+?^_InYTR7(^=YwCSVr`jG^4-)bfEG^w) z2TMTmf#2}G-KoF^bs#KT87~*x3~B5tg;R3slS&oY4&MsAI;5+m6-~PGdH}WtS+bgM zM|=AlV4X=Bp)!EgubR>4ej!l0o9DIX{+5FPEh6+eOv(YpJv|Ne!#SzBUFqOoQ!_~R z<tFzePd!5qG6mvCSH`f`0tW#ZlN@MoCO{RciEc+1<&~A~26NQ}g@w`cnEKZ=!d-hJ z#PB!ZsDKn+Lz8?fm;%5_9r5bbZ9P39<2oPM8$d+5bH?6>{RmvITP%=268!tjEijt% z+YbYt+y{LDWOQzeuD1YqmzHc8WK2ze!dar7IxLbo1HNIC-!jiTHDAPQ0&a^Oa2AjH z2jhGJ=|oNZNNZK&k5UvYrjrfcP&GUruoW8^UVt@}++%w^kx4!joNK@4zT5?Q1q+vW z%XNC&8|X{98e{m#np!FLZGHVEdjYsy3FxJuxw_>ht$KuWpZOC_pshf1hJn+uVl>Z0 zI&o9-`{68WG9VZbrDPMa_dsSLWRMG`-P>sAl9!iX)WCu3V#_D8S;6rSW`C&tP^dT< zrK?x2w9Pw_)03f}@_`U}2`&um{>#|d*qE64jRo!trEl6TVKtL_l23u)|GCy802}j% zGocV82HH|x-Ir^!CtOUY7yLlWa1MtW)Np|Eu^e}P(Vwi-i_QAkzzM0TcI4(KkU$_} zi8;-Mlm3J$0sUd4oOn}G>fG70jn8aQs29?Zb`VbX(Za4#vqdiR(z9JWKn-(IXq_DW z%=SfSGTLct6Jk7auuaA1Pf&(;5;VB2{$eOn+VqVlGmQMiju1g%>hL{|V5wfa|II%a z36XfJQ{+>i=V-Ag<TOHyxYJu$S|ERC(R2bRdhz>e(eNweqy?Efhwka$gluvm32Q?m zA1aBUleHc=2Hs>YawK=-cOukW$A4&ufWhe9m@&{2d~tXb(6Xm13aFa__b7fyAUfp# ziASB8bmqNIi?Tj<wh^u1k6_V%)Wv@|S^vupjOS5@lV|<~xBiRrjgxpZiN=44nxN=p zst>`&FEsTaLG4O1J<9{O=dbaq197zLE6N9#MotE)^KXvA&tFhJYJ6dM{C^)5tltta z!ukh4PFT<~TUev&u!xu#q4cMi_`N3)E;($x1qX#+8xRr%RKj03K!=Yvrl0>8c%^BU zbo_?%H?V~%0HHJwFDC=T*g{|04-X;wFsTu3f$=GVx9!CgDi{DXUkDEZ76d*Hrx@$4 z=bmC4v+=q0oPs8k?n09%QF#on#boH<=cEOfd}<>6Ix#2_0Gj`WF2Bj}Go#v5lKnyv zNL;)r>8Oh9bE9WOk_*9@Sq|Y>5tz^YT3{|18~^@Kcfr3uoOiV*1uKu4hJOzDK?=MT zm;60v;<|dvpGjQMWptTCxNkWFhA!DdiF!QfiI^1J=C9ht!9x?*n1}B^H|AfT6!*lr zL4b*Jdw1E-0U=Q&!~70+8j7#rq2^xT5CPHa&tb1fgesiGq(PX(>rz43#u|J^NG+v; z-hw-6ilbCQ<xc-ru>A#yHJ%}5RNzxW92sB#kToJYAH^>opDazcI3@g{RJ;f52`E!Y zR=RPcdNHTc+C#z1>lo~yRk1D*K;Zm^$t5O6$%@pcB~(7Qd(1w?*+ih>R1g4Uo!hrB zj~e8gHp1CS#F3ZLH$SV+cI(3+i0?Za5POK}#YEUo$zB7hf=?uZ!!iOR4tqA&L>G9Q z@^T;>x&UmgfUE*^yRL@D1{|rFnVMqPFI(H2P0U^Y0Zj`I3)A78|Mv0DAOYccQAk+F z5>}neZUy1p0xw^W`LtMn#2Y{*<n*5O9avTXJN|;hc4FWW-`d)OZyk6)*3;7i%Of+v zbG)DW*HM!xuY4nJA1b{DEC4<Q#IWT$>+kOmx)VNw7?{+Kp5q*Sp}?=pvrIC!2Yv_C zR;eJMLR{Hnb5bLY@1%gg7fw`kwm+@2x=NplTQh{kE%5p>)vLyCQ?Ntp<EewR5H<~# zKnkg;+1Y{J(>qX6z*zW`s%AU{g$q2&*AjN0&J<n1&3vq<N{+$J_?nd}v614xu`j3K zmi;FUh!GIRXm@uP&eW}f%evtykr8+uL1K2vNH3k5G7Dn?lY^$ZlMDgJHI(#^!(tOx z`l02HpZEpfw8v8~wKGUOf!e~0PWa)Bin+^OSJyqD_X`UPA<mTp<pE0X3D*rnzEhd! zBT4b=(5br$!DhcH7z?Ff=9az9S!EOTUMP$J?-4M7G|u8L0ABv){oXbnp5w8a<{@h! zg+MYsJUoOb4fA)JPDD4mK1J?zH*V(VDKYRm?BZ$WDfo7@wPnGHgH<rPDl3Kmh6>Ry zU%GwZGLY^AfmS>Br@a7xXJ;UG;A9lJ8FK)a*zv*M{8Q{CaT><BAX#!VI9#`p)3Ba< zzXO!|%N{HW^RomX8E5|rNDcM{|G6LA#TPG1&ijN4P-8yKSMYri60%)h^>51NJ><nI z{r&QKFbWiNY3b{;`-8hdGmj-ek_S!h6H0ZA*O$NR5e}*;9gnGux%o7dW77e!LySDu zWkCc4B4;W9Q2$$yS0Q7iRnB%N);df+Z7zgK`7hE2Ga!(ic2m+VWf>=l=`}hoSau(M z6bD{jI3);fIw%itPgB{0p9Anj_q1c@E8dF?43dVnVBLVi2sw%v?=p7TzooMiJO$3y z*46-+qaq_gO$PYQ5|W^wXDs=M(uGN-UX)m4UCK!sGl=i?g}8`q3NtwGCI&?z;4?D| z<VDCpPC)?&;>vO99@llJyarW1Rgq%etn>p2lwb)-!s`8w7lC4YhJ(v`wn<TAiCs|e z)gHPt7()@o==ZH@2?~-@h@ZOBW=)c9so&l%GGh3jT_;P2<cBX)lkt`mAN?UHj2k$U ziSrEP5^<#TCO{A*>G><5UNec+!!a}NCwO6gTJK{1#TBo<!00`M)GIWz^29tG{p2+n zTs3qT4`G-w7-TT<POX!jLx`U_B!s~&1U}3EA*bIPsWQr7-VBh#dTDkv-iX7;+`W1? zRfVvw%#zbsdrK1YQ<5fzM2O`jV-qB7OG2aLtY{@d;sj~GAx);TrcL#SrB3pbi9HM( z9~&-Sckw6F667iDFnEu(PIeulEIySjZEECjr$_|qShiy0^)4QqdZ@=fEkN80z04D& z!5Aa}3WUZuL7{GDcelZA&JUZfVcw<=M2kEI2*!0SlW0)|hF+2BQ>5hco2nlEL`ddO zr^3BFiD_HMTDC;vEa!_|Bp-y$9=4132BZcPNqBE4@6n1vo!dm73-DqW56J<nG_aMl zB79hQ=9$oOow(`7IS%1;Q>0ci{1_5=6?7P<_R&xBCLd$z;?P@2APNHhmJDWk(=6p0 z$S*2&sn8NoGmJGp%h#Pp)DlgYj-SmW7=1sm2zO<Cu^B^nzx!NX6FhYY!cr0zs4O`0 z9@vK<6|s_@J!}4oV(6-QP|?U6ER`2(ETnjdpz$p@?5YqGhBSj1CI(;yAto7297zvs zOpv4{yx)Go*=o!nxfv`5GjMIj??c2}rsZ{K4C!!jhtKj7XOZElhenl+zWs{BDBl%Y zVs#hQX@BlKH!Uk2E~8Hv6)6EZv++$(Z~XBS+0jlQz2Fa;(Wdf)ZuH&sD^t?%ONdRP zt9h=H_YkDeVZh*GP@rWn8Qv|D^_+ux{GoA|0$RYs+Q%N5H}<{C!A}hGm`^67F#Sm^ z@)2E-MBfB!xA`ouL>cHIagp*tQ{4CpQ@Pq6mwXWT!zvewZDuBqjzmPUyk(DY4AUlh zpI2@^c*wZa3A9MqM-VMN^Q1!{M&21m<|V%)+8#2Cd<?>$rnb80?|Ng5B2tgBSPL3H z$^NX}9OZ|!B`8diNxuGSOXzQAYZ2amh4&cHfyy;H+SYX{oaPz=D)5jYaE_?;tYR$l z>EH=GDth>hgvV)IRoez1_`+@OHzdaQ+r|q`7U<^`UR`(==Ccm>o4A-!a%xmOh<)0y zxdt~5fj`jJp!Ho(Tk8uy8tic5XntSk1$P*y;wK)u?<N_T9{`{x>8YTwKVFg_DxkzT zC*g~I6N?okb!m4WLl=<~p(TD3OV=@*RWWrD2~EO-kLDe7Rs$!-Ah4<uYap-UH_&2K z!uG|BxynPzVjIv&H27B^DAvV3aRgC*tABY4L|^VxKU1h(jXrVU(cY7@$4-LvM`|e6 z?LepzM4eZS(gJN8?dajGLeTpx;!<g_aUbeE4t~Ks&e%m@1Ado_NQzngIY>5%{@9#y zH<B-tOM?kjtPp<u0n#QMCYP0!g<~JRk%$B14zoL>nBJS_8J12NRLp6#3^6=q!ty@^ zenMkPyB)RTR63<Sl27aJ<-(M3P@qO`S^RN_!g<fLQokJ-v~{6#$)}0Wo<e_s+lA8* z`8tG$?~z1{4djbl!H}3jcKBy`t>)Pr_0d+l!d3ZOo<^t+U}x*Bvw~xe1J!950{aDe z`tSm<QIfu==~sCt^qYz1-Zw3o`?ovc1^Gnql-ziRP0cwaOT<G=PFBZ>QzyR4R2k39 zg0In$C=NDerJCVC>3Bhx?lBY8V~BMlA|^&#U7cb4qjompJw(-!kf*k^w`-0)5{NU0 z>amWVJT;v4bYKKr6g(NpwL~z3h<On@d6AzV$u{boufY54#3U*z%EBTWCIz5)?gjRI zH$VVjCbRSz$8RVr_oc`HzTRh&+~@TGV_rkxq5;A0^5ia5wxISSb=N<58b0~kX#%{2 z8zo%skRJB^KTgO$|N9s8M%LFKTjW253pVg$|8mFtAB&*B@AAiti6Hm?&-q!H|M3X@ z|7a9g<W@0dg20px3k}K<e^NhO65=U_y}iBOeLA29d&?Z|hP30>{;}igic9AFkIjE- z<9~?2=450(;LSqu(_+fRSchKeKetUy{Pjwa=@GUoh{sS9Kw;yuGU5t0VrzOau$b-c zK86F3qZL*<La@{}^SylE@>%u5@p?E5A3)mL+G<Uo@bcwL;5DB*N(KON0ESoC6~M-D zeXEURg~R2~!??NrtVt+*lC$5xzr@DYS9u1mCTDU~ILJ@|9^T*Viv9m|jKksUE)u0l zG*;DVTX^gT^d6XLsETUA`U_{;fIos~8N|MNH3Tt1!Vphy52(OTu$O!=hJJl_2EUGK zf=K3)9Xl6SqPVx0v$HeMCnYvRaGK#ljs_IqRBvR-r=TLp&dQpqgyVZOf{v*>)>-7K z{ITsZFJB^P96Y(abylsgQ$I8_P9n7*$naB@K%H*9LQ7BmH`ET*cOD1S4IrsZ8w4`x z55y^p_vnKlkUk4+Ah#I&S5W7!?%%lE%n%r~I-fX_4WnB*`fx~i2_{*|r5oBh*+dlf z2%s`N_T>-lO}UPVv^M}j(twLSf#Z)>W`$>Dj4G(9slfqUyH(IP0Vf0dU9;IGoF?Cy zAS!(AS}~B#AdG-a3tSU8SI<bX>*giFgpzrZAX9+M{C_i%XSr*^<ik0x0(i2|bUh$; zc&dOO=x-?Fhv!~(LO)Ps4M?~`{Nn$LQg@Hotm<d~pPCucDfL-~Y2EMn!@&%2t|}Kd z=W3t2RHk&7iwK;$KOnS%<bK5;Dn@BIcntMUrc3e*&N-#RZo{@1K1raYUxO_H9Bfr) z|292b)=Yn_|C8hPAMX4bXIkqigI4FJ1ZqWCAb)Ic5&A!%X6!3fXrfd~%a6^9NlX+6 zMiuOnZtUK0Rt&TwD}(1|9t^i$d;ZecNBc#*c>`Q4VkQO8xjozs#u7MP8&%aVDBcsj zkM|^gAGTOuUvFc9<w>Y!(s^Y|sf6KI2Oi==|M$5J*6QH9#K}4|?p6~(qG|%M>b5m! zboi4JrbsFX&fp@CX92O~d03eDM(f3G&LlD`4Xctt<<Xm~-~fgPoE#aQ?CZF;!s!E0 zXTFy{@c#K3|0E1KW&!^P8bO1;TpwXtq;0S$Z#{A`sHYT5p>zi8sJmzTU4mpS8uv^+ z@Q8A9aBS<Af!Gfl7I|I{q}EssYW<*?dx_Q2Y*t!qmoHzwbV&i8Fykx_Uf>rr*Oc(q zftgs;;ag0K^pi-FHFR`zw6Xaxmc~teg(DK?<G3*KsN=2)Y|gi;7PoJ|>i*%D)Qc(O zt94`Fw&5=pK_~q9JaS4HSOnYld(?W`1t0S)>cs|?rGGe<>vP7EzJsmp7Td_@`<}0T zHSL9;)-qV{>j%WX{-qOmq17DWL;yUEM-lIblMp!jUq?iI0a@guvbE`Jt%6aw94lOI z3!Z!g{_3I!;|ba1SQ#a~OL?)qxS8Mo<?^taEpywp4(aXzn<KcY;dxPRz`Fub0X)Oq zrWZqSPE|nZzDBZ60a3n1Juz}ocuokXZk_}l5AX@q?WQ!=Y@Mv`mp#L?z;lkzumH~j z+N{;!f+uHLbZL2!UH&`n{DOT^`aAA?G*Rzl`>a%Q@t2A&ox4>KoHyh#Z;M7wJHTVU zmVsf<c5&#Cv`rhb;9>!s;eG5e|DJsw4qkzdc^@Gl))Fo&>G86rKfSU&*X%4552v2s zkdZhr<*KU0ePqf~AI#iMyZxv0W1qf*qcae~z{mk{Z~ti3I~T6a5cGQ&-L~-t6S9~( z;3Nv<9Dp32x}M%bet}b(6fjTyHP7KxbNVxgb-hVFFOytZhB4e(ZGx)#B;d4<n#lTR z;JZQ7ssQUgvZnR4Uu*AZ>^mMtFs5`M4)@gYYa3#!$~wF7G@|Q4lrZDuQqi%oxH_tf z`0^}w=-gSCo>dpg!Nq_Qs&rX}(?C6oxwSb+=ZBRFrwo<oQ^oVeS%{40`ZB^Aejrah z16?kfO}W-IIx>>{GvV3459P>aeniv8*tjme%DebW;{;6FplHGKslI_$`SY$1UoM~W zN*c35zx6<lsOe{TAXD3Pdu%%)$k(-?zyZ4i%18?#kmY|x;5KE@?p7U~DF4%m!XI46 zMtv0~4&ObK6}%=uoun}r*$iD}GiV|cd!qBYb4R1g6!-4_);uu!Egc=~92^(8jqBiX z3}bKzKeqiE&`$pT*sjGupV+{$C@{mjjJakMF~bv4KuQGjHqc$FN=jEQUmk)Z1$-*V z>8pMN+52i3x2{GH@-ngW@0^snJYdjv@}zA(30Z08BPi<7s8Uc8N_zSzf`%sZ41rWM zwXT_ll(6)Y1iy(E={dJ3GuLyiDjXdI(rq$nXNr4A7}b-ga7<V;FJD<63w9k^E}8Fp z{J7}QD<}P0;kOUePj?0HcYY6<pP!$BqcA)Ra!yWsT<zZT{10f<=8G<IaD06Ko-_hp zP+#0$3IUR7YwK-@SEp62ci+sOrjqa5(-s!9RaI562jGb*@Cpj5u08?~!^p_Unp5UD z-3ChR`;_ObkgbGWH>Qk!Wwd_1vCrCVA@b@3@o#~^_bN8-n3|mY>Uq(9ES3HA^=MUJ zE5V40ii&)9CMKqn;gv(`bjQA#e$9#rc$P%rXrQ>RySqEw7qs50>gxVg8?WZIwKb5N z;e^Ur+4YT${r2NaubiVQTQ_OdSdVXsq{SV~v_fl<6n4Gp3*>j7>%Wnv<)5_n|Kf)@ zGH5hB{VC_09wds)4<Ft>J4V&<6(lSZqw3fd6cs_j=i$0tW}lp$ec#@G4Gi-cW5=MR z0)_&!LsGFRJoN@nYJzZ#2;5^ts5l1j8~E&9g3}OLSqrh1@ZdeLTc0&olI8=HV0Hh# z`~FrYxX99<8yFZsf*Bhd18k%@k3w}^lFP^FFakM~m+CZ*-w&X+fxd&;V$`^G%Nfo9 zWb)n7(HZFN1)IaWYhurXf`gUq?d_o@ckfPW?W0h<U`sJRhS1PE?<5r81!sKv`gj=_ z7}(iWWZ;khZ_GV_Kr&`v0*K0{qod<wgoUCxj|DfLk;JScdGh4R&g%H;!opRWkh{1A zckbLlk`|y!c=!y^if(RhbOQEuaNy`LZe?X<VPOHz=fhEo#wrnU@!F3cZL2mD#J%Cr zv(o6V&CSB%;*Xh`^UKS{rKO4KY*;??P%Zn=pJUfevU?HFlmJc=I4Hyj&HVPQBsn>` zq@*M%3C+aRa5#DXk=ry-;2c@vV83gPx;PoX1FCX5cIKt$wYA<55pUcG*;hS-nxTR5 znh4zAcO!!t;F%WG2Fe^#I~d~NoE{O5G`uu5qYQIb7Z-)W8R6|+JKs`KAw;&mww7nP z2io*gp05~iFjnWzTRX@bj2fDnyu3R2C{0;dT4WKQK79fu6a?DmEkKxdy1-_ELpYb7 zN4|M;o|H7{+=5dDDC5B1dmbN_=jHV{twFMu{oLQ*|IV}Tt#TCPZwPe40s=s1-gyyM zSzi9?HKvbXkh%?OQwL@qp2JlkDkO9T20=CVe|2)TKS{-5^cu`ormdOuVoM`ynK{w0 zKBTF2v8*N`n!S-1w3WHC<wRzzoQ1nf#hSE2v$siW>2#)sT7b*6S~{mWc_{|7q9&t4 z9Zd`Exc-CgH@>jT@1FDU+~+yx7>|X$fk&xQsq|$sp<(NLsDL#M3>+~Up<6#3nVX-# z;s&||zI+^I5Yke!$yBe=RC;qRLc_ow9vX`7bS@}SV=~9N9DZ$LFkz0Shfb#l)>l>W zN%Cs1cwk_Fjq-W{!BOQR27|#ycu<7!Ee?Y|e2hP3$ioG-D2;i+#o}URe4^{7WjWEG z1ZquYk|ZJ|OS`<Y-rwlA4rOMBpx^H3Fv%rjcKdyLWOV+TeOd>|sGkM#qE}ZsHn6&$ zKhKs(%F4>nF$Jz!6PI*_RlVMa`W_0~9!)niI011yBp?ke0uj$yG#fkdmhnDpub)FO zI68{xk!BPPL)=q?Az}08amXX!dBY*CZQeTmVNY;y?OTx_(a**5?9aWrIuYjF&=&&b zo*%aSqvZmTyG5%t8jZiQg3S<i;Lc}eX8OJZ;6M!Ao0D#Lr_4RZtV9eUkHmnPtA0n6 zs9$SM#LwMG<AKE)cR!*D$pAUnX##;*e`Zkj(Q5tjRefV4Ht8697Zep?169|ttbN9` zw1}XT_;ua<sbU@d+2QbbJWn?0^?J|^CyrpegI~!S=eKX1Ea_{TEsF%td&T%09k;}* z)oQ%u1pa!U(eOwtB_2t`365}OuW!k{s|tk%@<*-q)X9_c=Ag(IQrA(LOjcM}h?;~h zP^Z)JUQrzG_U+oXw&Qxac}jmCF6w}Q06cWeMF5xB*jkk;jGdY~AB>jGuTiOTY7UsK zR;$I*1s2;@aTk^xfijxdU#y$Owi-M`gO(<|UtKLk5ySvrEEWT@xj`v;c}{Q@h9jYf zCwSS@1OMvUo$}KyP4#qJd%JhSI4_Bk?7I$Q89PQQSV!F6!K(1OGKp?kMe-*UPlJ5= z;ihY?t&<QEY`K)0OadrqHXv#Cz?7SEM*^8DK>xV0k$YLOh$vY6Bh)96!4n{ZGR_^X zR4Or;!EvE+`xHrV?;@JW<B{r4@a0U-EjQ*wk8E~3MNxLFK(Mfg%~;~^?{YdLqN3)E x&1VUU^-tgD-!P3=p~PT-2WBtK|Niqs?VQiH^kG#@jM)!gM5ORi$);UY>0dNWhf@Fm literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/explicit_midpoint_euler_erk_stab_region.png b/doc/shared/figs/arkode/explicit_midpoint_euler_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..c3f7e7b937833c5e42272dcf65d72d646a9625a8 GIT binary patch literal 26029 zcmc$`by$_%);+ulfsG;?P(kTdkd`j#mJX2=P(ngdkdjakq)R|RKq={xMg(aEloF8c zE@}A9t<Q7b_x*j}^?rYTT<2WJ&E~%Eb+0wooMVnL)(KX-BS(OL4IhC(5Gcq?YakF< zHV6b}1Rf^*CT!Ow2mS}?Ab-~hfgmMD{}<z7Y9IU+0@qnVMFw{P8;QZm+U4Z)41UGn zETiYFY5&04&D7BXp(3HBEFpQ5M$6KIM#a?GQrF(m#_1-Ff}I(=h~5|({5>7|@1-0q zOr5Rl?P#>DY%LI+0&Efvj%?hV+_z}B1cYwEe|XsN3k?wn8iazhgw~Vfl`;1xm$cLO zHltth1t6*(483YRC#l9q6pV*|0kfnnZR<L{EbbGO#7yo@tU|0%I(9sIffAOv4!VvO zfi4G`;726^-M(BVOhKlXF{46gXc-p0&$3^atgJcbR_E1Jtk1VokHs#neec)K^7i_g z^Ie@PTn@&H$dw_7Q6La{7mzRyh@TNO7zjif!T%p0R6g{c<5ZTB2}IHH@e$u^Ty<^O z`}MSMbzxya{CJX3LR@-z3y*W-9lgo?*Ei$dNBPb*F3SUMV=nQ<v+C17%WcT{?P{GD zqspSs(;n_F4}N@XW~O8j#7W8Ver(?VdV>1Xk5-j$!;&|s-h6IU{a%*!_Ih}$ne$b; zdARmGDZ4?X-PkiM+>VZp02CJ&7yqv(({J2<4d-g-(MmlZb)SE;)uCHp5II03$-u-k zkgZO?Fj(h(Qr$TlWmjWRU^7^7?gW+J>EcPMA7V|YDt@vvV&A|vM#XP8YJ7I6Yu2fm zubrnOdN30$es)~yIQd>B$zyMgvY7h<Ip50GY$t}!!f4fY=v5v%HRAkMr65&SN#Uv5 zihD_XwnjcDF5~^OVHECbqk;zoj%GNU^`SpMyL{kx9-XU~9M)CQ;J5Y)_Z|!n3%esP zZ#h=IJMqb1*m(i9ubtv^dXOUel;up=>`N#X?!`8@huw*@dkUeKpU81<e807B)izDm z($Zo(QbAC31Lp!+nt@MS1npKsNlA&MyOn#^CCQHl1!`33E>&Uck~ZqArlTJpZ`HtD zC-=7G$Vx~^C@Y7q*VkEne=mQ9UQkfbp?uoqLtyy8G-GqtZh&j^fnDW#{n1yOH>)F+ zxI+mNwHz709VnLxyeg~0j&c>2Wb@aHf9}4xNU5){e{Dkhm(Q8kY(t92(v8{AJUl#~ zPgDGf|BiIks!gJ9h+ZzNtFx1*`jWMboE#w;=k4nJ_j!iPhehvRk@M^5=qOgMf1D1B zH}<}J*f(15^;D|ULWq`%gGhMv3cJDn7jpY2Y+O>GBp<#_Z|a0~huK}Kd^S25ttwXK zyr^-o))C7}?X}ZebeVu?HfH+w3u^EEqwzELF__l`e*0e$v{Fkya-2>Mcj0xY#XO&k zRl9tN>rs02Xhr;VGkhbT@LtEaZ}Ilw6oTAQqJ!G)ZEXvE??MKfV7afU#~BAasg+)F zxL57G_~CA;-N#9s#kKZm=D`9(o9BLkUjt-#=j(Gh^4A~3B#+g&kxF_VtyXT&f8)4u zBQlP|s8&zK&+~Y*bsQ$?U~Q>C?*#$*73pHrJ9iW!j()F3+Y?d>Iqxj=_N`vywcc4D zZ}2%gC1Jh;S5UtTgb?rQM*qZ8Z~Y#zw;w8!sD2X}NlU4|JXknhY}N_`QBqXANGYVH zuHIYgzMW)WUv;n2PE}-6di7^HR?Pgy<Y%9QPGi^gUnkq&#Iv%p#J9V6I%pFlgI>PG zubLHSXJ>c#>_5Jn=S3<bBjXr86huT{i@(v%oZ7|;BP&x)6?=9*ZE>vqH%y*&e{P0c z_}WNi;e+l(_-sE?u}Xcq@nWt!sdE|q+D`LdW9^t38E@p}UuM<W_c~vHZ+f9O!@mAt z4z7oh!X$FvZw@*=IeL0|E-Tghu+#Xo#C?0tzTu<-E{0&I;CY~|y{`T}YyBRT70K#w z>HP7*HtYjIm!+8XnuzRUnoO0=*?8j)C7pbI#?{}!!NJ>e-O=%R!*l&{?y$&jgxw0P zr?2m>jU5%YQspf*w1!bWosHGa9AS^Q`Bm$_HIxAXVtTl<_$N<QInDoa_)Op(lKDV& zTVr)|_nXhDQ_IWC2L}fb;D?J@sXxoCqNAev3XK~~KR<^EKJxn5;UV=dAt3?sPG>v^ zhjG2<%207%(>tYjMcb~&j~~y@&gzfHABxuIsu~yiSLdc%i#qO(%{|-GCekvzG&E@J z^XB#I8@74mb|2rGwT3}FlJi=}yvLV5`IJ2;>ap1OuJbdY_|3693JO=b?guy@L9Q7r zG$s_8*@0KOSLOK5(+w^n6xq04Ubt}dfRI991GWhaB11hx7Um%7mX$`net7_Dcz8I3 zl;c<3Q@79037+mOa9Q<bLZUqqdz<)*Vl*ssu8dBLnuu5>i+1|z*efbppQDlSnabpp z6r;O$ubNoQn&26)*KUWE>EFM9UwfGWR#q;>{Z*=7ok#h)N%?T;L)K2zp+KAUc%b9$ z*mb?s0>he)Gq&s3@rtVap14tkXO)%h>@}R#jhD1EH`ne@g={6l_KiC0hg>`x9eRyd z@ig9X=9O;b>F>&hme$s%bshKY>)v_hrl-@5b4=Ae-HWqP-dx7Gz9jB7zUBFQ_+iJ^ z^>0!VKBx|rNk&1zyUToq6<y?fkFs+aQhe#tG2=b^G8MMA>b;ISI-%w)-^+BMkb`lQ zlsF#mZ))3iL5|F&Dk%A-Ry8(LnHm?zbW&McYhYx$zcIO$$kHld{qyr@FEw3lt$ewH z`jOh7UfMQ>mnNpKv$AU1xxbs4nfWGmbhELd&zTd_H^zW&y%(*tySuxuoaj~?{nl7Q z0@?1gX5Ftx4<5W9{H>s*RP$tWD&~e}Z5+S#kA;=tQX|!Oj`VrMk$wXCmO^wQKUJlk zJ1P2!IL-uZ(Odm2TioBA7C&5|Z^$xNLH5l$zI*>3z4IW|cPR4RxB;P|)R)*H%E83M z#LoV8orjgx5061Uy!CsrnOv0?^PS{~)Yax-lC4CDkMp&*{^&(`*pnuK@sc?pLD1=a z*@GZtNiJQLLBZ72eXA3Q;M{_eD2{rPQ{v1-)$vLZ1qB78drUiok}7^$4c+}Qg11d$ z=A#}@f63o`y!7LS`)prdUs>5L_Y)Y^Q<0R)Umi+Ebj+D}e`Y!NnlW)Pc9q?jko)*Z zwM$;>^xYEkVCPDOXr{Y&@79knHy-s>zj$$!R*;*mA8z1P>0W-68-~=ly9K)`j8gdh z`}ZumziQkH$8F#3n*2DV64hpIo9&G6?9|lM#Hv-ykbN~X0vpWd>}WjigeKRc)SH7K zhE<tERdiR&f&8wGpH``p$1N%%iR9-O=3}rIH=nH4AK5jes%U8Rk*JD9CMB^JRzZd( zAm_V2;%)R~GLYbmDRm;%>-TVSGR3TtLG6=bxp1njjJTV3>DYAF+$DoNc9(2_mgPX) zq@|@nZr$3dupQ}8z3kzqwaq@`6oryJ@Ur}xEVu=mG#>X?kwmTVZ1#6}AGcrb5OyVH zWm*U2+)PaGi;8--m-TC)>UPBIMAHPKHa9oz>vjhs>E*b2cw)z|=@uHX<u`cjTF)-C z>z8GJ_^{ITn#agg(tRQKY{#pUK0sbo^;=h$L7m4g<nji$^<O>WLAABDe_m#lNjZVW zYe2(4`@L<!`z{Q8&DHW`BLZT`V_Wl4QBfs6XWj>P(M&4r1|KIX<tGKg#7=fJXO)gm z_Zs5s&EsNYVGbU`hPxO+qdh>*QaJ+UZ>C=427SlFZe3&827W*O$I?|9ccAx%R)6c; z6%w1i%-~v;n2{n#XWrsE!H53p%TIUoeVPK0u<-Cx`tX|$yK(7*SBbj8At8Bu6CRsm zdpZRM?h8G%g#*n20RfCkaTG$%mau(00zcWB^9n}|ywO}HB5Jm3bGWD&@$hRh(o-h4 z1h<=H<pPn-z=ufcSg3?-J3qH$?#@HVcdYBdyVesT#~+Dxco#FNB(`-5yDTxVg@%X6 z-+7IJy}1_iZtLetN1C|Tq4T#wn^j1Qthzd{Y39GBa-6Z!(@PnNc^^Nqn)D|WyUw9S zl^Pox+aVTcO=#GVT5s?E{KD0#-P?v@c!dO0{fG>!q`VtW2>ow*RN?c0IU~<l*LeVf z3cIdE3<fto&Ky<T8*?+(w&z?J_WZpzR`cn_sO4lV&1_0Eq=*B@fR7(P!Vb(wYAjPx zt^HSx@Yar{>Hi^P?OGbks>_m^1u?PJ0QG&wt#qF%RH(kyde9!`+TQcSlDd_ZRR^CS zZ|$!SBD>#S^E`~{oRzqQ9yC*Rs?Vw5$5$)8+)3eT#ZK0ubUQ)>GEtfZnM9Je9t~~e z71n#K*P-YC09{I>Q`+XbUVn#D_*Uvgu4faq&++5Qra-vK0ibI|B_%K2Y-?iO*%nLw zF=x%JJ8$5HSjW1*eY5}m{#6HN06QO_YgYnS>4R=!$z&lH>*+7Apa{WKB#7)Tn}v(M zcOiD<U1t{-zGoyiY{wix#%&%Xa$B=-I6mdc6!M^A>t4Wd4lKt#qwHEOMj@fYwVHKy z7M3lqudr6M%^@813*`(H)B*9R$}0QU+KS4`S_A9E<9pnWGi}{T{7U0Zvt~|TLa$<Y zd(l#~Mmn+vnjwx-&yF9uKdFBNh0hyz0vZMMU4H?*w6K^3=y-z-jmmtslg2H*#%O*! zFlJm_vJN-k{bBDEdt|*3GqMC>pk@^9y|bWx;A&)KRO7npNxk-zQ+7r4OG^vEwOjHh zfw6L76pH{+;@Ix_4Oua6xro4C)MBR=c~ay|FC<hAFv+pjsb;M26^h@nJa<g6oQjB+ zD)YI6n%^Z!X*oH7obU>fmoHy7_CBz%vs<fnS$19h$ym5C`GPuEIRc=|@~^s@!Ad$_ z1NQjAnTH*zNg>DKS3;>o4`X$WBEJs%oGcq3?Jn;DT<kp4red(p_H^rTo^?@pS(4ae zVe`>|eU{hFW$DMJp<Mk1V?6cJ2P(4-$3|QvJ6Rk7K_MYEy94*U;+Kyk_VF!}bhRJw z{_;MujUDu6*DEps1i8id<;IO0K8N2^bM*z4(NlXcrcL(<Hfi5$SuwU7^H+3Km#GTO ze@Nudwe`mzdhtqk*v=*$n^#kZN*+B`R#mkJ`1JVkCP2hM6yTzeD{LLz-6va}99Ugb zH@vnZ?dIp_A(NeSax`3^ldd*kcV}Vc0PGTFe?-Z8wL?}%v&h=*PQIM<b=(~F<X9Su z;^Jb_r@x_+&O3b*-D?F1Up{CQ9mm>$jm_u2WiEI-^Zk1$B^6L}dV71JyV)u|VDyoS zY8N-U84wf}rgKE)?D$=Up8!DflK0rh$J2}7vu1nADn}hdIs|W+vy8uSWG5~xcm@!= zv(n2Z8?Zd<`qJf(W@cty4NZq^DGUp$##$#te<sZ%3HN$wy^+Tv<Lm`qD8El&*Q0~N zZI+W#jy+!Kmw<OxXK)d0qxYGaZKPT*t3P=^j{AMDe!&`elva_gwnR5;H;|`WnCq(B z&|pD5>C`+_Z1%3X3M&3MfTBL#(d6W0=#2y$!$rfOMOf&0yOoS{?%X+v7j3y(HS~cc zkuGm{gYaf)cweeqoU^7B_pU7~D}y$>{%mO=Kgn}I_l#F}nBlbH?5JU@`404ri` zjJ)?ZOshh=S6x{j_HS0Vv2%Y3qhvi74}bs)RJ+rCZC*l21k1SL@<9IV`=jaBaMo0b zs`{PB*N+Th2AR&&!U|-R2Y8p;j~m&&6oak4Wo+ceDB*MXY;j*=zpt#D-X3xQ%-x>8 zfcNpf@Otfcdmrb7u#AEHd(=YC^3`<@zfp~4nG@c>xVkyr+Bt~dMj~bX&V^7Hzg2=# zLFntf0$sz*(e4M|QdWgqDs_kwl1@^duDP#O&Cl2zLAruI<{P#^Pm1^9;?R)Zfi>q1 zX}jT)mOLIIPv`MAiA%S?6A^VtSjWg$KDqj?sECt|E#J7oJ5MJ+>R~^rWU{!A(E<Hz z$1jZ8e(icQw;0GF*0TVO`|q5v1pqD}of$cQ<>p5qCyqrDnbvgZH)<lB*MAw-cWF`; zQIn967`zBebjzZ6!{fF#%Bou+Ul~p<ehS;R<19+{Qk!lx9<8FH;>_D;g>}F6O-)Tv zj63frGPxgqrEn)4u5!xy;Wo_}qbiQ@63636tf&fu9KX|WdVNsPeJgWR#W?E@rTdjB zz*;Y;JhF2K-T;c-nqZ-AwkfQ8f6RzU+YBHihPuw!I!r)CHk?Y-q|p}x3+Dorh`_@5 zc2D(-r@bd>1Mx<G0Bm7(n+^ZA;UqMN?$FTiHeg)-K@qO~`j%Cc!Pv?1_BZIy9!%`E zhF;A`wnzt*^YB}W`0<8RPv9U!(5nyYpYkBSHfeaD_r`BY2MuavL(gSc<Eo;duz5}V zZSApQ^#_TA2!O`$1O3ob5vtj?Vc3ENcT49^_Qv-TGZpLaf2~ATLrl}lhHh9-su>l$ z8!R7sHXf+#&iKK6W8xD_r7dc`;NwTVgIQiiMvEWW>d?amIGRF>Ji8kk{RG06fJ$UP z?w;MIM=yfsrS9$>xmVX1*+d>s1(dkFg|_GF)vHo3F7767D%IoN`JP4nQN&2{fJOwP zuw|gSyFY$dw|vkWU#460?%mfZDeN5a?AytFwu$Slm!3^8OtpmUF7-#BT_z#nvFu69 zO7XC64kGHCCpY1v4(^~Y__;dAd!vptfAGG|*k^hNwY=Br1_yB`R8@y|+qu^V2enAG zcU=KkrHyv40hLiX?)?<-H|%O}z*O&+WKzEHZah$zT7G(g6YHS#n^@lH*N(gPc^)y` z()hHA{Px}u&xm&f8xQ&~>7DkJ+nKAn`~!d9?$YpLy<n1Wpz_?1n3cNoMrhV;Kevnr z_zpSmROthP5qrPTkdW;W-nh89_aD}G6eG~HDwq^1eZpV_STww~6#8pKhClR#>B*fc z2c5YknVAf;JBDu=<i8bW6~#f@HU7Aja?9|br+;S=mpwdQO$<-95j)2vN$#cu%jYTJ z5Z(o%am8;ctC!_}kUldrvz+_XriQJbmV2{y&Df4g1l6mjPp~gqQ<7vt)UkBz^7hMM z{Q3%EfEixS`Or_qX)ctz=Q?vC!N&DM4s=z)kjykf_GLV#f0{cI={F?EOG!la3ODDf z0HXw;(R`!2!$>)*&8K#j!zHuEr(2}sa!^0eU6#>P-&%k6yCu>Gg#gacGtrSaX7A@* zW$^CZJ0K`@_<Sy2<!-j=yIDtUUcN5LbcR#BaZnX#U70`N#(V%Uz#IC9r(T}`NF;Nb zHnoJ1*6F11JPg}98m4p`RoBzY-qIzA{YEk&67%|X&WB(PP0dRC@q*eN?LSZ)E522? zhdLmu8hf#~q?<mPCf0aWLqj7*<yv51AQFjmM4mr?p5B2%;cJShu-&M@LB9p1uxpHW zJKM%*ZK}u5DwEdWy)6jC8zu71{B{<~y7Q)XQM)ec6XDZ8ax~!$exF!H@9*#9QhTZi z&ZoN*XSPnOuW>>dkK}ipkaIr~F!e>{z@?VMZBYne4F}<@_urG{rU5Cdrx^RN+;M=? z4UaUaafJjwn5~`xpiRP<X3n(+_%Kfhb#nXK&9B1iKb&I?6cpM4o{rhM0oeHLCYa!X zW~CYyl#}>Y0UKVN9sbcETsczbG=Im+TpRj_pXD~X{SRsZra&eKQsh^)i_NUoMIpzU zv5^Yf8qWhqfPb;JCffNFJ6Y7e_0$2zOO;hQ1`XbZVoo&%>{g!U`(gBzBVN#PLziDU zVhFg=Zme3Hw>T&;d-Su^=#ML7pMHEVW`{eDdv13JlQ3s)tHY@1UGsyT$m$~@P!jJ* zeQ~_+r^O*IezsiLAm+JWw7<7f5AZa)HxQq6_Jb@e1)F{uXN5>u3$FU*hGLw_#`idC zY*}4%8U3I9aiQb8JANZ0^~qFlj%L<1jZDthFf~9Mzz!=nYrSaI-t$&Ufi1EX7Xwj* zBF^;5QcVS}j7sFmhP}_xy+!65koFG-8%}wF@ua1leEl$mtJ=4ExY+E4qq4R?4#Dxo zIhl`}5(vc20PIC$ppq)=#&RjBUneI1EV1Z>e8py5e+=wWMR!pO)UTWxmK!&6pflxp z`1ONvLw#?cBb`{#e+X0Cq*OjGW<FkDYp#nLNig@Y9c{<!-;@d?5Dqt!Ze_|mA6bp_ z&M$$9l#M@!Ks0hP$P?6~374%cAj)nqV`0HxUL(%b7eC#fhQ2Zo1uWyO>YJb-$lebs zV}VA45_oT*9D&di9|dgHUr>0ws)az9=mOf1CH+Lk(6$7R72W-zSyffF2ZSc|*}hzC zxZ?`@Wu}~*oJSg7#R@L1O#P%IJQPE@hmMZ^M0G>`*Eu+Rw%VDU932mTuL?u`%Lu_j z+>S_3PY-3sT=B=gD(~)o0GJ0rAke4l=gwatGo(Nu{92E_dWeuEittD@M+QqX<~FY4 ziH$%+MADo9s0K_DKQ-MHc;4*({ZMuy1j6^O1LG?nG=&8(ex9}&1claD<nz1ZKr~iE z!IF(RkMN}dnzP)xzhgn8kx4${R2%4Len&?~&$FY2jBwcsfr+24C;z^Nrdz0gK-j+F zN|8x5JonMJ_N=F0BtVb4O-{@JqEw@21Pl>G7&(*CYtGVs@Hf7E4Dv9gmQwJck%$Zz zNf`<9j05%;2}!xG>lYD4r9XaXWrQGDAFmvT>7&2nlVkE#^c+_UH+uB%h5zF&|MP?O z8!;~rpeJFoo^Oq&7Wejq56r457h0pGjM0ytXg%1T7YE4#4cSPkgq*L_)0+VkHu<Cl zfMjSWT2Kg>Zhy;xeuIr^h;pgt7uvsm<*TOQq(}b_Q8vkMg+LS)p;=Pcb&HFOzzMy6 z{Tdb>{s9z>HFSNbDd2Tkbv|5YVX^K_Z-MoLj3PU0R%lRF0^teC=i}HKFjs`+d>_0| z4*MF=klc2JkG2`QZkzsGMmEp=$rrP&&{o+VY|X-RLSDV1gncZ!H#)6d1cNUG^Z;_q zt5>g9dox;LoHjqQC(FP7B~K5g!^JDCzCVB}U2R7e@EX^&Cs&&l<`uE=ghGuLO_bwt z0c8Lj1``9rk33yfJR(xkN<hWXpn*6d1jGO%Ba#*Xwew`txr1jwX506qJwv5Kv4p{g z1_vuBE001A-x=@f>e}CbLM!d*={eQV&cP2G9{@I_XDB`ZOOUiiUc1^BIXbX`NJ&Xa zNYGT=qPBj;Blo$ktFuB%aW^Ah{sb%lj06m1y@k~HlBBtXMW9dVL6(bs@yV~t2qgE- z<XR;R-<+X($v8SgNy(;UL8nZ{qrG*vDg$UtfI07g4(eSX;Av7xNX;tMPXRJyW@g63 z#2g=cTD7~4dkq5r4+u;to?StS&-N!nz!M-Qj_XHZv$L|Yic)<8y7pehqpPH(Zktmw zR&S1vkAbCv8M<=iilWjl_jyWMX%CO;V-cV;fysc!cET0!7=gM83l650&_6c~;TlGA z*`mK87cH(q0*SG6Tl%qhdbIxS+c$JDeoGO37x+zNJG65a>O{P=+v)KEBO@c4t`VvU zL_xD|TxQt|NoL@~UCmXTmA~>?dPYVd3U;dxfcuWl&UZ%ki|sJvcn;%V=`!c7+S?-O zsoiHHA$}o4C@KB&Sk8w&1(ZhBHU3oK8-S6x<@u8H5^Ti@0jhBAvs`YIM#Svc%#1m$ zG^E~`^Jtz8P_AtC8~BNc=z&mV#fQk2#N*}Jy#T$uJDQ`E3<CJ7<koP!r4--E_(B(5 z17cO{Ejr_xo14GB5oR59pLm9w>t&UIt=k8Q(cLJ%O+Mcr+Po^x8#feEMmNz=>D@cP z$Mvc%(EeB(ukkk=yjt&UfBEudW@Nl#->d)>roJ(#$1W>Fy*6)P{j80zF-f4)#pC;C zX3^2n;`<X=<30+c^#S`czzi6jAG51ONnTsLj_zJhq0z4!*z~%j9D<ER_)a@7_QCMj z-UzvD+1|Wh2pb)^V%OP@%kI}`Xajbng3w~Cb0s_va%(|$cF?O6#+NH2m8yG9G|G^k z5Y~ayn0SpSLa}`lAV#1IUpeB)DOSVl1%{qh8r8rx1eFhF`w!8pp{`!+FxdoQLnZ1V zuLSLqu8~pwlg<0?Z-8PX6hBs5w)u3uOajv(eS*%=cbQCi|K)82s5f_kJsGWX0yXIb z((C|~To48zX+S%c2n%?2dJ>4rzgJnHTL^Gs*$(=V8!BSIhs>-~Jb^+4F><ZU>iejj z8_+mFN6mM=j!sPl8gJ*zD{`gfP>8(Esg`JFRo9v^QI8z~07^TH-yzFr8yHa3yAhys z@Q{vg&y@r7E2FH5OKgn~_#O>$I?Z)KwQ2jl2dj&2?Na=hfqU{fo%exF!3U!*DdB!A zB!QNPfS#F!lylm2o<m-Vn3(uMx5MpbJj6d<fW+Oi)A6(D!5r<p0ic4YJQm&}Ntoo7 zxVgDOX5#VOcc}YC)5Ovt#drw^3MIOn#$!5Qw?4SpTK_mdJK}B1KwV4wQ&QUq#D`}4 zM~)9na+eH`C|wu3RIq70<s%SXAq<zW8<K+9khjrEo@wf`v%DZMs8Nrs5pQWEFgb|@ zzg#y;N+iVeWrFXCWHh*#F&PmmaA{MRz<t4vZ*9wc6k=isKWrq8=gg4ATv1tWBJ+VB z1~a_`W)I0L?Fwd}51s?Q(VI0x2+4QHyAQ+X<Hd)Pwo2zn8*LY1HX+vwK$pMv%@cGK z5ciTr+%-;wpiTVz@-i!$40vjaq9A7QrMW?ZmD4*JBaBe*<AbI)CNi=Zu;W;&AoL9M z^wW*cu$BhfAzie!=@s7(Tnm(NSZKjXBltXl@*QLps6YQ~0<xq%=-Gf_d8%plNueld z%VYI)xHU5f6Z#E+!~_d5w4gCT3a_d?rGZ@V3$dr002LSn{V@PwBdd1f^(RH9pO*#; zInMS#4;}*A&%?t5K>C9R5A5vhKn(y;49paLfPlx&0=xn2PyI4WF4vVIfX2Pc?T~SG zKInm7kd%<H4<YNi*eCNn?>ue&>ESXI1Yk&uAx6;M?9mm>LZ`LSDhS^S%ieU@X&r7_ z4c;f92CR=%asV|7KzDD{DSQx%kV+)s_3OJD8g!zo<u-#*C;Q<lh~d1kj~ku-oR<B$ zvAr?~NxJ5SQ(uRmnTvA)`0h{|fow!c-m?Ey3qS}mGo%;LA!2ohicI}c_d$Aqk*LVa zXX_TGpy=4y?SQfYMa-ef0QP}`q9U>6Es&l7Cw0hmr-;@-o`d@>KqfUXNJdTd>l*j( zETM~(5$rxAmBd>)unB>3y&llk(V@}s74|{^3Lw2^oGrX1aLyoGKnJmXuLAgDMO7%A z<1sOp8aVPZUF;t>{nEbtmC$r@#t=VF)<HTz#w5PfE70?QtyP(|u@MoR01U0#K^Hb; zA7rZ>MGF@0+YhWJLHrFweSfdA?ePOtv`j`)4x^Qy<$0+4pue*ii*j&)5;g~{fZ)^L zAIh456$CIC!*!=y$eY9*%IN=l?K=>~r|tXxeO6h-=hU+>Ygf`wE8M0SWB+vsZqSAC z1K+fMcq~K!6e)Tah4bhRy&jep)Oc_J$X3k(-!J%hN_x>13eQ@@*(p>~ps@B<hBfu~ zft3P$0ci6Eb!=4B)>2-fVkOAOzn-p((l+~@JFiuL2nwh6-Ma_ytM-$h5HGPF=@!-l zn|UCB^E~K+B!5NnN1^dq)qDyo2gi7YZPJc$P6Q<R=%d+G_qo^5t?3?>srh3g1ri6H zMSRt3nXvGMXD`GJ9BxPc-{q|^_zBt|Qk#^Vd@}&JLx0D~{K{X4-TdR%<9C(^RoyGW z;lg&W;&|t~s&@S$WG`Y85@ENs51vuDR8MZZ>%vT;x$gg7A7RCf;LXvmQS}vED|ue} z*`H!>`AW5aBH|2hGpx7GFg*LON_bWcmYc1DK}K$k?{7M1HQ1FE6@|QyKRPNvXxF7w zzyP2ovKXI0?+egt=TKKs@#R)QqRa7Nx4m~pEo&V;5N7kW8ab$RP~iK;*nU9D``T2? zQiNUjTi$gL@jvV4$AE?TRG;7aQ?51dI(2^3dN@1pK*m_uEd<NMtRe3*_FLIk*Wd-V z^cP}tiEa@yOyFV5=@IcL=JtYw50l{x`=&ZU-wkNytHQ1y9NVGOP2#sN*y;yCsqE?A z8f1&1A!E8$XiCZoNCKegvK{?coS7+ow*nx}i~X_)f%_DhBdcOhHYQ;IWU^LiMNv=9 zLIs>;Wl0m36>7qv6IJZf08-}@)K;K(hxd%_Dus9EjiJH;fS;|Q2END2Y7s<;?5%!a z`2Q`m?$ED8M$0zP>=u$B6L3h=9S)-sy>|Fr^8Pko8;C~U&};z%9ZCNAJU+gbnCozf z1-Jm}JLkKT=6T7kaxzz+neZ5?M6HZOahZMj0FesY8fv^Z@F>f$1p4|OU?hM=QGrev z8d6#@A3&b~%eN1g3;At-Iz#ILr50VPp-Ifz>TeCFZUB)RtSB{OYk&*T3J{b%XtG$? z+2f2Q(c^@;22<AD*EdICuh{;CODzIv7qo12Wk(C@nQWM}0jnf4z>`D6dJP&;Kxp6& z!r8p=Jxf(pUS5rTv-%MMCvEkyiT&1!xZfKCJlf{x1mq9CCRdq!!gN1O0Z;-vqtddM zZig8_;SxBgy!UFxp}~XA-q#0vIivPE^G4oauC@(qCPLAjo&Y3C=Gg;tb0}{Q(fU76 z_FZNHFr_R)+R*)=R}88*tbD`f7jh6CfH8PoQbX}6cx&izg7x}!%U`usw<h>`d9^LA z{3-bD3|w7Z@7%eAqE`aCsJ{V~M*lU(A<=rzeO{{#mX@D?50VNrP~cDbUCk*d4X_yE z%L<rIz(#&gcR#-%Oci*Ht{+CEYBq+<(r3HIXS_bA$9{f((7_*^>MsA9O0MgS@8<a! za}9%;M!4zq%w}ZM=8=!Hb6MiukN(jyF*CeenFG3LSx#j6$@OJR$Jvfp{c`JeH=u|U zp@)l$o8uRgBuQeHH;jpo*VWQ$ZfzwuL^X<keS;7r_O>uLH>mflf;tLq(kO_*0LBV{ zjetqb=(NCPXtN%LMgvAJi5K754|xDANPIQ}T?>*JXH5shYIJf<oq(Cqr~oiNuy~A2 zOhCn%gI=WV(kw+nY);eO-VTN*d3pK$gZb1wSTX1hp?<O5Ey;w=rC)5I5^JnjiV<}& znf_UB1U)TOGN^N(cRcu>f4LD!lXnXeuZ5G@-Mho!y90Th=}z)TXzO708wr^?=#&LG zFs<7JqcH4yLe^i8wZHBo;(3YNnpgRA))8I(?v_4)o~_H0P>RzFnRXfXJc_AI!Wu<M zIR?__I^=TbHK4I5>}`4G&)Gna!e{2cgkdV__k)RrMG;S3N9TdF#Ka|YIU4DX6uB4F zYU=8Iso2*dr8z42Ac;xhc|FX-%xzk~i*=}RT3>-hME#bYI1?p#6Ffp&GwsG+yRo%1 zkOrXA?&{mNM=?UL1@#n)arh&QNrAoyxe|KR#lA>J!kaiK?4-T>XhRs7J~|kI6^yeB zCF7zK6*a7W6CGU&WIB|YU#=szTUbB<jKUv)+{g=Fh3srgsE#0pO9p`|41h`4aUJ90 z=W_1b=A4U!DEuVmHYhc4y-JmI{RkM&5QOMC2GXjev^4ho_r5-GAVU8@B$nLeix*8! z|HfgI>msqx{fGGHna_R*`Au(Nocb0EAc!cKQ`fHIBFVy8A0W&GkMYTA@c7nSaFoOB zY#K$#t|GJL$Qew??r8ZUhd*+0cf_sZ<Gdvx=0pq=aq`sg$vVzrIZKl>psaoivtd-2 zPk)i8ab}RGah$mt8XWG+*hU*gfqX(Mfl1VKZqWDg@FKS@nnr=YAhz_tzS&Jh8}%3n z7-+>z=Oa>U5GyJdBPqW6LUAya`A%=b(^p7?A7&#!RX23|qeCLbqxNdipJ+lyKH|0> ziW-Bw)H2ANg27pugD;Jzgnk0s^^FUKS}>pdZPnyE2)SZQGX|6pF+&>pBAv<<{lxV? zb^BmcyMX*c5H@nbKk=%Az_u>t-~0JqT&TsN2wQt3Kmen8d;hs9!tX}wBqwx2w3Cl8 zZnt-t(ZM`X_TnJ1gHvn}-mibV*`UcG^e;XqXW=54J{8FiQ6Y(YLih2~^aJFF$dSZ& zIGaSb%e!>cInk3(!H|ZLAC9=i)t?}bo(8zL_3Qath(^hUug}?_!_f{3NBGGG1)N0C zJX<27#t3M;@OOfc#My8sU-k=xk^j6tO|u+Ah+9M&(*tI=pGFL`he#WL<ry|oD|oyX z2X#^Q#FcNF211u%f|{4jx9FuO<LAFGzW-@M4q@8jE3Ze1B;Jtq#71ER$m?B067OH0 zqW297cKAD`e%Rg;@SSPog?}E|Sg7_1Gl(;nQV$5TebTu#43kS4b9)$mvVPbBCY-_u z5<EAV=D*M2JSOtpq~oOdv${xPl;1vHBX)L>2`z)X0Oe<Dj09XPI@8PW;TkV5f&^c) z|DWsT@9)#Y=W*XZ^Mn4r{|162-P-RUl4erPc@DuTn0q7PDw6n)^cgQA`n;U+KQBq~ z5}q*QT=@PkUpFbBJdV}Kk}!(<UdAt=RE-p?h=PSZK@Dwo1}gkychEQ$<U_p2V4=8X zNU`9HBagU}ZpLG-rFDsNxaT~OmLLco&qS++Q3yiIOv`rT`gP6<c|4-=X$-v>_Rsb~ z;XOc&Y703`+y-X>5Cu@+A3EPnBVSTQ#7VWBBS|MHQG^E69iBBkH5Gt@u2Gg0_w5ws zHN*hpu7zgsClUDwZ8}~|#7Y2q57Z4gVAt1R6;=0e<j{(t_s9@6X%C`^faO*KcHPkA z)CltHyHT8}5Pm<>Fdn|A41P`6(_ijCNg_sa8?=QmN!W%MBkf-F@NdY-oYTA@$$ZMT zU@92ue<AWu5{<$}9%VE+qj=l9HYn+WFtd?wo;PqvOJDDfXqH3o2jL8iz6wmwvI-G7 zoul`d(#rSjP_5HTx5>h=kx3a*<yZ~FLE$<%x%rd)cS{y;hV@2pVi7Yu3Rz!>lh*qY zKd#a$TTws3MD`H9AN{aRDAGe|Ju5j?V!z(@L~mH_pOB^iFT^T=*vU3V#&sV}RS^aH z>EF7Y7_X}_>BQ}C&BI6?eXt??g7XTj05BmSM<h80dsYI7k&VGCVxr5q?Cz!P8HDhD zg?;xOS}rByY+TTwA@k(mC$swOjTiGiv;68mQRhpwu<0CwcowBP-i%%@B(dvf2GU3= zJ74L8#Zp~qiaK^qY$P$Cw8b?eM`;tO&++58+6##Jx(JXN;K<i{Az_afR-0FJ{x#O$ zo%AU17lmjqC9>`buW}z>4(smVcNDrhF!&lzuY?t)Cy^JOBW76f$7ze`nF?x){(VcI zQR>UeRFDYl!bizfrULqm^nvKbMiM(PeErVJJRV{{B(p2^XM&259u8WQA1>t4C|XO) z@zI4scYv5T(IZtS=6q+FaUQYYi*(6jFwU6Rbodom-hNcH)j@u&KS4m!;_B~h=^vmH z5#}8@aBb+aN|biq?>(!3sB7}cWc+y=Ma<`P5=~nRaYTO6*D1R4Y(_R;AO^qFaLY#& zVa@BrD`Q=hPe?YvQ#X|3+y0ZH8xxbg60wgpU2VTJEc)-`p(&U=T4BuobQ^L!9%6<M z-FNA|+roUA!nz`r*}~c&Y3od6Zd0f66y{Y>dQzb44V?t$+}yqsRT_Dff`-6O0^Og$ z)=PNv)Ow)^r%C!XeV`~Imrw~2#&IsKiP-T)T9jSKxIA_mrEP@oYk`kG1f0H~56jVs z7oJX1<nrR0iR;CM!8r81dlZ{$|GqjamC9>^^LuIV;_>vY+Y6Td*rC%2^*oK-6a$3> z*srjWWY4xqOdjxc|C>3@hu4y^hvHTp88(T~Ir(OLu0M^fGYe*NQ;9$QRs7(hbOPca zyb^j7!wQ>FY)L49s0Zrm$xjf%5l)#F_kO3}yyuvJg5=KpU<qTTd5Y&0o!wz}J#K2c zC}r^Glwc%9hS`MtkiK$*>B9?bq!Ra2mgvK(E+a(*ZG>cI71p&_R1^Gu;iY=Gualmw zIRiSr3R-Y>q-y9VZf()p2Yycd8zwzit6{#M+v(|Za3?P8+{dDwF2lI3_hjuc4R}WN zLKi(=Ldh_nJ0IDR_vKG{3L(G_S;1?J5B6z%j=qI$#BDWYcMpWgl{t8s9T{?lv^R^@ zeHaPh6m&W4Cg>WZhdQ0cn0DeyPUZ+>ap_)>TY6VK1eqwMe0n=;A{G~N=$#7lfD z{?7Id_2%<f*ddqU*^+WG{;$yG3d-?9OV8ixYE%3ym&<|>F?MzD=mol9!K&omhHAp} zzN!KTFOmKy4e*H2=o;$j=|Q^$Eyt+$(W*6-3-}0tAU|Ta2lxX?b(fu9`8iZu)0Rh( zMFL06ZGaP1QpM`h(<Q5G9u1cm)p^t%%q6kMvu<EP+ZXrd&1#J&IK&|_^faV#5-vF- zB58Lm<#L;XU%pJIC-*3J_Zx*g1XQH;V1X!*+HeP8XipBl`M_n{Kn|ddK)l~Lftd^l zz@Ci){wpA>h!Yn|qx?&gAO;9vKGlfA`omn*ec(jAj(%U3EPFKU*qbf`mmHuKs8F(A zxQ}(}TgY0_Etqm#*9vNmpoKfMg~$hGdid9`crvP}tE)rd(9nn~`7X%CwFv|~oI3z- z$Ct|l68L7jt=}$Va;hcx97j|WRF^vWb$tWb0I1>?n<{6<S3AbMz_KeTDebb6cLlLr z@qN~0e2$Bn!P$J?Xa!&-J}nrBmdk5Fq?8Qu$0f{lk2+ebDTMYGZ_=>}t>U?^=<#}u z7m?{hF_uWEDMhdIu%HCATsnA<x4ZeDvc=O)00EZg^&Aulm<0v~hGQ_AK<jJ>)EKnH z;IEw;DOhCX<?XjokdS!xGo3yP0-}q)ME9W-$v96<G~5r)hTzk}RIlzeKnJz)8T?h* zkL+%;vL<nv$?E6~fa??1{~DNa_9tg#Y|`H2nD7P2mu`uc3JYrfbf++Xb&WRw1v1d4 zK09OQ(2#Xssjhu_=WL?rQ&$k3UxtK$=KH}$!4$P*iI}^TlKSld)F1PC?BQB>CtB&p zkBbK#7q2A(L1*LDw6I`l#oY#HSr*i9lc51aR}<<FsDpw2a{jK;Wb7B?omV6iaz#QU zYv)|ShYvSr`aY?765*O4wRAXHg_+xG)~Z>Bggl@$0shx!kN3{w6crT>n!kDT<|Rpp zD%p7ACNhmzU2cyNOw4Dld?sS9cOrOg1}Fp^Ok`wQz@;(^O$OSR=?>f$FsZYFAXub| zxNm_$mytuzZ7o@M?ULlpyCn=jjERZW!+cM&i!=qoXeFHq{^YO~Pqqrw)bPVpU`kt~ z7?ofWpbd40<^(Mvt-7kd=4RyLQa55_W_}0-6zGAv)ryfnS`<9U5#2|^h+wcF;KG** zSl3~G@AmJGaSBh-BRV5}3Ycc9Lm+uXc9WQcSO|xMPHt$v2f+(|khDPT8F_BD0D~d0 zfrakv(j>5Q8t#F4<u}B~cZ3xlC5tNDD5Q^Gnp+OFbGd~-%0XU5#X?NpYcZN;cmzXF zw=I^eJZ&x6v$}FyKz@Q$D;e>DT_jo>^AoK^6GpZZ#t_csYh3_lYs>%-j+l5;C*UB7 zFG2<}A=k3x#0A{(YBC(L@&Y5069X!42+U3aUL+@gSU#CC{Knte3nsv1uY>@s<CDFN zD-}s&Dz{^d<$!ruVhUfNB~o~jtEDgY1jQ|>CK>=+=K)`TN70#L|L1F2^w-L_r0Axg zMxM7;MO>8Q4Z?#w|K|%mE#IJ<Fpy`bHi$G1a-#oe$9mM`RT#HrV}pWdB$}=)G~pm5 zEP~qLaZ_X%NQ7eOb7|@SocGg_#bQA0r(Y$Wl>1kD*1IxZgh7K~Q3xPG66?s4@*(zR zc7r&9<o_#Le+ag*M9^>+WJw4>NrYpADj#SI^>uVAKz&D_o`VpJXE$VFWd$|1Zt^)f z`ruS6r5h+L^+1L^zjR@svC<l$7EDDRAQ!`2B0K=Bk6b9(<EiH0#yl_*!O?|`zw+Np z<xe}YiHZ7ZY9`J%9?j~y&|IcNWM^h`<_NpY&wTfqA)W!><qJY;@IGCom4?GuD*R*M zO)i3_79`u|mX@lqHLzep<LnON4jc^n=rHNGlif=7bS03~C`cLUGBabyq6`uT>H@L3 zfZ%~M^;_)MNl8a-^x=5_Qnrw3aE#8tnGb~hCa|vs235qQq<cVrN~c8#Ic|Y-p+U=2 zgOsnF29f<Xn@1s{+G%T1%u%=R7!IU#x3?bvFPir%TrvnWqE@&GY&t;wMxX`nE8!}= z#m7d(W^)ozMN;7|qVAk(5HmGc`<rK-L+qX!+G=<$eFewBgY9SU94_-Au%C61c<?Zx z%}wwVSb~`xV&8*EL-sQ@H6~ym44H+4CQtyKxn1SRIzIYv4@j4E1}qS7*{0?kzu|mh z3~Uo{L0r|tfnQo$nEO$H(-@TwrNY>AGw@jp{MMIAmZ>e?$iu25=7wYt>~Z#c6<v){ zjn_Vgq7Z)5n+{wAI~E(|Lm*w~RXgXPre5*?N)U3%Ee?cm@V)ls+Z@_f`)Kr|I^HH| zjY<voz&L{7;SrMnry8#fTFd}tcYbc}eO8vP%QHUsva9hDQUi~OgrwAdydHG^xR{vC zckfPM=49hRBSW0NW|a8Dr5mOh8W=oszH7ox^~vHE0)-jgO8+qdr<#jN0^G5;tooYQ z8{pvNE{JE+A4T9wHI5Fcnmc3y2U!E319LnPG}2m`9<V^a4C;p9Yt9C}jPoY0Kwf_R z`j!3W%?}`pK!UPsIC0HT0yBn55nj2(+}zxq#9NDS@=l-nBRCs(c6J;tDZBzKunV*w zC|5A)h82&7Gs49Ve`u=0(p=T1f}8UM8F2gtg%gV1e$DvF+Dv<Ne*xM%1ybn*c&EDB z+Q1#Ef&Fsc2INbSDDuFt03ilv-I9Ecr>TMG`v(+UxIqY0t029mn22`0goeTzBWb6m zrV?*iIi8*D?ZHtRVEBMzw5vQqYpQT80uHPJH7e}Rmpb|R#o3~&&r4-woybm)6c9#m z-i@5o#J6k);u>H>6_Bq`qLO%Ru1pl)q0%R3zktB?MX5(Fb+>07$s30lYH8g9n>jFx z=Zv~%9f9OiPT-^kHxu`{Z4E80AHd^*lK_4GWlPt{osoyf2{c!bng})=nAbHXC0lS2 zwCQyHNztl%k@ZpU!5<9KCIjR&$Th~WTyVn72tuj0Rzyfh2&xXy;Xt9;%gV}vY(#Is z$?=DZVmGXQ!q#x|djt$q@6I3}2}E-Z-fwMfh13H~<J$Au>T7WH=Cb6E{Ck5o?oc`c zP`HFtx6+hhG3LN(bNc4L!HehOM)jV<zT6PB30TO!hK>$JTJ({}lT)Z+xZeBXX9wSY z_=LQC8D)n@o1X4{prT>tlr%Cr$5%=3ey{z)Z1Je=te{~v8%5~VmXkd7jOVB+V111` z-<e+}zt`;w;&JTw+wzX(xR3d(zZ(d(N@HI9xjNtVpQ{0*{1BN@#$j#)hWc#$>|`7q z3@4|RFmXie;U8d?B=OueXkR-MyqY9Egm)loE5bg2!*E`ZRKdxpoe!*|7r6iBuP7|O zPqHIEC7uE1KM;kst^Ivz6J<X*{`m%2VH6$AD`a5y_)fPs3zqb)mcLvE4Z+_IQcW$K z7y{yNb{1%UNjxkcORz#UI(%V}zaa*j(G}M6`K2`dzc69~!V6aG82nudU{X9Ues;VK zXK#RZzjhD3;jpeo)A$@NGSdcFO=ryff1!llg+7>nvM&kPcQa%OGQ11a>OfhkJ3Bqn ze6QRN!bV32u_X9x>cEEv=76GJ8OSA^QC!FpNE9Ibqfb}nCOY&ofLZ1Mk`1{b`t-jO z*PL}M)Q0o4=p)5aMwIZox15joQo+FS9wG$14%b9IoC}TWj*Z+;QqK-jBRSBA_%V5I zN`RF`R!+{i%FzP7_vX5{4L=PXpbMSaWi#R#P?6vi58W8h^uL9vGe7&-fp@F1EL0%^ zZ8k>ThjVghw>F%PrnT@bmqvy&vnXn9Vih8Mt)<mpNUDA@P|yVNHUJ1SIDQ|=h2&;o z>6mpSDzjAX{?`jY4G;U!mVk|xtbm^G>(lu64VWapzUGlTeyRg5ErebOmu{Z{j1yuO zY|AI06QU10Q=e^8d(ZpVg5*GN%$E?~N>7G&5g`%5qB<w=%o{yWu-^ew9e@J;sv0Kx zq~Nn>1l(`VT-omfh&FI?0<&<sQX5_j@f?Z`yK((!#2^>~p}C#+@82+!`CD;(p|PCg zzJ|cVjAh;d4h|9&UnDuMAe;|{aLzLp2VWQXCni}5Z-xqbA#O8P7eSR%ihw%Y6GKyV zh5S^ZR1y=RHO0!`MB|9uf&hNm=QzcT1{w*PP~3ga_I%`4%1wNn&9QEmFBD4*^?b!W zPbZA&tEiQLNBAF{l=v|P2Z3o;M%WY#h86_E7T^+hA}vNEN3L7|aCLDq>lYB%w;6*S zfDZTv#Dp$eAsR^sduWcK`XdlM&#{pq8CQuBF_yk)cw~A$Kpuh8dL9H|?L)Zz2!bX< z@xQ^QibhL$gb6kS9q?A<w9=RkH(72=UjcsS6Tkg`p|pigoC)O}V|svZ|2*R9+pEOB z-+K^9dU%8|JmRZ_XMn_iz7_@`=1T%!Ps7*7@b$mgQPYzH*W{^|Gv`Gl@oyPpK15CW z*)>^uiKYR(NI;?ccq9PzFyP;h{P79qZu<p{DU1W`!Wi<^itR-p|9qQm`yW*M(Bw7) zA`hT#7sJ2;rgR(Zl+w~t*vlaMk3jbZp1Hc8F8~;9fZkN!IRbWFXt_9Jh$iJu&Nrs- zU%U|gSlSQ$|D1q!b+E8x)_@we+@CiH#{(7}t1v~Z|C?gS59bPsE?v@&{)v)$>C>l) zqQlS&qxwvpbDYKj4fV;<o@x?bJ{TFGoq`Ih3#ZUi&yGQA<o}k)yZkQRDEIf|zXIMO zC__W|A)NHmm_-x?DbH>Ui%ZlWF6I4EDZnbIi`NUzSm>XiF3&?Xz6K;8+!j;3_HQd3 zdHp(_KML6>85GXRnq;h?sig%PRy=@>6}LOe%C)c?0#Tse<vf=0f1EIm>&v)6Nu80s zmqrbO2bkn&r2*R3#wqFc$)DxxKpnNR%2~7UkKC6eY$SHh{~)5})f3+Rv=|TsOF%Z5 zkp{OQn;~g0Qi<rT^87!AFP)K10-K)6pA-l@a+d1}N!=qfV1Hu`_y_=?E>7vj29)P# z)G5iyqhNOe%Q1*uBeRa^LnvTwfu0MgX+>nEOpI(yh8Ge|s{Fs&-A1$jrQLl8=V9yO zE?v5m&2oz_I8Gk%fTTk41`Er}uoboal;JmBOh`vK5T~IRgEojkUXu(0t0NvQm_??` z>&qM;JxZ%w@4vU|SOw>6ynr_W>B}4PCAw};&_$B6p(k3T=`JM^wbabh2X2n<%M{Qt zW9aT)<yi^SqT%-l^iNd!$B#ocUjOvS9<lKM`vJ|qCtw;-pmX>nniL_dyL?~b4VXrw zv3XuCIps;=<{Pw6dn2CaT`KFN-t@o$(x~^6aKQR}K{6-rk{tr)z8>Gr7A7P&`h@e= z|7e=?@0Px=H8`wl+Szf==g`vAyB=T((5r}1M!qRwb4Gy<8Hu3d=!y-Gx$}pUIM!bQ z(0Y+VpeQ~4KC}^AP4M$g{7i(F)^wur*;W&f6sjpA2XG)VYApqdDFm_6w+i$2C^%OO z7EjP8<<d4bh=V=C^GY$Kjil>qJVbz#N_o_WbF~ppa@0V%hm)(9ps83H-Uf^aigv-s zY6`c7;{E&SwfcANd<7-D+I7`q#I_Pi`+I#{9C~e_tZo5)1V{?p$RPhl$*RK2l;(!i znBs;8W1|$b1d5nofBkRO)WKJd7uqEWe;kd6l{eYgRzXkA!st7N8K?8l#ffW)2r5E1 z&U~p3L6#PIdmMe3jU06MKFh~4Pt%}Vu)6M63CvH?h4~l=ud6%fVu7R`ZXhMcqawA$ z>Y>!efAow`K269Vjo>y%v)s@*B(d5v6q3eSwzc*864wGSkgQzXZ3=}dC+BJKG*(U3 zJY$Ss|K%OkUfI|{yAw=lB4?n0W%;R`7jf%twXX`OU6yj;e7@FKe>$y_{^bi%mpsZa zuuVErY|x?>kd&V^p35&;Ac&W+1+Z)*ipaiq=Si6{AYLC#WwZ<RnNoxNXAar5DRi^< zJo*+M#TcRvulOb$bOet7@{JfL*K3Ayaxj=DB3@|rh7c@tOuyA6cfhY2N!-Vqhh93W zi|Sh@&&y#YBn`GkWqDO;hA!hj8qzYC+pGM>=4oHH*Y>#^h?tf?3ZWl%lfqgrlN=@= z4Rxn9mjDQLcs#PQn7<pd<!(O%!ZK(A_Yq>bq%)HI@?{x0z8y(&G&3BZ(?f>T3$vKc zSl0sy@sHMd_m(WC&Zo!tT7Sr83S`37Rwgw{Vg?fmM+OtV3Nb45I{^EwW6}RMqCR00 zmlNx0_m63}CdI!uFu`;zx62?QGr3CP=IhEJ->AGWh(i}_Mu2yvZpinbr;s2ZsqXND z_LN)kTVP5}P5ad3pAMYu*kGAX`I_bCzKs04Mx6YI<rsAi6c~pf0qRWbn(-xLV(bby z_;Q+106Q<{beKK4$tg|Tb6aqzmur)&afs?4)lp~qG99Ip5%#ULv0iHQ?_dy#p5*j` z{D=-dzA!wRWV9+UViak}Hp@72OQETKpM^01b-`X@2B_}1`IYUK1}<shu-UdxVHns$ zIR8+*kD6_+C`i;l_bQIIY5gk%COO#2RTxVv3|+2q?zc3RW&kDz_iN&JITH5K=e7}) z+9o43_vIsev3eMg%lEVTRsR*>i1|$C$J+*o)QNRIvFAo6;z#^dAmr#2o05lUF+$J= zqB(NLbIkVAaooHm>ljxg`~tjsA}NWPnB``Ar?N?6wW<FGsIPH`HnC}ow*>`y0sI2; zdoJWKkLxHD&iX1EmD(1cUwo-Z_#AGS9X2=|oFbRqT!1-53S3e%|JDYmIv7Q|(sA#p zHDOxOmyc~6-HOZ*xg1HJ9I865w!|+8LIOaW9w}`r4b+X5pl~t=5n}V*QM)~`x_g}- zyVEw;?ftTGeyk>1kj15^J<W7-N*dSr!cq|+1q#U>@n4>wob2ofbWtF?$I$437o*eM zYA%PK-Sk)NzB!Zv4m2Dbg<!V;YMiI~X3z89h&jfSwV>l=`aUg*4sq#}an(=D(SGgN zy$A&ml`Q=)n8T^=!iG~1v{R4{sM>`oM8)(|v2AiX!PUi1d*z4pSUrB&SMhRs`^X5a z6uiYbiB)@socUyCaX!OZIsGVgO)JSM$&GzOb9=pkhd(I)oali6-vD&|Vktk8yL2=A z0mHk?-_opqo3Yk&V6%QyP5QG|rarf%gyhRpogGM*7izH1?Ug@&Lnax7x<-TH6-o2C z#q9zk55`r$2lB^?D8ZW)x<MqkM3}DB84fN1#7GSocScExM*RpFx*$Uao|etXXaauw zWH$KBDq!Cb)D7CdG;tJ73z%Gh51*~!wf@n=DA6Qh`5c(Sw+y%ctoJ22_Rvw&+uK!Q zC)Krr)wq=1Y{J4IPpd+95pZFwrM<sqPdq_mwX>CPXgYBKNNE?$fe!#Li#GdJQI9fb zGdQCFPIK8y__S}y@qA|&E+7BZ*06xDMcbTWlxAuGNb#pj;~~2v5I0}0;Fi)#;DCi4 zeWa7j5Pu=`0SL@ZdqxQ)(=?Me&E*hr8M-YkfA>i1TMlwx?S+wtO@BYXpp(Y@kIv2D zMVRG^W1_EdP9}pE?HGTNZiHjvSgosx4h#7Rhg-Rt2&PN#bA$h`$yYQyB>{LE2QV~4 zT@H(rHkT=Z8Wi)^88IN|KZv_G{(TId1o|)kn`Tc#?7K;Jif04aL{iNLixY!|P7e<) z_2a;J6!l(+vls;mU95($8zj%2r)i?oS^X<~VKxAu^~D1~d-EkW@))0%_;xdj+SCxT z3OW26TUtzv`>z=24d^o<mNq~9@8ErXev~1aUMk|mLI0B5d@P1&qUCnlLzv3IM~NWp zG<vMOOMmkd4GKol6Io1Z%=7nF{WS3ToYP+89WaCJLdler_6+C-W>p*h?e`#RzwPg9 zX3GR&qp+i!<vzh@7QovG9l96tOQr~GHN(aN5T^Vjlo))i)zurnKpuMF{17WU&RwX` z;_nD=bHd#)IZZt;!RG>4b?jiSNW^ivKJ*DV$bf+HuQ+M&Tq#h%)D+NW7lC9g!UVy8 z-&e>)k72@Lj$(h|AKAADmzQV4K?~F2Qb8t$GktjQj5MYIuAFG{AJYmvJnVk{-;slf z<zWZPDs~$mk^kXIDEh5Im&7}NjUH?-_dP+%gOV1ALJkpc5}}}?eh{I0Pl5YLCULVj zee+L+n5KDFG=0ss5$BP^rGG9D!iG|<R0_rp^yPHY7b9on8zpDV;`Z^bN76iNi+rI< zM2DdiQJNt-MgLEAw+fJNBwiWZ`7@uaR{y88E02eA|M!nJYsiwakELX5vkXbo99xuA z(!^L=kgY}5A{wH!$d*t!sVH%fWhk;m)>GE9b`TX=(g~%K`+ln5z305{@4jC5zV7^E z={1k%`Of$I+1^XU{52!gy$2+((%4u$J|y<N^eSW8;x1VZ`Q~NZ31`M4tJ2bxbaQWr z;a3Ak6SelLp0V}VhH!MPWzn#2aT)m6!1#D6<Cwx~3g{f0NX{>fCz;gQd-lBftK$77 zN{p#=xWY<DW18ReuTd)hjfk=RLpc-^PR`C>)UN~n!5N!Wm76%ylHD#S7aUH}pI4D{ zGDPnOGXwK0U?9au2aGZWu0wc5r-yiM!BloqMXE0%I-2H4oltThA)~nkItTtpK)~Lp zu5Qj1edS8}R6p4qnVRza@_<FFji!B~PS=tEHtuP2icz`3p!uQx+B~V`4Kw>S`ITf1 zY|q=3fcl7e!7Ve6GZx<j<#xNx-@G$uxxD_o8+j)s9K)eoEscp0qJ%cQdfQ$24(bVv z{0?~E=%d<GVt|}Wk6m2%BSkNY`5&8(wMDibN=^X^gr<w1C3!zjKkLdxoVC=s+6YBo z_TSJo25e@aSp>SabBy=+j+r8sI7*k`qZep?*Lva(ww&Jxf(piNGl$VuEm|xt^3uzH ziUC_ah=yQ*G4bVHSubETc5BQA-*~#CM~>EZ(TlvHXGucI?vXBq%~@!%V7*jogHd0T za7y++nui@Tm0C2bXn79Bi(%ztyzEpUC%MY+jEv8?pKwO&CwLPG+tx;b1;LWs_vSLt zi(fn#Bb&-yDW81r9`q|1{ntK}OqSLWdRnC~uq?zqXU+*qGf-E*Vc3#V3>2=|e=5D5 z6lm2oG@Or&B<GM-yj*E=c3#R)zEmo9-&=cp<r`i1azQQEQ+#{>T~u!wgD441I@mf) z6?7ktmDc<>)jizh#OQyZzQ;CQ5-7kjs-Kb9dGIL6#gC7lJSHgg|H;QomwpDyBi7W> z*;z&Gc53QIjOjFJkCY#-h#aiq$Z&AxUxKRP<%o$@%I(|ht_o}o+qqgbLTcITL6r5g z-Lf29kB`T%U#lAWLUfH9=p(B3J7R>_|8aJ78UN4N`O8{Up%qp9%NZnpr}G419P3Qq zH!ZWwEK#aXhc$yrowXxo&4qULnv0xPsQt@VhsT8T`L6lpXV9LgEOfv6fuDXya#e-2 z=<y#cpk&kf*2O!7HaooG7)5_T6V<(cL$sJ@uY-aK(e=q_%VvY}vYg!s%YVd%iMj6L zj|sQO=OPDW&TS8NX{+l{aCFP3ibW@%O%uLG`}&l(n)*h_`E>QLYTCZa?p&6+Lr<I2 zj+zAv&o=8AhEQ*L35!ZT5?T15R`P(L)B(@vaQ=C5;~#5gQb%~&ezRAa){{9I_iLlh z?Bv*n>BqxwB=;%~DAjeY2$QFl3Wi7CBjt`ZKE<{cQ3|$FbI(~ZfW$h4#d`1SeY57^ z!avpw`#w&QJ^s+;(;Khlzn=;vX(ZHZb!WGf&W?UDiBLcLiE9H&x1n7tWcDe<>4%); zB65*KsKUW5)=HX$4ZfeGyq@pWzIZQ1nY%*Qq(hWjh}QdTsxr%6=&kR1#ajkL-0zq8 z0{xqi8`j$Cdo{7>MMvD^WL8*4*-;{p1M7bN$yTOk@P$|Nj&QKd@W(u?pNE-^@PD!` znLEege!lq;(l~LcwkUGPh()qmHdhCB26;ik?EMTcArzOl5@iZY?7LT}p+}yR)S`*+ zI#H2epQ!IEKoEmS%9yN4lQX$<<+w{Qj0nPTuav?lMr3&V@$W;fD14*@OYR=O(D&=p zmRNCelaK$exBj?JGS|<ABDOF1d3R9kl5hQa9i@3Az*Dg!i2v6uv^91L4~+n+Y^bk? z+(#`G9P_OpgwSZLyp;<H*1;dQ5nu_6N*S5CzKZ#=??Dm<)mX>L)O6{xWyjt;m2z%; zl)Bxb_*Tla;YO+8^hfq4Q5(}UGBUEWks9m`462}F2or=}3rdBC+S-Zt@4+9A$Xf|i zt4~s)R(c^PC-BM6_V)HQLd%wsQX<R~V6s^A`0-uK-{lq(57+ec^k|4j<T-PQZC>;? zx~#11=!r|DfHRX($YyJ5Xi%LPm<FHu{$Zr(`Ip#dxARhP^an>DV8y7M+!nv}^w=hu z-)VMfb7SYd!E*OW9=_IEV2crux3@Q3Y24i0jvc$7s5XE8{D4E`)m|c$J4>a!ST)_{ zo0XDd>F(}+@ZdoQhXF9?p41rM=nKMCOlct^Bpp2|>9ovB$bS6BZDS90b$9R1WbU%C z5R#HA0p9Ruk}N*nUV4ZKJiK(1o=)7t(`^Z98}>$GRaI8LqT>Zp|Av6T5Zr7a?}%*J z(Gw!{G)rYaKfeKIHuF$WP>`eJpmy(x){#66|A)LxqF#IZ`jTP;phECPfyPza{4(Bs z?(vHg{weJvphl=Yu7PwDEC7NP>JzoG9-Q$fPekc>+N$d6D|!-;*@}n^UO0|XJ9RmC zuJLK!d>}nV`lQ$1pGm08X?t+kaLwAvA74l{Ho?*(HywT#r@=@^?od%F4*XIexF5X& z?t_Da<MOB#liAhO)a0Y5q*M!u+S5F53Pa4cf6_k?t|4unVBIVoH;iXKDGE`swX=Hx zjyrY>C-gCZ;b2q1%oVd!KJR15pz5~jWu-)C!YEH){~Kn1D+Zw3g7cyO_&8ub7}pNz zeuMG~jP!2(o!)9%OKo$&74-x%l%AdrkaCMWdV?H~Jw<Ii1tPX}01_a}S!^gw$ITAF z@PLu=?6qHtnVPdtbliofC)A&Au4nAty?f7|O;Cx2hlc|+<fZWN@L;SOA06F4Fn~d- zxEX&;Lc-9%fP<cpq~vILXAw~>VjFxIP_MoH_`7$T@Es8D=5z8*skt5Y9t$Dg_y!P{ zgx-<jmajk1_WU_4c3y!bfU1b}_fs@ZHoM+1EvF)w<QjcawiV12>pgpptV_6lJ-gYZ zI#Q;$v(q)mFO!kc?1Gus;63glaS7fmE5Lv@#>QtRt!_2DXoxp_Of}2gYgQrZUJ<fT zJOae1^{1o32x)5C9%1wWsCz<hygEBd&5)t0+bU$cMgA&|QFeBAT_0#DZEij`Ha3MB zGJAP>4kwkD(*y(roEzzzmG0ZJ*=*o!ATVitb31}&3UC=c9GO<<h+EbvIh){{*5M0W zW&Z2PIrgjTCS_%2K8cR?bYh4|GLp^uslbEj;n2(_UNCD{F==FmsB2c*8!|+6Tj{@_ z%8&fl*;KVn_zH(sZEbB{N}Jmh9)ZmqgO{qLo^iZfVc)%Zc06Z_0zPI9jmMWm#KcX3 zj8#pC%g*gLyK}#5c;61Aa=LPE+qMldqos7PrL1yiF)m*TpcWr!ZLJBLi7hq^d~gmb zoQp}RywNruR>A6Fw@5ZJJ-ppM;EAK{=j1@}c)TKM@%r&&h74KU<F!-yyZ(OsD=RCn z7YCw_eZN|6Y-|hx0H`56OQ5y(#hD#+v<vPDspRoq<-gh4`HtXz3`t+;tElZ<drF-h z8ezy-fom$5c!9=~Vji;<05-%!)e`xIh1pDYI(%h7Z$i<0S+aFduYj3J+O0t`xNX}L zc&vy9@$NSk>3OxW&;={|#KWM%&c4v_!{nq0-Mi#jM!r*7P~*(8n`UbJ9HQgSKFt?= z;b6{STsFV6{_D{2u<O?yH(H0`SZ5718_He4>&#hY<v3+3^*(GP)6?tY{2O>mc6x|8 zl)6mQ<HaY<E9|xw8cOJRrU>3FE&bEcVc2xx$&)7^WYgn)oj%H`a3r}>gi>^%W~ttk zZaJqe@od<enOOj<sCDZ+G0E2|je`7B@McNLi|T=gL;jh4Syfw`N6)LrO)@L&wiFu1 zep}<(-sn2K)D9JF?#r+t3*n1Oxed40s~Lo7+__U+?Bna}#_obT5Z5eDNqqa(jY7J6 z9op2!o7v7YZt6cK9qN5I^r}AdM)ys~t#+kah>D2h7Zmsh1V~h;mT`%Ri@QDMZBAVw zxx+Eu*qIsL`<qki$P~;3F1Kv;^vq4%m4nd&STbeDKiu9oh*O`LnYrR>DtrOr;{%Q# zN49&iBQ_}7+Wz}y$vYMh0HeS+sL;u<%ZHFLhXby!ua5;?%h!_1$a`43CV9PDm5xa# zOffvYyutudOCe;fXoTq<65*CeL|XJIx3?xj1}ztX!8bf$g0MG1C|L$`<wJ+YfCHtb ziee{^57(~_%X`?jhJgXnl`C#~x%(gU3|9c<;VUz0O`YDquVSAn0wnZr*ob$tvrmp> z7LNCp!It%Q`-nCq+K};A9`L@armDK`LUZC}+0FF_?%%wZmX<b>2iAdB-a8ELKi8{d zn>asOOfpA))t{+)9Hf~eZ^M)2C?KOx`c6x){YrIzuDX6hOX~BSqCQhnPz13RJR&F? z$d?V*TFCSO3Y-89^KVf#KeQY0_`s-+l6gSD7l_fkb(2g}#o@1Ze%4}MJ1zdE_OrIO zo?^eonwphhEd6ypcF4l|ca_{n&4~w4`T-FZC<{Zz`B7Q@qs;o>{Xnh4U0s8U$}byj z3pf^aOFnQA8{WPdMIk0U3botAhdswq0FNPiAvsl4R20a}!6*V2sidN}*a3$Rif3Qn zX>!|LUqn#3PKrsegfgvi<S+~Dz5~S&JK*Etxcb}KE^vTILiWMBex8}B>&nT>Qip(D zL17S19|a&`NS-^A!=cn3@U8?fANj)JgewTt|CB21sE_Y@k2LJV?!YV!e&veV`aG1c zv$MBu-UP)EuS1FR2`VfaSe_4xivy04ue4`x;Wh?l6}Xj@Dp1J|=^SJ-uL$l(9(X=h z>d{Z97`VBmtHJXB%zh~a;;V|B+)JRAK0ZGFC8Z-`oe0jbp_xT208pci4jh*Q8uRJ% zXYnJgO-)fS3GnDEM;;k?4`h_FYuD6d5iBr{`uW96|C*%xtf659vT^upBS{prZkSI5 zpq?!+L(P`LY1bZ(9-A~sp>rXpV7YM4#Fj3V1|bM6uxhbhlLi&|6K#uq0V;xj|D&+q z?6p^|`r^@GL=X$=$^Rpu4pyqlyR57_5Vv8BB9|n*kX3pbtJt>(oFifSr!QY5{<;Q& z#4G$2umBMMGt<)U2hI8enq*`ga&@(aiV`0^pUqNHQEm!YKF*$la6h#4rUdTW=+>qb z8y_$bp&cp+%Fxk2iWd+z=ul`}6sC<$YildqCFMdt^_>#9a2+LL7i@J+Q|oJM@ig&^ zHtOk-!Z64S!Kjeh6x4I?sE-d@P)=61eDKq0&G<#VfgkM-9C!`$bSR~_m9CXR9PQsu zG;zLH(;{B!LMTuAGS%oNnRE5`_uqKtw(UE=!dutw*s)L8G21SZ{tBa`qo7y8>d00c z5|$-&QgQLsY!9ZTsHol8x{8XaBZ}Ral!(z$TrfYD66MWgKVz0^aopdZhcfA3a!D5I zwuew4#*!{kilG=2z~JFh-A<6eMd|R*SZ0K(HB4~!bK;j?HY^+T_3gQGKq$gq$dWM0 zi{W2L1cGqS@&vI)3Dj2q6X@hg(J8#6V6zQ1zlME6M^~3}s1k^{s;Z;YRI(_pQI0ds zZkLEmaB*>gQ-Pt4O*izWAaMO5+2nXsftZv+IVngFXR%mtFZTtJ47(APDuT0?o}%Id z*t}NCnFv?!Xv8i9ygH5>_iezlV83f<X@TAK9e8(L*V1W>Lit4i2Vo4JX8GKQ>FJA+ zkq`pgp&G>$<;Z=pTi!J_n0|mqtM^eBryPM;O-;@2ddtWZmX~Bt0eJ+X@Ag_2E`&?z zC>tuS6vC{fhTTC-kdu`q@<#b=_Ljn+O9lo8Togq1h<9DB!VyOD--_3@$gW+RlblSu z)vT~`<<(8$`2p>`enfI4K#lT~E^H>n09-CFuRM))PW6}26>LN;0ym7y&ke*gGBY(x z$IPv)5(Kd{j~w%0FJ$s@oSe%Q78cIvAP@0UZks2$b=%<i`fUyppCWNPV1-|~as@Uz zpvk*VfO%kj-(w$o1+dW|>!j1^p@JaR<B614ubz8(el_14-d}J+_?CNu<$!b#f@7UW z2l&U_6r@*d#^xzQzp*YStF4_l?bg;h-b35XN;No%J9q}xs!T>P_6~ynYP%v!(_s7| z_<~~9Ho}<_+nCQUdK64kG%9f4Ui>B9G98sY7>O|9sU9qip@$<Z9-h;kMxJsti9&gf zUZmu%Ahy6^ySZr<B6+2M$v1>utUcqdB@AaJF!-;#9t*Qw4UMfB9D?NqP3$Sr)$hyZ zX5XP7z{qT!ei%0q2yqPuZBd-5CS<K2x)HdltE#}=Sc7nLM}n9d1cyUYQ<IsA8Ef+D z0Z9d-V-LzXbf$1>xfUBM?_Pt@TbQ2@Kg(|qc6TE!eCPGb3iu&Y{AbJakN)TX_QM=! Xo$2VSi}su(50%(rXl{^2-y8BD<Hb%F literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/forward_euler_erk_stab_region.png b/doc/shared/figs/arkode/forward_euler_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..e5bedb74c797b355b85f91b455a4bdfeb9b62596 GIT binary patch literal 21530 zcmeIacR1GZ`#$_O3JEtVh3vgU_9i1MBSL0E$t-&&L=ws>E32|)Z?dz=9wCv;$ezFJ zPM`Vx{f_64=Qy6{`Qy2dqrv?iuX$bPbzbN73cjJHKyZfq41yp8N{Vut2!dseAeiB} znDCnyn@$<<51zfE-a`Z-BSHVcuuSTMs}P(=N~+gz=CScGxH#7|X5l7;;nB5QkF@M8 z9=Vu0-bGZUwN<2LIB2x3?$W55KC;rabF_ZQL8D}QhfD0%#6`HC4t>3><6YB7_v~zG zwC~y6MR<fbrR^O#d3kvGX|4!~@C%6WUu7uqGC&X-L`hCs+ckb^!o&02z^CK2SE}{o zX5nI*T+?P##F)2M=!oU89Qnqtb8;7-(cids<wF(9zio!-MudKbD-PW=G2F=Ocg}@q z21n4C_)B48&=Ewn=Ag8xP6g9`p4)B_OR%h{9O+m}oOqqETV=d^$A!1jW2<B7^=hK< zLxFcSHAc{2q@uio3;l1(Sv(jFq&b`h13^swU->~Le&m!C{e5fe0F;A6#IPn+*pHmj zubQ@%w{s^C<^-iB8|T+?dDhbDO@4GG7<=!gJ62i`<vux0z*{Qjez5UH-Js;b?$Q2g zRKjiCEBE_9l-P{DF<{#%82x&8wY%U;Y}wVEk~<0sv3q;&h3$x)<l)Abg1haGj*eR^ z69$Hcoc=+fq1Af}S$0)x&0K~RDzQA%%@lUpx;3tADFrW3bgZlyO0SrtYgcC5V<v1% z9mkfPkKwK8b~y&G)>~;TPbWX6a$hbUiX8j$UfpMNK(~`qJ#{e0V0&!xXsd<Vr=M%Q z!f7$zw1G}1uyUnhu|5DFLuY=n_So+fKAjF#`x&#<Gu9LOKMEhr+w2*R%sMhMF*z@f zIvwn+ReNj`9*`7TbdvL$2W{2jU*H(7bjfpf=}o!joz!^yahwZjsYU<QI2~E)wApx3 zmz6;SJ5El{0j}(<tgP&8&*Q`G0Mt_=>Z3*D<IE%L_3xj{%gfuA$H&Kw55AE_aO7}o zxsvt#T=hBLuipM@psQ<Xdu4rny=Hfg;$gdqE@6g&tR3I4HheO!cp-;xZ?0PBmVJ8` zNafUW*~RKODk`ejbJuZmWnmzT^CI=B&PuNc8qOau7u(Ombmkn(<-@3Q#s?o}PR#G+ zr*j&Vd{|oxq_B0Jdu<u17GzZI{#u`_PK83yRz+3SYo+|hM)m=E#5RYFbysr@E4NlE zR|ySz5lJC`gLcW|-EJa@9jWq!*x0g1Kl|`VnQl7`+>GHi{#xU;Ki%;3p`&95XL3wg znUKxX4;!1N%1;R|YuZiv93MuAJ)8*t{EC_AB2S&Q>HYhem+pR~c-o(nTq^9fxAEx- z4nA$o!Fqd)k^9es-QR8N=h=1UmBP2bdaOc!`zsfR@@f}zEB)97Q2Zom#Y-cF3f1Bc z-x@Qt-m{g)@!xy-8vPOW*jloyJ=D=FdoWV)4gE3Oq|K||8lCHmiyC{ytgfT~K{ZZb zdHCZ@V=(ED?xe|DA0HbVoA+u7x#e?j;%qB^*6goX4`%E6u2V{Q?gWq-?Hv5>_BmK< z+1S`npmLKF#n!^rFfiDkdP2ljIx{m9!)b6~hhQ&va=!AzhY!OwUX_k6ZIP@-r(9R7 zxBH`*)#8QB8iVRi@ocPUL*w*HZ6|tD6}Fc~z7*a20)xLf-#a5%yQ>N<=yyU7z>g#! zqw<9K_-ygBRfk(+-jjZIHk9J-8%<=!<1og%zklGIy~uO7EwZCSC9nSAR|64u)h`)u z@1q!F?~z)c<12TXRpJD4lDDm_7WbnSGE%r}cD{|5Km77eRn%=gZME{o{5b0RP0y_n z%Y~Oti-W9{UYeSHed)>rv+fI3y}Wj#MHxQFM+7%t48mSvQhk$VsVaWTx=4G-&}HKJ zCBDe>u#2|lQ^VLwxeY7QxROMiGWA_;HZ$8d?QS0yn_I2+W%O1Md@Cd!evE~qlV_Ck zAeBA0EJZy@LU7{I7c3$%6RW2~wZG>*<MgpkpS_{3<TBr53PaYm4D0)Lji>N0sb8?w za||nWs^eb0`rU4Pq}d&^S2GE_@MtZ}XZ+(Gh3nVbK4_#;c`SWo&#ThJjfjaUHEVj- zEqPo8vwP{%r7-cWTUk0eo=N$=?t^aO>nZOqovVn$y(Z-RAjthzFmInmL}H?mt}dC$ zEG%K{;Q}x_fd%@SnwqkU49v`S6BReTWSsH~QT5BtdB(L80s@1Jv>{~NgVCQBX{9;r zHVi+s5YaZy_oh~}nNHO`UhoN{6ef9F;pghIxw(1s=FQrp&Ah{CP62_fjQ5F}LtuHb z_VOYl&n>?a`&EavPzx*U%Z-SyurK`mvGa7@W}|eA)Ng8NOpj$<c`(egiOb+0E8$g9 zQFD~DYLHlaxNJANZWXpDZHH@f)Ae3&N<goOT~SAzpq=dp26!W<e$kDge%qM9dG6Rm z&0^aL{qnf*@VDN51Jh>TCQDPd?r7@hyyG~#mpXBS^U_46`9Mx@x0-Bc$U3*py<+_$ ztF_YF!%pkF;sbPxHUdQjTg&*g_wV1w6kF&LUDaM~Zf>5Nn-kD)4g9(aR;D`hgF&h7 zq}TQYtgGti_i1VI!VjAlGdB7Q6Q5|KI^QNUr5G)|AmD_J8W|OJ&t<K@zyB$<_fCS# z*EJ7Cfk>JOTNi!((bfohkB#|cRkhEbKZA*=E_k=~ijsnYf|`1D`*ksaH8zR4mzP(P zgjc`jWl8VbUL`XvVOiE+AAM1MyeJUlqHAm{>AW<IG?B`1+%CJJ$JdBGawB5g*5&Tq z^a5`~L&GpC@q-Jp)v+2o%Hi%MHFj<<U%jfn&$L01%q+c-_fY&U;f;&SAKmsgeo}bG zi@EWZB}l7hfCZ#-QZhA7Ua!+Dw8+5U-}sqo>#`X;3bv3&AUAOx`=iU}OoL!N&9TJB z=H{)RUzj;LRV&w5CMpM_WJlcmT;m8BTW@CRWVC<j>%**)yMFzdyQqZ3(GwyGD^F!B z*J|U*ydD|cO}>@cPdL<PQxZd&6vaDDsy{Kwto#|X*>TU`o!;A<-@kv~U#ZM1E4yV_ z_~C=q@43#=nk42#SF_)>A8>YF^I2xLFgLkOdc{OUBulV~iW=zU9x~w5>X$qyhkad9 zQ9-ZpVjKo*VVz3c{e${>cfbDMTm^-N1IPDkjk)v+<P2->4`kMzr)aGF@<JpuG}LP* zRB&NoAu}_xXtMXtojdLA?Tg2UEU|CiWP05b$Af(q9{#J1JrCwI$EaF=pVRYjZ?kO= zO!H99%KB_OI6K(o%bQNO$IdNG?$yi^%cQ-3p9fYBt^@BmTJ7O7Pmxko^a%O_jnf`V zx^gG5ASX(KPu3~-eFw&wRB?g*^yR55+C1Xvqxq&!_9n@UT&3NjHZ~qD7as1+guz;` zbXnCQQ%e*R4hqeBFDAWYSg<fSZ}~oX?wSYTd&5fS1+|n3=lfhkdYmMa@0@2Z@mYL_ z#XC30WmI*m(z79uz}<*WLc&PBZu8sNX_!>!<D)~P>R|YcjEwAWulg)~Y$?Kj^1)KP zv$EHs$BLBJr6uqJUZ0~{lEmemXZ<Zy9x9bJTgr(?eB`64G43ksdkofvU28Kf#m2XY zE{lBM51%4QOLWoD(n=Lb9hHdnKHOu)CnX`t%*w*5ou&DjP@-)#kV~-l`$u=)@pkGI znAsxsMU`;w>W!CsdEg?m+F`Gl-kn}9oy_IxFL7~lavFWeA1V;wT?&hsNhNk_Q;L<M zK1-&*%P}BXWJqfcIeYnt;Jk`@MpwLWYOekMa_JC!`ukb-P1~b6qh?oYkG;LT4wbp9 z({g{t@l?(4TJ3X&^;TPNuS~>weYkv0npsgi>9Tld>u9lcaW~(i`5T+YFcvU~k0(=m zOE0<30u<VvDD$Qs$T1MKx$<b;y*5iXPbV67r+($_%N<&}y6>0MwQ9PtHM#*0rFOpU zWs=b;#52CFbVt}`v}mN%ZqmT6x)>hQEwSI>(pAN%9KEqR>GQ2ISS0D!m|d-5$%7Gq zX;m((Uo$h=CeM?<A=dS9Fy7x<-rrn&zZF0!^5}!d_KFBTs-mo{?B17mVDuDm9RN%L zrg=_&bs;OSM)Q4N0$_n&rPj@=%Bm_cr^_}&FHmOn{&)+Bs$L=Y1Z<ZDo8?kmr!23d z-5(1w%js-fF^h9?cDWxu{POC0TUvwq1{Ql=pX3F>G-IR4HfN!ll9JNslXRJVBN^7% zNzLN>0}B<4xmsMx$KZPdEMBHsCVA=nyf6xgx6EOtNcM3t_vMY|O#`Y_kD*uU5*bD$ z$)i<ng{#+yLI-m=Mr}6UOCBnTE;j%S7#K@WPZ#&t+VCo~E1vfWqbn-CL`@Aw?baa~ zW^_~(!6n}BU(_WJN4mY={idzyS9TjMx|eDw;eFsb8`wU3A6)gDUt&~Yj`WT0gxRoI z=b5hrS&)iE(B!nvI!=Ih*`7q>n`LwpZ{Lo8^{UW%h|4Je4dX;ezv~)%U3L9sl9w0j zUN&Kyw@Y3uDM+?U{Ww;{X#udP$LtOO^1K%?v@mWrkF#tZZS?G}6yccUWnCz;$&DPf zubddgzm`|Az&7dB-~KBA1>SeysD1U?d1*T@S~*Y8gKnRrhm*68g8q3o7OIkY7uQCu z^G?--3(WhSV!0_VANZ0cD>IXjQs^z!LUSm^P^v;$Utb>}7MTNf<1@6ml`A5fFNfa> z+RDyesc`u@WHr&2G9h2{S)I}AhsH(sxSv0NW@Kal0^Z%-l?i(D<_$y#WMpJM0B$gt z+NyWw;s*R5&G#e&yhQ)*Q-EUW*z#4U@=WCzt_7RgJB+d!Kjf7MtoW=pUR|uYOu?Y2 z91;>j!E4?cPAg00wb46yxZ>io(?A_LJIa0Yap!A31@Y#z^z^%T?-pARb<H}Szi=V5 zdoE_rNh|%x^&_f&*72to(aR#cNpD!!ZI>!wX~v5<UB5ixIN>z(Gk!)k{r5yuOAC5y zmR7431KiQ8ULO0FB<iB(p{q0XA|&MZGSM#sv1>gB#{5;mv$nX#(nD^(yvoFnK4C`Q zAI>*j2+IWcdZ*>ZWtpI&q9R!I?sdKx*ZmH@g>d(OC9?@r?x846UcWd|S<evJ{bFoc zCqx8>An<F(<fKuUeH<*S^u|s<KR?)wH+Qe=+`6^X!Pkww^RWeo%GCr~O(c1c@3;-V zIoZE8kblpBD7pXP{Bv&-&VoB*BzS%LHAj1k;3B|s?j0?@i?h`vI_q8gdN*CX_Sf`N z>P*tRH+6JQdz+}Lc0xQbpfx}hrr^QWxtP+_+S=Bp>8EUHI8o*HyI;7O{EapplCYW! zapXcqcwX(1{{Gp~&8W^~@yF@a0(!W~8w>%tx_L(TbvIz8rXR)(8N#qg@&r@V$0Un{ zrP-f*&=^Gg@#Dwq?ycS3ljRTJqs)5VO1ITUDq|<Qe#3L}TJB%$6SQUV&<!&8a;|V* zuJAebp56M^6yo(`TYwEy(#O7?vs7$vK6RnkN;#Ut?R$g*CVxJW_{I&`EFw9nBy<p` zYUT0unle@=hSpRhtEco{rr5hy!HoAfDkjEdanPp!gT~@uj+Rfl6t2U{xbSjVjdgd4 zRi4i8%TLmm^|j)Dw#RS_ifopmWIX2GcV}a2kB>Yy-Oj3x=O|3MBwrMB%@_INzvpol zy74K2=F9JuqSS;$pQBv>n{1`EFx2S1x=<TQd}?8UK_&=%MwTqr@vo<nkufni8ZySC zTpz%Ye(-4RN)U~DXlf)gvWL++figNf;KmS;Y62VbriYE7&1jn3XN^>Oyv`CG1+S*& zX0~HZ#mO@HZLY(u)yd;z$%Qio5~2%;#O%i!c1khVUl2?49-Q8|w_zjj{bLK2R_Roj z<k1c+vC~FAV1q{Wh+j|&qqm9A(eI?>b6-)Zo7wN(hPuH3d5Q{@T^Q4^dKayF{W`gj zy$OVXRi{&}xGlA~ta~KVu7z9x%UxzaE#u`??abf^9z@{5a6Sard6#PY*->7V8-NP0 z+-*CTN1gD+=!j`if2nR&W)tWD*C>04#zp>sKRvyS<+HH08z7>v2P}GzY-?da+0a;& zULWkv&e}{K7>_(M0-jV?+0~85I8-+-PyvV>GkEp#C9m81_h3?H_s+NPjI<$6!r=;w zxgj9uRcHM%bg=x0cb}L4a#6D1PwoL&sa5yaH-3I;s}*rs$u^X*pORX}dU9kXs15c# z=BUCZ$k|IaDIxG{m*Avls!=nSf7x^(g^|Z{aeRFI=HgIyys%cr6{k@R**K-Pv9tNL zo$!l8T}{oG&e4N`ROti}GC^tyA{icPvY1tqfh8eZ0|SG@R^m9eUqc0+$j9N9iwYDe zh7W#=qB+!LI=Yb{=GM1rZ!+7k3&?!Oi^N7fc(Oso)3a*Qn0;k12kh_X>*0?l1Fnn4 zJ(oF7vy!f=+}qnbI5<F3bH<9T-zVHM*jFyj{Qlj1`H@vJLo0l#Yvk6n%}7E*Vp}$S zdNX(Q9Qo+p<MtWGNCFLN9%=HN-$9IuvZuZnv*m?VISa_;wZBB~u0NxI!xENU&CZjG z*VkjoTsJlXq1n_GfkBn<_v%T5r^%PivoNS;H?QT&J|%oCo0g5OXP2LdCAcch|0M8D zkb4GnO(?{M6Gra$-sa+J)o-<BL9v@?g2{C{p!Q&vdo;jitYiXAEkq7Kw@I%;z`wNg zV7V4BF1r8x8?SD##k6k%j#fz!xjA+yY+CQ{=Z87_RBQIk0hhLegM*%)-ogX~UbSED z^It!%1k<jlr1Uw@=g>NjI~zPZpGAid%qgIZfq+*`s`>@y!CU()1cKxF9^1CTeAMC_ zJ+c6F1_c)H-Mi<rKQ?)A<ZIVsP^(cO;BOqbAoj9eBR^U8>HQ>C(d2}!_+r$zXan2c zuLLd4SBqReGcFeLS@paHp9Va|-cgZ~j7&Wm)m<huzYL)0HN?*Dx*m=KzWb}S#{2F5 zEn(E^>gr(~KOe|$W*7e1PrZ$o$G(~^93QshWY4@$@*V}-50K#dn(G_>dwmd`zU40a z?J5QiFa~(D69!FQR`+tEBy7!Y$!%9LpjYs|6gvf?Ig`V0LUv!PEEC<BA}zlhuZU4~ zqwU7@%jMDH#gRfw*?}Fv8!+a}0OtW34|IjlMzqYZvaq1{>sX0R@tsz3ec|~WYTt2! z>6jytFrLM89F!D8Jzp7P8oOV#%m};wngS>swN(g~JECf^QMe<=QZ`AB)a5~?qnzJ{ zs~8R;<qf9bixQq?T?$c=k*=NW$@3$H??o6X=+s5CG~C>Fi-(M?ZQUqC2rv*ei{B%j zgSm$LzypDs&luvQ5_XjPaYr}zc1FU!Q892(fTNVz={EE#9{o%d_kh44qvJKRf2@!L zT?XU&FbY9T_p!?XRKg?xMBAG0y#tU~TC4$BCQ?$;VrBR370!%DJSN~#ft6dB0LpOx zGG(a!9a#kNUnczyJWZm<itye19On|;LtZ{U)z{(_MnEk^YHUH^3ak_G7Ump}S^vK4 z((U{Hr>^q5;L$yY4xkR0LaDA^y}Gd42NZbSoL6{q<#NebB(=0-<pjh)9c^t3!yi*e z0^nO7Qm^pGMOM8j#<kuM>QW0lh#g!03h(#FBLxx%zp(uj(8Ej$9XJ^`n&lRfI)4BV z7+q<GnC%q)1&DG0K|8`E8A)m{Zx<toZ}rda^8yWeOQ+oua-1tCz^8DrvI+yd^!D~n z<$ERS9CPMXQ4xQpHdm&$2>iXkNBQAqdHlF(quv9o+gvfcm(2C_UXR?xK<Z*+V=oql zAp11Z<f)zq5Xy9N;R0hVWI0Yw=Zk$$#m%i8l>+eGf(#qF$<Lrj>wgQNG7tk>%VY1k z(8OH2a!i#@dsi11#LJ3`;QH*%@!=UJv;ws+-+lNn4~*jw7kW!L-T^uYpk3Q?eSJM3 z72uKJA-Y~u@HAdtUJ>Ud2ubxdG(G}y0Ly|$dx7iraJF7yYc&pnm<I(1|LjW-8A<n5 z9Tt;@B~kMBtyHC4b=>RMm!=-WuDdr;;bdf#=xhpHoJHrGYdC4FWv(}%|9^%+OQcy^ zh7P9_=aQ0242<Ej@UDHgkRs6Y7iImhkvig7A`+4aAnNV0n{%Y;NEqOo=d{x3$-RjF z;YFR0qN3cND=*^U1wW8T6@n!g6&-EiOic6Y&JP#<XV`d%lwvDo$)|0ML!l4?c)%US zaQK@i5We}}{ZJ<ZE@E?Q%nnU!PrI%IR@wtIBH{2&PAG9)1ATKHC74YQ;2Z&-SufWg z?r*Cnin+n>rd^w06d|fyov0L~R9|6XfWDZ#Kwl8cL(9$Gz2sNNbJB}x!FvcIMRR=c zLlUC3MEJzVSGjL4z*+|`0^s3Wm|&S80O>WrOrAe~e#pqfMn`9GK-W0OYpE%OOwe|` z>`n_|Sj!hMnZU7U0S(etTLVT3j52K_P$YR(>(}p2Uv?Q!me>MgrVmR5W(ZyYv`eCa zZFy6ciLuY&W*`9tnhS+E@A>oR;Hd@f^)*^2VBrvE8&&T?thoHOdOwm?D^2Hl;Q;+v z*!gD8#0U~G<$u}-s0EoIfJABU-Z3#T!H&?xC8nmX1)J6xCs;YLl9gM*CM>Ln8}ahx zdZ*yz2O?lqJpjT5pb{YLfz-i+2M>S{1yd1uoNH7qLQ5-+<~_nUxEI>Rj}Lys;!##q zv>GY63r-jHZNxHZAo@P=8*6K8fZ@Q_Y8a(I{LzJWfVr;{5^~Nt0Z0M!YCTdgtEDc^ z=-=Aexw)?vYOBip;4m<prlJ0G<vB#?87a9ZV;`g((8P?MrndHX=SuVt5(1&{;|Dvw zvHMR(+D3pQk(KahH8r&rfIi@OA{mc&S|p+6{VCT%Aj~(?D{xxWp>3qFtD4@Pg^h7b zR~LvfpSh0LVCh?0T70%AT-rnclRXO!RaI5x<mT3mhMWt9Oc0PPn{L;Ym4W#|znRan zi$(bYw-GRM%6^f44zS4HItYGsodG`*H3mI~l)*T(fXaJknpQTD1)tjOJ8|h)HAI-R zE5I~7Iy%@Tpb%hTuKY8!`Zb=r;OGlY8v^BxbAe%oEQ)>kZJ8jQ9DQ+s;9w)$^z3Fo zFD@*=Z=4{J!=}6fXjyc%sxUwQ7q~KL=Xx7EkRf)}o6+uHfs?0R9m+GFzlrfFiXTA~ z$w*0?d<ZUyyBBTQ0><=50bxAIb+Fs*<Na$&de+&<$jHph3`jw)`#?+K({6P1^MNf~ zo&Zh)kCy9p+1v5MrNZuU+fs6)^Q6pb{Sv#dMBhY4_Cu0jSp<zoD7@~?pS(=R*v=WR zzHX7^Qo2jeva>ZA6EkzxD^V(NYrtNxvVPvq;4-cmpKm{0vXuPoC4BSRwE*6AP33aR z_f=K5%RPX$knq}b&G`Z&C~r*ej!ymgdIDepY`pU&>FE1D_iTL(DygcZWY9XfWrkRW zh5m8?3djmr{+s$O+Zwop=%it*ph=xC;DI9W88rz3$%~NDke2=gn{nWtuRp4dh?bC? zU$J})fC8ExFDVh=S~>3Pf=!o3*8CbQ6oP!Ogxw6op6E7rY0`%^AwVVw028eos`d&x zcL78qAjE5ing#}ykX0ET9)AA(?A_16zXL<8lYJ{W_aV$QI!uu_#`o_1^Tap-n^B18 zlOT}MdapJCOtG$^6VT#dDZGH4t^l4#jE_$Xw-=yYG^fGb_wTnKc3!>yCLYL}L}p+G zo8#<igzdhHg|$5VqACb?a_SX)?@5-0_{VOnB&VROfk?6nD1YIHbFN~EU?d>7)0HH7 z4D4ifcJ|rHN@qf}O~Va=P0xM1?AL6JvCjL|;Ly;^=!ol7So`cA<P~@U3xVg<*44$I zz*~RDp1T9{zXB;ZU|D7KUP6uwobmBq-m&ITIV?SN($e^FK^HLNjc64xuMmE2k3S5{ z7MwS~vRP7P((wR5qQVQxE3l(|^HV>SlBODb`D~Dc-aG$i>;BJgz_TE};Xp6EHpHgs zLtAxh?q~0?o(G$fSSdE>JwOo3$2+*e|HD@Z$*8D2AGzl1g<eG9mcW1gU%93K`3%e% z8d_rXic&D4WMH8CmqR=8Zd16=pZLq6eFx=Zhw$*A|MpbA^gM+B^o#$`HQ-wZm+yd^ zSR%Lv$h)fHUh&+qFATu~4<|ul{^Vc4abR$eO&LN~GusGQ75XYFXPFCV@hzM5mYa~j zT7ZufMJFf`%ugu!)wZPq1VOQVqi0AVDv*ZknFqM2Z!<FiD41glGC&%2Y>MFobXURi z?=+oE&hGza2%Dt?LsogNGhtz7cbxgLJx`07{T!bGLb_=gBW#ZJUSF$#jSJ@k<TlJC zT2Z@HBMI@WO5w=TyJSj>Ls`oylIF%8AL~IM<9u9b3QS9o*^BGi1l8OMH!+bA8u*#X z=w5I<1NjGRwlh+<0GQk&S7H$|I)Ck|49tjT1Pz6@w)V!}VxDyjIz}poz&a8vJ>QvA z!_<1rl(>;7m{@Iw*3$|9j+E}n2O}PIopMx<Nu+|Ho8*vzgltzQ*C`WqxeLm@gSA8F zCm)a_-ta;>!rsO`^6Rf2a8vwUI=I}LcQ)3qzw(Zue}<w)FDt2AD4_@P6G4wuFj26G z93wa%blbHs#8KFjlQ8(+=$)9qHTptnG9aJ)WcB(^^`1HvuqtfpjE7Gr@n=0Z;J&a5 zvdd!-#WPWcN4Q7ey`|P5$rptC<#`$jl5cEX%AG2~{Codtht{VYXCsR+Pe$#RyuI9x zy)#8V4qSdL`vXPS%znLK2%|Ru8_)MEO{~&omW=8U`@ijf(QHa_VcO{vfvCCAN&D?t z3g|h4DDmX*Nf@R$R64O1XYNzf?J0))YT5J1_a`fBa-F=`#K&Ag?y6%NN23B71ui{b z!X2Ygz>JoG{|7JO8qg_VUYO>s1gon>luK!Bs=QE>Q_Xue^jUHZ4Ut#4Z%)q@tRFpr zid$~tX!r;(P_?HF;ESNg(6YZk5#;_H538zK0TWknkLEE;^DM9LvycbmO`d;tq#R=b z{S=unF9Lo3#vy?6D(ff5eI8Q$*glnrB#7xz7P99ML4cBAP^1yDKZorn`$GE)Y+46+ zE+*xHFUmpF;AF{QD9`vIQWq=^FwiS*u<1OX@9o>BSgp_r4mPI1C0zf2_0NtbLEl|I z(h}?TA<+%@tZ6X&Q9t9m$<by6`VqjhKpey%FOMlrFO8}5>4O5z`o&9l*iQ?GeRt<w zusdeMh3Q`dk_LYf+p&eiNuxhp!}s!!b@P246y}>gEFp(k0A1$686nPRdK%w*T1JkV z!32{~&9`Z!fbS)GuX%+_rLk%SVC4&4l^dPIYCl2VbWd{?XcmO*zd1+|b(vui*GuCD zX_knk68MAFlEajAB#^u6aS$nRV(@T9$!+QcQuby#;O<5tMVhK5{<GBfLi>gWSlFT1 zc>efU)EEZeM#-h1F}S3JJiejVeimOnv4&C--{?&|dN0ylI+-i;Muj@slq=A37|8Ho z+AZHydm94E5D7&o@)vZzeAn8wBhYtlNMn-N&ym}geJGQPLz`2$fKcC}ZrTcaiUq!; z{pg*C<r@_IEKyPF49xVD!v|!lsg2Bv?~jpvOhZhKv2%9>_4%a7e$t-UDBruX3^e$7 zBs|Y|aNlb9D-KiOk>H+QBbG|d9=w4z&JLUcCP;M{a`t2Yz{uZLH1}X)@%YPQmB3ov z_@;o5fz7P%y@l!t!^WGJfrp-9_g6ew*gZnu=zV)$Q~m9#6n#(_Vtz#&x*AUNSjuV< zLs6jtlL8D9K|vQKCGw!5@pbdxQSoV1Kupbag3M1Gi#LiI!~cA(TacB4A9fY=L=K@P z(dZ<uz3;lvpHWp+1=1JLYgn3_--b}Yo$98hrXx_Rle3U1c`%R}wZvPm4=<;qsgJQ} zX>7EoqbL}blm-mZktA7LQle8{={Va4unI!v5ZhAGUsymEypD<aQRxYBAp|ec#y4(Z zJ={iu7#QW`-;L0Md5L3gO-V^{`#pEndhh|LdLXLI`S8JY{WJ6L-@nN?^*2CjwCENH z;tOUbru#7)D-)t(0Rg+{R&c+hB?)hu!&`?);5<4JZU4O$I6VN{+{QJYfDnMz>VjAW zqSoPgK648T0E$nm-{vFo^cXzEv?RSvUAlc>q9dcD;Tvmp5oSilPzpgc+_hc>>essb zw+MB+5grZm+)PsmMMd);*lzPZw6u-B7+6)&?7Dp{#{;SF-o4Aryly*UA`Ju0^h}Br zmN8seIIIvxbzX+w?(4X<8)TtTDQRhP-LJ--$813PLMBr-u@XVAU~%{EPvPy*`TEcF zh)$iaq8zd4wls*;<Z&H3uMW9#>e5XG;FFPi1p;fku{dN0)GFjqA68BP#(TqKT2E%| zN&KR(o+Ew$!-SRpde9l?l_wy3B9-B{9_(245vNk0dfJ^RZZI}+%h0ge<dYw$o`7ir z6bI@EfnN=fB(I956n0Eolc6uTc!XQ08EM<fvnj_*Z64$qwxnk91A8P*iIleS=a=`@ z(d?gjxpE`6SDZ>lmz}wds>;&Rz5@vY>{r86BBBHPb+e+k!lz7Fr{gT*cP`RR(pSFX zOHb%Fb6MzD!qw2z`&oRuJn$U^gYro|vyQB<q#+&hnT1BB*_9p{JU2a=iQ#7gFNBbA znp>K!_NFVuA*a{k+q7{91_o$j2$@oyPMbLJYvuEbGPg=UIbD7`H$l|JsN#`Q<?Y>^ zdJqZGBo+d|$L)n&H!Gum`MfW-iJmDr4(qYfw6?QaI1uue`7Bf*C->|;dw;;}>@2m< zfrFXZx7aIp`U60-@&@8A(E0Q;T6QOHwk5~}EiEkpb>;8x4@s=2mA`P=yNt2&C4T-W zK<}<4PsUJ`83cEt&P%ObUAfuWl)%bE#QfFsw`y1mpUcX4S{j2>@qZ90=<t%?vMU~7 z^NY)(uzGZ~wU<VVl`lz^+fUaA=B~<XPbmxeveXM2-FnqYY7S}}&|uAVCB*&tfJsnO z^Iph!zfv~yqK@bRU?Yg1qkd0h0<!OXb2Wrek>aiJY1H|$wA0Z|{WnY_qNAH1NDMZX zx*-}0It}2h`hZli`{5AoO9n=Tg)yD^#PTD^E%Hx97v%i>wRoa&rL<FtpQMM=Ow)LV z;h@sZL!U(c;_yZJVdFhD!DjHaBHMHNW5yU1hp8tkFosVPkaNJ73R5A12*q30Cr;rs zrVl-haZLE61+7o)HC#A~F)YtQ@W)NzkvKP>;zyRACW-i;hl>r0@{tG6nF#0Tr0cuT z6Q}&?s_ow!NtYRrF}~3rw8M;mOZlVzd1)YAI)&nQ;Q`~j)mZuvDX}a{zVjDE{{uG< z6Fii{v?rVk^w(1i&p)rPi4e+tdD==ZU2luNon?<g{KU@wlR@(L;=v^G<-0;o5&?D+ zn5ZkzQS8g%NW6-=Aj5y5^?Je`BLc*)8AS|(r}}Gv+_$0kEZs{q%oqBL>@~uytq>{V z9rwQw3qlg$t>`Ko)J`K+Jv?-nis3=-@zEH_O<$&nzYzZ)sGhiKM}z?J?iHgOhpTKo zQ%@t@{Lh0BbeQp%@RBP^VZ`=DJSmh;`jK)mlor{!_B+TP0Kk8dV{+QxO7k&jcqS)X zE&gY)LAPgrh6366B@)qj;@*ICJHbN#5k&>@o}Ix!Wcw{%{b_9Qe1jqt(xWtH!uw~6 z{zFMita`Bl3z5D-t`3b$5z;a$uBZUscf#jjhPoC+Hb9)zR8)v?ajifQShkRv1*wog zP%M>!rFeJl>|hHI6~ZHzpc@abVqvP^{{lPgoyu!RFotzmj0_Cp5aEW2tp|-Qzfk$~ z9XJ$G$L~QS>G`zYp{Ef)shLYmY7*lLT+)d^)S$^^ue~A^9T!)w*Z!6ZB!=rAV*wQn zYC>_UZpdImz?u)SEzlR<zdHrnQbB~b(MYN;_s*Y0*e&J^JGnH1iy3MeE3|7*os6w_ z`?lwg1eY_k@a!Vb-F47f)h!wWUyl|$K*kZQ<V9*~pI=j-aL;MdF|TTxUZclFk41NE ztYVUDkvKE;3cU+sC&+#EAsGx_=PEgM019#=Xz}IOYL7|x#T+m{zhVdxB#s`uWz7r! zfLFDV{zR}CQT%Uu?Csa56GuE@c1)fN;}rm50Am?>9+oU^2iT|%rEtisEP&AmrHwdM z*yMTd-F9Qp{fgG7V<L6U7fVkEcZh`?LP-B;ad4UXc;{*GU3i$Uh6PhA<Pz{{fpnML z{Z2|60+Wi!cBq5{;jsbQvj7yNci44v`9H!s9HxRj5%GD*O#L<QEO5zWG6$d*^aPry zlk;r$b2k=*=G^9{4DK5Z#XCn2Bud8}ArD~Sk6NwS&t0#)3Qx}G{Y{#NN`c%uXmxEt zq6c)0ySuwAnH2<-b!RvtXaZ2c@d1?$zNj0(KqV+4q1Ca5ba3~MWfXP>B<P<wK6VBL z8k#jne0}B^T7kkV0<pkqEzEp5$dTmA#NhHC?!Ze64WB+s7E>|Z1`?Pyg*K||^HUG& zgr?JQ<7U%qLnKSoX+axkD>pZQCY^k|yt%bU?uE)=3``1eH>EF-kx6b1-+{aj?_M2< zCg{Y)#VN1#(K9n!0`35||0@Vm+M?K@hbuVLp7|9OquJ~5>RZy^yUfr!Pf%;s?lf_O zMzwdo4IZ-x#M2`Xfk6^w7cx>|Qfr>T@&bjD2XY(k+Jkj)LC1STwU9HGl$7)Vp!6;h z9SGCWxiG3;yVmsm^DA)m?EXPvVRl2g6YzHV7nEpiV{=mz1nID{jjLSOwrh_MC6CsK zoCK24G4=6b?J?PF68GJKJnx(O`atHQQ#$O*K*;d`{REA-g^9W>>U{RsEoPz|0@BmI zSW-b&is=v6rzQG^%yhN2$3f}Bte$wb>dn|P&@$^FQ-w&KUW<ntnh!}96*V<34vv1V z<HJ>-S|GGx63p-3J>^>V$|Zv*c^b<X)f;~O$M*)Ww7fJWRn^1quhc=|@a)+$^o*fL z4+bMIBg3KmHXa@x3<otxgQ2gGYN43+a}$0vAC58u5r$DanwTHR(q%tBg&_7!4|AK; z{v<kJ?>$j<a}s|+CC=t=^|h*eX#Eevrlb^%cNdIf{^_|V8>=0!`DB8ubIY5p%Xtsh zK%UMN3G7@QxnlScfDb%cv=82{r3z#I)o^^YUHkq}8E79zSzKaL($w4r8{3C*W8-tq z40hIf$zmEV1|BN9w)i-A<Q<M7QAp=61U6^Lkx{R?>8hrkVa200(IOp>36fHR2_4Dz z7g&i(%R6ms6((#r*&~@3Z1<@~qE=`vd4>O&ET5wvKEP%!ZPx<79c=HW4OBUa%!gNJ zG9s<5RBC(BYe4QDV=G9*r+}4(p}J>vDyAKTAQwK<-7B`6Gy(-C<RVCAZbM@HZ@0iK zG&MC9T6SNMVPIe=vKbp(cHYmOaeOT-{}5yxTrt*g2P{go%Bez(n_C^%^cxW;j8<${ zJa$H73-Ej}kFlD*@>gv}A9ciD0YIw%(X1&oOd^wmgPZ#p<bq&TTb^IKW4i{cUd3F^ z?*J4k{;25CuxB8jTp9jIFDhDDP~Zq^9}sH0g0Tey40Z)10v%kJVHe(mMykHyzq0t_ z%%-xE5(q*&;p>x601C2y>f)RIkj*f4?u9pWz#9O`eg}axaN<t`nQj-M;{ddSv4}zY zK>dz#{kuSx$^^l7?1|Kcag$<EiR=6U>jPBFz^TW95eJ&{(8%pD>3BCOf*W1fg2~4z z9UT(`r5NZ89?TuYF*WS5qSRpZ5OOm$KQS;#kRyy71M>KnD0Nzck1Y^+bp_CRVEdC$ zW=q2#(JCghJ9kuB!ImL@ce<kZ{{#ULi$VQKgfJd26I1iDGwDBmEC7ZcRvj>}@2W)L z4jEH5zuS-;-x<md_odq0^s~-FXsoVWNvZj|BvU8fQT}ocbTyC?KvyULeg)IIMSZ+R z?fv6P736>DjRoK#*cNJjp1(ffY_Cpo`wM{x11!WrZi6SF6vcC-q+05d3=CJ8rH#-g z!^rLKl+(f1bxg!}3OE>Oq2oX%GzMKTBcmWm4gdT}yG`L9+~xtAg6=*~G7*BU@Vf0O z+DSXk&`^Us9N6cd#*$1-7Lc}?W+#H1{7B2u>0l#SyqDG=q3_wOj(7#&hXdtJ(DZ3| z5D*I*-$}mv9B=z5ETOZgfKeGzl87_{L+&AUs5h$qSa>A8{;S;x3Y%PA5sl6MBPsZY z{7fO5Ou>+1CRg#t!z0lM%<Dl+a66gm9|LXr4@~vnR4v_J{}7)5B|=U{+CZb|4`A}& zxY&QdNI6C|b1W&7_<DIX)dzmyPqENn%9id~??p^sWA8YHzYy#^CoO_4MIW61PdYb+ zg1G>rPFa?K{scg3Jb%cKOvOyj{R8p+Nk5+8!1JnfbWgB@=bMEuA;0==G_?K~8Vhni zkQYE$b~qo%{j+4rl=P7-rhS=wob*W(mV65Z5E^ppvnNylj6XWb88_ulj;J+X<q!Ik zdHjnY{k?h!@akSaa+dlJ1m`R($bcv$_da1o1822f#GWQWmHMRl&J9+INSEn6$%B*E zoh*v_#Q8vM6A%7JJit5(GzOC+gr*<LPY`*1i4_~h@GX=o<;fGa<V5l6wyfq&fHGft zZmWot$jzMof=2kBqBtgZr1>5G1^|~H%3|hI%RZF4|2G8i@rR2c1OyVcer~6Ypw7Z- z(Bu?@q7WuJ#*hk9z4Z4DE!$2=3GwwO&40$vpWa@H0D_l|Q~Xjw=->t(qw#DGUq=?A zo?jD}rL^&@iT}1$&q@+Q?y?>M*~ya#WoGbbuJ?L=x(~Fsls^ay*|@p$fG`1c0On)J z*vBiCh!ryYE-Ue?>*&n){Q<VKcjXvZV)}b7U<F;^*UM*8U}yzp5`dQ>pu}B(8Ugp! z13`T6vNMirKcI!*>+7B|P}=bb2wziH7P^27m!!1AMSnpyHIQ^9yy*z90MzJTtK1;e zGXS*$m@9TRwnWeM&!92_ahEt`NkSz&!OVfAdXy1RETMrZF<!?K7R@uo=bpfenjd5D zLZamiI&UxJ_+61!4sGeVjU~X{yL@%CgzP`s-5>nw=;(mNv*NjP#Es<-kU<5$Q|yJi zQT*W4K{pH5cl37`z|@)MP*NGsjb4Sh^8|CL%p|^dd!;^odyq&2Vr&Ngi##U2Lyoi8 z$!BXrGeInxnfcO4AU4Eq3*k_6=R-56t#g(iAuIS_o>?ii+kVWZG(pnG2zT1K60$n4 zqoM}pgYD$-yY6D;zvH>8ie4E4>fsPc6U(6US4Qno=Uk`j1L}zE02%>w2KR$59h#_g z0km}wg5;5rk(z`zH4xAL;XE3pdWl(K{-b3SlJBCq|BgAlg4|p++}><GzS`qWS1}AK zQ6Rl+T<$nIZ9<)z<HLtQ3sgf?0%^E9ZdIe_XRZq}(31FGV_A#1@c9jzFzJdEPzs0S z>W%soG$;Wy3mnkBJ~>>6y^VW$n^93S-!QAa@(KrROFh=UH8C<Wg7T%kyBk1FS$2KH zZIu<QI?Z}AYBW1L!hq)0Afou-0yS1C46UF;z@uejXRjXA%}u@snYd(KKt(Xe5|ByN z)4PP%r*;vAS9hj<0!0i)Tb0Dz!QtapZu@5KP%LN)&^Vy2`#f46CvU7+9-ae%LYZTI z8*T)m()bxAM;6D>y0hb2+m1s({@t<Md1c%UeBC?MxXkvbBz6^bb-_IupiE?fKuUmP zpn2;Y79B=x&~#Xkh(Hoi0f5vy&CfG(atuG31ytl$RUOQPNvf%+Q1V$kudoO2@o=sK zbm&QrP<~Yi$YR~S<lo5^g}1+gct&kc7&P>{VDbvb=m5<Lj1Np4$d6<L&kBPC4RVt| z*IdzjNMvMME+}Yk-MGPHKUD{A?+h)VMxbL}MMU(1Pzy#5eg+{GYbrAoHx2hRO$0fg z4Z=pb5nDT>W7?%88ZAvt2sO}5&7aS0S~*9@bx;bRtNXBBwb7`i)HWx6Ne7BLY~adA zQlk{KBvK5$Q#98dOnq)azVHgQ`G%PkiEr!M;$UZpG{-zC8Bo~iS1qehzWL8QJ^x9( z(qZ^Vu~vu0JE2o~b&@g+zC6?4uRid_#^Vn{;Yo>nqhA6Sg)PHQBqdTve&NKZ_Tb+2 zrbciR${%i{Y2*l+$IZm>pcfg`rpyeAQe^Oy8z^d1KKMU3{D0~egT!A0e#h!D#znIP z`6u9!TaRi(2o%%0R%J!cN)f%mA3hK4Jx}(R48SQ?EGBoLJv<iVI6W-*U6frXp2kla zM#}fpOe&;h(!hmD)5&4}YJamv93BFV41;xszeY?b?T0O+Y1}OqfgHs+&KBRD`Rm%k zpG04>7g`j=L~m1wLlx`9B77Ux)}DUpfgc)vKB$8{gFOui1I;TEy3Y~5vMfp4R>5H> z=3a`ItLHQ&-2zwTUxH#Cx;z$Av4h)s%@4cY4}~{;ag7+*?&*5%2wzS;&%PD}J)g0i zIJn$b<>Y79PW$Q<`9!1L-ux5n`WNyP`2-SOzJ3ylG$ixE*eT>m#&!5G0{)O6K&3w* zrT%**-BW5w?35P?68R?$q3IJ!C6GHM@m>mvZ#u0~cgd#iTTqyk2_y;TAWif_)7NQu zN9z(PX+!XXRvAc;Fp1D(D1UVDJO}q{!=Re`E7s91U8cq;2dPnP7~iOG`OXH0Jmg(& z1-zmE8HP<Kf7mEYE5S?sC+m9whEmCf#<72C-hYP$x|9L8-6A9n!y>LzIE#A<k0hUk zi3+FQU;P3~1hOlGO|6PjTneF3pm;KA9H9{rz8q>4oAV)mco{r73>gL#9kYu#<}^s7 zXhe7{8BmlGSJBSzv6ajV?2VaM-vTC^0_C88DMY%%$YbGyXRia%c{dmz?e#Melw?T2 zUhy-cQz#usT|I+b*!dAiF2UP1!Y=tB77M*kPO?FeD~lkA5B4&WJXyIW?B5lIaQ1~w z=-^s`#-`DH!R8~(caROsXXYw+%;`|B!tz(nB}%VQFVOlT8O?8yFqrs!SCqS2KyM-q zBgpEBqu?kO*z_?EGa4p8{+c++7e>5xI-x+k6TfWFqGr?J*ZRWrnkTHZIV_<!TiXv} z_i&i{EEF6GO}t>Pc1pFz{8p&tqMh^ZOk$<LFxDNf?RnV{{=lVnE^PhF7XF$WU}P0) zmZfrLBL(w`&YM1oMQ{tO6h;cjFa)IhuzPTs5E+)8J&a)zJQ81{_=!O8C58)Vz8?}e zCKokG2ux%0c>%D(cEP2>VoWxPrJn*d9+KS0bUGz1HNPCA1-=UZyp3H-V>FC!AmDxi zXE6K&R?m<7)e(2%z7UXte!xA`v)h!VGy!s0C1k#!RKk#ZG5JDCTI3_ivNJK{ehFx# z1-fR|C_z69L6J-l$o=CCDeDNUM3|Ib&Cy*I!TvKmyx}17r~xhsT{KZ#-1ZUz@>m0g zI`66%R%x$s-@Z%;hP2;p3$nUCbS*g41!msN0<HRM!wYq+3ya6g>OYgUk5QC)_ct=l z5uRrfty16+w#FZJLm>q|E%?$7F2X6fjT@(*KEs3+(ki7G>N|i<80kIqQJf7!<Zu7v zuGA_t1gbeJ>?eQ8UBxGsJ?W$KmmAq<#h&+_Y0=Nh|BWD|vgmUG2IX<w^^?O98c5U6 zc$|)3EW;qZ`ldSD{xu;6aXxQz$-M}ghJY$uIkG;A2VoB3wCmypqQY7)X_~-EgB-KJ z5=vVyiaKWp&tf1nltE!2m|%rscTmjqS3*GfM=yvi<#!Gu;L%DhvchbL%CKep&b9eZ z1CvF89=JmrG<Um33@Oq}iW(Zdi+Q!VhP*%s%{D_isqf2|PL^{JoqSdde;ohcse6b; z75vVcqf_<@VFI8=K@`!lL|7;PzlP-hdm@&9iE;i<u_2l~_}{5Z|8?hI+2}vW{(lP{ z|K9nJX!*pg{NI!DoU?Ssplkfkt-t67!usHXnwXQg<GSN62yOV#c6gt;^?zD`dAF(m ziZysca4*AVeq<{&FBf%PA*$_~S0GmL89jhVz|^Dd0%$U!k`**)P4f*vUL?iFelY9< zZ0(i~yC+CuOFjI*WIFQHi6GC8kEaZD1SPh{l`B^utO0RWKHk2u(yQp`caSed;-CLP zCwRP%K!ON-#|c%#w&Zg`RIYTwc??3O02E+lNb3UI41o!M<qe24EuJ}OCzbFLYW}!u z1*%bQR@R?@^C6K3g)(KJlZ6saTKI^HdH@J_H^N1b#hv}hV}Le4DLrgN@d~5?R(^37 z)X~-DzLifSC|G*8JsKFrkkC*9T~;(P(aD78_{r}S2p$(EFtAQPzbrcFa#a?uFQ#SY zb4Q05<ddQJEAyegBeZ7!<7XjsT=(V;`KB$f?FUS)D9B9$dru8kC_DQ(TCYXf&V*M0 z<-{ICvuB2`&b5U-gO@-3xr=^THxnMO8J`5uO!%}FE~`|pV_;14Y380B82>9N8Ci*r zJ|6viIV1vr7-BG>L!aOfy>P`qKcXIum(QI)Ukz1Dqm013+_Y7B&C4h*Zdh*k?--da z404=m^78U909smF5Ilka6I8O0)dtct?yB{L-fifT2_sA>ypNNGrH4yn)xyF;VB-Vm z3X5zfM1T#f%!e9u;Nw!TfF}`(SGD*JZIEgNgbMfm=SeEV$JgKRpu=1ck`q!(aQM$d zwF78>(aK+OB98wIn6Eps+Az$YaS;OP;Zz;Q-Iy=Ove%c=rSWs?FR%1xXaN@w5eSgL z-L0)<(9=z^XVv}TQ*0yC!+cmX*U1~MU%zhA6%SSA_wr_eeVc?B<m-F`h;~<;f=kW* zN)WW<Jn%l&U$zEeFle@oU}4$V<P^vqbJrKfoTiOD<5F-Eq-RAj`Co+ky%6r2dFM(j z$?$6J+PCZ@pNIJ<u2H9%!l@CNkn)xEK7i~Els~fh50^ju0n4HSSnkHgM)Zjl-LF6w zA$jGBMr9i4+ooA^2oy8yaYkX^fRGIq928r9gr!H5_!#=p!#@5P9l><Q4S}E@qIm*H zUZkXa`^=ow(cNtf;Xc%d<oviatW0s<olz9!@s4YgXCAn4h>nc#A;S9#Dt{>W2I}yX zx2ukh4uo02pI7Fe@3EE1wr|;6Z|4SGME3X!oHzmBZAeB}^W!FKm))80-d~2@xr;s` zg=-ghTJUg{kAAL$Wb~9bhew85vUb6pkCqD{zYQ#gIu1+8{ntbFkdOdPHz;mvQ>jsB z*u;dOPsIDxuDERDWzY|>C+JG2jOw(sG>4gHJX(ppdHUbaEU2{|Q6Kmd6vG`|p?tQ5 z{tqeN^%TN2?VC3P3U4@HkPD#4T}sELo^>&U^EReHHee*Zn@6>jj?tQFu3*~TAM6nB z2%HBq7!7E4uQ1PU$(XIE&rucn%m_FQf|s2=3u13muGE~1Iri9(tIwG_ZOm&-uPU4T zON)^obDAmrWkR617V{nr;|?hNAxdQNj|G38xQQlLK(-4RFd_<pj%8;whX9q##-3}} zT$S(9%d=BTn{Zz%OZYdf24NB0Z?*An)1$T_9k>8v4JPUs%ACD_$4x@wi!(G=5_pAW zvWS1yj-VyMuo@u0HO-NI`EQenZ|LeW`&$iWzn(m1YtY6t;U1uGyzb1jr2=F3nB!Ky z)X1xIf1!?Z06YtwW-2Rl9WQgJ-Je+95PPpHSu(b4RORXbRaX!YumApiS>lv~5Zm|` zc}@`x^dI%&OsRNn)F4{p;lHY#*Y?K2A(S$4Sa}ooBS1qKnXN>re}hiFRBV8vyrB~7 z!i5W<=yd%2l2N+$S^Mn5MCCTTp{=cLsmSgWE$?|-zQ^pU7q&ESnzM~t9O&r7X7NX% z*C{)@E*m=EFrSqlv-i^IvsztZ1}PqIIGh%<Y#6h692h#--wz2Qbcr}<T|6L(D(jgH z1u(R7V2p#hNtfw#rkzRN_I)?wzA2Yozuah-&MK+0;1RF$ZoXn`)cT1l?Up9@^at~? zJFrl&FDc3vR>F<|0Bkc^a|qKA{nDbXy*&U09)svGBSpWFZCs5`0EgBi!%vC&$y8|{ zXc_*S|1kDfR#zwb7BH+_?VtM6CJaWVMx0`9&6Nrc3t;TzFeu@u`!Ea@7f_{aIa%Yi z@Dg$>piKE}UHtDX$J4ByUKO7|tD8p|{3YZ^v_RQy)^x_n6l$+PnH?V+D`e4e(TUdM zUeAUuulCYwkzSm8!;k|z1~Y(53z;CODSMQ6ECID~pvls<C4;FrckV2uP`=${P1{S5 zQh_ep+}!-p((sk5SBq0p%!YCe+j^dXkVxRsY)r$?JbNo3@&40MTstK1G-3<sI`ec8 zGGQ)D!x0GyhI)F!P-F^X{3@vBrV6uM87~LMZ{hw@dUB86=N_}}{wLV?V%@Kq!hs#D zKIl{(5@z#PkdkPB^Q6M(Zebo1Nr2|Gn)BAu2vnjhlWf|8JMqOSh&jy+roJFDG7^Me z9SNd>e?Gdn5%KW{{aWf14lS1-Q@0vr8uvsknJ>L|Z|ol$iZeXjl98MH6%44VYACF` zfvlL$n#ek;VP#?^aA~4Yoey;eFaw*$@r_3J744&z?3Z3+ptB3W*H6lzecL|?^FO~s zQ~m$tv;JQF-`~`m0gEUsEG$pG83P3gV2lYA+z_c0p+bBFVRD7M35XAhmC@%zLCF*m zwFLS&g=EQNpr)wY=ab=Fol9OOuoXd^4_PcYN`uP%3PPi@WB343<A)*=7@gYVwvG-@ zSo(&!;cC4H3%a$y_W?g>2hzJ_98fTztI#1~VpwWx$Z`sF?jSWqepLMK5+$O7%HgR` z;A9_+m#u-S;)0AP<iXf=vT<kc;p5{U`*>`V^=)joI2=qU3~92o^3$%-DdE+h9|-V~ zNoBlNPh;k$Rg~g)npVC~m4gl!zfwuR<5=$Q{Tn*xp2&>m2VB2eLaV{Ux?nM4|K?@i zj*+Lgr@q17q3Wx=p5G3e)1F;F;=9W)ad!zP@g;Sa0(LN;Neu!98RT_m3DKXfAD0mm zX~>)$RKr<6k3<sG-hWx#JpJU8Md51|CgO6yZJuvzz=cFW2RoM?3P(8T;9!*BZaB!T z8%s~HeUqNc&j8|q(v5SW@}y)1SdZ&K|MmCqD=7D+I2#CGgQl)&5HCOma+poe&R@HB z?c*%0L~?TSHyM*q!2k#5d>8`s1ilLNiIjwSx69XwLeC;c44|huC^G*{vPtI<<_ag+ z7#PF_%|EJuI{(LyF`%rfx3{;y|J?psXhk);(9a>P)^+V0h!OZUJwPGJDb4l_&iR>p zBmyU-i7=l*LI|>kkzZOqKDFpkuyRwIwHF#49R)cBoU(K1eOy;p2S*5H>sT|8pn1*V z;aHvDpg*D0ymjm1&^jct5Apg>EduY@<Wy?faGKbmasr?4Iugqb?F<T1QBf%>DS<?Q zmK;bN&Usjyo2MlwOKU`KZEdZuI~Lz~|K+BxE|i^Z!wE472?_eMuoi<AZEbCD?~f)b zcP@{WR#sMmszKktU`D3{@(xAs5EEjv^AvTHS*fY1Sy{@}P=j`XI6=*_Sbv7(JJfi* zd;cCzr2$dqjQ%hL6+k@i?e7D5pBat)M4DI+YK)c)x3{*y;b`OyiBi63R4;)Ox|rx1 z8X6u_kRcrWApfq7Nnru(aX!L|Ka;5yYR@3oUv}RpPgf44a4VCw)GpSZp10+UYQ1x! zJdckI<utV{_nio^F~QZ-fwc7elTYEdq`laSS&>`*5P=;TLDV1+r&@gkRp+2`G2|Ko zKU7g!c}I{5*yo_2mYFqIv09rSP|`VCoWjy;#b3gp#&S-?`(OvA1*|n28=J*F9@~cu z2nQALE-2#9ot@R*hwk7oXi)iM%b;!Ox6M%MGW%#1M>EqXUkwWaEG?989hS_&tTmbK zLcQ+M;XWF7d};qs80KE>ZF>j9H$dJG+xJ*WT^&;Lz>CAm7Pg=Ab-s}5{_TzsB@~11 z4#@+g2CGIEEJtE@EwvYXIAmwx3=L2anMTXYD=1tu2l>UrOQ#VIv6`mSzDX)fU!a<e znVESYmHMW9s)if@hYKF}yH(DdIrDueA%Z-vb8u)#_r?vA(lJXrIWMubhRet;1{kPc z_*nyNbj!=j)AqMGAy381!9fYfoj5H-RxtAp{`zIV^idSLO!sYje<l+KJHv9DUr_M< z`}f^Pgc3>Wa$wqi2%bZ3v1FTJ)p4sZy_&EkI{gF=+5>Q{gP&(uX(142$fXNH6tKbq zc3(N@ylW>HH}^biV7l-94uFjaX)>cc7jR9G4bU%y(}d_=f|t?NjTycNrxBFA<~?`j z6y{^dI~`m0QX)sBFdIRz_^hq1?Eus4{4%|I%EHoedt-y2pZ}4wv$K=az4wafWdjTt z<e^3jpQXfhT0Cu71LmddA>%c3E35g^;}>4L>vuV&;oO#6awJ6OF@2lvD1Gy(#Y8Mf zLgkIC-LHy>WU`<&mH>}tj@0DkWRiQpe8Y}_dNQG>T+XXs4<QWw`t|EDs|s>UI~FVv z1Ish0^cx&m1fZhF5e)|%K}g*F2<cIYSF_}~Sfrl=!EMN;hcN6vR8>?ihBm`~hK4h2 zn!p${kT{4W9PbqqAO}zXkO+!|?;&7EXoR81aP;O=biC;M{f`$4r-bc}ATQD7uZWc6 m-^>4arq6$ftpB>{04q>6yz}f+lLfd7QM#rkmn&o9_rCzBPMRwK literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png b/doc/shared/figs/arkode/implicit_midpoint_dirk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..94695afff9a9db17201070f762d74a76ddddf80e GIT binary patch literal 17997 zcmdsf1zeR|n=d9MAqpsxN=OR`2nYyDcZY-^-Mwiz2%@5dlr$33-E6|3Q%UKPX49Sb z*`Dvr%r|$wJ9mC}ZjHZlP<OoVde?f^^F04pzE+f%z{4TK!N9=4lahR*jDc~%5(DFW zDAsv+C3wd<3x314lhks=z#t_;|9{RjsRurVf$1bACx*Fj5$7r`$5j^Hd+-vilbEKH zimizg!oa~8Lrz3hRz#GATGh;$TF$`9OvBc}(vgK)%H}!SL(Q=p@cG;5&p&oBHgGbx zwV_ruw>HM$xW_7D=fKK&kMlk?$31>79{&4$pRofPFfgbwq@IYVy2h`Jd3auPt~=YX z4gXZcDpu{F^;DZ#;%<xI^(Sq4qwImpDGpDnv<oGx1nms2ZeuVlzrjNKIb8dg<9k<~ zkhF0&WfZByqKGr#r=F~9T}6Jkyp*POE#v^T@}bncPHxydc5v&5F#UwAiBL?3=lob} z2kmE@3S1cNXY0$g=-+)qXhdLg9^qrdd|)_8hQiO#$9@;#9daUC_{*<Q>T@vOz>C=M z7d~1^_}TKG`IY!bwYZrHtD{wS{IRa&1~*!k3=I_M7hJh@<z+^acXbbYn03Kr{;p~= za(<_U5!-sTmvOwd<5iBPUd#5)sF4c9>ZsdH6P__0sp$6FgfJ(k@<g_is@PMxce-0U zOu0>Lp-U^Msn}rV*X%BHiMWL$DEC1{nbA5gkH$B|Sy@>O^6_^W8Lx`oc-Q2yT9xs< zIk+>H`xcLtW^*t_f0*r9b^2Qv87?j^4o>#Ar;LnDr%4H?6;GV)M4j$pbW6F%hHgug zwt#F5=PasXLj5I!LgMkjQ`^O-3IRMeqYvz-8}z*o#6~JD2lK~kJv5%;DF_`H85n%z zJPs5-{wNVb+0V1g*=oa0DX;EYK4u=BNI3lklgjgCXD~tHmazA6xA0l6kkv%p$??G! zGfS?tn|)m(LPxo__8TXu=*3HyE@5H@`uo$;(w4%A+_vV7yBZs_S0BpJ_<wnZg@<Q7 zUUTsM<KvN1^O@5=f5NT#Zejar|3kZ}uK`^unb<l$F8r(Pp7~sR_yRRF!ou}xIqGat zTc7{9P&Pwwi$~VWVtF7hu|s<--k;E<WGMV!JaFPeEiXhkgTeqZ9>>Vo_~twDd1sHo zeBFL6@sq=yey#ewagTn!zdhT)>X1u@uKOEYQnm+gOMK3}1MN%4qV?j^NavRgn(0PH z1lS!h6ZoC^y^kxm-s<Eo5z9O7uTM2LHrmKr_oPV;4}MBZYheqwm^m!zwfC8Nnow0? zH#sKI6hf607WNTAyvljw$^}e()t6%jn_@1WebNGm)l%)ew)Hz94>vP}PoxeIXCDJ8 zd&=_3+P>v|8s@1cW>&A+Xu5^Z%KfpBj8orKZw*C2C3L+0jiBIZMOV;7warj59X<W0 zjtd?5^z!kQCY@wEQ!nvui3gJ}=5Z<_!!FlM>Yp7BnkIRDx)S*EC7W)w)6YT!#Do{Z z+<fu$<fuDQFfKMW+cp6I{Dli=r+f7pWBZwroLpS}QyVkQ8uPq^buE7mh1+s~MW=E- zAGxYbsaNe}-X8V0L19wv?mlmNyZHU%w}Y*D2tj-p;mO`ajslEq+_78m@yjb=tmd1) zT6K{w#G;-@s0!P<gSnmM!N^@$Nwp8u5XDF19&1?yyw=0pzrq#TNHFTf{I>ld&a=LK z3nWmGmR5fG!q4yWl^ge-efEvvGS#bfS2NcsG8A)1|EfNGUoqkB0hei8|G@D)qVCzz zE(()?vc_q#2X3PPYc}7NKra_N3J(r5aFf?YXRO*;x6g5RWvKpmmR%y4{9ra(e|lyn zLoV)<Afp79{d^b2jwNn*>#xJm$1yV+`)m#l4t;B1iLPCv!1-Bj9ml`9KJ^W5vs{gl zg~;G{S^3%Y?pAk_u+PfRqR`OLKuY&acsK>&6Q^)`xjy^4lid+InW($prlzKb@%LbQ z*tb|8u)l*?Kietr8LRg>gOLh2Erfpf@Zi~Jj6g#h*c8$A$Hr^pwG-Y)*61g~Bimjn z>5kf?Oc(N+caIR;?)Et?Nlu;|GEJ)WJSg5mDpnqd+zpzBong@q!-?z{Vqvjb>`Avk z3bfaJjjgbq7_aj>+9Z*8i_dVIZg|Z*?m9F1<;B&jS5J=ilDI9^VW#{Ek%%?DGK>DO zI})q4d*iEP$nIF~9Hmt8d|XIqIfay{k_oT9v7@#6q?j1DrM@i4bwc}-FMj;^0ax+a zY-PZ^{Md~hQL<+j{=*F7J0KtcHmHoeygJ!nu2w3!IZuo%Nl@d-p4y_A#-j758W+-$ z)OlRR><YvH-1|qWL=M5(ZbiLZ?ES3DN=-L(eu80Vn~%#;@H@Fqzh;P-T3A?UXn0~= zSy)(DTH4pBm6$3KGG1u#;_x0f_s$OqDreJRy`h0p`6Qu)_wQ43FCfO8HFR`zqS<um zWj`dNmYMd3s(SfwD>Os{R895T7f-m|t=AVblCs;mgoMT|%BpW@d5{H`lvxfkrNa0l zdF5SQD|b7%0=a~FtcQPj77ynX)Me*=+1jFJ_9Puv$s+H<DIP(={3$1OwzWAFRWfa? zuDE#E+i$2S2&$P_i>GctgsC@=mRUw0sy=z*?{fPZy{uwVPa@AR#U7|4WaQ*4_o8Rp zqb(UC!^5v#yEb!A9@f6UPVe}z@8+H`ta#n=ri``Vu&mA^fhh7Wd0&CPzDtaT=2kF; zKwD0O-sz$aey^;Ql>OaQu^<x2a&dwl<&Qm{JZXS1RGoX0ZD?7nou`r^&+1{0qok}n zJw0o)OKHPa>wR*VB_r-OU|5uS=PenxG(~R$JXX=dLoL%bOGK@pdmTo)yT`oos^?t( zE@ARxJex$!EHCMikJvOUBr<O7H#rRbUCd<?2$mwP<q{&wZ}nyC*Plk~duIhNcA09t z?$WZLD{V*2mEFSb!R<;A$k2^3G&KAqpKu5(6<H+{B^_!~!pFl?u3zt+r(M?L(hR$V z*Jf0)sn3Q>JoSeWXC$97O0SBHC~eFpBq&HFr`mNRg}*F_ls)^o%VJOCPH|oXvSbAH z0+YZ+DUs0di{GWT50vyRo6?+dod*X8ZTspuWi?x?{q2{<w6J>;6eg+?*VpX=>1GZv zr{w*dd}5F)B|(OxQla9hMIAxjePUD3AfZR<O&C>t+H}!)vm_e|Wq65fe`ipC1hw0r zqrpsYi`S;cd0E|AcIe{bTuRP1{~ZB+XOC^qbJ9DzUF|g;mi48tji5fP))dxc4CFn{ zC~t0RirRbs>J^srPa{sR-62!rI(yavD@z;{gW-L$ndxc6=g<2|N`^eQ7nJ5X68IP- z5&WjeU(%YdyJ}qSh`39Lii*Zqs=2!ESK80?^!E01gis0BJ#WTG6(y1Cd)hbGX9?`z z<T6Q1Pd7KUM-7+3-pwh{u5~Z#$saTEC&atOgATub3y9FAp7fyM@oY6_XXQk=&v-yJ zFOjI(S@_c$*P`J%n=$@D+;XBdc@N6>Kg@KHE_wYHtZZxpr;n}fla-W|pz7sAIXF0m zwUFV|0fb+^d})tn7e=h=NK3!jJsXpY<6)e!9WIp;n22Q7h>D2#H9N~ki*21TbDFWH z6GC`fNJxl|&barJoX`F@s$fdNr31{cu&^R{lAX{<Lc_!D#WvGCa>7XMxz)avlp6@5 zG{O{vZ!e+adEmSh@$G8x_wV0f4U+hsEe3M6hMS}dY?Yt(!W4W=IEC$&P8;(6{d@NM z<6^|xc>cAtxZ1!t8C%#8ONcOOan-%Ug4*3!28aW(`BwfJ!@B$miEh$l-A@$=y*Xog zNz~M5NZ&09q!vlBLSBckbQLyZhf6sH79-Hr>5R*$(ucS12wNF%ww0Tl?VKBfRGX7j z<}&sQLX&LlV8uwlbSScrD8UUS?zbIWQ}b|8BdsfzTSmZp)`p?TZOddw4GN|b8AbU` zYYE4VX)%;fU`$L*7kgGU^1!VAs^w^9(eQY_u0T4+g9n;p`cWCM5>F$)84kLfY|V9+ zobik7u8utwD2~J4?BtzLO(Nqmc{?oRyri1GQPfPSa;r=*sNbTW(j&95mvO5Xk#7n$ zAD?}@4RfmS5qa={B&#FB!sScn#jNo#T6T7Yk$mqki!$x9Ks@h*S<?B}u3nZsY?)`L zYiBMSJj`CaNswGu?NTV6>?K2&u5zdT$n;LI;EdVa+7grvC1&GS7`REgm1pO%ZFg>X z*5e50TAE9{GQkqk`{Oe5;J(f1PZ}YJdlFV{vx(Tan&P}6pA!+QpM@d<L5YGM+34~t zZH+jy5&HTrQpAOBTisO8ay{qexcyq~p7&NKFLb3SXiH-Pw@KOcRt|9_Ff|JFyk;Xc zs$EcIL_|dEw!=PZ3APM5-}R(OiHXxcUEEl<G|v%v_AJ@mdjm2mwBL;W`=>{1{YL{3 zZQ8qfb*nYVF(e}A-SCWyD3-O)RNj&O+grTy6a%XoeI+v?<a{YS7VK&qH?GW5bYyO4 zu=~40gFvC3J^jLNa*7j?KjgSnb_trtf^x5g?;qQIp^wGJRvNM9iQ9ToQ^##is!E*T zb=D)pj^~t8d-^yBn%*{PvodYy<TLL>zAhJeahWnoX(}Zr1y%YLRU}Hx_NZWQH$6Rl zsc<=mcFce?<}v~0%G~U0=v<beB#Maq!Qhy?UH(ZI6J2Z>xVw^s3xw1b>#Dz^CoT7h zsU9+ny0+=ry|+}tr%;@#y^eNa)}mRoQUu4@{P&?}9E<PUoA8;ac3y_zP&{<~eiE#J zWxx|hu^RE|q^fG^Oe8ujjkYXMZS}`lD??Idw*{{)qViz1bg^yf{dH^1`N(wmbeZ7k z7-9nTFnIT?tTpeFPGU+=QXSz}BhHgmM7^WU-YVu)N4T+`UT5OHxXxMK@58xTT+Wpp zWA!e#^(JCVakD$h(hsvH?qxH_?T)uZ&UB^Zyg~IPpnfpd{2U3=KjT$?jm&9kZVtJ@ zAu4EQTBNC-ufqo|(GEf)!F)#E#KZ)4GBd?(L8$M`pJ6U}EX}%m@<+?(y4t9bL~Sl} zWt7-GN6^oDY%gq#I(9?TAnCy$uscCIc)H&#oUM=9(9{GSXdI+;*xJr@rJa9l*<ZJ2 zNExL|;};VX!=n<?xrv5vHa7Y0lv2>?j@2-~Y3oE}2zm@p$>5>R4!d~iToxYJ5?7XS zIk@6>Wn91^5b{zwl~@@g_^Op2T@@6Y^XiB<HUCYX)RC@U%wAiT_lwJTZ-Rr>sa%%& zTDOu)98G_?6?gTKC+_WH;*)<rjei!1Phn&!DKCFI`GNo%(=DhqIU=mAtSAMaLlrmn zn0p3aH)q@X1GTiY68&2?RriO?c>`ew?Xm^#P7tiU*Tps#*wPNUxOhqUbU*bld<nla zBNTZ?P_)}rmE?1JP-@;w>9zf10@{4z@i^&r!=iXW4|OlIlA%&WzkTI&nS175Oo?`$ z<9wIe+ML=r1-Xvh)|k1E(QY%9PoKPqK;5Rj8S);=r&jcp&*@fDF>#cXhoXqb1%vs( zH_|?b`EDC8?C8rnyu{S3<c2TJ<`H*%ftw-bdn4OwFcYOc5H!w$8~y@8`Azv;`J~AR zk0UPAF0*cVju_cQPnz$LXXg_=<h?3gHw<@Hr@KDM#uPiuO7DCmx{dCU)!bJjlXWrm zymtC^XBQ^weYmerc1hnIi5YaKm1J+}>azKfB6fCq0*yoFm?7YhQsIL9lWchp-49z* zl*4C({jXHCwY8`6>H`Sb>-JOlYpjNfp@?VphE>~F2<X(~ilLDq?!$hSop<7?yXDoZ zj`L&Yh$xvTmMZ7vD9+=V5MhgYZROxrbA|3|?~`ixd(YsOLqkK6ncrh}x5=!NydfFX zdhGFsthHvW`5}a{FqPX!10kO(cVD?C%A#G`GPT_R8?$PEPHDEwg@KNdQHpQG7QQup zDD@tPG$DBTEdy>LQElx&mP&@u+3^-YYaKpR0hH9?9EG{=B>g$OiZNcmVr9Mi&`_Qp z4%S!SH~<9DKb}d$%$$P;>o;#x@L<kg?TY8)GH$zW9fZ*E9*R^f=PEeKJ~d1j?w+F0 zH!v`Ov<va*@?h(+$JEcS0k{-;%Jt9*?ktm%kPM?-P{RE7_V&=*dqWx~w<$>1t6TD1 zuK`f=`t@skVg8KT?;TGE4UyiY+0Z5Pt3GgAP~?rarW@Dw_O9FAS9EgP_Q$>kr7^?0 zZ=Cb7#}P+(>wTw%?@_Ez`8)a=6LQ);GSD3`8M|IhreM#_t5-QpIzCK&3ltd5k*)Pq zSn5UShFnk(!a}xN78yrZ9dQddZUs*dN1IJJxP>dL4`+|Z=IbH{3Jo5YjhWrYr+nxN zEgOujO=9KHMhJ(u0*Moy_$_ad!qt`4B_OEl>GIo^-G!<1xle4@4y(;0cQ501u{&*f zhq@rWn%>?V-t6;ej@l!#esx{+zIhMS#qJ%^b*S(aBLzBDDP!c6Zok3+W(sg~J45Hf zWzwPOE{bYg+<hY?FoaIQ5vUGJL83I$2iuIs?kh#jrR-In2M#d|<4kd1B&fWg0WUoZ zj*g+0qgRQkS07Cg!?m7Y$h)|BsGC`e2v@4~!7P@p5kQXB0sJDJ=Y}xW^qAodobXrl z4-B+ac(+F@f?gIziR{VANeN1~CtjH@{K`pn%kJc^n<77T=_QAZSFd3gzbXGzT6!O) z*ZYS6c26fN|7*I2GyFkpKGOLU(Mam=@bU`4=44@!^_Ym^)L-!S>u7K9y-c=4Qplz^ zy<TtZ<W#y$xR`g*ykdla^5MdvKVcvYvm~dXjk=6zm=2v}Y>R5CX=n^!BJPO4z3bTg z9g+(gNmKb87nO5xa-z}k?{~&1ggp0``g6(@xUGJ!r-leQoLG{GV!imX4l!%aUPCN; z1=_laI<K~Z2>0k^#7CSfSNallh_7CqI?T=8tUOzF-(Ii>@*pG8y=_YW8vwq=-i#z6 zFMcK_X=`#p_wDJ%pt3V9q0N>%5c^*1Uoe@KjA9^nKns|Hdi?zP^ZMh>c21v@s-7h8 zfSMhV2q}x0BY&phSm5gHpw(;*X8>k|{~<9c>3r8Eej6JEzk}nC#j-BfVhrXVBLerx z-kFpftRmOsB_&;#vNDvFmAwxaGt7HGwW=#8daTuIoRryYEVG-ob9o=TqS&wL)wps9 z3DvpRbpd1OC@wCpto(j!t@$D*rtt31=fjQ{o)G6A7c+kZ;JJM1r_YJPg@;Z6?*Y63 zIv+790lo}&RDKUay=2JBV{es}iK!YABXA6Nol)~Z6F_@nSTZy{J)ONO%Ckoy;39iM zY7O^dV<U13JX-5ADM6P!KFl2ZnI=f8Y_=R|*uPv*&&J9MTwB#H{dGN~lA&GHh=!)- zjhi>K1kZ|V!kAAMk&|NtDYC2VTV$D~rK%_TU#)nU2WK>X48W(mfGG+Oe_k>KAf(!9 zQF&Zf$<vP^s7qq-Cj0Jg;gFSSS9}$~vf_JG?h7=5NE!9V=T-~+l@r`p#r;^K8x8q9 z_wD56yMQA?xd14AGE#0mGc&W3-_9Tid2Z=-4<u58hwHv|JNv9cSc7eEMeHzx@Yi{{ z57nO@z6l9I2<=Z~tK|Tq*bMm;7saOQ4pa-^4yuQ)ism<kJRfAGA8v?XVAKR%)XFcn z9%%w%uBnNsVx$&`#I{IgE>6xwx49VWk@7{|1ltF$>&d&G#}lW!6~>7#-)1*qp2JvY zBQmNQcblg`efuOAM^8)Zv^;=<B?P*3``Gl>F}kDNY*YvQ<$LY|35(|B)L54ypC_Ts zU%Z~>e!<7S`z-vQC+sNG;?vU7Al2t-7NtPH>OKezb}|7~<#^s4Ojg@kgzNs10}$0h z?=CKq#C1kRMsgdsMby;P0Mjz&b9Umc0sMCItuFN}-_5czP94A?=`zvT^M~-AeFh?< zOT!hmRAgk?<S&k=0;!<6R)tSMLag?V+|7tOxBp_TuH9nbEgsdn05lBl(a8k)X<>yB zR{#)iTzLtsbaO*P<qa+#o&j5pET*rwclb%N5SK2#GU?Pz8*gCJCf3XzpY3iB-=e15 zUhFmP%T%JHqs#Z%y$-_yG}>l9RGdzDo0nH(O%#UY^w=*VJUsl4f2K-C@OS{cvhebv zRyjORO3LlPrj?bIcei+PXfETCrAa8kyWHmo4Wm&DKT_Fi)<uEmNKHurP5>YU7Z=yw z>KHKW(EpBpe2iI(3-j<D54+e32qq|lV^xkB<s7$f8;(}m13}oI!{jqpL5ftPAjujm zlB^Ay)q;VqlMopV4VPOZtw(rjbKrKFuOATn2gHLZZ_pT2^{lLN$LT)DRW4S?p+yH* z{|+U~^)uh2eUe*n&3{LTum~L;9ff}T44ATlH?Pn3XF}HM&rZ>cXgKX1fYvIul@t{V zAs``ZDvh`TmB#VB2_%F}rnwJMQ9Mu%uQAB0Ha48#poNcxnZ7KQZ!hsiYCS5(10Iq6 zDTeIJkzrs=w$-2R6af3y+}s=(7?=T(myrQ~Q220f3W)maqVd8$r@%ROx3;=X{(<>E zJbbNco)TpV%0ZcNdlY1zVXJb$ybI9vTlHmzZK82Pz3qe$O#?uW<-V-c`$8KH*On}S zzOS_ztA=^Mbop{H8Fx1H&-ei+@MzE|obHa;Ubt`pC_G5{>&eN~f%bp$Zw@<4{U8_I z<KXy_gWFU;q;x5k+wv0v8zY;zHfv%t5Z?!=ThUjIL8K6p{x4thSp8JQ0t8fddbkYP z?L+4ra;;9_;X@rPU@Glr+lY4pj`r5hP_{nI{$^10b#&r?m|eleJvv-2h%{AER`z@G z;x{W{aQ3Ooru97?t9B_CKEBP*!jG*+M4~mj!<NI@K;s#4#=I4O4&UaChW$P_J8Ryo z1!Re`1+e1K7>*Vid;=0o3#-U^d4O{wYb9fmAj#WpVJq8TxIo$0=eEcptIxuEq$DXB z84yy2>9hMAGbSZfFryHvkhs;zCOo&~Xc{1eL<YLKxdE#MZvfJlZV$jEjlFM<Zn)q^ zcUh4xC?e5ZU1WL35UXb4XN$67)NYdZVHOk_`tZf!GRw9H@HO#N4tjce0fDFHTENJl zX%xK#d2#WVKg^($oduFFt+WPs3h~sii;KkZm=Iu013;<(U(WOm*q~dSMv^8ba}Y%U zj6U9%kK^gI;-M1q)O6dQi?h|M_x1vEp)Gn$^c7I$xjI#wkThXg^X*(9Spc(L_vIO( z=zWX6g{t|)5>1x2it)CFJoROOla#KL=hBUj_cx&AOUlRyIQ)9mQw+^dPCvBC?mHe^ ze2#OamV;eeV&}d@-iM8(`^cBzEYfuH^B=>3P|!$4p?we^*+)*Ctaik3wXFkj_4x7Q zr)3t-GI!u9v8K8b+#w(2di{h=PxAz%sm*m@xlKy6@Cx2Q&uGbT+OMGxL~WVvgq}bb zv>Dn{xl{Q0Y3DFLx39R=GH0I0k8ZgufeFG`IR`{iZPm<BiD^(!(6_H&;~CV@xL}3s zzS-nM0X2E~V28Q%C<i`y7nkzQb%0#Z2jkB?k&w`MU|IPBy>DyS@7*heUYW{s{f{k` zwg7fY`D5TU@!#>p$zgqrU%cyo@5U8K`p!3+57aV$Yn1DC_!Rt}JN+845RO8c3sq2k z*G4MVfL&U$_Vp)hBcO3v9o2IC2`T)JL@>JQ+*=nmpZ{6(T#vm;*q#z}&h@%xN{<eU zveQKc9|vz~KFz!SuU@?(6jhz(y$lV6Wtny~yMBH-eAg6oL!dGt2Bl>H60wrBL*?wV z&j(r-ibY!&uJQDZ-xma7$OZ5%K%CajP6|GUUjXfOb#&1BjV&ZtfDjihUx8J(9j^fb z4gmAs7$WICJ#<>Au7(VSq*LgN;K>I~N}NGws08RX-3XBiffV%it!h&Yzw;8@84bH3 z!@#QQ*Lk{)*SI+Y2JY@Is79cK(TO!#8cO+dU~OS2Dz+2P?~}oX$R77=es<6Ec%vBr zX@anix0KXtI{}e#=RsWn%r^vFR)W~;GD{&}uz@ZWK&q$M44A1)L*Hu$@{vN4kghqD zI$3BfCEk(E=J76cpI<54^y8?7uE50Dcv1I~@6t6wMFIADv4Dkj%WFdly-C7eT`!>A z{QI)<9(?TcouZ;5_h<}NUbF}uIbTt6!9Qu{sTGul|5Ww)|BS}{kM8odfd18AUVy)z zOFnu0QlA;DGem%p$8IiR3J^-zK!7PJxszUk_2h!`E1&p~4`@!HKLdB65$%lOl8Al} zb7O%8Z#p<SZf$J=<1w70QSjlz4Vs3Jj|0cum-8YbB7oe5ytk-J4GUp&e#Hej&fWK< zs;WvvL<EoQ{&ybA2X@cC`eOs@4C(dVm&v8;JwJc`%+1YZ%D?&ukBE?ZLGGN-OgGXa zKaKIJkx|-X&+DR2sNsGq9#Z&q{rZA3F_;PD9{EK)g9e)?jxYt}#6SD9TSRI8K&WW4 zM45EP#&nw0T7s_tnvWh`*v-0y&;B4Zoa>1B^Ro>3jV>}uN<V(Jh66y{-0oFCEDv-h zL<70RU%HQKEyuv<JKyEu;v?>tt0^VbnkE$voPFSxo11{@kq1nhw=povUT-CiC2`SB z7;1brERv0Xz`@Fz2Pz0C8v{skn5>g9YTY7Dme$r*&?pzjkbA|(?b~daFva53B2n!Y zW%LXTYZLXtG&FzgW5KJpMWP_Z$tCcsy$)ek&jsxAyN^^<v7?h45<1!Lg{Q-!k(QBx zo_1w@C4x~!yTT?<LKkjzcn7{~QO0z^+}ymYJD8lW*u5Q|K2zjxOCWlBtg`IugM&r5 z{mHj}V}49<{{OBk;~z!rUs3vh%`Wo);lQx_kiM}19211Rs*{r+Vg1NZpsGbL|92|v zVjV!}pm~o}InD#hOf3Z`#o|-wNFT|4uJ}32Z$JG6KyIq|yTiS;0t73B5;s;eb^8uz z)#wh6K3odx>aANj2tM>Xm*8?~;;^$hH&}V#g}=A%#A9ly#Ve%#GI<0bhm9@t`)v_* z;=kW07yf|}2sZm5SQgL<v$Yf$1}=kCkH(jG!D#i!hqlGx1hySi$=>oz0?aEnk|o5@ z!#NMb0ZRt?1H0sLHF%-#!SBB5e}{?a|HG*GU-eL(-(h>C4XF=6#Dwe2I{=?!mG-Hi zG2FX{Hj-2yts<#_RfDn(0kouh2Ug0O<XOeYPW~5Nkm{vnWov*@SpEV1JfuH9>*4z) zLpp*1d_nKtfrQy(xr&jk|HyYeVf?x;Vt;FOoR`SR#%48BDRpym)1UB<KmLG%gtjte z$R~(Cek?~H-f6-NggOh04)_~hUt`DzVz0(xd*KI~4`#b`w8eA@pf&Ae;ISKG?E*HZ zprBX7tE+$Y!<_W=O*{M0WF~oTwn82TAY{xL11*vYh1zNC-yp$x@0KLQUY$LiT!CI~ zPft(X{&Wz|Oe*1RaAH7{1Nx69G}?A{cKsTV#V7SWCvT*&Z_fKjW1KZ`NPZ?bKtDz> zI<Y3tt=C@E0=5a1`c}y880-FPbS*HIfb-Gf4o_TO$5k|;4@gGU5gojz-}Z>orsq22 z0Pj@VP5J$X;rkT&a-oj{@quUq_Y5GL-_;9l%q>#4*~VOA+D#%#%fL{-)g|B_4V!CH z0^Y%)f!zaJ>5e}v8!wc+)Ze@J^lRWXkYWM!fph7)C`<!G+u8u!IXU~l#qYZ4DDW1h z-HB+y6l^)3o}O-`W^l>RPd$a;l5fRl0F3}`1#RefidYa}izVHw=rvb|x@(9AAD4zf zt^Ykh#kd1Kzqi4`HqeE}DAYn8>CI3mm~)4l9n1NS*$g6IYPTf$SWv7hoIB??etn(y zv<A6X`yA~J{H}rSPn@7-04&<o)s+v$8#o0j?|p+>W|-OUF$Cl<WEB+9ju$1Ruoc|1 zgKi&CoIE&}`}+ETDyst&^|ai|Z9V}3PAWe0p0xMxi4;CT=RdjZNez!uZaYCqO1gIh z@<va(3~{iIs_HfXZKsu=_8lKM&<e!1ENJsWpge*Z2moOMAfPp$GY?2WFcKs%Qql_7 zVBSd9-!YqmwFn64E#UfbX=LeDW}4nXm(Ww7Uk}~$#mkqWbA~{IIX!`4*1@{E^CkgF zbh37KYMX9)2+gjkkr4~{ngC8o%K)<vEpGu}NobpadYEXmJUQso{w!=yhxcb--@;Z7 z3l9gfav#_;Bqe~r5NMQv2?bd@+zsFu`@@G1Sy|;qPUnTs_&}&flccS!Y<jERIoBtX zBtw0vHs{A`*>$DBr2_Gj2unKC98wQ!1Of`ue&%JPAt<NNp8@WNW$Ok{*6llY1d}vO zOg<5&KrG^;2!xOAz$~!I0+qmLGyP%~;PX|$xp09TC${<SBvR479F6Xeg12vrVxj3@ zrUU_q6uG%u8a=A@0F9-v?7@Y^SIV3rOhQ7kqzIGwsPmB@OI*JNv1lJeV23G)vCGju z09cC7NC*j&uVB%fKYzZ@{)Wj1gO@kq2Nl`CYHy^$RI}&W)0L&G*RRw1x3srAnrXZ@ ze)jBAd!AN_iE*NKPOZ)BKR^HS=I%#>c|oLuYm4xKonJ?1=Slt9Q9Y~;XVSZ%pe>_m za4cOF&E&nT%sBYnb=HsqVv%Y#9DB2*TPTjpG`P`_(e~ntFLtY=d<rI4iHYgjq(g!1 z6@7(C>H0bRHSCoA`x7#ui;Ih(i(MB5!dOCFJhszh-u}vEh3>VL(W;U!&(Jyxq%}#& zSHpE4dp0!wfx=Oc9VUA{*+rN(IQaP7V7b(Iqap4<W44A^=+9Q`7Tk;P`H+xs65?}w z=l*@C@5v%+yx=<aCF|NF`qdf78$hT=Mnw#w2JoVjK-WWa4kUp+U^=kO0lMo<6ck`# z$<3a}$G}j04qNjI4$kJUd7LrQt5-L`y9e)kfXNGjlvotx3N+=e@NnY^cL&Tta?@t* z#UTi1U;qL8mDI#>yDNcmAbjvEJUbB#zP`2_wE}Ot<9HRYI6!%+#f83OU8N3jMH$N; zau4j63d=z@M#e0NHDf)u6aBLt{eFG$Gy4j!w_c1%NU*+l19D;+*!_TA;}4lUI6?b? z6)9mdg@IcJ9w%Z7gso^dVM*b$ENS>6)2s)!1EdzwS6^OWvV$&Xc7I71p3Qe+qn6nm z5)_+1wGgC=g~mN1qeqW?hpg!T>94SdWgvEgf_B&dD}Gjh+0X&k%>JG(4f?Jpo@>&v zFcH>6#l~R&0gTf5hM3uVD{dmfO}GW^-#xU1rC!IZi>79fi*;J+W29*Smjdj0<+%r= zXqqy4X<yGT7o1w4(dmS!%qdAhB)JAa`UfUzQ5VMLt3RWO4zIs&pX%%>f8}bG0Js{X z5~ikp2AM=ng8)5GTkkG{;SW3OVr$t?_?lWXluA`qRd}+anQ-)EWe3~Rw$z`XYyr^1 z7tTVSJHzk)M_tzc)f=Qg+({=dSn-U2eg*2ZKcUy*_K)8nF9AT_5Ckc-*ubSAz<Qca z$IL7<fkw+t%@sfM;~&^V0!>9H{iD4>Bnd1~tl#s{{D(&?B?a}T)o4}|VCU}$e)R5< zpHn~|IwicdErON(%NFk$q^lNRe{P=N1_Q&BbiUj?j5-I$?J9=vaD!X-YIn^0i;SQz z+m>nf2ZDTb<DqL|@D2>1&yH3yEH>7nNV6{x5cqF%J*i~qZ9zfZqwmiqmu|ynG$cbs zs|+5%pGF%t&|Q7Y)QvRe<`63V5|el3Xp#G-q^#`QkdVRDyYMdhc@GZellD*}8P-Zv z_&4r73V8#sZ%g<&8AB0+hP)36ZM$!5z!o|-|9XP|d}IHA^^p62X~r%t={}N+2Fozi zC+He*XkvM76GKA@!LfxvD?;wTT`U8c0!8R|8K#0ZDxS~Li4oeaWO`sbn0a}5g@t|4 z77O>CH?Ln`6-6Jn$g3EamXgB8!%N_?jvc>*&e?b1{K&HIW4y??xLen+_a%#5u%3aS z0_QIwIr%X-=D^mKC`NYcR$OGH+79>mOvdx)FV-?n+Ctmk9eIED&D*z5uR=s$K{FHE zIS1X1pWk`iY`F4w3T)+I;8%vML|?h@EG_Dyi<gjOr~}w_o)>9?s$s$tx04SH*dr<( zsXJ3pNO4J62t_;M`AWWqffP-leY~p*&tq{8`Uv4WBGoyWnP$-4Xyog-fu@WEKk3x| zFF>Xi*U%p@l_pC20K|L0g&LL1!gqu9$uIabz>vwt-e&}C(h^Do_7Kk<64>mDC85+} z78co!hDubIFI|E|FhPx+V4N;3Ed`>QRj;OU7%ik_YW=l!r`SSBg6R184qC$QfMrFm z+)8UF>M~sDS{QXes}a*0V@`i;e0+`1*{Q$(#pyfnq<+YQi1vSrUAkj;rC0}=vPI|u z{0YIt21hPjTwU5C7@;E=NM-wT&$p-RB_~8h%^k16EpsY>-tvvT{pV7#{^}Mk!{5*F z#SpQ@*}vs8KIVufy#G~s`+q5#|2LmF`mdCjexIKD!9vmwLXD$?0~i-=D@N|zz76{9 zEh?%41e$z=&0kGKMdh<Rz#7=3o~NCsQ&kM@Yjwo03NS^N6c=yjr>Gl*xl;u7AvF`# z{z%8Mr4gy_fr?pKSqbd#!h#u11Bhzi6^scB+vwoxwi+pyTU&xlZ;SXj%_bnme+XF( zmzsln0q`@r%)+(<<h-DU?jwUM-;0C2LlU$=!fDvGe=@uTL}}!p%qJwUqGiU{<7IHQ zg%=kW+5VwiAA*4#%SYgG>nbbv0FI290&$E@v+x-dwS0Y|TeqI>IG@WDsXJoJ(c<Fq z{Jgf0Dnsc=sT6@21RfNoW@?}PsX#FA_rtycEChC(isfsQ6F=9_?c)ZEyaDgT(>(PZ z1K`a;4bvHK0huJ0<N3=k&wj#LF<Dtz=RP166u;SBQBM2xNt=aa$3RgrH0a_G@bu6; z0JD4w9=1e2N0YMaf8`7~KC}Dri{h7lG1jN$*F}HL&8Zv6!Gm(&z*hbsOP{p?OXg1q zf=$+Y3wYV$;p&`9{y&uU4`*%|Re{I$@GCC+_Uf1b6B83imcqiqTwIQz^7F)5Lk@%X z;ydyYT+Az!x}BJUVhq$jSP+X_5ENh-<8@ilto<|HBDSFX`;z}#q71WnO}AkYIru&p z80O*JnF|uIVhV`q8yg$$gR>)Wh6%(8uiX_bnkPUlTq7b%NlDpeYnvakDhDb7bO0<G zs6;?))G_h$A^??x{{#(K$7_$i5eVlZ#Dqe)dyxymwL!HtesDK{)GiP@4rW&U+5I4m z-nws=EF&d^`nO6}76~}6|NDN<Q`N#^sm5)quko(`!cfUP9L>@w8OnXGRu}a9RypTA z+%7d!*A~EIfanPF66nREui!u$$g!Mv?##rPCJw>jqw)TOL@*Z|A0LBivb)sJOiwS4 zWe<h1V%(h>TpEDzAk^JS7sBP^AAqy|>dl)&VD%4ts{X|by0Rnz1i&R{QZ}8RP>AE> z<D>Q5&0%%mKAvE!-p=o0C^B&;Juy{##$GUa!^rtA6VuW_-U#4CVK{q+-Zi?xAs`sy z;ovyzH?Km+22MUe@TZ_7GaWNJK4@=ivw$758J-Bw;CDwba`WF|DfA~cJ+Fc%;D?Vo z!P#hg$&zXy0NBdP2Q&>}^xw&E+yjo8--rEsnI+5^oaD)kXS}2Z7cZ{IBEaP1<GXqD zCdlg+AochM1mNA|e1f&nNUFb}5lisAbDQn3dub}k!;Q$u8N4^J&c7+W1zj0dgTGUN zgd<~O82#-||4^BgCY#ktzMOKl%@4x~r_KRc1s*Dv(^y(hZyXrLef9RI|5Wvxc5uG8 z!{!vzI+}#z9W)K#DRa)mw!3hWL3*&Im&k0ME&VStf<<?PUtqpoZS}J+=V=;1@P?M* zbQ#V75s9KtsNtj9*wP9M6$4{^-+cFR$3>4@%^ZNdnOWxML@Q7yg=RleAhWojhSk=p zJ@x*z2qm}XFj=3go<o>|rYMDSJY}%@?rtaPHRvT?)N+F(XBsXvZ$OT|LiteBYaeoD z=C?l+NfX2}91_bPRXAttP%9Zg2(bjm*Q6B`s5p&UfS=MwT{=v}A!TG@y?a*@Ysxc2 z(D)C`%RR^xlaFWHY`dG=_L0&5j1^{4aYx&WTo!$qKq~owkn3qb>9;HfPy)^>g2M&Q z(AI<LV_7MA&EAJKfMqt~;P}`x&}Eh^wxvaq!s2|J$eC99u_L>JUvACzwiD{{Afn&m zZ?>Zf3(HM=Hj=DHLn(QAA%|a*5Wvx_Pt{TB2TWOI*OenC0vzQ-+bERL<^=S$M9;MF zj_uIbdYBa#HT&xq77Zjd6}A38oLN@of7$F*3p0*t7c4ogjt)J$hxX%SX5OWxePTTU z&Ktt71U|H++}BP_ch<kvKE$N0VPR)4$jof{$RQx$0f1Zd71XUor3hPyEI{yT)%9?Q z^Ts=IU>^MmZ`0Bm0rvv5pjMeh<nTW;G7;}6xX+zr3>HOe*k9>s|MxOz7cZ4~!2dwb zt3!bm#d09`M>#DW9peRX#gYp<_P)Kz1vc4A=v*OlPzt*1fR7LK{<0w}NCWt|xV=dJ zq=wi<T?mzCJv}&qSq#VQz!?LgkIKjmFz5mq3k>d(TBL#sJDt3YjH9>9ua>a>r}C^D z5F9xOPL;p36(Ppkx2NIsARIy4{qq0~lRp*#fe)ObNOGOVu9ewR%Z(WqJ6m*KnN>UI zg4A6jv!Kc8cLxv2NQEt&s|FTZ;EaXQclcKzl{eZEZf0f%j=?G&?982??YO^>eH(4m zb3zsQdk*A(x=94n!EhNfH@DiZ8u+g^z&D^qyo2FOdT9w7l7(jno3oHphND2HU}j>< zhFW4hT)N?Th~{%ZHWd${WIg%{eJ-59H3sI3KxjXC-WcN%@f4!y+&*X=XzyR-K_55; zqgb>I@40RhcS7y;hPi}po5!M0awz}^YWTCwNI43so**NTFxMvxFRbf>i{^nN5MNxT z;Ge1m_85+0;?SVo;NZS?;~avX{_Weh=Pq1sX_BCMVq|0lbuO3+&SCG{D_8)xCFXZ= zvi_}jYAYC=WWkUGq!Cm=u>ZUwoQ5&%8WpeA9pw{F!(e^+BDmH&j0O}0f7>^>S zA4+2Ehkzgs%%LDJFHnDcK4A$lF;$@O=bCAD%wb?$azX#Q0J*s!QuBZ>1g;L}gKWMh z|KSqv=jVrJDDs~2f@^1_4rG5Ip(A-Gpun`6-Dmm+RURK7U&wCqGh~Es-@esucVT=+ zd+XMz&Ye5g=DWo=4QI24fvXE3qz`9&@L(T&A?VY&a3tclF|(1kZ7~w4ZhO}Q=qBNK zm+rVHu*C)Rk}tkM!B_`NJlF#s@zLX8aO1&be)a*2uqqZ5z^pmGM(FGY;m{<wuHZB? zV9PnUItbyi^780Y=^)VK;Ntdk^!D`l6T&$}hYy>e@^n2=sw?yc*BrUYV6m|bO#>jw z>^a@@z8NrVYJWmFF9ORy0%uPN4ME@;&Oj%2@IJwK-oNjGnMjB8i*m3+&=CN;eFW!l z`orJ|T>v4lxcI#q-Bqd(Sm@)_^#`4{uvg~S-?^dB3`?DRgx65<6XSRgymRYtQj+l- zNst)Y7YF`53Zh?d+|8g!6Ux9qskurZ<M#5PEer&lISKa+{CYN_hry!x`t_?$_aU4H zatG&8r^yyfKmz+v-EuzCpAd>>q=!C+Vm~~`aWouY!oeXD{b|KRCjy6=H(oO&+TB1w zeiVHL1UK{}d=KGHtTa!cUmONW>NfmK2u}S-IE~Zwf#We&kx}b=7`s47vTC|44u%Ca zY|yivhHDBP!0O(t17;S?I+cJWO%vTr;8};ST?=~i#-9)^>p||0=`GUETPpnW49fE` z2_}%@Qc_aj--W!i+M5v)gv}pMj*Y>M37$ttqD)K{vu%;U5_NQRz#;HP7-fG(1TF9d z4|ZrJF^4lr0p_=}*GEJ}Me&&!7)-%&Ns#(Bh0nHxAr;ONr;>Z!kL!%|VE^;!*Utj{ z{Xw^R4u=V0XP^bdJ`WBigl7%7*MNj&ikFPzv4(=_v^6I;p8*se7-He9_XH$E4L!HU z#wU;%Y5dJ#d5y;}W2g$|H(vHVy8$H=Y*hNttBf8h{m9W^r)dCuT#7(3DwLRXHWYNf zRfUdf4gTc=_}3hs78wRCzrM?ksI$XFTV!Z4j-?$OiV1Ji(apkkkd}dQXoDXPmKc3V zhL1s+nSnvVV<Z8<IZXqk3UYA|kgFm*_P|ESLrdG>j0fpU^c5f-k6m>T=+;4QKW+=9 zd90qRxdFjZ1L7;l460;sx*P?230x%gkmMj=19HkEoQCuRw`^-^(JVC!bFaB4By`FP z5eix@1h_j03Yp<vpbh#Hz9ZvyN0kl6n;tgZvdv^rA-R6t$ixI{`$PhJ=eb9ukdW;n z;^QAeIf4UoYjDU~UHMt6_*p@%fT|KT)`bT`y!$xr&#rfnP(Aui{Q(u{bv;LF{Zc9G zn?m!AOS$54jcH%*4*vSS70id<wSF{9@#*yD&oz(kEl<vvj`^)dL;JYfT3M>@wR&JT zOnAqEANXz2saiX4bx!&vp$l>>dZeg%W+RV!aM>Aa%083u^RlbQ=n2keE_eYsmMEWb z<9V%~El(U`*+>+td8Vj$@jltRS%-rl=EIZIDZ9Jvn_JiDKg(=f#tx-!`e{>9fA&c` z&qRwSt`q(%Irpghx>(V~nnY@t=S963UP<42M3qkUm`$E~`_{w7$!GT-Bz21^9q(7* reHK;*bux{k6BEPtJ`T};^aqt!Y+os}weTjCJPau@`6v0J&;0%yh0lXh literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png b/doc/shared/figs/arkode/implicit_trapezoidal_dirk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..da400133124299d48e9a792a4f063546015c828a GIT binary patch literal 18255 zcmeIa2UL_>w<TICA_xjd6huH&R1hR*5Db8TNY0?-oO4vN5<P%OM#(wnsN^g;2g#|( zIn`U`x%a;N|2_KM*LU>j+oMO<7zYIE`|8_!uf5h>bIyG}zIiQj?JD_I1OjnQO!T=7 z0&&S0fw&lgbrF6Ov}c<R->@x2m8}s7(i`aiF6hVi!n+VxY{VpATv@`nO7IXzE9kfz zes$O8g_4b|xt@*vJ1bp;q>!A1kT3(aoPjR2<U1P!MRO}-YX)jDGi^pbr3o^4{~h%E zpIPa?voSO`qn0x?)kQErc`RgM^_b-e3mY}_6CO5Z9%kkk8A@^lf*K+ATu9C#W^KY% zP0n@_wZ(L)9>cFKr36QKF8q6Wl)?Qk2@A-1<UGk(puLwK_9UNyt>mgqX=Ug5xMX{! z#K?`p05<yxlWId^^Oop01c5L7<%WM&iZkQC)N^x>nTq4@d{Xb?d-HmIRUF<qm-RwN zWOvLC|KiC)2e<ykEQL&XV1%09uS)dyL$Vup;oDpY^#yn`Ukq&cf%~o~d~Kl-f|+}I z9UCSKVI>*@UqhaGU?33hZ~f1_1iQELJ*MsI;A5KSZ{A#THS%vPFq`1f9e(?S?`SS` zU6P5n=H1fCx<;`(>O8mhT;=BaaQ>_(o<N#8KVyaC&cZ%&ELXiUrO2A5;n%lkiQm8P zX1`*Z95aftXg_#tmW35;GFrj*9&^2F+AGNUebXT4Wu<HdSNhG8XijrR%^E&l-jk)C zM0t66VZXY%x-s+GYWs~zN*)_BRy~Q0$?AcR=Hq4GBxt>`@bK`iU(e}QRa8`rmbkAw ztiv)<<=9uftlR8->M1Heh9MEnfkc*0DfsmD^-VdgK6YKTe4(H)*e4};HXAHxBmxhv zJze+Vnrt2XsG*^egNs_=tX-a}b+50=r8P5Q--{_6qlmTZ88F<O{=ur(5t3foYNajj zq|;}Yi#<^O#d&|N{Oym6NV4><cDM5%KYq~A(0u#$O-xLTAN~Y)kM$lgDK8#0c|!K{ z=T9EHH7=*!C9{bNvCcPG`EP%CB#H!Q;Ay%Y&8z5tXIdO92y)d-T#e3>R8dw|j$l-e zaXI~6?`xb&#i|!@+`rHny?V56L`Wq3RpNeWY6RuR7Tz6sQ^JtAxE!~l-CdjN_H@;E z@7}$Ao8Y=LnXfJ4Iq)k(o_^1D%6X$2(^*qweAsA(TfdZ(2l+j-Z>}|TBCTBP-;c(W zhjyeZv+GE3v+j~e&@D@iubp317x_X%L+R=1)#HEnr^^;Ib$4{wST3_a`TJ?LSEHj2 zX|}{d@6RtTuBv-y;$qfs{;m&yr&yC65_?;60D{5T$SCah$wn<ITv0>%{6)>dq_b^y zCUXW#q26vtlnqJzd#h`;?!%>n3HzzhVq^Zp?9~*>Xf17RP4_cf#rtl@%c+XF8rcGB zwQgrHrTp^PHa-0%JlXDNtD5dd?V4e~^YZfUiGK;W$(r)QpJZTQ!1-XE-*!dL&aR|} zcoggE)#Fu7)JpYoj~p=(QCfZIeMzG{^Bh;{vr_V4bNk%t{iyx4rmflLV#@5}<nZsZ zsjqLl7{@PE^44J!-rrprXxGy*G0Eal>+TYdL`AadGip>hK-ieq9KCdX#Lm9AKW0wF zZWLzHxxBpm@#9BfKiCz=ot#ruPJ0<FZu4#7Id@w=64IduzEXdUf`jk;aJGOwA>XhK zdmAQe#lp&JJM5us*zf7->38)$@D7u~EaeC$O@)`}{lJ8NNx8P7cY^5{hpxj<FYLCa zLfE0MC;PF2?&m85na#mewYIAYm3GMWs+}$Y*W;w5BsTNOaYwP#*RjX5R44}sU@G@h zW*VAzO#wGY36&uVlW)&)k_Wa&Fxd-~s-))bcoLD4ZcJ1vI)06c%6R+~D_^&r#CB$G zZtjQY72ez*ds3-9E{7JdfnW}<QwiK6CwJPYKCoNvoo}U!HyO%_wJSi6JdktpjSuae zJ4L+d2UG4-=d{C2fvoynr^{0Aqm}j>1DT4>dn@5lQ9LHYPolMQG;7bB1<x%H)+f;G z-5tj-5<s@q!P?Dr6p+J-IB^P_-<gllgekXN9n40*<xJ75;DMEuRX;QAl2`4J1vCqE zKK8TZ7B0l`JM$=W6&J)W_9Tj+Hhl%x#!8u3Sge+QeJj-OHXF=}#MfHviltY~;e!cb za@+EEJ3H=-<39=FT~8}4;Tcnn-5ZwJ>~=rjIXjqQdhmeD?euVOb!ek}G4AWvuiu{e z3c%W7dVU+^E-O2*(CJMQ8}(H!G3mMAQdCsLBPg7mnSO3M5U%Sy)9|sQLn7I5!fwoT zYirB(csG*IvB2&;Q!#gNJrLO$!@Uzxdzx$)K>v8~C?jmNXti8Bg56@e4&snE@@d9S zhV?l-MLaAYB!hH57uW??@NT<|nU;zTjKf_-s9fc427UY}CMhZJ)85{mnVA_IzsLLc z^Jd}|78bhiWoix_1;vfprl}cbuA8>!?6UuyKg$y?G4J)A)J$~lNsV{QaO?2$@`{Qg zrz14(cFrr+>m=7L*xa-b>3jbC`EZP#o^?qBMC6*3g7e;hBBkWU<ROosUzCd1L?oL+ z=H7=Zx8KA+W?-->XwVUi9Wcty%5s_cNN4nz;mMQDMpDiG*Hzlh*Y`$RT11hup>$FT z@iN_o`RR+0g0Ep?=Q~E|wtq2PlvPv9I;+)WwwQiuyZB(Oi`}yN!f^l2(PF&u>PU%c zw1|S2o%FE5Kt}i)tg@bnt`cSZsSYcoB8g}g9@`Zg*kjz*3&R1y0RgAyCmWQV&9kbZ z@HFY^kpiwxNO4)ejEqMj))tl<zrS}za~f-!34ZX;Y(<u=w3TF4y{b$$C^i~c+36Nk zOm$hyZ;oN0+UiT0ck;I_c%;jTJYE}CSId^6yDDz0k<+2+d@6NXBw68bJ8AzRvP&83 z9Y=I5+++XJrAz99FNS3+uV+fA+Uly>CFXt}#Z#SFiMHtpBb;0AODz@`<lwM7-d(10 z-IdNh%a`+Di<Gdmw0!1+yWE@XZ>LB>Kwya+Ww(tRwId-TGhib(jxDb^F!_pMSgbNT zJ3Elk70a92wK-mHy%Gi?Wm)5(i=K5#ZmXowQ7?QPQbswt94QYQx!_ivNA&cvDY@zC zmNwrjoMK}wLa5aZ5gdEyWo7zuoa@I!nAFc=pR6aMCKmGH!-ryxtwhEv6p;LEE33;t zQ&S>mhyz)Lc$6j0O63(xbfcvx$;im4sHjLuQ`K2~uT#pTguM#MDOD25><yG0LsC{c zW3%w{yC%lMQ=}2XRPFENvVSuo6tl7_pl7n#?T6exumz)i{pe#rfShmO%UR9yZBkOw zhym+AQx+~60uidvdY0$x8p;@D<x!-P4VAPw$H&jlFDxvqs*2CHjaDScWUNHed3w>C zRAYGG+-M{2^XJde(V4FPu&Z}hhooEwGUPM+Q;U!iSUpfjD0%Jr`}>JVNcNZeL@1|{ z#Ys<=Ctio-xP-`ODx`NCp-z;m9P)YGkfX(25!q|0eQ{-kWMpM}ol)>=YkP%sN6*fS z7cbg&M=@?vP-MEU!pz~{xqDY<q(C=SD!!|uqyOBq>|H&k?lGipgDLyQPsD&;l9Q7; zn1AZg+oEHc)=N}Ww56kCJnvn-x!VqfuCF|b_;Y-Gt?5_^%`>00zU~-qS>+*KyR{JY zg`EC1KYDDLKaUT|hf2_Gd?DnilF~2?EQm@_z<J*UDOx%fy*9Wzq91R#h-x5|dQfdE zFF&vt?=AqFhz`5AvD()^=|)oMz?_|Gw)KdLyHiLOe3lVmFGu;|p@XiDhQ?$`eD4>6 zn>UqJRE$vDJgQlV^2<#r$o-%R&mpa`TQSzvI|cFX+1N7CvykRB6gARZjR3g<N}H^5 z+{w(X$)K#YoPDV%kltfpbIz2;FNNeu8qJ^|D=^Wdt)#NcHSc{vC=~+p(8VMY%kNxb z=X9{%oDY}m$rIj}c+)&q#ENWkTp#B~y31X@d|3hSo~WXL--w9<=XQzdSjMdL?$Wma zTx@LV6LAs9E+u!P8*?TUyW#~kZ>CFzT)J|-|MkWz50{-z&Vgk*iLVJk@dB<DEZe_* zsT4$vI2$3UAq7`+Op=Q^5YbLh^|VpK!C6?*m%sDR+^g(RPah#5B}{Tc1@-pIARYF^ zd(ju5Mg-3fwX=7&4hNIe6;NkWDCAsdg*|8dGvDi`g^B#HzWpT`B9qw~UZS#CP<)iP zI+Qz9)A$UJKS{v$^w9EzT*Dd3ZtD?`I$bnsHVik(4^r?-<uFyWTN^#Ft@)%&m}Igj zukX>nelLva!HUbbov5)AQ)4PB%IXZ*dc`GnbbQ6D7KzyvZk$xVh0*i4|8{E5RPt2u zn){Z&rVAut<H4-up<K=E<~mX)jVi;w`$PH;N89re8cq+HnVH$x*run7P-EQX`dRzE zg-c5Y?DzcQHN?jd9v&Y3)>cevWqGbAb~Fu~Q!a^<OYqQJ1)MawJAKIUa#_m6vqcT8 zZxeNVwwL_F!ia2@Drps@=mZ@$6L@5tV?X_PYq2|3n<jF}VXKi8DdMF4!eGEUa!AFR zKb>wCHA7naD~O8Usfgw66Efjv&jz+g{F4Wd99)ch8R^Yq^3N-$&dkav7l$IsT6&DE zDzhsJOp5(ip>=Rjo9&2XU6I|FG=@aj&3_QXG7fteK=iol!Nf}8?Gf>^e8VCA<{T?m zVqah1(gN+mWap}#jGP<=-&J?hkRF3ukONmERN^26pf7=$u{oifn6xdMP*9iC*Q6cG zm{>*U;oL?AGF%_PtCCS{%Y)gf+}zxbj*cTEBUi59dP8@(S&s*BS3Pn7W+(LPSA!kA z5PymLp`DcNMS`3|n}SO$x@}=osPlt1Net*HvH=meZMV{`6pl*%B+hZ+K{5_6RM{eL z|Dg5%sl#Gu|M{^>QC|E@=X;5Ewc46-ZAi?wY~-el?DCFwFNV{)S?pyB$Kd{n^iO$h zmJ+THjcSf|plg?%^1$d@aypSeHEO0{fRS<UmAo^@suol_z*2HP;q-DvtLhF0Of;3~ zd0CGuopKvHDjvRyXQwffic&7OOdW>8K0G{JP*5;YX^%tGp||sin0|YE8=zCncmV6e zhho(_c?k*B5HxgjsQ@PnHZ<bZeVt7Q_I|Fc8SAJPQ@Dm|M7epOH|O34bVaE1Zh@0E z>u&y1gPuFORU8|<2V+y`3KQ)Ojg7F)i%rJ{-#(dJSje!pZa9DQ>3FtL7;B!9=GsFZ z9v*IP<)bLQlYQj9d-qn#Nn?5K?dEeHsKA^h_84$Phck0bT{J*(=h*7&?8Ik^$mqR! z6QbfHdA7e8`Ec9}@p>><U(qY@m|+LgEL6tcYrknwhb6NAMG|9CQ+JQAEd)~;I+(us z-nNqS;c(T{)lKKr$Hv1$trd1x*ddKrU0qeO_Lb8mD+PG>eWX!c^mKG0C#oL%_K8`t zDk@QbIUTHxu)eKB%*RiTkB=*AI5sXclNH~Wii?Sf$(o!=$jkeM#9tPTt-Q`TnxWrX zV#IlTznX0x;|SUoc>u-7+6hpSr8$L%f;kN~G)_uu&m^mTWdWnc=CVh30+6d%jB^h2 zCGmgZ%t{)a`H<ozeC!Q1BO@c|>{2H$wD+jv#aPVu*{%&s^S?sDZ4EVZVwKb>M_E;h zhVJ9g)SPaMk6cAgKs&eMzB9_ZJ}M|Tka~gZ_YdNC&+H;ku9}-jLb>B}J1t{51<dSp znzMGzWy831EW^KDp|VWFb#H)&5U{!ni`h7rE*Ap>lv2~;ng-g(3U+<_{dUM7@@peq ztI!&bn$HEk)OM{IUm7djDC`!<)IgRxY|Y$c)#Dmjf}Kf1M3i*Cli=0DRCD-qq1|BP zvuWn!gQpqtl|7ux$q(bND9gz~yO;|5<IhU`A{ADva*#f8o*UhGUqmW15>Nc?Oj8Xq z_rQSd<gx13PaLMSdhrOxYCB{U4}Cg?edW)iE7EuG-_Ix&ezQRWXlSWzh<<<N)Mk`7 zt7fZ-g41mLjZf{#dL^FV=^NKqXEHCH_XnW27;sM@eXJrUCpY)fo1<tkkwK$M$&}{g zU_-GcC10@{bJ`E$=*t?*0nP2HsQ$uqFMNNJ#|7N3rqFqe7HiTga#Uc-#se@cC{|Y6 zXXSR>o+~o!3;SJrhBU7|-^(3{bb$>YWR}1FnS{R5(AlukZsu@n);%+j=L1EoV)l;W z>l0{HqW5`^FXNE(JJp*GL4%>H{s!vGZ2b8y-D02MP6zAg$!jzw*_c9UqK*|^jVxm2 zROKD)RKJ)GnC(hd^qk1tW-2IOHFR(|yoASxPe`b3o#D0rDl<aUZDiqI8+X_I{JcV@ zyz{!Ki_2+KAO-aJ{Lv@UhPnPlg45&4;t~D*a?$k^D~-yxt4PLRDzlXfn^Jy4TU1#F zpix~}IdUJ>4?Rt5C|zn&l7WcP2J^dOmEzJh7V<!#CDzBw3p=BEDiX^QgJBMIbmz*g z7mIwkX=!Pp)P}^wm{?mgA@|H=u037(Lbaz%pwK*|)y`;rU?%(BVk>B7G{QhIH&HqL z@!*(hUpT$uXpv!}05KUEm(^Sg#6?O<%A?HT)(ICPMl&1Rzp4`*vRN(v6ohPrRe1U$ z|5d>8?kC7nXk<7|hC@Do{#I4#^ut_9>1)Z`6MxZuRXg!wC6RU^yS|)mKrHq<1W~rg zmy7dlr;Sofk4oLY`5$-!fV_G0=ID0OLA%ZFBU3*j;UeRq*VX>A*-&Idj54nRiSaj9 zNi^^Er@Ggo!hgD1KN_J{X7O#1RX*Hqr$>YewhU6RA;^yHWn%u|MkBNva>i83-5ATK zo@qt)q0(h;?TjN*`o${1QX%J_PXlxr9p~;|uqPrSARrixwk?mPhCvnRwy!Nx-MC?e zIy=b3D^^XHyA-mbw^Dc~D~K=&!Z93UIWW7`sCZ#v!N{4M!uGx>DQ5+b<6WT&s9@t? z;0`seCo%C)6876h*Ygxc2iMW<$*m*~bbCT^Uudu`1>H0L{{4IOq^ti}c!*HP&@i3j zmw~zd>YO|W>QQq;0~hvZ=mwQ^M>BpNm8`vls(8@4FX;q4L_tP|5ik$I{QFAT)xwaa zQHRZfqqUC&1yT9Uw+od=j8xT%jl%cSIZQ`gc6&rd`D;QcC3SV@fww3^JrBCc`qJ5- z0q=ebG>1m#r$;M=9D-*ui!<TJHlLvL7T9Va<Uomg`}zXT-DwM_-`^;3*wQjRu!h+n zB_=N4&h#0L<QmP$RxsAnOR-BOBqc3{`2<qSHlR~s#pzNAQg2*?Kp_>o_fcVo>pdYS zZDSc1xELsxQEk0X0BQG9$6`8uGzNBY2j3Mn<{!=QA1fFzs<!z36P|I+J(TwD-8nQg zG$(lwPMytIs<hZHWb`L^dbUex!l@^gs!SHBpzC6ZR4Fp}92T|<uv$k?FXKSOW*eq6 zX~1ZJv4iBXN*Z$fDAU9(=9ie??pu$dig5+`*Co0K$K)e5QqWqzc)yoQpO}tjLSe<s zCaVndl{`E>0nGm1FMdnnuM12EF)=aJYiD3Hb(v0qCRzc8<uQr4i%Zo3<GIxYkbVR1 z#!wXw+URrp_01UFcz}d;N4d?PW<Yq^Ax8&VwE%-J2%c{RudJ*DQSy$CpVZSbkhB8> z($?M%q-znKCQoFIz_mJp?i?&<nf59IG+6TVYt@m-X+G#3)X7(R9m^xHre>0_1X%54 zcX@W{^_{>Nf79Z)_Cc-u7(T~s=rh|U_a>b;_F7)t*fY<Ui7tsKSv}r)yLg$YSU&xt zn)yJ1t8D#F1jaIE;fM=xVly){08f;%2U}WN)+Z|I?%rKekMK3zxF#(pmsDNJM1F(* zXSs^(bv_SWoVsh0M`i+hVId(28m!4Hy~*u>PonB---~}?;C4CO^u{3t_AoU-?DgyW z#cX^E7>GJj=u1~7tDRk3T-4OmBqRdxXVyjv=@qhCy1U(1(o;)JM!wtI?iHI)2_TgP z1W`xb#{9OVlTDw1R=;y2>DflrPSE~42=CCp{yN@AIzub2-5dnaM>6*(-<<~!M2{vP z-MOPRoc9iz*sMj$pVPM$y!`)_(@dwz6N*(TL5$ZqhFGOYL>B0G$IZ7#;E_Ffx}gGO z{BDmDBj*k_6!;@{qCNdw_|+*scJDnv!FhQWkO2WB%{B#AuI5zk=3oJn&l$5Vb7kJx zShoz;5=Jd8MFs@_rqtaQo?QSV3=9(7m`6ZhGpZD&!8?Fk?9xm=6VgYVPsgJe)_#4s zMzzW7?d|Opk${(z^f?d45)gpv`6CZTG(4<CC)?E6cw`#7eS;*uIbW2Yp8BcHQr(@s zyHRPJd2;;i@ey>3La)f!41Sea&Sqp}0Jo)GZ49czuWQ&cuYo7?#s{$GL<-N8Kyf1} zW@bi<=6RuB=Pn~?4o^Anwv2{<`Jx~vHypt5=uul++YR9WGG^i6?=Wui%Q?`iLG_Pw zKR^0#>B>tHk>;kRFX7?9z^+YJk7?xx+~O_(TGxpbCIarRgVfT}8Z9-ih28`S!P5c_ zKX9fi^5KFzWBwCWzAsiR8DzS(9GxzS6UPaAWU0e8Dn&0hF??Jg!Q%gjG%}6{3d%ua zW8<>=MZS;GIhB5(vOKL0;f}&Rr?Q}&(z^5?$}CT5Wn^Tw(KQO%&&jVx_EWA0@Kd~? z`y>VH0X<r;NeK2QWilHnn6KQZ=?el>cIbso2o--L(7vOyGxo_lbTzJKwyqUMYdFVf zs_`qcw%z)8x;;(E%fEFUw@^$3f@>$&{mdAW1vWM|l$6NGNN8E$AHb*80HpN7*YApP zgk0$F@4r!VvJOlnP{ryeqkxf2AnK-STuJ=rVHdleZZ&U|&0e2R2kKf6@Q$z_bhYfp zgAzB7mJ)+Aa;qW8fTh6$ZkLFN&1}3364)rwJ|I!k@v^Pe+}i6`udYDr2_1xmMP4Tx z-Rl_OG^$*Vw)qdnL!+WrdM?jSWo>#~r{q~uzxW=rakAh1sQ$V;piE)EMt@QW0UvMg zV#B_dSnt@#QCq?806;r+Sc;*YxN}Ds3&;q^<=%UH-az1=9d)}idKnDmsKaJ|`}QpW zA;@-k^CKM{9U&q3G|z!hIjl`LKWL&bw^`|bc=v9SWHiUiL}{$8QR7_0%+b7eo;?P* zxVQnq!HSc~K$XMp8#PqOR!I&!{`CwGnw1i`0PyQ~e65{@&SE#2k>X`M<0*oDM~&az zl2>6Hiq_8K@w(jWg)R0NVB}5fxfX)Z)_y=j0GyzyqNkm5*^#7afK(jj3%7?gfo2N2 zrM9n7^h%6}a)4uk5y&=y7W51&A4nyYDYM@{z1i8>fjk9G#C)ozy2qf(YW@?8q>zvh zjMK!#L|XbY3%r$G*w4!g!&czv=m;1nXqe6+z`~hxYmSZHzNN<QrR740aep?{N!XM! zK2Twpjr!A|%?GOSU}H-2CbxDIZfL8`blrvd-_hnZj(aNuffSsNH0^L`V3|v`8b1Nz zhNaE#DqS5ZT=ck%gNx~jKLcdA!~TeVr(WT9b}7pa@L<KpLzB>mw|#}inSXy+yS%&{ z$Y{AH2Gx?RloY**3fq-~1?$BwBt-NX>17PXUIb#=^1=my)5R80IEwL9i;eDiEdeaH zn_~ja1|s)SJ+J*bE)LEr<o#=bFi;vVdi#}|(8ce+gLv`A2Y}mF9}{ycv^B{`@dc2G zb_<#=TQ3|O93XOw`%YIBYcqDTe_zc>x`3#w&r+zS-@F(tt`nB%c|TN)mj&Xfx_lO( zCh(y3_4P=7d3AO5#j#?uiP3YU9PItJ$Ox6Tc`h`wR}a~~p}BcXf{>6<c2TvS7`=U` z9brMTRf><NJ@MA!Wf)!37dy-+Ds)+UweqoO!dNN2@i9GrZ_l@L^bOZuUH_xacCQX( z4v}iQz%<~UczW**K^UM(j55n-)z?Dsg^y?&u28wWaU2GO?Rf=nvci`B!IGfiBFxck zrY1ql+o1ezR{2u7m8GOCfLxaE{)$`aftO!E0FiLn7KJBVlarpVTw)T*vjF4;NH=)6 zxNAeX@ho~Eap)B~0zI(825I#Shz#8+oZ=a>KX=rRbJXigku<N`dMPH>3L=_nk%6?b z@)3wsI=Z@@5L;04g#7?VlmMRu0&ExWhFtF)^fl^{N5ITLa+`qMpv>?Eq$N281yI1s z5)$45(36&yZe#09mC`J?nm2bpQT1=^&DE@h`Rs@ntW_?A=1+I>1o%<3j9sM#3k!cz ztFTFTI*9{ux1r(r9tj^zBj~Sjz$-!oLLKsI$KEa(Giz^cjpVYN!C|UO2*Ad{aXy-l zh<87Cw2gwj;R^gyFyD3yJX<(3kcniV=RgtT+q-b4{JvOB<4H<sSy|c7pTgCdh+h^L zFGelQm!=W&o~AsvGd<oJUF3rW{%1XX&HK0izj^`wTW#G!5H4A{$H@44<Hma*bb79H zb#vx@ddOYV2s!$Ht_1(TM(F>KJ_Tc0{b{1Yn>Q99W&t^gO#=e<S6~GxDYNaRVg7h% zg$B_QI`mkO{5WQ1Wn>n*Vl&0X&=na2yTA_61FS#9`t2ugpMr#nuZ224Gq2uL(9_cc zIvWJrT}FH~l(+z`>;^e`;$MIL1sW(swz0^<+?+%lA2)z@V47LTVq%5KNl6uzl$Pen zFR<OYaKWSc;k5Z_dFA4(s8QI%BMl-n&$YC^x9VhMWmP$BeP@&hAj5`vR}}DABYMZG zl$fO3KZZxEpb>gCTx=XMVzU10n`f&|ZzT!*b^`PfTcA+^bzY@`2uuF+UZ)uqlL#Oa zl2TJOD{Pj5I{`&8m!9dPzklJ)*;2Z(i-=zs!v|~U0T{}q5W0|W7Ut&z$=O#xF|^*2 zpL>BoMBO-vn}}z<H>EZ7!vxx*-9AX4Ao-wmhsk;P=%rwc<$w{B*W%*5ph|)g4$^;y zJvVw5FJkw8gZv96z1sQU{=ItyR4^(zKwhvFA<NTmS;8Yjb#PJy2=PnF;+`Z@06svy z(hi#@BQq0x52kUk9HuHzg!a;KV5;5W+JXN52bbU(_Pfy={#`rV(%?DThBC>{CUkx( zyZYY!Di;2l<OTQH?g{??A!PNx(x>tth3|ivf#!eP2SYo1n!2F3gS0x+=r8Oi<cYbg zejT#cxoF7sY|UD?_Aie?(yFmt{lb!xm-lAsF9<^NOErylOJK<XAYwmm*$k$hy`0N{ zZwY>rB|Yor+vxygXvRkFjSu3UQv_h=UrHg=ly}&nZ|MJIo)6*mk2a>?e4^(0f`NZU zU$}snt}J^h?2obh_#b!5e-D7?Bv~%Ce5OUK=s}Szx}R7=V0S<RDT2;N$FxE`yY+a2 z&=QL9zI5dRe*ym^cnAX`7~M500q7}zJ1N5B{93X=SK9wVkJbOSA@ZMiFo-IIAqbwJ z2_M%}om&6~K_g#zc>uy_`vXWIWvKHLh^yPg#L4!7F!7Sg?}1IJ#8d?PiU2rhfN1EV z!@<VB2?8io1&RBz^+bA1jEp%DgSqxser;a7=(Pa}$-zg^{-EYFwfL)7z<DaFs66rl zd(Wq!AU9}js2rw0<mEj9IU!#Oavyji6m!%Zcb9qq<UY(L7j!#CLkaO8=i^BT)N>Dv z(-63sKnV5D_V#V(HD;RU;GR*)QX-(BSamrDokU9DNC(s?Aex_$2hvH!nfN_&Z;Ov6 znvNF@c~7;yxIW35lXMd*o0-|Ve!Q!Kz6+7Cm#?o>4A&NH7T|zkKwECMFx>OTD?viX zcihiYF*c=cdH(&$HI}#l-w}bn8~0kEa=`0Y0)BpfyjhLG4ZUEFdgcDwNS{`IKhKX` zx4ld-?66zNqwiLKa3g8vcyBe9$Ck%=KWow(etAf#DH#HlmP8mA>_d?5orWOtr!`&J zg=%(t#ldn&Ae@w(T)or9`)7+zi@;y5(#Xil0$P0RbqEXh#C~0^8eI%FNd;o4z44)C zny7KD#GeV35|DN)1(1W7To?mg+Hy$U9zHt*5Fs?8(3A!-{z5~b)I%2!B4G?n%-aGk zTmk}UUlP2n!tJbLk{E8wrYlJ!^oYZ3JWVY@T|pt`Pl1(;gyBOs1+>=SaX%yy0eDo* zoGS=K-4q7+0;`P;JWh{N2QQ$A@TrHRFP=BWS2|DeVxnD<u9pFzXe-Ld6hQ0o{rmSX zk5%`<s{<`?U*#S6d+bpib4yiK)kvYfqMTey&1O4Ot%Rs(TDPjczCPY<zQX}U%?Tj) zc{i$9?be2&b}N8}t{(@N)^uIDk%X@WiwNc&)Q%v^8n7-8T~1osA+!UaWAnfJ=><_< zewG4GxkyfP4FiLv-ehs9IKHEy+Vf&yhQR6s#=eM&I65f1gwqs?y<o4B`uYSoNH=_8 zvcM)7au7MYQA-F7^m;f~uNEjVfEohfc6heo?!LdKyk{l=bkWHa>P)kAYWK6q?bhyY zusXG(4R*}X9zi!yV>RCfB-uvADkEL)-lDAW1yn;g+rLETjim2oWe(s`0?2J45ZS5| z1)KvQX0)<1X$+qW{VKqK(XCq4*#;{s5O*<=U%o8N&Huv=sj;~yX=1Vl;Ru~n@Gb7` z<JDX=+J_EOuW;n;6Hpn8Oh&AJB?tiy_xtoI1LX`P4;Brun!2p#uo&$f9ddC{FE*uW z!l;SCAqhMdyfj=R;1mDgGDB7Y78Z!BwPEOPd11P=7ht;Bs=za-fn~WEYd;#G_}ZO; ziD~HDeTcKB4;adoAlB17hrZp|70601_aijfSLTj`h4lv03;)7}3oC56tQ}A4;Y%Lg zHRBT-U8O_jsS}dQcNkZ$;LyAh7dLI9Z)JIq7BoKyG?j`}_JBrd!=LxVmy=(4uH8Ae zZbJ@;K_{E@4Y0aaR8$P=g9~Ssbq5$&Y?^+GOX*?827Ffe=n5LV-HLGpmM&dTPGDYo zFrcg1UGCd+^alxETGa!MN%3daD>rhwJ76=oL_yp`Y(k5KO(QHU4B-np@EIHCGuQ47 zm(3qnu3^@npPkS@dh|y~hhCXTxPPbl#=l%DdQTuFIT>7Jea;&<$jN!M8vL?VOLNr9 zx4{u2|B{55_zZ#w4+n>WS<CBS5<JccpLeP;9M6tzX}lC?6YtQ{Y6CBnsgMnex;j;h zI@(!;CQseJkp-dv{9op^=ygb(2U8ChSDApI;!*{Wa^PSz?~396+X7OE52Vcun7q(} z0LAnKJR14qDe(}1wykY#=xv`E&F=ID*jB-#IYRSVfS>Qpx2kzRb%TQgiy3s3Y8<#` zQ?|w)7Z!het`*F9drLjqZD9}b_;=rAD{7#I+|Ly2Ng=sR<GHX1!LV-P`T(uPpbXpK zuY3E1{U|qdt7g$~aAOXHz$bbgWV&TQx)e|1^>({wK!UBybYT)oNlL<^c^P!8+@R-s zUER~avm9@Y{k=|5488FiMBpCPhZ-KZSXfUYCI0P4022C8$8>d*|IV=wVRXRhk)Uem z(eQyhZbMzn8n!6#NcZUI+`*dx9XV>G+f8BhjM}{RY~LsM8ax3N+&KnxBe3>)<HKGg zV>gn^?)%eFA~v?FF-Ec=3Ob{><5LC`(SU0c3qA*u%RnW7dPHqgJ`a5RNAtJKEME&e zTtrw{nSkrlr%x3Wz8tKeCsQA)WAJVMN8!}vBoy%3&Mve<K)znVz$g>oM;pig{N^0U zwZT7kKXt#A31I90#P;>S4F9765!GAJR{&>k&Agy#ND%VeWrULURR6B1{vhxp;Cckk zWU9he{HCmuQkprsW3HH0HPH{c%^wvX@7_#lk4woT_eWJA#|aYR0mZnx>il>W&2JKb z1MlCu!<#a+uzLLez(H(2E-4*$ztm+r4!D4^%e3!~kQ0t00pfj1Lyi8yqJ)?S5e^AM zT6(%P)&9zW@m$Mio<THfZ~0990zA`Tz@oyuawQaf{vd{0=o9$vkk33nWCA&Yh@la> zI`8uv{$)YXJO<yWeYHcnz<Z+u+~O#+Y>I?5CSVG}8#i_zz`2h<19m(7?F%HBL30|O z?=^}Pkr!|o8mhCR@p!%Osyft$r?WpD|69)Gzib8n6DauqUIMH5FGo{6b{P}$>A^j1 zInw~B$_pP{DH5+<0Zt#Rd;qJ@4>BHbNlGtYz66cB^ANNi;M7-SAU!?Re(GV92JZE& zEE9n4moRbt0t1PK*PujYmrk~IbO2=>&8+P+c^TmC5^bGP@rwF0T6r0n8@FzaSJ)aO zTfnXZo(5kpFSJ(<)3d%%barOuDh^JyChhyCJJe6}I4_?D0`gZAn|&iE7bXd)9c(61 z5-FfyL2_S_0YT~gx@d?M1DZG@5C(7~^S8Vw<PlbAJj7TyGXCw^6`-a60NCT{SLE2> z)z<*e0KOLZ_HAF^A|=&lZ8Db%hpLO6w=r^d6T4R)Bwx^~f!T2a`v}xT)y3U^-|}M1 zFev3Eq@=ub9fs!iGp)#|gsi+gyX{IpfCTBpmmsiMUsI(<?-XGVBJiu}6)L-u-MVEG zO5Lfq19s}z=xAP@mJm=`I2}H~90%fH%goKs8&Zvq&-a*cq$Vd*@;QLN`~#ZuAMS;B zkkj5sg3cx=E+ai%Ok8}d(%u}Vaf<*x<Hv-{Er6qtqZDUmf#L>h^B!8UOpu<2mOmbj zWB?rW!UwntW8&z39nFyq^~$Lqc5(tM=&UQ3NB@amV)(!O(*OB<1DaoY*=fQ-#buFD zR(1%jhC(Jg3rhjWdC(;~4WYw>?nV+T`~YoE-pvtk`ViAA6q!w^MErHC0FwT@ci$%E z*&Z^;1Z#hGB5CiVP|DaOf-6953x*dcoF6|D2*>a{+kwd%_$Vp<y?$u>c5?uNKc#}| zI_bDbiL8f~i0<CKJ>=K{K=9@uO0*$M!yD?^k{`X{oR^PJQ*$#84IHk?`g;#k3$^7d zF#wG$><7?(Sse{k1w=z~U=M)y2g(Wk<HwZn$m;eJ$@YKh7gnB1w$sqBVM$=2K#yv( zfK~*c9TyysSwyqLJ8tR-^3U$)g?Z1eaJbZM93qR6YGSgb;LiXF^kFkKpu;gZt;B9V z$;Zsx(<**i!hhjB@EX<oTG(Prd2fXzB?FK1pg9M}yA9hGFtsc!EZ{@{a$H+mo8r3w zJmO0q?T|aXykjODnRuR_p0RgZfY1Yl52ylLIP9|pxRN~SDZH`C8{;7`8bx^5e0Xvg zSHRna|2-+G!Ji$bgiY(ND5$Z?DZsao2(uXvcF+$%c3^WF?`;0o+uQr;)79wDFg0Lg z6!s&aeYqq}1a~~=!dwO-@c*a2j|Vvclu_hZDKs6Gb~^BS^{TDmBjH{K8YS3|cLF*> zSp5++|LJ67PSO_N|A)84{J&Rb;`RR-fHf<IhlQ=d*wfO|0DwWS0mA&rZcfW$4-3El zS*m_dJAK(-O*?Qz&vLfuTJ&f23LE8otrrkHwhvoVp@uQg(k2!a_3OF7!vkey`!F3_ z2@a(}0KNw6Ih>f(m4E=Qxp$PdwzdWxRi;0v(V#V-!O<s{NC_T=`AUPxxW@B7iluqt zTb{dBV3BEt7pRd94Olc?ar~8_$)28`rp7rL0Tt_{xaj-}KC7+mC1Coub??E{LDK+j zA=-KjIyjtr14rhPdV&;>)2@M=n;R$<P+?5WlrIm#nGhZD>BDIkcVHo?oR+?UH)rZ> z-Tq&A2~DTvd)1jcVnq_&TBzk~yW3ZTggCrDefk8NzXl8n&7;DunVdiT`bU*{8|}UZ zx<B|~Z{4`D4a~{Fk?cYq2r|Pt>b&!G{7_^uM4ZOATWEvl78jYIK?8Kx_7$QIyiLFt z=t9l2pRkRnnLoOtlA@oFG9f!3Y45Wk7d9|30OJ$>4AdE?p&4iBgx6|GMI|KQY)p7~ zcw3}Q2r(%s-HHEZp0t`;Onf{Q0l~K>P<y};kS3kzg&*&_AL*8S^yL4&YbZ5^N2Aum zM~`m&G5l?)L}8&dASEyS$Eqd$l_ZDh9v&BIyw31q9x3)d=)M?;e<BsU)2$H)iq}7x zb!Jr`OO5=iSafNK{wWjm#{|WDKj74fupbz1mfsLgU)+zsJ=a~$r`YSz4rVi;?GkZ8 z%~W$vAzE36VS(mJB-|0jF212MU0Z`Xccy8GwVyO()mRn=vzBcdb{fu!l+?EfIw2=< zNGA0^e}<u6*ZlhgA-z%Iq5+%G$>|t!W*k^hVVPFcub(PHn!x`KOkA-*ri(Zh+oLr> zen0d;YQTN^K;7^A-x)-XN?@;Fc4hPLG}7DGS86tqF)nqX*s4a<8y|XH(Dypq+bP(M z`oZ2kG=2Fvj)(N&ILWPB3|@J)eQ^bKo*u)M-!0#vmX&w6*Jj5fVq;A?q6d88%xlo` z!at-PX3bk%zg<2@buPg9G9FG&dtjOXSPdpVotkx`_hy(6J1Qt(iQZ~sX9M+^ryql> z?z}Jav=D}0fj;SY^6N;wn8$vd!Rx`phg)Wn0$r_lz(8$iXb7HzTU-{?z_U?Qv1#5L zct!K#NS*5hBYm7^9+;KEZ}$^8)&wcuQ|)ix6+IA}D9S1;Q^M-WQf4)m@4L&Tk_5gB zxDAve$ycwm4(Pm9R~@_I_<_L_GVtYSN=p-vlV=1?m0PFc|HN~@OBzUc((Uuxx0>(D zUA`>P;J$zVsiy<a4Ba+9FfIg6MDt_dxq})LJ~8!gFbQAS@7J$ikSWo46fMZNKuDu0 zHaMGWvSxrg?Cx}{y6Tg5$Zb0i?cvCd8=$hDo}T>td{9e)G>08pqQn4szo_=;$;$3> zYW(_Wu{f5rx_WF}oY~GAP?q3m&k#|sLH@HA(zeA)s;i>|BBePTgM!<gogBak(NoBD z#`#KcdWZ1#?HqesfsbF7l_64sG&Ej#?B)Ug3KbK)DC+1U!vd-;D85ee^L_o|AFZve zk@1lGOzOY%JqLFz-b!o-(Mmm>Q(cz+EcGcMzy%Hm!Ho+c1|iwt&;Ti<;j-0;KA*VJ z>q7jvukh~yKl&T16UxcTf{*4ia7g61J`j(iD29jcQ|7?3#190tl9Cb_yUNwD4Yrr& zFaJ5|UT~;+6I~tta|hn1i9u6n>FWC8I?xO?5$Gz1#M_9?1nO!i@|0j;VGtD5<Xr&2 zfqziYZ8n29urpQ!sbe-L5C}{M^#2zCg?8M4k7~9#IKuUJzIHQsV2fb1&g<o==emgZ z5u266h|`|GH@@tuEcj@hX9GELeVklh>_9q<fg^}8CXmj2`*DCw#JqlM7}VUXtgK_G zq#BK-aP^ROFuxrzU|@`i<FeEO!~v;=Sojoa?yd^C(^W4TUh(mQAZd*pf+6J7Cvvdu zL7NbCi(4k199S-xol`|P`rQMk1_SShrUM?|S?oriOU9o8cSTOO37X%dX+Y=o$#yv8 z;*AfDMvl}q#I$_O6>J2G8R`pgh+o3Olo&`(m<oWA2Cg2~!vPpgSSJ8R=)*$rmciH7 zTQiL?1P%Z%G&DlI0>B}{CJ355u&+H)hlgM}1(w{$%WH0KPOaLB{mz}A&*E_rd>_FD zf+E1jPrx0Hr#%Oo7ToML+6wkeSQrizyTBP`Jb}Y$$c;T3E{QQ3BdJnU(Gh?q-+~!2 zXwv?N$7LfAHZoi|6^M3%ynY>IB|(HBrvUcjJ&Ma_DFpw{qerhgtv>++h^9l~8;nr^ zEd0PT1XJ>U`SQgM%09HDUm_whWx;BFl?GIOE!IVJQY}h!c?Uih`>`tZKi)?;8Z>zn zhIpe1qBiVlD2-r)g5$~>Sj?6)&ylj|rVpGrKi+}|4($qH=`~;ja@4xxD>DdBN3c}} zKKg(9<b@A=n`1|@yIjr`TsE+@f+r*0gE{KPJAsZMIrS@FcuL#wCkVhBv<Z&$hxO3h zp{J#<x7Xyx9B4~=9MMod$7)=iqq%W!vgp881GOy*P872&z{Vj)>rTAxt6*lEfy&Gt zDFNdzsMR@vs3sH!*`e~F98ouh4v~l-Z?UdlClQ7<z9+Q5K5+t{R~)$pP9I@Ea1uj( z9OknH^h5JpLnDqSB_rb%76H+m$%YCX$NBu3#>)XB8-1Kc@PkY^3q8WX3w_g}#9#p) z_j4EB!_%W3rmD@KV9||tT1f|9)KE$yD=iIQ_!j!W^$*YDF0lT;q~svO1(z&uQxmkS zsS=Sg%F5hOR-uY;M}F&U{fzkK0MyS@ESm3$iHccD%s>=@s|~ESQt<-nuCK(b9zJ}y zA{N3?B+Uf=5ZKmPIXOADZGbg^Nr3+L?0Bg5wWOr2T!7VXj}A-uf%4y@-$Z%)_~_~A zbij#kFf{_Ak8xspIUf`ZMbdTp!<Cg7G1&c33fzGwKS_nu4lN8g*83nM!|}S-Rtac( z?|Xr|=gUiV2~ibnoPS|j@MR#mEhu7e2Ix_#n;b5<fwA&|CP1n?-vWs2dAJ<;IRn5T z9H6QNyXBwb_Js5E`=slLr?f&I81Lgn#l;DQ!D+5h?IeG5r|uG-4IHTleG?8_Wm&yW zQn0kl-!I{XpcnRo{4gr95ALi72kSr@OBxuY?T~Np?0DnD#(8@ta24Tz1NPNAsQ^%x zz#1~;c7lZ5&ucu$po>niu`w}K_8TbUjdf*0pYI6Vc#YG`ZkKOe))%^Us}T=BX2P~} z-Th7L!d<TNWfCHq&|xZS3}O+^i0K5+M4Ja*-;0qCy?Ls-W9D+0I9tne2aJm49?e^E z6O5Q})NJGqt(uimtdo*l^)_HzIXT~Q2x!#$txefXK+s;m6Wew6J!sa8N)}TnZ^CSL z>rhG~>QY^80`-OIFQ#KiJ7+fXVwLQJt3?d$wi9l(g13X|LdCdVu-y14_bA+igJRM+ zz>tmH^T%6`=!uSSqR$g%VE!Mj)?i|2IdWmVbMVX?EPGYs@n<jxb57Mc3YmS&IsszI zGLaGs3tTq|ussr#7*hI{mu-&y?->=3{<eTUKvnwW!gP8b<iD#;UtI)Hd+Z;de;+Zq z?pr@^b!33}MH{z>Ja8T>X%#_q2k?s`4xJ;~lhqjE$%bs@IR{twc8=B@CrjPO5Ospz z(S&J2JsTAitED$+HuKlFKfikR$D8c?$I*NJGFrK$yb4qof`<sLBG^1Yd(r;kf*s7; YpI&vOTqyK_zaYe3yndb|{MO_D0nXeS7XSbN literal 0 HcmV?d00001 diff --git a/doc/shared/figs/arkode/ralston_euler_erk_stab_region.png b/doc/shared/figs/arkode/ralston_euler_erk_stab_region.png new file mode 100644 index 0000000000000000000000000000000000000000..e05a95f3c5d99bc527f72ba62e9024949a24968a GIT binary patch literal 25417 zcmc$`byU<{+dn$MNVg~rLzfaN-H3!Btss&D(nuqXh=|f9h$5+UNJ<EZC=ycA-Q6J4 z{H{@-=e+Ma>#TGBJFIoz0yFcC{oVVzKDBwSp{7WLPlJy@Ac&Ne<h2k8EL#KuGYS_I zeiQM_EeHO=b5y$Pf<RD`qyNLOOzDAlA#hxkZ{5IIMB-ua<DBN5zYo7+b-khIs{QbR ztB0wx1>%;hj;gHOC6tbp1?rZmtCj9UXIqy`C}jsTUJ1Q1DtJFL`u*3PElgdlA3C6P ztnDoj{34fS9i1;<;lFYXB_JYpO+<`eSdE}i27y2!l;vf09=%x|^Y)?W`+T+)OKXdZ zv7P9QM~Ov3DpS=IBJY6xA^;=P$}{J-c4#dpcC_N0R<^WEXzvS+?$+A^@uAsY^)5wn zM!z2A!w$jti3-jmjg!D7my7wa5ow(@v;N>}sd$acQLXWTna7nHZ+G|kc8^X`7oqg` z?-k%`5xF;L4AKAU5#qr}Acmt*7zjiv(f=Pm+$!rn7l3{H_HDV4#YKK!8;8oHg39q2 z2So*i(|O@~JUiclwl7}>bxCsQ#oc{=_38GkMbL}yt&fciZfCo$4VM$q3K>+pDi3!) zCA}U@Xx*Lu^uxQJ=x~oJev_4<;Kz*bZmcN$e36}#BT!AaxiDOAOF+qMP~*P#7z>A+ zn>&b9Q&UrT{Lu`($7pxj^=Hv6isMer^xLhvg$B|6WO7Z-%>#M5e2EElekav!b1@Dz z28Ff*h36{j`sb?a$!@(Xf6Vdr(e$qY;{=CDM(I;N|AWvEbDCy-xwq?2)*kvFZz;|- zhSLfY(~0m)oO`tS8HdlfZuJBIl`B_xc?->&BUlu|7RNt%NAZyz^HK)SFjGlYrfEeo zNIvLzLp>P#dN!bMmjP=eCoa-!{*~q7?~S74jrLbpN$5mS6Uma^?wj84*N-={vHjxi z<kQ|Nz-GUruRr`wg;JVvqATrs{7NL9sMe{jgM&j<5w9+W9Bx9}h0R0#gq2f;Yw`Wq z-y#|L>dUugnrRK+RA0Do;l_;{o*Uz|!VZM@sL9WtKhcfPPzdMd<0F}83!Ip1bTmL_ zbl5Ly8e89w!MgL)o6s&xOKN$oa^lYE%2qR@u9O4^2M688UGX#VTp0MdWrf%b%8_0M z@6`{1ftVR8X?M)cXW_Emjo4HVmlu-M3>TYTcXKOuJ=z<2=s)$8GL!v<!&o)7eqqX^ zvy<Pkv9ZQpOKcegm`7b@+9!LJ^@i21IX)h9t??w1yBgnLVE2aqtnl<bTB~IA-Hmn? z=jC-cJw9MjjIis??*6qhP-#EnKKnho+;)KGo*YScclX(Tv$R~L)M{>Vu}0m=pjqV8 zf`w|KndZoik;)>{>Aa#k{bCc@yLVre`D{&pWmSqVDJk*VTV49VFDg0|QWEsy{coyS zwO=d7XNPdtFE<K}J{^9>VI<5S3@}oPnlFDiA$72qt(oyHf}UrrP`AkF0s3n`Q#rQo z?9|(Os_`ko&Y!QjXSJt?D=Py<2@aMP7RvDh)ov>l4=4PVdvoBF*Pju?f+)8i*?a%m zVfklPXGWwHdZ^BBh&j)GPdPhYFsyMu*`JAAT3S+<I>>aUcyRl6{Ade2vQoz>xwFoB zmlLrGC1vH73j2}FnheFrI~Qeex2B#kw(>;M2-<X|%AU5Ro{qKbt&LRL^yR`dgl~%c zP7cT5I(pu<J@ngo4Iky!JzCByn*Z^dV@yp+N#iZ+oqWBilZ&;L-#(Z%8+p#f+mBSl z$H)I#9dg-S?0)s?6~og5ILYbpg7m}TvLzVK<?f8;V$(0*!f6*4By%S)YTH=sQzX6j z3_d!V!nurnf8E|>3@YQ2Iy-jpY{|WymnkVNCFKWCF{#2c*<!sr<5@~L%gRvc!pZLm zzA=~_zZSbQ-i;){DuM;+tf3o)6W6rne)g-#|3_OJ4;R<Lg7g_RJ$>@amoKBDqLPw^ zYdjuuWn@b<JQ+2xaTkrpCZ^l}&Jx+XXI!ADm`uzl^(Ho!<<lIk!$&4T!E*H!DYI{3 zTl=`X!`FLj6-kyoxF1GJY=3W!=b5X4b^q!2xOZP|_U|J}$H|5^zWQ3<qrJ?`Os4C> zs&6H#WS?Nmh1Ay8ehsDE7%tEA+?l7QrjF%McNi|q`F*~>Dp_zX`%1j{+gAE}>E#ac zsIYYf#e&n*-}P;b+Fo8>uo6<@<7d=rKW%-Z?XlU~+A1%Ijf$ESSZy~eYhCWk`-GGC z<JHxyieFgwj2394J9!%iigS%Vd9|Ef=H}im{aRL6la!RSy}fOGvaBmbaPh*0U&lM0 zJi6l_oidImGBa7{>c53ivz)0gEX-=Ytv@^2`0(KaL(%rIZ4p;WR%T{X&1bX8hR542 z%8$Z-Y1U&sid%?Pm(qM`d2;xx+K06D))bR~faZ!&QE7Ymg^c%mpDkNEHE}iX-lZPg z+vR;*w%PMe#oF4sT=IFX>1~F|&vv|mHE;a=us1!syj*)Ler3+J(i?FJ2yDSow{~6% zt}*FPWTeEOZ0ImVdQCpYiDOKEzg5JrA<V(iY<Avlxp!&$Yp8aX+AqDgadEEeqoR>n zTBXT-tJxT<kCNP1lLD3%kO4?*BgIID+v_JSEiLESRUd79`t9>JQjkq4p)Ecp=E|eZ zNnXQhPBU#exyE-Y39}123=2^51q1}7QVa^+zr><!ZEUo(wdb^wB|NqK8sTxZ+U_m= zY(AUsJ6yN1u?Z$&T+gzT3%OhRpoIqq-p&)*HphMWa(sVLVPWAKH_w5XqNYlqPALo* z2NTn0?^5KMZ0{?SpuLNrMd2-bj-$D@gtj(qEiDO#3!4~h8=IX{NBOn<?CkGhw!z58 zKFR4vQn%0Nx+LVqI@3llO8bQ;{LE5Uv0Y9?#ouFxE+r@^$i{Y~Y91Pet#@0}9%;eG z2llSyn+MtOP!HTyRofLAeKVJ1v*%6@YmIJ6y^xeR-JfaA(yB@>XIFw5_nuz7xS9+D zC7YyQ?|0(EfQ^TT7b$gU<>yydJAZm|G*Dz*WVi3RH)J_*_S(nYe>o@1ePg`9=Xoe4 z-ve{=?~(c?=FgA$=A3wgta>tAU_IyM<%Pa@ak#t0!ne`$F7)>y28WX1L-Upxwr&6T z38{sSWFA<fK2>M-dB4WE6q6Nh+(1w3zP`S>xw+P&4R{7$zkcmGY;`erb}rd|x1t&) z7cw|FIAG+x21{I2RJ4_EF;BPXWxw$!ukvj-%FFsXnwm~~t9K(GE;E#89?~~tNXUik z?(V*M^QJFPS9+)YYR?e!K1q6NstJth6C9G411Ta->AQCyj(&tmtE)Xf%&9(do<ptu z2l^}ds%3=pL6V^De;&*BSMy{sw`!k*lG^PmmxY&n#!}vUc1wjxGtA$A++N_-%@X62 zd^yrt#z0?gFKMB8tL^3GxytvW6gfFLQYrH3ek9$847QkKIX-prs;Xg00V|(tUf!#6 zoRp?`j6div$1yUvSUX)UoFJd~}S8Ghn<Lz?C5kMuoO8~)B@8_UkOzx+j)XIo<9 zS8#-en&I+h6)h|*TG}KdTrBMUwr7>+28J3N8)=fsGn0h1?%w6nExCNJA}*or(_>i7 z(8EtB%KJUCF2yuI(8WHXzWP9kAb#OH8te?{#-b=M>7k0C$guIH@S6sfZPp#F$5L|V zH7+mPSo{u8((hRyp45B`AjnHvBY~vR?8)~Z)`G*8RY_L{zWHCV8Y+4B`&FHg4Kb(Z zv-+d;ns;ol=uVprdwbmskX2R7qjLbvYQ{rL(m0EeIrEFz_A6Wy+fY2?JFl8FAP$V5 z5z}uUy!`Z=lzzf2nP;Fv`@lyhOD(xq82f0{N>1RYbEwoZzHM$w4CYDeooYt^V}ate zd_N(^wEN9JtIbyQgd3#`GX=__C;4xErF{75S3ewG8r?m<ogW&la`E0>6tL;#j91@B zHw=T1n?Kd1p;pUydRG0$_hWCnZFD#QZKkZO?34HJn;rxN1mYg+`6Yy(Ln9&>gdIj# zhf1H4W~rx)L)VI8x(<txSH0{A8irM}T~&uiLP7#ZQL3Fexm*|kD+Y?}fmIb)N7+92 z4lc``_PVbPv+?N|Wsy@;4;2~L$Hb7QsMBr|Z$cIJ<|F)ylSVNs^!x5SqN%BgkWp%M z;j7GNI*l0kl(O*6n>V$zw5Dffw6(SGRXQX`M@PSUHB{^A@@tOJ*`=?lP4f4s%QhQX z3E-Ne+C?TQDWg|6SgX|^7y7hq)b2z$J3NCn-cm_`k6-P+wtV8aA<1gD(cP&w_p>`g z@#yzPJ+z~glT}M@#_3yiam{A+Gy?a7Tv@JMDS^K4+~`s>))S7ZEcJK$pA*s@E+bNM z50H}No!hs69W10QEG!fO`hfMljlWTMRM?92Jl@}`^F8wNInrsFbM{mn%08~D+B}nL z8vI~}23$9z4*?ao!DveDPhuU^w{j~J32vxSpOYv|(YVuGZHJ%G_O3R#Ofy4aeC2z> z6amxnKvB`Lu6=?BvK9-5YSg*yveenT4V)>aMEmuucDI}A>gsB0yq7PJm08D<rk9jB zcc<StI5<f0Kdo|>#+wg_If16y`QwMA?_rti@9nv^9%?5*jZkwsVHh|3&%EQ+FSO5V zm9|-LAFdST)vJk`v{tSrADdTiFp=Nd(4147OEa$bbC%=2bZK>@a$_OIpFuCgwaP$v z)bUBDzuRJ$Y~7kmzB&I$Rfkqz)r|Gn2dr#bGAi;+3wcGw-y0M4{%5D^(kHtce!pv^ zPnOhsoacUDK6|hFiaBKso^wfQ>Aea&KnGRcza0*SY*_rM<6ESSE(L{zh3VYI{#0hu zXVaUlspT;hOhnu9MwBJex9VX2_3aJ>v-ZyV{rmU1d3fHjF?`~O!kzH&NP-#wm8_?3 zLL5M!wK1K^(nlo$9ti1_qB_Q)XC@V%{72^Q?iF!_6%J#EJ1J)dt<5za8-9Se<D^?D z+cDT|hs&%@O{Z*&KJ6`KrK}H?Djo<yg-`L_8^XZC&K?beUXFFn#r2~B??Ey#6@O|4 z$=E_s-m|KHttxF#s;dv$0rj%0CZfgwiQu!#_rLEjWKLY8lPC~(N4T+Inib|EZ*r); z;pF4n82pg&yB^&*Qqp@XFLKr}oc{Jd(|vm#y(l}H@7%e=AnGi?p6gyS*4knq!D~$z zxw>k{^-)Jx7y6~)+sFA8TpY(5JL_WZtDL`M-iSEK9XQUlZa1f`j%yjcz7#ZAY8ly2 z?zPfi@OqTO_juoFu3lojHE;;yxNGalW~$rkmGuts4WGlMtT}=w^Bu`Yv$5)}-Ze%e zrKVqk(V*yE#Wx<^Lc5U)`=y?D+vNmRRaM;Q&9j9QB6iMJ++1B(2e*L4^sI@x%s=Yf zD7a1KH`8#YHn;Yi<84Sp#LFzVIJsFUP=eu(xH0P^cUSUkhyTouL`PwI*-z8c(`w0L zMATQzfg^5{P~kH18hlJWmV9KP7`81Zw9&2B>MmG?4Q<*hS=(PF?q@{p;c{LAuVGBe z&7VzUHv9f8F|gcPcQn4&_me`w*PFPTyrCvaYBOHziDs=1(DkOrJSO7L*djSK)V6i+ z++imnI{uk*s$*b4Cxa)+*^KogSzLGgy8G%NlUuAOfiq5aI82n7etQOdz&|f5`y!=J z_gi_2zMu72c&`tatN0nqg<uoWm_K;XD$R%r(qK3`jU>2g$2$bQ?R0>0sosm8ej6dR z^kJOG=U^^DU1Ccf^-$*A*+w^sw0OMw%(rmu4sQ(|onBZM59?2a5*uyP-Nf^98v3BB z<7fyo%P1JPKGFAV7o%lloPf69UvSSmOk2}viQVvLs*e)P`1|+Muc?GMM>*TrEJIry z_dBwWY-xz2<nR*S_gLz&00zP!EyiI?mo-y9csdcX8ZJD($vG85#-ih3RIpK4R;Dwg z)&=}V!0emE;bKPXQy?JPbwSQ`Wr>N2WGo7!K07}c`1D7@rprJ5fHx@-sK1rSvHPxk z^JZ&nE6}F6=2@H86(YekgkS5-<wTP7_j|S<${k#8S?o<(zF*9G>vi)~*T<(;;;R`y zPMkq)e*UGU^cT>A^8urSQc+ZYTJ79<x6CT~m=K1KUO1uCQ0=Eset2!k`;3f=9>3pX z9=DRNMJG)79j(Ee4?(N|4tdh6t**=%b?t*y@<UOI4S|4Uzz%UtTDaXn(Ml~l5BUmG zey@}^Fck3)RO(ljp3&c4iO6zmCQfybHvv{U7mf0*hEg3zA`0cOGrF<I>1f=0<G_d9 z;<dazM{QyvRZ9Jx{5MT%&B&#*@b7V@ElR!WuipO}>+9{c8!l_<lv#aw`5w1rUtvy; z=4nL1B_<|W(YyK$cqQ-O&zBDv?f9Jna2t78Z&;U?&j!Pj)KUJ~hg7hfL#bdyLLP4$ znrf>{q{NN|49gYS{=M}eQos$ZlEob}az#Hb1S4~n7B{trfrB0~-Z1Mx-W^e!JJVz^ z?$fVySd*4tjz`&EbFe%Uw?T-%?XT9g9Sdpb3bi)^ly~ow*Dov*iPYn54%>;k6ErnO z%Py@?FYA{L0*HgxCU;C|1#Nm`*i_=qYyi7@Z+y}nDZ0URLqWlBw_6dK=Ix4r2s%+` zC>TARxyx;5w9z*d6)i0-+dN`pVla=WjpH{8p`7E8FdX+4`OR$^3IRo(ZhHQVgwdfd zH{SVxB~s#w$GX8><rEBp@5cBiuOB|UP3P5TXJ<KWkK^Lv&?LQLVvpzn&Zc@1N#kqu zLi_PrSl6AW?Zm3ut`l&*$4dW?Bg{dViZJz7$7*z|aQZzB5=~ulG6%Z5p;`w91_JB$ zIxADQvs?B3J(fkcW5!UvrgMsJ&#lJn5}w=UKq4PimkQcj#$Wj8rSD-^0Hyc5=FZOz zX8tT-ul6uRFsB?UYhXeGQNu6}U2v}vwjXx=wcJPhuy!j#e7(y{_Ws?wLxqMlqYfTG ze?kgtf0|F!`EC!iF8$1^-)toKEb+S413u>g)gwIKZm7g!pwRHd?i>09LnU*Ezg9r0 z)9FY`qpTeH<hIh^mcUnO)!o?1cZp|!<iX!kBYbN_;*IOjTTuHzCE(`b%E`@r5f)Yp z48ePEmAakw+S>ef>P+{PdrkfEb{iC>oAKtA4r7g;1<zfmYJf-&>aQqR-3Z*xDlXpK zocf{|K}RMBmH7j7?fC<2lIPC%Gp48Sd-^>HqGm)QMDR-w_T4upKf@wz^)8$Qy5tHi zFPH-F=FURrMCHQ?xH<Sg?`3L18;TsZ<9!sO;gwQUU9zal`?50ErVujevxCle#yz9( z5R6Z^6M%Jm{P>Y0#iwTxQ)~=`6c-nlxtbqIf;*zFG-=;(Fc2N`fx89Xzt^GBYeopF zDl1#V@WayuVsQ$SBhf`8+6BOZirMCQa`G!zuUh^{>MOI>&LEhR_aQ}0s)jx3eGg*_ z6&^a#%r!g&f-W@p8qugj<u1!>kQ9ZgFM)O&%p_~GIb@k~`_3JAKqaEjs1b;OpHZm3 z!_%V;I3!z8;x+4-ZVM22`N?&AvYp{kgW%^6wWj{y$HVp7oer@9-P2hf1fn=EJ)Jot z)P#`Sd<;k@1BjQ$$H(65RSO>VN6D><qV5U!(Q$DULOFGVnbl^o%b{!3_;$B_MXNrC z7_Exw+_`fK8r>KG>&eeg03h1BIw26a8uIc%-8TY!qfjR~`T6Y~9pj+KH9W>bYd;yG zSO}TP#Cj4jX4(GS>S{4@ac{U;SlBF5pxS?j2T(P(j(472Y0C-3Gr(^O3AhME!=;Zg z-zw3q8UV^G(rK7-pyB=A-#D)>(G4||rS%*_CV-ilS<H3O#FfkBJgd?~ZeHFyT3AMV zryJKvBq_$H18hfrHM958zt%CfQy&u`CKsFb_;5XN2?X(CNsg3tY8)7GguPM}0wIFA zBP*xKssvBqv6F2V+5b%^S2Uqxb(If9A{xl3aPa5_GDHv!9RTyfcro*vKJ19w+<?~x z>0TkYw|uWldVTo+ptfhb&9}e0z;lOA+E0Q)9bInVhc{ww+!X4>zR{r92ate{y}$W| zME#9On!zLBmHGMku=0YYFL-Q>C&$OTfs~^mA-an`H$sX|%+(6CP)|=!1xn-t^tB=a zgpS#X5QvL=pk+FYR9u#nlw@LJ0tr`ITAGQ;v^`NES={5I9G$qk-Pacv*x1;hhqZNd z)WIT+kNo63*Lt*3U+;V5UO6&WaIX@F(Wlt@=lh;|;7oOHD|eWhpsLYcvqD|2Jv%*` zYc{HJw?EjPJK9?Vs^zyo^$b{xT4Z3dh|_&oHR##k>guYX@C|?@NL>pbI;Ornb8&VC z;q<5@SsWB`{Q;sUq<ONqu8Uot7nu<V8yh+eCSX}cxB?#Qqfl#MJ+j|Q!es)ePyuBL z08~O-9~>?y2+1U`rPbpx;maZI2=fchcV4c{enbd#6`1Hy&4J4I_`})mo0&Z&1s=V1 z#$G>K>$xN5woE}wI|2eObV;VBP`<kCOMP&8W`IW0(?K?Rr;A?IXx6%N>28TU_i_LR zmOh*vJ^`G;2sirmYudvf^RN3qeckg;U}XIs<+#mz4)Ol}5&qp5u1-!)E(;y;FIOk( zC+3{T0D!<ijsvMFbNn25PA&wBl8Q&?Tglf^QE24S*eGY+GGOdK28|zhkxBxuvWk$y zC}+^4nQ&pBy3zc*r7+Dw&w>FP0E`ID1oWGmD-;(mg8ah9!9ht$siFdA2N9FJmsj<% z#JO|lU`+{6`0PNh%w%(!Z-4&c1+%RFxfz&X5$DNF`|5{B!48RKzZK(<_3qu6OQ+=1 zr%yp<Tb!t`FWYS4NC8d+3_5O|SFboVKi>|9R?D)IG#!-T(2JK3*K0QV^Y3aeV6TD@ z488>m3(Hf|Td#$D0e$lTg)w@#)B-#M<lON>LviaC;F)_3SR|`3b)c#A#DE%9P+fh9 zc7%?8WZilVs_y$K?VvRDs%*~5`LJwkA52W2Tl+dOkuwN<lp5!$%ax<sa|y;bD|fcH z0c%≧-*|l9V*WO?&YEEzBvN4R}0SxK0P#7E9~!jMkm2W;eN^?8j}l2tORB1N@nx zNHQk|O7FvDKBCykn=}Z-rOp|0>KwPOIcF|Pc2?H!vEo2dGHYukq@>1=atdJ*F0=u+ zmfrCby{oMJ{Mxpbay4Dn$B%l|-oSKvdvzk+0LvIIsC;4lQ&7}kuHU~uExu7ZbHcaO zn1D*D&CP8!OB-3cD5u0i|CAJX_k{o1r)IJ7$UtlKa(8_5R?^#HyjJw`<sUU4_#a7n z?GD0}i09FrwGId(?IB?T>E&KEj8FwMjojSa#l<uEXppCujHrTe;d#mwXc!<csHQ>k z$tx^GbHCa%Ho=SdOffMrL8KVR-zHOKpTP7n_Ffb8RK9(?56p^;^mH()GTFdbgW7FS z`{+Zh8i0eEjk>&F<t7xvC=3xzljx34H$rxw8x4_8Gv7YJa^0E#Ar4as$}CXW43MLt zI2Y-c+d#twk3cR2{5v7*9&@NB!eg$naqNtqvt)wmQclxNFcV#1ya1p8)dQUn7RTjF zm);1NDZpgPbOVA}{Ag>MOZ)xDvGuU9Fc3*Q69qCrc7ONoU7Gg*x-tjYAK=+fsXuu9 zDLrQ#)9wNElF|o1yudh|Tk?iAd$_m8qyG6kHT6Md{fRxC?5br)es(r#?)h0F;n7V{ zIL;0S>is|oea8mN6Y%xv$%a2)(N7p1fNW>m3H3lZ)5}<Scx=H(A(1{VHhM_PbV2hv z8wDm87Z+G)3JI8w$mR!^n(LejvZK=8!rE`~rnHYj<TqK`IX^JTT{AqQb6;w|g+#f+ zY-kT<r9h;-4!MjcV+=ipeVWWwNz`j=JjTuj@fjtH$xkl&jg#SZ5(#DiJG^dsLrZ`I zlMQhTJ}MU>a$mHy^ZQH>os<+J5Q&F!ogI{&FD@HS;yBR5;9!x(>^dKQyMn_%-={wy zcB^I(5%})-*FsX#+41M`xD>&9goBD@$D6w!?tcYP;O0LM@@T%^hw0uN?d5?3aOHI2 zC(BNTF@h%zU=kyhUQsE96K9QLgv3-h{kP>Tp0-10?PzTkbDRt~bi*egC@m=guPDvi zl#~j(oz)k9k^Lzryold&D1Kl#)S}Mju)M>0aZjHj@nkOaAj-BG1X?<t1h}mY|9V0q z#a~UaPeRTbpzoA}bp8BQ*c1qU{O<{Wf9M`CIY1vHk=i%;`To}28BnE4DCsI72`MRk z2U^kD3EzMsp$Z7(DQR;A{k;$OZzwA(gXIgV3xHgONDe+89`tYh{QP`;j?we9)KdLc z5pR%)&%UFYS_hnI0tzBpH}fGl9T4?DJq7{<$T<PZkB=hMFT*;Y11PZR85xYw%3vA) zoOulVpuMGqi-#xn?H;@rs^Th4P?)&A4hH)=Pe@_7o^;<p1Tr_(p9W~)er_5~M*PbH zED+BJ;d}l+b*626FbXN<+LOhFK^6zwSUHwmE(D4@2*3Hp_2YBSz;8H#l;Hw8+Xd#& z#V8056)suGw%-m=0GJ(eA(X~Gnm_aSph<aEfu>Ui9TJYyDScK;$}B9bdm;w5FNItf zqqNc83XlrHec=)ks(`mhwFx~Omsqlf`x~uxvrXYE$aH(?)Hr^dwu6LeYSs|{rGle; z;#1RvQs1XOd#gi1K|#RYDKB2UsZs|fC-f?Ic6KAM==GWB3ZO^B$lg@h+nCsJu5ze5 zn1}a*S*Wc4(d08GQ`7F!Pe}$rw`Cpc7I4wLe=V~G0guaS)#c;l40-XQ8bq+pWO0rH zez?KxY)*?X?b3)&BsC?aux)?-^71nHUr;pAMl3t~Jh(^O-V}0~Sy^qb9zjE8P+xhB z%wZU~kF_a4NkYmnzJno~caGp<Tzq`N-BN|+n2Tss;0|Kq1Q09`8RBfwVSxYF?x!P_ z3p|IfZa>{soQY`)x)r$`TD0LdJ^^}+uC^-$m9u_p0FRU<yRQhY?Dv8v`|7Htf`S4* zQ<4yrp`Yp?(}2Bs`>;soyG7f}mXmEDjcDSv;-jA}8;GR)VJ61Vz{wDc@$`)|wu<eE zXG>dKXlN+fuD$Sdch{9Es99bD?HrHaQdOmpbKMv>tlE5e&*5OZjW1p$n2<WXb_CQK zU@Cy?o4JjBp-h9t2z^9Dss((_yxP16^eNzW71oZFSg0^Hfo=7!2IizKnCZ||(+w<v z1-VIG?uCxnkTyGso2a<YJ5kYH=nuFOs{H=`qYZz<dOt(Y0d%um>iE|z(F$EvCahTo zb@T-QD~m7k`_~oy%N@q_J#~MGNuj%^_IUhw^y=}!4nvL(ZZ{f!rChXuvSVp#bU`mr z(VMj<j}ct_=g*&`74P5mnFI!byEBo}UYDFey|&=7F_OG;WgAfG?|oe`#J3BR+%PqY zj6T6K^uDyK)Q3xjNA8FWWXTVqX6su7QyEmcpFKU9p*e1q;Jkp$I2QwJ3g*C_xjcY7 z(4q2jbGgM1rK8Q@N$3yY$)rg63fT>6+`04q(#ZQ;uLFJbmFNVBd)C|;B_26~%+(Wb zz}-T!<p>UT*M$pR^eptISW^sa)?C21jNROR5%AScp72$U&>!!BjJ^jwc6-cY+%v1T z_81zo_QCT1Xtf|9t-@-)U6}JA89_)Z)Sh7n<&5Cen(2cl?JU~&INtmM6R9<P3c3zA zV+|~6fFv7pKxuzdg%Kv6AM-D!j$~Kfvv2w6G&Amhb^;3<80~!8GX}K0?CE&`RbRJ2 zU(kNIti8P*l~ND$7%pc)h3`|`n>T288=CDk>z-Lqh3_0J1Mt(UeY6$Fr48Z$V0FN! zmhFk%&>DMsv<}#M^UntW1}K1D4_YK>G140V6+mIRY*<|e#5~1kTUp~CQVw^7<2x1( zF$D!hnN@c>z*t%#JKRa?2knVul$2Qp(@sM)CUUL^pT}p1{E^~Sq;er(dUPfUuJq{| z$7gK-MqM7Md<X?S(0?1&)EYcV%KH5q;GdJGgIx@jK+`C0=By9cM={(nnyy1%i#vTC zA1`RtmHLd)PtOlqa0NLJbLXv~ZU2i4Jn&GvfY~P)`-zH)9im-t_XHMxGQkR|{TDA@ z3|H9m5bfVmRwmOQMm0w=rX(a(0<%Xbyae+<+n-5B@s0M>HMjMhj-0452M<5L)29TK z<mBXDyNgp!rp{5IA3|Y_jf?9=b6=yA@6jwA>Tgw5RCYcF=&y*$9;Tcfq(C8}xNrfi zh0jOz`oAwOtQwBnz5V>I7gq#hh^&J(GLj-<;tT+EUwb2cB5<0>=S<~wUeM*{?lwQU zs~8KK^);(5nL2M!K|q}Vk@+Ajva4wxPm2;l8W1P}UIW~3Gu(wkCL&1v?%lfpyVt=w zg+kx~Qypw5=rer!W#1Q_hcNI;h=DJ8Ko*9yan6~DK|(}ayaqa-0ww-FWk*5)xhOe< zLO9JYK=`0v7lU#DGztm<NHv88EDT9N_mx#u(Lmn7U=-x!k3dRca@mi5bOMhUA|UxY zAI9kyBj~vwYfRGN^#;@74MFGMpL{~H{L79oTpJVtkn5CN=fA-NfLb{}Kd+W_%^H{* zP?l3hH6!^DM<Zl!lnX1?cq-+_)tcC=?^qsCkc25dEN`1jx@xKRTFCyUipr~QhG3IJ zav2`tizs=kC%q_eyx`dZ=lKB*exrJY7gPuwQ$Ix%m6`)5rd$v*=N3p7q<|G07Xur( zzDLMJ#YsjIOQ$k3+ezVFYkY2GXa6EJ^eO3K$DMP%!4sv}yYG&D?Qxi;&>8_#kRD(I zSRr-$(*&L^2RjQ;fR;ZDgZ_w*j}QD3APns|W}{OkQ>3{fiXxLmg+Y%Hg%H~KIu7DE zBq-ul{=|o<B)wdLq`AVijzRHU>&qK}#=<S_*c!(L#u2PoW$?hbxQ41+EKN<*NbdvD zf-D^2gm=If#{xo92Gv6><d=E8ZK$X4`P;nF8<0gh^fZCT{aVoWWkN!h!C;PdmgQT| zU~HuzVveh*_StVr9CRLGPl6%_U&%GLNS8-6i1-9Zn_ME6L4Iq=^8O}^`EBL}b%P#p zeIqt*zz^>a7_k{6H2fqA3Yg2?*mzXI=P#JZ2|0v?70=ZK%33`^63VzE+uIAnqYVxa z^ze?L*C%Q!0hfn93XtP6;F04pdSaVRvzXvHhp;MQGAKpKBszW;G`Znkt@_$23XSJ+ zagrD?R7w>?%t2ylioYiFU37MV7vUXyo%PvO6nsFbdlz>wY?mh_aE2yAkxz(}`^^Ky zy%L8=p&3*f3ppz(d6Qzpw@Wn4An4F{hY~G@t>TJ2HngP2(McyF?>e7#zCrWSFcls$ z5{b8{P^}cZk1O)Rwf7#g{1woIm}M~!Qy*Z{bsWbd{vIzCORNavS%x^R+84N*;zU!b z0FzcH5kmVY84Zzp2#qT{iAvu<E-I77#7JMD2~dB3GDh?77mxWDmM{X8`7e=IC<Y?0 zfykA8o{4-<ArOfv>x0zbD7{UA9(>S{tYlVL5VuqX*<;YdU>_BrKQBszC?>5gHC16% zlDRO=5)eSfY%0yFl<Lr=h>*Q<{m%e_uCpxTgG?p(a-H?><xY}pkp)B$l0>5uYBKa8 zkqB4$cua5L73I^yMHoSWn)S&)M3fdoka+tFw+K*~jm9nfe{Woh|CmfhNdQHD2QF5E zj1eOUgNghlT&!Q<J}%0xk?zlsMx!2|p`<WzOC5v%+&8PzBuBOhMi6x$aXuXMn84*X zg8zl)&Jh9w=!hJDB7Fc}P&M=Yzls^vDQ?3fQ!3Jyzn6du!(f7`BVSBP&iW=|DiYED z1S7f_pPZF0Jc%X%?`gKp-_HfP2pp5a&ki#GZj&y2nIZsBQ}FY#Qj{a7m<uA2u8*QU z42j2)enu0}@-&_A-+Usz0cUWo*40K2G`yGY{RW1~1=V$|pUkq2ce6t=^oTD|s&Wo5 zVkRb!tV#LoZ$c>#BJ~(^OX&XknAj=+X~HBXbX`GSzAKvOQxwX!9E31nftwIofg0Nr z1C`J$GzhgN$q;a3>B@2NJ}%5U!@R%!?iy(A-=mlm63$hpogz&{bqx5KhEcYH4x=9v zjJ&wm*%ff3V`A>RI+0%DO~o)V)G`)|r)qzKyvw7-f@n}fi;FOY6(?)N5qSisF*MUG zAUg(~IAIVWMpEUTD0hX@bB`xa8noJ@>K?H;riqx9Dl(%~`5i6=S8_$8u0O4{BJZu( zf8OAZ>x*S9FOT|)a-E*QWO(^S<U7hUWhnU#mvU6GG`A{_W^6m*1QRA_KvI|W{*jy> z@+YCP4|>FkuhO9G+d36(+g!|(AGWGDmCa#0NfZ(XO~GrT+;_z{Uxn{m#oLU~NX4?f z?wF<`!n=x+ZLHXja8M4q;d?OZYG=MeU>E3wUK7A)zcIB^HF^{L)L9~IQiN%EH}B-= zH=kj(PL(+{vYv1#(pgzqw3?jRH?T52Jy|bEaa_&5s=Y1nilp8J*DM-k>jq#8bTjUR z?;cmLUJd6YGr1+Nz_Y!dxDT=h1zyP=K*jW8uG!u1WKjD?4*WgAC#0OWlx?s6n>z@} zu9+oHKTNiiy60q!=$f$_tjyc^Y!vZ)`=@0QuDF+>2`)LST}bP-ve}S^;9%ht>li~e z^F&&51twX{Y=S4_q*R`|rj%E3{@&9d{wGndba8U8Evv*#doA7NqAaFA%>g0(b%>tn zhOn>+0jts=4pEeB+E=nEjy3DDo7mw)U&;Jfl^TXbT)sG#-3%u9w|<r0WSOdsQ%)3z zE<c006pb=HzdM=Tc$fN)Y+P?hgk2CdfLcVy=VIP;R+F323Y3U0jPuL=H|rGA-UsjS z=HD8B7Oy)#nRWay5x0VN_c|@BU7+jk`Lh0oLaUg3!{mDPFMrqGAnt;W2#zK>KLsB7 zOU24C(l_!`CJcrn5z@$yZ?UIj1B2*ADyz+D9Az43XXQew#Y$e0{3($Av#UQ@CtsJ? zzGheE`|}L(^oWMYvd<fi$b`W4+IP@wU3W)bb25)Gw{Z%>!6Prm<VZe4Bzqc^uT9Q` z{4MnS!p$i=h_UatVj9z$DYnR<^forGj%r_jCP>QMO2@V88PXjc&OfP3gt0T_f%{lP z`&5A$u?9V+z3KCbZ2$&cf6>1}mKabV-is)8k*Ti;`m_9q@=7{684vR@t`_UoSDZ0s zVFW7DvYOB}?<QlsoGSLSN14FL<Gx8jTrIVZKzAA_q>XLv3#<(lb_p!cBfH3EP^QXv z=#kbL+GLXyFX`!8G?aoUpyumE(PONX7@Dz?N(`eOlZJ*&Hen4ue#3Hkq=eFRDCSEL zR9#L1Z4wiXiz!>r{@!Z8*{j@pGzH4>M1x_j2KO@AOOymmC0Uj9VurL|^>$k9X<_09 zQZWCZ@5&A$6@zlG8|H<4^TmdR1>M7(E(@hH4%1^~MU!~)(4GFRV*w0S9!NSh25MzV zgk>rvEiO$K5u<B@zole~tH52ejpVkf^K1Av#8a9q8w6WQWo)S451f9%Bii4*}zd zdB6217NV5j*o-xm5462C)q!~82A^3{Wj73QbgvA|X~eL)|NeP1`ZD0b3Md2%`@JKT zL8$)B_&4-C0wvh*m&jxq2v4}|SB^u3^MjCh+0c?mCDQ5a;QQXE`?xZE!GC*&K`2pg z1eZ5rvE$=}^q*m;Wz`^n-bO0$qg+s?fvy|d6KoKO)Pj-=p+ie^^HKK^dm9Efu<{_s z|A-HAwzi-H{o-X&4Ss8jVESqoT`Y3M@f~n>2S|gtxi_oPv<L)`+U-^z-h{R@tc1(= z0Q@X`@`17em7%Xbm7iqU6*0y1%j#KP<MWV^R2EvV51xUe0LMU%0B#}zo+KOrj9du_ zVF9d60{qH&x``v$$q#Yij~_+mVj%bS?0qpm4qUt=zF7z>tal;xD6}T<2bn<}5yS;Z zc!Rj`1e?eUQmP7(3}Zkc#Zs7{YJu@Gd+sUz6x9`YPNaUOc+ol!yAqO%GC@-0;^b6< z__e!Ob93_qDDZM2fTssPrZdSf<)7|X$sw@uw;~y}DrG&~)uKS2mkR-@*y~b4VP^Dc zo&ux?A^cWn@q}9QD<;3jVjgN99{1{KsPF2a0Fyj$R>_wfY;1T;#0(PI^UCW$LrY4o zFa@>E(Ez1|)KF60Lp{O*XvL_eu_5$SS$%^-YcN3{m)^gYc&S3R2>~lNsq6Re-v_7) zF-Jep7r+E81k?#fS9y79%VA*mWlYTUhs^A3CHrnNH9#!$WaD|IY0rPZ8f$^$fd}xE z6wvGLfpO)?+SwFHE?PpucXV{x--uon7WM!l05&QRzwI-}?Q}s6Z7hCTxy-wNJJy;6 zaS0gOav>nr!fnS`xVq9W4P{gg&pD&x(m+~39)_pZQ=Z9>>vj#{g8!q_@+x4Q5|=<o z`4o_*mzDLJRk;$~0<o@4%GBIE^BVOm^qpUvC_*$`c))}k{qM%_mD{lSuqiE7;*XTu zQZ~5UG@b+pDUg?*@GGSg;-!qmxl%YP`1c;L)d7TV*ddT>z<YAX6s&nf=UoGXOF@gH zRi(UaK?0dHuQsL;s%oceb`3r-20*@~?FNfMx(DT}jR3SA$dCO5!OZkaa0>x&H7SeM zIG9j!M$V_lo{^(mL3$<T%CfSuc6N54PFy#96oe00@9E-Ss5^9^Z^zW6tu9#(ES^o} zW!%e`AiAA_viq>^;Qh$jTQN5q2&>c%!^{O|eHcPF_a1(_tzQCB2O$0C=H_MAKiNe^ zt1>gqfn@d|S|I`5=k6=q9<h(x;5?g>hgZFhMq}nX$XB2{f>^AcEG8(7{?f&bj*3F3 z9>K#nIb|FKDd)kDB;}K_5@4m0kkq{<LnHUB6`*!Q`YvvCI~mgV#%4Gx1z4tuBwEIY ztV(<Ci2e(%YzmjN#lee(CrrLi!mWn5Lz$$^{1~L@DMW7-!tMz^(Y#Dx&=?vF+Vj_w zs6IjB;Q$ydCgQ%9h=oU9@oiHPvG*lFDG`B3zK4F4x<N`*;YhsK=?>>iymegpiP68u zVnxtqym$hxQZdV65rznc?-2ThzdNH$#jnX=Iua)_nF1zVh3eH{jT_C6`QMjW&@Zzm zF_F1LOFvi6fq0fdBTog@@y`pFxMhMU;X-821QA^c;rzfS5C|Dsa@PFFjZp+D<EFe` z6v~vq)f6ir^@{vHeD4$%fJCq<TxY(7c8U;P!ALxw3=DEaZ8zcbE<n(KKYl6n;UHoX zC!SUAIr?=1T7*x!mppXaf7Wt;li)SPB;&wORNUXgun$M+7G!4+f>00p7SP*UKzF&V zqXP+q3CAx);WUEPCwn6ts)=3cHwdodW7|&N6GUXoM-s`gq_fwG_XAUeg5?VV<g>i5 z-@Zxhc3nrOTH5CD)j#h-&|XVN$J~|6ZjQqZb%7a?ote#_Bkr~^`_p%yd=}U{1IXmC zJn@-8GKV$v3uyk{avu*bFE2a$w>5VVhfbi1fLkdA8!OO8t>kjFA_F>*{zY4kUeq%I zpNyOpfeb`a-&B(td&VU@zpx;^*?=V%0{Swqei<ih&^bGVMRE#9HuC+|2Wkjdr06i3 zDQ9NHn_88p-~G9zatL1QlOlRGdS9_Bjfoz(GS=}}`<?EjKxXF%#Gt~fQus`e!Sz2` zF=iBToCL!CB0QYPcgciH=P@Fc`~tfi%jgV>zOlvlrra!tebj0hB6Ykz?^dol`e>bY zQpFU7jo1MQ4Ntj;-&ntcasgi^cLH3th-eVk(uU=6sbW#!cSS?KW^b|k%bNR<!4!nC z)<7poR5=IFTQF?(>nUua0q1!ac9qfUVZ$%2EX)JxAg)WweD&&1X{XfHV)UlNuBPwE zgJ;smrm$;BE@X9e6?9{2J#sy)1Tst+6C0b4iP(o%_VvMfRYc=y+$~Uo)n5z!7;J<O z%Mi_2?o{n`hzr{dqJq$}OXfrYOrC&O)G4T^q#!SdI?pP72_}O5N<V-8w5^e$g-<;& zd4c2#0wI35@}V)LgFr-r_%=LSoD3C66d)$rV^D0MzeV$QK|EKm`VxNv&1Z{i2-2XW zB%04(uXTkB;FW+31S;$9K@m_MYX~-&@{+(udqcC+3^|Z*j<r|P8g--)q^#UppI}fQ z78=>X%ZbLYQINj|+`8GhxeK88JB*63u*_79I9#okhu5(Qv}w&jc!TIX2rjw59z)Mo zR#zvv5#6f?N+C#;03>!G6T^3}ViojHFKALc+}vT@aP9!=pdw0dhyy~BzkdHK9~7zE z3#|~n^Ib^xSpPT^0m%wjEl<-PjYA2Q_C4H%#7R8}{KkF<bJC|<5Ki!dpqw>me8F)z zkWXQ4^k4(EQ2EZCeh`43l7ayPcU-&h)*Bm46u6efMXSmYU+^YjnjUXO`X56Id2YxD zy-Lo0pPd>%y16)&P=9P8EBhJb8=x=Tm#cgZw&9b!Mz!dMAY?zh@0lO_tUnkZs{sS0 zq?768vb`iVI&eP$Pzof%Aj7^_pVT%7(qj@tEL2rhAK}lZK`jU51e-sg4BX*8n_)al zjE%ht&MRo&(j*?+ycf82eEvK1jO#qsF|o1IN2{fv?*lEX-|bPM<TI*uUD5(r0WAVr z543m?(F$RRE?(9Tsxn~!`|l|!0Hj?#zY+V&x!GBzGnm+p>}G{uBf`TW<o6J|6_KZ# zAhbvJAgj@jADXve8w*p@=O;Ksoaf<ji1IULK7^igUT)O&=Pib|cT<tDvV~Gr;W<OS z--SqkK5jQ`h)X$hs~J0GJni&9y*f7mfuBrTxsZ^MvtxFy%Bmms4lb`prfLh!gSYk8 zE4JV8j$I`F7B*c6lBYWEpPeLgS|wo-g=RHq(RHCqf6h&1wBP+`0w?!w>z6;DzEkt> z)4yLC+Auh?KRJ&sW~UoxryDQ@q|RQ$w4UGoj@E~RqBt(ZC=YZ|`K6(!)MG-GDA<+Q z4NVlX+P3$Yz?lGvVCqtgR^FY0pdzH_RO2}&d6=4nfA1Lz11vR;TS=@zA>rZnu#dHE zZrh0CO3!zJBtTOUVPWX#8C*MBq~+^uYdbGTwSPSnh9vkZyX?&^0mx3lVhW~6g$;@W zj38)3Jm4aq(J^>SD*qczP~Ve)k6}^AqWodyG6h-BWX$Gdy&VQe6J$!zOkul#KNJ<P z<A1KXqq{o992R?^I#7K}MBXhjlFaZc)c6G2cjbhiH@p!N((ol00@fcSDo$aQ30GUe zDHN`-%L1%?1W9L5NUqzT=S`9a{ZktD0c5Da;Y@hH85CSG`$ovr1l8B!dma`zqEx{@ z=64{$0sD?J-@OZmNK-=qhE!4QpHbhWB!uIhQolq2J_0ek$e`*9*t4+8yo*d$eb5~< z8)^(%^n`t&aSj~p?1yhidZwg>A<bo?4>cL0e>%7VpzEMx`5+|+$6@r7GuhZMGs|C= z-o!^_Uq`xe?wYs9UxO(whda#z5Ay;H6$>-70Waki87%J?Vaie9n`MIm$;T%=+Xr_- zN@zwt3;R#L)>}SBN2|)IT-bg<I0J3Ez{Un&*sKD4<+$kVkS}FN79u#|Q+%}TdG8hY zN$C)nsM~MboiI<(y#dTQASHNAYTz`%W`%u&X9wt>-rkak9D?N!A?$tQX3IQQxKTn& z)j$K-V#QQM0B4-+?!d{LYJP!`IiGtg2=LC!Ms(ptaH}r@;DNW>HwqIwZ_l=XbE;YI zCokUw`(WgB8T6=J4iN!2T>-B^4h1$Ar*g?UUl#I-eE>I--K6UfB(qO$4s({d?9IM1 zdVuFC>W~Km^{0Y%Mdyw(SZEQ;XqXV}E~Q60M265wZ<M$C?}qaJreA0rlHp5w6P=$! zSX~bciti@GLr7^#GB*L>y5wbvXdvNM4kG_AqOveh$3l#M48~3a-4X6g2$(V5k0?Z{ zJQiysgdFan<T3w)mVA9iuo2X^nbE&T-y<CHoWgZX1Ph8x0q__u6M2A{CI)jY{GOoB z6U$K~S2hS#Wg$6ZA%rDJgQovI#UKHk;tfdQRF9E(BTVvu`KDP2<^FR8gJkHJ1K{On zNW3FvdCX#gToI}l041lrMG+$z=}(;C9DIi*7=ss12KZ?J^C^TNO{AL?(b$t%2EM1& zvEs)845@bbUM-oR0Xs7{4Eql<C06Ac=KN0<K*pY+K`6V+gqT%H1PhB9Ly!IoqbYm0 z0wqcnHiE<^B<O;n0(KtcUq&2i3Ob(ANj%yFA91`5Y6&!<pQLeQX^JNV4e9&Dgt1QY zf#}WdVboWFS7g?JdqT@^(!f(xJMCO`EMWuTT}T9uw=Hz0NJFkJih`m%c9`_Z3;!N% zQaE)4!xzS!<5WH%)KL8)lk*8$55PDEeiIqkT?|~b68twvznx8y_-F4-!9I|X&`@pO zC4e*E@k2>jV3_C%-#+FVl9mNOB=pZNO7N2OaJ!+_+z7o$M00Hsyk}bQI)I=ZOH2Hv z!gS|uJVKuzcZ=+S#SV`(Y>oo+1PryflMe8#frLkrPD8~IDzxG!24%Sz`Dw-s`HNxK zYzKK)PY<GCL#0{G&Pz9Gmg?PdA&1Y$H}J`hpWJv6Locu}{x;EVMtG~yDp-?vOf<p{ zs~;q|xRi07pf`%8Orb3;9-i}Z9}NnjB|#8;U}%fTwrgsb4uMO}&6)W6$H@O8z+7ko ze9HJ15*aUF3f*rCf!%i12894~!XZ`;@jWK)%Z=g6%ovI1x5(aG?g)K{?RHG^fUSH_ z2LJ(ju0mQc?ngKzeF5IU?!;tpTp_&y4%BhI>&=@ln$e>2?WYPN-Q;);c5-*PZlKj? zdP216HN+|l(?T0RGzLgNY-cvW)r9)Y)C3PjvOnQYM8w|jJxQ-TL*9WmqApO2_kRda z09IKltXbbSX5CJ=fN@S#<jiB4HjAq5Tvh9c6H<<X1X)3Te%wYsbjq7ikmb7|2lUY^ zpU?36PoM|4iqIR}peX^9oQJ07#;&A?2P=(QgY2`IT@1R9#e1-@oC(&I-p;$zs2dpP zS6B?2#`KMqlJL{uUW%O?d$VgWs6tGKiYZ>Ren)RXXal2*9yUb5GePhFC^9xS;yp0{ z-dx>J$<51qQ4YNUxGRR4ld1jDHfwZ{5@L#Sx>fOJ7Mhvc`CWDgH1&*#7PhICKiazQ zY3k&(m6hU014z+skl%9(9#NL+tL?9p#!4PA+5LYl-;T7r_df~r7mY`ca1}o__YEN$ z`7TWu+S-8JE;*D*)DsD*aU1AcAZ2h}zPvV3e+F!5+-K)j<%lHYWFYw9Sq_Z<;aGJ! zfX2#kuRPNGXQwCH?^RpAf42g8%Guc&mJ6gZ-*v}A8ZCEi+F=mGj2R>7`~~9tmQ%bd zTwF^K!bMYZ_)`rI4uz!5kRyRCT0O++P9$={#D-vHtXPc&>`+DjAqcC0GHE&1fX&q0 z#})#t%&chQ{DXs{QGaOpB(w~%$v9PDn%Nrb6jcqVaD09S^|+yBpdS%XM|c=`6J-3= ziBKYB1VI_bVg&cO3K>w{D0#cEQz@reR-uq)L$xB6$UrYCs$F!!rlOwB9C&|vjuerz z$ImI%TGakmGS2>1E{MQvXd*6VDa^zun;fP=Bxx8nyazF{EJKl2CYf-pYVY|!BM(<{ z7;(&R(J6=)w!J<)mf^b2`s)e;&kgg<V<9EIu%-FFGy(E}cAu?obNZ!X$bXSulVe4g ze%oJsj6TGt!2pJj3bc+Q|Ci|L7iYNI+Z%A+@%xvY#jn_|x3#Zl2~AQsR|;;Cb-;zQ zy^?&ZY)Mg?KrTa?>0s+(sTg_lpWNJUwoY^J@$+VkdsilOru;ZV|2a@WF{2r`B9L}6 zQZJw1ca(sOxE~gVTz#w=8Gs4FA=A$!gNS~M1Quat=D-NM#iwxPF}L}&;mV8Y+P*1n zd`Lno;6h5MTB|T*e&7s6Ha#9WKc*--|J8_Fsk|UFi_9uD*xC6?pzTG_Px4!HuQPoT zm?1I2-b>19UI>c+dw>Sytj(AL2Y<sAk#)qHQdGdJt|FqK^UXA*oDiwoNi(L!74-gf zH?L{q{&g@L8yhpzqW1F7mIkopnlPGm>@TqVH4sc3c5Sh|rbIB|Nh0$bW}59p&S5S) zO(K{YM3nSi`_AubX1ot(iV47O{TvbTJksym9@_r{y|<Vql5{C?hdC8vEu!w9C)htb zM%7Y<p;7U{Ngj~~-V^=c-iuW+F214n%H(R_bh(&<Odb(5g3w(oVVS~r8qO5scuA4i zefLYJ(4UYz$nGo*rAqkQf~%p)2IBt=lOPxI5?|(<jfI2nY!wMu8bQ<$ckF*7mE<@j zWcOq>8*>EP6fU1GfL&RSQoO(qp#I|bU~n{x@x;#*Dk4H+it*hw!+UiC{`wCh<eKF3 zO~iP5NH9l)HaNLNJXvbva-w}niowZQeG;*n3V+h0G4i5fa(4b9+ExSQ<d~u$2A6A( zXNL5T31s*5fs&+W<xQ_kI6B*j_MwJKx;kF`a6lPDi4L`02{|_R3k`K}2~2g-&n}LQ zZa(?MTzl;#5%cf3uLe(K;W5tTgp5v_`y2*q)wiH+1PG`y*r>z?Dw!(!GzH8=qgLkK zYe*QSe9&y5$<SlW!qrJbxG+mV&whs8_muKw!!xU!pi`0J^`rot1b+Ao{@Ou7Zf?v= z2#ZkPV{P!ljl0v-Y_5ndgUsQ)0Xg&{j;ZhkjTy2;0@atgg1e*U*-q9&j#pTEbYxql zgHk%xKhMMlwjjF@Xiv}T$*v_J3cgRfTCi`Ol$nj~>*6$`V#Zf$hniV*ZK=&t)sh9P zD-gLvlGEKoMP#ikCCyK+-Z1DYbYl+t3rJlqy`}D{B{?M(@yQM98}(O(LkiAG^gsE# z@ZG;zDUIZ=UCMsI`tCw!s?DAmPaPkUyIB48UpveH+I2Cd<P=vE%9X_$taE$i!O2u| zAt)LY2JCaV{?(h1?J5R!-~**&d4%XC3f++NIAln7#tcU{fQ(w850?TPtV3^vgK#&_ zS=sCj?KEog$7TbMt&s<Y!A?=K+ft?CqS`U2uizCx=zOjQw!r*klWml+3I<U2nN{YG zi%J0-h+Au-quWayuD7pZH7sX0nQ%j%;}#V$0Lyr*hflP-5{MeAU9AJcQptn-(4z)L z9<8GBQj5FiyPClc#HFPr1qyuGG+Nw%xy1{|e<#)nIzS3B$9R?58VEou#No=q6$adh zJ~07k>kk2T*r%cageVz+af96cIDre)g*Q)EL1x{}{rLAFQzE+-SjG6hN2>pR)_@Mk zt|)l!DvNC6^URH@-VTJSN^YvvwIIlgPigeFfwcVF=EdJ<5TW3P-w-6HBZ%JT0>)a^ zVjH%J+^+E#a<IU!En6Yj<@=C3aHOTgQJetJpj{4<e~W?%{Z7oZ!jOMIW6NXm11dDV z47L=mjXi>0<_3}gT+p+|040P1-qNPx*F248S>gZ00PYUv(*IrLlhRbAc&K)8{6j$n zm6nAbBh;j*2kPjiJbaHm6&Z=1!%*o+;MSNdlve&#ut{3M%K=g8F^}It)<9pNo&?gf zouiU6O7No?z?a4E4ct%v-sk2sjA(?b`Rdn!zlV~c$AzCik4hGwCuh|VhL(vUV>G>r zPEf%20k2r4{)Iej$e1yZ4Xj(5Q0J;&2vs8j;=eP+cu@t==uj5(fU_slMUI!MrbAII zK+c*<JvM|`Hh<e;OZ|7Plj1_7l2)Z+gpCtvJdl#XxUb5JNXfo9iG&!4>{Mkb1}7Qg z6e+6`N>2-&bRp*G!+H?$pZg`Ix`-$8MifWN>)$@2UD+RmB6RTxx~DwWV2PSBi$;UP zt4U({C$Ta%6p*3E^XJOZKfk&nuRm9dDZ|6VFoV8pXufiR-;^4@<x?@Dm(XJkATt$U zD?#bP%}JtpPlsc7BWbHUeJdJ0Xn+l(W@zjiu<aZv(546+5*Np-3^F&6#XxT!YLq9A zhL$BaYxZ&<mlKY+8U0KhhD#-?G(&Rw-!me02vTYwUme)}jz$J>)mZ#1A|?;$UdtrI z^$=b+V>OX$Qj{SATal%k3NP{5T4Ym52(DO38YTQ{#_5%i$)#roj<=v3z3IVT`rkG2 z-8>V7kK_7(cY&=3mf5m_l*rpF@>(reQ?o&<xQiX9co4#fM@O+i>x9T=CL07IZ5TfO zk3b|N1OVRNK%U+@{6!<jik^8W{yp_59AY|7PEJT6-hds}pqZrp`ky4G#_t`LguoSY zToN1x3-s8orl6X`X@B>q@O^D+!es*3RVMY1vmoa%kC_xP(`E))LZPq$<H3%i!HA6# zFMrC?=^n5?8`>w58h~=T>^=s9P+MDDIPW>Sn+MlJ404E&ss|Qf`?$!?Q~M~{YWTw% zZLO_Aq`V2XKuCs$hCqxJsMc_#izID1Akm0)SNt>WhW{k&AVf$jaK8yQ)B(f?#YZ86 zt_lcRM%%e(S`~_z8c*C6*`U77<`=Q_Br3(19zgC*_<x4#&|5M7hU(nvqHyAi2(o3( zSSJ~qab25R3|rVg4Wc(l6#k#et~?&9z5ky?#@L34><N`6yB1p}Zn8uYLY62(aTCf? zlSZlR$(DV&5+Z9g5p@e?$rdW5t8OZ!D5Utkr~2LJ_WbwwqvmC{bH3kmKHGb7CFwn; zoBlHsFAVew|DR#kj`rvl7}-GBdN(LtcMDoWXBYBbT>awOrpO~8lY~}ZG3S5zuc*tZ zXApcYDhjN?Ii}QOYGnHbeV@g2ferkYf7wmM;&O~P=f@Pc{^LP+_e=MJz_KB&0KP_@ z`nri|jwj}Bi6Fl>%W+txspxQhC*eV&#?$d&(cAcyFU&?KX)CTRn{#GbxBSG)ZiHYs zgnlBpq|&`50UBB;mC<^hs-w~5yEF^CZt6Q$aEqP~I&`IS376}6En|I5cyD38`6>a^ zHj{P0JTfvf*AAkgokj=;Aw2+GZj;zFwY?@_Z=-3&fYj8)Byjxc_r^0t)7u7(-JLHI zM0DchmP3akzC9cl7G_33Ty1ExpWg^5K6EB@ow|Bu%@$4HXE%YWp#{Gm@lRz>-+9DL zqUFqDo2GU#8EoC3eerSd@^aOZOd%IK*@<YYKxR-FGFNNBLODCR)?<$yiJ{<PkIHhF zPOi+VeJM)^R0V!U>(hG@Wy~VQ)$$`zdsNO6F>)RB+oSp_Nov{&{={S+H$Ral<0>4x zJ4T$BNwcCYNSR3M^fz)f{wVMp*xz3{(5_9&Je1EGVm<SN9YeEUW3kR~D{E8+d$}Y~ znVlm;r));$Y0;>mJcq?)+4vSM+;ei>_ag)oEcsChRazUw8aw%!M}hjOJd`I{K!$@c zT)8A26s=7bj-hTLp(O;fwi=lcQ(a>$VRNU+L-gkdP}}od6P{U2uGD<Y|D6}YLQ;s` zA-wgj3{<+Fn9#V$uoP_X?;*m$lXsDxUtBOvwmhT6!8`{HXc}(bv<Q5*wfVKzwtI5a z13!*|c44M9QBVDR$Az){njodo`Fo2}7NIz+o`s~Y*-q;SC*gx4w4sKDGx>zBYsT$` zv$UV=9%7q7|9*{f0pV5!mW@A1pM>SPNoB$q<rhi?LJ^Q1L0f6as?M``W(^jI0FClH z!|um~3jZ=uJ-p;+QB4eyexB;jXa3QhBAw(dJbzZ#WcYg>x0t@-ZL(pWjfuhvC}*qr zIMO2R8_9I%I+v(wt*d`{mONt9tUBT?^3W@)^s$E1rEDox`(k5?cU4VpxY4CtDWRgf z0=ajs*YbB#UG~n+tNPYFF?y6ySAO{Q+^qL>Yr48emd*(eOdza)GG>!XPSVA<;}Nk* zLY_IgYu?O;W0o%G;SV(Y<q<&~y~LbRO7RNfT+cRaH16m7^%3zh=ldK@#~Sm))hzF% zT(|uCh=@B)X5y_ME&uuIPyU}-zudso3eW>E1I`t&E?c^6*)j@cXmsl$LQ3?<r|2S> zni?C!=Ig}P5Gdop63I}LmF48(y6OKqrqbhu6{%>D&uUIOGiH;utFm>R?&Y#FUr)~z z?Vy8(hJQjj9zg+T0>g*4*4C*HA9lfQs&W;HAcn;7S~3q0*t`{GWo0?CDk^@c@DM5= zG&e`a#@ZIy8Ig&Z4nKeYZcmN&Og2YWP0QG?-@ZjZ*wTVAT#r{kNJxmATi%X+Yy>U9 zj-5k0H#~7mS>L-)!7Kj6C^ubK2xt5{J3Mifva&^C_kInLYWuO#>-gpR)1t4dl=_}N z6<fNryQc@Umt_(X2lsU}G&DF}6eNhG8B7c8*!KsWt*gz@-mlpE=+QDEp}wA;D)$!t z$ya%netOss+3auu2%>iH-hHYTgbGliV_NjY#l?X+DJm&NpE)xC2<81Y3ameUbHW9X zXf|fFPdozJmml8q=CFcI$?COhV`5^SU3J@1X7T-HuHyMBYb7Hn@)zz84h|kEwkcME zE(g#A;J~sD6w28hIpG?G#l`PnSt!4HHHnk+$*tqJe&37XY_^?FTj7@Ax??~CtY%XZ z5~#CSW+_*3_t-=J{!nYuDH$0V(A>#63=a>V3=dCNRmNJZ$_pQjf3ai?44`obxPbLA zx^ZqJ3RqA)d-Ugj|GEH)moK)7D1eK3AvqaHlLJW=!h-VhavF^=-IxRkfR<LEFE5$= zadNV9QgL@=?;_jvbxzJsPHPJst*sLy>YA;JcM17L6ql9Vf}5hbc^fv1>DBi8Uxuc^ z@dXujLhcbO)!T-*i3|W;!&DLohf9})s3-&C2cf{&bLSX%-}L9Q`Y&D}Wq(f1^}eb) zbT$C&c&HP0+S=-ed^Yof3@Rofti?*9pWjawvg&OnCTgtaB)C6B!TZC$)aK%Q<0Sj` zw^9nrQ)j8^ClgES>+5rJT*seY=i}qMbDCF(3SBSA8%QPHO-&wXYLd7T5))qz54%0( z7ZV$e9JoO+SRGG*TMC%t#ryaAc!V0M@ho4n)h-|2Yb+NM6PY$Rpr%6D^$s&)2&ka- zVv+;Er#v`NaW{dlxl5=*x0!6X&;F%v^Hh`MaSaWP6pdv90-hRa5RU`}1f;&d((9!u z(gr1pn3jR9n_Gk6JBXCWMn@B!yfs9ke{(zPT+u_WVRgLvcSlxPrzhr>Zl3!O9N^~W z?)B8bh>I~>?_Lz)!%?v(J~e3w%Zj@wEG*1i1l*lJY>J;ed6LEWvZzLC=n)4O*VM#> z-)BVuI_&{g(iTpBM<!f`O+ywh;fg$ShL4)A9n^kwhrc-M0GYLoY904Ehk3)*QT9Nr zxh$~r&Ec`Jv6%Ekg-Yq6a+Y1>CKylfQ_a#eTJm?_a5i}C#Zl426~eY_d$SqmRh}+A z1fRnjGk(jv>gW0q<{pDxUD9;R;$Enb>`McohvLc1GmRJZvpb;}u^G+>wmR=khhQB> zrvN-k;-V&{c_d3IaHsBH(QfeA09QGxS2_g(rle8kydBO4OjVznnpLR{@Sb3(W?*-5 z&duWu_2m*V8!6Klp2z2B3n_m=My9?$dA?Kc=*O24E8_~3-9zF8BU`H|ucZ$B`{qxW zn3xb6&q_)0{A!e+m$wpnLFoD6xQOxR`1p8CdWk~Z_oFpZ9(ntgpUNe+e&V`A!Cv`& zaRo``s?GPY&ynP=^p`K)*PNI688kld{8!L8DeIP&-egnU3w0P8>f+MUx+5QQZ%Z1C zM$#BJg_g9D-HVpTkgh!lIrvaVS2uz(DEUc#Y@qBp=e%zGf4*l_b(OZZLt*#wXCOz3 zEEGTdHRhb|-Lk#Ny0Njby1E*6a90u?Y(_F@4B<(GN}-CL>>!r$J(;3a@Tw!P5D^hE z3rrffo|v9a4iTuR(q^#l;=m4WH%QxIZ}0Whrr?Xmz@=@4-Cosb44|zB{9W^56DF-t zBggQFHqDm3tEMsd)eS0@E3CV`7X`_7aHmb($sb&>FpV8ydjANrOPiXnmu_Agi&YoQ z-=M2ISXx|cTHK3UfgTYtP>=@l03S6<T>H`IocZoxrJ*bNeVGQvNhU`|@&s|97#Ux- zz6|TWni?%%U*FA)sdIigIXO0Bk&2oxBBdBQYTeY(kR<c6K4_&)F7HEc(OPo0t-09_ z>?|mcxs@;`^6~aoA5el(Da0uc9xz?IV$!CLr@mTrTCmw_{khuOX?X3xV72D>!m-V6 z2wh+bjtmd0!^m*+%3WTX4^DC|#`hqaD1oMhv_t9~7=U`xqXH1G9(abqyB!_Vv$FJ2 zKF7sTiV8p&051XpI!QDcNS5#3z6GUCUa7PnRwWie$JV6dyRSk*UR9+roCL|BsdCcV z-Ci>y=1GswMc^qw!a#&K;E;22n99f-I5N!ionYK>>>JDyxES#THRUSJD!=Ws4<}n` z-4Ty~FXUh?I6ci~&u!rgalzIpzMU@0G|Yv7?990^&8sUNSgyEZIa)h9)*V#62}#=@ zsWI+F0VO=w62KxHWgci>SqG9|OA8;B3#i9rhraVQznodT>QxC(MFIki-yD>J8M^Fu z-;9g^Pdl}(a7U3fr0PLem1X_7-PZ)~IB;MLWq)XBD3wZ8ytUzs;)T06q!h$b_b*|V zH^?&%NMOIzHow#{zZ6ct7D+$ebb1D|I*5{Aecp)s8t$ZGs**%`-m&&flmLyubI|%k zIl%N;l0soReTj+r%+0`~ASyQ28Cv|OF$gkX;NT_)Xi^;}LJUcLU8_aN+Si931r^4B zT^leT2(9HWm?wKe)t7<z4vN*6+1Zx2cFxX{kP-3oA3_)AAV&~9cX#>__dkJ*1S=W* zfFlcQV)!T-Gr1B2!2h18`5-$R8Qq1E!>goND(U#~1z_OVd>9=%{Ed$=V&m9!{psMK zt`74D6_BN+C9Y%URPiqmb85IQqL-ql=pU~S7-U*e(v3|`EBEpcLzX2cS!u@&4Gq)v z!fw>pJC*eX-HO`{$3f^H2aze!ejzV%kjeHqZ&YI+^rEAq;a-8%#l_97c~C!i$}=D! zz@lmJ=Fv(9gE18hR)Uk06a3KNbF^INNO^|da-x4J_U-GPwl?$N&amhiNMU)!H_Ffv zGbcWNyaB(E?b|!i^}(y#C3G^n>gGpaWg2geA+rLzpE?YW5%<k(MOH<)iQ54oy}B>> zCVe$ArRjKg3GFywR&x@vtna1QG6)6W?1;c}#ope2@7`A+WT2z3vOnPM{SLa#ES;l! z`YYiMK~e>a>3lq-ak~ei4>txwlPPyP1ZEy|3Xc5u)<Rao0VOz%LanN<2Hys7q9N%6 z9H)hS0Texh(Va=b{nl14UfyI8tT~Deb##;%5R2;{ds^;qZXQjMmXd04551FSdXnk8 z1||yRC)js6+g4a6?H48!U!<<=S!~I)B8L?VHMq3<4V@w(Az@$oC_h{$XgqyeAtx`d zq;7Ck3kg{d*BUM;aB)+6tQ;H^=)x*4wAszhn2I77cvWx2eLko31Q&}CwWqgt*YtIw zp%b;)>SU9Gk5f|u)R9lYMd9i2ssdtd9>@rImqf{}tegZZRqkS@UYI<6HE3g1aK|96 z`0`18y004gTc)!8Dj-P=wa2xMD-%w!(DWk7{Io+#j@MLx+XjbW4$Cyv&CVXW!>iwV z|Gt`2O8=ura`e@>f#l_b$JaA!;6C{aCS`r1wJDxHKA=q;4GEb8hbJ#Lx0TDYVm&|c zg$Hd8w5Bu~4Y=k$EGBA5u&+UVQ1eNUzuw<(cSqWI>Aix?<Yd%0-+BiIW}oU}FZtmR z)6+A>gpHwdEo?FNknHuU4#;97#G=vF%xBfs2El!p$yD#|1|v4?PNi_cD!rPjDzj9z zR}m*!+1a6%uc@gCe4gL;ZvHOgH2!SCKIY#D=quUf4^A}<V|`JKwMxNZei_v)MWrz< z7XB<vb^XLdEKp~d*HzWln#LYW#2rLhftn>M>v8we=-*b(*Qs?$!Ceb}=Xssr>!e5; zzJ2!Xo;WeG61y_wTxDO%<P=sG6c~A>s_ngxIEY>N0yB40Z|P`c-R1g$s}vQ@m?qEr zE1m$@&i9xG;ou=^vae!TTRH_LZS`0lLCf<K6eZ?m<>cgKWebqw;3fpKXfJdI&%@c^ zN=gQt%~bgE^Gnk&m6Y6sMG!&>TnSv)I}3}5Y;<pqL(K{PFq33<$`zJAYv>b`lTYfy zLZ(lm=<O~~sepp@@?|d=DI_^+uoH#ZXexK04ug0VUTjXVD7I!paC`Ol-*B*eJ@a80 zj*}`nMiodk$oUBE>!x-VS#vH^G&VQa_5VAn#a}jpf|Km{7BH%O>uZ;#0b;HVsq<S7 zm3SC*Ens2Hme^!575ok97p}}DRz+~*)Iz8^pLL#(s-dODB<Y~4$DY;+o}PKWFwb<p z0wS<H>ozM*FTy{LkUD8n0RCO>Y*=Vmn46m$uY^uYR@U?G#k63sxMv?fMxk#yOUhOr z7Ly_RogEw;(3FCpn||@4Lh&#Ree4|^09P;EW*i_I&iw3hEGE$b(Y`m+|69WO?>Bvw YjP}cQ(fw?Yjyy(eHQHu)h3XRifB(1uqW}N^ literal 0 HcmV?d00001 diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index 3516b83111..b4b5cf0343 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -1795,6 +1795,15 @@ @article{DorPri:80 doi = {10.1016/0771-050X(80)90013-3} } +@book{Euler:68 + author = {Leonhard Euler}, + title = {Institutiones calculi integralis}, + volume = {Volumen Primum}, + year = {1768}, + publisher = {B. G. Teubner Verlag}, + note = {reprinted in Opera Omnia Series 1, Volume 11} +} + @article{HaSo:05, title={Explicit, time reversible, adaptive step size control}, author={Hairer, Ernst and S{\"o}derlind, Gustaf}, @@ -1943,6 +1952,42 @@ @article{Mclachlan:92 publisher = {IOP Publishing} } +@article{Ralston:62, + author = {Ralston, Anthony}, + title = {{Runge--Kutta} methods with minimum error bounds}, + journal = {Mathematics of Computation}, + volume = {16}, + number = {80}, + pages = {431–437}, + year = {1962}, + publisher = {American Mathematical Society}, + doi = {10.1090/s0025-5718-1962-0150954-0} +} + +@article{Roberts:22, + author = {Roberts, Steven and Popov, Andrey A and Sarshar, Arash and Sandu, Adrian}, + title = {A Fast Time-Stepping Strategy for Dynamical Systems Equipped with a Surrogate Model}, + journal = {SIAM Journal on Scientific Computing}, + volume = {44}, + number = {3}, + pages = {A1405--A1427}, + year = {2022}, + publisher = {SIAM}, + doi = {10.1137/20M1386281} +} + +@Article{Runge:95, + author = {Runge, C.}, + title = {Ueber die numerische Aufl{\"o}sung von Differentialgleichungen}, + journal = {Mathematische Annalen}, + volume = {46}, + number = {2}, + pages = {167-178}, + year = {1895}, + publisher = {Springer}, + doi = {10.1007/BF01446807} +} + @article{Sandu:19, author = {Sandu, A.}, title = {A Class of Multirate Infinitesimal GARK Methods}, diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 8c43ee198b..f7a6f112f5 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -35,6 +35,7 @@ extern "C" { /* Default Butcher tables for each method/order */ /* explicit */ +static const int ARKSTEP_DEFAULT_ERK_1 = ARKODE_FORWARD_EULER_1_1; static const int ARKSTEP_DEFAULT_ERK_2 = ARKODE_HEUN_EULER_2_1_2; static const int ARKSTEP_DEFAULT_ERK_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3; static const int ARKSTEP_DEFAULT_ERK_4 = ARKODE_ZONNEVELD_5_3_4; @@ -45,6 +46,7 @@ static const int ARKSTEP_DEFAULT_ERK_8 = ARKODE_FEHLBERG_13_7_8; static const int ARKSTEP_DEFAULT_ERK_9 = ARKODE_VERNER_16_8_9; /* implicit */ +static const int ARKSTEP_DEFAULT_DIRK_1 = ARKODE_BACKWARD_EULER_1_1; static const int ARKSTEP_DEFAULT_DIRK_2 = ARKODE_SDIRK_2_1_2; static const int ARKSTEP_DEFAULT_DIRK_3 = ARKODE_ARK324L2SA_DIRK_4_2_3; static const int ARKSTEP_DEFAULT_DIRK_4 = ARKODE_SDIRK_5_3_4; diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index fa60103e89..ffa4908c91 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -51,7 +51,10 @@ typedef enum ARKODE_ESDIRK547L2SA_7_4_5, ARKODE_ESDIRK547L2SA2_7_4_5, ARKODE_ARK2_DIRK_3_1_2, - ARKODE_MAX_DIRK_NUM = ARKODE_ARK2_DIRK_3_1_2 + ARKODE_BACKWARD_EULER_1_1, + ARKODE_IMPLICIT_MIDPOINT_1_2, + ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, + ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 } ARKODE_DIRKTableID; /* Accessor routine to load built-in DIRK table */ diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index bb99368b41..764b67bbfe 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -49,7 +49,10 @@ typedef enum ARKODE_VERNER_10_6_7, ARKODE_VERNER_13_7_8, ARKODE_VERNER_16_8_9, - ARKODE_MAX_ERK_NUM = ARKODE_VERNER_16_8_9 + ARKODE_FORWARD_EULER_1_1, + ARKODE_RALSTON_EULER_2_1_2, + ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2, + ARKODE_MAX_ERK_NUM = ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 } ARKODE_ERKTableID; /* Accessor routine to load built-in ERK table */ diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index 73f2a474c6..ed93a240b9 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -32,6 +32,7 @@ extern "C" { /* Default Butcher tables for each order */ +static const int ERKSTEP_DEFAULT_1 = ARKODE_FORWARD_EULER_1_1; static const int ERKSTEP_DEFAULT_2 = ARKODE_HEUN_EULER_2_1_2; static const int ERKSTEP_DEFAULT_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3; static const int ERKSTEP_DEFAULT_4 = ARKODE_ZONNEVELD_5_3_4; diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 1191e0a39d..000bae135a 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -52,17 +52,32 @@ typedef enum ARKODE_IMEX_MRI_GARK3a, ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, - ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK4 + ARKODE_MRI_GARK_FORWARD_EULER, + ARKODE_MRI_GARK_RALSTON2, + ARKODE_MRI_GARK_ERK22a, + ARKODE_MRI_GARK_ERK22b, + ARKODE_MRI_GARK_RALSTON3, + ARKODE_MRI_GARK_BACKWARD_EULER, + ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, + ARKODE_IMEX_MRI_GARK_EULER, + ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, + ARKODE_IMEX_MRI_GARK_MIDPOINT, + ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT, } ARKODE_MRITableID; /* Default MRI coupling tables for each order */ +static const int MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER; +static const int MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b; +static const int MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3; +static const int MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a; -static const int MRISTEP_DEFAULT_3 = ARKODE_MIS_KW3; -static const int MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3; -static const int MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a; +static const int MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER; static const int MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a; static const int MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a; static const int MRISTEP_DEFAULT_IMPL_SD_4 = ARKODE_MRI_GARK_ESDIRK46a; + +static const int MRISTEP_DEFAULT_IMEX_SD_1 = ARKODE_IMEX_MRI_GARK_EULER; +static const int MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL; static const int MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b; static const int MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4; diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 5e181982c1..70275484ec 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2159,6 +2159,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) { switch (step_mem->q) { + case (1): itable = ARKSTEP_DEFAULT_DIRK_1; break; case (2): itable = ARKSTEP_DEFAULT_DIRK_2; break; case (3): itable = ARKSTEP_DEFAULT_DIRK_3; break; case (4): itable = ARKSTEP_DEFAULT_DIRK_4; break; @@ -2176,6 +2177,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) { switch (step_mem->q) { + case (1): itable = ARKSTEP_DEFAULT_ERK_1; break; case (2): etable = ARKSTEP_DEFAULT_ERK_2; break; case (3): etable = ARKSTEP_DEFAULT_ERK_3; break; case (4): etable = ARKSTEP_DEFAULT_ERK_4; break; diff --git a/src/arkode/arkode_butcher_dirk.def b/src/arkode/arkode_butcher_dirk.def index 2ce5444f8c..40d13e60bd 100644 --- a/src/arkode/arkode_butcher_dirk.def +++ b/src/arkode/arkode_butcher_dirk.def @@ -34,7 +34,11 @@ imeth type A-stable L-stable QP ----------------------------------------------------------------- + ARKODE_BACKWARD_EULER_1_1 SDIRK Y Y Y ARKODE_SDIRK_2_1_2 SDIRK Y N Y + ARKODE_ARK2_DIRK_3_1_2 ESDIRK Y Y Y + ARKODE_IMPLICIT_MIDPOINT_1_2 SDIRK Y N Y + ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 ESDIRK Y N Y ARKODE_BILLINGTON_3_3_2 SDIRK N N N ARKODE_TRBDF2_3_3_2 ESDIRK N N Y ARKODE_KVAERNO_4_2_3 ESDIRK Y Y N @@ -57,7 +61,6 @@ ARKODE_ARK548L2SAb_DIRK_8_4_5* ESDIRK Y Y N ARKODE_ESDIRK547L2SA_7_4_5 ESDIRK Y Y N ARKODE_ESDIRK547L2SA2_7_4_5 ESDIRK Y Y N - ARKODE_ARK2_DIRK_3_1_2 ESDIRK Y Y Y ----------------------------------------------------------------- */ @@ -65,6 +68,19 @@ ARK_BUTCHER_TABLE(ARKODE_DIRK_NONE, { return NULL; }) +ARK_BUTCHER_TABLE(ARKODE_BACKWARD_EULER_1_1, { /* Backward Euler (L,B stable) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(1, SUNFALSE); + B->q = 1; + B->p = 0; + + B->A[0][0] = SUN_RCONST(1.0); + + B->b[0] = SUN_RCONST(1.0); + + B->c[0] = SUN_RCONST(1.0); + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_SDIRK_2_1_2, { /* SDIRK-2-1 (A,B stable) */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNTRUE); B->q = 2; @@ -119,6 +135,34 @@ ARK_BUTCHER_TABLE(ARKODE_ARK2_DIRK_3_1_2, { /* ARK2 Implicit Table (A,L stable) return B; }) +ARK_BUTCHER_TABLE(ARKODE_IMPLICIT_MIDPOINT_1_2, { /* Implicit Midpoint Rule (A,B stable) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(1, SUNFALSE); + B->q = 2; + B->p = 0; + + B->A[0][0] = SUN_RCONST(0.5); + + B->b[0] = SUN_RCONST(1.0); + + B->c[0] = SUN_RCONST(0.5); + return B; + }) + +ARK_BUTCHER_TABLE(ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, { /* Implicit Trapezoidal Rule (A stable) */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNFALSE); + B->q = 2; + B->p = 0; + + B->A[1][0] = SUN_RCONST(0.5); + B->A[1][1] = SUN_RCONST(0.5); + + B->b[0] = SUN_RCONST(0.5); + B->b[1] = SUN_RCONST(0.5); + + B->c[1] = SUN_RCONST(1.0); + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_BILLINGTON_3_3_2, { /* Billington-SDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNTRUE); diff --git a/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index 5fe439bbab..a29292e27d 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -36,38 +36,50 @@ are known precisely enough for use in quad precision (128-bit) calculations. - imeth QP - -------------------------------------- - ARKODE_HEUN_EULER_2_1_2 Y - ARKODE_BOGACKI_SHAMPINE_4_2_3 Y - ARKODE_ARK324L2SA_ERK_4_2_3* N - ARKODE_SHU_OSHER_3_2_3 Y - ARKODE_SOFRONIOU_SPALETTA_5_3_4 Y - ARKODE_ZONNEVELD_5_3_4 Y - ARKODE_ARK436L2SA_ERK_6_3_4* N - ARKODE_ARK437L2SA_ERK_7_3_4* N - ARKODE_SAYFY_ABURUB_6_3_4 N - ARKODE_CASH_KARP_6_4_5 Y - ARKODE_FEHLBERG_6_4_5 Y - ARKODE_DORMAND_PRINCE_7_4_5 Y - ARKODE_ARK548L2SA_ERK_8_4_5* N - ARKODE_ARK548L2SAb_ERK_8_4_5* N - ARKODE_VERNER_8_5_6 Y - ARKODE_FEHLBERG_13_7_8 Y - ARKODE_ARK2_ERK_3_1_2 Y - ARKODE_VERNER_9_5_6 Y - ARKODE_VERNER_10_6_7 Y - ARKODE_VERNER_13_7_8 Y - ARKODE_VERNER_16_8_9 Y - -------------------------------------- - ARKODE_KNOTH_WOLKE_3_3^ Y - -------------------------------------- + imeth QP + --------------------------------------- + ARKODE_FORWARD_EULER_1_1 Y + ARKODE_HEUN_EULER_2_1_2 Y + ARKODE_RALSTON_EULER_2_1_2 Y + ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 Y + ARKODE_BOGACKI_SHAMPINE_4_2_3 Y + ARKODE_ARK324L2SA_ERK_4_2_3* N + ARKODE_SHU_OSHER_3_2_3 Y + ARKODE_SOFRONIOU_SPALETTA_5_3_4 Y + ARKODE_ZONNEVELD_5_3_4 Y + ARKODE_ARK436L2SA_ERK_6_3_4* N + ARKODE_ARK437L2SA_ERK_7_3_4* N + ARKODE_SAYFY_ABURUB_6_3_4 N + ARKODE_CASH_KARP_6_4_5 Y + ARKODE_FEHLBERG_6_4_5 Y + ARKODE_DORMAND_PRINCE_7_4_5 Y + ARKODE_ARK548L2SA_ERK_8_4_5* N + ARKODE_ARK548L2SAb_ERK_8_4_5* N + ARKODE_VERNER_8_5_6 Y + ARKODE_FEHLBERG_13_7_8 Y + ARKODE_ARK2_ERK_3_1_2 Y + ARKODE_VERNER_9_5_6 Y + ARKODE_VERNER_10_6_7 Y + ARKODE_VERNER_13_7_8 Y + ARKODE_VERNER_16_8_9 Y + --------------------------------------- + ARKODE_KNOTH_WOLKE_3_3^ Y + --------------------------------------- */ ARK_BUTCHER_TABLE(ARKODE_ERK_NONE, { return NULL; }) +ARK_BUTCHER_TABLE(ARKODE_FORWARD_EULER_1_1, { /* Euler-ERK */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(1, SUNFALSE); + B->q = 1; + B->p = 0; + + B->b[0] = SUN_RCONST(1.0); + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_HEUN_EULER_2_1_2, { /* Heun-Euler-ERK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNTRUE); B->q = 2; @@ -84,6 +96,37 @@ ARK_BUTCHER_TABLE(ARKODE_HEUN_EULER_2_1_2, { /* Heun-Euler-ERK */ return B; }) +ARK_BUTCHER_TABLE(ARKODE_RALSTON_EULER_2_1_2, { /* Ralston-Euler-ERK */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNTRUE); + B->q = 2; + B->p = 1; + + B->A[1][0] = SUN_RCONST(2.0) / SUN_RCONST(3.0); + + B->b[0] = SUN_RCONST(1.0) / SUN_RCONST(4.0); + B->b[1] = SUN_RCONST(3.0) / SUN_RCONST(4.0); + + B->d[0] = SUN_RCONST(1.0); + + B->c[1] = SUN_RCONST(2.0) / SUN_RCONST(3.0); + return B; + }) + +ARK_BUTCHER_TABLE(ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2, { /* Explicit-Midpoint-Euler-ERK */ + ARKodeButcherTable B = ARKodeButcherTable_Alloc(2, SUNTRUE); + B->q = 2; + B->p = 1; + + B->A[1][0] = SUN_RCONST(1.0) / SUN_RCONST(2.0); + + B->b[1] = SUN_RCONST(1.0); + + B->d[0] = SUN_RCONST(1.0); + + B->c[1] = SUN_RCONST(1.0) / SUN_RCONST(2.0); + return B; + }) + ARK_BUTCHER_TABLE(ARKODE_ARK2_ERK_3_1_2, { /* ARK2 Explicit Table */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNTRUE); diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index adf22daadb..2432784596 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -838,6 +838,7 @@ int erkStep_SetButcherTable(ARKodeMem ark_mem) /* select method based on order */ switch (step_mem->q) { + case (1): etable = ERKSTEP_DEFAULT_1; break; case (2): etable = ERKSTEP_DEFAULT_2; break; case (3): etable = ERKSTEP_DEFAULT_3; break; case (4): etable = ERKSTEP_DEFAULT_4; break; diff --git a/src/arkode/arkode_mri_tables.def b/src/arkode/arkode_mri_tables.def index 13c5635b43..999ef71f95 100644 --- a/src/arkode/arkode_mri_tables.def +++ b/src/arkode/arkode_mri_tables.def @@ -31,24 +31,49 @@ are known precisely enough for use in quad precision (128-bit) calculations. - imeth order type QP - ------------------------------------------------ - ARKODE_MIS_KW3 3 E Y - ARKODE_MRI_GARK_ERK33a 3 E Y - ARKODE_MRI_GARK_ERK45a 4 E Y - ARKODE_MRI_GARK_IRK21a 2 ID Y - ARKODE_MRI_GARK_ESDIRK34a 3 ID Y - ARKODE_MRI_GARK_ESDIRK46a 4 ID Y - ARKODE_IMEX_MRI_GARK3a 3 ID Y - ARKODE_IMEX_MRI_GARK3b 3 ID Y - ARKODE_IMEX_MRI_GARK4 4 ID Y - ------------------------------------------------ + imeth order type QP + ----------------------------------------------------- + ARKODE_MRI_GARK_FORWARD_EULER 1 E Y + ARKODE_MRI_GARK_RALSTON2 2 E Y + ARKODE_MIS_KW3 3 E Y + ARKODE_MRI_GARK_ERK22a 2 E Y + ARKODE_MRI_GARK_ERK22b 2 E Y + ARKODE_MRI_GARK_ERK33a 3 E Y + ARKODE_MRI_GARK_RALSTON3 3 E Y + ARKODE_MRI_GARK_ERK45a 4 E Y + ARKODE_MRI_GARK_BACKWARD_EULER 1 ID Y + ARKODE_MRI_GARK_IRK21a 2 ID Y + ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 2 ID Y + ARKODE_MRI_GARK_ESDIRK34a 3 ID Y + ARKODE_MRI_GARK_ESDIRK46a 4 ID Y + ARKODE_IMEX_MRI_GARK_EULER 1 ID Y + ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 2 ID Y + ARKODE_IMEX_MRI_GARK_MIDPOINT 2 ID Y + ARKODE_IMEX_MRI_GARK3a 3 ID Y + ARKODE_IMEX_MRI_GARK3b 3 ID Y + ARKODE_IMEX_MRI_GARK4 4 ID Y + ----------------------------------------------------- */ + ARK_MRI_TABLE(ARKODE_MRI_NONE, { return NULL; }) +ARK_MRI_TABLE(ARKODE_MRI_GARK_FORWARD_EULER, { + ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_FORWARD_EULER_1_1); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 1, 0); + ARKodeButcherTable_Free(B); + return C; + }) + +ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON2, { /* Roberts et al., SISC 44:A1405 - A1427, 2022 */ + ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_RALSTON_EULER_2_1_2); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + ARKodeButcherTable_Free(B); + return C; + }) + ARK_MRI_TABLE(ARKODE_MIS_KW3, { /* Schlegel et al., JCAM 226:345-357, 2009 */ ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_KNOTH_WOLKE_3_3); MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 3, 0); @@ -56,6 +81,20 @@ ARK_MRI_TABLE(ARKODE_MIS_KW3, { /* Schlegel et al., JCAM 226:345-357, 2009 */ return C; }) +ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK22a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ + ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + ARKodeButcherTable_Free(B); + return C; + }) + +ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK22b, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ + ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_HEUN_EULER_2_1_2); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + ARKodeButcherTable_Free(B); + return C; + }) + ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK33a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(2, 4, MRISTEP_EXPLICIT); @@ -77,6 +116,31 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK33a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ return C; }) +ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON3, { /* Roberts et al., SISC 44:A1405 - A1427, 2022 */ + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 4, MRISTEP_EXPLICIT); + + C->q = 3; + C->p = 0; + + C->c[1] = ONE/TWO; + C->c[2] = SUN_RCONST(3.0)/SUN_RCONST(4.0); + C->c[3] = ONE; + + C->W[0][1][0] = ONE/TWO; + C->W[0][2][0] = -SUN_RCONST(11.0)/SUN_RCONST(4.0); + C->W[0][2][1] = SUN_RCONST(3.0); + C->W[0][3][0] = SUN_RCONST(47.0)/SUN_RCONST(36.0); + C->W[0][3][1] = -ONE/SUN_RCONST(6.0); + C->W[0][3][2] = -SUN_RCONST(8.0)/SUN_RCONST(9.0); + + C->W[1][2][0] = SUN_RCONST(9.0)/TWO; + C->W[1][2][1] = -SUN_RCONST(9.0)/TWO; + C->W[1][3][0] = -SUN_RCONST(13.0)/SUN_RCONST(6.0); + C->W[1][3][1] = -ONE/TWO; + C->W[1][3][2] = SUN_RCONST(8.0)/SUN_RCONST(3.0); + return C; + }) + ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(2, 6, MRISTEP_EXPLICIT); @@ -122,6 +186,21 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ return C; }) +ARK_MRI_TABLE(ARKODE_MRI_GARK_BACKWARD_EULER, { + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 3, MRISTEP_IMPLICIT); + + C->q = 1; + C->p = 0; + + C->c[1] = ONE; + C->c[2] = ONE; + + C->G[0][1][0] = ONE; + C->G[0][2][0] = -ONE; + C->G[0][2][2] = ONE; + return C; + }) + ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C; ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNFALSE); @@ -143,6 +222,23 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ return C; }) +ARK_MRI_TABLE(ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, { + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 4, MRISTEP_IMPLICIT); + + C->q = 2; + C->p = 0; + + C->c[1] = ONE/TWO; + C->c[2] = ONE/TWO; + C->c[3] = ONE; + + C->G[0][1][0] = ONE/TWO; + C->G[0][2][0] = -ONE/TWO; + C->G[0][2][2] = ONE/TWO; + C->G[0][3][2] = ONE/TWO; + return C; + }) + ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 7, MRISTEP_IMPLICIT); sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); @@ -257,6 +353,64 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 return C; }) +ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK_EULER, { + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 3, MRISTEP_IMEX); + + C->q = 1; + C->p = 0; + + C->c[1] = ONE; + C->c[2] = ONE; + + C->W[0][1][0] = ONE; + + C->G[0][1][0] = ONE; + C->G[0][2][0] = -ONE; + C->G[0][2][2] = ONE; + return C; + }) + +ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, { + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 4, MRISTEP_IMEX); + + C->q = 2; + C->p = 0; + + C->c[1] = ONE; + C->c[2] = ONE; + C->c[3] = ONE; + + C->W[0][1][0] = ONE; + C->W[0][3][0] = -ONE/TWO; + C->W[0][3][2] = ONE/TWO; + + C->G[0][1][0] = ONE; + C->G[0][2][0] = -ONE/TWO; + C->G[0][2][2] = ONE/TWO; + return C; + }) + +ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK_MIDPOINT, { + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 4, MRISTEP_IMEX); + + C->q = 2; + C->p = 0; + + C->c[1] = ONE/TWO; + C->c[2] = ONE/TWO; + C->c[3] = ONE; + + C->W[0][1][0] = ONE/TWO; + C->W[0][3][0] = -ONE/TWO; + C->W[0][3][2] = ONE; + + C->G[0][1][0] = ONE/TWO; + C->G[0][2][0] = -ONE/TWO; + C->G[0][2][2] = ONE/TWO; + C->G[0][3][2] = ONE/TWO; + return C; + }) + ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK3a, { /* R. Chinomona & D. Reynolds SINUM 43(5):A3082-A3113, 2021 */ MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMEX); sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index cea390373e..78f34da788 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -90,8 +90,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, } /* Allocate ARKodeMRIStepMem structure, and initialize to zero */ - step_mem = NULL; - step_mem = (ARKodeMRIStepMem)malloc(sizeof(struct ARKodeMRIStepMemRec)); + step_mem = (ARKodeMRIStepMem)calloc(1, sizeof(*step_mem)); if (step_mem == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, @@ -99,7 +98,6 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, ARKodeFree((void**)&ark_mem); return (NULL); } - memset(step_mem, 0, sizeof(struct ARKodeMRIStepMemRec)); /* Attach step_mem structure and function pointers to ark_mem */ ark_mem->step_attachlinsol = mriStep_AttachLinsol; @@ -917,23 +915,23 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_ILL_INPUT); } - /* Retrieve/store method and embedding orders now that tables are finalized */ - step_mem->stages = step_mem->MRIC->stages; - step_mem->q = step_mem->MRIC->q; - step_mem->p = step_mem->MRIC->p; - /* allocate/fill derived quantities from MRIC structure */ /* stage map */ if (step_mem->stage_map) { free(step_mem->stage_map); - step_mem->stage_map = NULL; ark_mem->liw -= step_mem->stages; } - step_mem->stage_map = (int*)calloc(step_mem->stages, sizeof(int)); - ark_mem->liw += step_mem->stages; - + step_mem->stage_map = (int*)calloc(step_mem->MRIC->stages, + sizeof(*step_mem->stage_map)); + if (step_mem->stage_map == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->liw += step_mem->MRIC->stages; retval = mriStepCoupling_GetStageMap(step_mem->MRIC, step_mem->stage_map, &(step_mem->nstages_active)); if (retval != ARK_SUCCESS) @@ -947,12 +945,18 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) if (step_mem->stagetypes) { free(step_mem->stagetypes); - step_mem->stagetypes = NULL; ark_mem->liw -= step_mem->stages; } - step_mem->stagetypes = (int*)calloc(step_mem->stages, sizeof(int)); - ark_mem->liw += step_mem->stages; - for (j = 0; j < step_mem->stages; j++) + step_mem->stagetypes = (int*)calloc(step_mem->MRIC->stages, + sizeof(*step_mem->stagetypes)); + if (step_mem->stagetypes == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->liw += step_mem->MRIC->stages; + for (j = 0; j < step_mem->MRIC->stages; j++) { step_mem->stagetypes[j] = mriStepCoupling_GetStageType(step_mem->MRIC, j); } @@ -961,23 +965,70 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) if (step_mem->Ae_row) { free(step_mem->Ae_row); - step_mem->Ae_row = NULL; ark_mem->lrw -= step_mem->stages; } - step_mem->Ae_row = (sunrealtype*)calloc(step_mem->stages, - sizeof(sunrealtype)); - ark_mem->lrw += step_mem->stages; + step_mem->Ae_row = (sunrealtype*)calloc(step_mem->MRIC->stages, + sizeof(*step_mem->Ae_row)); + if (step_mem->Ae_row == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->lrw += step_mem->MRIC->stages; /* implicit RK coefficient row */ if (step_mem->Ai_row) { free(step_mem->Ai_row); - step_mem->Ai_row = NULL; ark_mem->lrw -= step_mem->stages; } - step_mem->Ai_row = (sunrealtype*)calloc(step_mem->stages, - sizeof(sunrealtype)); - ark_mem->lrw += step_mem->stages; + step_mem->Ai_row = (sunrealtype*)calloc(step_mem->MRIC->stages, + sizeof(*step_mem->Ai_row)); + if (step_mem->Ai_row == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->lrw += step_mem->MRIC->stages; + + /* Allocate reusable arrays for fused vector interface */ + if (step_mem->cvals) + { + free(step_mem->cvals); + ark_mem->lrw -= step_mem->nfusedopvecs; + } + if (step_mem->Xvecs) + { + free(step_mem->Xvecs); + ark_mem->liw -= step_mem->nfusedopvecs; + } + step_mem->nfusedopvecs = 2 * step_mem->MRIC->stages + 2; + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(*step_mem->cvals)); + if (step_mem->cvals == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->lrw += step_mem->nfusedopvecs; + + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, + sizeof(*step_mem->Xvecs)); + if (step_mem->Xvecs == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return (ARK_MEM_FAIL); + } + ark_mem->liw += step_mem->nfusedopvecs; + + /* Retrieve/store method and embedding orders now that tables are finalized */ + step_mem->stages = step_mem->MRIC->stages; + step_mem->q = step_mem->MRIC->q; + step_mem->p = step_mem->MRIC->p; /* Allocate MRI RHS vector memory, update storage requirements */ /* Allocate Fse[0] ... Fse[nstages_active - 1] and */ @@ -1054,23 +1105,6 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) step_mem->lmem = NULL; } - /* Allocate reusable arrays for fused vector interface */ - step_mem->nfusedopvecs = 2 * step_mem->stages + 2; - if (step_mem->cvals == NULL) - { - step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, - sizeof(sunrealtype)); - if (step_mem->cvals == NULL) { return (ARK_MEM_FAIL); } - ark_mem->lrw += (step_mem->nfusedopvecs); - } - if (step_mem->Xvecs == NULL) - { - step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, - sizeof(N_Vector)); - if (step_mem->Xvecs == NULL) { return (ARK_MEM_FAIL); } - ark_mem->liw += (step_mem->nfusedopvecs); /* pointers */ - } - /* Allocate inner stepper data */ retval = mriStepInnerStepper_AllocVecs(step_mem->stepper, step_mem->MRIC->nmat, ark_mem->ewt); @@ -1693,6 +1727,8 @@ int mriStep_SetCoupling(ARKodeMem ark_mem) { ARKodeMRIStepMem step_mem; sunindextype Cliw, Clrw; + int q_actual; + ARKODE_MRITableID table_id; /* access ARKodeMRIStepMem structure */ if (ark_mem->step_mem == NULL) @@ -1702,72 +1738,57 @@ int mriStep_SetCoupling(ARKodeMem ark_mem) return (ARK_MEM_NULL); } step_mem = (ARKodeMRIStepMem)ark_mem->step_mem; + q_actual = step_mem->q; /* if coupling has already been specified, just return */ if (step_mem->MRIC != NULL) { return (ARK_SUCCESS); } + if (q_actual < 1 || q_actual > 4) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "No MRI method at requested order, using q=3."); + q_actual = 3; + } + /* select method based on order and type */ /**** ImEx methods ****/ if (step_mem->implicit_rhs && step_mem->explicit_rhs) { - switch (step_mem->q) + switch (q_actual) { - case 3: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMEX_SD_3); - break; - case 4: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMEX_SD_4); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "No MRI method at requested order, using q=3."); - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMEX_SD_3); - break; + case 1: table_id = MRISTEP_DEFAULT_IMEX_SD_1; break; + case 2: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; + case 3: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; + case 4: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; } /**** implicit methods ****/ } else if (step_mem->implicit_rhs) { - switch (step_mem->q) + switch (q_actual) { - case 2: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMPL_SD_3); - break; - case 3: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMPL_SD_3); - break; - case 4: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMPL_SD_4); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "No MRI method at requested order, using q=3."); - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_IMPL_SD_3); - break; + case 1: table_id = MRISTEP_DEFAULT_IMPL_SD_1; break; + case 2: table_id = MRISTEP_DEFAULT_IMPL_SD_2; break; + case 3: table_id = MRISTEP_DEFAULT_IMPL_SD_3; break; + case 4: table_id = MRISTEP_DEFAULT_IMPL_SD_4; break; } /**** explicit methods ****/ } else { - switch (step_mem->q) + switch (q_actual) { - case 3: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_EXPL_3); - break; - case 4: - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_EXPL_4); - break; - default: - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "No MRI method at requested order, using q=3."); - step_mem->MRIC = MRIStepCoupling_LoadTable(MRISTEP_DEFAULT_EXPL_3); - break; + case 1: table_id = MRISTEP_DEFAULT_EXPL_1; break; + case 2: table_id = MRISTEP_DEFAULT_EXPL_2; break; + case 3: table_id = MRISTEP_DEFAULT_EXPL_3; break; + case 4: table_id = MRISTEP_DEFAULT_EXPL_4; break; } } + step_mem->MRIC = MRIStepCoupling_LoadTable(table_id); if (step_mem->MRIC == NULL) { arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, __FILE__, @@ -2882,7 +2903,7 @@ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, /* Allocate fused operation workspace arrays */ if (stepper->vecs == NULL) { - stepper->vecs = (N_Vector*)calloc(count + 1, sizeof(N_Vector)); + stepper->vecs = (N_Vector*)calloc(count + 1, sizeof(*stepper->vecs)); if (stepper->vecs == NULL) { mriStepInnerStepper_FreeVecs(stepper); @@ -2892,7 +2913,7 @@ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, if (stepper->vals == NULL) { - stepper->vals = (sunrealtype*)calloc(count + 1, sizeof(sunrealtype)); + stepper->vals = (sunrealtype*)calloc(count + 1, sizeof(*stepper->vals)); if (stepper->vals == NULL) { mriStepInnerStepper_FreeVecs(stepper); diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index e4ca3abaa2..d803141044 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -333,7 +333,7 @@ int mriStep_SetOrder(ARKodeMem ark_mem, int ord) if (retval) { return (retval); } /* check for illegal inputs */ - if (ord < 3 || ord > 4) { step_mem->q = 3; } + if (ord <= 0) { step_mem->q = 3; } else { step_mem->q = ord; } /* Clear tables, the user is requesting a change in method or a reset to diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index beac179931..f6252c31f4 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -315,7 +315,10 @@ module farkode_mod enumerator :: ARKODE_ESDIRK547L2SA_7_4_5 enumerator :: ARKODE_ESDIRK547L2SA2_7_4_5 enumerator :: ARKODE_ARK2_DIRK_3_1_2 - enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_ARK2_DIRK_3_1_2 + enumerator :: ARKODE_BACKWARD_EULER_1_1 + enumerator :: ARKODE_IMPLICIT_MIDPOINT_1_2 + enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 end enum integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & @@ -324,7 +327,7 @@ module farkode_mod ARKODE_ARK437L2SA_DIRK_7_3_4, ARKODE_ARK548L2SAb_DIRK_8_4_5, ARKODE_ESDIRK324L2SA_4_2_3, ARKODE_ESDIRK325L2SA_5_2_3, & ARKODE_ESDIRK32I5L2SA_5_2_3, ARKODE_ESDIRK436L2SA_6_3_4, ARKODE_ESDIRK43I6L2SA_6_3_4, ARKODE_QESDIRK436L2SA_6_3_4, & ARKODE_ESDIRK437L2SA_7_3_4, ARKODE_ESDIRK547L2SA_7_4_5, ARKODE_ESDIRK547L2SA2_7_4_5, ARKODE_ARK2_DIRK_3_1_2, & - ARKODE_MAX_DIRK_NUM + ARKODE_BACKWARD_EULER_1_1, ARKODE_IMPLICIT_MIDPOINT_1_2, ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, ARKODE_MAX_DIRK_NUM public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName ! typedef enum ARKODE_ERKTableID @@ -353,7 +356,10 @@ module farkode_mod 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 + enumerator :: ARKODE_FORWARD_EULER_1_1 + enumerator :: ARKODE_RALSTON_EULER_2_1_2 + enumerator :: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 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, & @@ -361,7 +367,8 @@ module farkode_mod 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_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 + ARKODE_VERNER_9_5_6, ARKODE_VERNER_10_6_7, ARKODE_VERNER_13_7_8, ARKODE_VERNER_16_8_9, ARKODE_FORWARD_EULER_1_1, & + ARKODE_RALSTON_EULER_2_1_2, ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2, 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 1b7b8aef81..782c3c1df9 100644 --- a/src/arkode/fmod/farkode_mristep_mod.f90 +++ b/src/arkode/fmod/farkode_mristep_mod.f90 @@ -47,18 +47,35 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_GARK3a enumerator :: ARKODE_IMEX_MRI_GARK3b enumerator :: ARKODE_IMEX_MRI_GARK4 - enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK4 + enumerator :: ARKODE_MRI_GARK_FORWARD_EULER + enumerator :: ARKODE_MRI_GARK_RALSTON2 + enumerator :: ARKODE_MRI_GARK_ERK22a + enumerator :: ARKODE_MRI_GARK_ERK22b + enumerator :: ARKODE_MRI_GARK_RALSTON3 + enumerator :: ARKODE_MRI_GARK_BACKWARD_EULER + enumerator :: ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + enumerator :: ARKODE_IMEX_MRI_GARK_EULER + enumerator :: ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + enumerator :: ARKODE_IMEX_MRI_GARK_MIDPOINT + enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT end enum integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & - ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MAX_MRI_NUM - integer(C_INT), parameter, public :: MRISTEP_DEFAULT_3 = ARKODE_MIS_KW3 + ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & + ARKODE_MRI_GARK_ERK22a, ARKODE_MRI_GARK_ERK22b, ARKODE_MRI_GARK_RALSTON3, ARKODE_MRI_GARK_BACKWARD_EULER, & + ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, ARKODE_IMEX_MRI_GARK_EULER, ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, & + ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MAX_MRI_NUM + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3 integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_4 = ARKODE_MRI_GARK_ESDIRK46a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_1 = ARKODE_IMEX_MRI_GARK_EULER + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4 diff --git a/test/answers b/test/answers index ea6ac15fdc..073b119355 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit ea6ac15fdcd8615e25e52692bcd453e2f003f46b +Subproject commit 073b119355058ac88a2e4abc87acfb007bc211f6 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 index 0b5e75274c..0632b1dd9d 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 68 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK Table ID 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index 63acf12fd8..2594d1cd48 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 64 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index 02af9aea19..c4acdc8074 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 68 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK Table ID 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index 8e54df6754..6d307f1e20 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 64 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index 363b66b2ac..bf6e07f6c5 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 68 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK Table ID 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index bf8edcf74b..0269da8178 100644 --- 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 @@ -818,6 +818,111 @@ Fe RHS evals: expected: 64 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + ======================== Test implicit RK methods ======================== @@ -1797,6 +1902,123 @@ Fi RHS evals: expected: 17 -------------------- +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + ===================== Test IMEX ARK methods ===================== 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 index 7e2256037c..0a8aaf3158 100644 --- 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 @@ -815,5 +815,110 @@ Fe RHS evals: expected: 68 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + 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 index 74bc1b6a8d..3851797978 100644 --- 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 @@ -815,5 +815,110 @@ Fe RHS evals: expected: 64 -------------------- +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + 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 579e76ddef..7e3d20ca84 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 @@ -24,6 +24,7 @@ #include <cstring> #include <iomanip> #include <iostream> +#include <map> #include <nvector/nvector_serial.h> #include <string> #include <sundials/sundials_core.hpp> @@ -242,10 +243,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, // Evolve with various IMEX MRI methods // ------------------------------------ - // Methods to test (order most stages to least since reinit does not realloc) - int num_methods; - ARKODE_MRITableID* methods = nullptr; - bool* stiffly_accurate = nullptr; + // Methods to test paired with whether they are stiffly accurate + std::map<std::string, bool> methods; if (type == MRISTEP_EXPLICIT) { @@ -253,12 +252,14 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, cout << "Test explicit MRI methods\n"; cout << "=========================\n"; - num_methods = 3; - methods = new ARKODE_MRITableID[num_methods]; - - methods[0] = ARKODE_MIS_KW3; - methods[1] = ARKODE_MRI_GARK_ERK33a; - methods[2] = ARKODE_MRI_GARK_ERK45a; + methods.insert({{"ARKODE_MRI_GARK_FORWARD_EULER", false}, + {"ARKODE_MRI_GARK_ERK22a", false}, + {"ARKODE_MRI_GARK_ERK22b", false}, + {"ARKODE_MRI_GARK_RALSTON2", false}, + {"ARKODE_MIS_KW3", false}, + {"ARKODE_MRI_GARK_ERK33a", false}, + {"ARKODE_MRI_GARK_RALSTON3", false}, + {"ARKODE_MRI_GARK_ERK45a", false}}); } else if (type == MRISTEP_IMPLICIT) { @@ -266,18 +267,11 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, cout << "Test implicit MRI methods\n"; cout << "=========================\n"; - num_methods = 3; - methods = new ARKODE_MRITableID[num_methods]; - stiffly_accurate = new bool[num_methods]; - - 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_ESDIRK46a; - stiffly_accurate[2] = true; + methods.insert({{"ARKODE_MRI_GARK_BACKWARD_EULER", true}, + {"ARKODE_MRI_GARK_IRK21a", true}, + {"ARKODE_MRI_GARK_IMPLICIT_MIDPOINT", false}, + {"ARKODE_MRI_GARK_ESDIRK34a", true}, + {"ARKODE_MRI_GARK_ESDIRK46a", true}}); } else if (type == MRISTEP_IMEX) { @@ -285,31 +279,27 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, cout << "Test IMEX MRI methods\n"; cout << "=====================\n"; - num_methods = 3; - methods = new ARKODE_MRITableID[num_methods]; - stiffly_accurate = new bool[num_methods]; - - 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_GARK4; - stiffly_accurate[2] = false; + methods.insert({{"ARKODE_IMEX_MRI_GARK_EULER", true}, + {"ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL", false}, + {"ARKODE_IMEX_MRI_GARK_MIDPOINT", false}, + {"ARKODE_IMEX_MRI_GARK3a", false}, + {"ARKODE_IMEX_MRI_GARK3b", false}, + {"ARKODE_IMEX_MRI_GARK4", false}}); } else { return 1; } - for (int i = 0; i < num_methods; i++) + for (const auto& pair : methods) { - cout << "\nTesting method " << i << "\n"; + std::string id = pair.first; + bool stiffly_accurate = pair.second; + cout << "\nTesting method " << id << "\n"; // ------------- // Select method // ------------- // Load method table - MRIStepCoupling C = MRIStepCoupling_LoadTable(methods[i]); + MRIStepCoupling C = MRIStepCoupling_LoadTableByName(id.c_str()); if (check_flag((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } MRIStepCoupling_Write(C, stdout); @@ -415,10 +405,12 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, cout << "\nComparing Solver Statistics:\n"; + int nstages_evaluated = nstages_stored; + if (stiffly_accurate) nstages_evaluated--; long int fe_evals = 0; if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { - fe_evals = mri_nst * nstages_stored; + fe_evals = mri_nst * nstages_evaluated; } if (mri_nfse != fe_evals) @@ -430,17 +422,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, long int fi_evals = 0; if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - 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; } + fi_evals = mri_nst * nstages_evaluated + mri_nni; } if (mri_nfsi != fi_evals) @@ -493,8 +475,6 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, SUNMatDestroy(A); } N_VDestroy(y); - delete[] methods; - delete[] stiffly_accurate; return numfails; } 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 5e7243e3e8..e5f2a9b602 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 @@ -12,7 +12,7 @@ Dahlquist ODE test problem: Test explicit MRI methods ========================= -Testing method 0 +Testing method ARKODE_MIS_KW3 nmat = 1 stages = 4 method order (q) = 3 @@ -38,7 +38,57 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 1 +Testing method ARKODE_MRI_GARK_ERK22a + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 1 + W[0] = + 0 0 0 + 0.5 0 0 + -0.5 1 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95647e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK22b + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + -0.5 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95856e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK33a nmat = 2 stages = 4 method order (q) = 3 @@ -70,7 +120,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 2 +Testing method ARKODE_MRI_GARK_ERK45a nmat = 2 stages = 6 method order (q) = 4 @@ -106,28 +156,109 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +Testing method ARKODE_MRI_GARK_FORWARD_EULER + nmat = 1 + stages = 2 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 + W[0] = + 0 0 + 1 0 + + Stored stages = 1 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.9801 + Error = 9.90058e-05 + Steps = 1 + Fe evals = 1 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON2 + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.6666666666666666 1 + W[0] = + 0 0 0 + 0.6666666666666666 0 0 + -0.4166666666666666 0.75 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.9567e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON3 + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.5 0.75 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + -2.75 3 0 0 + 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + 4.5 -4.5 0 0 + -2.166666666666667 -0.5 2.666666666666667 0 + + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.72143e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + ========================= Test implicit MRI methods ========================= -Testing method 0 +Testing method ARKODE_MRI_GARK_BACKWARD_EULER nmat = 1 stages = 3 - method order (q) = 2 + method order (q) = 1 embedding order (p) = 0 c = 0 1 1 G[0] = 0 0 0 1 0 0 - -0.5 0 0.5 + -1 0 1 Stored stages = 2 MRIStep Statistics: Time = 0.01 y(t) = 0.980199 - y_n = 0.980199 - Error = -8.22598e-10 + y_n = 0.980297 + Error = -9.80272e-05 Steps = 1 Fe evals = 0 Fi evals = 2 @@ -140,7 +271,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 1 +Testing method ARKODE_MRI_GARK_ESDIRK34a nmat = 1 stages = 7 method order (q) = 3 @@ -174,7 +305,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 2 +Testing method ARKODE_MRI_GARK_ESDIRK46a nmat = 2 stages = 11 method order (q) = 4 @@ -225,11 +356,72 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.2304e-07 + Steps = 1 + Fe evals = 0 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_IRK21a + 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 + ===================== Test IMEX MRI methods ===================== -Testing method 0 +Testing method ARKODE_IMEX_MRI_GARK3a nmat = 1 stages = 8 method order (q) = 3 @@ -274,7 +466,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 1 +Testing method ARKODE_IMEX_MRI_GARK3b nmat = 1 stages = 8 method order (q) = 3 @@ -319,7 +511,7 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed -Testing method 2 +Testing method ARKODE_IMEX_MRI_GARK4 nmat = 2 stages = 12 method order (q) = 4 @@ -400,5 +592,114 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +Testing method ARKODE_IMEX_MRI_GARK_EULER + nmat = 1 + stages = 3 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + 0 0 0 + + G[0] = + 0 0 0 + 1 0 0 + -1 0 1 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 4.82806e-07 + Steps = 1 + Fe evals = 1 + 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 ARKODE_IMEX_MRI_GARK_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + 0 0 0 0 + -0.5 0 1 0 + + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -8.01486e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 0 0 0 0 + -0.5 0 0.5 0 + + G[0] = + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970447 + Error = -9.8759e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + All tests passed! From 67e9b1458218819038ab709f8f5a730708c3d332 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Sun, 12 May 2024 06:59:07 -0700 Subject: [PATCH 038/137] Bugfix: SPRK Table Create (#472) ARKodeSPRKTable_Create did not allocate coefficient arrays --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/arkode/arkode_sprk.c | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c27937e5a4..59ffc7a35d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,9 @@ Fixed a memory leak when an error handler was added to a `SUNContext`. Fixes [Gi Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes [GitHub Issue #464](https://github.com/LLNL/sundials/issues/464). +Fixed a bug in `ARKodeSPRKTable_Create` where the coefficient arrays where not +allocated. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ef560561bf..a6eef5064e 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -62,3 +62,6 @@ Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHu Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 <https://github.com/LLNL/sundials/issues/466>`_. Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 <https://github.com/LLNL/sundials/issues/464>`_. + +Fixed a bug in :c:func:`ARKodeSPRKTable_Create` where the coefficient arrays +where not allocated. diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index 65d1a07069..974228afd1 100644 --- a/src/arkode/arkode_sprk.c +++ b/src/arkode/arkode_sprk.c @@ -403,16 +403,15 @@ ARKodeSPRKTable ARKodeSymplecticSofroniou10(void) ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, const sunrealtype* a, const sunrealtype* ahat) { - int i = 0; - ARKodeSPRKTable sprk_table = NULL; + if (s < 1 || !a || !ahat) { return NULL; } - sprk_table = (ARKodeSPRKTable)malloc(sizeof(struct ARKodeSPRKTableMem)); + ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(s); if (!sprk_table) { return NULL; } sprk_table->stages = s; sprk_table->q = q; - for (i = 0; i < s; i++) + for (int i = 0; i < s; i++) { sprk_table->a[i] = a[i]; sprk_table->ahat[i] = ahat[i]; From 0e8106eb1c271b5249046e0927dda8142a6cdfb0 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Sun, 12 May 2024 10:06:30 -0700 Subject: [PATCH 039/137] Bugfix: order condition 6s (#473) Fix copy-paste error in order condition 6s --- src/arkode/arkode_butcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index a6321cf16f..f0d4326d39 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -4149,7 +4149,7 @@ static sunbooleantype arkode_butcher_order6s(sunrealtype* b, sunrealtype** A1, free(tmp2); return (SUNFALSE); } - if (arkode_butcher_mv(A2, tmp1, s, tmp2)) + if (arkode_butcher_mv(A3, tmp1, s, tmp2)) { free(tmp1); free(tmp2); From 1c57b7f2ecaa64bb47d83a58e01c694c76acf4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Wed, 15 May 2024 20:06:03 +0200 Subject: [PATCH 040/137] FindKLU.cmake: Avoid detecting MSVC libraries when targeting MinGW (#476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For MinGW, setting the library prefix is not necessary and setting the library suffix to d.lib is incorrect. The static library suffix is .a for MinGW. Prepending those values to the list of library prefixes and suffixes might not actually cause an issue if no libraries are found that match those patterns. But slight ABI differences between MSVC and MinGW could lead to unexpected behavior when mixing binaries of both targets. This was already discussed in https://github.com/LLNL/sundials/pull/407#discussion_r1481939567. But apparently that change got lost in one of the rebases in that PR. --------- Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> --- cmake/tpl/FindKLU.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index 96b9d7343b..a3d817d037 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -46,7 +46,7 @@ if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) endif() # Set library prefixes for Windows -if(WIN32) +if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES d.lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) elseif(APPLE) @@ -95,7 +95,7 @@ endif () if (NOT SUITESPARSECONFIG_LIBRARY) set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) # NOTE: no prefix for this library on windows - if(WIN32 AND NOT MSYS) + if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) set(CMAKE_FIND_LIBRARY_PREFIXES "") endif() find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) From a8564846044ac61a96ad43ae604a033a4a559130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Wed, 15 May 2024 23:48:27 +0200 Subject: [PATCH 041/137] Use `int64_t` for `KLU_INDEXTYPE` if `SUNDIALS_INT64_T` is true. (#477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `long int` is 32 bits wide on systems that use an LLP64 data model (e.g., Windows). Use a type for which the C standard guarantees that it is 64-bit instead (i.e., `int64_t`). See the error in CI for PR #432. Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/sunlinsol/klu/sunlinsol_klu.c | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ffc7a35d..40706c1649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,9 @@ Fixed a CMake bug that caused an MPI linking error for our C++ examples in some Fixed a bug in `ARKodeSPRKTable_Create` where the coefficient arrays where not allocated. +Fix bug on LLP64 platforms (like Windows 64-bit) where `KLU_INDEXTYPE` could be +32 bits wide even if `SUNDIALS_INT64_T` is defined. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index a6eef5064e..4f1e6dbe92 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -65,3 +65,6 @@ Fixed a CMake bug that caused an MPI linking error for our C++ examples in some Fixed a bug in :c:func:`ARKodeSPRKTable_Create` where the coefficient arrays where not allocated. + +Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could be +32 bits wide even if ``SUNDIALS_INT64_T`` is defined. diff --git a/src/sunlinsol/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index cbdaa54135..568dc1d549 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -16,6 +16,7 @@ * the SUNLINSOL package. * -----------------------------------------------------------------*/ +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <sundials/sundials_math.h> @@ -49,7 +50,7 @@ */ #if defined(SUNDIALS_INT64_T) -#define KLU_INDEXTYPE long int +#define KLU_INDEXTYPE int64_t #else #define KLU_INDEXTYPE int #endif From 0b149ccfbb45b5f653200bf53d9a5e6c36f218ea Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 15 May 2024 16:22:47 -0700 Subject: [PATCH 042/137] CI: Use LC template for gitlab id tokens and limit github actions push events (#479) Addresses https://hpc.llnl.gov/technical-bulletins/bulletin-568 and also limits our github action workflows to only run on push to certain branches. --- .github/workflows/double-precision.yml | 3 +++ .github/workflows/extended-precision.yml | 4 ++++ .github/workflows/single-precision.yml | 4 ++++ .gitlab-ci.yml | 2 ++ 4 files changed, 13 insertions(+) diff --git a/.github/workflows/double-precision.yml b/.github/workflows/double-precision.yml index b0ca087ef4..cda708a4a9 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/double-precision.yml @@ -3,6 +3,9 @@ name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs) on: push: + branches: + - main + - develop pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml index 51678b6e70..2c521b2fad 100644 --- a/.github/workflows/extended-precision.yml +++ b/.github/workflows/extended-precision.yml @@ -2,6 +2,10 @@ name: Build and Test - Ubuntu/gcc extended precision (TPLs, no GPUs) on: + push: + branches: + - main + - develop pull_request: merge_group: workflow_dispatch: diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml index 30a53b0402..d986643256 100644 --- a/.github/workflows/single-precision.yml +++ b/.github/workflows/single-precision.yml @@ -2,6 +2,10 @@ name: Build and Test - Ubuntu/gcc single precision (TPLs, no GPUs) on: + push: + branches: + - main + - develop pull_request: merge_group: workflow_dispatch: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63622ebb08..c02b239373 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -126,6 +126,8 @@ stages: # This is where jobs are included. include: + - project: 'lc-templates/id_tokens' + file: 'id_tokens.yml' - local: .gitlab/quartz-templates.yml - local: .gitlab/quartz-jobs.yml - local: .gitlab/lassen-templates.yml From 65d0b2b7f797e5ff739554d5e937fcbbe2334eb4 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 16 May 2024 07:23:57 -0700 Subject: [PATCH 043/137] Fix promotion of double to sunrealtype identified with -Wdouble-promotion (#483) --- src/arkode/arkode.c | 6 +++--- src/arkode/arkode_io.c | 2 +- src/arkode/arkode_sprk.c | 13 +++++++------ src/cvodes/cvodea.c | 2 +- src/sundials/sundials_band.c | 2 +- src/sundials/sundials_dense.c | 2 +- src/sunmatrix/sparse/sunmatrix_sparse.c | 6 +++--- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 098d0756c6..cddd647a34 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -2816,8 +2816,8 @@ int arkPredict_MaximumOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { int ord; - sunrealtype tau_tol = 0.5; - sunrealtype tau_tol2 = 0.75; + sunrealtype tau_tol = HALF; + sunrealtype tau_tol2 = SUN_RCONST(0.75); /* verify that ark_mem and interpolation structure are provided */ if (ark_mem == NULL) @@ -2854,7 +2854,7 @@ int arkPredict_VariableOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess int arkPredict_CutoffOrder(ARKodeMem ark_mem, sunrealtype tau, N_Vector yguess) { int ord; - sunrealtype tau_tol = 0.5; + sunrealtype tau_tol = HALF; /* verify that ark_mem and interpolation structure are provided */ if (ark_mem == NULL) diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 291a61ec35..c1d73c866c 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -1588,7 +1588,7 @@ int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) /* set allowed value, otherwise set default */ if (bias < ONE) { - retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, -1.0); + retval = SUNAdaptController_SetErrorBias(hadapt_mem->hcontroller, -ONE); } else { diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index 974228afd1..c5e17837ab 100644 --- a/src/arkode/arkode_sprk.c +++ b/src/arkode/arkode_sprk.c @@ -136,8 +136,8 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) if (!sprk_table) { return NULL; } sprk_table->q = 2; sprk_table->stages = 2; - sprk_table->a[1] = SUN_RCONST(1.0) - - (SUN_RCONST(1.0) / SUN_RCONST(2.0)) * SUNRsqrt(2.0); + sprk_table->a[1] = SUN_RCONST(1.0) - (SUN_RCONST(1.0) / SUN_RCONST(2.0)) * + SUNRsqrt(SUN_RCONST(2.0)); sprk_table->a[0] = SUN_RCONST(1.0) - sprk_table->a[1]; sprk_table->ahat[1] = SUN_RCONST(1.0) / (SUN_RCONST(2.0) * (SUN_RCONST(1.0) - sprk_table->a[1])); @@ -147,9 +147,9 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) { - sunrealtype w = 0.0; - sunrealtype y = 0.0; - sunrealtype z = 0.0; + sunrealtype w = SUN_RCONST(0.0); + sunrealtype y = SUN_RCONST(0.0); + sunrealtype z = SUN_RCONST(0.0); ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(3); if (!sprk_table) { return NULL; } @@ -157,7 +157,8 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) sprk_table->stages = 3; z = -SUNRpowerR((SUN_RCONST(2.0) / SUN_RCONST(27.0)) - - SUN_RCONST(1.0) / (SUN_RCONST(9.0) * SUNRsqrt(3.0)), + SUN_RCONST(1.0) / + (SUN_RCONST(9.0) * SUNRsqrt(SUN_RCONST(3.0))), SUN_RCONST(1.0) / SUN_RCONST(3.0)); w = -SUN_RCONST(2.0) / SUN_RCONST(3.0) + SUN_RCONST(1.0) / (SUN_RCONST(9.0) * z) + z; diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index fd4ae06f97..2df97cf712 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -1793,7 +1793,7 @@ static CVckpntMem CVAckpntInit(CVodeMem cv_mem) ck_mem->ck_t0 = cv_mem->cv_tn; ck_mem->ck_nst = 0; ck_mem->ck_q = 1; - ck_mem->ck_h = 0.0; + ck_mem->ck_h = ZERO; /* Do we need to carry quadratures */ ck_mem->ck_quadr = cv_mem->cv_quadr && cv_mem->cv_errconQ; diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index e8051d80c1..4124c701ea 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -322,7 +322,7 @@ void SUNDlsMat_bandMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype i, j, is, ie; sunrealtype* col_j; - for (i = 0; i < n; i++) { y[i] = 0.0; } + for (i = 0; i < n; i++) { y[i] = ZERO; } for (j = 0; j < n; j++) { diff --git a/src/sundials/sundials_dense.c b/src/sundials/sundials_dense.c index f022212f9c..f037fefbdf 100644 --- a/src/sundials/sundials_dense.c +++ b/src/sundials/sundials_dense.c @@ -502,7 +502,7 @@ void SUNDlsMat_denseMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype i, j; sunrealtype* col_j; - for (i = 0; i < m; i++) { y[i] = 0.0; } + for (i = 0; i < m; i++) { y[i] = ZERO; } for (j = 0; j < n; j++) { diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index 96754afbd6..18d644dba5 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -1187,7 +1187,7 @@ SUNErrCode Matvec_SparseCSC(SUNMatrix A, N_Vector x, N_Vector y) SUNCheckLastErr(); /* initialize result */ - for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = 0.0; } + for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = ZERO; } /* iterate through matrix columns */ for (j = 0; j < SM_COLUMNS_S(A); j++) @@ -1230,7 +1230,7 @@ SUNErrCode Matvec_SparseCSR(SUNMatrix A, N_Vector x, N_Vector y) SUNAssert(yd, SUN_ERR_ARG_CORRUPT); SUNAssert(xd != yd, SUN_ERR_ARG_CORRUPT); /* initialize result */ - for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = 0.0; } + for (i = 0; i < SM_ROWS_S(A); i++) { yd[i] = ZERO; } /* iterate through matrix rows */ for (i = 0; i < SM_ROWS_S(A); i++) @@ -1298,7 +1298,7 @@ SUNErrCode format_convert(const SUNMatrix A, SUNMatrix B) sunindextype jj; for (jj = Ap[row]; jj < Ap[row + 1]; jj++) { - sunindextype col = Aj[jj]; + col = Aj[jj]; sunindextype dest = Bp[col]; Bi[dest] = row; From 4eed309f00d678d2aeb48f73061a4be7b8457e87 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 16 May 2024 07:24:48 -0700 Subject: [PATCH 044/137] Fix casting warnings identified with -Wcast-qual flag (#482) --- src/sundials/sundials_hashmap.c | 12 +++++++----- src/sundials/sundials_hashmap_impl.h | 3 ++- src/sundials/sundials_profiler.c | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/sundials/sundials_hashmap.c b/src/sundials/sundials_hashmap.c index 55c786b34f..a2a2fc3764 100644 --- a/src/sundials/sundials_hashmap.c +++ b/src/sundials/sundials_hashmap.c @@ -140,7 +140,8 @@ SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, void (*freevalue)(void* ptr)) * ``<-1`` -- an error occurred */ int SUNHashMap_Iterate(SUNHashMap map, int start, - int (*yieldfn)(int, SUNHashMapKeyValue, void*), void* ctx) + int (*yieldfn)(int, SUNHashMapKeyValue, const void*), + const void* ctx) { int i; @@ -159,7 +160,8 @@ int SUNHashMap_Iterate(SUNHashMap map, int start, return (map->max_size); } -static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, void* ctx) +static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, + const void* ctx) { /* find the next open spot */ if (kv == NULL) { return (idx); /* open spot found at idx */ } @@ -216,7 +218,8 @@ int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value) return (0); } -static int sunHashMapLinearProbeGet(int idx, SUNHashMapKeyValue kv, void* key) +static int sunHashMapLinearProbeGet(int idx, SUNHashMapKeyValue kv, + const void* key) { /* target key cannot be NULL */ if (key == NULL) { return (-2); } @@ -260,8 +263,7 @@ int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value) if (strcmp(map->buckets[idx]->key, key)) { /* Keys did not match, so we have a collision and need to probe */ - retval = SUNHashMap_Iterate(map, idx + 1, sunHashMapLinearProbeGet, - (void*)key); + retval = SUNHashMap_Iterate(map, idx + 1, sunHashMapLinearProbeGet, key); if (retval < 0) { return (-1); /* error occurred */ } if (retval == map->max_size) { return (-2); /* not found */ } } diff --git a/src/sundials/sundials_hashmap_impl.h b/src/sundials/sundials_hashmap_impl.h index 7fc743a2f3..235947ed71 100644 --- a/src/sundials/sundials_hashmap_impl.h +++ b/src/sundials/sundials_hashmap_impl.h @@ -43,7 +43,8 @@ struct SUNHashMap_ SUNErrCode SUNHashMap_New(int max_size, SUNHashMap* map); SUNErrCode SUNHashMap_Destroy(SUNHashMap* map, void (*freevalue)(void* ptr)); int SUNHashMap_Iterate(SUNHashMap map, int start, - int (*yieldfn)(int, SUNHashMapKeyValue, void*), void* ctx); + int (*yieldfn)(int, SUNHashMapKeyValue, const void*), + const void* ctx); int SUNHashMap_Insert(SUNHashMap map, const char* key, void* value); int SUNHashMap_GetValue(SUNHashMap map, const char* key, void** value); SUNErrCode SUNHashMap_Sort(SUNHashMap map, SUNHashMapKeyValue** sorted, diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index 4a2e12e783..1ac2b30aee 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -543,8 +543,8 @@ int sunCompareTimes(const void* l, const void* r) double left_max; double right_max; - const SUNHashMapKeyValue left = *((SUNHashMapKeyValue*)l); - const SUNHashMapKeyValue right = *((SUNHashMapKeyValue*)r); + const SUNHashMapKeyValue left = *((const SUNHashMapKeyValue*)l); + const SUNHashMapKeyValue right = *((const SUNHashMapKeyValue*)r); if (left == NULL && right == NULL) { return 0; } if (left == NULL) { return 1; } From 363bc95cce64ed577d250a6f00a410b29c087810 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 16 May 2024 12:44:41 -0700 Subject: [PATCH 045/137] CI: Combine actions (#486) Combine some actions so it's easier to trigger all the tests manually --- .github/workflows/extended-precision.yml | 52 ------------------- .github/workflows/single-precision.yml | 52 ------------------- ...double-precision.yml => ubuntu-latest.yml} | 19 +++++-- 3 files changed, 16 insertions(+), 107 deletions(-) delete mode 100644 .github/workflows/extended-precision.yml delete mode 100644 .github/workflows/single-precision.yml rename .github/workflows/{double-precision.yml => ubuntu-latest.yml} (71%) diff --git a/.github/workflows/extended-precision.yml b/.github/workflows/extended-precision.yml deleted file mode 100644 index 2c521b2fad..0000000000 --- a/.github/workflows/extended-precision.yml +++ /dev/null @@ -1,52 +0,0 @@ -# -name: Build and Test - Ubuntu/gcc extended precision (TPLs, no GPUs) - -on: - push: - branches: - - main - - develop - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - -jobs: - build_and_test: - runs-on: ubuntu-latest - container: - image: ghcr.io/llnl/sundials-ci-int${{ matrix.indexsize }}-${{ matrix.precision }}:latest - options: --user root - strategy: - matrix: - indexsize: [32, 64] - precision: ['extended'] - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: true - - name: Run test_driver.sh - uses: ./.github/actions/test-driver - with: - indexsize: ${{ matrix.indexsize }} - precision: ${{ matrix.precision }} - - name: Archive build files from failed build - uses: actions/upload-artifact@v3 - if: failure() - with: - name: build_files - path: | - ${{ github.workspace }}/test/build_* - !${{ github.workspace }}/test/build_*/Testing/output - - name: Archive output files from failed build - uses: actions/upload-artifact@v3 - if: failure() - with: - name: output_files - path: | - ${{ github.workspace }}/test/build_*/Testing/ - \ No newline at end of file diff --git a/.github/workflows/single-precision.yml b/.github/workflows/single-precision.yml deleted file mode 100644 index d986643256..0000000000 --- a/.github/workflows/single-precision.yml +++ /dev/null @@ -1,52 +0,0 @@ -# -name: Build and Test - Ubuntu/gcc single precision (TPLs, no GPUs) - -on: - push: - branches: - - main - - develop - pull_request: - merge_group: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - -jobs: - build_and_test: - runs-on: ubuntu-latest - container: - image: ghcr.io/llnl/sundials-ci-int${{ matrix.indexsize }}-${{ matrix.precision }}:latest - options: --user root - strategy: - matrix: - indexsize: [32, 64] - precision: ['single'] - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: true - - name: Run test_driver.sh - uses: ./.github/actions/test-driver - with: - indexsize: ${{ matrix.indexsize }} - precision: ${{ matrix.precision }} - - name: Archive build files from failed build - uses: actions/upload-artifact@v3 - if: failure() - with: - name: build_files - path: | - ${{ github.workspace }}/test/build_* - !${{ github.workspace }}/test/build_*/Testing/output - - name: Archive output files from failed build - uses: actions/upload-artifact@v3 - if: failure() - with: - name: output_files - path: | - ${{ github.workspace }}/test/build_*/Testing/ - \ No newline at end of file diff --git a/.github/workflows/double-precision.yml b/.github/workflows/ubuntu-latest.yml similarity index 71% rename from .github/workflows/double-precision.yml rename to .github/workflows/ubuntu-latest.yml index cda708a4a9..f9f24a5dd0 100644 --- a/.github/workflows/double-precision.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -1,5 +1,5 @@ # -name: Build and Test - Ubuntu/gcc double precision (TPLs, no GPUs) +name: Build and Test - Ubuntu/gcc (TPLs, no GPUs) on: push: @@ -24,8 +24,21 @@ jobs: max-parallel: 2 matrix: indexsize: [32, 64] - precision: ['double'] - buildtype: ['Debug', 'Release'] + # Disable extended tests until compiler warnings are addressed + precision: ['single', 'double'] + buildtype: ['Debug', 'Release', 'RelWithDebInfo'] + exclude: + - buildtype: Debug + precision: single + # - buildtype: Debug + # precision: extended + - buildtype: Release + precision: single + # - buildtype: Release + # precision: extended + - buildtype: RelWithDebInfo + precision: double + steps: - name: Checkout repository uses: actions/checkout@v3 From 932658e3b9b8e1952e59a7a5313f981894fac8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Thu, 16 May 2024 21:45:23 +0200 Subject: [PATCH 046/137] CI (mingw): Install and build with SuiteSparse library (#432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSYS2 follows a rolling release model. I.e., most of its packages are quite new most of the time. Adding the SuiteSparse libraries in the CI tests for MSYS2 might help to detect potentially API changes early. Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> --- .github/workflows/windows-latest-mingw.yml | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index beb55d1efe..52cacd8504 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -14,27 +14,46 @@ env: BUILD_TYPE: Release jobs: - buil_and_test: + build_and_test: runs-on: windows-latest + defaults: + run: + # Use MSYS2 as default shell + shell: msys2 {0} + steps: - uses: actions/checkout@v3 - uses: msys2/setup-msys2@v2 with: msystem: mingw64 + update: true + release: false + install: >- + base-devel + mingw-w64-x86_64-cmake + mingw-w64-x86_64-cc + mingw-w64-x86_64-openblas + mingw-w64-x86_64-suitesparse - 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 -G "MinGW Makefiles" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_LOGGING_LEVEL=2 -DSUNDIALS_TEST_UNITTESTS=OFF -DEXAMPLES_ENABLE_CXX=ON + # Configure CMake in a 'build' subdirectory + run: | + cmake \ + -B ${GITHUB_WORKSPACE}/build \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DSUNDIALS_BUILD_WITH_PROFILING=ON \ + -DSUNDIALS_LOGGING_LEVEL=2 \ + -DSUNDIALS_TEST_UNITTESTS=OFF \ + -DEXAMPLES_ENABLE_CXX=ON \ + -DENABLE_KLU=ON - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + # Build your program + run: cmake --build ${GITHUB_WORKSPACE}/build - 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}} + # Execute tests + run: ctest From 5e2e70e3ae68e205a14dac66833d26289249e95a Mon Sep 17 00:00:00 2001 From: Adrien Delsalle <ad.delsalle@gmail.com> Date: Fri, 17 May 2024 00:50:27 +0200 Subject: [PATCH 047/137] Disambiguate shared and static libs `.lib` files on Windows using MSVC (#455) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description --- Disambiguate shared and static libs `.lib` files on Windows using MSVC Suffix library output name with `_static` when building both static and shared libs on Windows Closes #454 --------- Co-authored-by: Markus Mützel <markus.muetzel@gmx.de> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 4 ++++ cmake/macros/SundialsAddLibrary.cmake | 19 +++++++++++++------ doc/shared/RecentChanges.rst | 4 ++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40706c1649..fcf9091a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Changes to SUNDIALS in release X.Y.Z +Fixed conflicting `.lib` files between shared and static libs when using `MSVC` on Windows + +Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and static libs + Created shared user interface for ARKODE user-callable routines, to allow more uniform control over time-stepping algorithms, improved extensibility, and simplified code maintenance. Marked the corresponding stepper-specific diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index ca0d226191..3c66bbe7e3 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -200,7 +200,7 @@ macro(sundials_add_library target) # add compile definitions to object library for SUNDIALS_EXPORT if(${_libtype} MATCHES "STATIC") - target_compile_definitions(${obj_target} PRIVATE SUNDIALS_STATIC_DEFINE) + target_compile_definitions(${obj_target} PUBLIC SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() @@ -296,7 +296,7 @@ macro(sundials_add_library target) # add compile definitions for SUNDIALS_EXPORT if(${_libtype} MATCHES "STATIC") - target_compile_definitions(${_actual_target_name} PRIVATE SUNDIALS_STATIC_DEFINE) + target_compile_definitions(${_actual_target_name} PUBLIC SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() @@ -325,10 +325,17 @@ macro(sundials_add_library target) # set the correct output name if(sundials_add_library_OUTPUT_NAME) - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} - CLEAN_DIRECT_OUTPUT 1 - ) + if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) AND ${_libtype} MATCHES "STATIC") + set_target_properties(${_actual_target_name} PROPERTIES + OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static" + CLEAN_DIRECT_OUTPUT 1 + ) + else() + set_target_properties(${_actual_target_name} PROPERTIES + OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} + CLEAN_DIRECT_OUTPUT 1 + ) + endif() else() set_target_properties(${_actual_target_name} PROPERTIES OUTPUT_NAME ${target} diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 4f1e6dbe92..6b3cb4f270 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -37,6 +37,10 @@ Added the following MRI coupling tables **Bug Fixes** +Fixed conflicting ``.lib`` files between shared and static libs when using ``MSVC`` on Windows + +Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and static libs + Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). From 77db64447f75538e1d639d112fba926a18b06da9 Mon Sep 17 00:00:00 2001 From: Julien Schueller <schueller@phimeca.com> Date: Fri, 17 May 2024 05:57:11 +0200 Subject: [PATCH 048/137] CMake: Fix dll install location (#475) This fixes dll search on conda where dlls are expected to be installed in prefix/bin (pretty standard layout) static or import libs still go to prefix/lib Signed-off-by: Julien Schueller <schueller@phimeca.com> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 8 ++++++-- cmake/macros/SundialsAddLibrary.cmake | 2 +- doc/shared/RecentChanges.rst | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf9091a19..03754be282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ ## Changes to SUNDIALS in release X.Y.Z -Fixed conflicting `.lib` files between shared and static libs when using `MSVC` on Windows +Fixed the runtime library installation path for windows systems. This fix changes the +default library installation path from `CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR` to +`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR`. -Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and static libs +Fixed conflicting `.lib` files between shared and static libs when using `MSVC` on Windows. + +Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and static libs. Created shared user interface for ARKODE user-callable routines, to allow more uniform control over time-stepping algorithms, improved extensibility, and diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 3c66bbe7e3..84505e4f12 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -362,7 +362,7 @@ macro(sundials_add_library target) endif() # install phase - install(TARGETS ${_actual_target_name} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT sundials-targets) + install(TARGETS ${_actual_target_name} EXPORT sundials-targets) endif() diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 6b3cb4f270..3d7025d7ac 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,5 +1,9 @@ **New Features** +Fixed the runtime library installation path for windows systems. This fix changes the +default library installation path from ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``. + Created shared user interface for ARKODE user-callable routines, to allow more uniform control over time-stepping algorithms, improved extensibility, and simplified code maintenance. Marked the corresponding stepper-specific From cbbaca362c7d36e8560360b3aa4c9131e6f5b620 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 17 May 2024 05:54:25 -0700 Subject: [PATCH 049/137] Fix missing statics and dead code identified with -Wmissing-declarations (#481) Co-authored-by: David Gardner <gardner48@llnl.gov> Co-authored-by: Cody Balos <balos1@llnl.gov> --- .../SUNAdaptController_Description.rst | 17 +++ .../C_serial/ark_damped_harmonic_symplectic.c | 4 +- .../arkode/C_serial/ark_harmonic_symplectic.h | 6 +- examples/arkode/C_serial/ark_kepler.h | 11 +- include/sundials/sundials_adaptcontroller.h | 4 + src/arkode/arkode_relaxation.c | 4 +- src/arkode/arkode_sprk.c | 72 ++++++------- src/arkode/arkode_sprkstep_io.c | 15 --- src/ida/ida_ic.c | 2 - src/idas/idas_ic.c | 7 -- src/nvector/manyvector/nvector_manyvector.c | 3 - src/sundials/sundials_band.c | 61 ----------- src/sundials/sundials_dense.c | 100 ------------------ src/sundials/sundials_direct.c | 59 ----------- 14 files changed, 70 insertions(+), 295 deletions(-) diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index c5c02ceb44..9c6e791a7f 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -123,6 +123,23 @@ 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:: void SUNAdaptController_DestroyEmpty(SUNAdaptController C) + + This routine frees the generic ``SUNAdaptController`` object, under the + assumption that any implementation-specific data that was allocated within the + underlying content structure has already been freed. It will additionally test + whether the ops pointer is ``NULL``, and, if it is not, it will free it as + well. + + :param C: the :c:type:`SUNAdaptController` object. + :return: :c:type:`SUNErrCode` indicating success or failure. + + Usage: + + .. code-block:: c + + retval = SUNAdaptController_DestroyEmpty(C); + .. c:function:: SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C) Returns the type identifier for the controller *C*. Returned values diff --git a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c index 8bfca224ed..ec3b797928 100644 --- a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c +++ b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c @@ -157,9 +157,9 @@ int main(int argc, char* argv[]) return 0; } -sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } +static sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } -sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); } +static sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); } sunrealtype Hamiltonian(N_Vector yvec, sunrealtype t) { diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.h b/examples/arkode/C_serial/ark_harmonic_symplectic.h index 816961e6e5..498c4eb0d1 100644 --- a/examples/arkode/C_serial/ark_harmonic_symplectic.h +++ b/examples/arkode/C_serial/ark_harmonic_symplectic.h @@ -34,7 +34,7 @@ typedef struct sunrealtype dt; } ProgramArgs; -void PrintHelp(void) +static void PrintHelp(void) { fprintf(stderr, "ark_harmonic_symplectic: an ARKODE example demonstrating " "the SPRKStep time-stepping module solving a simple harmonic " @@ -48,7 +48,7 @@ void PrintHelp(void) /* clang-format on */ } -int ParseArgs(int argc, char* argv[], ProgramArgs* args) +static int ParseArgs(int argc, char* argv[], ProgramArgs* args) { int argi = 0; @@ -110,7 +110,7 @@ int ParseArgs(int argc, char* argv[], ProgramArgs* args) opt == 2 means function allocates memory so check if returned NULL pointer */ -int check_retval(void* returnvalue, const char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/arkode/C_serial/ark_kepler.h b/examples/arkode/C_serial/ark_kepler.h index 01f40f26b5..d487347466 100644 --- a/examples/arkode/C_serial/ark_kepler.h +++ b/examples/arkode/C_serial/ark_kepler.h @@ -37,11 +37,12 @@ typedef struct const char* method_name; } ProgramArgs; -int ComputeConvergence(int num_dt, sunrealtype* orders, - sunrealtype expected_order, sunrealtype a11, - sunrealtype a12, sunrealtype a21, sunrealtype a22, - sunrealtype b1, sunrealtype b2, sunrealtype* ord_avg, - sunrealtype* ord_max, sunrealtype* ord_est) +static int ComputeConvergence(int num_dt, sunrealtype* orders, + sunrealtype expected_order, sunrealtype a11, + sunrealtype a12, sunrealtype a21, sunrealtype a22, + sunrealtype b1, sunrealtype b2, + sunrealtype* ord_avg, sunrealtype* ord_max, + sunrealtype* ord_est) { /* Compute/print overall estimated convergence rate */ int i = 0; diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index 9cde03bfa4..b27d7c73c8 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -91,6 +91,10 @@ struct _generic_SUNAdaptController SUNDIALS_EXPORT SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx); +/* Function to free a generic SUNAdaptController (assumes content is already empty) */ +SUNDIALS_EXPORT +void SUNAdaptController_DestroyEmpty(SUNAdaptController C); + /* Function to report the type of a SUNAdaptController object. */ SUNDIALS_EXPORT SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C); diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index 451fa6711a..b824bbfb9c 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -336,8 +336,8 @@ static int arkRelaxBrentSolve(ARKodeMem ark_mem) } /* Compute and apply relaxation parameter */ -int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, - sunrealtype* relax_val_out) +static int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, + sunrealtype* relax_val_out) { int retval; diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index c5e17837ab..a7d0349416 100644 --- a/src/arkode/arkode_sprk.c +++ b/src/arkode/arkode_sprk.c @@ -23,7 +23,7 @@ #include "arkode/arkode_butcher.h" #include "arkode_impl.h" -ARKodeSPRKTable ARKodeSymplecticEuler(void) +static ARKodeSPRKTable arkodeSymplecticEuler(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(1); if (!sprk_table) { return NULL; } @@ -43,7 +43,7 @@ ARKodeSPRKTable ARKodeSymplecticEuler(void) https://doi.org/10.1016/0021-9991(91)90299-Z. */ -ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) +static ARKodeSPRKTable arkodeSymplecticLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -56,7 +56,7 @@ ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) +static ARKodeSPRKTable arkodeSymplecticPseudoLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -69,7 +69,7 @@ ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) +static ARKodeSPRKTable arkodeSymplecticCandyRozmus4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -108,7 +108,7 @@ ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) https://accelconf.web.cern.ch/p83/PDF/PAC1983_2669.PDF */ -ARKodeSPRKTable ARKodeSymplecticRuth3(void) +static ARKodeSPRKTable arkodeSymplecticRuth3(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(3); if (!sprk_table) { return NULL; } @@ -130,7 +130,7 @@ ARKodeSPRKTable ARKodeSymplecticRuth3(void) Nonlinearity. 5, 541–562 (1992). https://doi.org/10.1088/0951-7715/5/2/011 */ -ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) +static ARKodeSPRKTable arkodeSymplecticMcLachlan2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -145,7 +145,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) +static ARKodeSPRKTable arkodeSymplecticMcLachlan3(void) { sunrealtype w = SUN_RCONST(0.0); sunrealtype y = SUN_RCONST(0.0); @@ -175,7 +175,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) +static ARKodeSPRKTable arkodeSymplecticMcLachlan4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -192,7 +192,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) +static ARKodeSPRKTable arkodeSymplecticMcLachlan5(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(6); if (!sprk_table) { return NULL; } @@ -222,7 +222,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) */ -ARKodeSPRKTable ARKodeSymplecticYoshida6(void) +static ARKodeSPRKTable arkodeSymplecticYoshida6(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(8); if (!sprk_table) { return NULL; } @@ -261,7 +261,7 @@ ARKodeSPRKTable ARKodeSymplecticYoshida6(void) */ -ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) +static ARKodeSPRKTable arkodeSymplecticSuzukiUmeno816(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(16); if (!sprk_table) { return NULL; } @@ -311,7 +311,7 @@ ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) */ -ARKodeSPRKTable ARKodeSymplecticSofroniou10(void) +static ARKodeSPRKTable arkodeSymplecticSofroniou10(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(36); if (!sprk_table) { return NULL; } @@ -453,19 +453,19 @@ ARKodeSPRKTable ARKodeSPRKTable_Load(ARKODE_SPRKMethodID id) { switch (id) { - case ARKODE_SPRK_EULER_1_1: return ARKodeSymplecticEuler(); - case ARKODE_SPRK_LEAPFROG_2_2: return ARKodeSymplecticLeapfrog2(); + case ARKODE_SPRK_EULER_1_1: return arkodeSymplecticEuler(); + case ARKODE_SPRK_LEAPFROG_2_2: return arkodeSymplecticLeapfrog2(); case ARKODE_SPRK_PSEUDO_LEAPFROG_2_2: - return ARKodeSymplecticPseudoLeapfrog2(); - case ARKODE_SPRK_RUTH_3_3: return ARKodeSymplecticRuth3(); - case ARKODE_SPRK_MCLACHLAN_2_2: return ARKodeSymplecticMcLachlan2(); - case ARKODE_SPRK_MCLACHLAN_3_3: return ARKodeSymplecticMcLachlan3(); - case ARKODE_SPRK_MCLACHLAN_4_4: return ARKodeSymplecticMcLachlan4(); - case ARKODE_SPRK_CANDY_ROZMUS_4_4: return ARKodeSymplecticCandyRozmus4(); - case ARKODE_SPRK_MCLACHLAN_5_6: return ARKodeSymplecticMcLachlan5(); - case ARKODE_SPRK_YOSHIDA_6_8: return ARKodeSymplecticYoshida6(); - case ARKODE_SPRK_SUZUKI_UMENO_8_16: return ARKodeSymplecticSuzukiUmeno816(); - case ARKODE_SPRK_SOFRONIOU_10_36: return ARKodeSymplecticSofroniou10(); + return arkodeSymplecticPseudoLeapfrog2(); + case ARKODE_SPRK_RUTH_3_3: return arkodeSymplecticRuth3(); + case ARKODE_SPRK_MCLACHLAN_2_2: return arkodeSymplecticMcLachlan2(); + case ARKODE_SPRK_MCLACHLAN_3_3: return arkodeSymplecticMcLachlan3(); + case ARKODE_SPRK_MCLACHLAN_4_4: return arkodeSymplecticMcLachlan4(); + case ARKODE_SPRK_CANDY_ROZMUS_4_4: return arkodeSymplecticCandyRozmus4(); + case ARKODE_SPRK_MCLACHLAN_5_6: return arkodeSymplecticMcLachlan5(); + case ARKODE_SPRK_YOSHIDA_6_8: return arkodeSymplecticYoshida6(); + case ARKODE_SPRK_SUZUKI_UMENO_8_16: return arkodeSymplecticSuzukiUmeno816(); + case ARKODE_SPRK_SOFRONIOU_10_36: return arkodeSymplecticSofroniou10(); default: return NULL; } } @@ -474,51 +474,51 @@ ARKodeSPRKTable ARKodeSPRKTable_LoadByName(const char* method) { if (!strcmp(method, "ARKODE_SPRK_EULER_1_1")) { - return ARKodeSymplecticEuler(); + return arkodeSymplecticEuler(); } if (!strcmp(method, "ARKODE_SPRK_LEAPFROG_2_2")) { - return ARKodeSymplecticLeapfrog2(); + return arkodeSymplecticLeapfrog2(); } if (!strcmp(method, "ARKODE_SPRK_PSEUDO_LEAPFROG_2_2")) { - return ARKodeSymplecticPseudoLeapfrog2(); + return arkodeSymplecticPseudoLeapfrog2(); } if (!strcmp(method, "ARKODE_SPRK_RUTH_3_3")) { - return ARKodeSymplecticRuth3(); + return arkodeSymplecticRuth3(); } if (!strcmp(method, "ARKODE_SPRK_MCLACHLAN_2_2")) { - return ARKodeSymplecticMcLachlan2(); + return arkodeSymplecticMcLachlan2(); } if (!strcmp(method, "ARKODE_SPRK_MCLACHLAN_3_3")) { - return ARKodeSymplecticMcLachlan3(); + return arkodeSymplecticMcLachlan3(); } if (!strcmp(method, "ARKODE_SPRK_MCLACHLAN_4_4")) { - return ARKodeSymplecticMcLachlan4(); + return arkodeSymplecticMcLachlan4(); } if (!strcmp(method, "ARKODE_SPRK_CANDY_ROZMUS_4_4")) { - return ARKodeSymplecticCandyRozmus4(); + return arkodeSymplecticCandyRozmus4(); } if (!strcmp(method, "ARKODE_SPRK_MCLACHLAN_5_6")) { - return ARKodeSymplecticMcLachlan5(); + return arkodeSymplecticMcLachlan5(); } if (!strcmp(method, "ARKODE_SPRK_YOSHIDA_6_8")) { - return ARKodeSymplecticYoshida6(); + return arkodeSymplecticYoshida6(); } if (!strcmp(method, "ARKODE_SPRK_SUZUKI_UMENO_8_16")) { - return ARKodeSymplecticSuzukiUmeno816(); + return arkodeSymplecticSuzukiUmeno816(); } if (!strcmp(method, "ARKODE_SPRK_SOFRONIOU_10_36")) { - return ARKodeSymplecticSofroniou10(); + return arkodeSymplecticSofroniou10(); } return NULL; } diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index f8ccd8bfb2..88378f14ca 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -414,16 +414,6 @@ int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); } -void SPRKStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} - -int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) -{ - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} - int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) { return (ARKodeWriteParameters(arkode_mem, fp)); @@ -436,11 +426,6 @@ int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } -int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} - void SPRKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } /*=============================================================== diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index f1a0dacaf0..2d44eab573 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -58,8 +58,6 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - sunbooleantype mask); static int IDAnlsIC(IDAMem IDA_mem); static int IDANewtonIC(IDAMem IDA_mem); diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index 783a75a3bb..c2f4d030ba 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -58,13 +58,6 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - sunbooleantype mask); -extern sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector* xS, N_Vector* wS, - sunbooleantype mask); -extern sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, - N_Vector* xS, N_Vector* wS, - sunbooleantype mask); extern int IDASensEwtSet(IDAMem IDA_mem, N_Vector* yScur, N_Vector* weightS); diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index 2785ee7b91..d52cc4fee7 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -595,9 +595,6 @@ MPI_Comm N_VGetCommunicator_MPIManyVector(N_Vector v) { return (MANYVECTOR_COMM(v)); } -#else -/* This function retrieves the MPI Communicator from a ManyVector object. */ -SUNComm N_VGetCommunicator_ManyVector(N_Vector v) { return SUN_COMM_NULL; } #endif /* This function retrieves the global length of a ManyVector object. */ diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index 4124c701ea..d5fbcbb6a6 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -38,64 +38,33 @@ sunindextype SUNDlsMat_BandGBTRF(SUNDlsMat A, sunindextype* p) return (SUNDlsMat_bandGBTRF(A->cols, A->M, A->mu, A->ml, A->s_mu, p)); } -sunindextype BandGBTRF(SUNDlsMat A, sunindextype* p) -{ - return (SUNDlsMat_bandGBTRF(A->cols, A->M, A->mu, A->ml, A->s_mu, p)); -} - void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) { SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); } -void BandGBTRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); -} - void SUNDlsMat_BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml) { SUNDlsMat_bandCopy(A->cols, B->cols, A->M, A->s_mu, B->s_mu, copymu, copyml); } -void BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml) -{ - SUNDlsMat_bandCopy(A->cols, B->cols, A->M, A->s_mu, B->s_mu, copymu, copyml); -} - void SUNDlsMat_BandScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); } -void BandScale(sunrealtype c, SUNDlsMat A) -{ - SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); -} - void SUNDlsMat_BandMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) { SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); } -void BandMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) -{ - SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); -} - /* * ----------------------------------------------------- * Functions working on sunrealtype** * ----------------------------------------------------- */ -sunindextype bandGBTRF(sunrealtype** a, sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu, sunindextype* p) -{ - return (SUNDlsMat_bandGBTRF(a, n, mu, ml, smu, p)); -} - sunindextype SUNDlsMat_bandGBTRF(sunrealtype** a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype* p) @@ -212,12 +181,6 @@ sunindextype SUNDlsMat_bandGBTRF(sunrealtype** a, sunindextype n, return (0); } -void bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_bandGBTRS(a, n, smu, ml, p, b); -} - void SUNDlsMat_bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype* p, sunrealtype* b) { @@ -252,13 +215,6 @@ void SUNDlsMat_bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, } } -void bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, - sunindextype a_smu, sunindextype b_smu, sunindextype copymu, - sunindextype copyml) -{ - SUNDlsMat_bandCopy(a, b, n, a_smu, b_smu, copymu, copyml); -} - void SUNDlsMat_bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml) @@ -276,12 +232,6 @@ void SUNDlsMat_bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, } } -void bandScale(sunrealtype c, sunrealtype** a, sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu) -{ - SUNDlsMat_bandScale(c, a, n, mu, ml, smu); -} - void SUNDlsMat_bandScale(sunrealtype c, sunrealtype** a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { @@ -297,11 +247,6 @@ void SUNDlsMat_bandScale(sunrealtype c, sunrealtype** a, sunindextype n, } } -void bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu) -{ - SUNDlsMat_bandAddIdentity(a, n, smu); -} - void SUNDlsMat_bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu) { sunindextype j; @@ -309,12 +254,6 @@ void SUNDlsMat_bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu for (j = 0; j < n; j++) { a[j][smu] += ONE; } } -void bandMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype n, - sunindextype mu, sunindextype ml, sunindextype smu) -{ - SUNDlsMat_bandMatvec(a, x, y, n, mu, ml, smu); -} - void SUNDlsMat_bandMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) diff --git a/src/sundials/sundials_dense.c b/src/sundials/sundials_dense.c index f037fefbdf..ce420fca0f 100644 --- a/src/sundials/sundials_dense.c +++ b/src/sundials/sundials_dense.c @@ -38,99 +38,47 @@ sunindextype SUNDlsMat_DenseGETRF(SUNDlsMat A, sunindextype* p) return (SUNDlsMat_denseGETRF(A->cols, A->M, A->N, p)); } -sunindextype DenseGETRF(SUNDlsMat A, sunindextype* p) -{ - return (SUNDlsMat_denseGETRF(A->cols, A->M, A->N, p)); -} - void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) { SUNDlsMat_denseGETRS(A->cols, A->N, p, b); } -void DenseGETRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_denseGETRS(A->cols, A->N, p, b); -} - sunindextype SUNDlsMat_DensePOTRF(SUNDlsMat A) { return (SUNDlsMat_densePOTRF(A->cols, A->M)); } -sunindextype DensePOTRF(SUNDlsMat A) -{ - return (SUNDlsMat_densePOTRF(A->cols, A->M)); -} - void SUNDlsMat_DensePOTRS(SUNDlsMat A, sunrealtype* b) { SUNDlsMat_densePOTRS(A->cols, A->M, b); } -void DensePOTRS(SUNDlsMat A, sunrealtype* b) -{ - SUNDlsMat_densePOTRS(A->cols, A->M, b); -} - int SUNDlsMat_DenseGEQRF(SUNDlsMat A, sunrealtype* beta, sunrealtype* wrk) { return (SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); } -int DenseGEQRF(SUNDlsMat A, sunrealtype* beta, sunrealtype* wrk) -{ - return (SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); -} - int SUNDlsMat_DenseORMQR(SUNDlsMat A, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, sunrealtype* wrk) { return (SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); } -int DenseORMQR(SUNDlsMat A, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, - sunrealtype* wrk) -{ - return (SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); -} - void SUNDlsMat_DenseCopy(SUNDlsMat A, SUNDlsMat B) { SUNDlsMat_denseCopy(A->cols, B->cols, A->M, A->N); } -void DenseCopy(SUNDlsMat A, SUNDlsMat B) -{ - SUNDlsMat_denseCopy(A->cols, B->cols, A->M, A->N); -} - void SUNDlsMat_DenseScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_denseScale(c, A->cols, A->M, A->N); } -void DenseScale(sunrealtype c, SUNDlsMat A) -{ - SUNDlsMat_denseScale(c, A->cols, A->M, A->N); -} - void SUNDlsMat_DenseMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) { SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); } -void DenseMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) -{ - SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); -} - -sunindextype denseGETRF(sunrealtype** a, sunindextype m, sunindextype n, - sunindextype* p) -{ - return (SUNDlsMat_denseGETRF(a, m, n, p)); -} - sunindextype SUNDlsMat_denseGETRF(sunrealtype** a, sunindextype m, sunindextype n, sunindextype* p) { @@ -199,11 +147,6 @@ sunindextype SUNDlsMat_denseGETRF(sunrealtype** a, sunindextype m, return (0); } -void denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_denseGETRS(a, n, p, b); -} - void SUNDlsMat_denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, sunrealtype* b) { @@ -246,11 +189,6 @@ void SUNDlsMat_denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, * the lower triangle of C. */ -sunindextype densePOTRF(sunrealtype** a, sunindextype m) -{ - return (SUNDlsMat_densePOTRF(a, m)); -} - sunindextype SUNDlsMat_densePOTRF(sunrealtype** a, sunindextype m) { sunrealtype *a_col_j, *a_col_k; @@ -289,11 +227,6 @@ sunindextype SUNDlsMat_densePOTRF(sunrealtype** a, sunindextype m) * */ -void densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) -{ - SUNDlsMat_densePOTRS(a, m, b); -} - void SUNDlsMat_densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) { sunrealtype *col_j, *col_i; @@ -334,12 +267,6 @@ void SUNDlsMat_densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) * */ -int denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, - sunrealtype* beta, sunrealtype* v) -{ - return (SUNDlsMat_denseGEQRF(a, m, n, beta, v)); -} - int SUNDlsMat_denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, sunrealtype* v) { @@ -404,12 +331,6 @@ int SUNDlsMat_denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, * v (of length m) must be provided as workspace. */ -int denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, - sunrealtype* vn, sunrealtype* vm, sunrealtype* v) -{ - return (SUNDlsMat_denseORMQR(a, m, n, beta, vn, vm, v)); -} - int SUNDlsMat_denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, sunrealtype* v) @@ -441,11 +362,6 @@ int SUNDlsMat_denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, return (0); } -void denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, sunindextype n) -{ - SUNDlsMat_denseCopy(a, b, m, n); -} - void SUNDlsMat_denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, sunindextype n) { @@ -460,11 +376,6 @@ void SUNDlsMat_denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, } } -void denseScale(sunrealtype c, sunrealtype** a, sunindextype m, sunindextype n) -{ - SUNDlsMat_denseScale(c, a, m, n); -} - void SUNDlsMat_denseScale(sunrealtype c, sunrealtype** a, sunindextype m, sunindextype n) { @@ -478,11 +389,6 @@ void SUNDlsMat_denseScale(sunrealtype c, sunrealtype** a, sunindextype m, } } -void denseAddIdentity(sunrealtype** a, sunindextype n) -{ - SUNDlsMat_denseAddIdentity(a, n); -} - void SUNDlsMat_denseAddIdentity(sunrealtype** a, sunindextype n) { sunindextype i; @@ -490,12 +396,6 @@ void SUNDlsMat_denseAddIdentity(sunrealtype** a, sunindextype n) for (i = 0; i < n; i++) { a[i][i] += ONE; } } -void denseMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, - sunindextype m, sunindextype n) -{ - SUNDlsMat_denseMatvec(a, x, y, m, n); -} - void SUNDlsMat_denseMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype m, sunindextype n) { diff --git a/src/sundials/sundials_direct.c b/src/sundials/sundials_direct.c index 2bf135b9d3..02ff31d96c 100644 --- a/src/sundials/sundials_direct.c +++ b/src/sundials/sundials_direct.c @@ -23,11 +23,6 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -SUNDlsMat NewDenseMat(sunindextype M, sunindextype N) -{ - return (SUNDlsMat_NewDenseMat(M, N)); -} - SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N) { SUNDlsMat A; @@ -68,11 +63,6 @@ SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N) return (A); } -sunrealtype** newDenseMat(sunindextype m, sunindextype n) -{ - return (SUNDlsMat_newDenseMat(m, n)); -} - sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) { sunindextype j; @@ -98,12 +88,6 @@ sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) return (a); } -SUNDlsMat NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, - sunindextype smu) -{ - return (SUNDlsMat_NewBandMat(N, mu, ml, smu)); -} - SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, sunindextype smu) { @@ -151,11 +135,6 @@ SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, return (A); } -sunrealtype** newBandMat(sunindextype n, sunindextype smu, sunindextype ml) -{ - return (SUNDlsMat_newBandMat(n, smu, ml)); -} - sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml) { @@ -183,8 +162,6 @@ sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, return (a); } -void DestroyMat(SUNDlsMat A) { SUNDlsMat_DestroyMat(A); } - void SUNDlsMat_DestroyMat(SUNDlsMat A) { free(A->data); @@ -194,8 +171,6 @@ void SUNDlsMat_DestroyMat(SUNDlsMat A) A = NULL; } -void destroyMat(sunrealtype** a) { SUNDlsMat_destroyMat(a); } - void SUNDlsMat_destroyMat(sunrealtype** a) { free(a[0]); @@ -204,8 +179,6 @@ void SUNDlsMat_destroyMat(sunrealtype** a) a = NULL; } -int* NewIntArray(int N) { return (SUNDlsMat_NewIntArray(N)); } - int* SUNDlsMat_NewIntArray(int N) { int* vec; @@ -218,8 +191,6 @@ int* SUNDlsMat_NewIntArray(int N) return (vec); } -int* newIntArray(int N) { return (SUNDlsMat_newIntArray(N)); } - int* SUNDlsMat_newIntArray(int n) { int* v; @@ -232,11 +203,6 @@ int* SUNDlsMat_newIntArray(int n) return (v); } -sunindextype* NewIndexArray(sunindextype N) -{ - return (SUNDlsMat_NewIndexArray(N)); -} - sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) { sunindextype* vec; @@ -249,11 +215,6 @@ sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) return (vec); } -sunindextype* newIndexArray(sunindextype n) -{ - return (SUNDlsMat_newIndexArray(n)); -} - sunindextype* SUNDlsMat_newIndexArray(sunindextype n) { sunindextype* v; @@ -266,11 +227,6 @@ sunindextype* SUNDlsMat_newIndexArray(sunindextype n) return (v); } -sunrealtype* NewRealArray(sunindextype N) -{ - return (SUNDlsMat_NewRealArray(N)); -} - sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) { sunrealtype* vec; @@ -283,11 +239,6 @@ sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) return (vec); } -sunrealtype* newRealArray(sunindextype N) -{ - return (SUNDlsMat_newRealArray(N)); -} - sunrealtype* SUNDlsMat_newRealArray(sunindextype m) { sunrealtype* v; @@ -300,24 +251,18 @@ sunrealtype* SUNDlsMat_newRealArray(sunindextype m) return (v); } -void DestroyArray(void* p) { SUNDlsMat_DestroyArray(p); } - void SUNDlsMat_DestroyArray(void* V) { free(V); V = NULL; } -void destroyArray(void* p) { SUNDlsMat_destroyArray(p); } - void SUNDlsMat_destroyArray(void* v) { free(v); v = NULL; } -void AddIdentity(SUNDlsMat A) { SUNDlsMat_AddIdentity(A); } - void SUNDlsMat_AddIdentity(SUNDlsMat A) { sunindextype i; @@ -334,8 +279,6 @@ void SUNDlsMat_AddIdentity(SUNDlsMat A) } } -void SetToZero(SUNDlsMat A) { SUNDlsMat_SetToZero(A); } - void SUNDlsMat_SetToZero(SUNDlsMat A) { sunindextype i, j, colSize; @@ -366,8 +309,6 @@ void SUNDlsMat_SetToZero(SUNDlsMat A) } } -void PrintMat(SUNDlsMat A, FILE* outfile) { SUNDlsMat_PrintMat(A, outfile); } - void SUNDlsMat_PrintMat(SUNDlsMat A, FILE* outfile) { sunindextype i, j, start, finish; From 968281667841a26152e8121e4b312f5140931e42 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 20 May 2024 18:42:33 -0500 Subject: [PATCH 050/137] CI: Update Compiler Warnings, Enable Warnings as Errors (#484) * Additional warning flags from #481, #482, and #483 * Remove `-Wno-deprecated-declarations` * Enable warnings as errors in GitHub actions --- .../kokkos/ParallelGrid.hpp | 36 +++++++++++------ .../kokkos/advection_reaction_3D.cpp | 25 ++++++------ .../kokkos/advection_reaction_3D.hpp | 16 ++++---- .../kokkos/arkode_driver.cpp | 31 +++++++------- .../kokkos/ida_driver.cpp | 2 +- benchmarks/diffusion_2D/diffusion_2D.cpp | 8 ++-- benchmarks/diffusion_2D/diffusion_2D.hpp | 4 +- .../diffusion_2D/mpi_serial/buffers.cpp | 2 +- .../diffusion_2D/mpi_serial/diffusion.cpp | 15 +++---- benchmarks/nvector/test_nvector_performance.c | 12 +++--- cmake/SundialsSetupCompilers.cmake | 21 +++++++++- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 4 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 32 +++------------ .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 4 +- .../ark_advection_diffusion_reaction.hpp | 33 +++++++-------- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 4 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 6 +-- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 6 +-- examples/cvode/CXX_serial/cv_heat2D.hpp | 16 ++++---- examples/cvode/CXX_serial/cv_kpr.hpp | 5 ++- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 16 ++++---- examples/cvode/ginkgo/cv_kpr_ginkgo.hpp | 4 +- examples/cvode/petsc/cv_petsc_ex7.c | 2 +- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 6 +-- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 40 +++++++++++-------- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 40 +++++++++++-------- .../ginkgo/test_sunlinsol_ginkgo.cpp | 38 +++++++++++++----- .../kokkos/test_sunlinsol_kokkosdense.cpp | 2 +- examples/sunmatrix/dreadrb.c | 2 + .../ginkgo/test_sunmatrix_ginkgo.cpp | 31 +++++++------- .../kokkos/test_sunmatrix_kokkosdense.cpp | 2 +- examples/utilities/example_utilities.hpp | 4 +- .../trilinos/SundialsTpetraVectorKernels.hpp | 8 +--- include/sunlinsol/sunlinsol_ginkgo.hpp | 8 ++++ include/sunlinsol/sunlinsol_kokkosdense.hpp | 4 +- include/sunmatrix/sunmatrix_kokkosdense.hpp | 2 +- src/arkode/fmod/farkode_arkstep_mod.f90 | 2 + src/arkode/fmod/farkode_erkstep_mod.f90 | 1 + src/cvode/CMakeLists.txt | 2 +- src/cvode/cvode.c | 15 ------- src/cvode/cvode_diag.c | 14 ------- src/cvode/cvode_impl.h | 28 +++++++++++++ src/cvode/cvode_nls.c | 6 --- src/sundials/fmod/fsundials_core_mod.c | 8 ++++ src/sundials/fmod/fsundials_core_mod.f90 | 16 ++++++++ src/sundials/sundials_futils.c | 1 + test/env/default.sh | 5 --- test/env/docker.sh | 3 -- .../arkode/CXX_serial/ark_test_getjac.cpp | 10 ++--- .../arkode/CXX_serial/ark_test_getjac_mri.cpp | 12 +++--- .../arkode/C_serial/ark_test_innerstepper.c | 6 +-- .../arkode/C_serial/ark_test_mass.c | 5 ++- .../arkode/C_serial/ark_test_tstop.c | 7 ++-- .../cvode/CXX_serial/cv_test_getjac.cpp | 10 ++--- .../cvode/CXX_serial/cv_test_kpr.hpp | 8 ++-- .../unit_tests/cvode/C_serial/cv_test_tstop.c | 7 ++-- test/unit_tests/cvode/gtest/CMakeLists.txt | 5 +++ .../cvodes/CXX_serial/cvs_test_getjac.cpp | 10 ++--- .../cvodes/CXX_serial/cvs_test_kpr.hpp | 8 ++-- .../cvodes/C_serial/cvs_test_tstop.c | 7 ++-- .../ida/CXX_serial/ida_test_getjac.cpp | 16 ++++---- .../ida/CXX_serial/ida_test_kpr.hpp | 8 ++-- test/unit_tests/ida/C_serial/ida_test_tstop.c | 10 ++--- .../idas/CXX_serial/idas_test_getjac.cpp | 16 ++++---- .../idas/CXX_serial/idas_test_kpr.hpp | 8 ++-- .../idas/C_serial/idas_test_tstop.c | 10 ++--- .../kinsol/CXX_serial/kin_test_getjac.cpp | 14 +++---- test/unit_tests/profiling/test_profiling.cpp | 4 +- .../reductions/test_reduction_operators.cpp | 12 +++--- .../sunmemory/sys/test_sunmemory_sys.cpp | 4 +- test/unit_tests/utilities/dumpstderr.hpp | 2 +- 71 files changed, 431 insertions(+), 360 deletions(-) diff --git a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp index 2eed892ee5..7bbf8743a7 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp @@ -82,9 +82,9 @@ class ParallelGrid // [in] npxyz - the number of processors in each dimension; defaults to 0 which means MPI will choose // [in] reorder - should MPI_Cart_create do process reordering to optimize or not; defaults to false (some MPI implementations ignore this) ParallelGrid(MPI_Comm* comm, const sunrealtype a[], const sunrealtype b[], - const GLOBALINT npts[], int dof, BoundaryType bc, StencilType st, - const sunrealtype c, const int npxyz[] = nullptr, - bool reorder = false) + const GLOBALINT npts[], int dof_, BoundaryType bc_, + StencilType st_, const sunrealtype c, + const int npxyz[] = nullptr, bool reorder = false) : nx(1), ny(1), nz(1), @@ -103,12 +103,12 @@ class ParallelGrid bx(0.0), by(0.0), bz(0.0), - dof(dof), + dof(dof_), + upwindRight(true), dims{0, 0, 0}, coords{0, 0, 0}, - bc(bc), - st(st), - upwindRight(true) + bc(bc_), + st(st_) { assert(st == StencilType::UPWIND); @@ -121,6 +121,10 @@ class ParallelGrid } int retval, nprocs; +#ifdef NDEBUG + // Suppress unused variable warning + ((void)retval); +#endif MPI_Comm_size(*comm, &nprocs); retval = MPI_Dims_create(nprocs, 3, dims); assert(retval == MPI_SUCCESS); @@ -181,6 +185,12 @@ class ParallelGrid // For all faces: allocate upwind exchange buffers. void AllocateBuffersUpwind() { + int retval; +#ifdef NDEBUG + // Suppress unused variable warning + ((void)retval); +#endif + /* Allocate send/receive buffers and determine ID for communication West */ if (upwindRight) { @@ -196,7 +206,7 @@ class ParallelGrid if ((coords[0] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0] - 1, coords[1], coords[2]}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipW); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipW); assert(retval == MPI_SUCCESS); } @@ -215,7 +225,7 @@ class ParallelGrid if ((coords[0] < dims[0] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0] + 1, coords[1], coords[2]}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipE); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipE); assert(retval == MPI_SUCCESS); } @@ -234,7 +244,7 @@ class ParallelGrid if ((coords[1] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1] - 1, coords[2]}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipS); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipS); assert(retval == MPI_SUCCESS); } @@ -253,7 +263,7 @@ class ParallelGrid if ((coords[1] < dims[1] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1] + 1, coords[2]}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipN); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipN); assert(retval == MPI_SUCCESS); } @@ -272,7 +282,7 @@ class ParallelGrid if ((coords[2] > 0) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1], coords[2] - 1}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipB); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipB); assert(retval == MPI_SUCCESS); } @@ -291,7 +301,7 @@ class ParallelGrid if ((coords[2] < dims[2] - 1) || (bc == BoundaryType::PERIODIC)) { int nbcoords[] = {coords[0], coords[1], coords[2] + 1}; - int retval = MPI_Cart_rank(cart_comm, nbcoords, &ipF); + retval = MPI_Cart_rank(cart_comm, nbcoords, &ipF); assert(retval == MPI_SUCCESS); } } diff --git a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp index 5f72a5b085..1bca75cbcc 100644 --- a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.cpp @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) if (udata.myid == 0 && uopt.nout > 0) { char fname[MXSTR]; - snprintf(fname, MXSTR, "%s/mesh.txt", uopt.outputdir); + snprintf(fname, MXSTR, "%s/mesh.txt", uopt.outputdir.c_str()); udata.grid->MeshToFile(fname); } @@ -259,7 +259,7 @@ int FillSendBuffers(N_Vector y, UserData* udata) * --------------------------------------------------------------*/ /* Parses the CLI arguments */ -int ParseArgs(int argc, char* argv[], UserData* udata, UserOptions* uopt) +static int ParseArgs(int argc, char* argv[], UserData* udata, UserOptions* uopt) { /* check for input args */ if (argc > 1) @@ -449,7 +449,7 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, uopt->fused = 0; /* use fused vector ops */ uopt->save = 1; /* save solution to disk */ uopt->nout = 10; /* number of output times */ - uopt->outputdir = (char*)"."; /* output directory */ + uopt->outputdir = "."; /* output directory */ /* Parse CLI args and set udata/uopt appropriately */ int retval = ParseArgs(argc, argv, udata, uopt); @@ -493,17 +493,17 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, char fname[MXSTR]; if (udata->myid == 0) { - sprintf(fname, "%s/t.%06d.txt", uopt->outputdir, udata->myid); + sprintf(fname, "%s/t.%06d.txt", uopt->outputdir.c_str(), udata->myid); udata->TFID = fopen(fname, "w"); } - sprintf(fname, "%s/u.%06d.txt", uopt->outputdir, udata->myid); + sprintf(fname, "%s/u.%06d.txt", uopt->outputdir.c_str(), udata->myid); udata->UFID = fopen(fname, "w"); - sprintf(fname, "%s/v.%06d.txt", uopt->outputdir, udata->myid); + sprintf(fname, "%s/v.%06d.txt", uopt->outputdir.c_str(), udata->myid); udata->VFID = fopen(fname, "w"); - sprintf(fname, "%s/w.%06d.txt", uopt->outputdir, udata->myid); + sprintf(fname, "%s/w.%06d.txt", uopt->outputdir.c_str(), udata->myid); udata->WFID = fopen(fname, "w"); } @@ -540,7 +540,7 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, printf(" reltol = %.1e\n", uopt->rtol); printf(" abstol = %.1e\n", uopt->atol); printf(" nout = %d\n", uopt->nout); - printf("Output directory: %s\n", uopt->outputdir); + printf("Output directory: %s\n", uopt->outputdir.c_str()); } /* return success */ @@ -549,7 +549,8 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, /* Compute the 3D Gaussian function. */ KOKKOS_FUNCTION -void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax) +static void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, + sunrealtype xmax) { /* Gaussian distribution defaults */ const sunrealtype alpha = 0.1; @@ -567,7 +568,7 @@ void Gaussian3D(sunrealtype& x, sunrealtype& y, sunrealtype& z, sunrealtype xmax } /* Initial condition function */ -int SetIC(N_Vector y, UserData* udata) +int SetIC(N_Vector yvec, UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -596,8 +597,8 @@ int SetIC(N_Vector y, UserData* udata) const sunrealtype ws = 3.0; /* Create 4D view of y */ - Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(y)), nxl, nyl, - nzl, dof); + Vec4D yview(N_VGetDeviceArrayPointer(N_VGetLocalVector_MPIPlusX(yvec)), nxl, + nyl, nzl, dof); /* Gaussian perturbation of the steady state solution */ Kokkos::parallel_for( diff --git a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp index fc4717fefe..ed594b0828 100644 --- a/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/advection_reaction_3D.hpp @@ -59,7 +59,7 @@ struct UserOptions int fused; /* use fused vector ops */ int nout; /* number of outputs */ int save; /* save solution to disk */ - char* outputdir; + string outputdir; }; /* @@ -113,16 +113,16 @@ struct UserData UserOptions* uopt; /* Constructor that takes the context */ - UserData(SUNContext ctx) - : ctx(ctx), - umask(nullptr), - vmask(nullptr), - wmask(nullptr), - uopt(nullptr), + UserData(SUNContext ctx_) + : ctx(ctx_), TFID(nullptr), UFID(nullptr), VFID(nullptr), - WFID(nullptr) + WFID(nullptr), + umask(nullptr), + vmask(nullptr), + wmask(nullptr), + uopt(nullptr) { SUNContext_GetProfiler(ctx, &prof); } diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 49dcc6d8cf..2001c2736a 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -58,7 +58,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = true; @@ -246,7 +245,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, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = false; @@ -445,7 +443,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]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = true; @@ -544,7 +541,7 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) * (Non)linear system functions * --------------------------------------------------------------*/ -int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) +static int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) { /* temporary variables */ UserData* udata; @@ -586,7 +583,7 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) return (0); } -int TaskLocalLSolve(N_Vector delta, void* arkode_mem) +static int TaskLocalLSolve(N_Vector delta, void* arkode_mem) { /* local variables */ UserData* udata = NULL; @@ -609,12 +606,12 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) return (retval); } -SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) +static SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) { return SUNNONLINEARSOLVER_ROOTFIND; } -int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) +static int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -626,9 +623,9 @@ int TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) return (SUNNonlinSolInitialize(LOCAL_NLS(NLS))); } -int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, - N_Vector w, sunrealtype tol, - sunbooleantype callLSetup, void* mem) +static int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, + N_Vector ycor, N_Vector w, sunrealtype tol, + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; @@ -662,7 +659,7 @@ int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, return recover; } -int TaskLocalNewton_Free(SUNNonlinearSolver NLS) +static int TaskLocalNewton_Free(SUNNonlinearSolver NLS) { /* return if NLS is already free */ if (NLS == NULL) { return SUN_SUCCESS; } @@ -688,7 +685,8 @@ int TaskLocalNewton_Free(SUNNonlinearSolver NLS) return SUN_SUCCESS; } -int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, SUNNonlinSolSysFn SysFn) +static int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, + SUNNonlinSolSysFn SysFn) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -696,9 +694,9 @@ int TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, SUNNonlinSolSysFn SysFn) return (SUNNonlinSolSetSysFn(LOCAL_NLS(NLS), SysFn)); } -int TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, - SUNNonlinSolConvTestFn CTestFn, - void* ctest_data) +static int TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, + SUNNonlinSolConvTestFn CTestFn, + void* ctest_data) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -706,7 +704,8 @@ int TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, return (SUNNonlinSolSetConvTestFn(LOCAL_NLS(NLS), CTestFn, ctest_data)); } -int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, long int* nconvfails) +static int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, + long int* nconvfails) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } diff --git a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp index b85c7a3fb6..d029f8c34e 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/ida_driver.cpp @@ -20,7 +20,7 @@ #include "sunnonlinsol/sunnonlinsol_newton.h" /* Initial condition function */ -int SetICDot(N_Vector y, N_Vector yp, UserData* udata) +static int SetICDot(N_Vector y, N_Vector yp, UserData* udata) { int retval; diff --git a/benchmarks/diffusion_2D/diffusion_2D.cpp b/benchmarks/diffusion_2D/diffusion_2D.cpp index e5d3ece986..bd18cf1dfb 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.cpp +++ b/benchmarks/diffusion_2D/diffusion_2D.cpp @@ -775,8 +775,8 @@ int UserOutput::open(UserData* udata) int UserOutput::write(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (output > 0) { @@ -900,7 +900,7 @@ int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata) } // Check function return value -int check_flag(void* flagvalue, const string funcname, int opt) +int check_flag(const void* flagvalue, const string funcname, int opt) { // Check if the function returned a NULL pointer if (opt == 0) @@ -916,7 +916,7 @@ int check_flag(void* flagvalue, const string funcname, int opt) // Check the function return flag value else if (opt == 1 || opt == 2) { - int errflag = *((int*)flagvalue); + const int errflag = *((const int*)flagvalue); if ((opt == 1 && errflag < 0) || (opt == 2 && errflag != 0)) { cerr << endl diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index 11e0b350e8..1ebb3394aa 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -168,7 +168,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector diag = NULL; - UserData(SUNProfiler prof) : prof(prof) {} + UserData(SUNProfiler prof_) : prof(prof_) {} ~UserData(); @@ -280,6 +280,6 @@ int SolutionDerivative(sunrealtype t, N_Vector up, UserData* udata); int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata); // Check function return values -int check_flag(void* flagvalue, const string funcname, int opt); +int check_flag(const void* flagvalue, const string funcname, int opt); #endif diff --git a/benchmarks/diffusion_2D/mpi_serial/buffers.cpp b/benchmarks/diffusion_2D/mpi_serial/buffers.cpp index 13a35dbffb..a5448b8939 100644 --- a/benchmarks/diffusion_2D/mpi_serial/buffers.cpp +++ b/benchmarks/diffusion_2D/mpi_serial/buffers.cpp @@ -21,7 +21,7 @@ int UserData::pack_buffers(const N_Vector u) { // Access data array const sunrealtype* uarray = N_VGetArrayPointer(u); - if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) return -1; + if (check_flag(uarray, "N_VGetArrayPointer", 0)) return -1; if (HaveNbrW) for (sunindextype i = 0; i < ny_loc; i++) diff --git a/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp b/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp index 9be04d0cde..277267993b 100644 --- a/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp +++ b/benchmarks/diffusion_2D/mpi_serial/diffusion.cpp @@ -207,8 +207,8 @@ int laplacian(sunrealtype t, N_Vector u, N_Vector f, UserData* udata) // j -- local y index // x -- x processor coordinate // y -- y processor coordinate -sunindextype global_index(sunindextype i, sunindextype j, int x, int y, - UserData* udata) +static sunindextype global_index(sunindextype i, sunindextype j, int x, int y, + UserData* udata) { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); @@ -253,12 +253,13 @@ sunindextype global_index(sunindextype i, sunindextype j, int x, int y, // x -- x processor coordinate // y -- y processor coordinate #if defined(BENCHMARK_ODE) -int matrix_row(sunindextype i, sunindextype j, int x, int y, UserData* udata, - sunrealtype* vals, sunindextype* col_idx, sunindextype* row_nnz) +static int matrix_row(sunindextype i, sunindextype j, int x, int y, + UserData* udata, sunrealtype* vals, sunindextype* col_idx, + sunindextype* row_nnz) #else -int matrix_row(sunindextype i, sunindextype j, int x, int y, UserData* udata, - sunrealtype cj, sunrealtype* vals, sunindextype* col_idx, - sunindextype* row_nnz) +static int matrix_row(sunindextype i, sunindextype j, int x, int y, + UserData* udata, sunrealtype cj, sunrealtype* vals, + sunindextype* col_idx, sunindextype* row_nnz) #endif { SUNDIALS_CXX_MARK_FUNCTION(udata->prof); diff --git a/benchmarks/nvector/test_nvector_performance.c b/benchmarks/nvector/test_nvector_performance.c index d522349e3f..36224a9c38 100644 --- a/benchmarks/nvector/test_nvector_performance.c +++ b/benchmarks/nvector/test_nvector_performance.c @@ -2826,23 +2826,23 @@ static double get_time(void) /* ---------------------------------------------------------------------- * compute average, standard deviation, max, and min * --------------------------------------------------------------------*/ -static void time_stats(N_Vector X, double* times, int nwarmups, int ntests, +static void time_stats(N_Vector X, double* times, int num_warmups, int ntests, double* avg, double* sdev, double* min, double* max) { int i, ntotal; /* total number of times collected */ - ntotal = nwarmups + ntests; + ntotal = num_warmups + ntests; /* if running in parallel collect data from all processes */ collect_times(X, times, ntotal); /* compute timing stats */ *avg = 0.0; - *min = times[nwarmups]; - *max = times[nwarmups]; + *min = times[num_warmups]; + *max = times[num_warmups]; - for (i = nwarmups; i < ntotal; i++) + for (i = num_warmups; i < ntotal; i++) { *avg += times[i]; if (times[i] < *min) { *min = times[i]; } @@ -2853,7 +2853,7 @@ static void time_stats(N_Vector X, double* times, int nwarmups, int ntests, *sdev = 0.0; if (ntests > 1) { - for (i = nwarmups; i < ntotal; i++) + for (i = num_warmups; i < ntotal; i++) { *sdev += (times[i] - *avg) * (times[i] - *avg); } diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 36f10b44c1..065f39e1b2 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -76,8 +76,25 @@ endif() if(ENABLE_ALL_WARNINGS) message(STATUS "Enabling all compiler warnings") - set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -Wno-unused-function ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -Wno-unused-function ${CMAKE_CXX_FLAGS}") + # Avoid numerous warnings from printf + if(SUNDIALS_PRECISION MATCHES "EXTENDED") + set(CMAKE_C_FLAGS "-Wdouble-promotion ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wdouble-promotion ${CMAKE_CXX_FLAGS}") + endif() + + if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32")) + set(CMAKE_C_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_CXX_FLAGS}") + endif() + + # Avoid numerous warnings from SWIG generated functions + if(NOT BUILD_FORTRAN_MODULE_INTERFACE) + set(CMAKE_C_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_CXX_FLAGS}") + endif() + + set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}") set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}") endif() diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 78a25fa210..566a7a4b41 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -1720,8 +1720,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index 09e95bc328..d5cb124652 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -470,31 +470,9 @@ int main(int argc, char* argv[]) flag = ARKodeSetEpsLin(arkode_mem, udata->epslin); if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } - // Select method order - if (udata->order > 1) - { - // Use an ARKode provided table - flag = ARKodeSetOrder(arkode_mem, udata->order); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } - } - else - { - // Use implicit Euler (requires fixed step size) - sunrealtype c[1], A[1], b[1]; - ARKodeButcherTable B = NULL; - - // Create implicit Euler Butcher table - c[0] = A[0] = b[0] = ONE; - B = ARKodeButcherTable_Create(1, 1, 0, c, A, b, NULL); - if (check_flag((void*)B, "ARKodeButcherTable_Create", 0)) { return 1; } - - // Attach the Butcher table - flag = ARKStepSetTables(arkode_mem, 1, 0, B, NULL); - if (check_flag(&flag, "ARKStepSetTables", 1)) { return 1; } - - // Free the Butcher table - ARKodeButcherTable_Free(B); - } + // Use an ARKode provided table + flag = ARKodeSetOrder(arkode_mem, udata->order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } // Set fixed step size or adaptivity method if (udata->hfixed > ZERO) @@ -2020,8 +1998,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index bb541e41d6..2582758ef7 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -2534,8 +2534,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index 6d0bc8a09d..bdf4102903 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -266,7 +266,7 @@ int SetIC(N_Vector y, UserData& udata); // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const string funcname) +static int check_flag(int flag, const string funcname) { if (flag < 0) { @@ -277,7 +277,7 @@ int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const string funcname) +static int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -285,7 +285,7 @@ int check_ptr(void* ptr, const string funcname) } // Print ERK integrator statistics -int OutputStatsERK(void* arkode_mem, UserData& udata) +static int OutputStatsERK(void* arkode_mem, UserData& udata) { int flag; @@ -309,7 +309,7 @@ int OutputStatsERK(void* arkode_mem, UserData& udata) } // Print ARK integrator statistics -int OutputStatsARK(void* arkode_mem, UserData& udata) +static int OutputStatsARK(void* arkode_mem, UserData& udata) { int flag; @@ -362,8 +362,8 @@ int OutputStatsARK(void* arkode_mem, UserData& udata) } // Print MRI integrator statistics -int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, - UserData& udata) +static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, + UserData& udata) { int flag; @@ -461,7 +461,7 @@ int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, } // Save current stats -int UpdateCVodeStats(CVodeInnerStepperContent* content) +static int UpdateCVodeStats(CVodeInnerStepperContent* content) { int flag; long int nst, netf, nfe, nni, nncf, nsetups, nje; @@ -498,8 +498,8 @@ int UpdateCVodeStats(CVodeInnerStepperContent* content) } // Print MRI integrator statistics -int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, - UserData& udata) +static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, + UserData& udata) { int flag; @@ -570,7 +570,7 @@ int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, } // Print command line options -void InputHelp() +static void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -662,8 +662,8 @@ inline void find_arg(vector<string>& args, const string key, bool& dest, } } -int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, - SUNContext ctx) +static int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, + SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -785,7 +785,7 @@ int ReadInputs(vector<string>& args, UserData& udata, UserOptions& uopts, } // Print user data -int PrintSetup(UserData& udata, UserOptions& uopts) +static int PrintSetup(UserData& udata, UserOptions& uopts) { cout << endl; cout << "Problem parameters and options:" << endl; @@ -1147,7 +1147,7 @@ int PrintSetup(UserData& udata, UserOptions& uopts) } // Initialize output -int OpenOutput(UserData& udata, UserOptions& uopts) +static int OpenOutput(UserData& udata, UserOptions& uopts) { // Header for status output if (uopts.output) @@ -1183,7 +1183,8 @@ int OpenOutput(UserData& udata, UserOptions& uopts) } // Write output -int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, UserOptions& uopts) +static int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, + UserOptions& uopts) { if (uopts.output) { @@ -1212,7 +1213,7 @@ int WriteOutput(sunrealtype t, N_Vector y, UserData& udata, UserOptions& uopts) } // Finalize output -int CloseOutput(UserOptions& uopts) +static int CloseOutput(UserOptions& uopts) { // Footer for status output if (uopts.output) diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index 068d59993d..aabfef2e64 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -1620,8 +1620,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp index 77af0d8b03..c213aeaca2 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp @@ -1498,7 +1498,7 @@ static int WaitRecv(UserData* udata) // ----------------------------------------------------------------------------- // Initialize memory allocated within Userdata -UserData::UserData(sundials::Context& sunctx) : sunctx(sunctx) +UserData::UserData(sundials::Context& ctx) : sunctx(ctx) { // Diffusion coefficient kx = ONE; @@ -1932,8 +1932,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 762d36e973..5d74df7818 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -1970,7 +1970,7 @@ static int WaitRecv(UserData* udata) // ----------------------------------------------------------------------------- // Initialize memory allocated within Userdata -UserData::UserData(sundials::Context& sunctx) : sunctx(sunctx) +UserData::UserData(sundials::Context& ctx) : sunctx(ctx) { // Diffusion coefficient kx = ONE; @@ -2446,8 +2446,8 @@ static int OpenOutput(UserData* udata) static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) { int flag; - sunrealtype max; - bool outproc = (udata->myid_c == 0); + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); if (udata->output > 0) { diff --git a/examples/cvode/CXX_serial/cv_heat2D.hpp b/examples/cvode/CXX_serial/cv_heat2D.hpp index 0488247e7c..35bfa1ef84 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.hpp +++ b/examples/cvode/CXX_serial/cv_heat2D.hpp @@ -107,7 +107,7 @@ UserData::~UserData() // ----------------------------------------------------------------------------- // Compute the exact solution -int Solution(sunrealtype t, N_Vector u, UserData& udata) +static int Solution(sunrealtype t, N_Vector u, UserData& udata) { auto uarray = N_VGetArrayPointer(u); if (check_ptr(uarray, "N_VGetArrayPointer")) { return -1; } @@ -137,7 +137,7 @@ int Solution(sunrealtype t, N_Vector u, UserData& udata) } // Compute the solution error -int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) { // Compute true solution auto flag = Solution(t, e, udata); @@ -151,7 +151,7 @@ int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Print command line options -void InputHelp() +static void InputHelp() { std::cout << std::endl << "Command line options:\n" @@ -176,7 +176,7 @@ void InputHelp() } // Read command line inputs -int ReadInputs(std::vector<std::string>& args, UserData& udata) +static int ReadInputs(std::vector<std::string>& args, UserData& udata) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -212,7 +212,7 @@ int ReadInputs(std::vector<std::string>& args, UserData& udata) } // Print user data -void PrintUserData(UserData& udata) +static void PrintUserData(UserData& udata) { std::cout << std::endl << "2D Heat problem:\n" @@ -243,7 +243,7 @@ void PrintUserData(UserData& udata) } // Initialize output -int OpenOutput(UserData& udata) +static int OpenOutput(UserData& udata) { // Header for status output std::cout << std::scientific @@ -280,7 +280,7 @@ int OpenOutput(UserData& udata) } // Write output -int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) { // Compute the error auto flag = SolutionError(t, u, e, udata); @@ -325,7 +325,7 @@ int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Finalize output -int CloseOutput(UserData& udata) +static int CloseOutput(UserData& udata) { // Footer for status output std::cout << " ----------------------------------------------" diff --git a/examples/cvode/CXX_serial/cv_kpr.hpp b/examples/cvode/CXX_serial/cv_kpr.hpp index aa258668d7..5d4d0e10b4 100644 --- a/examples/cvode/CXX_serial/cv_kpr.hpp +++ b/examples/cvode/CXX_serial/cv_kpr.hpp @@ -86,7 +86,7 @@ inline int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) // ----------------------------------------------------------------------------- // Print command line options -void InputHelp() +static void InputHelp() { std::cout << std::endl; std::cout << "Command line options:" << std::endl; @@ -98,7 +98,8 @@ void InputHelp() std::cout << " --nout : number of outputs\n"; } -int ReadInputs(std::vector<std::string>& args, Options& opts, SUNContext ctx) +static int ReadInputs(std::vector<std::string>& args, Options& opts, + SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp index f64ec2c1b7..a2d170a3cd 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp @@ -124,7 +124,7 @@ __global__ void solution_kernel(const sunindextype nx, const sunindextype ny, #endif // Compute the exact solution -int Solution(sunrealtype t, N_Vector u, UserData& udata) +static int Solution(sunrealtype t, N_Vector u, UserData& udata) { // Access problem data and set shortcuts const auto nx = udata.nx; @@ -206,7 +206,7 @@ int Solution(sunrealtype t, N_Vector u, UserData& udata) } // Compute the solution error -int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) { // Compute true solution int flag = Solution(t, e, udata); @@ -220,7 +220,7 @@ int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Print command line options -void InputHelp() +static void InputHelp() { std::cout << std::endl << "Command line options:\n" @@ -243,7 +243,7 @@ void InputHelp() } // Read command line inputs -int ReadInputs(std::vector<std::string>& args, UserData& udata) +static int ReadInputs(std::vector<std::string>& args, UserData& udata) { if (find(args.begin(), args.end(), "--help") != args.end()) { @@ -276,7 +276,7 @@ int ReadInputs(std::vector<std::string>& args, UserData& udata) } // Print user data -void PrintUserData(UserData& udata) +static void PrintUserData(UserData& udata) { std::cout << std::endl << "2D Heat problem:\n" @@ -303,7 +303,7 @@ void PrintUserData(UserData& udata) } // Initialize output -int OpenOutput(UserData& udata) +static int OpenOutput(UserData& udata) { // Header for status output std::cout << std::scientific @@ -340,7 +340,7 @@ int OpenOutput(UserData& udata) } // Write output -int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) +static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) { // Compute the error int flag = SolutionError(t, u, e, udata); @@ -398,7 +398,7 @@ int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) } // Finalize output -int CloseOutput(UserData& udata) +static int CloseOutput(UserData& udata) { // Footer for status output std::cout << " ----------------------------------------------" diff --git a/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp b/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp index 557b544885..6186d73f95 100644 --- a/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_kpr_ginkgo.hpp @@ -83,7 +83,7 @@ inline int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) // ----------------------------------------------------------------------------- // Print command line options -void InputHelp() +static void InputHelp() { std::cout << std::endl; std::cout << "Command line options:" << std::endl; @@ -94,7 +94,7 @@ void InputHelp() std::cout << " --nout : number of outputs\n"; } -int ReadInputs(std::vector<std::string>& args, Options& opts) +static int ReadInputs(std::vector<std::string>& args, Options& opts) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/examples/cvode/petsc/cv_petsc_ex7.c b/examples/cvode/petsc/cv_petsc_ex7.c index f2a72da5c3..3e9d0b6acb 100644 --- a/examples/cvode/petsc/cv_petsc_ex7.c +++ b/examples/cvode/petsc/cv_petsc_ex7.c @@ -396,7 +396,7 @@ PetscErrorCode MyCVodeMonitor(long int step, PetscReal ptime, Vec v, void* ctx) PetscFunctionBeginUser; ierr = VecNorm(v, NORM_2, &norm); CHKERRQ(ierr); - ierr = PetscPrintf(PETSC_COMM_WORLD, "timestep %D time %g norm %g\n", step, + ierr = PetscPrintf(PETSC_COMM_WORLD, "timestep %ld time %g norm %g\n", step, (double)ptime, (double)norm); CHKERRQ(ierr); PetscFunctionReturn(0); diff --git a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp index 2b67775408..d3f5cbf27b 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp @@ -493,7 +493,7 @@ int PsolveHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, static int SetInitialProfile(UserData* data, N_Vector uu, N_Vector up, N_Vector res) { - sunindextype mm, mm1, i, j; + sunindextype mm, mm1; sunrealtype xfact, yfact; mm = data->mm; @@ -513,10 +513,10 @@ static int SetInitialProfile(UserData* data, N_Vector uu, N_Vector up, #endif /* Initialize uu on all grid points. */ - for (j = 0; j < mm; j++) + for (sunindextype j = 0; j < mm; j++) { yfact = data->dx * j; - for (i = 0; i < mm; i++) + for (sunindextype i = 0; i < mm; i++) { xfact = data->dx * i; u_1d(mm * j + i) = SUN_RCONST(16.0) * xfact * (ONE - xfact) * yfact * diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp index cdd0c6b72c..35de74bfff 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp @@ -236,62 +236,68 @@ static int check_retval(void* flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -sunrealtype c1(sunrealtype u_val) { return u_val; } +static sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } +static sunrealtype c2(sunrealtype u_val) +{ + return u_val * u_val * u_val - u_val; +} // c(u) = u - u^2 -sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } +static sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -sunrealtype c4(sunrealtype u_val) { return exp(u_val); } +static sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } +static sunrealtype c5(sunrealtype u_val) +{ + return u_val * u_val * u_val * u_val; +} // c(u) = cos^2(u) - sin^2(u) -sunrealtype c6(sunrealtype u_val) +static sunrealtype c6(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)); } // c(u) = cos^2(u) - sin^2(u) - e^u -sunrealtype c7(sunrealtype u_val) +static sunrealtype c7(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)) - exp(u_val); } // c(u) = e^u * u^4 - u * e^{cos(u)} -sunrealtype c8(sunrealtype u_val) +static sunrealtype c8(sunrealtype u_val) { sunrealtype u2 = u_val * u_val; return exp(u_val) * u2 * u2 - u_val * exp(cos(u_val)); } // c(u) = e^(cos^2(u)) -sunrealtype c9(sunrealtype u_val) +static sunrealtype c9(sunrealtype u_val) { sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -sunrealtype c10(sunrealtype u_val) +static sunrealtype c10(sunrealtype u_val) { sunrealtype u2 = u_val * u_val; return 10.0 * (u_val - u2); } // c(u) = -13 + u + ((5-u)u - 2)u -sunrealtype c11(sunrealtype u_val) +static sunrealtype c11(sunrealtype u_val) { sunrealtype temp = ((5.0 - u_val) * u_val) - 2.0; return -13.0 + u_val + temp * u_val; } // c(u) = sqrt(5) * (u - u^2) -sunrealtype c12(sunrealtype u_val) +static sunrealtype c12(sunrealtype u_val) { sunrealtype temp = sqrt(5); sunrealtype u2 = u_val * u_val; @@ -299,7 +305,7 @@ sunrealtype c12(sunrealtype u_val) } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -sunrealtype c13(sunrealtype u_val) +static sunrealtype c13(sunrealtype u_val) { sunrealtype eu = u_val - exp(u_val); sunrealtype usin = u_val * sin(u_val); @@ -308,7 +314,7 @@ sunrealtype c13(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} -sunrealtype c14(sunrealtype u_val) +static sunrealtype c14(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -316,7 +322,7 @@ sunrealtype c14(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -sunrealtype c15(sunrealtype u_val) +static sunrealtype c15(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -325,7 +331,7 @@ sunrealtype c15(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -sunrealtype c16(sunrealtype u_val) +static sunrealtype c16(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -335,7 +341,7 @@ sunrealtype c16(sunrealtype u_val) } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -sunrealtype c17(sunrealtype u_val) +static sunrealtype c17(sunrealtype u_val) { sunrealtype ue_u = u_val * exp(-u_val); sunrealtype eu = exp(u_val); diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index f14c6871c5..05d6f6d09c 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -293,62 +293,68 @@ static int check_retval(void* flagvalue, const string funcname, int opt); // ----------------------------------------------------------------------------- // c(u) = u -sunrealtype c1(sunrealtype u_val) { return u_val; } +static sunrealtype c1(sunrealtype u_val) { return u_val; } // c(u) = u^3 - u -sunrealtype c2(sunrealtype u_val) { return u_val * u_val * u_val - u_val; } +static sunrealtype c2(sunrealtype u_val) +{ + return u_val * u_val * u_val - u_val; +} // c(u) = u - u^2 -sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } +static sunrealtype c3(sunrealtype u_val) { return u_val - u_val * u_val; } // c(u) = e^u -sunrealtype c4(sunrealtype u_val) { return exp(u_val); } +static sunrealtype c4(sunrealtype u_val) { return exp(u_val); } // c(u) = u^4 -sunrealtype c5(sunrealtype u_val) { return u_val * u_val * u_val * u_val; } +static sunrealtype c5(sunrealtype u_val) +{ + return u_val * u_val * u_val * u_val; +} // c(u) = cos^2(u) - sin^2(u) -sunrealtype c6(sunrealtype u_val) +static sunrealtype c6(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)); } // c(u) = cos^2(u) - sin^2(u) - e^u -sunrealtype c7(sunrealtype u_val) +static sunrealtype c7(sunrealtype u_val) { return (cos(u_val) * cos(u_val)) - (sin(u_val) * sin(u_val)) - exp(u_val); } // c(u) = e^u * u^4 - u * e^{cos(u)} -sunrealtype c8(sunrealtype u_val) +static sunrealtype c8(sunrealtype u_val) { sunrealtype u2 = u_val * u_val; return exp(u_val) * u2 * u2 - u_val * exp(cos(u_val)); } // c(u) = e^(cos^2(u)) -sunrealtype c9(sunrealtype u_val) +static sunrealtype c9(sunrealtype u_val) { sunrealtype cos2u = cos(u_val) * cos(u_val); return exp(cos2u); } // c(u) = 10(u - u^2) -sunrealtype c10(sunrealtype u_val) +static sunrealtype c10(sunrealtype u_val) { sunrealtype u2 = u_val * u_val; return 10.0 * (u_val - u2); } // c(u) = -13 + u + ((5-u)u - 2)u -sunrealtype c11(sunrealtype u_val) +static sunrealtype c11(sunrealtype u_val) { sunrealtype temp = ((5.0 - u_val) * u_val) - 2.0; return -13.0 + u_val + temp * u_val; } // c(u) = sqrt(5) * (u - u^2) -sunrealtype c12(sunrealtype u_val) +static sunrealtype c12(sunrealtype u_val) { sunrealtype temp = sqrt(5); sunrealtype u2 = u_val * u_val; @@ -356,7 +362,7 @@ sunrealtype c12(sunrealtype u_val) } // c(u) = (u - e^u)^2 + (u + u * sin(u) - cos(u))^2 -sunrealtype c13(sunrealtype u_val) +static sunrealtype c13(sunrealtype u_val) { sunrealtype eu = u_val - exp(u_val); sunrealtype usin = u_val * sin(u_val); @@ -365,7 +371,7 @@ sunrealtype c13(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} -sunrealtype c14(sunrealtype u_val) +static sunrealtype c14(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -373,7 +379,7 @@ sunrealtype c14(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 -sunrealtype c15(sunrealtype u_val) +static sunrealtype c15(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -382,7 +388,7 @@ sunrealtype c15(sunrealtype u_val) } // c(u) = u + ue^u + ue^{-u} + (u - e^u)^2 + (u + usin(u) - cos(u))^2 -sunrealtype c16(sunrealtype u_val) +static sunrealtype c16(sunrealtype u_val) { sunrealtype ueu = u_val * exp(u_val); sunrealtype ue_u = u_val * exp(-u_val); @@ -392,7 +398,7 @@ sunrealtype c16(sunrealtype u_val) } // c(u) = u + ue^{-u} + e^u*(u + sin(u) - cos(u))^3 -sunrealtype c17(sunrealtype u_val) +static sunrealtype c17(sunrealtype u_val) { sunrealtype ue_u = u_val * exp(-u_val); sunrealtype eu = exp(u_val); diff --git a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp index a1b00950c0..cddc307c5e 100644 --- a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp +++ b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp @@ -143,10 +143,15 @@ __global__ void fill_kernel(sunindextype mat_rows, sunindextype mat_cols, } #endif -void fill_matrix(gko::matrix::Csr<sunrealtype, sunindextype>* matrix) +#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) +static void fill_matrix(gko::matrix::Csr<sunrealtype, sunindextype>* matrix) +#else +static void fill_matrix( + std::shared_ptr<gko::matrix::Csr<sunrealtype, sunindextype>> matrix) +#endif { - sunindextype mat_rows = matrix->get_size()[0]; - sunindextype mat_cols = matrix->get_size()[1]; + sunindextype mat_rows = static_cast<sunindextype>(matrix->get_size()[0]); + sunindextype mat_cols = static_cast<sunindextype>(matrix->get_size()[1]); sunindextype* row_ptrs = matrix->get_row_ptrs(); sunindextype* col_idxs = matrix->get_col_idxs(); sunrealtype* mat_data = matrix->get_values(); @@ -229,10 +234,14 @@ void fill_matrix(gko::matrix::Csr<sunrealtype, sunindextype>* matrix) #endif } -void fill_matrix(gko::matrix::Dense<sunrealtype>* matrix) +#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) +static void fill_matrix(gko::matrix::Dense<sunrealtype>* matrix) +#else +static void fill_matrix(std::shared_ptr<gko::matrix::Dense<sunrealtype>> matrix) +#endif { - sunindextype mat_rows = matrix->get_size()[0]; - sunindextype mat_cols = matrix->get_size()[1]; + sunindextype mat_rows = static_cast<sunindextype>(matrix->get_size()[0]); + sunindextype mat_cols = static_cast<sunindextype>(matrix->get_size()[1]); sunrealtype* mat_data = matrix->get_values(); #if defined(USE_CUDA) || defined(USE_HIP) @@ -471,7 +480,7 @@ int main(int argc, char* argv[]) auto gko_matrix = gko::share(GkoMatrixType::create(gko_exec, matrix_dim, matrix_nnz)); - if (matcond) + if (matcond > 0) { auto gko_matdata{gko::matrix_data< sunrealtype, sunindextype>::cond(matrows, @@ -480,7 +489,14 @@ int main(int argc, char* argv[]) gko_matdata.remove_zeros(); gko_matrix->read(gko_matdata); } - else { fill_matrix(gko::lend(gko_matrix)); } + else + { +#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) + fill_matrix(gko::lend(gko_matrix)); +#else + fill_matrix(gko_matrix); +#endif + } A = std::make_unique<sundials::ginkgo::Matrix<GkoMatrixType>>(std::move( gko_matrix), sunctx); @@ -489,7 +505,7 @@ int main(int argc, char* argv[]) { using GkoMatrixType = gko::matrix::Dense<sunrealtype>; auto gko_matrix = gko::share(GkoMatrixType::create(gko_exec, matrix_dim)); - if (matcond) + if (matcond > 0) { auto gko_matdata{gko::matrix_data< sunrealtype, sunindextype>::cond(matrows, @@ -501,7 +517,11 @@ int main(int argc, char* argv[]) else { gko_matrix->fill(0.0); +#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) fill_matrix(gko::lend(gko_matrix)); +#else + fill_matrix(gko_matrix); +#endif } A = std::make_unique<sundials::ginkgo::Matrix<GkoMatrixType>>(std::move( gko_matrix), diff --git a/examples/sunlinsol/kokkos/test_sunlinsol_kokkosdense.cpp b/examples/sunlinsol/kokkos/test_sunlinsol_kokkosdense.cpp index cc42870024..5099ff8044 100644 --- a/examples/sunlinsol/kokkos/test_sunlinsol_kokkosdense.cpp +++ b/examples/sunlinsol/kokkos/test_sunlinsol_kokkosdense.cpp @@ -164,7 +164,7 @@ int main(int argc, char* argv[]) * ---------------------------------------------------------------------------*/ KOKKOS_FUNCTION -int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) +static int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) { if (a == b) { return 0; } if (std::isnan(a) || std::isnan(b)) { return 1; } diff --git a/examples/sunmatrix/dreadrb.c b/examples/sunmatrix/dreadrb.c index 86ab792353..9d24da993a 100644 --- a/examples/sunmatrix/dreadrb.c +++ b/examples/sunmatrix/dreadrb.c @@ -120,6 +120,8 @@ * </pre> */ +#include "dreadrb.h" + #include <stdio.h> #include <stdlib.h> #include <sundials/sundials_types.h> diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index f7381b7f17..4c7bb27f3c 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -213,7 +213,8 @@ int main(int argc, char* argv[]) auto Arowptrs{gko_matrix->get_const_row_ptrs()}; auto Acolidxs{gko_matrix->get_const_col_idxs()}; auto Avalues{gko_matrix->get_const_values()}; - for (auto irow = 0; irow < gko_matrix->get_size()[0]; irow++) + for (sunindextype irow = 0; + irow < static_cast<sunindextype>(gko_matrix->get_size()[0]); irow++) { for (auto inz = gko_exec->copy_val_to_host(Arowptrs + irow); inz < gko_exec->copy_val_to_host(Arowptrs + irow + 1); inz++) @@ -299,7 +300,7 @@ int main(int argc, char* argv[]) /* ---------------------------------------------------------------------- * Check matrix * --------------------------------------------------------------------*/ -int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) +static int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{ @@ -309,10 +310,7 @@ int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) auto Amat_ref = Amat->clone(Amat->get_executor()->get_master()); auto Bmat_ref = Bmat->clone(Bmat->get_executor()->get_master()); auto Arowptrs{Amat_ref->get_const_row_ptrs()}; - auto Acolidxs{Amat_ref->get_const_col_idxs()}; auto Avalues{Amat_ref->get_const_values()}; - auto Browptrs{Bmat_ref->get_const_row_ptrs()}; - auto Bcolidxs{Bmat_ref->get_const_col_idxs()}; auto Bvalues{Bmat_ref->get_const_values()}; /* check lengths */ @@ -323,7 +321,8 @@ int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) } /* compare data */ - for (sunindextype irow = 0; irow < Amat_ref->get_size()[0]; irow++) + for (sunindextype irow = 0; + irow < static_cast<sunindextype>(Amat_ref->get_size()[0]); irow++) { for (sunindextype inz = Arowptrs[irow]; inz < Arowptrs[irow + 1]; inz++) { @@ -334,7 +333,7 @@ int check_matrix_csr(SUNMatrix A, SUNMatrix B, sunrealtype tol) return failure > 0; } -int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) +static int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) { int failure{0}; auto Amat{ @@ -354,9 +353,9 @@ int check_matrix_dense(SUNMatrix A, SUNMatrix B, sunrealtype tol) } /* compare data */ - for (sunindextype i = 0; i < rows; i++) + for (sunindextype i = 0; i < static_cast<sunindextype>(rows); i++) { - for (sunindextype j = 0; j < cols; j++) + for (sunindextype j = 0; j < static_cast<sunindextype>(cols); j++) { failure += SUNRCompareTol(Amat_ref->at(i, j), Bmat_ref->at(i, j), tol); } @@ -372,18 +371,18 @@ extern "C" int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) else { return 1; } } -int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) +static int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure{0}; auto Amat{ static_cast<sundials::ginkgo::Matrix<GkoCsrMat>*>(A->content)->GkoMtx()}; auto Amat_ref = Amat->clone(Amat->get_executor()->get_master()); auto Arowptrs{Amat_ref->get_const_row_ptrs()}; - auto Acolidxs{Amat_ref->get_const_col_idxs()}; auto Avalues{Amat_ref->get_const_values()}; /* compare data */ - for (sunindextype irow = 0; irow < Amat_ref->get_size()[0]; irow++) + for (sunindextype irow = 0; + irow < static_cast<sunindextype>(Amat_ref->get_size()[0]); irow++) { for (sunindextype inz = Arowptrs[irow]; inz < Arowptrs[irow + 1]; inz++) { @@ -400,7 +399,7 @@ int check_matrix_entry_csr(SUNMatrix A, sunrealtype val, sunrealtype tol) return failure > 0; } -int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) +static int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) { int failure{0}; auto Amat{ @@ -410,9 +409,9 @@ int check_matrix_entry_dense(SUNMatrix A, sunrealtype val, sunrealtype tol) auto Amat_ref = Amat->clone(Amat->get_executor()->get_master()); /* compare data */ - for (sunindextype i = 0; i < rows; i++) + for (sunindextype i = 0; i < static_cast<sunindextype>(rows); i++) { - for (sunindextype j = 0; j < cols; j++) + for (sunindextype j = 0; j < static_cast<sunindextype>(cols); j++) { int check = SUNRCompareTol(Amat_ref->at(i, j), val, tol); if (check) @@ -537,4 +536,4 @@ extern "C" void sync_device(SUNMatrix A) ->GkoExec() ->synchronize(); } -} \ No newline at end of file +} diff --git a/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp b/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp index 17fbf4d8a6..cb0d3374f2 100644 --- a/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp +++ b/examples/sunmatrix/kokkos/test_sunmatrix_kokkosdense.cpp @@ -174,7 +174,7 @@ int main(int argc, char* argv[]) * ---------------------------------------------------------------------------*/ KOKKOS_FUNCTION -int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) +static int CompareTol(sunrealtype a, sunrealtype b, sunrealtype tol) { if (a == b) { return 0; } if (std::isnan(a) || std::isnan(b)) { return 1; } diff --git a/examples/utilities/example_utilities.hpp b/examples/utilities/example_utilities.hpp index e21c762126..00b4d843fc 100644 --- a/examples/utilities/example_utilities.hpp +++ b/examples/utilities/example_utilities.hpp @@ -21,7 +21,7 @@ #include <vector> // Check for an unrecoverable (negative) return value from a SUNDIALS function -int check_flag(const int flag, const std::string funcname) +static int check_flag(const int flag, const std::string funcname) { if (flag < 0) { @@ -32,7 +32,7 @@ int check_flag(const int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(const void* ptr, const std::string funcname) +static int check_ptr(const void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp b/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp index 02779a18e3..8b2d68eb08 100644 --- a/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp +++ b/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp @@ -54,8 +54,8 @@ static constexpr scalar_type one = 1.0; static constexpr scalar_type onept5 = 1.5; /*---------------------------------------------------------------- - * Streaming vector kernels - *---------------------------------------------------------------*/ + * Streaming vector kernels + *---------------------------------------------------------------*/ /// Divide: z(i) = x(i)/y(i) forall i inline void elementWiseDivide(const vector_type& x, const vector_type& y, @@ -339,8 +339,6 @@ inline bool invTest(const vector_type& x, vector_type& z) Kokkos::parallel_reduce( "invTest", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - static constexpr scalar_type zero = 0; - static constexpr scalar_type one = 1.0; if (x_1d(i) == zero) { min_reducer.join(local_min, zero); } else { z_1d(i) = one / x_1d(i); } }, @@ -665,8 +663,6 @@ inline bool invTestLocal(const vector_type& x, vector_type& z) Kokkos::parallel_reduce( "invTestLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - static constexpr scalar_type zero = 0; - static constexpr scalar_type one = 1.0; if (x_1d(i) == zero) { min_reducer.join(local_min, zero); } else { z_1d(i) = one / x_1d(i); } }, diff --git a/include/sunlinsol/sunlinsol_ginkgo.hpp b/include/sunlinsol/sunlinsol_ginkgo.hpp index d801cb1da9..2817d426a9 100644 --- a/include/sunlinsol/sunlinsol_ginkgo.hpp +++ b/include/sunlinsol/sunlinsol_ginkgo.hpp @@ -332,11 +332,19 @@ class LinearSolver : public ConvertibleTo<SUNLinearSolver> } iter_count_ = static_cast<int>(logger->get_num_iterations()); +#if (GKO_VERSION_MAJOR == 1) && (GKO_VERSION_MINOR < 6) GkoExec()->get_master()->copy_from(gko::lend(GkoExec()), 1, gko::as<impl::GkoDenseMat>( logger->get_residual_norm()) ->get_const_values(), &res_norm_); +#else + GkoExec()->get_master()->copy_from(GkoExec(), 1, + gko::as<impl::GkoDenseMat>( + logger->get_residual_norm()) + ->get_const_values(), + &res_norm_); +#endif return result; } diff --git a/include/sunlinsol/sunlinsol_kokkosdense.hpp b/include/sunlinsol/sunlinsol_kokkosdense.hpp index ba109bb2be..2fbda953bd 100644 --- a/include/sunlinsol/sunlinsol_kokkosdense.hpp +++ b/include/sunlinsol/sunlinsol_kokkosdense.hpp @@ -40,12 +40,12 @@ class DenseLinearSolver; namespace impl { -SUNLinearSolver_Type SUNLinSolGetType_KokkosDense(SUNLinearSolver S) +static SUNLinearSolver_Type SUNLinSolGetType_KokkosDense(SUNLinearSolver S) { return SUNLINEARSOLVER_DIRECT; } -SUNLinearSolver_ID SUNLinSolGetID_KokkosDense(SUNLinearSolver S) +static SUNLinearSolver_ID SUNLinSolGetID_KokkosDense(SUNLinearSolver S) { return SUNLINEARSOLVER_KOKKOSDENSE; } diff --git a/include/sunmatrix/sunmatrix_kokkosdense.hpp b/include/sunmatrix/sunmatrix_kokkosdense.hpp index d172ba73df..15bf696dee 100644 --- a/include/sunmatrix/sunmatrix_kokkosdense.hpp +++ b/include/sunmatrix/sunmatrix_kokkosdense.hpp @@ -46,7 +46,7 @@ inline MatrixType* GetDenseMat(SUNMatrix A) namespace impl { -SUNMatrix_ID SUNMatGetID_KokkosDense(SUNMatrix A) +static SUNMatrix_ID SUNMatGetID_KokkosDense(SUNMatrix A) { return SUNMATRIX_KOKKOSDENSE; } diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod/farkode_arkstep_mod.f90 index 165149355b..cc0373f1eb 100644 --- a/src/arkode/fmod/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod/farkode_arkstep_mod.f90 @@ -26,6 +26,7 @@ module farkode_arkstep_mod private ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_1 = ARKODE_FORWARD_EULER_1_1 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_2 = ARKODE_HEUN_EULER_2_1_2 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3 integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_4 = ARKODE_ZONNEVELD_5_3_4 @@ -34,6 +35,7 @@ module farkode_arkstep_mod 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_1 = ARKODE_BACKWARD_EULER_1_1 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 diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod/farkode_erkstep_mod.f90 index 797d0ca9ff..291dc643d5 100644 --- a/src/arkode/fmod/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod/farkode_erkstep_mod.f90 @@ -26,6 +26,7 @@ module farkode_erkstep_mod private ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_1 = ARKODE_FORWARD_EULER_1_1 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_2 = ARKODE_HEUN_EULER_2_1_2 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3 integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_4 = ARKODE_ZONNEVELD_5_3_4 diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index 7c30d3538c..ca1e745b98 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -89,7 +89,7 @@ if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) SOURCES cvode_fused_stubs.c LINK_LIBRARIES - PUBLIC sundials_core + PUBLIC sundials_core OUTPUT_NAME sundials_cvode_fused_stubs VERSION diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 379c0fa0c2..368db3e53f 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -138,16 +138,6 @@ static void cvFreeVectors(CVodeMem cv_mem); static int cvEwtSetSS(CVodeMem cv_mem, N_Vector ycur, N_Vector weight); static int cvEwtSetSV(CVodeMem cv_mem, N_Vector ycur, N_Vector weight); -#ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS -extern int cvEwtSetSS_fused(const sunbooleantype atolmin0, - const sunrealtype reltol, const sunrealtype Sabstol, - const N_Vector ycur, N_Vector tempv, N_Vector weight); - -extern int cvEwtSetSV_fused(const sunbooleantype atolmin0, - const sunrealtype reltol, const N_Vector Vabstol, - const N_Vector ycur, N_Vector tempv, N_Vector weight); -#endif - /* Initial stepsize calculation */ static int cvHin(CVodeMem cv_mem, sunrealtype tout); @@ -183,11 +173,6 @@ static void cvSetTqBDF(CVodeMem cv_mem, sunrealtype hsum, sunrealtype alpha0, static int cvNls(CVodeMem cv_mem, int nflag); static int cvCheckConstraints(CVodeMem cv_mem); -#ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS -extern int cvCheckConstraints_fused(const N_Vector c, const N_Vector ewt, - const N_Vector y, const N_Vector mm, - N_Vector tempv); -#endif static int cvHandleNFlag(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, int* ncfPtr); diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index e24592c827..ab73f5ac55 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -23,20 +23,6 @@ #include "cvode_diag_impl.h" #include "cvode_impl.h" -#ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS -extern int cvDiagSetup_formY(const sunrealtype h, const sunrealtype r, - const N_Vector fpred, const N_Vector zn1, - const N_Vector ypred, N_Vector ftemp, N_Vector y); - -extern int cvDiagSetup_buildM(const sunrealtype fract, const sunrealtype uround, - const sunrealtype h, const N_Vector ftemp, - const N_Vector fpred, const N_Vector ewt, - N_Vector bit, N_Vector bitcomp, N_Vector y, - N_Vector M); - -int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); -#endif - /* Other Constants */ #define FRACT SUN_RCONST(0.1) diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index d7d9d08823..c8d08a32fb 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -634,6 +634,34 @@ void cvRestore(CVodeMem cv_mem, sunrealtype saved_t); void cvRescale(CVodeMem cv_mem); +#ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS +int cvEwtSetSS_fused(const sunbooleantype atolmin0, const sunrealtype reltol, + const sunrealtype Sabstol, const N_Vector ycur, + N_Vector tempv, N_Vector weight); + +int cvEwtSetSV_fused(const sunbooleantype atolmin0, const sunrealtype reltol, + const N_Vector Vabstol, const N_Vector ycur, + N_Vector tempv, N_Vector weight); + +int cvCheckConstraints_fused(const N_Vector c, const N_Vector ewt, + const N_Vector y, const N_Vector mm, N_Vector tempv); + +int cvNlsResid_fused(const sunrealtype rl1, const sunrealtype ngamma, + const N_Vector zn1, const N_Vector ycor, + const N_Vector ftemp, N_Vector res); + +int cvDiagSetup_formY(const sunrealtype h, const sunrealtype r, + const N_Vector fpred, const N_Vector zn1, + const N_Vector ypred, N_Vector ftemp, N_Vector y); + +int cvDiagSetup_buildM(const sunrealtype fract, const sunrealtype uround, + const sunrealtype h, const N_Vector ftemp, + const N_Vector fpred, const N_Vector ewt, N_Vector bit, + N_Vector bitcomp, N_Vector y, N_Vector M); + +int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); +#endif + /* * ================================================================= * E R R O R M E S S A G E S diff --git a/src/cvode/cvode_nls.c b/src/cvode/cvode_nls.c index ade248a1b9..7821bd976a 100644 --- a/src/cvode/cvode_nls.c +++ b/src/cvode/cvode_nls.c @@ -40,12 +40,6 @@ static int cvNlsLSolve(N_Vector delta, void* cvode_mem); static int cvNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* cvode_mem); -#ifdef SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS -int cvNlsResid_fused(const sunrealtype rl1, const sunrealtype ngamma, - const N_Vector zn1, const N_Vector ycor, - const N_Vector ftemp, N_Vector res); -#endif - /* ----------------------------------------------------------------------------- * Exported functions * ---------------------------------------------------------------------------*/ diff --git a/src/sundials/fmod/fsundials_core_mod.c b/src/sundials/fmod/fsundials_core_mod.c index 4af16b91a4..c369799cce 100644 --- a/src/sundials/fmod/fsundials_core_mod.c +++ b/src/sundials/fmod/fsundials_core_mod.c @@ -2516,6 +2516,14 @@ SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_NewEmpty(void *farg1) { } +SWIGEXPORT void _wrap_FSUNAdaptController_DestroyEmpty(SUNAdaptController farg1) { + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + + arg1 = (SUNAdaptController)(farg1); + SUNAdaptController_DestroyEmpty(arg1); +} + + SWIGEXPORT int _wrap_FSUNAdaptController_GetType(SUNAdaptController farg1) { int fresult ; SUNAdaptController arg1 = (SUNAdaptController) 0 ; diff --git a/src/sundials/fmod/fsundials_core_mod.f90 b/src/sundials/fmod/fsundials_core_mod.f90 index 4334dfe0d3..c51487dd30 100644 --- a/src/sundials/fmod/fsundials_core_mod.f90 +++ b/src/sundials/fmod/fsundials_core_mod.f90 @@ -536,6 +536,7 @@ module fsundials_core_mod type(C_PTR), public :: sunctx end type SUNAdaptController public :: FSUNAdaptController_NewEmpty + public :: FSUNAdaptController_DestroyEmpty public :: FSUNAdaptController_GetType public :: FSUNAdaptController_Destroy public :: FSUNAdaptController_EstimateStep @@ -1955,6 +1956,12 @@ function swigc_FSUNAdaptController_NewEmpty(farg1) & type(C_PTR) :: fresult end function +subroutine swigc_FSUNAdaptController_DestroyEmpty(farg1) & +bind(C, name="_wrap_FSUNAdaptController_DestroyEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + function swigc_FSUNAdaptController_GetType(farg1) & bind(C, name="_wrap_FSUNAdaptController_GetType") & result(fresult) @@ -4622,6 +4629,15 @@ function FSUNAdaptController_NewEmpty(sunctx) & call c_f_pointer(fresult, swig_result) end function +subroutine FSUNAdaptController_DestroyEmpty(c) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +call swigc_FSUNAdaptController_DestroyEmpty(farg1) +end subroutine + function FSUNAdaptController_GetType(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/sundials_futils.c b/src/sundials/sundials_futils.c index e494fe7447..3a0d0f27d1 100644 --- a/src/sundials/sundials_futils.c +++ b/src/sundials/sundials_futils.c @@ -17,6 +17,7 @@ #include <string.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_errors.h> +#include <sundials/sundials_futils.h> /* Create a file pointer with the given file name and mode. */ SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp_out) diff --git a/test/env/default.sh b/test/env/default.sh index fb6ed34802..3085490055 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -139,11 +139,6 @@ if [ "$compilername" == "gcc" ]; then export CUDAFLAGS="-g -O3" fi - # append additional warning flags - if [[ "$SUNDIALS_PRECISION" == "double" && "$SUNDIALS_INDEX_SIZE" == "32" ]]; then - export CFLAGS="${CFLAGS} -Wconversion -Wno-sign-conversion" - export CXXFLAGS="${CXXFLAGS} -Wconversion -Wno-sign-conversion" - fi # TODO(CJB): add this back after we upgrade the GNU compiler stack on the Jenkins box # Currently this causes the compiler to segfault on many of the Fortran example codes. # export FFLAGS="${FFLAGS} -fbounds-check" diff --git a/test/env/docker.sh b/test/env/docker.sh index 2ab9b50410..2f9359af0d 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -178,9 +178,6 @@ else # single export SUNDIALS_TEST_INTEGER_PRECISION=10 fi -# FindMPI fails with this ON -export SUNDIALS_ENABLE_WARNINGS_AS_ERRORS=OFF - # ------------------------------------------------------------------------------ # Third party libraries # ------------------------------------------------------------------------------ diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp index 7b3598451d..9b53b9083b 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_getjac.cpp @@ -89,7 +89,7 @@ static int ytrue(sunrealtype t, N_Vector y) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -117,8 +117,8 @@ int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, - N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -145,7 +145,7 @@ int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -155,7 +155,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp index af9168d5fd..4737434ff6 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp @@ -90,7 +90,7 @@ static int ytrue(sunrealtype t, N_Vector y) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -116,7 +116,7 @@ int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) /* ----------------------------------------------------------------------------- * Compute the fast ODE RHS function * ---------------------------------------------------------------------------*/ -int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { N_VConst(ZERO, ydot); return 0; @@ -127,8 +127,8 @@ int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, - N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -155,7 +155,7 @@ int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -165,7 +165,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c index f79566aa6f..7e16e77946 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c +++ b/test/unit_tests/arkode/C_serial/ark_test_innerstepper.c @@ -32,7 +32,7 @@ #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) +static 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); @@ -40,8 +40,8 @@ int ode_slow_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) return 0; } -int fast_evolve(MRIStepInnerStepper fast_mem, sunrealtype t0, sunrealtype tf, - N_Vector y) +static 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); diff --git a/test/unit_tests/arkode/C_serial/ark_test_mass.c b/test/unit_tests/arkode/C_serial/ark_test_mass.c index c011d11209..d50eed86c0 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_mass.c +++ b/test/unit_tests/arkode/C_serial/ark_test_mass.c @@ -92,8 +92,9 @@ static int check_retval(void* flagvalue, const char* funcname, int opt) return 0; } -int solve(const char* im, const char* ex, int steps, sunbooleantype time_dep, - sunbooleantype deduce_implicit_rhs, long int expected_mass_solves) +static int solve(const char* im, const char* ex, int steps, + sunbooleantype time_dep, sunbooleantype deduce_implicit_rhs, + long int expected_mass_solves) { int retval = 0; int s; diff --git a/test/unit_tests/arkode/C_serial/ark_test_tstop.c b/test/unit_tests/arkode/C_serial/ark_test_tstop.c index 7498e251bb..80cb6b9e2f 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_tstop.c +++ b/test/unit_tests/arkode/C_serial/ark_test_tstop.c @@ -33,15 +33,16 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* ydot_data = N_VGetArrayPointer(ydot); ydot_data[0] = ONE; return 0; } -int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, void* user_data, - N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) +static int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, + void* user_data, N_Vector tempv1, N_Vector tempv2, + N_Vector tempv3) { sunrealtype* J_data = SUNDenseMatrix_Data(J); J_data[0] = ZERO; diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_getjac.cpp b/test/unit_tests/cvode/CXX_serial/cv_test_getjac.cpp index b671ad3911..4475159260 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_getjac.cpp +++ b/test/unit_tests/cvode/CXX_serial/cv_test_getjac.cpp @@ -89,7 +89,7 @@ static int ytrue(sunrealtype t, N_Vector y) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -117,8 +117,8 @@ int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, - N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -145,7 +145,7 @@ int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -155,7 +155,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp index e4d8cd1884..1a0675efbb 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.hpp @@ -129,7 +129,7 @@ static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const string funcname) +static int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -138,7 +138,7 @@ int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const string funcname) +static int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -193,7 +193,7 @@ inline void find_arg(vector<string>& args, const string key, bool& dest, } // Print command line options -void InputHelp() +static void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -217,7 +217,7 @@ void InputHelp() cout << " --nout : number of outputs\n"; } -int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/test/unit_tests/cvode/C_serial/cv_test_tstop.c b/test/unit_tests/cvode/C_serial/cv_test_tstop.c index 33a5a2bcc6..f8809e2c19 100644 --- a/test/unit_tests/cvode/C_serial/cv_test_tstop.c +++ b/test/unit_tests/cvode/C_serial/cv_test_tstop.c @@ -33,15 +33,16 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* ydot_data = N_VGetArrayPointer(ydot); ydot_data[0] = ONE; return 0; } -int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, void* user_data, - N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) +static int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, + void* user_data, N_Vector tempv1, N_Vector tempv2, + N_Vector tempv3) { sunrealtype* J_data = SUNDenseMatrix_Data(J); J_data[0] = ZERO; diff --git a/test/unit_tests/cvode/gtest/CMakeLists.txt b/test/unit_tests/cvode/gtest/CMakeLists.txt index 997358abdb..df16114295 100644 --- a/test/unit_tests/cvode/gtest/CMakeLists.txt +++ b/test/unit_tests/cvode/gtest/CMakeLists.txt @@ -20,12 +20,17 @@ target_include_directories(test_cvode_error_handling ${CMAKE_SOURCE_DIR}/src ) +if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) + set(_fused_link_lib sundials_cvode_fused_stubs_obj) +endif() + # We explicitly choose which object libraries to link to and link in the # cvode objects so that we have access to private functions w/o changing # their visibility in the installed libraries. target_link_libraries(test_cvode_error_handling PRIVATE $<TARGET_OBJECTS:sundials_cvode_obj> + ${_fused_link_lib} sundials_sunmemsys_obj sundials_nvecserial_obj sundials_sunlinsolband_obj diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_getjac.cpp b/test/unit_tests/cvodes/CXX_serial/cvs_test_getjac.cpp index 0b805b419b..6c26d1bf3d 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_getjac.cpp +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_getjac.cpp @@ -88,7 +88,7 @@ static int ytrue(sunrealtype t, N_Vector y) * [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] * [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] * ---------------------------------------------------------------------------*/ -int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -116,8 +116,8 @@ int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, - N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -144,7 +144,7 @@ int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -154,7 +154,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp index a669dd9b1b..6142b566c9 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.hpp @@ -129,7 +129,7 @@ static int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const string funcname) +static int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -138,7 +138,7 @@ int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const string funcname) +static int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -193,7 +193,7 @@ inline void find_arg(vector<string>& args, const string key, bool& dest, } // Print command line options -void InputHelp() +static void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -217,7 +217,7 @@ void InputHelp() cout << " --nout : number of outputs\n"; } -int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c b/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c index a465618540..ede859ef67 100644 --- a/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c +++ b/test/unit_tests/cvodes/C_serial/cvs_test_tstop.c @@ -33,15 +33,16 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +static int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* ydot_data = N_VGetArrayPointer(ydot); ydot_data[0] = ONE; return 0; } -int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, void* user_data, - N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) +static int ode_jac(sunrealtype t, N_Vector y, N_Vector f, SUNMatrix J, + void* user_data, N_Vector tempv1, N_Vector tempv2, + N_Vector tempv3) { sunrealtype* J_data = SUNDenseMatrix_Data(J); J_data[0] = ZERO; diff --git a/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp b/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp index 72e2b48b25..aa372836e3 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_getjac.cpp @@ -105,7 +105,8 @@ static int yptrue(sunrealtype t, N_Vector yp) * [a b] * [ (-1 + u^2 - r(t)) ] + [ r'(t) ] - [ 2 u u'] = 0 * [c d] [ (-2 + v^2 - s(t)) ] [ s'(t) ] - [ 2 v v'] = 0 * ---------------------------------------------------------------------------*/ -int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) +static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, + void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -137,8 +138,9 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, - SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, + N_Vector res, SUNMatrix J, void* user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -167,8 +169,8 @@ int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, // Custom linear solver solve function // ----------------------------------------------------------------------------- -int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) +static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); @@ -196,7 +198,7 @@ int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -206,7 +208,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp b/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp index ab5573b882..b7088929e3 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr.hpp @@ -123,7 +123,7 @@ static int true_sol_p(sunrealtype t, sunrealtype* up, sunrealtype* vp) // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const string funcname) +static int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -132,7 +132,7 @@ int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const string funcname) +static int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -187,7 +187,7 @@ inline void find_arg(vector<string>& args, const string key, bool& dest, } // Print command line options -void InputHelp() +static void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -205,7 +205,7 @@ void InputHelp() cout << " --nout : number of outputs\n"; } -int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/test/unit_tests/ida/C_serial/ida_test_tstop.c b/test/unit_tests/ida/C_serial/ida_test_tstop.c index 180fe263a8..27fffde375 100644 --- a/test/unit_tests/ida/C_serial/ida_test_tstop.c +++ b/test/unit_tests/ida/C_serial/ida_test_tstop.c @@ -33,8 +33,8 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, - void* user_data) +static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, + void* user_data) { sunrealtype* ydot_data = N_VGetArrayPointer(ydot); sunrealtype* res_data = N_VGetArrayPointer(res); @@ -42,9 +42,9 @@ int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, return 0; } -int dae_jac(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, - SUNMatrix J, void* user_data, N_Vector tempv1, N_Vector tempv2, - N_Vector tempv3) +static int dae_jac(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, + N_Vector rr, SUNMatrix J, void* user_data, N_Vector tempv1, + N_Vector tempv2, N_Vector tempv3) { sunrealtype* J_data = SUNDenseMatrix_Data(J); J_data[0] = ONE; diff --git a/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp b/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp index 7c50f7f5da..0775840110 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_getjac.cpp @@ -105,7 +105,8 @@ static int yptrue(sunrealtype t, N_Vector yp) * [a b] * [ (-1 + u^2 - r(t)) ] + [ r'(t) ] - [ 2 u u'] = 0 * [c d] [ (-2 + v^2 - s(t)) ] [ s'(t) ] - [ 2 v v'] = 0 * ---------------------------------------------------------------------------*/ -int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) +static int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, + void* user_data) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -137,8 +138,9 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector res, void* user_data) * [2 a u - 2 u' - 2 cj u 2 b v ] * [2 c u 2 d v - 2 v' - 2 cj v ] * ---------------------------------------------------------------------------*/ -int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, - SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +static int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, + N_Vector res, SUNMatrix J, void* user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3) { sunrealtype* udata = (sunrealtype*)user_data; const sunrealtype a = udata[0]; @@ -167,8 +169,8 @@ int J(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector res, // Custom linear solver solve function // ----------------------------------------------------------------------------- -int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) +static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); @@ -196,7 +198,7 @@ int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -206,7 +208,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp b/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp index 2860e2e511..95f91c331d 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr.hpp @@ -123,7 +123,7 @@ static int true_sol_p(sunrealtype t, sunrealtype* up, sunrealtype* vp) // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const string funcname) +static int check_flag(int flag, const string funcname) { if (!flag) { return 0; } if (flag < 0) { cerr << "ERROR: "; } @@ -132,7 +132,7 @@ int check_flag(int flag, const string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const string funcname) +static int check_ptr(void* ptr, const string funcname) { if (ptr) { return 0; } cerr << "ERROR: " << funcname << " returned NULL" << endl; @@ -187,7 +187,7 @@ inline void find_arg(vector<string>& args, const string key, bool& dest, } // Print command line options -void InputHelp() +static void InputHelp() { cout << endl; cout << "Command line options:" << endl; @@ -205,7 +205,7 @@ void InputHelp() cout << " --nout : number of outputs\n"; } -int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) +static int ReadInputs(vector<string>& args, TestOptions& opts, SUNContext ctx) { if (find(args.begin(), args.end(), "--help") != args.end()) { diff --git a/test/unit_tests/idas/C_serial/idas_test_tstop.c b/test/unit_tests/idas/C_serial/idas_test_tstop.c index b647c9fd8e..3303a390a8 100644 --- a/test/unit_tests/idas/C_serial/idas_test_tstop.c +++ b/test/unit_tests/idas/C_serial/idas_test_tstop.c @@ -33,8 +33,8 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, - void* user_data) +static int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, + void* user_data) { sunrealtype* ydot_data = N_VGetArrayPointer(ydot); sunrealtype* res_data = N_VGetArrayPointer(res); @@ -42,9 +42,9 @@ int dae_res(sunrealtype t, N_Vector y, N_Vector ydot, N_Vector res, return 0; } -int dae_jac(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, N_Vector rr, - SUNMatrix J, void* user_data, N_Vector tempv1, N_Vector tempv2, - N_Vector tempv3) +static int dae_jac(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, + N_Vector rr, SUNMatrix J, void* user_data, N_Vector tempv1, + N_Vector tempv2, N_Vector tempv3) { sunrealtype* J_data = SUNDenseMatrix_Data(J); J_data[0] = ONE; diff --git a/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp b/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp index 67185076a6..cb3abe9da2 100644 --- a/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp +++ b/test/unit_tests/kinsol/CXX_serial/kin_test_getjac.cpp @@ -83,7 +83,7 @@ * x^2 - 81(y-0.9)^2 + sin(z) + 1.06 = 0 * exp(-x(y-1)) + 20z + (10 pi - 3)/3 = 0 * ---------------------------------------------------------------------------*/ -int res(N_Vector uu, N_Vector fuu, void* user_data) +static int res(N_Vector uu, N_Vector fuu, void* user_data) { /* Get vector data arrays */ sunrealtype* udata = N_VGetArrayPointer(uu); @@ -108,8 +108,8 @@ int res(N_Vector uu, N_Vector fuu, void* user_data) * [ exp(-x(y-1))(1-y) -exp(-x(y-1))x 20 ] * ---------------------------------------------------------------------------*/ -int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void* user_data, N_Vector tmp1, - N_Vector tmp2) +static int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void* user_data, + N_Vector tmp1, N_Vector tmp2) { sunrealtype* udata = N_VGetArrayPointer(uu); sunrealtype* Jdata = SUNDenseMatrix_Data(J); @@ -140,8 +140,8 @@ int J(N_Vector uu, N_Vector fuu, SUNMatrix J, void* user_data, N_Vector tmp1, // Custom linear solver solve function // ----------------------------------------------------------------------------- -int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) +static int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, + N_Vector b, sunrealtype tol) { // Create a copy of the matrix for factorization SUNMatrix Acpy = SUNMatClone(A); @@ -169,7 +169,7 @@ int DenseSetupAndSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, // ----------------------------------------------------------------------------- // Check function return flag -int check_flag(int flag, const std::string funcname) +static int check_flag(int flag, const std::string funcname) { if (!flag) { return 0; } if (flag < 0) { std::cerr << "ERROR: "; } @@ -179,7 +179,7 @@ int check_flag(int flag, const std::string funcname) } // Check if a function returned a NULL pointer -int check_ptr(void* ptr, const std::string funcname) +static int check_ptr(void* ptr, const std::string funcname) { if (ptr) { return 0; } std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; diff --git a/test/unit_tests/profiling/test_profiling.cpp b/test/unit_tests/profiling/test_profiling.cpp index 8b4bcfc820..0db4c3e101 100644 --- a/test/unit_tests/profiling/test_profiling.cpp +++ b/test/unit_tests/profiling/test_profiling.cpp @@ -23,7 +23,7 @@ #include "sundials/sundials_profiler.h" #include "sundials/sundials_types.h" -int sleep(SUNProfiler prof, int sec, double* chrono) +static int sleep(SUNProfiler prof, int sec, double* chrono) { auto begin = std::chrono::steady_clock::now(); @@ -43,7 +43,7 @@ int sleep(SUNProfiler prof, int sec, double* chrono) return 0; } -int print_timings(SUNProfiler prof) +static int print_timings(SUNProfiler prof) { // Output timing in default (table) format int flag = SUNProfiler_Print(prof, stdout); diff --git a/test/unit_tests/sundials/reductions/test_reduction_operators.cpp b/test/unit_tests/sundials/reductions/test_reduction_operators.cpp index 4e7601def4..bda983b0dc 100644 --- a/test/unit_tests/sundials/reductions/test_reduction_operators.cpp +++ b/test/unit_tests/sundials/reductions/test_reduction_operators.cpp @@ -22,7 +22,7 @@ using namespace sundials::reductions; using namespace sundials::reductions::impl; -int testPlusWithInts() +static int testPlusWithInts() { const std::string testStr = "Running testPlusWithInts"; @@ -41,7 +41,7 @@ int testPlusWithInts() return !pass; } -int testPlusWithDoubles() +static int testPlusWithDoubles() { const std::string testStr = "Running testPlusWithDoubles"; @@ -60,7 +60,7 @@ int testPlusWithDoubles() return !pass; } -int testMaximumWithInts() +static int testMaximumWithInts() { const std::string testStr = "Running testMaximumWithInts"; @@ -83,7 +83,7 @@ int testMaximumWithInts() return !pass; } -int testMaximumWithDoubles() +static int testMaximumWithDoubles() { const std::string testStr = "Running testMaximumWithDoubles"; @@ -106,7 +106,7 @@ int testMaximumWithDoubles() return !pass; } -int testMinimumWithInts() +static int testMinimumWithInts() { const std::string testStr = "Running testMinimumWithInts"; @@ -129,7 +129,7 @@ int testMinimumWithInts() return !pass; } -int testMinimumWithDoubles() +static int testMinimumWithDoubles() { const std::string testStr = "Running testMinimumWithDoubles"; diff --git a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp index 4fab019e00..2abba4d927 100644 --- a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp +++ b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp @@ -14,8 +14,8 @@ #include <sundials/sundials_core.hpp> #include <sunmemory/sunmemory_system.h> -int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, - bool print_test_status) +static int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, + bool print_test_status) { // Try and allocate some memory int N = 8; diff --git a/test/unit_tests/utilities/dumpstderr.hpp b/test/unit_tests/utilities/dumpstderr.hpp index 4df2e660f7..9d57384fcc 100644 --- a/test/unit_tests/utilities/dumpstderr.hpp +++ b/test/unit_tests/utilities/dumpstderr.hpp @@ -17,7 +17,7 @@ #include <string> #include <sundials/sundials_core.hpp> -std::string dumpstderr(SUNContext sunctx, const std::string& errfile) +static std::string dumpstderr(SUNContext sunctx, const std::string& errfile) { SUNLogger logger = NULL; SUNContext_GetLogger(sunctx, &logger); From 4b473bd58600c9ba5a2f99d9be23f7f86289f390 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Mon, 20 May 2024 18:45:14 -0500 Subject: [PATCH 051/137] Updated folder layout for ARKODE stepper usage in docs (#490) This is a tiny PR to updated the file folder layout for ARKODE's time-stepping module "usage" documents. Now that we do not separately document the C and Fortran interfaces in different folders, there is no need for our folder names to be, e.g., `Usage/ARKStep_c_interface/`. --- .../Usage/{ARKStep_c_interface => ARKStep}/Relaxation.rst | 0 .../{ARKStep_c_interface => ARKStep}/User_callable.rst | 0 .../Usage/{ARKStep_c_interface => ARKStep}/XBraid.rst | 0 .../Usage/{ARKStep_c_interface => ARKStep}/index.rst | 0 .../Usage/{ERKStep_c_interface => ERKStep}/Relaxation.rst | 0 .../{ERKStep_c_interface => ERKStep}/User_callable.rst | 0 .../Usage/{ERKStep_c_interface => ERKStep}/index.rst | 0 .../Custom_Inner_Stepper/Description.rst | 0 .../Custom_Inner_Stepper/Implementing.rst | 0 .../Custom_Inner_Stepper/index.rst | 0 .../{MRIStep_c_interface => MRIStep}/MRIStepCoupling.rst | 0 .../Usage/{MRIStep_c_interface => MRIStep}/Skeleton.rst | 0 .../{MRIStep_c_interface => MRIStep}/User_callable.rst | 0 .../Usage/{MRIStep_c_interface => MRIStep}/index.rst | 0 .../{SPRKStep_c_interface => SPRKStep}/User_callable.rst | 0 .../Usage/{SPRKStep_c_interface => SPRKStep}/index.rst | 0 doc/arkode/guide/source/Usage/index.rst | 8 ++++---- 17 files changed, 4 insertions(+), 4 deletions(-) rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => ARKStep}/Relaxation.rst (100%) rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => ARKStep}/User_callable.rst (100%) rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => ARKStep}/XBraid.rst (100%) rename doc/arkode/guide/source/Usage/{ARKStep_c_interface => ARKStep}/index.rst (100%) rename doc/arkode/guide/source/Usage/{ERKStep_c_interface => ERKStep}/Relaxation.rst (100%) rename doc/arkode/guide/source/Usage/{ERKStep_c_interface => ERKStep}/User_callable.rst (100%) rename doc/arkode/guide/source/Usage/{ERKStep_c_interface => ERKStep}/index.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/Custom_Inner_Stepper/Description.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/Custom_Inner_Stepper/Implementing.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/Custom_Inner_Stepper/index.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/MRIStepCoupling.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/Skeleton.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/User_callable.rst (100%) rename doc/arkode/guide/source/Usage/{MRIStep_c_interface => MRIStep}/index.rst (100%) rename doc/arkode/guide/source/Usage/{SPRKStep_c_interface => SPRKStep}/User_callable.rst (100%) rename doc/arkode/guide/source/Usage/{SPRKStep_c_interface => SPRKStep}/index.rst (100%) diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/Relaxation.rst rename to doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/User_callable.rst rename to doc/arkode/guide/source/Usage/ARKStep/User_callable.rst diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/XBraid.rst rename to doc/arkode/guide/source/Usage/ARKStep/XBraid.rst diff --git a/doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ARKStep/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ARKStep_c_interface/index.rst rename to doc/arkode/guide/source/Usage/ARKStep/index.rst diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ERKStep_c_interface/Relaxation.rst rename to doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ERKStep_c_interface/User_callable.rst rename to doc/arkode/guide/source/Usage/ERKStep/User_callable.rst diff --git a/doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/ERKStep/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/ERKStep_c_interface/index.rst rename to doc/arkode/guide/source/Usage/ERKStep/index.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Description.rst rename to doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Implementing.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Implementing.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/Implementing.rst rename to doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Implementing.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/index.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/Custom_Inner_Stepper/index.rst rename to doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/MRIStepCoupling.rst rename to doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/Skeleton.rst rename to doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/User_callable.rst rename to doc/arkode/guide/source/Usage/MRIStep/User_callable.rst diff --git a/doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/MRIStep/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/MRIStep_c_interface/index.rst rename to doc/arkode/guide/source/Usage/MRIStep/index.rst diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst similarity index 100% rename from doc/arkode/guide/source/Usage/SPRKStep_c_interface/User_callable.rst rename to doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst diff --git a/doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst b/doc/arkode/guide/source/Usage/SPRKStep/index.rst similarity index 100% rename from doc/arkode/guide/source/Usage/SPRKStep_c_interface/index.rst rename to doc/arkode/guide/source/Usage/SPRKStep/index.rst diff --git a/doc/arkode/guide/source/Usage/index.rst b/doc/arkode/guide/source/Usage/index.rst index 2ecc9a671c..93b63d84b8 100644 --- a/doc/arkode/guide/source/Usage/index.rst +++ b/doc/arkode/guide/source/Usage/index.rst @@ -75,7 +75,7 @@ ARKBBDPRE can only be used with NVECTOR_PARALLEL. User_supplied Relaxation Preconditioners - ARKStep_c_interface/index.rst - ERKStep_c_interface/index.rst - SPRKStep_c_interface/index.rst - MRIStep_c_interface/index.rst + ARKStep/index.rst + ERKStep/index.rst + SPRKStep/index.rst + MRIStep/index.rst From 9d92648b58396fb45932cc4dd6868f98e9170d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Tue, 21 May 2024 01:47:01 +0200 Subject: [PATCH 052/137] Use dependabot to periodically check for updated actions. (#489) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is essentially the exact file that GitHub proposes here: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot#example-dependabotyml-file-for-github-actions Adding this file to the repository would simplify the update process of actions used in the CI. You might need to additionally enable dependabot for this repository to actually make this work. You should be able to find that setting on the "Insights" tab in the "Dependency graph" section. If it works, the bot will automatically create PRs for CI actions that are out of date. You can still decide to not merge those PRs. So everything will still be in your hands. Potential caveat: This file might need to exist on the default branch of this repository (i.e., `main`) to actually have an effect. Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..df4d15b35c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" From 0056cb821d20155122e3c676ac31c51e9c0a8797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Tue, 21 May 2024 07:48:17 +0200 Subject: [PATCH 053/137] Do not cast pointers to arrays of differently sized integers. (#485) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Casting between `int64_t *` and `int32_t *` does *not* maintain the values in the array. Instead, it tells the compiler to interpret the memory at that pointer as an array of a different type (i.e., two `int32_t` elements "become" one `int64_t` element). That can lead to all kinds of errors and is likely not what was intended. Remove the pointer casts to allow the compiler to emit an error on compile-time instead of potentially causing, e.g., an array overflow on runtime if `sunindextype` has a different size from `KLU_INDEXTYPE`. --------- Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 3 +++ cmake/tpl/SundialsKLU.cmake | 16 +++++++++++++ doc/shared/RecentChanges.rst | 3 +++ src/sunlinsol/klu/sunlinsol_klu.c | 39 +++++++++++-------------------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03754be282..b5851c8e01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,9 @@ allocated. Fix bug on LLP64 platforms (like Windows 64-bit) where `KLU_INDEXTYPE` could be 32 bits wide even if `SUNDIALS_INT64_T` is defined. +Check if size of `SuiteSparse_long` is 8 if the size of `sunindextype` is 8 +when using KLU. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/cmake/tpl/SundialsKLU.cmake b/cmake/tpl/SundialsKLU.cmake index 8ab9a7fe72..aa71405687 100644 --- a/cmake/tpl/SundialsKLU.cmake +++ b/cmake/tpl/SundialsKLU.cmake @@ -57,6 +57,22 @@ message(STATUS "KLU_INCLUDE_DIR: ${KLU_INCLUDE_DIR}") if(KLU_FOUND AND (NOT KLU_WORKS)) # Do any checks which don't require compilation first. + if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Check size of SuiteSparse_long + include(CheckTypeSize) + set(save_CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}) + list(APPEND CMAKE_EXTRA_INCLUDE_FILES "klu.h") + set(save_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${KLU_INCLUDE_DIR}) + check_type_size("SuiteSparse_long" SIZEOF_SUITESPARSE_LONG) + set(CMAKE_EXTRA_INCLUDE_FILES ${save_CMAKE_EXTRA_INCLUDE_FILES}) + set(CMAKE_REQUIRED_INCLUDES ${save_CMAKE_REQUIRED_INCLUDES}) + message(STATUS "Size of SuiteSparse_long is ${SIZEOF_SUITESPARSE_LONG}") + if(NOT SIZEOF_SUITESPARSE_LONG EQUAL "8") + print_error("Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used.") + endif() + endif() + # Create the KLU_TEST directory set(KLU_TEST_DIR ${PROJECT_BINARY_DIR}/KLU_TEST) file(MAKE_DIRECTORY ${KLU_TEST_DIR}) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 3d7025d7ac..a55efd89ea 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -76,3 +76,6 @@ where not allocated. Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could be 32 bits wide even if ``SUNDIALS_INT64_T`` is defined. + +Check if size of ``SuiteSparse_long`` is 8 if the size of ``sunindextype`` is 8 +when using KLU. diff --git a/src/sunlinsol/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index 568dc1d549..3594b24f4f 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -43,18 +43,6 @@ #define COMMON(S) (KLU_CONTENT(S)->common) #define SOLVE(S) (KLU_CONTENT(S)->klu_solver) -/* - * ----------------------------------------------------------------- - * typedef to handle pointer casts from sunindextype to KLU type - * ----------------------------------------------------------------- - */ - -#if defined(SUNDIALS_INT64_T) -#define KLU_INDEXTYPE int64_t -#else -#define KLU_INDEXTYPE int -#endif - /* * ----------------------------------------------------------------- * exported functions @@ -266,10 +254,9 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) { /* Perform symbolic analysis of sparsity structure */ if (SYMBOLIC(S)) { sun_klu_free_symbolic(&SYMBOLIC(S), &COMMON(S)); } - SYMBOLIC(S) = - sun_klu_analyze(SUNSparseMatrix_NP(A), - (KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), - (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), &COMMON(S)); + SYMBOLIC(S) = sun_klu_analyze(SUNSparseMatrix_NP(A), + SUNSparseMatrix_IndexPointers(A), + SUNSparseMatrix_IndexValues(A), &COMMON(S)); if (SYMBOLIC(S) == NULL) { LASTFLAG(S) = SUN_ERR_EXT_FAIL; @@ -280,8 +267,8 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) Compute the LU factorization of the matrix ------------------------------------------------------------*/ if (NUMERIC(S)) { sun_klu_free_numeric(&NUMERIC(S), &COMMON(S)); } - NUMERIC(S) = sun_klu_factor((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), - (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), + NUMERIC(S) = sun_klu_factor(SUNSparseMatrix_IndexPointers(A), + SUNSparseMatrix_IndexValues(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), &COMMON(S)); if (NUMERIC(S) == NULL) { @@ -294,8 +281,8 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) else { /* not the first decomposition, so just refactor */ - retval = sun_klu_refactor((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), - (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), + retval = sun_klu_refactor(SUNSparseMatrix_IndexPointers(A), + SUNSparseMatrix_IndexValues(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), NUMERIC(S), &COMMON(S)); if (retval == 0) @@ -321,7 +308,7 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) { /* Condition number may be getting large. Compute more accurate estimate */ - retval = sun_klu_condest((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), + retval = sun_klu_condest(SUNSparseMatrix_IndexPointers(A), SUNSparseMatrix_Data(A), SYMBOLIC(S), NUMERIC(S), &COMMON(S)); if (retval == 0) @@ -333,12 +320,12 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) if (COMMON(S).condest > (ONE / uround_twothirds)) { /* More accurate estimate also says condition number is - large, so recompute the numeric factorization */ + large, so recompute the numeric factorization */ sun_klu_free_numeric(&NUMERIC(S), &COMMON(S)); - NUMERIC(S) = - sun_klu_factor((KLU_INDEXTYPE*)SUNSparseMatrix_IndexPointers(A), - (KLU_INDEXTYPE*)SUNSparseMatrix_IndexValues(A), - SUNSparseMatrix_Data(A), SYMBOLIC(S), &COMMON(S)); + NUMERIC(S) = sun_klu_factor(SUNSparseMatrix_IndexPointers(A), + SUNSparseMatrix_IndexValues(A), + SUNSparseMatrix_Data(A), SYMBOLIC(S), + &COMMON(S)); if (NUMERIC(S) == NULL) { LASTFLAG(S) = SUN_ERR_EXT_FAIL; From bc145346a5ffa79fce96172a71311a57abbc3afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de> Date: Tue, 21 May 2024 19:09:47 +0200 Subject: [PATCH 054/137] CI: Add runner for 32-bit (MINGW32) (#492) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 32-bit and 64-bit Windows systems are different to 32-bit and 64-bit Linux systems, e.g., when it comes to the data model. Add a runner to the CI that builds for Windows 32-bit for coverage. Signed-off-by: Markus Mützel <markus.muetzel@gmx.de> --- .github/workflows/windows-latest-mingw.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 52cacd8504..49974e4e30 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -22,20 +22,29 @@ jobs: # Use MSYS2 as default shell shell: msys2 {0} + strategy: + matrix: + msystem: [MINGW64, MINGW32] + include: + - msystem: MINGW64 + target-prefix: mingw-w64-x86_64 + - msystem: MINGW32 + target-prefix: mingw-w64-i686 + steps: - uses: actions/checkout@v3 - uses: msys2/setup-msys2@v2 with: - msystem: mingw64 + msystem: ${{ matrix.msystem }} update: true release: false install: >- base-devel - mingw-w64-x86_64-cmake - mingw-w64-x86_64-cc - mingw-w64-x86_64-openblas - mingw-w64-x86_64-suitesparse + ${{ matrix.target-prefix }}-cmake + ${{ matrix.target-prefix }}-cc + ${{ matrix.target-prefix }}-openblas + ${{ matrix.target-prefix }}-suitesparse - name: Configure CMake # Configure CMake in a 'build' subdirectory @@ -50,7 +59,7 @@ jobs: -DENABLE_KLU=ON - name: Build - # Build your program + # Build program run: cmake --build ${GITHUB_WORKSPACE}/build - name: Test From 8e1c543e1b3724fff74ee06159bc484be7f5c016 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 23 May 2024 08:44:53 -0700 Subject: [PATCH 055/137] Loop over all Butcher tables to test order (#488) Switches from a vector of table names (which was often not updated) to iterating over the enum of tables so methods get included in this test automatically. --- .../guide/source/ARKodeButcherTable.rst | 35 ++++++ include/arkode/arkode_butcher_dirk.h | 3 + include/arkode/arkode_butcher_erk.h | 2 + src/arkode/arkode_butcher_dirk.c | 22 ++++ src/arkode/arkode_butcher_erk.c | 24 ++++- test/answers | 2 +- .../arkode/CXX_serial/ark_test_butcher.cpp | 101 +++++++----------- .../arkode/CXX_serial/ark_test_butcher.out | 11 +- 8 files changed, 131 insertions(+), 69 deletions(-) diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 916641678b..969e1bc23a 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -83,10 +83,14 @@ ARKodeButcherTable functions +--------------------------------------------------+------------------------------------------------------------+ | :c:func:`ARKodeButcherTable_LoadERKByName()` | Retrieve a given explicit Butcher table by its unique name | +--------------------------------------------------+------------------------------------------------------------+ + | :c:func:`ARKodeButcherTable_ERKIDToName()` | Convert an explicit Butcher table ID to its 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_DIRKIDToName()` | Convert an implicit Butcher table ID to its name | + +--------------------------------------------------+------------------------------------------------------------+ | :c:func:`ARKodeButcherTable_Alloc()` | Allocate an empty Butcher table | +--------------------------------------------------+------------------------------------------------------------+ | :c:func:`ARKodeButcherTable_Create()` | Create a new Butcher table | @@ -138,6 +142,21 @@ ARKodeButcherTable functions **Notes:** This function is case sensitive. +.. c:function:: const char* ARKodeButcherTable_ERKIDToName(ARKODE_ERKTableID emethod) + + Converts a specified explicit Butcher table ID to a string of the same name. + The prototype for this function, as well as the integer names for each + provided method, are defined in the header file + ``arkode/arkode_butcher_erk.h``. For further information on these tables and + their corresponding identifiers, see :numref:`Butcher`. + + **Arguments:** + * *emethod* -- integer input specifying the given Butcher table. + + **Return value:** + * The name associated with *emethod*. + * ``NULL`` pointer if *emethod* was invalid. + .. c:function:: ARKodeButcherTable ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod) Retrieves a specified diagonally-implicit Butcher table. The prototype for @@ -172,6 +191,22 @@ ARKodeButcherTable functions This function is case sensitive. +.. c:function:: const char* ARKodeButcherTable_DIRKIDToName(ARKODE_DIRKTableID imethod) + + Converts a specified diagonally-implicit Butcher table ID to a string of the + same name. The prototype for this function, as well as the integer names for + each provided method, are defined in the header file + ``arkode/arkode_butcher_dirk.h``. For further information on these tables + and their corresponding identifiers, see :numref:`Butcher`. + + **Arguments:** + * *imethod* -- integer input specifying the given Butcher table. + + **Return value:** + * The name associated with *imethod*. + * ``NULL`` pointer if *imethod* was invalid. + + .. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) Allocates an empty Butcher table. diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index ffa4908c91..c89ea0594f 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -65,6 +65,9 @@ ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_LoadDIRKByName(const char* imethod); +SUNDIALS_EXPORT const char* ARKodeButcherTable_DIRKIDToName( + ARKODE_DIRKTableID imethod); + #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index 764b67bbfe..c6c0373510 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -62,6 +62,8 @@ ARKodeButcherTable_LoadERK(ARKODE_ERKTableID emethod); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_LoadERKByName(const char* emethod); +SUNDIALS_EXPORT const char* ARKodeButcherTable_ERKIDToName(ARKODE_ERKTableID emethod); + #ifdef __cplusplus } #endif diff --git a/src/arkode/arkode_butcher_dirk.c b/src/arkode/arkode_butcher_dirk.c index 54026e7ae2..ee3001a2c8 100644 --- a/src/arkode/arkode_butcher_dirk.c +++ b/src/arkode/arkode_butcher_dirk.c @@ -54,6 +54,28 @@ ARKodeButcherTable ARKodeButcherTable_LoadDIRKByName(const char* imethod) return ARKodeButcherTable_LoadDIRK(arkButcherTableDIRKNameToID(imethod)); } +/*--------------------------------------------------------------- + Returns the string name for a pre-set DIRK method by its ID. + + Input: imethod -- integer key for the desired method + ---------------------------------------------------------------*/ +const char* ARKodeButcherTable_DIRKIDToName(ARKODE_DIRKTableID imethod) +{ + /* Use X-macro to test each method name */ + switch (imethod) + { +#define ARK_BUTCHER_TABLE(name, coeff) \ + case name: return #name; +#include "arkode_butcher_dirk.def" +#undef ARK_BUTCHER_TABLE + + default: + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown Butcher table"); + return NULL; + } +} + /*--------------------------------------------------------------- Returns Butcher table ID for pre-set DIRK methods. diff --git a/src/arkode/arkode_butcher_erk.c b/src/arkode/arkode_butcher_erk.c index e15aa6b8b0..10cebbfdf4 100644 --- a/src/arkode/arkode_butcher_erk.c +++ b/src/arkode/arkode_butcher_erk.c @@ -25,7 +25,7 @@ /*--------------------------------------------------------------- Returns Butcher table structure for pre-set Runge Kutta methods. - Input: emthod -- integer key for the desired method + Input: emethod -- integer key for the desired method ---------------------------------------------------------------*/ ARKodeButcherTable ARKodeButcherTable_LoadERK(ARKODE_ERKTableID emethod) { @@ -54,6 +54,28 @@ ARKodeButcherTable ARKodeButcherTable_LoadERKByName(const char* emethod) return ARKodeButcherTable_LoadERK(arkButcherTableERKNameToID(emethod)); } +/*--------------------------------------------------------------- + Returns the string name for a pre-set Runge Kutta method by its ID. + + Input: emethod -- integer key for the desired method + ---------------------------------------------------------------*/ +const char* ARKodeButcherTable_ERKIDToName(ARKODE_ERKTableID emethod) +{ + /* Use X-macro to test each method name */ + switch (emethod) + { +#define ARK_BUTCHER_TABLE(name, coeff) \ + case name: return #name; +#include "arkode_butcher_erk.def" +#undef ARK_BUTCHER_TABLE + + default: + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown Butcher table"); + return NULL; + } +} + /*--------------------------------------------------------------- Returns Butcher table ID for pre-set Runge Kutta methods. diff --git a/test/answers b/test/answers index 073b119355..b622a192d5 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 073b119355058ac88a2e4abc87acfb007bc211f6 +Subproject commit b622a192d52f7982bb6485f0cba5ffd3fc24e622 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp index c789fec715..a8013ad472 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.cpp @@ -21,76 +21,45 @@ #include <arkode/arkode_butcher_erk.h> #include <iostream> #include <ostream> -#include <string> #include <sundials/sundials_types.h> #include <vector> +#include "arkode/arkode_impl.h" + +struct ARK_Table +{ + const char* const name; + const char* const erk_table; + const char* const dirk_table; +}; + // Main Program int main() { - // set vectors of individual tables to test - std::vector<std::string> Tables_ERK = - {"ARKODE_HEUN_EULER_2_1_2", "ARKODE_ARK2_ERK_3_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_ARK437L2SA_ERK_7_3_4", - "ARKODE_ARK548L2SAb_ERK_8_4_5", "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"}; - std::vector<std::string> Tables_DIRK = {"ARKODE_SDIRK_2_1_2", - "ARKODE_ARK2_DIRK_3_1_2", - "ARKODE_BILLINGTON_3_3_2", - "ARKODE_TRBDF2_3_3_2", - "ARKODE_KVAERNO_4_2_3", - "ARKODE_ARK324L2SA_DIRK_4_2_3", - "ARKODE_CASH_5_2_4", - "ARKODE_CASH_5_3_4", - "ARKODE_SDIRK_5_3_4", - "ARKODE_KVAERNO_5_3_4", - "ARKODE_ARK436L2SA_DIRK_6_3_4", - "ARKODE_KVAERNO_7_4_5", - "ARKODE_ARK548L2SA_DIRK_8_4_5", - "ARKODE_ARK437L2SA_DIRK_7_3_4", - "ARKODE_ARK548L2SAb_DIRK_8_4_5", - "ARKODE_ESDIRK324L2SA_4_2_3", - "ARKODE_ESDIRK325L2SA_5_2_3", - "ARKODE_ESDIRK32I5L2SA_5_2_3", - "ARKODE_ESDIRK436L2SA_6_3_4", - "ARKODE_ESDIRK43I6L2SA_6_3_4", - "ARKODE_QESDIRK436L2SA_6_3_4", - "ARKODE_ESDIRK437L2SA_7_3_4", - "ARKODE_ESDIRK547L2SA_7_4_5", - "ARKODE_ESDIRK547L2SA2_7_4_5"}; - std::vector<ARKODE_ERKTableID> Tables_ARK_ERK = {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}; - std::vector<ARKODE_DIRKTableID> Tables_ARK_DIRK = - {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_DIRK_8_4_5, ARKODE_ARK548L2SAb_DIRK_8_4_5}; - std::vector<std::string> STables_ARK = {"ARKODE_ARK2_3_1_2", - "ARKODE_ARK324L2SA_4_2_3", - "ARKODE_ARK436L2SA_6_3_4", - "ARKODE_ARK437L2SA_7_3_4", - "ARKODE_ARK548L2SA_8_4_5", - "ARKODE_ARK548L2SAb_8_4_5"}; - int numfails = 0; + std::vector<ARK_Table> ark_tables = + {{"ARKODE_ARK2_3_1_2", "ARKODE_ARK2_ERK_3_1_2", "ARKODE_ARK2_DIRK_3_1_2"}, + {"ARKODE_ARK324L2SA_4_2_3", "ARKODE_ARK324L2SA_ERK_4_2_3", + "ARKODE_ARK324L2SA_DIRK_4_2_3"}, + {"ARKODE_ARK436L2SA_6_3_4", "ARKODE_ARK436L2SA_ERK_6_3_4", + "ARKODE_ARK436L2SA_DIRK_6_3_4"}, + {"ARKODE_ARK437L2SA_7_3_4", "ARKODE_ARK437L2SA_ERK_7_3_4", + "ARKODE_ARK437L2SA_DIRK_7_3_4"}, + {"ARKODE_ARK548L2SA_8_4_5", "ARKODE_ARK548L2SA_ERK_8_4_5", + "ARKODE_ARK548L2SA_DIRK_8_4_5"}, + {"ARKODE_ARK548L2SAb_8_4_5", "ARKODE_ARK548L2SAb_ERK_8_4_5", + "ARKODE_ARK548L2SAb_DIRK_8_4_5"}}; + + int numfails = 0; // loop over individual ERK tables std::cout << "\nTesting individual ERK methods:\n\n"; - for (std::string table : Tables_ERK) + for (int i = ARKODE_MIN_ERK_NUM; i <= ARKODE_MAX_ERK_NUM; i++) { - std::cout << "Testing method " << table << ":"; + ARKODE_ERKTableID id = static_cast<ARKODE_ERKTableID>(i); + std::cout << "Testing method " << ARKodeButcherTable_ERKIDToName(id) << ":"; // load Butcher table - ARKodeButcherTable B = ARKodeButcherTable_LoadERKByName(table.c_str()); + ARKodeButcherTable B = ARKodeButcherTable_LoadERK(id); if (B == NULL) { std::cout << " error retrieving table, aborting\n"; @@ -123,12 +92,13 @@ int main() // loop over individual DIRK tables std::cout << "\nTesting individual DIRK methods:\n\n"; - for (std::string table : Tables_DIRK) + for (int i = ARKODE_MIN_DIRK_NUM; i <= ARKODE_MAX_DIRK_NUM; i++) { - std::cout << "Testing method " << table << ":"; + ARKODE_DIRKTableID id = static_cast<ARKODE_DIRKTableID>(i); + std::cout << "Testing method " << ARKodeButcherTable_DIRKIDToName(id) << ":"; // load Butcher table - ARKodeButcherTable B = ARKodeButcherTable_LoadDIRKByName(table.c_str()); + ARKodeButcherTable B = ARKodeButcherTable_LoadDIRK(id); if (B == NULL) { std::cout << " error retrieving table, aborting\n"; @@ -161,18 +131,19 @@ int main() // loop over ARK pairs std::cout << "\nTesting ARK pairs:\n\n"; - for (size_t i = 0; i < Tables_ARK_ERK.size(); i++) + for (ARK_Table& ark_table : ark_tables) { - std::cout << "Testing method " << STables_ARK[i] << ":"; + std::cout << "Testing method " << ark_table.name << ":"; // load Butcher tables - ARKodeButcherTable Be = ARKodeButcherTable_LoadERK(Tables_ARK_ERK[i]); + ARKodeButcherTable Be = ARKodeButcherTable_LoadERKByName(ark_table.erk_table); if (Be == NULL) { std::cout << " error retrieving explicit table, aborting\n"; return 1; } - ARKodeButcherTable Bi = ARKodeButcherTable_LoadDIRK(Tables_ARK_DIRK[i]); + ARKodeButcherTable Bi = + ARKodeButcherTable_LoadDIRKByName(ark_table.dirk_table); if (Bi == NULL) { std::cout << " error retrieving implicit table, aborting"; diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out index b7c11bcecf..559c92b3ae 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_butcher.out @@ -2,7 +2,6 @@ Testing individual ERK methods: Testing method ARKODE_HEUN_EULER_2_1_2: table matches predicted method/embedding orders of 2/1 -Testing method ARKODE_ARK2_ERK_3_1_2: table matches predicted method/embedding orders of 2/1 Testing method ARKODE_BOGACKI_SHAMPINE_4_2_3: table matches predicted method/embedding orders of 3/2 Testing method ARKODE_ARK324L2SA_ERK_4_2_3: table matches predicted method/embedding orders of 3/2 Testing method ARKODE_ZONNEVELD_5_3_4: table matches predicted method/embedding orders of 4/3 @@ -20,8 +19,10 @@ ARKodeButcherTable_CheckOrder: embedding order >= 6; reverting to simplifying assumptions embedding order = 6 +Testing method ARKODE_KNOTH_WOLKE_3_3: table matches predicted method/embedding orders of 3/0 Testing method ARKODE_ARK437L2SA_ERK_7_3_4: table matches predicted method/embedding orders of 4/3 Testing method ARKODE_ARK548L2SAb_ERK_8_4_5: table matches predicted method/embedding orders of 5/4 +Testing method ARKODE_ARK2_ERK_3_1_2: table matches predicted method/embedding orders of 2/1 Testing method ARKODE_SOFRONIOU_SPALETTA_5_3_4: table matches predicted method/embedding orders of 4/3 Testing method ARKODE_SHU_OSHER_3_2_3: table matches predicted method/embedding orders of 3/2 Testing method ARKODE_VERNER_9_5_6: table matches predicted method/embedding orders of 6/5 @@ -46,11 +47,13 @@ ARKodeButcherTable_CheckOrder: embedding order >= 6; reverting to simplifying assumptions embedding order = 6 +Testing method ARKODE_FORWARD_EULER_1_1: table matches predicted method/embedding orders of 1/0 +Testing method ARKODE_RALSTON_EULER_2_1_2: table matches predicted method/embedding orders of 2/1 +Testing method ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2: table matches predicted method/embedding orders of 2/1 Testing individual DIRK methods: Testing method ARKODE_SDIRK_2_1_2: table matches predicted method/embedding orders of 2/1 -Testing method ARKODE_ARK2_DIRK_3_1_2: table matches predicted method/embedding orders of 2/1 Testing method ARKODE_BILLINGTON_3_3_2: table matches predicted method/embedding orders of 2/3 Testing method ARKODE_TRBDF2_3_3_2: table matches predicted method/embedding orders of 2/3 Testing method ARKODE_KVAERNO_4_2_3: table matches predicted method/embedding orders of 3/2 @@ -73,6 +76,10 @@ Testing method ARKODE_QESDIRK436L2SA_6_3_4: table matches predicted method/embe Testing method ARKODE_ESDIRK437L2SA_7_3_4: table matches predicted method/embedding orders of 4/3 Testing method ARKODE_ESDIRK547L2SA_7_4_5: table matches predicted method/embedding orders of 5/4 Testing method ARKODE_ESDIRK547L2SA2_7_4_5: table matches predicted method/embedding orders of 5/4 +Testing method ARKODE_ARK2_DIRK_3_1_2: table matches predicted method/embedding orders of 2/1 +Testing method ARKODE_BACKWARD_EULER_1_1: table matches predicted method/embedding orders of 1/0 +Testing method ARKODE_IMPLICIT_MIDPOINT_1_2: table matches predicted method/embedding orders of 2/0 +Testing method ARKODE_IMPLICIT_TRAPEZOIDAL_2_2: table matches predicted method/embedding orders of 2/0 Testing ARK pairs: From 1fcd3b82f392c1d27228627cb005078c9d62dda5 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 23 May 2024 15:42:23 -0700 Subject: [PATCH 056/137] Feature: Add option to disable interpolation in ARKODE (#474) Add support for disabling interpolated output in ARKODE steppers by passing `ARK_INTERP_NONE` to `ARKodeSetInterpolantType`. Disabling interpolation can reduce the memory footprint of an integrator by two or more state vectors (depending on the interpolation type and degree) which can be beneficial when interpolation is not needed e.g., when integrating to a final time without output in between or using an explicit fast time scale integrator with MRIStep. When interpolation is disabled, rootfinding is not supported, implicit methods must use the trivial predictor, interpolation at stop times cannot be used, and calls to `ARKodeEvolve` in `ARK_NORMAL` mode will return at or past the requested output time. --------- Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- CHANGELOG.md | 95 +- doc/arkode/guide/source/Constants.rst | 2 + .../source/Usage/ARKStep/User_callable.rst | 33 +- .../source/Usage/ERKStep/User_callable.rst | 33 +- .../source/Usage/MRIStep/User_callable.rst | 38 +- .../source/Usage/SPRKStep/User_callable.rst | 36 +- .../guide/source/Usage/User_callable.rst | 65 +- doc/shared/RecentChanges.rst | 98 +- include/arkode/arkode.h | 1 + scripts/startReleaseCycle.sh | 12 +- src/arkode/arkode.c | 127 +- src/arkode/arkode_arkstep.c | 37 +- src/arkode/arkode_erkstep.c | 31 +- src/arkode/arkode_impl.h | 1 + src/arkode/arkode_interp.c | 79 +- src/arkode/arkode_io.c | 63 +- src/arkode/arkode_mristep.c | 37 +- src/arkode/arkode_sprkstep.c | 34 +- src/arkode/fmod/farkode_mod.f90 | 1 + test/answers | 2 +- .../arkode/CXX_serial/CMakeLists.txt | 8 +- .../CXX_serial/ark_test_dahlquist_ark.cpp | 40 +- .../ark_test_dahlquist_ark_0_-1.out | 2405 +++++++++++++++++ .../ark_test_dahlquist_ark_1_-1.out | 2405 +++++++++++++++++ .../ark_test_dahlquist_ark_2_-1.out | 2405 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_erk.cpp | 40 +- .../CXX_serial/ark_test_dahlquist_erk_-1.out | 924 +++++++ .../CXX_serial/ark_test_dahlquist_mri.cpp | 294 +- ..._mri.out => ark_test_dahlquist_mri_-1.out} | 1 + .../CXX_serial/ark_test_dahlquist_mri_0.out | 706 +++++ .../CXX_serial/ark_test_dahlquist_mri_1.out | 706 +++++ 31 files changed, 10195 insertions(+), 564 deletions(-) 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_-1.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_-1.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_mri.out => ark_test_dahlquist_mri_-1.out} (99%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out diff --git a/CHANGELOG.md b/CHANGELOG.md index b5851c8e01..6b1f819250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,25 +2,20 @@ ## Changes to SUNDIALS in release X.Y.Z -Fixed the runtime library installation path for windows systems. This fix changes the -default library installation path from `CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR` to -`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR`. - -Fixed conflicting `.lib` files between shared and static libs when using `MSVC` on Windows. +### Major Features -Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and static libs. +Created shared user interface functions for ARKODE to allow more uniform control +over time-stepping algorithms, improved extensibility, and simplified code +maintenance. The corresponding stepper-specific user-callable functions are now +deprecated and will be removed in a future major release. -Created shared user interface for ARKODE user-callable routines, to allow more -uniform control over time-stepping algorithms, improved extensibility, and -simplified code maintenance. Marked the corresponding stepper-specific -user-callable routines as deprecated; these will be removed in a future major -release. +Added CMake infrastructure that enables externally maintained addons/plugins to +be *optionally* built with SUNDIALS. See the [Contributing +Guide](./CONTRIBUTING.md) for more details. -Added "Resize" capability, as well as missing `SetRootDirection` and -`SetNoInactiveRootWarn` functions, to ARKODE's SPRKStep time-stepping module. +### New Features and Enhancements -Deprecated `ARKStepSetOptimalParams` function; added instructions to user guide -for users who wish to retain the current functionality. +Added support for Kokkos Kernels v4. Added the following Runge-Kutta Butcher tables * `ARKODE_FORWARD_EULER_1_1` @@ -40,37 +35,66 @@ Added the following MRI coupling tables * `ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL` * `ARKODE_IMEX_MRI_GARK_MIDPOINT` +Users may now disable interpolated output in ARKODE by passing `ARK_INTERP_NONE` +to `ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is +not supported, implicit methods must use the trivial predictor (the default +option), and interpolation at stop times cannot be used (interpolating at stop +times is disabled by default). With interpolation disabled, calling +`ARKodeEvolve` in `ARK_NORMAL` mode will return at or past the requested output +time (setting a stop time may still be used to halt the integrator at a specific +time). Disabling interpolation will reduce the memory footprint of an integrator +by two or more state vectors (depending on the interpolant type and degree) +which can be beneficial when interpolation is not needed e.g., when integrating +to a final time without output in between or using an explicit fast time scale +integrator with an MRI method. + +Added "Resize" capability to ARKODE's SPRKStep time-stepping module. + +### Bug Fixes + Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). -Fixed a bug in the HIP execution policies where `WARP_SIZE` would not be set -with ROCm 6.0.0 or newer. - Changed the CMake version compatibility mode for SUNDIALS to `AnyNewerVersion` instead of `SameMajorVersion`. This fixes the issue seen [here](https://github.com/AMReX-Codes/amrex/pull/3835). -Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argument -to a function pointer instead of `c_null_funptr`. This caused compilation issues -with the Cray Fortran compiler. +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some +instances. Fixes [GitHub Issue +#464](https://github.com/LLNL/sundials/issues/464). -Fixed a bug where `MRIStepEvolve` would not handle a recoverable error produced -from evolving the inner stepper. +Fixed the runtime library installation path for windows systems. This fix +changes the default library installation path from +`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR` to +`CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR`. -Added CMake infrastructure that enables externally maintained addons/plugins -to be *optionally* built with SUNDIALS. See the [Contributing Guide](./CONTRIBUTING.md) -for more details. +Fixed conflicting `.lib` files between shared and static libs when using `MSVC` +on Windows. -Added support for Kokkos Kernels v4. +Fixed invalid `SUNDIALS_EXPORT` generated macro when building both shared and +static libs. + +Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an +argument to a function pointer instead of `c_null_funptr`. This caused +compilation issues with the Cray Fortran compiler. + +Fixed a bug in the HIP execution policies where `WARP_SIZE` would not be set +with ROCm 6.0.0 or newer. -Fixed a bug that caused error messages to be cut off in some cases. Fixes [GitHub Issue #461](https://github.com/LLNL/sundials/issues/461). +Fixed a bug that caused error messages to be cut off in some cases. Fixes +[GitHub Issue #461](https://github.com/LLNL/sundials/issues/461). -Fixed a memory leak when an error handler was added to a `SUNContext`. Fixes [GitHub Issue #466](https://github.com/LLNL/sundials/issues/466). +Fixed a memory leak when an error handler was added to a `SUNContext`. Fixes +[GitHub Issue #466](https://github.com/LLNL/sundials/issues/466). -Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes [GitHub Issue #464](https://github.com/LLNL/sundials/issues/464). +Fixed a bug where `MRIStepEvolve` would not handle a recoverable error produced +from evolving the inner stepper. + +Added missing `SetRootDirection` and `SetNoInactiveRootWarn` functions to +ARKODE's SPRKStep time-stepping module. -Fixed a bug in `ARKodeSPRKTable_Create` where the coefficient arrays where not +Fixed a bug in `ARKodeSPRKTable_Create` where the coefficient arrays were not allocated. Fix bug on LLP64 platforms (like Windows 64-bit) where `KLU_INDEXTYPE` could be @@ -79,6 +103,15 @@ Fix bug on LLP64 platforms (like Windows 64-bit) where `KLU_INDEXTYPE` could be Check if size of `SuiteSparse_long` is 8 if the size of `sunindextype` is 8 when using KLU. +### Deprecation Notices + +Numerous ARKODE stepper-specific functions are now deprecated in favor of +ARKODE-wide functions. + +Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an +ARKODE-wide equivalent, instructions have been added to the user guide for how +to retain the current functionality using other user-callable functions. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 088dbbdda8..5915413240 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -52,6 +52,8 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | **Interpolation module input constants** | | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARK_INTERP_NONE` | Disables polynomial interpolation for dense output. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARK_INTERP_HERMITE` | Specifies use of the Hermite polynomial interpolation | | | module (for non-stiff problems). | +-----------------------------------------------+------------------------------------------------------------+ diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index dcd7339a97..383c3795ea 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -552,39 +552,10 @@ Optional inputs for ARKStep .. c:function:: int ARKStepSetInterpolantType(void* arkode_mem, int itype) - Specifies use of the Lagrange or Hermite interpolation modules (used for - dense output -- interpolation of solution output values and implicit - method predictors). - - **Arguments:** - * *arkode_mem* -- pointer to the ARKStep memory block. - * *itype* -- requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` - * *ARK_MEM_FAIL* if the interpolation module cannot be allocated - * *ARK_ILL_INPUT* if the *itype* argument is not recognized or the - interpolation module has already been initialized - - **Notes:** - The Hermite interpolation module is described in - :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module - is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. - - This routine frees any previously-allocated interpolation module, and re-creates - one according to the specified argument. Thus any previous calls to - :c:func:`ARKStepSetInterpolantDegree()` will be nullified. - - This routine may only be called *after* the call to :c:func:`ARKStepCreate`. - After the first call to :c:func:`ARKStepEvolve()` the interpolation type may - not be changed without first calling :c:func:`ARKStepReInit()`. - - If this routine is not called, the Hermite interpolation module will be used. - .. deprecated:: x.y.z - Use :c:func:`ARKodeSetInterpolantType` instead. + This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see + the documentation for that function instead. .. c:function:: int ARKStepSetInterpolantDegree(void* arkode_mem, int degree) diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 8984b67a9b..03a9954b28 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -329,39 +329,10 @@ Optional inputs for ERKStep .. c:function:: int ERKStepSetInterpolantType(void* arkode_mem, int itype) - Specifies use of the Lagrange or Hermite interpolation modules (used for - dense output -- interpolation of solution output values and implicit - method predictors). - - **Arguments:** - * *arkode_mem* -- pointer to the ERKStep memory block. - * *itype* -- requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` - * *ARK_MEM_FAIL* if the interpolation module cannot be allocated - * *ARK_ILL_INPUT* if the *itype* argument is not recognized or the - interpolation module has already been initialized - - **Notes:** - The Hermite interpolation module is described in - :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module - is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. - - This routine frees any previously-allocated interpolation module, and re-creates - one according to the specified argument. Thus any previous calls to - :c:func:`ERKStepSetInterpolantDegree()` will be nullified. - - This routine must be called *after* the call to :c:func:`ERKStepCreate`. - After the first call to :c:func:`ERKStepEvolve()` the interpolation type may - not be changed without first calling :c:func:`ERKStepReInit()`. - - If this routine is not called, the Hermite interpolation module will be used. - .. deprecated:: x.y.z - Use :c:func:`ARKodeSetInterpolantType` instead. + This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see + the documentation for that function instead. diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 3719395f66..eb92a95ac9 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -462,44 +462,10 @@ Optional inputs for MRIStep .. c:function:: int MRIStepSetInterpolantType(void* arkode_mem, int itype) - Specifies use of the Lagrange or Hermite interpolation modules (used for - dense output -- interpolation of solution output values and implicit - method predictors). - - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *itype* -- requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_MEM_FAIL* if the interpolation module cannot be allocated - - * *ARK_ILL_INPUT* if the *itype* argument is not recognized or the - interpolation module has already been initialized - - **Notes:** The Hermite interpolation module is described in - :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module - is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. - - This routine frees any previously-allocated interpolation module, and re-creates - one according to the specified argument. Thus any previous calls to - :c:func:`MRIStepSetInterpolantDegree()` will be nullified. - - This routine must be called *after* the call to :c:func:`MRIStepCreate()`. - After the first call to :c:func:`MRIStepEvolve()` the interpolation type may - not be changed without first calling :c:func:`MRIStepReInit()`. - - If this routine is not called, the Hermite interpolation module will be used. - .. deprecated:: x.y.z - Use :c:func:`ARKodeSetInterpolantType` instead. + This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see + the documentation for that function instead. diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 45996860cf..4d9d8fc3c8 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -244,42 +244,10 @@ Optional inputs for SPRKStep .. c:function:: int SPRKStepSetInterpolantType(void* arkode_mem, int itype) - Specifies use of the Lagrange or Hermite interpolation modules (used for - dense output -- interpolation of solution output values and implicit - method predictors). - - :param arkode_mem: pointer to the SPRKStep memory block. - :param itype: requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``) - - :retval ARK_SUCCESS: if successful - :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_MEM_FAIL: if the interpolation module cannot be allocated - :retval ARK_ILL_INPUT: if the *itype* argument is not recognized or the - interpolation module has already been initialized - - .. note:: - - The Hermite interpolation module is described in - :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module - is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. - - This routine frees any previously-allocated interpolation module, and re-creates - one according to the specified argument. Thus any previous calls to - :c:func:`SPRKStepSetInterpolantDegree()` will be nullified. - - This routine must be called *after* the call to :c:func:`SPRKStepCreate`. - After the first call to :c:func:`SPRKStepEvolve()` the interpolation type may - not be changed without first calling :c:func:`SPRKStepReInit()`. - - If this routine is not called, the Lagrange interpolation module will be used. - - Interpolated outputs may or may not conserve the Hamiltonian. Our testing - has shown that Lagrange interpolation typically performs well in this - regard, while Hermite interpolation does not. - .. deprecated:: x.y.z - Use :c:func:`ARKodeSetInterpolantType` instead. + This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see + the documentation for that function instead. .. c:function:: int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree) diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 96d4f5eddd..718655dff1 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -709,9 +709,12 @@ the user has set a stop time (with a call to the optional input function time, *tout*, in the direction of integration, i.e. :math:`t_{n-1} <` *tout* :math:`\le t_{n}` for forward integration, or :math:`t_{n} \le` *tout* :math:`< t_{n-1}` for - backward integration. It will then compute an approximation - to the solution :math:`y(tout)` by interpolation (as described - in :numref:`ARKODE.Mathematics.Interpolation`). + backward integration. If interpolation is enabled (on by + default), it will then compute an approximation to the solution + :math:`y(tout)` by interpolation (as described in + :numref:`ARKODE.Mathematics.Interpolation`). Otherwise, the + solution at the time reached by the solver is returned, + :math:`y(tret)`. The *ARK_ONE_STEP* option tells the solver to only take a single internal step, :math:`y_{n-1} \to y_{n}`, and return the solution @@ -922,12 +925,41 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr .. c:function:: int ARKodeSetInterpolantType(void* arkode_mem, int itype) - Specifies use of the Lagrange or Hermite interpolation modules (used for - dense output -- interpolation of solution output values and implicit - method predictors). + Specifies the interpolation type used for dense output (interpolation of + solution output values) and implicit method predictors. By default, + Hermite interpolation is used except with SPRK methods where Lagrange + interpolation is the default. + + This routine must be called *after* the calling a stepper constructor. After + the first call to :c:func:`ARKodeEvolve` the interpolation type may not be + changed without first calling a stepper ``ReInit`` function. + + The Hermite interpolation module (``ARK_INTERP_HERMITE``) is described in + :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange + interpolation module (``ARK_INTERP_LAGRANGE``) is described in + :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. ``ARK_INTERP_NONE`` will + disable interpolation. + + When interpolation is disabled, using rootfinding is not supported, implicit + methods must use the trivial predictor (the default option), and + interpolation at stop times cannot be used (interpolating at stop times is + disabled by default). With interpolation disabled, calling + :c:func:`ARKodeEvolve` in ``ARK_NORMAL`` mode will return at or past the + requested output time (setting a stop time may still be used to halt the + integrator at a specific time). + + Disabling interpolation will reduce the memory footprint of an integrator by + two or more state vectors (depending on the interpolant type and degree) + which can be beneficial when interpolation is not needed e.g., when + integrating to a final time without output in between or using ARKStep as an + explicit fast time scale integrator with MRI methods. + + This routine frees any previously-allocated interpolation module, and + re-creates one according to the specified argument. :param arkode_mem: pointer to the ARKODE memory block. - :param itype: requested interpolant type (``ARK_INTERP_HERMITE`` or ``ARK_INTERP_LAGRANGE``). + :param itype: requested interpolant type: ``ARK_INTERP_HERMITE``, + ``ARK_INTERP_LAGRANGE``, or ``ARK_INTERP_NONE`` :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. @@ -935,23 +967,18 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr :retval ARK_ILL_INPUT: the *itype* argument is not recognized or the interpolation module has already been initialized. - .. note:: - - The Hermite interpolation module is described in - :numref:`ARKODE.Mathematics.Interpolation.Hermite`, and the Lagrange interpolation module - is described in :numref:`ARKODE.Mathematics.Interpolation.Lagrange`. + .. versionchanged:: x.y.z - This routine frees any previously-allocated interpolation module, and re-creates - one according to the specified argument. Thus any previous calls to - :c:func:`ARKodeSetInterpolantDegree` will be nullified. + Added the ``ARK_INTERP_NONE`` option to disable interpolation. - After the first call to :c:func:`ARKodeEvolve` the interpolation type may - not be changed without first calling ``*StepReInit``. - - If this routine is not called, the Hermite interpolation module will be used. + Values set by a previous call to :c:func:`ARKStepSetInterpolantDegree` are + no longer nullified by a call to :c:func:`ARKStepSetInterpolantType`. .. versionadded:: x.y.z + This function replaces stepper specific versions in ARKStep, ERKStep, + MRIStep, and SPRKStep. + .. c:function:: int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index a55efd89ea..690e4b36e2 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,23 +1,16 @@ -**New Features** +**Major Features** -Fixed the runtime library installation path for windows systems. This fix changes the -default library installation path from ``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to -``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``. - -Created shared user interface for ARKODE user-callable routines, to allow more -uniform control over time-stepping algorithms, improved extensibility, and -simplified code maintenance. Marked the corresponding stepper-specific -user-callable routines as deprecated; these will be removed in a future major -release. +Created shared user interface functions for ARKODE to allow more uniform control +over time-stepping algorithms, improved extensibility, and simplified code +maintenance. The corresponding stepper-specific user-callable functions are now +deprecated and will be removed in a future major release. -Added "Resize" capability, as well as missing ``SetRootDirection`` and -``SetNoInactiveRootWarn`` functions, to ARKODE's SPRKStep time-stepping module. +Added CMake infrastructure that enables externally maintained addons/plugins to +be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. -Deprecated ``ARKStepSetOptimalParams`` function; added instructions to user guide -for users who wish to retain the current functionality. +**New Features and Enhancements** -Added CMake infrastructure that enables externally maintained addons/plugins -to be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. +Added support for Kokkos Kernels v4. Added the following Runge-Kutta Butcher tables @@ -39,43 +32,80 @@ Added the following MRI coupling tables * ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` * ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` -**Bug Fixes** - -Fixed conflicting ``.lib`` files between shared and static libs when using ``MSVC`` on Windows +Users may now disable interpolated output in ARKODE by passing +``ARK_INTERP_NONE`` to :c:func:`ARKodeSetInterpolantType`. When interpolation is +disabled, rootfinding is not supported, implicit methods must use the trivial +predictor (the default option), and interpolation at stop times cannot be used +(interpolating at stop times is disabled by default). With interpolation +disabled, calling :c:func:`ARKodeEvolve` in ``ARK_NORMAL`` mode will return at +or past the requested output time (setting a stop time may still be used to halt +the integrator at a specific time). Disabling interpolation will reduce the +memory footprint of an integrator by two or more state vectors (depending on the +interpolant type and degree) which can be beneficial when interpolation is not +needed e.g., when integrating to a final time without output in between or using +an explicit fast time scale integrator with an MRI method. + +Added "Resize" capability to ARKODE's SPRKStep time-stepping module. -Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and static libs +**Bug Fixes** Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). +Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` +instead of ``SameMajorVersion``. This fixes the issue seen `here +<https://github.com/AMReX-Codes/amrex/pull/3835>`_. + +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some +instances. Fixes `GitHub Issue #464 +<https://github.com/LLNL/sundials/issues/464>`_. + +Fixed the runtime library installation path for windows systems. This fix +changes the default library installation path from +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``. + +Fixed conflicting ``.lib`` files between shared and static libs when using +``MSVC`` on Windows + +Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and +static libs. + +Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an +argument to a function pointer instead of ``c_null_funptr``. This caused +compilation issues with the Cray Fortran compiler. + Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set with ROCm 6.0.0 or newer. -Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` -instead of ``SameMajorVersion``. This fixes the issue seen -`here <https://github.com/AMReX-Codes/amrex/pull/3835>`_. +Fixed a bug that caused error messages to be cut off in some cases. Fixes +`GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. -Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an argument -to a function pointer instead of ``c_null_funptr``. This caused compilation issues -with the Cray Fortran compiler. +Fixed a memory leak when an error handler was added to a +:c:type:`SUNContext`. Fixes `GitHub Issue #466 +<https://github.com/LLNL/sundials/issues/466>`_. Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error produced from evolving the inner stepper. -Added support for Kokkos Kernels v4. - -Fixed a bug that caused error messages to be cut off in some cases. Fixes `GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. - -Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 <https://github.com/LLNL/sundials/issues/466>`_. - -Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 <https://github.com/LLNL/sundials/issues/464>`_. +Added missing ``SetRootDirection`` and ``SetNoInactiveRootWarn`` functions to +ARKODE's SPRKStep time-stepping module. Fixed a bug in :c:func:`ARKodeSPRKTable_Create` where the coefficient arrays -where not allocated. +were not allocated. Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could be 32 bits wide even if ``SUNDIALS_INT64_T`` is defined. Check if size of ``SuiteSparse_long`` is 8 if the size of ``sunindextype`` is 8 when using KLU. + +**Deprecation Notices** + +Numerous ARKODE stepper-specific functions are now deprecated in favor of +ARKODE-wide functions. + +Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an +ARKODE-wide equivalent, instructions have been added to the user guide for how +to retain the current functionality using other user-callable functions. diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index a656411f3f..7bb5e8df38 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -64,6 +64,7 @@ extern "C" { #define ARK_INTERP_MAX_DEGREE 5 /* interpolation module types */ +#define ARK_INTERP_NONE -1 #define ARK_INTERP_HERMITE 0 #define ARK_INTERP_LAGRANGE 1 diff --git a/scripts/startReleaseCycle.sh b/scripts/startReleaseCycle.sh index 042e4a251f..5e9f9e86b8 100755 --- a/scripts/startReleaseCycle.sh +++ b/scripts/startReleaseCycle.sh @@ -46,9 +46,13 @@ cat > tmp.txt <<HEREDOC ## Changes to SUNDIALS in release X.Y.Z -### New Features +### Major Features + +### New Features and Enhancements ### Bug Fixes + +### Deprecation Notices HEREDOC sedi -e '/SUNDIALS Changelog/ {' \ @@ -74,9 +78,13 @@ sedi -e '/RecentChanges_link.rst/ {' \ # Clear recent changes file cat > ../doc/shared/RecentChanges.rst <<HEREDOC -**New Features** +**Major Features** + +**New Features and Enhancements** **Bug Fixes** + +**Deprecation Notices** HEREDOC # Add new entry to changelog diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index cddd647a34..bc7a449ef4 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1020,7 +1020,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, if ((tout - ark_mem->tstop) * ark_mem->h >= ZERO || SUNRabs(tout - ark_mem->tstop) <= troundoff) { - if (ark_mem->tstopinterp) + if (ark_mem->tstopinterp && ark_mem->interp) { retval = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); if (retval != ARK_SUCCESS) @@ -1051,17 +1051,25 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, /* In NORMAL mode, check if tout reached */ if ((itask == ARK_NORMAL) && (ark_mem->tcur - tout) * ark_mem->h >= ZERO) { - retval = ARKodeGetDky(ark_mem, tout, 0, yout); - if (retval != ARK_SUCCESS) + if (ark_mem->interp) { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - MSG_ARK_INTERPOLATION_FAIL, tout); - istate = retval; - break; + retval = ARKodeGetDky(ark_mem, tout, 0, yout); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + MSG_ARK_INTERPOLATION_FAIL, tout); + istate = retval; + break; + } + ark_mem->tretlast = *tret = tout; } - ark_mem->tretlast = *tret = tout; - ark_mem->next_h = ark_mem->hprime; - istate = ARK_SUCCESS; + else + { + N_VScale(ONE, ark_mem->yn, yout); + ark_mem->tretlast = *tret = ark_mem->tcur; + } + ark_mem->next_h = ark_mem->hprime; + istate = ARK_SUCCESS; break; } @@ -1193,8 +1201,7 @@ void ARKodeFree(void** arkode_mem) if (ark_mem->interp != NULL) { arkInterpFree(ark_mem, ark_mem->interp); - ark_mem->interp = NULL; - ark_mem->interp_type = -1; + ark_mem->interp = NULL; } /* free the root-finding module */ @@ -1300,7 +1307,8 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) } /* output interpolation quantities */ - arkInterpPrintMem(ark_mem->interp, outfile); + if (ark_mem->interp) { arkInterpPrintMem(ark_mem->interp, outfile); } + else { fprintf(outfile, "interpolation = NULL\n"); } #ifdef SUNDIALS_DEBUG_PRINTVEC /* output vector quantities */ @@ -1487,8 +1495,9 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->liw += leniw; /* Initialize the interpolation structure to NULL */ - ark_mem->interp = NULL; - ark_mem->interp_type = -1; + ark_mem->interp = NULL; + ark_mem->interp_type = ARK_INTERP_HERMITE; + ark_mem->interp_degree = ARK_INTERP_MAX_DEGREE; /* Initially, rwt should point to ewt */ ark_mem->rwt_is_ewt = SUNTRUE; @@ -1654,19 +1663,6 @@ int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) return (ARK_MEM_FAIL); } - /* Create default Hermite interpolation module */ - 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, __LINE__, __func__, __FILE__, - "Unable to allocate interpolation module"); - return (ARK_MEM_FAIL); - } - ark_mem->interp_type = ARK_INTERP_HERMITE; - } - /* All allocations are complete */ ark_mem->MallocDone = SUNTRUE; } @@ -1894,11 +1890,51 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) } } + /* Create default Hermite interpolation module (if needed) */ + if (ark_mem->interp_type != ARK_INTERP_NONE && !(ark_mem->interp)) + { + ark_mem->interp = arkInterpCreate_Hermite(ark_mem, ark_mem->interp_degree); + if (ark_mem->interp == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to allocate interpolation module"); + return ARK_MEM_FAIL; + } + ark_mem->interp_type = ARK_INTERP_HERMITE; + } + /* 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); } + /* Stepper init may have limited the interpolation degree */ + if (arkInterpSetDegree(ark_mem, ark_mem->interp, ark_mem->interp_degree)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unable to update interpolation polynomial degree"); + return ARK_ILL_INPUT; + } + + if (arkInterpInit(ark_mem, ark_mem->interp, ark_mem->tcur)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unable to initialize interpolation module"); + return ARK_ILL_INPUT; + } + } + + /* Check if the configuration requires interpolation */ + if (ark_mem->root_mem && !(ark_mem->interp)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Rootfinding requires an interpolation module"); + return ARK_ILL_INPUT; + } + + if (ark_mem->tstopinterp && !(ark_mem->interp)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Stop time interpolation requires an interpolation module"); + return ARK_ILL_INPUT; } /* If fullrhs will be called (to estimate initial step, explicit steppers, Hermite @@ -2144,7 +2180,7 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, if ((tout - ark_mem->tstop) * ark_mem->h >= ZERO || SUNRabs(tout - ark_mem->tstop) <= troundoff) { - if (ark_mem->tstopinterp) + if (ark_mem->tstopinterp && ark_mem->interp) { *ier = ARKodeGetDky(ark_mem, ark_mem->tstop, 0, yout); if (*ier != ARK_SUCCESS) @@ -2175,14 +2211,22 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout, /* In ARK_NORMAL mode, test if tout was reached */ if ((itask == ARK_NORMAL) && ((ark_mem->tcur - tout) * ark_mem->h >= ZERO)) { - ark_mem->tretlast = *tret = tout; - *ier = ARKodeGetDky(ark_mem, tout, 0, yout); - if (*ier != ARK_SUCCESS) + if (ark_mem->interp) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - MSG_ARK_BAD_TOUT, tout); - *ier = ARK_ILL_INPUT; - return (1); + *ier = ARKodeGetDky(ark_mem, tout, 0, yout); + if (*ier != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_TOUT, tout); + *ier = ARK_ILL_INPUT; + return (1); + } + ark_mem->tretlast = *tret = tout; + } + else + { + N_VScale(ONE, ark_mem->yn, yout); + ark_mem->tretlast = *tret = ark_mem->tcur; } *ier = ARK_SUCCESS; return (1); @@ -2403,13 +2447,6 @@ int arkYddNorm(ARKodeMem ark_mem, sunrealtype hg, sunrealtype* yddnrm) { int retval; - if (ark_mem->interp == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Missing interpolation structure"); - return (ARK_MEM_NULL); - } - /* increment y with a multiple of f */ N_VLinearSum(hg, ark_mem->fn, ONE, ark_mem->yn, ark_mem->ycur); diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 70275484ec..f5f61f5e38 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1150,28 +1150,25 @@ int arkStep_Init(ARKodeMem ark_mem, int init_type) } } - /* Limit max interpolant degree (negative input only overwrites the current - interpolant degree if it is greater than abs(input). */ - if (ark_mem->interp != NULL) + /* Override the interpolant degree (if needed), used in arkInitialSetup */ + if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) { - if (step_mem->q > 1) - { - /* Limit max degree to at most one less than the method global order */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q - 1)); - } - else - { - /* Allow for linear interpolant with first order methods to ensure - solution values are returned at the time interval end points */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q)); - } + /* Limit max degree to at most one less than the method global order */ + ark_mem->interp_degree = step_mem->q - 1; + } + else if (step_mem->q == 1 && ark_mem->interp_degree > 1) + { + /* Allow for linear interpolant with first order methods to ensure + solution values are returned at the time interval end points */ + ark_mem->interp_degree = 1; + } - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Unable to update interpolation polynomial degree"); - return (ARK_ILL_INPUT); - } + /* Higher-order predictors require interpolation */ + if (ark_mem->interp_type == ARK_INTERP_NONE && step_mem->predictor != 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Non-trival predictors require an interpolation module"); + return ARK_ILL_INPUT; } } diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 2432784596..1da8125942 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -449,28 +449,17 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) ark_mem->liw += (step_mem->stages + 1); /* pointers */ } - /* Limit max interpolant degree (negative input only overwrites the current - interpolant degree if it is greater than abs(input). */ - if (ark_mem->interp != NULL) + /* Override the interpolant degree (if needed), used in arkInitialSetup */ + if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) { - if (step_mem->q > 1) - { - /* Limit max degree to at most one less than the method global order */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q - 1)); - } - else - { - /* Allow for linear interpolant with first order methods to ensure - solution values are returned at the time interval end points */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q)); - } - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Unable to update interpolation polynomial degree"); - return (ARK_ILL_INPUT); - } + /* Limit max degree to at most one less than the method global order */ + ark_mem->interp_degree = step_mem->q - 1; + } + else if (step_mem->q == 1 && ark_mem->interp_degree > 1) + { + /* Allow for linear interpolant with first order methods to ensure + solution values are returned at the time interval end points */ + ark_mem->interp_degree = 1; } /* Signal to shared arkode module that full RHS evaluations are required */ diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 4f6cad21be..f5a91d468c 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -466,6 +466,7 @@ struct ARKodeMemRec /* Temporal interpolation module */ ARKInterp interp; int interp_type; + int interp_degree; /* Tstop information */ sunbooleantype tstopset; diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 2d61283c7a..daf42de479 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -23,6 +23,7 @@ #include <sundials/sundials_math.h> #include <sundials/sundials_types.h> +#include "arkode/arkode.h" #include "arkode_impl.h" #include "arkode_interp_impl.h" @@ -290,18 +291,8 @@ void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile) /*--------------------------------------------------------------- arkInterpSetDegree_Hermite - This routine sets a supplied interpolation degree. If the - argument is positive, then we require that - 0 <= degree <= ARK_INTERP_MAX_DEGREE - and use this value as the user-specified (or default) degree. - - If the argument is negative, then we assume that this has been - called by a time-step module to limit the interpolant degree - based on the temporal method order. In this case we set the - Hermite polynomial degree to be the minimum of (-degree), - ARK_INTERP_MAX_DEGREE, and the previously-set value [i.e., in - case the user has already specified use of a lower-degree - polynomial]. + This routine sets a supplied interpolation degree which must be + in the range 0 <= degree <= ARK_INTERP_MAX_DEGREE. Return values: ARK_ILL_INPUT -- if the input is outside of allowable bounds @@ -311,29 +302,16 @@ void arkInterpPrintMem_Hermite(ARKInterp interp, FILE* outfile) ---------------------------------------------------------------*/ int arkInterpSetDegree_Hermite(ARKodeMem ark_mem, ARKInterp interp, int degree) { - /* if this degree is already stored, just return */ - if (abs(degree) == HINT_DEGREE(interp)) { return (ARK_SUCCESS); } - - /* on positive degree, check for allowable value and overwrite stored degree */ - if (degree >= 0) + if (degree > ARK_INTERP_MAX_DEGREE || degree < 0) { - if (degree > ARK_INTERP_MAX_DEGREE) - { - arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, - "Illegal degree specified."); - return (ARK_ILL_INPUT); - } - - HINT_DEGREE(interp) = degree; - return (ARK_SUCCESS); + arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, + "Illegal degree specified."); + return ARK_ILL_INPUT; } - /* on negative degree, check for allowable value and update stored degree */ - degree = -degree; - if (degree > ARK_INTERP_MAX_DEGREE) { degree = ARK_INTERP_MAX_DEGREE; } - HINT_DEGREE(interp) = SUNMIN(HINT_DEGREE(interp), degree); + HINT_DEGREE(interp) = degree; - return (ARK_SUCCESS); + return ARK_SUCCESS; } /*--------------------------------------------------------------- @@ -1015,18 +993,8 @@ void arkInterpPrintMem_Lagrange(ARKInterp I, FILE* outfile) /*--------------------------------------------------------------- arkInterpSetDegree_Lagrange - This routine sets a supplied interpolation degree. If the - argument is positive, then we require that - 0 <= degree <= ARK_INTERP_MAX_DEGREE - and use this value as the user-specified (or default) degree. - - If the argument is negative, then we assume that this has been - called by a time-step module to limit the interpolant degree - based on the temporal method order. In this case we set the - Lagrange polynomial degree to be the minimum of (-degree), - ARK_INTERP_MAX_DEGREE, and the previously-set value [i.e., in - case the user has already specified use of a lower-degree - polynomial]. + This routine sets a supplied interpolation degree which must be + in the range 0 <= degree <= ARK_INTERP_MAX_DEGREE. Return values: ARK_ILL_INPUT -- if the input is outside of allowable bounds @@ -1036,29 +1004,16 @@ void arkInterpPrintMem_Lagrange(ARKInterp I, FILE* outfile) ---------------------------------------------------------------*/ int arkInterpSetDegree_Lagrange(ARKodeMem ark_mem, ARKInterp I, int degree) { - /* if this degree is already stored, just return */ - if (abs(degree) + 1 == LINT_NMAX(I)) { return (ARK_SUCCESS); } - - /* on positive degree, check for allowable value and overwrite stored degree */ - if (degree >= 0) + if (degree > ARK_INTERP_MAX_DEGREE || degree < 0) { - if (degree > ARK_INTERP_MAX_DEGREE) - { - arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, - "Illegal degree specified."); - return (ARK_ILL_INPUT); - } - - LINT_NMAX(I) = degree + 1; - return (ARK_SUCCESS); + arkProcessError(ark_mem, ARK_INTERP_FAIL, __LINE__, __func__, __FILE__, + "Illegal degree specified."); + return ARK_ILL_INPUT; } - /* on negative degree, check for allowable value and update stored degree */ - degree = -degree; - if (degree > ARK_INTERP_MAX_DEGREE) { degree = ARK_INTERP_MAX_DEGREE; } - LINT_NMAX(I) = SUNMIN(LINT_NMAX(I), degree + 1); + LINT_NMAX(I) = degree + 1; - return (ARK_SUCCESS); + return ARK_SUCCESS; } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index c1d73c866c..fd7287fbde 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -25,6 +25,7 @@ #include <sundials/sundials_math.h> #include <sundials/sundials_types.h> +#include "arkode/arkode.h" #include "arkode_impl.h" #include "arkode_interp_impl.h" #include "arkode_user_controller.h" @@ -165,7 +166,8 @@ int ARKodeSetInterpolantType(void* arkode_mem, int itype) ark_mem = (ARKodeMem)arkode_mem; /* check for legal itype input */ - if ((itype != ARK_INTERP_HERMITE) && (itype != ARK_INTERP_LAGRANGE)) + if ((itype != ARK_INTERP_HERMITE) && (itype != ARK_INTERP_LAGRANGE) && + (itype != ARK_INTERP_NONE)) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, "Illegal interpolation type input."); @@ -191,24 +193,30 @@ int ARKodeSetInterpolantType(void* arkode_mem, int itype) the maximum possible interpolant degree. */ if (itype == ARK_INTERP_HERMITE) { - ark_mem->interp = arkInterpCreate_Hermite(arkode_mem, ARK_INTERP_MAX_DEGREE); + ark_mem->interp = arkInterpCreate_Hermite(arkode_mem, ark_mem->interp_degree); + if (ark_mem->interp == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to allocate interpolation structure"); + return ARK_MEM_FAIL; + } ark_mem->interp_type = ARK_INTERP_HERMITE; } else if (itype == ARK_INTERP_LAGRANGE) { - ark_mem->interp = arkInterpCreate_Lagrange(arkode_mem, ARK_INTERP_MAX_DEGREE); + ark_mem->interp = arkInterpCreate_Lagrange(arkode_mem, + ark_mem->interp_degree); + if (ark_mem->interp == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Unable to allocate interpolation structure"); + } 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, __LINE__, __func__, __FILE__, - "Unable to allocate interpolation structure"); - return (ARK_MEM_FAIL); + ark_mem->interp_type = ARK_INTERP_NONE; } return (ARK_SUCCESS); @@ -239,13 +247,6 @@ int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) } ark_mem = (ARKodeMem)arkode_mem; - if (ark_mem->interp == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - "Interpolation module is not yet allocated"); - return (ARK_MEM_NULL); - } - /* do not change degree once the module has been initialized */ if (ark_mem->initialized) { @@ -254,9 +255,23 @@ int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) return (ARK_ILL_INPUT); } - /* pass 'degree' to interpolation module, returning its value */ - if (degree < 0) { degree = ARK_INTERP_MAX_DEGREE; } - return (arkInterpSetDegree(ark_mem, ark_mem->interp, degree)); + if (degree > ARK_INTERP_MAX_DEGREE) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Illegal degree specified."); + return ARK_ILL_INPUT; + } + else if (degree < 0) { ark_mem->interp_degree = ARK_INTERP_MAX_DEGREE; } + else { ark_mem->interp_degree = degree; } + + /* Set the degree now if possible otherwise it will be used when creating the + interpolation module */ + if (ark_mem->interp) + { + return arkInterpSetDegree(ark_mem, ark_mem->interp, ark_mem->interp_degree); + } + + return ARK_SUCCESS; } /*--------------------------------------------------------------- @@ -655,6 +670,14 @@ int ARKodeSetPredictorMethod(void* arkode_mem, int pred_method) return (ARK_STEPPER_UNSUPPORTED); } + /* Higher-order predictors require interpolation */ + if (ark_mem->interp_type == ARK_INTERP_NONE && pred_method != 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Non-trival predictors require an interpolation module"); + return ARK_ILL_INPUT; + } + /* Call stepper routine (if provided) */ if (ark_mem->step_setpredictormethod) { diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 78f34da788..ce77dde8d4 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1115,28 +1115,25 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_MEM_FAIL); } - /* Limit max interpolant degree (negative input only overwrites the current - interpolant degree if it is greater than abs(input). */ - if (ark_mem->interp != NULL) + /* Override the interpolant degree (if needed), used in arkInitialSetup */ + if (step_mem->q > 1 && ark_mem->interp_degree > (step_mem->q - 1)) { - if (step_mem->q > 1) - { - /* Limit max degree to at most one less than the method global order */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q - 1)); - } - else - { - /* Allow for linear interpolant with first order methods to ensure - solution values are returned at the time interval end points */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, -(step_mem->q)); - } + /* Limit max degree to at most one less than the method global order */ + ark_mem->interp_degree = step_mem->q - 1; + } + else if (step_mem->q == 1 && ark_mem->interp_degree > 1) + { + /* Allow for linear interpolant with first order methods to ensure + solution values are returned at the time interval end points */ + ark_mem->interp_degree = 1; + } - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Unable to update interpolation polynomial degree"); - return (ARK_ILL_INPUT); - } + /* Higher-order predictors require interpolation */ + if (ark_mem->interp_type == ARK_INTERP_NONE && step_mem->predictor != 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Non-trival predictors require an interpolation module"); + return ARK_ILL_INPUT; } } diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 8537444ab6..b84bc328c1 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -410,30 +410,18 @@ int sprkStep_Init(ARKodeMem ark_mem, int init_type) } } - /* Limit max interpolant degree (negative input only overwrites the current - interpolant degree if it is greater than abs(input). */ - if (ark_mem->interp != NULL) + /* Override the interpolant degree (if needed), used in arkInitialSetup */ + if (step_mem->method->q > 1 && + ark_mem->interp_degree > (step_mem->method->q - 1)) { - if (step_mem->method->q > 1) - { - /* Limit max degree to at most one less than the method global order */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, - -(step_mem->method->q - 1)); - } - else - { - /* Allow for linear interpolant with first order methods to ensure - solution values are returned at the time interval end points */ - retval = arkInterpSetDegree(ark_mem, ark_mem->interp, - -(step_mem->method->q)); - } - - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Unable to update interpolation polynomial degree"); - return (ARK_ILL_INPUT); - } + /* Limit max degree to at most one less than the method global order */ + ark_mem->interp_degree = step_mem->method->q - 1; + } + else if (step_mem->method->q == 1 && ark_mem->interp_degree > 1) + { + /* Allow for linear interpolant with first order methods to ensure + solution values are returned at the time interval end points */ + ark_mem->interp_degree = 1; } return (ARK_SUCCESS); diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index f6252c31f4..182cf7fe2f 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -38,6 +38,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT integer(C_INT), parameter, public :: ARK_INTERP_MAX_DEGREE = 5_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_NONE = -1_C_INT integer(C_INT), parameter, public :: ARK_INTERP_HERMITE = 0_C_INT integer(C_INT), parameter, public :: ARK_INTERP_LAGRANGE = 1_C_INT integer(C_INT), parameter, public :: ARK_SUCCESS = 0_C_INT diff --git a/test/answers b/test/answers index b622a192d5..a7784dcea1 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit b622a192d52f7982bb6485f0cba5ffd3fc24e622 +Subproject commit a7784dcea101f2240e883d26a0691998324beda4 diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 9eb5952496..331b1ece35 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -18,15 +18,21 @@ set(unit_tests "ark_test_analytic_sys_mri.cpp\;0" "ark_test_analytic_sys_mri.cpp\;1" + "ark_test_dahlquist_ark.cpp\;0 -1" + "ark_test_dahlquist_ark.cpp\;1 -1" + "ark_test_dahlquist_ark.cpp\;2 -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\;-1" "ark_test_dahlquist_erk.cpp\;0" "ark_test_dahlquist_erk.cpp\;1" - "ark_test_dahlquist_mri.cpp\;" + "ark_test_dahlquist_mri.cpp\;-1" + "ark_test_dahlquist_mri.cpp\;0" + "ark_test_dahlquist_mri.cpp\;1" "ark_test_butcher.cpp\;" "ark_test_getjac.cpp\;" "ark_test_getjac_mri.cpp\;" 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 index 6a98c79797..4cad0ee64b 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp @@ -65,6 +65,7 @@ enum class rk_type enum class interp_type { + none = -1, hermite, lagrange }; @@ -93,8 +94,9 @@ struct ProblemOptions sunrealtype h = SUN_RCONST(0.01); // Interpolant type - // 0 = Hermite - // 1 = Lagrange + // -1 = None + // 0 = Hermite + // 1 = Lagrange interp_type i_type = interp_type::hermite; // Predictor type @@ -166,8 +168,20 @@ int main(int argc, char* argv[]) if (argc > 2) { - if (std::stoi(argv[2]) == 1) { prob_opts.i_type = interp_type::lagrange; } - else { prob_opts.i_type = interp_type::hermite; } + if (std::stoi(argv[2]) == -1) { prob_opts.i_type = interp_type::none; } + else if (std::stoi(argv[2]) == 0) + { + prob_opts.i_type = interp_type::hermite; + } + else if (std::stoi(argv[2]) == 1) + { + prob_opts.i_type = interp_type::lagrange; + } + else + { + std::cerr << "ERROR: Invalid interpolation type option" << std::endl; + return 1; + } } if (argc > 3) @@ -201,7 +215,11 @@ int main(int argc, char* argv[]) { std::cout << " interp type = Hermite\n"; } - else { std::cout << " interp type = Lagrange\n"; } + else if (prob_opts.i_type == interp_type::lagrange) + { + std::cout << " interp type = Lagrange\n"; + } + else { std::cout << " interp type = None\n"; } if (prob_opts.p_type == 0) { std::cout << " pred type = Trivial (0)\n"; } else { std::cout << " pred type = Max order (1)\n"; } @@ -489,6 +507,11 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, flag = ARKodeSetInterpolantType(arkstep_mem, ARK_INTERP_LAGRANGE); if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } } + else if (prob_opts.i_type == interp_type::none) + { + flag = ARKodeSetInterpolantType(arkstep_mem, ARK_INTERP_NONE); + if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } + } // Create matrix and linear solver (if necessary) SUNMatrix A = nullptr; @@ -595,8 +618,11 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, flag = ARKodeGetLastStep(arkstep_mem, &h_last); if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } - flag = ARKodeGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); - if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + if (prob_opts.i_type != interp_type::none) + { + flag = ARKodeGetDky(arkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKodeGetDky", 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 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..5ab8fcafd1 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_-1.out @@ -0,0 +1,2405 @@ + +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 = None + pred type = Trivial (0) + +======================== +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 +-------------------- + +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + +======================== +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 +-------------------- + +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + +===================== +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: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +IMEX Table ID 2 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +IMEX Table ID 3 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +IMEX Table ID 4 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + +======================== +IMEX Table ID 5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + + +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..11e1fc907f --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_-1.out @@ -0,0 +1,2405 @@ + +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 = None + pred type = Trivial (0) + +======================== +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 +-------------------- + +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + +======================== +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 +-------------------- + +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + +===================== +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: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +IMEX Table ID 2 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +IMEX Table ID 3 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +IMEX Table ID 4 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + +======================== +IMEX Table ID 5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + + +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..1fa5a0d33a --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1.out @@ -0,0 +1,2405 @@ + +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 = None + pred type = Trivial (0) + +======================== +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 +-------------------- + +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + +======================== +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 +-------------------- + +======================== +DIRK Table ID 124 + 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 125 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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 126 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + +===================== +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: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +IMEX Table ID 2 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +IMEX Table ID 3 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +IMEX Table ID 4 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + +======================== +IMEX Table ID 5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + + +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 index a97e27ecd8..de271e6646 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp @@ -46,6 +46,7 @@ enum class interp_type { + none = -1, hermite, lagrange }; @@ -71,8 +72,9 @@ struct ProblemOptions sunrealtype h = SUN_RCONST(0.01); // Interpolant type - // 0 = Hermite - // 1 = Lagrange + // -1 = None + // 0 = Hermite + // 1 = Lagrange interp_type i_type = interp_type::hermite; }; @@ -109,8 +111,20 @@ int main(int argc, char* argv[]) // 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; } + if (std::stoi(argv[1]) == -1) { prob_opts.i_type = interp_type::none; } + else if (std::stoi(argv[1]) == 0) + { + prob_opts.i_type = interp_type::hermite; + } + else if (std::stoi(argv[1]) == 1) + { + prob_opts.i_type = interp_type::lagrange; + } + else + { + std::cerr << "ERROR: Invalid interpolation type option" << std::endl; + return 1; + } } // Output problem setup @@ -123,7 +137,11 @@ int main(int argc, char* argv[]) { std::cout << " interp type = Hermite\n"; } - else { std::cout << " interp type = Lagrange\n"; } + else if (prob_opts.i_type == interp_type::lagrange) + { + std::cout << " interp type = Lagrange\n"; + } + else { std::cout << " interp type = None\n"; } // Create SUNDIALS context sundials::Context sunctx; @@ -251,6 +269,11 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, flag = ARKodeSetInterpolantType(erkstep_mem, ARK_INTERP_LAGRANGE); if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } } + else if (prob_opts.i_type == interp_type::none) + { + flag = ARKodeSetInterpolantType(erkstep_mem, ARK_INTERP_NONE); + if (check_flag(&flag, "ERKodeSetInterpolantType", 1)) { return 1; } + } // Attach Butcher tables flag = ERKStepSetTable(erkstep_mem, Be); @@ -305,8 +328,11 @@ int run_tests(ARKodeButcherTable Be, ProblemData& prob_data, flag = ARKodeGetLastStep(erkstep_mem, &h_last); if (check_flag(&flag, "ARKodeGetLastStep", 1)) { return 1; } - flag = ARKodeGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); - if (check_flag(&flag, "ARKodeGetDky", 1)) { return 1; } + if (prob_opts.i_type != interp_type::none) + { + flag = ARKodeGetDky(erkstep_mem, t_ret - h_last / TWO, 0, y); + if (check_flag(&flag, "ARKodeGetDky", 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 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..ddbbbe232b --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_-1.out @@ -0,0 +1,924 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + step size = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = None + +======================== +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 +-------------------- + +======================== +ERK Table ID 22 + 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 23 + 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 24 + 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 +-------------------- + + +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 7e3d20ca84..202e1780ef 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 @@ -43,16 +43,45 @@ #define FSYM "f" #endif -using namespace std; +enum class interp_type +{ + none = -1, + hermite, + lagrange, +}; -// User data structure -struct UserData +// Problem parameters +struct ProblemData { sunrealtype lambda_e = SUN_RCONST(-1.0); sunrealtype lambda_i = SUN_RCONST(-1.0); sunrealtype lambda_f = SUN_RCONST(-1.0); }; +// Problem options +struct ProblemOptions +{ + // Initial time + sunrealtype t0 = SUN_RCONST(0.0); + + // Number of time steps + int nsteps = 1; + + // Relative and absolute tolerances + sunrealtype reltol = SUN_RCONST(1.0e-4); + sunrealtype abstol = SUN_RCONST(1.0e-6); + + // Slow and fast step sizes + sunrealtype hs = SUN_RCONST(0.01); + sunrealtype hf = SUN_RCONST(0.01); + + // Interpolant type + // -1 = None + // 0 = Hermite + // 1 = Lagrange + interp_type i_type = interp_type::hermite; +}; + // User-supplied Functions called by the solver static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); @@ -61,12 +90,11 @@ static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); // Private function to check function return values -static int check_flag(void* flagvalue, const string funcname, int opt); +static int check_flag(void* flagvalue, const std::string funcname, int opt); // Test drivers -static int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, - sunrealtype hs, sunrealtype hf, sunrealtype reltol, - sunrealtype abstol, UserData* udata, SUNContext ctx); +static int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, + ProblemData& prob_data, SUNContext ctx); // ----------------------------------------------------------------------------- // Main Program @@ -74,58 +102,61 @@ static int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, int main(int argc, char* argv[]) { - // Initial time - sunrealtype t0 = SUN_RCONST(0.0); - - // Number of time steps - int nsteps = 1; - - // Relative and absolute tolerances - sunrealtype reltol = SUN_RCONST(1.0e-4); - sunrealtype abstol = SUN_RCONST(1.0e-6); - - // Slow and fast step sizes - sunrealtype hs = SUN_RCONST(0.01); - sunrealtype hf = SUN_RCONST(0.01); - - // User data structure - UserData udata; + // Problem data and options structures + ProblemData prob_data; + ProblemOptions prob_opts; // Check for inputs - if (argc > 1) { udata.lambda_e = std::stod(argv[1]); } - if (argc > 2) { udata.lambda_i = std::stod(argv[2]); } - if (argc > 3) { udata.lambda_f = std::stod(argv[3]); } - if (argc > 4) { hs = std::stod(argv[4]); } - if (argc > 5) { hf = std::stod(argv[5]); } - if (argc > 5) { nsteps = std::stoi(argv[6]); } + if (argc > 1) + { + if (std::stoi(argv[1]) == -1) { prob_opts.i_type = interp_type::none; } + else if (std::stoi(argv[1]) == 0) + { + prob_opts.i_type = interp_type::hermite; + } + else if (std::stoi(argv[1]) == 1) + { + prob_opts.i_type = interp_type::lagrange; + } + else + { + std::cerr << "ERROR: Invalid interpolation type option" << std::endl; + return 1; + } + } // Output problem setup - cout << "\nDahlquist ODE test problem:\n"; - cout << " lambda expl = " << udata.lambda_e << "\n"; - cout << " lambda impl = " << udata.lambda_i << "\n"; - cout << " lambda fast = " << udata.lambda_f << "\n"; - cout << " h slow = " << hs << "\n"; - cout << " h fast = " << hf << "\n"; - cout << " relative tol = " << reltol << "\n"; - cout << " absolute tol = " << abstol << "\n"; - + std::cout << "\nDahlquist ODE test problem:\n"; + std::cout << " lambda expl = " << prob_data.lambda_e << "\n"; + std::cout << " lambda impl = " << prob_data.lambda_i << "\n"; + std::cout << " lambda fast = " << prob_data.lambda_f << "\n"; + std::cout << " h slow = " << prob_opts.hs << "\n"; + std::cout << " h fast = " << prob_opts.hf << "\n"; + std::cout << " relative tol = " << prob_opts.reltol << "\n"; + std::cout << " absolute tol = " << prob_opts.abstol << "\n"; + if (prob_opts.i_type == interp_type::hermite) + { + std::cout << " interp type = Hermite\n"; + } + else if (prob_opts.i_type == interp_type::lagrange) + { + std::cout << " interp type = Lagrange\n"; + } + else { std::cout << " interp type = None\n"; } // Create SUNDIALS context sundials::Context sunctx; // Test methods int numfails = 0; - numfails += run_tests(MRISTEP_EXPLICIT, t0, nsteps, hs, hf, reltol, abstol, - &udata, sunctx); + numfails += run_tests(MRISTEP_EXPLICIT, prob_opts, prob_data, sunctx); - numfails += run_tests(MRISTEP_IMPLICIT, t0, nsteps, hs, hf, reltol, abstol, - &udata, sunctx); + numfails += run_tests(MRISTEP_IMPLICIT, prob_opts, prob_data, sunctx); - numfails += run_tests(MRISTEP_IMEX, t0, nsteps, hs, hf, reltol, abstol, - &udata, sunctx); + numfails += run_tests(MRISTEP_IMEX, prob_opts, prob_data, sunctx); - if (numfails) { cout << "\n\nFailed " << numfails << " tests!\n"; } - else { cout << "\n\nAll tests passed!\n"; } + if (numfails) { std::cout << "\n\nFailed " << numfails << " tests!\n"; } + else { std::cout << "\n\nAll tests passed!\n"; } // Return test status return numfails; @@ -135,9 +166,8 @@ int main(int argc, char* argv[]) // Test drivers // ----------------------------------------------------------------------------- -int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, - sunrealtype hs, sunrealtype hf, sunrealtype reltol, - sunrealtype abstol, UserData* udata, SUNContext sunctx) +int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, + ProblemData& prob_data, SUNContext sunctx) { // Reusable error-checking flag int flag; @@ -170,21 +200,33 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, // ---------------------- // Create explicit fast integrator - void* arkstep_mem = ARKStepCreate(ff, nullptr, t0, y, sunctx); + void* arkstep_mem = ARKStepCreate(ff, nullptr, prob_opts.t0, y, sunctx); if (check_flag((void*)arkstep_mem, "ARKStepCreate", 0)) { return 1; } // Set user data - flag = ARKodeSetUserData(arkstep_mem, udata); + flag = ARKodeSetUserData(arkstep_mem, &prob_data); if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(arkstep_mem, reltol, abstol); + flag = ARKodeSStolerances(arkstep_mem, prob_opts.reltol, prob_opts.abstol); if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step size - flag = ARKodeSetFixedStep(arkstep_mem, hf); + flag = ARKodeSetFixedStep(arkstep_mem, prob_opts.hf); if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + // Lagrange interpolant (removes additional RHS evaluation with DIRK methods) + if (prob_opts.i_type == interp_type::lagrange) + { + flag = ARKodeSetInterpolantType(arkstep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + } + else if (prob_opts.i_type == interp_type::none) + { + flag = ARKodeSetInterpolantType(arkstep_mem, ARK_INTERP_NONE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + } + // Wrap ARKStep integrator as fast integrator object MRIStepInnerStepper inner_stepper = nullptr; flag = ARKStepCreateMRIStepInnerStepper(arkstep_mem, &inner_stepper); @@ -199,29 +241,31 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (type == MRISTEP_EXPLICIT) { - mristep_mem = MRIStepCreate(fe, nullptr, t0, y, inner_stepper, sunctx); + mristep_mem = MRIStepCreate(fe, nullptr, prob_opts.t0, y, inner_stepper, + sunctx); } else if (type == MRISTEP_IMPLICIT) { - mristep_mem = MRIStepCreate(nullptr, fi, t0, y, inner_stepper, sunctx); + mristep_mem = MRIStepCreate(nullptr, fi, prob_opts.t0, y, inner_stepper, + sunctx); } else if (type == MRISTEP_IMEX) { - mristep_mem = MRIStepCreate(fe, fi, t0, y, inner_stepper, sunctx); + mristep_mem = MRIStepCreate(fe, fi, prob_opts.t0, y, inner_stepper, sunctx); } else { return 1; } if (check_flag((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } // Set user data - flag = ARKodeSetUserData(mristep_mem, udata); + flag = ARKodeSetUserData(mristep_mem, &prob_data); if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } // Specify tolerances - flag = ARKodeSStolerances(mristep_mem, reltol, abstol); + flag = ARKodeSStolerances(mristep_mem, prob_opts.reltol, prob_opts.abstol); if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } // Specify fixed time step sizes - flag = ARKodeSetFixedStep(mristep_mem, hs); + flag = ARKodeSetFixedStep(mristep_mem, prob_opts.hs); if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) @@ -239,6 +283,18 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } } + // Lagrange interpolant (removes additional RHS evaluation with DIRK methods) + if (prob_opts.i_type == interp_type::lagrange) + { + flag = ARKodeSetInterpolantType(mristep_mem, ARK_INTERP_LAGRANGE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + } + else if (prob_opts.i_type == interp_type::none) + { + flag = ARKodeSetInterpolantType(mristep_mem, ARK_INTERP_NONE); + if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } + } + // ------------------------------------ // Evolve with various IMEX MRI methods // ------------------------------------ @@ -248,9 +304,9 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (type == MRISTEP_EXPLICIT) { - cout << "\n=========================\n"; - cout << "Test explicit MRI methods\n"; - cout << "=========================\n"; + std::cout << "\n=========================\n"; + std::cout << "Test explicit MRI methods\n"; + std::cout << "=========================\n"; methods.insert({{"ARKODE_MRI_GARK_FORWARD_EULER", false}, {"ARKODE_MRI_GARK_ERK22a", false}, @@ -263,9 +319,9 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, } else if (type == MRISTEP_IMPLICIT) { - cout << "\n=========================\n"; - cout << "Test implicit MRI methods\n"; - cout << "=========================\n"; + std::cout << "\n=========================\n"; + std::cout << "Test implicit MRI methods\n"; + std::cout << "=========================\n"; methods.insert({{"ARKODE_MRI_GARK_BACKWARD_EULER", true}, {"ARKODE_MRI_GARK_IRK21a", true}, @@ -275,9 +331,9 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, } else if (type == MRISTEP_IMEX) { - cout << "\n=====================\n"; - cout << "Test IMEX MRI methods\n"; - cout << "=====================\n"; + std::cout << "\n=====================\n"; + std::cout << "Test IMEX MRI methods\n"; + std::cout << "=====================\n"; methods.insert({{"ARKODE_IMEX_MRI_GARK_EULER", true}, {"ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL", false}, @@ -292,7 +348,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, { std::string id = pair.first; bool stiffly_accurate = pair.second; - cout << "\nTesting method " << id << "\n"; + std::cout << "\nTesting method " << id << "\n"; // ------------- // Select method @@ -311,7 +367,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, flag = mriStepCoupling_GetStageMap(C, stage_map, &nstages_stored); if (check_flag(&flag, "mriStepCoupling_GetStageMap", 1)) { return 1; } - cout << " Stored stages = " << nstages_stored << "\n"; + std::cout << " Stored stages = " << nstages_stored << "\n"; delete[] stage_map; // Set coupling table @@ -322,17 +378,17 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, // Output statistics // ----------------- - sunrealtype t = t0; - sunrealtype tf = nsteps * hs; + sunrealtype t = prob_opts.t0; + sunrealtype tf = prob_opts.nsteps * prob_opts.hs; - for (int i = 0; i < nsteps; i++) + for (int i = 0; i < prob_opts.nsteps; i++) { // Advance in time flag = ARKodeEvolve(mristep_mem, tf, y, &t, ARK_ONE_STEP); if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } // Update output time - tf += hs; + tf += prob_opts.hs; } // ----------------- @@ -367,43 +423,43 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, check_flag(&flag, "ARKodeGetNumLinRhsEvals", 1); } - sunrealtype pow = udata->lambda_f; + sunrealtype pow = prob_data.lambda_f; if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) { - pow += udata->lambda_e; + pow += prob_data.lambda_e; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - pow += udata->lambda_i; + pow += prob_data.lambda_i; } sunrealtype ytrue = exp(pow * t); sunrealtype* ydata = N_VGetArrayPointer(y); sunrealtype error = ytrue - ydata[0]; - cout << "\nMRIStep Statistics:\n"; - cout << " Time = " << t << "\n"; - cout << " y(t) = " << ytrue << "\n"; - cout << " y_n = " << ydata[0] << "\n"; - cout << " Error = " << error << "\n"; - cout << " Steps = " << mri_nst << "\n"; - cout << " Fe evals = " << mri_nfse << "\n"; - cout << " Fi evals = " << mri_nfsi << "\n"; + std::cout << "\nMRIStep Statistics:\n"; + std::cout << " Time = " << t << "\n"; + std::cout << " y(t) = " << ytrue << "\n"; + std::cout << " y_n = " << ydata[0] << "\n"; + std::cout << " Error = " << error << "\n"; + std::cout << " Steps = " << mri_nst << "\n"; + std::cout << " Fe evals = " << mri_nfse << "\n"; + std::cout << " Fi evals = " << mri_nfsi << "\n"; if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { - cout << " NLS iters = " << mri_nni << "\n"; - cout << " NLS fails = " << mri_ncfn << "\n"; - cout << " LS setups = " << mri_nsetups << "\n"; - cout << " LS Fi evals = " << mri_nfeLS << "\n"; - cout << " Ji evals = " << mri_nje << "\n"; + std::cout << " NLS iters = " << mri_nni << "\n"; + std::cout << " NLS fails = " << mri_ncfn << "\n"; + std::cout << " LS setups = " << mri_nsetups << "\n"; + std::cout << " LS Fi evals = " << mri_nfeLS << "\n"; + std::cout << " Ji evals = " << mri_nje << "\n"; } // ---------------- // Check statistics // ---------------- - cout << "\nComparing Solver Statistics:\n"; + std::cout << "\nComparing Solver Statistics:\n"; int nstages_evaluated = nstages_stored; if (stiffly_accurate) nstages_evaluated--; @@ -416,7 +472,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (mri_nfse != fe_evals) { numfails++; - cout << "Fe RHS evals: " << mri_nfse << " vs " << fe_evals << "\n"; + std::cout << "Fe RHS evals: " << mri_nfse << " vs " << fe_evals << "\n"; } long int fi_evals = 0; @@ -428,11 +484,11 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, if (mri_nfsi != fi_evals) { numfails++; - cout << "Fi RHS evals: " << mri_nfsi << " vs " << fi_evals << "\n"; + std::cout << "Fi RHS evals: " << mri_nfsi << " vs " << fi_evals << "\n"; } - if (numfails) { cout << "Failed " << numfails << " tests\n"; } - else { cout << "All checks passed\n"; } + if (numfails) { std::cout << "Failed " << numfails << " tests\n"; } + else { std::cout << "All checks passed\n"; } // ------------------- // Setup for next test @@ -445,21 +501,21 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, N_VConst(SUN_RCONST(1.0), y); // Re-initialize fast integrator - flag = ARKStepReInit(arkstep_mem, ff, nullptr, t0, y); + flag = ARKStepReInit(arkstep_mem, ff, nullptr, prob_opts.t0, y); if (check_flag(&flag, "ARKStepReInit", 1)) { return 1; } // Re-initialize slow integrator based on MRI type if (type == MRISTEP_EXPLICIT) { - flag = MRIStepReInit(mristep_mem, fe, nullptr, t0, y); + flag = MRIStepReInit(mristep_mem, fe, nullptr, prob_opts.t0, y); } else if (type == MRISTEP_IMPLICIT) { - flag = MRIStepReInit(mristep_mem, nullptr, fi, t0, y); + flag = MRIStepReInit(mristep_mem, nullptr, fi, prob_opts.t0, y); } else if (type == MRISTEP_IMEX) { - flag = MRIStepReInit(mristep_mem, fe, fi, t0, y); + flag = MRIStepReInit(mristep_mem, fe, fi, prob_opts.t0, y); } else { return 1; } if (check_flag(&flag, "MRIStepReInit", 1)) { return 1; } @@ -486,11 +542,11 @@ int run_tests(MRISTEP_METHOD_TYPE type, sunrealtype t0, int nsteps, // Explicit ODE RHS function fe(t,y) static 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); - UserData* udata = static_cast<UserData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast<ProblemData*>(user_data); - yd_data[0] = udata->lambda_e * y_data[0]; + yd_data[0] = prob_data->lambda_e * y_data[0]; return 0; } @@ -498,11 +554,11 @@ static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) // Implicit ODE RHS function fi(t,y) static 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); - UserData* udata = static_cast<UserData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast<ProblemData*>(user_data); - yd_data[0] = udata->lambda_i * y_data[0]; + yd_data[0] = prob_data->lambda_i * y_data[0]; return 0; } @@ -510,11 +566,11 @@ static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) // Fast ODE RHS function ff(t,y) static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { - sunrealtype* y_data = N_VGetArrayPointer(y); - sunrealtype* yd_data = N_VGetArrayPointer(ydot); - UserData* udata = static_cast<UserData*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yd_data = N_VGetArrayPointer(ydot); + ProblemData* prob_data = static_cast<ProblemData*>(user_data); - yd_data[0] = udata->lambda_f * y_data[0]; + yd_data[0] = prob_data->lambda_f * y_data[0]; return 0; } @@ -523,10 +579,10 @@ static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) static 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); - UserData* udata = static_cast<UserData*>(user_data); + sunrealtype* J_data = SUNDenseMatrix_Data(J); + ProblemData* prob_data = static_cast<ProblemData*>(user_data); - J_data[0] = udata->lambda_i; + J_data[0] = prob_data->lambda_i; return 0; } @@ -536,15 +592,15 @@ static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, // ----------------------------------------------------------------------------- // Check function return value -static int check_flag(void* flagvalue, const string funcname, int opt) +static 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) { - cerr << "\nMEMORY_ERROR: " << funcname - << " failed - returned NULL pointer\n\n"; + std::cerr << "\nMEMORY_ERROR: " << funcname + << " failed - returned NULL pointer\n\n"; return 1; } // Check if flag < 0 @@ -553,8 +609,8 @@ static int check_flag(void* flagvalue, const string funcname, int opt) errflag = (int*)flagvalue; if (*errflag < 0) { - cerr << "\nSUNDIALS_ERROR: " << funcname - << " failed with flag = " << *errflag << "\n\n"; + std::cerr << "\nSUNDIALS_ERROR: " << funcname + << " failed with flag = " << *errflag << "\n\n"; return 1; } } 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_-1.out similarity index 99% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out index e5f2a9b602..9f09d86912 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out @@ -7,6 +7,7 @@ Dahlquist ODE test problem: h fast = 0.01 relative tol = 0.0001 absolute tol = 1e-06 + interp type = None ========================= Test explicit MRI methods diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out new file mode 100644 index 0000000000..4591cb3cd3 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out @@ -0,0 +1,706 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + lambda impl = -1 + lambda fast = -1 + h slow = 0.01 + h fast = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Hermite + +========================= +Test explicit MRI methods +========================= + +Testing method ARKODE_MIS_KW3 + 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 = 1.86014e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK22a + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 1 + W[0] = + 0 0 0 + 0.5 0 0 + -0.5 1 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95647e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK22b + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + -0.5 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95856e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK33a + 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: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.7757e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK45a + 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 = -5.3153e-12 + Steps = 1 + Fe evals = 5 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_FORWARD_EULER + nmat = 1 + stages = 2 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 + W[0] = + 0 0 + 1 0 + + Stored stages = 1 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.9801 + Error = 9.90058e-05 + Steps = 1 + Fe evals = 1 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON2 + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.6666666666666666 1 + W[0] = + 0 0 0 + 0.6666666666666666 0 0 + -0.4166666666666666 0.75 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.9567e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON3 + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.5 0.75 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + -2.75 3 0 0 + 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + 4.5 -4.5 0 0 + -2.166666666666667 -0.5 2.666666666666667 0 + + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.72143e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +========================= +Test implicit MRI methods +========================= + +Testing method ARKODE_MRI_GARK_BACKWARD_EULER + nmat = 1 + stages = 3 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 1 + G[0] = + 0 0 0 + 1 0 0 + -1 0 1 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980297 + Error = -9.80272e-05 + 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 ARKODE_MRI_GARK_ESDIRK34a + 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 ARKODE_MRI_GARK_ESDIRK46a + nmat = 2 + stages = 11 + method order (q) = 4 + embedding order (p) = 0 + c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 + G[0] = + 0 0 0 0 0 0 0 0 0 0 0 + 0.2 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 + 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 + 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 + 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 + 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 + -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 + 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 + -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 + 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 + + G[1] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 + -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 + -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 + -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 + 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 + -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 + 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 + 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 + + Stored stages = 6 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.36036e-12 + Steps = 1 + Fe evals = 0 + Fi evals = 10 + NLS iters = 5 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.2304e-07 + Steps = 1 + Fe evals = 0 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_IRK21a + 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 + +===================== +Test IMEX MRI methods +===================== + +Testing method ARKODE_IMEX_MRI_GARK3a + 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 = 4 + Fi evals = 7 + NLS iters = 3 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK3b + 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 = 4 + Fi evals = 7 + NLS iters = 3 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK4 + nmat = 2 + stages = 12 + method order (q) = 4 + embedding order (p) = 0 + c = 0 0.5 0.5 0.625 0.625 0.75 0.75 0.875 0.875 1 1 1 + W[0] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.917165343636629 0 2.042165343636629 0 0 0 0 0 0 0 0 0 + -0.4047510318011059 0 0.4047510318011059 0 0 0 0 0 0 0 0 0 + 11.45146602249222 0 -30.21075747526504 0 18.88429145277282 0 0 0 0 0 0 0 + -0.7090335647602615 0 1.030307208587519 0 -0.3212736438272573 0 0 0 0 0 0 0 + -29.99548716455828 0 37.6059827749918 0 0.3212736438272573 0 -7.806769254260774 0 0 0 0 0 + 3.104665054272962 0 -2.430325019757162 0 -1.905479301151525 0 1.231139266635725 0 0 0 0 0 + -2.424429547752048 0 2.430325019757162 0 1.905479301151525 0 -1.231139266635725 0 -0.5552355065209142 0 0 0 + -0.01044135044479749 0 0.07260303614655074 0 -0.1288275951677261 0 0.1129355350093824 0 -0.04626962554340952 0 0 0 + -0.8108522787762101 0 0.2560073199220492 0 0.8068294072697528 0 -0.4557148228721824 0 -0.04626962554340952 0 0.25 0 + + W[1] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 4.084330687273257 0 -4.084330687273257 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -21.84342998138222 0 59.61201288692787 0 -37.76858290554565 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 61.65904145863709 0 -77.27257996715863 0 0 0 15.61353850852155 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.110471013041828 0 0 0 0 0 0 0 1.110471013041828 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + G[0] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 0 + -3.977281248108488 0 4.102281248108488 0 0 0 0 0 0 0 0 0 + -0.06905388741401691 0 -0.1809461125859831 0 0.25 0 0 0 0 0 0 0 + -1.76176766375792 0 2.694524698377299 0 -0.8077570346193781 0 0 0 0 0 0 0 + 0.555872179155397 0 -0.6799140501579995 0 -0.1259581289973974 0 0.25 0 0 0 0 0 + -5.840176028724956 0 8.174456684291915 0 0.1259581289973974 0 -2.335238784564357 0 0 0 0 0 + -1.906792645167812 0 -1.547057811385124 0 4.12988801314935 0 -0.9260375565964145 0 0.25 0 0 0 + 3.337028151688726 0 1.547057811385124 0 -4.12988801314935 0 0.9260375565964145 0 -1.555235506520914 0 0 0 + -0.8212936292210076 0 0.3286103560686 0 0.6780018121020267 0 -0.3427792878628 0 -0.09253925108681904 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + G[1] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 8.704562496216976 0 -8.704562496216976 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 3.911643102343875 0 -5.027157171582631 0 1.115514069238756 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 10.81860769913912 0 -14.98908526826783 0 0 0 4.170477569128713 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -2.610471013041828 0 0 0 0 0 0 0 2.610471013041828 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + Stored stages = 6 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -2.09769e-11 + Steps = 1 + Fe evals = 6 + Fi evals = 11 + NLS iters = 5 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK_EULER + nmat = 1 + stages = 3 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + 0 0 0 + + G[0] = + 0 0 0 + 1 0 0 + -1 0 1 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 4.82806e-07 + Steps = 1 + Fe evals = 1 + 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 ARKODE_IMEX_MRI_GARK_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + 0 0 0 0 + -0.5 0 1 0 + + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -8.01486e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 0 0 0 0 + -0.5 0 0.5 0 + + G[0] = + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970447 + Error = -9.8759e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + 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/CXX_serial/ark_test_dahlquist_mri_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out new file mode 100644 index 0000000000..5311a51fcd --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out @@ -0,0 +1,706 @@ + +Dahlquist ODE test problem: + lambda expl = -1 + lambda impl = -1 + lambda fast = -1 + h slow = 0.01 + h fast = 0.01 + relative tol = 0.0001 + absolute tol = 1e-06 + interp type = Lagrange + +========================= +Test explicit MRI methods +========================= + +Testing method ARKODE_MIS_KW3 + 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 = 1.86014e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK22a + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 1 + W[0] = + 0 0 0 + 0.5 0 0 + -0.5 1 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95647e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK22b + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + -0.5 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.95856e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK33a + 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: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.7757e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_ERK45a + 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 = -5.3153e-12 + Steps = 1 + Fe evals = 5 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_FORWARD_EULER + nmat = 1 + stages = 2 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 + W[0] = + 0 0 + 1 0 + + Stored stages = 1 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.9801 + Error = 9.90058e-05 + Steps = 1 + Fe evals = 1 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON2 + nmat = 1 + stages = 3 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.6666666666666666 1 + W[0] = + 0 0 0 + 0.6666666666666666 0 0 + -0.4166666666666666 0.75 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.9567e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_RALSTON3 + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 0 + c = 0 0.5 0.75 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + -2.75 3 0 0 + 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + 4.5 -4.5 0 0 + -2.166666666666667 -0.5 2.666666666666667 0 + + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.72143e-09 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +========================= +Test implicit MRI methods +========================= + +Testing method ARKODE_MRI_GARK_BACKWARD_EULER + nmat = 1 + stages = 3 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 1 + G[0] = + 0 0 0 + 1 0 0 + -1 0 1 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980297 + Error = -9.80272e-05 + 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 ARKODE_MRI_GARK_ESDIRK34a + 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 ARKODE_MRI_GARK_ESDIRK46a + nmat = 2 + stages = 11 + method order (q) = 4 + embedding order (p) = 0 + c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 + G[0] = + 0 0 0 0 0 0 0 0 0 0 0 + 0.2 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 + 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 + 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 + 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 + 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 + -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 + 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 + -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 + 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 + + G[1] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 + -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 + -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 + -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 + 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 + -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 + 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 + 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 + + Stored stages = 6 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.36036e-12 + Steps = 1 + Fe evals = 0 + Fi evals = 10 + NLS iters = 5 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 1.2304e-07 + Steps = 1 + Fe evals = 0 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MRI_GARK_IRK21a + 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 + +===================== +Test IMEX MRI methods +===================== + +Testing method ARKODE_IMEX_MRI_GARK3a + 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 = 4 + Fi evals = 7 + NLS iters = 3 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK3b + 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 = 4 + Fi evals = 7 + NLS iters = 3 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK4 + nmat = 2 + stages = 12 + method order (q) = 4 + embedding order (p) = 0 + c = 0 0.5 0.5 0.625 0.625 0.75 0.75 0.875 0.875 1 1 1 + W[0] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.917165343636629 0 2.042165343636629 0 0 0 0 0 0 0 0 0 + -0.4047510318011059 0 0.4047510318011059 0 0 0 0 0 0 0 0 0 + 11.45146602249222 0 -30.21075747526504 0 18.88429145277282 0 0 0 0 0 0 0 + -0.7090335647602615 0 1.030307208587519 0 -0.3212736438272573 0 0 0 0 0 0 0 + -29.99548716455828 0 37.6059827749918 0 0.3212736438272573 0 -7.806769254260774 0 0 0 0 0 + 3.104665054272962 0 -2.430325019757162 0 -1.905479301151525 0 1.231139266635725 0 0 0 0 0 + -2.424429547752048 0 2.430325019757162 0 1.905479301151525 0 -1.231139266635725 0 -0.5552355065209142 0 0 0 + -0.01044135044479749 0 0.07260303614655074 0 -0.1288275951677261 0 0.1129355350093824 0 -0.04626962554340952 0 0 0 + -0.8108522787762101 0 0.2560073199220492 0 0.8068294072697528 0 -0.4557148228721824 0 -0.04626962554340952 0 0.25 0 + + W[1] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 4.084330687273257 0 -4.084330687273257 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -21.84342998138222 0 59.61201288692787 0 -37.76858290554565 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 61.65904145863709 0 -77.27257996715863 0 0 0 15.61353850852155 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.110471013041828 0 0 0 0 0 0 0 1.110471013041828 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + G[0] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 0 + -3.977281248108488 0 4.102281248108488 0 0 0 0 0 0 0 0 0 + -0.06905388741401691 0 -0.1809461125859831 0 0.25 0 0 0 0 0 0 0 + -1.76176766375792 0 2.694524698377299 0 -0.8077570346193781 0 0 0 0 0 0 0 + 0.555872179155397 0 -0.6799140501579995 0 -0.1259581289973974 0 0.25 0 0 0 0 0 + -5.840176028724956 0 8.174456684291915 0 0.1259581289973974 0 -2.335238784564357 0 0 0 0 0 + -1.906792645167812 0 -1.547057811385124 0 4.12988801314935 0 -0.9260375565964145 0 0.25 0 0 0 + 3.337028151688726 0 1.547057811385124 0 -4.12988801314935 0 0.9260375565964145 0 -1.555235506520914 0 0 0 + -0.8212936292210076 0 0.3286103560686 0 0.6780018121020267 0 -0.3427792878628 0 -0.09253925108681904 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + G[1] = + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 8.704562496216976 0 -8.704562496216976 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 3.911643102343875 0 -5.027157171582631 0 1.115514069238756 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 10.81860769913912 0 -14.98908526826783 0 0 0 4.170477569128713 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -2.610471013041828 0 0 0 0 0 0 0 2.610471013041828 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + + Stored stages = 6 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -2.09769e-11 + Steps = 1 + Fe evals = 6 + Fi evals = 11 + NLS iters = 5 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK_EULER + nmat = 1 + stages = 3 + method order (q) = 1 + embedding order (p) = 0 + c = 0 1 1 + W[0] = + 0 0 0 + 1 0 0 + 0 0 0 + + G[0] = + 0 0 0 + 1 0 0 + -1 0 1 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 4.82806e-07 + Steps = 1 + Fe evals = 1 + 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 ARKODE_IMEX_MRI_GARK_MIDPOINT + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 0.5 0.5 1 + W[0] = + 0 0 0 0 + 0.5 0 0 0 + 0 0 0 0 + -0.5 0 1 0 + + G[0] = + 0 0 0 0 + 0.5 0 0 0 + -0.5 0 0.5 0 + 0 0 0.5 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -8.01486e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 0 + c = 0 1 1 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 0 0 0 0 + -0.5 0 0.5 0 + + G[0] = + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + + Stored stages = 2 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970447 + Error = -9.8759e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 3 + NLS iters = 1 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + + +All tests passed! From 18d50663e8ab6b7863ac2d7d62e0019a94007e89 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 23 May 2024 19:57:38 -0700 Subject: [PATCH 057/137] Docs: ID to Name (#494) Address a couple missing things noted in #488 after it was merged. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 +++ doc/arkode/guide/source/ARKodeButcherTable.rst | 4 ++++ doc/shared/RecentChanges.rst | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1f819250..4140cc95bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ Added the following MRI coupling tables * `ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL` * `ARKODE_IMEX_MRI_GARK_MIDPOINT` +Added `ARKodeButcherTable_ERKIDToName` and `ARKodeButcherTable_DIRKIDToName` to +convert a Butcher table ID to a string representation. + Users may now disable interpolated output in ARKODE by passing `ARK_INTERP_NONE` to `ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is not supported, implicit methods must use the trivial predictor (the default diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 969e1bc23a..8b66ef192f 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -156,6 +156,8 @@ ARKodeButcherTable functions **Return value:** * The name associated with *emethod*. * ``NULL`` pointer if *emethod* was invalid. + + .. versionadded:: x.y.z .. c:function:: ARKodeButcherTable ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod) @@ -205,6 +207,8 @@ ARKodeButcherTable functions **Return value:** * The name associated with *imethod*. * ``NULL`` pointer if *imethod* was invalid. + + .. versionadded:: x.y.z .. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 690e4b36e2..b83bd7c08c 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -32,6 +32,10 @@ Added the following MRI coupling tables * ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` * ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` +Added :c:func:`ARKodeButcherTable_ERKIDToName` and +:c:func:`ARKodeButcherTable_DIRKIDToName` to convert a Butcher table ID to a +string representation. + Users may now disable interpolated output in ARKODE by passing ``ARK_INTERP_NONE`` to :c:func:`ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is not supported, implicit methods must use the trivial From e3566a79a070a97293ad83e62c8fb4e924694101 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Fri, 24 May 2024 05:31:16 -0700 Subject: [PATCH 058/137] Maintenance: Rename ginkgo dpcpp to sycl (#493) Ginkgo now refers to DPC++ as SYCL (inline with what Intel is doing), so this just updates our interface to match the naming convention. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 +++ cmake/SundialsTPLOptions.cmake | 2 +- cmake/macros/SundialsAddExamplesGinkgo.cmake | 2 +- cmake/tpl/SundialsGinkgo.cmake | 4 ++-- doc/shared/RecentChanges.rst | 5 ++++- doc/shared/sundials/Install.rst | 14 +++++++++----- examples/cvode/ginkgo/CMakeLists.txt | 4 ++-- ..._ginkgo.DPCPP.out => cv_heat2D_ginkgo.SYCL.out} | 0 examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp | 10 +++++----- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 6 +++--- examples/sunlinsol/ginkgo/CMakeLists.txt | 4 ++-- .../sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp | 10 +++++----- examples/sunmatrix/ginkgo/CMakeLists.txt | 4 ++-- .../sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp | 4 ++-- include/sundials/sundials_config.in | 2 +- 15 files changed, 42 insertions(+), 32 deletions(-) rename examples/cvode/ginkgo/{cv_heat2D_ginkgo.DPCPP.out => cv_heat2D_ginkgo.SYCL.out} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4140cc95bb..b6908a7af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,9 @@ Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous default, `hcc`, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). +Renamed the DPCPP value for the `SUNDIALS_GINKGO_BACKENDS` CMake option to `SYCL` +to match Ginkgo's updated naming convention. + Changed the CMake version compatibility mode for SUNDIALS to `AnyNewerVersion` instead of `SameMajorVersion`. This fixes the issue seen [here](https://github.com/AMReX-Codes/amrex/pull/3835). diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 42a058c9aa..36e0dc5a1b 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -86,7 +86,7 @@ sundials_option(ENABLE_GINKGO BOOL "Enable Ginkgo support" OFF) sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" "${Ginkgo_DIR}" DEPENDS_ON ENABLE_GINKGO) -sundials_option(SUNDIALS_GINKGO_BACKENDS STRING "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, DPCPP)" "REF;OMP" +sundials_option(SUNDIALS_GINKGO_BACKENDS STRING "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, SYCL)" "REF;OMP" DEPENDS_ON ENABLE_GINKGO) sundials_option(GINKGO_WORKS BOOL "Set to ON to force CMake to accept a given Ginkgo configuration" OFF diff --git a/cmake/macros/SundialsAddExamplesGinkgo.cmake b/cmake/macros/SundialsAddExamplesGinkgo.cmake index 3e27c2858c..1e23dfdb58 100644 --- a/cmake/macros/SundialsAddExamplesGinkgo.cmake +++ b/cmake/macros/SundialsAddExamplesGinkgo.cmake @@ -63,7 +63,7 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) elseif(backend MATCHES "HIP") set_source_files_properties(${example} PROPERTIES LANGUAGE CXX) set(vector nvechip) - elseif(backend MATCHES "DPCPP") + elseif(backend MATCHES "SYCL") set(vector nvecsycl) elseif(backend MATCHES "OMP") set(vector nvecopenmp) diff --git a/cmake/tpl/SundialsGinkgo.cmake b/cmake/tpl/SundialsGinkgo.cmake index cdb99f5411..595c96aa5a 100644 --- a/cmake/tpl/SundialsGinkgo.cmake +++ b/cmake/tpl/SundialsGinkgo.cmake @@ -66,8 +66,8 @@ if(Ginkgo_FOUND AND (NOT GINKGO_WORKS)) print_error("SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP" AND NOT ENABLE_SYCL) - print_error("SUNDIALS_GINKGO_BACKENDS includes DPC++ but SYCL/DPC++ is not enabled. Set ENABLE_SYCL=ON or change the backend.") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) + print_error("SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend.") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP" AND NOT ENABLE_OPENMP) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index b83bd7c08c..d11c3b24d4 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -57,6 +57,9 @@ Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new default is also valid in older version of ROCm (at least back to version 4.3.1). +Renamed the DPCPP value for the :cmakeop:`SUNDIALS_GINKGO_BACKENDS` CMake option +to ``SYCL`` to match Ginkgo's updated naming convention. + Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` instead of ``SameMajorVersion``. This fixes the issue seen `here <https://github.com/AMReX-Codes/amrex/pull/3835>`_. @@ -112,4 +115,4 @@ ARKODE-wide functions. Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an ARKODE-wide equivalent, instructions have been added to the user guide for how -to retain the current functionality using other user-callable functions. +to retain the current functionality using other user-callable functions. \ No newline at end of file diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 8c2ed50c2e..f1ed3c80a8 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -665,10 +665,14 @@ illustration only. .. cmakeoption:: SUNDIALS_GINKGO_BACKENDS Semi-colon separated list of Ginkgo target architecutres/executors to build for. - Options currenty supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and DPC++. + Options currenty supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and SYCL. Default: "REF;OMP" + .. versionchanged: x.y.z + + The ``DPCPP`` option was changed to ``SYCL`` to align with Ginkgo's naming convention. + .. cmakeoption:: ENABLE_KOKKOS Enable the Kokkos based vector. @@ -1480,13 +1484,13 @@ SUNDIALS has been tested with MAGMA version v2.6.1 and v2.6.2. .. _Installation.CMake.ExternalLibraries.OneMKL: -Building with oneMKL -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Building with oneMKL for SYCL +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Intel `oneAPI Math Kernel Library (oneMKL) <https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html>`_ -includes CPU and DPC++ interfaces for LAPACK dense linear algebra routines. The -SUNDIALS oneMKL interface targets the DPC++ routines, to utilize the CPU routine +includes CPU and SYCL/DPC++ interfaces for LAPACK dense linear algebra routines. The +SUNDIALS oneMKL interface targets the SYCL/DPC++ routines, to utilize the CPU routine see :numref:`Installation.CMake.ExternalLibraries.LAPACK`. To enable the SUNDIALS oneMKL interface set ``ENABLE_ONEMKL`` to ``ON`` and diff --git a/examples/cvode/ginkgo/CMakeLists.txt b/examples/cvode/ginkgo/CMakeLists.txt index a66f49fdf9..5d1e706371 100644 --- a/examples/cvode/ginkgo/CMakeLists.txt +++ b/examples/cvode/ginkgo/CMakeLists.txt @@ -20,7 +20,7 @@ set(cpu_gpu_examples sundials_add_examples_ginkgo(cpu_gpu_examples TARGETS sundials_cvode - BACKENDS REF OMP CUDA HIP DPCPP) + BACKENDS REF OMP CUDA HIP SYCL) # Examples that only support CPU Ginkgo backends set(cpu_examples @@ -39,7 +39,7 @@ if(EXAMPLES_INSTALL) if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP") list(APPEND vectors nvechip) endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL") list(APPEND vectors nvecsycl) endif() if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.DPCPP.out b/examples/cvode/ginkgo/cv_heat2D_ginkgo.SYCL.out similarity index 100% rename from examples/cvode/ginkgo/cv_heat2D_ginkgo.DPCPP.out rename to examples/cvode/ginkgo/cv_heat2D_ginkgo.SYCL.out diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp index 3cda52748b..eaa7627e09 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp @@ -61,7 +61,7 @@ constexpr auto N_VNew = N_VNew_Cuda; #include <nvector/nvector_hip.h> #define HIP_OR_CUDA_OR_SYCL(a, b, c) a constexpr auto N_VNew = N_VNew_Hip; -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) #include <nvector/nvector_sycl.h> #define HIP_OR_CUDA_OR_SYCL(a, b, c) c constexpr auto N_VNew = N_VNew_Sycl; @@ -122,7 +122,7 @@ int main(int argc, char* argv[]) #elif defined(USE_HIP) auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; #elif defined(USE_OMP) auto gko_exec{gko::OmpExecutor::create()}; @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) // --------------- // Create solution vector -#if defined(USE_DPCPP) +#if defined(USE_SYCL) N_Vector u = N_VNew(udata.nodes, gko_exec->get_queue(), sunctx); #else N_Vector u = N_VNew(udata.nodes, sunctx); @@ -372,7 +372,7 @@ int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data) HIP_OR_CUDA_OR_SYCL(hipDeviceSynchronize(), cudaDeviceSynchronize(), ); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) // Access device data arrays sunrealtype* uarray = N_VGetDeviceArrayPointer(u); if (check_ptr(uarray, "N_VGetDeviceArrayPointer")) return -1; @@ -612,7 +612,7 @@ int J(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, col_idxs, mat_data); HIP_OR_CUDA_OR_SYCL(hipDeviceSynchronize(), cudaDeviceSynchronize(), ); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) auto queue = std::dynamic_pointer_cast<const gko::DpcppExecutor>(udata->exec)->get_queue(); // J_sn_kernel diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp index a2d170a3cd..75bc3ba8c9 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp @@ -32,7 +32,7 @@ #include <nvector/nvector_cuda.h> #elif defined(USE_HIP) #include <nvector/nvector_hip.h> -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) #include <nvector/nvector_sycl.h> #endif @@ -152,7 +152,7 @@ static int Solution(sunrealtype t, N_Vector u, UserData& udata) solution_kernel<<<num_blocks, threads_per_block>>>(nx, ny, dx, dy, cos_sqr_t, uarray); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) sunrealtype* uarray = N_VGetDeviceArrayPointer(u); if (check_ptr(uarray, "N_VGetDeviceArrayPointer")) return -1; std::dynamic_pointer_cast<const gko::DpcppExecutor>(udata.exec) @@ -366,7 +366,7 @@ static int WriteOutput(sunrealtype t, N_Vector u, N_Vector e, UserData& udata) #elif defined(USE_HIP) N_VCopyFromDevice_Hip(u); N_VCopyFromDevice_Hip(e); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) N_VCopyFromDevice_Sycl(u); N_VCopyFromDevice_Sycl(e); #endif diff --git a/examples/sunlinsol/ginkgo/CMakeLists.txt b/examples/sunlinsol/ginkgo/CMakeLists.txt index 2633fd7751..6d3cae204f 100644 --- a/examples/sunlinsol/ginkgo/CMakeLists.txt +++ b/examples/sunlinsol/ginkgo/CMakeLists.txt @@ -32,7 +32,7 @@ include_directories(..) sundials_add_examples_ginkgo(examples TARGETS test_sunlinsol_obj - BACKENDS REF OMP CUDA HIP DPCPP + BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) # Install the targets @@ -44,7 +44,7 @@ if(EXAMPLES_INSTALL) if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP") list(APPEND vectors nvechip) endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL") list(APPEND vectors nvecsycl) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") diff --git a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp index cddc307c5e..9a979b2c9a 100644 --- a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp +++ b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp @@ -37,7 +37,7 @@ constexpr auto N_VNew = N_VNew_Hip; #include <nvector/nvector_cuda.h> #define HIP_OR_CUDA_OR_SYCL(a, b, c) b constexpr auto N_VNew = N_VNew_Cuda; -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) #include <nvector/nvector_sycl.h> #define HIP_OR_CUDA_OR_SYCL(a, b, c) c constexpr auto N_VNew = N_VNew_Sycl; @@ -163,7 +163,7 @@ static void fill_matrix( fill_kernel<<<num_blocks, threads_per_block>>>(mat_rows, mat_cols, row_ptrs, col_idxs, mat_data); HIP_OR_CUDA_OR_SYCL(hipDeviceSynchronize(), cudaDeviceSynchronize(), ); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) std::dynamic_pointer_cast<const gko::DpcppExecutor>(matrix->get_executor()) ->get_queue() ->submit( @@ -250,7 +250,7 @@ static void fill_matrix(std::shared_ptr<gko::matrix::Dense<sunrealtype>> matrix) fill_kernel<<<num_blocks, threads_per_block>>>(mat_rows, mat_cols, mat_data); HIP_OR_CUDA_OR_SYCL(hipDeviceSynchronize(), cudaDeviceSynchronize(), ); -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) std::dynamic_pointer_cast<const gko::DpcppExecutor>(matrix->get_executor()) ->get_queue() ->submit( @@ -355,7 +355,7 @@ int main(int argc, char* argv[]) #elif defined(USE_CUDA) auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; #elif defined(USE_OMP) auto gko_exec{gko::OmpExecutor::create()}; @@ -443,7 +443,7 @@ int main(int argc, char* argv[]) * Create solution and RHS vectors * * ------------------------------- */ -#if defined(USE_DPCPP) +#if defined(USE_SYCL) N_Vector x{N_VNew(matcols, gko_exec->get_queue(), sunctx)}; #else N_Vector x{N_VNew(matcols, sunctx)}; diff --git a/examples/sunmatrix/ginkgo/CMakeLists.txt b/examples/sunmatrix/ginkgo/CMakeLists.txt index cf19355e45..0e17ab0821 100644 --- a/examples/sunmatrix/ginkgo/CMakeLists.txt +++ b/examples/sunmatrix/ginkgo/CMakeLists.txt @@ -28,7 +28,7 @@ include_directories(..) sundials_add_examples_ginkgo(examples TARGETS test_sunmatrix_obj sundials_sunmatrixdense - BACKENDS REF OMP CUDA HIP DPCPP + BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) # Install the targets @@ -40,7 +40,7 @@ if(EXAMPLES_INSTALL) if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP") list(APPEND vectors nvechip) endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "DPCPP") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL") list(APPEND vectors nvecsycl) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index 4c7bb27f3c..b29ac171aa 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -28,7 +28,7 @@ #define REF_OR_OMP_OR_HIP_OR_CUDA_OR_SYCL(a, b, c, d, e) c #elif defined(USE_CUDA) #define REF_OR_OMP_OR_HIP_OR_CUDA_OR_SYCL(a, b, c, d, e) d -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) #define REF_OR_OMP_OR_HIP_OR_CUDA_OR_SYCL(a, b, c, d, e) e #elif defined(USE_OMP) #define REF_OR_OMP_OR_HIP_OR_CUDA_OR_SYCL(a, b, c, d, e) b @@ -42,7 +42,7 @@ #include <nvector/nvector_hip.h> #elif defined(USE_OMP) #include <nvector/nvector_openmp.h> -#elif defined(USE_DPCPP) +#elif defined(USE_SYCL) #include <nvector/nvector_sycl.h> #else #include <nvector/nvector_serial.h> diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index b56ae8fa86..99923d1e81 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -220,7 +220,7 @@ #cmakedefine SUNDIALS_GINKGO_BACKENDS_HIP #cmakedefine SUNDIALS_GINKGO_BACKENDS_OMP #cmakedefine SUNDIALS_GINKGO_BACKENDS_REF -#cmakedefine SUNDIALS_GINKGO_BACKENDS_DPCPP +#cmakedefine SUNDIALS_GINKGO_BACKENDS_SYCL /* MAGMA backends */ #cmakedefine SUNDIALS_MAGMA_BACKENDS_CUDA From 831f9c316604185a9fa5bca790f1cb40479f539a Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 29 May 2024 08:52:16 -0700 Subject: [PATCH 059/137] Bugfix: broken doc references (#497) Fix broken references in docs with "nitpicky" mode --- .readthedocs.yaml | 1 + doc/arkode/examples/source/conf.py | 4 +- .../guide/source/ARKodeButcherTable.rst | 75 ++-- doc/arkode/guide/source/Butcher.rst | 16 +- doc/arkode/guide/source/Constants.rst | 10 + .../guide/source/Usage/ARKStep/Relaxation.rst | 6 +- .../guide/source/Usage/ARKStep/XBraid.rst | 14 +- .../guide/source/Usage/ERKStep/Relaxation.rst | 6 +- .../Custom_Inner_Stepper/Description.rst | 17 +- .../source/Usage/MRIStep/MRIStepCoupling.rst | 84 +++-- .../source/Usage/SPRKStep/User_callable.rst | 2 +- .../guide/source/Usage/User_callable.rst | 25 +- doc/arkode/guide/source/conf.py | 4 +- doc/cvode/guide/source/Usage/index.rst | 98 +++-- doc/cvode/guide/source/conf.py | 4 +- doc/cvodes/guide/source/Usage/ADJ.rst | 222 ++++++----- doc/cvodes/guide/source/Usage/FSA.rst | 4 +- doc/cvodes/guide/source/Usage/SIM.rst | 94 +++-- doc/cvodes/guide/source/conf.py | 4 +- doc/ida/guide/source/Usage/index.rst | 151 +++----- doc/ida/guide/source/conf.py | 4 +- doc/idas/guide/source/Usage/ADJ.rst | 186 +++++----- doc/idas/guide/source/Usage/SIM.rst | 148 +++----- doc/idas/guide/source/conf.py | 4 +- doc/install_guide/source/conf.py | 4 +- doc/kinsol/guide/Makefile | 2 +- doc/kinsol/guide/source/Usage/index.rst | 101 +++-- doc/kinsol/guide/source/conf.py | 9 +- doc/shared/nvectors/NVector_CUDA.rst | 39 +- doc/shared/nvectors/NVector_Description.rst | 349 +++++++++++++----- doc/shared/nvectors/NVector_HIP.rst | 36 +- doc/shared/nvectors/NVector_Kokkos.rst | 7 + doc/shared/nvectors/NVector_MPIManyVector.rst | 11 +- doc/shared/nvectors/NVector_MPIPlusX.rst | 6 +- doc/shared/nvectors/NVector_ManyVector.rst | 12 +- doc/shared/nvectors/NVector_OpenMP.rst | 2 +- doc/shared/nvectors/NVector_OpenMPDEV.rst | 8 +- doc/shared/nvectors/NVector_Operations.rst | 31 ++ doc/shared/nvectors/NVector_PETSc.rst | 2 +- doc/shared/nvectors/NVector_ParHyp.rst | 6 +- doc/shared/nvectors/NVector_Parallel.rst | 2 +- doc/shared/nvectors/NVector_Pthreads.rst | 2 +- doc/shared/nvectors/NVector_SYCL.rst | 18 +- doc/shared/nvectors/NVector_Serial.rst | 4 +- .../SUNAdaptController_Description.rst | 82 ++-- doc/shared/sundials/Fortran.rst | 29 +- doc/shared/sundials/GPU.rst | 28 +- doc/shared/sundials/Logging.rst | 4 +- doc/shared/sundials/Profiling.rst | 5 +- doc/shared/sundials/SUNContext.rst | 6 +- doc/shared/sundials/Types.rst | 20 +- doc/shared/sundials_vars.py | 128 +++++++ doc/shared/sunlinsol/SUNLinSol_API.rst | 208 +++++++---- doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst | 6 +- doc/shared/sunlinsol/SUNLinSol_KLU.rst | 39 +- doc/shared/sunlinsol/SUNLinSol_PCG.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPGMR.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst | 2 +- .../sunmatrix/SUNMatrix_Description.rst | 95 +++-- .../sunmatrix/SUNMatrix_KokkosDense.rst | 18 +- doc/shared/sunmatrix/SUNMatrix_Sparse.rst | 2 +- .../sunmemory/SUNMemory_Description.rst | 123 +++--- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 129 +++++-- doc/shared/versions.py | 20 - doc/superbuild/source/conf.py | 4 +- .../developers/style_guide/SourceCode.rst | 2 +- doc/superbuild/source/index.rst | 4 +- scripts/updateVersion.sh | 2 +- 70 files changed, 1641 insertions(+), 1157 deletions(-) create mode 100644 doc/shared/sundials_vars.py delete mode 100644 doc/shared/versions.py diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 162f9eb490..5e5cd86b40 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,6 +14,7 @@ build: - graphviz # Build documentation in the doc/ directory with Sphinx +# TODO(DJG): Once multiple references are fixed, add fail_on_warning: true sphinx: configuration: doc/superbuild/source/conf.py diff --git a/doc/arkode/examples/source/conf.py b/doc/arkode/examples/source/conf.py index c86186cc6d..826730c1f7 100644 --- a/doc/arkode/examples/source/conf.py +++ b/doc/arkode/examples/source/conf.py @@ -11,8 +11,8 @@ # ----------------------------------------------------------------------------- import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 8b66ef192f..6475ee766e 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -18,55 +18,66 @@ Butcher Table Data Structure ============================== -To store the Butcher table defining a Runge--Kutta method ARKODE provides the -:c:type:`ARKodeButcherTable` type and several related utility routines. We use -the following Butcher table notation (shown for a 3-stage method): +To store a Butcher table, :math:`B`, defining a Runge--Kutta method ARKODE +provides the :c:type:`ARKodeButcherTable` type and several related utility +routines. We use the following notation .. math:: + B \; \equiv \; \begin{array}{r|c} c & A \\ \hline q & b \\ p & \tilde{b} \end{array} - \quad = \quad - \begin{array}{r|ccc} - c_1 & a_{1,1} & a_{1,2} & a_{1,3} \\ - c_2 & a_{2,1} & a_{2,2} & a_{2,3} \\ - c_3 & a_{3,1} & a_{3,2} & a_{3,3} \\ - \hline - q & b_1 & b_2 & b_3 \\ - p & \tilde{b}_1 & \tilde{b}_2 & \tilde{b}_3 - \end{array} - -where the method and embedding share stage :math:`A` and abscissa :math:`c` -values, but use their stages :math:`z_i` differently through the coefficients -:math:`b` and :math:`\tilde{b}` to generate methods of orders :math:`q` (the -main method) and :math:`p` (the embedding, typically :math:`q = p+1`, though -sometimes this is reversed). :c:type:`ARKodeButcherTable` is defined as + \; = \; + \begin{array}{c|cccc} + c_1 & a_{1,1} & \cdots & a_{1,s-1} & a_{1,s} \\ + c_2 & a_{2,1} & \cdots & a_{2,s-1} & a_{2,s} \\ + \vdots & \vdots & \vdots & \vdots & \vdots \\ + c_s & a_{s,1} & \cdots & a_{s,s-1} & a_{s,s} \\ + \hline + q & b_1 & \cdots & b_{s-1} & b_s \\ + p & \tilde{b}_1 & \cdots & \tilde{b}_{s-1} & \tilde{b}_s + \end{array}. + +An :c:type:`ARKodeButcherTable` is a pointer to the +:c:struct:`ARKodeButcherTableMem` structure: .. c:type:: ARKodeButcherTableMem* ARKodeButcherTable -where ``ARKodeButcherTableMem`` is the structure +.. c:struct:: ARKodeButcherTableMem + + Structure for storing a Butcher table + + .. c:member:: int q + + The method order of accuracy + + .. c:member:: int p + + The embedding order of accuracy, typically :math:`q = p + 1` + + .. c:member:: int stages + + The number of stages in the method, :math:`s` + + .. c:member:: sunrealtype **A + + The method coefficients :math:`A \in \mathbb{R}^s` + + .. c:member:: sunrealtype *c -.. code-block:: c + The method abscissa :math:`c \in \mathbb{R}^s` - typedef struct ARKodeButcherTableMem { + .. c:member:: sunrealtype *b - int q; - int p; - int stages; - sunrealtype **A; - sunrealtype *c; - sunrealtype *b; - sunrealtype *d; + The method coefficients :math:`b \in \mathbb{R}^s` - }; + .. c:member:: sunrealtype *d -where ``stages`` is the number of stages in the RK method, the variables ``q``, -``p``, ``A``, ``c``, and ``b`` have the same meaning as in the Butcher table -above, and ``d`` is used to store :math:`\tilde{b}`. + The method embedding coefficients :math:`\tilde{b} \in \mathbb{R}^s` .. _ARKodeButcherTable.Functions: diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index 3d44dbecdc..678510cd4f 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -438,10 +438,10 @@ Knoth-Wolke-3-3 .. index:: Knoth-Wolke-3-3 ERK method Accessible via the constant ``ARKODE_KNOTH_WOLKE_3_3`` to -:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` or +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`, or :c:func:`ARKodeButcherTable_LoadERK`. Accessible via the string ``"ARKODE_KNOTH_WOLKE_3_3"`` to -:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName`, or :c:func:`ARKodeButcherTable_LoadERKByName`. This is the default 3th order slow and fast MRIStep method (from :cite:p:`KnWo:98`). @@ -511,10 +511,10 @@ Zonneveld-5-3-4 .. index:: Zonneveld-5-3-4 ERK method Accessible via the constant ``ARKODE_ZONNEVELD_5_3_4`` to -:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum` -or :c:func:`ARKodeButcherTable_LoadERK`. +:c:func:`ARKStepSetTableNum`, :c:func:`ERKStepSetTableNum`, or +:c:func:`ARKodeButcherTable_LoadERK`. Accessible via the string ``"ARKODE_ZONNEVELD_5_3_4"`` to -:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or +:c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName`, or :c:func:`ARKodeButcherTable_LoadERKByName`. This is the default 4th order explicit method (from :cite:p:`Zon:63`). @@ -2227,9 +2227,11 @@ Symplectic Partitioned Butcher tables ------------------------------------- In the category of symplectic partitioned Runge-Kutta (SPRK) methods, ARKODE -includes methods that have orders :math:`q = \{1,2,3,4,5,6,8,10\}`. Each of -the ARKODE SPRK tables are specified via a unique ID and name. +includes methods that have orders :math:`q = \{1,2,3,4,5,6,8,10\}`. + +.. c:enum:: ARKODE_SPRKMethodID + Each of the ARKODE SPRK tables are specified via a unique ID and name. ARKODE_SPRK_EULER_1_1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 5915413240..22363ef243 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -578,8 +578,18 @@ contains the ARKODE output constants. | | | :c:type:`SUNLinearSolver` module. | +-------------------------------------+------+------------------------------------------------------------+ +.. c:enum:: ARKRelaxSolver + Nonlinear solver identifiers used to specify the method for solving + :eq:`ARKODE_RELAX_NLS` when relaxation is enabled. + .. c:enumerator:: ARK_RELAX_NEWTON + + Newton's method + + .. c:enumerator:: ARK_RELAX_BRENT + + Brent's method .. Commented-out table rows: diff --git a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst index 3a2d7611db..da267bf1ee 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst @@ -211,12 +211,10 @@ relaxation. Sets the nonlinear solver method used to compute the relaxation parameter. - The default value is ``ARK_RELAX_NEWTON``. + The default value is :c:enumerator:`ARK_RELAX_NEWTON` :param arkode_mem: the ARKStep memory structure - :param solver: the nonlinear solver to use: ``ARK_RELAX_BRENT`` or - ``ARK_RELAX_NEWTON`` - + :param solver: the nonlinear solver to use :retval ARK_SUCCESS: the value was successfully set :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was diff --git a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst index 24633e9fb4..4ea9043bcc 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst @@ -234,15 +234,15 @@ to store a snapshot of solution data at a single point in time and this structure simply contains an N_Vector. Specifically, the structure is defined as follows: -.. code-block:: C +.. c:type:: struct _braid_Vector_struct *SUNBraidVector; - struct _braid_Vector_struct - { - N_Vector y; - }; + Pointer to vector wrapper (same as braid_Vector) + +.. c:struct:: _braid_Vector_struct + + .. c:member:: N_Vector y - /* Poiner to vector wrapper (same as braid_Vector) */ - typedef struct _braid_Vector_struct *SUNBraidVector; + SUNDIALS N_Vector wrapped by the ``braid_Vector`` To assist in creating creating and destroying this structure the following utility functions are provided. diff --git a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst index 72af9b9c82..fec0342371 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst @@ -205,12 +205,10 @@ relaxation. Sets the nonlinear solver method used to compute the relaxation parameter. - The default value is ``ARK_RELAX_NEWTON``. + The default value is :c:enumerator:`ARK_RELAX_NEWTON` :param arkode_mem: the ERKStep memory structure - :param solver: the nonlinear solver to use: ``ARK_RELAX_BRENT`` or - ``ARK_RELAX_NEWTON`` - + :param solver: the nonlinear solver to use :retval ARK_SUCCESS: the value was successfully set :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst index 9e17b38bc2..523bd8a7be 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst @@ -20,17 +20,16 @@ The MRIStepInnerStepper Class As with other SUNDIALS classes, the :c:type:`MRIStepInnerStepper` abstract base class is implemented using a C structure containing a ``content`` pointer to the derived class member data and a structure of function pointers the derived class -implementations of the virtual methods. The :c:type:`MRIStepInnerStepper` -type is defined in ``include/arkode/arkode.h`` as +implementations of the virtual methods. -.. c:type:: struct _MRIStepInnerStepper *MRIStepInnerStepper +.. c:type:: MRIStepInnerStepper -The actual definitions of the ``_MRIStepInnerStepper`` structure and the -corresponding operations structure are kept private to allow for the object -internals to change without impacting user code. The following sections describe -the :numref:`ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods` and the virtual -:numref:`ARKODE.Usage.MRIStep.CustomInnerStepper.Description.ImplMethods` that a must be -provided by a derived class. + An object for solving the fast (inner) ODE in an MRI method. + + The actual definition of the ``MRIStepInnerStepper`` structure is kept + private to allow for the object internals to change without impacting user + code. The following sections describe the base class methods and the virtual + methods that a must be provided by a derived class. .. _ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods: diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst index a948bd6dbb..88fb32a748 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst @@ -18,59 +18,61 @@ MRI Coupling Coefficients Data Structure ---------------------------------------- MRIStep supplies several built-in MIS, MRI-GARK, and IMEX-MRI-GARK methods, see -:numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables` for the current set of coupling -tables and their corresponding identifiers. Additionally, a user may supply a -custom set of slow-to-fast time scale coupling coefficients by constructing a -coupling table and attaching it with :c:func:`MRIStepSetCoupling()`. - -As described in :numref:`ARKODE.Mathematics.MRIStep`, the coupling from the slow time -scale to the fast time scale is encoded by a vector of slow 'stage time' -abscissae, :math:`c^S \in \mathbb{R}^{s+1}` and a set of coupling matrices -:math:`\Gamma^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}` and -:math:`\Omega^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}`. An ``MRIStepCoupling`` -object stores this information and provides several related utility functions -for creating a coupling table. The ``MRIStepCoupling`` type is defined as: +:numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables` for the current set of +coupling tables and their corresponding identifiers. Additionally, a user may +supply a custom set of slow-to-fast time scale coupling coefficients by +constructing a coupling table and attaching it with +:c:func:`MRIStepSetCoupling`. The MRI coupling tables are stored in an +:c:func:`MRIStepCoupling` object which is a pointer to a +:c:struct:`MRIStepCouplingMem` strucutre: .. c:type:: MRIStepCouplingMem *MRIStepCoupling -where ``MRIStepCouplingMem`` is the structure +.. c:struct:: MRIStepCouplingMem -.. code-block:: c + Structure for storing the coupling coefficients defining an MIS, MRI-GARK, or + IMEX-MRI-GARK method. - struct MRIStepCouplingMem - { - int nmat; - int stages; - int q; - int p; - sunrealtype ***G; - sunrealtype ***W; - sunrealtype *c; - }; + As described in :numref:`ARKODE.Mathematics.MRIStep`, the coupling from the + slow time scale to the fast time scale is encoded by a vector of slow + stage time abscissae, :math:`c^S \in \mathbb{R}^{s+1}` and a set of coupling + matrices :math:`\Gamma^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}` and + :math:`\Omega^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}`. -and the members of the strucutre are: + .. c:member:: int nmat - * ``nmat`` corresponds to the number of coupling matrices - :math:`\Omega^{\{k\}}` for the slow-nonstiff terms and/or - :math:`\Gamma^{\{k\}}` for the slow-stiff terms in :eq:`ARKODE_IVP_two_rate`, + The number of coupling matrices :math:`\Omega^{\{k\}}` for the + slow-nonstiff terms and/or :math:`\Gamma^{\{k\}}` for the slow-stiff terms + in :eq:`ARKODE_IVP_two_rate`, - * ``stages`` is the number of abscissae i.e., :math:`s+1` above, + .. c:member:: int stages - * ``q`` and ``p`` indicate the orders of accuracy for both the method and - the embedding, respectively, + The number of abscissae i.e., :math:`s+1` above - * ``W`` is a three-dimensional array with dimensions - ``[nmat][stages][stages]`` containing the method's :math:`\Omega^{\{k\}}` - coupling matrices for the slow-nonstiff (explicit) terms in - :eq:`ARKODE_IVP_two_rate`, + .. c:member:: int q - * ``G`` is a three-dimensional array with dimensions - ``[nmat][stages][stages]`` containing the method's :math:`\Gamma^{\{k\}}` - coupling matrices for the slow-stiff (implicit) terms in - :eq:`ARKODE_IVP_two_rate`, and + The method order of accuracy - * ``c`` is an array of length ``stages`` containing the slow abscissae - :math:`c^S` for the method. + .. c:member:: int p + + The embedding order of accuracy + + .. c:member:: sunrealtype*** W + + A three-dimensional array with dimensions ``[nmat][stages][stages]`` + containing the method's :math:`\Omega^{\{k\}}` coupling matrices for the + slow-nonstiff (explicit) terms in :eq:`ARKODE_IVP_two_rate` + + .. c:member:: sunrealtype*** G + + A three-dimensional array with dimensions ``[nmat][stages][stages]`` + containing the method's :math:`\Gamma^{\{k\}}` coupling matrices for the + slow-stiff (implicit) terms in :eq:`ARKODE_IVP_two_rate` + + .. c:member:: sunrealtype* c + + An array of length ``[stages]`` containing the slow abscissae :math:`c^S` + for the method .. _ARKODE.Usage.MRIStep.MRIStepCoupling.Functions: diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 4d9d8fc3c8..ccf9617daa 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -406,7 +406,7 @@ Optional inputs for IVP method selection +=============================+===========================================+=====================================+ | Set integrator method order | :c:func:`SPRKStepSetOrder()` | 4 | +-----------------------------+-------------------------------------------+-------------------------------------+ - | Set SPRK method | :c:func:`SPRKStepSetMethod()` | :c:type:`ARKODE_SPRK_MCLACHLAN_4_4` | + | Set SPRK method | :c:func:`SPRKStepSetMethod()` | ``ARKODE_SPRK_MCLACHLAN_4_4`` | +-----------------------------+-------------------------------------------+-------------------------------------+ | Set SPRK method by name | :c:func:`SPRKStepSetMethodName()` | "ARKODE_SPRK_MCLACHLAN_4_4" | +-----------------------------+-------------------------------------------+-------------------------------------+ diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 718655dff1..10ad863164 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -52,6 +52,26 @@ Then in the introduction for each of the stepper-specific documentation sections we clarify the categories of these functions that are supported. +.. _ARKODE.Usage.Initialization: + +ARKODE initialization and deallocation functions +------------------------------------------------------ + +For functions to create an ARKODE stepper instance see :c:func:`ARKStepCreate`, +:c:func:`ERKStepCreate`, :c:func:`MRIStepCreate`, or :c:func:`SPRKStepCreate`. + +.. c:function:: void ARKodeFree(void** arkode_mem) + + This function frees the problem memory created a stepper constructor. + + :param arkode_mem: pointer to the ARKODE stepper memory block. + :return: none + + .. versionadded:: x.y.z + + This function replaces stepper specific versions in ARKStep, ERKStep, + MRIStep, and SPRKStep. + .. _ARKODE.Usage.Tolerances: @@ -855,7 +875,6 @@ Set integrator method order :c:func:`ARKodeSetOrder` Set dense output interpolation type (SPRKStep) :c:func:`ARKodeSetInterpolantType` ``ARK_INTERP_LAGRANGE`` Set dense output interpolation type (others) :c:func:`ARKodeSetInterpolantType` ``ARK_INTERP_HERMITE`` Set dense output polynomial degree :c:func:`ARKodeSetInterpolantDegree` 5 -Supply a pointer to a diagnostics output file :c:func:`ARKodeSetDiagnostics` ``NULL`` Disable time step adaptivity (fixed-step mode) :c:func:`ARKodeSetFixedStep` disabled Supply an initial step size to attempt :c:func:`ARKodeSetInitStep` estimated Maximum no. of warnings for :math:`t_n+h = t_n` :c:func:`ARKodeSetMaxHnilWarns` 10 @@ -1502,7 +1521,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value below 1.0 will imply a reset to the default value. - If both this and one of :c:func:`ARKodeSetAdaptivityMethod` or + If both this and one of the stepper ``SetAdaptivityMethod`` functions or :c:func:`ARKodeSetAdaptController` will be called, then this routine must be called *second*. @@ -1903,7 +1922,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS This is only compatible with time-stepping modules that support implicit algebraic solvers. The default is to use the implicit right-hand side function - provided to :c:func:`ARKodeCreate` in nonlinear system functions. If the + provided to the stepper constructor in nonlinear system functions. If the input implicit right-hand side function is ``NULL``, the default is used. When using a non-default nonlinear solver, this function must be called diff --git a/doc/arkode/guide/source/conf.py b/doc/arkode/guide/source/conf.py index db90126fc6..a0817d416f 100644 --- a/doc/arkode/guide/source/conf.py +++ b/doc/arkode/guide/source/conf.py @@ -11,8 +11,8 @@ # ----------------------------------------------------------------------------- import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 2384ad9b31..722e20533e 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -578,7 +578,9 @@ returned by :c:func:`CVodeCreate`. When using sparse linear solvers, it is typically much more efficient to supply ``J`` so that it includes the full sparsity pattern of the Newton system matrices :math:`M=I-\gamma J`, even if ``J`` itself has zeros in nonzero locations of I. The reasoning for this is that M is constructed in-place, on top of the user-specified values of ``J``, so if the sparsity pattern in ``J`` is insufficient to store M then it will need to be resized internally by CVODE. - The previous routines ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver``. .. c:function:: int CVDiag(void* cvode_mem) @@ -1370,7 +1372,9 @@ through :c:func:`CVodeSetUserData`. The function type :c:type:`CVLsJacFn` is described in :numref:`CVODE.Usage.CC.user_fct_sim.jacFn`. - The previous routine ``CVDlsSetJacFn`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsSetJacFn``. To specify a user-supplied linear system function ``linsys``, CVLS provides @@ -1475,7 +1479,9 @@ without using global data in the program. This function must be called after the CVLS linear solver interface has been initialized through a call to :c:func:`CVodeSetLinearSolver`. - The previous routine ``CVSpilsSetJacTimes`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetJacTimes``. When using the internal difference quotient the user may optionally supply an @@ -1558,7 +1564,9 @@ the :c:func:`CVodeSetEpsLin` function. The function type :c:type:`CVLsPrecSetupFn` is described in :numref:`CVODE.Usage.CC.user_fct_sim.precondFn` - The previous routine ``CVSpilsSetPreconditioner`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetPreconditioner``. .. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) @@ -1582,7 +1590,9 @@ the :c:func:`CVodeSetEpsLin` function. If ``eplifac`` = 0.0 is passed, the default value is used. - The previous routine ``CVSpilsSetEpsLin`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetEpsLin``. .. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) @@ -2907,7 +2917,10 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Notes:** The workspace requirements reported by this routine correspond only to memory allocated within this interface and to memory allocated by the ``SUNLinearSolver`` object attached to it. The template Jacobian matrix allocated by the user outside of CVLS is not included in this report. - The previous routines ``CVDlsGetWorkspace`` and ``CVSpilsGetWorkspace`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetWorkspace`` and + ``CVSpilsGetWorkspace``. .. c:function:: int CVodeGetNumJacEvals(void* cvode_mem, long int *njevals) @@ -2923,8 +2936,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVDlsGetNumJacEvals`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsGetNumJacEvals``. .. c:function:: int CVodeGetNumLinRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -2943,7 +2957,10 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Notes:** The value ``nfevalsLS`` is incremented only if one of the default internal difference quotient functions is used. - The previous routines ``CVDlsGetNumRhsEvals`` and ``CVSpilsGetNumRhsEvals`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetNumRhsEvals`` and + ``CVSpilsGetNumRhsEvals``. .. c:function:: int CVodeGetNumLinIters(void* cvode_mem, long int *nliters) @@ -2959,8 +2976,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumLinIters`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumLinIters``. .. c:function:: int CVodeGetNumLinConvFails(void* cvode_mem, long int *nlcfails) @@ -2976,8 +2994,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumConvFails`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumConvFails``. .. c:function:: int CVodeGetNumPrecEvals(void* cvode_mem, long int *npevals) @@ -2993,8 +3012,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumPrecEvals`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumPrecEvals``. .. c:function:: int CVodeGetNumPrecSolves(void* cvode_mem, long int *npsolves) @@ -3080,7 +3100,10 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). If the CVLS solve function failed (i.e., :c:func:`CVode` returned ``CV_LSOLVE_FAIL``), then ``lsflag`` contains the error return flag from the ``SUNLinearSolver`` object, which will be one of: ``SUN_ERR_ARG_CORRUPTRRUPT``, indicating that the ``SUNLinearSolver`` memory is ``NULL``; ``SUNLS_ATIMES_FAIL_UNREC``, indicating an unrecoverable failure in the Jv function; ``SUNLS_PSOLVE_FAIL_UNREC``, indicating that the preconditioner solve function ``psolve`` failed unrecoverably; ``SUNLS_GS_FAIL``, indicating a failure in the Gram-Schmidt procedure (SPGMR and SPFGMR only); ``SUNLS_QRSOL_FAIL``, indicating that the matrix R was found to be singular during the QR solve phase (SPGMR and SPFGMR only); or ``SUN_ERR_EXT_FAIL``, indicating an unrecoverable failure in an external iterative linear solver package. - The previous routines ``CVDlsGetLastFlag`` and ``CVSpilsGetLastFlag`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetLastFlag`` and + ``CVSpilsGetLastFlag``. .. c:function:: int CVodeGetLinReturnFlagName(long int lsflag) @@ -3093,8 +3116,10 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Return value:** * The return value is a string containing the name of the corresponding constant. If :math:`1 \leq \text{lsflag} \leq N` (LU factorization failed), this routine returns "NONE". - **Notes:** - The previous routines ``CVDlsGetReturnFlagName`` and ``CVSpilsGetReturnFlagName`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetReturnFlagName`` and + ``CVSpilsGetReturnFlagName``. .. _CVODE.Usage.CC.optional_output.optout_diag: @@ -3551,10 +3576,9 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: SUNMATRIX_SPARSE type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - The previous function type :c:type:`CVDlsJacFn` is identical to - :c:type:`CVLsJacFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVDlsJacFn``. .. _CVODE.Usage.CC.user_fct_sim.linsysFn: @@ -3626,10 +3650,9 @@ the default is a difference quotient approximation to these products. :numref:`CVODE.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsJacTimesVecFn`` is identical to - :c:func:`CVLsJacTimesVecFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesVecFn``. .. _CVODE.Usage.CC.user_fct_sim.jtsetupFn: @@ -3671,11 +3694,9 @@ be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defin :numref:`CVODE.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsJacTimesSetupFn`` is identical - to :c:type:`CVLsJacTimesSetupFn`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function - type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesSetupFn``. .. _CVODE.Usage.CC.user_fct_sim.psolveFn: @@ -3713,11 +3734,9 @@ sides, the product of the two preconditioner matrices should approximate positive for a recoverable error (in which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type ``CVSpilsPrecSolveFn`` is identical to - :c:type:`CVLsPrecSolveFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSolveFn``. .. _CVODE.Usage.CC.user_fct_sim.precondFn: @@ -3774,10 +3793,9 @@ function of type , defined as follows: :numref:`CVODE.Usage.CC.optional_output`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsPrecSetupFn`` is identical to - :c:type:`CVLsPrecSetupFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSetupFn``. .. _CVODE.Usage.CC.precond: diff --git a/doc/cvode/guide/source/conf.py b/doc/cvode/guide/source/conf.py index 403ce410fd..3d86ad65cb 100644 --- a/doc/cvode/guide/source/conf.py +++ b/doc/cvode/guide/source/conf.py @@ -11,8 +11,8 @@ # ------------------------------------------------------------------------------ import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index 038019c16f..fde6cd2261 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -644,11 +644,12 @@ following functions. is required within the ``SUNMatrix`` object (e.g., for factorization of a banded matrix), ensure that the input object is allocated with sufficient size (see the documentation of the particular ``SUNMatrix`` type in - :numref:`SUNMatrix`). The previous routines ``CVDlsSetLinearSolverB`` and - ``CVSpilsSetLinearSolverB`` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + :numref:`SUNMatrix`). + + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsSetLinearSolverB`` and + ``CVSpilsSetLinearSolverB``. .. c:function:: int CVDiagB(void * cvode_mem, int which) @@ -905,8 +906,9 @@ sensitivities. * ``CVLS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`CVodeSetLinearSolverB`. * ``CVLS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine :c:type:`CVDlsSetJacFnB` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsSetJacFnB``. .. c:function:: int CVodeSetJacFnBS(void * cvode_mem, int which, CVLsJacFnBS jacBS) @@ -927,8 +929,9 @@ sensitivities. * ``CVLS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`CVodeSetLinearSolverB`. * ``CVLS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine :c:type:`CVDlsSetJacFnBS` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsSetJacFnBS``. .. c:function:: int CVodeSetLinSysFnB(void * cvode_mem, int which, CVLsLinSysFnB linsysB) @@ -1012,8 +1015,9 @@ disable solution scaling when using a matrix-based linear solver. * ``CVLS_NO_ADJ`` -- The function :c:func:`CVodeAdjInit` has not been previously called. * ``CVLS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine ``CVSpilsSetJacTimesB`` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetJacTimesB``. .. c:function:: int CVodeSetJacTimesBS(void * cvode_mem, int which, CVLsJacTimesVecFnBS jtvBS) @@ -1035,8 +1039,9 @@ disable solution scaling when using a matrix-based linear solver. * ``CVLS_NO_ADJ`` -- The function :c:func:`CVodeAdjInit` has not been previously called. * ``CVLS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine ``CVSpilsSetJacTimesBS`` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetJacTimesBS``. When using the internal difference quotient the user may optionally supply an @@ -1096,7 +1101,11 @@ potentially non-differentiable factor. * ``CVLS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. **Notes:** - The ``psetupB`` argument may be ``NULL`` if no setup operation is involved in the preconditioner. The previous routine :c:type:`CVSpilsSetPrecSolveFnB` is now deprecated. + The ``psetupB`` argument may be ``NULL`` if no setup operation is involved in the preconditioner. + + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetPrecSolveFnB``. .. c:function:: int CVodeSetPreconditionerBS(void * cvode_mem, int which, CVLsPrecSetupFnBS psetupBS, CVLsPrecSolveFnBS psolveBS) @@ -1120,8 +1129,11 @@ potentially non-differentiable factor. **Notes:** The ``psetupBS`` argument may be ``NULL`` if no setup operation is - involved in the preconditioner. The previous routine - :c:type:`CVSpilsSetPrecSolveFnBS` is now deprecated. + involved in the preconditioner. + + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetPrecSolveFnBS``. .. c:function:: int CVodeSetEpsLinB(void * cvode_mem, int which, sunrealtype eplifacB) @@ -1146,8 +1158,11 @@ potentially non-differentiable factor. **Notes:** The default value is :math:`0.05`. Passing a value ``eplifacB = 0.0`` - also indicates using the default value. The previous routine - ``CVSpilsSetEpsLinB`` is now deprecated. + also indicates using the default value. + + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetEpsLinB``. .. c:function:: int CVodeSetLSNormFactorB(void * cvode_mem, int which, sunrealtype nrmfac) @@ -1232,7 +1247,9 @@ any case, it must be within the last checkpoint interval used by .. c:function:: int CVodeGetAdjCheckPointsInfo(void * cvode_mem, CVadjCheckPointRec *ckpnt) - The function :c:func:`CVodeGetAdjCheckPointsInfo` loads an array of ``ncheck+1`` records of type ``CVadjCheckPointRec``. The user must allocate space for the array ``ckpnt``. + The function :c:func:`CVodeGetAdjCheckPointsInfo` loads an array of + ``ncheck + 1`` records of type :c:struct:`CVadjCheckPointRec`. The user must + allocate space for the array ``ckpnt``. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block created by :c:func:`CVodeCreate`. @@ -1241,16 +1258,37 @@ any case, it must be within the last checkpoint interval used by **Return value:** * ``void`` - **Notes:** - The members of each record ``ckpnt[i]`` are: + The checkpoint structure is defined as + + .. c:struct:: CVadjCheckPointRec + + .. c:member:: void* my_addr + + The address of current checkpoint in ``cvode_mem->cv_adj_mem`` + + .. c:member:: void* next_addr + + The address of next checkpoint. + + .. c:member:: sunrealtype t0 + + The start time of the checkpoint interval + + .. c:member:: sunrealtype t1 + + The end time of the checkpoint interval + + .. c:member:: long int nstep - * ``ckpnt[i].my_addr`` (``void *``) -- address of current checkpoint in ``cvode_mem->cv_adj_mem`` - * ``ckpnt[i].next_addr`` (``void *``) -- address of next checkpoint - * ``ckpnt[i].t0`` (``sunrealtype``) -- start of checkpoint interval - * ``ckpnt[i].t1`` (``sunrealtype``) -- end of checkpoint interval - * ``ckpnt[i].nstep`` (``long int``) -- step counter at ckeckpoint ``t0`` - * ``ckpnt[i].order`` (``int``) -- method order at checkpoint ``t0`` - * ``ckpnt[i].step`` (``sunrealtype``) -- step size at checkpoint ``t0`` + The step counter at ``t0`` + + .. c:member:: int order + + The method order at ``t0`` + + .. c:member:: sunrealtype step + + The step size at ``t0`` Backward integration of quadrature equations @@ -1442,7 +1480,7 @@ must provide a ``rhsB`` function of type :c:type:`CVRhsFnB` defined as follows: * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``yBdot`` -- is the output vector containing the right-hand side :math:`f_B` of the backward ODE problem. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** A :c:type:`CVRhsFnB` should return 0 if successful, a positive value if a recoverable @@ -1492,7 +1530,7 @@ provide a ``rhsBS`` function of type :c:type:`CVRhsFnBS` defined as follows: * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``yBdot`` -- is the output vector containing the right-hand side. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. **Return value:** A :c:type:`CVRhsFnBS` should return 0 if successful, a positive value if a @@ -1541,7 +1579,7 @@ by * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``qBdot`` -- is the output vector containing the right-hand side ``fQB`` of the backward quadrature equations. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. **Return value:** A :c:type:`CVQuadRhsFnB` should return 0 if successful, a positive value @@ -1591,7 +1629,7 @@ defined by * ``yS`` -- a pointer to an array of ``Ns`` vectors continaing the sensitvities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``qBdot`` -- is the output vector containing the right-hand side ``fQBS`` of the backward quadrature equations. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. **Return value:** A :c:type:`CVQuadRhsFnBS` should return 0 if successful, a positive value if a recoverable @@ -1643,7 +1681,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``JacB`` -- is the output approximate Jacobian matrix. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by the :c:type:`CVLsJacFnB` function as temporary storage or work space. **Return value:** @@ -1669,16 +1707,17 @@ non-``NULL`` ``SUNMatrix`` object was supplied to loaded into ``JacB``. .. warning:: + Before calling the user's :c:type:`CVLsJacFnB`, CVODES needs to - evaluate (through interpolation) the values of the states from the + evaluate (through interpolation) the values of the states from the forward integration. If an error occurs in the interpolation, CVODES triggers an unrecoverable failure in the Jacobian function which will halt the integration (:c:func:`CVodeB` returns ``CV_LSETUP_FAIL`` and - CVLS sets ``last_flag`` to ``CVLS_JACFUNC_UNRECVR``). The previous - function type :c:type:`CVDlsJacFnB` is identical to - :c:type:`CVLsJacFnB`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + CVLS sets ``last_flag`` to ``CVLS_JACFUNC_UNRECVR``). + + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVDlsJacFnB``. .. c:type:: int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B) @@ -1694,7 +1733,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``JacB`` -- is the output approximate Jacobian matrix. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by the :c:type:`CVLsLinSysFnBS` function as temporary storage or work space. **Return value:** @@ -1726,12 +1765,11 @@ non-``NULL`` ``SUNMatrix`` object was supplied to forward integration. If an error occurs in the interpolation, CVODES triggers an unrecoverable failure in the Jacobian function which will halt the integration (:c:func:`CVodeB` returns ``CV_LSETUP_FAIL`` and - CVLS sets ``last_flag`` to ``CVLS_JACFUNC_UNRECVR``). The previous - function type :c:type:`CVDlsJacFnBS` is identical to - :c:type:`CVLsJacFnBS`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function - type name soon. + CVLS sets ``last_flag`` to ``CVLS_JACFUNC_UNRECVR``). + + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVDlsJacFnBS``. @@ -1760,7 +1798,7 @@ J_B` (or an approximation of it) for the backward problem. * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by the :c:type:`CVLsLinSysFnB` function as temporary storage or work space. **Return value:** @@ -1803,7 +1841,7 @@ J_B` (or an approximation of it) for the backward problem. * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by the :c:type:`CVLsLinSysFnBS` function as temporary storage or work space. **Return value:** @@ -1856,7 +1894,7 @@ difference quotient approximation to these products. * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmpB`` -- is a pointer to memory allocated for a variable of type ``N_Vector`` which can be used by :c:type:`CVLsJacTimesVecFnB` as temporary storage or work space. **Return value:** @@ -1873,8 +1911,11 @@ difference quotient approximation to these products. equivalent to those passed to a function of type :c:type:`CVLsJacTimesVecFn`. If the backward problem is the adjoint of :math:`{\dot y} = f(t, y)`, then this function is to compute - :math:`-({\partial f}/{\partial y_i})^T v_B`. The previous function type - :c:type:`CVSpilsJacTimesVecFnB` is deprecated. + :math:`-({\partial f}/{\partial y_i})^T v_B`. + + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesVecFnB``. .. c:type:: int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB, N_Vector tmpB); @@ -1891,7 +1932,7 @@ difference quotient approximation to these products. * ``yS`` -- is a pointer to an array containing the forward sensitivity vectors. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. * ``tmpB`` -- is a pointer to memory allocated for a variable of type ``N_Vector`` which can be used by :c:type:`CVLsJacTimesVecFnB` as temporary storage or work space. **Return value:** @@ -1906,8 +1947,11 @@ difference quotient approximation to these products. solution of the original IVP at time ``t`` and ``yB`` is the solution of the backward problem at the same time. The rest of the arguments are equivalent to those passed to a function of type - :c:type:`CVLsJacTimesVecFn`. The previous function type - :c:type:`CVSpilsJacTimesVecFnBS` is deprecated. + :c:type:`CVLsJacTimesVecFn`. + + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesVecFnBS``. .. _CVODES.Usage.ADJ.user_supplied.jactimesvecsetup_b: @@ -1930,7 +1974,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or * ``y`` -- is the current value of the dependent variable vector, :math:`y(t)`. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the right-hand-side for the backward problem. - * ``user_dataB`` -- is a pointer to user data :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to user data ``CVodeSetUserDataB``. **Return value:** The value returned by the Jacobian-vector setup function @@ -1950,12 +1994,11 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or ``user_dataB`` and then use the ``CVGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in - ``sundials_types.h``. The previous function type - :c:type:`CVSpilsJacTimesSetupFnB` is identical to - :c:type:`CVLsJacTimesSetupFnB`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + ``sundials_types.h``. + + .. versionadded:: 4.0.0 + + Replaces the deprecated function type ``CVSpilsJacTimesSetupFnB``. .. c:type:: int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, void *user_dataB) @@ -1970,7 +2013,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the right-hand-side function for the backward problem. - * ``user_dataB`` -- is a pointer to the same user data provided to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data provided to ``CVodeSetUserDataB``. **Return value:** The value returned by the Jacobian-vector setup function @@ -1990,12 +2033,11 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or ``cvode_mem`` to ``user_dataB`` and then use the ``CVGet*`` functions described in :numref:`CVODES.Usage.SIM.optional_output`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in - ``sundials_types.h``. The previous function type - :c:type:`CVSpilsJacTimesSetupFnBS` is identical to - :c:type:`CVLsJacTimesSetupFnBS`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + ``sundials_types.h``. + + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesSetupFnBS``. .. _CVODES.Usage.ADJ.user_supplied.psolve_b: @@ -2026,7 +2068,7 @@ following two types: * ``zvecB`` -- is the computed output vector. * ``gammaB`` -- is the scalar appearing in the matrix, :math:`M_B = I - \gamma_B J_B`. * ``deltaB`` -- is an input tolerance to be used if an iterative method is employed in the solution. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** The return value of a preconditioner solve function for the backward @@ -2034,8 +2076,9 @@ following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type :c:type:`CVSpilsPrecSolveFnB` is deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSolveFnB``. .. c:type:: int (*CVLsPrecSolveFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, N_Vector rvecB, N_Vector zvecB, sunrealtype gammaB, sunrealtype deltaB, void *user_dataB) @@ -2052,7 +2095,7 @@ following two types: * ``zvecB`` -- is the computed output vector. * ``gammaB`` -- is the scalar appearing in the matrix, :math:`M_B = I - \gamma_B J_B`. * ``deltaB`` -- is an input tolerance to be used if an iterative method is employed in the solution. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** The return value of a preconditioner solve function for the backward @@ -2061,8 +2104,9 @@ following two types: negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type :c:type:`CVSpilsPrecSolveFnBS` is identical to :c:type:`CVLsPrecSolveFnBS`, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSolveFnBS``. .. _CVODES.Usage.ADJ.user_supplied.psetup_b: @@ -2087,7 +2131,7 @@ function of one of the following two types: * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** The return value of a preconditioner setup function for the backward @@ -2095,12 +2139,9 @@ function of one of the following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type :c:type:`CVSpilsPrecSetupFnB` is identical to - :c:type:`CVLsPrecSetupFnB`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSetupFnB``. .. c:type:: int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector *yS, N_Vector yB, N_Vector fyB, sunbooleantype jokB, sunbooleantype *jcurPtrB, sunrealtype gammaB, void *user_dataB) @@ -2118,7 +2159,7 @@ function of one of the following two types: * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** The return value of a preconditioner setup function for the backward @@ -2126,8 +2167,9 @@ function of one of the following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type :c:type:`CVSpilsPrecSetupFnBS` is deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSetupFnBS``. Using CVODES preconditioner modules for the backward problem @@ -2172,7 +2214,7 @@ initialization function must be made. * ``mlB`` -- lower half-bandwidth of the backward problem Jacobian approximation. **Return value:** - * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBandPrecInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVBandPrecInitB` was successful. * ``CVLS_MEM_FAIL`` -- A memory allocation request has failed. * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` argument was ``NULL``. * ``CVLS_LMEM_NULL`` -- No linear solver has been attached. @@ -2223,7 +2265,7 @@ iterative ``SUNLinearSolver`` object has been attached to CVODES via a call to * ``gcommB`` -- the optional function which performs all interprocess communication required for the computation of :math:`g_B`. **Return value:** - * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBBDPrecInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVBBDPrecInitB` was successful. * ``CVLS_MEM_FAIL`` -- A memory allocation request has failed. * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` argument was ``NULL``. * ``CVLS_LMEM_NULL`` -- No linear solver has been attached. @@ -2243,10 +2285,10 @@ iterative ``SUNLinearSolver`` object has been attached to CVODES via a call to * ``dqrelyB`` -- the relative increment in components of ``yB`` used in the difference quotient approximations. **Return value:** - * ``CVLS_SUCCESS`` -- The call to :c:func:`CVodeBBDPrecReInitB` was successful. + * ``CVLS_SUCCESS`` -- The call to :c:func:`CVBBDPrecReInitB` was successful. * ``CVLS_MEM_FAIL`` -- A memory allocation request has failed. * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` argument was ``NULL``. - * ``CVLS_PMEM_NULL`` -- The :c:func:`CVodeBBDPrecInitB` has not been previously called. + * ``CVLS_PMEM_NULL`` -- The :c:func:`CVBBDPrecInitB` has not been previously called. * ``CVLS_LMEM_NULL`` -- No linear solver has been attached. * ``CVLS_ILL_INPUT`` -- An invalid parameter has been passed. @@ -2278,7 +2320,7 @@ prototypes for these two functions are described below. * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``gB`` -- is the output vector, :math:`g_B(t, y, y_B)`. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** An :c:type:`CVBBDLocalFnB` should return 0 if successful, a positive value @@ -2312,7 +2354,7 @@ prototypes for these two functions are described below. * ``t`` -- is the value of the independent variable. * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. - * ``user_dataB`` -- is a pointer to the same user data passed to :c:func:`CVodeSetUserDataB`. + * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. **Return value:** An :c:type:`CVBBDCommFnB` should return 0 if successful, a positive value diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index 5a9e74a97c..bec66d6d76 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -707,7 +707,7 @@ parameter in turn through the functions :c:func:`CVodeGetSens1` and * ``dkyS`` -- the vector containing the derivative. The space for ``dkyS`` must be allocated by the user. **Return value:** - * ``CV_SUCCESS`` -- :c:func:`CVodeGetQuadDky1` succeeded. + * ``CV_SUCCESS`` -- :c:func:`CVodeGetSensDky1` succeeded. * ``CV_MEM_NULL`` -- The pointer to ``cvode_mem`` was ``NULL``. * ``CV_NO_SENS`` -- Forward sensitivity analysis was not initialized. * ``CV_BAD_DKY`` -- ``dkyS`` or one of the vectors ``dkyS[i]`` is ``NULL``. @@ -1554,7 +1554,7 @@ each parameter in turn through the functions :c:func:`CVodeGetQuadSens1` and * ``dkyQS`` -- the vector containing the derivative on output. The space for ``dkyQS`` must be allocated by the user. **Return value:** - * ``CV_SUCCESS`` -- :c:func:`CVodeGetQuadDky1` succeeded. + * ``CV_SUCCESS`` -- :c:func:`CVodeGetQuadSensDky1` succeeded. * ``CVODE_MEM_NULL`` -- ``cvode_mem`` was ``NULL``. * ``CV_NO_SENS`` -- Forward sensitivity analysis was not initialized. * ``CV_NO_QUADSENS`` -- Quadratures depending on the sensitivities were not activated. diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 449bb24857..18dce59206 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -581,7 +581,9 @@ returned by :c:func:`CVodeCreate`. When using sparse linear solvers, it is typically much more efficient to supply ``J`` so that it includes the full sparsity pattern of the Newton system matrices :math:`M=I-\gamma J`, even if ``J`` itself has zeros in nonzero locations of I. The reasoning for this is that M is constructed in-place, on top of the user-specified values of ``J``, so if the sparsity pattern in ``J`` is insufficient to store M then it will need to be resized internally by CVODES. - The previous routines ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsSetLinearSolver`` and ``CVSpilsSetLinearSolver``. .. c:function:: int CVDiag(void* cvode_mem) @@ -1367,7 +1369,9 @@ through :c:func:`CVodeSetUserData`. The function type :c:type:`CVLsJacFn` is described in :numref:`CVODES.Usage.SIM.user_supplied.jacFn`. - The previous routine ``CVDlsSetJacFn`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsSetJacFn``. To specify a user-supplied linear system function ``linsys``, CVLS provides @@ -1472,7 +1476,9 @@ without using global data in the program. This function must be called after the CVLS linear solver interface has been initialized through a call to :c:func:`CVodeSetLinearSolver`. - The previous routine ``CVSpilsSetJacTimes`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetJacTimes``. When using the internal difference quotient the user may optionally supply an @@ -1555,7 +1561,9 @@ the :c:func:`CVodeSetEpsLin` function. The function type :c:type:`CVLsPrecSetupFn` is described in :numref:`CVODES.Usage.SIM.user_supplied.precondFn`. - The previous routine ``CVSpilsSetPreconditioner`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetPreconditioner``. .. c:function:: int CVodeSetEpsLin(void* cvode_mem, sunrealtype eplifac) @@ -1579,7 +1587,9 @@ the :c:func:`CVodeSetEpsLin` function. If ``eplifac`` = 0.0 is passed, the default value is used. - The previous routine ``CVSpilsSetEpsLin`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsSetEpsLin``. .. c:function:: int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) @@ -2902,7 +2912,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Notes:** The workspace requirements reported by this routine correspond only to memory allocated within this interface and to memory allocated by the ``SUNLinearSolver`` object attached to it. The template Jacobian matrix allocated by the user outside of CVLS is not included in this report. - The previous routines ``CVDlsGetWorkspace`` and ``CVSpilsGetWorkspace`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetWorkspace`` and ``CVSpilsGetWorkspace``. .. c:function:: int CVodeGetNumJacEvals(void* cvode_mem, long int *njevals) @@ -2918,8 +2930,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVDlsGetNumJacEvals`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVDlsGetNumJacEvals``. .. c:function:: int CVodeGetNumLinRhsEvals(void* cvode_mem, long int *nfevalsLS) @@ -2938,7 +2951,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Notes:** The value ``nfevalsLS`` is incremented only if one of the default internal difference quotient functions is used. - The previous routines ``CVDlsGetNumRhsEvals`` and ``CVSpilsGetNumRhsEvals`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetNumRhsEvals`` and ``CVSpilsGetNumRhsEvals``. .. c:function:: int CVodeGetNumLinIters(void* cvode_mem, long int *nliters) @@ -2954,8 +2969,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumLinIters`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumLinIters``. .. c:function:: int CVodeGetNumLinConvFails(void* cvode_mem, long int *nlcfails) @@ -2971,8 +2987,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumConvFails`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumConvFails``. .. c:function:: int CVodeGetNumPrecEvals(void* cvode_mem, long int *npevals) @@ -2988,8 +3005,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). * ``CVLS_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVLS_LMEM_NULL`` -- The CVLS linear solver has not been initialized. - **Notes:** - The previous routine ``CVSpilsGetNumPrecEvals`` is now a wrapper for this routine, and may still be used for backward-compatibility. However, this will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``CVSpilsGetNumPrecEvals``. .. c:function:: int CVodeGetNumPrecSolves(void* cvode_mem, long int *npsolves) @@ -3075,7 +3093,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). If the CVLS solve function failed (i.e., :c:func:`CVode` returned ``CV_LSOLVE_FAIL``), then ``lsflag`` contains the error return flag from the ``SUNLinearSolver`` object, which will be one of: ``SUN_ERR_ARG_CORRUPTRRUPT``, indicating that the ``SUNLinearSolver`` memory is ``NULL``; ``SUNLS_ATIMES_FAIL_UNREC``, indicating an unrecoverable failure in the Jv function; ``SUNLS_PSOLVE_FAIL_UNREC``, indicating that the preconditioner solve function ``psolve`` failed unrecoverably; ``SUNLS_GS_FAIL``, indicating a failure in the Gram-Schmidt procedure (SPGMR and SPFGMR only); ``SUNLS_QRSOL_FAIL``, indicating that the matrix R was found to be singular during the QR solve phase (SPGMR and SPFGMR only); or ``SUN_ERR_EXT_FAIL``, indicating an unrecoverable failure in an external iterative linear solver package. - The previous routines ``CVDlsGetLastFlag`` and ``CVSpilsGetLastFlag`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetLastFlag`` and ``CVSpilsGetLastFlag``. .. c:function:: int CVodeGetLinReturnFlagName(long int lsflag) @@ -3088,8 +3108,9 @@ solver, a suffix (for Linear Solver) has been added (e.g. ``lenrwLS``). **Return value:** * The return value is a string containing the name of the corresponding constant. If :math:`1 \leq \text{lsflag} \leq N` (LU factorization failed), this routine returns "NONE". - **Notes:** - The previous routines ``CVDlsGetReturnFlagName`` and ``CVSpilsGetReturnFlagName`` are now wrappers for this routine, and may still be used for backward-compatibility. However, these will be deprecated in future releases, so we recommend that users transition to the new routine name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``CVDlsGetReturnFlagName`` and ``CVSpilsGetReturnFlagName``. .. _CVODES.Usage.SIM.optional_output.optout_diag: @@ -3554,10 +3575,9 @@ side function (or an approximation of it). ``CVLsJacFn`` is defined as follows: SUNMATRIX_SPARSE type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - The previous function type :c:type:`CVDlsJacFn` is identical to - :c:type:`CVLsJacFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVDlsJacFn``. .. _CVODES.Usage.SIM.user_supplied.linsysFn: @@ -3629,10 +3649,9 @@ the default is a difference quotient approximation to these products. :numref:`CVODES.Usage.SIM.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsJacTimesVecFn`` is identical to - :c:func:`CVLsJacTimesVecFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesVecFn``. .. _CVODES.Usage.SIM.user_supplied.jtsetupFn: @@ -3674,11 +3693,9 @@ be done in a user-supplied function of type :c:type:`CVLsJacTimesSetupFn`, defin :numref:`CVODES.Usage.SIM.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsJacTimesSetupFn`` is identical - to :c:type:`CVLsJacTimesSetupFn`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function - type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsJacTimesSetupFn``. .. _CVODES.Usage.SIM.user_supplied.psolveFn: @@ -3716,11 +3733,9 @@ sides, the product of the two preconditioner matrices should approximate positive for a recoverable error (in which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - **Notes:** - The previous function type ``CVSpilsPrecSolveFn`` is identical to - :c:type:`CVLsPrecSolveFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated type ``CVSpilsPrecSolveFn``. .. _CVODES.Usage.SIM.user_supplied.precondFn: @@ -3777,10 +3792,9 @@ function of type , defined as follows: :numref:`CVODES.Usage.SIM.optional_output`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - The previous function type ``CVSpilsPrecSetupFn`` is identical to - :c:type:`CVLsPrecSetupFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend - that users transition to the new function type name soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated function type ``CVSpilsPrecSetupFn``. .. _CVODES.Usage.purequad: diff --git a/doc/cvodes/guide/source/conf.py b/doc/cvodes/guide/source/conf.py index 6ed2b1895e..a8a21e28a1 100644 --- a/doc/cvodes/guide/source/conf.py +++ b/doc/cvodes/guide/source/conf.py @@ -11,8 +11,8 @@ # ------------------------------------------------------------------------------ import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 02bf3732d1..2402ae83eb 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -588,13 +588,9 @@ pertinent to their choice of linear solver. the documentation of the particular ``SUNMatrix`` in Chapter :numref:`SUNMatrix` for further information). - .. warning:: + .. versionadded:: 4.0.0 - The previous routines ``IDADlsSetLinearSolver`` and - ``IDASpilsSetLinearSolver`` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated function ``IDASpilsSetLinearSolver``. .. _IDA.Usage.CC.nonlin_solv_init: @@ -1259,12 +1255,9 @@ in the program. The pointer ``user_data`` may be specified through ``jac``, this default function is used. An error will occur if no ``jac`` is supplied when using other matrix types. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDADlsSetJacFn`` is now a wrapper for this routine, - and may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated function ``IDADlsSetJacFn``. When using a matrix-based linear solver the matrix information will be updated @@ -1369,12 +1362,9 @@ without using global data in the program. solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsSetJacTimes`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetJacTimes``. When using the default difference-quotient approximation to the Jacobian-vector @@ -1412,12 +1402,9 @@ finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`IDASpilsSetIncrementFactor` is now a wrapper - for this routine, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend that - users transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetIncrementFactor``. Additionally, when using the internal difference quotient, the user may also @@ -1497,12 +1484,9 @@ global data in the program. function must be called after the IDALS linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsSetPreconditioner`` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetPreconditioner``. Also, as described in :numref:`IDA.Mathematics.ivp_sol`, the IDALS interface @@ -1538,12 +1522,9 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default :c:func:`IDASetLinearSolver`. If ``eplifac`` :math:`= 0.0` is passed, the default value is used. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsSetEpsLin`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetEpsLin``. .. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) @@ -2820,13 +2801,10 @@ The following optional outputs are available from the IDALS modules: ``SUNLinearSolver`` object attached to it. The template Jacobian matrix allocated by the user outside of IDALS is not included in this report. - .. warning:: + .. versionadded:: 4.0.0 - The previous routines ``IDADlsGetWorkspace`` and ``IDASpilsGetWorkspace`` - are now wrappers for this routine, and may still be used for - backward-compatibility. However, these will be deprecated in future - releases, so we recommend that users transition to the new routine name - soon. + Replaces the deprecated functions ``IDADlsGetWorkspace`` and + ``IDASpilsGetWorkspace``. .. c:function:: int IDAGetNumJacEvals(void * ida_mem, long int * njevals) @@ -2842,12 +2820,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDADlsGetNumJacEvals`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDADlsGetNumJacEvals``. .. c:function:: int IDAGetNumLinResEvals(void * ida_mem, long int * nrevalsLS) @@ -2869,13 +2844,10 @@ The following optional outputs are available from the IDALS modules: The value ``nrevalsLS`` is incremented only if one of the default internal difference quotient functions is used. - .. warning:: + .. versionadded:: 4.0.0 - The previous routines ``IDADlsGetNumRhsEvals`` and - ``IDASpilsGetNumRhsEvals`` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated functions ``IDADlsGetNumRhsEvals`` and + ``IDASpilsGetNumRhsEvals``. .. c:function:: int IDAGetNumLinIters(void * ida_mem, long int * nliters) @@ -2891,12 +2863,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumLinIters`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumLinIters``. .. c:function:: int IDAGetNumLinConvFails(void * ida_mem, long int * nlcfails) @@ -2912,12 +2881,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumConvFails`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumConvFails``. .. c:function:: int IDAGetNumPrecEvals(void * ida_mem, long int * npevals) @@ -2933,12 +2899,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumPrecEvals`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumPrecEvals``. .. c:function:: int IDAGetNumPrecSolves(void * ida_mem, long int * npsolves) @@ -2954,12 +2917,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumPrecSolves`` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumPrecSolves``. .. c:function:: int IDAGetNumJTSetupEvals(void * ida_mem, long int * njtsetup) @@ -2975,12 +2935,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumJTSetupEvals`` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumJTSetupEvals``. .. c:function:: int IDAGetNumJtimesEvals(void * ida_mem, long int * njvevals) @@ -2996,12 +2953,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine ``IDASpilsGetNumJtimesEvals`` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumJtimesEvals``. .. c:function:: int IDAGetLastLinFlag(void * ida_mem, long int * lsflag) @@ -3039,13 +2993,10 @@ The following optional outputs are available from the IDALS modules: (SPGMR and SPFGMR only); or ``SUN_ERR_EXT_FAIL``, indicating an unrecoverable failure in an external iterative linear solver package. - .. warning:: + .. versionadded:: 4.0.0 - The previous routines ``IDADlsGetLastFlag`` and ``IDASpilsGetLastFlag`` - are now wrappers for this routine, and may still be used for - backward-compatibility. However, these will be deprecated in future - releases, so we recommend that users transition to the new routine name - soon. + Replaces the deprecated functions ``IDADlsGetLastFlag`` and + ``IDASpilsGetLastFlag``. .. c:function:: char* IDAGetLinReturnFlagName(long int lsflag) @@ -3060,13 +3011,10 @@ The following optional outputs are available from the IDALS modules: :math:`1 \leq \mathtt{lsflag} \leq N` (LU factorization failed), this function returns "NONE". - .. warning:: + .. versionadded:: 4.0.0 - The previous routines ``IDADlsGetReturnFlagName`` and - ``IDASpilsGetReturnFlagName`` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated functions ``IDADlsGetReturnFlagName`` and + ``IDASpilsGetReturnFlagName``. .. _IDA.Usage.CC.reinit: @@ -3401,12 +3349,9 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: ``SUNMATRIX_SPARSE`` type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - .. warning:: + .. versionadded:: 4.0.0 - The previous function type ``IDADlsJacFn`` is identical to ``IDALsJacFn``, - and may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new function type name soon. + Replaces the deprecated type ``IDADlsJacFn``. .. _IDA.Usage.CC.user_fct_sim.jtimesFn: @@ -3461,13 +3406,9 @@ the default is a difference quotient approximation to these products. :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: + .. versionadded:: 4.0.0 - The previous function type ``IDASpilsJacTimesVecFn`` is identical to - ``IDALsJacTimesVecFn``, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesVecFn``. .. _IDA.Usage.CC.user_fct_sim.jtsetupFn: @@ -3517,13 +3458,9 @@ follows: :numref:`IDA.Usage.CC.optional_output.optout_main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: + .. versionadded:: 4.0.0 - The previous function type ``IDASpilsJacTimesSetupFn`` is identical to - ``IDALsJacTimesSetupFn``, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesSetupFn``. diff --git a/doc/ida/guide/source/conf.py b/doc/ida/guide/source/conf.py index 847aabc2da..a92a878cf5 100644 --- a/doc/ida/guide/source/conf.py +++ b/doc/ida/guide/source/conf.py @@ -11,8 +11,8 @@ # ------------------------------------------------------------------------------ import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 0d89e5b895..60c76147d7 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -690,8 +690,10 @@ function. documentation of the particular ``SUNMatrix`` type in Chapter :numref:`SUNMatrix` for further information). - The previous routines ``IDADlsSetLinearSolverB`` and - ``IDASpilsSetLinearSolverB`` are now deprecated. + .. versionadded:: 3.0.0 + + Replaces the deprecated functions ``IDADlsSetLinearSolverB`` and + ``IDASpilsSetLinearSolverB``. .. _IDAS.Usage.ADJ.user_callable.nonlin_solv_init_b: @@ -748,7 +750,7 @@ The above functions provide the same functionality for backward problems as :c:func:`IDACalcIC` with parameter ``icopt`` = ``IDA_YA_YDP_INIT`` provides for forward problems: compute the algebraic components of :math:`yB` and differential components of :math:`\dot{y}B`, given the differential components -of :math:`yB`. They require that the :c:func:`IDASetIdB` was previously called +of :math:`yB`. They require that the ``IDASetIdB`` was previously called to specify the differential and algebraic components. Both functions require forward solutions at the final time ``tB0``. @@ -990,11 +992,9 @@ backward problem depends on the forward sensitivities. * ``IDALS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`IDASetLinearSolverB`. * ``IDALS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine ``IDADlsSetJacFnB`` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + .. versionadded:: 3.0.0 + + Replaces the deprecated function ``IDADlsSetJacFnB``. .. c:function:: int IDASetJacFnBS(void * ida_mem, int which, IDALsJacFnBS jacBS) @@ -1015,8 +1015,9 @@ backward problem depends on the forward sensitivities. * ``IDALS_LMEM_NULL`` -- The linear solver has not been initialized with a call to :c:func:`IDASetLinearSolverB`. * ``IDALS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - **Notes:** - The previous routine, ``IDADlsSetJacFnBS``, is now deprecated. + .. versionadded:: 3.0.0 + + Replaces the deprecated function ``IDADlsSetJacFnBS``. The function :c:func:`IDASetLinearSolutionScalingB` can be used to enable or @@ -1073,9 +1074,9 @@ two functions: * ``IDALS_NO_ADJ`` -- The function :c:func:`IDAAdjInit` has not been previously called. * ``IDALS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine, ``IDASpilsSetJacTimesB``, is now deprecated. + Replaces the deprecated function ``IDASpilsSetJacTimesB``. .. c:function:: int IDASetJacTimesBS(void * ida_mem, int which, \ @@ -1098,9 +1099,9 @@ two functions: * ``IDALS_NO_ADJ`` -- The function :c:func:`IDAAdjInit` has not been previously called. * ``IDALS_ILL_INPUT`` -- The parameter ``which`` represented an invalid identifier. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine, ``IDASpilsSetJacTimesBS``, is now deprecated. + Replaces the deprecated function ``IDASpilsSetJacTimesBS``. When using the default difference-quotient approximation to the Jacobian-vector @@ -1131,7 +1132,9 @@ setting increments for the finite-difference approximation, via a call to **Notes:** The default value is :math:`1.0`. - The previous routine ``IDASpilsSetIncrementFactorB`` is now a deprecated. + .. versionadded:: 3.0.0 + + Replaces the deprecated function ``IDASpilsSetIncrementFactorB``. Additionally, When using the internal difference quotient for the backward @@ -1203,9 +1206,9 @@ These may be accomplished through calling the following functions: The ``psetupB`` argument may be ``NULL`` if no setup operation is involved in the preconditioner. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine ``IDASpilsSetPreconditionerB`` is now deprecated. + Replaces the deprecated function ``IDASpilsSetPreconditionerB``. .. c:function:: int IDASetPreconditionerBS(void * ida_mem, int which, IDALsPrecSetupFnBS psetupBS, IDALsPrecSolveFnBS psolveBS) @@ -1231,9 +1234,9 @@ These may be accomplished through calling the following functions: The ``psetupBS`` argument may be ``NULL`` if no setup operation is involved in the preconditioner. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine ``IDASpilsSetPreconditionerBS`` is now deprecated. + Replaces the deprecated function ``IDASpilsSetPreconditionerBS``. .. c:function:: int IDASetEpsLinB(void * ida_mem, int which, sunrealtype eplifacB) @@ -1262,9 +1265,9 @@ These may be accomplished through calling the following functions: Passing a value ``eplifacB`` :math:`= 0.0` also indicates using the default value. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine ``IDASpilsSetEpsLinB`` is now deprecated. + Replaces the deprecated function ``IDASpilsSetEpsLinB``. .. c:function:: int IDASetLSNormFactorB(void * ida_mem, int which, sunrealtype nrmfac) @@ -1364,8 +1367,8 @@ any case, it must be within the last checkpoint interval used by .. c:function:: int IDAGetAdjCheckPointsInfo(void * ida_mem, IDAadjCheckPointRec *ckpnt) The function :c:func:`IDAGetAdjCheckPointsInfo` loads an array of - ``ncheck+1`` records of type :c:func:`IDAadjCheckPointRec`. The user must - allocate space for the array ``ckpnt``. + ``ncheck + 1`` records of type :c:struct:`IDAadjCheckPointRec`. The user + must allocate space for the array ``ckpnt``. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block created by :c:func:`IDACreate`. @@ -1374,22 +1377,37 @@ any case, it must be within the last checkpoint interval used by **Return value:** * ``void`` - **Notes:** - The members of each record ``ckpnt[i]`` are: + The checkpoint structure is defined as + + .. c:struct:: IDAadjCheckPointRec + + .. c:member:: void* my_addr + + The address of current checkpoint in ``ida_mem->ida_adj_mem`` - - ``ckpnt[i].my_addr`` (``void *``) address of current checkpoint in ``ida_mem->ida_adj_mem`` + .. c:member:: void* next_addr - - ``ckpnt[i].next_addr`` (``void *``) address of next checkpoint + The address of next checkpoint. - - ``ckpnt[i].t0`` (``sunrealtype``) start of checkpoint interval + .. c:member:: sunrealtype t0 - - ``ckpnt[i].t1`` (``sunrealtype``) end of checkpoint interval + The start time of the checkpoint interval - - ``ckpnt[i].nstep`` (``long int``) step counter at ckeckpoint ``t0`` + .. c:member:: sunrealtype t1 - - ``ckpnt[i].order`` (``int``) method order at checkpoint ``t0`` + The end time of the checkpoint interval - - ``ckpnt[i].step`` (``sunrealtype``) step size at checkpoint ``t0`` + .. c:member:: long int nstep + + The step counter at ``t0`` + + .. c:member:: int order + + The method order at ``t0`` + + .. c:member:: sunrealtype step + + The step size at ``t0`` .. _IDAS.Usage.ADJ.user_callable.optional_ouput_b.iccalcB: @@ -1615,7 +1633,7 @@ The user must provide a ``resB`` function of type ``IDAResFnB`` defined as follo * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the output vector containing the residual for the backward DAE problem. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data, same as passed to ``IDASetUserDataB``. **Return value:** An ``IDAResFnB`` should return 0 if successful, a positive value if a recoverable @@ -1664,7 +1682,7 @@ follows: * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the output vector containing the residual for the backward DAE problem. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data, same as passed to ``IDASetUserDataB``. **Return value:** An ``IDAResFnBS`` should return 0 if successful, a positive value if a @@ -1711,7 +1729,7 @@ The user must provide an ``fQB`` function of type ``IDAQuadRhsFnB`` defined by * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``rhsvalBQ`` -- is the output vector containing the residual for the backward quadrature equations. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data, same as passed to ``IDASetUserDataB``. **Return value:** An ``IDAQuadRhsFnB`` should return 0 if successful, a positive value if a @@ -1763,7 +1781,7 @@ The user must provide an ``fQBS`` function of type ``IDAQuadRhsFnBS`` defined by * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``rhsvalBQS`` -- is the output vector containing the residual for the backward quadrature equations. - * ``user_dataB`` -- is a pointer to user data, same as passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data, same as passed to ``IDASetUserDataB``. **Return value:** An ``IDAQuadRhsFnBS`` should return 0 if successful, a positive value if a @@ -1817,7 +1835,7 @@ as follows: * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``rrB`` -- is the current value of the residual for the backward problem. * ``JacB`` -- is the output approximate Jacobian matrix. - * ``user_dataB`` -- is a pointer to user data — the parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the parameter passed to ``IDASetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by the :c:type:`IDALsJacFnB` function as temporary storage or work space. **Return value:** @@ -1850,11 +1868,9 @@ as follows: integration (:c:func:`IDASolveB` returns ``IDA_LSETUP_FAIL`` and IDALS sets ``last_flag`` to ``IDALS_JACFUNC_UNRECVR``). - The previous - function type ``IDADlsJacFnB`` is identical to ``IDALsJacFnB``, and may - still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new function type name soon. + .. versionadded:: 3.0.0 + + Replaces the deprecated type ``IDADlsJacFnB``. .. c:type:: int (*IDALsJacFnBS)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector yp, N_Vector *yS, N_Vector *ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); @@ -1874,7 +1890,7 @@ as follows: * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``rrb`` -- is the current value of the residual for the backward problem. * ``JacB`` -- is the output approximate Jacobian matrix. - * ``user_dataB`` -- is a pointer to user data — the parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the parameter passed to ``IDASetUserDataB``. * ``tmp1B``, ``tmp2B``, ``tmp3B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by :c:type:`IDALsJacFnBS` as temporary storage or work space. **Return value:** @@ -1908,11 +1924,9 @@ as follows: integration (:c:func:`IDASolveB` returns ``IDA_LSETUP_FAIL`` and IDALS sets ``last_flag`` to ``IDALS_JACFUNC_UNRECVR``). - The previous - function type ``IDADlsJacFnBS`` is identical to :c:type:`IDALsJacFnBS`, and - may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new function type name soon. + .. versionadded:: 3.0.0 + + Replaces the deprecated type ``IDADlsJacFnBS``. .. _IDAS.Usage.ADJ.user_supplied.jactimesvec_b: @@ -1941,9 +1955,9 @@ these products. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``vB`` -- is the vector by which the Jacobian must be multiplied. - * ``JvB`` -- is the computed output vector, ``JB*vB`` . + * ``JvB`` -- is the computed output vector, ``JB*vB``. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. * ``tmp1B``, ``tmp2B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by ``IDALsJacTimesVecFnB`` as temporary storage or work space. **Return value:** @@ -1962,13 +1976,9 @@ these products. problem is the adjoint of :math:`{\dot y} = f(t, y)`, then this function is to compute :math:`-\left({\partial f}/{\partial y_i}\right)^T v_B`. - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsJacTimesVecFnB`` is identical to - ``IDALsJacTimesVecFnB``, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesVecFnB``. .. c:type:: int (*IDALsJacTimesVecFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector vB, N_Vector JvB, sunrealtype cjB, void *user_dataB, N_Vector tmp1B, N_Vector tmp2B) @@ -1987,9 +1997,9 @@ these products. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``vB`` -- is the vector by which the Jacobian must be multiplied. - * ``JvB`` -- is the computed output vector, ``JB*vB`` . + * ``JvB`` -- is the computed output vector, ``JB*vB``. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. * ``tmp1B``, ``tmp2B`` -- are pointers to memory allocated for variables of type ``N_Vector`` which can be used by ``IDALsJacTimesVecFnBS`` as temporary storage or work space. **Return value:** @@ -2006,13 +2016,9 @@ these products. equivalent to those passed to a function of type ``IDALsJacTimesVecFn`` (see :numref:`IDAS.Usage.SIM.user_supplied.jtimesFn`). - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsJacTimesVecFnBS`` is identical to - ``IDALsJacTimesVecFnBS``, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesVecFnBS``. .. _IDAS.Usage.ADJ.user_supplied.jactimesvecsetup_b: @@ -2038,7 +2044,7 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. **Return value:** The value returned by the Jacobian-vector setup function @@ -2060,13 +2066,9 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsJacTimesSetupFnB`` is identical to - ``IDALsJacTimesSetupFnB``, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesSetupFnB``. .. c:type:: int (*IDALsJacTimesSetupFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) @@ -2083,7 +2085,7 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. **Return value:** The value returned by the Jacobian-vector setup function should be if @@ -2105,13 +2107,9 @@ function of type :c:type:`IDALsJacTimesSetupFnB` or can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. The previous function type ``IDASpilsJacTimesSetupFnBS`` is deprecated. - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsJacTimesSetupFnBS`` is identical to - :c:type:`IDALsJacTimesSetupFnBS`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesSetupFnBS``. .. _IDAS.Usage.ADJ.user_supplied.psolve_b: @@ -2140,7 +2138,7 @@ following two forms: * ``zvecB`` -- is the computed output vector. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). * ``deltaB`` -- is an input tolerance to be used if an iterative method is employed in the solution. - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function ``IDASetUserDataB``. **Return value:** The return value of a preconditioner solve function for the backward @@ -2148,10 +2146,9 @@ following two forms: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsPrecSolveFnB`` is identical to - ``IDALsPrecSolveFnB``, and is deprecated. + Replaces the deprecated type ``IDASpilsPrecSolveFnB``. .. c:type:: int (*IDALsPrecSolveFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, N_Vector rvecB, N_Vector zvecB, sunrealtype cjB, sunrealtype deltaB, void *user_dataB) @@ -2173,7 +2170,7 @@ following two forms: * ``zvecB`` -- is the computed output vector. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). * ``deltaB`` -- is an input tolerance to be used if an iterative method is employed in the solution. - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function ``IDASetUserDataB``. **Return value:** The return value of a preconditioner solve function for the backward @@ -2181,10 +2178,9 @@ following two forms: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsPrecSolveFnBS`` is identical to - ``IDALsPrecSolveFnBS``, and is deprecated. + Replaces the deprecated type ``IDASpilsPrecSolveFnBS``. .. _IDAS.Usage.ADJ.user_supplied.psetup_b: @@ -2209,7 +2205,7 @@ function of one of the following two types: * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function ``IDASetUserDataB``. **Return value:** The return value of a preconditioner setup function for the backward @@ -2217,10 +2213,9 @@ function of one of the following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsPrecSetupFnB`` is identical to - ``IDALsPrecSetupFnB``, and is deprecated. + Replaces the deprecated type ``IDASpilsPrecSetupFnB``. .. c:type:: int (*IDALsPrecSetupFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector *yyS, N_Vector *ypS, N_Vector yB, N_Vector ypB, N_Vector resvalB, sunrealtype cjB, void *user_dataB) @@ -2239,7 +2234,7 @@ function of one of the following two types: * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``resvalB`` -- is the current value of the residual for the backward problem. * ``cjB`` -- is the scalar in the system Jacobian, proportional to the inverse of the step size ( :math:`\alpha` in :eq:`IDAS_DAE_Jacobian` ). - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to the function ``IDASetUserDataB``. **Return value:** The return value of a preconditioner setup function for the backward @@ -2247,10 +2242,9 @@ function of one of the following two types: which case the step will be retried), or negative for an unrecoverable error (in which case the integration is halted). - .. warning:: + .. versionadded:: 3.0.0 - The previous function type ``IDASpilsPrecSetupFnBS`` is identical to - ``IDALsPrecSetupFnBS``, and is deprecated. + Replaces the deprecated type ``IDASpilsPrecSetupFnBS``. Using the band-block-diagonal preconditioner for backward problems @@ -2359,7 +2353,7 @@ are described below. * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. * ``gB`` -- is the output vector, :math:`G_B(t,y,\dot y, y_B, \dot y_B)` . - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. **Return value:** An ``IDABBDLocalFnB`` should return 0 if successful, a positive value if a @@ -2394,7 +2388,7 @@ are described below. * ``yp`` -- is the current value of the forward solution derivative vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``ypB`` -- is the current value of the backward dependent derivative vector. - * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to :c:func:`IDASetUserDataB` . + * ``user_dataB`` -- is a pointer to user data — the same as the ``user_dataB`` parameter passed to ``IDASetUserDataB``. **Return value:** An ``IDABBDCommFnB`` should return 0 if successful, a positive value if a diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index 69f3e29842..981291a4aa 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -586,13 +586,9 @@ pertinent to their choice of linear solver. the documentation of the particular ``SUNMatrix`` in Chapter :numref:`SUNMatrix` for further information). - .. warning:: + .. versionadded:: 3.0.0 - The previous routines :c:func:`IDADlsSetLinearSolver` and - :c:func:`IDASpilsSetLinearSolver` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated function ``IDADlsSetLinearSolver``. .. _IDAS.Usage.SIM.user_callable.nonlin_solv_init: @@ -1271,12 +1267,9 @@ in the program. The pointer ``user_data`` may be specified through ``jac``, this default function is used. An error will occur if no ``jac`` is supplied when using other matrix types. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDADlsSetJacFn` is now a wrapper for this routine, - and may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated function ``IDADlsSetJacFn``. When using a matrix-based linear solver the matrix information will be updated @@ -1381,12 +1374,9 @@ without using global data in the program. solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsSetJacTimes` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetJacTimes``. When using the default difference-quotient approximation to the Jacobian-vector @@ -1424,12 +1414,9 @@ finite-difference approximation, via a call to :c:func:`IDASetIncrementFactor`. linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsSetIncrementFactor` is now a wrapper - for this routine, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend that - users transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetIncrementFactor``. Additionally, when using the internal difference quotient, the user may also @@ -1509,12 +1496,9 @@ global data in the program. function must be called after the IDALS linear solver interface has been initialized through a call to :c:func:`IDASetLinearSolver`. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsSetPreconditioner` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetPreconditioner``. Also, as described in :numref:`IDAS.Mathematics.ivp_sol`, the IDALS interface @@ -1550,12 +1534,9 @@ where :math:`\epsilon` is the nonlinear solver tolerance, and the default :c:func:`IDASetLinearSolver`. If ``eplifac`` :math:`= 0.0` is passed, the default value is used. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsSetEpsLin` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsSetEpsLin``. .. c:function:: int IDASetLSNormFactor(void * ida_mem, sunrealtype nrmfac) @@ -2849,13 +2830,10 @@ The following optional outputs are available from the IDALS modules: ``SUNLinearSolver`` object attached to it. The template Jacobian matrix allocated by the user outside of IDALS is not included in this report. - .. warning:: + .. versionadded:: 3.0.0 - The previous routines :c:func:`IDADlsGetWorkspace` and :c:func:`IDASpilsGetWorkspace` - are now wrappers for this routine, and may still be used for - backward-compatibility. However, these will be deprecated in future - releases, so we recommend that users transition to the new routine name - soon. + Replaces the deprecated functions ``IDADlsGetWorkspace`` and + ``IDASpilsGetWorkspace``. .. c:function:: int IDAGetNumJacEvals(void * ida_mem, long int * njevals) @@ -2871,12 +2849,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDADlsGetNumJacEvals` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDADlsGetNumJacEvals``. .. c:function:: int IDAGetNumLinResEvals(void * ida_mem, long int * nrevalsLS) @@ -2898,9 +2873,10 @@ The following optional outputs are available from the IDALS modules: The value ``nrevalsLS`` is incremented only if one of the default internal difference quotient functions is used. - .. warning:: + .. versionadded:: 3.0.0 - The previous routines :c:func:`IDADlsGetNumRhsEvals` and :c:func:`IDASpilsGetNumRhsEvals` are now deprecated. + Replaces the deprecated functions ``IDADlsGetNumRhsEvals`` and + ``IDASpilsGetNumRhsEvals``. .. c:function:: int IDAGetNumLinIters(void * ida_mem, long int * nliters) @@ -2917,12 +2893,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumLinIters` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumLinIters``. .. c:function:: int IDAGetNumLinConvFails(void * ida_mem, long int * nlcfails) @@ -2938,12 +2911,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumConvFails` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumConvFails``. .. c:function:: int IDAGetNumPrecEvals(void * ida_mem, long int * npevals) @@ -2959,12 +2929,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumPrecEvals` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumPrecEvals``. .. c:function:: int IDAGetNumPrecSolves(void * ida_mem, long int * npsolves) @@ -2980,12 +2947,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumPrecSolves` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumPrecSolves``. .. c:function:: int IDAGetNumJTSetupEvals(void * ida_mem, long int * njtsetup) @@ -3001,12 +2965,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumJTSetupEvals` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumJTSetupEvals``. .. c:function:: int IDAGetNumJtimesEvals(void * ida_mem, long int * njvevals) @@ -3022,12 +2983,9 @@ The following optional outputs are available from the IDALS modules: * ``IDALS_MEM_NULL`` -- The ``ida_mem`` pointer is ``NULL``. * ``IDALS_LMEM_NULL`` -- The IDALS linear solver has not been initialized. - .. warning:: + .. versionadded:: 3.0.0 - The previous routine :c:func:`IDASpilsGetNumJtimesEvals` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``IDASpilsGetNumJtimesEvals``. .. c:function:: int IDAGetLastLinFlag(void * ida_mem, long int * lsflag) @@ -3065,13 +3023,10 @@ The following optional outputs are available from the IDALS modules: (SPGMR and SPFGMR only); or ``SUN_ERR_EXT_FAIL``, indicating an unrecoverable failure in an external iterative linear solver package. - .. warning:: + .. versionadded:: 3.0.0 - The previous routines :c:func:`IDADlsGetLastFlag` and :c:func:`IDASpilsGetLastFlag` - are now wrappers for this routine, and may still be used for - backward-compatibility. However, these will be deprecated in future - releases, so we recommend that users transition to the new routine name - soon. + Replaces the deprecated functions ``IDADlsGetLastFlag`` and + ``IDASpilsGetLastFlag``. .. c:function:: char* IDAGetLinReturnFlagName(long int lsflag) @@ -3086,13 +3041,10 @@ The following optional outputs are available from the IDALS modules: :math:`1 \leq \mathtt{lsflag} \leq N` (LU factorization failed), this function returns "NONE". - .. warning:: + .. versionadded:: 3.0.0 - The previous routines :c:func:`IDADlsGetReturnFlagName` and - :c:func:`IDASpilsGetReturnFlagName` are now wrappers for this routine, and may - still be used for backward-compatibility. However, these will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated functions ``IDADlsGetReturnFlagName`` and + ``IDASpilsGetReturnFlagName``. .. _IDAS.Usage.SIM.user_callable.reinit: @@ -3437,12 +3389,9 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: ``SUNMATRIX_SPARSE`` type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - .. warning:: + .. versionadded:: 3.0.0 - The previous function type :c:func:`IDADlsJacFn` is identical to :c:func:`IDALsJacFn`, - and may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new function type name soon. + Replaces the deprecated type ``IDADlsJacFn``. .. _IDAS.Usage.SIM.user_supplied.jtimesFn: @@ -3497,13 +3446,9 @@ the default is a difference quotient approximation to these products. :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: + .. versionadded:: 3.0.0 - The previous function type :c:func:`IDASpilsJacTimesVecFn` is identical to - :c:func:`IDALsJacTimesVecFn`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``IDASpilsJacTimesVecFn``. .. _IDAS.Usage.SIM.user_supplied.jtsetupFn: @@ -3553,14 +3498,9 @@ follows: :numref:`IDAS.Usage.SIM.user_callable.optional_output.main`. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: - - The previous function type :c:func:`IDASpilsJacTimesSetupFn` is identical to - :c:func:`IDALsJacTimesSetupFn`, and may still be used for - backward-compatibility. However, this will be deprecated in future - releases, so we recommend that users transition to the new function type - name soon. + .. versionadded:: 3.0.0 + Replaces the deprecated type ``IDASpilsJacTimesSetupFn`` .. _IDAS.Usage.SIM.user_supplied.psolveFn: diff --git a/doc/idas/guide/source/conf.py b/doc/idas/guide/source/conf.py index 701f4d9e22..8613adcf6a 100644 --- a/doc/idas/guide/source/conf.py +++ b/doc/idas/guide/source/conf.py @@ -11,8 +11,8 @@ # ------------------------------------------------------------------------------ import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/install_guide/source/conf.py b/doc/install_guide/source/conf.py index 211d28657c..34d91a697c 100644 --- a/doc/install_guide/source/conf.py +++ b/doc/install_guide/source/conf.py @@ -12,8 +12,8 @@ from posixpath import supports_unicode_filenames import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/kinsol/guide/Makefile b/doc/kinsol/guide/Makefile index d0c3cbf102..8b6275ab8c 100644 --- a/doc/kinsol/guide/Makefile +++ b/doc/kinsol/guide/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= +SPHINXOPTS ?= -W --keep-going SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index 1079ea0b25..17d89da5c3 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -373,12 +373,10 @@ pertinent to their choice of linear solver. size (see the documentation of the particular ``SUNMatrix`` type in Chapter :numref:`SUNMatrix` for further information). - The previous routines :c:func:`KINDlsSetLinearSolver` and - :c:func:`KINSpilsSetLinearSolver` are - now wrappers for this routine, and may still be used for - backward-compatibility. However, these will be deprecated in future - releases, so we recommend that users transition to the new routine name - soon. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``KINDlsSetLinearSolver`` and + ``KINSpilsSetLinearSolver``. .. _KINSOL.Usage.CC.kin: @@ -1146,12 +1144,9 @@ pointer ``user_data`` may be specified through :c:func:`KINSetUserData`. this default function is used. An error will occur if no ``jac`` is supplied when using other matrix types. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`KINDlsSetJacFn` is now a wrapper for this routine, - and may still be used for backward-compatibility. However, this will be - deprecated in future releases, so we recommend that users transition to - the new routine name soon. + Replaces the deprecated function ``KINDlsSetJacFn``. When using matrix-free linear solver modules, the KINLS linear solver @@ -1190,11 +1185,11 @@ user-supplied functions without using global data in the program. must be called after the KINLS linear solver interface has been initialized through a call to :c:func:`KINSetLinearSolver`. The function type :c:type:`KINLsJacTimesVecFn` is described in - :numref:`KINSOL.Usage.CC.user_fct_sim.jtimesFn`. The previous - routine :c:func:`KINSpilsSetJacTimesVecFn` is now a wrapper for this - routine, and may still be used for backward-compatibility. However, this - will be deprecated in future releases, so we recommend that users - transition to the new routine name soon. + :numref:`KINSOL.Usage.CC.user_fct_sim.jtimesFn`. + + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``KINSpilsSetJacTimesVecFn``. When using the internal difference quotient the user may optionally supply an @@ -1270,12 +1265,9 @@ global data in the program. This function must be called after the KINLS linear solver interface has been initialized through a call to :c:func:`KINSetLinearSolver`. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`KINSpilsSetPreconditioner` is now a wrapper for - this routine, and may still be used for backward-compatibility. However, - this will be removed in future releases, so we recommend that users - transition to the new routine name soon. + Replaces the deprecated function ``KINSpilsSetPreconditioner``. .. _KINSOL.Usage.CC.optional_output: @@ -1564,10 +1556,10 @@ The following optional outputs are available from the KINLS modules: ``SUNLinearSolver`` object attached to it. The template Jacobian matrix allocated by the user outside of KINLS is not included in this report. - .. warning:: + .. versionadded:: 4.0.0 - The previous routines :c:func:`KINDlsGetWorkspace` and :c:func:`KINSpilsGetWorkspace` - are now deprecated. + Replaces the deprecated function ``KINDlsGetWorkspace`` and + ``KINSpilsGetWorkspace``. .. c:function:: int KINGetNumJacEvals(void * kin_mem, long int * njevals) @@ -1584,10 +1576,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: - - The previous routine :c:func:`KINDlsGetNumJacEvals` is now deprecated, + .. versionadded:: 4.0.0 + Replaces the deprecated function ``KINDlsGetNumJacEvals``. .. c:function:: int KINGetNumLinFuncEvals(void * kin_mem, long int * nrevalsLS) @@ -1609,9 +1600,10 @@ The following optional outputs are available from the KINLS modules: The value ``nrevalsLS`` is incremented only if one of the default internal difference quotient functions is used. - .. warning:: - The previous routines :c:func:`KINDlsGetNumRhsEvals` and - :c:func:`KINSpilsGetNumRhsEvals` are now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated functions ``KINDlsGetNumRhsEvals`` and + ``KINSpilsGetNumRhsEvals``. .. c:function:: int KINGetNumLinIters(void * kin_mem, long int * nliters) @@ -1628,8 +1620,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: - The previous routine :c:func:`KINSpilsGetNumLinIters` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``KINSpilsGetNumLinIters``. .. c:function:: int KINGetNumLinConvFails(void * kin_mem, long int * nlcfails) @@ -1646,8 +1639,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: - The previous routine :c:func:`KINSpilsGetNumConvFails` is now deprecated. + .. versionadded:: 4.0.0 + + Replaces the deprecated function ``KINSpilsGetNumConvFails``. .. c:function:: int KINGetNumPrecEvals(void * kin_mem, long int * npevals) @@ -1664,9 +1658,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`KINSpilsGetNumPrecEvals` is now deprecated. + Replaces the deprecated function ``KINSpilsGetNumPrecEvals``. .. c:function:: int KINGetNumPrecSolves(void * kin_mem, long int * npsolves) @@ -1683,9 +1677,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`KINSpilsGetNumPrecSolves` is now deprecated. + Replaces the deprecated function ``KINSpilsGetNumPrecSolves``. .. c:function:: int KINGetNumJtimesEvals(void * kin_mem, long int * njvevals) @@ -1702,9 +1696,9 @@ The following optional outputs are available from the KINLS modules: * ``KINLS_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. * ``KINLS_LMEM_NULL`` -- The KINLS linear solver has not been initialized. - .. warning:: + .. versionadded:: 4.0.0 - The previous routine :c:func:`KINSpilsGetNumJtimesEvals` is now deprecated. + Replaces the deprecated function ``KINSpilsGetNumJtimesEvals``. .. c:function:: int KINGetLastLinFlag(void * kin_mem, long int * lsflag) @@ -1746,10 +1740,10 @@ The following optional outputs are available from the KINLS modules: ``SUN_ERR_EXT_FAIL``, indicating an unrecoverable failure in an external iterative linear solver package. - .. warning:: + .. versionadded:: 4.0.0 - The previous routines :c:func:`KINDlsGetLastFlag` and :c:func:`KINSpilsGetLastFlag` - are now deprecated. + Replaces the deprecated functions ``KINDlsGetLastFlag`` and + ``KINSpilsGetLastFlag``. .. c:function:: char* KINGetLinReturnFlagName(long int lsflag) @@ -1765,10 +1759,10 @@ The following optional outputs are available from the KINLS modules: :math:`1 \leq \mathtt{lsflag} \leq N` (LU factorization failed), this function returns "NONE". - .. warning:: + .. versionadded:: 4.0.0 - The previous routines :c:func:`KINDlsGetReturnFlagName` and - :c:func:`KINSpilsGetReturnFlagName` are now deprecated. + Replaces the deprecated functions ``KINDlsGetReturnFlagName`` and + ``KINSpilsGetReturnFlagName``. .. _KINSOL.Usage.CC.user_fct_sim: @@ -1931,12 +1925,9 @@ provide a function of type :c:type:`KINLsJacFn` defined as follows: ``SUNSparseMatrix_NNZ``. The ``SUNMATRIX_SPARSE`` type and accessor macros are documented in :numref:`SUNMatrix.Sparse`. - .. warning:: + .. versionadded:: 4.0.0 - The previous function type :c:func:`KINDlsJacFn` is identical to - :c:type:`KINLsJacFn`, and may still be used for backward-compatibility. - However, this will be deprecated in future releases, so we recommend that - users transition to the new function type name soon. + Replaces the deprecated type ``KINDlsJacFn``. .. _KINSOL.Usage.CC.user_fct_sim.jtimesFn: @@ -1983,13 +1974,9 @@ supplied, the default is a difference quotient approximation to these products. and/or ``f_scale`` as needed. The unit roundoff can be accessed as ``SUN_UNIT_ROUNDOFF`` defined in ``sundials_types.h``. - .. warning:: + .. versionadded:: 4.0.0 - The previous function type :c:type:`KINSpilsJacTimesVecFn` is identical to - :c:type:`KINLsJacTimesVecFn`, and may still be used for - backward-compatibility. However, this will be removed in future - releases, so we recommend that users transition to the new function type - name soon. + Replaces the deprecated type ``KINSpilsJacTimesVecFn``. .. _KINSOL.Usage.CC.user_fct_sim.psolveFn: diff --git a/doc/kinsol/guide/source/conf.py b/doc/kinsol/guide/source/conf.py index 366c1af7d6..c8cef7c6ac 100644 --- a/doc/kinsol/guide/source/conf.py +++ b/doc/kinsol/guide/source/conf.py @@ -11,8 +11,8 @@ # ------------------------------------------------------------------------------ import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../../shared'))) # -- General configuration ---------------------------------------------------- @@ -34,6 +34,11 @@ intersphinx_mapping = {'sundials': (f'https://sundials.readthedocs.io/en/{doc_version}', ('../../../superbuild/build/html/objects.inv', None))} +# Ignore warnings from nonlinear solver references in change log +nitpick_ignore.extend([('c:func', 'SUNNonlinSolSysFn'), + ('c:func', 'SUNNonlinSolLSetupFn'), + ('c:func', 'SUNNonlinSolLSolveFn')]) + # References bibtex_bibfiles = ['../../../shared/sundials.bib'] diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index 5fbdca2733..df27c93672 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -159,8 +159,8 @@ The module NVECTOR_CUDA also provides the following user-callable routines: This function sets the execution policies which control the kernel parameters utilized when launching the streaming and reduction CUDA kernels. By default - the vector is setup to use the :cpp:func:`SUNCudaThreadDirectExecPolicy` and - :cpp:func:`SUNCudaBlockReduceAtomicExecPolicy`. Any custom execution policy + the vector is setup to use the ``SUNCudaThreadDirectExecPolicy`` and + ``SUNCudaBlockReduceAtomicExecPolicy``. Any custom execution policy for reductions must ensure that the grid dimensions (number of thread blocks) is a multiple of the CUDA warp size (32). See :numref:`NVectors.CUDA.SUNCudaExecPolicy` below for more information about @@ -288,7 +288,6 @@ options as the vector they are cloned from while vectors created with The ``SUNCudaExecPolicy`` Class -------------------------------- - In order to provide maximum flexibility to users, the CUDA kernel execution parameters used by kernels within SUNDIALS are defined by objects of the ``sundials::cuda::ExecPolicy`` abstract class type (this class can be accessed in the global namespace as ``SUNCudaExecPolicy``). @@ -300,27 +299,23 @@ Thus, users may provide custom execution policies that fit the needs of their pr where the ``sundials::cuda::ExecPolicy`` class is defined in the header file ``sundials_cuda_policies.hpp``, as follows: -.. code-block:: c++ +.. cpp:class:: sundials::cuda::ExecPolicy - class ExecPolicy - { - public: - ExecPolicy(cudaStream_t stream = 0) : stream_(stream) { } - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const = 0; - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const = 0; - virtual const cudaStream_t* stream() const { return (&stream_); } - virtual ExecPolicy* clone() const = 0; - ExecPolicy* clone_new_stream(cudaStream_t stream) const { - ExecPolicy* ex = clone(); - ex->stream_ = stream; - return ex; - } - virtual bool atomic() const { return false; } - virtual ~ExecPolicy() {} - protected: - cudaStream_t stream_; - }; + .. cpp:function:: ExecPolicy(cudaStream_t stream = 0) + + .. cpp:function:: virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) + + .. cpp:function:: virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) + + .. cpp:function:: virtual const cudaStream_t* stream() const + + .. cpp:function:: virtual ExecPolicy* clone() const + + .. cpp:function:: ExecPolicy* clone_new_stream(cudaStream_t stream) const + + .. cpp:function:: virtual bool atomic() const + .. cpp:function:: virtual ~ExecPolicy() To define a custom execution policy, a user simply needs to create a class that inherits from the abstract class and implements the methods. The SUNDIALS diff --git a/doc/shared/nvectors/NVector_Description.rst b/doc/shared/nvectors/NVector_Description.rst index f9ca95f18c..c4d5eb7054 100644 --- a/doc/shared/nvectors/NVector_Description.rst +++ b/doc/shared/nvectors/NVector_Description.rst @@ -17,101 +17,266 @@ Description of the NVECTOR Modules ================================== -The SUNDIALS solvers are written in a data-independent manner. They -all operate on generic vectors (of type ``N_Vector``) through a set of -operations defined by, and specific to, the particular NVECTOR -implementation. Users can provide a custom implementation of the -NVECTOR module or use one provided within SUNDIALS. The generic -operations are described below. In the sections following, the -implementations provided with SUNDIALS are described. - -The generic ``N_Vector`` type is a pointer to a structure that has an -implementation-dependent *content* field containing the description -and actual data of the vector, and an *ops* field pointing to a -structure with generic vector operations. The type ``N_Vector`` is -defined as +SUNDIALS solvers are written in a data-independent manner. They all operate on +generic vectors (of type :c:type:`N_Vector`) through a set of operations defined +by, and specific to, the particular vector implementation. Users can provide a +custom vector implementation or use one provided with SUNDIALS. The generic +operations are described below. In the sections following, the implementations +provided with SUNDIALS are described. + +An :c:type:`N_Vector` is a pointer to the :c:struct:`_generic_N_Vector` +structure: .. c:type:: struct _generic_N_Vector *N_Vector -and the generic structure is defined as +.. c:struct:: _generic_N_Vector -.. code-block:: c + The structure defining the SUNDIALS vector class. - struct _generic_N_Vector { - void *content; - struct _generic_N_Vector_Ops *ops; - }; + .. c:member:: void *content -Here, the ``_generic_N_Vector_Op`` structure is essentially a list of -function pointers to the various actual vector operations, and is -defined as + Pointer to vector-specific member data. -.. code-block:: c + .. c:member:: N_Vector_Ops ops + + A virtual table of vector operations provided by a specific + implementation. + + .. c:member:: SUNContext sunctx + + The SUNDIALS simulation context + +The virtual table structure is defined as + +.. c:type:: _generic_N_Vector_Ops *N_Vector_Ops + +.. c:struct:: _generic_N_Vector_Ops + + The structure defining :c:type:`N_Vector` operations. + + .. c:member:: N_Vector_ID (*nvgetvectorid)(N_Vector) + + The function implementing :c:func:`N_VGetVectorID` + + .. c:member:: N_Vector (*nvclone)(N_Vector) + + The function implementing :c:func:`N_VClone` + + .. c:member:: N_Vector (*nvcloneempty)(N_Vector) + + The function implementing :c:func:`N_VCloneEmpty` + + .. c:member:: void (*nvdestroy)(N_Vector) + + The function implementing :c:func:`N_VDestroy` + + .. c:member:: void (*nvspace)(N_Vector, sunindextype*, sunindextype*) + + The function implementing :c:func:`N_VSpace` + + .. c:member:: sunrealtype* (*nvgetarraypointer)(N_Vector) + + The function implementing :c:func:`N_VGetArrayPointer` + + .. c:member:: sunrealtype* (*nvgetdevicearraypointer)(N_Vector) + + The function implementing :c:func:`N_VGetDeviceArrayPointer` + + .. c:member:: void (*nvsetarraypointer)(sunrealtype*, N_Vector) + + The function implementing :c:func:`N_VSetArrayPointer` + + .. c:member:: SUNComm (*nvgetcommunicator)(N_Vector) + + The function implementing :c:func:`N_VGetCommunicator` + + .. c:member:: sunindextype (*nvgetlength)(N_Vector) + + The function implementing :c:func:`N_VGetLength` + + .. c:member:: sunindextype (*nvgetlocallength)(N_Vector) + + The function implementing :c:func:`N_VGetLocalLength` + + .. c:member:: void (*nvlinearsum)(sunrealtype, N_Vector, sunrealtype, N_Vector, N_Vector) + + The function implementing :c:func:`N_VLinearSum` + + .. c:member:: void (*nvconst)(sunrealtype, N_Vector) + + The function implementing :c:func:`N_VConst` + + .. c:member:: void (*nvprod)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VProd` + + .. c:member:: void (*nvdiv)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VDiv` + + .. c:member:: void (*nvscale)(sunrealtype, N_Vector, N_Vector) + + The function implementing :c:func:`N_VScale` + + .. c:member:: void (*nvabs)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VAbs` + + .. c:member:: void (*nvinv)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VInv` + + .. c:member:: void (*nvaddconst)(N_Vector, sunrealtype, N_Vector) + + The function implementing :c:func:`N_VAddConst` + + .. c:member:: sunrealtype (*nvdotprod)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VDotProd` + + .. c:member:: sunrealtype (*nvmaxnorm)(N_Vector) + + The function implementing :c:func:`N_VMaxNorm` + + .. c:member:: sunrealtype (*nvwrmsnorm)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VWrmsNorm` + + .. c:member:: sunrealtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VWrmsNormMask` + + .. c:member:: sunrealtype (*nvmin)(N_Vector) + + The function implementing :c:func:`N_VMin` + + .. c:member:: sunrealtype (*nvwl2norm)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VWL2Norm` + + .. c:member:: sunrealtype (*nvl1norm)(N_Vector) - struct _generic_N_Vector_Ops { - N_Vector_ID (*nvgetvectorid)(N_Vector); - N_Vector (*nvclone)(N_Vector); - N_Vector (*nvcloneempty)(N_Vector); - void (*nvdestroy)(N_Vector); - void (*nvspace)(N_Vector, sunindextype*, sunindextype*); - sunrealtype* (*nvgetarraypointer)(N_Vector); - sunrealtype* (*nvgetdevicearraypointer)(N_Vector); - void (*nvsetarraypointer)(sunrealtype*, N_Vector); - SUNComm (*nvgetcommunicator)(N_Vector); - sunindextype (*nvgetlength)(N_Vector); - sunindextype (*nvgetlocallength)(N_Vector); - void (*nvlinearsum)(sunrealtype, N_Vector, sunrealtype, N_Vector, N_Vector); - void (*nvconst)(sunrealtype, N_Vector); - void (*nvprod)(N_Vector, N_Vector, N_Vector); - void (*nvdiv)(N_Vector, N_Vector, N_Vector); - void (*nvscale)(sunrealtype, N_Vector, N_Vector); - void (*nvabs)(N_Vector, N_Vector); - void (*nvinv)(N_Vector, N_Vector); - void (*nvaddconst)(N_Vector, sunrealtype, N_Vector); - sunrealtype (*nvdotprod)(N_Vector, N_Vector); - sunrealtype (*nvmaxnorm)(N_Vector); - sunrealtype (*nvwrmsnorm)(N_Vector, N_Vector); - sunrealtype (*nvwrmsnormmask)(N_Vector, N_Vector, N_Vector); - sunrealtype (*nvmin)(N_Vector); - sunrealtype (*nvwl2norm)(N_Vector, N_Vector); - sunrealtype (*nvl1norm)(N_Vector); - void (*nvcompare)(sunrealtype, N_Vector, N_Vector); - sunbooleantype (*nvinvtest)(N_Vector, N_Vector); - sunbooleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector); - sunrealtype (*nvminquotient)(N_Vector, N_Vector); - SUNErrCode (*nvlinearcombination)(int, sunrealtype*, N_Vector*, N_Vector); - SUNErrCode (*nvscaleaddmulti)(int, sunrealtype*, N_Vector, N_Vector*, - N_Vector*); - SUNErrCode (*nvdotprodmulti)(int, N_Vector, N_Vector*, sunrealtype*); - SUNErrCode (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector*, sunrealtype, - N_Vector*, N_Vector*); - SUNErrCode (*nvscalevectorarray)(int, sunrealtype*, N_Vector*, N_Vector*); - SUNErrCode (*nvconstvectorarray)(int, sunrealtype, N_Vector*); - SUNErrCode (*nvwrmsnormvectorarray)(int, N_Vector*, N_Vector*, sunrealtype*); - SUNErrCode (*nvwrmsnormmaskvectorarray)(int, N_Vector*, N_Vector*, N_Vector, - sunrealtype*); - SUNErrCode (*nvscaleaddmultivectorarray)(int, int, sunrealtype*, N_Vector*, - N_Vector**, N_Vector**); - SUNErrCode (*nvlinearcombinationvectorarray)(int, int, sunrealtype*, - N_Vector**, N_Vector*); - sunrealtype (*nvdotprodlocal)(N_Vector, N_Vector); - sunrealtype (*nvmaxnormlocal)(N_Vector); - sunrealtype (*nvminlocal)(N_Vector); - sunrealtype (*nvl1normlocal)(N_Vector); - sunbooleantype (*nvinvtestlocal)(N_Vector, N_Vector); - sunbooleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector); - sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector); - sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector); - sunrealtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector); - SUNErrCode (*nvdotprodmultilocal)(int, N_Vector, N_Vector*, sunrealtype*); - SUNErrCode (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype*); - SUNErrCode (*nvbufsize)(N_Vector, sunindextype*); - SUNErrCode (*nvbufpack)(N_Vector, void*); - SUNErrCode (*nvbufunpack)(N_Vector, void*); - void (*nvprint)(N_Vector); - void (*nvprintfile)(N_Vector, FILE*); - }; + The function implementing :c:func:`N_VL1Norm` + .. c:member:: void (*nvcompare)(sunrealtype, N_Vector, N_Vector) + + The function implementing :c:func:`N_VCompare` + + .. c:member:: sunbooleantype (*nvinvtest)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VInvTest` + + .. c:member:: sunbooleantype (*nvconstrmask)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VConstrMask` + + .. c:member:: sunrealtype (*nvminquotient)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VMinQuotient` + + .. c:member:: SUNErrCode (*nvlinearcombination)(int, sunrealtype*, N_Vector*, N_Vector) + + The function implementing :c:func:`N_VLinearCombination` + + .. c:member:: SUNErrCode (*nvscaleaddmulti)(int, sunrealtype*, N_Vector, N_Vector*, N_Vector*) + + The function implementing :c:func:`N_VScaleAddMulti` + + .. c:member:: SUNErrCode (*nvdotprodmulti)(int, N_Vector, N_Vector*, sunrealtype*) + + The function implementing :c:func:`N_VDotProdMulti` + + .. c:member:: SUNErrCode (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector*, sunrealtype, N_Vector*, N_Vector*) + + The function implementing :c:func:`N_VLinearSumVectorArray` + + .. c:member:: SUNErrCode (*nvscalevectorarray)(int, sunrealtype*, N_Vector*, N_Vector*) + + The function implementing :c:func:`N_VScaleVectorArray` + + .. c:member:: SUNErrCode (*nvconstvectorarray)(int, sunrealtype, N_Vector*) + + The function implementing :c:func:`N_VConstVectorArray` + + .. c:member:: SUNErrCode (*nvwrmsnormvectorarray)(int, N_Vector*, N_Vector*, sunrealtype*) + + The function implementing :c:func:`N_VWrmsNormVectorArray` + + .. c:member:: SUNErrCode (*nvwrmsnormmaskvectorarray)(int, N_Vector*, N_Vector*, N_Vector, sunrealtype*) + + The function implementing :c:func:`N_VWrmsNormMaskVectorArray` + + .. c:member:: SUNErrCode (*nvscaleaddmultivectorarray)(int, int, sunrealtype*, N_Vector*, N_Vector**, N_Vector**) + + The function implementing :c:func:`N_VScaleAddMultiVectorArray` + + .. c:member:: SUNErrCode (*nvlinearcombinationvectorarray)(int, int, sunrealtype*, N_Vector**, N_Vector*) + + The function implementing :c:func:`N_VLinearCombinationVectorArray` + + .. c:member:: sunrealtype (*nvdotprodlocal)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VDotProdLocal` + + .. c:member:: sunrealtype (*nvmaxnormlocal)(N_Vector) + + The function implementing :c:func:`N_VMaxNormLocal` + + .. c:member:: sunrealtype (*nvminlocal)(N_Vector) + + The function implementing :c:func:`N_VMinLocal` + + .. c:member:: sunrealtype (*nvl1normlocal)(N_Vector) + + The function implementing :c:func:`N_VL1NormLocal` + + .. c:member:: sunbooleantype (*nvinvtestlocal)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VInvTestLocal` + + .. c:member:: sunbooleantype (*nvconstrmasklocal)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VConstrMaskLocal` + + .. c:member:: sunrealtype (*nvminquotientlocal)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VMinQuotientLocal` + + .. c:member:: sunrealtype (*nvwsqrsumlocal)(N_Vector, N_Vector) + + The function implementing :c:func:`N_VWSqrSumLocal` + + .. c:member:: sunrealtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector) + + The function implementing :c:func:`N_VWSqrSumMaskLocal` + + .. c:member:: SUNErrCode (*nvdotprodmultilocal)(int, N_Vector, N_Vector*, sunrealtype*) + + The function implementing :c:func:`N_VDotProdMultiLocal` + + .. c:member:: SUNErrCode (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype*) + + The function implementing :c:func:`N_VDotProdMultiAllReduce` + + .. c:member:: SUNErrCode (*nvbufsize)(N_Vector, sunindextype*) + + The function implementing :c:func:`N_VBufSize` + + .. c:member:: SUNErrCode (*nvbufpack)(N_Vector, void*) + + The function implementing :c:func:`N_VBufPack` + + .. c:member:: SUNErrCode (*nvbufunpack)(N_Vector, void*) + + The function implementing :c:func:`N_VBufUnpack` + + .. c:member:: void (*nvprint)(N_Vector) + + The function implementing :c:func:`N_VPrint` + + .. c:member:: void (*nvprintfile)(N_Vector, FILE*) + + The function implementing :c:func:`N_VPrintFile` The generic NVECTOR module defines and implements the vector operations acting on a ``N_Vector``. These routines are nothing but @@ -359,11 +524,13 @@ to be set, and that all operations are copied when cloning a vector. **Return value:** Returns a :c:type:`SUNErrCode`. -Each NVECTOR implementation included in SUNDIALS has a unique -identifier specified in enumeration and shown in -:numref:`NVectors.Description.vectorIDs`. -It is recommended that a user supplied NVECTOR implementation use the -``SUNDIALS_NVEC_CUSTOM`` identifier. + +.. c:enum:: N_Vector_ID + + Each :c:type:`N_Vector` implementation included in SUNDIALS has a unique + identifier specified in enumeration and shown in + :numref:`NVectors.Description.vectorIDs`. It is recommended that a user + supplied NVECTOR implementation use the ``SUNDIALS_NVEC_CUSTOM`` identifier. .. _NVectors.Description.vectorIDs: diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index 5a2cac0d2a..f722e9cfac 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -92,7 +92,7 @@ operations defined in :numref:`NVectors.Ops`, :numref:`NVectors.Ops.Fused`, The names of vector operations are obtained from those in :numref:`NVectors.Ops`, :numref:`NVectors.Ops.Fused`, :numref:`NVectors.Ops.Array`, and :numref:`NVectors.Ops.Local` by appending the suffix ``_Hip`` -(e.g. :c:func:`N_VDestroy_Hip`). The module NVECTOR_HIP provides the +(e.g. ``N_VDestroy_Hip``). The module NVECTOR_HIP provides the following additional user-callable routines: @@ -271,7 +271,6 @@ options as the vector they are cloned from while vectors created with The ``SUNHipExecPolicy`` Class -------------------------------- - In order to provide maximum flexibility to users, the HIP kernel execution parameters used by kernels within SUNDIALS are defined by objects of the ``sundials::hip::ExecPolicy`` abstract class type (this class can be accessed in the global namespace as ``SUNHipExecPolicy``). @@ -283,28 +282,23 @@ Thus, users may provide custom execution policies that fit the needs of their pr where the ``sundials::hip::ExecPolicy`` class is defined in the header file ``sundials_hip_policies.hpp``, as follows: -.. code-block:: c++ +.. cpp:class:: sundials::hip::ExecPolicy - class ExecPolicy - { - public: - ExecPolicy(hipStream_t stream = 0) : stream_(stream) { } - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const = 0; - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const = 0; - virtual const hipStream_t* stream() const { return (&stream_); } - virtual ExecPolicy* clone() const = 0; - ExecPolicy* clone_new_stream(hipStream_t stream) const { - ExecPolicy* ex = clone(); - ex->stream_ = stream; - return ex; - } - virtual bool atomic() const { return false; } - virtual ~ExecPolicy() {} - protected: - hipStream_t stream_; - }; + .. cpp:function:: ExecPolicy(hipStream_t stream = 0) + + .. cpp:function:: virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) + + .. cpp:function:: virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) + + .. cpp:function:: virtual const hipStream_t* stream() const + + .. cpp:function:: virtual ExecPolicy* clone() const + + .. cpp:function:: ExecPolicy* clone_new_stream(hipStream_t stream) const + .. cpp:function:: virtual bool atomic() const + .. cpp:function:: virtual ~ExecPolicy() To define a custom execution policy, a user simply needs to create a class that inherits from the abstract class and implements the methods. The SUNDIALS provided diff --git a/doc/shared/nvectors/NVector_Kokkos.rst b/doc/shared/nvectors/NVector_Kokkos.rst index b9a47f7539..1879a7c130 100644 --- a/doc/shared/nvectors/NVector_Kokkos.rst +++ b/doc/shared/nvectors/NVector_Kokkos.rst @@ -102,6 +102,13 @@ class. Vector : public sundials::impl::BaseNVector, \ public sundials::ConvertibleTo<N_Vector> + .. cpp:type:: view_type = Kokkos::View<sunrealtype*, MemorySpace>; + .. cpp:type:: size_type = typename view_type::size_type; + .. cpp:type:: host_view_type = typename view_type::HostMirror; + .. cpp:type:: memory_space = MemorySpace; + .. cpp:type:: exec_space = typename MemorySpace::execution_space; + .. cpp:type:: range_policy = Kokkos::RangePolicy<exec_space>; + .. cpp:function:: Vector() = default Default constructor -- the vector must be copied or moved to. diff --git a/doc/shared/nvectors/NVector_MPIManyVector.rst b/doc/shared/nvectors/NVector_MPIManyVector.rst index 6008e50994..fdaeaf31c9 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -302,12 +302,11 @@ them to the MPIManyVector in :c:func:`N_VNew_MPIManyVector` or **Notes** * :c:func:`N_VNew_MPIManyVector` and :c:func:`N_VMake_MPIManyVector` set - the field ``own_data = SUNFALSE``. - :c:func:`N_VDestroy_MPIManyVector()` will not attempt to call - :c:func:`N_VDestroy()` on any subvectors contained in the - subvector array for any ``N_Vector`` with ``own_data`` set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the subvectors. + the field ``own_data = SUNFALSE``. The MPIManyVector implementation of + :c:func:`N_VDestroy` will not attempt to call :c:func:`N_VDestroy` on any + subvectors contained in the subvector array for any ``N_Vector`` with + ``own_data`` set to ``SUNFALSE``. In such a case, it is the user's + responsibility to deallocate the subvectors. * To maximize efficiency, arithmetic vector operations in the NVECTOR_MPIMANYVECTOR implementation that have more than one diff --git a/doc/shared/nvectors/NVector_MPIPlusX.rst b/doc/shared/nvectors/NVector_MPIPlusX.rst index 66e7c11fbf..88905edd50 100644 --- a/doc/shared/nvectors/NVector_MPIPlusX.rst +++ b/doc/shared/nvectors/NVector_MPIPlusX.rst @@ -126,9 +126,9 @@ local vector. **Notes** * :c:func:`N_VMake_MPIPlusX` sets the field ``own_data = SUNFALSE`` and - :c:func:`N_VDestroy_MPIPlusX()` will not call :c:func:`N_VDestroy()` on the - local vector. In this a case, it is the user's responsibility to deallocate - the local vector. + the MPIPlusX implementation of :c:func:`N_VDestroy` will not call + :c:func:`N_VDestroy` on the local vector. In this a case, it is the user's + responsibility to deallocate the local vector. * To maximize efficiency, arithmetic vector operations in the NVECTOR_MPIPLUSX implementation that have more than one diff --git a/doc/shared/nvectors/NVector_ManyVector.rst b/doc/shared/nvectors/NVector_ManyVector.rst index 639a286ea5..cded89fd73 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -240,13 +240,11 @@ them to the ManyVector in :c:func:`N_VNew_ManyVector`. **Notes** -* :c:func:`N_VNew_ManyVector` sets - the field ``own_data = SUNFALSE``. - :c:func:`N_VDestroy_ManyVector()` will not attempt to call - :c:func:`N_VDestroy()` on any subvectors contained in the - subvector array for any ``N_Vector`` with ``own_data`` set to - ``SUNFALSE``. In such a case, it is the user's responsibility to - deallocate the subvectors. +* :c:func:`N_VNew_ManyVector` sets the field ``own_data = SUNFALSE``. The + ManyVector implementation of :c:func:`N_VDestroy` will not attempt to call + :c:func:`N_VDestroy` on any subvectors contained in the subvector array for + any ``N_Vector`` with ``own_data`` set to ``SUNFALSE``. In such a case, it is + the user's responsibility to deallocate the subvectors. * To maximize efficiency, arithmetic vector operations in the NVECTOR_MANYVECTOR implementation that have more than one diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index 1275654279..4f84694770 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -276,7 +276,7 @@ options as the vector they are cloned from while vectors created with loop than it is to use ``NV_Ith_OMP(v,i)`` within the loop. * :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 + *own_data* to ``SUNFALSE``. The implemenation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/nvectors/NVector_OpenMPDEV.rst b/doc/shared/nvectors/NVector_OpenMPDEV.rst index 9bca572c6f..9dabeba2d7 100644 --- a/doc/shared/nvectors/NVector_OpenMPDEV.rst +++ b/doc/shared/nvectors/NVector_OpenMPDEV.rst @@ -287,10 +287,10 @@ options as the vector they are cloned from while vectors created with to ensure the array is up to date. * :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. + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index e9321ad9cd..e184b829de 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -1034,3 +1034,34 @@ usage. .. code-block:: c flag = N_VBufUnpack(x, buf) + + +.. _NVectors.Ops.Print: + +Output operations +----------------- + +The following optional vector operations are for writing vector data either to +``stdout`` or to a given file. + +.. c:function:: void N_VPrint(N_Vector x) + + This routine prints vector data to ``stdout`` + + Usage: + + .. code-block:: c + + N_VPrint(x); + +.. c:function:: void N_VPrintFile(N_Vector x, FILE* file) + + This routine writes vector data to the given file pointer. + + Usage: + + .. code-block:: c + + FILE* fp = fopen("vector_data.txt", "w"); + N_VPrintFile(x, fp); + fclose(fp); diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index 8b723fbfe6..f7284ae7f8 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -166,7 +166,7 @@ options as the vector they are cloned from while vectors created with and then access components using appropriate PETSc functions. * 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()` + field *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/nvectors/NVector_ParHyp.rst b/doc/shared/nvectors/NVector_ParHyp.rst index cd662bae5a..815469e938 100644 --- a/doc/shared/nvectors/NVector_ParHyp.rst +++ b/doc/shared/nvectors/NVector_ParHyp.rst @@ -175,10 +175,10 @@ 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 implementation of :c:func:`N_VDestroy` 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. + 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 38a3a55a5c..f0b185a584 100644 --- a/doc/shared/nvectors/NVector_Parallel.rst +++ b/doc/shared/nvectors/NVector_Parallel.rst @@ -274,7 +274,7 @@ options as the vector they are cloned from, while vectors created with than it is to use ``NV_Ith_P(v,i)`` within the loop. * :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 + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/nvectors/NVector_Pthreads.rst b/doc/shared/nvectors/NVector_Pthreads.rst index fa637e5c5f..39478ce7ab 100644 --- a/doc/shared/nvectors/NVector_Pthreads.rst +++ b/doc/shared/nvectors/NVector_Pthreads.rst @@ -272,7 +272,7 @@ options as the vector they are cloned from while vectors created with is to use ``NV_Ith_S(v,i)`` within the loop. * :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 + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/nvectors/NVector_SYCL.rst b/doc/shared/nvectors/NVector_SYCL.rst index ea3b221e85..3b1cfeeb68 100644 --- a/doc/shared/nvectors/NVector_SYCL.rst +++ b/doc/shared/nvectors/NVector_SYCL.rst @@ -309,7 +309,6 @@ for the NVECTOR_SYCL module. The ``SUNSyclExecPolicy`` Class -------------------------------- - In order to provide maximum flexibility to users, the SYCL kernel execution parameters used by kernels within SUNDIALS are defined by objects of the ``sundials::sycl::ExecPolicy`` abstract class type (this class can be accessed in @@ -322,16 +321,15 @@ class is defined as where the ``sundials::sycl::ExecPolicy`` class is defined in the header file ``sundials_sycl_policies.hpp``, as follows: -.. code-block:: c++ +.. cpp:class:: sundials::sycl::ExecPolicy - class ExecPolicy - { - public: - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const = 0; - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const = 0; - virtual ExecPolicy* clone() const = 0; - virtual ~ExecPolicy() {} - }; + .. cpp:function:: virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) + + .. cpp:function:: virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) + + .. cpp:function:: virtual ExecPolicy* clone() const + + .. cpp:function:: virtual ~ExecPolicy() For consistency the function names and behavior mirror the execution policies for the CUDA and HIP vectors. In the SYCL case the ``blockSize`` is the local diff --git a/doc/shared/nvectors/NVector_Serial.rst b/doc/shared/nvectors/NVector_Serial.rst index 80f99703e9..e822908156 100644 --- a/doc/shared/nvectors/NVector_Serial.rst +++ b/doc/shared/nvectors/NVector_Serial.rst @@ -249,8 +249,8 @@ 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` set the field - *own_data* to ``SUNFALSE``. The function :c:func:`N_VDestroy_Serial()` will +* :c:func:`N_VNewEmpty_Serial` and :c:func:`N_VMake_Serial` set the field + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index 9c6e791a7f..91e94abbf0 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -34,40 +34,74 @@ accuracy tolerances (see :eq:`ARKODE_WRMS_NORM`), 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 +The :c:type:`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:`SUNContext` object. + +A :c:type:`SUNAdaptController` is a pointer to the +:c:struct:`_generic_SUNAdaptController` structure: .. c:type:: struct _generic_SUNAdaptController *SUNAdaptController -and the base class structure is defined as +.. c:struct:: _generic_SUNAdaptController -.. code-block:: C + .. c:member:: void* content - struct _generic_SUNAdaptController { - void* content; - generic_SUNAdaptController_Ops* ops; - SUNContext sunctx; - }; + Pointer to the controller-specific member data -Here, ``_generic_SUNAdaptController_Ops`` is the pointer to a structure containing -function pointers to the various controller operations, and is defined as + .. c:member:: SUNAdaptController_Ops ops; -.. code-block:: c + A virtual table of controller operations provided by a specific + implementation + + .. c:member:: SUNContext sunctx + + The SUNDIALS simulation context + +The virtual table structure is defined as + +.. c:type:: struct _generic_SUNAdaptController_Ops *SUNAdaptController_Ops + +.. c:struct:: _generic_SUNAdaptController_Ops + + The structure defining :c:type:`SUNAdaptController` operations. + + .. c:member:: SUNAdaptController_Type (*gettype)(SUNAdaptController C) + + The function implementing :c:func:`SUNAdaptController_GetType` + + .. c:member:: SUNErrCode (*destroy)(SUNAdaptController C) + + The function implementing :c:func:`SUNAdaptController_Destroy` + + .. c:member:: SUNErrCode (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); + + The function implementing :c:func:`SUNAdaptController_EstimateStep` + + .. c:member:: SUNErrCode (*reset)(SUNAdaptController C) + + The function implementing :c:func:`SUNAdaptController_Reset` + + .. c:member:: SUNErrCode (*setdefaults)(SUNAdaptController C) + + The function implementing :c:func:`SUNAdaptController_SetDefaults` + + .. c:member:: SUNErrCode (*write)(SUNAdaptController C, FILE* fptr) + + The function implementing :c:func:`SUNAdaptController_Write` + + .. c:member:: SUNErrCode (*seterrorbias)(SUNAdaptController C, sunrealtype bias) + + The function implementing :c:func:`SUNAdaptController_SetErrorBias` + + .. c:member:: SUNErrCode (*updateh)(SUNAdaptController C, sunrealtype h, sunrealtype dsm) + + The function implementing :c:func:`SUNAdaptController_UpdateH` + + .. c:member:: SUNErrCode (*space)(SUNAdaptController C, long int *lenrw, long int *leniw) - struct _generic_SUNAdaptController_Ops { - SUNAdaptController_Type (*getid)(SUNAdaptController C); - SUNErrCode (*destroy)(SUNAdaptController C); - SUNErrCode (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); - SUNErrCode (*reset)(SUNAdaptController C); - SUNErrCode (*setdefaults)(SUNAdaptController C); - SUNErrCode (*write)(SUNAdaptController C, FILE* fptr); - SUNErrCode (*seterrorbias)(SUNAdaptController C, sunrealtype bias); - SUNErrCode (*updateh)(SUNAdaptController C, sunrealtype h, sunrealtype dsm); - SUNErrCode (*space)(SUNAdaptController C, long int *lenrw, long int *leniw); - }; + The function implementing :c:func:`SUNAdaptController_Space` .. _SUNAdaptController.Description.controllerTypes: diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index 39f7fe9937..9cc9d82c2a 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -81,24 +81,11 @@ differences are discussed in :numref:`SUNDIALS.Fortran.Differences`. A discussion on the topic of equivalent data types in C and Fortran 2003 is presented in :numref:`SUNDIALS.Fortran.DataTypes`. -.. ifconfig:: package_name == 'kinsol' - - Further information on the Fortran 2003 interfaces specific to the - :c:type:`N_Vector`, :c:type:`SUNMatrix`, and :c:type:`SUNLinearSolver` - classes is given alongside the C documentation (:numref:`NVectors`, - :numref:`SUNMatrix`, and :numref:`SUNLinSol`, respectively). For details on - where the Fortran 2003 module (``.mod``) files and libraries are installed - see :numref:`Installation`. - -.. ifconfig:: package_name != 'kinsol' - - Further information on the Fortran 2003 interfaces specific to the - :c:type:`N_Vector`, :c:type:`SUNMatrix`, :c:type:`SUNLinearSolver`, and - :c:type:`SUNNonlinearSolver` classes is given alongside the C documentation - (:numref:`NVectors`, :numref:`SUNMatrix`, :numref:`SUNLinSol`, and - :numref:`SUNNonlinSol` respectively). For details on where the Fortran 2003 - module (``.mod``) files and libraries are installed see - :numref:`Installation`. +Further information on the Fortran 2003 interfaces specific to the +:c:type:`N_Vector`, :c:type:`SUNMatrix`, :c:type:`SUNLinearSolver`, and +:c:type:`SUNNonlinearSolver` classes is given alongside the C documentation. For +details on where the Fortran 2003 module (``.mod``) files and libraries are +installed see :numref:`Installation`. The Fortran 2003 interface modules were generated with SWIG Fortran :cite:p:`Swig-Fortran`, a fork of SWIG. Users who are interested in the SWIG @@ -437,9 +424,9 @@ Arrays of :c:type:`N_Vector` objects are interfaced to Fortran 2003 as an opaque ``type(c_ptr)``. As such, it is not possible to directly index an array of :c:type:`N_Vector` objects returned by the ``N_Vector`` "VectorArray" operations, or packages with sensitivity capabilities (CVODES and IDAS). Instead, SUNDIALS -provides a utility function :f:func:`FN_VGetVecAtIndexVectorArray` that can be -called for accessing a vector in a vector array. The example below demonstrates -this: +provides a utility function ``FN_VGetVecAtIndexVectorArray`` wrapping +:c:func:`N_VGetVecAtIndexVectorArray`. The example below demonstrates accessing +a vector in a vector array. C code: diff --git a/doc/shared/sundials/GPU.rst b/doc/shared/sundials/GPU.rst index ec32d74e2e..8607643adf 100644 --- a/doc/shared/sundials/GPU.rst +++ b/doc/shared/sundials/GPU.rst @@ -16,27 +16,13 @@ Features for GPU Accelerated Computing ============================================= -.. ifconfig:: package_name == 'kinsol' - - In this section, we introduce the SUNDIALS GPU programming model and - highlight SUNDIALS GPU features. The model leverages the fact that all of the - SUNDIALS packages interact with simulation data either through the shared - vector, matrix, and solver APIs (see Chapters :numref:`NVectors`, - :numref:`SUNMatrix`, and :numref:`SUNLinSol`) or through user-supplied - callback functions. Thus, under the model, the overall structure of the - user’s calling program, and the way users interact with the SUNDIALS packages - is similar to using SUNDIALS in CPU-only environments. - -.. ifconfig:: package_name != 'kinsol' - - In this section, we introduce the SUNDIALS GPU programming model and - highlight SUNDIALS GPU features. The model leverages the fact that all of the - SUNDIALS packages interact with simulation data either through the shared - vector, matrix, and solver APIs (see Chapters :numref:`NVectors`, - :numref:`SUNMatrix`, :numref:`SUNLinSol`, and :numref:`SUNNonlinSol`) or - through user-supplied callback functions. Thus, under the model, the overall - structure of the user’s calling program, and the way users interact with the - SUNDIALS packages is similar to using SUNDIALS in CPU-only environments. +In this section, we introduce the SUNDIALS GPU programming model and highlight +SUNDIALS GPU features. The model leverages the fact that all of the SUNDIALS +packages interact with simulation data either through the shared vector, matrix, +and solver APIs or through user-supplied callback functions. Thus, under the +model, the overall structure of the user’s calling program, and the way users +interact with the SUNDIALS packages is similar to using SUNDIALS in CPU-only +environments. .. _SUNDIALS.GPU.Model: diff --git a/doc/shared/sundials/Logging.rst b/doc/shared/sundials/Logging.rst index e98d56e583..8ce0b31774 100644 --- a/doc/shared/sundials/Logging.rst +++ b/doc/shared/sundials/Logging.rst @@ -82,7 +82,9 @@ Logger API The central piece of the Logger API is the :c:type:`SUNLogger` type: -.. c:type:: struct SUNLogger_* SUNLogger +.. c:type:: SUNLogger + + An opaque pointer containing logging information. When SUNDIALS is built with logging enabled, a default logging object is stored in the :c:type:`SUNContext` object and can be accessed with a call to diff --git a/doc/shared/sundials/Profiling.rst b/doc/shared/sundials/Profiling.rst index b787b5d485..2f8f458235 100644 --- a/doc/shared/sundials/Profiling.rst +++ b/doc/shared/sundials/Profiling.rst @@ -89,9 +89,10 @@ placed at all exit points for the scope/function. The a function, and leverages RAII to implicitly end the region. The ``profobj`` argument to the macro should be a ``SUNProfiler`` object, i.e. -an instance of the struct -.. c:type:: struct SUNProfiler_ *SUNProfiler +.. c:type:: SUNProfiler + + An opaque pointer containing profiling information. When SUNDIALS is built with profiling, a default profiling object is stored in the ``SUNContext`` object and can be accessed with a call to diff --git a/doc/shared/sundials/SUNContext.rst b/doc/shared/sundials/SUNContext.rst index 9bcd204bd9..18b1bf050d 100644 --- a/doc/shared/sundials/SUNContext.rst +++ b/doc/shared/sundials/SUNContext.rst @@ -21,10 +21,10 @@ All of the SUNDIALS objects (vectors, linear and nonlinear solvers, matrices, etc.) that collectively form a SUNDIALS simulation, hold a reference to a common simulation context object defined by the :c:type:`SUNContext` class. -The :c:type:`SUNContext` class/type is defined in the header file -``sundials/sundials_context.h`` as +.. c:type:: SUNContext -.. c:type:: struct _SUNContext *SUNContext + An opaque pointer used by SUNDIALS objects for error handling, logging, + profiling, etc. Users should create a :c:type:`SUNContext` object prior to any other calls to SUNDIALS library functions by calling: diff --git a/doc/shared/sundials/Types.rst b/doc/shared/sundials/Types.rst index 027e9cffe8..59cf1b29ba 100644 --- a/doc/shared/sundials/Types.rst +++ b/doc/shared/sundials/Types.rst @@ -125,7 +125,15 @@ Boolean type The advantage of using the name sunbooleantype (instead of int) is an increase in code readability. It also allows the programmer to make a distinction between int and boolean data. Variables of type ``sunbooleantype`` are intended to have -only the two values ``SUNFALSE`` (``0``) and ``SUNTRUE`` (``1``). +only the two values: :c:macro:`SUNFALSE` or :c:macro:`SUNTRUE`. + +.. c:macro:: SUNFALSE + + False (``0``) + +.. c:macro:: SUNTRUE + + True (``1``) Output formatting type ---------------------- @@ -153,9 +161,13 @@ Output formatting type MPI types --------- -.. c:type:: SUNComm +.. c:type:: SUNComm A simple typedef to an `int` when SUNDIALS is built without MPI, or a ``MPI_Comm`` when built with MPI. This type exists solely to ensure SUNDIALS - can support MPI and non-MPI builds. - \ No newline at end of file + can support MPI and non-MPI builds. + +.. c:macro:: SUN_COMM_NULL + + A macro defined as ``0`` when SUNDIALS is built without MPI, or as + ``MPI_COMM_NULL`` when built with MPI. diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py new file mode 100644 index 0000000000..b72f632920 --- /dev/null +++ b/doc/shared/sundials_vars.py @@ -0,0 +1,128 @@ +# ---------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ---------------------------------------------------------------- +doc_version = 'develop' +sundials_version = 'v7.0.0' +arkode_version = 'v6.0.0' +cvode_version = 'v7.0.0' +cvodes_version = 'v7.0.0' +ida_version = 'v7.0.0' +idas_version = 'v6.0.0' +kinsol_version = 'v7.0.0' +year = '2024' + +# Warn about all references where the target cannot be found +nitpicky = True + +# List of tuples (type, target) to ignore when generating "nitpicky" warnings +nitpick_ignore = [ + # C/C++ types Sphinx does not seem to know about + ('c:identifier', 'FILE'), + ('cpp:identifier', 'FILE'), + ('c:identifier', 'size_t'), + ('cpp:identifier', 'size_t'), + # CUDA + ('cpp:identifier', 'cudaStream_t'), + ('c:identifier', 'cusparseHandle_t'), + ('c:identifier', 'cusparseMatDescr_t'), + ('c:identifier', 'cusolverHandle_t'), + # Ginkgo + ('cpp:identifier', 'gko'), + ('cpp:identifier', 'gko::dim<2>'), + ('cpp:identifier', 'gko::Executor'), + ('cpp:identifier', 'gko::LinOp'), + # HIP + ('cpp:identifier', 'hipStream_t'), + # hypre + ('c:identifier', 'hypre_ParVector'), + # Kokkos + ('cpp:identifier', 'ExecutionSpace'), + ('cpp:identifier', 'ExecutionSpace::memory_space'), + ('cpp:identifier', 'Kokkos'), + ('cpp:identifier', 'Kokkos::DefaultExecutionSpace'), + ('cpp:identifier', 'Kokkos::RangePolicy<exec_space>'), + ('cpp:identifier', 'Kokkos::View<sunrealtype***, memory_space>'), + ('cpp:identifier', 'Kokkos::View<sunrealtype*, MemorySpace>'), + ('cpp:identifier', 'Kokkos::Rank<3>'), + ('cpp:identifier', 'Kokkos::TeamPolicy<exec_space>'), + ('cpp:identifier', 'Kokkos::TeamPolicy<exec_space>::member_type'), + ('cpp:identifier', 'Kokkos::MDRangePolicy<exec_space, Kokkos::Rank<3>>'), + # MPI + ('c:identifier', 'MPI_Comm'), + # PETSc + ('c:identifier', 'SNES'), + ('c:identifier', 'PetscErrorCode'), + ('c:identifier', 'Vec'), + # SuperLU + ('c:identifier', 'gridinfo_t'), + ('c:identifier', 'SuperMatrix'), + ('c:identifier', 'gridinfo_t'), + ('c:identifier', 'xLUstruct_t'), + ('c:identifier', 'xScalePermstruct_t'), + ('c:identifier', 'xSOLVEstruct_t'), + ('c:identifier', 'SuperLUStat_t'), + ('c:identifier', 'superlu_dist_options_t'), + # SYCL + ('cpp:identifier', 'sycl'), + ('cpp:identifier', 'sycl::queue'), + # Trilinos + ('cpp:identifier', 'Tpetra'), + ('cpp:identifier', 'Tpetra::Vector<sunrealtype, int, sunindextype>'), + ('cpp:identifier', 'Teuchos'), + ('cpp:identifier', 'Teuchos::RCP<vector_type>'), + # XBraid + ('c:identifier', 'braid_AccessStatus'), + ('c:identifier', 'braid_App'), + ('c:identifier', 'braid_BufferStatus'), + ('c:identifier', 'braid_Core'), + ('c:identifier', 'braid_Int'), + ('c:identifier', 'braid_PtFcnAccess'), + ('c:identifier', 'braid_PtFcnInit'), + ('c:identifier', 'braid_PtFcnSpatialNorm'), + ('c:identifier', 'braid_PtFcnStep'), + ('c:identifier', 'braid_Real'), + ('c:identifier', 'braid_StepStatus'), + ('c:identifier', 'braid_Vector'), + # C types referenced in C++ functions, not sure how to fix + ('cpp:identifier', 'sunbooleantype'), + ('cpp:identifier', 'sunindextype'), + ('cpp:identifier', 'sunrealtype'), + ('cpp:identifier', 'SUNErrCode'), + ('cpp:identifier', 'SUNContext'), + ('cpp:identifier', 'N_Vector'), + ('cpp:identifier', 'SUNMatrix'), + ('cpp:identifier', 'SUNLinearSolver'), + ('cpp:identifier', 'SUNMemoryHelper'), + ('cpp:identifier', 'SUNMemoryType'), + # C++ namespaces don't seem to work as expected, not sure how to fix + ('cpp:identifier', 'sundials'), + ('cpp:identifier', 'sundials::cuda'), + ('cpp:identifier', 'sundials::hip'), + ('cpp:identifier', 'sundials::sycl'), + ('cpp:identifier', 'sundials::ginkgo'), + # Experimental or internal namespaces and types + ('cpp:identifier', 'sundials::impl'), + ('cpp:identifier', 'sundials::impl::BaseNVector'), + ('cpp:identifier', 'sundials::impl::BaseMatrix'), + ('cpp:identifier', 'sundials::impl::BaseLinearSolver'), + ('cpp:identifier', 'sundials::ConvertibleTo<N_Vector>'), + ('cpp:identifier', 'sundials::ConvertibleTo<SUNMatrix>'), + ('cpp:identifier', 'sundials::ConvertibleTo<SUNLinearSolver>'), + # Defined types in Kokkos vector that are not found by Sphinx + ('cpp:identifier', 'view_type::size_type'), + ('cpp:identifier', 'view_type::HostMirror'), + # Template parameter that causes an error in Kokkos matrix + ('cpp:identifier', 'MatrixType'), + # C++ types referenced in "C" functions, should probably switch + # documentation to use .. cpp:function rather than .. c:function + ('c:identifier', 'SUNCudaExecPolicy'), + ('c:identifier', 'SUNHipExecPolicy') +] diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index ad1be8c5ae..6650b88d20 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -44,54 +44,58 @@ set up the linear solver object to utilize an updated matrix :math:`A` (:c:func:`SUNLinSolSetup`), and destroy a linear solver object (:c:func:`SUNLinSolFree`). +.. c:enum:: SUNLinearSolver_Type -.. c:function:: SUNLinearSolver_Type SUNLinSolGetType(SUNLinearSolver LS) + An identifier indicating the type of linear solver. - Returns the type identifier for the linear solver *LS*. + .. note:: - **Return value:** + See :numref:`SUNLinSol.Intended` for more information on + intended use cases corresponding to the linear solver type. - * ``SUNLINEARSOLVER_DIRECT (0)`` -- the SUNLinSol module - requires a matrix, and computes an "exact" solution to the linear - system defined by that matrix. - - * ``SUNLINEARSOLVER_ITERATIVE (1)`` -- the SUNLinSol module does - not require a matrix (though one may be provided), and computes - an inexact solution to the linear system using a matrix-free - iterative algorithm. That is it solves the linear system defined - by the package-supplied ``ATimes`` routine (see - :c:func:`SUNLinSolSetATimes()` below), even if that linear system - differs from the one encoded in the matrix object (if one is - provided). As the solver computes the solution only inexactly (or - may diverge), the linear solver should check for solution - convergence/accuracy as appropriate. - - * ``SUNLINEARSOLVER_MATRIX_ITERATIVE (2)`` -- the SUNLinSol - module requires a matrix, and computes an inexact solution to the - linear system defined by that matrix using an iterative - algorithm. That is it solves the linear system defined by the - matrix object even if that linear system differs from that - encoded by the package-supplied ``ATimes`` routine. As the solver - computes the solution only inexactly (or may diverge), the linear - solver should check for solution convergence/accuracy as - appropriate. - - * ``SUNLINEARSOLVER_MATRIX_EMBEDDED (3)`` -- the SUNLinSol module sets up - and solves the specified linear system at each linear solve call. Any - matrix-related data structures are held internally to the linear solver itself, - and are not provided by the SUNDIALS package. + .. c:enumerator:: SUNLINEARSOLVER_DIRECT - **Usage:** + The linear solver requires a matrix, and computes an "exact" solution to + the linear system defined by that matrix. - .. code-block:: c + .. c:enumerator:: SUNLINEARSOLVER_ITERATIVE - type = SUNLinSolGetType(LS); + The linear solver does not require a matrix (though one may be provided), + and computes an inexact solution to the linear system using a matrix-free + iterative algorithm. That is it solves the linear system defined by the + package-supplied ``ATimes`` routine (see :c:func:`SUNLinSolSetATimes()` + below), even if that linear system differs from the one encoded in the + matrix object (if one is provided). As the solver computes the solution + only inexactly (or may diverge), the linear solver should check for + solution convergence/accuracy as appropriate. - .. note:: + .. c:enumerator:: SUNLINEARSOLVER_MATRIX_ITERATIVE - See :numref:`SUNLinSol.Intended` for more information on - intended use cases corresponding to the linear solver type. + The linear solver module requires a matrix, and computes an inexact + solution to the linear system defined by that matrix using an iterative + algorithm. That is it solves the linear system defined by the matrix + object even if that linear system differs from that encoded by the + package-supplied ``ATimes`` routine. As the solver computes the solution + only inexactly (or may diverge), the linear solver should check for + solution convergence/accuracy as appropriate. + + .. c:enumerator:: SUNLINEARSOLVER_MATRIX_EMBEDDED + + The linear solver sets up and solves the specified linear system at each + linear solve call. Any matrix-related data structures are held internally + to the linear solver itself, and are not provided by the SUNDIALS package. + + +.. c:function:: SUNLinearSolver_Type SUNLinSolGetType(SUNLinearSolver LS) + + Returns the :c:enum:`SUNLinearSolver_Type` type identifier for the linear + solver. + + **Usage:** + .. code-block:: c + + type = SUNLinSolGetType(LS); .. c:function:: SUNLinearSolver_ID SUNLinSolGetID(SUNLinearSolver LS) @@ -567,51 +571,96 @@ provide additional information to the user in case of a linear solver failure. The generic SUNLinearSolver module ----------------------------------------- -SUNDIALS packages interact with specific SUNLinSol implementations -through the generic SUNLinearSolver abstract base class. The -``SUNLinearSolver`` type is a pointer to a structure containing an -implementation-dependent *content* field, and an *ops* field, and is -defined as +SUNDIALS packages interact with linear solver implementations through the +:c:type:`SUNLinearSolver` class. A :c:type:`SUNLinearSolver` is a pointer to the +:c:struct:`_generic_SUNLinearSolver` structure: .. c:type:: struct _generic_SUNLinearSolver *SUNLinearSolver -and the generic structure is defined as +.. c:struct:: _generic_SUNLinearSolver -.. code-block:: c + The structure defining the SUNDIALS linear solver class. - struct _generic_SUNLinearSolver { - void *content; - struct _generic_SUNLinearSolver_Ops *ops; - }; + .. c:member:: void *content -where the ``_generic_SUNLinearSolver_Ops`` structure is a list of -pointers to the various actual linear solver operations provided by a -specific implementation. The ``_generic_SUNLinearSolver_Ops`` -structure is defined as + Pointer to the linear solver-specific member data -.. code-block:: c + .. c:member:: SUNLinearSolver_Ops ops + + A virtual table of linear solver operations provided by a specific + implementation + + .. c:member:: SUNContext sunctx + + The SUNDIALS simulation context + +The virtual table structure is defined as + +.. c:type:: struct _generic_SUNLinearSolver_Ops *SUNLinearSolver_Ops + +.. c:struct:: _generic_SUNLinearSolver_Ops - struct _generic_SUNLinearSolver_Ops { - SUNLinearSolver_Type (*gettype)(SUNLinearSolver); - SUNLinearSolver_ID (*getid)(SUNLinearSolver); - SUNErrCode (*setatimes)(SUNLinearSolver, void*, SUNATimesFn); - SUNErrCode (*setpreconditioner)(SUNLinearSolver, void*, - SUNPSetupFn, SUNPSolveFn); - SUNErrCode (*setscalingvectors)(SUNLinearSolver, - N_Vector, N_Vector); - SUNErrCode (*setzeroguess)(SUNLinearSolver, sunbooleantype); - SUNErrCode (*initialize)(SUNLinearSolver); - int (*setup)(SUNLinearSolver, SUNMatrix); - int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, - N_Vector, sunrealtype); - int (*numiters)(SUNLinearSolver); - sunrealtype (*resnorm)(SUNLinearSolver); - sunindextype (*lastflag)(SUNLinearSolver); - SUNErrCode (*space)(SUNLinearSolver, long int*, long int*); - N_Vector (*resid)(SUNLinearSolver); - SUNErrCode (*free)(SUNLinearSolver); - }; + The structure defining :c:type:`SUNLinearSolver` operations. + .. c:member:: SUNLinearSolver_Type (*gettype)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolGetType` + + .. c:member:: SUNLinearSolver_ID (*getid)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolGetID` + + .. c:member:: SUNErrCode (*setatimes)(SUNLinearSolver, void*, SUNATimesFn) + + The function implementing :c:func:`SUNLinSolSetATimes` + + .. c:member:: SUNErrCode (*setpreconditioner)(SUNLinearSolver, void*, SUNPSetupFn, SUNPSolveFn) + + The function implementing :c:func:`SUNLinSolSetPreconditioner` + + .. c:member:: SUNErrCode (*setscalingvectors)(SUNLinearSolver, N_Vector, N_Vector) + + The function implementing :c:func:`SUNLinSolSetScalingVectors` + + .. c:member:: SUNErrCode (*setzeroguess)(SUNLinearSolver, sunbooleantype) + + The function implementing :c:func:`SUNLinSolSetZeroGuess` + + .. c:member:: SUNErrCode (*initialize)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolInitialize` + + .. c:member:: int (*setup)(SUNLinearSolver, SUNMatrix) + + The function implementing :c:func:`SUNLinSolSetup` + + .. c:member:: int (*solve)(SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, sunrealtype) + + The function implementing :c:func:`SUNLinSolSolve` + + .. c:member:: int (*numiters)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolNumIters` + + .. c:member:: sunrealtype (*resnorm)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolResNorm` + + .. c:member:: sunindextype (*lastflag)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolLastFlag` + + .. c:member:: SUNErrCode (*space)(SUNLinearSolver, long int*, long int*) + + The function implementing :c:func:`SUNLinSolSpace` + + .. c:member:: N_Vector (*resid)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolResid` + + .. c:member:: SUNErrCode (*free)(SUNLinearSolver) + + The function implementing :c:func:`SUNLinSolFree` The generic SUNLinSol class defines and implements the linear solver operations defined in :numref:`SUNLinSol.CoreFn` -- :numref:`SUNLinSol.GetFn`. @@ -803,11 +852,12 @@ Additionally, a ``SUNLinearSolver`` implementation *may* do the following: -Each SUNLinSol implementation included in SUNDIALS has a unique -identifier specified in enumeration and shown in -:numref:`SUNLinSol.API.IDs`. It is recommended that a -user-supplied SUNLinSol implementation use the -``SUNLINEARSOLVER_CUSTOM`` identifier. +.. c:enum:: SUNLinearSolver_ID + + Each SUNLinSol implementation included in SUNDIALS has a unique identifier + specified in enumeration and shown in :numref:`SUNLinSol.API.IDs`. It is + recommended that a user-supplied SUNLinSol implementation use the + ``SUNLINEARSOLVER_CUSTOM`` identifier. .. _SUNLinSol.API.IDs: .. table:: Identifiers associated with :c:type:`SUNLinearSolver` diff --git a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst index 1b290d627a..34fd25c82d 100644 --- a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst +++ b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst @@ -44,7 +44,7 @@ Using SUNLINEARSOLVER_GINKGO After choosing a compatible ``N_Vector`` (see :numref:`SUNMatrix.Ginkgo.CompatibleNVectors`) and creating a Ginkgo-enabled ``SUNMatrix`` (see :numref:`SUNMatrix.Ginkgo`) to use the SUNLINEARSOLVER_GINKGO module, we first create a Ginkgo -stopping criteria object. Importantly, the :cpp:type:`sundials::ginkgo::DefaultStop` class provided +stopping criteria object. Importantly, the ``sundials::ginkgo::DefaultStop`` class provided by SUNDIALS implements a stopping critierion that matches the default SUNDIALS stopping critierion. Namely, it checks if the max iterations (5 by default) were reached or if the absolute residual norm was below a speicified tolerance. The critierion can be created just like any other @@ -95,7 +95,7 @@ expecting a ``SUNLinearSolver`` object through the implicit conversion operator .. warning:: :c:func:`SUNLinSolFree` should never be called on a ``SUNLinearSolver`` that was created via conversion - from a ``sundials::ginkgo::LinearSolver``. Doing so may result in a double free. + from a :cpp:type:`sundials::ginkgo::LinearSolver`. Doing so may result in a double free. .. _SUNLinSol.Ginkgo.API: @@ -106,7 +106,7 @@ SUNLINEARSOLVER_GINKGO API In this section we list the public API of the :cpp:type:`sundials::ginkgo::LinearSolver` class. .. cpp:class:: template<class GkoSolverType, class GkoMatrixType> \ - LinearSolver : public ConvertibleTo<SUNLinearSolver> + sundials::ginkgo::LinearSolver : public sundials::ConvertibleTo<SUNLinearSolver> .. cpp:function:: LinearSolver() = default; diff --git a/doc/shared/sunlinsol/SUNLinSol_KLU.rst b/doc/shared/sunlinsol/SUNLinSol_KLU.rst index 95ee6eaa43..ff3a9e2712 100644 --- a/doc/shared/sunlinsol/SUNLinSol_KLU.rst +++ b/doc/shared/sunlinsol/SUNLinSol_KLU.rst @@ -120,10 +120,15 @@ user-callable routines: This function returns a pointer to the KLU symbolic factorization stored in the SUNLinSol_KLU ``content`` structure. - When SUNDIALS is compiled with 32-bit indices (``SUNDIALS_INDEX_SIZE=32``), - ``sun_klu_symbolic`` is mapped to the KLU type ``klu_symbolic``; when - SUNDIALS compiled with 64-bit indices (``SUNDIALS_INDEX_SIZE=64``) this is - mapped to the KLU type ``klu_l_symbolic``. + .. c:type:: sun_klu_symbolic + + This type is an alias that depends on the SUNDIALS index size, see + :c:type:`sunindextype` and :cmakeop:`SUNDIALS_INDEX_SIZE`. It is + equivalent to: + + * ``klu_symbolic`` when SUNDIALS is compiled with 32-bit indices + + * ``klu_l_symbolic`` when SUNDIALS is compiled with 64-bit indices .. c:function:: sun_klu_numeric* SUNLinSol_KLUGetNumeric(SUNLinearSolver S) @@ -131,10 +136,15 @@ user-callable routines: This function returns a pointer to the KLU numeric factorization stored in the SUNLinSol_KLU ``content`` structure. - When SUNDIALS is compiled with 32-bit indices (``SUNDIALS_INDEX_SIZE=32``), - ``sun_klu_numeric`` is mapped to the KLU type ``klu_numeric``; when - SUNDIALS is compiled with 64-bit indices (``SUNDIALS_INDEX_SIZE=64``) this is - mapped to the KLU type ``klu_l_numeric``. + .. c:type:: sun_klu_numeric + + This type is an alias that depends on the SUNDIALS index size, see + :c:type:`sunindextype` and :cmakeop:`SUNDIALS_INDEX_SIZE`. It is + equivalent to: + + * ``klu_numeric`` when SUNDIALS is compiled with 32-bit indices + + * ``klu_l_numeric`` when SUNDIALS is compiled with 64-bit indices .. c:function:: sun_klu_common* SUNLinSol_KLUGetCommon(SUNLinearSolver S) @@ -142,10 +152,15 @@ user-callable routines: This function returns a pointer to the KLU common structure stored in the SUNLinSol_KLU ``content`` structure. - When SUNDIALS is compiled with 32-bit indices (``SUNDIALS_INDEX_SIZE=32``), - ``sun_klu_common`` is mapped to the KLU type ``klu_common``; when - SUNDIALS is compiled with 64-bit indices (``SUNDIALS_INDEX_SIZE=64``) this is - mapped to the KLU type ``klu_l_common``. + .. c:type:: sun_klu_common + + This type is an alias that depends on the SUNDIALS index size, see + :c:type:`sunindextype` and :cmakeop:`SUNDIALS_INDEX_SIZE`. It is + equivalent to: + + * ``klu_common`` when SUNDIALS is compiled with 32-bit indices + + * ``klu_l_common`` when SUNDIALS is compiled with 64-bit indices .. _SUNLinSol.KLU.Description: diff --git a/doc/shared/sunlinsol/SUNLinSol_PCG.rst b/doc/shared/sunlinsol/SUNLinSol_PCG.rst index 2d92a464ef..80d7dd65ef 100644 --- a/doc/shared/sunlinsol/SUNLinSol_PCG.rst +++ b/doc/shared/sunlinsol/SUNLinSol_PCG.rst @@ -280,7 +280,7 @@ The SUNLinSol_PCG module defines implementations of all * ``SUNLinSolSetZeroGuess_PCG`` -- note the solver assumes a non-zero guess by default and the zero guess flag is reset to ``SUNFALSE`` after each call to - :c:func:`SUNLinSolSolve_PCG`. + ``SUNLinSolSolve_PCG``. * ``SUNLinSolSetup_PCG`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst index 0075fd9df3..57f5e792e7 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPBCGS.rst @@ -232,7 +232,7 @@ The SUNLinSol_SPBCGS module defines implementations of all * ``SUNLinSolSetZeroGuess_SPBCGS`` -- note the solver assumes a non-zero guess by default and the zero guess flag is reset to ``SUNFALSE`` after each call to - :c:func:`SUNLinSolSolve_SPBCGS`. + ``SUNLinSolSolve_SPBCGS``. * ``SUNLinSolSetup_SPBCGS`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst index c978fdc91c..293e6b9418 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPFGMR.rst @@ -296,7 +296,7 @@ The SUNLinSol_SPFGMR module defines implementations of all * ``SUNLinSolSetZeroGuess_SPFGMR`` -- note the solver assumes a non-zero guess by default and the zero guess flag is reset to ``SUNFALSE`` after each call to - :c:func:`SUNLinSolSolve_SPFGMR`. + ``SUNLinSolSolve_SPFGMR``. * ``SUNLinSolSetup_SPFGMR`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst index 90ce60fb44..2f78bc29f3 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPGMR.rst @@ -280,7 +280,7 @@ The SUNLinSol_SPGMR module defines implementations of all * ``SUNLinSolSetZeroGuess_SPGMR`` -- note the solver assumes a non-zero guess by default and the zero guess flag is reset to ``SUNFALSE`` after each call to - :c:func:`SUNLinSolSolve_SPGMR`. + ``SUNLinSolSolve_SPGMR``. * ``SUNLinSolSetup_SPGMR`` diff --git a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst index 566e5e239c..168ba7fd5c 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SPTFQMR.rst @@ -238,7 +238,7 @@ The SUNLinSol_SPTFQMR module defines implementations of all * ``SUNLinSolSetZeroGuess_SPTFQMR`` -- note the solver assumes a non-zero guess by default and the zero guess flag is reset to ``SUNFALSE`` after each call to - :c:func:`SUNLinSolSolve_SPTFQMR`. + ``SUNLinSolSolve_SPTFQMR``. * ``SUNLinSolSetup_SPTFQMR`` diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index e60b31e097..11f69ab896 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -34,37 +34,74 @@ Specifically, a generic ``SUNMatrix`` is a pointer to a structure that has an implementation-dependent *content* field containing the description and actual data of the matrix, and an *ops* field pointing to a structure with generic matrix operations. -The type ``SUNMatrix`` is defined as: + +A :c:type:`SUNMatrix` is a pointer to the :c:struct:`_generic_SUNMatrix` +structure: .. c:type:: struct _generic_SUNMatrix *SUNMatrix -and the generic structure is defined as +.. c:struct:: _generic_SUNMatrix -.. code-block:: c + The structure defining the SUNDIALS matrix class. - struct _generic_SUNMatrix { - void *content; - struct _generic_SUNMatrix_Ops *ops; - }; + .. c:member:: void *content -Here, the ``_generic_SUNMatrix_Ops`` structure is essentially a list of -function pointers to the various actual matrix operations, and is -defined as + Pointer to matrix-specific member data -.. code-block:: c + .. c:member:: struct _generic_SUNMatrix_Ops *ops + + A virtual table of matrix operations provided by a specific + implementation + + .. c:member:: SUNContext sunctx + + The SUNDIALS simulation context + +The virtual table structure is defined as + +.. c:struct:: _generic_SUNMatrix_Ops + + The structure defining :c:type:`SUNMatrix` operations. + + .. c:member:: SUNMatrix_ID (*getid)(SUNMatrix) + + The function implementing :c:func:`SUNMatGetID` + + .. c:member:: SUNMatrix (*clone)(SUNMatrix) + + The function implementing :c:func:`SUNMatClone` + + .. c:member:: void (*destroy)(SUNMatrix) + + The function implementing :c:func:`SUNMatDestroy` - struct _generic_SUNMatrix_Ops { - SUNMatrix_ID (*getid)(SUNMatrix); - SUNMatrix (*clone)(SUNMatrix); - void (*destroy)(SUNMatrix); - SUNErrCode (*zero)(SUNMatrix); - SUNErrCode (*copy)(SUNMatrix, SUNMatrix); - SUNErrCode (*scaleadd)(sunrealtype, SUNMatrix, SUNMatrix); - SUNErrCode (*scaleaddi)(sunrealtype, SUNMatrix); - SUNErrCode (*matvecsetup)(SUNMatrix); - SUNErrCode (*matvec)(SUNMatrix, N_Vector, N_Vector); - SUNErrCode (*space)(SUNMatrix, long int*, long int*); - }; + .. c:member:: SUNErrCode (*zero)(SUNMatrix) + + The function implementing :c:func:`SUNMatZero` + + .. c:member:: SUNErrCode (*copy)(SUNMatrix, SUNMatrix) + + The function implementing :c:func:`SUNMatCopy` + + .. c:member:: SUNErrCode (*scaleadd)(sunrealtype, SUNMatrix, SUNMatrix) + + The function implementing :c:func:`SUNMatScaleAdd` + + .. c:member:: SUNErrCode (*scaleaddi)(sunrealtype, SUNMatrix) + + The function implementing :c:func:`SUNMatScaleAddI` + + .. c:member:: SUNErrCode (*matvecsetup)(SUNMatrix) + + The function implementing :c:func:`SUNMatMatvecSetup` + + .. c:member:: SUNErrCode (*matvec)(SUNMatrix, N_Vector, N_Vector) + + The function implementing :c:func:`SUNMatMatvec` + + .. c:member:: SUNErrCode (*space)(SUNMatrix, long int*, long int*) + + The function implementing :c:func:`SUNMatSpace` The generic SUNMATRIX module defines and implements the matrix @@ -150,11 +187,13 @@ set and all operations are copied when cloning a matrix. * *A* -- the SUNMatrix object to free -Each SUNMATRIX implementation included in SUNDIALS has a unique -identifier specified in enumeration and shown in -:numref:`SUNMatrix.Description.matrixIDs`. It is recommended that a -user-supplied SUNMATRIX implementation use the ``SUNMATRIX_CUSTOM`` -identifier. +.. c:type:: SUNMatrix_ID + + Each SUNMATRIX implementation included in SUNDIALS has a unique identifier + specified in enumeration and shown in + :numref:`SUNMatrix.Description.matrixIDs`. It is recommended that a + user-supplied SUNMATRIX implementation use the ``SUNMATRIX_CUSTOM`` + identifier. .. _SUNMatrix.Description.matrixIDs: diff --git a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst index 2a5c9e4cf0..899782dcbf 100644 --- a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst @@ -44,7 +44,7 @@ class in the ``sundials::kokkos`` namespace: .. code-block:: cpp template<class ExecutionSpace = Kokkos::DefaultExecutionSpace, - class MemorySpace = typename ExecSpace::memory_space> + class MemorySpace = typename ExecutionSpace::memory_space> class DenseMatrix : public sundials::impl::BaseMatrix, public sundials::ConvertibleTo<SUNMatrix> @@ -108,10 +108,18 @@ In this section we list the public API of the ``sundials::kokkos::DenseMatrix`` class. .. cpp:class:: template<class ExeccutionSpace = Kokkos::DefaultExecutionSpace, \ - class MemorySpace = typename ExecSpace::memory_space> \ + class MemorySpace = typename ExecutionSpace::memory_space> \ DenseMatrix : public sundials::impl::BaseMatrix, \ public sundials::ConvertibleTo<SUNMatrix> + .. cpp:type:: exec_space = ExecutionSpace; + .. cpp:type:: memory_space = MemorySpace; + .. cpp:type:: view_type = Kokkos::View<sunrealtype***, memory_space>; + .. cpp:type:: size_type = typename view_type::size_type; + .. cpp:type:: range_policy = Kokkos::MDRangePolicy<exec_space, Kokkos::Rank<3>>; + .. cpp:type:: team_policy = typename Kokkos::TeamPolicy<exec_space>; + .. cpp:type:: member_type = typename Kokkos::TeamPolicy<exec_space>::member_type; + .. cpp:function:: DenseMatrix() = default Default constructor -- the matrix must be copied or moved to. @@ -134,7 +142,7 @@ class. :param rows: number of matrix rows :param cols: number of matrix columns - :param exec_space: a `ExecSpace` instance + :param ex: an execuation space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(size_type blocks, size_type block_rows, \ @@ -158,7 +166,7 @@ class. :param blocks: number of matrix blocks :param block_rows: number of rows in a block :param block_cols: number of columns in a block - :param exec_space: a `ExecSpace` instance + :param ex: an execuation space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(DenseMatrix&& that_matrix) noexcept @@ -233,7 +241,7 @@ class. Explicit conversion to a :c:type:`SUNMatrix`. .. cpp:function:: template<class ExecutionSpace = Kokkos::DefaultExecutionSpace, \ - class MemorySpace = typename ExecSpace::memory_space> \ + class MemorySpace = typename ExecutionSpace::memory_space> \ inline DenseMatrix<MatrixType>* GetDenseMat(SUNMatrix A) Get the dense matrix wrapped by a SUNMatrix diff --git a/doc/shared/sunmatrix/SUNMatrix_Sparse.rst b/doc/shared/sunmatrix/SUNMatrix_Sparse.rst index 2f623ed184..89ce2505e8 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Sparse.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Sparse.rst @@ -382,7 +382,7 @@ following additional user-callable routines: space allocated for nonzero entries equals the actual number of nonzeros, ``indexptrs[NP]``). Returns a :c:type:`SUNErrCode`. -.. c:function:: SUNErrCode SUNSparseMatrix_Reallocate(SUNMatrix A) +.. c:function:: SUNErrCode SUNSparseMatrix_Reallocate(SUNMatrix A, sunindextype NNZ) Function to reallocate internal sparse matrix storage arrays so that the resulting sparse matrix has storage for a specified number of nonzeros. diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 40c9de73c6..3499367c7b 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -22,20 +22,25 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, .. c:type:: struct SUNMemory_ *SUNMemory - The ``SUNMemory`` type is a pointer a structure containing a pointer to - actual data (``ptr``), the data memory type, and a flag indicating ownership - of that data pointer. This structure is defined as + The ``SUNMemory`` type is a pointer the structure - .. code-block:: c + .. c:struct:: SUNMemory_ - struct SUNMemory_ - { - void* ptr; - SUNMemoryType type; - sunbooleantype own; - size_t bytes; - }; + .. c:member:: void* ptr; + The actual data. + + .. c:member:: SUNMemoryType type; + + The data memory type. + + .. c:member:: sunbooleantype own; + + A flag indicating ownership. + + .. c:member:: size_t bytes; + + The size of the data allocated. .. c:function:: SUNMemory SUNMemoryNewEmpty(SUNContext sunctx) @@ -48,7 +53,7 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, **Returns:** * an uninitialized ``SUNMemory`` object - + .. versionchanged:: 7.0.0 The function signature was updated to add the ``SUNContext`` argument. @@ -59,31 +64,40 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, The ``SUNMemoryType`` type is an enumeration that defines the supported memory types: - .. code-block:: c + .. c:enumerator:: SUNMEMTYPE_HOST + + Pageable memory accessible on the host - typedef enum - { - SUNMEMTYPE_HOST, /* pageable memory accessible on the host */ - SUNMEMTYPE_PINNED, /* page-locked memory accesible on the host */ - SUNMEMTYPE_DEVICE, /* memory accessible from the device */ - SUNMEMTYPE_UVM /* memory accessible from the host or device */ - } SUNMemoryType; + .. c:enumerator:: SUNMEMTYPE_PINNED + + Page-locked memory accesible on the host + + .. c:enumerator:: SUNMEMTYPE_DEVICE + + Memory accessible from the device + + .. c:enumerator:: SUNMEMTYPE_UVM + + Memory accessible from the host or device .. c:type:: struct SUNMemoryHelper_ *SUNMemoryHelper - The ``SUNMemoryHelper`` type is a pointer to a structure containing a pointer - to the implementation-specific member data (``content``) and a virtual method - table of member functions (``ops``). This strucutre is defined as + The ``SUNMemoryHelper`` type is a pointer to the structure + + .. c:struct:: SUNMemoryHelper_ + + .. c:member:: void* content; + + Pointer to the implementation-specific member data - .. code-block:: c + .. c:member:: SUNMemoryHelper_Ops ops; - struct SUNMemoryHelper_ - { - void* content; - SUNMemoryHelper_Ops ops; - SUNContext sunctx; - }; + A virtual method table of member functions + + .. c:member:: SUNContext sunctx; + + The SUNDIALS simulation context .. c:type:: struct SUNMemoryHelper_Ops_ *SUNMemoryHelper_Ops @@ -92,26 +106,35 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, containing the function pointers to the member function implementations. This structure is define as - .. code-block:: c - - struct SUNMemoryHelper_Ops_ - { - /* operations that implementations are required to provide */ - SUNErrCode (*alloc)(SUNMemoryHelper, SUNMemory* memptr size_t mem_size, - SUNMemoryType mem_type, void* queue); - SUNErrCode (*dealloc)(SUNMemoryHelper, SUNMemory mem, void* queue); - SUNErrCode (*copy)(SUNMemoryHelper, SUNMemory dst, SUNMemory src, - size_t mem_size, void* queue); - - /* operations that provide default implementations */ - SUNErrCode (*copyasync)(SUNMemoryHelper, SUNMemory dst, - SUNMemory src, size_t mem_size, void* queue); - SUNErrCode (*getallocstats)(SUNMemoryHelper, SUNMemoryType mem_type, unsigned long* num_allocations, - unsigned long* num_deallocations, size_t* bytes_allocated, - size_t* bytes_high_watermark); - SUNMemoryHelper (*clone)(SUNMemoryHelper); - SUNErrCode (*destroy)(SUNMemoryHelper); - }; + .. c:struct:: SUNMemoryHelper_Ops_ + + .. c:member:: SUNErrCode (*alloc)(SUNMemoryHelper, SUNMemory* memptr, size_t mem_size, SUNMemoryType mem_type, void* queue) + + The function implementing :c:func:`SUNMemoryHelper_Alloc` + + .. c:member:: SUNErrCode (*dealloc)(SUNMemoryHelper, SUNMemory mem, void* queue) + + The function implementing :c:func:`SUNMemoryHelper_Dealloc` + + .. c:member:: SUNErrCode (*copy)(SUNMemoryHelper, SUNMemory dst, SUNMemory src, size_t mem_size, void* queue) + + The function implementing :c:func:`SUNMemoryHelper_Copy` + + .. c:member:: SUNErrCode (*copyasync)(SUNMemoryHelper, SUNMemory dst, SUNMemory src, size_t mem_size, void* queue) + + The function implementing :c:func:`SUNMemoryHelper_CopyAsync` + + .. c:member:: SUNErrCode (*getallocstats)(SUNMemoryHelper, SUNMemoryType mem_type, unsigned long* num_allocations, unsigned long* num_deallocations, size_t* bytes_allocated, size_t* bytes_high_watermark) + + The function implementing :c:func:`SUNMemoryHelper_GetAllocStats` + + .. c:member:: SUNMemoryHelper (*clone)(SUNMemoryHelper) + + The function implementing :c:func:`SUNMemoryHelper_Clone` + + .. c:member:: SUNErrCode (*destroy)(SUNMemoryHelper) + + The function implementing :c:func:`SUNMemoryHelper_Destroy` .. _SUNMemory.Description.Required: diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index aef87888b2..d169c83001 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -41,6 +41,19 @@ nonlinear solver type (:c:func:`SUNNonlinSolGetType`) and solve the nonlinear sy initialization (:c:func:`SUNNonlinSolInitialize`), setup (:c:func:`SUNNonlinSolSetup`), and destruction (:c:func:`SUNNonlinSolFree`) are optional. +.. c:enum:: SUNNonlinearSolver_Type + + An identifier indicating the form of the nonlinear system expected by the + nonlinear solver. + + .. c:enumerator:: SUNNONLINEARSOLVER_ROOTFIND + + The nonlinear solver expects systems in rootfinding form :math:`F(y) = 0` + + .. c:enumerator:: SUNNONLINEARSOLVER_FIXEDPOINT + + The nonlinear solver expects systems in fixed-point form :math:`G(y) = y`. + .. c:function:: SUNNonlinearSolver_Type SUNNonlinSolGetType(SUNNonlinearSolver NLS) @@ -50,15 +63,8 @@ initialization (:c:func:`SUNNonlinSolInitialize`), setup * *NLS* -- a SUNNonlinSol object. **Return value:** - The SUNNonlinSol type identifier (of type ``int``) will be one - of the following: - - * ``SUNNONLINEARSOLVER_ROOTFIND`` -- ``0``, the SUNNonlinSol module - solves :math:`F(y) = 0`. - - * ``SUNNONLINEARSOLVER_FIXEDPOINT`` -- ``1``, the SUNNonlinSol - module solves :math:`G(y) = y`. - + The :c:enum:`SUNNonlinearSolver_Type` type identifier for the nonlinear + solver. .. c:function:: SUNErrCode SUNNonlinSolInitialize(SUNNonlinearSolver NLS) @@ -500,43 +506,90 @@ implementations through the generic SUNNonlinSol module on which all other SUNNonlinSol implementations are built. The ``SUNNonlinearSolver`` type is a pointer to a structure containing an implementation-dependent *content* field and an *ops* -field. The type ``SUNNonlinearSolver`` is defined as follows: +field. + +A :c:type:`SUNNonlinearSolver` is a pointer to the +:c:struct:`_generic_SUNNonlinearSolver` structure: .. c:type:: struct _generic_SUNNonlinearSolver *SUNNonlinearSolver -and the generic structure is defined as +.. c:struct:: _generic_SUNNonlinearSolver -.. code-block:: c + The structure defining the SUNDIALS nonlinear solver class. - struct _generic_SUNNonlinearSolver { - void *content; - struct _generic_SUNNonlinearSolver_Ops *ops; - }; + .. c:member:: void* content -where the ``_generic_SUNNonlinearSolver_Ops`` structure is a list of -pointers to the various actual nonlinear solver operations provided by a -specific implementation. The ``_generic_SUNNonlinearSolver_Ops`` -structure is defined as + Pointer to nonlinear solver-specific member data -.. code-block:: c + .. c:member:: SUNNonlinearSolver_Ops ops + + A virtual table of nonlinear solver operations provided by a specific + implementation + + .. c:member:: SUNContext sunctx + + The SUNDIALS simulation context + +The virtual table structure is defined as + +.. c:type:: struct _generic_SUNNonlinearSolver_Ops *SUNNonlinearSolver_Ops + +.. c:struct:: _generic_SUNNonlinearSolver_Ops + + The structure defining :c:type:`SUNNonlinearSolver` operations. + + .. c:member:: SUNNonlinearSolver_Type (*gettype)(SUNNonlinearSolver) + + The function implementing :c:func:`SUNNonlinSolGetType` + + .. c:member:: int (*initialize)(SUNNonlinearSolver) + + The function implementing :c:func:`SUNNonlinSolInitialize` + + .. c:member:: int (*setup)(SUNNonlinearSolver, N_Vector, void*) + + The function implementing :c:func:`SUNNonlinSolSetup` + + .. c:member:: int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, sunrealtype, sunbooleantype, void*) + + The function implementing :c:func:`SUNNonlinSolSolve` + + .. c:member:: int (*free)(SUNNonlinearSolver) + + The function implementing :c:func:`SUNNonlinSolFree` + + .. c:member:: int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn) + + The function implementing :c:func:`SUNNonlinSolSetSysFn` + + .. c:member:: int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn) + + The function implementing :c:func:`SUNNonlinSolSetLSetupFn` + + .. c:member:: int (*setlsolvefn)(SUNNonlinearSolver, SUNNonlinSolLSolveFn) + + The function implementing :c:func:`SUNNonlinSolSetLSolveFn` + + .. c:member:: int (*setctestfn)(SUNNonlinearSolver, SUNNonlinSolConvTestFn, void*) + + The function implementing :c:func:`SUNNonlinSolSetConvTestFn` + + .. c:member:: int (*setmaxiters)(SUNNonlinearSolver, int) + + The function implementing :c:func:`SUNNonlinSolSetMaxIters` + + .. c:member:: int (*getnumiters)(SUNNonlinearSolver, long int*) + + The function implementing :c:func:`SUNNonlinSolGetNumIters` + + .. c:member:: int (*getcuriter)(SUNNonlinearSolver, int*) + + The function implementing :c:func:`SUNNonlinSolGetCurIter` + + .. c:member:: int (*getnumconvfails)(SUNNonlinearSolver, long int*) + + The function implementing :c:func:`SUNNonlinSolGetNumConvFails` - struct _generic_SUNNonlinearSolver_Ops { - SUNNonlinearSolver_Type (*gettype)(SUNNonlinearSolver); - int (*initialize)(SUNNonlinearSolver); - int (*setup)(SUNNonlinearSolver, N_Vector, void*); - int (*solve)(SUNNonlinearSolver, N_Vector, N_Vector, - N_Vector, sunrealtype, sunbooleantype, void*); - int (*free)(SUNNonlinearSolver); - int (*setsysfn)(SUNNonlinearSolver, SUNNonlinSolSysFn); - int (*setlsetupfn)(SUNNonlinearSolver, SUNNonlinSolLSetupFn); - int (*setlsolvefn)(SUNNonlinearSolver, SUNNonlinSolLSolveFn); - int (*setctestfn)(SUNNonlinearSolver, SUNNonlinSolConvTestFn, - void*); - int (*setmaxiters)(SUNNonlinearSolver, int); - int (*getnumiters)(SUNNonlinearSolver, long int*); - int (*getcuriter)(SUNNonlinearSolver, int*); - int (*getnumconvfails)(SUNNonlinearSolver, long int*); - }; The generic SUNNonlinSol module defines and implements the nonlinear solver operations defined in diff --git a/doc/shared/versions.py b/doc/shared/versions.py deleted file mode 100644 index 1845394297..0000000000 --- a/doc/shared/versions.py +++ /dev/null @@ -1,20 +0,0 @@ -# ---------------------------------------------------------------- -# SUNDIALS Copyright Start -# Copyright (c) 2002-2024, 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 -# ---------------------------------------------------------------- -doc_version = 'develop' -sundials_version = 'v7.0.0' -arkode_version = 'v6.0.0' -cvode_version = 'v7.0.0' -cvodes_version = 'v7.0.0' -ida_version = 'v7.0.0' -idas_version = 'v6.0.0' -kinsol_version = 'v7.0.0' -year = '2024' diff --git a/doc/superbuild/source/conf.py b/doc/superbuild/source/conf.py index ff7f57d7e8..b5c8189bac 100644 --- a/doc/superbuild/source/conf.py +++ b/doc/superbuild/source/conf.py @@ -11,8 +11,8 @@ # ----------------------------------------------------------------------------- import sys, os -sys.path.append(os.path.dirname(os.path.abspath('../../shared/versions.py'))) -from versions import * +sys.path.append(os.path.dirname(os.path.abspath('../../shared/sundials_vars.py'))) +from sundials_vars import * sys.path.append(os.path.dirname(os.path.abspath('../../shared'))) # -- General configuration ---------------------------------------------------- diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 7c7b84e0ae..dbf932411c 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -54,7 +54,7 @@ Functions should have a descriptive name that lets a reader know what it does. For functions that return a boolean value, prefer the convention ``Is<statement>``, e.g. ``IsOutputRank``. Pascal case (with the appropriate namespace prefix) should be used for all public function names that are not -class functions (see :ref:`Style.Classes` for class naming conventions). +class functions. C++ function names ------------------ diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index a69c0c8ed7..1d9fde63a7 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -183,12 +183,12 @@ SUNDIALS License and Notices :maxdepth: 1 :hidden: - developers/index.rst contributing/index.rst + developers/index.rst .. toctree:: :caption: REFERENCES :maxdepth: 1 :hidden: - References \ No newline at end of file + References diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index 6089b1b723..30cc9b9147 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -327,7 +327,7 @@ done # Update rst documentation # ------------------------------------------------------------------------------ -fn="../doc/shared/versions.py" +fn="../doc/shared/sundials_vars.py" sedi "s/arkode_version =.*/arkode_version = \'v${ark_ver}\'/" $fn sedi "s/cvode_version =.*/cvode_version = \'v${cv_ver}\'/" $fn sedi "s/cvodes_version =.*/cvodes_version = \'v${cvs_ver}\'/" $fn From c6726463d20f17ef96bfe5e28583890d5b45b13b Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 29 May 2024 09:39:42 -0700 Subject: [PATCH 060/137] CI: Add Fortran Compiler Warnings (#487) Add Fortran `-check` flags with `ENABLE_ALL_WARNINGS` --- cmake/SundialsSetupCompilers.cmake | 13 +++++++ ...ark_brusselator1D_task_local_nls_f2003.f90 | 35 ++++++------------- test/env/default.sh | 4 --- test/env/docker.sh | 8 ++--- 4 files changed, 26 insertions(+), 34 deletions(-) diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 065f39e1b2..59dea2d019 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -95,6 +95,19 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}") + + # TODO(DJG): Add -fcheck=all,no-pointer,no-recursion once Jenkins is updated + # to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem + # no- options were added in gfortran 6 + # + # Exclude run-time pointer checks (no-pointer) because passing null objects + # to SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a + # run-time error with this check + # + # Exclude checks for subroutines and functions not marked as recursive + # (no-recursion) e.g., ark_brusselator1D_task_local_nls_f2003 calls + # SUNNonlinsolFree from within a custom nonlinear solver implementation of + # SUNNonlinsolFree which causes a run-time error with this check set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}") endif() 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 cc1e51b503..b0dbbadc20 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 @@ -76,11 +76,11 @@ module ode_mod integer, parameter :: Nvar = 3 ! MPI variables - integer, target :: comm ! communicator - integer :: myid ! process ID - integer :: nprocs ! total number of processes - integer :: reqS ! MPI send request handle - integer :: reqR ! MPI receive request handle + integer, target :: comm ! communicator + integer :: myid ! process ID + integer :: nprocs ! total number of processes + integer :: reqS ! MPI send request handle + integer :: reqR ! MPI receive request handle ! Excahnge buffers real(c_double) :: Wsend(Nvar), Wrecv(Nvar) @@ -346,7 +346,6 @@ module prec_mod ! Preconditioner functions ! -------------------------------------------------------------- - ! Sets P = I - gamma * J integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & user_data) result(ierr) bind(C) @@ -462,7 +461,6 @@ integer(c_int) function PSolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fnvector_mpiplusx_mod !======= Declarations ========= @@ -758,7 +756,6 @@ integer(SUNNonlinearSolver_Type) function TaskLocalNewton_GetType(sunnls) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -778,7 +775,6 @@ integer(c_int) function TaskLocalNewton_Initialize(sunnls) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -817,8 +813,6 @@ integer(c_int) function TaskLocalNewton_Solve(sunnls, sunvec_y0, sunvec_ycor, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - - use fnvector_mpiplusx_mod use ode_mod, only : comm @@ -880,10 +874,6 @@ integer(c_int) function TaskLocalNewton_Free(sunnls) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - - - - !======= Declarations ========= implicit none @@ -911,7 +901,6 @@ integer(c_int) function TaskLocalNewton_SetSysFn(sunnls, SysFn) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -932,7 +921,6 @@ integer(c_int) function TaskLocalNewton_SetConvTestFn(sunnls, CTestFn, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -954,7 +942,6 @@ integer(c_int) function TaskLocalNewton_GetNumConvFails(sunnls, nconvfails) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -976,9 +963,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fnvector_serial_mod - use fsunnonlinsol_newton_mod use fsunlinsol_dense_mod use fsunmatrix_dense_mod @@ -995,7 +980,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) type(SUNNonlinearSolver), pointer :: sunnls ! SUNDIALS nonlinear solver type(SUNNonlinearSolver_Ops), pointer :: nlsops ! solver operations - integer :: ierr ! MPI error status + integer :: ierr ! MPI error status !======= Internals ============ @@ -1258,6 +1243,9 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Create the (non)linear solver + sun_NLS => null() + sun_LS => null() + if (global) then ! Create nonlinear solver @@ -1948,6 +1936,7 @@ subroutine ExchangeAllEnd() !======= Inclusions =========== use, intrinsic :: iso_c_binding + use ode_mod, only : comm, reqS, reqR, c !======= Declarations ========= @@ -1983,9 +1972,6 @@ subroutine SetupProblem() !======= Inclusions =========== use, intrinsic :: iso_c_binding - - - use fnvector_serial_mod use fnvector_mpiplusx_mod use fnvector_mpimanyvector_mod @@ -2252,6 +2238,7 @@ subroutine FreeProblem() !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsundials_core_mod + use ode_mod, only : sunctx, logger, myid, nout, umask_s, umask, vmask, wmask !======= Declarations ========= diff --git a/test/env/default.sh b/test/env/default.sh index 3085490055..6fdf276cf3 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -139,10 +139,6 @@ if [ "$compilername" == "gcc" ]; then export CUDAFLAGS="-g -O3" fi - # TODO(CJB): add this back after we upgrade the GNU compiler stack on the Jenkins box - # Currently this causes the compiler to segfault on many of the Fortran example codes. - # export FFLAGS="${FFLAGS} -fbounds-check" - else COMPILER_ROOT="$(spack location -i "llvm@$compilerversion")" diff --git a/test/env/docker.sh b/test/env/docker.sh index 2f9359af0d..105f5aaedc 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -109,12 +109,8 @@ if [ "$compilername" == "gcc" ]; then export CUDAFLAGS="-g -O3" fi - # append additional warning flags - if [[ "$SUNDIALS_PRECISION" == "double" && "$SUNDIALS_INDEX_SIZE" == "32" ]]; then - export CFLAGS="${CFLAGS} -Wconversion -Wno-sign-conversion" - export CXXFLAGS="${CXXFLAGS} -Wconversion -Wno-sign-conversion" - fi - + # additional Fortran flags not currently added by ENABLE_ALL_WARNINGS + export FFLAGS="${FFLAGS} -fcheck=all,no-pointer,no-recursion" fi # ------------------------------------------------------------------------------ From 5fa5a3ac4af9e39a4e3b8d8bd9e4befee16fc43c Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 30 May 2024 09:07:27 -0700 Subject: [PATCH 061/137] Maintenance: Add Maybe Unused Macro (#491) Add `SUNDIALS_MAYBE_UNUSED` macro to suppresses warnings on unused entities. --- .clang-format | 2 +- .github/workflows/macos-latest.yml | 10 +++-- .github/workflows/ubuntu-clang-latest.yml | 31 +++++++++++---- CHANGELOG.md | 5 +++ benchmarks/CMakeLists.txt | 6 +++ cmake/SundialsSetupCompilers.cmake | 15 ++++++- doc/shared/RecentChanges.rst | 7 +++- examples/CMakeLists.txt | 6 +++ .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 4 +- include/nvector/nvector_parallel.h | 6 +-- include/nvector/nvector_parhyp.h | 8 +++- include/nvector/nvector_petsc.h | 9 +++-- include/nvector/nvector_serial.h | 6 +-- include/sundials/sundials_config.in | 1 + src/arkode/arkode.c | 19 +++++---- src/arkode/arkode_adapt.c | 2 +- src/arkode/arkode_adapt_impl.h | 2 +- src/arkode/arkode_arkstep.c | 9 +++-- src/arkode/arkode_arkstep_nls.c | 3 +- src/arkode/arkode_bandpre.c | 9 +++-- src/arkode/arkode_bbdpre.c | 12 ++++-- src/arkode/arkode_erkstep.c | 6 ++- src/arkode/arkode_impl.h | 4 +- src/arkode/arkode_ls.c | 5 ++- src/arkode/arkode_mristep.c | 20 ++++++---- src/arkode/arkode_mristep_nls.c | 3 +- src/arkode/arkode_relaxation.c | 3 +- src/arkode/arkode_relaxation_impl.h | 3 +- src/arkode/arkode_sprkstep.c | 9 +++-- src/arkode/arkode_user_controller.c | 14 +++---- src/arkode/xbraid/arkode_xbraid.c | 8 ++-- src/cvode/cvode_bandpre.c | 9 +++-- src/cvode/cvode_bbdpre.c | 16 +++++--- src/cvode/cvode_diag.c | 13 ++++--- src/cvode/cvode_fused_stubs.c | 10 +++-- src/cvode/cvode_impl.h | 3 +- src/cvode/cvode_io.c | 4 ++ src/cvode/cvode_ls.c | 5 ++- src/cvodes/cvodes.c | 10 ++--- src/cvodes/cvodes_bandpre.c | 9 +++-- src/cvodes/cvodes_bbdpre.c | 16 +++++--- src/cvodes/cvodes_diag.c | 13 ++++--- src/cvodes/cvodes_impl.h | 6 ++- src/cvodes/cvodes_io.c | 2 + src/cvodes/cvodes_ls.c | 13 ++++--- src/cvodes/cvodes_nls_stg1.c | 3 +- src/ida/ida_bbdpre.c | 13 +++++-- src/ida/ida_impl.h | 4 +- src/ida/ida_ls.c | 5 ++- src/ida/ida_nls.c | 6 ++- src/idas/idas.c | 13 ++++--- src/idas/idas_bbdpre.c | 13 +++++-- src/idas/idas_impl.h | 4 +- src/idas/idas_ls.c | 5 ++- src/idas/idas_nls.c | 6 ++- src/idas/idas_nls_sim.c | 7 ++-- src/idas/idas_nls_stg.c | 7 ++-- src/kinsol/kinsol.c | 8 ++-- src/kinsol/kinsol_bbdpre.c | 12 ++++-- src/kinsol/kinsol_impl.h | 4 +- src/kinsol/kinsol_ls.c | 8 ++-- src/nvector/manyvector/nvector_manyvector.c | 10 +++-- src/nvector/mpiplusx/nvector_mpiplusx.c | 6 +-- src/nvector/openmp/nvector_openmp.c | 13 +++++-- src/nvector/parallel/nvector_parallel.c | 17 ++++++-- src/nvector/parhyp/nvector_parhyp.c | 20 ++++++---- src/nvector/petsc/nvector_petsc.c | 24 ++++++++---- src/nvector/pthreads/nvector_pthreads.c | 11 +++--- src/nvector/serial/nvector_serial.c | 15 ++++++- src/nvector/trilinos/nvector_trilinos.cpp | 9 +++-- .../imexgus/sunadaptcontroller_imexgus.c | 9 +++-- .../soderlind/sunadaptcontroller_soderlind.c | 9 +++-- src/sundials/sundials_context.c | 9 ++++- src/sundials/sundials_errors.c | 18 +++++---- src/sundials/sundials_hashmap.c | 10 +++-- src/sundials/sundials_logger.c | 22 +++++++++-- src/sundials/sundials_macros.h | 39 +++++++++++++++++++ src/sundials/sundials_mpi_errors.c | 10 +++-- src/sundials/sundials_nvector.c | 8 +++- src/sundials/sundials_profiler.c | 25 ++++++------ src/sundials/sundials_utils.h | 2 +- src/sundials/sundials_xbraid.c | 26 +++++++------ src/sunlinsol/band/sunlinsol_band.c | 12 ++++-- src/sunlinsol/dense/sunlinsol_dense.c | 13 ++++--- src/sunlinsol/klu/sunlinsol_klu.c | 14 ++++--- .../lapackband/sunlinsol_lapackband.c | 9 +++-- .../lapackdense/sunlinsol_lapackdense.c | 9 +++-- src/sunlinsol/pcg/sunlinsol_pcg.c | 14 ++++--- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 12 +++--- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 12 +++--- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 12 +++--- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 12 +++--- .../superludist/sunlinsol_superludist.c | 20 ++++++---- src/sunlinsol/superlumt/sunlinsol_superlumt.c | 11 ++++-- src/sunmatrix/band/sunmatrix_band.c | 11 +++++- src/sunmatrix/dense/sunmatrix_dense.c | 11 +++++- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 11 +++++- src/sunmatrix/sparse/sunmatrix_sparse.c | 11 +++++- src/sunmemory/system/sundials_system_memory.c | 24 ++++++------ .../fixedpoint/sunnonlinsol_fixedpoint.c | 11 ++++-- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 8 +++- .../petscsnes/sunnonlinsol_petscsnes.c | 20 ++++++---- test/unit_tests/CMakeLists.txt | 6 +++ 103 files changed, 715 insertions(+), 354 deletions(-) create mode 100644 src/sundials/sundials_macros.h diff --git a/.clang-format b/.clang-format index 2ecb664e26..8f5802e45d 100644 --- a/.clang-format +++ b/.clang-format @@ -79,7 +79,7 @@ EmptyLineAfterAccessModifier : Never EmptyLineBeforeAccessModifier : Always ExperimentalAutoDetectBinPacking : false FixNamespaceComments : true -IncludeBlocks : Regroup +IncludeBlocks : Preserve IncludeCategories : - Regex : '^(<|"(gtest|gmock|isl|json)/)' Priority : 1 diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 5b78697c81..1c60778d37 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -25,9 +25,13 @@ jobs: - 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}} + # Configure CMake in a 'build' subdirectory. + run: | + cmake \ + -B ${{github.workspace}}/build \ + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -D ENABLE_ALL_WARNINGS=ON \ + -D ENABLE_WARNINGS_AS_ERRORS=ON - name: Build # Build your program with the given configuration diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index d2f3fcae0e..b78a7cb7cd 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -21,8 +21,9 @@ jobs: fail-fast: false max-parallel: 2 matrix: - # 2 is what all other builds use (its the default), so skip it here - logging_level: [0, 1, 3, 4, 5] + # Level 2 is also used in other builds (it's the default) but include it + # here to ensure it's tested with all warning flags + logging_level: [0, 1, 2, 3, 4, 5] steps: - name: Install LLVM and Clang @@ -33,9 +34,16 @@ jobs: - 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_LOGGING_LEVEL=${{matrix.logging_level}} + # Configure CMake in a 'build' subdirectory. + run: | + cmake \ + -B ${{github.workspace}}/build \ + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -D CMAKE_C_COMPILER=$(which clang) \ + -D CMAKE_CXX_COMPILER=$(which clang++) \ + -D SUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}} \ + -D ENABLE_ALL_WARNINGS=ON \ + -D ENABLE_WARNINGS_AS_ERRORS=ON - name: Build # Build your program with the given configuration @@ -57,9 +65,16 @@ jobs: - 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}} + # Configure CMake in a 'build' subdirectory. + run: | + cmake \ + -B ${{github.workspace}}/build \ + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -D CMAKE_C_COMPILER=$(which clang) \ + -D CMAKE_CXX_COMPILER=$(which clang++) \ + -D SUNDIALS_BUILD_WITH_PROFILING=${{matrix.profiling}} \ + -D ENABLE_ALL_WARNINGS=ON \ + -D ENABLE_WARNINGS_AS_ERRORS=ON - name: Build # Build your program with the given configuration diff --git a/CHANGELOG.md b/CHANGELOG.md index b6908a7af0..fbb107486f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,6 +118,11 @@ Deprecated the `ARKStepSetOptimalParams` function. Since this function does not ARKODE-wide equivalent, instructions have been added to the user guide for how to retain the current functionality using other user-callable functions. +The unsupported implementations of `N_VGetArrayPointer` and `N_VSetArrayPointer` +for the *hypre* and PETSc vectors are now deprecated. Users should access the +underlying wrapped external library vector objects instead with +`N_VGetVector_ParHyp` and `N_VGetVector_Petsc`, respectively. + ## Changes to SUNDIALS in release v7.0.0 ### Major Feature diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index a70315ea5b..980e1e230d 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -22,6 +22,12 @@ endif() sundials_option(BENCHMARK_NVECTOR BOOL "NVector benchmarks are on" ON) +# Disable some warnings for benchmarks +if(ENABLE_ALL_WARNINGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") +endif() + #---------------------------------------- # Add specific benchmarks #---------------------------------------- diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 59dea2d019..f4b226e96d 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -93,8 +93,8 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_CXX_FLAGS}") endif() - set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow -Wno-unused-parameter -Wno-unused-function ${CMAKE_CXX_FLAGS}") + set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_CXX_FLAGS}") # TODO(DJG): Add -fcheck=all,no-pointer,no-recursion once Jenkins is updated # to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem @@ -218,6 +218,17 @@ if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUIL " SUNDIALS_C_COMPILER_HAS_ASSUME) endif() +# --------------------------------------------------------------- +# Check for unused extension +# --------------------------------------------------------------- + +check_c_source_compiles(" + int main(void) { + __attribute__((unused)) double a = 0.0; + return 0; + } +" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) + # --------------------------------------------------------------- # Check for POSIX timers # --------------------------------------------------------------- diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index d11c3b24d4..68ac8d6c4c 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -115,4 +115,9 @@ ARKODE-wide functions. Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an ARKODE-wide equivalent, instructions have been added to the user guide for how -to retain the current functionality using other user-callable functions. \ No newline at end of file +to retain the current functionality using other user-callable functions. + +The unsupported implementations of ``N_VGetArrayPointer`` and +``N_VSetArrayPointer`` for the *hypre* and PETSc vectors are now deprecated. +Users should access the underlying wrapped external library vector objects +instead with ``N_VGetVector_ParHyp`` and ``N_VGetVector_Petsc``, respectively. diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bb9df6250f..a342a109eb 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -31,6 +31,12 @@ foreach(lang ${_SUNDIALS_ENABLED_LANGS}) endif() endforeach() +# Disable some warnings for examples +if(ENABLE_ALL_WARNINGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") +endif() + # Set variables used in generating CMake and Makefiles for examples if(EXAMPLES_INSTALL) diff --git a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c index 511ca7a901..440739e147 100644 --- a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c +++ b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c @@ -123,8 +123,8 @@ int main(int argc, char* argv[]) sunrealtype* data = NULL; SUNContext sunctx = NULL; - /* Check if a acceleration/dampling values were provided */ - if (argc > 1) { maa = (long int)atoi(argv[1]); } + /* Check if a acceleration/damping values were provided */ + if (argc > 1) { maa = atoi(argv[1]); } if (argc > 2) { damping = (sunrealtype)atof(argv[2]); } /* Print problem description */ diff --git a/include/nvector/nvector_parallel.h b/include/nvector/nvector_parallel.h index e05e4c7ef8..385ca528ed 100644 --- a/include/nvector/nvector_parallel.h +++ b/include/nvector/nvector_parallel.h @@ -117,10 +117,8 @@ void N_VPrint_Parallel(N_Vector v); SUNDIALS_EXPORT void N_VPrintFile_Parallel(N_Vector v, FILE* outfile); -static inline N_Vector_ID N_VGetVectorID_Parallel(N_Vector v) -{ - return SUNDIALS_NVEC_PARALLEL; -} +SUNDIALS_EXPORT +N_Vector_ID N_VGetVectorID_Parallel(N_Vector v); SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Parallel(N_Vector w); diff --git a/include/nvector/nvector_parhyp.h b/include/nvector/nvector_parhyp.h index a7c7ced8a1..b7f8271fb7 100644 --- a/include/nvector/nvector_parhyp.h +++ b/include/nvector/nvector_parhyp.h @@ -96,8 +96,6 @@ SUNDIALS_EXPORT N_Vector N_VClone_ParHyp(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_ParHyp(N_Vector v); SUNDIALS_EXPORT void N_VSpace_ParHyp(N_Vector v, sunindextype* lrw, sunindextype* liw); -SUNDIALS_EXPORT sunrealtype* N_VGetArrayPointer_ParHyp(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer_ParHyp(sunrealtype* v_data, N_Vector v); SUNDIALS_EXPORT MPI_Comm N_VGetCommunicator_ParHyp(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_ParHyp(N_Vector v); @@ -214,6 +212,12 @@ SUNErrCode N_VEnableLinearCombinationVectorArray_ParHyp(N_Vector v, SUNDIALS_EXPORT SUNErrCode N_VEnableDotProdMultiLocal_ParHyp(N_Vector v, sunbooleantype tf); +SUNDIALS_DEPRECATED_EXPORT_MSG("Not supported, use N_VGetVector_ParHyp") +sunrealtype* N_VGetArrayPointer_ParHyp(N_Vector v); + +SUNDIALS_DEPRECATED_EXPORT_MSG("Not supported, use N_VGetVector_ParHyp") +void N_VSetArrayPointer_ParHyp(sunrealtype* v_data, N_Vector v); + #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_petsc.h b/include/nvector/nvector_petsc.h index 1fa3b536b2..8605cb130e 100644 --- a/include/nvector/nvector_petsc.h +++ b/include/nvector/nvector_petsc.h @@ -76,8 +76,6 @@ SUNDIALS_EXPORT N_Vector N_VNewEmpty_Petsc(MPI_Comm comm, SUNDIALS_EXPORT N_Vector N_VMake_Petsc(Vec v, SUNContext sunctx); -SUNDIALS_EXPORT sunrealtype* N_VGetArrayPointer_Petsc(N_Vector v); - SUNDIALS_EXPORT Vec N_VGetVector_Petsc(N_Vector v); SUNDIALS_EXPORT void N_VSetVector_Petsc(N_Vector v, Vec p); @@ -93,7 +91,6 @@ SUNDIALS_EXPORT N_Vector N_VClone_Petsc(N_Vector w); SUNDIALS_EXPORT void N_VDestroy_Petsc(N_Vector v); SUNDIALS_EXPORT void N_VSpace_Petsc(N_Vector v, sunindextype* lrw, sunindextype* liw); -SUNDIALS_EXPORT void N_VSetArrayPointer_Petsc(sunrealtype* v_data, N_Vector v); SUNDIALS_EXPORT MPI_Comm N_VGetCommunicator_Petsc(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength_Petsc(N_Vector v); @@ -208,6 +205,12 @@ SUNErrCode N_VEnableLinearCombinationVectorArray_Petsc(N_Vector v, SUNDIALS_EXPORT SUNErrCode N_VEnableDotProdMultiLocal_Petsc(N_Vector v, sunbooleantype tf); +SUNDIALS_DEPRECATED_EXPORT_MSG("Not supported, use N_VGetVector_Petsc") +sunrealtype* N_VGetArrayPointer_Petsc(N_Vector v); + +SUNDIALS_DEPRECATED_EXPORT_MSG("Not supported, use N_VGetVector_Petsc") +void N_VSetArrayPointer_Petsc(sunrealtype* v_data, N_Vector v); + #ifdef __cplusplus } #endif diff --git a/include/nvector/nvector_serial.h b/include/nvector/nvector_serial.h index bcbc995f2e..988e090af2 100644 --- a/include/nvector/nvector_serial.h +++ b/include/nvector/nvector_serial.h @@ -102,10 +102,8 @@ void N_VPrint_Serial(N_Vector v); SUNDIALS_EXPORT void N_VPrintFile_Serial(N_Vector v, FILE* outfile); -static inline N_Vector_ID N_VGetVectorID_Serial(N_Vector v) -{ - return SUNDIALS_NVEC_SERIAL; -} +SUNDIALS_EXPORT +N_Vector_ID N_VGetVectorID_Serial(N_Vector v); SUNDIALS_EXPORT N_Vector N_VCloneEmpty_Serial(N_Vector w); diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index 99923d1e81..def1a87414 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -60,6 +60,7 @@ #cmakedefine SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME #cmakedefine SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME #cmakedefine SUNDIALS_C_COMPILER_HAS_ASSUME +#cmakedefine SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED /* Define precision of SUNDIALS data type 'sunrealtype' * Depending on the precision level, one of the following diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index bc7a449ef4..50735b32ea 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -642,10 +642,13 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype troundoff, nrm; sunbooleantype inactive_roots; sunrealtype dsm; - int nflag, attempts, ncf, nef, constrfails; + int nflag, ncf, nef, constrfails; int relax_fails; ARKodeMem ark_mem; + /* used only with debugging logging */ + SUNDIALS_MAYBE_UNUSED int attempts; + /* Check and process inputs */ /* Check if ark_mem exists */ @@ -897,7 +900,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - on fatal error, returns negative error flag */ if (ark_mem->relax_enabled && (kflag == ARK_SUCCESS)) { - kflag = arkRelax(ark_mem, &relax_fails, &dsm, &nflag); + kflag = arkRelax(ark_mem, &relax_fails, &dsm); if (kflag < 0) { break; } } @@ -2751,7 +2754,8 @@ int arkEwtSetSV(N_Vector ycur, N_Vector weight, void* arkode_mem) a fixed step size to avoid a potential too much error return to the user. ---------------------------------------------------------------*/ -int arkEwtSetSmallReal(N_Vector ycur, N_Vector weight, void* arkode_mem) +int arkEwtSetSmallReal(SUNDIALS_MAYBE_UNUSED N_Vector ycur, N_Vector weight, + SUNDIALS_MAYBE_UNUSED void* arkode_mem) { N_VConst(SUN_SMALL_REAL, weight); return (ARK_SUCCESS); @@ -2804,7 +2808,9 @@ int arkRwtSetSV(ARKodeMem ark_mem, N_Vector My, N_Vector weight) /*--------------------------------------------------------------- arkExpStab is the default explicit stability estimation function ---------------------------------------------------------------*/ -int arkExpStab(N_Vector y, sunrealtype t, sunrealtype* hstab, void* data) +int arkExpStab(SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED sunrealtype t, sunrealtype* hstab, + SUNDIALS_MAYBE_UNUSED void* data) { /* explicit stability not used by default, set to zero to disable */ @@ -3106,7 +3112,6 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, { int retval; sunrealtype ttmp; - long int nsttmp; ARKodeHAdaptMem hadapt_mem; /* Access hadapt_mem structure */ @@ -3121,9 +3126,7 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, /* consider change of step size for next step attempt (may be larger/smaller than current step, depending on dsm) */ ttmp = (dsm <= ONE) ? ark_mem->tn + ark_mem->h : ark_mem->tn; - nsttmp = (dsm <= ONE) ? ark_mem->nst + 1 : ark_mem->nst; - retval = arkAdapt(ark_mem, hadapt_mem, ark_mem->ycur, ttmp, ark_mem->h, dsm, - nsttmp); + retval = arkAdapt(ark_mem, hadapt_mem, ark_mem->ycur, ttmp, ark_mem->h, dsm); if (retval != ARK_SUCCESS) { return (ARK_ERR_FAILURE); } /* if we've made it here then no nonrecoverable failures occurred; someone above diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 5d6896a46f..7fef0ec2ae 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -92,7 +92,7 @@ void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE* outfile) data structure. ---------------------------------------------------------------*/ int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, - sunrealtype tcur, sunrealtype hcur, sunrealtype dsm, long int nst) + sunrealtype tcur, sunrealtype hcur, sunrealtype dsm) { int retval; sunrealtype h_acc, h_cfl, int_dir; diff --git a/src/arkode/arkode_adapt_impl.h b/src/arkode/arkode_adapt_impl.h index 3d86d9e385..7dd9460a1e 100644 --- a/src/arkode/arkode_adapt_impl.h +++ b/src/arkode/arkode_adapt_impl.h @@ -109,7 +109,7 @@ typedef struct ARKodeHAdaptMemRec ARKodeHAdaptMem arkAdaptInit(void); void arkPrintAdaptMem(ARKodeHAdaptMem hadapt_mem, FILE* outfile); int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, - sunrealtype tcur, sunrealtype hcur, sunrealtype dsm, long int nst); + sunrealtype tcur, sunrealtype hcur, sunrealtype dsm); #ifdef __cplusplus } diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index f5f61f5e38..1c1a7dc92f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -387,8 +387,10 @@ int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, This routine resizes the memory within the ARKStep module. ---------------------------------------------------------------*/ -int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, + SUNDIALS_MAYBE_UNUSED sunrealtype hscale, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, + void* resize_data) { ARKodeARKStepMem step_mem; SUNNonlinearSolver NLS; @@ -3089,7 +3091,8 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsmPtr) ODE IVP. ----------------------------------------------------------------------------*/ -int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, +int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, sunrealtype tout, N_Vector y) { void* arkode_mem; /* arkode memory */ diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index 7cfe1f14f1..d11f69d518 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -872,7 +872,8 @@ int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem) implicit, then we just declare 'success' no matter what is provided. ---------------------------------------------------------------*/ -int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, +int arkStep_NlsConvTest(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index ad1d72e2b1..5355311d98 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -410,9 +410,12 @@ static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the ARKBandPrecSolve function is always 0, indicating success. ---------------------------------------------------------------*/ -static int ARKBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bp_data) +static int ARKBandPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bp_data) { ARKBandPrecData pdata; int retval; diff --git a/src/arkode/arkode_bbdpre.c b/src/arkode/arkode_bbdpre.c index aa2c2fb652..f6445c8ede 100644 --- a/src/arkode/arkode_bbdpre.c +++ b/src/arkode/arkode_bbdpre.c @@ -426,7 +426,8 @@ int ARKBBDPrecGetNumGfnEvals(void* arkode_mem, long int* ngevalsBBDP) 0 if successful, 1 for a recoverable error (step will be retried). ---------------------------------------------------------------*/ -static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, +static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, sunbooleantype jok, sunbooleantype* jcurPtr, sunrealtype gamma, void* bbd_data) { @@ -517,9 +518,12 @@ static int ARKBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the ARKBBDPrecSolve function is the same as the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int ARKBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bbd_data) +static int ARKBBDPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bbd_data) { int retval; ARKBBDPrecData pdata; diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 1da8125942..bb244a80a9 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -216,8 +216,10 @@ int ERKStepReInit(void* arkode_mem, ARKRhsFn f, sunrealtype t0, N_Vector y0) This routine resizes the memory within the ERKStep module. ---------------------------------------------------------------*/ -int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, + SUNDIALS_MAYBE_UNUSED sunrealtype hscale, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, + void* resize_data) { ARKodeERKStepMem step_mem; sunindextype lrw1, liw1, lrw_diff, liw_diff; diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index f5a91d468c..80edfb6829 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -17,11 +17,12 @@ #ifndef _ARKODE_IMPL_H #define _ARKODE_IMPL_H +#include <stdarg.h> + #include <arkode/arkode.h> #include <arkode/arkode_butcher.h> #include <arkode/arkode_butcher_dirk.h> #include <arkode/arkode_butcher_erk.h> -#include <stdarg.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_adaptcontroller.h> @@ -33,6 +34,7 @@ #include "arkode_root_impl.h" #include "arkode_types_impl.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 7032f62e40..646b87ab6f 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -2547,7 +2547,8 @@ int arkLsMPSolve(void* arkode_mem, N_Vector r, N_Vector z, sunrealtype tol, int approximation routines. ---------------------------------------------------------------*/ int arkLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, - void* arkode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) + void* arkode_mem, N_Vector tmp1, N_Vector tmp2, + SUNDIALS_MAYBE_UNUSED N_Vector tmp3) { ARKodeMem ark_mem; ARKLsMem arkls_mem; @@ -2774,7 +2775,7 @@ int arkLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = fi(ark_mem->tcur, ytemp, ftemp, ark_mem->user_data); + retval = fi(t, ytemp, ftemp, ark_mem->user_data); arkls_mem->nfeDQ++; if (retval != 0) { break; } diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index ce77dde8d4..b4c727c506 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -347,8 +347,10 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, This routine resizes the memory within the MRIStep module. ---------------------------------------------------------------*/ -int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, + SUNDIALS_MAYBE_UNUSED sunrealtype hscale, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, + void* resize_data) { ARKodeMRIStepMem step_mem; SUNNonlinearSolver NLS; @@ -743,7 +745,8 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolSetupFn lsetup, ARKLinsolSolveFn lsolve, ARKLinsolFreeFn lfree, - SUNLinearSolver_Type lsolve_type, void* lmem) + SUNDIALS_MAYBE_UNUSED SUNLinearSolver_Type lsolve_type, + void* lmem) { ARKodeMRIStepMem step_mem; int retval; @@ -2107,8 +2110,10 @@ int mriStep_StageERKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) and involves evolution of the fast time scale, in a fully-coupled fashion. ---------------------------------------------------------------*/ -int mriStep_StageDIRKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is, - int* nflagPtr) +int mriStep_StageDIRKFast(ARKodeMem ark_mem, + SUNDIALS_MAYBE_UNUSED ARKodeMRIStepMem step_mem, + SUNDIALS_MAYBE_UNUSED int is, + SUNDIALS_MAYBE_UNUSED int* nflagPtr) { #ifdef SUNDIALS_DEBUG printf(" MRIStep DIRK fast stage\n"); @@ -2239,8 +2244,9 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ARK_SUCCESS -- successful evaluation ---------------------------------------------------------------*/ -int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, - int stage, sunrealtype cdiff) +int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, + ARKodeMRIStepMem step_mem, int stage, + sunrealtype cdiff) { sunrealtype rcdiff; int j, k, nmat, nstore, retval; diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index 4375806ade..39119403ad 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -556,7 +556,8 @@ int mriStep_NlsFPFunction(N_Vector zcor, N_Vector g, void* arkode_mem) implicit, then we just declare 'success' no matter what is provided. ---------------------------------------------------------------*/ -int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, +int mriStep_NlsConvTest(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem) { /* temporary variables */ diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index b824bbfb9c..e2307448b9 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -857,8 +857,7 @@ int arkRelaxDestroy(ARKodeRelaxMem relax_mem) } /* Compute and apply relaxation, called by driver */ -int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout, - int* nflag_out) +int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout) { int retval; sunrealtype relax_val; diff --git a/src/arkode/arkode_relaxation_impl.h b/src/arkode/arkode_relaxation_impl.h index a8c9001ed0..57830d38ff 100644 --- a/src/arkode/arkode_relaxation_impl.h +++ b/src/arkode/arkode_relaxation_impl.h @@ -103,8 +103,7 @@ int arkRelaxCreate(ARKodeMem ark_mem, ARKRelaxFn relax_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, - int* nflag_out); +int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout); /* User Functions */ int arkRelaxPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index b84bc328c1..0ae21c2741 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -246,8 +246,10 @@ int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, This routine resizes the memory within the SPRKStep module. ---------------------------------------------------------------*/ -int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data) +int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, + SUNDIALS_MAYBE_UNUSED sunrealtype hscale, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, ARKVecResizeFn resize, + void* resize_data) { ARKodeSPRKStepMem step_mem = NULL; sunindextype lrw1, liw1, lrw_diff, liw_diff; @@ -295,7 +297,8 @@ int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, problem from the given time with the input state (all counter values are retained). ---------------------------------------------------------------*/ -int sprkStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) +int sprkStep_Reset(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tR, + SUNDIALS_MAYBE_UNUSED N_Vector yR) { ARKodeSPRKStepMem step_mem = NULL; int retval = 0; diff --git a/src/arkode/arkode_user_controller.c b/src/arkode/arkode_user_controller.c index 29167a38cb..d10dbf923c 100644 --- a/src/arkode/arkode_user_controller.c +++ b/src/arkode/arkode_user_controller.c @@ -96,15 +96,14 @@ SUNAdaptController ARKUserControl(SUNContext sunctx, void* arkode_mem, * ----------------------------------------------------------------- */ SUNAdaptController_Type SUNAdaptController_GetType_ARKUserControl( - SUNAdaptController C) + SUNDIALS_MAYBE_UNUSED SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } -SUNErrCode SUNAdaptController_EstimateStep_ARKUserControl(SUNAdaptController C, - sunrealtype h, int p, - sunrealtype dsm, - sunrealtype* hnew) +SUNErrCode SUNAdaptController_EstimateStep_ARKUserControl( + SUNAdaptController C, sunrealtype h, SUNDIALS_MAYBE_UNUSED int p, + sunrealtype dsm, sunrealtype* hnew) { /* call user-provided function to compute new step */ sunrealtype ttmp = (dsm <= ONE) ? SC_ARKMEM(C)->tn + SC_ARKMEM(C)->h @@ -155,9 +154,8 @@ SUNErrCode SUNAdaptController_UpdateH_ARKUserControl(SUNAdaptController C, return SUN_SUCCESS; } -SUNErrCode SUNAdaptController_Space_ARKUserControl(SUNAdaptController C, - long int* lenrw, - long int* leniw) +SUNErrCode SUNAdaptController_Space_ARKUserControl( + SUNDIALS_MAYBE_UNUSED SUNAdaptController C, long int* lenrw, long int* leniw) { *lenrw = 4; *leniw = 2; diff --git a/src/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index 67e20edf1f..208c2c2888 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -283,8 +283,9 @@ int ARKBraid_GetSolution(braid_App app, sunrealtype* tout, N_Vector yout) * -------------------------- */ /* Take a time step */ -int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, - braid_Vector u, braid_StepStatus status) +int ARKBraid_Step(braid_App app, SUNDIALS_MAYBE_UNUSED braid_Vector ustop, + SUNDIALS_MAYBE_UNUSED braid_Vector fstop, braid_Vector u, + braid_StepStatus status) { braid_Int braid_flag; /* braid function return flag */ int ark_flag; /* arkode step return flag */ @@ -350,7 +351,8 @@ int ARKBraid_Step(braid_App app, braid_Vector ustop, braid_Vector fstop, } /* Create and initialize vectors */ -int ARKBraid_Init(braid_App app, sunrealtype t, braid_Vector* u_ptr) +int ARKBraid_Init(braid_App app, SUNDIALS_MAYBE_UNUSED sunrealtype t, + braid_Vector* u_ptr) { int flag; /* return flag */ N_Vector y; /* output N_Vector */ diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index f421257440..b19c32e1e5 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -435,9 +435,12 @@ static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the CVBandPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int CVBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bp_data) +static int CVBandPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bp_data) { CVBandPrecData pdata; int retval; diff --git a/src/cvode/cvode_bbdpre.c b/src/cvode/cvode_bbdpre.c index 6c8a28470b..4cdefc1c28 100644 --- a/src/cvode/cvode_bbdpre.c +++ b/src/cvode/cvode_bbdpre.c @@ -467,9 +467,10 @@ int CVBBDPrecGetNumGfnEvals(void* cvode_mem, long int* ngevalsBBDP) 0 if successful, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ -static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - sunbooleantype jok, sunbooleantype* jcurPtr, - sunrealtype gamma, void* bbd_data) +static int CVBBDPrecSetup(sunrealtype t, N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, sunbooleantype jok, + sunbooleantype* jcurPtr, sunrealtype gamma, + void* bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -556,9 +557,12 @@ static int CVBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the CVBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int CVBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bbd_data) +static int CVBBDPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bbd_data) { int retval; CVBBDPrecData pdata; diff --git a/src/cvode/cvode_diag.c b/src/cvode/cvode_diag.c index ab73f5ac55..25af67fbe9 100644 --- a/src/cvode/cvode_diag.c +++ b/src/cvode/cvode_diag.c @@ -320,9 +320,10 @@ static int CVDiagInit(CVodeMem cv_mem) * ----------------------------------------------------------------- */ -static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, - N_Vector vtemp2, N_Vector vtemp3) +static int CVDiagSetup(CVodeMem cv_mem, SUNDIALS_MAYBE_UNUSED int convfail, + N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, + N_Vector vtemp1, N_Vector vtemp2, + SUNDIALS_MAYBE_UNUSED N_Vector vtemp3) { sunrealtype r; N_Vector ftemp, y; @@ -412,8 +413,10 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, * ----------------------------------------------------------------- */ -static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, - N_Vector ycur, N_Vector fcur) +static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, + SUNDIALS_MAYBE_UNUSED N_Vector weight, + SUNDIALS_MAYBE_UNUSED N_Vector ycur, + SUNDIALS_MAYBE_UNUSED N_Vector fcur) { sunbooleantype invOK; sunrealtype r; diff --git a/src/cvode/cvode_fused_stubs.c b/src/cvode/cvode_fused_stubs.c index cd7aa6acd8..7bc41c5d6f 100644 --- a/src/cvode/cvode_fused_stubs.c +++ b/src/cvode/cvode_fused_stubs.c @@ -18,6 +18,7 @@ #include "cvode_diag_impl.h" #include "cvode_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define PT1 SUN_RCONST(0.1) @@ -121,10 +122,11 @@ int cvDiagSetup_formY(const sunrealtype h, const sunrealtype r, * ----------------------------------------------------------------- */ -int cvDiagSetup_buildM(const sunrealtype fract, const sunrealtype uround, - const sunrealtype h, const N_Vector ftemp, - const N_Vector fpred, const N_Vector ewt, N_Vector bit, - N_Vector bitcomp, N_Vector y, N_Vector M) +int cvDiagSetup_buildM(SUNDIALS_MAYBE_UNUSED const sunrealtype fract, + const sunrealtype uround, const sunrealtype h, + const N_Vector ftemp, const N_Vector fpred, + const N_Vector ewt, N_Vector bit, N_Vector bitcomp, + N_Vector y, N_Vector M) { N_VLinearSum(ONE, M, -ONE, fpred, M); N_VLinearSum(FRACT, ftemp, -h, M, M); diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index c8d08a32fb..e2f3a36350 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -22,10 +22,11 @@ #include <cvode/cvode.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_math.h> #include "cvode_proj_impl.h" -#include "sundials/sundials_math.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index 1a545a0886..1f23b850c0 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -104,6 +104,8 @@ int CVodeSetMonitorFn(void* cvode_mem, CVMonitorFn fn) cv_mem->cv_monitorfun = fn; return (CV_SUCCESS); #else + /* silence warnings when monitoring is disabled */ + ((void)fn); cvProcessError(cv_mem, CV_ILL_INPUT, __LINE__, __func__, __FILE__, "SUNDIALS was not built with monitoring enabled."); return (CV_ILL_INPUT); @@ -1023,6 +1025,8 @@ int CVodeSetUseIntegratorFusedKernels(void* cvode_mem, sunbooleantype onoff) cv_mem->cv_usefused = onoff; return (CV_SUCCESS); #else + /* silence warnings when fused kernels are disabled */ + ((void)onoff); cvProcessError(cv_mem, CV_ILL_INPUT, __LINE__, __func__, __FILE__, "CVODE was not built with fused integrator kernels enabled"); return (CV_ILL_INPUT); diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index a51ef16132..50c60c6e8b 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -977,7 +977,8 @@ int cvLsPSolve(void* cvode_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) approximation routines. ---------------------------------------------------------------*/ int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, - void* cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) + void* cvode_mem, N_Vector tmp1, N_Vector tmp2, + SUNDIALS_MAYBE_UNUSED N_Vector tmp3) { CVodeMem cv_mem; int retval; @@ -1213,7 +1214,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = cv_mem->cv_f(cv_mem->cv_tn, ytemp, ftemp, cv_mem->cv_user_data); + retval = cv_mem->cv_f(t, ytemp, ftemp, cv_mem->cv_user_data); cvls_mem->nfeDQ++; if (retval != 0) { break; } diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 4e2ac40d00..ad60c4e9e4 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -9402,8 +9402,8 @@ static int cvQuadSensEwtSetSV(CVodeMem cv_mem, N_Vector* yQScur, * Updates the norm old_nrm to account for all quadratures. */ -static sunrealtype cvQuadUpdateNorm(CVodeMem cv_mem, sunrealtype old_nrm, - N_Vector xQ, N_Vector wQ) +static sunrealtype cvQuadUpdateNorm(SUNDIALS_MAYBE_UNUSED CVodeMem cv_mem, + sunrealtype old_nrm, N_Vector xQ, N_Vector wQ) { sunrealtype qnrm; @@ -9620,9 +9620,9 @@ int cvSensRhsInternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, * non-zero return value from f(). */ -int cvSensRhs1InternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, - int is, N_Vector yS, N_Vector ySdot, void* cvode_mem, - N_Vector ytemp, N_Vector ftemp) +int cvSensRhs1InternalDQ(SUNDIALS_MAYBE_UNUSED int Ns, sunrealtype t, N_Vector y, + N_Vector ydot, int is, N_Vector yS, N_Vector ySdot, + void* cvode_mem, N_Vector ytemp, N_Vector ftemp) { CVodeMem cv_mem; int retval, method; diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index 98a9308759..55dbe1afbb 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -438,9 +438,12 @@ static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the cvBandPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int cvBandPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bp_data) +static int cvBandPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bp_data) { CVBandPrecData pdata; int retval; diff --git a/src/cvodes/cvodes_bbdpre.c b/src/cvodes/cvodes_bbdpre.c index af9cba7900..12eb1b7883 100644 --- a/src/cvodes/cvodes_bbdpre.c +++ b/src/cvodes/cvodes_bbdpre.c @@ -479,9 +479,10 @@ int CVBBDPrecGetNumGfnEvals(void* cvode_mem, long int* ngevalsBBDP) 0 if successful, 1 for a recoverable error (step will be retried). -----------------------------------------------------------------*/ -static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, - sunbooleantype jok, sunbooleantype* jcurPtr, - sunrealtype gamma, void* bbd_data) +static int cvBBDPrecSetup(sunrealtype t, N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, sunbooleantype jok, + sunbooleantype* jcurPtr, sunrealtype gamma, + void* bbd_data) { CVBBDPrecData pdata; CVodeMem cv_mem; @@ -568,9 +569,12 @@ static int cvBBDPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, The value returned by the cvBBDPrecSolve function is always 0, indicating success. -----------------------------------------------------------------*/ -static int cvBBDPrecSolve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, - N_Vector z, sunrealtype gamma, sunrealtype delta, - int lr, void* bbd_data) +static int cvBBDPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype t, + SUNDIALS_MAYBE_UNUSED N_Vector y, + SUNDIALS_MAYBE_UNUSED N_Vector fy, N_Vector r, + N_Vector z, SUNDIALS_MAYBE_UNUSED sunrealtype gamma, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + SUNDIALS_MAYBE_UNUSED int lr, void* bbd_data) { int retval; CVBBDPrecData pdata; diff --git a/src/cvodes/cvodes_diag.c b/src/cvodes/cvodes_diag.c index b1db687e4b..857a81bf73 100644 --- a/src/cvodes/cvodes_diag.c +++ b/src/cvodes/cvodes_diag.c @@ -326,9 +326,10 @@ static int CVDiagInit(CVodeMem cv_mem) * ----------------------------------------------------------------- */ -static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, - N_Vector fpred, sunbooleantype* jcurPtr, N_Vector vtemp1, - N_Vector vtemp2, N_Vector vtemp3) +static int CVDiagSetup(CVodeMem cv_mem, SUNDIALS_MAYBE_UNUSED int convfail, + N_Vector ypred, N_Vector fpred, sunbooleantype* jcurPtr, + N_Vector vtemp1, N_Vector vtemp2, + SUNDIALS_MAYBE_UNUSED N_Vector vtemp3) { sunrealtype r; N_Vector ftemp, y; @@ -400,8 +401,10 @@ static int CVDiagSetup(CVodeMem cv_mem, int convfail, N_Vector ypred, * ----------------------------------------------------------------- */ -static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, - N_Vector ycur, N_Vector fcur) +static int CVDiagSolve(CVodeMem cv_mem, N_Vector b, + SUNDIALS_MAYBE_UNUSED N_Vector weight, + SUNDIALS_MAYBE_UNUSED N_Vector ycur, + SUNDIALS_MAYBE_UNUSED N_Vector fcur) { sunbooleantype invOK; sunrealtype r; diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index e98b88b371..c22d166359 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -18,12 +18,14 @@ #define _CVODES_IMPL_H #include <stdarg.h> + +#include <cvodes/cvodes.h> #include <sundials/priv/sundials_context_impl.h> +#include <sundials/sundials_math.h> -#include "cvodes/cvodes.h" #include "cvodes_proj_impl.h" -#include "sundials/sundials_math.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index 4114259b23..e4599bd853 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -104,6 +104,8 @@ int CVodeSetMonitorFn(void* cvode_mem, CVMonitorFn fn) cv_mem->cv_monitorfun = fn; return (CV_SUCCESS); #else + /* silence warnings when monitoring is disabled */ + ((void)fn); cvProcessError(cv_mem, CV_ILL_INPUT, __LINE__, __func__, __FILE__, "SUNDIALS was not built with monitoring enabled."); return (CV_ILL_INPUT); diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index 6c7362d74b..539a69a1d4 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -1055,7 +1055,8 @@ int cvLsPSolve(void* cvode_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) approximation routines. ---------------------------------------------------------------*/ int cvLsDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, - void* cvode_mem, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) + void* cvode_mem, N_Vector tmp1, N_Vector tmp2, + SUNDIALS_MAYBE_UNUSED N_Vector tmp3) { CVodeMem cv_mem; int retval; @@ -1291,7 +1292,7 @@ int cvLsBandDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, } /* Evaluate f with incremented y */ - retval = cv_mem->cv_f(cv_mem->cv_tn, ytemp, ftemp, cv_mem->cv_user_data); + retval = cv_mem->cv_f(t, ytemp, ftemp, cv_mem->cv_user_data); cvls_mem->nfeDQ++; if (retval != 0) { break; } @@ -2884,7 +2885,7 @@ int cvLs_AccessLMemBCur(void* cvode_mem, const char* fname, CVodeMem* cv_mem, /* access CVodeMem structure */ if (cvode_mem == NULL) { - cvProcessError(NULL, CVLS_MEM_NULL, __LINE__, __func__, __FILE__, + cvProcessError(NULL, CVLS_MEM_NULL, __LINE__, fname, __FILE__, MSG_LS_CVMEM_NULL); return (CVLS_MEM_NULL); } @@ -2893,7 +2894,7 @@ int cvLs_AccessLMemBCur(void* cvode_mem, const char* fname, CVodeMem* cv_mem, /* access CVadjMem structure */ if ((*cv_mem)->cv_adjMallocDone == SUNFALSE) { - cvProcessError(*cv_mem, CVLS_NO_ADJ, __LINE__, __func__, __FILE__, + cvProcessError(*cv_mem, CVLS_NO_ADJ, __LINE__, fname, __FILE__, MSG_LS_NO_ADJ); return (CVLS_NO_ADJ); } @@ -2902,7 +2903,7 @@ int cvLs_AccessLMemBCur(void* cvode_mem, const char* fname, CVodeMem* cv_mem, /* get current backward problem */ if ((*ca_mem)->ca_bckpbCrt == NULL) { - cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, __func__, __FILE__, + cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, fname, __FILE__, MSG_LS_LMEMB_NULL); return (CVLS_LMEMB_NULL); } @@ -2911,7 +2912,7 @@ int cvLs_AccessLMemBCur(void* cvode_mem, const char* fname, CVodeMem* cv_mem, /* access CVLsMemB structure */ if ((*cvB_mem)->cv_lmem == NULL) { - cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, __func__, __FILE__, + cvProcessError(*cv_mem, CVLS_LMEMB_NULL, __LINE__, fname, __FILE__, MSG_LS_LMEMB_NULL); return (CVLS_LMEMB_NULL); } diff --git a/src/cvodes/cvodes_nls_stg1.c b/src/cvodes/cvodes_nls_stg1.c index a1b4fdc3d0..c292572b10 100644 --- a/src/cvodes/cvodes_nls_stg1.c +++ b/src/cvodes/cvodes_nls_stg1.c @@ -258,7 +258,8 @@ static int cvNlsLSolveSensStg1(N_Vector delta, void* cvode_mem) return (CV_SUCCESS); } -static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, N_Vector ycor, +static int cvNlsConvTestSensStg1(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector delta, sunrealtype tol, N_Vector ewt, void* cvode_mem) { diff --git a/src/ida/ida_bbdpre.c b/src/ida/ida_bbdpre.c index 2352ff3b64..8bce33eea7 100644 --- a/src/ida/ida_bbdpre.c +++ b/src/ida/ida_bbdpre.c @@ -455,7 +455,8 @@ int IDABBDPrecGetNumGfnEvals(void* ida_mem, long int* ngevalsBBDP) < 0 for a nonrecoverable error (step fails). ----------------------------------------------------------------*/ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, sunrealtype c_j, void* bbd_data) + SUNDIALS_MAYBE_UNUSED N_Vector rr, sunrealtype c_j, + void* bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -502,9 +503,13 @@ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, N_Vector rvec, N_Vector zvec, - sunrealtype c_j, sunrealtype delta, void* bbd_data) +static int IDABBDPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype tt, + SUNDIALS_MAYBE_UNUSED N_Vector yy, + SUNDIALS_MAYBE_UNUSED N_Vector yp, + SUNDIALS_MAYBE_UNUSED N_Vector rr, N_Vector rvec, + N_Vector zvec, SUNDIALS_MAYBE_UNUSED sunrealtype c_j, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + void* bbd_data) { IBBDPrecData pdata; int retval; diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index b68debbccb..f61a79381e 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -20,10 +20,12 @@ #define _IDA_IMPL_H #include <stdarg.h> + +#include <ida/ida.h> #include <sundials/priv/sundials_context_impl.h> -#include "ida/ida.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index c0a0c73649..a8e2707208 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -860,7 +860,8 @@ int idaLsPSetup(void* ida_mem) is the only case in which the user's psolve routine is allowed to be NULL. ---------------------------------------------------------------*/ -int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) +int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, + SUNDIALS_MAYBE_UNUSED int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1138,7 +1139,7 @@ int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, /* Increment yj and ypj. */ ytemp_data[j] += inc; - yptemp_data[j] += IDA_mem->ida_cj * inc; + yptemp_data[j] += c_j * inc; } /* Call res routine with incremented arguments. */ diff --git a/src/ida/ida_nls.c b/src/ida/ida_nls.c index 8873023638..160b817327 100644 --- a/src/ida/ida_nls.c +++ b/src/ida/ida_nls.c @@ -233,7 +233,8 @@ int idaNlsInit(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetup(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, + sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -318,7 +319,8 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) return (IDA_SUCCESS); } -static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, +static int idaNlsConvTest(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; diff --git a/src/idas/idas.c b/src/idas/idas.c index 1cf688a5d0..3174660c12 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -7836,8 +7836,9 @@ static sunrealtype IDAQuadSensWrmsNorm(IDAMem IDA_mem, N_Vector* xQS, * Updates the norm old_nrm to account for all quadratures. */ -static sunrealtype IDAQuadWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, - N_Vector xQ, N_Vector wQ) +static sunrealtype IDAQuadWrmsNormUpdate(SUNDIALS_MAYBE_UNUSED IDAMem IDA_mem, + sunrealtype old_nrm, N_Vector xQ, + N_Vector wQ) { sunrealtype qnrm; @@ -8441,10 +8442,10 @@ int IDASensResDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, * (<0 if res fails unrecoverably, >0 if res has a recoverable error). */ -static int IDASensRes1DQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector resval, int is, N_Vector yyS, N_Vector ypS, - N_Vector resvalS, void* user_dataS, N_Vector ytemp, - N_Vector yptemp, N_Vector restemp) +static int IDASensRes1DQ(SUNDIALS_MAYBE_UNUSED int Ns, sunrealtype t, N_Vector yy, + N_Vector yp, N_Vector resval, int is, N_Vector yyS, + N_Vector ypS, N_Vector resvalS, void* user_dataS, + N_Vector ytemp, N_Vector yptemp, N_Vector restemp) { IDAMem IDA_mem; int method; diff --git a/src/idas/idas_bbdpre.c b/src/idas/idas_bbdpre.c index a584499293..25521a90d1 100644 --- a/src/idas/idas_bbdpre.c +++ b/src/idas/idas_bbdpre.c @@ -469,7 +469,8 @@ int IDABBDPrecGetNumGfnEvals(void* ida_mem, long int* ngevalsBBDP) < 0 for a nonrecoverable error (step fails). ----------------------------------------------------------------*/ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, sunrealtype c_j, void* bbd_data) + SUNDIALS_MAYBE_UNUSED N_Vector rr, sunrealtype c_j, + void* bbd_data) { IBBDPrecData pdata; IDAMem IDA_mem; @@ -516,9 +517,13 @@ static int IDABBDPrecSetup(sunrealtype tt, N_Vector yy, N_Vector yp, IDABBDPrecSolve returns the value returned from the linear solver object. ---------------------------------------------------------------*/ -static int IDABBDPrecSolve(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector rr, N_Vector rvec, N_Vector zvec, - sunrealtype c_j, sunrealtype delta, void* bbd_data) +static int IDABBDPrecSolve(SUNDIALS_MAYBE_UNUSED sunrealtype tt, + SUNDIALS_MAYBE_UNUSED N_Vector yy, + SUNDIALS_MAYBE_UNUSED N_Vector yp, + SUNDIALS_MAYBE_UNUSED N_Vector rr, N_Vector rvec, + N_Vector zvec, SUNDIALS_MAYBE_UNUSED sunrealtype c_j, + SUNDIALS_MAYBE_UNUSED sunrealtype delta, + void* bbd_data) { IBBDPrecData pdata; int retval; diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index 90abcbcf8d..e54b593bc5 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -19,10 +19,12 @@ #define _IDAS_IMPL_H #include <stdarg.h> + +#include <idas/idas.h> #include <sundials/priv/sundials_context_impl.h> -#include "idas/idas.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index dc0c0bab52..088bcbb015 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -901,7 +901,8 @@ int idaLsPSetup(void* ida_mem) is the only case in which the user's psolve routine is allowed to be NULL. ---------------------------------------------------------------*/ -int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, int lr) +int idaLsPSolve(void* ida_mem, N_Vector r, N_Vector z, sunrealtype tol, + SUNDIALS_MAYBE_UNUSED int lr) { IDAMem IDA_mem; IDALsMem idals_mem; @@ -1179,7 +1180,7 @@ int idaLsBandDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, /* Increment yj and ypj. */ ytemp_data[j] += inc; - yptemp_data[j] += IDA_mem->ida_cj * inc; + yptemp_data[j] += c_j * inc; } /* Call res routine with incremented arguments. */ diff --git a/src/idas/idas_nls.c b/src/idas/idas_nls.c index 034f2c3612..17ba1e6b5d 100644 --- a/src/idas/idas_nls.c +++ b/src/idas/idas_nls.c @@ -233,7 +233,8 @@ int idaNlsInit(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* ida_mem) +static int idaNlsLSetup(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, + sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -321,7 +322,8 @@ static int idaNlsResidual(N_Vector ycor, N_Vector res, void* ida_mem) return (IDA_SUCCESS); } -static int idaNlsConvTest(SUNNonlinearSolver NLS, N_Vector ycor, N_Vector del, +static int idaNlsConvTest(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { IDAMem IDA_mem; diff --git a/src/idas/idas_nls_sim.c b/src/idas/idas_nls_sim.c index d23a6c2bf8..d527189905 100644 --- a/src/idas/idas_nls_sim.c +++ b/src/idas/idas_nls_sim.c @@ -277,8 +277,8 @@ int idaNlsInitSensSim(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetupSensSim(sunbooleantype jbad, sunbooleantype* jcur, - void* ida_mem) +static int idaNlsLSetupSensSim(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, + sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -415,7 +415,8 @@ static int idaNlsResidualSensSim(N_Vector ycorSim, N_Vector resSim, void* ida_me return (IDA_SUCCESS); } -static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, N_Vector ycor, +static int idaNlsConvTestSensSim(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { diff --git a/src/idas/idas_nls_stg.c b/src/idas/idas_nls_stg.c index 6311cf659a..3e1590c780 100644 --- a/src/idas/idas_nls_stg.c +++ b/src/idas/idas_nls_stg.c @@ -232,8 +232,8 @@ int idaNlsInitSensStg(IDAMem IDA_mem) return (IDA_SUCCESS); } -static int idaNlsLSetupSensStg(sunbooleantype jbad, sunbooleantype* jcur, - void* ida_mem) +static int idaNlsLSetupSensStg(SUNDIALS_MAYBE_UNUSED sunbooleantype jbad, + sunbooleantype* jcur, void* ida_mem) { IDAMem IDA_mem; int retval; @@ -326,7 +326,8 @@ static int idaNlsResidualSensStg(N_Vector ycorStg, N_Vector resStg, void* ida_me return (IDA_SUCCESS); } -static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, N_Vector ycor, +static int idaNlsConvTestSensStg(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector ycor, N_Vector del, sunrealtype tol, N_Vector ewt, void* ida_mem) { diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 982e9e9f2e..344451d5c0 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -2491,8 +2491,10 @@ static sunrealtype KINScSNorm(KINMem kin_mem, N_Vector v, N_Vector u) * passes it to the info handler function. */ -void KINPrintInfo(KINMem kin_mem, int info_code, const char* module, - const char* fname, const char* msgfmt, ...) +void KINPrintInfo(SUNDIALS_MAYBE_UNUSED KINMem kin_mem, int info_code, + SUNDIALS_MAYBE_UNUSED const char* module, + SUNDIALS_MAYBE_UNUSED const char* fname, const char* msgfmt, + ...) { va_list ap; char msg[256], msg1[40]; @@ -2540,7 +2542,7 @@ void KINPrintInfo(KINMem kin_mem, int info_code, const char* module, { /* Compose the message */ - vsprintf(msg, msgfmt, ap); + vsnprintf(msg, sizeof msg, msgfmt, ap); } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO diff --git a/src/kinsol/kinsol_bbdpre.c b/src/kinsol/kinsol_bbdpre.c index 3cd8b78e5f..7025f38a82 100644 --- a/src/kinsol/kinsol_bbdpre.c +++ b/src/kinsol/kinsol_bbdpre.c @@ -399,8 +399,9 @@ int KINBBDPrecGetNumGfnEvals(void* kinmem, long int* ngevalsBBDP) 0 if successful, > 0 for a recoverable error - step will be retried. ------------------------------------------------------------------*/ -static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, N_Vector fval, - N_Vector fscale, void* bbd_data) +static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, + SUNDIALS_MAYBE_UNUSED N_Vector fval, + SUNDIALS_MAYBE_UNUSED N_Vector fscale, void* bbd_data) { KBBDPrecData pdata; KINMem kin_mem; @@ -463,8 +464,11 @@ static int KINBBDPrecSetup(N_Vector uu, N_Vector uscale, N_Vector fval, flag returned from the lienar solver object. ------------------------------------------------------------------*/ -static int KINBBDPrecSolve(N_Vector uu, N_Vector uscale, N_Vector fval, - N_Vector fscale, N_Vector vv, void* bbd_data) +static int KINBBDPrecSolve(SUNDIALS_MAYBE_UNUSED N_Vector uu, + SUNDIALS_MAYBE_UNUSED N_Vector uscale, + SUNDIALS_MAYBE_UNUSED N_Vector fval, + SUNDIALS_MAYBE_UNUSED N_Vector fscale, N_Vector vv, + void* bbd_data) { KBBDPrecData pdata; sunrealtype* vd; diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 7122c076cc..117bf003f5 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -20,12 +20,14 @@ #ifndef _KINSOL_IMPL_H #define _KINSOL_IMPL_H -#include <kinsol/kinsol.h> #include <stdarg.h> + +#include <kinsol/kinsol.h> #include <sundials/priv/sundials_context_impl.h> #include "sundials_iterative_impl.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 684995a069..37c706e01d 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -678,7 +678,9 @@ int kinLsPSetup(void* kinmem) in the case in which preconditioning is not done. This is the only case in which the user's psolve routine is allowed to be NULL. ------------------------------------------------------------------*/ -int kinLsPSolve(void* kinmem, N_Vector r, N_Vector z, sunrealtype tol, int lr) +int kinLsPSolve(void* kinmem, N_Vector r, N_Vector z, + SUNDIALS_MAYBE_UNUSED sunrealtype tol, + SUNDIALS_MAYBE_UNUSED int lr) { KINMem kin_mem; KINLsMem kinls_mem; @@ -941,8 +943,8 @@ int kinLsBandDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, KINMem kin_mem, a recovery may still be possible even if the system function fails (recoverably). ------------------------------------------------------------------*/ -int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, sunbooleantype* new_u, - void* kinmem) +int kinLsDQJtimes(N_Vector v, N_Vector Jv, N_Vector u, + SUNDIALS_MAYBE_UNUSED sunbooleantype* new_u, void* kinmem) { sunrealtype sigma, sigma_inv, sutsv, sq1norm, sign, vtv; KINMem kin_mem; diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index d52cc4fee7..31c74c78da 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -18,9 +18,9 @@ #include <stdio.h> #include <stdlib.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" +#include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> +#include <sundials/sundials_types.h> #ifdef MANYVECTOR_BUILD_WITH_MPI #include <nvector/nvector_mpimanyvector.h> #include <sundials/priv/sundials_mpi_errors_impl.h> @@ -31,6 +31,8 @@ #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include "sundials_macros.h" + /* Macro to handle separate MPI-aware/unaware installations */ #ifdef MANYVECTOR_BUILD_WITH_MPI #define MVAPPEND(fun) fun##_MPIManyVector @@ -472,7 +474,7 @@ sunindextype MVAPPEND(N_VGetNumSubvectors)(N_Vector v) /* Returns vector type ID. Used to identify vector implementation from abstract N_Vector interface. */ -N_Vector_ID MVAPPEND(N_VGetVectorID)(N_Vector v) +N_Vector_ID MVAPPEND(N_VGetVectorID)(SUNDIALS_MAYBE_UNUSED N_Vector v) { #ifdef MANYVECTOR_BUILD_WITH_MPI return (SUNDIALS_NVEC_MPIMANYVECTOR); diff --git a/src/nvector/mpiplusx/nvector_mpiplusx.c b/src/nvector/mpiplusx/nvector_mpiplusx.c index e8be7eb0cd..a955dfcf09 100644 --- a/src/nvector/mpiplusx/nvector_mpiplusx.c +++ b/src/nvector/mpiplusx/nvector_mpiplusx.c @@ -18,9 +18,9 @@ #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define MPIPLUSX_LOCAL_VECTOR(v) (N_VGetSubvector_MPIManyVector(v, 0)) @@ -49,7 +49,7 @@ N_Vector N_VMake_MPIPlusX(MPI_Comm comm, N_Vector X, SUNContext sunctx) return v; } -N_Vector_ID N_VGetVectorID_MPIPlusX(N_Vector v) +N_Vector_ID N_VGetVectorID_MPIPlusX(SUNDIALS_MAYBE_UNUSED N_Vector v) { return SUNDIALS_NVEC_MPIPLUSX; } diff --git a/src/nvector/openmp/nvector_openmp.c b/src/nvector/openmp/nvector_openmp.c index 649a27a6df..bcb1f6d6b6 100644 --- a/src/nvector/openmp/nvector_openmp.c +++ b/src/nvector/openmp/nvector_openmp.c @@ -20,16 +20,18 @@ * of the NVECTOR module. * -----------------------------------------------------------------*/ -#include <nvector/nvector_openmp.h> #include <omp.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_openmp.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_context.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/sundials_context.h" -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -82,7 +84,10 @@ static void VaxpyVectorArray_OpenMP(int nvec, sunrealtype a, N_Vector* X, * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_OpenMP(N_Vector v) { return SUNDIALS_NVEC_OPENMP; } +N_Vector_ID N_VGetVectorID_OpenMP(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return SUNDIALS_NVEC_OPENMP; +} /* ---------------------------------------------------------------------------- * Function to create a new empty vector diff --git a/src/nvector/parallel/nvector_parallel.c b/src/nvector/parallel/nvector_parallel.c index a438b4eb29..eb278bc21d 100644 --- a/src/nvector/parallel/nvector_parallel.c +++ b/src/nvector/parallel/nvector_parallel.c @@ -16,14 +16,16 @@ * of the NVECTOR package. * -----------------------------------------------------------------*/ -#include <nvector/nvector_parallel.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_parallel.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/priv/sundials_mpi_errors_impl.h> +#include <sundials/sundials_errors.h> +#include <sundials/sundials_types.h> -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -242,6 +244,15 @@ N_Vector N_VMake_Parallel(MPI_Comm comm, sunindextype local_length, return (v); } +/* ---------------------------------------------------------------- + * Returns vector type ID. Used to identify vector implementation + * from abstract N_Vector interface. + */ +N_Vector_ID N_VGetVectorID_Parallel(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return SUNDIALS_NVEC_PARALLEL; +} + /* ---------------------------------------------------------------- * Function to return global vector length */ diff --git a/src/nvector/parhyp/nvector_parhyp.c b/src/nvector/parhyp/nvector_parhyp.c index 4e9ef4d50c..aee1f08450 100644 --- a/src/nvector/parhyp/nvector_parhyp.c +++ b/src/nvector/parhyp/nvector_parhyp.c @@ -18,13 +18,15 @@ * for the NVECTOR package. * -----------------------------------------------------------------*/ -#include <nvector/nvector_parhyp.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_parhyp.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> +#include <sundials/sundials_nvector.h> -#include "sundials/sundials_errors.h" -#include "sundials/sundials_nvector.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -136,7 +138,10 @@ static void VLin2_ParHyp(sunrealtype a, N_Vector x, N_Vector y, N_Vector z); * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_ParHyp(N_Vector v) { return SUNDIALS_NVEC_PARHYP; } +N_Vector_ID N_VGetVectorID_ParHyp(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return SUNDIALS_NVEC_PARHYP; +} /* ---------------------------------------------------------------- * Function to create a new parhyp vector without underlying @@ -161,8 +166,6 @@ N_Vector N_VNewEmpty_ParHyp(MPI_Comm comm, sunindextype local_length, v->ops->nvcloneempty = N_VCloneEmpty_ParHyp; v->ops->nvdestroy = N_VDestroy_ParHyp; v->ops->nvspace = N_VSpace_ParHyp; - v->ops->nvgetarraypointer = N_VGetArrayPointer_ParHyp; - v->ops->nvsetarraypointer = N_VSetArrayPointer_ParHyp; v->ops->nvgetcommunicator = N_VGetCommunicator_ParHyp; v->ops->nvgetlength = N_VGetLength_ParHyp; @@ -426,7 +429,7 @@ void N_VSpace_ParHyp(N_Vector v, sunindextype* lrw, sunindextype* liw) * then use HYPRE functions to get pointer to raw data of the local HYPRE * vector. */ -sunrealtype* N_VGetArrayPointer_ParHyp(N_Vector v) +sunrealtype* N_VGetArrayPointer_ParHyp(SUNDIALS_MAYBE_UNUSED N_Vector v) { return NULL; /* ((sunrealtype *) NV_DATA_PH(v)); */ } @@ -435,7 +438,8 @@ sunrealtype* N_VGetArrayPointer_ParHyp(N_Vector v) * This method is not implemented for HYPRE vector wrapper. * TODO: Put error handler in the function body. */ -void N_VSetArrayPointer_ParHyp(sunrealtype* v_data, N_Vector v) +void N_VSetArrayPointer_ParHyp(SUNDIALS_MAYBE_UNUSED sunrealtype* v_data, + SUNDIALS_MAYBE_UNUSED N_Vector v) { /* Not implemented for Hypre vector */ } diff --git a/src/nvector/petsc/nvector_petsc.c b/src/nvector/petsc/nvector_petsc.c index 87960d839a..f3accf46bd 100644 --- a/src/nvector/petsc/nvector_petsc.c +++ b/src/nvector/petsc/nvector_petsc.c @@ -18,12 +18,14 @@ * of the NVECTOR package. * -----------------------------------------------------------------*/ -#include <nvector/nvector_petsc.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_petsc.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -101,7 +103,10 @@ * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_Petsc(N_Vector v) { return SUNDIALS_NVEC_PETSC; } +N_Vector_ID N_VGetVectorID_Petsc(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return SUNDIALS_NVEC_PETSC; +} /* ---------------------------------------------------------------- * Function to create a new N_Vector wrapper with an empty (NULL) @@ -139,8 +144,6 @@ N_Vector N_VNewEmpty_Petsc(MPI_Comm comm, sunindextype local_length, v->ops->nvcloneempty = N_VCloneEmpty_Petsc; v->ops->nvdestroy = N_VDestroy_Petsc; v->ops->nvspace = N_VSpace_Petsc; - v->ops->nvgetarraypointer = N_VGetArrayPointer_Petsc; - v->ops->nvsetarraypointer = N_VSetArrayPointer_Petsc; v->ops->nvgetcommunicator = N_VGetCommunicator_Petsc; v->ops->nvgetlength = N_VGetLength_Petsc; @@ -397,12 +400,19 @@ void N_VSpace_Petsc(N_Vector v, sunindextype* lrw, sunindextype* liw) /* * Not implemented for PETSc wrapper. */ -sunrealtype* N_VGetArrayPointer_Petsc(N_Vector v) { return NULL; } +sunrealtype* N_VGetArrayPointer_Petsc(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return NULL; +} /* * Not implemented for PETSc wrapper. */ -void N_VSetArrayPointer_Petsc(sunrealtype* v_data, N_Vector v) { return; } +void N_VSetArrayPointer_Petsc(SUNDIALS_MAYBE_UNUSED sunrealtype* v_data, + SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return; +} MPI_Comm N_VGetCommunicator_Petsc(N_Vector v) { return (NV_COMM_PTC(v)); } diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 6938934059..5e5314afb3 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -21,16 +21,17 @@ * structures to pass data to threads. * -----------------------------------------------------------------*/ -#include <math.h> /* define NAN */ -#include <nvector/nvector_pthreads.h> +#include <math.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_pthreads.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -153,7 +154,7 @@ static void nvInitThreadData(Pthreads_Data* thread_data); * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_Pthreads(N_Vector v) +N_Vector_ID N_VGetVectorID_Pthreads(SUNDIALS_MAYBE_UNUSED N_Vector v) { return SUNDIALS_NVEC_PTHREADS; } diff --git a/src/nvector/serial/nvector_serial.c b/src/nvector/serial/nvector_serial.c index a4a1bff95a..255aca3fb6 100644 --- a/src/nvector/serial/nvector_serial.c +++ b/src/nvector/serial/nvector_serial.c @@ -16,14 +16,16 @@ * of the NVECTOR package. * -----------------------------------------------------------------*/ -#include <nvector/nvector_serial.h> #include <stdio.h> #include <stdlib.h> + +#include <nvector/nvector_serial.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -217,6 +219,15 @@ N_Vector N_VMake_Serial(sunindextype length, sunrealtype* v_data, return (v); } +/* ---------------------------------------------------------------- + * Returns vector type ID. Used to identify vector implementation + * from abstract N_Vector interface. + */ +N_Vector_ID N_VGetVectorID_Serial(SUNDIALS_MAYBE_UNUSED N_Vector v) +{ + return SUNDIALS_NVEC_SERIAL; +} + /* ---------------------------------------------------------------------------- * Function to return number of vector elements */ diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index fdb28b7ef5..880bb33c95 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -18,11 +18,14 @@ * of the NVECTOR package. * -----------------------------------------------------------------*/ +#include <stdio.h> +#include <stdlib.h> + #include <nvector/nvector_trilinos.h> #include <nvector/trilinos/SundialsTpetraVectorInterface.hpp> #include <nvector/trilinos/SundialsTpetraVectorKernels.hpp> -#include <stdio.h> -#include <stdlib.h> + +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define HALF SUN_RCONST(0.5) @@ -55,7 +58,7 @@ typedef TpetraVectorInterface::vector_type vector_type; * Returns vector type ID. Used to identify vector implementation * from abstract N_Vector interface. */ -N_Vector_ID N_VGetVectorID_Trilinos(N_Vector v) +N_Vector_ID N_VGetVectorID_Trilinos(SUNDIALS_MAYBE_UNUSED N_Vector v) { return SUNDIALS_NVEC_TRILINOS; } diff --git a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c index 11075d477f..e4bb23e6dd 100644 --- a/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c +++ b/src/sunadaptcontroller/imexgus/sunadaptcontroller_imexgus.c @@ -17,11 +17,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sunadaptcontroller/sunadaptcontroller_imexgus.h> +#include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" /* --------------- * Macro accessors @@ -113,7 +115,8 @@ SUNErrCode SUNAdaptController_SetParams_ImExGus(SUNAdaptController C, * implementation of controller operations * ----------------------------------------------------------------- */ -SUNAdaptController_Type SUNAdaptController_GetType_ImExGus(SUNAdaptController C) +SUNAdaptController_Type SUNAdaptController_GetType_ImExGus( + SUNDIALS_MAYBE_UNUSED SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } diff --git a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c index da60d812f1..bca88252cb 100644 --- a/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c +++ b/src/sunadaptcontroller/soderlind/sunadaptcontroller_soderlind.c @@ -17,11 +17,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" /* --------------- * Macro accessors @@ -297,7 +299,8 @@ SUNErrCode SUNAdaptController_SetParams_ImpGus(SUNAdaptController C, * implementation of controller operations * ----------------------------------------------------------------- */ -SUNAdaptController_Type SUNAdaptController_GetType_Soderlind(SUNAdaptController C) +SUNAdaptController_Type SUNAdaptController_GetType_Soderlind( + SUNDIALS_MAYBE_UNUSED SUNAdaptController C) { return SUN_ADAPTCONTROLLER_H; } diff --git a/src/sundials/sundials_context.c b/src/sundials/sundials_context.c index b3c847e682..86b0a49c34 100644 --- a/src/sundials/sundials_context.c +++ b/src/sundials/sundials_context.c @@ -18,15 +18,17 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_context.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_logger.h> #include <sundials/sundials_profiler.h> +#include <sundials/sundials_types.h> -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" #include "sundials_adiak_metadata.h" +#include "sundials_macros.h" SUNErrCode SUNContext_Create(SUNComm comm, SUNContext* sunctx_out) { @@ -209,6 +211,9 @@ SUNErrCode SUNContext_SetProfiler(SUNContext sunctx, SUNProfiler profiler) /* set profiler */ sunctx->profiler = profiler; sunctx->own_profiler = SUNFALSE; +#else + /* silence warnings when profiling is disabled */ + ((void)profiler); #endif return SUN_SUCCESS; diff --git a/src/sundials/sundials_errors.c b/src/sundials/sundials_errors.c index 667a3a4e07..acc3a0e5bc 100644 --- a/src/sundials/sundials_errors.c +++ b/src/sundials/sundials_errors.c @@ -10,17 +10,18 @@ * SUNDIALS Copyright End * -----------------------------------------------------------------*/ -#include "sundials/sundials_errors.h" - #include <stdarg.h> #include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_errors.h> +#include <sundials/sundials_logger.h> +#include <sundials/sundials_types.h> -#include "sundials/sundials_logger.h" -#include "sundials/sundials_types.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #include "sundials_utils.h" SUNErrCode SUNErrHandler_Create(SUNErrHandlerFn eh_fn, void* eh_data, @@ -62,7 +63,8 @@ const char* SUNGetErrMsg(SUNErrCode code) void SUNLogErrHandlerFn(int line, const char* func, const char* file, const char* msg, SUNErrCode err_code, - void* err_user_data, SUNContext sunctx) + SUNDIALS_MAYBE_UNUSED void* err_user_data, + SUNContext sunctx) { char* file_and_line = sunCombineFileAndLine(line, file); if (msg == NULL) { msg = SUNGetErrMsg(err_code); } @@ -72,8 +74,10 @@ void SUNLogErrHandlerFn(int line, const char* func, const char* file, } void SUNAbortErrHandlerFn(int line, const char* func, const char* file, - const char* msg, SUNErrCode err_code, - void* err_user_data, SUNContext sunctx) + SUNDIALS_MAYBE_UNUSED const char* msg, + SUNDIALS_MAYBE_UNUSED SUNErrCode err_code, + SUNDIALS_MAYBE_UNUSED void* err_user_data, + SUNContext sunctx) { char* file_and_line = sunCombineFileAndLine(line, file); SUNLogger_QueueMsg(sunctx->logger, SUN_LOGLEVEL_ERROR, file_and_line, func, diff --git a/src/sundials/sundials_hashmap.c b/src/sundials/sundials_hashmap.c index a2a2fc3764..acf1c12c8d 100644 --- a/src/sundials/sundials_hashmap.c +++ b/src/sundials/sundials_hashmap.c @@ -21,9 +21,11 @@ #include <stdlib.h> #include <string.h> -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" +#include <sundials/sundials_errors.h> +#include <sundials/sundials_types.h> + #include "sundials_hashmap_impl.h" +#include "sundials_macros.h" static const uint64_t HASH_PRIME = 14695981039346656037U; static const uint64_t HASH_OFFSET_BASIS = 1099511628211U; @@ -33,7 +35,7 @@ static const uint64_t HASH_OFFSET_BASIS = 1099511628211U; https://softwareengineering.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed/145633#145633 This is a 64-bit implementation of the 'a' modification of the - Fowler–Noll–Vo hash (i.e., FNV1-a). + Fowler-Noll-Vo hash (i.e., FNV1-a). */ static uint64_t fnv1a_hash(const char* str) { @@ -161,7 +163,7 @@ int SUNHashMap_Iterate(SUNHashMap map, int start, } static int sunHashMapLinearProbeInsert(int idx, SUNHashMapKeyValue kv, - const void* ctx) + SUNDIALS_MAYBE_UNUSED const void* ctx) { /* find the next open spot */ if (kv == NULL) { return (idx); /* open spot found at idx */ } diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index 2b109f677b..bc4d6869ae 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -16,18 +16,19 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_config.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_logger.h> - -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" +#include <sundials/sundials_types.h> #if SUNDIALS_MPI_ENABLED #include <mpi.h> #endif #include "sundials_logger_impl.h" +#include "sundials_macros.h" #include "sundials_utils.h" /* max number of files that can be opened */ @@ -65,6 +66,7 @@ void sunCreateLogMessage(SUNLogLevel lvl, int rank, const char* scope, free(formatted_txt); } +#if SUNDIALS_LOGGING_LEVEL > 0 static FILE* sunOpenLogFile(const char* fname, const char* mode) { FILE* fp = NULL; @@ -78,13 +80,15 @@ static FILE* sunOpenLogFile(const char* fname, const char* mode) return fp; } +#endif static void sunCloseLogFile(void* fp) { if (fp && fp != stdout && fp != stderr) { fclose((FILE*)fp); } } -static sunbooleantype sunLoggerIsOutputRank(SUNLogger logger, int* rank_ref) +static sunbooleantype sunLoggerIsOutputRank(SUNDIALS_MAYBE_UNUSED SUNLogger logger, + int* rank_ref) { sunbooleantype retval; @@ -371,6 +375,13 @@ SUNErrCode SUNLogger_QueueMsg(SUNLogger logger, SUNLogLevel lvl, va_end(args); } +#else + /* silence warnings when all logging is disabled */ + ((void)logger); + ((void)lvl); + ((void)scope); + ((void)label); + ((void)msg_txt); #endif return retval; @@ -417,6 +428,9 @@ SUNErrCode SUNLogger_Flush(SUNLogger logger, SUNLogLevel lvl) } } } +#else + /* silence warnings when all logging is disabled */ + ((void)lvl); #endif return retval; diff --git a/src/sundials/sundials_macros.h b/src/sundials/sundials_macros.h new file mode 100644 index 0000000000..4bf007e507 --- /dev/null +++ b/src/sundials/sundials_macros.h @@ -0,0 +1,39 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 macros + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_MACROS_H +#define _SUNDIALS_MACROS_H + +#include "sundials/sundials_config.h" + +/* ----------------------------------------------------------------------------- + * SUNDIALS_MAYBE_UNUSED + * + * This maps to an attribute that can be used to silence warnings about unused + * classes, typedefs, variables, functions, or methods when the entity cannot be + * removed. For example, functions or variables that are only used when error + * checks or profiling is enabled. + * ---------------------------------------------------------------------------*/ + +#if __cplusplus >= 201703L || __STDC_VERSION__ > 201710L +#define SUNDIALS_MAYBE_UNUSED [[maybe_unused]] +#elif defined(SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) +#define SUNDIALS_MAYBE_UNUSED __attribute__((unused)) +#else +#define SUNDIALS_MAYBE_UNUSED +#endif + +#endif /* _SUNDIALS_MACROS_H */ diff --git a/src/sundials/sundials_mpi_errors.c b/src/sundials/sundials_mpi_errors.c index ac9f56680c..60ed704a07 100644 --- a/src/sundials/sundials_mpi_errors.c +++ b/src/sundials/sundials_mpi_errors.c @@ -13,16 +13,20 @@ #include <mpi.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> + #include <sundials/priv/sundials_mpi_errors_impl.h> #include <sundials/sundials_core.h> #include <sundials/sundials_mpi_types.h> -#include <unistd.h> +#include "sundials_macros.h" #include "sundials_utils.h" void SUNMPIAbortErrHandlerFn(int line, const char* func, const char* file, - const char* msg, SUNErrCode err_code, - void* err_user_data, SUNContext sunctx) + SUNDIALS_MAYBE_UNUSED const char* msg, + SUNErrCode err_code, + SUNDIALS_MAYBE_UNUSED void* err_user_data, + SUNContext sunctx) { char* file_and_line = sunCombineFileAndLine(line, file); SUNLogger_QueueMsg(sunctx->logger, SUN_LOGLEVEL_ERROR, file_and_line, func, diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index a6549d81b5..46791fa66c 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -335,7 +335,11 @@ void N_VSpace(N_Vector v, sunindextype* lrw, sunindextype* liw) sunrealtype* N_VGetArrayPointer(N_Vector v) { - return ((sunrealtype*)v->ops->nvgetarraypointer(v)); + if (v->ops->nvgetarraypointer) + { + return (sunrealtype*)v->ops->nvgetarraypointer(v); + } + else { return NULL; } } sunrealtype* N_VGetDeviceArrayPointer(N_Vector v) @@ -349,7 +353,7 @@ sunrealtype* N_VGetDeviceArrayPointer(N_Vector v) void N_VSetArrayPointer(sunrealtype* v_data, N_Vector v) { - v->ops->nvsetarraypointer(v_data, v); + if (v->ops->nvsetarraypointer) { v->ops->nvsetarraypointer(v_data, v); } return; } diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index 1ac2b30aee..c85244817c 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -12,12 +12,16 @@ * SUNDIALS Copyright End * -----------------------------------------------------------------*/ +#include <stdio.h> +#include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_config.h> - -#include "sundials/sundials_errors.h" -#include "sundials/sundials_types.h" +#include <sundials/sundials_errors.h> +#include <sundials/sundials_math.h> +#include <sundials/sundials_profiler.h> +#include <sundials/sundials_types.h> #if SUNDIALS_MPI_ENABLED #include <mpi.h> @@ -33,14 +37,9 @@ #error SUNProfiler needs POSIX or Windows timers #endif -#include <stdio.h> -#include <stdlib.h> -#include <sundials/sundials_math.h> -#include <sundials/sundials_profiler.h> -#include <sundials/sundials_types.h> - #include "sundials_debug.h" #include "sundials_hashmap_impl.h" +#include "sundials_macros.h" #define SUNDIALS_ROOT_TIMER ((const char*)"From profiler epoch") @@ -58,7 +57,7 @@ typedef struct _sunTimespec #if SUNDIALS_MPI_ENABLED static SUNErrCode sunCollectTimers(SUNProfiler p); #endif -static void sunPrintTimers(int idx, SUNHashMapKeyValue kv, FILE* fp, void* pvoid); +static void sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid); static int sunCompareTimes(const void* l, const void* r); static int sunclock_gettime_monotonic(sunTimespec* tp); @@ -420,7 +419,7 @@ SUNErrCode SUNProfiler_Print(SUNProfiler p, FILE* fp) /* Print all the other timers out */ for (i = 0; i < p->map->size; i++) { - if (sorted[i]) { sunPrintTimers(i, sorted[i], fp, (void*)p); } + if (sorted[i]) { sunPrintTimer(sorted[i], fp, (void*)p); } } free(sorted); } @@ -443,7 +442,7 @@ SUNErrCode SUNProfiler_Print(SUNProfiler p, FILE* fp) #if SUNDIALS_MPI_ENABLED static void sunTimerStructReduceMaxAndSum(void* a, void* b, int* len, - MPI_Datatype* dType) + SUNDIALS_MAYBE_UNUSED MPI_Datatype* dType) { sunTimerStruct* a_ts = (sunTimerStruct*)a; sunTimerStruct* b_ts = (sunTimerStruct*)b; @@ -523,7 +522,7 @@ SUNErrCode sunCollectTimers(SUNProfiler p) /* Print out the: timer name, percentage of exec time (based on the max), max across ranks, average across ranks, and the timer counter. */ -void sunPrintTimers(int idx, SUNHashMapKeyValue kv, FILE* fp, void* pvoid) +void sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid) { SUNProfiler p = (SUNProfiler)pvoid; sunTimerStruct* ts = (sunTimerStruct*)kv->value; diff --git a/src/sundials/sundials_utils.h b/src/sundials/sundials_utils.h index 6866ffac2c..44ce2a7d4b 100644 --- a/src/sundials/sundials_utils.h +++ b/src/sundials/sundials_utils.h @@ -71,7 +71,7 @@ static inline int sunvasnprintf(char** str, const char* fmt, va_list args) *str = (char*)malloc(size + 1); if (NULL == *str) { return -1; } - size = vsprintf(*str, fmt, args); + size = vsnprintf(*str, size + 1, fmt, args); return size; } diff --git a/src/sundials/sundials_xbraid.c b/src/sundials/sundials_xbraid.c index 6368d5ca5a..95016e10bd 100644 --- a/src/sundials/sundials_xbraid.c +++ b/src/sundials/sundials_xbraid.c @@ -14,9 +14,10 @@ * This is the implementation file for the SUNDIALS + XBraid interface. * -------------------------------------------------------------------------- */ -#include "sundials/sundials_xbraid.h" +#include <sundials/sundials_math.h> +#include <sundials/sundials_xbraid.h> -#include "sundials/sundials_math.h" +#include "sundials_macros.h" #define ONE SUN_RCONST(1.0) @@ -114,7 +115,8 @@ int SUNBraidVector_GetNVector(SUNBraidVector u, N_Vector* y) } /* Create clone of an existing vector */ -int SUNBraidVector_Clone(braid_App app, braid_Vector u, braid_Vector* v_ptr) +int SUNBraidVector_Clone(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, + braid_Vector* v_ptr) { int flag; N_Vector vy; @@ -138,7 +140,7 @@ int SUNBraidVector_Clone(braid_App app, braid_Vector u, braid_Vector* v_ptr) } /* Free vector */ -int SUNBraidVector_Free(braid_App app, braid_Vector u) +int SUNBraidVector_Free(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u) { /* Check for valid input */ if (u == NULL) { return SUNBRAID_SUCCESS; } @@ -158,8 +160,8 @@ int SUNBraidVector_Free(braid_App app, braid_Vector u) } /* Compute alpha x + beta y -> y */ -int SUNBraidVector_Sum(braid_App app, braid_Real alpha, braid_Vector x, - braid_Real beta, braid_Vector y) +int SUNBraidVector_Sum(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Real alpha, + braid_Vector x, braid_Real beta, braid_Vector y) { /* Check for valid wrappers */ if (x == NULL || y == NULL) { return SUNBRAID_ILLINPUT; } @@ -171,7 +173,8 @@ int SUNBraidVector_Sum(braid_App app, braid_Real alpha, braid_Vector x, } /* Compute L2 norm */ -int SUNBraidVector_SpatialNorm(braid_App app, braid_Vector u, braid_Real* norm_ptr) +int SUNBraidVector_SpatialNorm(SUNDIALS_MAYBE_UNUSED braid_App app, + braid_Vector u, braid_Real* norm_ptr) { /* Check for valid wrapper */ if (u == NULL) { return SUNBRAID_ILLINPUT; } @@ -185,7 +188,7 @@ int SUNBraidVector_SpatialNorm(braid_App app, braid_Vector u, braid_Real* norm_p /* Compute message buffer size */ int SUNBraidVector_BufSize(braid_App app, braid_Int* size_ptr, - braid_BufferStatus bstatus) + SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) { int flag; /* return flag */ N_Vector ytmpl; /* template vector */ @@ -202,8 +205,9 @@ int SUNBraidVector_BufSize(braid_App app, braid_Int* size_ptr, } /* Pack message buffer */ -int SUNBraidVector_BufPack(braid_App app, braid_Vector u, void* buffer, - braid_BufferStatus bstatus) +int SUNBraidVector_BufPack(SUNDIALS_MAYBE_UNUSED braid_App app, braid_Vector u, + void* buffer, + SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) { int flag; /* return flag */ @@ -220,7 +224,7 @@ int SUNBraidVector_BufPack(braid_App app, braid_Vector u, void* buffer, /* Unpack message buffer */ int SUNBraidVector_BufUnpack(braid_App app, void* buffer, braid_Vector* u_ptr, - braid_BufferStatus bstatus) + SUNDIALS_MAYBE_UNUSED braid_BufferStatus bstatus) { int flag; /* return flag */ N_Vector ytmpl; /* template vector */ diff --git a/src/sunlinsol/band/sunlinsol_band.c b/src/sunlinsol/band/sunlinsol_band.c index 775466bd28..d72e37af1c 100644 --- a/src/sunlinsol/band/sunlinsol_band.c +++ b/src/sunlinsol/band/sunlinsol_band.c @@ -17,11 +17,14 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_band.h> +#include "sundials_macros.h" + #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) #define ROW(i, j, smu) (i - j + smu) @@ -46,7 +49,8 @@ * Function to create a new band linear solver */ -SUNLinearSolver SUNLinSol_Band(N_Vector y, SUNMatrix A, SUNContext sunctx) +SUNLinearSolver SUNLinSol_Band(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, + SUNContext sunctx) { SUNFunctionBegin(sunctx); SUNLinearSolver S; @@ -107,12 +111,12 @@ SUNLinearSolver SUNLinSol_Band(N_Vector y, SUNMatrix A, SUNContext sunctx) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_Band(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_Band(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_Band(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_Band(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_BAND); } @@ -156,7 +160,7 @@ int SUNLinSolSetup_Band(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Band(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) + SUNDIALS_MAYBE_UNUSED sunrealtype tol) { SUNFunctionBegin(S->sunctx); sunrealtype **A_cols, *xdata; diff --git a/src/sunlinsol/dense/sunlinsol_dense.c b/src/sunlinsol/dense/sunlinsol_dense.c index 13a1fa9dbd..41e6a1bb61 100644 --- a/src/sunlinsol/dense/sunlinsol_dense.c +++ b/src/sunlinsol/dense/sunlinsol_dense.c @@ -17,12 +17,14 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_dense.h> -#include "sundials/sundials_errors.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ONE SUN_RCONST(1.0) @@ -46,7 +48,8 @@ * Function to create a new dense linear solver */ -SUNLinearSolver SUNLinSol_Dense(N_Vector y, SUNMatrix A, SUNContext sunctx) +SUNLinearSolver SUNLinSol_Dense(SUNDIALS_MAYBE_UNUSED N_Vector y, SUNMatrix A, + SUNContext sunctx) { SUNFunctionBegin(sunctx); SUNLinearSolver S; @@ -102,12 +105,12 @@ SUNLinearSolver SUNLinSol_Dense(N_Vector y, SUNMatrix A, SUNContext sunctx) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_Dense(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_Dense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_Dense(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_Dense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DENSE); } @@ -146,7 +149,7 @@ int SUNLinSolSetup_Dense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_Dense(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) + SUNDIALS_MAYBE_UNUSED sunrealtype tol) { SUNFunctionBegin(S->sunctx); sunrealtype **A_cols, *xdata; diff --git a/src/sunlinsol/klu/sunlinsol_klu.c b/src/sunlinsol/klu/sunlinsol_klu.c index 3594b24f4f..b2a1f290e2 100644 --- a/src/sunlinsol/klu/sunlinsol_klu.c +++ b/src/sunlinsol/klu/sunlinsol_klu.c @@ -19,10 +19,12 @@ #include <stdint.h> #include <stdio.h> #include <stdlib.h> + +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_klu.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -216,12 +218,12 @@ sun_klu_common* SUNLinSol_KLUGetCommon(SUNLinearSolver S) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_KLU(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_KLU(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_KLU(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_KLU(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_KLU); } @@ -340,7 +342,7 @@ int SUNLinSolSetup_KLU(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_KLU(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype tol) + SUNDIALS_MAYBE_UNUSED sunrealtype tol) { int flag; sunrealtype* xdata; @@ -377,8 +379,8 @@ int SUNLinSolSolve_KLU(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, sunindextype SUNLinSolLastFlag_KLU(SUNLinearSolver S) { return (LASTFLAG(S)); } -SUNErrCode SUNLinSolSpace_KLU(SUNLinearSolver S, long int* lenrwLS, - long int* leniwLS) +SUNErrCode SUNLinSolSpace_KLU(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S, + long int* lenrwLS, long int* leniwLS) { /* since the klu structures are opaque objects, we omit those from these results */ diff --git a/src/sunlinsol/lapackband/sunlinsol_lapackband.c b/src/sunlinsol/lapackband/sunlinsol_lapackband.c index cce85657d5..ce26bb6951 100644 --- a/src/sunlinsol/lapackband/sunlinsol_lapackband.c +++ b/src/sunlinsol/lapackband/sunlinsol_lapackband.c @@ -18,10 +18,12 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_lapackband.h> #include "sundials_lapack_defs.h" +#include "sundials_macros.h" /* Interfaces to match 'sunrealtype' with the correct LAPACK functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) @@ -127,12 +129,13 @@ SUNLinearSolver SUNLinSol_LapackBand(N_Vector y, SUNMatrix A, SUNContext sunctx) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_LapackBand(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_LapackBand( + SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_LAPACKBAND); } @@ -173,7 +176,7 @@ int SUNLinSolSetup_LapackBand(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_LapackBand(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) + N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) { sunindextype n, ml, mu, ldim, one, ier; sunrealtype* xdata; diff --git a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c index 09a17910cc..a13460b035 100644 --- a/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c +++ b/src/sunlinsol/lapackdense/sunlinsol_lapackdense.c @@ -18,10 +18,12 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_lapackdense.h> #include "sundials_lapack_defs.h" +#include "sundials_macros.h" /* Interfaces to match 'sunrealtype' with the correct LAPACK functions */ #if defined(SUNDIALS_DOUBLE_PRECISION) @@ -128,12 +130,13 @@ SUNLinearSolver SUNLinSol_LapackDense(N_Vector y, SUNMatrix A, SUNContext sunctx * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_LapackDense(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_LapackDense( + SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_LAPACKDENSE); } @@ -170,7 +173,7 @@ int SUNLinSolSetup_LapackDense(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_LapackDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) + N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) { sunindextype n, one, ier; sunrealtype* xdata; diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index 1504a744dc..100183e82c 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -18,11 +18,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_pcg.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -162,12 +164,12 @@ SUNErrCode SUNLinSol_PCGSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_PCG(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_PCG(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_PCG(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_PCG(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_PCG); } @@ -216,7 +218,7 @@ SUNErrCode SUNLinSolSetPreconditioner_PCG(SUNLinearSolver S, void* PData, } SUNErrCode SUNLinSolSetScalingVectors_PCG(SUNLinearSolver S, N_Vector s, - N_Vector nul) + SUNDIALS_MAYBE_UNUSED N_Vector nul) { /* set N_Vector pointer to integrator-supplied scaling vector (only use the first one), and return with success */ @@ -231,7 +233,7 @@ SUNErrCode SUNLinSolSetZeroGuess_PCG(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul) +int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul) { SUNFunctionBegin(S->sunctx); @@ -260,8 +262,8 @@ int SUNLinSolSetup_PCG(SUNLinearSolver S, SUNMatrix nul) return SUN_SUCCESS; } -int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNMatrix nul, N_Vector x, N_Vector b, - sunrealtype delta) +int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, + N_Vector x, N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index 168e554176..67df9bcdfe 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -19,12 +19,14 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_spbcgs.h> #include "sundials/sundials_errors.h" #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -186,12 +188,12 @@ SUNErrCode SUNLinSol_SPBCGSSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPBCGS(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPBCGS(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPBCGS(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPBCGS(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_SPBCGS); } @@ -265,7 +267,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A) +int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -294,8 +296,8 @@ int SUNLinSolSetup_SPBCGS(SUNLinearSolver S, SUNMatrix A) return (LASTFLAG(S)); } -int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, + N_Vector x, N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 4e726e2d7e..a1d3ea27ad 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -19,11 +19,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_spfgmr.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -190,12 +192,12 @@ SUNErrCode SUNLinSol_SPFGMRSetMaxRestarts(SUNLinearSolver S, int maxrs) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPFGMR(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPFGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPFGMR(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPFGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_SPFGMR); } @@ -330,7 +332,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver S, sunbooleantype onoff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A) +int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -359,8 +361,8 @@ int SUNLinSolSetup_SPFGMR(SUNLinearSolver S, SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, + N_Vector x, N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index c1e10b3629..6ef57661ae 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -19,11 +19,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_spgmr.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -185,12 +187,12 @@ SUNErrCode SUNLinSol_SPGMRSetMaxRestarts(SUNLinearSolver S, int maxrs) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPGMR(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPGMR(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPGMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_SPGMR); } @@ -317,7 +319,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver S, sunbooleantype onff) return SUN_SUCCESS; } -int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A) +int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -344,8 +346,8 @@ int SUNLinSolSetup_SPGMR(SUNLinearSolver S, SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, - sunrealtype delta) +int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, + N_Vector x, N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 6f09ccc1db..28ad1ef883 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -18,11 +18,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_sptfqmr.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -184,12 +186,12 @@ SUNErrCode SUNLinSol_SPTFQMRSetMaxl(SUNLinearSolver S, int maxl) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SPTFQMR(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SPTFQMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_ITERATIVE); } -SUNLinearSolver_ID SUNLinSolGetID_SPTFQMR(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SPTFQMR(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_SPTFQMR); } @@ -260,7 +262,7 @@ SUNErrCode SUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver S, sunbooleantype onoff return SUN_SUCCESS; } -int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A) +int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A) { SUNFunctionBegin(S->sunctx); @@ -289,8 +291,8 @@ int SUNLinSolSetup_SPTFQMR(SUNLinearSolver S, SUNMatrix A) return SUN_SUCCESS; } -int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype delta) +int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, + N_Vector x, N_Vector b, sunrealtype delta) { SUNFunctionBegin(S->sunctx); diff --git a/src/sunlinsol/superludist/sunlinsol_superludist.c b/src/sunlinsol/superludist/sunlinsol_superludist.c index 55df80aeba..8b58d1d22b 100644 --- a/src/sunlinsol/superludist/sunlinsol_superludist.c +++ b/src/sunlinsol/superludist/sunlinsol_superludist.c @@ -17,10 +17,14 @@ #include <stdio.h> #include <stdlib.h> + +#include <superlu_ddefs.h> + #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_superludist.h> #include <sunmatrix/sunmatrix_slunrloc.h> -#include <superlu_ddefs.h> + +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -166,12 +170,13 @@ SuperLUStat_t* SUNLinSol_SuperLUDIST_GetSuperLUStat(SUNLinearSolver LS) * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SuperLUDIST(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SuperLUDIST( + SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_DIRECT); } -SUNLinearSolver_ID SUNLinSolGetID_SuperLUDIST(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SuperLUDIST(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return (SUNLINEARSOLVER_SUPERLUDIST); } @@ -184,7 +189,8 @@ SUNErrCode SUNLinSolInitialize_SuperLUDIST(SUNLinearSolver S) return (SLU_LASTFLAG(S)); } -int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, SUNMatrix A) +int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, + SUNDIALS_MAYBE_UNUSED SUNMatrix A) { if (SLU_FIRSTFACTORIZE(S)) { @@ -210,7 +216,7 @@ int SUNLinSolSetup_SuperLUDIST(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_SuperLUDIST(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) + N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) { int retval; sunrealtype* xdata; @@ -296,8 +302,8 @@ SUNErrCode SUNLinSolFree_SuperLUDIST(SUNLinearSolver S) return SUN_SUCCESS; } -SUNErrCode SUNLinSolSpace_SuperLUDIST(SUNLinearSolver S, long int* leniwLS, - long int* lenrwLS) +SUNErrCode SUNLinSolSpace_SuperLUDIST(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S, + long int* leniwLS, long int* lenrwLS) { /* since the SuperLU_DIST structures are opaque objects, we omit those from these results */ diff --git a/src/sunlinsol/superlumt/sunlinsol_superlumt.c b/src/sunlinsol/superlumt/sunlinsol_superlumt.c index 609243d5a3..439a948fed 100644 --- a/src/sunlinsol/superlumt/sunlinsol_superlumt.c +++ b/src/sunlinsol/superlumt/sunlinsol_superlumt.c @@ -20,10 +20,12 @@ #include <stdio.h> #include <stdlib.h> + +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunlinsol/sunlinsol_superlumt.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -229,12 +231,13 @@ SUNErrCode SUNLinSol_SuperLUMTSetOrdering(SUNLinearSolver S, int ordering_choice * ----------------------------------------------------------------- */ -SUNLinearSolver_Type SUNLinSolGetType_SuperLUMT(SUNLinearSolver S) +SUNLinearSolver_Type SUNLinSolGetType_SuperLUMT( + SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return SUNLINEARSOLVER_DIRECT; } -SUNLinearSolver_ID SUNLinSolGetID_SuperLUMT(SUNLinearSolver S) +SUNLinearSolver_ID SUNLinSolGetID_SuperLUMT(SUNDIALS_MAYBE_UNUSED SUNLinearSolver S) { return SUNLINEARSOLVER_SUPERLUMT; } @@ -319,7 +322,7 @@ int SUNLinSolSetup_SuperLUMT(SUNLinearSolver S, SUNMatrix A) } int SUNLinSolSolve_SuperLUMT(SUNLinearSolver S, SUNMatrix A, N_Vector x, - N_Vector b, sunrealtype tol) + N_Vector b, SUNDIALS_MAYBE_UNUSED sunrealtype tol) { int_t retval; sunrealtype* xdata; diff --git a/src/sunmatrix/band/sunmatrix_band.c b/src/sunmatrix/band/sunmatrix_band.c index 238450443e..f3d06c730b 100644 --- a/src/sunmatrix/band/sunmatrix_band.c +++ b/src/sunmatrix/band/sunmatrix_band.c @@ -22,11 +22,13 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunmatrix/sunmatrix_band.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -230,7 +232,10 @@ sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Band(SUNMatrix A) { return SUNMATRIX_BAND; } +SUNMatrix_ID SUNMatGetID_Band(SUNDIALS_MAYBE_UNUSED SUNMatrix A) +{ + return SUNMATRIX_BAND; +} SUNMatrix SUNMatClone_Band(SUNMatrix A) { @@ -428,6 +433,7 @@ SUNErrCode SUNMatSpace_Band(SUNMatrix A, long int* lenrw, long int* leniw) * ----------------------------------------------------------------- */ +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) { /* both matrices must have the same number of columns @@ -437,6 +443,7 @@ static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) return SUNTRUE; } +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y) { diff --git a/src/sunmatrix/dense/sunmatrix_dense.c b/src/sunmatrix/dense/sunmatrix_dense.c index 5067379fd5..c1250a9eaa 100644 --- a/src/sunmatrix/dense/sunmatrix_dense.c +++ b/src/sunmatrix/dense/sunmatrix_dense.c @@ -20,10 +20,12 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> #include <sunmatrix/sunmatrix_dense.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -178,7 +180,10 @@ sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Dense(SUNMatrix A) { return SUNMATRIX_DENSE; } +SUNMatrix_ID SUNMatGetID_Dense(SUNDIALS_MAYBE_UNUSED SUNMatrix A) +{ + return SUNMATRIX_DENSE; +} SUNMatrix SUNMatClone_Dense(SUNMatrix A) { @@ -346,6 +351,7 @@ SUNErrCode SUNMatSpace_Dense(SUNMatrix A, long int* lenrw, long int* leniw) * ----------------------------------------------------------------- */ +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) { /* both matrices must have the same shape */ @@ -357,6 +363,7 @@ static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) return SUNTRUE; } +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y) { diff --git a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c index a17ab753d9..5c84fc3b76 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -20,10 +20,14 @@ #include <mpi.h> #include <stdarg.h> #include <stdlib.h> + +#include <superlu_ddefs.h> + #include <sundials/sundials_math.h> #include <sundials/sundials_mpi_types.h> #include <sunmatrix/sunmatrix_slunrloc.h> -#include <superlu_ddefs.h> + +#include "sundials_macros.h" /* * ---------------------------------------------------------------------------- @@ -171,7 +175,10 @@ sunbooleantype SUNMatrix_SLUNRloc_OwnData(SUNMatrix A) * ---------------------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_SLUNRloc(SUNMatrix A) { return (SUNMATRIX_SLUNRLOC); } +SUNMatrix_ID SUNMatGetID_SLUNRloc(SUNDIALS_MAYBE_UNUSED SUNMatrix A) +{ + return (SUNMATRIX_SLUNRLOC); +} SUNMatrix SUNMatClone_SLUNRloc(SUNMatrix A) { diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index 18d644dba5..bbdbc344d2 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -22,13 +22,15 @@ #include <stdio.h> #include <stdlib.h> + #include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunmatrix/sunmatrix_band.h> #include <sunmatrix/sunmatrix_dense.h> #include <sunmatrix/sunmatrix_sparse.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) @@ -497,7 +499,10 @@ sunindextype* SUNSparseMatrix_IndexPointers(SUNMatrix A) * ----------------------------------------------------------------- */ -SUNMatrix_ID SUNMatGetID_Sparse(SUNMatrix A) { return SUNMATRIX_SPARSE; } +SUNMatrix_ID SUNMatGetID_Sparse(SUNDIALS_MAYBE_UNUSED SUNMatrix A) +{ + return SUNMATRIX_SPARSE; +} SUNMatrix SUNMatClone_Sparse(SUNMatrix A) { @@ -1120,6 +1125,7 @@ SUNErrCode SUNMatSpace_Sparse(SUNMatrix A, long int* lenrw, long int* leniw) * Function to check compatibility of two sparse SUNMatrix objects */ +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) { /* both matrices must have the same shape and sparsity type */ @@ -1138,6 +1144,7 @@ static sunbooleantype compatibleMatrices(SUNMatrix A, SUNMatrix B) * N_Vectors (A*x = b) */ +SUNDIALS_MAYBE_UNUSED static sunbooleantype compatibleMatrixAndVectors(SUNMatrix A, N_Vector x, N_Vector y) { diff --git a/src/sunmemory/system/sundials_system_memory.c b/src/sunmemory/system/sundials_system_memory.c index 00839c6d59..8b34d7f137 100644 --- a/src/sunmemory/system/sundials_system_memory.c +++ b/src/sunmemory/system/sundials_system_memory.c @@ -17,13 +17,15 @@ #include <stdlib.h> #include <string.h> + +#include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> +#include <sundials/sundials_memory.h> #include <sunmemory/sunmemory_system.h> -#include "sundials/priv/sundials_errors_impl.h" -#include "sundials/sundials_errors.h" -#include "sundials/sundials_memory.h" #include "sundials_debug.h" +#include "sundials_macros.h" struct SUNMemoryHelper_Content_Sys_ { @@ -70,7 +72,7 @@ SUNMemoryHelper SUNMemoryHelper_Sys(SUNContext sunctx) SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, size_t mem_size, SUNMemoryType mem_type, - void* queue) + SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); @@ -100,7 +102,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, } SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, - void* queue) + SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); @@ -125,7 +127,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, size_t memory_size, - void* queue) + SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); SUNAssert(src->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); @@ -134,12 +136,10 @@ SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, return SUN_SUCCESS; } -SUNErrCode SUNMemoryHelper_GetAllocStats_Sys(SUNMemoryHelper helper, - SUNMemoryType mem_type, - unsigned long* num_allocations, - unsigned long* num_deallocations, - size_t* bytes_allocated, - size_t* bytes_high_watermark) +SUNErrCode SUNMemoryHelper_GetAllocStats_Sys( + SUNMemoryHelper helper, SUNDIALS_MAYBE_UNUSED SUNMemoryType mem_type, + unsigned long* num_allocations, unsigned long* num_deallocations, + size_t* bytes_allocated, size_t* bytes_high_watermark) { SUNFunctionBegin(helper->sunctx); SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index 1ec228965e..ff1d45a2c9 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -18,11 +18,13 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_nvector_senswrapper.h> #include <sunnonlinsol/sunnonlinsol_fixedpoint.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" /* Internal utility routines */ static SUNErrCode AndersonAccelerate(SUNNonlinearSolver NLS, N_Vector gval, @@ -129,7 +131,8 @@ SUNNonlinearSolver SUNNonlinSol_FixedPointSens(int count, N_Vector y, int m, GetType, Initialize, Setup, Solve, and Free operations ============================================================================*/ -SUNNonlinearSolver_Type SUNNonlinSolGetType_FixedPoint(SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_FixedPoint( + SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_FIXEDPOINT); } @@ -165,9 +168,11 @@ SUNErrCode SUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver NLS) by the Sys function provided to the nonlinear solver. ---------------------------------------------------------------------------*/ -int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, N_Vector y0, +int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, - sunbooleantype callSetup, void* mem) + SUNDIALS_MAYBE_UNUSED sunbooleantype callSetup, + void* mem) { SUNFunctionBegin(NLS->sunctx); /* local variables */ diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index c796171ad3..090f91a7a3 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -18,12 +18,14 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_math.h> #include <sundials/sundials_nvector_senswrapper.h> #include <sunnonlinsol/sunnonlinsol_newton.h> #include "sundials_logger_impl.h" +#include "sundials_macros.h" /* Content structure accessibility macros */ #define NEWTON_CONTENT(S) ((SUNNonlinearSolverContent_Newton)(S->content)) @@ -126,7 +128,8 @@ SUNNonlinearSolver SUNNonlinSol_NewtonSens(int count, N_Vector y, GetType, Initialize, Setup, Solve, and Free operations ============================================================================*/ -SUNNonlinearSolver_Type SUNNonlinSolGetType_Newton(SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_Newton( + SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_ROOTFIND); } @@ -170,7 +173,8 @@ SUNErrCode SUNNonlinSolInitialize_Newton(SUNNonlinearSolver NLS) Note return values beginning with * are package specific values returned by the Sys, LSetup, and LSolve functions provided to the nonlinear solver. ----------------------------------------------------------------------------*/ -int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, +int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, + SUNDIALS_MAYBE_UNUSED N_Vector y0, N_Vector ycor, N_Vector w, sunrealtype tol, sunbooleantype callLSetup, void* mem) { diff --git a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c index 7001c35257..e932c386ef 100644 --- a/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c +++ b/src/sunnonlinsol/petscsnes/sunnonlinsol_petscsnes.c @@ -15,15 +15,18 @@ * implementation that interfaces to the PETSc SNES nonlinear solvers. * ---------------------------------------------------------------------------*/ -#include <nvector/nvector_petsc.h> -#include <petscsnes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> + +#include <petscsnes.h> + +#include <nvector/nvector_petsc.h> +#include <sundials/sundials_errors.h> #include <sundials/sundials_math.h> #include <sunnonlinsol/sunnonlinsol_petscsnes.h> -#include "sundials/sundials_errors.h" +#include "sundials_macros.h" #define SUNNLS_SNES_CONTENT(NLS) \ ((SUNNonlinearSolverContent_PetscSNES)(NLS->content)) @@ -128,7 +131,8 @@ SUNNonlinearSolver SUNNonlinSol_PetscSNES(N_Vector y, SNES snes, SUNContext sunc ============================================================================*/ /* get the type of SUNNonlinearSolver */ -SUNNonlinearSolver_Type SUNNonlinSolGetType_PetscSNES(SUNNonlinearSolver NLS) +SUNNonlinearSolver_Type SUNNonlinSolGetType_PetscSNES( + SUNDIALS_MAYBE_UNUSED SUNNonlinearSolver NLS) { return (SUNNONLINEARSOLVER_ROOTFIND); } @@ -168,8 +172,9 @@ SUNErrCode SUNNonlinSolInitialize_PetscSNES(SUNNonlinearSolver NLS) the Sys function provided to the nonlinear solver. ----------------------------------------------------------------------------*/ int SUNNonlinSolSolve_PetscSNES(SUNNonlinearSolver NLS, N_Vector y0, N_Vector y, - N_Vector w, sunrealtype tol, - sunbooleantype callLSetup, void* mem) + N_Vector w, SUNDIALS_MAYBE_UNUSED sunrealtype tol, + SUNDIALS_MAYBE_UNUSED sunbooleantype callLSetup, + void* mem) { /* local variables */ PetscErrorCode ierr; @@ -370,7 +375,8 @@ SUNErrCode SUNNonlinSolGetNumConvFails_PetscSNES(SUNNonlinearSolver NLS, Private functions ============================================================================*/ -static PetscErrorCode PetscSysFn(SNES snes, Vec x, Vec f, void* ctx) +static PetscErrorCode PetscSysFn(SUNDIALS_MAYBE_UNUSED SNES snes, Vec x, Vec f, + void* ctx) { int retval; SUNNonlinearSolver NLS = (SUNNonlinearSolver)ctx; diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt index 3ca5c3aa28..29e3a74114 100644 --- a/test/unit_tests/CMakeLists.txt +++ b/test/unit_tests/CMakeLists.txt @@ -16,6 +16,12 @@ message("Adding units tests") +# Disable some warnings for tests +if(ENABLE_ALL_WARNINGS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") +endif() + add_subdirectory(sundials) if(BUILD_ARKODE) From 88ca1d99f05742cf0eca253c5f5c84d2ea1171b6 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 30 May 2024 13:21:03 -0700 Subject: [PATCH 062/137] Feature: Remove Implicit RHS Evaluation in Autonomous Problems With the Trivial Predictor (#495) Add the function ``ARKodeSetAutonomous`` to indicate that the implicit right-hand side function does not explicitly depend on time. When using the trivial predictor, an autonomous problem may reuse implicit function evaluations across stage solves reducing the total number of function evaluations. --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 6 + .../guide/source/Usage/User_callable.rst | 53 + doc/shared/RecentChanges.rst | 6 + .../arkode/CXX_serial/ark_analytic_sys.cpp | 6 + .../arkode/CXX_serial/ark_analytic_sys.out | 2 +- examples/arkode/CXX_serial/ark_pendulum.cpp | 3 + examples/arkode/CXX_serial/ark_pendulum.out | 2 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 6 + .../arkode/C_openmp/ark_brusselator1D_omp.out | 2 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 7 + examples/arkode/C_serial/ark_brusselator.c | 13 + examples/arkode/C_serial/ark_brusselator.out | 32 +- examples/arkode/C_serial/ark_brusselator1D.c | 5 + .../arkode/C_serial/ark_brusselator1D.out | 2 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 4 + .../C_serial/ark_brusselator1D_FEM_slu.out | 2 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 5 + .../arkode/C_serial/ark_brusselator1D_klu.out | 2 +- examples/arkode/C_serial/ark_brusselator_fp.c | 5 + .../arkode/C_serial/ark_brusselator_fp.out | 2 +- .../arkode/C_serial/ark_brusselator_fp_1.out | 2 +- include/arkode/arkode.h | 2 + src/arkode/arkode.c | 10 + src/arkode/arkode_arkstep.c | 108 +- src/arkode/arkode_arkstep_impl.h | 22 +- src/arkode/arkode_arkstep_io.c | 70 + src/arkode/arkode_arkstep_nls.c | 384 ++- src/arkode/arkode_impl.h | 11 + src/arkode/arkode_io.c | 33 + src/arkode/fmod/farkode_mod.c | 40 + src/arkode/fmod/farkode_mod.f90 | 74 + src/sunnonlinsol/newton/sunnonlinsol_newton.c | 57 +- test/answers | 2 +- .../arkode/CXX_serial/CMakeLists.txt | 24 +- .../CXX_serial/ark_test_dahlquist_ark.cpp | 109 +- .../CXX_serial/ark_test_dahlquist_ark.out | 1972 -------------- ....out => ark_test_dahlquist_ark_0_-1_0.out} | 852 +++--- .../ark_test_dahlquist_ark_0_0_0.out | 2337 +++++++++++++++++ ...0.out => ark_test_dahlquist_ark_0_0_1.out} | 342 +-- .../ark_test_dahlquist_ark_0_1_0.out | 2337 +++++++++++++++++ ...1.out => ark_test_dahlquist_ark_0_1_1.out} | 198 +- ....out => ark_test_dahlquist_ark_1_-1_0.out} | 852 +++--- .../ark_test_dahlquist_ark_1_0_0.out | 2337 +++++++++++++++++ ...0.out => ark_test_dahlquist_ark_1_0_1.out} | 342 +-- .../ark_test_dahlquist_ark_1_1_0.out | 2337 +++++++++++++++++ ...1.out => ark_test_dahlquist_ark_1_1_1.out} | 198 +- ....out => ark_test_dahlquist_ark_2_-1_0.out} | 196 +- ...0.out => ark_test_dahlquist_ark_2_0_0.out} | 196 +- .../ark_test_dahlquist_ark_2_0_1.out | 2337 +++++++++++++++++ ...1.out => ark_test_dahlquist_ark_2_1_0.out} | 196 +- .../ark_test_dahlquist_ark_2_1_1.out | 2337 +++++++++++++++++ .../CXX_serial/ark_test_dahlquist_erk.cpp | 27 +- .../CXX_serial/ark_test_dahlquist_erk.out | 609 ----- .../CXX_serial/ark_test_dahlquist_erk_-1.out | 85 +- .../CXX_serial/ark_test_dahlquist_erk_0.out | 85 +- .../CXX_serial/ark_test_dahlquist_erk_1.out | 85 +- 56 files changed, 16413 insertions(+), 4957 deletions(-) delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_0_-1.out => ark_test_dahlquist_ark_0_-1_0.out} (89%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_0.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_0_0.out => ark_test_dahlquist_ark_0_0_1.out} (92%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_0_1.out => ark_test_dahlquist_ark_0_1_1.out} (94%) rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_1_-1.out => ark_test_dahlquist_ark_1_-1_0.out} (89%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_0.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_1_0.out => ark_test_dahlquist_ark_1_0_1.out} (92%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_1_1.out => ark_test_dahlquist_ark_1_1_1.out} (94%) rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_-1.out => ark_test_dahlquist_ark_2_-1_0.out} (94%) rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_0.out => ark_test_dahlquist_ark_2_0_0.out} (94%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_1.out rename test/unit_tests/arkode/CXX_serial/{ark_test_dahlquist_ark_2_1.out => ark_test_dahlquist_ark_2_1_0.out} (94%) create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out delete mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb107486f..3b23939604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ Added the following MRI coupling tables Added `ARKodeButcherTable_ERKIDToName` and `ARKodeButcherTable_DIRKIDToName` to convert a Butcher table ID to a string representation. +Added the function ``ARKodeSetAutonomous`` in ARKODE to indicate that the +implicit right-hand side function does not explicitly depend on time. When using +the trivial predictor, an autonomous problem may reuse implicit function +evaluations across stage solves to reduce the total number of function +evaluations. + Users may now disable interpolated output in ARKODE by passing `ARK_INTERP_NONE` to `ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is not supported, implicit methods must use the trivial predictor (the default diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 10ad863164..4f37c689ca 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -1769,6 +1769,7 @@ Optional input Function name ============================================================== ====================================== ============ Specify that the implicit RHS is linear :c:func:`ARKodeSetLinear` ``SUNFALSE`` Specify that the implicit RHS nonlinear :c:func:`ARKodeSetNonlinear` ``SUNTRUE`` +Specify that the implicit RHS is autonomous :c:func:`ARKodeSetAutonomous` ``SUNFALSE`` Implicit predictor method :c:func:`ARKodeSetPredictorMethod` 0 User-provided implicit stage predictor :c:func:`ARKodeSetStagePredictFn` ``NULL`` RHS function for nonlinear system evaluations :c:func:`ARKodeSetNlsRhsFn` ``NULL`` @@ -1843,6 +1844,58 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS .. versionadded:: x.y.z +.. c:function:: int ARKodeSetAutonomous(void* arkode_mem, sunbooleantype autonomous) + + Specifies that the implicit portion of the problem is autonomous i.e., does + not explicitly depend on time. + + When using an implicit or ImEx method with the trivial predictor, this option + enables reusing the implicit right-hand side evaluation at the predicted + state across stage solves within a step. This reuse reduces the total number + of implicit RHS function evaluations. + + :param arkode_mem: pointer to the ARKODE memory block. + :param autonomous: flag denoting if the implicit RHS function, + :math:`f^I(t,y)`, is autonomous (``SUNTRUE``) or + non-autonomous (``SUNFALSE``). + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + :retval ARK_STEPPER_UNSUPPORTED: implicit solvers are not supported by the + current time-stepping module. + + .. warning:: + + Results may differ when enabling both :c:func:`ARKodeSetAutonomous` and + :c:func:`ARKodeSetDeduceImplicitRhs` with a stiffly accurate implicit + method and using the trivial predictor. The differences are due to reusing + the deduced implicit right-hand side (RHS) value in the initial nonlinear + residual computation rather than evaluating the implicit RHS function. The + significance of the difference will depend on how well the deduced RHS + approximates the RHS evaluated at the trivial predictor. This behavior can + be observed in ``examples/arkode/C_serial/ark_brusselator.c`` by comparing + the outputs with :c:func:`ARKodeSetAutonomous` enabled/disabled. + + Similarly programs that assume the nonlinear residual will always call the + implicit RHS function will need to be updated to account for the RHS value + reuse when using :c:func:`ARKodeSetAutonomous`. For example, + ``examples/arkode/C_serial/ark_KrylovDemo_prec.c`` assumes that the + nonlinear residual will be called and will evaluate the implicit RHS + function before calling the preconditioner setup function. Based on this + assumption, this example code saves some computations in the RHS + evaluation for reuse in the preconditioner setup. However, when + :c:func:`ARKodeSetAutonomous` is enabled, the call to the nonlinear + residual before the preconditioner setup reuses a saved RHS evaluation and + the saved data is actually from an earlier RHS evaluation that is not + consistent with the state and RHS values passed to the preconditioner + setup function. For this example, the code should not save data in the RHS + evaluation but instead evaluate the necessary quantities within the + preconditioner setup function using the input values. + + .. versionadded:: x.y.z + + .. c:function:: int ARKodeSetPredictorMethod(void* arkode_mem, int method) Specifies the method from :numref:`ARKODE.Mathematics.Predictors` to use diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 68ac8d6c4c..62e5088a1a 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -36,6 +36,12 @@ Added :c:func:`ARKodeButcherTable_ERKIDToName` and :c:func:`ARKodeButcherTable_DIRKIDToName` to convert a Butcher table ID to a string representation. +Added the function :c:func:`ARKodeSetAutonomous` in ARKODE to indicate that the +implicit right-hand side function does not explicitly depend on time. When using +the trivial predictor, an autonomous problem may reuse implicit function +evaluations across stage solves to reduce the total number of function +evaluations. + Users may now disable interpolated output in ARKODE by passing ``ARK_INTERP_NONE`` to :c:func:`ARKodeSetInterpolantType`. When interpolation is disabled, rootfinding is not supported, implicit methods must use the trivial diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index e0a668f025..6ce667770c 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -162,6 +162,7 @@ int main() // Initialize dense matrix data structure and solver A = SUNDenseMatrix(NEQ, NEQ, 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; } @@ -176,6 +177,7 @@ int main() flag = ARKodeSetUserData(arkode_mem, (void*)&lamda); // Pass lamda to user functions if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); // Specify tolerances if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } @@ -183,6 +185,7 @@ int main() flag = ARKodeSetLinearSolver(arkode_mem, LS, A); // Attach matrix and linear solver if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); // Set Jacobian routine if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } @@ -190,6 +193,9 @@ int main() flag = ARKodeSetLinear(arkode_mem, 0); if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + // Open output stream for results, output comment line FILE* UFID = fopen("solution.txt", "w"); fprintf(UFID, "# t y1 y2 y3\n"); diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.out b/examples/arkode/CXX_serial/ark_analytic_sys.out index 5ac8dbdf0d..92c5378f2e 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.out +++ b/examples/arkode/CXX_serial/ark_analytic_sys.out @@ -20,7 +20,7 @@ Analytical ODE test problem: Final Solver Statistics: Internal solver steps = 67 (attempted = 69) - Total RHS evals: Fe = 0, Fi = 693 + Total RHS evals: Fe = 0, Fi = 348 Total linear solver setups = 22 Total RHS evals for setting up the linear system = 0 Total number of Jacobian evaluations = 3 diff --git a/examples/arkode/CXX_serial/ark_pendulum.cpp b/examples/arkode/CXX_serial/ark_pendulum.cpp index be36be088c..57c23ccc99 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.cpp +++ b/examples/arkode/CXX_serial/ark_pendulum.cpp @@ -213,6 +213,9 @@ int main(int argc, char* argv[]) flag = ARKodeSetNonlinConvCoef(arkode_mem, SUN_RCONST(0.01)); if (check_flag(flag, "ARKodeSetNonlinConvCoef")) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(flag, "ARKodeSetAutonomous")) { return 1; } + /* --------------- * * Advance in Time * * --------------- */ diff --git a/examples/arkode/CXX_serial/ark_pendulum.out b/examples/arkode/CXX_serial/ark_pendulum.out index 94c4259cfd..d2ff98a75c 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.out +++ b/examples/arkode/CXX_serial/ark_pendulum.out @@ -20,7 +20,7 @@ Nonlinear Pendulum problem: Final Solver Statistics: Internal solver steps = 8552 (attempted = 8562) Total number of error test failures = 10 - Total RHS evals: Fe = 0, Fi = 52696 + Total RHS evals: Fe = 0, Fi = 35561 Total number of Newton iterations = 27018 Total number of linear solver convergence failures = 11 Total linear solver setups = 471 diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 2dde9c37ee..9fa052cc15 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -225,6 +225,7 @@ int main(int argc, char* argv[]) /* Initialize matrix and linear solver data structures */ A = SUNBandMatrix(NEQ, 4, 4, ctx); if (check_flag((void*)A, "SUNBandMatrix", 0)) { return 1; } + LS = SUNLinSol_Band(y, A, ctx); if (check_flag((void*)LS, "SUNLinSol_Band", 0)) { return 1; } @@ -239,6 +240,7 @@ int main(int argc, char* argv[]) flag = ARKodeSetUserData(arkode_mem, (void*)udata); /* Pass udata to user functions */ if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } @@ -246,9 +248,13 @@ int main(int argc, char* argv[]) flag = ARKodeSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and linear solver */ if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); for (i = 0; i < N; i++) { fprintf(FID, " %.16" ESYM "\n", udata->dx * i); } diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.out b/examples/arkode/C_openmp/ark_brusselator1D_omp.out index 9d254eaac0..81af310e01 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.out +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.out @@ -112,7 +112,7 @@ Final Solver Statistics: Internal solver steps = 99 (attempted = 99) - Total RHS evals: Fe = 0, Fi = 1694 + Total RHS evals: Fe = 0, Fi = 1186 Total linear solver setups = 35 Total RHS evals for setting up the linear system = 0 Total number of Jacobian evaluations = 14 diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index 26774ead15..9f160e8df1 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -193,6 +193,13 @@ typedef struct int jxr[NGX], jyr[NGY]; sunrealtype acoef[NS][NS], bcoef[NS], diff[NS]; sunrealtype cox[NS], coy[NS], dx, dy, srur; + /* fsave contains saved rate data from the last RHS evaluation for reuse in + the preconditioner setup. This reuse relies on the nonlinear residual + evaluating the RHS function before calling the preconditioner setup + function. This assumption is incorrect when using ARKodeSetAutonomous which + enables reuse of RHS evaluations with the trivial predictor. To use + ARKodeSetAutonomous in this example, the saved values would need to be + recomputed in the preconditioner setup function using the input state. */ sunrealtype fsave[NEQ]; N_Vector tmp; N_Vector rewt; diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index 927c3e57da..f2ab415dbf 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -171,17 +171,21 @@ int main(void) flag = ARKodeSetUserData(arkode_mem, (void*)rdata); /* Pass rdata to user functions */ if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_LAGRANGE); /* Specify stiff interpolant */ if (check_flag(&flag, "ARKodeSetInterpolantType", 1)) { return 1; } + flag = ARKodeSetDeduceImplicitRhs(arkode_mem, 1); /* Avoid eval of f after stage */ if (check_flag(&flag, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } /* Initialize dense matrix data structure and solver */ A = SUNDenseMatrix(NEQ, NEQ, ctx); if (check_flag((void*)A, "SUNDenseMatrix", 0)) { return 1; } + LS = SUNLinSol_Dense(y, A, ctx); if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } @@ -189,9 +193,18 @@ int main(void) flag = ARKodeSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and linear solver */ if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set Jacobian routine */ if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + /* Signal that this problem does not explicitly depend on time. In this case + enabling/disabling this option will lead to slightly different results when + combined with ARKodeSetDeduceImplicitRhs because the implicit method is + stiffly accurate. The differences are due to reuse of the deduced implicit + RHS evaluation in the nonlinear residual. */ + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); fprintf(UFID, "# t u v w\n"); diff --git a/examples/arkode/C_serial/ark_brusselator.out b/examples/arkode/C_serial/ark_brusselator.out index 260a9fb31b..dec501df56 100644 --- a/examples/arkode/C_serial/ark_brusselator.out +++ b/examples/arkode/C_serial/ark_brusselator.out @@ -8,24 +8,24 @@ Brusselator ODE test problem: ------------------------------------------- 0.000000 1.200000 3.100000 3.000000 1.000000 1.103849 3.013164 3.499981 - 2.000000 0.687998 3.521383 3.499988 - 3.000000 0.409468 4.277886 3.499993 - 4.000000 0.367888 4.942004 3.499994 - 5.000000 0.413854 5.510621 3.499993 - 6.000000 0.589240 5.855669 3.499990 - 7.000000 4.756630 0.735405 3.499917 - 8.000000 1.813466 1.575769 3.499968 - 9.000000 0.527904 2.807358 3.499991 - 10.000000 0.305600 3.657365 3.499995 + 2.000000 0.687997 3.521384 3.499988 + 3.000000 0.409467 4.277888 3.499993 + 4.000000 0.367889 4.942005 3.499994 + 5.000000 0.413860 5.510615 3.499993 + 6.000000 0.589251 5.855655 3.499990 + 7.000000 4.756472 0.735414 3.499917 + 8.000000 1.813403 1.575799 3.499968 + 9.000000 0.527886 2.807385 3.499991 + 10.000000 0.305598 3.657381 3.499995 ------------------------------------------- Final Solver Statistics: - Internal solver steps = 250 (attempted = 262) - Total RHS evals: Fe = 0, Fi = 3282 - Total linear solver setups = 118 + Internal solver steps = 252 (attempted = 262) + Total RHS evals: Fe = 0, Fi = 1910 + Total linear solver setups = 111 Total RHS evals for setting up the linear system = 0 - Total number of Jacobian evaluations = 72 - Total number of Newton iterations = 3279 - Total number of nonlinear solver convergence failures = 71 - Total number of error test failures = 11 + Total number of Jacobian evaluations = 71 + Total number of Newton iterations = 3286 + Total number of nonlinear solver convergence failures = 70 + Total number of error test failures = 9 Total number of failed steps from solver failure = 1 diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index 6857fab6d0..38f312756c 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -216,6 +216,7 @@ int main(void) /* Initialize band matrix data structure and solver -- A will be factored, so set smu to ml+mu */ A = SUNBandMatrix(NEQ, 4, 4, ctx); if (check_flag((void*)A, "SUNBandMatrix", 0)) { return 1; } + LS = SUNLinSol_Band(y, A, ctx); if (check_flag((void*)LS, "SUNLinSol_Band", 0)) { return 1; } @@ -223,9 +224,13 @@ int main(void) flag = ARKodeSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and linear solver */ if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Set the Jacobian routine */ if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); for (i = 0; i < N; i++) { fprintf(FID, " %.16" ESYM "\n", udata->dx * i); } diff --git a/examples/arkode/C_serial/ark_brusselator1D.out b/examples/arkode/C_serial/ark_brusselator1D.out index fed3032856..d430e862df 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.out +++ b/examples/arkode/C_serial/ark_brusselator1D.out @@ -111,7 +111,7 @@ Final Solver Statistics: Internal solver steps = 99 (attempted = 99) - Total RHS evals: Fe = 0, Fi = 1694 + Total RHS evals: Fe = 0, Fi = 1186 Total linear solver setups = 35 Total RHS evals for setting up the linear system = 0 Total number of Jacobian evaluations = 14 diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index a79e142eea..b0ddf2295d 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -296,6 +296,10 @@ int main(int argc, char* argv[]) retval = ARKodeResStolerance(arkode_mem, abstol); if (check_retval(&retval, "ARKodeResStolerance", 1)) { return (1); } + /* Specify an autonomous problem */ + retval = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_retval(&retval, "ARKodeSetAutonomous", 1)) { return (1); } + /* Initialize sparse matrix data structure and linear solvers (system and mass) */ NNZ = 15 * NEQ; diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out index 863032a717..8cae2ef2fe 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.out @@ -112,7 +112,7 @@ Final Solver Statistics: Internal solver steps = 95 (attempted = 95) - Total RHS evals: Fe = 0, Fi = 1596 + Total RHS evals: Fe = 0, Fi = 1111 Total mass matrix setups = 1 Total mass matrix solves = 193 Total mass times evals = 1688 diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index 208acb9a92..f5fc65b396 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -233,15 +233,20 @@ int main(void) NNZ = 5 * NEQ; A = SUNSparseMatrix(NEQ, NEQ, NNZ, CSC_MAT, ctx); if (check_flag((void*)A, "SUNSparseMatrix", 0)) { return 1; } + LS = SUNLinSol_KLU(y, A, ctx); if (check_flag((void*)LS, "SUNLinSol_KLU", 0)) { return 1; } /* Attach the matrix, linear solver, and Jacobian construction routine to ARKODE */ flag = ARKodeSetLinearSolver(arkode_mem, LS, A); /* Attach matrix and LS */ if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + flag = ARKodeSetJacFn(arkode_mem, Jac); /* Supply Jac routine */ if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + /* output spatial mesh to disk */ FID = fopen("bruss_mesh.txt", "w"); for (i = 0; i < N; i++) { fprintf(FID, " %.16" ESYM "\n", udata->dx * i); } diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.out b/examples/arkode/C_serial/ark_brusselator1D_klu.out index 453cd212f8..a4e1828ee9 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.out +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.out @@ -21,7 +21,7 @@ Final Solver Statistics: Internal solver steps = 99 (attempted = 99) - Total RHS evals: Fe = 0, Fi = 1694 + Total RHS evals: Fe = 0, Fi = 1186 Total linear solver setups = 35 Total number of Jacobian evaluations = 14 Total number of nonlinear iterations = 1196 diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index 96b6e2fff6..25380ff79e 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -196,12 +196,17 @@ int main(int argc, char* argv[]) flag = ARKodeSetUserData(arkode_mem, (void*)rdata); /* Pass rdata to user functions */ if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + flag = ARKodeSetMaxNonlinIters(arkode_mem, maxcor); /* Increase default iterations */ if (check_flag(&flag, "ARKodeSetMaxNonlinIters", 1)) { return 1; } + flag = ARKodeSetAutonomous(arkode_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); fprintf(UFID, "# t u v w\n"); diff --git a/examples/arkode/C_serial/ark_brusselator_fp.out b/examples/arkode/C_serial/ark_brusselator_fp.out index ed5ca0e6f3..76e1aa7768 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.out +++ b/examples/arkode/C_serial/ark_brusselator_fp.out @@ -20,7 +20,7 @@ Brusselator ODE test problem, fixed-point solver: Final Solver Statistics: Internal solver steps = 729 (attempted = 730) - Total RHS evals: Fe = 4382, Fi = 18792 + Total RHS evals: Fe = 4382, Fi = 15142 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 ed5ca0e6f3..76e1aa7768 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp_1.out +++ b/examples/arkode/C_serial/ark_brusselator_fp_1.out @@ -20,7 +20,7 @@ Brusselator ODE test problem, fixed-point solver: Final Solver Statistics: Internal solver steps = 729 (attempted = 730) - Total RHS evals: Fe = 4382, Fi = 18792 + Total RHS evals: Fe = 4382, Fi = 15142 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/include/arkode/arkode.h b/include/arkode/arkode.h index 7bb5e8df38..f4e0667d72 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -239,6 +239,8 @@ SUNDIALS_EXPORT int ARKodeSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); SUNDIALS_EXPORT int ARKodeSetLinear(void* arkode_mem, int timedepend); SUNDIALS_EXPORT int ARKodeSetNonlinear(void* arkode_mem); +SUNDIALS_EXPORT int ARKodeSetAutonomous(void* arkode_mem, + sunbooleantype autonomous); SUNDIALS_EXPORT int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); SUNDIALS_EXPORT int ARKodeSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 50735b32ea..f21c51d46e 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1338,6 +1338,8 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) N_VPrintFile(ark_mem->tempv3, outfile); fprintf(outfile, "tempv4:\n"); N_VPrintFile(ark_mem->tempv4, outfile); + fprintf(outfile, "tempv5:\n"); + N_VPrintFile(ark_mem->tempv5, outfile); fprintf(outfile, "constraints:\n"); N_VPrintFile(ark_mem->constraints, outfile); #endif @@ -1417,6 +1419,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->step_setnonlinearsolver = NULL; ark_mem->step_setlinear = NULL; ark_mem->step_setnonlinear = NULL; + ark_mem->step_setautonomous = NULL; ark_mem->step_setnlsrhsfn = NULL; ark_mem->step_setdeduceimplicitrhs = NULL; ark_mem->step_setnonlincrdown = NULL; @@ -3456,6 +3459,12 @@ sunbooleantype arkResizeVectors(ARKodeMem ark_mem, ARKVecResizeFn resize, return (SUNFALSE); } + if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, + &ark_mem->tempv5)) + { + return (SUNFALSE); + } + /* constraints */ if (!arkResizeVec(ark_mem, resize, resize_data, lrw_diff, liw_diff, tmpl, &ark_mem->constraints)) @@ -3480,6 +3489,7 @@ void arkFreeVectors(ARKodeMem ark_mem) arkFreeVec(ark_mem, &ark_mem->tempv2); arkFreeVec(ark_mem, &ark_mem->tempv3); arkFreeVec(ark_mem, &ark_mem->tempv4); + arkFreeVec(ark_mem, &ark_mem->tempv5); arkFreeVec(ark_mem, &ark_mem->yn); arkFreeVec(ark_mem, &ark_mem->fn); arkFreeVec(ark_mem, &ark_mem->Vabstol); diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 1c1a7dc92f..f51f5a732f 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -120,6 +120,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, ark_mem->step_setnonlinearsolver = arkStep_SetNonlinearSolver; ark_mem->step_setlinear = arkStep_SetLinear; ark_mem->step_setnonlinear = arkStep_SetNonlinear; + ark_mem->step_setautonomous = arkStep_SetAutonomous; ark_mem->step_setnlsrhsfn = arkStep_SetNlsRhsFn; ark_mem->step_setdeduceimplicitrhs = arkStep_SetDeduceImplicitRhs; ark_mem->step_setnonlincrdown = arkStep_SetNonlinCRDown; @@ -249,6 +250,9 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, step_mem->forcing = NULL; step_mem->nforcing = 0; + /* Initialize saved fi alias */ + step_mem->fn_implicit = NULL; + /* Initialize main ARKODE infrastructure */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); if (retval != ARK_SUCCESS) @@ -1660,6 +1664,10 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) sunbooleantype deduce_stage; sunbooleantype save_stages; sunbooleantype stiffly_accurate; + sunbooleantype save_fn_for_interp; + sunbooleantype imex_method; + sunbooleantype save_fn_for_residual; + sunbooleantype eval_rhs; ARKodeARKStepMem step_mem; N_Vector zcor0; @@ -1695,7 +1703,10 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) save_stages = SUNTRUE; } - /* check for implicit method with explicit first stage */ + /* check for an ImEx method */ + imex_method = step_mem->implicit && step_mem->explicit; + + /* check for implicit method with an explicit first stage */ implicit_stage = SUNFALSE; is_start = 1; if (step_mem->implicit) @@ -1731,23 +1742,88 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } - /* 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. */ + /* For a stiffly accurate implicit or ImEx method with an implicit first + stage, save f(tn, yn) if using Hermite interpolation as Fi[0] will be + overwritten during the implicit solve */ + save_fn_for_interp = implicit_stage && stiffly_accurate && + ark_mem->interp_type == ARK_INTERP_HERMITE; + + /* For an implicit or ImEx method using the trivial predictor with an + autonomous problem with an identity or fixed mass matrix, save fi(tn, yn) + for reuse in the first residual evaluation of each stage solve */ + save_fn_for_residual = step_mem->implicit && step_mem->predictor == 0 && + step_mem->autonomous && + step_mem->mass_type != MASS_TIMEDEP; + + /* Call the RHS if needed. */ + eval_rhs = !implicit_stage || save_fn_for_interp || save_fn_for_residual; + + if (!(ark_mem->fn_is_current) && eval_rhs) + { + /* If saving the RHS evaluation for reuse in the residual, call the full RHS + for all implicit methods or for ImEx methods with an explicit first + stage. ImEx methods with an implicit first stage may not need to evaluate + fe depending on the interpolation type. */ + sunbooleantype res_full_rhs = save_fn_for_residual && implicit_stage && + !imex_method; + + if (!implicit_stage || save_fn_for_interp || res_full_rhs) + { + /* Need full RHS evaluation. If this is the first step, then we evaluate + or copy the RHS values from an earlier evaluation (e.g., to compute + h0). For subsequent steps treat this call as an evaluation at the end + of the just completed step (tn, yn) and potentially reuse the + evaluation (FSAL method) or save the value for later use. */ + 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; + } + else + { + /* For an ImEx method with implicit first stage and an interpolation + method that does not need fn (e.g., Lagrange), only evaluate fi (if + necessary) for reuse in the residual */ + if (stiffly_accurate) + { + N_VScale(ONE, step_mem->Fi[step_mem->stages - 1], step_mem->Fi[0]); + } + else + { + retval = step_mem->fi(ark_mem->tn, ark_mem->yn, step_mem->Fi[0], + ark_mem->user_data); + step_mem->nfi++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return ARK_UNREC_RHSFUNC_ERR; } + } + } + } - if ((!implicit_stage || - (stiffly_accurate && ark_mem->interp_type == ARK_INTERP_HERMITE)) && - !(ark_mem->fn_is_current)) + /* Set alias to implicit RHS evaluation for reuse in residual */ + step_mem->fn_implicit = NULL; + if (save_fn_for_residual) { - 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 (!implicit_stage) + { + /* Explicit first stage -- Fi[0] will be retained */ + step_mem->fn_implicit = step_mem->Fi[0]; + } + else + { + /* Implicit first stage -- Fi[0] will be overwritten */ + if (imex_method || step_mem->mass_type == MASS_FIXED) + { + /* Copy from Fi[0] as fn includes fe or M^{-1} */ + N_VScale(ONE, step_mem->Fi[0], ark_mem->tempv5); + step_mem->fn_implicit = ark_mem->tempv5; + } + else + { + /* fn is the same as Fi[0] but will not be overwritten */ + step_mem->fn_implicit = ark_mem->fn; + } + } } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 5a020b32a7..8af982cd1b 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -67,14 +67,15 @@ extern "C" { typedef struct ARKodeARKStepMemRec { /* ARK problem specification */ - ARKRhsFn fe; /* My' = fe(t,y) + fi(t,y) */ + ARKRhsFn fe; /* My' = fe(t,y) + fi(t,y) */ ARKRhsFn fi; + sunbooleantype autonomous; /* SUNTRUE if fi depends on t */ sunbooleantype linear; /* SUNTRUE if fi is linear */ sunbooleantype linear_timedep; /* SUNTRUE if dfi/dy depends on t */ sunbooleantype explicit; /* SUNTRUE if fe is enabled */ sunbooleantype implicit; /* SUNTRUE if fi is enabled */ sunbooleantype deduce_rhs; /* SUNTRUE if fi is deduced after - a nonlinear solve */ + a nonlinear solve */ /* ARK method storage and parameters */ N_Vector* Fe; /* explicit RHS at each stage */ @@ -118,8 +119,9 @@ typedef struct ARKodeARKStepMemRec int maxcor; /* max num iterations for solving the nonlinear equation */ - int convfail; /* NLS fail flag (for interface routines) */ - sunbooleantype jcur; /* is Jacobian info for lin solver current? */ + int convfail; /* NLS fail flag (for interface routines) */ + sunbooleantype jcur; /* is Jacobian info for lin solver current? */ + N_Vector fn_implicit; /* alias to saved implicit function evaluation */ /* Linear Solver Data */ ARKLinsolInitFn linit; @@ -195,6 +197,7 @@ int arkStep_SetNonlinearSolver(ARKodeMem ark_mem, SUNNonlinearSolver NLS); int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi); int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend); int arkStep_SetNonlinear(ARKodeMem ark_mem); +int arkStep_SetAutonomous(ARKodeMem ark_mem, sunbooleantype autonomous); int arkStep_SetNonlinCRDown(ARKodeMem ark_mem, sunrealtype crdown); int arkStep_SetNonlinRDiv(ARKodeMem ark_mem, sunrealtype rdiv); int arkStep_SetDeltaGammaMax(ARKodeMem ark_mem, sunrealtype dgmax); @@ -236,6 +239,7 @@ int arkStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess); int arkStep_StageSetup(ARKodeMem ark_mem, sunbooleantype implicit); int arkStep_NlsInit(ARKodeMem ark_mem); int arkStep_Nls(ARKodeMem ark_mem, int nflag); +int arkStep_SetNlsSysFn(ARKodeMem ark_mem); int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsm); int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsm); void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype* stage_times, @@ -243,10 +247,20 @@ void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype* stage_times, /* private functions passed to nonlinear solver */ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem); +int arkStep_NlsResidual_MassIdent_TrivialPredAutonomous(N_Vector zcor, N_Vector r, + void* arkode_mem); int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem); +int arkStep_NlsResidual_MassFixed_TrivialPredAutonomous(N_Vector zcor, N_Vector r, + void* arkode_mem); int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem); int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem); +int arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous(N_Vector zcor, + N_Vector g, + void* arkode_mem); int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem); +int arkStep_NlsFPFunction_MassFixed_TrivialPredAutonomous(N_Vector zcor, + N_Vector g, + void* arkode_mem); int arkStep_NlsFPFunction_MassTDep(N_Vector zcor, N_Vector g, void* arkode_mem); int arkStep_NlsLSetup(sunbooleantype jbad, sunbooleantype* jcur, void* arkode_mem); diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index a95ddf9f30..7df74cb590 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -665,6 +665,7 @@ int arkStep_SetDefaults(ARKodeMem ark_mem) step_mem->predictor = 0; /* trivial predictor */ step_mem->linear = SUNFALSE; /* nonlinear problem */ step_mem->linear_timedep = SUNTRUE; /* dfi/dy depends on t */ + step_mem->autonomous = SUNFALSE; /* non-autonomous problem */ step_mem->explicit = SUNTRUE; /* fe(t,y) will be used */ step_mem->implicit = SUNTRUE; /* fi(t,y) will be used */ step_mem->deduce_rhs = SUNFALSE; /* deduce fi on result of NLS */ @@ -749,6 +750,14 @@ int arkStep_SetLinear(ARKodeMem ark_mem, int timedepend) retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } + if (timedepend && step_mem->autonomous) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Incompatible settings, the problem is autonomous but the " + "Jacobian is time dependent"); + return ARK_ILL_INPUT; + } + /* set parameters */ step_mem->linear = SUNTRUE; step_mem->linear_timedep = (timedepend == 1); @@ -781,6 +790,56 @@ int arkStep_SetNonlinear(ARKodeMem ark_mem) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + arkStep_SetAutonomous: + + Indicates if the problem is autonomous (True) or non-autonomous + (False). + ---------------------------------------------------------------*/ +int arkStep_SetAutonomous(ARKodeMem ark_mem, sunbooleantype autonomous) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + step_mem->autonomous = autonomous; + + if (autonomous && step_mem->linear) { step_mem->linear_timedep = SUNFALSE; } + + /* Reattach the nonlinear system function e.g., switching to/from an + autonomous problem with the trivial predictor requires swapping the + nonlinear system function provided to the nonlinear solver */ + retval = arkStep_SetNlsSysFn(ark_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Setting nonlinear system function failed"); + return ARK_ILL_INPUT; + } + + /* This will be better handled when the temp vector stack is added */ + if (autonomous) + { + /* Allocate tempv5 if needed */ + if (!arkAllocVec(ark_mem, ark_mem->yn, &ark_mem->tempv5)) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_MEM_FAIL); + return ARK_MEM_FAIL; + } + } + else + { + /* Free tempv5 if necessary */ + arkFreeVec(ark_mem, &ark_mem->tempv5); + } + + return ARK_SUCCESS; +} + /*--------------------------------------------------------------- arkStep_SetNonlinCRDown: @@ -893,6 +952,17 @@ int arkStep_SetPredictorMethod(ARKodeMem ark_mem, int pred_method) /* set parameter */ step_mem->predictor = pred_method; + /* Reattach the nonlinear system function e.g., switching to/from the trivial + predictor with an autonomous problem requires swapping the nonlinear system + function provided to the nonlinear solver */ + retval = arkStep_SetNlsSysFn(ark_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Setting nonlinear system function failed"); + return ARK_ILL_INPUT; + } + return (ARK_SUCCESS); } diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index d11f69d518..5f1811b156 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -122,6 +122,122 @@ int arkStep_SetNlsRhsFn(ARKodeMem ark_mem, ARKRhsFn nls_fi) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + arkStep_SetNlsSysFn: + + This routine sets the appropriate version of the nonlinear + system function based on the current settings. + ---------------------------------------------------------------*/ +int arkStep_SetNlsSysFn(ARKodeMem ark_mem) +{ + ARKodeARKStepMem step_mem; + int retval; + + /* access ARKodeARKStepMem structure */ + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* set the nonlinear residual/fixed-point function, based on solver type */ + if (SUNNonlinSolGetType(step_mem->NLS) == SUNNONLINEARSOLVER_ROOTFIND) + { + if (step_mem->mass_type == MASS_IDENTITY) + { + if (step_mem->predictor == 0 && step_mem->autonomous) + { + retval = + SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsResidual_MassIdent_TrivialPredAutonomous); + } + else + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsResidual_MassIdent); + } + } + else if (step_mem->mass_type == MASS_FIXED) + { + if (step_mem->predictor == 0 && step_mem->autonomous) + { + retval = + SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsResidual_MassFixed_TrivialPredAutonomous); + } + else + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsResidual_MassFixed); + } + } + else if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, arkStep_NlsResidual_MassTDep); + } + else + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid mass matrix type"); + return (ARK_ILL_INPUT); + } + } + else if (SUNNonlinSolGetType(step_mem->NLS) == SUNNONLINEARSOLVER_FIXEDPOINT) + { + if (step_mem->mass_type == MASS_IDENTITY) + { + if (step_mem->predictor == 0 && step_mem->autonomous) + { + retval = + SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous); + } + else + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsFPFunction_MassIdent); + } + } + else if (step_mem->mass_type == MASS_FIXED) + { + if (step_mem->predictor == 0 && step_mem->autonomous) + { + retval = + SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsFPFunction_MassFixed_TrivialPredAutonomous); + } + else + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsFPFunction_MassFixed); + } + } + else if (step_mem->mass_type == MASS_TIMEDEP) + { + retval = SUNNonlinSolSetSysFn(step_mem->NLS, + arkStep_NlsFPFunction_MassTDep); + } + else + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid mass matrix type"); + return (ARK_ILL_INPUT); + } + } + else + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid nonlinear solver type"); + return (ARK_ILL_INPUT); + } + + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Setting nonlinear system function failed"); + return (ARK_ILL_INPUT); + } + + return ARK_SUCCESS; +} + /*--------------------------------------------------------------- arkStep_GetNonlinearSystemData: @@ -208,58 +324,7 @@ int arkStep_NlsInit(ARKodeMem ark_mem) return (ARK_NLS_INIT_FAIL); } - /* set the nonlinear residual/fixed-point function, based on solver type */ - if (SUNNonlinSolGetType(step_mem->NLS) == SUNNONLINEARSOLVER_ROOTFIND) - { - if (step_mem->mass_type == MASS_IDENTITY) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, arkStep_NlsResidual_MassIdent); - } - else if (step_mem->mass_type == MASS_FIXED) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, arkStep_NlsResidual_MassFixed); - } - else if (step_mem->mass_type == MASS_TIMEDEP) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, arkStep_NlsResidual_MassTDep); - } - else - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid mass matrix type"); - return (ARK_ILL_INPUT); - } - } - else if (SUNNonlinSolGetType(step_mem->NLS) == SUNNONLINEARSOLVER_FIXEDPOINT) - { - if (step_mem->mass_type == MASS_IDENTITY) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, - arkStep_NlsFPFunction_MassIdent); - } - else if (step_mem->mass_type == MASS_FIXED) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, - arkStep_NlsFPFunction_MassFixed); - } - else if (step_mem->mass_type == MASS_TIMEDEP) - { - retval = SUNNonlinSolSetSysFn(step_mem->NLS, - arkStep_NlsFPFunction_MassTDep); - } - else - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid mass matrix type"); - return (ARK_ILL_INPUT); - } - } - else - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid nonlinear solver type"); - return (ARK_ILL_INPUT); - } + retval = arkStep_SetNlsSysFn(ark_mem); if (retval != ARK_SUCCESS) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -463,7 +528,8 @@ int arkStep_NlsLSolve(N_Vector b, void* arkode_mem) } /*--------------------------------------------------------------- - arkStep_NlsResidual_MassIdent: + arkStep_NlsResidual_MassIdent + arkStep_NlsResidual_MassIdent_TrivialPredAutonomous This routine evaluates the nonlinear residual for the additive Runge-Kutta method. It assumes that any data from previous @@ -488,6 +554,10 @@ int arkStep_NlsLSolve(N_Vector b, void* arkode_mem) z = zp + zc (stored in ark_mem->ycur) Fi(z) (stored step_mem->Fi[step_mem->istage]) r = zc - gamma*Fi(z) - step_mem->sdata + + The "TrivialPredAutonomous" version reuses the implicit RHS + evaluation at the beginning of the step in the initial residual + evaluation. ---------------------------------------------------------------*/ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) { @@ -505,13 +575,59 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) /* update 'ycur' value as stored predictor + current corrector */ N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); - /* compute implicit RHS */ retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, step_mem->Fi[step_mem->istage], ark_mem->user_data); step_mem->nfi++; if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (RHSFUNC_RECVR); } + /* compute residual via linear combination */ + c[0] = ONE; + X[0] = zcor; + c[1] = -ONE; + X[1] = step_mem->sdata; + c[2] = -step_mem->gamma; + X[2] = step_mem->Fi[step_mem->istage]; + retval = N_VLinearCombination(3, c, X, r); + if (retval != 0) { return (ARK_VECTOROP_ERR); } + + return (ARK_SUCCESS); +} + +int arkStep_NlsResidual_MassIdent_TrivialPredAutonomous(N_Vector zcor, N_Vector r, + void* arkode_mem) +{ + /* temporary variables */ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval, nls_iter; + sunrealtype c[3]; + N_Vector X[3]; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* update 'ycur' value as stored predictor + current corrector */ + N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); + + /* compute implicit RHS if not already available */ + retval = SUNNonlinSolGetCurIter(step_mem->NLS, &nls_iter); + if (retval != ARK_SUCCESS) { return ARK_NLS_OP_ERR; } + + if (nls_iter == 0 && step_mem->fn_implicit) + { + N_VScale(ONE, step_mem->fn_implicit, step_mem->Fi[step_mem->istage]); + } + else + { + retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fi[step_mem->istage], ark_mem->user_data); + step_mem->nfi++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (RHSFUNC_RECVR); } + } + /* compute residual via linear combination */ c[0] = ONE; X[0] = zcor; @@ -525,7 +641,8 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) } /*--------------------------------------------------------------- - arkStep_NlsResidual_MassFixed: + arkStep_NlsResidual_MassFixed + arkStep_NlsResidual_MassFixed_TrivialPredAutonomous This routine evaluates the nonlinear residual for the additive Runge-Kutta method. It assumes that any data from previous @@ -550,6 +667,10 @@ int arkStep_NlsResidual_MassIdent(N_Vector zcor, N_Vector r, void* arkode_mem) z = zp + zc (stored in ark_mem->ycur) Fi(z) (stored step_mem->Fi[step_mem->istage]) r = M*zc - gamma*Fi(z) - step_mem->sdata + + The "TrivialPredAutonomous" version reuses the implicit RHS + evaluation at the beginning of the step in the initial residual + evaluation. ---------------------------------------------------------------*/ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) { @@ -567,7 +688,7 @@ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) /* update 'ycur' value as stored predictor + current corrector */ N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); - /* compute implicit RHS */ + /* compute implicit RHS if not already available */ retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, step_mem->Fi[step_mem->istage], ark_mem->user_data); step_mem->nfi++; @@ -590,6 +711,56 @@ int arkStep_NlsResidual_MassFixed(N_Vector zcor, N_Vector r, void* arkode_mem) return (ARK_SUCCESS); } +int arkStep_NlsResidual_MassFixed_TrivialPredAutonomous(N_Vector zcor, N_Vector r, + void* arkode_mem) +{ + /* temporary variables */ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval, nls_iter; + sunrealtype c[3]; + N_Vector X[3]; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* update 'ycur' value as stored predictor + current corrector */ + N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); + + /* compute implicit RHS if not already available */ + retval = SUNNonlinSolGetCurIter(step_mem->NLS, &nls_iter); + if (retval != ARK_SUCCESS) { return ARK_NLS_OP_ERR; } + + if (nls_iter == 0 && step_mem->fn_implicit) + { + N_VScale(ONE, step_mem->fn_implicit, step_mem->Fi[step_mem->istage]); + } + else + { + retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fi[step_mem->istage], ark_mem->user_data); + step_mem->nfi++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (RHSFUNC_RECVR); } + } + + /* put M*zcor in r */ + retval = step_mem->mmult((void*)ark_mem, zcor, r); + if (retval != ARK_SUCCESS) { return (ARK_MASSMULT_FAIL); } + + /* compute residual via linear combination */ + c[0] = ONE; + X[0] = r; + c[1] = -ONE; + X[1] = step_mem->sdata; + c[2] = -step_mem->gamma; + X[2] = step_mem->Fi[step_mem->istage]; + retval = N_VLinearCombination(3, c, X, r); + if (retval != 0) { return (ARK_VECTOROP_ERR); } + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- arkStep_NlsResidual_MassTDep: @@ -653,7 +824,8 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem) } /*--------------------------------------------------------------- - arkStep_NlsFPFunction_MassIdent: + arkStep_NlsFPFunction_MassIdent + arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous This routine evaluates the fixed point iteration function for the additive Runge-Kutta method. It assumes that any data from @@ -685,6 +857,10 @@ int arkStep_NlsResidual_MassTDep(N_Vector zcor, N_Vector r, void* arkode_mem) so we really just compute: Fi(z) (store in step_mem->Fi[step_mem->istage]) g = gamma*Fi(z) + step_mem->sdata + + The "TrivialPredAutonomous" version reuses the implicit RHS + evaluation at the beginning of the step in the initial FP + function evaluation. ---------------------------------------------------------------*/ int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem) { @@ -714,8 +890,50 @@ int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem) return (ARK_SUCCESS); } +int arkStep_NlsFPFunction_MassIdent_TrivialPredAutonomous(N_Vector zcor, + N_Vector g, + void* arkode_mem) +{ + /* temporary variables */ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval, nls_iter; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* update 'ycur' value as stored predictor + current corrector */ + N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); + + /* compute implicit RHS if not already available */ + retval = SUNNonlinSolGetCurIter(step_mem->NLS, &nls_iter); + if (retval != ARK_SUCCESS) { return ARK_NLS_OP_ERR; } + + if (nls_iter == 0 && step_mem->fn_implicit) + { + N_VScale(ONE, step_mem->fn_implicit, step_mem->Fi[step_mem->istage]); + } + else + { + /* compute implicit RHS and save for later */ + retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fi[step_mem->istage], ark_mem->user_data); + step_mem->nfi++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (RHSFUNC_RECVR); } + } + + /* combine parts: g = gamma*Fi(z) + sdata */ + N_VLinearSum(step_mem->gamma, step_mem->Fi[step_mem->istage], ONE, + step_mem->sdata, g); + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- - arkStep_NlsFPFunction_MassFixed: + arkStep_NlsFPFunction_MassFixed + arkStep_NlsFPFunction_MassFixed_TrivialPredAutonomous This routine evaluates the fixed point iteration function for the additive Runge-Kutta method. It assumes that any data from @@ -748,6 +966,10 @@ int arkStep_NlsFPFunction_MassIdent(N_Vector zcor, N_Vector g, void* arkode_mem) Fi(z) (store in step_mem->Fi[step_mem->istage]) g = gamma*Fi(z) + step_mem->sdata g = M^{-1}*g + + The "TrivialPredAutonomous" version reuses the implicit RHS + evaluation at the beginning of the step in the initial FP + function evaluation. ---------------------------------------------------------------*/ int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem) { @@ -782,6 +1004,52 @@ int arkStep_NlsFPFunction_MassFixed(N_Vector zcor, N_Vector g, void* arkode_mem) return (ARK_SUCCESS); } +int arkStep_NlsFPFunction_MassFixed_TrivialPredAutonomous(N_Vector zcor, + N_Vector g, + void* arkode_mem) +{ + /* temporary variables */ + ARKodeMem ark_mem; + ARKodeARKStepMem step_mem; + int retval, nls_iter; + + /* access ARKodeMem and ARKodeARKStepMem structures */ + retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* update 'ycur' value as stored predictor + current corrector */ + N_VLinearSum(ONE, step_mem->zpred, ONE, zcor, ark_mem->ycur); + + /* compute implicit RHS if not already available */ + retval = SUNNonlinSolGetCurIter(step_mem->NLS, &nls_iter); + if (retval != ARK_SUCCESS) { return ARK_NLS_OP_ERR; } + + if (nls_iter == 0 && step_mem->fn_implicit) + { + N_VScale(ONE, step_mem->fn_implicit, step_mem->Fi[step_mem->istage]); + } + else + { + /* compute implicit RHS and save for later */ + retval = step_mem->nls_fi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fi[step_mem->istage], ark_mem->user_data); + step_mem->nfi++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (RHSFUNC_RECVR); } + } + + /* combine parts: g = gamma*Fi(z) + sdata */ + N_VLinearSum(step_mem->gamma, step_mem->Fi[step_mem->istage], ONE, + step_mem->sdata, g); + + /* perform mass matrix solve */ + retval = step_mem->msolve((void*)ark_mem, g, step_mem->nlscoef); + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (RHSFUNC_RECVR); } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- arkStep_NlsFPFunction_MassTDep: diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 80edfb6829..2b4ad70e3a 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -251,6 +251,8 @@ typedef int (*ARKTimestepSetNonlinearSolver)(ARKodeMem ark_mem, SUNNonlinearSolver NLS); typedef int (*ARKTimestepSetLinear)(ARKodeMem ark_mem, int timedepend); typedef int (*ARKTimestepSetNonlinear)(ARKodeMem ark_mem); +typedef int (*ARKTimestepSetAutonomous)(ARKodeMem ark_mem, + sunbooleantype autonomous); typedef int (*ARKTimestepSetNlsRhsFn)(ARKodeMem ark_mem, ARKRhsFn nls_fi); typedef int (*ARKTimestepSetDeduceImplicitRhs)(ARKodeMem ark_mem, sunbooleantype deduce); @@ -423,6 +425,7 @@ struct ARKodeMemRec ARKTimestepComputeState step_computestate; ARKTimestepSetNonlinearSolver step_setnonlinearsolver; ARKTimestepSetLinear step_setlinear; + ARKTimestepSetAutonomous step_setautonomous; ARKTimestepSetNonlinear step_setnonlinear; ARKTimestepSetNlsRhsFn step_setnlsrhsfn; ARKTimestepSetDeduceImplicitRhs step_setdeduceimplicitrhs; @@ -462,6 +465,7 @@ struct ARKodeMemRec N_Vector tempv2; /* and by time-stepping modules) */ N_Vector tempv3; N_Vector tempv4; + N_Vector tempv5; N_Vector constraints; /* vector of inequality constraint options */ @@ -1277,6 +1281,13 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); --------------------------------------------------------------- + ARKTimestepSetAutonomous + + This routine is called by ARKodeSetAutonomous, and allows the + stepper to store the corresponding user input. + + --------------------------------------------------------------- + ARKTimestepSetNonlinear This routine is called by ARKodeSetNonlinear, and allows the diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index fd7287fbde..b8a12c6a33 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -400,6 +400,39 @@ int ARKodeSetNonlinear(void* arkode_mem) } } +int ARKodeSetAutonomous(void* arkode_mem, sunbooleantype autonomous) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for time steppers that do not need an algebraic solver */ + if (!ark_mem->step_supports_implicit) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not require an algebraic solver"); + return ARK_STEPPER_UNSUPPORTED; + } + + /* Call stepper routine (if provided) */ + if (ark_mem->step_setautonomous) + { + return ark_mem->step_setautonomous(arkode_mem, autonomous); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return ARK_STEPPER_UNSUPPORTED; + } +} + /*--------------------------------------------------------------- ARKodeSetNlsRhsFn: diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod/farkode_mod.c index 61db05f83e..7b2c3c9811 100644 --- a/src/arkode/fmod/farkode_mod.c +++ b/src/arkode/fmod/farkode_mod.c @@ -687,6 +687,20 @@ SWIGEXPORT int _wrap_FARKodeSetNonlinear(void *farg1) { } +SWIGEXPORT int _wrap_FARKodeSetAutonomous(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetAutonomous(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -2700,6 +2714,19 @@ SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadDIRKByName(SwigArrayWrapper *far } +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeButcherTable_DIRKIDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_DIRKTableID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_DIRKTableID)(*farg1); + result = (char *)ARKodeButcherTable_DIRKIDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadERK(int const *farg1) { void * fresult ; ARKODE_ERKTableID arg1 ; @@ -2724,6 +2751,19 @@ SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadERKByName(SwigArrayWrapper *farg } +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeButcherTable_ERKIDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_ERKTableID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_ERKTableID)(*farg1); + result = (char *)ARKodeButcherTable_ERKIDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + SWIGEXPORT void _wrap_ARKodeSPRKTableMem_q_set(SwigClassWrapper const *farg1, int const *farg2) { struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; int arg2 ; diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod/farkode_mod.f90 index 182cf7fe2f..e627472572 100644 --- a/src/arkode/fmod/farkode_mod.f90 +++ b/src/arkode/fmod/farkode_mod.f90 @@ -128,6 +128,7 @@ module farkode_mod public :: FARKodeSetNonlinearSolver public :: FARKodeSetLinear public :: FARKodeSetNonlinear + public :: FARKodeSetAutonomous public :: FARKodeSetNlsRhsFn public :: FARKodeSetDeduceImplicitRhs public :: FARKodeSetNonlinCRDown @@ -331,6 +332,7 @@ module farkode_mod ARKODE_BACKWARD_EULER_1_1, ARKODE_IMPLICIT_MIDPOINT_1_2, ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, ARKODE_MAX_DIRK_NUM public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName + public :: FARKodeButcherTable_DIRKIDToName ! typedef enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 @@ -372,6 +374,7 @@ module farkode_mod ARKODE_RALSTON_EULER_2_1_2, ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2, ARKODE_MAX_ERK_NUM public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName + public :: FARKodeButcherTable_ERKIDToName ! typedef enum ARKODE_SPRKMethodID enum, bind(c) enumerator :: ARKODE_SPRK_NONE = -1 @@ -693,6 +696,15 @@ function swigc_FARKodeSetNonlinear(farg1) & integer(C_INT) :: fresult end function +function swigc_FARKodeSetAutonomous(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAutonomous") & +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_FARKodeSetNlsRhsFn(farg1, farg2) & bind(C, name="_wrap_FARKodeSetNlsRhsFn") & result(fresult) @@ -1999,6 +2011,15 @@ function swigc_FARKodeButcherTable_LoadDIRKByName(farg1) & type(C_PTR) :: fresult end function +function swigc_FARKodeButcherTable_DIRKIDToName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_DIRKIDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + function swigc_FARKodeButcherTable_LoadERK(farg1) & bind(C, name="_wrap_FARKodeButcherTable_LoadERK") & result(fresult) @@ -2016,6 +2037,15 @@ function swigc_FARKodeButcherTable_LoadERKByName(farg1) & type(C_PTR) :: fresult end function +function swigc_FARKodeButcherTable_ERKIDToName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_ERKIDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + subroutine swigc_ARKodeSPRKTableMem_q_set(farg1, farg2) & bind(C, name="_wrap_ARKodeSPRKTableMem_q_set") use, intrinsic :: ISO_C_BINDING @@ -2767,6 +2797,22 @@ function FARKodeSetNonlinear(arkode_mem) & swig_result = fresult end function +function FARKodeSetAutonomous(arkode_mem, autonomous) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: autonomous +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = autonomous +fresult = swigc_FARKodeSetAutonomous(farg1, farg2) +swig_result = fresult +end function + function FARKodeSetNlsRhsFn(arkode_mem, nls_fi) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -5117,6 +5163,20 @@ function FARKodeButcherTable_LoadDIRKByName(imethod) & swig_result = fresult end function +function FARKodeButcherTable_DIRKIDToName(imethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_DIRKTableID), intent(in) :: imethod +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = imethod +fresult = swigc_FARKodeButcherTable_DIRKIDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + function FARKodeButcherTable_LoadERK(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -5144,6 +5204,20 @@ function FARKodeButcherTable_LoadERKByName(emethod) & swig_result = fresult end function +function FARKodeButcherTable_ERKIDToName(emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_ERKTableID), intent(in) :: emethod +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = emethod +fresult = swigc_FARKodeButcherTable_ERKIDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + subroutine swigf_ARKodeSPRKTableMem_q_set(self, q) use, intrinsic :: ISO_C_BINDING class(ARKodeSPRKTableMem), intent(in) :: self diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 090f91a7a3..c4c0af932a 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -207,6 +207,20 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, Preform Newton iteraion */ for (;;) { + /* initialize current iteration counter for this solve attempt */ + NEWTON_CONTENT(NLS)->curiter = 0; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "begin-attempt", "iter = %ld, nni = %ld", + (long int)NEWTON_CONTENT(NLS)->curiter, + NEWTON_CONTENT(NLS)->niters); + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "start-iterate", "iter = %ld, nni = %ld", + (long int)NEWTON_CONTENT(NLS)->curiter, + NEWTON_CONTENT(NLS)->niters); +#endif + /* compute the nonlinear residual, store in delta */ retval = NEWTON_CONTENT(NLS)->Sys(ycor, delta, mem); if (retval != SUN_SUCCESS) { break; } @@ -219,16 +233,6 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, if (retval != SUN_SUCCESS) { break; } } - /* initialize current iteration counter for this solve attempt */ - NEWTON_CONTENT(NLS)->curiter = 0; - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNNonlinSolSolve_Newton", "begin-iteration", - "iter = %ld, nni = %ld", (long int)0, - NEWTON_CONTENT(NLS)->niters); -#endif - /* looping point for Newton iteration. Break out on any error. */ for (;;) { @@ -252,16 +256,24 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, NEWTON_CONTENT(NLS)->ctest_data); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNNonlinSolSolve_Newton", "end-of-iterate", - "iter = %ld, nni = %ld, wrmsnorm = %.16g", + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "end-iterate", "iter = %ld, nni = %ld, wrmsnorm = %.16g", NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters, N_VWrmsNorm(delta, w)); + NEWTON_CONTENT(NLS)->niters - 1, N_VWrmsNorm(delta, w)); #endif + /* Update here so begin/end logging iterations match */ + NEWTON_CONTENT(NLS)->curiter++; + /* if successful update Jacobian status and return */ if (retval == SUN_SUCCESS) { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "end-attempt", "success, iter = %ld, nni = %ld", + (long int)NEWTON_CONTENT(NLS)->curiter, + NEWTON_CONTENT(NLS)->niters); +#endif NEWTON_CONTENT(NLS)->jcur = SUNFALSE; return SUN_SUCCESS; } @@ -269,14 +281,20 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, /* check if the iteration should continue; otherwise exit Newton loop */ if (retval != SUN_NLS_CONTINUE) { break; } - /* not yet converged. Increment curiter and test for max allowed. */ - NEWTON_CONTENT(NLS)->curiter++; + /* not yet converged, test for max allowed iterations. */ if (NEWTON_CONTENT(NLS)->curiter >= NEWTON_CONTENT(NLS)->maxiters) { retval = SUN_NLS_CONV_RECVR; break; } +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "start-iterate", "iter = %ld, nni = %ld", + (long int)NEWTON_CONTENT(NLS)->curiter, + NEWTON_CONTENT(NLS)->niters); +#endif + /* compute the nonlinear residual, store in delta */ retval = NEWTON_CONTENT(NLS)->Sys(ycor, delta, mem); if (retval != SUN_SUCCESS) { break; } @@ -285,6 +303,13 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, /* all errors go here */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO + SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, + "end-attempt", "failure, iter = %ld, nni = %ld", + (long int)NEWTON_CONTENT(NLS)->curiter, + NEWTON_CONTENT(NLS)->niters); +#endif + /* If there is a recoverable convergence failure and the Jacobian-related data appears not to be current, increment the convergence failure count, reset the initial correction to zero, and loop again with a call to diff --git a/test/answers b/test/answers index a7784dcea1..96a64d9683 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit a7784dcea101f2240e883d26a0691998324beda4 +Subproject commit 96a64d9683fa88ca890c097685e373a1efd3407e diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 331b1ece35..0d2bc15460 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -18,15 +18,21 @@ set(unit_tests "ark_test_analytic_sys_mri.cpp\;0" "ark_test_analytic_sys_mri.cpp\;1" - "ark_test_dahlquist_ark.cpp\;0 -1" - "ark_test_dahlquist_ark.cpp\;1 -1" - "ark_test_dahlquist_ark.cpp\;2 -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_ark.cpp\;0 -1 0" + "ark_test_dahlquist_ark.cpp\;0 0 0" + "ark_test_dahlquist_ark.cpp\;0 0 1" + "ark_test_dahlquist_ark.cpp\;0 1 0" + "ark_test_dahlquist_ark.cpp\;0 1 1" + "ark_test_dahlquist_ark.cpp\;1 -1 0" + "ark_test_dahlquist_ark.cpp\;1 0 0" + "ark_test_dahlquist_ark.cpp\;1 0 1" + "ark_test_dahlquist_ark.cpp\;1 1 0" + "ark_test_dahlquist_ark.cpp\;1 1 1" + "ark_test_dahlquist_ark.cpp\;2 -1 0" + "ark_test_dahlquist_ark.cpp\;2 0 0" + "ark_test_dahlquist_ark.cpp\;2 0 1" + "ark_test_dahlquist_ark.cpp\;2 1 0" + "ark_test_dahlquist_ark.cpp\;2 1 1" "ark_test_dahlquist_erk.cpp\;-1" "ark_test_dahlquist_erk.cpp\;0" "ark_test_dahlquist_erk.cpp\;1" 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 index 4cad0ee64b..22d6856800 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp @@ -30,6 +30,7 @@ #include <sunlinsol/sunlinsol_dense.h> #include <sunmatrix/sunmatrix_dense.h> +#include "arkode/arkode.h" #include "arkode/arkode_butcher.h" #if defined(SUNDIALS_EXTENDED_PRECISION) @@ -243,30 +244,6 @@ int main(int argc, char* argv[]) << "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<ARKODE_ERKTableID>(i)); @@ -275,7 +252,9 @@ int main(int argc, char* argv[]) 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 << "ERK: " + << ARKodeButcherTable_ERKIDToName(static_cast<ARKODE_ERKTableID>(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; @@ -297,30 +276,6 @@ int main(int argc, char* argv[]) << "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<ARKODE_DIRKTableID>(i)); @@ -329,7 +284,10 @@ int main(int argc, char* argv[]) 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 << "DIRK: " + << ARKodeButcherTable_DIRKIDToName( + static_cast<ARKODE_DIRKTableID>(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; @@ -407,7 +365,8 @@ int main(int argc, char* argv[]) 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 << "DIRK: " << ark_methods_dirk[i] << std::endl; + std::cout << "ERK: " << ark_methods_erk[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; @@ -538,6 +497,10 @@ int run_tests(ARKodeButcherTable Be, ARKodeButcherTable Bi, flag = ARKodeSetLinear(arkstep_mem, 0); if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + // Specify an autonomous RHS + flag = ARKodeSetAutonomous(arkstep_mem, SUNTRUE); + if (check_flag(&flag, "ARKodeSetAutonomous", 1)) { return 1; } + // Specify implicit predictor method flag = ARKodeSetPredictorMethod(arkstep_mem, prob_opts.p_type); if (check_flag(&flag, "ARKodeSetPredictorMethod", 1)) { return 1; } @@ -779,10 +742,40 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, long int extra_fe_evals = 0; long int extra_fi_evals = 0; + bool save_fn_for_residual = prob_opts.p_type == 0 && + prob_opts.m_type != + mass_matrix_type::time_dependent && + prob_opts.r_type != rk_type::expl; + if (prob_opts.r_type == rk_type::impl || prob_opts.r_type == rk_type::imex) { flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } + + // Remove one evaluation per implicit stage + int implicit_stages = (explicit_first_stage) ? stages - 1 : stages; + + if (save_fn_for_residual) { extra_fi_evals -= implicit_stages * nst; } + + // With higher order methods some predictors require additional RHS when + // using Hermite interpolation (note default degree is order - 1, except + // for first order where the degree is 1. + int degree = (order == 1) ? 1 : order - 1; + + if (prob_opts.p_type != 0 && prob_opts.i_type == interp_type::hermite && + degree > 3) + { + if (prob_opts.r_type == rk_type::expl || prob_opts.r_type == rk_type::imex) + { + extra_fe_evals = (degree == 4) ? 1 : 4; + } + if (prob_opts.r_type == rk_type::impl || prob_opts.r_type == rk_type::imex) + { + extra_fi_evals = (degree == 4) ? 1 : 4; + } + extra_fe_evals *= implicit_stages * (nst - 1); + extra_fi_evals *= implicit_stages * (nst - 1); + } } // Expected number of explicit functions evaluations @@ -810,6 +803,13 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, nfe_expected += nst; } } + + if (prob_opts.i_type != interp_type::hermite && save_fn_for_residual && + !explicit_first_stage) + { + if (stiffly_accurate) { nfe_expected++; } + else { nfe_expected += nst; } + } } // Expected number of implicit functions evaluations @@ -837,6 +837,13 @@ int expected_rhs_evals(ProblemOptions& prob_opts, int stages, int order, nfi_expected += nst; } } + + if (prob_opts.i_type != interp_type::hermite && save_fn_for_residual && + !explicit_first_stage) + { + if (stiffly_accurate) { nfi_expected++; } + else { nfi_expected += nst; } + } } std::cout << "Steps: " << nst << std::endl; 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 deleted file mode 100644 index 92d1e73a20..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.out +++ /dev/null @@ -1,1972 +0,0 @@ - -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_-1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_-1_0.out similarity index 89% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_-1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_-1_0.out index 5ab8fcafd1..251a290409 100644 --- 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_0.out @@ -14,42 +14,7 @@ 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -978,35 +904,35 @@ DIRK Table ID 100 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 4 - expected: 4 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 8 - expected: 8 + actual: 6 + expected: 6 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 12 - expected: 12 + actual: 9 + expected: 9 -------------------- Dense Output Fi RHS evals: - actual: 12 - expected: 12 + actual: 9 + expected: 9 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 16 - expected: 16 + actual: 12 + expected: 12 -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1017,35 +943,35 @@ DIRK Table ID 101 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 12 - expected: 12 + actual: 8 + expected: 8 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 18 - expected: 18 + actual: 12 + expected: 12 -------------------- Dense Output Fi RHS evals: - actual: 18 - expected: 18 + actual: 12 + expected: 12 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 24 - expected: 24 + actual: 16 + expected: 16 -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1056,35 +982,35 @@ DIRK Table ID 102 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Dense Output Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1095,35 +1021,35 @@ DIRK Table ID 103 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1134,35 +1060,35 @@ DIRK Table ID 104 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1173,35 +1099,35 @@ DIRK Table ID 105 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1212,35 +1138,35 @@ DIRK Table ID 106 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1251,35 +1177,35 @@ DIRK Table ID 107 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1290,35 +1216,35 @@ DIRK Table ID 108 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1329,35 +1255,35 @@ DIRK Table ID 109 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1368,35 +1294,35 @@ DIRK Table ID 110 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1407,35 +1333,35 @@ DIRK Table ID 111 Steps: 1 NLS iters: 7 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 15 + expected: 15 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Dense Output Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 57 - expected: 57 + actual: 29 + expected: 29 -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1446,35 +1372,35 @@ DIRK Table ID 112 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1485,35 +1411,35 @@ DIRK Table ID 113 Steps: 1 NLS iters: 7 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 15 + expected: 15 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Dense Output Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 57 - expected: 57 + actual: 29 + expected: 29 -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1524,35 +1450,35 @@ DIRK Table ID 114 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1563,35 +1489,35 @@ DIRK Table ID 115 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1602,35 +1528,35 @@ DIRK Table ID 116 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1641,35 +1567,35 @@ DIRK Table ID 117 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1680,35 +1606,35 @@ DIRK Table ID 118 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1719,35 +1645,35 @@ DIRK Table ID 119 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1758,35 +1684,35 @@ DIRK Table ID 120 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1797,35 +1723,35 @@ DIRK Table ID 121 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1836,35 +1762,35 @@ DIRK Table ID 122 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1875,35 +1801,35 @@ DIRK Table ID 123 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Dense Output Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1920,29 +1846,29 @@ Fi RHS evals: Steps: 2 NLS iters: 2 Fi RHS evals: - actual: 4 - expected: 4 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Dense Output Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 Fi RHS evals: - actual: 8 - expected: 8 + actual: 5 + expected: 5 -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -1992,31 +1918,31 @@ DIRK Table ID 126 Steps: 1 NLS iters: 1 Fi RHS evals: - actual: 3 - expected: 3 + actual: 2 + expected: 2 -------------------- Steps: 2 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Dense Output Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- ===================== @@ -2038,8 +1964,8 @@ Fe RHS evals: actual: 2 expected: 2 Fi RHS evals: - actual: 3 - expected: 3 + actual: 2 + expected: 2 -------------------- Steps: 2 NLS iters: 2 @@ -2047,8 +1973,8 @@ Fe RHS evals: actual: 3 expected: 3 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 @@ -2056,16 +1982,16 @@ Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Dense Output Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 @@ -2073,12 +1999,13 @@ Fe RHS evals: actual: 5 expected: 5 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2092,8 +2019,8 @@ Fe RHS evals: actual: 3 expected: 3 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 @@ -2101,8 +2028,8 @@ Fe RHS evals: actual: 6 expected: 6 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 3 NLS iters: 6 @@ -2110,16 +2037,16 @@ Fe RHS evals: actual: 9 expected: 9 Fi RHS evals: - actual: 15 - expected: 15 + actual: 9 + expected: 9 -------------------- Dense Output Fe RHS evals: actual: 9 expected: 9 Fi RHS evals: - actual: 15 - expected: 15 + actual: 9 + expected: 9 -------------------- Steps: 4 NLS iters: 8 @@ -2127,12 +2054,13 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 20 - expected: 20 + actual: 12 + expected: 12 -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2146,8 +2074,8 @@ Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 @@ -2155,8 +2083,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 14 - expected: 14 + actual: 8 + expected: 8 -------------------- Steps: 3 NLS iters: 9 @@ -2164,16 +2092,16 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 21 - expected: 21 + actual: 12 + expected: 12 -------------------- Dense Output Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 21 - expected: 21 + actual: 12 + expected: 12 -------------------- Steps: 4 NLS iters: 12 @@ -2181,12 +2109,13 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 28 - expected: 28 + actual: 16 + expected: 16 -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2200,8 +2129,8 @@ Fe RHS evals: actual: 6 expected: 6 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 @@ -2209,8 +2138,8 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 22 - expected: 22 + actual: 12 + expected: 12 -------------------- Steps: 3 NLS iters: 15 @@ -2218,16 +2147,16 @@ Fe RHS evals: actual: 18 expected: 18 Fi RHS evals: - actual: 33 - expected: 33 + actual: 18 + expected: 18 -------------------- Dense Output Fe RHS evals: actual: 18 expected: 18 Fi RHS evals: - actual: 33 - expected: 33 + actual: 18 + expected: 18 -------------------- Steps: 4 NLS iters: 20 @@ -2235,12 +2164,13 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 44 - expected: 44 + actual: 24 + expected: 24 -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2254,8 +2184,8 @@ Fe RHS evals: actual: 7 expected: 7 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 @@ -2263,8 +2193,8 @@ Fe RHS evals: actual: 14 expected: 14 Fi RHS evals: - actual: 26 - expected: 26 + actual: 14 + expected: 14 -------------------- Steps: 3 NLS iters: 18 @@ -2272,16 +2202,16 @@ Fe RHS evals: actual: 21 expected: 21 Fi RHS evals: - actual: 39 - expected: 39 + actual: 21 + expected: 21 -------------------- Dense Output Fe RHS evals: actual: 21 expected: 21 Fi RHS evals: - actual: 39 - expected: 39 + actual: 21 + expected: 21 -------------------- Steps: 4 NLS iters: 24 @@ -2289,12 +2219,13 @@ Fe RHS evals: actual: 28 expected: 28 Fi RHS evals: - actual: 52 - expected: 52 + actual: 28 + expected: 28 -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2308,8 +2239,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 @@ -2317,8 +2248,8 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 3 NLS iters: 21 @@ -2326,16 +2257,16 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Dense Output Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Steps: 4 NLS iters: 28 @@ -2343,12 +2274,13 @@ Fe RHS evals: actual: 32 expected: 32 Fi RHS evals: - actual: 60 - expected: 60 + actual: 32 + expected: 32 -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2362,8 +2294,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 @@ -2371,8 +2303,8 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 3 NLS iters: 21 @@ -2380,16 +2312,16 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Dense Output Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Steps: 4 NLS iters: 28 @@ -2397,8 +2329,8 @@ Fe RHS evals: actual: 32 expected: 32 Fi RHS evals: - actual: 60 - expected: 60 + actual: 32 + expected: 32 -------------------- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_0.out new file mode 100644 index 0000000000..a5d862a551 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_0.out @@ -0,0 +1,2337 @@ + +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 + pred type = Trivial (0) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_BILLINGTON_3_3_2 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_TRBDF2_3_3_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_2_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_SDIRK_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_5_3_4 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 23 + expected: 23 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 23 + expected: 23 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_BACKWARD_EULER_1_1 + 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: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +===================== +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: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 33 + expected: 33 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 33 + expected: 33 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + + +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_1.out similarity index 92% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_0_1.out index 0632b1dd9d..b5755efd07 100644 --- 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_1.out @@ -7,49 +7,14 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Hermite - pred type = Trivial (0) + pred type = Max order (1) ======================== 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1374,29 +1300,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1413,29 +1339,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 36 + expected: 36 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 57 + expected: 57 -------------------- Dense Output Fi RHS evals: - actual: 44 - expected: 44 + actual: 58 + expected: 58 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 58 - expected: 58 + actual: 79 + expected: 79 -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1491,29 +1417,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 36 + expected: 36 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 57 + expected: 57 -------------------- Dense Output Fi RHS evals: - actual: 44 - expected: 44 + actual: 58 + expected: 58 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 58 - expected: 58 + actual: 79 + expected: 79 -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1803,29 +1729,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1842,29 +1768,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2314,41 +2245,42 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 16 - expected: 16 + actual: 23 + expected: 23 Fi RHS evals: - actual: 30 - expected: 30 + actual: 37 + expected: 37 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 24 - expected: 24 + actual: 38 + expected: 38 Fi RHS evals: - actual: 45 - expected: 45 + actual: 59 + expected: 59 -------------------- Dense Output Fe RHS evals: - actual: 26 - expected: 26 + actual: 40 + expected: 40 Fi RHS evals: - actual: 47 - expected: 47 + actual: 61 + expected: 61 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 33 - expected: 33 + actual: 54 + expected: 54 Fi RHS evals: - actual: 61 - expected: 61 + actual: 82 + expected: 82 -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2368,37 +2300,37 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 16 - expected: 16 + actual: 23 + expected: 23 Fi RHS evals: - actual: 30 - expected: 30 + actual: 37 + expected: 37 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 24 - expected: 24 + actual: 38 + expected: 38 Fi RHS evals: - actual: 45 - expected: 45 + actual: 59 + expected: 59 -------------------- Dense Output Fe RHS evals: - actual: 26 - expected: 26 + actual: 40 + expected: 40 Fi RHS evals: - actual: 47 - expected: 47 + actual: 61 + expected: 61 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 33 - expected: 33 + actual: 54 + expected: 54 Fi RHS evals: - actual: 61 - expected: 61 + actual: 82 + expected: 82 -------------------- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out new file mode 100644 index 0000000000..85b1436888 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_0.out @@ -0,0 +1,2337 @@ + +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 + pred type = Trivial (0) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_BILLINGTON_3_3_2 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_TRBDF2_3_3_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_2_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_SDIRK_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_5_3_4 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_BACKWARD_EULER_1_1 + 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: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +===================== +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: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 32 + expected: 32 +-------------------- + + +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_1.out similarity index 94% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_0_1_1.out index 2594d1cd48..dc65841178 100644 --- 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_1.out @@ -7,49 +7,14 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Lagrange - pred type = Trivial (0) + pred type = Max order (1) ======================== 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1396,7 +1322,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1435,7 +1361,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1513,7 +1439,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1825,7 +1751,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1864,7 +1790,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2348,7 +2279,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 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_0.out similarity index 89% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_-1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_-1_0.out index 11e1fc907f..a635cf9f2b 100644 --- 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_0.out @@ -14,42 +14,7 @@ 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -978,35 +904,35 @@ DIRK Table ID 100 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 4 - expected: 4 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 8 - expected: 8 + actual: 6 + expected: 6 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 12 - expected: 12 + actual: 9 + expected: 9 -------------------- Dense Output Fi RHS evals: - actual: 12 - expected: 12 + actual: 9 + expected: 9 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 16 - expected: 16 + actual: 12 + expected: 12 -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1017,35 +943,35 @@ DIRK Table ID 101 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 12 - expected: 12 + actual: 8 + expected: 8 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 18 - expected: 18 + actual: 12 + expected: 12 -------------------- Dense Output Fi RHS evals: - actual: 18 - expected: 18 + actual: 12 + expected: 12 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 24 - expected: 24 + actual: 16 + expected: 16 -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1056,35 +982,35 @@ DIRK Table ID 102 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Dense Output Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1095,35 +1021,35 @@ DIRK Table ID 103 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1134,35 +1060,35 @@ DIRK Table ID 104 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1173,35 +1099,35 @@ DIRK Table ID 105 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1212,35 +1138,35 @@ DIRK Table ID 106 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1251,35 +1177,35 @@ DIRK Table ID 107 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 20 - expected: 20 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 40 - expected: 40 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1290,35 +1216,35 @@ DIRK Table ID 108 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1329,35 +1255,35 @@ DIRK Table ID 109 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1368,35 +1294,35 @@ DIRK Table ID 110 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1407,35 +1333,35 @@ DIRK Table ID 111 Steps: 1 NLS iters: 7 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 15 + expected: 15 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Dense Output Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 57 - expected: 57 + actual: 29 + expected: 29 -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1446,35 +1372,35 @@ DIRK Table ID 112 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1485,35 +1411,35 @@ DIRK Table ID 113 Steps: 1 NLS iters: 7 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 15 + expected: 15 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Dense Output Fi RHS evals: - actual: 43 - expected: 43 + actual: 22 + expected: 22 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 57 - expected: 57 + actual: 29 + expected: 29 -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1524,35 +1450,35 @@ DIRK Table ID 114 Steps: 1 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 3 NLS iters: 9 Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Dense Output Fi RHS evals: - actual: 19 - expected: 19 + actual: 10 + expected: 10 -------------------- Steps: 4 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1563,35 +1489,35 @@ DIRK Table ID 115 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1602,35 +1528,35 @@ DIRK Table ID 116 Steps: 1 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 2 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- Steps: 3 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Dense Output Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 4 NLS iters: 16 Fi RHS evals: - actual: 33 - expected: 33 + actual: 17 + expected: 17 -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1641,35 +1567,35 @@ DIRK Table ID 117 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1680,35 +1606,35 @@ DIRK Table ID 118 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1719,35 +1645,35 @@ DIRK Table ID 119 Steps: 1 NLS iters: 5 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 Fi RHS evals: - actual: 21 - expected: 21 + actual: 11 + expected: 11 -------------------- Steps: 3 NLS iters: 15 Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Dense Output Fi RHS evals: - actual: 31 - expected: 31 + actual: 16 + expected: 16 -------------------- Steps: 4 NLS iters: 20 Fi RHS evals: - actual: 41 - expected: 41 + actual: 21 + expected: 21 -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1758,35 +1684,35 @@ DIRK Table ID 120 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1797,35 +1723,35 @@ DIRK Table ID 121 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1836,35 +1762,35 @@ DIRK Table ID 122 Steps: 1 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 13 + expected: 13 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Dense Output Fi RHS evals: - actual: 37 - expected: 37 + actual: 19 + expected: 19 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 49 - expected: 49 + actual: 25 + expected: 25 -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1875,35 +1801,35 @@ DIRK Table ID 123 Steps: 1 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- Steps: 3 NLS iters: 6 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Dense Output Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 4 NLS iters: 8 Fi RHS evals: - actual: 17 - expected: 17 + actual: 9 + expected: 9 -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1920,29 +1846,29 @@ Fi RHS evals: Steps: 2 NLS iters: 2 Fi RHS evals: - actual: 4 - expected: 4 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Dense Output Fi RHS evals: - actual: 6 - expected: 6 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 Fi RHS evals: - actual: 8 - expected: 8 + actual: 5 + expected: 5 -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -1992,31 +1918,31 @@ DIRK Table ID 126 Steps: 1 NLS iters: 1 Fi RHS evals: - actual: 3 - expected: 3 + actual: 2 + expected: 2 -------------------- Steps: 2 NLS iters: 2 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Dense Output Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- ===================== @@ -2038,8 +1964,8 @@ Fe RHS evals: actual: 2 expected: 2 Fi RHS evals: - actual: 3 - expected: 3 + actual: 2 + expected: 2 -------------------- Steps: 2 NLS iters: 2 @@ -2047,8 +1973,8 @@ Fe RHS evals: actual: 3 expected: 3 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 3 NLS iters: 3 @@ -2056,16 +1982,16 @@ Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Dense Output Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 4 NLS iters: 4 @@ -2073,12 +1999,13 @@ Fe RHS evals: actual: 5 expected: 5 Fi RHS evals: - actual: 9 - expected: 9 + actual: 5 + expected: 5 -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2092,8 +2019,8 @@ Fe RHS evals: actual: 3 expected: 3 Fi RHS evals: - actual: 5 - expected: 5 + actual: 3 + expected: 3 -------------------- Steps: 2 NLS iters: 4 @@ -2101,8 +2028,8 @@ Fe RHS evals: actual: 6 expected: 6 Fi RHS evals: - actual: 10 - expected: 10 + actual: 6 + expected: 6 -------------------- Steps: 3 NLS iters: 6 @@ -2110,16 +2037,16 @@ Fe RHS evals: actual: 9 expected: 9 Fi RHS evals: - actual: 15 - expected: 15 + actual: 9 + expected: 9 -------------------- Dense Output Fe RHS evals: actual: 9 expected: 9 Fi RHS evals: - actual: 15 - expected: 15 + actual: 9 + expected: 9 -------------------- Steps: 4 NLS iters: 8 @@ -2127,12 +2054,13 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 20 - expected: 20 + actual: 12 + expected: 12 -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2146,8 +2074,8 @@ Fe RHS evals: actual: 4 expected: 4 Fi RHS evals: - actual: 7 - expected: 7 + actual: 4 + expected: 4 -------------------- Steps: 2 NLS iters: 6 @@ -2155,8 +2083,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 14 - expected: 14 + actual: 8 + expected: 8 -------------------- Steps: 3 NLS iters: 9 @@ -2164,16 +2092,16 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 21 - expected: 21 + actual: 12 + expected: 12 -------------------- Dense Output Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 21 - expected: 21 + actual: 12 + expected: 12 -------------------- Steps: 4 NLS iters: 12 @@ -2181,12 +2109,13 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 28 - expected: 28 + actual: 16 + expected: 16 -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2200,8 +2129,8 @@ Fe RHS evals: actual: 6 expected: 6 Fi RHS evals: - actual: 11 - expected: 11 + actual: 6 + expected: 6 -------------------- Steps: 2 NLS iters: 10 @@ -2209,8 +2138,8 @@ Fe RHS evals: actual: 12 expected: 12 Fi RHS evals: - actual: 22 - expected: 22 + actual: 12 + expected: 12 -------------------- Steps: 3 NLS iters: 15 @@ -2218,16 +2147,16 @@ Fe RHS evals: actual: 18 expected: 18 Fi RHS evals: - actual: 33 - expected: 33 + actual: 18 + expected: 18 -------------------- Dense Output Fe RHS evals: actual: 18 expected: 18 Fi RHS evals: - actual: 33 - expected: 33 + actual: 18 + expected: 18 -------------------- Steps: 4 NLS iters: 20 @@ -2235,12 +2164,13 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 44 - expected: 44 + actual: 24 + expected: 24 -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2254,8 +2184,8 @@ Fe RHS evals: actual: 7 expected: 7 Fi RHS evals: - actual: 13 - expected: 13 + actual: 7 + expected: 7 -------------------- Steps: 2 NLS iters: 12 @@ -2263,8 +2193,8 @@ Fe RHS evals: actual: 14 expected: 14 Fi RHS evals: - actual: 26 - expected: 26 + actual: 14 + expected: 14 -------------------- Steps: 3 NLS iters: 18 @@ -2272,16 +2202,16 @@ Fe RHS evals: actual: 21 expected: 21 Fi RHS evals: - actual: 39 - expected: 39 + actual: 21 + expected: 21 -------------------- Dense Output Fe RHS evals: actual: 21 expected: 21 Fi RHS evals: - actual: 39 - expected: 39 + actual: 21 + expected: 21 -------------------- Steps: 4 NLS iters: 24 @@ -2289,12 +2219,13 @@ Fe RHS evals: actual: 28 expected: 28 Fi RHS evals: - actual: 52 - expected: 52 + actual: 28 + expected: 28 -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2308,8 +2239,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 @@ -2317,8 +2248,8 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 3 NLS iters: 21 @@ -2326,16 +2257,16 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Dense Output Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Steps: 4 NLS iters: 28 @@ -2343,12 +2274,13 @@ Fe RHS evals: actual: 32 expected: 32 Fi RHS evals: - actual: 60 - expected: 60 + actual: 32 + expected: 32 -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2362,8 +2294,8 @@ Fe RHS evals: actual: 8 expected: 8 Fi RHS evals: - actual: 15 - expected: 15 + actual: 8 + expected: 8 -------------------- Steps: 2 NLS iters: 14 @@ -2371,8 +2303,8 @@ Fe RHS evals: actual: 16 expected: 16 Fi RHS evals: - actual: 30 - expected: 30 + actual: 16 + expected: 16 -------------------- Steps: 3 NLS iters: 21 @@ -2380,16 +2312,16 @@ Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Dense Output Fe RHS evals: actual: 24 expected: 24 Fi RHS evals: - actual: 45 - expected: 45 + actual: 24 + expected: 24 -------------------- Steps: 4 NLS iters: 28 @@ -2397,8 +2329,8 @@ Fe RHS evals: actual: 32 expected: 32 Fi RHS evals: - actual: 60 - expected: 60 + actual: 32 + expected: 32 -------------------- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_0.out new file mode 100644 index 0000000000..17271d2d55 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_0.out @@ -0,0 +1,2337 @@ + +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 + pred type = Trivial (0) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_BILLINGTON_3_3_2 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_TRBDF2_3_3_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_2_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_SDIRK_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_5_3_4 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 23 + expected: 23 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 23 + expected: 23 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 20 + expected: 20 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_BACKWARD_EULER_1_1 + 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: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +===================== +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: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 10 + expected: 10 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 33 + expected: 33 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 26 + expected: 26 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 33 + expected: 33 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- + + +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_1.out similarity index 92% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_0_1.out index c4acdc8074..db53a029b4 100644 --- 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_1.out @@ -7,49 +7,14 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Hermite - pred type = Trivial (0) + pred type = Max order (1) ======================== 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1374,29 +1300,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1413,29 +1339,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 36 + expected: 36 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 57 + expected: 57 -------------------- Dense Output Fi RHS evals: - actual: 44 - expected: 44 + actual: 58 + expected: 58 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 58 - expected: 58 + actual: 79 + expected: 79 -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1491,29 +1417,29 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fi RHS evals: - actual: 29 - expected: 29 + actual: 36 + expected: 36 -------------------- Steps: 3 NLS iters: 21 Fi RHS evals: - actual: 43 - expected: 43 + actual: 57 + expected: 57 -------------------- Dense Output Fi RHS evals: - actual: 44 - expected: 44 + actual: 58 + expected: 58 -------------------- Steps: 4 NLS iters: 28 Fi RHS evals: - actual: 58 - expected: 58 + actual: 79 + expected: 79 -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1803,29 +1729,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1842,29 +1768,29 @@ Fi RHS evals: Steps: 2 NLS iters: 12 Fi RHS evals: - actual: 25 - expected: 25 + actual: 31 + expected: 31 -------------------- Steps: 3 NLS iters: 18 Fi RHS evals: - actual: 37 - expected: 37 + actual: 49 + expected: 49 -------------------- Dense Output Fi RHS evals: - actual: 38 - expected: 38 + actual: 50 + expected: 50 -------------------- Steps: 4 NLS iters: 24 Fi RHS evals: - actual: 50 - expected: 50 + actual: 68 + expected: 68 -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2314,41 +2245,42 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 16 - expected: 16 + actual: 23 + expected: 23 Fi RHS evals: - actual: 30 - expected: 30 + actual: 37 + expected: 37 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 24 - expected: 24 + actual: 38 + expected: 38 Fi RHS evals: - actual: 45 - expected: 45 + actual: 59 + expected: 59 -------------------- Dense Output Fe RHS evals: - actual: 26 - expected: 26 + actual: 40 + expected: 40 Fi RHS evals: - actual: 47 - expected: 47 + actual: 61 + expected: 61 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 33 - expected: 33 + actual: 54 + expected: 54 Fi RHS evals: - actual: 61 - expected: 61 + actual: 82 + expected: 82 -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2368,37 +2300,37 @@ Fi RHS evals: Steps: 2 NLS iters: 14 Fe RHS evals: - actual: 16 - expected: 16 + actual: 23 + expected: 23 Fi RHS evals: - actual: 30 - expected: 30 + actual: 37 + expected: 37 -------------------- Steps: 3 NLS iters: 21 Fe RHS evals: - actual: 24 - expected: 24 + actual: 38 + expected: 38 Fi RHS evals: - actual: 45 - expected: 45 + actual: 59 + expected: 59 -------------------- Dense Output Fe RHS evals: - actual: 26 - expected: 26 + actual: 40 + expected: 40 Fi RHS evals: - actual: 47 - expected: 47 + actual: 61 + expected: 61 -------------------- Steps: 4 NLS iters: 28 Fe RHS evals: - actual: 33 - expected: 33 + actual: 54 + expected: 54 Fi RHS evals: - actual: 61 - expected: 61 + actual: 82 + expected: 82 -------------------- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out new file mode 100644 index 0000000000..360e2985b9 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_0.out @@ -0,0 +1,2337 @@ + +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 + pred type = Trivial (0) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_BILLINGTON_3_3_2 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_TRBDF2_3_3_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_2_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_CASH_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_SDIRK_5_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_5_3_4 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_KVAERNO_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Dense Output +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 29 + expected: 29 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 + 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: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 3 +NLS iters: 9 +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: 5 + expected: 5 +-------------------- +Steps: 2 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 3 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Dense Output +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 4 +NLS iters: 16 +Fi RHS evals: + actual: 17 + expected: 17 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 + 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: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 3 +NLS iters: 15 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Dense Output +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 4 +NLS iters: 20 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Dense Output +Fi RHS evals: + actual: 19 + expected: 19 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 25 + expected: 25 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 + 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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- +Steps: 3 +NLS iters: 6 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Dense Output +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 4 +NLS iters: 8 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- + +======================== +DIRK: ARKODE_BACKWARD_EULER_1_1 + 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: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +Steps: 1 +NLS iters: 1 +Fi RHS evals: + actual: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +===================== +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: 2 + expected: 2 +-------------------- +Steps: 2 +NLS iters: 2 +Fe RHS evals: + actual: 3 + expected: 3 +Fi RHS evals: + actual: 3 + expected: 3 +-------------------- +Steps: 3 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Dense Output +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 4 +NLS iters: 4 +Fe RHS evals: + actual: 5 + expected: 5 +Fi RHS evals: + actual: 5 + expected: 5 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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: 3 + expected: 3 +-------------------- +Steps: 2 +NLS iters: 4 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 6 +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fe RHS evals: + actual: 9 + expected: 9 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Steps: 4 +NLS iters: 8 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 4 + expected: 4 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 6 + expected: 6 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 18 + expected: 18 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 32 + expected: 32 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 8 + expected: 8 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 16 + expected: 16 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 24 + expected: 24 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 32 + expected: 32 +-------------------- + + +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_1.out similarity index 94% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_1_1_1.out index 6d307f1e20..7b6e6eaa43 100644 --- 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_1.out @@ -7,49 +7,14 @@ Dahlquist ODE test problem: relative tol = 0.0001 absolute tol = 1e-06 interp type = Lagrange - pred type = Trivial (0) + pred type = Max order (1) ======================== 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1396,7 +1322,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1435,7 +1361,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1513,7 +1439,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1825,7 +1751,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1864,7 +1790,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2348,7 +2279,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 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_0.out similarity index 94% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_-1_0.out index 1fa5a0d33a..7febbb08dc 100644 --- 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_0.out @@ -14,42 +14,7 @@ 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1396,7 +1322,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1435,7 +1361,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1513,7 +1439,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1825,7 +1751,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1864,7 +1790,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2348,7 +2279,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 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_0.out similarity index 94% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_0.out index bf6e07f6c5..e10f1f5d4c 100644 --- 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_0.out @@ -14,42 +14,7 @@ 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1396,7 +1322,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1435,7 +1361,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1513,7 +1439,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1825,7 +1751,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1864,7 +1790,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2348,7 +2279,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_1.out new file mode 100644 index 0000000000..23ba95fc26 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_0_1.out @@ -0,0 +1,2337 @@ + +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 + pred type = Max order (1) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: ARKODE_BILLINGTON_3_3_2 + 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: ARKODE_TRBDF2_3_3_2 + 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: ARKODE_KVAERNO_4_2_3 + 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: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: ARKODE_CASH_5_2_4 + 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: ARKODE_CASH_5_3_4 + 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: ARKODE_SDIRK_5_3_4 + 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: ARKODE_KVAERNO_5_3_4 + 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: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: ARKODE_KVAERNO_7_4_5 + 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: 31 + expected: 31 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- +Dense Output +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: 36 + expected: 36 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- +Dense Output +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 79 + expected: 79 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: 36 + expected: 36 +-------------------- +Steps: 3 +NLS iters: 21 +Fi RHS evals: + actual: 57 + expected: 57 +-------------------- +Dense Output +Fi RHS evals: + actual: 58 + expected: 58 +-------------------- +Steps: 4 +NLS iters: 28 +Fi RHS evals: + actual: 79 + expected: 79 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 + 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: ARKODE_ESDIRK325L2SA_5_2_3 + 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: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: ARKODE_ESDIRK436L2SA_6_3_4 + 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: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: ARKODE_QESDIRK436L2SA_6_3_4 + 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: ARKODE_ESDIRK437L2SA_7_3_4 + 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: ARKODE_ESDIRK547L2SA_7_4_5 + 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: 31 + expected: 31 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- +Dense Output +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: 31 + expected: 31 +-------------------- +Steps: 3 +NLS iters: 18 +Fi RHS evals: + actual: 49 + expected: 49 +-------------------- +Dense Output +Fi RHS evals: + actual: 50 + expected: 50 +-------------------- +Steps: 4 +NLS iters: 24 +Fi RHS evals: + actual: 68 + expected: 68 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 + 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: ARKODE_BACKWARD_EULER_1_1 + 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: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: 6 + expected: 6 +-------------------- +Steps: 3 +NLS iters: 3 +Fi RHS evals: + actual: 9 + expected: 9 +-------------------- +Dense Output +Fi RHS evals: + actual: 10 + expected: 10 +-------------------- +Steps: 4 +NLS iters: 4 +Fi RHS evals: + actual: 12 + expected: 12 +-------------------- + +======================== +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + +===================== +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 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 13 + expected: 13 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Dense Output +Fe RHS evals: + actual: 19 + expected: 19 +Fi RHS evals: + actual: 34 + expected: 34 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 22 + expected: 22 +Fi RHS evals: + actual: 40 + expected: 40 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 23 + expected: 23 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 38 + expected: 38 +Fi RHS evals: + actual: 59 + expected: 59 +-------------------- +Dense Output +Fe RHS evals: + actual: 40 + expected: 40 +Fi RHS evals: + actual: 61 + expected: 61 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 54 + expected: 54 +Fi RHS evals: + actual: 82 + expected: 82 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 23 + expected: 23 +Fi RHS evals: + actual: 37 + expected: 37 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 38 + expected: 38 +Fi RHS evals: + actual: 59 + expected: 59 +-------------------- +Dense Output +Fe RHS evals: + actual: 40 + expected: 40 +Fi RHS evals: + actual: 61 + expected: 61 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 54 + expected: 54 +Fi RHS evals: + actual: 82 + expected: 82 +-------------------- + + +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_0.out similarity index 94% rename from test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1.out rename to test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_0.out index 0269da8178..6104aab893 100644 --- 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_0.out @@ -14,42 +14,7 @@ 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 +ERK: ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -84,7 +49,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ERK: ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -119,7 +84,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -154,7 +119,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ERK: ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -189,7 +154,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -224,7 +189,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ERK: ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -259,7 +224,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ERK: ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -294,7 +259,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ERK: ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -329,7 +294,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ERK: ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -364,7 +329,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -399,7 +364,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ERK: ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -434,7 +399,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ERK: ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -469,7 +434,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ERK: ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -504,7 +469,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -539,7 +504,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -574,7 +539,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -609,7 +574,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ERK: ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -644,7 +609,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ERK: ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -679,7 +644,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ERK: ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -714,7 +679,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ERK: ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -749,7 +714,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ERK: ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -784,7 +749,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ERK: ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -819,7 +784,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ERK: ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -854,7 +819,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ERK: ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -889,7 +854,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ERK: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -928,46 +893,7 @@ 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 +DIRK: ARKODE_SDIRK_2_1_2 stages: 2 order: 2 explicit 1st stage: 0 @@ -1006,7 +932,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 101 +DIRK: ARKODE_BILLINGTON_3_3_2 stages: 3 order: 2 explicit 1st stage: 0 @@ -1045,7 +971,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 102 +DIRK: ARKODE_TRBDF2_3_3_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1084,7 +1010,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 103 +DIRK: ARKODE_KVAERNO_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1123,7 +1049,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 104 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1162,7 +1088,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 105 +DIRK: ARKODE_CASH_5_2_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1201,7 +1127,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 106 +DIRK: ARKODE_CASH_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1240,7 +1166,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 107 +DIRK: ARKODE_SDIRK_5_3_4 stages: 5 order: 4 explicit 1st stage: 0 @@ -1279,7 +1205,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 108 +DIRK: ARKODE_KVAERNO_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -1318,7 +1244,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 109 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1357,7 +1283,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 110 +DIRK: ARKODE_KVAERNO_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1396,7 +1322,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 111 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1435,7 +1361,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 112 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1474,7 +1400,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 113 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -1513,7 +1439,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 114 +DIRK: ARKODE_ESDIRK324L2SA_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -1552,7 +1478,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 115 +DIRK: ARKODE_ESDIRK325L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1591,7 +1517,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 116 +DIRK: ARKODE_ESDIRK32I5L2SA_5_2_3 stages: 5 order: 3 explicit 1st stage: 1 @@ -1630,7 +1556,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 117 +DIRK: ARKODE_ESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1669,7 +1595,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 118 +DIRK: ARKODE_ESDIRK43I6L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1708,7 +1634,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 119 +DIRK: ARKODE_QESDIRK436L2SA_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -1747,7 +1673,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 120 +DIRK: ARKODE_ESDIRK437L2SA_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -1786,7 +1712,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 121 +DIRK: ARKODE_ESDIRK547L2SA_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1825,7 +1751,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 122 +DIRK: ARKODE_ESDIRK547L2SA2_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -1864,7 +1790,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 123 +DIRK: ARKODE_ARK2_DIRK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -1903,7 +1829,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 124 +DIRK: ARKODE_BACKWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 0 @@ -1942,7 +1868,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 125 +DIRK: ARKODE_IMPLICIT_MIDPOINT_1_2 stages: 1 order: 2 explicit 1st stage: 0 @@ -1981,7 +1907,7 @@ Fi RHS evals: -------------------- ======================== -DIRK Table ID 126 +DIRK: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -2078,7 +2004,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 0 +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -2132,7 +2059,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 1 +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -2186,7 +2114,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 2 +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -2240,7 +2169,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 3 +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -2294,7 +2224,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 4 +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -2348,7 +2279,8 @@ Fi RHS evals: -------------------- ======================== -IMEX Table ID 5 +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out new file mode 100644 index 0000000000..8e069fe420 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark_2_1_1.out @@ -0,0 +1,2337 @@ + +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 + pred type = Max order (1) + +======================== +Test explicit RK methods +======================== + +======================== +ERK: ARKODE_HEUN_EULER_2_1_2 + 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: ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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: ARKODE_ARK324L2SA_ERK_4_2_3 + 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: ARKODE_ZONNEVELD_5_3_4 + 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: ARKODE_ARK436L2SA_ERK_6_3_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: ARKODE_SAYFY_ABURUB_6_3_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: ARKODE_CASH_KARP_6_4_5 + 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: ARKODE_FEHLBERG_6_4_5 + 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: ARKODE_DORMAND_PRINCE_7_4_5 + 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: ARKODE_ARK548L2SA_ERK_8_4_5 + 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: ARKODE_VERNER_8_5_6 + 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: ARKODE_FEHLBERG_13_7_8 + 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: ARKODE_KNOTH_WOLKE_3_3 + 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: ARKODE_ARK437L2SA_ERK_7_3_4 + 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: ARKODE_ARK548L2SAb_ERK_8_4_5 + 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: ARKODE_ARK2_ERK_3_1_2 + 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: ARKODE_SOFRONIOU_SPALETTA_5_3_4 + 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: ARKODE_SHU_OSHER_3_2_3 + 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: ARKODE_VERNER_9_5_6 + 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: ARKODE_VERNER_10_6_7 + 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: ARKODE_VERNER_13_7_8 + 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: ARKODE_VERNER_16_8_9 + 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 +-------------------- + +======================== +ERK: ARKODE_FORWARD_EULER_1_1 + 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: ARKODE_RALSTON_EULER_2_1_2 + 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: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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 +-------------------- + +======================== +Test implicit RK methods +======================== + +======================== +DIRK: ARKODE_SDIRK_2_1_2 + 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: ARKODE_BILLINGTON_3_3_2 + 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: ARKODE_TRBDF2_3_3_2 + 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: ARKODE_KVAERNO_4_2_3 + 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: ARKODE_ARK324L2SA_DIRK_4_2_3 + 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: ARKODE_CASH_5_2_4 + 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: ARKODE_CASH_5_3_4 + 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: ARKODE_SDIRK_5_3_4 + 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: ARKODE_KVAERNO_5_3_4 + 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: ARKODE_ARK436L2SA_DIRK_6_3_4 + 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: ARKODE_KVAERNO_7_4_5 + 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: ARKODE_ARK548L2SA_DIRK_8_4_5 + 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: ARKODE_ARK437L2SA_DIRK_7_3_4 + 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: ARKODE_ARK548L2SAb_DIRK_8_4_5 + 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: ARKODE_ESDIRK324L2SA_4_2_3 + 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: ARKODE_ESDIRK325L2SA_5_2_3 + 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: ARKODE_ESDIRK32I5L2SA_5_2_3 + 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: ARKODE_ESDIRK436L2SA_6_3_4 + 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: ARKODE_ESDIRK43I6L2SA_6_3_4 + 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: ARKODE_QESDIRK436L2SA_6_3_4 + 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: ARKODE_ESDIRK437L2SA_7_3_4 + 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: ARKODE_ESDIRK547L2SA_7_4_5 + 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: ARKODE_ESDIRK547L2SA2_7_4_5 + 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: ARKODE_ARK2_DIRK_3_1_2 + 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: ARKODE_BACKWARD_EULER_1_1 + 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: ARKODE_IMPLICIT_MIDPOINT_1_2 + stages: 1 + order: 2 + explicit 1st stage: 0 + stiffly accurate: 0 + 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: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + stages: 2 + order: 2 + explicit 1st stage: 1 + stiffly accurate: 1 + first same as last: 1 +======================== +-------------------- +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 +-------------------- + +===================== +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 +-------------------- + +======================== +DIRK: ARKODE_ARK2_DIRK_3_1_2 +ERK: ARKODE_ARK2_ERK_3_1_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 +-------------------- + +======================== +DIRK: ARKODE_ARK324L2SA_DIRK_4_2_3 +ERK: ARKODE_ARK324L2SA_ERK_4_2_3 + stages: 4 + order: 3 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 3 +Fe RHS evals: + actual: 4 + expected: 4 +Fi RHS evals: + actual: 7 + expected: 7 +-------------------- +Steps: 2 +NLS iters: 6 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 14 + expected: 14 +-------------------- +Steps: 3 +NLS iters: 9 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Dense Output +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 21 + expected: 21 +-------------------- +Steps: 4 +NLS iters: 12 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 28 + expected: 28 +-------------------- + +======================== +DIRK: ARKODE_ARK436L2SA_DIRK_6_3_4 +ERK: ARKODE_ARK436L2SA_ERK_6_3_4 + stages: 6 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 5 +Fe RHS evals: + actual: 6 + expected: 6 +Fi RHS evals: + actual: 11 + expected: 11 +-------------------- +Steps: 2 +NLS iters: 10 +Fe RHS evals: + actual: 12 + expected: 12 +Fi RHS evals: + actual: 22 + expected: 22 +-------------------- +Steps: 3 +NLS iters: 15 +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Dense Output +Fe RHS evals: + actual: 18 + expected: 18 +Fi RHS evals: + actual: 33 + expected: 33 +-------------------- +Steps: 4 +NLS iters: 20 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 44 + expected: 44 +-------------------- + +======================== +DIRK: ARKODE_ARK437L2SA_DIRK_7_3_4 +ERK: ARKODE_ARK437L2SA_ERK_7_3_4 + stages: 7 + order: 4 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 6 +Fe RHS evals: + actual: 7 + expected: 7 +Fi RHS evals: + actual: 13 + expected: 13 +-------------------- +Steps: 2 +NLS iters: 12 +Fe RHS evals: + actual: 14 + expected: 14 +Fi RHS evals: + actual: 26 + expected: 26 +-------------------- +Steps: 3 +NLS iters: 18 +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Dense Output +Fe RHS evals: + actual: 21 + expected: 21 +Fi RHS evals: + actual: 39 + expected: 39 +-------------------- +Steps: 4 +NLS iters: 24 +Fe RHS evals: + actual: 28 + expected: 28 +Fi RHS evals: + actual: 52 + expected: 52 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SA_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SA_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + +======================== +DIRK: ARKODE_ARK548L2SAb_DIRK_8_4_5 +ERK: ARKODE_ARK548L2SAb_ERK_8_4_5 + stages: 8 + order: 5 + explicit 1st stage: 1 + stiffly accurate: 0 + first same as last: 0 +======================== +-------------------- +Steps: 1 +NLS iters: 7 +Fe RHS evals: + actual: 8 + expected: 8 +Fi RHS evals: + actual: 15 + expected: 15 +-------------------- +Steps: 2 +NLS iters: 14 +Fe RHS evals: + actual: 16 + expected: 16 +Fi RHS evals: + actual: 30 + expected: 30 +-------------------- +Steps: 3 +NLS iters: 21 +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Dense Output +Fe RHS evals: + actual: 24 + expected: 24 +Fi RHS evals: + actual: 45 + expected: 45 +-------------------- +Steps: 4 +NLS iters: 28 +Fe RHS evals: + actual: 32 + expected: 32 +Fi RHS evals: + actual: 60 + expected: 60 +-------------------- + + +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 index de271e6646..2de9d17dca 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp @@ -162,30 +162,6 @@ int main(int argc, char* argv[]) << "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<ARKODE_ERKTableID>(i)); @@ -194,7 +170,8 @@ int main(int argc, char* argv[]) 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 << ARKodeButcherTable_ERKIDToName(static_cast<ARKODE_ERKTableID>(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; 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 deleted file mode 100644 index d4900dcca0..0000000000 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.out +++ /dev/null @@ -1,609 +0,0 @@ - -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_-1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk_-1.out index ddbbbe232b..7943fd7e1b 100644 --- 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 @@ -11,42 +11,7 @@ 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 +ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -81,7 +46,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -116,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -151,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -186,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -221,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -256,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -291,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -326,7 +291,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -361,7 +326,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -396,7 +361,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -431,7 +396,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -466,7 +431,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -501,7 +466,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -536,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -571,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -606,7 +571,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -641,7 +606,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -676,7 +641,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -711,7 +676,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -746,7 +711,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -781,7 +746,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -816,7 +781,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -851,7 +816,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -886,7 +851,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 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 index 0a8aaf3158..e252ae486b 100644 --- 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 @@ -11,42 +11,7 @@ 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 +ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -81,7 +46,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -116,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -151,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -186,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -221,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -256,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -291,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -326,7 +291,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -361,7 +326,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -396,7 +361,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -431,7 +396,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -466,7 +431,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -501,7 +466,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -536,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -571,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -606,7 +571,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -641,7 +606,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -676,7 +641,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -711,7 +676,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -746,7 +711,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -781,7 +746,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -816,7 +781,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -851,7 +816,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -886,7 +851,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 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 index 3851797978..c62f75edf0 100644 --- 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 @@ -11,42 +11,7 @@ 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 +ARKODE_HEUN_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -81,7 +46,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 1 +ARKODE_BOGACKI_SHAMPINE_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -116,7 +81,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 2 +ARKODE_ARK324L2SA_ERK_4_2_3 stages: 4 order: 3 explicit 1st stage: 1 @@ -151,7 +116,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 3 +ARKODE_ZONNEVELD_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -186,7 +151,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 4 +ARKODE_ARK436L2SA_ERK_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -221,7 +186,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 5 +ARKODE_SAYFY_ABURUB_6_3_4 stages: 6 order: 4 explicit 1st stage: 1 @@ -256,7 +221,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 6 +ARKODE_CASH_KARP_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -291,7 +256,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 7 +ARKODE_FEHLBERG_6_4_5 stages: 6 order: 5 explicit 1st stage: 1 @@ -326,7 +291,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 8 +ARKODE_DORMAND_PRINCE_7_4_5 stages: 7 order: 5 explicit 1st stage: 1 @@ -361,7 +326,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 9 +ARKODE_ARK548L2SA_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -396,7 +361,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 10 +ARKODE_VERNER_8_5_6 stages: 8 order: 6 explicit 1st stage: 1 @@ -431,7 +396,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 11 +ARKODE_FEHLBERG_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -466,7 +431,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 12 +ARKODE_KNOTH_WOLKE_3_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -501,7 +466,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 13 +ARKODE_ARK437L2SA_ERK_7_3_4 stages: 7 order: 4 explicit 1st stage: 1 @@ -536,7 +501,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 14 +ARKODE_ARK548L2SAb_ERK_8_4_5 stages: 8 order: 5 explicit 1st stage: 1 @@ -571,7 +536,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 15 +ARKODE_ARK2_ERK_3_1_2 stages: 3 order: 2 explicit 1st stage: 1 @@ -606,7 +571,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 16 +ARKODE_SOFRONIOU_SPALETTA_5_3_4 stages: 5 order: 4 explicit 1st stage: 1 @@ -641,7 +606,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 17 +ARKODE_SHU_OSHER_3_2_3 stages: 3 order: 3 explicit 1st stage: 1 @@ -676,7 +641,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 18 +ARKODE_VERNER_9_5_6 stages: 9 order: 6 explicit 1st stage: 1 @@ -711,7 +676,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 19 +ARKODE_VERNER_10_6_7 stages: 10 order: 7 explicit 1st stage: 1 @@ -746,7 +711,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 20 +ARKODE_VERNER_13_7_8 stages: 13 order: 8 explicit 1st stage: 1 @@ -781,7 +746,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 21 +ARKODE_VERNER_16_8_9 stages: 16 order: 9 explicit 1st stage: 1 @@ -816,7 +781,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 22 +ARKODE_FORWARD_EULER_1_1 stages: 1 order: 1 explicit 1st stage: 1 @@ -851,7 +816,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 23 +ARKODE_RALSTON_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 @@ -886,7 +851,7 @@ Fe RHS evals: -------------------- ======================== -ERK Table ID 24 +ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 stages: 2 order: 2 explicit 1st stage: 1 From 3d02eef61e0c66ef0750f4c0ab617c911df62618 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Mon, 10 Jun 2024 16:45:25 -0700 Subject: [PATCH 063/137] Feature: Add a Python library for log parsing (#499) Add initial log parsing Python library --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: David J. Gardner <gardner48@llnl.gov> --- doc/developers | 1 + doc/superbuild/source/developers/index.rst | 1 + .../developers/style_guide/SourceCode.rst | 18 +++ .../source/developers/sundialsdev/index.rst | 23 ++++ scripts/sundialsdev/__init__.py | 8 ++ scripts/sundialsdev/logs.py | 120 ++++++++++++++++++ src/arkode/arkode_arkstep.c | 26 ++-- src/arkode/arkode_arkstep_nls.c | 2 +- src/arkode/arkode_erkstep.c | 8 +- src/arkode/arkode_mristep.c | 20 +-- src/arkode/arkode_mristep_nls.c | 2 +- src/arkode/arkode_relaxation.c | 2 +- src/cvode/cvode.c | 2 +- src/cvodes/cvodes.c | 8 +- src/kinsol/kinsol.c | 8 +- 15 files changed, 211 insertions(+), 38 deletions(-) create mode 120000 doc/developers create mode 100644 doc/superbuild/source/developers/sundialsdev/index.rst create mode 100644 scripts/sundialsdev/__init__.py create mode 100644 scripts/sundialsdev/logs.py diff --git a/doc/developers b/doc/developers new file mode 120000 index 0000000000..9b2ae4b9e1 --- /dev/null +++ b/doc/developers @@ -0,0 +1 @@ +superbuild/source/developers \ No newline at end of file diff --git a/doc/superbuild/source/developers/index.rst b/doc/superbuild/source/developers/index.rst index f88f57bb12..b0737c8792 100644 --- a/doc/superbuild/source/developers/index.rst +++ b/doc/superbuild/source/developers/index.rst @@ -34,6 +34,7 @@ meant for SUNDIALS developers. pull_requests/index releases/index packages/index + sundialsdev/index appendix/index .. only:: html diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index dbf932411c..8cef6cd32e 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -338,6 +338,24 @@ Coding Conventions and Rules x;`` to ``return(x);``. Note, however, lots of older SUNDIALS source code uses ``return(x);``. +#. ``SUNLogger`` statements must be in the format: + + .. code-block:: c + + [log level][rank][scope][label] key1 = value, key2 = value + + or if the payload (the part after the label) is a vector/array: + + .. code-block:: c + + [log level][rank][scope][label] key(:) = + value1 + value2 + + Note that the ``(:)`` is needed for the ``scripts/sundialsdev/logs.py`` Python + utility to understand that the payload is an array. + + .. code-block:: c .. _Style.Formatting: diff --git a/doc/superbuild/source/developers/sundialsdev/index.rst b/doc/superbuild/source/developers/sundialsdev/index.rst new file mode 100644 index 0000000000..75dfee59b1 --- /dev/null +++ b/doc/superbuild/source/developers/sundialsdev/index.rst @@ -0,0 +1,23 @@ +.. + ----------------------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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_DEV: + +sundialsdev Python Library +========================== + +This is a Python library of utilities SUNDIALS developer may find useful. +Right now it consists of the following modules: + +- ``logs``: this module has functions for parsing logs produced by `SUNLogger`. + diff --git a/scripts/sundialsdev/__init__.py b/scripts/sundialsdev/__init__.py new file mode 100644 index 0000000000..87ae34c366 --- /dev/null +++ b/scripts/sundialsdev/__init__.py @@ -0,0 +1,8 @@ + +""" +This is a Python library of utilities SUNDIALS developer may find useful. +Right now it consists of the following modules: + +- `logs`: this module has functions for parsing logs produced by `SUNLogger`. + +""" diff --git a/scripts/sundialsdev/logs.py b/scripts/sundialsdev/logs.py new file mode 100644 index 0000000000..7965555d1c --- /dev/null +++ b/scripts/sundialsdev/logs.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +# ----------------------------------------------------------------------------- +# Programmer(s): Cody Balos @ LLNL +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 of Python functions that may be useful to SUNDIALS developers writing +# scripts to parse logs produced by SUNLogger. +# ----------------------------------------------------------------------------- + +import re +import numpy as np + + +def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): + """ + This function parses the payload of in a SUNDIALS log file line + into a dictionary. The payload of a SUNDIALS log file line + is the part after all the [ ] brackets. + """ + kvpstrs = payload.split(",") + kvp_dict = {} + for kvpstr in kvpstrs: + kvp = kvpstr.split("=") + if len(kvp) == 1: + kvp_dict[kvp[0].strip()] = "" + else: + key, value = kvp + values = [] + if array_indicator in key: + for line in all_lines[line_number + 1 :]: + if line.startswith("["): + break + values.append(np.double(line)) + kvp_dict[key.strip()] = values + else: + kvp_dict[key.strip()] = value.strip() + return kvp_dict + + +def parse_logfile_line(line, line_number, all_lines): + """ + This function takes a line from a SUNDIALS log file and parses it into a dictionary. + A log file line has the form: + [loglvl][rank][scope][label] key1 = value, key2 = value + Log file payloads can be multiline if they are an array/vector with one value per line. + I.e. + [loglvl][rank][scope][label] y(:) + y_1 + y_2 + ... + """ + pattern = re.compile(r"\[(\w+)\]\[(rank \d+)\]\[(.*)\]\[(.*)\](.*)") + matches = pattern.findall(line) + line_dict = {} + if matches: + line_dict["loglvl"] = matches[0][0] + line_dict["rank"] = matches[0][1] + line_dict["scope"] = matches[0][2] + line_dict["label"] = matches[0][3] + line_dict["payload"] = parse_logfile_payload( + matches[0][4], line_number, all_lines + ) + return line_dict + + +def log_file_to_list(filename, step_scope_txt): + """ + This function takes a debug log file from a SUNDIALS log file and creates a list where + each list element represents an integrator step attempt. + + E.g., + [ + [ + { + "loglvl": "DEBUG", + "rank": "rank 0", + "scope": "<step_scope_txt>", + "label": "enter-step-attempt-loop", + "payload": {"step": "0", "h": "1e-06", "q": "1", "t_n": "0"}, + }, ... + ], ... + ] + """ + with open(filename, "r") as logfile: + log = [] + lines_for_this_step = None + all_lines = logfile.readlines() + for line_number, line in enumerate(all_lines): + line_dict = parse_logfile_line(line.rstrip(), line_number, all_lines) + if not line_dict: + continue + if ( + line_dict["scope"] == step_scope_txt + and line_dict["label"] == "enter-step-attempt-loop" + ): + if lines_for_this_step is None: + lines_for_this_step = [line_dict] + else: + log.append(lines_for_this_step) + lines_for_this_step = [line_dict] + else: + lines_for_this_step.append(line_dict) + return log + + +def cvode_debug_file_to_list(filename): + """ + This function takes a debug log file from CVODE and creates a list where + each list entry is a step attempt. See log_file_to_list. + """ + return log_file_to_list(filename, "CVODE::cvStep") diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index f51f5a732f..5f91285edb 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1838,20 +1838,20 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "explicit stage", - "z[%i] =", 0); + "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); + "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); + "Fe_%i(:) =", 0); N_VPrintFile(step_mem->Fe[0], ARK_LOGGER->debug_fp); } #endif @@ -1919,7 +1919,8 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "predictor", "zpred =", ""); + "ARKODE::arkStep_TakeStep_Z", "predictor", + "zpred(:) =", ""); N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); #endif @@ -1929,7 +1930,8 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "rhs data", "sdata =", ""); + "ARKODE::arkStep_TakeStep_Z", "rhs data", + "sdata(:) =", ""); N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); #endif @@ -1944,7 +1946,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "implicit stage", - "z[%i] =", is); + "z_%i(:) =", is); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif @@ -1968,7 +1970,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "explicit stage", - "z[%i] =", is); + "z_%i(:) =", is); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif } @@ -2013,7 +2015,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "implicit RHS", - "Fi[%i] =", is); + "Fi_%i(:) =", is); N_VPrintFile(step_mem->Fi[is], ARK_LOGGER->debug_fp); #endif @@ -2031,7 +2033,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "explicit RHS", - "Fe[%i] =", is); + "Fe_%i(:) =", is); N_VPrintFile(step_mem->Fe[is], ARK_LOGGER->debug_fp); #endif @@ -2050,7 +2052,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "M^{-1} implicit RHS", - "Fi[%i] =", is); + "Fi_%i(:) =", is); N_VPrintFile(step_mem->Fi[is], ARK_LOGGER->debug_fp); #endif if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } @@ -2062,7 +2064,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", "M^{-1} explicit RHS", - "Fe[%i] =", is); + "Fe_%i(:) =", is); N_VPrintFile(step_mem->Fe[is], ARK_LOGGER->debug_fp); #endif if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } @@ -2084,7 +2086,7 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", - "updated solution", "ycur =", ""); + "updated solution", "ycur(:) =", ""); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index 5f1811b156..939a82ad02 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -425,7 +425,7 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_Nls", - "correction", "zcor =", ""); + "correction", "zcor(:) =", ""); N_VPrintFile(step_mem->zcor, ARK_LOGGER->debug_fp); #endif diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index bb244a80a9..5cc09d2390 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -635,10 +635,10 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "stage", "z[0] =", ""); + "stage", "z_0(:) =", ""); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "stage RHS", "F[0] =", ""); + "stage RHS", "F_0(:) =", ""); N_VPrintFile(step_mem->F[0], ARK_LOGGER->debug_fp); #endif @@ -704,7 +704,7 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::erkStep_TakeStep", "stage RHS", "F[%i] =", is); + "ARKODE::erkStep_TakeStep", "stage RHS", "F_%i(:) =", is); N_VPrintFile(step_mem->F[is], ARK_LOGGER->debug_fp); #endif @@ -716,7 +716,7 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "updated solution", "ycur =", ""); + "updated solution", "ycur(:) =", ""); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index b4c727c506..3e856a724a 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1497,19 +1497,19 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow stage", "z[0] =", ""); + "slow stage", "z_0(:) =", ""); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); if (step_mem->explicit_rhs) { SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow explicit RHS", "Fse[0] =", ""); + "slow explicit RHS", "Fse_0(:) =", ""); N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); } if (step_mem->implicit_rhs) { SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow implicit RHS", "Fsi[0] =", ""); + "slow implicit RHS", "Fsi_0(:) =", ""); N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); } #endif @@ -1555,7 +1555,7 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow stage", "z[%i] =", is); + "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif @@ -1593,7 +1593,7 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "slow explicit RHS", - "Fse[%i] =", is); + "Fse_%i(:) =", is); N_VPrintFile(step_mem->Fse[step_mem->stage_map[is]], ARK_LOGGER->debug_fp); #endif @@ -1623,7 +1623,7 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "slow implicit RHS", - "Fsi[%i] =", is); + "Fsi_%i(:) =", is); N_VPrintFile(step_mem->Fsi[step_mem->stage_map[is]], ARK_LOGGER->debug_fp); #endif @@ -1633,7 +1633,7 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "updated solution", "ycur =", ""); + "updated solution", "ycur(:) =", ""); N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif @@ -2161,7 +2161,7 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_StageDIRKNoFast", "predictor", - "zpred =", ""); + "zpred(:) =", ""); N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); #endif @@ -2177,7 +2177,7 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_StageDIRKNoFast", "rhs data", - "sdata =", ""); + "sdata(:) =", ""); N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); #endif @@ -2316,7 +2316,7 @@ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, { SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_ComputeInnerForcing", "forcing", - "forcing[%i] =", k); + "forcing_%i(:) =", k); N_VPrintFile(step_mem->stepper->forcing[k], ARK_LOGGER->debug_fp); } #endif diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index 39119403ad..882eedad75 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -328,7 +328,7 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_Nls", - "correction", "zcor =", ""); + "correction", "zcor(:) =", ""); N_VPrintFile(step_mem->zcor, ARK_LOGGER->debug_fp); #endif diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index e2307448b9..c911077580 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -357,7 +357,7 @@ static int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkRelaxSolve", - "compute delta y", "delta_y =", ""); + "compute delta y", "delta_y(:) =", ""); N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); #endif diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 368db3e53f..0558991e85 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -2704,7 +2704,7 @@ static void cvPredict(CVodeMem cv_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvPredict", - "return", "predictor =", ""); + "return", "zn_0(:) =", ""); N_VPrintFile(cv_mem->cv_zn[0], CV_LOGGER->debug_fp); #endif } diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index ad60c4e9e4..55399d7349 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -6531,7 +6531,7 @@ static void cvPredict(CVodeMem cv_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "forward", "predictor =", ""); + "forward", "zn_0(:) =", ""); N_VPrintFile(cv_mem->cv_zn[0], CV_LOGGER->debug_fp); #endif @@ -6548,7 +6548,7 @@ static void cvPredict(CVodeMem cv_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "quad", "predictor =", ""); + "quad", "znQ_0(:) =", ""); N_VPrintFile(cv_mem->cv_znQ[0], CV_LOGGER->debug_fp); #endif } @@ -6566,7 +6566,7 @@ static void cvPredict(CVodeMem cv_mem) for (i = 0; i < cv_mem->cv_Ns; i++) { SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "sensi", " i = %d, predictor_i = ", i); + "sensi", " i = %d, znS_i(:) = ", i); N_VPrintFile(cv_mem->cv_znS[0][i], CV_LOGGER->debug_fp); } #endif @@ -6587,7 +6587,7 @@ static void cvPredict(CVodeMem cv_mem) for (i = 0; i < cv_mem->cv_Ns; i++) { SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "quad-sensi", " i = %d, predictor_i = ", i); + "quad-sensi", " i = %d, znQS_i(:) = ", i); N_VPrintFile(cv_mem->cv_znQS[0][i], CV_LOGGER->debug_fp); } #endif diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index 344451d5c0..acfe65fd9b 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -2842,7 +2842,7 @@ static int KINFP(KINMem kin_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", "begin", - "%s", "u_0:"); + "%s", "u_0(:) ="); N_VPrintFile(kin_mem->kin_uu, KIN_LOGGER->debug_fp); #endif @@ -2862,7 +2862,7 @@ static int KINFP(KINMem kin_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", "while-loop-before-compute-new", - "G_%ld:", kin_mem->kin_nni - 1); + "G_%ld(:) =", kin_mem->kin_nni - 1); N_VPrintFile(kin_mem->kin_fval, KIN_LOGGER->debug_fp); #endif @@ -2917,8 +2917,8 @@ static int KINFP(KINMem kin_mem) #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", - "while-loop-after-compute-new", "u_%ld:\n", - kin_mem->kin_nni); + "while-loop-after-compute-new", + "u_%ld(:) =", kin_mem->kin_nni); N_VPrintFile(kin_mem->kin_unew, KIN_LOGGER->debug_fp); #endif From 293e27cfe0140254e8301534a0d1eb797bb24438 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 12 Jun 2024 16:15:25 -0700 Subject: [PATCH 064/137] Feature: Fortran interface for 32-bit sunindextype (#447) Update the the SWIG generation and CMake build system to support Fortran interfaces for 32-bit or 64-bit sunindextype. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- .github/workflows/check-clang-format.yml | 9 +- .github/workflows/check-swig.yml | 49 + CHANGELOG.md | 2 + cmake/SundialsBuildOptionsPre.cmake | 5 - cmake/SundialsExampleOptions.cmake | 11 +- cmake/macros/SundialsAddLibrary.cmake | 1 + cmake/tpl/FindKLU.cmake | 4 + doc/shared/RecentChanges.rst | 2 + doc/shared/sundials/Fortran.rst | 9 +- .../developers/getting_started/Checklist.rst | 28 +- .../source/developers/releases/Checklist.rst | 1 + .../developers/style_guide/SourceCode.rst | 25 + examples/arkode/F2003_custom/CMakeLists.txt | 26 +- examples/arkode/F2003_parallel/CMakeLists.txt | 17 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 136 +- examples/arkode/F2003_serial/CMakeLists.txt | 55 +- .../F2003_serial/ark_analytic_f2003.f90 | 12 +- .../F2003_serial/test_ark_butcher_f2003.f90 | 12 +- examples/cvode/CMakeLists.txt | 4 +- examples/cvode/F2003_parallel/CMakeLists.txt | 2 +- .../F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 17 +- .../F2003_parallel/cv_diag_kry_f2003.f90 | 19 +- .../F2003_parallel/cv_diag_kry_f2003.out | 56 +- .../F2003_parallel/cv_diag_non_p_f2003.f90 | 14 +- .../F2003_parallel/cv_diag_non_p_f2003.out | 2 +- examples/cvode/F2003_serial/CMakeLists.txt | 28 +- .../F2003_serial/cv_advdiff_bnd_f2003.f90 | 28 +- examples/cvodes/F2003_serial/CMakeLists.txt | 5 +- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 21 +- .../F2003_serial/cvs_analytic_fp_f2003.f90 | 13 +- examples/ida/F2003_openmp/CMakeLists.txt | 12 +- examples/ida/F2003_parallel/CMakeLists.txt | 3 +- .../ida_heat2D_kry_bbd_f2003.f90 | 29 +- .../ida_heat2D_kry_bbd_f2003.out | 68 + examples/ida/F2003_serial/CMakeLists.txt | 8 +- .../ida/F2003_serial/idaRoberts_dns_f2003.f90 | 14 +- examples/idas/F2003_serial/CMakeLists.txt | 10 +- .../idasAkzoNob_ASAi_dns_f2003.f90 | 15 +- examples/kinsol/CMakeLists.txt | 4 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 2 +- .../F2003_parallel/kin_diagon_kry_f2003.f90 | 15 +- .../F2003_parallel/kin_diagon_kry_f2003.out | 48 + examples/kinsol/F2003_serial/CMakeLists.txt | 16 +- .../F2003_serial/kinDiagon_kry_f2003.f90 | 12 +- .../C_openmp/test_fnvector_openmp_mod.f90 | 32 +- .../test_fnvector_manyvector_mod.f90 | 33 +- .../test_fnvector_mpimanyvector_mod.f90 | 69 +- .../mpiplusx/test_fnvector_mpiplusx_mod.f90 | 12 +- .../parallel/test_fnvector_parallel_mod.f90 | 54 +- .../pthreads/test_fnvector_pthreads_mod.f90 | 33 +- .../serial/test_fnvector_serial_mod.f90 | 35 +- examples/nvector/test_nvector.f90 | 20 +- .../band/test_fsunlinsol_band_mod.f90 | 30 +- .../dense/test_fsunlinsol_dense_mod.f90 | 22 +- .../sunlinsol/klu/test_fsunlinsol_klu_mod.f90 | 4 +- .../test_fsunlinsol_lapackdense_mod.f90 | 6 +- .../serial/test_fsunlinsol_pcg_mod_serial.f90 | 8 +- .../test_fsunlinsol_spbcgs_mod_serial.f90 | 8 +- .../test_fsunlinsol_spfgmr_mod_serial.f90 | 12 +- .../test_fsunlinsol_spgmr_mod_serial.f90 | 30 +- .../test_fsunlinsol_sptfqmr_mod_serial.f90 | 8 +- .../band/test_fsunmatrix_band_mod.f90 | 20 +- .../dense/test_fsunmatrix_dense_mod.f90 | 6 +- .../sparse/test_fsunmatrix_sparse_mod.f90 | 39 +- .../test_fsunnonlinsol_fixedpoint_mod.f90 | 2 +- .../newton/test_fsunnonlinsol_newton_mod.f90 | 5 +- .../templates/cmakelists_openmp_F2003_ex.in | 5 + .../templates/cmakelists_parallel_F2003_ex.in | 5 + .../templates/cmakelists_serial_F2003_ex.in | 7 + .../templates/makefile_openmp_F2003_ex.in | 2 +- .../templates/makefile_parallel_F2003_ex.in | 2 +- .../templates/makefile_serial_F2003_ex.in | 2 +- examples/utilities/test_utilities.f90 | 10 + src/arkode/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../farkode_arkstep_mod.c | 0 .../farkode_arkstep_mod.f90 | 0 .../farkode_erkstep_mod.c | 0 .../farkode_erkstep_mod.f90 | 0 src/arkode/fmod_int32/farkode_mod.c | 3246 ++++++++ src/arkode/fmod_int32/farkode_mod.f90 | 5769 +++++++++++++ src/arkode/fmod_int32/farkode_mristep_mod.c | 2114 +++++ src/arkode/fmod_int32/farkode_mristep_mod.f90 | 3516 ++++++++ .../farkode_sprkstep_mod.c | 0 .../farkode_sprkstep_mod.f90 | 0 src/arkode/fmod_int64/CMakeLists.txt | 59 + src/arkode/fmod_int64/farkode_arkstep_mod.c | 2660 ++++++ src/arkode/fmod_int64/farkode_arkstep_mod.f90 | 4625 +++++++++++ src/arkode/fmod_int64/farkode_erkstep_mod.c | 1563 ++++ src/arkode/fmod_int64/farkode_erkstep_mod.f90 | 2566 ++++++ src/arkode/{fmod => fmod_int64}/farkode_mod.c | 0 .../{fmod => fmod_int64}/farkode_mod.f90 | 0 .../farkode_mristep_mod.c | 0 .../farkode_mristep_mod.f90 | 0 src/arkode/fmod_int64/farkode_sprkstep_mod.c | 767 ++ .../fmod_int64/farkode_sprkstep_mod.f90 | 1081 +++ src/cvode/CMakeLists.txt | 2 +- src/cvode/{fmod => fmod_int32}/CMakeLists.txt | 0 src/cvode/fmod_int32/fcvode_mod.c | 2020 +++++ src/cvode/fmod_int32/fcvode_mod.f90 | 3436 ++++++++ src/cvode/fmod_int64/CMakeLists.txt | 47 + src/cvode/{fmod => fmod_int64}/fcvode_mod.c | 0 src/cvode/{fmod => fmod_int64}/fcvode_mod.f90 | 0 src/cvodes/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 src/cvodes/fmod_int32/fcvodes_mod.c | 4040 ++++++++++ src/cvodes/fmod_int32/fcvodes_mod.f90 | 7142 +++++++++++++++++ src/cvodes/fmod_int64/CMakeLists.txt | 46 + src/cvodes/{fmod => fmod_int64}/fcvodes_mod.c | 0 .../{fmod => fmod_int64}/fcvodes_mod.f90 | 0 src/ida/CMakeLists.txt | 2 +- src/ida/{fmod => fmod_int32}/CMakeLists.txt | 0 src/ida/fmod_int32/fida_mod.c | 1784 ++++ src/ida/fmod_int32/fida_mod.f90 | 2992 +++++++ src/ida/fmod_int64/CMakeLists.txt | 47 + src/ida/{fmod => fmod_int64}/fida_mod.c | 0 src/ida/{fmod => fmod_int64}/fida_mod.f90 | 0 src/idas/CMakeLists.txt | 2 +- src/idas/{fmod => fmod_int32}/CMakeLists.txt | 0 src/idas/fmod_int32/fidas_mod.c | 3879 +++++++++ src/idas/fmod_int32/fidas_mod.f90 | 6831 ++++++++++++++++ src/idas/fmod_int64/CMakeLists.txt | 45 + src/idas/{fmod => fmod_int64}/fidas_mod.c | 0 src/idas/{fmod => fmod_int64}/fidas_mod.f90 | 0 src/kinsol/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 src/kinsol/fmod_int32/fkinsol_mod.c | 1092 +++ src/kinsol/fmod_int32/fkinsol_mod.f90 | 1696 ++++ src/kinsol/fmod_int64/CMakeLists.txt | 45 + src/kinsol/{fmod => fmod_int64}/fkinsol_mod.c | 0 .../{fmod => fmod_int64}/fkinsol_mod.f90 | 0 src/nvector/manyvector/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fnvector_manyvector_mod.c | 1007 +++ .../fmod_int32/fnvector_manyvector_mod.f90 | 1557 ++++ .../fmod_int32/fnvector_mpimanyvector_mod.c | 1167 +++ .../fmod_int32/fnvector_mpimanyvector_mod.f90 | 1817 +++++ .../manyvector/fmod_int64/CMakeLists.txt | 61 + .../fnvector_manyvector_mod.c | 0 .../fnvector_manyvector_mod.f90 | 12 + .../fnvector_mpimanyvector_mod.c | 0 .../fnvector_mpimanyvector_mod.f90 | 12 + src/nvector/mpiplusx/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fnvector_mpiplusx_mod.c | 327 + .../fmod_int32/fnvector_mpiplusx_mod.f90 | 241 + .../mpiplusx/fmod_int64/CMakeLists.txt | 43 + .../fnvector_mpiplusx_mod.c | 0 .../fnvector_mpiplusx_mod.f90 | 0 src/nvector/openmp/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../openmp/fmod_int32/fnvector_openmp_mod.c | 961 +++ .../openmp/fmod_int32/fnvector_openmp_mod.f90 | 1461 ++++ src/nvector/openmp/fmod_int64/CMakeLists.txt | 31 + .../fnvector_openmp_mod.c | 0 .../fnvector_openmp_mod.f90 | 0 src/nvector/parallel/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fnvector_parallel_mod.c | 1173 +++ .../fmod_int32/fnvector_parallel_mod.f90 | 1781 ++++ .../parallel/fmod_int64/CMakeLists.txt | 49 + .../fnvector_parallel_mod.c | 0 .../fnvector_parallel_mod.f90 | 0 src/nvector/pthreads/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fnvector_pthreads_mod.c | 961 +++ .../fmod_int32/fnvector_pthreads_mod.f90 | 1461 ++++ .../pthreads/fmod_int64/CMakeLists.txt | 33 + .../fnvector_pthreads_mod.c | 0 .../fnvector_pthreads_mod.f90 | 0 src/nvector/serial/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../serial/fmod_int32/fnvector_serial_mod.c | 955 +++ .../serial/fmod_int32/fnvector_serial_mod.f90 | 1449 ++++ src/nvector/serial/fmod_int64/CMakeLists.txt | 31 + .../fnvector_serial_mod.c | 0 .../fnvector_serial_mod.f90 | 0 src/nvector/sycl/nvector_sycl.cpp | 2 +- src/sunadaptcontroller/imexgus/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fsunadaptcontroller_imexgus_mod.c | 0 .../fsunadaptcontroller_imexgus_mod.f90 | 0 .../imexgus/fmod_int64/CMakeLists.txt | 26 + .../fsunadaptcontroller_imexgus_mod.c | 359 + .../fsunadaptcontroller_imexgus_mod.f90 | 313 + .../soderlind/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fsunadaptcontroller_soderlind_mod.c | 0 .../fsunadaptcontroller_soderlind_mod.f90 | 0 .../soderlind/fmod_int64/CMakeLists.txt | 26 + .../fsunadaptcontroller_soderlind_mod.c | 501 ++ .../fsunadaptcontroller_soderlind_mod.f90 | 577 ++ src/sundials/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 src/sundials/fmod_int32/fsundials_core_mod.c | 2651 ++++++ .../fmod_int32/fsundials_core_mod.f90 | 4789 +++++++++++ src/sundials/fmod_int64/CMakeLists.txt | 27 + .../{fmod => fmod_int64}/fsundials_core_mod.c | 4 - .../fsundials_core_mod.f90 | 0 src/sunlinsol/band/CMakeLists.txt | 2 +- .../band/{fmod => fmod_int32}/CMakeLists.txt | 0 .../band/fmod_int32/fsunlinsol_band_mod.c | 337 + .../band/fmod_int32/fsunlinsol_band_mod.f90 | 271 + src/sunlinsol/band/fmod_int64/CMakeLists.txt | 33 + .../fsunlinsol_band_mod.c | 0 .../fsunlinsol_band_mod.f90 | 0 src/sunlinsol/dense/CMakeLists.txt | 2 +- .../dense/{fmod => fmod_int32}/CMakeLists.txt | 0 .../dense/fmod_int32/fsunlinsol_dense_mod.c | 337 + .../dense/fmod_int32/fsunlinsol_dense_mod.f90 | 271 + src/sunlinsol/dense/fmod_int64/CMakeLists.txt | 32 + .../fsunlinsol_dense_mod.c | 0 .../fsunlinsol_dense_mod.f90 | 0 src/sunlinsol/klu/CMakeLists.txt | 2 +- .../klu/{fmod => fmod_int32}/CMakeLists.txt | 0 .../klu/fmod_int32/fsunlinsol_klu_mod.c | 429 + .../klu/fmod_int32/fsunlinsol_klu_mod.f90 | 420 + src/sunlinsol/klu/fmod_int64/CMakeLists.txt | 33 + .../{fmod => fmod_int64}/fsunlinsol_klu_mod.c | 0 .../fsunlinsol_klu_mod.f90 | 0 src/sunlinsol/lapackdense/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fsunlinsol_lapackdense_mod.c | 337 + .../fmod_int32/fsunlinsol_lapackdense_mod.f90 | 271 + .../lapackdense/fmod_int64/CMakeLists.txt | 33 + .../fsunlinsol_lapackdense_mod.c | 0 .../fsunlinsol_lapackdense_mod.f90 | 0 src/sunlinsol/pcg/CMakeLists.txt | 2 +- .../pcg/{fmod => fmod_int32}/CMakeLists.txt | 0 .../pcg/fmod_int32/fsunlinsol_pcg_mod.c | 467 ++ .../pcg/fmod_int32/fsunlinsol_pcg_mod.f90 | 514 ++ src/sunlinsol/pcg/fmod_int64/CMakeLists.txt | 31 + .../{fmod => fmod_int64}/fsunlinsol_pcg_mod.c | 0 .../fsunlinsol_pcg_mod.f90 | 0 src/sunlinsol/spbcgs/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c | 467 ++ .../fmod_int32/fsunlinsol_spbcgs_mod.f90 | 514 ++ .../spbcgs/fmod_int64/CMakeLists.txt | 31 + .../fsunlinsol_spbcgs_mod.c | 0 .../fsunlinsol_spbcgs_mod.f90 | 0 src/sunlinsol/spfgmr/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c | 481 ++ .../fmod_int32/fsunlinsol_spfgmr_mod.f90 | 541 ++ .../spfgmr/fmod_int64/CMakeLists.txt | 31 + .../fsunlinsol_spfgmr_mod.c | 0 .../fsunlinsol_spfgmr_mod.f90 | 0 src/sunlinsol/spgmr/CMakeLists.txt | 2 +- .../spgmr/{fmod => fmod_int32}/CMakeLists.txt | 0 .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.c | 481 ++ .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 | 541 ++ src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt | 31 + .../fsunlinsol_spgmr_mod.c | 0 .../fsunlinsol_spgmr_mod.f90 | 0 src/sunlinsol/sptfqmr/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fmod_int32/fsunlinsol_sptfqmr_mod.c | 467 ++ .../fmod_int32/fsunlinsol_sptfqmr_mod.f90 | 514 ++ .../sptfqmr/fmod_int64/CMakeLists.txt | 31 + .../fsunlinsol_sptfqmr_mod.c | 0 .../fsunlinsol_sptfqmr_mod.f90 | 0 src/sunmatrix/band/CMakeLists.txt | 2 +- .../band/{fmod => fmod_int32}/CMakeLists.txt | 0 .../band/fmod_int32/fsunmatrix_band_mod.c | 500 ++ .../band/fmod_int32/fsunmatrix_band_mod.f90 | 595 ++ src/sunmatrix/band/fmod_int64/CMakeLists.txt | 31 + .../fsunmatrix_band_mod.c | 4 +- .../fsunmatrix_band_mod.f90 | 24 +- src/sunmatrix/dense/CMakeLists.txt | 2 +- .../dense/{fmod => fmod_int32}/CMakeLists.txt | 0 .../dense/fmod_int32/fsunmatrix_dense_mod.c | 430 + .../dense/fmod_int32/fsunmatrix_dense_mod.f90 | 463 ++ src/sunmatrix/dense/fmod_int64/CMakeLists.txt | 31 + .../fsunmatrix_dense_mod.c | 4 +- .../fsunmatrix_dense_mod.f90 | 22 +- src/sunmatrix/sparse/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../sparse/fmod_int32/fsunmatrix_sparse_mod.c | 565 ++ .../fmod_int32/fsunmatrix_sparse_mod.f90 | 670 ++ .../sparse/fmod_int64/CMakeLists.txt | 31 + .../fsunmatrix_sparse_mod.c | 30 +- .../fsunmatrix_sparse_mod.f90 | 22 +- src/sunnonlinsol/fixedpoint/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fsunnonlinsol_fixedpoint_mod.c | 0 .../fsunnonlinsol_fixedpoint_mod.f90 | 0 .../fixedpoint/fmod_int64/CMakeLists.txt | 32 + .../fmod_int64/fsunnonlinsol_fixedpoint_mod.c | 419 + .../fsunnonlinsol_fixedpoint_mod.f90 | 425 + src/sunnonlinsol/newton/CMakeLists.txt | 2 +- .../{fmod => fmod_int32}/CMakeLists.txt | 0 .../fsunnonlinsol_newton_mod.c | 0 .../fsunnonlinsol_newton_mod.f90 | 0 .../newton/fmod_int64/CMakeLists.txt | 32 + .../fmod_int64/fsunnonlinsol_newton_mod.c | 429 + .../fmod_int64/fsunnonlinsol_newton_mod.f90 | 443 + swig/Makefile | 85 +- swig/README.md | 4 +- swig/nvector/fnvector_manyvector_mod.i | 12 + swig/nvector/fnvector_mpimanyvector_mod.i | 12 + swig/sundials/fsundials.i | 7 +- swig/sundials/fsundials_types.i | 10 +- swig/sunmatrix/fsunmatrix_band_mod.i | 28 +- swig/sunmatrix/fsunmatrix_dense_mod.i | 26 +- swig/sunmatrix/fsunmatrix_sparse_mod.i | 52 +- test/answers | 2 +- test/env/default.sh | 2 +- test/env/docker.sh | 2 +- test/env/lassen.sh | 2 +- test/env/quartz.sh | 2 +- test/env/summit.sh | 139 - 312 files changed, 103132 insertions(+), 822 deletions(-) create mode 100644 .github/workflows/check-swig.yml create mode 100644 examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out create mode 100644 examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out rename src/arkode/{fmod => fmod_int32}/CMakeLists.txt (100%) rename src/arkode/{fmod => fmod_int32}/farkode_arkstep_mod.c (100%) rename src/arkode/{fmod => fmod_int32}/farkode_arkstep_mod.f90 (100%) rename src/arkode/{fmod => fmod_int32}/farkode_erkstep_mod.c (100%) rename src/arkode/{fmod => fmod_int32}/farkode_erkstep_mod.f90 (100%) create mode 100644 src/arkode/fmod_int32/farkode_mod.c create mode 100644 src/arkode/fmod_int32/farkode_mod.f90 create mode 100644 src/arkode/fmod_int32/farkode_mristep_mod.c create mode 100644 src/arkode/fmod_int32/farkode_mristep_mod.f90 rename src/arkode/{fmod => fmod_int32}/farkode_sprkstep_mod.c (100%) rename src/arkode/{fmod => fmod_int32}/farkode_sprkstep_mod.f90 (100%) create mode 100644 src/arkode/fmod_int64/CMakeLists.txt create mode 100644 src/arkode/fmod_int64/farkode_arkstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_arkstep_mod.f90 create mode 100644 src/arkode/fmod_int64/farkode_erkstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_erkstep_mod.f90 rename src/arkode/{fmod => fmod_int64}/farkode_mod.c (100%) rename src/arkode/{fmod => fmod_int64}/farkode_mod.f90 (100%) rename src/arkode/{fmod => fmod_int64}/farkode_mristep_mod.c (100%) rename src/arkode/{fmod => fmod_int64}/farkode_mristep_mod.f90 (100%) create mode 100644 src/arkode/fmod_int64/farkode_sprkstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_sprkstep_mod.f90 rename src/cvode/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/cvode/fmod_int32/fcvode_mod.c create mode 100644 src/cvode/fmod_int32/fcvode_mod.f90 create mode 100644 src/cvode/fmod_int64/CMakeLists.txt rename src/cvode/{fmod => fmod_int64}/fcvode_mod.c (100%) rename src/cvode/{fmod => fmod_int64}/fcvode_mod.f90 (100%) rename src/cvodes/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/cvodes/fmod_int32/fcvodes_mod.c create mode 100644 src/cvodes/fmod_int32/fcvodes_mod.f90 create mode 100644 src/cvodes/fmod_int64/CMakeLists.txt rename src/cvodes/{fmod => fmod_int64}/fcvodes_mod.c (100%) rename src/cvodes/{fmod => fmod_int64}/fcvodes_mod.f90 (100%) rename src/ida/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/ida/fmod_int32/fida_mod.c create mode 100644 src/ida/fmod_int32/fida_mod.f90 create mode 100644 src/ida/fmod_int64/CMakeLists.txt rename src/ida/{fmod => fmod_int64}/fida_mod.c (100%) rename src/ida/{fmod => fmod_int64}/fida_mod.f90 (100%) rename src/idas/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/idas/fmod_int32/fidas_mod.c create mode 100644 src/idas/fmod_int32/fidas_mod.f90 create mode 100644 src/idas/fmod_int64/CMakeLists.txt rename src/idas/{fmod => fmod_int64}/fidas_mod.c (100%) rename src/idas/{fmod => fmod_int64}/fidas_mod.f90 (100%) rename src/kinsol/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/kinsol/fmod_int32/fkinsol_mod.c create mode 100644 src/kinsol/fmod_int32/fkinsol_mod.f90 create mode 100644 src/kinsol/fmod_int64/CMakeLists.txt rename src/kinsol/{fmod => fmod_int64}/fkinsol_mod.c (100%) rename src/kinsol/{fmod => fmod_int64}/fkinsol_mod.f90 (100%) rename src/nvector/manyvector/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c create mode 100644 src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 create mode 100644 src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c create mode 100644 src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 create mode 100644 src/nvector/manyvector/fmod_int64/CMakeLists.txt rename src/nvector/manyvector/{fmod => fmod_int64}/fnvector_manyvector_mod.c (100%) rename src/nvector/manyvector/{fmod => fmod_int64}/fnvector_manyvector_mod.f90 (99%) rename src/nvector/manyvector/{fmod => fmod_int64}/fnvector_mpimanyvector_mod.c (100%) rename src/nvector/manyvector/{fmod => fmod_int64}/fnvector_mpimanyvector_mod.f90 (99%) rename src/nvector/mpiplusx/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c create mode 100644 src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 create mode 100644 src/nvector/mpiplusx/fmod_int64/CMakeLists.txt rename src/nvector/mpiplusx/{fmod => fmod_int64}/fnvector_mpiplusx_mod.c (100%) rename src/nvector/mpiplusx/{fmod => fmod_int64}/fnvector_mpiplusx_mod.f90 (100%) rename src/nvector/openmp/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c create mode 100644 src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 create mode 100644 src/nvector/openmp/fmod_int64/CMakeLists.txt rename src/nvector/openmp/{fmod => fmod_int64}/fnvector_openmp_mod.c (100%) rename src/nvector/openmp/{fmod => fmod_int64}/fnvector_openmp_mod.f90 (100%) rename src/nvector/parallel/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c create mode 100644 src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 create mode 100644 src/nvector/parallel/fmod_int64/CMakeLists.txt rename src/nvector/parallel/{fmod => fmod_int64}/fnvector_parallel_mod.c (100%) rename src/nvector/parallel/{fmod => fmod_int64}/fnvector_parallel_mod.f90 (100%) rename src/nvector/pthreads/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c create mode 100644 src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 create mode 100644 src/nvector/pthreads/fmod_int64/CMakeLists.txt rename src/nvector/pthreads/{fmod => fmod_int64}/fnvector_pthreads_mod.c (100%) rename src/nvector/pthreads/{fmod => fmod_int64}/fnvector_pthreads_mod.f90 (100%) rename src/nvector/serial/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/nvector/serial/fmod_int32/fnvector_serial_mod.c create mode 100644 src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 create mode 100644 src/nvector/serial/fmod_int64/CMakeLists.txt rename src/nvector/serial/{fmod => fmod_int64}/fnvector_serial_mod.c (100%) rename src/nvector/serial/{fmod => fmod_int64}/fnvector_serial_mod.f90 (100%) rename src/sunadaptcontroller/imexgus/{fmod => fmod_int32}/CMakeLists.txt (100%) rename src/sunadaptcontroller/imexgus/{fmod => fmod_int32}/fsunadaptcontroller_imexgus_mod.c (100%) rename src/sunadaptcontroller/imexgus/{fmod => fmod_int32}/fsunadaptcontroller_imexgus_mod.f90 (100%) create mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt create mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c create mode 100644 src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 rename src/sunadaptcontroller/soderlind/{fmod => fmod_int32}/CMakeLists.txt (100%) rename src/sunadaptcontroller/soderlind/{fmod => fmod_int32}/fsunadaptcontroller_soderlind_mod.c (100%) rename src/sunadaptcontroller/soderlind/{fmod => fmod_int32}/fsunadaptcontroller_soderlind_mod.f90 (100%) create mode 100644 src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt create mode 100644 src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c create mode 100644 src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 rename src/sundials/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sundials/fmod_int32/fsundials_core_mod.c create mode 100644 src/sundials/fmod_int32/fsundials_core_mod.f90 create mode 100644 src/sundials/fmod_int64/CMakeLists.txt rename src/sundials/{fmod => fmod_int64}/fsundials_core_mod.c (99%) rename src/sundials/{fmod => fmod_int64}/fsundials_core_mod.f90 (100%) rename src/sunlinsol/band/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c create mode 100644 src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 create mode 100644 src/sunlinsol/band/fmod_int64/CMakeLists.txt rename src/sunlinsol/band/{fmod => fmod_int64}/fsunlinsol_band_mod.c (100%) rename src/sunlinsol/band/{fmod => fmod_int64}/fsunlinsol_band_mod.f90 (100%) rename src/sunlinsol/dense/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c create mode 100644 src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 create mode 100644 src/sunlinsol/dense/fmod_int64/CMakeLists.txt rename src/sunlinsol/dense/{fmod => fmod_int64}/fsunlinsol_dense_mod.c (100%) rename src/sunlinsol/dense/{fmod => fmod_int64}/fsunlinsol_dense_mod.f90 (100%) rename src/sunlinsol/klu/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c create mode 100644 src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 create mode 100644 src/sunlinsol/klu/fmod_int64/CMakeLists.txt rename src/sunlinsol/klu/{fmod => fmod_int64}/fsunlinsol_klu_mod.c (100%) rename src/sunlinsol/klu/{fmod => fmod_int64}/fsunlinsol_klu_mod.f90 (100%) rename src/sunlinsol/lapackdense/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c create mode 100644 src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 create mode 100644 src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt rename src/sunlinsol/lapackdense/{fmod => fmod_int64}/fsunlinsol_lapackdense_mod.c (100%) rename src/sunlinsol/lapackdense/{fmod => fmod_int64}/fsunlinsol_lapackdense_mod.f90 (100%) rename src/sunlinsol/pcg/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c create mode 100644 src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 create mode 100644 src/sunlinsol/pcg/fmod_int64/CMakeLists.txt rename src/sunlinsol/pcg/{fmod => fmod_int64}/fsunlinsol_pcg_mod.c (100%) rename src/sunlinsol/pcg/{fmod => fmod_int64}/fsunlinsol_pcg_mod.f90 (100%) rename src/sunlinsol/spbcgs/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c create mode 100644 src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 create mode 100644 src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt rename src/sunlinsol/spbcgs/{fmod => fmod_int64}/fsunlinsol_spbcgs_mod.c (100%) rename src/sunlinsol/spbcgs/{fmod => fmod_int64}/fsunlinsol_spbcgs_mod.f90 (100%) rename src/sunlinsol/spfgmr/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c create mode 100644 src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 create mode 100644 src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt rename src/sunlinsol/spfgmr/{fmod => fmod_int64}/fsunlinsol_spfgmr_mod.c (100%) rename src/sunlinsol/spfgmr/{fmod => fmod_int64}/fsunlinsol_spfgmr_mod.f90 (100%) rename src/sunlinsol/spgmr/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c create mode 100644 src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 create mode 100644 src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt rename src/sunlinsol/spgmr/{fmod => fmod_int64}/fsunlinsol_spgmr_mod.c (100%) rename src/sunlinsol/spgmr/{fmod => fmod_int64}/fsunlinsol_spgmr_mod.f90 (100%) rename src/sunlinsol/sptfqmr/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c create mode 100644 src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 create mode 100644 src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt rename src/sunlinsol/sptfqmr/{fmod => fmod_int64}/fsunlinsol_sptfqmr_mod.c (100%) rename src/sunlinsol/sptfqmr/{fmod => fmod_int64}/fsunlinsol_sptfqmr_mod.f90 (100%) rename src/sunmatrix/band/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c create mode 100644 src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 create mode 100644 src/sunmatrix/band/fmod_int64/CMakeLists.txt rename src/sunmatrix/band/{fmod => fmod_int64}/fsunmatrix_band_mod.c (99%) rename src/sunmatrix/band/{fmod => fmod_int64}/fsunmatrix_band_mod.f90 (97%) rename src/sunmatrix/dense/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c create mode 100644 src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 create mode 100644 src/sunmatrix/dense/fmod_int64/CMakeLists.txt rename src/sunmatrix/dense/{fmod => fmod_int64}/fsunmatrix_dense_mod.c (99%) rename src/sunmatrix/dense/{fmod => fmod_int64}/fsunmatrix_dense_mod.f90 (97%) rename src/sunmatrix/sparse/{fmod => fmod_int32}/CMakeLists.txt (100%) create mode 100644 src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c create mode 100644 src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 create mode 100644 src/sunmatrix/sparse/fmod_int64/CMakeLists.txt rename src/sunmatrix/sparse/{fmod => fmod_int64}/fsunmatrix_sparse_mod.c (95%) rename src/sunmatrix/sparse/{fmod => fmod_int64}/fsunmatrix_sparse_mod.f90 (98%) rename src/sunnonlinsol/fixedpoint/{fmod => fmod_int32}/CMakeLists.txt (100%) rename src/sunnonlinsol/fixedpoint/{fmod => fmod_int32}/fsunnonlinsol_fixedpoint_mod.c (100%) rename src/sunnonlinsol/fixedpoint/{fmod => fmod_int32}/fsunnonlinsol_fixedpoint_mod.f90 (100%) create mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt create mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c create mode 100644 src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 rename src/sunnonlinsol/newton/{fmod => fmod_int32}/CMakeLists.txt (100%) rename src/sunnonlinsol/newton/{fmod => fmod_int32}/fsunnonlinsol_newton_mod.c (100%) rename src/sunnonlinsol/newton/{fmod => fmod_int32}/fsunnonlinsol_newton_mod.f90 (100%) create mode 100644 src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt create mode 100644 src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c create mode 100644 src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 delete mode 100644 test/env/summit.sh diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 8da2ebd3f9..0e2e6dab52 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -1,7 +1,6 @@ name: Checks - clang-format on: - push: pull_request: workflow_dispatch: @@ -36,12 +35,12 @@ jobs: - name: Run git diff if we failed if: failure() - run: /usr/bin/git diff > diff + run: /usr/bin/git diff > clang_format.patch - - name: Archive diff if we failed + - name: Archive diff as a patch if we failed uses: actions/upload-artifact@v3 if: failure() with: - name: diff + name: clang_format.patch path: | - ${{ github.workspace }}/diff + ${{ github.workspace }}/clang_format.patch diff --git a/.github/workflows/check-swig.yml b/.github/workflows/check-swig.yml new file mode 100644 index 0000000000..2a4193a239 --- /dev/null +++ b/.github/workflows/check-swig.yml @@ -0,0 +1,49 @@ +name: Checks - swig + +on: + pull_request: + workflow_dispatch: + +jobs: + swig: + runs-on: ubuntu-latest + + steps: + - name: Install swig + run: | + git clone https://github.com/sundials-codes/swig + cd swig + ./autogen.sh + ./configure --prefix=/usr/ + make + sudo make install + swig -version + + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Add safe directory + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Run swig on code + run: | + cd swig + make all32 + make all64 + + - name: Run git diff to see if anything changed + run: /usr/bin/git diff --name-only --exit-code + + - name: Run git diff if we failed + if: failure() + run: /usr/bin/git diff > swig.patch + + - name: Archive diff as a patch if we failed + uses: actions/upload-artifact@v3 + if: failure() + with: + name: swig.patch + path: | + ${{ github.workspace }}/swig.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b23939604..d85d47def6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,8 @@ integrator with an MRI method. Added "Resize" capability to ARKODE's SPRKStep time-stepping module. +Enabled the Fortran interfaces to build with 32-bit `sunindextype`. + ### Bug Fixes Updated the CMake variable `HIP_PLATFORM` default to `amd` as the previous diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index d4defde798..a9a3df9ea0 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -185,11 +185,6 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) print_error("F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision") endif() - # F2003 interface only supports 64-bit indices - if(NOT (SUNDIALS_INDEX_SIZE MATCHES "64")) - print_error("F2003 interface is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indicies") - endif() - # Allow a user to set where the Fortran modules will be installed set(DOCSTR "Directory where Fortran module files are installed") sundials_option(Fortran_INSTALL_MODDIR STRING "${DOCSTR}" "fortran") diff --git a/cmake/SundialsExampleOptions.cmake b/cmake/SundialsExampleOptions.cmake index a34ef8ae95..29f099eb1e 100644 --- a/cmake/SundialsExampleOptions.cmake +++ b/cmake/SundialsExampleOptions.cmake @@ -38,8 +38,7 @@ endif() # Fortran 2003 interface is enabled. set(DOCSTR "Build SUNDIALS Fortran 2003 examples") if(BUILD_FORTRAN_MODULE_INTERFACE) - - sundials_option(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" ON) + set(EXAMPLES_ENABLE_F2003 ON CACHE BOOL "${DOCSTR}") # Fortran 2003 examples only support double precision if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))) @@ -47,14 +46,6 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() - - # Fortran 2003 examples only support 64-bit indices - if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_INDEX_SIZE MATCHES "64"))) - print_warning("F2003 examples are not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") - force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) - endif() - else() # set back to OFF (in case it was ON) diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 84505e4f12..d8be54aac8 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -458,6 +458,7 @@ macro(sundials_add_f2003_library target) ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} ${_includes} COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} + PUBLIC "SUNDIALS_INT${SUNDIALS_INDEX_SIZE}_T" COMPILE_OPTIONS ${sundials_add_f2003_library_COMPILE_OPTIONS} PROPERTIES ${sundials_add_f2003_library_PROPERTIES} ${_properties} OUTPUT_NAME ${sundials_add_f2003_library_OUTPUT_NAME} diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index a3d817d037..47ac8dd9c8 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -33,7 +33,11 @@ if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) # Prefer the import target from upstream SuiteSparse if it is available # and the user didn't point to a specific (different) version. + find_package(AMD CONFIG) + find_package(BTF CONFIG) + find_package(COLAMD CONFIG) find_package(KLU CONFIG) + find_package(SuiteSparse_config CONFIG) if(TARGET SuiteSparse::KLU) if(NOT TARGET SUNDIALS::KLU) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 62e5088a1a..ef32fa2bbb 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -57,6 +57,8 @@ an explicit fast time scale integrator with an MRI method. Added "Resize" capability to ARKODE's SPRKStep time-stepping module. +Enabled the Fortran interfaces to build with 32-bit ``sunindextype``. + **Bug Fixes** Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index 9cc9d82c2a..cb483b2733 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -162,8 +162,13 @@ equivalencies with the parameter direction in mind. .. warning:: Currently, the Fortran 2003 interfaces are only compatible with SUNDIALS - builds where the ``sunrealtype`` is double-precision the ``sunindextype`` size - is 64-bits. + builds where the ``sunrealtype`` is double-precision. + +.. versionchanged:: x.y.z + + The Fortran interfaces can now be built with 32-bit ``sunindextype`` in + addition to 64-bit ``sunindextype``. + .. _SUNDIALS.Fortran.DataTypes.Table: .. table:: C/Fortran-2003 Equivalent Types diff --git a/doc/superbuild/source/developers/getting_started/Checklist.rst b/doc/superbuild/source/developers/getting_started/Checklist.rst index c39432f85c..3b9366fd95 100644 --- a/doc/superbuild/source/developers/getting_started/Checklist.rst +++ b/doc/superbuild/source/developers/getting_started/Checklist.rst @@ -27,10 +27,11 @@ system, etc. developers should adhere to the following checklist. third party libraries to ensure that these files are only included when SUNDIALS is configured to use that library. -#. Configure SUNDIALS using the C flags ``-Wall -ansi -pedantic``, to aid in - catching compatibility issues on other platforms (Windows). When building, - modify your file to remove any error/warning messages output during - compilation of your code. +#. It can be helpful to configure SUNDIALS using the C flags ``-Wall -Werror``. + When building, modify your file to remove any error/warning messages output + during compilation of your code. This can be done automatically with the + advanced CMake options ``ENABLE_ALL_WARNINGS`` and + ``ENABLE_WARNINGS_AS_ERRORS``. #. Configure your build with a minimal set of configuration options enabled (serial). Run ``make``, ``make test``, ``make install``, and @@ -52,8 +53,7 @@ system, etc. developers should adhere to the following checklist. #. When adding new solvers or new solver options: - * Update the documentation to include descriptions of your work. Ensure that - the documentation also compiles (``make ug`` in the relevant directory). + * Update the documentation to include descriptions of your work. * Add a new example problem (or multiple problems) to the ``examples/`` directory to demonstrate how to use your solver/option, and to include in SUNDIALS' automated nightly tests. @@ -68,20 +68,20 @@ system, etc. developers should adhere to the following checklist. directory and ensure that ``make`` succeeds, since the CMake-generated Makefile system differs from how the examples are built within SUNDIALS. * Ensure that the reference output is included e.g., if a file ``foo.c`` is - added, also add ``foo.out``. + added, also add ``foo.out``. * Update the example problem documentation for to include a description of the new problem. #. When adding any new files, update the corresponding package script in the ``scripts/`` directory to include your file(s) within the distribution. -#. Use the debugging macros defined in ``src/sundials/sundials_debug.h`` where - relevant and internal to SUNDIALS. Use the ``SUNDIALS_DEBUG`` macro to - ``#ifdef`` out calls the sections of code which are for debugging purposes - only. Additionally, the ``SUNDIALS_DEBUG_PRINTVEC`` macro should be used to - ``#ifdef`` out calls to the generic vector print functions ``N_VPrint`` and - ``N_VPrintFile`` used for debugging purposes. - #. If answer files changed, and it is expected/desired, then update the `.out` files that are embedded in the `examples/` directory AND the `"answers" repository <https://github.com/sundials-codes/answers>`_. + +#. If you changed any header files, re-run SWIG to generate updated fortran interfaces. + This is done by navigating to the `swig/` directory and running `make all32 all64`. + If you do not have `swig` installed on your system, you can obtain a git patch file + from the SWIG GitHub action that we run on all pull requests. The patch can be found + under the job artifacts (if there were in fact changes that required updates + to the Fortran). diff --git a/doc/superbuild/source/developers/releases/Checklist.rst b/doc/superbuild/source/developers/releases/Checklist.rst index c9b5e1675c..37709c60e6 100644 --- a/doc/superbuild/source/developers/releases/Checklist.rst +++ b/doc/superbuild/source/developers/releases/Checklist.rst @@ -73,6 +73,7 @@ web pages. that they are deprecated). #. Regenerate the Fortran 2003 interfaces. It is possible nothing will be updated. + This is done by running ``make all32 all64`` in the ``swig/`` directory. #. Update the "Changes in ..." sections in all user guides. The changes should be sorted so that major new features are above bug fixes. diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 8cef6cd32e..c9105fa99c 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -176,6 +176,9 @@ C++ private class members should use snake case with a trailing underscore Coding Conventions and Rules ============================ +These rules should be followed for all new code. Unfortunately, old code might +not adhere to all of these rules. + #. Do not use language features that are not compatible with C99, C++14, and MSVC v1900+ (Visual Studio 2015). Examples of such features include variable-length arrays. Exceptions are allowed when interfacing with a @@ -338,6 +341,17 @@ Coding Conventions and Rules x;`` to ``return(x);``. Note, however, lots of older SUNDIALS source code uses ``return(x);``. +#. Always use ``sunindextype`` for variables that are related to problem dimensions. + E.g., use it for the length of a vector, or dimensions of a matrix. + The only exception is when interfacing with a third party library requires a different + variable type. + +#. Conversely, never use ``sunindextype`` for variables that are not specifically related to + the dimensions of a vector, matrix, etc.. E.g., if you have a variable that + represents the number of integer "words" allocated in a workspace do not use + ``sunindextype`` for it. Instead use the appropriate integer type (e.g., ``uint64_t``) directly. + Do not use ``sunindextype`` for counters either. + #. ``SUNLogger`` statements must be in the format: .. code-block:: c @@ -371,6 +385,16 @@ for the tools respectively. To apply clang-format you can run: ./scripts/format.sh <path to directories to format> + +.. warning:: + + The output of ``clang-format`` is sensitive to the ``clang-format`` version. We recommend + that you use version ``17.0.4``, which can be installed from source or with Spack. Alternatively, + when you open a pull request on GitHub, an action will run ``clang-format`` on the code. If any + formatting is required, the action will fail and produce a git patch artifact that you can download + (from the job artifacts section) and apply with `git apply`. + + If clang-format breaks lines in a way that is unreadable, use ``//`` to break the line. For example, sometimes (mostly in C++ code) you may have code like this: @@ -426,3 +450,4 @@ There are other scenarios (e.g., a function call with a lot of parameters) where .. }; .. See the clang-tidy documentation for more details. + diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 6393b31306..7aac6173a6 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -17,18 +17,22 @@ # Example lists are tuples "name\;type" where the type is # 'develop' for examples excluded from 'make test' in releases -# Examples using SUNDIALS linear solvers -set(FARKODE_examples - "ark_brusselator1D_f2003\;develop" - "ark_analytic_complex_f2003\;develop" - ) +if(SUNDIALS_INDEX_SIZE MATCHES "64") -set(FARKODE_tests - "test_fnvector_complex_mod\;develop" - "test_fnvector_fortran_mod\;develop" - "test_fsunmatrix_fortran_mod\;develop" - "test_fsunlinsol_fortran_mod\;develop" - ) + # Examples using SUNDIALS linear solvers + set(FARKODE_examples + "ark_brusselator1D_f2003\;develop" + "ark_analytic_complex_f2003\;develop" + ) + + set(FARKODE_tests + "test_fnvector_complex_mod\;develop" + "test_fnvector_fortran_mod\;develop" + "test_fsunmatrix_fortran_mod\;develop" + "test_fsunlinsol_fortran_mod\;develop" + ) + +endif() # note the order matters when auto-generating the installed Makefile set(FARKODEsources diff --git a/examples/arkode/F2003_parallel/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index d1084b5af3..63c87909cf 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -18,12 +18,17 @@ # Example lists are tuples "name\;nodes\;tasks\;type" where the # type is develop for examples excluded from 'make test' in releases set(FARKODE_examples - "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" - "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" - "ark_diag_non_f2003\;\;1\;4\;develop\;2" - "ark_heat2D_f2003\;\;1\;4\;develop\;2") + "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" +) + +if(SUNDIALS_INDEX_SIZE MATCHES "64") + list(APPEND FARKODE_examples + "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "ark_diag_non_f2003\;\;1\;4\;develop\;2" + "ark_heat2D_f2003\;\;1\;4\;develop\;2") +endif() # Set-up linker flags and link libraries set(SUNDIALS_LIBS sundials_arkode 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 b0dbbadc20..297b036559 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 @@ -69,11 +69,21 @@ module ode_mod implicit none save + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + type(c_ptr) :: sunctx ! SUNDIALS simulation context type(c_ptr) :: logger ! SUNDIALS logger ! Number of chemical species - integer, parameter :: Nvar = 3 + integer(kind=myindextype), parameter :: Nvar = 3 ! MPI variables integer, target :: comm ! communicator @@ -87,9 +97,9 @@ module ode_mod real(c_double) :: Esend(Nvar), Erecv(Nvar) ! Problem settings - integer :: Nx ! number of intervals (global) - integer :: Npts ! number of spatial nodes (local) - integer :: Neq ! number of equations (local) + integer(kind=myindextype) :: Nx ! number of intervals (global) + integer(kind=myindextype) :: Npts ! number of spatial nodes (local) + integer(kind=myindextype) :: Neq ! number of equations (local) real(c_double) :: xmax ! maximum x value real(c_double) :: dx ! mesh spacing @@ -150,7 +160,7 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & real(c_double), pointer :: fdata(:) ! local variables - integer :: i, j, idx1, idx2 ! loop counters and array indices + integer(myindextype) :: i, j, idx1, idx2 ! loop counters and array indices real(c_double) :: tmp ! temporary value !======= Internals ============ @@ -237,7 +247,7 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & ! local variables real(c_double) :: u, v, w ! chemcial species - integer :: j, idx ! loop counter and array index + integer(kind=myindextype) :: j, idx ! loop counter and array index !======= Internals ============ @@ -354,8 +364,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod use fsunlinsol_dense_mod - - use ode_mod, only : Nvar, Npts, Neq, k2, k3, k4, k6 + use ode_mod, only : Nvar, Npts, Neq, k2, k3, k4, k6, myindextype !======= Declarations ========= implicit none @@ -374,7 +383,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & real(c_double), pointer :: pdata(:) ! matrix data real(c_double) :: u, v, w ! chemical species - integer :: i, idx, offset ! loop counter, array index, col offset + integer(kind=myindextype) :: i, idx, offset ! loop counter, array index, col offset !======= Internals ============ @@ -545,8 +554,7 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) use, intrinsic :: iso_c_binding use farkode_mod use farkode_arkstep_mod - - use ode_mod, only : Neq, Reaction + use ode_mod, only : Neq, Reaction, myindextype !======= Declarations ========= implicit none @@ -578,7 +586,7 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) real(c_double), pointer :: Fi_data(:) real(c_double), pointer :: sdata_data(:) - integer :: i ! loop counter + integer(kind=myindextype) :: i ! loop counter !======= Internals ============ @@ -640,8 +648,7 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & use farkode_mod use farkode_arkstep_mod use fsunmatrix_dense_mod - - use ode_mod, only : Nvar, Npts, k2, k3, k4, k6 + use ode_mod, only : Nvar, Npts, k2, k3, k4, k6, myindextype !======= Declarations ========= implicit none @@ -665,7 +672,7 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & real(c_double), pointer :: bnode_data(:) real(c_double) :: u, v, w ! chemical species - integer :: i, idx ! loop counter and array index + integer(kind=myindextype) :: i, idx ! loop counter and array index !======= Internals ============ @@ -814,7 +821,6 @@ integer(c_int) function TaskLocalNewton_Solve(sunnls, sunvec_y0, sunvec_ycor, & !======= Inclusions =========== use, intrinsic :: iso_c_binding use fnvector_mpiplusx_mod - use ode_mod, only : comm !======= Declarations ========= @@ -968,7 +974,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) use fsunlinsol_dense_mod use fsunmatrix_dense_mod - use ode_mod, only : sunctx, Nvar, comm + use ode_mod !======= Declarations ========= implicit none @@ -1015,8 +1021,8 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) Fi_ptr = FN_VNewVectorArray(1, sunctx) sdata_ptr = FN_VNewVectorArray(1, sunctx) - sunvec_bnode => FN_VNew_Serial(int(Nvar, c_long), sunctx) - sunmat_Jnode => FSUNDenseMatrix(int(Nvar, c_long), int(Nvar, c_long), sunctx) + sunvec_bnode => FN_VNew_Serial(Nvar, sunctx) + sunmat_Jnode => FSUNDenseMatrix(Nvar, Nvar, sunctx) sunls_Jnode => FSUNLinSol_Dense(sunvec_bnode, sunmat_Jnode, sunctx) ! initialize number of nonlinear solver function evals and fails @@ -1037,7 +1043,8 @@ program main use fnvector_mpimanyvector_mod ! Access MPIManyVector N_Vector use fnvector_serial_mod ! Access serial N_Vector - use ode_mod, only : sunctx, logger, comm, myid, Nx, Neq, dx, fused, explicit, printtime, nout + use ode_mod, only : sunctx, logger, comm, myid, Nx, Neq, dx, fused, & + explicit, printtime, nout, myindextype !======= Declarations ========= implicit none @@ -1045,7 +1052,7 @@ program main ! With MPI-3 use mpi_f08 is preferred include "mpif.h" - integer :: i + integer(kind=myindextype) :: i integer :: ierr ! MPI error status integer(c_int) :: retval ! SUNDIALS error status real(c_double) :: starttime, endtime ! timing variables @@ -1107,7 +1114,7 @@ program main call SetupProblem() ! Create solution vector - sunvec_ys => FN_VNew_Serial(int(Neq, c_long), sunctx) + sunvec_ys => FN_VNew_Serial(Neq, sunctx) sunvec_y => FN_VMake_MPIPlusX(comm, sunvec_ys, sunctx) ! Enable fused vector ops in local and MPI+X vectors @@ -1213,6 +1220,10 @@ subroutine EvolveProblemIMEX(sunvec_y) !======= Internals ============ + sun_NLS => null() + sun_LS => null() + sunmat_A => null() + ! Create the ARK timestepper module arkode_mem = FARKStepCreate(c_funloc(Advection), c_funloc(Reaction), & t0, sunvec_y, sunctx) @@ -1286,7 +1297,7 @@ subroutine EvolveProblemIMEX(sunvec_y) end if ! Create MPI task-local data structures for preconditioning - sunmat_P => FSUNDenseMatrix(int(Neq, c_long), int(Neq, c_long), sunctx) + sunmat_P => FSUNDenseMatrix(Neq, Neq, sunctx) sunls_P => FSUNLinSol_Dense(umask_s, sunmat_P, sunctx) else @@ -1628,7 +1639,7 @@ subroutine WriteOutput(t, sunvec_y) use farkode_mod ! Access ARKode use ode_mod, only : Nvar, nprocs, myid, Erecv, Nx, Npts, monitor, nout, & - umask, vmask, wmask + umask, vmask, wmask, myindextype !======= Declarations ========= implicit none @@ -1639,7 +1650,7 @@ subroutine WriteOutput(t, sunvec_y) real(c_double), pointer :: ydata(:) ! vector data - integer i, idx ! loop counter and array index + integer(kind=myindextype) i, idx ! loop counter and array index real(c_double) :: u, v, w ! RMS norm of chemical species @@ -1707,7 +1718,7 @@ subroutine SetIC(sunvec_y) use, intrinsic :: iso_c_binding use fsundials_core_mod - use ode_mod, only : Nvar, myid, Npts, xmax, dx, A, B, k1, k2, k4, k3 + use ode_mod !======= Declarations ========= implicit none @@ -1721,7 +1732,7 @@ subroutine SetIC(sunvec_y) real(c_double) :: x, us, vs, ws ! position and state real(c_double) :: p, mu, sigma, alpha ! perturbation vars - integer :: j, idx ! loop counter and array index + integer(kind=myindextype) :: j, idx ! loop counter and array index !======= Internals ============ @@ -1985,13 +1996,14 @@ subroutine SetupProblem() include "mpif.h" ! local variables - real(c_double), pointer :: data(:) ! array data - integer(c_int) :: retval ! SUNDIALS error status - integer :: ierr ! MPI error status - integer :: j ! loop counter - integer :: nargs, length, status ! input parsing vars - character(len=32) :: arg ! input arg - character(len=100) :: outname ! output file name + integer :: ierr ! MPI error status + integer(c_int) :: retval ! SUNDIALS error status + integer :: argj + integer :: nargs, length, status ! input parsing vars + character(len=32) :: arg ! input arg + character(len=100) :: outname ! output file name + real(c_double), pointer :: data(:) ! array data + integer(kind=myindextype) :: j !======= Internals ============ @@ -2043,11 +2055,11 @@ subroutine SetupProblem() ! check for input args nargs = command_argument_count() - j = 1 - do while (j <= nargs) + argj= 1 + do while (argj <= nargs) ! get input arg - call get_command_argument(j, arg, length, status) + call get_command_argument(argj, arg, length, status) ! check if reading the input was successful if (status == -1) then @@ -2064,39 +2076,39 @@ subroutine SetupProblem() else if (trim(arg) == "--printtime") then printtime = .true. else if (trim(arg) == "--nout") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) nout else if (trim(arg) == "--nx") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) Nx else if (trim(arg) == "--xmax") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) xmax else if (trim(arg) == "--A") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) A else if (trim(arg) == "--B") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) B else if (trim(arg) == "--k") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) k1 read(arg,*) k2 read(arg,*) k3 read(arg,*) k4 else if (trim(arg) == "--c") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) c else if (trim(arg) == "--order") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) order else if (trim(arg) == "--explicit") then explicit = .true. @@ -2105,16 +2117,16 @@ subroutine SetupProblem() else if (trim(arg) == "--fused") then fused = .true. else if (trim(arg) == "--tf") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) tf else if (trim(arg) == "--rtol") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) rtol else if (trim(arg) == "--atol") then - j = j + 1 - call get_command_argument(j, arg) + argj = argj + 1 + call get_command_argument(argj, arg) read(arg,*) atol else if (trim(arg) == "--help") then if (myid == 0) call InputHelp() @@ -2128,11 +2140,11 @@ subroutine SetupProblem() end if ! move to the next input - j = j+1 + argj = argj+1 end do ! Setup the parallel decomposition - if (MOD(Nx,nprocs) > 0) then + if (MOD(Nx,int(nprocs, myindextype)) > 0) then print *, "ERROR: The mesh size (nx = ", Nx,") must be divisible by the number of processors (",nprocs,")" call MPI_Abort(comm, 1, ierr) end if @@ -2142,7 +2154,7 @@ subroutine SetupProblem() dx = xmax / Nx ! Nx is number of intervals ! Create the solution masks - umask_s => FN_VNew_Serial(int(Neq, c_long), sunctx) + umask_s => FN_VNew_Serial(Neq, sunctx) umask => FN_VMake_MPIPlusX(comm, umask_s, sunctx) if (fused) then diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index 635906df1b..2268891857 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -18,48 +18,45 @@ # Example lists are tuples "name\;type" where the type is # 'develop' for examples excluded from 'make test' in releases -# Examples using SUNDIALS linear solvers set(FARKODE_examples "ark_analytic_f2003\;\;develop" - "ark_bruss_f2003\;\;develop" - "ark_diurnal_kry_bp_f2003\;\;develop" - "ark_roberts_dns_f2003\;\;develop" - "ark_kpr_mri_f2003\;\;develop" - "ark_kpr_mri_f2003\;0 0.002\;develop" - "ark_kpr_mri_f2003\;1 0.002\;develop" - "ark_kpr_mri_f2003\;2 0.005\;develop" - "ark_kpr_mri_f2003\;3 0.01\;develop" - "ark_kpr_mri_f2003\;4 0.002\;develop" - "ark_kpr_mri_f2003\;5 0.002\;develop" - "ark_kpr_mri_f2003\;6 0.005\;develop" - "ark_kpr_mri_f2003\;7 0.001\;develop" - "ark_kpr_mri_f2003\;8 0.001\;develop" - "ark_kpr_mri_f2003\;9 0.001\;develop" - ) +) + +# Regression tests +set(FARKODE_tests + "test_ark_butcher_f2003\;develop" +) -# Examples using SUNDIALS KLU interface if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Examples using SUNDIALS linear solvers + list(APPEND FARKODE_examples + "ark_bruss_f2003\;\;develop" + "ark_diurnal_kry_bp_f2003\;\;develop" + "ark_roberts_dns_f2003\;\;develop" + "ark_kpr_mri_f2003\;\;develop" + "ark_kpr_mri_f2003\;0 0.002\;develop" + "ark_kpr_mri_f2003\;1 0.002\;develop" + "ark_kpr_mri_f2003\;2 0.005\;develop" + "ark_kpr_mri_f2003\;3 0.01\;develop" + "ark_kpr_mri_f2003\;4 0.002\;develop" + "ark_kpr_mri_f2003\;5 0.002\;develop" + "ark_kpr_mri_f2003\;6 0.005\;develop" + "ark_kpr_mri_f2003\;7 0.001\;develop" + "ark_kpr_mri_f2003\;8 0.001\;develop" + "ark_kpr_mri_f2003\;9 0.001\;develop" + ) + set(FARKODE_examples_KLU "ark_bruss1D_FEM_klu_f2003\;develop" - ) - -endif() - -# Examples using LAPACK interface -if(SUNDIALS_INDEX_SIZE MATCHES "64") + ) set(FARKODE_examples_LAPACK "ark_roberts_dnsL_f2003\;\;develop" - ) + ) endif() -# Regression tests -set(FARKODE_tests - "test_ark_butcher_f2003\;develop" - ) - # Specify libraries to link against set(ARKODE_LIB sundials_arkode) set(FARKODE_LIB sundials_farkode_mod) diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index d7378eabd0..2df7e977c3 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -34,8 +34,18 @@ module analytic_mod !======= Declarations ========= implicit none + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! number of equations - integer(c_long), parameter :: neq = 1 + integer(kind=myindextype), parameter :: neq = 1 ! ODE parameters real(c_double), parameter :: lamda = -100.0d0 diff --git a/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 b/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 index a6132d9df6..0bc1bafdfa 100644 --- a/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 +++ b/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 @@ -16,6 +16,12 @@ module test_arkode_butcher_table +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + contains integer function smoke_tests() result(ret) @@ -27,9 +33,9 @@ integer function smoke_tests() result(ret) !======== Declarations ======== implicit none type(c_ptr) :: ERK, DIRK - integer(C_INT) :: ierr, q(1), p(1) - integer(C_LONG) :: liw(1), lrw(1) - real(C_DOUBLE) :: b(2), c(2), d(2), A(4) + integer(C_INT) :: ierr, q(1), p(1) + integer(kind=myindextype) :: liw(1), lrw(1) + real(C_DOUBLE) :: b(2), c(2), d(2), A(4) !===== Setup ==== diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index f5bdfb8d78..eab3a925e9 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -79,7 +79,9 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) - add_subdirectory(F2003_parallel) + if(ENABLE_MPI) + add_subdirectory(F2003_parallel) + endif() endif() # CUDA examples diff --git a/examples/cvode/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt index c2b894d375..e686e97fa3 100644 --- a/examples/cvode/F2003_parallel/CMakeLists.txt +++ b/examples/cvode/F2003_parallel/CMakeLists.txt @@ -17,7 +17,7 @@ # Example lists are tuples "name\;nodes\;tasks\;type" where the # type is develop for examples excluded from 'make test' in releases -if(MPI_ENABLED) +if(SUNDIALS_INDEX_SIZE MATCHES "64") set(FCVODE_examples "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" "cv_diag_kry_f2003\;\;1\;4\;develop\;2" diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 index 1710a0d061..685d60784c 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -28,8 +28,7 @@ module DiagkrybbdData !======= Inclusions =========== use, intrinsic :: iso_c_binding - - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -67,7 +66,7 @@ integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -112,7 +111,7 @@ integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -149,15 +148,10 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_futils_mod ! Fortran utilities - use fcvode_mod ! Access CVode - use fsundials_types_mod ! sundials defined types - use fsundials_matrix_mod ! Fortran interface to generic SUNMatrix - use fsundials_nvector_mod ! Access generic N_Vector + use fsundials_core_mod + use fcvode_mod ! Access CVode use fnvector_parallel_mod ! Access parallel N_Vector - use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver - use fsundials_context_mod ! Access sundials context use DiagkrybbdData @@ -178,7 +172,6 @@ program driver type(N_Vector), pointer :: sunvec_y ! solution N_Vector real(c_double), pointer :: y(:) ! vector data type(c_ptr) :: cvode_mem ! CVODE memory - integer(c_long) :: N, Ntot integer(c_int) :: retval integer :: ierr logical :: outproc diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 index 9061936dfa..e1266fb522 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -28,8 +28,7 @@ module DiagkryData !======= Inclusions =========== use, intrinsic :: iso_c_binding - - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -65,7 +64,7 @@ integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -115,7 +114,7 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -136,7 +135,7 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & real(c_double), pointer, dimension(nlocal) :: r(:) ! local data - integer(c_long) :: i, ibase, istart + integer(c_int64_t) :: i, ibase, istart real(c_double) :: psubi, pj !======= Internals ============ @@ -150,7 +149,7 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & ! Calculate Jacobian here ibase = myid * nlocal - istart = max(1, 4 - ibase) + istart = max(1_8, 4 - ibase) do i = istart,nlocal pj = dble(ibase + i) psubi = 1.d0 + gamma * alpha * pj @@ -173,15 +172,10 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_futils_mod ! Fortran utilities use fcvode_mod ! Access CVode - use fsundials_types_mod ! sundials defined types - use fsundials_matrix_mod ! Fortran interface to generic SUNMatrix - use fsundials_nvector_mod ! Access generic N_Vector + use fsundials_core_mod use fnvector_parallel_mod ! Access parallel N_Vector - use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver - use fsundials_context_mod ! Access sundials context use DiagkryData !======= Declarations ========= @@ -201,7 +195,6 @@ program driver type(N_Vector), pointer :: sunvec_y ! solution N_Vector real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data type(c_ptr) :: cvode_mem ! CVODE memory - integer(c_long) :: N, Ntot integer(c_int) :: retval integer :: ierr logical :: outproc diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out index 04ba4dc843..284e66aed0 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.out @@ -13,27 +13,27 @@ Preconditioning on left: t steps fe -------------------------------- - 0.100000 221 261 - 0.200000 265 307 - 0.300000 290 333 - 0.400000 306 350 - 0.500000 319 364 - 0.600000 329 374 - 0.700000 339 384 - 0.800000 346 392 - 0.900000 351 399 - 1.000000 355 403 + 0.100000 221 400 + 0.200000 265 452 + 0.300000 290 481 + 0.400000 306 500 + 0.500000 319 517 + 0.600000 329 528 + 0.700000 339 538 + 0.800000 346 548 + 0.900000 351 555 + 1.000000 355 563 -------------------------------- Max. absolute error is 1.46E-08 Final Solver Statistics: Internal solver steps = 355 - Total RHS evals = 403 - Total preconditioner setups = 7 + Total RHS evals = 563 + Total preconditioner setups = 0 Total preconditioner solves = 727 - Total nonlinear iterations = 400 + Total nonlinear iterations = 560 Total linear iterations = 367 - Average Krylov subspace dimension = 0.9175 + Average Krylov subspace dimension = 0.6554 Total Convergence Failures - Nonlinear = 0 - Linear = 0 Total number of error test failures = 5 @@ -45,27 +45,27 @@ Max. absolute error is 1.46E-08 Preconditioning on right: t steps fe -------------------------------- - 0.100000 221 261 - 0.200000 265 307 - 0.300000 290 333 - 0.400000 306 350 - 0.500000 319 364 - 0.600000 329 374 - 0.700000 339 384 - 0.800000 345 391 - 0.900000 352 398 - 1.000000 358 404 + 0.100000 221 400 + 0.200000 265 452 + 0.300000 290 481 + 0.400000 306 500 + 0.500000 319 517 + 0.600000 329 528 + 0.700000 339 538 + 0.800000 345 547 + 0.900000 352 554 + 1.000000 358 560 -------------------------------- Max. absolute error is 2.09E-09 Final Solver Statistics: Internal solver steps = 358 - Total RHS evals = 404 - Total preconditioner setups = 6 + Total RHS evals = 560 + Total preconditioner setups = 0 Total preconditioner solves = 730 - Total nonlinear iterations = 401 + Total nonlinear iterations = 557 Total linear iterations = 367 - Average Krylov subspace dimension = 0.9152 + Average Krylov subspace dimension = 0.6589 Total Convergence Failures - Nonlinear = 0 - Linear = 0 Total number of error test failures = 5 diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 index c390f65de3..39b8abf5dc 100644 --- a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 @@ -26,8 +26,7 @@ module DiagnonData !======= Inclusions =========== use, intrinsic :: iso_c_binding - - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -60,7 +59,7 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -76,7 +75,7 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), pointer, dimension(nlocal) :: ydot(:) ! local data - integer :: i, ierr + integer :: i !======= Internals ============ @@ -109,13 +108,9 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_futils_mod ! Fortran utilities + use fsundials_core_mod use fcvode_mod ! Access CVode - use fsundials_types_mod ! sundials defined types - use fsundials_nvector_mod ! Access generic N_Vector use fnvector_parallel_mod ! Access parallel N_Vector - use fsundials_context_mod ! Access sundials context - use fsundials_nonlinearsolver_mod ! Access generic nonlinear SUNDIALS solver use fsunnonlinsol_fixedpoint_mod ! Access fixed-point nonlinear SUNDIALS solver use DiagnonData @@ -136,7 +131,6 @@ program driver type(N_Vector), pointer :: sunvec_y ! solution N_Vector real(c_double), pointer, dimension(nlocal) :: y(:) ! vector data type(c_ptr) :: cvode_mem ! CVODE memory - integer(c_long) :: N, Ntot integer(c_int) :: retval integer :: ierr logical :: outproc diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out index bef79307c7..4fbc9c0568 100644 --- a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.out @@ -7,7 +7,7 @@ atol = 1.00E-10 alpha = 1.25E+00 ydot_i = -alpha*i * y_i (i = 1,...,neq) - Method is ADAMS/FIXED-POINT/SPGMR + Method is ADAMS/FIXED-POINT t steps fe ---------------------------- diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 555ce99c6a..1a0458a11e 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -21,33 +21,32 @@ # Examples using SUNDIALS linear solvers set(FCVODE_examples "cv_advdiff_bnd_f2003\;develop" - "cv_analytic_fp_f2003\;develop" - "cv_analytic_sys_dns_f2003\;develop" - "cv_analytic_sys_dns_jac_f2003\;develop" - "cv_brusselator_dns_f2003\;develop" - "cv_diurnal_kry_f2003\;develop" - "cv_diurnal_kry_bp_f2003\;develop" - "cv_roberts_dns_constraints_f2003\;develop" - "cv_roberts_dns_f2003\;develop" ) -# Examples using LAPACK linear solvers if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Examples using SUNDIALS linear solvers + list(APPEND FCVODE_examples + "cv_analytic_fp_f2003\;develop" + "cv_analytic_sys_dns_f2003\;develop" + "cv_analytic_sys_dns_jac_f2003\;develop" + "cv_brusselator_dns_f2003\;develop" + "cv_diurnal_kry_f2003\;develop" + "cv_diurnal_kry_bp_f2003\;develop" + "cv_roberts_dns_constraints_f2003\;develop" + "cv_roberts_dns_f2003\;develop" + ) + set(FCVODE_examples_LAPACK "cv_roberts_dnsL_f2003\;develop" ) -endif() - -# Add sparse solvers examples for 64-bit indextype configurations only, -# not compatible with 32-bit indextype -if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using KLU linear solver set(FCVODE_examples_KLU "cv_analytic_sys_klu_f2003\;develop" "cv_roberts_klu_f2003\;develop" ) + endif() # Specify libraries to link against @@ -62,6 +61,7 @@ set(SUNDIALS_LIBS ${CVODE_LIB}) # Add the build and install targets for each example foreach(example_tuple ${FCVODE_examples}) + # parse the example tuple list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) diff --git a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 index fe37cc6da7..423ef44f12 100644 --- a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 @@ -42,10 +42,20 @@ module advdiff_mod !======= Declarations ========= implicit none + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! setup and number of equations - integer(c_int), parameter :: mx = 10, my = 5 - integer(c_int), parameter :: mxmy = mx*my - integer(c_long), parameter :: neq = mxmy + integer(kind=myindextype), parameter :: mx = 10, my = 5 + integer(kind=myindextype), parameter :: mxmy = mx*my + integer(kind=myindextype), parameter :: neq = mxmy ! ODE constant parameters real(c_double), parameter :: xmax = 2.0d0, ymax = 1.0d0 @@ -61,8 +71,8 @@ module advdiff_mod real(c_double), parameter :: atol = 1.0d-5 ! ODE non-constant parameters - integer(c_int) :: i, j ! index variables - integer(c_int) :: mu, ml ! band preconditioner constants + integer(kind=myindextype) :: i, j ! index variables + integer(kind=myindextype) :: mu, ml ! band preconditioner constants real(c_double) :: x, y ! initialization index variables real(c_double) :: unorm ! solution output variable @@ -166,11 +176,11 @@ integer(c_int) function JacFn(t, sunvec_u, sunvec_f, sunmat_J, & type(N_Vector) :: sunvec_t3 ! local data - integer(c_int) :: mband, k, ioff, mu1, mu2, smu, mdim - integer(c_int) :: start + integer(kind=myindextype) :: mband, k, ioff, mu1, mu2, smu, mdim + integer(kind=myindextype) :: start real(c_double), pointer, dimension(mdim,neq) :: Jmat(:,:) - smu = int(FSUNBandMatrix_StoredUpperBandwidth(sunmat_J), c_int) + smu = FSUNBandMatrix_StoredUpperBandwidth(sunmat_J) mdim = smu + 1 + ml Jmat(1:mdim,1:neq) => FSUNBandMatrix_Data(sunmat_J) @@ -277,7 +287,7 @@ program main end if ! Tell CVODE to use a Band linear solver. - sunmat_A => FSUNBandMatrix(neq, int(mu,c_long), int(ml,c_long), ctx) + sunmat_A => FSUNBandMatrix(neq, mu, ml, ctx) if (.not. associated(sunmat_A)) then print *, 'ERROR: sunmat = NULL' stop 1 diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index 517d64133c..667a6260c6 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -16,13 +16,10 @@ # Example lists are tuples "name\;args\;type" where the type is # 'develop' for examples excluded from 'make test' in releases - -# Examples using SUNDIALS linear solvers set(FCVODES_examples "cvs_analytic_fp_f2003\;\;develop" "cvsAdvDiff_FSA_non_f2003\;-sensi stg t\;develop" - "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop" - ) + "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop") # Specify libraries to link against set(CVODES_LIB sundials_fcvodes_mod) diff --git a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 index 8f47e8a72b..25e75a14c5 100644 --- a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 @@ -56,6 +56,17 @@ module ode_problem use fsundials_core_mod implicit none + + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! SUNDIALS simulation context type(c_ptr) :: ctx @@ -68,8 +79,8 @@ module ode_problem integer(c_int), parameter :: NOUT = 10 integer(c_int), parameter :: NP = 2 integer(c_int), parameter :: NS = 2 - integer(c_long), parameter :: MX = 10 - integer(c_long), parameter :: NEQ = MX + integer(kind=myindextype), parameter :: MX = 10 + integer(kind=myindextype), parameter :: NEQ = MX ! problem constants real(c_double) :: ZERO = 0.d0 @@ -199,9 +210,9 @@ program main type(SUNNonlinearSolver), pointer :: NLSsens => null() integer(c_int) :: iout, retval real(c_double) :: reltol, abstol, tout, t(1) + integer(c_int) :: plist(0:NS-1) integer(c_int) :: is real(c_double) :: pbar(0:NS-1) - integer(c_int) :: plist(0:NS-1) ! Command line arguments integer(c_int) :: sensi, err_con @@ -267,7 +278,7 @@ program main if (sensi /= 0) then do is=0, NS-1 - plist(is) = is + plist(is) = int(is, 4) pbar(is) = p(plist(is)) end do @@ -282,7 +293,7 @@ program main call FN_VConst(ZERO, uiS) end do - retval = FCVodeSensInit1(cvodes_mem, NS, sensi_meth, c_null_funptr, uS) + retval = FCVodeSensInit1(cvodes_mem, int(NS, 4), sensi_meth, c_null_funptr, uS) call check_retval(retval, "FCVodeSensInit1") retval = FCVodeSensEEtolerances(cvodes_mem) diff --git a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 index 705d111a5b..1c147387af 100644 --- a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 @@ -33,8 +33,19 @@ module ode_mod !======= Declarations ========= implicit none + + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! number of equations - integer(c_long), parameter :: neq = 1 + integer(kind=myindextype), parameter :: neq = 1 ! ODE parameters double precision, parameter :: lamda = -100.0d0 diff --git a/examples/ida/F2003_openmp/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt index 215563c7a4..63fb888572 100644 --- a/examples/ida/F2003_openmp/CMakeLists.txt +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -18,11 +18,13 @@ # Example lists are tuples "name\;args\;type" where the type is # 'develop' for examples excluded from 'make test' in releases -# Examples using SUNDIALS linear solvers -set(FIDA_examples_OMP - "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" - "idaHeat2D_kry_omp_f2003.f90\;8\;exclude" - ) +if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Examples using SUNDIALS linear solvers + set(FIDA_examples_OMP + "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" + "idaHeat2D_kry_omp_f2003.f90\;8\;exclude" + ) +endif() # Specify libraries to link against set(IDA_LIB sundials_fida_mod) diff --git a/examples/ida/F2003_parallel/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt index 908a89cc9b..af50a152e3 100644 --- a/examples/ida/F2003_parallel/CMakeLists.txt +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -17,12 +17,11 @@ # Example lists are tuples "name\;nodes\;tasks\;type" where the # type is develop for examples excluded from 'make test' in releases -if(MPI_ENABLED) +if(SUNDIALS_INDEX_SIZE MATCHES "64") set(FIDA_examples "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") endif() - # Specify libraries to link against set(IDA_LIBS sundials_ida diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 index b3ee8dbff4..b718674c52 100644 --- a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 @@ -54,8 +54,7 @@ module Heat2DKryBBD_mod !======= Inclusions =========== use, intrinsic :: iso_c_binding - - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -259,8 +258,11 @@ subroutine InitProfile(sunvec_y, sunvec_ydot, sunvec_id, & real(c_double), pointer, dimension(nxl,nyl) :: y(:,:), ydot(:,:), id(:,:), res(:,:), cstr(:,:) real(c_double) :: xreal, yreal integer(c_int) :: retval - type(c_ptr), value :: user_data + type(c_ptr) :: user_data integer :: i, j + + user_data = c_null_ptr + ! Create solution vector, point at its data, and set initial condition N = nxl*nyl Ntot = nx*ny @@ -312,7 +314,7 @@ subroutine getStats(ida_mem, retval, ierr) !======= Inclusions =========== use, intrinsic :: iso_c_binding use fida_mod - use fsundials_futils_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -393,7 +395,7 @@ integer(c_int) function resfn(t, sunvec_y, sunvec_ydot, sunvec_res, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -434,7 +436,7 @@ integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -639,7 +641,7 @@ integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -734,16 +736,10 @@ program driver ! inclusions use, intrinsic :: iso_c_binding - use fsundials_futils_mod ! Fortran utilities + use fsundials_core_mod use fida_mod ! Access IDA - use fsundials_types_mod ! sundials defined types - use fsundials_nvector_mod ! Access generic N_Vector use fnvector_parallel_mod ! Access parallel N_Vector - use fsundials_context_mod ! Access sundials context - use fsundials_matrix_mod ! Access generic SUNMatrix - use fsundials_linearsolver_mod ! Access generic SUNLinearSolver use fsunlinsol_spgmr_mod ! Access GMRES SUNLinearSolver - use Heat2DKryBBD_mod !======= Declarations ========= @@ -768,16 +764,15 @@ program driver type(N_Vector), pointer :: sunvec_res ! derivative N_Vector type(N_Vector), pointer :: sunvec_c ! constraint N_Vector real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) ! vector data - real(c_double), pointer, dimension(nxl,nyl) :: f(:,:) ! vector data type(SUNLinearSolver), pointer :: sun_LS ! linear solver type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(c_ptr) :: ida_mem ! IDA memory integer(c_int) :: retval integer :: ierr, case logical :: outproc - real(c_double) :: t(1), dTout, tout, ymax + real(c_double) :: t(1), tout, ymax integer :: i, j, ioutput - character*100 :: outname + character(100) :: outname ! initialize MPI call MPI_Init(ierr) diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out new file mode 100644 index 0000000000..393585907b --- /dev/null +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.out @@ -0,0 +1,68 @@ + + 2D Heat PDE test problem: + nprocs = 4 + nx = 100 + ny = 100 + kx = 1.00 + ky = 1.00 + rtol = 0.00E+00 + atol = 1.00E-03 + nxl (proc 0) = 50 + nyl (proc 0) = 50 + + + Case 1 + Difference quotient half-bandwidths = 50 + Retained matrix half-bandwidths = 1 + + Output Summary + umax = max-norm of solution + nre = nre + nreLS (total number of RES evals.) + + t ||u||_max k nst nni nli nre nge h npe nps + ------------------------------------------------------------------------------------ + 0.010000 8.46213E-01 2 15 20 32 20+ 32 816 2.56E-03 8 52 + 0.020000 7.05517E-01 2 18 24 47 24+ 47 918 5.12E-03 9 71 + 0.040000 4.83694E-01 3 22 29 73 29+ 73 918 5.12E-03 9 102 + 0.080000 2.15365E-01 3 28 38 143 38+143 918 6.97E-03 9 181 + 0.160000 6.15447E-02 2 36 48 211 48+211 1020 1.39E-02 10 259 + 0.320000 1.63800E-02 2 48 69 393 69+393 1428 1.88E-02 14 462 + 0.640000 1.06183E-02 1 84 125 603 125+603 2958 5.52E-02 29 728 + 1.280000 1.98532E-02 1 88 131 621 131+621 3162 2.21E-01 31 752 + 2.560000 3.00701E-02 1 92 138 651 138+651 3264 3.52E-01 32 789 + 5.120000 2.46999E-02 1 96 147 670 147+670 3570 1.07E+00 35 817 + 10.240000 1.82570E-02 1 98 150 682 150+682 3672 2.14E+00 36 832 + ------------------------------------------------------------------------------------ + + Final Solver Statistics: + Total number of error test failures = 1 + Total number of nonlinear conv. failures = 3 + Total number of linear conv. failures = 2 + + Case 2 + Difference quotient half-bandwidths = 5 + Retained matrix half-bandwidths = 1 + + Output Summary + umax = max-norm of solution + nre = nre + nreLS (total number of RES evals.) + + t ||u||_max k nst nni nli nre nge h npe nps + ------------------------------------------------------------------------------------ + 0.010000 8.46213E-01 2 15 20 32 20+ 32 96 2.56E-03 8 52 + 0.020000 7.05517E-01 2 18 24 47 24+ 47 108 5.12E-03 9 71 + 0.040000 4.83694E-01 3 22 29 73 29+ 73 108 5.12E-03 9 102 + 0.080000 2.15365E-01 3 28 38 143 38+143 108 6.97E-03 9 181 + 0.160000 6.15447E-02 2 36 48 211 48+211 120 1.39E-02 10 259 + 0.320000 1.63800E-02 2 48 69 393 69+393 168 1.88E-02 14 462 + 0.640000 1.06183E-02 1 84 125 603 125+603 348 5.52E-02 29 728 + 1.280000 1.98532E-02 1 88 131 621 131+621 372 2.21E-01 31 752 + 2.560000 3.00701E-02 1 92 138 651 138+651 384 3.52E-01 32 789 + 5.120000 2.46999E-02 1 96 147 670 147+670 420 1.07E+00 35 817 + 10.240000 1.82570E-02 1 98 150 682 150+682 432 2.14E+00 36 832 + ------------------------------------------------------------------------------------ + + Final Solver Statistics: + Total number of error test failures = 1 + Total number of nonlinear conv. failures = 3 + Total number of linear conv. failures = 2 diff --git a/examples/ida/F2003_serial/CMakeLists.txt b/examples/ida/F2003_serial/CMakeLists.txt index 637c5c2139..107b423e41 100644 --- a/examples/ida/F2003_serial/CMakeLists.txt +++ b/examples/ida/F2003_serial/CMakeLists.txt @@ -19,9 +19,15 @@ # Examples using SUNDIALS linear solvers set(FIDA_examples - "idaHeat2D_kry_f2003\;develop" "idaRoberts_dns_f2003\;develop" +) + +if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Examples using SUNDIALS linear solvers + list(APPEND FIDA_examples + "idaHeat2D_kry_f2003\;develop" ) +endif() # Specify libraries to link against set(IDA_LIB sundials_fida_mod) diff --git a/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 b/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 index c424d7acd3..63a7807eec 100644 --- a/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 +++ b/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 @@ -40,8 +40,18 @@ module dae_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: neq = 3 - integer(c_long), parameter :: nout = 12 + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + + integer(kind=myindextype), parameter :: neq = 3 + integer(kind=myindextype), parameter :: nout = 12 contains diff --git a/examples/idas/F2003_serial/CMakeLists.txt b/examples/idas/F2003_serial/CMakeLists.txt index 6d409c2857..d66b309729 100644 --- a/examples/idas/F2003_serial/CMakeLists.txt +++ b/examples/idas/F2003_serial/CMakeLists.txt @@ -16,13 +16,17 @@ # Example lists are tuples "name\;type" where the type is # 'develop' for examples excluded from 'make test' in releases - -# Examples using SUNDIALS linear solvers set(FIDAS_examples - "idasHeat2D_kry_f2003\;develop" "idasAkzoNob_ASAi_dns_f2003\;develop" ) +if(SUNDIALS_INDEX_SIZE MATCHES "64") + # Examples using SUNDIALS linear solvers + list(APPEND FIDAS_examples + "idasHeat2D_kry_f2003\;develop" + ) +endif() + # Specify libraries to link against set(IDAS_LIB sundials_fidas_mod) diff --git a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 index c0e64c78e1..debacbf91a 100644 --- a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 +++ b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 @@ -33,8 +33,19 @@ module dae_mod use fsundials_core_mod implicit none + + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! problem parameters - integer(c_long), parameter :: NEQ = 6 + integer(kind=myindextype), parameter :: NEQ = 6 integer(c_long), parameter :: STEPS = 150 real(c_double), parameter :: T0 = 0.0d0 real(c_double), parameter :: TF = 180.d0 @@ -308,7 +319,7 @@ program main call FN_VDestroy(nv_rr) ! Create and initialize q0 for quadratures. - nv_q => FN_VNew_Serial(1_8, sunctx) + nv_q => FN_VNew_Serial(1_myindextype, sunctx) if (.not. associated(nv_q)) then write(*,*) 'ERROR: FN_VNew_Serial returned NULL' stop 1 diff --git a/examples/kinsol/CMakeLists.txt b/examples/kinsol/CMakeLists.txt index c41e93d845..67657f9399 100644 --- a/examples/kinsol/CMakeLists.txt +++ b/examples/kinsol/CMakeLists.txt @@ -47,5 +47,7 @@ endif() # Fortran examples if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) - add_subdirectory(F2003_parallel) + if(ENABLE_MPI) + add_subdirectory(F2003_parallel) + endif() endif() diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt index 8ba5706a32..d6ea17cb03 100644 --- a/examples/kinsol/F2003_parallel/CMakeLists.txt +++ b/examples/kinsol/F2003_parallel/CMakeLists.txt @@ -17,7 +17,7 @@ # Example lists are tuples "name\;nodes\;tasks\;type" where the # type is develop for examples excluded from 'make test' in releases -if(MPI_ENABLED) +if(SUNDIALS_INDEX_SIZE MATCHES "64") set(FKINSOL_examples "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") endif() diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 index dcc6b09bbb..9c00556e7d 100644 --- a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 @@ -62,7 +62,7 @@ module kinDiagonKry_mod subroutine init(sunvec_u, sunvec_s, sunvec_c) !======= Inclusions =========== - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -104,7 +104,7 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & result(ierr) bind(C) !======= Inclusions =========== - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -155,7 +155,7 @@ integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & sunvec_fs, user_data) result(ierr) bind(C) !======= Inclusions =========== - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -202,7 +202,7 @@ integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) !======= Inclusions =========== - use fsundials_nvector_mod + use fsundials_core_mod !======= Declarations ========= implicit none @@ -247,20 +247,17 @@ end module kinDiagonKry_mod program main !======= Inclusions =========== - use fsundials_context_mod + use fsundials_core_mod use fkinsol_mod ! Fortran interface to KINSOL - use fsundials_nvector_mod ! Fortran interface to generic N_Vector use fnvector_parallel_mod ! Fortran interface to serial N_Vector use fsunlinsol_spgmr_mod ! Fortran interface to SPGMR SUNLinearSolver - use fsundials_matrix_mod ! Fortran interface to generic SUNmatrix - use fsundials_linearsolver_mod ! Fortran interface to generic SUNLinearSolver use kinDiagonKry_mod ! problem-defining functions !======= Declarations ========= implicit none ! local variables - real(c_double) :: ftol, fnorm(1) + real(c_double) :: ftol type(c_ptr) :: sunctx ! sundials context type(N_Vector), pointer :: sunvec_u ! sundials vectors diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out new file mode 100644 index 0000000000..0eb25a14dc --- /dev/null +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.out @@ -0,0 +1,48 @@ + + Example program kinDiagon_kry_f2003: + This FKINSOL example solves a 128 eqn diagonal algebraic system. + Its purpose is to demonstrate the use of the Fortran interface in + a parallel environment. + + Solution method: KIN_none +Problem size: neq = 128 +Number of procs: nprocs = 4 + + 1 1.000000 2.000000 3.000000 4.000000 + 5 5.000000 6.000000 7.000000 8.000000 + 9 9.000000 10.000000 11.000000 12.000000 + 13 13.000000 14.000000 15.000000 16.000000 + 17 17.000000 18.000000 19.000000 20.000000 + 21 21.000000 22.000000 23.000000 24.000000 + 25 25.000000 26.000000 27.000000 28.000000 + 29 29.000000 30.000000 31.000000 32.000000 + 33 33.000000 34.000000 35.000000 36.000000 + 37 37.000000 38.000000 39.000000 40.000000 + 41 41.000000 42.000000 43.000000 44.000000 + 45 45.000000 46.000000 47.000000 48.000000 + 49 49.000000 50.000000 51.000000 52.000000 + 53 53.000000 54.000000 55.000000 56.000000 + 57 57.000000 58.000000 59.000000 60.000000 + 61 61.000000 62.000000 63.000000 64.000000 + 65 65.000000 66.000000 67.000000 68.000000 + 69 69.000000 70.000000 71.000000 72.000000 + 73 73.000000 74.000000 75.000000 76.000000 + 77 77.000000 78.000000 79.000000 80.000000 + 81 81.000000 82.000000 83.000000 84.000000 + 85 85.000000 86.000000 87.000000 88.000000 + 89 89.000000 90.000000 91.000000 92.000000 + 93 93.000000 94.000000 95.000000 96.000000 + 97 97.000000 98.000000 99.000000 100.000000 + 101 101.000000 102.000000 103.000000 104.000000 + 105 105.000000 106.000000 107.000000 108.000000 + 109 109.000000 110.000000 111.000000 112.000000 + 113 113.000000 114.000000 115.000000 116.000000 + 117 117.000000 118.000000 119.000000 120.000000 + 121 121.000000 122.000000 123.000000 124.000000 + 125 125.000000 126.000000 127.000000 128.000000 + + Final Statistics.. + +nni = 7 nli = 21 +nfe = 8 npe = 2 +nps = 28 nlcf = 0 diff --git a/examples/kinsol/F2003_serial/CMakeLists.txt b/examples/kinsol/F2003_serial/CMakeLists.txt index 8908285b85..1bca9e8dd3 100644 --- a/examples/kinsol/F2003_serial/CMakeLists.txt +++ b/examples/kinsol/F2003_serial/CMakeLists.txt @@ -16,14 +16,16 @@ # Example lists are tuples "name\;type" where the type is # 'develop' for examples excluded from 'make test' in releases - -# Examples using SUNDIALS linear solvers set(FKINSOL_examples - "kinDiagon_kry_f2003\;\;develop" - "kinRoboKin_dns_f2003\;\;develop" - "kinLaplace_bnd_f2003\;\;develop" - "kinLaplace_picard_kry_f2003\;\;develop" - ) + "kinDiagon_kry_f2003\;\;develop") + +if(SUNDIALS_INDEX_SIZE MATCHES "64") + list(APPEND FKINSOL_examples + "kinRoboKin_dns_f2003\;\;develop" + "kinLaplace_bnd_f2003\;\;develop" + "kinLaplace_picard_kry_f2003\;\;develop" + ) +endif() # Specify libraries to link against set(KINSOL_LIB sundials_fkinsol_mod) diff --git a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 index 83cdef8caa..a69564fe1f 100644 --- a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 @@ -34,7 +34,17 @@ module kinDiagonKry_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: neq = 128 + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + + integer(kind=myindextype), parameter :: neq = 128 integer(c_int) :: ierr, retval integer(c_long) :: i diff --git a/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 b/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 index a4b7648839..afa1157fef 100644 --- a/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 +++ b/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 @@ -22,16 +22,16 @@ module test_nvector_openmp use test_utilities implicit none - integer(c_long), parameter :: N = 100 ! vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(c_int), parameter :: ns = 2 ! number of vector arrays + integer(kind=myindextype), parameter :: N = 100 ! vector length + integer(kind=myindextype), parameter :: ns = 2 ! number of vector arrays + integer(c_int), parameter :: nv = 3 ! length of vector arrays contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size integer(c_long) :: ival ! integer work value real(c_double) :: rval ! real work value real(c_double) :: xdata(N) ! vector data array @@ -94,16 +94,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_OpenMP(x, y) ! test fused vector operations - ival = FN_VLinearCombination_OpenMP(nv, nvarr, xvecs, x) - ival = FN_VScaleAddMulti_OpenMP(nv, nvarr, x, xvecs, zvecs) - ival = FN_VDotProdMulti_OpenMP(nv, x, xvecs, nvarr) + ival = FN_VLinearCombination_OpenMP(int(nv, 4), nvarr, xvecs, x) + ival = FN_VScaleAddMulti_OpenMP(int(nv, 4), nvarr, x, xvecs, zvecs) + ival = FN_VDotProdMulti_OpenMP(int(nv, 4), x, xvecs, nvarr) ! test vector array operations - ival = FN_VLinearSumVectorArray_OpenMP(nv, ONE, xvecs, ONE, xvecs, zvecs) - ival = FN_VScaleVectorArray_OpenMP(nv, nvarr, xvecs, zvecs) - ival = FN_VConstVectorArray_OpenMP(nv, ONE, xvecs) - ival = FN_VWrmsNormVectorArray_OpenMP(nv, xvecs, xvecs, nvarr) - ival = FN_VWrmsNormMaskVectorArray_OpenMP(nv, xvecs, xvecs, x, nvarr) + ival = FN_VLinearSumVectorArray_OpenMP(int(nv, 4), ONE, xvecs, ONE, xvecs, zvecs) + ival = FN_VScaleVectorArray_OpenMP(int(nv, 4), nvarr, xvecs, zvecs) + ival = FN_VConstVectorArray_OpenMP(int(nv, 4), ONE, xvecs) + ival = FN_VWrmsNormVectorArray_OpenMP(int(nv, 4), xvecs, xvecs, nvarr) + ival = FN_VWrmsNormMaskVectorArray_OpenMP(int(nv, 4), xvecs, xvecs, x, nvarr) !==== Cleanup ===== call FN_VDestroy_OpenMP(x) @@ -148,10 +148,10 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - integer(C_LONG) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(kind=myindextype) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 diff --git a/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 b/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 index d87b6747b0..cf12181129 100644 --- a/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 +++ b/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 @@ -24,18 +24,18 @@ module test_nvector_manyvector implicit none integer(c_int), parameter :: nsubvecs = 2 - integer(c_long), parameter :: N1 = 100 ! individual vector length - integer(c_long), parameter :: N2 = 200 ! individual vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(c_long), parameter :: N = N1 + N2 ! overall manyvector length + integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(kind=myindextype), parameter :: N1 = 100 ! individual vector length + integer(kind=myindextype), parameter :: N2 = 200 ! individual vector length + integer(kind=myindextype), parameter :: N = N1 + N2 ! overall manyvector length contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size - integer(c_long) :: ival ! integer work value + integer(kind=myindextype) :: ival ! integer work value + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size real(c_double) :: rval ! real work value real(c_double) :: x1data(N1), x2data(N2) ! vector data array real(c_double), pointer :: xptr(:) ! pointer to vector data array @@ -51,7 +51,7 @@ integer function smoke_tests() result(ret) tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) - x => FN_VNew_ManyVector(int(nsubvecs,8), subvecs, sunctx) + x => FN_VNew_ManyVector(int(nsubvecs, myindextype), subvecs, sunctx) call FN_VConst(ONE, x) y => FN_VClone_ManyVector(x) call FN_VConst(ONE, y) @@ -140,7 +140,7 @@ integer function unit_tests() result(fails) tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) - x => FN_VNew_ManyVector(int(nsubvecs,8), subvecs, sunctx) + x => FN_VNew_ManyVector(int(nsubvecs, myindextype), subvecs, sunctx) call FN_VConst(ONE, x) !==== tests ==== @@ -157,23 +157,22 @@ end function unit_tests end module -integer(C_INT) function check_ans(ans, X, local_length) result(failure) +function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding use fnvector_manyvector_mod - use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - type(N_Vector), pointer :: X0, X1 - integer(C_LONG) :: local_length, i, x0len, x1len - real(C_DOUBLE), pointer :: x0data(:), x1data(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + type(N_Vector), pointer :: X0, X1 + integer(kind=myindextype) :: failure, local_length, i, x0len, x1len + real(C_DOUBLE), pointer :: x0data(:), x1data(:) failure = 0 - X0 => FN_VGetSubvector_ManyVector(X, 0_8) - X1 => FN_VGetSubvector_ManyVector(X, 1_8) + X0 => FN_VGetSubvector_ManyVector(X, 0_myindextype) + X1 => FN_VGetSubvector_ManyVector(X, 1_myindextype) x0len = FN_VGetLength(X0) x1len = FN_VGetLength(X1) x0data => FN_VGetArrayPointer(X0) diff --git a/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 index 0e9f02f6aa..1b25a3f139 100644 --- a/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 +++ b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 @@ -25,28 +25,28 @@ module test_nvector_mpimanyvector implicit none include "mpif.h" - integer(c_int), parameter :: nsubvecs = 2 - integer(c_long), parameter :: N1 = 100 ! individual vector length - integer(c_long), parameter :: N2 = 200 ! individual vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(c_long), parameter :: N = N1 + N2 ! overall manyvector length - integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator - integer(c_int) :: nprocs ! number of MPI processes + integer(c_int), parameter :: nsubvecs = 2 + integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(kind=myindextype), parameter :: N1 = 100 ! individual vector length + integer(kind=myindextype), parameter :: N2 = 200 ! individual vector length + integer(kind=myindextype), parameter :: N = N1 + N2 ! overall manyvector length + integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator + integer(c_int) :: nprocs ! number of MPI processes contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size - integer(c_long) :: ival ! integer work value - real(c_double) :: rval ! real work value - real(c_double) :: x1data(N1), x2data(N2) ! vector data array - real(c_double), pointer :: xptr(:) ! pointer to vector data array - real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array - type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors - type(c_ptr) :: subvecs ! MPIManyVector subvectors - type(c_ptr) :: xvecs, zvecs ! C pointer to array of MPIManyVectors + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + integer(kind=myindextype) :: ival ! integer work value + real(c_double) :: rval ! real work value + real(c_double) :: x1data(N1), x2data(N2) ! vector data array + real(c_double), pointer :: xptr(:) ! pointer to vector data array + real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array + type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors + type(c_ptr) :: subvecs ! MPIManyVector subvectors + type(c_ptr) :: xvecs, zvecs ! C pointer to array of MPIManyVectors !===== Setup ==== subvecs = FN_VNewVectorArray(nsubvecs, sunctx) @@ -55,7 +55,7 @@ integer function smoke_tests() result(ret) tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) - x => FN_VMake_MPIManyVector(comm, int(nsubvecs,8), subvecs, sunctx) + x => FN_VMake_MPIManyVector(comm, int(nsubvecs, myindextype), subvecs, sunctx) call FN_VConst(ONE, x) y => FN_VClone_MPIManyVector(x) call FN_VConst(ONE, y) @@ -96,16 +96,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotientLocal_MPIManyVector(x, y) ! test fused vector operations - ival = FN_VLinearCombination_MPIManyVector(nv, nvarr, xvecs, x) - ival = FN_VScaleAddMulti_MPIManyVector(nv, nvarr, x, xvecs, zvecs) - ival = FN_VDotProdMulti_MPIManyVector(nv, x, xvecs, nvarr) + ival = FN_VLinearCombination_MPIManyVector(int(nv, 4), nvarr, xvecs, x) + ival = FN_VScaleAddMulti_MPIManyVector(int(nv, 4), nvarr, x, xvecs, zvecs) + ival = FN_VDotProdMulti_MPIManyVector(int(nv, 4), x, xvecs, nvarr) ! test vector array operations - ival = FN_VLinearSumVectorArray_MPIManyVector(nv, ONE, xvecs, ONE, xvecs, zvecs) - ival = FN_VScaleVectorArray_MPIManyVector(nv, nvarr, xvecs, zvecs) - ival = FN_VConstVectorArray_MPIManyVector(nv, ONE, xvecs) - ival = FN_VWrmsNormVectorArray_MPIManyVector(nv, xvecs, xvecs, nvarr) - ival = FN_VWrmsNormMaskVectorArray_MPIManyVector(nv, xvecs, xvecs, x, nvarr) + ival = FN_VLinearSumVectorArray_MPIManyVector(int(nv, 4), ONE, xvecs, ONE, xvecs, zvecs) + ival = FN_VScaleVectorArray_MPIManyVector(int(nv, 4), nvarr, xvecs, zvecs) + ival = FN_VConstVectorArray_MPIManyVector(int(nv, 4), ONE, xvecs) + ival = FN_VWrmsNormVectorArray_MPIManyVector(int(nv, 4), xvecs, xvecs, nvarr) + ival = FN_VWrmsNormMaskVectorArray_MPIManyVector(int(nv, 4), xvecs, xvecs, x, nvarr) ! test the MPIManyVector specific operations ival = FN_VGetNumSubvectors_MPIManyVector(x) @@ -154,7 +154,7 @@ integer function unit_tests() result(fails) tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) - x => FN_VMake_MPIManyVector(comm, int(nsubvecs,8), subvecs, sunctx) + x => FN_VMake_MPIManyVector(comm, int(nsubvecs, myindextype), subvecs, sunctx) call FN_VConst(ONE, x) !==== tests ==== @@ -177,20 +177,19 @@ end function unit_tests integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding use fnvector_mpimanyvector_mod - - use test_utilities + use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - type(N_Vector), pointer :: X0, X1 - integer(C_LONG) :: local_length, i, x0len, x1len - real(C_DOUBLE), pointer :: x0data(:), x1data(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + type(N_Vector), pointer :: X0, X1 + integer(kind=myindextype) :: local_length, i, x0len, x1len + real(C_DOUBLE), pointer :: x0data(:), x1data(:) failure = 0 - X0 => FN_VGetSubvector_MPIManyVector(X, 0_8) - X1 => FN_VGetSubvector_MPIManyVector(X, 1_8) + X0 => FN_VGetSubvector_MPIManyVector(X, 0_myindextype) + X1 => FN_VGetSubvector_MPIManyVector(X, 1_myindextype) x0len = FN_VGetLength(X0) x1len = FN_VGetLength(X1) x0data => FN_VGetArrayPointer(X0) diff --git a/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 b/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 index cc194d7840..180944377d 100644 --- a/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 +++ b/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 @@ -24,7 +24,7 @@ module test_nvector_mpiplusx implicit none include "mpif.h" - integer(c_long), parameter :: N = 100 ! overall manyvector length + integer(kind=myindextype), parameter :: N = 100 ! overall manyvector length integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator integer(c_int) :: nprocs ! number of MPI processes @@ -103,11 +103,11 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - type(N_Vector), pointer :: X0 - integer(C_LONG) :: local_length, i, x0len - real(C_DOUBLE), pointer :: x0data(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + type(N_Vector), pointer :: X0 + integer(kind=myindextype) :: local_length, i, x0len + real(C_DOUBLE), pointer :: x0data(:) failure = 0 diff --git a/examples/nvector/parallel/test_fnvector_parallel_mod.f90 b/examples/nvector/parallel/test_fnvector_parallel_mod.f90 index 59f4d16968..8ca51a39ba 100644 --- a/examples/nvector/parallel/test_fnvector_parallel_mod.f90 +++ b/examples/nvector/parallel/test_fnvector_parallel_mod.f90 @@ -23,26 +23,26 @@ module test_nvector_parallel implicit none include "mpif.h" - integer(c_long), parameter :: local_length = 100 ! vector local length - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(c_int), parameter :: ns = 2 ! number of vector arrays + integer(kind=myindextype), parameter :: local_length = 100 ! vector local length + integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(c_int), parameter :: ns = 2 ! number of vector arrays - integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator - integer(c_long) :: global_length ! vector global_length - integer(c_int) :: nprocs ! number of MPI processes + integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator + integer(kind=myindextype) :: global_length ! vector global_length + integer(c_int) :: nprocs ! number of MPI processes contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size - integer(c_long) :: ival ! integer work value - real(c_double) :: rval ! real work value - real(c_double) :: xdata(local_length) ! vector data array - real(c_double), pointer :: xptr(:) ! pointer to vector data array - real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array - type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors - type(c_ptr) :: xvecs, zvecs ! C pointer to array of C pointers to N_Vectors + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + integer(c_long) :: ival ! integer work value + real(c_double) :: rval ! real work value + real(c_double) :: xdata(local_length) ! vector data array + real(c_double), pointer :: xptr(:) ! pointer to vector data array + real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array + type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors + type(c_ptr) :: xvecs, zvecs ! C pointer to array of C pointers to N_Vectors !===== Setup ==== x => FN_VMake_Parallel(comm, local_length, global_length, xdata, sunctx) @@ -98,16 +98,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_Parallel(x, y) ! test fused vector operations - ival = FN_VLinearCombination_Parallel(nv, nvarr, xvecs, x) - ival = FN_VScaleAddMulti_Parallel(nv, nvarr, x, xvecs, zvecs) - ival = FN_VDotProdMulti_Parallel(nv, x, xvecs, nvarr) + ival = FN_VLinearCombination_Parallel(int(nv, 4), nvarr, xvecs, x) + ival = FN_VScaleAddMulti_Parallel(int(nv, 4), nvarr, x, xvecs, zvecs) + ival = FN_VDotProdMulti_Parallel(int(nv, 4), x, xvecs, nvarr) ! test vector array operations - ival = FN_VLinearSumVectorArray_Parallel(nv, ONE, xvecs, ONE, xvecs, zvecs) - ival = FN_VScaleVectorArray_Parallel(nv, nvarr, xvecs, zvecs) - ival = FN_VConstVectorArray_Parallel(nv, ONE, xvecs) - ival = FN_VWrmsNormVectorArray_Parallel(nv, xvecs, xvecs, nvarr) - ival = FN_VWrmsNormMaskVectorArray_Parallel(nv, xvecs, xvecs, x, nvarr) + ival = FN_VLinearSumVectorArray_Parallel(int(nv, 4), ONE, xvecs, ONE, xvecs, zvecs) + ival = FN_VScaleVectorArray_Parallel(int(nv, 4), nvarr, xvecs, zvecs) + ival = FN_VConstVectorArray_Parallel(int(nv, 4), ONE, xvecs) + ival = FN_VWrmsNormVectorArray_Parallel(int(nv, 4), xvecs, xvecs, nvarr) + ival = FN_VWrmsNormMaskVectorArray_Parallel(int(nv, 4), xvecs, xvecs, x, nvarr) !==== Cleanup ===== call FN_VDestroy_Parallel(x) @@ -160,15 +160,15 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - integer(C_LONG) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(kind=myindextype) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 Xdata => FN_VGetArrayPointer(X) - do i = 1, local_length + do i = 1, local_length if (FNEQ(Xdata(i), ans) > 0) then failure = failure + 1 end if diff --git a/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 index 13b3429927..96db87411a 100644 --- a/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 +++ b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 @@ -17,21 +17,20 @@ module test_nvector_pthreads use, intrinsic :: iso_c_binding - use fnvector_pthreads_mod use test_utilities implicit none - integer(c_long), parameter :: N = 100 ! vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(c_int), parameter :: ns = 2 ! number of vector arrays + integer(kind=myindextype), parameter :: N = 100 ! vector length + integer(kind=myindextype), parameter :: ns = 2 ! number of vector arrays + integer(c_int), parameter :: nv = 3 ! length of vector arrays contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size integer(c_long) :: ival ! integer work value real(c_double) :: rval ! real work value real(c_double) :: xdata(N) ! vector data array @@ -94,16 +93,16 @@ integer function smoke_tests() result(ret) rval = FN_VMinQuotient_Pthreads(x, y) ! test fused vector operations - ival = FN_VLinearCombination_Pthreads(nv, nvarr, xvecs, x) - ival = FN_VScaleAddMulti_Pthreads(nv, nvarr, x, xvecs, zvecs) - ival = FN_VDotProdMulti_Pthreads(nv, x, xvecs, nvarr) + ival = FN_VLinearCombination_Pthreads(int(nv, 4), nvarr, xvecs, x) + ival = FN_VScaleAddMulti_Pthreads(int(nv, 4), nvarr, x, xvecs, zvecs) + ival = FN_VDotProdMulti_Pthreads(int(nv, 4), x, xvecs, nvarr) ! test vector array operations - ival = FN_VLinearSumVectorArray_Pthreads(nv, ONE, xvecs, ONE, xvecs, zvecs) - ival = FN_VScaleVectorArray_Pthreads(nv, nvarr, xvecs, zvecs) - ival = FN_VConstVectorArray_Pthreads(nv, ONE, xvecs) - ival = FN_VWrmsNormVectorArray_Pthreads(nv, xvecs, xvecs, nvarr) - ival = FN_VWrmsNormMaskVectorArray_Pthreads(nv, xvecs, xvecs, x, nvarr) + ival = FN_VLinearSumVectorArray_Pthreads(int(nv, 4), ONE, xvecs, ONE, xvecs, zvecs) + ival = FN_VScaleVectorArray_Pthreads(int(nv, 4), nvarr, xvecs, zvecs) + ival = FN_VConstVectorArray_Pthreads(int(nv, 4), ONE, xvecs) + ival = FN_VWrmsNormVectorArray_Pthreads(int(nv, 4), xvecs, xvecs, nvarr) + ival = FN_VWrmsNormMaskVectorArray_Pthreads(int(nv, 4), xvecs, xvecs, x, nvarr) !==== Cleanup ===== call FN_VDestroy_Pthreads(x) @@ -148,10 +147,10 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - integer(C_LONG) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(kind=myindextype) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 diff --git a/examples/nvector/serial/test_fnvector_serial_mod.f90 b/examples/nvector/serial/test_fnvector_serial_mod.f90 index eb958fb6ea..8c725b6207 100644 --- a/examples/nvector/serial/test_fnvector_serial_mod.f90 +++ b/examples/nvector/serial/test_fnvector_serial_mod.f90 @@ -22,22 +22,22 @@ module test_nvector_serial use test_utilities implicit none - integer(c_long), parameter :: N = 100 ! vector length - integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(kind=myindextype), parameter :: N = 100 ! vector length + integer(c_int), parameter :: nv = 3 ! length of vector arrays contains integer function smoke_tests() result(ret) implicit none - integer(c_long) :: lenrw(1), leniw(1) ! real and int work space size - integer(c_long) :: ival ! integer work value - real(c_double) :: rval ! real work value - real(c_double) :: xdata(N) ! vector data array - real(c_double), pointer :: xptr(:) ! pointer to vector data array - real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array - type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors - type(c_ptr) :: xvecs, zvecs ! C pointer to array of C pointers to N_Vectors + integer(kind=myindextype) :: lenrw(1), leniw(1) ! real and int work space size + integer(c_long) :: ival ! integer work value + real(c_double) :: rval ! real work value + real(c_double) :: xdata(N) ! vector data array + real(c_double), pointer :: xptr(:) ! pointer to vector data array + real(c_double) :: nvarr(nv) ! array of nv constants to go with vector array + type(N_Vector), pointer :: x, y, z, tmp ! N_Vectors + type(c_ptr) :: xvecs, zvecs ! C pointer to array of C pointers to N_Vectors !===== Setup ==== x => FN_VMake_Serial(N, xdata, sunctx) @@ -140,17 +140,16 @@ end function unit_tests end module - -integer(C_INT) function check_ans(ans, X, local_length) result(failure) +function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding - use test_utilities implicit none - real(C_DOUBLE) :: ans - type(N_Vector) :: X - integer(C_LONG) :: local_length, i - real(C_DOUBLE), pointer :: Xdata(:) + integer(kind=myindextype) :: failure + real(C_DOUBLE) :: ans + type(N_Vector) :: X + integer(kind=myindextype) :: local_length, i + real(C_DOUBLE), pointer :: Xdata(:) failure = 0 @@ -165,7 +164,6 @@ end function check_ans logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding - use test_utilities implicit none @@ -176,7 +174,6 @@ logical function has_data(X) result(failure) failure = associated(xptr) end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/nvector/test_nvector.f90 b/examples/nvector/test_nvector.f90 index c4465f6c46..b97f65b3ca 100644 --- a/examples/nvector/test_nvector.f90 +++ b/examples/nvector/test_nvector.f90 @@ -22,8 +22,6 @@ module test_fnvector use, intrinsic :: iso_c_binding - - use test_utilities implicit none @@ -38,7 +36,7 @@ integer(C_INT) function Test_FN_VMake(X, local_length, myid) & implicit none type(N_Vector) :: X - integer(C_LONG) :: local_length + integer(kind=myindextype) :: local_length integer(C_INT) :: myid if (.not. has_data(X)) then @@ -64,7 +62,7 @@ integer(C_INT) function Test_FN_VGetArrayPointer(W, local_length, myid) & implicit none type(N_Vector) :: W - integer(C_LONG) :: local_length + integer(kind=myindextype) :: local_length integer(C_INT) :: myid ! check vector data @@ -97,13 +95,13 @@ end function Test_FN_VGetArrayPointer integer(C_INT) function Test_FN_VLinearCombination(X, local_length, myid) & result(failure) - type(N_Vector) :: X - integer(C_LONG) :: local_length - integer(C_INT) :: myid, ierr - type(N_Vector), pointer :: Y1, Y2, Y3 - type(c_ptr), target :: V(3) - type(c_ptr) :: Vptr - real(C_DOUBLE) :: c(3) + type(N_Vector) :: X + integer(kind=myindextype) :: local_length + integer(C_INT) :: myid, ierr + type(N_Vector), pointer :: Y1, Y2, Y3 + type(c_ptr), target :: V(3) + type(c_ptr) :: Vptr + real(C_DOUBLE) :: c(3) failure = 0 diff --git a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 index 48c66684a0..8e6e755762 100644 --- a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 +++ b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 @@ -20,17 +20,14 @@ module test_fsunlinsol_band use test_utilities implicit none - integer(C_LONG), parameter :: N = 10 - integer(C_LONG), parameter :: mu = 2 - integer(C_LONG), parameter :: ml = 3 + integer(kind=myindextype), parameter :: N = 10 + integer(kind=myindextype), parameter :: mu = 2 + integer(kind=myindextype), parameter :: ml = 3 contains integer(C_INT) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - - use fnvector_serial_mod use fsunmatrix_band_mod use fsunlinsol_band_mod @@ -39,13 +36,13 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! test matrices - type(N_Vector), pointer :: x, y, b ! test vectors - real(C_DOUBLE), pointer :: xdata(:), Adata(:) ! data arrays - real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j, k - integer(C_LONG) :: smu, kstart, kend, offset - integer(C_INT) :: tmp + type(SUNMatrix), pointer :: A ! test matrices + type(N_Vector), pointer :: x, y, b ! test vectors + real(C_DOUBLE), pointer :: xdata(:), Adata(:) ! data arrays + real(C_DOUBLE) :: tmpr ! temporary real value + integer(kind=myindextype) :: j, k + integer(kind=myindextype) :: smu, kstart, kend, offset + integer(C_INT) :: tmp fails = 0 smu = 0 @@ -121,13 +118,14 @@ end function unit_tests integer(C_INT) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding - use test_utilities - implicit none + + + type(N_Vector) :: x, y real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen + integer(kind=myindextype) :: i, xlen, ylen real(C_DOUBLE), pointer :: xdata(:), ydata(:) failure = 0 diff --git a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 index a06d69eeb5..34da2d20a3 100644 --- a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 +++ b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 @@ -20,15 +20,14 @@ module test_fsunlinsol_dense use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 contains integer(C_INT) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - - use fnvector_serial_mod use fsunmatrix_dense_mod use fsunlinsol_dense_mod @@ -42,7 +41,7 @@ integer(C_INT) function unit_tests() result(fails) real(C_DOUBLE), pointer :: colj(:), colIj(:) ! matrix column data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j, k + integer(kind=myindextype) :: j, k integer(C_INT) :: tmp fails = 0 @@ -120,14 +119,15 @@ end function unit_tests integer(C_INT) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding - use test_utilities - implicit none - type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + + + + type(N_Vector) :: x, y + real(C_DOUBLE) :: tol, maxerr + integer(kind=myindextype) :: i, xlen, ylen + real(C_DOUBLE), pointer :: xdata(:), ydata(:) failure = 0 diff --git a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 index 360e3c73d8..c46d15a3b3 100644 --- a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 +++ b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 @@ -20,7 +20,7 @@ module test_fsunlinsol_klu use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 300 + integer(kind=myindextype), private, parameter :: N = 300 contains @@ -43,7 +43,7 @@ integer(C_INT) function unit_tests() result(fails) real(C_DOUBLE), pointer :: colj(:) ! matrix column data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j, k, i + integer(kind=myindextype) :: j, k, i integer(C_INT) :: tmp fails = 0 diff --git a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 index 3751dd2a76..387a126399 100644 --- a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 +++ b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 @@ -20,7 +20,9 @@ module test_fsunlinsol_lapackdense use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 contains @@ -42,7 +44,7 @@ integer(C_INT) function unit_tests() result(fails) real(C_DOUBLE), pointer :: colj(:), colIj(:) ! matrix column data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j, k + integer(kind=myindextype) :: j, k integer(C_INT) :: tmp fails = 0 diff --git a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 index e874047354..f1c22e2ad9 100644 --- a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 +++ b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 @@ -25,13 +25,15 @@ module test_fsunlinsol_pcg_serial use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(C_INT), private, parameter :: maxl = 500 ! maxium Krylov subspace dimension (> 0) real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData - integer(C_LONG) :: N + integer(kind=myindextype) :: N type(N_Vector), pointer :: d, s end type @@ -55,7 +57,7 @@ integer(C_INT) function unit_tests() result(fails) type(UserData), pointer :: probdata ! problem data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j + integer(kind=myindextype) :: j integer(C_INT) :: tmp ! setup diff --git a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 index 5e44e48df2..12941ec00c 100644 --- a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 +++ b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 @@ -25,13 +25,15 @@ module test_fsunlinsol_spbcgs_serial use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData - integer(C_LONG) :: N + integer(kind=myindextype) :: N type(N_Vector), pointer :: d, s1, s2 end type @@ -54,7 +56,7 @@ integer(C_INT) function unit_tests() result(fails) type(UserData), pointer :: probdata ! problem data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j + integer(kind=myindextype) :: j integer(C_INT) :: tmp ! setup diff --git a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 index 9a1792a7f1..aa5066aed7 100644 --- a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 +++ b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 @@ -21,18 +21,19 @@ module test_fsunlinsol_spfgmr_serial use, intrinsic :: iso_c_binding - use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(C_INT), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData - integer(C_LONG) :: N + integer(kind=myindextype) :: N type(N_Vector), pointer :: d, s1, s2 end type @@ -40,9 +41,6 @@ module test_fsunlinsol_spfgmr_serial integer(C_INT) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - - use fnvector_serial_mod use fsunlinsol_spfgmr_mod use test_sunlinsol @@ -55,7 +53,7 @@ integer(C_INT) function unit_tests() result(fails) type(UserData), pointer :: probdata ! problem data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j + integer(kind=myindextype) :: j integer(C_INT) :: tmp ! setup diff --git a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 index e0de52a8bd..9f72112a41 100644 --- a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 +++ b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 @@ -21,18 +21,19 @@ module test_fsunlinsol_spgmr_serial use, intrinsic :: iso_c_binding - use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(C_INT), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData - integer(C_LONG) :: N + integer(kind=myindextype) :: N type(N_Vector), pointer :: d, s1, s2 end type @@ -40,9 +41,6 @@ module test_fsunlinsol_spgmr_serial integer(C_INT) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - - use fnvector_serial_mod use fsunlinsol_spgmr_mod use test_sunlinsol @@ -55,7 +53,7 @@ integer(C_INT) function unit_tests() result(fails) type(UserData), pointer :: probdata ! problem data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j + integer(kind=myindextype) :: j integer(C_INT) :: tmp ! setup @@ -257,13 +255,13 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & implicit none - type(C_PTR), value :: udata - type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr - type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:) - integer(C_LONG) :: i, N + type(C_PTR), value :: udata + type(N_Vector) :: rvec, zvec + real(C_DOUBLE) :: tol + integer(C_INT) :: lr + type(UserData), pointer :: probdata + real(C_DOUBLE), pointer :: r(:), z(:), d(:) + integer(kind=myindextype) :: i, N call c_f_pointer(udata, probdata) @@ -285,11 +283,11 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_spgmr_serial use test_utilities - implicit none + type(N_Vector) :: x, y real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen + integer(kind=myindextype) :: i, xlen, ylen real(C_DOUBLE), pointer :: xdata(:), ydata(:) failure = 0 diff --git a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 index 055809c074..ea6d19df35 100644 --- a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 +++ b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 @@ -25,13 +25,15 @@ module test_fsunlinsol_sptfqmr_serial use test_utilities implicit none - integer(C_LONG), private, parameter :: N = 100 + + + integer(kind=myindextype), private, parameter :: N = 100 integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData - integer(C_LONG) :: N + integer(kind=myindextype) :: N type(N_Vector), pointer :: d, s1, s2 end type @@ -54,7 +56,7 @@ integer(C_INT) function unit_tests() result(fails) type(UserData), pointer :: probdata ! problem data real(C_DOUBLE), pointer :: xdata(:) ! x vector data real(C_DOUBLE) :: tmpr ! temporary real value - integer(C_LONG) :: j + integer(kind=myindextype) :: j integer(C_INT) :: tmp ! setup diff --git a/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 index 8ebc559680..3fc4bff7a4 100644 --- a/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 +++ b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 @@ -20,9 +20,11 @@ module test_fsunmatrix_band use test_utilities implicit none - integer(C_LONG), parameter :: N = 10 - integer(C_LONG), parameter :: mu = 2 - integer(C_LONG), parameter :: ml = 2 + + + integer(kind=myindextype), parameter :: N = 10 + integer(kind=myindextype), parameter :: mu = 2 + integer(kind=myindextype), parameter :: ml = 2 contains @@ -105,15 +107,15 @@ integer(C_INT) function unit_tests() result(fails) implicit none - type(SUNMatrix), pointer :: A, I - type(N_Vector), pointer :: x, y - real(C_DOUBLE), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) - integer(C_LONG) :: ii, jj, smu, istart, iend, offset + type(SUNMatrix), pointer :: A, I + type(N_Vector), pointer :: x, y + real(C_DOUBLE), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) + integer(kind=myindextype) :: ii, jj, smu, istart, iend, offset fails = 0 A => FSUNBandMatrix(N, mu, ml, sunctx) - I => FSUNBandMatrix(N, 0_8, 0_8, sunctx) + I => FSUNBandMatrix(N, 0_myindextype, 0_myindextype, sunctx) x => FN_VNew_Serial(N, sunctx) y => FN_VNew_Serial(N, sunctx) @@ -144,7 +146,7 @@ integer(C_INT) function unit_tests() result(fails) xdata(jj+1) = jj ! y vector ydata(jj+1) = ZERO - istart = max(0_c_long, jj-ml) + istart = max(0_myindextype, jj-ml) iend = min(N-1, jj+mu) do ii = istart, iend ydata(jj+1) = ydata(jj+1) + (ii+ii-jj)*(ii) diff --git a/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 index 35ecd897e7..87cac2dff5 100644 --- a/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 +++ b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 @@ -20,7 +20,7 @@ module test_fsunmatrix_dense use test_utilities implicit none - integer(C_LONG), parameter :: N = 4 + integer(kind=myindextype), parameter :: N = 4 contains @@ -190,10 +190,12 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) implicit none + + type(SUNMatrix) :: A, B real(C_DOUBLE) :: tol real(C_DOUBLE), pointer :: Adata(:), Bdata(:) - integer(C_LONG) :: Aldata, Bldata, i + integer(kind=myindextype) :: Aldata, Bldata, i fails = 0 diff --git a/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 index 740cc82a39..3283cd637e 100644 --- a/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 +++ b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 @@ -20,7 +20,7 @@ module test_fsunmatrix_sparse use test_utilities implicit none - integer(C_LONG), parameter :: N = 5 + integer(kind=myindextype), parameter :: N = 5 contains @@ -37,14 +37,14 @@ integer(C_INT) function smoke_tests() result(fails) implicit none ! local variables - type(SUNMatrix), pointer :: A, B ! SUNMatrix - type(N_Vector), pointer :: x, y ! NVectors - real(C_DOUBLE), pointer :: matdat(:) ! matrix data pointer - integer(C_LONG), pointer :: inddat(:) ! indices pointer - integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size + type(SUNMatrix), pointer :: A, B ! SUNMatrix + type(N_Vector), pointer :: x, y ! NVectors + real(C_DOUBLE), pointer :: matdat(:) ! matrix data pointer + integer(kind=myindextype), pointer :: inddat(:) ! indices pointer + integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size - integer(C_LONG) :: tmp1 - integer(C_INT) :: tmp2 + integer(kind=myindextype) :: tmp1 + integer(C_INT) :: tmp2 fails = 0 @@ -206,12 +206,13 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) implicit none - type(SUNMatrix) :: A, B - real(C_DOUBLE) :: tol - real(C_DOUBLE), pointer :: Adata(:), Bdata(:) - integer(C_LONG), pointer :: Aidxvals(:), Bidxvals(:) - integer(C_LONG), pointer :: Aidxptrs(:), Bidxptrs(:) - integer(C_LONG) :: i, np, Annz, Bnnz + + type(SUNMatrix) :: A, B + real(C_DOUBLE) :: tol + real(C_DOUBLE), pointer :: Adata(:), Bdata(:) + integer(kind=myindextype), pointer :: Aidxvals(:), Bidxvals(:) + integer(kind=myindextype), pointer :: Aidxptrs(:), Bidxptrs(:) + integer(kind=myindextype) :: i, np, Annz, Bnnz fails = 0 @@ -292,11 +293,11 @@ integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) implicit none - type(SUNMatrix) :: A - real(C_DOUBLE) :: c, tol - real(C_DOUBLE), pointer :: Adata(:) - integer(C_LONG), pointer :: Aidxptrs(:) - integer(C_LONG) :: i, np + type(SUNMatrix) :: A + real(C_DOUBLE) :: c, tol + real(C_DOUBLE), pointer :: Adata(:) + integer(kind=myindextype), pointer :: Aidxptrs(:) + integer(kind=myindextype) :: i, np fails = 0 diff --git a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 index bedf8684c2..90213440af 100644 --- a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 +++ b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 @@ -21,7 +21,7 @@ module test_fsunnonlinsol_fixedpoint implicit none - integer(C_LONG), parameter :: NEQ = 3 ! number of equations + integer(kind=myindextype), parameter :: NEQ = 3 ! number of equations integer(C_INT), parameter :: MAXIT = 10 ! max nonlinear iters. real(C_DOUBLE), parameter :: TOL = 1.0e-4 ! nonlinear solver tolerance diff --git a/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 index 6f9716979c..9308fa902f 100644 --- a/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 +++ b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 @@ -17,14 +17,11 @@ module test_fsunnonlinsol_newton use, intrinsic :: iso_c_binding - - - use test_utilities implicit none - integer(C_LONG), parameter :: NEQ = 3 ! number of equations + integer(kind=myindextype), parameter :: NEQ = 3 ! number of equations integer(C_INT), parameter :: MAXIT = 10 ! max nonlinear iters. real(C_DOUBLE), parameter :: TOL = 1.0e-2 ! nonlinear solver tolerance diff --git a/examples/templates/cmakelists_openmp_F2003_ex.in b/examples/templates/cmakelists_openmp_F2003_ex.in index cf351be2a7..f8c099048c 100644 --- a/examples/templates/cmakelists_openmp_F2003_ex.in +++ b/examples/templates/cmakelists_openmp_F2003_ex.in @@ -33,6 +33,9 @@ set(CMAKE_Fortran_FLAGS # Specify project name and languages project(@SOLVER@_F2003_openmp_examples Fortran) +# Fortran preprocessor must be enabled +set(CMAKE_Fortran_PREPROCESS ON) + # Enable testing include(CTest) @@ -147,6 +150,8 @@ foreach(example ${examples}) # libraries to link against target_link_libraries(${example_target} ${SUNDIALS_LIBRARIES}) + target_compile_definitions(${example_target} PRIVATE SUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T) + # add the example to ctest add_test(NAME ${example_target} COMMAND ${example_target}) diff --git a/examples/templates/cmakelists_parallel_F2003_ex.in b/examples/templates/cmakelists_parallel_F2003_ex.in index 1d5670752f..5fc13f1bc0 100644 --- a/examples/templates/cmakelists_parallel_F2003_ex.in +++ b/examples/templates/cmakelists_parallel_F2003_ex.in @@ -24,6 +24,9 @@ set(CMAKE_Fortran_FLAGS "@CMAKE_Fortran_FLAGS@" CACHE STRING "Fortran compiler flags") +# Fortran preprocessor must be enabled +set(CMAKE_Fortran_PREPROCESS ON) + # Set cache variables for C compilers and flags set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" @@ -106,6 +109,8 @@ foreach(example ${examples}) # libraries to link against target_link_libraries(${example} ${LIBRARIES}) + target_compile_definitions(${example} PRIVATE SUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T) + # add the example to ctest add_test(NAME ${example} COMMAND ${example}) diff --git a/examples/templates/cmakelists_serial_F2003_ex.in b/examples/templates/cmakelists_serial_F2003_ex.in index bd59966da3..fdc2568027 100644 --- a/examples/templates/cmakelists_serial_F2003_ex.in +++ b/examples/templates/cmakelists_serial_F2003_ex.in @@ -32,6 +32,9 @@ set(CMAKE_Fortran_FLAGS # Specify project name and languages project(@SOLVER@_F2003_examples Fortran) +# Fortran preprocessor must be enabled +set(CMAKE_Fortran_PREPROCESS ON) + # Enable testing include(CTest) @@ -143,6 +146,8 @@ foreach(example ${examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBRARIES}) + target_compile_definitions(${example} PRIVATE SUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T) + # add the example to ctest add_test(NAME ${example} COMMAND ${example}) @@ -184,6 +189,8 @@ if(KLU_LIBRARIES AND examples_klu) target_link_libraries(${example} ${SUNDIALS_LIBRARIES}) target_link_libraries(${example} ${KLU_LIBRARIES}) + target_compile_definitions(${example} PRIVATE SUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T) + # add the example to ctest add_test(NAME ${example} COMMAND ${example}) diff --git a/examples/templates/makefile_openmp_F2003_ex.in b/examples/templates/makefile_openmp_F2003_ex.in index 16ca3499cf..f1f8152e4a 100644 --- a/examples/templates/makefile_openmp_F2003_ex.in +++ b/examples/templates/makefile_openmp_F2003_ex.in @@ -26,7 +26,7 @@ includedir = ${prefix}/@Fortran_INSTALL_MODDIR@ libdir = ${prefix}/@CMAKE_INSTALL_LIBDIR@ F90 = @_EXAMPLES_Fortran_COMPILER@ -F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ @OpenMP_Fortran_FLAGS@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ @OpenMP_Fortran_FLAGS@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ F90LIBS = @LIBS@ # ----------------------------------------------------------------------------------------- diff --git a/examples/templates/makefile_parallel_F2003_ex.in b/examples/templates/makefile_parallel_F2003_ex.in index e54328fb74..071b0c4cbc 100644 --- a/examples/templates/makefile_parallel_F2003_ex.in +++ b/examples/templates/makefile_parallel_F2003_ex.in @@ -19,7 +19,7 @@ # ----------------------------------------------------------------- F90 = @MPI_Fortran_COMPILER@ -F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ F90LIBS = @LIBS@ SUNDIALS_PREFIX = @CMAKE_INSTALL_PREFIX@ diff --git a/examples/templates/makefile_serial_F2003_ex.in b/examples/templates/makefile_serial_F2003_ex.in index fb08ffe4d7..d77f5368d1 100644 --- a/examples/templates/makefile_serial_F2003_ex.in +++ b/examples/templates/makefile_serial_F2003_ex.in @@ -26,7 +26,7 @@ includedir = ${prefix}/@Fortran_INSTALL_MODDIR@ libdir = ${prefix}/@CMAKE_INSTALL_LIBDIR@ F90 = @_EXAMPLES_Fortran_COMPILER@ -F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ +F90FLAGS = @CMAKE_Fortran_FLAGS_RELEASE@ -DSUNDIALS_INT@SUNDIALS_INDEX_SIZE@_T @CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON@ F90LIBS = @LIBS@ # ------------------------------------------------------------------------------ diff --git a/examples/utilities/test_utilities.f90 b/examples/utilities/test_utilities.f90 index 69a0161487..dc5abe7587 100644 --- a/examples/utilities/test_utilities.f90 +++ b/examples/utilities/test_utilities.f90 @@ -20,6 +20,16 @@ module test_utilities use fsundials_core_mod implicit none + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + real(C_DOUBLE), parameter :: SUN_UNIT_ROUNDOFF = epsilon(1.0d0) real(C_DOUBLE) :: NEG_TWO = -2.0d0 diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index f430d53930..267bc89a33 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -104,7 +104,7 @@ message(STATUS "Added ARKODE module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() # Add ARKODE XBraid interface diff --git a/src/arkode/fmod/CMakeLists.txt b/src/arkode/fmod_int32/CMakeLists.txt similarity index 100% rename from src/arkode/fmod/CMakeLists.txt rename to src/arkode/fmod_int32/CMakeLists.txt diff --git a/src/arkode/fmod/farkode_arkstep_mod.c b/src/arkode/fmod_int32/farkode_arkstep_mod.c similarity index 100% rename from src/arkode/fmod/farkode_arkstep_mod.c rename to src/arkode/fmod_int32/farkode_arkstep_mod.c diff --git a/src/arkode/fmod/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 similarity index 100% rename from src/arkode/fmod/farkode_arkstep_mod.f90 rename to src/arkode/fmod_int32/farkode_arkstep_mod.f90 diff --git a/src/arkode/fmod/farkode_erkstep_mod.c b/src/arkode/fmod_int32/farkode_erkstep_mod.c similarity index 100% rename from src/arkode/fmod/farkode_erkstep_mod.c rename to src/arkode/fmod_int32/farkode_erkstep_mod.c diff --git a/src/arkode/fmod/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 similarity index 100% rename from src/arkode/fmod/farkode_erkstep_mod.f90 rename to src/arkode/fmod_int32/farkode_erkstep_mod.f90 diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c new file mode 100644 index 0000000000..1423d2e582 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -0,0 +1,3246 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "arkode/arkode.h" +#include "arkode/arkode_bandpre.h" +#include "arkode/arkode_bbdpre.h" +#include "arkode/arkode_butcher.h" +#include "arkode/arkode_butcher_dirk.h" +#include "arkode/arkode_butcher_erk.h" +#include "arkode/arkode_sprk.h" +#include "arkode/arkode_ls.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT int _wrap_FARKodeResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ARKodeResize(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeWFtolerances(void *farg1, ARKEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKEwtFn arg2 = (ARKEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKEwtFn)(farg2); + result = (int)ARKodeWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResStolerance(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeResStolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResVtolerance(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeResVtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResFtolerance(void *farg1, ARKRwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRwtFn arg2 = (ARKRwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRwtFn)(farg2); + result = (int)ARKodeResFtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)ARKodeRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKodeSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKodeSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)ARKodeSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKodeSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)ARKodeSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinear(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLinear(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinear(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeSetNonlinear(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetAutonomous(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetAutonomous(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKodeSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDeduceImplicitRhs(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetDeduceImplicitRhs(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinCRDown(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinCRDown(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinRDiv(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinRDiv(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetDeltaGammaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetDeltaGammaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLSetupFrequency(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPredictorMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetPredictorMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKStagePredictFn)(farg2); + result = (int)ARKodeSetStagePredictFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetAdaptController(void *farg1, SUNAdaptController farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdaptController)(farg2); + result = (int)ARKodeSetAdaptController(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetAdaptivityAdjustment(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetAdaptivityAdjustment(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetCFLFraction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetCFLFraction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetErrorBias(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetErrorBias(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMinReduction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMinReduction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSetFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxFirstGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxFirstGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxEFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxEFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetSmallNumEFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetSmallNumEFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxCFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxCFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKExpStabFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ARKodeSetStabilityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetMaxNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)ARKodeEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ARKodeGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKodeComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumStepAttempts(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKodeGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)ARKodeGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodePrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)ARKodePrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ARKodeWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumExpSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumExpSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumAccSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumAccSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumConstrFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)ARKodeGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)ARKodeGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (void **)(farg8); + result = (int)ARKodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKodeGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKodeGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetCurrentMassMatrix(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKodeGetCurrentMassMatrix(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetResWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKodeGetResWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetMassWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetMassWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassMultSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassMultSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassMult(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassMult(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMassConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMassConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumMTSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumMTSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetLastMassFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetLastMassFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FARKodeFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + ARKodeFree(arg1); +} + + +SWIGEXPORT void _wrap_FARKodePrintMem(void *farg1, void *farg2) { + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + ARKodePrintMem(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxFn arg2 = (ARKRelaxFn) 0 ; + ARKRelaxJacFn arg3 = (ARKRelaxJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxFn)(farg2); + arg3 = (ARKRelaxJacFn)(farg3); + result = (int)ARKodeSetRelaxFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxEtaFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxEtaFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxLowerBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxLowerBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxMaxFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetRelaxMaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxMaxIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetRelaxMaxIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxSolver(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxSolver arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxSolver)(*farg2); + result = (int)ARKodeSetRelaxSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxResTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxResTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxTol(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKodeSetRelaxTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetRelaxUpperBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetRelaxUpperBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxFnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxFnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxBoundFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxBoundFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKodeGetNumRelaxSolveIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBandPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + result = (int)ARKBandPrecInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBandPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKBandPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBandPrecGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKBandPrecGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, ARKLocalFn farg8, ARKCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + ARKLocalFn arg8 = (ARKLocalFn) 0 ; + ARKCommFn arg9 = (ARKCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (ARKLocalFn)(farg8); + arg9 = (ARKCommFn)(farg9); + result = (int)ARKBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBBDPrecReInit(void *farg1, int32_t const *farg2, int32_t const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)ARKBBDPrecReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKBBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKBBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKBBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_q_set(SwigClassWrapper const *farg1, int const *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::q", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->q = arg2; +} + + +SWIGEXPORT int _wrap_ARKodeButcherTableMem_q_get(SwigClassWrapper const *farg1) { + int fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::q", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (int) ((arg1)->q); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_p_set(SwigClassWrapper const *farg1, int const *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::p", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->p = arg2; +} + + +SWIGEXPORT int _wrap_ARKodeButcherTableMem_p_get(SwigClassWrapper const *farg1) { + int fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::p", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (int) ((arg1)->p); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_stages_set(SwigClassWrapper const *farg1, int const *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::stages", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->stages = arg2; +} + + +SWIGEXPORT int _wrap_ARKodeButcherTableMem_stages_get(SwigClassWrapper const *farg1) { + int fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::stages", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (int) ((arg1)->stages); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, void *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (sunrealtype **)(farg2); + if (arg1) (arg1)->A = arg2; +} + + +SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype **result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (sunrealtype **) ((arg1)->A); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, double *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->c = arg2; +} + + +SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->c); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, double *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->b = arg2; +} + + +SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->b); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, double *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->d = arg2; +} + + +SWIGEXPORT double * _wrap_ARKodeButcherTableMem_d_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return 0); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->d); + fresult = result; + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_ARKodeButcherTableMem() { + SwigClassWrapper fresult ; + struct ARKodeButcherTableMem *result = 0 ; + + result = (struct ARKodeButcherTableMem *)calloc(1, sizeof(struct ARKodeButcherTableMem)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_ARKodeButcherTableMem(SwigClassWrapper *farg1) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + + SWIG_check_mutable(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::~ARKodeButcherTableMem()", return ); + arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_ARKodeButcherTableMem_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; + struct ARKodeButcherTableMem *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_Alloc(int const *farg1, int const *farg2) { + void * fresult ; + int arg1 ; + int arg2 ; + ARKodeButcherTable result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + result = (ARKodeButcherTable)ARKodeButcherTable_Alloc(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_Create(int const *farg1, int const *farg2, int const *farg3, double *farg4, double *farg5, double *farg6, double *farg7) { + void * fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + ARKodeButcherTable result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); + result = (ARKodeButcherTable)ARKodeButcherTable_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_Copy(void *farg1) { + void * fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + ARKodeButcherTable result; + + arg1 = (ARKodeButcherTable)(farg1); + result = (ARKodeButcherTable)ARKodeButcherTable_Copy(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FARKodeButcherTable_Space(void *farg1, int32_t *farg2, int32_t *farg3) { + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (ARKodeButcherTable)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + ARKodeButcherTable_Space(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FARKodeButcherTable_Free(void *farg1) { + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + + arg1 = (ARKodeButcherTable)(farg1); + ARKodeButcherTable_Free(arg1); +} + + +SWIGEXPORT void _wrap_FARKodeButcherTable_Write(void *farg1, void *farg2) { + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (ARKodeButcherTable)(farg1); + arg2 = (FILE *)(farg2); + ARKodeButcherTable_Write(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FARKodeButcherTable_IsStifflyAccurate(void *farg1) { + int fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (ARKodeButcherTable)(farg1); + result = (int)ARKodeButcherTable_IsStifflyAccurate(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeButcherTable_CheckOrder(void *farg1, int *farg2, int *farg3, void *farg4) { + int fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + int *arg2 = (int *) 0 ; + int *arg3 = (int *) 0 ; + FILE *arg4 = (FILE *) 0 ; + int result; + + arg1 = (ARKodeButcherTable)(farg1); + arg2 = (int *)(farg2); + arg3 = (int *)(farg3); + arg4 = (FILE *)(farg4); + result = (int)ARKodeButcherTable_CheckOrder(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeButcherTable_CheckARKOrder(void *farg1, void *farg2, int *farg3, int *farg4, void *farg5) { + int fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + ARKodeButcherTable arg2 = (ARKodeButcherTable) 0 ; + int *arg3 = (int *) 0 ; + int *arg4 = (int *) 0 ; + FILE *arg5 = (FILE *) 0 ; + int result; + + arg1 = (ARKodeButcherTable)(farg1); + arg2 = (ARKodeButcherTable)(farg2); + arg3 = (int *)(farg3); + arg4 = (int *)(farg4); + arg5 = (FILE *)(farg5); + result = (int)ARKodeButcherTable_CheckARKOrder(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadDIRK(int const *farg1) { + void * fresult ; + ARKODE_DIRKTableID arg1 ; + ARKodeButcherTable result; + + arg1 = (ARKODE_DIRKTableID)(*farg1); + result = (ARKodeButcherTable)ARKodeButcherTable_LoadDIRK(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadDIRKByName(SwigArrayWrapper *farg1) { + void * fresult ; + char *arg1 = (char *) 0 ; + ARKodeButcherTable result; + + arg1 = (char *)(farg1->data); + result = (ARKodeButcherTable)ARKodeButcherTable_LoadDIRKByName((char const *)arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeButcherTable_DIRKIDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_DIRKTableID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_DIRKTableID)(*farg1); + result = (char *)ARKodeButcherTable_DIRKIDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadERK(int const *farg1) { + void * fresult ; + ARKODE_ERKTableID arg1 ; + ARKodeButcherTable result; + + arg1 = (ARKODE_ERKTableID)(*farg1); + result = (ARKodeButcherTable)ARKodeButcherTable_LoadERK(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeButcherTable_LoadERKByName(SwigArrayWrapper *farg1) { + void * fresult ; + char *arg1 = (char *) 0 ; + ARKodeButcherTable result; + + arg1 = (char *)(farg1->data); + result = (ARKodeButcherTable)ARKodeButcherTable_LoadERKByName((char const *)arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKodeButcherTable_ERKIDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_ERKTableID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_ERKTableID)(*farg1); + result = (char *)ARKodeButcherTable_ERKIDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeSPRKTableMem_q_set(SwigClassWrapper const *farg1, int const *farg2) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::q", return ); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->q = arg2; +} + + +SWIGEXPORT int _wrap_ARKodeSPRKTableMem_q_get(SwigClassWrapper const *farg1) { + int fresult ; + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::q", return 0); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + result = (int) ((arg1)->q); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeSPRKTableMem_stages_set(SwigClassWrapper const *farg1, int const *farg2) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::stages", return ); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->stages = arg2; +} + + +SWIGEXPORT int _wrap_ARKodeSPRKTableMem_stages_get(SwigClassWrapper const *farg1) { + int fresult ; + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::stages", return 0); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + result = (int) ((arg1)->stages); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeSPRKTableMem_a_set(SwigClassWrapper const *farg1, double *farg2) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return ); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->a = arg2; +} + + +SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_a_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return 0); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->a); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_ARKodeSPRKTableMem_ahat_set(SwigClassWrapper const *farg1, double *farg2) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return ); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->ahat = arg2; +} + + +SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_ahat_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return 0); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->ahat); + fresult = result; + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_ARKodeSPRKTableMem() { + SwigClassWrapper fresult ; + struct ARKodeSPRKTableMem *result = 0 ; + + result = (struct ARKodeSPRKTableMem *)calloc(1, sizeof(struct ARKodeSPRKTableMem)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_ARKodeSPRKTableMem(SwigClassWrapper *farg1) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + + SWIG_check_mutable(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::~ARKodeSPRKTableMem()", return ); + arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_ARKodeSPRKTableMem_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; + struct ARKodeSPRKTableMem *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT void * _wrap_FARKodeSPRKTable_Create(int const *farg1, int const *farg2, double *farg3, double *farg4) { + void * fresult ; + int arg1 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + ARKodeSPRKTable result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Create(arg1,arg2,(double const *)arg3,(double const *)arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeSPRKTable_Alloc(int const *farg1) { + void * fresult ; + int arg1 ; + ARKodeSPRKTable result; + + arg1 = (int)(*farg1); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Alloc(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeSPRKTable_Load(int const *farg1) { + void * fresult ; + ARKODE_SPRKMethodID arg1 ; + ARKodeSPRKTable result; + + arg1 = (ARKODE_SPRKMethodID)(*farg1); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Load(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeSPRKTable_LoadByName(SwigArrayWrapper *farg1) { + void * fresult ; + char *arg1 = (char *) 0 ; + ARKodeSPRKTable result; + + arg1 = (char *)(farg1->data); + result = (ARKodeSPRKTable)ARKodeSPRKTable_LoadByName((char const *)arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FARKodeSPRKTable_Copy(void *farg1) { + void * fresult ; + ARKodeSPRKTable arg1 = (ARKodeSPRKTable) 0 ; + ARKodeSPRKTable result; + + arg1 = (ARKodeSPRKTable)(farg1); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Copy(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FARKodeSPRKTable_Write(void *farg1, void *farg2) { + ARKodeSPRKTable arg1 = (ARKodeSPRKTable) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (ARKodeSPRKTable)(farg1); + arg2 = (FILE *)(farg2); + ARKodeSPRKTable_Write(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FARKodeSPRKTable_Space(void *farg1, int32_t *farg2, int32_t *farg3) { + ARKodeSPRKTable arg1 = (ARKodeSPRKTable) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (ARKodeSPRKTable)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + ARKodeSPRKTable_Space(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FARKodeSPRKTable_Free(void *farg1) { + ARKodeSPRKTable arg1 = (ARKodeSPRKTable) 0 ; + + arg1 = (ARKodeSPRKTable)(farg1); + ARKodeSPRKTable_Free(arg1); +} + + +SWIGEXPORT int _wrap_FARKodeSPRKTable_ToButcher(void *farg1, void *farg2, void *farg3) { + int fresult ; + ARKodeSPRKTable arg1 = (ARKodeSPRKTable) 0 ; + ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; + ARKodeButcherTable *arg3 = (ARKodeButcherTable *) 0 ; + int result; + + arg1 = (ARKodeSPRKTable)(farg1); + arg2 = (ARKodeButcherTable *)(farg2); + arg3 = (ARKodeButcherTable *)(farg3); + result = (int)ARKodeSPRKTable_ToButcher(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)ARKodeSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3, int const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + arg4 = (int)(*farg4); + result = (int)ARKodeSetMassLinearSolver(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacFn(void *farg1, ARKLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacFn arg2 = (ARKLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacFn)(farg2); + result = (int)ARKodeSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassFn(void *farg1, ARKLsMassFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassFn arg2 = (ARKLsMassFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassFn)(farg2); + result = (int)ARKodeSetMassFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKodeSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKodeSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMassEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetMassLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetPreconditioner(void *farg1, ARKLsPrecSetupFn farg2, ARKLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsPrecSetupFn arg2 = (ARKLsPrecSetupFn) 0 ; + ARKLsPrecSolveFn arg3 = (ARKLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsPrecSetupFn)(farg2); + arg3 = (ARKLsPrecSolveFn)(farg3); + result = (int)ARKodeSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassPreconditioner(void *farg1, ARKLsMassPrecSetupFn farg2, ARKLsMassPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassPrecSetupFn arg2 = (ARKLsMassPrecSetupFn) 0 ; + ARKLsMassPrecSolveFn arg3 = (ARKLsMassPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassPrecSetupFn)(farg2); + arg3 = (ARKLsMassPrecSolveFn)(farg3); + result = (int)ARKodeSetMassPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacTimes(void *farg1, ARKLsJacTimesSetupFn farg2, ARKLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacTimesSetupFn arg2 = (ARKLsJacTimesSetupFn) 0 ; + ARKLsJacTimesVecFn arg3 = (ARKLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacTimesSetupFn)(farg2); + arg3 = (ARKLsJacTimesVecFn)(farg3); + result = (int)ARKodeSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetJacTimesRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKodeSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetMassTimes(void *farg1, ARKLsMassTimesSetupFn farg2, ARKLsMassTimesVecFn farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassTimesSetupFn arg2 = (ARKLsMassTimesSetupFn) 0 ; + ARKLsMassTimesVecFn arg3 = (ARKLsMassTimesVecFn) 0 ; + void *arg4 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassTimesSetupFn)(farg2); + arg3 = (ARKLsMassTimesVecFn)(farg3); + arg4 = (void *)(farg4); + result = (int)ARKodeSetMassTimes(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsLinSysFn arg2 = (ARKLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsLinSysFn)(farg2); + result = (int)ARKodeSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 new file mode 100644 index 0000000000..366867f40a --- /dev/null +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -0,0 +1,5769 @@ +! 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-2024, 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 farkode_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: ARK_NORMAL = 1_C_INT + integer(C_INT), parameter, public :: ARK_ONE_STEP = 2_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_CUSTOM = -1_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_PID = 0_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_PI = 1_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_I = 2_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_EXP_GUS = 3_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_IMP_GUS = 4_C_INT + integer(C_INT), parameter, public :: ARK_ADAPT_IMEX_GUS = 5_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_START = 0_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_MAX_DEGREE = 5_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_NONE = -1_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_HERMITE = 0_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_LAGRANGE = 1_C_INT + integer(C_INT), parameter, public :: ARK_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: ARK_TSTOP_RETURN = 1_C_INT + integer(C_INT), parameter, public :: ARK_ROOT_RETURN = 2_C_INT + integer(C_INT), parameter, public :: ARK_WARNING = 99_C_INT + integer(C_INT), parameter, public :: ARK_TOO_MUCH_WORK = -1_C_INT + integer(C_INT), parameter, public :: ARK_TOO_MUCH_ACC = -2_C_INT + integer(C_INT), parameter, public :: ARK_ERR_FAILURE = -3_C_INT + integer(C_INT), parameter, public :: ARK_CONV_FAILURE = -4_C_INT + integer(C_INT), parameter, public :: ARK_LINIT_FAIL = -5_C_INT + integer(C_INT), parameter, public :: ARK_LSETUP_FAIL = -6_C_INT + integer(C_INT), parameter, public :: ARK_LSOLVE_FAIL = -7_C_INT + integer(C_INT), parameter, public :: ARK_RHSFUNC_FAIL = -8_C_INT + integer(C_INT), parameter, public :: ARK_FIRST_RHSFUNC_ERR = -9_C_INT + integer(C_INT), parameter, public :: ARK_REPTD_RHSFUNC_ERR = -10_C_INT + integer(C_INT), parameter, public :: ARK_UNREC_RHSFUNC_ERR = -11_C_INT + integer(C_INT), parameter, public :: ARK_RTFUNC_FAIL = -12_C_INT + integer(C_INT), parameter, public :: ARK_LFREE_FAIL = -13_C_INT + integer(C_INT), parameter, public :: ARK_MASSINIT_FAIL = -14_C_INT + integer(C_INT), parameter, public :: ARK_MASSSETUP_FAIL = -15_C_INT + integer(C_INT), parameter, public :: ARK_MASSSOLVE_FAIL = -16_C_INT + integer(C_INT), parameter, public :: ARK_MASSFREE_FAIL = -17_C_INT + integer(C_INT), parameter, public :: ARK_MASSMULT_FAIL = -18_C_INT + integer(C_INT), parameter, public :: ARK_CONSTR_FAIL = -19_C_INT + integer(C_INT), parameter, public :: ARK_MEM_FAIL = -20_C_INT + integer(C_INT), parameter, public :: ARK_MEM_NULL = -21_C_INT + integer(C_INT), parameter, public :: ARK_ILL_INPUT = -22_C_INT + integer(C_INT), parameter, public :: ARK_NO_MALLOC = -23_C_INT + integer(C_INT), parameter, public :: ARK_BAD_K = -24_C_INT + integer(C_INT), parameter, public :: ARK_BAD_T = -25_C_INT + integer(C_INT), parameter, public :: ARK_BAD_DKY = -26_C_INT + integer(C_INT), parameter, public :: ARK_TOO_CLOSE = -27_C_INT + integer(C_INT), parameter, public :: ARK_VECTOROP_ERR = -28_C_INT + integer(C_INT), parameter, public :: ARK_NLS_INIT_FAIL = -29_C_INT + integer(C_INT), parameter, public :: ARK_NLS_SETUP_FAIL = -30_C_INT + integer(C_INT), parameter, public :: ARK_NLS_SETUP_RECVR = -31_C_INT + integer(C_INT), parameter, public :: ARK_NLS_OP_ERR = -32_C_INT + integer(C_INT), parameter, public :: ARK_INNERSTEP_ATTACH_ERR = -33_C_INT + integer(C_INT), parameter, public :: ARK_INNERSTEP_FAIL = -34_C_INT + integer(C_INT), parameter, public :: ARK_OUTERTOINNER_FAIL = -35_C_INT + integer(C_INT), parameter, public :: ARK_INNERTOOUTER_FAIL = -36_C_INT + integer(C_INT), parameter, public :: ARK_POSTPROCESS_FAIL = -37_C_INT + integer(C_INT), parameter, public :: ARK_POSTPROCESS_STEP_FAIL = -37_C_INT + integer(C_INT), parameter, public :: ARK_POSTPROCESS_STAGE_FAIL = -38_C_INT + integer(C_INT), parameter, public :: ARK_USER_PREDICT_FAIL = -39_C_INT + integer(C_INT), parameter, public :: ARK_INTERP_FAIL = -40_C_INT + integer(C_INT), parameter, public :: ARK_INVALID_TABLE = -41_C_INT + integer(C_INT), parameter, public :: ARK_CONTEXT_ERR = -42_C_INT + integer(C_INT), parameter, public :: ARK_RELAX_FAIL = -43_C_INT + 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_STEPPER_UNSUPPORTED = -48_C_INT + integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT + ! typedef enum ARKRelaxSolver + enum, bind(c) + enumerator :: ARK_RELAX_BRENT + enumerator :: ARK_RELAX_NEWTON + end enum + integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) + public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON + public :: FARKodeResize + public :: FARKodeReset + public :: FARKodeSStolerances + public :: FARKodeSVtolerances + public :: FARKodeWFtolerances + public :: FARKodeResStolerance + public :: FARKodeResVtolerance + public :: FARKodeResFtolerance + public :: FARKodeRootInit + public :: FARKodeSetRootDirection + public :: FARKodeSetNoInactiveRootWarn + public :: FARKodeSetDefaults + public :: FARKodeSetOrder + public :: FARKodeSetInterpolantType + public :: FARKodeSetInterpolantDegree + public :: FARKodeSetMaxNumSteps + public :: FARKodeSetInterpolateStopTime + public :: FARKodeSetStopTime + public :: FARKodeClearStopTime + public :: FARKodeSetFixedStep + public :: FARKodeSetUserData + public :: FARKodeSetPostprocessStepFn + public :: FARKodeSetPostprocessStageFn + public :: FARKodeSetNonlinearSolver + public :: FARKodeSetLinear + public :: FARKodeSetNonlinear + public :: FARKodeSetAutonomous + public :: FARKodeSetNlsRhsFn + public :: FARKodeSetDeduceImplicitRhs + public :: FARKodeSetNonlinCRDown + public :: FARKodeSetNonlinRDiv + public :: FARKodeSetDeltaGammaMax + public :: FARKodeSetLSetupFrequency + public :: FARKodeSetPredictorMethod + public :: FARKodeSetMaxNonlinIters + public :: FARKodeSetMaxConvFails + public :: FARKodeSetNonlinConvCoef + public :: FARKodeSetStagePredictFn + public :: FARKodeSetAdaptController + public :: FARKodeSetAdaptivityAdjustment + public :: FARKodeSetCFLFraction + public :: FARKodeSetErrorBias + public :: FARKodeSetSafetyFactor + public :: FARKodeSetMaxGrowth + public :: FARKodeSetMinReduction + public :: FARKodeSetFixedStepBounds + public :: FARKodeSetMaxFirstGrowth + public :: FARKodeSetMaxEFailGrowth + public :: FARKodeSetSmallNumEFails + public :: FARKodeSetMaxCFailGrowth + public :: FARKodeSetStabilityFn + public :: FARKodeSetMaxErrTestFails + public :: FARKodeSetConstraints + public :: FARKodeSetMaxHnilWarns + public :: FARKodeSetInitStep + public :: FARKodeSetMinStep + public :: FARKodeSetMaxStep + public :: FARKodeSetMaxNumConstrFails + public :: FARKodeEvolve + public :: FARKodeGetDky + public :: FARKodeComputeState + public :: FARKodeGetNumStepAttempts + public :: FARKodeGetWorkSpace + public :: FARKodeGetNumSteps + public :: FARKodeGetLastStep + public :: FARKodeGetCurrentStep + public :: FARKodeGetErrWeights + public :: FARKodeGetNumGEvals + public :: FARKodeGetRootInfo + public :: FARKodeGetUserData + public :: FARKodePrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FARKodeGetReturnFlagName + public :: FARKodeWriteParameters + public :: FARKodeGetNumExpSteps + public :: FARKodeGetNumAccSteps + public :: FARKodeGetNumErrTestFails + public :: FARKodeGetEstLocalErrors + public :: FARKodeGetActualInitStep + public :: FARKodeGetTolScaleFactor + public :: FARKodeGetNumConstrFails + public :: FARKodeGetStepStats + public :: FARKodeGetNumLinSolvSetups + public :: FARKodeGetCurrentTime + public :: FARKodeGetCurrentState + public :: FARKodeGetCurrentGamma + public :: FARKodeGetNonlinearSystemData + public :: FARKodeGetNumNonlinSolvIters + public :: FARKodeGetNumNonlinSolvConvFails + public :: FARKodeGetNonlinSolvStats + public :: FARKodeGetNumStepSolveFails + public :: FARKodeGetJac + public :: FARKodeGetJacTime + public :: FARKodeGetJacNumSteps + public :: FARKodeGetLinWorkSpace + public :: FARKodeGetNumJacEvals + public :: FARKodeGetNumPrecEvals + public :: FARKodeGetNumPrecSolves + public :: FARKodeGetNumLinIters + public :: FARKodeGetNumLinConvFails + public :: FARKodeGetNumJTSetupEvals + public :: FARKodeGetNumJtimesEvals + public :: FARKodeGetNumLinRhsEvals + public :: FARKodeGetLastLinFlag + public :: FARKodeGetLinReturnFlagName + public :: FARKodeGetCurrentMassMatrix + public :: FARKodeGetResWeights + public :: FARKodeGetMassWorkSpace + public :: FARKodeGetNumMassSetups + public :: FARKodeGetNumMassMultSetups + public :: FARKodeGetNumMassMult + public :: FARKodeGetNumMassSolves + public :: FARKodeGetNumMassPrecEvals + public :: FARKodeGetNumMassPrecSolves + public :: FARKodeGetNumMassIters + public :: FARKodeGetNumMassConvFails + public :: FARKodeGetNumMTSetups + public :: FARKodeGetLastMassFlag + public :: FARKodeFree + public :: FARKodePrintMem + public :: FARKodeSetRelaxFn + public :: FARKodeSetRelaxEtaFail + public :: FARKodeSetRelaxLowerBound + public :: FARKodeSetRelaxMaxFails + public :: FARKodeSetRelaxMaxIters + public :: FARKodeSetRelaxSolver + public :: FARKodeSetRelaxResTol + public :: FARKodeSetRelaxTol + public :: FARKodeSetRelaxUpperBound + public :: FARKodeGetNumRelaxFnEvals + public :: FARKodeGetNumRelaxJacEvals + public :: FARKodeGetNumRelaxFails + public :: FARKodeGetNumRelaxBoundFails + public :: FARKodeGetNumRelaxSolveFails + public :: FARKodeGetNumRelaxSolveIters + public :: FARKBandPrecInit + public :: FARKBandPrecGetWorkSpace + public :: FARKBandPrecGetNumRhsEvals + public :: FARKBBDPrecInit + public :: FARKBBDPrecReInit + public :: FARKBBDPrecGetWorkSpace + public :: FARKBBDPrecGetNumGfnEvals + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct ARKodeButcherTableMem + type, public :: ARKodeButcherTableMem + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_q => swigf_ARKodeButcherTableMem_q_set + procedure :: get_q => swigf_ARKodeButcherTableMem_q_get + procedure :: set_p => swigf_ARKodeButcherTableMem_p_set + procedure :: get_p => swigf_ARKodeButcherTableMem_p_get + procedure :: set_stages => swigf_ARKodeButcherTableMem_stages_set + procedure :: get_stages => swigf_ARKodeButcherTableMem_stages_get + procedure :: set_A => swigf_ARKodeButcherTableMem_A_set + procedure :: get_A => swigf_ARKodeButcherTableMem_A_get + procedure :: set_c => swigf_ARKodeButcherTableMem_c_set + procedure :: get_c => swigf_ARKodeButcherTableMem_c_get + procedure :: set_b => swigf_ARKodeButcherTableMem_b_set + procedure :: get_b => swigf_ARKodeButcherTableMem_b_get + procedure :: set_d => swigf_ARKodeButcherTableMem_d_set + procedure :: get_d => swigf_ARKodeButcherTableMem_d_get + procedure :: release => swigf_release_ARKodeButcherTableMem + procedure, private :: swigf_ARKodeButcherTableMem_op_assign__ + generic :: assignment(=) => swigf_ARKodeButcherTableMem_op_assign__ + end type ARKodeButcherTableMem + interface ARKodeButcherTableMem + module procedure swigf_create_ARKodeButcherTableMem + end interface + public :: FARKodeButcherTable_Alloc + public :: FARKodeButcherTable_Create + public :: FARKodeButcherTable_Copy + public :: FARKodeButcherTable_Space + public :: FARKodeButcherTable_Free + public :: FARKodeButcherTable_Write + public :: FARKodeButcherTable_IsStifflyAccurate + public :: FARKodeButcherTable_CheckOrder + public :: FARKodeButcherTable_CheckARKOrder + ! typedef enum ARKODE_DIRKTableID + enum, bind(c) + enumerator :: ARKODE_DIRK_NONE = -1 + enumerator :: ARKODE_MIN_DIRK_NUM = 100 + enumerator :: ARKODE_SDIRK_2_1_2 = ARKODE_MIN_DIRK_NUM + enumerator :: ARKODE_BILLINGTON_3_3_2 + enumerator :: ARKODE_TRBDF2_3_3_2 + enumerator :: ARKODE_KVAERNO_4_2_3 + enumerator :: ARKODE_ARK324L2SA_DIRK_4_2_3 + enumerator :: ARKODE_CASH_5_2_4 + enumerator :: ARKODE_CASH_5_3_4 + enumerator :: ARKODE_SDIRK_5_3_4 + enumerator :: ARKODE_KVAERNO_5_3_4 + enumerator :: ARKODE_ARK436L2SA_DIRK_6_3_4 + enumerator :: ARKODE_KVAERNO_7_4_5 + enumerator :: ARKODE_ARK548L2SA_DIRK_8_4_5 + enumerator :: ARKODE_ARK437L2SA_DIRK_7_3_4 + enumerator :: ARKODE_ARK548L2SAb_DIRK_8_4_5 + enumerator :: ARKODE_ESDIRK324L2SA_4_2_3 + enumerator :: ARKODE_ESDIRK325L2SA_5_2_3 + enumerator :: ARKODE_ESDIRK32I5L2SA_5_2_3 + enumerator :: ARKODE_ESDIRK436L2SA_6_3_4 + enumerator :: ARKODE_ESDIRK43I6L2SA_6_3_4 + enumerator :: ARKODE_QESDIRK436L2SA_6_3_4 + enumerator :: ARKODE_ESDIRK437L2SA_7_3_4 + enumerator :: ARKODE_ESDIRK547L2SA_7_4_5 + enumerator :: ARKODE_ESDIRK547L2SA2_7_4_5 + enumerator :: ARKODE_ARK2_DIRK_3_1_2 + enumerator :: ARKODE_BACKWARD_EULER_1_1 + enumerator :: ARKODE_IMPLICIT_MIDPOINT_1_2 + enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 + end enum + integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) + public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & + ARKODE_KVAERNO_4_2_3, ARKODE_ARK324L2SA_DIRK_4_2_3, ARKODE_CASH_5_2_4, ARKODE_CASH_5_3_4, ARKODE_SDIRK_5_3_4, & + ARKODE_KVAERNO_5_3_4, ARKODE_ARK436L2SA_DIRK_6_3_4, ARKODE_KVAERNO_7_4_5, ARKODE_ARK548L2SA_DIRK_8_4_5, & + ARKODE_ARK437L2SA_DIRK_7_3_4, ARKODE_ARK548L2SAb_DIRK_8_4_5, ARKODE_ESDIRK324L2SA_4_2_3, ARKODE_ESDIRK325L2SA_5_2_3, & + ARKODE_ESDIRK32I5L2SA_5_2_3, ARKODE_ESDIRK436L2SA_6_3_4, ARKODE_ESDIRK43I6L2SA_6_3_4, ARKODE_QESDIRK436L2SA_6_3_4, & + ARKODE_ESDIRK437L2SA_7_3_4, ARKODE_ESDIRK547L2SA_7_4_5, ARKODE_ESDIRK547L2SA2_7_4_5, ARKODE_ARK2_DIRK_3_1_2, & + ARKODE_BACKWARD_EULER_1_1, ARKODE_IMPLICIT_MIDPOINT_1_2, ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, ARKODE_MAX_DIRK_NUM + public :: FARKodeButcherTable_LoadDIRK + public :: FARKodeButcherTable_LoadDIRKByName + public :: FARKodeButcherTable_DIRKIDToName + ! typedef enum ARKODE_ERKTableID + enum, bind(c) + enumerator :: ARKODE_ERK_NONE = -1 + enumerator :: ARKODE_MIN_ERK_NUM = 0 + enumerator :: ARKODE_HEUN_EULER_2_1_2 = ARKODE_MIN_ERK_NUM + enumerator :: ARKODE_BOGACKI_SHAMPINE_4_2_3 + enumerator :: ARKODE_ARK324L2SA_ERK_4_2_3 + enumerator :: ARKODE_ZONNEVELD_5_3_4 + enumerator :: ARKODE_ARK436L2SA_ERK_6_3_4 + enumerator :: ARKODE_SAYFY_ABURUB_6_3_4 + enumerator :: ARKODE_CASH_KARP_6_4_5 + enumerator :: ARKODE_FEHLBERG_6_4_5 + enumerator :: ARKODE_DORMAND_PRINCE_7_4_5 + enumerator :: ARKODE_ARK548L2SA_ERK_8_4_5 + enumerator :: ARKODE_VERNER_8_5_6 + enumerator :: ARKODE_FEHLBERG_13_7_8 + enumerator :: ARKODE_KNOTH_WOLKE_3_3 + enumerator :: ARKODE_ARK437L2SA_ERK_7_3_4 + enumerator :: ARKODE_ARK548L2SAb_ERK_8_4_5 + enumerator :: 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_FORWARD_EULER_1_1 + enumerator :: ARKODE_RALSTON_EULER_2_1_2 + enumerator :: ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2 + 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_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_FORWARD_EULER_1_1, & + ARKODE_RALSTON_EULER_2_1_2, ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2, ARKODE_MAX_ERK_NUM + public :: FARKodeButcherTable_LoadERK + public :: FARKodeButcherTable_LoadERKByName + public :: FARKodeButcherTable_ERKIDToName + ! typedef enum ARKODE_SPRKMethodID + enum, bind(c) + enumerator :: ARKODE_SPRK_NONE = -1 + enumerator :: ARKODE_MIN_SPRK_NUM = 0 + enumerator :: ARKODE_SPRK_EULER_1_1 = ARKODE_MIN_SPRK_NUM + enumerator :: ARKODE_SPRK_LEAPFROG_2_2 + enumerator :: ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 + enumerator :: ARKODE_SPRK_RUTH_3_3 + enumerator :: ARKODE_SPRK_MCLACHLAN_2_2 + enumerator :: ARKODE_SPRK_MCLACHLAN_3_3 + enumerator :: ARKODE_SPRK_CANDY_ROZMUS_4_4 + enumerator :: ARKODE_SPRK_MCLACHLAN_4_4 + enumerator :: ARKODE_SPRK_MCLACHLAN_5_6 + enumerator :: ARKODE_SPRK_YOSHIDA_6_8 + enumerator :: ARKODE_SPRK_SUZUKI_UMENO_8_16 + enumerator :: ARKODE_SPRK_SOFRONIOU_10_36 + enumerator :: ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 + end enum + integer, parameter, public :: ARKODE_SPRKMethodID = kind(ARKODE_SPRK_NONE) + public :: ARKODE_SPRK_NONE, ARKODE_MIN_SPRK_NUM, ARKODE_SPRK_EULER_1_1, ARKODE_SPRK_LEAPFROG_2_2, & + ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, ARKODE_SPRK_MCLACHLAN_2_2, ARKODE_SPRK_MCLACHLAN_3_3, & + ARKODE_SPRK_CANDY_ROZMUS_4_4, ARKODE_SPRK_MCLACHLAN_4_4, ARKODE_SPRK_MCLACHLAN_5_6, ARKODE_SPRK_YOSHIDA_6_8, & + ARKODE_SPRK_SUZUKI_UMENO_8_16, ARKODE_SPRK_SOFRONIOU_10_36, ARKODE_MAX_SPRK_NUM + ! struct struct ARKodeSPRKTableMem + type, public :: ARKodeSPRKTableMem + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_q => swigf_ARKodeSPRKTableMem_q_set + procedure :: get_q => swigf_ARKodeSPRKTableMem_q_get + procedure :: set_stages => swigf_ARKodeSPRKTableMem_stages_set + procedure :: get_stages => swigf_ARKodeSPRKTableMem_stages_get + procedure :: set_a => swigf_ARKodeSPRKTableMem_a_set + procedure :: get_a => swigf_ARKodeSPRKTableMem_a_get + procedure :: set_ahat => swigf_ARKodeSPRKTableMem_ahat_set + procedure :: get_ahat => swigf_ARKodeSPRKTableMem_ahat_get + procedure :: release => swigf_release_ARKodeSPRKTableMem + procedure, private :: swigf_ARKodeSPRKTableMem_op_assign__ + generic :: assignment(=) => swigf_ARKodeSPRKTableMem_op_assign__ + end type ARKodeSPRKTableMem + interface ARKodeSPRKTableMem + module procedure swigf_create_ARKodeSPRKTableMem + end interface + public :: FARKodeSPRKTable_Create + public :: FARKodeSPRKTable_Alloc + public :: FARKodeSPRKTable_Load + public :: FARKodeSPRKTable_LoadByName + public :: FARKodeSPRKTable_Copy + public :: FARKodeSPRKTable_Write + public :: FARKodeSPRKTable_Space + public :: FARKodeSPRKTable_Free + public :: FARKodeSPRKTable_ToButcher + integer(C_INT), parameter, public :: ARKLS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: ARKLS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: ARKLS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: ARKLS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: ARKLS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: ARKLS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: ARKLS_MASSMEM_NULL = -6_C_INT + integer(C_INT), parameter, public :: ARKLS_JACFUNC_UNRECVR = -7_C_INT + integer(C_INT), parameter, public :: ARKLS_JACFUNC_RECVR = -8_C_INT + integer(C_INT), parameter, public :: ARKLS_MASSFUNC_UNRECVR = -9_C_INT + integer(C_INT), parameter, public :: ARKLS_MASSFUNC_RECVR = -10_C_INT + integer(C_INT), parameter, public :: ARKLS_SUNMAT_FAIL = -11_C_INT + integer(C_INT), parameter, public :: ARKLS_SUNLS_FAIL = -12_C_INT + public :: FARKodeSetLinearSolver + public :: FARKodeSetMassLinearSolver + public :: FARKodeSetJacFn + public :: FARKodeSetMassFn + public :: FARKodeSetJacEvalFrequency + public :: FARKodeSetLinearSolutionScaling + public :: FARKodeSetEpsLin + public :: FARKodeSetMassEpsLin + public :: FARKodeSetLSNormFactor + public :: FARKodeSetMassLSNormFactor + public :: FARKodeSetPreconditioner + public :: FARKodeSetMassPreconditioner + public :: FARKodeSetJacTimes + public :: FARKodeSetJacTimesRhsFn + public :: FARKodeSetMassTimes + public :: FARKodeSetLinSysFn + +! WRAPPER DECLARATIONS +interface +function swigc_FARKodeResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKodeResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSStolerances") & +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_FARKodeSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FARKodeWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeResStolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResStolerance") & +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_FARKodeResVtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResVtolerance") & +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_FARKodeResFtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKodeResFtolerance") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRootDirection") & +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_FARKodeSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FARKodeSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetDefaults(farg1) & +bind(C, name="_wrap_FARKodeSetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetOrder(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetOrder") & +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_FARKodeSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolantType") & +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_FARKodeSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolantDegree") & +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_FARKodeSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInterpolateStopTime") & +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_FARKodeSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStopTime") & +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_FARKodeClearStopTime(farg1) & +bind(C, name="_wrap_FARKodeClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetFixedStep") & +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_FARKodeSetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetUserData") & +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_FARKodeSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinearSolver") & +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_FARKodeSetLinear(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinear") & +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_FARKodeSetNonlinear(farg1) & +bind(C, name="_wrap_FARKodeSetNonlinear") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetAutonomous(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAutonomous") & +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_FARKodeSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNlsRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetDeduceImplicitRhs") & +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_FARKodeSetNonlinCRDown(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinCRDown") & +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_FARKodeSetNonlinRDiv(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinRDiv") & +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_FARKodeSetDeltaGammaMax(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetDeltaGammaMax") & +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_FARKodeSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLSetupFrequency") & +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_FARKodeSetPredictorMethod(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetPredictorMethod") & +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_FARKodeSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNonlinIters") & +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_FARKodeSetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxConvFails") & +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_FARKodeSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetNonlinConvCoef") & +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_FARKodeSetStagePredictFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStagePredictFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetAdaptController(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptController") & +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_FARKodeSetAdaptivityAdjustment(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAdaptivityAdjustment") & +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_FARKodeSetCFLFraction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetCFLFraction") & +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_FARKodeSetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetErrorBias") & +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_FARKodeSetSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSafetyFactor") & +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_FARKodeSetMaxGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxGrowth") & +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_FARKodeSetMinReduction(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinReduction") & +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_FARKodeSetFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetFixedStepBounds") & +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_FARKodeSetMaxFirstGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxFirstGrowth") & +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_FARKodeSetMaxEFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxEFailGrowth") & +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_FARKodeSetSmallNumEFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetSmallNumEFails") & +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_FARKodeSetMaxCFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxCFailGrowth") & +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_FARKodeSetStabilityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetStabilityFn") & +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_FARKodeSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxErrTestFails") & +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_FARKodeSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetConstraints") & +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_FARKodeSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxHnilWarns") & +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_FARKodeSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetInitStep") & +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_FARKodeSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMinStep") & +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_FARKodeSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxStep") & +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_FARKodeSetMaxNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMaxNumConstrFails") & +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_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKodeEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeComputeState") & +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_FARKodeGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumStepAttempts") & +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_FARKodeGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetWorkSpace") & +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_FARKodeGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumSteps") & +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_FARKodeGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastStep") & +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_FARKodeGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentStep") & +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_FARKodeGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetErrWeights") & +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_FARKodeGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumGEvals") & +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_FARKodeGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetRootInfo") & +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_FARKodeGetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetUserData") & +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_FARKodePrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodePrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FARKodeGetReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FARKodeWriteParameters") & +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_FARKodeGetNumExpSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumExpSteps") & +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_FARKodeGetNumAccSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumAccSteps") & +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_FARKodeGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumErrTestFails") & +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_FARKodeGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetEstLocalErrors") & +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_FARKodeGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetActualInitStep") & +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_FARKodeGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetTolScaleFactor") & +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_FARKodeGetNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumConstrFails") & +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_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKodeGetStepStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & +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_FARKodeGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentTime") & +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_FARKodeGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentState") & +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_FARKodeGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentGamma") & +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_FARKodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FARKodeGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumNonlinSolvIters") & +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_FARKodeGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumNonlinSolvConvFails") & +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_FARKodeGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetNonlinSolvStats") & +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_FARKodeGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumStepSolveFails") & +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_FARKodeGetJac(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJac") & +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_FARKodeGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJacTime") & +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_FARKodeGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetJacNumSteps") & +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_FARKodeGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetLinWorkSpace") & +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_FARKodeGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJacEvals") & +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_FARKodeGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumPrecEvals") & +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_FARKodeGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumPrecSolves") & +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_FARKodeGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinIters") & +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_FARKodeGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinConvFails") & +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_FARKodeGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJTSetupEvals") & +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_FARKodeGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumJtimesEvals") & +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_FARKodeGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumLinRhsEvals") & +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_FARKodeGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastLinFlag") & +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_FARKodeGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FARKodeGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetCurrentMassMatrix") & +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_FARKodeGetResWeights(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetResWeights") & +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_FARKodeGetMassWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetMassWorkSpace") & +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_FARKodeGetNumMassSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassSetups") & +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_FARKodeGetNumMassMultSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassMultSetups") & +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_FARKodeGetNumMassMult(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassMult") & +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_FARKodeGetNumMassSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassSolves") & +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_FARKodeGetNumMassPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassPrecEvals") & +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_FARKodeGetNumMassPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassPrecSolves") & +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_FARKodeGetNumMassIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassIters") & +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_FARKodeGetNumMassConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMassConvFails") & +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_FARKodeGetNumMTSetups(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumMTSetups") & +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_FARKodeGetLastMassFlag(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetLastMassFlag") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_FARKodeFree(farg1) & +bind(C, name="_wrap_FARKodeFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FARKodePrintMem(farg1, farg2) & +bind(C, name="_wrap_FARKodePrintMem") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FARKodeSetRelaxFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetRelaxFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetRelaxEtaFail(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxEtaFail") & +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_FARKodeSetRelaxLowerBound(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxLowerBound") & +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_FARKodeSetRelaxMaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxMaxFails") & +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_FARKodeSetRelaxMaxIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxMaxIters") & +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_FARKodeSetRelaxSolver(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxSolver") & +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_FARKodeSetRelaxResTol(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxResTol") & +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_FARKodeSetRelaxTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetRelaxTol") & +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_FARKodeSetRelaxUpperBound(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetRelaxUpperBound") & +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_FARKodeGetNumRelaxFnEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxFnEvals") & +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_FARKodeGetNumRelaxJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxJacEvals") & +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_FARKodeGetNumRelaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxFails") & +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_FARKodeGetNumRelaxBoundFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxBoundFails") & +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_FARKodeGetNumRelaxSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxSolveFails") & +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_FARKodeGetNumRelaxSolveIters(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetNumRelaxSolveIters") & +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_FARKBandPrecInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKBandPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKBandPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKBandPrecGetWorkSpace") & +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_FARKBandPrecGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FARKBandPrecGetNumRhsEvals") & +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_FARKBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FARKBBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FARKBBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKBBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKBBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKBBDPrecGetWorkSpace") & +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_FARKBBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FARKBBDPrecGetNumGfnEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_q_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_q_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_q_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_q_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_p_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_p_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_p_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_p_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_stages_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_A_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_A_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_A_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_A_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_c_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_c_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_c_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_c_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_b_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_b_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_b_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_b_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeButcherTableMem_d_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_d_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeButcherTableMem_d_get(farg1) & +bind(C, name="_wrap_ARKodeButcherTableMem_d_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_new_ARKodeButcherTableMem() & +bind(C, name="_wrap_new_ARKodeButcherTableMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_ARKodeButcherTableMem(farg1) & +bind(C, name="_wrap_delete_ARKodeButcherTableMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_ARKodeButcherTableMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_ARKodeButcherTableMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FARKodeButcherTable_Alloc(farg1, farg2) & +bind(C, name="_wrap_FARKodeButcherTable_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FARKodeButcherTable_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_Copy(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FARKodeButcherTable_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeButcherTable_Space") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FARKodeButcherTable_Free(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_Free") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FARKodeButcherTable_Write(farg1, farg2) & +bind(C, name="_wrap_FARKodeButcherTable_Write") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_IsStifflyAccurate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_CheckOrder(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeButcherTable_CheckOrder") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_CheckARKOrder(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKodeButcherTable_CheckARKOrder") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadDIRK(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadDIRK") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadDIRKByName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadDIRKByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_DIRKIDToName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_DIRKIDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadERK(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadERK") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_LoadERKByName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_LoadERKByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeButcherTable_ERKIDToName(farg1) & +bind(C, name="_wrap_FARKodeButcherTable_ERKIDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_q_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_q_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_q_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_q_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_stages_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_a_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_a_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_a_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_a_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_ARKodeSPRKTableMem_ahat_set(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_ARKodeSPRKTableMem_ahat_get(farg1) & +bind(C, name="_wrap_ARKodeSPRKTableMem_ahat_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_new_ARKodeSPRKTableMem() & +bind(C, name="_wrap_new_ARKodeSPRKTableMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_ARKodeSPRKTableMem(farg1) & +bind(C, name="_wrap_delete_ARKodeSPRKTableMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_ARKodeSPRKTableMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_ARKodeSPRKTableMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FARKodeSPRKTable_Create(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSPRKTable_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Alloc(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Load(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Load") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_LoadByName(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_LoadByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FARKodeSPRKTable_Copy(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FARKodeSPRKTable_Write(farg1, farg2) & +bind(C, name="_wrap_FARKodeSPRKTable_Write") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FARKodeSPRKTable_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSPRKTable_Space") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FARKodeSPRKTable_Free(farg1) & +bind(C, name="_wrap_FARKodeSPRKTable_Free") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FARKodeSPRKTable_ToButcher(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSPRKTable_ToButcher") & +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_FARKodeSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetLinearSolver") & +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_FARKodeSetMassLinearSolver(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSetMassLinearSolver") & +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), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinearSolutionScaling") & +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_FARKodeSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetEpsLin") & +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_FARKodeSetMassEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassEpsLin") & +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_FARKodeSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLSNormFactor") & +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_FARKodeSetMassLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetMassLSNormFactor") & +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_FARKodeSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetMassPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetMassTimes(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKodeSetMassTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKodeSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FARKodeResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: hscale +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_FUNPTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(ynew) +farg3 = hscale +farg4 = t0 +farg5 = resize +farg6 = resize_data +fresult = swigc_FARKodeResize(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKodeReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FARKodeReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSStolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FARKodeSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSVtolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FARKodeSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeWFtolerances(arkode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = efun +fresult = swigc_FARKodeWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResStolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rabstol +fresult = swigc_FARKodeResStolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResVtolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rabstol) +fresult = swigc_FARKodeResVtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResFtolerance(arkode_mem, rfun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = rfun +fresult = swigc_FARKodeResFtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKodeRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FARKodeRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FARKodeSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FARKodeSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetDefaults(farg1) +swig_result = fresult +end function + +function FARKodeSetOrder(arkode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxord +fresult = swigc_FARKodeSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FARKodeSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FARKodeSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FARKodeSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInterpolateStopTime(arkode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = interp +fresult = swigc_FARKodeSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FARKodeSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeClearStopTime(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeClearStopTime(farg1) +swig_result = fresult +end function + +function FARKodeSetFixedStep(arkode_mem, hfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hfixed +fresult = swigc_FARKodeSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FARKodeSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FARKodeSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FARKodeSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinearSolver(arkode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nls) +fresult = swigc_FARKodeSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLinear(arkode_mem, timedepend) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: timedepend +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = timedepend +fresult = swigc_FARKodeSetLinear(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinear(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeSetNonlinear(farg1) +swig_result = fresult +end function + +function FARKodeSetAutonomous(arkode_mem, autonomous) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: autonomous +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = autonomous +fresult = swigc_FARKodeSetAutonomous(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNlsRhsFn(arkode_mem, nls_fi) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: nls_fi +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = nls_fi +fresult = swigc_FARKodeSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetDeduceImplicitRhs(arkode_mem, deduce) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: deduce +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = deduce +fresult = swigc_FARKodeSetDeduceImplicitRhs(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinCRDown(arkode_mem, crdown) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: crdown +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = crdown +fresult = swigc_FARKodeSetNonlinCRDown(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinRDiv(arkode_mem, rdiv) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rdiv +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rdiv +fresult = swigc_FARKodeSetNonlinRDiv(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetDeltaGammaMax(arkode_mem, dgmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dgmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dgmax +fresult = swigc_FARKodeSetDeltaGammaMax(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLSetupFrequency(arkode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = msbp +fresult = swigc_FARKodeSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPredictorMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FARKodeSetPredictorMethod(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNonlinIters(arkode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxcor +fresult = swigc_FARKodeSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxConvFails(arkode_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxncf +fresult = swigc_FARKodeSetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nlscoef +fresult = swigc_FARKodeSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStagePredictFn(arkode_mem, predictstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: predictstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = predictstage +fresult = swigc_FARKodeSetStagePredictFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetAdaptController(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_FARKodeSetAdaptController(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetAdaptivityAdjustment(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_FARKodeSetAdaptivityAdjustment(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetCFLFraction(arkode_mem, cfl_frac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: cfl_frac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = cfl_frac +fresult = swigc_FARKodeSetCFLFraction(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetErrorBias(arkode_mem, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = bias +fresult = swigc_FARKodeSetErrorBias(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetSafetyFactor(arkode_mem, safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = safety +fresult = swigc_FARKodeSetSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxGrowth(arkode_mem, mx_growth) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: mx_growth +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = mx_growth +fresult = swigc_FARKodeSetMaxGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMinReduction(arkode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_min +fresult = swigc_FARKodeSetMinReduction(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetFixedStepBounds(arkode_mem, lb, ub) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lb +real(C_DOUBLE), intent(in) :: ub +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = lb +farg3 = ub +fresult = swigc_FARKodeSetFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMaxFirstGrowth(arkode_mem, etamx1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamx1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamx1 +fresult = swigc_FARKodeSetMaxFirstGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxEFailGrowth(arkode_mem, etamxf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamxf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamxf +fresult = swigc_FARKodeSetMaxEFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetSmallNumEFails(arkode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = small_nef +fresult = swigc_FARKodeSetSmallNumEFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxCFailGrowth(arkode_mem, etacf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etacf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etacf +fresult = swigc_FARKodeSetMaxCFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetStabilityFn(arkode_mem, estab, estab_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: estab +type(C_PTR) :: estab_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = estab +farg3 = estab_data +fresult = swigc_FARKodeSetStabilityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMaxErrTestFails(arkode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxnef +fresult = swigc_FARKodeSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetConstraints(arkode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(constraints) +fresult = swigc_FARKodeSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxHnilWarns(arkode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = mxhnil +fresult = swigc_FARKodeSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetInitStep(arkode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hin +fresult = swigc_FARKodeSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMinStep(arkode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmin +fresult = swigc_FARKodeSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxStep(arkode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmax +fresult = swigc_FARKodeSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxfails +fresult = swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKodeGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FARKodeGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeComputeState(arkode_mem, zcor, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: zcor +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(zcor) +farg3 = c_loc(z) +fresult = swigc_FARKodeComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(step_attempts(1)) +fresult = swigc_FARKodeGetNumStepAttempts(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +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 = arkode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FARKodeGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumSteps(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FARKodeGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FARKodeGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentStep(arkode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FARKodeGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetErrWeights(arkode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(eweight) +fresult = swigc_FARKodeGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumGEvals(arkode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FARKodeGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FARKodeGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FARKodeGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKodePrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FARKodePrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FARKodeGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FARKodeWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumExpSteps(arkode_mem, expsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +fresult = swigc_FARKodeGetNumExpSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumAccSteps(arkode_mem, accsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accsteps(1)) +fresult = swigc_FARKodeGetNumAccSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumErrTestFails(arkode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FARKodeGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetEstLocalErrors(arkode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ele) +fresult = swigc_FARKodeGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetActualInitStep(arkode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FARKodeGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetTolScaleFactor(arkode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FARKodeGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumConstrFails(arkode_mem, nconstrfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nconstrfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nconstrfails(1)) +fresult = swigc_FARKodeGetNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FARKodeGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FARKodeGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentState(arkode_mem, state) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: state +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = state +fresult = swigc_FARKodeGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetCurrentGamma(arkode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FARKodeGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNonlinearSystemData(arkode_mem, tcur, zpred, z, fi, gamma, sdata, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: zpred +type(C_PTR) :: z +type(C_PTR) :: fi +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +type(C_PTR) :: sdata +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +farg3 = zpred +farg4 = z +farg5 = fi +farg6 = c_loc(gamma(1)) +farg7 = sdata +farg8 = c_loc(user_data) +fresult = swigc_FARKodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FARKodeGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumNonlinSolvConvFails(arkode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FARKodeGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNonlinSolvStats(arkode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FARKodeGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumStepSolveFails(arkode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FARKodeGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJac(arkode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j) +fresult = swigc_FARKodeGetJac(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJacTime(arkode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FARKodeGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetJacNumSteps(arkode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FARKodeGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FARKodeGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumJacEvals(arkode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FARKodeGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumPrecEvals(arkode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FARKodeGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumPrecSolves(arkode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FARKodeGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinIters(arkode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FARKodeGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinConvFails(arkode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FARKodeGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumJTSetupEvals(arkode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FARKodeGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumJtimesEvals(arkode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FARKodeGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumLinRhsEvals(arkode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FARKodeGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastLinFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKodeGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKodeGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeGetCurrentMassMatrix(arkode_mem, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(m) +fresult = swigc_FARKodeGetCurrentMassMatrix(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetResWeights(arkode_mem, rweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rweight) +fresult = swigc_FARKodeGetResWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetMassWorkSpace(arkode_mem, lenrwmls, leniwmls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwmls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwmls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwmls(1)) +farg3 = c_loc(leniwmls(1)) +fresult = swigc_FARKodeGetMassWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeGetNumMassSetups(arkode_mem, nmsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsetups(1)) +fresult = swigc_FARKodeGetNumMassSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassMultSetups(arkode_mem, nmvsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvsetups(1)) +fresult = swigc_FARKodeGetNumMassMultSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassMult(arkode_mem, nmvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvevals(1)) +fresult = swigc_FARKodeGetNumMassMult(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassSolves(arkode_mem, nmsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsolves(1)) +fresult = swigc_FARKodeGetNumMassSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassPrecEvals(arkode_mem, nmpevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpevals(1)) +fresult = swigc_FARKodeGetNumMassPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassPrecSolves(arkode_mem, nmpsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpsolves(1)) +fresult = swigc_FARKodeGetNumMassPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassIters(arkode_mem, nmiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmiters(1)) +fresult = swigc_FARKodeGetNumMassIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMassConvFails(arkode_mem, nmcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmcfails(1)) +fresult = swigc_FARKodeGetNumMassConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumMTSetups(arkode_mem, nmtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmtsetups(1)) +fresult = swigc_FARKodeGetNumMTSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetLastMassFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKodeGetLastMassFlag(farg1, farg2) +swig_result = fresult +end function + +subroutine FARKodeFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FARKodeFree(farg1) +end subroutine + +subroutine FARKodePrintMem(arkode_mem, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = outfile +call swigc_FARKodePrintMem(farg1, farg2) +end subroutine + +function FARKodeSetRelaxFn(arkode_mem, rfn, rjac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfn +type(C_FUNPTR), intent(in), value :: rjac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = rfn +farg3 = rjac +fresult = swigc_FARKodeSetRelaxFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRelaxEtaFail(arkode_mem, eta_rf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_rf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_rf +fresult = swigc_FARKodeSetRelaxEtaFail(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxLowerBound(arkode_mem, lower) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lower +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = lower +fresult = swigc_FARKodeSetRelaxLowerBound(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxMaxFails(arkode_mem, max_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_fails +fresult = swigc_FARKodeSetRelaxMaxFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxMaxIters(arkode_mem, max_iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_iters +fresult = swigc_FARKodeSetRelaxMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxSolver(arkode_mem, solver) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKRelaxSolver), intent(in) :: solver +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = solver +fresult = swigc_FARKodeSetRelaxSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxResTol(arkode_mem, res_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: res_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = res_tol +fresult = swigc_FARKodeSetRelaxResTol(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetRelaxTol(arkode_mem, rel_tol, abs_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rel_tol +real(C_DOUBLE), intent(in) :: abs_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = rel_tol +farg3 = abs_tol +fresult = swigc_FARKodeSetRelaxTol(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetRelaxUpperBound(arkode_mem, upper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: upper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = upper +fresult = swigc_FARKodeSetRelaxUpperBound(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxFnEvals(arkode_mem, r_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: r_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(r_evals(1)) +fresult = swigc_FARKodeGetNumRelaxFnEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxJacEvals(arkode_mem, j_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: j_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j_evals(1)) +fresult = swigc_FARKodeGetNumRelaxJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxFails(arkode_mem, relax_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: relax_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(relax_fails(1)) +fresult = swigc_FARKodeGetNumRelaxFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxBoundFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKodeGetNumRelaxBoundFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxSolveFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKodeGetNumRelaxSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FARKodeGetNumRelaxSolveIters(arkode_mem, iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(iters(1)) +fresult = swigc_FARKodeGetNumRelaxSolveIters(farg1, farg2) +swig_result = fresult +end function + +function FARKBandPrecInit(arkode_mem, n, mu, ml) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: mu +integer(C_INT32_T), intent(in) :: ml +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 + +farg1 = arkode_mem +farg2 = n +farg3 = mu +farg4 = ml +fresult = swigc_FARKBandPrecInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKBandPrecGetWorkSpace(arkode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FARKBandPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKBandPrecGetNumRhsEvals(arkode_mem, nfevalsbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevalsbp(1)) +fresult = swigc_FARKBandPrecGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKBBDPrecInit(arkode_mem, nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dqrely +type(C_FUNPTR), intent(in), value :: gloc +type(C_FUNPTR), intent(in), value :: cfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = arkode_mem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dqrely +farg8 = gloc +farg9 = cfn +fresult = swigc_FARKBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FARKBBDPrecReInit(arkode_mem, mudq, mldq, dqrely) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dqrely +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = arkode_mem +farg2 = mudq +farg3 = mldq +farg4 = dqrely +fresult = swigc_FARKBBDPrecReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKBBDPrecGetWorkSpace(arkode_mem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FARKBBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKBBDPrecGetNumGfnEvals(arkode_mem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FARKBBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +subroutine swigf_ARKodeButcherTableMem_q_set(self, q) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT), intent(in) :: q +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = q +call swigc_ARKodeButcherTableMem_q_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_q_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_q_get(farg1) +swig_result = fresult +end function + +subroutine swigf_ARKodeButcherTableMem_p_set(self, p) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT), intent(in) :: p +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = p +call swigc_ARKodeButcherTableMem_p_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_p_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_p_get(farg1) +swig_result = fresult +end function + +subroutine swigf_ARKodeButcherTableMem_stages_set(self, stages) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT), intent(in) :: stages +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = stages +call swigc_ARKodeButcherTableMem_stages_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_stages_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_stages_get(farg1) +swig_result = fresult +end function + +subroutine swigf_ARKodeButcherTableMem_A_set(self, a) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: a +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(a) +call swigc_ARKodeButcherTableMem_A_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_A_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_A_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_ARKodeButcherTableMem_c_set(self, c) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(c(1)) +call swigc_ARKodeButcherTableMem_c_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_c_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_c_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_ARKodeButcherTableMem_b_set(self, b) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: b +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(b(1)) +call swigc_ARKodeButcherTableMem_b_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_b_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_b_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_ARKodeButcherTableMem_d_set(self, d) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: d +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(d(1)) +call swigc_ARKodeButcherTableMem_d_set(farg1, farg2) +end subroutine + +function swigf_ARKodeButcherTableMem_d_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(ARKodeButcherTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeButcherTableMem_d_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +function swigf_create_ARKodeButcherTableMem() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(ARKodeButcherTableMem) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_ARKodeButcherTableMem() +self%swigdata = fresult +end function + +subroutine swigf_release_ARKodeButcherTableMem(self) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_ARKodeButcherTableMem(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_ARKodeButcherTableMem_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(ARKodeButcherTableMem), intent(inout) :: self +type(ARKodeButcherTableMem), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_ARKodeButcherTableMem_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FARKodeButcherTable_Alloc(stages, embedded) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: embedded +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 + +farg1 = stages +farg2 = embedded +fresult = swigc_FARKodeButcherTable_Alloc(farg1, farg2) +swig_result = fresult +end function + +function FARKodeButcherTable_Create(s, q, p, c, a, b, d) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: s +integer(C_INT), intent(in) :: q +integer(C_INT), intent(in) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +real(C_DOUBLE), dimension(*), target, intent(inout) :: b +real(C_DOUBLE), dimension(*), target, intent(inout) :: d +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = s +farg2 = q +farg3 = p +farg4 = c_loc(c(1)) +farg5 = c_loc(a(1)) +farg6 = c_loc(b(1)) +farg7 = c_loc(d(1)) +fresult = swigc_FARKodeButcherTable_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FARKodeButcherTable_Copy(b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: b +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = b +fresult = swigc_FARKodeButcherTable_Copy(farg1) +swig_result = fresult +end function + +subroutine FARKodeButcherTable_Space(b, liw, lrw) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: b +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = b +farg2 = c_loc(liw(1)) +farg3 = c_loc(lrw(1)) +call swigc_FARKodeButcherTable_Space(farg1, farg2, farg3) +end subroutine + +subroutine FARKodeButcherTable_Free(b) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: b +type(C_PTR) :: farg1 + +farg1 = b +call swigc_FARKodeButcherTable_Free(farg1) +end subroutine + +subroutine FARKodeButcherTable_Write(b, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: b +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = b +farg2 = outfile +call swigc_FARKodeButcherTable_Write(farg1, farg2) +end subroutine + +function FARKodeButcherTable_IsStifflyAccurate(b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = b +fresult = swigc_FARKodeButcherTable_IsStifflyAccurate(farg1) +swig_result = fresult +end function + +function FARKodeButcherTable_CheckOrder(b, q, p, outfile) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: b +integer(C_INT), dimension(*), target, intent(inout) :: q +integer(C_INT), dimension(*), target, intent(inout) :: p +type(C_PTR) :: outfile +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = b +farg2 = c_loc(q(1)) +farg3 = c_loc(p(1)) +farg4 = outfile +fresult = swigc_FARKodeButcherTable_CheckOrder(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeButcherTable_CheckARKOrder(b1, b2, q, p, outfile) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: b1 +type(C_PTR) :: b2 +integer(C_INT), dimension(*), target, intent(inout) :: q +integer(C_INT), dimension(*), target, intent(inout) :: p +type(C_PTR) :: outfile +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = b1 +farg2 = b2 +farg3 = c_loc(q(1)) +farg4 = c_loc(p(1)) +farg5 = outfile +fresult = swigc_FARKodeButcherTable_CheckARKOrder(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKodeButcherTable_LoadDIRK(imethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(ARKODE_DIRKTableID), intent(in) :: imethod +type(C_PTR) :: fresult +integer(C_INT) :: farg1 + +farg1 = imethod +fresult = swigc_FARKodeButcherTable_LoadDIRK(farg1) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FARKodeButcherTable_LoadDIRKByName(imethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +character(kind=C_CHAR, len=*), target :: imethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(C_PTR) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(imethod, farg1_chars, farg1) +fresult = swigc_FARKodeButcherTable_LoadDIRKByName(farg1) +swig_result = fresult +end function + +function FARKodeButcherTable_DIRKIDToName(imethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_DIRKTableID), intent(in) :: imethod +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = imethod +fresult = swigc_FARKodeButcherTable_DIRKIDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKodeButcherTable_LoadERK(emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(ARKODE_ERKTableID), intent(in) :: emethod +type(C_PTR) :: fresult +integer(C_INT) :: farg1 + +farg1 = emethod +fresult = swigc_FARKodeButcherTable_LoadERK(farg1) +swig_result = fresult +end function + +function FARKodeButcherTable_LoadERKByName(emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +character(kind=C_CHAR, len=*), target :: emethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(C_PTR) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(emethod, farg1_chars, farg1) +fresult = swigc_FARKodeButcherTable_LoadERKByName(farg1) +swig_result = fresult +end function + +function FARKodeButcherTable_ERKIDToName(emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_ERKTableID), intent(in) :: emethod +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = emethod +fresult = swigc_FARKodeButcherTable_ERKIDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine swigf_ARKodeSPRKTableMem_q_set(self, q) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(in) :: self +integer(C_INT), intent(in) :: q +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = q +call swigc_ARKodeSPRKTableMem_q_set(farg1, farg2) +end subroutine + +function swigf_ARKodeSPRKTableMem_q_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(ARKodeSPRKTableMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeSPRKTableMem_q_get(farg1) +swig_result = fresult +end function + +subroutine swigf_ARKodeSPRKTableMem_stages_set(self, stages) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(in) :: self +integer(C_INT), intent(in) :: stages +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = stages +call swigc_ARKodeSPRKTableMem_stages_set(farg1, farg2) +end subroutine + +function swigf_ARKodeSPRKTableMem_stages_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(ARKodeSPRKTableMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeSPRKTableMem_stages_get(farg1) +swig_result = fresult +end function + +subroutine swigf_ARKodeSPRKTableMem_a_set(self, a) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(a(1)) +call swigc_ARKodeSPRKTableMem_a_set(farg1, farg2) +end subroutine + +function swigf_ARKodeSPRKTableMem_a_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(ARKodeSPRKTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeSPRKTableMem_a_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_ARKodeSPRKTableMem_ahat_set(self, ahat) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: ahat +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(ahat(1)) +call swigc_ARKodeSPRKTableMem_ahat_set(farg1, farg2) +end subroutine + +function swigf_ARKodeSPRKTableMem_ahat_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(ARKodeSPRKTableMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_ARKodeSPRKTableMem_ahat_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +function swigf_create_ARKodeSPRKTableMem() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(ARKodeSPRKTableMem) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_ARKodeSPRKTableMem() +self%swigdata = fresult +end function + +subroutine swigf_release_ARKodeSPRKTableMem(self) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_ARKodeSPRKTableMem(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_ARKodeSPRKTableMem_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(ARKodeSPRKTableMem), intent(inout) :: self +type(ARKodeSPRKTableMem), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_ARKodeSPRKTableMem_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FARKodeSPRKTable_Create(s, q, a, ahat) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: s +integer(C_INT), intent(in) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +real(C_DOUBLE), dimension(*), target, intent(inout) :: ahat +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = s +farg2 = q +farg3 = c_loc(a(1)) +farg4 = c_loc(ahat(1)) +fresult = swigc_FARKodeSPRKTable_Create(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeSPRKTable_Alloc(stages) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: stages +type(C_PTR) :: fresult +integer(C_INT) :: farg1 + +farg1 = stages +fresult = swigc_FARKodeSPRKTable_Alloc(farg1) +swig_result = fresult +end function + +function FARKodeSPRKTable_Load(id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(ARKODE_SPRKMethodID), intent(in) :: id +type(C_PTR) :: fresult +integer(C_INT) :: farg1 + +farg1 = id +fresult = swigc_FARKodeSPRKTable_Load(farg1) +swig_result = fresult +end function + +function FARKodeSPRKTable_LoadByName(method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +character(kind=C_CHAR, len=*), target :: method +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(C_PTR) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(method, farg1_chars, farg1) +fresult = swigc_FARKodeSPRKTable_LoadByName(farg1) +swig_result = fresult +end function + +function FARKodeSPRKTable_Copy(that_sprk_storage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: that_sprk_storage +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = that_sprk_storage +fresult = swigc_FARKodeSPRKTable_Copy(farg1) +swig_result = fresult +end function + +subroutine FARKodeSPRKTable_Write(sprk_table, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: sprk_table +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sprk_table +farg2 = outfile +call swigc_FARKodeSPRKTable_Write(farg1, farg2) +end subroutine + +subroutine FARKodeSPRKTable_Space(sprk_storage, liw, lrw) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: sprk_storage +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = sprk_storage +farg2 = c_loc(liw(1)) +farg3 = c_loc(lrw(1)) +call swigc_FARKodeSPRKTable_Space(farg1, farg2, farg3) +end subroutine + +subroutine FARKodeSPRKTable_Free(sprk_storage) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: sprk_storage +type(C_PTR) :: farg1 + +farg1 = sprk_storage +call swigc_FARKodeSPRKTable_Free(farg1) +end subroutine + +function FARKodeSPRKTable_ToButcher(sprk_storage, a_ptr, b_ptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sprk_storage +type(C_PTR), target, intent(inout) :: a_ptr +type(C_PTR), target, intent(inout) :: b_ptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = sprk_storage +farg2 = c_loc(a_ptr) +farg3 = c_loc(b_ptr) +fresult = swigc_FARKodeSPRKTable_ToButcher(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetLinearSolver(arkode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FARKodeSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMassLinearSolver(arkode_mem, ls, m, time_dep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: m +integer(C_INT), intent(in) :: time_dep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(m) +farg4 = time_dep +fresult = swigc_FARKodeSetMassLinearSolver(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeSetJacFn(arkode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jac +fresult = swigc_FARKodeSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassFn(arkode_mem, mass) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: mass +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = mass +fresult = swigc_FARKodeSetMassFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetJacEvalFrequency(arkode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = msbj +fresult = swigc_FARKodeSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLinearSolutionScaling(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FARKodeSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKodeSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKodeSetMassEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKodeSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKodeSetMassLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKodeSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetMassPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKodeSetMassPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetJacTimes(arkode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FARKodeSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKodeSetJacTimesRhsFn(arkode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jtimesrhsfn +fresult = swigc_FARKodeSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKodeSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: msetup +type(C_FUNPTR), intent(in), value :: mtimes +type(C_PTR) :: mtimes_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = msetup +farg3 = mtimes +farg4 = mtimes_data +fresult = swigc_FARKodeSetMassTimes(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKodeSetLinSysFn(arkode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = linsys +fresult = swigc_FARKodeSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.c b/src/arkode/fmod_int32/farkode_mristep_mod.c new file mode 100644 index 0000000000..35721938c4 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_mristep_mod.c @@ -0,0 +1,2114 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "arkode/arkode_mristep.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +#include <string.h> + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + +SWIGEXPORT void _wrap_MRIStepCouplingMem_nmat_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::nmat", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->nmat = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_nmat_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::nmat", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->nmat); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_stages_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::stages", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->stages = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_stages_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::stages", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->stages); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_q_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::q", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->q = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_q_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::q", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->q); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_p_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::p", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->p = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_p_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::p", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->p); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, double *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->c = arg2; +} + + +SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->c); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, void *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (sunrealtype ***)(farg2); + if (arg1) (arg1)->W = arg2; +} + + +SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype ***result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (sunrealtype ***) ((arg1)->W); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, void *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (sunrealtype ***)(farg2); + if (arg1) (arg1)->G = arg2; +} + + +SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + sunrealtype ***result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (sunrealtype ***) ((arg1)->G); + fresult = result; + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_MRIStepCouplingMem() { + SwigClassWrapper fresult ; + struct MRIStepCouplingMem *result = 0 ; + + result = (struct MRIStepCouplingMem *)calloc(1, sizeof(struct MRIStepCouplingMem)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_MRIStepCouplingMem(SwigClassWrapper *farg1) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + + SWIG_check_mutable(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::~MRIStepCouplingMem()", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + struct MRIStepCouplingMem *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_LoadTable(int const *farg1) { + void * fresult ; + ARKODE_MRITableID arg1 ; + MRIStepCoupling result; + + arg1 = (ARKODE_MRITableID)(*farg1); + result = (MRIStepCoupling)MRIStepCoupling_LoadTable(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_LoadTableByName(SwigArrayWrapper *farg1) { + void * fresult ; + char *arg1 = (char *) 0 ; + MRIStepCoupling result; + + arg1 = (char *)(farg1->data); + result = (MRIStepCoupling)MRIStepCoupling_LoadTableByName((char const *)arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_Alloc(int const *farg1, int const *farg2, int const *farg3) { + void * fresult ; + int arg1 ; + int arg2 ; + MRISTEP_METHOD_TYPE arg3 ; + MRIStepCoupling result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (MRISTEP_METHOD_TYPE)(*farg3); + result = (MRIStepCoupling)MRIStepCoupling_Alloc(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_Create(int const *farg1, int const *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, double *farg7) { + void * fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + MRIStepCoupling result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); + result = (MRIStepCoupling)MRIStepCoupling_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_MIStoMRI(void *farg1, int const *farg2, int const *farg3) { + void * fresult ; + ARKodeButcherTable arg1 = (ARKodeButcherTable) 0 ; + int arg2 ; + int arg3 ; + MRIStepCoupling result; + + arg1 = (ARKodeButcherTable)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (MRIStepCoupling)MRIStepCoupling_MIStoMRI(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FMRIStepCoupling_Copy(void *farg1) { + void * fresult ; + MRIStepCoupling arg1 = (MRIStepCoupling) 0 ; + MRIStepCoupling result; + + arg1 = (MRIStepCoupling)(farg1); + result = (MRIStepCoupling)MRIStepCoupling_Copy(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FMRIStepCoupling_Space(void *farg1, int32_t *farg2, int32_t *farg3) { + MRIStepCoupling arg1 = (MRIStepCoupling) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (MRIStepCoupling)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + MRIStepCoupling_Space(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FMRIStepCoupling_Free(void *farg1) { + MRIStepCoupling arg1 = (MRIStepCoupling) 0 ; + + arg1 = (MRIStepCoupling)(farg1); + MRIStepCoupling_Free(arg1); +} + + +SWIGEXPORT void _wrap_FMRIStepCoupling_Write(void *farg1, void *farg2) { + MRIStepCoupling arg1 = (MRIStepCoupling) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (MRIStepCoupling)(farg1); + arg2 = (FILE *)(farg2); + MRIStepCoupling_Write(arg1,arg2); +} + + +SWIGEXPORT void * _wrap_FMRIStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4, void *farg5, void *farg6) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + MRIStepInnerStepper arg5 = (MRIStepInnerStepper) 0 ; + SUNContext arg6 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (MRIStepInnerStepper)(farg5); + arg6 = (SUNContext)(farg6); + result = (void *)MRIStepCreate(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + ARKRhsFn arg3 = (ARKRhsFn) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (ARKRhsFn)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)MRIStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetCoupling(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepCoupling arg2 = (MRIStepCoupling) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepCoupling)(farg2); + result = (int)MRIStepSetCoupling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPreInnerFn(void *farg1, MRIStepPreInnerFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepPreInnerFn arg2 = (MRIStepPreInnerFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepPreInnerFn)(farg2); + result = (int)MRIStepSetPreInnerFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPostInnerFn(void *farg1, MRIStepPostInnerFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepPostInnerFn arg2 = (MRIStepPostInnerFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepPostInnerFn)(farg2); + result = (int)MRIStepSetPostInnerFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetCurrentCoupling(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepCoupling *arg2 = (MRIStepCoupling *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepCoupling *)(farg2); + result = (int)MRIStepGetCurrentCoupling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetLastInnerStepFlag(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)MRIStepGetLastInnerStepFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (SUNContext)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)MRIStepInnerStepper_Create(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_Free(void *farg1) { + int fresult ; + MRIStepInnerStepper *arg1 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper *)(farg1); + result = (int)MRIStepInnerStepper_Free(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetContent(void *farg1, void *farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (void *)(farg2); + result = (int)MRIStepInnerStepper_SetContent(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetContent(void *farg1, void *farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (void **)(farg2); + result = (int)MRIStepInnerStepper_GetContent(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetEvolveFn(void *farg1, MRIStepInnerEvolveFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerEvolveFn arg2 = (MRIStepInnerEvolveFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerEvolveFn)(farg2); + result = (int)MRIStepInnerStepper_SetEvolveFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetFullRhsFn(void *farg1, MRIStepInnerFullRhsFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerFullRhsFn arg2 = (MRIStepInnerFullRhsFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerFullRhsFn)(farg2); + result = (int)MRIStepInnerStepper_SetFullRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerResetFn farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerResetFn arg2 = (MRIStepInnerResetFn) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerResetFn)(farg2); + result = (int)MRIStepInnerStepper_SetResetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)MRIStepInnerStepper_AddForcing(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_GetForcingData(void *farg1, double *farg2, double *farg3, void *farg4, int *farg5) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector **arg4 = (N_Vector **) 0 ; + int *arg5 = (int *) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector **)(farg4); + arg5 = (int *)(farg5); + result = (int)MRIStepInnerStepper_GetForcingData(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepResize(void *farg1, N_Vector farg2, double const *farg3, ARKVecResizeFn farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + ARKVecResizeFn arg4 = (ARKVecResizeFn) 0 ; + void *arg5 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (ARKVecResizeFn)(farg4); + arg5 = (void *)(farg5); + result = (int)MRIStepResize(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)MRIStepReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)MRIStepSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)MRIStepSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepWFtolerances(void *farg1, ARKEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKEwtFn arg2 = (ARKEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKEwtFn)(farg2); + result = (int)MRIStepWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)MRIStepSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)MRIStepRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)MRIStepSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetDenseOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetDenseOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)MRIStepSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)MRIStepSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLinear(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetLinear(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNonlinear(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)MRIStepSetNonlinear(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)MRIStepSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNonlinCRDown(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetNonlinCRDown(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNonlinRDiv(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetNonlinRDiv(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetDeltaGammaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetDeltaGammaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLSetupFrequency(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPredictorMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetPredictorMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)MRIStepClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)MRIStepSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)MRIStepSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)MRIStepSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)MRIStepSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)MRIStepSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKStagePredictFn)(farg2); + result = (int)MRIStepSetStagePredictFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetDeduceImplicitRhs(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetDeduceImplicitRhs(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetJacFn(void *farg1, ARKLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacFn arg2 = (ARKLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacFn)(farg2); + result = (int)MRIStepSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)MRIStepSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)MRIStepSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)MRIStepSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetPreconditioner(void *farg1, ARKLsPrecSetupFn farg2, ARKLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsPrecSetupFn arg2 = (ARKLsPrecSetupFn) 0 ; + ARKLsPrecSolveFn arg3 = (ARKLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsPrecSetupFn)(farg2); + arg3 = (ARKLsPrecSolveFn)(farg3); + result = (int)MRIStepSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetJacTimes(void *farg1, ARKLsJacTimesSetupFn farg2, ARKLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacTimesSetupFn arg2 = (ARKLsJacTimesSetupFn) 0 ; + ARKLsJacTimesVecFn arg3 = (ARKLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacTimesSetupFn)(farg2); + arg3 = (ARKLsJacTimesVecFn)(farg3); + result = (int)MRIStepSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetJacTimesRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)MRIStepSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsLinSysFn arg2 = (ARKLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsLinSysFn)(farg2); + result = (int)MRIStepSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)MRIStepEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)MRIStepGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)MRIStepComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)MRIStepGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)MRIStepGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)MRIStepGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)MRIStepGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)MRIStepGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)MRIStepGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)MRIStepGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)MRIStepGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)MRIStepPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FMRIStepGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)MRIStepGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)MRIStepWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepWriteCoupling(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)MRIStepWriteCoupling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (void **)(farg8); + result = (int)MRIStepGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)MRIStepGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)MRIStepGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FMRIStepGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)MRIStepGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FMRIStepFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + MRIStepFree(arg1); +} + + +SWIGEXPORT void _wrap_FMRIStepPrintMem(void *farg1, void *farg2) { + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + MRIStepPrintMem(arg1,arg2); +} + + + diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 new file mode 100644 index 0000000000..74a3de5637 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -0,0 +1,3516 @@ +! 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-2024, 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 farkode_mristep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + ! typedef enum MRISTEP_METHOD_TYPE + enum, bind(c) + enumerator :: MRISTEP_EXPLICIT + enumerator :: MRISTEP_IMPLICIT + enumerator :: MRISTEP_IMEX + end enum + integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) + public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX + ! typedef enum ARKODE_MRITableID + enum, bind(c) + enumerator :: ARKODE_MRI_NONE = -1 + enumerator :: ARKODE_MIN_MRI_NUM = 200 + enumerator :: ARKODE_MIS_KW3 = ARKODE_MIN_MRI_NUM + enumerator :: ARKODE_MRI_GARK_ERK33a + enumerator :: ARKODE_MRI_GARK_ERK45a + enumerator :: ARKODE_MRI_GARK_IRK21a + enumerator :: ARKODE_MRI_GARK_ESDIRK34a + enumerator :: ARKODE_MRI_GARK_ESDIRK46a + enumerator :: ARKODE_IMEX_MRI_GARK3a + enumerator :: ARKODE_IMEX_MRI_GARK3b + enumerator :: ARKODE_IMEX_MRI_GARK4 + enumerator :: ARKODE_MRI_GARK_FORWARD_EULER + enumerator :: ARKODE_MRI_GARK_RALSTON2 + enumerator :: ARKODE_MRI_GARK_ERK22a + enumerator :: ARKODE_MRI_GARK_ERK22b + enumerator :: ARKODE_MRI_GARK_RALSTON3 + enumerator :: ARKODE_MRI_GARK_BACKWARD_EULER + enumerator :: ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + enumerator :: ARKODE_IMEX_MRI_GARK_EULER + enumerator :: ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + enumerator :: ARKODE_IMEX_MRI_GARK_MIDPOINT + enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT + end enum + integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) + public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & + ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & + ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & + ARKODE_MRI_GARK_ERK22a, ARKODE_MRI_GARK_ERK22b, ARKODE_MRI_GARK_RALSTON3, ARKODE_MRI_GARK_BACKWARD_EULER, & + ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, ARKODE_IMEX_MRI_GARK_EULER, ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, & + ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MAX_MRI_NUM + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_4 = ARKODE_MRI_GARK_ESDIRK46a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_1 = ARKODE_IMEX_MRI_GARK_EULER + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4 + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct MRIStepCouplingMem + type, public :: MRIStepCouplingMem + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_nmat => swigf_MRIStepCouplingMem_nmat_set + procedure :: get_nmat => swigf_MRIStepCouplingMem_nmat_get + procedure :: set_stages => swigf_MRIStepCouplingMem_stages_set + procedure :: get_stages => swigf_MRIStepCouplingMem_stages_get + procedure :: set_q => swigf_MRIStepCouplingMem_q_set + procedure :: get_q => swigf_MRIStepCouplingMem_q_get + procedure :: set_p => swigf_MRIStepCouplingMem_p_set + procedure :: get_p => swigf_MRIStepCouplingMem_p_get + procedure :: set_c => swigf_MRIStepCouplingMem_c_set + procedure :: get_c => swigf_MRIStepCouplingMem_c_get + procedure :: set_W => swigf_MRIStepCouplingMem_W_set + procedure :: get_W => swigf_MRIStepCouplingMem_W_get + procedure :: set_G => swigf_MRIStepCouplingMem_G_set + procedure :: get_G => swigf_MRIStepCouplingMem_G_get + procedure :: release => swigf_release_MRIStepCouplingMem + procedure, private :: swigf_MRIStepCouplingMem_op_assign__ + generic :: assignment(=) => swigf_MRIStepCouplingMem_op_assign__ + end type MRIStepCouplingMem + interface MRIStepCouplingMem + module procedure swigf_create_MRIStepCouplingMem + end interface + public :: FMRIStepCoupling_LoadTable + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FMRIStepCoupling_LoadTableByName + public :: FMRIStepCoupling_Alloc + public :: FMRIStepCoupling_Create + public :: FMRIStepCoupling_MIStoMRI + public :: FMRIStepCoupling_Copy + public :: FMRIStepCoupling_Space + public :: FMRIStepCoupling_Free + public :: FMRIStepCoupling_Write + public :: FMRIStepCreate + public :: FMRIStepReInit + public :: FMRIStepSetCoupling + public :: FMRIStepSetPreInnerFn + public :: FMRIStepSetPostInnerFn + public :: FMRIStepGetNumRhsEvals + public :: FMRIStepGetCurrentCoupling + public :: FMRIStepGetLastInnerStepFlag + public :: FMRIStepInnerStepper_Create + public :: FMRIStepInnerStepper_Free + public :: FMRIStepInnerStepper_SetContent + public :: FMRIStepInnerStepper_GetContent + public :: FMRIStepInnerStepper_SetEvolveFn + public :: FMRIStepInnerStepper_SetFullRhsFn + public :: FMRIStepInnerStepper_SetResetFn + public :: FMRIStepInnerStepper_AddForcing + public :: FMRIStepInnerStepper_GetForcingData + public :: FMRIStepResize + public :: FMRIStepReset + public :: FMRIStepSStolerances + public :: FMRIStepSVtolerances + public :: FMRIStepWFtolerances + public :: FMRIStepSetLinearSolver + public :: FMRIStepRootInit + public :: FMRIStepSetDefaults + public :: FMRIStepSetOrder + public :: FMRIStepSetInterpolantType + public :: FMRIStepSetInterpolantDegree + public :: FMRIStepSetDenseOrder + public :: FMRIStepSetNonlinearSolver + public :: FMRIStepSetNlsRhsFn + public :: FMRIStepSetLinear + public :: FMRIStepSetNonlinear + public :: FMRIStepSetMaxNumSteps + public :: FMRIStepSetNonlinCRDown + public :: FMRIStepSetNonlinRDiv + public :: FMRIStepSetDeltaGammaMax + public :: FMRIStepSetLSetupFrequency + public :: FMRIStepSetPredictorMethod + public :: FMRIStepSetMaxNonlinIters + public :: FMRIStepSetNonlinConvCoef + public :: FMRIStepSetMaxHnilWarns + public :: FMRIStepSetInterpolateStopTime + public :: FMRIStepSetStopTime + public :: FMRIStepClearStopTime + public :: FMRIStepSetFixedStep + public :: FMRIStepSetRootDirection + public :: FMRIStepSetNoInactiveRootWarn + public :: FMRIStepSetUserData + public :: FMRIStepSetPostprocessStepFn + public :: FMRIStepSetPostprocessStageFn + public :: FMRIStepSetStagePredictFn + public :: FMRIStepSetDeduceImplicitRhs + public :: FMRIStepSetJacFn + public :: FMRIStepSetJacEvalFrequency + public :: FMRIStepSetLinearSolutionScaling + public :: FMRIStepSetEpsLin + public :: FMRIStepSetLSNormFactor + public :: FMRIStepSetPreconditioner + public :: FMRIStepSetJacTimes + public :: FMRIStepSetJacTimesRhsFn + public :: FMRIStepSetLinSysFn + public :: FMRIStepEvolve + public :: FMRIStepGetDky + public :: FMRIStepComputeState + public :: FMRIStepGetNumLinSolvSetups + public :: FMRIStepGetWorkSpace + public :: FMRIStepGetNumSteps + public :: FMRIStepGetLastStep + public :: FMRIStepGetCurrentTime + public :: FMRIStepGetCurrentState + public :: FMRIStepGetCurrentGamma + public :: FMRIStepGetTolScaleFactor + public :: FMRIStepGetErrWeights + public :: FMRIStepGetNumGEvals + public :: FMRIStepGetRootInfo + public :: FMRIStepGetUserData + public :: FMRIStepPrintAllStats + public :: FMRIStepGetReturnFlagName + public :: FMRIStepWriteParameters + public :: FMRIStepWriteCoupling + public :: FMRIStepGetNonlinearSystemData + public :: FMRIStepGetNumNonlinSolvIters + public :: FMRIStepGetNumNonlinSolvConvFails + public :: FMRIStepGetNonlinSolvStats + public :: FMRIStepGetNumStepSolveFails + public :: FMRIStepGetJac + public :: FMRIStepGetJacTime + public :: FMRIStepGetJacNumSteps + public :: FMRIStepGetLinWorkSpace + public :: FMRIStepGetNumJacEvals + public :: FMRIStepGetNumPrecEvals + public :: FMRIStepGetNumPrecSolves + public :: FMRIStepGetNumLinIters + public :: FMRIStepGetNumLinConvFails + public :: FMRIStepGetNumJTSetupEvals + public :: FMRIStepGetNumJtimesEvals + public :: FMRIStepGetNumLinRhsEvals + public :: FMRIStepGetLastLinFlag + public :: FMRIStepGetLinReturnFlagName + public :: FMRIStepFree + public :: FMRIStepPrintMem + +! WRAPPER DECLARATIONS +interface +subroutine swigc_MRIStepCouplingMem_nmat_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_nmat_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_nmat_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_nmat_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_stages_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_q_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_q_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_q_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_q_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_p_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_p_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_p_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_p_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_c_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_c_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_c_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_c_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_W_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_W_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_W_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_W_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_G_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_G_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_G_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_G_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_new_MRIStepCouplingMem() & +bind(C, name="_wrap_new_MRIStepCouplingMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_MRIStepCouplingMem(farg1) & +bind(C, name="_wrap_delete_MRIStepCouplingMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_MRIStepCouplingMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FMRIStepCoupling_LoadTable(farg1) & +bind(C, name="_wrap_FMRIStepCoupling_LoadTable") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepCoupling_LoadTableByName(farg1) & +bind(C, name="_wrap_FMRIStepCoupling_LoadTableByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepCoupling_Alloc(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepCoupling_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepCoupling_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FMRIStepCoupling_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepCoupling_MIStoMRI(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepCoupling_MIStoMRI") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepCoupling_Copy(farg1) & +bind(C, name="_wrap_FMRIStepCoupling_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FMRIStepCoupling_Space(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepCoupling_Space") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FMRIStepCoupling_Free(farg1) & +bind(C, name="_wrap_FMRIStepCoupling_Free") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FMRIStepCoupling_Write(farg1, farg2) & +bind(C, name="_wrap_FMRIStepCoupling_Write") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FMRIStepCreate(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FMRIStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR) :: fresult +end function + +function swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetCoupling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetCoupling") & +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_FMRIStepSetPreInnerFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPreInnerFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetPostInnerFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPostInnerFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & +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_FMRIStepGetCurrentCoupling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetCurrentCoupling") & +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_FMRIStepGetLastInnerStepFlag(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetLastInnerStepFlag") & +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_FMRIStepInnerStepper_Create(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_Create") & +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_FMRIStepInnerStepper_Free(farg1) & +bind(C, name="_wrap_FMRIStepInnerStepper_Free") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetContent") & +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_FMRIStepInnerStepper_GetContent(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_GetContent") & +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_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetEvolveFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetFullRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepInnerStepper_AddForcing") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepInnerStepper_GetForcingData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_FUNPTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepSStolerances") & +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_FMRIStepSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FMRIStepWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepSetLinearSolver") & +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_FMRIStepRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetDefaults(farg1) & +bind(C, name="_wrap_FMRIStepSetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetOrder(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetOrder") & +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_FMRIStepSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetInterpolantType") & +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_FMRIStepSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetInterpolantDegree") & +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_FMRIStepSetDenseOrder(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetDenseOrder") & +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_FMRIStepSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetNonlinearSolver") & +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_FMRIStepSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetNlsRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetLinear(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetLinear") & +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_FMRIStepSetNonlinear(farg1) & +bind(C, name="_wrap_FMRIStepSetNonlinear") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetNonlinCRDown(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetNonlinCRDown") & +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_FMRIStepSetNonlinRDiv(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetNonlinRDiv") & +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_FMRIStepSetDeltaGammaMax(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetDeltaGammaMax") & +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_FMRIStepSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetLSetupFrequency") & +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_FMRIStepSetPredictorMethod(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPredictorMethod") & +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_FMRIStepSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetMaxNonlinIters") & +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_FMRIStepSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetNonlinConvCoef") & +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_FMRIStepSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetMaxHnilWarns") & +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_FMRIStepSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetInterpolateStopTime") & +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_FMRIStepSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetStopTime") & +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_FMRIStepClearStopTime(farg1) & +bind(C, name="_wrap_FMRIStepClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetFixedStep") & +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_FMRIStepSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetRootDirection") & +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_FMRIStepSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FMRIStepSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetUserData(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetUserData") & +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_FMRIStepSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetStagePredictFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetStagePredictFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetDeduceImplicitRhs(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetDeduceImplicitRhs") & +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_FMRIStepSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetLinearSolutionScaling") & +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_FMRIStepSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetEpsLin") & +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_FMRIStepSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetLSNormFactor") & +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_FMRIStepSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FMRIStepEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FMRIStepGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepComputeState") & +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_FMRIStepGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumLinSolvSetups") & +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_FMRIStepGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetWorkSpace") & +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_FMRIStepGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumSteps") & +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_FMRIStepGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetLastStep") & +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_FMRIStepGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetCurrentTime") & +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_FMRIStepGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetCurrentState") & +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_FMRIStepGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetCurrentGamma") & +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_FMRIStepGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetTolScaleFactor") & +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_FMRIStepGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetErrWeights") & +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_FMRIStepGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumGEvals") & +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_FMRIStepGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetRootInfo") & +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_FMRIStepGetUserData(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetUserData") & +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_FMRIStepPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FMRIStepGetReturnFlagName(farg1) & +bind(C, name="_wrap_FMRIStepGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FMRIStepWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FMRIStepWriteParameters") & +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_FMRIStepWriteCoupling(farg1, farg2) & +bind(C, name="_wrap_FMRIStepWriteCoupling") & +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_FMRIStepGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FMRIStepGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumNonlinSolvIters") & +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_FMRIStepGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumNonlinSolvConvFails") & +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_FMRIStepGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetNonlinSolvStats") & +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_FMRIStepGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumStepSolveFails") & +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_FMRIStepGetJac(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetJac") & +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_FMRIStepGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetJacTime") & +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_FMRIStepGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetJacNumSteps") & +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_FMRIStepGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetLinWorkSpace") & +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_FMRIStepGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumJacEvals") & +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_FMRIStepGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumPrecEvals") & +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_FMRIStepGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumPrecSolves") & +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_FMRIStepGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumLinIters") & +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_FMRIStepGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumLinConvFails") & +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_FMRIStepGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumJTSetupEvals") & +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_FMRIStepGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumJtimesEvals") & +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_FMRIStepGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumLinRhsEvals") & +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_FMRIStepGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetLastLinFlag") & +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_FMRIStepGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FMRIStepGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FMRIStepFree(farg1) & +bind(C, name="_wrap_FMRIStepFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FMRIStepPrintMem(farg1, farg2) & +bind(C, name="_wrap_FMRIStepPrintMem") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +end interface + + +contains + ! MODULE SUBPROGRAMS +subroutine swigf_MRIStepCouplingMem_nmat_set(self, nmat) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: nmat +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = nmat +call swigc_MRIStepCouplingMem_nmat_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_nmat_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_nmat_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_stages_set(self, stages) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: stages +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = stages +call swigc_MRIStepCouplingMem_stages_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_stages_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_stages_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_q_set(self, q) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: q +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = q +call swigc_MRIStepCouplingMem_q_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_q_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_q_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_p_set(self, p) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: p +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = p +call swigc_MRIStepCouplingMem_p_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_p_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_p_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_c_set(self, c) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(c(1)) +call swigc_MRIStepCouplingMem_c_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_c_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_c_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_MRIStepCouplingMem_W_set(self, w) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: w +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(w) +call swigc_MRIStepCouplingMem_W_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_W_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_W_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_MRIStepCouplingMem_G_set(self, g) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: g +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(g) +call swigc_MRIStepCouplingMem_G_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_G_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_G_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function swigf_create_MRIStepCouplingMem() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(MRIStepCouplingMem) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_MRIStepCouplingMem() +self%swigdata = fresult +end function + +subroutine swigf_release_MRIStepCouplingMem(self) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_MRIStepCouplingMem(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_MRIStepCouplingMem_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(inout) :: self +type(MRIStepCouplingMem), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_MRIStepCouplingMem_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FMRIStepCoupling_LoadTable(method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(ARKODE_MRITableID), intent(in) :: method +type(C_PTR) :: fresult +integer(C_INT) :: farg1 + +farg1 = method +fresult = swigc_FMRIStepCoupling_LoadTable(farg1) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FMRIStepCoupling_LoadTableByName(method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +character(kind=C_CHAR, len=*), target :: method +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(C_PTR) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(method, farg1_chars, farg1) +fresult = swigc_FMRIStepCoupling_LoadTableByName(farg1) +swig_result = fresult +end function + +function FMRIStepCoupling_Alloc(nmat, stages, type) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: nmat +integer(C_INT), intent(in) :: stages +integer(MRISTEP_METHOD_TYPE), intent(in) :: type +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = nmat +farg2 = stages +farg3 = type +fresult = swigc_FMRIStepCoupling_Alloc(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepCoupling_Create(nmat, stages, q, p, w, g, c) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: nmat +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: q +integer(C_INT), intent(in) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: g +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = nmat +farg2 = stages +farg3 = q +farg4 = p +farg5 = c_loc(w(1)) +farg6 = c_loc(g(1)) +farg7 = c_loc(c(1)) +fresult = swigc_FMRIStepCoupling_Create(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FMRIStepCoupling_MIStoMRI(b, q, p) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: b +integer(C_INT), intent(in) :: q +integer(C_INT), intent(in) :: p +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = b +farg2 = q +farg3 = p +fresult = swigc_FMRIStepCoupling_MIStoMRI(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepCoupling_Copy(mric) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: mric +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = mric +fresult = swigc_FMRIStepCoupling_Copy(farg1) +swig_result = fresult +end function + +subroutine FMRIStepCoupling_Space(mric, liw, lrw) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: mric +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = mric +farg2 = c_loc(liw(1)) +farg3 = c_loc(lrw(1)) +call swigc_FMRIStepCoupling_Space(farg1, farg2, farg3) +end subroutine + +subroutine FMRIStepCoupling_Free(mric) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: mric +type(C_PTR) :: farg1 + +farg1 = mric +call swigc_FMRIStepCoupling_Free(farg1) +end subroutine + +subroutine FMRIStepCoupling_Write(mric, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: mric +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = mric +farg2 = outfile +call swigc_FMRIStepCoupling_Write(farg1, farg2) +end subroutine + +function FMRIStepCreate(fse, fsi, t0, y0, stepper, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: fse +type(C_FUNPTR), intent(in), value :: fsi +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: stepper +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = fse +farg2 = fsi +farg3 = t0 +farg4 = c_loc(y0) +farg5 = stepper +farg6 = sunctx +fresult = swigc_FMRIStepCreate(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FMRIStepReInit(arkode_mem, fse, fsi, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: fse +type(C_FUNPTR), intent(in), value :: fsi +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = fse +farg3 = fsi +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FMRIStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FMRIStepSetCoupling(arkode_mem, mric) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: mric +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = mric +fresult = swigc_FMRIStepSetCoupling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPreInnerFn(arkode_mem, prefn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: prefn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = prefn +fresult = swigc_FMRIStepSetPreInnerFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPostInnerFn(arkode_mem, postfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: postfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = postfn +fresult = swigc_FMRIStepSetPostInnerFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfse_evals(1)) +farg3 = c_loc(nfsi_evals(1)) +fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetCurrentCoupling(arkode_mem, mric) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: mric +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(mric) +fresult = swigc_FMRIStepGetCurrentCoupling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLastInnerStepFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_Create(sunctx, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_Create(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_Free(stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_Free(farg1) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = content +fresult = swigc_FMRIStepInnerStepper_SetContent(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_GetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR), target, intent(inout) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(content) +fresult = swigc_FMRIStepInnerStepper_GetContent(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetEvolveFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetEvolveFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetFullRhsFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetFullRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_AddForcing(stepper, t, f) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: f +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = stepper +farg2 = t +farg3 = c_loc(f) +fresult = swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepInnerStepper_GetForcingData(stepper, tshift, tscale, forcing, nforcing) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), dimension(*), target, intent(inout) :: tshift +real(C_DOUBLE), dimension(*), target, intent(inout) :: tscale +type(C_PTR), target, intent(inout) :: forcing +integer(C_INT), dimension(*), target, intent(inout) :: nforcing +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = stepper +farg2 = c_loc(tshift(1)) +farg3 = c_loc(tscale(1)) +farg4 = c_loc(forcing) +farg5 = c_loc(nforcing(1)) +fresult = swigc_FMRIStepInnerStepper_GetForcingData(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FMRIStepResize(arkode_mem, ynew, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_FUNPTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = c_loc(ynew) +farg3 = t0 +farg4 = resize +farg5 = resize_data +fresult = swigc_FMRIStepResize(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FMRIStepReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FMRIStepReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepSStolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FMRIStepSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepSVtolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FMRIStepSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepWFtolerances(arkode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = efun +fresult = swigc_FMRIStepWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLinearSolver(arkode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FMRIStepSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FMRIStepRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FMRIStepSetDefaults(farg1) +swig_result = fresult +end function + +function FMRIStepSetOrder(arkode_mem, ord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: ord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = ord +fresult = swigc_FMRIStepSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FMRIStepSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FMRIStepSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetDenseOrder(arkode_mem, dord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: dord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = dord +fresult = swigc_FMRIStepSetDenseOrder(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNonlinearSolver(arkode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nls) +fresult = swigc_FMRIStepSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNlsRhsFn(arkode_mem, nls_fs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: nls_fs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = nls_fs +fresult = swigc_FMRIStepSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLinear(arkode_mem, timedepend) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: timedepend +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = timedepend +fresult = swigc_FMRIStepSetLinear(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNonlinear(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FMRIStepSetNonlinear(farg1) +swig_result = fresult +end function + +function FMRIStepSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FMRIStepSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNonlinCRDown(arkode_mem, crdown) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: crdown +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = crdown +fresult = swigc_FMRIStepSetNonlinCRDown(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNonlinRDiv(arkode_mem, rdiv) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rdiv +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rdiv +fresult = swigc_FMRIStepSetNonlinRDiv(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetDeltaGammaMax(arkode_mem, dgmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dgmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dgmax +fresult = swigc_FMRIStepSetDeltaGammaMax(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLSetupFrequency(arkode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = msbp +fresult = swigc_FMRIStepSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPredictorMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FMRIStepSetPredictorMethod(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetMaxNonlinIters(arkode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxcor +fresult = swigc_FMRIStepSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNonlinConvCoef(arkode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nlscoef +fresult = swigc_FMRIStepSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetMaxHnilWarns(arkode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = mxhnil +fresult = swigc_FMRIStepSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetInterpolateStopTime(arkode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = interp +fresult = swigc_FMRIStepSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FMRIStepSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepClearStopTime(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FMRIStepClearStopTime(farg1) +swig_result = fresult +end function + +function FMRIStepSetFixedStep(arkode_mem, hsfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hsfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hsfixed +fresult = swigc_FMRIStepSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FMRIStepSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FMRIStepSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FMRIStepSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FMRIStepSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FMRIStepSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FMRIStepSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetStagePredictFn(arkode_mem, predictstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: predictstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = predictstage +fresult = swigc_FMRIStepSetStagePredictFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetDeduceImplicitRhs(arkode_mem, deduce) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: deduce +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = deduce +fresult = swigc_FMRIStepSetDeduceImplicitRhs(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetJacFn(arkode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jac +fresult = swigc_FMRIStepSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetJacEvalFrequency(arkode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = msbj +fresult = swigc_FMRIStepSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLinearSolutionScaling(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FMRIStepSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FMRIStepSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FMRIStepSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FMRIStepSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepSetJacTimes(arkode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FMRIStepSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepSetJacTimesRhsFn(arkode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jtimesrhsfn +fresult = swigc_FMRIStepSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepSetLinSysFn(arkode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = linsys +fresult = swigc_FMRIStepSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FMRIStepEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FMRIStepGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FMRIStepGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FMRIStepComputeState(arkode_mem, zcor, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: zcor +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(zcor) +farg3 = c_loc(z) +fresult = swigc_FMRIStepComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetNumLinSolvSetups(arkode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FMRIStepGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetWorkSpace(arkode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +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 = arkode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FMRIStepGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetNumSteps(arkode_mem, nssteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nssteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nssteps(1)) +fresult = swigc_FMRIStepGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FMRIStepGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FMRIStepGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetCurrentState(arkode_mem, state) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: state +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = state +fresult = swigc_FMRIStepGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetCurrentGamma(arkode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FMRIStepGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetTolScaleFactor(arkode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FMRIStepGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetErrWeights(arkode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(eweight) +fresult = swigc_FMRIStepGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumGEvals(arkode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FMRIStepGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FMRIStepGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FMRIStepGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepPrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FMRIStepPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FMRIStepGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FMRIStepGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FMRIStepWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FMRIStepWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepWriteCoupling(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FMRIStepWriteCoupling(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNonlinearSystemData(arkode_mem, tcur, zpred, z, f, gamma, sdata, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: zpred +type(C_PTR) :: z +type(C_PTR) :: f +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +type(C_PTR) :: sdata +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +farg3 = zpred +farg4 = z +farg5 = f +farg6 = c_loc(gamma(1)) +farg7 = sdata +farg8 = c_loc(user_data) +fresult = swigc_FMRIStepGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FMRIStepGetNumNonlinSolvIters(arkode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FMRIStepGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumNonlinSolvConvFails(arkode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FMRIStepGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNonlinSolvStats(arkode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FMRIStepGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetNumStepSolveFails(arkode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FMRIStepGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetJac(arkode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j) +fresult = swigc_FMRIStepGetJac(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetJacTime(arkode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FMRIStepGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetJacNumSteps(arkode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FMRIStepGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FMRIStepGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FMRIStepGetNumJacEvals(arkode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FMRIStepGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumPrecEvals(arkode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FMRIStepGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumPrecSolves(arkode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FMRIStepGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumLinIters(arkode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FMRIStepGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumLinConvFails(arkode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FMRIStepGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumJTSetupEvals(arkode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FMRIStepGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumJtimesEvals(arkode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FMRIStepGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetNumLinRhsEvals(arkode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FMRIStepGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLastLinFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FMRIStepGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FMRIStepGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FMRIStepFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FMRIStepFree(farg1) +end subroutine + +subroutine FMRIStepPrintMem(arkode_mem, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = outfile +call swigc_FMRIStepPrintMem(farg1, farg2) +end subroutine + + +end module diff --git a/src/arkode/fmod/farkode_sprkstep_mod.c b/src/arkode/fmod_int32/farkode_sprkstep_mod.c similarity index 100% rename from src/arkode/fmod/farkode_sprkstep_mod.c rename to src/arkode/fmod_int32/farkode_sprkstep_mod.c diff --git a/src/arkode/fmod/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 similarity index 100% rename from src/arkode/fmod/farkode_sprkstep_mod.f90 rename to src/arkode/fmod_int32/farkode_sprkstep_mod.f90 diff --git a/src/arkode/fmod_int64/CMakeLists.txt b/src/arkode/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..32e5c935d7 --- /dev/null +++ b/src/arkode/fmod_int64/CMakeLists.txt @@ -0,0 +1,59 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 ARKODE object library +# --------------------------------------------------------------- + +set(arkode_SOURCES + farkode_mod.f90 + farkode_mod.c + farkode_arkstep_mod.f90 + farkode_arkstep_mod.c + farkode_erkstep_mod.f90 + farkode_erkstep_mod.c + farkode_sprkstep_mod.f90 + farkode_sprkstep_mod.c + farkode_mristep_mod.f90 + farkode_mristep_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_farkode_mod + SOURCES + ${arkode_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunadaptcontrollersoderlind_mod_obj + sundials_fsunadaptcontrollerimexgus_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + sundials_fsunnonlinsolnewton_mod_obj + sundials_fsunnonlinsolfixedpoint_mod_obj + OUTPUT_NAME + sundials_farkode_mod + VERSION + ${arkodelib_VERSION} + SOVERSION + ${arkodelib_SOVERSION} +) + +message(STATUS "Added ARKODE F2003 interface") diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.c b/src/arkode/fmod_int64/farkode_arkstep_mod.c new file mode 100644 index 0000000000..4791bedcdc --- /dev/null +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.c @@ -0,0 +1,2660 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_arkstep.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FARKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)ARKStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + ARKRhsFn arg3 = (ARKRhsFn) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (ARKRhsFn)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)ARKStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetExplicit(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetExplicit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetImplicit(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetImplicit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetImEx(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetImEx(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTables(void *farg1, int const *farg2, int const *farg3, void *farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + ARKodeButcherTable arg4 = (ARKodeButcherTable) 0 ; + ARKodeButcherTable arg5 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (ARKodeButcherTable)(farg4); + arg5 = (ARKodeButcherTable)(farg5); + result = (int)ARKStepSetTables(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTableNum(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_DIRKTableID arg2 ; + ARKODE_ERKTableID arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_DIRKTableID)(*farg2); + arg3 = (ARKODE_ERKTableID)(*farg3); + result = (int)ARKStepSetTableNum(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + arg3 = (char *)(farg3->data); + result = (int)ARKStepSetTableName(arg1,(char const *)arg2,(char const *)arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentButcherTables(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; + ARKodeButcherTable *arg3 = (ARKodeButcherTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable *)(farg2); + arg3 = (ARKodeButcherTable *)(farg3); + result = (int)ARKStepGetCurrentButcherTables(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6, long *farg7, long *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + long *arg7 = (long *) 0 ; + long *arg8 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + arg7 = (long *)(farg7); + arg8 = (long *)(farg8); + result = (int)ARKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepCreateMRIStepInnerStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)ARKStepCreateMRIStepInnerStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ARKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKStepReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKStepSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKStepSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepWFtolerances(void *farg1, ARKEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKEwtFn arg2 = (ARKEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKEwtFn)(farg2); + result = (int)ARKStepWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepResStolerance(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepResStolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepResVtolerance(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKStepResVtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepResFtolerance(void *farg1, ARKRwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRwtFn arg2 = (ARKRwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRwtFn)(farg2); + result = (int)ARKStepResFtolerance(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)ARKStepSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3, int const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + arg4 = (int)(*farg4); + result = (int)ARKStepSetMassLinearSolver(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)ARKStepRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetOptimalParams(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetOptimalParams(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetDenseOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetDenseOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)ARKStepSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNlsRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKStepSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLinear(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetLinear(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNonlinear(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetNonlinear(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetDeduceImplicitRhs(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetDeduceImplicitRhs(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +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 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetCFLFraction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetErrorBias(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetErrorBias(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMaxGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMinReduction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMinReduction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKStepSetFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetAdaptivityMethod(void *farg1, int const *farg2, int const *farg3, int const *farg4, double *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (double *)(farg5); + result = (int)ARKStepSetAdaptivityMethod(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetAdaptivityFn(void *farg1, ARKAdaptFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKAdaptFn arg2 = (ARKAdaptFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKAdaptFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ARKStepSetAdaptivityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxFirstGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMaxFirstGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxEFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMaxEFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetSmallNumEFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetSmallNumEFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxCFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMaxCFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNonlinCRDown(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetNonlinCRDown(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNonlinRDiv(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetNonlinRDiv(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetDeltaGammaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetDeltaGammaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLSetupFrequency(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetPredictorMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetPredictorMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKExpStabFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ARKStepSetStabilityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKStepSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKStepSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMaxNumConstrFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetMaxNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKStepSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKStepSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)ARKStepSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKStepSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ARKStepSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetStagePredictFn(void *farg1, ARKStagePredictFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKStagePredictFn arg2 = (ARKStagePredictFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKStagePredictFn)(farg2); + result = (int)ARKStepSetStagePredictFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetJacFn(void *farg1, ARKLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacFn arg2 = (ARKLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacFn)(farg2); + result = (int)ARKStepSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassFn(void *farg1, ARKLsMassFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassFn arg2 = (ARKLsMassFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassFn)(farg2); + result = (int)ARKStepSetMassFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ARKStepSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMassEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetMassLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetPreconditioner(void *farg1, ARKLsPrecSetupFn farg2, ARKLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsPrecSetupFn arg2 = (ARKLsPrecSetupFn) 0 ; + ARKLsPrecSolveFn arg3 = (ARKLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsPrecSetupFn)(farg2); + arg3 = (ARKLsPrecSolveFn)(farg3); + result = (int)ARKStepSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassPreconditioner(void *farg1, ARKLsMassPrecSetupFn farg2, ARKLsMassPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassPrecSetupFn arg2 = (ARKLsMassPrecSetupFn) 0 ; + ARKLsMassPrecSolveFn arg3 = (ARKLsMassPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassPrecSetupFn)(farg2); + arg3 = (ARKLsMassPrecSolveFn)(farg3); + result = (int)ARKStepSetMassPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetJacTimes(void *farg1, ARKLsJacTimesSetupFn farg2, ARKLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsJacTimesSetupFn arg2 = (ARKLsJacTimesSetupFn) 0 ; + ARKLsJacTimesVecFn arg3 = (ARKLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsJacTimesSetupFn)(farg2); + arg3 = (ARKLsJacTimesVecFn)(farg3); + result = (int)ARKStepSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetJacTimesRhsFn(void *farg1, ARKRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + result = (int)ARKStepSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetMassTimes(void *farg1, ARKLsMassTimesSetupFn farg2, ARKLsMassTimesVecFn farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsMassTimesSetupFn arg2 = (ARKLsMassTimesSetupFn) 0 ; + ARKLsMassTimesVecFn arg3 = (ARKLsMassTimesVecFn) 0 ; + void *arg4 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsMassTimesSetupFn)(farg2); + arg3 = (ARKLsMassTimesVecFn)(farg3); + arg4 = (void *)(farg4); + result = (int)ARKStepSetMassTimes(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetLinSysFn(void *farg1, ARKLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKLsLinSysFn arg2 = (ARKLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKLsLinSysFn)(farg2); + result = (int)ARKStepSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)ARKStepEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ARKStepGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)ARKStepComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumExpSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumExpSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumAccSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumAccSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumStepAttempts(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumStepAttempts(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKStepGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)ARKStepGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetCurrentMassMatrix(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKStepGetCurrentMassMatrix(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKStepGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetResWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ARKStepGetResWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ARKStepGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumConstrFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)ARKStepGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)ARKStepPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKStepGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKStepGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ARKStepWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepWriteButcher(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ARKStepWriteButcher(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)ARKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, void *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (void **)(farg8); + result = (int)ARKStepGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)ARKStepGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKStepGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetMassWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetMassWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassMultSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassMultSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassMult(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassMult(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMassConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMassConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumMTSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumMTSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetLastMassFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetLastMassFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FARKStepGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ARKStepGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FARKStepFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + ARKStepFree(arg1); +} + + +SWIGEXPORT void _wrap_FARKStepPrintMem(void *farg1, void *farg2) { + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + ARKStepPrintMem(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxFn arg2 = (ARKRelaxFn) 0 ; + ARKRelaxJacFn arg3 = (ARKRelaxJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxFn)(farg2); + arg3 = (ARKRelaxJacFn)(farg3); + result = (int)ARKStepSetRelaxFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxEtaFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetRelaxEtaFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxLowerBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetRelaxLowerBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxMaxFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetRelaxMaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxMaxIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ARKStepSetRelaxMaxIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxSolver(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxSolver arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxSolver)(*farg2); + result = (int)ARKStepSetRelaxSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxResTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetRelaxResTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxTol(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ARKStepSetRelaxTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepSetRelaxUpperBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKStepSetRelaxUpperBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxFnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxFnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxBoundFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxBoundFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ARKStepGetNumRelaxSolveIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 new file mode 100644 index 0000000000..cc0373f1eb --- /dev/null +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 @@ -0,0 +1,4625 @@ +! 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-2024, 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 farkode_arkstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_1 = ARKODE_FORWARD_EULER_1_1 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_2 = ARKODE_HEUN_EULER_2_1_2 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ERK_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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_1 = ARKODE_BACKWARD_EULER_1_1 + 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 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_DIRK_5 = ARKODE_ARK548L2SA_DIRK_8_4_5 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ETABLE_2 = ARKODE_ARK2_ERK_3_1_2 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ETABLE_3 = ARKODE_ARK324L2SA_ERK_4_2_3 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ETABLE_4 = ARKODE_ARK436L2SA_ERK_6_3_4 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ETABLE_5 = ARKODE_ARK548L2SA_ERK_8_4_5 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_2 = ARKODE_ARK2_DIRK_3_1_2 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_3 = ARKODE_ARK324L2SA_DIRK_4_2_3 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_4 = ARKODE_ARK436L2SA_DIRK_6_3_4 + integer(C_INT), parameter, public :: ARKSTEP_DEFAULT_ARK_ITABLE_5 = ARKODE_ARK548L2SA_DIRK_8_4_5 + public :: FARKStepCreate + public :: FARKStepReInit + public :: FARKStepSetExplicit + public :: FARKStepSetImplicit + public :: FARKStepSetImEx + public :: FARKStepSetTables + public :: FARKStepSetTableNum + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FARKStepSetTableName + public :: FARKStepGetNumRhsEvals + public :: FARKStepGetCurrentButcherTables + public :: FARKStepGetTimestepperStats + public :: FARKStepCreateMRIStepInnerStepper + public :: FARKStepResize + public :: FARKStepReset + public :: FARKStepSStolerances + public :: FARKStepSVtolerances + public :: FARKStepWFtolerances + public :: FARKStepResStolerance + public :: FARKStepResVtolerance + public :: FARKStepResFtolerance + public :: FARKStepSetLinearSolver + public :: FARKStepSetMassLinearSolver + public :: FARKStepRootInit + public :: FARKStepSetDefaults + public :: FARKStepSetOptimalParams + public :: FARKStepSetOrder + public :: FARKStepSetInterpolantType + public :: FARKStepSetInterpolantDegree + public :: FARKStepSetDenseOrder + public :: FARKStepSetNonlinearSolver + public :: FARKStepSetNlsRhsFn + public :: FARKStepSetLinear + public :: FARKStepSetNonlinear + public :: FARKStepSetDeduceImplicitRhs + public :: FARKStepSetAdaptController + public :: FARKStepSetAdaptivityAdjustment + public :: FARKStepSetCFLFraction + public :: FARKStepSetSafetyFactor + public :: FARKStepSetErrorBias + public :: FARKStepSetMaxGrowth + public :: FARKStepSetMinReduction + public :: FARKStepSetFixedStepBounds + public :: FARKStepSetAdaptivityMethod + public :: FARKStepSetAdaptivityFn + public :: FARKStepSetMaxFirstGrowth + public :: FARKStepSetMaxEFailGrowth + public :: FARKStepSetSmallNumEFails + public :: FARKStepSetMaxCFailGrowth + public :: FARKStepSetNonlinCRDown + public :: FARKStepSetNonlinRDiv + public :: FARKStepSetDeltaGammaMax + public :: FARKStepSetLSetupFrequency + public :: FARKStepSetPredictorMethod + public :: FARKStepSetStabilityFn + public :: FARKStepSetMaxErrTestFails + public :: FARKStepSetMaxNonlinIters + public :: FARKStepSetMaxConvFails + public :: FARKStepSetNonlinConvCoef + public :: FARKStepSetConstraints + public :: FARKStepSetMaxNumSteps + public :: FARKStepSetMaxHnilWarns + public :: FARKStepSetInitStep + public :: FARKStepSetMinStep + public :: FARKStepSetMaxStep + public :: FARKStepSetInterpolateStopTime + public :: FARKStepSetStopTime + public :: FARKStepClearStopTime + public :: FARKStepSetFixedStep + public :: FARKStepSetMaxNumConstrFails + public :: FARKStepSetRootDirection + public :: FARKStepSetNoInactiveRootWarn + public :: FARKStepSetUserData + public :: FARKStepSetPostprocessStepFn + public :: FARKStepSetPostprocessStageFn + public :: FARKStepSetStagePredictFn + public :: FARKStepSetJacFn + public :: FARKStepSetMassFn + public :: FARKStepSetJacEvalFrequency + public :: FARKStepSetLinearSolutionScaling + public :: FARKStepSetEpsLin + public :: FARKStepSetMassEpsLin + public :: FARKStepSetLSNormFactor + public :: FARKStepSetMassLSNormFactor + public :: FARKStepSetPreconditioner + public :: FARKStepSetMassPreconditioner + public :: FARKStepSetJacTimes + public :: FARKStepSetJacTimesRhsFn + public :: FARKStepSetMassTimes + public :: FARKStepSetLinSysFn + public :: FARKStepEvolve + public :: FARKStepGetDky + public :: FARKStepComputeState + public :: FARKStepGetNumExpSteps + public :: FARKStepGetNumAccSteps + public :: FARKStepGetNumStepAttempts + public :: FARKStepGetNumLinSolvSetups + public :: FARKStepGetNumErrTestFails + public :: FARKStepGetEstLocalErrors + public :: FARKStepGetWorkSpace + public :: FARKStepGetNumSteps + public :: FARKStepGetActualInitStep + public :: FARKStepGetLastStep + public :: FARKStepGetCurrentStep + public :: FARKStepGetCurrentTime + public :: FARKStepGetCurrentState + public :: FARKStepGetCurrentGamma + public :: FARKStepGetCurrentMassMatrix + public :: FARKStepGetTolScaleFactor + public :: FARKStepGetErrWeights + public :: FARKStepGetResWeights + public :: FARKStepGetNumGEvals + public :: FARKStepGetRootInfo + public :: FARKStepGetNumConstrFails + public :: FARKStepGetUserData + public :: FARKStepPrintAllStats + public :: FARKStepGetReturnFlagName + public :: FARKStepWriteParameters + public :: FARKStepWriteButcher + public :: FARKStepGetStepStats + public :: FARKStepGetNonlinearSystemData + public :: FARKStepGetNumNonlinSolvIters + public :: FARKStepGetNumNonlinSolvConvFails + public :: FARKStepGetNonlinSolvStats + public :: FARKStepGetNumStepSolveFails + public :: FARKStepGetJac + public :: FARKStepGetJacTime + public :: FARKStepGetJacNumSteps + public :: FARKStepGetLinWorkSpace + public :: FARKStepGetNumJacEvals + public :: FARKStepGetNumPrecEvals + public :: FARKStepGetNumPrecSolves + public :: FARKStepGetNumLinIters + public :: FARKStepGetNumLinConvFails + public :: FARKStepGetNumJTSetupEvals + public :: FARKStepGetNumJtimesEvals + public :: FARKStepGetNumLinRhsEvals + public :: FARKStepGetLastLinFlag + public :: FARKStepGetMassWorkSpace + public :: FARKStepGetNumMassSetups + public :: FARKStepGetNumMassMultSetups + public :: FARKStepGetNumMassMult + public :: FARKStepGetNumMassSolves + public :: FARKStepGetNumMassPrecEvals + public :: FARKStepGetNumMassPrecSolves + public :: FARKStepGetNumMassIters + public :: FARKStepGetNumMassConvFails + public :: FARKStepGetNumMTSetups + public :: FARKStepGetLastMassFlag + public :: FARKStepGetLinReturnFlagName + public :: FARKStepFree + public :: FARKStepPrintMem + public :: FARKStepSetRelaxFn + public :: FARKStepSetRelaxEtaFail + public :: FARKStepSetRelaxLowerBound + public :: FARKStepSetRelaxMaxFails + public :: FARKStepSetRelaxMaxIters + public :: FARKStepSetRelaxSolver + public :: FARKStepSetRelaxResTol + public :: FARKStepSetRelaxTol + public :: FARKStepSetRelaxUpperBound + public :: FARKStepGetNumRelaxFnEvals + public :: FARKStepGetNumRelaxJacEvals + public :: FARKStepGetNumRelaxFails + public :: FARKStepGetNumRelaxBoundFails + public :: FARKStepGetNumRelaxSolveFails + public :: FARKStepGetNumRelaxSolveIters + +! WRAPPER DECLARATIONS +interface +function swigc_FARKStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetExplicit(farg1) & +bind(C, name="_wrap_FARKStepSetExplicit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetImplicit(farg1) & +bind(C, name="_wrap_FARKStepSetImplicit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetImEx(farg1) & +bind(C, name="_wrap_FARKStepSetImEx") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepSetTables") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTableNum(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetTableNum") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetTableName(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetTableName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetNumRhsEvals") & +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_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetCurrentButcherTables") & +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_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FARKStepGetTimestepperStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) & +bind(C, name="_wrap_FARKStepCreateMRIStepInnerStepper") & +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_FARKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKStepResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSStolerances") & +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_FARKStepSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FARKStepWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepResStolerance(farg1, farg2) & +bind(C, name="_wrap_FARKStepResStolerance") & +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_FARKStepResVtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKStepResVtolerance") & +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_FARKStepResFtolerance(farg1, farg2) & +bind(C, name="_wrap_FARKStepResFtolerance") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetLinearSolver") & +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_FARKStepSetMassLinearSolver(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKStepSetMassLinearSolver") & +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), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetDefaults(farg1) & +bind(C, name="_wrap_FARKStepSetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetOptimalParams(farg1) & +bind(C, name="_wrap_FARKStepSetOptimalParams") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetOrder(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetOrder") & +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_FARKStepSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetInterpolantType") & +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_FARKStepSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetInterpolantDegree") & +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_FARKStepSetDenseOrder(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetDenseOrder") & +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_FARKStepSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetNonlinearSolver") & +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_FARKStepSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetNlsRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetLinear(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetLinear") & +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_FARKStepSetNonlinear(farg1) & +bind(C, name="_wrap_FARKStepSetNonlinear") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetDeduceImplicitRhs(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetDeduceImplicitRhs") & +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_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) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetSafetyFactor") & +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_FARKStepSetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetErrorBias") & +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_FARKStepSetMaxGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxGrowth") & +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_FARKStepSetMinReduction(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMinReduction") & +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_FARKStepSetFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetFixedStepBounds") & +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_FARKStepSetAdaptivityMethod(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepSetAdaptivityMethod") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetAdaptivityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetAdaptivityFn") & +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_FARKStepSetMaxFirstGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxFirstGrowth") & +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_FARKStepSetMaxEFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxEFailGrowth") & +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_FARKStepSetSmallNumEFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetSmallNumEFails") & +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_FARKStepSetMaxCFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxCFailGrowth") & +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_FARKStepSetNonlinCRDown(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetNonlinCRDown") & +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_FARKStepSetNonlinRDiv(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetNonlinRDiv") & +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_FARKStepSetDeltaGammaMax(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetDeltaGammaMax") & +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_FARKStepSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetLSetupFrequency") & +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_FARKStepSetPredictorMethod(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetPredictorMethod") & +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_FARKStepSetStabilityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetStabilityFn") & +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_FARKStepSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxErrTestFails") & +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_FARKStepSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxNonlinIters") & +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_FARKStepSetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxConvFails") & +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_FARKStepSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetNonlinConvCoef") & +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_FARKStepSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetConstraints") & +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_FARKStepSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxHnilWarns") & +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_FARKStepSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetInitStep") & +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_FARKStepSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMinStep") & +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_FARKStepSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxStep") & +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_FARKStepSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetInterpolateStopTime") & +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_FARKStepSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetStopTime") & +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_FARKStepClearStopTime(farg1) & +bind(C, name="_wrap_FARKStepClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetFixedStep") & +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_FARKStepSetMaxNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMaxNumConstrFails") & +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_FARKStepSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRootDirection") & +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_FARKStepSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FARKStepSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetUserData") & +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_FARKStepSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetStagePredictFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetStagePredictFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetMassFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMassFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetLinearSolutionScaling") & +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_FARKStepSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetEpsLin") & +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_FARKStepSetMassEpsLin(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMassEpsLin") & +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_FARKStepSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetLSNormFactor") & +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_FARKStepSetMassLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetMassLSNormFactor") & +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_FARKStepSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetMassPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetMassPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetMassTimes(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKStepSetMassTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FARKStepEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FARKStepGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepComputeState") & +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_FARKStepGetNumExpSteps(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumExpSteps") & +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_FARKStepGetNumAccSteps(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumAccSteps") & +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_FARKStepGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumStepAttempts") & +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_FARKStepGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumLinSolvSetups") & +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_FARKStepGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumErrTestFails") & +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_FARKStepGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetEstLocalErrors") & +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_FARKStepGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetWorkSpace") & +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_FARKStepGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumSteps") & +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_FARKStepGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetActualInitStep") & +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_FARKStepGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetLastStep") & +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_FARKStepGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetCurrentStep") & +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_FARKStepGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetCurrentTime") & +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_FARKStepGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetCurrentState") & +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_FARKStepGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetCurrentGamma") & +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_FARKStepGetCurrentMassMatrix(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetCurrentMassMatrix") & +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_FARKStepGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetTolScaleFactor") & +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_FARKStepGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetErrWeights") & +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_FARKStepGetResWeights(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetResWeights") & +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_FARKStepGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumGEvals") & +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_FARKStepGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetRootInfo") & +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_FARKStepGetNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumConstrFails") & +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_FARKStepGetUserData(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetUserData") & +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_FARKStepPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FARKStepGetReturnFlagName(farg1) & +bind(C, name="_wrap_FARKStepGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FARKStepWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FARKStepWriteParameters") & +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_FARKStepWriteButcher(farg1, farg2) & +bind(C, name="_wrap_FARKStepWriteButcher") & +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_FARKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FARKStepGetStepStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FARKStepGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumNonlinSolvIters") & +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_FARKStepGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumNonlinSolvConvFails") & +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_FARKStepGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetNonlinSolvStats") & +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_FARKStepGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumStepSolveFails") & +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_FARKStepGetJac(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetJac") & +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_FARKStepGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetJacTime") & +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_FARKStepGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetJacNumSteps") & +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_FARKStepGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetLinWorkSpace") & +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_FARKStepGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumJacEvals") & +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_FARKStepGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumPrecEvals") & +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_FARKStepGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumPrecSolves") & +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_FARKStepGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumLinIters") & +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_FARKStepGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumLinConvFails") & +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_FARKStepGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumJTSetupEvals") & +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_FARKStepGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumJtimesEvals") & +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_FARKStepGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumLinRhsEvals") & +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_FARKStepGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetLastLinFlag") & +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_FARKStepGetMassWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetMassWorkSpace") & +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_FARKStepGetNumMassSetups(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassSetups") & +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_FARKStepGetNumMassMultSetups(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassMultSetups") & +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_FARKStepGetNumMassMult(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassMult") & +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_FARKStepGetNumMassSolves(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassSolves") & +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_FARKStepGetNumMassPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassPrecEvals") & +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_FARKStepGetNumMassPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassPrecSolves") & +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_FARKStepGetNumMassIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassIters") & +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_FARKStepGetNumMassConvFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMassConvFails") & +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_FARKStepGetNumMTSetups(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumMTSetups") & +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_FARKStepGetLastMassFlag(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetLastMassFlag") & +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_FARKStepGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FARKStepGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FARKStepFree(farg1) & +bind(C, name="_wrap_FARKStepFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FARKStepPrintMem(farg1, farg2) & +bind(C, name="_wrap_FARKStepPrintMem") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FARKStepSetRelaxFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetRelaxFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FARKStepSetRelaxEtaFail(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxEtaFail") & +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_FARKStepSetRelaxLowerBound(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxLowerBound") & +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_FARKStepSetRelaxMaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxMaxFails") & +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_FARKStepSetRelaxMaxIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxMaxIters") & +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_FARKStepSetRelaxSolver(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxSolver") & +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_FARKStepSetRelaxResTol(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxResTol") & +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_FARKStepSetRelaxTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepSetRelaxTol") & +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_FARKStepSetRelaxUpperBound(farg1, farg2) & +bind(C, name="_wrap_FARKStepSetRelaxUpperBound") & +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_FARKStepGetNumRelaxFnEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxFnEvals") & +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_FARKStepGetNumRelaxJacEvals(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxJacEvals") & +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_FARKStepGetNumRelaxFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxFails") & +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_FARKStepGetNumRelaxBoundFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxBoundFails") & +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_FARKStepGetNumRelaxSolveFails(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxSolveFails") & +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_FARKStepGetNumRelaxSolveIters(farg1, farg2) & +bind(C, name="_wrap_FARKStepGetNumRelaxSolveIters") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FARKStepCreate(fe, fi, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: fe +type(C_FUNPTR), intent(in), value :: fi +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = fe +farg2 = fi +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FARKStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepReInit(arkode_mem, fe, fi, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: fe +type(C_FUNPTR), intent(in), value :: fi +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = fe +farg3 = fi +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FARKStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepSetExplicit(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetExplicit(farg1) +swig_result = fresult +end function + +function FARKStepSetImplicit(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetImplicit(farg1) +swig_result = fresult +end function + +function FARKStepSetImEx(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetImEx(farg1) +swig_result = fresult +end function + +function FARKStepSetTables(arkode_mem, q, p, bi, be) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: q +integer(C_INT), intent(in) :: p +type(C_PTR) :: bi +type(C_PTR) :: be +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = q +farg3 = p +farg4 = bi +farg5 = be +fresult = swigc_FARKStepSetTables(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepSetTableNum(arkode_mem, itable, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_DIRKTableID), intent(in) :: itable +integer(ARKODE_ERKTableID), intent(in) :: etable +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = itable +farg3 = etable +fresult = swigc_FARKStepSetTableNum(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FARKStepSetTableName(arkode_mem, itable, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: itable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +character(kind=C_CHAR, len=*), target :: etable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 + +farg1 = arkode_mem +call SWIG_string_to_chararray(itable, farg2_chars, farg2) +call SWIG_string_to_chararray(etable, farg3_chars, farg3) +fresult = swigc_FARKStepSetTableName(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfe_evals(1)) +farg3 = c_loc(nfi_evals(1)) +fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetCurrentButcherTables(arkode_mem, bi, be) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: bi +type(C_PTR), target, intent(inout) :: be +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(bi) +farg3 = c_loc(be) +fresult = swigc_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, & + netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +farg3 = c_loc(accsteps(1)) +farg4 = c_loc(step_attempts(1)) +farg5 = c_loc(nfe_evals(1)) +farg6 = c_loc(nfi_evals(1)) +farg7 = c_loc(nlinsetups(1)) +farg8 = c_loc(netfails(1)) +fresult = swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FARKStepCreateMRIStepInnerStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) +swig_result = fresult +end function + +function FARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: hscale +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_FUNPTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(ynew) +farg3 = hscale +farg4 = t0 +farg5 = resize +farg6 = resize_data +fresult = swigc_FARKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKStepReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FARKStepReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSStolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FARKStepSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSVtolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FARKStepSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepWFtolerances(arkode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = efun +fresult = swigc_FARKStepWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FARKStepResStolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rabstol +fresult = swigc_FARKStepResStolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKStepResVtolerance(arkode_mem, rabstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rabstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rabstol) +fresult = swigc_FARKStepResVtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKStepResFtolerance(arkode_mem, rfun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = rfun +fresult = swigc_FARKStepResFtolerance(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetLinearSolver(arkode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FARKStepSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetMassLinearSolver(arkode_mem, ls, m, time_dep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: m +integer(C_INT), intent(in) :: time_dep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 + +farg1 = arkode_mem +farg2 = c_loc(ls) +farg3 = c_loc(m) +farg4 = time_dep +fresult = swigc_FARKStepSetMassLinearSolver(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKStepRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FARKStepRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetDefaults(farg1) +swig_result = fresult +end function + +function FARKStepSetOptimalParams(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetOptimalParams(farg1) +swig_result = fresult +end function + +function FARKStepSetOrder(arkode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxord +fresult = swigc_FARKStepSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FARKStepSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FARKStepSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetDenseOrder(arkode_mem, dord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: dord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = dord +fresult = swigc_FARKStepSetDenseOrder(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNonlinearSolver(arkode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nls) +fresult = swigc_FARKStepSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNlsRhsFn(arkode_mem, nls_fi) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: nls_fi +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = nls_fi +fresult = swigc_FARKStepSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetLinear(arkode_mem, timedepend) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: timedepend +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = timedepend +fresult = swigc_FARKStepSetLinear(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNonlinear(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetNonlinear(farg1) +swig_result = fresult +end function + +function FARKStepSetDeduceImplicitRhs(arkode_mem, deduce) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: deduce +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = deduce +fresult = swigc_FARKStepSetDeduceImplicitRhs(farg1, farg2) +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 +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: cfl_frac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = cfl_frac +fresult = swigc_FARKStepSetCFLFraction(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetSafetyFactor(arkode_mem, safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = safety +fresult = swigc_FARKStepSetSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetErrorBias(arkode_mem, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = bias +fresult = swigc_FARKStepSetErrorBias(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxGrowth(arkode_mem, mx_growth) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: mx_growth +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = mx_growth +fresult = swigc_FARKStepSetMaxGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMinReduction(arkode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_min +fresult = swigc_FARKStepSetMinReduction(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetFixedStepBounds(arkode_mem, lb, ub) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lb +real(C_DOUBLE), intent(in) :: ub +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = lb +farg3 = ub +fresult = swigc_FARKStepSetFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: imethod +integer(C_INT), intent(in) :: idefault +integer(C_INT), intent(in) :: pq +real(C_DOUBLE), dimension(3), target, intent(inout) :: adapt_params +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = imethod +farg3 = idefault +farg4 = pq +farg5 = c_loc(adapt_params(1)) +fresult = swigc_FARKStepSetAdaptivityMethod(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepSetAdaptivityFn(arkode_mem, hfun, h_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: hfun +type(C_PTR) :: h_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = hfun +farg3 = h_data +fresult = swigc_FARKStepSetAdaptivityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetMaxFirstGrowth(arkode_mem, etamx1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamx1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamx1 +fresult = swigc_FARKStepSetMaxFirstGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxEFailGrowth(arkode_mem, etamxf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamxf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamxf +fresult = swigc_FARKStepSetMaxEFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetSmallNumEFails(arkode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = small_nef +fresult = swigc_FARKStepSetSmallNumEFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxCFailGrowth(arkode_mem, etacf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etacf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etacf +fresult = swigc_FARKStepSetMaxCFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNonlinCRDown(arkode_mem, crdown) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: crdown +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = crdown +fresult = swigc_FARKStepSetNonlinCRDown(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNonlinRDiv(arkode_mem, rdiv) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rdiv +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = rdiv +fresult = swigc_FARKStepSetNonlinRDiv(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetDeltaGammaMax(arkode_mem, dgmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dgmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dgmax +fresult = swigc_FARKStepSetDeltaGammaMax(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetLSetupFrequency(arkode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = msbp +fresult = swigc_FARKStepSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetPredictorMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FARKStepSetPredictorMethod(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetStabilityFn(arkode_mem, estab, estab_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: estab +type(C_PTR) :: estab_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = estab +farg3 = estab_data +fresult = swigc_FARKStepSetStabilityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetMaxErrTestFails(arkode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxnef +fresult = swigc_FARKStepSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxNonlinIters(arkode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxcor +fresult = swigc_FARKStepSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxConvFails(arkode_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxncf +fresult = swigc_FARKStepSetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNonlinConvCoef(arkode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nlscoef +fresult = swigc_FARKStepSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetConstraints(arkode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(constraints) +fresult = swigc_FARKStepSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FARKStepSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxHnilWarns(arkode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = mxhnil +fresult = swigc_FARKStepSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetInitStep(arkode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hin +fresult = swigc_FARKStepSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMinStep(arkode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmin +fresult = swigc_FARKStepSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxStep(arkode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmax +fresult = swigc_FARKStepSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetInterpolateStopTime(arkode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = interp +fresult = swigc_FARKStepSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FARKStepSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FARKStepClearStopTime(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepClearStopTime(farg1) +swig_result = fresult +end function + +function FARKStepSetFixedStep(arkode_mem, hfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hfixed +fresult = swigc_FARKStepSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMaxNumConstrFails(arkode_mem, maxfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxfails +fresult = swigc_FARKStepSetMaxNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FARKStepSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKStepSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FARKStepSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FARKStepSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FARKStepSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FARKStepSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetStagePredictFn(arkode_mem, predictstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: predictstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = predictstage +fresult = swigc_FARKStepSetStagePredictFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetJacFn(arkode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jac +fresult = swigc_FARKStepSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMassFn(arkode_mem, mass) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: mass +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = mass +fresult = swigc_FARKStepSetMassFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetJacEvalFrequency(arkode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = msbj +fresult = swigc_FARKStepSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetLinearSolutionScaling(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FARKStepSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKStepSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMassEpsLin(arkode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eplifac +fresult = swigc_FARKStepSetMassEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKStepSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMassLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FARKStepSetMassLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKStepSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetMassPreconditioner(arkode_mem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = psetup +farg3 = psolve +fresult = swigc_FARKStepSetMassPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetJacTimes(arkode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FARKStepSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetJacTimesRhsFn(arkode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = jtimesrhsfn +fresult = swigc_FARKStepSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetMassTimes(arkode_mem, msetup, mtimes, mtimes_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: msetup +type(C_FUNPTR), intent(in), value :: mtimes +type(C_PTR) :: mtimes_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = msetup +farg3 = mtimes +farg4 = mtimes_data +fresult = swigc_FARKStepSetMassTimes(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKStepSetLinSysFn(arkode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = linsys +fresult = swigc_FARKStepSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + +function FARKStepEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FARKStepEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FARKStepGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FARKStepGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FARKStepComputeState(arkode_mem, zcor, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: zcor +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(zcor) +farg3 = c_loc(z) +fresult = swigc_FARKStepComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumExpSteps(arkode_mem, expsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +fresult = swigc_FARKStepGetNumExpSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumAccSteps(arkode_mem, accsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accsteps(1)) +fresult = swigc_FARKStepGetNumAccSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumStepAttempts(arkode_mem, step_attempts) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(step_attempts(1)) +fresult = swigc_FARKStepGetNumStepAttempts(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FARKStepGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumErrTestFails(arkode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FARKStepGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetEstLocalErrors(arkode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ele) +fresult = swigc_FARKStepGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetWorkSpace(arkode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +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 = arkode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FARKStepGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumSteps(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FARKStepGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetActualInitStep(arkode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FARKStepGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FARKStepGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetCurrentStep(arkode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FARKStepGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FARKStepGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetCurrentState(arkode_mem, state) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: state +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = state +fresult = swigc_FARKStepGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetCurrentGamma(arkode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FARKStepGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetCurrentMassMatrix(arkode_mem, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(m) +fresult = swigc_FARKStepGetCurrentMassMatrix(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetTolScaleFactor(arkode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FARKStepGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetErrWeights(arkode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(eweight) +fresult = swigc_FARKStepGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetResWeights(arkode_mem, rweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: rweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rweight) +fresult = swigc_FARKStepGetResWeights(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumGEvals(arkode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FARKStepGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FARKStepGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumConstrFails(arkode_mem, nconstrfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nconstrfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nconstrfails(1)) +fresult = swigc_FARKStepGetNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FARKStepGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FARKStepPrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FARKStepPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FARKStepGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKStepGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FARKStepWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FARKStepWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepWriteButcher(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FARKStepWriteButcher(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FARKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FARKStepGetNonlinearSystemData(arkode_mem, tcur, zpred, z, fi, gamma, sdata, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: zpred +type(C_PTR) :: z +type(C_PTR) :: fi +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +type(C_PTR) :: sdata +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +farg3 = zpred +farg4 = z +farg5 = fi +farg6 = c_loc(gamma(1)) +farg7 = sdata +farg8 = c_loc(user_data) +fresult = swigc_FARKStepGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FARKStepGetNumNonlinSolvIters(arkode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FARKStepGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumNonlinSolvConvFails(arkode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FARKStepGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNonlinSolvStats(arkode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FARKStepGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumStepSolveFails(arkode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FARKStepGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetJac(arkode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j) +fresult = swigc_FARKStepGetJac(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetJacTime(arkode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FARKStepGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetJacNumSteps(arkode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FARKStepGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetLinWorkSpace(arkode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FARKStepGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumJacEvals(arkode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FARKStepGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumPrecEvals(arkode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FARKStepGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumPrecSolves(arkode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FARKStepGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumLinIters(arkode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FARKStepGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumLinConvFails(arkode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FARKStepGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumJTSetupEvals(arkode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FARKStepGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumJtimesEvals(arkode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FARKStepGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumLinRhsEvals(arkode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FARKStepGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetLastLinFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKStepGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetMassWorkSpace(arkode_mem, lenrwmls, leniwmls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwmls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwmls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(lenrwmls(1)) +farg3 = c_loc(leniwmls(1)) +fresult = swigc_FARKStepGetMassWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepGetNumMassSetups(arkode_mem, nmsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsetups(1)) +fresult = swigc_FARKStepGetNumMassSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassMultSetups(arkode_mem, nmvsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvsetups(1)) +fresult = swigc_FARKStepGetNumMassMultSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassMult(arkode_mem, nmvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmvevals(1)) +fresult = swigc_FARKStepGetNumMassMult(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassSolves(arkode_mem, nmsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmsolves(1)) +fresult = swigc_FARKStepGetNumMassSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassPrecEvals(arkode_mem, nmpevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpevals(1)) +fresult = swigc_FARKStepGetNumMassPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassPrecSolves(arkode_mem, nmpsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmpsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmpsolves(1)) +fresult = swigc_FARKStepGetNumMassPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassIters(arkode_mem, nmiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmiters(1)) +fresult = swigc_FARKStepGetNumMassIters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMassConvFails(arkode_mem, nmcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmcfails(1)) +fresult = swigc_FARKStepGetNumMassConvFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumMTSetups(arkode_mem, nmtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nmtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nmtsetups(1)) +fresult = swigc_FARKStepGetNumMTSetups(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetLastMassFlag(arkode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FARKStepGetLastMassFlag(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FARKStepGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FARKStepFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FARKStepFree(farg1) +end subroutine + +subroutine FARKStepPrintMem(arkode_mem, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = outfile +call swigc_FARKStepPrintMem(farg1, farg2) +end subroutine + +function FARKStepSetRelaxFn(arkode_mem, rfn, rjac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfn +type(C_FUNPTR), intent(in), value :: rjac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = rfn +farg3 = rjac +fresult = swigc_FARKStepSetRelaxFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetRelaxEtaFail(arkode_mem, eta_rf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_rf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_rf +fresult = swigc_FARKStepSetRelaxEtaFail(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxLowerBound(arkode_mem, lower) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lower +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = lower +fresult = swigc_FARKStepSetRelaxLowerBound(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxMaxFails(arkode_mem, max_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_fails +fresult = swigc_FARKStepSetRelaxMaxFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxMaxIters(arkode_mem, max_iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_iters +fresult = swigc_FARKStepSetRelaxMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxSolver(arkode_mem, solver) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKRelaxSolver), intent(in) :: solver +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = solver +fresult = swigc_FARKStepSetRelaxSolver(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxResTol(arkode_mem, res_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: res_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = res_tol +fresult = swigc_FARKStepSetRelaxResTol(farg1, farg2) +swig_result = fresult +end function + +function FARKStepSetRelaxTol(arkode_mem, rel_tol, abs_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rel_tol +real(C_DOUBLE), intent(in) :: abs_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = rel_tol +farg3 = abs_tol +fresult = swigc_FARKStepSetRelaxTol(farg1, farg2, farg3) +swig_result = fresult +end function + +function FARKStepSetRelaxUpperBound(arkode_mem, upper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: upper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = upper +fresult = swigc_FARKStepSetRelaxUpperBound(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxFnEvals(arkode_mem, r_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: r_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(r_evals(1)) +fresult = swigc_FARKStepGetNumRelaxFnEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxJacEvals(arkode_mem, j_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: j_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j_evals(1)) +fresult = swigc_FARKStepGetNumRelaxJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxFails(arkode_mem, relax_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: relax_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(relax_fails(1)) +fresult = swigc_FARKStepGetNumRelaxFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxBoundFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKStepGetNumRelaxBoundFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxSolveFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FARKStepGetNumRelaxSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FARKStepGetNumRelaxSolveIters(arkode_mem, iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(iters(1)) +fresult = swigc_FARKStepGetNumRelaxSolveIters(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.c b/src/arkode/fmod_int64/farkode_erkstep_mod.c new file mode 100644 index 0000000000..5def57befc --- /dev/null +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.c @@ -0,0 +1,1563 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_erkstep.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FERKStepCreate(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (SUNContext)(farg4); + result = (void *)ERKStepCreate(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepReInit(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ERKStepReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetTable(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeButcherTable arg2 = (ARKodeButcherTable) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable)(farg2); + result = (int)ERKStepSetTable(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetTableNum(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_ERKTableID arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_ERKTableID)(*farg2); + result = (int)ERKStepSetTableNum(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)ERKStepSetTableName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetCurrentButcherTable(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeButcherTable *arg2 = (ARKodeButcherTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeButcherTable *)(farg2); + result = (int)ERKStepGetCurrentButcherTable(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetTimestepperStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + result = (int)ERKStepGetTimestepperStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepResize(void *farg1, N_Vector farg2, double const *farg3, double const *farg4, ARKVecResizeFn farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + ARKVecResizeFn arg5 = (ARKVecResizeFn) 0 ; + void *arg6 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (ARKVecResizeFn)(farg5); + arg6 = (void *)(farg6); + result = (int)ERKStepResize(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ERKStepReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ERKStepSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)ERKStepSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepWFtolerances(void *farg1, ARKEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKEwtFn arg2 = (ARKEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKEwtFn)(farg2); + result = (int)ERKStepWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)ERKStepRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ERKStepSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetDenseOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetDenseOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +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 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetCFLFraction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetErrorBias(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetErrorBias(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMaxGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMinReduction(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMinReduction(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ERKStepSetFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetAdaptivityMethod(void *farg1, int const *farg2, int const *farg3, int const *farg4, double *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (double *)(farg5); + result = (int)ERKStepSetAdaptivityMethod(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetAdaptivityFn(void *farg1, ARKAdaptFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKAdaptFn arg2 = (ARKAdaptFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKAdaptFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ERKStepSetAdaptivityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxFirstGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMaxFirstGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxEFailGrowth(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMaxEFailGrowth(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetSmallNumEFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetSmallNumEFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetStabilityFn(void *farg1, ARKExpStabFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKExpStabFn arg2 = (ARKExpStabFn) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKExpStabFn)(farg2); + arg3 = (void *)(farg3); + result = (int)ERKStepSetStabilityFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ERKStepSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)ERKStepSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ERKStepClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetMaxNumConstrFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetMaxNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ERKStepSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ERKStepSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)ERKStepSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ERKStepSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)ERKStepSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)ERKStepEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)ERKStepGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumExpSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumExpSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumAccSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumAccSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumStepAttempts(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumStepAttempts(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ERKStepGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ERKStepGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ERKStepGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ERKStepGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ERKStepGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ERKStepGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ERKStepGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)ERKStepGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)ERKStepGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumConstrFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumConstrFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)ERKStepGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)ERKStepPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FERKStepGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)ERKStepGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ERKStepWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepWriteButcher(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)ERKStepWriteButcher(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)ERKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FERKStepFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + ERKStepFree(arg1); +} + + +SWIGEXPORT void _wrap_FERKStepPrintMem(void *farg1, void *farg2) { + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + ERKStepPrintMem(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxFn arg2 = (ARKRelaxFn) 0 ; + ARKRelaxJacFn arg3 = (ARKRelaxJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxFn)(farg2); + arg3 = (ARKRelaxJacFn)(farg3); + result = (int)ERKStepSetRelaxFn(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxEtaFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetRelaxEtaFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxLowerBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetRelaxLowerBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxMaxFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetRelaxMaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxMaxIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)ERKStepSetRelaxMaxIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxSolver(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRelaxSolver arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRelaxSolver)(*farg2); + result = (int)ERKStepSetRelaxSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxResTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetRelaxResTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxTol(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)ERKStepSetRelaxTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepSetRelaxUpperBound(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ERKStepSetRelaxUpperBound(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxFnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxFnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxBoundFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxBoundFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FERKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRelaxSolveIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 new file mode 100644 index 0000000000..291dc643d5 --- /dev/null +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 @@ -0,0 +1,2566 @@ +! 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-2024, 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 farkode_erkstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_1 = ARKODE_FORWARD_EULER_1_1 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_2 = ARKODE_HEUN_EULER_2_1_2 + integer(C_INT), parameter, public :: ERKSTEP_DEFAULT_3 = ARKODE_BOGACKI_SHAMPINE_4_2_3 + 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 :: FERKStepReInit + public :: FERKStepSetTable + public :: FERKStepSetTableNum + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FERKStepSetTableName + public :: FERKStepGetNumRhsEvals + public :: FERKStepGetCurrentButcherTable + public :: FERKStepGetTimestepperStats + public :: FERKStepResize + public :: FERKStepReset + public :: FERKStepSStolerances + public :: FERKStepSVtolerances + public :: FERKStepWFtolerances + public :: FERKStepRootInit + public :: FERKStepSetDefaults + public :: FERKStepSetOrder + public :: FERKStepSetInterpolantType + public :: FERKStepSetInterpolantDegree + public :: FERKStepSetDenseOrder + public :: FERKStepSetAdaptController + public :: FERKStepSetAdaptivityAdjustment + public :: FERKStepSetCFLFraction + public :: FERKStepSetSafetyFactor + public :: FERKStepSetErrorBias + public :: FERKStepSetMaxGrowth + public :: FERKStepSetMinReduction + public :: FERKStepSetFixedStepBounds + public :: FERKStepSetAdaptivityMethod + public :: FERKStepSetAdaptivityFn + public :: FERKStepSetMaxFirstGrowth + public :: FERKStepSetMaxEFailGrowth + public :: FERKStepSetSmallNumEFails + public :: FERKStepSetStabilityFn + public :: FERKStepSetMaxErrTestFails + public :: FERKStepSetConstraints + public :: FERKStepSetMaxNumSteps + public :: FERKStepSetMaxHnilWarns + public :: FERKStepSetInitStep + public :: FERKStepSetMinStep + public :: FERKStepSetMaxStep + public :: FERKStepSetInterpolateStopTime + public :: FERKStepSetStopTime + public :: FERKStepClearStopTime + public :: FERKStepSetFixedStep + public :: FERKStepSetMaxNumConstrFails + public :: FERKStepSetRootDirection + public :: FERKStepSetNoInactiveRootWarn + public :: FERKStepSetUserData + public :: FERKStepSetPostprocessStepFn + public :: FERKStepSetPostprocessStageFn + public :: FERKStepEvolve + public :: FERKStepGetDky + public :: FERKStepGetNumExpSteps + public :: FERKStepGetNumAccSteps + public :: FERKStepGetNumStepAttempts + public :: FERKStepGetNumErrTestFails + public :: FERKStepGetEstLocalErrors + public :: FERKStepGetWorkSpace + public :: FERKStepGetNumSteps + public :: FERKStepGetActualInitStep + public :: FERKStepGetLastStep + public :: FERKStepGetCurrentStep + public :: FERKStepGetCurrentTime + public :: FERKStepGetTolScaleFactor + public :: FERKStepGetErrWeights + public :: FERKStepGetNumGEvals + public :: FERKStepGetRootInfo + public :: FERKStepGetNumConstrFails + public :: FERKStepGetUserData + public :: FERKStepPrintAllStats + public :: FERKStepGetReturnFlagName + public :: FERKStepWriteParameters + public :: FERKStepWriteButcher + public :: FERKStepGetStepStats + public :: FERKStepFree + public :: FERKStepPrintMem + public :: FERKStepSetRelaxFn + public :: FERKStepSetRelaxEtaFail + public :: FERKStepSetRelaxLowerBound + public :: FERKStepSetRelaxMaxFails + public :: FERKStepSetRelaxMaxIters + public :: FERKStepSetRelaxSolver + public :: FERKStepSetRelaxResTol + public :: FERKStepSetRelaxTol + public :: FERKStepSetRelaxUpperBound + public :: FERKStepGetNumRelaxFnEvals + public :: FERKStepGetNumRelaxJacEvals + public :: FERKStepGetNumRelaxFails + public :: FERKStepGetNumRelaxBoundFails + public :: FERKStepGetNumRelaxSolveFails + public :: FERKStepGetNumRelaxSolveIters + +! WRAPPER DECLARATIONS +interface +function swigc_FERKStepCreate(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FERKStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FERKStepReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FERKStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetTable(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTable") & +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_FERKStepSetTableNum(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTableNum") & +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_FERKStepSetTableName(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetTableName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRhsEvals") & +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_FERKStepGetCurrentButcherTable(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetCurrentButcherTable") & +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_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FERKStepGetTimestepperStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FERKStepResize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_FUNPTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSStolerances") & +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_FERKStepSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FERKStepWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetDefaults(farg1) & +bind(C, name="_wrap_FERKStepSetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetOrder(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetOrder") & +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_FERKStepSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetInterpolantType") & +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_FERKStepSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetInterpolantDegree") & +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_FERKStepSetDenseOrder(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetDenseOrder") & +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_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) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetSafetyFactor") & +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_FERKStepSetErrorBias(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetErrorBias") & +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_FERKStepSetMaxGrowth(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxGrowth") & +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_FERKStepSetMinReduction(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMinReduction") & +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_FERKStepSetFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSetFixedStepBounds") & +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_FERKStepSetAdaptivityMethod(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FERKStepSetAdaptivityMethod") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetAdaptivityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSetAdaptivityFn") & +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_FERKStepSetMaxFirstGrowth(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxFirstGrowth") & +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_FERKStepSetMaxEFailGrowth(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxEFailGrowth") & +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_FERKStepSetSmallNumEFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetSmallNumEFails") & +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_FERKStepSetStabilityFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSetStabilityFn") & +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_FERKStepSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxErrTestFails") & +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_FERKStepSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetConstraints") & +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_FERKStepSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxHnilWarns") & +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_FERKStepSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetInitStep") & +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_FERKStepSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMinStep") & +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_FERKStepSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxStep") & +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_FERKStepSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetInterpolateStopTime") & +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_FERKStepSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetStopTime") & +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_FERKStepClearStopTime(farg1) & +bind(C, name="_wrap_FERKStepClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetFixedStep") & +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_FERKStepSetMaxNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetMaxNumConstrFails") & +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_FERKStepSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRootDirection") & +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_FERKStepSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FERKStepSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetUserData(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetUserData") & +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_FERKStepSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FERKStepEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FERKStepGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepGetNumExpSteps(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumExpSteps") & +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_FERKStepGetNumAccSteps(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumAccSteps") & +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_FERKStepGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumStepAttempts") & +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_FERKStepGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumErrTestFails") & +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_FERKStepGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetEstLocalErrors") & +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_FERKStepGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepGetWorkSpace") & +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_FERKStepGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumSteps") & +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_FERKStepGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetActualInitStep") & +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_FERKStepGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetLastStep") & +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_FERKStepGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetCurrentStep") & +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_FERKStepGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetCurrentTime") & +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_FERKStepGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetTolScaleFactor") & +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_FERKStepGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetErrWeights") & +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_FERKStepGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumGEvals") & +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_FERKStepGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetRootInfo") & +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_FERKStepGetNumConstrFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumConstrFails") & +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_FERKStepGetUserData(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetUserData") & +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_FERKStepPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FERKStepGetReturnFlagName(farg1) & +bind(C, name="_wrap_FERKStepGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FERKStepWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FERKStepWriteParameters") & +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_FERKStepWriteButcher(farg1, farg2) & +bind(C, name="_wrap_FERKStepWriteButcher") & +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_FERKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FERKStepGetStepStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +subroutine swigc_FERKStepFree(farg1) & +bind(C, name="_wrap_FERKStepFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FERKStepPrintMem(farg1, farg2) & +bind(C, name="_wrap_FERKStepPrintMem") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FERKStepSetRelaxFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSetRelaxFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FERKStepSetRelaxEtaFail(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxEtaFail") & +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_FERKStepSetRelaxLowerBound(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxLowerBound") & +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_FERKStepSetRelaxMaxFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxMaxFails") & +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_FERKStepSetRelaxMaxIters(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxMaxIters") & +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_FERKStepSetRelaxSolver(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxSolver") & +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_FERKStepSetRelaxResTol(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxResTol") & +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_FERKStepSetRelaxTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FERKStepSetRelaxTol") & +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_FERKStepSetRelaxUpperBound(farg1, farg2) & +bind(C, name="_wrap_FERKStepSetRelaxUpperBound") & +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_FERKStepGetNumRelaxFnEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxFnEvals") & +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_FERKStepGetNumRelaxJacEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxJacEvals") & +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_FERKStepGetNumRelaxFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxFails") & +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_FERKStepGetNumRelaxBoundFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxBoundFails") & +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_FERKStepGetNumRelaxSolveFails(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxSolveFails") & +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_FERKStepGetNumRelaxSolveIters(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRelaxSolveIters") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FERKStepCreate(f, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: f +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = f +farg2 = t0 +farg3 = c_loc(y0) +farg4 = sunctx +fresult = swigc_FERKStepCreate(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FERKStepReInit(arkode_mem, f, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: f +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = f +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FERKStepReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FERKStepSetTable(arkode_mem, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = b +fresult = swigc_FERKStepSetTable(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetTableNum(arkode_mem, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_ERKTableID), intent(in) :: etable +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = etable +fresult = swigc_FERKStepSetTableNum(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FERKStepSetTableName(arkode_mem, etable) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: etable +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(etable, farg2_chars, farg2) +fresult = swigc_FERKStepSetTableName(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetCurrentButcherTable(arkode_mem, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(b) +fresult = swigc_FERKStepGetCurrentButcherTable(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +farg3 = c_loc(accsteps(1)) +farg4 = c_loc(step_attempts(1)) +farg5 = c_loc(nfevals(1)) +farg6 = c_loc(netfails(1)) +fresult = swigc_FERKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ynew +real(C_DOUBLE), intent(in) :: hscale +real(C_DOUBLE), intent(in) :: t0 +type(C_FUNPTR), intent(in), value :: resize +type(C_PTR) :: resize_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_FUNPTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(ynew) +farg3 = hscale +farg4 = t0 +farg5 = resize +farg6 = resize_data +fresult = swigc_FERKStepResize(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FERKStepReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FERKStepReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSStolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FERKStepSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSVtolerances(arkode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FERKStepSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepWFtolerances(arkode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = efun +fresult = swigc_FERKStepWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FERKStepRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FERKStepRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FERKStepSetDefaults(farg1) +swig_result = fresult +end function + +function FERKStepSetOrder(arkode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxord +fresult = swigc_FERKStepSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FERKStepSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FERKStepSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetDenseOrder(arkode_mem, dord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: dord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = dord +fresult = swigc_FERKStepSetDenseOrder(farg1, farg2) +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 +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: cfl_frac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = cfl_frac +fresult = swigc_FERKStepSetCFLFraction(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetSafetyFactor(arkode_mem, safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = safety +fresult = swigc_FERKStepSetSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetErrorBias(arkode_mem, bias) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: bias +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = bias +fresult = swigc_FERKStepSetErrorBias(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxGrowth(arkode_mem, mx_growth) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: mx_growth +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = mx_growth +fresult = swigc_FERKStepSetMaxGrowth(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMinReduction(arkode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_min +fresult = swigc_FERKStepSetMinReduction(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetFixedStepBounds(arkode_mem, lb, ub) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lb +real(C_DOUBLE), intent(in) :: ub +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = lb +farg3 = ub +fresult = swigc_FERKStepSetFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: imethod +integer(C_INT), intent(in) :: idefault +integer(C_INT), intent(in) :: pq +real(C_DOUBLE), dimension(3), target, intent(inout) :: adapt_params +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = imethod +farg3 = idefault +farg4 = pq +farg5 = c_loc(adapt_params(1)) +fresult = swigc_FERKStepSetAdaptivityMethod(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FERKStepSetAdaptivityFn(arkode_mem, hfun, h_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: hfun +type(C_PTR) :: h_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = hfun +farg3 = h_data +fresult = swigc_FERKStepSetAdaptivityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetMaxFirstGrowth(arkode_mem, etamx1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamx1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamx1 +fresult = swigc_FERKStepSetMaxFirstGrowth(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxEFailGrowth(arkode_mem, etamxf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: etamxf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = etamxf +fresult = swigc_FERKStepSetMaxEFailGrowth(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetSmallNumEFails(arkode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = small_nef +fresult = swigc_FERKStepSetSmallNumEFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetStabilityFn(arkode_mem, estab, estab_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: estab +type(C_PTR) :: estab_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = estab +farg3 = estab_data +fresult = swigc_FERKStepSetStabilityFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetMaxErrTestFails(arkode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxnef +fresult = swigc_FERKStepSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetConstraints(arkode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(constraints) +fresult = swigc_FERKStepSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FERKStepSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxHnilWarns(arkode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = mxhnil +fresult = swigc_FERKStepSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetInitStep(arkode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hin +fresult = swigc_FERKStepSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMinStep(arkode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmin +fresult = swigc_FERKStepSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxStep(arkode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hmax +fresult = swigc_FERKStepSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetInterpolateStopTime(arkode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = interp +fresult = swigc_FERKStepSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FERKStepSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FERKStepClearStopTime(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FERKStepClearStopTime(farg1) +swig_result = fresult +end function + +function FERKStepSetFixedStep(arkode_mem, hfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hfixed +fresult = swigc_FERKStepSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetMaxNumConstrFails(arkode_mem, maxfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxfails +fresult = swigc_FERKStepSetMaxNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FERKStepSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FERKStepSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FERKStepSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FERKStepSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FERKStepSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FERKStepSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FERKStepEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FERKStepEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FERKStepGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FERKStepGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FERKStepGetNumExpSteps(arkode_mem, expsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: expsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(expsteps(1)) +fresult = swigc_FERKStepGetNumExpSteps(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumAccSteps(arkode_mem, accsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: accsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accsteps(1)) +fresult = swigc_FERKStepGetNumAccSteps(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumStepAttempts(arkode_mem, step_attempts) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(step_attempts(1)) +fresult = swigc_FERKStepGetNumStepAttempts(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumErrTestFails(arkode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FERKStepGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetEstLocalErrors(arkode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ele) +fresult = swigc_FERKStepGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetWorkSpace(arkode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +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 = arkode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FERKStepGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepGetNumSteps(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FERKStepGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetActualInitStep(arkode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FERKStepGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FERKStepGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetCurrentStep(arkode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FERKStepGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FERKStepGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetTolScaleFactor(arkode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FERKStepGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetErrWeights(arkode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(eweight) +fresult = swigc_FERKStepGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumGEvals(arkode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FERKStepGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FERKStepGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumConstrFails(arkode_mem, nconstrfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nconstrfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nconstrfails(1)) +fresult = swigc_FERKStepGetNumConstrFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FERKStepGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FERKStepPrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FERKStepPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FERKStepGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FERKStepGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FERKStepWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FERKStepWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FERKStepWriteButcher(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FERKStepWriteButcher(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FERKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +subroutine FERKStepFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FERKStepFree(farg1) +end subroutine + +subroutine FERKStepPrintMem(arkode_mem, outfile) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = outfile +call swigc_FERKStepPrintMem(farg1, farg2) +end subroutine + +function FERKStepSetRelaxFn(arkode_mem, rfn, rjac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rfn +type(C_FUNPTR), intent(in), value :: rjac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = rfn +farg3 = rjac +fresult = swigc_FERKStepSetRelaxFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetRelaxEtaFail(arkode_mem, eta_rf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: eta_rf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = eta_rf +fresult = swigc_FERKStepSetRelaxEtaFail(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxLowerBound(arkode_mem, lower) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: lower +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = lower +fresult = swigc_FERKStepSetRelaxLowerBound(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxMaxFails(arkode_mem, max_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_fails +fresult = swigc_FERKStepSetRelaxMaxFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxMaxIters(arkode_mem, max_iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: max_iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = max_iters +fresult = swigc_FERKStepSetRelaxMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxSolver(arkode_mem, solver) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKRelaxSolver), intent(in) :: solver +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = solver +fresult = swigc_FERKStepSetRelaxSolver(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxResTol(arkode_mem, res_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: res_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = res_tol +fresult = swigc_FERKStepSetRelaxResTol(farg1, farg2) +swig_result = fresult +end function + +function FERKStepSetRelaxTol(arkode_mem, rel_tol, abs_tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: rel_tol +real(C_DOUBLE), intent(in) :: abs_tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = rel_tol +farg3 = abs_tol +fresult = swigc_FERKStepSetRelaxTol(farg1, farg2, farg3) +swig_result = fresult +end function + +function FERKStepSetRelaxUpperBound(arkode_mem, upper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: upper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = upper +fresult = swigc_FERKStepSetRelaxUpperBound(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxFnEvals(arkode_mem, r_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: r_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(r_evals(1)) +fresult = swigc_FERKStepGetNumRelaxFnEvals(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxJacEvals(arkode_mem, j_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: j_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(j_evals(1)) +fresult = swigc_FERKStepGetNumRelaxJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxFails(arkode_mem, relax_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: relax_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(relax_fails(1)) +fresult = swigc_FERKStepGetNumRelaxFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxBoundFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FERKStepGetNumRelaxBoundFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxSolveFails(arkode_mem, fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(fails(1)) +fresult = swigc_FERKStepGetNumRelaxSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FERKStepGetNumRelaxSolveIters(arkode_mem, iters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: iters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(iters(1)) +fresult = swigc_FERKStepGetNumRelaxSolveIters(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c similarity index 100% rename from src/arkode/fmod/farkode_mod.c rename to src/arkode/fmod_int64/farkode_mod.c diff --git a/src/arkode/fmod/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 similarity index 100% rename from src/arkode/fmod/farkode_mod.f90 rename to src/arkode/fmod_int64/farkode_mod.f90 diff --git a/src/arkode/fmod/farkode_mristep_mod.c b/src/arkode/fmod_int64/farkode_mristep_mod.c similarity index 100% rename from src/arkode/fmod/farkode_mristep_mod.c rename to src/arkode/fmod_int64/farkode_mristep_mod.c diff --git a/src/arkode/fmod/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 similarity index 100% rename from src/arkode/fmod/farkode_mristep_mod.f90 rename to src/arkode/fmod_int64/farkode_mristep_mod.f90 diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.c b/src/arkode/fmod_int64/farkode_sprkstep_mod.c new file mode 100644 index 0000000000..28cfb297d4 --- /dev/null +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.c @@ -0,0 +1,767 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_sprkstep.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FSPRKStepCreate(ARKRhsFn farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)SPRKStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + ARKRhsFn arg3 = (ARKRhsFn) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (ARKRhsFn)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)SPRKStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeSPRKTable arg2 = (ARKodeSPRKTable) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeSPRKTable)(farg2); + result = (int)SPRKStepSetMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetMethodName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)SPRKStepSetMethodName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetCurrentMethod(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKodeSPRKTable *arg2 = (ARKodeSPRKTable *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKodeSPRKTable *)(farg2); + result = (int)SPRKStepGetCurrentMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)SPRKStepReset(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepRootInit(void *farg1, int const *farg2, ARKRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + ARKRootFn arg3 = (ARKRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (ARKRootFn)(farg3); + result = (int)SPRKStepRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)SPRKStepSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)SPRKStepSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetDefaults(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)SPRKStepSetDefaults(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetOrder(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetInterpolantType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetInterpolantType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetInterpolantDegree(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetInterpolantDegree(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)SPRKStepSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SPRKStepSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetFixedStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)SPRKStepSetFixedStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)SPRKStepSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetPostprocessStepFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)SPRKStepSetPostprocessStepFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepSetPostprocessStageFn(void *farg1, ARKPostProcessFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKPostProcessFn arg2 = (ARKPostProcessFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKPostProcessFn)(farg2); + result = (int)SPRKStepSetPostprocessStageFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)SPRKStepEvolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)SPRKStepGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FSPRKStepGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)SPRKStepGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)SPRKStepGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)SPRKStepGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)SPRKStepGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)SPRKStepGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetNumStepAttempts(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)SPRKStepGetNumStepAttempts(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)SPRKStepGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)SPRKStepGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)SPRKStepGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)SPRKStepPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepWriteParameters(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + result = (int)SPRKStepWriteParameters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSPRKStepGetStepStats(void *farg1, long *farg2, double *farg3, double *farg4, double *farg5, double *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (int)SPRKStepGetStepStats(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FSPRKStepFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + SPRKStepFree(arg1); +} + + + diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 new file mode 100644 index 0000000000..82217e7b1b --- /dev/null +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 @@ -0,0 +1,1081 @@ +! 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-2024, 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 farkode_sprkstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_1 = ARKODE_SPRK_EULER_1_1 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_2 = ARKODE_SPRK_LEAPFROG_2_2 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_3 = ARKODE_SPRK_MCLACHLAN_3_3 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_4 = ARKODE_SPRK_MCLACHLAN_4_4 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_5 = ARKODE_SPRK_MCLACHLAN_5_6 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_6 = ARKODE_SPRK_YOSHIDA_6_8 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_8 = ARKODE_SPRK_SUZUKI_UMENO_8_16 + integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36 + public :: FSPRKStepCreate + public :: FSPRKStepReInit + public :: FSPRKStepSetUseCompensatedSums + public :: FSPRKStepSetMethod + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FSPRKStepSetMethodName + public :: FSPRKStepGetCurrentMethod + public :: FSPRKStepGetNumRhsEvals + public :: FSPRKStepReset + public :: FSPRKStepRootInit + public :: FSPRKStepSetRootDirection + public :: FSPRKStepSetNoInactiveRootWarn + public :: FSPRKStepSetDefaults + public :: FSPRKStepSetOrder + public :: FSPRKStepSetInterpolantType + public :: FSPRKStepSetInterpolantDegree + public :: FSPRKStepSetMaxNumSteps + public :: FSPRKStepSetStopTime + public :: FSPRKStepSetFixedStep + public :: FSPRKStepSetUserData + public :: FSPRKStepSetPostprocessStepFn + public :: FSPRKStepSetPostprocessStageFn + public :: FSPRKStepEvolve + public :: FSPRKStepGetDky + public :: FSPRKStepGetReturnFlagName + public :: FSPRKStepGetCurrentState + public :: FSPRKStepGetCurrentStep + public :: FSPRKStepGetCurrentTime + public :: FSPRKStepGetLastStep + public :: FSPRKStepGetNumStepAttempts + public :: FSPRKStepGetNumSteps + public :: FSPRKStepGetRootInfo + public :: FSPRKStepGetUserData + public :: FSPRKStepPrintAllStats + public :: FSPRKStepWriteParameters + public :: FSPRKStepGetStepStats + public :: FSPRKStepFree + +! WRAPPER DECLARATIONS +interface +function swigc_FSPRKStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSPRKStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSPRKStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & +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_FSPRKStepSetMethod(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetMethod") & +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_FSPRKStepSetMethodName(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetMethodName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepGetCurrentMethod(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetCurrentMethod") & +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_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & +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_FSPRKStepReset(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepReset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetRootDirection") & +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_FSPRKStepSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FSPRKStepSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetDefaults(farg1) & +bind(C, name="_wrap_FSPRKStepSetDefaults") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetOrder(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetOrder") & +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_FSPRKStepSetInterpolantType(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetInterpolantType") & +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_FSPRKStepSetInterpolantDegree(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetInterpolantDegree") & +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_FSPRKStepSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetStopTime") & +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_FSPRKStepSetFixedStep(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetFixedStep") & +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_FSPRKStepSetUserData(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetUserData") & +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_FSPRKStepSetPostprocessStepFn(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetPostprocessStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepSetPostprocessStageFn(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetPostprocessStageFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepEvolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSPRKStepEvolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSPRKStepGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FSPRKStepGetReturnFlagName(farg1) & +bind(C, name="_wrap_FSPRKStepGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FSPRKStepGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetCurrentState") & +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_FSPRKStepGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetCurrentStep") & +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_FSPRKStepGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetCurrentTime") & +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_FSPRKStepGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetLastStep") & +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_FSPRKStepGetNumStepAttempts(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetNumStepAttempts") & +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_FSPRKStepGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetNumSteps") & +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_FSPRKStepGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetRootInfo") & +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_FSPRKStepGetUserData(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepGetUserData") & +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_FSPRKStepPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSPRKStepWriteParameters(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepWriteParameters") & +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_FSPRKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSPRKStepGetStepStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +subroutine swigc_FSPRKStepFree(farg1) & +bind(C, name="_wrap_FSPRKStepFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSPRKStepCreate(f1, f2, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: f1 +type(C_FUNPTR), intent(in), value :: f2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = f1 +farg2 = f2 +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FSPRKStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSPRKStepReInit(arkode_mem, f1, f2, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: f1 +type(C_FUNPTR), intent(in), value :: f2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = f1 +farg3 = f2 +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetMethod(arkode_mem, sprk_storage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: sprk_storage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = sprk_storage +fresult = swigc_FSPRKStepSetMethod(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FSPRKStepSetMethodName(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: method +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(method, farg2_chars, farg2) +fresult = swigc_FSPRKStepSetMethodName(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetCurrentMethod(arkode_mem, sprk_storage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: sprk_storage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(sprk_storage) +fresult = swigc_FSPRKStepGetCurrentMethod(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nf1 +integer(C_LONG), dimension(*), target, intent(inout) :: nf2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nf1(1)) +farg3 = c_loc(nf2(1)) +fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSPRKStepReset(arkode_mem, tr, yr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: yr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = tr +farg3 = c_loc(yr) +fresult = swigc_FSPRKStepReset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSPRKStepRootInit(arkode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = arkode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FSPRKStepRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSPRKStepSetRootDirection(arkode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FSPRKStepSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetNoInactiveRootWarn(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FSPRKStepSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FSPRKStepSetDefaults(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FSPRKStepSetDefaults(farg1) +swig_result = fresult +end function + +function FSPRKStepSetOrder(arkode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = maxord +fresult = swigc_FSPRKStepSetOrder(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetInterpolantType(arkode_mem, itype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: itype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = itype +fresult = swigc_FSPRKStepSetInterpolantType(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetInterpolantDegree(arkode_mem, degree) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: degree +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = degree +fresult = swigc_FSPRKStepSetInterpolantDegree(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetMaxNumSteps(arkode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = mxsteps +fresult = swigc_FSPRKStepSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetStopTime(arkode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = tstop +fresult = swigc_FSPRKStepSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetFixedStep(arkode_mem, hfixed) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: hfixed +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = hfixed +fresult = swigc_FSPRKStepSetFixedStep(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = user_data +fresult = swigc_FSPRKStepSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetPostprocessStepFn(arkode_mem, processstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstep +fresult = swigc_FSPRKStepSetPostprocessStepFn(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepSetPostprocessStageFn(arkode_mem, processstage) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: processstage +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = processstage +fresult = swigc_FSPRKStepSetPostprocessStageFn(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepEvolve(arkode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = arkode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FSPRKStepEvolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSPRKStepGetDky(arkode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FSPRKStepGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FSPRKStepGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FSPRKStepGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FSPRKStepGetCurrentState(arkode_mem, state) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: state +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = state +fresult = swigc_FSPRKStepGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetCurrentStep(arkode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FSPRKStepGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetCurrentTime(arkode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FSPRKStepGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetLastStep(arkode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FSPRKStepGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetNumStepAttempts(arkode_mem, step_attempts) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: step_attempts +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(step_attempts(1)) +fresult = swigc_FSPRKStepGetNumStepAttempts(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetNumSteps(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FSPRKStepGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetRootInfo(arkode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FSPRKStepGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetUserData(arkode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(user_data) +fresult = swigc_FSPRKStepGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepPrintAllStats(arkode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = arkode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FSPRKStepPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSPRKStepWriteParameters(arkode_mem, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = fp +fresult = swigc_FSPRKStepWriteParameters(farg1, farg2) +swig_result = fresult +end function + +function FSPRKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = arkode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(hinused(1)) +farg4 = c_loc(hlast(1)) +farg5 = c_loc(hcur(1)) +farg6 = c_loc(tcur(1)) +fresult = swigc_FSPRKStepGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +subroutine FSPRKStepFree(arkode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: arkode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(arkode_mem) +call swigc_FSPRKStepFree(farg1) +end subroutine + + +end module diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index ca1e745b98..7a3e01613a 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -142,5 +142,5 @@ message(STATUS "Added CVODE module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/cvode/fmod/CMakeLists.txt b/src/cvode/fmod_int32/CMakeLists.txt similarity index 100% rename from src/cvode/fmod/CMakeLists.txt rename to src/cvode/fmod_int32/CMakeLists.txt diff --git a/src/cvode/fmod_int32/fcvode_mod.c b/src/cvode/fmod_int32/fcvode_mod.c new file mode 100644 index 0000000000..d7ebeac053 --- /dev/null +++ b/src/cvode/fmod_int32/fcvode_mod.c @@ -0,0 +1,2020 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "cvode/cvode.h" +#include "cvode/cvode_bandpre.h" +#include "cvode/cvode_bbdpre.h" +#include "cvode/cvode_diag.h" +#include "cvode/cvode_ls.h" +#include "cvode/cvode_proj.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FCVodeCreate(int const *farg1, void *farg2) { + void * fresult ; + int arg1 ; + SUNContext arg2 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (int)(*farg1); + arg2 = (SUNContext)(farg2); + result = (void *)CVodeCreate(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeReInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeWFtolerances(void *farg1, CVEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVEwtFn arg2 = (CVEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVEwtFn)(farg2); + result = (int)CVodeWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxLSetup(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetDeltaGammaMaxLSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLSetupFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxOrd(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxOrd(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMonitorFn(void *farg1, CVMonitorFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVMonitorFn arg2 = (CVMonitorFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVMonitorFn)(farg2); + result = (int)CVodeSetMonitorFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMonitorFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetMonitorFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNlsRhsFn(void *farg1, CVRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + result = (int)CVodeSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)CVodeSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetStabLimDet(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetStabLimDet(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetUseIntegratorFusedKernels(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetUseIntegratorFusedKernels(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)CVodeSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetEtaFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxFirstStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxEarlyStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxEarlyStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNumStepsEtaMaxEarlyStep(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetNumStepsEtaMaxEarlyStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMinErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNumFailsEtaMaxErrFail(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetNumFailsEtaMaxErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaConvFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaConvFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeRootInit(void *farg1, int const *farg2, CVRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVRootFn arg3 = (CVRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVRootFn)(farg3); + result = (int)CVodeRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVode(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)CVode(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetLastOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetCurrentOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStabLimOrderReds(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStabLimOrderReds(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)CVodeGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, int *farg6, int *farg7, double *farg8, double *farg9, double *farg10, double *farg11) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (int *)(farg6); + arg7 = (int *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); + result = (int)CVodeGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, double *farg7, void *farg8, void *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + N_Vector *arg8 = (N_Vector *) 0 ; + void **arg9 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (N_Vector *)(farg8); + arg9 = (void **)(farg9); + result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)CVodeGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodePrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)CVodePrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVodeGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVodeGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + CVodeFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimesRhsFn(void *farg1, CVRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + result = (int)CVodeSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + result = (int)CVBandPrecInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVBandPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVBandPrecGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, CVLocalFn farg8, CVCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + CVLocalFn arg8 = (CVLocalFn) 0 ; + CVCommFn arg9 = (CVCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (CVLocalFn)(farg8); + arg9 = (CVCommFn)(farg9); + result = (int)CVBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecReInit(void *farg1, int32_t const *farg2, int32_t const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)CVBBDPrecReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVBBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVBBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiag(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVDiag(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVDiagGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVDiagGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetLastFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVDiagGetLastFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVDiagGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVDiagGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)CVodeSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacFn(void *farg1, CVLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsJacFn arg2 = (CVLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsJacFn)(farg2); + result = (int)CVodeSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetDeltaGammaMaxBadJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetPreconditioner(void *farg1, CVLsPrecSetupFn farg2, CVLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsPrecSetupFn arg2 = (CVLsPrecSetupFn) 0 ; + CVLsPrecSolveFn arg3 = (CVLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsPrecSetupFn)(farg2); + arg3 = (CVLsPrecSolveFn)(farg3); + result = (int)CVodeSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimes(void *farg1, CVLsJacTimesSetupFn farg2, CVLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsJacTimesSetupFn arg2 = (CVLsJacTimesSetupFn) 0 ; + CVLsJacTimesVecFn arg3 = (CVLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsJacTimesSetupFn)(farg2); + arg3 = (CVLsJacTimesVecFn)(farg3); + result = (int)CVodeSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinSysFn(void *farg1, CVLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsLinSysFn arg2 = (CVLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsLinSysFn)(farg2); + result = (int)CVodeSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)CVodeGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLinSolveStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6, long *farg7, long *farg8, long *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + long *arg7 = (long *) 0 ; + long *arg8 = (long *) 0 ; + long *arg9 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + arg7 = (long *)(farg7); + arg8 = (long *)(farg8); + arg9 = (long *)(farg9); + result = (int)CVodeGetLinSolveStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVodeGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVodeGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetProjFn(void *farg1, CVProjFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVProjFn arg2 = (CVProjFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVProjFn)(farg2); + result = (int)CVodeSetProjFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetProjErrEst(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetProjErrEst(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetProjFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetProjFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNumProjFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxNumProjFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEpsProj(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEpsProj(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetProjFailEta(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetProjFailEta(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumProjEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumProjEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumProjFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumProjFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/cvode/fmod_int32/fcvode_mod.f90 b/src/cvode/fmod_int32/fcvode_mod.f90 new file mode 100644 index 0000000000..6a597e65da --- /dev/null +++ b/src/cvode/fmod_int32/fcvode_mod.f90 @@ -0,0 +1,3436 @@ +! 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-2024, 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 fcvode_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: CV_ADAMS = 1_C_INT + integer(C_INT), parameter, public :: CV_BDF = 2_C_INT + integer(C_INT), parameter, public :: CV_NORMAL = 1_C_INT + integer(C_INT), parameter, public :: CV_ONE_STEP = 2_C_INT + integer(C_INT), parameter, public :: CV_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CV_TSTOP_RETURN = 1_C_INT + integer(C_INT), parameter, public :: CV_ROOT_RETURN = 2_C_INT + integer(C_INT), parameter, public :: CV_WARNING = 99_C_INT + integer(C_INT), parameter, public :: CV_TOO_MUCH_WORK = -1_C_INT + integer(C_INT), parameter, public :: CV_TOO_MUCH_ACC = -2_C_INT + integer(C_INT), parameter, public :: CV_ERR_FAILURE = -3_C_INT + integer(C_INT), parameter, public :: CV_CONV_FAILURE = -4_C_INT + integer(C_INT), parameter, public :: CV_LINIT_FAIL = -5_C_INT + integer(C_INT), parameter, public :: CV_LSETUP_FAIL = -6_C_INT + integer(C_INT), parameter, public :: CV_LSOLVE_FAIL = -7_C_INT + integer(C_INT), parameter, public :: CV_RHSFUNC_FAIL = -8_C_INT + integer(C_INT), parameter, public :: CV_FIRST_RHSFUNC_ERR = -9_C_INT + integer(C_INT), parameter, public :: CV_REPTD_RHSFUNC_ERR = -10_C_INT + integer(C_INT), parameter, public :: CV_UNREC_RHSFUNC_ERR = -11_C_INT + integer(C_INT), parameter, public :: CV_RTFUNC_FAIL = -12_C_INT + integer(C_INT), parameter, public :: CV_NLS_INIT_FAIL = -13_C_INT + integer(C_INT), parameter, public :: CV_NLS_SETUP_FAIL = -14_C_INT + integer(C_INT), parameter, public :: CV_CONSTR_FAIL = -15_C_INT + integer(C_INT), parameter, public :: CV_NLS_FAIL = -16_C_INT + integer(C_INT), parameter, public :: CV_MEM_FAIL = -20_C_INT + integer(C_INT), parameter, public :: CV_MEM_NULL = -21_C_INT + integer(C_INT), parameter, public :: CV_ILL_INPUT = -22_C_INT + integer(C_INT), parameter, public :: CV_NO_MALLOC = -23_C_INT + integer(C_INT), parameter, public :: CV_BAD_K = -24_C_INT + integer(C_INT), parameter, public :: CV_BAD_T = -25_C_INT + integer(C_INT), parameter, public :: CV_BAD_DKY = -26_C_INT + integer(C_INT), parameter, public :: CV_TOO_CLOSE = -27_C_INT + integer(C_INT), parameter, public :: CV_VECTOROP_ERR = -28_C_INT + integer(C_INT), parameter, public :: CV_PROJ_MEM_NULL = -29_C_INT + integer(C_INT), parameter, public :: CV_PROJFUNC_FAIL = -30_C_INT + integer(C_INT), parameter, public :: CV_REPTD_PROJFUNC_ERR = -31_C_INT + integer(C_INT), parameter, public :: CV_CONTEXT_ERR = -32_C_INT + integer(C_INT), parameter, public :: CV_UNRECOGNIZED_ERR = -99_C_INT + public :: FCVodeCreate + public :: FCVodeInit + public :: FCVodeReInit + public :: FCVodeSStolerances + public :: FCVodeSVtolerances + public :: FCVodeWFtolerances + public :: FCVodeSetConstraints + public :: FCVodeSetDeltaGammaMaxLSetup + public :: FCVodeSetInitStep + public :: FCVodeSetLSetupFrequency + public :: FCVodeSetMaxConvFails + public :: FCVodeSetMaxErrTestFails + public :: FCVodeSetMaxHnilWarns + public :: FCVodeSetMaxNonlinIters + public :: FCVodeSetMaxNumSteps + public :: FCVodeSetMaxOrd + public :: FCVodeSetMaxStep + public :: FCVodeSetMinStep + public :: FCVodeSetMonitorFn + public :: FCVodeSetMonitorFrequency + public :: FCVodeSetNlsRhsFn + public :: FCVodeSetNonlinConvCoef + public :: FCVodeSetNonlinearSolver + public :: FCVodeSetStabLimDet + public :: FCVodeSetStopTime + public :: FCVodeSetInterpolateStopTime + public :: FCVodeClearStopTime + public :: FCVodeSetUseIntegratorFusedKernels + public :: FCVodeSetUserData + public :: FCVodeSetEtaFixedStepBounds + public :: FCVodeSetEtaMaxFirstStep + public :: FCVodeSetEtaMaxEarlyStep + public :: FCVodeSetNumStepsEtaMaxEarlyStep + public :: FCVodeSetEtaMax + public :: FCVodeSetEtaMin + public :: FCVodeSetEtaMinErrFail + public :: FCVodeSetEtaMaxErrFail + public :: FCVodeSetNumFailsEtaMaxErrFail + public :: FCVodeSetEtaConvFail + public :: FCVodeRootInit + public :: FCVodeSetRootDirection + public :: FCVodeSetNoInactiveRootWarn + public :: FCVode + public :: FCVodeComputeState + public :: FCVodeGetDky + public :: FCVodeGetWorkSpace + public :: FCVodeGetNumSteps + public :: FCVodeGetNumRhsEvals + public :: FCVodeGetNumLinSolvSetups + public :: FCVodeGetNumErrTestFails + public :: FCVodeGetLastOrder + public :: FCVodeGetCurrentOrder + public :: FCVodeGetCurrentGamma + public :: FCVodeGetNumStabLimOrderReds + public :: FCVodeGetActualInitStep + public :: FCVodeGetLastStep + public :: FCVodeGetCurrentStep + public :: FCVodeGetCurrentState + public :: FCVodeGetCurrentTime + public :: FCVodeGetTolScaleFactor + public :: FCVodeGetErrWeights + public :: FCVodeGetEstLocalErrors + public :: FCVodeGetNumGEvals + public :: FCVodeGetRootInfo + public :: FCVodeGetIntegratorStats + public :: FCVodeGetNonlinearSystemData + public :: FCVodeGetNumNonlinSolvIters + public :: FCVodeGetNumNonlinSolvConvFails + public :: FCVodeGetNonlinSolvStats + public :: FCVodeGetNumStepSolveFails + public :: FCVodeGetUserData + public :: FCVodePrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FCVodeGetReturnFlagName + public :: FCVodeFree + public :: FCVodeSetJacTimesRhsFn + public :: FCVBandPrecInit + public :: FCVBandPrecGetWorkSpace + public :: FCVBandPrecGetNumRhsEvals + public :: FCVBBDPrecInit + public :: FCVBBDPrecReInit + public :: FCVBBDPrecGetWorkSpace + public :: FCVBBDPrecGetNumGfnEvals + integer(C_INT), parameter, public :: CVDIAG_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CVDIAG_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: CVDIAG_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: CVDIAG_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: CVDIAG_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: CVDIAG_INV_FAIL = -5_C_INT + integer(C_INT), parameter, public :: CVDIAG_RHSFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: CVDIAG_RHSFUNC_RECVR = -7_C_INT + public :: FCVDiag + public :: FCVDiagGetWorkSpace + public :: FCVDiagGetNumRhsEvals + public :: FCVDiagGetLastFlag + public :: FCVDiagGetReturnFlagName + integer(C_INT), parameter, public :: CVLS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CVLS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: CVLS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: CVLS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: CVLS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: CVLS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: CVLS_JACFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: CVLS_JACFUNC_RECVR = -7_C_INT + integer(C_INT), parameter, public :: CVLS_SUNMAT_FAIL = -8_C_INT + integer(C_INT), parameter, public :: CVLS_SUNLS_FAIL = -9_C_INT + public :: FCVodeSetLinearSolver + public :: FCVodeSetJacFn + public :: FCVodeSetJacEvalFrequency + public :: FCVodeSetLinearSolutionScaling + public :: FCVodeSetDeltaGammaMaxBadJac + public :: FCVodeSetEpsLin + public :: FCVodeSetLSNormFactor + public :: FCVodeSetPreconditioner + public :: FCVodeSetJacTimes + public :: FCVodeSetLinSysFn + public :: FCVodeGetJac + public :: FCVodeGetJacTime + public :: FCVodeGetJacNumSteps + public :: FCVodeGetLinWorkSpace + public :: FCVodeGetNumJacEvals + public :: FCVodeGetNumPrecEvals + public :: FCVodeGetNumPrecSolves + public :: FCVodeGetNumLinIters + public :: FCVodeGetNumLinConvFails + public :: FCVodeGetNumJTSetupEvals + public :: FCVodeGetNumJtimesEvals + public :: FCVodeGetNumLinRhsEvals + public :: FCVodeGetLinSolveStats + public :: FCVodeGetLastLinFlag + public :: FCVodeGetLinReturnFlagName + public :: FCVodeSetProjFn + public :: FCVodeSetProjErrEst + public :: FCVodeSetProjFrequency + public :: FCVodeSetMaxNumProjFails + public :: FCVodeSetEpsProj + public :: FCVodeSetProjFailEta + public :: FCVodeGetNumProjEvals + public :: FCVodeGetNumProjFails + +! WRAPPER DECLARATIONS +interface +function swigc_FCVodeCreate(farg1, farg2) & +bind(C, name="_wrap_FCVodeCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FCVodeInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeReInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSStolerances") & +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_FCVodeSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FCVodeWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetConstraints") & +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_FCVodeSetDeltaGammaMaxLSetup(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetDeltaGammaMaxLSetup") & +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_FCVodeSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetInitStep") & +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_FCVodeSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLSetupFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxConvFails") & +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_FCVodeSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxErrTestFails") & +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_FCVodeSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxHnilWarns") & +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_FCVodeSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxNonlinIters") & +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_FCVodeSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxOrd(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxOrd") & +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_FCVodeSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxStep") & +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_FCVodeSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMinStep") & +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_FCVodeSetMonitorFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMonitorFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMonitorFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMonitorFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNlsRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinConvCoef") & +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_FCVodeSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinearSolver") & +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_FCVodeSetStabLimDet(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetStabLimDet") & +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_FCVodeSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetStopTime") & +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_FCVodeSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetInterpolateStopTime") & +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_FCVodeClearStopTime(farg1) & +bind(C, name="_wrap_FCVodeClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetUseIntegratorFusedKernels(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetUseIntegratorFusedKernels") & +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_FCVodeSetUserData(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetUserData") & +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_FCVodeSetEtaFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetEtaFixedStepBounds") & +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_FCVodeSetEtaMaxFirstStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxFirstStep") & +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_FCVodeSetEtaMaxEarlyStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxEarlyStep") & +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_FCVodeSetNumStepsEtaMaxEarlyStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNumStepsEtaMaxEarlyStep") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetEtaMax(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMax") & +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_FCVodeSetEtaMin(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMin") & +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_FCVodeSetEtaMinErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMinErrFail") & +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_FCVodeSetEtaMaxErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxErrFail") & +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_FCVodeSetNumFailsEtaMaxErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNumFailsEtaMaxErrFail") & +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_FCVodeSetEtaConvFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaConvFail") & +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_FCVodeRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetRootDirection") & +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_FCVodeSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FCVodeSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVode(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVode") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeComputeState") & +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_FCVodeGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetWorkSpace") & +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_FCVodeGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumSteps") & +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_FCVodeGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumRhsEvals") & +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_FCVodeGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinSolvSetups") & +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_FCVodeGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumErrTestFails") & +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_FCVodeGetLastOrder(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastOrder") & +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_FCVodeGetCurrentOrder(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentOrder") & +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_FCVodeGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentGamma") & +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_FCVodeGetNumStabLimOrderReds(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStabLimOrderReds") & +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_FCVodeGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetActualInitStep") & +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_FCVodeGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastStep") & +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_FCVodeGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentStep") & +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_FCVodeGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentState") & +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_FCVodeGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentTime") & +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_FCVodeGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetTolScaleFactor") & +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_FCVodeGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetErrWeights") & +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_FCVodeGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetEstLocalErrors") & +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_FCVodeGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumGEvals") & +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_FCVodeGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetRootInfo") & +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_FCVodeGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) & +bind(C, name="_wrap_FCVodeGetIntegratorStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +type(C_PTR), value :: farg10 +type(C_PTR), value :: farg11 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVodeGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumNonlinSolvIters") & +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_FCVodeGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumNonlinSolvConvFails") & +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_FCVodeGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetNonlinSolvStats") & +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_FCVodeGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStepSolveFails") & +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_FCVodeGetUserData(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetUserData") & +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_FCVodePrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodePrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FCVodeGetReturnFlagName(farg1) & +bind(C, name="_wrap_FCVodeGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FCVodeFree(farg1) & +bind(C, name="_wrap_FCVodeFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVBandPrecInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVBandPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVBandPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVBandPrecGetWorkSpace") & +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_FCVBandPrecGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVBandPrecGetNumRhsEvals") & +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_FCVBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVBBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVBBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVBBDPrecGetWorkSpace") & +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_FCVBBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FCVBBDPrecGetNumGfnEvals") & +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_FCVDiag(farg1) & +bind(C, name="_wrap_FCVDiag") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVDiagGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVDiagGetWorkSpace") & +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_FCVDiagGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVDiagGetNumRhsEvals") & +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_FCVDiagGetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FCVDiagGetLastFlag") & +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_FCVDiagGetReturnFlagName(farg1) & +bind(C, name="_wrap_FCVDiagGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FCVodeSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLinearSolver") & +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_FCVodeSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLinearSolutionScaling") & +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_FCVodeSetDeltaGammaMaxBadJac(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetDeltaGammaMaxBadJac") & +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_FCVodeSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEpsLin") & +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_FCVodeSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLSNormFactor") & +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_FCVodeSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetJac(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJac") & +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_FCVodeGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJacTime") & +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_FCVodeGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJacNumSteps") & +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_FCVodeGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetLinWorkSpace") & +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_FCVodeGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJacEvals") & +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_FCVodeGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumPrecEvals") & +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_FCVodeGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumPrecSolves") & +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_FCVodeGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinIters") & +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_FCVodeGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinConvFails") & +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_FCVodeGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJTSetupEvals") & +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_FCVodeGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJtimesEvals") & +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_FCVodeGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinRhsEvals") & +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_FCVodeGetLinSolveStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVodeGetLinSolveStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastLinFlag") & +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_FCVodeGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FCVodeGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FCVodeSetProjFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetProjFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetProjErrEst(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetProjErrEst") & +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_FCVodeSetProjFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetProjFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxNumProjFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxNumProjFails") & +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_FCVodeSetEpsProj(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEpsProj") & +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_FCVodeSetProjFailEta(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetProjFailEta") & +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_FCVodeGetNumProjEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumProjEvals") & +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_FCVodeGetNumProjFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumProjFails") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FCVodeCreate(lmm, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: lmm +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = lmm +farg2 = sunctx +fresult = swigc_FCVodeCreate(farg1, farg2) +swig_result = fresult +end function + +function FCVodeInit(cvode_mem, f, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: f +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = f +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FCVodeInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeReInit(cvode_mem, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = t0 +farg3 = c_loc(y0) +fresult = swigc_FCVodeReInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSStolerances(cvode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FCVodeSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSVtolerances(cvode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FCVodeSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeWFtolerances(cvode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = efun +fresult = swigc_FCVodeWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetConstraints(cvode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(constraints) +fresult = swigc_FCVodeSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetDeltaGammaMaxLSetup(cvode_mem, dgmax_lsetup) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: dgmax_lsetup +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = dgmax_lsetup +fresult = swigc_FCVodeSetDeltaGammaMaxLSetup(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetInitStep(cvode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hin +fresult = swigc_FCVodeSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLSetupFrequency(cvode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = msbp +fresult = swigc_FCVodeSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxConvFails(cvode_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxncf +fresult = swigc_FCVodeSetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxErrTestFails(cvode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxnef +fresult = swigc_FCVodeSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxHnilWarns(cvode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = mxhnil +fresult = swigc_FCVodeSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxNonlinIters(cvode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxcor +fresult = swigc_FCVodeSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxNumSteps(cvode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = mxsteps +fresult = swigc_FCVodeSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxOrd(cvode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxord +fresult = swigc_FCVodeSetMaxOrd(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxStep(cvode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hmax +fresult = swigc_FCVodeSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMinStep(cvode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hmin +fresult = swigc_FCVodeSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMonitorFn(cvode_mem, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = fn +fresult = swigc_FCVodeSetMonitorFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMonitorFrequency(cvode_mem, nst) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: nst +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = nst +fresult = swigc_FCVodeSetMonitorFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNlsRhsFn(cvode_mem, f) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: f +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = f +fresult = swigc_FCVodeSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinConvCoef(cvode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = nlscoef +fresult = swigc_FCVodeSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolver(cvode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetStabLimDet(cvode_mem, stldet) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: stldet +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = stldet +fresult = swigc_FCVodeSetStabLimDet(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetStopTime(cvode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = tstop +fresult = swigc_FCVodeSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetInterpolateStopTime(cvode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = interp +fresult = swigc_FCVodeSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeClearStopTime(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeClearStopTime(farg1) +swig_result = fresult +end function + +function FCVodeSetUseIntegratorFusedKernels(cvode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = onoff +fresult = swigc_FCVodeSetUseIntegratorFusedKernels(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetUserData(cvode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = user_data +fresult = swigc_FCVodeSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaFixedStepBounds(cvode_mem, eta_min_fx, eta_max_fx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min_fx +real(C_DOUBLE), intent(in) :: eta_max_fx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = eta_min_fx +farg3 = eta_max_fx +fresult = swigc_FCVodeSetEtaFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetEtaMaxFirstStep(cvode_mem, eta_max_fs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_fs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_fs +fresult = swigc_FCVodeSetEtaMaxFirstStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMaxEarlyStep(cvode_mem, eta_max_es) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_es +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_es +fresult = swigc_FCVodeSetEtaMaxEarlyStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNumStepsEtaMaxEarlyStep(cvode_mem, small_nst) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: small_nst +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = small_nst +fresult = swigc_FCVodeSetNumStepsEtaMaxEarlyStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMax(cvode_mem, eta_max_gs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_gs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_gs +fresult = swigc_FCVodeSetEtaMax(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMin(cvode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_min +fresult = swigc_FCVodeSetEtaMin(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMinErrFail(cvode_mem, eta_min_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_min_ef +fresult = swigc_FCVodeSetEtaMinErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMaxErrFail(cvode_mem, eta_max_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_ef +fresult = swigc_FCVodeSetEtaMaxErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNumFailsEtaMaxErrFail(cvode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = small_nef +fresult = swigc_FCVodeSetNumFailsEtaMaxErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaConvFail(cvode_mem, eta_cf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_cf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_cf +fresult = swigc_FCVodeSetEtaConvFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeRootInit(cvode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FCVodeRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetRootDirection(cvode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FCVodeSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNoInactiveRootWarn(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FCVode(cvode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = cvode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FCVode(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeComputeState(cvode_mem, ycor, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(ycor) +farg3 = c_loc(y) +fresult = swigc_FCVodeComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetDky(cvode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FCVodeGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +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 = cvode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FCVodeGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumSteps(cvode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FCVodeGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumRhsEvals(cvode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FCVodeGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FCVodeGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumErrTestFails(cvode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FCVodeGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLastOrder(cvode_mem, qlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(qlast(1)) +fresult = swigc_FCVodeGetLastOrder(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentOrder(cvode_mem, qcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: qcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(qcur(1)) +fresult = swigc_FCVodeGetCurrentOrder(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentGamma(cvode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FCVodeGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumStabLimOrderReds(cvode_mem, nslred) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nslred +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nslred(1)) +fresult = swigc_FCVodeGetNumStabLimOrderReds(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetActualInitStep(cvode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FCVodeGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLastStep(cvode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FCVodeGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentStep(cvode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FCVodeGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentState(cvode_mem, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = y +fresult = swigc_FCVodeGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentTime(cvode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FCVodeGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetTolScaleFactor(cvode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FCVodeGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetErrWeights(cvode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(eweight) +fresult = swigc_FCVodeGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetEstLocalErrors(cvode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ele) +fresult = swigc_FCVodeGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumGEvals(cvode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FCVodeGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetRootInfo(cvode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FCVodeGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT), dimension(*), target, intent(inout) :: qcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 +type(C_PTR) :: farg10 +type(C_PTR) :: farg11 + +farg1 = cvode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(nfevals(1)) +farg4 = c_loc(nlinsetups(1)) +farg5 = c_loc(netfails(1)) +farg6 = c_loc(qlast(1)) +farg7 = c_loc(qcur(1)) +farg8 = c_loc(hinused(1)) +farg9 = c_loc(hlast(1)) +farg10 = c_loc(hcur(1)) +farg11 = c_loc(tcur(1)) +fresult = swigc_FCVodeGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) +swig_result = fresult +end function + +function FCVodeGetNonlinearSystemData(cvode_mem, tcur, ypred, yn, fn, gamma, rl1, zn1, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: ypred +type(C_PTR) :: yn +type(C_PTR) :: fn +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +real(C_DOUBLE), dimension(*), target, intent(inout) :: rl1 +type(C_PTR) :: zn1 +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = cvode_mem +farg2 = c_loc(tcur(1)) +farg3 = ypred +farg4 = yn +farg5 = fn +farg6 = c_loc(gamma(1)) +farg7 = c_loc(rl1(1)) +farg8 = zn1 +farg9 = c_loc(user_data) +fresult = swigc_FCVodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FCVodeGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumNonlinSolvConvFails(cvode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FCVodeGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNonlinSolvStats(cvode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FCVodeGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumStepSolveFails(cvode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FCVodeGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetUserData(cvode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(user_data) +fresult = swigc_FCVodeGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FCVodePrintAllStats(cvode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FCVodePrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FCVodeGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVodeGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FCVodeFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(cvode_mem) +call swigc_FCVodeFree(farg1) +end subroutine + +function FCVodeSetJacTimesRhsFn(cvode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = jtimesrhsfn +fresult = swigc_FCVodeSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FCVBandPrecInit(cvode_mem, n, mu, ml) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: mu +integer(C_INT32_T), intent(in) :: ml +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 + +farg1 = cvode_mem +farg2 = n +farg3 = mu +farg4 = ml +fresult = swigc_FCVBandPrecInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVBandPrecGetWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVBandPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVBandPrecGetNumRhsEvals(cvode_mem, nfevalsbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsbp(1)) +fresult = swigc_FCVBandPrecGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dqrely +type(C_FUNPTR), intent(in), value :: gloc +type(C_FUNPTR), intent(in), value :: cfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = cvode_mem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dqrely +farg8 = gloc +farg9 = cfn +fresult = swigc_FCVBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVBBDPrecReInit(cvode_mem, mudq, mldq, dqrely) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dqrely +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = cvode_mem +farg2 = mudq +farg3 = mldq +farg4 = dqrely +fresult = swigc_FCVBBDPrecReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FCVBBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FCVBBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVDiag(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVDiag(farg1) +swig_result = fresult +end function + +function FCVDiagGetWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVDiagGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVDiagGetNumRhsEvals(cvode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FCVDiagGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVDiagGetLastFlag(cvode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FCVDiagGetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FCVDiagGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVDiagGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FCVodeSetLinearSolver(cvode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FCVodeSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetJacFn(cvode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = jac +fresult = swigc_FCVodeSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetJacEvalFrequency(cvode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = msbj +fresult = swigc_FCVodeSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLinearSolutionScaling(cvode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = onoff +fresult = swigc_FCVodeSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetDeltaGammaMaxBadJac(cvode_mem, dgmax_jbad) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: dgmax_jbad +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = dgmax_jbad +fresult = swigc_FCVodeSetDeltaGammaMaxBadJac(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEpsLin(cvode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eplifac +fresult = swigc_FCVodeSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FCVodeSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetPreconditioner(cvode_mem, pset, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = pset +farg3 = psolve +fresult = swigc_FCVodeSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetJacTimes(cvode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FCVodeSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetLinSysFn(cvode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = linsys +fresult = swigc_FCVodeSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJac(cvode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(j) +fresult = swigc_FCVodeGetJac(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJacTime(cvode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FCVodeGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJacNumSteps(cvode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FCVodeGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVodeGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumJacEvals(cvode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FCVodeGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumPrecEvals(cvode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FCVodeGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumPrecSolves(cvode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FCVodeGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinIters(cvode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FCVodeGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinConvFails(cvode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FCVodeGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumJTSetupEvals(cvode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FCVodeGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumJtimesEvals(cvode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FCVodeGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinRhsEvals(cvode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FCVodeGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinSolveStats(cvode_mem, njevals, nfevalsls, nliters, nlcfails, npevals, npsolves, njtsetups, njtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_LONG), dimension(*), target, intent(inout) :: njtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = cvode_mem +farg2 = c_loc(njevals(1)) +farg3 = c_loc(nfevalsls(1)) +farg4 = c_loc(nliters(1)) +farg5 = c_loc(nlcfails(1)) +farg6 = c_loc(npevals(1)) +farg7 = c_loc(npsolves(1)) +farg8 = c_loc(njtsetups(1)) +farg9 = c_loc(njtimes(1)) +fresult = swigc_FCVodeGetLinSolveStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVodeGetLastLinFlag(cvode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FCVodeGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVodeGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FCVodeSetProjFn(cvode_mem, pfun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: pfun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = pfun +fresult = swigc_FCVodeSetProjFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetProjErrEst(cvode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = onoff +fresult = swigc_FCVodeSetProjErrEst(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetProjFrequency(cvode_mem, proj_freq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: proj_freq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = proj_freq +fresult = swigc_FCVodeSetProjFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxNumProjFails(cvode_mem, max_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: max_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = max_fails +fresult = swigc_FCVodeSetMaxNumProjFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEpsProj(cvode_mem, eps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eps +fresult = swigc_FCVodeSetEpsProj(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetProjFailEta(cvode_mem, eta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta +fresult = swigc_FCVodeSetProjFailEta(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumProjEvals(cvode_mem, nproj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nproj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nproj(1)) +fresult = swigc_FCVodeGetNumProjEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumProjFails(cvode_mem, nprf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nprf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nprf(1)) +fresult = swigc_FCVodeGetNumProjFails(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/cvode/fmod_int64/CMakeLists.txt b/src/cvode/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..e27c43ae02 --- /dev/null +++ b/src/cvode/fmod_int64/CMakeLists.txt @@ -0,0 +1,47 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 CVODE object library +# --------------------------------------------------------------- + +set(cvode_SOURCES fcvode_mod.f90 fcvode_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_fcvode_mod + SOURCES + ${cvode_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + sundials_fsunnonlinsolnewton_mod_obj + sundials_fsunnonlinsolfixedpoint_mod_obj + OUTPUT_NAME + sundials_fcvode_mod + VERSION + ${cvodelib_VERSION} + SOVERSION + ${cvodelib_SOVERSION} +) + +message(STATUS "Added CVODE F2003 interface") diff --git a/src/cvode/fmod/fcvode_mod.c b/src/cvode/fmod_int64/fcvode_mod.c similarity index 100% rename from src/cvode/fmod/fcvode_mod.c rename to src/cvode/fmod_int64/fcvode_mod.c diff --git a/src/cvode/fmod/fcvode_mod.f90 b/src/cvode/fmod_int64/fcvode_mod.f90 similarity index 100% rename from src/cvode/fmod/fcvode_mod.f90 rename to src/cvode/fmod_int64/fcvode_mod.f90 diff --git a/src/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 26d9323f7e..1879c49614 100644 --- a/src/cvodes/CMakeLists.txt +++ b/src/cvodes/CMakeLists.txt @@ -85,5 +85,5 @@ message(STATUS "Added CVODES module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/cvodes/fmod/CMakeLists.txt b/src/cvodes/fmod_int32/CMakeLists.txt similarity index 100% rename from src/cvodes/fmod/CMakeLists.txt rename to src/cvodes/fmod_int32/CMakeLists.txt diff --git a/src/cvodes/fmod_int32/fcvodes_mod.c b/src/cvodes/fmod_int32/fcvodes_mod.c new file mode 100644 index 0000000000..dfb9a1d1b5 --- /dev/null +++ b/src/cvodes/fmod_int32/fcvodes_mod.c @@ -0,0 +1,4040 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "cvodes/cvodes.h" +#include "cvodes/cvodes_bandpre.h" +#include "cvodes/cvodes_bbdpre.h" +#include "cvodes/cvodes_diag.h" +#include "cvodes/cvodes_ls.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT void * _wrap_FCVodeCreate(int const *farg1, void *farg2) { + void * fresult ; + int arg1 ; + SUNContext arg2 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (int)(*farg1); + arg2 = (SUNContext)(farg2); + result = (void *)CVodeCreate(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeInit(void *farg1, CVRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeReInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeWFtolerances(void *farg1, CVEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVEwtFn arg2 = (CVEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVEwtFn)(farg2); + result = (int)CVodeWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxLSetup(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetDeltaGammaMaxLSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLSetupFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetLSetupFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxHnilWarns(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxHnilWarns(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxOrd(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetMaxOrd(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMonitorFn(void *farg1, CVMonitorFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVMonitorFn arg2 = (CVMonitorFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVMonitorFn)(farg2); + result = (int)CVodeSetMonitorFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMonitorFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetMonitorFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNlsRhsFn(void *farg1, CVRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + result = (int)CVodeSetNlsRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)CVodeSetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetStabLimDet(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetStabLimDet(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetInterpolateStopTime(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetInterpolateStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)CVodeSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetEtaFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxFirstStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxFirstStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxEarlyStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxEarlyStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNumStepsEtaMaxEarlyStep(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetNumStepsEtaMaxEarlyStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMinErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMinErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaMaxErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaMaxErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNumFailsEtaMaxErrFail(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetNumFailsEtaMaxErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEtaConvFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEtaConvFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeRootInit(void *farg1, int const *farg2, CVRootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVRootFn arg3 = (CVRootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVRootFn)(farg3); + result = (int)CVodeRootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeSetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeSetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVode(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + result = (int)CVode(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeComputeState(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeComputeState(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeComputeStateSens(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeComputeStateSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeComputeStateSens1(void *farg1, int const *farg2, N_Vector farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeComputeStateSens1(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetLastOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetCurrentOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentGamma(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentGamma(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStabLimOrderReds(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStabLimOrderReds(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)CVodeGetCurrentState(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentStateSens(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector **arg2 = (N_Vector **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector **)(farg2); + result = (int)CVodeGetCurrentStateSens(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentSensSolveIndex(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetCurrentSensSolveIndex(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)CVodeGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetIntegratorStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, int *farg6, int *farg7, double *farg8, double *farg9, double *farg10, double *farg11) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (int *)(farg6); + arg7 = (int *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); + result = (int)CVodeGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, double *farg6, double *farg7, void *farg8, void *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + N_Vector *arg8 = (N_Vector *) 0 ; + void **arg9 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (N_Vector *)(farg8); + arg9 = (void **)(farg9); + result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemDataSens(void *farg1, double *farg2, void *farg3, void *farg4, double *farg5, double *farg6, void *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector **arg3 = (N_Vector **) 0 ; + N_Vector **arg4 = (N_Vector **) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector **arg7 = (N_Vector **) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector **)(farg3); + arg4 = (N_Vector **)(farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector **)(farg7); + arg8 = (void **)(farg8); + result = (int)CVodeGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)CVodeGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodePrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)CVodePrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVodeGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVodeGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + CVodeFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimesRhsFn(void *farg1, CVRhsFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVRhsFn arg2 = (CVRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVRhsFn)(farg2); + result = (int)CVodeSetJacTimesRhsFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadInit(void *farg1, CVQuadRhsFn farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVQuadRhsFn arg2 = (CVQuadRhsFn) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVQuadRhsFn)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeQuadInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadReInit(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeQuadReInit(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeQuadSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeQuadSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetQuadErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetQuadErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuad(void *farg1, double *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeGetQuad(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetQuadDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetQuadNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetQuadNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)CVodeGetQuadErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetQuadStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeQuadFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + CVodeQuadFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeSensInit(void *farg1, int const *farg2, int const *farg3, CVSensRhsFn farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + CVSensRhsFn arg4 = (CVSensRhsFn) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (CVSensRhsFn)(farg4); + arg5 = (N_Vector *)(farg5); + result = (int)CVodeSensInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensInit1(void *farg1, int const *farg2, int const *farg3, CVSensRhs1Fn farg4, void *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + CVSensRhs1Fn arg4 = (CVSensRhs1Fn) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (CVSensRhs1Fn)(farg4); + arg5 = (N_Vector *)(farg5); + result = (int)CVodeSensInit1(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensReInit(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeSensReInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensSStolerances(void *farg1, double const *farg2, double *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + result = (int)CVodeSensSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensSVtolerances(void *farg1, double const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeSensSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensEEtolerances(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeSensEEtolerances(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetSensDQMethod(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetSensDQMethod(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetSensErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetSensErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetSensMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetSensMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int *arg4 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (int *)(farg4); + result = (int)CVodeSetSensParams(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolverSensSim(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)CVodeSetNonlinearSolverSensSim(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolverSensStg(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)CVodeSetNonlinearSolverSensStg(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolverSensStg1(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)CVodeSetNonlinearSolverSensStg1(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSensToggleOff(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeSensToggleOff(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSens(void *farg1, double *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeGetSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetSens1(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector *)(farg4); + result = (int)CVodeGetSensDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeGetSensDky1(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetSensNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumRhsEvalsSens(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumRhsEvalsSens(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetSensNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetSensNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensErrWeights(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)CVodeGetSensErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + result = (int)CVodeGetSensStats(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetSensNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetSensNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetSensNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetSensNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStepSensSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStepSensSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetStgrSensNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetStgrSensNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetStgrSensNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetStgrSensNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetStgrSensNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetStgrSensNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumStepStgrSensSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumStepStgrSensSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeSensFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + CVodeSensFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeQuadSensInit(void *farg1, CVQuadSensRhsFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVQuadSensRhsFn arg2 = (CVQuadSensRhsFn) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVQuadSensRhsFn)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeQuadSensInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSensReInit(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)CVodeQuadSensReInit(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSensSStolerances(void *farg1, double const *farg2, double *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + result = (int)CVodeQuadSensSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSensSVtolerances(void *farg1, double const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeQuadSensSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSensEEtolerances(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeQuadSensEEtolerances(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetQuadSensErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetQuadSensErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSens(void *farg1, double *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)CVodeGetQuadSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetQuadSens1(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector *)(farg4); + result = (int)CVodeGetQuadSensDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeGetQuadSensDky1(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetQuadSensNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetQuadSensNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensErrWeights(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)CVodeGetQuadSensErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadSensStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetQuadSensStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeQuadSensFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + CVodeQuadSensFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeAdjInit(void *farg1, long const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeAdjInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeAdjReInit(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeAdjReInit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FCVodeAdjFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + CVodeAdjFree(arg1); +} + + +SWIGEXPORT int _wrap_FCVodeCreateB(void *farg1, int const *farg2, int *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int *arg3 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int *)(farg3); + result = (int)CVodeCreateB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeInitB(void *farg1, int const *farg2, CVRhsFnB farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVRhsFnB arg3 = (CVRhsFnB) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVRhsFnB)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeInitB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeInitBS(void *farg1, int const *farg2, CVRhsFnBS farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVRhsFnBS arg3 = (CVRhsFnBS) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVRhsFnBS)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeInitBS(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeReInitB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeReInitB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSStolerancesB(void *farg1, int const *farg2, double const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)CVodeSStolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSVtolerancesB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeSVtolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadInitB(void *farg1, int const *farg2, CVQuadRhsFnB farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVQuadRhsFnB arg3 = (CVQuadRhsFnB) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVQuadRhsFnB)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeQuadInitB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadInitBS(void *farg1, int const *farg2, CVQuadRhsFnBS farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVQuadRhsFnBS arg3 = (CVQuadRhsFnBS) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVQuadRhsFnBS)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeQuadInitBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadReInitB(void *farg1, int const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeQuadReInitB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSStolerancesB(void *farg1, int const *farg2, double const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)CVodeQuadSStolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeQuadSVtolerancesB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeQuadSVtolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeF(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5, int *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int arg5 ; + int *arg6 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (int)(*farg5); + arg6 = (int *)(farg6); + result = (int)CVodeF(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeB(void *farg1, double const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetAdjNoSensi(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVodeSetAdjNoSensi(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void *)(farg3); + result = (int)CVodeSetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxOrdB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeSetMaxOrdB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxNumStepsB(void *farg1, int const *farg2, long const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long)(*farg3); + result = (int)CVodeSetMaxNumStepsB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetStabLimDetB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeSetStabLimDetB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetInitStepB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetInitStepB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMinStepB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetMinStepB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetMaxStepB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetMaxStepB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetConstraintsB(void *farg1, int const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeSetConstraintsB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetQuadErrConB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeSetQuadErrConB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetNonlinearSolverB(void *farg1, int const *farg2, SUNNonlinearSolver farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + SUNNonlinearSolver arg3 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (SUNNonlinearSolver)(farg3); + result = (int)CVodeSetNonlinearSolverB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetB(void *farg1, int const *farg2, double *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetQuadB(void *farg1, int const *farg2, double *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)CVodeGetQuadB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FCVodeGetAdjCVodeBmem(void *farg1, int const *farg2) { + void * fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void *result = 0 ; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (void *)CVodeGetAdjCVodeBmem(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetAdjY(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)CVodeGetAdjY(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_my_addr_set(SwigClassWrapper const *farg1, void *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + void *arg2 = (void *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::my_addr", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (void *)(farg2); + if (arg1) (arg1)->my_addr = arg2; +} + + +SWIGEXPORT void * _wrap_CVadjCheckPointRec_my_addr_get(SwigClassWrapper const *farg1) { + void * fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + void *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::my_addr", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (void *) ((arg1)->my_addr); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_next_addr_set(SwigClassWrapper const *farg1, void *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + void *arg2 = (void *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::next_addr", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (void *)(farg2); + if (arg1) (arg1)->next_addr = arg2; +} + + +SWIGEXPORT void * _wrap_CVadjCheckPointRec_next_addr_get(SwigClassWrapper const *farg1) { + void * fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + void *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::next_addr", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (void *) ((arg1)->next_addr); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, double const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t0", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->t0 = arg2; +} + + +SWIGEXPORT double _wrap_CVadjCheckPointRec_t0_get(SwigClassWrapper const *farg1) { + double fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t0", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->t0); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, double const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t1", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->t1 = arg2; +} + + +SWIGEXPORT double _wrap_CVadjCheckPointRec_t1_get(SwigClassWrapper const *farg1) { + double fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::t1", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->t1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_nstep_set(SwigClassWrapper const *farg1, long const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + long arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::nstep", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (long)(*farg2); + if (arg1) (arg1)->nstep = arg2; +} + + +SWIGEXPORT long _wrap_CVadjCheckPointRec_nstep_get(SwigClassWrapper const *farg1) { + long fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + long result; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::nstep", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (long) ((arg1)->nstep); + fresult = (long)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_order_set(SwigClassWrapper const *farg1, int const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::order", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->order = arg2; +} + + +SWIGEXPORT int _wrap_CVadjCheckPointRec_order_get(SwigClassWrapper const *farg1) { + int fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::order", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (int) ((arg1)->order); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_step_set(SwigClassWrapper const *farg1, double const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::step", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->step = arg2; +} + + +SWIGEXPORT double _wrap_CVadjCheckPointRec_step_get(SwigClassWrapper const *farg1) { + double fresult ; + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::step", return 0); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->step); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_CVadjCheckPointRec() { + SwigClassWrapper fresult ; + CVadjCheckPointRec *result = 0 ; + + result = (CVadjCheckPointRec *)calloc(1, sizeof(CVadjCheckPointRec)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_CVadjCheckPointRec(SwigClassWrapper *farg1) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + + SWIG_check_mutable(*farg1, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVadjCheckPointRec::~CVadjCheckPointRec()", return ); + arg1 = (CVadjCheckPointRec *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_CVadjCheckPointRec_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + CVadjCheckPointRec *arg1 = (CVadjCheckPointRec *) 0 ; + CVadjCheckPointRec *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT int _wrap_FCVodeGetAdjCheckPointsInfo(void *farg1, SwigClassWrapper const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVadjCheckPointRec *arg2 = (CVadjCheckPointRec *) 0 ; + int result; + + arg1 = (void *)(farg1); + SWIG_check_mutable(*farg2, "CVadjCheckPointRec *", "CVadjCheckPointRec", "CVodeGetAdjCheckPointsInfo(void *,CVadjCheckPointRec *)", return 0); + arg2 = (CVadjCheckPointRec *)(farg2->cptr); + result = (int)CVodeGetAdjCheckPointsInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimesRhsFnB(void *farg1, int const *farg2, CVRhsFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVRhsFn arg3 = (CVRhsFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVRhsFn)(farg3); + result = (int)CVodeSetJacTimesRhsFnB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetAdjDataPointHermite(void *farg1, int const *farg2, double *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeGetAdjDataPointHermite(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetAdjDataPointPolynomial(void *farg1, int const *farg2, double *farg3, int *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int *arg4 = (int *) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (int *)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)CVodeGetAdjDataPointPolynomial(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetAdjCurrentCheckPoint(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)CVodeGetAdjCurrentCheckPoint(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + result = (int)CVBandPrecInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVBandPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVBandPrecGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBandPrecInitB(void *farg1, int const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + result = (int)CVBandPrecInitB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, CVLocalFn farg8, CVCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + CVLocalFn arg8 = (CVLocalFn) 0 ; + CVCommFn arg9 = (CVCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (CVLocalFn)(farg8); + arg9 = (CVCommFn)(farg9); + result = (int)CVBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecReInit(void *farg1, int32_t const *farg2, int32_t const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)CVBBDPrecReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVBBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVBBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecInitB(void *farg1, int const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, int32_t const *farg7, double const *farg8, CVLocalFnB farg9, CVCommFnB farg10) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunindextype arg7 ; + sunrealtype arg8 ; + CVLocalFnB arg9 = (CVLocalFnB) 0 ; + CVCommFnB arg10 = (CVCommFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunindextype)(*farg7); + arg8 = (sunrealtype)(*farg8); + arg9 = (CVLocalFnB)(farg9); + arg10 = (CVCommFnB)(farg10); + result = (int)CVBBDPrecInitB(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVBBDPrecReInitB(void *farg1, int const *farg2, int32_t const *farg3, int32_t const *farg4, double const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunrealtype arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)CVBBDPrecReInitB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiag(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)CVDiag(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVDiagGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVDiagGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagGetLastFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVDiagGetLastFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVDiagGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVDiagGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVDiagB(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVDiagB(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)CVodeSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacFn(void *farg1, CVLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsJacFn arg2 = (CVLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsJacFn)(farg2); + result = (int)CVodeSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacEvalFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)CVodeSetJacEvalFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)CVodeSetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetDeltaGammaMaxBadJac(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetDeltaGammaMaxBadJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)CVodeSetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetPreconditioner(void *farg1, CVLsPrecSetupFn farg2, CVLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsPrecSetupFn arg2 = (CVLsPrecSetupFn) 0 ; + CVLsPrecSolveFn arg3 = (CVLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsPrecSetupFn)(farg2); + arg3 = (CVLsPrecSolveFn)(farg3); + result = (int)CVodeSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimes(void *farg1, CVLsJacTimesSetupFn farg2, CVLsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsJacTimesSetupFn arg2 = (CVLsJacTimesSetupFn) 0 ; + CVLsJacTimesVecFn arg3 = (CVLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsJacTimesSetupFn)(farg2); + arg3 = (CVLsJacTimesVecFn)(farg3); + result = (int)CVodeSetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinSysFn(void *farg1, CVLsLinSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + CVLsLinSysFn arg2 = (CVLsLinSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (CVLsLinSysFn)(farg2); + result = (int)CVodeSetLinSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)CVodeGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)CVodeGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)CVodeGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetNumLinRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetNumLinRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLinSolveStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, long *farg6, long *farg7, long *farg8, long *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + long *arg6 = (long *) 0 ; + long *arg7 = (long *) 0 ; + long *arg8 = (long *) 0 ; + long *arg9 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (long *)(farg6); + arg7 = (long *)(farg7); + arg8 = (long *)(farg8); + arg9 = (long *)(farg9); + result = (int)CVodeGetLinSolveStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)CVodeGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FCVodeGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)CVodeGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolverB(void *farg1, int const *farg2, SUNLinearSolver farg3, SUNMatrix farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + SUNLinearSolver arg3 = (SUNLinearSolver) 0 ; + SUNMatrix arg4 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (SUNLinearSolver)(farg3); + arg4 = (SUNMatrix)(farg4); + result = (int)CVodeSetLinearSolverB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacFnB(void *farg1, int const *farg2, CVLsJacFnB farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsJacFnB arg3 = (CVLsJacFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsJacFnB)(farg3); + result = (int)CVodeSetJacFnB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacFnBS(void *farg1, int const *farg2, CVLsJacFnBS farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsJacFnBS arg3 = (CVLsJacFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsJacFnBS)(farg3); + result = (int)CVodeSetJacFnBS(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetEpsLinB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetEpsLinB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLSNormFactorB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)CVodeSetLSNormFactorB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinearSolutionScalingB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)CVodeSetLinearSolutionScalingB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetPreconditionerB(void *farg1, int const *farg2, CVLsPrecSetupFnB farg3, CVLsPrecSolveFnB farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsPrecSetupFnB arg3 = (CVLsPrecSetupFnB) 0 ; + CVLsPrecSolveFnB arg4 = (CVLsPrecSolveFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsPrecSetupFnB)(farg3); + arg4 = (CVLsPrecSolveFnB)(farg4); + result = (int)CVodeSetPreconditionerB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetPreconditionerBS(void *farg1, int const *farg2, CVLsPrecSetupFnBS farg3, CVLsPrecSolveFnBS farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsPrecSetupFnBS arg3 = (CVLsPrecSetupFnBS) 0 ; + CVLsPrecSolveFnBS arg4 = (CVLsPrecSolveFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsPrecSetupFnBS)(farg3); + arg4 = (CVLsPrecSolveFnBS)(farg4); + result = (int)CVodeSetPreconditionerBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimesB(void *farg1, int const *farg2, CVLsJacTimesSetupFnB farg3, CVLsJacTimesVecFnB farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsJacTimesSetupFnB arg3 = (CVLsJacTimesSetupFnB) 0 ; + CVLsJacTimesVecFnB arg4 = (CVLsJacTimesVecFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsJacTimesSetupFnB)(farg3); + arg4 = (CVLsJacTimesVecFnB)(farg4); + result = (int)CVodeSetJacTimesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetJacTimesBS(void *farg1, int const *farg2, CVLsJacTimesSetupFnBS farg3, CVLsJacTimesVecFnBS farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsJacTimesSetupFnBS arg3 = (CVLsJacTimesSetupFnBS) 0 ; + CVLsJacTimesVecFnBS arg4 = (CVLsJacTimesVecFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsJacTimesSetupFnBS)(farg3); + arg4 = (CVLsJacTimesVecFnBS)(farg4); + result = (int)CVodeSetJacTimesBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinSysFnB(void *farg1, int const *farg2, CVLsLinSysFnB farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsLinSysFnB arg3 = (CVLsLinSysFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsLinSysFnB)(farg3); + result = (int)CVodeSetLinSysFnB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FCVodeSetLinSysFnBS(void *farg1, int const *farg2, CVLsLinSysFnBS farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + CVLsLinSysFnBS arg3 = (CVLsLinSysFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (CVLsLinSysFnBS)(farg3); + result = (int)CVodeSetLinSysFnBS(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/cvodes/fmod_int32/fcvodes_mod.f90 b/src/cvodes/fmod_int32/fcvodes_mod.f90 new file mode 100644 index 0000000000..f3cd69dcbf --- /dev/null +++ b/src/cvodes/fmod_int32/fcvodes_mod.f90 @@ -0,0 +1,7142 @@ +! 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-2024, 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 fcvodes_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: CV_ADAMS = 1_C_INT + integer(C_INT), parameter, public :: CV_BDF = 2_C_INT + integer(C_INT), parameter, public :: CV_NORMAL = 1_C_INT + integer(C_INT), parameter, public :: CV_ONE_STEP = 2_C_INT + integer(C_INT), parameter, public :: CV_SIMULTANEOUS = 1_C_INT + integer(C_INT), parameter, public :: CV_STAGGERED = 2_C_INT + integer(C_INT), parameter, public :: CV_STAGGERED1 = 3_C_INT + integer(C_INT), parameter, public :: CV_CENTERED = 1_C_INT + integer(C_INT), parameter, public :: CV_FORWARD = 2_C_INT + integer(C_INT), parameter, public :: CV_HERMITE = 1_C_INT + integer(C_INT), parameter, public :: CV_POLYNOMIAL = 2_C_INT + integer(C_INT), parameter, public :: CV_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CV_TSTOP_RETURN = 1_C_INT + integer(C_INT), parameter, public :: CV_ROOT_RETURN = 2_C_INT + integer(C_INT), parameter, public :: CV_WARNING = 99_C_INT + integer(C_INT), parameter, public :: CV_TOO_MUCH_WORK = -1_C_INT + integer(C_INT), parameter, public :: CV_TOO_MUCH_ACC = -2_C_INT + integer(C_INT), parameter, public :: CV_ERR_FAILURE = -3_C_INT + integer(C_INT), parameter, public :: CV_CONV_FAILURE = -4_C_INT + integer(C_INT), parameter, public :: CV_LINIT_FAIL = -5_C_INT + integer(C_INT), parameter, public :: CV_LSETUP_FAIL = -6_C_INT + integer(C_INT), parameter, public :: CV_LSOLVE_FAIL = -7_C_INT + integer(C_INT), parameter, public :: CV_RHSFUNC_FAIL = -8_C_INT + integer(C_INT), parameter, public :: CV_FIRST_RHSFUNC_ERR = -9_C_INT + integer(C_INT), parameter, public :: CV_REPTD_RHSFUNC_ERR = -10_C_INT + integer(C_INT), parameter, public :: CV_UNREC_RHSFUNC_ERR = -11_C_INT + integer(C_INT), parameter, public :: CV_RTFUNC_FAIL = -12_C_INT + integer(C_INT), parameter, public :: CV_NLS_INIT_FAIL = -13_C_INT + integer(C_INT), parameter, public :: CV_NLS_SETUP_FAIL = -14_C_INT + integer(C_INT), parameter, public :: CV_CONSTR_FAIL = -15_C_INT + integer(C_INT), parameter, public :: CV_NLS_FAIL = -16_C_INT + integer(C_INT), parameter, public :: CV_MEM_FAIL = -20_C_INT + integer(C_INT), parameter, public :: CV_MEM_NULL = -21_C_INT + integer(C_INT), parameter, public :: CV_ILL_INPUT = -22_C_INT + integer(C_INT), parameter, public :: CV_NO_MALLOC = -23_C_INT + integer(C_INT), parameter, public :: CV_BAD_K = -24_C_INT + integer(C_INT), parameter, public :: CV_BAD_T = -25_C_INT + integer(C_INT), parameter, public :: CV_BAD_DKY = -26_C_INT + integer(C_INT), parameter, public :: CV_TOO_CLOSE = -27_C_INT + integer(C_INT), parameter, public :: CV_VECTOROP_ERR = -28_C_INT + integer(C_INT), parameter, public :: CV_NO_QUAD = -30_C_INT + integer(C_INT), parameter, public :: CV_QRHSFUNC_FAIL = -31_C_INT + integer(C_INT), parameter, public :: CV_FIRST_QRHSFUNC_ERR = -32_C_INT + integer(C_INT), parameter, public :: CV_REPTD_QRHSFUNC_ERR = -33_C_INT + integer(C_INT), parameter, public :: CV_UNREC_QRHSFUNC_ERR = -34_C_INT + integer(C_INT), parameter, public :: CV_NO_SENS = -40_C_INT + integer(C_INT), parameter, public :: CV_SRHSFUNC_FAIL = -41_C_INT + integer(C_INT), parameter, public :: CV_FIRST_SRHSFUNC_ERR = -42_C_INT + integer(C_INT), parameter, public :: CV_REPTD_SRHSFUNC_ERR = -43_C_INT + integer(C_INT), parameter, public :: CV_UNREC_SRHSFUNC_ERR = -44_C_INT + integer(C_INT), parameter, public :: CV_BAD_IS = -45_C_INT + integer(C_INT), parameter, public :: CV_NO_QUADSENS = -50_C_INT + integer(C_INT), parameter, public :: CV_QSRHSFUNC_FAIL = -51_C_INT + integer(C_INT), parameter, public :: CV_FIRST_QSRHSFUNC_ERR = -52_C_INT + integer(C_INT), parameter, public :: CV_REPTD_QSRHSFUNC_ERR = -53_C_INT + integer(C_INT), parameter, public :: CV_UNREC_QSRHSFUNC_ERR = -54_C_INT + integer(C_INT), parameter, public :: CV_CONTEXT_ERR = -55_C_INT + integer(C_INT), parameter, public :: CV_PROJ_MEM_NULL = -56_C_INT + integer(C_INT), parameter, public :: CV_PROJFUNC_FAIL = -57_C_INT + integer(C_INT), parameter, public :: CV_REPTD_PROJFUNC_ERR = -58_C_INT + integer(C_INT), parameter, public :: CV_BAD_TINTERP = -59_C_INT + integer(C_INT), parameter, public :: CV_UNRECOGNIZED_ERR = -99_C_INT + integer(C_INT), parameter, public :: CV_NO_ADJ = -101_C_INT + integer(C_INT), parameter, public :: CV_NO_FWD = -102_C_INT + integer(C_INT), parameter, public :: CV_NO_BCK = -103_C_INT + integer(C_INT), parameter, public :: CV_BAD_TB0 = -104_C_INT + integer(C_INT), parameter, public :: CV_REIFWD_FAIL = -105_C_INT + integer(C_INT), parameter, public :: CV_FWD_FAIL = -106_C_INT + integer(C_INT), parameter, public :: CV_GETY_BADT = -107_C_INT + public :: FCVodeCreate + public :: FCVodeInit + public :: FCVodeReInit + public :: FCVodeSStolerances + public :: FCVodeSVtolerances + public :: FCVodeWFtolerances + public :: FCVodeSetConstraints + public :: FCVodeSetDeltaGammaMaxLSetup + public :: FCVodeSetInitStep + public :: FCVodeSetLSetupFrequency + public :: FCVodeSetMaxConvFails + public :: FCVodeSetMaxErrTestFails + public :: FCVodeSetMaxHnilWarns + public :: FCVodeSetMaxNonlinIters + public :: FCVodeSetMaxNumSteps + public :: FCVodeSetMaxOrd + public :: FCVodeSetMaxStep + public :: FCVodeSetMinStep + public :: FCVodeSetMonitorFn + public :: FCVodeSetMonitorFrequency + public :: FCVodeSetNlsRhsFn + public :: FCVodeSetNonlinConvCoef + public :: FCVodeSetNonlinearSolver + public :: FCVodeSetStabLimDet + public :: FCVodeSetStopTime + public :: FCVodeSetInterpolateStopTime + public :: FCVodeClearStopTime + public :: FCVodeSetUserData + public :: FCVodeSetEtaFixedStepBounds + public :: FCVodeSetEtaMaxFirstStep + public :: FCVodeSetEtaMaxEarlyStep + public :: FCVodeSetNumStepsEtaMaxEarlyStep + public :: FCVodeSetEtaMax + public :: FCVodeSetEtaMin + public :: FCVodeSetEtaMinErrFail + public :: FCVodeSetEtaMaxErrFail + public :: FCVodeSetNumFailsEtaMaxErrFail + public :: FCVodeSetEtaConvFail + public :: FCVodeRootInit + public :: FCVodeSetRootDirection + public :: FCVodeSetNoInactiveRootWarn + public :: FCVode + public :: FCVodeComputeState + public :: FCVodeComputeStateSens + public :: FCVodeComputeStateSens1 + public :: FCVodeGetDky + public :: FCVodeGetWorkSpace + public :: FCVodeGetNumSteps + public :: FCVodeGetNumRhsEvals + public :: FCVodeGetNumLinSolvSetups + public :: FCVodeGetNumErrTestFails + public :: FCVodeGetLastOrder + public :: FCVodeGetCurrentOrder + public :: FCVodeGetCurrentGamma + public :: FCVodeGetNumStabLimOrderReds + public :: FCVodeGetActualInitStep + public :: FCVodeGetLastStep + public :: FCVodeGetCurrentStep + public :: FCVodeGetCurrentState + public :: FCVodeGetCurrentStateSens + public :: FCVodeGetCurrentSensSolveIndex + public :: FCVodeGetCurrentTime + public :: FCVodeGetTolScaleFactor + public :: FCVodeGetErrWeights + public :: FCVodeGetEstLocalErrors + public :: FCVodeGetNumGEvals + public :: FCVodeGetRootInfo + public :: FCVodeGetIntegratorStats + public :: FCVodeGetNonlinearSystemData + public :: FCVodeGetNonlinearSystemDataSens + public :: FCVodeGetNumNonlinSolvIters + public :: FCVodeGetNumNonlinSolvConvFails + public :: FCVodeGetNonlinSolvStats + public :: FCVodeGetNumStepSolveFails + public :: FCVodeGetUserData + public :: FCVodePrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FCVodeGetReturnFlagName + public :: FCVodeFree + public :: FCVodeSetJacTimesRhsFn + public :: FCVodeQuadInit + public :: FCVodeQuadReInit + public :: FCVodeQuadSStolerances + public :: FCVodeQuadSVtolerances + public :: FCVodeSetQuadErrCon + public :: FCVodeGetQuad + public :: FCVodeGetQuadDky + public :: FCVodeGetQuadNumRhsEvals + public :: FCVodeGetQuadNumErrTestFails + public :: FCVodeGetQuadErrWeights + public :: FCVodeGetQuadStats + public :: FCVodeQuadFree + public :: FCVodeSensInit + public :: FCVodeSensInit1 + public :: FCVodeSensReInit + public :: FCVodeSensSStolerances + public :: FCVodeSensSVtolerances + public :: FCVodeSensEEtolerances + public :: FCVodeSetSensDQMethod + public :: FCVodeSetSensErrCon + public :: FCVodeSetSensMaxNonlinIters + public :: FCVodeSetSensParams + public :: FCVodeSetNonlinearSolverSensSim + public :: FCVodeSetNonlinearSolverSensStg + public :: FCVodeSetNonlinearSolverSensStg1 + public :: FCVodeSensToggleOff + public :: FCVodeGetSens + public :: FCVodeGetSens1 + public :: FCVodeGetSensDky + public :: FCVodeGetSensDky1 + public :: FCVodeGetSensNumRhsEvals + public :: FCVodeGetNumRhsEvalsSens + public :: FCVodeGetSensNumErrTestFails + public :: FCVodeGetSensNumLinSolvSetups + public :: FCVodeGetSensErrWeights + public :: FCVodeGetSensStats + public :: FCVodeGetSensNumNonlinSolvIters + public :: FCVodeGetSensNumNonlinSolvConvFails + public :: FCVodeGetSensNonlinSolvStats + public :: FCVodeGetNumStepSensSolveFails + public :: FCVodeGetStgrSensNumNonlinSolvIters + public :: FCVodeGetStgrSensNumNonlinSolvConvFails + public :: FCVodeGetStgrSensNonlinSolvStats + public :: FCVodeGetNumStepStgrSensSolveFails + public :: FCVodeSensFree + public :: FCVodeQuadSensInit + public :: FCVodeQuadSensReInit + public :: FCVodeQuadSensSStolerances + public :: FCVodeQuadSensSVtolerances + public :: FCVodeQuadSensEEtolerances + public :: FCVodeSetQuadSensErrCon + public :: FCVodeGetQuadSens + public :: FCVodeGetQuadSens1 + public :: FCVodeGetQuadSensDky + public :: FCVodeGetQuadSensDky1 + public :: FCVodeGetQuadSensNumRhsEvals + public :: FCVodeGetQuadSensNumErrTestFails + public :: FCVodeGetQuadSensErrWeights + public :: FCVodeGetQuadSensStats + public :: FCVodeQuadSensFree + public :: FCVodeAdjInit + public :: FCVodeAdjReInit + public :: FCVodeAdjFree + public :: FCVodeCreateB + public :: FCVodeInitB + public :: FCVodeInitBS + public :: FCVodeReInitB + public :: FCVodeSStolerancesB + public :: FCVodeSVtolerancesB + public :: FCVodeQuadInitB + public :: FCVodeQuadInitBS + public :: FCVodeQuadReInitB + public :: FCVodeQuadSStolerancesB + public :: FCVodeQuadSVtolerancesB + public :: FCVodeF + public :: FCVodeB + public :: FCVodeSetAdjNoSensi + public :: FCVodeSetUserDataB + public :: FCVodeSetMaxOrdB + public :: FCVodeSetMaxNumStepsB + public :: FCVodeSetStabLimDetB + public :: FCVodeSetInitStepB + public :: FCVodeSetMinStepB + public :: FCVodeSetMaxStepB + public :: FCVodeSetConstraintsB + public :: FCVodeSetQuadErrConB + public :: FCVodeSetNonlinearSolverB + public :: FCVodeGetB + public :: FCVodeGetQuadB + public :: FCVodeGetAdjCVodeBmem + public :: FCVodeGetAdjY + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct CVadjCheckPointRec + type, public :: CVadjCheckPointRec + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_my_addr => swigf_CVadjCheckPointRec_my_addr_set + procedure :: get_my_addr => swigf_CVadjCheckPointRec_my_addr_get + procedure :: set_next_addr => swigf_CVadjCheckPointRec_next_addr_set + procedure :: get_next_addr => swigf_CVadjCheckPointRec_next_addr_get + procedure :: set_t0 => swigf_CVadjCheckPointRec_t0_set + procedure :: get_t0 => swigf_CVadjCheckPointRec_t0_get + procedure :: set_t1 => swigf_CVadjCheckPointRec_t1_set + procedure :: get_t1 => swigf_CVadjCheckPointRec_t1_get + procedure :: set_nstep => swigf_CVadjCheckPointRec_nstep_set + procedure :: get_nstep => swigf_CVadjCheckPointRec_nstep_get + procedure :: set_order => swigf_CVadjCheckPointRec_order_set + procedure :: get_order => swigf_CVadjCheckPointRec_order_get + procedure :: set_step => swigf_CVadjCheckPointRec_step_set + procedure :: get_step => swigf_CVadjCheckPointRec_step_get + procedure :: release => swigf_release_CVadjCheckPointRec + procedure, private :: swigf_CVadjCheckPointRec_op_assign__ + generic :: assignment(=) => swigf_CVadjCheckPointRec_op_assign__ + end type CVadjCheckPointRec + interface CVadjCheckPointRec + module procedure swigf_create_CVadjCheckPointRec + end interface + public :: FCVodeGetAdjCheckPointsInfo + public :: FCVodeSetJacTimesRhsFnB + public :: FCVodeGetAdjDataPointHermite + public :: FCVodeGetAdjDataPointPolynomial + public :: FCVodeGetAdjCurrentCheckPoint + public :: FCVBandPrecInit + public :: FCVBandPrecGetWorkSpace + public :: FCVBandPrecGetNumRhsEvals + public :: FCVBandPrecInitB + public :: FCVBBDPrecInit + public :: FCVBBDPrecReInit + public :: FCVBBDPrecGetWorkSpace + public :: FCVBBDPrecGetNumGfnEvals + public :: FCVBBDPrecInitB + public :: FCVBBDPrecReInitB + integer(C_INT), parameter, public :: CVDIAG_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CVDIAG_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: CVDIAG_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: CVDIAG_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: CVDIAG_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: CVDIAG_INV_FAIL = -5_C_INT + integer(C_INT), parameter, public :: CVDIAG_RHSFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: CVDIAG_RHSFUNC_RECVR = -7_C_INT + integer(C_INT), parameter, public :: CVDIAG_NO_ADJ = -101_C_INT + public :: FCVDiag + public :: FCVDiagGetWorkSpace + public :: FCVDiagGetNumRhsEvals + public :: FCVDiagGetLastFlag + public :: FCVDiagGetReturnFlagName + public :: FCVDiagB + integer(C_INT), parameter, public :: CVLS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: CVLS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: CVLS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: CVLS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: CVLS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: CVLS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: CVLS_JACFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: CVLS_JACFUNC_RECVR = -7_C_INT + integer(C_INT), parameter, public :: CVLS_SUNMAT_FAIL = -8_C_INT + integer(C_INT), parameter, public :: CVLS_SUNLS_FAIL = -9_C_INT + integer(C_INT), parameter, public :: CVLS_NO_ADJ = -101_C_INT + integer(C_INT), parameter, public :: CVLS_LMEMB_NULL = -102_C_INT + public :: FCVodeSetLinearSolver + public :: FCVodeSetJacFn + public :: FCVodeSetJacEvalFrequency + public :: FCVodeSetLinearSolutionScaling + public :: FCVodeSetDeltaGammaMaxBadJac + public :: FCVodeSetEpsLin + public :: FCVodeSetLSNormFactor + public :: FCVodeSetPreconditioner + public :: FCVodeSetJacTimes + public :: FCVodeSetLinSysFn + public :: FCVodeGetJac + public :: FCVodeGetJacTime + public :: FCVodeGetJacNumSteps + public :: FCVodeGetLinWorkSpace + public :: FCVodeGetNumJacEvals + public :: FCVodeGetNumPrecEvals + public :: FCVodeGetNumPrecSolves + public :: FCVodeGetNumLinIters + public :: FCVodeGetNumLinConvFails + public :: FCVodeGetNumJTSetupEvals + public :: FCVodeGetNumJtimesEvals + public :: FCVodeGetNumLinRhsEvals + public :: FCVodeGetLinSolveStats + public :: FCVodeGetLastLinFlag + public :: FCVodeGetLinReturnFlagName + public :: FCVodeSetLinearSolverB + public :: FCVodeSetJacFnB + public :: FCVodeSetJacFnBS + public :: FCVodeSetEpsLinB + public :: FCVodeSetLSNormFactorB + public :: FCVodeSetLinearSolutionScalingB + public :: FCVodeSetPreconditionerB + public :: FCVodeSetPreconditionerBS + public :: FCVodeSetJacTimesB + public :: FCVodeSetJacTimesBS + public :: FCVodeSetLinSysFnB + public :: FCVodeSetLinSysFnBS + +! WRAPPER DECLARATIONS +interface +function swigc_FCVodeCreate(farg1, farg2) & +bind(C, name="_wrap_FCVodeCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FCVodeInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeReInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSStolerances") & +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_FCVodeSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FCVodeWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetConstraints") & +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_FCVodeSetDeltaGammaMaxLSetup(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetDeltaGammaMaxLSetup") & +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_FCVodeSetInitStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetInitStep") & +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_FCVodeSetLSetupFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLSetupFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxConvFails") & +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_FCVodeSetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxErrTestFails") & +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_FCVodeSetMaxHnilWarns(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxHnilWarns") & +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_FCVodeSetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxNonlinIters") & +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_FCVodeSetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxOrd(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxOrd") & +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_FCVodeSetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMaxStep") & +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_FCVodeSetMinStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMinStep") & +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_FCVodeSetMonitorFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMonitorFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMonitorFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetMonitorFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNlsRhsFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNlsRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinConvCoef") & +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_FCVodeSetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinearSolver") & +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_FCVodeSetStabLimDet(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetStabLimDet") & +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_FCVodeSetStopTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetStopTime") & +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_FCVodeSetInterpolateStopTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetInterpolateStopTime") & +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_FCVodeClearStopTime(farg1) & +bind(C, name="_wrap_FCVodeClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetUserData(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetUserData") & +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_FCVodeSetEtaFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetEtaFixedStepBounds") & +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_FCVodeSetEtaMaxFirstStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxFirstStep") & +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_FCVodeSetEtaMaxEarlyStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxEarlyStep") & +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_FCVodeSetNumStepsEtaMaxEarlyStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNumStepsEtaMaxEarlyStep") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetEtaMax(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMax") & +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_FCVodeSetEtaMin(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMin") & +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_FCVodeSetEtaMinErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMinErrFail") & +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_FCVodeSetEtaMaxErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaMaxErrFail") & +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_FCVodeSetNumFailsEtaMaxErrFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNumFailsEtaMaxErrFail") & +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_FCVodeSetEtaConvFail(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEtaConvFail") & +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_FCVodeRootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeRootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetRootDirection") & +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_FCVodeSetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FCVodeSetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVode(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVode") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeComputeState(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeComputeState") & +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_FCVodeComputeStateSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeComputeStateSens") & +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_FCVodeComputeStateSens1(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeComputeStateSens1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetWorkSpace") & +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_FCVodeGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumSteps") & +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_FCVodeGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumRhsEvals") & +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_FCVodeGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinSolvSetups") & +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_FCVodeGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumErrTestFails") & +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_FCVodeGetLastOrder(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastOrder") & +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_FCVodeGetCurrentOrder(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentOrder") & +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_FCVodeGetCurrentGamma(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentGamma") & +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_FCVodeGetNumStabLimOrderReds(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStabLimOrderReds") & +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_FCVodeGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetActualInitStep") & +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_FCVodeGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastStep") & +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_FCVodeGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentStep") & +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_FCVodeGetCurrentState(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentState") & +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_FCVodeGetCurrentStateSens(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentStateSens") & +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_FCVodeGetCurrentSensSolveIndex(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentSensSolveIndex") & +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_FCVodeGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetCurrentTime") & +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_FCVodeGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetTolScaleFactor") & +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_FCVodeGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetErrWeights") & +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_FCVodeGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetEstLocalErrors") & +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_FCVodeGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumGEvals") & +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_FCVodeGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetRootInfo") & +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_FCVodeGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) & +bind(C, name="_wrap_FCVodeGetIntegratorStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +type(C_PTR), value :: farg10 +type(C_PTR), value :: farg11 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVodeGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetNonlinearSystemDataSens(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FCVodeGetNonlinearSystemDataSens") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumNonlinSolvIters") & +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_FCVodeGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumNonlinSolvConvFails") & +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_FCVodeGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetNonlinSolvStats") & +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_FCVodeGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStepSolveFails") & +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_FCVodeGetUserData(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetUserData") & +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_FCVodePrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodePrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FCVodeGetReturnFlagName(farg1) & +bind(C, name="_wrap_FCVodeGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FCVodeFree(farg1) & +bind(C, name="_wrap_FCVodeFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeSetJacTimesRhsFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacTimesRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadInit") & +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_FCVodeQuadReInit(farg1, farg2) & +bind(C, name="_wrap_FCVodeQuadReInit") & +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_FCVodeQuadSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadSStolerances") & +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_FCVodeQuadSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetQuadErrCon(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetQuadErrCon") & +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_FCVodeGetQuad(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetQuad") & +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_FCVodeGetQuadDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetQuadDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetQuadNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadNumRhsEvals") & +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_FCVodeGetQuadNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadNumErrTestFails") & +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_FCVodeGetQuadErrWeights(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadErrWeights") & +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_FCVodeGetQuadStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetQuadStats") & +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 + +subroutine swigc_FCVodeQuadFree(farg1) & +bind(C, name="_wrap_FCVodeQuadFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeSensInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeSensInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_FUNPTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSensInit1(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeSensInit1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_FUNPTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSensReInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSensReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSensSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSensSStolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSensSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSensSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSensEEtolerances(farg1) & +bind(C, name="_wrap_FCVodeSensEEtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetSensDQMethod(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetSensDQMethod") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetSensErrCon(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetSensErrCon") & +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_FCVodeSetSensMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetSensMaxNonlinIters") & +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_FCVodeSetSensParams(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetSensParams") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNonlinearSolverSensSim(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinearSolverSensSim") & +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_FCVodeSetNonlinearSolverSensStg(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinearSolverSensStg") & +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_FCVodeSetNonlinearSolverSensStg1(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetNonlinearSolverSensStg1") & +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_FCVodeSensToggleOff(farg1) & +bind(C, name="_wrap_FCVodeSensToggleOff") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetSens") & +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_FCVodeGetSens1(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetSens1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetSensDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetSensDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetSensDky1(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeGetSensDky1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetSensNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensNumRhsEvals") & +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_FCVodeGetNumRhsEvalsSens(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumRhsEvalsSens") & +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_FCVodeGetSensNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensNumErrTestFails") & +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_FCVodeGetSensNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensNumLinSolvSetups") & +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_FCVodeGetSensErrWeights(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensErrWeights") & +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_FCVodeGetSensStats(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeGetSensStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetSensNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensNumNonlinSolvIters") & +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_FCVodeGetSensNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetSensNumNonlinSolvConvFails") & +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_FCVodeGetSensNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetSensNonlinSolvStats") & +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_FCVodeGetNumStepSensSolveFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStepSensSolveFails") & +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_FCVodeGetStgrSensNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetStgrSensNumNonlinSolvIters") & +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_FCVodeGetStgrSensNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetStgrSensNumNonlinSolvConvFails") & +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_FCVodeGetStgrSensNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetStgrSensNonlinSolvStats") & +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_FCVodeGetNumStepStgrSensSolveFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumStepStgrSensSolveFails") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_FCVodeSensFree(farg1) & +bind(C, name="_wrap_FCVodeSensFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeQuadSensInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadSensInit") & +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_FCVodeQuadSensReInit(farg1, farg2) & +bind(C, name="_wrap_FCVodeQuadSensReInit") & +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_FCVodeQuadSensSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadSensSStolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadSensSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadSensSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadSensEEtolerances(farg1) & +bind(C, name="_wrap_FCVodeQuadSensEEtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetQuadSensErrCon(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetQuadSensErrCon") & +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_FCVodeGetQuadSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetQuadSens") & +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_FCVodeGetQuadSens1(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetQuadSens1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetQuadSensDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetQuadSensDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetQuadSensDky1(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeGetQuadSensDky1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetQuadSensNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadSensNumRhsEvals") & +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_FCVodeGetQuadSensNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadSensNumErrTestFails") & +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_FCVodeGetQuadSensErrWeights(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetQuadSensErrWeights") & +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_FCVodeGetQuadSensStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetQuadSensStats") & +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 + +subroutine swigc_FCVodeQuadSensFree(farg1) & +bind(C, name="_wrap_FCVodeQuadSensFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeAdjInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeAdjInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeAdjReInit(farg1) & +bind(C, name="_wrap_FCVodeAdjReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FCVodeAdjFree(farg1) & +bind(C, name="_wrap_FCVodeAdjFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FCVodeCreateB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeCreateB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeInitB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeInitBS(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeInitBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeReInitB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSStolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSStolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSVtolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSVtolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadInitB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeQuadInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadInitBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeQuadInitBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadReInitB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeQuadReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadSStolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeQuadSStolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeQuadSVtolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeQuadSVtolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeF(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FCVodeF") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetAdjNoSensi(farg1) & +bind(C, name="_wrap_FCVodeSetAdjNoSensi") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxOrdB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetMaxOrdB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxNumStepsB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetMaxNumStepsB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_LONG), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetStabLimDetB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetStabLimDetB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetInitStepB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetInitStepB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMinStepB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetMinStepB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetMaxStepB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetMaxStepB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetConstraintsB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetConstraintsB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetQuadErrConB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetQuadErrConB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetNonlinearSolverB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetNonlinearSolverB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetQuadB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeGetQuadB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetAdjCVodeBmem(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetAdjCVodeBmem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FCVodeGetAdjY(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetAdjY") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_my_addr_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_my_addr_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_my_addr_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_my_addr_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_next_addr_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_next_addr_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_next_addr_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_next_addr_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_t0_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_t0_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_t0_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_t0_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_t1_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_t1_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_t1_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_t1_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_nstep_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_nstep_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_LONG), intent(in) :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_nstep_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_nstep_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_LONG) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_order_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_order_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_order_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_order_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_CVadjCheckPointRec_step_set(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_step_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_CVadjCheckPointRec_step_get(farg1) & +bind(C, name="_wrap_CVadjCheckPointRec_step_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_new_CVadjCheckPointRec() & +bind(C, name="_wrap_new_CVadjCheckPointRec") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_CVadjCheckPointRec(farg1) & +bind(C, name="_wrap_delete_CVadjCheckPointRec") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_CVadjCheckPointRec_op_assign__(farg1, farg2) & +bind(C, name="_wrap_CVadjCheckPointRec_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FCVodeGetAdjCheckPointsInfo(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetAdjCheckPointsInfo") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacTimesRhsFnB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetJacTimesRhsFnB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetAdjDataPointHermite(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeGetAdjDataPointHermite") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetAdjDataPointPolynomial(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVodeGetAdjDataPointPolynomial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetAdjCurrentCheckPoint(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetAdjCurrentCheckPoint") & +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_FCVBandPrecInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVBandPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVBandPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVBandPrecGetWorkSpace") & +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_FCVBandPrecGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVBandPrecGetNumRhsEvals") & +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_FCVBandPrecInitB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVBandPrecInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVBBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVBBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVBBDPrecGetWorkSpace") & +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_FCVBBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FCVBBDPrecGetNumGfnEvals") & +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_FCVBBDPrecInitB(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10) & +bind(C, name="_wrap_FCVBBDPrecInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +integer(C_INT32_T), intent(in) :: farg7 +real(C_DOUBLE), intent(in) :: farg8 +type(C_FUNPTR), value :: farg9 +type(C_FUNPTR), value :: farg10 +integer(C_INT) :: fresult +end function + +function swigc_FCVBBDPrecReInitB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FCVBBDPrecReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FCVDiag(farg1) & +bind(C, name="_wrap_FCVDiag") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FCVDiagGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVDiagGetWorkSpace") & +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_FCVDiagGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVDiagGetNumRhsEvals") & +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_FCVDiagGetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FCVDiagGetLastFlag") & +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_FCVDiagGetReturnFlagName(farg1) & +bind(C, name="_wrap_FCVDiagGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FCVDiagB(farg1, farg2) & +bind(C, name="_wrap_FCVDiagB") & +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_FCVodeSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLinearSolver") & +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_FCVodeSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacEvalFrequency(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetJacEvalFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLinearSolutionScaling") & +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_FCVodeSetDeltaGammaMaxBadJac(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetDeltaGammaMaxBadJac") & +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_FCVodeSetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetEpsLin") & +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_FCVodeSetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLSNormFactor") & +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_FCVodeSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinSysFn(farg1, farg2) & +bind(C, name="_wrap_FCVodeSetLinSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetJac(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJac") & +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_FCVodeGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJacTime") & +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_FCVodeGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetJacNumSteps") & +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_FCVodeGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetLinWorkSpace") & +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_FCVodeGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJacEvals") & +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_FCVodeGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumPrecEvals") & +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_FCVodeGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumPrecSolves") & +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_FCVodeGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinIters") & +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_FCVodeGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinConvFails") & +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_FCVodeGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJTSetupEvals") & +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_FCVodeGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumJtimesEvals") & +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_FCVodeGetNumLinRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetNumLinRhsEvals") & +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_FCVodeGetLinSolveStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FCVodeGetLinSolveStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FCVodeGetLastLinFlag") & +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_FCVodeGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FCVodeGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FCVodeSetLinearSolverB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetLinearSolverB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacFnB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetJacFnB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacFnBS(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetJacFnBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetEpsLinB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetEpsLinB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLSNormFactorB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLSNormFactorB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinearSolutionScalingB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLinearSolutionScalingB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetPreconditionerB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetPreconditionerB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetPreconditionerBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetPreconditionerBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacTimesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetJacTimesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetJacTimesBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FCVodeSetJacTimesBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinSysFnB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLinSysFnB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FCVodeSetLinSysFnBS(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeSetLinSysFnBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FCVodeCreate(lmm, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: lmm +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = lmm +farg2 = sunctx +fresult = swigc_FCVodeCreate(farg1, farg2) +swig_result = fresult +end function + +function FCVodeInit(cvode_mem, f, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: f +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = f +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FCVodeInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeReInit(cvode_mem, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = t0 +farg3 = c_loc(y0) +fresult = swigc_FCVodeReInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSStolerances(cvode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FCVodeSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSVtolerances(cvode_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FCVodeSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeWFtolerances(cvode_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = efun +fresult = swigc_FCVodeWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetConstraints(cvode_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(constraints) +fresult = swigc_FCVodeSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetDeltaGammaMaxLSetup(cvode_mem, dgmax_lsetup) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: dgmax_lsetup +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = dgmax_lsetup +fresult = swigc_FCVodeSetDeltaGammaMaxLSetup(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetInitStep(cvode_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hin +fresult = swigc_FCVodeSetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLSetupFrequency(cvode_mem, msbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: msbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = msbp +fresult = swigc_FCVodeSetLSetupFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxConvFails(cvode_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxncf +fresult = swigc_FCVodeSetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxErrTestFails(cvode_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxnef +fresult = swigc_FCVodeSetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxHnilWarns(cvode_mem, mxhnil) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: mxhnil +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = mxhnil +fresult = swigc_FCVodeSetMaxHnilWarns(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxNonlinIters(cvode_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxcor +fresult = swigc_FCVodeSetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxNumSteps(cvode_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = mxsteps +fresult = swigc_FCVodeSetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxOrd(cvode_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxord +fresult = swigc_FCVodeSetMaxOrd(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMaxStep(cvode_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hmax +fresult = swigc_FCVodeSetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMinStep(cvode_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = hmin +fresult = swigc_FCVodeSetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMonitorFn(cvode_mem, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = fn +fresult = swigc_FCVodeSetMonitorFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetMonitorFrequency(cvode_mem, nst) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: nst +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = nst +fresult = swigc_FCVodeSetMonitorFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNlsRhsFn(cvode_mem, f) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: f +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = f +fresult = swigc_FCVodeSetNlsRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinConvCoef(cvode_mem, nlscoef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: nlscoef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = nlscoef +fresult = swigc_FCVodeSetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolver(cvode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetStabLimDet(cvode_mem, stldet) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: stldet +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = stldet +fresult = swigc_FCVodeSetStabLimDet(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetStopTime(cvode_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = tstop +fresult = swigc_FCVodeSetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetInterpolateStopTime(cvode_mem, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = interp +fresult = swigc_FCVodeSetInterpolateStopTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeClearStopTime(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeClearStopTime(farg1) +swig_result = fresult +end function + +function FCVodeSetUserData(cvode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = user_data +fresult = swigc_FCVodeSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaFixedStepBounds(cvode_mem, eta_min_fx, eta_max_fx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min_fx +real(C_DOUBLE), intent(in) :: eta_max_fx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = eta_min_fx +farg3 = eta_max_fx +fresult = swigc_FCVodeSetEtaFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetEtaMaxFirstStep(cvode_mem, eta_max_fs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_fs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_fs +fresult = swigc_FCVodeSetEtaMaxFirstStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMaxEarlyStep(cvode_mem, eta_max_es) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_es +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_es +fresult = swigc_FCVodeSetEtaMaxEarlyStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNumStepsEtaMaxEarlyStep(cvode_mem, small_nst) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: small_nst +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = small_nst +fresult = swigc_FCVodeSetNumStepsEtaMaxEarlyStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMax(cvode_mem, eta_max_gs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_gs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_gs +fresult = swigc_FCVodeSetEtaMax(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMin(cvode_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_min +fresult = swigc_FCVodeSetEtaMin(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMinErrFail(cvode_mem, eta_min_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_min_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_min_ef +fresult = swigc_FCVodeSetEtaMinErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaMaxErrFail(cvode_mem, eta_max_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_max_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_max_ef +fresult = swigc_FCVodeSetEtaMaxErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNumFailsEtaMaxErrFail(cvode_mem, small_nef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: small_nef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = small_nef +fresult = swigc_FCVodeSetNumFailsEtaMaxErrFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEtaConvFail(cvode_mem, eta_cf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eta_cf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eta_cf +fresult = swigc_FCVodeSetEtaConvFail(farg1, farg2) +swig_result = fresult +end function + +function FCVodeRootInit(cvode_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FCVodeRootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetRootDirection(cvode_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FCVodeSetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNoInactiveRootWarn(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeSetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FCVode(cvode_mem, tout, yout, tret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = cvode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +fresult = swigc_FCVode(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeComputeState(cvode_mem, ycor, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(ycor) +farg3 = c_loc(y) +fresult = swigc_FCVodeComputeState(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeComputeStateSens(cvode_mem, yscor, ys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: yscor +type(C_PTR) :: ys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = yscor +farg3 = ys +fresult = swigc_FCVodeComputeStateSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeComputeStateSens1(cvode_mem, idx, yscor1, ys1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: idx +type(N_Vector), target, intent(inout) :: yscor1 +type(N_Vector), target, intent(inout) :: ys1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = idx +farg3 = c_loc(yscor1) +farg4 = c_loc(ys1) +fresult = swigc_FCVodeComputeStateSens1(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetDky(cvode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FCVodeGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +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 = cvode_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FCVodeGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumSteps(cvode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FCVodeGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumRhsEvals(cvode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FCVodeGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FCVodeGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumErrTestFails(cvode_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FCVodeGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLastOrder(cvode_mem, qlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(qlast(1)) +fresult = swigc_FCVodeGetLastOrder(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentOrder(cvode_mem, qcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: qcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(qcur(1)) +fresult = swigc_FCVodeGetCurrentOrder(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentGamma(cvode_mem, gamma) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(gamma(1)) +fresult = swigc_FCVodeGetCurrentGamma(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumStabLimOrderReds(cvode_mem, nslred) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nslred +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nslred(1)) +fresult = swigc_FCVodeGetNumStabLimOrderReds(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetActualInitStep(cvode_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FCVodeGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLastStep(cvode_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FCVodeGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentStep(cvode_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FCVodeGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentState(cvode_mem, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = y +fresult = swigc_FCVodeGetCurrentState(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentStateSens(cvode_mem, ys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: ys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ys) +fresult = swigc_FCVodeGetCurrentStateSens(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentSensSolveIndex(cvode_mem, index) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: index +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(index(1)) +fresult = swigc_FCVodeGetCurrentSensSolveIndex(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetCurrentTime(cvode_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FCVodeGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetTolScaleFactor(cvode_mem, tolsfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(tolsfac(1)) +fresult = swigc_FCVodeGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetErrWeights(cvode_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(eweight) +fresult = swigc_FCVodeGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetEstLocalErrors(cvode_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ele) +fresult = swigc_FCVodeGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumGEvals(cvode_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FCVodeGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetRootInfo(cvode_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FCVodeGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT), dimension(*), target, intent(inout) :: qcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 +type(C_PTR) :: farg10 +type(C_PTR) :: farg11 + +farg1 = cvode_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(nfevals(1)) +farg4 = c_loc(nlinsetups(1)) +farg5 = c_loc(netfails(1)) +farg6 = c_loc(qlast(1)) +farg7 = c_loc(qcur(1)) +farg8 = c_loc(hinused(1)) +farg9 = c_loc(hlast(1)) +farg10 = c_loc(hcur(1)) +farg11 = c_loc(tcur(1)) +fresult = swigc_FCVodeGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) +swig_result = fresult +end function + +function FCVodeGetNonlinearSystemData(cvode_mem, tcur, ypred, yn, fn, gamma, rl1, zn1, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: ypred +type(C_PTR) :: yn +type(C_PTR) :: fn +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +real(C_DOUBLE), dimension(*), target, intent(inout) :: rl1 +type(C_PTR) :: zn1 +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = cvode_mem +farg2 = c_loc(tcur(1)) +farg3 = ypred +farg4 = yn +farg5 = fn +farg6 = c_loc(gamma(1)) +farg7 = c_loc(rl1(1)) +farg8 = zn1 +farg9 = c_loc(user_data) +fresult = swigc_FCVodeGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVodeGetNonlinearSystemDataSens(cvode_mem, tcur, yspred, ysn, gamma, rl1, zn1, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR), target, intent(inout) :: yspred +type(C_PTR), target, intent(inout) :: ysn +real(C_DOUBLE), dimension(*), target, intent(inout) :: gamma +real(C_DOUBLE), dimension(*), target, intent(inout) :: rl1 +type(C_PTR), target, intent(inout) :: zn1 +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = cvode_mem +farg2 = c_loc(tcur(1)) +farg3 = c_loc(yspred) +farg4 = c_loc(ysn) +farg5 = c_loc(gamma(1)) +farg6 = c_loc(rl1(1)) +farg7 = c_loc(zn1) +farg8 = c_loc(user_data) +fresult = swigc_FCVodeGetNonlinearSystemDataSens(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FCVodeGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumNonlinSolvConvFails(cvode_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FCVodeGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNonlinSolvStats(cvode_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FCVodeGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumStepSolveFails(cvode_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FCVodeGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetUserData(cvode_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(user_data) +fresult = swigc_FCVodeGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FCVodePrintAllStats(cvode_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FCVodePrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FCVodeGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVodeGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FCVodeFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(cvode_mem) +call swigc_FCVodeFree(farg1) +end subroutine + +function FCVodeSetJacTimesRhsFn(cvode_mem, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = jtimesrhsfn +fresult = swigc_FCVodeSetJacTimesRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeQuadInit(cvode_mem, fq, yq0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: fq +type(N_Vector), target, intent(inout) :: yq0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = fq +farg3 = c_loc(yq0) +fresult = swigc_FCVodeQuadInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadReInit(cvode_mem, yq0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: yq0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(yq0) +fresult = swigc_FCVodeQuadReInit(farg1, farg2) +swig_result = fresult +end function + +function FCVodeQuadSStolerances(cvode_mem, reltolq, abstolq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltolq +real(C_DOUBLE), intent(in) :: abstolq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = reltolq +farg3 = abstolq +fresult = swigc_FCVodeQuadSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadSVtolerances(cvode_mem, reltolq, abstolq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltolq +type(N_Vector), target, intent(inout) :: abstolq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltolq +farg3 = c_loc(abstolq) +fresult = swigc_FCVodeQuadSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetQuadErrCon(cvode_mem, errconq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: errconq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = errconq +fresult = swigc_FCVodeSetQuadErrCon(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuad(cvode_mem, tret, yqout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: yqout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(tret(1)) +farg3 = c_loc(yqout) +fresult = swigc_FCVodeGetQuad(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetQuadDky(cvode_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FCVodeGetQuadDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetQuadNumRhsEvals(cvode_mem, nfqevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfqevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfqevals(1)) +fresult = swigc_FCVodeGetQuadNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadNumErrTestFails(cvode_mem, nqetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nqetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nqetfails(1)) +fresult = swigc_FCVodeGetQuadNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadErrWeights(cvode_mem, eqweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(N_Vector), target, intent(inout) :: eqweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(eqweight) +fresult = swigc_FCVodeGetQuadErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadStats(cvode_mem, nfqevals, nqetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfqevals +integer(C_LONG), dimension(*), target, intent(inout) :: nqetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nfqevals(1)) +farg3 = c_loc(nqetfails(1)) +fresult = swigc_FCVodeGetQuadStats(farg1, farg2, farg3) +swig_result = fresult +end function + +subroutine FCVodeQuadFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = cvode_mem +call swigc_FCVodeQuadFree(farg1) +end subroutine + +function FCVodeSensInit(cvode_mem, ns, ism, fs, ys0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: ns +integer(C_INT), intent(in) :: ism +type(C_FUNPTR), intent(in), value :: fs +type(C_PTR) :: ys0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_FUNPTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = ns +farg3 = ism +farg4 = fs +farg5 = ys0 +fresult = swigc_FCVodeSensInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeSensInit1(cvode_mem, ns, ism, fs1, ys0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: ns +integer(C_INT), intent(in) :: ism +type(C_FUNPTR), intent(in), value :: fs1 +type(C_PTR) :: ys0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_FUNPTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = ns +farg3 = ism +farg4 = fs1 +farg5 = ys0 +fresult = swigc_FCVodeSensInit1(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeSensReInit(cvode_mem, ism, ys0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: ism +type(C_PTR) :: ys0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = ism +farg3 = ys0 +fresult = swigc_FCVodeSensReInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSensSStolerances(cvode_mem, reltols, abstols) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltols +real(C_DOUBLE), dimension(*), target, intent(inout) :: abstols +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltols +farg3 = c_loc(abstols(1)) +fresult = swigc_FCVodeSensSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSensSVtolerances(cvode_mem, reltols, abstols) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltols +type(C_PTR) :: abstols +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltols +farg3 = abstols +fresult = swigc_FCVodeSensSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSensEEtolerances(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeSensEEtolerances(farg1) +swig_result = fresult +end function + +function FCVodeSetSensDQMethod(cvode_mem, dqtype, dqrhomax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: dqtype +real(C_DOUBLE), intent(in) :: dqrhomax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = dqtype +farg3 = dqrhomax +fresult = swigc_FCVodeSetSensDQMethod(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetSensErrCon(cvode_mem, errcons) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: errcons +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = errcons +fresult = swigc_FCVodeSetSensErrCon(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetSensMaxNonlinIters(cvode_mem, maxcors) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: maxcors +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = maxcors +fresult = swigc_FCVodeSetSensMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetSensParams(cvode_mem, p, pbar, plist) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: pbar +integer(C_INT), dimension(*), target, intent(inout) :: plist +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = c_loc(p(1)) +farg3 = c_loc(pbar(1)) +farg4 = c_loc(plist(1)) +fresult = swigc_FCVodeSetSensParams(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolverSensSim(cvode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolverSensSim(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolverSensStg(cvode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolverSensStg(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolverSensStg1(cvode_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolverSensStg1(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSensToggleOff(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeSensToggleOff(farg1) +swig_result = fresult +end function + +function FCVodeGetSens(cvode_mem, tret, ysout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(C_PTR) :: ysout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(tret(1)) +farg3 = ysout +fresult = swigc_FCVodeGetSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetSens1(cvode_mem, tret, is, ysout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: ysout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = c_loc(tret(1)) +farg3 = is +farg4 = c_loc(ysout) +fresult = swigc_FCVodeGetSens1(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetSensDky(cvode_mem, t, k, dkya) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(C_PTR) :: dkya +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = dkya +fresult = swigc_FCVodeGetSensDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetSensDky1(cvode_mem, t, k, is, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = is +farg5 = c_loc(dky) +fresult = swigc_FCVodeGetSensDky1(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeGetSensNumRhsEvals(cvode_mem, nfsevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfsevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfsevals(1)) +fresult = swigc_FCVodeGetSensNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumRhsEvalsSens(cvode_mem, nfevalss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalss(1)) +fresult = swigc_FCVodeGetNumRhsEvalsSens(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensNumErrTestFails(cvode_mem, nsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsetfails(1)) +fresult = swigc_FCVodeGetSensNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensNumLinSolvSetups(cvode_mem, nlinsetupss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetupss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nlinsetupss(1)) +fresult = swigc_FCVodeGetSensNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensErrWeights(cvode_mem, esweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: esweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = esweight +fresult = swigc_FCVodeGetSensErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensStats(cvode_mem, nfsevals, nfevalss, nsetfails, nlinsetupss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfsevals +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalss +integer(C_LONG), dimension(*), target, intent(inout) :: nsetfails +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetupss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = c_loc(nfsevals(1)) +farg3 = c_loc(nfevalss(1)) +farg4 = c_loc(nsetfails(1)) +farg5 = c_loc(nlinsetupss(1)) +fresult = swigc_FCVodeGetSensStats(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeGetSensNumNonlinSolvIters(cvode_mem, nsniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsniters(1)) +fresult = swigc_FCVodeGetSensNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensNumNonlinSolvConvFails(cvode_mem, nsnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsnfails(1)) +fresult = swigc_FCVodeGetSensNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetSensNonlinSolvStats(cvode_mem, nsniters, nsnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsniters +integer(C_LONG), dimension(*), target, intent(inout) :: nsnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nsniters(1)) +farg3 = c_loc(nsnfails(1)) +fresult = swigc_FCVodeGetSensNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumStepSensSolveFails(cvode_mem, nsncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nsncfails(1)) +fresult = swigc_FCVodeGetNumStepSensSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetStgrSensNumNonlinSolvIters(cvode_mem, nstgr1niters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nstgr1niters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nstgr1niters(1)) +fresult = swigc_FCVodeGetStgrSensNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem, nstgr1nfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nstgr1nfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nstgr1nfails(1)) +fresult = swigc_FCVodeGetStgrSensNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetStgrSensNonlinSolvStats(cvode_mem, nstgr1niters, nstgr1nfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nstgr1niters +integer(C_LONG), dimension(*), target, intent(inout) :: nstgr1nfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nstgr1niters(1)) +farg3 = c_loc(nstgr1nfails(1)) +fresult = swigc_FCVodeGetStgrSensNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumStepStgrSensSolveFails(cvode_mem, nstgr1ncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nstgr1ncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nstgr1ncfails(1)) +fresult = swigc_FCVodeGetNumStepStgrSensSolveFails(farg1, farg2) +swig_result = fresult +end function + +subroutine FCVodeSensFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = cvode_mem +call swigc_FCVodeSensFree(farg1) +end subroutine + +function FCVodeQuadSensInit(cvode_mem, fqs, yqs0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: fqs +type(C_PTR) :: yqs0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = fqs +farg3 = yqs0 +fresult = swigc_FCVodeQuadSensInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadSensReInit(cvode_mem, yqs0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: yqs0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = yqs0 +fresult = swigc_FCVodeQuadSensReInit(farg1, farg2) +swig_result = fresult +end function + +function FCVodeQuadSensSStolerances(cvode_mem, reltolqs, abstolqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltolqs +real(C_DOUBLE), dimension(*), target, intent(inout) :: abstolqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltolqs +farg3 = c_loc(abstolqs(1)) +fresult = swigc_FCVodeQuadSensSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadSensSVtolerances(cvode_mem, reltolqs, abstolqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: reltolqs +type(C_PTR) :: abstolqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = reltolqs +farg3 = abstolqs +fresult = swigc_FCVodeQuadSensSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadSensEEtolerances(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeQuadSensEEtolerances(farg1) +swig_result = fresult +end function + +function FCVodeSetQuadSensErrCon(cvode_mem, errconqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: errconqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = errconqs +fresult = swigc_FCVodeSetQuadSensErrCon(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadSens(cvode_mem, tret, yqsout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(C_PTR) :: yqsout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(tret(1)) +farg3 = yqsout +fresult = swigc_FCVodeGetQuadSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetQuadSens1(cvode_mem, tret, is, yqsout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: yqsout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = c_loc(tret(1)) +farg3 = is +farg4 = c_loc(yqsout) +fresult = swigc_FCVodeGetQuadSens1(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetQuadSensDky(cvode_mem, t, k, dkyqs_all) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(C_PTR) :: dkyqs_all +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = dkyqs_all +fresult = swigc_FCVodeGetQuadSensDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetQuadSensDky1(cvode_mem, t, k, is, dkyqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: dkyqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = t +farg3 = k +farg4 = is +farg5 = c_loc(dkyqs) +fresult = swigc_FCVodeGetQuadSensDky1(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeGetQuadSensNumRhsEvals(cvode_mem, nfqsevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfqsevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfqsevals(1)) +fresult = swigc_FCVodeGetQuadSensNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadSensNumErrTestFails(cvode_mem, nqsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nqsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nqsetfails(1)) +fresult = swigc_FCVodeGetQuadSensNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadSensErrWeights(cvode_mem, eqsweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR) :: eqsweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = eqsweight +fresult = swigc_FCVodeGetQuadSensErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetQuadSensStats(cvode_mem, nfqsevals, nqsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfqsevals +integer(C_LONG), dimension(*), target, intent(inout) :: nqsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(nfqsevals(1)) +farg3 = c_loc(nqsetfails(1)) +fresult = swigc_FCVodeGetQuadSensStats(farg1, farg2, farg3) +swig_result = fresult +end function + +subroutine FCVodeQuadSensFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = cvode_mem +call swigc_FCVodeQuadSensFree(farg1) +end subroutine + +function FCVodeAdjInit(cvode_mem, steps, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: steps +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = steps +farg3 = interp +fresult = swigc_FCVodeAdjInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeAdjReInit(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeAdjReInit(farg1) +swig_result = fresult +end function + +subroutine FCVodeAdjFree(cvode_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: cvode_mem +type(C_PTR) :: farg1 + +farg1 = cvode_mem +call swigc_FCVodeAdjFree(farg1) +end subroutine + +function FCVodeCreateB(cvode_mem, lmmb, which) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: lmmb +integer(C_INT), dimension(*), target, intent(inout) :: which +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = lmmb +farg3 = c_loc(which(1)) +fresult = swigc_FCVodeCreateB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeInitB(cvode_mem, which, fb, tb0, yb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: fb +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = fb +farg4 = tb0 +farg5 = c_loc(yb0) +fresult = swigc_FCVodeInitB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeInitBS(cvode_mem, which, fbs, tb0, yb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: fbs +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = fbs +farg4 = tb0 +farg5 = c_loc(yb0) +fresult = swigc_FCVodeInitBS(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeReInitB(cvode_mem, which, tb0, yb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = tb0 +farg4 = c_loc(yb0) +fresult = swigc_FCVodeReInitB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSStolerancesB(cvode_mem, which, reltolb, abstolb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolb +real(C_DOUBLE), intent(in) :: abstolb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = reltolb +farg4 = abstolb +fresult = swigc_FCVodeSStolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSVtolerancesB(cvode_mem, which, reltolb, abstolb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolb +type(N_Vector), target, intent(inout) :: abstolb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = reltolb +farg4 = c_loc(abstolb) +fresult = swigc_FCVodeSVtolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeQuadInitB(cvode_mem, which, fqb, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: fqb +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = fqb +farg4 = c_loc(yqb0) +fresult = swigc_FCVodeQuadInitB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeQuadInitBS(cvode_mem, which, fqbs, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: fqbs +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = fqbs +farg4 = c_loc(yqb0) +fresult = swigc_FCVodeQuadInitBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeQuadReInitB(cvode_mem, which, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(yqb0) +fresult = swigc_FCVodeQuadReInitB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeQuadSStolerancesB(cvode_mem, which, reltolqb, abstolqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolqb +real(C_DOUBLE), intent(in) :: abstolqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = reltolqb +farg4 = abstolqb +fresult = swigc_FCVodeQuadSStolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeQuadSVtolerancesB(cvode_mem, which, reltolqb, abstolqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolqb +type(N_Vector), target, intent(inout) :: abstolqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = reltolqb +farg4 = c_loc(abstolqb) +fresult = swigc_FCVodeQuadSVtolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeF(cvode_mem, tout, yout, tret, itask, ncheckptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: yout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: itask +integer(C_INT), dimension(*), target, intent(inout) :: ncheckptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = cvode_mem +farg2 = tout +farg3 = c_loc(yout) +farg4 = c_loc(tret(1)) +farg5 = itask +farg6 = c_loc(ncheckptr(1)) +fresult = swigc_FCVodeF(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FCVodeB(cvode_mem, tbout, itaskb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: tbout +integer(C_INT), intent(in) :: itaskb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = tbout +farg3 = itaskb +fresult = swigc_FCVodeB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetAdjNoSensi(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVodeSetAdjNoSensi(farg1) +swig_result = fresult +end function + +function FCVodeSetUserDataB(cvode_mem, which, user_datab) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_PTR) :: user_datab +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = user_datab +fresult = swigc_FCVodeSetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetMaxOrdB(cvode_mem, which, maxordb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: maxordb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = maxordb +fresult = swigc_FCVodeSetMaxOrdB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetMaxNumStepsB(cvode_mem, which, mxstepsb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_LONG), intent(in) :: mxstepsb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_LONG) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = mxstepsb +fresult = swigc_FCVodeSetMaxNumStepsB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetStabLimDetB(cvode_mem, which, stldetb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: stldetb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = stldetb +fresult = swigc_FCVodeSetStabLimDetB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetInitStepB(cvode_mem, which, hinb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: hinb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = hinb +fresult = swigc_FCVodeSetInitStepB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetMinStepB(cvode_mem, which, hminb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: hminb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = hminb +fresult = swigc_FCVodeSetMinStepB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetMaxStepB(cvode_mem, which, hmaxb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: hmaxb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = hmaxb +fresult = swigc_FCVodeSetMaxStepB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetConstraintsB(cvode_mem, which, constraintsb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: constraintsb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(constraintsb) +fresult = swigc_FCVodeSetConstraintsB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetQuadErrConB(cvode_mem, which, errconqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: errconqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = errconqb +fresult = swigc_FCVodeSetQuadErrConB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetNonlinearSolverB(cvode_mem, which, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(nls) +fresult = swigc_FCVodeSetNonlinearSolverB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetB(cvode_mem, which, tbret, yb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: tbret +type(N_Vector), target, intent(inout) :: yb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(tbret(1)) +farg4 = c_loc(yb) +fresult = swigc_FCVodeGetB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetQuadB(cvode_mem, which, tbret, qb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: tbret +type(N_Vector), target, intent(inout) :: qb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(tbret(1)) +farg4 = c_loc(qb) +fresult = swigc_FCVodeGetQuadB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeGetAdjCVodeBmem(cvode_mem, which) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = which +fresult = swigc_FCVodeGetAdjCVodeBmem(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetAdjY(cvode_mem, t, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = t +farg3 = c_loc(y) +fresult = swigc_FCVodeGetAdjY(farg1, farg2, farg3) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_my_addr_set(self, my_addr) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +type(C_PTR) :: my_addr +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = my_addr +call swigc_CVadjCheckPointRec_my_addr_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_my_addr_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_my_addr_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_next_addr_set(self, next_addr) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +type(C_PTR) :: next_addr +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = next_addr +call swigc_CVadjCheckPointRec_next_addr_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_next_addr_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_next_addr_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_t0_set(self, t0) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: t0 +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = t0 +call swigc_CVadjCheckPointRec_t0_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_t0_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_t0_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_t1_set(self, t1) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: t1 +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = t1 +call swigc_CVadjCheckPointRec_t1_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_t1_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_t1_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_nstep_set(self, nstep) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +integer(C_LONG), intent(in) :: nstep +type(SwigClassWrapper) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = self%swigdata +farg2 = nstep +call swigc_CVadjCheckPointRec_nstep_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_nstep_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_LONG) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +integer(C_LONG) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_nstep_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_order_set(self, order) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = order +call swigc_CVadjCheckPointRec_order_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_order_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_order_get(farg1) +swig_result = fresult +end function + +subroutine swigf_CVadjCheckPointRec_step_set(self, step) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: step +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = step +call swigc_CVadjCheckPointRec_step_set(farg1, farg2) +end subroutine + +function swigf_CVadjCheckPointRec_step_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(CVadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_CVadjCheckPointRec_step_get(farg1) +swig_result = fresult +end function + +function swigf_create_CVadjCheckPointRec() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(CVadjCheckPointRec) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_CVadjCheckPointRec() +self%swigdata = fresult +end function + +subroutine swigf_release_CVadjCheckPointRec(self) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_CVadjCheckPointRec(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_CVadjCheckPointRec_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(CVadjCheckPointRec), intent(inout) :: self +type(CVadjCheckPointRec), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_CVadjCheckPointRec_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FCVodeGetAdjCheckPointsInfo(cvode_mem, ckpnt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +class(CVadjCheckPointRec), intent(in) :: ckpnt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = cvode_mem +farg2 = ckpnt%swigdata +fresult = swigc_FCVodeGetAdjCheckPointsInfo(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetJacTimesRhsFnB(cvode_mem, which, jtimesrhsfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtimesrhsfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = jtimesrhsfn +fresult = swigc_FCVodeSetJacTimesRhsFnB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetAdjDataPointHermite(cvode_mem, which, t, y, yd) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: t +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: yd +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(t(1)) +farg4 = c_loc(y) +farg5 = c_loc(yd) +fresult = swigc_FCVodeGetAdjDataPointHermite(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeGetAdjDataPointPolynomial(cvode_mem, which, t, order, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: t +integer(C_INT), dimension(*), target, intent(inout) :: order +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(t(1)) +farg4 = c_loc(order(1)) +farg5 = c_loc(y) +fresult = swigc_FCVodeGetAdjDataPointPolynomial(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVodeGetAdjCurrentCheckPoint(cvode_mem, addr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: addr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(addr) +fresult = swigc_FCVodeGetAdjCurrentCheckPoint(farg1, farg2) +swig_result = fresult +end function + +function FCVBandPrecInit(cvode_mem, n, mu, ml) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: mu +integer(C_INT32_T), intent(in) :: ml +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 + +farg1 = cvode_mem +farg2 = n +farg3 = mu +farg4 = ml +fresult = swigc_FCVBandPrecInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVBandPrecGetWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVBandPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVBandPrecGetNumRhsEvals(cvode_mem, nfevalsbp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsbp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsbp(1)) +fresult = swigc_FCVBandPrecGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVBandPrecInitB(cvode_mem, which, nb, mub, mlb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT32_T), intent(in) :: nb +integer(C_INT32_T), intent(in) :: mub +integer(C_INT32_T), intent(in) :: mlb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = nb +farg4 = mub +farg5 = mlb +fresult = swigc_FCVBandPrecInitB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dqrely +type(C_FUNPTR), intent(in), value :: gloc +type(C_FUNPTR), intent(in), value :: cfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = cvode_mem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dqrely +farg8 = gloc +farg9 = cfn +fresult = swigc_FCVBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVBBDPrecReInit(cvode_mem, mudq, mldq, dqrely) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dqrely +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = cvode_mem +farg2 = mudq +farg3 = mldq +farg4 = dqrely +fresult = swigc_FCVBBDPrecReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FCVBBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FCVBBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVBBDPrecInitB(cvode_mem, which, nlocalb, mudqb, mldqb, mukeepb, mlkeepb, dqrelyb, glocb, cfnb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT32_T), intent(in) :: nlocalb +integer(C_INT32_T), intent(in) :: mudqb +integer(C_INT32_T), intent(in) :: mldqb +integer(C_INT32_T), intent(in) :: mukeepb +integer(C_INT32_T), intent(in) :: mlkeepb +real(C_DOUBLE), intent(in) :: dqrelyb +type(C_FUNPTR), intent(in), value :: glocb +type(C_FUNPTR), intent(in), value :: cfnb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +integer(C_INT32_T) :: farg7 +real(C_DOUBLE) :: farg8 +type(C_FUNPTR) :: farg9 +type(C_FUNPTR) :: farg10 + +farg1 = cvode_mem +farg2 = which +farg3 = nlocalb +farg4 = mudqb +farg5 = mldqb +farg6 = mukeepb +farg7 = mlkeepb +farg8 = dqrelyb +farg9 = glocb +farg10 = cfnb +fresult = swigc_FCVBBDPrecInitB(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10) +swig_result = fresult +end function + +function FCVBBDPrecReInitB(cvode_mem, which, mudqb, mldqb, dqrelyb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT32_T), intent(in) :: mudqb +integer(C_INT32_T), intent(in) :: mldqb +real(C_DOUBLE), intent(in) :: dqrelyb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = cvode_mem +farg2 = which +farg3 = mudqb +farg4 = mldqb +farg5 = dqrelyb +fresult = swigc_FCVBBDPrecReInitB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FCVDiag(cvode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = cvode_mem +fresult = swigc_FCVDiag(farg1) +swig_result = fresult +end function + +function FCVDiagGetWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVDiagGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVDiagGetNumRhsEvals(cvode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FCVDiagGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVDiagGetLastFlag(cvode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FCVDiagGetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FCVDiagGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVDiagGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FCVDiagB(cvode_mem, which) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = which +fresult = swigc_FCVDiagB(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLinearSolver(cvode_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FCVodeSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetJacFn(cvode_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = jac +fresult = swigc_FCVodeSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetJacEvalFrequency(cvode_mem, msbj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), intent(in) :: msbj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = cvode_mem +farg2 = msbj +fresult = swigc_FCVodeSetJacEvalFrequency(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLinearSolutionScaling(cvode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = cvode_mem +farg2 = onoff +fresult = swigc_FCVodeSetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetDeltaGammaMaxBadJac(cvode_mem, dgmax_jbad) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: dgmax_jbad +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = dgmax_jbad +fresult = swigc_FCVodeSetDeltaGammaMaxBadJac(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetEpsLin(cvode_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = cvode_mem +farg2 = eplifac +fresult = swigc_FCVodeSetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetLSNormFactor(arkode_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = nrmfac +fresult = swigc_FCVodeSetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FCVodeSetPreconditioner(cvode_mem, pset, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = pset +farg3 = psolve +fresult = swigc_FCVodeSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetJacTimes(cvode_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FCVodeSetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetLinSysFn(cvode_mem, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = cvode_mem +farg2 = linsys +fresult = swigc_FCVodeSetLinSysFn(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJac(cvode_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(j) +fresult = swigc_FCVodeGetJac(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJacTime(cvode_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FCVodeGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetJacNumSteps(cvode_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FCVodeGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FCVodeGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeGetNumJacEvals(cvode_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FCVodeGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumPrecEvals(cvode_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FCVodeGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumPrecSolves(cvode_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FCVodeGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinIters(cvode_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FCVodeGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinConvFails(cvode_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FCVodeGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumJTSetupEvals(cvode_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FCVodeGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumJtimesEvals(cvode_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FCVodeGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetNumLinRhsEvals(cvode_mem, nfevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(nfevalsls(1)) +fresult = swigc_FCVodeGetNumLinRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinSolveStats(cvode_mem, njevals, nfevalsls, nliters, nlcfails, npevals, npsolves, njtsetups, njtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_LONG), dimension(*), target, intent(inout) :: nfevalsls +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_LONG), dimension(*), target, intent(inout) :: njtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = cvode_mem +farg2 = c_loc(njevals(1)) +farg3 = c_loc(nfevalsls(1)) +farg4 = c_loc(nliters(1)) +farg5 = c_loc(nlcfails(1)) +farg6 = c_loc(npevals(1)) +farg7 = c_loc(npsolves(1)) +farg8 = c_loc(njtsetups(1)) +farg9 = c_loc(njtimes(1)) +fresult = swigc_FCVodeGetLinSolveStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FCVodeGetLastLinFlag(cvode_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = cvode_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FCVodeGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FCVodeGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FCVodeGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FCVodeSetLinearSolverB(cvode_mem, which, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(ls) +farg4 = c_loc(a) +fresult = swigc_FCVodeSetLinearSolverB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetJacFnB(cvode_mem, which, jacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = jacb +fresult = swigc_FCVodeSetJacFnB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetJacFnBS(cvode_mem, which, jacbs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jacbs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = jacbs +fresult = swigc_FCVodeSetJacFnBS(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetEpsLinB(cvode_mem, which, eplifacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: eplifacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = eplifacb +fresult = swigc_FCVodeSetEpsLinB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetLSNormFactorB(arkode_mem, which, nrmfacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: nrmfacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = arkode_mem +farg2 = which +farg3 = nrmfacb +fresult = swigc_FCVodeSetLSNormFactorB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetLinearSolutionScalingB(cvode_mem, which, onoffb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: onoffb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = onoffb +fresult = swigc_FCVodeSetLinearSolutionScalingB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetPreconditionerB(cvode_mem, which, psetb, psolveb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: psetb +type(C_FUNPTR), intent(in), value :: psolveb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = psetb +farg4 = psolveb +fresult = swigc_FCVodeSetPreconditionerB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetPreconditionerBS(cvode_mem, which, psetbs, psolvebs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: psetbs +type(C_FUNPTR), intent(in), value :: psolvebs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = psetbs +farg4 = psolvebs +fresult = swigc_FCVodeSetPreconditionerBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetJacTimesB(cvode_mem, which, jtsetupb, jtimesb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtsetupb +type(C_FUNPTR), intent(in), value :: jtimesb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = jtsetupb +farg4 = jtimesb +fresult = swigc_FCVodeSetJacTimesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetJacTimesBS(cvode_mem, which, jtsetupbs, jtimesbs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtsetupbs +type(C_FUNPTR), intent(in), value :: jtimesbs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = cvode_mem +farg2 = which +farg3 = jtsetupbs +farg4 = jtimesbs +fresult = swigc_FCVodeSetJacTimesBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FCVodeSetLinSysFnB(cvode_mem, which, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = linsys +fresult = swigc_FCVodeSetLinSysFnB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FCVodeSetLinSysFnBS(cvode_mem, which, linsys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: linsys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = linsys +fresult = swigc_FCVodeSetLinSysFnBS(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/cvodes/fmod_int64/CMakeLists.txt b/src/cvodes/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..031ac9c6f9 --- /dev/null +++ b/src/cvodes/fmod_int64/CMakeLists.txt @@ -0,0 +1,46 @@ +# --------------------------------------------------------------- +# Programmer: Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 cvodes object library + +set(cvodes_SOURCES fcvodes_mod.f90 fcvodes_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_fcvodes_mod + SOURCES + ${cvodes_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + sundials_fsunnonlinsolnewton_mod_obj + sundials_fsunnonlinsolfixedpoint_mod_obj + OUTPUT_NAME + sundials_fcvodes_mod + VERSION + ${cvodeslib_VERSION} + SOVERSION + ${cvodeslib_SOVERSION} +) + +message(STATUS "Added CVODES F2003 interface") diff --git a/src/cvodes/fmod/fcvodes_mod.c b/src/cvodes/fmod_int64/fcvodes_mod.c similarity index 100% rename from src/cvodes/fmod/fcvodes_mod.c rename to src/cvodes/fmod_int64/fcvodes_mod.c diff --git a/src/cvodes/fmod/fcvodes_mod.f90 b/src/cvodes/fmod_int64/fcvodes_mod.f90 similarity index 100% rename from src/cvodes/fmod/fcvodes_mod.f90 rename to src/cvodes/fmod_int64/fcvodes_mod.f90 diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 2bb371dee2..8a7e5ae25e 100644 --- a/src/ida/CMakeLists.txt +++ b/src/ida/CMakeLists.txt @@ -75,5 +75,5 @@ message(STATUS "Added IDA module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/ida/fmod/CMakeLists.txt b/src/ida/fmod_int32/CMakeLists.txt similarity index 100% rename from src/ida/fmod/CMakeLists.txt rename to src/ida/fmod_int32/CMakeLists.txt diff --git a/src/ida/fmod_int32/fida_mod.c b/src/ida/fmod_int32/fida_mod.c new file mode 100644 index 0000000000..0ebd34a2c2 --- /dev/null +++ b/src/ida/fmod_int32/fida_mod.c @@ -0,0 +1,1784 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "ida/ida.h" +#include "ida/ida_bbdpre.h" +#include "ida/ida_ls.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FIDACreate(void *farg1) { + void * fresult ; + SUNContext arg1 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNContext)(farg1); + result = (void *)IDACreate(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDASVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAWFtolerances(void *farg1, IDAEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAEwtFn arg2 = (IDAEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAEwtFn)(farg2); + result = (int)IDAWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDACalcIC(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinConvCoefIC(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetNonlinConvCoefIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumStepsIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumStepsIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumJacsIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumJacsIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumItersIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumItersIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLineSearchOffIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetLineSearchOffIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetStepToleranceIC(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetStepToleranceIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxBacksIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxBacksIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetDeltaCjLSetup(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetDeltaCjLSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)IDASetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxOrd(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxOrd(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)IDASetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDAClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSuppressAlg(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetSuppressAlg(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetId(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDASetId(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDASetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetEtaFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaLow(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMinErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaConvFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaConvFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNlsResFn(void *farg1, IDAResFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + result = (int)IDASetNlsResFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)IDASetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDARootInit(void *farg1, int const *farg2, IDARootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDARootFn arg3 = (IDARootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDARootFn)(farg3); + result = (int)IDARootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDASetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDASetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASolve(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int arg6 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + arg6 = (int)(*farg6); + result = (int)IDASolve(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeY(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAComputeY(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeYp(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAComputeYp(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumResEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumResEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumBacktrackOps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumBacktrackOps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetConsistentIC(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAGetConsistentIC(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetLastOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetCurrentOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentCj(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentCj(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentY(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAGetCurrentY(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentYp(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAGetCurrentYp(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, int *farg6, int *farg7, double *farg8, double *farg9, double *farg10, double *farg11) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (int *)(farg6); + arg7 = (int *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); + result = (int)IDAGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, void *farg7, double *farg8, void *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + void **arg9 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (void **)(farg9); + result = (int)IDAGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)IDAGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)IDAPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FIDAGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)IDAGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDAFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + IDAFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDASetJacTimesResFn(void *farg1, IDAResFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + result = (int)IDASetJacTimesResFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, IDABBDLocalFn farg8, IDABBDCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + IDABBDLocalFn arg8 = (IDABBDLocalFn) 0 ; + IDABBDCommFn arg9 = (IDABBDCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (IDABBDLocalFn)(farg8); + arg9 = (IDABBDCommFn)(farg9); + result = (int)IDABBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecReInit(void *farg1, int32_t const *farg2, int32_t const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)IDABBDPrecReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDABBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDABBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)IDASetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacFn(void *farg1, IDALsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsJacFn arg2 = (IDALsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsJacFn)(farg2); + result = (int)IDASetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetPreconditioner(void *farg1, IDALsPrecSetupFn farg2, IDALsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsPrecSetupFn arg2 = (IDALsPrecSetupFn) 0 ; + IDALsPrecSolveFn arg3 = (IDALsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsPrecSetupFn)(farg2); + arg3 = (IDALsPrecSolveFn)(farg3); + result = (int)IDASetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacTimes(void *farg1, IDALsJacTimesSetupFn farg2, IDALsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsJacTimesSetupFn arg2 = (IDALsJacTimesSetupFn) 0 ; + IDALsJacTimesVecFn arg3 = (IDALsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsJacTimesSetupFn)(farg2); + arg3 = (IDALsJacTimesVecFn)(farg3); + result = (int)IDASetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetIncrementFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetIncrementFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)IDAGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacCj(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetJacCj(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinResEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinResEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FIDAGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)IDAGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + + diff --git a/src/ida/fmod_int32/fida_mod.f90 b/src/ida/fmod_int32/fida_mod.f90 new file mode 100644 index 0000000000..735aa814cb --- /dev/null +++ b/src/ida/fmod_int32/fida_mod.f90 @@ -0,0 +1,2992 @@ +! 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-2024, 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 fida_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: IDA_NORMAL = 1_C_INT + integer(C_INT), parameter, public :: IDA_ONE_STEP = 2_C_INT + integer(C_INT), parameter, public :: IDA_YA_YDP_INIT = 1_C_INT + integer(C_INT), parameter, public :: IDA_Y_INIT = 2_C_INT + integer(C_INT), parameter, public :: IDA_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: IDA_TSTOP_RETURN = 1_C_INT + integer(C_INT), parameter, public :: IDA_ROOT_RETURN = 2_C_INT + integer(C_INT), parameter, public :: IDA_WARNING = 99_C_INT + integer(C_INT), parameter, public :: IDA_TOO_MUCH_WORK = -1_C_INT + integer(C_INT), parameter, public :: IDA_TOO_MUCH_ACC = -2_C_INT + integer(C_INT), parameter, public :: IDA_ERR_FAIL = -3_C_INT + integer(C_INT), parameter, public :: IDA_CONV_FAIL = -4_C_INT + integer(C_INT), parameter, public :: IDA_LINIT_FAIL = -5_C_INT + integer(C_INT), parameter, public :: IDA_LSETUP_FAIL = -6_C_INT + integer(C_INT), parameter, public :: IDA_LSOLVE_FAIL = -7_C_INT + integer(C_INT), parameter, public :: IDA_RES_FAIL = -8_C_INT + integer(C_INT), parameter, public :: IDA_REP_RES_ERR = -9_C_INT + integer(C_INT), parameter, public :: IDA_RTFUNC_FAIL = -10_C_INT + integer(C_INT), parameter, public :: IDA_CONSTR_FAIL = -11_C_INT + integer(C_INT), parameter, public :: IDA_FIRST_RES_FAIL = -12_C_INT + integer(C_INT), parameter, public :: IDA_LINESEARCH_FAIL = -13_C_INT + integer(C_INT), parameter, public :: IDA_NO_RECOVERY = -14_C_INT + integer(C_INT), parameter, public :: IDA_NLS_INIT_FAIL = -15_C_INT + integer(C_INT), parameter, public :: IDA_NLS_SETUP_FAIL = -16_C_INT + integer(C_INT), parameter, public :: IDA_NLS_FAIL = -17_C_INT + integer(C_INT), parameter, public :: IDA_MEM_NULL = -20_C_INT + integer(C_INT), parameter, public :: IDA_MEM_FAIL = -21_C_INT + integer(C_INT), parameter, public :: IDA_ILL_INPUT = -22_C_INT + integer(C_INT), parameter, public :: IDA_NO_MALLOC = -23_C_INT + integer(C_INT), parameter, public :: IDA_BAD_EWT = -24_C_INT + integer(C_INT), parameter, public :: IDA_BAD_K = -25_C_INT + integer(C_INT), parameter, public :: IDA_BAD_T = -26_C_INT + integer(C_INT), parameter, public :: IDA_BAD_DKY = -27_C_INT + integer(C_INT), parameter, public :: IDA_VECTOROP_ERR = -28_C_INT + integer(C_INT), parameter, public :: IDA_CONTEXT_ERR = -29_C_INT + integer(C_INT), parameter, public :: IDA_UNRECOGNIZED_ERROR = -99_C_INT + public :: FIDACreate + public :: FIDAInit + public :: FIDAReInit + public :: FIDASStolerances + public :: FIDASVtolerances + public :: FIDAWFtolerances + public :: FIDACalcIC + public :: FIDASetNonlinConvCoefIC + public :: FIDASetMaxNumStepsIC + public :: FIDASetMaxNumJacsIC + public :: FIDASetMaxNumItersIC + public :: FIDASetLineSearchOffIC + public :: FIDASetStepToleranceIC + public :: FIDASetMaxBacksIC + public :: FIDASetDeltaCjLSetup + public :: FIDASetUserData + public :: FIDASetMaxOrd + public :: FIDASetMaxNumSteps + public :: FIDASetInitStep + public :: FIDASetMaxStep + public :: FIDASetMinStep + public :: FIDASetStopTime + public :: FIDAClearStopTime + public :: FIDASetMaxErrTestFails + public :: FIDASetSuppressAlg + public :: FIDASetId + public :: FIDASetConstraints + public :: FIDASetEtaFixedStepBounds + public :: FIDASetEtaMin + public :: FIDASetEtaMax + public :: FIDASetEtaLow + public :: FIDASetEtaMinErrFail + public :: FIDASetEtaConvFail + public :: FIDASetMaxConvFails + public :: FIDASetMaxNonlinIters + public :: FIDASetNlsResFn + public :: FIDASetNonlinConvCoef + public :: FIDASetNonlinearSolver + public :: FIDARootInit + public :: FIDASetRootDirection + public :: FIDASetNoInactiveRootWarn + public :: FIDASolve + public :: FIDAComputeY + public :: FIDAComputeYp + public :: FIDAGetDky + public :: FIDAGetWorkSpace + public :: FIDAGetNumSteps + public :: FIDAGetNumResEvals + public :: FIDAGetNumLinSolvSetups + public :: FIDAGetNumErrTestFails + public :: FIDAGetNumBacktrackOps + public :: FIDAGetConsistentIC + public :: FIDAGetLastOrder + public :: FIDAGetCurrentOrder + public :: FIDAGetCurrentCj + public :: FIDAGetCurrentY + public :: FIDAGetCurrentYp + public :: FIDAGetActualInitStep + public :: FIDAGetLastStep + public :: FIDAGetCurrentStep + public :: FIDAGetCurrentTime + public :: FIDAGetTolScaleFactor + public :: FIDAGetErrWeights + public :: FIDAGetEstLocalErrors + public :: FIDAGetNumGEvals + public :: FIDAGetRootInfo + public :: FIDAGetIntegratorStats + public :: FIDAGetNonlinearSystemData + public :: FIDAGetNumNonlinSolvIters + public :: FIDAGetNumNonlinSolvConvFails + public :: FIDAGetNonlinSolvStats + public :: FIDAGetNumStepSolveFails + public :: FIDAGetUserData + public :: FIDAPrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FIDAGetReturnFlagName + public :: FIDAFree + public :: FIDASetJacTimesResFn + public :: FIDABBDPrecInit + public :: FIDABBDPrecReInit + public :: FIDABBDPrecGetWorkSpace + public :: FIDABBDPrecGetNumGfnEvals + integer(C_INT), parameter, public :: IDALS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: IDALS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: IDALS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: IDALS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: IDALS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: IDALS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: IDALS_JACFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: IDALS_JACFUNC_RECVR = -7_C_INT + integer(C_INT), parameter, public :: IDALS_SUNMAT_FAIL = -8_C_INT + integer(C_INT), parameter, public :: IDALS_SUNLS_FAIL = -9_C_INT + public :: FIDASetLinearSolver + public :: FIDASetJacFn + public :: FIDASetPreconditioner + public :: FIDASetJacTimes + public :: FIDASetEpsLin + public :: FIDASetLSNormFactor + public :: FIDASetLinearSolutionScaling + public :: FIDASetIncrementFactor + public :: FIDAGetJac + public :: FIDAGetJacCj + public :: FIDAGetJacTime + public :: FIDAGetJacNumSteps + public :: FIDAGetLinWorkSpace + public :: FIDAGetNumJacEvals + public :: FIDAGetNumPrecEvals + public :: FIDAGetNumPrecSolves + public :: FIDAGetNumLinIters + public :: FIDAGetNumLinConvFails + public :: FIDAGetNumJTSetupEvals + public :: FIDAGetNumJtimesEvals + public :: FIDAGetNumLinResEvals + public :: FIDAGetLastLinFlag + public :: FIDAGetLinReturnFlagName + +! WRAPPER DECLARATIONS +interface +function swigc_FIDACreate(farg1) & +bind(C, name="_wrap_FIDACreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FIDAInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASStolerances") & +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_FIDASVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FIDAWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDACalcIC(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDACalcIC") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinConvCoefIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinConvCoefIC") & +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_FIDASetMaxNumStepsIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumStepsIC") & +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_FIDASetMaxNumJacsIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumJacsIC") & +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_FIDASetMaxNumItersIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumItersIC") & +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_FIDASetLineSearchOffIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetLineSearchOffIC") & +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_FIDASetStepToleranceIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetStepToleranceIC") & +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_FIDASetMaxBacksIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxBacksIC") & +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_FIDASetDeltaCjLSetup(farg1, farg2) & +bind(C, name="_wrap_FIDASetDeltaCjLSetup") & +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_FIDASetUserData(farg1, farg2) & +bind(C, name="_wrap_FIDASetUserData") & +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_FIDASetMaxOrd(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxOrd") & +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_FIDASetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetInitStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetInitStep") & +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_FIDASetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxStep") & +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_FIDASetMinStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetMinStep") & +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_FIDASetStopTime(farg1, farg2) & +bind(C, name="_wrap_FIDASetStopTime") & +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_FIDAClearStopTime(farg1) & +bind(C, name="_wrap_FIDAClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxErrTestFails") & +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_FIDASetSuppressAlg(farg1, farg2) & +bind(C, name="_wrap_FIDASetSuppressAlg") & +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_FIDASetId(farg1, farg2) & +bind(C, name="_wrap_FIDASetId") & +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_FIDASetConstraints(farg1, farg2) & +bind(C, name="_wrap_FIDASetConstraints") & +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_FIDASetEtaFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetEtaFixedStepBounds") & +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_FIDASetEtaMin(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMin") & +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_FIDASetEtaMax(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMax") & +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_FIDASetEtaLow(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaLow") & +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_FIDASetEtaMinErrFail(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMinErrFail") & +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_FIDASetEtaConvFail(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaConvFail") & +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_FIDASetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxConvFails") & +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_FIDASetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNonlinIters") & +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_FIDASetNlsResFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetNlsResFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinConvCoef") & +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_FIDASetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinearSolver") & +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_FIDARootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDARootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FIDASetRootDirection") & +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_FIDASetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FIDASetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASolve(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FIDASolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT), intent(in) :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FIDAComputeY(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeY") & +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_FIDAComputeYp(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeYp") & +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_FIDAGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetWorkSpace") & +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_FIDAGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumSteps") & +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_FIDAGetNumResEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumResEvals") & +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_FIDAGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinSolvSetups") & +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_FIDAGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumErrTestFails") & +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_FIDAGetNumBacktrackOps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumBacktrackOps") & +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_FIDAGetConsistentIC(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetConsistentIC") & +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_FIDAGetLastOrder(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastOrder") & +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_FIDAGetCurrentOrder(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentOrder") & +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_FIDAGetCurrentCj(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentCj") & +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_FIDAGetCurrentY(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentY") & +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_FIDAGetCurrentYp(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentYp") & +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_FIDAGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetActualInitStep") & +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_FIDAGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastStep") & +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_FIDAGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentStep") & +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_FIDAGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentTime") & +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_FIDAGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FIDAGetTolScaleFactor") & +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_FIDAGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FIDAGetErrWeights") & +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_FIDAGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FIDAGetEstLocalErrors") & +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_FIDAGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumGEvals") & +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_FIDAGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FIDAGetRootInfo") & +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_FIDAGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) & +bind(C, name="_wrap_FIDAGetIntegratorStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +type(C_PTR), value :: farg10 +type(C_PTR), value :: farg11 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FIDAGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumNonlinSolvIters") & +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_FIDAGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumNonlinSolvConvFails") & +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_FIDAGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetNonlinSolvStats") & +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_FIDAGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumStepSolveFails") & +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_FIDAGetUserData(farg1, farg2) & +bind(C, name="_wrap_FIDAGetUserData") & +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_FIDAPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FIDAGetReturnFlagName(farg1) & +bind(C, name="_wrap_FIDAGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FIDAFree(farg1) & +bind(C, name="_wrap_FIDAFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDASetJacTimesResFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetJacTimesResFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FIDABBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDABBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDABBDPrecGetWorkSpace") & +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_FIDABBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FIDABBDPrecGetNumGfnEvals") & +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_FIDASetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetLinearSolver") & +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_FIDASetJacFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FIDASetEpsLin") & +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_FIDASetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FIDASetLSNormFactor") & +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_FIDASetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FIDASetLinearSolutionScaling") & +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_FIDASetIncrementFactor(farg1, farg2) & +bind(C, name="_wrap_FIDASetIncrementFactor") & +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_FIDAGetJac(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJac") & +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_FIDAGetJacCj(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacCj") & +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_FIDAGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacTime") & +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_FIDAGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacNumSteps") & +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_FIDAGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetLinWorkSpace") & +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_FIDAGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJacEvals") & +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_FIDAGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumPrecEvals") & +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_FIDAGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumPrecSolves") & +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_FIDAGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinIters") & +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_FIDAGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinConvFails") & +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_FIDAGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJTSetupEvals") & +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_FIDAGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJtimesEvals") & +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_FIDAGetNumLinResEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinResEvals") & +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_FIDAGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastLinFlag") & +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_FIDAGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FIDAGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FIDACreate(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FIDACreate(farg1) +swig_result = fresult +end function + +function FIDAInit(ida_mem, res, t0, yy0, yp0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: res +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = res +farg3 = t0 +farg4 = c_loc(yy0) +farg5 = c_loc(yp0) +fresult = swigc_FIDAInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAReInit(ida_mem, t0, yy0, yp0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t0 +farg3 = c_loc(yy0) +farg4 = c_loc(yp0) +fresult = swigc_FIDAReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASStolerances(ida_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FIDASStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASVtolerances(ida_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FIDASVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAWFtolerances(ida_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = efun +fresult = swigc_FIDAWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FIDACalcIC(ida_mem, icopt, tout1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: icopt +real(C_DOUBLE), intent(in) :: tout1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = icopt +farg3 = tout1 +fresult = swigc_FIDACalcIC(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetNonlinConvCoefIC(ida_mem, epiccon) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: epiccon +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = epiccon +fresult = swigc_FIDASetNonlinConvCoefIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumStepsIC(ida_mem, maxnh) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnh +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnh +fresult = swigc_FIDASetMaxNumStepsIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumJacsIC(ida_mem, maxnj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnj +fresult = swigc_FIDASetMaxNumJacsIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumItersIC(ida_mem, maxnit) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnit +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnit +fresult = swigc_FIDASetMaxNumItersIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLineSearchOffIC(ida_mem, lsoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: lsoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = lsoff +fresult = swigc_FIDASetLineSearchOffIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetStepToleranceIC(ida_mem, steptol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: steptol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = steptol +fresult = swigc_FIDASetStepToleranceIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxBacksIC(ida_mem, maxbacks) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxbacks +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxbacks +fresult = swigc_FIDASetMaxBacksIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetDeltaCjLSetup(ida_max, dcj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_max +real(C_DOUBLE), intent(in) :: dcj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_max +farg2 = dcj +fresult = swigc_FIDASetDeltaCjLSetup(farg1, farg2) +swig_result = fresult +end function + +function FIDASetUserData(ida_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = user_data +fresult = swigc_FIDASetUserData(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxOrd(ida_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxord +fresult = swigc_FIDASetMaxOrd(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumSteps(ida_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = ida_mem +farg2 = mxsteps +fresult = swigc_FIDASetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDASetInitStep(ida_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hin +fresult = swigc_FIDASetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxStep(ida_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hmax +fresult = swigc_FIDASetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMinStep(ida_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hmin +fresult = swigc_FIDASetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetStopTime(ida_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = tstop +fresult = swigc_FIDASetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAClearStopTime(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDAClearStopTime(farg1) +swig_result = fresult +end function + +function FIDASetMaxErrTestFails(ida_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnef +fresult = swigc_FIDASetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDASetSuppressAlg(ida_mem, suppressalg) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: suppressalg +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = suppressalg +fresult = swigc_FIDASetSuppressAlg(farg1, farg2) +swig_result = fresult +end function + +function FIDASetId(ida_mem, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: id +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(id) +fresult = swigc_FIDASetId(farg1, farg2) +swig_result = fresult +end function + +function FIDASetConstraints(ida_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(constraints) +fresult = swigc_FIDASetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaFixedStepBounds(ida_mem, eta_min_fx, eta_max_fx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min_fx +real(C_DOUBLE), intent(in) :: eta_max_fx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = eta_min_fx +farg3 = eta_max_fx +fresult = swigc_FIDASetEtaFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetEtaMin(ida_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_min +fresult = swigc_FIDASetEtaMin(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaMax(ida_mem, eta_max) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_max +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_max +fresult = swigc_FIDASetEtaMax(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaLow(ida_mem, eta_low) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_low +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_low +fresult = swigc_FIDASetEtaLow(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaMinErrFail(ida_mem, eta_min_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_min_ef +fresult = swigc_FIDASetEtaMinErrFail(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaConvFail(ida_mem, eta_cf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_cf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_cf +fresult = swigc_FIDASetEtaConvFail(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxConvFails(ida_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxncf +fresult = swigc_FIDASetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNonlinIters(ida_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxcor +fresult = swigc_FIDASetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNlsResFn(ida_mem, res) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: res +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = res +fresult = swigc_FIDASetNlsResFn(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNonlinConvCoef(ida_mem, epcon) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: epcon +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = epcon +fresult = swigc_FIDASetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNonlinearSolver(ida_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nls) +fresult = swigc_FIDASetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FIDARootInit(ida_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FIDARootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetRootDirection(ida_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FIDASetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNoInactiveRootWarn(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDASetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FIDASolve(ida_mem, tout, tret, yret, ypret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: yret +type(N_Vector), target, intent(inout) :: ypret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +integer(C_INT) :: farg6 + +farg1 = ida_mem +farg2 = tout +farg3 = c_loc(tret(1)) +farg4 = c_loc(yret) +farg5 = c_loc(ypret) +farg6 = itask +fresult = swigc_FIDASolve(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FIDAComputeY(ida_mem, ycor, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ycor) +farg3 = c_loc(y) +fresult = swigc_FIDAComputeY(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAComputeYp(ida_mem, ycor, yp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: yp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ycor) +farg3 = c_loc(yp) +fresult = swigc_FIDAComputeYp(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetDky(ida_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FIDAGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetWorkSpace(ida_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +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 = ida_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FIDAGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumSteps(ida_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FIDAGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumResEvals(ida_mem, nrevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrevals(1)) +fresult = swigc_FIDAGetNumResEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinSolvSetups(ida_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FIDAGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumErrTestFails(ida_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FIDAGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumBacktrackOps(ida_mem, nbacktr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nbacktr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nbacktr(1)) +fresult = swigc_FIDAGetNumBacktrackOps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: yy0_mod +type(N_Vector), target, intent(inout) :: yp0_mod +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(yy0_mod) +farg3 = c_loc(yp0_mod) +fresult = swigc_FIDAGetConsistentIC(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetLastOrder(ida_mem, klast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: klast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(klast(1)) +fresult = swigc_FIDAGetLastOrder(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentOrder(ida_mem, kcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: kcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(kcur(1)) +fresult = swigc_FIDAGetCurrentOrder(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentCj(ida_mem, cj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(cj(1)) +fresult = swigc_FIDAGetCurrentCj(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentY(ida_mem, ycur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ycur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = ycur +fresult = swigc_FIDAGetCurrentY(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentYp(ida_mem, ypcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ypcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = ypcur +fresult = swigc_FIDAGetCurrentYp(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetActualInitStep(ida_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FIDAGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLastStep(ida_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FIDAGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentStep(ida_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FIDAGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentTime(ida_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FIDAGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetTolScaleFactor(ida_mem, tolsfact) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfact +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(tolsfact(1)) +fresult = swigc_FIDAGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetErrWeights(ida_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(eweight) +fresult = swigc_FIDAGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetEstLocalErrors(ida_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ele) +fresult = swigc_FIDAGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumGEvals(ida_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FIDAGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetRootInfo(ida_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FIDAGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_LONG), dimension(*), target, intent(inout) :: nrevals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT), dimension(*), target, intent(inout) :: qcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 +type(C_PTR) :: farg10 +type(C_PTR) :: farg11 + +farg1 = ida_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(nrevals(1)) +farg4 = c_loc(nlinsetups(1)) +farg5 = c_loc(netfails(1)) +farg6 = c_loc(qlast(1)) +farg7 = c_loc(qcur(1)) +farg8 = c_loc(hinused(1)) +farg9 = c_loc(hlast(1)) +farg10 = c_loc(hcur(1)) +farg11 = c_loc(tcur(1)) +fresult = swigc_FIDAGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) +swig_result = fresult +end function + +function FIDAGetNonlinearSystemData(ida_mem, tcur, yypred, yppred, yyn, ypn, res, cj, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: yypred +type(C_PTR) :: yppred +type(C_PTR) :: yyn +type(C_PTR) :: ypn +type(C_PTR) :: res +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = ida_mem +farg2 = c_loc(tcur(1)) +farg3 = yypred +farg4 = yppred +farg5 = yyn +farg6 = ypn +farg7 = res +farg8 = c_loc(cj(1)) +farg9 = c_loc(user_data) +fresult = swigc_FIDAGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FIDAGetNumNonlinSolvIters(ida_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FIDAGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumNonlinSolvConvFails(ida_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FIDAGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNonlinSolvStats(ida_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FIDAGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumStepSolveFails(ida_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FIDAGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetUserData(ida_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(user_data) +fresult = swigc_FIDAGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FIDAPrintAllStats(ida_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FIDAPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FIDAGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FIDAGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FIDAFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(ida_mem) +call swigc_FIDAFree(farg1) +end subroutine + +function FIDASetJacTimesResFn(ida_mem, jtimesresfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jtimesresfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = jtimesresfn +fresult = swigc_FIDASetJacTimesResFn(farg1, farg2) +swig_result = fresult +end function + +function FIDABBDPrecInit(ida_mem, nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, gres, gcomm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dq_rel_yy +type(C_FUNPTR), intent(in), value :: gres +type(C_FUNPTR), intent(in), value :: gcomm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = ida_mem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dq_rel_yy +farg8 = gres +farg9 = gcomm +fresult = swigc_FIDABBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FIDABBDPrecReInit(ida_mem, mudq, mldq, dq_rel_yy) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dq_rel_yy +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = ida_mem +farg2 = mudq +farg3 = mldq +farg4 = dq_rel_yy +fresult = swigc_FIDABBDPrecReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDABBDPrecGetWorkSpace(ida_mem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FIDABBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDABBDPrecGetNumGfnEvals(ida_mem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FIDABBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLinearSolver(ida_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FIDASetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetJacFn(ida_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = jac +fresult = swigc_FIDASetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FIDASetPreconditioner(ida_mem, pset, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = pset +farg3 = psolve +fresult = swigc_FIDASetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetJacTimes(ida_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FIDASetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetEpsLin(ida_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eplifac +fresult = swigc_FIDASetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLSNormFactor(ida_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = nrmfac +fresult = swigc_FIDASetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLinearSolutionScaling(ida_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = onoff +fresult = swigc_FIDASetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FIDASetIncrementFactor(ida_mem, dqincfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: dqincfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = dqincfac +fresult = swigc_FIDASetIncrementFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJac(ida_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(j) +fresult = swigc_FIDAGetJac(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacCj(ida_mem, cj_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(cj_j(1)) +fresult = swigc_FIDAGetJacCj(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacTime(ida_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FIDAGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacNumSteps(ida_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FIDAGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLinWorkSpace(ida_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FIDAGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumJacEvals(ida_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FIDAGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumPrecEvals(ida_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FIDAGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumPrecSolves(ida_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FIDAGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinIters(ida_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FIDAGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinConvFails(ida_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FIDAGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumJTSetupEvals(ida_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FIDAGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumJtimesEvals(ida_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FIDAGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinResEvals(ida_mem, nrevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrevalsls(1)) +fresult = swigc_FIDAGetNumLinResEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLastLinFlag(ida_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FIDAGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FIDAGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + + +end module diff --git a/src/ida/fmod_int64/CMakeLists.txt b/src/ida/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..e305f237d0 --- /dev/null +++ b/src/ida/fmod_int64/CMakeLists.txt @@ -0,0 +1,47 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 IDA object library +# --------------------------------------------------------------- + +set(ida_SOURCES fida_mod.f90 fida_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_fida_mod + SOURCES + ${ida_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + sundials_fsunnonlinsolnewton_mod_obj + sundials_fsunnonlinsolfixedpoint_mod_obj + OUTPUT_NAME + sundials_fida_mod + VERSION + ${idalib_VERSION} + SOVERSION + ${idalib_SOVERSION} +) + +message(STATUS "Added IDA F2003 interface") diff --git a/src/ida/fmod/fida_mod.c b/src/ida/fmod_int64/fida_mod.c similarity index 100% rename from src/ida/fmod/fida_mod.c rename to src/ida/fmod_int64/fida_mod.c diff --git a/src/ida/fmod/fida_mod.f90 b/src/ida/fmod_int64/fida_mod.f90 similarity index 100% rename from src/ida/fmod/fida_mod.f90 rename to src/ida/fmod_int64/fida_mod.f90 diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index f54b9fa8da..a5ed8b4739 100644 --- a/src/idas/CMakeLists.txt +++ b/src/idas/CMakeLists.txt @@ -79,5 +79,5 @@ message(STATUS "Added IDAS module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/idas/fmod/CMakeLists.txt b/src/idas/fmod_int32/CMakeLists.txt similarity index 100% rename from src/idas/fmod/CMakeLists.txt rename to src/idas/fmod_int32/CMakeLists.txt diff --git a/src/idas/fmod_int32/fidas_mod.c b/src/idas/fmod_int32/fidas_mod.c new file mode 100644 index 0000000000..4774bf709e --- /dev/null +++ b/src/idas/fmod_int32/fidas_mod.c @@ -0,0 +1,3879 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "idas/idas.h" +#include "idas/idas_bbdpre.h" +#include "idas/idas_ls.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT void * _wrap_FIDACreate(void *farg1) { + void * fresult ; + SUNContext arg1 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNContext)(farg1); + result = (void *)IDACreate(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAInit(void *farg1, IDAResFn farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAReInit(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDASVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAWFtolerances(void *farg1, IDAEwtFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAEwtFn arg2 = (IDAEwtFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAEwtFn)(farg2); + result = (int)IDAWFtolerances(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDACalcIC(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDACalcIC(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinConvCoefIC(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetNonlinConvCoefIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumStepsIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumStepsIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumJacsIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumJacsIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumItersIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNumItersIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLineSearchOffIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetLineSearchOffIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetStepToleranceIC(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetStepToleranceIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxBacksIC(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxBacksIC(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetDeltaCjLSetup(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetDeltaCjLSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)IDASetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxOrd(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxOrd(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumSteps(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)IDASetMaxNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetInitStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetMaxStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMinStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetMinStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetStopTime(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetStopTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAClearStopTime(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDAClearStopTime(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxErrTestFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSuppressAlg(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetSuppressAlg(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetId(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDASetId(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDASetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaFixedStepBounds(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetEtaFixedStepBounds(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMax(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMax(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaLow(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaLow(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaMinErrFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaMinErrFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEtaConvFail(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEtaConvFail(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxConvFails(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNlsResFn(void *farg1, IDAResFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + result = (int)IDASetNlsResFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinConvCoef(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetNonlinConvCoef(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinearSolver(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)IDASetNonlinearSolver(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDARootInit(void *farg1, int const *farg2, IDARootFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDARootFn arg3 = (IDARootFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDARootFn)(farg3); + result = (int)IDARootInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetRootDirection(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDASetRootDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNoInactiveRootWarn(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDASetNoInactiveRootWarn(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASolve(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int arg6 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + arg6 = (int)(*farg6); + result = (int)IDASolve(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeY(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAComputeY(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeYp(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAComputeYp(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeYSens(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAComputeYSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAComputeYpSens(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAComputeYpSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumResEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumResEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumBacktrackOps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumBacktrackOps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetConsistentIC(void *farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAGetConsistentIC(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetLastOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentOrder(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetCurrentOrder(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentCj(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentCj(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentY(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAGetCurrentY(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentYSens(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector **arg2 = (N_Vector **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector **)(farg2); + result = (int)IDAGetCurrentYSens(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentYp(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAGetCurrentYp(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentYpSens(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector **arg2 = (N_Vector **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector **)(farg2); + result = (int)IDAGetCurrentYpSens(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetActualInitStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetActualInitStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetLastStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentStep(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetCurrentTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetCurrentTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetTolScaleFactor(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetTolScaleFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAGetErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetEstLocalErrors(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAGetEstLocalErrors(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumGEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumGEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetRootInfo(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDAGetRootInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetIntegratorStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5, int *farg6, int *farg7, double *farg8, double *farg9, double *farg10, double *farg11) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int *arg6 = (int *) 0 ; + int *arg7 = (int *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + sunrealtype *arg9 = (sunrealtype *) 0 ; + sunrealtype *arg10 = (sunrealtype *) 0 ; + sunrealtype *arg11 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + arg6 = (int *)(farg6); + arg7 = (int *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (sunrealtype *)(farg9); + arg10 = (sunrealtype *)(farg10); + arg11 = (sunrealtype *)(farg11); + result = (int)IDAGetIntegratorStats(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNonlinearSystemData(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, void *farg7, double *farg8, void *farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + void **arg9 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + arg7 = (N_Vector *)(farg7); + arg8 = (sunrealtype *)(farg8); + arg9 = (void **)(farg9); + result = (int)IDAGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNonlinearSystemDataSens(void *farg1, double *farg2, void *farg3, void *farg4, void *farg5, void *farg6, double *farg7, void *farg8) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector **arg3 = (N_Vector **) 0 ; + N_Vector **arg4 = (N_Vector **) 0 ; + N_Vector **arg5 = (N_Vector **) 0 ; + N_Vector **arg6 = (N_Vector **) 0 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + void **arg8 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector **)(farg3); + arg4 = (N_Vector **)(farg4); + arg5 = (N_Vector **)(farg5); + arg6 = (N_Vector **)(farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (void **)(farg8); + result = (int)IDAGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumStepSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumStepSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)IDAGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)IDAPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FIDAGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)IDAGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDAFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + IDAFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDASetJacTimesResFn(void *farg1, IDAResFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAResFn arg2 = (IDAResFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAResFn)(farg2); + result = (int)IDASetJacTimesResFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadInit(void *farg1, IDAQuadRhsFn farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAQuadRhsFn arg2 = (IDAQuadRhsFn) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAQuadRhsFn)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAQuadInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadReInit(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAQuadReInit(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSStolerances(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDAQuadSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSVtolerances(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAQuadSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetQuadErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetQuadErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuad(void *farg1, double *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAGetQuad(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadDky(void *farg1, double const *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetQuadDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetQuadNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetQuadNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadErrWeights(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)IDAGetQuadErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetQuadStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDAQuadFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + IDAQuadFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDASensInit(void *farg1, int const *farg2, int const *farg3, IDASensResFn farg4, void *farg5, void *farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + IDASensResFn arg4 = (IDASensResFn) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (IDASensResFn)(farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (int)IDASensInit(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASensReInit(void *farg1, int const *farg2, void *farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (int)IDASensReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASensSStolerances(void *farg1, double const *farg2, double *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + result = (int)IDASensSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASensSVtolerances(void *farg1, double const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDASensSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASensEEtolerances(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDASensEEtolerances(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensConsistentIC(void *farg1, void *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAGetSensConsistentIC(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSensDQMethod(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetSensDQMethod(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSensErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetSensErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSensMaxNonlinIters(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetSensMaxNonlinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int *arg4 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (int *)(farg4); + result = (int)IDASetSensParams(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinearSolverSensSim(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)IDASetNonlinearSolverSensSim(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinearSolverSensStg(void *farg1, SUNNonlinearSolver farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNNonlinearSolver arg2 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNNonlinearSolver)(farg2); + result = (int)IDASetNonlinearSolverSensStg(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASensToggleOff(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDASensToggleOff(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSens(void *farg1, double *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAGetSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetSens1(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector *)(farg4); + result = (int)IDAGetSensDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAGetSensDky1(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNumResEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetSensNumResEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumResEvalsSens(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumResEvalsSens(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetSensNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNumLinSolvSetups(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetSensNumLinSolvSetups(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensErrWeights(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector_S arg2 = (N_Vector_S) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector_S)(farg2); + result = (int)IDAGetSensErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensStats(void *farg1, long *farg2, long *farg3, long *farg4, long *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + long *arg4 = (long *) 0 ; + long *arg5 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + arg4 = (long *)(farg4); + arg5 = (long *)(farg5); + result = (int)IDAGetSensStats(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetSensNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNumNonlinSolvConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetSensNumNonlinSolvConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetSensNonlinSolvStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetSensNonlinSolvStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumStepSensSolveFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumStepSensSolveFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDASensFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + IDASensFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDAQuadSensInit(void *farg1, IDAQuadSensRhsFn farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAQuadSensRhsFn arg2 = (IDAQuadSensRhsFn) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDAQuadSensRhsFn)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAQuadSensInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSensReInit(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAQuadSensReInit(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSensSStolerances(void *farg1, double const *farg2, double *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + result = (int)IDAQuadSensSStolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSensSVtolerances(void *farg1, double const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAQuadSensSVtolerances(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSensEEtolerances(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDAQuadSensEEtolerances(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetQuadSensErrCon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetQuadSensErrCon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSens(void *farg1, double *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + result = (int)IDAGetQuadSens(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSens1(void *farg1, double *farg2, int const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetQuadSens1(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensDky(void *farg1, double const *farg2, int const *farg3, void *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector *)(farg4); + result = (int)IDAGetQuadSensDky(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensDky1(void *farg1, double const *farg2, int const *farg3, int const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAGetQuadSensDky1(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetQuadSensNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensNumErrTestFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetQuadSensNumErrTestFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensErrWeights(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector *arg2 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector *)(farg2); + result = (int)IDAGetQuadSensErrWeights(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadSensStats(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetQuadSensStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDAQuadSensFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + IDAQuadSensFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDAAdjInit(void *farg1, long const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDAAdjInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAAdjReInit(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDAAdjReInit(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FIDAAdjFree(void *farg1) { + void *arg1 = (void *) 0 ; + + arg1 = (void *)(farg1); + IDAAdjFree(arg1); +} + + +SWIGEXPORT int _wrap_FIDACreateB(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)IDACreateB(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAInitB(void *farg1, int const *farg2, IDAResFnB farg3, double const *farg4, N_Vector farg5, N_Vector farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDAResFnB arg3 = (IDAResFnB) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + N_Vector arg6 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDAResFnB)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + arg6 = (N_Vector)(farg6); + result = (int)IDAInitB(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAInitBS(void *farg1, int const *farg2, IDAResFnBS farg3, double const *farg4, N_Vector farg5, N_Vector farg6) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDAResFnBS arg3 = (IDAResFnBS) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + N_Vector arg6 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDAResFnBS)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + arg6 = (N_Vector)(farg6); + result = (int)IDAInitBS(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAReInitB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAReInitB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASStolerancesB(void *farg1, int const *farg2, double const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)IDASStolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASVtolerancesB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDASVtolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadInitB(void *farg1, int const *farg2, IDAQuadRhsFnB farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDAQuadRhsFnB arg3 = (IDAQuadRhsFnB) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDAQuadRhsFnB)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAQuadInitB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadInitBS(void *farg1, int const *farg2, IDAQuadRhsFnBS farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDAQuadRhsFnBS arg3 = (IDAQuadRhsFnBS) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDAQuadRhsFnBS)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAQuadInitBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadReInitB(void *farg1, int const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDAQuadReInitB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSStolerancesB(void *farg1, int const *farg2, double const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)IDAQuadSStolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAQuadSVtolerancesB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAQuadSVtolerancesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDACalcICB(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDACalcICB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, N_Vector farg5, void *farg6, void *farg7) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + arg6 = (N_Vector *)(farg6); + arg7 = (N_Vector *)(farg7); + result = (int)IDACalcICBS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASolveF(void *farg1, double const *farg2, double *farg3, N_Vector farg4, N_Vector farg5, int const *farg6, int *farg7) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int arg6 ; + int *arg7 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + arg6 = (int)(*farg6); + arg7 = (int *)(farg7); + result = (int)IDASolveF(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASolveB(void *farg1, double const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDASolveB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAAdjSetNoSensi(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)IDAAdjSetNoSensi(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void *)(farg3); + result = (int)IDASetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxOrdB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDASetMaxOrdB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxNumStepsB(void *farg1, int const *farg2, long const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long)(*farg3); + result = (int)IDASetMaxNumStepsB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetInitStepB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetInitStepB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetMaxStepB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetMaxStepB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetSuppressAlgB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDASetSuppressAlgB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetIdB(void *farg1, int const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDASetIdB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetConstraintsB(void *farg1, int const *farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + result = (int)IDASetConstraintsB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetQuadErrConB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDASetQuadErrConB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetNonlinearSolverB(void *farg1, int const *farg2, SUNNonlinearSolver farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + SUNNonlinearSolver arg3 = (SUNNonlinearSolver) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (SUNNonlinearSolver)(farg3); + result = (int)IDASetNonlinearSolverB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetB(void *farg1, int const *farg2, double *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAGetB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetQuadB(void *farg1, int const *farg2, double *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetQuadB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FIDAGetAdjIDABmem(void *farg1, int const *farg2) { + void * fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void *result = 0 ; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (void *)IDAGetAdjIDABmem(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetConsistentICB(void *farg1, int const *farg2, N_Vector farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetConsistentICB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetAdjY(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + result = (int)IDAGetAdjY(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_my_addr_set(SwigClassWrapper const *farg1, void *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + void *arg2 = (void *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::my_addr", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (void *)(farg2); + if (arg1) (arg1)->my_addr = arg2; +} + + +SWIGEXPORT void * _wrap_IDAadjCheckPointRec_my_addr_get(SwigClassWrapper const *farg1) { + void * fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + void *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::my_addr", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (void *) ((arg1)->my_addr); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_next_addr_set(SwigClassWrapper const *farg1, void *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + void *arg2 = (void *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::next_addr", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (void *)(farg2); + if (arg1) (arg1)->next_addr = arg2; +} + + +SWIGEXPORT void * _wrap_IDAadjCheckPointRec_next_addr_get(SwigClassWrapper const *farg1) { + void * fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + void *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::next_addr", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (void *) ((arg1)->next_addr); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_t0_set(SwigClassWrapper const *farg1, double const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t0", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->t0 = arg2; +} + + +SWIGEXPORT double _wrap_IDAadjCheckPointRec_t0_get(SwigClassWrapper const *farg1) { + double fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t0", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->t0); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_t1_set(SwigClassWrapper const *farg1, double const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t1", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->t1 = arg2; +} + + +SWIGEXPORT double _wrap_IDAadjCheckPointRec_t1_get(SwigClassWrapper const *farg1) { + double fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::t1", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->t1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_nstep_set(SwigClassWrapper const *farg1, long const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + long arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::nstep", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (long)(*farg2); + if (arg1) (arg1)->nstep = arg2; +} + + +SWIGEXPORT long _wrap_IDAadjCheckPointRec_nstep_get(SwigClassWrapper const *farg1) { + long fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + long result; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::nstep", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (long) ((arg1)->nstep); + fresult = (long)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_order_set(SwigClassWrapper const *farg1, int const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::order", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->order = arg2; +} + + +SWIGEXPORT int _wrap_IDAadjCheckPointRec_order_get(SwigClassWrapper const *farg1) { + int fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::order", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (int) ((arg1)->order); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_step_set(SwigClassWrapper const *farg1, double const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::step", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->step = arg2; +} + + +SWIGEXPORT double _wrap_IDAadjCheckPointRec_step_get(SwigClassWrapper const *farg1) { + double fresult ; + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::step", return 0); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + result = (sunrealtype) ((arg1)->step); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_IDAadjCheckPointRec() { + SwigClassWrapper fresult ; + IDAadjCheckPointRec *result = 0 ; + + result = (IDAadjCheckPointRec *)calloc(1, sizeof(IDAadjCheckPointRec)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_IDAadjCheckPointRec(SwigClassWrapper *farg1) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + + SWIG_check_mutable(*farg1, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAadjCheckPointRec::~IDAadjCheckPointRec()", return ); + arg1 = (IDAadjCheckPointRec *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_IDAadjCheckPointRec_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + IDAadjCheckPointRec *arg1 = (IDAadjCheckPointRec *) 0 ; + IDAadjCheckPointRec *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT int _wrap_FIDAGetAdjCheckPointsInfo(void *farg1, SwigClassWrapper const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDAadjCheckPointRec *arg2 = (IDAadjCheckPointRec *) 0 ; + int result; + + arg1 = (void *)(farg1); + SWIG_check_mutable(*farg2, "IDAadjCheckPointRec *", "IDAadjCheckPointRec", "IDAGetAdjCheckPointsInfo(void *,IDAadjCheckPointRec *)", return 0); + arg2 = (IDAadjCheckPointRec *)(farg2->cptr); + result = (int)IDAGetAdjCheckPointsInfo(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacTimesResFnB(void *farg1, int const *farg2, IDAResFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDAResFn arg3 = (IDAResFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDAResFn)(farg3); + result = (int)IDASetJacTimesResFnB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetAdjDataPointHermite(void *farg1, int const *farg2, double *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAGetAdjDataPointHermite(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetAdjDataPointPolynomial(void *farg1, int const *farg2, double *farg3, int *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int *arg4 = (int *) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (int *)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)IDAGetAdjDataPointPolynomial(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetAdjCurrentCheckPoint(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)IDAGetAdjCurrentCheckPoint(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, IDABBDLocalFn farg8, IDABBDCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + IDABBDLocalFn arg8 = (IDABBDLocalFn) 0 ; + IDABBDCommFn arg9 = (IDABBDCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (IDABBDLocalFn)(farg8); + arg9 = (IDABBDCommFn)(farg9); + result = (int)IDABBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecReInit(void *farg1, int32_t const *farg2, int32_t const *farg3, double const *farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype arg4 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (int)IDABBDPrecReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDABBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDABBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecInitB(void *farg1, int const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, int32_t const *farg7, double const *farg8, IDABBDLocalFnB farg9, IDABBDCommFnB farg10) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunindextype arg7 ; + sunrealtype arg8 ; + IDABBDLocalFnB arg9 = (IDABBDLocalFnB) 0 ; + IDABBDCommFnB arg10 = (IDABBDCommFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunindextype)(*farg7); + arg8 = (sunrealtype)(*farg8); + arg9 = (IDABBDLocalFnB)(farg9); + arg10 = (IDABBDCommFnB)(farg10); + result = (int)IDABBDPrecInitB(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDABBDPrecReInitB(void *farg1, int const *farg2, int32_t const *farg3, int32_t const *farg4, double const *farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunrealtype arg5 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)IDABBDPrecReInitB(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)IDASetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacFn(void *farg1, IDALsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsJacFn arg2 = (IDALsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsJacFn)(farg2); + result = (int)IDASetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetPreconditioner(void *farg1, IDALsPrecSetupFn farg2, IDALsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsPrecSetupFn arg2 = (IDALsPrecSetupFn) 0 ; + IDALsPrecSolveFn arg3 = (IDALsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsPrecSetupFn)(farg2); + arg3 = (IDALsPrecSolveFn)(farg3); + result = (int)IDASetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacTimes(void *farg1, IDALsJacTimesSetupFn farg2, IDALsJacTimesVecFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + IDALsJacTimesSetupFn arg2 = (IDALsJacTimesSetupFn) 0 ; + IDALsJacTimesVecFn arg3 = (IDALsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (IDALsJacTimesSetupFn)(farg2); + arg3 = (IDALsJacTimesVecFn)(farg3); + result = (int)IDASetJacTimes(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEpsLin(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetEpsLin(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLSNormFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetLSNormFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolutionScaling(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)IDASetLinearSolutionScaling(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetIncrementFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)IDASetIncrementFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)IDAGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacCj(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetJacCj(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacTime(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)IDAGetJacTime(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetJacNumSteps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetJacNumSteps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)IDAGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJTSetupEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJTSetupEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetNumLinResEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetNumLinResEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDAGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)IDAGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FIDAGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)IDAGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolverB(void *farg1, int const *farg2, SUNLinearSolver farg3, SUNMatrix farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + SUNLinearSolver arg3 = (SUNLinearSolver) 0 ; + SUNMatrix arg4 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (SUNLinearSolver)(farg3); + arg4 = (SUNMatrix)(farg4); + result = (int)IDASetLinearSolverB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacFnB(void *farg1, int const *farg2, IDALsJacFnB farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsJacFnB arg3 = (IDALsJacFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsJacFnB)(farg3); + result = (int)IDASetJacFnB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacFnBS(void *farg1, int const *farg2, IDALsJacFnBS farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsJacFnBS arg3 = (IDALsJacFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsJacFnBS)(farg3); + result = (int)IDASetJacFnBS(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetEpsLinB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetEpsLinB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLSNormFactorB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetLSNormFactorB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetLinearSolutionScalingB(void *farg1, int const *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (int)IDASetLinearSolutionScalingB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetIncrementFactorB(void *farg1, int const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)IDASetIncrementFactorB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetPreconditionerB(void *farg1, int const *farg2, IDALsPrecSetupFnB farg3, IDALsPrecSolveFnB farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsPrecSetupFnB arg3 = (IDALsPrecSetupFnB) 0 ; + IDALsPrecSolveFnB arg4 = (IDALsPrecSolveFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsPrecSetupFnB)(farg3); + arg4 = (IDALsPrecSolveFnB)(farg4); + result = (int)IDASetPreconditionerB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetPreconditionerBS(void *farg1, int const *farg2, IDALsPrecSetupFnBS farg3, IDALsPrecSolveFnBS farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsPrecSetupFnBS arg3 = (IDALsPrecSetupFnBS) 0 ; + IDALsPrecSolveFnBS arg4 = (IDALsPrecSolveFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsPrecSetupFnBS)(farg3); + arg4 = (IDALsPrecSolveFnBS)(farg4); + result = (int)IDASetPreconditionerBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacTimesB(void *farg1, int const *farg2, IDALsJacTimesSetupFnB farg3, IDALsJacTimesVecFnB farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsJacTimesSetupFnB arg3 = (IDALsJacTimesSetupFnB) 0 ; + IDALsJacTimesVecFnB arg4 = (IDALsJacTimesVecFnB) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsJacTimesSetupFnB)(farg3); + arg4 = (IDALsJacTimesVecFnB)(farg4); + result = (int)IDASetJacTimesB(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FIDASetJacTimesBS(void *farg1, int const *farg2, IDALsJacTimesSetupFnBS farg3, IDALsJacTimesVecFnBS farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + IDALsJacTimesSetupFnBS arg3 = (IDALsJacTimesSetupFnBS) 0 ; + IDALsJacTimesVecFnBS arg4 = (IDALsJacTimesVecFnBS) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (IDALsJacTimesSetupFnBS)(farg3); + arg4 = (IDALsJacTimesVecFnBS)(farg4); + result = (int)IDASetJacTimesBS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/idas/fmod_int32/fidas_mod.f90 b/src/idas/fmod_int32/fidas_mod.f90 new file mode 100644 index 0000000000..3b5dcfe964 --- /dev/null +++ b/src/idas/fmod_int32/fidas_mod.f90 @@ -0,0 +1,6831 @@ +! 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-2024, 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 fidas_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: IDA_NORMAL = 1_C_INT + integer(C_INT), parameter, public :: IDA_ONE_STEP = 2_C_INT + integer(C_INT), parameter, public :: IDA_YA_YDP_INIT = 1_C_INT + integer(C_INT), parameter, public :: IDA_Y_INIT = 2_C_INT + integer(C_INT), parameter, public :: IDA_SIMULTANEOUS = 1_C_INT + integer(C_INT), parameter, public :: IDA_STAGGERED = 2_C_INT + integer(C_INT), parameter, public :: IDA_CENTERED = 1_C_INT + integer(C_INT), parameter, public :: IDA_FORWARD = 2_C_INT + integer(C_INT), parameter, public :: IDA_HERMITE = 1_C_INT + integer(C_INT), parameter, public :: IDA_POLYNOMIAL = 2_C_INT + integer(C_INT), parameter, public :: IDA_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: IDA_TSTOP_RETURN = 1_C_INT + integer(C_INT), parameter, public :: IDA_ROOT_RETURN = 2_C_INT + integer(C_INT), parameter, public :: IDA_WARNING = 99_C_INT + integer(C_INT), parameter, public :: IDA_TOO_MUCH_WORK = -1_C_INT + integer(C_INT), parameter, public :: IDA_TOO_MUCH_ACC = -2_C_INT + integer(C_INT), parameter, public :: IDA_ERR_FAIL = -3_C_INT + integer(C_INT), parameter, public :: IDA_CONV_FAIL = -4_C_INT + integer(C_INT), parameter, public :: IDA_LINIT_FAIL = -5_C_INT + integer(C_INT), parameter, public :: IDA_LSETUP_FAIL = -6_C_INT + integer(C_INT), parameter, public :: IDA_LSOLVE_FAIL = -7_C_INT + integer(C_INT), parameter, public :: IDA_RES_FAIL = -8_C_INT + integer(C_INT), parameter, public :: IDA_REP_RES_ERR = -9_C_INT + integer(C_INT), parameter, public :: IDA_RTFUNC_FAIL = -10_C_INT + integer(C_INT), parameter, public :: IDA_CONSTR_FAIL = -11_C_INT + integer(C_INT), parameter, public :: IDA_FIRST_RES_FAIL = -12_C_INT + integer(C_INT), parameter, public :: IDA_LINESEARCH_FAIL = -13_C_INT + integer(C_INT), parameter, public :: IDA_NO_RECOVERY = -14_C_INT + integer(C_INT), parameter, public :: IDA_NLS_INIT_FAIL = -15_C_INT + integer(C_INT), parameter, public :: IDA_NLS_SETUP_FAIL = -16_C_INT + integer(C_INT), parameter, public :: IDA_NLS_FAIL = -17_C_INT + integer(C_INT), parameter, public :: IDA_MEM_NULL = -20_C_INT + integer(C_INT), parameter, public :: IDA_MEM_FAIL = -21_C_INT + integer(C_INT), parameter, public :: IDA_ILL_INPUT = -22_C_INT + integer(C_INT), parameter, public :: IDA_NO_MALLOC = -23_C_INT + integer(C_INT), parameter, public :: IDA_BAD_EWT = -24_C_INT + integer(C_INT), parameter, public :: IDA_BAD_K = -25_C_INT + integer(C_INT), parameter, public :: IDA_BAD_T = -26_C_INT + integer(C_INT), parameter, public :: IDA_BAD_DKY = -27_C_INT + integer(C_INT), parameter, public :: IDA_VECTOROP_ERR = -28_C_INT + integer(C_INT), parameter, public :: IDA_CONTEXT_ERR = -29_C_INT + integer(C_INT), parameter, public :: IDA_NO_QUAD = -30_C_INT + integer(C_INT), parameter, public :: IDA_QRHS_FAIL = -31_C_INT + integer(C_INT), parameter, public :: IDA_FIRST_QRHS_ERR = -32_C_INT + integer(C_INT), parameter, public :: IDA_REP_QRHS_ERR = -33_C_INT + integer(C_INT), parameter, public :: IDA_NO_SENS = -40_C_INT + integer(C_INT), parameter, public :: IDA_SRES_FAIL = -41_C_INT + integer(C_INT), parameter, public :: IDA_REP_SRES_ERR = -42_C_INT + integer(C_INT), parameter, public :: IDA_BAD_IS = -43_C_INT + integer(C_INT), parameter, public :: IDA_NO_QUADSENS = -50_C_INT + integer(C_INT), parameter, public :: IDA_QSRHS_FAIL = -51_C_INT + integer(C_INT), parameter, public :: IDA_FIRST_QSRHS_ERR = -52_C_INT + integer(C_INT), parameter, public :: IDA_REP_QSRHS_ERR = -53_C_INT + integer(C_INT), parameter, public :: IDA_UNRECOGNIZED_ERROR = -99_C_INT + integer(C_INT), parameter, public :: IDA_NO_ADJ = -101_C_INT + integer(C_INT), parameter, public :: IDA_NO_FWD = -102_C_INT + integer(C_INT), parameter, public :: IDA_NO_BCK = -103_C_INT + integer(C_INT), parameter, public :: IDA_BAD_TB0 = -104_C_INT + integer(C_INT), parameter, public :: IDA_REIFWD_FAIL = -105_C_INT + integer(C_INT), parameter, public :: IDA_FWD_FAIL = -106_C_INT + integer(C_INT), parameter, public :: IDA_GETY_BADT = -107_C_INT + public :: FIDACreate + public :: FIDAInit + public :: FIDAReInit + public :: FIDASStolerances + public :: FIDASVtolerances + public :: FIDAWFtolerances + public :: FIDACalcIC + public :: FIDASetNonlinConvCoefIC + public :: FIDASetMaxNumStepsIC + public :: FIDASetMaxNumJacsIC + public :: FIDASetMaxNumItersIC + public :: FIDASetLineSearchOffIC + public :: FIDASetStepToleranceIC + public :: FIDASetMaxBacksIC + public :: FIDASetDeltaCjLSetup + public :: FIDASetUserData + public :: FIDASetMaxOrd + public :: FIDASetMaxNumSteps + public :: FIDASetInitStep + public :: FIDASetMaxStep + public :: FIDASetMinStep + public :: FIDASetStopTime + public :: FIDAClearStopTime + public :: FIDASetMaxErrTestFails + public :: FIDASetSuppressAlg + public :: FIDASetId + public :: FIDASetConstraints + public :: FIDASetEtaFixedStepBounds + public :: FIDASetEtaMin + public :: FIDASetEtaMax + public :: FIDASetEtaLow + public :: FIDASetEtaMinErrFail + public :: FIDASetEtaConvFail + public :: FIDASetMaxConvFails + public :: FIDASetMaxNonlinIters + public :: FIDASetNlsResFn + public :: FIDASetNonlinConvCoef + public :: FIDASetNonlinearSolver + public :: FIDARootInit + public :: FIDASetRootDirection + public :: FIDASetNoInactiveRootWarn + public :: FIDASolve + public :: FIDAComputeY + public :: FIDAComputeYp + public :: FIDAComputeYSens + public :: FIDAComputeYpSens + public :: FIDAGetDky + public :: FIDAGetWorkSpace + public :: FIDAGetNumSteps + public :: FIDAGetNumResEvals + public :: FIDAGetNumLinSolvSetups + public :: FIDAGetNumErrTestFails + public :: FIDAGetNumBacktrackOps + public :: FIDAGetConsistentIC + public :: FIDAGetLastOrder + public :: FIDAGetCurrentOrder + public :: FIDAGetCurrentCj + public :: FIDAGetCurrentY + public :: FIDAGetCurrentYSens + public :: FIDAGetCurrentYp + public :: FIDAGetCurrentYpSens + public :: FIDAGetActualInitStep + public :: FIDAGetLastStep + public :: FIDAGetCurrentStep + public :: FIDAGetCurrentTime + public :: FIDAGetTolScaleFactor + public :: FIDAGetErrWeights + public :: FIDAGetEstLocalErrors + public :: FIDAGetNumGEvals + public :: FIDAGetRootInfo + public :: FIDAGetIntegratorStats + public :: FIDAGetNonlinearSystemData + public :: FIDAGetNonlinearSystemDataSens + public :: FIDAGetNumNonlinSolvIters + public :: FIDAGetNumNonlinSolvConvFails + public :: FIDAGetNonlinSolvStats + public :: FIDAGetNumStepSolveFails + public :: FIDAGetUserData + public :: FIDAPrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FIDAGetReturnFlagName + public :: FIDAFree + public :: FIDASetJacTimesResFn + public :: FIDAQuadInit + public :: FIDAQuadReInit + public :: FIDAQuadSStolerances + public :: FIDAQuadSVtolerances + public :: FIDASetQuadErrCon + public :: FIDAGetQuad + public :: FIDAGetQuadDky + public :: FIDAGetQuadNumRhsEvals + public :: FIDAGetQuadNumErrTestFails + public :: FIDAGetQuadErrWeights + public :: FIDAGetQuadStats + public :: FIDAQuadFree + public :: FIDASensInit + public :: FIDASensReInit + public :: FIDASensSStolerances + public :: FIDASensSVtolerances + public :: FIDASensEEtolerances + public :: FIDAGetSensConsistentIC + public :: FIDASetSensDQMethod + public :: FIDASetSensErrCon + public :: FIDASetSensMaxNonlinIters + public :: FIDASetSensParams + public :: FIDASetNonlinearSolverSensSim + public :: FIDASetNonlinearSolverSensStg + public :: FIDASensToggleOff + public :: FIDAGetSens + public :: FIDAGetSens1 + public :: FIDAGetSensDky + public :: FIDAGetSensDky1 + public :: FIDAGetSensNumResEvals + public :: FIDAGetNumResEvalsSens + public :: FIDAGetSensNumErrTestFails + public :: FIDAGetSensNumLinSolvSetups + public :: FIDAGetSensErrWeights + public :: FIDAGetSensStats + public :: FIDAGetSensNumNonlinSolvIters + public :: FIDAGetSensNumNonlinSolvConvFails + public :: FIDAGetSensNonlinSolvStats + public :: FIDAGetNumStepSensSolveFails + public :: FIDASensFree + public :: FIDAQuadSensInit + public :: FIDAQuadSensReInit + public :: FIDAQuadSensSStolerances + public :: FIDAQuadSensSVtolerances + public :: FIDAQuadSensEEtolerances + public :: FIDASetQuadSensErrCon + public :: FIDAGetQuadSens + public :: FIDAGetQuadSens1 + public :: FIDAGetQuadSensDky + public :: FIDAGetQuadSensDky1 + public :: FIDAGetQuadSensNumRhsEvals + public :: FIDAGetQuadSensNumErrTestFails + public :: FIDAGetQuadSensErrWeights + public :: FIDAGetQuadSensStats + public :: FIDAQuadSensFree + public :: FIDAAdjInit + public :: FIDAAdjReInit + public :: FIDAAdjFree + public :: FIDACreateB + public :: FIDAInitB + public :: FIDAInitBS + public :: FIDAReInitB + public :: FIDASStolerancesB + public :: FIDASVtolerancesB + public :: FIDAQuadInitB + public :: FIDAQuadInitBS + public :: FIDAQuadReInitB + public :: FIDAQuadSStolerancesB + public :: FIDAQuadSVtolerancesB + public :: FIDACalcICB + public :: FIDACalcICBS + public :: FIDASolveF + public :: FIDASolveB + public :: FIDAAdjSetNoSensi + public :: FIDASetUserDataB + public :: FIDASetMaxOrdB + public :: FIDASetMaxNumStepsB + public :: FIDASetInitStepB + public :: FIDASetMaxStepB + public :: FIDASetSuppressAlgB + public :: FIDASetIdB + public :: FIDASetConstraintsB + public :: FIDASetQuadErrConB + public :: FIDASetNonlinearSolverB + public :: FIDAGetB + public :: FIDAGetQuadB + public :: FIDAGetAdjIDABmem + public :: FIDAGetConsistentICB + public :: FIDAGetAdjY + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct IDAadjCheckPointRec + type, public :: IDAadjCheckPointRec + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_my_addr => swigf_IDAadjCheckPointRec_my_addr_set + procedure :: get_my_addr => swigf_IDAadjCheckPointRec_my_addr_get + procedure :: set_next_addr => swigf_IDAadjCheckPointRec_next_addr_set + procedure :: get_next_addr => swigf_IDAadjCheckPointRec_next_addr_get + procedure :: set_t0 => swigf_IDAadjCheckPointRec_t0_set + procedure :: get_t0 => swigf_IDAadjCheckPointRec_t0_get + procedure :: set_t1 => swigf_IDAadjCheckPointRec_t1_set + procedure :: get_t1 => swigf_IDAadjCheckPointRec_t1_get + procedure :: set_nstep => swigf_IDAadjCheckPointRec_nstep_set + procedure :: get_nstep => swigf_IDAadjCheckPointRec_nstep_get + procedure :: set_order => swigf_IDAadjCheckPointRec_order_set + procedure :: get_order => swigf_IDAadjCheckPointRec_order_get + procedure :: set_step => swigf_IDAadjCheckPointRec_step_set + procedure :: get_step => swigf_IDAadjCheckPointRec_step_get + procedure :: release => swigf_release_IDAadjCheckPointRec + procedure, private :: swigf_IDAadjCheckPointRec_op_assign__ + generic :: assignment(=) => swigf_IDAadjCheckPointRec_op_assign__ + end type IDAadjCheckPointRec + interface IDAadjCheckPointRec + module procedure swigf_create_IDAadjCheckPointRec + end interface + public :: FIDAGetAdjCheckPointsInfo + public :: FIDASetJacTimesResFnB + public :: FIDAGetAdjDataPointHermite + public :: FIDAGetAdjDataPointPolynomial + public :: FIDAGetAdjCurrentCheckPoint + public :: FIDABBDPrecInit + public :: FIDABBDPrecReInit + public :: FIDABBDPrecGetWorkSpace + public :: FIDABBDPrecGetNumGfnEvals + public :: FIDABBDPrecInitB + public :: FIDABBDPrecReInitB + integer(C_INT), parameter, public :: IDALS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: IDALS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: IDALS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: IDALS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: IDALS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: IDALS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: IDALS_JACFUNC_UNRECVR = -6_C_INT + integer(C_INT), parameter, public :: IDALS_JACFUNC_RECVR = -7_C_INT + integer(C_INT), parameter, public :: IDALS_SUNMAT_FAIL = -8_C_INT + integer(C_INT), parameter, public :: IDALS_SUNLS_FAIL = -9_C_INT + integer(C_INT), parameter, public :: IDALS_NO_ADJ = -101_C_INT + integer(C_INT), parameter, public :: IDALS_LMEMB_NULL = -102_C_INT + public :: FIDASetLinearSolver + public :: FIDASetJacFn + public :: FIDASetPreconditioner + public :: FIDASetJacTimes + public :: FIDASetEpsLin + public :: FIDASetLSNormFactor + public :: FIDASetLinearSolutionScaling + public :: FIDASetIncrementFactor + public :: FIDAGetJac + public :: FIDAGetJacCj + public :: FIDAGetJacTime + public :: FIDAGetJacNumSteps + public :: FIDAGetLinWorkSpace + public :: FIDAGetNumJacEvals + public :: FIDAGetNumPrecEvals + public :: FIDAGetNumPrecSolves + public :: FIDAGetNumLinIters + public :: FIDAGetNumLinConvFails + public :: FIDAGetNumJTSetupEvals + public :: FIDAGetNumJtimesEvals + public :: FIDAGetNumLinResEvals + public :: FIDAGetLastLinFlag + public :: FIDAGetLinReturnFlagName + public :: FIDASetLinearSolverB + public :: FIDASetJacFnB + public :: FIDASetJacFnBS + public :: FIDASetEpsLinB + public :: FIDASetLSNormFactorB + public :: FIDASetLinearSolutionScalingB + public :: FIDASetIncrementFactorB + public :: FIDASetPreconditionerB + public :: FIDASetPreconditionerBS + public :: FIDASetJacTimesB + public :: FIDASetJacTimesBS + +! WRAPPER DECLARATIONS +interface +function swigc_FIDACreate(farg1) & +bind(C, name="_wrap_FIDACreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FIDAInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASStolerances") & +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_FIDASVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAWFtolerances(farg1, farg2) & +bind(C, name="_wrap_FIDAWFtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDACalcIC(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDACalcIC") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinConvCoefIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinConvCoefIC") & +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_FIDASetMaxNumStepsIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumStepsIC") & +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_FIDASetMaxNumJacsIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumJacsIC") & +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_FIDASetMaxNumItersIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumItersIC") & +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_FIDASetLineSearchOffIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetLineSearchOffIC") & +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_FIDASetStepToleranceIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetStepToleranceIC") & +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_FIDASetMaxBacksIC(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxBacksIC") & +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_FIDASetDeltaCjLSetup(farg1, farg2) & +bind(C, name="_wrap_FIDASetDeltaCjLSetup") & +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_FIDASetUserData(farg1, farg2) & +bind(C, name="_wrap_FIDASetUserData") & +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_FIDASetMaxOrd(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxOrd") & +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_FIDASetMaxNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNumSteps") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetInitStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetInitStep") & +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_FIDASetMaxStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxStep") & +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_FIDASetMinStep(farg1, farg2) & +bind(C, name="_wrap_FIDASetMinStep") & +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_FIDASetStopTime(farg1, farg2) & +bind(C, name="_wrap_FIDASetStopTime") & +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_FIDAClearStopTime(farg1) & +bind(C, name="_wrap_FIDAClearStopTime") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetMaxErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxErrTestFails") & +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_FIDASetSuppressAlg(farg1, farg2) & +bind(C, name="_wrap_FIDASetSuppressAlg") & +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_FIDASetId(farg1, farg2) & +bind(C, name="_wrap_FIDASetId") & +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_FIDASetConstraints(farg1, farg2) & +bind(C, name="_wrap_FIDASetConstraints") & +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_FIDASetEtaFixedStepBounds(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetEtaFixedStepBounds") & +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_FIDASetEtaMin(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMin") & +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_FIDASetEtaMax(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMax") & +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_FIDASetEtaLow(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaLow") & +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_FIDASetEtaMinErrFail(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaMinErrFail") & +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_FIDASetEtaConvFail(farg1, farg2) & +bind(C, name="_wrap_FIDASetEtaConvFail") & +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_FIDASetMaxConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxConvFails") & +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_FIDASetMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FIDASetMaxNonlinIters") & +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_FIDASetNlsResFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetNlsResFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinConvCoef(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinConvCoef") & +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_FIDASetNonlinearSolver(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinearSolver") & +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_FIDARootInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDARootInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetRootDirection(farg1, farg2) & +bind(C, name="_wrap_FIDASetRootDirection") & +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_FIDASetNoInactiveRootWarn(farg1) & +bind(C, name="_wrap_FIDASetNoInactiveRootWarn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASolve(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FIDASolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT), intent(in) :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FIDAComputeY(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeY") & +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_FIDAComputeYp(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeYp") & +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_FIDAComputeYSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeYSens") & +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_FIDAComputeYpSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAComputeYpSens") & +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_FIDAGetDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetWorkSpace") & +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_FIDAGetNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumSteps") & +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_FIDAGetNumResEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumResEvals") & +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_FIDAGetNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinSolvSetups") & +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_FIDAGetNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumErrTestFails") & +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_FIDAGetNumBacktrackOps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumBacktrackOps") & +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_FIDAGetConsistentIC(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetConsistentIC") & +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_FIDAGetLastOrder(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastOrder") & +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_FIDAGetCurrentOrder(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentOrder") & +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_FIDAGetCurrentCj(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentCj") & +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_FIDAGetCurrentY(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentY") & +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_FIDAGetCurrentYSens(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentYSens") & +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_FIDAGetCurrentYp(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentYp") & +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_FIDAGetCurrentYpSens(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentYpSens") & +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_FIDAGetActualInitStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetActualInitStep") & +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_FIDAGetLastStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastStep") & +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_FIDAGetCurrentStep(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentStep") & +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_FIDAGetCurrentTime(farg1, farg2) & +bind(C, name="_wrap_FIDAGetCurrentTime") & +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_FIDAGetTolScaleFactor(farg1, farg2) & +bind(C, name="_wrap_FIDAGetTolScaleFactor") & +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_FIDAGetErrWeights(farg1, farg2) & +bind(C, name="_wrap_FIDAGetErrWeights") & +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_FIDAGetEstLocalErrors(farg1, farg2) & +bind(C, name="_wrap_FIDAGetEstLocalErrors") & +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_FIDAGetNumGEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumGEvals") & +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_FIDAGetRootInfo(farg1, farg2) & +bind(C, name="_wrap_FIDAGetRootInfo") & +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_FIDAGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) & +bind(C, name="_wrap_FIDAGetIntegratorStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +type(C_PTR), value :: farg10 +type(C_PTR), value :: farg11 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FIDAGetNonlinearSystemData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +type(C_PTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetNonlinearSystemDataSens(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FIDAGetNonlinearSystemDataSens") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumNonlinSolvIters") & +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_FIDAGetNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumNonlinSolvConvFails") & +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_FIDAGetNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetNonlinSolvStats") & +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_FIDAGetNumStepSolveFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumStepSolveFails") & +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_FIDAGetUserData(farg1, farg2) & +bind(C, name="_wrap_FIDAGetUserData") & +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_FIDAPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FIDAGetReturnFlagName(farg1) & +bind(C, name="_wrap_FIDAGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FIDAFree(farg1) & +bind(C, name="_wrap_FIDAFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDASetJacTimesResFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetJacTimesResFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadInit") & +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_FIDAQuadReInit(farg1, farg2) & +bind(C, name="_wrap_FIDAQuadReInit") & +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_FIDAQuadSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadSStolerances") & +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_FIDAQuadSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetQuadErrCon(farg1, farg2) & +bind(C, name="_wrap_FIDASetQuadErrCon") & +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_FIDAGetQuad(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetQuad") & +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_FIDAGetQuadDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetQuadDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetQuadNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadNumRhsEvals") & +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_FIDAGetQuadNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadNumErrTestFails") & +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_FIDAGetQuadErrWeights(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadErrWeights") & +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_FIDAGetQuadStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetQuadStats") & +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 + +subroutine swigc_FIDAQuadFree(farg1) & +bind(C, name="_wrap_FIDAQuadFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDASensInit(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FIDASensInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_FUNPTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FIDASensReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASensReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASensSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASensSStolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASensSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASensSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASensEEtolerances(farg1) & +bind(C, name="_wrap_FIDASensEEtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSensConsistentIC(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetSensConsistentIC") & +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_FIDASetSensDQMethod(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetSensDQMethod") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetSensErrCon(farg1, farg2) & +bind(C, name="_wrap_FIDASetSensErrCon") & +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_FIDASetSensMaxNonlinIters(farg1, farg2) & +bind(C, name="_wrap_FIDASetSensMaxNonlinIters") & +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_FIDASetSensParams(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetSensParams") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinearSolverSensSim(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinearSolverSensSim") & +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_FIDASetNonlinearSolverSensStg(farg1, farg2) & +bind(C, name="_wrap_FIDASetNonlinearSolverSensStg") & +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_FIDASensToggleOff(farg1) & +bind(C, name="_wrap_FIDASensToggleOff") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetSens") & +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_FIDAGetSens1(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetSens1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSensDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetSensDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSensDky1(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetSensDky1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSensNumResEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensNumResEvals") & +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_FIDAGetNumResEvalsSens(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumResEvalsSens") & +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_FIDAGetSensNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensNumErrTestFails") & +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_FIDAGetSensNumLinSolvSetups(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensNumLinSolvSetups") & +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_FIDAGetSensErrWeights(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensErrWeights") & +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_FIDAGetSensStats(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetSensStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetSensNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensNumNonlinSolvIters") & +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_FIDAGetSensNumNonlinSolvConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetSensNumNonlinSolvConvFails") & +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_FIDAGetSensNonlinSolvStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetSensNonlinSolvStats") & +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_FIDAGetNumStepSensSolveFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumStepSensSolveFails") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_FIDASensFree(farg1) & +bind(C, name="_wrap_FIDASensFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDAQuadSensInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadSensInit") & +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_FIDAQuadSensReInit(farg1, farg2) & +bind(C, name="_wrap_FIDAQuadSensReInit") & +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_FIDAQuadSensSStolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadSensSStolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadSensSVtolerances(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadSensSVtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadSensEEtolerances(farg1) & +bind(C, name="_wrap_FIDAQuadSensEEtolerances") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetQuadSensErrCon(farg1, farg2) & +bind(C, name="_wrap_FIDASetQuadSensErrCon") & +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_FIDAGetQuadSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetQuadSens") & +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_FIDAGetQuadSens1(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetQuadSens1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetQuadSensDky(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetQuadSensDky") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetQuadSensDky1(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetQuadSensDky1") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetQuadSensNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadSensNumRhsEvals") & +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_FIDAGetQuadSensNumErrTestFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadSensNumErrTestFails") & +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_FIDAGetQuadSensErrWeights(farg1, farg2) & +bind(C, name="_wrap_FIDAGetQuadSensErrWeights") & +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_FIDAGetQuadSensStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetQuadSensStats") & +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 + +subroutine swigc_FIDAQuadSensFree(farg1) & +bind(C, name="_wrap_FIDAQuadSensFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDAAdjInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAAdjInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAAdjReInit(farg1) & +bind(C, name="_wrap_FIDAAdjReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FIDAAdjFree(farg1) & +bind(C, name="_wrap_FIDAAdjFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FIDACreateB(farg1, farg2) & +bind(C, name="_wrap_FIDACreateB") & +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_FIDAInitB(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FIDAInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FIDAInitBS(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FIDAInitBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FIDAReInitB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDASStolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASStolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASVtolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASVtolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadInitB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAQuadInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadInitBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAQuadInitBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadReInitB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAQuadReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadSStolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAQuadSStolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAQuadSVtolerancesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAQuadSVtolerancesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDACalcICB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDACalcICB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDACalcICBS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FIDACalcICBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FIDASolveF(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FIDASolveF") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT), intent(in) :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FIDASolveB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASolveB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAAdjSetNoSensi(farg1) & +bind(C, name="_wrap_FIDAAdjSetNoSensi") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetMaxOrdB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetMaxOrdB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetMaxNumStepsB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetMaxNumStepsB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_LONG), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetInitStepB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetInitStepB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetMaxStepB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetMaxStepB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetSuppressAlgB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetSuppressAlgB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetIdB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetIdB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetConstraintsB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetConstraintsB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetQuadErrConB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetQuadErrConB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetNonlinearSolverB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetNonlinearSolverB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetQuadB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetQuadB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetAdjIDABmem(farg1, farg2) & +bind(C, name="_wrap_FIDAGetAdjIDABmem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FIDAGetConsistentICB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetConsistentICB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetAdjY(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDAGetAdjY") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_my_addr_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_my_addr_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_my_addr_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_my_addr_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_next_addr_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_next_addr_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_next_addr_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_next_addr_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_t0_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_t0_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_t0_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_t0_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_t1_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_t1_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_t1_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_t1_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_nstep_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_nstep_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_LONG), intent(in) :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_nstep_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_nstep_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_LONG) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_order_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_order_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_order_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_order_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_IDAadjCheckPointRec_step_set(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_step_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_IDAadjCheckPointRec_step_get(farg1) & +bind(C, name="_wrap_IDAadjCheckPointRec_step_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_new_IDAadjCheckPointRec() & +bind(C, name="_wrap_new_IDAadjCheckPointRec") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_IDAadjCheckPointRec(farg1) & +bind(C, name="_wrap_delete_IDAadjCheckPointRec") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_IDAadjCheckPointRec_op_assign__(farg1, farg2) & +bind(C, name="_wrap_IDAadjCheckPointRec_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FIDAGetAdjCheckPointsInfo(farg1, farg2) & +bind(C, name="_wrap_FIDAGetAdjCheckPointsInfo") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacTimesResFnB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetJacTimesResFnB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetAdjDataPointHermite(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetAdjDataPointHermite") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetAdjDataPointPolynomial(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDAGetAdjDataPointPolynomial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDAGetAdjCurrentCheckPoint(farg1, farg2) & +bind(C, name="_wrap_FIDAGetAdjCurrentCheckPoint") & +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_FIDABBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FIDABBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDABBDPrecReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDABBDPrecGetWorkSpace") & +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_FIDABBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FIDABBDPrecGetNumGfnEvals") & +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_FIDABBDPrecInitB(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10) & +bind(C, name="_wrap_FIDABBDPrecInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +integer(C_INT32_T), intent(in) :: farg7 +real(C_DOUBLE), intent(in) :: farg8 +type(C_FUNPTR), value :: farg9 +type(C_FUNPTR), value :: farg10 +integer(C_INT) :: fresult +end function + +function swigc_FIDABBDPrecReInitB(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FIDABBDPrecReInitB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetLinearSolver") & +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_FIDASetJacFn(farg1, farg2) & +bind(C, name="_wrap_FIDASetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacTimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetJacTimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetEpsLin(farg1, farg2) & +bind(C, name="_wrap_FIDASetEpsLin") & +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_FIDASetLSNormFactor(farg1, farg2) & +bind(C, name="_wrap_FIDASetLSNormFactor") & +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_FIDASetLinearSolutionScaling(farg1, farg2) & +bind(C, name="_wrap_FIDASetLinearSolutionScaling") & +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_FIDASetIncrementFactor(farg1, farg2) & +bind(C, name="_wrap_FIDASetIncrementFactor") & +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_FIDAGetJac(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJac") & +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_FIDAGetJacCj(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacCj") & +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_FIDAGetJacTime(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacTime") & +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_FIDAGetJacNumSteps(farg1, farg2) & +bind(C, name="_wrap_FIDAGetJacNumSteps") & +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_FIDAGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetLinWorkSpace") & +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_FIDAGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJacEvals") & +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_FIDAGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumPrecEvals") & +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_FIDAGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumPrecSolves") & +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_FIDAGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinIters") & +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_FIDAGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinConvFails") & +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_FIDAGetNumJTSetupEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJTSetupEvals") & +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_FIDAGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumJtimesEvals") & +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_FIDAGetNumLinResEvals(farg1, farg2) & +bind(C, name="_wrap_FIDAGetNumLinResEvals") & +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_FIDAGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FIDAGetLastLinFlag") & +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_FIDAGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FIDAGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FIDASetLinearSolverB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetLinearSolverB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacFnB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetJacFnB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacFnBS(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetJacFnBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetEpsLinB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetEpsLinB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetLSNormFactorB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetLSNormFactorB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetLinearSolutionScalingB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetLinearSolutionScalingB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetIncrementFactorB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDASetIncrementFactorB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetPreconditionerB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetPreconditionerB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetPreconditionerBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetPreconditionerBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacTimesB(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetJacTimesB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FIDASetJacTimesBS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FIDASetJacTimesBS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FIDACreate(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FIDACreate(farg1) +swig_result = fresult +end function + +function FIDAInit(ida_mem, res, t0, yy0, yp0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: res +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = res +farg3 = t0 +farg4 = c_loc(yy0) +farg5 = c_loc(yp0) +fresult = swigc_FIDAInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAReInit(ida_mem, t0, yy0, yp0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t0 +farg3 = c_loc(yy0) +farg4 = c_loc(yp0) +fresult = swigc_FIDAReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASStolerances(ida_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltol +real(C_DOUBLE), intent(in) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = reltol +farg3 = abstol +fresult = swigc_FIDASStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASVtolerances(ida_mem, reltol, abstol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltol +type(N_Vector), target, intent(inout) :: abstol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltol +farg3 = c_loc(abstol) +fresult = swigc_FIDASVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAWFtolerances(ida_mem, efun) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: efun +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = efun +fresult = swigc_FIDAWFtolerances(farg1, farg2) +swig_result = fresult +end function + +function FIDACalcIC(ida_mem, icopt, tout1) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: icopt +real(C_DOUBLE), intent(in) :: tout1 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = icopt +farg3 = tout1 +fresult = swigc_FIDACalcIC(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetNonlinConvCoefIC(ida_mem, epiccon) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: epiccon +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = epiccon +fresult = swigc_FIDASetNonlinConvCoefIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumStepsIC(ida_mem, maxnh) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnh +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnh +fresult = swigc_FIDASetMaxNumStepsIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumJacsIC(ida_mem, maxnj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnj +fresult = swigc_FIDASetMaxNumJacsIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumItersIC(ida_mem, maxnit) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnit +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnit +fresult = swigc_FIDASetMaxNumItersIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLineSearchOffIC(ida_mem, lsoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: lsoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = lsoff +fresult = swigc_FIDASetLineSearchOffIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetStepToleranceIC(ida_mem, steptol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: steptol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = steptol +fresult = swigc_FIDASetStepToleranceIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxBacksIC(ida_mem, maxbacks) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxbacks +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxbacks +fresult = swigc_FIDASetMaxBacksIC(farg1, farg2) +swig_result = fresult +end function + +function FIDASetDeltaCjLSetup(ida_max, dcj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_max +real(C_DOUBLE), intent(in) :: dcj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_max +farg2 = dcj +fresult = swigc_FIDASetDeltaCjLSetup(farg1, farg2) +swig_result = fresult +end function + +function FIDASetUserData(ida_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = user_data +fresult = swigc_FIDASetUserData(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxOrd(ida_mem, maxord) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxord +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxord +fresult = swigc_FIDASetMaxOrd(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNumSteps(ida_mem, mxsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), intent(in) :: mxsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = ida_mem +farg2 = mxsteps +fresult = swigc_FIDASetMaxNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDASetInitStep(ida_mem, hin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hin +fresult = swigc_FIDASetInitStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxStep(ida_mem, hmax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hmax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hmax +fresult = swigc_FIDASetMaxStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMinStep(ida_mem, hmin) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: hmin +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = hmin +fresult = swigc_FIDASetMinStep(farg1, farg2) +swig_result = fresult +end function + +function FIDASetStopTime(ida_mem, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = tstop +fresult = swigc_FIDASetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAClearStopTime(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDAClearStopTime(farg1) +swig_result = fresult +end function + +function FIDASetMaxErrTestFails(ida_mem, maxnef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxnef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxnef +fresult = swigc_FIDASetMaxErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDASetSuppressAlg(ida_mem, suppressalg) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: suppressalg +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = suppressalg +fresult = swigc_FIDASetSuppressAlg(farg1, farg2) +swig_result = fresult +end function + +function FIDASetId(ida_mem, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: id +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(id) +fresult = swigc_FIDASetId(farg1, farg2) +swig_result = fresult +end function + +function FIDASetConstraints(ida_mem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(constraints) +fresult = swigc_FIDASetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaFixedStepBounds(ida_mem, eta_min_fx, eta_max_fx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min_fx +real(C_DOUBLE), intent(in) :: eta_max_fx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = eta_min_fx +farg3 = eta_max_fx +fresult = swigc_FIDASetEtaFixedStepBounds(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetEtaMin(ida_mem, eta_min) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_min +fresult = swigc_FIDASetEtaMin(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaMax(ida_mem, eta_max) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_max +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_max +fresult = swigc_FIDASetEtaMax(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaLow(ida_mem, eta_low) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_low +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_low +fresult = swigc_FIDASetEtaLow(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaMinErrFail(ida_mem, eta_min_ef) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_min_ef +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_min_ef +fresult = swigc_FIDASetEtaMinErrFail(farg1, farg2) +swig_result = fresult +end function + +function FIDASetEtaConvFail(ida_mem, eta_cf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eta_cf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eta_cf +fresult = swigc_FIDASetEtaConvFail(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxConvFails(ida_mem, maxncf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxncf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxncf +fresult = swigc_FIDASetMaxConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDASetMaxNonlinIters(ida_mem, maxcor) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxcor +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxcor +fresult = swigc_FIDASetMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNlsResFn(ida_mem, res) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: res +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = res +fresult = swigc_FIDASetNlsResFn(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNonlinConvCoef(ida_mem, epcon) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: epcon +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = epcon +fresult = swigc_FIDASetNonlinConvCoef(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNonlinearSolver(ida_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nls) +fresult = swigc_FIDASetNonlinearSolver(farg1, farg2) +swig_result = fresult +end function + +function FIDARootInit(ida_mem, nrtfn, g) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: nrtfn +type(C_FUNPTR), intent(in), value :: g +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = nrtfn +farg3 = g +fresult = swigc_FIDARootInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetRootDirection(ida_mem, rootdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(rootdir(1)) +fresult = swigc_FIDASetRootDirection(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNoInactiveRootWarn(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDASetNoInactiveRootWarn(farg1) +swig_result = fresult +end function + +function FIDASolve(ida_mem, tout, tret, yret, ypret, itask) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: yret +type(N_Vector), target, intent(inout) :: ypret +integer(C_INT), intent(in) :: itask +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +integer(C_INT) :: farg6 + +farg1 = ida_mem +farg2 = tout +farg3 = c_loc(tret(1)) +farg4 = c_loc(yret) +farg5 = c_loc(ypret) +farg6 = itask +fresult = swigc_FIDASolve(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FIDAComputeY(ida_mem, ycor, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ycor) +farg3 = c_loc(y) +fresult = swigc_FIDAComputeY(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAComputeYp(ida_mem, ycor, yp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ycor +type(N_Vector), target, intent(inout) :: yp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ycor) +farg3 = c_loc(yp) +fresult = swigc_FIDAComputeYp(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAComputeYSens(ida_mem, ycor, yys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ycor +type(C_PTR) :: yys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = ycor +farg3 = yys +fresult = swigc_FIDAComputeYSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAComputeYpSens(ida_mem, ycor, yps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ycor +type(C_PTR) :: yps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = ycor +farg3 = yps +fresult = swigc_FIDAComputeYpSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetDky(ida_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FIDAGetDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetWorkSpace(ida_mem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +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 = ida_mem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FIDAGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumSteps(ida_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsteps(1)) +fresult = swigc_FIDAGetNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumResEvals(ida_mem, nrevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrevals(1)) +fresult = swigc_FIDAGetNumResEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinSolvSetups(ida_mem, nlinsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nlinsetups(1)) +fresult = swigc_FIDAGetNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumErrTestFails(ida_mem, netfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(netfails(1)) +fresult = swigc_FIDAGetNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumBacktrackOps(ida_mem, nbacktr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nbacktr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nbacktr(1)) +fresult = swigc_FIDAGetNumBacktrackOps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: yy0_mod +type(N_Vector), target, intent(inout) :: yp0_mod +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(yy0_mod) +farg3 = c_loc(yp0_mod) +fresult = swigc_FIDAGetConsistentIC(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetLastOrder(ida_mem, klast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: klast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(klast(1)) +fresult = swigc_FIDAGetLastOrder(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentOrder(ida_mem, kcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: kcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(kcur(1)) +fresult = swigc_FIDAGetCurrentOrder(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentCj(ida_mem, cj) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(cj(1)) +fresult = swigc_FIDAGetCurrentCj(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentY(ida_mem, ycur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ycur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = ycur +fresult = swigc_FIDAGetCurrentY(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentYSens(ida_mem, ys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: ys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ys) +fresult = swigc_FIDAGetCurrentYSens(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentYp(ida_mem, ypcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: ypcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = ypcur +fresult = swigc_FIDAGetCurrentYp(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentYpSens(ida_mem, yps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: yps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(yps) +fresult = swigc_FIDAGetCurrentYpSens(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetActualInitStep(ida_mem, hinused) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hinused(1)) +fresult = swigc_FIDAGetActualInitStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLastStep(ida_mem, hlast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hlast(1)) +fresult = swigc_FIDAGetLastStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentStep(ida_mem, hcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(hcur(1)) +fresult = swigc_FIDAGetCurrentStep(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetCurrentTime(ida_mem, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(tcur(1)) +fresult = swigc_FIDAGetCurrentTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetTolScaleFactor(ida_mem, tolsfact) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolsfact +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(tolsfact(1)) +fresult = swigc_FIDAGetTolScaleFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetErrWeights(ida_mem, eweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: eweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(eweight) +fresult = swigc_FIDAGetErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetEstLocalErrors(ida_mem, ele) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: ele +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ele) +fresult = swigc_FIDAGetEstLocalErrors(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumGEvals(ida_mem, ngevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ngevals(1)) +fresult = swigc_FIDAGetNumGEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetRootInfo(ida_mem, rootsfound) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: rootsfound +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(rootsfound(1)) +fresult = swigc_FIDAGetRootInfo(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsteps +integer(C_LONG), dimension(*), target, intent(inout) :: nrevals +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetups +integer(C_LONG), dimension(*), target, intent(inout) :: netfails +integer(C_INT), dimension(*), target, intent(inout) :: qlast +integer(C_INT), dimension(*), target, intent(inout) :: qcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: hinused +real(C_DOUBLE), dimension(*), target, intent(inout) :: hlast +real(C_DOUBLE), dimension(*), target, intent(inout) :: hcur +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 +type(C_PTR) :: farg10 +type(C_PTR) :: farg11 + +farg1 = ida_mem +farg2 = c_loc(nsteps(1)) +farg3 = c_loc(nrevals(1)) +farg4 = c_loc(nlinsetups(1)) +farg5 = c_loc(netfails(1)) +farg6 = c_loc(qlast(1)) +farg7 = c_loc(qcur(1)) +farg8 = c_loc(hinused(1)) +farg9 = c_loc(hlast(1)) +farg10 = c_loc(hcur(1)) +farg11 = c_loc(tcur(1)) +fresult = swigc_FIDAGetIntegratorStats(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10, farg11) +swig_result = fresult +end function + +function FIDAGetNonlinearSystemData(ida_mem, tcur, yypred, yppred, yyn, ypn, res, cj, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR) :: yypred +type(C_PTR) :: yppred +type(C_PTR) :: yyn +type(C_PTR) :: ypn +type(C_PTR) :: res +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 +type(C_PTR) :: farg9 + +farg1 = ida_mem +farg2 = c_loc(tcur(1)) +farg3 = yypred +farg4 = yppred +farg5 = yyn +farg6 = ypn +farg7 = res +farg8 = c_loc(cj(1)) +farg9 = c_loc(user_data) +fresult = swigc_FIDAGetNonlinearSystemData(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FIDAGetNonlinearSystemDataSens(ida_mem, tcur, yyspred, ypspred, yysn, ypsn, cj, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tcur +type(C_PTR), target, intent(inout) :: yyspred +type(C_PTR), target, intent(inout) :: ypspred +type(C_PTR), target, intent(inout) :: yysn +type(C_PTR), target, intent(inout) :: ypsn +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = ida_mem +farg2 = c_loc(tcur(1)) +farg3 = c_loc(yyspred) +farg4 = c_loc(ypspred) +farg5 = c_loc(yysn) +farg6 = c_loc(ypsn) +farg7 = c_loc(cj(1)) +farg8 = c_loc(user_data) +fresult = swigc_FIDAGetNonlinearSystemDataSens(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FIDAGetNumNonlinSolvIters(ida_mem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nniters(1)) +fresult = swigc_FIDAGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumNonlinSolvConvFails(ida_mem, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nnfails(1)) +fresult = swigc_FIDAGetNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNonlinSolvStats(ida_mem, nniters, nnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_LONG), dimension(*), target, intent(inout) :: nnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(nniters(1)) +farg3 = c_loc(nnfails(1)) +fresult = swigc_FIDAGetNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumStepSolveFails(ida_mem, nncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nncfails(1)) +fresult = swigc_FIDAGetNumStepSolveFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetUserData(ida_mem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(user_data) +fresult = swigc_FIDAGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FIDAPrintAllStats(ida_mem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = outfile +farg3 = fmt +fresult = swigc_FIDAPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FIDAGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FIDAGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FIDAFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = c_loc(ida_mem) +call swigc_FIDAFree(farg1) +end subroutine + +function FIDASetJacTimesResFn(ida_mem, jtimesresfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jtimesresfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = jtimesresfn +fresult = swigc_FIDASetJacTimesResFn(farg1, farg2) +swig_result = fresult +end function + +function FIDAQuadInit(ida_mem, rhsq, yq0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: rhsq +type(N_Vector), target, intent(inout) :: yq0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = rhsq +farg3 = c_loc(yq0) +fresult = swigc_FIDAQuadInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadReInit(ida_mem, yq0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: yq0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(yq0) +fresult = swigc_FIDAQuadReInit(farg1, farg2) +swig_result = fresult +end function + +function FIDAQuadSStolerances(ida_mem, reltolq, abstolq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltolq +real(C_DOUBLE), intent(in) :: abstolq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = reltolq +farg3 = abstolq +fresult = swigc_FIDAQuadSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadSVtolerances(ida_mem, reltolq, abstolq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltolq +type(N_Vector), target, intent(inout) :: abstolq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltolq +farg3 = c_loc(abstolq) +fresult = swigc_FIDAQuadSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetQuadErrCon(ida_mem, errconq) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: errconq +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = errconq +fresult = swigc_FIDASetQuadErrCon(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuad(ida_mem, t, yqout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t +type(N_Vector), target, intent(inout) :: yqout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(t(1)) +farg3 = c_loc(yqout) +fresult = swigc_FIDAGetQuad(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetQuadDky(ida_mem, t, k, dky) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(N_Vector), target, intent(inout) :: dky +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = c_loc(dky) +fresult = swigc_FIDAGetQuadDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetQuadNumRhsEvals(ida_mem, nrhsqevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrhsqevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrhsqevals(1)) +fresult = swigc_FIDAGetQuadNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadNumErrTestFails(ida_mem, nqetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nqetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nqetfails(1)) +fresult = swigc_FIDAGetQuadNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadErrWeights(ida_mem, eqweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(N_Vector), target, intent(inout) :: eqweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(eqweight) +fresult = swigc_FIDAGetQuadErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadStats(ida_mem, nrhsqevals, nqetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrhsqevals +integer(C_LONG), dimension(*), target, intent(inout) :: nqetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(nrhsqevals(1)) +farg3 = c_loc(nqetfails(1)) +fresult = swigc_FIDAGetQuadStats(farg1, farg2, farg3) +swig_result = fresult +end function + +subroutine FIDAQuadFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = ida_mem +call swigc_FIDAQuadFree(farg1) +end subroutine + +function FIDASensInit(ida_mem, ns, ism, ress, ys0, yps0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: ns +integer(C_INT), intent(in) :: ism +type(C_FUNPTR), intent(in), value :: ress +type(C_PTR) :: ys0 +type(C_PTR) :: yps0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_FUNPTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = ida_mem +farg2 = ns +farg3 = ism +farg4 = ress +farg5 = ys0 +farg6 = yps0 +fresult = swigc_FIDASensInit(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FIDASensReInit(ida_mem, ism, ys0, yps0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: ism +type(C_PTR) :: ys0 +type(C_PTR) :: yps0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = ism +farg3 = ys0 +farg4 = yps0 +fresult = swigc_FIDASensReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASensSStolerances(ida_mem, reltols, abstols) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltols +real(C_DOUBLE), dimension(*), target, intent(inout) :: abstols +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltols +farg3 = c_loc(abstols(1)) +fresult = swigc_FIDASensSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASensSVtolerances(ida_mem, reltols, abstols) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltols +type(C_PTR) :: abstols +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltols +farg3 = abstols +fresult = swigc_FIDASensSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASensEEtolerances(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDASensEEtolerances(farg1) +swig_result = fresult +end function + +function FIDAGetSensConsistentIC(ida_mem, yys0, yps0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: yys0 +type(C_PTR) :: yps0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = yys0 +farg3 = yps0 +fresult = swigc_FIDAGetSensConsistentIC(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetSensDQMethod(ida_mem, dqtype, dqrhomax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: dqtype +real(C_DOUBLE), intent(in) :: dqrhomax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = dqtype +farg3 = dqrhomax +fresult = swigc_FIDASetSensDQMethod(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetSensErrCon(ida_mem, errcons) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: errcons +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = errcons +fresult = swigc_FIDASetSensErrCon(farg1, farg2) +swig_result = fresult +end function + +function FIDASetSensMaxNonlinIters(ida_mem, maxcors) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: maxcors +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = maxcors +fresult = swigc_FIDASetSensMaxNonlinIters(farg1, farg2) +swig_result = fresult +end function + +function FIDASetSensParams(ida_mem, p, pbar, plist) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: pbar +integer(C_INT), dimension(*), target, intent(inout) :: plist +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = c_loc(p(1)) +farg3 = c_loc(pbar(1)) +farg4 = c_loc(plist(1)) +fresult = swigc_FIDASetSensParams(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASetNonlinearSolverSensSim(ida_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nls) +fresult = swigc_FIDASetNonlinearSolverSensSim(farg1, farg2) +swig_result = fresult +end function + +function FIDASetNonlinearSolverSensStg(ida_mem, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nls) +fresult = swigc_FIDASetNonlinearSolverSensStg(farg1, farg2) +swig_result = fresult +end function + +function FIDASensToggleOff(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDASensToggleOff(farg1) +swig_result = fresult +end function + +function FIDAGetSens(ida_mem, tret, yysout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(C_PTR) :: yysout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(tret(1)) +farg3 = yysout +fresult = swigc_FIDAGetSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetSens1(ida_mem, tret, is, yysret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: yysret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = c_loc(tret(1)) +farg3 = is +farg4 = c_loc(yysret) +fresult = swigc_FIDAGetSens1(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetSensDky(ida_mem, t, k, dkys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(C_PTR) :: dkys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = dkys +fresult = swigc_FIDAGetSensDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetSensDky1(ida_mem, t, k, is, dkys) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: dkys +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = is +farg5 = c_loc(dkys) +fresult = swigc_FIDAGetSensDky1(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetSensNumResEvals(ida_mem, nressevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nressevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nressevals(1)) +fresult = swigc_FIDAGetSensNumResEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumResEvalsSens(ida_mem, nresevalss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nresevalss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nresevalss(1)) +fresult = swigc_FIDAGetNumResEvalsSens(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensNumErrTestFails(ida_mem, nsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsetfails(1)) +fresult = swigc_FIDAGetSensNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensNumLinSolvSetups(ida_mem, nlinsetupss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetupss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nlinsetupss(1)) +fresult = swigc_FIDAGetSensNumLinSolvSetups(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensErrWeights(ida_mem, esweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: esweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = esweight +fresult = swigc_FIDAGetSensErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensStats(ida_mem, nressevals, nresevalss, nsetfails, nlinsetupss) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nressevals +integer(C_LONG), dimension(*), target, intent(inout) :: nresevalss +integer(C_LONG), dimension(*), target, intent(inout) :: nsetfails +integer(C_LONG), dimension(*), target, intent(inout) :: nlinsetupss +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = c_loc(nressevals(1)) +farg3 = c_loc(nresevalss(1)) +farg4 = c_loc(nsetfails(1)) +farg5 = c_loc(nlinsetupss(1)) +fresult = swigc_FIDAGetSensStats(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetSensNumNonlinSolvIters(ida_mem, nsniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsniters(1)) +fresult = swigc_FIDAGetSensNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensNumNonlinSolvConvFails(ida_mem, nsnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsnfails(1)) +fresult = swigc_FIDAGetSensNumNonlinSolvConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetSensNonlinSolvStats(ida_mem, nsniters, nsnfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsniters +integer(C_LONG), dimension(*), target, intent(inout) :: nsnfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(nsniters(1)) +farg3 = c_loc(nsnfails(1)) +fresult = swigc_FIDAGetSensNonlinSolvStats(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumStepSensSolveFails(ida_mem, nsncfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nsncfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nsncfails(1)) +fresult = swigc_FIDAGetNumStepSensSolveFails(farg1, farg2) +swig_result = fresult +end function + +subroutine FIDASensFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = ida_mem +call swigc_FIDASensFree(farg1) +end subroutine + +function FIDAQuadSensInit(ida_mem, resqs, yqs0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: resqs +type(C_PTR) :: yqs0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = resqs +farg3 = yqs0 +fresult = swigc_FIDAQuadSensInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadSensReInit(ida_mem, yqs0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: yqs0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = yqs0 +fresult = swigc_FIDAQuadSensReInit(farg1, farg2) +swig_result = fresult +end function + +function FIDAQuadSensSStolerances(ida_mem, reltolqs, abstolqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltolqs +real(C_DOUBLE), dimension(*), target, intent(inout) :: abstolqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltolqs +farg3 = c_loc(abstolqs(1)) +fresult = swigc_FIDAQuadSensSStolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadSensSVtolerances(ida_mem, reltolqs, abstolqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: reltolqs +type(C_PTR) :: abstolqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = reltolqs +farg3 = abstolqs +fresult = swigc_FIDAQuadSensSVtolerances(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadSensEEtolerances(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDAQuadSensEEtolerances(farg1) +swig_result = fresult +end function + +function FIDASetQuadSensErrCon(ida_mem, errconqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: errconqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = errconqs +fresult = swigc_FIDASetQuadSensErrCon(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadSens(ida_mem, tret, yyqsout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(C_PTR) :: yyqsout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(tret(1)) +farg3 = yyqsout +fresult = swigc_FIDAGetQuadSens(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetQuadSens1(ida_mem, tret, is, yyqsret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: yyqsret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = c_loc(tret(1)) +farg3 = is +farg4 = c_loc(yyqsret) +fresult = swigc_FIDAGetQuadSens1(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetQuadSensDky(ida_mem, t, k, dkyqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +type(C_PTR) :: dkyqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = dkyqs +fresult = swigc_FIDAGetQuadSensDky(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetQuadSensDky1(ida_mem, t, k, is, dkyqs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: is +type(N_Vector), target, intent(inout) :: dkyqs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = t +farg3 = k +farg4 = is +farg5 = c_loc(dkyqs) +fresult = swigc_FIDAGetQuadSensDky1(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetQuadSensNumRhsEvals(ida_mem, nrhsqsevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrhsqsevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrhsqsevals(1)) +fresult = swigc_FIDAGetQuadSensNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadSensNumErrTestFails(ida_mem, nqsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nqsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nqsetfails(1)) +fresult = swigc_FIDAGetQuadSensNumErrTestFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadSensErrWeights(ida_mem, eqsweight) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR) :: eqsweight +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = eqsweight +fresult = swigc_FIDAGetQuadSensErrWeights(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetQuadSensStats(ida_mem, nrhsqsevals, nqsetfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrhsqsevals +integer(C_LONG), dimension(*), target, intent(inout) :: nqsetfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(nrhsqsevals(1)) +farg3 = c_loc(nqsetfails(1)) +fresult = swigc_FIDAGetQuadSensStats(farg1, farg2, farg3) +swig_result = fresult +end function + +subroutine FIDAQuadSensFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = ida_mem +call swigc_FIDAQuadSensFree(farg1) +end subroutine + +function FIDAAdjInit(ida_mem, steps, interp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), intent(in) :: steps +integer(C_INT), intent(in) :: interp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = steps +farg3 = interp +fresult = swigc_FIDAAdjInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAAdjReInit(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDAAdjReInit(farg1) +swig_result = fresult +end function + +subroutine FIDAAdjFree(ida_mem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: ida_mem +type(C_PTR) :: farg1 + +farg1 = ida_mem +call swigc_FIDAAdjFree(farg1) +end subroutine + +function FIDACreateB(ida_mem, which) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), dimension(*), target, intent(inout) :: which +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(which(1)) +fresult = swigc_FIDACreateB(farg1, farg2) +swig_result = fresult +end function + +function FIDAInitB(ida_mem, which, resb, tb0, yyb0, ypb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: resb +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yyb0 +type(N_Vector), target, intent(inout) :: ypb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = ida_mem +farg2 = which +farg3 = resb +farg4 = tb0 +farg5 = c_loc(yyb0) +farg6 = c_loc(ypb0) +fresult = swigc_FIDAInitB(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FIDAInitBS(ida_mem, which, ress, tb0, yyb0, ypb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: ress +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yyb0 +type(N_Vector), target, intent(inout) :: ypb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = ida_mem +farg2 = which +farg3 = ress +farg4 = tb0 +farg5 = c_loc(yyb0) +farg6 = c_loc(ypb0) +fresult = swigc_FIDAInitBS(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FIDAReInitB(ida_mem, which, tb0, yyb0, ypb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: tb0 +type(N_Vector), target, intent(inout) :: yyb0 +type(N_Vector), target, intent(inout) :: ypb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = tb0 +farg4 = c_loc(yyb0) +farg5 = c_loc(ypb0) +fresult = swigc_FIDAReInitB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDASStolerancesB(ida_mem, which, reltolb, abstolb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolb +real(C_DOUBLE), intent(in) :: abstolb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = reltolb +farg4 = abstolb +fresult = swigc_FIDASStolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASVtolerancesB(ida_mem, which, reltolb, abstolb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolb +type(N_Vector), target, intent(inout) :: abstolb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = reltolb +farg4 = c_loc(abstolb) +fresult = swigc_FIDASVtolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAQuadInitB(ida_mem, which, rhsqb, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: rhsqb +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = rhsqb +farg4 = c_loc(yqb0) +fresult = swigc_FIDAQuadInitB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAQuadInitBS(ida_mem, which, rhsqs, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: rhsqs +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = rhsqs +farg4 = c_loc(yqb0) +fresult = swigc_FIDAQuadInitBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAQuadReInitB(ida_mem, which, yqb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: yqb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(yqb0) +fresult = swigc_FIDAQuadReInitB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAQuadSStolerancesB(ida_mem, which, reltolqb, abstolqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolqb +real(C_DOUBLE), intent(in) :: abstolqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = reltolqb +farg4 = abstolqb +fresult = swigc_FIDAQuadSStolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAQuadSVtolerancesB(ida_mem, which, reltolqb, abstolqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: reltolqb +type(N_Vector), target, intent(inout) :: abstolqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = reltolqb +farg4 = c_loc(abstolqb) +fresult = swigc_FIDAQuadSVtolerancesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDACalcICB(ida_mem, which, tout1, yy0, yp0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: tout1 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = tout1 +farg4 = c_loc(yy0) +farg5 = c_loc(yp0) +fresult = swigc_FIDACalcICB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDACalcICBS(ida_mem, which, tout1, yy0, yp0, yys0, yps0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: tout1 +type(N_Vector), target, intent(inout) :: yy0 +type(N_Vector), target, intent(inout) :: yp0 +type(C_PTR) :: yys0 +type(C_PTR) :: yps0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = ida_mem +farg2 = which +farg3 = tout1 +farg4 = c_loc(yy0) +farg5 = c_loc(yp0) +farg6 = yys0 +farg7 = yps0 +fresult = swigc_FIDACalcICBS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FIDASolveF(ida_mem, tout, tret, yret, ypret, itask, ncheckptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tout +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: yret +type(N_Vector), target, intent(inout) :: ypret +integer(C_INT), intent(in) :: itask +integer(C_INT), dimension(*), target, intent(inout) :: ncheckptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 +integer(C_INT) :: farg6 +type(C_PTR) :: farg7 + +farg1 = ida_mem +farg2 = tout +farg3 = c_loc(tret(1)) +farg4 = c_loc(yret) +farg5 = c_loc(ypret) +farg6 = itask +farg7 = c_loc(ncheckptr(1)) +fresult = swigc_FIDASolveF(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FIDASolveB(ida_mem, tbout, itaskb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: tbout +integer(C_INT), intent(in) :: itaskb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = tbout +farg3 = itaskb +fresult = swigc_FIDASolveB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAAdjSetNoSensi(ida_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = ida_mem +fresult = swigc_FIDAAdjSetNoSensi(farg1) +swig_result = fresult +end function + +function FIDASetUserDataB(ida_mem, which, user_datab) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_PTR) :: user_datab +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = user_datab +fresult = swigc_FIDASetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetMaxOrdB(ida_mem, which, maxordb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: maxordb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = maxordb +fresult = swigc_FIDASetMaxOrdB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetMaxNumStepsB(ida_mem, which, mxstepsb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_LONG), intent(in) :: mxstepsb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_LONG) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = mxstepsb +fresult = swigc_FIDASetMaxNumStepsB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetInitStepB(ida_mem, which, hinb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: hinb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = hinb +fresult = swigc_FIDASetInitStepB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetMaxStepB(ida_mem, which, hmaxb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: hmaxb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = hmaxb +fresult = swigc_FIDASetMaxStepB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetSuppressAlgB(ida_mem, which, suppressalgb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: suppressalgb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = suppressalgb +fresult = swigc_FIDASetSuppressAlgB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetIdB(ida_mem, which, idb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: idb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(idb) +fresult = swigc_FIDASetIdB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetConstraintsB(ida_mem, which, constraintsb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: constraintsb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(constraintsb) +fresult = swigc_FIDASetConstraintsB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetQuadErrConB(ida_mem, which, errconqb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: errconqb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = errconqb +fresult = swigc_FIDASetQuadErrConB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetNonlinearSolverB(ida_mem, which, nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(nls) +fresult = swigc_FIDASetNonlinearSolverB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetB(ida_mem, which, tret, yy, yp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: yy +type(N_Vector), target, intent(inout) :: yp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(tret(1)) +farg4 = c_loc(yy) +farg5 = c_loc(yp) +fresult = swigc_FIDAGetB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetQuadB(ida_mem, which, tret, qb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +type(N_Vector), target, intent(inout) :: qb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(tret(1)) +farg4 = c_loc(qb) +fresult = swigc_FIDAGetQuadB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetAdjIDABmem(ida_mem, which) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = which +fresult = swigc_FIDAGetAdjIDABmem(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetConsistentICB(ida_mem, which, yyb0, ypb0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(N_Vector), target, intent(inout) :: yyb0 +type(N_Vector), target, intent(inout) :: ypb0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(yyb0) +farg4 = c_loc(ypb0) +fresult = swigc_FIDAGetConsistentICB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDAGetAdjY(ida_mem, t, yy, yp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: yy +type(N_Vector), target, intent(inout) :: yp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = t +farg3 = c_loc(yy) +farg4 = c_loc(yp) +fresult = swigc_FIDAGetAdjY(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_my_addr_set(self, my_addr) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +type(C_PTR) :: my_addr +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = my_addr +call swigc_IDAadjCheckPointRec_my_addr_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_my_addr_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_my_addr_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_next_addr_set(self, next_addr) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +type(C_PTR) :: next_addr +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = next_addr +call swigc_IDAadjCheckPointRec_next_addr_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_next_addr_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_next_addr_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_t0_set(self, t0) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: t0 +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = t0 +call swigc_IDAadjCheckPointRec_t0_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_t0_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_t0_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_t1_set(self, t1) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: t1 +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = t1 +call swigc_IDAadjCheckPointRec_t1_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_t1_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_t1_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_nstep_set(self, nstep) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +integer(C_LONG), intent(in) :: nstep +type(SwigClassWrapper) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = self%swigdata +farg2 = nstep +call swigc_IDAadjCheckPointRec_nstep_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_nstep_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_LONG) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +integer(C_LONG) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_nstep_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_order_set(self, order) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = order +call swigc_IDAadjCheckPointRec_order_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_order_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_order_get(farg1) +swig_result = fresult +end function + +subroutine swigf_IDAadjCheckPointRec_step_set(self, step) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE), intent(in) :: step +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = step +call swigc_IDAadjCheckPointRec_step_set(farg1, farg2) +end subroutine + +function swigf_IDAadjCheckPointRec_step_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(IDAadjCheckPointRec), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_IDAadjCheckPointRec_step_get(farg1) +swig_result = fresult +end function + +function swigf_create_IDAadjCheckPointRec() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(IDAadjCheckPointRec) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_IDAadjCheckPointRec() +self%swigdata = fresult +end function + +subroutine swigf_release_IDAadjCheckPointRec(self) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_IDAadjCheckPointRec(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_IDAadjCheckPointRec_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(IDAadjCheckPointRec), intent(inout) :: self +type(IDAadjCheckPointRec), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_IDAadjCheckPointRec_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FIDAGetAdjCheckPointsInfo(ida_mem, ckpnt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +class(IDAadjCheckPointRec), intent(in) :: ckpnt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = ida_mem +farg2 = ckpnt%swigdata +fresult = swigc_FIDAGetAdjCheckPointsInfo(farg1, farg2) +swig_result = fresult +end function + +function FIDASetJacTimesResFnB(ida_mem, which, jtimesresfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtimesresfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = jtimesresfn +fresult = swigc_FIDASetJacTimesResFnB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetAdjDataPointHermite(ida_mem, which, t, yy, yd) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: t +type(N_Vector), target, intent(inout) :: yy +type(N_Vector), target, intent(inout) :: yd +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(t(1)) +farg4 = c_loc(yy) +farg5 = c_loc(yd) +fresult = swigc_FIDAGetAdjDataPointHermite(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetAdjDataPointPolynomial(ida_mem, which, t, order, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), dimension(*), target, intent(inout) :: t +integer(C_INT), dimension(*), target, intent(inout) :: order +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(t(1)) +farg4 = c_loc(order(1)) +farg5 = c_loc(y) +fresult = swigc_FIDAGetAdjDataPointPolynomial(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDAGetAdjCurrentCheckPoint(ida_mem, addr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: addr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(addr) +fresult = swigc_FIDAGetAdjCurrentCheckPoint(farg1, farg2) +swig_result = fresult +end function + +function FIDABBDPrecInit(ida_mem, nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, gres, gcomm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dq_rel_yy +type(C_FUNPTR), intent(in), value :: gres +type(C_FUNPTR), intent(in), value :: gcomm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = ida_mem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dq_rel_yy +farg8 = gres +farg9 = gcomm +fresult = swigc_FIDABBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FIDABBDPrecReInit(ida_mem, mudq, mldq, dq_rel_yy) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +real(C_DOUBLE), intent(in) :: dq_rel_yy +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +real(C_DOUBLE) :: farg4 + +farg1 = ida_mem +farg2 = mudq +farg3 = mldq +farg4 = dq_rel_yy +fresult = swigc_FIDABBDPrecReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDABBDPrecGetWorkSpace(ida_mem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FIDABBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDABBDPrecGetNumGfnEvals(ida_mem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FIDABBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDABBDPrecInitB(ida_mem, which, nlocalb, mudqb, mldqb, mukeepb, mlkeepb, dq_rel_yyb, gresb, gcommb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT32_T), intent(in) :: nlocalb +integer(C_INT32_T), intent(in) :: mudqb +integer(C_INT32_T), intent(in) :: mldqb +integer(C_INT32_T), intent(in) :: mukeepb +integer(C_INT32_T), intent(in) :: mlkeepb +real(C_DOUBLE), intent(in) :: dq_rel_yyb +type(C_FUNPTR), intent(in), value :: gresb +type(C_FUNPTR), intent(in), value :: gcommb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +integer(C_INT32_T) :: farg7 +real(C_DOUBLE) :: farg8 +type(C_FUNPTR) :: farg9 +type(C_FUNPTR) :: farg10 + +farg1 = ida_mem +farg2 = which +farg3 = nlocalb +farg4 = mudqb +farg5 = mldqb +farg6 = mukeepb +farg7 = mlkeepb +farg8 = dq_rel_yyb +farg9 = gresb +farg10 = gcommb +fresult = swigc_FIDABBDPrecInitB(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9, farg10) +swig_result = fresult +end function + +function FIDABBDPrecReInitB(ida_mem, which, mudqb, mldqb, dq_rel_yyb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT32_T), intent(in) :: mudqb +integer(C_INT32_T), intent(in) :: mldqb +real(C_DOUBLE), intent(in) :: dq_rel_yyb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = ida_mem +farg2 = which +farg3 = mudqb +farg4 = mldqb +farg5 = dq_rel_yyb +fresult = swigc_FIDABBDPrecReInitB(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FIDASetLinearSolver(ida_mem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FIDASetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetJacFn(ida_mem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = ida_mem +farg2 = jac +fresult = swigc_FIDASetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FIDASetPreconditioner(ida_mem, pset, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = pset +farg3 = psolve +fresult = swigc_FIDASetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetJacTimes(ida_mem, jtsetup, jtimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_FUNPTR), intent(in), value :: jtsetup +type(C_FUNPTR), intent(in), value :: jtimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = jtsetup +farg3 = jtimes +fresult = swigc_FIDASetJacTimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetEpsLin(ida_mem, eplifac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: eplifac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = eplifac +fresult = swigc_FIDASetEpsLin(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLSNormFactor(ida_mem, nrmfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: nrmfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = nrmfac +fresult = swigc_FIDASetLSNormFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDASetLinearSolutionScaling(ida_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = ida_mem +farg2 = onoff +fresult = swigc_FIDASetLinearSolutionScaling(farg1, farg2) +swig_result = fresult +end function + +function FIDASetIncrementFactor(ida_mem, dqincfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), intent(in) :: dqincfac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = ida_mem +farg2 = dqincfac +fresult = swigc_FIDASetIncrementFactor(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJac(ida_mem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(j) +fresult = swigc_FIDAGetJac(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacCj(ida_mem, cj_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: cj_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(cj_j(1)) +fresult = swigc_FIDAGetJacCj(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacTime(ida_mem, t_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: t_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(t_j(1)) +fresult = swigc_FIDAGetJacTime(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetJacNumSteps(ida_mem, nst_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nst_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nst_j(1)) +fresult = swigc_FIDAGetJacNumSteps(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLinWorkSpace(ida_mem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FIDAGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDAGetNumJacEvals(ida_mem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njevals(1)) +fresult = swigc_FIDAGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumPrecEvals(ida_mem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(npevals(1)) +fresult = swigc_FIDAGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumPrecSolves(ida_mem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FIDAGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinIters(ida_mem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nliters(1)) +fresult = swigc_FIDAGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinConvFails(ida_mem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FIDAGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumJTSetupEvals(ida_mem, njtsetups) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njtsetups +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njtsetups(1)) +fresult = swigc_FIDAGetNumJTSetupEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumJtimesEvals(ida_mem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FIDAGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetNumLinResEvals(ida_mem, nrevalsls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nrevalsls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(nrevalsls(1)) +fresult = swigc_FIDAGetNumLinResEvals(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLastLinFlag(ida_mem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = ida_mem +farg2 = c_loc(flag(1)) +fresult = swigc_FIDAGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FIDAGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FIDAGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FIDASetLinearSolverB(ida_mem, which, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(ls) +farg4 = c_loc(a) +fresult = swigc_FIDASetLinearSolverB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASetJacFnB(ida_mem, which, jacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = jacb +fresult = swigc_FIDASetJacFnB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetJacFnBS(ida_mem, which, jacbs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jacbs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = jacbs +fresult = swigc_FIDASetJacFnBS(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetEpsLinB(ida_mem, which, eplifacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: eplifacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = eplifacb +fresult = swigc_FIDASetEpsLinB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetLSNormFactorB(ida_mem, which, nrmfacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: nrmfacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = nrmfacb +fresult = swigc_FIDASetLSNormFactorB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetLinearSolutionScalingB(ida_mem, which, onoffb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +integer(C_INT), intent(in) :: onoffb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = onoffb +fresult = swigc_FIDASetLinearSolutionScalingB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetIncrementFactorB(ida_mem, which, dqincfacb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +real(C_DOUBLE), intent(in) :: dqincfacb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = dqincfacb +fresult = swigc_FIDASetIncrementFactorB(farg1, farg2, farg3) +swig_result = fresult +end function + +function FIDASetPreconditionerB(ida_mem, which, psetb, psolveb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: psetb +type(C_FUNPTR), intent(in), value :: psolveb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = psetb +farg4 = psolveb +fresult = swigc_FIDASetPreconditionerB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASetPreconditionerBS(ida_mem, which, psetbs, psolvebs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: psetbs +type(C_FUNPTR), intent(in), value :: psolvebs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = psetbs +farg4 = psolvebs +fresult = swigc_FIDASetPreconditionerBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASetJacTimesB(ida_mem, which, jtsetupb, jtimesb) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtsetupb +type(C_FUNPTR), intent(in), value :: jtimesb +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = jtsetupb +farg4 = jtimesb +fresult = swigc_FIDASetJacTimesB(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FIDASetJacTimesBS(ida_mem, which, jtsetupbs, jtimesbs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_FUNPTR), intent(in), value :: jtsetupbs +type(C_FUNPTR), intent(in), value :: jtimesbs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = ida_mem +farg2 = which +farg3 = jtsetupbs +farg4 = jtimesbs +fresult = swigc_FIDASetJacTimesBS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + + +end module diff --git a/src/idas/fmod_int64/CMakeLists.txt b/src/idas/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..a6abe6516b --- /dev/null +++ b/src/idas/fmod_int64/CMakeLists.txt @@ -0,0 +1,45 @@ +# --------------------------------------------------------------- +# Programmer: Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 IDAS object library + +set(idas_SOURCES fidas_mod.f90 fidas_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_fidas_mod + SOURCES + ${idas_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + sundials_fsunnonlinsolnewton_mod_obj + sundials_fsunnonlinsolfixedpoint_mod_obj + OUTPUT_NAME + sundials_fidas_mod + VERSION + ${idaslib_VERSION} + SOVERSION + ${idaslib_SOVERSION} +) +message(STATUS "Added IDAS F2003 interface") diff --git a/src/idas/fmod/fidas_mod.c b/src/idas/fmod_int64/fidas_mod.c similarity index 100% rename from src/idas/fmod/fidas_mod.c rename to src/idas/fmod_int64/fidas_mod.c diff --git a/src/idas/fmod/fidas_mod.f90 b/src/idas/fmod_int64/fidas_mod.f90 similarity index 100% rename from src/idas/fmod/fidas_mod.f90 rename to src/idas/fmod_int64/fidas_mod.f90 diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index e1353618ee..7306c3f449 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -71,5 +71,5 @@ message(STATUS "Added KINSOL module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/kinsol/fmod/CMakeLists.txt b/src/kinsol/fmod_int32/CMakeLists.txt similarity index 100% rename from src/kinsol/fmod/CMakeLists.txt rename to src/kinsol/fmod_int32/CMakeLists.txt diff --git a/src/kinsol/fmod_int32/fkinsol_mod.c b/src/kinsol/fmod_int32/fkinsol_mod.c new file mode 100644 index 0000000000..c8c99a75a1 --- /dev/null +++ b/src/kinsol/fmod_int32/fkinsol_mod.c @@ -0,0 +1,1092 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "kinsol/kinsol.h" +#include "kinsol/kinsol_bbdpre.h" +#include "kinsol/kinsol_ls.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + +SWIGEXPORT void * _wrap_FKINCreate(void *farg1) { + void * fresult ; + SUNContext arg1 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNContext)(farg1); + result = (void *)KINCreate(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FKINInit(void *farg1, KINSysFn farg2, N_Vector farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + KINSysFn arg2 = (KINSysFn) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINSysFn)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)KINInit(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSol(void *farg1, N_Vector farg2, int const *farg3, N_Vector farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (int)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + result = (int)KINSol(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void *)(farg2); + result = (int)KINSetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetDamping(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetDamping(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetMAA(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetMAA(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetOrthAA(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetOrthAA(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetDelayAA(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetDelayAA(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetDampingAA(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetDampingAA(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetReturnNewest(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetReturnNewest(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetNumMaxIters(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetNumMaxIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetNoInitSetup(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetNoInitSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetNoResMon(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetNoResMon(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetMaxSetupCalls(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetMaxSetupCalls(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetMaxSubSetupCalls(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetMaxSubSetupCalls(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetEtaForm(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetEtaForm(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetEtaConstValue(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetEtaConstValue(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetEtaParams(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)KINSetEtaParams(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetResMonParams(void *farg1, double const *farg2, double const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (int)KINSetResMonParams(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetResMonConstValue(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetResMonConstValue(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetNoMinEps(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)KINSetNoMinEps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetMaxNewtonStep(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetMaxNewtonStep(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetMaxBetaFails(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)KINSetMaxBetaFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetRelErrFunc(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetRelErrFunc(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetFuncNormTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetFuncNormTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetScaledStepTol(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)KINSetScaledStepTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetConstraints(void *farg1, N_Vector farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)KINSetConstraints(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetSysFunc(void *farg1, KINSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + KINSysFn arg2 = (KINSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINSysFn)(farg2); + result = (int)KINSetSysFunc(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)KINGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumNonlinSolvIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumNonlinSolvIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumFuncEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumFuncEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumBetaCondFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumBetaCondFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumBacktrackOps(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumBacktrackOps(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetFuncNorm(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)KINGetFuncNorm(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetStepLength(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)KINGetStepLength(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetUserData(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + void **arg2 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (void **)(farg2); + result = (int)KINGetUserData(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINPrintAllStats(void *farg1, void *farg2, int const *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNOutputFormat arg3 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (FILE *)(farg2); + arg3 = (SUNOutputFormat)(*farg3); + result = (int)KINPrintAllStats(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FKINGetReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)KINGetReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FKINFree(void *farg1) { + void **arg1 = (void **) 0 ; + + arg1 = (void **)(farg1); + KINFree(arg1); +} + + +SWIGEXPORT int _wrap_FKINSetJacTimesVecSysFn(void *farg1, KINSysFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + KINSysFn arg2 = (KINSysFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINSysFn)(farg2); + result = (int)KINSetJacTimesVecSysFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINBBDPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, int32_t const *farg5, int32_t const *farg6, double const *farg7, KINBBDLocalFn farg8, KINBBDCommFn farg9) { + int fresult ; + void *arg1 = (void *) 0 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + sunindextype arg5 ; + sunindextype arg6 ; + sunrealtype arg7 ; + KINBBDLocalFn arg8 = (KINBBDLocalFn) 0 ; + KINBBDCommFn arg9 = (KINBBDCommFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (sunindextype)(*farg5); + arg6 = (sunindextype)(*farg6); + arg7 = (sunrealtype)(*farg7); + arg8 = (KINBBDLocalFn)(farg8); + arg9 = (KINBBDCommFn)(farg9); + result = (int)KINBBDPrecInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINBBDPrecGetWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)KINBBDPrecGetWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINBBDPrecGetNumGfnEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINBBDPrecGetNumGfnEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetLinearSolver(void *farg1, SUNLinearSolver farg2, SUNMatrix farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNLinearSolver arg2 = (SUNLinearSolver) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNLinearSolver)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (int)KINSetLinearSolver(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetJacFn(void *farg1, KINLsJacFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + KINLsJacFn arg2 = (KINLsJacFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINLsJacFn)(farg2); + result = (int)KINSetJacFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetPreconditioner(void *farg1, KINLsPrecSetupFn farg2, KINLsPrecSolveFn farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + KINLsPrecSetupFn arg2 = (KINLsPrecSetupFn) 0 ; + KINLsPrecSolveFn arg3 = (KINLsPrecSolveFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINLsPrecSetupFn)(farg2); + arg3 = (KINLsPrecSolveFn)(farg3); + result = (int)KINSetPreconditioner(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINSetJacTimesVecFn(void *farg1, KINLsJacTimesVecFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + KINLsJacTimesVecFn arg2 = (KINLsJacTimesVecFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (KINLsJacTimesVecFn)(farg2); + result = (int)KINSetJacTimesVecFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetJac(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (int)KINGetJac(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetJacNumIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetJacNumIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetLinWorkSpace(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)KINGetLinWorkSpace(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumJacEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumJacEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumLinFuncEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumLinFuncEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumPrecEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumPrecEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumPrecSolves(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumPrecSolves(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumLinIters(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumLinIters(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumLinConvFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumLinConvFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetNumJtimesEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetNumJtimesEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FKINGetLastLinFlag(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)KINGetLastLinFlag(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FKINGetLinReturnFlagName(long const *farg1) { + SwigArrayWrapper fresult ; + long arg1 ; + char *result = 0 ; + + arg1 = (long)(*farg1); + result = (char *)KINGetLinReturnFlagName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + + diff --git a/src/kinsol/fmod_int32/fkinsol_mod.f90 b/src/kinsol/fmod_int32/fkinsol_mod.f90 new file mode 100644 index 0000000000..45e03047a6 --- /dev/null +++ b/src/kinsol/fmod_int32/fkinsol_mod.f90 @@ -0,0 +1,1696 @@ +! 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-2024, 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 fkinsol_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: KIN_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: KIN_INITIAL_GUESS_OK = 1_C_INT + integer(C_INT), parameter, public :: KIN_STEP_LT_STPTOL = 2_C_INT + integer(C_INT), parameter, public :: KIN_WARNING = 99_C_INT + integer(C_INT), parameter, public :: KIN_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: KIN_ILL_INPUT = -2_C_INT + integer(C_INT), parameter, public :: KIN_NO_MALLOC = -3_C_INT + integer(C_INT), parameter, public :: KIN_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: KIN_LINESEARCH_NONCONV = -5_C_INT + integer(C_INT), parameter, public :: KIN_MAXITER_REACHED = -6_C_INT + integer(C_INT), parameter, public :: KIN_MXNEWT_5X_EXCEEDED = -7_C_INT + integer(C_INT), parameter, public :: KIN_LINESEARCH_BCFAIL = -8_C_INT + integer(C_INT), parameter, public :: KIN_LINSOLV_NO_RECOVERY = -9_C_INT + integer(C_INT), parameter, public :: KIN_LINIT_FAIL = -10_C_INT + integer(C_INT), parameter, public :: KIN_LSETUP_FAIL = -11_C_INT + integer(C_INT), parameter, public :: KIN_LSOLVE_FAIL = -12_C_INT + integer(C_INT), parameter, public :: KIN_SYSFUNC_FAIL = -13_C_INT + integer(C_INT), parameter, public :: KIN_FIRST_SYSFUNC_ERR = -14_C_INT + integer(C_INT), parameter, public :: KIN_REPTD_SYSFUNC_ERR = -15_C_INT + integer(C_INT), parameter, public :: KIN_VECTOROP_ERR = -16_C_INT + integer(C_INT), parameter, public :: KIN_CONTEXT_ERR = -17_C_INT + integer(C_INT), parameter, public :: KIN_ORTH_MGS = 0_C_INT + integer(C_INT), parameter, public :: KIN_ORTH_ICWY = 1_C_INT + integer(C_INT), parameter, public :: KIN_ORTH_CGS2 = 2_C_INT + integer(C_INT), parameter, public :: KIN_ORTH_DCGS2 = 3_C_INT + integer(C_INT), parameter, public :: KIN_ETACHOICE1 = 1_C_INT + integer(C_INT), parameter, public :: KIN_ETACHOICE2 = 2_C_INT + integer(C_INT), parameter, public :: KIN_ETACONSTANT = 3_C_INT + integer(C_INT), parameter, public :: KIN_NONE = 0_C_INT + integer(C_INT), parameter, public :: KIN_LINESEARCH = 1_C_INT + integer(C_INT), parameter, public :: KIN_PICARD = 2_C_INT + integer(C_INT), parameter, public :: KIN_FP = 3_C_INT + public :: FKINCreate + public :: FKINInit + public :: FKINSol + public :: FKINSetUserData + public :: FKINSetDamping + public :: FKINSetMAA + public :: FKINSetOrthAA + public :: FKINSetDelayAA + public :: FKINSetDampingAA + public :: FKINSetReturnNewest + public :: FKINSetNumMaxIters + public :: FKINSetNoInitSetup + public :: FKINSetNoResMon + public :: FKINSetMaxSetupCalls + public :: FKINSetMaxSubSetupCalls + public :: FKINSetEtaForm + public :: FKINSetEtaConstValue + public :: FKINSetEtaParams + public :: FKINSetResMonParams + public :: FKINSetResMonConstValue + public :: FKINSetNoMinEps + public :: FKINSetMaxNewtonStep + public :: FKINSetMaxBetaFails + public :: FKINSetRelErrFunc + public :: FKINSetFuncNormTol + public :: FKINSetScaledStepTol + public :: FKINSetConstraints + public :: FKINSetSysFunc + public :: FKINGetWorkSpace + public :: FKINGetNumNonlinSolvIters + public :: FKINGetNumFuncEvals + public :: FKINGetNumBetaCondFails + public :: FKINGetNumBacktrackOps + public :: FKINGetFuncNorm + public :: FKINGetStepLength + public :: FKINGetUserData + public :: FKINPrintAllStats + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FKINGetReturnFlagName + public :: FKINFree + public :: FKINSetJacTimesVecSysFn + integer(C_INT), parameter, public :: KINBBDPRE_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: KINBBDPRE_PDATA_NULL = -11_C_INT + integer(C_INT), parameter, public :: KINBBDPRE_FUNC_UNRECVR = -12_C_INT + public :: FKINBBDPrecInit + public :: FKINBBDPrecGetWorkSpace + public :: FKINBBDPrecGetNumGfnEvals + integer(C_INT), parameter, public :: KINLS_SUCCESS = 0_C_INT + integer(C_INT), parameter, public :: KINLS_MEM_NULL = -1_C_INT + integer(C_INT), parameter, public :: KINLS_LMEM_NULL = -2_C_INT + integer(C_INT), parameter, public :: KINLS_ILL_INPUT = -3_C_INT + integer(C_INT), parameter, public :: KINLS_MEM_FAIL = -4_C_INT + integer(C_INT), parameter, public :: KINLS_PMEM_NULL = -5_C_INT + integer(C_INT), parameter, public :: KINLS_JACFUNC_ERR = -6_C_INT + integer(C_INT), parameter, public :: KINLS_SUNMAT_FAIL = -7_C_INT + integer(C_INT), parameter, public :: KINLS_SUNLS_FAIL = -8_C_INT + public :: FKINSetLinearSolver + public :: FKINSetJacFn + public :: FKINSetPreconditioner + public :: FKINSetJacTimesVecFn + public :: FKINGetJac + public :: FKINGetJacNumIters + public :: FKINGetLinWorkSpace + public :: FKINGetNumJacEvals + public :: FKINGetNumLinFuncEvals + public :: FKINGetNumPrecEvals + public :: FKINGetNumPrecSolves + public :: FKINGetNumLinIters + public :: FKINGetNumLinConvFails + public :: FKINGetNumJtimesEvals + public :: FKINGetLastLinFlag + public :: FKINGetLinReturnFlagName + +! WRAPPER DECLARATIONS +interface +function swigc_FKINCreate(farg1) & +bind(C, name="_wrap_FKINCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FKINInit(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINInit") & +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_FKINSol(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FKINSol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetUserData(farg1, farg2) & +bind(C, name="_wrap_FKINSetUserData") & +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_FKINSetDamping(farg1, farg2) & +bind(C, name="_wrap_FKINSetDamping") & +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_FKINSetMAA(farg1, farg2) & +bind(C, name="_wrap_FKINSetMAA") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetOrthAA(farg1, farg2) & +bind(C, name="_wrap_FKINSetOrthAA") & +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_FKINSetDelayAA(farg1, farg2) & +bind(C, name="_wrap_FKINSetDelayAA") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetDampingAA(farg1, farg2) & +bind(C, name="_wrap_FKINSetDampingAA") & +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_FKINSetReturnNewest(farg1, farg2) & +bind(C, name="_wrap_FKINSetReturnNewest") & +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_FKINSetNumMaxIters(farg1, farg2) & +bind(C, name="_wrap_FKINSetNumMaxIters") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetNoInitSetup(farg1, farg2) & +bind(C, name="_wrap_FKINSetNoInitSetup") & +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_FKINSetNoResMon(farg1, farg2) & +bind(C, name="_wrap_FKINSetNoResMon") & +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_FKINSetMaxSetupCalls(farg1, farg2) & +bind(C, name="_wrap_FKINSetMaxSetupCalls") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetMaxSubSetupCalls(farg1, farg2) & +bind(C, name="_wrap_FKINSetMaxSubSetupCalls") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetEtaForm(farg1, farg2) & +bind(C, name="_wrap_FKINSetEtaForm") & +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_FKINSetEtaConstValue(farg1, farg2) & +bind(C, name="_wrap_FKINSetEtaConstValue") & +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_FKINSetEtaParams(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINSetEtaParams") & +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_FKINSetResMonParams(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINSetResMonParams") & +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_FKINSetResMonConstValue(farg1, farg2) & +bind(C, name="_wrap_FKINSetResMonConstValue") & +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_FKINSetNoMinEps(farg1, farg2) & +bind(C, name="_wrap_FKINSetNoMinEps") & +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_FKINSetMaxNewtonStep(farg1, farg2) & +bind(C, name="_wrap_FKINSetMaxNewtonStep") & +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_FKINSetMaxBetaFails(farg1, farg2) & +bind(C, name="_wrap_FKINSetMaxBetaFails") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetRelErrFunc(farg1, farg2) & +bind(C, name="_wrap_FKINSetRelErrFunc") & +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_FKINSetFuncNormTol(farg1, farg2) & +bind(C, name="_wrap_FKINSetFuncNormTol") & +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_FKINSetScaledStepTol(farg1, farg2) & +bind(C, name="_wrap_FKINSetScaledStepTol") & +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_FKINSetConstraints(farg1, farg2) & +bind(C, name="_wrap_FKINSetConstraints") & +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_FKINSetSysFunc(farg1, farg2) & +bind(C, name="_wrap_FKINSetSysFunc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINGetWorkSpace") & +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_FKINGetNumNonlinSolvIters(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumNonlinSolvIters") & +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_FKINGetNumFuncEvals(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumFuncEvals") & +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_FKINGetNumBetaCondFails(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumBetaCondFails") & +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_FKINGetNumBacktrackOps(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumBacktrackOps") & +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_FKINGetFuncNorm(farg1, farg2) & +bind(C, name="_wrap_FKINGetFuncNorm") & +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_FKINGetStepLength(farg1, farg2) & +bind(C, name="_wrap_FKINGetStepLength") & +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_FKINGetUserData(farg1, farg2) & +bind(C, name="_wrap_FKINGetUserData") & +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_FKINPrintAllStats(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINPrintAllStats") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FKINGetReturnFlagName(farg1) & +bind(C, name="_wrap_FKINGetReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +subroutine swigc_FKINFree(farg1) & +bind(C, name="_wrap_FKINFree") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FKINSetJacTimesVecSysFn(farg1, farg2) & +bind(C, name="_wrap_FKINSetJacTimesVecSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) & +bind(C, name="_wrap_FKINBBDPrecInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +integer(C_INT32_T), intent(in) :: farg5 +integer(C_INT32_T), intent(in) :: farg6 +real(C_DOUBLE), intent(in) :: farg7 +type(C_FUNPTR), value :: farg8 +type(C_FUNPTR), value :: farg9 +integer(C_INT) :: fresult +end function + +function swigc_FKINBBDPrecGetWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINBBDPrecGetWorkSpace") & +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_FKINBBDPrecGetNumGfnEvals(farg1, farg2) & +bind(C, name="_wrap_FKINBBDPrecGetNumGfnEvals") & +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_FKINSetLinearSolver(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINSetLinearSolver") & +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_FKINSetJacFn(farg1, farg2) & +bind(C, name="_wrap_FKINSetJacFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetPreconditioner(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FKINSetJacTimesVecFn(farg1, farg2) & +bind(C, name="_wrap_FKINSetJacTimesVecFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FKINGetJac(farg1, farg2) & +bind(C, name="_wrap_FKINGetJac") & +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_FKINGetJacNumIters(farg1, farg2) & +bind(C, name="_wrap_FKINGetJacNumIters") & +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_FKINGetLinWorkSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FKINGetLinWorkSpace") & +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_FKINGetNumJacEvals(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumJacEvals") & +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_FKINGetNumLinFuncEvals(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumLinFuncEvals") & +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_FKINGetNumPrecEvals(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumPrecEvals") & +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_FKINGetNumPrecSolves(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumPrecSolves") & +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_FKINGetNumLinIters(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumLinIters") & +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_FKINGetNumLinConvFails(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumLinConvFails") & +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_FKINGetNumJtimesEvals(farg1, farg2) & +bind(C, name="_wrap_FKINGetNumJtimesEvals") & +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_FKINGetLastLinFlag(farg1, farg2) & +bind(C, name="_wrap_FKINGetLastLinFlag") & +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_FKINGetLinReturnFlagName(farg1) & +bind(C, name="_wrap_FKINGetLinReturnFlagName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_LONG), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FKINCreate(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FKINCreate(farg1) +swig_result = fresult +end function + +function FKINInit(kinmem, func, tmpl) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: func +type(N_Vector), target, intent(inout) :: tmpl +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = kinmem +farg2 = func +farg3 = c_loc(tmpl) +fresult = swigc_FKINInit(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINSol(kinmem, uu, strategy, u_scale, f_scale) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(N_Vector), target, intent(inout) :: uu +integer(C_INT), intent(in) :: strategy +type(N_Vector), target, intent(inout) :: u_scale +type(N_Vector), target, intent(inout) :: f_scale +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = kinmem +farg2 = c_loc(uu) +farg3 = strategy +farg4 = c_loc(u_scale) +farg5 = c_loc(f_scale) +fresult = swigc_FKINSol(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FKINSetUserData(kinmem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_PTR) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = user_data +fresult = swigc_FKINSetUserData(farg1, farg2) +swig_result = fresult +end function + +function FKINSetDamping(kinmem, beta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: beta +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = beta +fresult = swigc_FKINSetDamping(farg1, farg2) +swig_result = fresult +end function + +function FKINSetMAA(kinmem, maa) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: maa +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = maa +fresult = swigc_FKINSetMAA(farg1, farg2) +swig_result = fresult +end function + +function FKINSetOrthAA(kinmem, orthaa) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: orthaa +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = orthaa +fresult = swigc_FKINSetOrthAA(farg1, farg2) +swig_result = fresult +end function + +function FKINSetDelayAA(kinmem, delay) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: delay +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = delay +fresult = swigc_FKINSetDelayAA(farg1, farg2) +swig_result = fresult +end function + +function FKINSetDampingAA(kinmem, beta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: beta +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = beta +fresult = swigc_FKINSetDampingAA(farg1, farg2) +swig_result = fresult +end function + +function FKINSetReturnNewest(kinmem, ret_newest) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: ret_newest +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = ret_newest +fresult = swigc_FKINSetReturnNewest(farg1, farg2) +swig_result = fresult +end function + +function FKINSetNumMaxIters(kinmem, mxiter) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: mxiter +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = mxiter +fresult = swigc_FKINSetNumMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FKINSetNoInitSetup(kinmem, noinitsetup) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: noinitsetup +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = noinitsetup +fresult = swigc_FKINSetNoInitSetup(farg1, farg2) +swig_result = fresult +end function + +function FKINSetNoResMon(kinmem, nonniresmon) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: nonniresmon +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = nonniresmon +fresult = swigc_FKINSetNoResMon(farg1, farg2) +swig_result = fresult +end function + +function FKINSetMaxSetupCalls(kinmem, msbset) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: msbset +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = msbset +fresult = swigc_FKINSetMaxSetupCalls(farg1, farg2) +swig_result = fresult +end function + +function FKINSetMaxSubSetupCalls(kinmem, msbsetsub) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: msbsetsub +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = msbsetsub +fresult = swigc_FKINSetMaxSubSetupCalls(farg1, farg2) +swig_result = fresult +end function + +function FKINSetEtaForm(kinmem, etachoice) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: etachoice +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = etachoice +fresult = swigc_FKINSetEtaForm(farg1, farg2) +swig_result = fresult +end function + +function FKINSetEtaConstValue(kinmem, eta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: eta +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = eta +fresult = swigc_FKINSetEtaConstValue(farg1, farg2) +swig_result = fresult +end function + +function FKINSetEtaParams(kinmem, egamma, ealpha) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: egamma +real(C_DOUBLE), intent(in) :: ealpha +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = kinmem +farg2 = egamma +farg3 = ealpha +fresult = swigc_FKINSetEtaParams(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINSetResMonParams(kinmem, omegamin, omegamax) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: omegamin +real(C_DOUBLE), intent(in) :: omegamax +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 + +farg1 = kinmem +farg2 = omegamin +farg3 = omegamax +fresult = swigc_FKINSetResMonParams(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINSetResMonConstValue(kinmem, omegaconst) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: omegaconst +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = omegaconst +fresult = swigc_FKINSetResMonConstValue(farg1, farg2) +swig_result = fresult +end function + +function FKINSetNoMinEps(kinmem, nomineps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT), intent(in) :: nomineps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = kinmem +farg2 = nomineps +fresult = swigc_FKINSetNoMinEps(farg1, farg2) +swig_result = fresult +end function + +function FKINSetMaxNewtonStep(kinmem, mxnewtstep) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: mxnewtstep +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = mxnewtstep +fresult = swigc_FKINSetMaxNewtonStep(farg1, farg2) +swig_result = fresult +end function + +function FKINSetMaxBetaFails(kinmem, mxnbcf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), intent(in) :: mxnbcf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = kinmem +farg2 = mxnbcf +fresult = swigc_FKINSetMaxBetaFails(farg1, farg2) +swig_result = fresult +end function + +function FKINSetRelErrFunc(kinmem, relfunc) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: relfunc +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = relfunc +fresult = swigc_FKINSetRelErrFunc(farg1, farg2) +swig_result = fresult +end function + +function FKINSetFuncNormTol(kinmem, fnormtol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: fnormtol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = fnormtol +fresult = swigc_FKINSetFuncNormTol(farg1, farg2) +swig_result = fresult +end function + +function FKINSetScaledStepTol(kinmem, scsteptol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), intent(in) :: scsteptol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = kinmem +farg2 = scsteptol +fresult = swigc_FKINSetScaledStepTol(farg1, farg2) +swig_result = fresult +end function + +function FKINSetConstraints(kinmem, constraints) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(N_Vector), target, intent(inout) :: constraints +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(constraints) +fresult = swigc_FKINSetConstraints(farg1, farg2) +swig_result = fresult +end function + +function FKINSetSysFunc(kinmem, func) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: func +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = kinmem +farg2 = func +fresult = swigc_FKINSetSysFunc(farg1, farg2) +swig_result = fresult +end function + +function FKINGetWorkSpace(kinmem, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +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 = kinmem +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FKINGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINGetNumNonlinSolvIters(kinmem, nniters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nniters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nniters(1)) +fresult = swigc_FKINGetNumNonlinSolvIters(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumFuncEvals(kinmem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FKINGetNumFuncEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumBetaCondFails(kinmem, nbcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nbcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nbcfails(1)) +fresult = swigc_FKINGetNumBetaCondFails(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumBacktrackOps(kinmem, nbacktr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nbacktr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nbacktr(1)) +fresult = swigc_FKINGetNumBacktrackOps(farg1, farg2) +swig_result = fresult +end function + +function FKINGetFuncNorm(kinmem, fnorm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), dimension(*), target, intent(inout) :: fnorm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(fnorm(1)) +fresult = swigc_FKINGetFuncNorm(farg1, farg2) +swig_result = fresult +end function + +function FKINGetStepLength(kinmem, steplength) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +real(C_DOUBLE), dimension(*), target, intent(inout) :: steplength +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(steplength(1)) +fresult = swigc_FKINGetStepLength(farg1, farg2) +swig_result = fresult +end function + +function FKINGetUserData(kinmem, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(user_data) +fresult = swigc_FKINGetUserData(farg1, farg2) +swig_result = fresult +end function + +function FKINPrintAllStats(kinmem, outfile, fmt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_PTR) :: outfile +integer(SUNOutputFormat), intent(in) :: fmt +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 + +farg1 = kinmem +farg2 = outfile +farg3 = fmt +fresult = swigc_FKINPrintAllStats(farg1, farg2, farg3) +swig_result = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FKINGetReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FKINGetReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +subroutine FKINFree(kinmem) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: kinmem +type(C_PTR) :: farg1 + +farg1 = c_loc(kinmem) +call swigc_FKINFree(farg1) +end subroutine + +function FKINSetJacTimesVecSysFn(kinmem, jtimessysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: jtimessysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = kinmem +farg2 = jtimessysfn +fresult = swigc_FKINSetJacTimesVecSysFn(farg1, farg2) +swig_result = fresult +end function + +function FKINBBDPrecInit(kinmem, nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_uu, gloc, gcomm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_INT32_T), intent(in) :: nlocal +integer(C_INT32_T), intent(in) :: mudq +integer(C_INT32_T), intent(in) :: mldq +integer(C_INT32_T), intent(in) :: mukeep +integer(C_INT32_T), intent(in) :: mlkeep +real(C_DOUBLE), intent(in) :: dq_rel_uu +type(C_FUNPTR), intent(in), value :: gloc +type(C_FUNPTR), intent(in), value :: gcomm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +integer(C_INT32_T) :: farg5 +integer(C_INT32_T) :: farg6 +real(C_DOUBLE) :: farg7 +type(C_FUNPTR) :: farg8 +type(C_FUNPTR) :: farg9 + +farg1 = kinmem +farg2 = nlocal +farg3 = mudq +farg4 = mldq +farg5 = mukeep +farg6 = mlkeep +farg7 = dq_rel_uu +farg8 = gloc +farg9 = gcomm +fresult = swigc_FKINBBDPrecInit(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8, farg9) +swig_result = fresult +end function + +function FKINBBDPrecGetWorkSpace(kinmem, lenrwbbdp, leniwbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwbbdp +integer(C_LONG), dimension(*), target, intent(inout) :: leniwbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = kinmem +farg2 = c_loc(lenrwbbdp(1)) +farg3 = c_loc(leniwbbdp(1)) +fresult = swigc_FKINBBDPrecGetWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINBBDPrecGetNumGfnEvals(kinmem, ngevalsbbdp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: ngevalsbbdp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(ngevalsbbdp(1)) +fresult = swigc_FKINBBDPrecGetNumGfnEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINSetLinearSolver(kinmem, ls, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(SUNLinearSolver), target, intent(inout) :: ls +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = kinmem +farg2 = c_loc(ls) +farg3 = c_loc(a) +fresult = swigc_FKINSetLinearSolver(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINSetJacFn(kinmem, jac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: jac +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = kinmem +farg2 = jac +fresult = swigc_FKINSetJacFn(farg1, farg2) +swig_result = fresult +end function + +function FKINSetPreconditioner(kinmem, psetup, psolve) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: psetup +type(C_FUNPTR), intent(in), value :: psolve +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = kinmem +farg2 = psetup +farg3 = psolve +fresult = swigc_FKINSetPreconditioner(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINSetJacTimesVecFn(kinmem, jtv) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_FUNPTR), intent(in), value :: jtv +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = kinmem +farg2 = jtv +fresult = swigc_FKINSetJacTimesVecFn(farg1, farg2) +swig_result = fresult +end function + +function FKINGetJac(kinmem, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +type(C_PTR), target, intent(inout) :: j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(j) +fresult = swigc_FKINGetJac(farg1, farg2) +swig_result = fresult +end function + +function FKINGetJacNumIters(kinmem, nni_j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nni_j +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nni_j(1)) +fresult = swigc_FKINGetJacNumIters(farg1, farg2) +swig_result = fresult +end function + +function FKINGetLinWorkSpace(kinmem, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = kinmem +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FKINGetLinWorkSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FKINGetNumJacEvals(kinmem, njevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: njevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(njevals(1)) +fresult = swigc_FKINGetNumJacEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumLinFuncEvals(kinmem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FKINGetNumLinFuncEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumPrecEvals(kinmem, npevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: npevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(npevals(1)) +fresult = swigc_FKINGetNumPrecEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumPrecSolves(kinmem, npsolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: npsolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(npsolves(1)) +fresult = swigc_FKINGetNumPrecSolves(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumLinIters(kinmem, nliters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nliters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nliters(1)) +fresult = swigc_FKINGetNumLinIters(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumLinConvFails(kinmem, nlcfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: nlcfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(nlcfails(1)) +fresult = swigc_FKINGetNumLinConvFails(farg1, farg2) +swig_result = fresult +end function + +function FKINGetNumJtimesEvals(kinmem, njvevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: njvevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(njvevals(1)) +fresult = swigc_FKINGetNumJtimesEvals(farg1, farg2) +swig_result = fresult +end function + +function FKINGetLastLinFlag(kinmem, flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: kinmem +integer(C_LONG), dimension(*), target, intent(inout) :: flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = kinmem +farg2 = c_loc(flag(1)) +fresult = swigc_FKINGetLastLinFlag(farg1, farg2) +swig_result = fresult +end function + +function FKINGetLinReturnFlagName(flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_LONG), intent(in) :: flag +type(SwigArrayWrapper) :: fresult +integer(C_LONG) :: farg1 + +farg1 = flag +fresult = swigc_FKINGetLinReturnFlagName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + + +end module diff --git a/src/kinsol/fmod_int64/CMakeLists.txt b/src/kinsol/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..a154a8b865 --- /dev/null +++ b/src/kinsol/fmod_int64/CMakeLists.txt @@ -0,0 +1,45 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 KINSOL object library +# --------------------------------------------------------------- + +set(kinsol_SOURCES fkinsol_mod.f90 fkinsol_mod.c) + +# Create the library +sundials_add_f2003_library(sundials_fkinsol_mod + SOURCES + ${kinsol_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + sundials_fnvecserial_mod_obj + sundials_fsunmatrixband_mod_obj + sundials_fsunmatrixdense_mod_obj + sundials_fsunmatrixsparse_mod_obj + sundials_fsunlinsolband_mod_obj + sundials_fsunlinsoldense_mod_obj + sundials_fsunlinsolspbcgs_mod_obj + sundials_fsunlinsolspfgmr_mod_obj + sundials_fsunlinsolspgmr_mod_obj + sundials_fsunlinsolsptfqmr_mod_obj + sundials_fsunlinsolpcg_mod_obj + OUTPUT_NAME + sundials_fkinsol_mod + VERSION + ${kinsollib_VERSION} + SOVERSION + ${kinsollib_SOVERSION} +) + +message(STATUS "Added KINSOL F2003 interface") diff --git a/src/kinsol/fmod/fkinsol_mod.c b/src/kinsol/fmod_int64/fkinsol_mod.c similarity index 100% rename from src/kinsol/fmod/fkinsol_mod.c rename to src/kinsol/fmod_int64/fkinsol_mod.c diff --git a/src/kinsol/fmod/fkinsol_mod.f90 b/src/kinsol/fmod_int64/fkinsol_mod.f90 similarity index 100% rename from src/kinsol/fmod/fkinsol_mod.f90 rename to src/kinsol/fmod_int64/fkinsol_mod.f90 diff --git a/src/nvector/manyvector/CMakeLists.txt b/src/nvector/manyvector/CMakeLists.txt index 00ee0d4372..4080f60ffc 100644 --- a/src/nvector/manyvector/CMakeLists.txt +++ b/src/nvector/manyvector/CMakeLists.txt @@ -76,5 +76,5 @@ endif() # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/manyvector/fmod/CMakeLists.txt b/src/nvector/manyvector/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/manyvector/fmod/CMakeLists.txt rename to src/nvector/manyvector/fmod_int32/CMakeLists.txt diff --git a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c new file mode 100644 index 0000000000..39cc98fdf7 --- /dev/null +++ b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c @@ -0,0 +1,1007 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_manyvector.h" + +SWIGEXPORT N_Vector _wrap_FN_VNew_ManyVector(int32_t const *farg1, void *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNew_ManyVector(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VGetSubvector_ManyVector(N_Vector farg1, int32_t const *farg2) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (N_Vector)N_VGetSubvector_ManyVector(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VSetSubvectorArrayPointer_ManyVector(double *farg1, N_Vector farg2, int32_t const *farg3) { + int fresult ; + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunindextype arg3 ; + SUNErrCode result; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunindextype)(*farg3); + result = (SUNErrCode)N_VSetSubvectorArrayPointer_ManyVector(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetNumSubvectors_ManyVector(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetNumSubvectors_ManyVector(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_ManyVector(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_ManyVector(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_ManyVector(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_ManyVector(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_ManyVector(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_ManyVector(arg1,arg2); +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_ManyVector(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_ManyVector(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_ManyVector(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_ManyVector(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_ManyVector(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_ManyVector(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_ManyVector(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_ManyVector(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_ManyVector(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetSubvectorLocalLength_ManyVector(N_Vector farg1, int32_t const *farg2) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = N_VGetSubvectorLocalLength_ManyVector(arg1,arg2); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_ManyVector(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_ManyVector(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_ManyVector(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_ManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_ManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_ManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_ManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_ManyVector(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_ManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_ManyVector(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_ManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_ManyVector(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_ManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_ManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_ManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_ManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_ManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_ManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_ManyVector(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_ManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_ManyVector(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_ManyVector(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_ManyVector(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_ManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_ManyVector(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_ManyVector(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_ManyVector(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_ManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_ManyVector(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_ManyVector(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_ManyVector(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_ManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_ManyVector(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_ManyVector(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VDotProdLocal_ManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProdLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNormLocal_ManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNormLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinLocal_ManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMinLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1NormLocal_ManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1NormLocal_ManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_ManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_ManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_ManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VInvTestLocal_ManyVector(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTestLocal_ManyVector(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMaskLocal_ManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMaskLocal_ManyVector(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotientLocal_ManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotientLocal_ManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiLocal_ManyVector(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMultiLocal_ManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_ManyVector(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_ManyVector(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_ManyVector(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_ManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMultiLocal_ManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int64_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 new file mode 100644 index 0000000000..a9e0c7ea09 --- /dev/null +++ b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.f90 @@ -0,0 +1,1557 @@ +! 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-2024, 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 fnvector_manyvector_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VNew_ManyVector + public :: FN_VGetSubvector_ManyVector + public :: FN_VSetSubvectorArrayPointer_ManyVector + public :: FN_VGetNumSubvectors_ManyVector + public :: FN_VGetVectorID_ManyVector + public :: FN_VPrint_ManyVector + public :: FN_VPrintFile_ManyVector + public :: FN_VCloneEmpty_ManyVector + public :: FN_VClone_ManyVector + public :: FN_VDestroy_ManyVector + public :: FN_VSpace_ManyVector + public :: FN_VGetLength_ManyVector + public :: FN_VGetSubvectorLocalLength_ManyVector + public :: FN_VLinearSum_ManyVector + public :: FN_VConst_ManyVector + public :: FN_VProd_ManyVector + public :: FN_VDiv_ManyVector + public :: FN_VScale_ManyVector + public :: FN_VAbs_ManyVector + public :: FN_VInv_ManyVector + public :: FN_VAddConst_ManyVector + public :: FN_VWrmsNorm_ManyVector + public :: FN_VWrmsNormMask_ManyVector + public :: FN_VWL2Norm_ManyVector + public :: FN_VCompare_ManyVector + public :: FN_VLinearCombination_ManyVector + public :: FN_VScaleAddMulti_ManyVector + public :: FN_VDotProdMulti_ManyVector + public :: FN_VLinearSumVectorArray_ManyVector + public :: FN_VScaleVectorArray_ManyVector + public :: FN_VConstVectorArray_ManyVector + public :: FN_VWrmsNormVectorArray_ManyVector + public :: FN_VWrmsNormMaskVectorArray_ManyVector + public :: FN_VDotProdLocal_ManyVector + public :: FN_VMaxNormLocal_ManyVector + public :: FN_VMinLocal_ManyVector + public :: FN_VL1NormLocal_ManyVector + public :: FN_VWSqrSumLocal_ManyVector + public :: FN_VWSqrSumMaskLocal_ManyVector + public :: FN_VInvTestLocal_ManyVector + public :: FN_VConstrMaskLocal_ManyVector + public :: FN_VMinQuotientLocal_ManyVector + public :: FN_VDotProdMultiLocal_ManyVector + public :: FN_VBufSize_ManyVector + public :: FN_VBufPack_ManyVector + public :: FN_VBufUnpack_ManyVector + public :: FN_VEnableFusedOps_ManyVector + public :: FN_VEnableLinearCombination_ManyVector + public :: FN_VEnableScaleAddMulti_ManyVector + public :: FN_VEnableDotProdMulti_ManyVector + public :: FN_VEnableLinearSumVectorArray_ManyVector + public :: FN_VEnableScaleVectorArray_ManyVector + public :: FN_VEnableConstVectorArray_ManyVector + public :: FN_VEnableWrmsNormVectorArray_ManyVector + public :: FN_VEnableWrmsNormMaskVectorArray_ManyVector + public :: FN_VEnableDotProdMultiLocal_ManyVector + + public :: FN_VGetSubvectorArrayPointer_ManyVector + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VNew_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNew_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetSubvector_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvector_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VSetSubvectorArrayPointer_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSetSubvectorArrayPointer_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VGetNumSubvectors_ManyVector(farg1) & +bind(C, name="_wrap_FN_VGetNumSubvectors_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetVectorID_ManyVector(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FN_VPrint_ManyVector(farg1) & +bind(C, name="_wrap_FN_VPrint_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VCloneEmpty_ManyVector(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_ManyVector(farg1) & +bind(C, name="_wrap_FN_VClone_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_ManyVector(farg1) & +bind(C, name="_wrap_FN_VDestroy_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VGetLength_ManyVector(farg1) & +bind(C, name="_wrap_FN_VGetLength_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetSubvectorLocalLength_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvectorLocalLength_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VLinearSum_ManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_ManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_ManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_ManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_ManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VWrmsNorm_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_ManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VLinearCombination_ManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_ManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_ManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_ManyVector(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_ManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_ManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_ManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdLocal_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProdLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNormLocal_ManyVector(farg1) & +bind(C, name="_wrap_FN_VMaxNormLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMinLocal_ManyVector(farg1) & +bind(C, name="_wrap_FN_VMinLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1NormLocal_ManyVector(farg1) & +bind(C, name="_wrap_FN_VL1NormLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VInvTestLocal_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTestLocal_ManyVector") & +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_FN_VConstrMaskLocal_ManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMaskLocal_ManyVector") & +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_FN_VMinQuotientLocal_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotientLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VDotProdMultiLocal_ManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMultiLocal_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VBufSize_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_ManyVector") & +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_FN_VBufPack_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_ManyVector") & +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_FN_VBufUnpack_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_ManyVector") & +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_FN_VEnableFusedOps_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_ManyVector") & +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_FN_VEnableLinearCombination_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_ManyVector") & +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_FN_VEnableScaleAddMulti_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_ManyVector") & +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_FN_VEnableDotProdMulti_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_ManyVector") & +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_FN_VEnableLinearSumVectorArray_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_ManyVector") & +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_FN_VEnableScaleVectorArray_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_ManyVector") & +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_FN_VEnableConstVectorArray_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_ManyVector") & +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_FN_VEnableWrmsNormVectorArray_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_ManyVector") & +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_FN_VEnableWrmsNormMaskVectorArray_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_ManyVector") & +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_FN_VEnableDotProdMultiLocal_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMultiLocal_ManyVector") & +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_FN_VGetSubvectorArrayPointer_ManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvectorArrayPointer_ManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else +integer(C_INT64_T), intent(in) :: farg2 +#endif +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VNew_ManyVector(num_subvectors, vec_array, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: num_subvectors +type(C_PTR) :: vec_array +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = num_subvectors +farg2 = vec_array +farg3 = sunctx +fresult = swigc_FN_VNew_ManyVector(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetSubvector_ManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvector_ManyVector(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VSetSubvectorArrayPointer_ManyVector(v_data, v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT32_T) :: farg3 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +farg3 = vec_num +fresult = swigc_FN_VSetSubvectorArrayPointer_ManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VGetNumSubvectors_ManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetNumSubvectors_ManyVector(farg1) +swig_result = fresult +end function + +function FN_VGetVectorID_ManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_ManyVector(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_ManyVector(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_ManyVector(farg1) +end subroutine + +subroutine FN_VPrintFile_ManyVector(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_ManyVector(farg1, farg2) +end subroutine + +function FN_VCloneEmpty_ManyVector(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_ManyVector(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_ManyVector(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_ManyVector(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_ManyVector(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_ManyVector(farg1) +end subroutine + +subroutine FN_VSpace_ManyVector(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_ManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VGetLength_ManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_ManyVector(farg1) +swig_result = fresult +end function + +function FN_VGetSubvectorLocalLength_ManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvectorLocalLength_ManyVector(farg1, farg2) +swig_result = fresult +end function + +subroutine FN_VLinearSum_ManyVector(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_ManyVector(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_ManyVector(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_ManyVector(farg1, farg2) +end subroutine + +subroutine FN_VProd_ManyVector(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_ManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_ManyVector(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_ManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_ManyVector(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_ManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_ManyVector(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_ManyVector(farg1, farg2) +end subroutine + +subroutine FN_VInv_ManyVector(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_ManyVector(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_ManyVector(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_ManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VWrmsNorm_ManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_ManyVector(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_ManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWL2Norm_ManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_ManyVector(farg1, farg2) +swig_result = fresult +end function + +subroutine FN_VCompare_ManyVector(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_ManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VLinearCombination_ManyVector(nvec, c, v, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: v +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = v +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_ManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_ManyVector(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_ManyVector(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_ManyVector(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_ManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_ManyVector(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_ManyVector(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_ManyVector(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_ManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_ManyVector(nvecs, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvecs +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_ManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_ManyVector(nvecs, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_ManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_ManyVector(nvec, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_ManyVector(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdLocal_ManyVector(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProdLocal_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNormLocal_ManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNormLocal_ManyVector(farg1) +swig_result = fresult +end function + +function FN_VMinLocal_ManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMinLocal_ManyVector(farg1) +swig_result = fresult +end function + +function FN_VL1NormLocal_ManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1NormLocal_ManyVector(farg1) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_ManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_ManyVector(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_ManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VInvTestLocal_ManyVector(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTestLocal_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMaskLocal_ManyVector(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMaskLocal_ManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotientLocal_ManyVector(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotientLocal_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VDotProdMultiLocal_ManyVector(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMultiLocal_ManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VBufSize_ManyVector(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_ManyVector(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_ManyVector(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_ManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMultiLocal_ManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMultiLocal_ManyVector(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetSubvectorArrayPointer_ManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else +integer(C_INT64_T), intent(in) :: vec_num +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvectorArrayPointer_ManyVector(farg1, farg2) +call c_f_pointer(fresult, swig_result, [FN_VGetSubvectorLocalLength_ManyVector(v, vec_num)]) +end function + + +end module diff --git a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c new file mode 100644 index 0000000000..b567955a3d --- /dev/null +++ b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c @@ -0,0 +1,1167 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_mpimanyvector.h" + +SWIGEXPORT N_Vector _wrap_FN_VMake_MPIManyVector(int const *farg1, int32_t const *farg2, void *farg3, void *farg4) { + N_Vector fresult ; + MPI_Comm arg1 ; + sunindextype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + N_Vector result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (sunindextype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (SUNContext)(farg4); + result = (N_Vector)N_VMake_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNew_MPIManyVector(int32_t const *farg1, void *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNew_MPIManyVector(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VGetSubvector_MPIManyVector(N_Vector farg1, int32_t const *farg2) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (N_Vector)N_VGetSubvector_MPIManyVector(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VSetSubvectorArrayPointer_MPIManyVector(double *farg1, N_Vector farg2, int32_t const *farg3) { + int fresult ; + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunindextype arg3 ; + SUNErrCode result; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunindextype)(*farg3); + result = (SUNErrCode)N_VSetSubvectorArrayPointer_MPIManyVector(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetNumSubvectors_MPIManyVector(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetNumSubvectors_MPIManyVector(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_MPIManyVector(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_MPIManyVector(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_MPIManyVector(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_MPIManyVector(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_MPIManyVector(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_MPIManyVector(arg1,arg2); +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_MPIManyVector(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_MPIManyVector(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_MPIManyVector(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_MPIManyVector(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_MPIManyVector(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_MPIManyVector(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_MPIManyVector(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VGetCommunicator_MPIManyVector(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + MPI_Comm result; + + arg1 = (N_Vector)(farg1); + result = N_VGetCommunicator_MPIManyVector(arg1); +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + fresult = (int)(MPI_Comm_c2f(result)); + } else { + fresult = 0; + } +#else + fresult = result; +#endif + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_MPIManyVector(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_MPIManyVector(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetSubvectorLocalLength_MPIManyVector(N_Vector farg1, int32_t const *farg2) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = N_VGetSubvectorLocalLength_MPIManyVector(arg1,arg2); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_MPIManyVector(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_MPIManyVector(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_MPIManyVector(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_MPIManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_MPIManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_MPIManyVector(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_MPIManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_MPIManyVector(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_MPIManyVector(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_MPIManyVector(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_MPIManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_MPIManyVector(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_MPIManyVector(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest_MPIManyVector(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest_MPIManyVector(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask_MPIManyVector(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_MPIManyVector(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_MPIManyVector(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_MPIManyVector(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_MPIManyVector(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiLocal_MPIManyVector(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMultiLocal_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce_MPIManyVector(int const *farg1, N_Vector farg2, double *farg3) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype *)(farg3); + result = (SUNErrCode)N_VDotProdMultiAllReduce_MPIManyVector(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_MPIManyVector(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_MPIManyVector(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_MPIManyVector(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_MPIManyVector(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_MPIManyVector(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_MPIManyVector(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_MPIManyVector(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_MPIManyVector(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_MPIManyVector(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VDotProdLocal_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProdLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNormLocal_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNormLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinLocal_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMinLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1NormLocal_MPIManyVector(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1NormLocal_MPIManyVector(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_MPIManyVector(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VInvTestLocal_MPIManyVector(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTestLocal_MPIManyVector(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMaskLocal_MPIManyVector(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMaskLocal_MPIManyVector(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotientLocal_MPIManyVector(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotientLocal_MPIManyVector(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_MPIManyVector(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_MPIManyVector(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_MPIManyVector(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_MPIManyVector(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMultiLocal_MPIManyVector(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int64_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 new file mode 100644 index 0000000000..2226643c27 --- /dev/null +++ b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.f90 @@ -0,0 +1,1817 @@ +! 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-2024, 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 fnvector_mpimanyvector_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VMake_MPIManyVector + public :: FN_VNew_MPIManyVector + public :: FN_VGetSubvector_MPIManyVector + public :: FN_VSetSubvectorArrayPointer_MPIManyVector + public :: FN_VGetNumSubvectors_MPIManyVector + public :: FN_VGetVectorID_MPIManyVector + public :: FN_VPrint_MPIManyVector + public :: FN_VPrintFile_MPIManyVector + public :: FN_VCloneEmpty_MPIManyVector + public :: FN_VClone_MPIManyVector + public :: FN_VDestroy_MPIManyVector + public :: FN_VSpace_MPIManyVector + public :: FN_VGetCommunicator_MPIManyVector + public :: FN_VGetLength_MPIManyVector + public :: FN_VGetSubvectorLocalLength_MPIManyVector + public :: FN_VLinearSum_MPIManyVector + public :: FN_VConst_MPIManyVector + public :: FN_VProd_MPIManyVector + public :: FN_VDiv_MPIManyVector + public :: FN_VScale_MPIManyVector + public :: FN_VAbs_MPIManyVector + public :: FN_VInv_MPIManyVector + public :: FN_VAddConst_MPIManyVector + public :: FN_VDotProd_MPIManyVector + public :: FN_VMaxNorm_MPIManyVector + public :: FN_VWrmsNorm_MPIManyVector + public :: FN_VWrmsNormMask_MPIManyVector + public :: FN_VMin_MPIManyVector + public :: FN_VWL2Norm_MPIManyVector + public :: FN_VL1Norm_MPIManyVector + public :: FN_VCompare_MPIManyVector + public :: FN_VInvTest_MPIManyVector + public :: FN_VConstrMask_MPIManyVector + public :: FN_VMinQuotient_MPIManyVector + public :: FN_VLinearCombination_MPIManyVector + public :: FN_VScaleAddMulti_MPIManyVector + public :: FN_VDotProdMulti_MPIManyVector + public :: FN_VDotProdMultiLocal_MPIManyVector + public :: FN_VDotProdMultiAllReduce_MPIManyVector + public :: FN_VLinearSumVectorArray_MPIManyVector + public :: FN_VScaleVectorArray_MPIManyVector + public :: FN_VConstVectorArray_MPIManyVector + public :: FN_VWrmsNormVectorArray_MPIManyVector + public :: FN_VWrmsNormMaskVectorArray_MPIManyVector + public :: FN_VDotProdLocal_MPIManyVector + public :: FN_VMaxNormLocal_MPIManyVector + public :: FN_VMinLocal_MPIManyVector + public :: FN_VL1NormLocal_MPIManyVector + public :: FN_VWSqrSumLocal_MPIManyVector + public :: FN_VWSqrSumMaskLocal_MPIManyVector + public :: FN_VInvTestLocal_MPIManyVector + public :: FN_VConstrMaskLocal_MPIManyVector + public :: FN_VMinQuotientLocal_MPIManyVector + public :: FN_VBufSize_MPIManyVector + public :: FN_VBufPack_MPIManyVector + public :: FN_VBufUnpack_MPIManyVector + public :: FN_VEnableFusedOps_MPIManyVector + public :: FN_VEnableLinearCombination_MPIManyVector + public :: FN_VEnableScaleAddMulti_MPIManyVector + public :: FN_VEnableDotProdMulti_MPIManyVector + public :: FN_VEnableLinearSumVectorArray_MPIManyVector + public :: FN_VEnableScaleVectorArray_MPIManyVector + public :: FN_VEnableConstVectorArray_MPIManyVector + public :: FN_VEnableWrmsNormVectorArray_MPIManyVector + public :: FN_VEnableWrmsNormMaskVectorArray_MPIManyVector + public :: FN_VEnableDotProdMultiLocal_MPIManyVector + + public :: FN_VGetSubvectorArrayPointer_MPIManyVector + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VMake_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VMake_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FN_VNew_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNew_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetSubvector_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvector_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VSetSubvectorArrayPointer_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSetSubvectorArrayPointer_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VGetNumSubvectors_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VGetNumSubvectors_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetVectorID_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FN_VPrint_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VPrint_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VCloneEmpty_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VClone_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VDestroy_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VGetCommunicator_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VGetCommunicator_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VGetLength_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VGetLength_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetSubvectorLocalLength_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvectorLocalLength_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VLinearSum_MPIManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VMaxNorm_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VMin_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VL1Norm_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_MPIManyVector") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest_MPIManyVector") & +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_FN_VConstrMask_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask_MPIManyVector") & +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_FN_VMinQuotient_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_MPIManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMultiLocal_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMultiLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMultiAllReduce_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDotProdMultiAllReduce_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_MPIManyVector(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_MPIManyVector(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_MPIManyVector(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdLocal_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProdLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNormLocal_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VMaxNormLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMinLocal_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VMinLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1NormLocal_MPIManyVector(farg1) & +bind(C, name="_wrap_FN_VL1NormLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VInvTestLocal_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTestLocal_MPIManyVector") & +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_FN_VConstrMaskLocal_MPIManyVector(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMaskLocal_MPIManyVector") & +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_FN_VMinQuotientLocal_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotientLocal_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VBufSize_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_MPIManyVector") & +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_FN_VBufPack_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_MPIManyVector") & +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_FN_VBufUnpack_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_MPIManyVector") & +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_FN_VEnableFusedOps_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_MPIManyVector") & +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_FN_VEnableLinearCombination_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_MPIManyVector") & +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_FN_VEnableScaleAddMulti_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_MPIManyVector") & +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_FN_VEnableDotProdMulti_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_MPIManyVector") & +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_FN_VEnableLinearSumVectorArray_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_MPIManyVector") & +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_FN_VEnableScaleVectorArray_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_MPIManyVector") & +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_FN_VEnableConstVectorArray_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_MPIManyVector") & +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_FN_VEnableWrmsNormVectorArray_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_MPIManyVector") & +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_FN_VEnableWrmsNormMaskVectorArray_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_MPIManyVector") & +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_FN_VEnableDotProdMultiLocal_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMultiLocal_MPIManyVector") & +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_FN_VGetSubvectorArrayPointer_MPIManyVector(farg1, farg2) & +bind(C, name="_wrap_FN_VGetSubvectorArrayPointer_MPIManyVector") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else +integer(C_INT64_T), intent(in) :: farg2 +#endif +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VMake_MPIManyVector(comm, num_subvectors, vec_array, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer :: comm +integer(C_INT32_T), intent(in) :: num_subvectors +type(C_PTR) :: vec_array +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT32_T) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = int(comm, C_INT) +farg2 = num_subvectors +farg3 = vec_array +farg4 = sunctx +fresult = swigc_FN_VMake_MPIManyVector(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VNew_MPIManyVector(num_subvectors, vec_array, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: num_subvectors +type(C_PTR) :: vec_array +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = num_subvectors +farg2 = vec_array +farg3 = sunctx +fresult = swigc_FN_VNew_MPIManyVector(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetSubvector_MPIManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvector_MPIManyVector(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VSetSubvectorArrayPointer_MPIManyVector(v_data, v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT32_T) :: farg3 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +farg3 = vec_num +fresult = swigc_FN_VSetSubvectorArrayPointer_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VGetNumSubvectors_MPIManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetNumSubvectors_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VGetVectorID_MPIManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_MPIManyVector(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_MPIManyVector(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_MPIManyVector(farg1) +end subroutine + +subroutine FN_VPrintFile_MPIManyVector(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_MPIManyVector(farg1, farg2) +end subroutine + +function FN_VCloneEmpty_MPIManyVector(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_MPIManyVector(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_MPIManyVector(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_MPIManyVector(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_MPIManyVector(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_MPIManyVector(farg1) +end subroutine + +subroutine FN_VSpace_MPIManyVector(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_MPIManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VGetCommunicator_MPIManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetCommunicator_MPIManyVector(farg1) +swig_result = int(fresult) +end function + +function FN_VGetLength_MPIManyVector(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VGetSubvectorLocalLength_MPIManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), intent(in) :: vec_num +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvectorLocalLength_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +subroutine FN_VLinearSum_MPIManyVector(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_MPIManyVector(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_MPIManyVector(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_MPIManyVector(farg1, farg2) +end subroutine + +subroutine FN_VProd_MPIManyVector(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_MPIManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_MPIManyVector(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_MPIManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_MPIManyVector(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_MPIManyVector(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_MPIManyVector(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_MPIManyVector(farg1, farg2) +end subroutine + +subroutine FN_VInv_MPIManyVector(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_MPIManyVector(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_MPIManyVector(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_MPIManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd_MPIManyVector(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm_MPIManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_MPIManyVector(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm_MPIManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm_MPIManyVector(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare_MPIManyVector(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_MPIManyVector(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest_MPIManyVector(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask_MPIManyVector(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient_MPIManyVector(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination_MPIManyVector(nvec, c, v, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: v +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = v +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_MPIManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_MPIManyVector(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_MPIManyVector(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_MPIManyVector(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_MPIManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VDotProdMultiLocal_MPIManyVector(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMultiLocal_MPIManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VDotProdMultiAllReduce_MPIManyVector(nvec_total, x, sum) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec_total +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), dimension(*), target, intent(inout) :: sum +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvec_total +farg2 = c_loc(x) +farg3 = c_loc(sum(1)) +fresult = swigc_FN_VDotProdMultiAllReduce_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_MPIManyVector(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_MPIManyVector(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_MPIManyVector(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_MPIManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_MPIManyVector(nvecs, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvecs +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_MPIManyVector(nvecs, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_MPIManyVector(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_MPIManyVector(nvec, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_MPIManyVector(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdLocal_MPIManyVector(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProdLocal_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNormLocal_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNormLocal_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VMinLocal_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMinLocal_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VL1NormLocal_MPIManyVector(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1NormLocal_MPIManyVector(farg1) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_MPIManyVector(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_MPIManyVector(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VInvTestLocal_MPIManyVector(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTestLocal_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMaskLocal_MPIManyVector(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMaskLocal_MPIManyVector(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotientLocal_MPIManyVector(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotientLocal_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufSize_MPIManyVector(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_MPIManyVector(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_MPIManyVector(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMultiLocal_MPIManyVector(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMultiLocal_MPIManyVector(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetSubvectorArrayPointer_MPIManyVector(v, vec_num) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else +integer(C_INT64_T), intent(in) :: vec_num +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif + +farg1 = c_loc(v) +farg2 = vec_num +fresult = swigc_FN_VGetSubvectorArrayPointer_MPIManyVector(farg1, farg2) +call c_f_pointer(fresult, swig_result, [FN_VGetSubvectorLocalLength_MPIManyVector(v, vec_num)]) +end function + + +end module diff --git a/src/nvector/manyvector/fmod_int64/CMakeLists.txt b/src/nvector/manyvector/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..8033da01f7 --- /dev/null +++ b/src/nvector/manyvector/fmod_int64/CMakeLists.txt @@ -0,0 +1,61 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 manyvector NVECTOR object library +# --------------------------------------------------------------- + +if(BUILD_NVECTOR_MANYVECTOR) + sundials_add_f2003_library(sundials_fnvecmanyvector_mod + SOURCES + fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OUTPUT_NAME + sundials_fnvecmanyvector_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} + ) + message(STATUS "Added NVECTOR_MANYVECTOR F2003 Interface") +endif() + +if(BUILD_NVECTOR_MPIMANYVECTOR) + + if(MPI_C_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) + elseif() + # add MPI_INCLUDE_PATH to include directories + include_directories(${MPI_INCLUDE_PATH}) + endif() + if(MPI_Fortran_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) + endif() + + sundials_add_f2003_library(sundials_fnvecmpimanyvector_mod + SOURCES + fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OUTPUT_NAME + sundials_fnvecmpimanyvector_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} + ) + + message(STATUS "Added NVECTOR_MPIMANYVECTOR F2003 Interface") +endif() diff --git a/src/nvector/manyvector/fmod/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c similarity index 100% rename from src/nvector/manyvector/fmod/fnvector_manyvector_mod.c rename to src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c diff --git a/src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 b/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 similarity index 99% rename from src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 rename to src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 index 1c747bb028..88587dc2f3 100644 --- a/src/nvector/manyvector/fmod/fnvector_manyvector_mod.f90 +++ b/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.f90 @@ -596,7 +596,11 @@ function swigc_FN_VGetSubvectorArrayPointer_ManyVector(farg1, farg2) & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function @@ -1530,10 +1534,18 @@ function FN_VGetSubvectorArrayPointer_ManyVector(v, vec_num) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else integer(C_INT64_T), intent(in) :: vec_num +#endif type(C_PTR) :: fresult type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(v) farg2 = vec_num diff --git a/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c similarity index 100% rename from src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c rename to src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c diff --git a/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 b/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 similarity index 99% rename from src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 rename to src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 index d214fc462b..39d48fa9be 100644 --- a/src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.f90 +++ b/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.f90 @@ -696,7 +696,11 @@ function swigc_FN_VGetSubvectorArrayPointer_MPIManyVector(farg1, farg2) & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function @@ -1790,10 +1794,18 @@ function FN_VGetSubvectorArrayPointer_MPIManyVector(v, vec_num) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else integer(C_INT64_T), intent(in) :: vec_num +#endif type(C_PTR) :: fresult type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(v) farg2 = vec_num diff --git a/src/nvector/mpiplusx/CMakeLists.txt b/src/nvector/mpiplusx/CMakeLists.txt index c97db8224a..1be179696d 100644 --- a/src/nvector/mpiplusx/CMakeLists.txt +++ b/src/nvector/mpiplusx/CMakeLists.txt @@ -48,5 +48,5 @@ message(STATUS "Added NVECTOR_MPIPLUSX module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/mpiplusx/fmod/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/mpiplusx/fmod/CMakeLists.txt rename to src/nvector/mpiplusx/fmod_int32/CMakeLists.txt diff --git a/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c b/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c new file mode 100644 index 0000000000..5d6aeb893d --- /dev/null +++ b/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.c @@ -0,0 +1,327 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_mpiplusx.h" + +SWIGEXPORT N_Vector _wrap_FN_VMake_MPIPlusX(int const *farg1, N_Vector farg2, void *farg3) { + N_Vector fresult ; + MPI_Comm arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (N_Vector)(farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VMake_MPIPlusX(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_MPIPlusX(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_MPIPlusX(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer_MPIPlusX(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer_MPIPlusX(arg1,arg2); +} + + +SWIGEXPORT N_Vector _wrap_FN_VGetLocalVector_MPIPlusX(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VGetLocalVector_MPIPlusX(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLocalLength_MPIPlusX(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLocalLength_MPIPlusX(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_MPIPlusX(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_MPIPlusX(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_MPIPlusX(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_MPIPlusX(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_MPIPlusX(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_MPIPlusX(arg1,arg2); +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer_MPIPlusX(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer_MPIPlusX(arg1); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 b/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 new file mode 100644 index 0000000000..1b29334b59 --- /dev/null +++ b/src/nvector/mpiplusx/fmod_int32/fnvector_mpiplusx_mod.f90 @@ -0,0 +1,241 @@ +! 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-2024, 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 fnvector_mpiplusx_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VMake_MPIPlusX + public :: FN_VGetVectorID_MPIPlusX + public :: FN_VSetArrayPointer_MPIPlusX + public :: FN_VGetLocalVector_MPIPlusX + public :: FN_VGetLocalLength_MPIPlusX + public :: FN_VEnableFusedOps_MPIPlusX + public :: FN_VPrint_MPIPlusX + public :: FN_VPrintFile_MPIPlusX + + public :: FN_VGetArrayPointer_MPIPlusX + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VMake_MPIPlusX(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VMake_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetVectorID_MPIPlusX(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FN_VSetArrayPointer_MPIPlusX(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer_MPIPlusX") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetLocalVector_MPIPlusX(farg1) & +bind(C, name="_wrap_FN_VGetLocalVector_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetLocalLength_MPIPlusX(farg1) & +bind(C, name="_wrap_FN_VGetLocalLength_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VEnableFusedOps_MPIPlusX(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_FN_VPrint_MPIPlusX(farg1) & +bind(C, name="_wrap_FN_VPrint_MPIPlusX") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_MPIPlusX(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_MPIPlusX") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + + +function swigc_FN_VGetArrayPointer_MPIPlusX(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer_MPIPlusX") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VMake_MPIPlusX(comm, x, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer :: comm +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = int(comm, C_INT) +farg2 = c_loc(x) +farg3 = sunctx +fresult = swigc_FN_VMake_MPIPlusX(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetVectorID_MPIPlusX(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_MPIPlusX(farg1) +swig_result = fresult +end function + +subroutine FN_VSetArrayPointer_MPIPlusX(vdata, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: vdata +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(vdata(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer_MPIPlusX(farg1, farg2) +end subroutine + +function FN_VGetLocalVector_MPIPlusX(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLocalVector_MPIPlusX(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetLocalLength_MPIPlusX(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLocalLength_MPIPlusX(farg1) +swig_result = fresult +end function + +function FN_VEnableFusedOps_MPIPlusX(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_MPIPlusX(farg1, farg2) +swig_result = fresult +end function + +subroutine FN_VPrint_MPIPlusX(x) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +call swigc_FN_VPrint_MPIPlusX(farg1) +end subroutine + +subroutine FN_VPrintFile_MPIPlusX(x, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = outfile +call swigc_FN_VPrintFile_MPIPlusX(farg1, farg2) +end subroutine + + +function FN_VGetArrayPointer_MPIPlusX(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer_MPIPlusX(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLocalLength_MPIPlusX(v)]) +end function + + +end module diff --git a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..d068b3609f --- /dev/null +++ b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt @@ -0,0 +1,43 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 MPIPlusX NVECTOR object library +# --------------------------------------------------------------- + +if(MPI_C_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) +elseif() + # add MPI_INCLUDE_PATH to include directories + include_directories(${MPI_INCLUDE_PATH}) +endif() +if(MPI_Fortran_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) +endif() + +sundials_add_f2003_library(sundials_fnvecmpiplusx_mod + SOURCES + fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fnvecmpiplusx_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} +) + +message(STATUS "Added NVECTOR_MPIPLUSX F2003 interface") diff --git a/src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.c b/src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.c similarity index 100% rename from src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.c rename to src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.c diff --git a/src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.f90 b/src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.f90 similarity index 100% rename from src/nvector/mpiplusx/fmod/fnvector_mpiplusx_mod.f90 rename to src/nvector/mpiplusx/fmod_int64/fnvector_mpiplusx_mod.f90 diff --git a/src/nvector/openmp/CMakeLists.txt b/src/nvector/openmp/CMakeLists.txt index ab938e6694..9cbc2f35fe 100644 --- a/src/nvector/openmp/CMakeLists.txt +++ b/src/nvector/openmp/CMakeLists.txt @@ -41,5 +41,5 @@ message(STATUS "Added NVECTOR_OPENMP module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/openmp/fmod/CMakeLists.txt b/src/nvector/openmp/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/openmp/fmod/CMakeLists.txt rename to src/nvector/openmp/fmod_int32/CMakeLists.txt diff --git a/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c b/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c new file mode 100644 index 0000000000..ddf0295838 --- /dev/null +++ b/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.c @@ -0,0 +1,961 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_openmp.h" + +SWIGEXPORT N_Vector _wrap_FN_VNew_OpenMP(int32_t const *farg1, int const *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + int arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (int)(*farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNew_OpenMP(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNewEmpty_OpenMP(int32_t const *farg1, int const *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + int arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (int)(*farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNewEmpty_OpenMP(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VMake_OpenMP(int32_t const *farg1, double *farg2, int const *farg3, void *farg4) { + N_Vector fresult ; + sunindextype arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (N_Vector)N_VMake_OpenMP(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_OpenMP(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_OpenMP(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_OpenMP(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_OpenMP(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_OpenMP(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_OpenMP(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_OpenMP(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_OpenMP(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_OpenMP(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_OpenMP(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_OpenMP(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_OpenMP(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_OpenMP(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_OpenMP(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_OpenMP(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer_OpenMP(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer_OpenMP(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_OpenMP(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_OpenMP(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_OpenMP(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_OpenMP(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_OpenMP(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_OpenMP(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_OpenMP(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_OpenMP(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_OpenMP(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_OpenMP(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_OpenMP(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_OpenMP(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd_OpenMP(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd_OpenMP(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm_OpenMP(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm_OpenMP(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_OpenMP(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_OpenMP(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_OpenMP(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_OpenMP(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin_OpenMP(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin_OpenMP(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_OpenMP(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_OpenMP(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm_OpenMP(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm_OpenMP(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_OpenMP(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_OpenMP(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest_OpenMP(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest_OpenMP(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask_OpenMP(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask_OpenMP(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient_OpenMP(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient_OpenMP(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_OpenMP(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_OpenMP(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_OpenMP(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_OpenMP(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_OpenMP(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_OpenMP(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_OpenMP(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_OpenMP(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_OpenMP(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_OpenMP(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_OpenMP(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_OpenMP(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_OpenMP(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_OpenMP(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_OpenMP(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_OpenMP(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_OpenMP(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_OpenMP(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_OpenMP(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_OpenMP(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_OpenMP(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_OpenMP(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_OpenMP(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_OpenMP(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_OpenMP(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer_OpenMP(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer_OpenMP(arg1); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 new file mode 100644 index 0000000000..e5f7cdc3f2 --- /dev/null +++ b/src/nvector/openmp/fmod_int32/fnvector_openmp_mod.f90 @@ -0,0 +1,1461 @@ +! 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-2024, 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 fnvector_openmp_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VNew_OpenMP + public :: FN_VNewEmpty_OpenMP + public :: FN_VMake_OpenMP + public :: FN_VGetLength_OpenMP + public :: FN_VPrint_OpenMP + public :: FN_VPrintFile_OpenMP + public :: FN_VGetVectorID_OpenMP + public :: FN_VCloneEmpty_OpenMP + public :: FN_VClone_OpenMP + public :: FN_VDestroy_OpenMP + public :: FN_VSpace_OpenMP + public :: FN_VSetArrayPointer_OpenMP + public :: FN_VLinearSum_OpenMP + public :: FN_VConst_OpenMP + public :: FN_VProd_OpenMP + public :: FN_VDiv_OpenMP + public :: FN_VScale_OpenMP + public :: FN_VAbs_OpenMP + public :: FN_VInv_OpenMP + public :: FN_VAddConst_OpenMP + public :: FN_VDotProd_OpenMP + public :: FN_VMaxNorm_OpenMP + public :: FN_VWrmsNorm_OpenMP + public :: FN_VWrmsNormMask_OpenMP + public :: FN_VMin_OpenMP + public :: FN_VWL2Norm_OpenMP + public :: FN_VL1Norm_OpenMP + public :: FN_VCompare_OpenMP + public :: FN_VInvTest_OpenMP + public :: FN_VConstrMask_OpenMP + public :: FN_VMinQuotient_OpenMP + public :: FN_VLinearCombination_OpenMP + public :: FN_VScaleAddMulti_OpenMP + public :: FN_VDotProdMulti_OpenMP + public :: FN_VLinearSumVectorArray_OpenMP + public :: FN_VScaleVectorArray_OpenMP + public :: FN_VConstVectorArray_OpenMP + public :: FN_VWrmsNormVectorArray_OpenMP + public :: FN_VWrmsNormMaskVectorArray_OpenMP + public :: FN_VWSqrSumLocal_OpenMP + public :: FN_VWSqrSumMaskLocal_OpenMP + public :: FN_VBufSize_OpenMP + public :: FN_VBufPack_OpenMP + public :: FN_VBufUnpack_OpenMP + public :: FN_VEnableFusedOps_OpenMP + public :: FN_VEnableLinearCombination_OpenMP + public :: FN_VEnableScaleAddMulti_OpenMP + public :: FN_VEnableDotProdMulti_OpenMP + public :: FN_VEnableLinearSumVectorArray_OpenMP + public :: FN_VEnableScaleVectorArray_OpenMP + public :: FN_VEnableConstVectorArray_OpenMP + public :: FN_VEnableWrmsNormVectorArray_OpenMP + public :: FN_VEnableWrmsNormMaskVectorArray_OpenMP + + public :: FN_VGetArrayPointer_OpenMP + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VNew_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNew_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VNewEmpty_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNewEmpty_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VMake_OpenMP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VMake_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetLength_OpenMP(farg1) & +bind(C, name="_wrap_FN_VGetLength_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VPrint_OpenMP(farg1) & +bind(C, name="_wrap_FN_VPrint_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetVectorID_OpenMP(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VCloneEmpty_OpenMP(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_OpenMP(farg1) & +bind(C, name="_wrap_FN_VClone_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_OpenMP(farg1) & +bind(C, name="_wrap_FN_VDestroy_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VSetArrayPointer_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VLinearSum_OpenMP(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_OpenMP") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_OpenMP") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_OpenMP") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_OpenMP") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm_OpenMP(farg1) & +bind(C, name="_wrap_FN_VMaxNorm_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin_OpenMP(farg1) & +bind(C, name="_wrap_FN_VMin_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm_OpenMP(farg1) & +bind(C, name="_wrap_FN_VL1Norm_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_OpenMP") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest_OpenMP") & +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_FN_VConstrMask_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask_OpenMP") & +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_FN_VMinQuotient_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination_OpenMP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_OpenMP(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_OpenMP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_OpenMP(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_OpenMP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_OpenMP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_OpenMP(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_OpenMP(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VBufSize_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_OpenMP") & +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_FN_VBufPack_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_OpenMP") & +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_FN_VBufUnpack_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_OpenMP") & +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_FN_VEnableFusedOps_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_OpenMP") & +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_FN_VEnableLinearCombination_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_OpenMP") & +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_FN_VEnableScaleAddMulti_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_OpenMP") & +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_FN_VEnableDotProdMulti_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_OpenMP") & +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_FN_VEnableLinearSumVectorArray_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_OpenMP") & +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_FN_VEnableScaleVectorArray_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_OpenMP") & +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_FN_VEnableConstVectorArray_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_OpenMP") & +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_FN_VEnableWrmsNormVectorArray_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_OpenMP") & +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_FN_VEnableWrmsNormMaskVectorArray_OpenMP(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_OpenMP") & +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_FN_VGetArrayPointer_OpenMP(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer_OpenMP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VNew_OpenMP(vec_length, num_threads, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +integer(C_INT), intent(in) :: num_threads +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vec_length +farg2 = num_threads +farg3 = sunctx +fresult = swigc_FN_VNew_OpenMP(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VNewEmpty_OpenMP(vec_length, num_threads, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +integer(C_INT), intent(in) :: num_threads +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vec_length +farg2 = num_threads +farg3 = sunctx +fresult = swigc_FN_VNewEmpty_OpenMP(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VMake_OpenMP(vec_length, v_data, num_threads, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +integer(C_INT), intent(in) :: num_threads +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = vec_length +farg2 = c_loc(v_data(1)) +farg3 = num_threads +farg4 = sunctx +fresult = swigc_FN_VMake_OpenMP(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetLength_OpenMP(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_OpenMP(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_OpenMP(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_OpenMP(farg1) +end subroutine + +subroutine FN_VPrintFile_OpenMP(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_OpenMP(farg1, farg2) +end subroutine + +function FN_VGetVectorID_OpenMP(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_OpenMP(farg1) +swig_result = fresult +end function + +function FN_VCloneEmpty_OpenMP(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_OpenMP(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_OpenMP(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_OpenMP(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_OpenMP(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_OpenMP(farg1) +end subroutine + +subroutine FN_VSpace_OpenMP(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_OpenMP(farg1, farg2, farg3) +end subroutine + +subroutine FN_VSetArrayPointer_OpenMP(v_data, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer_OpenMP(farg1, farg2) +end subroutine + +subroutine FN_VLinearSum_OpenMP(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_OpenMP(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_OpenMP(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_OpenMP(farg1, farg2) +end subroutine + +subroutine FN_VProd_OpenMP(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_OpenMP(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_OpenMP(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_OpenMP(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_OpenMP(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_OpenMP(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_OpenMP(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_OpenMP(farg1, farg2) +end subroutine + +subroutine FN_VInv_OpenMP(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_OpenMP(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_OpenMP(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_OpenMP(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd_OpenMP(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm_OpenMP(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm_OpenMP(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm_OpenMP(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_OpenMP(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_OpenMP(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin_OpenMP(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin_OpenMP(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm_OpenMP(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm_OpenMP(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm_OpenMP(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare_OpenMP(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_OpenMP(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest_OpenMP(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask_OpenMP(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask_OpenMP(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient_OpenMP(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination_OpenMP(nvec, c, v, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: v +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = v +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_OpenMP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_OpenMP(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_OpenMP(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_OpenMP(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_OpenMP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_OpenMP(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_OpenMP(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_OpenMP(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_OpenMP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_OpenMP(nvecs, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvecs +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_OpenMP(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_OpenMP(nvecs, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_OpenMP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_OpenMP(nvecs, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_OpenMP(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_OpenMP(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_OpenMP(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_OpenMP(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VBufSize_OpenMP(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_OpenMP(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_OpenMP(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_OpenMP(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_OpenMP(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_OpenMP(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetArrayPointer_OpenMP(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer_OpenMP(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLength_OpenMP(v)]) +end function + + +end module diff --git a/src/nvector/openmp/fmod_int64/CMakeLists.txt b/src/nvector/openmp/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..31f4363b84 --- /dev/null +++ b/src/nvector/openmp/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 openmp NVECTOR object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fnvecopenmp_mod + SOURCES + fnvector_openmp_mod.f90 fnvector_openmp_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fnvecopenmp_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} +) + +message(STATUS "Added NVECTOR_OPENMP F2003 interface") diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.c b/src/nvector/openmp/fmod_int64/fnvector_openmp_mod.c similarity index 100% rename from src/nvector/openmp/fmod/fnvector_openmp_mod.c rename to src/nvector/openmp/fmod_int64/fnvector_openmp_mod.c diff --git a/src/nvector/openmp/fmod/fnvector_openmp_mod.f90 b/src/nvector/openmp/fmod_int64/fnvector_openmp_mod.f90 similarity index 100% rename from src/nvector/openmp/fmod/fnvector_openmp_mod.f90 rename to src/nvector/openmp/fmod_int64/fnvector_openmp_mod.f90 diff --git a/src/nvector/parallel/CMakeLists.txt b/src/nvector/parallel/CMakeLists.txt index 55cce2df2d..55effd6b9a 100644 --- a/src/nvector/parallel/CMakeLists.txt +++ b/src/nvector/parallel/CMakeLists.txt @@ -47,5 +47,5 @@ message(STATUS "Added NVECTOR_PARALLEL module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/parallel/fmod/CMakeLists.txt b/src/nvector/parallel/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/parallel/fmod/CMakeLists.txt rename to src/nvector/parallel/fmod_int32/CMakeLists.txt diff --git a/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c b/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c new file mode 100644 index 0000000000..cdbd1f87c3 --- /dev/null +++ b/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.c @@ -0,0 +1,1173 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_parallel.h" + +SWIGEXPORT N_Vector _wrap_FN_VNew_Parallel(int const *farg1, int32_t const *farg2, int32_t const *farg3, void *farg4) { + N_Vector fresult ; + MPI_Comm arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + N_Vector result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (SUNContext)(farg4); + result = (N_Vector)N_VNew_Parallel(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNewEmpty_Parallel(int const *farg1, int32_t const *farg2, int32_t const *farg3, void *farg4) { + N_Vector fresult ; + MPI_Comm arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + N_Vector result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (SUNContext)(farg4); + result = (N_Vector)N_VNewEmpty_Parallel(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VMake_Parallel(int const *farg1, int32_t const *farg2, int32_t const *farg3, double *farg4, void *farg5) { + N_Vector fresult ; + MPI_Comm arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + N_Vector result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunrealtype *)(farg4); + arg5 = (SUNContext)(farg5); + result = (N_Vector)N_VMake_Parallel(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_Parallel(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_Parallel(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLocalLength_Parallel(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLocalLength_Parallel(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_Parallel(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_Parallel(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_Parallel(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_Parallel(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_Parallel(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_Parallel(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_Parallel(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_Parallel(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_Parallel(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_Parallel(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_Parallel(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_Parallel(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_Parallel(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer_Parallel(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer_Parallel(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetCommunicator_Parallel(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + MPI_Comm result; + + arg1 = (N_Vector)(farg1); + result = N_VGetCommunicator_Parallel(arg1); +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + fresult = (int)(MPI_Comm_c2f(result)); + } else { + fresult = 0; + } +#else + fresult = result; +#endif + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_Parallel(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_Parallel(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_Parallel(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_Parallel(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_Parallel(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_Parallel(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_Parallel(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_Parallel(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_Parallel(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_Parallel(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_Parallel(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_Parallel(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_Parallel(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest_Parallel(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest_Parallel(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask_Parallel(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_Parallel(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_Parallel(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_Parallel(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_Parallel(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_Parallel(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_Parallel(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_Parallel(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_Parallel(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_Parallel(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_Parallel(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_Parallel(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_Parallel(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_Parallel(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_Parallel(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_Parallel(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_Parallel(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VDotProdLocal_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProdLocal_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNormLocal_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNormLocal_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinLocal_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMinLocal_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1NormLocal_Parallel(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1NormLocal_Parallel(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_Parallel(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VInvTestLocal_Parallel(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTestLocal_Parallel(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMaskLocal_Parallel(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMaskLocal_Parallel(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotientLocal_Parallel(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotientLocal_Parallel(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiLocal_Parallel(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMultiLocal_Parallel(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce_Parallel(int const *farg1, N_Vector farg2, double *farg3) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype *)(farg3); + result = (SUNErrCode)N_VDotProdMultiAllReduce_Parallel(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_Parallel(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_Parallel(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_Parallel(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_Parallel(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMultiLocal_Parallel(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Parallel(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer_Parallel(arg1); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 new file mode 100644 index 0000000000..571b01856b --- /dev/null +++ b/src/nvector/parallel/fmod_int32/fnvector_parallel_mod.f90 @@ -0,0 +1,1781 @@ +! 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-2024, 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 fnvector_parallel_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VNew_Parallel + public :: FN_VNewEmpty_Parallel + public :: FN_VMake_Parallel + public :: FN_VGetLength_Parallel + public :: FN_VGetLocalLength_Parallel + public :: FN_VPrint_Parallel + public :: FN_VPrintFile_Parallel + public :: FN_VGetVectorID_Parallel + public :: FN_VCloneEmpty_Parallel + public :: FN_VClone_Parallel + public :: FN_VDestroy_Parallel + public :: FN_VSpace_Parallel + public :: FN_VSetArrayPointer_Parallel + public :: FN_VGetCommunicator_Parallel + public :: FN_VLinearSum_Parallel + public :: FN_VConst_Parallel + public :: FN_VProd_Parallel + public :: FN_VDiv_Parallel + public :: FN_VScale_Parallel + public :: FN_VAbs_Parallel + public :: FN_VInv_Parallel + public :: FN_VAddConst_Parallel + public :: FN_VDotProd_Parallel + public :: FN_VMaxNorm_Parallel + public :: FN_VWrmsNorm_Parallel + public :: FN_VWrmsNormMask_Parallel + public :: FN_VMin_Parallel + public :: FN_VWL2Norm_Parallel + public :: FN_VL1Norm_Parallel + public :: FN_VCompare_Parallel + public :: FN_VInvTest_Parallel + public :: FN_VConstrMask_Parallel + public :: FN_VMinQuotient_Parallel + public :: FN_VLinearCombination_Parallel + public :: FN_VScaleAddMulti_Parallel + public :: FN_VDotProdMulti_Parallel + public :: FN_VLinearSumVectorArray_Parallel + public :: FN_VScaleVectorArray_Parallel + public :: FN_VConstVectorArray_Parallel + public :: FN_VWrmsNormVectorArray_Parallel + public :: FN_VWrmsNormMaskVectorArray_Parallel + public :: FN_VDotProdLocal_Parallel + public :: FN_VMaxNormLocal_Parallel + public :: FN_VMinLocal_Parallel + public :: FN_VL1NormLocal_Parallel + public :: FN_VWSqrSumLocal_Parallel + public :: FN_VWSqrSumMaskLocal_Parallel + public :: FN_VInvTestLocal_Parallel + public :: FN_VConstrMaskLocal_Parallel + public :: FN_VMinQuotientLocal_Parallel + public :: FN_VDotProdMultiLocal_Parallel + public :: FN_VDotProdMultiAllReduce_Parallel + public :: FN_VBufSize_Parallel + public :: FN_VBufPack_Parallel + public :: FN_VBufUnpack_Parallel + public :: FN_VEnableFusedOps_Parallel + public :: FN_VEnableLinearCombination_Parallel + public :: FN_VEnableScaleAddMulti_Parallel + public :: FN_VEnableDotProdMulti_Parallel + public :: FN_VEnableLinearSumVectorArray_Parallel + public :: FN_VEnableScaleVectorArray_Parallel + public :: FN_VEnableConstVectorArray_Parallel + public :: FN_VEnableWrmsNormVectorArray_Parallel + public :: FN_VEnableWrmsNormMaskVectorArray_Parallel + public :: FN_VEnableDotProdMultiLocal_Parallel + + public :: FN_VGetArrayPointer_Parallel + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VNew_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VNew_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FN_VNewEmpty_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VNewEmpty_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FN_VMake_Parallel(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VMake_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetLength_Parallel(farg1) & +bind(C, name="_wrap_FN_VGetLength_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetLocalLength_Parallel(farg1) & +bind(C, name="_wrap_FN_VGetLocalLength_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VPrint_Parallel(farg1) & +bind(C, name="_wrap_FN_VPrint_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetVectorID_Parallel(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VCloneEmpty_Parallel(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_Parallel(farg1) & +bind(C, name="_wrap_FN_VClone_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_Parallel(farg1) & +bind(C, name="_wrap_FN_VDestroy_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VSetArrayPointer_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetCommunicator_Parallel(farg1) & +bind(C, name="_wrap_FN_VGetCommunicator_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_FN_VLinearSum_Parallel(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_Parallel") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_Parallel") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_Parallel") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_Parallel") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm_Parallel(farg1) & +bind(C, name="_wrap_FN_VMaxNorm_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin_Parallel(farg1) & +bind(C, name="_wrap_FN_VMin_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm_Parallel(farg1) & +bind(C, name="_wrap_FN_VL1Norm_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_Parallel") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest_Parallel") & +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_FN_VConstrMask_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask_Parallel") & +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_FN_VMinQuotient_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_Parallel(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_Parallel(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_Parallel(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdLocal_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProdLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNormLocal_Parallel(farg1) & +bind(C, name="_wrap_FN_VMaxNormLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMinLocal_Parallel(farg1) & +bind(C, name="_wrap_FN_VMinLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1NormLocal_Parallel(farg1) & +bind(C, name="_wrap_FN_VL1NormLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VInvTestLocal_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTestLocal_Parallel") & +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_FN_VConstrMaskLocal_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMaskLocal_Parallel") & +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_FN_VMinQuotientLocal_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotientLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VDotProdMultiLocal_Parallel(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMultiLocal_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMultiAllReduce_Parallel(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDotProdMultiAllReduce_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VBufSize_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_Parallel") & +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_FN_VBufPack_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_Parallel") & +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_FN_VBufUnpack_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_Parallel") & +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_FN_VEnableFusedOps_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_Parallel") & +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_FN_VEnableLinearCombination_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_Parallel") & +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_FN_VEnableScaleAddMulti_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_Parallel") & +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_FN_VEnableDotProdMulti_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_Parallel") & +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_FN_VEnableLinearSumVectorArray_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_Parallel") & +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_FN_VEnableScaleVectorArray_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_Parallel") & +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_FN_VEnableConstVectorArray_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_Parallel") & +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_FN_VEnableWrmsNormVectorArray_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_Parallel") & +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_FN_VEnableWrmsNormMaskVectorArray_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_Parallel") & +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_FN_VEnableDotProdMultiLocal_Parallel(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMultiLocal_Parallel") & +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_FN_VGetArrayPointer_Parallel(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VNew_Parallel(comm, local_length, global_length, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer :: comm +integer(C_INT32_T), intent(in) :: local_length +integer(C_INT32_T), intent(in) :: global_length +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +type(C_PTR) :: farg4 + +farg1 = int(comm, C_INT) +farg2 = local_length +farg3 = global_length +farg4 = sunctx +fresult = swigc_FN_VNew_Parallel(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VNewEmpty_Parallel(comm, local_length, global_length, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer :: comm +integer(C_INT32_T), intent(in) :: local_length +integer(C_INT32_T), intent(in) :: global_length +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +type(C_PTR) :: farg4 + +farg1 = int(comm, C_INT) +farg2 = local_length +farg3 = global_length +farg4 = sunctx +fresult = swigc_FN_VNewEmpty_Parallel(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VMake_Parallel(comm, local_length, global_length, v_data, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer :: comm +integer(C_INT32_T), intent(in) :: local_length +integer(C_INT32_T), intent(in) :: global_length +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = int(comm, C_INT) +farg2 = local_length +farg3 = global_length +farg4 = c_loc(v_data(1)) +farg5 = sunctx +fresult = swigc_FN_VMake_Parallel(farg1, farg2, farg3, farg4, farg5) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetLength_Parallel(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_Parallel(farg1) +swig_result = fresult +end function + +function FN_VGetLocalLength_Parallel(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLocalLength_Parallel(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_Parallel(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_Parallel(farg1) +end subroutine + +subroutine FN_VPrintFile_Parallel(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_Parallel(farg1, farg2) +end subroutine + +function FN_VGetVectorID_Parallel(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_Parallel(farg1) +swig_result = fresult +end function + +function FN_VCloneEmpty_Parallel(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_Parallel(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_Parallel(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_Parallel(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_Parallel(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_Parallel(farg1) +end subroutine + +subroutine FN_VSpace_Parallel(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_Parallel(farg1, farg2, farg3) +end subroutine + +subroutine FN_VSetArrayPointer_Parallel(v_data, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer_Parallel(farg1, farg2) +end subroutine + +function FN_VGetCommunicator_Parallel(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetCommunicator_Parallel(farg1) +swig_result = int(fresult) +end function + +subroutine FN_VLinearSum_Parallel(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_Parallel(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_Parallel(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_Parallel(farg1, farg2) +end subroutine + +subroutine FN_VProd_Parallel(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_Parallel(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_Parallel(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_Parallel(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_Parallel(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_Parallel(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_Parallel(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_Parallel(farg1, farg2) +end subroutine + +subroutine FN_VInv_Parallel(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_Parallel(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_Parallel(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_Parallel(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd_Parallel(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm_Parallel(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm_Parallel(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_Parallel(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin_Parallel(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm_Parallel(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm_Parallel(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare_Parallel(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_Parallel(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest_Parallel(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask_Parallel(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient_Parallel(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination_Parallel(nvec, c, v, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: v +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = v +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_Parallel(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_Parallel(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_Parallel(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_Parallel(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_Parallel(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_Parallel(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_Parallel(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_Parallel(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_Parallel(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_Parallel(nvecs, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvecs +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_Parallel(nvecs, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_Parallel(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_Parallel(nvec, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_Parallel(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdLocal_Parallel(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProdLocal_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNormLocal_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNormLocal_Parallel(farg1) +swig_result = fresult +end function + +function FN_VMinLocal_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMinLocal_Parallel(farg1) +swig_result = fresult +end function + +function FN_VL1NormLocal_Parallel(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1NormLocal_Parallel(farg1) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_Parallel(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_Parallel(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VInvTestLocal_Parallel(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTestLocal_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMaskLocal_Parallel(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMaskLocal_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotientLocal_Parallel(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotientLocal_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VDotProdMultiLocal_Parallel(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMultiLocal_Parallel(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VDotProdMultiAllReduce_Parallel(nvec_total, x, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec_total +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvec_total +farg2 = c_loc(x) +farg3 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMultiAllReduce_Parallel(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VBufSize_Parallel(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_Parallel(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_Parallel(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_Parallel(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMultiLocal_Parallel(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMultiLocal_Parallel(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetArrayPointer_Parallel(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer_Parallel(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLocalLength_Parallel(v)]) +end function + + +end module diff --git a/src/nvector/parallel/fmod_int64/CMakeLists.txt b/src/nvector/parallel/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..3b4031b8c9 --- /dev/null +++ b/src/nvector/parallel/fmod_int64/CMakeLists.txt @@ -0,0 +1,49 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 parallel NVECTOR object library +# --------------------------------------------------------------- + +set(nvecparallel_SOURCES fnvector_parallel_mod.f90 fnvector_parallel_mod.c) + +if(MPI_C_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) +else() + # add MPI_INCLUDE_PATH to include directories + include_directories(${MPI_INCLUDE_PATH}) +endif() + +if(MPI_Fortran_COMPILER) + # use MPI wrapper as the compiler + set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) +else() + # add MPI_INCLUDE_PATH to include directories + include_directories(${MPI_INCLUDE_PATH}) +endif() + +sundials_add_f2003_library(sundials_fnvecparallel_mod + SOURCES + fnvector_parallel_mod.f90 fnvector_parallel_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fnvecparallel_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} +) + +message(STATUS "Added NVECTOR_PARALLEL F2003 interface") diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.c b/src/nvector/parallel/fmod_int64/fnvector_parallel_mod.c similarity index 100% rename from src/nvector/parallel/fmod/fnvector_parallel_mod.c rename to src/nvector/parallel/fmod_int64/fnvector_parallel_mod.c diff --git a/src/nvector/parallel/fmod/fnvector_parallel_mod.f90 b/src/nvector/parallel/fmod_int64/fnvector_parallel_mod.f90 similarity index 100% rename from src/nvector/parallel/fmod/fnvector_parallel_mod.f90 rename to src/nvector/parallel/fmod_int64/fnvector_parallel_mod.f90 diff --git a/src/nvector/pthreads/CMakeLists.txt b/src/nvector/pthreads/CMakeLists.txt index bb4e3c361b..2aafa31e4a 100644 --- a/src/nvector/pthreads/CMakeLists.txt +++ b/src/nvector/pthreads/CMakeLists.txt @@ -41,5 +41,5 @@ message(STATUS "Added NVECTOR_PTHREADS module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/pthreads/fmod/CMakeLists.txt b/src/nvector/pthreads/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/pthreads/fmod/CMakeLists.txt rename to src/nvector/pthreads/fmod_int32/CMakeLists.txt diff --git a/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c new file mode 100644 index 0000000000..77ac40a163 --- /dev/null +++ b/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.c @@ -0,0 +1,961 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_pthreads.h" + +SWIGEXPORT N_Vector _wrap_FN_VNew_Pthreads(int32_t const *farg1, int const *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + int arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (int)(*farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNew_Pthreads(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNewEmpty_Pthreads(int32_t const *farg1, int const *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + int arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (int)(*farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VNewEmpty_Pthreads(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VMake_Pthreads(int32_t const *farg1, int const *farg2, double *farg3, void *farg4) { + N_Vector fresult ; + sunindextype arg1 ; + int arg2 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (SUNContext)(farg4); + result = (N_Vector)N_VMake_Pthreads(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_Pthreads(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_Pthreads(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_Pthreads(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_Pthreads(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_Pthreads(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_Pthreads(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_Pthreads(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_Pthreads(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_Pthreads(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_Pthreads(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_Pthreads(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_Pthreads(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_Pthreads(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_Pthreads(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_Pthreads(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer_Pthreads(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer_Pthreads(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_Pthreads(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_Pthreads(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_Pthreads(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_Pthreads(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_Pthreads(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_Pthreads(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_Pthreads(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_Pthreads(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_Pthreads(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_Pthreads(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_Pthreads(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_Pthreads(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd_Pthreads(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd_Pthreads(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm_Pthreads(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm_Pthreads(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_Pthreads(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_Pthreads(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_Pthreads(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_Pthreads(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin_Pthreads(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin_Pthreads(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_Pthreads(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_Pthreads(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm_Pthreads(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm_Pthreads(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_Pthreads(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_Pthreads(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest_Pthreads(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest_Pthreads(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask_Pthreads(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask_Pthreads(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient_Pthreads(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient_Pthreads(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_Pthreads(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_Pthreads(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_Pthreads(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_Pthreads(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_Pthreads(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_Pthreads(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_Pthreads(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_Pthreads(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_Pthreads(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_Pthreads(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_Pthreads(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_Pthreads(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_Pthreads(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_Pthreads(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_Pthreads(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_Pthreads(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_Pthreads(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_Pthreads(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_Pthreads(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_Pthreads(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_Pthreads(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_Pthreads(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_Pthreads(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Pthreads(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_Pthreads(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Pthreads(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer_Pthreads(arg1); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 new file mode 100644 index 0000000000..fb2af230a5 --- /dev/null +++ b/src/nvector/pthreads/fmod_int32/fnvector_pthreads_mod.f90 @@ -0,0 +1,1461 @@ +! 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-2024, 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 fnvector_pthreads_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VNew_Pthreads + public :: FN_VNewEmpty_Pthreads + public :: FN_VMake_Pthreads + public :: FN_VGetLength_Pthreads + public :: FN_VPrint_Pthreads + public :: FN_VPrintFile_Pthreads + public :: FN_VGetVectorID_Pthreads + public :: FN_VCloneEmpty_Pthreads + public :: FN_VClone_Pthreads + public :: FN_VDestroy_Pthreads + public :: FN_VSpace_Pthreads + public :: FN_VSetArrayPointer_Pthreads + public :: FN_VLinearSum_Pthreads + public :: FN_VConst_Pthreads + public :: FN_VProd_Pthreads + public :: FN_VDiv_Pthreads + public :: FN_VScale_Pthreads + public :: FN_VAbs_Pthreads + public :: FN_VInv_Pthreads + public :: FN_VAddConst_Pthreads + public :: FN_VDotProd_Pthreads + public :: FN_VMaxNorm_Pthreads + public :: FN_VWrmsNorm_Pthreads + public :: FN_VWrmsNormMask_Pthreads + public :: FN_VMin_Pthreads + public :: FN_VWL2Norm_Pthreads + public :: FN_VL1Norm_Pthreads + public :: FN_VCompare_Pthreads + public :: FN_VInvTest_Pthreads + public :: FN_VConstrMask_Pthreads + public :: FN_VMinQuotient_Pthreads + public :: FN_VLinearCombination_Pthreads + public :: FN_VScaleAddMulti_Pthreads + public :: FN_VDotProdMulti_Pthreads + public :: FN_VLinearSumVectorArray_Pthreads + public :: FN_VScaleVectorArray_Pthreads + public :: FN_VConstVectorArray_Pthreads + public :: FN_VWrmsNormVectorArray_Pthreads + public :: FN_VWrmsNormMaskVectorArray_Pthreads + public :: FN_VWSqrSumLocal_Pthreads + public :: FN_VWSqrSumMaskLocal_Pthreads + public :: FN_VBufSize_Pthreads + public :: FN_VBufPack_Pthreads + public :: FN_VBufUnpack_Pthreads + public :: FN_VEnableFusedOps_Pthreads + public :: FN_VEnableLinearCombination_Pthreads + public :: FN_VEnableScaleAddMulti_Pthreads + public :: FN_VEnableDotProdMulti_Pthreads + public :: FN_VEnableLinearSumVectorArray_Pthreads + public :: FN_VEnableScaleVectorArray_Pthreads + public :: FN_VEnableConstVectorArray_Pthreads + public :: FN_VEnableWrmsNormVectorArray_Pthreads + public :: FN_VEnableWrmsNormMaskVectorArray_Pthreads + + public :: FN_VGetArrayPointer_Pthreads + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VNew_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNew_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VNewEmpty_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VNewEmpty_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VMake_Pthreads(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VMake_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetLength_Pthreads(farg1) & +bind(C, name="_wrap_FN_VGetLength_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VPrint_Pthreads(farg1) & +bind(C, name="_wrap_FN_VPrint_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetVectorID_Pthreads(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VCloneEmpty_Pthreads(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_Pthreads(farg1) & +bind(C, name="_wrap_FN_VClone_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_Pthreads(farg1) & +bind(C, name="_wrap_FN_VDestroy_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VSetArrayPointer_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VLinearSum_Pthreads(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_Pthreads") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_Pthreads") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_Pthreads") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_Pthreads") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm_Pthreads(farg1) & +bind(C, name="_wrap_FN_VMaxNorm_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin_Pthreads(farg1) & +bind(C, name="_wrap_FN_VMin_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm_Pthreads(farg1) & +bind(C, name="_wrap_FN_VL1Norm_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_Pthreads") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest_Pthreads") & +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_FN_VConstrMask_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask_Pthreads") & +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_FN_VMinQuotient_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination_Pthreads(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_Pthreads(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_Pthreads(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_Pthreads(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_Pthreads(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_Pthreads(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_Pthreads(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_Pthreads(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VBufSize_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_Pthreads") & +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_FN_VBufPack_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_Pthreads") & +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_FN_VBufUnpack_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_Pthreads") & +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_FN_VEnableFusedOps_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_Pthreads") & +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_FN_VEnableLinearCombination_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_Pthreads") & +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_FN_VEnableScaleAddMulti_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_Pthreads") & +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_FN_VEnableDotProdMulti_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_Pthreads") & +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_FN_VEnableLinearSumVectorArray_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_Pthreads") & +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_FN_VEnableScaleVectorArray_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_Pthreads") & +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_FN_VEnableConstVectorArray_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_Pthreads") & +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_FN_VEnableWrmsNormVectorArray_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_Pthreads") & +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_FN_VEnableWrmsNormMaskVectorArray_Pthreads(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_Pthreads") & +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_FN_VGetArrayPointer_Pthreads(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer_Pthreads") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VNew_Pthreads(vec_length, n_threads, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +integer(C_INT), intent(in) :: n_threads +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vec_length +farg2 = n_threads +farg3 = sunctx +fresult = swigc_FN_VNew_Pthreads(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VNewEmpty_Pthreads(vec_length, n_threads, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +integer(C_INT), intent(in) :: n_threads +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vec_length +farg2 = n_threads +farg3 = sunctx +fresult = swigc_FN_VNewEmpty_Pthreads(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VMake_Pthreads(vec_length, n_threads, v_data, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +integer(C_INT), intent(in) :: n_threads +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = vec_length +farg2 = n_threads +farg3 = c_loc(v_data(1)) +farg4 = sunctx +fresult = swigc_FN_VMake_Pthreads(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetLength_Pthreads(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_Pthreads(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_Pthreads(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_Pthreads(farg1) +end subroutine + +subroutine FN_VPrintFile_Pthreads(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_Pthreads(farg1, farg2) +end subroutine + +function FN_VGetVectorID_Pthreads(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_Pthreads(farg1) +swig_result = fresult +end function + +function FN_VCloneEmpty_Pthreads(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_Pthreads(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_Pthreads(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_Pthreads(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_Pthreads(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_Pthreads(farg1) +end subroutine + +subroutine FN_VSpace_Pthreads(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_Pthreads(farg1, farg2, farg3) +end subroutine + +subroutine FN_VSetArrayPointer_Pthreads(v_data, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer_Pthreads(farg1, farg2) +end subroutine + +subroutine FN_VLinearSum_Pthreads(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_Pthreads(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_Pthreads(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_Pthreads(farg1, farg2) +end subroutine + +subroutine FN_VProd_Pthreads(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_Pthreads(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_Pthreads(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_Pthreads(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_Pthreads(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_Pthreads(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_Pthreads(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_Pthreads(farg1, farg2) +end subroutine + +subroutine FN_VInv_Pthreads(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_Pthreads(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_Pthreads(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_Pthreads(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd_Pthreads(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm_Pthreads(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm_Pthreads(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm_Pthreads(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_Pthreads(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_Pthreads(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin_Pthreads(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin_Pthreads(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm_Pthreads(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm_Pthreads(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm_Pthreads(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare_Pthreads(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_Pthreads(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest_Pthreads(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask_Pthreads(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask_Pthreads(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient_Pthreads(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination_Pthreads(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_Pthreads(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_Pthreads(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_Pthreads(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_Pthreads(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_Pthreads(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_Pthreads(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_Pthreads(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_Pthreads(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_Pthreads(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_Pthreads(nvec, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvec +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_Pthreads(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_Pthreads(nvec, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_Pthreads(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_Pthreads(nvec, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_Pthreads(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_Pthreads(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_Pthreads(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_Pthreads(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VBufSize_Pthreads(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_Pthreads(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_Pthreads(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_Pthreads(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_Pthreads(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_Pthreads(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetArrayPointer_Pthreads(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer_Pthreads(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLength_Pthreads(v)]) +end function + + +end module diff --git a/src/nvector/pthreads/fmod_int64/CMakeLists.txt b/src/nvector/pthreads/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..e43ebc9c08 --- /dev/null +++ b/src/nvector/pthreads/fmod_int64/CMakeLists.txt @@ -0,0 +1,33 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 Pthreads NVECTOR object library +# --------------------------------------------------------------- + +set(nvecpthreads_SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c) + +sundials_add_f2003_library(sundials_fnvecpthreads_mod + SOURCES + fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fnvecpthreads_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} +) + +message(STATUS "Added NVECTOR_PTHREADS F2003 interface") diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.c b/src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.c similarity index 100% rename from src/nvector/pthreads/fmod/fnvector_pthreads_mod.c rename to src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.c diff --git a/src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 b/src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.f90 similarity index 100% rename from src/nvector/pthreads/fmod/fnvector_pthreads_mod.f90 rename to src/nvector/pthreads/fmod_int64/fnvector_pthreads_mod.f90 diff --git a/src/nvector/serial/CMakeLists.txt b/src/nvector/serial/CMakeLists.txt index efcfb15818..c8e867daa8 100644 --- a/src/nvector/serial/CMakeLists.txt +++ b/src/nvector/serial/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added NVECTOR_SERIAL module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/nvector/serial/fmod/CMakeLists.txt b/src/nvector/serial/fmod_int32/CMakeLists.txt similarity index 100% rename from src/nvector/serial/fmod/CMakeLists.txt rename to src/nvector/serial/fmod_int32/CMakeLists.txt diff --git a/src/nvector/serial/fmod_int32/fnvector_serial_mod.c b/src/nvector/serial/fmod_int32/fnvector_serial_mod.c new file mode 100644 index 0000000000..14ddfe38a0 --- /dev/null +++ b/src/nvector/serial/fmod_int32/fnvector_serial_mod.c @@ -0,0 +1,955 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nvector.h" + + +#include "nvector/nvector_serial.h" + +SWIGEXPORT N_Vector _wrap_FN_VNewEmpty_Serial(int32_t const *farg1, void *farg2) { + N_Vector fresult ; + sunindextype arg1 ; + SUNContext arg2 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (SUNContext)(farg2); + result = (N_Vector)N_VNewEmpty_Serial(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNew_Serial(int32_t const *farg1, void *farg2) { + N_Vector fresult ; + sunindextype arg1 ; + SUNContext arg2 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (SUNContext)(farg2); + result = (N_Vector)N_VNew_Serial(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VMake_Serial(int32_t const *farg1, double *farg2, void *farg3) { + N_Vector fresult ; + sunindextype arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (SUNContext)(farg3); + result = (N_Vector)N_VMake_Serial(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength_Serial(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength_Serial(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VPrint_Serial(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint_Serial(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile_Serial(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile_Serial(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID_Serial(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID_Serial(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty_Serial(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty_Serial(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone_Serial(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone_Serial(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy_Serial(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy_Serial(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace_Serial(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer_Serial(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer_Serial(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VLinearSum_Serial(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum_Serial(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst_Serial(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst_Serial(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd_Serial(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv_Serial(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale_Serial(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs_Serial(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs_Serial(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv_Serial(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv_Serial(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst_Serial(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd_Serial(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd_Serial(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm_Serial(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm_Serial(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm_Serial(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm_Serial(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask_Serial(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask_Serial(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin_Serial(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin_Serial(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm_Serial(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm_Serial(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm_Serial(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm_Serial(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare_Serial(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare_Serial(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest_Serial(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest_Serial(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask_Serial(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask_Serial(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient_Serial(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient_Serial(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination_Serial(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination_Serial(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti_Serial(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti_Serial(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti_Serial(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti_Serial(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray_Serial(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray_Serial(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray_Serial(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray_Serial(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray_Serial(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray_Serial(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray_Serial(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray_Serial(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray_Serial(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray_Serial(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal_Serial(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal_Serial(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal_Serial(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal_Serial(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize_Serial(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack_Serial(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack_Serial(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableFusedOps_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableFusedOps_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearCombination_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearCombination_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleAddMulti_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleAddMulti_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableDotProdMulti_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableDotProdMulti_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableLinearSumVectorArray_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableLinearSumVectorArray_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableScaleVectorArray_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableScaleVectorArray_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableConstVectorArray_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableConstVectorArray_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormVectorArray_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormVectorArray_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VEnableWrmsNormMaskVectorArray_Serial(N_Vector farg1, int const *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)N_VEnableWrmsNormMaskVectorArray_Serial(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer_Serial(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer_Serial(arg1); + fresult = result; + return fresult; +} + + diff --git a/src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 b/src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 new file mode 100644 index 0000000000..ac6df66be2 --- /dev/null +++ b/src/nvector/serial/fmod_int32/fnvector_serial_mod.f90 @@ -0,0 +1,1449 @@ +! 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-2024, 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 fnvector_serial_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FN_VNewEmpty_Serial + public :: FN_VNew_Serial + public :: FN_VMake_Serial + public :: FN_VGetLength_Serial + public :: FN_VPrint_Serial + public :: FN_VPrintFile_Serial + public :: FN_VGetVectorID_Serial + public :: FN_VCloneEmpty_Serial + public :: FN_VClone_Serial + public :: FN_VDestroy_Serial + public :: FN_VSpace_Serial + public :: FN_VSetArrayPointer_Serial + public :: FN_VLinearSum_Serial + public :: FN_VConst_Serial + public :: FN_VProd_Serial + public :: FN_VDiv_Serial + public :: FN_VScale_Serial + public :: FN_VAbs_Serial + public :: FN_VInv_Serial + public :: FN_VAddConst_Serial + public :: FN_VDotProd_Serial + public :: FN_VMaxNorm_Serial + public :: FN_VWrmsNorm_Serial + public :: FN_VWrmsNormMask_Serial + public :: FN_VMin_Serial + public :: FN_VWL2Norm_Serial + public :: FN_VL1Norm_Serial + public :: FN_VCompare_Serial + public :: FN_VInvTest_Serial + public :: FN_VConstrMask_Serial + public :: FN_VMinQuotient_Serial + public :: FN_VLinearCombination_Serial + public :: FN_VScaleAddMulti_Serial + public :: FN_VDotProdMulti_Serial + public :: FN_VLinearSumVectorArray_Serial + public :: FN_VScaleVectorArray_Serial + public :: FN_VConstVectorArray_Serial + public :: FN_VWrmsNormVectorArray_Serial + public :: FN_VWrmsNormMaskVectorArray_Serial + public :: FN_VWSqrSumLocal_Serial + public :: FN_VWSqrSumMaskLocal_Serial + public :: FN_VBufSize_Serial + public :: FN_VBufPack_Serial + public :: FN_VBufUnpack_Serial + public :: FN_VEnableFusedOps_Serial + public :: FN_VEnableLinearCombination_Serial + public :: FN_VEnableScaleAddMulti_Serial + public :: FN_VEnableDotProdMulti_Serial + public :: FN_VEnableLinearSumVectorArray_Serial + public :: FN_VEnableScaleVectorArray_Serial + public :: FN_VEnableConstVectorArray_Serial + public :: FN_VEnableWrmsNormVectorArray_Serial + public :: FN_VEnableWrmsNormMaskVectorArray_Serial + + public :: FN_VGetArrayPointer_Serial + + +! WRAPPER DECLARATIONS +interface +function swigc_FN_VNewEmpty_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VNewEmpty_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VNew_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VNew_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VMake_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VMake_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetLength_Serial(farg1) & +bind(C, name="_wrap_FN_VGetLength_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VPrint_Serial(farg1) & +bind(C, name="_wrap_FN_VPrint_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetVectorID_Serial(farg1) & +bind(C, name="_wrap_FN_VGetVectorID_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VCloneEmpty_Serial(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VClone_Serial(farg1) & +bind(C, name="_wrap_FN_VClone_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy_Serial(farg1) & +bind(C, name="_wrap_FN_VDestroy_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VSetArrayPointer_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VLinearSum_Serial(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum_Serial") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VConst_Serial") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale_Serial") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VInv_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst_Serial") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm_Serial(farg1) & +bind(C, name="_wrap_FN_VMaxNorm_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin_Serial(farg1) & +bind(C, name="_wrap_FN_VMin_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm_Serial(farg1) & +bind(C, name="_wrap_FN_VL1Norm_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare_Serial") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest_Serial") & +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_FN_VConstrMask_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask_Serial") & +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_FN_VMinQuotient_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination_Serial(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti_Serial(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti_Serial(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray_Serial(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray_Serial(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray_Serial(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray_Serial(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWSqrSumLocal_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal_Serial(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VBufSize_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize_Serial") & +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_FN_VBufPack_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack_Serial") & +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_FN_VBufUnpack_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack_Serial") & +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_FN_VEnableFusedOps_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableFusedOps_Serial") & +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_FN_VEnableLinearCombination_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearCombination_Serial") & +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_FN_VEnableScaleAddMulti_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleAddMulti_Serial") & +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_FN_VEnableDotProdMulti_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableDotProdMulti_Serial") & +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_FN_VEnableLinearSumVectorArray_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableLinearSumVectorArray_Serial") & +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_FN_VEnableScaleVectorArray_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableScaleVectorArray_Serial") & +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_FN_VEnableConstVectorArray_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableConstVectorArray_Serial") & +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_FN_VEnableWrmsNormVectorArray_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormVectorArray_Serial") & +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_FN_VEnableWrmsNormMaskVectorArray_Serial(farg1, farg2) & +bind(C, name="_wrap_FN_VEnableWrmsNormMaskVectorArray_Serial") & +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_FN_VGetArrayPointer_Serial(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer_Serial") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FN_VNewEmpty_Serial(vec_length, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 + +farg1 = vec_length +farg2 = sunctx +fresult = swigc_FN_VNewEmpty_Serial(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VNew_Serial(vec_length, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 + +farg1 = vec_length +farg2 = sunctx +fresult = swigc_FN_VNew_Serial(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VMake_Serial(vec_length, v_data, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +integer(C_INT32_T), intent(in) :: vec_length +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vec_length +farg2 = c_loc(v_data(1)) +farg3 = sunctx +fresult = swigc_FN_VMake_Serial(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VGetLength_Serial(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength_Serial(farg1) +swig_result = fresult +end function + +subroutine FN_VPrint_Serial(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint_Serial(farg1) +end subroutine + +subroutine FN_VPrintFile_Serial(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile_Serial(farg1, farg2) +end subroutine + +function FN_VGetVectorID_Serial(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetVectorID_Serial(farg1) +swig_result = fresult +end function + +function FN_VCloneEmpty_Serial(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty_Serial(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VClone_Serial(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone_Serial(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy_Serial(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy_Serial(farg1) +end subroutine + +subroutine FN_VSpace_Serial(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace_Serial(farg1, farg2, farg3) +end subroutine + +subroutine FN_VSetArrayPointer_Serial(v_data, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer_Serial(farg1, farg2) +end subroutine + +subroutine FN_VLinearSum_Serial(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum_Serial(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst_Serial(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst_Serial(farg1, farg2) +end subroutine + +subroutine FN_VProd_Serial(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd_Serial(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv_Serial(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv_Serial(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale_Serial(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale_Serial(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs_Serial(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs_Serial(farg1, farg2) +end subroutine + +subroutine FN_VInv_Serial(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv_Serial(farg1, farg2) +end subroutine + +subroutine FN_VAddConst_Serial(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst_Serial(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd_Serial(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm_Serial(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm_Serial(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm_Serial(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask_Serial(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask_Serial(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin_Serial(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin_Serial(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm_Serial(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm_Serial(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm_Serial(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare_Serial(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare_Serial(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest_Serial(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask_Serial(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask_Serial(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient_Serial(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination_Serial(nvec, c, v, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: v +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = v +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination_Serial(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti_Serial(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti_Serial(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti_Serial(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti_Serial(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray_Serial(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray_Serial(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray_Serial(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray_Serial(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray_Serial(nvecs, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvecs +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray_Serial(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray_Serial(nvecs, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray_Serial(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray_Serial(nvecs, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvecs +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvecs +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray_Serial(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VWSqrSumLocal_Serial(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal_Serial(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal_Serial(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VBufSize_Serial(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack_Serial(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack_Serial(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableFusedOps_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableFusedOps_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearCombination_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearCombination_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleAddMulti_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleAddMulti_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableDotProdMulti_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableDotProdMulti_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableLinearSumVectorArray_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableLinearSumVectorArray_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableScaleVectorArray_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableScaleVectorArray_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableConstVectorArray_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableConstVectorArray_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormVectorArray_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormVectorArray_Serial(farg1, farg2) +swig_result = fresult +end function + +function FN_VEnableWrmsNormMaskVectorArray_Serial(v, tf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT), intent(in) :: tf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(v) +farg2 = tf +fresult = swigc_FN_VEnableWrmsNormMaskVectorArray_Serial(farg1, farg2) +swig_result = fresult +end function + + +function FN_VGetArrayPointer_Serial(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer_Serial(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLength_Serial(v)]) +end function + + +end module diff --git a/src/nvector/serial/fmod_int64/CMakeLists.txt b/src/nvector/serial/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..293239b9fb --- /dev/null +++ b/src/nvector/serial/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 serial NVECTOR object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fnvecserial_mod + SOURCES + fnvector_serial_mod.f90 fnvector_serial_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fnvecserial_mod + VERSION + ${nveclib_VERSION} + SOVERSION + ${nveclib_SOVERSION} +) + +message(STATUS "Added NVECTOR_SERIAL F2003 interface") diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.c b/src/nvector/serial/fmod_int64/fnvector_serial_mod.c similarity index 100% rename from src/nvector/serial/fmod/fnvector_serial_mod.c rename to src/nvector/serial/fmod_int64/fnvector_serial_mod.c diff --git a/src/nvector/serial/fmod/fnvector_serial_mod.f90 b/src/nvector/serial/fmod_int64/fnvector_serial_mod.f90 similarity index 100% rename from src/nvector/serial/fmod/fnvector_serial_mod.f90 rename to src/nvector/serial/fmod_int64/fnvector_serial_mod.f90 diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index 2f5b6a0a61..ce2106e210 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -870,7 +870,7 @@ void N_VDestroy_Sycl(N_Vector v) return; } -void N_VSpace_Sycl(N_Vector X, sunindextype* lrw, sunindextype* liw) +void N_VSpace_Sycl(N_Vector X, long int* lrw, long int* liw) { *lrw = NVEC_SYCL_CONTENT(X)->length; *liw = 2; diff --git a/src/sunadaptcontroller/imexgus/CMakeLists.txt b/src/sunadaptcontroller/imexgus/CMakeLists.txt index 9ca6b96a15..8bbef68cdf 100644 --- a/src/sunadaptcontroller/imexgus/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/CMakeLists.txt @@ -27,5 +27,5 @@ sundials_add_library(sundials_sunadaptcontrollerimexgus # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt rename to src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt diff --git a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.c similarity index 100% rename from src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c rename to src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.c diff --git a/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 similarity index 100% rename from src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90 rename to src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..0c9fd4f2c2 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt @@ -0,0 +1,26 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunadaptcontrollerimexgus_mod + OBJECT_LIB_ONLY +) + +message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.c new file mode 100644 index 0000000000..1351217e15 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod_int64/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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (SUNErrCode)SUNAdaptController_SetParams_ImExGus(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)SUNAdaptController_EstimateStep_ImExGus(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_ImExGus(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_Reset_ImExGus(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_ImExGus(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_SetDefaults_ImExGus(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_ImExGus(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (SUNErrCode)SUNAdaptController_Write_ImExGus(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_ImExGus(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNAdaptController_SetErrorBias_ImExGus(arg1,arg2); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_UpdateH_ImExGus(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNAdaptController_Space_ImExGus(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 new file mode 100644 index 0000000000..29c98ad378 --- /dev/null +++ b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_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. + +! --------------------------------------------------------------- +! Programmer(s): Auto-generated by swig. +! --------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2024, 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_core_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), dimension(*), 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(1)) +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/soderlind/CMakeLists.txt b/src/sunadaptcontroller/soderlind/CMakeLists.txt index 0b8c4c8cf4..50cf7330bc 100644 --- a/src/sunadaptcontroller/soderlind/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/CMakeLists.txt @@ -27,5 +27,5 @@ sundials_add_library(sundials_sunadaptcontrollersoderlind # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunadaptcontroller/soderlind/fmod/CMakeLists.txt rename to src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt diff --git a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.c similarity index 100% rename from src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.c rename to src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.c diff --git a/src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 similarity index 100% rename from src/sunadaptcontroller/soderlind/fmod/fsunadaptcontroller_soderlind_mod.f90 rename to src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..44aa8a4922 --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt @@ -0,0 +1,26 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunadaptcontrollersoderlind_mod + OBJECT_LIB_ONLY +) + +message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.c new file mode 100644 index 0000000000..f3da8c259b --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod_int64/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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + result = (SUNErrCode)SUNAdaptController_SetParams_Soderlind(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)SUNAdaptController_EstimateStep_Soderlind(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_Soderlind(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_Reset_Soderlind(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_Soderlind(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_SetDefaults_Soderlind(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_Soderlind(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (SUNErrCode)SUNAdaptController_Write_Soderlind(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_Soderlind(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNAdaptController_SetErrorBias_Soderlind(arg1,arg2); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_UpdateH_Soderlind(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNAdaptController_Space_Soderlind(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (SUNErrCode)SUNAdaptController_SetParams_PID(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_SetParams_PI(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNAdaptController_SetParams_I(arg1,arg2); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_SetParams_ExpGus(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_SetParams_ImpGus(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 new file mode 100644 index 0000000000..cd6bc5262a --- /dev/null +++ b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 @@ -0,0 +1,577 @@ +! 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-2024, 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_core_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), dimension(*), 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(1)) +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/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index 8c91a3fd6d..bde159761c 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -169,5 +169,5 @@ generate_export_header( # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sundials/fmod/CMakeLists.txt b/src/sundials/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sundials/fmod/CMakeLists.txt rename to src/sundials/fmod_int32/CMakeLists.txt diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c new file mode 100644 index 0000000000..ad1f31a295 --- /dev/null +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -0,0 +1,2651 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 + * -------------------------------------------------------------*/ + + +/* --------------------------------------------------------------- + * Programmer(s): Auto-generated by swig. + * --------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 <stdint.h> + + +#include "sundials/sundials_types.h" + +#ifndef SUNDIALS_DOUBLE_PRECISION +#error "The Fortran bindings are only targeted at double-precision" +#endif + + +#include "sundials/sundials_context.h" +#include "sundials/sundials_errors.h" +#include "sundials/sundials_profiler.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + + +#include <string.h> + + +#include "sundials/sundials_profiler.h" +#if SUNDIALS_MPI_ENABLED +#include <mpi.h> +#endif + + +#include "sundials/sundials_logger.h" +#if SUNDIALS_MPI_ENABLED +#include <mpi.h> +#endif + + +#include "sundials/sundials_futils.h" + + +#include "sundials/sundials_nvector.h" + + +#include "sundials/sundials_matrix.h" + + +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_linearsolver.h" + + +#include "sundials/sundials_nonlinearsolver.h" + + +#include "sundials/sundials_adaptcontroller.h" + + +SWIGEXPORT SWIGEXTERN int const _wrap_SUN_COMM_NULL = (int)(0); + +SWIGEXPORT SWIGEXTERN int const _wrap_SUNFALSE = (int)(0); + +SWIGEXPORT SWIGEXTERN int const _wrap_SUNTRUE = (int)(1); + +SWIGEXPORT void _wrap_FSUNLogErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { + int arg1 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + SUNErrCode arg5 ; + void *arg6 = (void *) 0 ; + SUNContext arg7 = (SUNContext) 0 ; + + arg1 = (int)(*farg1); + arg2 = (char *)(farg2->data); + arg3 = (char *)(farg3->data); + arg4 = (char *)(farg4->data); + arg5 = (SUNErrCode)(*farg5); + arg6 = (void *)(farg6); + arg7 = (SUNContext)(farg7); + SUNLogErrHandlerFn(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7); +} + + +SWIGEXPORT void _wrap_FSUNAbortErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { + int arg1 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + SUNErrCode arg5 ; + void *arg6 = (void *) 0 ; + SUNContext arg7 = (SUNContext) 0 ; + + arg1 = (int)(*farg1); + arg2 = (char *)(farg2->data); + arg3 = (char *)(farg3->data); + arg4 = (char *)(farg4->data); + arg5 = (SUNErrCode)(*farg5); + arg6 = (void *)(farg6); + arg7 = (SUNContext)(farg7); + SUNAbortErrHandlerFn(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7); +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FSUNGetErrMsg(int const *farg1) { + SwigArrayWrapper fresult ; + SUNErrCode arg1 ; + char *result = 0 ; + + arg1 = (SUNErrCode)(*farg1); + result = (char *)SUNGetErrMsg(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_Create(int const *farg1, void *farg2) { + int fresult ; + SUNComm arg1 ; + SUNContext *arg2 = (SUNContext *) 0 ; + SUNErrCode result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (SUNContext *)(farg2); + result = (SUNErrCode)SUNContext_Create(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_GetLastError(void *farg1) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + result = (SUNErrCode)SUNContext_GetLastError(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_PeekLastError(void *farg1) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + result = (SUNErrCode)SUNContext_PeekLastError(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_PushErrHandler(void *farg1, SUNErrHandlerFn farg2, void *farg3) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNErrHandlerFn arg2 = (SUNErrHandlerFn) 0 ; + void *arg3 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNErrHandlerFn)(farg2); + arg3 = (void *)(farg3); + result = (SUNErrCode)SUNContext_PushErrHandler(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_PopErrHandler(void *farg1) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + result = (SUNErrCode)SUNContext_PopErrHandler(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_ClearErrHandlers(void *farg1) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + result = (SUNErrCode)SUNContext_ClearErrHandlers(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_GetProfiler(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNProfiler *arg2 = (SUNProfiler *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNProfiler *)(farg2); + result = (SUNErrCode)SUNContext_GetProfiler(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_SetProfiler(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNProfiler arg2 = (SUNProfiler) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNProfiler)(farg2); + result = (SUNErrCode)SUNContext_SetProfiler(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_GetLogger(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNLogger *arg2 = (SUNLogger *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNLogger *)(farg2); + result = (SUNErrCode)SUNContext_GetLogger(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_SetLogger(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNLogger arg2 = (SUNLogger) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNLogger)(farg2); + result = (SUNErrCode)SUNContext_SetLogger(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNContext_Free(void *farg1) { + int fresult ; + SUNContext *arg1 = (SUNContext *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext *)(farg1); + result = (SUNErrCode)SUNContext_Free(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_Create(int const *farg1, SwigArrayWrapper *farg2, void *farg3) { + int fresult ; + SUNComm arg1 ; + char *arg2 = (char *) 0 ; + SUNProfiler *arg3 = (SUNProfiler *) 0 ; + SUNErrCode result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (char *)(farg2->data); + arg3 = (SUNProfiler *)(farg3); + result = (SUNErrCode)SUNProfiler_Create(arg1,(char const *)arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_Free(void *farg1) { + int fresult ; + SUNProfiler *arg1 = (SUNProfiler *) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler *)(farg1); + result = (SUNErrCode)SUNProfiler_Free(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_Begin(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNProfiler_Begin(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_End(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNProfiler_End(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_GetTimerResolution(void *farg1, double *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + double *arg2 = (double *) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (double *)(farg2); + result = (SUNErrCode)SUNProfiler_GetTimerResolution(arg1,arg2); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (char *)(farg2->data); + arg3 = (double *)(farg3); + result = (SUNErrCode)SUNProfiler_GetElapsedTime(arg1,(char const *)arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_Print(void *farg1, void *farg2) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + arg2 = (FILE *)(farg2); + result = (SUNErrCode)SUNProfiler_Print(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNProfiler_Reset(void *farg1) { + int fresult ; + SUNProfiler arg1 = (SUNProfiler) 0 ; + SUNErrCode result; + + arg1 = (SUNProfiler)(farg1); + result = (SUNErrCode)SUNProfiler_Reset(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_Create(int const *farg1, int const *farg2, void *farg3) { + int fresult ; + SUNComm arg1 ; + int arg2 ; + SUNLogger *arg3 = (SUNLogger *) 0 ; + SUNErrCode result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (int)(*farg2); + arg3 = (SUNLogger *)(farg3); + result = (SUNErrCode)SUNLogger_Create(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_CreateFromEnv(int const *farg1, void *farg2) { + int fresult ; + SUNComm arg1 ; + SUNLogger *arg2 = (SUNLogger *) 0 ; + SUNErrCode result; + +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + arg1 = MPI_Comm_f2c((MPI_Fint)(*farg1)); + } else { + arg1 = SUN_COMM_NULL; + } +#else + arg1 = *farg1; +#endif + arg2 = (SUNLogger *)(farg2); + result = (SUNErrCode)SUNLogger_CreateFromEnv(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_SetErrorFilename(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNLogger_SetErrorFilename(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_SetWarningFilename(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNLogger_SetWarningFilename(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_SetDebugFilename(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNLogger_SetDebugFilename(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_SetInfoFilename(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + char *arg2 = (char *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (char *)(farg2->data); + result = (SUNErrCode)SUNLogger_SetInfoFilename(arg1,(char const *)arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_QueueMsg(void *farg1, int const *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, SwigArrayWrapper *farg5) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + SUNLogLevel arg2 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + void *arg6 = 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (SUNLogLevel)(*farg2); + arg3 = (char *)(farg3->data); + arg4 = (char *)(farg4->data); + arg5 = (char *)(farg5->data); + result = (SUNErrCode)SUNLogger_QueueMsg(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_Flush(void *farg1, int const *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + SUNLogLevel arg2 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (SUNLogLevel)(*farg2); + result = (SUNErrCode)SUNLogger_Flush(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_GetOutputRank(void *farg1, int *farg2) { + int fresult ; + SUNLogger arg1 = (SUNLogger) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNLogger_GetOutputRank(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLogger_Destroy(void *farg1) { + int fresult ; + SUNLogger *arg1 = (SUNLogger *) 0 ; + SUNErrCode result; + + arg1 = (SUNLogger *)(farg1); + result = (SUNErrCode)SUNLogger_Destroy(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNDIALSFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper *farg2, void *farg3) { + int fresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + FILE **arg3 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (char *)(farg1->data); + arg2 = (char *)(farg2->data); + arg3 = (FILE **)(farg3); + result = (SUNErrCode)SUNDIALSFileOpen((char const *)arg1,(char const *)arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNDIALSFileClose(void *farg1) { + int fresult ; + FILE **arg1 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (FILE **)(farg1); + result = (SUNErrCode)SUNDIALSFileClose(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VNewEmpty(void *farg1) { + N_Vector fresult ; + SUNContext arg1 = (SUNContext) 0 ; + N_Vector result; + + arg1 = (SUNContext)(farg1); + result = (N_Vector)N_VNewEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VFreeEmpty(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VFreeEmpty(arg1); +} + + +SWIGEXPORT int _wrap_FN_VCopyOps(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (SUNErrCode)N_VCopyOps(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VGetVectorID(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector_ID result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector_ID)N_VGetVectorID(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VClone(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VClone(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FN_VCloneEmpty(N_Vector farg1) { + N_Vector fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector result; + + arg1 = (N_Vector)(farg1); + result = (N_Vector)N_VCloneEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroy(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VDestroy(arg1); +} + + +SWIGEXPORT void _wrap_FN_VSpace(N_Vector farg1, int32_t *farg2, int32_t *farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + sunindextype *arg3 = (sunindextype *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + arg3 = (sunindextype *)(farg3); + N_VSpace(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VSetArrayPointer(double *farg1, N_Vector farg2) { + sunrealtype *arg1 = (sunrealtype *) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype *)(farg1); + arg2 = (N_Vector)(farg2); + N_VSetArrayPointer(arg1,arg2); +} + + +SWIGEXPORT int _wrap_FN_VGetCommunicator(N_Vector farg1) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNComm result; + + arg1 = (N_Vector)(farg1); + result = (SUNComm)N_VGetCommunicator(arg1); +#if SUNDIALS_MPI_ENABLED + int flag = 0; + MPI_Initialized(&flag); + if(flag) { + fresult = (int)(MPI_Comm_c2f(result)); + } else { + fresult = 0; + } +#else + fresult = result; +#endif + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLength(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLength(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FN_VGetLocalLength(N_Vector farg1) { + int32_t fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype result; + + arg1 = (N_Vector)(farg1); + result = N_VGetLocalLength(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VLinearSum(double const *farg1, N_Vector farg2, double const *farg3, N_Vector farg4, N_Vector farg5) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + N_Vector arg5 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (N_Vector)(farg5); + N_VLinearSum(arg1,arg2,arg3,arg4,arg5); +} + + +SWIGEXPORT void _wrap_FN_VConst(double const *farg1, N_Vector farg2) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + N_VConst(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VProd(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VProd(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VDiv(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VDiv(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VScale(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VScale(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VAbs(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VAbs(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VInv(N_Vector farg1, N_Vector farg2) { + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + N_VInv(arg1,arg2); +} + + +SWIGEXPORT void _wrap_FN_VAddConst(N_Vector farg1, double const *farg2, N_Vector farg3) { + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + N_VAddConst(arg1,arg2,arg3); +} + + +SWIGEXPORT double _wrap_FN_VDotProd(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProd(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNorm(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNorm(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNorm(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWrmsNorm(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWrmsNormMask(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWrmsNormMask(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMin(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMin(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWL2Norm(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWL2Norm(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1Norm(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1Norm(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VCompare(double const *farg1, N_Vector farg2, N_Vector farg3) { + sunrealtype arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (sunrealtype)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + N_VCompare(arg1,arg2,arg3); +} + + +SWIGEXPORT int _wrap_FN_VInvTest(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTest(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMask(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMask(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotient(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotient(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + result = (SUNErrCode)N_VLinearCombination(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleAddMulti(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector *arg5 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (N_Vector *)(farg5); + result = (SUNErrCode)N_VScaleAddMulti(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMulti(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMulti(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *farg2, void *farg3, double const *farg4, void *farg5, void *farg6) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype arg4 ; + N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector *arg6 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector *)(farg5); + arg6 = (N_Vector *)(farg6); + result = (SUNErrCode)N_VLinearSumVectorArray(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VScaleVectorArray(int const *farg1, double *farg2, void *farg3, void *farg4) { + int fresult ; + int arg1 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector *arg4 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector *)(farg4); + result = (SUNErrCode)N_VScaleVectorArray(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, void *farg3) { + int fresult ; + int arg1 ; + sunrealtype arg2 ; + N_Vector *arg3 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector *)(farg3); + result = (SUNErrCode)N_VConstVectorArray(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VWrmsNormVectorArray(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { + int fresult ; + int arg1 ; + N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector *)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)N_VWrmsNormMaskVectorArray(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VDotProdLocal(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VDotProdLocal(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMaxNormLocal(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMaxNormLocal(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinLocal(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VMinLocal(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VL1NormLocal(N_Vector farg1) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + result = (sunrealtype)N_VL1NormLocal(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumLocal(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VWSqrSumLocal(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VWSqrSumMaskLocal(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (sunrealtype)N_VWSqrSumMaskLocal(arg1,arg2,arg3); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VInvTestLocal(N_Vector farg1, N_Vector farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (int)N_VInvTestLocal(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VConstrMaskLocal(N_Vector farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (int)N_VConstrMaskLocal(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FN_VMinQuotientLocal(N_Vector farg1, N_Vector farg2) { + double fresult ; + N_Vector arg1 = (N_Vector) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype result; + + arg1 = (N_Vector)(farg1); + arg2 = (N_Vector)(farg2); + result = (sunrealtype)N_VMinQuotientLocal(arg1,arg2); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiLocal(int const *farg1, N_Vector farg2, void *farg3, double *farg4) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)N_VDotProdMultiLocal(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce(int const *farg1, N_Vector farg2, double *farg3) { + int fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (sunrealtype *)(farg3); + result = (SUNErrCode)N_VDotProdMultiAllReduce(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufSize(N_Vector farg1, int32_t *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype *arg2 = (sunindextype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype *)(farg2); + result = (SUNErrCode)N_VBufSize(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufPack(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufPack(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FN_VBufUnpack(N_Vector farg1, void *farg2) { + int fresult ; + N_Vector arg1 = (N_Vector) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)N_VBufUnpack(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FN_VNewVectorArray(int const *farg1, void *farg2) { + void * fresult ; + int arg1 ; + SUNContext arg2 = (SUNContext) 0 ; + N_Vector *result = 0 ; + + arg1 = (int)(*farg1); + arg2 = (SUNContext)(farg2); + result = (N_Vector *)N_VNewVectorArray(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FN_VCloneEmptyVectorArray(int const *farg1, N_Vector farg2) { + void * fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *result = 0 ; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + result = (N_Vector *)N_VCloneEmptyVectorArray(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FN_VCloneVectorArray(int const *farg1, N_Vector farg2) { + void * fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector *result = 0 ; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + result = (N_Vector *)N_VCloneVectorArray(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VDestroyVectorArray(void *farg1, int const *farg2) { + N_Vector *arg1 = (N_Vector *) 0 ; + int arg2 ; + + arg1 = (N_Vector *)(farg1); + arg2 = (int)(*farg2); + N_VDestroyVectorArray(arg1,arg2); +} + + +SWIGEXPORT N_Vector _wrap_FN_VGetVecAtIndexVectorArray(void *farg1, int const *farg2) { + N_Vector fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + int arg2 ; + N_Vector result; + + arg1 = (N_Vector *)(farg1); + arg2 = (int)(*farg2); + result = (N_Vector)N_VGetVecAtIndexVectorArray(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FN_VSetVecAtIndexVectorArray(void *farg1, int const *farg2, N_Vector farg3) { + N_Vector *arg1 = (N_Vector *) 0 ; + int arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + + arg1 = (N_Vector *)(farg1); + arg2 = (int)(*farg2); + arg3 = (N_Vector)(farg3); + N_VSetVecAtIndexVectorArray(arg1,arg2,arg3); +} + + +SWIGEXPORT void _wrap_FN_VPrint(N_Vector farg1) { + N_Vector arg1 = (N_Vector) 0 ; + + arg1 = (N_Vector)(farg1); + N_VPrint(arg1); +} + + +SWIGEXPORT void _wrap_FN_VPrintFile(N_Vector farg1, void *farg2) { + N_Vector arg1 = (N_Vector) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (FILE *)(farg2); + N_VPrintFile(arg1,arg2); +} + + + +SWIGEXPORT double * _wrap_FN_VGetArrayPointer(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetArrayPointer(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT double * _wrap_FN_VGetDeviceArrayPointer(N_Vector farg1) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunrealtype *result = 0 ; + arg1 = (N_Vector)(farg1); + result = (sunrealtype *)N_VGetDeviceArrayPointer(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT SUNMatrix _wrap_FSUNMatNewEmpty(void *farg1) { + SUNMatrix fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNMatrix result; + + arg1 = (SUNContext)(farg1); + result = (SUNMatrix)SUNMatNewEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNMatFreeEmpty(SUNMatrix farg1) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + + arg1 = (SUNMatrix)(farg1); + SUNMatFreeEmpty(arg1); +} + + +SWIGEXPORT int _wrap_FSUNMatCopyOps(SUNMatrix farg1, SUNMatrix farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatCopyOps(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatGetID(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix_ID result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix_ID)SUNMatGetID(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNMatClone(SUNMatrix farg1) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix)SUNMatClone(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNMatDestroy(SUNMatrix farg1) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + + arg1 = (SUNMatrix)(farg1); + SUNMatDestroy(arg1); +} + + +SWIGEXPORT int _wrap_FSUNMatZero(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNMatZero(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatCopy(SUNMatrix farg1, SUNMatrix farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatCopy(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAdd(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (SUNErrCode)SUNMatScaleAdd(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAddI(double const *farg1, SUNMatrix farg2) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatScaleAddI(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatMatvecSetup(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNMatMatvecSetup(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatMatvec(SUNMatrix farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNMatMatvec(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatSpace(SUNMatrix farg1, long *farg2, long *farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNMatSpace(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype **)(farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)SUNModifiedGS(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + N_Vector *arg7 = (N_Vector *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype **)(farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + arg7 = (N_Vector *)(farg7); + result = (SUNErrCode)SUNClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { + int fresult ; + int arg1 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + int arg4 ; + int result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (int)(*farg4); + result = (int)SUNQRfact(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { + int fresult ; + int arg1 ; + sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + int result; + + arg1 = (int)(*farg1); + arg2 = (sunrealtype **)(farg2); + arg3 = (sunrealtype *)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (int)SUNQRsol(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_MGS(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_ICWY(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_ICWY_SB(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_CGS2(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_DCGS2(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { + int fresult ; + N_Vector *arg1 = (N_Vector *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + int arg4 ; + int arg5 ; + void *arg6 = (void *) 0 ; + SUNErrCode result; + + arg1 = (N_Vector *)(farg1); + arg2 = (sunrealtype *)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (int)(*farg4); + arg5 = (int)(*farg5); + arg6 = (void *)(farg6); + result = (SUNErrCode)SUNQRAdd_DCGS2_SB(arg1,arg2,arg3,arg4,arg5,arg6); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSolNewEmpty(void *farg1) { + SUNLinearSolver fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (SUNContext)(farg1); + result = (SUNLinearSolver)SUNLinSolNewEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNLinSolFreeEmpty(SUNLinearSolver farg1) { + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + + arg1 = (SUNLinearSolver)(farg1); + SUNLinSolFreeEmpty(arg1); +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT SUNNonlinearSolver _wrap_FSUNNonlinSolNewEmpty(void *farg1) { + SUNNonlinearSolver fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNNonlinearSolver result; + + arg1 = (SUNContext)(farg1); + result = (SUNNonlinearSolver)SUNNonlinSolNewEmpty(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNNonlinSolFreeEmpty(SUNNonlinearSolver farg1) { + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + + arg1 = (SUNNonlinearSolver)(farg1); + SUNNonlinSolFreeEmpty(arg1); +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetType(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinearSolver_Type result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNNonlinearSolver_Type)SUNNonlinSolGetType(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolInitialize(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolInitialize(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetup(SUNNonlinearSolver farg1, N_Vector farg2, void *farg3) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + void *arg3 = (void *) 0 ; + int result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (void *)(farg3); + result = (int)SUNNonlinSolSetup(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSolve(SUNNonlinearSolver farg1, N_Vector farg2, N_Vector farg3, N_Vector farg4, double const *farg5, int const *farg6, void *farg7) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int arg6 ; + void *arg7 = (void *) 0 ; + int result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (int)(*farg6); + arg7 = (void *)(farg7); + result = (int)SUNNonlinSolSolve(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolFree(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolFree(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetSysFn(SUNNonlinearSolver farg1, SUNNonlinSolSysFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolSysFn arg2 = (SUNNonlinSolSysFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolSysFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetSysFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetLSetupFn(SUNNonlinearSolver farg1, SUNNonlinSolLSetupFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolLSetupFn arg2 = (SUNNonlinSolLSetupFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolLSetupFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetLSetupFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetLSolveFn(SUNNonlinearSolver farg1, SUNNonlinSolLSolveFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolLSolveFn arg2 = (SUNNonlinSolLSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolLSolveFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetLSolveFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetConvTestFn(SUNNonlinearSolver farg1, SUNNonlinSolConvTestFn farg2, void *farg3) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolConvTestFn arg2 = (SUNNonlinSolConvTestFn) 0 ; + void *arg3 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolConvTestFn)(farg2); + arg3 = (void *)(farg3); + result = (SUNErrCode)SUNNonlinSolSetConvTestFn(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetMaxIters(SUNNonlinearSolver farg1, int const *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNNonlinSolSetMaxIters(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumIters(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumIters(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetCurIter(SUNNonlinearSolver farg1, int *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetCurIter(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumConvFails(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumConvFails(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +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 void _wrap_FSUNAdaptController_DestroyEmpty(SUNAdaptController farg1) { + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + + arg1 = (SUNAdaptController)(farg1); + SUNAdaptController_DestroyEmpty(arg1); +} + + +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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_Destroy(arg1); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype *)(farg5); + result = (SUNErrCode)SUNAdaptController_EstimateStep(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_Reset(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNErrCode)SUNAdaptController_SetDefaults(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + FILE *arg2 = (FILE *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (FILE *)(farg2); + result = (SUNErrCode)SUNAdaptController_Write(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias(SUNAdaptController farg1, double const *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNAdaptController_SetErrorBias(arg1,arg2); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + result = (SUNErrCode)SUNAdaptController_UpdateH(arg1,arg2,arg3); + fresult = (SUNErrCode)(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNAdaptController_Space(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 new file mode 100644 index 0000000000..f47a3141f2 --- /dev/null +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -0,0 +1,4789 @@ +! 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-2024, 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 +! --------------------------------------------------------------- + + +! --------------------------------------------------------------- +! Programmer(s): Auto-generated by swig. +! --------------------------------------------------------------- +! SUNDIALS Copyright Start +! Copyright (c) 2002-2024, 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 fsundials_core_mod + use, intrinsic :: ISO_C_BINDING + implicit none + private + + ! DECLARATION CONSTRUCTS + +#if SUNDIALS_MPI_ENABLED + include "mpif.h" + integer(C_INT), protected, public :: SUN_COMM_NULL = MPI_COMM_NULL +#else + integer(C_INT), protected, public, & + bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL +#endif + + integer(C_INT), protected, public, & + bind(C, name="_wrap_SUNFALSE") :: SUNFALSE + integer(C_INT), protected, public, & + bind(C, name="_wrap_SUNTRUE") :: SUNTRUE + ! typedef enum SUNOutputFormat + enum, bind(c) + enumerator :: SUN_OUTPUTFORMAT_TABLE + enumerator :: SUN_OUTPUTFORMAT_CSV + end enum + integer, parameter, public :: SUNOutputFormat = kind(SUN_OUTPUTFORMAT_TABLE) + public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV + enum, bind(c) + enumerator :: SUN_ERR_MINIMUM = -10000 + enumerator :: SUN_ERR_ARG_CORRUPT + enumerator :: SUN_ERR_ARG_INCOMPATIBLE + enumerator :: SUN_ERR_ARG_OUTOFRANGE + enumerator :: SUN_ERR_ARG_WRONGTYPE + enumerator :: SUN_ERR_ARG_DIMSMISMATCH + enumerator :: SUN_ERR_GENERIC + enumerator :: SUN_ERR_CORRUPT + enumerator :: SUN_ERR_OUTOFRANGE + enumerator :: SUN_ERR_FILE_OPEN + enumerator :: SUN_ERR_OP_FAIL + enumerator :: SUN_ERR_MEM_FAIL + enumerator :: SUN_ERR_MALLOC_FAIL + enumerator :: SUN_ERR_EXT_FAIL + enumerator :: SUN_ERR_DESTROY_FAIL + enumerator :: SUN_ERR_NOT_IMPLEMENTED + enumerator :: SUN_ERR_USER_FCN_FAIL + enumerator :: SUN_ERR_PROFILER_MAPFULL + enumerator :: SUN_ERR_PROFILER_MAPGET + enumerator :: SUN_ERR_PROFILER_MAPINSERT + enumerator :: SUN_ERR_PROFILER_MAPKEYNOTFOUND + enumerator :: SUN_ERR_PROFILER_MAPSORT + enumerator :: SUN_ERR_SUNCTX_CORRUPT + enumerator :: SUN_ERR_MPI_FAIL + enumerator :: SUN_ERR_UNREACHABLE + enumerator :: SUN_ERR_UNKNOWN + enumerator :: SUN_ERR_MAXIMUM = -1000 + enumerator :: SUN_SUCCESS = 0 + end enum + public :: SUN_ERR_MINIMUM, SUN_ERR_ARG_CORRUPT, SUN_ERR_ARG_INCOMPATIBLE, SUN_ERR_ARG_OUTOFRANGE, SUN_ERR_ARG_WRONGTYPE, & + SUN_ERR_ARG_DIMSMISMATCH, SUN_ERR_GENERIC, SUN_ERR_CORRUPT, SUN_ERR_OUTOFRANGE, SUN_ERR_FILE_OPEN, SUN_ERR_OP_FAIL, & + SUN_ERR_MEM_FAIL, SUN_ERR_MALLOC_FAIL, SUN_ERR_EXT_FAIL, SUN_ERR_DESTROY_FAIL, SUN_ERR_NOT_IMPLEMENTED, & + SUN_ERR_USER_FCN_FAIL, SUN_ERR_PROFILER_MAPFULL, SUN_ERR_PROFILER_MAPGET, SUN_ERR_PROFILER_MAPINSERT, & + SUN_ERR_PROFILER_MAPKEYNOTFOUND, SUN_ERR_PROFILER_MAPSORT, SUN_ERR_SUNCTX_CORRUPT, SUN_ERR_MPI_FAIL, SUN_ERR_UNREACHABLE, & + SUN_ERR_UNKNOWN, SUN_ERR_MAXIMUM, SUN_SUCCESS + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FSUNLogErrHandlerFn + public :: FSUNAbortErrHandlerFn + public :: FSUNGetErrMsg + public :: FSUNContext_Create + public :: FSUNContext_GetLastError + public :: FSUNContext_PeekLastError + public :: FSUNContext_PushErrHandler + public :: FSUNContext_PopErrHandler + public :: FSUNContext_ClearErrHandlers + public :: FSUNContext_GetProfiler + public :: FSUNContext_SetProfiler + public :: FSUNContext_GetLogger + public :: FSUNContext_SetLogger + public :: FSUNContext_Free + public :: FSUNProfiler_Create + public :: FSUNProfiler_Free + public :: FSUNProfiler_Begin + public :: FSUNProfiler_End + public :: FSUNProfiler_GetTimerResolution + public :: FSUNProfiler_GetElapsedTime + public :: FSUNProfiler_Print + public :: FSUNProfiler_Reset + ! typedef enum SUNLogLevel + enum, bind(c) + enumerator :: SUN_LOGLEVEL_ALL = -1 + enumerator :: SUN_LOGLEVEL_NONE = 0 + enumerator :: SUN_LOGLEVEL_ERROR = 1 + enumerator :: SUN_LOGLEVEL_WARNING = 2 + enumerator :: SUN_LOGLEVEL_INFO = 3 + enumerator :: SUN_LOGLEVEL_DEBUG = 4 + end enum + integer, parameter, public :: SUNLogLevel = kind(SUN_LOGLEVEL_ALL) + public :: SUN_LOGLEVEL_ALL, SUN_LOGLEVEL_NONE, SUN_LOGLEVEL_ERROR, SUN_LOGLEVEL_WARNING, SUN_LOGLEVEL_INFO, & + SUN_LOGLEVEL_DEBUG + public :: FSUNLogger_Create + public :: FSUNLogger_CreateFromEnv + public :: FSUNLogger_SetErrorFilename + public :: FSUNLogger_SetWarningFilename + public :: FSUNLogger_SetDebugFilename + public :: FSUNLogger_SetInfoFilename + public :: FSUNLogger_QueueMsg + public :: FSUNLogger_Flush + public :: FSUNLogger_GetOutputRank + public :: FSUNLogger_Destroy + public :: FSUNDIALSFileOpen + public :: FSUNDIALSFileClose + ! typedef enum N_Vector_ID + enum, bind(c) + enumerator :: SUNDIALS_NVEC_SERIAL + enumerator :: SUNDIALS_NVEC_PARALLEL + enumerator :: SUNDIALS_NVEC_OPENMP + enumerator :: SUNDIALS_NVEC_PTHREADS + enumerator :: SUNDIALS_NVEC_PARHYP + enumerator :: SUNDIALS_NVEC_PETSC + enumerator :: SUNDIALS_NVEC_CUDA + enumerator :: SUNDIALS_NVEC_HIP + enumerator :: SUNDIALS_NVEC_SYCL + enumerator :: SUNDIALS_NVEC_RAJA + enumerator :: SUNDIALS_NVEC_KOKKOS + enumerator :: SUNDIALS_NVEC_OPENMPDEV + enumerator :: SUNDIALS_NVEC_TRILINOS + enumerator :: SUNDIALS_NVEC_MANYVECTOR + enumerator :: SUNDIALS_NVEC_MPIMANYVECTOR + enumerator :: SUNDIALS_NVEC_MPIPLUSX + enumerator :: SUNDIALS_NVEC_CUSTOM + end enum + integer, parameter, public :: N_Vector_ID = kind(SUNDIALS_NVEC_SERIAL) + public :: SUNDIALS_NVEC_SERIAL, SUNDIALS_NVEC_PARALLEL, SUNDIALS_NVEC_OPENMP, SUNDIALS_NVEC_PTHREADS, SUNDIALS_NVEC_PARHYP, & + SUNDIALS_NVEC_PETSC, SUNDIALS_NVEC_CUDA, SUNDIALS_NVEC_HIP, SUNDIALS_NVEC_SYCL, SUNDIALS_NVEC_RAJA, SUNDIALS_NVEC_KOKKOS, & + SUNDIALS_NVEC_OPENMPDEV, SUNDIALS_NVEC_TRILINOS, SUNDIALS_NVEC_MANYVECTOR, SUNDIALS_NVEC_MPIMANYVECTOR, & + SUNDIALS_NVEC_MPIPLUSX, SUNDIALS_NVEC_CUSTOM + ! struct struct _generic_N_Vector_Ops + type, bind(C), public :: N_Vector_Ops + type(C_FUNPTR), public :: nvgetvectorid + type(C_FUNPTR), public :: nvclone + type(C_FUNPTR), public :: nvcloneempty + type(C_FUNPTR), public :: nvdestroy + type(C_FUNPTR), public :: nvspace + type(C_FUNPTR), public :: nvgetarraypointer + type(C_FUNPTR), public :: nvgetdevicearraypointer + type(C_FUNPTR), public :: nvsetarraypointer + type(C_FUNPTR), public :: nvgetcommunicator + type(C_FUNPTR), public :: nvgetlength + type(C_FUNPTR), public :: nvgetlocallength + type(C_FUNPTR), public :: nvlinearsum + type(C_FUNPTR), public :: nvconst + type(C_FUNPTR), public :: nvprod + type(C_FUNPTR), public :: nvdiv + type(C_FUNPTR), public :: nvscale + type(C_FUNPTR), public :: nvabs + type(C_FUNPTR), public :: nvinv + type(C_FUNPTR), public :: nvaddconst + type(C_FUNPTR), public :: nvdotprod + type(C_FUNPTR), public :: nvmaxnorm + type(C_FUNPTR), public :: nvwrmsnorm + type(C_FUNPTR), public :: nvwrmsnormmask + type(C_FUNPTR), public :: nvmin + type(C_FUNPTR), public :: nvwl2norm + type(C_FUNPTR), public :: nvl1norm + type(C_FUNPTR), public :: nvcompare + type(C_FUNPTR), public :: nvinvtest + type(C_FUNPTR), public :: nvconstrmask + type(C_FUNPTR), public :: nvminquotient + type(C_FUNPTR), public :: nvlinearcombination + type(C_FUNPTR), public :: nvscaleaddmulti + type(C_FUNPTR), public :: nvdotprodmulti + type(C_FUNPTR), public :: nvlinearsumvectorarray + type(C_FUNPTR), public :: nvscalevectorarray + type(C_FUNPTR), public :: nvconstvectorarray + type(C_FUNPTR), public :: nvwrmsnormvectorarray + type(C_FUNPTR), public :: nvwrmsnormmaskvectorarray + type(C_FUNPTR), public :: nvscaleaddmultivectorarray + type(C_FUNPTR), public :: nvlinearcombinationvectorarray + type(C_FUNPTR), public :: nvdotprodlocal + type(C_FUNPTR), public :: nvmaxnormlocal + type(C_FUNPTR), public :: nvminlocal + type(C_FUNPTR), public :: nvl1normlocal + type(C_FUNPTR), public :: nvinvtestlocal + type(C_FUNPTR), public :: nvconstrmasklocal + type(C_FUNPTR), public :: nvminquotientlocal + type(C_FUNPTR), public :: nvwsqrsumlocal + type(C_FUNPTR), public :: nvwsqrsummasklocal + type(C_FUNPTR), public :: nvdotprodmultilocal + type(C_FUNPTR), public :: nvdotprodmultiallreduce + type(C_FUNPTR), public :: nvbufsize + type(C_FUNPTR), public :: nvbufpack + type(C_FUNPTR), public :: nvbufunpack + type(C_FUNPTR), public :: nvprint + type(C_FUNPTR), public :: nvprintfile + end type N_Vector_Ops + ! struct struct _generic_N_Vector + type, bind(C), public :: N_Vector + type(C_PTR), public :: content + type(C_PTR), public :: ops + type(C_PTR), public :: sunctx + end type N_Vector + public :: FN_VNewEmpty + public :: FN_VFreeEmpty + public :: FN_VCopyOps + public :: FN_VGetVectorID + public :: FN_VClone + public :: FN_VCloneEmpty + public :: FN_VDestroy + public :: FN_VSpace + public :: FN_VSetArrayPointer + public :: FN_VGetCommunicator + public :: FN_VGetLength + public :: FN_VGetLocalLength + public :: FN_VLinearSum + public :: FN_VConst + public :: FN_VProd + public :: FN_VDiv + public :: FN_VScale + public :: FN_VAbs + public :: FN_VInv + public :: FN_VAddConst + public :: FN_VDotProd + public :: FN_VMaxNorm + public :: FN_VWrmsNorm + public :: FN_VWrmsNormMask + public :: FN_VMin + public :: FN_VWL2Norm + public :: FN_VL1Norm + public :: FN_VCompare + public :: FN_VInvTest + public :: FN_VConstrMask + public :: FN_VMinQuotient + public :: FN_VLinearCombination + public :: FN_VScaleAddMulti + public :: FN_VDotProdMulti + public :: FN_VLinearSumVectorArray + public :: FN_VScaleVectorArray + public :: FN_VConstVectorArray + public :: FN_VWrmsNormVectorArray + public :: FN_VWrmsNormMaskVectorArray + public :: FN_VDotProdLocal + public :: FN_VMaxNormLocal + public :: FN_VMinLocal + public :: FN_VL1NormLocal + public :: FN_VWSqrSumLocal + public :: FN_VWSqrSumMaskLocal + public :: FN_VInvTestLocal + public :: FN_VConstrMaskLocal + public :: FN_VMinQuotientLocal + public :: FN_VDotProdMultiLocal + public :: FN_VDotProdMultiAllReduce + public :: FN_VBufSize + public :: FN_VBufPack + public :: FN_VBufUnpack + public :: FN_VNewVectorArray + public :: FN_VCloneEmptyVectorArray + public :: FN_VCloneVectorArray + public :: FN_VDestroyVectorArray + public :: FN_VGetVecAtIndexVectorArray + public :: FN_VSetVecAtIndexVectorArray + public :: FN_VPrint + public :: FN_VPrintFile + + public :: FN_VGetArrayPointer + public :: FN_VGetDeviceArrayPointer + + ! typedef enum SUNMatrix_ID + enum, bind(c) + enumerator :: SUNMATRIX_DENSE + enumerator :: SUNMATRIX_MAGMADENSE + enumerator :: SUNMATRIX_ONEMKLDENSE + enumerator :: SUNMATRIX_BAND + enumerator :: SUNMATRIX_SPARSE + enumerator :: SUNMATRIX_SLUNRLOC + enumerator :: SUNMATRIX_CUSPARSE + enumerator :: SUNMATRIX_GINKGO + enumerator :: SUNMATRIX_KOKKOSDENSE + enumerator :: SUNMATRIX_CUSTOM + end enum + integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) + public :: SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, SUNMATRIX_ONEMKLDENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, & + SUNMATRIX_CUSPARSE, SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM + ! struct struct _generic_SUNMatrix_Ops + type, bind(C), public :: SUNMatrix_Ops + type(C_FUNPTR), public :: getid + type(C_FUNPTR), public :: clone + type(C_FUNPTR), public :: destroy + type(C_FUNPTR), public :: zero + type(C_FUNPTR), public :: copy + type(C_FUNPTR), public :: scaleadd + type(C_FUNPTR), public :: scaleaddi + type(C_FUNPTR), public :: matvecsetup + type(C_FUNPTR), public :: matvec + type(C_FUNPTR), public :: space + end type SUNMatrix_Ops + ! struct struct _generic_SUNMatrix + type, bind(C), public :: SUNMatrix + type(C_PTR), public :: content + type(C_PTR), public :: ops + type(C_PTR), public :: sunctx + end type SUNMatrix + public :: FSUNMatNewEmpty + public :: FSUNMatFreeEmpty + public :: FSUNMatCopyOps + public :: FSUNMatGetID + public :: FSUNMatClone + public :: FSUNMatDestroy + public :: FSUNMatZero + public :: FSUNMatCopy + public :: FSUNMatScaleAdd + public :: FSUNMatScaleAddI + public :: FSUNMatMatvecSetup + public :: FSUNMatMatvec + public :: FSUNMatSpace + enum, bind(c) + enumerator :: SUN_PREC_NONE + enumerator :: SUN_PREC_LEFT + enumerator :: SUN_PREC_RIGHT + enumerator :: SUN_PREC_BOTH + end enum + public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH + enum, bind(c) + enumerator :: SUN_MODIFIED_GS = 1 + enumerator :: SUN_CLASSICAL_GS = 2 + end enum + public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS + public :: FSUNModifiedGS + public :: FSUNClassicalGS + public :: FSUNQRfact + public :: FSUNQRsol + public :: FSUNQRAdd_MGS + public :: FSUNQRAdd_ICWY + public :: FSUNQRAdd_ICWY_SB + public :: FSUNQRAdd_CGS2 + public :: FSUNQRAdd_DCGS2 + public :: FSUNQRAdd_DCGS2_SB + ! typedef enum SUNLinearSolver_Type + enum, bind(c) + enumerator :: SUNLINEARSOLVER_DIRECT + enumerator :: SUNLINEARSOLVER_ITERATIVE + enumerator :: SUNLINEARSOLVER_MATRIX_ITERATIVE + enumerator :: SUNLINEARSOLVER_MATRIX_EMBEDDED + end enum + integer, parameter, public :: SUNLinearSolver_Type = kind(SUNLINEARSOLVER_DIRECT) + public :: SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, & + SUNLINEARSOLVER_MATRIX_EMBEDDED + ! typedef enum SUNLinearSolver_ID + enum, bind(c) + enumerator :: SUNLINEARSOLVER_BAND + enumerator :: SUNLINEARSOLVER_DENSE + enumerator :: SUNLINEARSOLVER_KLU + enumerator :: SUNLINEARSOLVER_LAPACKBAND + enumerator :: SUNLINEARSOLVER_LAPACKDENSE + enumerator :: SUNLINEARSOLVER_PCG + enumerator :: SUNLINEARSOLVER_SPBCGS + enumerator :: SUNLINEARSOLVER_SPFGMR + enumerator :: SUNLINEARSOLVER_SPGMR + enumerator :: SUNLINEARSOLVER_SPTFQMR + enumerator :: SUNLINEARSOLVER_SUPERLUDIST + enumerator :: SUNLINEARSOLVER_SUPERLUMT + enumerator :: SUNLINEARSOLVER_CUSOLVERSP_BATCHQR + enumerator :: SUNLINEARSOLVER_MAGMADENSE + enumerator :: SUNLINEARSOLVER_ONEMKLDENSE + enumerator :: SUNLINEARSOLVER_GINKGO + enumerator :: SUNLINEARSOLVER_KOKKOSDENSE + enumerator :: SUNLINEARSOLVER_CUSTOM + end enum + integer, parameter, public :: SUNLinearSolver_ID = kind(SUNLINEARSOLVER_BAND) + public :: SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, SUNLINEARSOLVER_KLU, SUNLINEARSOLVER_LAPACKBAND, & + SUNLINEARSOLVER_LAPACKDENSE, SUNLINEARSOLVER_PCG, SUNLINEARSOLVER_SPBCGS, SUNLINEARSOLVER_SPFGMR, SUNLINEARSOLVER_SPGMR, & + SUNLINEARSOLVER_SPTFQMR, SUNLINEARSOLVER_SUPERLUDIST, SUNLINEARSOLVER_SUPERLUMT, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, & + SUNLINEARSOLVER_MAGMADENSE, SUNLINEARSOLVER_ONEMKLDENSE, SUNLINEARSOLVER_GINKGO, SUNLINEARSOLVER_KOKKOSDENSE, & + SUNLINEARSOLVER_CUSTOM + ! struct struct _generic_SUNLinearSolver_Ops + type, bind(C), public :: SUNLinearSolver_Ops + type(C_FUNPTR), public :: gettype + type(C_FUNPTR), public :: getid + type(C_FUNPTR), public :: setatimes + type(C_FUNPTR), public :: setpreconditioner + type(C_FUNPTR), public :: setscalingvectors + type(C_FUNPTR), public :: setzeroguess + type(C_FUNPTR), public :: initialize + type(C_FUNPTR), public :: setup + type(C_FUNPTR), public :: solve + type(C_FUNPTR), public :: numiters + type(C_FUNPTR), public :: resnorm + type(C_FUNPTR), public :: lastflag + type(C_FUNPTR), public :: space + type(C_FUNPTR), public :: resid + type(C_FUNPTR), public :: free + end type SUNLinearSolver_Ops + ! struct struct _generic_SUNLinearSolver + type, bind(C), public :: SUNLinearSolver + type(C_PTR), public :: content + type(C_PTR), public :: ops + type(C_PTR), public :: sunctx + end type SUNLinearSolver + public :: FSUNLinSolNewEmpty + public :: FSUNLinSolFreeEmpty + public :: FSUNLinSolGetType + public :: FSUNLinSolGetID + public :: FSUNLinSolSetATimes + public :: FSUNLinSolSetPreconditioner + public :: FSUNLinSolSetScalingVectors + public :: FSUNLinSolSetZeroGuess + public :: FSUNLinSolInitialize + public :: FSUNLinSolSetup + public :: FSUNLinSolSolve + public :: FSUNLinSolNumIters + public :: FSUNLinSolResNorm + public :: FSUNLinSolResid + public :: FSUNLinSolLastFlag + public :: FSUNLinSolSpace + public :: FSUNLinSolFree + integer(C_INT), parameter, public :: SUNLS_ATIMES_NULL = -804_C_INT + integer(C_INT), parameter, public :: SUNLS_ATIMES_FAIL_UNREC = -805_C_INT + integer(C_INT), parameter, public :: SUNLS_PSET_FAIL_UNREC = -806_C_INT + integer(C_INT), parameter, public :: SUNLS_PSOLVE_NULL = -807_C_INT + integer(C_INT), parameter, public :: SUNLS_PSOLVE_FAIL_UNREC = -808_C_INT + integer(C_INT), parameter, public :: SUNLS_GS_FAIL = -810_C_INT + integer(C_INT), parameter, public :: SUNLS_QRSOL_FAIL = -811_C_INT + integer(C_INT), parameter, public :: SUNLS_RECOV_FAILURE = 800_C_INT + integer(C_INT), parameter, public :: SUNLS_RES_REDUCED = 801_C_INT + integer(C_INT), parameter, public :: SUNLS_CONV_FAIL = 802_C_INT + integer(C_INT), parameter, public :: SUNLS_ATIMES_FAIL_REC = 803_C_INT + integer(C_INT), parameter, public :: SUNLS_PSET_FAIL_REC = 804_C_INT + integer(C_INT), parameter, public :: SUNLS_PSOLVE_FAIL_REC = 805_C_INT + integer(C_INT), parameter, public :: SUNLS_PACKAGE_FAIL_REC = 806_C_INT + integer(C_INT), parameter, public :: SUNLS_QRFACT_FAIL = 807_C_INT + integer(C_INT), parameter, public :: SUNLS_LUFACT_FAIL = 808_C_INT + ! typedef enum SUNNonlinearSolver_Type + enum, bind(c) + enumerator :: SUNNONLINEARSOLVER_ROOTFIND + enumerator :: SUNNONLINEARSOLVER_FIXEDPOINT + end enum + integer, parameter, public :: SUNNonlinearSolver_Type = kind(SUNNONLINEARSOLVER_ROOTFIND) + public :: SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT + ! struct struct _generic_SUNNonlinearSolver_Ops + type, bind(C), public :: SUNNonlinearSolver_Ops + type(C_FUNPTR), public :: gettype + type(C_FUNPTR), public :: initialize + type(C_FUNPTR), public :: setup + type(C_FUNPTR), public :: solve + type(C_FUNPTR), public :: free + type(C_FUNPTR), public :: setsysfn + type(C_FUNPTR), public :: setlsetupfn + type(C_FUNPTR), public :: setlsolvefn + type(C_FUNPTR), public :: setctestfn + type(C_FUNPTR), public :: setmaxiters + type(C_FUNPTR), public :: getnumiters + type(C_FUNPTR), public :: getcuriter + type(C_FUNPTR), public :: getnumconvfails + end type SUNNonlinearSolver_Ops + ! struct struct _generic_SUNNonlinearSolver + type, bind(C), public :: SUNNonlinearSolver + type(C_PTR), public :: content + type(C_PTR), public :: ops + type(C_PTR), public :: sunctx + end type SUNNonlinearSolver + public :: FSUNNonlinSolNewEmpty + public :: FSUNNonlinSolFreeEmpty + public :: FSUNNonlinSolGetType + public :: FSUNNonlinSolInitialize + public :: FSUNNonlinSolSetup + public :: FSUNNonlinSolSolve + public :: FSUNNonlinSolFree + public :: FSUNNonlinSolSetSysFn + public :: FSUNNonlinSolSetLSetupFn + public :: FSUNNonlinSolSetLSolveFn + public :: FSUNNonlinSolSetConvTestFn + public :: FSUNNonlinSolSetMaxIters + public :: FSUNNonlinSolGetNumIters + public :: FSUNNonlinSolGetCurIter + public :: FSUNNonlinSolGetNumConvFails + integer(C_INT), parameter, public :: SUN_NLS_CONTINUE = +901_C_INT + integer(C_INT), parameter, public :: SUN_NLS_CONV_RECVR = +902_C_INT + ! 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_DestroyEmpty + 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 + +! WRAPPER DECLARATIONS +interface +subroutine swigc_FSUNLogErrHandlerFn(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNLogErrHandlerFn") +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +end subroutine + +subroutine swigc_FSUNAbortErrHandlerFn(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNAbortErrHandlerFn") +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +end subroutine + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FSUNGetErrMsg(farg1) & +bind(C, name="_wrap_FSUNGetErrMsg") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FSUNContext_Create(farg1, farg2) & +bind(C, name="_wrap_FSUNContext_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNContext_GetLastError(farg1) & +bind(C, name="_wrap_FSUNContext_GetLastError") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNContext_PeekLastError(farg1) & +bind(C, name="_wrap_FSUNContext_PeekLastError") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNContext_PushErrHandler(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNContext_PushErrHandler") & +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_FSUNContext_PopErrHandler(farg1) & +bind(C, name="_wrap_FSUNContext_PopErrHandler") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNContext_ClearErrHandlers(farg1) & +bind(C, name="_wrap_FSUNContext_ClearErrHandlers") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNContext_GetProfiler(farg1, farg2) & +bind(C, name="_wrap_FSUNContext_GetProfiler") & +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_FSUNContext_SetProfiler(farg1, farg2) & +bind(C, name="_wrap_FSUNContext_SetProfiler") & +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_FSUNContext_GetLogger(farg1, farg2) & +bind(C, name="_wrap_FSUNContext_GetLogger") & +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_FSUNContext_SetLogger(farg1, farg2) & +bind(C, name="_wrap_FSUNContext_SetLogger") & +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_FSUNContext_Free(farg1) & +bind(C, name="_wrap_FSUNContext_Free") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_Create(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNProfiler_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_Free(farg1) & +bind(C, name="_wrap_FSUNProfiler_Free") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_Begin(farg1, farg2) & +bind(C, name="_wrap_FSUNProfiler_Begin") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_End(farg1, farg2) & +bind(C, name="_wrap_FSUNProfiler_End") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: 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) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNProfiler_Reset(farg1) & +bind(C, name="_wrap_FSUNProfiler_Reset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_Create(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLogger_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_CreateFromEnv(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_CreateFromEnv") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_SetErrorFilename(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_SetErrorFilename") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_SetWarningFilename(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_SetWarningFilename") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_SetDebugFilename(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_SetDebugFilename") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_SetInfoFilename(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_SetInfoFilename") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_QueueMsg(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLogger_QueueMsg") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +type(SwigArrayWrapper) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLogger_Flush(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_Flush") & +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_FSUNLogger_GetOutputRank(farg1, farg2) & +bind(C, name="_wrap_FSUNLogger_GetOutputRank") & +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_FSUNLogger_Destroy(farg1) & +bind(C, name="_wrap_FSUNLogger_Destroy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNDIALSFileOpen") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNDIALSFileClose(farg1) & +bind(C, name="_wrap_FSUNDIALSFileClose") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VNewEmpty(farg1) & +bind(C, name="_wrap_FN_VNewEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VFreeEmpty(farg1) & +bind(C, name="_wrap_FN_VFreeEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FN_VCopyOps(farg1, farg2) & +bind(C, name="_wrap_FN_VCopyOps") & +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_FN_VGetVectorID(farg1) & +bind(C, name="_wrap_FN_VGetVectorID") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VClone(farg1) & +bind(C, name="_wrap_FN_VClone") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VCloneEmpty(farg1) & +bind(C, name="_wrap_FN_VCloneEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroy(farg1) & +bind(C, name="_wrap_FN_VDestroy") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSpace") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VSetArrayPointer(farg1, farg2) & +bind(C, name="_wrap_FN_VSetArrayPointer") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FN_VGetCommunicator(farg1) & +bind(C, name="_wrap_FN_VGetCommunicator") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FN_VGetLength(farg1) & +bind(C, name="_wrap_FN_VGetLength") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FN_VGetLocalLength(farg1) & +bind(C, name="_wrap_FN_VGetLocalLength") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +subroutine swigc_FN_VLinearSum(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VLinearSum") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +end subroutine + +subroutine swigc_FN_VConst(farg1, farg2) & +bind(C, name="_wrap_FN_VConst") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VProd(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VProd") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VDiv(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDiv") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VScale(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VScale") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VAbs(farg1, farg2) & +bind(C, name="_wrap_FN_VAbs") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VInv(farg1, farg2) & +bind(C, name="_wrap_FN_VInv") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +subroutine swigc_FN_VAddConst(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VAddConst") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VDotProd(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProd") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNorm(farg1) & +bind(C, name="_wrap_FN_VMaxNorm") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNorm(farg1, farg2) & +bind(C, name="_wrap_FN_VWrmsNorm") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWrmsNormMask(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWrmsNormMask") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMin(farg1) & +bind(C, name="_wrap_FN_VMin") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWL2Norm(farg1, farg2) & +bind(C, name="_wrap_FN_VWL2Norm") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1Norm(farg1) & +bind(C, name="_wrap_FN_VL1Norm") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_FN_VCompare(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VCompare") +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +function swigc_FN_VInvTest(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTest") & +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_FN_VConstrMask(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMask") & +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_FN_VMinQuotient(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotient") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VLinearCombination(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VLinearCombination") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleAddMulti(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VScaleAddMulti") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMulti(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMulti") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VLinearSumVectorArray(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FN_VLinearSumVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FN_VScaleVectorArray(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VScaleVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VConstVectorArray(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormVectorArray(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VWrmsNormVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VWrmsNormMaskVectorArray(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FN_VWrmsNormMaskVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdLocal(farg1, farg2) & +bind(C, name="_wrap_FN_VDotProdLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMaxNormLocal(farg1) & +bind(C, name="_wrap_FN_VMaxNormLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VMinLocal(farg1) & +bind(C, name="_wrap_FN_VMinLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VL1NormLocal(farg1) & +bind(C, name="_wrap_FN_VL1NormLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumLocal(farg1, farg2) & +bind(C, name="_wrap_FN_VWSqrSumLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VWSqrSumMaskLocal(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VWSqrSumMaskLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VInvTestLocal(farg1, farg2) & +bind(C, name="_wrap_FN_VInvTestLocal") & +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_FN_VConstrMaskLocal(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VConstrMaskLocal") & +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_FN_VMinQuotientLocal(farg1, farg2) & +bind(C, name="_wrap_FN_VMinQuotientLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE) :: fresult +end function + +function swigc_FN_VDotProdMultiLocal(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FN_VDotProdMultiLocal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FN_VDotProdMultiAllReduce(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VDotProdMultiAllReduce") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FN_VBufSize(farg1, farg2) & +bind(C, name="_wrap_FN_VBufSize") & +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_FN_VBufPack(farg1, farg2) & +bind(C, name="_wrap_FN_VBufPack") & +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_FN_VBufUnpack(farg1, farg2) & +bind(C, name="_wrap_FN_VBufUnpack") & +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_FN_VNewVectorArray(farg1, farg2) & +bind(C, name="_wrap_FN_VNewVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VCloneEmptyVectorArray(farg1, farg2) & +bind(C, name="_wrap_FN_VCloneEmptyVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FN_VCloneVectorArray(farg1, farg2) & +bind(C, name="_wrap_FN_VCloneVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VDestroyVectorArray(farg1, farg2) & +bind(C, name="_wrap_FN_VDestroyVectorArray") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_FN_VGetVecAtIndexVectorArray(farg1, farg2) & +bind(C, name="_wrap_FN_VGetVecAtIndexVectorArray") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR) :: fresult +end function + +subroutine swigc_FN_VSetVecAtIndexVectorArray(farg1, farg2, farg3) & +bind(C, name="_wrap_FN_VSetVecAtIndexVectorArray") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +end subroutine + +subroutine swigc_FN_VPrint(farg1) & +bind(C, name="_wrap_FN_VPrint") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +subroutine swigc_FN_VPrintFile(farg1, farg2) & +bind(C, name="_wrap_FN_VPrintFile") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + + +function swigc_FN_VGetArrayPointer(farg1) & +bind(C, name="_wrap_FN_VGetArrayPointer") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FN_VGetDeviceArrayPointer(farg1) & +bind(C, name="_wrap_FN_VGetDeviceArrayPointer") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNMatNewEmpty(farg1) & +bind(C, name="_wrap_FSUNMatNewEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNMatFreeEmpty(farg1) & +bind(C, name="_wrap_FSUNMatFreeEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNMatCopyOps(farg1, farg2) & +bind(C, name="_wrap_FSUNMatCopyOps") & +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_FSUNMatGetID(farg1) & +bind(C, name="_wrap_FSUNMatGetID") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatClone(farg1) & +bind(C, name="_wrap_FSUNMatClone") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNMatDestroy(farg1) & +bind(C, name="_wrap_FSUNMatDestroy") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNMatZero(farg1) & +bind(C, name="_wrap_FSUNMatZero") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatCopy(farg1, farg2) & +bind(C, name="_wrap_FSUNMatCopy") & +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_FSUNMatScaleAdd(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatScaleAdd") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatScaleAddI(farg1, farg2) & +bind(C, name="_wrap_FSUNMatScaleAddI") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatMatvecSetup(farg1) & +bind(C, name="_wrap_FSUNMatMatvecSetup") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatMatvec(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatMatvec") & +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_FSUNMatSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatSpace") & +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_FSUNModifiedGS(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNModifiedGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNClassicalGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRfact(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNQRfact") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRsol(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNQRsol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_MGS(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_MGS") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_ICWY(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_ICWY") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_ICWY_SB(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_ICWY_SB") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_CGS2(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_CGS2") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_DCGS2(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_DCGS2") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNQRAdd_DCGS2_SB(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSUNQRAdd_DCGS2_SB") & +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), intent(in) :: farg4 +integer(C_INT), intent(in) :: farg5 +type(C_PTR), value :: farg6 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNewEmpty(farg1) & +bind(C, name="_wrap_FSUNLinSolNewEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNLinSolFreeEmpty(farg1) & +bind(C, name="_wrap_FSUNLinSolFreeEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNLinSolGetType(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors") & +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_FSUNLinSolSetZeroGuess(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess") & +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_FSUNLinSolInitialize(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup") & +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_FSUNLinSolSolve(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid(farg1) & +bind(C, name="_wrap_FSUNLinSolResid") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace") & +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_FSUNLinSolFree(farg1) & +bind(C, name="_wrap_FSUNLinSolFree") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolNewEmpty(farg1) & +bind(C, name="_wrap_FSUNNonlinSolNewEmpty") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNNonlinSolFreeEmpty(farg1) & +bind(C, name="_wrap_FSUNNonlinSolFreeEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNNonlinSolGetType(farg1) & +bind(C, name="_wrap_FSUNNonlinSolGetType") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolInitialize(farg1) & +bind(C, name="_wrap_FSUNNonlinSolInitialize") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetup(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSolSetup") & +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_FSUNNonlinSolSolve(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNNonlinSolSolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT), intent(in) :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolFree(farg1) & +bind(C, name="_wrap_FSUNNonlinSolFree") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetSysFn(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetSysFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetLSetupFn(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetLSetupFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetLSolveFn(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetLSolveFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetConvTestFn(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSolSetConvTestFn") & +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_FSUNNonlinSolSetMaxIters(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetMaxIters") & +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_FSUNNonlinSolGetNumIters(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumIters") & +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_FSUNNonlinSolGetCurIter(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetCurIter") & +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_FSUNNonlinSolGetNumConvFails(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumConvFails") & +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_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 + +subroutine swigc_FSUNAdaptController_DestroyEmpty(farg1) & +bind(C, name="_wrap_FSUNAdaptController_DestroyEmpty") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +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 + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +subroutine FSUNLogErrHandlerFn(line, func, file, msg, err_code, err_user_data, sunctx) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: line +character(kind=C_CHAR, len=*), target :: func +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +character(kind=C_CHAR, len=*), target :: file +character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars +character(kind=C_CHAR, len=*), target :: msg +character(kind=C_CHAR), dimension(:), allocatable, target :: farg4_chars +integer(C_INT), intent(in) :: err_code +type(C_PTR) :: err_user_data +type(C_PTR) :: sunctx +integer(C_INT) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = line +call SWIG_string_to_chararray(func, farg2_chars, farg2) +call SWIG_string_to_chararray(file, farg3_chars, farg3) +call SWIG_string_to_chararray(msg, farg4_chars, farg4) +farg5 = err_code +farg6 = err_user_data +farg7 = sunctx +call swigc_FSUNLogErrHandlerFn(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +end subroutine + +subroutine FSUNAbortErrHandlerFn(line, func, file, msg, err_code, err_user_data, sunctx) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: line +character(kind=C_CHAR, len=*), target :: func +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +character(kind=C_CHAR, len=*), target :: file +character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars +character(kind=C_CHAR, len=*), target :: msg +character(kind=C_CHAR), dimension(:), allocatable, target :: farg4_chars +integer(C_INT), intent(in) :: err_code +type(C_PTR) :: err_user_data +type(C_PTR) :: sunctx +integer(C_INT) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = line +call SWIG_string_to_chararray(func, farg2_chars, farg2) +call SWIG_string_to_chararray(file, farg3_chars, farg3) +call SWIG_string_to_chararray(msg, farg4_chars, farg4) +farg5 = err_code +farg6 = err_user_data +farg7 = sunctx +call swigc_FSUNAbortErrHandlerFn(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +end subroutine + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FSUNGetErrMsg(code) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(C_INT), intent(in) :: code +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = code +fresult = swigc_FSUNGetErrMsg(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FSUNContext_Create(comm, sunctx_out) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer :: comm +type(C_PTR), target, intent(inout) :: sunctx_out +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = int(comm, C_INT) +farg2 = c_loc(sunctx_out) +fresult = swigc_FSUNContext_Create(farg1, farg2) +swig_result = fresult +end function + +function FSUNContext_GetLastError(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNContext_GetLastError(farg1) +swig_result = fresult +end function + +function FSUNContext_PeekLastError(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNContext_PeekLastError(farg1) +swig_result = fresult +end function + +function FSUNContext_PushErrHandler(sunctx, err_fn, err_user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_FUNPTR), intent(in), value :: err_fn +type(C_PTR) :: err_user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = sunctx +farg2 = err_fn +farg3 = err_user_data +fresult = swigc_FSUNContext_PushErrHandler(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNContext_PopErrHandler(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNContext_PopErrHandler(farg1) +swig_result = fresult +end function + +function FSUNContext_ClearErrHandlers(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNContext_ClearErrHandlers(farg1) +swig_result = fresult +end function + +function FSUNContext_GetProfiler(sunctx, profiler) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: profiler +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(profiler) +fresult = swigc_FSUNContext_GetProfiler(farg1, farg2) +swig_result = fresult +end function + +function FSUNContext_SetProfiler(sunctx, profiler) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: profiler +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = profiler +fresult = swigc_FSUNContext_SetProfiler(farg1, farg2) +swig_result = fresult +end function + +function FSUNContext_GetLogger(sunctx, logger) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: logger +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(logger) +fresult = swigc_FSUNContext_GetLogger(farg1, farg2) +swig_result = fresult +end function + +function FSUNContext_SetLogger(sunctx, logger) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: logger +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = logger +fresult = swigc_FSUNContext_SetLogger(farg1, farg2) +swig_result = fresult +end function + +function FSUNContext_Free(ctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: ctx +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(ctx) +fresult = swigc_FSUNContext_Free(farg1) +swig_result = fresult +end function + +function FSUNProfiler_Create(comm, title, p) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer :: comm +character(kind=C_CHAR, len=*), target :: title +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +type(C_PTR), target, intent(inout) :: p +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +farg1 = int(comm, C_INT) +call SWIG_string_to_chararray(title, farg2_chars, farg2) +farg3 = c_loc(p) +fresult = swigc_FSUNProfiler_Create(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNProfiler_Free(p) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: p +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(p) +fresult = swigc_FSUNProfiler_Free(farg1) +swig_result = fresult +end function + +function FSUNProfiler_Begin(p, name) & +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 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = p +call SWIG_string_to_chararray(name, farg2_chars, farg2) +fresult = swigc_FSUNProfiler_Begin(farg1, farg2) +swig_result = fresult +end function + +function FSUNProfiler_End(p, name) & +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 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = p +call SWIG_string_to_chararray(name, farg2_chars, farg2) +fresult = swigc_FSUNProfiler_End(farg1, farg2) +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 +integer(C_INT) :: swig_result +type(C_PTR) :: p +type(C_PTR) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = p +farg2 = fp +fresult = swigc_FSUNProfiler_Print(farg1, farg2) +swig_result = fresult +end function + +function FSUNProfiler_Reset(p) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: p +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = p +fresult = swigc_FSUNProfiler_Reset(farg1) +swig_result = fresult +end function + +function FSUNLogger_Create(comm, output_rank, logger) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer :: comm +integer(C_INT), intent(in) :: output_rank +type(C_PTR), target, intent(inout) :: logger +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = int(comm, C_INT) +farg2 = output_rank +farg3 = c_loc(logger) +fresult = swigc_FSUNLogger_Create(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLogger_CreateFromEnv(comm, logger) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer :: comm +type(C_PTR), target, intent(inout) :: logger +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = int(comm, C_INT) +farg2 = c_loc(logger) +fresult = swigc_FSUNLogger_CreateFromEnv(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_SetErrorFilename(logger, error_filename) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +character(kind=C_CHAR, len=*), target :: error_filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = logger +call SWIG_string_to_chararray(error_filename, farg2_chars, farg2) +fresult = swigc_FSUNLogger_SetErrorFilename(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_SetWarningFilename(logger, warning_filename) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +character(kind=C_CHAR, len=*), target :: warning_filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = logger +call SWIG_string_to_chararray(warning_filename, farg2_chars, farg2) +fresult = swigc_FSUNLogger_SetWarningFilename(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_SetDebugFilename(logger, debug_filename) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +character(kind=C_CHAR, len=*), target :: debug_filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = logger +call SWIG_string_to_chararray(debug_filename, farg2_chars, farg2) +fresult = swigc_FSUNLogger_SetDebugFilename(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_SetInfoFilename(logger, info_filename) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +character(kind=C_CHAR, len=*), target :: info_filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = logger +call SWIG_string_to_chararray(info_filename, farg2_chars, farg2) +fresult = swigc_FSUNLogger_SetInfoFilename(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_QueueMsg(logger, lvl, scope, label, msg_txt) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +integer(SUNLogLevel), intent(in) :: lvl +character(kind=C_CHAR, len=*), target :: scope +character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars +character(kind=C_CHAR, len=*), target :: label +character(kind=C_CHAR), dimension(:), allocatable, target :: farg4_chars +character(kind=C_CHAR, len=*), target :: msg_txt +character(kind=C_CHAR), dimension(:), allocatable, target :: farg5_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(SwigArrayWrapper) :: farg3 +type(SwigArrayWrapper) :: farg4 +type(SwigArrayWrapper) :: farg5 + +farg1 = logger +farg2 = lvl +call SWIG_string_to_chararray(scope, farg3_chars, farg3) +call SWIG_string_to_chararray(label, farg4_chars, farg4) +call SWIG_string_to_chararray(msg_txt, farg5_chars, farg5) +fresult = swigc_FSUNLogger_QueueMsg(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLogger_Flush(logger, lvl) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +integer(SUNLogLevel), intent(in) :: lvl +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = logger +farg2 = lvl +fresult = swigc_FSUNLogger_Flush(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_GetOutputRank(logger, output_rank) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: logger +integer(C_INT), dimension(*), target, intent(inout) :: output_rank +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = logger +farg2 = c_loc(output_rank(1)) +fresult = swigc_FSUNLogger_GetOutputRank(farg1, farg2) +swig_result = fresult +end function + +function FSUNLogger_Destroy(logger) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: logger +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(logger) +fresult = swigc_FSUNLogger_Destroy(farg1) +swig_result = fresult +end function + +function FSUNDIALSFileOpen(filename, modes, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +character(kind=C_CHAR, len=*), target :: filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +character(kind=C_CHAR, len=*), target :: modes +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +call SWIG_string_to_chararray(filename, farg1_chars, farg1) +call SWIG_string_to_chararray(modes, farg2_chars, farg2) +farg3 = c_loc(fp) +fresult = swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNDIALSFileClose(fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(fp) +fresult = swigc_FSUNDIALSFileClose(farg1) +swig_result = fresult +end function + +function FN_VNewEmpty(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FN_VNewEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VFreeEmpty(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VFreeEmpty(farg1) +end subroutine + +function FN_VCopyOps(w, v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(w) +farg2 = c_loc(v) +fresult = swigc_FN_VCopyOps(farg1, farg2) +swig_result = fresult +end function + +function FN_VGetVectorID(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(N_Vector_ID) :: swig_result +type(N_Vector), target, intent(inout) :: w +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VGetVectorID(farg1) +swig_result = fresult +end function + +function FN_VClone(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VClone(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FN_VCloneEmpty(w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(w) +fresult = swigc_FN_VCloneEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VDestroy(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VDestroy(farg1) +end subroutine + +subroutine FN_VSpace(v, lrw, liw) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T), dimension(*), target, intent(inout) :: lrw +integer(C_INT32_T), dimension(*), target, intent(inout) :: liw +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(v) +farg2 = c_loc(lrw(1)) +farg3 = c_loc(liw(1)) +call swigc_FN_VSpace(farg1, farg2, farg3) +end subroutine + +subroutine FN_VSetArrayPointer(v_data, v) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(*), target, intent(inout) :: v_data +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v_data(1)) +farg2 = c_loc(v) +call swigc_FN_VSetArrayPointer(farg1, farg2) +end subroutine + +function FN_VGetCommunicator(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetCommunicator(farg1) +swig_result = int(fresult) +end function + +function FN_VGetLength(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLength(farg1) +swig_result = fresult +end function + +function FN_VGetLocalLength(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(N_Vector), target, intent(inout) :: v +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetLocalLength(farg1) +swig_result = fresult +end function + +subroutine FN_VLinearSum(a, x, b, y, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: a +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = a +farg2 = c_loc(x) +farg3 = b +farg4 = c_loc(y) +farg5 = c_loc(z) +call swigc_FN_VLinearSum(farg1, farg2, farg3, farg4, farg5) +end subroutine + +subroutine FN_VConst(c, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(z) +call swigc_FN_VConst(farg1, farg2) +end subroutine + +subroutine FN_VProd(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VProd(farg1, farg2, farg3) +end subroutine + +subroutine FN_VDiv(x, y, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(y) +farg3 = c_loc(z) +call swigc_FN_VDiv(farg1, farg2, farg3) +end subroutine + +subroutine FN_VScale(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VScale(farg1, farg2, farg3) +end subroutine + +subroutine FN_VAbs(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VAbs(farg1, farg2) +end subroutine + +subroutine FN_VInv(x, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +call swigc_FN_VInv(farg1, farg2) +end subroutine + +subroutine FN_VAddConst(x, b, z) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), intent(in) :: b +type(N_Vector), target, intent(inout) :: z +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = b +farg3 = c_loc(z) +call swigc_FN_VAddConst(farg1, farg2, farg3) +end subroutine + +function FN_VDotProd(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProd(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNorm(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNorm(farg1) +swig_result = fresult +end function + +function FN_VWrmsNorm(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWrmsNorm(farg1, farg2) +swig_result = fresult +end function + +function FN_VWrmsNormMask(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWrmsNormMask(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMin(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMin(farg1) +swig_result = fresult +end function + +function FN_VWL2Norm(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWL2Norm(farg1, farg2) +swig_result = fresult +end function + +function FN_VL1Norm(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1Norm(farg1) +swig_result = fresult +end function + +subroutine FN_VCompare(c, x, z) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(x) +farg3 = c_loc(z) +call swigc_FN_VCompare(farg1, farg2, farg3) +end subroutine + +function FN_VInvTest(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTest(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMask(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMask(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotient(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotient(farg1, farg2) +swig_result = fresult +end function + +function FN_VLinearCombination(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = c_loc(z) +fresult = swigc_FN_VLinearCombination(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VScaleAddMulti(nvec, a, x, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = c_loc(a(1)) +farg3 = c_loc(x) +farg4 = y +farg5 = z +fresult = swigc_FN_VScaleAddMulti(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdMulti(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMulti(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VLinearSumVectorArray(nvec, a, x, b, y, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: a +type(C_PTR) :: x +real(C_DOUBLE), intent(in) :: b +type(C_PTR) :: y +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = nvec +farg2 = a +farg3 = x +farg4 = b +farg5 = y +farg6 = z +fresult = swigc_FN_VLinearSumVectorArray(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FN_VScaleVectorArray(nvec, c, x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), dimension(*), target, intent(inout) :: c +type(C_PTR) :: x +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(c(1)) +farg3 = x +farg4 = z +fresult = swigc_FN_VScaleVectorArray(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VConstVectorArray(nvec, c, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +real(C_DOUBLE), intent(in) :: c +type(C_PTR) :: z +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvec +farg2 = c +farg3 = z +fresult = swigc_FN_VConstVectorArray(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VWrmsNormVectorArray(nvec, x, w, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormVectorArray(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VWrmsNormMaskVectorArray(nvec, x, w, id, nrm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(C_PTR) :: x +type(C_PTR) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = nvec +farg2 = x +farg3 = w +farg4 = c_loc(id) +farg5 = c_loc(nrm(1)) +fresult = swigc_FN_VWrmsNormMaskVectorArray(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FN_VDotProdLocal(x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(y) +fresult = swigc_FN_VDotProdLocal(farg1, farg2) +swig_result = fresult +end function + +function FN_VMaxNormLocal(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMaxNormLocal(farg1) +swig_result = fresult +end function + +function FN_VMinLocal(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VMinLocal(farg1) +swig_result = fresult +end function + +function FN_VL1NormLocal(x) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(x) +fresult = swigc_FN_VL1NormLocal(farg1) +swig_result = fresult +end function + +function FN_VWSqrSumLocal(x, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(w) +fresult = swigc_FN_VWSqrSumLocal(farg1, farg2) +swig_result = fresult +end function + +function FN_VWSqrSumMaskLocal(x, w, id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: w +type(N_Vector), target, intent(inout) :: id +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(x) +farg2 = c_loc(w) +farg3 = c_loc(id) +fresult = swigc_FN_VWSqrSumMaskLocal(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VInvTestLocal(x, z) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: z +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(z) +fresult = swigc_FN_VInvTestLocal(farg1, farg2) +swig_result = fresult +end function + +function FN_VConstrMaskLocal(c, x, m) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: c +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: m +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(c) +farg2 = c_loc(x) +farg3 = c_loc(m) +fresult = swigc_FN_VConstrMaskLocal(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VMinQuotientLocal(num, denom) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(N_Vector), target, intent(inout) :: num +type(N_Vector), target, intent(inout) :: denom +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(num) +farg2 = c_loc(denom) +fresult = swigc_FN_VMinQuotientLocal(farg1, farg2) +swig_result = fresult +end function + +function FN_VDotProdMultiLocal(nvec, x, y, dotprods) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: y +real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = nvec +farg2 = c_loc(x) +farg3 = y +farg4 = c_loc(dotprods(1)) +fresult = swigc_FN_VDotProdMultiLocal(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FN_VDotProdMultiAllReduce(nvec_total, x, sum) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: nvec_total +type(N_Vector), target, intent(inout) :: x +real(C_DOUBLE), dimension(*), target, intent(inout) :: sum +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = nvec_total +farg2 = c_loc(x) +farg3 = c_loc(sum(1)) +fresult = swigc_FN_VDotProdMultiAllReduce(farg1, farg2, farg3) +swig_result = fresult +end function + +function FN_VBufSize(x, size) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +integer(C_INT32_T), dimension(*), target, intent(inout) :: size +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = c_loc(size(1)) +fresult = swigc_FN_VBufSize(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufPack(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufPack(farg1, farg2) +swig_result = fresult +end function + +function FN_VBufUnpack(x, buf) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(N_Vector), target, intent(inout) :: x +type(C_PTR) :: buf +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(x) +farg2 = buf +fresult = swigc_FN_VBufUnpack(farg1, farg2) +swig_result = fresult +end function + +function FN_VNewVectorArray(count, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: count +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = count +farg2 = sunctx +fresult = swigc_FN_VNewVectorArray(farg1, farg2) +swig_result = fresult +end function + +function FN_VCloneEmptyVectorArray(count, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: count +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = count +farg2 = c_loc(w) +fresult = swigc_FN_VCloneEmptyVectorArray(farg1, farg2) +swig_result = fresult +end function + +function FN_VCloneVectorArray(count, w) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +integer(C_INT), intent(in) :: count +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 + +farg1 = count +farg2 = c_loc(w) +fresult = swigc_FN_VCloneVectorArray(farg1, farg2) +swig_result = fresult +end function + +subroutine FN_VDestroyVectorArray(vs, count) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: vs +integer(C_INT), intent(in) :: count +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = vs +farg2 = count +call swigc_FN_VDestroyVectorArray(farg1, farg2) +end subroutine + +function FN_VGetVecAtIndexVectorArray(vs, index) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(C_PTR) :: vs +integer(C_INT), intent(in) :: index +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = vs +farg2 = index +fresult = swigc_FN_VGetVecAtIndexVectorArray(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FN_VSetVecAtIndexVectorArray(vs, index, w) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: vs +integer(C_INT), intent(in) :: index +type(N_Vector), target, intent(inout) :: w +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = vs +farg2 = index +farg3 = c_loc(w) +call swigc_FN_VSetVecAtIndexVectorArray(farg1, farg2, farg3) +end subroutine + +subroutine FN_VPrint(v) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +call swigc_FN_VPrint(farg1) +end subroutine + +subroutine FN_VPrintFile(v, outfile) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(v) +farg2 = outfile +call swigc_FN_VPrintFile(farg1, farg2) +end subroutine + + +function FN_VGetArrayPointer(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetArrayPointer(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLocalLength(v)]) +end function + +function FN_VGetDeviceArrayPointer(v) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(N_Vector), target, intent(inout) :: v +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(v) +fresult = swigc_FN_VGetDeviceArrayPointer(farg1) +call c_f_pointer(fresult, swig_result, [FN_VGetLocalLength(v)]) +end function + +function FSUNMatNewEmpty(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNMatNewEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNMatFreeEmpty(a) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +call swigc_FSUNMatFreeEmpty(farg1) +end subroutine + +function FSUNMatCopyOps(a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(b) +fresult = swigc_FSUNMatCopyOps(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatGetID(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNMatrix_ID) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatGetID(farg1) +swig_result = fresult +end function + +function FSUNMatClone(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatClone(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNMatDestroy(a) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +call swigc_FSUNMatDestroy(farg1) +end subroutine + +function FSUNMatZero(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatZero(farg1) +swig_result = fresult +end function + +function FSUNMatCopy(a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(b) +fresult = swigc_FSUNMatCopy(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatScaleAdd(c, a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(a) +farg3 = c_loc(b) +fresult = swigc_FSUNMatScaleAdd(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatScaleAddI(c, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(a) +fresult = swigc_FSUNMatScaleAddI(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatMatvecSetup(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatMatvecSetup(farg1) +swig_result = fresult +end function + +function FSUNMatMatvec(a, x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(a) +farg2 = c_loc(x) +farg3 = c_loc(y) +fresult = swigc_FSUNMatMatvec(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatSpace(a, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +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(a) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNMatSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNModifiedGS(v, h, k, p, new_vk_norm) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: v +type(C_PTR), target, intent(inout) :: h +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = v +farg2 = c_loc(h) +farg3 = k +farg4 = p +farg5 = c_loc(new_vk_norm(1)) +fresult = swigc_FSUNModifiedGS(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNClassicalGS(v, h, k, p, new_vk_norm, stemp, vtemp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: v +type(C_PTR), target, intent(inout) :: h +integer(C_INT), intent(in) :: k +integer(C_INT), intent(in) :: p +real(C_DOUBLE), dimension(*), target, intent(inout) :: new_vk_norm +real(C_DOUBLE), dimension(*), target, intent(inout) :: stemp +type(C_PTR) :: vtemp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = v +farg2 = c_loc(h) +farg3 = k +farg4 = p +farg5 = c_loc(new_vk_norm(1)) +farg6 = c_loc(stemp(1)) +farg7 = vtemp +fresult = swigc_FSUNClassicalGS(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FSUNQRfact(n, h, q, job) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: n +type(C_PTR), target, intent(inout) :: h +real(C_DOUBLE), dimension(*), target, intent(inout) :: q +integer(C_INT), intent(in) :: job +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 + +farg1 = n +farg2 = c_loc(h) +farg3 = c_loc(q(1)) +farg4 = job +fresult = swigc_FSUNQRfact(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNQRsol(n, h, q, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +integer(C_INT), intent(in) :: n +type(C_PTR), target, intent(inout) :: h +real(C_DOUBLE), dimension(*), target, intent(inout) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: b +integer(C_INT) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = n +farg2 = c_loc(h) +farg3 = c_loc(q(1)) +farg4 = c_loc(b(1)) +fresult = swigc_FSUNQRsol(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNQRAdd_MGS(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_MGS(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNQRAdd_ICWY(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_ICWY(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNQRAdd_ICWY_SB(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_ICWY_SB(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNQRAdd_CGS2(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_CGS2(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNQRAdd_DCGS2(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_DCGS2(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNQRAdd_DCGS2_SB(q, r, df, m, mmax, qrdata) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: q +real(C_DOUBLE), dimension(*), target, intent(inout) :: r +type(N_Vector), target, intent(inout) :: df +integer(C_INT), intent(in) :: m +integer(C_INT), intent(in) :: mmax +type(C_PTR) :: qrdata +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +integer(C_INT) :: farg4 +integer(C_INT) :: farg5 +type(C_PTR) :: farg6 + +farg1 = q +farg2 = c_loc(r(1)) +farg3 = c_loc(df) +farg4 = m +farg5 = mmax +farg6 = qrdata +fresult = swigc_FSUNQRAdd_DCGS2_SB(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result = fresult +end function + +function FSUNLinSolNewEmpty(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNLinSolNewEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNLinSolFreeEmpty(s) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +call swigc_FSUNLinSolFreeEmpty(farg1) +end subroutine + +function FSUNLinSolGetType(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors(s, s1, s2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: s2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(s2) +fresult = swigc_FSUNLinSolSetScalingVectors(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess(s, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onoff +fresult = swigc_FSUNLinSolSetZeroGuess(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolInitialize(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolNewEmpty(sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), pointer :: swig_result +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = sunctx +fresult = swigc_FSUNNonlinSolNewEmpty(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNNonlinSolFreeEmpty(nls) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +call swigc_FSUNNonlinSolFreeEmpty(farg1) +end subroutine + +function FSUNNonlinSolGetType(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNNonlinearSolver_Type) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolGetType(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolInitialize(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolInitialize(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSetup(nls, y, mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(N_Vector), target, intent(inout) :: y +type(C_PTR) :: mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(nls) +farg2 = c_loc(y) +farg3 = mem +fresult = swigc_FSUNNonlinSolSetup(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNNonlinSolSolve(nls, y0, y, w, tol, calllsetup, mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(N_Vector), target, intent(inout) :: y0 +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE), intent(in) :: tol +integer(C_INT), intent(in) :: calllsetup +type(C_PTR) :: mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 +integer(C_INT) :: farg6 +type(C_PTR) :: farg7 + +farg1 = c_loc(nls) +farg2 = c_loc(y0) +farg3 = c_loc(y) +farg4 = c_loc(w) +farg5 = tol +farg6 = calllsetup +farg7 = mem +fresult = swigc_FSUNNonlinSolSolve(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FSUNNonlinSolFree(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolFree(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSetSysFn(nls, sysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: sysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = sysfn +fresult = swigc_FSUNNonlinSolSetSysFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetLSetupFn(nls, setupfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: setupfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = setupfn +fresult = swigc_FSUNNonlinSolSetLSetupFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetLSolveFn(nls, solvefn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: solvefn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = solvefn +fresult = swigc_FSUNNonlinSolSetLSolveFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetConvTestFn(nls, ctestfn, ctest_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: ctestfn +type(C_PTR) :: ctest_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(nls) +farg2 = ctestfn +farg3 = ctest_data +fresult = swigc_FSUNNonlinSolSetConvTestFn(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNNonlinSolSetMaxIters(nls, maxiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), intent(in) :: maxiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(nls) +farg2 = maxiters +fresult = swigc_FSUNNonlinSolSetMaxIters(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumIters(nls, niters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: niters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(niters(1)) +fresult = swigc_FSUNNonlinSolGetNumIters(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetCurIter(nls, iter) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), dimension(*), target, intent(inout) :: iter +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(iter(1)) +fresult = swigc_FSUNNonlinSolGetCurIter(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumConvFails(nls, nconvfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: nconvfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(nconvfails(1)) +fresult = swigc_FSUNNonlinSolGetNumConvFails(farg1, farg2) +swig_result = fresult +end function + +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 + +subroutine FSUNAdaptController_DestroyEmpty(c) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR) :: farg1 + +farg1 = c_loc(c) +call swigc_FSUNAdaptController_DestroyEmpty(farg1) +end subroutine + +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), dimension(*), 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(1)) +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_int64/CMakeLists.txt b/src/sundials/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..74fe6c96ee --- /dev/null +++ b/src/sundials/fmod_int64/CMakeLists.txt @@ -0,0 +1,27 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 SUNDIALS object library +# --------------------------------------------------------------- + +set(sundials_SOURCES + fsundials_core_mod.c + fsundials_core_mod.f90 + ) + +sundials_add_f2003_library(sundials_fcore_mod + SOURCES + ${sundials_SOURCES} + LINK_LIBRARIES + PUBLIC sundials_core +) diff --git a/src/sundials/fmod/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c similarity index 99% rename from src/sundials/fmod/fsundials_core_mod.c rename to src/sundials/fmod_int64/fsundials_core_mod.c index c369799cce..9fa73f722b 100644 --- a/src/sundials/fmod/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -227,10 +227,6 @@ #error "The Fortran bindings are only targeted at double-precision" #endif -#ifndef SUNDIALS_INT64_T -#error "The Fortran bindings are only targeted at 64-bit indices" -#endif - #include "sundials/sundials_context.h" #include "sundials/sundials_errors.h" diff --git a/src/sundials/fmod/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 similarity index 100% rename from src/sundials/fmod/fsundials_core_mod.f90 rename to src/sundials/fmod_int64/fsundials_core_mod.f90 diff --git a/src/sunlinsol/band/CMakeLists.txt b/src/sunlinsol/band/CMakeLists.txt index 6eb7fb51f2..0b2035e0ef 100644 --- a/src/sunlinsol/band/CMakeLists.txt +++ b/src/sunlinsol/band/CMakeLists.txt @@ -42,5 +42,5 @@ message(STATUS "Added SUNLINSOL_BAND module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/band/fmod/CMakeLists.txt b/src/sunlinsol/band/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/band/fmod/CMakeLists.txt rename to src/sunlinsol/band/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c new file mode 100644 index 0000000000..0b46475231 --- /dev/null +++ b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.c @@ -0,0 +1,337 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_band.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_Band(N_Vector farg1, SUNMatrix farg2, void *farg3) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNLinearSolver)SUNLinSol_Band(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_Band(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_Band(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_Band(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_Band(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_Band(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_Band(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_Band(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_Band(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_Band(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_Band(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_Band(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_Band(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_Band(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_Band(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_Band(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_Band(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 new file mode 100644 index 0000000000..782fdffb60 --- /dev/null +++ b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 @@ -0,0 +1,271 @@ +! 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-2024, 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 fsunlinsol_band_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNLinSol_Band + public :: FSUNLinSolGetType_Band + public :: FSUNLinSolGetID_Band + public :: FSUNLinSolInitialize_Band + public :: FSUNLinSolSetup_Band + public :: FSUNLinSolSolve_Band + public :: FSUNLinSolLastFlag_Band + public :: FSUNLinSolSpace_Band + public :: FSUNLinSolFree_Band + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_Band(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSol_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolGetType_Band(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_Band(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_Band(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup_Band(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_Band") & +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_FSUNLinSolSolve_Band(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_Band(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_Band(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_Band") & +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_FSUNLinSolFree_Band(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_Band(y, a, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = c_loc(a) +farg3 = sunctx +fresult = swigc_FSUNLinSol_Band(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolGetType_Band(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_Band(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_Band(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_Band(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_Band(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_Band(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup_Band(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_Band(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_Band(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_Band(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolLastFlag_Band(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_Band(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_Band(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_Band(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_Band(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_Band(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/band/fmod_int64/CMakeLists.txt b/src/sunlinsol/band/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..250f17c914 --- /dev/null +++ b/src/sunlinsol/band/fmod_int64/CMakeLists.txt @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# ---------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ---------------------------------------------------------------------- +# CMakeLists.txt file for the F2003 band SUNLinearSolver object library +# ---------------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsolband_mod + SOURCES + fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + LINK_LIBRARIES + PUBLIC sundials_fsunmatrixband_mod + OUTPUT_NAME + sundials_fsunlinsolband_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_BAND F2003 interface") diff --git a/src/sunlinsol/band/fmod/fsunlinsol_band_mod.c b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.c similarity index 100% rename from src/sunlinsol/band/fmod/fsunlinsol_band_mod.c rename to src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.c diff --git a/src/sunlinsol/band/fmod/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 similarity index 100% rename from src/sunlinsol/band/fmod/fsunlinsol_band_mod.f90 rename to src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 diff --git a/src/sunlinsol/dense/CMakeLists.txt b/src/sunlinsol/dense/CMakeLists.txt index 8edb6de95d..1661deca42 100644 --- a/src/sunlinsol/dense/CMakeLists.txt +++ b/src/sunlinsol/dense/CMakeLists.txt @@ -42,5 +42,5 @@ message(STATUS "Added SUNLINSOL_DENSE module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/dense/fmod/CMakeLists.txt b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/dense/fmod/CMakeLists.txt rename to src/sunlinsol/dense/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c new file mode 100644 index 0000000000..417d14d673 --- /dev/null +++ b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.c @@ -0,0 +1,337 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_dense.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_Dense(N_Vector farg1, SUNMatrix farg2, void *farg3) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNLinearSolver)SUNLinSol_Dense(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_Dense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_Dense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_Dense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_Dense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_Dense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_Dense(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_Dense(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_Dense(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_Dense(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_Dense(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_Dense(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_Dense(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_Dense(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_Dense(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_Dense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_Dense(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 new file mode 100644 index 0000000000..6ec001b1ed --- /dev/null +++ b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 @@ -0,0 +1,271 @@ +! 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-2024, 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 fsunlinsol_dense_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNLinSol_Dense + public :: FSUNLinSolGetType_Dense + public :: FSUNLinSolGetID_Dense + public :: FSUNLinSolInitialize_Dense + public :: FSUNLinSolSetup_Dense + public :: FSUNLinSolSolve_Dense + public :: FSUNLinSolLastFlag_Dense + public :: FSUNLinSolSpace_Dense + public :: FSUNLinSolFree_Dense + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_Dense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSol_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolGetType_Dense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_Dense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_Dense(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup_Dense(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_Dense") & +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_FSUNLinSolSolve_Dense(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_Dense(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_Dense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_Dense") & +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_FSUNLinSolFree_Dense(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_Dense(y, a, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = c_loc(a) +farg3 = sunctx +fresult = swigc_FSUNLinSol_Dense(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolGetType_Dense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_Dense(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_Dense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_Dense(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_Dense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_Dense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup_Dense(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_Dense(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_Dense(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_Dense(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolLastFlag_Dense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_Dense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_Dense(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_Dense(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_Dense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_Dense(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..61bdf87108 --- /dev/null +++ b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt @@ -0,0 +1,32 @@ +# ---------------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# ---------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ---------------------------------------------------------------------- +# CMakeLists.txt file for the F2003 dense SUNLinearSolver object library +# ---------------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsoldense_mod + SOURCES + fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + LINK_LIBRARIES + PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME + sundials_fsunlinsoldense_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) +message(STATUS "Added SUNLINSOL_DENSE F2003 interface") diff --git a/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.c similarity index 100% rename from src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.c rename to src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.c diff --git a/src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 similarity index 100% rename from src/sunlinsol/dense/fmod/fsunlinsol_dense_mod.f90 rename to src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 diff --git a/src/sunlinsol/klu/CMakeLists.txt b/src/sunlinsol/klu/CMakeLists.txt index 5be94d2e36..c78a547deb 100644 --- a/src/sunlinsol/klu/CMakeLists.txt +++ b/src/sunlinsol/klu/CMakeLists.txt @@ -41,5 +41,5 @@ message(STATUS "Added SUNLINSOL_KLU module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/klu/fmod/CMakeLists.txt b/src/sunlinsol/klu/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/klu/fmod/CMakeLists.txt rename to src/sunlinsol/klu/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c new file mode 100644 index 0000000000..0d9434fe92 --- /dev/null +++ b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.c @@ -0,0 +1,429 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_klu.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_KLU(N_Vector farg1, SUNMatrix farg2, void *farg3) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNLinearSolver)SUNLinSol_KLU(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_KLUReInit(SUNLinearSolver farg1, SUNMatrix farg2, int32_t const *farg3, int const *farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + sunindextype arg3 ; + int arg4 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (int)(*farg4); + result = (int)SUNLinSol_KLUReInit(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_KLUSetOrdering(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (int)SUNLinSol_KLUSetOrdering(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetSymbolic(SUNLinearSolver farg1) { + SwigClassWrapper fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + klu_symbolic *result = 0 ; + + arg1 = (SUNLinearSolver)(farg1); + result = (klu_symbolic *)SUNLinSol_KLUGetSymbolic(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetNumeric(SUNLinearSolver farg1) { + SwigClassWrapper fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + klu_numeric *result = 0 ; + + arg1 = (SUNLinearSolver)(farg1); + result = (klu_numeric *)SUNLinSol_KLUGetNumeric(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSUNLinSol_KLUGetCommon(SUNLinearSolver farg1) { + SwigClassWrapper fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + klu_common *result = 0 ; + + arg1 = (SUNLinearSolver)(farg1); + result = (klu_common *)SUNLinSol_KLUGetCommon(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_KLU(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_KLU(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_KLU(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_KLU(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_KLU(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_KLU(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_KLU(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_KLU(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_KLU(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_KLU(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_KLU(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_KLU(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_KLU(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_KLU(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_KLU(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_KLU(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 new file mode 100644 index 0000000000..fa942b3a09 --- /dev/null +++ b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 @@ -0,0 +1,420 @@ +! 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-2024, 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 fsunlinsol_klu_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNKLU_ORDERING_DEFAULT = 1_C_INT + integer(C_INT), parameter, public :: SUNKLU_REINIT_FULL = 1_C_INT + integer(C_INT), parameter, public :: SUNKLU_REINIT_PARTIAL = 2_C_INT + public :: FSUNLinSol_KLU + public :: FSUNLinSol_KLUReInit + public :: FSUNLinSol_KLUSetOrdering + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + type, public :: SWIGTYPE_p_klu_symbolic + type(SwigClassWrapper), public :: swigdata + end type + public :: FSUNLinSol_KLUGetSymbolic + type, public :: SWIGTYPE_p_klu_numeric + type(SwigClassWrapper), public :: swigdata + end type + public :: FSUNLinSol_KLUGetNumeric + type, public :: SWIGTYPE_p_klu_common + type(SwigClassWrapper), public :: swigdata + end type + public :: FSUNLinSol_KLUGetCommon + public :: FSUNLinSolGetType_KLU + public :: FSUNLinSolGetID_KLU + public :: FSUNLinSolInitialize_KLU + public :: FSUNLinSolSetup_KLU + public :: FSUNLinSolSolve_KLU + public :: FSUNLinSolLastFlag_KLU + public :: FSUNLinSolSpace_KLU + public :: FSUNLinSolFree_KLU + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_KLU(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSol_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_KLUReInit(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_KLUReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSol_KLUSetOrdering(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_KLUSetOrdering") & +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_FSUNLinSol_KLUGetSymbolic(farg1) & +bind(C, name="_wrap_FSUNLinSol_KLUGetSymbolic") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSUNLinSol_KLUGetNumeric(farg1) & +bind(C, name="_wrap_FSUNLinSol_KLUGetNumeric") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSUNLinSol_KLUGetCommon(farg1) & +bind(C, name="_wrap_FSUNLinSol_KLUGetCommon") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSUNLinSolGetType_KLU(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_KLU(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_KLU(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup_KLU(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_KLU") & +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_FSUNLinSolSolve_KLU(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_KLU(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_KLU(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_KLU") & +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_FSUNLinSolFree_KLU(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_KLU") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_KLU(y, a, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = c_loc(a) +farg3 = sunctx +fresult = swigc_FSUNLinSol_KLU(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_KLUReInit(s, a, nnz, reinit_type) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T), intent(in) :: nnz +integer(C_INT), intent(in) :: reinit_type +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT) :: farg4 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = nnz +farg4 = reinit_type +fresult = swigc_FSUNLinSol_KLUReInit(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSol_KLUSetOrdering(s, ordering_choice) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: ordering_choice +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = ordering_choice +fresult = swigc_FSUNLinSol_KLUSetOrdering(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_KLUGetSymbolic(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SWIGTYPE_p_klu_symbolic) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SwigClassWrapper) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSol_KLUGetSymbolic(farg1) +swig_result%swigdata = fresult +end function + +function FSUNLinSol_KLUGetNumeric(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SWIGTYPE_p_klu_numeric) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SwigClassWrapper) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSol_KLUGetNumeric(farg1) +swig_result%swigdata = fresult +end function + +function FSUNLinSol_KLUGetCommon(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SWIGTYPE_p_klu_common) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SwigClassWrapper) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSol_KLUGetCommon(farg1) +swig_result%swigdata = fresult +end function + +function FSUNLinSolGetType_KLU(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_KLU(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_KLU(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_KLU(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_KLU(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_KLU(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup_KLU(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_KLU(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_KLU(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_KLU(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolLastFlag_KLU(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_KLU(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_KLU(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_KLU(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_KLU(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_KLU(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..4a0323d921 --- /dev/null +++ b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt @@ -0,0 +1,33 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 KLU SUNLinearSolver object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsolklu_mod + SOURCES + fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + LINK_LIBRARIES + PUBLIC sundials_fsunmatrixsparse_mod + OUTPUT_NAME + sundials_fsunlinsolklu_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_KLU F2003 interface") diff --git a/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.c similarity index 100% rename from src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.c rename to src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.c diff --git a/src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 similarity index 100% rename from src/sunlinsol/klu/fmod/fsunlinsol_klu_mod.f90 rename to src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index 7e0eb9239c..41ab2a5fa7 100644 --- a/src/sunlinsol/lapackdense/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/CMakeLists.txt @@ -41,5 +41,5 @@ message(STATUS "Added SUNLINSOL_LAPACKDENSE module") # Add module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/lapackdense/fmod/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/lapackdense/fmod/CMakeLists.txt rename to src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c new file mode 100644 index 0000000000..00f91c82e9 --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.c @@ -0,0 +1,337 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_lapackdense.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_LapackDense(N_Vector farg1, SUNMatrix farg2, void *farg3) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNLinearSolver)SUNLinSol_LapackDense(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_LapackDense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_LapackDense(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_LapackDense(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_LapackDense(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_LapackDense(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_LapackDense(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_LapackDense(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_LapackDense(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_LapackDense(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_LapackDense(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_LapackDense(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_LapackDense(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 new file mode 100644 index 0000000000..7d555e8985 --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 @@ -0,0 +1,271 @@ +! 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-2024, 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 fsunlinsol_lapackdense_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNLinSol_LapackDense + public :: FSUNLinSolGetType_LapackDense + public :: FSUNLinSolGetID_LapackDense + public :: FSUNLinSolInitialize_LapackDense + public :: FSUNLinSolSetup_LapackDense + public :: FSUNLinSolSolve_LapackDense + public :: FSUNLinSolLastFlag_LapackDense + public :: FSUNLinSolSpace_LapackDense + public :: FSUNLinSolFree_LapackDense + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_LapackDense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSol_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolGetType_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetup_LapackDense(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_LapackDense") & +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_FSUNLinSolSolve_LapackDense(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_LapackDense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_LapackDense") & +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_FSUNLinSolFree_LapackDense(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_LapackDense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_LapackDense(y, a, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = c_loc(a) +farg3 = sunctx +fresult = swigc_FSUNLinSol_LapackDense(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolGetType_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetup_LapackDense(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_LapackDense(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_LapackDense(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_LapackDense(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolLastFlag_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_LapackDense(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_LapackDense(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_LapackDense(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_LapackDense(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_LapackDense(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..12bcb2fae2 --- /dev/null +++ b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# ---------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ---------------------------------------------------------------------- +# CMakeLists.txt file for the F2003 LAPACK dense SUNLinearSolver +# object library +# ---------------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod + SOURCES + fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + LINK_LIBRARIES + PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME + sundials_fsunlinsollapackdense_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) +message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.c similarity index 100% rename from src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.c rename to src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.c diff --git a/src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 similarity index 100% rename from src/sunlinsol/lapackdense/fmod/fsunlinsol_lapackdense_mod.f90 rename to src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 diff --git a/src/sunlinsol/pcg/CMakeLists.txt b/src/sunlinsol/pcg/CMakeLists.txt index ea21ecee47..e8e37003f2 100644 --- a/src/sunlinsol/pcg/CMakeLists.txt +++ b/src/sunlinsol/pcg/CMakeLists.txt @@ -40,5 +40,5 @@ message(STATUS "Added SUNLINSOL_PCG module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/pcg/fmod/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/pcg/fmod/CMakeLists.txt rename to src/sunlinsol/pcg/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c new file mode 100644 index 0000000000..7653513146 --- /dev/null +++ b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.c @@ -0,0 +1,467 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_pcg.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_PCG(N_Vector farg1, int const *farg2, int const *farg3, void *farg4) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNLinearSolver)SUNLinSol_PCG(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_PCGSetPrecType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_PCGSetPrecType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_PCGSetMaxl(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_PCGSetMaxl(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_PCG(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_PCG(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_PCG(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_PCG(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_PCG(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_PCG(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes_PCG(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes_PCG(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_PCG(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner_PCG(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_PCG(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors_PCG(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess_PCG(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess_PCG(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_PCG(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_PCG(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_PCG(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_PCG(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters_PCG(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters_PCG(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm_PCG(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm_PCG(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_PCG(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid_PCG(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_PCG(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_PCG(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_PCG(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_PCG(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_PCG(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_PCG(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 new file mode 100644 index 0000000000..e22ce1124b --- /dev/null +++ b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 @@ -0,0 +1,514 @@ +! 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-2024, 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 fsunlinsol_pcg_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNPCG_MAXL_DEFAULT = 5_C_INT + public :: FSUNLinSol_PCG + public :: FSUNLinSol_PCGSetPrecType + public :: FSUNLinSol_PCGSetMaxl + public :: FSUNLinSolGetType_PCG + public :: FSUNLinSolGetID_PCG + public :: FSUNLinSolInitialize_PCG + public :: FSUNLinSolSetATimes_PCG + public :: FSUNLinSolSetPreconditioner_PCG + public :: FSUNLinSolSetScalingVectors_PCG + public :: FSUNLinSolSetZeroGuess_PCG + public :: FSUNLinSolSetup_PCG + public :: FSUNLinSolSolve_PCG + public :: FSUNLinSolNumIters_PCG + public :: FSUNLinSolResNorm_PCG + public :: FSUNLinSolResid_PCG + public :: FSUNLinSolLastFlag_PCG + public :: FSUNLinSolSpace_PCG + public :: FSUNLinSolFree_PCG + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_PCG(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_PCGSetPrecType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_PCGSetPrecType") & +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_FSUNLinSol_PCGSetMaxl(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_PCGSetMaxl") & +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_FSUNLinSolGetType_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes_PCG(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner_PCG(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors_PCG(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors_PCG") & +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_FSUNLinSolSetZeroGuess_PCG(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess_PCG") & +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_FSUNLinSolSetup_PCG(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_PCG") & +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_FSUNLinSolSolve_PCG(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolResid_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_PCG(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_PCG") & +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_FSUNLinSolFree_PCG(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_PCG") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_PCG(y, pretype, maxl, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: pretype +integer(C_INT), intent(in) :: maxl +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = c_loc(y) +farg2 = pretype +farg3 = maxl +farg4 = sunctx +fresult = swigc_FSUNLinSol_PCG(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_PCGSetPrecType(s, pretype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: pretype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = pretype +fresult = swigc_FSUNLinSol_PCGSetPrecType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_PCGSetMaxl(s, maxl) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: maxl +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = maxl +fresult = swigc_FSUNLinSol_PCGSetMaxl(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolGetType_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes_PCG(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes_PCG(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner_PCG(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner_PCG(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors_PCG(s, s1, nul) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: nul +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(nul) +fresult = swigc_FSUNLinSolSetScalingVectors_PCG(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess_PCG(s, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onoff +fresult = swigc_FSUNLinSolSetZeroGuess_PCG(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSetup_PCG(s, nul) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: nul +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(nul) +fresult = swigc_FSUNLinSolSetup_PCG(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_PCG(s, nul, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: nul +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(nul) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_PCG(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid_PCG(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_PCG(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_PCG(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_PCG(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_PCG(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_PCG(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..535741e7d6 --- /dev/null +++ b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 PCG SUNLinearSolver object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsolpcg_mod + SOURCES + fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunlinsolpcg_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_PCG F2003 interface") diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.c similarity index 100% rename from src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.c rename to src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.c diff --git a/src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 similarity index 100% rename from src/sunlinsol/pcg/fmod/fsunlinsol_pcg_mod.f90 rename to src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 diff --git a/src/sunlinsol/spbcgs/CMakeLists.txt b/src/sunlinsol/spbcgs/CMakeLists.txt index 6fc0243c0f..331c788606 100644 --- a/src/sunlinsol/spbcgs/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/CMakeLists.txt @@ -40,5 +40,5 @@ message(STATUS "Added SUNLINSOL_SPBCGS module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/spbcgs/fmod/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spbcgs/fmod/CMakeLists.txt rename to src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c new file mode 100644 index 0000000000..1ffbd482cc --- /dev/null +++ b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.c @@ -0,0 +1,467 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_spbcgs.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_SPBCGS(N_Vector farg1, int const *farg2, int const *farg3, void *farg4) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNLinearSolver)SUNLinSol_SPBCGS(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPBCGSSetPrecType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPBCGSSetPrecType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPBCGSSetMaxl(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPBCGSSetMaxl(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_SPBCGS(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_SPBCGS(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_SPBCGS(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_SPBCGS(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_SPBCGS(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_SPBCGS(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes_SPBCGS(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes_SPBCGS(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_SPBCGS(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner_SPBCGS(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_SPBCGS(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors_SPBCGS(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess_SPBCGS(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess_SPBCGS(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_SPBCGS(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_SPBCGS(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_SPBCGS(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_SPBCGS(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPBCGS(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters_SPBCGS(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPBCGS(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm_SPBCGS(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_SPBCGS(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid_SPBCGS(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_SPBCGS(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_SPBCGS(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_SPBCGS(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_SPBCGS(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_SPBCGS(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_SPBCGS(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 new file mode 100644 index 0000000000..3c84f21c55 --- /dev/null +++ b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 @@ -0,0 +1,514 @@ +! 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-2024, 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 fsunlinsol_spbcgs_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNSPBCGS_MAXL_DEFAULT = 5_C_INT + public :: FSUNLinSol_SPBCGS + public :: FSUNLinSol_SPBCGSSetPrecType + public :: FSUNLinSol_SPBCGSSetMaxl + public :: FSUNLinSolGetType_SPBCGS + public :: FSUNLinSolGetID_SPBCGS + public :: FSUNLinSolInitialize_SPBCGS + public :: FSUNLinSolSetATimes_SPBCGS + public :: FSUNLinSolSetPreconditioner_SPBCGS + public :: FSUNLinSolSetScalingVectors_SPBCGS + public :: FSUNLinSolSetZeroGuess_SPBCGS + public :: FSUNLinSolSetup_SPBCGS + public :: FSUNLinSolSolve_SPBCGS + public :: FSUNLinSolNumIters_SPBCGS + public :: FSUNLinSolResNorm_SPBCGS + public :: FSUNLinSolResid_SPBCGS + public :: FSUNLinSolLastFlag_SPBCGS + public :: FSUNLinSolSpace_SPBCGS + public :: FSUNLinSolFree_SPBCGS + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_SPBCGS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_SPBCGSSetPrecType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPBCGSSetPrecType") & +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_FSUNLinSol_SPBCGSSetMaxl(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPBCGSSetMaxl") & +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_FSUNLinSolGetType_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes_SPBCGS(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner_SPBCGS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors_SPBCGS(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors_SPBCGS") & +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_FSUNLinSolSetZeroGuess_SPBCGS(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess_SPBCGS") & +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_FSUNLinSolSetup_SPBCGS(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_SPBCGS") & +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_FSUNLinSolSolve_SPBCGS(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolResid_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_SPBCGS(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_SPBCGS") & +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_FSUNLinSolFree_SPBCGS(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_SPBCGS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_SPBCGS(y, pretype, maxl, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: pretype +integer(C_INT), intent(in) :: maxl +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = c_loc(y) +farg2 = pretype +farg3 = maxl +farg4 = sunctx +fresult = swigc_FSUNLinSol_SPBCGS(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_SPBCGSSetPrecType(s, pretype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: pretype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = pretype +fresult = swigc_FSUNLinSol_SPBCGSSetPrecType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPBCGSSetMaxl(s, maxl) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: maxl +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = maxl +fresult = swigc_FSUNLinSol_SPBCGSSetMaxl(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolGetType_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes_SPBCGS(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes_SPBCGS(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner_SPBCGS(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner_SPBCGS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors_SPBCGS(s, s1, s2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: s2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(s2) +fresult = swigc_FSUNLinSolSetScalingVectors_SPBCGS(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess_SPBCGS(s, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onoff +fresult = swigc_FSUNLinSolSetZeroGuess_SPBCGS(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSetup_SPBCGS(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_SPBCGS(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_SPBCGS(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_SPBCGS(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid_SPBCGS(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_SPBCGS(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_SPBCGS(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_SPBCGS(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_SPBCGS(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_SPBCGS(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..d1b588396f --- /dev/null +++ b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 SPBCGS SUNLinearSolver object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod + SOURCES + fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunlinsolspbcgs_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_SPBCGS F2003 interface") diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.c similarity index 100% rename from src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.c rename to src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.c diff --git a/src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 similarity index 100% rename from src/sunlinsol/spbcgs/fmod/fsunlinsol_spbcgs_mod.f90 rename to src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 diff --git a/src/sunlinsol/spfgmr/CMakeLists.txt b/src/sunlinsol/spfgmr/CMakeLists.txt index 455415b224..38b9d784e9 100644 --- a/src/sunlinsol/spfgmr/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNLINSOL_SPFGMR module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/spfgmr/fmod/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spfgmr/fmod/CMakeLists.txt rename to src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c new file mode 100644 index 0000000000..a83cedc83c --- /dev/null +++ b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.c @@ -0,0 +1,481 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_spfgmr.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_SPFGMR(N_Vector farg1, int const *farg2, int const *farg3, void *farg4) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNLinearSolver)SUNLinSol_SPFGMR(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPFGMRSetPrecType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPFGMRSetPrecType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPFGMRSetGSType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPFGMRSetGSType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPFGMRSetMaxRestarts(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPFGMRSetMaxRestarts(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_SPFGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_SPFGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_SPFGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_SPFGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_SPFGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_SPFGMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes_SPFGMR(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes_SPFGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_SPFGMR(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner_SPFGMR(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_SPFGMR(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors_SPFGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess_SPFGMR(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess_SPFGMR(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_SPFGMR(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_SPFGMR(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_SPFGMR(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_SPFGMR(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPFGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters_SPFGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPFGMR(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm_SPFGMR(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_SPFGMR(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid_SPFGMR(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_SPFGMR(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_SPFGMR(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_SPFGMR(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_SPFGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_SPFGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_SPFGMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 new file mode 100644 index 0000000000..d7167721e2 --- /dev/null +++ b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 @@ -0,0 +1,541 @@ +! 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-2024, 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 fsunlinsol_spfgmr_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNSPFGMR_MAXL_DEFAULT = 5_C_INT + integer(C_INT), parameter, public :: SUNSPFGMR_MAXRS_DEFAULT = 0_C_INT + public :: FSUNLinSol_SPFGMR + public :: FSUNLinSol_SPFGMRSetPrecType + public :: FSUNLinSol_SPFGMRSetGSType + public :: FSUNLinSol_SPFGMRSetMaxRestarts + public :: FSUNLinSolGetType_SPFGMR + public :: FSUNLinSolGetID_SPFGMR + public :: FSUNLinSolInitialize_SPFGMR + public :: FSUNLinSolSetATimes_SPFGMR + public :: FSUNLinSolSetPreconditioner_SPFGMR + public :: FSUNLinSolSetScalingVectors_SPFGMR + public :: FSUNLinSolSetZeroGuess_SPFGMR + public :: FSUNLinSolSetup_SPFGMR + public :: FSUNLinSolSolve_SPFGMR + public :: FSUNLinSolNumIters_SPFGMR + public :: FSUNLinSolResNorm_SPFGMR + public :: FSUNLinSolResid_SPFGMR + public :: FSUNLinSolLastFlag_SPFGMR + public :: FSUNLinSolSpace_SPFGMR + public :: FSUNLinSolFree_SPFGMR + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_SPFGMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_SPFGMRSetPrecType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPFGMRSetPrecType") & +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_FSUNLinSol_SPFGMRSetGSType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPFGMRSetGSType") & +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_FSUNLinSol_SPFGMRSetMaxRestarts(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPFGMRSetMaxRestarts") & +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_FSUNLinSolGetType_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes_SPFGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner_SPFGMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors_SPFGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors_SPFGMR") & +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_FSUNLinSolSetZeroGuess_SPFGMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess_SPFGMR") & +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_FSUNLinSolSetup_SPFGMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_SPFGMR") & +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_FSUNLinSolSolve_SPFGMR(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResid_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_SPFGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_SPFGMR") & +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_FSUNLinSolFree_SPFGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_SPFGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_SPFGMR(y, pretype, maxl, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: pretype +integer(C_INT), intent(in) :: maxl +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = c_loc(y) +farg2 = pretype +farg3 = maxl +farg4 = sunctx +fresult = swigc_FSUNLinSol_SPFGMR(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_SPFGMRSetPrecType(s, pretype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: pretype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = pretype +fresult = swigc_FSUNLinSol_SPFGMRSetPrecType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPFGMRSetGSType(s, gstype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: gstype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = gstype +fresult = swigc_FSUNLinSol_SPFGMRSetGSType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPFGMRSetMaxRestarts(s, maxrs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: maxrs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = maxrs +fresult = swigc_FSUNLinSol_SPFGMRSetMaxRestarts(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolGetType_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes_SPFGMR(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes_SPFGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner_SPFGMR(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner_SPFGMR(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors_SPFGMR(s, s1, s2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: s2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(s2) +fresult = swigc_FSUNLinSolSetScalingVectors_SPFGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess_SPFGMR(s, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onoff +fresult = swigc_FSUNLinSolSetZeroGuess_SPFGMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSetup_SPFGMR(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_SPFGMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_SPFGMR(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_SPFGMR(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid_SPFGMR(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_SPFGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_SPFGMR(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_SPFGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_SPFGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_SPFGMR(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..c2cbd50123 --- /dev/null +++ b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# ------------------------------------------------------------------------ +# Programmer(s): Cody J. Balos @ LLNL +# ------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------ +# CMakeLists.txt file for the F2003 SPFGMR SUNLinearSolver object library +# ------------------------------------------------------------------------ + +sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod + SOURCES + fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunlinsolspfgmr_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.c similarity index 100% rename from src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.c rename to src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.c diff --git a/src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 similarity index 100% rename from src/sunlinsol/spfgmr/fmod/fsunlinsol_spfgmr_mod.f90 rename to src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 diff --git a/src/sunlinsol/spgmr/CMakeLists.txt b/src/sunlinsol/spgmr/CMakeLists.txt index 62c7100e86..712f07731a 100644 --- a/src/sunlinsol/spgmr/CMakeLists.txt +++ b/src/sunlinsol/spgmr/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNLINSOL_SPGMR module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/spgmr/fmod/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/spgmr/fmod/CMakeLists.txt rename to src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c new file mode 100644 index 0000000000..c25c8f07ee --- /dev/null +++ b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.c @@ -0,0 +1,481 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_spgmr.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_SPGMR(N_Vector farg1, int const *farg2, int const *farg3, void *farg4) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNLinearSolver)SUNLinSol_SPGMR(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPGMRSetPrecType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPGMRSetPrecType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPGMRSetGSType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPGMRSetGSType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPGMRSetMaxRestarts(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPGMRSetMaxRestarts(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_SPGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_SPGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_SPGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_SPGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_SPGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_SPGMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes_SPGMR(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes_SPGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_SPGMR(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner_SPGMR(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_SPGMR(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors_SPGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess_SPGMR(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess_SPGMR(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_SPGMR(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_SPGMR(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_SPGMR(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_SPGMR(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters_SPGMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPGMR(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm_SPGMR(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_SPGMR(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid_SPGMR(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_SPGMR(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_SPGMR(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_SPGMR(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_SPGMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_SPGMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_SPGMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 new file mode 100644 index 0000000000..142c9328a7 --- /dev/null +++ b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 @@ -0,0 +1,541 @@ +! 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-2024, 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 fsunlinsol_spgmr_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNSPGMR_MAXL_DEFAULT = 5_C_INT + integer(C_INT), parameter, public :: SUNSPGMR_MAXRS_DEFAULT = 0_C_INT + public :: FSUNLinSol_SPGMR + public :: FSUNLinSol_SPGMRSetPrecType + public :: FSUNLinSol_SPGMRSetGSType + public :: FSUNLinSol_SPGMRSetMaxRestarts + public :: FSUNLinSolGetType_SPGMR + public :: FSUNLinSolGetID_SPGMR + public :: FSUNLinSolInitialize_SPGMR + public :: FSUNLinSolSetATimes_SPGMR + public :: FSUNLinSolSetPreconditioner_SPGMR + public :: FSUNLinSolSetScalingVectors_SPGMR + public :: FSUNLinSolSetZeroGuess_SPGMR + public :: FSUNLinSolSetup_SPGMR + public :: FSUNLinSolSolve_SPGMR + public :: FSUNLinSolNumIters_SPGMR + public :: FSUNLinSolResNorm_SPGMR + public :: FSUNLinSolResid_SPGMR + public :: FSUNLinSolLastFlag_SPGMR + public :: FSUNLinSolSpace_SPGMR + public :: FSUNLinSolFree_SPGMR + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_SPGMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_SPGMRSetPrecType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPGMRSetPrecType") & +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_FSUNLinSol_SPGMRSetGSType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPGMRSetGSType") & +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_FSUNLinSol_SPGMRSetMaxRestarts(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPGMRSetMaxRestarts") & +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_FSUNLinSolGetType_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes_SPGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner_SPGMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors_SPGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors_SPGMR") & +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_FSUNLinSolSetZeroGuess_SPGMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess_SPGMR") & +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_FSUNLinSolSetup_SPGMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_SPGMR") & +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_FSUNLinSolSolve_SPGMR(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResid_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_SPGMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_SPGMR") & +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_FSUNLinSolFree_SPGMR(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_SPGMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_SPGMR(y, pretype, maxl, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: pretype +integer(C_INT), intent(in) :: maxl +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = c_loc(y) +farg2 = pretype +farg3 = maxl +farg4 = sunctx +fresult = swigc_FSUNLinSol_SPGMR(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_SPGMRSetPrecType(s, pretype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: pretype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = pretype +fresult = swigc_FSUNLinSol_SPGMRSetPrecType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPGMRSetGSType(s, gstype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: gstype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = gstype +fresult = swigc_FSUNLinSol_SPGMRSetGSType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPGMRSetMaxRestarts(s, maxrs) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: maxrs +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = maxrs +fresult = swigc_FSUNLinSol_SPGMRSetMaxRestarts(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolGetType_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes_SPGMR(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes_SPGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner_SPGMR(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner_SPGMR(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors_SPGMR(s, s1, s2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: s2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(s2) +fresult = swigc_FSUNLinSolSetScalingVectors_SPGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess_SPGMR(s, onff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onff +fresult = swigc_FSUNLinSolSetZeroGuess_SPGMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSetup_SPGMR(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_SPGMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_SPGMR(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_SPGMR(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid_SPGMR(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_SPGMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_SPGMR(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_SPGMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_SPGMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_SPGMR(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..9ea74e0e45 --- /dev/null +++ b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# ------------------------------------------------------------------------ +# Programmer(s): Cody J. Balos @ LLNL +# ------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------ +# CMakeLists.txt file for the F2003 SPGMR SUNLinearSolver object library +# ------------------------------------------------------------------------ + +sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod + SOURCES + fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunlinsolspgmr_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.c similarity index 100% rename from src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.c rename to src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.c diff --git a/src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 similarity index 100% rename from src/sunlinsol/spgmr/fmod/fsunlinsol_spgmr_mod.f90 rename to src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 diff --git a/src/sunlinsol/sptfqmr/CMakeLists.txt b/src/sunlinsol/sptfqmr/CMakeLists.txt index d4d069077c..60bb70ef1f 100644 --- a/src/sunlinsol/sptfqmr/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNLINSOL_SPTFQMR module") # Add F90 module if F2003 interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunlinsol/sptfqmr/fmod/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunlinsol/sptfqmr/fmod/CMakeLists.txt rename to src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt diff --git a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c new file mode 100644 index 0000000000..eecf61a1ce --- /dev/null +++ b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.c @@ -0,0 +1,467 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_linearsolver.h" + + +#include "sunlinsol/sunlinsol_sptfqmr.h" + +SWIGEXPORT SUNLinearSolver _wrap_FSUNLinSol_SPTFQMR(N_Vector farg1, int const *farg2, int const *farg3, void *farg4) { + SUNLinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNLinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNLinearSolver)SUNLinSol_SPTFQMR(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPTFQMRSetPrecType(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPTFQMRSetPrecType(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSol_SPTFQMRSetMaxl(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSol_SPTFQMRSetMaxl(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetType_SPTFQMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_Type result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_Type)SUNLinSolGetType_SPTFQMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolGetID_SPTFQMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNLinearSolver_ID result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNLinearSolver_ID)SUNLinSolGetID_SPTFQMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolInitialize_SPTFQMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolInitialize_SPTFQMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetATimes_SPTFQMR(SUNLinearSolver farg1, void *farg2, SUNATimesFn farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNATimesFn arg3 = (SUNATimesFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNATimesFn)(farg3); + result = (SUNErrCode)SUNLinSolSetATimes_SPTFQMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetPreconditioner_SPTFQMR(SUNLinearSolver farg1, void *farg2, SUNPSetupFn farg3, SUNPSolveFn farg4) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + void *arg2 = (void *) 0 ; + SUNPSetupFn arg3 = (SUNPSetupFn) 0 ; + SUNPSolveFn arg4 = (SUNPSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (void *)(farg2); + arg3 = (SUNPSetupFn)(farg3); + arg4 = (SUNPSolveFn)(farg4); + result = (SUNErrCode)SUNLinSolSetPreconditioner_SPTFQMR(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetScalingVectors_SPTFQMR(SUNLinearSolver farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNLinSolSetScalingVectors_SPTFQMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetZeroGuess_SPTFQMR(SUNLinearSolver farg1, int const *farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNLinSolSetZeroGuess_SPTFQMR(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSetup_SPTFQMR(SUNLinearSolver farg1, SUNMatrix farg2) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (int)SUNLinSolSetup_SPTFQMR(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSolve_SPTFQMR(SUNLinearSolver farg1, SUNMatrix farg2, N_Vector farg3, N_Vector farg4, double const *farg5) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + result = (int)SUNLinSolSolve_SPTFQMR(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolNumIters_SPTFQMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + int result; + + arg1 = (SUNLinearSolver)(farg1); + result = (int)SUNLinSolNumIters_SPTFQMR(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT double _wrap_FSUNLinSolResNorm_SPTFQMR(SUNLinearSolver farg1) { + double fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunrealtype result; + + arg1 = (SUNLinearSolver)(farg1); + result = (sunrealtype)SUNLinSolResNorm_SPTFQMR(arg1); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT N_Vector _wrap_FSUNLinSolResid_SPTFQMR(SUNLinearSolver farg1) { + N_Vector fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + N_Vector result; + + arg1 = (SUNLinearSolver)(farg1); + result = (N_Vector)SUNLinSolResid_SPTFQMR(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNLinSolLastFlag_SPTFQMR(SUNLinearSolver farg1) { + int32_t fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + sunindextype result; + + arg1 = (SUNLinearSolver)(farg1); + result = SUNLinSolLastFlag_SPTFQMR(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolSpace_SPTFQMR(SUNLinearSolver farg1, long *farg2, long *farg3) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNLinSolSpace_SPTFQMR(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNLinSolFree_SPTFQMR(SUNLinearSolver farg1) { + int fresult ; + SUNLinearSolver arg1 = (SUNLinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNLinearSolver)(farg1); + result = (SUNErrCode)SUNLinSolFree_SPTFQMR(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 new file mode 100644 index 0000000000..105984e2f7 --- /dev/null +++ b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 @@ -0,0 +1,514 @@ +! 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-2024, 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 fsunlinsol_sptfqmr_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: SUNSPTFQMR_MAXL_DEFAULT = 5_C_INT + public :: FSUNLinSol_SPTFQMR + public :: FSUNLinSol_SPTFQMRSetPrecType + public :: FSUNLinSol_SPTFQMRSetMaxl + public :: FSUNLinSolGetType_SPTFQMR + public :: FSUNLinSolGetID_SPTFQMR + public :: FSUNLinSolInitialize_SPTFQMR + public :: FSUNLinSolSetATimes_SPTFQMR + public :: FSUNLinSolSetPreconditioner_SPTFQMR + public :: FSUNLinSolSetScalingVectors_SPTFQMR + public :: FSUNLinSolSetZeroGuess_SPTFQMR + public :: FSUNLinSolSetup_SPTFQMR + public :: FSUNLinSolSolve_SPTFQMR + public :: FSUNLinSolNumIters_SPTFQMR + public :: FSUNLinSolResNorm_SPTFQMR + public :: FSUNLinSolResid_SPTFQMR + public :: FSUNLinSolLastFlag_SPTFQMR + public :: FSUNLinSolSpace_SPTFQMR + public :: FSUNLinSolFree_SPTFQMR + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNLinSol_SPTFQMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSol_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSol_SPTFQMRSetPrecType(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPTFQMRSetPrecType") & +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_FSUNLinSol_SPTFQMRSetMaxl(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSol_SPTFQMRSetMaxl") & +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_FSUNLinSolGetType_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetType_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolGetID_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolGetID_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolInitialize_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolInitialize_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetATimes_SPTFQMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetATimes_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetPreconditioner_SPTFQMR(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNLinSolSetPreconditioner_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +type(C_FUNPTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolSetScalingVectors_SPTFQMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSetScalingVectors_SPTFQMR") & +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_FSUNLinSolSetZeroGuess_SPTFQMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetZeroGuess_SPTFQMR") & +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_FSUNLinSolSetup_SPTFQMR(farg1, farg2) & +bind(C, name="_wrap_FSUNLinSolSetup_SPTFQMR") & +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_FSUNLinSolSolve_SPTFQMR(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNLinSolSolve_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolNumIters_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolNumIters_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNLinSolResNorm_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResNorm_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_FSUNLinSolResid_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolResid_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNLinSolLastFlag_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolLastFlag_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNLinSolSpace_SPTFQMR(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNLinSolSpace_SPTFQMR") & +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_FSUNLinSolFree_SPTFQMR(farg1) & +bind(C, name="_wrap_FSUNLinSolFree_SPTFQMR") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNLinSol_SPTFQMR(y, pretype, maxl, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNLinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: pretype +integer(C_INT), intent(in) :: maxl +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = c_loc(y) +farg2 = pretype +farg3 = maxl +farg4 = sunctx +fresult = swigc_FSUNLinSol_SPTFQMR(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSol_SPTFQMRSetPrecType(s, pretype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: pretype +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = pretype +fresult = swigc_FSUNLinSol_SPTFQMRSetPrecType(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSol_SPTFQMRSetMaxl(s, maxl) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: maxl +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = maxl +fresult = swigc_FSUNLinSol_SPTFQMRSetMaxl(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolGetType_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_Type) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetType_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolGetID_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNLinearSolver_ID) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolGetID_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolInitialize_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolInitialize_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSetATimes_SPTFQMR(s, a_data, atimes) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: a_data +type(C_FUNPTR), intent(in), value :: atimes +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 + +farg1 = c_loc(s) +farg2 = a_data +farg3 = atimes +fresult = swigc_FSUNLinSolSetATimes_SPTFQMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetPreconditioner_SPTFQMR(s, p_data, pset, psol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: p_data +type(C_FUNPTR), intent(in), value :: pset +type(C_FUNPTR), intent(in), value :: psol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_FUNPTR) :: farg3 +type(C_FUNPTR) :: farg4 + +farg1 = c_loc(s) +farg2 = p_data +farg3 = pset +farg4 = psol +fresult = swigc_FSUNLinSolSetPreconditioner_SPTFQMR(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNLinSolSetScalingVectors_SPTFQMR(s, s1, s2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(N_Vector), target, intent(inout) :: s1 +type(N_Vector), target, intent(inout) :: s2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(s1) +farg3 = c_loc(s2) +fresult = swigc_FSUNLinSolSetScalingVectors_SPTFQMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolSetZeroGuess_SPTFQMR(s, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(s) +farg2 = onoff +fresult = swigc_FSUNLinSolSetZeroGuess_SPTFQMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSetup_SPTFQMR(s, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(s) +farg2 = c_loc(a) +fresult = swigc_FSUNLinSolSetup_SPTFQMR(farg1, farg2) +swig_result = fresult +end function + +function FSUNLinSolSolve_SPTFQMR(s, a, x, b, tol) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: b +real(C_DOUBLE), intent(in) :: tol +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 + +farg1 = c_loc(s) +farg2 = c_loc(a) +farg3 = c_loc(x) +farg4 = c_loc(b) +farg5 = tol +fresult = swigc_FSUNLinSolSolve_SPTFQMR(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNLinSolNumIters_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolNumIters_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResNorm_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +real(C_DOUBLE) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResNorm_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolResid_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(N_Vector), pointer :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolResid_SPTFQMR(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNLinSolLastFlag_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolLastFlag_SPTFQMR(farg1) +swig_result = fresult +end function + +function FSUNLinSolSpace_SPTFQMR(s, lenrwls, leniwls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_LONG), dimension(*), target, intent(inout) :: lenrwls +integer(C_LONG), dimension(*), target, intent(inout) :: leniwls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(s) +farg2 = c_loc(lenrwls(1)) +farg3 = c_loc(leniwls(1)) +fresult = swigc_FSUNLinSolSpace_SPTFQMR(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNLinSolFree_SPTFQMR(s) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNLinearSolver), target, intent(inout) :: s +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(s) +fresult = swigc_FSUNLinSolFree_SPTFQMR(farg1) +swig_result = fresult +end function + + +end module diff --git a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..ff3dc41956 --- /dev/null +++ b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# ------------------------------------------------------------------------ +# Programmer(s): Cody J. Balos @ LLNL +# ------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------ +# CMakeLists.txt file for the F2003 SPTFQMR SUNLinearSolver object library +# ------------------------------------------------------------------------ + +sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod + SOURCES + fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunlinsolsptfqmr_mod + VERSION + ${sunlinsollib_VERSION} + SOVERSION + ${sunlinsollib_SOVERSION} +) + +message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.c similarity index 100% rename from src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.c rename to src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.c diff --git a/src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 similarity index 100% rename from src/sunlinsol/sptfqmr/fmod/fsunlinsol_sptfqmr_mod.f90 rename to src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 diff --git a/src/sunmatrix/band/CMakeLists.txt b/src/sunmatrix/band/CMakeLists.txt index faafb96173..240fcf7ed4 100644 --- a/src/sunmatrix/band/CMakeLists.txt +++ b/src/sunmatrix/band/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNMATRIX_BAND module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunmatrix/band/fmod/CMakeLists.txt b/src/sunmatrix/band/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunmatrix/band/fmod/CMakeLists.txt rename to src/sunmatrix/band/fmod_int32/CMakeLists.txt diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c new file mode 100644 index 0000000000..d506997738 --- /dev/null +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c @@ -0,0 +1,500 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_matrix.h" + + +#include "sunmatrix/sunmatrix_band.h" + +SWIGEXPORT SUNMatrix _wrap_FSUNBandMatrix(int32_t const *farg1, int32_t const *farg2, int32_t const *farg3, void *farg4) { + SUNMatrix fresult ; + sunindextype arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNMatrix result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNMatrix)SUNBandMatrix(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNBandMatrixStorage(int32_t const *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4, void *farg5) { + SUNMatrix fresult ; + sunindextype arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + sunindextype arg4 ; + SUNContext arg5 = (SUNContext) 0 ; + SUNMatrix result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (sunindextype)(*farg4); + arg5 = (SUNContext)(farg5); + result = (SUNMatrix)SUNBandMatrixStorage(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNBandMatrix_Print(SUNMatrix farg1, void *farg2) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (FILE *)(farg2); + SUNBandMatrix_Print(arg1,arg2); +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_Rows(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_Rows(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_Columns(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_Columns(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_LowerBandwidth(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_LowerBandwidth(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_UpperBandwidth(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_UpperBandwidth(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_StoredUpperBandwidth(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_StoredUpperBandwidth(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_LDim(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_LDim(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNBandMatrix_LData(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNBandMatrix_LData(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FSUNBandMatrix_Cols(SUNMatrix farg1) { + void * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype **result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunrealtype **)SUNBandMatrix_Cols(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatGetID_Band(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix_ID result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix_ID)SUNMatGetID_Band(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNMatClone_Band(SUNMatrix farg1) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix)SUNMatClone_Band(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNMatDestroy_Band(SUNMatrix farg1) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + + arg1 = (SUNMatrix)(farg1); + SUNMatDestroy_Band(arg1); +} + + +SWIGEXPORT int _wrap_FSUNMatZero_Band(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNMatZero_Band(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatCopy_Band(SUNMatrix farg1, SUNMatrix farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatCopy_Band(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAdd_Band(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (SUNErrCode)SUNMatScaleAdd_Band(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAddI_Band(double const *farg1, SUNMatrix farg2) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatScaleAddI_Band(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatMatvec_Band(SUNMatrix farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNMatMatvec_Band(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatSpace_Band(SUNMatrix farg1, long *farg2, long *farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNMatSpace_Band(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunrealtype *)SUNBandMatrix_Data(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} + + diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 new file mode 100644 index 0000000000..82f10ff03b --- /dev/null +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 @@ -0,0 +1,595 @@ +! 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-2024, 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 fsunmatrix_band_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNBandMatrix + public :: FSUNBandMatrixStorage + public :: FSUNBandMatrix_Print + public :: FSUNBandMatrix_Rows + public :: FSUNBandMatrix_Columns + public :: FSUNBandMatrix_LowerBandwidth + public :: FSUNBandMatrix_UpperBandwidth + public :: FSUNBandMatrix_StoredUpperBandwidth + public :: FSUNBandMatrix_LDim + public :: FSUNBandMatrix_LData + public :: FSUNBandMatrix_Cols + public :: FSUNMatGetID_Band + public :: FSUNMatClone_Band + public :: FSUNMatDestroy_Band + public :: FSUNMatZero_Band + public :: FSUNMatCopy_Band + public :: FSUNMatScaleAdd_Band + public :: FSUNMatScaleAddI_Band + public :: FSUNMatMatvec_Band + public :: FSUNMatSpace_Band + + public :: FSUNBandMatrix_Data + public :: FSUNBandMatrix_Column + + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNBandMatrix(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNBandMatrix") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNBandMatrixStorage(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNBandMatrixStorage") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT32_T), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNBandMatrix_Print(farg1, farg2) & +bind(C, name="_wrap_FSUNBandMatrix_Print") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FSUNBandMatrix_Rows(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_Rows") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_Columns(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_Columns") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_LowerBandwidth(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_LowerBandwidth") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_UpperBandwidth(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_UpperBandwidth") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_StoredUpperBandwidth(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_StoredUpperBandwidth") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_LDim(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_LDim") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_LData(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_LData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNBandMatrix_Cols(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_Cols") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNMatGetID_Band(farg1) & +bind(C, name="_wrap_FSUNMatGetID_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatClone_Band(farg1) & +bind(C, name="_wrap_FSUNMatClone_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNMatDestroy_Band(farg1) & +bind(C, name="_wrap_FSUNMatDestroy_Band") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNMatZero_Band(farg1) & +bind(C, name="_wrap_FSUNMatZero_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatCopy_Band(farg1, farg2) & +bind(C, name="_wrap_FSUNMatCopy_Band") & +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_FSUNMatScaleAdd_Band(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatScaleAdd_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatScaleAddI_Band(farg1, farg2) & +bind(C, name="_wrap_FSUNMatScaleAddI_Band") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatMatvec_Band(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatMatvec_Band") & +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_FSUNMatSpace_Band(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatSpace_Band") & +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_FSUNBandMatrix_Data(farg1) & +bind(C, name="_wrap_FSUNBandMatrix_Data") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNBandMatrix_Column(farg1, farg2) & +bind(C, name="_wrap_FSUNBandMatrix_Column") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else +integer(C_INT64_T), intent(in) :: farg2 +#endif +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNBandMatrix(n, mu, ml, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: mu +integer(C_INT32_T), intent(in) :: ml +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +type(C_PTR) :: farg4 + +farg1 = n +farg2 = mu +farg3 = ml +farg4 = sunctx +fresult = swigc_FSUNBandMatrix(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNBandMatrixStorage(n, mu, ml, smu, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: mu +integer(C_INT32_T), intent(in) :: ml +integer(C_INT32_T), intent(in) :: smu +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT32_T) :: farg4 +type(C_PTR) :: farg5 + +farg1 = n +farg2 = mu +farg3 = ml +farg4 = smu +farg5 = sunctx +fresult = swigc_FSUNBandMatrixStorage(farg1, farg2, farg3, farg4, farg5) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNBandMatrix_Print(a, outfile) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = outfile +call swigc_FSUNBandMatrix_Print(farg1, farg2) +end subroutine + +function FSUNBandMatrix_Rows(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_Rows(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_Columns(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_Columns(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_LowerBandwidth(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_LowerBandwidth(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_UpperBandwidth(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_UpperBandwidth(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_StoredUpperBandwidth(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_StoredUpperBandwidth(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_LDim(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_LDim(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_LData(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_LData(farg1) +swig_result = fresult +end function + +function FSUNBandMatrix_Cols(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_Cols(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNMatGetID_Band(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNMatrix_ID) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatGetID_Band(farg1) +swig_result = fresult +end function + +function FSUNMatClone_Band(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatClone_Band(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNMatDestroy_Band(a) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +call swigc_FSUNMatDestroy_Band(farg1) +end subroutine + +function FSUNMatZero_Band(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatZero_Band(farg1) +swig_result = fresult +end function + +function FSUNMatCopy_Band(a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(b) +fresult = swigc_FSUNMatCopy_Band(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatScaleAdd_Band(c, a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(a) +farg3 = c_loc(b) +fresult = swigc_FSUNMatScaleAdd_Band(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatScaleAddI_Band(c, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(a) +fresult = swigc_FSUNMatScaleAddI_Band(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatMatvec_Band(a, x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(a) +farg2 = c_loc(x) +farg3 = c_loc(y) +fresult = swigc_FSUNMatMatvec_Band(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatSpace_Band(a, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +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(a) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNMatSpace_Band(farg1, farg2, farg3) +swig_result = fresult +end function + + +function FSUNBandMatrix_Data(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNBandMatrix_Data(farg1) +call c_f_pointer(fresult, swig_result, [FSUNBandMatrix_LData(a)]) +end function + +function FSUNBandMatrix_Column(a, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else +integer(C_INT64_T), intent(in) :: j +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif + +farg1 = c_loc(a) +farg2 = j +fresult = swigc_FSUNBandMatrix_Column(farg1, farg2) +! We set the array shape to [1] because only the diagonal element +! can be accessed through this function from Fortran. +call c_f_pointer(fresult, swig_result, [1]) +end function + + +end module diff --git a/src/sunmatrix/band/fmod_int64/CMakeLists.txt b/src/sunmatrix/band/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..465260d783 --- /dev/null +++ b/src/sunmatrix/band/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 band SUNMatrix object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunmatrixband_mod + SOURCES + fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunmatrixband_mod + VERSION + ${sunmatrixlib_VERSION} + SOVERSION + ${sunmatrixlib_SOVERSION} +) + +message(STATUS "Added SUNMATRIX_BAND F2003 interface") diff --git a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c similarity index 99% rename from src/sunmatrix/band/fmod/fsunmatrix_band_mod.c rename to src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c index dda3324003..0a5bac84c8 100644 --- a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c @@ -477,7 +477,7 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNBandMatrix_Data(arg1); fresult = result; @@ -489,7 +489,7 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); diff --git a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 similarity index 97% rename from src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 rename to src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 index 4ebf3a229e..f9b8189f10 100644 --- a/src/sunmatrix/band/fmod/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 @@ -238,7 +238,11 @@ function swigc_FSUNBandMatrix_Column(farg1, farg2) & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function @@ -553,8 +557,8 @@ function FSUNBandMatrix_Data(a) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNBandMatrix_Data(farg1) @@ -566,15 +570,23 @@ function FSUNBandMatrix_Column(a, j) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else integer(C_INT64_T), intent(in) :: j -type(C_PTR) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(a) farg2 = j fresult = swigc_FSUNBandMatrix_Column(farg1, farg2) -! We set the array shape to [1] because only the diagonal element +! We set the array shape to [1] because only the diagonal element ! can be accessed through this function from Fortran. call c_f_pointer(fresult, swig_result, [1]) end function diff --git a/src/sunmatrix/dense/CMakeLists.txt b/src/sunmatrix/dense/CMakeLists.txt index 8563a8ced3..e9e1b9ad85 100644 --- a/src/sunmatrix/dense/CMakeLists.txt +++ b/src/sunmatrix/dense/CMakeLists.txt @@ -40,5 +40,5 @@ message(STATUS "Added SUNMATRIX_DENSE module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunmatrix/dense/fmod/CMakeLists.txt b/src/sunmatrix/dense/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunmatrix/dense/fmod/CMakeLists.txt rename to src/sunmatrix/dense/fmod_int32/CMakeLists.txt diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c new file mode 100644 index 0000000000..7f6d3a1a4d --- /dev/null +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c @@ -0,0 +1,430 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_matrix.h" + + +#include "sunmatrix/sunmatrix_dense.h" + +SWIGEXPORT SUNMatrix _wrap_FSUNDenseMatrix(int32_t const *farg1, int32_t const *farg2, void *farg3) { + SUNMatrix fresult ; + sunindextype arg1 ; + sunindextype arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNMatrix result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (SUNContext)(farg3); + result = (SUNMatrix)SUNDenseMatrix(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNDenseMatrix_Print(SUNMatrix farg1, void *farg2) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (FILE *)(farg2); + SUNDenseMatrix_Print(arg1,arg2); +} + + +SWIGEXPORT int32_t _wrap_FSUNDenseMatrix_Rows(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNDenseMatrix_Rows(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNDenseMatrix_Columns(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNDenseMatrix_Columns(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNDenseMatrix_LData(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNDenseMatrix_LData(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT void * _wrap_FSUNDenseMatrix_Cols(SUNMatrix farg1) { + void * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype **result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunrealtype **)SUNDenseMatrix_Cols(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatGetID_Dense(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix_ID result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix_ID)SUNMatGetID_Dense(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNMatClone_Dense(SUNMatrix farg1) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix)SUNMatClone_Dense(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNMatDestroy_Dense(SUNMatrix farg1) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + + arg1 = (SUNMatrix)(farg1); + SUNMatDestroy_Dense(arg1); +} + + +SWIGEXPORT int _wrap_FSUNMatZero_Dense(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNMatZero_Dense(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatCopy_Dense(SUNMatrix farg1, SUNMatrix farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatCopy_Dense(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAdd_Dense(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (SUNErrCode)SUNMatScaleAdd_Dense(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAddI_Dense(double const *farg1, SUNMatrix farg2) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatScaleAddI_Dense(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatMatvec_Dense(SUNMatrix farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNMatMatvec_Dense(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatSpace_Dense(SUNMatrix farg1, long *farg2, long *farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNMatSpace_Dense(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunrealtype *)SUNDenseMatrix_Data(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} + + diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 new file mode 100644 index 0000000000..23c12b6eba --- /dev/null +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 @@ -0,0 +1,463 @@ +! 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-2024, 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 fsunmatrix_dense_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNDenseMatrix + public :: FSUNDenseMatrix_Print + public :: FSUNDenseMatrix_Rows + public :: FSUNDenseMatrix_Columns + public :: FSUNDenseMatrix_LData + public :: FSUNDenseMatrix_Cols + public :: FSUNMatGetID_Dense + public :: FSUNMatClone_Dense + public :: FSUNMatDestroy_Dense + public :: FSUNMatZero_Dense + public :: FSUNMatCopy_Dense + public :: FSUNMatScaleAdd_Dense + public :: FSUNMatScaleAddI_Dense + public :: FSUNMatMatvec_Dense + public :: FSUNMatSpace_Dense + + public :: FSUNDenseMatrix_Data + public :: FSUNDenseMatrix_Column + + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNDenseMatrix(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNDenseMatrix") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNDenseMatrix_Print(farg1, farg2) & +bind(C, name="_wrap_FSUNDenseMatrix_Print") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FSUNDenseMatrix_Rows(farg1) & +bind(C, name="_wrap_FSUNDenseMatrix_Rows") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNDenseMatrix_Columns(farg1) & +bind(C, name="_wrap_FSUNDenseMatrix_Columns") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNDenseMatrix_LData(farg1) & +bind(C, name="_wrap_FSUNDenseMatrix_LData") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNDenseMatrix_Cols(farg1) & +bind(C, name="_wrap_FSUNDenseMatrix_Cols") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNMatGetID_Dense(farg1) & +bind(C, name="_wrap_FSUNMatGetID_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatClone_Dense(farg1) & +bind(C, name="_wrap_FSUNMatClone_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNMatDestroy_Dense(farg1) & +bind(C, name="_wrap_FSUNMatDestroy_Dense") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNMatZero_Dense(farg1) & +bind(C, name="_wrap_FSUNMatZero_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatCopy_Dense(farg1, farg2) & +bind(C, name="_wrap_FSUNMatCopy_Dense") & +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_FSUNMatScaleAdd_Dense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatScaleAdd_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatScaleAddI_Dense(farg1, farg2) & +bind(C, name="_wrap_FSUNMatScaleAddI_Dense") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatMatvec_Dense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatMatvec_Dense") & +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_FSUNMatSpace_Dense(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatSpace_Dense") & +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_FSUNDenseMatrix_Data(farg1) & +bind(C, name="_wrap_FSUNDenseMatrix_Data") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNDenseMatrix_Column(farg1, farg2) & +bind(C, name="_wrap_FSUNDenseMatrix_Column") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else +integer(C_INT64_T), intent(in) :: farg2 +#endif +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNDenseMatrix(m, n, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +integer(C_INT32_T), intent(in) :: m +integer(C_INT32_T), intent(in) :: n +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT32_T) :: farg2 +type(C_PTR) :: farg3 + +farg1 = m +farg2 = n +farg3 = sunctx +fresult = swigc_FSUNDenseMatrix(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNDenseMatrix_Print(a, outfile) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = outfile +call swigc_FSUNDenseMatrix_Print(farg1, farg2) +end subroutine + +function FSUNDenseMatrix_Rows(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNDenseMatrix_Rows(farg1) +swig_result = fresult +end function + +function FSUNDenseMatrix_Columns(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNDenseMatrix_Columns(farg1) +swig_result = fresult +end function + +function FSUNDenseMatrix_LData(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNDenseMatrix_LData(farg1) +swig_result = fresult +end function + +function FSUNDenseMatrix_Cols(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNDenseMatrix_Cols(farg1) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNMatGetID_Dense(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNMatrix_ID) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatGetID_Dense(farg1) +swig_result = fresult +end function + +function FSUNMatClone_Dense(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatClone_Dense(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNMatDestroy_Dense(a) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +call swigc_FSUNMatDestroy_Dense(farg1) +end subroutine + +function FSUNMatZero_Dense(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatZero_Dense(farg1) +swig_result = fresult +end function + +function FSUNMatCopy_Dense(a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(b) +fresult = swigc_FSUNMatCopy_Dense(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatScaleAdd_Dense(c, a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(a) +farg3 = c_loc(b) +fresult = swigc_FSUNMatScaleAdd_Dense(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatScaleAddI_Dense(c, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(a) +fresult = swigc_FSUNMatScaleAddI_Dense(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatMatvec_Dense(a, x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(a) +farg2 = c_loc(x) +farg3 = c_loc(y) +fresult = swigc_FSUNMatMatvec_Dense(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatSpace_Dense(a, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +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(a) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNMatSpace_Dense(farg1, farg2, farg3) +swig_result = fresult +end function + + +function FSUNDenseMatrix_Data(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNDenseMatrix_Data(farg1) +call c_f_pointer(fresult, swig_result, [FSUNDenseMatrix_LData(a)]) +end function + +function FSUNDenseMatrix_Column(a, j) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else +integer(C_INT64_T), intent(in) :: j +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif + +farg1 = c_loc(a) +farg2 = j +fresult = swigc_FSUNDenseMatrix_Column(farg1, farg2) +call c_f_pointer(fresult, swig_result, [FSUNDenseMatrix_Rows(a)]) +end function + + +end module diff --git a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..987102b9f6 --- /dev/null +++ b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 dense SUNMatrix object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunmatrixdense_mod + SOURCES + fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunmatrixdense_mod + VERSION + ${sunmatrixlib_VERSION} + SOVERSION + ${sunmatrixlib_SOVERSION} +) + +message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c similarity index 99% rename from src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c rename to src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c index 8709e95887..140e8d8d61 100644 --- a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c @@ -407,7 +407,7 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNDenseMatrix_Data(arg1); fresult = result; @@ -419,7 +419,7 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); diff --git a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 similarity index 97% rename from src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 rename to src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 index 3f1b68e2bd..7bfb049939 100644 --- a/src/sunmatrix/dense/fmod/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 @@ -188,7 +188,11 @@ function swigc_FSUNDenseMatrix_Column(farg1, farg2) & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function @@ -423,8 +427,8 @@ function FSUNDenseMatrix_Data(a) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNDenseMatrix_Data(farg1) @@ -436,10 +440,18 @@ function FSUNDenseMatrix_Column(a, j) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else integer(C_INT64_T), intent(in) :: j -type(C_PTR) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(a) farg2 = j diff --git a/src/sunmatrix/sparse/CMakeLists.txt b/src/sunmatrix/sparse/CMakeLists.txt index 120a8cbef3..3ca9363150 100644 --- a/src/sunmatrix/sparse/CMakeLists.txt +++ b/src/sunmatrix/sparse/CMakeLists.txt @@ -40,5 +40,5 @@ message(STATUS "Added SUNMATRIX_SPARSE module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunmatrix/sparse/fmod/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunmatrix/sparse/fmod/CMakeLists.txt rename to src/sunmatrix/sparse/fmod_int32/CMakeLists.txt diff --git a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c new file mode 100644 index 0000000000..c329b1edde --- /dev/null +++ b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.c @@ -0,0 +1,565 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_matrix.h" + + +#include "sunmatrix/sunmatrix_sparse.h" + +SWIGEXPORT SUNMatrix _wrap_FSUNSparseMatrix(int32_t const *farg1, int32_t const *farg2, int32_t const *farg3, int const *farg4, void *farg5) { + SUNMatrix fresult ; + sunindextype arg1 ; + sunindextype arg2 ; + sunindextype arg3 ; + int arg4 ; + SUNContext arg5 = (SUNContext) 0 ; + SUNMatrix result; + + arg1 = (sunindextype)(*farg1); + arg2 = (sunindextype)(*farg2); + arg3 = (sunindextype)(*farg3); + arg4 = (int)(*farg4); + arg5 = (SUNContext)(farg5); + result = (SUNMatrix)SUNSparseMatrix(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNSparseFromDenseMatrix(SUNMatrix farg1, double const *farg2, int const *farg3) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype arg2 ; + int arg3 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + result = (SUNMatrix)SUNSparseFromDenseMatrix(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNSparseFromBandMatrix(SUNMatrix farg1, double const *farg2, int const *farg3) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype arg2 ; + int arg3 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (int)(*farg3); + result = (SUNMatrix)SUNSparseFromBandMatrix(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNSparseMatrix_ToCSR(SUNMatrix farg1, void *farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) (SUNMatrix)0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (SUNErrCode)SUNSparseMatrix_ToCSR(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNSparseMatrix_ToCSC(SUNMatrix farg1, void *farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) (SUNMatrix)0 ; + SUNMatrix *arg2 = (SUNMatrix *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix *)(farg2); + result = (SUNErrCode)SUNSparseMatrix_ToCSC(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNSparseMatrix_Realloc(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNSparseMatrix_Realloc(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNSparseMatrix_Reallocate(SUNMatrix farg1, int32_t const *farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (SUNErrCode)SUNSparseMatrix_Reallocate(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNSparseMatrix_Print(SUNMatrix farg1, void *farg2) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + FILE *arg2 = (FILE *) 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (FILE *)(farg2); + SUNSparseMatrix_Print(arg1,arg2); +} + + +SWIGEXPORT int32_t _wrap_FSUNSparseMatrix_Rows(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNSparseMatrix_Rows(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNSparseMatrix_Columns(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNSparseMatrix_Columns(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNSparseMatrix_NNZ(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNSparseMatrix_NNZ(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int32_t _wrap_FSUNSparseMatrix_NP(SUNMatrix farg1) { + int32_t fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype result; + + arg1 = (SUNMatrix)(farg1); + result = SUNSparseMatrix_NP(arg1); + fresult = (sunindextype)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNSparseMatrix_SparseType(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + int result; + + arg1 = (SUNMatrix)(farg1); + result = (int)SUNSparseMatrix_SparseType(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatGetID_Sparse(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix_ID result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix_ID)SUNMatGetID_Sparse(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SUNMatrix _wrap_FSUNMatClone_Sparse(SUNMatrix farg1) { + SUNMatrix fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNMatrix)SUNMatClone_Sparse(arg1); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_FSUNMatDestroy_Sparse(SUNMatrix farg1) { + SUNMatrix arg1 = (SUNMatrix) 0 ; + + arg1 = (SUNMatrix)(farg1); + SUNMatDestroy_Sparse(arg1); +} + + +SWIGEXPORT int _wrap_FSUNMatZero_Sparse(SUNMatrix farg1) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + result = (SUNErrCode)SUNMatZero_Sparse(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatCopy_Sparse(SUNMatrix farg1, SUNMatrix farg2) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatCopy_Sparse(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAdd_Sparse(double const *farg1, SUNMatrix farg2, SUNMatrix farg3) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNMatrix arg3 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + arg3 = (SUNMatrix)(farg3); + result = (SUNErrCode)SUNMatScaleAdd_Sparse(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatScaleAddI_Sparse(double const *farg1, SUNMatrix farg2) { + int fresult ; + sunrealtype arg1 ; + SUNMatrix arg2 = (SUNMatrix) 0 ; + SUNErrCode result; + + arg1 = (sunrealtype)(*farg1); + arg2 = (SUNMatrix)(farg2); + result = (SUNErrCode)SUNMatScaleAddI_Sparse(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatMatvec_Sparse(SUNMatrix farg1, N_Vector farg2, N_Vector farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNMatMatvec_Sparse(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNMatSpace_Sparse(SUNMatrix farg1, long *farg2, long *farg3) { + int fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNMatrix)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (SUNErrCode)SUNMatSpace_Sparse(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + + +SWIGEXPORT double * _wrap_FSUNSparseMatrix_Data(SUNMatrix farg1) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunrealtype *)SUNSparseMatrix_Data(arg1); + fresult = result; + return fresult; +} + +#if SUNDIALS_INT32_T +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); + fresult = result; + return fresult; +} +#else +SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { + int64_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { + int64_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); + fresult = result; + return fresult; +} +#endif + + diff --git a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 new file mode 100644 index 0000000000..fa9ff1555a --- /dev/null +++ b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 @@ -0,0 +1,670 @@ +! 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-2024, 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 fsunmatrix_sparse_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + integer(C_INT), parameter, public :: CSC_MAT = 0_C_INT + integer(C_INT), parameter, public :: CSR_MAT = 1_C_INT + public :: FSUNSparseMatrix + public :: FSUNSparseFromDenseMatrix + public :: FSUNSparseFromBandMatrix + public :: FSUNSparseMatrix_ToCSR + public :: FSUNSparseMatrix_ToCSC + public :: FSUNSparseMatrix_Realloc + public :: FSUNSparseMatrix_Reallocate + public :: FSUNSparseMatrix_Print + public :: FSUNSparseMatrix_Rows + public :: FSUNSparseMatrix_Columns + public :: FSUNSparseMatrix_NNZ + public :: FSUNSparseMatrix_NP + public :: FSUNSparseMatrix_SparseType + public :: FSUNMatGetID_Sparse + public :: FSUNMatClone_Sparse + public :: FSUNMatDestroy_Sparse + public :: FSUNMatZero_Sparse + public :: FSUNMatCopy_Sparse + public :: FSUNMatScaleAdd_Sparse + public :: FSUNMatScaleAddI_Sparse + public :: FSUNMatMatvec_Sparse + public :: FSUNMatSpace_Sparse + + public :: FSUNSparseMatrix_Data + public :: FSUNSparseMatrix_IndexValues + public :: FSUNSparseMatrix_IndexPointers + + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNSparseMatrix(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNSparseMatrix") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T), intent(in) :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT32_T), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FSUNSparseFromDenseMatrix(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNSparseFromDenseMatrix") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNSparseFromBandMatrix(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNSparseFromBandMatrix") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNSparseMatrix_ToCSR(farg1, farg2) & +bind(C, name="_wrap_FSUNSparseMatrix_ToCSR") & +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_FSUNSparseMatrix_ToCSC(farg1, farg2) & +bind(C, name="_wrap_FSUNSparseMatrix_ToCSC") & +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_FSUNSparseMatrix_Realloc(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_Realloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNSparseMatrix_Reallocate(farg1, farg2) & +bind(C, name="_wrap_FSUNSparseMatrix_Reallocate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +subroutine swigc_FSUNSparseMatrix_Print(farg1, farg2) & +bind(C, name="_wrap_FSUNSparseMatrix_Print") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FSUNSparseMatrix_Rows(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_Rows") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNSparseMatrix_Columns(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_Columns") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNSparseMatrix_NNZ(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_NNZ") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNSparseMatrix_NP(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_NP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT32_T) :: fresult +end function + +function swigc_FSUNSparseMatrix_SparseType(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_SparseType") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatGetID_Sparse(farg1) & +bind(C, name="_wrap_FSUNMatGetID_Sparse") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatClone_Sparse(farg1) & +bind(C, name="_wrap_FSUNMatClone_Sparse") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_FSUNMatDestroy_Sparse(farg1) & +bind(C, name="_wrap_FSUNMatDestroy_Sparse") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSUNMatZero_Sparse(farg1) & +bind(C, name="_wrap_FSUNMatZero_Sparse") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatCopy_Sparse(farg1, farg2) & +bind(C, name="_wrap_FSUNMatCopy_Sparse") & +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_FSUNMatScaleAdd_Sparse(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatScaleAdd_Sparse") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatScaleAddI_Sparse(farg1, farg2) & +bind(C, name="_wrap_FSUNMatScaleAddI_Sparse") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNMatMatvec_Sparse(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatMatvec_Sparse") & +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_FSUNMatSpace_Sparse(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNMatSpace_Sparse") & +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_FSUNSparseMatrix_Data(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_Data") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNSparseMatrix_IndexValues(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_IndexValues") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +function swigc_FSUNSparseMatrix_IndexPointers(farg1) & +bind(C, name="_wrap_FSUNSparseMatrix_IndexPointers") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNSparseMatrix(m, n, nnz, sparsetype, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +integer(C_INT32_T), intent(in) :: m +integer(C_INT32_T), intent(in) :: n +integer(C_INT32_T), intent(in) :: nnz +integer(C_INT), intent(in) :: sparsetype +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT32_T) :: farg1 +integer(C_INT32_T) :: farg2 +integer(C_INT32_T) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 + +farg1 = m +farg2 = n +farg3 = nnz +farg4 = sparsetype +farg5 = sunctx +fresult = swigc_FSUNSparseMatrix(farg1, farg2, farg3, farg4, farg5) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNSparseFromDenseMatrix(a, droptol, sparsetype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +real(C_DOUBLE), intent(in) :: droptol +integer(C_INT), intent(in) :: sparsetype +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 + +farg1 = c_loc(a) +farg2 = droptol +farg3 = sparsetype +fresult = swigc_FSUNSparseFromDenseMatrix(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNSparseFromBandMatrix(a, droptol, sparsetype) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +real(C_DOUBLE), intent(in) :: droptol +integer(C_INT), intent(in) :: sparsetype +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +integer(C_INT) :: farg3 + +farg1 = c_loc(a) +farg2 = droptol +farg3 = sparsetype +fresult = swigc_FSUNSparseFromBandMatrix(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNSparseMatrix_ToCSR(a, bout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR), target, intent(inout) :: bout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(bout) +fresult = swigc_FSUNSparseMatrix_ToCSR(farg1, farg2) +swig_result = fresult +end function + +function FSUNSparseMatrix_ToCSC(a, bout) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR), target, intent(inout) :: bout +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(bout) +fresult = swigc_FSUNSparseMatrix_ToCSC(farg1, farg2) +swig_result = fresult +end function + +function FSUNSparseMatrix_Realloc(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_Realloc(farg1) +swig_result = fresult +end function + +function FSUNSparseMatrix_Reallocate(a, nnz) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T), intent(in) :: nnz +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT32_T) :: farg2 + +farg1 = c_loc(a) +farg2 = nnz +fresult = swigc_FSUNSparseMatrix_Reallocate(farg1, farg2) +swig_result = fresult +end function + +subroutine FSUNSparseMatrix_Print(a, outfile) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: outfile +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = outfile +call swigc_FSUNSparseMatrix_Print(farg1, farg2) +end subroutine + +function FSUNSparseMatrix_Rows(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_Rows(farg1) +swig_result = fresult +end function + +function FSUNSparseMatrix_Columns(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_Columns(farg1) +swig_result = fresult +end function + +function FSUNSparseMatrix_NNZ(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_NNZ(farg1) +swig_result = fresult +end function + +function FSUNSparseMatrix_NP(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT32_T) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT32_T) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_NP(farg1) +swig_result = fresult +end function + +function FSUNSparseMatrix_SparseType(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_SparseType(farg1) +swig_result = fresult +end function + +function FSUNMatGetID_Sparse(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNMatrix_ID) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatGetID_Sparse(farg1) +swig_result = fresult +end function + +function FSUNMatClone_Sparse(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatClone_Sparse(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine FSUNMatDestroy_Sparse(a) +use, intrinsic :: ISO_C_BINDING +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +call swigc_FSUNMatDestroy_Sparse(farg1) +end subroutine + +function FSUNMatZero_Sparse(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNMatZero_Sparse(farg1) +swig_result = fresult +end function + +function FSUNMatCopy_Sparse(a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(a) +farg2 = c_loc(b) +fresult = swigc_FSUNMatCopy_Sparse(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatScaleAdd_Sparse(c, a, b) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +type(SUNMatrix), target, intent(inout) :: b +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c +farg2 = c_loc(a) +farg3 = c_loc(b) +fresult = swigc_FSUNMatScaleAdd_Sparse(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatScaleAddI_Sparse(c, a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +real(C_DOUBLE), intent(in) :: c +type(SUNMatrix), target, intent(inout) :: a +integer(C_INT) :: fresult +real(C_DOUBLE) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c +farg2 = c_loc(a) +fresult = swigc_FSUNMatScaleAddI_Sparse(farg1, farg2) +swig_result = fresult +end function + +function FSUNMatMatvec_Sparse(a, x, y) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(N_Vector), target, intent(inout) :: x +type(N_Vector), target, intent(inout) :: y +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(a) +farg2 = c_loc(x) +farg3 = c_loc(y) +fresult = swigc_FSUNMatMatvec_Sparse(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNMatSpace_Sparse(a, lenrw, leniw) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNMatrix), target, intent(inout) :: a +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(a) +farg2 = c_loc(lenrw(1)) +farg3 = c_loc(leniw(1)) +fresult = swigc_FSUNMatSpace_Sparse(farg1, farg2, farg3) +swig_result = fresult +end function + + + +function FSUNSparseMatrix_Data(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_Data(farg1) +call c_f_pointer(fresult, swig_result, [FSUNSparseMatrix_NNZ(a)]) +end function + +function FSUNSparseMatrix_IndexValues(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else +integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_IndexValues(farg1) +call c_f_pointer(fresult, swig_result, [FSUNSparseMatrix_NNZ(a)]) +end function + +function FSUNSparseMatrix_IndexPointers(a) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else +integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif +type(SUNMatrix), target, intent(inout) :: a +type(C_PTR) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(a) +fresult = swigc_FSUNSparseMatrix_IndexPointers(farg1) +call c_f_pointer(fresult, swig_result, [FSUNSparseMatrix_NP(a)+1]) +end function + + +end module diff --git a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..fb0ed79b4c --- /dev/null +++ b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt @@ -0,0 +1,31 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 sparse SUNMatrix object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunmatrixsparse_mod + SOURCES + fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunmatrixsparse_mod + VERSION + ${sunmatrixlib_VERSION} + SOVERSION + ${sunmatrixlib_SOVERSION} +) + +message(STATUS "Added SUNMATRIX_SPARSE F2003 interface") diff --git a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c similarity index 95% rename from src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c rename to src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c index b49bdc9945..3f97241d5f 100644 --- a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.c +++ b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.c @@ -509,18 +509,41 @@ SWIGEXPORT double * _wrap_FSUNSparseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNSparseMatrix_Data(arg1); fresult = result; return fresult; } +#if SUNDIALS_INT32_T +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); + fresult = result; + return fresult; +} +#else SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { int64_t * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); fresult = result; @@ -531,11 +554,12 @@ SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { int64_t * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); fresult = result; return fresult; } +#endif diff --git a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 similarity index 98% rename from src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.f90 rename to src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 index f128403e93..eedd562db3 100644 --- a/src/sunmatrix/sparse/fmod/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 @@ -624,8 +624,8 @@ function FSUNSparseMatrix_Data(a) & use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_Data(farg1) @@ -635,10 +635,14 @@ function FSUNSparseMatrix_Data(a) & function FSUNSparseMatrix_IndexValues(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_IndexValues(farg1) @@ -648,15 +652,19 @@ function FSUNSparseMatrix_IndexValues(a) & function FSUNSparseMatrix_IndexPointers(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_IndexPointers(farg1) call c_f_pointer(fresult, swig_result, [FSUNSparseMatrix_NP(a)+1]) -end function +end function end module diff --git a/src/sunnonlinsol/fixedpoint/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/CMakeLists.txt index 2fcb289310..257fe8f97b 100644 --- a/src/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNNONLINSOL_FIXEDPOINT module") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunnonlinsol/fixedpoint/fmod/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod/CMakeLists.txt rename to src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.c similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.c rename to src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.c diff --git a/src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 similarity index 100% rename from src/sunnonlinsol/fixedpoint/fmod/fsunnonlinsol_fixedpoint_mod.f90 rename to src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..bb2f0097b6 --- /dev/null +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt @@ -0,0 +1,32 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 fixed-point SUNNonlinearSolver +# object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod + SOURCES + fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunnonlinsolfixedpoint_mod + VERSION + ${sunnonlinsollib_VERSION} + SOVERSION + ${sunnonlinsollib_SOVERSION} +) + +message(STATUS "Added SUNNONLINSOL_FIXEDPOINT F2003 interface") diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c new file mode 100644 index 0000000000..3911f51201 --- /dev/null +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.c @@ -0,0 +1,419 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nonlinearsolver.h" + + +#include "sunnonlinsol/sunnonlinsol_fixedpoint.h" + +SWIGEXPORT SUNNonlinearSolver _wrap_FSUNNonlinSol_FixedPoint(N_Vector farg1, int const *farg2, void *farg3) { + SUNNonlinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + int arg2 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNNonlinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (int)(*farg2); + arg3 = (SUNContext)(farg3); + result = (SUNNonlinearSolver)SUNNonlinSol_FixedPoint(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT SUNNonlinearSolver _wrap_FSUNNonlinSol_FixedPointSens(int const *farg1, N_Vector farg2, int const *farg3, void *farg4) { + SUNNonlinearSolver fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + int arg3 ; + SUNContext arg4 = (SUNContext) 0 ; + SUNNonlinearSolver result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (int)(*farg3); + arg4 = (SUNContext)(farg4); + result = (SUNNonlinearSolver)SUNNonlinSol_FixedPointSens(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetType_FixedPoint(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinearSolver_Type result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNNonlinearSolver_Type)SUNNonlinSolGetType_FixedPoint(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolInitialize_FixedPoint(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolInitialize_FixedPoint(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver farg1, N_Vector farg2, N_Vector farg3, N_Vector farg4, double const *farg5, int const *farg6, void *farg7) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int arg6 ; + void *arg7 = (void *) 0 ; + int result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (int)(*farg6); + arg7 = (void *)(farg7); + result = (int)SUNNonlinSolSolve_FixedPoint(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolFree_FixedPoint(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolFree_FixedPoint(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetSysFn_FixedPoint(SUNNonlinearSolver farg1, SUNNonlinSolSysFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolSysFn arg2 = (SUNNonlinSolSysFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolSysFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetSysFn_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetConvTestFn_FixedPoint(SUNNonlinearSolver farg1, SUNNonlinSolConvTestFn farg2, void *farg3) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolConvTestFn arg2 = (SUNNonlinSolConvTestFn) 0 ; + void *arg3 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolConvTestFn)(farg2); + arg3 = (void *)(farg3); + result = (SUNErrCode)SUNNonlinSolSetConvTestFn_FixedPoint(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetMaxIters_FixedPoint(SUNNonlinearSolver farg1, int const *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNNonlinSolSetMaxIters_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetDamping_FixedPoint(SUNNonlinearSolver farg1, double const *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNNonlinSolSetDamping_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumIters_FixedPoint(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumIters_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetCurIter_FixedPoint(SUNNonlinearSolver farg1, int *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetCurIter_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumConvFails_FixedPoint(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumConvFails_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_FixedPoint(SUNNonlinearSolver farg1, void *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolSysFn *arg2 = (SUNNonlinSolSysFn *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolSysFn *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetSysFn_FixedPoint(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 new file mode 100644 index 0000000000..763e069388 --- /dev/null +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 @@ -0,0 +1,425 @@ +! 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-2024, 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 fsunnonlinsol_fixedpoint_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNNonlinSol_FixedPoint + public :: FSUNNonlinSol_FixedPointSens + public :: FSUNNonlinSolGetType_FixedPoint + public :: FSUNNonlinSolInitialize_FixedPoint + public :: FSUNNonlinSolSolve_FixedPoint + public :: FSUNNonlinSolFree_FixedPoint + public :: FSUNNonlinSolSetSysFn_FixedPoint + public :: FSUNNonlinSolSetConvTestFn_FixedPoint + public :: FSUNNonlinSolSetMaxIters_FixedPoint + public :: FSUNNonlinSolSetDamping_FixedPoint + public :: FSUNNonlinSolGetNumIters_FixedPoint + public :: FSUNNonlinSolGetCurIter_FixedPoint + public :: FSUNNonlinSolGetNumConvFails_FixedPoint + public :: FSUNNonlinSolGetSysFn_FixedPoint + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNNonlinSol_FixedPoint(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSol_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNNonlinSol_FixedPointSens(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNNonlinSol_FixedPointSens") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FSUNNonlinSolGetType_FixedPoint(farg1) & +bind(C, name="_wrap_FSUNNonlinSolGetType_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolInitialize_FixedPoint(farg1) & +bind(C, name="_wrap_FSUNNonlinSolInitialize_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSolve_FixedPoint(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNNonlinSolSolve_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT), intent(in) :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolFree_FixedPoint(farg1) & +bind(C, name="_wrap_FSUNNonlinSolFree_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetSysFn_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetSysFn_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetConvTestFn_FixedPoint(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSolSetConvTestFn_FixedPoint") & +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_FSUNNonlinSolSetMaxIters_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetMaxIters_FixedPoint") & +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_FSUNNonlinSolSetDamping_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetDamping_FixedPoint") & +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_FSUNNonlinSolGetNumIters_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumIters_FixedPoint") & +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_FSUNNonlinSolGetCurIter_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetCurIter_FixedPoint") & +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_FSUNNonlinSolGetNumConvFails_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumConvFails_FixedPoint") & +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_FSUNNonlinSolGetSysFn_FixedPoint(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetSysFn_FixedPoint") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNNonlinSol_FixedPoint(y, m, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: m +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(y) +farg2 = m +farg3 = sunctx +fresult = swigc_FSUNNonlinSol_FixedPoint(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNNonlinSol_FixedPointSens(count, y, m, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), pointer :: swig_result +integer(C_INT), intent(in) :: count +type(N_Vector), target, intent(inout) :: y +integer(C_INT), intent(in) :: m +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +type(C_PTR) :: farg4 + +farg1 = count +farg2 = c_loc(y) +farg3 = m +farg4 = sunctx +fresult = swigc_FSUNNonlinSol_FixedPointSens(farg1, farg2, farg3, farg4) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNNonlinSolGetType_FixedPoint(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNNonlinearSolver_Type) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolGetType_FixedPoint(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolInitialize_FixedPoint(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolInitialize_FixedPoint(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSolve_FixedPoint(nls, y0, y, w, tol, callsetup, mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(N_Vector), target, intent(inout) :: y0 +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE), intent(in) :: tol +integer(C_INT), intent(in) :: callsetup +type(C_PTR) :: mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 +integer(C_INT) :: farg6 +type(C_PTR) :: farg7 + +farg1 = c_loc(nls) +farg2 = c_loc(y0) +farg3 = c_loc(y) +farg4 = c_loc(w) +farg5 = tol +farg6 = callsetup +farg7 = mem +fresult = swigc_FSUNNonlinSolSolve_FixedPoint(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FSUNNonlinSolFree_FixedPoint(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolFree_FixedPoint(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSetSysFn_FixedPoint(nls, sysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: sysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = sysfn +fresult = swigc_FSUNNonlinSolSetSysFn_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetConvTestFn_FixedPoint(nls, ctestfn, ctest_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: ctestfn +type(C_PTR) :: ctest_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(nls) +farg2 = ctestfn +farg3 = ctest_data +fresult = swigc_FSUNNonlinSolSetConvTestFn_FixedPoint(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNNonlinSolSetMaxIters_FixedPoint(nls, maxiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), intent(in) :: maxiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(nls) +farg2 = maxiters +fresult = swigc_FSUNNonlinSolSetMaxIters_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetDamping_FixedPoint(nls, beta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +real(C_DOUBLE), intent(in) :: beta +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = c_loc(nls) +farg2 = beta +fresult = swigc_FSUNNonlinSolSetDamping_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumIters_FixedPoint(nls, niters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: niters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(niters(1)) +fresult = swigc_FSUNNonlinSolGetNumIters_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetCurIter_FixedPoint(nls, iter) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), dimension(*), target, intent(inout) :: iter +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(iter(1)) +fresult = swigc_FSUNNonlinSolGetCurIter_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumConvFails_FixedPoint(nls, nconvfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: nconvfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(nconvfails(1)) +fresult = swigc_FSUNNonlinSolGetNumConvFails_FixedPoint(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetSysFn_FixedPoint(nls, sysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), target, intent(inout) :: sysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(sysfn) +fresult = swigc_FSUNNonlinSolGetSysFn_FixedPoint(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/sunnonlinsol/newton/CMakeLists.txt b/src/sunnonlinsol/newton/CMakeLists.txt index 141b978996..718b026d3f 100644 --- a/src/sunnonlinsol/newton/CMakeLists.txt +++ b/src/sunnonlinsol/newton/CMakeLists.txt @@ -39,5 +39,5 @@ message(STATUS "Added SUNNONLINSOL_NEWTON module") # Add F2003 module if interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) - add_subdirectory(fmod) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") endif() diff --git a/src/sunnonlinsol/newton/fmod/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt similarity index 100% rename from src/sunnonlinsol/newton/fmod/CMakeLists.txt rename to src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.c similarity index 100% rename from src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.c rename to src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.c diff --git a/src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 similarity index 100% rename from src/sunnonlinsol/newton/fmod/fsunnonlinsol_newton_mod.f90 rename to src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 diff --git a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..46be1ab585 --- /dev/null +++ b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt @@ -0,0 +1,32 @@ +# --------------------------------------------------------------- +# Programmer(s): Cody J. Balos @ LLNL +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for the F2003 Newton SUNNonlinearSolver +# object library +# --------------------------------------------------------------- + +sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod + SOURCES + fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c + LINK_LIBRARIES + PUBLIC sundials_fcore_mod + OBJECT_LIBRARIES + OUTPUT_NAME + sundials_fsunnonlinsolnewton_mod + VERSION + ${sunnonlinsollib_VERSION} + SOVERSION + ${sunnonlinsollib_SOVERSION} +) + +message(STATUS "Added SUNNONLINSOL_NEWTON F2003 interface") diff --git a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c new file mode 100644 index 0000000000..a7df613d41 --- /dev/null +++ b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.c @@ -0,0 +1,429 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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_nonlinearsolver.h" + + +#include "sunnonlinsol/sunnonlinsol_newton.h" + +SWIGEXPORT SUNNonlinearSolver _wrap_FSUNNonlinSol_Newton(N_Vector farg1, void *farg2) { + SUNNonlinearSolver fresult ; + N_Vector arg1 = (N_Vector) 0 ; + SUNContext arg2 = (SUNContext) 0 ; + SUNNonlinearSolver result; + + arg1 = (N_Vector)(farg1); + arg2 = (SUNContext)(farg2); + result = (SUNNonlinearSolver)SUNNonlinSol_Newton(arg1,arg2); + fresult = result; + return fresult; +} + + +SWIGEXPORT SUNNonlinearSolver _wrap_FSUNNonlinSol_NewtonSens(int const *farg1, N_Vector farg2, void *farg3) { + SUNNonlinearSolver fresult ; + int arg1 ; + N_Vector arg2 = (N_Vector) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNNonlinearSolver result; + + arg1 = (int)(*farg1); + arg2 = (N_Vector)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNNonlinearSolver)SUNNonlinSol_NewtonSens(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetType_Newton(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinearSolver_Type result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNNonlinearSolver_Type)SUNNonlinSolGetType_Newton(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolInitialize_Newton(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolInitialize_Newton(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSolve_Newton(SUNNonlinearSolver farg1, N_Vector farg2, N_Vector farg3, N_Vector farg4, double const *farg5, int const *farg6, void *farg7) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + N_Vector arg2 = (N_Vector) 0 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + sunrealtype arg5 ; + int arg6 ; + void *arg7 = (void *) 0 ; + int result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (N_Vector)(farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (int)(*farg6); + arg7 = (void *)(farg7); + result = (int)SUNNonlinSolSolve_Newton(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolFree_Newton(SUNNonlinearSolver farg1) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + result = (SUNErrCode)SUNNonlinSolFree_Newton(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetSysFn_Newton(SUNNonlinearSolver farg1, SUNNonlinSolSysFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolSysFn arg2 = (SUNNonlinSolSysFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolSysFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetSysFn_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetLSetupFn_Newton(SUNNonlinearSolver farg1, SUNNonlinSolLSetupFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolLSetupFn arg2 = (SUNNonlinSolLSetupFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolLSetupFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetLSetupFn_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetLSolveFn_Newton(SUNNonlinearSolver farg1, SUNNonlinSolLSolveFn farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolLSolveFn arg2 = (SUNNonlinSolLSolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolLSolveFn)(farg2); + result = (SUNErrCode)SUNNonlinSolSetLSolveFn_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetConvTestFn_Newton(SUNNonlinearSolver farg1, SUNNonlinSolConvTestFn farg2, void *farg3) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolConvTestFn arg2 = (SUNNonlinSolConvTestFn) 0 ; + void *arg3 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolConvTestFn)(farg2); + arg3 = (void *)(farg3); + result = (SUNErrCode)SUNNonlinSolSetConvTestFn_Newton(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolSetMaxIters_Newton(SUNNonlinearSolver farg1, int const *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNNonlinSolSetMaxIters_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumIters_Newton(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumIters_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetCurIter_Newton(SUNNonlinearSolver farg1, int *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetCurIter_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetNumConvFails_Newton(SUNNonlinearSolver farg1, long *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + long *arg2 = (long *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (long *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetNumConvFails_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNNonlinSolGetSysFn_Newton(SUNNonlinearSolver farg1, void *farg2) { + int fresult ; + SUNNonlinearSolver arg1 = (SUNNonlinearSolver) 0 ; + SUNNonlinSolSysFn *arg2 = (SUNNonlinSolSysFn *) 0 ; + SUNErrCode result; + + arg1 = (SUNNonlinearSolver)(farg1); + arg2 = (SUNNonlinSolSysFn *)(farg2); + result = (SUNErrCode)SUNNonlinSolGetSysFn_Newton(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + + diff --git a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 new file mode 100644 index 0000000000..53a4bb2bd3 --- /dev/null +++ b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 @@ -0,0 +1,443 @@ +! 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-2024, 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 fsunnonlinsol_newton_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FSUNNonlinSol_Newton + public :: FSUNNonlinSol_NewtonSens + public :: FSUNNonlinSolGetType_Newton + public :: FSUNNonlinSolInitialize_Newton + public :: FSUNNonlinSolSolve_Newton + public :: FSUNNonlinSolFree_Newton + public :: FSUNNonlinSolSetSysFn_Newton + public :: FSUNNonlinSolSetLSetupFn_Newton + public :: FSUNNonlinSolSetLSolveFn_Newton + public :: FSUNNonlinSolSetConvTestFn_Newton + public :: FSUNNonlinSolSetMaxIters_Newton + public :: FSUNNonlinSolGetNumIters_Newton + public :: FSUNNonlinSolGetCurIter_Newton + public :: FSUNNonlinSolGetNumConvFails_Newton + public :: FSUNNonlinSolGetSysFn_Newton + +! WRAPPER DECLARATIONS +interface +function swigc_FSUNNonlinSol_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSol_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR) :: fresult +end function + +function swigc_FSUNNonlinSol_NewtonSens(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSol_NewtonSens") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +integer(C_INT), intent(in) :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNNonlinSolGetType_Newton(farg1) & +bind(C, name="_wrap_FSUNNonlinSolGetType_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolInitialize_Newton(farg1) & +bind(C, name="_wrap_FSUNNonlinSolInitialize_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSolve_Newton(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FSUNNonlinSolSolve_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +integer(C_INT), intent(in) :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolFree_Newton(farg1) & +bind(C, name="_wrap_FSUNNonlinSolFree_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetSysFn_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetSysFn_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetLSetupFn_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetLSetupFn_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetLSolveFn_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetLSolveFn_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNNonlinSolSetConvTestFn_Newton(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNNonlinSolSetConvTestFn_Newton") & +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_FSUNNonlinSolSetMaxIters_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolSetMaxIters_Newton") & +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_FSUNNonlinSolGetNumIters_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumIters_Newton") & +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_FSUNNonlinSolGetCurIter_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetCurIter_Newton") & +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_FSUNNonlinSolGetNumConvFails_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetNumConvFails_Newton") & +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_FSUNNonlinSolGetSysFn_Newton(farg1, farg2) & +bind(C, name="_wrap_FSUNNonlinSolGetSysFn_Newton") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FSUNNonlinSol_Newton(y, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), pointer :: swig_result +type(N_Vector), target, intent(inout) :: y +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(y) +farg2 = sunctx +fresult = swigc_FSUNNonlinSol_Newton(farg1, farg2) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNNonlinSol_NewtonSens(count, y, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNNonlinearSolver), pointer :: swig_result +integer(C_INT), intent(in) :: count +type(N_Vector), target, intent(inout) :: y +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +integer(C_INT) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = count +farg2 = c_loc(y) +farg3 = sunctx +fresult = swigc_FSUNNonlinSol_NewtonSens(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNNonlinSolGetType_Newton(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(SUNNonlinearSolver_Type) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolGetType_Newton(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolInitialize_Newton(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolInitialize_Newton(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSolve_Newton(nls, y0, y, w, tol, calllsetup, mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(N_Vector), target, intent(inout) :: y0 +type(N_Vector), target, intent(inout) :: y +type(N_Vector), target, intent(inout) :: w +real(C_DOUBLE), intent(in) :: tol +integer(C_INT), intent(in) :: calllsetup +type(C_PTR) :: mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +real(C_DOUBLE) :: farg5 +integer(C_INT) :: farg6 +type(C_PTR) :: farg7 + +farg1 = c_loc(nls) +farg2 = c_loc(y0) +farg3 = c_loc(y) +farg4 = c_loc(w) +farg5 = tol +farg6 = calllsetup +farg7 = mem +fresult = swigc_FSUNNonlinSolSolve_Newton(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + +function FSUNNonlinSolFree_Newton(nls) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(nls) +fresult = swigc_FSUNNonlinSolFree_Newton(farg1) +swig_result = fresult +end function + +function FSUNNonlinSolSetSysFn_Newton(nls, sysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: sysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = sysfn +fresult = swigc_FSUNNonlinSolSetSysFn_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetLSetupFn_Newton(nls, lsetupfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: lsetupfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = lsetupfn +fresult = swigc_FSUNNonlinSolSetLSetupFn_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetLSolveFn_Newton(nls, lsolvefn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: lsolvefn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = lsolvefn +fresult = swigc_FSUNNonlinSolSetLSolveFn_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolSetConvTestFn_Newton(nls, ctestfn, ctest_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), intent(in), value :: ctestfn +type(C_PTR) :: ctest_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(nls) +farg2 = ctestfn +farg3 = ctest_data +fresult = swigc_FSUNNonlinSolSetConvTestFn_Newton(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNNonlinSolSetMaxIters_Newton(nls, maxiters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), intent(in) :: maxiters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = c_loc(nls) +farg2 = maxiters +fresult = swigc_FSUNNonlinSolSetMaxIters_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumIters_Newton(nls, niters) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: niters +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(niters(1)) +fresult = swigc_FSUNNonlinSolGetNumIters_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetCurIter_Newton(nls, iter) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_INT), dimension(*), target, intent(inout) :: iter +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(iter(1)) +fresult = swigc_FSUNNonlinSolGetCurIter_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetNumConvFails_Newton(nls, nconvfails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +integer(C_LONG), dimension(*), target, intent(inout) :: nconvfails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(nconvfails(1)) +fresult = swigc_FSUNNonlinSolGetNumConvFails_Newton(farg1, farg2) +swig_result = fresult +end function + +function FSUNNonlinSolGetSysFn_Newton(nls, sysfn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNNonlinearSolver), target, intent(inout) :: nls +type(C_FUNPTR), target, intent(inout) :: sysfn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(nls) +farg2 = c_loc(sysfn) +fresult = swigc_FSUNNonlinSolGetSysFn_Newton(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/swig/Makefile b/swig/Makefile index 7264855297..f8aabe16ba 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -20,7 +20,7 @@ CVODES=fcvodes_mod IDA=fida_mod IDAS=fidas_mod KINSOL=fkinsol_mod -GENERIC=fsundials_core_mod +CORE=fsundials_core_mod NVECTOR=openmp pthreads serial parallel manyvector mpiplusx SUNMATRIX=band dense sparse SUNLINSOL=band dense lapackdense klu spbcgs spfgmr spgmr sptfqmr pcg @@ -29,90 +29,97 @@ SUNADAPTCONTROLLER=imexgus soderlind INCLUDES=-I../include -.PHONY: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch +.PHONY: .SETINT64 .SETINT32 all all32 all64 modules core arkode cvode cvodes ida idas kinsol nvector mpimanyvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller clean -all: generic arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller patch +.SETINT32: + $(eval INT_SIZE=32) + +.SETINT64: + $(eval INT_SIZE=64) + +all: all32 all64 + +all32: .SETINT32 modules + +all64: .SETINT64 modules + +modules: core arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol sunnonlinsol sunadaptcontroller + +core: $(CORE:%:sundials/%.i) + @for i in ${CORE} ; do \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sundials/fmod_int${INT_SIZE} -o ../src/sundials/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} sundials/$${i}.i; \ + done arkode: $(ARKODE:%:arkode/%.i) @for i in ${ARKODE} ; do \ - echo "swig -fortran -outdir ../src/arkode/fmod -o ../src/arkode/fmod/$${i}.c ${INCLUDES} arkode/$${i}.i" ; \ - swig -fortran -outdir ../src/arkode/fmod -o ../src/arkode/fmod/$${i}.c ${INCLUDES} arkode/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/arkode/fmod_int${INT_SIZE} -o ../src/arkode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} arkode/$${i}.i; \ done cvode: $(CVODE:%:cvode/%.i) @for i in ${CVODE} ; do \ - echo "swig -fortran -outdir ../src/cvode/fmod -o ../src/cvode/fmod/$${i}.c ${INCLUDES} cvode/$${i}.i" ; \ - swig -fortran -outdir ../src/cvode/fmod -o ../src/cvode/fmod/$${i}.c ${INCLUDES} cvode/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvode/fmod_int${INT_SIZE} -o ../src/cvode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvode/$${i}.i; \ done cvodes: $(CVODE:%:cvodes/%.i) @for i in ${CVODES} ; do \ - echo "swig -fortran -outdir ../src/cvodes/fmod -o ../src/cvodes/fmod/$${i}.c ${INCLUDES} cvodes/$${i}.i" ; \ - swig -fortran -outdir ../src/cvodes/fmod -o ../src/cvodes/fmod/$${i}.c ${INCLUDES} cvodes/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvodes/fmod_int${INT_SIZE} -o ../src/cvodes/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvodes/$${i}.i; \ done ida: $(IDA:%:ida/%.i) @for i in ${IDA} ; do \ - echo "swig -fortran -outdir ../src/ida/fmod -o ../src/ida/fmod/$${i}.c ${INCLUDES} ida/$${i}.i" ; \ - swig -fortran -outdir ../src/ida/fmod -o ../src/ida/fmod/$${i}.c ${INCLUDES} ida/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/ida/fmod_int${INT_SIZE} -o ../src/ida/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} ida/$${i}.i; \ done idas: $(IDAS:%:idas/%.i) @for i in ${IDAS} ; do \ - echo "swig -fortran -outdir ../src/idas/fmod -o ../src/idas/fmod/$${i}.c ${INCLUDES} idas/$${i}.i" ; \ - swig -fortran -outdir ../src/idas/fmod -o ../src/idas/fmod/$${i}.c ${INCLUDES} idas/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/idas/fmod_int${INT_SIZE} -o ../src/idas/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} idas/$${i}.i; \ done kinsol: $(KINSOL:%:kinsol/%.i) @for i in ${KINSOL} ; do \ - echo "swig -fortran -outdir ../src/kinsol/fmod -o ../src/kinsol/fmod/$${i}.c ${INCLUDES} kinsol/$${i}" ; \ - swig -fortran -outdir ../src/kinsol/fmod -o ../src/kinsol/fmod/$${i}.c ${INCLUDES} kinsol/$${i}.i ; \ - done - -generic: $(GENERIC:%:sundials/%.i) - @for i in ${GENERIC} ; do \ - echo "swig -fortran -outdir ../src/sundials/fmod -o ../src/sundials/fmod/$${i}.c ${INCLUDES} $${i}" ; \ - swig -fortran -outdir ../src/sundials/fmod -o ../src/sundials/fmod/$${i}.c ${INCLUDES} sundials/$${i}.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/kinsol/fmod_int${INT_SIZE} -o ../src/kinsol/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} kinsol/$${i}.i; \ done nvector: $(NVECTOR:%:nvector/fnvector_%_mod.i) mpimanyvector @for i in ${NVECTOR} ; do \ - echo "swig -fortran -outdir ../src/nvector/$${i}/fmod -o ../src/nvector/$${i}/fmod ${INCLUDES} nvector/fnvector_$${i}_mod.i" ; \ - swig -fortran -outdir ../src/nvector/$${i}/fmod -o ../src/nvector/$${i}/fmod/fnvector_$${i}_mod.c ${INCLUDES} nvector/fnvector_$${i}_mod.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/$${i}/fmod_int${INT_SIZE} -o ../src/nvector/$${i}/fmod_int${INT_SIZE}/fnvector_$${i}_mod.c ${INCLUDES} nvector/fnvector_$${i}_mod.i; \ done mpimanyvector: nvector/fnvector_mpimanyvector_mod.i - @echo "swig -fortran -outdir ../src/nvector/manyvector/fmod -o ../src/nvector/manyvector/fmod ${INCLUDES} nvector/fnvector_mpimanyvector_mod.i" ; \ - swig -fortran -outdir ../src/nvector/manyvector/fmod -o ../src/nvector/manyvector/fmod/fnvector_mpimanyvector_mod.c ${INCLUDES} nvector/fnvector_mpimanyvector_mod.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/manyvector/fmod_int${INT_SIZE} -o ../src/nvector/manyvector/fmod_int${INT_SIZE}/fnvector_mpimanyvector_mod.c ${INCLUDES} nvector/fnvector_mpimanyvector_mod.i; sunmatrix: $(SUNMATRIX:%:sunmatrix/fsunmatrix_%_mod.i) @for i in ${SUNMATRIX} ; do \ - echo "swig -fortran -outdir ../src/sunmatrix/$${i}/fmod -o ../src/sunmatrix/$${i}/fmod ${INCLUDES} sunmatrix/fsunmatrix_$${i}_mod.i" ; \ - swig -fortran -outdir ../src/sunmatrix/$${i}/fmod -o ../src/sunmatrix/$${i}/fmod/fsunmatrix_$${i}_mod.c ${INCLUDES} sunmatrix/fsunmatrix_$${i}_mod.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunmatrix/$${i}/fmod_int${INT_SIZE} -o ../src/sunmatrix/$${i}/fmod_int${INT_SIZE}/fsunmatrix_$${i}_mod.c ${INCLUDES} sunmatrix/fsunmatrix_$${i}_mod.i; \ done sunlinsol: $(SUNLINSOL:%:sunlinsol/fsunlinsol_%_mod.i) @for i in ${SUNLINSOL} ; do \ - echo "swig -fortran -outdir ../src/sunlinsol/$${i}/fmod -o ../src/sunlinsol/$${i}/fmod ${INCLUDES} sunlinsol/fsunlinsol_$${i}_mod.i" ; \ - swig -fortran -outdir ../src/sunlinsol/$${i}/fmod -o ../src/sunlinsol/$${i}/fmod/fsunlinsol_$${i}_mod.c ${INCLUDES} sunlinsol/fsunlinsol_$${i}_mod.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunlinsol/$${i}/fmod_int${INT_SIZE}/fsunlinsol_$${i}_mod.c ${INCLUDES} sunlinsol/fsunlinsol_$${i}_mod.i; \ done sunnonlinsol: $(SUNNONLINSOL:%:sunnonlinsol/fsunnonlinsol_%_mod.i) @for i in ${SUNNONLINSOL} ; do \ - echo "swig -fortran -outdir ../src/sunnonlinsol/$${i}/fmod -o ../src/sunnonlinsol/$${i}/fmod ${INCLUDES} sunnonlinsol/fsunnonlinsol_$${i}_mod.i" ; \ - swig -fortran -outdir ../src/sunnonlinsol/$${i}/fmod -o ../src/sunnonlinsol/$${i}/fmod/fsunnonlinsol_$${i}_mod.c ${INCLUDES} sunnonlinsol/fsunnonlinsol_$${i}_mod.i ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE}/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 ; \ + set -x; \ + swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE} -o ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE}/fsunadaptcontroller_$${i}_mod.c ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i; \ done -patch: .FORCE - cd ..; - clean: - rm ../src/**/fmod/*.c; rm ../src/**/fmod/*.f90 - -.FORCE: ; + rm ../src/**/fmod*/*.c; rm ../src/**/fmod*/*.f90 diff --git a/swig/README.md b/swig/README.md index ab12b54893..ae3b174264 100644 --- a/swig/README.md +++ b/swig/README.md @@ -52,8 +52,8 @@ $ make install # optional ## How to regenerate the interfaces To regenerate the interfaces that have already been created. Simply run -`make` from the `sunrepo/swig` directory. **This will replace all the -generated files in `sunrepo/src`.** +`make all32 all64` from the `sundials/swig` directory. +**This will replace all the generated files in `sundials/src`.** ## Creating a new interface diff --git a/swig/nvector/fnvector_manyvector_mod.i b/swig/nvector/fnvector_manyvector_mod.i index 9bc07378a4..417197d0ef 100644 --- a/swig/nvector/fnvector_manyvector_mod.i +++ b/swig/nvector/fnvector_manyvector_mod.i @@ -55,7 +55,11 @@ bind(C, name="_wrap_FN_VGetSubvectorArrayPointer_ManyVector") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function %} @@ -66,10 +70,18 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else integer(C_INT64_T), intent(in) :: vec_num +#endif type(C_PTR) :: fresult type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(v) farg2 = vec_num diff --git a/swig/nvector/fnvector_mpimanyvector_mod.i b/swig/nvector/fnvector_mpimanyvector_mod.i index 83bb770d27..71dbe86b05 100644 --- a/swig/nvector/fnvector_mpimanyvector_mod.i +++ b/swig/nvector/fnvector_mpimanyvector_mod.i @@ -55,7 +55,11 @@ bind(C, name="_wrap_FN_VGetSubvectorArrayPointer_MPIManyVector") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function %} @@ -66,10 +70,18 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(N_Vector), target, intent(inout) :: v +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: vec_num +#else integer(C_INT64_T), intent(in) :: vec_num +#endif type(C_PTR) :: fresult type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(v) farg2 = vec_num diff --git a/swig/sundials/fsundials.i b/swig/sundials/fsundials.i index 7f4f6f8b67..7ea007a29c 100644 --- a/swig/sundials/fsundials.i +++ b/swig/sundials/fsundials.i @@ -53,8 +53,11 @@ // Assume sunrealtype* is an array of doubles %apply double[] { sunrealtype* }; -// Assume sunindextype* is an array of long int -%apply long int[] { sunindextype* }; +#ifdef GENERATE_INT32 +%apply int[] { sunindextype* }; +#else +%apply long long[] { sunindextype* }; +#endif // Assume int* is an array of integers %apply int[] { int* }; diff --git a/swig/sundials/fsundials_types.i b/swig/sundials/fsundials_types.i index 5877bf99bb..248ec9d5e7 100644 --- a/swig/sundials/fsundials_types.i +++ b/swig/sundials/fsundials_types.i @@ -17,9 +17,15 @@ %include <stdint.i> +#ifdef GENERATE_INT32 +// Inform SWIG of the configure-provided types +#define SUNDIALS_INT32_T +#define SUNDIALS_INDEX_TYPE int32_t +#else // Inform SWIG of the configure-provided types #define SUNDIALS_INT64_T #define SUNDIALS_INDEX_TYPE int64_t +#endif #define SUNDIALS_DOUBLE_PRECISION #define sunbooleantype int @@ -73,10 +79,6 @@ #ifndef SUNDIALS_DOUBLE_PRECISION #error "The Fortran bindings are only targeted at double-precision" #endif - -#ifndef SUNDIALS_INT64_T -#error "The Fortran bindings are only targeted at 64-bit indices" -#endif %} // We insert the binding code for SUN_COMM_NULL ourselves because diff --git a/swig/sunmatrix/fsunmatrix_band_mod.i b/swig/sunmatrix/fsunmatrix_band_mod.i index bc23b646fb..11e468608a 100644 --- a/swig/sunmatrix/fsunmatrix_band_mod.i +++ b/swig/sunmatrix/fsunmatrix_band_mod.i @@ -38,7 +38,7 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNBandMatrix_Data(arg1); fresult = result; @@ -50,7 +50,7 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); @@ -78,7 +78,11 @@ bind(C, name="_wrap_FSUNBandMatrix_Column") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function %} @@ -89,8 +93,8 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNBandMatrix_Data(farg1) @@ -102,15 +106,23 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else integer(C_INT64_T), intent(in) :: j -type(C_PTR) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(a) farg2 = j fresult = swigc_FSUNBandMatrix_Column(farg1, farg2) -! We set the array shape to [1] because only the diagonal element +! We set the array shape to [1] because only the diagonal element ! can be accessed through this function from Fortran. call c_f_pointer(fresult, swig_result, [1]) end function diff --git a/swig/sunmatrix/fsunmatrix_dense_mod.i b/swig/sunmatrix/fsunmatrix_dense_mod.i index d2f72e31b4..572922617c 100644 --- a/swig/sunmatrix/fsunmatrix_dense_mod.i +++ b/swig/sunmatrix/fsunmatrix_dense_mod.i @@ -38,7 +38,7 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNDenseMatrix_Data(arg1); fresult = result; @@ -50,7 +50,7 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype arg2 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); arg2 = (sunindextype)(*farg2); result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); @@ -78,7 +78,11 @@ bind(C, name="_wrap_FSUNDenseMatrix_Column") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: farg2 +#else integer(C_INT64_T), intent(in) :: farg2 +#endif type(C_PTR) :: fresult end function %} @@ -89,8 +93,8 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNDenseMatrix_Data(farg1) @@ -102,10 +106,18 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), intent(in) :: j +#else integer(C_INT64_T), intent(in) :: j -type(C_PTR) :: fresult -type(C_PTR) :: farg1 -integer(C_INT64_T) :: farg2 +#endif +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T) :: farg2 +#else +integer(C_INT64_T) :: farg2 +#endif farg1 = c_loc(a) farg2 = j diff --git a/swig/sunmatrix/fsunmatrix_sparse_mod.i b/swig/sunmatrix/fsunmatrix_sparse_mod.i index 40b3d811eb..36ff430367 100644 --- a/swig/sunmatrix/fsunmatrix_sparse_mod.i +++ b/swig/sunmatrix/fsunmatrix_sparse_mod.i @@ -40,18 +40,41 @@ SWIGEXPORT double * _wrap_FSUNSparseMatrix_Data(SUNMatrix farg1) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunrealtype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunrealtype *)SUNSparseMatrix_Data(arg1); fresult = result; return fresult; } +#if SUNDIALS_INT32_T +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); + fresult = result; + return fresult; +} + +SWIGEXPORT int32_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { + int32_t * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); + fresult = result; + return fresult; +} +#else SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexValues(SUNMatrix farg1) { int64_t * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunindextype *)SUNSparseMatrix_IndexValues(arg1); fresult = result; @@ -62,12 +85,13 @@ SWIGEXPORT int64_t * _wrap_FSUNSparseMatrix_IndexPointers(SUNMatrix farg1) { int64_t * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; sunindextype *result = 0 ; - + arg1 = (SUNMatrix)(farg1); result = (sunindextype *)SUNSparseMatrix_IndexPointers(arg1); fresult = result; return fresult; } +#endif %} %insert("fdecl") %{ @@ -109,8 +133,8 @@ result(swig_result) use, intrinsic :: ISO_C_BINDING real(C_DOUBLE), dimension(:), pointer :: swig_result type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_Data(farg1) @@ -120,10 +144,14 @@ end function function FSUNSparseMatrix_IndexValues(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_IndexValues(farg1) @@ -133,13 +161,17 @@ end function function FSUNSparseMatrix_IndexPointers(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING +#ifdef SUNDIALS_INT32_T +integer(C_INT32_T), dimension(:), pointer :: swig_result +#else integer(C_INT64_T), dimension(:), pointer :: swig_result +#endif type(SUNMatrix), target, intent(inout) :: a -type(C_PTR) :: fresult -type(C_PTR) :: farg1 +type(C_PTR) :: fresult +type(C_PTR) :: farg1 farg1 = c_loc(a) fresult = swigc_FSUNSparseMatrix_IndexPointers(farg1) call c_f_pointer(fresult, swig_result, [FSUNSparseMatrix_NP(a)+1]) -end function +end function %} diff --git a/test/answers b/test/answers index 96a64d9683..dd4aebcaa5 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 96a64d9683fa88ca890c097685e373a1efd3407e +Subproject commit dd4aebcaa5a886746fa281c528d452fdae825cd2 diff --git a/test/env/default.sh b/test/env/default.sh index 6fdf276cf3..4f72c3f7f5 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -181,7 +181,7 @@ export SUNDIALS_KINSOL=ON # Fortran interface status if [ "$compilername" == "gcc" ]; then - if [[ ("$SUNDIALS_PRECISION" == "double") && ("$SUNDIALS_INDEX_SIZE" == "64") ]]; then + if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then export SUNDIALS_FMOD_INTERFACE=ON else export SUNDIALS_FMOD_INTERFACE=OFF diff --git a/test/env/docker.sh b/test/env/docker.sh index 105f5aaedc..361d91646c 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -134,7 +134,7 @@ export SUNDIALS_KINSOL=ON # Fortran interface status if [ "$compilername" == "gcc" ]; then - if [[ ("$SUNDIALS_PRECISION" == "double") && ("$SUNDIALS_INDEX_SIZE" == "64") ]]; then + if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then export SUNDIALS_FMOD_INTERFACE=ON else export SUNDIALS_FMOD_INTERFACE=OFF diff --git a/test/env/lassen.sh b/test/env/lassen.sh index 59d26d3b7f..473b7f1522 100644 --- a/test/env/lassen.sh +++ b/test/env/lassen.sh @@ -105,7 +105,7 @@ else fi # Fortran settings -if [[ ("$SUNDIALS_PRECISION" == "double") && ("$indexsize" == "64") ]]; then +if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then export SUNDIALS_FMOD_INTERFACE=${FORTRAN_STATUS} else export SUNDIALS_FMOD_INTERFACE=OFF diff --git a/test/env/quartz.sh b/test/env/quartz.sh index fdafcd3318..e70ea2b512 100644 --- a/test/env/quartz.sh +++ b/test/env/quartz.sh @@ -105,7 +105,7 @@ else fi # Fortran settings -if [[ ("$SUNDIALS_PRECISION" == "double") && ("$indexsize" == "64") ]]; then +if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then export SUNDIALS_FMOD_INTERFACE=${FORTRAN_STATUS} else export SUNDIALS_FMOD_INTERFACE=OFF diff --git a/test/env/summit.sh b/test/env/summit.sh deleted file mode 100644 index 4cfcce6868..0000000000 --- a/test/env/summit.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -# ------------------------------------------------------------------------------ -# Programmer(s): David J. Gardner @ LLNL -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2024, 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 -# ------------------------------------------------------------------------------ -# Script that sets up the environment for SUNDIALS testing on Summit. -# -# Usage: source env.summit.sh <compiler spec> <build type> -# -# Optional Inputs: -# <compiler spec> = Compiler to build sundials with: -# e.g., xl@16.1.1-5, gcc@8.1.1, etc. -# <build type> = SUNDIALS build type: -# dbg : debug build -# opt : optimized build -# ------------------------------------------------------------------------------ - -echo "./summit.sh $*" | tee -a setup_env.log - -# set defaults for optional inputs -compiler="xl@16.1.1-5" # compiler spec -bldtype="opt" # build type dbg = debug or opt = optimized - -# set optional inputs if provided -if [ "$#" -gt 0 ]; then - compiler=$1 -fi - -if [ "$#" -gt 1 ]; then - bldtype=$2 -fi - -# ------------------------------------------------------------------------------ -# Setup environment -# ------------------------------------------------------------------------------ - -# get compiler name and version from spec -compilername="${compiler%%@*}" -compilerversion="${compiler##*@}" - -# load default cmake module -module load cmake - -# load compiler module -case "$compilername" in - clang) - module load clang/${compilerversion} - if [ $? -ne 0 ]; then return 1; fi - export CC=$(which clang) - export CXX=$(which clang++) - export FC="" - FORTRAN_STATUS=OFF - ;; - gcc) - module load gcc/${compilerversion} - if [ $? -ne 0 ]; then return 1; fi - export CC=$(which gcc) - export CXX=$(which g++) - export FC=$(which gfortran) - FORTRAN_STATUS=ON - ;; - xl) - module load xl/${compilerversion} - if [ $? -ne 0 ]; then return 1; fi - export CC=$(which xlc_r) - export CXX=$(which xlc++_r) - export FC=$(which xlf2003_r) - FORTRAN_STATUS=OFF # Build issues with F2003 interface - ;; - pgi) - module load pgi/${compilerversion} - if [ $? -ne 0 ]; then return 1; fi - export CC=$(which pgcc) - export CXX=$(which pgc++) - export FC=$(which pgfortran) - FORTRAN_STATUS=ON - ;; - *) - echo "ERROR: Invalid compiler option: $compiler" - return 1 - ;; -esac - -# set compiler flags -if [ "$bldtype" == "dbg" ]; then - export CFLAGS="-g -O0" - export CXXFLAGS="-g -O0" - export FFLAGS="-g -O0" -elif [ "$bldtype" == "opt" ]; then - export CFLAGS="-g -O3" - export CXXFLAGS="-g -O3" - export FFLAGS="-g -O3" -else - echo "ERROR: Invalid build type: $bldtype" - return 1 -fi - -# Fortran settings -if [[ ("$SUNDIALS_PRECISION" == "double") && ("$indexsize" == "64") ]]; then - export SUNDIALS_FMOD_INTERFACE=${FORTRAN_STATUS} -else - export SUNDIALS_FMOD_INTERFACE=OFF -fi - -# Sundials monitoring -export SUNDIALS_MONITORING=ON - -# set MPI compiler wrapper -export SUNDIALS_MPI=ON -export MPICC=$(which mpicc) -export MPICXX=$(which mpicxx) -export MPIFC=$(which mpifort) -export MPIEXEC=$(which srun) - -# PThread settings -export SUNDIALS_PTHREAD=ON - -# OpenMP settings -export SUNDIALS_OPENMP=ON -export OMP_NUM_THREADS=20 - -# LAPACK settings -module load essl -export SUNDIALS_LAPACK=ON -export LAPACK_LIBRARIES="${OLCF_ESSL_ROOT}/lib64/libessl.so" - -# CUDA settings -module load cuda -export SUNDIALS_CUDA=ON -export CUDAARCHS=70 From 1451b5e0d458243b277892937290bfb77158ce8c Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Fri, 14 Jun 2024 12:29:29 -0700 Subject: [PATCH 065/137] CMake: Revert KLU find_package updates (#505) Revert changes to FindKLU made in #447 --- cmake/tpl/FindKLU.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index 47ac8dd9c8..a3d817d037 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -33,11 +33,7 @@ if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) # Prefer the import target from upstream SuiteSparse if it is available # and the user didn't point to a specific (different) version. - find_package(AMD CONFIG) - find_package(BTF CONFIG) - find_package(COLAMD CONFIG) find_package(KLU CONFIG) - find_package(SuiteSparse_config CONFIG) if(TARGET SuiteSparse::KLU) if(NOT TARGET SUNDIALS::KLU) From e4717fe86c945bea759b33595956d55198297e10 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 19 Jun 2024 16:04:06 -0700 Subject: [PATCH 066/137] Bugfix: windows fortran builds (#506) Fixes various issues related to building Fortran interfaces and examples on Windows --- .github/workflows/windows-latest-intel.yml | 50 ++++++ .github/workflows/windows-latest-mingw.yml | 49 +++++- .github/workflows/windows-latest.yml | 12 +- CHANGELOG.md | 2 + cmake/SundialsBuildOptionsPre.cmake | 2 +- cmake/SundialsSetupFortran.cmake | 19 --- cmake/macros/SundialsAddLibrary.cmake | 48 ++++-- doc/shared/RecentChanges.rst | 2 + doc/shared/sundials/Fortran.rst | 3 +- doc/shared/sundials/Install.rst | 13 +- examples/CMakeLists.txt | 14 +- examples/arkode/F2003_custom/CMakeLists.txt | 2 +- .../ark_analytic_complex_f2003.f90 | 2 +- .../F2003_custom/ark_brusselator1D_f2003.f90 | 12 +- .../F2003_custom/fnvector_complex_mod.f90 | 12 +- .../F2003_custom/fnvector_fortran_mod.f90 | 24 +-- .../F2003_custom/fsunlinsol_fortran_mod.f90 | 14 +- .../F2003_custom/fsunmatrix_fortran_mod.f90 | 12 +- .../test_fnvector_complex_mod.f90 | 6 +- .../test_fnvector_fortran_mod.f90 | 10 +- .../test_fsunlinsol_fortran_mod.f90 | 8 +- .../test_fsunmatrix_fortran_mod.f90 | 16 +- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 6 +- .../F2003_parallel/ark_diag_non_f2003.f90 | 4 +- .../F2003_parallel/ark_heat2D_f2003.f90 | 2 +- examples/arkode/F2003_serial/CMakeLists.txt | 18 +- .../ark_bruss1D_FEM_klu_f2003.f90 | 47 +++--- .../arkode/F2003_serial/ark_bruss_f2003.f90 | 12 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 6 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 2 +- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 2 +- .../F2003_serial/ark_roberts_dns_f2003.f90 | 2 +- .../F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 6 +- .../F2003_parallel/cv_diag_kry_f2003.f90 | 6 +- .../F2003_parallel/cv_diag_non_p_f2003.f90 | 4 +- .../F2003_serial/cv_analytic_fp_f2003.f90 | 2 +- .../cv_analytic_sys_dns_f2003.f90 | 2 +- .../cv_analytic_sys_dns_jac_f2003.f90 | 2 +- .../cv_analytic_sys_klu_f2003.f90 | 6 +- .../F2003_serial/cv_brusselator_dns_f2003.f90 | 2 +- .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 6 +- .../F2003_serial/cv_diurnal_kry_f2003.f90 | 10 +- .../F2003_serial/cv_roberts_dnsL_f2003.f90 | 2 +- .../cv_roberts_dns_constraints_f2003.f90 | 2 +- .../F2003_serial/cv_roberts_dns_f2003.f90 | 2 +- .../F2003_serial/cv_roberts_klu_f2003.f90 | 8 +- examples/cvodes/F2003_serial/CMakeLists.txt | 3 + .../F2003_openmp/idaHeat2D_kry_omp_f2003.f90 | 6 +- .../ida_heat2D_kry_bbd_f2003.f90 | 8 +- .../ida/F2003_serial/idaHeat2D_kry_f2003.f90 | 6 +- .../idasAkzoNob_ASAi_dns_f2003.f90 | 2 +- .../F2003_serial/idasHeat2D_kry_f2003.f90 | 6 +- .../F2003_parallel/kin_diagon_kry_f2003.f90 | 10 +- .../F2003_serial/kinDiagon_kry_f2003.f90 | 2 +- .../F2003_serial/kinLaplace_bnd_f2003.f90 | 12 +- .../kinLaplace_picard_kry_f2003.f90 | 14 +- .../F2003_serial/kinRoboKin_dns_f2003.f90 | 4 +- examples/nvector/C_openmp/CMakeLists.txt | 4 +- examples/nvector/manyvector/CMakeLists.txt | 4 +- examples/nvector/mpimanyvector/CMakeLists.txt | 4 +- examples/nvector/mpiplusx/CMakeLists.txt | 4 +- examples/nvector/parallel/CMakeLists.txt | 4 +- examples/nvector/pthreads/CMakeLists.txt | 4 +- examples/nvector/serial/CMakeLists.txt | 6 +- examples/sunlinsol/band/CMakeLists.txt | 6 +- examples/sunlinsol/dense/CMakeLists.txt | 6 +- examples/sunlinsol/klu/CMakeLists.txt | 6 +- examples/sunlinsol/lapackdense/CMakeLists.txt | 6 +- examples/sunlinsol/pcg/serial/CMakeLists.txt | 6 +- .../sunlinsol/spbcgs/serial/CMakeLists.txt | 6 +- .../sunlinsol/spfgmr/serial/CMakeLists.txt | 6 +- .../sunlinsol/spgmr/serial/CMakeLists.txt | 6 +- .../sunlinsol/sptfqmr/serial/CMakeLists.txt | 6 +- examples/sunmatrix/band/CMakeLists.txt | 6 +- examples/sunmatrix/dense/CMakeLists.txt | 4 +- examples/sunmatrix/sparse/CMakeLists.txt | 4 +- .../sunnonlinsol/fixedpoint/CMakeLists.txt | 3 + .../test_fsunnonlinsol_fixedpoint_mod.f90 | 155 +++++++++++------- examples/sunnonlinsol/newton/CMakeLists.txt | 3 + include/cvodes/cvodes.h | 3 +- src/nvector/serial/fmod_int32/CMakeLists.txt | 1 - .../imexgus/fmod_int32/CMakeLists.txt | 1 - .../imexgus/fmod_int64/CMakeLists.txt | 1 - .../soderlind/fmod_int32/CMakeLists.txt | 1 - .../soderlind/fmod_int64/CMakeLists.txt | 1 - src/sundials/CMakeLists.txt | 10 +- src/sundials/fmod_int32/CMakeLists.txt | 2 - src/sundials/fmod_int32/fsundials_core_mod.c | 7 - .../fmod_int32/fsundials_core_mod.f90 | 9 +- src/sundials/fmod_int64/CMakeLists.txt | 2 - src/sundials/fmod_int64/fsundials_core_mod.c | 7 - .../fmod_int64/fsundials_core_mod.f90 | 9 +- src/sundials/sundials_nvector.c | 8 +- src/sunlinsol/band/fmod_int32/CMakeLists.txt | 5 +- src/sunlinsol/dense/fmod_int32/CMakeLists.txt | 5 +- src/sunlinsol/klu/fmod_int64/CMakeLists.txt | 5 +- .../lapackdense/fmod_int32/CMakeLists.txt | 5 +- src/sunlinsol/pcg/fmod_int32/CMakeLists.txt | 1 - .../spbcgs/fmod_int32/CMakeLists.txt | 1 - .../spfgmr/fmod_int64/CMakeLists.txt | 1 - src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt | 1 - .../sptfqmr/fmod_int64/CMakeLists.txt | 1 - src/sunmatrix/band/fmod_int32/CMakeLists.txt | 1 - src/sunmatrix/dense/fmod_int64/CMakeLists.txt | 1 - .../sparse/fmod_int32/CMakeLists.txt | 1 - .../fixedpoint/fmod_int64/CMakeLists.txt | 1 - .../newton/fmod_int32/CMakeLists.txt | 1 - swig/Makefile | 28 ++-- swig/sundials/fsundials_types.i | 10 +- 109 files changed, 534 insertions(+), 421 deletions(-) create mode 100644 .github/workflows/windows-latest-intel.yml diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml new file mode 100644 index 0000000000..88b263c6b9 --- /dev/null +++ b/.github/workflows/windows-latest-intel.yml @@ -0,0 +1,50 @@ +name: Build and Test - Windows/intel/ninja (short) + +on: + pull_request: + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build_and_test: + runs-on: windows-latest + + steps: + - uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2023.2' + + - name: Install Ninja + run: choco install ninja + + - uses: actions/checkout@v3 + + - name: Configure CMake (Static) + run: cmake -G "Ninja" -B ${{github.workspace}}/build_static -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_UNITTESTS=OFF -DEXAMPLES_ENABLE_CXX=ON + + - name: Build (Static) + run: cmake --build ${{github.workspace}}/build_static --verbose + + - name: Test (Static) + working-directory: ${{github.workspace}}/build_static + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + + - name: Configure CMake (Shared) + run: cmake -G "Ninja" -B ${{github.workspace}}/build_shared -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_UNITTESTS=OFF -DEXAMPLES_ENABLE_CXX=ON + + - name: Build (Shared) + run: cmake --build ${{github.workspace}}/build_shared --verbose + + - name: Test (Shared) + working-directory: ${{github.workspace}}/build_shared + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 49974e4e30..5a714b5133 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -10,7 +10,6 @@ concurrency: cancel-in-progress: true env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: @@ -42,27 +41,59 @@ jobs: install: >- base-devel ${{ matrix.target-prefix }}-cmake - ${{ matrix.target-prefix }}-cc + ${{ matrix.target-prefix }}-gcc + ${{ matrix.target-prefix }}-gcc-fortran ${{ matrix.target-prefix }}-openblas ${{ matrix.target-prefix }}-suitesparse - - name: Configure CMake + - name: Configure CMake (Static) # Configure CMake in a 'build' subdirectory run: | cmake \ - -B ${GITHUB_WORKSPACE}/build \ + -G "MSYS Makefiles" \ + -B ${GITHUB_WORKSPACE}/build_static \ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_C_FLAGS=-Wno-deprecated-declarations \ + -DBUILD_FORTRAN_MODULE_INTERFACE=ON \ + -DBUILD_SHARED_LIBS=OFF \ -DSUNDIALS_BUILD_WITH_PROFILING=ON \ -DSUNDIALS_LOGGING_LEVEL=2 \ -DSUNDIALS_TEST_UNITTESTS=OFF \ -DEXAMPLES_ENABLE_CXX=ON \ -DENABLE_KLU=ON - - name: Build + - name: Build (Static) # Build program - run: cmake --build ${GITHUB_WORKSPACE}/build + run: cmake --build ${GITHUB_WORKSPACE}/build_static --verbose - - name: Test - working-directory: ${{github.workspace}}/build + - name: Test (Static) + working-directory: ${{github.workspace}}/build_static # Execute tests - run: ctest + run: ctest --output-on-failure + + # TODO(CJB): shared libraries with the fortran interfaces turned on + # fail to link correctly with this toolchain see https://github.com/LLNL/sundials/issues/507. + - name: Configure CMake (Shared) + # Configure CMake in a 'build' subdirectory + run: | + cmake \ + -G "MSYS Makefiles" \ + -B ${GITHUB_WORKSPACE}/build_shared \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_C_FLAGS=-Wno-deprecated-declarations \ + -DBUILD_FORTRAN_MODULE_INTERFACE=OFF \ + -DBUILD_STATIC_LIBS=OFF \ + -DSUNDIALS_BUILD_WITH_PROFILING=ON \ + -DSUNDIALS_LOGGING_LEVEL=2 \ + -DSUNDIALS_TEST_UNITTESTS=OFF \ + -DEXAMPLES_ENABLE_CXX=ON \ + -DENABLE_KLU=ON + + - name: Build (Shared) + # Build program + run: cmake --build ${GITHUB_WORKSPACE}/build_shared --verbose + + - name: Test (Shared) + working-directory: ${{github.workspace}}/build_shared + # Execute tests + run: ctest --output-on-failure diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index ccfa6c2251..aa45f757c0 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -10,7 +10,6 @@ concurrency: cancel-in-progress: true env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: @@ -21,16 +20,11 @@ jobs: - 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}} -DBUILD_STATIC_LIBS=OFF -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_LOGGING_LEVEL=2 -DSUNDIALS_TEST_UNITTESTS=ON -DEXAMPLES_ENABLE_CXX=ON + run: cmake -G "Visual Studio 17 2022" -B ${{github.workspace}}/build -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_UNITTESTS=ON -DEXAMPLES_ENABLE_CXX=ON - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --verbose - 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}} + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure diff --git a/CHANGELOG.md b/CHANGELOG.md index d85d47def6..3b94e65798 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,8 @@ Fix bug on LLP64 platforms (like Windows 64-bit) where `KLU_INDEXTYPE` could be Check if size of `SuiteSparse_long` is 8 if the size of `sunindextype` is 8 when using KLU. +Fixed several build errors with the Fortran interfaces on Windows systems. + ### Deprecation Notices Numerous ARKODE stepper-specific functions are now deprecated in favor of diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index a9a3df9ea0..b78212e720 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -119,7 +119,7 @@ sundials_option(BUILD_SHARED_LIBS BOOL "Build shared libraries" ON) # Make sure we build at least one type of libraries if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS) - print_error("Both static and shared library generation were disabled.") + message(FATAL_ERROR "Both static and shared library generation were disabled.") endif() # --------------------------------------------------------------- diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index 2e6e8c4de0..1daee0b7b2 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -19,25 +19,6 @@ # Fortran 2003 standard # --------------------------------------------------------------- -# If the Fortran compiler flags are set using environemnt variables (i.e., -# CMAKE_Fortran_FLAGS is not set), then check if both FFLAGS and FCFLAGS are -# set. If both are set and not the same then a fatal error occurs. -# -# NOTE: This check must occur before 'enable_language(Fortran)' as it will use -# the value of FFLAGS to set CMAKE_Fortran_FLAGS -set(ENV_FFLAGS "$ENV{FFLAGS}") -set(ENV_FCFLAGS "$ENV{FCFLAGS}") - -# check if environment variables are used and CMAKE_Fortran_FLAGS is not -if ((NOT "${ENV_FFLAGS}" STREQUAL "") AND (NOT "${ENV_FCFLAGS}" STREQUAL "") - AND ("${CMAKE_Fortran_FLAGS}" STREQUAL "")) - - # check if environment variables are equal - if (NOT "${ENV_FFLAGS}" STREQUAL "${ENV_FCFLAGS}") - print_error("FFLAGS='${ENV_FFLAGS}' and FCFLAGS='${ENV_FCFLAGS}' are both set but are not equal.") - endif() -endif() - # ----------------------------------------------------------------------------- # Enable Fortran # ----------------------------------------------------------------------------- diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index d8be54aac8..199f790e66 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -150,7 +150,7 @@ macro(sundials_add_library target) # -------------------------------------------------------------------------- # create the target for the object library - add_library(${obj_target} OBJECT ${sources}) + add_library(${obj_target} OBJECT ${sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) set_target_properties(${obj_target} PROPERTIES FOLDER "obj") @@ -173,6 +173,19 @@ macro(sundials_add_library target) else() set(_all_libs ${sundials_add_library_LINK_LIBRARIES}) endif() + # Due to various issues in CMake, particularly https://gitlab.kitware.com/cmake/cmake/-/issues/25365, + # we create a fake custom target to enforce a build order. Without this, parallel builds + # might fail with an error about a missing '.mod' file when Fortran is enabled (see GitHub #410). + set(_stripped_all_libs ${_all_libs}) + list(FILTER _stripped_all_libs EXCLUDE REGEX "PUBLIC|INTERFACE|PRIVATE") + foreach(_item ${_stripped_all_libs}) + if(NOT TARGET ${_item}) + list(REMOVE_ITEM _stripped_all_libs ${_item}) + endif() + endforeach() + add_custom_target(fake_to_force_build_order_${obj_target}) + add_dependencies(fake_to_force_build_order_${obj_target} ${_stripped_all_libs}) + add_dependencies(${obj_target} fake_to_force_build_order_${obj_target}) target_link_libraries(${obj_target} ${_all_libs}) endif() @@ -239,11 +252,7 @@ macro(sundials_add_library target) # set target name set(_actual_target_name ${target}${_lib_suffix}) - add_library(${_actual_target_name} ${_libtype} $<TARGET_OBJECTS:${obj_target}>) - - set_target_properties(${_actual_target_name} PROPERTIES FOLDER "src") - - # add any object library dependencies + set(_object_sources $<TARGET_OBJECTS:${obj_target}>) if(sundials_add_library_OBJECT_LIBRARIES) if(${_libtype} MATCHES "STATIC") append_static_suffix(sundials_add_library_OBJECT_LIBRARIES _all_objs) @@ -251,13 +260,14 @@ macro(sundials_add_library target) set(_all_objs ${sundials_add_library_OBJECT_LIBRARIES}) endif() foreach(_tmp ${_all_objs}) - # We use target_sources since target_link_libraries does not work - # as expected with CMake 3.12 (see CMake issues 18090 and 18692). - # TODO(DJG): Update whenever we require CMake 3.14 or newer - target_sources(${_actual_target_name} PRIVATE $<TARGET_OBJECTS:${_tmp}>) + list(APPEND _object_sources $<TARGET_OBJECTS:${_tmp}>) endforeach() endif() + add_library(${_actual_target_name} ${_libtype} ${_object_sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) + + set_target_properties(${_actual_target_name} PROPERTIES FOLDER "src") + # add all link libraries if(SUNDIALS_MATH_LIBRARY) target_link_libraries(${_actual_target_name} PRIVATE "${SUNDIALS_MATH_LIBRARY}") @@ -426,34 +436,41 @@ macro(sundials_add_f2003_library target) cmake_parse_arguments(sundials_add_f2003_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - # set target properties and target dependencies so that includes - # and links get passed on when this target is used if(CMAKE_Fortran_MODULE_DIRECTORY) set(_includes PUBLIC $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}> ) - set(_properties PROPERTIES Fortran_MODULE_DIRECTORY "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}") + set(_properties PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}" + WINDOWS_EXPORT_ALL_SYMBOLS ON) else() set(_includes PUBLIC $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}> ) - set(_properties PROPERTIES Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir") + set(_properties PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir" + WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() # get the name of the C library which the fortran library interfaces to string(REPLACE "sundials_f" "sundials_" _clib_name "${target}") string(REPLACE "_mod" "" _clib_name "${_clib_name}") + if(TARGET ${_clib_name}) + set(_clib_target ${_clib_name}) + else() + set(_clib_target ) + endif() sundials_add_library(${target} SOURCES ${sundials_add_f2003_library_SOURCES} OBJECT_LIBRARIES ${sundials_add_f2003_library_OBJECT_LIBRARIES} LINK_LIBRARIES + PUBLIC ${_clib_target} # depend on the c library ${sundials_add_f2003_library_LINK_LIBRARIES} - PUBLIC ${_clib_name} # depend on the c library INCLUDE_DIRECTORIES ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} ${_includes} @@ -466,7 +483,6 @@ macro(sundials_add_f2003_library target) SOVERSION ${sundials_add_f2003_library_SOVERSION} ${sundials_add_f2003_library_UNPARSED_ARGUMENTS} ) - endmacro() diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ef32fa2bbb..adc2691e7b 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -116,6 +116,8 @@ Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could b Check if size of ``SuiteSparse_long`` is 8 if the size of ``sunindextype`` is 8 when using KLU. +Fixed several build errors with the Fortran interfaces on Windows systems. + **Deprecation Notices** Numerous ARKODE stepper-specific functions are now deprecated in favor of diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index cb483b2733..fbb6fdc0c4 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -557,8 +557,7 @@ Important notes on portability ------------------------------ The SUNDIALS Fortran 2003 interface *should* be compatible with any compiler -supporting the Fortran 2003 ISO standard. However, it has only been tested and -confirmed to be working with GNU Fortran 4.9+ and Intel Fortran 18.0.1+. +supporting the Fortran 2003 ISO standard. Upon compilation of SUNDIALS, Fortran module (``.mod``) files are generated for each Fortran 2003 interface. These files are highly compiler specific, and thus diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index f1ed3c80a8..b11ecd9621 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -294,8 +294,8 @@ default configuration: .. _Installation.CMake.Options: -Configuration options (Unix/Linux) ------------------------------------ +Configuration options +--------------------- A complete list of all available options for a CMake-based SUNDIALS configuration is provide below. Note that the default values shown @@ -590,6 +590,11 @@ illustration only. Default: ``OFF`` + .. warning:: There is a known issue with MSYS/gfortran and SUNDIALS shared libraries + that causes linking the Fortran interfaces to fail when buidling SUNDIALS. For + now the work around is to only build with static libraries when using MSYS with + gfortran on Windows. + .. cmakeoption:: SUNDIALS_LOGGING_LEVEL Set the maximum logging level for the SUNLogger runtime API. The higher this is set, @@ -669,7 +674,7 @@ illustration only. Default: "REF;OMP" - .. versionchanged: x.y.z + .. versionchanged: x.y.z The ``DPCPP`` option was changed to ``SYCL`` to align with Ginkgo's naming convention. @@ -1704,7 +1709,7 @@ header files. without any notice and relying on them may break your code. -Using SUNDIALS in your prpject +Using SUNDIALS in your project ------------------------------ After building and installing SUNDIALS, using SUNDIALS in your application involves diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a342a109eb..55b1e52db4 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -17,9 +17,9 @@ # We need this to ensure the installed templates have MPI when ENABLE_MPI=TRUE, # at least until we convert all of the templates to use the SUNDIALS CMake target. -# =============================================================== +# =================================================================== # Configure compilers for installed examples -# =============================================================== +# =================================================================== foreach(lang ${_SUNDIALS_ENABLED_LANGS}) if(ENABLE_MPI) @@ -37,7 +37,13 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") endif() +# Initialize CMAKE_Fortran_MODULE_DIRECTORY for examples +set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + +# =================================================================== # Set variables used in generating CMake and Makefiles for examples +# =================================================================== + if(EXAMPLES_INSTALL) set(SHELL "sh") @@ -95,9 +101,9 @@ if(EXAMPLES_INSTALL) endif() -#---------------------------------------- +# =================================================================== # Add specific examples -#---------------------------------------- +# =================================================================== # Add ARKode examples if(BUILD_ARKODE) diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 7aac6173a6..98abe2d887 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -56,7 +56,7 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) - # Install fortran modules to a unique directory to avoid naming collisions + # build fortran modules into a unique directory to avoid naming collisions set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index 4a0a8a5911..83e9ac1fbf 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 @@ -39,7 +39,7 @@ module ode_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: neq = 1 + integer(c_int64_t), parameter :: neq = 1 integer(c_int), parameter :: Nt = 10 complex(c_double_complex), parameter :: lambda = (-1d-2, 10.d0) real(c_double), parameter :: T0 = 0.d0 diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 index 579d70479c..c195ce2d12 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -51,10 +51,10 @@ module ode_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: N = 201 ! number of intervals + integer(c_int64_t), parameter :: N = 201 ! number of intervals integer(c_long), parameter :: Nt = 100 ! total number of output times - integer(c_long), parameter :: Nvar = 3 ! number of solution fields - integer(c_long), parameter :: neq = N*Nvar ! total size of solution vector + integer(c_int64_t), parameter :: Nvar = 3 ! number of solution fields + integer(c_int64_t), parameter :: neq = N*Nvar ! total size of solution vector real(c_double), parameter :: dx = 1.d0/(N-1) ! mesh spacing real(c_double), parameter :: a = 0.6d0 ! constant forcing on u real(c_double), parameter :: b = 2.d0 ! steady-state value of w @@ -97,7 +97,7 @@ integer(c_int) function RhsImplicit(tn, sunvec_y, sunvec_f, user_data) & ! local variables type(FVec), pointer :: y, f ! ptrs to Fortran vector data real(c_double) :: u, v, w - integer(c_long) :: i + integer(c_int64_t) :: i !======= Internals ============ @@ -161,7 +161,7 @@ integer(c_int) function RhsExplicit(tn, sunvec_y, sunvec_f, user_data) & ! local variables type(FVec), pointer :: y, f ! ptrs to Fortran vector data real(c_double) :: dconst(3) - integer(c_long) :: i, j + integer(c_int64_t) :: i, j !======= Internals ============ @@ -221,7 +221,7 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & type(FVec), pointer :: y, f ! ptrs to Fortran vector data type(FMat), pointer :: J ! ptr to Fortran matrix data real(c_double) :: u, v, w - integer(c_long) :: i + integer(c_int64_t) :: i !======= Internals ============ diff --git a/examples/arkode/F2003_custom/fnvector_complex_mod.f90 b/examples/arkode/F2003_custom/fnvector_complex_mod.f90 index 5a4ce4548a..e762a3858d 100644 --- a/examples/arkode/F2003_custom/fnvector_complex_mod.f90 +++ b/examples/arkode/F2003_custom/fnvector_complex_mod.f90 @@ -24,7 +24,7 @@ module fnvector_complex_mod ! ---------------------------------------------------------------- type, public :: FVec logical :: own_data - integer(c_long) :: len + integer(c_int64_t) :: len complex(c_double_complex), pointer :: data(:) end type FVec ! ---------------------------------------------------------------- @@ -35,7 +35,7 @@ module fnvector_complex_mod function FN_VNew_Complex(n, sunctx) result(sunvec_y) implicit none - integer(c_long), value :: n + integer(c_int64_t), value :: n type(c_ptr), value :: sunctx type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops @@ -88,7 +88,7 @@ end function FN_VNew_Complex function FN_VMake_Complex(n, data, sunctx) result(sunvec_y) implicit none - integer(c_long), value :: n + integer(c_int64_t), value :: n type(c_ptr), value :: sunctx type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops @@ -191,7 +191,7 @@ subroutine FN_VDestroy_Complex(sunvec_y) bind(C) end subroutine FN_VDestroy_Complex ! ---------------------------------------------------------------- - integer(c_long) function FN_VGetLength_Complex(sunvec_y) & + integer(c_int64_t) function FN_VGetLength_Complex(sunvec_y) & bind(C) result(length) implicit none @@ -456,7 +456,7 @@ real(c_double) function FN_VWSqrSumMask_Complex(sunvec_x, sunvec_w, sunvec_id) & type(N_Vector) :: sunvec_w type(N_Vector) :: sunvec_id type(FVec), pointer :: x, w, id - integer(c_long) :: i + integer(c_int64_t) :: i ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -571,7 +571,7 @@ integer(c_int) function FN_VInvTest_Complex(sunvec_x, sunvec_z) & type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z type(FVec), pointer :: x, z - integer(c_long) :: i + integer(c_int64_t) :: i ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) diff --git a/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 b/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 index 1f4b2851bc..3264f75a5d 100644 --- a/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 @@ -25,8 +25,8 @@ module fnvector_fortran_mod ! ---------------------------------------------------------------- type, public :: FVec logical :: own_data - integer(c_long) :: length1 - integer(c_long) :: length2 + integer(c_int64_t) :: length1 + integer(c_int64_t) :: length2 real(c_double), pointer :: data(:,:) end type FVec ! ---------------------------------------------------------------- @@ -36,8 +36,8 @@ module fnvector_fortran_mod ! ---------------------------------------------------------------- function FN_VNew_Fortran(n1, n2, sunctx) result(sunvec_y) implicit none - integer(c_long), value :: n1 - integer(c_long), value :: n2 + integer(c_int64_t), value :: n1 + integer(c_int64_t), value :: n2 type(c_ptr), value :: sunctx type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops @@ -97,8 +97,8 @@ end function FN_VNew_Fortran ! ---------------------------------------------------------------- function FN_VMake_Fortran(n1, n2, data, sunctx) result(sunvec_y) implicit none - integer(c_long), value :: n1 - integer(c_long), value :: n2 + integer(c_int64_t), value :: n1 + integer(c_int64_t), value :: n2 type(c_ptr), value :: sunctx type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops @@ -206,7 +206,7 @@ subroutine FN_VDestroy_Fortran(sunvec_y) bind(C) end subroutine FN_VDestroy_Fortran ! ---------------------------------------------------------------- - integer(c_long) function FN_VGetLength_Fortran(sunvec_y) & + integer(c_int64_t) function FN_VGetLength_Fortran(sunvec_y) & bind(C) result(length) implicit none @@ -480,7 +480,7 @@ real(c_double) function FN_VWSqrSumMask_Fortran(sunvec_x, sunvec_w, sunvec_id) & type(N_Vector) :: sunvec_w type(N_Vector) :: sunvec_id type(FVec), pointer :: x, w, id - integer(c_long) :: i, j + integer(c_int64_t) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -596,7 +596,7 @@ subroutine FN_VCompare_Fortran(c, sunvec_x, sunvec_z) bind(C) type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z type(FVec), pointer :: x, z - integer(c_long) :: i, j + integer(c_int64_t) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -624,7 +624,7 @@ integer(c_int) function FN_VInvTest_Fortran(sunvec_x, sunvec_z) & type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z type(FVec), pointer :: x, z - integer(c_long) :: i, j + integer(c_int64_t) :: i, j ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -654,7 +654,7 @@ integer(c_int) function FN_VConstrMask_Fortran(sunvec_c, sunvec_x, sunvec_m) & type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_m type(FVec), pointer :: c, x, m - integer(c_long) :: i, j + integer(c_int64_t) :: i, j logical :: test ! extract Fortran vector structures to work with @@ -692,7 +692,7 @@ real(c_double) function FN_VMinQuotient_Fortran(sunvec_n, sunvec_d) & type(N_Vector) :: sunvec_n type(N_Vector) :: sunvec_d type(FVec), pointer :: n, d - integer(c_long) :: i, j + integer(c_int64_t) :: i, j logical :: notEvenOnce ! extract Fortran vector structures to work with diff --git a/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 b/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 index 6939fa2795..9da06d3ea9 100644 --- a/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 @@ -30,9 +30,9 @@ module fsunlinsol_fortran_mod ! ---------------------------------------------------------------- type, public :: FLinSol - integer(c_long) :: Nvar - integer(c_long) :: N - integer(c_long), allocatable :: pivots(:,:) + integer(c_int64_t) :: Nvar + integer(c_int64_t) :: N + integer(c_int64_t), allocatable :: pivots(:,:) end type FLinSol ! ---------------------------------------------------------------- @@ -42,8 +42,8 @@ module fsunlinsol_fortran_mod function FSUNLinSolNew_Fortran(Nvar, N, sunctx) result(sunls_S) implicit none - integer(c_long), value :: Nvar - integer(c_long), value :: N + integer(c_int64_t), value :: Nvar + integer(c_int64_t), value :: N type(c_ptr), value :: sunctx type(SUNLinearSolver), pointer :: sunls_S type(SUNLinearSolver_Ops), pointer :: ops @@ -135,7 +135,7 @@ integer(c_int) function FSUNLinSolSetup_Fortran(sunls_S, sunmat_A) & type(SUNMatrix) :: sunmat_A type(FLinSol), pointer :: S type(FMat), pointer :: AMat - integer(c_long) :: i, j, k, l + integer(c_int64_t) :: i, j, k, l real(c_double) :: temp real(c_double), pointer :: A(:,:) @@ -214,7 +214,7 @@ integer(c_int) function FSUNLinSolSolve_Fortran(sunls_S, sunmat_A, & type(FLinSol), pointer :: S type(FMat), pointer :: AMat type(FVec), pointer :: xvec, bvec - integer(c_long) :: i, k, pk + integer(c_int64_t) :: i, k, pk real(c_double) :: temp real(c_double), pointer :: A(:,:), x(:) diff --git a/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 b/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 index 88dfd5710d..7d6b397e99 100644 --- a/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 @@ -30,8 +30,8 @@ module fsunmatrix_fortran_mod ! ---------------------------------------------------------------- type, public :: FMat logical :: own_data - integer(c_long) :: Nvar - integer(c_long) :: N + integer(c_int64_t) :: Nvar + integer(c_int64_t) :: N real(c_double), pointer :: data(:,:,:) end type FMat ! ---------------------------------------------------------------- @@ -42,8 +42,8 @@ module fsunmatrix_fortran_mod function FSUNMatNew_Fortran(Nvar, N, sunctx) result(sunmat_A) implicit none - integer(c_long), value :: Nvar - integer(c_long), value :: N + integer(c_int64_t), value :: Nvar + integer(c_int64_t), value :: N type(c_ptr), value :: sunctx type(SUNMatrix), pointer :: sunmat_A type(SUNMatrix_Ops), pointer :: ops @@ -236,7 +236,7 @@ integer(c_int) function FSUNMatScaleAddI_Fortran(c, sunmat_A) & real(c_double), value :: c type(SUNMatrix) :: sunmat_A type(FMat), pointer :: A - integer(c_long) :: i, j, k + integer(c_int64_t) :: i, j, k ! extract Fortran matrix structure to work with A => FSUNMatGetFMat(sunmat_A) @@ -267,7 +267,7 @@ integer(c_int) function FSUNMatMatvec_Fortran(sunmat_A, sunvec_x, sunvec_y) & type(N_Vector) :: sunvec_y type(FMat), pointer :: A type(FVec), pointer :: x, y - integer(c_long) :: i + integer(c_int64_t) :: i ! extract Fortran matrix and vector structures to work with A => FSUNMatGetFMat(sunmat_A) diff --git a/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 b/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 index 28c5bb0410..b9cec621a6 100644 --- a/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 @@ -29,10 +29,10 @@ integer(c_int) function check_ans(val, tol, N, sunvec_x) result(failure) implicit none complex(c_double_complex), value :: val real(c_double), value :: tol - integer(c_long), value :: N + integer(c_int64_t), value :: N Type(N_Vector) :: sunvec_x Type(FVec), pointer :: x - integer(c_long) :: i + integer(c_int64_t) :: i x => FN_VGetFVec(sunvec_x) failure = 0 @@ -58,7 +58,7 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, i, loc - integer(c_long), parameter :: N = 1000 + integer(c_int64_t), parameter :: N = 1000 type(N_Vector), pointer :: sU, sV, sW, sX, sY, sZ type(FVec), pointer :: U, V, W, X, Y, Z complex(c_double_complex) :: Udata(N) diff --git a/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 index 148f95212b..ac6e69c9d6 100644 --- a/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 @@ -28,10 +28,10 @@ integer(c_int) function check_ans(val, tol, Nvar, N, sunvec_x) result(failure) implicit none real(c_double), value :: val, tol - integer(c_long), value :: Nvar, N + integer(c_int64_t), value :: Nvar, N Type(N_Vector) :: sunvec_x Type(FVec), pointer :: x - integer(c_long) :: i, j + integer(c_int64_t) :: i, j x => FN_VGetFVec(sunvec_x) failure = 0 @@ -59,9 +59,9 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails - integer(c_long) :: i, j, loc - integer(c_long), parameter :: N = 1000 - integer(c_long), parameter :: Nvar = 10 + integer(c_int64_t) :: i, j, loc + integer(c_int64_t), parameter :: N = 1000 + integer(c_int64_t), parameter :: Nvar = 10 type(N_Vector), pointer :: sU, sV, sW, sX, sY, sZ type(FVec), pointer :: U, V, W, X, Y, Z real(c_double), allocatable :: Udata(:,:) diff --git a/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 index 508a1c74a3..15752897ce 100644 --- a/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 @@ -31,10 +31,10 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_long), value :: Nvar, N + integer(c_int64_t), value :: Nvar, N Type(N_Vector) :: sunvec_x, sunvec_y Type(FVec), pointer :: x, y - integer(c_long) :: i, j + integer(c_int64_t) :: i, j x => FN_VGetFVec(sunvec_x) y => FN_VGetFVec(sunvec_y) @@ -82,8 +82,8 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, retval, j, k - integer(c_long), parameter :: N = 1000 - integer(c_long), parameter :: Nvar = 50 + integer(c_int64_t), parameter :: N = 1000 + integer(c_int64_t), parameter :: Nvar = 50 type(SUNMatrix), pointer :: sA type(FMat), pointer :: A type(SUNLinearSolver), pointer :: LS diff --git a/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 index 740db810e1..da5fe15966 100644 --- a/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 @@ -30,10 +30,10 @@ integer(c_int) function check_matrix(sunmat_A, sunmat_B, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_long), value :: Nvar, N + integer(c_int64_t), value :: Nvar, N Type(SUNMatrix) :: sunmat_A, sunmat_B Type(FMat), pointer :: A, B - integer(c_long) :: i, j, k + integer(c_int64_t) :: i, j, k A => FSUNMatGetFMat(sunmat_A) B => FSUNMatGetFMat(sunmat_B) @@ -53,10 +53,10 @@ integer(c_int) function check_matrix_entry(sunmat_A, val, tol, Nvar, N) result(f implicit none real(c_double), value :: tol, val - integer(c_long), value :: Nvar, N + integer(c_int64_t), value :: Nvar, N Type(SUNMatrix) :: sunmat_A Type(FMat), pointer :: A - integer(c_long) :: i, j, k + integer(c_int64_t) :: i, j, k A => FSUNMatGetFMat(sunmat_A) failure = 0 @@ -75,10 +75,10 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa implicit none real(c_double), value :: tol - integer(c_long), value :: Nvar, N + integer(c_int64_t), value :: Nvar, N Type(N_Vector) :: sunvec_x, sunvec_y Type(FVec), pointer :: x, y - integer(c_long) :: i, j + integer(c_int64_t) :: i, j x => FN_VGetFVec(sunvec_x) y => FN_VGetFVec(sunvec_y) @@ -127,8 +127,8 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, retval, i, j, k - integer(c_long), parameter :: N = 1000 - integer(c_long), parameter :: Nvar = 50 + integer(c_int64_t), parameter :: N = 1000 + integer(c_int64_t), parameter :: Nvar = 50 type(SUNMatrix), pointer :: sA, sB, sC, sD, sI type(FMat), pointer :: A, Eye type(N_Vector), pointer :: sW, sX, sY, sZ diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 index 7cf6efd0f9..c7b25afe86 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -53,8 +53,8 @@ module DiagkryData ! Problem parameters integer(c_int), parameter :: iGStype = 1 integer(c_int), parameter :: iPretype0 = 1 - integer(c_long), parameter :: nlocal = 10 - integer(c_long) :: neq, mu, ml, mudq, mldq + integer(c_int64_t), parameter :: nlocal = 10 + integer(c_int64_t) :: neq, mu, ml, mudq, mldq integer(c_int) :: iPretype real(c_double) :: alpha @@ -118,7 +118,7 @@ integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & ! calling variables real(c_double), value :: t ! current time - integer(c_long) :: nnlocal ! local space + integer(c_int64_t) :: nnlocal ! local space type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_g ! output g N_Vector type(c_ptr), value :: user_data ! user-defined data diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 index edfcf0d3b5..e05da275b0 100644 --- a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -46,8 +46,8 @@ module DiagnonData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_long), parameter :: nlocal = 2 - integer(c_long) :: neq + integer(c_int64_t), parameter :: nlocal = 2 + integer(c_int64_t) :: neq real(c_double) :: alpha contains diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index a58e0ad2d8..e8c53d66cd 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -671,7 +671,7 @@ program driver type(SUNLinearSolver), pointer :: sun_LS ! linear solver type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(c_ptr) :: arkode_mem ! ARKODE memory - integer(c_long) :: N, Ntot + integer(c_int64_t) :: N, Ntot integer(c_int) :: retval integer :: ierr logical :: outproc diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index 2268891857..f755a4695b 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -73,6 +73,9 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 2 example_type) if (NOT TARGET ${example}) + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90) @@ -81,9 +84,6 @@ foreach(example_tuple ${FARKODE_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - - # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) endif() # check if example args are provided and set the test name @@ -125,11 +125,12 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) - # example source files - add_executable(${example} ${example}.f90) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # create the cmake executable target + add_executable(${example} ${example}.f90) set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # add example to regression tests sundials_add_test(${example} ${example} @@ -140,7 +141,7 @@ if(BUILD_SUNLINSOL_KLU) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLKLU_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) @@ -168,6 +169,9 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90) diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 index f272a56644..80908e0127 100644 --- a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -71,12 +71,12 @@ module Bruss1DFEMKLU_UserData implicit none ! number of equations - integer(c_int), parameter :: neqreal = 3 + integer(c_int64_t), parameter :: neqreal = 3 ! ODE parameters - integer(c_int), parameter :: N = 201 ! number of intervals - integer(c_int), parameter :: neq = neqreal*N ! set overall problem size - integer(c_int), parameter :: nnz = 15*neq + integer(c_int64_t), parameter :: N = 201 ! number of intervals + integer(c_int64_t), parameter :: neq = neqreal*N ! set overall problem size + integer(c_int64_t), parameter :: nnz = 15*neq real(c_double), parameter :: a = 0.6d0 ! constant forcing on u real(c_double), parameter :: b = 2.d0 ! steady-state value of w real(c_double), parameter :: du = 2.5d-2 ! diffusion coeff for u @@ -89,8 +89,9 @@ module Bruss1DFEMKLU_UserData ! function that maps 2D data into 1D address space ! (0-based since CSR matrix will be sent to C solver) - integer(c_int) function idx(ix, ivar) - integer(c_int) :: ivar, ix + integer(c_int64_t) function idx(ix, ivar) + integer(c_int64_t):: ix + integer(c_int) :: ivar idx = neqreal*(ix - 1) + ivar - 1 end function idx @@ -210,7 +211,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & type(c_ptr), value :: user_data ! user-defined data ! Local data - integer(c_int) :: ix + integer(c_int64_t) :: ix logical :: left, right real(c_double) :: ul, ur, vl, vr, wl, wr, xl, xr, u, v, w, f1, f2, f3 @@ -413,7 +414,7 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & type(N_Vector) :: sunvec_t3 ! Local data - integer(c_int) :: ix, nz, Nint + integer(c_int64_t) :: ix, nz, Nint real(c_double) :: ul, uc, ur, vl, vc, vr, wl, wc, wr, xl, xc, xr real(c_double) :: u1, u2, u3, v1, v2, v3, w1, w2, w3 real(c_double) :: df1, df2, df3, dQdf1, dQdf2, dQdf3 @@ -421,8 +422,8 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & real(c_double), dimension(3,-1:1) :: Ju, Jv, Jw ! pointers to data in SUNDIALS vectors - integer(c_long), pointer, dimension(nnz) :: Jcolvals(:) - integer(c_long), pointer, dimension(neq+1) :: Jrowptrs(:) + integer(c_int64_t), pointer, dimension(nnz) :: Jcolvals(:) + integer(c_int64_t), pointer, dimension(neq+1) :: Jrowptrs(:) real(c_double), pointer, dimension(nnz) :: Jdata(:) real(c_double), pointer, dimension(neqreal,N) :: yvec(:,:) real(c_double), pointer, dimension(neqreal,N) :: fvec(:,:) @@ -451,9 +452,9 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & nz = 0 ! Dirichlet boundary at left - Jrowptrs(idx(1,1)+1) = nz - Jrowptrs(idx(1,2)+1) = nz - Jrowptrs(idx(1,3)+1) = nz + Jrowptrs(idx(1_c_int64_t,1)+1) = nz + Jrowptrs(idx(1_c_int64_t,2)+1) = nz + Jrowptrs(idx(1_c_int64_t,3)+1) = nz ! iterate through nodes, filling in matrix by rows do ix=2,N-1 @@ -868,13 +869,13 @@ integer(c_int) function Mass(tn, sunmat_M, user_data, & type(N_Vector) :: sunvec_t3 ! Local data - integer(c_int) :: ix, nz, Nint + integer(c_int64_t) :: ix, nz, Nint real(c_double) :: xl, xc, xr, Ml, Mc, Mr, ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3 logical :: left, right ! pointers to data in SUNDIALS vectors - integer(c_long), pointer, dimension(nnz) :: Mcolvals(:) - integer(c_long), pointer, dimension(neq+1) :: Mrowptrs(:) + integer(c_int64_t), pointer, dimension(nnz) :: Mcolvals(:) + integer(c_int64_t), pointer, dimension(neq+1) :: Mrowptrs(:) real(c_double), pointer, dimension(nnz) :: Mdata(:) !======= Internals ============ @@ -1050,7 +1051,7 @@ program main integer(c_int) :: outstep ! output loop counter integer(c_int) :: sparsetype ! CSR signal, here integer(c_long) :: mxsteps ! max num steps - integer :: i + integer(c_int64_t) :: i type(N_Vector), pointer :: sunvec_y ! sundials vector type(N_Vector), pointer :: sunvec_u ! sundials vector @@ -1081,28 +1082,28 @@ program main nout = ceiling(tend/dtout) ! create and assign SUNDIALS N_Vectors - sunvec_y => FN_VNew_Serial(int(neq,c_long), ctx) + sunvec_y => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_y)) then print *, 'ERROR: sunvec = NULL' stop 1 end if yvec(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_y) - sunvec_u => FN_VNew_Serial(int(neq,c_long), ctx) + sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then print *, 'ERROR: sunvec = NULL' stop 1 end if umask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_u) - sunvec_v => FN_VNew_Serial(int(neq,c_long), ctx) + sunvec_v => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_v)) then print *, 'ERROR: sunvec = NULL' stop 1 end if vmask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_v) - sunvec_w => FN_VNew_Serial(int(neq,c_long), ctx) + sunvec_w => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_w)) then print *, 'ERROR: sunvec = NULL' stop 1 @@ -1148,13 +1149,13 @@ program main ! Tell ARKODE to use a sparse linear solver for both Newton and mass matrix systems. sparsetype = 1 - sunmat_A => FSUNSparseMatrix(int(neq,c_long), int(neq,c_long), int(nnz,c_long), sparsetype, ctx) + sunmat_A => FSUNSparseMatrix(neq, neq, nnz, sparsetype, ctx) if (.not. associated(sunmat_A)) then print *, 'ERROR: sunmat_A = NULL' stop 1 end if - sunmat_M => FSUNSparseMatrix(int(neq,c_long), int(neq,c_long), int(nnz,c_long), sparsetype, ctx) + sunmat_M => FSUNSparseMatrix(neq, neq, nnz, sparsetype, ctx) if (.not. associated(sunmat_M)) then print *, 'ERROR: sunmat_M = NULL' stop 1 diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 index 52a7121a88..d4b5185105 100644 --- a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -46,8 +46,18 @@ module bruss_mod !======= Declarations ========= implicit none + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. +#if defined(SUNDIALS_INT32_T) + integer, parameter :: myindextype = selected_int_kind(8) +#elif defined(SUNDIALS_INT64_T) + integer, parameter :: myindextype = selected_int_kind(16) +#endif + ! number of equations - integer(c_long), parameter :: neq = 3 + integer(kind=myindextype), parameter :: neq = 3 ! ODE parameters real(c_double), parameter, dimension(neq) :: y0 = (/ 3.9d0, 1.1d0, 2.8d0 /) diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index c87583eb23..ab8fa486a8 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -54,8 +54,8 @@ module DiurnalKryBP_mod ! setup and number of equations integer(c_int), parameter :: mx = 10, my = 10 - integer(c_long), parameter :: mm = mx*my - integer(c_long), parameter :: neq = 2*mm + integer(c_int64_t), parameter :: mm = mx*my + integer(c_int64_t), parameter :: neq = 2*mm ! ODE constant parameters real(c_double), parameter :: Kh = 4.0d-6 @@ -230,7 +230,7 @@ program main real(c_double) :: cx, cy ! initialization variables integer(c_int) :: ierr ! error flag from C functions integer(c_long) :: outstep ! output step - integer(c_long) :: mu, ml ! band preconditioner constants + integer(c_int64_t) :: mu, ml ! band preconditioner constants real(c_double) :: x, y ! initialization index variables type(N_Vector), pointer :: sunvec_u ! sundials vector diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index 929844e792..cb0aa027d0 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -93,7 +93,7 @@ module kpr_mod real(c_double), parameter :: T0 = 0.0d0 ! initial time real(c_double), parameter :: Tf = 5.0d0 ! final time real(c_double), parameter :: dTout = 0.1d0 ! time between outputs - integer(c_long), parameter :: NEQ = 2 ! number of dependent vars. + integer(c_int64_t), parameter :: NEQ = 2 ! number of dependent vars. integer(c_int), parameter :: Nt = ceiling(Tf/dTout) ! number of output times ! parameters that can be modified via CLI args or are derived diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 index fb58aee07f..c93a7dc06f 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -41,7 +41,7 @@ module dnsL_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 integer(c_long), parameter :: nout = 12 contains diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index 379f7a23ea..f4ef7e1984 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -41,7 +41,7 @@ module dns_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 integer(c_long), parameter :: nout = 12 contains diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 index 685d60784c..98d9110884 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -49,8 +49,8 @@ module DiagkrybbdData ! Problem parameters integer(c_int), parameter :: iGStype = 1 integer(c_int), parameter :: iPretype0 = 1 - integer(c_long), parameter :: nlocal = 10 - integer(c_long) :: neq, mu, ml, mudq, mldq + integer(c_int64_t), parameter :: nlocal = 10 + integer(c_int64_t) :: neq, mu, ml, mudq, mldq integer(c_int) :: iPretype real(c_double) :: alpha @@ -118,7 +118,7 @@ integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & ! calling variables real(c_double), value :: t ! current time - integer(c_long) :: nnlocal ! local space + integer(c_int64_t) :: nnlocal ! local space type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_g ! output g N_Vector type(c_ptr) :: user_data ! user-defined data diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 index e1266fb522..38cf788bdc 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -49,8 +49,8 @@ module DiagkryData ! Problem parameters integer(c_int), parameter :: iGStype = 1 integer(c_int), parameter :: iPretype0 = 1 - integer(c_long), parameter :: nlocal = 10 - integer(c_long) :: neq + integer(c_int64_t), parameter :: nlocal = 10 + integer(c_int64_t) :: neq integer(c_int) :: iPretype real(c_double) :: alpha @@ -149,7 +149,7 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & ! Calculate Jacobian here ibase = myid * nlocal - istart = max(1_8, 4 - ibase) + istart = max(1_c_int64_t, 4 - ibase) do i = istart,nlocal pj = dble(ibase + i) psubi = 1.d0 + gamma * alpha * pj diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 index 39b8abf5dc..8f200c90c7 100644 --- a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 @@ -45,8 +45,8 @@ module DiagnonData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_long), parameter :: nlocal = 2 - integer(c_long) :: neq + integer(c_int64_t), parameter :: nlocal = 2 + integer(c_int64_t) :: neq real(c_double) :: alpha contains diff --git a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 index 28e82b79f7..83c8a46598 100644 --- a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 @@ -34,7 +34,7 @@ module ode_mod implicit none ! number of equations - integer(c_long), parameter :: neq = 1 + integer(c_int64_t), parameter :: neq = 1 ! ODE parameters double precision, parameter :: lamda = -100.0d0 diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 index 6efd6980ba..9302d65408 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 @@ -55,7 +55,7 @@ module ode_mod implicit none ! number of equations - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 index f2d44c4418..bf79b5bde6 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 @@ -55,7 +55,7 @@ module ode_mod implicit none ! number of equations - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 index 4f458287a5..f4360ff1c7 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 @@ -55,7 +55,7 @@ module ode_mod implicit none ! number of equations - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 ! ODE parameters double precision, parameter :: lamda = -100.0d0 @@ -145,8 +145,8 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & type(N_Vector) :: tmp1, tmp2, tmp3 ! workspace N_Vectors ! pointer to data in SUNDIALS matrix - integer(c_long), pointer :: Jidxptr(:) - integer(c_long), pointer :: Jidxval(:) + integer(c_int64_t), pointer :: Jidxptr(:) + integer(c_int64_t), pointer :: Jidxval(:) real(c_double), pointer :: Jmat(:) !======= Internals ============ diff --git a/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 index 3ec4d5ab3b..33ef0b610c 100644 --- a/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 @@ -38,7 +38,7 @@ module ode_mod implicit none ! number of equations - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 ! ODE parameters double precision, parameter :: a = 1.2d0 diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 index 69b4016927..fe69831f05 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 @@ -55,8 +55,8 @@ module diurnal_bp_mod ! setup and number of equations integer(c_int), parameter :: mx = 10, my = 10 - integer(c_long), parameter :: mm = mx*my - integer(c_long), parameter :: neq = 2*mm + integer(c_int64_t), parameter :: mm = mx*my + integer(c_int64_t), parameter :: neq = 2*mm ! ODE constant parameters real(c_double), parameter :: Kh = 4.0d-6 @@ -227,7 +227,7 @@ program main real(c_double) :: cx, cy ! initialization variables integer(c_int) :: ierr ! error flag from C functions integer(c_long) :: outstep ! output step - integer(c_long) :: mu, ml ! band preconditioner constants + integer(c_int64_t) :: mu, ml ! band preconditioner constants real(c_double) :: x, y ! initialization index variables type(N_Vector), pointer :: sunvec_u ! sundials vector diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 index d9267480ac..d087b60d99 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 @@ -55,8 +55,8 @@ module diurnal_mod ! setup and number of equations integer(c_int), parameter :: mx = 10, my = 10 - integer(c_long), parameter :: mm = mx*my - integer(c_long), parameter :: neq = 2*mm + integer(c_int64_t), parameter :: mm = mx*my + integer(c_int64_t), parameter :: neq = 2*mm ! ODE constant parameters real(c_double), parameter :: Kh = 4.0d-6 @@ -375,11 +375,11 @@ subroutine Prec_LU(mmm, p, ierr) implicit none integer(c_int), intent(out) :: ierr - integer(c_long), intent(in) :: mmm + integer(c_int64_t), intent(in) :: mmm real(c_double), intent(inout) :: p(2,2,mmm) ! local variable - integer(c_long) :: i + integer(c_int64_t) :: i real(c_double) :: p11, p12, p21, p22, det ! initialize return value to success @@ -426,7 +426,7 @@ subroutine Prec_Sol(mx,my, p, z) real(c_double), dimension(2,mx,my), intent(inout) :: z(:,:,:) ! local variable - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: z1, z2 diff --git a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 index 2563680cba..2ed0a8cbed 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 @@ -45,7 +45,7 @@ module robertsDnsL_mod implicit none integer(c_int), parameter :: nout = 12 - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 contains diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 index 3e6a9901ad..1eb2e504be 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 @@ -49,7 +49,7 @@ module RobertsDnsConstr_mod implicit none integer(c_int), parameter :: nout = 12 - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 contains diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 index 751a2f2807..3a07939e64 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 @@ -45,7 +45,7 @@ module robertsDns_mod implicit none integer(c_int), parameter :: nout = 12 - integer(c_long), parameter :: neq = 3 + integer(c_int64_t), parameter :: neq = 3 contains diff --git a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 index eef7aeab8e..785d3e7c63 100644 --- a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 @@ -45,8 +45,8 @@ module roberts_klu_mod implicit none integer(c_int), parameter :: nout = 12 - integer(c_long), parameter :: neq = 3 - integer(c_long), parameter :: nnz = neq * neq + integer(c_int64_t), parameter :: neq = 3 + integer(c_int64_t), parameter :: nnz = neq * neq contains @@ -164,8 +164,8 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) real(c_double), pointer, dimension(nnz) :: Jdata(:) - integer(c_long), pointer, dimension(nnz) :: Jrvals(:) - integer(c_long), pointer, dimension(neq+1) :: Jcptrs(:) + integer(c_int64_t), pointer, dimension(nnz) :: Jrvals(:) + integer(c_int64_t), pointer, dimension(neq+1) :: Jcptrs(:) !======= Internals ============ diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index 667a6260c6..5e5bac8953 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -37,6 +37,9 @@ foreach(example_tuple ${FCVODES_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # Install fortran modules to a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90) diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 index 790b62326c..3e83d622e6 100644 --- a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 @@ -48,7 +48,7 @@ module idaHeat2DKryOMP_mod integer(c_int), parameter :: nout = 11 integer(c_int), parameter :: mgrid = 100 - integer(c_long), parameter :: neq = mgrid*mgrid + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff @@ -86,7 +86,7 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j !======= Internals ============ @@ -522,7 +522,7 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 index b718674c52..0f76650345 100644 --- a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 @@ -76,7 +76,7 @@ module Heat2DKryBBD_mod integer :: je integer :: nxl ! local number of x grid points integer :: nyl ! local number of y grid points - integer(c_long) :: N, Ntot + integer(c_int64_t) :: N, Ntot real(c_double) :: dx ! x-directional mesh spacing real(c_double) :: dy ! y-directional mesh spacing integer, target :: comm ! communicator object @@ -93,7 +93,7 @@ module Heat2DKryBBD_mod real(c_double), dimension(:), allocatable :: Ssend ! Problem parameters - integer(c_long) :: mudq, mldq, mu, ml + integer(c_int64_t) :: mudq, mldq, mu, ml integer(c_int) :: maxl real(c_double) :: kx ! x-directional diffusion coefficient real(c_double) :: ky ! y-directional diffusion coefficient @@ -442,7 +442,7 @@ integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & implicit none ! calling variables - integer(c_long), value :: Nloc + integer(c_int64_t), value :: Nloc real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector @@ -647,7 +647,7 @@ integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & implicit none ! calling variables - integer(c_long), value :: Nloc + integer(c_int64_t), value :: Nloc real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector diff --git a/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 b/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 index 22c7d2d691..a8fd742d0e 100644 --- a/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 +++ b/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 @@ -46,7 +46,7 @@ module dae_mod integer(c_int), parameter :: nout = 11 integer(c_int), parameter :: mgrid = 10 - integer(c_long), parameter :: neq = mgrid*mgrid + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff @@ -84,7 +84,7 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) real(c_double), pointer :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j !======= Internals ============ @@ -498,7 +498,7 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) real(c_double), pointer :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval diff --git a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 index debacbf91a..d41404ff8f 100644 --- a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 +++ b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 @@ -419,7 +419,7 @@ program main retval = FIDASStolerancesB(mem, indexB(1), RTOLB, ATOLB) call check_retval(retval, "FIDASStolerancesB") - retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_8) + retval = FIDASetMaxNumStepsB(mem, indexB(1), 1000_c_long) call check_retval(retval, "FIDASetMaxNumStepsB") ! Create dense SUNMatrix for use in linear solves diff --git a/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 b/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 index 2c06761340..9ecad4f265 100644 --- a/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 +++ b/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 @@ -46,7 +46,7 @@ module dae_mod integer(c_int), parameter :: nout = 11 integer(c_int), parameter :: mgrid = 10 - integer(c_long), parameter :: neq = mgrid*mgrid + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff @@ -84,7 +84,7 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) real(c_double), pointer :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j !======= Internals ============ @@ -500,7 +500,7 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) real(c_double), pointer :: r(:,:) ! local variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: xfact, yfact integer(c_int) :: retval diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 index 9c00556e7d..e0fba580a1 100644 --- a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 @@ -36,10 +36,10 @@ module kinDiagonKry_mod ! With MPI-3 use mpi_f08 is preferred include "mpif.h" - integer(c_long), parameter :: neq = 128 + integer(c_int64_t), parameter :: neq = 128 integer(c_int) :: ierr, retval, nprint - integer(c_long) :: i, nlocal + integer(c_int64_t) :: i, nlocal real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) real(c_double) :: p(neq) integer(c_int), parameter :: prectype = 2 @@ -73,7 +73,7 @@ subroutine init(sunvec_u, sunvec_s, sunvec_c) type(N_Vector) :: sunvec_c ! constraint N_Vector ! local variables - integer(c_long) :: ii + integer(c_int64_t) :: ii u(1:nlocal) => FN_VGetArrayPointer(sunvec_u) scale(1:nlocal) => FN_VGetArrayPointer(sunvec_s) @@ -118,7 +118,7 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & real(c_double), pointer, dimension(nlocal) :: uu(:), ff(:) ! local variables - integer(c_long) :: ii + integer(c_int64_t) :: ii !======= Internals ============ @@ -471,7 +471,7 @@ subroutine PrintOutput(uu) ! calling variable real(c_double), dimension(neq) :: uu - integer(c_long) :: ii + integer(c_int64_t) :: ii !======= Internals ============ diff --git a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 index a69564fe1f..78c76cde4f 100644 --- a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 @@ -47,7 +47,7 @@ module kinDiagonKry_mod integer(kind=myindextype), parameter :: neq = 128 integer(c_int) :: ierr, retval - integer(c_long) :: i + integer(c_int64_t) :: i real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) real(c_double) :: p(neq) integer(c_int), parameter :: prectype = 2 diff --git a/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 index 823015cf9c..4cdf270c9b 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 @@ -31,10 +31,10 @@ module prob_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: nx = 31 - integer(c_long), parameter :: ny = 31 - integer(c_long), parameter :: neq = nx*ny - integer(c_long), parameter :: skip = 3 + integer(c_int64_t), parameter :: nx = 31 + integer(c_int64_t), parameter :: ny = 31 + integer(c_int64_t), parameter :: neq = nx*ny + integer(c_int64_t), parameter :: skip = 3 real(c_double), parameter :: ftol = 1.d-12 contains @@ -66,7 +66,7 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & real(c_double), pointer :: u(:,:), f(:,:) ! internal variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, uij, udn, uup, ult, urt !======= Internals ============ @@ -315,7 +315,7 @@ subroutine PrintOutput(u) real(c_double), dimension(nx,ny) :: u ! internal variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: dx, dy, x, y !======= Internals ============ diff --git a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 index e96dc3c5f0..9832ac97ff 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -34,10 +34,10 @@ module prob_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: nx = 31 - integer(c_long), parameter :: ny = 31 - integer(c_long), parameter :: neq = nx*ny - integer(c_long), parameter :: skip = 3 + integer(c_int64_t), parameter :: nx = 31 + integer(c_int64_t), parameter :: ny = 31 + integer(c_int64_t), parameter :: neq = nx*ny + integer(c_int64_t), parameter :: skip = 3 real(c_double), parameter :: ftol = 1.d-12 contains @@ -65,7 +65,7 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & real(c_double), pointer :: u(:,:), f(:,:) ! internal variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, uij, udn, uup, ult, urt !======= Internals ============ @@ -137,7 +137,7 @@ integer(c_int) function jactimes(sunvec_v, sunvec_Jv, sunvec_u, new_u, user_data real(c_double), pointer :: v(:,:), Jv(:,:) ! internal variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: dx, dy, hdiff, vdiff, hdc, vdc, vij, vdn, vup, vlt, vrt !======= Internals ============ @@ -376,7 +376,7 @@ subroutine PrintOutput(u) real(c_double), dimension(nx,ny) :: u ! internal variables - integer(c_long) :: i, j + integer(c_int64_t) :: i, j real(c_double) :: dx, dy, x, y !======= Internals ============ diff --git a/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 b/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 index e9f56c6a3a..2399a29ea5 100644 --- a/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 @@ -34,8 +34,8 @@ module prob_mod !======= Declarations ========= implicit none - integer(c_long), parameter :: nvar = 8 - integer(c_long), parameter :: neq = 3*nvar + integer(c_int64_t), parameter :: nvar = 8 + integer(c_int64_t), parameter :: neq = 3*nvar real(c_double), parameter :: ftol = 1.d-5 real(c_double), parameter :: stol = 1.d-5 diff --git a/examples/nvector/C_openmp/CMakeLists.txt b/examples/nvector/C_openmp/CMakeLists.txt index cfdc518d93..b332f20064 100644 --- a/examples/nvector/C_openmp/CMakeLists.txt +++ b/examples/nvector/C_openmp/CMakeLists.txt @@ -108,6 +108,9 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -115,7 +118,6 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) diff --git a/examples/nvector/manyvector/CMakeLists.txt b/examples/nvector/manyvector/CMakeLists.txt index e76cd90cd9..a43d1e4c15 100644 --- a/examples/nvector/manyvector/CMakeLists.txt +++ b/examples/nvector/manyvector/CMakeLists.txt @@ -105,6 +105,9 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -112,7 +115,6 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) diff --git a/examples/nvector/mpimanyvector/CMakeLists.txt b/examples/nvector/mpimanyvector/CMakeLists.txt index 32765aa29a..66c7253bc9 100644 --- a/examples/nvector/mpimanyvector/CMakeLists.txt +++ b/examples/nvector/mpimanyvector/CMakeLists.txt @@ -146,6 +146,9 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -153,7 +156,6 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) diff --git a/examples/nvector/mpiplusx/CMakeLists.txt b/examples/nvector/mpiplusx/CMakeLists.txt index 9b2c733540..195bcb6868 100644 --- a/examples/nvector/mpiplusx/CMakeLists.txt +++ b/examples/nvector/mpiplusx/CMakeLists.txt @@ -144,6 +144,9 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -151,7 +154,6 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) diff --git a/examples/nvector/parallel/CMakeLists.txt b/examples/nvector/parallel/CMakeLists.txt index ff13f85ce5..bfdf74eec8 100644 --- a/examples/nvector/parallel/CMakeLists.txt +++ b/examples/nvector/parallel/CMakeLists.txt @@ -133,6 +133,9 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -140,7 +143,6 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} diff --git a/examples/nvector/pthreads/CMakeLists.txt b/examples/nvector/pthreads/CMakeLists.txt index 586e1c3f06..e9fefd7191 100644 --- a/examples/nvector/pthreads/CMakeLists.txt +++ b/examples/nvector/pthreads/CMakeLists.txt @@ -108,6 +108,9 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -115,7 +118,6 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/nvector/serial/CMakeLists.txt b/examples/nvector/serial/CMakeLists.txt index ef92e58040..6807562188 100644 --- a/examples/nvector/serial/CMakeLists.txt +++ b/examples/nvector/serial/CMakeLists.txt @@ -100,6 +100,9 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -108,9 +111,6 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # folder where fortran .mod files are - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) endif() diff --git a/examples/sunlinsol/band/CMakeLists.txt b/examples/sunlinsol/band/CMakeLists.txt index 1dd10759f5..8a6d09997e 100644 --- a/examples/sunlinsol/band/CMakeLists.txt +++ b/examples/sunlinsol/band/CMakeLists.txt @@ -97,6 +97,9 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -105,9 +108,6 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/dense/CMakeLists.txt b/examples/sunlinsol/dense/CMakeLists.txt index f751cd4760..03b6155811 100644 --- a/examples/sunlinsol/dense/CMakeLists.txt +++ b/examples/sunlinsol/dense/CMakeLists.txt @@ -97,6 +97,9 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -105,9 +108,6 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/klu/CMakeLists.txt b/examples/sunlinsol/klu/CMakeLists.txt index 5932da7b07..664ec266a1 100644 --- a/examples/sunlinsol/klu/CMakeLists.txt +++ b/examples/sunlinsol/klu/CMakeLists.txt @@ -98,6 +98,9 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -106,9 +109,6 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index ce5739b1b5..0dd6ea947e 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -103,6 +103,9 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -111,9 +114,6 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/pcg/serial/CMakeLists.txt b/examples/sunlinsol/pcg/serial/CMakeLists.txt index 4a014d11e7..4d6be609ee 100644 --- a/examples/sunlinsol/pcg/serial/CMakeLists.txt +++ b/examples/sunlinsol/pcg/serial/CMakeLists.txt @@ -104,6 +104,9 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -112,9 +115,6 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt index 81a7330259..005f743cdf 100644 --- a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @@ -104,6 +104,9 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -112,9 +115,6 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt index beba6889fd..daa7d9fca3 100644 --- a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @@ -103,6 +103,9 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -111,9 +114,6 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/spgmr/serial/CMakeLists.txt b/examples/sunlinsol/spgmr/serial/CMakeLists.txt index 0ad67ecec1..3353f2a829 100644 --- a/examples/sunlinsol/spgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/serial/CMakeLists.txt @@ -106,6 +106,9 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -114,9 +117,6 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt index 2d3543ed5c..c985445c51 100644 --- a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt @@ -104,6 +104,9 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -112,9 +115,6 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunmatrix/band/CMakeLists.txt b/examples/sunmatrix/band/CMakeLists.txt index 2502ecf508..1db5a837a3 100644 --- a/examples/sunmatrix/band/CMakeLists.txt +++ b/examples/sunmatrix/band/CMakeLists.txt @@ -98,6 +98,9 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 @@ -106,9 +109,6 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - # set fortran module directory to avoid name collisions - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - # libraries to link against target_link_libraries(${example} sundials_nvecserial diff --git a/examples/sunmatrix/dense/CMakeLists.txt b/examples/sunmatrix/dense/CMakeLists.txt index 48365ac059..e5e5f9a346 100644 --- a/examples/sunmatrix/dense/CMakeLists.txt +++ b/examples/sunmatrix/dense/CMakeLists.txt @@ -97,13 +97,15 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} diff --git a/examples/sunmatrix/sparse/CMakeLists.txt b/examples/sunmatrix/sparse/CMakeLists.txt index daff9a61d4..ee04a96b8d 100644 --- a/examples/sunmatrix/sparse/CMakeLists.txt +++ b/examples/sunmatrix/sparse/CMakeLists.txt @@ -102,13 +102,15 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") - set_target_properties(${example} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) # libraries to link against target_link_libraries(${example} diff --git a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 4906cd1a31..834af69c2e 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -97,6 +97,9 @@ foreach(example_tuple ${fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) diff --git a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 index 90213440af..7b6cfd2322 100644 --- a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 +++ b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 @@ -22,15 +22,17 @@ module test_fsunnonlinsol_fixedpoint implicit none integer(kind=myindextype), parameter :: NEQ = 3 ! number of equations - integer(C_INT), parameter :: MAXIT = 10 ! max nonlinear iters. + integer(C_INT), parameter :: MAXIT = 20 ! max nonlinear iters. real(C_DOUBLE), parameter :: TOL = 1.0e-4 ! nonlinear solver tolerance real(C_DOUBLE), parameter :: PI = 3.1415926535898 ! approximate solution - real(C_DOUBLE) :: Y1 = 0.5d0 - real(C_DOUBLE) :: Y2 = 0.d0 - real(C_DOUBLE) :: Y3 = -PI/6.0d0 + real(C_DOUBLE) :: XTRUE = 0.5d0 + real(C_DOUBLE) :: YTRUE = 1.0d0 + real(C_DOUBLE) :: ZTRUE = -PI/6.0d0 + + type(N_Vector), pointer :: y0 contains @@ -43,26 +45,30 @@ integer(C_INT) function unit_tests() result(retval) implicit none type(SUNNonlinearSolver), pointer :: NLS ! test nonlinear solver - type(N_Vector), pointer :: x, y0, y, w ! test vectors - real(C_DOUBLE), pointer :: ydata(:) + type(N_Vector), pointer :: ycur, ycor, w ! test vectors + real(C_DOUBLE), pointer :: data(:) integer(C_LONG) :: niters(1) integer(C_INT) :: tmp - x => FN_VNew_Serial(NEQ, sunctx) - y0 => FN_VClone(x) - y => FN_VClone(x) - w => FN_VClone(x) + y0 => FN_VNew_Serial(NEQ, sunctx) + ycor => FN_VClone(y0) + ycur => FN_VClone(y0) + w => FN_VClone(y0) - ! set weights - ydata => FN_VGetArrayPointer(y0) - ydata(1) = 0.1d0 - ydata(2) = 0.1d0 - ydata(3) = -0.1d0 + ! set initial guess + data => FN_VGetArrayPointer(y0) + data(1) = 0.1d0 + data(2) = 0.1d0 + data(3) = -0.1d0 + + ! set initial correction + call FN_VConst(0.0d0, ycor) + ! set weights call FN_VConst(1.0d0, w) ! create and test NLS - NLS => FSUNNonlinsol_FixedPoint(y, 0, sunctx) + NLS => FSUNNonlinsol_FixedPoint(y0, 0, sunctx) retval = FSUNNonlinSolSetSysFn(NLS, c_funloc(FPFunction)) if (retval /= 0) then @@ -82,37 +88,35 @@ integer(C_INT) function unit_tests() result(retval) return end if - retval = FSUNNonlinSolSolve(NLS, y0, y, w, TOL, 1, c_loc(x)) + retval = FSUNNonlinSolSolve(NLS, y0, ycor, w, TOL, 1, c_loc(y0)) if (retval /= 0) then write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSolve returned ', retval return end if - ! extract and print solution - ydata => FN_VGetArrayPointer(y) - - write(*,*) 'Solution:' - write(*,'(A,E14.7)') 'y1 = ', ydata(1) - write(*,'(A,E14.7)') 'y2 = ', ydata(2) - write(*,'(A,E14.7)') 'y3 = ', ydata(3) - - write(*,*) 'Solution Error:' - write(*,'(A,E14.7)') 'e1 = ', ydata(1) - Y1 - write(*,'(A,E14.7)') 'e2 = ', ydata(2) - Y2 - write(*,'(A,E14.7)') 'e3 = ', ydata(3) - Y3 + ! update the initial guess with the final correction + call FN_VLinearSum(1.0d0, y0, 1.0d0, ycor, ycur); + ! print number of iterations retval = FSUNNonlinSolGetNumIters(NLS, niters) if (retval /= 0) then write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval return end if - write(*,'(A,I0)') 'Number of nonlinear iterations:', niters(1) + write(*,'(A,I0)') 'Number of nonlinear iterations: ', niters(1) + + ! check answer + retval = check_ans(ycur, TOL) + if (retval /= 0) then + write(*,'(A,I0)') ' >>> FAIL: check_ans failed' + return + end if ! cleanup - call FN_VDestroy(x) call FN_VDestroy(y0) - call FN_VDestroy(y) + call FN_VDestroy(ycor) + call FN_VDestroy(ycur) call FN_VDestroy(w) tmp = FSUNNonlinSolFree(NLS) @@ -122,8 +126,6 @@ integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - - implicit none type(SUNNonlinearSolver) :: NLS @@ -144,46 +146,87 @@ integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & end function ! ----------------------------------------------------------------------------- - ! Nonlinear system + ! Nonlinear system F(x,y,z): ! - ! 3x - cos(yz) - 1/2 = 0 - ! x^2 - 81(y+0.1)^2 + sin(z) + 1.06 = 0 - ! exp(-xy) + 20z + (10 pi - 3)/3 = 0 + ! 3x - cos((y-1)z) - 1/2 = 0 + ! x^2 - 81(y-0.9)^2 + sin(z) + 1.06 = 0 + ! exp(-x(y-1)) + 20z + (10 pi - 3)/3 = 0 ! - ! Nonlinear fixed point function + ! Nonlinear fixed point function G(x,y,z): ! - ! g1(x,y,z) = 1/3 cos(yz) + 1/6 - ! g2(x,y,z) = 1/9 sqrt(x^2 + sin(z) + 1.06) - 0.1 - ! g3(x,y,z) = -1/20 exp(-xy) - (10 pi - 3) / 60 + ! G1(x,y,z) = 1/3 cos((y-1)yz) + 1/6 + ! G2(x,y,z) = 1/9 sqrt(x^2 + sin(z) + 1.06) + 0.9 + ! G3(x,y,z) = -1/20 exp(-x(y-1)) - (10 pi - 3) / 60 + ! + ! Corrector form g(x,y,z): + ! + ! g1(x,y,z) = 1/3 cos((y-1)yz) + 1/6 - x0 + ! g2(x,y,z) = 1/9 sqrt(x^2 + sin(z) + 1.06) + 0.9 - y0 + ! g3(x,y,z) = -1/20 exp(-x(y-1)) - (10 pi - 3) / 60 - z0 ! ! ---------------------------------------------------------------------------- - integer(C_INT) function FPFunction(y, f, mem) & + integer(C_INT) function FPFunction(ycor, f, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - - implicit none - type(N_Vector) :: y, f + type(N_Vector) :: ycor, f type(C_PTR), value :: mem - real(C_DOUBLE), pointer :: ydata(:), fdata(:) - real(C_DOUBLE) :: y1, y2, y3 + real(C_DOUBLE), pointer :: data(:), fdata(:) + real(C_DOUBLE) :: x, y, z - ydata => FN_VGetArrayPointer(y) + data => FN_VGetArrayPointer(ycor) fdata => FN_VGetArrayPointer(f) - y1 = ydata(1) - y2 = ydata(2) - y3 = ydata(3) + x = data(1) + y = data(2) + z = data(3) - fdata(1) = (1/3.0d0) * cos(y2*y3) + (1/6.0d0) - fdata(2) = (1/9.0d0) * sqrt(y1*y1 + sin(y3) + 1.06d0) - 0.1d0 - fdata(3) = -(1/20.d0) * exp(-y1*y2) - (10.d0 * PI - 3.0d0) / 60.d0 + fdata(1) = (1.0d0/3.0d0) * cos((y - 1.0d0) * z) + (1.0d0/6.0d0) + fdata(2) = (1.0d0/9.0d0) * sqrt(x*x + sin(z) + 1.06d0) + 0.9d0 + fdata(3) = -(1/20.d0) * exp(-x*(y-1.0d0)) - (10.d0 * PI - 3.0d0) / 60.0d0 + + call FN_VLinearSum(1.0d0, f, -1.0d0, y0, f) retval = 0 end function + integer(C_INT) function check_ans(ycor, tol) & + result(retval) bind(C) + use, intrinsic :: iso_c_binding + implicit none + + type(N_Vector) :: ycor + real(C_DOUBLE), value :: tol + real(C_DOUBLE) :: ex, ey, ez + real(C_DOUBLE), pointer :: data(:) + + ! extract and print solution + data => FN_VGetArrayPointer(ycor) + + write(*,*) 'Solution:' + write(*,'(A,E14.7)') ' x = ', data(1) + write(*,'(A,E14.7)') ' y = ', data(2) + write(*,'(A,E14.7)') ' z = ', data(3) + + ex = data(1) - XTRUE + ey = data(2) - YTRUE + ez = data(3) - ZTRUE + + write(*,*) 'Solution Error:' + write(*,'(A,E14.7)') ' ex = ', ex + write(*,'(A,E14.7)') ' ey = ', ey + write(*,'(A,E14.7)') ' ez = ', ez + + tol = tol * 10.0d0 + if (ex > tol .or. ey > tol .or. ez > tol) then + retval = 1 + end if + + retval = 0 + end function + end module program main @@ -198,7 +241,7 @@ program main integer(C_INT) :: fails = 0 !============== Introduction ============= - print *, 'fixedpoint SUNNonlinearSolver Fortran 2003 interface test' + write(*,*) 'SUNNonlinearSolver_FixedPoint Fortran 2003 interface test' call Test_Init(SUN_COMM_NULL) diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 08870d929f..2f3413bd0b 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -98,6 +98,9 @@ foreach(example_tuple ${fortran_examples}) # check if this example has already been added, only need to add # example source files once for testing with different inputs if(NOT TARGET ${example}) + # build fortran modules into a unique directory to avoid naming collisions + set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + # example source files add_executable(${example} ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index 813ded3c7f..8af98fc26c 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -579,7 +579,8 @@ SUNDIALS_EXPORT int CVodeGetAdjCheckPointsInfo(void* cvode_mem, CVadjCheckPointRec* ckpnt); /* CVLS interface function that depends on CVRhsFn */ -int CVodeSetJacTimesRhsFnB(void* cvode_mem, int which, CVRhsFn jtimesRhsFn); +SUNDIALS_EXPORT int CVodeSetJacTimesRhsFnB(void* cvode_mem, int which, + CVRhsFn jtimesRhsFn); /* Undocumented Optional Output Functions For Backward Problems */ diff --git a/src/nvector/serial/fmod_int32/CMakeLists.txt b/src/nvector/serial/fmod_int32/CMakeLists.txt index 293239b9fb..ebf2ec0182 100644 --- a/src/nvector/serial/fmod_int32/CMakeLists.txt +++ b/src/nvector/serial/fmod_int32/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fnvecserial_mod fnvector_serial_mod.f90 fnvector_serial_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fnvecserial_mod VERSION diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt index 0c9fd4f2c2..0c4142417c 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt @@ -17,7 +17,6 @@ sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt index 0c9fd4f2c2..0c4142417c 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt @@ -17,7 +17,6 @@ sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt index 44aa8a4922..cdf9d3825e 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt @@ -17,7 +17,6 @@ sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt index 44aa8a4922..cdf9d3825e 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt @@ -17,7 +17,6 @@ sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index bde159761c..b8a19e2ff2 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -32,6 +32,7 @@ set(sundials_HEADERS sundials_dense.h sundials_direct.h sundials_errors.h + sundials_futils.h sundials_iterative.h sundials_linearsolver.h sundials_linearsolver.hpp @@ -53,10 +54,6 @@ set(sundials_HEADERS sundials_version.h ) -if(BUILD_FORTRAN_MODULE_INTERFACE) - list(APPEND sundials_HEADERS sundials_futils.h) -endif() - if(ENABLE_MPI) list(APPEND sundials_HEADERS sundials_mpi_errors.h) endif() @@ -88,6 +85,7 @@ set(sundials_SOURCES sundials_dense.c sundials_direct.c sundials_errors.c + sundials_futils.c sundials_hashmap.c sundials_iterative.c sundials_linearsolver.c @@ -106,10 +104,6 @@ if(ENABLE_MPI) list(APPEND sundials_SOURCES sundials_mpi_errors.c) endif() -if(BUILD_FORTRAN_MODULE_INTERFACE) - list(APPEND sundials_SOURCES sundials_futils.c) -endif() - # Add prefix with complete path to the source files add_prefix(${SUNDIALS_SOURCE_DIR}/src/sundials/ sundials_SOURCES) diff --git a/src/sundials/fmod_int32/CMakeLists.txt b/src/sundials/fmod_int32/CMakeLists.txt index 74fe6c96ee..957328e8ff 100644 --- a/src/sundials/fmod_int32/CMakeLists.txt +++ b/src/sundials/fmod_int32/CMakeLists.txt @@ -22,6 +22,4 @@ set(sundials_SOURCES sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_core ) diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index ad1f31a295..62e0215249 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -291,13 +291,6 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { #include "sundials/sundials_adaptcontroller.h" - -SWIGEXPORT SWIGEXTERN int const _wrap_SUN_COMM_NULL = (int)(0); - -SWIGEXPORT SWIGEXTERN int const _wrap_SUNFALSE = (int)(0); - -SWIGEXPORT SWIGEXTERN int const _wrap_SUNTRUE = (int)(1); - SWIGEXPORT void _wrap_FSUNLogErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { int arg1 ; char *arg2 = (char *) 0 ; diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index f47a3141f2..2bda4cb0fe 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -44,14 +44,11 @@ module fsundials_core_mod include "mpif.h" integer(C_INT), protected, public :: SUN_COMM_NULL = MPI_COMM_NULL #else - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL + integer(C_INT), parameter, public :: SUN_COMM_NULL = 0_C_INT #endif - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUNFALSE") :: SUNFALSE - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUNTRUE") :: SUNTRUE + integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT + integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT ! typedef enum SUNOutputFormat enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE diff --git a/src/sundials/fmod_int64/CMakeLists.txt b/src/sundials/fmod_int64/CMakeLists.txt index 74fe6c96ee..957328e8ff 100644 --- a/src/sundials/fmod_int64/CMakeLists.txt +++ b/src/sundials/fmod_int64/CMakeLists.txt @@ -22,6 +22,4 @@ set(sundials_SOURCES sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_core ) diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index 9fa73f722b..2478b92d68 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -291,13 +291,6 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { #include "sundials/sundials_adaptcontroller.h" - -SWIGEXPORT SWIGEXTERN int const _wrap_SUN_COMM_NULL = (int)(0); - -SWIGEXPORT SWIGEXTERN int const _wrap_SUNFALSE = (int)(0); - -SWIGEXPORT SWIGEXTERN int const _wrap_SUNTRUE = (int)(1); - SWIGEXPORT void _wrap_FSUNLogErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { int arg1 ; char *arg2 = (char *) 0 ; diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index c51487dd30..7096d0c6ce 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -44,14 +44,11 @@ module fsundials_core_mod include "mpif.h" integer(C_INT), protected, public :: SUN_COMM_NULL = MPI_COMM_NULL #else - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL + integer(C_INT), parameter, public :: SUN_COMM_NULL = 0_C_INT #endif - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUNFALSE") :: SUNFALSE - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUNTRUE") :: SUNTRUE + integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT + integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT ! typedef enum SUNOutputFormat enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index 46791fa66c..9b15332993 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -284,8 +284,8 @@ N_Vector N_VClone(N_Vector w) { N_Vector result = NULL; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(w)); - result = w->ops->nvclone(w); - result->sunctx = w->sunctx; + result = w->ops->nvclone(w); + if (result) { result->sunctx = w->sunctx; } SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(w)); return result; } @@ -294,8 +294,8 @@ N_Vector N_VCloneEmpty(N_Vector w) { N_Vector result; SUNDIALS_MARK_FUNCTION_BEGIN(getSUNProfiler(w)); - result = w->ops->nvcloneempty(w); - result->sunctx = w->sunctx; + result = w->ops->nvcloneempty(w); + if (result) { result->sunctx = w->sunctx; } SUNDIALS_MARK_FUNCTION_END(getSUNProfiler(w)); return result; } diff --git a/src/sunlinsol/band/fmod_int32/CMakeLists.txt b/src/sunlinsol/band/fmod_int32/CMakeLists.txt index 250f17c914..8b6e38724e 100644 --- a/src/sunlinsol/band/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/band/fmod_int32/CMakeLists.txt @@ -18,10 +18,7 @@ sundials_add_f2003_library(sundials_fsunlinsolband_mod SOURCES fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixband_mod + PUBLIC sundials_fsunmatrixband_mod sundials_fcore_mod OUTPUT_NAME sundials_fsunlinsolband_mod VERSION diff --git a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt index 61bdf87108..3a1329e120 100644 --- a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt @@ -18,10 +18,7 @@ sundials_add_f2003_library(sundials_fsunlinsoldense_mod SOURCES fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod + PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod OUTPUT_NAME sundials_fsunlinsoldense_mod VERSION diff --git a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt index 4a0323d921..683f76cc3b 100644 --- a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt @@ -18,10 +18,7 @@ sundials_add_f2003_library(sundials_fsunlinsolklu_mod SOURCES fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixsparse_mod + PUBLIC sundials_fsunmatrixsparse_mod sundials_fcore_mod OUTPUT_NAME sundials_fsunlinsolklu_mod VERSION diff --git a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt index 12bcb2fae2..72b9d5acda 100644 --- a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt @@ -19,10 +19,7 @@ sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod SOURCES fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod + PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod OUTPUT_NAME sundials_fsunlinsollapackdense_mod VERSION diff --git a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt index 535741e7d6..e863f286ee 100644 --- a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunlinsolpcg_mod fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunlinsolpcg_mod VERSION diff --git a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt index d1b588396f..d05fdd7d0c 100644 --- a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunlinsolspbcgs_mod VERSION diff --git a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt index c2cbd50123..4a236368f8 100644 --- a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunlinsolspfgmr_mod VERSION diff --git a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt index 9ea74e0e45..005f891f6c 100644 --- a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunlinsolspgmr_mod VERSION diff --git a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt index ff3dc41956..2aa92f9022 100644 --- a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunlinsolsptfqmr_mod VERSION diff --git a/src/sunmatrix/band/fmod_int32/CMakeLists.txt b/src/sunmatrix/band/fmod_int32/CMakeLists.txt index 465260d783..6026568af8 100644 --- a/src/sunmatrix/band/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/band/fmod_int32/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunmatrixband_mod fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunmatrixband_mod VERSION diff --git a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt index 987102b9f6..6b11defa31 100644 --- a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunmatrixdense_mod fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunmatrixdense_mod VERSION diff --git a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt index fb0ed79b4c..407bddff70 100644 --- a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt @@ -19,7 +19,6 @@ sundials_add_f2003_library(sundials_fsunmatrixsparse_mod fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunmatrixsparse_mod VERSION diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt index bb2f0097b6..6e24d5269c 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt @@ -20,7 +20,6 @@ sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunnonlinsolfixedpoint_mod VERSION diff --git a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt index 46be1ab585..883fac35ed 100644 --- a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt +++ b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt @@ -20,7 +20,6 @@ sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c LINK_LIBRARIES PUBLIC sundials_fcore_mod - OBJECT_LIBRARIES OUTPUT_NAME sundials_fsunnonlinsolnewton_mod VERSION diff --git a/swig/Makefile b/swig/Makefile index f8aabe16ba..eb772623e9 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -14,6 +14,8 @@ # Makefile to generate SUNDIALS fortran interfaces with swig # --------------------------------------------------------------- +SWIG ?= swig + ARKODE=farkode_mod farkode_arkstep_mod farkode_erkstep_mod farkode_sprkstep_mod farkode_mristep_mod CVODE=fcvode_mod CVODES=fcvodes_mod @@ -48,77 +50,77 @@ modules: core arkode cvode cvodes ida idas kinsol nvector sunmatrix sunlinsol su core: $(CORE:%:sundials/%.i) @for i in ${CORE} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sundials/fmod_int${INT_SIZE} -o ../src/sundials/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} sundials/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sundials/fmod_int${INT_SIZE} -o ../src/sundials/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} sundials/$${i}.i; \ done arkode: $(ARKODE:%:arkode/%.i) @for i in ${ARKODE} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/arkode/fmod_int${INT_SIZE} -o ../src/arkode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} arkode/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/arkode/fmod_int${INT_SIZE} -o ../src/arkode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} arkode/$${i}.i; \ done cvode: $(CVODE:%:cvode/%.i) @for i in ${CVODE} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvode/fmod_int${INT_SIZE} -o ../src/cvode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvode/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvode/fmod_int${INT_SIZE} -o ../src/cvode/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvode/$${i}.i; \ done cvodes: $(CVODE:%:cvodes/%.i) @for i in ${CVODES} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvodes/fmod_int${INT_SIZE} -o ../src/cvodes/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvodes/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/cvodes/fmod_int${INT_SIZE} -o ../src/cvodes/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} cvodes/$${i}.i; \ done ida: $(IDA:%:ida/%.i) @for i in ${IDA} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/ida/fmod_int${INT_SIZE} -o ../src/ida/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} ida/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/ida/fmod_int${INT_SIZE} -o ../src/ida/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} ida/$${i}.i; \ done idas: $(IDAS:%:idas/%.i) @for i in ${IDAS} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/idas/fmod_int${INT_SIZE} -o ../src/idas/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} idas/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/idas/fmod_int${INT_SIZE} -o ../src/idas/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} idas/$${i}.i; \ done kinsol: $(KINSOL:%:kinsol/%.i) @for i in ${KINSOL} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/kinsol/fmod_int${INT_SIZE} -o ../src/kinsol/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} kinsol/$${i}.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/kinsol/fmod_int${INT_SIZE} -o ../src/kinsol/fmod_int${INT_SIZE}/$${i}.c ${INCLUDES} kinsol/$${i}.i; \ done nvector: $(NVECTOR:%:nvector/fnvector_%_mod.i) mpimanyvector @for i in ${NVECTOR} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/$${i}/fmod_int${INT_SIZE} -o ../src/nvector/$${i}/fmod_int${INT_SIZE}/fnvector_$${i}_mod.c ${INCLUDES} nvector/fnvector_$${i}_mod.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/$${i}/fmod_int${INT_SIZE} -o ../src/nvector/$${i}/fmod_int${INT_SIZE}/fnvector_$${i}_mod.c ${INCLUDES} nvector/fnvector_$${i}_mod.i; \ done mpimanyvector: nvector/fnvector_mpimanyvector_mod.i set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/manyvector/fmod_int${INT_SIZE} -o ../src/nvector/manyvector/fmod_int${INT_SIZE}/fnvector_mpimanyvector_mod.c ${INCLUDES} nvector/fnvector_mpimanyvector_mod.i; + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/nvector/manyvector/fmod_int${INT_SIZE} -o ../src/nvector/manyvector/fmod_int${INT_SIZE}/fnvector_mpimanyvector_mod.c ${INCLUDES} nvector/fnvector_mpimanyvector_mod.i; sunmatrix: $(SUNMATRIX:%:sunmatrix/fsunmatrix_%_mod.i) @for i in ${SUNMATRIX} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunmatrix/$${i}/fmod_int${INT_SIZE} -o ../src/sunmatrix/$${i}/fmod_int${INT_SIZE}/fsunmatrix_$${i}_mod.c ${INCLUDES} sunmatrix/fsunmatrix_$${i}_mod.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunmatrix/$${i}/fmod_int${INT_SIZE} -o ../src/sunmatrix/$${i}/fmod_int${INT_SIZE}/fsunmatrix_$${i}_mod.c ${INCLUDES} sunmatrix/fsunmatrix_$${i}_mod.i; \ done sunlinsol: $(SUNLINSOL:%:sunlinsol/fsunlinsol_%_mod.i) @for i in ${SUNLINSOL} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunlinsol/$${i}/fmod_int${INT_SIZE}/fsunlinsol_$${i}_mod.c ${INCLUDES} sunlinsol/fsunlinsol_$${i}_mod.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunlinsol/$${i}/fmod_int${INT_SIZE}/fsunlinsol_$${i}_mod.c ${INCLUDES} sunlinsol/fsunlinsol_$${i}_mod.i; \ done sunnonlinsol: $(SUNNONLINSOL:%:sunnonlinsol/fsunnonlinsol_%_mod.i) @for i in ${SUNNONLINSOL} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE}/fsunnonlinsol_$${i}_mod.c ${INCLUDES} sunnonlinsol/fsunnonlinsol_$${i}_mod.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE} -o ../src/sunnonlinsol/$${i}/fmod_int${INT_SIZE}/fsunnonlinsol_$${i}_mod.c ${INCLUDES} sunnonlinsol/fsunnonlinsol_$${i}_mod.i; \ done sunadaptcontroller: $(SUNADAPTCONTROLLER:%:sunadaptcontroller/fsunadaptcontroller_%_mod.i) @for i in ${SUNADAPTCONTROLLER} ; do \ set -x; \ - swig -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE} -o ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE}/fsunadaptcontroller_$${i}_mod.c ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i; \ + ${SWIG} -DGENERATE_INT${INT_SIZE} -fortran -outdir ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE} -o ../src/sunadaptcontroller/$${i}/fmod_int${INT_SIZE}/fsunadaptcontroller_$${i}_mod.c ${INCLUDES} sunadaptcontroller/fsunadaptcontroller_$${i}_mod.i; \ done clean: diff --git a/swig/sundials/fsundials_types.i b/swig/sundials/fsundials_types.i index 248ec9d5e7..0f61838b50 100644 --- a/swig/sundials/fsundials_types.i +++ b/swig/sundials/fsundials_types.i @@ -15,6 +15,9 @@ // Swig interface file // --------------------------------------------------------------- +// By default, wrap all constants as native fortran PARAMETERs +%fortranconst; + %include <stdint.i> #ifdef GENERATE_INT32 @@ -85,17 +88,12 @@ // (1) SWIG expands SUN_COMM_NULL to its value // (2) We need it to be equivalent to MPI_COMM_NULL when MPI is enabled -%insert("wrapper") %{ -SWIGEXPORT SWIGEXTERN int const _wrap_SUN_COMM_NULL = (int)(0); -%} - %insert("fdecl") %{ #if SUNDIALS_MPI_ENABLED include "mpif.h" integer(C_INT), protected, public :: SUN_COMM_NULL = MPI_COMM_NULL #else - integer(C_INT), protected, public, & - bind(C, name="_wrap_SUN_COMM_NULL") :: SUN_COMM_NULL + integer(C_INT), parameter, public :: SUN_COMM_NULL = 0_C_INT #endif %} From 0168f423cc0911827c9a955745a71a8d4f85c514 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Wed, 19 Jun 2024 17:36:55 -0700 Subject: [PATCH 067/137] Docs: Update CMake version requirement in install guide (#508) Correct required CMake version from 3.12+ to 3.18+ --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- doc/shared/sundials/Install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index b11ecd9621..bf63423eb5 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -101,7 +101,7 @@ generate Unix and Linux Makefiles, as well as KDevelop, Visual Studio, and CMake also provides a GUI front end and which allows an interactive build and installation process. -The SUNDIALS build process requires CMake version 3.12.0 or higher and a working +The SUNDIALS build process requires CMake version 3.18.0 or higher and a working C compiler. On Unix-like operating systems, it also requires Make (and ``curses``, including its development libraries, for the GUI front end to CMake, ``ccmake`` or ``cmake-gui``), while on Windows it requires Visual Studio. While From 23581e8454955283139e551a7bcd1b85d8b7c77b Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 19 Jun 2024 20:35:45 -0700 Subject: [PATCH 068/137] Maintenance: Fortran formatting (#509) Add Fortran formatting to CI and apply it --- .github/workflows/check-clang-format.yml | 5 +- .../developers/style_guide/SourceCode.rst | 11 +- .../ark_analytic_complex_f2003.f90 | 71 +- .../F2003_custom/ark_brusselator1D_f2003.f90 | 181 +- .../F2003_custom/fnvector_complex_mod.f90 | 202 +- .../F2003_custom/fnvector_fortran_mod.f90 | 334 ++-- .../F2003_custom/fsunlinsol_fortran_mod.f90 | 200 +- .../F2003_custom/fsunmatrix_fortran_mod.f90 | 84 +- .../test_fnvector_complex_mod.f90 | 341 ++-- .../test_fnvector_fortran_mod.f90 | 534 +++--- .../test_fsunlinsol_fortran_mod.f90 | 128 +- .../test_fsunmatrix_fortran_mod.f90 | 198 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 1482 ++++++++------- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 457 +++-- .../F2003_parallel/ark_diag_non_f2003.f90 | 174 +- .../F2003_parallel/ark_heat2D_f2003.f90 | 832 +++++---- .../F2003_serial/ark_analytic_f2003.f90 | 153 +- .../ark_bruss1D_FEM_klu_f2003.f90 | 1621 ++++++++--------- .../arkode/F2003_serial/ark_bruss_f2003.f90 | 181 +- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 335 ++-- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 324 ++-- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 269 ++- .../F2003_serial/ark_roberts_dns_f2003.f90 | 270 ++- .../F2003_serial/test_ark_butcher_f2003.f90 | 11 +- .../F2003_parallel/cv_diag_kry_bbd_f2003.f90 | 817 +++++---- .../F2003_parallel/cv_diag_kry_f2003.f90 | 405 ++-- .../F2003_parallel/cv_diag_non_p_f2003.f90 | 168 +- .../F2003_serial/cv_advdiff_bnd_f2003.f90 | 223 ++- .../F2003_serial/cv_analytic_fp_f2003.f90 | 93 +- .../cv_analytic_sys_dns_f2003.f90 | 124 +- .../cv_analytic_sys_dns_jac_f2003.f90 | 143 +- .../cv_analytic_sys_klu_f2003.f90 | 147 +- .../F2003_serial/cv_brusselator_dns_f2003.f90 | 140 +- .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 315 ++-- .../F2003_serial/cv_diurnal_kry_f2003.f90 | 422 +++-- .../F2003_serial/cv_roberts_dnsL_f2003.f90 | 197 +- .../cv_roberts_dns_constraints_f2003.f90 | 199 +- .../F2003_serial/cv_roberts_dns_f2003.f90 | 191 +- .../F2003_serial/cv_roberts_klu_f2003.f90 | 194 +- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 201 +- .../F2003_serial/cvs_analytic_fp_f2003.f90 | 93 +- .../F2003_openmp/idaHeat2D_kry_omp_f2003.f90 | 269 ++- .../ida_heat2D_kry_bbd_f2003.f90 | 914 +++++----- .../ida/F2003_serial/idaHeat2D_kry_f2003.f90 | 262 ++- .../ida/F2003_serial/idaRoberts_dns_f2003.f90 | 219 ++- .../idasAkzoNob_ASAi_dns_f2003.f90 | 182 +- .../F2003_serial/idasHeat2D_kry_f2003.f90 | 260 ++- .../F2003_parallel/kin_diagon_kry_f2003.f90 | 202 +- .../F2003_serial/kinDiagon_kry_f2003.f90 | 138 +- .../F2003_serial/kinLaplace_bnd_f2003.f90 | 189 +- .../kinLaplace_picard_kry_f2003.f90 | 256 ++- .../F2003_serial/kinRoboKin_dns_f2003.f90 | 176 +- .../C_openmp/test_fnvector_openmp_mod.f90 | 7 +- .../test_fnvector_manyvector_mod.f90 | 31 +- .../test_fnvector_mpimanyvector_mod.f90 | 40 +- .../mpiplusx/test_fnvector_mpiplusx_mod.f90 | 31 +- .../parallel/test_fnvector_parallel_mod.f90 | 23 +- .../pthreads/test_fnvector_pthreads_mod.f90 | 7 +- .../serial/test_fnvector_serial_mod.f90 | 3 +- examples/nvector/test_nvector.f90 | 266 ++- .../band/test_fsunlinsol_band_mod.f90 | 42 +- .../dense/test_fsunlinsol_dense_mod.f90 | 56 +- .../sunlinsol/klu/test_fsunlinsol_klu_mod.f90 | 44 +- .../test_fsunlinsol_lapackdense_mod.f90 | 58 +- .../serial/test_fsunlinsol_pcg_mod_serial.f90 | 149 +- .../test_fsunlinsol_spbcgs_mod_serial.f90 | 153 +- .../test_fsunlinsol_spfgmr_mod_serial.f90 | 155 +- .../test_fsunlinsol_spgmr_mod_serial.f90 | 151 +- .../test_fsunlinsol_sptfqmr_mod_serial.f90 | 155 +- examples/sunlinsol/test_sunlinsol.f90 | 135 +- .../band/test_fsunmatrix_band_mod.f90 | 104 +- .../dense/test_fsunmatrix_dense_mod.f90 | 76 +- .../sparse/test_fsunmatrix_sparse_mod.f90 | 73 +- examples/sunmatrix/test_sunmatrix.f90 | 107 +- .../test_fsunnonlinsol_fixedpoint_mod.f90 | 97 +- .../newton/test_fsunnonlinsol_newton_mod.f90 | 130 +- examples/utilities/test_utilities.f90 | 64 +- scripts/format.sh | 5 +- .../F2003_serial/ark_test_table_f2003.f90 | 18 +- 79 files changed, 8707 insertions(+), 9010 deletions(-) diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 0e2e6dab52..2a87a2a35d 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -13,7 +13,10 @@ jobs: - name: Install git run: | apt update - apt install -y git + apt install -y git python3-pip + + - name: Install fprettify + run: pip install fprettify - name: Check out repository code uses: actions/checkout@v4 diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index c9105fa99c..473409d987 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -185,7 +185,8 @@ not adhere to all of these rules. library which requires a newer standard. #. All new code added to SUNDIALS should be - formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_. + formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_, + and `fprettify <https://github.com/fortran-lang/fprettify>`_. See :ref:`Style.Formatting` for details. #. Spaces not tabs. @@ -377,9 +378,11 @@ Formatting ---------- All new code added to SUNDIALS should be formatted with `clang-format -<https://clang.llvm.org/docs/ClangFormat.html>`_. The -``.clang-format`` files in the root of the project define our configurations -for the tools respectively. To apply clang-format you can run: +<https://clang.llvm.org/docs/ClangFormat.html>`_ and +`fprettify <https://github.com/fortran-lang/fprettify>`_. The +``.clang-format`` file in the root of the project defines our configuration +for clang-format. We use the default fprettify settings, except we use +2-space indentation. To apply ``clang-format`` and ``fprettify`` you can run: .. code-block:: shell diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index 83e9ac1fbf..ad1c64c8fa 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 @@ -39,14 +39,14 @@ module ode_mod !======= Declarations ========= implicit none - integer(c_int64_t), parameter :: neq = 1 - integer(c_int), parameter :: Nt = 10 - complex(c_double_complex), parameter :: lambda = (-1d-2, 10.d0) - real(c_double), parameter :: T0 = 0.d0 - real(c_double), parameter :: Tf = 10.d0 - real(c_double), parameter :: dtmax = 0.01d0 - real(c_double), parameter :: reltol = 1.d-6 - real(c_double), parameter :: abstol = 1.d-10 + integer(c_int64_t), parameter :: neq = 1 + integer(c_int), parameter :: Nt = 10 + complex(c_double_complex), parameter :: lambda = (-1d-2, 10.d0) + real(c_double), parameter :: T0 = 0.d0 + real(c_double), parameter :: Tf = 10.d0 + real(c_double), parameter :: dtmax = 0.01d0 + real(c_double), parameter :: reltol = 1.d-6 + real(c_double), parameter :: abstol = 1.d-10 contains @@ -60,7 +60,7 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function Rhs(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='Rhs') + result(ierr) bind(C, name='Rhs') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -147,13 +147,13 @@ program main print *, " " print *, "Analytical ODE test problem:" print '(2(a,f5.2),a)', " lambda = (", real(lambda), " , ", imag(lambda), " ) " - print '(2(a,es8.1))', " reltol = ",reltol,", abstol = ",abstol + print '(2(a,es8.1))', " reltol = ", reltol, ", abstol = ", abstol ! initialize SUNDIALS solution vector sunvec_y => FN_VNew_Complex(neq, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if y => FN_VGetFVec(sunvec_y) @@ -163,43 +163,43 @@ program main ! create ARKStep memory arkode_mem = FARKStepCreate(c_funloc(Rhs), c_null_funptr, T0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *,'ERROR: arkode_mem = NULL' - stop 1 + print *, 'ERROR: arkode_mem = NULL' + stop 1 end if ! main time-stepping loop: calls FARKodeEvolve to perform the integration, then ! prints results. Stops when the final time has been reached tcur(1) = T0 - dTout = (Tf-T0)/Nt - tout = T0+dTout + dTout = (Tf - T0)/Nt + tout = T0 + dTout yerrI = 0.d0 yerr2 = 0.d0 print *, " " print *, " t real(u) imag(u) error" print *, " -------------------------------------------" print '(5x,f4.1,2(2x,es9.2),2x,es8.1)', tcur(1), real(y%data(1)), imag(y%data(1)), 0.d0 - do iout = 1,Nt + do iout = 1, Nt - ! call integrator - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) - if (ierr /= 0) then - write(*,*) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' - stop 1 - endif + ! call integrator + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write (*, *) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if - ! compute/accumulate solution error - yerr = abs( y%data(1) - Sol(tcur(1)) ) - yerrI = max(yerrI, yerr) - yerr2 = yerr2 + yerr**2 + ! compute/accumulate solution error + yerr = abs(y%data(1) - Sol(tcur(1))) + yerrI = max(yerrI, yerr) + yerr2 = yerr2 + yerr**2 - ! print solution statistics - print '(5x,f4.1,2(2x,es9.2),2x,es8.1)', tcur(1), real(y%data(1)), imag(y%data(1)), yerr + ! print solution statistics + print '(5x,f4.1,2(2x,es9.2),2x,es8.1)', tcur(1), real(y%data(1)), imag(y%data(1)), yerr - ! update output time - tout = min(tout + dTout, Tf) + ! update output time + tout = min(tout + dTout, Tf) end do - yerr2 = dsqrt( yerr2 / Nt ) + yerr2 = dsqrt(yerr2/Nt) print *, " -------------------------------------------" ! diagnostics output @@ -214,7 +214,6 @@ program main end program main - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -248,9 +247,9 @@ subroutine ARKStepStats(arkode_mem) print *, ' ' print *, 'Final Solver Statistics:' - print '(4x,2(A,i4),A)' ,'Internal solver steps = ',nsteps(1),', (attempted = ',nst_a(1),')' - print '(4x,A,i5)' ,'Total RHS evals = ',nfe(1) - print '(4x,A,i5)' ,'Total number of error test failures =',netfails(1) + print '(4x,2(A,i4),A)', 'Internal solver steps = ', nsteps(1), ', (attempted = ', nst_a(1), ')' + print '(4x,A,i5)', 'Total RHS evals = ', nfe(1) + print '(4x,A,i5)', 'Total number of error test failures =', netfails(1) return diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 index c195ce2d12..71e577acd5 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -55,17 +55,17 @@ module ode_mod integer(c_long), parameter :: Nt = 100 ! total number of output times integer(c_int64_t), parameter :: Nvar = 3 ! number of solution fields integer(c_int64_t), parameter :: neq = N*Nvar ! total size of solution vector - real(c_double), parameter :: dx = 1.d0/(N-1) ! mesh spacing - real(c_double), parameter :: a = 0.6d0 ! constant forcing on u - real(c_double), parameter :: b = 2.d0 ! steady-state value of w - real(c_double), parameter :: du = 0.001d0 ! diffusion coeff for u - real(c_double), parameter :: dv = 0.001d0 ! diffusion coeff for v - real(c_double), parameter :: dw = 0.001d0 ! diffusion coeff for w - real(c_double), parameter :: ep = 1.d-5 ! stiffness parameter - real(c_double), parameter :: T0 = 0.d0 ! initial time - real(c_double), parameter :: Tf = 10.d0 ! final time - real(c_double), parameter :: reltol = 1.d-6 ! solver tolerances - real(c_double), parameter :: abstol = 1.d-10 + real(c_double), parameter :: dx = 1.d0/(N - 1) ! mesh spacing + real(c_double), parameter :: a = 0.6d0 ! constant forcing on u + real(c_double), parameter :: b = 2.d0 ! steady-state value of w + real(c_double), parameter :: du = 0.001d0 ! diffusion coeff for u + real(c_double), parameter :: dv = 0.001d0 ! diffusion coeff for v + real(c_double), parameter :: dw = 0.001d0 ! diffusion coeff for w + real(c_double), parameter :: ep = 1.d-5 ! stiffness parameter + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 10.d0 ! final time + real(c_double), parameter :: reltol = 1.d-6 ! solver tolerances + real(c_double), parameter :: abstol = 1.d-10 contains @@ -80,7 +80,7 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsImplicit(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsImplicit') + result(ierr) bind(C, name='RhsImplicit') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -106,27 +106,27 @@ integer(c_int) function RhsImplicit(tn, sunvec_y, sunvec_f, user_data) & call c_f_pointer(sunvec_f%content, f) ! iterate over domain, computing all equations - do i = 2,N-1 + do i = 2, N - 1 - ! set solution variable shortcuts - u = y%data(1,i) - v = y%data(2,i) - w = y%data(3,i) + ! set solution variable shortcuts + u = y%data(1, i) + v = y%data(2, i) + w = y%data(3, i) - ! Fill in ODE RHS for u - f%data(1,i) = a - (w+1.d0)*u + v*u*u + ! Fill in ODE RHS for u + f%data(1, i) = a - (w + 1.d0)*u + v*u*u - ! Fill in ODE RHS for v - f%data(2,i) = w*u - v*u*u + ! Fill in ODE RHS for v + f%data(2, i) = w*u - v*u*u - ! Fill in ODE RHS for w - f%data(3,i) = (b-w)/ep - w*u + ! Fill in ODE RHS for w + f%data(3, i) = (b - w)/ep - w*u end do ! enforce stationary boundary conditions - f%data(:,1) = 0.d0 - f%data(:,N) = 0.d0 + f%data(:, 1) = 0.d0 + f%data(:, N) = 0.d0 ! return success ierr = 0 @@ -144,7 +144,7 @@ end function RhsImplicit ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsExplicit(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsExplicit') + result(ierr) bind(C, name='RhsExplicit') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -170,18 +170,18 @@ integer(c_int) function RhsExplicit(tn, sunvec_y, sunvec_f, user_data) & call c_f_pointer(sunvec_f%content, f) ! set shortcut variables - dconst = (/ du/dx/dx, dv/dx/dx, dw/dx/dx /) + dconst = (/du/dx/dx, dv/dx/dx, dw/dx/dx/) ! Fill in diffusion RHS for each species - do j = 2,N-1 - do i = 1,Nvar - f%data(i,j) = (y%data(i,j-1) + y%data(i,j+1) - 2.d0*y%data(i,j))*dconst(i) - end do + do j = 2, N - 1 + do i = 1, Nvar + f%data(i, j) = (y%data(i, j - 1) + y%data(i, j + 1) - 2.d0*y%data(i, j))*dconst(i) + end do end do ! enforce stationary boundary conditions - f%data(:,1) = 0.d0 - f%data(:,N) = 0.d0 + f%data(:, 1) = 0.d0 + f%data(:, N) = 0.d0 ! return success ierr = 0 @@ -198,8 +198,8 @@ end function RhsExplicit ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & - user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='JacFn') + user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='JacFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -231,27 +231,27 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & call c_f_pointer(sunmat_J%content, J) ! iterate over domain, computing all Jacobian entries - do i = 2,N-1 + do i = 2, N - 1 - ! set solution variable shortcuts - u = y%data(1,i) - v = y%data(2,i) - w = y%data(3,i) + ! set solution variable shortcuts + u = y%data(1, i) + v = y%data(2, i) + w = y%data(3, i) - ! Fill in Jacobian of all variables wrt u - J%data(:,1,i) = (/ 2.d0*v*u - (w+1.d0), w - 2.d0*v*u, -w /) + ! Fill in Jacobian of all variables wrt u + J%data(:, 1, i) = (/2.d0*v*u - (w + 1.d0), w - 2.d0*v*u, -w/) - ! Fill in Jacobian of all variables wrt v - J%data(:,2,i) = (/ u*u, -u*u, 0.d0 /) + ! Fill in Jacobian of all variables wrt v + J%data(:, 2, i) = (/u*u, -u*u, 0.d0/) - ! Fill in Jacobian of all variables wrt w - J%data(:,3,i) = (/ -u, u, -1.d0/ep - u/) + ! Fill in Jacobian of all variables wrt w + J%data(:, 3, i) = (/-u, u, -1.d0/ep - u/) end do ! stationary boundary conditions - J%data(:,:,1) = 0.d0 - J%data(:,:,N) = 0.d0 + J%data(:, :, 1) = 0.d0 + J%data(:, :, N) = 0.d0 ! return success ierr = 0 @@ -280,13 +280,13 @@ program main real(c_double) :: pi, tcur(1), dTout, tout type(c_ptr) :: sunctx ! sundials context for the simulation - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + 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 ! solution vector, N and Nvar are set in the ode_mod module - real(c_double) :: y(Nvar,N) + real(c_double) :: y(Nvar, N) !======= Internals ============ @@ -295,93 +295,93 @@ program main print *, "1D Brusselator PDE test problem (F2003 with custom data structures):" print '(a,i5,a,i5)', " N = ", N, ", NEQ = ", neq print '(3(a,es9.2))', " problem parameters: a = ", a, ", b = ", b, ", ep = ", ep - print '(3(a,es10.3))', " diffusion coefficients: du = ",du,", dv = ",dv,", dw = ",dw - print '(2(a,es8.1))', " reltol = ",reltol,", abstol = ",abstol + print '(3(a,es10.3))', " diffusion coefficients: du = ", du, ", dv = ", dv, ", dw = ", dw + print '(2(a,es8.1))', " reltol = ", reltol, ", abstol = ", abstol ! create the SUNDIALS context for the simulation ierr = FSUNContext_Create(SUN_COMM_NULL, sunctx) if (ierr /= 0) then - write(*,*) 'Error in FSUNContext_Create' + write (*, *) 'Error in FSUNContext_Create' stop 1 end if ! initialize SUNDIALS solution vector sunvec_y => FN_VMake_Fortran(Nvar, N, y, sunctx) if (.not. associated(sunvec_y)) then - write(*,*) 'ERROR: sunvec = NULL' + write (*, *) 'ERROR: sunvec = NULL' stop 1 end if ! Set initial conditions into y pi = 4.d0*datan(1.d0) - do i = 1,N - y(1,i) = a + 0.1d0*sin(pi*i*dx) ! u - y(2,i) = b/a + 0.1d0*sin(pi*i*dx) ! v - y(3,i) = b + 0.1d0*sin(pi*i*dx) ! w + do i = 1, N + y(1, i) = a + 0.1d0*sin(pi*i*dx) ! u + y(2, i) = b/a + 0.1d0*sin(pi*i*dx) ! v + y(3, i) = b + 0.1d0*sin(pi*i*dx) ! w end do ! create ARKStep memory arkode_mem = FARKStepCreate(c_funloc(RhsExplicit), c_funloc(RhsImplicit), T0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *,'ERROR: arkode_mem = NULL' - stop 1 + print *, 'ERROR: arkode_mem = NULL' + stop 1 end if ! set routines ierr = FARKodeSStolerances(arkode_mem, reltol, abstol) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSStolerances' + write (*, *) 'Error in FARKodeSStolerances' stop 1 end if ! initialize custom matrix data structure and solver; attach to ARKODE sunmat_A => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sunmat_A)) then - print *,'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sunls => FSUNLinSolNew_Fortran(Nvar, N, sunctx) if (.not. associated(sunls)) then - print *,'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ! Attach matrix, linear solver, and Jacobian routine to linear solver interface ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSetLinearSolver' + write (*, *) 'Error in FARKodeSetLinearSolver' stop 1 end if ierr = FARKodeSetJacFn(arkode_mem, c_funloc(JacFn)) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSetJacFn' + write (*, *) 'Error in FARKodeSetJacFn' stop 1 end if ! main time-stepping loop: calls FARKodeEvolve to perform the integration, then ! prints results. Stops when the final time has been reached tcur(1) = T0 - dTout = (Tf-T0)/Nt - tout = T0+dTout + dTout = (Tf - T0)/Nt + tout = T0 + dTout print *, " t ||u||_rms ||v||_rms ||w||_rms" print *, " ----------------------------------------------" - do iout = 1,Nt + do iout = 1, Nt - ! call integrator - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) - if (ierr /= 0) then - write(*,*) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' - stop 1 - endif + ! call integrator + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write (*, *) 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if - ! access/print solution statistics - print '(4(2x,f10.6))', tcur(1), dsqrt(sum(y(1,:)**2)/N), & - dsqrt(sum(y(2,:)**2)/N), dsqrt(sum(y(3,:)**2)/N) + ! access/print solution statistics + print '(4(2x,f10.6))', tcur(1), dsqrt(sum(y(1, :)**2)/N), & + dsqrt(sum(y(2, :)**2)/N), dsqrt(sum(y(3, :)**2)/N) - ! update output time - tout = min(tout + dTout, Tf) + ! update output time + tout = min(tout + dTout, Tf) end do print *, " ----------------------------------------------" @@ -398,7 +398,6 @@ program main end program main - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -445,14 +444,14 @@ subroutine ARKStepStats(arkode_mem) print *, ' ' print *, 'Final Solver Statistics:' - print '(4x,2(A,i9),A)' ,'Internal solver steps = ',nsteps(1),', (attempted = ',nst_a(1),')' - print '(4x,2(A,i9))' ,'Total RHS evals: Fe = ',nfe(1),', Fi = ',nfi(1) - print '(4x,A,i9)' ,'Total linear solver setups =',nlinsetups(1) - print '(4x,A,i9)' ,'Total RHS evals for setting up the linear system =',nfeLS(1) - print '(4x,A,i9)' ,'Total number of Jacobian evaluations =',nje(1) - print '(4x,A,i9)' ,'Total number of Newton iterations =',nniters(1) - print '(4x,A,i9)' ,'Total number of nonlinear solver convergence failures =',nncfails(1) - print '(4x,A,i9)' ,'Total number of error test failures =',netfails(1) + print '(4x,2(A,i9),A)', 'Internal solver steps = ', nsteps(1), ', (attempted = ', nst_a(1), ')' + print '(4x,2(A,i9))', 'Total RHS evals: Fe = ', nfe(1), ', Fi = ', nfi(1) + print '(4x,A,i9)', 'Total linear solver setups =', nlinsetups(1) + print '(4x,A,i9)', 'Total RHS evals for setting up the linear system =', nfeLS(1) + print '(4x,A,i9)', 'Total number of Jacobian evaluations =', nje(1) + print '(4x,A,i9)', 'Total number of Newton iterations =', nniters(1) + print '(4x,A,i9)', 'Total number of nonlinear solver convergence failures =', nncfails(1) + print '(4x,A,i9)', 'Total number of error test failures =', netfails(1) print *, ' ' return diff --git a/examples/arkode/F2003_custom/fnvector_complex_mod.f90 b/examples/arkode/F2003_custom/fnvector_complex_mod.f90 index e762a3858d..d6d1c0f504 100644 --- a/examples/arkode/F2003_custom/fnvector_complex_mod.f90 +++ b/examples/arkode/F2003_custom/fnvector_complex_mod.f90 @@ -35,18 +35,18 @@ module fnvector_complex_mod function FN_VNew_Complex(n, sunctx) result(sunvec_y) implicit none - integer(c_int64_t), value :: n - type(c_ptr), value :: sunctx - type(N_Vector), pointer :: sunvec_y + integer(c_int64_t), value :: n + type(c_ptr), value :: sunctx + type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops - type(FVec), pointer :: content + type(FVec), pointer :: content ! allocate output N_Vector structure sunvec_y => FN_VNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) - allocate(content%data(n)) + allocate (content) + allocate (content%data(n)) content%own_data = .true. content%len = n @@ -55,31 +55,31 @@ function FN_VNew_Complex(n, sunctx) result(sunvec_y) ! access the N_Vector ops structure, and set internal function pointers call c_f_pointer(sunvec_y%ops, ops) - ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Complex) - ops%nvdestroy = c_funloc(FN_VDestroy_Complex) - ops%nvgetlength = c_funloc(FN_VGetLength_Complex) - ops%nvconst = c_funloc(FN_VConst_Complex) - ops%nvclone = c_funloc(FN_VClone_Complex) - ops%nvspace = c_funloc(FN_VSpace_Complex) - ops%nvlinearsum = c_funloc(FN_VLinearSum_Complex) - ops%nvprod = c_funloc(FN_VProd_Complex) - ops%nvdiv = c_funloc(FN_VDiv_Complex) - ops%nvscale = c_funloc(FN_VScale_Complex) - ops%nvabs = c_funloc(FN_VAbs_Complex) - ops%nvinv = c_funloc(FN_VInv_Complex) - ops%nvaddconst = c_funloc(FN_VAddConst_Complex) - ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Complex) - ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Complex) - ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Complex) - ops%nvmin = c_funloc(FN_VMin_Complex) - ops%nvwl2norm = c_funloc(FN_VWL2Norm_Complex) - ops%nvl1norm = c_funloc(FN_VL1Norm_Complex) - ops%nvinvtest = c_funloc(FN_VInvTest_Complex) - ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Complex) - ops%nvminlocal = c_funloc(FN_VMin_Complex) - ops%nvl1normlocal = c_funloc(FN_VL1Norm_Complex) - ops%nvinvtestlocal = c_funloc(FN_VInvTest_Complex) - ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Complex) + ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Complex) + ops%nvdestroy = c_funloc(FN_VDestroy_Complex) + ops%nvgetlength = c_funloc(FN_VGetLength_Complex) + ops%nvconst = c_funloc(FN_VConst_Complex) + ops%nvclone = c_funloc(FN_VClone_Complex) + ops%nvspace = c_funloc(FN_VSpace_Complex) + ops%nvlinearsum = c_funloc(FN_VLinearSum_Complex) + ops%nvprod = c_funloc(FN_VProd_Complex) + ops%nvdiv = c_funloc(FN_VDiv_Complex) + ops%nvscale = c_funloc(FN_VScale_Complex) + ops%nvabs = c_funloc(FN_VAbs_Complex) + ops%nvinv = c_funloc(FN_VInv_Complex) + ops%nvaddconst = c_funloc(FN_VAddConst_Complex) + ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Complex) + ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Complex) + ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Complex) + ops%nvmin = c_funloc(FN_VMin_Complex) + ops%nvwl2norm = c_funloc(FN_VWL2Norm_Complex) + ops%nvl1norm = c_funloc(FN_VL1Norm_Complex) + ops%nvinvtest = c_funloc(FN_VInvTest_Complex) + ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Complex) + ops%nvminlocal = c_funloc(FN_VMin_Complex) + ops%nvl1normlocal = c_funloc(FN_VL1Norm_Complex) + ops%nvinvtestlocal = c_funloc(FN_VInvTest_Complex) + ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Complex) ops%nvwsqrsummasklocal = c_funloc(FN_VWSqrSumMask_Complex) end function FN_VNew_Complex @@ -88,18 +88,18 @@ end function FN_VNew_Complex function FN_VMake_Complex(n, data, sunctx) result(sunvec_y) implicit none - integer(c_int64_t), value :: n - type(c_ptr), value :: sunctx - type(N_Vector), pointer :: sunvec_y - type(N_Vector_Ops), pointer :: ops - type(FVec), pointer :: content + integer(c_int64_t), value :: n + type(c_ptr), value :: sunctx + type(N_Vector), pointer :: sunvec_y + type(N_Vector_Ops), pointer :: ops + type(FVec), pointer :: content complex(c_double_complex), target :: data(:) ! allocate output N_Vector structure sunvec_y => FN_VNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) + allocate (content) content%own_data = .false. content%len = n content%data => data @@ -109,31 +109,31 @@ function FN_VMake_Complex(n, data, sunctx) result(sunvec_y) ! access the N_Vector ops structure, and set internal function pointers call c_f_pointer(sunvec_y%ops, ops) - ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Complex) - ops%nvdestroy = c_funloc(FN_VDestroy_Complex) - ops%nvgetlength = c_funloc(FN_VGetLength_Complex) - ops%nvconst = c_funloc(FN_VConst_Complex) - ops%nvclone = c_funloc(FN_VClone_Complex) - ops%nvspace = c_funloc(FN_VSpace_Complex) - ops%nvlinearsum = c_funloc(FN_VLinearSum_Complex) - ops%nvprod = c_funloc(FN_VProd_Complex) - ops%nvdiv = c_funloc(FN_VDiv_Complex) - ops%nvscale = c_funloc(FN_VScale_Complex) - ops%nvabs = c_funloc(FN_VAbs_Complex) - ops%nvinv = c_funloc(FN_VInv_Complex) - ops%nvaddconst = c_funloc(FN_VAddConst_Complex) - ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Complex) - ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Complex) - ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Complex) - ops%nvmin = c_funloc(FN_VMin_Complex) - ops%nvwl2norm = c_funloc(FN_VWL2Norm_Complex) - ops%nvl1norm = c_funloc(FN_VL1Norm_Complex) - ops%nvinvtest = c_funloc(FN_VInvTest_Complex) - ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Complex) - ops%nvminlocal = c_funloc(FN_VMin_Complex) - ops%nvl1normlocal = c_funloc(FN_VL1Norm_Complex) - ops%nvinvtestlocal = c_funloc(FN_VInvTest_Complex) - ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Complex) + ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Complex) + ops%nvdestroy = c_funloc(FN_VDestroy_Complex) + ops%nvgetlength = c_funloc(FN_VGetLength_Complex) + ops%nvconst = c_funloc(FN_VConst_Complex) + ops%nvclone = c_funloc(FN_VClone_Complex) + ops%nvspace = c_funloc(FN_VSpace_Complex) + ops%nvlinearsum = c_funloc(FN_VLinearSum_Complex) + ops%nvprod = c_funloc(FN_VProd_Complex) + ops%nvdiv = c_funloc(FN_VDiv_Complex) + ops%nvscale = c_funloc(FN_VScale_Complex) + ops%nvabs = c_funloc(FN_VAbs_Complex) + ops%nvinv = c_funloc(FN_VInv_Complex) + ops%nvaddconst = c_funloc(FN_VAddConst_Complex) + ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Complex) + ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Complex) + ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Complex) + ops%nvmin = c_funloc(FN_VMin_Complex) + ops%nvwl2norm = c_funloc(FN_VWL2Norm_Complex) + ops%nvl1norm = c_funloc(FN_VL1Norm_Complex) + ops%nvinvtest = c_funloc(FN_VInvTest_Complex) + ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Complex) + ops%nvminlocal = c_funloc(FN_VMin_Complex) + ops%nvl1normlocal = c_funloc(FN_VL1Norm_Complex) + ops%nvinvtestlocal = c_funloc(FN_VInvTest_Complex) + ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Complex) ops%nvwsqrsummasklocal = c_funloc(FN_VWSqrSumMask_Complex) end function FN_VMake_Complex @@ -169,16 +169,16 @@ subroutine FN_VDestroy_Complex(sunvec_y) bind(C) implicit none type(N_Vector), target :: sunvec_y - type(FVec), pointer :: y + type(FVec), pointer :: y ! access FVec structure y => FN_VGetFVec(sunvec_y) ! if vector owns the data, then deallocate - if (y%own_data) deallocate(y%data) + if (y%own_data) deallocate (y%data) ! deallocate the underlying Fortran object (the content) - deallocate(y) + deallocate (y) ! set N_Vector structure members to NULL and return sunvec_y%content = C_NULL_PTR @@ -192,11 +192,11 @@ end subroutine FN_VDestroy_Complex ! ---------------------------------------------------------------- integer(c_int64_t) function FN_VGetLength_Complex(sunvec_y) & - bind(C) result(length) + bind(C) result(length) implicit none type(N_Vector) :: sunvec_y - type(FVec), pointer :: y + type(FVec), pointer :: y y => FN_VGetFVec(sunvec_y) length = y%len @@ -210,7 +210,7 @@ subroutine FN_VConst_Complex(const, sunvec_y) bind(C) implicit none type(N_Vector) :: sunvec_y real(c_double), value :: const - type(FVec), pointer :: y + type(FVec), pointer :: y ! extract Fortran vector structure to work with y => FN_VGetFVec(sunvec_y) @@ -229,7 +229,7 @@ function FN_VClone_Complex(sunvec_x) result(y_ptr) bind(C) type(N_Vector), pointer :: sunvec_y type(c_ptr) :: y_ptr integer(c_int) :: retval - type(FVec), pointer :: x, y + type(FVec), pointer :: x, y ! extract Fortran vector structure to work with x => FN_VGetFVec(sunvec_x) @@ -241,8 +241,8 @@ function FN_VClone_Complex(sunvec_x) result(y_ptr) bind(C) retval = FN_VCopyOps(sunvec_x, sunvec_y) ! allocate and clone content structure - allocate(y) - allocate(y%data(x%len)) + allocate (y) + allocate (y%data(x%len)) y%own_data = .true. y%len = x%len @@ -276,7 +276,7 @@ end subroutine FN_VSpace_Complex ! ---------------------------------------------------------------- subroutine FN_VLinearSum_Complex(a, sunvec_x, b, sunvec_y, sunvec_z) & - bind(C) + bind(C) implicit none type(N_Vector) :: sunvec_x @@ -284,7 +284,7 @@ subroutine FN_VLinearSum_Complex(a, sunvec_x, b, sunvec_y, sunvec_z) & type(N_Vector) :: sunvec_z real(c_double), value :: a real(c_double), value :: b - type(FVec), pointer :: x, y, z + type(FVec), pointer :: x, y, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -312,7 +312,7 @@ subroutine FN_VProd_Complex(sunvec_x, sunvec_y, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = x%data * y%data + z%data = x%data*y%data return end subroutine FN_VProd_Complex @@ -332,7 +332,7 @@ subroutine FN_VDiv_Complex(sunvec_x, sunvec_y, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = x%data / y%data + z%data = x%data/y%data return end subroutine FN_VDiv_Complex @@ -344,14 +344,14 @@ subroutine FN_VScale_Complex(c, sunvec_x, sunvec_z) bind(C) real(c_double), value :: c type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z - type(FVec), pointer :: x, z + type(FVec), pointer :: x, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = c * x%data + z%data = c*x%data return end subroutine FN_VScale_Complex @@ -387,7 +387,7 @@ subroutine FN_VInv_Complex(sunvec_x, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = 1.d0 / x%data + z%data = 1.d0/x%data return end subroutine FN_VInv_Complex @@ -399,7 +399,7 @@ subroutine FN_VAddConst_Complex(sunvec_x, b, sunvec_z) bind(C) type(N_Vector) :: sunvec_x real(c_double), value :: b type(N_Vector) :: sunvec_z - type(FVec), pointer :: x, z + type(FVec), pointer :: x, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -413,7 +413,7 @@ end subroutine FN_VAddConst_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VMaxNorm_Complex(sunvec_x) & - result(maxnorm) bind(C) + result(maxnorm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -430,7 +430,7 @@ end function FN_VMaxNorm_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VWSqrSum_Complex(sunvec_x, sunvec_w) & - result(sqrsum) bind(C) + result(sqrsum) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -442,14 +442,14 @@ real(c_double) function FN_VWSqrSum_Complex(sunvec_x, sunvec_w) & w => FN_VGetFVec(sunvec_w) ! perform computation (via whole array ops) and return - sqrsum = sum(abs(x%data)**2 * abs(w%data)**2) + sqrsum = sum(abs(x%data)**2*abs(w%data)**2) return end function FN_VWSqrSum_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VWSqrSumMask_Complex(sunvec_x, sunvec_w, sunvec_id) & - result(sqrsum) bind(C) + result(sqrsum) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -465,10 +465,10 @@ real(c_double) function FN_VWSqrSumMask_Complex(sunvec_x, sunvec_w, sunvec_id) & ! perform computation and return sqrsum = 0.d0 - do i = 1,x%len - if (real(id%data(i)) > 0.d0) then - sqrsum = sqrsum + (abs(x%data(i)) * abs(w%data(i)))**2 - end if + do i = 1, x%len + if (real(id%data(i)) > 0.d0) then + sqrsum = sqrsum + (abs(x%data(i))*abs(w%data(i)))**2 + end if end do return @@ -476,7 +476,7 @@ end function FN_VWSqrSumMask_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VWRMSNorm_Complex(sunvec_x, sunvec_w) & - result(wrmsnorm) bind(C) + result(wrmsnorm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -487,14 +487,14 @@ real(c_double) function FN_VWRMSNorm_Complex(sunvec_x, sunvec_w) & x => FN_VGetFVec(sunvec_x) ! postprocess result from FN_VWSqrSum for result - wrmsnorm = dsqrt( FN_VWSqrSum_Complex(sunvec_x, sunvec_w) / x%len ) + wrmsnorm = dsqrt(FN_VWSqrSum_Complex(sunvec_x, sunvec_w)/x%len) return end function FN_VWRMSNorm_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VWRMSNormMask_Complex(sunvec_x, sunvec_w, sunvec_id) & - result(wrmsnorm) bind(C) + result(wrmsnorm) bind(C) implicit none type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_w @@ -505,14 +505,14 @@ real(c_double) function FN_VWRMSNormMask_Complex(sunvec_x, sunvec_w, sunvec_id) x => FN_VGetFVec(sunvec_x) ! postprocess result from FN_VWSqrSumMask for result - wrmsnorm = dsqrt( FN_VWSqrSumMask_Complex(sunvec_x, sunvec_w, sunvec_id) / x%len ) + wrmsnorm = dsqrt(FN_VWSqrSumMask_Complex(sunvec_x, sunvec_w, sunvec_id)/x%len) return end function FN_VWRMSNormMask_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VMin_Complex(sunvec_x) & - result(mnval) bind(C) + result(mnval) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -530,7 +530,7 @@ end function FN_VMin_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VWL2Norm_Complex(sunvec_x, sunvec_w) & - result(wl2norm) bind(C) + result(wl2norm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -548,7 +548,7 @@ end function FN_VWL2Norm_Complex ! ---------------------------------------------------------------- real(c_double) function FN_VL1Norm_Complex(sunvec_x) & - result(l1norm) bind(C) + result(l1norm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -565,7 +565,7 @@ end function FN_VL1Norm_Complex ! ---------------------------------------------------------------- integer(c_int) function FN_VInvTest_Complex(sunvec_x, sunvec_z) & - result(no_zero_found) bind(C) + result(no_zero_found) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -579,12 +579,12 @@ integer(c_int) function FN_VInvTest_Complex(sunvec_x, sunvec_z) & ! perform operation and return no_zero_found = 1 - do i = 1,x%len - if (x%data(i) == dcmplx(0.d0, 0.d0)) then - no_zero_found = 0 - else - z%data(i) = 1.d0 / x%data(i) - end if + do i = 1, x%len + if (x%data(i) == dcmplx(0.d0, 0.d0)) then + no_zero_found = 0 + else + z%data(i) = 1.d0/x%data(i) + end if end do return diff --git a/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 b/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 index 3264f75a5d..163885792b 100644 --- a/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fnvector_fortran_mod.f90 @@ -27,7 +27,7 @@ module fnvector_fortran_mod logical :: own_data integer(c_int64_t) :: length1 integer(c_int64_t) :: length2 - real(c_double), pointer :: data(:,:) + real(c_double), pointer :: data(:, :) end type FVec ! ---------------------------------------------------------------- @@ -36,60 +36,60 @@ module fnvector_fortran_mod ! ---------------------------------------------------------------- function FN_VNew_Fortran(n1, n2, sunctx) result(sunvec_y) implicit none - integer(c_int64_t), value :: n1 - integer(c_int64_t), value :: n2 - type(c_ptr), value :: sunctx - type(N_Vector), pointer :: sunvec_y + integer(c_int64_t), value :: n1 + integer(c_int64_t), value :: n2 + type(c_ptr), value :: sunctx + type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops - type(FVec), pointer :: content + type(FVec), pointer :: content ! allocate output N_Vector structure sunvec_y => FN_VNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) - allocate(content%data(n1,n2)) + allocate (content) + allocate (content%data(n1, n2)) content%own_data = .true. - content%length1 = n1 - content%length2 = n2 + content%length1 = n1 + content%length2 = n2 ! attach the content structure to the output N_Vector sunvec_y%content = c_loc(content) ! access the N_Vector ops structure, and set internal function pointers call c_f_pointer(sunvec_y%ops, ops) - ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Fortran) - ops%nvdestroy = c_funloc(FN_VDestroy_Fortran) - ops%nvgetlength = c_funloc(FN_VGetLength_Fortran) - ops%nvconst = c_funloc(FN_VConst_Fortran) - ops%nvdotprod = c_funloc(FN_VDotProd_Fortran) - ops%nvclone = c_funloc(FN_VClone_Fortran) - ops%nvspace = c_funloc(FN_VSpace_Fortran) - ops%nvlinearsum = c_funloc(FN_VLinearSum_Fortran) - ops%nvprod = c_funloc(FN_VProd_Fortran) - ops%nvdiv = c_funloc(FN_VDiv_Fortran) - ops%nvscale = c_funloc(FN_VScale_Fortran) - ops%nvabs = c_funloc(FN_VAbs_Fortran) - ops%nvinv = c_funloc(FN_VInv_Fortran) - ops%nvaddconst = c_funloc(FN_VAddConst_Fortran) - ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Fortran) - ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Fortran) - ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Fortran) - ops%nvmin = c_funloc(FN_VMin_Fortran) - ops%nvwl2norm = c_funloc(FN_VWL2Norm_Fortran) - ops%nvl1norm = c_funloc(FN_VL1Norm_Fortran) - ops%nvcompare = c_funloc(FN_VCompare_Fortran) - ops%nvinvtest = c_funloc(FN_VInvTest_Fortran) - ops%nvconstrmask = c_funloc(FN_VConstrMask_Fortran) - ops%nvminquotient = c_funloc(FN_VMinQuotient_Fortran) - ops%nvdotprodlocal = c_funloc(FN_VDotProd_Fortran) - ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Fortran) - ops%nvminlocal = c_funloc(FN_VMin_Fortran) - ops%nvl1normlocal = c_funloc(FN_VL1Norm_Fortran) - ops%nvinvtestlocal = c_funloc(FN_VInvTest_Fortran) - ops%nvconstrmasklocal = c_funloc(FN_VConstrMask_Fortran) + ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Fortran) + ops%nvdestroy = c_funloc(FN_VDestroy_Fortran) + ops%nvgetlength = c_funloc(FN_VGetLength_Fortran) + ops%nvconst = c_funloc(FN_VConst_Fortran) + ops%nvdotprod = c_funloc(FN_VDotProd_Fortran) + ops%nvclone = c_funloc(FN_VClone_Fortran) + ops%nvspace = c_funloc(FN_VSpace_Fortran) + ops%nvlinearsum = c_funloc(FN_VLinearSum_Fortran) + ops%nvprod = c_funloc(FN_VProd_Fortran) + ops%nvdiv = c_funloc(FN_VDiv_Fortran) + ops%nvscale = c_funloc(FN_VScale_Fortran) + ops%nvabs = c_funloc(FN_VAbs_Fortran) + ops%nvinv = c_funloc(FN_VInv_Fortran) + ops%nvaddconst = c_funloc(FN_VAddConst_Fortran) + ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Fortran) + ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Fortran) + ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Fortran) + ops%nvmin = c_funloc(FN_VMin_Fortran) + ops%nvwl2norm = c_funloc(FN_VWL2Norm_Fortran) + ops%nvl1norm = c_funloc(FN_VL1Norm_Fortran) + ops%nvcompare = c_funloc(FN_VCompare_Fortran) + ops%nvinvtest = c_funloc(FN_VInvTest_Fortran) + ops%nvconstrmask = c_funloc(FN_VConstrMask_Fortran) + ops%nvminquotient = c_funloc(FN_VMinQuotient_Fortran) + ops%nvdotprodlocal = c_funloc(FN_VDotProd_Fortran) + ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Fortran) + ops%nvminlocal = c_funloc(FN_VMin_Fortran) + ops%nvl1normlocal = c_funloc(FN_VL1Norm_Fortran) + ops%nvinvtestlocal = c_funloc(FN_VInvTest_Fortran) + ops%nvconstrmasklocal = c_funloc(FN_VConstrMask_Fortran) ops%nvminquotientlocal = c_funloc(FN_VMinQuotient_Fortran) - ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Fortran) + ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Fortran) ops%nvwsqrsummasklocal = c_funloc(FN_VWSqrSumMask_Fortran) end function FN_VNew_Fortran @@ -97,61 +97,61 @@ end function FN_VNew_Fortran ! ---------------------------------------------------------------- function FN_VMake_Fortran(n1, n2, data, sunctx) result(sunvec_y) implicit none - integer(c_int64_t), value :: n1 - integer(c_int64_t), value :: n2 - type(c_ptr), value :: sunctx - type(N_Vector), pointer :: sunvec_y + integer(c_int64_t), value :: n1 + integer(c_int64_t), value :: n2 + type(c_ptr), value :: sunctx + type(N_Vector), pointer :: sunvec_y type(N_Vector_Ops), pointer :: ops - type(FVec), pointer :: content - real(c_double), target :: data(:,:) + type(FVec), pointer :: content + real(c_double), target :: data(:, :) ! allocate output N_Vector structure sunvec_y => FN_VNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) + allocate (content) content%own_data = .false. - content%length1 = n1 - content%length2 = n2 - content%data => data + content%length1 = n1 + content%length2 = n2 + content%data => data ! attach the content structure to the output N_Vector sunvec_y%content = c_loc(content) ! access the N_Vector ops structure, and set internal function pointers call c_f_pointer(sunvec_y%ops, ops) - ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Fortran) - ops%nvdestroy = c_funloc(FN_VDestroy_Fortran) - ops%nvgetlength = c_funloc(FN_VGetLength_Fortran) - ops%nvconst = c_funloc(FN_VConst_Fortran) - ops%nvdotprod = c_funloc(FN_VDotProd_Fortran) - ops%nvclone = c_funloc(FN_VClone_Fortran) - ops%nvspace = c_funloc(FN_VSpace_Fortran) - ops%nvlinearsum = c_funloc(FN_VLinearSum_Fortran) - ops%nvprod = c_funloc(FN_VProd_Fortran) - ops%nvdiv = c_funloc(FN_VDiv_Fortran) - ops%nvscale = c_funloc(FN_VScale_Fortran) - ops%nvabs = c_funloc(FN_VAbs_Fortran) - ops%nvinv = c_funloc(FN_VInv_Fortran) - ops%nvaddconst = c_funloc(FN_VAddConst_Fortran) - ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Fortran) - ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Fortran) - ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Fortran) - ops%nvmin = c_funloc(FN_VMin_Fortran) - ops%nvwl2norm = c_funloc(FN_VWL2Norm_Fortran) - ops%nvl1norm = c_funloc(FN_VL1Norm_Fortran) - ops%nvcompare = c_funloc(FN_VCompare_Fortran) - ops%nvinvtest = c_funloc(FN_VInvTest_Fortran) - ops%nvconstrmask = c_funloc(FN_VConstrMask_Fortran) - ops%nvminquotient = c_funloc(FN_VMinQuotient_Fortran) - ops%nvdotprodlocal = c_funloc(FN_VDotProd_Fortran) - ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Fortran) - ops%nvminlocal = c_funloc(FN_VMin_Fortran) - ops%nvl1normlocal = c_funloc(FN_VL1Norm_Fortran) - ops%nvinvtestlocal = c_funloc(FN_VInvTest_Fortran) - ops%nvconstrmasklocal = c_funloc(FN_VConstrMask_Fortran) + ops%nvgetvectorid = c_funloc(FN_VGetVectorID_Fortran) + ops%nvdestroy = c_funloc(FN_VDestroy_Fortran) + ops%nvgetlength = c_funloc(FN_VGetLength_Fortran) + ops%nvconst = c_funloc(FN_VConst_Fortran) + ops%nvdotprod = c_funloc(FN_VDotProd_Fortran) + ops%nvclone = c_funloc(FN_VClone_Fortran) + ops%nvspace = c_funloc(FN_VSpace_Fortran) + ops%nvlinearsum = c_funloc(FN_VLinearSum_Fortran) + ops%nvprod = c_funloc(FN_VProd_Fortran) + ops%nvdiv = c_funloc(FN_VDiv_Fortran) + ops%nvscale = c_funloc(FN_VScale_Fortran) + ops%nvabs = c_funloc(FN_VAbs_Fortran) + ops%nvinv = c_funloc(FN_VInv_Fortran) + ops%nvaddconst = c_funloc(FN_VAddConst_Fortran) + ops%nvmaxnorm = c_funloc(FN_VMaxNorm_Fortran) + ops%nvwrmsnorm = c_funloc(FN_VWRMSNorm_Fortran) + ops%nvwrmsnormmask = c_funloc(FN_VWRMSNormMask_Fortran) + ops%nvmin = c_funloc(FN_VMin_Fortran) + ops%nvwl2norm = c_funloc(FN_VWL2Norm_Fortran) + ops%nvl1norm = c_funloc(FN_VL1Norm_Fortran) + ops%nvcompare = c_funloc(FN_VCompare_Fortran) + ops%nvinvtest = c_funloc(FN_VInvTest_Fortran) + ops%nvconstrmask = c_funloc(FN_VConstrMask_Fortran) + ops%nvminquotient = c_funloc(FN_VMinQuotient_Fortran) + ops%nvdotprodlocal = c_funloc(FN_VDotProd_Fortran) + ops%nvmaxnormlocal = c_funloc(FN_VMaxNorm_Fortran) + ops%nvminlocal = c_funloc(FN_VMin_Fortran) + ops%nvl1normlocal = c_funloc(FN_VL1Norm_Fortran) + ops%nvinvtestlocal = c_funloc(FN_VInvTest_Fortran) + ops%nvconstrmasklocal = c_funloc(FN_VConstrMask_Fortran) ops%nvminquotientlocal = c_funloc(FN_VMinQuotient_Fortran) - ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Fortran) + ops%nvwsqrsumlocal = c_funloc(FN_VWSqrSum_Fortran) ops%nvwsqrsummasklocal = c_funloc(FN_VWSqrSumMask_Fortran) end function FN_VMake_Fortran @@ -160,7 +160,7 @@ end function FN_VMake_Fortran function FN_VGetFVec(sunvec_x) result(x) implicit none type(N_Vector) :: sunvec_x - type(FVec), pointer :: x + type(FVec), pointer :: x ! extract Fortran matrix structure to output call c_f_pointer(sunvec_x%content, x) @@ -184,16 +184,16 @@ end function FN_VGetVectorID_Fortran subroutine FN_VDestroy_Fortran(sunvec_y) bind(C) implicit none type(N_Vector), target :: sunvec_y - type(FVec), pointer :: y + type(FVec), pointer :: y ! access FVec structure y => FN_VGetFVec(sunvec_y) ! if vector owns the data, then deallocate - if (y%own_data) deallocate(y%data) + if (y%own_data) deallocate (y%data) ! deallocate the underlying Fortran object (the content) - deallocate(y) + deallocate (y) ! set N_Vector structure members to NULL and return sunvec_y%content = C_NULL_PTR @@ -207,7 +207,7 @@ end subroutine FN_VDestroy_Fortran ! ---------------------------------------------------------------- integer(c_int64_t) function FN_VGetLength_Fortran(sunvec_y) & - bind(C) result(length) + bind(C) result(length) implicit none type(N_Vector) :: sunvec_y @@ -224,7 +224,7 @@ subroutine FN_VConst_Fortran(const, sunvec_y) bind(C) implicit none type(N_Vector) :: sunvec_y real(c_double), value :: const - type(FVec), pointer :: y + type(FVec), pointer :: y ! extract Fortran vector structure to work with y => FN_VGetFVec(sunvec_y) @@ -240,14 +240,14 @@ real(c_double) function FN_VDotProd_Fortran(sunvec_x, sunvec_y) & result(a) bind(C) implicit none type(N_Vector) :: sunvec_x, sunvec_y - type(FVec), pointer :: x, y + type(FVec), pointer :: x, y ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) y => FN_VGetFVec(sunvec_y) ! do the dot product via Fortran intrinsics - a = sum(x%data * y%data) + a = sum(x%data*y%data) return end function FN_VDotProd_Fortran @@ -259,7 +259,7 @@ function FN_VClone_Fortran(sunvec_x) result(y_ptr) bind(C) type(N_Vector), pointer :: sunvec_y type(c_ptr) :: y_ptr integer(c_int) :: retval - type(FVec), pointer :: x, y + type(FVec), pointer :: x, y ! extract Fortran vector structure to work with x => FN_VGetFVec(sunvec_x) @@ -271,8 +271,8 @@ function FN_VClone_Fortran(sunvec_x) result(y_ptr) bind(C) retval = FN_VCopyOps(sunvec_x, sunvec_y) ! allocate and clone content structure - allocate(y) - allocate(y%data(x%length1,x%length2)) + allocate (y) + allocate (y%data(x%length1, x%length2)) y%own_data = .true. y%length1 = x%length1 y%length2 = x%length2 @@ -306,7 +306,7 @@ end subroutine FN_VSpace_Fortran ! ---------------------------------------------------------------- subroutine FN_VLinearSum_Fortran(a, sunvec_x, b, sunvec_y, sunvec_z) & - bind(C) + bind(C) implicit none type(N_Vector) :: sunvec_x @@ -314,7 +314,7 @@ subroutine FN_VLinearSum_Fortran(a, sunvec_x, b, sunvec_y, sunvec_z) & type(N_Vector) :: sunvec_z real(c_double), value :: a real(c_double), value :: b - type(FVec), pointer :: x, y, z + type(FVec), pointer :: x, y, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -341,7 +341,7 @@ subroutine FN_VProd_Fortran(sunvec_x, sunvec_y, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = x%data * y%data + z%data = x%data*y%data return end subroutine FN_VProd_Fortran @@ -360,7 +360,7 @@ subroutine FN_VDiv_Fortran(sunvec_x, sunvec_y, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = x%data / y%data + z%data = x%data/y%data return end subroutine FN_VDiv_Fortran @@ -371,14 +371,14 @@ subroutine FN_VScale_Fortran(c, sunvec_x, sunvec_z) bind(C) real(c_double), value :: c type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z - type(FVec), pointer :: x, z + type(FVec), pointer :: x, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = c * x%data + z%data = c*x%data return end subroutine FN_VScale_Fortran @@ -412,7 +412,7 @@ subroutine FN_VInv_Fortran(sunvec_x, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform computation (via whole array ops) and return - z%data = 1.d0 / x%data + z%data = 1.d0/x%data return end subroutine FN_VInv_Fortran @@ -423,7 +423,7 @@ subroutine FN_VAddConst_Fortran(sunvec_x, b, sunvec_z) bind(C) type(N_Vector) :: sunvec_x real(c_double), value :: b type(N_Vector) :: sunvec_z - type(FVec), pointer :: x, z + type(FVec), pointer :: x, z ! extract Fortran vector structures to work with x => FN_VGetFVec(sunvec_x) @@ -437,7 +437,7 @@ end subroutine FN_VAddConst_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VMaxNorm_Fortran(sunvec_x) & - result(maxnorm) bind(C) + result(maxnorm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -454,7 +454,7 @@ end function FN_VMaxNorm_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VWSqrSum_Fortran(sunvec_x, sunvec_w) & - result(sqrsum) bind(C) + result(sqrsum) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -466,14 +466,14 @@ real(c_double) function FN_VWSqrSum_Fortran(sunvec_x, sunvec_w) & w => FN_VGetFVec(sunvec_w) ! perform computation (via whole array ops) and return - sqrsum = sum(x%data * x%data * w%data * w%data) + sqrsum = sum(x%data*x%data*w%data*w%data) return end function FN_VWSqrSum_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VWSqrSumMask_Fortran(sunvec_x, sunvec_w, sunvec_id) & - result(sqrsum) bind(C) + result(sqrsum) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -489,12 +489,12 @@ real(c_double) function FN_VWSqrSumMask_Fortran(sunvec_x, sunvec_w, sunvec_id) & ! perform computation and return sqrsum = 0.d0 - do j = 1,x%length2 - do i = 1,x%length1 - if (id%data(i,j) > 0.d0) then - sqrsum = sqrsum + (x%data(i,j) * w%data(i,j))**2 - end if - end do + do j = 1, x%length2 + do i = 1, x%length1 + if (id%data(i, j) > 0.d0) then + sqrsum = sqrsum + (x%data(i, j)*w%data(i, j))**2 + end if + end do end do return @@ -502,7 +502,7 @@ end function FN_VWSqrSumMask_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VWRMSNorm_Fortran(sunvec_x, sunvec_w) & - result(wrmsnorm) bind(C) + result(wrmsnorm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -513,14 +513,14 @@ real(c_double) function FN_VWRMSNorm_Fortran(sunvec_x, sunvec_w) & x => FN_VGetFVec(sunvec_x) ! postprocess result from FN_VWSqrSum for result - wrmsnorm = dsqrt( FN_VWSqrSum_Fortran(sunvec_x, sunvec_w) / (x%length1 * x%length2) ) + wrmsnorm = dsqrt(FN_VWSqrSum_Fortran(sunvec_x, sunvec_w)/(x%length1*x%length2)) return end function FN_VWRMSNorm_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VWRMSNormMask_Fortran(sunvec_x, sunvec_w, sunvec_id) & - result(wrmsnorm) bind(C) + result(wrmsnorm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -532,14 +532,14 @@ real(c_double) function FN_VWRMSNormMask_Fortran(sunvec_x, sunvec_w, sunvec_id) x => FN_VGetFVec(sunvec_x) ! postprocess result from FN_VWSqrSumMask for result - wrmsnorm = dsqrt( FN_VWSqrSumMask_Fortran(sunvec_x, sunvec_w, sunvec_id) / (x%length1 * x%length2) ) + wrmsnorm = dsqrt(FN_VWSqrSumMask_Fortran(sunvec_x, sunvec_w, sunvec_id)/(x%length1*x%length2)) return end function FN_VWRMSNormMask_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VMin_Fortran(sunvec_x) & - result(mnval) bind(C) + result(mnval) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -556,7 +556,7 @@ end function FN_VMin_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VWL2Norm_Fortran(sunvec_x, sunvec_w) & - result(wl2norm) bind(C) + result(wl2norm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -574,7 +574,7 @@ end function FN_VWL2Norm_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VL1Norm_Fortran(sunvec_x) & - result(l1norm) bind(C) + result(l1norm) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -595,7 +595,7 @@ subroutine FN_VCompare_Fortran(c, sunvec_x, sunvec_z) bind(C) real(c_double), value :: c type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_z - type(FVec), pointer :: x, z + type(FVec), pointer :: x, z integer(c_int64_t) :: i, j ! extract Fortran vector structures to work with @@ -603,14 +603,14 @@ subroutine FN_VCompare_Fortran(c, sunvec_x, sunvec_z) bind(C) z => FN_VGetFVec(sunvec_z) ! perform operation and return - do j = 1,x%length2 - do i = 1,x%length1 - if (abs(x%data(i,j)) .ge. c) then - z%data(i,j) = 1.d0 - else - z%data(i,j) = 0.d0 - end if - end do + do j = 1, x%length2 + do i = 1, x%length1 + if (abs(x%data(i, j)) >= c) then + z%data(i, j) = 1.d0 + else + z%data(i, j) = 0.d0 + end if + end do end do return @@ -618,7 +618,7 @@ end subroutine FN_VCompare_Fortran ! ---------------------------------------------------------------- integer(c_int) function FN_VInvTest_Fortran(sunvec_x, sunvec_z) & - result(no_zero_found) bind(C) + result(no_zero_found) bind(C) implicit none type(N_Vector) :: sunvec_x @@ -632,14 +632,14 @@ integer(c_int) function FN_VInvTest_Fortran(sunvec_x, sunvec_z) & ! perform operation and return no_zero_found = 1 - do j = 1,x%length2 - do i = 1,x%length1 - if (x%data(i,j) == 0.d0) then - no_zero_found = 0 - else - z%data(i,j) = 1.d0 / x%data(i,j) - end if - end do + do j = 1, x%length2 + do i = 1, x%length1 + if (x%data(i, j) == 0.d0) then + no_zero_found = 0 + else + z%data(i, j) = 1.d0/x%data(i, j) + end if + end do end do return @@ -647,7 +647,7 @@ end function FN_VInvTest_Fortran ! ---------------------------------------------------------------- integer(c_int) function FN_VConstrMask_Fortran(sunvec_c, sunvec_x, sunvec_m) & - result(all_good) bind(C) + result(all_good) bind(C) implicit none type(N_Vector) :: sunvec_c @@ -664,21 +664,21 @@ integer(c_int) function FN_VConstrMask_Fortran(sunvec_c, sunvec_x, sunvec_m) & ! perform operation and return all_good = 1 - do j = 1,x%length2 - do i = 1,x%length1 - m%data(i,j) = 0.d0 - - ! continue if no constraints were set for this variable - if (c%data(i,j) == 0.d0) cycle - - ! check if a set constraint has been violated - test = ((dabs(c%data(i,j)) > 1.5d0 .and. x%data(i,j)*c%data(i,j) .le. 0.d0) .or. & - (dabs(c%data(i,j)) > 0.5d0 .and. x%data(i,j)*c%data(i,j) < 0.d0)) - if (test) then - all_good = 0 - m%data(i,j) = 1.d0 - end if - end do + do j = 1, x%length2 + do i = 1, x%length1 + m%data(i, j) = 0.d0 + + ! continue if no constraints were set for this variable + if (c%data(i, j) == 0.d0) cycle + + ! check if a set constraint has been violated + test = ((dabs(c%data(i, j)) > 1.5d0 .and. x%data(i, j)*c%data(i, j) <= 0.d0) .or. & + (dabs(c%data(i, j)) > 0.5d0 .and. x%data(i, j)*c%data(i, j) < 0.d0)) + if (test) then + all_good = 0 + m%data(i, j) = 1.d0 + end if + end do end do return @@ -686,7 +686,7 @@ end function FN_VConstrMask_Fortran ! ---------------------------------------------------------------- real(c_double) function FN_VMinQuotient_Fortran(sunvec_n, sunvec_d) & - result(minq) bind(C) + result(minq) bind(C) implicit none type(N_Vector) :: sunvec_n @@ -704,20 +704,20 @@ real(c_double) function FN_VMinQuotient_Fortran(sunvec_n, sunvec_d) & minq = 1.d307 ! perform operation and return - do j = 1,n%length2 - do i = 1,n%length1 - - ! skip locations with zero-valued denominator - if (d%data(i,j) == 0.d0) cycle - - ! store the first quotient value - if (notEvenOnce) then - minq = n%data(i,j)/d%data(i,j) - notEvenOnce = .false. - else - minq = min(minq, n%data(i,j)/d%data(i,j)) - end if - end do + do j = 1, n%length2 + do i = 1, n%length1 + + ! skip locations with zero-valued denominator + if (d%data(i, j) == 0.d0) cycle + + ! store the first quotient value + if (notEvenOnce) then + minq = n%data(i, j)/d%data(i, j) + notEvenOnce = .false. + else + minq = min(minq, n%data(i, j)/d%data(i, j)) + end if + end do end do return diff --git a/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 b/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 index 9da06d3ea9..f9ddcbe404 100644 --- a/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fsunlinsol_fortran_mod.f90 @@ -30,9 +30,9 @@ module fsunlinsol_fortran_mod ! ---------------------------------------------------------------- type, public :: FLinSol - integer(c_int64_t) :: Nvar - integer(c_int64_t) :: N - integer(c_int64_t), allocatable :: pivots(:,:) + integer(c_int64_t) :: Nvar + integer(c_int64_t) :: N + integer(c_int64_t), allocatable :: pivots(:, :) end type FLinSol ! ---------------------------------------------------------------- @@ -42,21 +42,21 @@ module fsunlinsol_fortran_mod function FSUNLinSolNew_Fortran(Nvar, N, sunctx) result(sunls_S) implicit none - integer(c_int64_t), value :: Nvar - integer(c_int64_t), value :: N - type(c_ptr), value :: sunctx - type(SUNLinearSolver), pointer :: sunls_S + integer(c_int64_t), value :: Nvar + integer(c_int64_t), value :: N + type(c_ptr), value :: sunctx + type(SUNLinearSolver), pointer :: sunls_S type(SUNLinearSolver_Ops), pointer :: ops - type(FLinSol), pointer :: content + type(FLinSol), pointer :: content ! allocate output SUNLinearSolver structure sunls_S => FSUNLinSolNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) - allocate(content%pivots(Nvar,N)) + allocate (content) + allocate (content%pivots(Nvar, N)) content%Nvar = NVar - content%N = N + content%N = N ! attach the content structure to the output SUNMatrix sunls_S%content = c_loc(content) @@ -64,10 +64,10 @@ function FSUNLinSolNew_Fortran(Nvar, N, sunctx) result(sunls_S) ! access the ops structure, and set internal function pointers call c_f_pointer(sunls_S%ops, ops) ops%gettype = c_funloc(FSUNLinSolGetType_Fortran) - ops%setup = c_funloc(FSUNLinSolSetup_Fortran) - ops%solve = c_funloc(FSUNLinSolSolve_Fortran) - ops%space = c_funloc(FSUNLinSolSpace_Fortran) - ops%free = c_funloc(FSUNLinSolFree_Fortran) + ops%setup = c_funloc(FSUNLinSolSetup_Fortran) + ops%solve = c_funloc(FSUNLinSolSolve_Fortran) + ops%space = c_funloc(FSUNLinSolSpace_Fortran) + ops%free = c_funloc(FSUNLinSolFree_Fortran) end function FSUNLinSolNew_Fortran @@ -99,20 +99,20 @@ end function FSUNLinSolGetType_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNLinSolFree_Fortran(sunls_S) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNLinearSolver), target :: sunls_S - type(FLinSol), pointer :: S + type(FLinSol), pointer :: S ! access FLinSol structure S => FSUNLinSolGetFLinSol(sunls_S) ! deallocate pivots - deallocate(S%pivots) + deallocate (S%pivots) ! deallocate the underlying Fortran object (the content) - deallocate(S) + deallocate (S) ! set SUNLinearSolver structure members to NULL and return sunls_S%content = C_NULL_PTR @@ -128,71 +128,71 @@ end function FSUNLinSolFree_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNLinSolSetup_Fortran(sunls_S, sunmat_A) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNLinearSolver) :: sunls_S type(SUNMatrix) :: sunmat_A - type(FLinSol), pointer :: S - type(FMat), pointer :: AMat + type(FLinSol), pointer :: S + type(FMat), pointer :: AMat integer(c_int64_t) :: i, j, k, l real(c_double) :: temp - real(c_double), pointer :: A(:,:) + real(c_double), pointer :: A(:, :) ! extract Fortran structures to work with S => FSUNLinSolGetFLinSol(sunls_S) AMat => FSUNMatGetFMat(sunmat_A) ! perform LU factorization of each block on diagonal - do i = 1,S%N - - ! set 2D pointer to this diagonal block - A => AMat%data(:,:,i) + do i = 1, S%N - ! k-th elimination step number - do k = 1,S%Nvar + ! set 2D pointer to this diagonal block + A => AMat%data(:, :, i) - ! find l = pivot row number - l = k - do j = k+1,S%Nvar - if (dabs(A(j,k)) > dabs(A(l,k))) then - l = j - end if - end do - S%pivots(k,i) = l - - ! check for zero pivot element - if (A(l,k) == 0.d0) then - ierr = int(k, c_int) - return - end if + ! k-th elimination step number + do k = 1, S%Nvar - ! swap a(k,1:n) and a(l,1:n) if necessary - if ( l /= k ) then - do j = 1,S%Nvar - temp = A(l,j) - A(l,j) = A(k,j) - A(k,j) = temp - end do + ! find l = pivot row number + l = k + do j = k + 1, S%Nvar + if (dabs(A(j, k)) > dabs(A(l, k))) then + l = j end if - - ! Scale the elements below the diagonal in - ! column k by 1.0/a(k,k). After the above swap - ! a(k,k) holds the pivot element. This scaling - ! stores the pivot row multipliers a(i,k)/a(k,k) - ! in a(i,k), i=k+1, ..., m-1. - A(k+1:S%Nvar,k) = A(k+1:S%Nvar,k) / A(k,k) - - ! row_i = row_i - [a(i,k)/a(k,k)] row_k, i=k+1, ..., Nvar - ! row k is the pivot row after swapping with row l. - ! The computation is done one column at a time - do j = k+1,S%Nvar - if (A(k,j) /= 0.d0) then - A(k+1:S%Nvar,j) = A(k+1:S%Nvar,j) - A(k,j) * A(k+1:S%Nvar,k) - end if + end do + S%pivots(k, i) = l + + ! check for zero pivot element + if (A(l, k) == 0.d0) then + ierr = int(k, c_int) + return + end if + + ! swap a(k,1:n) and a(l,1:n) if necessary + if (l /= k) then + do j = 1, S%Nvar + temp = A(l, j) + A(l, j) = A(k, j) + A(k, j) = temp end do + end if + + ! Scale the elements below the diagonal in + ! column k by 1.0/a(k,k). After the above swap + ! a(k,k) holds the pivot element. This scaling + ! stores the pivot row multipliers a(i,k)/a(k,k) + ! in a(i,k), i=k+1, ..., m-1. + A(k + 1:S%Nvar, k) = A(k + 1:S%Nvar, k)/A(k, k) + + ! row_i = row_i - [a(i,k)/a(k,k)] row_k, i=k+1, ..., Nvar + ! row k is the pivot row after swapping with row l. + ! The computation is done one column at a time + do j = k + 1, S%Nvar + if (A(k, j) /= 0.d0) then + A(k + 1:S%Nvar, j) = A(k + 1:S%Nvar, j) - A(k, j)*A(k + 1:S%Nvar, k) + end if + end do - end do + end do end do ! return with success @@ -203,7 +203,7 @@ end function FSUNLinSolSetup_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNLinSolSolve_Fortran(sunls_S, sunmat_A, & - sunvec_x, sunvec_b, tol) result(ierr) bind(C) + sunvec_x, sunvec_b, tol) result(ierr) bind(C) implicit none type(SUNLinearSolver) :: sunls_S @@ -211,12 +211,12 @@ integer(c_int) function FSUNLinSolSolve_Fortran(sunls_S, sunmat_A, & type(N_Vector) :: sunvec_x type(N_Vector) :: sunvec_b real(c_double), value :: tol - type(FLinSol), pointer :: S - type(FMat), pointer :: AMat - type(FVec), pointer :: xvec, bvec + type(FLinSol), pointer :: S + type(FMat), pointer :: AMat + type(FVec), pointer :: xvec, bvec integer(c_int64_t) :: i, k, pk real(c_double) :: temp - real(c_double), pointer :: A(:,:), x(:) + real(c_double), pointer :: A(:, :), x(:) ! extract Fortran structures to work with S => FSUNLinSolGetFLinSol(sunls_S) @@ -225,36 +225,36 @@ integer(c_int) function FSUNLinSolSolve_Fortran(sunls_S, sunmat_A, & bvec => FN_VGetFVec(sunvec_b) ! copy b into x - xvec%data(:,:) = bvec%data(:,:) + xvec%data(:, :) = bvec%data(:, :) ! perform solve using LU-factored blocks on matrix diagonal - do i = 1,S%N - - ! set pointer to this block of overall linear system - A => AMat%data(:,:,i) - x => xvec%data(:,i) - - ! Permute x, based on pivot information in p - do k = 1,S%Nvar - pk = S%pivots(k,i) - if (pk /= k) then - temp = x(k) - x(k) = x(pk) - x(pk) = temp - end if - end do - - ! Solve Ly = x, store solution y in x - do k = 1,S%Nvar-1 - x(k+1:S%Nvar) = x(k+1:S%Nvar) - x(k)*A(k+1:S%Nvar,k) - end do - - ! Solve Ux = y (y is initially stored in x) - do k = S%Nvar,2,-1 - x(k) = x(k)/A(k,k) - x(1:k-1) = x(1:k-1) - A(1:k-1,k)*x(k) - end do - x(1) = x(1)/A(1,1) + do i = 1, S%N + + ! set pointer to this block of overall linear system + A => AMat%data(:, :, i) + x => xvec%data(:, i) + + ! Permute x, based on pivot information in p + do k = 1, S%Nvar + pk = S%pivots(k, i) + if (pk /= k) then + temp = x(k) + x(k) = x(pk) + x(pk) = temp + end if + end do + + ! Solve Ly = x, store solution y in x + do k = 1, S%Nvar - 1 + x(k + 1:S%Nvar) = x(k + 1:S%Nvar) - x(k)*A(k + 1:S%Nvar, k) + end do + + ! Solve Ux = y (y is initially stored in x) + do k = S%Nvar, 2, -1 + x(k) = x(k)/A(k, k) + x(1:k - 1) = x(1:k - 1) - A(1:k - 1, k)*x(k) + end do + x(1) = x(1)/A(1, 1) end do @@ -266,7 +266,7 @@ end function FSUNLinSolSolve_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNLinSolSpace_Fortran(sunls_S, lrw, liw) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNLinearSolver) :: sunls_S diff --git a/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 b/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 index 7d6b397e99..ced4f4263b 100644 --- a/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/fsunmatrix_fortran_mod.f90 @@ -32,7 +32,7 @@ module fsunmatrix_fortran_mod logical :: own_data integer(c_int64_t) :: Nvar integer(c_int64_t) :: N - real(c_double), pointer :: data(:,:,:) + real(c_double), pointer :: data(:, :, :) end type FMat ! ---------------------------------------------------------------- @@ -42,37 +42,37 @@ module fsunmatrix_fortran_mod function FSUNMatNew_Fortran(Nvar, N, sunctx) result(sunmat_A) implicit none - integer(c_int64_t), value :: Nvar - integer(c_int64_t), value :: N - type(c_ptr), value :: sunctx - type(SUNMatrix), pointer :: sunmat_A + integer(c_int64_t), value :: Nvar + integer(c_int64_t), value :: N + type(c_ptr), value :: sunctx + type(SUNMatrix), pointer :: sunmat_A type(SUNMatrix_Ops), pointer :: ops - type(FMat), pointer :: content + type(FMat), pointer :: content ! allocate output SUNMatrix structure sunmat_A => FSUNMatNewEmpty(sunctx) ! allocate and fill content structure - allocate(content) - allocate(content%data(Nvar,Nvar,N)) + allocate (content) + allocate (content%data(Nvar, Nvar, N)) content%own_data = .true. - content%Nvar = NVar - content%N = N + content%Nvar = NVar + content%N = N ! attach the content structure to the output SUNMatrix sunmat_A%content = c_loc(content) ! access the SUNMatrix ops structure, and set internal function pointers call c_f_pointer(sunmat_A%ops, ops) - ops%getid = c_funloc(FSUNMatGetID_Fortran) - ops%clone = c_funloc(FSUNMatClone_Fortran) - ops%destroy = c_funloc(FSUNMatDestroy_Fortran) - ops%zero = c_funloc(FSUNMatZero_Fortran) - ops%copy = c_funloc(FSUNMatCopy_Fortran) - ops%scaleadd = c_funloc(FSUNMatScaleAdd_Fortran) + ops%getid = c_funloc(FSUNMatGetID_Fortran) + ops%clone = c_funloc(FSUNMatClone_Fortran) + ops%destroy = c_funloc(FSUNMatDestroy_Fortran) + ops%zero = c_funloc(FSUNMatZero_Fortran) + ops%copy = c_funloc(FSUNMatCopy_Fortran) + ops%scaleadd = c_funloc(FSUNMatScaleAdd_Fortran) ops%scaleaddi = c_funloc(FSUNMatScaleAddI_Fortran) - ops%matvec = c_funloc(FSUNMatMatvec_Fortran) - ops%space = c_funloc(FSUNMatSpace_Fortran) + ops%matvec = c_funloc(FSUNMatMatvec_Fortran) + ops%space = c_funloc(FSUNMatSpace_Fortran) end function FSUNMatNew_Fortran @@ -110,7 +110,7 @@ function FSUNMatClone_Fortran(sunmat_A) result(B_ptr) bind(C) type(SUNMatrix), pointer :: sunmat_B type(c_ptr) :: B_ptr integer(c_int) :: retval - type(FMat), pointer :: A, B + type(FMat), pointer :: A, B ! extract Fortran matrix structure to work with A => FSUNMatGetFMat(sunmat_A) @@ -122,8 +122,8 @@ function FSUNMatClone_Fortran(sunmat_A) result(B_ptr) bind(C) retval = FSUNMatCopyOps(sunmat_A, sunmat_B) ! allocate and clone content structure - allocate(B) - allocate(B%data(A%Nvar,A%Nvar,A%N)) + allocate (B) + allocate (B%data(A%Nvar, A%Nvar, A%N)) B%own_data = .true. B%Nvar = A%Nvar B%N = A%N @@ -142,16 +142,16 @@ subroutine FSUNMatDestroy_Fortran(sunmat_A) bind(C) implicit none type(SUNMatrix), target :: sunmat_A - type(FMat), pointer :: A + type(FMat), pointer :: A ! access FMat structure A => FSUNMatGetFMat(sunmat_A) ! if matrix owns the data, then deallocate - if (A%own_data) deallocate(A%data) + if (A%own_data) deallocate (A%data) ! deallocate the underlying Fortran object (the content) - deallocate(A) + deallocate (A) ! set SUNMatrix structure members to NULL and return sunmat_A%content = C_NULL_PTR @@ -165,7 +165,7 @@ end subroutine FSUNMatDestroy_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNMatZero_Fortran(sunmat_A) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNMatrix) :: sunmat_A @@ -175,7 +175,7 @@ integer(c_int) function FSUNMatZero_Fortran(sunmat_A) & A => FSUNMatGetFMat(sunmat_A) ! set all entries to zero (whole array operation) - A%data(:,:,:) = 0.d0 + A%data(:, :, :) = 0.d0 ! return with success ierr = 0 @@ -185,7 +185,7 @@ end function FSUNMatZero_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNMatCopy_Fortran(sunmat_A, sunmat_B) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNMatrix) :: sunmat_A @@ -197,7 +197,7 @@ integer(c_int) function FSUNMatCopy_Fortran(sunmat_A, sunmat_B) & B => FSUNMatGetFMat(sunmat_B) ! copy all entries from A into B (whole array operation) - B%data(:,:,:) = A%data(:,:,:) + B%data(:, :, :) = A%data(:, :, :) ! return with success ierr = 0 @@ -207,20 +207,20 @@ end function FSUNMatCopy_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNMatScaleAdd_Fortran(c, sunmat_A, sunmat_B) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none real(c_double), value :: c type(SUNMatrix) :: sunmat_A type(SUNMatrix) :: sunmat_B - type(FMat), pointer :: A, B + type(FMat), pointer :: A, B ! extract Fortran matrix structures to work with A => FSUNMatGetFMat(sunmat_A) B => FSUNMatGetFMat(sunmat_B) ! A = c*A + B (whole array operation) - A%data(:,:,:) = c * A%data(:,:,:) + B%data(:,:,:) + A%data(:, :, :) = c*A%data(:, :, :) + B%data(:, :, :) ! return with success ierr = 0 @@ -230,7 +230,7 @@ end function FSUNMatScaleAdd_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNMatScaleAddI_Fortran(c, sunmat_A) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none real(c_double), value :: c @@ -242,13 +242,13 @@ integer(c_int) function FSUNMatScaleAddI_Fortran(c, sunmat_A) & A => FSUNMatGetFMat(sunmat_A) ! A = c*A + I - do k = 1,A%N - do j = 1,A%Nvar - do i = 1,A%Nvar - A%data(i,j,k) = c * A%data(i,j,k) - end do - A%data(j,j,k) = A%data(j,j,k) + 1.d0 - end do + do k = 1, A%N + do j = 1, A%Nvar + do i = 1, A%Nvar + A%data(i, j, k) = c*A%data(i, j, k) + end do + A%data(j, j, k) = A%data(j, j, k) + 1.d0 + end do end do ! return with success @@ -259,7 +259,7 @@ end function FSUNMatScaleAddI_Fortran ! ---------------------------------------------------------------- integer(c_int) function FSUNMatMatvec_Fortran(sunmat_A, sunvec_x, sunvec_y) & - result(ierr) bind(C) + result(ierr) bind(C) implicit none type(SUNMatrix) :: sunmat_A @@ -275,8 +275,8 @@ integer(c_int) function FSUNMatMatvec_Fortran(sunmat_A, sunvec_x, sunvec_y) & y => FN_VGetFVec(sunvec_y) ! y = A*x - do i = 1,A%N - y%data(:,i) = matmul(A%data(:,:,i), x%data(:,i)) + do i = 1, A%N + y%data(:, i) = matmul(A%data(:, :, i), x%data(:, i)) end do ! return with success diff --git a/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 b/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 index b9cec621a6..aa28a002ac 100644 --- a/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_complex_mod.f90 @@ -36,8 +36,8 @@ integer(c_int) function check_ans(val, tol, N, sunvec_x) result(failure) x => FN_VGetFVec(sunvec_x) failure = 0 - do i = 1,N - if (abs(x%data(i) - val) > tol) failure = 1 + do i = 1, N + if (abs(x%data(i) - val) > tol) failure = 1 end do end function check_ans @@ -76,74 +76,72 @@ program main ! create new vectors, using New, Make and Clone routines sU => FN_VMake_Complex(N, Udata, sunctx) if (.not. associated(sU)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if U => FN_VGetFVec(sU) sV => FN_VNew_Complex(N, sunctx) if (.not. associated(sV)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if V => FN_VGetFVec(sV) sW => FN_VNew_Complex(N, sunctx) if (.not. associated(sW)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if W => FN_VGetFVec(sW) sX => FN_VNew_Complex(N, sunctx) if (.not. associated(sX)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if X => FN_VGetFVec(sX) sY => FN_VNew_Complex(N, sunctx) if (.not. associated(sY)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if Y => FN_VGetFVec(sY) call c_f_pointer(FN_VClone_Complex(sU), sZ) if (.not. associated(sZ)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if Z => FN_VGetFVec(sZ) - ! check vector ID if (FN_VGetVectorID(sU) /= SUNDIALS_NVEC_CUSTOM) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VGetVectorID' - print *, ' Unrecognized vector type', FN_VGetVectorID(sU) + fails = fails + 1 + print *, '>>> FAILED test -- FN_VGetVectorID' + print *, ' Unrecognized vector type', FN_VGetVectorID(sU) else - print *, 'PASSED test -- FN_VGetVectorID' + print *, 'PASSED test -- FN_VGetVectorID' end if - ! check vector length if (FN_VGetLength(sV) /= N) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VGetLength' - print *, ' ', FN_VGetLength(sV), ' /= ', N + fails = fails + 1 + print *, '>>> FAILED test -- FN_VGetLength' + print *, ' ', FN_VGetLength(sV), ' /= ', N else - print *, 'PASSED test -- FN_VGetLength' + print *, 'PASSED test -- FN_VGetLength' end if ! test FN_VConst Udata = 0.d0 call FN_VConst(1.d0, sU) if (check_ans(dcmplx(1.d0, 0.d0), 1.d-14, N, sU) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VConst' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VConst' else - print *, 'PASSED test -- FN_VConst' + print *, 'PASSED test -- FN_VConst' end if ! test FN_VLinearSum @@ -151,60 +149,60 @@ program main Y%data = dcmplx(-2.d0, 2.d0) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sY) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1a' else - print *, 'PASSED test -- FN_VLinearSum Case 1a' + print *, 'PASSED test -- FN_VLinearSum Case 1a' end if X%data = dcmplx(1.d0, -1.d0) Y%data = dcmplx(2.d0, -2.d0) call FN_VLinearSum(-1.d0, sX, 1.d0, sY, sY) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1b' else - print *, 'PASSED test -- FN_VLinearSum Case 1b' + print *, 'PASSED test -- FN_VLinearSum Case 1b' end if X%data = dcmplx(2.d0, -2.d0) Y%data = dcmplx(-2.d0, 2.d0) call FN_VLinearSum(0.5d0, sX, 1.d0, sY, sY) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1c' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1c' else - print *, 'PASSED test -- FN_VLinearSum Case 1c' + print *, 'PASSED test -- FN_VLinearSum Case 1c' end if X%data = dcmplx(2.d0, -2.d0) Y%data = dcmplx(-1.d0, 1.d0) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sX) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2a' else - print *, 'PASSED test -- FN_VLinearSum Case 2a' + print *, 'PASSED test -- FN_VLinearSum Case 2a' end if X%data = dcmplx(1.d0, -1.d0) Y%data = dcmplx(2.d0, -2.d0) call FN_VLinearSum(1.d0, sX, -1.d0, sY, sX) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2b' else - print *, 'PASSED test -- FN_VLinearSum Case 2b' + print *, 'PASSED test -- FN_VLinearSum Case 2b' end if X%data = dcmplx(2.d0, -2.d0) Y%data = dcmplx(-0.5d0, 0.5d0) call FN_VLinearSum(1.d0, sX, 2.d0, sY, sX) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2c' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2c' else - print *, 'PASSED test -- FN_VLinearSum Case 2c' + print *, 'PASSED test -- FN_VLinearSum Case 2c' end if X%data = dcmplx(-2.d0, 2.d0) @@ -212,10 +210,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 3' else - print *, 'PASSED test -- FN_VLinearSum Case 3' + print *, 'PASSED test -- FN_VLinearSum Case 3' end if X%data = dcmplx(2.d0, -2.d0) @@ -223,10 +221,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(1.d0, sX, -1.d0, sY, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 4a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 4a' else - print *, 'PASSED test -- FN_VLinearSum Case 4a' + print *, 'PASSED test -- FN_VLinearSum Case 4a' end if X%data = dcmplx(2.d0, -2.d0) @@ -234,10 +232,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(-1.d0, sX, 1.d0, sY, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 4b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 4b' else - print *, 'PASSED test -- FN_VLinearSum Case 4b' + print *, 'PASSED test -- FN_VLinearSum Case 4b' end if X%data = dcmplx(2.d0, -2.d0) @@ -245,10 +243,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(1.d0, sX, 2.d0, sY, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 5a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 5a' else - print *, 'PASSED test -- FN_VLinearSum Case 5a' + print *, 'PASSED test -- FN_VLinearSum Case 5a' end if X%data = dcmplx(0.5d0, -0.5d0) @@ -256,10 +254,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(2.d0, sX, 1.d0, sY, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 5b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 5b' else - print *, 'PASSED test -- FN_VLinearSum Case 5b' + print *, 'PASSED test -- FN_VLinearSum Case 5b' end if X%data = dcmplx(-2.d0, 2.d0) @@ -267,10 +265,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(-1.d0, sX, 2.d0, sY, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 6a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 6a' else - print *, 'PASSED test -- FN_VLinearSum Case 6a' + print *, 'PASSED test -- FN_VLinearSum Case 6a' end if X%data = dcmplx(0.5d0, -0.5d0) @@ -278,10 +276,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(2.d0, sX, -1.d0, sY, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 6b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 6b' else - print *, 'PASSED test -- FN_VLinearSum Case 6b' + print *, 'PASSED test -- FN_VLinearSum Case 6b' end if X%data = dcmplx(1.d0, -1.d0) @@ -289,10 +287,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(2.d0, sX, 2.d0, sY, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 7' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 7' else - print *, 'PASSED test -- FN_VLinearSum Case 7' + print *, 'PASSED test -- FN_VLinearSum Case 7' end if X%data = dcmplx(0.5d0, -0.5d0) @@ -300,10 +298,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(2.d0, sX, -2.d0, sY, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 8' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 8' else - print *, 'PASSED test -- FN_VLinearSum Case 8' + print *, 'PASSED test -- FN_VLinearSum Case 8' end if X%data = dcmplx(1.d0, -1.d0) @@ -311,10 +309,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VLinearSum(2.d0, sX, 0.5d0, sY, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 9' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 9' else - print *, 'PASSED test -- FN_VLinearSum Case 9' + print *, 'PASSED test -- FN_VLinearSum Case 9' end if ! test FN_VProd @@ -323,10 +321,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VProd(sX, sY, sZ) if (check_ans(dcmplx(-1.d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VProd Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VProd Case 1' else - print *, 'PASSED test -- FN_VProd Case 1' + print *, 'PASSED test -- FN_VProd Case 1' end if X%data = dcmplx(0.d0, 0.5d0) @@ -334,10 +332,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VProd(sX, sY, sZ) if (check_ans(dcmplx(0.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VProd Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VProd Case 2' else - print *, 'PASSED test -- FN_VProd Case 2' + print *, 'PASSED test -- FN_VProd Case 2' end if X%data = dcmplx(1.d0, 2.d0) @@ -345,10 +343,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VProd(sX, sY, sZ) if (check_ans(dcmplx(5.d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VProd Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VProd Case 3' else - print *, 'PASSED test -- FN_VProd Case 3' + print *, 'PASSED test -- FN_VProd Case 3' end if ! test FN_VDiv @@ -357,10 +355,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VDiv(sX, sY, sZ) if (check_ans(dcmplx(0.5d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VDiv Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VDiv Case 1' else - print *, 'PASSED test -- FN_VDiv Case 1' + print *, 'PASSED test -- FN_VDiv Case 1' end if X%data = dcmplx(0.d0, 1.d0) @@ -368,10 +366,10 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VDiv(sX, sY, sZ) if (check_ans(dcmplx(0.d0, 0.5d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VDiv Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VDiv Case 2' else - print *, 'PASSED test -- FN_VDiv Case 2' + print *, 'PASSED test -- FN_VDiv Case 2' end if X%data = dcmplx(4.d0, 2.d0) @@ -379,50 +377,50 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VDiv(sX, sY, sZ) if (check_ans(dcmplx(1.d0, 3.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VDiv Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VDiv Case 3' else - print *, 'PASSED test -- FN_VDiv Case 3' + print *, 'PASSED test -- FN_VDiv Case 3' end if ! test FN_VScale X%data = dcmplx(0.5d0, -0.5d0) call FN_VScale(2.d0, sX, sX) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 1' else - print *, 'PASSED test -- FN_VScale Case 1' + print *, 'PASSED test -- FN_VScale Case 1' end if X%data = dcmplx(-1.d0, 1.d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VScale(1.d0, sX, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 2' else - print *, 'PASSED test -- FN_VScale Case 2' + print *, 'PASSED test -- FN_VScale Case 2' end if X%data = dcmplx(-1.d0, 1.d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VScale(-1.d0, sX, sZ) if (check_ans(dcmplx(1.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 3' else - print *, 'PASSED test -- FN_VScale Case 3' + print *, 'PASSED test -- FN_VScale Case 3' end if X%data = dcmplx(-0.5d0, 0.5d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VScale(2.d0, sX, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 4' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 4' else - print *, 'PASSED test -- FN_VScale Case 4' + print *, 'PASSED test -- FN_VScale Case 4' end if ! test FN_VAbs @@ -430,30 +428,30 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VAbs(sX, sZ) if (check_ans(dcmplx(1.d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAbs Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAbs Case 1' else - print *, 'PASSED test -- FN_VAbs Case 1' + print *, 'PASSED test -- FN_VAbs Case 1' end if X%data = dcmplx(1.d0, -0.d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VAbs(sX, sZ) if (check_ans(dcmplx(1.d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAbs Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAbs Case 2' else - print *, 'PASSED test -- FN_VAbs Case 2' + print *, 'PASSED test -- FN_VAbs Case 2' end if X%data = dcmplx(3.d0, -4.d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VAbs(sX, sZ) if (check_ans(dcmplx(5.d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAbs Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAbs Case 3' else - print *, 'PASSED test -- FN_VAbs Case 3' + print *, 'PASSED test -- FN_VAbs Case 3' end if ! test FN_VInv @@ -461,20 +459,20 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VInv(sX, sZ) if (check_ans(dcmplx(0.5d0, 0.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInv Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInv Case 1' else - print *, 'PASSED test -- FN_VInv Case 1' + print *, 'PASSED test -- FN_VInv Case 1' end if X%data = dcmplx(0.d0, 1.d0) Z%data = dcmplx(0.d0, 0.d0) call FN_VInv(sX, sZ) if (check_ans(dcmplx(0.d0, -1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInv Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInv Case 2' else - print *, 'PASSED test -- FN_VInv Case 2' + print *, 'PASSED test -- FN_VInv Case 2' end if ! test FN_VAddConst @@ -482,30 +480,30 @@ program main Z%data = dcmplx(0.d0, 0.d0) call FN_VAddConst(sX, -2.d0, sZ) if (check_ans(dcmplx(-1.d0, 1.d0), 1.d-14, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAddConst' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAddConst' else - print *, 'PASSED test -- FN_VAddConst' + print *, 'PASSED test -- FN_VAddConst' end if ! test FN_VMaxNorm X%data = dcmplx(-0.5d0, 0.d0) X%data(N) = dcmplx(0.d0, -2.d0) if (dabs(FN_VMaxNorm(sX) - 2.d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMaxNorm (',FN_VMaxNorm(sX),' /= 2.d0)' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMaxNorm (', FN_VMaxNorm(sX), ' /= 2.d0)' else - print *, 'PASSED test -- FN_VMaxNorm' + print *, 'PASSED test -- FN_VMaxNorm' end if ! test FN_VWrmsNorm X%data = dcmplx(-0.5d0, 0.d0) Y%data = dcmplx(0.5d0, 0.d0) - if (dabs(FN_VWrmsNorm(sX,sY) - 0.25d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWrmsNorm (',FN_VWrmsNorm(sX,sY),' /= 0.25d0)' + if (dabs(FN_VWrmsNorm(sX, sY) - 0.25d0) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWrmsNorm (', FN_VWrmsNorm(sX, sY), ' /= 0.25d0)' else - print *, 'PASSED test -- FN_VWrmsNorm' + print *, 'PASSED test -- FN_VWrmsNorm' end if ! test FN_VWrmsNormMask @@ -514,42 +512,42 @@ program main Z%data = dcmplx(1.d0, 0.d0) Z%data(N) = dcmplx(0.d0, 0.d0) fac = dsqrt(1.d0*(N - 1)/N)*0.25d0 - if (dabs(FN_VWrmsNormMask(sX,sY,sZ) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWrmsNormMask (',FN_VWrmsNormMask(sX,sY,sZ),' /= ',fac,')' + if (dabs(FN_VWrmsNormMask(sX, sY, sZ) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWrmsNormMask (', FN_VWrmsNormMask(sX, sY, sZ), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWrmsNormMask' + print *, 'PASSED test -- FN_VWrmsNormMask' end if ! test FN_VMin X%data = dcmplx(2.d0, 0.d0) X%data(N) = dcmplx(-2.d0, -3.d0) if (dabs(FN_VMin(sX) + 2.d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMin (',FN_VMin(sX),' /= -2.d0)' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMin (', FN_VMin(sX), ' /= -2.d0)' else - print *, 'PASSED test -- FN_VMin' + print *, 'PASSED test -- FN_VMin' end if ! test FN_VWL2Norm X%data = dcmplx(-0.5d0, 0.d0) Y%data = dcmplx(0.5d0, 0.d0) fac = dsqrt(1.d0*N)*0.25d0 - if (dabs(FN_VWL2Norm(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWL2Norm (',FN_VWL2Norm(sX,sY),' /= ',fac,')' + if (dabs(FN_VWL2Norm(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWL2Norm (', FN_VWL2Norm(sX, sY), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWL2Norm' + print *, 'PASSED test -- FN_VWL2Norm' end if ! test FN_VL1Norm X%data = dcmplx(0.d0, -1.d0) fac = 1.d0*N if (dabs(FN_VL1Norm(sX) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VL1Norm (',FN_VL1Norm(sX),' /= ',fac,')' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VL1Norm (', FN_VL1Norm(sX), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VL1Norm' + print *, 'PASSED test -- FN_VL1Norm' end if ! test FN_VInvTest @@ -557,55 +555,54 @@ program main Z%data = dcmplx(0.d0, 0.d0) failure = (FN_VInvTest(sX, sZ) == 0) if ((check_ans(dcmplx(2.d0, 0.d0), 1.d-14, N, sZ) /= 0) .or. failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInvTest Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInvTest Case 1' else - print *, 'PASSED test -- FN_VInvTest Case 1' + print *, 'PASSED test -- FN_VInvTest Case 1' end if failure = .false. Z%data = dcmplx(0.d0, 0.d0) - do i = 1,N - loc = mod(i-1, 2) - if (loc == 0) X%data(i) = dcmplx(0.d0, 0.d0) - if (loc == 1) X%data(i) = dcmplx(0.5d0, 0.d0) + do i = 1, N + loc = mod(i - 1, 2) + if (loc == 0) X%data(i) = dcmplx(0.d0, 0.d0) + if (loc == 1) X%data(i) = dcmplx(0.5d0, 0.d0) end do - if (FN_VInvTest(sX, sZ) == 1) failure = .true. - do i = 1,N - loc = mod(i-1, 2) - if ((loc == 0) .and. (Z%data(i) /= dcmplx(0.d0, 0.d0))) failure = .true. - if ((loc == 1) .and. (Z%data(i) /= dcmplx(2.d0, 0.d0))) failure = .true. + if (FN_VInvTest(sX, sZ) == 1) failure = .true. + do i = 1, N + loc = mod(i - 1, 2) + if ((loc == 0) .and. (Z%data(i) /= dcmplx(0.d0, 0.d0))) failure = .true. + if ((loc == 1) .and. (Z%data(i) /= dcmplx(2.d0, 0.d0))) failure = .true. end do if (failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInvTest Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInvTest Case 2' else - print *, 'PASSED test -- FN_VInvTest Case 2' + print *, 'PASSED test -- FN_VInvTest Case 2' end if ! test FN_VWSqrSumLocal X%data = dcmplx(-1.d0, 0.d0) Y%data = dcmplx(0.5d0, 0.d0) fac = 0.25d0*N - if (dabs(FN_VWSqrSumLocal(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWSqrSumLocal (',FN_VWSqrSumLocal(sX,sY),' /= ',fac,')' + if (dabs(FN_VWSqrSumLocal(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWSqrSumLocal (', FN_VWSqrSumLocal(sX, sY), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWSqrSumLocal' + print *, 'PASSED test -- FN_VWSqrSumLocal' end if - ! test FN_VWSqrSumMaskLocal X%data = dcmplx(-1.d0, 0.d0) Y%data = dcmplx(0.5d0, 0.d0) Z%data = dcmplx(1.d0, 0.d0) Z%data(N) = dcmplx(0.d0, 0.d0) - fac = 0.25d0*(N-1) - if (dabs(FN_VWSqrSumMaskLocal(sX,sY,sZ) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWSqrSumMaskLocal (',FN_VWSqrSumMaskLocal(sX,sY,sZ),' /= ',fac,')' + fac = 0.25d0*(N - 1) + if (dabs(FN_VWSqrSumMaskLocal(sX, sY, sZ) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWSqrSumMaskLocal (', FN_VWSqrSumMaskLocal(sX, sY, sZ), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWSqrSumMaskLocal' + print *, 'PASSED test -- FN_VWSqrSumMaskLocal' end if ! free vectors @@ -621,10 +618,10 @@ program main ! print results if (fails > 0) then - print '(a,i3,a)', 'FAIL: FNVector module failed ',fails,' tests' - stop 1 + print '(a,i3,a)', 'FAIL: FNVector module failed ', fails, ' tests' + stop 1 else - print *, 'SUCCESS: FNVector module passed all tests' + print *, 'SUCCESS: FNVector module passed all tests' end if print *, ' ' diff --git a/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 index ac6e69c9d6..0673d668ad 100644 --- a/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fnvector_fortran_mod.f90 @@ -35,10 +35,10 @@ integer(c_int) function check_ans(val, tol, Nvar, N, sunvec_x) result(failure) x => FN_VGetFVec(sunvec_x) failure = 0 - do j = 1,N - do i = 1,Nvar - if (dabs(x%data(i,j) - val) > tol) failure = 1 - end do + do j = 1, N + do i = 1, Nvar + if (dabs(x%data(i, j) - val) > tol) failure = 1 + end do end do end function check_ans @@ -64,11 +64,10 @@ program main integer(c_int64_t), parameter :: Nvar = 10 type(N_Vector), pointer :: sU, sV, sW, sX, sY, sZ type(FVec), pointer :: U, V, W, X, Y, Z - real(c_double), allocatable :: Udata(:,:) + real(c_double), allocatable :: Udata(:, :) real(c_double) :: fac logical :: failure - !======= Internals ============ ! initialize failure total @@ -78,77 +77,75 @@ program main fails = FSUNContext_Create(SUN_COMM_NULL, sunctx) ! create new vectors, using New, Make and Clone routines - allocate(Udata(Nvar,N)) + allocate (Udata(Nvar, N)) sU => FN_VMake_Fortran(Nvar, N, Udata, sunctx) if (.not. associated(sU)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if U => FN_VGetFVec(sU) sV => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sV)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if V => FN_VGetFVec(sV) sW => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sW)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if W => FN_VGetFVec(sW) sX => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sX)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if X => FN_VGetFVec(sX) sY => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sY)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if Y => FN_VGetFVec(sY) call c_f_pointer(FN_VClone_Fortran(sU), sZ) if (.not. associated(sZ)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if Z => FN_VGetFVec(sZ) - ! check vector ID if (FN_VGetVectorID(sU) /= SUNDIALS_NVEC_CUSTOM) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VGetVectorID' - print *, ' Unrecognized vector type', FN_VGetVectorID(sU) + fails = fails + 1 + print *, '>>> FAILED test -- FN_VGetVectorID' + print *, ' Unrecognized vector type', FN_VGetVectorID(sU) else - print *, 'PASSED test -- FN_VGetVectorID' + print *, 'PASSED test -- FN_VGetVectorID' end if - ! check vector length if (FN_VGetLength(sV) /= (N*Nvar)) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VGetLength' - print *, ' ', FN_VGetLength(sV), ' /= ', N*Nvar + fails = fails + 1 + print *, '>>> FAILED test -- FN_VGetLength' + print *, ' ', FN_VGetLength(sV), ' /= ', N*Nvar else - print *, 'PASSED test -- FN_VGetLength' + print *, 'PASSED test -- FN_VGetLength' end if ! test FN_VConst Udata = 0.d0 call FN_VConst(1.d0, sU) if (check_ans(1.d0, 1.d-14, Nvar, N, sU) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VConst' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VConst' else - print *, 'PASSED test -- FN_VConst' + print *, 'PASSED test -- FN_VConst' end if ! test FN_VLinearSum @@ -156,60 +153,60 @@ program main call FN_VConst(-2.d0, sY) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sY) if (check_ans(-1.d0, 1.d-14, Nvar, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1a' else - print *, 'PASSED test -- FN_VLinearSum Case 1a' + print *, 'PASSED test -- FN_VLinearSum Case 1a' end if call FN_VConst(1.d0, sX) call FN_VConst(2.d0, sY) call FN_VLinearSum(-1.d0, sX, 1.d0, sY, sY) if (check_ans(1.d0, 1.d-14, Nvar, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1b' else - print *, 'PASSED test -- FN_VLinearSum Case 1b' + print *, 'PASSED test -- FN_VLinearSum Case 1b' end if call FN_VConst(2.d0, sX) call FN_VConst(-2.d0, sY) call FN_VLinearSum(0.5d0, sX, 1.d0, sY, sY) if (check_ans(-1.d0, 1.d-14, Nvar, N, sY) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 1c' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 1c' else - print *, 'PASSED test -- FN_VLinearSum Case 1c' + print *, 'PASSED test -- FN_VLinearSum Case 1c' end if call FN_VConst(2.d0, sX) call FN_VConst(-1.d0, sY) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sX) if (check_ans(1.d0, 1.d-14, Nvar, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2a' else - print *, 'PASSED test -- FN_VLinearSum Case 2a' + print *, 'PASSED test -- FN_VLinearSum Case 2a' end if call FN_VConst(1.d0, sX) call FN_VConst(2.d0, sY) call FN_VLinearSum(1.d0, sX, -1.d0, sY, sX) if (check_ans(-1.d0, 1.d-14, Nvar, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2b' else - print *, 'PASSED test -- FN_VLinearSum Case 2b' + print *, 'PASSED test -- FN_VLinearSum Case 2b' end if call FN_VConst(2.d0, sX) call FN_VConst(-0.5d0, sY) call FN_VLinearSum(1.d0, sX, 2.d0, sY, sX) if (check_ans(1.d0, 1.d-14, Nvar, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 2c' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 2c' else - print *, 'PASSED test -- FN_VLinearSum Case 2c' + print *, 'PASSED test -- FN_VLinearSum Case 2c' end if call FN_VConst(-2.d0, sX) @@ -217,10 +214,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(1.d0, sX, 1.d0, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 3' else - print *, 'PASSED test -- FN_VLinearSum Case 3' + print *, 'PASSED test -- FN_VLinearSum Case 3' end if call FN_VConst(2.d0, sX) @@ -228,10 +225,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(1.d0, sX, -1.d0, sY, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 4a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 4a' else - print *, 'PASSED test -- FN_VLinearSum Case 4a' + print *, 'PASSED test -- FN_VLinearSum Case 4a' end if call FN_VConst(2.d0, sX) @@ -239,10 +236,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(-1.d0, sX, 1.d0, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 4b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 4b' else - print *, 'PASSED test -- FN_VLinearSum Case 4b' + print *, 'PASSED test -- FN_VLinearSum Case 4b' end if call FN_VConst(2.d0, sX) @@ -250,10 +247,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(1.d0, sX, 2.d0, sY, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 5a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 5a' else - print *, 'PASSED test -- FN_VLinearSum Case 5a' + print *, 'PASSED test -- FN_VLinearSum Case 5a' end if call FN_VConst(0.5d0, sX) @@ -261,10 +258,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(2.d0, sX, 1.d0, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 5b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 5b' else - print *, 'PASSED test -- FN_VLinearSum Case 5b' + print *, 'PASSED test -- FN_VLinearSum Case 5b' end if call FN_VConst(-2.d0, sX) @@ -272,10 +269,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(-1.d0, sX, 2.d0, sY, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 6a' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 6a' else - print *, 'PASSED test -- FN_VLinearSum Case 6a' + print *, 'PASSED test -- FN_VLinearSum Case 6a' end if call FN_VConst(0.5d0, sX) @@ -283,10 +280,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(2.d0, sX, -1.d0, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 6b' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 6b' else - print *, 'PASSED test -- FN_VLinearSum Case 6b' + print *, 'PASSED test -- FN_VLinearSum Case 6b' end if call FN_VConst(1.d0, sX) @@ -294,10 +291,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(2.d0, sX, 2.d0, sY, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 7' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 7' else - print *, 'PASSED test -- FN_VLinearSum Case 7' + print *, 'PASSED test -- FN_VLinearSum Case 7' end if call FN_VConst(0.5d0, sX) @@ -305,10 +302,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(2.d0, sX, -2.d0, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 8' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 8' else - print *, 'PASSED test -- FN_VLinearSum Case 8' + print *, 'PASSED test -- FN_VLinearSum Case 8' end if call FN_VConst(1.d0, sX) @@ -316,10 +313,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VLinearSum(2.d0, sX, 0.5d0, sY, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VLinearSum Case 9' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VLinearSum Case 9' else - print *, 'PASSED test -- FN_VLinearSum Case 9' + print *, 'PASSED test -- FN_VLinearSum Case 9' end if ! test FN_VProd @@ -328,10 +325,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VProd(sX, sY, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VProd' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VProd' else - print *, 'PASSED test -- FN_VProd' + print *, 'PASSED test -- FN_VProd' end if ! test FN_VDiv @@ -340,50 +337,50 @@ program main call FN_VConst(0.d0, sZ) call FN_VDiv(sX, sY, sZ) if (check_ans(0.5d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VDiv' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VDiv' else - print *, 'PASSED test -- FN_VDiv' + print *, 'PASSED test -- FN_VDiv' end if ! test FN_VScale call FN_VConst(0.5d0, sX) call FN_VScale(2.d0, sX, sX) if (check_ans(1.d0, 1.d-14, Nvar, N, sX) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 1' else - print *, 'PASSED test -- FN_VScale Case 1' + print *, 'PASSED test -- FN_VScale Case 1' end if call FN_VConst(-1.d0, sX) call FN_VConst(0.d0, sZ) call FN_VScale(1.d0, sX, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 2' else - print *, 'PASSED test -- FN_VScale Case 2' + print *, 'PASSED test -- FN_VScale Case 2' end if call FN_VConst(-1.d0, sX) call FN_VConst(0.d0, sZ) call FN_VScale(-1.d0, sX, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 3' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 3' else - print *, 'PASSED test -- FN_VScale Case 3' + print *, 'PASSED test -- FN_VScale Case 3' end if call FN_VConst(-0.5d0, sX) call FN_VConst(0.d0, sZ) call FN_VScale(2.d0, sX, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VScale Case 4' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VScale Case 4' else - print *, 'PASSED test -- FN_VScale Case 4' + print *, 'PASSED test -- FN_VScale Case 4' end if ! test FN_VAbs @@ -391,10 +388,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VAbs(sX, sZ) if (check_ans(1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAbs' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAbs' else - print *, 'PASSED test -- FN_VAbs' + print *, 'PASSED test -- FN_VAbs' end if ! test FN_VInv @@ -402,10 +399,10 @@ program main call FN_VConst(0.d0, sZ) call FN_VInv(sX, sZ) if (check_ans(0.5d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInv' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInv' else - print *, 'PASSED test -- FN_VInv' + print *, 'PASSED test -- FN_VInv' end if ! test FN_VAddConst @@ -413,111 +410,111 @@ program main call FN_VConst(0.d0, sZ) call FN_VAddConst(sX, -2.d0, sZ) if (check_ans(-1.d0, 1.d-14, Nvar, N, sZ) /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VAddConst' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VAddConst' else - print *, 'PASSED test -- FN_VAddConst' + print *, 'PASSED test -- FN_VAddConst' end if ! test FN_VDotProd call FN_VConst(2.d0, sX) call FN_VConst(0.5d0, sY) - if (dabs(FN_VDotProd(sX,sY) - (N*Nvar)) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VDotProd (',FN_VDotProd(sX,sY),' /= ',N*Nvar,')' + if (dabs(FN_VDotProd(sX, sY) - (N*Nvar)) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VDotProd (', FN_VDotProd(sX, sY), ' /= ', N*Nvar, ')' else - print *, 'PASSED test -- FN_VDotProd' + print *, 'PASSED test -- FN_VDotProd' end if ! test FN_VMaxNorm call FN_VConst(-0.5d0, sX) - X%data(Nvar,N) = -2.d0 + X%data(Nvar, N) = -2.d0 if (dabs(FN_VMaxNorm(sX) - 2.d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMaxNorm (',FN_VMaxNorm(sX),' /= 2.d0)' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMaxNorm (', FN_VMaxNorm(sX), ' /= 2.d0)' else - print *, 'PASSED test -- FN_VMaxNorm' + print *, 'PASSED test -- FN_VMaxNorm' end if ! test FN_VWrmsNorm call FN_VConst(-0.5d0, sX) call FN_VConst(0.5d0, sY) - if (dabs(FN_VWrmsNorm(sX,sY) - 0.25d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWrmsNorm (',FN_VWrmsNorm(sX,sY),' /= 0.25d0)' + if (dabs(FN_VWrmsNorm(sX, sY) - 0.25d0) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWrmsNorm (', FN_VWrmsNorm(sX, sY), ' /= 0.25d0)' else - print *, 'PASSED test -- FN_VWrmsNorm' + print *, 'PASSED test -- FN_VWrmsNorm' end if ! test FN_VWrmsNormMask call FN_VConst(-0.5d0, sX) call FN_VConst(0.5d0, sY) call FN_VConst(1.d0, sZ) - Z%data(Nvar,N) = 0.d0 + Z%data(Nvar, N) = 0.d0 fac = dsqrt(1.d0*(N*Nvar - 1)/(N*Nvar))*0.25d0 - if (dabs(FN_VWrmsNormMask(sX,sY,sZ) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWrmsNormMask (',FN_VWrmsNormMask(sX,sY,sZ),' /= ',fac,')' + if (dabs(FN_VWrmsNormMask(sX, sY, sZ) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWrmsNormMask (', FN_VWrmsNormMask(sX, sY, sZ), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWrmsNormMask' + print *, 'PASSED test -- FN_VWrmsNormMask' end if ! test FN_VMin call FN_VConst(2.d0, sX) - X%data(Nvar,N) = -2.d0 + X%data(Nvar, N) = -2.d0 if (dabs(FN_VMin(sX) + 2.d0) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMin (',FN_VMin(sX),' /= -2.d0)' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMin (', FN_VMin(sX), ' /= -2.d0)' else - print *, 'PASSED test -- FN_VMin' + print *, 'PASSED test -- FN_VMin' end if ! test FN_VWL2Norm call FN_VConst(-0.5d0, sX) call FN_VConst(0.5d0, sY) fac = dsqrt(1.d0*N*Nvar)*0.25d0 - if (dabs(FN_VWL2Norm(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWL2Norm (',FN_VWL2Norm(sX,sY),' /= ',fac,')' + if (dabs(FN_VWL2Norm(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWL2Norm (', FN_VWL2Norm(sX, sY), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWL2Norm' + print *, 'PASSED test -- FN_VWL2Norm' end if ! test FN_VL1Norm call FN_VConst(-1.d0, sX) fac = 1.d0*N*Nvar if (dabs(FN_VL1Norm(sX) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VL1Norm (',FN_VL1Norm(sX),' /= ',fac,')' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VL1Norm (', FN_VL1Norm(sX), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VL1Norm' + print *, 'PASSED test -- FN_VL1Norm' end if ! test FN_VCompare call FN_VConst(-1.d0, sZ) - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 3_c_long) - if (loc == 0) X%data(i,j) = 0.d0 - if (loc == 1) X%data(i,j) = -1.d0 - if (loc == 2) X%data(i,j) = -2.d0 - end do + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 3_c_long) + if (loc == 0) X%data(i, j) = 0.d0 + if (loc == 1) X%data(i, j) = -1.d0 + if (loc == 2) X%data(i, j) = -2.d0 + end do end do call FN_VCompare(1.d0, sX, sZ) failure = .false. - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 3_c_long) - if ((loc == 0) .and. (Z%data(i,j) /= 0.d0)) failure = .true. - if ((loc == 1) .and. (Z%data(i,j) /= 1.d0)) failure = .true. - if ((loc == 2) .and. (Z%data(i,j) /= 1.d0)) failure = .true. - end do + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 3_c_long) + if ((loc == 0) .and. (Z%data(i, j) /= 0.d0)) failure = .true. + if ((loc == 1) .and. (Z%data(i, j) /= 1.d0)) failure = .true. + if ((loc == 2) .and. (Z%data(i, j) /= 1.d0)) failure = .true. + end do end do if (failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VCompare' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VCompare' else - print *, 'PASSED test -- FN_VCompare' + print *, 'PASSED test -- FN_VCompare' end if ! test FN_VInvTest @@ -525,174 +522,173 @@ program main call FN_VConst(0.d0, sZ) failure = (FN_VInvTest(sX, sZ) == 0) if ((check_ans(2.d0, 1.d-14, Nvar, N, sZ) /= 0) .or. failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInvTest Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInvTest Case 1' else - print *, 'PASSED test -- FN_VInvTest Case 1' + print *, 'PASSED test -- FN_VInvTest Case 1' end if failure = .false. call FN_VConst(0.d0, sZ) - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 2_c_long) - if (loc == 0) X%data(i,j) = 0.d0 - if (loc == 1) X%data(i,j) = 0.5d0 - end do + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 2_c_long) + if (loc == 0) X%data(i, j) = 0.d0 + if (loc == 1) X%data(i, j) = 0.5d0 + end do end do - if (FN_VInvTest(sX, sZ) == 1) failure = .true. - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 2_c_long) - if ((loc == 0) .and. (Z%data(i,j) /= 0.d0)) failure = .true. - if ((loc == 1) .and. (Z%data(i,j) /= 2.d0)) failure = .true. - end do + if (FN_VInvTest(sX, sZ) == 1) failure = .true. + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 2_c_long) + if ((loc == 0) .and. (Z%data(i, j) /= 0.d0)) failure = .true. + if ((loc == 1) .and. (Z%data(i, j) /= 2.d0)) failure = .true. + end do end do if (failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VInvTest Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VInvTest Case 2' else - print *, 'PASSED test -- FN_VInvTest Case 2' + print *, 'PASSED test -- FN_VInvTest Case 2' end if ! test FN_VConstrMask call FN_VConst(-1.d0, sZ) - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 7_c_long) - if (loc == 0) then ! y = -2, test for < 0 - Y%data(i,j) = -2.d0 - X%data(i,j) = -2.d0 - end if - if (loc == 1) then ! y = -1, test for <= 0 - Y%data(i,j) = -1.d0 - X%data(i,j) = -1.d0 - end if - if (loc == 2) then ! y = -1, test for == 0 - Y%data(i,j) = -1.d0 - X%data(i,j) = 0.d0 - end if - if (loc == 3) then ! y = 0, no test - Y%data(i,j) = 0.d0 - X%data(i,j) = 0.5d0 - end if - if (loc == 4) then ! y = 1, test for == 0 - Y%data(i,j) = 1.d0 - X%data(i,j) = 0.d0 - end if - if (loc == 5) then ! y = 1, test for >= 0 - Y%data(i,j) = 1.d0 - X%data(i,j) = 1.d0 - end if - if (loc == 6) then ! y = 2, test for > 0 - Y%data(i,j) = 2.d0 - X%data(i,j) = 2.d0 - end if - end do + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 7_c_long) + if (loc == 0) then ! y = -2, test for < 0 + Y%data(i, j) = -2.d0 + X%data(i, j) = -2.d0 + end if + if (loc == 1) then ! y = -1, test for <= 0 + Y%data(i, j) = -1.d0 + X%data(i, j) = -1.d0 + end if + if (loc == 2) then ! y = -1, test for == 0 + Y%data(i, j) = -1.d0 + X%data(i, j) = 0.d0 + end if + if (loc == 3) then ! y = 0, no test + Y%data(i, j) = 0.d0 + X%data(i, j) = 0.5d0 + end if + if (loc == 4) then ! y = 1, test for == 0 + Y%data(i, j) = 1.d0 + X%data(i, j) = 0.d0 + end if + if (loc == 5) then ! y = 1, test for >= 0 + Y%data(i, j) = 1.d0 + X%data(i, j) = 1.d0 + end if + if (loc == 6) then ! y = 2, test for > 0 + Y%data(i, j) = 2.d0 + X%data(i, j) = 2.d0 + end if + end do end do failure = .false. if (FN_VConstrMask(sY, sX, sZ) /= 1) then - failure = .true. + failure = .true. end if if ((check_ans(0.d0, 1.d-14, Nvar, N, sZ) /= 0) .or. failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VConstrMask Case 1' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VConstrMask Case 1' else - print *, 'PASSED test -- FN_VConstrMask Case 1' + print *, 'PASSED test -- FN_VConstrMask Case 1' end if call FN_VConst(-1.d0, sZ) - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 5_c_long) - if (loc == 0) then ! y = -2, test for < 0 - Y%data(i,j) = -2.d0 - X%data(i,j) = 2.d0 - end if - if (loc == 1) then ! y = -1, test for <= 0 - Y%data(i,j) = -1.d0 - X%data(i,j) = 1.d0 - end if - if (loc == 2) then ! y = 0, no test - Y%data(i,j) = 0.d0 - X%data(i,j) = 0.5d0 - end if - if (loc == 3) then ! y = 1, test for >= 0 - Y%data(i,j) = 1.d0 - X%data(i,j) = -1.d0 - end if - if (loc == 4) then ! y = 2, test for > 0 - Y%data(i,j) = 2.d0 - X%data(i,j) = -2.d0 - end if - end do + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 5_c_long) + if (loc == 0) then ! y = -2, test for < 0 + Y%data(i, j) = -2.d0 + X%data(i, j) = 2.d0 + end if + if (loc == 1) then ! y = -1, test for <= 0 + Y%data(i, j) = -1.d0 + X%data(i, j) = 1.d0 + end if + if (loc == 2) then ! y = 0, no test + Y%data(i, j) = 0.d0 + X%data(i, j) = 0.5d0 + end if + if (loc == 3) then ! y = 1, test for >= 0 + Y%data(i, j) = 1.d0 + X%data(i, j) = -1.d0 + end if + if (loc == 4) then ! y = 2, test for > 0 + Y%data(i, j) = 2.d0 + X%data(i, j) = -2.d0 + end if + end do end do failure = .false. if (FN_VConstrMask(sY, sX, sZ) /= 0) then - failure = .true. - end if - do j = 1,N - do i = 1,Nvar - loc = mod((j-1)*Nvar + i - 1, 5_c_long) - if (loc == 2) then - if (Z%data(i,j) /= 0.d0) failure = .true. - else - if (Z%data(i,j) /= 1.d0) failure = .true. - end if - end do + failure = .true. + end if + do j = 1, N + do i = 1, Nvar + loc = mod((j - 1)*Nvar + i - 1, 5_c_long) + if (loc == 2) then + if (Z%data(i, j) /= 0.d0) failure = .true. + else + if (Z%data(i, j) /= 1.d0) failure = .true. + end if + end do end do if (failure) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VConstrMask Case 2' + fails = fails + 1 + print *, '>>> FAILED test -- FN_VConstrMask Case 2' else - print *, 'PASSED test -- FN_VConstrMask Case 2' + print *, 'PASSED test -- FN_VConstrMask Case 2' end if ! test FN_VMinQuotient call FN_VConst(2.d0, sX) call FN_VConst(2.d0, sY) - X%data(Nvar,N) = 0.5d0 + X%data(Nvar, N) = 0.5d0 fac = 0.25d0 - if (dabs(FN_VMinQuotient(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMinQuotient Case 1' + if (dabs(FN_VMinQuotient(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMinQuotient Case 1' else - print *, 'PASSED test -- FN_VMinQuotient Case 1' + print *, 'PASSED test -- FN_VMinQuotient Case 1' end if call FN_VConst(2.d0, sX) call FN_VConst(0.d0, sY) fac = 1.d307 - if (dabs(FN_VMinQuotient(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VMinQuotient Case 2' + if (dabs(FN_VMinQuotient(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VMinQuotient Case 2' else - print *, 'PASSED test -- FN_VMinQuotient Case 2' + print *, 'PASSED test -- FN_VMinQuotient Case 2' end if ! test FN_VWSqrSumLocal call FN_VConst(-1.d0, sX) call FN_VConst(0.5d0, sY) fac = 0.25d0*N*Nvar - if (dabs(FN_VWSqrSumLocal(sX,sY) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWSqrSumLocal (',FN_VWSqrSumLocal(sX,sY),' /= ',fac,')' + if (dabs(FN_VWSqrSumLocal(sX, sY) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWSqrSumLocal (', FN_VWSqrSumLocal(sX, sY), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWSqrSumLocal' + print *, 'PASSED test -- FN_VWSqrSumLocal' end if - ! test FN_VWSqrSumMaskLocal call FN_VConst(-1.d0, sX) call FN_VConst(0.5d0, sY) call FN_VConst(1.d0, sZ) - Z%data(Nvar,N) = 0.d0 - fac = 0.25d0*(N*Nvar-1) - if (dabs(FN_VWSqrSumMaskLocal(sX,sY,sZ) - fac) > 1.d-14) then - fails = fails + 1 - print *, '>>> FAILED test -- FN_VWSqrSumMaskLocal (',FN_VWSqrSumMaskLocal(sX,sY,sZ),' /= ',fac,')' + Z%data(Nvar, N) = 0.d0 + fac = 0.25d0*(N*Nvar - 1) + if (dabs(FN_VWSqrSumMaskLocal(sX, sY, sZ) - fac) > 1.d-14) then + fails = fails + 1 + print *, '>>> FAILED test -- FN_VWSqrSumMaskLocal (', FN_VWSqrSumMaskLocal(sX, sY, sZ), ' /= ', fac, ')' else - print *, 'PASSED test -- FN_VWSqrSumMaskLocal' + print *, 'PASSED test -- FN_VWSqrSumMaskLocal' end if ! free vectors @@ -704,17 +700,17 @@ program main call FN_VDestroy(sZ) ! Free vector data - deallocate(Udata) + deallocate (Udata) ! free SUNDIALS context fails = FSUNContext_Free(sunctx) ! print results if (fails > 0) then - print '(a,i3,a)', 'FAIL: FNVector module failed ',fails,' tests' - stop 1 + print '(a,i3,a)', 'FAIL: FNVector module failed ', fails, ' tests' + stop 1 else - print *, 'SUCCESS: FNVector module passed all tests' + print *, 'SUCCESS: FNVector module passed all tests' end if print *, ' ' diff --git a/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 index 15752897ce..dc1985d6ae 100644 --- a/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunlinsol_fortran_mod.f90 @@ -39,29 +39,29 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa x => FN_VGetFVec(sunvec_x) y => FN_VGetFVec(sunvec_y) failure = 0 - do j = 1,N - do i = 1,Nvar - if (dabs(x%data(i,j) - y%data(i,j)) > tol) then - failure = 1 - end if - end do + do j = 1, N + do i = 1, Nvar + if (dabs(x%data(i, j) - y%data(i, j)) > tol) then + failure = 1 + end if + end do end do if (failure == 1) then - print *, ' ' - print *, 'check_vector failure, differences:' - print *, ' blk idx x y diff' - print *, ' --------------------------------------------' - do j = 1,N - do i = 1,Nvar - if (dabs(x%data(i,j) - y%data(i,j)) > tol) then - print '(2x,2(i4,3x),3(es9.2,1x))', j, i, x%data(i,j), & - y%data(i,j), dabs(x%data(i,j) - y%data(i,j)) - end if - end do - end do - print *, ' --------------------------------------------' - print *, ' ' + print *, ' ' + print *, 'check_vector failure, differences:' + print *, ' blk idx x y diff' + print *, ' --------------------------------------------' + do j = 1, N + do i = 1, Nvar + if (dabs(x%data(i, j) - y%data(i, j)) > tol) then + print '(2x,2(i4,3x),3(es9.2,1x))', j, i, x%data(i, j), & + y%data(i, j), dabs(x%data(i, j) - y%data(i, j)) + end if + end do + end do + print *, ' --------------------------------------------' + print *, ' ' end if end function check_vector @@ -82,107 +82,105 @@ program main ! local variables type(c_ptr) :: sunctx integer(c_int) :: fails, retval, j, k - integer(c_int64_t), parameter :: N = 1000 - integer(c_int64_t), parameter :: Nvar = 50 - type(SUNMatrix), pointer :: sA - type(FMat), pointer :: A + integer(c_int64_t), parameter :: N = 1000 + integer(c_int64_t), parameter :: Nvar = 50 + type(SUNMatrix), pointer :: sA + type(FMat), pointer :: A type(SUNLinearSolver), pointer :: LS - type(FLinSol), pointer :: S - type(N_Vector), pointer :: sX, sY, sB - type(FVec), pointer :: X, B - + type(FLinSol), pointer :: S + type(N_Vector), pointer :: sX, sY, sB + type(FVec), pointer :: X, B !======= Internals ============ ! initialize failure total fails = 0 - ! create SUNDIALS context + ! create SUNDIALS context fails = FSUNContext_Create(SUN_COMM_NULL, sunctx) ! create new matrices and vectors sX => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sX)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if X => FN_VGetFVec(sX) sY => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sY)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sB => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sB)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if B => FN_VGetFVec(sB) sA => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sA)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if A => FSUNMatGetFMat(sA) - ! fill A and X with uniformly-distributed random numbers in [0,1) call random_number(X%data) call random_number(A%data) ! update A to scale by 1/Nvar, and 1 to anti-diagonal of each diagonal block - do k = 1,N - A%data(:,:,k) = A%data(:,:,k)/Nvar - do j = 1,Nvar - A%data(Nvar-j+1,j,k) = A%data(Nvar-j+1,j,k) + 1.d0 - end do + do k = 1, N + A%data(:, :, k) = A%data(:, :, k)/Nvar + do j = 1, Nvar + A%data(Nvar - j + 1, j, k) = A%data(Nvar - j + 1, j, k) + 1.d0 + end do end do ! compute B = A*X retval = FSUNMatMatvec(sA, sX, sB) if (retval /= SUN_SUCCESS) then - print *, 'ERROR: FSUNMatMatvec fail' - stop 1 + print *, 'ERROR: FSUNMatMatvec fail' + stop 1 end if ! create custom linear solver LS => FSUNLinSolNew_Fortran(Nvar, N, sunctx) if (.not. associated(LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if S => FSUNLinSolGetFLinSol(LS) ! test SUNLinSolGetType if (FSUNLinSolGetType(LS) /= SUNLINEARSOLVER_DIRECT) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNLinSolGetType' - print *, ' Unrecognized vector type', FSUNLinSolGetType(LS) + fails = fails + 1 + print *, '>>> FAILED test -- FSUNLinSolGetType' + print *, ' Unrecognized vector type', FSUNLinSolGetType(LS) else - print *, 'PASSED test -- FSUNLinSolGetType' + print *, 'PASSED test -- FSUNLinSolGetType' end if ! test SUNLinSolSetup retval = FSUNLinSolSetup(LS, sA) if (retval /= SUN_SUCCESS) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNLinSolSetup' + fails = fails + 1 + print *, '>>> FAILED test -- FSUNLinSolSetup' else - print *, 'PASSED test -- FSUNLinSolSetup' + print *, 'PASSED test -- FSUNLinSolSetup' end if ! test SUNLinSolSolve call FN_VConst(0.d0, sY) retval = FSUNLinSolSolve(LS, sA, sY, sB, 1.d-9) - if ( (check_vector(sX, sY, 1.d-15*Nvar*Nvar, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNLinSolSolve' + if ((check_vector(sX, sY, 1.d-15*Nvar*Nvar, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNLinSolSolve' else - print *, 'PASSED test -- FSUNLinSolSolve' + print *, 'PASSED test -- FSUNLinSolSolve' end if ! free solver, matrix and vectors @@ -192,10 +190,10 @@ program main call FN_VDestroy(sB) retval = FSUNLinSolFree(LS) if (retval /= 0) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNLinSolFree' + fails = fails + 1 + print *, '>>> FAILED test -- FSUNLinSolFree' else - print *, 'PASSED test -- FSUNLinSolFree' + print *, 'PASSED test -- FSUNLinSolFree' end if ! free SUNDIALS context @@ -203,10 +201,10 @@ program main ! print results if (fails > 0) then - print '(a,i3,a)', 'FAIL: FSUNLinSol module failed ',fails,' tests' - stop 1 + print '(a,i3,a)', 'FAIL: FSUNLinSol module failed ', fails, ' tests' + stop 1 else - print *, 'SUCCESS: FSUNLinSol module passed all tests' + print *, 'SUCCESS: FSUNLinSol module passed all tests' end if print *, ' ' diff --git a/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 b/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 index da5fe15966..190d1b9b61 100644 --- a/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 +++ b/examples/arkode/F2003_custom/test_fsunmatrix_fortran_mod.f90 @@ -38,12 +38,12 @@ integer(c_int) function check_matrix(sunmat_A, sunmat_B, tol, Nvar, N) result(fa A => FSUNMatGetFMat(sunmat_A) B => FSUNMatGetFMat(sunmat_B) failure = 0 - do k = 1,N - do j = 1,Nvar - do i = 1,Nvar - if (dabs(A%data(i,j,k) - B%data(i,j,k)) > tol) failure = 1 - end do - end do + do k = 1, N + do j = 1, Nvar + do i = 1, Nvar + if (dabs(A%data(i, j, k) - B%data(i, j, k)) > tol) failure = 1 + end do + end do end do end function check_matrix @@ -60,12 +60,12 @@ integer(c_int) function check_matrix_entry(sunmat_A, val, tol, Nvar, N) result(f A => FSUNMatGetFMat(sunmat_A) failure = 0 - do k = 1,N - do j = 1,Nvar - do i = 1,Nvar - if (dabs(A%data(i,j,k) - val) > tol) failure = 1 - end do - end do + do k = 1, N + do j = 1, Nvar + do i = 1, Nvar + if (dabs(A%data(i, j, k) - val) > tol) failure = 1 + end do + end do end do end function check_matrix_entry @@ -83,29 +83,29 @@ integer(c_int) function check_vector(sunvec_x, sunvec_y, tol, Nvar, N) result(fa x => FN_VGetFVec(sunvec_x) y => FN_VGetFVec(sunvec_y) failure = 0 - do j = 1,N - do i = 1,Nvar - if (dabs(x%data(i,j) - y%data(i,j)) > tol) then - failure = 1 - end if - end do + do j = 1, N + do i = 1, Nvar + if (dabs(x%data(i, j) - y%data(i, j)) > tol) then + failure = 1 + end if + end do end do if (failure == 1) then - print *, ' ' - print *, 'check_vector failure, differences:' - print *, ' i j x y diff' - print *, ' --------------------------------------------' - do j = 1,N - do i = 1,Nvar - if (dabs(x%data(i,j) - y%data(i,j)) > tol) then - print '(2x,2(i4,3x),3(es9.2,1x))', i, j, x%data(i,j), & - y%data(i,j), dabs(x%data(i,j) - y%data(i,j)) - end if - end do - end do - print *, ' --------------------------------------------' - print *, ' ' + print *, ' ' + print *, 'check_vector failure, differences:' + print *, ' i j x y diff' + print *, ' --------------------------------------------' + do j = 1, N + do i = 1, Nvar + if (dabs(x%data(i, j) - y%data(i, j)) > tol) then + print '(2x,2(i4,3x),3(es9.2,1x))', i, j, x%data(i, j), & + y%data(i, j), dabs(x%data(i, j) - y%data(i, j)) + end if + end do + end do + print *, ' --------------------------------------------' + print *, ' ' end if end function check_vector @@ -131,10 +131,9 @@ program main integer(c_int64_t), parameter :: Nvar = 50 type(SUNMatrix), pointer :: sA, sB, sC, sD, sI type(FMat), pointer :: A, Eye - type(N_Vector), pointer :: sW, sX, sY, sZ + type(N_Vector), pointer :: sW, sX, sY, sZ type(FVec), pointer :: X, Y - !======= Internals ============ ! initialize failure total @@ -146,140 +145,139 @@ program main ! create new matrices and vectors sW => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sW)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sX => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sX)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if X => FN_VGetFVec(sX) sY => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sY)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if Y => FN_VGetFVec(sY) sZ => FN_VNew_Fortran(Nvar, N, sunctx) if (.not. associated(sZ)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sA => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sA)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if A => FSUNMatGetFMat(sA) sB => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sB)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sC => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sC)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sD => FSUNMatNew_Fortran(Nvar, N, sunctx) if (.not. associated(sD)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if call c_f_pointer(FSUNMatClone_Fortran(sA), sI) if (.not. associated(sI)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if Eye => FSUNMatGetFMat(sI) - ! fill matrices and vectors X%data = 0.d0 Y%data = 0.d0 A%data = 0.d0 Eye%data = 0.d0 - do k = 1,N - do j = 1,Nvar - do i = 1,Nvar - A%data(i,j,k) = 1.d0*i*j/k - end do - Eye%data(j,j,k) = 1.d0 - x%data(j,k) = 1.d0*k/j - y%data(j,k) = 1.d0*j*Nvar - end do + do k = 1, N + do j = 1, Nvar + do i = 1, Nvar + A%data(i, j, k) = 1.d0*i*j/k + end do + Eye%data(j, j, k) = 1.d0 + x%data(j, k) = 1.d0*k/j + y%data(j, k) = 1.d0*j*Nvar + end do end do ! check matrix ID if (FSUNMatGetID(sA) /= SUNMATRIX_CUSTOM) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatGetID' - print *, ' Unrecognized vector type', FSUNMatGetID(sA) + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatGetID' + print *, ' Unrecognized vector type', FSUNMatGetID(sA) else - print *, 'PASSED test -- FSUNMatGetID' + print *, 'PASSED test -- FSUNMatGetID' end if ! test SUNMatZero retval = FSUNMatZero(sB) - if ( (check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatZero' + if ((check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatZero' else - print *, 'PASSED test -- FSUNMatZero' + print *, 'PASSED test -- FSUNMatZero' end if ! test SUNMatCopy retval = FSUNMatCopy(sA, sB) - if ( (check_matrix(sA, sB, 1.d-14, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatCopy' + if ((check_matrix(sA, sB, 1.d-14, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatCopy' else - print *, 'PASSED test -- FSUNMatCopy' + print *, 'PASSED test -- FSUNMatCopy' end if ! test SUNMatScaleAdd retval = FSUNMatCopy(sA, sB) retval = FSUNMatScaleAdd(-1.d0, sB, sB) - if ( (check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatScaleAdd case 1' + if ((check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatScaleAdd case 1' else - print *, 'PASSED test -- FSUNMatScaleAdd case 1' + print *, 'PASSED test -- FSUNMatScaleAdd case 1' end if retval = FSUNMatCopy(sA, sD) retval = FSUNMatCopy(sI, sC) retval = FSUNMatScaleAdd(1.d0, sD, sI) - if (retval == SUN_SUCCESS) retval = FSUNMatScaleAdd(1.d0, sC, sA) - if ( (check_matrix(sD, sC, 1.d-14, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatScaleAdd case 2' + if (retval == SUN_SUCCESS) retval = FSUNMatScaleAdd(1.d0, sC, sA) + if ((check_matrix(sD, sC, 1.d-14, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatScaleAdd case 2' else - print *, 'PASSED test -- FSUNMatScaleAdd case 2' + print *, 'PASSED test -- FSUNMatScaleAdd case 2' end if ! test SUNMatScaleAddI retval = FSUNMatCopy(sI, sB) retval = FSUNMatScaleAddI(-1.d0, sB) - if ( (check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatScaleAddI' + if ((check_matrix_entry(sB, 0.d0, 1.d-14, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatScaleAddI' else - print *, 'PASSED test -- FSUNMatScaleAddI' + print *, 'PASSED test -- FSUNMatScaleAddI' end if ! test SUNMatMatvec @@ -287,12 +285,12 @@ program main retval = FSUNMatScaleAddI(3.d0, sB) retval = FSUNMatMatvec(sB, sX, sZ) call FN_VLinearSum(3.d0, sY, 1.d0, sX, sW) - if ( (check_vector(sW, sZ, 1.d-15*Nvar*Nvar, Nvar, N) /= 0) & - .or. (retval /= SUN_SUCCESS) ) then - fails = fails + 1 - print *, '>>> FAILED test -- FSUNMatMatvec' + if ((check_vector(sW, sZ, 1.d-15*Nvar*Nvar, Nvar, N) /= 0) & + .or. (retval /= SUN_SUCCESS)) then + fails = fails + 1 + print *, '>>> FAILED test -- FSUNMatMatvec' else - print *, 'PASSED test -- FSUNMatMatvec' + print *, 'PASSED test -- FSUNMatMatvec' end if ! free matrices and vectors @@ -311,10 +309,10 @@ program main ! print results if (fails > 0) then - print '(a,i3,a)', 'FAIL: FSUNMatrix module failed ',fails,' tests' - stop 1 + print '(a,i3,a)', 'FAIL: FSUNMatrix module failed ', fails, ' tests' + stop 1 else - print *, 'SUCCESS: FSUNMatrix module passed all tests' + print *, 'SUCCESS: FSUNMatrix module passed all tests' end if print *, ' ' 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 297b036559..f35968c09b 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 @@ -141,7 +141,7 @@ module ode_mod ! Compute the advection term integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -153,7 +153,7 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: ydata(:) @@ -176,29 +176,29 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & call ExchangeAllStart(sunvec_y) ! Iterate over domain interior, computing advection - tmp = -c / dx + tmp = -c/dx if (c > 0.0d0) then - ! right moving flow - do j = 2,Npts - do i = 1,Nvar - idx1 = i + (j - 1) * Nvar - idx2 = i + (j - 2) * Nvar - fdata(idx1) = tmp * (ydata(idx1) - ydata(idx2)) - end do - end do + ! right moving flow + do j = 2, Npts + do i = 1, Nvar + idx1 = i + (j - 1)*Nvar + idx2 = i + (j - 2)*Nvar + fdata(idx1) = tmp*(ydata(idx1) - ydata(idx2)) + end do + end do else if (c < 0.0d0) then - ! left moving flow - do j = 1,Npts - 1 - do i = 1,Nvar - idx1 = i + (j - 1) * Nvar - idx2 = i + j * Nvar - fdata(idx1) = tmp * (ydata(idx2) - ydata(idx1)) - end do - end do + ! left moving flow + do j = 1, Npts - 1 + do i = 1, Nvar + idx1 = i + (j - 1)*Nvar + idx2 = i + j*Nvar + fdata(idx1) = tmp*(ydata(idx2) - ydata(idx1)) + end do + end do end if @@ -208,14 +208,14 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & ! compute advection at local boundaries if (c > 0.0d0) then - ! right moving flow (left boundary) - fdata(1:Nvar) = tmp * (ydata(1:Nvar) - Wrecv) + ! right moving flow (left boundary) + fdata(1:Nvar) = tmp*(ydata(1:Nvar) - Wrecv) else if (c < 0.0) then - ! left moving flow (right boundary) - fdata(Nvar * Npts - 2 : Nvar * Npts) = & - tmp * (Erecv - ydata(Nvar * Npts-2 : Nvar * Npts)) + ! left moving flow (right boundary) + fdata(Nvar*Npts - 2:Nvar*Npts) = & + tmp*(Erecv - ydata(Nvar*Npts - 2:Nvar*Npts)) end if @@ -224,10 +224,9 @@ integer(c_int) function Advection(t, sunvec_y, sunvec_f, user_data) & end function Advection - ! Compute the reaction term integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -239,7 +238,7 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: ydata(:) @@ -258,40 +257,40 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & ! iterate over domain, computing reactions if (explicit) then - ! when integrating explicitly, we add to ydot as we expect it - ! to hold the advection term already - do j = 1,Npts + ! when integrating explicitly, we add to ydot as we expect it + ! to hold the advection term already + do j = 1, Npts - idx = (j - 1) * Nvar + idx = (j - 1)*Nvar - u = ydata(idx + 1) - v = ydata(idx + 2) - w = ydata(idx + 3) + u = ydata(idx + 1) + v = ydata(idx + 2) + w = ydata(idx + 3) - fdata(idx + 1) = fdata(idx + 1) + k1 * A - k2 * w * u + k3 * u * u * v - k4 * u - fdata(idx + 2) = fdata(idx + 2) + k2 * w * u - k3 * u * u * v - fdata(idx + 3) = fdata(idx + 3) - k2 * w * u + k5 * B - k6 * w + fdata(idx + 1) = fdata(idx + 1) + k1*A - k2*w*u + k3*u*u*v - k4*u + fdata(idx + 2) = fdata(idx + 2) + k2*w*u - k3*u*u*v + fdata(idx + 3) = fdata(idx + 3) - k2*w*u + k5*B - k6*w - end do + end do else - ! set output to zero - fdata = 0.0d0 + ! set output to zero + fdata = 0.0d0 - do j = 1,Npts + do j = 1, Npts - idx = (j - 1) * Nvar + idx = (j - 1)*Nvar - u = ydata(idx + 1) - v = ydata(idx + 2) - w = ydata(idx + 3) + u = ydata(idx + 1) + v = ydata(idx + 2) + w = ydata(idx + 3) - fdata(idx + 1) = k1 * A - k2 * w * u + k3 * u * u * v - k4 * u - fdata(idx + 2) = k2 * w * u - k3 * u * u * v - fdata(idx + 3) = -k2 * w * u + k5 * B - k6 * w + fdata(idx + 1) = k1*A - k2*w*u + k3*u*u*v - k4*u + fdata(idx + 2) = k2*w*u - k3*u*u*v + fdata(idx + 3) = -k2*w*u + k5*B - k6*w - end do + end do end if @@ -300,10 +299,9 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & end function Reaction - ! Compute the RHS as Advection + Reaction integer(c_int) function AdvectionReaction(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -315,7 +313,7 @@ integer(c_int) function AdvectionReaction(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data !======= Internals ============ @@ -335,7 +333,6 @@ end function AdvectionReaction end module ode_mod - module prec_mod !======= Inclusions =========== @@ -348,7 +345,7 @@ module prec_mod ! preconditioner data type(SUNLinearSolver), pointer :: sunls_P ! linear solver - type(SUNMatrix), pointer :: sunmat_P ! matrix + type(SUNMatrix), pointer :: sunmat_P ! matrix contains @@ -358,13 +355,13 @@ module prec_mod ! Sets P = I - gamma * J integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & - user_data) result(ierr) bind(C) + user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod use fsunlinsol_dense_mod - use ode_mod, only : Nvar, Npts, Neq, k2, k3, k4, k6, myindextype + use ode_mod, only: Nvar, Npts, Neq, k2, k3, k4, k6, myindextype !======= Declarations ========= implicit none @@ -376,7 +373,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & integer(c_int), value :: jok ! flag to signal for Jacobian update integer(c_int) :: jcurPtr ! flag to singal Jacobian is current real(c_double), value :: gamma ! current gamma value - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local variables real(c_double), pointer :: ydata(:) ! vector data @@ -394,67 +391,67 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & ! update Jacobian if (jok == 0) then - ! zero the matrix - ierr = FSUNMatZero(sunmat_P) - if (ierr /= 0) then - print *, "Error: FSUNMatZero returned ",ierr - return - end if + ! zero the matrix + ierr = FSUNMatZero(sunmat_P) + if (ierr /= 0) then + print *, "Error: FSUNMatZero returned ", ierr + return + end if - ! setup the block diagonal preconditioner matrix - do i = 1,Npts + ! setup the block diagonal preconditioner matrix + do i = 1, Npts - ! set nodal value shortcuts - idx = (i - 1) * Nvar + ! set nodal value shortcuts + idx = (i - 1)*Nvar - u = ydata(idx + 1) - v = ydata(idx + 2) - w = ydata(idx + 3) + u = ydata(idx + 1) + v = ydata(idx + 2) + w = ydata(idx + 3) - ! fill in Jacobian entries for this mesh node + ! fill in Jacobian entries for this mesh node - ! first column (derivative with respect to u) - offset = (i - 1) * Nvar * Neq + (i - 1) * Nvar + ! first column (derivative with respect to u) + offset = (i - 1)*Nvar*Neq + (i - 1)*Nvar - pdata(offset + 1) = -k2 * w + 2.0d0 * k3 * u * v - k4 - pdata(offset + 2) = k2 * w - 2.0d0 * k3 * u * v - pdata(offset + 3) = -k2 * w + pdata(offset + 1) = -k2*w + 2.0d0*k3*u*v - k4 + pdata(offset + 2) = k2*w - 2.0d0*k3*u*v + pdata(offset + 3) = -k2*w - ! second column (derivative with respect to v) - offset = offset + Nvar * Npts + ! second column (derivative with respect to v) + offset = offset + Nvar*Npts - pdata(offset + 1) = k3 * u * u - pdata(offset + 2) = -k3 * u * u - pdata(offset + 3) = 0.0d0 + pdata(offset + 1) = k3*u*u + pdata(offset + 2) = -k3*u*u + pdata(offset + 3) = 0.0d0 - ! thrid column (derivative with respect to v) - offset = offset + Neq + ! thrid column (derivative with respect to v) + offset = offset + Neq - pdata(offset + 1) = -k2 * u - pdata(offset + 2) = k2 * u - pdata(offset + 3) = -k2 * u - k6 + pdata(offset + 1) = -k2*u + pdata(offset + 2) = k2*u + pdata(offset + 3) = -k2*u - k6 - end do + end do - ierr = FSUNMatScaleAddI(-gamma, sunmat_P) - if (ierr /= 0) then - print *, "Error: FSUNMatScaleAddI returned ",ierr - return - end if + ierr = FSUNMatScaleAddI(-gamma, sunmat_P) + if (ierr /= 0) then + print *, "Error: FSUNMatScaleAddI returned ", ierr + return + end if - ! setup the linear system Pz = r - ierr = FSUNLinSolSetup(sunls_P, sunmat_P) - if (ierr /= 0) then - print *, "Error: FSUNLinSolSetup returned ",ierr - return - end if + ! setup the linear system Pz = r + ierr = FSUNLinSolSetup(sunls_P, sunmat_P) + if (ierr /= 0) then + print *, "Error: FSUNLinSolSetup returned ", ierr + return + end if - ! indicate that J is now current - jcurPtr = 1 + ! indicate that J is now current + jcurPtr = 1 else - jcurPtr = 0 + jcurPtr = 0 end if @@ -463,10 +460,9 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & end function PSetup - ! Solves Pz = r integer(c_int) function PSolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & - gamma, delta, lr, user_data) result(ierr) bind(C) + gamma, delta, lr, user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -484,7 +480,7 @@ integer(c_int) function PSolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & real(c_double), value :: gamma ! current gamma value real(c_double), value :: delta ! current gamma value integer(c_int), value :: lr ! left or right preconditioning - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! shortcuts type(N_Vector), pointer :: z_local ! z vector data @@ -498,8 +494,8 @@ integer(c_int) function PSolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & ! solve the task-local linear system Pz = r ierr = FSUNLinSolSolve(sunls_P, sunmat_P, z_local, r_local, delta) if (ierr /= 0) then - print *, "Error: FSUNLinSolSolver returned ",ierr - return + print *, "Error: FSUNLinSolSolver returned ", ierr + return end if ! return success @@ -509,7 +505,6 @@ end function PSolve end module prec_mod - module nls_mod !======= Inclusions =========== @@ -533,8 +528,8 @@ module nls_mod type(c_ptr) :: sdata_ptr ! residual data ! node local linear solver and data - type(N_Vector), pointer :: sunvec_bnode ! node lobal rhs/solution vec - type(SUNMatrix), pointer :: sunmat_Jnode ! node local Jacobian + type(N_Vector), pointer :: sunvec_bnode ! node lobal rhs/solution vec + type(SUNMatrix), pointer :: sunmat_Jnode ! node local Jacobian type(SUNLinearSolver), pointer :: sunls_Jnode ! node local linear solver ! nonlinear solver counters @@ -548,13 +543,13 @@ module nls_mod ! -------------------------------------------------------------- integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding use farkode_mod use farkode_arkstep_mod - use ode_mod, only : Neq, Reaction, myindextype + use ode_mod, only: Neq, Reaction, myindextype !======= Declarations ========= implicit none @@ -592,29 +587,29 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) ! get nonlinear residual data ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & - Fi_ptr, gam, sdata_ptr, user_data) + Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKodeGetNonlinearSystemData returned ",ierr - return + print *, "Error: FARKodeGetNonlinearSystemData returned ", ierr + return end if ! get vectors from pointers sunvec_zpred => FN_VGetVecAtIndexVectorArray(zpred_ptr, 0) - sunvec_z => FN_VGetVecAtIndexVectorArray(z_ptr, 0) - sunvec_Fi => FN_VGetVecAtIndexVectorArray(Fi_ptr, 0) + sunvec_z => FN_VGetVecAtIndexVectorArray(z_ptr, 0) + sunvec_Fi => FN_VGetVecAtIndexVectorArray(Fi_ptr, 0) sunvec_sdata => FN_VGetVecAtIndexVectorArray(sdata_ptr, 0) ! get vector data arrays - ycor_data => FN_VGetArrayPointer(sunvec_zcor) - F_data => FN_VGetArrayPointer(sunvec_F) + ycor_data => FN_VGetArrayPointer(sunvec_zcor) + F_data => FN_VGetArrayPointer(sunvec_F) zpred_data => FN_VGetArrayPointer(sunvec_zpred) - z_data => FN_VGetArrayPointer(sunvec_z) - Fi_data => FN_VGetArrayPointer(sunvec_Fi) + z_data => FN_VGetArrayPointer(sunvec_z) + Fi_data => FN_VGetArrayPointer(sunvec_Fi) sdata_data => FN_VGetArrayPointer(sunvec_sdata) ! update "z" value as stored predictor + current corrector - do i = 1,Neq - z_data(i) = zpred_data(i) + ycor_data(i) + do i = 1, Neq + z_data(i) = zpred_data(i) + ycor_data(i) end do ! compute implicit RHS and save for later @@ -625,13 +620,13 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) ! check RHS return value if (ierr /= 0) then - print *, "Error: Reaction returned ",ierr - return + print *, "Error: Reaction returned ", ierr + return end if ! compute the nonlinear resiudal - do i = 1,Neq - F_data(i) = ycor_data(i) - sdata_data(i) - gam(1) * Fi_data(i) + do i = 1, Neq + F_data(i) = ycor_data(i) - sdata_data(i) - gam(1)*Fi_data(i) end do ! return success @@ -639,16 +634,15 @@ integer(c_int) function TaskLocalNlsResidual(sunvec_zcor, sunvec_F, arkode_mem) end function TaskLocalNlsResidual - integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding use farkode_mod use farkode_arkstep_mod use fsunmatrix_dense_mod - use ode_mod, only : Nvar, Npts, k2, k3, k4, k6, myindextype + use ode_mod, only: Nvar, Npts, k2, k3, k4, k6, myindextype !======= Declarations ========= implicit none @@ -678,10 +672,10 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & ! get nonlinear residual data ierr = FARKodeGetNonlinearSystemData(arkmem, tcur, zpred_ptr, z_ptr, & - Fi_ptr, gam, sdata_ptr, user_data) + Fi_ptr, gam, sdata_ptr, user_data) if (ierr /= 0) then - print *, "Error: FARKodeGetNonlinearSystemData returned ",ierr - return + print *, "Error: FARKodeGetNonlinearSystemData returned ", ierr + return end if ! get vectors from pointers @@ -695,59 +689,59 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & bnode_data => FN_VGetArrayPointer(sunvec_bnode) ! solve the linear system at each mesh node - do i = 1,Npts - - ! set nodal value shortcuts - idx = (i - 1) * Nvar - - u = z_data(idx + 1) - v = z_data(idx + 2) - w = z_data(idx + 3) - - ! fill in Jacobian entries for this mesh node - - ! first column (derivative with respect to u) - J_data(1) = -k2 * w + 2.0d0 * k3 * u * v - k4 - J_data(2) = k2 * w - 2.0d0 * k3 * u * v - J_data(3) = -k2 * w - - ! second column (derivative with respect to v) - J_data(4) = k3 * u * u - J_data(5) = -k3 * u * u - J_data(6) = 0.0d0 - - ! thrid column (derivative with respect to v) - J_data(7) = -k2 * u - J_data(8) = k2 * u - J_data(9) = -k2 * u - k6 - - ! I - gamma*J - ierr = FSUNMatScaleAddI(-gam(1), sunmat_Jnode) - if (ierr /= 0) then - print *, "Error: FSUNMatScaleAddI returned ",ierr - return - end if - - ! grab just the portion of the vector "b" for this mesh node - bnode_data = b_data(idx + 1 : idx + 3) - - ! setup the linear system - ierr = FSUNLinSolSetup(sunls_Jnode, sunmat_Jnode) - if (ierr /= 0) then - print *, "Error: FSUNLinSolSolSetup returned ",ierr - return - end if - - ! solve the linear system - ierr = FSUNLinSolSolve(sunls_Jnode, sunmat_Jnode, sunvec_bnode, & - sunvec_bnode, 0.0d0) - if (ierr /= 0) then - print *, "Error: FSUNLinSolSolve returned ",ierr - return - end if - - ! set just the portion of the vector "b" for this mesh node - b_data(idx + 1 : idx + 3) = bnode_data + do i = 1, Npts + + ! set nodal value shortcuts + idx = (i - 1)*Nvar + + u = z_data(idx + 1) + v = z_data(idx + 2) + w = z_data(idx + 3) + + ! fill in Jacobian entries for this mesh node + + ! first column (derivative with respect to u) + J_data(1) = -k2*w + 2.0d0*k3*u*v - k4 + J_data(2) = k2*w - 2.0d0*k3*u*v + J_data(3) = -k2*w + + ! second column (derivative with respect to v) + J_data(4) = k3*u*u + J_data(5) = -k3*u*u + J_data(6) = 0.0d0 + + ! thrid column (derivative with respect to v) + J_data(7) = -k2*u + J_data(8) = k2*u + J_data(9) = -k2*u - k6 + + ! I - gamma*J + ierr = FSUNMatScaleAddI(-gam(1), sunmat_Jnode) + if (ierr /= 0) then + print *, "Error: FSUNMatScaleAddI returned ", ierr + return + end if + + ! grab just the portion of the vector "b" for this mesh node + bnode_data = b_data(idx + 1:idx + 3) + + ! setup the linear system + ierr = FSUNLinSolSetup(sunls_Jnode, sunmat_Jnode) + if (ierr /= 0) then + print *, "Error: FSUNLinSolSolSetup returned ", ierr + return + end if + + ! solve the linear system + ierr = FSUNLinSolSolve(sunls_Jnode, sunmat_Jnode, sunvec_bnode, & + sunvec_bnode, 0.0d0) + if (ierr /= 0) then + print *, "Error: FSUNLinSolSolve returned ", ierr + return + end if + + ! set just the portion of the vector "b" for this mesh node + b_data(idx + 1:idx + 3) = bnode_data end do @@ -756,9 +750,8 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & end function TaskLocalLSolve - integer(SUNNonlinearSolver_Type) function TaskLocalNewton_GetType(sunnls) & - result(id) bind(C) + result(id) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -775,9 +768,8 @@ integer(SUNNonlinearSolver_Type) function TaskLocalNewton_GetType(sunnls) & end function TaskLocalNewton_GetType - integer(c_int) function TaskLocalNewton_Initialize(sunnls) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -793,20 +785,20 @@ integer(c_int) function TaskLocalNewton_Initialize(sunnls) & ! override default system and lsolve functions with local versions ierr = FSUNNonlinSolSetSysFn(sunnls_LOC, c_funloc(TaskLocalNlsResidual)) if (ierr /= 0) then - print *, "Error: FSUNNonlinSolSetSysFn returned ",ierr - return + print *, "Error: FSUNNonlinSolSetSysFn returned ", ierr + return end if ierr = FSUNNonlinSolSetLSolveFn(sunnls_LOC, c_funloc(TaskLocalLSolve)) if (ierr /= 0) then - print *, "Error: FSUNNonlinSolSetLSolveFn returned ",ierr - return + print *, "Error: FSUNNonlinSolSetLSolveFn returned ", ierr + return end if ierr = FSUNNonlinSolInitialize(sunnls_LOC) if (ierr /= 0) then - print *, "Error: FSUNNonlinSolSetLSolveFn returned ",ierr - return + print *, "Error: FSUNNonlinSolSetLSolveFn returned ", ierr + return end if ! return success @@ -814,14 +806,13 @@ integer(c_int) function TaskLocalNewton_Initialize(sunnls) & end function TaskLocalNewton_Initialize - integer(c_int) function TaskLocalNewton_Solve(sunnls, sunvec_y0, sunvec_ycor, & - sunvec_w, tol, callLSetup, arkode_mem) result(ierr) bind(C) + sunvec_w, tol, callLSetup, arkode_mem) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding use fnvector_mpiplusx_mod - use ode_mod, only : comm + use ode_mod, only: comm !======= Declarations ========= implicit none @@ -849,33 +840,32 @@ integer(c_int) function TaskLocalNewton_Solve(sunnls, sunvec_y0, sunvec_ycor, & !======= Internals ============ ! get MPI task local vectors - sunvec_y0loc => FN_VGetLocalVector_MPIPlusX(sunvec_y0) + sunvec_y0loc => FN_VGetLocalVector_MPIPlusX(sunvec_y0) sunvec_ycorloc => FN_VGetLocalVector_MPIPlusX(sunvec_ycor) - sunvec_wloc => FN_VGetLocalVector_MPIPlusX(sunvec_w) + sunvec_wloc => FN_VGetLocalVector_MPIPlusX(sunvec_w) ! each tasks solves the local nonlinear system ierr = FSUNNonlinSolSolve(sunnls_LOC, sunvec_y0loc, sunvec_ycorloc, & - sunvec_wloc, tol, callLSetup, arkode_mem) + sunvec_wloc, tol, callLSetup, arkode_mem) solve_status = ierr ! if any process had a nonrecoverable failure, return it call MPI_Allreduce(solve_status, nonrecover, 1, MPI_INTEGER, MPI_MIN, comm, & - mpi_ierr) + mpi_ierr) ierr = nonrecover if (ierr < 0) return ! check if any process has a recoverable convergence failure and return ! success (recover == 0) or a recoverable error code (recover > 0) call MPI_Allreduce(solve_status, recover, 1, MPI_INTEGER, MPI_MAX, comm, & - mpi_ierr) + mpi_ierr) ierr = recover if (ierr /= 0) ncnf_loc = ncnf_loc + 1 end function TaskLocalNewton_Solve - integer(c_int) function TaskLocalNewton_Free(sunnls) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -900,9 +890,8 @@ integer(c_int) function TaskLocalNewton_Free(sunnls) & end function TaskLocalNewton_Free - integer(c_int) function TaskLocalNewton_SetSysFn(sunnls, SysFn) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -920,9 +909,8 @@ integer(c_int) function TaskLocalNewton_SetSysFn(sunnls, SysFn) & end function TaskLocalNewton_SetSysFn - integer(c_int) function TaskLocalNewton_SetConvTestFn(sunnls, CTestFn, & - ctest_data) result(ierr) bind(C) + ctest_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -941,9 +929,8 @@ integer(c_int) function TaskLocalNewton_SetConvTestFn(sunnls, CTestFn, & end function TaskLocalNewton_SetConvTestFn - integer(c_int) function TaskLocalNewton_GetNumConvFails(sunnls, nconvfails) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -964,7 +951,6 @@ integer(c_int) function TaskLocalNewton_GetNumConvFails(sunnls, nconvfails) & end function TaskLocalNewton_GetNumConvFails - function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) !======= Inclusions =========== @@ -983,7 +969,7 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) type(c_ptr), target, intent(in) :: arkode_mem ! ARKODE memory type(N_Vector) :: sunvec_y ! solution N_Vector - type(SUNNonlinearSolver), pointer :: sunnls ! SUNDIALS nonlinear solver + type(SUNNonlinearSolver), pointer :: sunnls ! SUNDIALS nonlinear solver type(SUNNonlinearSolver_Ops), pointer :: nlsops ! solver operations integer :: ierr ! MPI error status @@ -996,20 +982,20 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) ! Create an empty nonlinear linear solver object sunnls => FSUNNonlinSolNewEmpty(sunctx) if (.not. associated(sunnls)) then - print *, "Error: FSUNNonlinSolNewEmpty returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNNonlinSolNewEmpty returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Access the SUNNonlinearSolver ops structure call c_f_pointer(sunnls%ops, nlsops) ! Attach operations - nlsops%gettype = c_funloc(TaskLocalNewton_GetType) - nlsops%initialize = c_funloc(TaskLocalNewton_Initialize) - nlsops%solve = c_funloc(TaskLocalNewton_Solve) - nlsops%free = c_funloc(TaskLocalNewton_Free) - nlsops%setsysfn = c_funloc(TaskLocalNewton_SetSysFn) - nlsops%setctestfn = c_funloc(TaskLocalNewton_SetConvTestFn) + nlsops%gettype = c_funloc(TaskLocalNewton_GetType) + nlsops%initialize = c_funloc(TaskLocalNewton_Initialize) + nlsops%solve = c_funloc(TaskLocalNewton_Solve) + nlsops%free = c_funloc(TaskLocalNewton_Free) + nlsops%setsysfn = c_funloc(TaskLocalNewton_SetSysFn) + nlsops%setctestfn = c_funloc(TaskLocalNewton_SetConvTestFn) nlsops%getnumconvfails = c_funloc(TaskLocalNewton_GetNumConvFails) ! Create the task local Newton solver @@ -1017,23 +1003,22 @@ function TaskLocalNewton(arkode_mem, sunvec_y) result(sunnls) ! Create vector pointers to receive residual data zpred_ptr = FN_VNewVectorArray(1, sunctx) - z_ptr = FN_VNewVectorArray(1, sunctx) - Fi_ptr = FN_VNewVectorArray(1, sunctx) + z_ptr = FN_VNewVectorArray(1, sunctx) + Fi_ptr = FN_VNewVectorArray(1, sunctx) sdata_ptr = FN_VNewVectorArray(1, sunctx) sunvec_bnode => FN_VNew_Serial(Nvar, sunctx) sunmat_Jnode => FSUNDenseMatrix(Nvar, Nvar, sunctx) - sunls_Jnode => FSUNLinSol_Dense(sunvec_bnode, sunmat_Jnode, sunctx) + sunls_Jnode => FSUNLinSol_Dense(sunvec_bnode, sunmat_Jnode, sunctx) ! initialize number of nonlinear solver function evals and fails - nnlfi = 0 + nnlfi = 0 ncnf_loc = 0 end function TaskLocalNewton end module nls_mod - program main !======= Inclusions =========== @@ -1043,8 +1028,8 @@ program main use fnvector_mpimanyvector_mod ! Access MPIManyVector N_Vector use fnvector_serial_mod ! Access serial N_Vector - use ode_mod, only : sunctx, logger, comm, myid, Nx, Neq, dx, fused, & - explicit, printtime, nout, myindextype + use ode_mod, only: sunctx, logger, comm, myid, Nx, Neq, dx, fused, & + explicit, printtime, nout, myindextype !======= Declarations ========= implicit none @@ -1065,8 +1050,8 @@ program main ! Initialize MPI call MPI_Init(ierr) if (ierr /= 0) then - print *, "Error: MPI_Init returned ",ierr - stop 1 + print *, "Error: MPI_Init returned ", ierr + stop 1 end if ! Start timing @@ -1076,7 +1061,7 @@ program main comm = MPI_COMM_WORLD retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval + print *, "Error: FSUNContext_Create returned ", retval call MPI_Abort(comm, 1, ierr) end if @@ -1094,19 +1079,19 @@ program main ! desired levels. We will enable informational logging here: retval = FSUNLogger_Create(comm, 0, logger) if (retval /= 0) then - print *, "Error: FSUNLogger_Create returned ",retval + print *, "Error: FSUNLogger_Create returned ", retval call MPI_Abort(comm, 1, ierr) end if retval = FSUNLogger_SetInfoFilename(logger, "sundials.log") if (retval /= 0) then - print *, "Error: FSUNLogger_SetInfoFilename returned ",retval + print *, "Error: FSUNLogger_SetInfoFilename returned ", retval call MPI_Abort(comm, 1, ierr) end if retval = FSUNContext_SetLogger(sunctx, logger) if (retval /= 0) then - print *, "Error: FSUNContext_SetLogger returned ",retval + print *, "Error: FSUNContext_SetLogger returned ", retval call MPI_Abort(comm, 1, ierr) end if @@ -1115,21 +1100,21 @@ program main ! Create solution vector sunvec_ys => FN_VNew_Serial(Neq, sunctx) - sunvec_y => FN_VMake_MPIPlusX(comm, sunvec_ys, sunctx) + sunvec_y => FN_VMake_MPIPlusX(comm, sunvec_ys, sunctx) ! Enable fused vector ops in local and MPI+X vectors if (fused) then - retval = FN_VEnableFusedOps_Serial(sunvec_ys, SUNTRUE) - if (retval /= 0) then - print *, "Error: FN_VEnableFusedOps_Serial returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FN_VEnableFusedOps_MPIManyVector(sunvec_y, SUNTRUE) - if (retval /= 0) then - print *, "Error: FN_VEnableFusedOps_MPIManyVector returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FN_VEnableFusedOps_Serial(sunvec_ys, SUNTRUE) + if (retval /= 0) then + print *, "Error: FN_VEnableFusedOps_Serial returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FN_VEnableFusedOps_MPIManyVector(sunvec_y, SUNTRUE) + if (retval /= 0) then + print *, "Error: FN_VEnableFusedOps_MPIManyVector returned ", retval + call MPI_Abort(comm, 1, ierr) + end if end if ! Set the initial condition @@ -1137,24 +1122,24 @@ program main ! Output spatial mesh to disk (add extra point for periodic BC if (myid == 0 .and. nout > 0) then - open(99, file="mesh.txt") - do i = 0, Nx - write(99, "(es23.16)") dx * i - end do + open (99, file="mesh.txt") + do i = 0, Nx + write (99, "(es23.16)") dx*i + end do end if ! Integrate in time if (explicit) then - call EvolveProblemExplicit(sunvec_y) + call EvolveProblemExplicit(sunvec_y) else - call EvolveProblemIMEX(sunvec_y) + call EvolveProblemIMEX(sunvec_y) end if ! End timing endtime = MPI_Wtime() if (myid == 0 .and. printtime) then - print "(A,es12.5,A)", "Total wall clock time: ",endtime-starttime," sec" + print "(A,es12.5,A)", "Total wall clock time: ", endtime - starttime, " sec" end if ! Finalize MPI @@ -1165,7 +1150,6 @@ program main end program main - ! Setup ARKODE and evolve problem in time with IMEX method subroutine EvolveProblemIMEX(sunvec_y) @@ -1179,12 +1163,12 @@ subroutine EvolveProblemIMEX(sunvec_y) use fsunlinsol_spgmr_mod ! Access GMRES SUNLinearSolver use fsunnonlinsol_newton_mod ! Access Newton SUNNonlinearSolver - use ode_mod, only : sunctx, comm, myid, Neq, t0, tf, atol, rtol, order, & - monitor, global, nout, umask_s, Advection, Reaction + use ode_mod, only: sunctx, comm, myid, Neq, t0, tf, atol, rtol, order, & + monitor, global, nout, umask_s, Advection, Reaction - use prec_mod, only : sunls_P, sunmat_P, PSetup, PSolve + use prec_mod, only: sunls_P, sunmat_P, PSetup, PSolve - use nls_mod, only : nnlfi, TaskLocalNewton + use nls_mod, only: nnlfi, TaskLocalNewton !======= Declarations ========= implicit none @@ -1211,8 +1195,8 @@ subroutine EvolveProblemIMEX(sunvec_y) integer(c_long) :: npsol(1) ! number of preconditioner solves type(SUNNonlinearSolver), pointer :: sun_NLS ! nonlinear solver - type(SUNLinearSolver), pointer :: sun_LS ! linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sun_LS ! linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix integer :: ierr ! MPI error status integer :: iout ! output counter @@ -1226,31 +1210,31 @@ subroutine EvolveProblemIMEX(sunvec_y) ! Create the ARK timestepper module arkode_mem = FARKStepCreate(c_funloc(Advection), c_funloc(Reaction), & - t0, sunvec_y, sunctx) + t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *, "Error: FARKStepCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Select the method order retval = FARKodeSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FARKodeSetOrder returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetOrder returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Increase the max number of steps allowed between outputs retval = FARKodeSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FARKodeMaxNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeMaxNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Create the (non)linear solver @@ -1259,195 +1243,195 @@ subroutine EvolveProblemIMEX(sunvec_y) if (global) then - ! Create nonlinear solver - sun_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) - if (.not. associated(sun_NLS)) then - print *, "Error: SUNNonlinSol_Newton returned NULL" - call MPI_Abort(comm, 1, ierr) - end if - - ! Attach nonlinear solver - retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) - if (retval /= 0) then - print *, "Error: FARKodeSetNonlinearSolver returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Create linear solver - sun_LS => FSUNLinSol_SPGMR(sunvec_y, SUN_PREC_LEFT, 0, sunctx) - if (.not. associated(sun_LS)) then - print *, "Error: FSUNLinSol_SPGMR returned NULL" - call MPI_Abort(comm, 1, ierr) - end if - - ! Attach linear solver - sunmat_A => null() - retval = FARKodeSetLinearSolver(arkode_mem, sun_LS, sunmat_A) - if (retval /= 0) then - print *, "Error: FARKodeSetLinearSolver returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Attach preconditioner - retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & - c_funloc(PSolve)) - if (retval /= 0) then - print *, "Error: FARKodeSetPreconditioner returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Create MPI task-local data structures for preconditioning - sunmat_P => FSUNDenseMatrix(Neq, Neq, sunctx) - sunls_P => FSUNLinSol_Dense(umask_s, sunmat_P, sunctx) + ! Create nonlinear solver + sun_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) + if (.not. associated(sun_NLS)) then + print *, "Error: SUNNonlinSol_Newton returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach nonlinear solver + retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) + if (retval /= 0) then + print *, "Error: FARKodeSetNonlinearSolver returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Create linear solver + sun_LS => FSUNLinSol_SPGMR(sunvec_y, SUN_PREC_LEFT, 0, sunctx) + if (.not. associated(sun_LS)) then + print *, "Error: FSUNLinSol_SPGMR returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach linear solver + sunmat_A => null() + retval = FARKodeSetLinearSolver(arkode_mem, sun_LS, sunmat_A) + if (retval /= 0) then + print *, "Error: FARKodeSetLinearSolver returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach preconditioner + retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & + c_funloc(PSolve)) + if (retval /= 0) then + print *, "Error: FARKodeSetPreconditioner returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Create MPI task-local data structures for preconditioning + sunmat_P => FSUNDenseMatrix(Neq, Neq, sunctx) + sunls_P => FSUNLinSol_Dense(umask_s, sunmat_P, sunctx) else - ! The custom task-local nonlinear solver handles the linear solve - ! as well, so we do not need a SUNLinearSolver - sun_NLS => TaskLocalNewton(arkode_mem, umask_s) - if (.not. associated(sun_NLS)) then - print *, "Error: TaskLocalNewton returned NULL" - call MPI_Abort(comm, 1, ierr) - end if - - ! Attach nonlinear solver - retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) - if (retval /= 0) then - print *, "Error: FARKodeSetNonlinearSolver returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + ! The custom task-local nonlinear solver handles the linear solve + ! as well, so we do not need a SUNLinearSolver + sun_NLS => TaskLocalNewton(arkode_mem, umask_s) + if (.not. associated(sun_NLS)) then + print *, "Error: TaskLocalNewton returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach nonlinear solver + retval = FARKodeSetNonlinearSolver(arkode_mem, sun_NLS) + if (retval /= 0) then + print *, "Error: FARKodeSetNonlinearSolver returned ", retval + call MPI_Abort(comm, 1, ierr) + end if end if ! Set initial time, determine output time, and initialize output count - t(1) = t0 + t(1) = t0 dtout = (tf - t0) if (nout /= 0) then - dtout = dtout / nout + dtout = dtout/nout end if tout = t(1) + dtout iout = 0 ! Output initial condition if (myid == 0 .and. monitor) then - print *, "" - print *, " t ||u||_rms ||v||_rms ||w||_rms" - print *, "-----------------------------------------------------------" + print *, "" + print *, " t ||u||_rms ||v||_rms ||w||_rms" + print *, "-----------------------------------------------------------" end if call WriteOutput(t, sunvec_y) ! Integrate to final time - do while (iout < max(nout,1)) + do while (iout < max(nout, 1)) - ! Integrate to output time - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) - if (retval /= 0) then - print *, "Error: FARKodeEvolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + ! Integrate to output time + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKodeEvolve returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - ! Output state - call WriteOutput(t, sunvec_y) + ! Output state + call WriteOutput(t, sunvec_y) - ! Update output time - tout = tout + dtout - if (tout > tf) then - tout = tf - end if + ! Update output time + tout = tout + dtout + if (tout > tf) then + tout = tf + end if - ! Update output count - iout = iout + 1 + ! Update output count + iout = iout + 1 end do if (myid == 0 .and. monitor) then - print *, "-----------------------------------------------------------" - print *, "" + print *, "-----------------------------------------------------------" + print *, "" end if ! Get final statistics retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvIters returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if if (global) then - retval = FARKodeGetNumLinIters(arkode_mem, nli) - if (retval /= 0) then - print *, "Error: FARKodeGetNumLinIters returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FARKodeGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FARKodeGetNumPrecEvals(arkode_mem, npre) - if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecEvals returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FARKodeGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) - if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecSolves returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if end if ! Print final statistics if (myid == 0) then - print "(A)","Final Solver Statistics (for processor 0):" - print "(2x,A,i0)", "Steps = ",nst - print "(2x,A,i0)", "Step attempts = ",nst_a - print "(2x,A,i0)", "Error test fails = ",netf - print "(2x,A,i0)", "NLS fails = ",ncfn + print "(A)", "Final Solver Statistics (for processor 0):" + print "(2x,A,i0)", "Steps = ", nst + print "(2x,A,i0)", "Step attempts = ", nst_a + print "(2x,A,i0)", "Error test fails = ", netf + print "(2x,A,i0)", "NLS fails = ", ncfn - if (global) then + if (global) then - print "(2x,A,i0)", "RHS evals Fe = ",nfe - print "(2x,A,i0)", "RHS evals Fi = ",nfi - print "(2x,A,i0)", "NLS iters = ",nni - print "(2x,A,i0)", "LS iters = ",nli - print "(2x,A,i0)", "P setups = ",npre - print "(2x,A,i0)", "P solves = ",npsol + print "(2x,A,i0)", "RHS evals Fe = ", nfe + print "(2x,A,i0)", "RHS evals Fi = ", nfi + print "(2x,A,i0)", "NLS iters = ", nni + print "(2x,A,i0)", "LS iters = ", nli + print "(2x,A,i0)", "P setups = ", npre + print "(2x,A,i0)", "P solves = ", npsol - else + else - print "(2x,A,i0)", "RHS evals Fe = ",nfe - print "(2x,A,i0)", "RHS evals Fi = ",nfi + nnlfi + print "(2x,A,i0)", "RHS evals Fe = ", nfe + print "(2x,A,i0)", "RHS evals Fi = ", nfi + nnlfi - end if + end if end if @@ -1457,30 +1441,29 @@ subroutine EvolveProblemIMEX(sunvec_y) ! Free nonlinear solver retval = FSUNNonlinSolFree(sun_NLS) if (retval /= 0) then - print *, "Error: FSUNNonlinSolFree returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNNonlinSolFree returned ", retval + call MPI_Abort(comm, 1, ierr) end if if (global) then - ! free task-local preconditioner solve structures - call FSUNMatDestroy(sunmat_P) - retval = FSUNLinSolFree(sunls_P) - if (retval /= 0) then - print *, "Error: FSUNLinSolFree returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! free global linear solver - retval = FSUNLinSolFree(sun_LS) - if (retval /= 0) then - print *, "Error: FSUNLinSolFree returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + ! free task-local preconditioner solve structures + call FSUNMatDestroy(sunmat_P) + retval = FSUNLinSolFree(sunls_P) + if (retval /= 0) then + print *, "Error: FSUNLinSolFree returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! free global linear solver + retval = FSUNLinSolFree(sun_LS) + if (retval /= 0) then + print *, "Error: FSUNLinSolFree returned ", retval + call MPI_Abort(comm, 1, ierr) + end if end if end subroutine EvolveProblemIMEX - subroutine EvolveProblemExplicit(sunvec_y) !======= Inclusions =========== @@ -1489,8 +1472,8 @@ subroutine EvolveProblemExplicit(sunvec_y) use farkode_mod ! Access ARKode use farkode_erkstep_mod ! Access ERKStep - use ode_mod, only : sunctx, comm, myid, t0, tf, atol, rtol, order, monitor, & - nout, AdvectionReaction + use ode_mod, only: sunctx, comm, myid, t0, tf, atol, rtol, order, monitor, & + nout, AdvectionReaction !======= Declarations ========= implicit none @@ -1519,109 +1502,109 @@ subroutine EvolveProblemExplicit(sunvec_y) ! Create the ERK integrator arkode_mem = FERKStepCreate(c_funloc(AdvectionReaction), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *, "Error: FERKStepCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Select the method order retval = FARKodeSetOrder(arkode_mem, order) if (retval /= 0) then - print *, "Error: FARKodeSetOrder returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetOrder returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Increase the max number of steps allowed between outputs retval = FARKodeSetMaxNumSteps(arkode_mem, int(100000, c_long)) if (retval /= 0) then - print *, "Error: FARKodeMaxNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeMaxNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Set initial time, determine output time, and initialize output count - t(1) = t0 + t(1) = t0 dtout = (tf - t0) if (nout /= 0) then - dtout = dtout / nout + dtout = dtout/nout end if tout = t(1) + dtout iout = 0 ! Ouput initial condition if (myid == 0 .and. monitor) then - print *, "" - print *, " t ||u||_rms ||v||_rms ||w||_rms" - print *, "-----------------------------------------------------------" + print *, "" + print *, " t ||u||_rms ||v||_rms ||w||_rms" + print *, "-----------------------------------------------------------" end if call WriteOutput(t, sunvec_y) ! Integrate to final time do while (iout < nout) - ! Integrate to output time - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) - if (retval /= 0) then - print *, "Error: FARKodeEvolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + ! Integrate to output time + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKodeEvolve returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - ! Output state - call WriteOutput(t, sunvec_y) + ! Output state + call WriteOutput(t, sunvec_y) - ! Update output time - tout = tout + dtout - if (tout > tf) then - tout = tf - end if + ! Update output time + tout = tout + dtout + if (tout > tf) then + tout = tf + end if - ! Update output count - iout = iout + 1 + ! Update output count + iout = iout + 1 end do if (myid == 0 .and. monitor) then - print *, "-----------------------------------------------------------" - print *, "" + print *, "-----------------------------------------------------------" + print *, "" end if ! Get final statistics retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Print final statistcs if (myid == 0) then - print "(A)","Final Solver Statistics (for processor 0):" - print "(2x,A,i0)", "Steps = ",nst - print "(2x,A,i0)", "Step attempts = ",nst_a - print "(2x,A,i0)", "Error test fails = ",netf - print "(2x,A,i0)", "RHS evals = ",nfe + print "(A)", "Final Solver Statistics (for processor 0):" + print "(2x,A,i0)", "Steps = ", nst + print "(2x,A,i0)", "Step attempts = ", nst_a + print "(2x,A,i0)", "Error test fails = ", netf + print "(2x,A,i0)", "RHS evals = ", nfe end if ! Clean up @@ -1629,7 +1612,6 @@ subroutine EvolveProblemExplicit(sunvec_y) end subroutine EvolveProblemExplicit - ! Write time and solution to disk subroutine WriteOutput(t, sunvec_y) @@ -1638,8 +1620,8 @@ subroutine WriteOutput(t, sunvec_y) use fsundials_core_mod use farkode_mod ! Access ARKode - use ode_mod, only : Nvar, nprocs, myid, Erecv, Nx, Npts, monitor, nout, & - umask, vmask, wmask, myindextype + use ode_mod, only: Nvar, nprocs, myid, Erecv, Nx, Npts, monitor, nout, & + umask, vmask, wmask, myindextype !======= Declarations ========= implicit none @@ -1659,58 +1641,57 @@ subroutine WriteOutput(t, sunvec_y) ! output current solution norm to screen if (monitor) then - u = FN_VWL2Norm(sunvec_y, umask) - u = sqrt(u * u / Nx) + u = FN_VWL2Norm(sunvec_y, umask) + u = sqrt(u*u/Nx) - v = FN_VWL2Norm(sunvec_y, vmask) - v = sqrt(v * v / Nx) + v = FN_VWL2Norm(sunvec_y, vmask) + v = sqrt(v*v/Nx) - w = FN_VWL2Norm(sunvec_y, wmask) - w = sqrt(w * w / Nx) + w = FN_VWL2Norm(sunvec_y, wmask) + w = sqrt(w*w/Nx) - if (myid == 0) then - print "(4(es12.5,4x))", t, u, v, w - end if + if (myid == 0) then + print "(4(es12.5,4x))", t, u, v, w + end if end if if (nout > 0) then - ! get left end point for output - call ExchangeBCOnly(sunvec_y) - - ! get vector data array - ydata => FN_VGetArrayPointer(sunvec_y) - - ! output the times to disk - if (myid == 0) then - write(100,"(es23.16)") t - end if - - ! output results to disk - do i = 1, Npts - idx = (i - 1) * Nvar - write(101, "(es23.16)", advance="no") ydata(idx + 1) - write(102, "(es23.16)", advance="no") ydata(idx + 2) - write(103, "(es23.16)", advance="no") ydata(idx + 3) - end do - - ! we have one extra output because of the periodic BCs - if (myid == nprocs - 1) then - write(101,"(es23.16)") Erecv(1) - write(102,"(es23.16)") Erecv(2) - write(103,"(es23.16)") Erecv(3) - else - write(101,"(es23.16)") - write(102,"(es23.16)") - write(103,"(es23.16)") - end if + ! get left end point for output + call ExchangeBCOnly(sunvec_y) + + ! get vector data array + ydata => FN_VGetArrayPointer(sunvec_y) + + ! output the times to disk + if (myid == 0) then + write (100, "(es23.16)") t + end if + + ! output results to disk + do i = 1, Npts + idx = (i - 1)*Nvar + write (101, "(es23.16)", advance="no") ydata(idx + 1) + write (102, "(es23.16)", advance="no") ydata(idx + 2) + write (103, "(es23.16)", advance="no") ydata(idx + 3) + end do + + ! we have one extra output because of the periodic BCs + if (myid == nprocs - 1) then + write (101, "(es23.16)") Erecv(1) + write (102, "(es23.16)") Erecv(2) + write (103, "(es23.16)") Erecv(3) + else + write (101, "(es23.16)") + write (102, "(es23.16)") + write (103, "(es23.16)") + end if end if end subroutine WriteOutput - ! Initial Condition Function subroutine SetIC(sunvec_y) @@ -1740,37 +1721,35 @@ subroutine SetIC(sunvec_y) ydata => FN_VGetArrayPointer(sunvec_y) ! Steady state solution - us = k1 * A / k4 - vs = k2 * k4 * B / (k1 * k3 * A) + us = k1*A/k4 + vs = k2*k4*B/(k1*k3*A) ws = 3.0d0 ! Perturbation parameters - mu = xmax / 2.0d0 - sigma = xmax / 4.0d0 + mu = xmax/2.0d0 + sigma = xmax/4.0d0 alpha = 0.1d0 ! Gaussian perturbation - do j = 1,Npts + do j = 1, Npts - x = (myid * Npts + (j - 1)) * dx - p = alpha * exp( -((x - mu) * (x - mu)) / (2.0d0 * sigma * sigma) ) + x = (myid*Npts + (j - 1))*dx + p = alpha*exp(-((x - mu)*(x - mu))/(2.0d0*sigma*sigma)) - idx = (j - 1) * Nvar + idx = (j - 1)*Nvar - ydata(idx + 1) = us + p - ydata(idx + 2) = vs + p - ydata(idx + 3) = ws + p + ydata(idx + 1) = us + p + ydata(idx + 2) = vs + p + ydata(idx + 3) = ws + p end do end subroutine SetIC - ! -------------------------------------------------------------- ! Utility functions ! -------------------------------------------------------------- - ! Exchanges the periodic BCs only by sending the first mesh node to the last ! processor. subroutine ExchangeBCOnly(sunvec_y) @@ -1779,7 +1758,7 @@ subroutine ExchangeBCOnly(sunvec_y) use, intrinsic :: iso_c_binding use fsundials_core_mod - use ode_mod, only : Nvar, comm, myid, nprocs, Erecv, Wsend + use ode_mod, only: Nvar, comm, myid, nprocs, Erecv, Wsend !======= Declarations ========= implicit none @@ -1801,52 +1780,51 @@ subroutine ExchangeBCOnly(sunvec_y) ! first and last MPI task ID first = 0 - last = nprocs - 1 + last = nprocs - 1 ! Access data array from SUNDIALS vector ydata => FN_VGetArrayPointer(sunvec_y) ! open the East Irecv buffer if (myid == last) then - call MPI_Irecv(Erecv, nvar, MPI_DOUBLE_PRECISION, first, MPI_ANY_TAG, & - comm, reqR, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Irecv returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Irecv(Erecv, nvar, MPI_DOUBLE_PRECISION, first, MPI_ANY_TAG, & + comm, reqR, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Irecv returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if ! send first mesh node to the last processor if (myid == first) then - Wsend(1:Nvar) = ydata(1:Nvar) - call MPI_Isend(Wsend, nvar, MPI_DOUBLE, last, 0, & - comm, reqS, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Isend returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + Wsend(1:Nvar) = ydata(1:Nvar) + call MPI_Isend(Wsend, nvar, MPI_DOUBLE, last, 0, & + comm, reqS, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Isend returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if ! wait for exchange to finish if (myid == last) then - call MPI_Wait(reqR, stat, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Wait returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Wait(reqR, stat, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Wait returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if if (myid == first) then - call MPI_Wait(reqS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Wait returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Wait(reqS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Wait returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if end subroutine ExchangeBCOnly - ! Starts the exchange of the neighbor information subroutine ExchangeAllStart(sunvec_y) @@ -1854,8 +1832,8 @@ subroutine ExchangeAllStart(sunvec_y) use, intrinsic :: iso_c_binding use fsundials_core_mod - use ode_mod, only : Nvar, comm, myid, nprocs, reqS, reqR, Wrecv, Wsend, & - Erecv, Esend, Npts, c + use ode_mod, only: Nvar, comm, myid, nprocs, reqS, reqR, Wrecv, Wsend, & + Erecv, Esend, Npts, c !======= Declarations ========= implicit none @@ -1877,19 +1855,19 @@ subroutine ExchangeAllStart(sunvec_y) ! first and last MPI task ID first = 0 - last = nprocs - 1 + last = nprocs - 1 ! get the ID for the process to the West and East of this process if (myid == first) then - ipW = last + ipW = last else - ipW = myid - 1 + ipW = myid - 1 end if if (myid == last) then - ipE = first + ipE = first else - ipE = myid + 1 + ipE = myid + 1 end if ! Access data array from SUNDIALS vector @@ -1897,58 +1875,57 @@ subroutine ExchangeAllStart(sunvec_y) if (c > 0.0d0) then - ! Right moving flow uses backward difference. - ! Send from west to east (last processor sends to first) + ! Right moving flow uses backward difference. + ! Send from west to east (last processor sends to first) - call MPI_Irecv(Wrecv, nvar, MPI_DOUBLE_PRECISION, ipW, & - MPI_ANY_TAG, comm, reqR, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Irecv returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Irecv(Wrecv, nvar, MPI_DOUBLE_PRECISION, ipW, & + MPI_ANY_TAG, comm, reqR, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Irecv returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if - Esend(1:Nvar) = ydata(Nvar * Npts - 2 : Nvar * Npts) + Esend(1:Nvar) = ydata(Nvar*Npts - 2:Nvar*Npts) - call MPI_Isend(Esend, nvar, MPI_DOUBLE_PRECISION, ipE, & - 0, comm, reqS, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Isend returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Isend(Esend, nvar, MPI_DOUBLE_PRECISION, ipE, & + 0, comm, reqS, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Isend returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if else if (c < 0.0d0) then - ! Left moving flow uses forward difference. - ! Send from east to west (first processor sends to last) + ! Left moving flow uses forward difference. + ! Send from east to west (first processor sends to last) - call MPI_Irecv(Erecv, nvar, MPI_DOUBLE_PRECISION, ipE, & - MPI_ANY_TAG, comm, reqR, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Irecv returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Irecv(Erecv, nvar, MPI_DOUBLE_PRECISION, ipE, & + MPI_ANY_TAG, comm, reqR, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Irecv returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if - Wsend(1:Nvar) = ydata(1:Nvar) + Wsend(1:Nvar) = ydata(1:Nvar) - call MPI_Isend(Wsend, nvar, MPI_DOUBLE_PRECISION, ipW, & - 0, comm, reqS, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Isend returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Isend(Wsend, nvar, MPI_DOUBLE_PRECISION, ipW, & + 0, comm, reqS, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Isend returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if end subroutine ExchangeAllStart - ! Completes the exchange of the neighbor information subroutine ExchangeAllEnd() !======= Inclusions =========== use, intrinsic :: iso_c_binding - use ode_mod, only : comm, reqS, reqR, c + use ode_mod, only: comm, reqS, reqR, c !======= Declarations ========= implicit none @@ -1963,22 +1940,21 @@ subroutine ExchangeAllEnd() ! wait for exchange to finish if (c < 0.0d0 .or. c > 0.0d0) then - call MPI_Wait(reqR, stat, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Wait returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if - - call MPI_Wait(reqS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error: MPI_Wait returned ",ierr - call MPI_Abort(comm, 1, ierr) - end if + call MPI_Wait(reqR, stat, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Wait returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + call MPI_Wait(reqS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error: MPI_Wait returned ", ierr + call MPI_Abort(comm, 1, ierr) + end if end if end subroutine ExchangeAllEnd - subroutine SetupProblem() !======= Inclusions =========== @@ -2010,171 +1986,171 @@ subroutine SetupProblem() ! MPI variables call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - print *, "Error:MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + print *, "Error:MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - print *, "Error:MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + print *, "Error:MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! default problem setting - Nx = 100 - Npts = Nx / nprocs - Neq = Nvar * Npts + Nx = 100 + Npts = Nx/nprocs + Neq = Nvar*Npts xmax = 1.0d0 - dx = xmax / Nx + dx = xmax/Nx ! Problem parameters - c = 0.01d0 - A = 1.0d0 - B = 3.5d0 + c = 0.01d0 + A = 1.0d0 + B = 3.5d0 k1 = 1.0d0 k2 = 1.0d0 k3 = 1.0d0 k4 = 1.0d0 - k5 = 1.0d0 / 5.0d-6 - k6 = 1.0d0 / 5.0d-6 + k5 = 1.0d0/5.0d-6 + k6 = 1.0d0/5.0d-6 ! Set default integrator options - order = 3 - rtol = 1.0d-6 - atol = 1.0d-9 - t0 = 0.0d0 - tf = 10.0d0 - explicit = .false. - global = .false. - fused = .false. - monitor = .false. + order = 3 + rtol = 1.0d-6 + atol = 1.0d-9 + t0 = 0.0d0 + tf = 10.0d0 + explicit = .false. + global = .false. + fused = .false. + monitor = .false. printtime = .false. - nout = 40 + nout = 40 ! check for input args nargs = command_argument_count() - argj= 1 + argj = 1 do while (argj <= nargs) - ! get input arg - call get_command_argument(argj, arg, length, status) - - ! check if reading the input was successful - if (status == -1) then - print *, "ERROR: Command line input too long (max length = 32)" - call MPI_Abort(comm, 1, ierr) - end if - - ! check if there are no more inputs to read - if (len_trim(arg) == 0) exit - - ! check for valid input options - if (trim(arg) == "--monitor") then - monitor = .true. - else if (trim(arg) == "--printtime") then - printtime = .true. - else if (trim(arg) == "--nout") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) nout - else if (trim(arg) == "--nx") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) Nx - else if (trim(arg) == "--xmax") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) xmax - else if (trim(arg) == "--A") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) A - else if (trim(arg) == "--B") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) B - else if (trim(arg) == "--k") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) k1 - read(arg,*) k2 - read(arg,*) k3 - read(arg,*) k4 - else if (trim(arg) == "--c") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) c - else if (trim(arg) == "--order") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) order - else if (trim(arg) == "--explicit") then - explicit = .true. - else if (trim(arg) == "--global-nls") then - global = .true. - else if (trim(arg) == "--fused") then - fused = .true. - else if (trim(arg) == "--tf") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) tf - else if (trim(arg) == "--rtol") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) rtol - else if (trim(arg) == "--atol") then - argj = argj + 1 - call get_command_argument(argj, arg) - read(arg,*) atol - else if (trim(arg) == "--help") then - if (myid == 0) call InputHelp() - call MPI_Abort(comm, 1, ierr) - else - if (myid == 0) then - print *, "Error: Unknown command line input ",trim(arg) - call InputHelp() - end if - call MPI_Abort(comm, 1, ierr) - end if - - ! move to the next input - argj = argj+1 + ! get input arg + call get_command_argument(argj, arg, length, status) + + ! check if reading the input was successful + if (status == -1) then + print *, "ERROR: Command line input too long (max length = 32)" + call MPI_Abort(comm, 1, ierr) + end if + + ! check if there are no more inputs to read + if (len_trim(arg) == 0) exit + + ! check for valid input options + if (trim(arg) == "--monitor") then + monitor = .true. + else if (trim(arg) == "--printtime") then + printtime = .true. + else if (trim(arg) == "--nout") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) nout + else if (trim(arg) == "--nx") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) Nx + else if (trim(arg) == "--xmax") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) xmax + else if (trim(arg) == "--A") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) A + else if (trim(arg) == "--B") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) B + else if (trim(arg) == "--k") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) k1 + read (arg, *) k2 + read (arg, *) k3 + read (arg, *) k4 + else if (trim(arg) == "--c") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) c + else if (trim(arg) == "--order") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) order + else if (trim(arg) == "--explicit") then + explicit = .true. + else if (trim(arg) == "--global-nls") then + global = .true. + else if (trim(arg) == "--fused") then + fused = .true. + else if (trim(arg) == "--tf") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) tf + else if (trim(arg) == "--rtol") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) rtol + else if (trim(arg) == "--atol") then + argj = argj + 1 + call get_command_argument(argj, arg) + read (arg, *) atol + else if (trim(arg) == "--help") then + if (myid == 0) call InputHelp() + call MPI_Abort(comm, 1, ierr) + else + if (myid == 0) then + print *, "Error: Unknown command line input ", trim(arg) + call InputHelp() + end if + call MPI_Abort(comm, 1, ierr) + end if + + ! move to the next input + argj = argj + 1 end do ! Setup the parallel decomposition - if (MOD(Nx,int(nprocs, myindextype)) > 0) then - print *, "ERROR: The mesh size (nx = ", Nx,") must be divisible by the number of processors (",nprocs,")" - call MPI_Abort(comm, 1, ierr) + if (MOD(Nx, int(nprocs, myindextype)) > 0) then + print *, "ERROR: The mesh size (nx = ", Nx, ") must be divisible by the number of processors (", nprocs, ")" + call MPI_Abort(comm, 1, ierr) end if - Npts = Nx / nprocs - Neq = nvar * Npts - dx = xmax / Nx ! Nx is number of intervals + Npts = Nx/nprocs + Neq = nvar*Npts + dx = xmax/Nx ! Nx is number of intervals ! Create the solution masks umask_s => FN_VNew_Serial(Neq, sunctx) - umask => FN_VMake_MPIPlusX(comm, umask_s, sunctx) + umask => FN_VMake_MPIPlusX(comm, umask_s, sunctx) if (fused) then - retval = FN_VEnableFusedOps_Serial(umask_s, SUNTRUE) - if (retval /= 0) then - print *, "Error: FN_VEnableFusedOps_Serial returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FN_VEnableFusedOps_MPIManyVector(umask, SUNTRUE) - if (retval /= 0) then - print *, "Error: FN_VEnableFusedOps_MPIManyVector returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FN_VEnableFusedOps_Serial(umask_s, SUNTRUE) + if (retval /= 0) then + print *, "Error: FN_VEnableFusedOps_Serial returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FN_VEnableFusedOps_MPIManyVector(umask, SUNTRUE) + if (retval /= 0) then + print *, "Error: FN_VEnableFusedOps_MPIManyVector returned ", retval + call MPI_Abort(comm, 1, ierr) + end if end if call FN_VConst(0.0d0, umask) data => FN_VGetArrayPointer(umask) do j = 1, Npts - data(1 + (j - 1) * nvar) = 1.0d0 + data(1 + (j - 1)*nvar) = 1.0d0 end do vmask => FN_VClone(umask) @@ -2182,7 +2158,7 @@ subroutine SetupProblem() call FN_VConst(0.0d0, vmask) data => FN_VGetArrayPointer(vmask) do j = 1, Npts - data(2 + (j - 1) * nvar) = 1.0d0 + data(2 + (j - 1)*nvar) = 1.0d0 end do wmask => FN_VClone(umask) @@ -2190,68 +2166,67 @@ subroutine SetupProblem() call FN_VConst(0.0d0, wmask) data => FN_VGetArrayPointer(wmask) do j = 1, Npts - data(3 + (j - 1) * nvar) = 1.0d0 + data(3 + (j - 1)*nvar) = 1.0d0 end do ! Open output files for results if (nout > 0) then - if (myid == 0) then - write(outname, "(A,I0.6,A)") "t.",myid,".txt" - open(100, file=trim(outname)) - end if + if (myid == 0) then + write (outname, "(A,I0.6,A)") "t.", myid, ".txt" + open (100, file=trim(outname)) + end if - write(outname, "(A,I0.6,A)") "u.",myid,".txt" - open(101, file=trim(outname)) + write (outname, "(A,I0.6,A)") "u.", myid, ".txt" + open (101, file=trim(outname)) - write(outname, "(A,I0.6,A)") "v.",myid,".txt" - open(102, file=trim(outname)) + write (outname, "(A,I0.6,A)") "v.", myid, ".txt" + open (102, file=trim(outname)) - write(outname, "(A,I0.6,A)") "w.",myid,".txt" - open(103, file=trim(outname)) + write (outname, "(A,I0.6,A)") "w.", myid, ".txt" + open (103, file=trim(outname)) end if ! Print problem setup if (myid == 0) then - print "(A)" , "1D Advection-Reaction Test Problem" - print "(A,i0)" , "Number of Processors = ", nprocs - print "(A)" , "Mesh Info:" - print "(A,i0)" , " Nx = ",nx - print "(A,i0)" , " Npts = ",Npts - print "(A,es12.5)", " xmax = ",xmax - print "(A,es12.5)", " dx = ",dx - print "(A)" , "Problem Parameters:" - print "(A,es12.5)", " A = ",A - print "(A,es12.5)", " B = ",B - print "(A,es12.5)", " k = ",k1 - print "(A,es12.5)", " c = ",c - print "(A)" , "Integrator Options:" - print "(A,es12.5)", " t0 = ", t0 - print "(A,es12.5)", " tf = ", tf - print "(A,es12.5)", " reltol = ", rtol - print "(A,es12.5)", " abstol = ", atol - print "(A,i0)" , " order = ", order - print "(A,L1)" , " explicit = ", explicit - print "(A,L1)" , " fused ops = ", fused - if (.not. explicit) then - print "(A,L1)"," global NLS = ", global - end if - print "(A,i0)" , " nout = ", nout + print "(A)", "1D Advection-Reaction Test Problem" + print "(A,i0)", "Number of Processors = ", nprocs + print "(A)", "Mesh Info:" + print "(A,i0)", " Nx = ", nx + print "(A,i0)", " Npts = ", Npts + print "(A,es12.5)", " xmax = ", xmax + print "(A,es12.5)", " dx = ", dx + print "(A)", "Problem Parameters:" + print "(A,es12.5)", " A = ", A + print "(A,es12.5)", " B = ", B + print "(A,es12.5)", " k = ", k1 + print "(A,es12.5)", " c = ", c + print "(A)", "Integrator Options:" + print "(A,es12.5)", " t0 = ", t0 + print "(A,es12.5)", " tf = ", tf + print "(A,es12.5)", " reltol = ", rtol + print "(A,es12.5)", " abstol = ", atol + print "(A,i0)", " order = ", order + print "(A,L1)", " explicit = ", explicit + print "(A,L1)", " fused ops = ", fused + if (.not. explicit) then + print "(A,L1)", " global NLS = ", global + end if + print "(A,i0)", " nout = ", nout end if end subroutine SetupProblem - subroutine FreeProblem() !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsundials_core_mod - use ode_mod, only : sunctx, logger, myid, nout, umask_s, umask, vmask, wmask + use ode_mod, only: sunctx, logger, myid, nout, umask_s, umask, vmask, wmask !======= Declarations ========= implicit none @@ -2267,18 +2242,17 @@ subroutine FreeProblem() ! close output streams if (nout > 0) then - if (myid == 0) close(100) - close(101) - close(102) - close(103) + if (myid == 0) close (100) + close (101) + close (102) + close (103) end if - ierr = FSUNLogger_Destroy(logger) - ierr = FSUNContext_Free(sunctx) + ierr = FSUNLogger_Destroy(logger) + ierr = FSUNContext_Free(sunctx) end subroutine FreeProblem - subroutine InputHelp() print *, "Command line options:" diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 index c7b25afe86..8c67715974 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -51,8 +51,8 @@ module DiagkryData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_int), parameter :: iGStype = 1 - integer(c_int), parameter :: iPretype0 = 1 + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 integer(c_int64_t), parameter :: nlocal = 10 integer(c_int64_t) :: neq, mu, ml, mudq, mldq integer(c_int) :: iPretype @@ -64,7 +64,7 @@ module DiagkryData ! ODE RHS function f(t,y). ! ---------------------------------------------------------------- integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -76,7 +76,7 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(nlocal) :: y(:) @@ -88,15 +88,15 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) ! Initialize ydot to zero ydot = 0.d0 ! Fill ydot with rhs function - do i = 1,nlocal - ydot(i) = -alpha * (myid * nlocal + i) * y(i) + do i = 1, nlocal + ydot(i) = -alpha*(myid*nlocal + i)*y(i) end do retval = 0 ! Return with success @@ -108,7 +108,7 @@ end function frhs ! Local g function for BBD preconditioner (calls ODE RHS). ! ---------------------------------------------------------------- integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -121,15 +121,15 @@ integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & integer(c_int64_t) :: nnlocal ! local space type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_g ! output g N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data integer :: ierr ierr = frhs(t, sunvec_y, sunvec_g, user_data) if (ierr /= 0) then - write(0,*) "Error in LocalgFn user-defined function, ierr = ", ierr - stop 1 + write (0, *) "Error in LocalgFn user-defined function, ierr = ", ierr + stop 1 end if retval = 0 ! Return with success @@ -140,7 +140,6 @@ end function LocalgFn end module DiagkryData ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Main driver program ! ---------------------------------------------------------------- @@ -205,47 +204,47 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Set input arguments neq and alpha - neq = nprocs * nlocal + neq = nprocs*nlocal alpha = 10.0d0 ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "Diagonal test problem:"; - write(6,'(A,i4)') " neq = " , neq - write(6,'(A,i4)') " nlocal = " , nlocal - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,es9.2)') " alpha = ", alpha - write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" - write(6,*) " Method is DIRK/NEWTON/SPGMR" - write(6,*) " Precond is band-block-diagonal, using ARKBBDPRE" - write(6,*) " " - endif + write (6, *) " " + write (6, *) "Diagonal test problem:"; + write (6, '(A,i4)') " neq = ", neq + write (6, '(A,i4)') " nlocal = ", nlocal + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,es9.2)') " alpha = ", alpha + write (6, *) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write (6, *) " Method is DIRK/NEWTON/SPGMR" + write (6, *) " Precond is band-block-diagonal, using ARKBBDPRE" + write (6, *) " " + end if ! Create solution vector, point at its data, and set initial condition sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) @@ -255,36 +254,36 @@ program driver ! Create the ARKStep timestepper module arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(frhs), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *, "Error: FARKStepCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Tell ARKODE to use a SPGMR linear solver. sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - call MPI_Abort(comm, 1, ierr) + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) end if ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() retval = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initialize BBD preconditioner @@ -293,218 +292,218 @@ program driver mudq = 0 mldq = 0 retval = FARKBBDPrecInit(arkode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & - c_funloc(LocalgFn), c_null_funptr) + c_funloc(LocalgFn), c_null_funptr) if (retval /= 0) then - print *, "Error: FARKBBDPrecInit returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKBBDPrecInit returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Run problem twice, using differing preconditioning types each time - do iPretype = 1,2 - - if (iPretype == 2) then - - y = 1.d0 - retval = FARKStepReInit(arkode_mem, c_null_funptr, c_funloc(frhs), & - t0, sunvec_y) - if (retval /= 0) then - print *, "Error in FARKStepReInit, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FARKBBDPrecReInit(arkode_mem, mudq, mldq, 0.d0) - if (retval /= 0) then - print *, "Error in FARKBBDPrecReInit, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - if (outproc) write(6,*) " Preconditioning on right:" - - end if - - if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" - - ! Main time-stepping loop: calls FARKodeEvolve to perform the integration, - ! then prints results. Stops when the final time has been reached - t(1) = T0 - dTout = 0.1d0 - tout = T0+dTout - if (outproc) then - write(6,*) " t steps steps att. fe fi" - write(6,*) " -------------------------------------------------" - end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) - if (retval /= 0) then - print *, "Error: FARKodeEvolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Retrieve solver statistics - retval = FARKodeGetNumSteps(arkode_mem, nst) - if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) - if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - if (outproc) write(6,'(3x,f10.6,4(3x,i6))') t, nst, nst_a, nfe, nfi - tout = min(tout + dTout, Tf) - - end do - if (outproc) then - write(6,*) " -------------------------------------------------" - end if - - ! Get max. absolute error in the local vector. - errmax = 0.d0 - do i = 1,nlocal - erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) - errmax = max(errmax, abs(erri)) - end do - - ! Get global max. error from MPI_Reduce call. - call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & - 0, comm, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error in MPI_Reduce = ", ierr - call MPI_Abort(comm, 1, ierr) - end if + do iPretype = 1, 2 - ! Print global max. error - if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + if (iPretype == 2) then - ! Get final statistics - retval = FARKodeGetNumSteps(arkode_mem, nst) - if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval + y = 1.d0 + retval = FARKStepReInit(arkode_mem, c_null_funptr, c_funloc(frhs), & + t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FARKStepReInit, retval = ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) - if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ", retval + retval = FARKBBDPrecReInit(arkode_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error in FARKBBDPrecReInit, retval = ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) - if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ", retval + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval call MPI_Abort(comm, 1, ierr) - end if + end if + + if (outproc) write (6, *) " Preconditioning on right:" - retval = FARKodeGetNumPrecEvals(arkode_mem, npre) - if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecEvals returned ", retval + end if + + if (iPretype == 1 .and. outproc) write (6, *) " Preconditioning on left:" + + ! Main time-stepping loop: calls FARKodeEvolve to perform the integration, + ! then prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0 + dTout + if (outproc) then + write (6, *) " t steps steps att. fe fi" + write (6, *) " -------------------------------------------------" + end if + do ioutput = 1, Nt + + ! Integrate to output time + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKodeEvolve returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) - if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecSolves returned ", retval + ! Retrieve solver statistics + retval = FARKodeGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKodeGetNumSteps returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) - if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKodeGetNumStepAttempts returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FARKodeGetNumLinIters(arkode_mem, nli) - if (retval /= 0) then - print *, "Error: FARKodeGetNumLinIters returned ", retval + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - avdim = dble(nli) / dble(nni) + ! print solution stats and update internal time + if (outproc) write (6, '(3x,f10.6,4(3x,i6))') t, nst, nst_a, nfe, nfi + tout = min(tout + dTout, Tf) - retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) - if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + end do + if (outproc) then + write (6, *) " -------------------------------------------------" + end if - retval = FARKodeGetNumLinConvFails(arkode_mem, ncfl) - if (retval /= 0) then - print *, "Error: FARKodeGetNumLinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1, nlocal + erri = y(i) - exp(-alpha*(myid*nlocal + i)*t(1)) + errmax = max(errmax, abs(erri)) + end do - retval = FARKodeGetNumErrTestFails(arkode_mem, netf) - if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if - retval = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) - if (retval /= 0) then - print *, "Error: FARKodeGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax - retval = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) - if (retval /= 0) then - print *, "Error: FARKodeGetLinWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! Get final statistics + retval = FARKodeGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FARKBBDPrecGetWorkSpace(arkode_mem, lenrwbbd, leniwbbd) - if (retval /= 0) then - print *, "Error: FARKBBDPrecGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FARKBBDPrecGetNumGfnEvals(arkode_mem, ngebbd) - if (retval /= 0) then - print *, "Error: FARKBBDPrecGetNumGfnEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Print some final statistics - if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & - " (attempted = ", nst_a, ")" - write(6,'(A,i6)') " Total explicit RHS evals = ", nfe - write(6,'(A,i6)') " Total implicit RHS evals = ", nfi - write(6,'(A,i6)') " Total preconditioner setups = ", npre - write(6,'(A,i6)') " Total preconditioner solves = ", npsol - write(6,'(A,i6)') " Total nonlinear iterations = ", nni - write(6,'(A,i6)') " Total linear iterations = ", nli - write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim - write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn - write(6,'(A,i6)') " - Linear = ", ncfl - write(6,'(A,i6)') " Total number of error test failures = ", netf - write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw - write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls - write(6,'(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd - write(6,'(A,i6)') " Total number of g evals = ", ngebbd - write(6,'(A)') " " - write(6,'(A)') " " - write(6,'(A)') " " - end if + retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + if (retval /= 0) then + print *, "Error: FARKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumPrecEvals(arkode_mem, npre) + if (retval /= 0) then + print *, "Error: FARKodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) + if (retval /= 0) then + print *, "Error: FARKodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) + if (retval /= 0) then + print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumLinIters(arkode_mem, nli) + if (retval /= 0) then + print *, "Error: FARKodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + avdim = dble(nli)/dble(nni) + + retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FARKodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumLinConvFails(arkode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FARKodeGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumErrTestFails(arkode_mem, netf) + if (retval /= 0) then + print *, "Error: FARKodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FARKodeGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FARKodeGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKBBDPrecGetWorkSpace(arkode_mem, lenrwbbd, leniwbbd) + if (retval /= 0) then + print *, "Error: FARKBBDPrecGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKBBDPrecGetNumGfnEvals(arkode_mem, ngebbd) + if (retval /= 0) then + print *, "Error: FARKBBDPrecGetNumGfnEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write (6, '(A,i6)') " Total explicit RHS evals = ", nfe + write (6, '(A,i6)') " Total implicit RHS evals = ", nfi + write (6, '(A,i6)') " Total preconditioner setups = ", npre + write (6, '(A,i6)') " Total preconditioner solves = ", npsol + write (6, '(A,i6)') " Total nonlinear iterations = ", nni + write (6, '(A,i6)') " Total linear iterations = ", nli + write (6, '(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write (6, '(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write (6, '(A,i6)') " - Linear = ", ncfl + write (6, '(A,i6)') " Total number of error test failures = ", netf + write (6, '(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write (6, '(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write (6, '(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd + write (6, '(A,i6)') " Total number of g evals = ", ngebbd + write (6, '(A)') " " + write (6, '(A)') " " + write (6, '(A)') " " + end if end do ! Clean up and return with successful completion diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 index e05da275b0..d3bfc3a55f 100644 --- a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -52,13 +52,11 @@ module DiagnonData contains - - !----------------------------------------------------------------- ! ODE RHS function f(t,y). !----------------------------------------------------------------- integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -70,7 +68,7 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(nlocal) :: y(:) @@ -82,15 +80,15 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) ! Initialize ydot to zero ydot = 0.d0 ! Fill ydot with rhs function - do i = 1,nlocal - ydot(i) = -alpha * (myid * nlocal + i) * y(i) + do i = 1, nlocal + ydot(i) = -alpha*(myid*nlocal + i)*y(i) end do retval = 0 ! Return with success @@ -98,11 +96,9 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & end function frhs !----------------------------------------------------------------- - end module DiagnonData !------------------------------------------------------------------- - !------------------------------------------------------------------- ! Main driver program !------------------------------------------------------------------- @@ -149,45 +145,45 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Set input arguments neq and alpha - neq = nprocs * nlocal - alpha = 10.0d0 / neq + neq = nprocs*nlocal + alpha = 10.0d0/neq ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "Diagonal test problem:"; - write(6,'(A,i4)') " neq = " , neq - write(6,'(A,i4)') " nlocal = " , nlocal - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,es9.2)') " alpha = ", alpha - write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" - write(6,*) " " - endif + write (6, *) " " + write (6, *) "Diagonal test problem:"; + write (6, '(A,i4)') " neq = ", neq + write (6, '(A,i4)') " nlocal = ", nlocal + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,es9.2)') " alpha = ", alpha + write (6, *) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write (6, *) " " + end if ! Create solution vector, point at its data, and set initial condition sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) @@ -197,15 +193,15 @@ program driver ! Create the ERKStep timestepper module arkode_mem = FERKStepCreate(c_funloc(frhs), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *, "Error: FERKStepCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Main time-stepping loop: calls FARKodeEvolve to perform the @@ -213,60 +209,60 @@ program driver ! has been reached. t(1) = T0 dTout = 0.1d0 - tout = T0+dTout + tout = T0 + dTout if (outproc) then - write(6,*) " t steps steps att. fe" - write(6,*) " -----------------------------------------" + write (6, *) " t steps steps att. fe" + write (6, *) " -----------------------------------------" end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) - if (retval /= 0) then - print *, "Error: FARKodeEvolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FARKodeGetNumSteps(arkode_mem, nst) - if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) - if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) - if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - if (outproc) write(6,'(3x,f10.6,3(3x,i5))') t, nst, nst_a, nfe - tout = min(tout + dTout, Tf) + do ioutput = 1, Nt + + ! Integrate to output time + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKodeEvolve returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumSteps(arkode_mem, nst) + if (retval /= 0) then + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) + if (retval /= 0) then + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + if (retval /= 0) then + print *, "Error: FERKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write (6, '(3x,f10.6,3(3x,i5))') t, nst, nst_a, nfe + tout = min(tout + dTout, Tf) end do if (outproc) then - write(6,*) " -----------------------------------------" + write (6, *) " -----------------------------------------" end if ! Get max. absolute error in the local vector. errmax = 0.d0 - do i = 1,nlocal - erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) - errmax = max(errmax, abs(erri)) + do i = 1, nlocal + erri = y(i) - exp(-alpha*(myid*nlocal + i)*t(1)) + errmax = max(errmax, abs(erri)) end do ! Get global max. error from MPI_Reduce call. call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & - 0, comm, ierr) + 0, comm, ierr) if (ierr /= MPI_SUCCESS) then - print *, "Error in MPI_Reduce = ", ierr - call MPI_Abort(comm, 1, ierr) + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Print global max. error @@ -275,37 +271,37 @@ program driver ! Get final statistics retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FERKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Print some final statistics if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & - " (attempted = ", nst_a, ")" - write(6,'(A,i6)') " Total RHS evals = ", nfe - write(6,'(A,i6)') " Total number of error test failures = ", netf - endif + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write (6, '(A,i6)') " Total RHS evals = ", nfe + write (6, '(A,i6)') " Total number of error test failures = ", netf + end if ! Clean up and return with successful completion call FARKodeFree(arkode_mem) ! free integrator memory diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index e8c53d66cd..36e1d9e315 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -85,7 +85,7 @@ module Heat2DData integer, target :: comm ! communicator object integer :: myid ! MPI process ID integer :: nprocs ! total number of MPI processes - logical :: HaveNbor(2,2) ! flags denoting neighbor on boundary + logical :: HaveNbor(2, 2) ! flags denoting neighbor on boundary real(c_double), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange real(c_double), dimension(:), allocatable :: Wrecv real(c_double), dimension(:), allocatable :: Nrecv @@ -98,10 +98,10 @@ module Heat2DData ! Problem parameters real(c_double) :: kx ! x-directional diffusion coefficient real(c_double) :: ky ! y-directional diffusion coefficient - real(c_double), dimension(:,:), allocatable :: h ! heat source vector + real(c_double), dimension(:, :), allocatable :: h ! heat source vector ! Preconditioning data - real(c_double), dimension(:,:), allocatable :: d ! inverse of Jacobian diagonal + real(c_double), dimension(:, :), allocatable :: d ! inverse of Jacobian diagonal contains @@ -122,24 +122,23 @@ subroutine InitHeat2DData() dy = 0.d0 kx = 0.d0 ky = 0.d0 - if (allocated(h)) deallocate(h) - if (allocated(d)) deallocate(d) + if (allocated(h)) deallocate (h) + if (allocated(d)) deallocate (d) comm = MPI_COMM_WORLD myid = 0 nprocs = 0 HaveNbor = .false. - if (allocated(Erecv)) deallocate(Erecv) - if (allocated(Wrecv)) deallocate(Wrecv) - if (allocated(Nrecv)) deallocate(Nrecv) - if (allocated(Srecv)) deallocate(Srecv) - if (allocated(Esend)) deallocate(Esend) - if (allocated(Wsend)) deallocate(Wsend) - if (allocated(Nsend)) deallocate(Nsend) - if (allocated(Ssend)) deallocate(Ssend) + if (allocated(Erecv)) deallocate (Erecv) + if (allocated(Wrecv)) deallocate (Wrecv) + if (allocated(Nrecv)) deallocate (Nrecv) + if (allocated(Srecv)) deallocate (Srecv) + if (allocated(Esend)) deallocate (Esend) + if (allocated(Wsend)) deallocate (Wsend) + if (allocated(Nsend)) deallocate (Nsend) + if (allocated(Ssend)) deallocate (Ssend) end subroutine InitHeat2DData ! -------------------------------------------------------------- - ! -------------------------------------------------------------- ! Set up parallel decomposition ! -------------------------------------------------------------- @@ -154,91 +153,90 @@ subroutine SetupDecomp(ierr) ! check that this has not been called before if (allocated(h) .or. allocated(d)) then - write(0,*) "SetupDecomp warning: parallel decomposition already set up" - ierr = 1 - return + write (0, *) "SetupDecomp warning: parallel decomposition already set up" + ierr = 1 + return end if ! get suggested parallel decomposition dims = (/0, 0/) call MPI_Comm_size(MPI_COMM_WORLD, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = " , ierr - return + write (0, *) "Error in MPI_Comm_size = ", ierr + return end if call MPI_Dims_create(nprocs, 2, dims, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Dims_create = " , ierr - return + write (0, *) "Error in MPI_Dims_create = ", ierr + return end if ! set up 2D Cartesian communicator periods = (/0, 0/) call MPI_Cart_create(MPI_COMM_WORLD, 2, dims, periods, 0, comm, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_create = " , ierr - return + write (0, *) "Error in MPI_Cart_create = ", ierr + return end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = " , ierr - return + write (0, *) "Error in MPI_Comm_rank = ", ierr + return end if ! determine local extents call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_get = " , ierr - return + write (0, *) "Error in MPI_Cart_get = ", ierr + return end if is = nx*coords(1)/dims(1) + 1 - ie = nx*(coords(1)+1)/dims(1) + ie = nx*(coords(1) + 1)/dims(1) js = ny*coords(2)/dims(2) + 1 - je = ny*(coords(2)+1)/dims(2) - nxl = ie-is+1 - nyl = je-js+1 + je = ny*(coords(2) + 1)/dims(2) + nxl = ie - is + 1 + nyl = je - js + 1 ! determine if I have neighbors, and allocate exchange buffers - HaveNbor(1,1) = (is /= 1) - HaveNbor(1,2) = (ie /= nx) - HaveNbor(2,1) = (js /= 1) - HaveNbor(2,2) = (je /= ny) - if (HaveNbor(1,1)) then - allocate(Wrecv(nyl)) - allocate(Wsend(nyl)) - endif - if (HaveNbor(1,2)) then - allocate(Erecv(nyl)) - allocate(Esend(nyl)) - endif - if (HaveNbor(2,1)) then - allocate(Srecv(nxl)) - allocate(Ssend(nxl)) - endif - if (HaveNbor(2,2)) then - allocate(Nrecv(nxl)) - allocate(Nsend(nxl)) - endif + HaveNbor(1, 1) = (is /= 1) + HaveNbor(1, 2) = (ie /= nx) + HaveNbor(2, 1) = (js /= 1) + HaveNbor(2, 2) = (je /= ny) + if (HaveNbor(1, 1)) then + allocate (Wrecv(nyl)) + allocate (Wsend(nyl)) + end if + if (HaveNbor(1, 2)) then + allocate (Erecv(nyl)) + allocate (Esend(nyl)) + end if + if (HaveNbor(2, 1)) then + allocate (Srecv(nxl)) + allocate (Ssend(nxl)) + end if + if (HaveNbor(2, 2)) then + allocate (Nrecv(nxl)) + allocate (Nsend(nxl)) + end if ! allocate temporary vectors - allocate(h(nxl,nyl)) ! Create vector for heat source - allocate(d(nxl,nyl)) ! Create vector for Jacobian diagonal + allocate (h(nxl, nyl)) ! Create vector for heat source + allocate (d(nxl, nyl)) ! Create vector for Jacobian diagonal ierr = 0 ! return with success flag return end subroutine SetupDecomp ! -------------------------------------------------------------- - ! -------------------------------------------------------------- ! Perform neighbor exchange ! -------------------------------------------------------------- subroutine Exchange(y, ierr) ! declarations implicit none - real(c_double), intent(in) :: y(nxl,nyl) + real(c_double), intent(in) :: y(nxl, nyl) integer, intent(out) :: ierr - integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; + integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; integer :: stat(MPI_STATUS_SIZE) integer :: i, ipW, ipE, ipS, ipN integer :: coords(2), dims(2), periods(2), nbcoords(2) @@ -248,194 +246,193 @@ subroutine Exchange(y, ierr) ! MPI neighborhood information call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_get = ", ierr - return - endif - if (HaveNbor(1,1)) then - nbcoords = (/ coords(1)-1, coords(2) /) - call MPI_Cart_rank(comm, nbcoords, ipW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - endif - endif - if (HaveNbor(1,2)) then - nbcoords = (/ coords(1)+1, coords(2) /) - call MPI_Cart_rank(comm, nbcoords, ipE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - endif - endif - if (HaveNbor(2,1)) then - nbcoords = (/ coords(1), coords(2)-1 /) - call MPI_Cart_rank(comm, nbcoords, ipS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - endif - endif - if (HaveNbor(2,2)) then - nbcoords = (/ coords(1), coords(2)+1 /) - call MPI_Cart_rank(comm, nbcoords, ipN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - endif - endif + write (0, *) "Error in MPI_Cart_get = ", ierr + return + end if + if (HaveNbor(1, 1)) then + nbcoords = (/coords(1) - 1, coords(2)/) + call MPI_Cart_rank(comm, nbcoords, ipW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(1, 2)) then + nbcoords = (/coords(1) + 1, coords(2)/) + call MPI_Cart_rank(comm, nbcoords, ipE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(2, 1)) then + nbcoords = (/coords(1), coords(2) - 1/) + call MPI_Cart_rank(comm, nbcoords, ipS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if + end if + if (HaveNbor(2, 2)) then + nbcoords = (/coords(1), coords(2) + 1/) + call MPI_Cart_rank(comm, nbcoords, ipN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if + end if ! open Irecv buffers - if (HaveNbor(1,1)) then - call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & - MPI_ANY_TAG, comm, reqRW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - endif - endif - if (HaveNbor(1,2)) then - call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & - MPI_ANY_TAG, comm, reqRE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - endif - endif - if (HaveNbor(2,1)) then - call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & - MPI_ANY_TAG, comm, reqRS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - endif - endif - if (HaveNbor(2,2)) then - call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & - MPI_ANY_TAG, comm, reqRN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - endif - endif + if (HaveNbor(1, 1)) then + call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & + MPI_ANY_TAG, comm, reqRW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(1, 2)) then + call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & + MPI_ANY_TAG, comm, reqRE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(2, 1)) then + call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & + MPI_ANY_TAG, comm, reqRS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if + end if + if (HaveNbor(2, 2)) then + call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & + MPI_ANY_TAG, comm, reqRN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if + end if ! send data - if (HaveNbor(1,1)) then - do i=1,nyl - Wsend(i) = y(1,i) - enddo - call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & - comm, reqSW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - endif - endif - if (HaveNbor(1,2)) then - do i=1,nyl - Esend(i) = y(nxl,i) - enddo - call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & - comm, reqSE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - endif - endif - if (HaveNbor(2,1)) then - do i=1,nxl - Ssend(i) = y(i,1) - enddo - call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & - comm, reqSS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - endif - endif - if (HaveNbor(2,2)) then - do i=1,nxl - Nsend(i) = y(i,nyl) - enddo - call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & - comm, reqSN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - endif - endif + if (HaveNbor(1, 1)) then + do i = 1, nyl + Wsend(i) = y(1, i) + end do + call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & + comm, reqSW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(1, 2)) then + do i = 1, nyl + Esend(i) = y(nxl, i) + end do + call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & + comm, reqSE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(2, 1)) then + do i = 1, nxl + Ssend(i) = y(i, 1) + end do + call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & + comm, reqSS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if + end if + if (HaveNbor(2, 2)) then + do i = 1, nxl + Nsend(i) = y(i, nyl) + end do + call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & + comm, reqSN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if + end if ! wait for messages to finish - if (HaveNbor(1,1)) then - call MPI_Wait(reqRW, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - call MPI_Wait(reqSW, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - endif - if (HaveNbor(1,2)) then - call MPI_Wait(reqRE, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - call MPI_Wait(reqSE, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - endif - if (HaveNbor(2,1)) then - call MPI_Wait(reqRS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - call MPI_Wait(reqSS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - endif - if (HaveNbor(2,2)) then - call MPI_Wait(reqRN, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - call MPI_Wait(reqSN, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - endif - endif + if (HaveNbor(1, 1)) then + call MPI_Wait(reqRW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(1, 2)) then + call MPI_Wait(reqRE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(2, 1)) then + call MPI_Wait(reqRS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + end if + if (HaveNbor(2, 2)) then + call MPI_Wait(reqRN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + end if ierr = MPI_SUCCESS ! return with success flag return end subroutine Exchange ! -------------------------------------------------------------- - ! -------------------------------------------------------------- ! Free memory allocated within Userdata ! -------------------------------------------------------------- subroutine FreeHeat2DData(ierr) implicit none integer, intent(out) :: ierr - if (allocated(h)) deallocate(h) - if (allocated(d)) deallocate(d) - if (allocated(Wrecv)) deallocate(Wrecv) - if (allocated(Wsend)) deallocate(Wsend) - if (allocated(Erecv)) deallocate(Erecv) - if (allocated(Esend)) deallocate(Esend) - if (allocated(Srecv)) deallocate(Srecv) - if (allocated(Ssend)) deallocate(Ssend) - if (allocated(Nrecv)) deallocate(Nrecv) - if (allocated(Nsend)) deallocate(Nsend) + if (allocated(h)) deallocate (h) + if (allocated(d)) deallocate (d) + if (allocated(Wrecv)) deallocate (Wrecv) + if (allocated(Wsend)) deallocate (Wsend) + if (allocated(Erecv)) deallocate (Erecv) + if (allocated(Esend)) deallocate (Esend) + if (allocated(Srecv)) deallocate (Srecv) + if (allocated(Ssend)) deallocate (Ssend) + if (allocated(Nrecv)) deallocate (Nrecv) + if (allocated(Nsend)) deallocate (Nsend) ierr = 0 ! return with success flag return end subroutine FreeHeat2DData @@ -445,7 +442,7 @@ end subroutine FreeHeat2DData ! ODE RHS function f(t,y). ! ---------------------------------------------------------------- integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -457,11 +454,11 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) - real(c_double), pointer, dimension(nxl,nyl) :: ydot(:,:) + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :) + real(c_double), pointer, dimension(nxl, nyl) :: ydot(:, :) ! local data real(c_double) :: c1, c2, c3 @@ -470,8 +467,8 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) - ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_ydot) ! Initialize ydot to zero ydot = 0.d0 @@ -479,66 +476,66 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & ! Exchange boundary data with neighbors call Exchange(y, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in Exchange = " , ierr - retval = -1 - return + write (0, *) "Error in Exchange = ", ierr + retval = -1 + return end if ! iterate over subdomain interior, computing approximation to RHS c1 = kx/dx/dx c2 = ky/dy/dy c3 = -2.d0*(c1 + c2) - do j=2,nyl-1 - do i=2,nxl-1 - ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) - enddo - enddo + do j = 2, nyl - 1 + do i = 2, nxl - 1 + ydot(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) + end do + end do ! iterate over subdomain boundaries (if not at overall domain boundary) - if (HaveNbor(1,1)) then ! West face - i=1 - do j=2,nyl-1 - ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) - enddo - endif - if (HaveNbor(1,2)) then ! East face - i=nxl - do j=2,nyl-1 - ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) - enddo - endif - if (HaveNbor(2,1)) then ! South face - j=1 - do i=2,nxl-1 - ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - enddo - endif - if (HaveNbor(2,2)) then ! West face - j=nyl - do i=2,nxl-1 - ydot(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - enddo - endif - if (HaveNbor(1,1) .and. HaveNbor(2,1)) then ! South-West corner - i=1 - j=1 - ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - endif - if (HaveNbor(1,1) .and. HaveNbor(2,2)) then ! North-West corner - i=1 - j=nyl - ydot(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - endif - if (HaveNbor(1,2) .and. HaveNbor(2,1)) then ! South-East corner - i=nxl - j=1 - ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - endif - if (HaveNbor(1,2) .and. HaveNbor(2,2)) then ! North-East corner - i=nxl - j=nyl - ydot(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - endif + if (HaveNbor(1, 1)) then ! West face + i = 1 + do j = 2, nyl - 1 + ydot(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) + end do + end if + if (HaveNbor(1, 2)) then ! East face + i = nxl + do j = 2, nyl - 1 + ydot(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) + end do + end if + if (HaveNbor(2, 1)) then ! South face + j = 1 + do i = 2, nxl - 1 + ydot(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end do + end if + if (HaveNbor(2, 2)) then ! West face + j = nyl + do i = 2, nxl - 1 + ydot(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end do + end if + if (HaveNbor(1, 1) .and. HaveNbor(2, 1)) then ! South-West corner + i = 1 + j = 1 + ydot(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end if + if (HaveNbor(1, 1) .and. HaveNbor(2, 2)) then ! North-West corner + i = 1 + j = nyl + ydot(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end if + if (HaveNbor(1, 2) .and. HaveNbor(2, 1)) then ! South-East corner + i = nxl + j = 1 + ydot(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end if + if (HaveNbor(1, 2) .and. HaveNbor(2, 2)) then ! North-East corner + i = nxl + j = nyl + ydot(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end if ydot = ydot + h ! add in heat source @@ -547,12 +544,11 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & end function frhs ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Preconditioner setup routine (fills inverse of Jacobian diagonal) ! ---------------------------------------------------------------- integer(c_int) function PSetup(t, sunvec_y, sunvec_ydot, jok, jcurPtr, & - gamma, user_data) result(ierr) bind(C) + gamma, user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -567,7 +563,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_ydot, jok, jcurPtr, & integer(c_int), value :: jok ! flag to signal for Jacobian update integer(c_int) :: jcurPtr ! flag to singal Jacobian is current real(c_double), value :: gamma ! current gamma value - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local variables real(c_double) :: c @@ -588,12 +584,11 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_ydot, jok, jcurPtr, & end function PSetup ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Preconditioner solve routine ! ---------------------------------------------------------------- integer(c_int) function PSolve(t, sunvec_y, sunvec_ydot, sunvec_r, & - sunvec_z, gamma, delta, lr, user_data) result(ierr) bind(C) + sunvec_z, gamma, delta, lr, user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -610,17 +605,17 @@ integer(c_int) function PSolve(t, sunvec_y, sunvec_ydot, sunvec_r, & real(c_double), value :: gamma ! current gamma value real(c_double), value :: delta ! current delta value integer(c_int), value :: lr ! left or right preconditioning - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(nxl,nyl) :: r(:,:) - real(c_double), pointer, dimension(nxl,nyl) :: z(:,:) + real(c_double), pointer, dimension(nxl, nyl) :: r(:, :) + real(c_double), pointer, dimension(nxl, nyl) :: z(:, :) !======= Internals ============ ! Get data arrays from SUNDIALS vectors - r(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_r) - z(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_z) + r(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_r) + z(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_z) ! perform Jacobi solve (whole array operation) z = r*d @@ -633,7 +628,6 @@ end function PSolve end module Heat2DData ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -667,9 +661,9 @@ program driver ! solution vector and other local variables type(N_Vector), pointer :: sunvec_y ! solution N_Vector type(N_Vector), pointer :: sunvec_ones ! masking vector for output - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) ! vector data + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :) ! vector data type(SUNLinearSolver), pointer :: sun_LS ! linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(c_ptr) :: arkode_mem ! ARKODE memory integer(c_int64_t) :: N, Ntot integer(c_int) :: retval @@ -694,13 +688,13 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Initialize Heat2DData module @@ -709,130 +703,130 @@ program driver ny = ny_ kx = kx_ ky = ky_ - dx = 1.d0/(nx-1) ! x mesh spacing - dy = 1.d0/(ny-1) ! x mesh spacing + dx = 1.d0/(nx - 1) ! x mesh spacing + dy = 1.d0/(ny - 1) ! x mesh spacing ! Set up parallel decomposition (computes local mesh sizes) call SetupDecomp(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in SetupDecomp = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in SetupDecomp = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "2D Heat PDE test problem:"; - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,i4)') " nx = ", nx - write(6,'(A,i4)') " ny = ", ny - write(6,'(A,f5.2)') " kx = ", kx - write(6,'(A,f5.2)') " ky = ", ky - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,i4)') " nxl (proc 0) = ", nxl - write(6,'(A,i4)') " nyl (proc 0) = ", nyl - write(6,*) " " - endif + write (6, *) " " + write (6, *) "2D Heat PDE test problem:"; + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,i4)') " nx = ", nx + write (6, '(A,i4)') " ny = ", ny + write (6, '(A,f5.2)') " kx = ", kx + write (6, '(A,f5.2)') " ky = ", ky + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,i4)') " nxl (proc 0) = ", nxl + write (6, '(A,i4)') " nyl (proc 0) = ", nyl + write (6, *) " " + end if ! Create solution vector, point at its data, and set initial condition N = nxl*nyl Ntot = nx*ny sunvec_y => FN_VNew_Parallel(comm, N, Ntot, sunctx) - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) y = 0.d0 ! Create the ARKStep timestepper module arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(frhs), t0, sunvec_y, sunctx) if (.not. c_associated(arkode_mem)) then - print *, "Error: FARKStepCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Create linear solver sun_LS => FSUNLinSol_PCG(sunvec_y, SUN_PREC_LEFT, int(20, c_int), sunctx) if (.not. associated(sun_LS)) then - print *, "Error: FSUNLinSol_PCG returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNLinSol_PCG returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Attach linear solver sunmat_A => null() retval = FARKodeSetLinearSolver(arkode_mem, sun_LS, sunmat_A) if (retval /= 0) then - print *, "Error: FARKodeSetLinearSolver returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetLinearSolver returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Attach preconditioner retval = FARKodeSetPreconditioner(arkode_mem, c_funloc(PSetup), & - c_funloc(PSolve)) + c_funloc(PSolve)) if (retval /= 0) then - print *, "Error: FARKodeSetPreconditioner returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetPreconditioner returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FARKodeSStolerances(arkode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FARKodeSStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver convergence coefficient retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetNonlinConvCoef returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify nonlinear solver predictor method retval = FARKodeSetPredictorMethod(arkode_mem, int(1, c_int)) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetNonlinConvCoef returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify that problem is linearly implicit retval = FARKodeSetLinear(arkode_mem, int(0, c_int)) if (retval /= 0) then - print *, "Error: FARKodeSetNonlinConvCoef returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeSetNonlinConvCoef returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! fill in the heat source array - do j=1,nyl - do i=1,nxl - h(i,j) = sin(pi*(is+i-2)*dx) * sin(2.d0*pi*(js+j-2)*dy) - enddo - enddo + do j = 1, nyl + do i = 1, nxl + h(i, j) = sin(pi*(is + i - 2)*dx)*sin(2.d0*pi*(js + j - 2)*dy) + end do + end do ! Each processor outputs subdomain information - write(idstring, "(f4.3)") myid/1000.0 - subdomainname = "heat2d_subdomain" // idstring // ".txt" - open(100, file=subdomainname) - write(100,'(6(i9,1x))') nx, ny, is, ie, js, je - close(100) + write (idstring, "(f4.3)") myid/1000.0 + subdomainname = "heat2d_subdomain"//idstring//".txt" + open (100, file=subdomainname) + write (100, '(6(i9,1x))') nx, ny, is, ie, js, je + close (100) ! Open output streams for results, access data array - outname = "heat2d" // idstring // ".txt" - open(101, file=outname) + outname = "heat2d"//idstring//".txt" + open (101, file=outname) ! Output initial condition to disk - do j=1,nyl - do i=1,nxl - write(101,'(es25.16)',advance='no') y(i,j) - enddo - enddo - write(101,*) " " + do j = 1, nyl + do i = 1, nxl + write (101, '(es25.16)', advance='no') y(i, j) + end do + end do + write (101, *) " " ! create masking vector for computing solution RMS norm sunvec_ones => FN_VNew_Parallel(comm, N, Ntot, sunctx) @@ -841,112 +835,112 @@ program driver ! Main time-stepping loop: calls ARKODE to perform the integration, then ! prints results. Stops when the final time has been reached t(1) = T0 - dTout = (Tf-T0)/Nt - tout = T0+dTout + dTout = (Tf - T0)/Nt + tout = T0 + dTout urms = FN_VWrmsNorm(sunvec_y, sunvec_ones) if (outproc) then - write(6,*) " t ||u||_rms" - write(6,*) " ----------------------" - write(6,'(2(2x,f10.6))') t, urms - endif - do ioutput=1,Nt - - ! Integrate to output time - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) - if (retval /= 0) then - print *, "Error: FARKodeEvolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - urms = FN_VWrmsNorm(sunvec_y, sunvec_ones) - if (outproc) write(6,'(2(2x,f10.6))') t, urms - tout = min(tout + dTout, Tf) - - ! output results to disk - do j=1,nyl - do i=1,nxl - write(101,'(es25.16)',advance='no') y(i,j) - enddo - enddo - write(101,*) " " - - enddo + write (6, *) " t ||u||_rms" + write (6, *) " ----------------------" + write (6, '(2(2x,f10.6))') t, urms + end if + do ioutput = 1, Nt + + ! Integrate to output time + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, t, ARK_NORMAL) + if (retval /= 0) then + print *, "Error: FARKodeEvolve returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + urms = FN_VWrmsNorm(sunvec_y, sunvec_ones) + if (outproc) write (6, '(2(2x,f10.6))') t, urms + tout = min(tout + dTout, Tf) + + ! output results to disk + do j = 1, nyl + do i = 1, nxl + write (101, '(es25.16)', advance='no') y(i, j) + end do + end do + write (101, *) " " + + end do if (outproc) then - write(6,*) " ----------------------" - endif - close(101) + write (6, *) " ----------------------" + end if + close (101) ! Get final statistics retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, "Error: FARKodeGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, "Error: FARKodeGetNumStepAttempts returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumStepAttempts returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKStepGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumErrTestFails(arkode_mem, netf) if (retval /= 0) then - print *, "Error: FARKodeGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nni) if (retval /= 0) then - print *, "Error: FARKodeGetNumNonlinSolvIters returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumLinConvFails(arkode_mem, ncfn) if (retval /= 0) then - print *, "Error: FARKodeGetNumLinConvFails returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumLinConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumLinIters(arkode_mem, nli) if (retval /= 0) then - print *, "Error: FARKodeGetNumLinIters returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumPrecEvals(arkode_mem, npre) if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FARKodeGetNumPrecSolves(arkode_mem, npsol) if (retval /= 0) then - print *, "Error: FARKodeGetNumPrecSolves returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FARKodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Print some final statistics if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(2(A,i6),A)') " Internal solver steps = ", nst, & - " (attempted = ", nst_a, ")" - write(6,'(A,i6,A,i6)') " Total RHS evals: Fe = ", nfe, ", Fi = ", nfi - write(6,'(A,i6)') " Total linear iterations = ", nli - write(6,'(A,i6)') " Total number of Preconditioner setups = ", npre - write(6,'(A,i6)') " Total number of Preconditioner solves = ", npsol - write(6,'(A,i6)') " Total number of linear solver convergence failures = ", & - ncfn - write(6,'(A,i6)') " Total number of Newton iterations = ", nni - write(6,'(A,i6)') " Total number of error test failures = ", netf - endif + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(2(A,i6),A)') " Internal solver steps = ", nst, & + " (attempted = ", nst_a, ")" + write (6, '(A,i6,A,i6)') " Total RHS evals: Fe = ", nfe, ", Fi = ", nfi + write (6, '(A,i6)') " Total linear iterations = ", nli + write (6, '(A,i6)') " Total number of Preconditioner setups = ", npre + write (6, '(A,i6)') " Total number of Preconditioner solves = ", npsol + write (6, '(A,i6)') " Total number of linear solver convergence failures = ", & + ncfn + write (6, '(A,i6)') " Total number of Newton iterations = ", nni + write (6, '(A,i6)') " Total number of error test failures = ", netf + end if ! Clean up and return with successful completion call FARKodeFree(arkode_mem) ! free integrator memory diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 2df7e977c3..974e0cea02 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -62,7 +62,7 @@ module analytic_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -74,7 +74,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yvec(:) @@ -87,8 +87,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0+tn*tn) - lamda*atan(tn); - + fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn); ! return success ierr = 0 return @@ -99,7 +98,6 @@ end function RhsFn end module analytic_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -131,9 +129,9 @@ program main 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(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, dimension(neq) :: yvec(:) ! underlying vector @@ -145,17 +143,17 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = 1.0d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = 1.0d0 + nout = ceiling(tend/dtout) ! create SUNDIALS N_Vector sunvec_y => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if yvec => FN_VGetArrayPointer(sunvec_y) @@ -164,25 +162,25 @@ program main ! create ARKStep memory arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(RhsFn), tstart, sunvec_y, ctx) - if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a dense linear solver. sunmat_A => FSUNDenseMatrix(neq, neq, ctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sunls => FSUNLinSol_Dense(sunvec_y, sunmat_A, ctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSetLinearSolver' - stop 1 + write (*, *) 'Error in FARKodeSetLinearSolver' + stop 1 end if ! set relative and absolute tolerances @@ -191,25 +189,25 @@ program main ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + write (*, *) 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if sunCtrl => FSUNAdaptController_ImpGus(ctx) if (.not. associated(sunCtrl)) then - print *, 'ERROR: sunCtrl = NULL' - stop 1 + print *, 'ERROR: sunCtrl = NULL' + stop 1 end if ierr = FARKodeSetAdaptController(arkode_mem, sunCtrl) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSetAdaptController, ierr = ', ierr, '; halting' - stop 1 + write (*, *) 'Error in FARKodeSetAdaptController, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeSetNonlinConvCoef(arkode_mem, 0.01d0) if (ierr /= 0) then - write(*,*) 'Error in FARKodeSetNonlinConvCoef, ierr = ', ierr, '; halting' - stop 1 + write (*, *) 'Error in FARKodeSetNonlinConvCoef, ierr = ', ierr, '; halting' + stop 1 end if ! Start time stepping @@ -219,20 +217,20 @@ program main print *, ' t y ' print *, '----------------------------' print '(2x,2(es12.5,1x))', tcur, yvec(1) - do outstep = 1,nout + do outstep = 1, nout - ! call ARKodeEvolve - tout = min(tout + dtout, tend) - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) - if (ierr /= 0) then - write(*,*) 'Error in FARKODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call ARKodeEvolve + tout = min(tout + dtout, tend) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + write (*, *) 'Error in FARKODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - enddo + end do ! diagnostics output call ARKStepStats(arkode_mem) @@ -248,7 +246,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -289,90 +286,90 @@ subroutine ARKStepStats(arkode_mem) ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if - nfevals=nfe+nfi + nfevals = nfe + nfi ierr = FARKodeGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 index 80908e0127..0d63e260cf 100644 --- a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -105,36 +105,36 @@ module FEMBasis contains ! left/right basis functions - real(c_double) function ChiL(xl,xr,x) + real(c_double) function ChiL(xl, xr, x) real(c_double) :: xl, xr, x - ChiL = (xr-x)/(xr-xl) + ChiL = (xr - x)/(xr - xl) end function ChiL - real(c_double) function ChiR(xl,xr,x) + real(c_double) function ChiR(xl, xr, x) real(c_double) :: xl, xr, x - ChiR = (x-xl)/(xr-xl) + ChiR = (x - xl)/(xr - xl) end function ChiR ! derivatives of left/right basis functions - real(c_double) function ChiL_x(xl,xr) + real(c_double) function ChiL_x(xl, xr) real(c_double) :: xl, xr - ChiL_x = 1.d0/(xl-xr) + ChiL_x = 1.d0/(xl - xr) end function ChiL_X - real(c_double) function ChiR_x(xl,xr) + real(c_double) function ChiR_x(xl, xr) real(c_double) :: xl, xr - ChiR_x = 1.d0/(xr-xl) + ChiR_x = 1.d0/(xr - xl) end function ChiR_x ! FEM output evaluation routines: value and derivative - real(c_double) function Eval(ul,ur,xl,xr,x) + real(c_double) function Eval(ul, ur, xl, xr, x) real(c_double) :: ul, ur, xl, xr, x - Eval = ul*ChiL(xl,xr,x) + ur*ChiR(xl,xr,x) + Eval = ul*ChiL(xl, xr, x) + ur*ChiR(xl, xr, x) end function Eval - real(c_double) function Eval_x(ul,ur,xl,xr) + real(c_double) function Eval_x(ul, ur, xl, xr) real(c_double) :: ul, ur, xl, xr - Eval_x = ul*ChiL_x(xl,xr) + ur*ChiR_x(xl,xr) + Eval_x = ul*ChiL_x(xl, xr) + ur*ChiR_x(xl, xr) end function Eval_x end module FEMBasis @@ -147,28 +147,28 @@ module Quadrature contains ! nodes - real(c_double) function X1(xl,xr) + real(c_double) function X1(xl, xr) real(c_double) :: xl, xr - X1 = 0.5d0*(xl+xr) - 0.5d0*(xr-xl)*0.774596669241483377035853079956d0 + X1 = 0.5d0*(xl + xr) - 0.5d0*(xr - xl)*0.774596669241483377035853079956d0 end function X1 - real(c_double) function X2(xl,xr) + real(c_double) function X2(xl, xr) real(c_double) :: xl, xr - X2 = 0.5d0*(xl+xr) + X2 = 0.5d0*(xl + xr) end function X2 - real(c_double) function X3(xl,xr) + real(c_double) function X3(xl, xr) real(c_double) :: xl, xr - X3 = 0.5d0*(xl+xr) + 0.5d0*(xr-xl)*0.774596669241483377035853079956d0 + X3 = 0.5d0*(xl + xr) + 0.5d0*(xr - xl)*0.774596669241483377035853079956d0 end function X3 ! quadrature - real(c_double) function Quad(f1,f2,f3,xl,xr) + real(c_double) function Quad(f1, f2, f3, xl, xr) real(c_double) :: f1, f2, f3, xl, xr - real(c_double), parameter :: wt1=0.55555555555555555555555555555556d0 - real(c_double), parameter :: wt2=0.88888888888888888888888888888889d0 - real(c_double), parameter :: wt3=0.55555555555555555555555555555556d0 - Quad = 0.5d0*(xr-xl)*(wt1*f1 + wt2*f2 + wt3*f3) + real(c_double), parameter :: wt1 = 0.55555555555555555555555555555556d0 + real(c_double), parameter :: wt2 = 0.88888888888888888888888888888889d0 + real(c_double), parameter :: wt3 = 0.55555555555555555555555555555556d0 + Quad = 0.5d0*(xr - xl)*(wt1*f1 + wt2*f2 + wt3*f3) end function Quad end module Quadrature @@ -195,7 +195,7 @@ module bruss1D_ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use FEMBasis @@ -208,7 +208,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! Local data integer(c_int64_t) :: ix @@ -216,8 +216,8 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double) :: ul, ur, vl, vr, wl, wr, xl, xr, u, v, w, f1, f2, f3 ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(neqreal, N) :: yvec(:,:) - real(c_double), pointer, dimension(neqreal, N) :: fvec(:,:) + real(c_double), pointer, dimension(neqreal, N) :: yvec(:, :) + real(c_double), pointer, dimension(neqreal, N) :: fvec(:, :) !======= Internals ============ @@ -229,149 +229,149 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec = 0.d0 ! iterate over intervals, filling in rhs function - do ix=1,N-1 - - ! set booleans to determine whether equations exist on the left/right */ - left = .true. - right = .true. - if (ix==1) left = .false. - if (ix==(N-1)) right = .false. - - ! set nodal value shortcuts (interval index aligns with left node) - ul = yvec(1,ix) - vl = yvec(2,ix) - wl = yvec(3,ix) - ur = yvec(1,ix+1) - vr = yvec(2,ix+1) - wr = yvec(3,ix+1) - - ! set mesh shortcuts - xl = x(ix) - xr = x(ix+1) - - ! left test function - if (left) then - - ! u -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = (a - (w+1.d0)*u + v*u*u) * ChiL(xl,xr,X3(xl,xr)) - fvec(1,ix) = fvec(1,ix) + Quad(f1,f2,f3,xl,xr) - - ! u -- diffusion - f1 = -du * Eval_x(ul,ur,xl,xr) * ChiL_x(xl,xr) - fvec(1,ix) = fvec(1,ix) + Quad(f1,f1,f1,xl,xr) - - ! v -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = (w*u - v*u*u) * ChiL(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = (w*u - v*u*u) * ChiL(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = (w*u - v*u*u) * ChiL(xl,xr,X3(xl,xr)) - fvec(2,ix) = fvec(2,ix) + Quad(f1,f2,f3,xl,xr) - - ! v -- diffusion - f1 = -dv * Eval_x(vl,vr,xl,xr) * ChiL_x(xl,xr) - fvec(2,ix) = fvec(2,ix) + Quad(f1,f1,f1,xl,xr) - - ! w -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = ((b-w)/ep - w*u) * ChiL(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = ((b-w)/ep - w*u) * ChiL(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = ((b-w)/ep - w*u) * ChiL(xl,xr,X3(xl,xr)) - fvec(3,ix) = fvec(3,ix) + Quad(f1,f2,f3,xl,xr) - - ! w -- diffusion - f1 = -dw * Eval_x(wl,wr,xl,xr) * ChiL_x(xl,xr) - fvec(3,ix) = fvec(3,ix) + Quad(f1,f1,f1,xl,xr) - - end if - - ! right test function - if (right) then - - ! u -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = (a - (w+1.d0)*u + v*u*u) * ChiR(xl,xr,X3(xl,xr)) - fvec(1,ix+1) = fvec(1,ix+1) + Quad(f1,f2,f3,xl,xr) - - ! u -- diffusion - f1 = -du * Eval_x(ul,ur,xl,xr) * ChiR_x(xl,xr) - fvec(1,ix+1) = fvec(1,ix+1) + Quad(f1,f1,f1,xl,xr) - - ! v -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = (w*u - v*u*u) * ChiR(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = (w*u - v*u*u) * ChiR(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = (w*u - v*u*u) * ChiR(xl,xr,X3(xl,xr)) - fvec(2,ix+1) = fvec(2,ix+1) + Quad(f1,f2,f3,xl,xr) - - ! v -- diffusion - f1 = -dv * Eval_x(vl,vr,xl,xr) * ChiR_x(xl,xr) - fvec(2,ix+1) = fvec(2,ix+1) + Quad(f1,f1,f1,xl,xr) - - ! w -- reaction - u = Eval(ul, ur, xl, xr, X1(xl,xr)) - v = Eval(vl, vr, xl, xr, X1(xl,xr)) - w = Eval(wl, wr, xl, xr, X1(xl,xr)) - f1 = ((b-w)/ep - w*u) * ChiR(xl,xr,X1(xl,xr)) - u = Eval(ul, ur, xl, xr, X2(xl,xr)) - v = Eval(vl, vr, xl, xr, X2(xl,xr)) - w = Eval(wl, wr, xl, xr, X2(xl,xr)) - f2 = ((b-w)/ep - w*u) * ChiR(xl,xr,X2(xl,xr)) - u = Eval(ul, ur, xl, xr, X3(xl,xr)) - v = Eval(vl, vr, xl, xr, X3(xl,xr)) - w = Eval(wl, wr, xl, xr, X3(xl,xr)) - f3 = ((b-w)/ep - w*u) * ChiR(xl,xr,X3(xl,xr)) - fvec(3,ix+1) = fvec(3,ix+1) + Quad(f1,f2,f3,xl,xr) - - ! w -- diffusion - f1 = -dw * Eval_x(wl,wr,xl,xr) * ChiR_x(xl,xr) - fvec(3,ix+1) = fvec(3,ix+1) + Quad(f1,f1,f1,xl,xr) - - end if + do ix = 1, N - 1 + + ! set booleans to determine whether equations exist on the left/right */ + left = .true. + right = .true. + if (ix == 1) left = .false. + if (ix == (N - 1)) right = .false. + + ! set nodal value shortcuts (interval index aligns with left node) + ul = yvec(1, ix) + vl = yvec(2, ix) + wl = yvec(3, ix) + ur = yvec(1, ix + 1) + vr = yvec(2, ix + 1) + wr = yvec(3, ix + 1) + + ! set mesh shortcuts + xl = x(ix) + xr = x(ix + 1) + + ! left test function + if (left) then + + ! u -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = (a - (w + 1.d0)*u + v*u*u)*ChiL(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = (a - (w + 1.d0)*u + v*u*u)*ChiL(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = (a - (w + 1.d0)*u + v*u*u)*ChiL(xl, xr, X3(xl, xr)) + fvec(1, ix) = fvec(1, ix) + Quad(f1, f2, f3, xl, xr) + + ! u -- diffusion + f1 = -du*Eval_x(ul, ur, xl, xr)*ChiL_x(xl, xr) + fvec(1, ix) = fvec(1, ix) + Quad(f1, f1, f1, xl, xr) + + ! v -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = (w*u - v*u*u)*ChiL(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = (w*u - v*u*u)*ChiL(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = (w*u - v*u*u)*ChiL(xl, xr, X3(xl, xr)) + fvec(2, ix) = fvec(2, ix) + Quad(f1, f2, f3, xl, xr) + + ! v -- diffusion + f1 = -dv*Eval_x(vl, vr, xl, xr)*ChiL_x(xl, xr) + fvec(2, ix) = fvec(2, ix) + Quad(f1, f1, f1, xl, xr) + + ! w -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = ((b - w)/ep - w*u)*ChiL(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = ((b - w)/ep - w*u)*ChiL(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = ((b - w)/ep - w*u)*ChiL(xl, xr, X3(xl, xr)) + fvec(3, ix) = fvec(3, ix) + Quad(f1, f2, f3, xl, xr) + + ! w -- diffusion + f1 = -dw*Eval_x(wl, wr, xl, xr)*ChiL_x(xl, xr) + fvec(3, ix) = fvec(3, ix) + Quad(f1, f1, f1, xl, xr) + + end if + + ! right test function + if (right) then + + ! u -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = (a - (w + 1.d0)*u + v*u*u)*ChiR(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = (a - (w + 1.d0)*u + v*u*u)*ChiR(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = (a - (w + 1.d0)*u + v*u*u)*ChiR(xl, xr, X3(xl, xr)) + fvec(1, ix + 1) = fvec(1, ix + 1) + Quad(f1, f2, f3, xl, xr) + + ! u -- diffusion + f1 = -du*Eval_x(ul, ur, xl, xr)*ChiR_x(xl, xr) + fvec(1, ix + 1) = fvec(1, ix + 1) + Quad(f1, f1, f1, xl, xr) + + ! v -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = (w*u - v*u*u)*ChiR(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = (w*u - v*u*u)*ChiR(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = (w*u - v*u*u)*ChiR(xl, xr, X3(xl, xr)) + fvec(2, ix + 1) = fvec(2, ix + 1) + Quad(f1, f2, f3, xl, xr) + + ! v -- diffusion + f1 = -dv*Eval_x(vl, vr, xl, xr)*ChiR_x(xl, xr) + fvec(2, ix + 1) = fvec(2, ix + 1) + Quad(f1, f1, f1, xl, xr) + + ! w -- reaction + u = Eval(ul, ur, xl, xr, X1(xl, xr)) + v = Eval(vl, vr, xl, xr, X1(xl, xr)) + w = Eval(wl, wr, xl, xr, X1(xl, xr)) + f1 = ((b - w)/ep - w*u)*ChiR(xl, xr, X1(xl, xr)) + u = Eval(ul, ur, xl, xr, X2(xl, xr)) + v = Eval(vl, vr, xl, xr, X2(xl, xr)) + w = Eval(wl, wr, xl, xr, X2(xl, xr)) + f2 = ((b - w)/ep - w*u)*ChiR(xl, xr, X2(xl, xr)) + u = Eval(ul, ur, xl, xr, X3(xl, xr)) + v = Eval(vl, vr, xl, xr, X3(xl, xr)) + w = Eval(wl, wr, xl, xr, X3(xl, xr)) + f3 = ((b - w)/ep - w*u)*ChiR(xl, xr, X3(xl, xr)) + fvec(3, ix + 1) = fvec(3, ix + 1) + Quad(f1, f2, f3, xl, xr) + + ! w -- diffusion + f1 = -dw*Eval_x(wl, wr, xl, xr)*ChiR_x(xl, xr) + fvec(3, ix + 1) = fvec(3, ix + 1) + Quad(f1, f1, f1, xl, xr) + + end if end do @@ -382,7 +382,6 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & end function ImpRhsFn ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Jac: The Jacobian function ! @@ -392,7 +391,7 @@ end function ImpRhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & - sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Jac') + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C, name='Jac') !======= Inclusions =========== use FEMBasis @@ -408,7 +407,7 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 @@ -419,29 +418,28 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & real(c_double) :: u1, u2, u3, v1, v2, v3, w1, w2, w3 real(c_double) :: df1, df2, df3, dQdf1, dQdf2, dQdf3 real(c_double) :: ChiL1, ChiL2, ChiL3, ChiR1, ChiR2, ChiR3 - real(c_double), dimension(3,-1:1) :: Ju, Jv, Jw + real(c_double), dimension(3, -1:1) :: Ju, Jv, Jw ! pointers to data in SUNDIALS vectors integer(c_int64_t), pointer, dimension(nnz) :: Jcolvals(:) - integer(c_int64_t), pointer, dimension(neq+1) :: Jrowptrs(:) - real(c_double), pointer, dimension(nnz) :: Jdata(:) - real(c_double), pointer, dimension(neqreal,N) :: yvec(:,:) - real(c_double), pointer, dimension(neqreal,N) :: fvec(:,:) - + integer(c_int64_t), pointer, dimension(neq + 1) :: Jrowptrs(:) + real(c_double), pointer, dimension(nnz) :: Jdata(:) + real(c_double), pointer, dimension(neqreal, N) :: yvec(:, :) + real(c_double), pointer, dimension(neqreal, N) :: fvec(:, :) !======= Internals ============ ! get data arrays from SUNDIALS vectors yvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_y) fvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_f) - Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) - Jcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) - Jrowptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_J) + Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) + Jcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) + Jrowptrs(1:neq + 1) => FSUNSparseMatrix_IndexPointers(sunmat_J) ! check that vector/matrix dimensions match up - if ((3*N /= neq) .or. (nnz < 27*(N-2))) then - ierr = 1 - return + if ((3*N /= neq) .or. (nnz < 27*(N - 2))) then + ierr = 1 + return end if ! set integer*4 version of N for call to idx() @@ -452,390 +450,381 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & nz = 0 ! Dirichlet boundary at left - Jrowptrs(idx(1_c_int64_t,1)+1) = nz - Jrowptrs(idx(1_c_int64_t,2)+1) = nz - Jrowptrs(idx(1_c_int64_t,3)+1) = nz + Jrowptrs(idx(1_c_int64_t, 1) + 1) = nz + Jrowptrs(idx(1_c_int64_t, 2) + 1) = nz + Jrowptrs(idx(1_c_int64_t, 3) + 1) = nz ! iterate through nodes, filling in matrix by rows - do ix=2,N-1 - - ! set nodal value shortcuts (interval index aligns with left node) - xl = x(ix-1) - ul = yvec(1,ix-1) - vl = yvec(2,ix-1) - wl = yvec(3,ix-1) - xc = x(ix) - uc = yvec(1,ix) - vc = yvec(2,ix) - wc = yvec(3,ix) - xr = x(ix+1) - ur = yvec(1,ix+1) - vr = yvec(2,ix+1) - wr = yvec(3,ix+1) - - ! compute entries of all Jacobian rows at node ix - Ju = 0.d0 - Jv = 0.d0 - Jw = 0.d0 - - ! first compute dependence on values to left and center - - ! evaluate relevant variables in left subinterval - u1 = Eval(ul, uc, xl, xc, X1(xl,xc)) - v1 = Eval(vl, vc, xl, xc, X1(xl,xc)) - w1 = Eval(wl, wc, xl, xc, X1(xl,xc)) - u2 = Eval(ul, uc, xl, xc, X2(xl,xc)) - v2 = Eval(vl, vc, xl, xc, X2(xl,xc)) - w2 = Eval(wl, wc, xl, xc, X2(xl,xc)) - u3 = Eval(ul, uc, xl, xc, X3(xl,xc)) - v3 = Eval(vl, vc, xl, xc, X3(xl,xc)) - w3 = Eval(wl, wc, xl, xc, X3(xl,xc)) - - dQdf1 = Quad(1.d0, 0.d0, 0.d0, xl, xc) - dQdf2 = Quad(0.d0, 1.d0, 0.d0, xl, xc) - dQdf3 = Quad(0.d0, 0.d0, 1.d0, xl, xc) - - ChiL1 = ChiL(xl, xc, X1(xl,xc)) - ChiL2 = ChiL(xl, xc, X2(xl,xc)) - ChiL3 = ChiL(xl, xc, X3(xl,xc)) - ChiR1 = ChiR(xl, xc, X1(xl,xc)) - ChiR2 = ChiR(xl, xc, X2(xl,xc)) - ChiR3 = ChiR(xl, xc, X3(xl,xc)) - - ! compute diffusion Jacobian components - - ! L_u = -du * u_x * ChiR_x - ! dL_u/dul - Ju(1,-1) = (-du) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) - ! dL_u/duc - Ju(1,0) = (-du) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) - - ! L_v = -dv * v_x * ChiR_x - ! dL_v/dvl - Jv(2,-1) = (-dv) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) - ! dL_v/dvc - Jv(2,0) = (-dv) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) - - ! L_w = -dw * w_x * ChiR_x - ! dL_w/dwl - Jw(3,-1) = (-dw) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiL_x(xl,xc) * ChiR_x(xl,xc) - ! dL_w/dwc - Jw(3,0) = (-dw) * Quad(1.d0,1.d0,1.d0,xl,xc) * ChiR_x(xl,xc) * ChiR_x(xl,xc) - - - ! compute reaction Jacobian components - - ! R_u = (a - (w+1.d0)*u + v*u*u) - ! dR_u/dul - df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiR1 - df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiR2 - df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiR3 - Ju(1,-1) = Ju(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/duc - df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiR1 * ChiR1 - df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiR2 * ChiR2 - df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiR3 * ChiR3 - Ju(1,0) = Ju(1,0)+ dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dvl - df1 = (u1*u1) * ChiL1 * ChiR1 - df2 = (u2*u2) * ChiL2 * ChiR2 - df3 = (u3*u3) * ChiL3 * ChiR3 - Ju(2,-1) = Ju(2,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dvc - df1 = (u1*u1) * ChiR1 * ChiR1 - df2 = (u2*u2) * ChiR2 * ChiR2 - df3 = (u3*u3) * ChiR3 * ChiR3 - Ju(2,0) = Ju(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dwl - df1 = (-u1) * ChiL1 * ChiR1 - df2 = (-u2) * ChiL2 * ChiR2 - df3 = (-u3) * ChiL3 * ChiR3 - Ju(3,-1) = Ju(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dwc - df1 = (-u1) * ChiR1 * ChiR1 - df2 = (-u2) * ChiR2 * ChiR2 - df3 = (-u3) * ChiR3 * ChiR3 - Ju(3,0) = Ju(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! R_v = (w*u - v*u*u) - ! dR_v/dul - df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiR1 - df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiR2 - df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiR3 - Jv(1,-1) = Jv(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/duc - df1 = (w1 - 2.d0*v1*u1) * ChiR1 * ChiR1 - df2 = (w2 - 2.d0*v2*u2) * ChiR2 * ChiR2 - df3 = (w3 - 2.d0*v3*u3) * ChiR3 * ChiR3 - Jv(1,0) = Jv(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dvl - df1 = (-u1*u1) * ChiL1 * ChiR1 - df2 = (-u2*u2) * ChiL2 * ChiR2 - df3 = (-u3*u3) * ChiL3 * ChiR3 - Jv(2,-1) = Jv(2,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dvc - df1 = (-u1*u1) * ChiR1 * ChiR1 - df2 = (-u2*u2) * ChiR2 * ChiR2 - df3 = (-u3*u3) * ChiR3 * ChiR3 - Jv(2,0) = Jv(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dwl - df1 = (u1) * ChiL1 * ChiR1 - df2 = (u2) * ChiL2 * ChiR2 - df3 = (u3) * ChiL3 * ChiR3 - Jv(3,-1) = Jv(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dwc - df1 = (u1) * ChiR1 * ChiR1 - df2 = (u2) * ChiR2 * ChiR2 - df3 = (u3) * ChiR3 * ChiR3 - Jv(3,0) = Jv(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! R_w = ((b-w)/ep - w*u) - ! dR_w/dul - df1 = (-w1) * ChiL1 * ChiR1 - df2 = (-w2) * ChiL2 * ChiR2 - df3 = (-w3) * ChiL3 * ChiR3 - Jw(1,-1) = Jw(1,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/duc - df1 = (-w1) * ChiR1 * ChiR1 - df2 = (-w2) * ChiR2 * ChiR2 - df3 = (-w3) * ChiR3 * ChiR3 - Jw(1,0) = Jw(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/dwl - df1 = (-1.d0/ep - u1) * ChiL1 * ChiR1 - df2 = (-1.d0/ep - u2) * ChiL2 * ChiR2 - df3 = (-1.d0/ep - u3) * ChiL3 * ChiR3 - Jw(3,-1) = Jw(3,-1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/dwc - df1 = (-1.d0/ep - u1) * ChiR1 * ChiR1 - df2 = (-1.d0/ep - u2) * ChiR2 * ChiR2 - df3 = (-1.d0/ep - u3) * ChiR3 * ChiR3 - Jw(3,0) = Jw(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! second compute dependence on values to center and right - - ! evaluate relevant variables in right subinterval - u1 = Eval(uc, ur, xc, xr, X1(xc,xr)) - v1 = Eval(vc, vr, xc, xr, X1(xc,xr)) - w1 = Eval(wc, wr, xc, xr, X1(xc,xr)) - u2 = Eval(uc, ur, xc, xr, X2(xc,xr)) - v2 = Eval(vc, vr, xc, xr, X2(xc,xr)) - w2 = Eval(wc, wr, xc, xr, X2(xc,xr)) - u3 = Eval(uc, ur, xc, xr, X3(xc,xr)) - v3 = Eval(vc, vr, xc, xr, X3(xc,xr)) - w3 = Eval(wc, wr, xc, xr, X3(xc,xr)) - - dQdf1 = Quad(1.d0, 0.d0, 0.d0, xc, xr) - dQdf2 = Quad(0.d0, 1.d0, 0.d0, xc, xr) - dQdf3 = Quad(0.d0, 0.d0, 1.d0, xc, xr) - - ChiL1 = ChiL(xc, xr, X1(xc,xr)) - ChiL2 = ChiL(xc, xr, X2(xc,xr)) - ChiL3 = ChiL(xc, xr, X3(xc,xr)) - ChiR1 = ChiR(xc, xr, X1(xc,xr)) - ChiR2 = ChiR(xc, xr, X2(xc,xr)) - ChiR3 = ChiR(xc, xr, X3(xc,xr)) - - - ! compute diffusion Jacobian components - - ! L_u = -du * u_x * ChiL_x - ! dL_u/duc - Ju(1,0) = Ju(1,0) + (-du) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) - - ! dL_u/dur - Ju(1,1) = Ju(1,1) + (-du) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) - - ! L_v = -dv * v_x * ChiL_x - ! dL_v/dvc - Jv(2,0) = Jv(2,0) + (-dv) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) - - ! dL_v/dvr - Jv(2,1) = Jv(2,1) + (-dv) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) - - ! L_w = -dw * w_x * ChiL_x - ! dL_w/dwc - Jw(3,0) = Jw(3,0) + (-dw) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiL_x(xc,xr) - - ! dL_w/dwr - Jw(3,1) = Jw(3,1) + (-dw) * Quad(1.d0,1.d0,1.d0,xc,xr) * ChiL_x(xc,xr) * ChiR_x(xc,xr) - - - ! compute reaction Jacobian components - - ! R_u = (a - (w+1.d0)*u + v*u*u) - ! dR_u/duc - df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiL1 - df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiL2 - df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiL3 - Ju(1,0) = Ju(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dur - df1 = (-(w1+1.d0) + 2.d0*v1*u1) * ChiL1 * ChiR1 - df2 = (-(w2+1.d0) + 2.d0*v2*u2) * ChiL2 * ChiR2 - df3 = (-(w3+1.d0) + 2.d0*v3*u3) * ChiL3 * ChiR3 - Ju(1,1) = Ju(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dvc - df1 = (u1*u1) * ChiL1 * ChiL1 - df2 = (u2*u2) * ChiL2 * ChiL2 - df3 = (u3*u3) * ChiL3 * ChiL3 - Ju(2,0) = Ju(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dvr - df1 = (u1*u1) * ChiL1 * ChiR1 - df2 = (u2*u2) * ChiL2 * ChiR2 - df3 = (u3*u3) * ChiL3 * ChiR3 - Ju(2,1) = Ju(2,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dwc - df1 = (-u1) * ChiL1 * ChiL1 - df2 = (-u2) * ChiL2 * ChiL2 - df3 = (-u3) * ChiL3 * ChiL3 - Ju(3,0) = Ju(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_u/dwr - df1 = (-u1) * ChiL1 * ChiR1 - df2 = (-u2) * ChiL2 * ChiR2 - df3 = (-u3) * ChiL3 * ChiR3 - Ju(3,1) = Ju(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! R_v = (w*u - v*u*u) - ! dR_v/duc - df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiL1 - df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiL2 - df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiL3 - Jv(1,0) = Jv(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dur - df1 = (w1 - 2.d0*v1*u1) * ChiL1 * ChiR1 - df2 = (w2 - 2.d0*v2*u2) * ChiL2 * ChiR2 - df3 = (w3 - 2.d0*v3*u3) * ChiL3 * ChiR3 - Jv(1,1) = Jv(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dvc - df1 = (-u1*u1) * ChiL1 * ChiL1 - df2 = (-u2*u2) * ChiL2 * ChiL2 - df3 = (-u3*u3) * ChiL3 * ChiL3 - Jv(2,0) = Jv(2,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dvr - df1 = (-u1*u1) * ChiL1 * ChiR1 - df2 = (-u2*u2) * ChiL2 * ChiR2 - df3 = (-u3*u3) * ChiL3 * ChiR3 - Jv(2,1) = Jv(2,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dwc - df1 = (u1) * ChiL1 * ChiL1 - df2 = (u2) * ChiL2 * ChiL2 - df3 = (u3) * ChiL3 * ChiL3 - Jv(3,0) = Jv(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_v/dwr - df1 = (u1) * ChiL1 * ChiR1 - df2 = (u2) * ChiL2 * ChiR2 - df3 = (u3) * ChiL3 * ChiR3 - Jv(3,1) = Jv(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! R_w = ((b-w)/ep - w*u) - ! dR_w/duc - df1 = (-w1) * ChiL1 * ChiL1 - df2 = (-w2) * ChiL2 * ChiL2 - df3 = (-w3) * ChiL3 * ChiL3 - Jw(1,0) = Jw(1,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/dur - df1 = (-w1) * ChiL1 * ChiR1 - df2 = (-w2) * ChiL2 * ChiR2 - df3 = (-w3) * ChiL3 * ChiR3 - Jw(1,1) = Jw(1,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/dwc - df1 = (-1.d0/ep - u1) * ChiL1 * ChiL1 - df2 = (-1.d0/ep - u2) * ChiL2 * ChiL2 - df3 = (-1.d0/ep - u3) * ChiL3 * ChiL3 - Jw(3,0) = Jw(3,0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - ! dR_w/dwr - df1 = (-1.d0/ep - u1) * ChiL1 * ChiR1 - df2 = (-1.d0/ep - u2) * ChiL2 * ChiR2 - df3 = (-1.d0/ep - u3) * ChiL3 * ChiR3 - Jw(3,1) = Jw(3,1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 - - - ! insert Jacobian entries into CSR matrix structure - - ! Ju row - Jrowptrs(idx(ix,1)+1) = nz - - Jdata(nz+1:nz+3) = (/ Ju(1,-1), Ju(2,-1), Ju(3,-1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Ju(1,0), Ju(2,0), Ju(3,0) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Ju(1,1), Ju(2,1), Ju(3,1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) - nz = nz+3 - - ! Jv row - Jrowptrs(idx(ix,2)+1) = nz - - Jdata(nz+1:nz+3) = (/ Jv(1,-1), Jv(2,-1), Jv(3,-1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Jv(1,0), Jv(2,0), Jv(3,0) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Jv(1,1), Jv(2,1), Jv(3,1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) - nz = nz+3 - - ! Jw row - Jrowptrs(idx(ix,3)+1) = nz - - Jdata(nz+1:nz+3) = (/ Jw(1,-1), Jw(2,-1), Jw(3,-1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix-1,1), idx(ix-1,2), idx(ix-1,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Jw(1,0), Jw(2,0), Jw(3,0) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix,1), idx(ix,2), idx(ix,3) /) - nz = nz+3 - - Jdata(nz+1:nz+3) = (/ Jw(1,1), Jw(2,1), Jw(3,1) /) - Jcolvals(nz+1:nz+3) = (/ idx(ix+1,1), idx(ix+1,2), idx(ix+1,3) /) - nz = nz+3 + do ix = 2, N - 1 + + ! set nodal value shortcuts (interval index aligns with left node) + xl = x(ix - 1) + ul = yvec(1, ix - 1) + vl = yvec(2, ix - 1) + wl = yvec(3, ix - 1) + xc = x(ix) + uc = yvec(1, ix) + vc = yvec(2, ix) + wc = yvec(3, ix) + xr = x(ix + 1) + ur = yvec(1, ix + 1) + vr = yvec(2, ix + 1) + wr = yvec(3, ix + 1) + + ! compute entries of all Jacobian rows at node ix + Ju = 0.d0 + Jv = 0.d0 + Jw = 0.d0 + + ! first compute dependence on values to left and center + + ! evaluate relevant variables in left subinterval + u1 = Eval(ul, uc, xl, xc, X1(xl, xc)) + v1 = Eval(vl, vc, xl, xc, X1(xl, xc)) + w1 = Eval(wl, wc, xl, xc, X1(xl, xc)) + u2 = Eval(ul, uc, xl, xc, X2(xl, xc)) + v2 = Eval(vl, vc, xl, xc, X2(xl, xc)) + w2 = Eval(wl, wc, xl, xc, X2(xl, xc)) + u3 = Eval(ul, uc, xl, xc, X3(xl, xc)) + v3 = Eval(vl, vc, xl, xc, X3(xl, xc)) + w3 = Eval(wl, wc, xl, xc, X3(xl, xc)) + + dQdf1 = Quad(1.d0, 0.d0, 0.d0, xl, xc) + dQdf2 = Quad(0.d0, 1.d0, 0.d0, xl, xc) + dQdf3 = Quad(0.d0, 0.d0, 1.d0, xl, xc) + + ChiL1 = ChiL(xl, xc, X1(xl, xc)) + ChiL2 = ChiL(xl, xc, X2(xl, xc)) + ChiL3 = ChiL(xl, xc, X3(xl, xc)) + ChiR1 = ChiR(xl, xc, X1(xl, xc)) + ChiR2 = ChiR(xl, xc, X2(xl, xc)) + ChiR3 = ChiR(xl, xc, X3(xl, xc)) + + ! compute diffusion Jacobian components + + ! L_u = -du * u_x * ChiR_x + ! dL_u/dul + Ju(1, -1) = (-du)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiL_x(xl, xc)*ChiR_x(xl, xc) + ! dL_u/duc + Ju(1, 0) = (-du)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiR_x(xl, xc)*ChiR_x(xl, xc) + + ! L_v = -dv * v_x * ChiR_x + ! dL_v/dvl + Jv(2, -1) = (-dv)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiL_x(xl, xc)*ChiR_x(xl, xc) + ! dL_v/dvc + Jv(2, 0) = (-dv)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiR_x(xl, xc)*ChiR_x(xl, xc) + + ! L_w = -dw * w_x * ChiR_x + ! dL_w/dwl + Jw(3, -1) = (-dw)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiL_x(xl, xc)*ChiR_x(xl, xc) + ! dL_w/dwc + Jw(3, 0) = (-dw)*Quad(1.d0, 1.d0, 1.d0, xl, xc)*ChiR_x(xl, xc)*ChiR_x(xl, xc) + + ! compute reaction Jacobian components + + ! R_u = (a - (w+1.d0)*u + v*u*u) + ! dR_u/dul + df1 = (-(w1 + 1.d0) + 2.d0*v1*u1)*ChiL1*ChiR1 + df2 = (-(w2 + 1.d0) + 2.d0*v2*u2)*ChiL2*ChiR2 + df3 = (-(w3 + 1.d0) + 2.d0*v3*u3)*ChiL3*ChiR3 + Ju(1, -1) = Ju(1, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/duc + df1 = (-(w1 + 1.d0) + 2.d0*v1*u1)*ChiR1*ChiR1 + df2 = (-(w2 + 1.d0) + 2.d0*v2*u2)*ChiR2*ChiR2 + df3 = (-(w3 + 1.d0) + 2.d0*v3*u3)*ChiR3*ChiR3 + Ju(1, 0) = Ju(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvl + df1 = (u1*u1)*ChiL1*ChiR1 + df2 = (u2*u2)*ChiL2*ChiR2 + df3 = (u3*u3)*ChiL3*ChiR3 + Ju(2, -1) = Ju(2, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvc + df1 = (u1*u1)*ChiR1*ChiR1 + df2 = (u2*u2)*ChiR2*ChiR2 + df3 = (u3*u3)*ChiR3*ChiR3 + Ju(2, 0) = Ju(2, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwl + df1 = (-u1)*ChiL1*ChiR1 + df2 = (-u2)*ChiL2*ChiR2 + df3 = (-u3)*ChiL3*ChiR3 + Ju(3, -1) = Ju(3, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwc + df1 = (-u1)*ChiR1*ChiR1 + df2 = (-u2)*ChiR2*ChiR2 + df3 = (-u3)*ChiR3*ChiR3 + Ju(3, 0) = Ju(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! R_v = (w*u - v*u*u) + ! dR_v/dul + df1 = (w1 - 2.d0*v1*u1)*ChiL1*ChiR1 + df2 = (w2 - 2.d0*v2*u2)*ChiL2*ChiR2 + df3 = (w3 - 2.d0*v3*u3)*ChiL3*ChiR3 + Jv(1, -1) = Jv(1, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/duc + df1 = (w1 - 2.d0*v1*u1)*ChiR1*ChiR1 + df2 = (w2 - 2.d0*v2*u2)*ChiR2*ChiR2 + df3 = (w3 - 2.d0*v3*u3)*ChiR3*ChiR3 + Jv(1, 0) = Jv(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvl + df1 = (-u1*u1)*ChiL1*ChiR1 + df2 = (-u2*u2)*ChiL2*ChiR2 + df3 = (-u3*u3)*ChiL3*ChiR3 + Jv(2, -1) = Jv(2, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvc + df1 = (-u1*u1)*ChiR1*ChiR1 + df2 = (-u2*u2)*ChiR2*ChiR2 + df3 = (-u3*u3)*ChiR3*ChiR3 + Jv(2, 0) = Jv(2, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwl + df1 = (u1)*ChiL1*ChiR1 + df2 = (u2)*ChiL2*ChiR2 + df3 = (u3)*ChiL3*ChiR3 + Jv(3, -1) = Jv(3, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwc + df1 = (u1)*ChiR1*ChiR1 + df2 = (u2)*ChiR2*ChiR2 + df3 = (u3)*ChiR3*ChiR3 + Jv(3, 0) = Jv(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! R_w = ((b-w)/ep - w*u) + ! dR_w/dul + df1 = (-w1)*ChiL1*ChiR1 + df2 = (-w2)*ChiL2*ChiR2 + df3 = (-w3)*ChiL3*ChiR3 + Jw(1, -1) = Jw(1, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/duc + df1 = (-w1)*ChiR1*ChiR1 + df2 = (-w2)*ChiR2*ChiR2 + df3 = (-w3)*ChiR3*ChiR3 + Jw(1, 0) = Jw(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwl + df1 = (-1.d0/ep - u1)*ChiL1*ChiR1 + df2 = (-1.d0/ep - u2)*ChiL2*ChiR2 + df3 = (-1.d0/ep - u3)*ChiL3*ChiR3 + Jw(3, -1) = Jw(3, -1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwc + df1 = (-1.d0/ep - u1)*ChiR1*ChiR1 + df2 = (-1.d0/ep - u2)*ChiR2*ChiR2 + df3 = (-1.d0/ep - u3)*ChiR3*ChiR3 + Jw(3, 0) = Jw(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! second compute dependence on values to center and right + + ! evaluate relevant variables in right subinterval + u1 = Eval(uc, ur, xc, xr, X1(xc, xr)) + v1 = Eval(vc, vr, xc, xr, X1(xc, xr)) + w1 = Eval(wc, wr, xc, xr, X1(xc, xr)) + u2 = Eval(uc, ur, xc, xr, X2(xc, xr)) + v2 = Eval(vc, vr, xc, xr, X2(xc, xr)) + w2 = Eval(wc, wr, xc, xr, X2(xc, xr)) + u3 = Eval(uc, ur, xc, xr, X3(xc, xr)) + v3 = Eval(vc, vr, xc, xr, X3(xc, xr)) + w3 = Eval(wc, wr, xc, xr, X3(xc, xr)) + + dQdf1 = Quad(1.d0, 0.d0, 0.d0, xc, xr) + dQdf2 = Quad(0.d0, 1.d0, 0.d0, xc, xr) + dQdf3 = Quad(0.d0, 0.d0, 1.d0, xc, xr) + + ChiL1 = ChiL(xc, xr, X1(xc, xr)) + ChiL2 = ChiL(xc, xr, X2(xc, xr)) + ChiL3 = ChiL(xc, xr, X3(xc, xr)) + ChiR1 = ChiR(xc, xr, X1(xc, xr)) + ChiR2 = ChiR(xc, xr, X2(xc, xr)) + ChiR3 = ChiR(xc, xr, X3(xc, xr)) + + ! compute diffusion Jacobian components + + ! L_u = -du * u_x * ChiL_x + ! dL_u/duc + Ju(1, 0) = Ju(1, 0) + (-du)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiL_x(xc, xr) + + ! dL_u/dur + Ju(1, 1) = Ju(1, 1) + (-du)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiR_x(xc, xr) + + ! L_v = -dv * v_x * ChiL_x + ! dL_v/dvc + Jv(2, 0) = Jv(2, 0) + (-dv)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiL_x(xc, xr) + + ! dL_v/dvr + Jv(2, 1) = Jv(2, 1) + (-dv)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiR_x(xc, xr) + + ! L_w = -dw * w_x * ChiL_x + ! dL_w/dwc + Jw(3, 0) = Jw(3, 0) + (-dw)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiL_x(xc, xr) + + ! dL_w/dwr + Jw(3, 1) = Jw(3, 1) + (-dw)*Quad(1.d0, 1.d0, 1.d0, xc, xr)*ChiL_x(xc, xr)*ChiR_x(xc, xr) + + ! compute reaction Jacobian components + + ! R_u = (a - (w+1.d0)*u + v*u*u) + ! dR_u/duc + df1 = (-(w1 + 1.d0) + 2.d0*v1*u1)*ChiL1*ChiL1 + df2 = (-(w2 + 1.d0) + 2.d0*v2*u2)*ChiL2*ChiL2 + df3 = (-(w3 + 1.d0) + 2.d0*v3*u3)*ChiL3*ChiL3 + Ju(1, 0) = Ju(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dur + df1 = (-(w1 + 1.d0) + 2.d0*v1*u1)*ChiL1*ChiR1 + df2 = (-(w2 + 1.d0) + 2.d0*v2*u2)*ChiL2*ChiR2 + df3 = (-(w3 + 1.d0) + 2.d0*v3*u3)*ChiL3*ChiR3 + Ju(1, 1) = Ju(1, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvc + df1 = (u1*u1)*ChiL1*ChiL1 + df2 = (u2*u2)*ChiL2*ChiL2 + df3 = (u3*u3)*ChiL3*ChiL3 + Ju(2, 0) = Ju(2, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dvr + df1 = (u1*u1)*ChiL1*ChiR1 + df2 = (u2*u2)*ChiL2*ChiR2 + df3 = (u3*u3)*ChiL3*ChiR3 + Ju(2, 1) = Ju(2, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwc + df1 = (-u1)*ChiL1*ChiL1 + df2 = (-u2)*ChiL2*ChiL2 + df3 = (-u3)*ChiL3*ChiL3 + Ju(3, 0) = Ju(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_u/dwr + df1 = (-u1)*ChiL1*ChiR1 + df2 = (-u2)*ChiL2*ChiR2 + df3 = (-u3)*ChiL3*ChiR3 + Ju(3, 1) = Ju(3, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! R_v = (w*u - v*u*u) + ! dR_v/duc + df1 = (w1 - 2.d0*v1*u1)*ChiL1*ChiL1 + df2 = (w2 - 2.d0*v2*u2)*ChiL2*ChiL2 + df3 = (w3 - 2.d0*v3*u3)*ChiL3*ChiL3 + Jv(1, 0) = Jv(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dur + df1 = (w1 - 2.d0*v1*u1)*ChiL1*ChiR1 + df2 = (w2 - 2.d0*v2*u2)*ChiL2*ChiR2 + df3 = (w3 - 2.d0*v3*u3)*ChiL3*ChiR3 + Jv(1, 1) = Jv(1, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvc + df1 = (-u1*u1)*ChiL1*ChiL1 + df2 = (-u2*u2)*ChiL2*ChiL2 + df3 = (-u3*u3)*ChiL3*ChiL3 + Jv(2, 0) = Jv(2, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dvr + df1 = (-u1*u1)*ChiL1*ChiR1 + df2 = (-u2*u2)*ChiL2*ChiR2 + df3 = (-u3*u3)*ChiL3*ChiR3 + Jv(2, 1) = Jv(2, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwc + df1 = (u1)*ChiL1*ChiL1 + df2 = (u2)*ChiL2*ChiL2 + df3 = (u3)*ChiL3*ChiL3 + Jv(3, 0) = Jv(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_v/dwr + df1 = (u1)*ChiL1*ChiR1 + df2 = (u2)*ChiL2*ChiR2 + df3 = (u3)*ChiL3*ChiR3 + Jv(3, 1) = Jv(3, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! R_w = ((b-w)/ep - w*u) + ! dR_w/duc + df1 = (-w1)*ChiL1*ChiL1 + df2 = (-w2)*ChiL2*ChiL2 + df3 = (-w3)*ChiL3*ChiL3 + Jw(1, 0) = Jw(1, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dur + df1 = (-w1)*ChiL1*ChiR1 + df2 = (-w2)*ChiL2*ChiR2 + df3 = (-w3)*ChiL3*ChiR3 + Jw(1, 1) = Jw(1, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwc + df1 = (-1.d0/ep - u1)*ChiL1*ChiL1 + df2 = (-1.d0/ep - u2)*ChiL2*ChiL2 + df3 = (-1.d0/ep - u3)*ChiL3*ChiL3 + Jw(3, 0) = Jw(3, 0) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! dR_w/dwr + df1 = (-1.d0/ep - u1)*ChiL1*ChiR1 + df2 = (-1.d0/ep - u2)*ChiL2*ChiR2 + df3 = (-1.d0/ep - u3)*ChiL3*ChiR3 + Jw(3, 1) = Jw(3, 1) + dQdf1*df1 + dQdf2*df2 + dQdf3*df3 + + ! insert Jacobian entries into CSR matrix structure + + ! Ju row + Jrowptrs(idx(ix, 1) + 1) = nz + + Jdata(nz + 1:nz + 3) = (/Ju(1, -1), Ju(2, -1), Ju(3, -1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix - 1, 1), idx(ix - 1, 2), idx(ix - 1, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Ju(1, 0), Ju(2, 0), Ju(3, 0)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix, 1), idx(ix, 2), idx(ix, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Ju(1, 1), Ju(2, 1), Ju(3, 1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix + 1, 1), idx(ix + 1, 2), idx(ix + 1, 3)/) + nz = nz + 3 + + ! Jv row + Jrowptrs(idx(ix, 2) + 1) = nz + + Jdata(nz + 1:nz + 3) = (/Jv(1, -1), Jv(2, -1), Jv(3, -1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix - 1, 1), idx(ix - 1, 2), idx(ix - 1, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Jv(1, 0), Jv(2, 0), Jv(3, 0)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix, 1), idx(ix, 2), idx(ix, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Jv(1, 1), Jv(2, 1), Jv(3, 1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix + 1, 1), idx(ix + 1, 2), idx(ix + 1, 3)/) + nz = nz + 3 + + ! Jw row + Jrowptrs(idx(ix, 3) + 1) = nz + + Jdata(nz + 1:nz + 3) = (/Jw(1, -1), Jw(2, -1), Jw(3, -1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix - 1, 1), idx(ix - 1, 2), idx(ix - 1, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Jw(1, 0), Jw(2, 0), Jw(3, 0)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix, 1), idx(ix, 2), idx(ix, 3)/) + nz = nz + 3 + + Jdata(nz + 1:nz + 3) = (/Jw(1, 1), Jw(2, 1), Jw(3, 1)/) + Jcolvals(nz + 1:nz + 3) = (/idx(ix + 1, 1), idx(ix + 1, 2), idx(ix + 1, 3)/) + nz = nz + 3 end do ! Dirichlet boundary at right - Jrowptrs(idx(Nint,1)+1) = nz - Jrowptrs(idx(Nint,2)+1) = nz - Jrowptrs(idx(Nint,3)+1) = nz + Jrowptrs(idx(Nint, 1) + 1) = nz + Jrowptrs(idx(Nint, 2) + 1) = nz + Jrowptrs(idx(Nint, 3) + 1) = nz ! signal end of data in CSR matrix - Jrowptrs(idx(Nint,3)+2) = nz + Jrowptrs(idx(Nint, 3) + 2) = nz ! return success ierr = 0 @@ -844,12 +833,11 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & end function Jac ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Mass matrix computation routine ! ---------------------------------------------------------------- integer(c_int) function Mass(tn, sunmat_M, user_data, & - sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Mass') + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C, name='Mass') !======= Inclusions =========== use FEMBasis @@ -863,7 +851,7 @@ integer(c_int) function Mass(tn, sunmat_M, user_data, & ! calling variables real(c_double), value :: tn ! current time type(SUNMatrix) :: sunmat_M ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 @@ -875,19 +863,19 @@ integer(c_int) function Mass(tn, sunmat_M, user_data, & ! pointers to data in SUNDIALS vectors integer(c_int64_t), pointer, dimension(nnz) :: Mcolvals(:) - integer(c_int64_t), pointer, dimension(neq+1) :: Mrowptrs(:) - real(c_double), pointer, dimension(nnz) :: Mdata(:) + integer(c_int64_t), pointer, dimension(neq + 1) :: Mrowptrs(:) + real(c_double), pointer, dimension(nnz) :: Mdata(:) !======= Internals ============ ! get data arrays from SUNDIALS vectors - Mdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_M) - Mcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_M) - Mrowptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_M) + Mdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_M) + Mcolvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_M) + Mrowptrs(1:neq + 1) => FSUNSparseMatrix_IndexPointers(sunmat_M) ! check that vector/matrix dimensions match up if ((3*N /= neq) .or. (nnz /= 15*neq)) then - ierr = 1 - return + ierr = 1 + return end if ! set integer*4 version of N for call to idx() @@ -898,113 +886,112 @@ integer(c_int) function Mass(tn, sunmat_M, user_data, & nz = 0 ! iterate through nodes, filling in matrix by rows - do ix=1,N - - ! set booleans to determine whether intervals exist on the left/right */ - left = .true. - right = .true. - if (ix==1) left = .false. - if (ix==N) right = .false. - - ! set nodal value shortcuts (interval index aligns with left node) - if (left) then - xl = x(ix-1) - end if - xc = x(ix) - if (right) then - xr = x(ix+1) - end if - - ! compute entries of all mass matrix rows at node ix - Ml = 0.d0 - Mc = 0.d0 - Mr = 0.d0 - - ! first compute dependence on values to left and center - if (left) then - - ChiL1 = ChiL(xl, xc, X1(xl,xc)) - ChiL2 = ChiL(xl, xc, X2(xl,xc)) - ChiL3 = ChiL(xl, xc, X3(xl,xc)) - ChiR1 = ChiR(xl, xc, X1(xl,xc)) - ChiR2 = ChiR(xl, xc, X2(xl,xc)) - ChiR3 = ChiR(xl, xc, X3(xl,xc)) - - Ml = Ml + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xl, xc) - Mc = Mc + Quad(ChiR1*ChiR1, ChiR2*ChiR2, ChiR3*ChiR3, xl, xc) - - end if - - ! second compute dependence on values to center and right - if (right) then - - ChiL1 = ChiL(xc, xr, X1(xc,xr)) - ChiL2 = ChiL(xc, xr, X2(xc,xr)) - ChiL3 = ChiL(xc, xr, X3(xc,xr)) - ChiR1 = ChiR(xc, xr, X1(xc,xr)) - ChiR2 = ChiR(xc, xr, X2(xc,xr)) - ChiR3 = ChiR(xc, xr, X3(xc,xr)) - - Mc = Mc + Quad(ChiL1*ChiL1, ChiL2*ChiL2, ChiL3*ChiL3, xc, xr) - Mr = Mr + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xc, xr) - - end if - - - ! insert mass matrix entries into CSR matrix structure - - ! u row - Mrowptrs(idx(ix,1)+1) = nz - if (left) then - nz = nz+1 - Mdata(nz) = Ml - Mcolvals(nz) = idx(ix-1,1) - end if - nz = nz+1 - Mdata(nz) = Mc - Mcolvals(nz) = idx(ix,1) - if (right) then - nz = nz+1 - Mdata(nz) = Mr - Mcolvals(nz) = idx(ix+1,1) - end if - - ! v row - Mrowptrs(idx(ix,2)+1) = nz - if (left) then - nz = nz+1 - Mdata(nz) = Ml - Mcolvals(nz) = idx(ix-1,2) - end if - nz = nz+1 - Mdata(nz) = Mc - Mcolvals(nz) = idx(ix,2) - if (right) then - nz = nz+1 - Mdata(nz) = Mr - Mcolvals(nz) = idx(ix+1,2) - end if - - ! w row - Mrowptrs(idx(ix,3)+1) = nz - if (left) then - nz = nz+1 - Mdata(nz) = Ml - Mcolvals(nz) = idx(ix-1,3) - end if - nz = nz+1 - Mdata(nz) = Mc - Mcolvals(nz) = idx(ix,3) - if (right) then - nz = nz+1 - Mdata(nz) = Mr - Mcolvals(nz) = idx(ix+1,3) - end if + do ix = 1, N + + ! set booleans to determine whether intervals exist on the left/right */ + left = .true. + right = .true. + if (ix == 1) left = .false. + if (ix == N) right = .false. + + ! set nodal value shortcuts (interval index aligns with left node) + if (left) then + xl = x(ix - 1) + end if + xc = x(ix) + if (right) then + xr = x(ix + 1) + end if + + ! compute entries of all mass matrix rows at node ix + Ml = 0.d0 + Mc = 0.d0 + Mr = 0.d0 + + ! first compute dependence on values to left and center + if (left) then + + ChiL1 = ChiL(xl, xc, X1(xl, xc)) + ChiL2 = ChiL(xl, xc, X2(xl, xc)) + ChiL3 = ChiL(xl, xc, X3(xl, xc)) + ChiR1 = ChiR(xl, xc, X1(xl, xc)) + ChiR2 = ChiR(xl, xc, X2(xl, xc)) + ChiR3 = ChiR(xl, xc, X3(xl, xc)) + + Ml = Ml + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xl, xc) + Mc = Mc + Quad(ChiR1*ChiR1, ChiR2*ChiR2, ChiR3*ChiR3, xl, xc) + + end if + + ! second compute dependence on values to center and right + if (right) then + + ChiL1 = ChiL(xc, xr, X1(xc, xr)) + ChiL2 = ChiL(xc, xr, X2(xc, xr)) + ChiL3 = ChiL(xc, xr, X3(xc, xr)) + ChiR1 = ChiR(xc, xr, X1(xc, xr)) + ChiR2 = ChiR(xc, xr, X2(xc, xr)) + ChiR3 = ChiR(xc, xr, X3(xc, xr)) + + Mc = Mc + Quad(ChiL1*ChiL1, ChiL2*ChiL2, ChiL3*ChiL3, xc, xr) + Mr = Mr + Quad(ChiL1*ChiR1, ChiL2*ChiR2, ChiL3*ChiR3, xc, xr) + + end if + + ! insert mass matrix entries into CSR matrix structure + + ! u row + Mrowptrs(idx(ix, 1) + 1) = nz + if (left) then + nz = nz + 1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix - 1, 1) + end if + nz = nz + 1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix, 1) + if (right) then + nz = nz + 1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix + 1, 1) + end if + + ! v row + Mrowptrs(idx(ix, 2) + 1) = nz + if (left) then + nz = nz + 1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix - 1, 2) + end if + nz = nz + 1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix, 2) + if (right) then + nz = nz + 1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix + 1, 2) + end if + + ! w row + Mrowptrs(idx(ix, 3) + 1) = nz + if (left) then + nz = nz + 1 + Mdata(nz) = Ml + Mcolvals(nz) = idx(ix - 1, 3) + end if + nz = nz + 1 + Mdata(nz) = Mc + Mcolvals(nz) = idx(ix, 3) + if (right) then + nz = nz + 1 + Mdata(nz) = Mr + Mcolvals(nz) = idx(ix + 1, 3) + end if end do ! signal end of data in CSR matrix - Mrowptrs(idx(Nint,3)+2) = nz + Mrowptrs(idx(Nint, 3) + 2) = nz ! return success ierr = 0 @@ -1016,7 +1003,6 @@ end function Mass end module bruss1D_ode_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -1053,20 +1039,20 @@ program main integer(c_long) :: mxsteps ! max num steps integer(c_int64_t) :: i - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(N_Vector), pointer :: sunvec_u ! sundials vector - type(N_Vector), pointer :: sunvec_v ! sundials vector - type(N_Vector), pointer :: sunvec_w ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials (linsol) matrix - type(SUNMatrix), pointer :: sunmat_M ! sundials (mass) matrix + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_v ! sundials vector + type(N_Vector), pointer :: sunvec_w ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials (linsol) matrix + type(SUNMatrix), pointer :: sunmat_M ! sundials (mass) matrix type(SUNLinearSolver), pointer :: sunls_A ! sundials linear solver type(SUNLinearSolver), pointer :: sunls_M ! sundials linear solver type(c_ptr) :: arkode_mem ! ARKODE memory type(c_ptr) :: outstr ! standard output file stream - real(c_double), pointer, dimension(neqreal,N) :: yvec(:,:) ! underlying vector y - real(c_double), pointer, dimension(neqreal,N) :: umask(:,:) ! identifier for u - real(c_double), pointer, dimension(neqreal,N) :: vmask(:,:) ! identifier for v - real(c_double), pointer, dimension(neqreal,N) :: wmask(:,:) ! identifier for w + real(c_double), pointer, dimension(neqreal, N) :: yvec(:, :) ! underlying vector y + real(c_double), pointer, dimension(neqreal, N) :: umask(:, :) ! identifier for u + real(c_double), pointer, dimension(neqreal, N) :: vmask(:, :) ! identifier for v + real(c_double), pointer, dimension(neqreal, N) :: wmask(:, :) ! identifier for w !======= Internals ============ @@ -1075,127 +1061,127 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = (tend - tstart)/10.d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = (tend - tstart)/10.d0 + nout = ceiling(tend/dtout) ! create and assign SUNDIALS N_Vectors sunvec_y => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - yvec(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_y) + yvec(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_y) sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - umask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_u) + umask(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_u) sunvec_v => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_v)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - vmask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_v) + vmask(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_v) sunvec_w => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_w)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - wmask(1:neqreal,1:N) => FN_VGetArrayPointer(sunvec_w) + wmask(1:neqreal, 1:N) => FN_VGetArrayPointer(sunvec_w) ! set up spatial mesh; this [arbitrarily] clusters ! more intervals near the end points of the interval pi = 4.d0*atan(1.d0) h = 10.d0/(N - 1) - do i=1,N - z = -5.d0 + h*(i - 1) - x(i) = 0.5d0/atan(5.d0)*atan(z) + 0.5d0 + do i = 1, N + z = -5.d0 + h*(i - 1) + x(i) = 0.5d0/atan(5.d0)*atan(z) + 0.5d0 end do ! output mesh to disk - open(200, file='bruss_FEM_mesh.txt') - do i=1,N - write(200,*) x(i) + open (200, file='bruss_FEM_mesh.txt') + do i = 1, N + write (200, *) x(i) end do - close(200) + close (200) ! set initial conditions into yvec - do i=1,N - yvec(1,i) = a + 0.1d0*sin(pi*x(i)) ! u0 - yvec(2,i) = b/a + 0.1d0*sin(pi*x(i)) ! v0 - yvec(3,i) = b + 0.1d0*sin(pi*x(i)) ! w0 + do i = 1, N + yvec(1, i) = a + 0.1d0*sin(pi*x(i)) ! u0 + yvec(2, i) = b/a + 0.1d0*sin(pi*x(i)) ! v0 + yvec(3, i) = b + 0.1d0*sin(pi*x(i)) ! w0 end do ! set mask values for each solution component umask = 0.d0 vmask = 0.d0 wmask = 0.d0 - do i=1,N - umask(1,i) = 1.d0 - vmask(2,i) = 1.d0 - wmask(3,i) = 1.d0 + do i = 1, N + umask(1, i) = 1.d0 + vmask(2, i) = 1.d0 + wmask(3, i) = 1.d0 end do ! create ARKStep memory arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(ImpRhsFn), tstart, sunvec_y, ctx) - if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a sparse linear solver for both Newton and mass matrix systems. sparsetype = 1 sunmat_A => FSUNSparseMatrix(neq, neq, nnz, sparsetype, ctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat_A = NULL' - stop 1 + print *, 'ERROR: sunmat_A = NULL' + stop 1 end if sunmat_M => FSUNSparseMatrix(neq, neq, nnz, sparsetype, ctx) if (.not. associated(sunmat_M)) then - print *, 'ERROR: sunmat_M = NULL' - stop 1 + print *, 'ERROR: sunmat_M = NULL' + stop 1 end if sunls_A => FSUNLinSol_KLU(sunvec_y, sunmat_A, ctx) if (.not. associated(sunls_A)) then - print *, 'ERROR: sunls_A = NULL' - stop 1 + print *, 'ERROR: sunls_A = NULL' + stop 1 end if ierr = FARKodeSetLinearSolver(arkode_mem, sunls_A, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver' - stop 1 + print *, 'Error in FARKodeSetLinearSolver' + stop 1 end if ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKodeSetJacFn' - stop 1 + print *, 'Error in FARKodeSetJacFn' + stop 1 end if sunls_M => FSUNLinSol_KLU(sunvec_y, sunmat_M, ctx) if (.not. associated(sunls_M)) then - print *, 'ERROR: sunls_M = NULL' - stop 1 + print *, 'ERROR: sunls_M = NULL' + stop 1 end if time_dep = 0 ierr = FARKodeSetMassLinearSolver(arkode_mem, sunls_M, sunmat_M, time_dep) if (ierr /= 0) then - print *, 'Error in FARKodeSetMassLinearSolver' - stop 1 + print *, 'Error in FARKodeSetMassLinearSolver' + stop 1 end if ierr = FARKodeSetMassFn(arkode_mem, c_funloc(Mass)) if (ierr /= 0) then - print *, 'Error in FARKodeSetMassFn' - stop 1 + print *, 'Error in FARKodeSetMassFn' + stop 1 end if ! set relative and absolute tolerances @@ -1204,50 +1190,50 @@ program main ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! set residual tolerance with the same atol as above ierr = FARKodeResStolerance(arkode_mem, atol) if (ierr /= 0) then - print *, 'Error in FARKodeResStolerance, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeResStolerance, ierr = ', ierr, '; halting' + stop 1 end if ! Set maximum number of internal time steps mxsteps = 1000 ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKodeSetNonlinConvCoef' + stop 1 end if ! Open output stream for results - open(501, file='bruss_FEM_u.txt') - open(502, file='bruss_FEM_v.txt') - open(503, file='bruss_FEM_w.txt') + open (501, file='bruss_FEM_u.txt') + open (502, file='bruss_FEM_v.txt') + open (503, file='bruss_FEM_w.txt') ! output initial condition to disk - write(501,*) ( yvec(1,i), i=1,N ) - write(502,*) ( yvec(2,i), i=1,N ) - write(503,*) ( yvec(3,i), i=1,N ) + write (501, *) (yvec(1, i), i=1, N) + write (502, *) (yvec(2, i), i=1, N) + write (503, *) (yvec(3, i), i=1, N) ! output solver parameters to screen ierr = FSUNDIALSFileOpen('stdout', 'w', outstr) if (ierr /= 0) then - print *, 'Error in FSUNDIALSFileOpen' - stop 1 + print *, 'Error in FSUNDIALSFileOpen' + stop 1 end if ierr = FARKodeWriteParameters(arkode_mem, outstr) if (ierr /= 0) then - print *, 'Error in FARKodeWriteParameters' - stop 1 + print *, 'Error in FARKodeWriteParameters' + stop 1 end if ierr = FSUNDIALSFileClose(outstr) if (ierr /= 0) then - print *, 'Error in FSUNDIALSFileClose' - stop 1 + print *, 'Error in FSUNDIALSFileClose' + stop 1 end if ! Start time stepping @@ -1257,37 +1243,37 @@ program main print *, ' t ||u||_rms ||v||_rms ||w||_rms' print *, ' ----------------------------------------------------' print '(3x,4(es12.5,1x))', tcur, sqrt(sum(yvec*yvec*umask)/N), & - sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) - do outstep = 1,nout - - ! set the next output time - tout = min(tout + dtout, tend) - - ierr = FARKodeSetStopTime(arkode_mem, tout) - if (ierr /= 0) then - print *, 'Error in FARKodeSetStopTime, ierr = ', ierr, '; halting' - stop 1 - end if - - ! call ARKodeEvolve - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) - if (ierr < 0) then - print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' - stop 1 - end if - - ! output current solution information (using yvec) - print '(3x,4(es12.5,1x))', Tcur, sqrt(sum(yvec*yvec*umask)/N), & - sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) - write(501,*) ( yvec(1,i), i=1,N ) - write(502,*) ( yvec(2,i), i=1,N ) - write(503,*) ( yvec(3,i), i=1,N ) + sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) + do outstep = 1, nout + + ! set the next output time + tout = min(tout + dtout, tend) + + ierr = FARKodeSetStopTime(arkode_mem, tout) + if (ierr /= 0) then + print *, 'Error in FARKodeSetStopTime, ierr = ', ierr, '; halting' + stop 1 + end if + + ! call ARKodeEvolve + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr < 0) then + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ! output current solution information (using yvec) + print '(3x,4(es12.5,1x))', Tcur, sqrt(sum(yvec*yvec*umask)/N), & + sqrt(sum(yvec*yvec*vmask)/N), sqrt(sum(yvec*yvec*wmask)/N) + write (501, *) (yvec(1, i), i=1, N) + write (502, *) (yvec(2, i), i=1, N) + write (503, *) (yvec(3, i), i=1, N) end do print *, ' ----------------------------------------------------' - close(501) - close(502) - close(503) + close (501) + close (502) + close (503) ! diagnostics output call ARKStepStats(arkode_mem) @@ -1307,7 +1293,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -1347,91 +1332,91 @@ subroutine ARKStepStats(arkode_mem) ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumMassSetups(arkode_mem, nmassevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumMassSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumMassSetups, retval = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe - print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi - print '(4x,A,i9)' ,'Total jac function calls =',njacevals - print '(4x,A,i9)' ,'Total mass function calls =',nmassevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs exp function calls =', nfe + print '(4x,A,i9)', 'Total rhs imp function calls =', nfi + print '(4x,A,i9)', 'Total jac function calls =', njacevals + print '(4x,A,i9)', 'Total mass function calls =', nmassevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 index d4b5185105..2b6579cf20 100644 --- a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -60,7 +60,7 @@ module bruss_mod integer(kind=myindextype), parameter :: neq = 3 ! ODE parameters - real(c_double), parameter, dimension(neq) :: y0 = (/ 3.9d0, 1.1d0, 2.8d0 /) + real(c_double), parameter, dimension(neq) :: y0 = (/3.9d0, 1.1d0, 2.8d0/) real(c_double), parameter :: a = 1.2d0 real(c_double), parameter :: b = 2.5d0 real(c_double), parameter :: ep = 1.d-5 @@ -79,7 +79,7 @@ module bruss_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function ExpRhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -91,7 +91,7 @@ integer(c_int) function ExpRhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data real(c_double) :: u, v, w @@ -123,7 +123,6 @@ integer(c_int) function ExpRhsFn(tn, sunvec_y, sunvec_f, user_data) & end function ExpRhsFn ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! ImpRhsFn provides the right hand side implicit function for the ! ODE: dy1/dt = f1(t,y1,y2,y3) @@ -136,7 +135,7 @@ end function ExpRhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -148,7 +147,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data real(c_double) :: u, v, w @@ -171,7 +170,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_y, sunvec_f, user_data) & ! fill RHS vector fvec(1) = 0.d0 fvec(2) = 0.d0 - fvec(3) = (b-w)/ep + fvec(3) = (b - w)/ep ! return success ierr = 0 @@ -189,7 +188,7 @@ end function ImpRhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & - sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C,name='Jac') + sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) bind(C, name='Jac') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -203,13 +202,13 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix - real(c_double), pointer, dimension(neq,neq) :: J(:,:) + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -218,7 +217,7 @@ integer(c_int) function Jac(tn, sunvec_y, sunvec_f, sunmat_J, user_data, & ! fill Jacobian entries J(1:3, 1:3) = 0.d0 - J(3,3) = -1.d0/ep + J(3, 3) = -1.d0/ep ! return success ierr = 0 @@ -230,7 +229,6 @@ end function Jac end module bruss_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -266,8 +264,8 @@ program main real(c_double), parameter :: nlscoef = 1.d-2 ! non-linear solver coefficient integer(c_int), parameter :: order = 3 ! method order - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + 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, dimension(neq) :: yvec(:) ! underlying vector @@ -279,17 +277,17 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = 1.0d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = 1.0d0 + nout = ceiling(tend/dtout) ! create SUNDIALS N_Vector sunvec_y => FN_VNew_Serial(neq, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if yvec => FN_VGetArrayPointer(sunvec_y) @@ -298,31 +296,31 @@ program main ! create ARKStep memory arkode_mem = FARKStepCreate(c_funloc(ExpRhsFn), c_funloc(ImpRhsFn), tstart, sunvec_y, sunctx) - if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a dense linear solver with user-supplied Jacobian function. sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sunls => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver' - stop 1 + print *, 'Error in FARKodeSetLinearSolver' + stop 1 end if ierr = FARKodeSetJacFn(arkode_mem, c_funloc(Jac)) if (ierr /= 0) then - print *, 'Error in FARKodeSetJacFn' - stop 1 + print *, 'Error in FARKodeSetJacFn' + stop 1 end if ! set relative and absolute tolerances @@ -331,21 +329,21 @@ program main ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! Set additional method parameters ierr = FARKodeSetOrder(arkode_mem, order) if (ierr /= 0) then - print *, 'Error in FARKodeSetOrder' - stop 1 + print *, 'Error in FARKodeSetOrder' + stop 1 end if ierr = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (ierr /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKodeSetNonlinConvCoef' + stop 1 end if imethod = 0 @@ -354,16 +352,16 @@ program main adapt_params = 0.d0 ierr = FARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) if (ierr /= 0) then - print *, 'Error in FARKStepSetAdaptivityMethod, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepSetAdaptivityMethod, ierr = ', ierr, '; halting' + stop 1 end if ! Open output stream for results, output comment line - open(100, file='solution.txt') - write(100,*) '# t u v w' + open (100, file='solution.txt') + write (100, *) '# t u v w' ! output initial condition to disk - write(100,'(3x,4(es23.16,1x))') tstart, yvec + write (100, '(3x,4(es23.16,1x))') tstart, yvec ! Start time stepping print *, ' ' @@ -372,23 +370,23 @@ program main print *, ' t u v w ' print *, ' ---------------------------------------------------' print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - do outstep = 1,nout + do outstep = 1, nout - ! call ARKodeEvolve - tout = min(tout + dtout, tend) - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) - if (ierr /= 0) then - print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' - stop 1 - endif + ! call ARKodeEvolve + tout = min(tout + dtout, tend) + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_y, tcur, ARK_NORMAL) + if (ierr /= 0) then + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - write(100,'(3x,4(es23.16,1x))') tcur, yvec(1), yvec(2), yvec(3) + ! output current solution + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + write (100, '(3x,4(es23.16,1x))') tcur, yvec(1), yvec(2), yvec(3) - enddo + end do print *, ' ----------------------------------------------------' - close(100) + close (100) ! diagnostics output call ARKStepStats(arkode_mem) @@ -403,7 +401,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -443,91 +440,91 @@ subroutine ARKStepStats(arkode_mem) ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetActualInitStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetLastStep(arkode_mem, hlast) if (ierr /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentStep(arkode_mem, hcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentStep, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetCurrentTime(arkode_mem, tcur) if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentTime, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumJacEvals, retval = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe - print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi - print '(4x,A,i9)' ,'Total jac function calls =',njacevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs exp function calls =', nfe + print '(4x,A,i9)', 'Total rhs imp function calls =', nfi + print '(4x,A,i9)', 'Total jac function calls =', njacevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index ab8fa486a8..6cdc9bad24 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -53,7 +53,7 @@ module DiurnalKryBP_mod implicit none ! setup and number of equations - integer(c_int), parameter :: mx = 10, my = 10 + integer(c_int), parameter :: mx = 10, my = 10 integer(c_int64_t), parameter :: mm = mx*my integer(c_int64_t), parameter :: neq = 2*mm @@ -107,7 +107,7 @@ module DiurnalKryBP_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function ImpRhsFn(tn, sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C,name='ImpRhsFn') + result(ierr) bind(C, name='ImpRhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -119,7 +119,7 @@ integer(c_int) function ImpRhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data integer(c_int) :: jleft, jright, jdn, jup @@ -129,69 +129,69 @@ integer(c_int) function ImpRhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double) :: vertd1, vertd2, ydn, yup ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(2,mx,my) :: uvecI(:,:,:) - real(c_double), pointer, dimension(2,mx,my) :: fvecI(:,:,:) + real(c_double), pointer, dimension(2, mx, my) :: uvecI(:, :, :) + real(c_double), pointer, dimension(2, mx, my) :: fvecI(:, :, :) !======= Internals ============ ! get data arrays from SUNDIALS vectors - uvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) - fvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + uvecI(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) + fvecI(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_f) ! Set diurnal rate coefficients. - s = sin(om * tn) + s = sin(om*tn) if (s > 0.0d0) then - q3 = exp(-a3 / s) - q4 = exp(-a4 / s) + q3 = exp(-a3/s) + q4 = exp(-a4/s) else - q3 = 0.0d0 - q4 = 0.0d0 + q3 = 0.0d0 + q4 = 0.0d0 end if ! Loop over all grid points. do jy = 1, my - ydn = 30.0d0 + (jy - 1.5d0) * dy - yup = ydn + dy - cydn = vdco * exp(0.2d0 * ydn) - cyup = vdco * exp(0.2d0 * yup) - jdn = jy-1 - if (jy == 1) jdn = my - jup = jy+1 - if (jy == my) jup = 1 - do jx = 1, mx - c1 = uvecI(1,jx,jy) - c2 = uvecI(2,jx,jy) - ! Set kinetic rate terms. - qq1 = q1 * c1 * c3 - qq2 = q2 * c1 * c2 - qq3 = q3 * c3 - qq4 = q4 * c2 - rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 - rkin2 = qq1 - qq2 - qq4 - ! Set vertical diffusion terms. - c1dn = uvecI(1,jx,jdn) - c2dn = uvecI(2,jx,jdn) - c1up = uvecI(1,jx,jup) - c2up = uvecI(2,jx,jup) - vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) - vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) - ! Set horizontal diffusion and advection terms. - jleft = jx-1 - if (jx == 1) jleft = mx - jright = jx+1 - if (jx == mx) jright = 1 - c1lt = uvecI(1,jleft,jy) - c2lt = uvecI(2,jleft,jy) - c1rt = uvecI(1,jright,jy) - c2rt = uvecI(2,jright,jy) - hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) - hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) - horad1 = haco * (c1rt - c1lt) - horad2 = haco * (c2rt - c2lt) - ! load all terms into fvecI. - fvecI(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 - fvecI(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 - end do + ydn = 30.0d0 + (jy - 1.5d0)*dy + yup = ydn + dy + cydn = vdco*exp(0.2d0*ydn) + cyup = vdco*exp(0.2d0*yup) + jdn = jy - 1 + if (jy == 1) jdn = my + jup = jy + 1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvecI(1, jx, jy) + c2 = uvecI(2, jx, jy) + ! Set kinetic rate terms. + qq1 = q1*c1*c3 + qq2 = q2*c1*c2 + qq3 = q3*c3 + qq4 = q4*c2 + rkin1 = -qq1 - qq2 + 2.0d0*qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvecI(1, jx, jdn) + c2dn = uvecI(2, jx, jdn) + c1up = uvecI(1, jx, jup) + c2up = uvecI(2, jx, jup) + vertd1 = cyup*(c1up - c1) - cydn*(c1 - c1dn) + vertd2 = cyup*(c2up - c2) - cydn*(c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx - 1 + if (jx == 1) jleft = mx + jright = jx + 1 + if (jx == mx) jright = 1 + c1lt = uvecI(1, jleft, jy) + c2lt = uvecI(2, jleft, jy) + c1rt = uvecI(1, jright, jy) + c2rt = uvecI(2, jright, jy) + hord1 = hdco*(c1rt - 2.0d0*c1 + c1lt) + hord2 = hdco*(c2rt - 2.0d0*c2 + c2lt) + horad1 = haco*(c1rt - c1lt) + horad2 = haco*(c2rt - c2lt) + ! load all terms into fvecI. + fvecI(1, jx, jy) = vertd1 + hord1 + horad1 + rkin1 + fvecI(2, jx, jy) = vertd2 + hord2 + horad2 + rkin2 + end do end do ! return success @@ -204,7 +204,6 @@ end function ImpRhsFn end module DiurnalKryBP_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -233,12 +232,12 @@ program main integer(c_int64_t) :: mu, ml ! band preconditioner constants real(c_double) :: x, y ! initialization index variables - type(N_Vector), pointer :: sunvec_u ! sundials vector - type(N_Vector), pointer :: sunvec_f ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(c_ptr) :: arkode_mem ! ARKODE memory - real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + real(c_double), pointer, dimension(2, mx, my) :: uvec(:, :, :) ! underlying vector ! output statistic variables integer(c_long) :: lnst(1), lnst_att(1) @@ -251,81 +250,80 @@ program main ! initialize ODE tstart = 0.0d0 - tcur = tstart + tcur = tstart ! create SUNDIALS N_Vectors sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + uvec(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) sunvec_f => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_f)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - ! initialize and fill initial condition vector - do jy = 1,my - y = 30.0d0 + (jy - 1.0d0) * dy - cy = (0.1d0 * (y - 40.0d0))**2 - cy = 1.0d0 - cy + 0.5d0 * cy**2 - do jx = 1,mx - x = (jx - 1.0d0) * dx - cx = (0.1d0 * (x - 10.0d0))**2 - cx = 1.0d0 - cx + 0.5d0 * cx**2 - uvec(1,jx,jy) = 1.0d6 * cx * cy - uvec(2,jx,jy) = 1.0d12 * cx * cy - end do + do jy = 1, my + y = 30.0d0 + (jy - 1.0d0)*dy + cy = (0.1d0*(y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0*cy**2 + do jx = 1, mx + x = (jx - 1.0d0)*dx + cx = (0.1d0*(x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0*cx**2 + uvec(1, jx, jy) = 1.0d6*cx*cy + uvec(2, jx, jy) = 1.0d12*cx*cy + end do end do ! create ARKStep memory arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(ImpRhsFn), tstart, sunvec_u, ctx) - if (.not. c_associated(arkode_mem)) print *,'ERROR: arkode_mem = NULL' + if (.not. c_associated(arkode_mem)) print *, 'ERROR: arkode_mem = NULL' ! Tell ARKODE to use a SPGMR linear solver. sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() ierr = FARKodeSetLinearSolver(arkode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FARKodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (ierr /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetGSType, ierr = ', ierr, '; halting' + stop 1 end if mu = 2 ml = 2 ierr = FARKBandPrecInit(arkode_mem, neq, mu, ml) if (ierr /= 0) then - print *, 'Error in FARKBandPrecInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKBandPrecInit, ierr = ', ierr, '; halting' + stop 1 end if ! Set additional method parameters ierr = FARKodeSStolerances(arkode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKodeSetMaxNumSteps' + stop 1 end if ! Start time stepping @@ -336,40 +334,40 @@ program main print *, ' t c2 (bottom left middle top right) | lnst lnst_att lh' print *, ' ----------------------------------------------------------------------------------------' tout = twohr - do outstep = 1,12 - - ! call ARKodeEvolve - ierr = FARKodeEvolve(arkode_mem, tout, sunvec_u, tcur, ARK_NORMAL) - if (ierr /= 0) then - print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' - stop 1 - end if - - ! get some solver statistics - ierr = FARKodeGetNumSteps(arkode_mem, lnst) - if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FARKodeGetNumStepAttempts(arkode_mem, lnst_att) - if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FARKodeGetCurrentStep(arkode_mem, lh) - if (ierr /= 0) then - print *, 'Error in FARKodeGetCurrentStep, ierr = ', ierr, '; halting' - stop 1 - end if - - ! print current solution and output statistics - print '(2x,4(es14.6,2x),i5,i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lnst_att, lh - print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) - - ! update tout - tout = tout + twohr + do outstep = 1, 12 + + ! call ARKodeEvolve + ierr = FARKodeEvolve(arkode_mem, tout, sunvec_u, tcur, ARK_NORMAL) + if (ierr /= 0) then + print *, 'Error in FARKodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ! get some solver statistics + ierr = FARKodeGetNumSteps(arkode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKodeGetNumStepAttempts(arkode_mem, lnst_att) + if (ierr /= 0) then + print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKodeGetCurrentStep(arkode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FARKodeGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,i5,es14.6)', tcur, uvec(1, 1, 1), uvec(1, 5, 5), uvec(1, 10, 10), lnst, lnst_att, lh + print '(18x,3(es14.6,2x))', uvec(2, 1, 1), uvec(2, 5, 5), uvec(2, 10, 10) + + ! update tout + tout = tout + twohr end do print *, ' ----------------------------------------------------------------------------------------' @@ -387,7 +385,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! ARKStepStats ! @@ -431,108 +428,108 @@ subroutine ARKStepStats(arkode_mem) ierr = FARKodeGetNumSteps(arkode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumPrecEvals(arkode_mem, npe) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumPrecEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumPrecSolves(arkode_mem, nps) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumPrecSolves, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumLinIters(arkode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 end if avdim = dble(nliters)/dble(nniters) ierr = FARKodeGetNumLinConvFails(arkode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetNumNonlinSolvConvFails(arkode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetWorkSpace(arkode_mem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FARKodeGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKodeGetLinWorkSpace(arkode_mem, lenrwls, leniwls) if (ierr /= 0) then - print *, 'Error in FARKodeGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKodeGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKBandPrecGetWorkSpace(arkode_mem, lenrwbp, leniwbp) if (ierr /= 0) then - print *, 'Error in FARKBandPrecGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKBandPrecGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FARKBandPrecGetNumRhsEvals(arkode_mem, nfebp) if (ierr /= 0) then - print *, 'Error in FARKBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FARKBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs exp function call =',nfe - print '(4x,A,i9)' ,'Total rhs imp function call =',nfi - print '(4x,A,i9)' ,'Total num preconditioner evals =',npe - print '(4x,A,i9)' ,'Total num preconditioner solves =',nps - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num linear solver iters =',nliters - print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim - print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf - print '(4x,A,i9)' ,'Num linear solver fails =',ncfl - print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw - print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls - print '(4x,A,2(i9,3x))' ,'ARKBandPre real/int workspace sizes =',lenrwbp,leniwbp - print '(4x,A,i9)' ,'ARKBandPre number of f evaluations =',nfebp + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs exp function call =', nfe + print '(4x,A,i9)', 'Total rhs imp function call =', nfi + print '(4x,A,i9)', 'Total num preconditioner evals =', npe + print '(4x,A,i9)', 'Total num preconditioner solves =', nps + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num linear solver iters =', nliters + print '(4x,A,es14.6)', 'Avg Krylov subspace dim =', avdim + print '(4x,A,i9)', 'Num nonlinear solver fails =', ncf + print '(4x,A,i9)', 'Num linear solver fails =', ncfl + print '(4x,A,2(i9,3x))', 'main solver real/int workspace sizes =', lenrw, leniw + print '(4x,A,2(i9,3x))', 'linear solver real/int workspace sizes =', lenrwls, leniwls + print '(4x,A,2(i9,3x))', 'ARKBandPre real/int workspace sizes =', lenrwbp, leniwbp + print '(4x,A,i9)', 'ARKBandPre number of f evaluations =', nfebp print *, ' ' return diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index cb0aa027d0..2b5cc5747e 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -86,23 +86,23 @@ module kpr_mod ! Constants real(c_double) :: ZERO = 0.0d0 - real(c_double) :: ONE = 1.0d0 - real(c_double) :: TWO = 2.0d0 + real(c_double) :: ONE = 1.0d0 + real(c_double) :: TWO = 2.0d0 ! general problem parameters - real(c_double), parameter :: T0 = 0.0d0 ! initial time - real(c_double), parameter :: Tf = 5.0d0 ! final time - real(c_double), parameter :: dTout = 0.1d0 ! time between outputs - integer(c_int64_t), parameter :: NEQ = 2 ! number of dependent vars. - integer(c_int), parameter :: Nt = ceiling(Tf/dTout) ! number of output times + real(c_double), parameter :: T0 = 0.0d0 ! initial time + real(c_double), parameter :: Tf = 5.0d0 ! final time + real(c_double), parameter :: dTout = 0.1d0 ! time between outputs + integer(c_int64_t), parameter :: NEQ = 2 ! number of dependent vars. + integer(c_int), parameter :: Nt = ceiling(Tf/dTout) ! number of output times ! parameters that can be modified via CLI args or are derived - real(c_double) :: hs = 0.01d0 ! slow step size - real(c_double) :: e = 0.5d0 ! fast/slow coupling strength - real(c_double) :: G = -100.0d0 ! stiffness at slow time scale - real(c_double) :: w = 100.0d0 ! time-scale separation factor - real(c_double) :: reltol = 0.01d0 ! integrator tolerances - real(c_double) :: abstol = 1e-11 + real(c_double) :: hs = 0.01d0 ! slow step size + real(c_double) :: e = 0.5d0 ! fast/slow coupling strength + real(c_double) :: G = -100.0d0 ! stiffness at slow time scale + real(c_double) :: w = 100.0d0 ! time-scale separation factor + real(c_double) :: reltol = 0.01d0 ! integrator tolerances + real(c_double) :: abstol = 1e-11 contains @@ -121,7 +121,7 @@ integer(c_int) function ff(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 @@ -139,8 +139,8 @@ integer(c_int) function ff(t, yvec, ydotvec, user_data) & ! fill in the RHS function: ! [0 0]*[(-1+u^2-r(t))/(2*u)] + [ 0 ] ! [e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2*vtrue(t))] - tmp1 = (-ONE+u*u-r(t))/(TWO*u) - tmp2 = (-TWO+v*v-s(t))/(TWO*v) + tmp1 = (-ONE + u*u - r(t))/(TWO*u) + tmp2 = (-TWO + v*v - s(t))/(TWO*v) ydotarr(1) = ZERO ydotarr(2) = e*tmp1 - tmp2 + sdot(t)/(TWO*vtrue(t)) @@ -162,7 +162,7 @@ integer(c_int) function fs(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 @@ -180,8 +180,8 @@ integer(c_int) function fs(t, yvec, ydotvec, user_data) & ! fill in the RHS function: ! [G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)] ! [0 0] [(-2+v^2-s(t))/(2*v)] [ 0 ] - tmp1 = (-ONE+u*u-r(t))/(TWO*u) - tmp2 = (-TWO+v*v-s(t))/(TWO*v) + tmp1 = (-ONE + u*u - r(t))/(TWO*u) + tmp2 = (-TWO + v*v - s(t))/(TWO*v) ydotarr(1) = G*tmp1 + e*tmp2 + rdot(t)/(TWO*u) ydotarr(2) = ZERO @@ -203,7 +203,7 @@ integer(c_int) function fse(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double), pointer, dimension(NEQ) :: yarr(:) @@ -241,7 +241,7 @@ integer(c_int) function fsi(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 @@ -259,8 +259,8 @@ integer(c_int) function fsi(t, yvec, ydotvec, user_data) & ! fill in the slow implicit RHS function: ! [G e]*[(-1+u^2-r(t))/(2*u))] ! [0 0] [(-2+v^2-s(t))/(2*v)] - tmp1 = (-ONE+u*u-r(t))/(TWO*u) - tmp2 = (-TWO+v*v-s(t))/(TWO*v) + tmp1 = (-ONE + u*u - r(t))/(TWO*u) + tmp2 = (-TWO + v*v - s(t))/(TWO*v) ydotarr(1) = G*tmp1 + e*tmp2 ydotarr(2) = ZERO @@ -281,7 +281,7 @@ integer(c_int) function fn(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data real(c_double) :: u, v real(c_double) :: tmp1, tmp2 @@ -299,8 +299,8 @@ integer(c_int) function fn(t, yvec, ydotvec, user_data) & ! fill in the RHS function: ! [G e]*[(-1+u^2-r(t))/(2*u))] + [rdot(t)/(2*u)] ! [e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2*vtrue(t))] - tmp1 = (-ONE+u*u-r(t))/(TWO*u) - tmp2 = (-TWO+v*v-s(t))/(TWO*v) + tmp1 = (-ONE + u*u - r(t))/(TWO*u) + tmp2 = (-TWO + v*v - s(t))/(TWO*v) ydotarr(1) = G*tmp1 + e*tmp2 + rdot(t)/(TWO*u) ydotarr(2) = e*tmp1 - tmp2 + sdot(t)/(TWO*vtrue(t)) @@ -321,7 +321,7 @@ integer(c_int) function f0(t, yvec, ydotvec, user_data) & real(c_double), value :: t type(N_Vector) :: yvec type(N_Vector) :: ydotvec - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data call FN_VConst(ZERO, ydotvec) @@ -346,18 +346,18 @@ integer(c_int) function Js(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & type(N_Vector) :: y type(N_Vector) :: fy type(SUNMatrix) :: J - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v real(c_double), pointer, dimension(NEQ) :: yarr(:) - real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) + real(c_double), pointer, dimension(NEQ, NEQ) :: Jarr(:, :) ! get N_Vector data arrays yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ, 1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -366,10 +366,10 @@ integer(c_int) function Js(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (w*(1+r(t))-rdot(t))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] ! [ 0 0 ] - Jarr(1,1) = G/TWO + (G*(ONE+r(t))-rdot(t))/(2*u*u) - Jarr(2,1) = ZERO - Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(2,2) = ZERO + Jarr(1, 1) = G/TWO + (G*(ONE + r(t)) - rdot(t))/(2*u*u) + Jarr(2, 1) = ZERO + Jarr(1, 2) = e/TWO + e*(TWO + s(t))/(TWO*v*v) + Jarr(2, 2) = ZERO ! return success ierr = 0 @@ -388,18 +388,18 @@ integer(c_int) function Jsi(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & type(N_Vector) :: y type(N_Vector) :: fy type(SUNMatrix) :: J - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v real(c_double), pointer, dimension(NEQ) :: yarr(:) - real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) + real(c_double), pointer, dimension(NEQ, NEQ) :: Jarr(:, :) ! get N_Vector data array yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ, 1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -408,10 +408,10 @@ integer(c_int) function Jsi(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (G*(1+r(t)))/(2*u^2) e/2+e*(2+s(t))/(2*v^2)] ! [ 0 0 ] - Jarr(1,1) = G/TWO + (G*(ONE+r(t)))/(2*u*u) - Jarr(2,1) = ZERO - Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(2,2) = ZERO + Jarr(1, 1) = G/TWO + (G*(ONE + r(t)))/(2*u*u) + Jarr(2, 1) = ZERO + Jarr(1, 2) = e/TWO + e*(TWO + s(t))/(TWO*v*v) + Jarr(2, 2) = ZERO ! return success ierr = 0 @@ -430,18 +430,18 @@ integer(c_int) function Jn(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & type(N_Vector) :: y type(N_Vector) :: fy type(SUNMatrix) :: J - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data type(N_Vector) :: tmp1, tmp2, tmp3 real(c_double) :: u, v real(c_double), pointer, dimension(NEQ) :: yarr(:) - real(c_double), pointer, dimension(NEQ,NEQ) :: Jarr(:,:) + real(c_double), pointer, dimension(NEQ, NEQ) :: Jarr(:, :) ! get N_Vector data array yarr => FN_VGetArrayPointer(y) ! get Jacobian data array - Jarr(1:NEQ,1:NEQ) => FSUNDenseMatrix_Data(J) + Jarr(1:NEQ, 1:NEQ) => FSUNDenseMatrix_Data(J) ! extract variables u = yarr(1) @@ -450,10 +450,10 @@ integer(c_int) function Jn(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & ! fill in the Jacobian: ! [G/2 + (G*(1+r(t))-rdot(t))/(2*u^2) e/2 + e*(2+s(t))/(2*v^2)] ! [e/2 + e*(1+r(t))/(2*u^2) -1/2 - (2+s(t))/(2*v^2)] - Jarr(1,1) = G/TWO + (G*(1+r(t))-rdot(t))/(TWO*u*u) - Jarr(2,1) = e/TWO + e*(ONE+r(t))/(TWO*u*u) - Jarr(1,2) = e/TWO + e*(TWO+s(t))/(TWO*v*v) - Jarr(2,2) = -ONE/TWO - (TWO+s(t))/(TWO*v*v) + Jarr(1, 1) = G/TWO + (G*(1 + r(t)) - rdot(t))/(TWO*u*u) + Jarr(2, 1) = e/TWO + e*(ONE + r(t))/(TWO*u*u) + Jarr(1, 2) = e/TWO + e*(TWO + s(t))/(TWO*v*v) + Jarr(2, 2) = -ONE/TWO - (TWO + s(t))/(TWO*v*v) ! return success ierr = 0 @@ -526,7 +526,7 @@ real(c_double) function utrue(t) & real(c_double) :: t - result = sqrt(ONE+r(t)) + result = sqrt(ONE + r(t)) return end function utrue @@ -540,7 +540,7 @@ real(c_double) function vtrue(t) & real(c_double) :: t - result = sqrt(TWO+s(t)) + result = sqrt(TWO + s(t)) return end function vtrue @@ -571,7 +571,6 @@ end function Ytrue end module kpr_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -580,7 +579,6 @@ program main use kpr_mod implicit none - ! general problem variables type(c_ptr) sunctx ! SUNDIALS simulation context integer(c_int) :: retval ! reusable error-checking flag @@ -600,8 +598,8 @@ program main logical :: imex_slow = .FALSE. real(c_double) :: hf, gamma, beta, t, tret(1), tout real(c_double) :: uerr, verr, uerrtot, verrtot, errtot - real(c_double), allocatable :: Af(:,:), bf(:), cf(:), df(:) ! Arrays for fast Butcher table, NOTE: must be in row-major order - real(c_double), allocatable :: As(:,:), bs(:), cs(:), ds(:) ! Arrays for slow Butcher table, NOTE: must be in row-major order + real(c_double), allocatable :: Af(:, :), bf(:), cf(:), df(:) ! Arrays for fast Butcher table, NOTE: must be in row-major order + real(c_double), allocatable :: As(:, :), bs(:), cs(:), ds(:) ! Arrays for slow Butcher table, NOTE: must be in row-major order integer(c_int) :: iout, argc, argi integer(c_long) :: nsts(1), nstf(1), nfse(1), nfsi(1), nff(1) integer(c_long) :: nnif(1), nncf(1), njef(1), nnis(1), nncs(1), njes(1), tmp(1) @@ -622,18 +620,18 @@ program main LSs => null() argc = command_argument_count() - allocate(argv(argc)) ! I've omitted checking the return status of the allocation + allocate (argv(argc)) ! I've omitted checking the return status of the allocation do argi = 1, argc call get_command_argument(argi, argv(argi)) end do ! Retrieve the command-line options: solve_type h G w e */ - if (argc > 0) read(argv(1), *) solve_type - if (argc > 1) read(argv(2), *) hs - if (argc > 2) read(argv(3), *) G - if (argc > 3) read(argv(4), *) w - if (argc > 4) read(argv(5), *) e + if (argc > 0) read (argv(1), *) solve_type + if (argc > 1) read (argv(2), *) hs + if (argc > 2) read (argv(3), *) G + if (argc > 3) read (argv(4), *) w + if (argc > 4) read (argv(5), *) e ! Check arguments for validity ! 0 <= solve_type <= 9 @@ -643,11 +641,11 @@ program main ! w >= 1.0 if ((solve_type < 0) .or. (solve_type > 9)) then print *, "ERROR: solve_type be an integer in [0,9]" - stop -1 + stop - 1 end if if (G >= ZERO) then print *, "ERROR: G must be a negative real number" - stop -1 + stop - 1 end if implicit_slow = .false. if ((solve_type == 4) .or. (solve_type == 7)) then @@ -659,15 +657,15 @@ program main end if if (hs <= ZERO) then print *, "ERROR: hs must be in positive" - stop -1 + stop - 1 end if if ((hs > ONE/abs(G)) .and. (.not. implicit_slow)) then print *, "ERROR: hs must be in (0, 1/|G|)" - stop -1 + stop - 1 end if if (w < ONE) then print *, "ERROR: w must be >= 1.0" - stop -1 + stop - 1 end if hf = hs/w @@ -681,41 +679,41 @@ program main print '(A,E12.4,A)', " e = ", e select case (solve_type) - case (0) - print *, " solver: exp-3/exp-3 (standard MIS)" - case (1) - print *, " solver: none/exp-3 (no slow, explicit fast)" - case (2) - reltol = max(hs*hs*hs, real(1e-10,8)) - abstol = 1e-11 - print *, " solver: none/dirk-3 (no slow, dirk fast)" - print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol - case (3) - print *, " solver: exp-3/none (explicit slow, no fast)" - case (4) - reltol = max(hs*hs, real(1e-10,8)) - abstol = 1e-11 - print *, " solver: dirk-2/none (dirk slow, no fast)" - print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol - case (5) - print *, " solver: exp-4/exp-4 (MRI-GARK-ERK45a / ERK-4-4)" - case (6) - print *, " solver: exp-4/exp-3 (MRI-GARK-ERK45a / ERK-3-3)" - case (7) - reltol = max(hs*hs*hs, real(1e-10,8)) - abstol = 1e-11 - print *, " solver: dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve decoupled" - print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol - case (8) - reltol = max(hs*hs*hs, real(1e-10,8)) - abstol = 1e-11 - print *, " solver: ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled" - print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol - case (9) - reltol = max(hs*hs*hs*hs, real(1e-14,8)) - abstol = 1e-14 - print *, " solver: imexark4/exp-4 (IMEX-MRI4 / ERK-4-4) -- solve decoupled" - print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol + case (0) + print *, " solver: exp-3/exp-3 (standard MIS)" + case (1) + print *, " solver: none/exp-3 (no slow, explicit fast)" + case (2) + reltol = max(hs*hs*hs, real(1e-10, 8)) + abstol = 1e-11 + print *, " solver: none/dirk-3 (no slow, dirk fast)" + print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol + case (3) + print *, " solver: exp-3/none (explicit slow, no fast)" + case (4) + reltol = max(hs*hs, real(1e-10, 8)) + abstol = 1e-11 + print *, " solver: dirk-2/none (dirk slow, no fast)" + print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol + case (5) + print *, " solver: exp-4/exp-4 (MRI-GARK-ERK45a / ERK-4-4)" + case (6) + print *, " solver: exp-4/exp-3 (MRI-GARK-ERK45a / ERK-3-3)" + case (7) + reltol = max(hs*hs*hs, real(1e-10, 8)) + abstol = 1e-11 + print *, " solver: dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve decoupled" + print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol + case (8) + reltol = max(hs*hs*hs, real(1e-10, 8)) + abstol = 1e-11 + print *, " solver: ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled" + print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol + case (9) + reltol = max(hs*hs*hs*hs, real(1e-14, 8)) + abstol = 1e-14 + print *, " solver: imexark4/exp-4 (IMEX-MRI4 / ERK-4-4) -- solve decoupled" + print '(A,E12.4,A,E12.4)', " reltol: ", reltol, " abstol: ", abstol end select ! Create the SUNDIALS context object for this simulation @@ -744,17 +742,17 @@ program main if (solve_type == 0 .or. solve_type == 6 .or. solve_type == 7 .or. solve_type == 8) then ! erk-3-3 fast solver inner_arkode_mem = FARKStepCreate(c_funloc(ff), c_null_funptr, T0, y, sunctx) - allocate(Af(3,3)) - allocate(bf(3)) - allocate(cf(3)) - allocate(df(3)) + allocate (Af(3, 3)) + allocate (bf(3)) + allocate (cf(3)) + allocate (df(3)) Af = 0.d0 bf = 0.d0 cf = 0.d0 df = 0.d0 - Af(1,2) = 0.5d0 - Af(1,3) = -ONE - Af(2,3) = TWO + Af(1, 2) = 0.5d0 + Af(1, 3) = -ONE + Af(2, 3) = TWO bf(1) = ONE/6.0d0 bf(2) = TWO/3.0d0 bf(3) = ONE/6.0d0 @@ -768,17 +766,17 @@ program main else if (solve_type == 1) then ! erk-3-3 fast solver (full problem) inner_arkode_mem = FARKStepCreate(c_funloc(fn), c_null_funptr, T0, y, sunctx) - allocate(Af(3,3)) - allocate(bf(3)) - allocate(cf(3)) - allocate(df(3)) + allocate (Af(3, 3)) + allocate (bf(3)) + allocate (cf(3)) + allocate (df(3)) Af = 0.d0 bf = 0.d0 cf = 0.d0 df = 0.d0 - Af(1,2) = 0.5d0 - Af(1,3) = -ONE - Af(2,3) = TWO + Af(1, 2) = 0.5d0 + Af(1, 3) = -ONE + Af(2, 3) = TWO bf(1) = ONE/6.0d0 bf(2) = TWO/3.0d0 bf(3) = ONE/6.0d0 @@ -792,17 +790,17 @@ program main else if (solve_type == 5 .or. solve_type == 9) then ! erk-4-4 fast solver inner_arkode_mem = FARKStepCreate(c_funloc(ff), c_null_funptr, T0, y, sunctx) - allocate(Af(4,4)) - allocate(bf(4)) - allocate(cf(4)) - allocate(df(4)) + allocate (Af(4, 4)) + allocate (bf(4)) + allocate (cf(4)) + allocate (df(4)) Af = 0.d0 bf = 0.d0 cf = 0.d0 df = 0.d0 - Af(1,2) = 0.5d0 - Af(2,3) = 0.5d0 - Af(3,4) = ONE + Af(1, 2) = 0.5d0 + Af(2, 3) = 0.5d0 + Af(3, 4) = ONE bf(1) = ONE/6.0d0 bf(2) = ONE/3.0d0 bf(3) = ONE/3.0d0 @@ -817,21 +815,21 @@ program main else if (solve_type == 2) then ! esdirk-3-3 fast solver (full problem) inner_arkode_mem = FARKStepCreate(c_null_funptr, c_funloc(fn), T0, y, sunctx) - beta = sqrt(3.0d0)/6.0d0 + 0.5d00 - gamma = (-ONE/8.0d0)*(sqrt(3.0d0)+ONE) - allocate(Af(3,3)) - allocate(bf(3)) - allocate(cf(3)) - allocate(df(3)) + beta = sqrt(3.0d0)/6.0d0 + 0.5d00 + gamma = (-ONE/8.0d0)*(sqrt(3.0d0) + ONE) + allocate (Af(3, 3)) + allocate (bf(3)) + allocate (cf(3)) + allocate (df(3)) Af = 0.d0 bf = 0.d0 cf = 0.d0 df = 0.d0 - Af(1,2) = 4.0d0*gamma+TWO*beta - Af(2,2) = ONE-4.0d0*gamma-TWO*beta - Af(1,3) = 0.5d0-beta-gamma - Af(2,3) = gamma - Af(3,3) = beta + Af(1, 2) = 4.0d0*gamma + TWO*beta + Af(2, 2) = ONE - 4.0d0*gamma - TWO*beta + Af(1, 3) = 0.5d0 - beta - gamma + Af(2, 3) = gamma + Af(3, 3) = beta bf(1) = ONE/6.0d0 bf(2) = ONE/6.0d0 bf(3) = TWO/3.0d0 @@ -852,17 +850,17 @@ program main else if (solve_type == 3 .or. solve_type == 4) then ! no fast dynamics ('evolve' explicitly w/ erk-3-3) inner_arkode_mem = FARKStepCreate(c_funloc(f0), c_null_funptr, T0, y, sunctx) - allocate(Af(3,3)) - allocate(bf(3)) - allocate(cf(3)) - allocate(df(3)) + allocate (Af(3, 3)) + allocate (bf(3)) + allocate (cf(3)) + allocate (df(3)) Af = 0.d0 bf = 0.d0 cf = 0.d0 df = 0.d0 - Af(1,2) = 0.5d0 - Af(1,3) = -ONE - Af(2,3) = TWO + Af(1, 2) = 0.5d0 + Af(1, 3) = -ONE + Af(2, 3) = TWO bf(1) = ONE/6.0d0 bf(2) = TWO/3.0d0 bf(3) = ONE/6.0d0 @@ -926,15 +924,15 @@ program main print *, 'ERROR: arkode_mem = NULL' stop 1 end if - allocate(As(2,2)) - allocate(bs(2)) - allocate(cs(2)) - allocate(ds(2)) + allocate (As(2, 2)) + allocate (bs(2)) + allocate (cs(2)) + allocate (ds(2)) As = 0.d0 bs = 0.d0 cs = 0.d0 ds = 0.d0 - As(1,2) = TWO/3.0d0 + As(1, 2) = TWO/3.0d0 bs(1) = 0.25d0 bs(2) = 0.75d0 cs(2) = TWO/3.0d0 @@ -1017,12 +1015,12 @@ program main ! integration, then prints results. Stops when the final time ! has been reached t = T0 - tout = T0+dTout + tout = T0 + dTout uerr = ZERO verr = ZERO uerrtot = ZERO verrtot = ZERO - errtot = ZERO + errtot = ZERO print *, " t u v uerr verr" print *, " ------------------------------------------------------" print '(A, F10.6, A, F10.6, A, F10.6, A, E9.2, A, E9.2)', & @@ -1034,10 +1032,10 @@ program main call check_retval(retval, "FARKodeEvolve") ! access/print solution and error - uerr = abs(yarr(1)-utrue(tret(1))) - verr = abs(yarr(2)-vtrue(tret(1))) + uerr = abs(yarr(1) - utrue(tret(1))) + verr = abs(yarr(2) - vtrue(tret(1))) print '(A, F10.6, A, F10.6, A, F10.6, A, E9.2, A, E9.2)', & - " ", tret(1), " ", yarr(1), " ", yarr(2), " ", uerr, " ", verr + " ", tret(1), " ", yarr(1), " ", yarr(2), " ", uerr, " ", verr uerrtot = uerrtot + uerr*uerr verrtot = verrtot + verr*verr errtot = errtot + uerr*uerr + verr*verr @@ -1047,10 +1045,10 @@ program main if (tout > Tf) then tout = Tf end if - enddo - uerrtot = sqrt(uerrtot / Nt) - verrtot = sqrt(verrtot / Nt) - errtot = sqrt(errtot / Nt / 2) + end do + uerrtot = sqrt(uerrtot/Nt) + verrtot = sqrt(verrtot/Nt) + errtot = sqrt(errtot/Nt/2) print *, " ------------------------------------------------------" ! @@ -1101,15 +1099,15 @@ program main end if ! Clean up and return - if (allocated(argv)) deallocate(argv) - if (allocated(Af)) deallocate(Af) - if (allocated(bf)) deallocate(bf) - if (allocated(cf)) deallocate(cf) - if (allocated(df)) deallocate(df) - if (allocated(As)) deallocate(As) - if (allocated(bs)) deallocate(bs) - if (allocated(cs)) deallocate(cs) - if (allocated(ds)) deallocate(ds) + if (allocated(argv)) deallocate (argv) + if (allocated(Af)) deallocate (Af) + if (allocated(bf)) deallocate (bf) + if (allocated(cf)) deallocate (cf) + if (allocated(df)) deallocate (df) + if (allocated(As)) deallocate (As) + if (allocated(bs)) deallocate (bs) + if (allocated(cs)) deallocate (cs) + if (allocated(ds)) deallocate (ds) call FN_VDestroy(y) ! Free y vector call FMRIStepCoupling_Free(SC) ! Free coupling coefficients if (associated(MATf)) call FSUNMatDestroy(MATf) ! Free fast matrix @@ -1131,7 +1129,7 @@ subroutine check_retval(retval, name) integer(c_int) :: retval if (retval /= 0) then - write(*,'(A,A,A)') 'ERROR: ', name,' returned nonzero' + write (*, '(A,A,A)') 'ERROR: ', name, ' returned nonzero' stop 1 end if end subroutine check_retval diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 index c93a7dc06f..2c5016d2d2 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -55,7 +55,7 @@ module dnsL_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnirob') + result(ierr) bind(C, name='fcnirob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -67,7 +67,7 @@ integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -100,7 +100,7 @@ end function fcnirob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(tn, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -112,7 +112,7 @@ integer(c_int) function grob(tn, sunvec_y, gout, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -142,8 +142,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -157,14 +157,14 @@ integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) - real(c_double), pointer, dimension(neq,neq) :: J(:,:) + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -173,15 +173,15 @@ integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - J(2,1) = 0.04d0 - J(3,1) = 0.d0 - J(1,2) = 1.d4*yval(3) - J(2,2) = -1.d4*yval(3) - 6.0d7*yval(2) - J(3,2) = 6.d7*yval(2) - J(1,3) = 1.d4*yval(2) - J(2,3) = -1.d4*yval(2) - J(3,3) = 0.d0 + J(1, 1) = -0.04d0 + J(2, 1) = 0.04d0 + J(3, 1) = 0.d0 + J(1, 2) = 1.d4*yval(3) + J(2, 2) = -1.d4*yval(3) - 6.0d7*yval(2) + J(3, 2) = 6.d7*yval(2) + J(1, 3) = 1.d4*yval(2) + J(2, 3) = -1.d4*yval(2) + J(3, 3) = 0.d0 ! return success ierr = 0 @@ -213,12 +213,12 @@ program main real(c_double) :: rtol, t0, tout1, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_f ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_f ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(SUNNonLinearSolver), pointer :: sunnonlin_NLS ! sundials nonlinear solver type(c_ptr) :: arkode_mem ! ARKODE memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -237,11 +237,11 @@ program main retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) ! initialize solution vectors and tolerances - yval(1) = 1.d0 - yval(2) = 0.d0 - yval(3) = 0.d0 - fval = 0.d0 - rtol = 1.d-4 + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + fval = 0.d0 + rtol = 1.d-4 avtol(1) = 1.d-8 avtol(2) = 1.d-11 avtol(3) = 1.d-8 @@ -249,20 +249,20 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_f => FN_VMake_Serial(neq, fval, sunctx) if (.not. associated(sunvec_f)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set integration limits @@ -278,87 +278,87 @@ program main ! Call FARKodeSVtolerances to set tolerances retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FARKodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_LapackDense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! Set additional method parameters mxsteps = 10000 retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKodeSetMaxNumSteps' + stop 1 end if - initsize = 1.d-4 * rtol + initsize = 1.d-4*rtol retval = FARKodeSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKodeSetInitStep' - stop 1 + print *, 'Error in FARKodeSetInitStep' + stop 1 end if nlscoef = 1.d-7 retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKodeSetNonlinConvCoef' + stop 1 end if nliters = 8 retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNonlinIters' - stop 1 + print *, 'Error in FARKodeSetMaxNonlinIters' + stop 1 end if pmethod = 1 retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKodeSetPredictorMethod' - stop 1 + print *, 'Error in FARKodeSetPredictorMethod' + stop 1 end if maxetf = 20 retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxErrTestFails' - stop 1 + print *, 'Error in FARKodeSetMaxErrTestFails' + stop 1 end if ! Create Newton SUNNonlinearSolver object. ARKODE uses a @@ -367,56 +367,56 @@ program main ! solely for demonstration purposes. sunnonlin_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) if (.not. associated(sunnonlin_NLS)) then - print *, 'ERROR: sunnonlinsol = NULL' - stop 1 + print *, 'ERROR: sunnonlinsol = NULL' + stop 1 end if ! Attach the nonlinear solver retval = FARKodeSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 end if ! In loop, call ARKodeEvolve, print results, and test for error. iout = 0 tout = tout1 - do while(iout < nout) + do while (iout < nout) - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) - if (retval < 0) then - print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(arkode_mem, tret(1), yval) + + if (retval == ARK_ROOT_RETURN) then + retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' stop 1 - endif - - call PrintOutput(arkode_mem, tret(1), yval) - - if (retval .eq. ARK_ROOT_RETURN) then - retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - endif - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. ARK_SUCCESS) then - iout = iout + 1 - tout = tout * 10.d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == ARK_SUCCESS) then + iout = iout + 1 + tout = tout*10.d0 + end if end do ! find and print derivative at tret(1) sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKodeGetDky' - stop 1 + print *, 'Error in ARKodeGetDky' + stop 1 end if print *, " " print *, "------------------------------------------------------" @@ -440,7 +440,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -465,8 +464,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: LAPACK DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, "Constraints not used." print *, " " print *, "----------------------------------------------------------------------" @@ -477,7 +476,6 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -505,23 +503,22 @@ subroutine PrintOutput(arkode_mem, t, y) retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' + stop 1 end if print '(es12.4,1x,3(es12.4,1x),a,i3,2x,es12.4)', & - t, y(1), y(2), y(3), "| ", nst, hused(1) + t, y(1), y(2), y(3), "| ", nst, hused(1) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -561,91 +558,91 @@ subroutine PrintFinalStats(arkode_mem) retval = FARKodeGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' + stop 1 end if retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (retval /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe - print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs exp function calls =', nfe + print '(4x,A,i9)', 'Total rhs imp function calls =', nfi + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index f4ef7e1984..79c3395ffa 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -55,7 +55,7 @@ module dns_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnirob') + result(ierr) bind(C, name='fcnirob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -67,7 +67,7 @@ integer(c_int) function fcnirob(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -100,7 +100,7 @@ end function fcnirob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(tn, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -113,7 +113,7 @@ integer(c_int) function grob(tn, sunvec_y, gout, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -143,8 +143,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -159,14 +159,14 @@ integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) - real(c_double), pointer, dimension(neq,neq) :: J(:,:) + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -175,15 +175,15 @@ integer(c_int) function jacrob(tn, sunvec_y, sunvec_f, & J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - J(2,1) = 0.04d0 - J(3,1) = 0.d0 - J(1,2) = 1.d4*yval(3) - J(2,2) = -1.d4*yval(3) - 6.0d7*yval(2) - J(3,2) = 6.d7*yval(2) - J(1,3) = 1.d4*yval(2) - J(2,3) = -1.d4*yval(2) - J(3,3) = 0.d0 + J(1, 1) = -0.04d0 + J(2, 1) = 0.04d0 + J(3, 1) = 0.d0 + J(1, 2) = 1.d4*yval(3) + J(2, 2) = -1.d4*yval(3) - 6.0d7*yval(2) + J(3, 2) = 6.d7*yval(2) + J(1, 3) = 1.d4*yval(2) + J(2, 3) = -1.d4*yval(2) + J(3, 3) = 0.d0 ! return success ierr = 0 @@ -195,7 +195,6 @@ end function jacrob end module dns_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -216,12 +215,12 @@ program main real(c_double) :: rtol, t0, tout1, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_f ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_f ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(SUNNonLinearSolver), pointer :: sunnonlin_NLS ! sundials nonlinear solver type(c_ptr) :: arkode_mem ! ARKODE memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -240,11 +239,11 @@ program main retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) ! initialize solution vectors and tolerances - yval(1) = 1.d0 - yval(2) = 0.d0 - yval(3) = 0.d0 - fval = 0.d0 - rtol = 1.d-4 + yval(1) = 1.d0 + yval(2) = 0.d0 + yval(3) = 0.d0 + fval = 0.d0 + rtol = 1.d-4 avtol(1) = 1.d-8 avtol(2) = 1.d-11 avtol(3) = 1.d-8 @@ -252,20 +251,20 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_f => FN_VMake_Serial(neq, fval, sunctx) if (.not. associated(sunvec_f)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set integration limits @@ -281,87 +280,87 @@ program main ! Call FARKodeSVtolerances to set tolerances retval = FARKodeSVtolerances(arkode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FARKodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FARKodeRootInit(arkode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); + retval = FARKodeSetLinearSolver(arkode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FARKodeSetJacFn(arkode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! Set additional method parameters mxsteps = 10000 retval = FARKodeSetMaxNumSteps(arkode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNumSteps' - stop 1 + print *, 'Error in FARKodeSetMaxNumSteps' + stop 1 end if - initsize = 1.d-4 * rtol + initsize = 1.d-4*rtol retval = FARKodeSetInitStep(arkode_mem, initsize) if (retval /= 0) then - print *, 'Error in FARKodeSetInitStep' - stop 1 + print *, 'Error in FARKodeSetInitStep' + stop 1 end if nlscoef = 1.d-7 retval = FARKodeSetNonlinConvCoef(arkode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinConvCoef' - stop 1 + print *, 'Error in FARKodeSetNonlinConvCoef' + stop 1 end if nliters = 8 retval = FARKodeSetMaxNonlinIters(arkode_mem, nliters) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxNonlinIters' - stop 1 + print *, 'Error in FARKodeSetMaxNonlinIters' + stop 1 end if pmethod = 1 retval = FARKodeSetPredictorMethod(arkode_mem, pmethod) if (retval /= 0) then - print *, 'Error in FARKodeSetPredictorMethod' - stop 1 + print *, 'Error in FARKodeSetPredictorMethod' + stop 1 end if maxetf = 20 retval = FARKodeSetMaxErrTestFails(arkode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FARKodeSetMaxErrTestFails' - stop 1 + print *, 'Error in FARKodeSetMaxErrTestFails' + stop 1 end if ! Create Newton SUNNonlinearSolver object. ARKODE uses a @@ -370,56 +369,56 @@ program main ! solely for demonstration purposes. sunnonlin_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) if (.not. associated(sunnonlin_NLS)) then - print *, 'ERROR: sunnonlinsol = NULL' - stop 1 + print *, 'ERROR: sunnonlinsol = NULL' + stop 1 end if ! Attach the nonlinear solver retval = FARKodeSetNonlinearSolver(arkode_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeSetNonlinearSolver, retval = ', retval, '; halting' + stop 1 end if ! In loop, call ARKodeEvolve, print results, and test for error. iout = 0 tout = tout1 - do while(iout < nout) + do while (iout < nout) + + retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) + if (retval < 0) then + print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(arkode_mem, tret(1), yval) - retval = FARKodeEvolve(arkode_mem, tout, sunvec_y, tret(1), ARK_NORMAL) - if (retval < 0) then - print *, 'Error in FARKodeEvolve, retval = ', retval, '; halting' + if (retval == ARK_ROOT_RETURN) then + retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' stop 1 - endif - - call PrintOutput(arkode_mem, tret(1), yval) - - if (retval .eq. ARK_ROOT_RETURN) then - retvalr = FARKodeGetRootInfo(arkode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FARKodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - endif - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. ARK_SUCCESS) then - iout = iout + 1 - tout = tout * 10.d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == ARK_SUCCESS) then + iout = iout + 1 + tout = tout*10.d0 + end if end do ! find and print derivative at tret(1) sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if retval = FARKodeGetDky(arkode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in ARKodeGetDky' - stop 1 + print *, 'Error in ARKodeGetDky' + stop 1 end if print *, " " print *, "------------------------------------------------------" @@ -443,7 +442,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -468,8 +466,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, "Constraints not used." print *, " " print *, "----------------------------------------------------------------------" @@ -480,7 +478,6 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -508,23 +505,22 @@ subroutine PrintOutput(arkode_mem, t, y) retval = FARKodeGetNumSteps(arkode_mem, nst) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetLastStep(arkode_mem, hused) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' + stop 1 end if print '(es12.4,1x,3(es12.4,1x),a,i3,2x,es12.4)', & - t, y(1), y(2), y(3), "| ", nst, hused(1) + t, y(1), y(2), y(3), "| ", nst, hused(1) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -564,91 +560,91 @@ subroutine PrintFinalStats(arkode_mem) retval = FARKodeGetNumSteps(arkode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumStepAttempts(arkode_mem, nst_a) if (retval /= 0) then - print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumStepAttempts, retval = ', retval, '; halting' + stop 1 end if retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) if (retval /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetActualInitStep(arkode_mem, hinused) if (retval /= 0) then - print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetActualInitStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetLastStep(arkode_mem, hlast) if (retval /= 0) then - print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetLastStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetCurrentStep(arkode_mem, hcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentStep, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetCurrentTime(arkode_mem, tcur) if (retval /= 0) then - print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetCurrentTime, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) if (retval /= 0) then - print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumErrTestFails(arkode_mem, netfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumNonlinSolvIters(arkode_mem, nniters) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumNonlinSolvConvFails(arkode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FARKodeGetNumJacEvals(arkode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FARKodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total internal steps attempts =',nst_a - print '(4x,A,i9)' ,'Total rhs exp function calls =',nfe - print '(4x,A,i9)' ,'Total rhs imp function calls =',nfi - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total internal steps attempts =', nst_a + print '(4x,A,i9)', 'Total rhs exp function calls =', nfe + print '(4x,A,i9)', 'Total rhs imp function calls =', nfi + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 b/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 index 0bc1bafdfa..7d3ee72e33 100644 --- a/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 +++ b/examples/arkode/F2003_serial/test_ark_butcher_f2003.f90 @@ -22,7 +22,7 @@ module test_arkode_butcher_table integer, parameter :: myindextype = selected_int_kind(16) #endif - contains +contains integer function smoke_tests() result(ret) @@ -52,7 +52,7 @@ integer function smoke_tests() result(ret) d(1) = 1.0d0 !===== Test ===== - ERK = FARkodeButcherTable_LoadERK(ARKODE_HEUN_EULER_2_1_2) + ERK = FARkodeButcherTable_LoadERK(ARKODE_HEUN_EULER_2_1_2) DIRK = FARkodeButcherTable_LoadDIRK(ARKODE_SDIRK_2_1_2) ierr = FARkodeButcherTable_CheckOrder(ERK, q, p, C_NULL_PTR) ierr = FARkodeButcherTable_CheckARKOrder(ERK, DIRK, q, p, C_NULL_PTR) @@ -60,10 +60,10 @@ integer function smoke_tests() result(ret) call FARKodeButcherTable_Free(ERK) call FARKodeButcherTable_Free(DIRK) - ERK = FARkodeButcherTable_Create(2, 2, 1, c, A, b, d) - DIRK = FARkodeButcherTable_Alloc(2, 1) + ERK = FARkodeButcherTable_Create(2, 2, 1, c, A, b, d) + DIRK = FARkodeButcherTable_Alloc(2, 1) call FARKodeButcherTable_Free(DIRK) - DIRK = FARkodeButcherTable_Copy(ERK) + DIRK = FARkodeButcherTable_Copy(ERK) !==== Cleanup ===== call FARKodeButcherTable_Free(ERK) @@ -75,7 +75,6 @@ end function smoke_tests end module - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 index 98d9110884..52ca72d685 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_bbd_f2003.f90 @@ -21,10 +21,46 @@ !----------------------------------------------------------------- module DiagkrybbdData - !--------------------------------------------------------------- - ! Description: - ! Module containing problem-defining parameters. - !--------------------------------------------------------------- + !--------------------------------------------------------------- + ! Description: + ! Module containing problem-defining parameters. + !--------------------------------------------------------------- + + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod + + !======= Declarations ========= + implicit none + + ! With MPI-3 use mpi_f08 is preferred + include "mpif.h" + + save + + ! SUNDIALS simulation context + type(c_ptr) :: sunctx + + ! MPI domain decomposition information + integer, target :: comm ! communicator object + integer :: myid ! MPI process ID + integer :: nprocs ! total number of MPI processes + + ! Problem parameters + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 + integer(c_int64_t), parameter :: nlocal = 10 + integer(c_int64_t) :: neq, mu, ml, mudq, mldq + integer(c_int) :: iPretype + real(c_double) :: alpha + +contains + + !----------------------------------------------------------------- + ! ODE RHS function f(t,y) (implicit). + !----------------------------------------------------------------- + integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -33,473 +69,434 @@ module DiagkrybbdData !======= Declarations ========= implicit none - ! With MPI-3 use mpi_f08 is preferred - include "mpif.h" + ! calling variables + real(c_double), value :: t ! current time + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_ydot ! rhs N_Vector + type(c_ptr) :: user_data ! user-defined data - save + ! pointers to data in SUNDIALS vectors + real(c_double), pointer :: y(:) + real(c_double), pointer :: ydot(:) - ! SUNDIALS simulation context - type(c_ptr) :: sunctx + ! local data + integer :: i - ! MPI domain decomposition information - integer, target :: comm ! communicator object - integer :: myid ! MPI process ID - integer :: nprocs ! total number of MPI processes + !======= Internals ============ - ! Problem parameters - integer(c_int), parameter :: iGStype = 1 - integer(c_int), parameter :: iPretype0 = 1 - integer(c_int64_t), parameter :: nlocal = 10 - integer(c_int64_t) :: neq, mu, ml, mudq, mldq - integer(c_int) :: iPretype - real(c_double) :: alpha + ! Get data arrays from SUNDIALS vectors + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) - contains + ! Initialize ydot to zero + ydot = 0.d0 + ! Fill ydot with rhs function + do i = 1, nlocal + ydot(i) = -alpha*(myid*nlocal + i)*y(i) + end do + retval = 0 ! Return with success + return + end function firhs + !----------------------------------------------------------------- - !----------------------------------------------------------------- - ! ODE RHS function f(t,y) (implicit). - !----------------------------------------------------------------- - integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + !----------------------------------------------------------------- + ! ODE RHS function used for BBD preconditioner. + !----------------------------------------------------------------- + integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & + result(retval) bind(C) - !======= Inclusions =========== - use, intrinsic :: iso_c_binding - use fsundials_core_mod + !======= Inclusions =========== + use, intrinsic :: iso_c_binding + use fsundials_core_mod - !======= Declarations ========= - implicit none + !======= Declarations ========= + implicit none - ! calling variables - real(c_double), value :: t ! current time - type(N_Vector) :: sunvec_y ! solution N_Vector - type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr) :: user_data ! user-defined data + ! calling variables + real(c_double), value :: t ! current time + integer(c_int64_t) :: nnlocal ! local space + type(N_Vector) :: sunvec_y ! solution N_Vector + type(N_Vector) :: sunvec_g ! output g N_Vector + type(c_ptr) :: user_data ! user-defined data - ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: y(:) - real(c_double), pointer :: ydot(:) + ! local data + integer :: ierr - ! local data - integer :: i + ierr = firhs(t, sunvec_y, sunvec_g, user_data) + if (ierr /= 0) then + write (0, *) "Error in firhs user-defined function, ierr = ", ierr + stop 1 + end if - !======= Internals ============ + retval = 0 ! Return with success + return + end function LocalgFn + !----------------------------------------------------------------- - ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) - ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) +end module DiagkrybbdData +!----------------------------------------------------------------- - ! Initialize ydot to zero - ydot = 0.d0 +!----------------------------------------------------------------- +! Main driver program +!----------------------------------------------------------------- +program driver + + ! inclusions + use, intrinsic :: iso_c_binding + use fsundials_core_mod + use fcvode_mod ! Access CVode + use fnvector_parallel_mod ! Access parallel N_Vector + use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + + use DiagkrybbdData + + !======= Declarations ========= + implicit none + + ! Declarations + ! general problem parameters + integer, parameter :: Nt = 10 ! total number of output times + real(c_double), parameter :: T0 = 0.d0 ! initial time + real(c_double), parameter :: Tf = 1.d0 ! final time + real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances + real(c_double), parameter :: atol = 1.d-10 + + ! solution vector and other local variables + type(SUNLinearSolver), pointer :: sunls ! sundials linear solver + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_y ! solution N_Vector + real(c_double), pointer :: y(:) ! vector data + type(c_ptr) :: cvode_mem ! CVODE memory + integer(c_int) :: retval + integer :: ierr + logical :: outproc + real(c_double) :: t(1), dTout, tout + integer(c_long) :: nst(1) ! number of time steps + integer(c_long) :: nfe(1) ! number of RHS evals + integer(c_long) :: netf(1) ! number of error test fails + integer(c_long) :: nni(1) ! number of nonlinear iters + integer(c_long) :: ncfn(1) ! number of nonlinear convergence fails + integer(c_long) :: ncfl(1) ! number of linear convergence fails + integer(c_long) :: nli(1) ! number of linear iters + integer(c_long) :: npre(1) ! number of preconditioner setups + integer(c_long) :: npsol(1) ! number of preconditioner solves + integer(c_long) :: lenrw(1) ! main solver real/int workspace size + integer(c_long) :: leniw(1) + integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size + integer(c_long) :: leniwls(1) + integer(c_long) :: ngebbd(1) ! num g evaluations + double precision :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) + integer(c_long) :: lenrwbbd(1) ! band preconditioner real/int workspace size + integer(c_long) :: leniwbbd(1) + integer :: i, ioutput + real(c_double) :: errmax, erri, gerrmax + + ! Initialize MPI variables + comm = MPI_COMM_WORLD + myid = 0 + nprocs = 0 + + ! initialize MPI + call MPI_Init(ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Init = ", ierr + stop 1 + end if + call MPI_Comm_size(comm, nprocs, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + call MPI_Comm_rank(comm, myid, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Set input arguments neq and alpha + neq = nprocs*nlocal + alpha = 10.0d0 + + ! Create SUNDIALS simulation context, now that comm has been configured + retval = FSUNContext_Create(comm, sunctx) + if (retval /= 0) then + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Initial problem output + outproc = (myid == 0) + if (outproc) then + write (6, *) " " + write (6, *) "Diagonal test problem:"; + write (6, '(A,i4)') " neq = ", neq + write (6, '(A,i4)') " nlocal = ", nlocal + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,es9.2)') " alpha = ", alpha + write (6, *) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write (6, *) " Method is BDF/NEWTON/SPGMR" + write (6, *) " Precond is band-block-diagonal, using CVBBDPRE" + write (6, *) " " + end if + + ! Create solution vector, point at its data, and set initial condition + sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y = 1.d0 + + ! Create the CVode timestepper module + cvode_mem = FCVodeCreate(CV_BDF, sunctx) + if (.not. c_associated(cvode_mem)) then + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) + if (retval /= 0) then + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Tell CVODE to use a SPGMR linear solver. + sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) + if (.not. associated(sunls)) then + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) + end if + + ! Attach the linear solver (with NULL SUNMatrix object) + sunmat_A => null() + retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + if (retval /= 0) then + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + if (retval /= 0) then + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Specify tolerances + retval = FCVodeSStolerances(cvode_mem, rtol, atol) + if (retval /= 0) then + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + mu = 0 + ml = 0 + mudq = 0 + mldq = 0 + retval = FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & + c_funloc(LocalgFn), c_null_funptr) + if (retval /= 0) then + print *, "Error: FCVBBDPrecInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + do iPretype = 1, 2 + + if (iPretype == 2) then + + y = 1.d0 + + retval = FCVodeReInit(cvode_mem, t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FCVodeReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if - ! Fill ydot with rhs function - do i = 1,nlocal - ydot(i) = -alpha * (myid * nlocal + i) * y(i) - end do + retval = FCVBBDPrecReInit(cvode_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error in FCVBBDPrecReInit, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = 0 ! Return with success - return - end function firhs - !----------------------------------------------------------------- + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval + call MPI_Abort(comm, 1, ierr) + end if - !----------------------------------------------------------------- - ! ODE RHS function used for BBD preconditioner. - !----------------------------------------------------------------- - integer(c_int) function LocalgFn(nnlocal, t, sunvec_y, sunvec_g, user_data) & - result(retval) bind(C) + if (outproc) write (6, *) " Preconditioning on right:" - !======= Inclusions =========== - use, intrinsic :: iso_c_binding - use fsundials_core_mod + end if - !======= Declarations ========= - implicit none + if (iPretype == 1 .and. outproc) write (6, *) " Preconditioning on left:" - ! calling variables - real(c_double), value :: t ! current time - integer(c_int64_t) :: nnlocal ! local space - type(N_Vector) :: sunvec_y ! solution N_Vector - type(N_Vector) :: sunvec_g ! output g N_Vector - type(c_ptr) :: user_data ! user-defined data + ! Main time-stepping loop: calls CVode to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0 + dTout + if (outproc) then + write (6, *) " t steps fe" + write (6, *) " --------------------------------" + end if + do ioutput = 1, Nt - ! local data - integer :: ierr + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - ierr = firhs(t, sunvec_y, sunvec_g, user_data) - if (ierr /= 0) then - write(0,*) "Error in firhs user-defined function, ierr = ", ierr - stop 1 + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if - retval = 0 ! Return with success - return - end function LocalgFn - !----------------------------------------------------------------- + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - end module DiagkrybbdData - !----------------------------------------------------------------- + ! print solution stats and update internal time + if (outproc) write (6, '(3x,f10.6,3(3x,i6))') t, nst, nfe + tout = min(tout + dTout, Tf) + end do + if (outproc) then + write (6, *) " --------------------------------" + end if - !----------------------------------------------------------------- - ! Main driver program - !----------------------------------------------------------------- - program driver + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1, nlocal + erri = y(i) - exp(-alpha*(myid*nlocal + i)*t(1)) + errmax = max(errmax, abs(erri)) + end do - ! inclusions - use, intrinsic :: iso_c_binding - use fsundials_core_mod - use fcvode_mod ! Access CVode - use fnvector_parallel_mod ! Access parallel N_Vector - use fsunlinsol_spgmr_mod ! Fortran interface to spgmr SUNLinearSolver + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if - use DiagkrybbdData + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax - !======= Declarations ========= - implicit none + ! Get final statistics + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - ! Declarations - ! general problem parameters - integer, parameter :: Nt = 10 ! total number of output times - real(c_double), parameter :: T0 = 0.d0 ! initial time - real(c_double), parameter :: Tf = 1.d0 ! final time - real(c_double), parameter :: rtol = 1.d-5 ! relative and absolute tolerances - real(c_double), parameter :: atol = 1.d-10 - - ! solution vector and other local variables - type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) - type(N_Vector), pointer :: sunvec_y ! solution N_Vector - real(c_double), pointer :: y(:) ! vector data - type(c_ptr) :: cvode_mem ! CVODE memory - integer(c_int) :: retval - integer :: ierr - logical :: outproc - real(c_double) :: t(1), dTout, tout - integer(c_long) :: nst(1) ! number of time steps - integer(c_long) :: nfe(1) ! number of RHS evals - integer(c_long) :: netf(1) ! number of error test fails - integer(c_long) :: nni(1) ! number of nonlinear iters - integer(c_long) :: ncfn(1) ! number of nonlinear convergence fails - integer(c_long) :: ncfl(1) ! number of linear convergence fails - integer(c_long) :: nli(1) ! number of linear iters - integer(c_long) :: npre(1) ! number of preconditioner setups - integer(c_long) :: npsol(1) ! number of preconditioner solves - integer(c_long) :: lenrw(1) ! main solver real/int workspace size - integer(c_long) :: leniw(1) - integer(c_long) :: lenrwls(1) ! linear solver real/int workspace size - integer(c_long) :: leniwls(1) - integer(c_long) :: ngebbd(1) ! num g evaluations - double precision :: avdim(1) ! avg Krylov subspace dim (NLI/NNI) - integer(c_long) :: lenrwbbd(1) ! band preconditioner real/int workspace size - integer(c_long) :: leniwbbd(1) - integer :: i, ioutput - real(c_double) :: errmax, erri, gerrmax - - ! Initialize MPI variables - comm = MPI_COMM_WORLD - myid = 0 - nprocs = 0 - - ! initialize MPI - call MPI_Init(ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if - call MPI_Comm_size(comm, nprocs, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + + retval = FCVodeGetNumPrecEvals(cvode_mem, npre) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if - call MPI_Comm_rank(comm, myid, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + + retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) end if - ! Set input arguments neq and alpha - neq = nprocs * nlocal - alpha = 10.0d0 + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - ! Create SUNDIALS simulation context, now that comm has been configured - retval = FSUNContext_Create(comm, sunctx) + retval = FCVodeGetNumLinIters(cvode_mem, nli) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ", retval + print *, "Error: FCVodeGetNumLinIters returned ", retval call MPI_Abort(comm, 1, ierr) end if - ! Initial problem output - outproc = (myid == 0) - if (outproc) then - write(6,*) " " - write(6,*) "Diagonal test problem:"; - write(6,'(A,i4)') " neq = " , neq - write(6,'(A,i4)') " nlocal = " , nlocal - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,es9.2)') " alpha = ", alpha - write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" - write(6,*) " Method is BDF/NEWTON/SPGMR" - write(6,*) " Precond is band-block-diagonal, using CVBBDPRE" - write(6,*) " " - endif - - ! Create solution vector, point at its data, and set initial condition - sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) - y = 1.d0 + avdim = dble(nli)/dble(nni) - ! Create the CVode timestepper module - cvode_mem = FCVodeCreate(CV_BDF, sunctx) - if (.not. c_associated(cvode_mem)) then - print *, "Error: FCVodeCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if - retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) + retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) if (retval /= 0) then - print *, "Error: FCVodeInit returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if - ! Tell CVODE to use a SPGMR linear solver. - sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) - if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - call MPI_Abort(comm, 1, ierr) + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if - ! Attach the linear solver (with NULL SUNMatrix object) - sunmat_A => null() - retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) + retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) end if - retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) + retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) end if - ! Specify tolerances - retval = FCVodeSStolerances(cvode_mem, rtol, atol) + retval = FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbd, leniwbbd) if (retval /= 0) then - print *, "Error: FCVodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVBBDPrecGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) end if - mu = 0 - ml = 0 - mudq = 0 - mldq = 0 - retval = FCVBBDPrecInit(cvode_mem, nlocal, mudq, mldq, mu, ml, 0.d0, & - c_funloc(LocalgFn), c_null_funptr) + retval = FCVBBDPrecGetNumGfnEvals(cvode_mem, ngebbd) if (retval /= 0) then - print *, "Error: FCVBBDPrecInit returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVBBDPrecGetNumGfnEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if - do iPretype = 1,2 - - if (iPretype == 2) then - - y = 1.d0 - - retval = FCVodeReInit(cvode_mem, t0, sunvec_y) - if (retval /= 0) then - print *, "Error in FCVodeReInit, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVBBDPrecReInit(cvode_mem, mudq, mldq, 0.d0) - if (retval /= 0) then - print *, "Error in FCVBBDPrecReInit, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - if (outproc) write(6,*) " Preconditioning on right:" - - end if - - if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" - - ! Main time-stepping loop: calls CVode to perform the integration, then - ! prints results. Stops when the final time has been reached - t(1) = T0 - dTout = 0.1d0 - tout = T0+dTout - if (outproc) then - write(6,*) " t steps fe" - write(6,*) " --------------------------------" - end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) - if (retval /= 0) then - print *, "Error: FCVode returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - if (outproc) write(6,'(3x,f10.6,3(3x,i6))') t, nst, nfe - tout = min(tout + dTout, Tf) - - end do - if (outproc) then - write(6,*) " --------------------------------" - end if - - ! Get max. absolute error in the local vector. - errmax = 0.d0 - do i = 1,nlocal - erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) - errmax = max(errmax, abs(erri)) - end do - - ! Get global max. error from MPI_Reduce call. - call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & - 0, comm, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error in MPI_Reduce = ", ierr - call MPI_Abort(comm, 1, ierr) - end if - - ! Print global max. error - if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax - - ! Get final statistics - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumPrecEvals(cvode_mem, npre) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecSolves returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumLinIters(cvode_mem, nli) - if (retval /= 0) then - print *, "Error: FCVodeGetNumLinIters returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - avdim = dble(nli) / dble(nni) - - retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) - if (retval /= 0) then - print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumErrTestFails(cvode_mem, netf) - if (retval /= 0) then - print *, "Error: FCVodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) - if (retval /= 0) then - print *, "Error: FCVodeGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) - if (retval /= 0) then - print *, "Error: FCVodeGetLinWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVBBDPrecGetWorkSpace(cvode_mem, lenrwbbd, leniwbbd) - if (retval /= 0) then - print *, "Error: FCVBBDPrecGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVBBDPrecGetNumGfnEvals(cvode_mem, ngebbd) - if (retval /= 0) then - print *, "Error: FCVBBDPrecGetNumGfnEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Print some final statistics - if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(A,i6)') " Internal solver steps = ", nst - write(6,'(A,i6)') " Total RHS evals = ", nfe - write(6,'(A,i6)') " Total preconditioner setups = ", npre - write(6,'(A,i6)') " Total preconditioner solves = ", npsol - write(6,'(A,i6)') " Total nonlinear iterations = ", nni - write(6,'(A,i6)') " Total linear iterations = ", nli - write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim - write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn - write(6,'(A,i6)') " - Linear = ", ncfl - write(6,'(A,i6)') " Total number of error test failures = ", netf - write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw - write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls - write(6,'(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd - write(6,'(A,i6)') " Total number of g evals = ", ngebbd - write(6,'(A)') " " - write(6,'(A)') " " - write(6,'(A)') " " - end if - end do + ! Print some final statistics + if (outproc) then + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(A,i6)') " Internal solver steps = ", nst + write (6, '(A,i6)') " Total RHS evals = ", nfe + write (6, '(A,i6)') " Total preconditioner setups = ", npre + write (6, '(A,i6)') " Total preconditioner solves = ", npsol + write (6, '(A,i6)') " Total nonlinear iterations = ", nni + write (6, '(A,i6)') " Total linear iterations = ", nli + write (6, '(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write (6, '(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write (6, '(A,i6)') " - Linear = ", ncfl + write (6, '(A,i6)') " Total number of error test failures = ", netf + write (6, '(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write (6, '(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write (6, '(A,2i6)') " BBD preconditioner real/int workspace sizes = ", lenrwbbd, leniwbbd + write (6, '(A,i6)') " Total number of g evals = ", ngebbd + write (6, '(A)') " " + write (6, '(A)') " " + write (6, '(A)') " " + end if + end do - ! Clean up and return with successful completion - call FCVodeFree(cvode_mem) ! free integrator memory - call FN_VDestroy(sunvec_y) ! free vector memory - call MPI_Barrier(comm, ierr) - call MPI_Finalize(ierr) ! Finalize MPI + ! Clean up and return with successful completion + call FCVodeFree(cvode_mem) ! free integrator memory + call FN_VDestroy(sunvec_y) ! free vector memory + call MPI_Barrier(comm, ierr) + call MPI_Finalize(ierr) ! Finalize MPI - end program driver - !----------------------------------------------------------------- +end program driver +!----------------------------------------------------------------- diff --git a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 index 38cf788bdc..2a8ca17ca1 100644 --- a/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_kry_f2003.f90 @@ -47,8 +47,8 @@ module DiagkryData integer :: nprocs ! total number of MPI processes ! Problem parameters - integer(c_int), parameter :: iGStype = 1 - integer(c_int), parameter :: iPretype0 = 1 + integer(c_int), parameter :: iGStype = 1 + integer(c_int), parameter :: iPretype0 = 1 integer(c_int64_t), parameter :: nlocal = 10 integer(c_int64_t) :: neq integer(c_int) :: iPretype @@ -60,7 +60,7 @@ module DiagkryData ! ODE RHS function f(t,y) (implicit). ! ---------------------------------------------------------------- integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -73,7 +73,7 @@ integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(nlocal) :: y(:) @@ -85,15 +85,15 @@ integer(c_int) function firhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) ! Initialize ydot to zero ydot = 0.d0 ! Fill ydot with rhs function - do i = 1,nlocal - ydot(i) = -alpha * (myid * nlocal + i) * y(i) + do i = 1, nlocal + ydot(i) = -alpha*(myid*nlocal + i)*y(i) end do retval = 0 ! Return with success @@ -110,7 +110,7 @@ end function firhs ! local vector segment) is applied to the vector z. ! ---------------------------------------------------------------- integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & - gamma, delta, lr, user_data) result(retval) bind(C) + gamma, delta, lr, user_data) result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -128,7 +128,7 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & real(c_double), value :: gamma ! current gamma value real(c_double), value :: delta ! current delta value integer(c_int), value :: lr ! left or right preconditioning - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(nlocal) :: z(:) @@ -148,12 +148,12 @@ integer(c_int) function Psolve(t, sunvec_y, sunvec_f, sunvec_r, sunvec_z, & z = r ! Calculate Jacobian here - ibase = myid * nlocal + ibase = myid*nlocal istart = max(1_c_int64_t, 4 - ibase) - do i = istart,nlocal - pj = dble(ibase + i) - psubi = 1.d0 + gamma * alpha * pj - z(i) = z(i) / psubi + do i = istart, nlocal + pj = dble(ibase + i) + psubi = 1.d0 + gamma*alpha*pj + z(i) = z(i)/psubi end do retval = 0 ! Return with success @@ -164,7 +164,6 @@ end function Psolve end module DiagkryData ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -224,47 +223,47 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Set input arguments neq and alpha - neq = nprocs * nlocal + neq = nprocs*nlocal alpha = 10.0d0 ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "Diagonal test problem:"; - write(6,'(A,i4)') " neq = " , neq - write(6,'(A,i4)') " nlocal = " , nlocal - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,es9.2)') " alpha = ", alpha - write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" - write(6,*) " Method is BDF/NEWTON/SPGMR" - write(6,*) " Diagonal preconditioner uses approximate Jacobian" - write(6,*) " " - endif + write (6, *) " " + write (6, *) "Diagonal test problem:"; + write (6, '(A,i4)') " neq = ", neq + write (6, '(A,i4)') " nlocal = ", nlocal + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,es9.2)') " alpha = ", alpha + write (6, *) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write (6, *) " Method is BDF/NEWTON/SPGMR" + write (6, *) " Diagonal preconditioner uses approximate Jacobian" + write (6, *) " " + end if ! Create solution vector, point at its data, and set initial condition sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) @@ -274,220 +273,220 @@ program driver ! Create the CVode timestepper module cvode_mem = FCVodeCreate(CV_BDF, sunctx) if (.not. c_associated(cvode_mem)) then - print *, "Error: FCVodeCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeInit(cvode_mem, c_funloc(firhs), t0, sunvec_y) if (retval /= 0) then - print *, "Error: FCVodeInit returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Tell CVODE to use a SPGMR linear solver. sunls => FSUNLinSol_SPGMR(sunvec_y, iPretype0, 0, sunctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - call MPI_Abort(comm, 1, ierr) + print *, 'ERROR: sunls = NULL' + call MPI_Abort(comm, 1, ierr) end if ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() retval = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if retval = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FCVodeSStolerances(cvode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FCVodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeSetPreconditioner(cvode_mem, c_null_funptr, c_funloc(Psolve)) if (retval /= 0) then - print *, "Error: FCVodeSetPreconditioner returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeSetPreconditioner returned ", retval + call MPI_Abort(comm, 1, ierr) end if - do iPretype = 1,2 - - if (iPretype == 2) then - - y = 1.d0 - - retval = FCVodeReInit(cvode_mem, t0, sunvec_y) - if (retval /= 0) then - print *, "Error in FCVodeReInit, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) - if (retval /= 0) then - print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval - call MPI_Abort(comm, 1, ierr) - end if - - if (outproc) write(6,*) " Preconditioning on right:" - - end if - - if (iPretype == 1 .and. outproc) write(6,*) " Preconditioning on left:" - - ! Main time-stepping loop: calls CVode to perform the integration, then - ! prints results. Stops when the final time has been reached - t(1) = T0 - dTout = 0.1d0 - tout = T0+dTout - if (outproc) then - write(6,*) " t steps fe" - write(6,*) " --------------------------------" - end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) - if (retval /= 0) then - print *, "Error: FCVode returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - if (outproc) write(6,'(3x,f10.6,3(3x,i6))') t, nst, nfe - tout = min(tout + dTout, Tf) - - end do - if (outproc) then - write(6,*) " --------------------------------" - end if - - ! Get max. absolute error in the local vector. - errmax = 0.d0 - do i = 1,nlocal - erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) - errmax = max(errmax, abs(erri)) - end do - - ! Get global max. error from MPI_Reduce call. - call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & - 0, comm, ierr) - if (ierr /= MPI_SUCCESS) then - print *, "Error in MPI_Reduce = ", ierr - call MPI_Abort(comm, 1, ierr) - end if + do iPretype = 1, 2 - ! Print global max. error - if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + if (iPretype == 2) then - ! Get final statistics - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + y = 1.d0 - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval + retval = FCVodeReInit(cvode_mem, t0, sunvec_y) + if (retval /= 0) then + print *, "Error in FCVodeReInit, retval = ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumPrecEvals(cvode_mem, npre) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecEvals returned ", retval + retval = FSUNLinSol_SPGMRSetPrecType(sunls, iPretype) + if (retval /= 0) then + print *, "Error in FSUNLinSol_SPGMRSetPrecType, retval = ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) - if (retval /= 0) then - print *, "Error: FCVodeGetNumPrecSolves returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + if (outproc) write (6, *) " Preconditioning on right:" - retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumLinIters(cvode_mem, nli) - if (retval /= 0) then - print *, "Error: FCVodeGetNumLinIters returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + if (iPretype == 1 .and. outproc) write (6, *) " Preconditioning on left:" - avdim = dble(nli) / dble(nni) + ! Main time-stepping loop: calls CVode to perform the integration, then + ! prints results. Stops when the final time has been reached + t(1) = T0 + dTout = 0.1d0 + tout = T0 + dTout + if (outproc) then + write (6, *) " t steps fe" + write (6, *) " --------------------------------" + end if + do ioutput = 1, Nt - retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) - if (retval /= 0) then - print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) - if (retval /= 0) then - print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetNumErrTestFails(cvode_mem, netf) - if (retval /= 0) then - print *, "Error: FCVodeGetNumErrTestFails returned ", retval + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) - end if + end if - retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) - if (retval /= 0) then - print *, "Error: FCVodeGetWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if + ! print solution stats and update internal time + if (outproc) write (6, '(3x,f10.6,3(3x,i6))') t, nst, nfe + tout = min(tout + dTout, Tf) - retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) - if (retval /= 0) then - print *, "Error: FCVodeGetLinWorkSpace returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Print some final statistics - if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(A,i6)') " Internal solver steps = ", nst - write(6,'(A,i6)') " Total RHS evals = ", nfe - write(6,'(A,i6)') " Total preconditioner setups = ", npre - write(6,'(A,i6)') " Total preconditioner solves = ", npsol - write(6,'(A,i6)') " Total nonlinear iterations = ", nni - write(6,'(A,i6)') " Total linear iterations = ", nli - write(6,'(A,f8.4)') " Average Krylov subspace dimension = ", avdim - write(6,'(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn - write(6,'(A,i6)') " - Linear = ", ncfl - write(6,'(A,i6)') " Total number of error test failures = ", netf - write(6,'(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw - write(6,'(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls - write(6,'(A)') " " - write(6,'(A)') " " - write(6,'(A)') " " - end if + end do + if (outproc) then + write (6, *) " --------------------------------" + end if + + ! Get max. absolute error in the local vector. + errmax = 0.d0 + do i = 1, nlocal + erri = y(i) - exp(-alpha*(myid*nlocal + i)*t(1)) + errmax = max(errmax, abs(erri)) + end do + + ! Get global max. error from MPI_Reduce call. + call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & + 0, comm, ierr) + if (ierr /= MPI_SUCCESS) then + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) + end if + + ! Print global max. error + if (outproc) print '(a,es10.2)', "Max. absolute error is ", gerrmax + + ! Get final statistics + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecEvals(cvode_mem, npre) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumPrecSolves(cvode_mem, npsol) + if (retval /= 0) then + print *, "Error: FCVodeGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nni) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinIters(cvode_mem, nli) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + avdim = dble(nli)/dble(nni) + + retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncfn) + if (retval /= 0) then + print *, "Error: FCVodeGetNumNonlinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumLinConvFails(cvode_mem, ncfl) + if (retval /= 0) then + print *, "Error: FCVodeGetNumLinSolvConvFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumErrTestFails(cvode_mem, netf) + if (retval /= 0) then + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) + if (retval /= 0) then + print *, "Error: FCVodeGetWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) + if (retval /= 0) then + print *, "Error: FCVodeGetLinWorkSpace returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(A,i6)') " Internal solver steps = ", nst + write (6, '(A,i6)') " Total RHS evals = ", nfe + write (6, '(A,i6)') " Total preconditioner setups = ", npre + write (6, '(A,i6)') " Total preconditioner solves = ", npsol + write (6, '(A,i6)') " Total nonlinear iterations = ", nni + write (6, '(A,i6)') " Total linear iterations = ", nli + write (6, '(A,f8.4)') " Average Krylov subspace dimension = ", avdim + write (6, '(A,i6)') " Total Convergence Failures - Nonlinear = ", ncfn + write (6, '(A,i6)') " - Linear = ", ncfl + write (6, '(A,i6)') " Total number of error test failures = ", netf + write (6, '(A,2i6)') " Main solver real/int workspace sizes = ", lenrw, leniw + write (6, '(A,2i6)') " Linear solver real/int workspace sizes = ", lenrwls, leniwls + write (6, '(A)') " " + write (6, '(A)') " " + write (6, '(A)') " " + end if end do ! Clean up and return with successful completion diff --git a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 index 8f200c90c7..bea02183c3 100644 --- a/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 +++ b/examples/cvode/F2003_parallel/cv_diag_non_p_f2003.f90 @@ -55,7 +55,7 @@ module DiagnonData ! ODE RHS function f(t,y). ! ---------------------------------------------------------------- integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & - result(retval) bind(C) + result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -68,7 +68,7 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(nlocal) :: y(:) @@ -80,15 +80,15 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) + y(1:nlocal) => FN_VGetArrayPointer(sunvec_y) ydot(1:nlocal) => FN_VGetArrayPointer(sunvec_ydot) ! Initialize ydot to zero ydot = 0.d0 ! Fill ydot with rhs function - do i = 1,nlocal - ydot(i) = -alpha * (myid * nlocal + i) * y(i) + do i = 1, nlocal + ydot(i) = -alpha*(myid*nlocal + i)*y(i) end do retval = 0 ! Return with success @@ -96,11 +96,9 @@ integer(c_int) function frhs(t, sunvec_y, sunvec_ydot, user_data) & end function frhs ! ---------------------------------------------------------------- - end module DiagnonData ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Main driver program ! ---------------------------------------------------------------- @@ -149,46 +147,46 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Set input arguments neq and alpha - neq = nprocs * nlocal - alpha = 10.0d0 / neq + neq = nprocs*nlocal + alpha = 10.0d0/neq ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "Diagonal test problem:"; - write(6,'(A,i4)') " neq = " , neq - write(6,'(A,i4)') " nlocal = " , nlocal - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,es9.2)') " alpha = ", alpha - write(6,*) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" - write(6,*) " Method is ADAMS/FIXED-POINT" - write(6,*) " " - endif + write (6, *) " " + write (6, *) "Diagonal test problem:"; + write (6, '(A,i4)') " neq = ", neq + write (6, '(A,i4)') " nlocal = ", nlocal + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,es9.2)') " alpha = ", alpha + write (6, *) " ydot_i = -alpha*i * y_i (i = 1,...,neq)" + write (6, *) " Method is ADAMS/FIXED-POINT" + write (6, *) " " + end if ! Create solution vector, point at its data, and set initial condition sunvec_y => FN_VNew_Parallel(comm, nlocal, neq, sunctx) @@ -198,88 +196,88 @@ program driver ! Create and Initialize the CVode timestepper module cvode_mem = FCVodeCreate(CV_ADAMS, sunctx) if (.not. c_associated(cvode_mem)) then - print *, "Error: FCVodeCreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeCreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeInit(cvode_mem, c_funloc(frhs), t0, sunvec_y) if (retval /= 0) then - print *, "Error: FCVodeInit returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeInit returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Assign and Setup SUNDIALS Nonlinear solver sunnls => FSUNNonlinSol_FixedPoint(sunvec_y, 0, sunctx) if (.not. associated(sunnls)) then - print *, 'ERROR: sunnls = NULL' - call MPI_Abort(comm, 1, ierr) + print *, 'ERROR: sunnls = NULL' + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeSetNonlinearSolver(cvode_mem, sunnls) if (retval /= 0) then - print *, 'Error in FCVodeSetNonlinearSolver, retval = ', retval - call MPI_Abort(comm, 1, ierr) + print *, 'Error in FCVodeSetNonlinearSolver, retval = ', retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FCVodeSStolerances(cvode_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FCVodeSStolerances returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeSStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Main time-stepping loop: calls CVode to perform the integration, then ! prints results. Stops when the final time has been reached t(1) = T0 dTout = 0.1d0 - tout = T0+dTout + tout = T0 + dTout if (outproc) then - write(6,*) " t steps fe" - write(6,*) " ----------------------------" + write (6, *) " t steps fe" + write (6, *) " ----------------------------" end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) - if (retval /= 0) then - print *, "Error: FCVode returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumSteps(cvode_mem, nst) - if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) - if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) - end if - - ! print solution stats and update internal time - if (outproc) write(6,'(3x,f10.6,2(3x,i5))') t, nst, nfe - tout = min(tout + dTout, Tf) + do ioutput = 1, Nt + + ! Integrate to output time + retval = FCVode(cvode_mem, tout, sunvec_y, t, CV_NORMAL) + if (retval /= 0) then + print *, "Error: FCVode returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumSteps(cvode_mem, nst) + if (retval /= 0) then + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) + if (retval /= 0) then + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + if (outproc) write (6, '(3x,f10.6,2(3x,i5))') t, nst, nfe + tout = min(tout + dTout, Tf) end do if (outproc) then - write(6,*) " --------------------------------" + write (6, *) " --------------------------------" end if ! Get max. absolute error in the local vector. errmax = 0.d0 - do i = 1,nlocal - erri = y(i) - exp(-alpha * (myid * nlocal + i) * t(1)) - errmax = max(errmax, abs(erri)) + do i = 1, nlocal + erri = y(i) - exp(-alpha*(myid*nlocal + i)*t(1)) + errmax = max(errmax, abs(erri)) end do ! Get global max. error from MPI_Reduce call. call MPI_Reduce(errmax, gerrmax, 1, MPI_DOUBLE, MPI_MAX, & - 0, comm, ierr) + 0, comm, ierr) if (ierr /= MPI_SUCCESS) then - print *, "Error in MPI_Reduce = ", ierr - call MPI_Abort(comm, 1, ierr) + print *, "Error in MPI_Reduce = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Print global max. error @@ -288,30 +286,30 @@ program driver ! Get final statistics retval = FCVodeGetNumSteps(cvode_mem, nst) if (retval /= 0) then - print *, "Error: FCVodeGetNumSteps returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (retval /= 0) then - print *, "Error: FCVodeGetNumRhsEvals returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FCVodeGetNumErrTestFails(cvode_mem, netf) if (retval /= 0) then - print *, "Error: FCVodeGetNumErrTestFails returned ", retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FCVodeGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Print some final statistics if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(A,i6)') " Internal solver steps = ", nst - write(6,'(A,i6)') " Total RHS evals = ", nfe - write(6,'(A,i6)') " Total number of error test failures = ", netf - endif + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(A,i6)') " Internal solver steps = ", nst + write (6, '(A,i6)') " Total RHS evals = ", nfe + write (6, '(A,i6)') " Total number of error test failures = ", netf + end if ! Clean up and return with successful completion call FCVodeFree(cvode_mem) ! free integrator memory diff --git a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 index 423ef44f12..32ca2ead64 100644 --- a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.f90 @@ -60,11 +60,11 @@ module advdiff_mod ! ODE constant parameters real(c_double), parameter :: xmax = 2.0d0, ymax = 1.0d0 real(c_double), parameter :: dtout = 0.1d0 - real(c_double), parameter :: dx = xmax / (mx + 1) - real(c_double), parameter :: dy = ymax / (my + 1) - real(c_double), parameter :: hdcoef = 1.0d0 / (dx * dx) - real(c_double), parameter :: hacoef = 0.5d0 / (2.0d0 * dx) - real(c_double), parameter :: vdcoef = 1.0d0 / (dy * dy) + real(c_double), parameter :: dx = xmax/(mx + 1) + real(c_double), parameter :: dy = ymax/(my + 1) + real(c_double), parameter :: hdcoef = 1.0d0/(dx*dx) + real(c_double), parameter :: hacoef = 0.5d0/(2.0d0*dx) + real(c_double), parameter :: vdcoef = 1.0d0/(dy*dy) ! Solving assistance fixed parameters real(c_double), parameter :: rtol = 0.0d0 @@ -87,7 +87,7 @@ module advdiff_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -99,43 +99,43 @@ integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data real(c_double) :: uij, udn, uup, ult, urt, hdiff, hadv, vdiff ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(mx,my) :: uvec(:,:) - real(c_double), pointer, dimension(mx,my) :: fvec(:,:) + real(c_double), pointer, dimension(mx, my) :: uvec(:, :) + real(c_double), pointer, dimension(mx, my) :: fvec(:, :) !======= Internals ============ ! get data arrays from SUNDIALS vectors - uvec(1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) - fvec(1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + uvec(1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) + fvec(1:mx, 1:my) => FN_VGetArrayPointer(sunvec_f) ! Loop over all grid points do i = 1, mx - do j = 1, my - - ! Extract u at x_i, y_j and four neighboring points. - uij = uvec(i,j) - udn = 0.0d0 - if (j .ne. 1) udn = uvec(i, j-1) - uup = 0.0d0 - if (j .ne. my) uup = uvec(i, j+1) - ult = 0.0d0 - if (i .ne. 1) ult = uvec(i-1, j) - urt = 0.0d0 - if (i .ne. mx) urt = uvec(i+1, j) - - ! Set diffusion and advection terms and load into fvec. - hdiff = hdcoef * (ult - 2.0d0 * uij + urt) - hadv = hacoef * (urt - ult) - vdiff = vdcoef * (uup - 2.0d0 * uij + udn) - fvec(i,j) = hdiff + hadv + vdiff - - end do + do j = 1, my + + ! Extract u at x_i, y_j and four neighboring points. + uij = uvec(i, j) + udn = 0.0d0 + if (j /= 1) udn = uvec(i, j - 1) + uup = 0.0d0 + if (j /= my) uup = uvec(i, j + 1) + ult = 0.0d0 + if (i /= 1) ult = uvec(i - 1, j) + urt = 0.0d0 + if (i /= mx) urt = uvec(i + 1, j) + + ! Set diffusion and advection terms and load into fvec. + hdiff = hdcoef*(ult - 2.0d0*uij + urt) + hadv = hacoef*(urt - ult) + vdiff = vdcoef*(uup - 2.0d0*uij + udn) + fvec(i, j) = hdiff + hadv + vdiff + + end do end do ! return success @@ -155,8 +155,8 @@ end function RhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function JacFn(t, sunvec_u, sunvec_f, sunmat_J, & - user_data, sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) & - bind(C,name='JacFn') + user_data, sunvec_t1, sunvec_t2, sunvec_t3) result(ierr) & + bind(C, name='JacFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -170,7 +170,7 @@ integer(c_int) function JacFn(t, sunvec_u, sunvec_f, sunmat_J, & type(N_Vector) :: sunvec_u type(N_Vector) :: sunvec_f type(SUNMatrix) :: sunmat_J - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data type(N_Vector) :: sunvec_t1 type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 @@ -178,31 +178,31 @@ integer(c_int) function JacFn(t, sunvec_u, sunvec_f, sunmat_J, & ! local data integer(kind=myindextype) :: mband, k, ioff, mu1, mu2, smu, mdim integer(kind=myindextype) :: start - real(c_double), pointer, dimension(mdim,neq) :: Jmat(:,:) + real(c_double), pointer, dimension(mdim, neq) :: Jmat(:, :) smu = FSUNBandMatrix_StoredUpperBandwidth(sunmat_J) mdim = smu + 1 + ml - Jmat(1:mdim,1:neq) => FSUNBandMatrix_Data(sunmat_J) + Jmat(1:mdim, 1:neq) => FSUNBandMatrix_Data(sunmat_J) mu1 = smu + 1 mu2 = smu + 2 mband = smu + 1 + ml - start = smu-mu+1 + start = smu - mu + 1 ! Loop over all grid points do i = 1, mx - ioff = (i - 1) * my - do j = 1, my - k = j + ioff - - ! Set Jacobian elements in column k of J. - Jmat(mu1,k) = -2.0d0 * (vdcoef + hdcoef) - if (i /= 1) Jmat(start,k) = hdcoef + hacoef - if (i /= mx) Jmat(mband,k) = hdcoef - hacoef - if (j /= 1) Jmat(smu,k) = vdcoef - if (j /= my) Jmat(mu2,k) = vdcoef - - end do + ioff = (i - 1)*my + do j = 1, my + k = j + ioff + + ! Set Jacobian elements in column k of J. + Jmat(mu1, k) = -2.0d0*(vdcoef + hdcoef) + if (i /= 1) Jmat(start, k) = hdcoef + hacoef + if (i /= mx) Jmat(mband, k) = hdcoef - hacoef + if (j /= 1) Jmat(smu, k) = vdcoef + if (j /= my) Jmat(mu2, k) = vdcoef + + end do end do ! return success @@ -215,7 +215,6 @@ end function JacFn end module advdiff_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -238,11 +237,11 @@ program main integer(c_int) :: ierr ! error flag from C functions integer(c_long) :: outstep ! output step - type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(c_ptr) :: cvode_mem ! CVODE memory - real(c_double), pointer, dimension(mx,my) :: u(:,:) ! underlying vector + real(c_double), pointer, dimension(mx, my) :: u(:, :) ! underlying vector ! output statistic variables integer(c_long) :: lnst(1) @@ -254,67 +253,67 @@ program main ! initialize ODE tstart = 0.0d0 - tcur = tstart + tcur = tstart mu = my ml = my ! create SUNDIALS N_Vector sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - u(1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + u(1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) ! initialize and fill initial condition vector do i = 1, mx - x = i * dx - do j = 1, my - y = j * dy - u(i,j) = x * (xmax - x) * y * (ymax - y) * exp(5.0d0 * x * y) - end do + x = i*dx + do j = 1, my + y = j*dy + u(i, j) = x*(xmax - x)*y*(ymax - y)*exp(5.0d0*x*y) + end do end do ! create and initialize CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) - if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! Tell CVODE to use a Band linear solver. sunmat_A => FSUNBandMatrix(neq, mu, ml, ctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if sunls => FSUNLinSol_Band(sunvec_u, sunmat_A, ctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ! Attach the linear solver (with NULL SUNMatrix object) ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSetJacFn(cvode_mem, c_funloc(JacFn)) if (ierr /= 0) then - print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' + stop 1 end if ! Start time stepping @@ -333,25 +332,25 @@ program main tout = dtout do outstep = 1, 10 - ! call CVode - ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' - stop 1 - end if + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if - ierr = FCVodeGetNumSteps(cvode_mem, lnst) - if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 - end if + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if - ! print current solution and output statistics - unorm = maxval(abs(u)) - print '(2x,f6.2,2x,es14.6,2x,i5)', tcur, unorm, lnst + ! print current solution and output statistics + unorm = maxval(abs(u)) + print '(2x,f6.2,2x,es14.6,2x,i5)', tcur, unorm, lnst - ! update tout - tout = tout + dtout + ! update tout + tout = tout + dtout end do print *, ' ------------------------------' @@ -399,55 +398,55 @@ subroutine CVodeStats(cvode_mem) ierr = FCVodeGetNumSteps(cvode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumLinIters(cvode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function call =',nfe - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num linear solver iters =',nliters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf - print '(4x,A,i9)' ,'Num linear solver fails =',ncfl + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function call =', nfe + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num linear solver iters =', nliters + print '(4x,A,i9)', 'Num nonlinear solver fails =', ncf + print '(4x,A,i9)', 'Num linear solver fails =', ncfl print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 index 83c8a46598..3135171b42 100644 --- a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 @@ -51,12 +51,11 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -77,7 +76,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0+tn*tn) - lamda*atan(tn) + fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn) ! return success ierr = 0 @@ -87,7 +86,6 @@ end function RhsFn end module ode_mod - program main !======= Inclusions =========== @@ -126,11 +124,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = 1.0d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = 1.0d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 0.0d0 @@ -138,22 +136,22 @@ program main ! create SUNDIALS N_Vector sunvec_y => FN_VMake_Serial(neq, yvec, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create CVode memory cvode_mem = FCVodeCreate(CV_ADAMS, ctx) if (.not. c_associated(cvode_mem)) then - print *, 'ERROR: cvode_mem = NULL' - stop 1 + print *, 'ERROR: cvode_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -162,15 +160,15 @@ program main ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! create fixed point nonlinear solver object sunnls => FSUNNonlinSol_FixedPoint(sunvec_y, 0, ctx) if (.not. associated(sunnls)) then - print *,'ERROR: sunnls = NULL' - stop 1 + print *, 'ERROR: sunnls = NULL' + stop 1 end if ! attache nonlinear solver object to CVode @@ -187,20 +185,20 @@ program main print *, ' t y ' print *, '----------------------------' print '(2x,2(es12.5,1x))', tcur, yvec(1) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - enddo + end do ! diagnostics output call CVodeStats(cvode_mem) @@ -213,7 +211,6 @@ program main end program main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -252,33 +249,33 @@ subroutine CVodeStats(cvode_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 index 9302d65408..541f0433e0 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 @@ -71,7 +71,7 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -83,14 +83,14 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yvec(:) real(c_double), pointer :: fvec(:) ! ODE system matrix - real(c_double) :: Amat(neq,neq) + real(c_double) :: Amat(neq, neq) !======= Internals ============ @@ -99,11 +99,11 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill A matrix (column major ordering) - Amat = reshape([& - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0 ], & - [3,3]) + Amat = reshape([ & + lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + [3, 3]) ! fill RHS vector f(t,y) = A*y fvec = matmul(Amat, yvec(1:neq)) @@ -116,7 +116,6 @@ end function RhsFn end module ode_mod - program main !======= Inclusions =========== @@ -144,8 +143,8 @@ program main integer :: outstep ! output loop counter - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: ctx ! SUNDIALS simulation context type(c_ptr) :: cvode_mem ! CVODE memory @@ -157,11 +156,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 0.05d0 - tcur = tstart - tout = tstart - dtout = 0.005d0 - nout = ceiling(tend/dtout) + tend = 0.05d0 + tcur = tstart + tout = tstart + dtout = 0.005d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 1.0d0 @@ -174,36 +173,36 @@ program main ! create a serial vector sunvec_y => FN_VMake_Serial(neq, yvec, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create a dense matrix sunmat_A => FSUNDenseMatrix(neq, neq, ctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! create a dense linear solver sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, ctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! create CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) if (.not. c_associated(cvode_mem)) then - print *, 'ERROR: cvode_mem = NULL' - stop 1 + print *, 'ERROR: cvode_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -212,15 +211,15 @@ program main ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! attach linear solver - ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! start time stepping @@ -230,20 +229,20 @@ program main print *, ' t y1 y2 y3 ' print *, '------------------------------------------------------' print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + ! output current solution + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - enddo + end do ! diagnostics output call CVodeStats(cvode_mem) @@ -257,7 +256,6 @@ program main end program main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -298,41 +296,41 @@ subroutine CVodeStats(cvode_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if ! number of Jacobian evaluations ierr = FCVodeGetNumJacEvals(cvode_mem, njevals) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails - print '(4x,A,i9)' ,'Num Jacobian evaluations =',njevals + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails + print '(4x,A,i9)', 'Num Jacobian evaluations =', njevals print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 index bf79b5bde6..fa55dda7d9 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 @@ -71,12 +71,11 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -84,14 +83,14 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yvec(:) real(c_double), pointer :: fvec(:) ! ODE system matrix - real(c_double) :: Amat(neq,neq) + real(c_double) :: Amat(neq, neq) !======= Internals ============ @@ -100,11 +99,11 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill A matrix (column major ordering) - Amat = reshape([& - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0 ], & - [3,3]) + Amat = reshape([ & + lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + [3, 3]) ! fill RHS vector f(t,y) = A*y fvec = matmul(Amat, yvec(1:neq)) @@ -115,7 +114,6 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & end function RhsFn - ! ---------------------------------------------------------------- ! JacFn: The Jacobian of the ODE hand side function J = df/dy ! @@ -125,15 +123,14 @@ end function RhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & - user_data, tmp1, tmp2, tmp3) & - result(ierr) bind(C,name='JacFn') + user_data, tmp1, tmp2, tmp3) & + result(ierr) bind(C, name='JacFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod - !======= Declarations ========= implicit none @@ -154,10 +151,10 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & Jmat => FSUNDenseMatrix_Data(sunmat_J) ! fill J matrix (column major ordering) - Jmat = & - [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0,& - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0,& - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] + Jmat = & + [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] ! return success ierr = 0 @@ -167,7 +164,6 @@ end function JacFn end module ode_mod - program main !======= Inclusions =========== @@ -197,8 +193,8 @@ program main type(c_ptr) :: ctx ! sundials simulation context type(c_ptr) :: cvode_mem ! CVODE memory - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver ! solution vector, neq is set in the ode_mod module @@ -208,11 +204,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 0.05d0 - tcur = tstart - tout = tstart - dtout = 0.005d0 - nout = ceiling(tend/dtout) + tend = 0.05d0 + tcur = tstart + tout = tstart + dtout = 0.005d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 1.0d0 @@ -225,36 +221,36 @@ program main ! create SUNDIALS N_Vector sunvec_y => FN_VMake_Serial(neq, yvec, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create a dense matrix sunmat_A => FSUNDenseMatrix(neq, neq, ctx) if (.not. associated(sunmat_A)) then - print *,'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! create a dense linear solver sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, ctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! create CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) if (.not. c_associated(cvode_mem)) then - print *, 'ERROR: cvode_mem = NULL' - stop 1 + print *, 'ERROR: cvode_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -263,22 +259,22 @@ program main ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! attach linear solver - ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! set Jacobian routine ierr = FCVodeSetJacFn(cvode_mem, c_funloc(JacFn)) if (ierr /= 0) then - print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' + stop 1 end if ! start time stepping @@ -288,20 +284,20 @@ program main print *, ' t y1 y2 y3 ' print *, '------------------------------------------------------' print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + ! output current solution + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - enddo + end do ! diagnostics output call CVodeStats(cvode_mem) @@ -315,7 +311,6 @@ program main end program main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -356,41 +351,41 @@ subroutine CVodeStats(cvode_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if ! number of Jacobian evaluations ierr = FCVodeGetNumJacEvals(cvode_mem, njevals) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails - print '(4x,A,i9)' ,'Num Jacobian evaluations =',njevals + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails + print '(4x,A,i9)', 'Num Jacobian evaluations =', njevals print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 index f4360ff1c7..33fd2ad507 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 @@ -71,12 +71,11 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -84,14 +83,14 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yvec(:) real(c_double), pointer :: fvec(:) ! ODE system matrix - real(c_double) :: Amat(neq,neq) + real(c_double) :: Amat(neq, neq) !======= Internals ============ @@ -100,11 +99,11 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill A matrix (column major ordering) - Amat = reshape([& - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0 ], & - [3,3]) + Amat = reshape([ & + lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + [3, 3]) ! fill RHS vector f(t,y) = A*y fvec = matmul(Amat, yvec(1:neq)) @@ -124,15 +123,14 @@ end function RhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & - user_data, tmp1, tmp2, tmp3) & - result(ierr) bind(C,name='JacFn') + user_data, tmp1, tmp2, tmp3) & + result(ierr) bind(C, name='JacFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsunmatrix_sparse_mod - !======= Declarations ========= implicit none @@ -147,7 +145,7 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & ! pointer to data in SUNDIALS matrix integer(c_int64_t), pointer :: Jidxptr(:) integer(c_int64_t), pointer :: Jidxval(:) - real(c_double), pointer :: Jmat(:) + real(c_double), pointer :: Jmat(:) !======= Internals ============ @@ -159,11 +157,10 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & Jmat => FSUNSparseMatrix_Data(sunmat_J) ! fill J matrix (column major ordering) - Jmat = & - [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0,& - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0,& - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] - + Jmat = & + [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & + lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] Jidxptr = [0, 3, 6, 9] Jidxval = [0, 1, 2, 0, 1, 2, 0, 1, 2] @@ -176,7 +173,6 @@ end function JacFn end module ode_mod - program main !======= Inclusions =========== @@ -205,8 +201,8 @@ program main integer :: outstep ! output loop counter - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: cvode_mem ! CVODE memory @@ -218,11 +214,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 0.05d0 - tcur = tstart - tout = tstart - dtout = 0.005d0 - nout = ceiling(tend/dtout) + tend = 0.05d0 + tcur = tstart + tout = tstart + dtout = 0.005d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 1.0d0 @@ -231,43 +227,43 @@ program main ierr = FSUNContext_Create(SUN_COMM_NULL, sunctx) if (ierr /= 0) then - print *, 'ERROR: FSUNContext_Create returned non-zero' - stop 1 + print *, 'ERROR: FSUNContext_Create returned non-zero' + stop 1 end if ! create a serial vector sunvec_y => FN_VMake_Serial(neq, yvec, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create a sparse matrix sunmat_A => FSUNSparseMatrix(neq, neq, neq*neq, CSC_MAT, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! create a klu linear solver sunlinsol_LS => FSUNLinSol_KLU(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! create CVode memory cvode_mem = FCVodeCreate(CV_BDF, sunctx) if (.not. c_associated(cvode_mem)) then - print *, 'ERROR: cvode_mem = NULL' - stop 1 + print *, 'ERROR: cvode_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -276,22 +272,22 @@ program main ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! attach linear solver ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! set Jacobian routine ierr = FCVodeSetJacFn(cvode_mem, c_funloc(JacFn)) if (ierr /= 0) then - print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' + stop 1 end if ! start time stepping @@ -301,20 +297,20 @@ program main print *, ' t y1 y2 y3 ' print *, '------------------------------------------------------' print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + ! output current solution + print '(2x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - enddo + end do ! diagnostics output call CVodeStats(cvode_mem) @@ -328,7 +324,6 @@ program main end program main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -369,41 +364,41 @@ subroutine CVodeStats(cvode_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if ! number of Jacobian evaluations ierr = FCVodeGetNumJacEvals(cvode_mem, njevals) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails - print '(4x,A,i9)' ,'Num Jacobian evaluations =',njevals + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails + print '(4x,A,i9)', 'Num Jacobian evaluations =', njevals print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 index 33ef0b610c..6bf52b7901 100644 --- a/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_brusselator_dns_f2003.f90 @@ -41,8 +41,8 @@ module ode_mod integer(c_int64_t), parameter :: neq = 3 ! ODE parameters - double precision, parameter :: a = 1.2d0 - double precision, parameter :: b = 2.5d0 + double precision, parameter :: a = 1.2d0 + double precision, parameter :: b = 2.5d0 double precision, parameter :: ep = 1.0d-5 contains @@ -57,12 +57,11 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -70,7 +69,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yvec(:) @@ -83,9 +82,9 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = a - (yvec(3) + 1.0d0) * yvec(1) + yvec(2) * yvec(1) * yvec(1) - fvec(2) = yvec(3) * yvec(1) - yvec(2) * yvec(1) * yvec(1) - fvec(3) = (b-yvec(3))/ep - yvec(3) * yvec(1) + fvec(1) = a - (yvec(3) + 1.0d0)*yvec(1) + yvec(2)*yvec(1)*yvec(1) + fvec(2) = yvec(3)*yvec(1) - yvec(2)*yvec(1)*yvec(1) + fvec(3) = (b - yvec(3))/ep - yvec(3)*yvec(1) ! return success ierr = 0 @@ -102,15 +101,14 @@ end function RhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & - user_data, tmp1, tmp2, tmp3) & - result(ierr) bind(C,name='JacFn') + user_data, tmp1, tmp2, tmp3) & + result(ierr) bind(C, name='JacFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod - !======= Declarations ========= implicit none @@ -137,9 +135,9 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & Jmat => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian matrix - Jmat = [-(yvec(3)+1.0d0) + 2.0d0*yvec(1)*yvec(2),& - yvec(3) - 2.0d0*yvec(1)*yvec(2), -yvec(3),& - yvec(1)*yvec(1), -yvec(1)*yvec(1), 0.0d0,& + Jmat = [-(yvec(3) + 1.0d0) + 2.0d0*yvec(1)*yvec(2), & + yvec(3) - 2.0d0*yvec(1)*yvec(2), -yvec(3), & + yvec(1)*yvec(1), -yvec(1)*yvec(1), 0.0d0, & -yvec(1), yvec(1), -1.0d0/ep - yvec(1)] ! return success @@ -150,7 +148,6 @@ end function JacFn end module ode_mod - program main !======= Inclusions =========== @@ -165,7 +162,7 @@ program main !======= Declarations ========= implicit none - ! local variables + ! local variables real(c_double) :: tstart ! initial time real(c_double) :: tend ! final time real(c_double) :: rtol, atol ! relative and absolute tolerance @@ -180,8 +177,8 @@ program main type(c_ptr) :: ctx ! SUNDIALS context type(c_ptr) :: cvode_mem ! CVODE memory - type(N_Vector), pointer :: sunvec_y ! sundials vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver ! solution vector, neq is set in the ode_mod module @@ -191,11 +188,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = (tend-tstart)/10.d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = (tend - tstart)/10.d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 3.9d0 @@ -208,36 +205,36 @@ program main ! create SUNDIALS N_Vector sunvec_y => FN_VMake_Serial(neq, yvec, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create a dense matrix sunmat_A => FSUNDenseMatrix(neq, neq, ctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! create a dense linear solver sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, ctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! create CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) if (.not. c_associated(cvode_mem)) then - print *, 'ERROR: cvode_mem = NULL' - stop 1 + print *, 'ERROR: cvode_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -246,22 +243,22 @@ program main ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! attach linear solver - ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + ierr = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! set Jacobian routine ierr = FCVodeSetJacFn(cvode_mem, c_funloc(JacFn)) if (ierr /= 0) then - print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, ierr = ', ierr, '; halting' + stop 1 end if ! start time stepping @@ -271,20 +268,20 @@ program main print *, ' t u v w' print *, '----------------------------------------------------' print '(1x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODE, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvode_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODE, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(1x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) + ! output current solution + print '(1x,4(es12.5,1x))', tcur, yvec(1), yvec(2), yvec(3) - enddo + end do ! diagnostics output call CVodeStats(cvode_mem) @@ -298,7 +295,6 @@ program main end program Main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -339,41 +335,41 @@ subroutine CVodeStats(cvode_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNumJacEvals(cvode_mem, njevals) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails - print '(4x,A,i9)' ,'Num Jacobian evaluations =',njevals + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails + print '(4x,A,i9)', 'Num Jacobian evaluations =', njevals print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 index fe69831f05..cc543fdab2 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 @@ -77,7 +77,7 @@ module diurnal_bp_mod real(c_double), parameter :: a4 = 7.601d0 ! Solving assistance fixed parameters - real(c_double), parameter :: twohr = 7200.0D0 + real(c_double), parameter :: twohr = 7200.0d0 real(c_double), parameter :: rtol = 1.0d-5 real(c_double), parameter :: floor = 100.0d0 real(c_double), parameter :: delt = 0.0d0 @@ -108,7 +108,7 @@ module diurnal_bp_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -120,7 +120,7 @@ integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data integer(c_int) :: jleft, jright, jup, jdn @@ -130,69 +130,69 @@ integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double) :: vertd1, vertd2, ydn, yup ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(2,mx,my) :: uvecI(:,:,:) - real(c_double), pointer, dimension(2,mx,my) :: fvecI(:,:,:) + real(c_double), pointer, dimension(2, mx, my) :: uvecI(:, :, :) + real(c_double), pointer, dimension(2, mx, my) :: fvecI(:, :, :) !======= Internals ============ ! get data arrays from SUNDIALS vectors - uvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) - fvecI(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + uvecI(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) + fvecI(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_f) ! Set diurnal rate coefficients. - s = sin(om * tn) + s = sin(om*tn) if (s > 0.0d0) then - q3 = exp(-a3 / s) - q4 = exp(-a4 / s) + q3 = exp(-a3/s) + q4 = exp(-a4/s) else - q3 = 0.0d0 - q4 = 0.0d0 + q3 = 0.0d0 + q4 = 0.0d0 end if ! Loop over all grid points. do jy = 1, my - ydn = 30.0d0 + (jy - 1.5d0) * dy - yup = ydn + dy - cydn = vdco * exp(0.2d0 * ydn) - cyup = vdco * exp(0.2d0 * yup) - jdn = jy-1 - if (jy == 1) jdn = my - jup = jy+1 - if (jy == my) jup = 1 - do jx = 1, mx - c1 = uvecI(1,jx,jy) - c2 = uvecI(2,jx,jy) - ! Set kinetic rate terms. - qq1 = q1 * c1 * c3 - qq2 = q2 * c1 * c2 - qq3 = q3 * c3 - qq4 = q4 * c2 - rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 - rkin2 = qq1 - qq2 - qq4 - ! Set vertical diffusion terms. - c1dn = uvecI(1,jx,jdn) - c2dn = uvecI(2,jx,jdn) - c1up = uvecI(1,jx,jup) - c2up = uvecI(2,jx,jup) - vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) - vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) - ! Set horizontal diffusion and advection terms. - jleft = jx-1 - if (jx == 1) jleft = mx - jright = jx+1 - if (jx == mx) jright = 1 - c1lt = uvecI(1,jleft,jy) - c2lt = uvecI(2,jleft,jy) - c1rt = uvecI(1,jright,jy) - c2rt = uvecI(2,jright,jy) - hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) - hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) - horad1 = haco * (c1rt - c1lt) - horad2 = haco * (c2rt - c2lt) - ! load all terms into fvecI. - fvecI(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 - fvecI(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 - end do + ydn = 30.0d0 + (jy - 1.5d0)*dy + yup = ydn + dy + cydn = vdco*exp(0.2d0*ydn) + cyup = vdco*exp(0.2d0*yup) + jdn = jy - 1 + if (jy == 1) jdn = my + jup = jy + 1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvecI(1, jx, jy) + c2 = uvecI(2, jx, jy) + ! Set kinetic rate terms. + qq1 = q1*c1*c3 + qq2 = q2*c1*c2 + qq3 = q3*c3 + qq4 = q4*c2 + rkin1 = -qq1 - qq2 + 2.0d0*qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvecI(1, jx, jdn) + c2dn = uvecI(2, jx, jdn) + c1up = uvecI(1, jx, jup) + c2up = uvecI(2, jx, jup) + vertd1 = cyup*(c1up - c1) - cydn*(c1 - c1dn) + vertd2 = cyup*(c2up - c2) - cydn*(c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx - 1 + if (jx == 1) jleft = mx + jright = jx + 1 + if (jx == mx) jright = 1 + c1lt = uvecI(1, jleft, jy) + c2lt = uvecI(2, jleft, jy) + c1rt = uvecI(1, jright, jy) + c2rt = uvecI(2, jright, jy) + hord1 = hdco*(c1rt - 2.0d0*c1 + c1lt) + hord2 = hdco*(c2rt - 2.0d0*c2 + c2lt) + horad1 = haco*(c1rt - c1lt) + horad2 = haco*(c2rt - c2lt) + ! load all terms into fvecI. + fvecI(1, jx, jy) = vertd1 + hord1 + horad1 + rkin1 + fvecI(2, jx, jy) = vertd2 + hord2 + horad2 + rkin2 + end do end do ! return success @@ -205,7 +205,6 @@ end function RhsFn end module diurnal_bp_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -230,12 +229,12 @@ program main integer(c_int64_t) :: mu, ml ! band preconditioner constants real(c_double) :: x, y ! initialization index variables - type(N_Vector), pointer :: sunvec_u ! sundials vector - type(N_Vector), pointer :: sunvec_f ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(c_ptr) :: cvode_mem ! CVODE memory - real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + real(c_double), pointer, dimension(2, mx, my) :: uvec(:, :, :) ! underlying vector ! output statistic variables integer(c_long) :: lnst(1) @@ -248,86 +247,86 @@ program main ! initialize ODE tstart = 0.0d0 - tcur = tstart + tcur = tstart ! create SUNDIALS N_Vector sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_f => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_f)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + uvec(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) ! initialize and fill initial condition vector - do jy = 1,my - y = 30.0d0 + (jy - 1.0d0) * dy - cy = (0.1d0 * (y - 40.0d0))**2 - cy = 1.0d0 - cy + 0.5d0 * cy**2 - do jx = 1,mx - x = (jx - 1.0d0) * dx - cx = (0.1d0 * (x - 10.0d0))**2 - cx = 1.0d0 - cx + 0.5d0 * cx**2 - uvec(1,jx,jy) = 1.0d6 * cx * cy - uvec(2,jx,jy) = 1.0d12 * cx * cy - end do + do jy = 1, my + y = 30.0d0 + (jy - 1.0d0)*dy + cy = (0.1d0*(y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0*cy**2 + do jx = 1, mx + x = (jx - 1.0d0)*dx + cx = (0.1d0*(x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0*cx**2 + uvec(1, jx, jy) = 1.0d6*cx*cy + uvec(2, jx, jy) = 1.0d12*cx*cy + end do end do ! create and initialize CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) - if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! Tell CVODE to use a SPGMR linear solver. sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver' - stop 1 + print *, 'Error in FCVodeSetLinearSolver' + stop 1 end if ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FCVodeSetMaxNumSteps' - stop 1 + print *, 'Error in FCVodeSetMaxNumSteps' + stop 1 end if mu = 2 ml = 2 ierr = FCVBandPrecInit(cvode_mem, neq, mu, ml) if (ierr /= 0) then - print *, 'Error in FCVBandPrecInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVBandPrecInit, ierr = ', ierr, '; halting' + stop 1 end if ! Start time stepping @@ -338,33 +337,33 @@ program main print *, ' t c2 (bottom left middle top right) | lnst lh' print *, ' -----------------------------------------------------------------------------------' tout = twohr - do outstep = 1,12 - - ! call CVode - ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FCVodeGetNumSteps(cvode_mem, lnst) - if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FCVodeGetCurrentStep(cvode_mem, lh) - if (ierr /= 0) then - print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' - stop 1 - end if - - ! print current solution and output statistics - print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lh - print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) - - ! update tout - tout = tout + twohr + do outstep = 1, 12 + + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVodeEvolve, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetCurrentStep(cvode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1, 1, 1), uvec(1, 5, 5), uvec(1, 10, 10), lnst, lh + print '(18x,3(es14.6,2x))', uvec(2, 1, 1), uvec(2, 5, 5), uvec(2, 10, 10) + + ! update tout + tout = tout + twohr end do print *, ' -----------------------------------------------------------------------------------' @@ -421,100 +420,100 @@ subroutine CVodeStats(cvode_mem) ierr = FCVodeGetNumSteps(cvode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumPrecEvals(cvode_mem, npe) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumPrecSolves(cvode_mem, nps) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumLinIters(cvode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 end if avdim = dble(nliters)/dble(nniters) ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) if (ierr /= 0) then - print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVBandPrecGetWorkSpace(cvode_mem, lenrwbp, leniwbp) if (ierr /= 0) then - print *, 'Error in FCVBandPrecGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVBandPrecGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVBandPrecGetNumRhsEvals(cvode_mem, nfebp) if (ierr /= 0) then - print *, 'Error in FCVBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVBandPrecGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function call =',nfe - print '(4x,A,i9)' ,'Total num preconditioner evals =',npe - print '(4x,A,i9)' ,'Total num preconditioner solves =',nps - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num linear solver iters =',nliters - print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim - print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf - print '(4x,A,i9)' ,'Num linear solver fails =',ncfl - print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw - print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls - print '(4x,A,2(i9,3x))' ,'CVBandPre real/int workspace sizes =',lenrwbp,leniwbp - print '(4x,A,i9)' ,'CVBandPre number of f evaluations =',nfebp + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function call =', nfe + print '(4x,A,i9)', 'Total num preconditioner evals =', npe + print '(4x,A,i9)', 'Total num preconditioner solves =', nps + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num linear solver iters =', nliters + print '(4x,A,es14.6)', 'Avg Krylov subspace dim =', avdim + print '(4x,A,i9)', 'Num nonlinear solver fails =', ncf + print '(4x,A,i9)', 'Num linear solver fails =', ncfl + print '(4x,A,2(i9,3x))', 'main solver real/int workspace sizes =', lenrw, leniw + print '(4x,A,2(i9,3x))', 'linear solver real/int workspace sizes =', lenrwls, leniwls + print '(4x,A,2(i9,3x))', 'CVBandPre real/int workspace sizes =', lenrwbp, leniwbp + print '(4x,A,i9)', 'CVBandPre number of f evaluations =', nfebp print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 index d087b60d99..0dbd71e32c 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 @@ -77,7 +77,7 @@ module diurnal_mod real(c_double), parameter :: a4 = 7.601d0 ! Solving assistance fixed parameters - real(c_double), parameter :: twohr = 7200.0D0 + real(c_double), parameter :: twohr = 7200.0d0 real(c_double), parameter :: rtol = 1.0d-5 real(c_double), parameter :: floor = 100.0d0 real(c_double), parameter :: delt = 0.0d0 @@ -86,7 +86,7 @@ module diurnal_mod integer(c_int), parameter :: iGStype = 1 integer(c_int), parameter :: maxL = 0 integer(c_long), parameter :: mxsteps = 1000 - real(c_double) :: p_p(2,2,mx,my) + real(c_double) :: p_p(2, 2, mx, my) ! ODE non-constant parameters real(c_double) :: q3 @@ -108,7 +108,7 @@ module diurnal_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -120,7 +120,7 @@ integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! local data integer(c_int) :: jleft, jright, jup, jdn @@ -130,69 +130,69 @@ integer(c_int) function RhsFn(tn, sunvec_u, sunvec_f, user_data) & real(c_double) :: vertd1, vertd2, ydn, yup ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) - real(c_double), pointer, dimension(2,mx,my) :: fvec(:,:,:) + real(c_double), pointer, dimension(2, mx, my) :: uvec(:, :, :) + real(c_double), pointer, dimension(2, mx, my) :: fvec(:, :, :) !======= Internals ============ ! get data arrays from SUNDIALS vectors - uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) - fvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_f) + uvec(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) + fvec(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_f) ! Set diurnal rate coefficients. - s = sin(om * tn) + s = sin(om*tn) if (s > 0.0d0) then - q3 = exp(-a3 / s) - q4 = exp(-a4 / s) + q3 = exp(-a3/s) + q4 = exp(-a4/s) else - q3 = 0.0d0 - q4 = 0.0d0 + q3 = 0.0d0 + q4 = 0.0d0 end if ! Loop over all grid points. do jy = 1, my - ydn = 30.0d0 + (jy - 1.5d0) * dy - yup = ydn + dy - cydn = vdco * exp(0.2d0 * ydn) - cyup = vdco * exp(0.2d0 * yup) - jdn = jy-1 - if (jy == 1) jdn = my - jup = jy+1 - if (jy == my) jup = 1 - do jx = 1, mx - c1 = uvec(1,jx,jy) - c2 = uvec(2,jx,jy) - ! Set kinetic rate terms. - qq1 = q1 * c1 * c3 - qq2 = q2 * c1 * c2 - qq3 = q3 * c3 - qq4 = q4 * c2 - rkin1 = -qq1 - qq2 + 2.0d0 * qq3 + qq4 - rkin2 = qq1 - qq2 - qq4 - ! Set vertical diffusion terms. - c1dn = uvec(1,jx,jdn) - c2dn = uvec(2,jx,jdn) - c1up = uvec(1,jx,jup) - c2up = uvec(2,jx,jup) - vertd1 = cyup * (c1up - c1) - cydn * (c1 - c1dn) - vertd2 = cyup * (c2up - c2) - cydn * (c2 - c2dn) - ! Set horizontal diffusion and advection terms. - jleft = jx-1 - if (jx == 1) jleft = mx - jright = jx+1 - if (jx == mx) jright = 1 - c1lt = uvec(1,jleft,jy) - c2lt = uvec(2,jleft,jy) - c1rt = uvec(1,jright,jy) - c2rt = uvec(2,jright,jy) - hord1 = hdco * (c1rt - 2.0d0 * c1 + c1lt) - hord2 = hdco * (c2rt - 2.0d0 * c2 + c2lt) - horad1 = haco * (c1rt - c1lt) - horad2 = haco * (c2rt - c2lt) - ! load all terms into fvec. - fvec(1,jx,jy) = vertd1 + hord1 + horad1 + rkin1 - fvec(2,jx,jy) = vertd2 + hord2 + horad2 + rkin2 - end do + ydn = 30.0d0 + (jy - 1.5d0)*dy + yup = ydn + dy + cydn = vdco*exp(0.2d0*ydn) + cyup = vdco*exp(0.2d0*yup) + jdn = jy - 1 + if (jy == 1) jdn = my + jup = jy + 1 + if (jy == my) jup = 1 + do jx = 1, mx + c1 = uvec(1, jx, jy) + c2 = uvec(2, jx, jy) + ! Set kinetic rate terms. + qq1 = q1*c1*c3 + qq2 = q2*c1*c2 + qq3 = q3*c3 + qq4 = q4*c2 + rkin1 = -qq1 - qq2 + 2.0d0*qq3 + qq4 + rkin2 = qq1 - qq2 - qq4 + ! Set vertical diffusion terms. + c1dn = uvec(1, jx, jdn) + c2dn = uvec(2, jx, jdn) + c1up = uvec(1, jx, jup) + c2up = uvec(2, jx, jup) + vertd1 = cyup*(c1up - c1) - cydn*(c1 - c1dn) + vertd2 = cyup*(c2up - c2) - cydn*(c2 - c2dn) + ! Set horizontal diffusion and advection terms. + jleft = jx - 1 + if (jx == 1) jleft = mx + jright = jx + 1 + if (jx == mx) jright = 1 + c1lt = uvec(1, jleft, jy) + c2lt = uvec(2, jleft, jy) + c1rt = uvec(1, jright, jy) + c2rt = uvec(2, jright, jy) + hord1 = hdco*(c1rt - 2.0d0*c1 + c1lt) + hord2 = hdco*(c2rt - 2.0d0*c2 + c2lt) + horad1 = haco*(c1rt - c1lt) + horad2 = haco*(c2rt - c2lt) + ! load all terms into fvec. + fvec(1, jx, jy) = vertd1 + hord1 + horad1 + rkin1 + fvec(2, jx, jy) = vertd2 + hord2 + horad2 + rkin2 + end do end do ! return success @@ -213,7 +213,7 @@ end function RhsFn ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PreSet(t, sunvec_u, sunvec_f, jok, jcur, gamma, user_data) & - result(ierr) bind(C,name='PreSet') + result(ierr) bind(C, name='PreSet') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -228,30 +228,30 @@ integer(c_int) function PreSet(t, sunvec_u, sunvec_f, jok, jcur, gamma, user_dat integer(c_int), value :: jok integer(c_int) :: jcur real(c_double), value :: gamma - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data ! temporary variables - real(c_double), pointer, dimension(2,mx,my) :: u(:,:,:) - real(c_double) :: p_bd(2,2,mx,my) - u(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + real(c_double), pointer, dimension(2, mx, my) :: u(:, :, :) + real(c_double) :: p_bd(2, 2, mx, my) + u(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) ! initialize return value to success ierr = 0 ! if needed, recompute bd if (jok == 1) then - ! jok = 1. reuse saved bd - jcur = 0 + ! jok = 1. reuse saved bd + jcur = 0 else - ! jok = 0. compute diagonal jacobian blocks. - ! (using q4 value computed on last fcvfun call). - call Prec_Jac(mx, my, u, p_bd, q1, q2, q3, q4, & - c3, dy, hdco, vdco, ierr) - jcur = 1 - endif + ! jok = 0. compute diagonal jacobian blocks. + ! (using q4 value computed on last fcvfun call). + call Prec_Jac(mx, my, u, p_bd, q1, q2, q3, q4, & + c3, dy, hdco, vdco, ierr) + jcur = 1 + end if ! copy bd to p and scale by -gamma - p_p = -gamma * p_bd + p_p = -gamma*p_bd ! Perform LU decomposition call Prec_LU(mm, p_p, ierr) @@ -274,7 +274,7 @@ end function PreSet ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PreSolve(t, sunvec_u, sunvec_f, sunvec_r, sunvec_z, & - gamma, delta, lr, user_data) result(ierr) bind(C,name='PreSolve') + gamma, delta, lr, user_data) result(ierr) bind(C, name='PreSolve') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -290,12 +290,12 @@ integer(c_int) function PreSolve(t, sunvec_u, sunvec_f, sunvec_r, sunvec_z, & type(N_Vector) :: sunvec_z ! output N_Vector real(c_double) :: gamma, delta integer(c_int) :: lr - type(c_ptr), value :: user_data + type(c_ptr), value :: user_data ! temporary variables - real(c_double), pointer, dimension(2,mx,my) :: z(:,:,:), r(:,:,:) - z(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_z) - r(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_r) + real(c_double), pointer, dimension(2, mx, my) :: z(:, :, :), r(:, :, :) + z(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_z) + r(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_r) ! copy rhs into z z = r @@ -323,13 +323,13 @@ end function PreSolve ! -1 = non-recoverable error ! ---------------------------------------------------------------- subroutine Prec_Jac(mmx, mmy, u, bd, qq1, qq2, qq3, qq4, cc3, & - ddy, hhdco, vvdco, ierr) + ddy, hhdco, vvdco, ierr) implicit none integer(c_int), intent(in) :: mmx, mmy - real(c_double), intent(in) :: u(2,mmx,mmy) - real(c_double), intent(out) :: bd(2,2,mmx,mmy) + real(c_double), intent(in) :: u(2, mmx, mmy) + real(c_double), intent(out) :: bd(2, 2, mmx, mmy) real(c_double), intent(in) :: qq1, qq2, qq3, qq4, cc3, ddy, hhdco, vvdco integer(c_int), intent(out) :: ierr @@ -337,19 +337,19 @@ subroutine Prec_Jac(mmx, mmy, u, bd, qq1, qq2, qq3, qq4, cc3, & real(c_double) :: cydn, cyup, diag, ydn, yup do jy = 1, mmy - ydn = 30.0d0 + (jy - 1.5d0) * ddy - yup = ydn + ddy - cydn = vvdco * exp(0.2d0 * ydn) - cyup = vvdco * exp(0.2d0 * yup) - diag = -(cydn + cyup + 2.0d0 * hhdco) - do jx = 1, mmx - c1 = u(1,jx,jy) - c2 = u(2,jx,jy) - bd(1,1,jx,jy) = (-qq1 * cc3 - qq2 * c2) + diag - bd(1,2,jx,jy) = -qq2 * c1 + qq4 - bd(2,1,jx,jy) = qq1 * cc3 - qq2 * c2 - bd(2,2,jx,jy) = (-qq2 * c1 - qq4) + diag - end do + ydn = 30.0d0 + (jy - 1.5d0)*ddy + yup = ydn + ddy + cydn = vvdco*exp(0.2d0*ydn) + cyup = vvdco*exp(0.2d0*yup) + diag = -(cydn + cyup + 2.0d0*hhdco) + do jx = 1, mmx + c1 = u(1, jx, jy) + c2 = u(2, jx, jy) + bd(1, 1, jx, jy) = (-qq1*cc3 - qq2*c2) + diag + bd(1, 2, jx, jy) = -qq2*c1 + qq4 + bd(2, 1, jx, jy) = qq1*cc3 - qq2*c2 + bd(2, 2, jx, jy) = (-qq2*c1 - qq4) + diag + end do end do ! return success @@ -376,7 +376,7 @@ subroutine Prec_LU(mmm, p, ierr) integer(c_int), intent(out) :: ierr integer(c_int64_t), intent(in) :: mmm - real(c_double), intent(inout) :: p(2,2,mmm) + real(c_double), intent(inout) :: p(2, 2, mmm) ! local variable integer(c_int64_t) :: i @@ -386,18 +386,18 @@ subroutine Prec_LU(mmm, p, ierr) ierr = 0 ! add identity matrix and do lu decompositions on blocks, in place. - do i = 1,mmm - p11 = p(1,1,i) + 1.0d0 - p22 = p(2,2,i) + 1.0d0 - p12 = p(1,2,i) - p21 = p(1,2,i) - det = p11*p22 - p12*p21 - if (det == 0.d0) return - - p(1,1,i) = p22/det - p(2,2,i) = p11/det - p(1,2,i) = -p21/det - p(2,1,i) = -p12/det + do i = 1, mmm + p11 = p(1, 1, i) + 1.0d0 + p22 = p(2, 2, i) + 1.0d0 + p12 = p(1, 2, i) + p21 = p(1, 2, i) + det = p11*p22 - p12*p21 + if (det == 0.d0) return + + p(1, 1, i) = p22/det + p(2, 2, i) = p11/det + p(1, 2, i) = -p21/det + p(2, 1, i) = -p12/det end do return @@ -417,26 +417,25 @@ end subroutine Prec_LU ! 1 = recoverable error, ! -1 = non-recoverable error ! ---------------------------------------------------------------- - subroutine Prec_Sol(mx,my, p, z) + subroutine Prec_Sol(mx, my, p, z) implicit none integer(c_int), intent(in) :: mx, my - real(c_double), dimension(2,2,mx,my), intent(inout) :: p(:,:,:,:) - real(c_double), dimension(2,mx,my), intent(inout) :: z(:,:,:) + real(c_double), dimension(2, 2, mx, my), intent(inout) :: p(:, :, :, :) + real(c_double), dimension(2, mx, my), intent(inout) :: z(:, :, :) ! local variable integer(c_int64_t) :: i, j real(c_double) :: z1, z2 - - do i = 1,mx - do j = 1,my - z1 = z(1,i,j) - z2 = z(2,i,j) - z(1,i,j) = p(1,1,i,j) * z1 + p(1,2,i,j) * z2 - z(2,i,j) = p(2,1,i,j) * z1 + p(2,2,i,j) * z2 - end do + do i = 1, mx + do j = 1, my + z1 = z(1, i, j) + z2 = z(2, i, j) + z(1, i, j) = p(1, 1, i, j)*z1 + p(1, 2, i, j)*z2 + z(2, i, j) = p(2, 1, i, j)*z1 + p(2, 2, i, j)*z2 + end do end do return @@ -447,7 +446,6 @@ end subroutine Prec_Sol end module diurnal_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -474,12 +472,12 @@ program main integer(c_long) :: outstep ! output step real(c_double) :: x, y ! initialization index variables - type(N_Vector), pointer :: sunvec_u ! sundials vector - type(N_Vector), pointer :: sunvec_f ! sundials vector + type(N_Vector), pointer :: sunvec_u ! sundials vector + type(N_Vector), pointer :: sunvec_f ! sundials vector type(SUNLinearSolver), pointer :: sunls ! sundials linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(c_ptr) :: cvode_mem ! CVODE memory - real(c_double), pointer, dimension(2,mx,my) :: uvec(:,:,:) ! underlying vector + real(c_double), pointer, dimension(2, mx, my) :: uvec(:, :, :) ! underlying vector ! output statistic variables integer(c_long) :: lnst(1) @@ -492,84 +490,84 @@ program main ! initialize ODE tstart = 0.0d0 - tcur = tstart + tcur = tstart ! create SUNDIALS N_Vector sunvec_u => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_f => FN_VNew_Serial(neq, ctx) if (.not. associated(sunvec_f)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if - uvec(1:2,1:mx,1:my) => FN_VGetArrayPointer(sunvec_u) + uvec(1:2, 1:mx, 1:my) => FN_VGetArrayPointer(sunvec_u) ! initialize and fill initial condition vector - do jy = 1,my - y = 30.0d0 + (jy - 1.0d0) * dy - cy = (0.1d0 * (y - 40.0d0))**2 - cy = 1.0d0 - cy + 0.5d0 * cy**2 - do jx = 1,mx - x = (jx - 1.0d0) * dx - cx = (0.1d0 * (x - 10.0d0))**2 - cx = 1.0d0 - cx + 0.5d0 * cx**2 - uvec(1,jx,jy) = 1.0d6 * cx * cy - uvec(2,jx,jy) = 1.0d12 * cx * cy - end do + do jy = 1, my + y = 30.0d0 + (jy - 1.0d0)*dy + cy = (0.1d0*(y - 40.0d0))**2 + cy = 1.0d0 - cy + 0.5d0*cy**2 + do jx = 1, mx + x = (jx - 1.0d0)*dx + cx = (0.1d0*(x - 10.0d0))**2 + cx = 1.0d0 - cx + 0.5d0*cx**2 + uvec(1, jx, jy) = 1.0d6*cx*cy + uvec(2, jx, jy) = 1.0d12*cx*cy + end do end do ! create and initialize CVode memory cvode_mem = FCVodeCreate(CV_BDF, ctx) - if (.not. c_associated(cvode_mem)) print *,'ERROR: cvode_mem = NULL' + if (.not. c_associated(cvode_mem)) print *, 'ERROR: cvode_mem = NULL' ierr = FCVodeInit(cvode_mem, c_funloc(RhsFn), tstart, sunvec_u) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) if (ierr /= 0) then - print *, 'Error in FCVodeSetMaxNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetMaxNumSteps, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSStolerances(cvode_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! Tell CVODE to use a SPGMR linear solver. sunls => FSUNLinSol_SPGMR(sunvec_u, Jpretype, maxL, ctx) if (.not. associated(sunls)) then - print *, 'ERROR: sunls = NULL' - stop 1 + print *, 'ERROR: sunls = NULL' + stop 1 end if ierr = FSUNLinSol_SPGMRSetGSType(sunls, iGStype) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver' - stop 1 + print *, 'Error in FCVodeSetLinearSolver' + stop 1 end if ! Attach the linear solver (with NULL SUNMatrix object) sunmat_A => null() ierr = FCVodeSetLinearSolver(cvode_mem, sunls, sunmat_A) if (ierr /= 0) then - print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeSetPreconditioner(cvode_mem, c_funloc(PreSet), c_funloc(PreSolve)) if (ierr /= 0) then - print *, 'Error in FCVodeSetPreconditioner, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSetPreconditioner, ierr = ', ierr, '; halting' + stop 1 end if ! Start time stepping @@ -580,33 +578,33 @@ program main print *, ' t c2 (bottom left middle top right) | lnst lh' print *, ' -----------------------------------------------------------------------------------' tout = twohr - do outstep = 1,12 - - ! call CVode - ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVode, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FCVodeGetNumSteps(cvode_mem, lnst) - if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 - end if - - ierr = FCVodeGetCurrentStep(cvode_mem, lh) - if (ierr /= 0) then - print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' - stop 1 - end if - - ! print current solution and output statistics - print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1,1,1), uvec(1,5,5), uvec(1,10,10), lnst, lh - print '(18x,3(es14.6,2x))', uvec(2,1,1), uvec(2,5,5), uvec(2,10,10) - - ! update tout - tout = tout + twohr + do outstep = 1, 12 + + ! call CVode + ierr = FCVode(cvode_mem, tout, sunvec_u, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVode, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetNumSteps(cvode_mem, lnst) + if (ierr /= 0) then + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 + end if + + ierr = FCVodeGetCurrentStep(cvode_mem, lh) + if (ierr /= 0) then + print *, 'Error in FCVodeGetCurrentStep, ierr = ', ierr, '; halting' + stop 1 + end if + + ! print current solution and output statistics + print '(2x,4(es14.6,2x),i5,es14.6)', tcur, uvec(1, 1, 1), uvec(1, 5, 5), uvec(1, 10, 10), lnst, lh + print '(18x,3(es14.6,2x))', uvec(2, 1, 1), uvec(2, 5, 5), uvec(2, 10, 10) + + ! update tout + tout = tout + twohr end do print *, ' -----------------------------------------------------------------------------------' @@ -661,86 +659,86 @@ subroutine CVodeStats(cvode_mem) ierr = FCVodeGetNumSteps(cvode_mem, nsteps) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumPrecEvals(cvode_mem, npe) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumPrecSolves(cvode_mem, nps) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumLinIters(cvode_mem, nliters) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinIters, ierr = ', ierr, '; halting' + stop 1 end if avdim = dble(nliters)/dble(nniters) ierr = FCVodeGetNumLinConvFails(cvode_mem, ncfl) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetNumNonlinSolvConvFails(cvode_mem, ncf) if (ierr /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetWorkSpace(cvode_mem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ierr = FCVodeGetLinWorkSpace(cvode_mem, lenrwls, leniwls) if (ierr /= 0) then - print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function call =',nfe - print '(4x,A,i9)' ,'Total num preconditioner evals =',npe - print '(4x,A,i9)' ,'Total num preconditioner solves =',nps - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num linear solver iters =',nliters - print '(4x,A,es14.6)' ,'Avg Krylov subspace dim =',avdim - print '(4x,A,i9)' ,'Num nonlinear solver fails =',ncf - print '(4x,A,i9)' ,'Num linear solver fails =',ncfl - print '(4x,A,2(i9,3x))' ,'main solver real/int workspace sizes =',lenrw,leniw - print '(4x,A,2(i9,3x))' ,'linear solver real/int workspace sizes =',lenrwls,leniwls + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function call =', nfe + print '(4x,A,i9)', 'Total num preconditioner evals =', npe + print '(4x,A,i9)', 'Total num preconditioner solves =', nps + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num linear solver iters =', nliters + print '(4x,A,es14.6)', 'Avg Krylov subspace dim =', avdim + print '(4x,A,i9)', 'Num nonlinear solver fails =', ncf + print '(4x,A,i9)', 'Num linear solver fails =', ncfl + print '(4x,A,2(i9,3x))', 'main solver real/int workspace sizes =', lenrw, leniw + print '(4x,A,2(i9,3x))', 'linear solver real/int workspace sizes =', lenrwls, leniwls print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 index 2ed0a8cbed..5c5b5078b4 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dnsL_f2003.f90 @@ -58,7 +58,7 @@ module robertsDnsL_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnrob') + result(ierr) bind(C, name='fcnrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -70,7 +70,7 @@ integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -79,13 +79,13 @@ integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & !======= Internals ============ ! get data arrays from SUNDIALS vectors - yval => FN_VGetArrayPointer(sunvec_y) - fval => FN_VGetArrayPointer(sunvec_f) + yval => FN_VGetArrayPointer(sunvec_y) + fval => FN_VGetArrayPointer(sunvec_f) ! fill residual vector - fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) - fval(3) = 3.0d7*yval(2)**2 - fval(2) = -fval(1) - fval(3) + fval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + fval(3) = 3.0d7*yval(2)**2 + fval(2) = -fval(1) - fval(3) ! return success ierr = 0 @@ -103,7 +103,7 @@ end function fcnrob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(t, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -115,7 +115,7 @@ integer(c_int) function grob(t, sunvec_y, gout, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -145,8 +145,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -160,15 +160,14 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) - real(c_double), pointer, dimension(neq,neq) :: J(:,:) - + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -177,15 +176,15 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - J(2,1) = 0.04d0 - J(3,1) = 0.0d0 - J(1,2) = 1.0d4*yval(3) - J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) - J(3,2) = 6.0d7*yval(2) - J(1,3) = 1.0d4*yval(2) - J(2,3) = -1.0d4*yval(2) - J(3,3) = 0.0d0 + J(1, 1) = -0.04d0 + J(2, 1) = 0.04d0 + J(3, 1) = 0.0d0 + J(1, 2) = 1.0d4*yval(3) + J(2, 2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3, 2) = 6.0d7*yval(2) + J(1, 3) = 1.0d4*yval(2) + J(2, 3) = -1.0d4*yval(2) + J(3, 3) = 0.0d0 ! return success ierr = 0 @@ -197,7 +196,6 @@ end function jacrob end module robertsDnsL_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -219,10 +217,10 @@ program main real(c_double) :: rtol, t0, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: cvode_mem ! CVode memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -248,14 +246,14 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set limits @@ -270,92 +268,92 @@ program main retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) if (retval /= 0) then - print *, 'Error in FCVodeInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeSVtolerances to set tolerances retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_LapackDense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! In loop, call FCVode, print results, and test for error. iout = 0 - do while(iout < nout) + do while (iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if - retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) - if (retval < 0) then - print *, 'Error in FCVode, retval = ', retval, '; halting' + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval == CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' stop 1 - end if - - call PrintOutput(cvode_mem, tret(1), yval) - - if (retval .eq. CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - end if - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. CV_SUCCESS) then - iout = iout + 1 - tout = tout * 10.0d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == CV_SUCCESS) then + iout = iout + 1 + tout = tout*10.0d0 + end if end do sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! find and print derivative at tret(1) retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in CVodeGetDky' - stop 1 + print *, 'Error in CVodeGetDky' + stop 1 end if print *, " " print *, "------------------------------------------------------" @@ -377,7 +375,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -402,8 +399,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: LAPACK DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, " " print *, "---------------------------------------------------" print *, " t y1 y2 y3" @@ -413,7 +410,6 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -437,7 +433,6 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -469,62 +464,62 @@ subroutine PrintFinalStats(cvode_mem) retval = FCVodeGetNumSteps(cvode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (retval /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumGEvals(cvode_mem, ngevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfe - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Total root function calls =',ngevals - print '(4x,A,i9)' ,'Total LU function calls =',nluevals - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfe + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Total root function calls =', ngevals + print '(4x,A,i9)', 'Total LU function calls =', nluevals + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 index 1eb2e504be..6f9c6e7576 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dns_constraints_f2003.f90 @@ -62,7 +62,7 @@ module RobertsDnsConstr_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnrob') + result(ierr) bind(C, name='fcnrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -74,7 +74,7 @@ integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -107,7 +107,7 @@ end function fcnrob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(t, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -119,7 +119,7 @@ integer(c_int) function grob(t, sunvec_y, gout, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -149,8 +149,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -164,15 +164,14 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) - real(c_double), pointer, dimension(neq,neq) :: J(:,:) - + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -181,15 +180,15 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - J(2,1) = 0.04d0 - J(3,1) = 0.0d0 - J(1,2) = 1.0d4*yval(3) - J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) - J(3,2) = 6.0d7*yval(2) - J(1,3) = 1.0d4*yval(2) - J(2,3) = -1.0d4*yval(2) - J(3,3) = 0.0d0 + J(1, 1) = -0.04d0 + J(2, 1) = 0.04d0 + J(3, 1) = 0.0d0 + J(1, 2) = 1.0d4*yval(3) + J(2, 2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3, 2) = 6.0d7*yval(2) + J(1, 3) = 1.0d4*yval(2) + J(2, 3) = -1.0d4*yval(2) + J(3, 3) = 0.0d0 ! return success ierr = 0 @@ -201,7 +200,6 @@ end function jacrob end module RobertsDnsConstr_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -223,11 +221,11 @@ program main real(c_double) :: rtol, t0, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_c ! sundials constraint vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_c ! sundials constraint vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: cvode_mem ! CVode memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -256,20 +254,20 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_c => FN_VMake_Serial(neq, cval, sunctx) if (.not. associated(sunvec_c)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set limits @@ -284,98 +282,98 @@ program main retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) if (retval /= 0) then - print *, 'Error in FCVodeInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeSVtolerances to set tolerances retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeSetConstraints(cvode_mem, sunvec_c) if (retval /= 0) then - print *, 'Error in FCVodeSetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetConstraints, retval = ', retval, '; halting' + stop 1 end if ! In loop, call FCVode, print results, and test for error. iout = 0 - do while(iout < nout) + do while (iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) - retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) - if (retval < 0) then - print *, 'Error in FCVode, retval = ', retval, '; halting' + if (retval == CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' stop 1 - end if - - call PrintOutput(cvode_mem, tret(1), yval) - - if (retval .eq. CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - end if - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. CV_SUCCESS) then - iout = iout + 1 - tout = tout * 10.0d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == CV_SUCCESS) then + iout = iout + 1 + tout = tout*10.0d0 + end if end do sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! find and print derivative at tret(1) retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in CVodeGetDky' - stop 1 + print *, 'Error in CVodeGetDky' + stop 1 end if print *, " " print *, "---------------------------------------------------" @@ -398,7 +396,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -423,9 +420,9 @@ subroutine PrintHeader(rtol, avtol, y, c) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" - print '(a,3(f5.2,1x),a)', "Constraints cval = (",c,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" + print '(a,3(f5.2,1x),a)', "Constraints cval = (", c, ")" print *, " " print *, "---------------------------------------------------" print *, " t y1 y2 y3" @@ -435,7 +432,6 @@ subroutine PrintHeader(rtol, avtol, y, c) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -460,7 +456,6 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -492,62 +487,62 @@ subroutine PrintFinalStats(cvode_mem) retval = FCVodeGetNumSteps(cvode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (retval /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumGEvals(cvode_mem, ngevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfe - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Total root function calls =',ngevals - print '(4x,A,i9)' ,'Total LU function calls =',nluevals - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfe + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Total root function calls =', ngevals + print '(4x,A,i9)', 'Total LU function calls =', nluevals + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 index 3a07939e64..5cbe7aaddd 100644 --- a/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_dns_f2003.f90 @@ -44,7 +44,7 @@ module robertsDns_mod !======= Declarations ========= implicit none - integer(c_int), parameter :: nout = 12 + integer(c_int), parameter :: nout = 12 integer(c_int64_t), parameter :: neq = 3 contains @@ -58,7 +58,7 @@ module robertsDns_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnrob') + result(ierr) bind(C, name='fcnrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -70,7 +70,7 @@ integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -103,7 +103,7 @@ end function fcnrob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(t, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -115,7 +115,7 @@ integer(c_int) function grob(t, sunvec_y, gout, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -145,8 +145,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -160,15 +160,14 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer, dimension(neq) :: yval(:) - real(c_double), pointer, dimension(neq,neq) :: J(:,:) - + real(c_double), pointer, dimension(neq, neq) :: J(:, :) !======= Internals ============ @@ -177,15 +176,15 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & J(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - J(2,1) = 0.04d0 - J(3,1) = 0.0d0 - J(1,2) = 1.0d4*yval(3) - J(2,2) = -1.0d4*yval(3) - 6.0d7*yval(2) - J(3,2) = 6.0d7*yval(2) - J(1,3) = 1.0d4*yval(2) - J(2,3) = -1.0d4*yval(2) - J(3,3) = 0.0d0 + J(1, 1) = -0.04d0 + J(2, 1) = 0.04d0 + J(3, 1) = 0.0d0 + J(1, 2) = 1.0d4*yval(3) + J(2, 2) = -1.0d4*yval(3) - 6.0d7*yval(2) + J(3, 2) = 6.0d7*yval(2) + J(1, 3) = 1.0d4*yval(2) + J(2, 3) = -1.0d4*yval(2) + J(3, 3) = 0.0d0 ! return success ierr = 0 @@ -197,7 +196,6 @@ end function jacrob end module robertsDns_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -216,11 +214,11 @@ program main real(c_double) :: rtol, t0, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: cvode_mem ! CVode memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -245,14 +243,14 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set limits @@ -267,92 +265,92 @@ program main retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) if (retval /= 0) then - print *, 'Error in FCVodeInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeSVtolerances to set tolerances retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! In loop, call FCVode, print results, and test for error. iout = 0 - do while(iout < nout) + do while (iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if + + call PrintOutput(cvode_mem, tret(1), yval) - retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) - if (retval < 0) then - print *, 'Error in FCVode, retval = ', retval, '; halting' + if (retval == CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' stop 1 - end if - - call PrintOutput(cvode_mem, tret(1), yval) - - if (retval .eq. CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - end if - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. CV_SUCCESS) then - iout = iout + 1 - tout = tout * 10.0d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == CV_SUCCESS) then + iout = iout + 1 + tout = tout*10.0d0 + end if end do sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! find and print derivative at tret(1) retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in CVodeGetDky' - stop 1 + print *, 'Error in CVodeGetDky' + stop 1 end if print *, " " print *, "---------------------------------------------------" @@ -374,7 +372,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -399,8 +396,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, "Constraints not used." print *, " " print *, "---------------------------------------------------" @@ -411,7 +408,6 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -435,7 +431,6 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -467,62 +462,62 @@ subroutine PrintFinalStats(cvode_mem) retval = FCVodeGetNumSteps(cvode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (retval /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumGEvals(cvode_mem, ngevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfe - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Total root function calls =',ngevals - print '(4x,A,i9)' ,'Total LU function calls =',nluevals - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfe + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Total root function calls =', ngevals + print '(4x,A,i9)', 'Total LU function calls =', nluevals + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 index 785d3e7c63..5e108501bd 100644 --- a/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_roberts_klu_f2003.f90 @@ -46,7 +46,7 @@ module roberts_klu_mod integer(c_int), parameter :: nout = 12 integer(c_int64_t), parameter :: neq = 3 - integer(c_int64_t), parameter :: nnz = neq * neq + integer(c_int64_t), parameter :: nnz = neq*neq contains @@ -59,7 +59,7 @@ module roberts_klu_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='fcnrob') + result(ierr) bind(C, name='fcnrob') !======= Inclusions =========== @@ -70,7 +70,7 @@ integer(c_int) function fcnrob(t, sunvec_y, sunvec_f, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! function N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -103,7 +103,7 @@ end function fcnrob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(t, sunvec_y, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Declarations ========= implicit none @@ -112,7 +112,7 @@ integer(c_int) function grob(t, sunvec_y, gout, user_data) & real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer, dimension(neq) :: yval(:) @@ -142,8 +142,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use fsunmatrix_sparse_mod @@ -156,7 +156,7 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! unused N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 @@ -165,13 +165,13 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & real(c_double), pointer, dimension(neq) :: yval(:) real(c_double), pointer, dimension(nnz) :: Jdata(:) integer(c_int64_t), pointer, dimension(nnz) :: Jrvals(:) - integer(c_int64_t), pointer, dimension(neq+1) :: Jcptrs(:) + integer(c_int64_t), pointer, dimension(neq + 1) :: Jcptrs(:) !======= Internals ============ ! get data arrays from SUNDIALS vectors yval(1:neq) => FN_VGetArrayPointer(sunvec_y) - Jcptrs(1:neq+1) => FSUNSparseMatrix_IndexPointers(sunmat_J) + Jcptrs(1:neq + 1) => FSUNSparseMatrix_IndexPointers(sunmat_J) Jrvals(1:nnz) => FSUNSparseMatrix_IndexValues(sunmat_J) Jdata(1:nnz) => FSUNSparseMatrix_Data(sunmat_J) @@ -191,7 +191,6 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & Jdata(3) = 0.0d0 Jrvals(3) = 2 - Jdata(4) = 1.0d4*yval(3) Jrvals(4) = 0 @@ -201,7 +200,6 @@ integer(c_int) function jacrob(t, sunvec_y, sunvec_f, & Jdata(6) = 6.0d7*yval(2) Jrvals(6) = 2 - Jdata(7) = 1.0d4*yval(2) Jrvals(7) = 0 @@ -221,7 +219,6 @@ end function jacrob end module roberts_klu_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -239,10 +236,10 @@ program main real(c_double) :: rtol, t0, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_dky ! sundials solution vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_dky ! sundials solution vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: cvode_mem ! CVode memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -270,20 +267,20 @@ program main avtol(2) = 1.0d-12 avtol(3) = 1.0d-4 - initsize = 1.0d-4 * rtol - nlscoef = 1.0d-4 + initsize = 1.0d-4*rtol + nlscoef = 1.0d-4 ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set limits @@ -298,116 +295,116 @@ program main retval = FCVodeInit(cvode_mem, c_funloc(fcnrob), t0, sunvec_y) if (retval /= 0) then - print *, 'Error in FCVodeInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeInit, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeSVtolerances to set tolerances retval = FCVodeSVtolerances(cvode_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FCVodeRootInit to specify the root function grob with 2 components nrtfn = 2 retval = FCVodeRootInit(cvode_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeRootInit, retval = ', retval, '; halting' + stop 1 end if ! Create sparse SUNMatrix for use in linear solves sunmat_A => FSUNSparseMatrix(neq, neq, nnz, CSC_MAT, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create KLU sparse SUNLinearSolver object sunlinsol_LS => FSUNLinSol_KLU(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if retval = FCVodeSetMaxNumSteps(cvode_mem, mxsteps) if (retval /= 0) then - print *, 'Error in FCVodeSetMaxNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetMaxNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeSetMaxErrTestFails(cvode_mem, maxetf) if (retval /= 0) then - print *, 'Error in FCVodeSetMaxErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetMaxErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeSetInitStep(cvode_mem, initsize) if (retval /= 0) then - print *, 'Error in FCVodeSetInitStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetInitStep, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeSetNonlinConvCoef(cvode_mem, nlscoef) if (retval /= 0) then - print *, 'Error in FCVodeSetNonlinConvCoef, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetNonlinConvCoef, retval = ', retval, '; halting' + stop 1 end if ! Attach the matrix and linear solver - retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); + retval = FCVodeSetLinearSolver(cvode_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FCVodeSetJacFn(cvode_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeSetJacFn, retval = ', retval, '; halting' + stop 1 end if ! In loop, call FCVode, print results, and test for error. iout = 0 - do while(iout < nout) + do while (iout < nout) + + retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) + if (retval < 0) then + print *, 'Error in FCVode, retval = ', retval, '; halting' + stop 1 + end if - retval = FCVode(cvode_mem, tout, sunvec_y, tret(1), CV_NORMAL) - if (retval < 0) then - print *, 'Error in FCVode, retval = ', retval, '; halting' + call PrintOutput(cvode_mem, tret(1), yval) + + if (retval == CV_ROOT_RETURN) then + retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' stop 1 - end if - - call PrintOutput(cvode_mem, tret(1), yval) - - if (retval .eq. CV_ROOT_RETURN) then - retvalr = FCVodeGetRootInfo(cvode_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FCVodeGetRootInfo, retval = ', retval, '; halting' - stop 1 - end if - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if - - if (retval .eq. CV_SUCCESS) then - iout = iout + 1 - tout = tout * 10.0d0 - end if + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if + + if (retval == CV_SUCCESS) then + iout = iout + 1 + tout = tout*10.0d0 + end if end do sunvec_dky => FN_VMake_Serial(neq, dkyval, sunctx) if (.not. associated(sunvec_dky)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! find and print derivative at tret(1) retval = FCVodeGetDky(cvode_mem, tret(1), 1, sunvec_dky) if (retval /= 0) then - print *, 'Error in CVodeGetDky' - stop 1 + print *, 'Error in CVodeGetDky' + stop 1 end if print *, " " print *, "---------------------------------------------------" @@ -429,7 +426,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -454,8 +450,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, "Constraints not used." print *, " " print *, "---------------------------------------------------" @@ -466,7 +462,6 @@ subroutine PrintHeader(rtol, avtol, y) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -490,7 +485,6 @@ subroutine PrintOutput(cvode_mem, t, y) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -522,62 +516,62 @@ subroutine PrintFinalStats(cvode_mem) retval = FCVodeGetNumSteps(cvode_mem, nsteps) if (retval /= 0) then - print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumRhsEvals(cvode_mem, nfe) if (retval /= 0) then - print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumLinSolvSetups(cvode_mem, nluevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumLinSolvSetups, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumErrTestFails(cvode_mem, netfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvIters(cvode_mem, nniters) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) if (retval /= 0) then - print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumJacEvals(cvode_mem, njacevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if retval = FCVodeGetNumGEvals(cvode_mem, ngevals) if (retval /= 0) then - print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FCVodeGetNumGEvals, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfe - print '(4x,A,i9)' ,'Total Jacobian function calls =',njacevals - print '(4x,A,i9)' ,'Total root function calls =',ngevals - print '(4x,A,i9)' ,'Total LU function calls =',nluevals - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfe + print '(4x,A,i9)', 'Total Jacobian function calls =', njacevals + print '(4x,A,i9)', 'Total root function calls =', ngevals + print '(4x,A,i9)', 'Total LU function calls =', nluevals + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 index 25e75a14c5..e42e33e0b8 100644 --- a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 @@ -56,7 +56,6 @@ module ode_problem use fsundials_core_mod implicit none - ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype ! we set the integer kind used for indices in this example based ! on the the index size SUNDIALS was compiled with so that it works @@ -71,22 +70,22 @@ module ode_problem type(c_ptr) :: ctx ! problem parameters - real(c_double), parameter :: XMAX = 2.0d0 - real(c_double), parameter :: T0 = 0.0d0 - real(c_double), parameter :: T1 = 0.5d0 - real(c_double), parameter :: DTOUT = 0.5d0 - real(c_double), parameter :: ATOL = 1e-5 - integer(c_int), parameter :: NOUT = 10 - integer(c_int), parameter :: NP = 2 - integer(c_int), parameter :: NS = 2 - integer(kind=myindextype), parameter :: MX = 10 + real(c_double), parameter :: XMAX = 2.0d0 + real(c_double), parameter :: T0 = 0.0d0 + real(c_double), parameter :: T1 = 0.5d0 + real(c_double), parameter :: DTOUT = 0.5d0 + real(c_double), parameter :: ATOL = 1e-5 + integer(c_int), parameter :: NOUT = 10 + integer(c_int), parameter :: NP = 2 + integer(c_int), parameter :: NS = 2 + integer(kind=myindextype), parameter :: MX = 10 integer(kind=myindextype), parameter :: NEQ = MX ! problem constants - real(c_double) :: ZERO = 0.d0 + real(c_double) :: ZERO = 0.d0 ! problem data - real(c_double) :: p(0:NP-1) + real(c_double) :: p(0:NP - 1) real(c_double) :: dx contains @@ -101,7 +100,7 @@ module ode_problem ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, nv_u, nv_udot, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -114,7 +113,7 @@ integer(c_int) function RhsFn(tn, nv_u, nv_udot, user_data) & real(c_double), value :: tn ! current time type(N_Vector) :: nv_u ! solution N_Vector type(N_Vector) :: nv_udot ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: u(:) @@ -134,28 +133,28 @@ integer(c_int) function RhsFn(tn, nv_u, nv_udot, user_data) & !======= Internals ============ ! get data arrays from SUNDIALS vectors - u => FN_VGetArrayPointer(nv_u) + u => FN_VGetArrayPointer(nv_u) udot => FN_VGetArrayPointer(nv_udot) ! loop over all grid points - do i=1, NEQ + do i = 1, NEQ ui = u(i) if (i /= 1) then - ult = u(i-1) + ult = u(i - 1) else ult = ZERO - endif + end if if (i /= NEQ) then - urt = u(i+1) + urt = u(i + 1) else urt = ZERO - endif + end if ! set diffusion and avection terms and load into udot - hdiff = hordc*(ult - 2.0d0*ui + urt) - hadv = horac*(urt - ult) + hdiff = hordc*(ult - 2.0d0*ui + urt) + hadv = horac*(urt - ult) udot(i) = hdiff + hadv end do @@ -180,7 +179,7 @@ subroutine SetIC(nv_u) u => FN_VGetArrayPointer(nv_u) ! Load initial profile into u vector - do i=1, NEQ + do i = 1, NEQ x = i*dx u(i) = x*(XMAX - x)*exp(2.0d0*x) end do @@ -204,15 +203,15 @@ program main ! Local variables type(c_ptr) :: cvodes_mem - type(N_Vector), pointer :: u, uiS + type(N_Vector), pointer :: u, uiS type(c_ptr) :: uS type(SUNNonlinearSolver), pointer :: NLS type(SUNNonlinearSolver), pointer :: NLSsens => null() integer(c_int) :: iout, retval real(c_double) :: reltol, abstol, tout, t(1) - integer(c_int) :: plist(0:NS-1) + integer(c_int) :: plist(0:NS - 1) integer(c_int) :: is - real(c_double) :: pbar(0:NS-1) + real(c_double) :: pbar(0:NS - 1) ! Command line arguments integer(c_int) :: sensi, err_con @@ -224,21 +223,21 @@ program main ! Create SUNDIALS simulation context retval = FSUNContext_Create(SUN_COMM_NULL, ctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval - stop 1 + print *, "Error: FSUNContext_Create returned ", retval + stop 1 end if ! Set problem data - dx = XMAX/(MX+1) + dx = XMAX/(MX + 1) p(0) = 1.0d0 p(1) = 0.5d0 ! Allocate and set initial states u => FN_VNew_Serial(NEQ, ctx) if (.not. associated(u)) then - write(*,*) 'ERROR: FN_VNew_Serial returned NULL' + write (*, *) 'ERROR: FN_VNew_Serial returned NULL' stop 1 - endif + end if call SetIC(u) ! Set integration tolerances @@ -248,9 +247,9 @@ program main ! Create CVODES object cvodes_mem = FCVodeCreate(CV_ADAMS, ctx) if (.not. c_associated(cvodes_mem)) then - write(*,*) 'ERROR: cvodes_mem = NULL' + write (*, *) 'ERROR: cvodes_mem = NULL' stop 1 - endif + end if ! Initialize CVode retval = FCVodeInit(cvodes_mem, c_funloc(RhsFn), T0, u) @@ -263,32 +262,32 @@ program main ! Create fixed point nonlinear solver object NLS => FSUNNonlinSol_FixedPoint(u, 0, ctx) if (.not. associated(NLS)) then - write(*,*) 'ERROR: FSUNNonlinSol_FixedPoint returned NULL' + write (*, *) 'ERROR: FSUNNonlinSol_FixedPoint returned NULL' stop 1 - endif + end if ! Attach nonlinear solver object to CVode retval = FCVodeSetNonlinearSolver(cvodes_mem, NLS) call check_retval(retval, "FCVodeSetNonlinearSolver") - write(*,*) "" + write (*, *) "" print '(A,i3)', "1-D advection-diffusion equation, mesh size =", MX ! Sensitivity-related settings if (sensi /= 0) then - do is=0, NS-1 + do is = 0, NS - 1 plist(is) = int(is, 4) - pbar(is) = p(plist(is)) + pbar(is) = p(plist(is)) end do uS = FN_VCloneVectorArray(NS, u) if (.not. c_associated(uS)) then - write(*,*) 'ERROR: FN_VCloneVectorArray returned NULL' + write (*, *) 'ERROR: FN_VCloneVectorArray returned NULL' stop 1 - endif + end if - do is=0, NS-1 + do is = 0, NS - 1 uiS => FN_VGetVecAtIndexVectorArray(uS, is) call FN_VConst(ZERO, uiS) end do @@ -310,17 +309,17 @@ program main ! create sensitivity fixed point nonlinear solver object if (sensi_meth == CV_SIMULTANEOUS) then - NLSsens => FSUNNonlinSol_FixedPointSens(NS+1, u, 0, ctx) + NLSsens => FSUNNonlinSol_FixedPointSens(NS + 1, u, 0, ctx) else if (sensi_meth == CV_STAGGERED) then NLSsens => FSUNNonlinSol_FixedPointSens(NS, u, 0, ctx) else NLSsens => FSUNNonlinSol_FixedPoint(u, 0, ctx) - endif + end if if (.not. associated(NLSsens)) then - write(*,*) 'ERROR: FSUNNonlinSol_FixedPointSens returned NULL' + write (*, *) 'ERROR: FSUNNonlinSol_FixedPointSens returned NULL' stop 1 - endif + end if ! attach nonlinear solver object to CVode if (sensi_meth == CV_SIMULTANEOUS) then @@ -329,40 +328,40 @@ program main retval = FCVodeSetNonlinearSolverSensStg(cvodes_mem, NLSsens) else retval = FCVodeSetNonlinearSolverSensStg1(cvodes_mem, NLSsens) - endif + end if call check_retval(retval, "FCVodeSetNonlinearSolverSens") - write(*,'(A)',advance="no") "Sensitivity: YES " + write (*, '(A)', advance="no") "Sensitivity: YES " if (sensi_meth == CV_SIMULTANEOUS) then - write(*,'(A)',advance="no") "( SIMULTANEOUS +" + write (*, '(A)', advance="no") "( SIMULTANEOUS +" else if (sensi_meth == CV_STAGGERED) then - write(*,'(A)',advance="no") "( STAGGERED +" + write (*, '(A)', advance="no") "( STAGGERED +" else - write(*,'(A)',advance="no") "( STAGGERED1 +" - endif - endif + write (*, '(A)', advance="no") "( STAGGERED1 +" + end if + end if if (err_con /= 0) then - write(*,'(A)',advance="no") " FULL ERROR CONTROL )" + write (*, '(A)', advance="no") " FULL ERROR CONTROL )" else - write(*,'(A)',advance="no") " PARTIAL ERROR CONTROL )" - endif + write (*, '(A)', advance="no") " PARTIAL ERROR CONTROL )" + end if else - write(*,'(A)') "Sensitivity: NO " + write (*, '(A)') "Sensitivity: NO " - endif + end if ! In loop over output points, call CVode, print results, test for error - write(*,*) "" - write(*,*) "" - write(*,*) "============================================================" - write(*,*) " T Q H NST Max norm " - write(*,*) "============================================================" + write (*, *) "" + write (*, *) "" + write (*, *) "============================================================" + write (*, *) " T Q H NST Max norm " + write (*, *) "============================================================" tout = T1 do iout = 1, NOUT @@ -375,9 +374,9 @@ program main retval = FCVodeGetSens(cvodes_mem, t, uS) call check_retval(retval, "FCVodeGetSens") call PrintOutputS(uS) - endif + end if - write(*,*) "------------------------------------------------------------" + write (*, *) "------------------------------------------------------------" tout = tout + DTOUT end do @@ -389,13 +388,13 @@ program main call FN_VDestroy(u) if (sensi /= 0) then call FN_VDestroyVectorArray(uS, NS) - endif + end if call FCVodeFree(cvodes_mem) retval = FSUNNonlinSolFree(NLS) if (associated(NLSsens)) then retval = FSUNNonlinSolFree(NLSsens) - endif + end if retval = FSUNContext_Free(ctx) @@ -411,14 +410,14 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) integer(c_int) :: argc character(len=32) :: arg - argc = command_argument_count() - sensi = 0 + argc = command_argument_count() + sensi = 0 sensi_meth = -1 - err_con = 0 + err_con = 0 if (argc < 1) then call WrongArgs() - endif + end if call get_command_argument(1, arg) if (arg == "-nosensi") then @@ -427,13 +426,13 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) sensi = 1 else call WrongArgs() - endif + end if if (sensi /= 0) then if (argc /= 3) then call WrongArgs() - endif + end if call get_command_argument(2, arg) if (arg == "sim") then @@ -444,7 +443,7 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) sensi_meth = CV_STAGGERED1 else call WrongArgs() - endif + end if call get_command_argument(3, arg) if (arg == "t") then @@ -453,18 +452,18 @@ subroutine ProcessArgs(sensi, sensi_meth, err_con) err_con = 0 else call WrongArgs() - endif + end if - endif + end if end subroutine ! Print help. subroutine WrongArgs() - write(*,*) "" - write(*,*) "Usage: ./cvsAdvDiff_FSA_non [-nosensi] [-sensi sensi_meth err_con]" - write(*,*) " sensi_meth = sim, stg, or stg1" - write(*,*) " err_con = t or f" - write(*,*) "" + write (*, *) "" + write (*, *) "Usage: ./cvsAdvDiff_FSA_non [-nosensi] [-sensi sensi_meth err_con]" + write (*, *) " sensi_meth = sim, stg, or stg1" + write (*, *) " err_con = t or f" + write (*, *) "" call exit(0) end subroutine @@ -492,10 +491,10 @@ subroutine PrintOutput(cvodes_mem, t, u) retval = FCVodeGetLastOrder(cvodes_mem, qu) retval = FCVodeGetLastStep(cvodes_mem, hu) - write(*,'(1x,es10.3,1x,i2,2x,es10.3,i5)') t, qu, hu, nst + write (*, '(1x,es10.3,1x,i2,2x,es10.3,i5)') t, qu, hu, nst unorm = FN_VMaxNorm(u) - write(*,'(1x,A,es12.4)') " Solution ", unorm + write (*, '(1x,A,es12.4)') " Solution ", unorm end subroutine @@ -512,10 +511,10 @@ subroutine PrintOutputS(uS) uiS => FN_VGetVecAtIndexVectorArray(uS, 0) norm = FN_VMaxNorm(uiS) - write(*,'(1x,A,es12.4)') " Sensitivity 1 ", norm + write (*, '(1x,A,es12.4)') " Sensitivity 1 ", norm uiS => FN_VGetVecAtIndexVectorArray(uS, 1) norm = FN_VMaxNorm(uiS) - write(*,'(1x,A,es12.4)') " Sensitivity 2 ", norm + write (*, '(1x,A,es12.4)') " Sensitivity 2 ", norm end subroutine @@ -550,32 +549,32 @@ subroutine PrintFinalStats(cvodes_mem, sensi, err_con, sensi_meth) retval = FCVodeGetSensNumErrTestFails(cvodes_mem, netfS) else netfS = 0 - endif + end if if (sensi_meth == CV_STAGGERED .or. sensi_meth == CV_STAGGERED1) then retval = FCVodeGetSensNumNonlinSolvIters(cvodes_mem, nniS) retval = FCVodeGetSensNumNonlinSolvConvFails(cvodes_mem, ncfnS) else - nniS = 0 + nniS = 0 ncfnS = 0 - endif + end if - endif + end if - write(*,*) "" - write(*,*) "Final Statistics" - write(*,*) "" - write(*,'(1x,A,i9)') "nst =", nst - write(*,'(1x,A,i9)') "nfe =", nfe - write(*,'(1x,A,i9,A,i9)') "nst =", netf, " nsetups =", nsetups - write(*,'(1x,A,i9,A,i9)') "nni =", nni, " ncfn =", ncfn + write (*, *) "" + write (*, *) "Final Statistics" + write (*, *) "" + write (*, '(1x,A,i9)') "nst =", nst + write (*, '(1x,A,i9)') "nfe =", nfe + write (*, '(1x,A,i9,A,i9)') "nst =", netf, " nsetups =", nsetups + write (*, '(1x,A,i9,A,i9)') "nni =", nni, " ncfn =", ncfn if (sensi /= 0) then - write(*,*) "" - write(*,'(1x,A,i9,A,i9)') "nfSe =", nfSe, " nfeS =", nfeS - write(*,'(1x,A,i9,A,i9)') "netfS =", netfS, " nsetupsS =", nsetupsS - write(*,'(1x,A,i9,A,i9)') "nniS =", nniS, " ncfnS =", ncfnS - endif + write (*, *) "" + write (*, '(1x,A,i9,A,i9)') "nfSe =", nfSe, " nfeS =", nfeS + write (*, '(1x,A,i9,A,i9)') "netfS =", netfS, " nsetupsS =", nsetupsS + write (*, '(1x,A,i9,A,i9)') "nniS =", nniS, " ncfnS =", ncfnS + end if end subroutine @@ -586,7 +585,7 @@ subroutine check_retval(retval, name) integer(c_int) :: retval if (retval /= 0) then - write(*,'(A,A,A)') 'ERROR: ', name,' returned nonzero' + write (*, '(A,A,A)') 'ERROR: ', name, ' returned nonzero' stop 1 end if end subroutine diff --git a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 index 1c147387af..3087baab20 100644 --- a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 @@ -33,7 +33,6 @@ module ode_mod !======= Declarations ========= implicit none - ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype ! we set the integer kind used for indices in this example based ! on the the index size SUNDIALS was compiled with so that it works @@ -62,7 +61,7 @@ module ode_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='RhsFn') + result(ierr) bind(C, name='RhsFn') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -87,7 +86,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0+tn*tn) - lamda*atan(tn) + fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn) ! return success ierr = 0 @@ -97,7 +96,6 @@ end function RhsFn end module ode_mod - program main !======= Inclusions =========== @@ -136,11 +134,11 @@ program main ! initialize ODE tstart = 0.0d0 - tend = 10.0d0 - tcur = tstart - tout = tstart - dtout = 1.0d0 - nout = ceiling(tend/dtout) + tend = 10.0d0 + tcur = tstart + tout = tstart + dtout = 1.0d0 + nout = ceiling(tend/dtout) ! initialize solution vector yvec(1) = 0.0d0 @@ -148,22 +146,22 @@ program main ! create SUNDIALS N_Vector sunvec_y => FN_VMake_Serial(neq, yvec, ctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! create CVode memory cvodes_mem = FCVodeCreate(CV_ADAMS, ctx) if (.not. c_associated(cvodes_mem)) then - print *, 'ERROR: cvodes_mem = NULL' - stop 1 + print *, 'ERROR: cvodes_mem = NULL' + stop 1 end if ! initialize CVode ierr = FCVodeInit(cvodes_mem, c_funloc(RhsFn), tstart, sunvec_y) if (ierr /= 0) then - print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeInit, ierr = ', ierr, '; halting' + stop 1 end if ! set relative and absolute tolerances @@ -172,15 +170,15 @@ program main ierr = FCVodeSStolerances(cvodes_mem, rtol, atol) if (ierr /= 0) then - print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeSStolerances, ierr = ', ierr, '; halting' + stop 1 end if ! create fixed point nonlinear solver object sunnls => FSUNNonlinSol_FixedPoint(sunvec_y, 0, ctx) if (.not. associated(sunnls)) then - print *,'ERROR: sunnls = NULL' - stop 1 + print *, 'ERROR: sunnls = NULL' + stop 1 end if ! attache nonlinear solver object to CVode @@ -197,20 +195,20 @@ program main print *, ' t y ' print *, '----------------------------' print '(2x,2(es12.5,1x))', tcur, yvec(1) - do outstep = 1,nout + do outstep = 1, nout - ! call CVode - tout = min(tout + dtout, tend) - ierr = FCVode(cvodes_mem, tout, sunvec_y, tcur, CV_NORMAL) - if (ierr /= 0) then - print *, 'Error in FCVODES, ierr = ', ierr, '; halting' - stop 1 - endif + ! call CVode + tout = min(tout + dtout, tend) + ierr = FCVode(cvodes_mem, tout, sunvec_y, tcur, CV_NORMAL) + if (ierr /= 0) then + print *, 'Error in FCVODES, ierr = ', ierr, '; halting' + stop 1 + end if - ! output current solution - print '(2x,2(es12.5,1x))', tcur, yvec(1) + ! output current solution + print '(2x,2(es12.5,1x))', tcur, yvec(1) - enddo + end do ! diagnostics output call CVodeStats(cvodes_mem) @@ -223,7 +221,6 @@ program main end program main - ! ---------------------------------------------------------------- ! CVodeStats ! @@ -262,33 +259,33 @@ subroutine CVodeStats(cvodes_mem) ! general solver statistics ierr = FCVodeGetIntegratorStats(cvodes_mem, nsteps, nfevals, nlinsetups, & - netfails, qlast, qcur, hinused, hlast, hcur, tcur) + netfails, qlast, qcur, hinused, hlast, hcur, tcur) if (ierr /= 0) then - print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetIntegratorStats, ierr = ', ierr, '; halting' + stop 1 end if ! nonlinear solver statistics ierr = FCVodeGetNonlinSolvStats(cvodes_mem, nniters, nncfails) if (ierr /= 0) then - print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FCVodeGetNonlinSolvStats, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, ' General Solver Stats:' - print '(4x,A,i9)' ,'Total internal steps taken =',nsteps - print '(4x,A,i9)' ,'Total rhs function calls =',nfevals - print '(4x,A,i9)' ,'Num lin solver setup calls =',nlinsetups - print '(4x,A,i9)' ,'Num error test failures =',netfails - print '(4x,A,i9)' ,'Last method order =',qlast - print '(4x,A,i9)' ,'Next method order =',qcur - print '(4x,A,es12.5)','First internal step size =',hinused - print '(4x,A,es12.5)','Last internal step size =',hlast - print '(4x,A,es12.5)','Next internal step size =',hcur - print '(4x,A,es12.5)','Current internal time =',tcur - print '(4x,A,i9)' ,'Num nonlinear solver iters =',nniters - print '(4x,A,i9)' ,'Num nonlinear solver fails =',nncfails + print '(4x,A,i9)', 'Total internal steps taken =', nsteps + print '(4x,A,i9)', 'Total rhs function calls =', nfevals + print '(4x,A,i9)', 'Num lin solver setup calls =', nlinsetups + print '(4x,A,i9)', 'Num error test failures =', netfails + print '(4x,A,i9)', 'Last method order =', qlast + print '(4x,A,i9)', 'Next method order =', qcur + print '(4x,A,es12.5)', 'First internal step size =', hinused + print '(4x,A,es12.5)', 'Last internal step size =', hlast + print '(4x,A,es12.5)', 'Next internal step size =', hcur + print '(4x,A,es12.5)', 'Current internal time =', tcur + print '(4x,A,i9)', 'Num nonlinear solver iters =', nniters + print '(4x,A,i9)', 'Num nonlinear solver fails =', nncfails print *, ' ' return diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 index 3e83d622e6..3dc08bc7e9 100644 --- a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003.f90 @@ -46,13 +46,13 @@ module idaHeat2DKryOMP_mod !======= Declarations ========= implicit none - integer(c_int), parameter :: nout = 11 - integer(c_int), parameter :: mgrid = 100 - integer(c_int64_t), parameter :: neq = mgrid*mgrid + integer(c_int), parameter :: nout = 11 + integer(c_int), parameter :: mgrid = 100 + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff - real(c_double) :: pp(mgrid,mgrid) + real(c_double) :: pp(mgrid, mgrid) contains @@ -65,7 +65,7 @@ module idaHeat2DKryOMP_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) & - result(ierr) bind(C,name='resHeat') + result(ierr) bind(C, name='resHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -78,12 +78,12 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(mgrid,mgrid) :: u(:,:) - real(c_double), pointer, dimension(mgrid,mgrid) :: up(:,:) - real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) + real(c_double), pointer, dimension(mgrid, mgrid) :: u(:, :) + real(c_double), pointer, dimension(mgrid, mgrid) :: up(:, :) + real(c_double), pointer, dimension(mgrid, mgrid) :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -91,9 +91,9 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) !======= Internals ============ ! get data arrays from SUNDIALS vectors - u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) + u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) ! Initialize r to u, to take care of boundary equations !$omp parallel @@ -103,10 +103,10 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) ! Loop over interior points; set res = up - (central difference) !$omp do collapse(2) private(i,j) - do j = 2,mgrid-1 - do i = 2,mgrid-1 - r(i,j) = up(i,j) - coeff*( u(i-1,j) + u(i+1,j) + u(i,j-1) + u(i,j+1) - 4.d0*u(i,j)) - end do + do j = 2, mgrid - 1 + do i = 2, mgrid - 1 + r(i, j) = up(i, j) - coeff*(u(i - 1, j) + u(i + 1, j) + u(i, j - 1) + u(i, j + 1) - 4.d0*u(i, j)) + end do end do !$omp end do !$omp end parallel @@ -127,7 +127,7 @@ end function resHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_data) & - result(ierr) bind(C,name='PSetupHeat') + result(ierr) bind(C, name='PSetupHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -141,7 +141,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! local variables real(c_double) :: pelinv @@ -156,7 +156,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da ! set the interior points to the correct value for preconditioning !$omp parallel workshare - pp(2:mgrid-1, 2:mgrid-1) = pelinv + pp(2:mgrid - 1, 2:mgrid - 1) = pelinv !$omp end parallel workshare ! return success @@ -175,7 +175,7 @@ end function PSetupHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, & - sunvec_sol, cj, delta, prec_data) result(ierr) bind(C,name='PSolveHeat') + sunvec_sol, cj, delta, prec_data) result(ierr) bind(C, name='PSolveHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -192,11 +192,11 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, type(N_Vector) :: sunvec_r ! residual N_Vector type(N_Vector) :: sunvec_rhs ! rhs N_Vector type(N_Vector) :: sunvec_sol ! solution N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(mgrid,mgrid) :: rhs(:,:) - real(c_double), pointer, dimension(mgrid,mgrid) :: sol(:,:) + real(c_double), pointer, dimension(mgrid, mgrid) :: rhs(:, :) + real(c_double), pointer, dimension(mgrid, mgrid) :: sol(:, :) !======= Internals ============ @@ -206,7 +206,7 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, ! Apply preconditioner to rhs to create sol !$omp parallel workshare - sol = rhs * pp + sol = rhs*pp !$omp end parallel workshare ! return success @@ -219,7 +219,6 @@ end function PSolveHeat end module idaHeat2DKryOMP_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -238,11 +237,11 @@ program main integer(c_int) :: retval, iout integer(c_long) :: netf(1), ncfn(1), ncfl(1) - type(N_Vector), pointer :: sunvec_u ! sundials solution vector - type(N_Vector), pointer :: sunvec_up ! sundials derivative vector - type(N_Vector), pointer :: sunvec_c ! sundials constraints vector - type(N_Vector), pointer :: sunvec_r ! sundials residual vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_u ! sundials solution vector + type(N_Vector), pointer :: sunvec_up ! sundials derivative vector + type(N_Vector), pointer :: sunvec_c ! sundials constraints vector + type(N_Vector), pointer :: sunvec_r ! sundials residual vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: ida_mem ! IDA memory type(c_ptr) :: sunctx ! sundials simulation context @@ -250,7 +249,7 @@ program main character(len=32) :: arg ! input arg ! solution, residual and constraints vectors, mgrid is set in the idaHeat2DKryOMP_mod module - real(c_double), dimension(mgrid,mgrid) :: uu, up, res, constraints + real(c_double), dimension(mgrid, mgrid) :: uu, up, res, constraints !======= Internals ============ retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) @@ -258,40 +257,40 @@ program main ! get the number of threads passed in as a command line argument (if applicable) nargs = command_argument_count() if (nargs > 0) then - call get_command_argument(1, arg, length, status) - read(arg,*) nthreads + call get_command_argument(1, arg, length, status) + read (arg, *) nthreads else - nthreads = 6 - endif + nthreads = 6 + end if call omp_set_num_threads(nthreads) ! Assign parameters in idaHeat2DKryOMP_mod - dx = 1.d0/(mgrid-1) - coeff = 1.d0/(dx * dx) + dx = 1.d0/(mgrid - 1) + coeff = 1.d0/(dx*dx) ! create N_Vectors sunvec_u => FN_VMake_OpenMP(neq, uu, nthreads, sunctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_up => FN_VMake_OpenMP(neq, up, nthreads, sunctx) if (.not. associated(sunvec_up)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_r => FN_VMake_OpenMP(neq, res, nthreads, sunctx) if (.not. associated(sunvec_r)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_c => FN_VMake_OpenMP(neq, constraints, nthreads, sunctx) if (.not. associated(sunvec_c)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! Initialize solution vectors @@ -301,64 +300,64 @@ program main constraints = 1.d0 ! Assign various parameters - t0 = 0.d0 - t1 = 0.01d0 + t0 = 0.d0 + t1 = 0.01d0 rtol = 0.d0 atol = 1.d-3 ! Call FIDACreate and FIDAInit to initialize solution ida_mem = FIDACreate(sunctx) if (.not. c_associated(ida_mem)) then - print *, 'ERROR: ida_mem = NULL' - stop 1 + print *, 'ERROR: ida_mem = NULL' + stop 1 end if retval = FIDASetConstraints(ida_mem, sunvec_c) if (retval /= 0) then - print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' + stop 1 end if retval = FIDAInit(ida_mem, c_funloc(resHeat), t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAInit, retval = ', retval, '; halting' + stop 1 end if retval = FIDASStolerances(ida_mem, rtol, atol) if (retval /= 0) then - print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' + stop 1 end if ! Create the linear solver SUNLinSol_SPGMR with left preconditioning ! and the default Krylov dimension sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, SUN_PREC_LEFT, 0, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! IDA recommends allowing up to 5 restarts (default is 0) retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, 5) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 end if ! Attach the linear solver (will NULL SUNMatrix object) sunmat_A => null() retval = FIDASetLinearSolver(ida_mem, sunlinsol_LS, sunmat_A) if (retval /= 0) then - print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the preconditioner solve and setup functions */ retval = FIDASetPreconditioner(ida_mem, c_funloc(PsetupHeat), c_funloc(PsolveHeat)) if (retval /= 0) then - print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' + stop 1 end if ! Print output heading @@ -382,33 +381,33 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(ida_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(ida_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(ida_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -428,14 +427,14 @@ program main retval = FIDAReInit(ida_mem, t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAReInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAReInit, retval = ', retval, '; halting' + stop 1 end if retval = FSUNLinSol_SPGMRSetGSType(sunlinsol_LS, SUN_CLASSICAL_GS) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' + stop 1 end if ! Print case number, output table heading, and initial line of table @@ -451,34 +450,34 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(ida_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(ida_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(ida_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -498,7 +497,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -517,9 +515,9 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) type(N_Vector) :: sunvec_r ! residual N_Vector ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(mgrid,mgrid) :: uu(:,:) - real(c_double), pointer, dimension(mgrid,mgrid) :: up(:,:) - real(c_double), pointer, dimension(mgrid,mgrid) :: r(:,:) + real(c_double), pointer, dimension(mgrid, mgrid) :: uu(:, :) + real(c_double), pointer, dimension(mgrid, mgrid) :: up(:, :) + real(c_double), pointer, dimension(mgrid, mgrid) :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -531,18 +529,18 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) ! get data arrays from SUNDIALS vectors uu(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) !======= Internals ============ ! Initialize uu on all grid points !$omp parallel do collapse(2) private(yfact,xfact,i,j) - do j = 1,mgrid - do i = 1,mgrid - yfact = dx * (j-1) - xfact = dx * (i-1) - uu(i,j) = 16.d0 * xfact * (1.d0 - xfact) * yfact * (1.d0 - yfact) - end do + do j = 1, mgrid + do i = 1, mgrid + yfact = dx*(j - 1) + xfact = dx*(i - 1) + uu(i, j) = 16.d0*xfact*(1.d0 - xfact)*yfact*(1.d0 - yfact) + end do end do !$omp end parallel do @@ -550,7 +548,7 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) up = 0.d0 ! resHeat sets res to negative of ODE RHS values at interior points - retval = resHeat(0.d0, sunvec_u, sunvec_up, sunvec_r, C_NULL_PTR) + retval = resHeat(0.d0, sunvec_u, sunvec_up, sunvec_r, c_null_ptr) ! Copy -r into up to get correct interior initial up values !$omp parallel workshare @@ -558,16 +556,15 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) !$omp end parallel workshare ! Set up at boundary points to zero - up(1,:) = 0.d0 - up(mgrid,:) = 0.d0 - up(:,1) = 0.d0 - up(:,mgrid) = 0.d0 + up(1, :) = 0.d0 + up(mgrid, :) = 0.d0 + up(:, 1) = 0.d0 + up(:, mgrid) = 0.d0 return end subroutine SetInitialProfile ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -590,11 +587,11 @@ subroutine PrintHeader(rtol, atol) print *, " Discretized heat equation on 2D unit square." print *, " Zero boundary conditions, polynomial initial conditions." print '(2(a,i4),a,i8)', " Mesh dimensions: ", mgrid, " x ", mgrid, & - " Total system size: ", neq + " Total system size: ", neq print *, " " print *, " Number of OpenMP threads = ", omp_get_max_threads() print *, " " - print '(2(a,es8.1))', "Tolerance parameters: rtol = ", rtol," atol = ", atol + print '(2(a,es8.1))', "Tolerance parameters: rtol = ", rtol, " atol = ", atol print *, "Constraints set to force all solution components >= 0." print *, "Linear solver: SPGMR, preconditioner using diagonal elements." @@ -602,7 +599,6 @@ subroutine PrintHeader(rtol, atol) end subroutine PrintHeader ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -618,7 +614,7 @@ subroutine PrintOutput(ida_mem, t, uu) ! calling variable type(c_ptr) :: ida_mem - real(c_double) :: t, uu(mgrid,mgrid) + real(c_double) :: t, uu(mgrid, mgrid) ! internal variables integer(c_int) :: retval, kused(1) @@ -631,67 +627,66 @@ subroutine PrintOutput(ida_mem, t, uu) retval = FIDAGetLastOrder(ida_mem, kused) if (retval /= 0) then - print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumSteps(ida_mem, nst) if (retval /= 0) then - print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumResEvals(ida_mem, nre) if (retval /= 0) then - print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetLastStep(ida_mem, hused) if (retval /= 0) then - print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumJtimesEvals(ida_mem, nje) if (retval /= 0) then - print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinIters(ida_mem, nli) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinResEvals(ida_mem, nreLS) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecEvals(ida_mem, npe) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecSolves(ida_mem, nps) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 end if - print '(f5.2,1x,es13.5,4x,i1,2x,3(i3,2x),2(i4,2x),es9.2,2x,2(i3,1x))', & - t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps + t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps end subroutine PrintOutput ! ---------------------------------------------------------------- diff --git a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 index 0f76650345..de8b11e835 100644 --- a/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 +++ b/examples/ida/F2003_parallel/ida_heat2D_kry_bbd_f2003.f90 @@ -82,7 +82,7 @@ module Heat2DKryBBD_mod integer, target :: comm ! communicator object integer :: myid ! MPI process ID integer :: nprocs ! total number of MPI processes - logical :: HaveNbor(2,2) ! flags denoting neighbor on boundary + logical :: HaveNbor(2, 2) ! flags denoting neighbor on boundary real(c_double), dimension(:), allocatable :: Erecv ! receive buffers for neighbor exchange real(c_double), dimension(:), allocatable :: Wrecv real(c_double), dimension(:), allocatable :: Nrecv @@ -136,18 +136,17 @@ subroutine InitHeat2DData() myid = 0 nprocs = 0 HaveNbor = .false. - if (allocated(Erecv)) deallocate(Erecv) - if (allocated(Wrecv)) deallocate(Wrecv) - if (allocated(Nrecv)) deallocate(Nrecv) - if (allocated(Srecv)) deallocate(Srecv) - if (allocated(Esend)) deallocate(Esend) - if (allocated(Wsend)) deallocate(Wsend) - if (allocated(Nsend)) deallocate(Nsend) - if (allocated(Ssend)) deallocate(Ssend) + if (allocated(Erecv)) deallocate (Erecv) + if (allocated(Wrecv)) deallocate (Wrecv) + if (allocated(Nrecv)) deallocate (Nrecv) + if (allocated(Srecv)) deallocate (Srecv) + if (allocated(Esend)) deallocate (Esend) + if (allocated(Wsend)) deallocate (Wsend) + if (allocated(Nsend)) deallocate (Nsend) + if (allocated(Ssend)) deallocate (Ssend) end subroutine InitHeat2DData ! -------------------------------------------------------------- - ! -------------------------------------------------------------- ! Set up parallel decomposition ! -------------------------------------------------------------- @@ -164,61 +163,61 @@ subroutine SetupDecomp(ierr) dims = (/0, 0/) call MPI_Comm_size(MPI_COMM_WORLD, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = " , ierr - return + write (0, *) "Error in MPI_Comm_size = ", ierr + return end if call MPI_Dims_create(nprocs, 2, dims, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Dims_create = " , ierr - return + write (0, *) "Error in MPI_Dims_create = ", ierr + return end if ! set up 2D Cartesian communicator periods = (/0, 0/) call MPI_Cart_create(MPI_COMM_WORLD, 2, dims, periods, 0, comm, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_create = " , ierr - return + write (0, *) "Error in MPI_Cart_create = ", ierr + return end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = " , ierr - return + write (0, *) "Error in MPI_Comm_rank = ", ierr + return end if ! determine local extents call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_get = " , ierr - return + write (0, *) "Error in MPI_Cart_get = ", ierr + return end if is = nx*coords(1)/dims(1) + 1 - ie = nx*(coords(1)+1)/dims(1) + ie = nx*(coords(1) + 1)/dims(1) js = ny*coords(2)/dims(2) + 1 - je = ny*(coords(2)+1)/dims(2) - nxl = ie-is+1 - nyl = je-js+1 + je = ny*(coords(2) + 1)/dims(2) + nxl = ie - is + 1 + nyl = je - js + 1 ! determine if I have neighbors, and allocate exchange buffers - HaveNbor(1,1) = (is /= 1) - HaveNbor(1,2) = (ie /= nx) - HaveNbor(2,1) = (js /= 1) - HaveNbor(2,2) = (je /= ny) - if (HaveNbor(1,1)) then - allocate(Wrecv(nyl)) - allocate(Wsend(nyl)) + HaveNbor(1, 1) = (is /= 1) + HaveNbor(1, 2) = (ie /= nx) + HaveNbor(2, 1) = (js /= 1) + HaveNbor(2, 2) = (je /= ny) + if (HaveNbor(1, 1)) then + allocate (Wrecv(nyl)) + allocate (Wsend(nyl)) end if - if (HaveNbor(1,2)) then - allocate(Erecv(nyl)) - allocate(Esend(nyl)) + if (HaveNbor(1, 2)) then + allocate (Erecv(nyl)) + allocate (Esend(nyl)) end if - if (HaveNbor(2,1)) then - allocate(Srecv(nxl)) - allocate(Ssend(nxl)) + if (HaveNbor(2, 1)) then + allocate (Srecv(nxl)) + allocate (Ssend(nxl)) end if - if (HaveNbor(2,2)) then - allocate(Nrecv(nxl)) - allocate(Nsend(nxl)) + if (HaveNbor(2, 2)) then + allocate (Nrecv(nxl)) + allocate (Nsend(nxl)) end if ierr = 0 ! return with success flag @@ -232,21 +231,21 @@ end subroutine SetupDecomp subroutine FreeHeat2DData(ierr) implicit none integer, intent(out) :: ierr - if (allocated(Wrecv)) deallocate(Wrecv) - if (allocated(Wsend)) deallocate(Wsend) - if (allocated(Erecv)) deallocate(Erecv) - if (allocated(Esend)) deallocate(Esend) - if (allocated(Srecv)) deallocate(Srecv) - if (allocated(Ssend)) deallocate(Ssend) - if (allocated(Nrecv)) deallocate(Nrecv) - if (allocated(Nsend)) deallocate(Nsend) + if (allocated(Wrecv)) deallocate (Wrecv) + if (allocated(Wsend)) deallocate (Wsend) + if (allocated(Erecv)) deallocate (Erecv) + if (allocated(Esend)) deallocate (Esend) + if (allocated(Srecv)) deallocate (Srecv) + if (allocated(Ssend)) deallocate (Ssend) + if (allocated(Nrecv)) deallocate (Nrecv) + if (allocated(Nsend)) deallocate (Nsend) ierr = 0 ! return with success flag return end subroutine FreeHeat2DData ! -------------------------------------------------------------- subroutine InitProfile(sunvec_y, sunvec_ydot, sunvec_id, & - sunvec_res, sunvec_c, ierr) + sunvec_res, sunvec_c, ierr) use fnvector_parallel_mod implicit none type(N_Vector), pointer, intent(inout) :: sunvec_y @@ -255,7 +254,7 @@ subroutine InitProfile(sunvec_y, sunvec_ydot, sunvec_id, & type(N_Vector), pointer, intent(inout) :: sunvec_res type(N_Vector), pointer, intent(inout) :: sunvec_c integer(c_int), intent(in) :: ierr - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:), ydot(:,:), id(:,:), res(:,:), cstr(:,:) + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :), ydot(:, :), id(:, :), res(:, :), cstr(:, :) real(c_double) :: xreal, yreal integer(c_int) :: retval type(c_ptr) :: user_data @@ -266,42 +265,42 @@ subroutine InitProfile(sunvec_y, sunvec_ydot, sunvec_id, & ! Create solution vector, point at its data, and set initial condition N = nxl*nyl Ntot = nx*ny - sunvec_y => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_y => FN_VNew_Parallel(comm, N, Ntot, sunctx) sunvec_ydot => FN_VNew_Parallel(comm, N, Ntot, sunctx) - sunvec_id => FN_VNew_Parallel(comm, N, Ntot, sunctx) - sunvec_res => FN_VNew_Parallel(comm, N, Ntot, sunctx) - sunvec_c => FN_VNew_Parallel(comm, N, Ntot, sunctx) - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) - ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) - id(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_id) - res(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_res) - cstr(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_c) + sunvec_id => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_res => FN_VNew_Parallel(comm, N, Ntot, sunctx) + sunvec_c => FN_VNew_Parallel(comm, N, Ntot, sunctx) + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + id(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_id) + res(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_res) + cstr(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_c) id = 1.d0 - do i = 1,nxl - xreal = dx*dble(is+i-2) - do j = 1,nyl - yreal = dy*dble(js+j-2) - if (.not. HaveNbor(1,1) .and. i == 1) then - id(i,j) = 0.d0 - end if - if (.not. HaveNbor(1,2) .and. i == nxl) then - id(i,j) = 0.d0 - end if - if (.not. HaveNbor(2,1) .and. j == 1) then - id(i,j) = 0.d0 - end if - if (.not. HaveNbor(2,2) .and. j == nyl) then - id(i,j) = 0.d0 - end if - y(i,j) = 16.d0*xreal*(1.d0-xreal)*yreal*(1.d0-yreal) - end do + do i = 1, nxl + xreal = dx*dble(is + i - 2) + do j = 1, nyl + yreal = dy*dble(js + j - 2) + if (.not. HaveNbor(1, 1) .and. i == 1) then + id(i, j) = 0.d0 + end if + if (.not. HaveNbor(1, 2) .and. i == nxl) then + id(i, j) = 0.d0 + end if + if (.not. HaveNbor(2, 1) .and. j == 1) then + id(i, j) = 0.d0 + end if + if (.not. HaveNbor(2, 2) .and. j == nyl) then + id(i, j) = 0.d0 + end if + y(i, j) = 16.d0*xreal*(1.d0 - xreal)*yreal*(1.d0 - yreal) + end do end do ydot = 0.d0 cstr = 1.d0 retval = resfn(0.d0, sunvec_y, sunvec_ydot, sunvec_res, user_data) if (retval /= 0) then - print *, "Error: resfn in InitProfile returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: resfn in InitProfile returned ", retval + call MPI_Abort(comm, 1, ierr) end if ydot = -1.d0*res @@ -320,68 +319,68 @@ subroutine getStats(ida_mem, retval, ierr) implicit none ! calling variables - type(c_ptr), intent(in) :: ida_mem + type(c_ptr), intent(in) :: ida_mem integer(c_int), intent(in) :: ierr integer(c_int), intent(out) :: retval retval = FIDAGetLastOrder(ida_mem, k) if (retval /= 0) then - print *, "Error: FIDAGetLastOrder returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetLastOrder returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumSteps(ida_mem, nst) if (retval /= 0) then - print *, "Error: FIDAGetNumSteps returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumSteps returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) if (retval /= 0) then - print *, "Error: FIDAGetNumNonlinSolvIters returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumNonlinSolvIters returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumLinIters(ida_mem, nli) if (retval /= 0) then - print *, "Error: FIDAGetNumLinIters returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumLinIters returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumResEvals(ida_mem, nre) if (retval /= 0) then - print *, "Error: FIDAGetNumResEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumResEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumLinResEvals(ida_mem, nreLS) if (retval /= 0) then - print *, "Error: FIDAGetNumLinResEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumLinResEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDABBDPrecGetNumGfnEvals(ida_mem, nge) if (retval /= 0) then - print *, "Error: FIDABBDPrecGetNumGfnEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDABBDPrecGetNumGfnEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetLastStep(ida_mem, h) if (retval /= 0) then - print *, "Error: FIDAGetLastStep returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetLastStep returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumPrecEvals(ida_mem, npre) if (retval /= 0) then - print *, "Error: FIDAGetNumPrecEvals returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumPrecEvals returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDAGetNumPrecSolves(ida_mem, npsol) if (retval /= 0) then - print *, "Error: FIDAGetNumPrecSolves returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAGetNumPrecSolves returned ", retval + call MPI_Abort(comm, 1, ierr) end if end subroutine getStats @@ -391,7 +390,7 @@ end subroutine getStats ! DAE residual function r(t,y). ! ---------------------------------------------------------------- integer(c_int) function resfn(t, sunvec_y, sunvec_ydot, sunvec_res, & - user_data) result(retval) bind(C) + user_data) result(retval) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -405,21 +404,21 @@ integer(c_int) function resfn(t, sunvec_y, sunvec_ydot, sunvec_res, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector type(N_Vector) :: sunvec_res ! residual N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data !======= Internals ============ ! Exchange boundary data with neighbors retval = Exchange(N, t, sunvec_y, sunvec_ydot, sunvec_res, user_data) if (retval /= MPI_SUCCESS) then - write(0,*) "Error in Exchange = " , retval - return + write (0, *) "Error in Exchange = ", retval + return end if retval = LocalFn(N, t, sunvec_y, sunvec_ydot, sunvec_res, user_data) if (retval /= MPI_SUCCESS) then - write(0,*) "Error in LocalFn = " , retval - return + write (0, *) "Error in LocalFn = ", retval + return end if retval = 0 ! Return with success @@ -427,12 +426,11 @@ integer(c_int) function resfn(t, sunvec_y, sunvec_ydot, sunvec_res, & end function resfn ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Perform neighbor exchange (Communication function) ! ---------------------------------------------------------------- integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & - sunvec_g, user_data) result(ierr) bind(C) + sunvec_g, user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -443,188 +441,188 @@ integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & ! calling variables integer(c_int64_t), value :: Nloc - real(c_double), value :: t ! current time + real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector type(N_Vector) :: sunvec_g ! evaluated N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) - integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :) + integer :: reqSW, reqSE, reqSS, reqSN, reqRW, reqRE, reqRS, reqRN; integer :: stat(MPI_STATUS_SIZE) integer :: i, ipW, ipE, ipS, ipN integer :: coords(2), dims(2), periods(2), nbcoords(2) ! internals - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) ! MPI neighborhood information call MPI_Cart_get(comm, 2, dims, periods, coords, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_get = ", ierr - return + write (0, *) "Error in MPI_Cart_get = ", ierr + return end if - if (HaveNbor(1,1)) then - nbcoords = (/ coords(1)-1, coords(2) /) - call MPI_Cart_rank(comm, nbcoords, ipW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - end if + if (HaveNbor(1, 1)) then + nbcoords = (/coords(1) - 1, coords(2)/) + call MPI_Cart_rank(comm, nbcoords, ipW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if end if - if (HaveNbor(1,2)) then - nbcoords = (/ coords(1)+1, coords(2) /) - call MPI_Cart_rank(comm, nbcoords, ipE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - end if + if (HaveNbor(1, 2)) then + nbcoords = (/coords(1) + 1, coords(2)/) + call MPI_Cart_rank(comm, nbcoords, ipE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if end if - if (HaveNbor(2,1)) then - nbcoords = (/ coords(1), coords(2)-1 /) - call MPI_Cart_rank(comm, nbcoords, ipS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - end if + if (HaveNbor(2, 1)) then + nbcoords = (/coords(1), coords(2) - 1/) + call MPI_Cart_rank(comm, nbcoords, ipS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if end if - if (HaveNbor(2,2)) then - nbcoords = (/ coords(1), coords(2)+1 /) - call MPI_Cart_rank(comm, nbcoords, ipN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Cart_rank = ", ierr - return - end if + if (HaveNbor(2, 2)) then + nbcoords = (/coords(1), coords(2) + 1/) + call MPI_Cart_rank(comm, nbcoords, ipN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Cart_rank = ", ierr + return + end if end if ! open Irecv buffers - if (HaveNbor(1,1)) then - call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & - MPI_ANY_TAG, comm, reqRW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - end if + if (HaveNbor(1, 1)) then + call MPI_Irecv(Wrecv, nyl, MPI_DOUBLE_PRECISION, ipW, & + MPI_ANY_TAG, comm, reqRW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if end if - if (HaveNbor(1,2)) then - call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & - MPI_ANY_TAG, comm, reqRE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - end if + if (HaveNbor(1, 2)) then + call MPI_Irecv(Erecv, nyl, MPI_DOUBLE_PRECISION, ipE, & + MPI_ANY_TAG, comm, reqRE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if end if - if (HaveNbor(2,1)) then - call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & - MPI_ANY_TAG, comm, reqRS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - end if + if (HaveNbor(2, 1)) then + call MPI_Irecv(Srecv, nxl, MPI_DOUBLE_PRECISION, ipS, & + MPI_ANY_TAG, comm, reqRS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if end if - if (HaveNbor(2,2)) then - call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & - MPI_ANY_TAG, comm, reqRN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Irecv = ", ierr - return - end if + if (HaveNbor(2, 2)) then + call MPI_Irecv(Nrecv, nxl, MPI_DOUBLE_PRECISION, ipN, & + MPI_ANY_TAG, comm, reqRN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Irecv = ", ierr + return + end if end if ! send data - if (HaveNbor(1,1)) then - do i=1,nyl - Wsend(i) = y(1,i) - end do - call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & - comm, reqSW, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - end if + if (HaveNbor(1, 1)) then + do i = 1, nyl + Wsend(i) = y(1, i) + end do + call MPI_Isend(Wsend, nyl, MPI_DOUBLE_PRECISION, ipW, 0, & + comm, reqSW, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if end if - if (HaveNbor(1,2)) then - do i=1,nyl - Esend(i) = y(nxl,i) - end do - call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & - comm, reqSE, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - end if + if (HaveNbor(1, 2)) then + do i = 1, nyl + Esend(i) = y(nxl, i) + end do + call MPI_Isend(Esend, nyl, MPI_DOUBLE_PRECISION, ipE, 1, & + comm, reqSE, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if end if - if (HaveNbor(2,1)) then - do i=1,nxl - Ssend(i) = y(i,1) - end do - call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & - comm, reqSS, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - end if + if (HaveNbor(2, 1)) then + do i = 1, nxl + Ssend(i) = y(i, 1) + end do + call MPI_Isend(Ssend, nxl, MPI_DOUBLE_PRECISION, ipS, 2, & + comm, reqSS, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if end if - if (HaveNbor(2,2)) then - do i=1,nxl - Nsend(i) = y(i,nyl) - end do - call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & - comm, reqSN, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Isend = ", ierr - return - end if + if (HaveNbor(2, 2)) then + do i = 1, nxl + Nsend(i) = y(i, nyl) + end do + call MPI_Isend(Nsend, nxl, MPI_DOUBLE_PRECISION, ipN, 3, & + comm, reqSN, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Isend = ", ierr + return + end if end if ! wait for messages to finish - if (HaveNbor(1,1)) then - call MPI_Wait(reqRW, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if - call MPI_Wait(reqSW, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if + if (HaveNbor(1, 1)) then + call MPI_Wait(reqRW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSW, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if end if - if (HaveNbor(1,2)) then - call MPI_Wait(reqRE, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if - call MPI_Wait(reqSE, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if + if (HaveNbor(1, 2)) then + call MPI_Wait(reqRE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSE, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if end if - if (HaveNbor(2,1)) then - call MPI_Wait(reqRS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if - call MPI_Wait(reqSS, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if + if (HaveNbor(2, 1)) then + call MPI_Wait(reqRS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSS, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if end if - if (HaveNbor(2,2)) then - call MPI_Wait(reqRN, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if - call MPI_Wait(reqSN, stat, ierr) - if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Wait = ", ierr - return - end if + if (HaveNbor(2, 2)) then + call MPI_Wait(reqRN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if + call MPI_Wait(reqSN, stat, ierr) + if (ierr /= MPI_SUCCESS) then + write (0, *) "Error in MPI_Wait = ", ierr + return + end if end if ierr = MPI_SUCCESS ! return with success flag @@ -632,12 +630,11 @@ integer(c_int) function Exchange(Nloc, t, sunvec_y, sunvec_ydot, & end function Exchange ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! Processor-local portion of the DAE residual function. ! ---------------------------------------------------------------- integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & - user_data) result(ierr) bind(C) + user_data) result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -648,16 +645,16 @@ integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & ! calling variables integer(c_int64_t), value :: Nloc - real(c_double), value :: t ! current time + real(c_double), value :: t ! current time type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector type(N_Vector) :: sunvec_g ! evaluated N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) - real(c_double), pointer, dimension(nxl,nyl) :: ydot(:,:) - real(c_double), pointer, dimension(nxl,nyl) :: res(:,:) + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :) + real(c_double), pointer, dimension(nxl, nyl) :: ydot(:, :) + real(c_double), pointer, dimension(nxl, nyl) :: res(:, :) ! local data real(c_double) :: c1, c2, c3 @@ -666,9 +663,9 @@ integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & !======= Internals ============ ! Get data arrays from SUNDIALS vectors - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) - ydot(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_ydot) - res(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_g) + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) + ydot(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_ydot) + res(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_g) ! set constants c1 = kx/dx/dx @@ -679,45 +676,45 @@ integer(c_int) function LocalFn(Nloc, t, sunvec_y, sunvec_ydot, sunvec_g, & res = y ! iterate over subdomain boundaries (if not at overall domain boundary) - do i = 1,nxl - do j = 1,nyl - if (i == 1 .and. j == 1) then - if (HaveNbor(1,1) .and. HaveNbor(2,1)) then ! South-West corner - res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - end if - else if (i == 1 .and. j == nyl) then - if (HaveNbor(1,1) .and. HaveNbor(2,2)) then ! North-West corner - res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - end if - else if (i == nxl .and. j == 1) then - if (HaveNbor(1,2) .and. HaveNbor(2,1)) then ! South-East corner - res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - end if - else if (i == nxl .and. j == nyl) then - if (HaveNbor(1,2) .and. HaveNbor(2,2)) then ! North-East corner - res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - end if - else if (i == 1) then - if (HaveNbor(1,1)) then ! West face - res(i,j) = c1*(Wrecv(j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) - end if - else if (i == nxl) then - if (HaveNbor(1,2)) then ! East face - res(i,j) = c1*(y(i-1,j)+Erecv(j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) - end if - else if (j == 1) then - if (HaveNbor(2,1)) then ! South face - res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(Srecv(i)+y(i,j+1)) + c3*y(i,j) - end if - else if (j == nyl) then - if (HaveNbor(2,2)) then ! North face - res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+Nrecv(i)) + c3*y(i,j) - end if - else - res(i,j) = c1*(y(i-1,j)+y(i+1,j)) + c2*(y(i,j-1)+y(i,j+1)) + c3*y(i,j) + do i = 1, nxl + do j = 1, nyl + if (i == 1 .and. j == 1) then + if (HaveNbor(1, 1) .and. HaveNbor(2, 1)) then ! South-West corner + res(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end if + else if (i == 1 .and. j == nyl) then + if (HaveNbor(1, 1) .and. HaveNbor(2, 2)) then ! North-West corner + res(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end if + else if (i == nxl .and. j == 1) then + if (HaveNbor(1, 2) .and. HaveNbor(2, 1)) then ! South-East corner + res(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end if + else if (i == nxl .and. j == nyl) then + if (HaveNbor(1, 2) .and. HaveNbor(2, 2)) then ! North-East corner + res(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end if + else if (i == 1) then + if (HaveNbor(1, 1)) then ! West face + res(i, j) = c1*(Wrecv(j) + y(i + 1, j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) + end if + else if (i == nxl) then + if (HaveNbor(1, 2)) then ! East face + res(i, j) = c1*(y(i - 1, j) + Erecv(j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) end if - res(i,j) = ydot(i,j) - res(i,j) - end do + else if (j == 1) then + if (HaveNbor(2, 1)) then ! South face + res(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(Srecv(i) + y(i, j + 1)) + c3*y(i, j) + end if + else if (j == nyl) then + if (HaveNbor(2, 2)) then ! North face + res(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(y(i, j - 1) + Nrecv(i)) + c3*y(i, j) + end if + else + res(i, j) = c1*(y(i - 1, j) + y(i + 1, j)) + c2*(y(i, j - 1) + y(i, j + 1)) + c3*y(i, j) + end if + res(i, j) = ydot(i, j) - res(i, j) + end do end do ierr = 0 ! Return with success @@ -728,7 +725,6 @@ end function LocalFn end module Heat2DKryBBD_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -763,9 +759,9 @@ program driver type(N_Vector), pointer :: sunvec_id ! derivative N_Vector type(N_Vector), pointer :: sunvec_res ! derivative N_Vector type(N_Vector), pointer :: sunvec_c ! constraint N_Vector - real(c_double), pointer, dimension(nxl,nyl) :: y(:,:) ! vector data + real(c_double), pointer, dimension(nxl, nyl) :: y(:, :) ! vector data type(SUNLinearSolver), pointer :: sun_LS ! linear solver - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix type(c_ptr) :: ida_mem ! IDA memory integer(c_int) :: retval integer :: ierr, case @@ -777,13 +773,13 @@ program driver ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_rank(MPI_COMM_WORLD, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Initialize Heat2DData module @@ -792,75 +788,75 @@ program driver ny = ny_ kx = kx_ ky = ky_ - dx = 1.d0/dble(nx-1) ! x mesh spacing - dy = 1.d0/dble(ny-1) ! x mesh spacing + dx = 1.d0/dble(nx - 1) ! x mesh spacing + dy = 1.d0/dble(ny - 1) ! x mesh spacing ! Set up parallel decomposition (computes local mesh sizes) call SetupDecomp(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in SetupDecomp = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in SetupDecomp = ", ierr + call MPI_Abort(comm, 1, ierr) end if ! Create SUNDIALS simulation context, now that comm has been configured retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then - print *, "Error: FSUNContext_Create returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNContext_Create returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Initial problem output outproc = (myid == 0) if (outproc) then - write(6,*) " " - write(6,*) "2D Heat PDE test problem:"; - write(6,'(A,i4)') " nprocs = " , nprocs - write(6,'(A,i4)') " nx = ", nx - write(6,'(A,i4)') " ny = ", ny - write(6,'(A,f5.2)') " kx = ", kx - write(6,'(A,f5.2)') " ky = ", ky - write(6,'(A,es9.2)') " rtol = ", rtol - write(6,'(A,es9.2)') " atol = ", atol - write(6,'(A,i4)') " nxl (proc 0) = ", nxl - write(6,'(A,i4)') " nyl (proc 0) = ", nyl - write(6,*) " " + write (6, *) " " + write (6, *) "2D Heat PDE test problem:"; + write (6, '(A,i4)') " nprocs = ", nprocs + write (6, '(A,i4)') " nx = ", nx + write (6, '(A,i4)') " ny = ", ny + write (6, '(A,f5.2)') " kx = ", kx + write (6, '(A,f5.2)') " ky = ", ky + write (6, '(A,es9.2)') " rtol = ", rtol + write (6, '(A,es9.2)') " atol = ", atol + write (6, '(A,i4)') " nxl (proc 0) = ", nxl + write (6, '(A,i4)') " nyl (proc 0) = ", nyl + write (6, *) " " end if ! Create the IDA timestepper module ida_mem = FIDACreate(sunctx) if (.not. c_associated(ida_mem)) then - print *, "Error: FIDACreate returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDACreate returned NULL" + call MPI_Abort(comm, 1, ierr) end if call InitProfile(sunvec_y, sunvec_f, sunvec_id, sunvec_res, sunvec_c, ierr) retval = FIDAInit(ida_mem, c_funloc(resfn), t0, sunvec_y, sunvec_f) if (retval /= 0) then - print *, "Error: FIDAInit returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDAInit returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Create linear solver maxl = 0 sun_LS => FSUNLinSol_SPGMR(sunvec_y, SUN_PREC_LEFT, maxl, sunctx) if (.not. associated(sun_LS)) then - print *, "Error: FSUNLinSol_PCG returned NULL" - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNLinSol_PCG returned NULL" + call MPI_Abort(comm, 1, ierr) end if ! Attach linear solver sunmat_A => null() retval = FIDASetLinearSolver(ida_mem, sun_LS, sunmat_A) if (retval /= 0) then - print *, "Error: FIDASetLinearSolver returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASetLinearSolver returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FSUNLinSol_SPGMRSetMaxRestarts(sun_LS, 5) if (retval /= 0) then - print *, "Error: FSUNLinSol_SPGMRSetMaxRestarts returned",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FSUNLinSol_SPGMRSetMaxRestarts returned", retval + call MPI_Abort(comm, 1, ierr) end if ! Attach preconditioner @@ -869,159 +865,159 @@ program driver mu = 1 ml = 1 retval = FIDABBDPrecInit(ida_mem, N, mudq, mldq, mu, ml, 0.d0, & - c_funloc(LocalFn), c_funloc(Exchange)) + c_funloc(LocalFn), c_funloc(Exchange)) if (retval /= 0) then - print *, "Error: FIDASetPreconditioner returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASetPreconditioner returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Specify tolerances retval = FIDASStolerances(ida_mem, rtol, atol) if (retval /= 0) then - print *, "Error: FIDASStolerances returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASStolerances returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDASetSuppressAlg(ida_mem, SUNTRUE) if (retval /= 0) then - print *, "Error: FIDASetSuppressAlg returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASetSuppressAlg returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDASetId(ida_mem, sunvec_id) if (retval /= 0) then - print *, "Error: FIDASetId returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASetId returned ", retval + call MPI_Abort(comm, 1, ierr) end if retval = FIDASetConstraints(ida_mem, sunvec_c) if (retval /= 0) then - print *, "Error: FIDASetConstraints returned ",retval - call MPI_Abort(comm, 1, ierr) + print *, "Error: FIDASetConstraints returned ", retval + call MPI_Abort(comm, 1, ierr) end if ! Each processor outputs subdomain information - write(outname,'(16Hheat2d_subdomain,f4.3,4H.txt)') myid/1000.0 - open(100, file=outname) - write(100,'(6(i9,1x))') nx, ny, is, ie, js, je - close(100) + write (outname, '(16Hheat2d_subdomain,f4.3,4H.txt)') myid/1000.0 + open (100, file=outname) + write (100, '(6(i9,1x))') nx, ny, is, ie, js, je + close (100) ! Open output streams for results, access data array - write(outname,'(6Hheat2d,f4.3,4H.txt)') myid/1000.0 - open(101, file=outname) + write (outname, '(6Hheat2d,f4.3,4H.txt)') myid/1000.0 + open (101, file=outname) ! Output initial condition to disk - y(1:nxl,1:nyl) => FN_VGetArrayPointer(sunvec_y) - do j=1,nyl - do i=1,nxl - write(101,'(es25.16)',advance='no') y(i,j) - end do + y(1:nxl, 1:nyl) => FN_VGetArrayPointer(sunvec_y) + do j = 1, nyl + do i = 1, nxl + write (101, '(es25.16)', advance='no') y(i, j) + end do end do - write(101,*) " " - - do case = 1,2 - if (case == 2) then - mudq = 5 - mldq = 5 - call InitProfile(sunvec_y, sunvec_f, sunvec_id, sunvec_res, sunvec_c, ierr) - retval = FIDAReInit(ida_mem, t0, sunvec_y, sunvec_f) - if (retval /= 0) then - print *, "Error: FIDAReInit returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - retval = FIDABBDPrecReInit(ida_mem, mudq, mldq, 0.d0) - if (retval /= 0) then - print *, "Error: FIDABBDPrecReInit returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - if(outproc) then - write(6,*) " " - write(6,*) "Case ", case - write(6,*) " Difference quotient half-bandwidths = ", mudq - write(6,*) " Retained matrix half-bandwidths = ", mu - write(6,*) " " - write(6,*) "Output Summary" - write(6,*) " umax = max-norm of solution" - write(6,*) " nre = nre + nreLS (total number of RES evals.)" - end if - end if - if (case == 1) then - if(outproc) then - write(6,*) " " - write(6,*) "Case ", case - write(6,*) " Difference quotient half-bandwidths = ", mudq - write(6,*) " Retained matrix half-bandwidths = ", mu - write(6,*) " " - write(6,*) "Output Summary" - write(6,*) " umax = max-norm of solution" - write(6,*) " nre = nre + nreLS (total number of RES evals.)" - end if - end if - ! Main time-stepping loop: calls IDA to perform the integration, then - ! prints results. Stops when the final time has been reached - t = T0 - tout = T1 - if (outproc) then - write(6,*) " " - write(6,*) " t ||u||_max k nst nni nli nre nge h npe nps" - write(6,*) " ------------------------------------------------------------------------------------" - end if - do ioutput=1,Nt - - ! Integrate to output time - retval = FIDASolve(ida_mem, tout, t, sunvec_y, sunvec_f, IDA_NORMAL) - if (retval /= 0) then - print *, "Error: FIDASolve returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + write (101, *) " " + + do case = 1, 2 + if (case == 2) then + mudq = 5 + mldq = 5 + call InitProfile(sunvec_y, sunvec_f, sunvec_id, sunvec_res, sunvec_c, ierr) + retval = FIDAReInit(ida_mem, t0, sunvec_y, sunvec_f) + if (retval /= 0) then + print *, "Error: FIDAReInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + retval = FIDABBDPrecReInit(ida_mem, mudq, mldq, 0.d0) + if (retval /= 0) then + print *, "Error: FIDABBDPrecReInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + if (outproc) then + write (6, *) " " + write (6, *) "Case ", case + write (6, *) " Difference quotient half-bandwidths = ", mudq + write (6, *) " Retained matrix half-bandwidths = ", mu + write (6, *) " " + write (6, *) "Output Summary" + write (6, *) " umax = max-norm of solution" + write (6, *) " nre = nre + nreLS (total number of RES evals.)" + end if + end if + if (case == 1) then + if (outproc) then + write (6, *) " " + write (6, *) "Case ", case + write (6, *) " Difference quotient half-bandwidths = ", mudq + write (6, *) " Retained matrix half-bandwidths = ", mu + write (6, *) " " + write (6, *) "Output Summary" + write (6, *) " umax = max-norm of solution" + write (6, *) " nre = nre + nreLS (total number of RES evals.)" + end if + end if + ! Main time-stepping loop: calls IDA to perform the integration, then + ! prints results. Stops when the final time has been reached + t = T0 + tout = T1 + if (outproc) then + write (6, *) " " + write (6, *) " t ||u||_max k nst nni nli nre nge h npe nps" + write (6, *) " ------------------------------------------------------------------------------------" + end if + do ioutput = 1, Nt - ! print solution stats and update internal time - ymax = FN_VMaxNorm(sunvec_y) - call getStats(ida_mem, retval, ierr) - if (outproc) write(6,'(2x,f10.6,2x,es13.5,3x,i1,3x,i2,3x,i3,3x,i3,3x,i3,a,i3,3x,i4,3x,es9.2,3x,i2,3x,i3)') & - t, ymax, k, nst, nni, nli, nre, "+", nreLS, nge, h, npre, npsol - tout = 2.0d0 * tout - - ! output results to disk - do j=1,nyl - do i=1,nxl - write(101,'(es25.16)',advance='no') y(i,j) - end do + ! Integrate to output time + retval = FIDASolve(ida_mem, tout, t, sunvec_y, sunvec_f, IDA_NORMAL) + if (retval /= 0) then + print *, "Error: FIDASolve returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! print solution stats and update internal time + ymax = FN_VMaxNorm(sunvec_y) + call getStats(ida_mem, retval, ierr) + if (outproc) write (6, '(2x,f10.6,2x,es13.5,3x,i1,3x,i2,3x,i3,3x,i3,3x,i3,a,i3,3x,i4,3x,es9.2,3x,i2,3x,i3)') & + t, ymax, k, nst, nni, nli, nre, "+", nreLS, nge, h, npre, npsol + tout = 2.0d0*tout + + ! output results to disk + do j = 1, nyl + do i = 1, nxl + write (101, '(es25.16)', advance='no') y(i, j) end do - write(101,*) " " + end do + write (101, *) " " - end do - if (outproc) then - write(6,*) " ------------------------------------------------------------------------------------" - end if - close(101) + end do + if (outproc) then + write (6, *) " ------------------------------------------------------------------------------------" + end if + close (101) - retval = FIDAGetNumErrTestFails(ida_mem, netf) - if (retval /= 0) then - print *, "Error: FIDAGetNumErrTestFails returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FIDAGetNumErrTestFails(ida_mem, netf) + if (retval /= 0) then + print *, "Error: FIDAGetNumErrTestFails returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FIDAGetNumNonlinSolvConvFails(ida_mem, nncf) - if (retval /= 0) then - print *, "Error: FIDAInit returned ",retval - call MPI_Abort(comm, 1, ierr) - end if + retval = FIDAGetNumNonlinSolvConvFails(ida_mem, nncf) + if (retval /= 0) then + print *, "Error: FIDAInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if - retval = FIDAGetNumLinConvFails(ida_mem, nlcf) - if (retval /= 0) then - print *, "Error: FIDAInit returned ",retval - call MPI_Abort(comm, 1, ierr) - end if - - ! Print some final statistics - if (outproc) then - write(6,*) " " - write(6,*) "Final Solver Statistics:" - write(6,'(A,i6)') " Total number of error test failures = ", netf - write(6,'(A,i6)') " Total number of nonlinear conv. failures = ", nncf - write(6,'(A,i6)') " Total number of linear conv. failures = ", nlcf - end if + retval = FIDAGetNumLinConvFails(ida_mem, nlcf) + if (retval /= 0) then + print *, "Error: FIDAInit returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + ! Print some final statistics + if (outproc) then + write (6, *) " " + write (6, *) "Final Solver Statistics:" + write (6, '(A,i6)') " Total number of error test failures = ", netf + write (6, '(A,i6)') " Total number of nonlinear conv. failures = ", nncf + write (6, '(A,i6)') " Total number of linear conv. failures = ", nlcf + end if end do ! Clean up and return with successful completion diff --git a/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 b/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 index a8fd742d0e..80fd7fdc00 100644 --- a/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 +++ b/examples/ida/F2003_serial/idaHeat2D_kry_f2003.f90 @@ -44,13 +44,13 @@ module dae_mod !======= Declarations ========= implicit none - integer(c_int), parameter :: nout = 11 - integer(c_int), parameter :: mgrid = 10 - integer(c_int64_t), parameter :: neq = mgrid*mgrid + integer(c_int), parameter :: nout = 11 + integer(c_int), parameter :: mgrid = 10 + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff - real(c_double) :: pp(mgrid,mgrid) + real(c_double) :: pp(mgrid, mgrid) contains @@ -63,7 +63,7 @@ module dae_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) & - result(ierr) bind(C,name='resHeat') + result(ierr) bind(C, name='resHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -76,12 +76,12 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: u(:,:) - real(c_double), pointer :: up(:,:) - real(c_double), pointer :: r(:,:) + real(c_double), pointer :: u(:, :) + real(c_double), pointer :: up(:, :) + real(c_double), pointer :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -89,18 +89,18 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) !======= Internals ============ ! get data arrays from SUNDIALS vectors - u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) + u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) ! Initialize r to u, to take care of boundary equations r = u ! Loop over interior points; set res = up - (central difference) - do j = 2,mgrid-1 - do i = 2,mgrid-1 - r(i,j) = up(i,j) - coeff*( u(i-1,j) + u(i+1,j) + u(i,j-1) + u(i,j+1) - 4.d0*u(i,j)) - end do + do j = 2, mgrid - 1 + do i = 2, mgrid - 1 + r(i, j) = up(i, j) - coeff*(u(i - 1, j) + u(i + 1, j) + u(i, j - 1) + u(i, j + 1) - 4.d0*u(i, j)) + end do end do ! return success @@ -118,7 +118,7 @@ end function resHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_data) & - result(ierr) bind(C,name='PSetupHeat') + result(ierr) bind(C, name='PSetupHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -133,7 +133,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! local variables real(c_double) :: pelinv @@ -147,7 +147,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da pelinv = 1.d0/(cj + 4.d0*coeff) ! set the interior points to the correct value for preconditioning - pp(2:mgrid-1, 2:mgrid-1) = pelinv + pp(2:mgrid - 1, 2:mgrid - 1) = pelinv ! return success ierr = 0 @@ -164,12 +164,11 @@ end function PSetupHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, & - sunvec_sol, cj, delta, prec_data) result(ierr) bind(C,name='PSolveHeat') + sunvec_sol, cj, delta, prec_data) result(ierr) bind(C, name='PSolveHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -182,11 +181,11 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, type(N_Vector) :: sunvec_r ! residual N_Vector type(N_Vector) :: sunvec_rhs ! rhs N_Vector type(N_Vector) :: sunvec_sol ! solution N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: rhs(:,:) - real(c_double), pointer :: sol(:,:) + real(c_double), pointer :: rhs(:, :) + real(c_double), pointer :: sol(:, :) !======= Internals ============ @@ -195,7 +194,7 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, sol(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_sol) ! Apply preconditioner to rhs to create sol - sol = rhs * pp + sol = rhs*pp ! return success ierr = 0 @@ -206,7 +205,6 @@ end function PSolveHeat end module dae_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -226,48 +224,48 @@ program main integer(c_int) :: retval, iout integer(c_long) :: netf(1), ncfn(1), ncfl(1) - type(N_Vector), pointer :: sunvec_u ! sundials solution vector - type(N_Vector), pointer :: sunvec_up ! sundials derivative vector - type(N_Vector), pointer :: sunvec_c ! sundials constraints vector - type(N_Vector), pointer :: sunvec_r ! sundials residual vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_u ! sundials solution vector + type(N_Vector), pointer :: sunvec_up ! sundials derivative vector + type(N_Vector), pointer :: sunvec_c ! sundials constraints vector + type(N_Vector), pointer :: sunvec_r ! sundials residual vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: ida_mem ! IDA memory type(c_ptr) :: sunctx ! sundials simulation context ! solution, residual and constraints vectors, mgrid is set in the dae_mod module - real(c_double), dimension(mgrid,mgrid) :: uu, up, res, constraints + real(c_double), dimension(mgrid, mgrid) :: uu, up, res, constraints !======= Internals ============ retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) ! Assign parameters in dae_mod - dx = 1.d0/(mgrid-1) - coeff = 1.d0/(dx * dx) + dx = 1.d0/(mgrid - 1) + coeff = 1.d0/(dx*dx) ! create N_Vectors sunvec_u => FN_VMake_Serial(neq, uu, sunctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_up => FN_VMake_Serial(neq, up, sunctx) if (.not. associated(sunvec_up)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_r => FN_VMake_Serial(neq, res, sunctx) if (.not. associated(sunvec_r)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_c => FN_VMake_Serial(neq, constraints, sunctx) if (.not. associated(sunvec_c)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! Initialize solution vectors @@ -277,64 +275,64 @@ program main constraints = 1.d0 ! Assign various parameters - t0 = 0.d0 - t1 = 0.01d0 + t0 = 0.d0 + t1 = 0.01d0 rtol = 0.d0 atol = 1.d-3 ! Call FIDACreate and FIDAInit to initialize solution ida_mem = FIDACreate(sunctx) if (.not. c_associated(ida_mem)) then - print *, 'ERROR: ida_mem = NULL' - stop 1 + print *, 'ERROR: ida_mem = NULL' + stop 1 end if retval = FIDASetConstraints(ida_mem, sunvec_c) if (retval /= 0) then - print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' + stop 1 end if retval = FIDAInit(ida_mem, c_funloc(resHeat), t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAInit, retval = ', retval, '; halting' + stop 1 end if retval = FIDASStolerances(ida_mem, rtol, atol) if (retval /= 0) then - print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' + stop 1 end if ! Create the linear solver SUNLinSol_SPGMR with left preconditioning ! and the default Krylov dimension sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, SUN_PREC_LEFT, 0, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! IDA recommends allowing up to 5 restarts (default is 0) retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, 5) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 end if ! Attach the linear solver (will NULL SUNMatrix object) sunmat_A => null() retval = FIDASetLinearSolver(ida_mem, sunlinsol_LS, sunmat_A) if (retval /= 0) then - print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the preconditioner solve and setup functions */ retval = FIDASetPreconditioner(ida_mem, c_funloc(PsetupHeat), c_funloc(PsolveHeat)) if (retval /= 0) then - print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' + stop 1 end if ! Print output heading @@ -358,33 +356,33 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(ida_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(ida_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(ida_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -404,14 +402,14 @@ program main retval = FIDAReInit(ida_mem, t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAReInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAReInit, retval = ', retval, '; halting' + stop 1 end if retval = FSUNLinSol_SPGMRSetGSType(sunlinsol_LS, SUN_CLASSICAL_GS) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' + stop 1 end if ! Print case number, output table heading, and initial line of table @@ -427,34 +425,34 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(ida_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(ida_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(ida_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(ida_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(ida_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -473,7 +471,6 @@ program main end program main - ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -493,9 +490,9 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) type(N_Vector) :: sunvec_r ! residual N_Vector ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: uu(:,:) - real(c_double), pointer :: up(:,:) - real(c_double), pointer :: r(:,:) + real(c_double), pointer :: uu(:, :) + real(c_double), pointer :: up(:, :) + real(c_double), pointer :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -507,38 +504,37 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) ! get data arrays from SUNDIALS vectors uu(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) !======= Internals ============ ! Initialize uu on all grid points - do j = 1,mgrid - yfact = dx * (j-1) - do i = 1,mgrid - xfact = dx * (i-1) - uu(i,j) = 16.d0 * xfact * (1.d0 - xfact) * yfact * (1.d0 - yfact) - end do + do j = 1, mgrid + yfact = dx*(j - 1) + do i = 1, mgrid + xfact = dx*(i - 1) + uu(i, j) = 16.d0*xfact*(1.d0 - xfact)*yfact*(1.d0 - yfact) + end do end do ! Initialize up vector to 0 up = 0.d0 ! resHeat sets res to negative of ODE RHS values at interior points - retval = resHeat(0.d0, sunvec_u, sunvec_up, sunvec_r, C_NULL_PTR) + retval = resHeat(0.d0, sunvec_u, sunvec_up, sunvec_r, c_null_ptr) ! Copy -r into up to get correct interior initial up values up = -r ! Set up at boundary points to zero - up(1,:) = 0.d0 - up(mgrid,:) = 0.d0 - up(:,1) = 0.d0 - up(:,mgrid) = 0.d0 + up(1, :) = 0.d0 + up(mgrid, :) = 0.d0 + up(:, 1) = 0.d0 + up(:, mgrid) = 0.d0 return end subroutine SetInitialProfile - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -561,16 +557,15 @@ subroutine PrintHeader(rtol, atol) print *, " Discretized heat equation on 2D unit square." print *, " Zero boundary conditions, polynomial initial conditions." print '(2(a,i2),a,i3)', " Mesh dimensions: ", mgrid, " x ", mgrid, & - " Total system size: ", neq + " Total system size: ", neq print *, " " - print '(2(a,f5.3))', "Tolerance parameters: rtol = ", rtol," atol = ", atol + print '(2(a,f5.3))', "Tolerance parameters: rtol = ", rtol, " atol = ", atol print *, "Constraints set to force all solution components >= 0." print *, "Linear solver: SPGMR, preconditioner using diagonal elements." return end subroutine PrintHeader - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -586,7 +581,7 @@ subroutine PrintOutput(ida_mem, t, uu) ! calling variable type(c_ptr) :: ida_mem - real(c_double) :: t, uu(mgrid,mgrid) + real(c_double) :: t, uu(mgrid, mgrid) ! internal variables integer(c_int) :: retval, kused(1) @@ -599,66 +594,65 @@ subroutine PrintOutput(ida_mem, t, uu) retval = FIDAGetLastOrder(ida_mem, kused) if (retval /= 0) then - print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumSteps(ida_mem, nst) if (retval /= 0) then - print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumResEvals(ida_mem, nre) if (retval /= 0) then - print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetLastStep(ida_mem, hused) if (retval /= 0) then - print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumJtimesEvals(ida_mem, nje) if (retval /= 0) then - print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinIters(ida_mem, nli) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinResEvals(ida_mem, nreLS) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecEvals(ida_mem, npe) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecSolves(ida_mem, nps) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 end if - print '(f5.2,1x,es13.5,1x,i1,2x,3(i3,2x),2(i4,2x),es9.2,2x,2(i3,1x))', & - t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps + t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps end subroutine PrintOutput diff --git a/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 b/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 index 63a7807eec..96b0122858 100644 --- a/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 +++ b/examples/ida/F2003_serial/idaRoberts_dns_f2003.f90 @@ -64,7 +64,7 @@ module dae_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function resrob(tres, sunvec_y, sunvec_yp, sunvec_r, user_data) & - result(ierr) bind(C,name='resrob') + result(ierr) bind(C, name='resrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -79,7 +79,7 @@ integer(c_int) function resrob(tres, sunvec_y, sunvec_yp, sunvec_r, user_data) & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_yp ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yval(:) @@ -89,15 +89,15 @@ integer(c_int) function resrob(tres, sunvec_y, sunvec_yp, sunvec_r, user_data) & !======= Internals ============ ! get data arrays from SUNDIALS vectors - yval => FN_VGetArrayPointer(sunvec_y) + yval => FN_VGetArrayPointer(sunvec_y) ypval => FN_VGetArrayPointer(sunvec_yp) - rval => FN_VGetArrayPointer(sunvec_r) + rval => FN_VGetArrayPointer(sunvec_r) ! fill residual vector - rval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) - rval(2) = -rval(1) - 3.0d7*yval(2)**2 - ypval(2) - rval(1) = rval(1) - ypval(1) - rval(3) = yval(1) + yval(2) + yval(3) - 1.d0 + rval(1) = -0.04d0*yval(1) + 1.0d4*yval(2)*yval(3) + rval(2) = -rval(1) - 3.0d7*yval(2)**2 - ypval(2) + rval(1) = rval(1) - ypval(1) + rval(3) = yval(1) + yval(2) + yval(3) - 1.d0 ! return success ierr = 0 @@ -114,7 +114,7 @@ end function resrob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function grob(t, sunvec_y, sunvec_yp, gout, user_data) & - result(ierr) bind(C,name='grob') + result(ierr) bind(C, name='grob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -129,7 +129,7 @@ integer(c_int) function grob(t, sunvec_y, sunvec_yp, gout, user_data) & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_yp ! derivative N_Vector real(c_double) :: gout(2) ! root function values - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yval(:) @@ -158,8 +158,8 @@ end function grob ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jacrob(t, cj, sunvec_y, sunvec_yp, sunvec_r, & - sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & - result(ierr) bind(C,name='jacrob') + sunmat_J, user_data, sunvec_t1, sunvec_t2, sunvec_t3) & + result(ierr) bind(C, name='jacrob') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -176,15 +176,14 @@ integer(c_int) function jacrob(t, cj, sunvec_y, sunvec_yp, sunvec_r, & type(N_Vector) :: sunvec_yp ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 type(N_Vector) :: sunvec_t3 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer :: yval(:) - real(c_double), pointer :: J(:,:) - + real(c_double), pointer :: J(:, :) !======= Internals ============ @@ -193,15 +192,15 @@ integer(c_int) function jacrob(t, cj, sunvec_y, sunvec_yp, sunvec_r, & j(1:3, 1:3) => FSUNDenseMatrix_Data(sunmat_J) ! fill Jacobian entries - J(1,1) = -0.04d0 - cj - J(2,1) = 0.04d0 - J(3,1) = 1.d0 - J(1,2) = 1.d4*yval(3) - J(2,2) = -1.d4*yval(3) - 6.0d7*yval(2) - cj - J(3,2) = 1.d0 - J(1,3) = 1.d4*yval(2) - J(2,3) = -1.d4*yval(2) - J(3,3) = 1.d0 + J(1, 1) = -0.04d0 - cj + J(2, 1) = 0.04d0 + J(3, 1) = 1.d0 + J(1, 2) = 1.d4*yval(3) + J(2, 2) = -1.d4*yval(3) - 6.0d7*yval(2) - cj + J(3, 2) = 1.d0 + J(1, 3) = 1.d4*yval(2) + J(2, 3) = -1.d4*yval(2) + J(3, 3) = 1.d0 ! return success ierr = 0 @@ -233,16 +232,16 @@ integer(c_int) function check_ans(y, t, rtol, atol) result(passfail) ewt = 1.d0/(rtol*dabs(ref) + 10.d0*atol) ! compute the solution error - ref = y-ref - err = dsqrt( dot_product(ewt*ref,ewt*ref)/3 ) + ref = y - ref + err = dsqrt(dot_product(ewt*ref, ewt*ref)/3) ! is the solution within the tolerances (pass=0 or fail=1)? passfail = 0 - if (err .ge. 1.d0) then - passfail = 1 - print *, " " - print *, "SUNDIALS_WARNING: check_ans error=", err - print *, " " + if (err >= 1.d0) then + passfail = 1 + print *, " " + print *, "SUNDIALS_WARNING: check_ans error=", err + print *, " " end if return @@ -252,7 +251,6 @@ end function check_ans end module dae_mod ! ------------------------------------------------------------------ - program main !======= Inclusions =========== @@ -272,11 +270,11 @@ program main real(c_double) :: rtol, t0, tout1, tout, tret(1) integer(c_int) :: iout, retval, retvalr, nrtfn, rootsfound(2) - type(N_Vector), pointer :: sunvec_y ! sundials solution vector - type(N_Vector), pointer :: sunvec_yp ! sundials derivative vector - type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix - type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver + type(N_Vector), pointer :: sunvec_y ! sundials solution vector + type(N_Vector), pointer :: sunvec_yp ! sundials derivative vector + type(N_Vector), pointer :: sunvec_av ! sundials tolerance vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix + type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(SUNNonLinearSolver), pointer :: sunnonlin_NLS ! sundials nonlinear solver type(c_ptr) :: ida_mem ! IDA memory type(c_ptr) :: sunctx ! SUNDIALS simulation context @@ -306,20 +304,20 @@ program main ! create serial vectors sunvec_y => FN_VMake_Serial(neq, yval, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_yp => FN_VMake_Serial(neq, ypval, sunctx) if (.not. associated(sunvec_yp)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_av => FN_VMake_Serial(neq, avtol, sunctx) if (.not. associated(sunvec_av)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! set integration limits @@ -331,57 +329,57 @@ program main ! Call FIDACreate and FIDAInit to initialize IDA memory ida_mem = FIDACreate(sunctx) if (.not. c_associated(ida_mem)) then - print *, 'ERROR: ida_mem = NULL' - stop 1 + print *, 'ERROR: ida_mem = NULL' + stop 1 end if retval = FIDAInit(ida_mem, c_funloc(resrob), t0, sunvec_y, sunvec_yp) if (retval /= 0) then - print *, 'Error in FIDAInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAInit, retval = ', retval, '; halting' + stop 1 end if ! Call FIDASVtolerances to set tolerances retval = FIDASVtolerances(ida_mem, rtol, sunvec_av) if (retval /= 0) then - print *, 'Error in FIDASVtolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASVtolerances, retval = ', retval, '; halting' + stop 1 end if ! Call FIDARootInit to specify the root function grob with 2 components nrtfn = 2 retval = FIDARootInit(ida_mem, nrtfn, c_funloc(grob)) if (retval /= 0) then - print *, 'Error in FIDARootInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDARootInit, retval = ', retval, '; halting' + stop 1 end if ! Create dense SUNMatrix for use in linear solves sunmat_A => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_A)) then - print *, 'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! Create dense SUNLinearSolver object sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_A, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! Attach the matrix and linear solver - retval = FIDASetLinearSolver(ida_mem, sunlinsol_LS, sunmat_A); + retval = FIDASetLinearSolver(ida_mem, sunlinsol_LS, sunmat_A); if (retval /= 0) then - print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the user-supplied Jacobian routine retval = FIDASetJacFn(ida_mem, c_funloc(jacrob)) if (retval /= 0) then - print *, 'Error in FIDASetJacFn, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetJacFn, retval = ', retval, '; halting' + stop 1 end if ! Create Newton SUNNonlinearSolver object. IDA uses a @@ -390,15 +388,15 @@ program main ! solely for demonstration purposes. sunnonlin_NLS => FSUNNonlinSol_Newton(sunvec_y, sunctx) if (.not. associated(sunnonlin_NLS)) then - print *, 'ERROR: sunnonlinsol = NULL' - stop 1 + print *, 'ERROR: sunnonlinsol = NULL' + stop 1 end if ! Attach the nonlinear solver retval = FIDASetNonlinearSolver(ida_mem, sunnonlin_NLS) if (retval /= 0) then - print *, 'Error in FIDASetNonlinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetNonlinearSolver, retval = ', retval, '; halting' + stop 1 end if ! In loop, call IDASolve, print results, and test for error. @@ -408,29 +406,29 @@ program main tout = tout1 do - retval = FIDASolve(ida_mem, tout, tret, sunvec_y, sunvec_yp, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - endif + retval = FIDASolve(ida_mem, tout, tret, sunvec_y, sunvec_yp, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if - call PrintOutput(ida_mem, tret(1), yval) + call PrintOutput(ida_mem, tret(1), yval) - if (retval .eq. IDA_ROOT_RETURN) then - retvalr = FIDAGetRootInfo(ida_mem, rootsfound) - if (retvalr < 0) then - print *, 'Error in FIDAGetRootInfo, retval = ', retval, '; halting' - stop 1 - endif - print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) - end if + if (retval == IDA_ROOT_RETURN) then + retvalr = FIDAGetRootInfo(ida_mem, rootsfound) + if (retvalr < 0) then + print *, 'Error in FIDAGetRootInfo, retval = ', retval, '; halting' + stop 1 + end if + print '(a,2(i2,2x))', " rootsfound[] = ", rootsfound(1), rootsfound(2) + end if - if (retval .eq. IDA_SUCCESS) then - iout = iout+1 - tout = tout*10.d0 - end if + if (retval == IDA_SUCCESS) then + iout = iout + 1 + tout = tout*10.d0 + end if - if (iout .eq. NOUT) exit + if (iout == NOUT) exit end do @@ -450,7 +448,6 @@ program main end program main - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -475,8 +472,8 @@ subroutine PrintHeader(rtol, avtol, y) print *, " Three equation chemical kinetics problem." print *, " " print *, "Linear solver: DENSE, with user-supplied Jacobian." - print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ",rtol," atol = ", avtol - print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (",y,")" + print '(a,f6.4,a,3(es7.0,1x))', "Tolerance parameters: rtol = ", rtol, " atol = ", avtol + print '(a,3(f5.2,1x),a)', "Initial conditions y0 = (", y, ")" print *, "Constraints and id not used." print *, " " print *, "-----------------------------------------------------------------------" @@ -486,7 +483,6 @@ subroutine PrintHeader(rtol, avtol, y) return end subroutine PrintHeader - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -513,28 +509,27 @@ subroutine PrintOutput(ida_mem, t, y) retval = FIDAGetLastOrder(ida_mem, kused) if (retval /= 0) then - print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumSteps(ida_mem, nst) if (retval /= 0) then - print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetLastStep(ida_mem, hused) if (retval /= 0) then - print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' + stop 1 end if print '(es12.4,1x,3(es12.4,1x),a,i3,2x,i1,1x,es12.4)', & - t, y(1), y(2), y(3), "| ", nst, kused(1), hused(1) + t, y(1), y(2), y(3), "| ", nst, kused(1), hused(1) end subroutine PrintOutput - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -557,56 +552,56 @@ subroutine PrintFinalStats(ida_mem) retval = FIDAGetNumSteps(ida_mem, nst) if (retval /= 0) then - print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumResEvals(ida_mem, nre) if (retval /= 0) then - print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumJacEvals(ida_mem, nje) if (retval /= 0) then - print *, 'Error in FIDAGetNumJacEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumJacEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvIters(ida_mem, nni) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumErrTestFails(ida_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(ida_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinResEvals(ida_mem, nreLS) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumGEvals(ida_mem, nge) if (retval /= 0) then - print *, 'Error in FIDAGetNumGEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumGEvals, retval = ', retval, '; halting' + stop 1 end if print *, " " print *, "Final Run Statistics: " print *, "Number of steps = ", nst - print *, "Number of residual evaluations = ", nre+nreLS + print *, "Number of residual evaluations = ", nre + nreLS print *, "Number of Jacobian evaluations = ", nje print *, "Number of nonlinear iterations = ", nni print *, "Number of error test failures = ", netf diff --git a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 index d41404ff8f..7f2d4b80d4 100644 --- a/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 +++ b/examples/idas/F2003_serial/idasAkzoNob_ASAi_dns_f2003.f90 @@ -33,7 +33,6 @@ module dae_mod use fsundials_core_mod implicit none - ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype ! we set the integer kind used for indices in this example based ! on the the index size SUNDIALS was compiled with so that it works @@ -47,23 +46,23 @@ module dae_mod ! problem parameters integer(kind=myindextype), parameter :: NEQ = 6 integer(c_long), parameter :: STEPS = 150 - real(c_double), parameter :: T0 = 0.0d0 - real(c_double), parameter :: TF = 180.d0 - real(c_double), parameter :: RTOL = 1e-08 - real(c_double), parameter :: ATOL = 1e-10 - real(c_double), parameter :: RTOLB = 1e-06 - real(c_double), parameter :: ATOLB = 1e-08 - real(c_double), parameter :: RTOLQ = 1e-10 - real(c_double), parameter :: ATOLQ = 1e-12 + real(c_double), parameter :: T0 = 0.0d0 + real(c_double), parameter :: TF = 180.d0 + real(c_double), parameter :: RTOL = 1e-08 + real(c_double), parameter :: ATOL = 1e-10 + real(c_double), parameter :: RTOLB = 1e-06 + real(c_double), parameter :: ATOLB = 1e-08 + real(c_double), parameter :: RTOLQ = 1e-10 + real(c_double), parameter :: ATOLQ = 1e-12 ! problem constants - real(c_double) :: ZERO = 0.0d0 + real(c_double) :: ZERO = 0.0d0 real(c_double) :: QUARTER = 0.25d0 - real(c_double) :: HALF = 0.5d0 - real(c_double) :: ONE = 1.0d0 - real(c_double) :: TWO = 2.0d0 - real(c_double) :: FOUR = 4.0d0 - real(c_double) :: EIGHT = 8.0d0 + real(c_double) :: HALF = 0.5d0 + real(c_double) :: ONE = 1.0d0 + real(c_double) :: TWO = 2.0d0 + real(c_double) :: FOUR = 4.0d0 + real(c_double) :: EIGHT = 8.0d0 ! problem data real(c_double) :: k1, k2, k3, k4 @@ -72,7 +71,7 @@ module dae_mod contains integer(c_int) function res(t, nv_yy, nv_yd, nv_resval, userdata) & - result(retval) bind(C,name='res') + result(retval) bind(C, name='res') use, intrinsic :: iso_c_binding implicit none @@ -88,8 +87,8 @@ integer(c_int) function res(t, nv_yy, nv_yd, nv_resval, userdata) & real(c_double) :: r1, r2, r3, r4, r5, Fin real(c_double), pointer :: yy(:), yd(:), resval(:) - yy => FN_VGetArrayPointer(nv_yy) - yd => FN_VGetArrayPointer(nv_yd) + yy => FN_VGetArrayPointer(nv_yy) + yd => FN_VGetArrayPointer(nv_yd) resval => FN_VGetArrayPointer(nv_resval) y1 = yy(1) @@ -105,12 +104,12 @@ integer(c_int) function res(t, nv_yy, nv_yd, nv_resval, userdata) & yd4 = yd(4) yd5 = yd(5) - r1 = k1 * (y1**4) * sqrt(y2) - r2 = k2 * y3 * y4 - r3 = k2/K * y1 * y5 - r4 = k3 * y1 * y4 * y4 - r5 = k4 * y6 * y6 * sqrt(y2) - Fin = klA * ( pCO2/H - y2 ) + r1 = k1*(y1**4)*sqrt(y2) + r2 = k2*y3*y4 + r3 = k2/K*y1*y5 + r4 = k3*y1*y4*y4 + r5 = k4*y6*y6*sqrt(y2) + Fin = klA*(pCO2/H - y2) resval(1) = yd1 + TWO*r1 - r2 + r3 + r4 resval(2) = yd2 + HALF*r1 + r4 + HALF*r5 - Fin @@ -124,7 +123,7 @@ integer(c_int) function res(t, nv_yy, nv_yd, nv_resval, userdata) & end function res integer(c_int) function rhsQ(t, nv_yy, nv_yp, nv_qdot, userdata) & - result(retval) bind(C,name='rhsQ') + result(retval) bind(C, name='rhsQ') use, intrinsic :: iso_c_binding implicit none @@ -138,7 +137,7 @@ integer(c_int) function rhsQ(t, nv_yy, nv_yp, nv_qdot, userdata) & real(c_double), pointer :: qdot(:), yy(:) qdot => FN_VGetArrayPointer(nv_qdot) - yy => FN_VGetArrayPointer(nv_yy) + yy => FN_VGetArrayPointer(nv_yy) qdot(1) = yy(1) retval = 0 @@ -146,7 +145,7 @@ integer(c_int) function rhsQ(t, nv_yy, nv_yp, nv_qdot, userdata) & end function rhsQ integer(c_int) function resB(tt, nv_yy, nv_yp, nv_yyB, nv_ypB, nv_rrB, userdata) & - result(retval) bind(C,name='resB') + result(retval) bind(C, name='resB') use, intrinsic :: iso_c_binding implicit none @@ -162,7 +161,7 @@ integer(c_int) function resB(tt, nv_yy, nv_yp, nv_yyB, nv_ypB, nv_rrB, userdata) real(c_double) :: y2tohalf, y1to3, k2overK, tmp1, tmp2 real(c_double), pointer :: yy(:), yyB(:), ypB(:), rrb(:) - yy => FN_VGetArrayPointer(nv_yy) + yy => FN_VGetArrayPointer(nv_yy) yyB => FN_VGetArrayPointer(nv_yyB) ypB => FN_VGetArrayPointer(nv_ypB) rrB => FN_VGetArrayPointer(nv_rrB) @@ -191,27 +190,27 @@ integer(c_int) function resB(tt, nv_yy, nv_yp, nv_yyB, nv_ypB, nv_rrB, userdata) y1to3 = y1*y1*y1 k2overK = k2/K - tmp1 = k1* y1to3 * y2tohalf + tmp1 = k1*y1to3*y2tohalf tmp2 = k3*y4*y4 - rrB(1) = 1 + ypB1 - (EIGHT*tmp1 + k2overK*y5 + tmp2)*yB1 & - - (TWO*tmp1+tmp2)*yB2 + (FOUR*tmp1+k2overK*y5)*yB3 & - + k2overK*y5*(yB4-yB5) - TWO*tmp2*yB4 + Ks*y4*yB6 + rrB(1) = 1 + ypB1 - (EIGHT*tmp1 + k2overK*y5 + tmp2)*yB1 & + - (TWO*tmp1 + tmp2)*yB2 + (FOUR*tmp1 + k2overK*y5)*yB3 & + + k2overK*y5*(yB4 - yB5) - TWO*tmp2*yB4 + Ks*y4*yB6 - tmp1 = k1 * y1*y1to3 * (y2tohalf/y2) - tmp2 = k4 * y6*y6 * (y2tohalf/y2) + tmp1 = k1*y1*y1to3*(y2tohalf/y2) + tmp2 = k4*y6*y6*(y2tohalf/y2) rrB(2) = ypB2 - tmp1*yB1 - (QUARTER*tmp1 + QUARTER*tmp2 + klA)*yB2 & - + HALF*tmp1*yB3 + HALF*tmp2*yB5 + + HALF*tmp1*yB3 + HALF*tmp2*yB5 - rrB(3) = ypB3 + k2*y4*(yB1-yB3-yB4+yB5) + rrB(3) = ypB3 + k2*y4*(yB1 - yB3 - yB4 + yB5) tmp1 = k3*y1*y4 tmp2 = k2*y3 - rrB(4) = ypB4 + (tmp2-TWO*tmp1)*yB1 - TWO*tmp1*yB2 - tmp2*yB3 & - - (tmp2+FOUR*tmp1)*yB4 + tmp2*yB5 + Ks*y1*yB6 + rrB(4) = ypB4 + (tmp2 - TWO*tmp1)*yB1 - TWO*tmp1*yB2 - tmp2*yB3 & + - (tmp2 + FOUR*tmp1)*yB4 + tmp2*yB5 + Ks*y1*yB6 - rrB(5) = ypB5 - k2overK*y1*(yB1-yB3-yB4+yB5) + rrB(5) = ypB5 - k2overK*y1*(yB1 - yB3 - yB4 + yB5) - rrB(6) = k4*y6*y2tohalf*(2*yB5-yB2) - yB6 + rrB(6) = k4*y6*y2tohalf*(2*yB5 - yB2) - yB6 retval = 0 return @@ -228,20 +227,19 @@ subroutine PrintOutput(nv_yB, nv_ypB) yB => FN_VGetArrayPointer(nv_yB) - write(*,'(1x,A,es12.4)') "dG/dy0: ", yB(1) - write(*,'(1x,A,es12.4)') " ", yB(2) - write(*,'(1x,A,es12.4)') " ", yB(3) - write(*,'(1x,A,es12.4)') " ", yB(4) - write(*,'(1x,A,es12.4)') " ", yB(5) - write(*,'(1x,A,es12.4)') " ", yB(6) - write(*,*) "--------------------------------------------------------" - write(*,*) "" + write (*, '(1x,A,es12.4)') "dG/dy0: ", yB(1) + write (*, '(1x,A,es12.4)') " ", yB(2) + write (*, '(1x,A,es12.4)') " ", yB(3) + write (*, '(1x,A,es12.4)') " ", yB(4) + write (*, '(1x,A,es12.4)') " ", yB(5) + write (*, '(1x,A,es12.4)') " ", yB(6) + write (*, *) "--------------------------------------------------------" + write (*, *) "" end subroutine end module dae_mod - ! Main program program main use, intrinsic :: iso_c_binding @@ -261,11 +259,11 @@ program main real(c_double) :: time(1) integer(c_long) :: nst(1), nstB(1) integer(c_int) :: indexB(1) - real(c_double), pointer :: yy(:), q(:) - type(N_Vector), pointer :: nv_yy, nv_yp, nv_rr, nv_q - real(c_double), pointer :: ypB(:) - type(N_Vector), pointer :: nv_yB, nv_ypB - type(SUNMatrix), pointer :: A, AB + real(c_double), pointer :: yy(:), q(:) + type(N_Vector), pointer :: nv_yy, nv_yp, nv_rr, nv_q + real(c_double), pointer :: ypB(:) + type(N_Vector), pointer :: nv_yB, nv_ypB + type(SUNMatrix), pointer :: A, AB type(SUNLinearSolver), pointer :: LS, LSB ! Consistent IC for y, y'. @@ -275,23 +273,23 @@ program main real(c_double) :: y04 = 0.007d0 real(c_double) :: y05 = 0.0d0 - write(*,*) "" - write(*,*) "Adjoint Sensitivity Example for Akzo-Nobel Chemical Kinetics" - write(*,*) "-------------------------------------------------------------" - write(*,*) "Sensitivity of G = int_t0^tf (y1) dt with respect to IC." - write(*,*) "-------------------------------------------------------------" - write(*,*) "" + write (*, *) "" + write (*, *) "Adjoint Sensitivity Example for Akzo-Nobel Chemical Kinetics" + write (*, *) "-------------------------------------------------------------" + write (*, *) "Sensitivity of G = int_t0^tf (y1) dt with respect to IC." + write (*, *) "-------------------------------------------------------------" + write (*, *) "" ! Fill problem data with the appropriate values for coefficients. - k1 = 18.7d0 - k2 = 0.58d0 - k3 = 0.09d0 - k4 = 0.42d0 - K = 34.4d0 - klA = 3.3d0 - Ks = 115.83d0 + k1 = 18.7d0 + k2 = 0.58d0 + k3 = 0.09d0 + k4 = 0.42d0 + K = 34.4d0 + klA = 3.3d0 + Ks = 115.83d0 pCO2 = 0.9d0 - H = 737.0d0 + H = 737.0d0 ! Create the SUNDIALS simulation context retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) @@ -302,18 +300,18 @@ program main nv_yp => FN_VNew_Serial(NEQ, sunctx) ! Set IC - yy => FN_VGetArrayPointer(nv_yy) + yy => FN_VGetArrayPointer(nv_yy) yy(1) = y01 yy(2) = y02 yy(3) = y03 yy(4) = y04 yy(5) = y05 - yy(6) = Ks * y01 * y04 + yy(6) = Ks*y01*y04 ! Get y' = - res(t0, y, 0) call FN_VConst(ZERO, nv_yp) - nv_rr => FN_VNew_Serial(NEQ, sunctx) + nv_rr => FN_VNew_Serial(NEQ, sunctx) retval = res(T0, nv_yy, nv_yp, nv_rr, c_null_ptr) call FN_VScale(-ONE, nv_rr, nv_yp) call FN_VDestroy(nv_rr) @@ -321,21 +319,21 @@ program main ! Create and initialize q0 for quadratures. nv_q => FN_VNew_Serial(1_myindextype, sunctx) if (.not. associated(nv_q)) then - write(*,*) 'ERROR: FN_VNew_Serial returned NULL' + write (*, *) 'ERROR: FN_VNew_Serial returned NULL' stop 1 end if - q => FN_VGetArrayPointer(nv_q) + q => FN_VGetArrayPointer(nv_q) if (.not. associated(q)) then - write(*,*) 'ERROR: FN_VGetArrayPointer returned NULL' + write (*, *) 'ERROR: FN_VGetArrayPointer returned NULL' stop 1 end if q(1) = ZERO ! Call FIDACreate and FIDAInit to initialize FIDA memory - mem = FIDACreate(sunctx) + mem = FIDACreate(sunctx) if (.not. c_associated(mem)) then - write(*,*) 'ERROR: FIDACreate returned NULL' + write (*, *) 'ERROR: FIDACreate returned NULL' stop 1 end if @@ -349,14 +347,14 @@ program main ! Create dense SUNMatrix for use in linear solves A => FSUNDenseMatrix(NEQ, NEQ, sunctx) if (.not. associated(A)) then - write(*,*) 'ERROR: FSUNDenseMatrix returned NULL' + write (*, *) 'ERROR: FSUNDenseMatrix returned NULL' stop 1 end if ! Create dense SUNLinearSolver object LS => FSUNLinSol_Dense(nv_yy, A, sunctx) if (.not. associated(LS)) then - write(*,*) 'ERROR: FSUNLinSol_Dense returned NULL' + write (*, *) 'ERROR: FSUNLinSol_Dense returned NULL' stop 1 end if @@ -380,34 +378,34 @@ program main call check_retval(retval, "FIDAAdjInit") ! FORWARD run. - write(*,'(1x,A)',advance='no') "Forward integration ... " + write (*, '(1x,A)', advance='no') "Forward integration ... " retval = FIDASolveF(mem, TF, time, nv_yy, nv_yp, IDA_NORMAL, ncheck) call check_retval(retval, "FIDASolveF") retval = FIDAGetNumSteps(mem, nst) - write(*,'(A,i6,A)') "done ( nst = ", nst, " )" + write (*, '(A,i6,A)') "done ( nst = ", nst, " )" retval = FIDAGetQuad(mem, time, nv_q) - write(*,'(1x,A,F24.16)') "G: ", q(1) - write(*,*) "--------------------------------------------------------" - write(*,*) "" + write (*, '(1x,A,F24.16)') "G: ", q(1) + write (*, *) "--------------------------------------------------------" + write (*, *) "" ! BACKWARD run ! Initialize yB nv_yB => FN_VNew_Serial(NEQ, sunctx) if (.not. associated(nv_yB)) then - write(*,*) 'ERROR: FN_VNew_Serial returned NULL' + write (*, *) 'ERROR: FN_VNew_Serial returned NULL' stop 1 end if call FN_VConst(ZERO, nv_yB) nv_ypB => FN_VNew_Serial(NEQ, sunctx) if (.not. associated(nv_ypB)) then - write(*,*) 'ERROR: FN_VNew_Serial returned NULL' + write (*, *) 'ERROR: FN_VNew_Serial returned NULL' stop 1 end if call FN_VConst(ZERO, nv_ypB) - ypB => FN_VGetArrayPointer(nv_ypB) + ypB => FN_VGetArrayPointer(nv_ypB) ypB(1) = -ONE retval = FIDACreateB(mem, indexB) @@ -425,14 +423,14 @@ program main ! Create dense SUNMatrix for use in linear solves AB => FSUNDenseMatrix(NEQ, NEQ, sunctx) if (.not. associated(AB)) then - write(*,*) 'ERROR: FSUNDenseMatrix returned NULL' + write (*, *) 'ERROR: FSUNDenseMatrix returned NULL' stop 1 end if ! Create dense SUNLinearSolver object LSB => FSUNLinSol_Dense(nv_yB, AB, sunctx) if (.not. associated(LSB)) then - write(*,*) 'ERROR: FSUNLinSol_Dense returned NULL' + write (*, *) 'ERROR: FSUNLinSol_Dense returned NULL' stop 1 end if @@ -441,12 +439,12 @@ program main call check_retval(retval, "FIDASetLinearSolverB") ! Do the backward integration - write(*,'(1x,A)',advance='no') "Backward integration ... " + write (*, '(1x,A)', advance='no') "Backward integration ... " retval = FIDASolveB(mem, T0, IDA_NORMAL) call check_retval(retval, "FIDASolveB") - memB = FIDAGetAdjIDABmem(mem, indexB(1)) + memB = FIDAGetAdjIDABmem(mem, indexB(1)) retval = FIDAGetNumSteps(memB, nstB) - write(*,'(A,i6,A)') "done ( nst = ", nstB, " )" + write (*, '(A,i6,A)') "done ( nst = ", nstB, " )" retval = FIDAGetB(mem, indexB(1), time, nv_yB, nv_ypB) ! Print the solution @@ -474,7 +472,7 @@ subroutine check_retval(retval, name) integer(c_int) :: retval if (retval < 0) then - write(*,'(A,A,A,I4)') 'ERROR: ', name,' returned ', retval + write (*, '(A,A,A,I4)') 'ERROR: ', name, ' returned ', retval stop 1 end if end subroutine diff --git a/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 b/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 index 9ecad4f265..4a5f9ea763 100644 --- a/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 +++ b/examples/idas/F2003_serial/idasHeat2D_kry_f2003.f90 @@ -44,13 +44,13 @@ module dae_mod !======= Declarations ========= implicit none - integer(c_int), parameter :: nout = 11 - integer(c_int), parameter :: mgrid = 10 - integer(c_int64_t), parameter :: neq = mgrid*mgrid + integer(c_int), parameter :: nout = 11 + integer(c_int), parameter :: mgrid = 10 + integer(c_int64_t), parameter :: neq = mgrid*mgrid real(c_double) :: dx real(c_double) :: coeff - real(c_double) :: pp(mgrid,mgrid) + real(c_double) :: pp(mgrid, mgrid) contains @@ -63,7 +63,7 @@ module dae_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) & - result(ierr) bind(C,name='resHeat') + result(ierr) bind(C, name='resHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -76,12 +76,12 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: u(:,:) - real(c_double), pointer :: up(:,:) - real(c_double), pointer :: r(:,:) + real(c_double), pointer :: u(:, :) + real(c_double), pointer :: up(:, :) + real(c_double), pointer :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -89,18 +89,18 @@ integer(c_int) function resHeat(tres, sunvec_u, sunvec_up, sunvec_r, user_data) !======= Internals ============ ! get data arrays from SUNDIALS vectors - u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) + u(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) ! Initialize r to u, to take care of boundary equations r = u ! Loop over interior points; set res = up - (central difference) - do j = 2,mgrid-1 - do i = 2,mgrid-1 - r(i,j) = up(i,j) - coeff*( u(i-1,j) + u(i+1,j) + u(i,j-1) + u(i,j+1) - 4.d0*u(i,j)) - end do + do j = 2, mgrid - 1 + do i = 2, mgrid - 1 + r(i, j) = up(i, j) - coeff*(u(i - 1, j) + u(i + 1, j) + u(i, j - 1) + u(i, j + 1) - 4.d0*u(i, j)) + end do end do ! return success @@ -118,7 +118,7 @@ end function resHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_data) & - result(ierr) bind(C,name='PSetupHeat') + result(ierr) bind(C, name='PSetupHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -134,7 +134,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_up ! derivative N_Vector type(N_Vector) :: sunvec_r ! residual N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! local variables real(c_double) :: pelinv @@ -148,7 +148,7 @@ integer(c_int) function PSetupHeat(t, sunvec_u, sunvec_up, sunvec_r, cj, prec_da pelinv = 1.d0/(cj + 4.d0*coeff) ! set the interior points to the correct value for preconditioning - pp(2:mgrid-1, 2:mgrid-1) = pelinv + pp(2:mgrid - 1, 2:mgrid - 1) = pelinv ! return success ierr = 0 @@ -165,12 +165,11 @@ end function PSetupHeat ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, & - sunvec_sol, cj, delta, prec_data) result(ierr) bind(C,name='PSolveHeat') + sunvec_sol, cj, delta, prec_data) result(ierr) bind(C, name='PSolveHeat') !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -183,11 +182,11 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, type(N_Vector) :: sunvec_r ! residual N_Vector type(N_Vector) :: sunvec_rhs ! rhs N_Vector type(N_Vector) :: sunvec_sol ! solution N_Vector - type(c_ptr), value :: prec_data ! preconditioner data + type(c_ptr), value :: prec_data ! preconditioner data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: rhs(:,:) - real(c_double), pointer :: sol(:,:) + real(c_double), pointer :: rhs(:, :) + real(c_double), pointer :: sol(:, :) !======= Internals ============ @@ -196,7 +195,7 @@ integer(c_int) function PSolveHeat(t, sunvec_u, sunvec_up, sunvec_r, sunvec_rhs, sol(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_sol) ! Apply preconditioner to rhs to create sol - sol = rhs * pp + sol = rhs*pp ! return success ierr = 0 @@ -207,7 +206,6 @@ end function PSolveHeat end module dae_mod ! ------------------------------------------------------------------ - program main use, intrinsic :: iso_c_binding use fsundials_core_mod @@ -223,22 +221,22 @@ program main integer(c_long) :: netf(1), ncfn(1), ncfl(1) type(c_ptr) :: sunctx - type(N_Vector), pointer :: sunvec_u ! sundials solution vector - type(N_Vector), pointer :: sunvec_up ! sundials derivative vector - type(N_Vector), pointer :: sunvec_c ! sundials constraints vector - type(N_Vector), pointer :: sunvec_r ! sundials residual vector - type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_u ! sundials solution vector + type(N_Vector), pointer :: sunvec_up ! sundials derivative vector + type(N_Vector), pointer :: sunvec_c ! sundials constraints vector + type(N_Vector), pointer :: sunvec_r ! sundials residual vector + type(SUNMatrix), pointer :: sunmat_A ! sundials matrix (empty) type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: idas_mem ! IDA memory ! Solution, residual and constraints vectors, mgrid is set in the dae_mod module - real(c_double), dimension(mgrid,mgrid) :: uu, up, res, constraints + real(c_double), dimension(mgrid, mgrid) :: uu, up, res, constraints !======= Internals ============ ! Assign parameters in dae_mod - dx = 1.d0/(mgrid-1) - coeff = 1.d0/(dx * dx) + dx = 1.d0/(mgrid - 1) + coeff = 1.d0/(dx*dx) ! Create the SUNDIALS simulation context retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) @@ -250,26 +248,26 @@ program main ! Create N_Vectors sunvec_u => FN_VMake_Serial(neq, uu, sunctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_up => FN_VMake_Serial(neq, up, sunctx) if (.not. associated(sunvec_up)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_r => FN_VMake_Serial(neq, res, sunctx) if (.not. associated(sunvec_r)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_c => FN_VMake_Serial(neq, constraints, sunctx) if (.not. associated(sunvec_c)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! Initialize solution vectors @@ -279,64 +277,64 @@ program main constraints = 1.d0 ! Assign various parameters - t0 = 0.d0 - t1 = 0.01d0 + t0 = 0.d0 + t1 = 0.01d0 rtol = 0.d0 atol = 1.d-3 ! Call FIDACreate and FIDAInit to initialize solution idas_mem = FIDACreate(sunctx) if (.not. c_associated(idas_mem)) then - print *, 'ERROR: idas_mem = NULL' - stop 1 + print *, 'ERROR: idas_mem = NULL' + stop 1 end if retval = FIDASetConstraints(idas_mem, sunvec_c) if (retval /= 0) then - print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetConstraints, retval = ', retval, '; halting' + stop 1 end if retval = FIDAInit(idas_mem, c_funloc(resHeat), t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAInit, retval = ', retval, '; halting' + stop 1 end if retval = FIDASStolerances(idas_mem, rtol, atol) if (retval /= 0) then - print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASStolerances, retval = ', retval, '; halting' + stop 1 end if ! Create the linear solver SUNLinSol_SPGMR with left preconditioning ! and the default Krylov dimension sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, SUN_PREC_LEFT, 0, sunctx) if (.not. associated(sunlinsol_LS)) then - print *, 'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! IDA recommends allowing up to 5 restarts (default is 0) retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, 5) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 end if ! Attach the linear solver (will NULL SUNMatrix object) sunmat_A => null() retval = FIDASetLinearSolver(idas_mem, sunlinsol_LS, sunmat_A) if (retval /= 0) then - print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! Set the preconditioner solve and setup functions */ retval = FIDASetPreconditioner(idas_mem, c_funloc(PsetupHeat), c_funloc(PsolveHeat)) if (retval /= 0) then - print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDASetPreconditioner, retval = ', retval, '; halting' + stop 1 end if ! Print output heading @@ -360,33 +358,33 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(idas_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(idas_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(idas_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(idas_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(idas_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(idas_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(idas_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -406,14 +404,14 @@ program main retval = FIDAReInit(idas_mem, t0, sunvec_u, sunvec_up) if (retval /= 0) then - print *, 'Error in FIDAReInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAReInit, retval = ', retval, '; halting' + stop 1 end if retval = FSUNLinSol_SPGMRSetGSType(sunlinsol_LS, SUN_CLASSICAL_GS) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetGSType, retval = ', retval, '; halting' + stop 1 end if ! Print case number, output table heading, and initial line of table @@ -429,34 +427,34 @@ program main ! Loop over output times, call IDASolve, and print results tout = t1 - do iout = 1,NOUT - retval = FIDASolve(idas_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) - if (retval < 0) then - print *, 'Error in FIDASolve, retval = ', retval, '; halting' - stop 1 - end if - call PrintOutput(idas_mem, tret(1), uu) - tout = 2.d0*tout + do iout = 1, NOUT + retval = FIDASolve(idas_mem, tout, tret, sunvec_u, sunvec_up, IDA_NORMAL) + if (retval < 0) then + print *, 'Error in FIDASolve, retval = ', retval, '; halting' + stop 1 + end if + call PrintOutput(idas_mem, tret(1), uu) + tout = 2.d0*tout end do ! Print remaining counters retval = FIDAGetNumErrTestFails(idas_mem, netf) if (retval /= 0) then - print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumErrTestFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvConvFails(idas_mem, ncfn) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvConvFails, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinConvFails(idas_mem, ncfl) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, " " @@ -475,7 +473,6 @@ program main end program main - ! ---------------------------------------------------------------- ! SetInitialProfile: routine to initialize u and up vectors. ! ---------------------------------------------------------------- @@ -495,9 +492,9 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) type(N_Vector) :: sunvec_r ! residual N_Vector ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: uu(:,:) - real(c_double), pointer :: up(:,:) - real(c_double), pointer :: r(:,:) + real(c_double), pointer :: uu(:, :) + real(c_double), pointer :: up(:, :) + real(c_double), pointer :: r(:, :) ! local variables integer(c_int64_t) :: i, j @@ -509,17 +506,17 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) ! get data arrays from SUNDIALS vectors uu(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_u) up(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_up) - r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) + r(1:mgrid, 1:mgrid) => FN_VGetArrayPointer(sunvec_r) !======= Internals ============ ! Initialize uu on all grid points - do j = 1,mgrid - yfact = dx * (j-1) - do i = 1,mgrid - xfact = dx * (i-1) - uu(i,j) = 16.d0 * xfact * (1.d0 - xfact) * yfact * (1.d0 - yfact) - end do + do j = 1, mgrid + yfact = dx*(j - 1) + do i = 1, mgrid + xfact = dx*(i - 1) + uu(i, j) = 16.d0*xfact*(1.d0 - xfact)*yfact*(1.d0 - yfact) + end do end do ! Initialize up vector to 0 @@ -532,15 +529,14 @@ subroutine SetInitialProfile(sunvec_u, sunvec_up, sunvec_r) up = -r ! Set up at boundary points to zero - up(1,:) = 0.d0 - up(mgrid,:) = 0.d0 - up(:,1) = 0.d0 - up(:,mgrid) = 0.d0 + up(1, :) = 0.d0 + up(mgrid, :) = 0.d0 + up(:, 1) = 0.d0 + up(:, mgrid) = 0.d0 return end subroutine SetInitialProfile - ! ---------------------------------------------------------------- ! PrintHeader: prints first lines of output (problem description) ! ---------------------------------------------------------------- @@ -563,16 +559,15 @@ subroutine PrintHeader(rtol, atol) print *, " Discretized heat equation on 2D unit square." print *, " Zero boundary conditions, polynomial initial conditions." print '(2(a,i2),a,i3)', " Mesh dimensions: ", mgrid, " x ", mgrid, & - " Total system size: ", neq + " Total system size: ", neq print *, " " - print '(2(a,f5.3))', "Tolerance parameters: rtol = ", rtol," atol = ", atol + print '(2(a,f5.3))', "Tolerance parameters: rtol = ", rtol, " atol = ", atol print *, "Constraints set to force all solution components >= 0." print *, "Linear solver: SPGMR, preconditioner using diagonal elements." return end subroutine PrintHeader - ! ---------------------------------------------------------------- ! PrintOutput ! ---------------------------------------------------------------- @@ -588,7 +583,7 @@ subroutine PrintOutput(idas_mem, t, uu) ! calling variable type(c_ptr) :: idas_mem - real(c_double) :: t, uu(mgrid,mgrid) + real(c_double) :: t, uu(mgrid, mgrid) ! internal variables integer(c_int) :: retval, kused(1) @@ -601,66 +596,65 @@ subroutine PrintOutput(idas_mem, t, uu) retval = FIDAGetLastOrder(idas_mem, kused) if (retval /= 0) then - print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastOrder, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumSteps(idas_mem, nst) if (retval /= 0) then - print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumSteps, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumNonlinSolvIters(idas_mem, nni) if (retval /= 0) then - print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumResEvals(idas_mem, nre) if (retval /= 0) then - print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetLastStep(idas_mem, hused) if (retval /= 0) then - print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetLastStep, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumJtimesEvals(idas_mem, nje) if (retval /= 0) then - print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumJtimesEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinIters(idas_mem, nli) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinIters, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumLinResEvals(idas_mem, nreLS) if (retval /= 0) then - print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumLinResEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecEvals(idas_mem, npe) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 end if retval = FIDAGetNumPrecSolves(idas_mem, nps) if (retval /= 0) then - print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FIDAGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 end if - print '(f5.2,1x,es13.5,1x,i1,2x,3(i3,2x),2(i4,2x),es9.2,2x,2(i3,1x))', & - t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps + t, umax, kused, nst, nni, nje, nre, nreLS, hused(1), npe, nps end subroutine PrintOutput diff --git a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 index e0fba580a1..9233fe7b4c 100644 --- a/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_parallel/kin_diagon_kry_f2003.f90 @@ -42,12 +42,12 @@ module kinDiagonKry_mod integer(c_int64_t) :: i, nlocal real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) real(c_double) :: p(neq) - integer(c_int), parameter :: prectype = 2 - integer(c_int), parameter :: maxl = 10 - integer(c_int), parameter :: maxlrst = 2 + integer(c_int), parameter :: prectype = 2 + integer(c_int), parameter :: maxl = 10 + integer(c_int), parameter :: maxlrst = 2 integer(c_long), parameter :: msbpre = 5 - real(c_double), parameter :: fnormtol = 1.0d-5 - real(c_double), parameter :: scsteptol = 1.0d-4 + real(c_double), parameter :: fnormtol = 1.0d-5 + real(c_double), parameter :: scsteptol = 1.0d-4 ! MPI domain decomposition information integer, target :: comm ! communicator object @@ -75,16 +75,16 @@ subroutine init(sunvec_u, sunvec_s, sunvec_c) ! local variables integer(c_int64_t) :: ii - u(1:nlocal) => FN_VGetArrayPointer(sunvec_u) - scale(1:nlocal) => FN_VGetArrayPointer(sunvec_s) + u(1:nlocal) => FN_VGetArrayPointer(sunvec_u) + scale(1:nlocal) => FN_VGetArrayPointer(sunvec_s) constr(1:nlocal) => FN_VGetArrayPointer(sunvec_c) ! ------------------------- ! Set initial guess, and disable scaling - do i = 1,nlocal - ii = i + myid * nlocal - u(i) = 2.0d0 * dble(ii) + do i = 1, nlocal + ii = i + myid*nlocal + u(i) = 2.0d0*dble(ii) end do scale = 1.0d0 constr = 0.0d0 @@ -101,7 +101,7 @@ end subroutine init ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function func(sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use fsundials_core_mod @@ -127,15 +127,14 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & ff(1:nlocal) => FN_VGetArrayPointer(sunvec_f) ! loop over domain, computing our system f(u) = 0 - do i = 1,nlocal - ! set local variables - ii = i + myid * nlocal + do i = 1, nlocal + ! set local variables + ii = i + myid*nlocal - ! applying the constraint f(u) = u(i)^2 - i^2 - ff(i) = uu(i)*uu(i) - dble(ii*ii) + ! applying the constraint f(u) = u(i)^2 - i^2 + ff(i) = uu(i)*uu(i) - dble(ii*ii) end do - ! return success ierr = 0 return @@ -152,7 +151,7 @@ end function func ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & - sunvec_fs, user_data) result(ierr) bind(C) + sunvec_fs, user_data) result(ierr) bind(C) !======= Inclusions =========== use fsundials_core_mod @@ -176,13 +175,12 @@ integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & udata(1:nlocal) => FN_VGetArrayPointer(sunvec_u) ! loop over domain - do i = 1,nlocal + do i = 1, nlocal - ! setup preconditioner - p(i) = 0.5d0 / (udata(i) + 5.0d0) + ! setup preconditioner + p(i) = 0.5d0/(udata(i) + 5.0d0) end do - ! return success ierr = 0 return @@ -199,7 +197,7 @@ end function kpsetup ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & - sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) + sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) !======= Inclusions =========== use fsundials_core_mod @@ -223,13 +221,12 @@ integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & v(1:nlocal) => FN_VGetArrayPointer(sunvec_v) ! loop over domain - do i = 1,nlocal + do i = 1, nlocal - ! preconditioner solver - v(i) = v(i) * p(i) + ! preconditioner solver + v(i) = v(i)*p(i) end do - ! return success ierr = 0 return @@ -240,7 +237,6 @@ end function kpsolve end module kinDiagonKry_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -260,10 +256,10 @@ program main real(c_double) :: ftol type(c_ptr) :: sunctx ! sundials context - type(N_Vector), pointer :: sunvec_u ! sundials vectors - type(N_Vector), pointer :: sunvec_s ! sundials vectors - type(N_Vector), pointer :: sunvec_c ! sundials vectors - type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s ! sundials vectors + type(N_Vector), pointer :: sunvec_c ! sundials vectors + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory @@ -280,22 +276,22 @@ program main ! initialize MPI call MPI_Init(ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Init = ", ierr - stop 1 + write (0, *) "Error in MPI_Init = ", ierr + stop 1 end if call MPI_Comm_size(comm, nprocs, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_size = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_size = ", ierr + call MPI_Abort(comm, 1, ierr) end if if (popcnt(nprocs) /= 1 .or. nprocs > neq) then - write(0,*) "Error nprocs must equal a power of 2^n <= neq for functionality." - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error nprocs must equal a power of 2^n <= neq for functionality." + call MPI_Abort(comm, 1, ierr) end if call MPI_Comm_rank(comm, myid, ierr) if (ierr /= MPI_SUCCESS) then - write(0,*) "Error in MPI_Comm_rank = ", ierr - call MPI_Abort(comm, 1, ierr) + write (0, *) "Error in MPI_Comm_rank = ", ierr + call MPI_Abort(comm, 1, ierr) end if outproc = (myid == 0) @@ -303,27 +299,27 @@ program main ! Print problem description if (outproc) then - print *, " " - print *, "Example program kinDiagon_kry_f2003:" - print *, " This FKINSOL example solves a 128 eqn diagonal algebraic system." - print *, " Its purpose is to demonstrate the use of the Fortran interface in" - print *, " a parallel environment." - print *, " " - print *, "Solution method: KIN_none" - print '(a,i3)', "Problem size: neq = ", neq - print '(a,i3)', "Number of procs: nprocs = ", nprocs + print *, " " + print *, "Example program kinDiagon_kry_f2003:" + print *, " This FKINSOL example solves a 128 eqn diagonal algebraic system." + print *, " Its purpose is to demonstrate the use of the Fortran interface in" + print *, " a parallel environment." + print *, " " + print *, "Solution method: KIN_none" + print '(a,i3)', "Problem size: neq = ", neq + print '(a,i3)', "Number of procs: nprocs = ", nprocs end if ! ------------------------- retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) if (retval /= 0) then - print *, 'ERROR in FSUNContext_Create' - stop 1 + print *, 'ERROR in FSUNContext_Create' + stop 1 end if ! ------------------------- ! Create vectors for solution and scales - nlocal = neq / nprocs + nlocal = neq/nprocs sunvec_u => FN_VNew_Parallel(comm, nlocal, neq, sunctx) sunvec_s => FN_VNew_Parallel(comm, nlocal, neq, sunctx) @@ -336,16 +332,16 @@ program main kmem = FKINCreate(sunctx) if (.not. c_associated(kmem)) then - print *, 'ERROR: kmem = NULL' - stop 1 + print *, 'ERROR: kmem = NULL' + stop 1 end if ! sunvec_u is used as a template retval = FKINInit(kmem, c_funloc(func), sunvec_u) if (retval /= 0) then - print *, 'Error in FKINInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINInit, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -353,27 +349,27 @@ program main retval = FKINSetMaxSetupCalls(kmem, msbpre) if (retval /= 0) then - print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' + stop 1 end if ftol = fnormtol retval = FKINSetFuncNormTol(kmem, ftol) if (retval /= 0) then - print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' + stop 1 end if retval = FKINSetScaledStepTol(kmem, scsteptol) if (retval /= 0) then - print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' + stop 1 end if retval = FKINSetConstraints(kmem, sunvec_c) if (retval /= 0) then - print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -381,8 +377,8 @@ program main sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, prectype, maxl, sunctx) if (.not. associated(sunlinsol_LS)) then - print *,'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! ------------------------- @@ -392,8 +388,8 @@ program main retval = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) if (retval /= 0) then - print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -401,8 +397,8 @@ program main retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, maxlrst) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -410,8 +406,8 @@ program main retval = FKINSetPreconditioner(kmem, c_funloc(kpsetup), c_funloc(kpsolve)) if (retval /= 0) then - print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -425,21 +421,21 @@ program main retval = FKINSol(kmem, sunvec_u, KIN_NONE, sunvec_s, sunvec_s) if (retval /= 0) then - print *, 'Error in FKINSol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSol, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- ! Print solution and solver statistics if (outproc) then - print *, " " + print *, " " end if - do nprint = 0,nprocs-1 - if (nprint == myid) then - call PrintOutput(u) - end if - call MPI_Barrier(comm, ierr) + do nprint = 0, nprocs - 1 + if (nprint == myid) then + call PrintOutput(u) + end if + call MPI_Barrier(comm, ierr) end do call MPI_Barrier(comm, ierr) call PrintFinalStats(kmem, outproc) @@ -457,7 +453,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -475,9 +470,9 @@ subroutine PrintOutput(uu) !======= Internals ============ - do i = 1,nlocal,4 - ii = i + nlocal * myid - print '(i4, 4(1x, f10.6))', ii, uu(i), uu(i+1), uu(i+2), uu(i+3) + do i = 1, nlocal, 4 + ii = i + nlocal*myid + print '(i4, 4(1x, f10.6))', ii, uu(i), uu(i + 1), uu(i + 2), uu(i + 3) end do return @@ -485,7 +480,6 @@ subroutine PrintOutput(uu) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -501,7 +495,7 @@ subroutine PrintFinalStats(kmemo, outproc) implicit none type(c_ptr), intent(in) :: kmemo - logical, intent(in) :: outproc + logical, intent(in) :: outproc integer(c_int) :: retval integer(c_long) :: nni(1), nli(1), nfe(1), npe(1), nps(1), ncfl(1) @@ -512,47 +506,47 @@ subroutine PrintFinalStats(kmemo, outproc) retval = FKINGetNumNonlinSolvIters(kmemo, nni) if (retval /= 0) then - print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumLinIters(kmemo, nli) if (retval /= 0) then - print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumFuncEvals(kmemo, nfe) if (retval /= 0) then - print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumPrecEvals(kmemo, npe) if (retval /= 0) then - print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumPrecSolves(kmemo, nps) if (retval /= 0) then - print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumLinConvFails(kmemo, ncfl) if (retval /= 0) then - print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if if (outproc) then - print *, ' ' - print *, 'Final Statistics..' - print *, ' ' - print '(2(A,i6))' ,'nni =', nni, ' nli =', nli - print '(2(A,i6))' ,'nfe =', nfe, ' npe =', npe - print '(2(A,i6))' ,'nps =', nps, ' nlcf =', ncfl + print *, ' ' + print *, 'Final Statistics..' + print *, ' ' + print '(2(A,i6))', 'nni =', nni, ' nli =', nli + print '(2(A,i6))', 'nfe =', nfe, ' npe =', npe + print '(2(A,i6))', 'nps =', nps, ' nlcf =', ncfl end if return diff --git a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 index 78c76cde4f..43eab280d1 100644 --- a/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinDiagon_kry_f2003.f90 @@ -50,12 +50,12 @@ module kinDiagonKry_mod integer(c_int64_t) :: i real(c_double), pointer, dimension(neq) :: u(:), scale(:), constr(:) real(c_double) :: p(neq) - integer(c_int), parameter :: prectype = 2 - integer(c_int), parameter :: maxl = 10 - integer(c_int), parameter :: maxlrst = 2 + integer(c_int), parameter :: prectype = 2 + integer(c_int), parameter :: maxl = 10 + integer(c_int), parameter :: maxlrst = 2 integer(c_long), parameter :: msbpre = 5 - real(c_double), parameter :: fnormtol = 1.0d-5 - real(c_double), parameter :: scsteptol = 1.0d-4 + real(c_double), parameter :: fnormtol = 1.0d-5 + real(c_double), parameter :: scsteptol = 1.0d-4 contains @@ -72,15 +72,15 @@ subroutine init(sunvec_u, sunvec_s, sunvec_c) type(N_Vector) :: sunvec_s ! scaling N_Vector type(N_Vector) :: sunvec_c ! constraint N_Vector - u(1:neq) => FN_VGetArrayPointer(sunvec_u) - scale(1:neq) => FN_VGetArrayPointer(sunvec_s) + u(1:neq) => FN_VGetArrayPointer(sunvec_u) + scale(1:neq) => FN_VGetArrayPointer(sunvec_s) constr(1:neq) => FN_VGetArrayPointer(sunvec_c) ! ------------------------- ! Set initial guess, and disable scaling - do i = 1,neq - u(i) = 2.0d0 * dble(i) + do i = 1, neq + u(i) = 2.0d0*dble(i) end do scale = 1.0d0 constr = 0.0d0 @@ -97,7 +97,7 @@ end subroutine init ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function func(sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Declarations ========= implicit none @@ -117,13 +117,12 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & ff(1:neq) => FN_VGetArrayPointer(sunvec_f) ! loop over domain, computing our system f(u) = 0 - do i = 1,neq + do i = 1, neq - ! applying the constraint f(u) = u(i)^2 - i^2 - ff(i) = uu(i)*uu(i) - dble(i*i) + ! applying the constraint f(u) = u(i)^2 - i^2 + ff(i) = uu(i)*uu(i) - dble(i*i) end do - ! return success ierr = 0 return @@ -140,7 +139,7 @@ end function func ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & - sunvec_fs, user_data) result(ierr) bind(C) + sunvec_fs, user_data) result(ierr) bind(C) !======= Declarations ========= implicit none @@ -161,13 +160,12 @@ integer(c_int) function kpsetup(sunvec_u, sunvec_s, sunvec_f, & udata(1:neq) => FN_VGetArrayPointer(sunvec_u) ! loop over domain - do i = 1,neq + do i = 1, neq - ! setup preconditioner - p(i) = 0.5d0 / (udata(i) + 5.0d0) + ! setup preconditioner + p(i) = 0.5d0/(udata(i) + 5.0d0) end do - ! return success ierr = 0 return @@ -184,7 +182,7 @@ end function kpsetup ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & - sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) + sunvec_fs, sunvec_v, user_data) result(ierr) bind(C) !======= Declarations ========= implicit none @@ -205,13 +203,12 @@ integer(c_int) function kpsolve(sunvec_u, sunvec_s, sunvec_f, & v(1:neq) => FN_VGetArrayPointer(sunvec_v) ! loop over domain - do i = 1,neq + do i = 1, neq - ! preconditioner solver - v(i) = v(i) * p(i) + ! preconditioner solver + v(i) = v(i)*p(i) end do - ! return success ierr = 0 return @@ -222,7 +219,6 @@ end function kpsolve end module kinDiagonKry_mod ! ------------------------------------------------------------------ - ! ------------------------------------------------------------------ ! Main driver program ! ------------------------------------------------------------------ @@ -241,10 +237,10 @@ program main real(c_double) :: ftol type(c_ptr) :: sunctx ! sundials context - type(N_Vector), pointer :: sunvec_u ! sundials vectors - type(N_Vector), pointer :: sunvec_s ! sundials vectors - type(N_Vector), pointer :: sunvec_c ! sundials vectors - type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s ! sundials vectors + type(N_Vector), pointer :: sunvec_c ! sundials vectors + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory @@ -266,8 +262,8 @@ program main ! ------------------------- retval = FSUNContext_Create(SUN_COMM_NULL, sunctx) if (retval /= 0) then - print *, 'ERROR in FSUNContext_Create' - stop 1 + print *, 'ERROR in FSUNContext_Create' + stop 1 end if ! ------------------------- @@ -284,16 +280,16 @@ program main kmem = FKINCreate(sunctx) if (.not. c_associated(kmem)) then - print *, 'ERROR: kmem = NULL' - stop 1 + print *, 'ERROR: kmem = NULL' + stop 1 end if ! sunvec_u is used as a template retval = FKINInit(kmem, c_funloc(func), sunvec_u) if (retval /= 0) then - print *, 'Error in FKINInit, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINInit, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -301,27 +297,27 @@ program main retval = FKINSetMaxSetupCalls(kmem, msbpre) if (retval /= 0) then - print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetMaxSetupCalls, retval = ', retval, '; halting' + stop 1 end if ftol = fnormtol retval = FKINSetFuncNormTol(kmem, ftol) if (retval /= 0) then - print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetFuncNormTol, retval = ', retval, '; halting' + stop 1 end if retval = FKINSetScaledStepTol(kmem, scsteptol) if (retval /= 0) then - print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetScaledStepTol, retval = ', retval, '; halting' + stop 1 end if retval = FKINSetConstraints(kmem, sunvec_c) if (retval /= 0) then - print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetConstraints, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -329,8 +325,8 @@ program main sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, prectype, maxl, sunctx) if (.not. associated(sunlinsol_LS)) then - print *,'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! ------------------------- @@ -340,8 +336,8 @@ program main retval = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) if (retval /= 0) then - print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetLinearSolver, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -349,8 +345,8 @@ program main retval = FSUNLinSol_SPGMRSetMaxRestarts(sunlinsol_LS, maxlrst) if (retval /= 0) then - print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FSUNLinSol_SPGMRSetMaxRestarts, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -358,8 +354,8 @@ program main retval = FKINSetPreconditioner(kmem, c_funloc(kpsetup), c_funloc(kpsolve)) if (retval /= 0) then - print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSetPreconditioner, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -373,8 +369,8 @@ program main retval = FKINSol(kmem, sunvec_u, KIN_NONE, sunvec_s, sunvec_s) if (retval /= 0) then - print *, 'Error in FKINSol, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINSol, retval = ', retval, '; halting' + stop 1 end if ! ------------------------- @@ -395,7 +391,6 @@ program main end program main ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -412,8 +407,8 @@ subroutine PrintOutput(uu) !======= Internals ============ - do i = 1,neq,4 - print '(i4, 4(1x, f10.6))', i, uu(i), uu(i+1), uu(i+2), uu(i+3) + do i = 1, neq, 4 + print '(i4, 4(1x, f10.6))', i, uu(i), uu(i + 1), uu(i + 2), uu(i + 3) end do return @@ -421,7 +416,6 @@ subroutine PrintOutput(uu) end subroutine PrintOutput ! ---------------------------------------------------------------- - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -447,46 +441,46 @@ subroutine PrintFinalStats(kmemo) retval = FKINGetNumNonlinSolvIters(kmemo, nni) if (retval /= 0) then - print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumNonlinSolvIters, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumLinIters(kmemo, nli) if (retval /= 0) then - print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinIters, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumFuncEvals(kmemo, nfe) if (retval /= 0) then - print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in FKINGetNumFuncEvals, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumPrecEvals(kmemo, npe) if (retval /= 0) then - print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumPrecEvals, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumPrecSolves(kmemo, nps) if (retval /= 0) then - print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumPrecSolves, retval = ', retval, '; halting' + stop 1 end if retval = FKINGetNumLinConvFails(kmemo, ncfl) if (retval /= 0) then - print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' - stop 1 + print *, 'Error in KINGetNumLinConvFails, retval = ', retval, '; halting' + stop 1 end if print *, ' ' print *, 'Final Statistics..' print *, ' ' - print '(2(A,i6))' ,'nni =', nni, ' nli =', nli - print '(2(A,i6))' ,'nfe =', nfe, ' npe =', npe - print '(2(A,i6))' ,'nps =', nps, ' nlcf =', ncfl + print '(2(A,i6))', 'nni =', nni, ' nli =', nli + print '(2(A,i6))', 'nfe =', nfe, ' npe =', npe + print '(2(A,i6))', 'nps =', nps, ' nlcf =', ncfl return diff --git a/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 index 4cdf270c9b..ccd4510591 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_bnd_f2003.f90 @@ -35,7 +35,7 @@ module prob_mod integer(c_int64_t), parameter :: ny = 31 integer(c_int64_t), parameter :: neq = nx*ny integer(c_int64_t), parameter :: skip = 3 - real(c_double), parameter :: ftol = 1.d-12 + real(c_double), parameter :: ftol = 1.d-12 contains @@ -48,7 +48,7 @@ module prob_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function func(sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -60,10 +60,10 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & ! calling variables type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: u(:,:), f(:,:) + real(c_double), pointer :: u(:, :), f(:, :) ! internal variables integer(c_int64_t) :: i, j @@ -76,33 +76,33 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & f(1:nx, 1:ny) => FN_VGetArrayPointer(sunvec_f) ! set shortcut constants - dx = 1.d0/(nx+1) - dy = 1.d0/(ny+1) + dx = 1.d0/(nx + 1) + dy = 1.d0/(ny + 1) hdc = 1.d0/(dx*dx) vdc = 1.d0/(dy*dy) ! loop over domain, computing residual - do j = 1,ny - do i = 1,nx - - ! Extract u at x_i, y_j and four neighboring points - uij = u(i,j) - udn = 0.d0 - if (j > 1) udn = u(i,j-1) - uup = 0.d0 - if (j < ny) uup = u(i,j+1) - ult = 0.d0 - if (i > 1) ult = u(i-1,j) - urt = 0.d0 - if (i < nx) urt = u(i+1,j) - - ! Evaluate diffusion components - hdiff = hdc*(ult - 2.d0*uij + urt) - vdiff = vdc*(uup - 2.d0*uij + udn) - - ! Set residual at x_i, y_j - f(i, j) = hdiff + vdiff + uij - uij*uij*uij + 2.d0 - end do + do j = 1, ny + do i = 1, nx + + ! Extract u at x_i, y_j and four neighboring points + uij = u(i, j) + udn = 0.d0 + if (j > 1) udn = u(i, j - 1) + uup = 0.d0 + if (j < ny) uup = u(i, j + 1) + ult = 0.d0 + if (i > 1) ult = u(i - 1, j) + urt = 0.d0 + if (i < nx) urt = u(i + 1, j) + + ! Evaluate diffusion components + hdiff = hdc*(ult - 2.d0*uij + urt) + vdiff = vdc*(uup - 2.d0*uij + udn) + + ! Set residual at x_i, y_j + f(i, j) = hdiff + vdiff + uij - uij*uij*uij + 2.d0 + end do end do ! return success @@ -113,7 +113,6 @@ end function func end module prob_mod - program main !======= Inclusions =========== @@ -134,15 +133,15 @@ program main integer(c_long) :: mset, msubset type(c_ptr) :: sunctx ! sundials context - type(N_Vector), pointer :: sunvec_u ! sundials vectors - type(N_Vector), pointer :: sunvec_s - type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory ! solution and scaling vectors; nx, ny are set in the prob_mod module - real(c_double), dimension(nx,ny) :: u, scale + real(c_double), dimension(nx, ny) :: u, scale !======= Internals ============ @@ -175,14 +174,14 @@ program main sunvec_u => FN_VMake_Serial(neq, u, sunctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_s => FN_VMake_Serial(neq, scale, sunctx) if (.not. associated(sunvec_s)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! ------------------------- @@ -190,16 +189,16 @@ program main kmem = FKINCreate(sunctx) if (.not. c_associated(kmem)) then - print *, 'ERROR: kmem = NULL' - stop 1 + print *, 'ERROR: kmem = NULL' + stop 1 end if ! sunvec_u is used as a template ierr = FKINInit(kmem, c_funloc(func), sunvec_u) if (ierr /= 0) then - print *, 'Error in FKINInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINInit, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -208,8 +207,8 @@ program main fnormtol = ftol ierr = FKINSetFuncNormTol(kmem, fnormtol) if (ierr /= 0) then - print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -217,8 +216,8 @@ program main sunmat_J => FSUNBandMatrix(neq, nx, nx, sunctx) if (.not. associated(sunmat_J)) then - print *,'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! ------------------------- @@ -226,8 +225,8 @@ program main sunlinsol_LS => FSUNLinSol_Band(sunvec_u, sunmat_J, sunctx) if (.not. associated(sunlinsol_LS)) then - print *,'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! ------------------------- @@ -235,8 +234,8 @@ program main ierr = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) if (ierr /= 0) then - print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -246,16 +245,16 @@ program main mset = 100 ierr = FKINSetMaxSetupCalls(kmem, mset) if (ierr /= 0) then - print *, 'Error in FKINSetMaxSetupCalls, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetMaxSetupCalls, ierr = ', ierr, '; halting' + stop 1 end if ! Every msubset iterations, test if a Jacobian evaluation is necessary msubset = 1 ierr = FKINSetMaxSubSetupCalls(kmem, msubset) if (ierr /= 0) then - print *, 'Error in FKINSetMaxSubSetupCalls, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetMaxSubSetupCalls, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -269,8 +268,8 @@ program main ierr = FKINSol(kmem, sunvec_u, KIN_LINESEARCH, sunvec_s, sunvec_s) if (ierr /= 0) then - print *, 'Error in FKINSol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSol, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -279,11 +278,11 @@ program main ! Get scaled norm of the system function ierr = FKINGetFuncNorm(kmem, fnorm) if (ierr /= 0) then - print *, 'Error in FKINGetFuncNorm, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetFuncNorm, ierr = ', ierr, '; halting' + stop 1 end if print *, " " - print *, "Computed solution (||F|| = ", fnorm,"):" + print *, "Computed solution (||F|| = ", fnorm, "):" print *, " " call PrintOutput(u) call PrintFinalStats(kmem) @@ -298,7 +297,6 @@ program main end program main - ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -312,7 +310,7 @@ subroutine PrintOutput(u) implicit none ! calling variable - real(c_double), dimension(nx,ny) :: u + real(c_double), dimension(nx, ny) :: u ! internal variables integer(c_int64_t) :: i, j @@ -321,30 +319,29 @@ subroutine PrintOutput(u) !======= Internals ============ ! set shortcuts - dx = 1.d0/(nx+1) - dy = 1.d0/(ny+1) + dx = 1.d0/(nx + 1) + dy = 1.d0/(ny + 1) - write(*,'(13x)',advance='no') - do i = 1,nx,skip - x = i*dx - write(*,'(f8.5,1x)',advance='no') x + write (*, '(13x)', advance='no') + do i = 1, nx, skip + x = i*dx + write (*, '(f8.5,1x)', advance='no') x end do print *, " " print *, " " - do j = 1,ny,skip - y = j*dy - write(*,'(f8.5,5x)',advance='no') y - do i = 1,nx,skip - write(*,'(f8.5,1x)',advance='no') u(i,j) - end do - print *, " " + do j = 1, ny, skip + y = j*dy + write (*, '(f8.5,5x)', advance='no') y + do i = 1, nx, skip + write (*, '(f8.5,1x)', advance='no') u(i, j) + end do + print *, " " end do return end subroutine PrintOutput - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -371,73 +368,69 @@ subroutine PrintFinalStats(kmem) ierr = FKINGetNumNonlinSolvIters(kmem, nni) if (ierr /= 0) then - print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumFuncEvals(kmem, nfe) if (ierr /= 0) then - print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if - ! Linesearch statistics ierr = FKINGetNumBetaCondFails(kmem, nbcfails) if (ierr /= 0) then - print *, 'Error in FKINGetNumBetaCondFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumBetaCondFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumBacktrackOps(kmem, nbacktr) if (ierr /= 0) then - print *, 'Error in FKINGetNumBacktrackOps, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumBacktrackOps, ierr = ', ierr, '; halting' + stop 1 end if - ! Main solver workspace size ierr = FKINGetWorkSpace(kmem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FKINGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if - ! Band linear solver statistics ierr = FKINGetNumJacEvals(kmem, nje) if (ierr /= 0) then - print *, 'Error in FKINGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumLinFuncEvals(kmem, nfeB) if (ierr /= 0) then - print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if - ! Band linear solver workspace size ierr = FKINGetLinWorkSpace(kmem, lenrwB, leniwB) if (ierr /= 0) then - print *, 'Error in FKINGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, 'Final Statistics..' print *, ' ' - print '(2(A,i6))' ,'nni =', nni, ' nfe =', nfe - print '(2(A,i6))' ,'nbcfails =', nbcfails, ' nbacktr =', nbacktr - print '(2(A,i6))' ,'nje =', nje, ' nfeB =', nfeB + print '(2(A,i6))', 'nni =', nni, ' nfe =', nfe + print '(2(A,i6))', 'nbcfails =', nbcfails, ' nbacktr =', nbacktr + print '(2(A,i6))', 'nje =', nje, ' nfeB =', nfeB print *, ' ' - print '(2(A,i6))' ,'lenrw =', lenrw, ' leniw =', leniw - print '(2(A,i6))' ,'lenrwB =', lenrwB, ' leniwB =', leniwB + print '(2(A,i6))', 'lenrw =', lenrw, ' leniw =', leniw + print '(2(A,i6))', 'lenrwB =', lenrwB, ' leniwB =', leniwB return diff --git a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 index 9832ac97ff..875359e19e 100644 --- a/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90 @@ -38,7 +38,7 @@ module prob_mod integer(c_int64_t), parameter :: ny = 31 integer(c_int64_t), parameter :: neq = nx*ny integer(c_int64_t), parameter :: skip = 3 - real(c_double), parameter :: ftol = 1.d-12 + real(c_double), parameter :: ftol = 1.d-12 contains @@ -47,22 +47,21 @@ module prob_mod ! ---------------------------------------------------------------- integer(c_int) function func(sunvec_u, sunvec_f, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none ! calling variables type(N_Vector) :: sunvec_u ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: u(:,:), f(:,:) + real(c_double), pointer :: u(:, :), f(:, :) ! internal variables integer(c_int64_t) :: i, j @@ -75,34 +74,34 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & f(1:nx, 1:ny) => FN_VGetArrayPointer(sunvec_f) ! set shortcut constants - dx = 1.d0/(nx+1) - dy = 1.d0/(ny+1) + dx = 1.d0/(nx + 1) + dy = 1.d0/(ny + 1) hdc = 1.d0/(dx*dx) vdc = 1.d0/(dy*dy) ! loop over domain, computing residual - do j = 1,ny - do i = 1,nx - - ! Extract u at x_i, y_j and four neighboring points - uij = u(i,j) - udn = 0.d0 - if (j > 1) udn = u(i,j-1) - uup = 0.d0 - if (j < ny) uup = u(i,j+1) - ult = 0.d0 - if (i > 1) ult = u(i-1,j) - urt = 0.d0 - if (i < nx) urt = u(i+1,j) - - ! Evaluate diffusion components - hdiff = hdc*(ult - 2.d0*uij + urt) - vdiff = vdc*(uup - 2.d0*uij + udn) - - ! Set residual at x_i, y_j - f(i, j) = hdiff + vdiff + uij - uij*uij*uij + 2.d0 - - end do + do j = 1, ny + do i = 1, nx + + ! Extract u at x_i, y_j and four neighboring points + uij = u(i, j) + udn = 0.d0 + if (j > 1) udn = u(i, j - 1) + uup = 0.d0 + if (j < ny) uup = u(i, j + 1) + ult = 0.d0 + if (i > 1) ult = u(i - 1, j) + urt = 0.d0 + if (i < nx) urt = u(i + 1, j) + + ! Evaluate diffusion components + hdiff = hdc*(ult - 2.d0*uij + urt) + vdiff = vdc*(uup - 2.d0*uij + udn) + + ! Set residual at x_i, y_j + f(i, j) = hdiff + vdiff + uij - uij*uij*uij + 2.d0 + + end do end do ! return success @@ -111,18 +110,16 @@ integer(c_int) function func(sunvec_u, sunvec_f, user_data) & end function func - ! ---------------------------------------------------------------- ! Jacobian vector product function ! ---------------------------------------------------------------- integer(c_int) function jactimes(sunvec_v, sunvec_Jv, sunvec_u, new_u, user_data) & - result(ierr) bind(C) + result(ierr) bind(C) !======= Inclusions =========== use, intrinsic :: iso_c_binding - !======= Declarations ========= implicit none @@ -131,10 +128,10 @@ integer(c_int) function jactimes(sunvec_v, sunvec_Jv, sunvec_u, new_u, user_data type(N_Vector) :: sunvec_Jv ! output vector type(N_Vector) :: sunvec_u ! current solution vector integer(c_int) :: new_u ! flag indicating if u has been updated - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors - real(c_double), pointer :: v(:,:), Jv(:,:) + real(c_double), pointer :: v(:, :), Jv(:, :) ! internal variables integer(c_int64_t) :: i, j @@ -143,38 +140,38 @@ integer(c_int) function jactimes(sunvec_v, sunvec_Jv, sunvec_u, new_u, user_data !======= Internals ============ ! get data arrays from SUNDIALS vectors, casting as 2D Fortran arrays - v(1:nx, 1:ny) => FN_VGetArrayPointer(sunvec_v) + v(1:nx, 1:ny) => FN_VGetArrayPointer(sunvec_v) Jv(1:nx, 1:ny) => FN_VGetArrayPointer(sunvec_Jv) ! set shortcut constants - dx = 1.d0/(nx+1) - dy = 1.d0/(ny+1) + dx = 1.d0/(nx + 1) + dy = 1.d0/(ny + 1) hdc = 1.d0/(dx*dx) vdc = 1.d0/(dy*dy) ! loop over domain, computing residual - do j = 1,ny - do i = 1,nx - - ! Extract v at x_i, y_j and four neighboring points - vij = v(i,j) - vdn = 0.d0 - if (j > 1) vdn = v(i,j-1) - vup = 0.d0 - if (j < ny) vup = v(i,j+1) - vlt = 0.d0 - if (i > 1) vlt = v(i-1,j) - vrt = 0.d0 - if (i < nx) vrt = v(i+1,j) - - ! Evaluate diffusion components - hdiff = hdc*(vlt - 2.d0*vij + vrt) - vdiff = vdc*(vup - 2.d0*vij + vdn) - - ! Set residual at x_i, y_j - Jv(i, j) = hdiff + vdiff - - end do + do j = 1, ny + do i = 1, nx + + ! Extract v at x_i, y_j and four neighboring points + vij = v(i, j) + vdn = 0.d0 + if (j > 1) vdn = v(i, j - 1) + vup = 0.d0 + if (j < ny) vup = v(i, j + 1) + vlt = 0.d0 + if (i > 1) vlt = v(i - 1, j) + vrt = 0.d0 + if (i < nx) vrt = v(i + 1, j) + + ! Evaluate diffusion components + hdiff = hdc*(vlt - 2.d0*vij + vrt) + vdiff = vdc*(vup - 2.d0*vij + vdn) + + ! Set residual at x_i, y_j + Jv(i, j) = hdiff + vdiff + + end do end do ! return success @@ -185,7 +182,6 @@ end function jactimes end module prob_mod - program main !======= Inclusions =========== @@ -205,15 +201,15 @@ program main integer(c_long) :: maa = 3 type(c_ptr) :: sunctx - type(N_Vector), pointer :: sunvec_u ! sundials vectors - type(N_Vector), pointer :: sunvec_s - type(SUNMatrix), pointer :: sunmat_L ! sundials matrix (empty) + type(N_Vector), pointer :: sunvec_u ! sundials vectors + type(N_Vector), pointer :: sunvec_s + type(SUNMatrix), pointer :: sunmat_L ! sundials matrix (empty) type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory ! solution and scaling vectors; nx, ny are set in the prob_mod module - real(c_double), dimension(nx,ny) :: u, scale + real(c_double), dimension(nx, ny) :: u, scale !======= Internals ============ @@ -232,7 +228,7 @@ program main ! Set initial guess, and disable scaling u = 0.d0 - u(2,2) = 1.0d0 + u(2, 2) = 1.0d0 scale = 1.d0 ! no scaling used @@ -245,14 +241,14 @@ program main sunvec_u => FN_VMake_Serial(neq, u, sunctx) if (.not. associated(sunvec_u)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_s => FN_VMake_Serial(neq, scale, sunctx) if (.not. associated(sunvec_s)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! ------------------------- @@ -260,23 +256,23 @@ program main kmem = FKINCreate(sunctx) if (.not. c_associated(kmem)) then - print *, 'ERROR: kmem = NULL' - stop 1 + print *, 'ERROR: kmem = NULL' + stop 1 end if ! sunvec_u is used as a template ! Use acceleration with up to 3 prior residuals - ierr = FKINSetMAA(kmem, maa); + ierr = FKINSetMAA(kmem, maa); if (ierr /= 0) then - print *, 'Error in FKINISetMAA, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINISetMAA, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINInit(kmem, c_funloc(func), sunvec_u) if (ierr /= 0) then - print *, 'Error in FKINInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINInit, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -287,8 +283,8 @@ program main fnormtol = ftol ierr = FKINSetFuncNormTol(kmem, fnormtol) if (ierr /= 0) then - print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -296,8 +292,8 @@ program main sunlinsol_LS => FSUNLinSol_SPGMR(sunvec_u, SUN_PREC_NONE, 10, sunctx) if (.not. associated(sunlinsol_LS)) then - print *,'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! ------------------------- @@ -307,17 +303,17 @@ program main ierr = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_L) if (ierr /= 0) then - print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- ! Set Jacobian vector product function - ierr = FKINSetJacTimesVecFn(kmem, c_funloc(jactimes)); + ierr = FKINSetJacTimesVecFn(kmem, c_funloc(jactimes)); if (ierr /= 0) then - print *, 'Error in FKINSetJacTimesVecFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetJacTimesVecFn, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -331,8 +327,8 @@ program main ierr = FKINSol(kmem, sunvec_u, KIN_PICARD, sunvec_s, sunvec_s) if (ierr /= 0) then - print *, 'Error in FKINSol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSol, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -341,11 +337,11 @@ program main ! Get scaled norm of the system function ierr = FKINGetFuncNorm(kmem, fnorm) if (ierr /= 0) then - print *, 'Error in FKINGetFuncNorm, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetFuncNorm, ierr = ', ierr, '; halting' + stop 1 end if print *, " " - print '(A,ES12.5,A)', "Computed solution (||F|| = ", fnorm,"):" + print '(A,ES12.5,A)', "Computed solution (||F|| = ", fnorm, "):" print *, " " call PrintOutput(u) call PrintFinalStats(kmem) @@ -359,7 +355,6 @@ program main end program main - ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -373,7 +368,7 @@ subroutine PrintOutput(u) implicit none ! calling variable - real(c_double), dimension(nx,ny) :: u + real(c_double), dimension(nx, ny) :: u ! internal variables integer(c_int64_t) :: i, j @@ -382,30 +377,29 @@ subroutine PrintOutput(u) !======= Internals ============ ! set shortcuts - dx = 1.d0/(nx+1) - dy = 1.d0/(ny+1) + dx = 1.d0/(nx + 1) + dy = 1.d0/(ny + 1) - write(*,'(11x)',advance='no') - do i = 1,nx,skip - x = i*dx - write(*,'(f8.5,1x)',advance='no') x + write (*, '(11x)', advance='no') + do i = 1, nx, skip + x = i*dx + write (*, '(f8.5,1x)', advance='no') x end do print *, " " print *, " " - do j = 1,ny,skip - y = j*dy - write(*,'(f7.5,4x)',advance='no') y - do i = 1,nx,skip - write(*,'(f8.5,1x)',advance='no') u(i,j) - end do - print *, " " + do j = 1, ny, skip + y = j*dy + write (*, '(f7.5,4x)', advance='no') y + do i = 1, nx, skip + write (*, '(f8.5,1x)', advance='no') u(i, j) + end do + print *, " " end do return end subroutine PrintOutput - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -432,79 +426,79 @@ subroutine PrintFinalStats(kmem) ierr = FKINGetNumNonlinSolvIters(kmem, nni) if (ierr /= 0) then - print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumFuncEvals(kmem, nfe) if (ierr /= 0) then - print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if ! Linear solver statistics ierr = FKINGetNumLinIters(kmem, nli) if (ierr /= 0) then - print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumLinFuncEvals(kmem, nfeLS) if (ierr /= 0) then - print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumLinConvFails(kmem, ncfl) if (ierr /= 0) then - print *, 'Error in FKINGetNumLinConvFails, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinConvFails, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumJtimesEvals(kmem, njvevals) if (ierr /= 0) then - print *, 'Error in FKINGetNumJtimesEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumJtimesEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumPrecEvals(kmem, npe) if (ierr /= 0) then - print *, 'Error in FKINGetNumPrecEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumPrecEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumPrecSolves(kmem, nps) if (ierr /= 0) then - print *, 'Error in FKINGetNumPrecSolves, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumPrecSolves, ierr = ', ierr, '; halting' + stop 1 end if ! Main solver workspace size ierr = FKINGetWorkSpace(kmem, lenrw, leniw) if (ierr /= 0) then - print *, 'Error in FKINGetWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if ! Linear solver workspace size ierr = FKINGetLinWorkSpace(kmem, lenrwLS, leniwLS) if (ierr /= 0) then - print *, 'Error in FKINGetLinWorkSpace, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetLinWorkSpace, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print '(A)', 'Final Statistics..' print *, ' ' - print '(3(A,i6))' ,'nni = ', nni, ' nli = ', nli, ' ncfl = ',ncfl - print '(3(A,i6))' ,'nfe = ', nfe, ' nfeLS = ', nfeLS, ' njt = ',njvevals - print '(2(A,i6))' ,'npe = ', npe, ' nps = ', nps + print '(3(A,i6))', 'nni = ', nni, ' nli = ', nli, ' ncfl = ', ncfl + print '(3(A,i6))', 'nfe = ', nfe, ' nfeLS = ', nfeLS, ' njt = ', njvevals + print '(2(A,i6))', 'npe = ', npe, ' nps = ', nps print *, ' ' - print '(2(A,i6))' ,'lenrw = ', lenrw, ' leniw = ', leniw - print '(2(A,i6))' ,'lenrwLS = ', lenrwLS, ' leniwLS = ', leniwLS + print '(2(A,i6))', 'lenrw = ', lenrw, ' leniw = ', leniw + print '(2(A,i6))', 'lenrwLS = ', lenrwLS, ' leniwLS = ', leniwLS return diff --git a/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 b/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 index 2399a29ea5..509d3df13c 100644 --- a/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 +++ b/examples/kinsol/F2003_serial/kinRoboKin_dns_f2003.f90 @@ -36,8 +36,8 @@ module prob_mod integer(c_int64_t), parameter :: nvar = 8 integer(c_int64_t), parameter :: neq = 3*nvar - real(c_double), parameter :: ftol = 1.d-5 - real(c_double), parameter :: stol = 1.d-5 + real(c_double), parameter :: ftol = 1.d-5 + real(c_double), parameter :: stol = 1.d-5 contains @@ -50,7 +50,7 @@ module prob_mod ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function func(sunvec_y, sunvec_f, user_data) & - result(ierr) bind(C,name='func') + result(ierr) bind(C, name='func') !======= Inclusions =========== use, intrinsic :: iso_c_binding @@ -62,7 +62,7 @@ integer(c_int) function func(sunvec_y, sunvec_f, user_data) & ! calling variables type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data ! pointers to data in SUNDIALS vectors real(c_double), pointer :: yd(:) @@ -109,12 +109,12 @@ integer(c_int) function func(sunvec_y, sunvec_f, user_data) & u8 = yd(24) ! Nonlinear equations - eq1 = - 0.1238d0*x1 + x7 - 0.001637d0*x2 - 0.9338d0*x4 & + eq1 = -0.1238d0*x1 + x7 - 0.001637d0*x2 - 0.9338d0*x4 & + 0.004731d0*x1*x3 - 0.3578d0*x2*x3 - 0.3571d0 eq2 = 0.2638d0*x1 - x7 - 0.07745d0*x2 - 0.6734d0*x4 & - + 0.2238d0*x1*x3 + 0.7623d0*x2*x3 - 0.6022d0 + + 0.2238d0*x1*x3 + 0.7623d0*x2*x3 - 0.6022d0 eq3 = 0.3578d0*x1 + 0.004731d0*x2 + x6*x8 - eq4 = - 0.7623d0*x1 + 0.2238d0*x2 + 0.3461d0 + eq4 = -0.7623d0*x1 + 0.2238d0*x2 + 0.3461d0 eq5 = x1*x1 + x2*x2 - 1.d0 eq6 = x3*x3 + x4*x4 - 1.d0 eq7 = x5*x5 + x6*x6 - 1.d0 @@ -172,7 +172,6 @@ integer(c_int) function func(sunvec_y, sunvec_f, user_data) & end function func - ! ---------------------------------------------------------------- ! jac: The nonlinear system Jacobian ! @@ -182,12 +181,11 @@ end function func ! -1 = non-recoverable error ! ---------------------------------------------------------------- integer(c_int) function jac(sunvec_y, sunvec_f, sunmat_J, user_data, sunvec_t1, sunvec_t2) & - result(ierr) bind(C,name='jac') + result(ierr) bind(C, name='jac') !======= Inclusions =========== use, intrinsic :: iso_c_binding - use fnvector_serial_mod use fsunmatrix_dense_mod @@ -198,13 +196,13 @@ integer(c_int) function jac(sunvec_y, sunvec_f, sunmat_J, user_data, sunvec_t1, type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector type(SUNMatrix) :: sunmat_J ! Jacobian SUNMatrix - type(c_ptr), value :: user_data ! user-defined data + type(c_ptr), value :: user_data ! user-defined data type(N_Vector) :: sunvec_t1 ! temporary N_Vectors type(N_Vector) :: sunvec_t2 ! pointers to data in SUNDIALS vector and matrix real(c_double), pointer :: yd(:) - real(c_double), pointer :: J(:,:) + real(c_double), pointer :: J(:, :) ! internal variables real(c_double) :: x1, x2, x3, x4, x5, x6, x7, x8 @@ -230,57 +228,57 @@ integer(c_int) function jac(sunvec_y, sunvec_f, sunmat_J, user_data, sunvec_t1, ! Nonlinear equations ! -0.1238*x1 + x7 - 0.001637*x2 - 0.9338*x4 + 0.004731*x1*x3 - 0.3578*x2*x3 - 0.3571 - J(1,1) = -0.1238d0 + 0.004731d0*x3 - J(1,2) = -0.001637d0 - 0.3578d0*x3 - J(1,3) = 0.004731d0*x1 - 0.3578d0*x2 - J(1,4) = -0.9338d0 - J(1,7) = 1.d0 + J(1, 1) = -0.1238d0 + 0.004731d0*x3 + J(1, 2) = -0.001637d0 - 0.3578d0*x3 + J(1, 3) = 0.004731d0*x1 - 0.3578d0*x2 + J(1, 4) = -0.9338d0 + J(1, 7) = 1.d0 ! 0.2638*x1 - x7 - 0.07745*x2 - 0.6734*x4 + 0.2238*x1*x3 + 0.7623*x2*x3 - 0.6022 - J(2,1) = 0.2638d0 + 0.2238d0*x3 - J(2,2) = -0.07745d0 + 0.7623d0*x3 - J(2,3) = 0.2238d0*x1 + 0.7623d0*x2 - J(2,4) = -0.6734d0 - J(2,7) = -1.d0 + J(2, 1) = 0.2638d0 + 0.2238d0*x3 + J(2, 2) = -0.07745d0 + 0.7623d0*x3 + J(2, 3) = 0.2238d0*x1 + 0.7623d0*x2 + J(2, 4) = -0.6734d0 + J(2, 7) = -1.d0 ! 0.3578*x1 + 0.004731*x2 + x6*x8 - J(3,1) = 0.3578d0 - J(3,2) = 0.004731d0 - J(3,6) = x8 - J(3,8) = x6 + J(3, 1) = 0.3578d0 + J(3, 2) = 0.004731d0 + J(3, 6) = x8 + J(3, 8) = x6 ! -0.7623*x1 + 0.2238*x2 + 0.3461 - J(4,1) = -0.7623d0 - J(4,2) = 0.2238d0 + J(4, 1) = -0.7623d0 + J(4, 2) = 0.2238d0 ! x1*x1 + x2*x2 - 1 - J(5,1) = 2.d0*x1 - J(5,2) = 2.d0*x2 + J(5, 1) = 2.d0*x1 + J(5, 2) = 2.d0*x2 ! x3*x3 + x4*x4 - 1 - J(6,3) = 2.d0*x3 - J(6,4) = 2.d0*x4 + J(6, 3) = 2.d0*x3 + J(6, 4) = 2.d0*x4 ! x5*x5 + x6*x6 - 1 - J(7,5) = 2.d0*x5 - J(7,6) = 2.d0*x6 + J(7, 5) = 2.d0*x5 + J(7, 6) = 2.d0*x6 ! x7*x7 + x8*x8 - 1 - J(8,7) = 2.d0*x7 - J(8,8) = 2.d0*x8 + J(8, 7) = 2.d0*x7 + J(8, 8) = 2.d0*x8 ! -------------------- ! Lower bounds ( l_i = 1 + x_i >= 0) - do i = 1,8 - J(8+i,i) = -1.d0 - J(8+i,8+i) = 1.d0 + do i = 1, 8 + J(8 + i, i) = -1.d0 + J(8 + i, 8 + i) = 1.d0 end do ! -------------------- ! Upper bounds ( u_i = 1 - x_i >= 0) - do i = 1,8 - J(16+i,i) = 1.d0 - J(16+i,16+i) = 1.d0 + do i = 1, 8 + J(16 + i, i) = 1.d0 + J(16 + i, 16 + i) = 1.d0 end do ! Return success @@ -291,7 +289,6 @@ end function jac end module prob_mod - program main !======= Inclusions =========== @@ -312,10 +309,10 @@ program main integer(c_long) :: mset type(c_ptr) :: sunctx - type(N_Vector), pointer :: sunvec_y ! sundials vectors - type(N_Vector), pointer :: sunvec_s - type(N_Vector), pointer :: sunvec_c - type(SUNMatrix), pointer :: sunmat_J ! sundials matrix + type(N_Vector), pointer :: sunvec_y ! sundials vectors + type(N_Vector), pointer :: sunvec_s + type(N_Vector), pointer :: sunvec_c + type(SUNMatrix), pointer :: sunmat_J ! sundials matrix type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver type(c_ptr) :: kmem ! KINSOL memory @@ -340,7 +337,7 @@ program main y(1:nvar) = dsqrt(2.d0)/2.d0 scale = 1.d0 constraints = 0.d0 - constraints(nvar+1:neq) = 1.d0 + constraints(nvar + 1:neq) = 1.d0 ! ------------------------- ! Create the SUNDIALS context used for this simulation @@ -351,20 +348,20 @@ program main sunvec_y => FN_VMake_Serial(neq, y, sunctx) if (.not. associated(sunvec_y)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_s => FN_VMake_Serial(neq, scale, sunctx) if (.not. associated(sunvec_s)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if sunvec_c => FN_VMake_Serial(neq, constraints, sunctx) if (.not. associated(sunvec_c)) then - print *, 'ERROR: sunvec = NULL' - stop 1 + print *, 'ERROR: sunvec = NULL' + stop 1 end if ! ------------------------- @@ -372,14 +369,14 @@ program main kmem = FKINCreate(sunctx) if (.not. c_associated(kmem)) then - print *, 'ERROR: kmem = NULL' - stop 1 + print *, 'ERROR: kmem = NULL' + stop 1 end if ierr = FKINInit(kmem, c_funloc(func), sunvec_y) if (ierr /= 0) then - print *, 'Error in FKINInit, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINInit, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -387,22 +384,22 @@ program main ierr = FKINSetConstraints(kmem, sunvec_c) if (ierr /= 0) then - print *, 'Error in FKINSetConstraints, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetConstraints, ierr = ', ierr, '; halting' + stop 1 end if fnormtol = ftol ierr = FKINSetFuncNormTol(kmem, fnormtol) if (ierr /= 0) then - print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetFuncNormTol, ierr = ', ierr, '; halting' + stop 1 end if scsteptol = stol ierr = FKINSetScaledStepTol(kmem, scsteptol) if (ierr /= 0) then - print *, 'Error in FKINSetScaledStepTol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetScaledStepTol, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -410,8 +407,8 @@ program main sunmat_J => FSUNDenseMatrix(neq, neq, sunctx) if (.not. associated(sunmat_J)) then - print *,'ERROR: sunmat = NULL' - stop 1 + print *, 'ERROR: sunmat = NULL' + stop 1 end if ! ------------------------- @@ -419,8 +416,8 @@ program main sunlinsol_LS => FSUNLinSol_Dense(sunvec_y, sunmat_J, sunctx) if (.not. associated(sunlinsol_LS)) then - print *,'ERROR: sunlinsol = NULL' - stop 1 + print *, 'ERROR: sunlinsol = NULL' + stop 1 end if ! ------------------------- @@ -428,8 +425,8 @@ program main ierr = FKINSetLinearSolver(kmem, sunlinsol_LS, sunmat_J) if (ierr /= 0) then - print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetLinearSolver, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -437,8 +434,8 @@ program main ierr = FKINSetJacFn(kmem, c_funloc(jac)) if (ierr /= 0) then - print *, 'Error in FKINSetJacFn, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetJacFn, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -447,8 +444,8 @@ program main mset = 1 ierr = FKINSetMaxSetupCalls(kmem, mset) if (ierr /= 0) then - print *, 'Error in FKINSetMaxSetupCalls, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSetMaxSetupCalls, ierr = ', ierr, '; halting' + stop 1 end if ! ------------------------- @@ -465,15 +462,14 @@ program main ierr = FKINSol(kmem, sunvec_y, KIN_LINESEARCH, sunvec_s, sunvec_s) if (ierr /= 0) then - print *, 'Error in FKINSol, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINSol, ierr = ', ierr, '; halting' + stop 1 end if print *, " " print *, "Computed solution:" call PrintOutput(y) - ! ------------------------- ! Print final statistics and free memory @@ -488,7 +484,6 @@ program main end program main - ! ---------------------------------------------------------------- ! PrintOutput: prints solution at selected points ! ---------------------------------------------------------------- @@ -512,14 +507,13 @@ subroutine PrintOutput(y) print *, " l=x+1 x u=1-x" print *, " ----------------------------------" - do i = 1,NVAR - print '(1x,3(f10.6,3x))', y(i+nvar), y(i), y(i+2*nvar) + do i = 1, NVAR + print '(1x,3(f10.6,3x))', y(i + nvar), y(i), y(i + 2*nvar) end do return end subroutine PrintOutput - ! ---------------------------------------------------------------- ! PrintFinalStats ! @@ -543,33 +537,33 @@ subroutine PrintFinalStats(kmem) ierr = FKINGetNumNonlinSolvIters(kmem, nni) if (ierr /= 0) then - print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumNonlinSolvIters, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumFuncEvals(kmem, nfe) if (ierr /= 0) then - print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumJacEvals(kmem, nje) if (ierr /= 0) then - print *, 'Error in FKINGetNumJacEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumJacEvals, ierr = ', ierr, '; halting' + stop 1 end if ierr = FKINGetNumLinFuncEvals(kmem, nfeD) if (ierr /= 0) then - print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' - stop 1 + print *, 'Error in FKINGetNumLinFuncEvals, ierr = ', ierr, '; halting' + stop 1 end if print *, ' ' print *, 'Final Statistics.. ' print *, ' ' - print '(2(A,i5))' ,'nni =', nni, ' nfe =', nfe - print '(2(A,i5))' ,'nje =', nje, ' nfeD =', nfeD + print '(2(A,i5))', 'nni =', nni, ' nfe =', nfe + print '(2(A,i5))', 'nje =', nje, ' nfeD =', nfeD return diff --git a/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 b/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 index afa1157fef..971f0b2c08 100644 --- a/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 +++ b/examples/nvector/C_openmp/test_fnvector_openmp_mod.f90 @@ -26,7 +26,7 @@ module test_nvector_openmp integer(kind=myindextype), parameter :: ns = 2 ! number of vector arrays integer(c_int), parameter :: nv = 3 ! length of vector arrays - contains +contains integer function smoke_tests() result(ret) implicit none @@ -50,7 +50,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -141,7 +141,6 @@ end function unit_tests end module - integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding @@ -163,7 +162,6 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -177,7 +175,6 @@ logical function has_data(X) result(failure) failure = associated(xptr) end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 b/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 index cf12181129..b6b99d480a 100644 --- a/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 +++ b/examples/nvector/manyvector/test_fnvector_manyvector_mod.f90 @@ -24,10 +24,10 @@ module test_nvector_manyvector implicit none integer(c_int), parameter :: nsubvecs = 2 - integer(c_int), parameter :: nv = 3 ! length of vector arrays - integer(kind=myindextype), parameter :: N1 = 100 ! individual vector length - integer(kind=myindextype), parameter :: N2 = 200 ! individual vector length - integer(kind=myindextype), parameter :: N = N1 + N2 ! overall manyvector length + integer(c_int), parameter :: nv = 3 ! length of vector arrays + integer(kind=myindextype), parameter :: N1 = 100 ! individual vector length + integer(kind=myindextype), parameter :: N2 = 200 ! individual vector length + integer(kind=myindextype), parameter :: N = N1 + N2 ! overall manyvector length contains @@ -46,9 +46,9 @@ integer function smoke_tests() result(ret) !===== Setup ==== subvecs = FN_VNewVectorArray(nsubvecs, sunctx) - tmp => FN_VMake_Serial(N1, x1data, sunctx) + tmp => FN_VMake_Serial(N1, x1data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 0, tmp) - tmp => FN_VMake_Serial(N2, x2data, sunctx) + tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) x => FN_VNew_ManyVector(int(nsubvecs, myindextype), subvecs, sunctx) @@ -60,7 +60,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -105,10 +105,10 @@ integer function smoke_tests() result(ret) ! test the ManyVector specific operations ival = FN_VGetNumSubvectors_ManyVector(x) - xptr => FN_VGetSubvectorArrayPointer_ManyVector(x, ival-1) - ival = FN_VSetSubvectorArrayPointer_ManyVector(xptr, x, ival-1) + xptr => FN_VGetSubvectorArrayPointer_ManyVector(x, ival - 1) + ival = FN_VSetSubvectorArrayPointer_ManyVector(xptr, x, ival - 1) ival = FN_VGetNumSubvectors_ManyVector(x) - tmp => FN_VGetSubvector_ManyVector(x, ival-1) + tmp => FN_VGetSubvector_ManyVector(x, ival - 1) !==== Cleanup ===== call FN_VDestroyVectorArray(subvecs, nsubvecs) @@ -135,9 +135,9 @@ integer function unit_tests() result(fails) fails = 0 subvecs = FN_VNewVectorArray(nsubvecs, sunctx) - tmp => FN_VMake_Serial(N1, x1data, sunctx) + tmp => FN_VMake_Serial(N1, x1data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 0, tmp) - tmp => FN_VMake_Serial(N2, x2data, sunctx) + tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) x => FN_VNew_ManyVector(int(nsubvecs, myindextype), subvecs, sunctx) @@ -156,7 +156,6 @@ end function unit_tests end module - function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding use fnvector_manyvector_mod @@ -181,13 +180,13 @@ function check_ans(ans, X, local_length) result(failure) if (local_length /= (x0len + x1len)) then failure = 1 return - endif + end if do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - enddo + end do do i = 1, x1len if (FNEQ(x1data(i), ans) > 0) then @@ -196,7 +195,6 @@ function check_ans(ans, X, local_length) result(failure) end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -208,7 +206,6 @@ logical function has_data(X) result(failure) failure = .true. end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 index 1b25a3f139..94d18d00ec 100644 --- a/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 +++ b/examples/nvector/mpimanyvector/test_fnvector_mpimanyvector_mod.f90 @@ -18,7 +18,6 @@ module test_nvector_mpimanyvector use, intrinsic :: iso_c_binding - use fnvector_mpimanyvector_mod use fnvector_serial_mod use test_utilities @@ -50,9 +49,9 @@ integer function smoke_tests() result(ret) !===== Setup ==== subvecs = FN_VNewVectorArray(nsubvecs, sunctx) - tmp => FN_VMake_Serial(N1, x1data, sunctx) + tmp => FN_VMake_Serial(N1, x1data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 0, tmp) - tmp => FN_VMake_Serial(N2, x2data, sunctx) + tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) x => FN_VMake_MPIManyVector(comm, int(nsubvecs, myindextype), subvecs, sunctx) @@ -64,7 +63,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -109,10 +108,10 @@ integer function smoke_tests() result(ret) ! test the MPIManyVector specific operations ival = FN_VGetNumSubvectors_MPIManyVector(x) - xptr => FN_VGetSubvectorArrayPointer_MPIManyVector(x, ival-1) - ival = FN_VSetSubvectorArrayPointer_MPIManyVector(xptr, x, ival-1) + xptr => FN_VGetSubvectorArrayPointer_MPIManyVector(x, ival - 1) + ival = FN_VSetSubvectorArrayPointer_MPIManyVector(xptr, x, ival - 1) ival = FN_VGetNumSubvectors_MPIManyVector(x) - tmp => FN_VGetSubvector_MPIManyVector(x, ival-1) + tmp => FN_VGetSubvector_MPIManyVector(x, ival - 1) !==== Cleanup ===== tmp => FN_VGetVecAtIndexVectorArray(subvecs, 0) @@ -146,12 +145,12 @@ integer function unit_tests() result(fails) if (fails /= 0) then print *, ' FAILURE - MPI_COMM_RANK returned nonzero' stop 1 - endif + end if subvecs = FN_VNewVectorArray(nsubvecs, sunctx) - tmp => FN_VMake_Serial(N1, x1data, sunctx) + tmp => FN_VMake_Serial(N1, x1data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 0, tmp) - tmp => FN_VMake_Serial(N2, x2data, sunctx) + tmp => FN_VMake_Serial(N2, x2data, sunctx) call FN_VSetVecAtIndexVectorArray(subvecs, 1, tmp) x => FN_VMake_MPIManyVector(comm, int(nsubvecs, myindextype), subvecs, sunctx) @@ -173,11 +172,10 @@ end function unit_tests end module - integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding use fnvector_mpimanyvector_mod - use test_utilities + use test_utilities implicit none real(C_DOUBLE) :: ans @@ -198,13 +196,13 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) if (local_length /= (x0len + x1len)) then failure = 1 return - endif + end if do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - enddo + end do do i = 1, x1len if (FNEQ(x1data(i), ans) > 0) then @@ -213,7 +211,6 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -225,7 +222,6 @@ logical function has_data(X) result(failure) failure = .true. end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -241,13 +237,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - endif + end if call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - endif + end if !============== Introduction ============= if (myid == 0) print *, 'MPIManyVector N_Vector Fortran 2003 interface test' @@ -258,7 +254,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - endif + end if fails = smoke_tests() if (fails /= 0) then @@ -272,14 +268,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - endif + end if fails = unit_tests() if (fails /= 0) then print *, 'FAILURE: n unit tests failed, proc', myid stop 1 else - if (myid == 0) print *,' SUCCESS - all unit tests passed' + if (myid == 0) print *, ' SUCCESS - all unit tests passed' end if call Test_Finalize() @@ -288,5 +284,5 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - endif + end if end program main diff --git a/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 b/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 index 180944377d..ac2f3f75f1 100644 --- a/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 +++ b/examples/nvector/mpiplusx/test_fnvector_mpiplusx_mod.f90 @@ -39,7 +39,7 @@ integer function smoke_tests() result(ret) type(N_Vector), pointer :: x, local ! N_Vectors !===== Setup ==== - local => FN_VMake_Serial(N, x1data, sunctx) + local => FN_VMake_Serial(N, x1data, sunctx) x => FN_VMake_MPIPlusX(comm, local, sunctx) call FN_VConst(ONE, x) @@ -47,10 +47,10 @@ integer function smoke_tests() result(ret) !===== Test ===== ! test the MPIPlusX specific operations - xptr => FN_VGetArrayPointer_MPIPlusX(x) + xptr => FN_VGetArrayPointer_MPIPlusX(x) local => FN_VGetLocalVector_MPIPlusX(x) - ival = FN_VGetLocalLength_MPIPlusX(x) - ival = FN_VGetVectorID_MPIPlusX(x) + ival = FN_VGetLocalLength_MPIPlusX(x) + ival = FN_VGetVectorID_MPIPlusX(x) !==== Cleanup ===== call FN_VDestroy(local) @@ -75,9 +75,9 @@ integer function unit_tests() result(fails) if (fails /= 0) then print *, ' FAILURE - MPI_COMM_RANK returned nonzero' stop 1 - endif + end if - local => FN_VMake_Serial(N, x1data, sunctx) + local => FN_VMake_Serial(N, x1data, sunctx) x => FN_VMake_MPIPlusX(comm, local, sunctx) call FN_VConst(ONE, x) @@ -95,7 +95,6 @@ end function unit_tests end module - integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding use fnvector_mpiplusx_mod @@ -118,17 +117,16 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) if (local_length /= x0len) then failure = 1 return - endif + end if do i = 1, x0len if (FNEQ(x0data(i), ans) > 0) then failure = failure + 1 end if - enddo + end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -140,7 +138,6 @@ logical function has_data(X) result(failure) failure = .true. end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -156,13 +153,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - endif + end if call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - endif + end if !============== Introduction ============= if (myid == 0) print *, 'MPIPlusX N_Vector Fortran 2003 interface test' @@ -173,7 +170,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - endif + end if fails = smoke_tests() if (fails /= 0) then @@ -187,14 +184,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - endif + end if fails = unit_tests() if (fails /= 0) then print *, 'FAILURE: n unit tests failed, proc', myid stop 1 else - if (myid == 0) print *,' SUCCESS - all unit tests passed' + if (myid == 0) print *, ' SUCCESS - all unit tests passed' end if call Test_Finalize() @@ -203,5 +200,5 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - endif + end if end program main diff --git a/examples/nvector/parallel/test_fnvector_parallel_mod.f90 b/examples/nvector/parallel/test_fnvector_parallel_mod.f90 index 8ca51a39ba..e473e0fa61 100644 --- a/examples/nvector/parallel/test_fnvector_parallel_mod.f90 +++ b/examples/nvector/parallel/test_fnvector_parallel_mod.f90 @@ -30,7 +30,7 @@ module test_nvector_parallel integer(c_int), target :: comm = MPI_COMM_WORLD ! default MPI communicator integer(kind=myindextype) :: global_length ! vector global_length integer(c_int) :: nprocs ! number of MPI processes - contains +contains integer function smoke_tests() result(ret) implicit none @@ -54,7 +54,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -136,7 +136,7 @@ integer function unit_tests() result(fails) if (fails /= 0) then print *, ' FAILURE - MPI_COMM_RANK returned nonzero' stop 1 - endif + end if x => FN_VMake_Parallel(comm, local_length, global_length, xdata, sunctx) call FN_VConst(ONE, x) @@ -153,7 +153,6 @@ end function unit_tests end module - integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding @@ -168,14 +167,13 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) failure = 0 Xdata => FN_VGetArrayPointer(X) - do i = 1, local_length + do i = 1, local_length if (FNEQ(Xdata(i), ans) > 0) then failure = failure + 1 end if end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -189,7 +187,6 @@ logical function has_data(X) result(failure) failure = associated(xptr) end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding @@ -205,13 +202,13 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_INIT returned nonzero' stop 1 - endif + end if call MPI_Comm_rank(comm, myid, fails) if (fails /= 0) then print *, 'FAILURE: MPI_COMM_RANK returned nonzero, proc', myid stop 1 - endif + end if !============== Introduction ============= if (myid == 0) print *, 'Parallel N_Vector Fortran 2003 interface test' @@ -222,7 +219,7 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_COMM_SIZE returned nonzero, proc', myid stop 1 - endif + end if global_length = nprocs*local_length fails = smoke_tests() @@ -237,14 +234,14 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_BARRIER returned nonzero, proc', myid stop 1 - endif + end if fails = unit_tests() if (fails /= 0) then print *, 'FAILURE: n unit tests failed, proc', myid stop 1 else - if (myid == 0) print *,' SUCCESS - all unit tests passed' + if (myid == 0) print *, ' SUCCESS - all unit tests passed' end if call Test_Finalize() @@ -253,6 +250,6 @@ program main if (fails /= 0) then print *, 'FAILURE: MPI_FINALIZE returned nonzero, proc ', myid stop 1 - endif + end if end program main diff --git a/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 index 96db87411a..c8223103d2 100644 --- a/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 +++ b/examples/nvector/pthreads/test_fnvector_pthreads_mod.f90 @@ -25,7 +25,7 @@ module test_nvector_pthreads integer(kind=myindextype), parameter :: ns = 2 ! number of vector arrays integer(c_int), parameter :: nv = 3 ! length of vector arrays - contains +contains integer function smoke_tests() result(ret) implicit none @@ -49,7 +49,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -140,7 +140,6 @@ end function unit_tests end module - integer(C_INT) function check_ans(ans, X, local_length) result(failure) use, intrinsic :: iso_c_binding @@ -162,7 +161,6 @@ integer(C_INT) function check_ans(ans, X, local_length) result(failure) end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding @@ -176,7 +174,6 @@ logical function has_data(X) result(failure) failure = associated(xptr) end function has_data - program main !======== Inclusions ========== use, intrinsic :: iso_c_binding diff --git a/examples/nvector/serial/test_fnvector_serial_mod.f90 b/examples/nvector/serial/test_fnvector_serial_mod.f90 index 8c725b6207..4f0daf3921 100644 --- a/examples/nvector/serial/test_fnvector_serial_mod.f90 +++ b/examples/nvector/serial/test_fnvector_serial_mod.f90 @@ -49,7 +49,7 @@ integer function smoke_tests() result(ret) xvecs = FN_VCloneVectorArray(nv, x) zvecs = FN_VCloneVectorArray(nv, z) - nvarr = (/ ONE, ONE, ONE /) + nvarr = (/ONE, ONE, ONE/) !===== Test ===== @@ -161,7 +161,6 @@ function check_ans(ans, X, local_length) result(failure) end do end function check_ans - logical function has_data(X) result(failure) use, intrinsic :: iso_c_binding use test_utilities diff --git a/examples/nvector/test_nvector.f90 b/examples/nvector/test_nvector.f90 index b97f65b3ca..855d0d6dd1 100644 --- a/examples/nvector/test_nvector.f90 +++ b/examples/nvector/test_nvector.f90 @@ -30,152 +30,148 @@ module test_fnvector contains - -integer(C_INT) function Test_FN_VMake(X, local_length, myid) & + integer(C_INT) function Test_FN_VMake(X, local_length, myid) & result(failure) - implicit none - - type(N_Vector) :: X - integer(kind=myindextype) :: local_length - integer(C_INT) :: myid + implicit none - if (.not. has_data(X)) then - print *, '(I4)', '>>> FAILED test -- FN_VMake, Proc ', myid - print *, ' vector data is not associated' - failure = 1 - return - end if + type(N_Vector) :: X + integer(kind=myindextype) :: local_length + integer(C_INT) :: myid - if (myid == 0) then - print *, 'PASSED test -- FN_VMake' - end if + if (.not. has_data(X)) then + print *, '(I4)', '>>> FAILED test -- FN_VMake, Proc ', myid + print *, ' vector data is not associated' + failure = 1 + return + end if - failure = 0 -end function Test_FN_VMake + if (myid == 0) then + print *, 'PASSED test -- FN_VMake' + end if + failure = 0 + end function Test_FN_VMake !! ---------------------------------------------------------------------- !! NOTE: This routine depends on FN_VConst to check vector data. !! ---------------------------------------------------------------------- -integer(C_INT) function Test_FN_VGetArrayPointer(W, local_length, myid) & + integer(C_INT) function Test_FN_VGetArrayPointer(W, local_length, myid) & result(failure) - implicit none - - type(N_Vector) :: W - integer(kind=myindextype) :: local_length - integer(C_INT) :: myid - - ! check vector data - if (.not. has_data(W)) then - print *, '>>> FAILED test -- FN_VGetArrayPointer, Proc ', myid - print *, ' Vector data == NULL \n\n' - failure = 1 - return; - end if - - call FN_VConst(NEG_HALF, W) - failure = check_ans(NEG_HALF, W, local_length) - - if (failure > 0) then - print *, '(I2)', '>>> FAILED test -- FN_VGetArrayPointer, Proc ', myid - print *, ' Failed FN_VConst check \n\n' - failure = 1 - return - end if - - if (myid == 0) then - print *, 'PASSED test -- FN_VConst' - print *, 'PASSED test -- FN_VGetArrayPointer' - end if - - failure = 0 -end function Test_FN_VGetArrayPointer - - -integer(C_INT) function Test_FN_VLinearCombination(X, local_length, myid) & + implicit none + + type(N_Vector) :: W + integer(kind=myindextype) :: local_length + integer(C_INT) :: myid + + ! check vector data + if (.not. has_data(W)) then + print *, '>>> FAILED test -- FN_VGetArrayPointer, Proc ', myid + print *, ' Vector data == NULL \n\n' + failure = 1 + return; + end if + + call FN_VConst(NEG_HALF, W) + failure = check_ans(NEG_HALF, W, local_length) + + if (failure > 0) then + print *, '(I2)', '>>> FAILED test -- FN_VGetArrayPointer, Proc ', myid + print *, ' Failed FN_VConst check \n\n' + failure = 1 + return + end if + + if (myid == 0) then + print *, 'PASSED test -- FN_VConst' + print *, 'PASSED test -- FN_VGetArrayPointer' + end if + + failure = 0 + end function Test_FN_VGetArrayPointer + + integer(C_INT) function Test_FN_VLinearCombination(X, local_length, myid) & result(failure) - type(N_Vector) :: X - integer(kind=myindextype) :: local_length - integer(C_INT) :: myid, ierr - type(N_Vector), pointer :: Y1, Y2, Y3 - type(c_ptr), target :: V(3) - type(c_ptr) :: Vptr - real(C_DOUBLE) :: c(3) - - failure = 0 - - ! create vectors for testing - Y1 => FN_VClone(X) - Y2 => FN_VClone(X) - Y3 => FN_VClone(X) - - ! set vectors in vector array - V(1) = c_loc(Y1) - V(2) = c_loc(Y2) - V(3) = c_loc(Y3) - Vptr = c_loc(V) - - ! initialize c values - c = ZERO - - ! - ! Case 1a: V[0] = a V[0], FN_VScale - ! - - ! fill vector data - call FN_VConst(TWO, Y1) - - ! set scaling factors - c = HALF - - ierr = FN_VLinearCombination(1, c, Vptr, Y1) - - ! Y1 should be vector of +1 - if (ierr == 0) then - failure = check_ans(ONE, Y1, local_length) - else - failure = 1 - end if - - if (failure > 0) then - print *, '(I4)', '>>> FAILED test -- FN_VLinearCombination Case 1a, Proc ', myid - else if (myid == 0) then - print *, 'PASSED test -- FN_VLinearCombination Case 1a' - end if - - ! - ! Case 3a: V[0] = V[0] + b V[1] + c V[2] - ! - - call FN_VConst(TWO, Y1) - call FN_VConst(NEG_TWO, Y2) - call FN_VConst(NEG_ONE, Y3) - - c(1) = ONE - c(2) = HALF - c(3) = NEG_TWO - - ierr = FN_VLinearCombination(3, c, Vptr, Y1) - - ! Y1 should be vector of +3 - if (ierr == 0) then - failure = check_ans(TWO+ONE, Y1, local_length) - else - failure = 1 - end if - - if (failure > 0) then - print *, '(I4)', '>>> FAILED test -- FN_VLinearCombination Case 3a, Proc ', myid - else if (myid == 0) then - print *, 'PASSED test -- FN_VLinearCombination Case 3a' - end if - - ! Free vectors - call FN_VDestroy(Y1); - call FN_VDestroy(Y2); - call FN_VDestroy(Y3); - -end function Test_FN_VLinearCombination + type(N_Vector) :: X + integer(kind=myindextype) :: local_length + integer(C_INT) :: myid, ierr + type(N_Vector), pointer :: Y1, Y2, Y3 + type(c_ptr), target :: V(3) + type(c_ptr) :: Vptr + real(C_DOUBLE) :: c(3) + + failure = 0 + + ! create vectors for testing + Y1 => FN_VClone(X) + Y2 => FN_VClone(X) + Y3 => FN_VClone(X) + + ! set vectors in vector array + V(1) = c_loc(Y1) + V(2) = c_loc(Y2) + V(3) = c_loc(Y3) + Vptr = c_loc(V) + + ! initialize c values + c = ZERO + + ! + ! Case 1a: V[0] = a V[0], FN_VScale + ! + + ! fill vector data + call FN_VConst(TWO, Y1) + + ! set scaling factors + c = HALF + + ierr = FN_VLinearCombination(1, c, Vptr, Y1) + + ! Y1 should be vector of +1 + if (ierr == 0) then + failure = check_ans(ONE, Y1, local_length) + else + failure = 1 + end if + + if (failure > 0) then + print *, '(I4)', '>>> FAILED test -- FN_VLinearCombination Case 1a, Proc ', myid + else if (myid == 0) then + print *, 'PASSED test -- FN_VLinearCombination Case 1a' + end if + + ! + ! Case 3a: V[0] = V[0] + b V[1] + c V[2] + ! + + call FN_VConst(TWO, Y1) + call FN_VConst(NEG_TWO, Y2) + call FN_VConst(NEG_ONE, Y3) + + c(1) = ONE + c(2) = HALF + c(3) = NEG_TWO + + ierr = FN_VLinearCombination(3, c, Vptr, Y1) + + ! Y1 should be vector of +3 + if (ierr == 0) then + failure = check_ans(TWO + ONE, Y1, local_length) + else + failure = 1 + end if + + if (failure > 0) then + print *, '(I4)', '>>> FAILED test -- FN_VLinearCombination Case 3a, Proc ', myid + else if (myid == 0) then + print *, 'PASSED test -- FN_VLinearCombination Case 3a' + end if + + ! Free vectors + call FN_VDestroy(Y1); + call FN_VDestroy(Y2); + call FN_VDestroy(Y3); + end function Test_FN_VLinearCombination end module diff --git a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 index 8e6e755762..0f238725e7 100644 --- a/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 +++ b/examples/sunlinsol/band/test_fsunlinsol_band_mod.f90 @@ -26,7 +26,7 @@ module test_fsunlinsol_band contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding use fnvector_serial_mod use fsunmatrix_band_mod @@ -37,12 +37,12 @@ integer(C_INT) function unit_tests() result(fails) type(SUNLinearSolver), pointer :: LS ! test linear solver type(SUNMatrix), pointer :: A ! test matrices - type(N_Vector), pointer :: x, y, b ! test vectors - real(C_DOUBLE), pointer :: xdata(:), Adata(:) ! data arrays - real(C_DOUBLE) :: tmpr ! temporary real value + type(N_Vector), pointer :: x, y, b ! test vectors + real(c_double), pointer :: xdata(:), Adata(:) ! data arrays + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j, k integer(kind=myindextype) :: smu, kstart, kend, offset - integer(C_INT) :: tmp + integer(c_int) :: tmp fails = 0 smu = 0 @@ -54,25 +54,25 @@ integer(C_INT) function unit_tests() result(fails) ! fill A matrix with uniform random data in [0, 1/N) Adata => FSUNBandMatrix_Data(A) - do j=1, N - offset = (j-1)*(smu+ml+1) + smu + 1 ! offset to diagonal - kstart = merge(-mu, -(j-1), j > mu) ! above diagonal - kend = merge(N-j , ml, j > N - ml) ! below diagonal - do k=kstart, kend + do j = 1, N + offset = (j - 1)*(smu + ml + 1) + smu + 1 ! offset to diagonal + kstart = merge(-mu, -(j - 1), j > mu) ! above diagonal + kend = merge(N - j, ml, j > N - ml) ! below diagonal + do k = kstart, kend call random_number(tmpr) - Adata(offset+k) = tmpr / N + Adata(offset + k) = tmpr/N end do end do ! fill x vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(x) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do ! scale/shift matrix to ensure diagonal dominance - fails = FSUNMatScaleAddI(ONE/(mu+ml+1), A) + fails = FSUNMatScaleAddI(ONE/(mu + ml + 1), A) if (fails /= 0) then print *, 'FAIL: FSUNMatScaleAddI failure' call FSUNMatDestroy(A) @@ -116,17 +116,15 @@ end function unit_tests end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_utilities implicit none - - type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr + real(c_double) :: tol, maxerr integer(kind=myindextype) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -149,9 +147,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -164,7 +162,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'Band SUNLinearSolver Fortran 2003 interface test' @@ -176,7 +174,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 index 34da2d20a3..728a746bd3 100644 --- a/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 +++ b/examples/sunlinsol/dense/test_fsunlinsol_dense_mod.f90 @@ -20,13 +20,11 @@ module test_fsunlinsol_dense use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding use fnvector_serial_mod use fsunmatrix_dense_mod @@ -36,13 +34,13 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A, I ! test matrices - type(N_Vector), pointer :: x, b ! test vectors - real(C_DOUBLE), pointer :: colj(:), colIj(:) ! matrix column data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A, I ! test matrices + type(N_Vector), pointer :: x, b ! test vectors + real(c_double), pointer :: colj(:), colIj(:) ! matrix column data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j, k - integer(C_INT) :: tmp + integer(c_int) :: tmp fails = 0 @@ -52,34 +50,34 @@ integer(C_INT) function unit_tests() result(fails) b => FN_VNew_Serial(N, sunctx) ! fill A matrix with uniform random data in [0, 1/N) - do j=1, N - colj => FSUNDenseMatrix_Column(A, j-1) - do k=1, N + do j = 1, N + colj => FSUNDenseMatrix_Column(A, j - 1) + do k = 1, N call random_number(tmpr) - colj(k) = tmpr / N + colj(k) = tmpr/N end do end do ! create anti-identity matrix j = N - do k=1, N - colj => FSUNDenseMatrix_Column(I, j-1) + do k = 1, N + colj => FSUNDenseMatrix_Column(I, j - 1) colj(k) = ONE - j = j-1 + j = j - 1 end do ! add anti-identity to ensure the solver needs to do row-swapping - do k=1, N - do j=1, N - colj => FSUNDenseMatrix_Column(A, j-1) - colIj => FSUNDenseMatrix_Column(I, j-1) + do k = 1, N + do j = 1, N + colj => FSUNDenseMatrix_Column(A, j - 1) + colIj => FSUNDenseMatrix_Column(I, j - 1) colj(k) = colj(k) + colIj(k) end do end do ! fill x vector with uniform random data in [0, 1) xdata => FN_VGetArrayPointer(x) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = tmpr end do @@ -117,17 +115,15 @@ end function unit_tests end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_utilities implicit none - - type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr + real(c_double) :: tol, maxerr integer(kind=myindextype) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -150,9 +146,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(ydata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(ydata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", tol, ")" end if @@ -165,7 +161,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'Dense SUNLinearSolver Fortran 2003 interface test' @@ -177,7 +173,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 index c46d15a3b3..a5392d0e6e 100644 --- a/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 +++ b/examples/sunlinsol/klu/test_fsunlinsol_klu_mod.f90 @@ -24,11 +24,9 @@ module test_fsunlinsol_klu contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - use fnvector_serial_mod use fsunmatrix_dense_mod use fsunmatrix_sparse_mod @@ -38,13 +36,13 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A, D ! test matrices - type(N_Vector), pointer :: x, b ! test vectors - real(C_DOUBLE), pointer :: colj(:) ! matrix column data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A, D ! test matrices + type(N_Vector), pointer :: x, b ! test vectors + real(c_double), pointer :: colj(:) ! matrix column data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j, k, i - integer(C_INT) :: tmp + integer(c_int) :: tmp fails = 0 @@ -53,14 +51,14 @@ integer(C_INT) function unit_tests() result(fails) b => FN_VNew_Serial(N, sunctx) ! fill A matrix with uniform random data in [0, 1/N) - do k=1, 5*N + do k = 1, 5*N call random_number(tmpr) - j = max(1, floor(tmpr * N)) + j = max(1, floor(tmpr*N)) call random_number(tmpr) - i = max(1, floor(tmpr * N)) - colj => FSUNDenseMatrix_Column(D, j-1) + i = max(1, floor(tmpr*N)) + colj => FSUNDenseMatrix_Column(D, j - 1) call random_number(tmpr) - colj(i) = tmpr / N + colj(i) = tmpr/N end do ! add identity to matrix @@ -74,7 +72,7 @@ integer(C_INT) function unit_tests() result(fails) ! fill x vector with uniform random data in [0, 1) xdata => FN_VGetArrayPointer(x) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = tmpr end do @@ -114,16 +112,16 @@ end function unit_tests end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -146,9 +144,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", tol, ")" end if @@ -161,7 +159,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'KLU SUNLinearSolver Fortran 2003 interface test' @@ -173,7 +171,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 index 387a126399..0088ca8418 100644 --- a/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 +++ b/examples/sunlinsol/lapackdense/test_fsunlinsol_lapackdense_mod.f90 @@ -20,17 +20,13 @@ module test_fsunlinsol_lapackdense use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - use fnvector_serial_mod use fsunmatrix_dense_mod use fsunlinsol_lapackdense_mod @@ -39,13 +35,13 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A, I ! test matrices - type(N_Vector), pointer :: x, b ! test vectors - real(C_DOUBLE), pointer :: colj(:), colIj(:) ! matrix column data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A, I ! test matrices + type(N_Vector), pointer :: x, b ! test vectors + real(c_double), pointer :: colj(:), colIj(:) ! matrix column data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j, k - integer(C_INT) :: tmp + integer(c_int) :: tmp fails = 0 @@ -55,34 +51,34 @@ integer(C_INT) function unit_tests() result(fails) b => FN_VNew_Serial(N, sunctx) ! fill A matrix with uniform random data in [0, 1/N) - do j=1, N - colj => FSUNDenseMatrix_Column(A, j-1) - do k=1, N + do j = 1, N + colj => FSUNDenseMatrix_Column(A, j - 1) + do k = 1, N call random_number(tmpr) - colj(k) = tmpr / N + colj(k) = tmpr/N end do end do ! create anti-identity matrix j = N - do k=1, N - colj => FSUNDenseMatrix_Column(I, j-1) + do k = 1, N + colj => FSUNDenseMatrix_Column(I, j - 1) colj(k) = ONE - j = j-1 + j = j - 1 end do ! add anti-identity to ensure the solver needs to do row-swapping - do k=1, N - do j=1, N - colj => FSUNDenseMatrix_Column(A, j-1) - colIj => FSUNDenseMatrix_Column(I, j-1) + do k = 1, N + do j = 1, N + colj => FSUNDenseMatrix_Column(A, j - 1) + colIj => FSUNDenseMatrix_Column(I, j - 1) colj(k) = colj(k) + colIj(k) end do end do ! fill x vector with uniform random data in [0, 1) xdata => FN_VGetArrayPointer(x) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = tmpr end do @@ -120,15 +116,15 @@ end function unit_tests end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -151,9 +147,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(ydata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(ydata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", tol, ")" end if @@ -166,7 +162,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'LAPACK-Dense SUNLinearSolver Fortran 2003 interface test' @@ -178,7 +174,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 index f1c22e2ad9..b5bad44d77 100644 --- a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 +++ b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 @@ -25,12 +25,10 @@ module test_fsunlinsol_pcg_serial use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 - integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(C_INT), private, parameter :: maxl = 500 ! maxium Krylov subspace dimension (> 0) - real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance + integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) + integer(c_int), private, parameter :: maxl = 500 ! maxium Krylov subspace dimension (> 0) + real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData integer(kind=myindextype) :: N @@ -39,11 +37,9 @@ module test_fsunlinsol_pcg_serial contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - use fnvector_serial_mod use fsunlinsol_pcg_mod use test_sunlinsol @@ -51,33 +47,33 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! dummy SUNMatrix (set to null) - type(N_Vector), pointer :: x, xhat, b ! test vectors - type(N_Vector), pointer :: s2 ! dummy scaling vector (set to null) - type(UserData), pointer :: probdata ! problem data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A ! dummy SUNMatrix (set to null) + type(N_Vector), pointer :: x, xhat, b ! test vectors + type(N_Vector), pointer :: s2 ! dummy scaling vector (set to null) + type(UserData), pointer :: probdata ! problem data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j - integer(C_INT) :: tmp + integer(c_int) :: tmp ! setup fails = 0 - A => null() + A => null() s2 => null() - x => FN_VNew_Serial(N, sunctx) + x => FN_VNew_Serial(N, sunctx) xhat => FN_VNew_Serial(N, sunctx) - b => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) - allocate(probdata) + allocate (probdata) probdata%N = N probdata%d => FN_VNew_Serial(N, sunctx) probdata%s => FN_VNew_Serial(N, sunctx) ! fill xhat vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(xhat) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do @@ -90,14 +86,14 @@ integer(C_INT) function unit_tests() result(fails) ! run initialization tests fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_ITERATIVE, 0) - fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata),& + fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata), & c_funloc(ATimes), 0) - fails = fails + Test_FSUNLinSolSetPreconditioner(LS,& - c_loc(probdata),& - c_funloc(PSetup),& - c_funloc(PSolve),& + fails = fails + Test_FSUNLinSolSetPreconditioner(LS, & + c_loc(probdata), & + c_funloc(PSetup), & + c_funloc(PSolve), & 0) - fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s,& + fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s, & s2, 0) fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSpace(LS, 0) @@ -125,14 +121,13 @@ integer(C_INT) function unit_tests() result(fails) end if ! Run tests with this setup - fails = fails + FSUNLinSol_PCGSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_PCGSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_PCG module, problem 1' else @@ -156,14 +151,13 @@ integer(C_INT) function unit_tests() result(fails) end if ! Run tests with this setup - fails = fails + FSUNLinSol_PCGSetPrecType(LS, pretype); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_PCGSetPrecType(LS, pretype); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_PCG module, problem 2' else @@ -175,7 +169,7 @@ integer(C_INT) function unit_tests() result(fails) ! set scaling vectors xdata => FN_VGetArrayPointer(probdata%s) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + 1000.0d0*tmpr end do @@ -191,14 +185,13 @@ integer(C_INT) function unit_tests() result(fails) end if ! Run tests with this setup - fails = fails + FSUNLinSol_PCGSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_PCGSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_PCG module, problem 3' else @@ -213,22 +206,22 @@ integer(C_INT) function unit_tests() result(fails) call FN_VDestroy(b) call FN_VDestroy(probdata%d) call FN_VDestroy(probdata%s) - deallocate(probdata) + deallocate (probdata) end function unit_tests - integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) + integer(c_int) function ATimes(udata, vvec, zvec) result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: vvec, zvec type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: v(:), z(:), s(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: v(:), z(:), s(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) @@ -241,37 +234,37 @@ integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) z(1) = (FIVE*v(1)/s(1) - v(2)/s(2))/s(1) ! iterate through interior of local domain, performing product - do i = 2, N-1 - z(i) = (-v(i-1)/s(i-1) + FIVE*v(i)/s(i) - v(i+1)/s(i+1))/s(i) + do i = 2, N - 1 + z(i) = (-v(i - 1)/s(i - 1) + FIVE*v(i)/s(i) - v(i + 1)/s(i + 1))/s(i) end do ! perform product at the right domain boundary (note: v is zero at the boundary) - z(N) = (-v(N-1)/s(N-1) + FIVE*v(N)/s(N))/s(N) + z(N) = (-v(N - 1)/s(N - 1) + FIVE*v(N)/s(N))/s(N) ret = 0 end function ATimes - integer(C_INT) function PSetup(udata) result(ret) bind(C) + integer(c_int) function PSetup(udata) result(ret) bind(C) use, intrinsic :: iso_c_binding - type(C_PTR), value :: udata + type(c_ptr), value :: udata ret = 0 end function PSetup - integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & - result(ret) bind(C) + integer(c_int) function PSolve(udata, rvec, zvec, tol, lr) & + result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr + real(c_double) :: tol + integer(c_int) :: lr type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:), s(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: r(:), z(:), d(:), s(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) @@ -281,8 +274,8 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & s => FN_VGetArrayPointer(probdata%s) N = probdata%N - do i=1, N - z(i) = s(i) * s(i) * r(i) / d(i) + do i = 1, N + z(i) = s(i)*s(i)*r(i)/d(i) end do ret = 0 @@ -290,16 +283,16 @@ end function PSolve end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_pcg_serial use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -322,9 +315,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -337,7 +330,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'PCG SUNLinearSolver Fortran 2003 interface test' @@ -350,7 +343,7 @@ program main print *, 'FAILURE: ', fails, ' unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 index 12941ec00c..7d5d2dfae6 100644 --- a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 +++ b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 @@ -25,12 +25,10 @@ module test_fsunlinsol_spbcgs_serial use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 - integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) - real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance + integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) + integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData integer(kind=myindextype) :: N @@ -39,11 +37,9 @@ module test_fsunlinsol_spbcgs_serial contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - use fnvector_serial_mod use fsunlinsol_spbcgs_mod use test_sunlinsol @@ -51,32 +47,32 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! dummy SUNMatrix - type(N_Vector), pointer :: x, xhat, b ! test vectors - type(UserData), pointer :: probdata ! problem data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A ! dummy SUNMatrix + type(N_Vector), pointer :: x, xhat, b ! test vectors + type(UserData), pointer :: probdata ! problem data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j - integer(C_INT) :: tmp + integer(c_int) :: tmp ! setup fails = 0 A => null() - x => FN_VNew_Serial(N, sunctx) + x => FN_VNew_Serial(N, sunctx) xhat => FN_VNew_Serial(N, sunctx) - b => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) - allocate(probdata) + allocate (probdata) probdata%N = N - probdata%d => FN_VNew_Serial(N, sunctx) + probdata%d => FN_VNew_Serial(N, sunctx) probdata%s1 => FN_VNew_Serial(N, sunctx) probdata%s2 => FN_VNew_Serial(N, sunctx) ! fill xhat vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(xhat) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do @@ -89,14 +85,14 @@ integer(C_INT) function unit_tests() result(fails) ! run initialization tests fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_ITERATIVE, 0) - fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata),& + fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata), & c_funloc(ATimes), 0) - fails = fails + Test_FSUNLinSolSetPreconditioner(LS,& - c_loc(probdata),& - c_funloc(PSetup),& - c_funloc(PSolve),& + fails = fails + Test_FSUNLinSolSetPreconditioner(LS, & + c_loc(probdata), & + c_funloc(PSetup), & + c_funloc(PSolve), & 0) - fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1,& + fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1, & probdata%s2, 0) fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSpace(LS, 0) @@ -121,14 +117,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPBCGS module, problem 1' else @@ -149,14 +144,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, pretype); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, pretype); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPBCGS module, problem 2' else @@ -168,7 +162,7 @@ integer(C_INT) function unit_tests() result(fails) ! set scaling vectors xdata => FN_VGetArrayPointer(probdata%s1) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + 1000.0d0*tmpr end do @@ -181,14 +175,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPBCGSSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPBCGS module, problem 3' else @@ -204,66 +197,66 @@ integer(C_INT) function unit_tests() result(fails) call FN_VDestroy(probdata%d) call FN_VDestroy(probdata%s1) call FN_VDestroy(probdata%s2) - deallocate(probdata) + deallocate (probdata) end function unit_tests - integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) + integer(c_int) function ATimes(udata, vvec, zvec) result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: vvec, zvec type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: v(:), z(:), s1(:), s2(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: v(:), z(:), s1(:), s2(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) - v => FN_VGetArrayPointer(vvec) - z => FN_VGetArrayPointer(zvec) + v => FN_VGetArrayPointer(vvec) + z => FN_VGetArrayPointer(zvec) s1 => FN_VGetArrayPointer(probdata%s1) s2 => FN_VGetArrayPointer(probdata%s2) - N = probdata%N + N = probdata%N ! perform product at the left domain boundary (note: v is zero at the boundary) z(1) = (FIVE*v(1)*s2(1) - v(2)*s2(2))/s1(1) ! iterate through interior of local domain, performing product - do i = 2, N-1 - z(i) = (-v(i-1)*s2(i-1) + FIVE*v(i)*s2(i) - v(i+1)*s2(i+1))/s1(i) + do i = 2, N - 1 + z(i) = (-v(i - 1)*s2(i - 1) + FIVE*v(i)*s2(i) - v(i + 1)*s2(i + 1))/s1(i) end do ! perform product at the right domain boundary (note: v is zero at the boundary) - z(N) = (-v(N-1)*s2(N-1) + FIVE*v(N)*s2(N))/s1(N) + z(N) = (-v(N - 1)*s2(N - 1) + FIVE*v(N)*s2(N))/s1(N) ret = 0 end function ATimes - integer(C_INT) function PSetup(udata) result(ret) bind(C) + integer(c_int) function PSetup(udata) result(ret) bind(C) use, intrinsic :: iso_c_binding - type(C_PTR), value :: udata + type(c_ptr), value :: udata ret = 0 end function PSetup - integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & - result(ret) bind(C) + integer(c_int) function PSolve(udata, rvec, zvec, tol, lr) & + result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr + real(c_double) :: tol + integer(c_int) :: lr type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: r(:), z(:), d(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) @@ -272,8 +265,8 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & d => FN_VGetArrayPointer(probdata%d) N = probdata%N - do i=1, N - z(i) = r(i) / d(i) + do i = 1, N + z(i) = r(i)/d(i) end do ret = 0 @@ -281,16 +274,16 @@ end function PSolve end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_spbcgs_serial use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -313,9 +306,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -328,7 +321,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'SPBCGS SUNLinearSolver Fortran 2003 interface test' @@ -341,7 +334,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 index aa5066aed7..0a14009745 100644 --- a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 +++ b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 @@ -24,13 +24,11 @@ module test_fsunlinsol_spfgmr_serial use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 - integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(C_INT), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) - integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) - real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance + integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) + integer(c_int), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) + integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData integer(kind=myindextype) :: N @@ -39,7 +37,7 @@ module test_fsunlinsol_spfgmr_serial contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding use fnvector_serial_mod use fsunlinsol_spfgmr_mod @@ -48,32 +46,32 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! dummy SUNMatrix - type(N_Vector), pointer :: x, xhat, b ! test vectors - type(UserData), pointer :: probdata ! problem data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A ! dummy SUNMatrix + type(N_Vector), pointer :: x, xhat, b ! test vectors + type(UserData), pointer :: probdata ! problem data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j - integer(C_INT) :: tmp + integer(c_int) :: tmp ! setup fails = 0 A => null() - x => FN_VNew_Serial(N, sunctx) + x => FN_VNew_Serial(N, sunctx) xhat => FN_VNew_Serial(N, sunctx) - b => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) - allocate(probdata) - probdata%N = N - probdata%d => FN_VNew_Serial(N, sunctx) + allocate (probdata) + probdata%N = N + probdata%d => FN_VNew_Serial(N, sunctx) probdata%s1 => FN_VNew_Serial(N, sunctx) probdata%s2 => FN_VNew_Serial(N, sunctx) ! fill xhat vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(xhat) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do @@ -86,14 +84,14 @@ integer(C_INT) function unit_tests() result(fails) ! run initialization tests fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_ITERATIVE, 0) - fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata),& + fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata), & c_funloc(ATimes), 0) - fails = fails + Test_FSUNLinSolSetPreconditioner(LS,& - c_loc(probdata),& - c_funloc(PSetup),& - c_funloc(PSolve),& + fails = fails + Test_FSUNLinSolSetPreconditioner(LS, & + c_loc(probdata), & + c_funloc(PSetup), & + c_funloc(PSolve), & 0) - fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1,& + fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1, & probdata%s2, 0) fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSpace(LS, 0) @@ -119,14 +117,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPFGMR module, problem 1' else @@ -147,14 +144,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, pretype); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, pretype); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPFGMR module, problem 2' else @@ -166,7 +162,7 @@ integer(C_INT) function unit_tests() result(fails) ! set scaling vectors xdata => FN_VGetArrayPointer(probdata%s1) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + 1000.0d0*tmpr end do @@ -179,14 +175,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPFGMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPFGMR module, problem 3' else @@ -202,66 +197,66 @@ integer(C_INT) function unit_tests() result(fails) call FN_VDestroy(probdata%d) call FN_VDestroy(probdata%s1) call FN_VDestroy(probdata%s2) - deallocate(probdata) + deallocate (probdata) end function unit_tests - integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) + integer(c_int) function ATimes(udata, vvec, zvec) result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: vvec, zvec type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: v(:), z(:), s1(:), s2(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: v(:), z(:), s1(:), s2(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) - v => FN_VGetArrayPointer(vvec) - z => FN_VGetArrayPointer(zvec) + v => FN_VGetArrayPointer(vvec) + z => FN_VGetArrayPointer(zvec) s1 => FN_VGetArrayPointer(probdata%s1) s2 => FN_VGetArrayPointer(probdata%s2) - N = probdata%N + N = probdata%N ! perform product at the left domain boundary (note: v is zero at the boundary) z(1) = (FIVE*v(1)*s2(1) - v(2)*s2(2))/s1(1) ! iterate through interior of local domain, performing product - do i = 2, N-1 - z(i) = (-v(i-1)*s2(i-1) + FIVE*v(i)*s2(i) - v(i+1)*s2(i+1))/s1(i) + do i = 2, N - 1 + z(i) = (-v(i - 1)*s2(i - 1) + FIVE*v(i)*s2(i) - v(i + 1)*s2(i + 1))/s1(i) end do ! perform product at the right domain boundary (note: v is zero at the boundary) - z(N) = (-v(N-1)*s2(N-1) + FIVE*v(N)*s2(N))/s1(N) + z(N) = (-v(N - 1)*s2(N - 1) + FIVE*v(N)*s2(N))/s1(N) ret = 0 end function ATimes - integer(C_INT) function PSetup(udata) result(ret) bind(C) + integer(c_int) function PSetup(udata) result(ret) bind(C) use, intrinsic :: iso_c_binding - type(C_PTR), value :: udata + type(c_ptr), value :: udata ret = 0 end function PSetup - integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & - result(ret) bind(C) + integer(c_int) function PSolve(udata, rvec, zvec, tol, lr) & + result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr + real(c_double) :: tol + integer(c_int) :: lr type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: r(:), z(:), d(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) @@ -270,8 +265,8 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & d => FN_VGetArrayPointer(probdata%d) N = probdata%N - do i=1, N - z(i) = r(i) / d(i) + do i = 1, N + z(i) = r(i)/d(i) end do ret = 0 @@ -279,16 +274,16 @@ end function PSolve end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_spfgmr_serial use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -311,9 +306,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -326,7 +321,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'SPFGMR SUNLinearSolver Fortran 2003 interface test' @@ -339,7 +334,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 index 9f72112a41..0f9dec6568 100644 --- a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 +++ b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 @@ -24,13 +24,11 @@ module test_fsunlinsol_spgmr_serial use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 - integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(C_INT), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) - integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) - real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance + integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) + integer(c_int), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) + integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData integer(kind=myindextype) :: N @@ -39,7 +37,7 @@ module test_fsunlinsol_spgmr_serial contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding use fnvector_serial_mod use fsunlinsol_spgmr_mod @@ -48,32 +46,32 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! dummy SUNMatrix - type(N_Vector), pointer :: x, xhat, b ! test vectors - type(UserData), pointer :: probdata ! problem data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A ! dummy SUNMatrix + type(N_Vector), pointer :: x, xhat, b ! test vectors + type(UserData), pointer :: probdata ! problem data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j - integer(C_INT) :: tmp + integer(c_int) :: tmp ! setup fails = 0 A => null() - x => FN_VNew_Serial(N, sunctx) + x => FN_VNew_Serial(N, sunctx) xhat => FN_VNew_Serial(N, sunctx) - b => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) - allocate(probdata) - probdata%N = N - probdata%d => FN_VNew_Serial(N, sunctx) + allocate (probdata) + probdata%N = N + probdata%d => FN_VNew_Serial(N, sunctx) probdata%s1 => FN_VNew_Serial(N, sunctx) probdata%s2 => FN_VNew_Serial(N, sunctx) ! fill xhat vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(xhat) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do @@ -86,14 +84,14 @@ integer(C_INT) function unit_tests() result(fails) ! run initialization tests fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_ITERATIVE, 0) - fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata),& + fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata), & c_funloc(ATimes), 0) - fails = fails + Test_FSUNLinSolSetPreconditioner(LS,& - c_loc(probdata),& - c_funloc(PSetup),& - c_funloc(PSolve),& + fails = fails + Test_FSUNLinSolSetPreconditioner(LS, & + c_loc(probdata), & + c_funloc(PSetup), & + c_funloc(PSolve), & 0) - fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1,& + fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1, & probdata%s2, 0) fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSpace(LS, 0) @@ -119,14 +117,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPGMR module, problem 1' else @@ -147,14 +144,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, pretype); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, pretype); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPGMR module, problem 2' else @@ -166,7 +162,7 @@ integer(C_INT) function unit_tests() result(fails) ! set scaling vectors xdata => FN_VGetArrayPointer(probdata%s1) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + 1000.0d0*tmpr end do @@ -179,14 +175,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPGMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPGMR module, problem 3' else @@ -202,65 +197,65 @@ integer(C_INT) function unit_tests() result(fails) call FN_VDestroy(probdata%d) call FN_VDestroy(probdata%s1) call FN_VDestroy(probdata%s2) - deallocate(probdata) + deallocate (probdata) end function unit_tests - integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) + integer(c_int) function ATimes(udata, vvec, zvec) result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: vvec, zvec type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: v(:), z(:), s1(:), s2(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: v(:), z(:), s1(:), s2(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) - v => FN_VGetArrayPointer(vvec) - z => FN_VGetArrayPointer(zvec) + v => FN_VGetArrayPointer(vvec) + z => FN_VGetArrayPointer(zvec) s1 => FN_VGetArrayPointer(probdata%s1) s2 => FN_VGetArrayPointer(probdata%s2) - N = probdata%N + N = probdata%N ! perform product at the left domain boundary (note: v is zero at the boundary) z(1) = (FIVE*v(1)*s2(1) - v(2)*s2(2))/s1(1) ! iterate through interior of local domain, performing product - do i = 2, N-1 - z(i) = (-v(i-1)*s2(i-1) + FIVE*v(i)*s2(i) - v(i+1)*s2(i+1))/s1(i) + do i = 2, N - 1 + z(i) = (-v(i - 1)*s2(i - 1) + FIVE*v(i)*s2(i) - v(i + 1)*s2(i + 1))/s1(i) end do ! perform product at the right domain boundary (note: v is zero at the boundary) - z(N) = (-v(N-1)*s2(N-1) + FIVE*v(N)*s2(N))/s1(N) + z(N) = (-v(N - 1)*s2(N - 1) + FIVE*v(N)*s2(N))/s1(N) ret = 0 end function ATimes - integer(C_INT) function PSetup(udata) result(ret) bind(C) + integer(c_int) function PSetup(udata) result(ret) bind(C) use, intrinsic :: iso_c_binding - type(C_PTR), value :: udata + type(c_ptr), value :: udata ret = 0 end function PSetup - integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & - result(ret) bind(C) + integer(c_int) function PSolve(udata, rvec, zvec, tol, lr) & + result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr + real(c_double) :: tol + integer(c_int) :: lr type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:) + real(c_double), pointer :: r(:), z(:), d(:) integer(kind=myindextype) :: i, N call c_f_pointer(udata, probdata) @@ -270,8 +265,8 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & d => FN_VGetArrayPointer(probdata%d) N = probdata%N - do i=1, N - z(i) = r(i) / d(i) + do i = 1, N + z(i) = r(i)/d(i) end do ret = 0 @@ -279,16 +274,16 @@ end function PSolve end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_spgmr_serial use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr + real(c_double) :: tol, maxerr integer(kind=myindextype) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -311,9 +306,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -326,7 +321,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'SPGMR SUNLinearSolver Fortran 2003 interface test' @@ -339,7 +334,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 index ea6d19df35..85c89199f2 100644 --- a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 +++ b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 @@ -25,12 +25,10 @@ module test_fsunlinsol_sptfqmr_serial use test_utilities implicit none - - integer(kind=myindextype), private, parameter :: N = 100 - integer(C_INT), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(C_INT), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) - real(C_DOUBLE), private, parameter :: tol = 1e-13 ! solver tolerance + integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) + integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData integer(kind=myindextype) :: N @@ -39,11 +37,9 @@ module test_fsunlinsol_sptfqmr_serial contains - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - - use fnvector_serial_mod use fsunlinsol_sptfqmr_mod use test_sunlinsol @@ -51,32 +47,32 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNLinearSolver), pointer :: LS ! test linear solver - type(SUNMatrix), pointer :: A ! dummy SUNMatrix - type(N_Vector), pointer :: x, xhat, b ! test vectors - type(UserData), pointer :: probdata ! problem data - real(C_DOUBLE), pointer :: xdata(:) ! x vector data - real(C_DOUBLE) :: tmpr ! temporary real value + type(SUNMatrix), pointer :: A ! dummy SUNMatrix + type(N_Vector), pointer :: x, xhat, b ! test vectors + type(UserData), pointer :: probdata ! problem data + real(c_double), pointer :: xdata(:) ! x vector data + real(c_double) :: tmpr ! temporary real value integer(kind=myindextype) :: j - integer(C_INT) :: tmp + integer(c_int) :: tmp ! setup fails = 0 A => null() - x => FN_VNew_Serial(N, sunctx) + x => FN_VNew_Serial(N, sunctx) xhat => FN_VNew_Serial(N, sunctx) - b => FN_VNew_Serial(N, sunctx) + b => FN_VNew_Serial(N, sunctx) - allocate(probdata) - probdata%N = N - probdata%d => FN_VNew_Serial(N, sunctx) + allocate (probdata) + probdata%N = N + probdata%d => FN_VNew_Serial(N, sunctx) probdata%s1 => FN_VNew_Serial(N, sunctx) probdata%s2 => FN_VNew_Serial(N, sunctx) ! fill xhat vector with uniform random data in [1, 2) xdata => FN_VGetArrayPointer(xhat) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + tmpr end do @@ -89,14 +85,14 @@ integer(C_INT) function unit_tests() result(fails) ! run initialization tests fails = fails + Test_FSUNLinSolGetType(LS, SUNLINEARSOLVER_ITERATIVE, 0) - fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata),& + fails = fails + Test_FSUNLinSolSetATimes(LS, c_loc(probdata), & c_funloc(ATimes), 0) - fails = fails + Test_FSUNLinSolSetPreconditioner(LS,& - c_loc(probdata),& - c_funloc(PSetup),& - c_funloc(PSolve),& + fails = fails + Test_FSUNLinSolSetPreconditioner(LS, & + c_loc(probdata), & + c_funloc(PSetup), & + c_funloc(PSolve), & 0) - fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1,& + fails = fails + Test_FSUNLinSolSetScalingVectors(LS, probdata%s1, & probdata%s2, 0) fails = fails + Test_FSUNLinSolInitialize(LS, 0) fails = fails + Test_FSUNLinSolSpace(LS, 0) @@ -121,14 +117,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPTFQMR module, problem 1' else @@ -149,14 +144,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, pretype); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, pretype); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPTFQMR module, problem 2' else @@ -168,7 +162,7 @@ integer(C_INT) function unit_tests() result(fails) ! set scaling vectors xdata => FN_VGetArrayPointer(probdata%s1) - do j=1, N + do j = 1, N call random_number(tmpr) xdata(j) = ONE + 1000.0d0*tmpr end do @@ -181,14 +175,13 @@ integer(C_INT) function unit_tests() result(fails) fails = fails + ATimes(c_loc(probdata), x, b) ! Run tests with this setup - fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, SUN_PREC_NONE); - fails = fails + Test_FSUNLinSolSetup(LS, A, 0); - fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); - fails = fails + Test_FSUNLinSolLastFlag(LS, 0); - fails = fails + Test_FSUNLinSolNumIters(LS, 0); - fails = fails + Test_FSUNLinSolResNorm(LS, 0); - fails = fails + Test_FSUNLinSolResid(LS, 0); - + fails = fails + FSUNLinSol_SPTFQMRSetPrecType(LS, SUN_PREC_NONE); + fails = fails + Test_FSUNLinSolSetup(LS, A, 0); + fails = fails + Test_FSUNLinSolSolve(LS, A, x, b, tol, 0); + fails = fails + Test_FSUNLinSolLastFlag(LS, 0); + fails = fails + Test_FSUNLinSolNumIters(LS, 0); + fails = fails + Test_FSUNLinSolResNorm(LS, 0); + fails = fails + Test_FSUNLinSolResid(LS, 0); if (fails /= 0) then print *, 'FAIL: FSUNLinSol_SPTFQMR module, problem 3' else @@ -204,66 +197,66 @@ integer(C_INT) function unit_tests() result(fails) call FN_VDestroy(probdata%d) call FN_VDestroy(probdata%s1) call FN_VDestroy(probdata%s2) - deallocate(probdata) + deallocate (probdata) end function unit_tests - integer(C_INT) function ATimes(udata, vvec, zvec) result(ret) bind(C) + integer(c_int) function ATimes(udata, vvec, zvec) result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: vvec, zvec type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: v(:), z(:), s1(:), s2(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: v(:), z(:), s1(:), s2(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) - v => FN_VGetArrayPointer(vvec) - z => FN_VGetArrayPointer(zvec) + v => FN_VGetArrayPointer(vvec) + z => FN_VGetArrayPointer(zvec) s1 => FN_VGetArrayPointer(probdata%s1) s2 => FN_VGetArrayPointer(probdata%s2) - N = probdata%N + N = probdata%N ! perform product at the left domain boundary (note: v is zero at the boundary) z(1) = (FIVE*v(1)*s2(1) - v(2)*s2(2))/s1(1) ! iterate through interior of local domain, performing product - do i = 2, N-1 - z(i) = (-v(i-1)*s2(i-1) + FIVE*v(i)*s2(i) - v(i+1)*s2(i+1))/s1(i) + do i = 2, N - 1 + z(i) = (-v(i - 1)*s2(i - 1) + FIVE*v(i)*s2(i) - v(i + 1)*s2(i + 1))/s1(i) end do ! perform product at the right domain boundary (note: v is zero at the boundary) - z(N) = (-v(N-1)*s2(N-1) + FIVE*v(N)*s2(N))/s1(N) + z(N) = (-v(N - 1)*s2(N - 1) + FIVE*v(N)*s2(N))/s1(N) ret = 0 end function ATimes - integer(C_INT) function PSetup(udata) result(ret) bind(C) + integer(c_int) function PSetup(udata) result(ret) bind(C) use, intrinsic :: iso_c_binding - type(C_PTR), value :: udata + type(c_ptr), value :: udata ret = 0 end function PSetup - integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & - result(ret) bind(C) + integer(c_int) function PSolve(udata, rvec, zvec, tol, lr) & + result(ret) bind(C) use, intrinsic :: iso_c_binding use test_utilities implicit none - type(C_PTR), value :: udata + type(c_ptr), value :: udata type(N_Vector) :: rvec, zvec - real(C_DOUBLE) :: tol - integer(C_INT) :: lr + real(c_double) :: tol + integer(c_int) :: lr type(UserData), pointer :: probdata - real(C_DOUBLE), pointer :: r(:), z(:), d(:) - integer(C_LONG) :: i, N + real(c_double), pointer :: r(:), z(:), d(:) + integer(c_long) :: i, N call c_f_pointer(udata, probdata) @@ -272,8 +265,8 @@ integer(C_INT) function PSolve(udata, rvec, zvec, tol, lr) & d => FN_VGetArrayPointer(probdata%d) N = probdata%N - do i=1, N - z(i) = r(i) / d(i) + do i = 1, N + z(i) = r(i)/d(i) end do ret = 0 @@ -281,16 +274,16 @@ end function PSolve end module -integer(C_INT) function check_vector(X, Y, tol) result(failure) +integer(c_int) function check_vector(X, Y, tol) result(failure) use, intrinsic :: iso_c_binding use test_fsunlinsol_sptfqmr_serial use test_utilities implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol, maxerr - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol, maxerr + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -313,9 +306,9 @@ integer(C_INT) function check_vector(X, Y, tol) result(failure) if (failure > 0) then maxerr = ZERO do i = 1, xlen - maxerr = max(abs(xdata(i)-ydata(i))/abs(xdata(i)), maxerr) + maxerr = max(abs(xdata(i) - ydata(i))/abs(xdata(i)), maxerr) end do - write(*,'(A,E14.7,A,E14.7,A)') & + write (*, '(A,E14.7,A,E14.7,A)') & "FAIL: check_vector failure: maxerr = ", maxerr, " (tol = ", FIVE*tol, ")" end if @@ -328,7 +321,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'SPTFQMR SUNLinearSolver Fortran 2003 interface test' @@ -341,7 +334,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunlinsol/test_sunlinsol.f90 b/examples/sunlinsol/test_sunlinsol.f90 index ffdb50250c..584d4162ae 100644 --- a/examples/sunlinsol/test_sunlinsol.f90 +++ b/examples/sunlinsol/test_sunlinsol.f90 @@ -26,37 +26,36 @@ module test_sunlinsol implicit none ! check_vector routine is provided by implementation specific tests - integer(C_INT), external :: check_vector + integer(c_int), external :: check_vector contains - integer(C_INT) function Test_FSUNLinSolGetType(S, mysunid, myid) result(failure) + integer(c_int) function Test_FSUNLinSolGetType(S, mysunid, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S integer(SUNLinearSolver_Type) :: mysunid, sunid - integer(C_INT) :: myid + integer(c_int) :: myid failure = 0 sunid = FSUNLinSolGetType(S) if (sunid /= mysunid) then failure = 1 - write(*,*) ">>> FAILED test -- FSUNLinSolGetType, Proc", myid + write (*, *) ">>> FAILED test -- FSUNLinSolGetType, Proc", myid else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolGetType" + write (*, *) " PASSED test -- FSUNLinSolGetType" end if end function Test_FSUNLinSolGetType - - integer(C_INT) function Test_FSUNLinSolLastFlag(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolLastFlag(S, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - integer(C_INT) :: myid - integer(C_LONG) :: lastflag + integer(c_int) :: myid + integer(c_long) :: lastflag failure = 0 @@ -64,40 +63,38 @@ integer(C_INT) function Test_FSUNLinSolLastFlag(S, myid) result(failure) ! which will cause a seg-fault lastflag = FSUNLinSolLastFlag(S) if (myid == 0) then - write(*,'(A,I0,A)') " PASSED test -- FSUNLinSolLastFlag (", lastflag, ")" + write (*, '(A,I0,A)') " PASSED test -- FSUNLinSolLastFlag (", lastflag, ")" end if end function Test_FSUNLinSolLastFlag - - integer(C_INT) function Test_FSUNLinSolSpace(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolSpace(S, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - integer(C_INT) :: myid - integer(C_LONG) :: lenrw(1), leniw(1) + integer(c_int) :: myid + integer(c_long) :: lenrw(1), leniw(1) failure = 0 ! call FSUNLinSolSpace (failure based on output flag) failure = FSUNLinSolSpace(S, lenrw, leniw) if (failure /= 0) then - write(*,*) ">>> FAILED test -- FSUNLinSolSpace, Proc ", myid + write (*, *) ">>> FAILED test -- FSUNLinSolSpace, Proc ", myid else if (myid == 0) then - write(*,'(A,I0,A,I0)') " PASSED test -- FSUNLinSolSpace, lenrw = ", & - lenrw, " leniw = ", leniw + write (*, '(A,I0,A,I0)') " PASSED test -- FSUNLinSolSpace, lenrw = ", & + lenrw, " leniw = ", leniw end if end function Test_FSUNLinSolSpace - - integer(C_INT) function Test_FSUNLinSolNumIters(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolNumIters(S, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - integer(C_INT) :: myid - integer(C_INT) :: numiters + integer(c_int) :: myid + integer(c_int) :: numiters failure = 0 @@ -105,116 +102,107 @@ integer(C_INT) function Test_FSUNLinSolNumIters(S, myid) result(failure) numiters = FSUNLinSolNumIters(S) if (myid == 0) then - write(*,'(A,I0,A)') " PASSED test -- FSUNLinSolNumIters (", numiters, ")" + write (*, '(A,I0,A)') " PASSED test -- FSUNLinSolNumIters (", numiters, ")" end if end function Test_FSUNLinSolNumIters - - integer(C_INT) function Test_FSUNLinSolResNorm(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolResNorm(S, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - integer(C_INT) :: myid - real(C_DOUBLE) :: resnorm + integer(c_int) :: myid + real(c_double) :: resnorm failure = 0 resnorm = FSUNLinSolResNorm(S) if (resnorm < ZERO) then - write(*,'(A,E14.7,A,I0)') & + write (*, '(A,E14.7,A,I0)') & ">>> FAILED test -- FSUNLinSolSolve returned ", resnorm, ", Proc ", myid else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolResNorm " + write (*, *) " PASSED test -- FSUNLinSolResNorm " end if end function Test_FSUNLinSolResNorm - - integer(C_INT) function Test_FSUNLinSolResid(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolResid(S, myid) result(failure) use, intrinsic :: iso_c_binding - - implicit none type(SUNLinearSolver), pointer :: S - integer(C_INT) :: myid - type(N_Vector), pointer :: resid + integer(c_int) :: myid + type(N_Vector), pointer :: resid failure = 0 resid => FSUNLinSolResid(S) if (.not. associated(resid)) then - write(*,*) ">>> FAILED test -- FSUNLinSolResid returned NULL N_Vector, Proc ", myid + write (*, *) ">>> FAILED test -- FSUNLinSolResid returned NULL N_Vector, Proc ", myid else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolResid " + write (*, *) " PASSED test -- FSUNLinSolResid " end if end function Test_FSUNLinSolResid - - integer(C_INT) function Test_FSUNLinSolSetATimes(S, ATdata, ATimes, myid) & + integer(c_int) function Test_FSUNLinSolSetATimes(S, ATdata, ATimes, myid) & result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - type(C_PTR) :: ATdata - type(C_FUNPTR) :: ATimes - integer(C_INT) :: myid + type(c_ptr) :: ATdata + type(c_funptr) :: ATimes + integer(c_int) :: myid failure = 0 ! try calling SetATimes routine: should pass/fail based on expected input - failure = FSUNLinSolSetATimes(S, ATdata, ATimes); - + failure = FSUNLinSolSetATimes(S, ATdata, ATimes); if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolSetATimes returned ", failure, ", Proc ", myid failure = 1 else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolSetATimes " + write (*, *) " PASSED test -- FSUNLinSolSetATimes " end if end function Test_FSUNLinSolSetATimes - - integer(C_INT) function Test_FSUNLinSolSetPreconditioner(S, Pdata, PSetup, PSolve, myid) & + integer(c_int) function Test_FSUNLinSolSetPreconditioner(S, Pdata, PSetup, PSolve, myid) & result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver), pointer :: S - type(C_PTR) :: Pdata - type(C_FUNPTR) :: PSetup, PSolve - integer(C_INT) :: myid + type(c_ptr) :: Pdata + type(c_funptr) :: PSetup, PSolve + integer(c_int) :: myid ! try calling SetPreconditioner routine: should pass/fail based on expected input - failure = FSUNLinSolSetPreconditioner(S, Pdata, PSetup, PSolve); - + failure = FSUNLinSolSetPreconditioner(S, Pdata, PSetup, PSolve); if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolSetPreconditioner returned ", failure, ", Proc ", myid failure = 1 else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolSetPreconditioner " + write (*, *) " PASSED test -- FSUNLinSolSetPreconditioner " end if end function Test_FSUNLinSolSetPreconditioner - - integer(C_INT) function Test_FSUNLinSolSetScalingVectors(S, s1, s2, myid) & + integer(c_int) function Test_FSUNLinSolSetScalingVectors(S, s1, s2, myid) & result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver) :: S type(N_Vector) :: s1, s2 - integer(C_INT) :: myid + integer(c_int) :: myid failure = 0 @@ -222,55 +210,54 @@ integer(C_INT) function Test_FSUNLinSolSetScalingVectors(S, s1, s2, myid) & failure = FSUNLinSolSetScalingVectors(S, s1, s2) if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolSetScalingVectors returned ", failure, ", Proc ", myid failure = 1 else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolSetScalingVectors " + write (*, *) " PASSED test -- FSUNLinSolSetScalingVectors " end if end function Test_FSUNLinSolSetScalingVectors - - integer(C_INT) function Test_FSUNLinSolInitialize(S, myid) result(failure) + integer(c_int) function Test_FSUNLinSolInitialize(S, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver) :: S - integer(C_INT) :: myid + integer(c_int) :: myid failure = 0 failure = FSUNLinSolInitialize(S) if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolInitialize returned ", failure, ", Proc ", myid failure = 1 else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolInitialize " + write (*, *) " PASSED test -- FSUNLinSolInitialize " end if end function Test_FSUNLinSolInitialize - integer(C_INT) function Test_FSUNLinSolSetup(S, A, myid) result(failure) + integer(c_int) function Test_FSUNLinSolSetup(S, A, myid) result(failure) use, intrinsic :: iso_c_binding implicit none type(SUNLinearSolver) :: S type(SUNMatrix) :: A - integer(C_INT) :: myid + integer(c_int) :: myid failure = 0 failure = FSUNLinSolSetup(S, A) if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolSetup returned ", failure, ", Proc ", myid failure = 1 else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolSetup " + write (*, *) " PASSED test -- FSUNLinSolSetup " end if end function Test_FSUNLinSolSetup @@ -283,7 +270,7 @@ end function Test_FSUNLinSolSetup ! while the 'A' that is supplied to this function should have been ! 'setup' by the Test_FSUNLinSolSetup() function prior to this call. ! ---------------------------------------------------------------------- - integer(C_INT) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failure) + integer(c_int) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failure) use, intrinsic :: iso_c_binding implicit none @@ -291,8 +278,8 @@ integer(C_INT) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failu type(SUNMatrix) :: A type(N_Vector) :: x, b type(N_Vector), pointer :: y - real(C_DOUBLE) :: tol - integer(C_INT) :: myid + real(c_double) :: tol + integer(c_int) :: myid failure = 0 @@ -303,7 +290,7 @@ integer(C_INT) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failu ! perform solve failure = FSUNLinSolSolve(S, A, y, b, tol) if (failure /= 0) then - write(*,'(A,I0,A,I0)') & + write (*, '(A,I0,A,I0)') & ">>> FAILED test -- FSUNLinSolSolve returned ", failure, ", Proc ", myid return end if @@ -313,9 +300,9 @@ integer(C_INT) function Test_FSUNLinSolSolve(S, A, x, b, tol, myid) result(failu call FN_VScale(ONE, y, x) if (failure /= 0) then - write(*,*) ">>> FAILED test -- FSUNLinSolSolve check, Proc ", myid + write (*, *) ">>> FAILED test -- FSUNLinSolSolve check, Proc ", myid else if (myid == 0) then - write(*,*) " PASSED test -- FSUNLinSolSolve" + write (*, *) " PASSED test -- FSUNLinSolSolve" end if call FN_VDestroy(y) diff --git a/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 index 3fc4bff7a4..f7c7e00bca 100644 --- a/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 +++ b/examples/sunmatrix/band/test_fsunmatrix_band_mod.f90 @@ -20,20 +20,17 @@ module test_fsunmatrix_band use test_utilities implicit none - - - integer(kind=myindextype), parameter :: N = 10 + integer(kind=myindextype), parameter :: N = 10 integer(kind=myindextype), parameter :: mu = 2 integer(kind=myindextype), parameter :: ml = 2 contains - integer(C_INT) function smoke_tests() result(fails) + integer(c_int) function smoke_tests() result(fails) !======== Inclusions ========== use, intrinsic :: iso_c_binding - use fsunmatrix_band_mod use fnvector_serial_mod @@ -42,11 +39,11 @@ integer(C_INT) function smoke_tests() result(fails) ! local variables type(SUNMatrix), pointer :: A, B ! SUNMatrix - type(N_Vector), pointer :: x, y ! NVectors - real(C_DOUBLE), pointer :: matdat(:) ! matrix data pointer - integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size - integer(C_LONG) :: val - type(C_PTR), pointer :: cptr + type(N_Vector), pointer :: x, y ! NVectors + real(c_double), pointer :: matdat(:) ! matrix data pointer + integer(c_long) :: lenrw(1), leniw(1) ! matrix real and int work space size + integer(c_long) :: val + type(c_ptr), pointer :: cptr fails = 0 x => FN_VNew_Serial(N, sunctx) @@ -57,7 +54,7 @@ integer(C_INT) function smoke_tests() result(fails) ! constructor A => FSUNBandMatrix(N, mu, ml, sunctx) if (.not. associated(A)) then - print *,'>>> FAILED - ERROR in FSUNBandMatrix; halting' + print *, '>>> FAILED - ERROR in FSUNBandMatrix; halting' fails = 1 return end if @@ -71,18 +68,18 @@ integer(C_INT) function smoke_tests() result(fails) val = FSUNBandMatrix_StoredUpperBandwidth(A) val = FSUNBandMatrix_LDim(A) matdat => FSUNBandMatrix_Data(A) - cptr => FSUNBandMatrix_Cols(A) + cptr => FSUNBandMatrix_Cols(A) matdat => FSUNBandMatrix_Column(A, N) ! matrix operations B => FSUNMatClone_Band(A) if (.not. associated(B)) then - print *,'>>> FAILED - ERROR in FSUNMatClone_Band; halting' + print *, '>>> FAILED - ERROR in FSUNMatClone_Band; halting' fails = 1 return end if fails = fails + FSUNMatZero_Band(A) - fails = fails + FSUNMatCopy_Band(A,B) + fails = fails + FSUNMatCopy_Band(A, B) fails = fails + FSUNMatScaleAdd_Band(ONE, A, B) fails = fails + FSUNMatScaleAddI_Band(ONE, A) fails = fails + FSUNMatMatvec_Band(A, x, y) @@ -96,10 +93,9 @@ integer(C_INT) function smoke_tests() result(fails) end function smoke_tests - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - use fnvector_serial_mod use fsunmatrix_band_mod @@ -108,8 +104,8 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNMatrix), pointer :: A, I - type(N_Vector), pointer :: x, y - real(C_DOUBLE), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) + type(N_Vector), pointer :: x, y + real(c_double), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) integer(kind=myindextype) :: ii, jj, smu, istart, iend, offset fails = 0 @@ -126,14 +122,14 @@ integer(C_INT) function unit_tests() result(fails) end do ! Fill A matrix - smu = FSUNBandMatrix_StoredUpperBandwidth(A) + smu = FSUNBandMatrix_StoredUpperBandwidth(A) Adata => FSUNBandMatrix_Data(A) do jj = 1, N - offset = (jj-1)*(smu+ml+1) + smu + 1 ! offset to diagonal - istart = merge(-mu, -(jj-1), jj > mu) ! above diagonal - iend = merge(N-jj , ml, jj > N - ml) ! below diagonal + offset = (jj - 1)*(smu + ml + 1) + smu + 1 ! offset to diagonal + istart = merge(-mu, -(jj - 1), jj > mu) ! above diagonal + iend = merge(N - jj, ml, jj > N - ml) ! below diagonal do ii = istart, iend - Adata(offset+ii) = (jj-1) - ii + Adata(offset + ii) = (jj - 1) - ii end do end do @@ -141,15 +137,15 @@ integer(C_INT) function unit_tests() result(fails) ydata => FN_VGetArrayPointer(y) ! Fill vectors - do jj = 0, N-1 + do jj = 0, N - 1 ! x vector - xdata(jj+1) = jj + xdata(jj + 1) = jj ! y vector - ydata(jj+1) = ZERO - istart = max(0_myindextype, jj-ml) - iend = min(N-1, jj+mu) + ydata(jj + 1) = ZERO + istart = max(0_myindextype, jj - ml) + iend = min(N - 1, jj + mu) do ii = istart, iend - ydata(jj+1) = ydata(jj+1) + (ii+ii-jj)*(ii) + ydata(jj + 1) = ydata(jj + 1) + (ii + ii - jj)*(ii) end do end do @@ -179,7 +175,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'Band SUNMatrix Fortran 2003 interface test' @@ -199,7 +195,7 @@ program main end program main ! exported functions used by test_sunmatrix -integer(C_INT) function check_matrix(B, A, tol) result(fails) +integer(c_int) function check_matrix(B, A, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_band_mod @@ -208,16 +204,16 @@ integer(C_INT) function check_matrix(B, A, tol) result(fails) implicit none type(SUNMatrix) :: A, B - real(C_DOUBLE) :: tol - real(C_DOUBLE), pointer :: Adata(:), Bdata(:) - integer(C_LONG) :: N, smu, mu, ml, ii, istart, iend, jj, offset + real(c_double) :: tol + real(c_double), pointer :: Adata(:), Bdata(:) + integer(c_long) :: N, smu, mu, ml, ii, istart, iend, jj, offset fails = 0 - N = FSUNBandMatrix_Columns(A) + N = FSUNBandMatrix_Columns(A) smu = FSUNBandMatrix_StoredUpperBandwidth(A) - mu = FSUNBandMatrix_UpperBandwidth(A) - ml = FSUNBandMatrix_LowerBandwidth(A) + mu = FSUNBandMatrix_UpperBandwidth(A) + ml = FSUNBandMatrix_LowerBandwidth(A) if (FSUNMatGetID(A) /= FSUNMatGetID(B)) then fails = 1 @@ -252,17 +248,17 @@ integer(C_INT) function check_matrix(B, A, tol) result(fails) Adata => FSUNBandMatrix_Data(A) Bdata => FSUNBandMatrix_Data(B) do jj = 1, N - offset = (jj-1)*(smu+ml+1) + smu + 1 ! offset to diagonal - istart = merge(-mu, -(jj-1), jj > mu) ! above diagonal - iend = merge(N-jj , ml, jj > N - ml) ! below diagonal + offset = (jj - 1)*(smu + ml + 1) + smu + 1 ! offset to diagonal + istart = merge(-mu, -(jj - 1), jj > mu) ! above diagonal + iend = merge(N - jj, ml, jj > N - ml) ! below diagonal do ii = istart, iend - fails = fails + FNEQTOL(Adata(offset+ii), Bdata(offset+ii), tol) + fails = fails + FNEQTOL(Adata(offset + ii), Bdata(offset + ii), tol) end do end do end function check_matrix -integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) +integer(c_int) function check_matrix_entry(A, c, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_band_mod @@ -271,27 +267,27 @@ integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) implicit none type(SUNMatrix) :: A - real(C_DOUBLE) :: c, tol - real(C_DOUBLE), pointer :: Adata(:) - integer(C_LONG) :: N, smu, mu, ml, ii, istart, iend, jj, offset + real(c_double) :: c, tol + real(c_double), pointer :: Adata(:) + integer(c_long) :: N, smu, mu, ml, ii, istart, iend, jj, offset fails = 0 - N = FSUNBandMatrix_Columns(A) + N = FSUNBandMatrix_Columns(A) smu = FSUNBandMatrix_StoredUpperBandwidth(A) - mu = FSUNBandMatrix_UpperBandwidth(A) - ml = FSUNBandMatrix_LowerBandwidth(A) + mu = FSUNBandMatrix_UpperBandwidth(A) + ml = FSUNBandMatrix_LowerBandwidth(A) Adata => FSUNBandMatrix_Data(A) do jj = 1, N - offset = (jj-1)*(smu+ml+1) + smu + 1 ! offset to diagonal - istart = merge(-mu, -(jj-1), jj > mu) ! above diagonal - iend = merge(N-jj , ml, jj > N - ml) ! below diagonal + offset = (jj - 1)*(smu + ml + 1) + smu + 1 ! offset to diagonal + istart = merge(-mu, -(jj - 1), jj > mu) ! above diagonal + iend = merge(N - jj, ml, jj > N - ml) ! below diagonal do ii = istart, iend - if (FNEQTOL(Adata(offset+ii), c, tol) /= 0) then + if (FNEQTOL(Adata(offset + ii), c, tol) /= 0) then fails = fails + 1 - write(*,'(A,E10.1,A,E14.7,A,I9,A,E14.7)') "tol = ", tol, & - " c = ", c, " data[", offset+ii, "] = ", Adata(offset+ii) + write (*, '(A,E10.1,A,E14.7,A,I9,A,E14.7)') "tol = ", tol, & + " c = ", c, " data[", offset + ii, "] = ", Adata(offset + ii) end if end do end do diff --git a/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 index 87cac2dff5..2a8a39ebbb 100644 --- a/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 +++ b/examples/sunmatrix/dense/test_fsunmatrix_dense_mod.f90 @@ -24,12 +24,11 @@ module test_fsunmatrix_dense contains - integer(C_INT) function smoke_tests() result(fails) + integer(c_int) function smoke_tests() result(fails) !======== Inclusions ========== use, intrinsic :: iso_c_binding - use fsunmatrix_dense_mod use fnvector_serial_mod @@ -38,10 +37,10 @@ integer(C_INT) function smoke_tests() result(fails) ! local variables type(SUNMatrix), pointer :: A, B ! SUNMatrix - type(N_Vector), pointer :: x, y ! NVectors - real(C_DOUBLE), pointer :: matdat(:) ! matrix data pointer - integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size - integer(C_LONG) :: val + type(N_Vector), pointer :: x, y ! NVectors + real(c_double), pointer :: matdat(:) ! matrix data pointer + integer(c_long) :: lenrw(1), leniw(1) ! matrix real and int work space size + integer(c_long) :: val fails = 0 @@ -53,7 +52,7 @@ integer(C_INT) function smoke_tests() result(fails) ! constructor A => FSUNDenseMatrix(N, N, sunctx) if (.not. associated(A)) then - print *,'>>> FAILED - ERROR in FSUNDenseMatrix; halting' + print *, '>>> FAILED - ERROR in FSUNDenseMatrix; halting' stop 1 end if @@ -63,16 +62,16 @@ integer(C_INT) function smoke_tests() result(fails) val = FSUNDenseMatrix_Columns(A) val = FSUNDenseMatrix_LData(A) matdat => FSUNDenseMatrix_Data(A) - matdat => FSUNDenseMatrix_Column(A,N) + matdat => FSUNDenseMatrix_Column(A, N) ! matrix operations B => FSUNMatClone_Dense(A) if (.not. associated(B)) then - print *,'>>> FAILED - ERROR in FSUNMatClone_Dense; halting' + print *, '>>> FAILED - ERROR in FSUNMatClone_Dense; halting' stop 1 end if fails = fails + FSUNMatZero_Dense(A) - fails = fails + FSUNMatCopy_Dense(A,B) + fails = fails + FSUNMatCopy_Dense(A, B) fails = fails + FSUNMatScaleAdd_Dense(ONE, A, B) fails = fails + FSUNMatScaleAddI_Dense(ONE, A) fails = fails + FSUNMatMatvec_Dense(A, x, y) @@ -86,10 +85,9 @@ integer(C_INT) function smoke_tests() result(fails) end function smoke_tests - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - use fnvector_serial_mod use fsunmatrix_dense_mod use test_sunmatrix @@ -97,9 +95,9 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNMatrix), pointer :: A, I - type(N_Vector), pointer :: x, y - real(C_DOUBLE), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) - integer(C_LONG) :: ii, jj, tmp1, tmp2 + type(N_Vector), pointer :: x, y + real(c_double), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) + integer(c_long) :: ii, jj, tmp1, tmp2 fails = 0 @@ -110,30 +108,30 @@ integer(C_INT) function unit_tests() result(fails) ! fill matrix A Adata => FSUNDenseMatrix_Data(A) - do jj=1, N - do ii=1, N - Adata((jj-1)*N + ii) = jj*(ii+jj-2) + do jj = 1, N + do ii = 1, N + Adata((jj - 1)*N + ii) = jj*(ii + jj - 2) end do end do ! fill matrix I (identity) Idata => FSUNDenseMatrix_Data(I) - do jj=1, N - Idata((jj-1)*N + jj) = ONE + do jj = 1, N + Idata((jj - 1)*N + jj) = ONE end do ! fill vector x xdata => FN_VGetArrayPointer(x) - do ii=1, N - xdata(ii) = ONE / ii + do ii = 1, N + xdata(ii) = ONE/ii end do ! fill vector y ydata => FN_VGetArrayPointer(y) - do ii=1, N - tmp1 = ii-1 + do ii = 1, N + tmp1 = ii - 1 tmp2 = tmp1 + N - 1 - ydata(ii) = HALF*(tmp2+1-tmp1)*(tmp1+tmp2) + ydata(ii) = HALF*(tmp2 + 1 - tmp1)*(tmp1 + tmp2) end do fails = fails + Test_FSUNMatGetID(A, SUNMATRIX_DENSE, 0) @@ -162,7 +160,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'Dense SUNMatrix Fortran 2003 interface test' @@ -182,7 +180,7 @@ program main end program main ! exported functions used by test_sunmatrix -integer(C_INT) function check_matrix(A, B, tol) result(fails) +integer(c_int) function check_matrix(A, B, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod @@ -190,11 +188,9 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) implicit none - - type(SUNMatrix) :: A, B - real(C_DOUBLE) :: tol - real(C_DOUBLE), pointer :: Adata(:), Bdata(:) + real(c_double) :: tol + real(c_double), pointer :: Adata(:), Bdata(:) integer(kind=myindextype) :: Aldata, Bldata, i fails = 0 @@ -214,13 +210,13 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) end if ! compare data - do i=1, Aldata + do i = 1, Aldata fails = fails + FNEQTOL(Adata(i), Bdata(i), tol) end do end function check_matrix -integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) +integer(c_int) function check_matrix_entry(A, c, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_dense_mod @@ -229,9 +225,9 @@ integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) implicit none type(SUNMatrix) :: A - real(C_DOUBLE) :: c, tol - real(C_DOUBLE), pointer :: Adata(:) - integer(C_LONG) :: Aldata, i + real(c_double) :: c, tol + real(c_double), pointer :: Adata(:) + integer(c_long) :: Aldata, i fails = 0 @@ -242,16 +238,16 @@ integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) Aldata = FSUNDenseMatrix_LData(A) ! compare data - do i=1, Aldata + do i = 1, Aldata fails = fails + FNEQTOL(Adata(i), c, tol) end do if (fails > ZERO) then print *, ">>> ERROR: check_matrix_entry failures: " - do i=1, Aldata + do i = 1, Aldata if (FNEQTOL(Adata(i), c, tol) /= 0) then - write(*,'(A,I0,A,E14.7,A,E14.7)') & - "Adata[ ", i, "] =", Adata(i) ," c = ", c + write (*, '(A,I0,A,E14.7,A,E14.7)') & + "Adata[ ", i, "] =", Adata(i), " c = ", c end if end do end if diff --git a/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 index 3283cd637e..03bcff5896 100644 --- a/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 +++ b/examples/sunmatrix/sparse/test_fsunmatrix_sparse_mod.f90 @@ -24,12 +24,11 @@ module test_fsunmatrix_sparse contains - integer(C_INT) function smoke_tests() result(fails) + integer(c_int) function smoke_tests() result(fails) !======== Inclusions ========== use, intrinsic :: iso_c_binding - use fsunmatrix_sparse_mod use fnvector_serial_mod @@ -38,13 +37,13 @@ integer(C_INT) function smoke_tests() result(fails) ! local variables type(SUNMatrix), pointer :: A, B ! SUNMatrix - type(N_Vector), pointer :: x, y ! NVectors - real(C_DOUBLE), pointer :: matdat(:) ! matrix data pointer + type(N_Vector), pointer :: x, y ! NVectors + real(c_double), pointer :: matdat(:) ! matrix data pointer integer(kind=myindextype), pointer :: inddat(:) ! indices pointer - integer(C_LONG) :: lenrw(1), leniw(1) ! matrix real and int work space size + integer(c_long) :: lenrw(1), leniw(1) ! matrix real and int work space size integer(kind=myindextype) :: tmp1 - integer(C_INT) :: tmp2 + integer(c_int) :: tmp2 fails = 0 @@ -56,7 +55,7 @@ integer(C_INT) function smoke_tests() result(fails) ! constructor A => FSUNSparseMatrix(N, N, N*N, CSR_MAT, sunctx) if (.not. associated(A)) then - print *,'>>> FAILED - ERROR in FSUNSparseMatrix; halting' + print *, '>>> FAILED - ERROR in FSUNSparseMatrix; halting' stop 1 end if @@ -74,7 +73,7 @@ integer(C_INT) function smoke_tests() result(fails) ! matrix operations B => FSUNMatClone_Sparse(A) if (.not. associated(B)) then - print *,'>>> FAILED - ERROR in FSUNMatClone_Sparse; halting' + print *, '>>> FAILED - ERROR in FSUNMatClone_Sparse; halting' stop 1 end if fails = fails + FSUNMatZero_Sparse(A) @@ -92,10 +91,9 @@ integer(C_INT) function smoke_tests() result(fails) end function smoke_tests - integer(C_INT) function unit_tests() result(fails) + integer(c_int) function unit_tests() result(fails) use, intrinsic :: iso_c_binding - use fnvector_serial_mod use fsunmatrix_dense_mod use fsunmatrix_sparse_mod @@ -104,9 +102,9 @@ integer(C_INT) function unit_tests() result(fails) implicit none type(SUNMatrix), pointer :: DA, DI, A, I - type(N_Vector), pointer :: x, y - real(C_DOUBLE), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) - integer(C_LONG) :: ii, jj, tmp1, tmp2 + type(N_Vector), pointer :: x, y + real(c_double), pointer :: Adata(:), Idata(:), xdata(:), ydata(:) + integer(c_long) :: ii, jj, tmp1, tmp2 fails = 0 @@ -116,16 +114,16 @@ integer(C_INT) function unit_tests() result(fails) ! fill A matrix Adata => FSUNDenseMatrix_Data(DA) - do jj=1, N - do ii=1, N - Adata((jj-1)*N + ii) = jj*(ii+jj-2) + do jj = 1, N + do ii = 1, N + Adata((jj - 1)*N + ii) = jj*(ii + jj - 2) end do end do ! fill identity matrix Idata => FSUNDenseMatrix_Data(DI) - do jj=1, N - Idata((jj-1)*N + jj) = ONE + do jj = 1, N + Idata((jj - 1)*N + jj) = ONE end do ! create sparse versions of A and I @@ -138,16 +136,16 @@ integer(C_INT) function unit_tests() result(fails) ! fill vector x xdata => FN_VGetArrayPointer(x) - do ii=1, N - xdata(ii) = ONE / ii + do ii = 1, N + xdata(ii) = ONE/ii end do ! fill vector y ydata => FN_VGetArrayPointer(y) - do ii=1, N - tmp1 = ii-1 + do ii = 1, N + tmp1 = ii - 1 tmp2 = tmp1 + N - 1 - ydata(ii) = HALF*(tmp2+1-tmp1)*(tmp1+tmp2) + ydata(ii) = HALF*(tmp2 + 1 - tmp1)*(tmp1 + tmp2) end do fails = fails + Test_FSUNMatGetID(A, SUNMATRIX_SPARSE, 0) @@ -178,7 +176,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= print *, 'Sparse SUNMatrix Fortran 2003 interface test' @@ -198,7 +196,7 @@ program main end program main ! exported functions used by test_sunmatrix -integer(C_INT) function check_matrix(A, B, tol) result(fails) +integer(c_int) function check_matrix(A, B, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_sparse_mod @@ -206,18 +204,17 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) implicit none - type(SUNMatrix) :: A, B - real(C_DOUBLE) :: tol - real(C_DOUBLE), pointer :: Adata(:), Bdata(:) + real(c_double) :: tol + real(c_double), pointer :: Adata(:), Bdata(:) integer(kind=myindextype), pointer :: Aidxvals(:), Bidxvals(:) integer(kind=myindextype), pointer :: Aidxptrs(:), Bidxptrs(:) integer(kind=myindextype) :: i, np, Annz, Bnnz fails = 0 - Adata => FSUNSparseMatrix_Data(A) - Bdata => FSUNSparseMatrix_Data(B) + Adata => FSUNSparseMatrix_Data(A) + Bdata => FSUNSparseMatrix_Data(B) Aidxvals => FSUNSparseMatrix_IndexValues(A) Bidxvals => FSUNSparseMatrix_IndexValues(B) Aidxptrs => FSUNSparseMatrix_IndexPointers(A) @@ -225,7 +222,7 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) Annz = FSUNSparseMatrix_NNZ(A) Bnnz = FSUNSparseMatrix_NNZ(B) - np = FSUNSparseMatrix_NP(A) + np = FSUNSparseMatrix_NP(A) if (FSUNMatGetID(A) /= FSUNMatGetID(B)) then fails = 1 @@ -282,10 +279,9 @@ integer(C_INT) function check_matrix(A, B, tol) result(fails) return end if - end function check_matrix -integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) +integer(c_int) function check_matrix_entry(A, c, tol) result(fails) use, intrinsic :: iso_c_binding use fsunmatrix_sparse_mod @@ -294,28 +290,27 @@ integer(C_INT) function check_matrix_entry(A, c, tol) result(fails) implicit none type(SUNMatrix) :: A - real(C_DOUBLE) :: c, tol - real(C_DOUBLE), pointer :: Adata(:) + real(c_double) :: c, tol + real(c_double), pointer :: Adata(:) integer(kind=myindextype), pointer :: Aidxptrs(:) integer(kind=myindextype) :: i, np fails = 0 - Adata => FSUNSparseMatrix_Data(A) + Adata => FSUNSparseMatrix_Data(A) Aidxptrs => FSUNSparseMatrix_IndexPointers(A) np = FSUNSparseMatrix_NP(A) ! compare data - do i=1, Aidxptrs(np) + do i = 1, Aidxptrs(np) if (FNEQTOL(Adata(i), c, tol) /= 0) then fails = fails + 1 - write(*,'(A,I0,A,E14.7,A,E14.7)') & + write (*, '(A,I0,A,E14.7,A,E14.7)') & 'Adata(', i, ') = ', Adata(i), ' c = ', c end if end do - end function check_matrix_entry logical function is_square(A) result(res) diff --git a/examples/sunmatrix/test_sunmatrix.f90 b/examples/sunmatrix/test_sunmatrix.f90 index 1f1cc3319b..30c1f5f2ca 100644 --- a/examples/sunmatrix/test_sunmatrix.f90 +++ b/examples/sunmatrix/test_sunmatrix.f90 @@ -23,17 +23,14 @@ module test_sunmatrix use, intrinsic :: iso_c_binding use test_utilities - - - implicit none logical, parameter :: print_all_ranks = .false. ! functions implemented in specific matrix tests - integer(C_INT), external :: check_matrix - integer(C_INT), external :: check_matrix_entry - logical, external :: is_square + integer(c_int), external :: check_matrix + integer(c_int), external :: check_matrix_entry + logical, external :: is_square contains @@ -43,12 +40,12 @@ subroutine TEST_STATUS(frmt, myrank) implicit none character(LEN=*) :: frmt - integer(C_INT) :: myrank + integer(c_int) :: myrank if (print_all_ranks) then - write(*,'(A,I0,A,A)') 'process ', myrank, ': ', frmt + write (*, '(A,I0,A,A)') 'process ', myrank, ': ', frmt else - write(*,*) frmt + write (*, *) frmt end if end subroutine TEST_STATUS @@ -59,26 +56,26 @@ subroutine TEST_STATUS2(frmt, retval, myrank) implicit none character(LEN=*) :: frmt - integer(C_INT) :: myrank - integer(C_INT) :: retval + integer(c_int) :: myrank + integer(c_int) :: retval if (print_all_ranks) then - write(*,'(A,I0,A,A,I0)') 'process ', myrank, ': ', frmt, retval + write (*, '(A,I0,A,A,I0)') 'process ', myrank, ': ', frmt, retval else - write(*,'(A,I0)') frmt, retval + write (*, '(A,I0)') frmt, retval end if end subroutine TEST_STATUS2 - integer(C_INT) function check_vector(x, y, tol) result(failure) + integer(c_int) function check_vector(x, y, tol) result(failure) use, intrinsic :: iso_c_binding implicit none type(N_Vector) :: x, y - real(C_DOUBLE) :: tol - integer(C_LONG) :: i, xlen, ylen - real(C_DOUBLE), pointer :: xdata(:), ydata(:) + real(c_double) :: tol + integer(c_long) :: i, xlen, ylen + real(c_double), pointer :: xdata(:), ydata(:) failure = 0 @@ -100,16 +97,15 @@ integer(C_INT) function check_vector(x, y, tol) result(failure) end function check_vector - integer(C_INT) function Test_FSUNMatGetID(A, sunid, myid) result(failure) + integer(c_int) function Test_FSUNMatGetID(A, sunid, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none type(SUNMatrix) :: A integer(SUNMatrix_ID) :: sunid, mysunid - integer(C_INT) :: myid + integer(c_int) :: myid failure = 0 @@ -128,16 +124,15 @@ end function Test_FSUNMatGetID ! SUNMatClone Test ! NOTE: This routine depends on SUNMatCopy to check matrix data. ! -------------------------------------------------------------------- - integer(C_INT) function Test_FSUNMatClone(A, myid) result(failure) + integer(c_int) function Test_FSUNMatClone(A, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid + integer(c_int) :: myid type(SUNMatrix) :: A - real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF + real(c_double) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix), pointer :: B failure = 0 @@ -172,15 +167,14 @@ integer(C_INT) function Test_FSUNMatClone(A, myid) result(failure) end function Test_FSUNMatClone - integer(C_INT) function Test_FSUNMatZero(A, myid) result(failure) + integer(c_int) function Test_FSUNMatZero(A, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF + integer(c_int) :: myid + real(c_double) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A type(SUNMatrix), pointer :: B @@ -197,7 +191,7 @@ integer(C_INT) function Test_FSUNMatZero(A, myid) result(failure) end if ! A data should be a vector of zeros - failure = check_matrix_entry(B, ZERO, tol); + failure = check_matrix_entry(B, ZERO, tol); if (failure /= 0) then call TEST_STATUS(">>> FAILED test -- SUNMatZero check ", myid) call FSUNMatDestroy(B) @@ -210,15 +204,14 @@ integer(C_INT) function Test_FSUNMatZero(A, myid) result(failure) end function Test_FSUNMatZero - integer(C_INT) function Test_FSUNMatCopy(A, myid) result(failure) + integer(c_int) function Test_FSUNMatCopy(A, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF + integer(c_int) :: myid + real(c_double) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A type(SUNMatrix), pointer :: B @@ -249,15 +242,14 @@ integer(C_INT) function Test_FSUNMatCopy(A, myid) result(failure) end function Test_FSUNMatCopy - integer(C_INT) function Test_FSUNMatScaleAdd(A, I, myid) result(failure) + integer(c_int) function Test_FSUNMatScaleAdd(A, I, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF + integer(c_int) :: myid + real(c_double) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A, I type(SUNMatrix), pointer :: B @@ -298,15 +290,14 @@ integer(C_INT) function Test_FSUNMatScaleAdd(A, I, myid) result(failure) end function Test_FSUNMatScaleAdd - integer(C_INT) function Test_FSUNMatScaleAddI(A, I, myid) result(failure) + integer(c_int) function Test_FSUNMatScaleAddI(A, I, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 10*SUN_UNIT_ROUNDOFF + integer(c_int) :: myid + real(c_double) :: tol = 10*SUN_UNIT_ROUNDOFF type(SUNMatrix) :: A, I type(SUNMatrix), pointer :: B @@ -343,14 +334,13 @@ integer(C_INT) function Test_FSUNMatScaleAddI(A, I, myid) result(failure) end function Test_FSUNMatScaleAddI - integer(C_INT) function Test_FSUNMatMatvecSetup(A, myid) result(failure) + integer(c_int) function Test_FSUNMatMatvecSetup(A, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid + integer(c_int) :: myid type(SUNMatrix) :: A type(SUNMatrix_Ops), pointer :: ops @@ -373,20 +363,18 @@ integer(C_INT) function Test_FSUNMatMatvecSetup(A, myid) result(failure) end function Test_FSUNMatMatvecSetup - integer(C_INT) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) + integer(c_int) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - - implicit none type(SUNMatrix) :: A type(SUNMatrix), pointer :: B type(N_Vector) :: x, y - type(N_Vector), pointer :: z, w - integer(C_INT) :: myid - real(C_DOUBLE) :: tol = 100*SUN_UNIT_ROUNDOFF + type(N_Vector), pointer :: z, w + integer(c_int) :: myid + real(c_double) :: tol = 100*SUN_UNIT_ROUNDOFF type(SUNMatrix_Ops), pointer :: ops failure = 0 @@ -425,16 +413,16 @@ integer(C_INT) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) end if end if - failure = FSUNMatMatvec(B,x,z) + failure = FSUNMatMatvec(B, x, z) if (failure /= 0) then call TEST_STATUS2(">>> FAILED test -- SUNMatMatvec returned ", failure, myid) call FSUNMatDestroy(B) return end if - call FN_VLinearSum(THREE,y,ONE,x,w) + call FN_VLinearSum(THREE, y, ONE, x, w) - failure = check_vector(w,z,tol) + failure = check_vector(w, z, tol) call FSUNMatDestroy(B) call FN_VDestroy(z) @@ -444,13 +432,13 @@ integer(C_INT) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) z => FN_VClone(y) - failure = FSUNMatMatvec(A,x,z) + failure = FSUNMatMatvec(A, x, z) if (failure /= 0) then call TEST_STATUS2(">>> FAILED test -- SUNMatMatvec returned ", failure, myid) return end if - failure = check_vector(y,z,tol) + failure = check_vector(y, z, tol) call FN_VDestroy(z) end if @@ -464,20 +452,19 @@ integer(C_INT) function Test_FSUNMatMatvec(A, x, y, myid) result(failure) end function Test_FSUNMatMatvec - integer(C_INT) function Test_FSUNMatSpace(A, myid) result(failure) + integer(c_int) function Test_FSUNMatSpace(A, myid) result(failure) use, intrinsic :: iso_c_binding use test_utilities - implicit none - integer(C_INT) :: myid + integer(c_int) :: myid type(SUNMatrix) :: A - integer(C_LONG) :: lenrw(1), leniw(1) + integer(c_long) :: lenrw(1), leniw(1) failure = 0 - failure = FSUNMatSpace(A, lenrw, leniw); + failure = FSUNMatSpace(A, lenrw, leniw); if (failure /= 0) then call TEST_STATUS(">>> FAILED test -- SUNMatSpace ", myid) return diff --git a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 index 7b6cfd2322..f732b96374 100644 --- a/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 +++ b/examples/sunnonlinsol/fixedpoint/test_fsunnonlinsol_fixedpoint_mod.f90 @@ -22,21 +22,21 @@ module test_fsunnonlinsol_fixedpoint implicit none integer(kind=myindextype), parameter :: NEQ = 3 ! number of equations - integer(C_INT), parameter :: MAXIT = 20 ! max nonlinear iters. - real(C_DOUBLE), parameter :: TOL = 1.0e-4 ! nonlinear solver tolerance + integer(c_int), parameter :: MAXIT = 20 ! max nonlinear iters. + real(c_double), parameter :: TOL = 1.0e-4 ! nonlinear solver tolerance - real(C_DOUBLE), parameter :: PI = 3.1415926535898 + real(c_double), parameter :: PI = 3.1415926535898 ! approximate solution - real(C_DOUBLE) :: XTRUE = 0.5d0 - real(C_DOUBLE) :: YTRUE = 1.0d0 - real(C_DOUBLE) :: ZTRUE = -PI/6.0d0 + real(c_double) :: XTRUE = 0.5d0 + real(c_double) :: YTRUE = 1.0d0 + real(c_double) :: ZTRUE = -PI/6.0d0 type(N_Vector), pointer :: y0 contains - integer(C_INT) function unit_tests() result(retval) + integer(c_int) function unit_tests() result(retval) use, intrinsic :: iso_c_binding use fsundials_core_mod use fnvector_serial_mod @@ -45,10 +45,10 @@ integer(C_INT) function unit_tests() result(retval) implicit none type(SUNNonlinearSolver), pointer :: NLS ! test nonlinear solver - type(N_Vector), pointer :: ycur, ycor, w ! test vectors - real(C_DOUBLE), pointer :: data(:) - integer(C_LONG) :: niters(1) - integer(C_INT) :: tmp + type(N_Vector), pointer :: ycur, ycor, w ! test vectors + real(c_double), pointer :: data(:) + integer(c_long) :: niters(1) + integer(c_int) :: tmp y0 => FN_VNew_Serial(NEQ, sunctx) ycor => FN_VClone(y0) @@ -56,7 +56,7 @@ integer(C_INT) function unit_tests() result(retval) w => FN_VClone(y0) ! set initial guess - data => FN_VGetArrayPointer(y0) + data => FN_VGetArrayPointer(y0) data(1) = 0.1d0 data(2) = 0.1d0 data(3) = -0.1d0 @@ -72,44 +72,43 @@ integer(C_INT) function unit_tests() result(retval) retval = FSUNNonlinSolSetSysFn(NLS, c_funloc(FPFunction)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetSysFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetSysFn returned ', retval return end if retval = FSUNNonlinSolSetConvTestFn(NLS, c_funloc(ConvTest), c_null_ptr) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetConvTestFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetConvTestFn returned ', retval return end if retval = FSUNNonlinSolSetMaxIters(NLS, MAXIT) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetMaxIters returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetMaxIters returned ', retval return end if retval = FSUNNonlinSolSolve(NLS, y0, ycor, w, TOL, 1, c_loc(y0)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSolve returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSolve returned ', retval return end if ! update the initial guess with the final correction - call FN_VLinearSum(1.0d0, y0, 1.0d0, ycor, ycur); - + call FN_VLinearSum(1.0d0, y0, 1.0d0, ycor, ycur); ! print number of iterations retval = FSUNNonlinSolGetNumIters(NLS, niters) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval return end if - write(*,'(A,I0)') 'Number of nonlinear iterations: ', niters(1) + write (*, '(A,I0)') 'Number of nonlinear iterations: ', niters(1) ! check answer retval = check_ans(ycur, TOL) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: check_ans failed' + write (*, '(A,I0)') ' >>> FAIL: check_ans failed' return end if @@ -122,7 +121,7 @@ integer(C_INT) function unit_tests() result(retval) end function unit_tests - integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & + integer(c_int) function ConvTest(NLS, y, del, tol, ewt, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding @@ -130,9 +129,9 @@ integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & type(SUNNonlinearSolver) :: NLS type(N_Vector) :: y, del, ewt - real(C_DOUBLE), value :: tol - type(C_PTR), value :: mem - real(C_DOUBLE) :: delnrm + real(c_double), value :: tol + type(c_ptr), value :: mem + real(c_double) :: delnrm ! compute the norm of the correction delnrm = FN_VMaxNorm(del) @@ -165,15 +164,15 @@ integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & ! g3(x,y,z) = -1/20 exp(-x(y-1)) - (10 pi - 3) / 60 - z0 ! ! ---------------------------------------------------------------------------- - integer(C_INT) function FPFunction(ycor, f, mem) & + integer(c_int) function FPFunction(ycor, f, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding implicit none type(N_Vector) :: ycor, f - type(C_PTR), value :: mem - real(C_DOUBLE), pointer :: data(:), fdata(:) - real(C_DOUBLE) :: x, y, z + type(c_ptr), value :: mem + real(c_double), pointer :: data(:), fdata(:) + real(c_double) :: x, y, z data => FN_VGetArrayPointer(ycor) fdata => FN_VGetArrayPointer(f) @@ -182,9 +181,9 @@ integer(C_INT) function FPFunction(ycor, f, mem) & y = data(2) z = data(3) - fdata(1) = (1.0d0/3.0d0) * cos((y - 1.0d0) * z) + (1.0d0/6.0d0) - fdata(2) = (1.0d0/9.0d0) * sqrt(x*x + sin(z) + 1.06d0) + 0.9d0 - fdata(3) = -(1/20.d0) * exp(-x*(y-1.0d0)) - (10.d0 * PI - 3.0d0) / 60.0d0 + fdata(1) = (1.0d0/3.0d0)*cos((y - 1.0d0)*z) + (1.0d0/6.0d0) + fdata(2) = (1.0d0/9.0d0)*sqrt(x*x + sin(z) + 1.06d0) + 0.9d0 + fdata(3) = -(1/20.d0)*exp(-x*(y - 1.0d0)) - (10.d0*PI - 3.0d0)/60.0d0 call FN_VLinearSum(1.0d0, f, -1.0d0, y0, f) @@ -192,36 +191,36 @@ integer(C_INT) function FPFunction(ycor, f, mem) & end function - integer(C_INT) function check_ans(ycor, tol) & + integer(c_int) function check_ans(ycor, tol) & result(retval) bind(C) use, intrinsic :: iso_c_binding implicit none type(N_Vector) :: ycor - real(C_DOUBLE), value :: tol - real(C_DOUBLE) :: ex, ey, ez - real(C_DOUBLE), pointer :: data(:) + real(c_double), value :: tol + real(c_double) :: ex, ey, ez + real(c_double), pointer :: data(:) ! extract and print solution data => FN_VGetArrayPointer(ycor) - write(*,*) 'Solution:' - write(*,'(A,E14.7)') ' x = ', data(1) - write(*,'(A,E14.7)') ' y = ', data(2) - write(*,'(A,E14.7)') ' z = ', data(3) + write (*, *) 'Solution:' + write (*, '(A,E14.7)') ' x = ', data(1) + write (*, '(A,E14.7)') ' y = ', data(2) + write (*, '(A,E14.7)') ' z = ', data(3) ex = data(1) - XTRUE ey = data(2) - YTRUE ez = data(3) - ZTRUE - write(*,*) 'Solution Error:' - write(*,'(A,E14.7)') ' ex = ', ex - write(*,'(A,E14.7)') ' ey = ', ey - write(*,'(A,E14.7)') ' ez = ', ez + write (*, *) 'Solution Error:' + write (*, '(A,E14.7)') ' ex = ', ex + write (*, '(A,E14.7)') ' ey = ', ey + write (*, '(A,E14.7)') ' ez = ', ez - tol = tol * 10.0d0 + tol = tol*10.0d0 if (ex > tol .or. ey > tol .or. ez > tol) then - retval = 1 + retval = 1 end if retval = 0 @@ -238,10 +237,10 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: fails = 0 + integer(c_int) :: fails = 0 !============== Introduction ============= - write(*,*) 'SUNNonlinearSolver_FixedPoint Fortran 2003 interface test' + write (*, *) 'SUNNonlinearSolver_FixedPoint Fortran 2003 interface test' call Test_Init(SUN_COMM_NULL) @@ -250,7 +249,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 index 9308fa902f..9c85724f72 100644 --- a/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 +++ b/examples/sunnonlinsol/newton/test_fsunnonlinsol_newton_mod.f90 @@ -22,13 +22,13 @@ module test_fsunnonlinsol_newton implicit none integer(kind=myindextype), parameter :: NEQ = 3 ! number of equations - integer(C_INT), parameter :: MAXIT = 10 ! max nonlinear iters. - real(C_DOUBLE), parameter :: TOL = 1.0e-2 ! nonlinear solver tolerance + integer(c_int), parameter :: MAXIT = 10 ! max nonlinear iters. + real(c_double), parameter :: TOL = 1.0e-2 ! nonlinear solver tolerance ! approximate solution - real(C_DOUBLE) :: Y1 = 0.785196933062355226 - real(C_DOUBLE) :: Y2 = 0.496611392944656396 - real(C_DOUBLE) :: Y3 = 0.369922830745872357 + real(c_double) :: Y1 = 0.785196933062355226 + real(c_double) :: Y2 = 0.496611392944656396 + real(c_double) :: Y3 = 0.369922830745872357 type, private :: IntegratorMem type(N_Vector), pointer :: y0 @@ -42,7 +42,7 @@ module test_fsunnonlinsol_newton contains - integer(C_INT) function unit_tests() result(retval) + integer(c_int) function unit_tests() result(retval) use, intrinsic :: iso_c_binding use fsundials_core_mod use fnvector_serial_mod @@ -53,22 +53,22 @@ integer(C_INT) function unit_tests() result(retval) implicit none type(SUNNonlinearSolver), pointer :: NLS ! test nonlinear solver - real(C_DOUBLE), pointer :: ydata(:) - integer(C_LONG) :: niters(1) - integer(C_INT) :: tmp - type(IntegratorMem), pointer :: Imem + real(c_double), pointer :: ydata(:) + integer(c_long) :: niters(1) + integer(c_int) :: tmp + type(IntegratorMem), pointer :: Imem retval = 0 ! create mock integrator memory - allocate(Imem) + allocate (Imem) ! create vectors - Imem%y0 => FN_VNew_Serial(NEQ, sunctx) + Imem%y0 => FN_VNew_Serial(NEQ, sunctx) Imem%ycur => FN_VClone(Imem%y0) Imem%ycor => FN_VClone(Imem%y0) - Imem%w => FN_VClone(Imem%y0) - Imem%x => FN_VClone(Imem%y0) + Imem%w => FN_VClone(Imem%y0) + Imem%x => FN_VClone(Imem%y0) ! set initial guess for the state call FN_VConst(HALF, Imem%y0) @@ -80,12 +80,12 @@ integer(C_INT) function unit_tests() result(retval) call FN_VConst(ONE, Imem%w) ! create matrix and linear solver - Imem%A => FSUNDenseMatrix(NEQ, NEQ, sunctx) + Imem%A => FSUNDenseMatrix(NEQ, NEQ, sunctx) Imem%LS => FSUNLinSol_Dense(Imem%y0, Imem%A, sunctx) retval = FSUNLinSolInitialize(Imem%LS) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNLinSolInitialize returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNLinSolInitialize returned ', retval return end if @@ -94,38 +94,38 @@ integer(C_INT) function unit_tests() result(retval) retval = FSUNNonlinSolSetSysFn(NLS, c_funloc(Res)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetSysFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetSysFn returned ', retval return end if retval = FSUNNonlinSolSetLSetupFn(NLS, c_funloc(LSetup)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetLSetupFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetLSetupFn returned ', retval return end if retval = FSUNNonlinSolSetLSolveFn(NLS, c_funloc(LSolve)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetLSolveFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetLSolveFn returned ', retval return end if retval = FSUNNonlinSolSetConvTestFn(NLS, c_funloc(ConvTest), c_null_ptr) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetConvTestFn returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetConvTestFn returned ', retval return end if retval = FSUNNonlinSolSetMaxIters(NLS, MAXIT) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSetMaxIters returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSetMaxIters returned ', retval return end if retval = FSUNNonlinSolSolve(NLS, Imem%y0, Imem%ycor, Imem%w, TOL, 1, & c_loc(Imem)) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolSolve returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolSolve returned ', retval return end if @@ -135,23 +135,23 @@ integer(C_INT) function unit_tests() result(retval) ! extract solution data ydata => FN_VGetArrayPointer(Imem%ycur) - write(*,*) 'Solution:' - write(*,'(A,E14.7)') 'y1 = ', ydata(1) - write(*,'(A,E14.7)') 'y2 = ', ydata(2) - write(*,'(A,E14.7)') 'y3 = ', ydata(3) + write (*, *) 'Solution:' + write (*, '(A,E14.7)') 'y1 = ', ydata(1) + write (*, '(A,E14.7)') 'y2 = ', ydata(2) + write (*, '(A,E14.7)') 'y3 = ', ydata(3) - write(*,*) 'Solution Error:' - write(*,'(A,E14.7)') 'e1 = ', ydata(1) - Y1 - write(*,'(A,E14.7)') 'e2 = ', ydata(2) - Y2 - write(*,'(A,E14.7)') 'e3 = ', ydata(3) - Y3 + write (*, *) 'Solution Error:' + write (*, '(A,E14.7)') 'e1 = ', ydata(1) - Y1 + write (*, '(A,E14.7)') 'e2 = ', ydata(2) - Y2 + write (*, '(A,E14.7)') 'e3 = ', ydata(3) - Y3 retval = FSUNNonlinSolGetNumIters(NLS, niters) if (retval /= 0) then - write(*,'(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval + write (*, '(A,I0)') ' >>> FAIL: FSUNNonlinSolGetNumIters returned ', retval return end if - write(*,'(A,I0)') 'Number of nonlinear iterations:', niters(1) + write (*, '(A,I0)') 'Number of nonlinear iterations:', niters(1) ! cleanup call FN_VDestroy(Imem%y0) @@ -162,26 +162,24 @@ integer(C_INT) function unit_tests() result(retval) call FSUNMatDestroy(Imem%A) tmp = FSUNLinSolFree(Imem%LS) tmp = FSUNNonlinSolFree(NLS) - deallocate(Imem) + deallocate (Imem) end function unit_tests - integer(C_INT) function LSetup(jbad, jcur, mem) & + integer(c_int) function LSetup(jbad, jcur, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - - implicit none type(N_Vector), pointer :: fy, tmp1, tmp2, tmp3 - integer(C_INT), value :: jbad - integer(C_INT), dimension(*) :: jcur - type(C_PTR), value :: mem + integer(c_int), value :: jbad + integer(c_int), dimension(*) :: jcur + type(c_ptr), value :: mem type(IntegratorMem), pointer :: Imem ! set unused parameters to null() - fy => null() + fy => null() tmp1 => null() tmp2 => null() tmp3 => null() @@ -190,7 +188,7 @@ integer(C_INT) function LSetup(jbad, jcur, mem) & call c_f_pointer(mem, Imem) ! compute the Jacobian - retval = Jac(0.d0, Imem%ycur, fy, Imem%A, C_NULL_PTR, tmp1, tmp2, tmp3) + retval = Jac(0.d0, Imem%ycur, fy, Imem%A, c_null_ptr, tmp1, tmp2, tmp3) if (retval /= 0) return ! update Jacobian status @@ -200,16 +198,14 @@ integer(C_INT) function LSetup(jbad, jcur, mem) & end function - integer(C_INT) function LSolve(b, mem) & + integer(c_int) function LSolve(b, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - - implicit none type(N_Vector) :: b - type(C_PTR), value :: mem + type(c_ptr), value :: mem type(IntegratorMem), pointer :: Imem ! get the Integrator memory Fortran type out @@ -220,19 +216,17 @@ integer(C_INT) function LSolve(b, mem) & end function - integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & + integer(c_int) function ConvTest(NLS, y, del, tol, ewt, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - - implicit none type(SUNNonlinearSolver) :: NLS type(N_Vector) :: y, del, ewt - real(C_DOUBLE), value :: tol - type(C_PTR), value :: mem - real(C_DOUBLE) :: delnrm + real(c_double), value :: tol + type(c_ptr), value :: mem + real(c_double) :: delnrm ! compute the norm of the correction delnrm = FN_VWrmsNorm(del, ewt) @@ -245,17 +239,16 @@ integer(C_INT) function ConvTest(NLS, y, del, tol, ewt, mem) & end function - integer(C_INT) function Res(ycor, f, mem) & + integer(c_int) function Res(ycor, f, mem) & result(retval) bind(C) use, intrinsic :: iso_c_binding - implicit none type(N_Vector) :: ycor, f - type(C_PTR), value :: mem - real(C_DOUBLE), pointer :: ydata(:), fdata(:) - real(C_DOUBLE) :: y1, y2, y3 + type(c_ptr), value :: mem + real(c_double), pointer :: ydata(:), fdata(:) + real(c_double) :: y1, y2, y3 type(IntegratorMem), pointer :: Imem ! get the Integrator memory Fortran type out @@ -272,28 +265,27 @@ integer(C_INT) function Res(ycor, f, mem) & y3 = ydata(3) fdata(1) = y1*y1 + y2*y2 + y3*y3 - 1.0d0 - fdata(2) = 2.0d0 * y1*y1 + y2*y2 - 4.0d0 * y3 - fdata(3) = 3 * y1*y1 - 4.0d0 * y2 + y3*y3 + fdata(2) = 2.0d0*y1*y1 + y2*y2 - 4.0d0*y3 + fdata(3) = 3*y1*y1 - 4.0d0*y2 + y3*y3 retval = 0 end function - integer(C_INT) function Jac(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & + integer(c_int) function Jac(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & result(retval) bind(C) use, intrinsic :: iso_c_binding - use fsunmatrix_dense_mod implicit none - real(C_DOUBLE), value :: t + real(c_double), value :: t type(N_Vector) :: y, fy, tmp1, tmp2, tmp3 type(SUNMatrix) :: J - type(C_PTR), value :: user_data - real(C_DOUBLE), pointer :: ydata(:), Jdata(:) - real(C_DOUBLE) :: y1, y2, y3 + type(c_ptr), value :: user_data + real(c_double), pointer :: ydata(:), Jdata(:) + real(c_double) :: y1, y2, y3 ydata => FN_VGetArrayPointer(y) Jdata => FSUNDenseMatrix_Data(J) @@ -303,9 +295,9 @@ integer(C_INT) function Jac(t, y, fy, J, user_data, tmp1, tmp2, tmp3) & y3 = ydata(3) ! dense matrix has column-major ordering - Jdata(1:9) = [ TWO*y1, FOUR*y1, SIX*y1, & - TWO*y2, TWO*y2, -FOUR, & - TWO*y3, -FOUR, TWO*y3 ] + Jdata(1:9) = [TWO*y1, FOUR*y1, SIX*y1, & + TWO*y2, TWO*y2, -FOUR, & + TWO*y3, -FOUR, TWO*y3] retval = 0 @@ -322,7 +314,7 @@ program main !======== Declarations ======== implicit none - integer(C_INT) :: retval = 0 + integer(c_int) :: retval = 0 !============== Introduction ============= print *, 'Newton SUNNonlinearSolver Fortran 2003 interface test' @@ -334,7 +326,7 @@ program main print *, 'FAILURE: n unit tests failed' stop 1 else - print *,'SUCCESS: all unit tests passed' + print *, 'SUCCESS: all unit tests passed' end if call Test_Finalize() diff --git a/examples/utilities/test_utilities.f90 b/examples/utilities/test_utilities.f90 index dc5abe7587..54c439dee3 100644 --- a/examples/utilities/test_utilities.f90 +++ b/examples/utilities/test_utilities.f90 @@ -16,42 +16,42 @@ module test_utilities - use, intrinsic :: iso_c_binding - use fsundials_core_mod - implicit none - - ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype - ! we set the integer kind used for indices in this example based - ! on the the index size SUNDIALS was compiled with so that it works - ! in both configurations. This is not a requirement for user codes. + use, intrinsic :: iso_c_binding + use fsundials_core_mod + implicit none + + ! Since SUNDIALS can be compiled with 32-bit or 64-bit sunindextype + ! we set the integer kind used for indices in this example based + ! on the the index size SUNDIALS was compiled with so that it works + ! in both configurations. This is not a requirement for user codes. #if defined(SUNDIALS_INT32_T) - integer, parameter :: myindextype = selected_int_kind(8) + integer, parameter :: myindextype = selected_int_kind(8) #elif defined(SUNDIALS_INT64_T) - integer, parameter :: myindextype = selected_int_kind(16) + integer, parameter :: myindextype = selected_int_kind(16) #endif - real(C_DOUBLE), parameter :: SUN_UNIT_ROUNDOFF = epsilon(1.0d0) + real(c_double), parameter :: SUN_UNIT_ROUNDOFF = epsilon(1.0d0) - real(C_DOUBLE) :: NEG_TWO = -2.0d0 - real(C_DOUBLE) :: NEG_ONE = -1.0d0 - real(C_DOUBLE) :: NEG_HALF = -0.50d0 - real(C_DOUBLE) :: ZERO = 0.0d0 - real(C_DOUBLE) :: HALF = 0.5d0 - real(C_DOUBLE) :: ONE = 1.0d0 - real(C_DOUBLE) :: TWO = 2.0d0 - real(C_DOUBLE) :: THREE = 3.0d0 - real(C_DOUBLE) :: FOUR = 4.0d0 - real(C_DOUBLE) :: FIVE = 5.0d0 - real(C_DOUBLE) :: SIX = 6.0d0 + real(c_double) :: NEG_TWO = -2.0d0 + real(c_double) :: NEG_ONE = -1.0d0 + real(c_double) :: NEG_HALF = -0.50d0 + real(c_double) :: ZERO = 0.0d0 + real(c_double) :: HALF = 0.5d0 + real(c_double) :: ONE = 1.0d0 + real(c_double) :: TWO = 2.0d0 + real(c_double) :: THREE = 3.0d0 + real(c_double) :: FOUR = 4.0d0 + real(c_double) :: FIVE = 5.0d0 + real(c_double) :: SIX = 6.0d0 - type(C_PTR) :: sunctx + type(c_ptr) :: sunctx contains subroutine Test_Init(comm) implicit none - integer(C_INT), value :: comm - integer(C_INT) :: retval + integer(c_int), value :: comm + integer(c_int) :: retval retval = FSUNContext_Create(comm, sunctx) if (retval /= 0) then @@ -63,19 +63,19 @@ subroutine Test_Init(comm) subroutine Test_Finalize() implicit none - integer(C_INT) :: retval + integer(c_int) :: retval retval = FSUNContext_Free(sunctx) end subroutine - integer(C_INT) function FNEQTOL(a, b, tol) result(nequal) + integer(c_int) function FNEQTOL(a, b, tol) result(nequal) implicit none - real(C_DOUBLE) :: a, b, tol + real(c_double) :: a, b, tol if (a /= a) then nequal = 1 - else if ((abs(a-b)/abs(b)) > tol) then + else if ((abs(a - b)/abs(b)) > tol) then nequal = 1 else nequal = 0 @@ -83,13 +83,13 @@ integer(C_INT) function FNEQTOL(a, b, tol) result(nequal) end function FNEQTOL - integer(C_INT) function FNEQ(a, b) result(nequal) + integer(c_int) function FNEQ(a, b) result(nequal) implicit none - real(C_DOUBLE) :: a, b + real(c_double) :: a, b if (a /= a) then nequal = 1 - else if ((abs(a-b)/abs(b)) > (10*SUN_UNIT_ROUNDOFF)) then + else if ((abs(a - b)/abs(b)) > (10*SUN_UNIT_ROUNDOFF)) then nequal = 1 else nequal = 0 diff --git a/scripts/format.sh b/scripts/format.sh index 21dc930698..b145adcfad 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -10,7 +10,8 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------------------------- -# This script will use clang-tidy and clang-format to format code. +# This script will use clang-tidy and clang-format to format C/C++ code and +# fprettify for Fortran code. # # Usage: # ./format.sh <paths to directories or files to format> @@ -28,3 +29,5 @@ paths=( "$@" ) find "${paths[@]}" -iname '*.h' -o -iname '*.hpp' -o \ -iname '*.c' -o -iname '*.cpp' -o \ -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i + +find "${paths[@]}" -iname '*.f90' | grep -v fmod | xargs fprettify --indent 2 --enable-replacements --c-relations diff --git a/test/unit_tests/arkode/F2003_serial/ark_test_table_f2003.f90 b/test/unit_tests/arkode/F2003_serial/ark_test_table_f2003.f90 index 55ef49d612..ab06dfa929 100644 --- a/test/unit_tests/arkode/F2003_serial/ark_test_table_f2003.f90 +++ b/test/unit_tests/arkode/F2003_serial/ark_test_table_f2003.f90 @@ -25,7 +25,7 @@ program main implicit none type(c_ptr) :: table ! Butcher table object - character (len=19) :: table_name ! table name + character(len=19) :: table_name ! table name integer(c_int) :: ierr ! error flag integer(c_int) :: q(1) ! table order integer(c_int) :: p(1) ! table embedded order @@ -33,14 +33,14 @@ program main print *, 'Loading ARKODE_DORMAND_PRINCE_7_4_5' table = FARKodeButcherTable_LoadERKByName('ARKODE_DORMAND_PRINCE_7_4_5') if (.not. c_associated(table)) then - write(error_unit,*) 'FARKodeButcherTable_LoadERKByName returned NULL' + write (error_unit, *) 'FARKodeButcherTable_LoadERKByName returned NULL' stop 1 end if print *, 'Checking ARKODE_DORMAND_PRINCE_7_4_5 order' - ierr = FARKodeButcherTable_CheckOrder(table, q, p, c_null_ptr); + ierr = FARKodeButcherTable_CheckOrder(table, q, p, c_null_ptr); if (ierr /= 0) then - write(error_unit, *) 'FARKodeButcherTable_CheckOrder returned ', ierr + write (error_unit, *) 'FARKodeButcherTable_CheckOrder returned ', ierr stop 1 end if @@ -50,14 +50,14 @@ program main table_name = 'ARKODE_TRBDF2_3_3_2' table = FARKodeButcherTable_LoadDIRKByName(table_name) if (.not. c_associated(table)) then - write(error_unit,*) 'FARKodeButcherTable_LoadDIRKByName returned NULL' + write (error_unit, *) 'FARKodeButcherTable_LoadDIRKByName returned NULL' stop 1 end if print *, 'Checking ARKODE_TRBDF2_3_3_2 order' - ierr = FARKodeButcherTable_CheckOrder(table, q, p, c_null_ptr); + ierr = FARKodeButcherTable_CheckOrder(table, q, p, c_null_ptr); if (ierr /= 0) then - write(error_unit, *) 'FARKodeButcherTable_CheckOrder returned ', ierr + write (error_unit, *) 'FARKodeButcherTable_CheckOrder returned ', ierr stop 1 end if @@ -66,14 +66,14 @@ program main print *, 'Loading ARKODE_DIRK_NONE' table = FARKodeButcherTable_LoadDIRKByName('ARKODE_DIRK_NONE') if (c_associated(table)) then - write(error_unit, *) 'FARKodeButcherTable_LoadDIRKByName returned non-NULL for ARKODE_DIRK_NONE' + write (error_unit, *) 'FARKodeButcherTable_LoadDIRKByName returned non-NULL for ARKODE_DIRK_NONE' stop 1 end if print *, 'Loading invalid table. This should print an error' table = FARKodeButcherTable_LoadERKByName('does not exist') if (c_associated(table)) then - write(error_unit, *) 'FARKodeButcherTable_LoadERKByName returned non-NULL for invalid table name' + write (error_unit, *) 'FARKodeButcherTable_LoadERKByName returned non-NULL for invalid table name' stop 1 end if From bacf6acae9008801da209b25a187d7904fd151a3 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 20 Jun 2024 09:28:58 -0700 Subject: [PATCH 069/137] Release/7.1.0 (#510) --- .git-blame-ignore-revs | 2 + CHANGELOG.md | 2 +- CITATIONS.md | 12 +- CMakeLists.txt | 24 +- README.md | 2 +- .../guide/source/ARKodeButcherTable.rst | 4 +- doc/arkode/guide/source/Introduction.rst | 2 +- .../guide/source/Usage/ARKStep/Relaxation.rst | 30 +- .../source/Usage/ARKStep/User_callable.rst | 258 +++++++++--------- .../guide/source/Usage/ARKStep/XBraid.rst | 4 +- .../guide/source/Usage/ERKStep/Relaxation.rst | 30 +- .../source/Usage/ERKStep/User_callable.rst | 122 ++++----- .../source/Usage/MRIStep/User_callable.rst | 158 +++++------ doc/arkode/guide/source/Usage/Relaxation.rst | 30 +- .../source/Usage/SPRKStep/User_callable.rst | 58 ++-- .../guide/source/Usage/User_callable.rst | 258 +++++++++--------- .../source/sunnonlinsol/ARKODE_interface.rst | 10 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvodes/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Introduction.rst | 2 +- doc/idas/guide/source/Introduction.rst | 2 +- doc/kinsol/guide/source/Introduction.rst | 2 +- doc/shared/Changelog.rst | 2 +- doc/shared/History.rst | 2 + doc/shared/sundials.bib | 24 +- doc/shared/sundials/Fortran.rst | 2 +- doc/shared/sundials/Install.rst | 14 +- doc/shared/sundials_vars.py | 16 +- doc/sundials/biblio.bib | 24 +- doc/sundials/ug.tex | 14 +- scripts/tarscript | 14 +- scripts/updateVersion.sh | 2 +- src/arkode/README.md | 10 +- src/cvode/README.md | 10 +- src/cvodes/README.md | 10 +- src/ida/README.md | 10 +- src/idas/README.md | 10 +- src/kinsol/README.md | 10 +- 38 files changed, 597 insertions(+), 593 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index d0d20d539f..51ab03ac92 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -2,3 +2,5 @@ fab1cecb7d91cff53b31730af5d00ff154c3b6ce # Remove deprecated types in 7.0.0 cc6960349aa92e2bcad9168a6dacff99b21c329c +# Apply formatting to Fortran files +23581e8454955283139e551a7bcd1b85d8b7c77b diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b94e65798..059d8d3666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release X.Y.Z +## Changes to SUNDIALS in release 7.1.0 ### Major Features diff --git a/CITATIONS.md b/CITATIONS.md index bdbe0f33e1..ef97b2c715 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -69,7 +69,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Cody J. Balos}, title = {User Documentation for ARKODE}, year = {2024}, - note = {v6.0.0} + note = {v6.1.0} } ``` @@ -78,7 +78,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODE}, year = {2024}, - note = {v7.0.0} + note = {v7.1.0} } ``` @@ -87,7 +87,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODES}, year = {2024}, - note = {v7.0.0} + note = {v7.1.0} } ``` @@ -96,7 +96,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDA}, year = {2024}, - note = {v7.0.0} + note = {v7.1.0} } ``` @@ -105,7 +105,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDAS}, year = {2024}, - note = {v6.0.0} + note = {v6.1.0} } ``` @@ -114,6 +114,6 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for KINSOL}, year = {2024}, - note = {v7.0.0} + note = {v7.1.0} } ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c2279f4e2..0f8fa7933f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ include(FindPackageHandleStandardArgs) # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") -set(PACKAGE_STRING "SUNDIALS 7.0.0") +set(PACKAGE_STRING "SUNDIALS 7.1.0") set(PACKAGE_TARNAME "sundials") # Set SUNDIALS version numbers @@ -57,7 +57,7 @@ message(STATUS "SUNDIALS_GIT_VERSION: ${SUNDIALS_GIT_VERSION}") # (use "" for the version label if none is needed) set(PACKAGE_VERSION_MAJOR "7") -set(PACKAGE_VERSION_MINOR "0") +set(PACKAGE_VERSION_MINOR "1") set(PACKAGE_VERSION_PATCH "0") set(PACKAGE_VERSION_LABEL "") @@ -73,37 +73,37 @@ endif() # Specify the VERSION and SOVERSION for shared libraries -set(arkodelib_VERSION "6.0.0") +set(arkodelib_VERSION "6.1.0") set(arkodelib_SOVERSION "6") -set(cvodelib_VERSION "7.0.0") +set(cvodelib_VERSION "7.1.0") set(cvodelib_SOVERSION "7") -set(cvodeslib_VERSION "7.0.0") +set(cvodeslib_VERSION "7.1.0") set(cvodeslib_SOVERSION "7") -set(idalib_VERSION "7.0.0") +set(idalib_VERSION "7.1.0") set(idalib_SOVERSION "7") -set(idaslib_VERSION "6.0.0") +set(idaslib_VERSION "6.1.0") set(idaslib_SOVERSION "6") -set(kinsollib_VERSION "7.0.0") +set(kinsollib_VERSION "7.1.0") set(kinsollib_SOVERSION "7") set(cpodeslib_VERSION "0.0.0") set(cpodeslib_SOVERSION "0") -set(nveclib_VERSION "7.0.0") +set(nveclib_VERSION "7.1.0") set(nveclib_SOVERSION "7") -set(sunmatrixlib_VERSION "5.0.0") +set(sunmatrixlib_VERSION "5.1.0") set(sunmatrixlib_SOVERSION "5") -set(sunlinsollib_VERSION "5.0.0") +set(sunlinsollib_VERSION "5.1.0") set(sunlinsollib_SOVERSION "5") -set(sunnonlinsollib_VERSION "4.0.0") +set(sunnonlinsollib_VERSION "4.1.0") set(sunnonlinsollib_SOVERSION "4") set(sundialslib_VERSION diff --git a/README.md b/README.md index d143fbbc69..9a21db1d4d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic equation Solvers # -### Version 7.0.0 (Feb 2024) ### +### Version 7.1.0 (Jun 2024) ### **Center for Applied Scientific Computing, Lawrence Livermore National Laboratory** diff --git a/doc/arkode/guide/source/ARKodeButcherTable.rst b/doc/arkode/guide/source/ARKodeButcherTable.rst index 6475ee766e..97ccdc96e5 100644 --- a/doc/arkode/guide/source/ARKodeButcherTable.rst +++ b/doc/arkode/guide/source/ARKodeButcherTable.rst @@ -168,7 +168,7 @@ ARKodeButcherTable functions * The name associated with *emethod*. * ``NULL`` pointer if *emethod* was invalid. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: ARKodeButcherTable ARKodeButcherTable_LoadDIRK(ARKODE_DIRKTableID imethod) @@ -219,7 +219,7 @@ ARKodeButcherTable functions * The name associated with *imethod*. * ``NULL`` pointer if *imethod* was invalid. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded) diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index a8e4d53d20..7427e78f0a 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -126,7 +126,7 @@ require a linear solver, ARKODE may use a variety of SUNLinearSolver modules provided with SUNDIALS, or again may utilize a user-supplied module. -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 6.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst index da267bf1ee..ed7ba1fd64 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/Relaxation.rst @@ -69,7 +69,7 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxFn` instead. @@ -98,7 +98,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxEtaFail` instead. @@ -124,7 +124,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxLowerBound` instead. @@ -150,7 +150,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxUpperBound` instead. @@ -174,7 +174,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxMaxFails` instead. @@ -202,7 +202,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxMaxIters` instead. @@ -223,7 +223,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxSolver` instead. @@ -253,7 +253,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxResTol` instead. @@ -284,7 +284,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxTol` instead. @@ -309,7 +309,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxFnEvals` instead. @@ -328,7 +328,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. @@ -352,7 +352,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxFails` instead. @@ -372,7 +372,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxBoundFails` instead. @@ -391,7 +391,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. @@ -410,6 +410,6 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxSolveIters` instead. diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index 383c3795ea..a6c07ac5e6 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -74,7 +74,7 @@ ARKStep initialization and deallocation functions **Return value:** None - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeFree` instead. @@ -100,7 +100,7 @@ ARKStep tolerance specification functions * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSStolerances` instead. @@ -123,7 +123,7 @@ ARKStep tolerance specification functions * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSVtolerances` instead. @@ -143,7 +143,7 @@ ARKStep tolerance specification functions * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWFtolerances` instead. @@ -163,7 +163,7 @@ ARKStep tolerance specification functions * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResStolerance` instead. @@ -183,7 +183,7 @@ ARKStep tolerance specification functions * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResVtolerance` instead. @@ -203,7 +203,7 @@ ARKStep tolerance specification functions * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResFtolerance` instead. @@ -256,7 +256,7 @@ Linear solver interface functions insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by ARKStep. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinearSolver` instead. @@ -318,7 +318,7 @@ Mass matrix solver specification functions mass-matrix-times-vector product routine (see :c:type:`ARKLsMassTimesVecFn` and :c:func:`ARKStepSetMassTimes()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassLinearSolver` instead. @@ -350,7 +350,7 @@ Nonlinear solver interface functions default; a call to this routine replaces that module with the supplied *NLS* object. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinearSolver` instead. @@ -389,7 +389,7 @@ Rootfinding initialization function problem but the prior one did, then call *ARKStepRootInit* with *nrtfn = 0*. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeRootInit` instead. @@ -508,7 +508,7 @@ ARKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeEvolve` instead. @@ -545,14 +545,14 @@ Optional inputs for ARKStep Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`ARKStepRootInit()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDefaults` instead. .. c:function:: int ARKStepSetInterpolantType(void* arkode_mem, int itype) - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see the documentation for that function instead. @@ -598,7 +598,7 @@ Optional inputs for ARKStep obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolantDegree` instead. @@ -694,7 +694,7 @@ Optional inputs for ARKStep routines will provide no useful information to the solver, and at worst they may interfere with the desired fixed step size. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStep` instead. @@ -724,7 +724,7 @@ Optional inputs for ARKStep This routine will also reset the step size and error history. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInitStep` instead. @@ -750,7 +750,7 @@ Optional inputs for ARKStep A negative value indicates that no warning messages should be issued. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -776,7 +776,7 @@ Optional inputs for ARKStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumSteps` instead. @@ -797,7 +797,7 @@ Optional inputs for ARKStep **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxStep` instead. @@ -818,7 +818,7 @@ Optional inputs for ARKStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMinStep` instead. @@ -848,7 +848,7 @@ Optional inputs for ARKStep :c:func:`ARKStepReset` will remain active but can be disabled by calling :c:func:`ARKStepClearStopTime`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStopTime` instead. @@ -869,7 +869,7 @@ Optional inputs for ARKStep .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolateStopTime` instead. @@ -891,7 +891,7 @@ Optional inputs for ARKStep .. versionadded:: 5.5.1 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeClearStopTime` instead. @@ -919,7 +919,7 @@ Optional inputs for ARKStep this function must be made *before* any calls to :c:func:`ARKStepSetLinearSolver()` and/or :c:func:`ARKStepSetMassLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetUserData` instead. @@ -942,7 +942,7 @@ Optional inputs for ARKStep The default value is 7; set *maxnef* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxErrTestFails` instead. @@ -968,7 +968,7 @@ Optional inputs for ARKStep all problems are different, so these values may not be optimal for all users. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Adjust solver parameters individually instead. For reference, this routine sets the following non-default parameters: @@ -1154,7 +1154,7 @@ Optional inputs for ARKStep and :c:func:`ARKStepSetFixedStep()` are incompatible, and should not be used simultaneously. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetConstraints` instead. @@ -1176,7 +1176,7 @@ Optional inputs for ARKStep Passing *maxfails* <= 0 results in ARKStep using the default value (10). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumConstrFails` instead. @@ -1227,7 +1227,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int ARKStep memory block, it cannot be changed after the first call to :c:func:`ARKStepEvolve()`, unless :c:func:`ARKStepReInit()` is called. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetOrder` instead. @@ -1459,7 +1459,7 @@ Optional inputs for time step adaptivity .. versionadded:: 5.7.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetAdaptController` instead. @@ -1557,7 +1557,7 @@ Optional inputs for time step adaptivity .. versionadded:: 5.7.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetAdaptivityAdjustment` instead. @@ -1580,7 +1580,7 @@ Optional inputs for time step adaptivity Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetCFLFraction` instead. @@ -1629,7 +1629,7 @@ Optional inputs for time step adaptivity **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStepBounds` instead. @@ -1653,7 +1653,7 @@ Optional inputs for time step adaptivity **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxCFailGrowth` instead. @@ -1675,7 +1675,7 @@ Optional inputs for time step adaptivity **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxEFailGrowth` instead. @@ -1698,7 +1698,7 @@ Optional inputs for time step adaptivity **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxFirstGrowth` instead. @@ -1721,7 +1721,7 @@ Optional inputs for time step adaptivity Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxGrowth` instead. @@ -1746,7 +1746,7 @@ Optional inputs for time step adaptivity Any value outside the interval :math:`(0,1)` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMinReduction` instead. @@ -1769,7 +1769,7 @@ Optional inputs for time step adaptivity Any value :math:`\le 0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetSafetyFactor` instead. @@ -1792,7 +1792,7 @@ Optional inputs for time step adaptivity **Notes:** Any value :math:`\le 0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetSmallNumEFails` instead. @@ -1821,7 +1821,7 @@ Optional inputs for time step adaptivity be quite useful for problems where the explicit right-hand side function :math:`f^E(t,y)` contains stiff terms. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStabilityFn` instead. @@ -1861,7 +1861,7 @@ Optional inputs for implicit stage solves stage. Thus one must balance the relative costs of such recomputation against the benefits of requiring only a single Newton linear solve. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinear` instead. @@ -1885,7 +1885,7 @@ Optional inputs for implicit stage solves :c:func:`ARKStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinear` instead. @@ -1933,7 +1933,7 @@ Optional inputs for implicit stage solves instead default to the trivial predictor (*method* 0). **Both of these options have been deprecated, and will be removed from a future release.** - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetPredictorMethod` instead. @@ -1956,7 +1956,7 @@ Optional inputs for implicit stage solves See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStagePredictFn` instead. @@ -1984,7 +1984,7 @@ Optional inputs for implicit stage solves When using a non-default nonlinear solver, this function must be called *after* :c:func:`ARKStepSetNonlinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNlsRhsFn` instead. @@ -2008,7 +2008,7 @@ Optional inputs for implicit stage solves The default value is 3; set *maxcor* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNonlinIters` instead. @@ -2031,7 +2031,7 @@ Optional inputs for implicit stage solves The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinConvCoef` instead. @@ -2052,7 +2052,7 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinCRDown` instead. @@ -2075,7 +2075,7 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinRDiv` instead. @@ -2106,7 +2106,7 @@ Optional inputs for implicit stage solves convergence failure still occurs, the time step size is reduced by the factor *etacf* (set within :c:func:`ARKStepSetMaxCFailGrowth()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxConvFails` instead. @@ -2129,7 +2129,7 @@ Optional inputs for implicit stage solves .. versionadded:: 5.2.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDeduceImplicitRhs` instead. @@ -2167,7 +2167,7 @@ Optional inputs for the ARKLS linear solver interface **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDeltaGammaMax` instead. @@ -2193,7 +2193,7 @@ Optional inputs for the ARKLS linear solver interface step. If **msbp** is 0, the default value of 20 will be used. A negative value forces a linear solver step at each implicit stage. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLSetupFrequency` instead. @@ -2230,7 +2230,7 @@ Optional inputs for the ARKLS linear solver interface This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacEvalFrequency` instead. @@ -2272,7 +2272,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacFn` instead. @@ -2303,7 +2303,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinSysFn` instead. @@ -2334,7 +2334,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsMassFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassFn` instead. @@ -2359,7 +2359,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules Linear solution scaling is enabled by default when a matrix-based linear solver is attached. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinearSolutionScaling` instead. @@ -2403,7 +2403,7 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacTimes` instead. @@ -2433,7 +2433,7 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacTimesRhsFn` instead. @@ -2474,7 +2474,7 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsMassTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassTimes` instead. @@ -2517,7 +2517,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetPreconditioner` instead. @@ -2553,7 +2553,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsMassPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassPreconditioner` instead. @@ -2582,7 +2582,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetEpsLin` instead. @@ -2611,7 +2611,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules Passing a value *eplifac* :math:`\le 0` indicates to use the default value of 0.05. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassEpsLin` instead. @@ -2643,7 +2643,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLSNormFactor` instead. @@ -2675,7 +2675,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKStepSetMassLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMassLSNormFactor` instead. @@ -2706,7 +2706,7 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRootDirection` instead. @@ -2732,7 +2732,7 @@ Rootfinding optional input functions first step), ARKStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -2781,7 +2781,7 @@ Interpolated output function functions :c:func:`ARKStepGetCurrentTime()` and :c:func:`ARKStepGetLastStep()`, respectively. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetDky` instead. @@ -2811,7 +2811,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetWorkSpace` instead. @@ -2829,7 +2829,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumSteps` instead. @@ -2855,7 +2855,7 @@ Main solver optional output functions local error test condition, or to ensure convergence of the nonlinear solver. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetActualInitStep` instead. @@ -2873,7 +2873,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastStep` instead. @@ -2890,7 +2890,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentStep` instead. @@ -2907,7 +2907,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentTime` instead. @@ -2929,7 +2929,7 @@ Main solver optional output functions as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentState` instead. @@ -2947,7 +2947,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentGamma` instead. @@ -2966,7 +2966,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetTolScaleFactor` instead. @@ -2987,7 +2987,7 @@ Main solver optional output functions The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetErrWeights` instead. @@ -3008,7 +3008,7 @@ Main solver optional output functions The user must allocate space for *rweight*, that will be filled in by this function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetResWeights` instead. @@ -3029,7 +3029,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetStepStats` instead. @@ -3061,7 +3061,7 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodePrintAllStats` instead. @@ -3078,7 +3078,7 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -3097,7 +3097,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumExpSteps` instead. @@ -3115,7 +3115,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumAccSteps` instead. @@ -3132,7 +3132,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumStepAttempts` instead. @@ -3170,7 +3170,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumErrTestFails` instead. @@ -3187,7 +3187,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumStepSolveFails` instead. @@ -3255,7 +3255,7 @@ Main solver optional output functions failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetEstLocalErrors` instead. @@ -3292,7 +3292,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumConstrFails` instead. @@ -3312,7 +3312,7 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetUserData` instead. @@ -3339,7 +3339,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinSolvSetups` instead. @@ -3362,7 +3362,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. @@ -3384,7 +3384,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. @@ -3407,7 +3407,7 @@ Implicit solver optional output functions solver object; the counters are reset whenever a new nonlinear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNonlinSolvStats` instead. @@ -3445,7 +3445,7 @@ Rootfinding optional output functions zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetRootInfo` instead. @@ -3463,7 +3463,7 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumGEvals` instead. @@ -3490,7 +3490,7 @@ Linear solver interface optional output functions This function is provided for debugging purposes and the values in the returned matrix should not be altered. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJac` instead. @@ -3507,7 +3507,7 @@ Linear solver interface optional output functions :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJacTime` instead. @@ -3524,7 +3524,7 @@ Linear solver interface optional output functions :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJacNumSteps` instead. @@ -3553,7 +3553,7 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e. summed over all processors). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLinWorkSpace` instead. @@ -3575,7 +3575,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJacEvals` instead. @@ -3599,7 +3599,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumPrecEvals` instead. @@ -3622,7 +3622,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumPrecSolves` instead. @@ -3644,7 +3644,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinIters` instead. @@ -3666,7 +3666,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinConvFails` instead. @@ -3689,7 +3689,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJTSetupEvals` instead. @@ -3712,7 +3712,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJtimesEvals` instead. @@ -3741,7 +3741,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinRhsEvals` instead. @@ -3796,7 +3796,7 @@ Linear solver interface optional output functions *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastLinFlag` instead. @@ -3813,7 +3813,7 @@ Linear solver interface optional output functions ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` :math:`\le n` (LU factorization failed), this routine returns "NONE". - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLinReturnFlagName` instead. @@ -3843,7 +3843,7 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e. summed over all processors). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetMassWorkSpace` instead. @@ -3868,7 +3868,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassSetups` instead. @@ -3892,7 +3892,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassMultSetups` instead. @@ -3917,7 +3917,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassMult` instead. @@ -3940,7 +3940,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassSolves` instead. @@ -3964,7 +3964,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassPrecEvals` instead. @@ -3988,7 +3988,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassPrecSolves` instead. @@ -4011,7 +4011,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassIters` instead. @@ -4034,7 +4034,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMassConvFails` instead. @@ -4058,7 +4058,7 @@ Linear solver interface optional output functions linear solver module is "attached" to ARKStep, or when ARKStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumMTSetups` instead. @@ -4082,7 +4082,7 @@ Linear solver interface optional output functions will match those described above for the function :c:func:`ARKStepGetLastLinFlag()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastMassFlag` instead. @@ -4114,7 +4114,7 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWriteParameters` instead. @@ -4143,7 +4143,7 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKStepGetCurrentButcherTables` and :c:func:`ARKodeButcherTable_Write` instead. @@ -4268,7 +4268,7 @@ ARKStep reset function If an error occurred, :c:func:`ARKStepReset()` also sends an error message to the error handler function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeReset` instead. @@ -4346,7 +4346,7 @@ ARKStep system resize function **Example codes:** * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResize` instead. diff --git a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst index 4ea9043bcc..665610283a 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst @@ -685,7 +685,7 @@ error occurred. The possible return codes are given in :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. :retval SUNBRAID_MEMFAIL: if the *app* content or ARKStep memory is ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKBraid_GetARKodeMem` instead. @@ -744,7 +744,7 @@ error occurred. The possible return codes are given in :retval SUNBRAID_ILLINPUT: if *app* is ``NULL``. :retval SUNBRAID_MEMFAIL: if the *app* content is ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKBraid_GetLastARKodeFlag` instead. diff --git a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst b/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst index fec0342371..979e8bff02 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/Relaxation.rst @@ -63,7 +63,7 @@ Enabling or Disabling Relaxation .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxFn` instead. @@ -92,7 +92,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxEtaFail` instead. @@ -118,7 +118,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxLowerBound` instead. @@ -144,7 +144,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxUpperBound` instead. @@ -168,7 +168,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxMaxFails` instead. @@ -196,7 +196,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxMaxIters` instead. @@ -217,7 +217,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxSolver` instead. @@ -246,7 +246,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxResTol` instead. @@ -278,7 +278,7 @@ relaxation. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRelaxTol` instead. @@ -303,7 +303,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxFnEvals` instead. @@ -322,7 +322,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxJacEvals` instead. @@ -346,7 +346,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxFails` instead. @@ -367,7 +367,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxBoundFails` instead. @@ -386,7 +386,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxSolveFails` instead. @@ -405,7 +405,7 @@ about the performance of the relaxation method. .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumRelaxSolveIters` instead. diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 03a9954b28..017aa17110 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -71,7 +71,7 @@ ERKStep initialization and deallocation functions **Return value:** None - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeFree` instead. @@ -97,7 +97,7 @@ ERKStep tolerance specification functions * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSStolerances` instead. @@ -121,7 +121,7 @@ ERKStep tolerance specification functions * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSVtolerances` instead. @@ -142,7 +142,7 @@ ERKStep tolerance specification functions * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWFtolerances` instead. @@ -181,7 +181,7 @@ Rootfinding initialization function problem but the prior one did, then call *ERKStepRootInit* with *nrtfn = 0*. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeRootInit` instead. @@ -283,7 +283,7 @@ ERKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeEvolve` instead. @@ -321,7 +321,7 @@ Optional inputs for ERKStep Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`ERKStepRootInit()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDefaults` instead. @@ -329,7 +329,7 @@ Optional inputs for ERKStep .. c:function:: int ERKStepSetInterpolantType(void* arkode_mem, int itype) - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see the documentation for that function instead. @@ -376,7 +376,7 @@ Optional inputs for ERKStep obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolantDegree` instead. @@ -473,7 +473,7 @@ Optional inputs for ERKStep routines will provide no useful information to the solver, and at worst they may interfere with the desired fixed step size. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStep` instead. @@ -503,7 +503,7 @@ Optional inputs for ERKStep This routine will also reset the step size and error history. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInitStep` instead. @@ -530,7 +530,7 @@ Optional inputs for ERKStep A negative value indicates that no warning messages should be issued. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -557,7 +557,7 @@ Optional inputs for ERKStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumSteps` instead. @@ -579,7 +579,7 @@ Optional inputs for ERKStep **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxStep` instead. @@ -601,7 +601,7 @@ Optional inputs for ERKStep **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMinStep` instead. @@ -632,7 +632,7 @@ Optional inputs for ERKStep :c:func:`ERKStepReset` will remain active but can be disabled by calling :c:func:`ERKStepClearStopTime`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStopTime` instead. @@ -654,7 +654,7 @@ Optional inputs for ERKStep .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolateStopTime` instead. @@ -677,7 +677,7 @@ Optional inputs for ERKStep .. versionadded:: 5.5.1 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeClearStopTime` instead. @@ -702,7 +702,7 @@ Optional inputs for ERKStep user-supplied functions for which it is an argument; otherwise ``NULL`` is passed. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetUserData` instead. @@ -726,7 +726,7 @@ Optional inputs for ERKStep The default value is 7; set *maxnef* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxErrTestFails` instead. @@ -774,7 +774,7 @@ Optional inputs for ERKStep and :c:func:`ERKStepSetFixedStep()` are incompatible, and should not be used simultaneously. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetConstraints` instead. @@ -797,7 +797,7 @@ Optional inputs for ERKStep Passing *maxfails* <= 0 results in ERKStep using the default value (10). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumConstrFails` instead. @@ -846,7 +846,7 @@ Optional inputs for IVP method selection ERKStep memory block, it cannot be changed after the first call to :c:func:`ERKStepEvolve()`, unless :c:func:`ERKStepReInit()` is called. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetOrder` instead. @@ -963,7 +963,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetAdaptController` instead. @@ -1059,7 +1059,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. .. versionadded:: 5.7.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetAdaptivityAdjustment` instead. @@ -1082,7 +1082,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetCFLFraction` instead. @@ -1133,7 +1133,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStepBounds` instead. @@ -1156,7 +1156,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxEFailGrowth` instead. @@ -1180,7 +1180,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxFirstGrowth` instead. @@ -1204,7 +1204,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any value :math:`\le 1.0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxGrowth` instead. @@ -1230,7 +1230,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any value :math:`\ge 1.0` or :math:`\le 0.0` will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMinReduction` instead. @@ -1254,7 +1254,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetSafetyFactor` instead. @@ -1278,7 +1278,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetSmallNumEFails` instead. @@ -1308,7 +1308,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. where the right-hand side function :math:`f(t,y)` contains stiff terms. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStabilityFn` instead. @@ -1343,7 +1343,7 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRootDirection` instead. @@ -1370,7 +1370,7 @@ Rootfinding optional input functions first step), ERKStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -1419,7 +1419,7 @@ Interpolated output function functions :c:func:`ERKStepGetCurrentTime()` and :c:func:`ERKStepGetLastStep()`, respectively. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetDky` instead. @@ -1450,7 +1450,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetWorkSpace` instead. @@ -1469,7 +1469,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumSteps` instead. @@ -1495,7 +1495,7 @@ Main solver optional output functions bounds :math:`(h_{min} \le h_0 \le h_{max})`, or to satisfy the local error test condition. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetActualInitStep` instead. @@ -1514,7 +1514,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastStep` instead. @@ -1532,7 +1532,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentStep` instead. @@ -1550,7 +1550,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentTime` instead. @@ -1570,7 +1570,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetTolScaleFactor` instead. @@ -1592,7 +1592,7 @@ Main solver optional output functions The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetErrWeights` instead. @@ -1614,7 +1614,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetStepStats` instead. @@ -1646,7 +1646,7 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodePrintAllStats` instead. @@ -1664,7 +1664,7 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -1683,7 +1683,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumExpSteps` instead. @@ -1702,7 +1702,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumAccSteps` instead. @@ -1720,7 +1720,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumStepAttempts` instead. @@ -1754,7 +1754,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumErrTestFails` instead. @@ -1821,7 +1821,7 @@ Main solver optional output functions failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetEstLocalErrors` instead. @@ -1857,7 +1857,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumConstrFails` instead. @@ -1878,7 +1878,7 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetUserData` instead. @@ -1916,7 +1916,7 @@ Rootfinding optional output functions zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetRootInfo` instead. @@ -1935,7 +1935,7 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumGEvals` instead. @@ -1967,7 +1967,7 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWriteParameters` instead. @@ -1993,7 +1993,7 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ERKStepGetCurrentButcherTable` and :c:func:`ARKodeButcherTable_Write` instead. @@ -2108,7 +2108,7 @@ ERKStep reset function If an error occurred, :c:func:`ERKStepReset()` also sends an error message to the error handler function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeReset` instead. @@ -2154,6 +2154,6 @@ ERKStep system resize function to :c:func:`ERKStepSetConstraints()` is required to re-enable constraint checking. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResize` instead. diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index eb92a95ac9..95f13fb608 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -110,7 +110,7 @@ MRIStep initialization and deallocation functions **Return value:** None - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeFree` instead. @@ -136,7 +136,7 @@ MRIStep tolerance specification functions * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSStolerances` instead. @@ -160,7 +160,7 @@ MRIStep tolerance specification functions * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSVtolerances` instead. @@ -181,7 +181,7 @@ MRIStep tolerance specification functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWFtolerances` instead. @@ -233,7 +233,7 @@ Linear solver interface functions insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by MRIStep. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinearSolver` instead. @@ -264,7 +264,7 @@ Nonlinear solver interface functions default; a call to this routine replaces that module with the supplied *NLS* object. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinearSolver` instead. @@ -305,7 +305,7 @@ Rootfinding initialization function Rootfinding is only supported for the slow (outer) integrator and should not be actived for the fast (inner) integrator. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeRootInit` instead. @@ -414,7 +414,7 @@ MRIStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeEvolve` instead. @@ -454,7 +454,7 @@ Optional inputs for MRIStep structures or options related to root-finding (those can be reset using :c:func:`MRIStepRootInit()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDefaults` instead. @@ -462,7 +462,7 @@ Optional inputs for MRIStep .. c:function:: int MRIStepSetInterpolantType(void* arkode_mem, int itype) - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see the documentation for that function instead. @@ -514,7 +514,7 @@ Optional inputs for MRIStep When :math:`q=1`, a linear interpolant is the default to ensure values obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolantDegree` instead. @@ -584,7 +584,7 @@ Optional inputs for MRIStep The step sizes used by the inner (fast) stepper may be controlled through calling the appropriate "Set" routines on the inner integrator. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStep` instead. @@ -615,7 +615,7 @@ Optional inputs for MRIStep A negative value indicates that no warning messages should be issued. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxHnilWarns` instead. @@ -646,7 +646,7 @@ Optional inputs for MRIStep Passing *mxsteps* < 0 disables the test (not recommended). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumSteps` instead. @@ -683,7 +683,7 @@ Optional inputs for MRIStep :c:func:`MRIStepReset` will remain active but can be disabled by calling :c:func:`MRIStepClearStopTime`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStopTime` instead. @@ -705,7 +705,7 @@ Optional inputs for MRIStep .. versionadded:: 5.6.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolateStopTime` instead. @@ -728,7 +728,7 @@ Optional inputs for MRIStep .. versionadded:: 5.5.1 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeClearStopTime` instead. @@ -763,7 +763,7 @@ Optional inputs for MRIStep may be the same as or different from the pointer attached to the outer integrator depending on what is required by the user code. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetUserData` instead. @@ -845,7 +845,7 @@ Optional inputs for IVP method selection * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetOrder` instead. @@ -913,7 +913,7 @@ Optional inputs for implicit stage solves The only SUNDIALS-provided SUNNonlinearSolver module that is compatible with the :c:func:`MRIStepSetLinear()` option is the Newton solver. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinear` instead. @@ -938,7 +938,7 @@ Optional inputs for implicit stage solves :c:func:`MRIStepSetDeltaGammaMax()` to reset the step size ratio threshold to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinear` instead. @@ -978,7 +978,7 @@ Optional inputs for implicit stage solves **The "bootstrap" predictor (option 4 above) has been deprecated, and will be removed from a future release.** - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetPredictorMethod` instead. @@ -1002,7 +1002,7 @@ Optional inputs for implicit stage solves **Notes:** The default value is 3; set *maxcor* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNonlinIters` instead. @@ -1024,7 +1024,7 @@ Optional inputs for implicit stage solves **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinConvCoef` instead. @@ -1045,7 +1045,7 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinCRDown` instead. @@ -1068,7 +1068,7 @@ Optional inputs for implicit stage solves **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNonlinRDiv` instead. @@ -1091,7 +1091,7 @@ Optional inputs for implicit stage solves **Notes:** See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStagePredictFn` instead. @@ -1119,7 +1119,7 @@ Optional inputs for implicit stage solves When using a non-default nonlinear solver, this function must be called *after* :c:func:`MRIStepSetNonlinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNlsRhsFn` instead. @@ -1143,7 +1143,7 @@ Optional inputs for implicit stage solves .. versionadded:: 5.2.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDeduceImplicitRhs` instead. @@ -1177,7 +1177,7 @@ Optional inputs for the ARKLS linear solver interface **Notes:** Any non-positive parameter will imply a reset to the default value. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDeltaGammaMax` instead. @@ -1203,7 +1203,7 @@ Optional inputs for the ARKLS linear solver interface step. If **msbp** is 0, the default value of 20 will be used. A negative value forces a linear solver step at each implicit stage. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLSetupFrequency` instead. @@ -1236,7 +1236,7 @@ Optional inputs for the ARKLS linear solver interface This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacEvalFrequency` instead. @@ -1274,7 +1274,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsJacFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacFn` instead. @@ -1305,7 +1305,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules The function type :c:func:`ARKLsLinSysFn()` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinSysFn` instead. @@ -1330,7 +1330,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules **Notes:** Linear solution scaling is enabled by default when a matrix-based linear solver is attached. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLinearSolutionScaling` instead. @@ -1373,7 +1373,7 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacTimes` instead. @@ -1401,7 +1401,7 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetJacTimesRhsFn` instead. @@ -1444,7 +1444,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules :c:func:`ARKLsPrecSolveFn()` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetPreconditioner` instead. @@ -1473,7 +1473,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetEpsLin` instead. @@ -1506,7 +1506,7 @@ Optional inputs for iterative ``SUNLinearSolver`` modules This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetLSNormFactor` instead. @@ -1538,7 +1538,7 @@ Rootfinding optional input functions **Notes:** The default behavior is to monitor for both zero-crossing directions. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRootDirection` instead. @@ -1564,7 +1564,7 @@ Rootfinding optional input functions first step), MRIStep will issue a warning which can be disabled with this optional input function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -1620,7 +1620,7 @@ Interpolated output function functions :c:func:`MRIStepGetCurrentTime()` and :c:func:`MRIStepGetLastStep()`, respectively. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetDky` instead. @@ -1656,7 +1656,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetWorkSpace` instead. @@ -1681,7 +1681,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumSteps` instead. @@ -1704,7 +1704,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastStep` instead. @@ -1726,7 +1726,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentTime` instead. @@ -1751,7 +1751,7 @@ Main solver optional output functions as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentState` instead. @@ -1773,7 +1773,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentGamma` instead. @@ -1796,7 +1796,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetTolScaleFactor` instead. @@ -1820,7 +1820,7 @@ Main solver optional output functions **Notes:** The user must allocate space for *eweight*, that will be filled in by this function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetErrWeights` instead. @@ -1852,7 +1852,7 @@ Main solver optional output functions .. versionadded:: 5.2.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodePrintAllStats` instead. @@ -1870,7 +1870,7 @@ Main solver optional output functions The return value is a string containing the name of the corresponding constant. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -1913,7 +1913,7 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumStepSolveFails` instead. @@ -1991,7 +1991,7 @@ Main solver optional output functions .. versionadded:: 5.3.0 - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetUserData` instead. @@ -2023,7 +2023,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinSolvSetups` instead. @@ -2050,7 +2050,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumNonlinSolvIters` instead. @@ -2077,7 +2077,7 @@ Implicit solver optional output functions solver object; the counter is reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumNonlinSolvConvFails` instead. @@ -2107,7 +2107,7 @@ Implicit solver optional output functions nonlinear solver object; the counters are reset whenever a new nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNonlinSolvStats` instead. @@ -2144,7 +2144,7 @@ Rootfinding optional output functions zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetRootInfo` instead. @@ -2163,7 +2163,7 @@ Rootfinding optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumGEvals` instead. @@ -2191,7 +2191,7 @@ Linear solver interface optional output functions This function is provided for debugging purposes and the values in the returned matrix should not be altered. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJac` instead. @@ -2208,7 +2208,7 @@ Linear solver interface optional output functions :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJacTime` instead. @@ -2226,7 +2226,7 @@ Linear solver interface optional output functions :retval ARKLS_MEM_NULL: ``arkode_mem`` was ``NULL`` :retval ARKLS_LMEM_NULL: the linear solver interface has not been initialized - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetJacNumSteps` instead. @@ -2260,7 +2260,7 @@ Linear solver interface optional output functions In a parallel setting, the above values are global (i.e., summed over all processors). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLinWorkSpace` instead. @@ -2287,7 +2287,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJacEvals` instead. @@ -2316,7 +2316,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumPrecEvals` instead. @@ -2344,7 +2344,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumPrecSolves` instead. @@ -2371,7 +2371,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinIters` instead. @@ -2398,7 +2398,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinConvFails` instead. @@ -2426,7 +2426,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJTSetupEvals` instead. @@ -2454,7 +2454,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumJtimesEvals` instead. @@ -2487,7 +2487,7 @@ Linear solver interface optional output functions solver object; the counter is reset whenever a new linear solver module is "attached" to MRIStep, or when MRIStep is resized. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumLinRhsEvals` instead. @@ -2546,7 +2546,7 @@ Linear solver interface optional output functions *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastLinFlag` instead. @@ -2564,7 +2564,7 @@ Linear solver interface optional output functions ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` :math:`\le n` (LU factorization failed), this routine returns "NONE". - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLinReturnFlagName` instead. @@ -2599,7 +2599,7 @@ General usability functions for this pointer, since parameters for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWriteParameters` instead. @@ -2627,7 +2627,7 @@ General usability functions for this pointer, since tables for all processes would be identical. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`MRIStepGetCurrentCoupling` and :c:func:`MRIStepCoupling_Write` instead. @@ -2764,7 +2764,7 @@ MRIStep reset function (*tR*, *yR*) arguments for the :c:type:`MRIStepInnerStepper` object that is used to evolve the MRI "fast" time scale subproblems. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeReset` instead. @@ -2842,6 +2842,6 @@ MRIStep system resize function routine, see the supplied serial C example problem, ``ark_heat1D_adapt.c``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeResize` instead. diff --git a/doc/arkode/guide/source/Usage/Relaxation.rst b/doc/arkode/guide/source/Usage/Relaxation.rst index f69c60e392..a3b237ccbd 100644 --- a/doc/arkode/guide/source/Usage/Relaxation.rst +++ b/doc/arkode/guide/source/Usage/Relaxation.rst @@ -70,7 +70,7 @@ Enabling or Disabling Relaxation the step fails or applying relaxation fails, :c:func:`ARKodeEvolve` will return with an error. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 Optional Input Functions ------------------------ @@ -94,7 +94,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxLowerBound(void* arkode_mem, sunrealtype lower) @@ -116,7 +116,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxUpperBound(void* arkode_mem, sunrealtype upper) @@ -138,7 +138,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxMaxFails(void* arkode_mem, int max_fails) @@ -158,7 +158,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxMaxIters(void* arkode_mem, int max_iters) @@ -182,7 +182,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver) @@ -201,7 +201,7 @@ relaxation. ``NULL`` :retval ARK_ILL_INPUT: an invalid solver option was provided - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxResTol(void* arkode_mem, sunrealtype res_tol) @@ -227,7 +227,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, sunrealtype abs_tol) @@ -254,7 +254,7 @@ relaxation. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 Optional Output Functions @@ -275,7 +275,7 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals) @@ -290,7 +290,7 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumRelaxFails(void* arkode_mem, long int* fails) @@ -310,7 +310,7 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumRelaxBoundFails(void* arkode_mem, long int* fails) @@ -326,7 +326,7 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumRelaxSolveFails(void* arkode_mem, long int* fails) @@ -341,7 +341,7 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters) @@ -356,4 +356,4 @@ about the performance of the relaxation method. :retval ARK_RELAX_MEM_NULL: the internal relaxation memory structure was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index ccf9617daa..d8f4dec8f9 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -70,7 +70,7 @@ SPRKStep initialization and deallocation functions :param arkode_mem: pointer to the SPRKStep memory block. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeFree` instead. @@ -104,7 +104,7 @@ Rootfinding initialization function :retval ARK_MEM_FAIL: if there was a memory allocation failure :retval ARK_ILL_INPUT: if *nrtfn* is greater than zero but *g* = ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeRootInit` instead. @@ -199,7 +199,7 @@ SPRKStep solver function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeEvolve` instead. @@ -237,14 +237,14 @@ Optional inputs for SPRKStep Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`SPRKStepRootInit()`). - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetDefaults` instead. .. c:function:: int SPRKStepSetInterpolantType(void* arkode_mem, int itype) - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 This function is now a wrapper to :c:func:`ARKodeSetInterpolantType`, see the documentation for that function instead. @@ -284,7 +284,7 @@ Optional inputs for SPRKStep When `q = 1`, a linear interpolant is the default to ensure values obtained by the integrator are returned at the ends of the time interval. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetInterpolantDegree` instead. @@ -300,7 +300,7 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetFixedStep` instead. @@ -323,7 +323,7 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetMaxNumSteps` instead. @@ -350,7 +350,7 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetStopTime` instead. @@ -367,7 +367,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeClearStopTime` instead. @@ -388,7 +388,7 @@ Optional inputs for SPRKStep :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetUserData` instead. @@ -437,7 +437,7 @@ Optional inputs for IVP method selection This overrides any previously set method so it should not be used with :c:func:`SPRKStepSetMethod` or :c:func:`SPRKStepSetMethodName`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetOrder` instead. @@ -524,7 +524,7 @@ Rootfinding optional input functions :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` :retval ARK_ILL_INPUT: if an argument has an illegal value - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetRootDirection` instead. @@ -546,7 +546,7 @@ Rootfinding optional input functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeSetNoInactiveRootWarn` instead. @@ -596,7 +596,7 @@ Interpolated output function It is only legal to call this function after a successful return from :c:func:`SPRKStepEvolve()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetDky` instead. @@ -624,7 +624,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumSteps` instead. @@ -640,7 +640,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetLastStep` instead. @@ -655,7 +655,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentStep` instead. @@ -670,7 +670,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentTime` instead. @@ -691,7 +691,7 @@ Main solver optional output functions as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentState` instead. @@ -710,7 +710,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetStepStats` instead. @@ -737,7 +737,7 @@ Main solver optional output functions read and output the data from a SUNDIALS CSV output file using the key and value pair format. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodePrintAllStats` instead. @@ -752,7 +752,7 @@ Main solver optional output functions :returns: The return value is a string containing the name of the corresponding constant. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetReturnFlagName` instead. @@ -767,7 +767,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumStepAttempts` instead. @@ -808,7 +808,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the ARKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetUserData` instead. @@ -840,7 +840,7 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetRootInfo` instead. @@ -856,7 +856,7 @@ Rootfinding optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNumGEvals` instead. @@ -882,7 +882,7 @@ General usability functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeWriteParameters` instead. @@ -975,6 +975,6 @@ SPRKStep reset function By default the next call to :c:func:`SPRKStepEvolve()` will use the step size computed by SPRKStep prior to calling :c:func:`SPRKStepReset()`. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeReset` instead. diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 4f37c689ca..fd9261eaa3 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -67,7 +67,7 @@ For functions to create an ARKODE stepper instance see :c:func:`ARKStepCreate`, :param arkode_mem: pointer to the ARKODE stepper memory block. :return: none - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 This function replaces stepper specific versions in ARKStep, ERKStep, MRIStep, and SPRKStep. @@ -125,7 +125,7 @@ Alternatively, the user may supply a custom function to supply the :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol) @@ -144,7 +144,7 @@ Alternatively, the user may supply a custom function to supply the :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeWFtolerances(void* arkode_mem, ARKEwtFn efun) @@ -160,7 +160,7 @@ Alternatively, the user may supply a custom function to supply the :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 Moreover, for problems involving a non-identity mass matrix @@ -214,7 +214,7 @@ these functions is provided below. :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeResVtolerance(void* arkode_mem, N_Vector rabstol) @@ -230,7 +230,7 @@ these functions is provided below. :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. :retval ARK_ILL_INPUT: an argument had an illegal value (e.g. a negative tolerance). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeResFtolerance(void* arkode_mem, ARKRwtFn rfun) @@ -246,7 +246,7 @@ these functions is provided below. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. :retval ARK_NO_MALLOC: ``arkode_mem`` was not allocated. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 General advice on the choice of tolerances @@ -480,7 +480,7 @@ pertinent to their choice of linear solver. insufficient to store :math:`\mathcal{A}` then it will need to be resized internally by ARKODE. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -596,7 +596,7 @@ Newton and mass matrix systems, these must have the same type: mass-matrix-times-vector product routine (see :c:type:`ARKLsMassTimesVecFn` and :c:func:`ARKodeSetMassTimes`). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -647,7 +647,7 @@ function attaches the nonlinear solver to the main ARKODE integrator. default; a call to this routine replaces that module with the supplied *NLS* object. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -697,7 +697,7 @@ called prior to a continuation call to :c:func:`ARKodeEvolve`. problem but the prior one did, then call *ARKodeRootInit* with *nrtfn = 0*. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -821,7 +821,7 @@ the user has set a stop time (with a call to the optional input function On all other error returns, *tret* and *yout* are left unchanged from those provided to the routine. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -912,7 +912,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Also leaves alone any data structures or options related to root-finding (those can be reset using :c:func:`ARKodeRootInit`). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetOrder(void* arkode_mem, int ord) @@ -939,7 +939,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr ARKODE memory block, it cannot be changed after the first call to :c:func:`ARKodeEvolve`, unless ``*StepReInit`` is called. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetInterpolantType(void* arkode_mem, int itype) @@ -986,14 +986,14 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr :retval ARK_ILL_INPUT: the *itype* argument is not recognized or the interpolation module has already been initialized. - .. versionchanged:: x.y.z + .. versionchanged:: 6.1.0 Added the ``ARK_INTERP_NONE`` option to disable interpolation. Values set by a previous call to :c:func:`ARKStepSetInterpolantDegree` are no longer nullified by a call to :c:func:`ARKStepSetInterpolantType`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 This function replaces stepper specific versions in ARKStep, ERKStep, MRIStep, and SPRKStep. @@ -1035,7 +1035,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr obtained by the integrator are returned at the ends of the time interval. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed) @@ -1091,7 +1091,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr routines will provide no useful information to the solver, and at worst they may interfere with the desired fixed step size. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -1119,7 +1119,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr This routine will also reset the step size and error history. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -1147,7 +1147,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr A negative value indicates that no warning messages should be issued. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -1171,7 +1171,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Passing *mxsteps* < 0 disables the test (not recommended). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax) @@ -1193,7 +1193,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin) @@ -1215,7 +1215,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Pass *hmin* :math:`\le 0.0` to set the default value of 0. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop) @@ -1242,7 +1242,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr :c:func:`ARKodeReset` will remain active but can be disabled by calling :c:func:`ARKodeClearStopTime`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp) @@ -1257,7 +1257,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeClearStopTime(void* arkode_mem) @@ -1274,7 +1274,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr The stop time can be reenabled though a new call to :c:func:`ARKodeSetStopTime`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetUserData(void* arkode_mem, void* user_data) @@ -1299,7 +1299,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr this function must be made *before* any calls to :c:func:`ARKodeSetLinearSolver` and/or :c:func:`ARKodeSetMassLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxErrTestFails(void* arkode_mem, int maxnef) @@ -1323,7 +1323,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr The default value is 7; set *maxnef* :math:`\le 0` to specify this default. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetConstraints(void* arkode_mem, N_Vector constraints) @@ -1371,7 +1371,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr and :c:func:`ARKodeSetFixedStep` are incompatible, and should not be used simultaneously. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails) @@ -1394,7 +1394,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Passing *maxfails* <= 0 results in ARKODE using the default value (10). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -1448,7 +1448,7 @@ Explicit stability function :c:func:`ARKodeSetSt This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) @@ -1474,7 +1474,7 @@ Explicit stability function :c:func:`ARKodeSetSt This should be called prior to calling :c:func:`ARKodeEvolve`, and can only be reset following a call to ``*StepReInit``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac) @@ -1497,7 +1497,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any non-positive parameter will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) @@ -1525,7 +1525,7 @@ Explicit stability function :c:func:`ARKodeSetSt :c:func:`ARKodeSetAdaptController` will be called, then this routine must be called *second*. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub) @@ -1548,7 +1548,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any interval *not* containing 1.0 will imply a reset to the default values. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf) @@ -1573,7 +1573,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf) @@ -1596,7 +1596,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value outside the interval :math:`(0,1]` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1) @@ -1620,7 +1620,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value :math:`\le 1.0` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth) @@ -1644,7 +1644,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value :math:`\le 1.0` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMinReduction(void* arkode_mem, sunrealtype eta_min) @@ -1670,7 +1670,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value outside the interval :math:`(0,1)` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetSafetyFactor(void* arkode_mem, sunrealtype safety) @@ -1694,7 +1694,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value :math:`\le 0` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetSmallNumEFails(void* arkode_mem, int small_nef) @@ -1718,7 +1718,7 @@ Explicit stability function :c:func:`ARKodeSetSt Any value :math:`\le 0` will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data) @@ -1748,7 +1748,7 @@ Explicit stability function :c:func:`ARKodeSetSt be quite useful for problems where the explicit right-hand side function :math:`f^E(t,y)` contains stiff terms. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -1816,7 +1816,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS stage. Thus one must balance the relative costs of such recomputation against the benefits of requiring only a single Newton linear solve. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNonlinear(void* arkode_mem) @@ -1841,7 +1841,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS :c:func:`ARKodeSetDeltaGammaMax` to reset the step size ratio threshold to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetAutonomous(void* arkode_mem, sunbooleantype autonomous) @@ -1893,7 +1893,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS evaluation but instead evaluate the necessary quantities within the preconditioner setup function using the input values. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetPredictorMethod(void* arkode_mem, int method) @@ -1928,7 +1928,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS The default value is 0. If *method* is set to an undefined value, this default predictor will be used. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage) @@ -1952,7 +1952,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS See :numref:`ARKODE.Usage.StagePredictFn` for more information on this user-supplied routine. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi) @@ -1981,7 +1981,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS When using a non-default nonlinear solver, this function must be called *after* :c:func:`ARKodeSetNonlinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxNonlinIters(void* arkode_mem, int maxcor) @@ -2006,7 +2006,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS The default value is 3; set *maxcor* :math:`\le 0` to specify this default. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef) @@ -2030,7 +2030,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNonlinCRDown(void* arkode_mem, sunrealtype crdown) @@ -2052,7 +2052,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS Any non-positive parameter will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv) @@ -2076,7 +2076,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS Any non-positive parameter will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) @@ -2108,7 +2108,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS convergence failure still occurs, the time step size is reduced by the factor *etacf* (set within :c:func:`ARKodeSetMaxCFailGrowth`). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetDeduceImplicitRhs(void *arkode_mem, sunbooleantype deduce) @@ -2131,7 +2131,7 @@ Specify if the implicit RHS is deduced after a nonlinear solve :c:func:`ARKodeS This is only compatible with time-stepping modules that support implicit algebraic solvers. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. _ARKODE.Usage.ARKLsInputs: @@ -2238,7 +2238,7 @@ is recomputed using the current :math:`\gamma` value. Any non-positive parameter will imply a reset to the default value. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. index:: single: optional input; linear solver setup frequency (ARKODE) @@ -2266,7 +2266,7 @@ is recomputed using the current :math:`\gamma` value. step. If **msbp** is 0, the default value of 20 will be used. A negative value forces a linear solver step at each implicit stage. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. index:: @@ -2308,7 +2308,7 @@ is recomputed using the current :math:`\gamma` value. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -2405,7 +2405,7 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsJacFn` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys) @@ -2437,7 +2437,7 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsLinSysFn` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMassFn(void* arkode_mem, ARKLsMassFn mass) @@ -2469,7 +2469,7 @@ data in the program. The user data pointer may be specified through The function type :c:func:`ARKLsMassFn` is described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff) @@ -2495,7 +2495,7 @@ data in the program. The user data pointer may be specified through Linear solution scaling is enabled by default when a matrix-based linear solver is attached. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. _ARKODE.Usage.ARKLsInputs.MatrixFree: @@ -2575,7 +2575,7 @@ time they are called. :c:type:`ARKLsJacTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 When using the internal difference quotient the user may optionally supply @@ -2619,7 +2619,7 @@ this through calls to *both* :c:func:`ARKodeSetJacTimesRhsFn` and This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 Similarly, if a problem involves a non-identity mass matrix, @@ -2676,7 +2676,7 @@ function of type :c:type:`ARKLsMassTimesSetupFn` (see :c:type:`ARKLsMassTimesVecFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -2765,7 +2765,7 @@ the user through the :c:func:`ARKodeSetEpsLin` function. :c:func:`ARKLsPrecSolveFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, ARKLsMassPrecSolveFn psolve) @@ -2802,7 +2802,7 @@ the user through the :c:func:`ARKodeSetEpsLin` function. :c:func:`ARKLsMassPrecSolveFn` are described in :numref:`ARKODE.Usage.UserSupplied`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2832,7 +2832,7 @@ the user through the :c:func:`ARKodeSetEpsLin` function. interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMassEpsLin(void* arkode_mem, sunrealtype eplifac) @@ -2862,7 +2862,7 @@ the user through the :c:func:`ARKodeSetEpsLin` function. Passing a value *eplifac* :math:`\le 0` indicates to use the default value of 0.05. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 Since iterative linear solver libraries typically consider linear residual @@ -2910,7 +2910,7 @@ allow for additional user control over these conversion factors. This function must be called *after* the ARKLS system solver interface has been initialized through a call to :c:func:`ARKodeSetLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) @@ -2943,7 +2943,7 @@ allow for additional user control over these conversion factors. This function must be called *after* the ARKLS mass matrix solver interface has been initialized through a call to :c:func:`ARKodeSetMassLinearSolver`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -2990,7 +2990,7 @@ Disable inactive root warnings :c:func:`ARKodeSetNoInactiveRootWarn` e The default behavior is to monitor for both zero-crossing directions. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetNoInactiveRootWarn(void* arkode_mem) @@ -3013,7 +3013,7 @@ Disable inactive root warnings :c:func:`ARKodeSetNoInactiveRootWarn` e first step), ARKODE will issue a warning which can be disabled with this optional input function. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -3073,7 +3073,7 @@ polynomial model may be evaluated upon request. functions :c:func:`ARKodeGetCurrentTime` and :c:func:`ARKodeGetLastStep`, respectively. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -3186,7 +3186,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps) @@ -3200,7 +3200,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetActualInitStep(void* arkode_mem, sunrealtype* hinused) @@ -3223,7 +3223,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat local error test condition, or to ensure convergence of the nonlinear solver. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast) @@ -3237,7 +3237,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) @@ -3250,7 +3250,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -3263,7 +3263,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetCurrentState(void *arkode_mem, N_Vector *ycur) @@ -3282,7 +3282,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat as altering values of *ycur* may lead to undesirable behavior, depending on the particular use case and on when this routine is called. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetCurrentGamma(void *arkode_mem, sunrealtype *gamma) @@ -3302,7 +3302,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support implicit algebraic solvers. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac) @@ -3317,7 +3317,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight) @@ -3335,7 +3335,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat The user must allocate space for *eweight*, that will be filled in by this function. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetResWeights(void* arkode_mem, N_Vector rweight) @@ -3357,7 +3357,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat The user must allocate space for *rweight*, that will be filled in by this function. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur) @@ -3374,7 +3374,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodePrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) @@ -3401,7 +3401,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat read and output the data from a SUNDIALS CSV output file using the key and value pair format. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: char* ARKodeGetReturnFlagName(long int flag) @@ -3414,7 +3414,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :return: The return value is a string containing the name of the corresponding constant. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps) @@ -3434,7 +3434,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumAccSteps(void* arkode_mem, long int* accsteps) @@ -3454,7 +3454,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumStepAttempts(void* arkode_mem, long int* step_attempts) @@ -3467,7 +3467,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) @@ -3485,7 +3485,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumStepSolveFails(void* arkode_mem, long int* ncnf) @@ -3504,7 +3504,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support implicit algebraic solvers. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetEstLocalErrors(void* arkode_mem, N_Vector ele) @@ -3535,7 +3535,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumConstrFails(void* arkode_mem, long int* nconstrfails) @@ -3554,7 +3554,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetUserData(void* arkode_mem, void** user_data) @@ -3568,7 +3568,7 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. _ARKODE.Usage.ARKodeImplicitSolverOutputs: @@ -3614,7 +3614,7 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumNonlinSolvIters(void* arkode_mem, long int* nniters) @@ -3639,7 +3639,7 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumNonlinSolvConvFails(void* arkode_mem, long int* nncfails) @@ -3663,7 +3663,7 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol solver object; the counter is reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nncfails) @@ -3688,7 +3688,7 @@ Single accessor to all nonlinear solver statistics :c:func:`ARKodeGetNonlinSol solver object; the counters are reset whenever a new nonlinear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. _ARKODE.Usage.ARKodeRootOutputs: @@ -3733,7 +3733,7 @@ No. of calls to user root function :c:func:`ARKodeGetNumGEvals zero-crossing. A value of +1 indicates that :math:`g_i` is increasing, while a value of -1 indicates a decreasing :math:`g_i`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals) @@ -3747,7 +3747,7 @@ No. of calls to user root function :c:func:`ARKodeGetNumGEvals :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -3820,7 +3820,7 @@ Last return from a mass matrix solver function :c:func:`ARKo This function is provided for debugging purposes and the values in the returned matrix should not be altered. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetJacTime(void* arkode_mem, sunrealtype* t_J) @@ -3860,7 +3860,7 @@ Last return from a mass matrix solver function :c:func:`ARKo This is only compatible with time-stepping modules that support implicit algebraic solvers. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, long int* leniwLS) @@ -3890,7 +3890,7 @@ Last return from a mass matrix solver function :c:func:`ARKo In a parallel setting, the above values are global (i.e. summed over all processors). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumJacEvals(void* arkode_mem, long int* njevals) @@ -3914,7 +3914,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumPrecEvals(void* arkode_mem, long int* npevals) @@ -3940,7 +3940,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumPrecSolves(void* arkode_mem, long int* npsolves) @@ -3965,7 +3965,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumLinIters(void* arkode_mem, long int* nliters) @@ -3989,7 +3989,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumLinConvFails(void* arkode_mem, long int* nlcfails) @@ -4013,7 +4013,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumJTSetupEvals(void* arkode_mem, long int* njtsetup) @@ -4038,7 +4038,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumJtimesEvals(void* arkode_mem, long int* njvevals) @@ -4063,7 +4063,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS) @@ -4093,7 +4093,7 @@ Last return from a mass matrix solver function :c:func:`ARKo solver object; the counter is reset whenever a new linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetLastLinFlag(void* arkode_mem, long int* lsflag) @@ -4149,7 +4149,7 @@ Last return from a mass matrix solver function :c:func:`ARKo *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in an external iterative linear solver package. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: char* ARKodeGetLinReturnFlagName(long int lsflag) @@ -4168,7 +4168,7 @@ Last return from a mass matrix solver function :c:func:`ARKo This is only compatible with time-stepping modules that support implicit algebraic solvers. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, long int* leniwMLS) @@ -4198,7 +4198,7 @@ Last return from a mass matrix solver function :c:func:`ARKo In a parallel setting, the above values are global (i.e. summed over all processors). - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassSetups(void* arkode_mem, long int* nmsetups) @@ -4225,7 +4225,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups) @@ -4251,7 +4251,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassMult(void* arkode_mem, long int* nmmults) @@ -4278,7 +4278,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassSolves(void* arkode_mem, long int* nmsolves) @@ -4303,7 +4303,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals) @@ -4329,7 +4329,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves) @@ -4355,7 +4355,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassIters(void* arkode_mem, long int* nmiters) @@ -4380,7 +4380,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMassConvFails(void* arkode_mem, long int* nmcfails) @@ -4405,7 +4405,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetNumMTSetups(void* arkode_mem, long int* nmtsetup) @@ -4431,7 +4431,7 @@ Last return from a mass matrix solver function :c:func:`ARKo linear solver module is "attached" to ARKODE, or when ARKODE is resized. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 .. c:function:: int ARKodeGetLastMassFlag(void* arkode_mem, long int* mlsflag) @@ -4456,7 +4456,7 @@ Last return from a mass matrix solver function :c:func:`ARKo will match those described above for the function :c:func:`ARKodeGetLastLinFlag`. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -4502,7 +4502,7 @@ Output all ARKODE solver parameters :c:func:`ARKodeWriteParameters` for this pointer, since parameters for all processes would be identical. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -4576,7 +4576,7 @@ vector. If an error occurred, :c:func:`ARKodeReset` also sends an error message to the error handler function. - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 @@ -4684,4 +4684,4 @@ rescale the upcoming time step by the specified factor. If a value * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` - .. versionadded:: x.y.z + .. versionadded:: 6.1.0 diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index fe7f768419..92046f510c 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -226,7 +226,7 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetCurrentMassMatrix` instead. @@ -290,7 +290,7 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`ARKStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNonlinearSystemData` instead. @@ -310,7 +310,7 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the ARKStep memory was ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeComputeState` instead. @@ -393,7 +393,7 @@ of user-supplied SUNNonlinSol modules are as follows. *Fi* are only current when :c:func:`MRIStepGetNonlinearSystemData()` is called after an evaluation of the nonlinear system function. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeGetNonlinearSystemData` instead. @@ -413,6 +413,6 @@ of user-supplied SUNNonlinSol modules are as follows. * ``ARK_SUCCESS`` if successful. * ``ARK_MEM_NULL`` if the MRIStep memory was ``NULL``. - .. deprecated:: x.y.z + .. deprecated:: 6.1.0 Use :c:func:`ARKodeComputeState` instead. diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index c0025d1f07..651efba809 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -108,7 +108,7 @@ implementations. .. efficiency of C, and the greater ease of interfacing the solver to .. applications written in extended Fortran. -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 55ea22f2cd..fbf0685067 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -109,7 +109,7 @@ greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 19dfc9a9d3..029b9a3523 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -69,7 +69,7 @@ systems. the greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index a67642229c..771da6ec5b 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -83,7 +83,7 @@ integrate any final-condition ODE dependent on the solution of the original IVP the greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 6.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 6961e9da38..5dd8e82594 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -85,7 +85,7 @@ applications written in Fortran. .. _KINSOL.Introduction.Changes: -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 136e910f4a..4fa304b8ac 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,7 +21,7 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.0 ==================================== .. include:: RecentChanges_link.rst diff --git a/doc/shared/History.rst b/doc/shared/History.rst index cfdee0c931..b5c79886e3 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -21,6 +21,8 @@ Release History +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Date | SUNDIALS | ARKODE | CVODE | CVODES | IDA | IDAS | KINSOL | +==========+===================+===================+===================+===================+===================+===================+===================+ +| Jun 2024 | 7.1.0 | 6.1.0 | 7.1.0 | 7.1.0 | 7.1.0 | 6.1.0 | 7.1.0 | ++----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Feb 2024 | 7.0.0 | 6.0.0 | 7.0.0 | 7.0.0 | 7.0.0 | 6.0.0 | 7.0.0 | +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Dec 2023 | 6.7.0 | 5.7.0 | 6.7.0 | 6.7.0 | 6.7.0 | 5.7.0 | 6.7.0 | diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index b4b5cf0343..afa6de0c0d 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -27,7 +27,7 @@ % @techreport{arkode_ug, author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Rujeko Chinomona and Cody J. Balos}, -title = {{User Documentation for ARKODE v6.0.0}}, +title = {{User Documentation for ARKODE v6.1.0}}, institution = {LLNL}, number = {LLNL-SM-668082}, year = 2024 @@ -37,7 +37,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author = {Daniel R. Reynolds}, -title = {{Example Programs for ARKODE v6.0.0}}, +title = {{Example Programs for ARKODE v6.1.0}}, institution = {Southern Methodist University}, year = 2024 } @@ -46,7 +46,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODE v7.0.0}}, +title = {{User Documentation for CVODE v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208108}, year = 2024 @@ -56,7 +56,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author = {Alan C. Hindmarsh and Radu Serban}, -title = {{Example Programs for CVODE v7.0.0}}, +title = {{Example Programs for CVODE v7.1.0}}, institution = {LLNL}, note = {UCRL-SM-208110}, year = 2024 @@ -66,7 +66,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODES v7.0.0}}, +title = {{User Documentation for CVODES v7.1.0}}, institution = {LLNL}, note = {UCRL-SM-208111}, year = 2024 @@ -76,7 +76,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for CVODES v7.0.0}}, +title = {{Example Programs for CVODES v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208115}, year = 2024 @@ -86,7 +86,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDA v7.0.0}}, +title = {{User Documentation for IDA v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208112}, year = 2024 @@ -96,7 +96,7 @@ @techreport{ida_ug % @techreport{ida_ex, author = {Alan C. Hindmarsh and Radu Serban and Aaron Collier}, -title = {{Example Programs for IDA v7.0.0}}, +title = {{Example Programs for IDA v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208113}, year = 2024 @@ -106,7 +106,7 @@ @techreport{ida_ex % @techreport{idas_ug, author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDAS v6.0.0}}, +title = {{User Documentation for IDAS v6.1.0}}, institution = {LLNL}, number = {UCRL-SM-234051}, year = 2024 @@ -116,7 +116,7 @@ @techreport{idas_ug % @techreport{idas_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for IDAS v6.0.0}}, +title = {{Example Programs for IDAS v6.1.0}}, institution = {LLNL}, number = {LLNL-TR-437091}, year = 2024 @@ -126,7 +126,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for KINSOL v7.0.0}}, +title = {{User Documentation for KINSOL v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208116}, year = 2024 @@ -136,7 +136,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author = {Aaron M. Collier and Radu Serban}, -title = {{Example Programs for KINSOL v7.0.0}}, +title = {{Example Programs for KINSOL v7.1.0}}, institution = {LLNL}, number = {UCRL-SM-208114}, year = 2024 diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index fbb6fdc0c4..97a5b80ba8 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -164,7 +164,7 @@ equivalencies with the parameter direction in mind. Currently, the Fortran 2003 interfaces are only compatible with SUNDIALS builds where the ``sunrealtype`` is double-precision. -.. versionchanged:: x.y.z +.. versionchanged:: 7.1.0 The Fortran interfaces can now be built with 32-bit ``sunindextype`` in addition to 64-bit ``sunindextype``. diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index bf63423eb5..d666fc7b29 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -33,17 +33,17 @@ SUNDIALS release compressed archives (``.tar.gz``) from the SUNDIALS The compressed archives allow for downloading of indvidual SUNDIALS packages. The name of the distribution archive is of the form -``SOLVER-X.Y.Z.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, -``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``X.Y.Z`` +``SOLVER-7.1.0.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, +``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``7.1.0`` represents the version number (of the SUNDIALS suite or of the individual solver). After downloading the relevant archives, uncompress and expand the sources, by running .. code-block:: bash - % tar -zxf SOLVER-X.Y.Z.tar.gz + % tar -zxf SOLVER-7.1.0.tar.gz -This will extract source files under a directory ``SOLVER-X.Y.Z``. +This will extract source files under a directory ``SOLVER-7.1.0``. Starting with version 2.6.0 of SUNDIALS, CMake is the only supported method of installation. The explanations of the installation procedure begin with a few @@ -51,7 +51,7 @@ common observations: #. The remainder of this chapter will follow these conventions: - ``SOLVERDIR`` is the directory ``SOLVER-X.Y.Z`` created above; i.e. the + ``SOLVERDIR`` is the directory ``SOLVER-7.1.0`` created above; i.e. the directory containing the SUNDIALS sources. ``BUILDDIR`` is the (temporary) directory under which SUNDIALS is built. @@ -674,7 +674,7 @@ illustration only. Default: "REF;OMP" - .. versionchanged: x.y.z + .. versionchanged: 7.1.0 The ``DPCPP`` option was changed to ``SYCL`` to align with Ginkgo's naming convention. @@ -1790,7 +1790,7 @@ configuration file to build against SUNDIALS in their own CMake project. .. note:: - .. versionchanged:: x.y.z + .. versionchanged:: 7.1.0 A single version provided to ``find_package`` denotes the minimum version of SUNDIALS to look for, and any version equal or newer than what is diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py index b72f632920..dca40a56f2 100644 --- a/doc/shared/sundials_vars.py +++ b/doc/shared/sundials_vars.py @@ -9,14 +9,14 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -doc_version = 'develop' -sundials_version = 'v7.0.0' -arkode_version = 'v6.0.0' -cvode_version = 'v7.0.0' -cvodes_version = 'v7.0.0' -ida_version = 'v7.0.0' -idas_version = 'v6.0.0' -kinsol_version = 'v7.0.0' +doc_version = 'v7.1.0' +sundials_version = 'v7.1.0' +arkode_version = 'v6.1.0' +cvode_version = 'v7.1.0' +cvodes_version = 'v7.1.0' +ida_version = 'v7.1.0' +idas_version = 'v6.1.0' +kinsol_version = 'v7.1.0' year = '2024' # Warn about all references where the target cannot be found diff --git a/doc/sundials/biblio.bib b/doc/sundials/biblio.bib index ad0b7f6bec..b0470d62e6 100644 --- a/doc/sundials/biblio.bib +++ b/doc/sundials/biblio.bib @@ -16,7 +16,7 @@ @techreport{arkode_ug, author={Daniel R. Reynolds and David J. Gardner and Alan C. Hindmarsh and Carol S. Woodward and Jean M. Sexton}, -title={{User Documentation for ARKODE v6.0.0}}, +title={{User Documentation for ARKODE v6.1.0}}, institution={LLNL}, number={LLNL-SM-668082}, year = 2024 @@ -26,7 +26,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author={Daniel R. Reynolds}, -title={{Example Programs for ARKODE v6.0.0}}, +title={{Example Programs for ARKODE v6.1.0}}, institution={Southern Methodist University}, year = 2024 } @@ -35,7 +35,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODE v7.0.0}}, +title={{User Documentation for CVODE v7.1.0}}, institution={LLNL}, number={UCRL-SM-208108}, year = 2024 @@ -45,7 +45,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author={A. C. Hindmarsh and R. Serban and D. R. Reynolds}, -title={{Example Programs for CVODE v7.0.0}}, +title={{Example Programs for CVODE v7.1.0}}, institution={LLNL}, note={UCRL-SM-208110}, year = 2024 @@ -55,7 +55,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODES v7.0.0}}, +title={{User Documentation for CVODES v7.1.0}}, institution={LLNL}, note={UCRL-SM-208111}, year = 2024 @@ -65,7 +65,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for CVODES v7.0.0}}, +title={{Example Programs for CVODES v7.1.0}}, institution={LLNL}, number={UCRL-SM-208115}, year = 2024 @@ -75,7 +75,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{User Documentation for IDA v7.0.0}}, +title={{User Documentation for IDA v7.1.0}}, institution={LLNL}, number={UCRL-SM-208112}, year = 2024 @@ -85,7 +85,7 @@ @techreport{ida_ug % @techreport{ida_ex, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{Example Programs for IDA v7.0.0}}, +title={{Example Programs for IDA v7.1.0}}, institution={LLNL}, number={UCRL-SM-208113}, year = 2024 @@ -95,7 +95,7 @@ @techreport{ida_ex % @techreport{idas_ug, author={R. Serban and C. Petra and A. C. Hindmarsh}, -title={{User Documentation for IDAS v6.0.0}}, +title={{User Documentation for IDAS v6.1.0}}, institution={LLNL}, number={UCRL-SM-234051}, year = 2024 @@ -105,7 +105,7 @@ @techreport{idas_ug % @techreport{idas_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for IDAS v6.0.0}}, +title={{Example Programs for IDAS v6.1.0}}, institution={LLNL}, number={LLNL-TR-437091}, year = 2024 @@ -115,7 +115,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author={A. M. Collier and A. C. Hindmarsh and R. Serban and C.S. Woodward}, -title={{User Documentation for KINSOL v7.0.0}}, +title={{User Documentation for KINSOL v7.1.0}}, institution={LLNL}, number={UCRL-SM-208116}, year = 2024 @@ -125,7 +125,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author={A. M. Collier and R. Serban}, -title={{Example Programs for KINSOL v7.0.0}}, +title={{Example Programs for KINSOL v7.1.0}}, institution={LLNL}, number={UCRL-SM-208114}, year = 2024 diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index 26724bb6ab..721acd879d 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -59,29 +59,29 @@ %----- VERSIONS AND UCRL NUMBERS OF SUNDIALS CODES -\newcommand{\sunrelease}{v7.0.0} +\newcommand{\sunrelease}{v7.1.0} -\newcommand{\cvrelease}{v7.0.0} +\newcommand{\cvrelease}{v7.1.0} \newcommand{\cvucrlug}{UCRL-SM-208108} \newcommand{\cvucrlex}{UCRL-SM-208110} -\newcommand{\cvsrelease}{v7.0.0} +\newcommand{\cvsrelease}{v7.1.0} \newcommand{\cvsucrlug}{UCRL-SM-208111} \newcommand{\cvsucrlex}{UCRL-SM-208115} -\newcommand{\idarelease}{v7.0.0} +\newcommand{\idarelease}{v7.1.0} \newcommand{\idaucrlug}{UCRL-SM-208112} \newcommand{\idaucrlex}{UCRL-SM-208113} -\newcommand{\idasrelease}{v6.0.0} +\newcommand{\idasrelease}{v6.1.0} \newcommand{\idasucrlug}{UCRL-SM-234051} \newcommand{\idasucrlex}{LLNL-TR-437091} -\newcommand{\kinrelease}{v7.0.0} +\newcommand{\kinrelease}{v7.1.0} \newcommand{\kinucrlug}{UCRL-SM-208116} \newcommand{\kinucrlex}{UCRL-SM-208114} -\newcommand{\arkrelease}{v6.0.0} +\newcommand{\arkrelease}{v6.1.0} \newcommand{\arkucrlug}{LLNL-SM-668082} \newcommand{\arkucrlex}{????-??-??????} diff --git a/scripts/tarscript b/scripts/tarscript index 8b64d9dd16..642dec13aa 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -57,13 +57,13 @@ function print_usage # VERSION NUMBERS #--------------------------------------------------------- -SUN_VER="7.0.0" -CV_VER="7.0.0" -CVS_VER="7.0.0" -IDA_VER="7.0.0" -IDAS_VER="6.0.0" -KIN_VER="7.0.0" -ARK_VER="6.0.0" +SUN_VER="7.1.0" +CV_VER="7.1.0" +CVS_VER="7.1.0" +IDA_VER="7.1.0" +IDAS_VER="6.1.0" +KIN_VER="7.1.0" +ARK_VER="6.1.0" #--------------------------------------------------------- # Test if the script is executed from within its directory diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index 30cc9b9147..e91e846bde 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -19,7 +19,7 @@ # development releases the label string is of the form "-dev.#" and for full # releases the label string is "". sun_major=${1:-7} -sun_minor=${2:-0} +sun_minor=${2:-1} sun_patch=${3:-0} sun_label=${4:-""} month=${5:-$(date +"%b")} diff --git a/src/arkode/README.md b/src/arkode/README.md index fd825b9dbb..d71f6b43ef 100644 --- a/src/arkode/README.md +++ b/src/arkode/README.md @@ -1,5 +1,5 @@ # ARKODE -### Version 6.0.0 (Feb 2024) +### Version 6.1.0 (Jun 2024) **Daniel R. Reynolds, Department of Mathematics, SMU** @@ -44,8 +44,8 @@ the "SUNDIALS Release History" appendix of the ARKODE User Guide. ## References * D. R. Reynolds, D. J. Gardner, C. S. Woodward, and C. J. Balos, - "User Documentation for ARKODE v6.0.0," LLNL technical report - LLNL-SM-668082, Feb 2024. + "User Documentation for ARKODE v6.1.0," LLNL technical report + LLNL-SM-668082, Jun 2024. -* D. R. Reynolds, "Example Programs for ARKODE v6.0.0," Technical Report, - Southern Methodist University Center for Scientific Computation, Feb 2024. +* D. R. Reynolds, "Example Programs for ARKODE v6.1.0," Technical Report, + Southern Methodist University Center for Scientific Computation, Jun 2024. diff --git a/src/cvode/README.md b/src/cvode/README.md index fbc0a5e9d4..7e17d2a68c 100644 --- a/src/cvode/README.md +++ b/src/cvode/README.md @@ -1,5 +1,5 @@ # CVODE -### Version 7.0.0 (Feb 2024) +### Version 7.1.0 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the CVODE User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODE v7.0.0," - LLNL technical report UCRL-SM-208108, Feb 2024. + and C. S. Woodward, "User Documentation for CVODE v7.1.0," + LLNL technical report UCRL-SM-208108, Jun 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.0.0," - LLNL technical report UCRL-SM-208110, Feb 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.1.0," + LLNL technical report UCRL-SM-208110, Jun 2024. * S.D. Cohen and A.C. Hindmarsh, "CVODE, a Stiff/nonstiff ODE Solver in C," Computers in Physics, 10(2), pp. 138-143, 1996. diff --git a/src/cvodes/README.md b/src/cvodes/README.md index a5cf70488b..8e4259efdd 100644 --- a/src/cvodes/README.md +++ b/src/cvodes/README.md @@ -1,5 +1,5 @@ # CVODES -### Version 7.0.0 (Feb 2024) +### Version 7.1.0 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -44,11 +44,11 @@ the "SUNDIALS Release History" appendix of the CVODES User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODES v7.0.0," - LLNL technical report UCRL-SM-208111, Feb 2024. + and C. S. Woodward, "User Documentation for CVODES v7.1.0," + LLNL technical report UCRL-SM-208111, Jun 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.0.0," - LLNL technical report UCRL-SM-208115, Feb 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.1.0," + LLNL technical report UCRL-SM-208115, Jun 2024. * R. Serban and A. C. Hindmarsh, "CVODES: the Sensitivity-Enabled ODE solver in SUNDIALS," Proceedings of IDETC/CIE 2005, Sept. 2005, diff --git a/src/ida/README.md b/src/ida/README.md index 325acccc19..086ea1c262 100644 --- a/src/ida/README.md +++ b/src/ida/README.md @@ -1,5 +1,5 @@ # IDA -### Version 7.0.0 (Feb 2024) +### Version 7.1.0 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the IDA User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for IDA v7.0.0," - LLNL technical report UCRL-SM-208112, Feb 2024. + and C. S. Woodward, "User Documentation for IDA v7.1.0," + LLNL technical report UCRL-SM-208112, Jun 2024. -* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.0.0," - LLNL technical report UCRL-SM-208113, Feb 2024. +* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.1.0," + LLNL technical report UCRL-SM-208113, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/idas/README.md b/src/idas/README.md index 7fd2909139..0b34eb22e7 100644 --- a/src/idas/README.md +++ b/src/idas/README.md @@ -1,5 +1,5 @@ # IDAS -### Version 6.0.0 (Feb 2024) +### Version 6.1.0 (Jun 2024) **Radu Serban, Cosmin Petra, Alan C. Hindmarsh, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -43,11 +43,11 @@ the "SUNDIALS Release History" appendix of the IDAS User Guide. ## References * R. Serban, C. Petra, A. C. Hindmarsh, C. J. Balos, D. J. Gardner, - D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.0.0," - LLNL technical report UCRL-SM-234051, Feb 2024. + D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.1.0," + LLNL technical report UCRL-SM-234051, Jun 2024. -* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.0.0," - LLNL technical report LLNL-TR-437091, Feb 2024. +* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.1.0," + LLNL technical report LLNL-TR-437091, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/kinsol/README.md b/src/kinsol/README.md index 6433b7c77b..84678f7713 100644 --- a/src/kinsol/README.md +++ b/src/kinsol/README.md @@ -1,5 +1,5 @@ # KINSOL -### Version 7.0.0 (Feb 2024) +### Version 7.1.0 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -48,11 +48,11 @@ the "SUNDIALS Release History" appendix of the KINSOL User Guide. * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds and C. S. Woodward, - "User Documentation for KINSOL v7.0.0," LLNL technical report - UCRL-SM-208116, Feb 2024. + "User Documentation for KINSOL v7.1.0," LLNL technical report + UCRL-SM-208116, Jun 2024. -* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.0.0," - LLNL technical report UCRL-SM-208114, Feb 2024. +* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.1.0," + LLNL technical report UCRL-SM-208114, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and From a8f454ae25153df98b4b63690da5520a692c8a88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:01:21 -0700 Subject: [PATCH 070/137] Build(deps): Bump docker/build-push-action from 3.0.0 to 6.0.2 (#516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.0.0 to 6.0.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/docker/build-push-action/releases">docker/build-push-action's releases</a>.</em></p> <blockquote> <h2>v6.0.2</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.26.1 to 0.26.2 in <a href="https://redirect.github.com/docker/build-push-action/pull/1147">docker/build-push-action#1147</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v6.0.1...v6.0.2">https://github.com/docker/build-push-action/compare/v6.0.1...v6.0.2</a></p> <h2>v6.0.1</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.26.0 to 0.26.1 in <a href="https://redirect.github.com/docker/build-push-action/pull/1142">docker/build-push-action#1142</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v6.0.0...v6.0.1">https://github.com/docker/build-push-action/compare/v6.0.0...v6.0.1</a></p> <h2>v6.0.0</h2> <ul> <li>Export build record and generate <a href="https://docs.docker.com/build/ci/github-actions/build-summary/">build summary</a> by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1120">docker/build-push-action#1120</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.24.0 to 0.26.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1132">docker/build-push-action#1132</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1136">docker/build-push-action#1136</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1138">docker/build-push-action#1138</a></li> <li>Bump braces from 3.0.2 to 3.0.3 in <a href="https://redirect.github.com/docker/build-push-action/pull/1137">docker/build-push-action#1137</a></li> </ul> <blockquote> <p>[!NOTE] This major release adds support for generating <a href="https://docs.docker.com/build/ci/github-actions/build-summary/">Build summary</a> and exporting build record for your build. You can disable this feature by setting <a href="https://docs.docker.com/build/ci/github-actions/build-summary/#disable-job-summary"> <code>DOCKER_BUILD_NO_SUMMARY: true</code> environment variable in your workflow</a>.</p> </blockquote> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v5.4.0...v6.0.0">https://github.com/docker/build-push-action/compare/v5.4.0...v6.0.0</a></p> <h2>v5.4.0</h2> <ul> <li>Show builder information before building by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1128">docker/build-push-action#1128</a></li> <li>Handle attestations correctly with provenance and sbom inputs by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1086">docker/build-push-action#1086</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.19.0 to 0.24.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1088">docker/build-push-action#1088</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1105">docker/build-push-action#1105</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1121">docker/build-push-action#1121</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1127">docker/build-push-action#1127</a></li> <li>Bump undici from 5.28.3 to 5.28.4 in <a href="https://redirect.github.com/docker/build-push-action/pull/1090">docker/build-push-action#1090</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v5.3.0...v5.4.0">https://github.com/docker/build-push-action/compare/v5.3.0...v5.4.0</a></p> <h2>v5.3.0</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.18.0 to 0.19.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1080">docker/build-push-action#1080</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v5.2.0...v5.3.0">https://github.com/docker/build-push-action/compare/v5.2.0...v5.3.0</a></p> <h2>v5.2.0</h2> <ul> <li>Disable quotes detection for <code>outputs</code> input by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1074">docker/build-push-action#1074</a></li> <li>Warn about ignored inputs by <a href="https://github.com/favonia"><code>@​favonia</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1019">docker/build-push-action#1019</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.14.0 to 0.18.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1070">docker/build-push-action#1070</a></li> <li>Bump undici from 5.26.3 to 5.28.3 in <a href="https://redirect.github.com/docker/build-push-action/pull/1057">docker/build-push-action#1057</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v5.1.0...v5.2.0">https://github.com/docker/build-push-action/compare/v5.1.0...v5.2.0</a></p> <h2>v5.1.0</h2> <ul> <li>Add <code>annotations</code> input by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/992">docker/build-push-action#992</a></li> <li>Add <code>secret-envs</code> input by <a href="https://github.com/elias-lundgren"><code>@​elias-lundgren</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/980">docker/build-push-action#980</a></li> <li>Bump <code>@​babel/traverse</code> from 7.17.3 to 7.23.2 in <a href="https://redirect.github.com/docker/build-push-action/pull/991">docker/build-push-action#991</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.13.0-rc.1 to 0.14.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/990">docker/build-push-action#990</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1006">docker/build-push-action#1006</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0">https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0</a></p> <h2>v5.0.0</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/docker/build-push-action/commit/f6010ea70151369b06f0194be1051fbbdff851b2"><code>f6010ea</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1147">#1147</a> from docker/dependabot/npm_and_yarn/docker/actions-t...</li> <li><a href="https://github.com/docker/build-push-action/commit/c0a6b9680fb13e0dc73747f7da2bb27d9f5a3beb"><code>c0a6b96</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/build-push-action/commit/0dfe9c3d416a6cc790f37ce7704bbab23e3442db"><code>0dfe9c3</code></a> chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.26.1 to 0.26.2</li> <li><a href="https://github.com/docker/build-push-action/commit/94f8f8c2eec4bc3f1d78c1755580779804cb87b2"><code>94f8f8c</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1142">#1142</a> from docker/dependabot/npm_and_yarn/docker/actions-t...</li> <li><a href="https://github.com/docker/build-push-action/commit/22f4433c588020040c09698d8998964f307cd95b"><code>22f4433</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/build-push-action/commit/6721c56015505c8bc8e7087fae9263d32715d7a3"><code>6721c56</code></a> chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.26.0 to 0.26.1</li> <li><a href="https://github.com/docker/build-push-action/commit/4367da978b557b70738a51fed31c93e6a240dfb3"><code>4367da9</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1140">#1140</a> from docker/dependabot/github_actions/docker/bake-ac...</li> <li><a href="https://github.com/docker/build-push-action/commit/0883ebe52d7ef25613a16c4f21be4ac1222aca4e"><code>0883ebe</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1139">#1139</a> from crazy-max/bump-major</li> <li><a href="https://github.com/docker/build-push-action/commit/76e5c2d6eae6ce377c2978efbaf0388f84e2cbee"><code>76e5c2d</code></a> chore(deps): Bump docker/bake-action from 4 to 5</li> <li><a href="https://github.com/docker/build-push-action/commit/29d67824d88073a7459e58c296a3b10206f3a906"><code>29d6782</code></a> docs: bump actions to latest major</li> <li>Additional commits viewable in <a href="https://github.com/docker/build-push-action/compare/v3.0.0...v6.0.2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=3.0.0&new-version=6.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index 16bd3c73eb..4a8316a18a 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -26,7 +26,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v3.0.0 + uses: docker/build-push-action@v6.0.2 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -56,7 +56,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v3.0.0 + uses: docker/build-push-action@v6.0.2 with: context: "./docker/sundials-ci/e4s-quarterly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index d61b14d5a2..431612223a 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -32,7 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v3.0.0 + uses: docker/build-push-action@v6.0.2 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml From a3eba40092663c5a57e09d74a3a0b6f5516b81c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:01:45 -0700 Subject: [PATCH 071/137] Build(deps): Bump actions/checkout from 3 to 4 (#515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update default runtime to node20 by <a href="https://github.com/takost"><code>@​takost</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li> <li>Support fetching without the --progress option by <a href="https://github.com/simonbaird"><code>@​simonbaird</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li> <li>Release 4.0.0 by <a href="https://github.com/takost"><code>@​takost</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1447">actions/checkout#1447</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/takost"><code>@​takost</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li> <li><a href="https://github.com/simonbaird"><code>@​simonbaird</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3...v4.0.0">https://github.com/actions/checkout/compare/v3...v4.0.0</a></p> <h2>v3.6.0</h2> <h2>What's Changed</h2> <ul> <li>Mark test scripts with Bash'isms to be run via Bash by <a href="https://github.com/dscho"><code>@​dscho</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1377">actions/checkout#1377</a></li> <li>Add option to fetch tags even if fetch-depth > 0 by <a href="https://github.com/RobertWieczoreck"><code>@​RobertWieczoreck</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li> <li>Release 3.6.0 by <a href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/RobertWieczoreck"><code>@​RobertWieczoreck</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li> <li><a href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3.5.3...v3.6.0">https://github.com/actions/checkout/compare/v3.5.3...v3.6.0</a></p> <h2>v3.5.3</h2> <h2>What's Changed</h2> <ul> <li>Fix: Checkout Issue in self hosted runner due to faulty submodule check-ins by <a href="https://github.com/megamanics"><code>@​megamanics</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li> <li>Fix typos found by codespell by <a href="https://github.com/DimitriPapadopoulos"><code>@​DimitriPapadopoulos</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li> <li>Add support for sparse checkouts by <a href="https://github.com/dscho"><code>@​dscho</code></a> and <a href="https://github.com/dfdez"><code>@​dfdez</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li> <li>Release v3.5.3 by <a href="https://github.com/TingluoHuang"><code>@​TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1376">actions/checkout#1376</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/megamanics"><code>@​megamanics</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li> <li><a href="https://github.com/DimitriPapadopoulos"><code>@​DimitriPapadopoulos</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li> <li><a href="https://github.com/dfdez"><code>@​dfdez</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3...v3.5.3">https://github.com/actions/checkout/compare/v3...v3.5.3</a></p> <h2>v3.5.2</h2> <h2>What's Changed</h2> <ul> <li>Fix: Use correct API url / endpoint in GHES by <a href="https://github.com/fhammerl"><code>@​fhammerl</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1289">actions/checkout#1289</a> based on <a href="https://redirect.github.com/actions/checkout/issues/1286">#1286</a> by <a href="https://github.com/1newsr"><code>@​1newsr</code></a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v3.5.1...v3.5.2">https://github.com/actions/checkout/compare/v3.5.1...v3.5.2</a></p> <h2>v3.5.1</h2> <h2>What's Changed</h2> <ul> <li>Improve checkout performance on Windows runners by upgrading <code>@​actions/github</code> dependency by <a href="https://github.com/BrettDong"><code>@​BrettDong</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/BrettDong"><code>@​BrettDong</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v4.1.7</h2> <ul> <li>Bump the minor-npm-dependencies group across 1 directory with 4 updates by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li> <li>Bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li> <li>Check out other refs/* by commit by <a href="https://github.com/orhantoy"><code>@​orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li> <li>Pin actions/checkout's own workflows to a known, good, stable version. by <a href="https://github.com/jww3"><code>@​jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li> </ul> <h2>v4.1.6</h2> <ul> <li>Check platform to set archive extension appropriately by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li> </ul> <h2>v4.1.5</h2> <ul> <li>Update NPM dependencies by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1703">actions/checkout#1703</a></li> <li>Bump github/codeql-action from 2 to 3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1694">actions/checkout#1694</a></li> <li>Bump actions/setup-node from 1 to 4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1696">actions/checkout#1696</a></li> <li>Bump actions/upload-artifact from 2 to 4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1695">actions/checkout#1695</a></li> <li>README: Suggest <code>user.email</code> to be <code>41898282+github-actions[bot]@users.noreply.github.com</code> by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1707">actions/checkout#1707</a></li> </ul> <h2>v4.1.4</h2> <ul> <li>Disable <code>extensions.worktreeConfig</code> when disabling <code>sparse-checkout</code> by <a href="https://github.com/jww3"><code>@​jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1692">actions/checkout#1692</a></li> <li>Add dependabot config by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1688">actions/checkout#1688</a></li> <li>Bump the minor-actions-dependencies group with 2 updates by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1693">actions/checkout#1693</a></li> <li>Bump word-wrap from 1.2.3 to 1.2.5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1643">actions/checkout#1643</a></li> </ul> <h2>v4.1.3</h2> <ul> <li>Check git version before attempting to disable <code>sparse-checkout</code> by <a href="https://github.com/jww3"><code>@​jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1656">actions/checkout#1656</a></li> <li>Add SSH user parameter by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1685">actions/checkout#1685</a></li> <li>Update <code>actions/checkout</code> version in <code>update-main-version.yml</code> by <a href="https://github.com/jww3"><code>@​jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1650">actions/checkout#1650</a></li> </ul> <h2>v4.1.2</h2> <ul> <li>Fix: Disable sparse checkout whenever <code>sparse-checkout</code> option is not present <a href="https://github.com/dscho"><code>@​dscho</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1598">actions/checkout#1598</a></li> </ul> <h2>v4.1.1</h2> <ul> <li>Correct link to GitHub Docs by <a href="https://github.com/peterbe"><code>@​peterbe</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1511">actions/checkout#1511</a></li> <li>Link to release page from what's new section by <a href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1514">actions/checkout#1514</a></li> </ul> <h2>v4.1.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1396">Add support for partial checkout filters</a></li> </ul> <h2>v4.0.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1067">Support fetching without the --progress option</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1436">Update to node20</a></li> </ul> <h2>v3.6.0</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1377">Fix: Mark test scripts with Bash'isms to be run via Bash</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/579">Add option to fetch tags even if fetch-depth > 0</a></li> </ul> <h2>v3.5.3</h2> <ul> <li><a href="https://redirect.github.com/actions/checkout/pull/1196">Fix: Checkout fail in self-hosted runners when faulty submodule are checked-in</a></li> <li><a href="https://redirect.github.com/actions/checkout/pull/1287">Fix typos found by codespell</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/692973e3d937129bcbf40652eb9f2f61becf3332"><code>692973e</code></a> Prepare 4.1.7 release (<a href="https://redirect.github.com/actions/checkout/issues/1775">#1775</a>)</li> <li><a href="https://github.com/actions/checkout/commit/6ccd57f4c5d15bdc2fef309bd9fb6cc9db2ef1c6"><code>6ccd57f</code></a> Pin actions/checkout's own workflows to a known, good, stable version. (<a href="https://redirect.github.com/actions/checkout/issues/1776">#1776</a>)</li> <li><a href="https://github.com/actions/checkout/commit/b17fe1e4d59a9d1d95a7aead5e6fcd13e50939a5"><code>b17fe1e</code></a> Handle hidden refs (<a href="https://redirect.github.com/actions/checkout/issues/1774">#1774</a>)</li> <li><a href="https://github.com/actions/checkout/commit/b80ff79f1755d06ba70441c368a6fe801f5f3a62"><code>b80ff79</code></a> Bump actions/checkout from 3 to 4 (<a href="https://redirect.github.com/actions/checkout/issues/1697">#1697</a>)</li> <li><a href="https://github.com/actions/checkout/commit/b1ec3021b8fa02164da82ca1557d017d83b0e179"><code>b1ec302</code></a> Bump the minor-npm-dependencies group across 1 directory with 4 updates (<a href="https://redirect.github.com/actions/checkout/issues/1739">#1739</a>)</li> <li><a href="https://github.com/actions/checkout/commit/a5ac7e51b41094c92402da3b24376905380afc29"><code>a5ac7e5</code></a> Update for 4.1.6 release (<a href="https://redirect.github.com/actions/checkout/issues/1733">#1733</a>)</li> <li><a href="https://github.com/actions/checkout/commit/24ed1a352802348c9e4e8d13de9177fb95b537ba"><code>24ed1a3</code></a> Check platform for extension (<a href="https://redirect.github.com/actions/checkout/issues/1732">#1732</a>)</li> <li><a href="https://github.com/actions/checkout/commit/44c2b7a8a4ea60a981eaca3cf939b5f4305c123b"><code>44c2b7a</code></a> README: Suggest <code>user.email</code> to be `41898282+github-actions[bot]<a href="https://github.com/users"><code>@​users</code></a>.norepl...</li> <li><a href="https://github.com/actions/checkout/commit/8459bc0c7e3759cdf591f513d9f141a95fef0a8f"><code>8459bc0</code></a> Bump actions/upload-artifact from 2 to 4 (<a href="https://redirect.github.com/actions/checkout/issues/1695">#1695</a>)</li> <li><a href="https://github.com/actions/checkout/commit/3f603f6d5e9f40714f97b2f017aa0df2a443192a"><code>3f603f6</code></a> Bump actions/setup-node from 1 to 4 (<a href="https://redirect.github.com/actions/checkout/issues/1696">#1696</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/checkout/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- .github/workflows/macos-latest.yml | 2 +- .github/workflows/spack-develop.yml | 2 +- .github/workflows/ubuntu-clang-latest.yml | 4 ++-- .github/workflows/ubuntu-latest.yml | 2 +- .github/workflows/windows-latest-intel.yml | 2 +- .github/workflows/windows-latest-mingw.yml | 2 +- .github/workflows/windows-latest.yml | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index 4a8316a18a..ea361362fa 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -14,7 +14,7 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -44,7 +44,7 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 431612223a..8405747b9c 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -20,7 +20,7 @@ jobs: run: | cat /proc/cpuinfo - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx diff --git a/.github/workflows/macos-latest.yml b/.github/workflows/macos-latest.yml index 1c60778d37..ae0eb137d2 100644 --- a/.github/workflows/macos-latest.yml +++ b/.github/workflows/macos-latest.yml @@ -22,7 +22,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake # Configure CMake in a 'build' subdirectory. diff --git a/.github/workflows/spack-develop.yml b/.github/workflows/spack-develop.yml index fd23c21a99..41f312164f 100644 --- a/.github/workflows/spack-develop.yml +++ b/.github/workflows/spack-develop.yml @@ -24,7 +24,7 @@ jobs: precision: ['double'] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Run test_driver.sh diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index b78a7cb7cd..c7be35258e 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -31,7 +31,7 @@ jobs: with: version: "14.0" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake # Configure CMake in a 'build' subdirectory. @@ -62,7 +62,7 @@ jobs: with: version: "14.0" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake # Configure CMake in a 'build' subdirectory. diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index f9f24a5dd0..0bc9ab7510 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true - name: Run test_driver.sh diff --git a/.github/workflows/windows-latest-intel.yml b/.github/workflows/windows-latest-intel.yml index 88b263c6b9..6ea4e35c34 100644 --- a/.github/workflows/windows-latest-intel.yml +++ b/.github/workflows/windows-latest-intel.yml @@ -27,7 +27,7 @@ jobs: - name: Install Ninja run: choco install ninja - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake (Static) run: cmake -G "Ninja" -B ${{github.workspace}}/build_static -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_FLAGS=-Wno-deprecated-declarations -DCMAKE_C_COMPILER=icx-cl -DCMAKE_CXX_COMPILER=icx-cl -DCMAKE_Fortran_COMPILER=ifx -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_UNITTESTS=OFF -DEXAMPLES_ENABLE_CXX=ON diff --git a/.github/workflows/windows-latest-mingw.yml b/.github/workflows/windows-latest-mingw.yml index 5a714b5133..c4a93a5d46 100644 --- a/.github/workflows/windows-latest-mingw.yml +++ b/.github/workflows/windows-latest-mingw.yml @@ -31,7 +31,7 @@ jobs: target-prefix: mingw-w64-i686 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/windows-latest.yml b/.github/workflows/windows-latest.yml index aa45f757c0..c94026c3b8 100644 --- a/.github/workflows/windows-latest.yml +++ b/.github/workflows/windows-latest.yml @@ -17,7 +17,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure CMake run: cmake -G "Visual Studio 17 2022" -B ${{github.workspace}}/build -DSUNDIALS_BUILD_WITH_PROFILING=ON -DSUNDIALS_TEST_UNITTESTS=ON -DEXAMPLES_ENABLE_CXX=ON From 64ed9a297e22a547311ef0c9b640a23661396aa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:02:07 -0700 Subject: [PATCH 072/137] Build(deps): Bump KyleMayes/install-llvm-action from 1 to 2 (#514) Bumps [KyleMayes/install-llvm-action](https://github.com/kylemayes/install-llvm-action) from 1 to 2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kylemayes/install-llvm-action/releases">KyleMayes/install-llvm-action's releases</a>.</em></p> <blockquote> <h2>v2.0.0</h2> <h3>Migrating from v1</h3> <ul> <li>Support for LLVM and Clang 3.5 through 7.0 has been removed (use 7.1 or later)</li> <li>The <code>download-url</code> input has been renamed to <code>mirror-url</code></li> <li>The <code>force-version</code> and <code>ubuntu-version</code> inputs have been replaced with the <code>force-url</code> input</li> </ul> <h3>Other Changes</h3> <ul> <li>Added <code>arch</code> input</li> <li>Added support for various missing LLVM and Clang versions up to 18.1.2</li> </ul> <h2>v1.9.0</h2> <ul> <li>Add support for LLVM 17 (binaries not available for macOS runners)</li> <li>Update dependencies and use <code>node20</code> runner</li> <li>Fix <code>downloadUrl</code> option usage on Linux and Windows runners (<a href="https://redirect.github.com/kylemayes/install-llvm-action/issues/57">#57</a>)</li> </ul> <h2>v1.8.3</h2> <p>No release notes provided.</p> <h2>v1.8.2</h2> <p>No release notes provided.</p> <h2>v1.8.1</h2> <p>No release notes provided.</p> <h2>v1.8.0</h2> <ul> <li>Support for LLVM 15.0.7</li> <li>Support for LLVM 16.0.0 (except on macOS because LLVM 16.0.0 was not released for that platform)</li> </ul> <h2>v1.7.0</h2> <p>No release notes provided.</p> <h2>v1.6.1</h2> <p>No release notes provided.</p> <h2>v1.6.0</h2> <p>No release notes provided.</p> <h2>v1.5.5</h2> <p>No release notes provided.</p> <h2>v1.5.4</h2> <p>No release notes provided.</p> <h2>v1.5.3</h2> <p>No release notes provided.</p> <h2>v1.5.2</h2> <p>No release notes provided.</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/KyleMayes/install-llvm-action/blob/master/CHANGELOG.md">KyleMayes/install-llvm-action's changelog</a>.</em></p> <blockquote> <h2>[2.0.3] - 2024-05-26</h2> <ul> <li>Added support up to LLVM and Clang 18.1.6 (for platforms with binaries available)</li> </ul> <h2>[2.0.2] - 2024-04-09</h2> <ul> <li>Added support up to LLVM and Clang 18.1.3 (for platforms with binaries available)</li> </ul> <h2>[2.0.1] - 2024-04-02</h2> <h3>Fixes</h3> <ul> <li>Fixed exact LLVM and Clang versions (e.g., <code>17.0.6</code>) causing the action to fail</li> <li>Fixed LLVM and Clang executables failing to run on ARM64 macOS runners</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/4d97c22059bcbf5a4b926fe50c0acdad3fbe4c99"><code>4d97c22</code></a> Move main into separate file</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/672fbb560772a0f2de171213f29ecff58559518a"><code>672fbb5</code></a> Update test CI script</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/c84c53654436b26dc8d5f0de92b02fbf400db0a5"><code>c84c536</code></a> Update actions to use NodeJS 20</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/3f3695131ae6612a8b910b09ba879908e9f1f6bd"><code>3f36951</code></a> Bump version</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/6de67fea4e635d0a390050cfcaf124bf2e0f127b"><code>6de67fe</code></a> Update version tag moving script</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/b99a34d3f198132b3bac291ec916961d7d6b9afc"><code>b99a34d</code></a> Use generated assets file</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/bb35fbb4b96230cab3ee79ec36d4c97c4bae5484"><code>bb35fbb</code></a> Move examples above inputs/outputs</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/be40c5af3a4adc3e4a03199995ab73aa37536712"><code>be40c5a</code></a> Use custom download URL on Linux/Windows</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/878985d084d4991346a5f6f26eae447ddc16457a"><code>878985d</code></a> Recommend against caching</li> <li><a href="https://github.com/KyleMayes/install-llvm-action/commit/54595e5a4224fb5d4f58dd0dccb4dfd3fa5227bc"><code>54595e5</code></a> Add support for LLVM 17</li> <li>Additional commits viewable in <a href="https://github.com/kylemayes/install-llvm-action/compare/v1...v2">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=KyleMayes/install-llvm-action&package-manager=github_actions&previous-version=1&new-version=2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ubuntu-clang-latest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index c7be35258e..2010b54dbf 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@v2 with: version: "14.0" @@ -58,7 +58,7 @@ jobs: steps: - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@v2 with: version: "14.0" From f1e7cce0a738ef2f68fff050c059515cc959d46a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:02:34 -0700 Subject: [PATCH 073/137] Build(deps): Bump docker/setup-buildx-action from 2 to 3 (#513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/docker/setup-buildx-action/releases">docker/setup-buildx-action's releases</a>.</em></p> <blockquote> <h2>v3.0.0</h2> <ul> <li>Node 20 as default runtime (requires <a href="https://github.com/actions/runner/releases/tag/v2.308.0">Actions Runner v2.308.0</a> or later) by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/264">docker/setup-buildx-action#264</a></li> <li>Bump <code>@​actions/core</code> from 1.10.0 to 1.10.1 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/267">docker/setup-buildx-action#267</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.10.0...v3.0.0">https://github.com/docker/setup-buildx-action/compare/v2.10.0...v3.0.0</a></p> <h2>v2.10.0</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.7.1 to 0.10.0 by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/258">docker/setup-buildx-action#258</a></li> <li>Bump word-wrap from 1.2.3 to 1.2.5 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/253">docker/setup-buildx-action#253</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.9.1...v2.10.0">https://github.com/docker/setup-buildx-action/compare/v2.9.1...v2.10.0</a></p> <h2>v2.9.1</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.7.0 to 0.7.1 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/248">docker/setup-buildx-action#248</a> <ul> <li>Fixes an issue where building Buildx does not match the local platform (<a href="https://redirect.github.com/docker/actions-toolkit/pull/135">docker/actions-toolkit#135</a>)</li> </ul> </li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.9.0...v2.9.1">https://github.com/docker/setup-buildx-action/compare/v2.9.0...v2.9.1</a></p> <h2>v2.9.0</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.6.0 to 0.7.0 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/246">docker/setup-buildx-action#246</a> <ul> <li>Adds support to cache Buildx binary to hosted tool cache and GHA cache backend</li> </ul> </li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.8.0...v2.9.0">https://github.com/docker/setup-buildx-action/compare/v2.8.0...v2.9.0</a></p> <h2>v2.8.0</h2> <ul> <li>Only set specific flags for drivers supporting them by <a href="https://github.com/nicks"><code>@​nicks</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/241">docker/setup-buildx-action#241</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.5.0 to 0.6.0 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/242">docker/setup-buildx-action#242</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.7.0...v2.8.0">https://github.com/docker/setup-buildx-action/compare/v2.7.0...v2.8.0</a></p> <h2>v2.7.0</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.3.0 to 0.5.0 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/237">docker/setup-buildx-action#237</a> <a href="https://redirect.github.com/docker/setup-buildx-action/pull/238">docker/setup-buildx-action#238</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.6.0...v2.7.0">https://github.com/docker/setup-buildx-action/compare/v2.6.0...v2.7.0</a></p> <h2>v2.6.0</h2> <ul> <li>Set node name for k8s driver when appending nodes by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/219">docker/setup-buildx-action#219</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.1.0-beta.18 to 0.3.0 in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/220">docker/setup-buildx-action#220</a> <a href="https://redirect.github.com/docker/setup-buildx-action/pull/229">docker/setup-buildx-action#229</a> <a href="https://redirect.github.com/docker/setup-buildx-action/pull/231">docker/setup-buildx-action#231</a> <a href="https://redirect.github.com/docker/setup-buildx-action/pull/236">docker/setup-buildx-action#236</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.5.0...v2.6.0">https://github.com/docker/setup-buildx-action/compare/v2.5.0...v2.6.0</a></p> <h2>v2.5.0</h2> <ul> <li><code>cleanup</code> input to remove builder and temp files by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/213">docker/setup-buildx-action#213</a></li> <li>do not remove builder using the <code>docker</code> driver by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/218">docker/setup-buildx-action#218</a></li> <li>fix current context as builder name for <code>docker</code> driver by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/setup-buildx-action/pull/209">docker/setup-buildx-action#209</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/setup-buildx-action/compare/v2.4.1...v2.5.0">https://github.com/docker/setup-buildx-action/compare/v2.4.1...v2.5.0</a></p> <h2>v2.4.1</h2> <ul> <li>Get releases from actions toolkit by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://redirect.github.com/docker/setup-buildx-action/issues/200">#200</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/docker/setup-buildx-action/commit/d70bba72b1f3fd22344832f00baa16ece964efeb"><code>d70bba7</code></a> Merge pull request <a href="https://redirect.github.com/docker/setup-buildx-action/issues/307">#307</a> from crazy-max/bump-toolkit</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/7638634cb70c02d327dde3b558f22b0db32054a3"><code>7638634</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/c68420fe0b4de2444121eec8f08bc2500c8d9216"><code>c68420f</code></a> bump <code>@​docker/actions-toolkit</code> from 0.19.0 to 0.20.0</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/2b51285047da1547ffb1b2203d8be4c0af6b1f20"><code>2b51285</code></a> Merge pull request <a href="https://redirect.github.com/docker/setup-buildx-action/issues/306">#306</a> from docker/dependabot/npm_and_yarn/docker/actions-to...</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/0f00370563710ebfbdf4287b76a0a5d88864e7f9"><code>0f00370</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/11c9683db9ea73b2090280c1cfa7d725bd8a60fa"><code>11c9683</code></a> build(deps): bump <code>@​docker/actions-toolkit</code> from 0.18.0 to 0.19.0</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/56a16b8f2aa74bcbd3ab9ec13027cd3ac8e3f94f"><code>56a16b8</code></a> Merge pull request <a href="https://redirect.github.com/docker/setup-buildx-action/issues/303">#303</a> from crazy-max/fix-inputs</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/c23f46eb919af18b86ac6f0f4646a63a7a452b4d"><code>c23f46e</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/f876da6242168c5bb185ad517fb42f0b59fba456"><code>f876da6</code></a> rename and align config inputs</li> <li><a href="https://github.com/docker/setup-buildx-action/commit/b7cf918227e7a90a94eea8534a6b0cc1965a0ccd"><code>b7cf918</code></a> Merge pull request <a href="https://redirect.github.com/docker/setup-buildx-action/issues/304">#304</a> from crazy-max/rm-docs-dir</li> <li>Additional commits viewable in <a href="https://github.com/docker/setup-buildx-action/compare/v2...v3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/setup-buildx-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index ea361362fa..ae268e3b87 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -18,7 +18,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to container registry uses: docker/login-action@v2 with: @@ -48,7 +48,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to container registry uses: docker/login-action@v2 with: diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 8405747b9c..17a8967e2e 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -24,7 +24,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to container registry uses: docker/login-action@v2 with: From 49ecc83edb01951516ff2df1ebb18c39671c3ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:02:53 -0700 Subject: [PATCH 074/137] Build(deps): Bump docker/login-action from 2 to 3 (#512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/docker/login-action/releases">docker/login-action's releases</a>.</em></p> <blockquote> <h2>v3.0.0</h2> <ul> <li>Node 20 as default runtime (requires <a href="https://github.com/actions/runner/releases/tag/v2.308.0">Actions Runner v2.308.0</a> or later) by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/login-action/pull/593">docker/login-action#593</a></li> <li>Bump <code>@​actions/core</code> from 1.10.0 to 1.10.1 in <a href="https://redirect.github.com/docker/login-action/pull/598">docker/login-action#598</a></li> <li>Bump <code>@​aws-sdk/client-ecr</code> and <code>@​aws-sdk/client-ecr-public</code> to 3.410.0 in <a href="https://redirect.github.com/docker/login-action/pull/555">docker/login-action#555</a> <a href="https://redirect.github.com/docker/login-action/pull/560">docker/login-action#560</a> <a href="https://redirect.github.com/docker/login-action/pull/582">docker/login-action#582</a> <a href="https://redirect.github.com/docker/login-action/pull/599">docker/login-action#599</a></li> <li>Bump semver from 6.3.0 to 6.3.1 in <a href="https://redirect.github.com/docker/login-action/pull/556">docker/login-action#556</a></li> <li>Bump https-proxy-agent to 7.0.2 <a href="https://redirect.github.com/docker/login-action/pull/561">docker/login-action#561</a> <a href="https://redirect.github.com/docker/login-action/pull/588">docker/login-action#588</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/login-action/compare/v2.2.0...v3.0.0">https://github.com/docker/login-action/compare/v2.2.0...v3.0.0</a></p> <h2>v2.2.0</h2> <ul> <li>Switch to actions-toolkit implementation by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/login-action/pull/409">docker/login-action#409</a> <a href="https://redirect.github.com/docker/login-action/pull/470">docker/login-action#470</a> <a href="https://redirect.github.com/docker/login-action/pull/476">docker/login-action#476</a></li> <li>Bump <code>@​aws-sdk/client-ecr</code> and <code>@​aws-sdk/client-ecr-public</code> to 3.347.1 in <a href="https://redirect.github.com/docker/login-action/pull/524">docker/login-action#524</a> <a href="https://redirect.github.com/docker/login-action/pull/364">docker/login-action#364</a> <a href="https://redirect.github.com/docker/login-action/pull/363">docker/login-action#363</a></li> <li>Bump minimatch from 3.0.4 to 3.1.2 in <a href="https://redirect.github.com/docker/login-action/pull/354">docker/login-action#354</a></li> <li>Bump json5 from 2.2.0 to 2.2.3 in <a href="https://redirect.github.com/docker/login-action/pull/378">docker/login-action#378</a></li> <li>Bump http-proxy-agent from 5.0.0 to 7.0.0 in <a href="https://redirect.github.com/docker/login-action/pull/509">docker/login-action#509</a></li> <li>Bump https-proxy-agent from 5.0.1 to 7.0.0 in <a href="https://redirect.github.com/docker/login-action/pull/508">docker/login-action#508</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/login-action/compare/v2.1.0...v2.2.0">https://github.com/docker/login-action/compare/v2.1.0...v2.2.0</a></p> <h2>v2.1.0</h2> <ul> <li>Ensure AWS temp credentials are redacted in workflow logs by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a href="https://redirect.github.com/docker/login-action/issues/275">#275</a>)</li> <li>Bump <code>@​actions/core</code> from 1.6.0 to 1.10.0 (<a href="https://redirect.github.com/docker/login-action/issues/252">#252</a> <a href="https://redirect.github.com/docker/login-action/issues/292">#292</a>)</li> <li>Bump <code>@​aws-sdk/client-ecr</code> from 3.53.0 to 3.186.0 (<a href="https://redirect.github.com/docker/login-action/issues/298">#298</a>)</li> <li>Bump <code>@​aws-sdk/client-ecr-public</code> from 3.53.0 to 3.186.0 (<a href="https://redirect.github.com/docker/login-action/issues/299">#299</a>)</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/login-action/compare/v2.0.0...v2.1.0">https://github.com/docker/login-action/compare/v2.0.0...v2.1.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/docker/login-action/commit/0d4c9c5ea7693da7b068278f7b52bda2a190a446"><code>0d4c9c5</code></a> Merge pull request <a href="https://redirect.github.com/docker/login-action/issues/722">#722</a> from crazy-max/update-readme</li> <li><a href="https://github.com/docker/login-action/commit/b29e14f6a983abc16efafe71e083f4b1ba2b1e5b"><code>b29e14f</code></a> add contributing section to README</li> <li><a href="https://github.com/docker/login-action/commit/218a70c516af2f25cb9fc1e5a14a5a3576e7093f"><code>218a70c</code></a> Merge pull request <a href="https://redirect.github.com/docker/login-action/issues/721">#721</a> from docker/dependabot/npm_and_yarn/docker/actions-to...</li> <li><a href="https://github.com/docker/login-action/commit/b8200806cfe29e3355c44f34309b26916aae48f6"><code>b820080</code></a> build(deps): bump <code>@​docker/actions-toolkit</code> from 0.23.0 to 0.24.0</li> <li><a href="https://github.com/docker/login-action/commit/27530a9fbbe988616da1dc41b4a8072f949d8042"><code>27530a9</code></a> Merge pull request <a href="https://redirect.github.com/docker/login-action/issues/720">#720</a> from docker/dependabot/npm_and_yarn/aws-sdk-dependenc...</li> <li><a href="https://github.com/docker/login-action/commit/d072a60421ee5ac6ee763e9306c27f92e8ce5a20"><code>d072a60</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/login-action/commit/7c627b5124287958ac76b37cc2d94f1c9ef72aaa"><code>7c627b5</code></a> build(deps): bump the aws-sdk-dependencies group across 1 directory with 2 up...</li> <li><a href="https://github.com/docker/login-action/commit/787cfc66231286ca823ebc099f52001f53aa8f42"><code>787cfc6</code></a> Merge pull request <a href="https://redirect.github.com/docker/login-action/issues/694">#694</a> from docker/dependabot/npm_and_yarn/undici-5.28.4</li> <li><a href="https://github.com/docker/login-action/commit/8e66e916f8ed83b241171904f8e1b9e0a83070bc"><code>8e66e91</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/login-action/commit/5ba5e97350e175e4c4e222569e6746675408a75c"><code>5ba5e97</code></a> build(deps): bump undici from 5.28.3 to 5.28.4</li> <li>Additional commits viewable in <a href="https://github.com/docker/login-action/compare/v2...v3">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index ae268e3b87..fe76443ae2 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -50,7 +50,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 17a8967e2e..7f9fdd9e3e 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} From 41152a55aff042d9341cc0030574f2597d06320e Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Fri, 21 Jun 2024 21:08:25 -0700 Subject: [PATCH 075/137] CMake: remove message wrapper macros (#519) Remove `print_error` and `print_warning` macros --- CMakeLists.txt | 2 +- cmake/SundialsBuildOptionsPre.cmake | 2 +- cmake/SundialsDeprecated.cmake | 78 ++++++++++++-------------- cmake/SundialsExampleOptions.cmake | 12 ++-- cmake/SundialsIndexSize.cmake | 12 ++-- cmake/SundialsSetupCompilers.cmake | 14 ++--- cmake/SundialsSetupFortran.cmake | 2 +- cmake/SundialsSetupHIP.cmake | 2 +- cmake/SundialsSetupTesting.cmake | 4 +- cmake/macros/SundialsCMakeMacros.cmake | 49 ---------------- cmake/macros/SundialsOption.cmake | 13 ++--- cmake/tpl/FindSUPERLUMT.cmake | 5 +- cmake/tpl/SundialsAdiak.cmake | 2 +- cmake/tpl/SundialsCaliper.cmake | 2 +- cmake/tpl/SundialsGinkgo.cmake | 10 ++-- cmake/tpl/SundialsHypre.cmake | 4 +- cmake/tpl/SundialsKLU.cmake | 6 +- cmake/tpl/SundialsLapack.cmake | 2 +- cmake/tpl/SundialsMAGMA.cmake | 6 +- cmake/tpl/SundialsOpenMP.cmake | 6 +- cmake/tpl/SundialsPETSC.cmake | 24 ++++---- cmake/tpl/SundialsPthread.cmake | 4 +- cmake/tpl/SundialsRAJA.cmake | 14 ++--- cmake/tpl/SundialsSuperLUDIST.cmake | 6 +- cmake/tpl/SundialsSuperLUMT.cmake | 4 +- cmake/tpl/SundialsTPL.cmake.template | 2 +- cmake/tpl/SundialsTrilinos.cmake | 2 +- 27 files changed, 116 insertions(+), 173 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8fa7933f..d16ee2e0a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ set(sundialslib_SOVERSION "${PACKAGE_VERSION_MAJOR}") # Prohibit in-source build if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - print_error("In-source build prohibited.") + message(FATAL_ERROR "In-source build prohibited.") endif() # Organize targets into folders when using an IDE diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index b78212e720..3c3f6b16cb 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -182,7 +182,7 @@ sundials_option(BUILD_FORTRAN_MODULE_INTERFACE BOOL "${DOCSTR}" OFF) if(BUILD_FORTRAN_MODULE_INTERFACE) # F2003 interface only supports double precision if(NOT (SUNDIALS_PRECISION MATCHES "DOUBLE")) - print_error("F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision") + message(FATAL_ERROR "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision") endif() # Allow a user to set where the Fortran modules will be installed diff --git a/cmake/SundialsDeprecated.cmake b/cmake/SundialsDeprecated.cmake index 702ee00aa5..385a11361b 100644 --- a/cmake/SundialsDeprecated.cmake +++ b/cmake/SundialsDeprecated.cmake @@ -17,9 +17,8 @@ # if(DEFINED F2003_INTERFACE_ENABLE) - print_warning("The CMake option F2003_INTERFACE_ENABLE is deprecated" - "Use BUILD_FORTRAN_MODULE_INTERFACE instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option F2003_INTERFACE_ENABLE is deprecated. " + "Use BUILD_FORTRAN_MODULE_INTERFACE instead.") set(BUILD_FORTRAN_MODULE_INTERFACE ${F2003_INTERFACE_ENABLE} CACHE BOOL "Enable Fortran 2003 module interfaces") endif() @@ -30,120 +29,115 @@ unset(F2003_INTERFACE_ENABLE CACHE) # if(DEFINED MPI_ENABLE) - print_warning("The CMake option MPI_ENABLE is deprecated" "Use ENABLE_MPI instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option MPI_ENABLE is deprecated. " + "Use ENABLE_MPI instead.") set(ENABLE_MPI ${MPI_ENABLE} CACHE BOOL "Enable MPI support" FORCE) unset(MPI_ENABLE CACHE) endif() if(DEFINED OPENMP_ENABLE) - print_warning("The CMake option OPENMP_ENABLE is deprecated" "Use ENABLE_OPENMP instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option OPENMP_ENABLE is deprecated. " + "Use ENABLE_OPENMP instead.") set(ENABLE_OPENMP ${OPENMP_ENABLE} CACHE BOOL "Enable OpenMP support" FORCE) unset(OPENMP_ENABLE CACHE) endif() if(DEFINED OPENMP_DEVICE_ENABLE) - print_warning("The CMake option OPENMP_DEVICE_ENABLE is deprecated" - "Use ENABLE_OPENMP_DEVICE instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option OPENMP_DEVICE_ENABLE is deprecated. " + "Use ENABLE_OPENMP_DEVICE instead.") set(ENABLE_OPENMP_DEVICE ${OPENMP_DEVICE_ENABLE} CACHE BOOL "Enable OpenMP device offloading support" FORCE) unset(OPENMP_DEVICE_ENABLE CACHE) endif() if(DEFINED SKIP_OPENMP_DEVICE_CHECK) - print_warning("The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated" - "Use OPENMP_DEVICE_WORKS instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. " + "Use OPENMP_DEVICE_WORKS instead.") set(OPENMP_DEVICE_WORKS ${SKIP_OPENMP_DEVICE_CHECK} CACHE BOOL "Skip the compiler check for OpenMP device offloading" FORCE) unset(SKIP_OPENMP_DEVICE_CHECK CACHE) endif() if(DEFINED PTHREAD_ENABLE) - print_warning("The CMake option PTHREAD_ENABLE is deprecated" "Use ENABLE_PTHREAD instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option PTHREAD_ENABLE is deprecated. " + "Use ENABLE_PTHREAD instead") set(ENABLE_PTHREAD ${PTHREAD_ENABLE} CACHE BOOL "Enable Pthreads support" FORCE) unset(PTHREAD_ENABLE CACHE) endif() if(DEFINED CUDA_ENABLE) - print_warning("The CMake option CUDA_ENABLE is deprecated" "Use ENABLE_CUDA instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option CUDA_ENABLE is deprecated. " + "Use ENABLE_CUDA instead.") set(ENABLE_CUDA ${CUDA_ENABLE} CACHE BOOL "Enable CUDA support" FORCE) unset(CUDA_ENABLE CACHE) endif() if(DEFINED LAPACK_ENABLE) - print_warning("The CMake option LAPACK_ENABLE is deprecated" "Use ENABLE_LAPACK instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option LAPACK_ENABLE is deprecated. " + "Use ENABLE_LAPACK instead.") set(ENABLE_LAPACK ${LAPACK_ENABLE} CACHE BOOL "Enable LAPACK support" FORCE) unset(LAPACK_ENABLE CACHE) endif() if(DEFINED SUPERLUDIST_ENABLE) - print_warning("The CMake option SUPERLUDIST_ENABLE is deprecated" - "Use ENABLE_SUPERLUDIST instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option SUPERLUDIST_ENABLE is deprecated. " + "Use ENABLE_SUPERLUDIST instead.") set(ENABLE_SUPERLUDIST ${SUPERLUDIST_ENABLE} CACHE BOOL "Enable SuperLU_DIST support" FORCE) unset(SUPERLUDIST_ENABLE CACHE) endif() # Deprecated with SUNDIALS 6.4.0 if(DEFINED SUPERLUDIST_LIBRARY_DIR) - print_warning("The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated" - "Use SUPERLUDIST_DIR instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated. " + "Use SUPERLUDIST_DIR instead.") set(SUPERLUDIST_DIR "${SUPERLUDIST_LIBRARY_DIR}/../" CACHE BOOL "SuperLU_DIST root directory" FORCE) unset(SUPERLUDIST_LIBRARY_DIR CACHE) endif() if(DEFINED SUPERLUDIST_INCLUDE_DIR) - print_warning("The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated" - "Use SUPERLUDIST_INCLUDE_DIRS instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated. " + "Use SUPERLUDIST_INCLUDE_DIRS instead.") set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIR}" CACHE BOOL "SuperLU_DIST include directoroes" FORCE) unset(SUPERLUDIST_INCLUDE_DIR CACHE) endif() if(DEFINED SUPERLUMT_ENABLE) - print_warning("The CMake option SUPERLUMT_ENABLE is deprecated" "Use ENABLE_SUPERLUMT instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option SUPERLUMT_ENABLE is deprecated. " + "Use ENABLE_SUPERLUMT instead.") set(ENABLE_SUPERLUMT ${SUPERLUMT_ENABLE} CACHE BOOL "Enable SuperLU_MT support" FORCE) unset(SUPERLUMT_ENABLE CACHE) endif() if(DEFINED KLU_ENABLE) - print_warning("The CMake option KLU_ENABLE is deprecated" "Use ENABLE_KLU instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option KLU_ENABLE is deprecated. " + "Use ENABLE_KLU instead.") set(ENABLE_KLU ${KLU_ENABLE} CACHE BOOL "Enable KLU support" FORCE) unset(KLU_ENABLE CACHE) endif() if(DEFINED HYPRE_ENABLE) - print_warning("The CMake option HYPRE_ENABLE is deprecated" "Use ENABLE_HYPRE instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option HYPRE_ENABLE is deprecated. " + "Use ENABLE_HYPRE instead.") set(ENABLE_HYPRE ${HYPRE_ENABLE} CACHE BOOL "Enable HYPRE support" FORCE) unset(HYPRE_ENABLE CACHE) endif() if(DEFINED PETSC_ENABLE) - print_warning("The CMake option PETSC_ENABLE is deprecated" "Use ENABLE_PETSC instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option PETSC_ENABLE is deprecated. " + "Use ENABLE_PETSC instead.") set(ENABLE_PETSC ${PETSC_ENABLE} CACHE BOOL "Enable PETSC support" FORCE) unset(PETSC_ENABLE CACHE) endif() if(DEFINED Trilinos_ENABLE) - print_warning("The CMake option Trilinos_ENABLE is deprecated" "Use ENABLE_TRILINOS instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option Trilinos_ENABLE is deprecated. " + "Use ENABLE_TRILINOS instead.") set(ENABLE_TRILINOS ${Trilinos_ENABLE} CACHE BOOL "Enable Trilinos support" FORCE) unset(Trilinos_ENABLE CACHE) endif() if(DEFINED RAJA_ENABLE) - print_warning("The CMake option RAJA_ENABLE is deprecated" "Use ENABLE_RAJA instead" - MODE DEPRECATION) + message(DEPRECATION "The CMake option RAJA_ENABLE is deprecated. " + "Use ENABLE_RAJA instead.") set(ENABLE_RAJA ${RAJA_ENABLE} CACHE BOOL "Enable RAJA support" FORCE) unset(RAJA_ENABLE CACHE) endif() @@ -153,8 +147,8 @@ endif() # if(DEFINED CUDA_ARCH) - print_warning("The CMake option CUDA_ARCH is deprecated" "Use CMAKE_CUDA_ARCHITECTURES instead" - MODE DEPRECATION) + print_warning("The CMake option CUDA_ARCH is deprecated. " + "Use CMAKE_CUDA_ARCHITECTURES instead.") # convert sm_** to just ** string(REGEX MATCH "[0-9]+" arch_name "${CUDA_ARCH}") set(CMAKE_CUDA_ARCHITECTURES ${arch_name} CACHE STRING "CUDA Architectures" FORCE) diff --git a/cmake/SundialsExampleOptions.cmake b/cmake/SundialsExampleOptions.cmake index 29f099eb1e..40d692771f 100644 --- a/cmake/SundialsExampleOptions.cmake +++ b/cmake/SundialsExampleOptions.cmake @@ -42,16 +42,16 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) # Fortran 2003 examples only support double precision if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))) - print_warning("F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message(WARNING "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() else() # set back to OFF (in case it was ON) if(EXAMPLES_ENABLE_F2003) - print_warning("EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message(WARNING "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() @@ -75,8 +75,8 @@ sundials_option(EXAMPLES_INSTALL_PATH PATH "Output directory for installing exam # If examples are to be exported, check where we should install them. if(EXAMPLES_INSTALL AND NOT EXAMPLES_INSTALL_PATH) - print_warning("The example installation path is empty. " - "Example installation path was reset to its default value") + message(WARNING "The example installation path is empty. Example installation " + "path was reset to its default value") set(EXAMPLES_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/examples" CACHE STRING "Output directory for installing example files" FORCE) endif() diff --git a/cmake/SundialsIndexSize.cmake b/cmake/SundialsIndexSize.cmake index 88c676b41b..6498637bd3 100644 --- a/cmake/SundialsIndexSize.cmake +++ b/cmake/SundialsIndexSize.cmake @@ -42,9 +42,8 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - print_error("No integer type of size 8 was found.\n\ - Tried ${POSSIBLE_INT64}.\n\ - Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message(FATAL_ERROR "No integer type of size 8 was found. Tried " + "${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") endif() # set Fortran integer size too @@ -70,13 +69,12 @@ elseif(SUNDIALS_INDEX_SIZE MATCHES "32") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - print_error("No integer type of size 4 was found.\n\ - Tried ${POSSIBLE_INT32}\n\ - Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message(FATAL_ERROR "No integer type of size 4 was found. Tried " + "${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") endif() # set Fortran integer size too set(SUNDIALS_FINDEX_TYPE "4") else() - print_error("Invalid index size.") + message(FATAL_ERROR "Invalid index size.") endif() diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index f4b226e96d..7790f61609 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -294,12 +294,12 @@ sundials_option(SUNDIALS_LAPACK_UNDERSCORES STRING # If used, both case and underscores must be set if((NOT SUNDIALS_LAPACK_CASE) AND SUNDIALS_LAPACK_UNDERSCORES) - print_error("If SUNDIALS_LAPACK_UNDERSCORES is set, " - "SUNDIALS_LAPACK_CASE must also be set.") + message(FATAL_ERROR "If SUNDIALS_LAPACK_UNDERSCORES is set, " + "SUNDIALS_LAPACK_CASE must also be set.") endif() if(SUNDIALS_LAPACK_CASE AND (NOT SUNDIALS_LAPACK_UNDERSCORES)) - print_error("If SUNDIALS_LAPACK_CASE is set, " - "SUNDIALS_LAPACK_UNDERSCORES must also be set.") + message(FATAL_ERROR "If SUNDIALS_LAPACK_CASE is set, " + "SUNDIALS_LAPACK_UNDERSCORES must also be set.") endif() # Did the user provide a name-mangling scheme? @@ -324,7 +324,7 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") else() - print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.") + message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() elseif(SUNDIALS_LAPACK_CASE MATCHES "UPPER") if(SUNDIALS_LAPACK_UNDERSCORES MATCHES "NONE") @@ -337,10 +337,10 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") else() - print_error("Invalid SUNDIALS_LAPACK_UNDERSCORES option.") + message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() else() - print_error("Invalid SUNDIALS_LAPACK_CASE option.") + message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_CASE option.") endif() # name-mangling scheme has been manually set diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index 1daee0b7b2..de9beea905 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -73,7 +73,7 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no") message(STATUS "Check output:") message("${COMPILE_OUTPUT}") - print_error("BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003") + message(FATAL_ERROR "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003") endif() else() message(STATUS "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE.") diff --git a/cmake/SundialsSetupHIP.cmake b/cmake/SundialsSetupHIP.cmake index 7c147019a7..bc5a6c3776 100644 --- a/cmake/SundialsSetupHIP.cmake +++ b/cmake/SundialsSetupHIP.cmake @@ -46,7 +46,7 @@ set(CMAKE_PREFIX_PATH "${ROCM_PATH};${HIP_PATH}") find_package(HIP REQUIRED) if("${HIP_COMPILER}" STREQUAL "hcc") - print_error("Deprecated HCC compiler is not supported" "Please update ROCm") + message(FATAL_ERROR "Deprecated HCC compiler is not supported" "Please update ROCm") endif() message(STATUS "HIP version: ${HIP_VERSION}") diff --git a/cmake/SundialsSetupTesting.cmake b/cmake/SundialsSetupTesting.cmake index 57dd7b1635..11a445900d 100644 --- a/cmake/SundialsSetupTesting.cmake +++ b/cmake/SundialsSetupTesting.cmake @@ -25,7 +25,7 @@ if (SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS) # look for the testRunner script in the test directory find_program(TESTRUNNER testRunner PATHS test NO_DEFAULT_PATH) if(NOT TESTRUNNER) - print_error("Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.") + message(FATAL_ERROR "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.") endif() message(STATUS "Found testRunner: ${TESTRUNNER}") set(TESTRUNNER ${TESTRUNNER} CACHE INTERNAL "") @@ -56,7 +56,7 @@ if(SUNDIALS_TEST_DEVTESTS) if(SUNDIALS_TEST_ANSWER_DIR) message(STATUS "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}") if(NOT EXISTS ${SUNDIALS_TEST_ANSWER_DIR}) - print_error("SUNDIALS_TEST_ANSWER_DIR does not exist!") + message(FATAL_ERROR "SUNDIALS_TEST_ANSWER_DIR does not exist!") endif() endif() diff --git a/cmake/macros/SundialsCMakeMacros.cmake b/cmake/macros/SundialsCMakeMacros.cmake index 237c7c6ac8..20d101c834 100644 --- a/cmake/macros/SundialsCMakeMacros.cmake +++ b/cmake/macros/SundialsCMakeMacros.cmake @@ -40,55 +40,6 @@ macro(ADD_PREFIX prefix rootlist) set(${rootlist} ${outlist}) endmacro(ADD_PREFIX) -# Macro to print warnings. - -macro(print_warning message action) - set(options ) - set(oneValueArgs MODE) - set(multiValueArgs ) - - # parse inputs and create variables print_warning_<keyword> - cmake_parse_arguments(print_warning "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - - if(print_warning_MODE) - set(_mode ${print_warning_MODE}) - else() - set(_mode WARNING) - endif() - - set(MSG - "------------------------------------------------------------------------\n" - "WARNING: ${message}\n" - "${action}\n" - "------------------------------------------------------------------------") - - message(${_mode} ${MSG}) -endmacro() - -# Macro to print error messages. - -macro(print_error message) - set(options ) - set(oneValueArgs MODE) - set(multiValueArgs ) - - # parse inputs and create variables print_warning_<keyword> - cmake_parse_arguments(print_error "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - - if(print_error_MODE) - set(_mode ${print_error_MODE}) - else() - set(_mode FATAL_ERROR) - endif() - - set(MSG - "************************************************************************\n" - "ERROR: ${message}\n" - "************************************************************************") - - message(${_mode} ${MSG}) -endmacro() - # Returns an unquoted string. Note that CMake will readily turn such # strings back into lists, due to the duality of lists and # semicolon-separated strings. So be careful how you use it. diff --git a/cmake/macros/SundialsOption.cmake b/cmake/macros/SundialsOption.cmake index 252db50f69..e80ed5aac8 100644 --- a/cmake/macros/SundialsOption.cmake +++ b/cmake/macros/SundialsOption.cmake @@ -74,15 +74,14 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) # dependencies were previously met but are no longer satisfied if(DEFINED ${NAME}) string(CONCAT _warn_msg_string - "The variable ${NAME} was set to ${${NAME}} " - "but not all of its dependencies " - "(${depends_on_dependencies_not_met}) evaluate to TRUE." - ) + "The variable ${NAME} was set to ${${NAME}} but not all of its " + "dependencies (${depends_on_dependencies_not_met}) evaluate to TRUE. " + "Unsetting ${NAME}.") unset(${NAME} CACHE) if(sundials_option_DEPENDS_ON_THROW_ERROR) - print_error("${_warn_msg_string}" "Unsetting ${NAME}") + message(FATAL_ERROR "${_warn_msg_string}") else() - print_warning("${_warn_msg_string}" "Unsetting ${NAME}") + message(WARNING "${_warn_msg_string}") endif() endif() @@ -93,7 +92,7 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) foreach(_option ${${NAME}}) if(NOT (${_option} IN_LIST sundials_option_OPTIONS)) list(JOIN sundials_option_OPTIONS ", " _options_msg) - print_error("Value of ${NAME} must be one of ${_options_msg}") + message(FATAL_ERROR "Value of ${NAME} must be one of ${_options_msg}") endif() endforeach() get_property(is_in_cache CACHE ${NAME} PROPERTY TYPE) diff --git a/cmake/tpl/FindSUPERLUMT.cmake b/cmake/tpl/FindSUPERLUMT.cmake index 8c9cbbfb73..4e1acb30b0 100644 --- a/cmake/tpl/FindSUPERLUMT.cmake +++ b/cmake/tpl/FindSUPERLUMT.cmake @@ -38,7 +38,8 @@ force_variable(SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP o if(SUPERLUMT_THREAD_TYPE AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP" AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") - print_error("Unknown thread type: ${SUPERLUMT_THREAD_TYPE}" "Please enter PTHREAD or OPENMP") + message(FATAL_ERROR "Unknown thread type: ${SUPERLUMT_THREAD_TYPE} " + "Please enter PTHREAD or OPENMP") endif() # check if the threading library has been found @@ -51,7 +52,7 @@ if(SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") message(STATUS "Using Pthreads") else() set(PTHREADS_FOUND FALSE) - print_error("Could not determine Pthreads compiler flags") + message(FATAL_ERROR "Could not determine Pthreads compiler flags") endif() endif() else(SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP") diff --git a/cmake/tpl/SundialsAdiak.cmake b/cmake/tpl/SundialsAdiak.cmake index a2b48cf1b9..b5342a7216 100644 --- a/cmake/tpl/SundialsAdiak.cmake +++ b/cmake/tpl/SundialsAdiak.cmake @@ -83,7 +83,7 @@ if(adiak_FOUND AND (NOT adiak_WORKS)) message(STATUS "Checking if adiak works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to adiak is not functional.") + message(FATAL_ERROR "SUNDIALS interface to adiak is not functional.") endif() elseif(adiak_FOUND AND adiak_WORKS) diff --git a/cmake/tpl/SundialsCaliper.cmake b/cmake/tpl/SundialsCaliper.cmake index 8a665a3f05..998376266d 100644 --- a/cmake/tpl/SundialsCaliper.cmake +++ b/cmake/tpl/SundialsCaliper.cmake @@ -102,7 +102,7 @@ if(CALIPER_FOUND AND (NOT CALIPER_WORKS)) message(STATUS "Checking if CALIPER works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to CALIPER is not functional.") + message(FATAL_ERROR "SUNDIALS interface to CALIPER is not functional.") endif() elseif(CALIPER_FOUND AND CALIPER_WORKS) diff --git a/cmake/tpl/SundialsGinkgo.cmake b/cmake/tpl/SundialsGinkgo.cmake index 595c96aa5a..37dd821a2b 100644 --- a/cmake/tpl/SundialsGinkgo.cmake +++ b/cmake/tpl/SundialsGinkgo.cmake @@ -55,23 +55,23 @@ message(STATUS "GINKGO CXX FLAGS: ${GINKGO_INTERFACE_CXX_FLAGS}") # ----------------------------------------------------------------------------- if(Ginkgo_FOUND AND (NOT GINKGO_WORKS)) if(SUNDIALS_PRECISION MATCHES "extended|EXTENDED") - print_error("SUNDIALS GINKGO interface is not compatible with extended precision") + message(FATAL_ERROR "SUNDIALS GINKGO interface is not compatible with extended precision") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - print_error("SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - print_error("SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) - print_error("SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend.") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP" AND NOT ENABLE_OPENMP) - print_error("SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend.") endif() message(STATUS "Checking if GINKGO works... OK") diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake index 56a6158165..ea27e32973 100644 --- a/cmake/tpl/SundialsHypre.cmake +++ b/cmake/tpl/SundialsHypre.cmake @@ -39,7 +39,7 @@ endif() if(ENABLE_HYPRE) # Using hypre requres building with MPI enabled if(NOT ENABLE_MPI) - print_error("MPI is required for hypre support. Set ENABLE_MPI to ON.") + message(FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") endif() # Using hypre requres C99 or newer if(CMAKE_C_STANDARD STREQUAL "90") @@ -112,7 +112,7 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS)) message(STATUS "Checking if HYPRE works... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to HYPRE is not functional.") + message(FATAL_ERROR "SUNDIALS interface to HYPRE is not functional.") endif() elseif(HYPRE_FOUND AND HYPRE_WORKS) diff --git a/cmake/tpl/SundialsKLU.cmake b/cmake/tpl/SundialsKLU.cmake index aa71405687..f3c006608c 100644 --- a/cmake/tpl/SundialsKLU.cmake +++ b/cmake/tpl/SundialsKLU.cmake @@ -38,7 +38,7 @@ endif() # KLU does not support single or extended precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - print_error("KLU is not compatible with ${SUNDIALS_PRECISION} precision") + message(FATAL_ERROR "KLU is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -69,7 +69,7 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) set(CMAKE_REQUIRED_INCLUDES ${save_CMAKE_REQUIRED_INCLUDES}) message(STATUS "Size of SuiteSparse_long is ${SIZEOF_SUITESPARSE_LONG}") if(NOT SIZEOF_SUITESPARSE_LONG EQUAL "8") - print_error("Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used.") + message(FATAL_ERROR "Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used.") endif() endif() @@ -119,7 +119,7 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) message(STATUS "Checking if KLU works... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to KLU is not functional.") + message(FATAL_ERROR "SUNDIALS interface to KLU is not functional.") endif() elseif(KLU_FOUND AND KLU_WORKS) diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index 63b8514520..0047d6afd5 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -355,7 +355,7 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) message(STATUS "Checking if LAPACK works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to LAPACK is not functional.") + message(FATAL_ERROR "SUNDIALS interface to LAPACK is not functional.") endif() elseif(LAPACK_LIBRARIES AND LAPACK_WORKS) diff --git a/cmake/tpl/SundialsMAGMA.cmake b/cmake/tpl/SundialsMAGMA.cmake index e821506c86..6b11a92b8d 100644 --- a/cmake/tpl/SundialsMAGMA.cmake +++ b/cmake/tpl/SundialsMAGMA.cmake @@ -37,7 +37,7 @@ endif() # ----------------------------------------------------------------------------- if(SUNDIALS_PRECISION MATCHES "extended") - print_error("SUNDIALS MAGMA interface is not compatible with extended precision") + message(FATAL_ERROR "SUNDIALS MAGMA interface is not compatible with extended precision") endif() # ----------------------------------------------------------------------------- @@ -57,10 +57,10 @@ message(STATUS "SUNDIALS_MAGMA_BACKENDS: ${SUNDIALS_MAGMA_BACKENDS}") if(MAGMA_FOUND AND (NOT MAGMA_WORKS)) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - print_error("SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") endif() if(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - print_error("SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") endif() set(MAGMA_WORKS TRUE CACHE BOOL "MAGMA works with SUNDIALS as configured" FORCE) diff --git a/cmake/tpl/SundialsOpenMP.cmake b/cmake/tpl/SundialsOpenMP.cmake index aff73d42c4..d845a27888 100644 --- a/cmake/tpl/SundialsOpenMP.cmake +++ b/cmake/tpl/SundialsOpenMP.cmake @@ -69,7 +69,7 @@ if(OPENMP_FOUND AND (ENABLE_OPENMP_DEVICE OR SUPERLUDIST_OpenMP)) # The user has asked for checks to be skipped, assume offloading is supported set(OPENMP45_FOUND TRUE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING TRUE) - print_warning("Skipping OpenMP device/version check." "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed.") + message(WARNING "Skipping OpenMP device/version check." "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed.") else() @@ -84,9 +84,9 @@ if(OPENMP_FOUND AND (ENABLE_OPENMP_DEVICE OR SUPERLUDIST_OpenMP)) message(STATUS "Checking whether OpenMP supports device offloading -- no") set(OPENMP45_FOUND FALSE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING FALSE) - print_error("The found OpenMP version does not support device offloading.") + message(FATAL_ERROR "The found OpenMP version does not support device offloading.") endif() endif() -endif() \ No newline at end of file +endif() diff --git a/cmake/tpl/SundialsPETSC.cmake b/cmake/tpl/SundialsPETSC.cmake index 1dc42ce873..dddcf47180 100644 --- a/cmake/tpl/SundialsPETSC.cmake +++ b/cmake/tpl/SundialsPETSC.cmake @@ -38,11 +38,11 @@ endif() # Using PETSc requires building with MPI enabled if(ENABLE_PETSC AND NOT ENABLE_MPI) - print_error("MPI is required for PETSc support. Set ENABLE_MPI to ON.") + message(FATAL_ERROR "MPI is required for PETSc support. Set ENABLE_MPI to ON.") endif() if(SUNDIALS_PRECISION MATCHES "EXTENDED") - print_error("SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision") + message(FATAL_ERROR "SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -68,22 +68,22 @@ if(PETSC_FOUND AND (NOT PETSC_WORKS)) if(NOT ("${SUNDIALS_INDEX_SIZE}" MATCHES "${PETSC_INDEX_SIZE}")) string(CONCAT _err_msg_string - "PETSc not functional due to index size mismatch:\n" - "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " - "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" - "PETSC_DIR: ${PETSC_DIR}\n") - print_error("${_err_msg_string}") + "PETSc not functional due to index size mismatch:\n" + "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " + "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" + "PETSC_DIR: ${PETSC_DIR}\n") + message(FATAL_ERROR "${_err_msg_string}") endif() string(TOUPPER "${PETSC_PRECISION}" _petsc_precision) string(TOUPPER "${SUNDIALS_PRECISION}" _sundials_precision) if(NOT ("${_sundials_precision}" MATCHES "${_petsc_precision}")) string(CONCAT _err_msg_string - "PETSc not functional due to real type precision mismatch:\n" - "SUNDIALS_PRECISION=${_sundials_precision}, " - "but PETSc was built with ${_petsc_precision} precision\n" - "PETSC_DIR: ${PETSC_DIR}\n") - print_error("${_err_msg_string}") + "PETSc not functional due to real type precision mismatch:\n" + "SUNDIALS_PRECISION=${_sundials_precision}, " + "but PETSc was built with ${_petsc_precision} precision\n" + "PETSC_DIR: ${PETSC_DIR}\n") + message(FATAL_ERROR "${_err_msg_string}") endif() set(PETSC_WORKS TRUE CACHE BOOL "PETSC works with SUNDIALS as configured" FORCE) diff --git a/cmake/tpl/SundialsPthread.cmake b/cmake/tpl/SundialsPthread.cmake index c520064d7b..f19b07c09c 100644 --- a/cmake/tpl/SundialsPthread.cmake +++ b/cmake/tpl/SundialsPthread.cmake @@ -53,5 +53,5 @@ if(CMAKE_USE_PTHREADS_INIT) else() set(PTHREADS_FOUND FALSE) message(STATUS "Checking if Pthreads is available... FAILED") - print_error("Could not determine Pthreads compiler flags") -endif() \ No newline at end of file + message(FATAL_ERROR "Could not determine Pthreads compiler flags") +endif() diff --git a/cmake/tpl/SundialsRAJA.cmake b/cmake/tpl/SundialsRAJA.cmake index 6f7ad51809..1084eb9f6f 100644 --- a/cmake/tpl/SundialsRAJA.cmake +++ b/cmake/tpl/SundialsRAJA.cmake @@ -95,24 +95,24 @@ endif() # ----------------------------------------------------------------------------- if((SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") AND - (NOT RAJA_BACKENDS MATCHES "CUDA")) - print_error("Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend.") + (NOT RAJA_BACKENDS MATCHES "CUDA")) + message(FATAL_ERROR "Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend.") endif() if((SUNDIALS_RAJA_BACKENDS MATCHES "HIP") AND - (NOT RAJA_BACKENDS MATCHES "HIP")) - print_error("Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend.") + (NOT RAJA_BACKENDS MATCHES "HIP")) + message(FATAL_ERROR "Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend.") endif() if(NOT ENABLE_OPENMP AND RAJA_BACKENDS MATCHES "OPENMP") - print_error("RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON.") + message(FATAL_ERROR "RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON.") endif() if(NOT ENABLE_OPENMP_DEVICE AND RAJA_BACKENDS MATCHES "TARGET_OPENMP") - print_error("RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON.") + message(FATAL_ERROR "RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON.") endif() if((SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") AND (NOT RAJA_BACKENDS MATCHES "SYCL")) - print_error("Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend.") + message(FATAL_ERROR "Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend.") endif() diff --git a/cmake/tpl/SundialsSuperLUDIST.cmake b/cmake/tpl/SundialsSuperLUDIST.cmake index c5699a87d5..2dfc84a565 100644 --- a/cmake/tpl/SundialsSuperLUDIST.cmake +++ b/cmake/tpl/SundialsSuperLUDIST.cmake @@ -38,17 +38,17 @@ endif() # SuperLU_DIST only supports double precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - print_error("SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") + message(FATAL_ERROR "SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") endif() # Using SUPERLUDIST requires building with MPI enabled if(ENABLE_SUPERLUDIST AND NOT ENABLE_MPI) - print_error("MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") + message(FATAL_ERROR "MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") endif() # Using SUPERLUDIST with OpenMP requires building with OpenMP enabled if(ENABLE_SUPERLUDIST AND SUPERLUDIST_OpenMP AND NOT ENABLE_OPENMP) - print_error("OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") + message(FATAL_ERROR "OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") endif() # ----------------------------------------------------------------------------- diff --git a/cmake/tpl/SundialsSuperLUMT.cmake b/cmake/tpl/SundialsSuperLUMT.cmake index 4691e94544..a7b6bf863a 100644 --- a/cmake/tpl/SundialsSuperLUMT.cmake +++ b/cmake/tpl/SundialsSuperLUMT.cmake @@ -38,7 +38,7 @@ endif() # SUPERLUMT does not support extended precision if(SUNDIALS_PRECISION MATCHES "EXTENDED") - print_error("SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") + message(FATAL_ERROR "SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -106,7 +106,7 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) message(STATUS "Checking if SuperLU_MT works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to SuperLU_MT is not functional.") + message(FATAL_ERROR "SUNDIALS interface to SuperLU_MT is not functional.") endif() elseif(SUPERLUMT_FOUND AND SUPERLUMT_WORKS) diff --git a/cmake/tpl/SundialsTPL.cmake.template b/cmake/tpl/SundialsTPL.cmake.template index c1036a5e01..e95255b18e 100644 --- a/cmake/tpl/SundialsTPL.cmake.template +++ b/cmake/tpl/SundialsTPL.cmake.template @@ -75,7 +75,7 @@ if(<TPL>_FOUND AND (NOT <TPL>_WORKS)) message(STATUS "Checking if <TPL> works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to <TPL> is not functional.") + message(FATAL_ERROR "SUNDIALS interface to <TPL> is not functional.") endif() elseif(<TPL>_FOUND AND <TPL>_WORKS) diff --git a/cmake/tpl/SundialsTrilinos.cmake b/cmake/tpl/SundialsTrilinos.cmake index 4b8e7e4593..849eef6319 100644 --- a/cmake/tpl/SundialsTrilinos.cmake +++ b/cmake/tpl/SundialsTrilinos.cmake @@ -143,7 +143,7 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) message(STATUS "Checking if Trilinos works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") - print_error("SUNDIALS interface to Trilinos is not functional.") + message(FATAL_ERROR "SUNDIALS interface to Trilinos is not functional.") endif() elseif(Trilinos_FOUND AND Trilinos_WORKS) From 9e7a8ff31c2a14b8d020ee78151514872881c1b7 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 21 Jun 2024 23:42:09 -0700 Subject: [PATCH 076/137] Docs: Add missing pointers to KINSOL getter docs (#522) --- doc/kinsol/guide/source/Usage/index.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index 17d89da5c3..dd1bcacec1 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -1327,7 +1327,7 @@ different quantities that may be of interest to the user, such as solver workspace requirements and solver performance statistics. These optional output functions are described next. -.. c:function:: int KINGetWorkSpace(void * kin_mem, long int lenrw, long int leniw) +.. c:function:: int KINGetWorkSpace(void * kin_mem, long int * lenrw, long int * leniw) The function :c:func:`KINGetWorkSpace` returns the KINSOL integer and real workspace sizes. @@ -1352,7 +1352,7 @@ functions are described next. :math:`22 + 5 N` (increased by :math:`N` if constraint checking is enabled). -.. c:function:: int KINGetNumFuncEvals(void * kin_mem, long int nfevals) +.. c:function:: int KINGetNumFuncEvals(void * kin_mem, long int * nfevals) The function :c:func:`KINGetNumFuncEvals` returns the number of evaluations of the system function. @@ -1366,7 +1366,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetNumNonlinSolvIters(void * kin_mem, long int nniters) +.. c:function:: int KINGetNumNonlinSolvIters(void * kin_mem, long int * nniters) The function :c:func:`KINGetNumNonlinSolvIters` returns the number of nonlinear iterations. @@ -1380,7 +1380,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetNumBetaCondFails(void * kin_mem, long int nbcfails) +.. c:function:: int KINGetNumBetaCondFails(void * kin_mem, long int * nbcfails) The function :c:func:`KINGetNumBetaCondFails` returns the number of :math:`\beta`-condition failures. @@ -1394,7 +1394,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetNumBacktrackOps(void * kin_mem, long int nbacktr) +.. c:function:: int KINGetNumBacktrackOps(void * kin_mem, long int * nbacktr) The function :c:func:`KINGetNumBacktrackOps` returns the number of backtrack operations (step length adjustments) performed by the line search algorithm. @@ -1408,7 +1408,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetFuncNorm(void * kin_mem, sunrealtype fnorm) +.. c:function:: int KINGetFuncNorm(void * kin_mem, sunrealtype * fnorm) The function :c:func:`KINGetFuncNorm` returns the scaled Euclidean :math:`\ell_2` norm of the nonlinear system function :math:`F(u)` evaluated @@ -1423,7 +1423,7 @@ functions are described next. * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``. -.. c:function:: int KINGetStepLength(void * kin_mem, sunrealtype steplength) +.. c:function:: int KINGetStepLength(void * kin_mem, sunrealtype * steplength) The function :c:func:`KINGetStepLength` returns the scaled Euclidean :math:`\ell_2` norm of the step used during the previous iteration. From c3c8490afaeb181c8f1488f026f60492d512d7f6 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 24 Jun 2024 09:33:46 -0700 Subject: [PATCH 077/137] Maintenance: update change log (#518) Update change logs for next development cycle --- CHANGELOG.md | 10 +++ doc/shared/Changelog.rst | 139 ++++++++++++++++++++++++++++++++++- doc/shared/RecentChanges.rst | 126 ------------------------------- doc/shared/sundials_vars.py | 2 +- scripts/startReleaseCycle.sh | 2 +- 5 files changed, 150 insertions(+), 129 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 059d8d3666..31c94ba897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # SUNDIALS Changelog +## Changes to SUNDIALS in release X.Y.Z + +### Major Features + +### New Features and Enhancements + +### Bug Fixes + +### Deprecation Notices + ## Changes to SUNDIALS in release 7.1.0 ### Major Features diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 4fa304b8ac..4c3126e836 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,11 +21,148 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release X.Y.Z ==================================== .. include:: RecentChanges_link.rst +Changes to SUNDIALS in release 7.1.0 +==================================== + +**Major Features** + +Created shared user interface functions for ARKODE to allow more uniform control +over time-stepping algorithms, improved extensibility, and simplified code +maintenance. The corresponding stepper-specific user-callable functions are now +deprecated and will be removed in a future major release. + +Added CMake infrastructure that enables externally maintained addons/plugins to +be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. + +**New Features and Enhancements** + +Added support for Kokkos Kernels v4. + +Added the following Runge-Kutta Butcher tables + +* ``ARKODE_FORWARD_EULER_1_1`` +* ``ARKODE_RALSTON_EULER_2_1_2`` +* ``ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2`` +* ``ARKODE_BACKWARD_EULER_1_1`` +* ``ARKODE_IMPLICIT_MIDPOINT_1_2`` +* ``ARKODE_IMPLICIT_TRAPEZOIDAL_2_2`` + +Added the following MRI coupling tables + +* ``ARKODE_MRI_GARK_FORWARD_EULER`` +* ``ARKODE_MRI_GARK_RALSTON2`` +* ``ARKODE_MRI_GARK_RALSTON3`` +* ``ARKODE_MRI_GARK_BACKWARD_EULER`` +* ``ARKODE_MRI_GARK_IMPLICIT_MIDPOINT`` +* ``ARKODE_IMEX_MRI_GARK_EULER`` +* ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` +* ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` + +Added :c:func:`ARKodeButcherTable_ERKIDToName` and +:c:func:`ARKodeButcherTable_DIRKIDToName` to convert a Butcher table ID to a +string representation. + +Added the function :c:func:`ARKodeSetAutonomous` in ARKODE to indicate that the +implicit right-hand side function does not explicitly depend on time. When using +the trivial predictor, an autonomous problem may reuse implicit function +evaluations across stage solves to reduce the total number of function +evaluations. + +Users may now disable interpolated output in ARKODE by passing +``ARK_INTERP_NONE`` to :c:func:`ARKodeSetInterpolantType`. When interpolation is +disabled, rootfinding is not supported, implicit methods must use the trivial +predictor (the default option), and interpolation at stop times cannot be used +(interpolating at stop times is disabled by default). With interpolation +disabled, calling :c:func:`ARKodeEvolve` in ``ARK_NORMAL`` mode will return at +or past the requested output time (setting a stop time may still be used to halt +the integrator at a specific time). Disabling interpolation will reduce the +memory footprint of an integrator by two or more state vectors (depending on the +interpolant type and degree) which can be beneficial when interpolation is not +needed e.g., when integrating to a final time without output in between or using +an explicit fast time scale integrator with an MRI method. + +Added "Resize" capability to ARKODE's SPRKStep time-stepping module. + +Enabled the Fortran interfaces to build with 32-bit ``sunindextype``. + +**Bug Fixes** + +Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous +default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new +default is also valid in older version of ROCm (at least back to version 4.3.1). + +Renamed the DPCPP value for the :cmakeop:`SUNDIALS_GINKGO_BACKENDS` CMake option +to ``SYCL`` to match Ginkgo's updated naming convention. + +Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` +instead of ``SameMajorVersion``. This fixes the issue seen `here +<https://github.com/AMReX-Codes/amrex/pull/3835>`_. + +Fixed a CMake bug that caused an MPI linking error for our C++ examples in some +instances. Fixes `GitHub Issue #464 +<https://github.com/LLNL/sundials/issues/464>`_. + +Fixed the runtime library installation path for windows systems. This fix +changes the default library installation path from +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to +``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``. + +Fixed conflicting ``.lib`` files between shared and static libs when using +``MSVC`` on Windows + +Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and +static libs. + +Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an +argument to a function pointer instead of ``c_null_funptr``. This caused +compilation issues with the Cray Fortran compiler. + +Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set +with ROCm 6.0.0 or newer. + +Fixed a bug that caused error messages to be cut off in some cases. Fixes +`GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. + +Fixed a memory leak when an error handler was added to a +:c:type:`SUNContext`. Fixes `GitHub Issue #466 +<https://github.com/LLNL/sundials/issues/466>`_. + +Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error +produced from evolving the inner stepper. + +Added missing ``SetRootDirection`` and ``SetNoInactiveRootWarn`` functions to +ARKODE's SPRKStep time-stepping module. + +Fixed a bug in :c:func:`ARKodeSPRKTable_Create` where the coefficient arrays +were not allocated. + +Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could be +32 bits wide even if ``SUNDIALS_INT64_T`` is defined. + +Check if size of ``SuiteSparse_long`` is 8 if the size of ``sunindextype`` is 8 +when using KLU. + +Fixed several build errors with the Fortran interfaces on Windows systems. + +**Deprecation Notices** + +Numerous ARKODE stepper-specific functions are now deprecated in favor of +ARKODE-wide functions. + +Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an +ARKODE-wide equivalent, instructions have been added to the user guide for how +to retain the current functionality using other user-callable functions. + +The unsupported implementations of ``N_VGetArrayPointer`` and +``N_VSetArrayPointer`` for the *hypre* and PETSc vectors are now deprecated. +Users should access the underlying wrapped external library vector objects +instead with ``N_VGetVector_ParHyp`` and ``N_VGetVector_Petsc``, respectively. + Changes to SUNDIALS in release 7.0.0 ==================================== diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index adc2691e7b..4f1514700e 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,133 +1,7 @@ **Major Features** -Created shared user interface functions for ARKODE to allow more uniform control -over time-stepping algorithms, improved extensibility, and simplified code -maintenance. The corresponding stepper-specific user-callable functions are now -deprecated and will be removed in a future major release. - -Added CMake infrastructure that enables externally maintained addons/plugins to -be *optionally* built with SUNDIALS. See :ref:`Contributing` for details. - **New Features and Enhancements** -Added support for Kokkos Kernels v4. - -Added the following Runge-Kutta Butcher tables - -* ``ARKODE_FORWARD_EULER_1_1`` -* ``ARKODE_RALSTON_EULER_2_1_2`` -* ``ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2`` -* ``ARKODE_BACKWARD_EULER_1_1`` -* ``ARKODE_IMPLICIT_MIDPOINT_1_2`` -* ``ARKODE_IMPLICIT_TRAPEZOIDAL_2_2`` - -Added the following MRI coupling tables - -* ``ARKODE_MRI_GARK_FORWARD_EULER`` -* ``ARKODE_MRI_GARK_RALSTON2`` -* ``ARKODE_MRI_GARK_RALSTON3`` -* ``ARKODE_MRI_GARK_BACKWARD_EULER`` -* ``ARKODE_MRI_GARK_IMPLICIT_MIDPOINT`` -* ``ARKODE_IMEX_MRI_GARK_EULER`` -* ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` -* ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` - -Added :c:func:`ARKodeButcherTable_ERKIDToName` and -:c:func:`ARKodeButcherTable_DIRKIDToName` to convert a Butcher table ID to a -string representation. - -Added the function :c:func:`ARKodeSetAutonomous` in ARKODE to indicate that the -implicit right-hand side function does not explicitly depend on time. When using -the trivial predictor, an autonomous problem may reuse implicit function -evaluations across stage solves to reduce the total number of function -evaluations. - -Users may now disable interpolated output in ARKODE by passing -``ARK_INTERP_NONE`` to :c:func:`ARKodeSetInterpolantType`. When interpolation is -disabled, rootfinding is not supported, implicit methods must use the trivial -predictor (the default option), and interpolation at stop times cannot be used -(interpolating at stop times is disabled by default). With interpolation -disabled, calling :c:func:`ARKodeEvolve` in ``ARK_NORMAL`` mode will return at -or past the requested output time (setting a stop time may still be used to halt -the integrator at a specific time). Disabling interpolation will reduce the -memory footprint of an integrator by two or more state vectors (depending on the -interpolant type and degree) which can be beneficial when interpolation is not -needed e.g., when integrating to a final time without output in between or using -an explicit fast time scale integrator with an MRI method. - -Added "Resize" capability to ARKODE's SPRKStep time-stepping module. - -Enabled the Fortran interfaces to build with 32-bit ``sunindextype``. - **Bug Fixes** -Updated the CMake variable ``HIP_PLATFORM`` default to ``amd`` as the previous -default, ``hcc``, is no longer recognized in ROCm 5.7.0 or newer. The new -default is also valid in older version of ROCm (at least back to version 4.3.1). - -Renamed the DPCPP value for the :cmakeop:`SUNDIALS_GINKGO_BACKENDS` CMake option -to ``SYCL`` to match Ginkgo's updated naming convention. - -Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` -instead of ``SameMajorVersion``. This fixes the issue seen `here -<https://github.com/AMReX-Codes/amrex/pull/3835>`_. - -Fixed a CMake bug that caused an MPI linking error for our C++ examples in some -instances. Fixes `GitHub Issue #464 -<https://github.com/LLNL/sundials/issues/464>`_. - -Fixed the runtime library installation path for windows systems. This fix -changes the default library installation path from -``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR`` to -``CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_BINDIR``. - -Fixed conflicting ``.lib`` files between shared and static libs when using -``MSVC`` on Windows - -Fixed invalid ``SUNDIALS_EXPORT`` generated macro when building both shared and -static libs. - -Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an -argument to a function pointer instead of ``c_null_funptr``. This caused -compilation issues with the Cray Fortran compiler. - -Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set -with ROCm 6.0.0 or newer. - -Fixed a bug that caused error messages to be cut off in some cases. Fixes -`GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. - -Fixed a memory leak when an error handler was added to a -:c:type:`SUNContext`. Fixes `GitHub Issue #466 -<https://github.com/LLNL/sundials/issues/466>`_. - -Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error -produced from evolving the inner stepper. - -Added missing ``SetRootDirection`` and ``SetNoInactiveRootWarn`` functions to -ARKODE's SPRKStep time-stepping module. - -Fixed a bug in :c:func:`ARKodeSPRKTable_Create` where the coefficient arrays -were not allocated. - -Fix bug on LLP64 platforms (like Windows 64-bit) where ``KLU_INDEXTYPE`` could be -32 bits wide even if ``SUNDIALS_INT64_T`` is defined. - -Check if size of ``SuiteSparse_long`` is 8 if the size of ``sunindextype`` is 8 -when using KLU. - -Fixed several build errors with the Fortran interfaces on Windows systems. - **Deprecation Notices** - -Numerous ARKODE stepper-specific functions are now deprecated in favor of -ARKODE-wide functions. - -Deprecated the `ARKStepSetOptimalParams` function. Since this function does not have an -ARKODE-wide equivalent, instructions have been added to the user guide for how -to retain the current functionality using other user-callable functions. - -The unsupported implementations of ``N_VGetArrayPointer`` and -``N_VSetArrayPointer`` for the *hypre* and PETSc vectors are now deprecated. -Users should access the underlying wrapped external library vector objects -instead with ``N_VGetVector_ParHyp`` and ``N_VGetVector_Petsc``, respectively. diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py index dca40a56f2..1b9406fa69 100644 --- a/doc/shared/sundials_vars.py +++ b/doc/shared/sundials_vars.py @@ -9,7 +9,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -doc_version = 'v7.1.0' +doc_version = 'develop' sundials_version = 'v7.1.0' arkode_version = 'v6.1.0' cvode_version = 'v7.1.0' diff --git a/scripts/startReleaseCycle.sh b/scripts/startReleaseCycle.sh index 5e9f9e86b8..f4ee9075db 100755 --- a/scripts/startReleaseCycle.sh +++ b/scripts/startReleaseCycle.sh @@ -31,7 +31,7 @@ sedi() { # Update versions # ------------------------------------------------------------------------------ -fn="../doc/shared/versions.py" +fn="../doc/shared/sundials_vars.py" sedi "s/doc_version =.*/doc_version = \'develop\'/" $fn # ------------------------------------------------------------------------------ From 8d3dde0ea9007dffde63e02427d12c454025cf43 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Mon, 24 Jun 2024 22:55:34 -0700 Subject: [PATCH 078/137] Bugfix: Revert change to N_VSpace_Sycl (#523) This change was supposed to be reverted in #447 but it was missed. --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 2 ++ src/nvector/sycl/nvector_sycl.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c94ba897..5954359481 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bug Fixes +Fixed a [bug](https://github.com/LLNL/sundials/pull/523) in v7.1.0 with the SYCL N_Vector `N_VSpace` function. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.0 diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 4f1514700e..c10634340f 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -4,4 +4,6 @@ **Bug Fixes** +Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`_ in v7.1.0 with the SYCL N_Vector ``N_VSpace`` function. + **Deprecation Notices** diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index ce2106e210..2f5b6a0a61 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -870,7 +870,7 @@ void N_VDestroy_Sycl(N_Vector v) return; } -void N_VSpace_Sycl(N_Vector X, long int* lrw, long int* liw) +void N_VSpace_Sycl(N_Vector X, sunindextype* lrw, sunindextype* liw) { *lrw = NVEC_SYCL_CONTENT(X)->length; *liw = 2; From c28eaa3764a03705d61decb6025b409360e9d53f Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 26 Jun 2024 09:46:34 -0700 Subject: [PATCH 079/137] Release/7.1.1 (#529) --- CHANGELOG.md | 8 +------- CITATIONS.md | 12 ++++++------ CMakeLists.txt | 24 ++++++++++++------------ README.md | 2 +- doc/shared/Changelog.rst | 2 +- doc/shared/History.rst | 2 ++ doc/shared/RecentChanges.rst | 6 ------ doc/shared/sundials.bib | 24 ++++++++++++------------ doc/shared/sundials_vars.py | 16 ++++++++-------- doc/sundials/biblio.bib | 24 ++++++++++++------------ doc/sundials/ug.tex | 14 +++++++------- scripts/tarscript | 14 +++++++------- scripts/updateVersion.sh | 2 +- src/arkode/README.md | 6 +++--- src/cvode/README.md | 6 +++--- src/cvodes/README.md | 6 +++--- src/ida/README.md | 6 +++--- src/idas/README.md | 6 +++--- src/kinsol/README.md | 6 +++--- 19 files changed, 88 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5954359481..eee9a428a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,11 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release X.Y.Z - -### Major Features - -### New Features and Enhancements +## Changes to SUNDIALS in release 7.1.1 ### Bug Fixes Fixed a [bug](https://github.com/LLNL/sundials/pull/523) in v7.1.0 with the SYCL N_Vector `N_VSpace` function. -### Deprecation Notices - ## Changes to SUNDIALS in release 7.1.0 ### Major Features diff --git a/CITATIONS.md b/CITATIONS.md index ef97b2c715..9e93aa7ced 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -69,7 +69,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Cody J. Balos}, title = {User Documentation for ARKODE}, year = {2024}, - note = {v6.1.0} + note = {v6.1.1} } ``` @@ -78,7 +78,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODE}, year = {2024}, - note = {v7.1.0} + note = {v7.1.1} } ``` @@ -87,7 +87,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODES}, year = {2024}, - note = {v7.1.0} + note = {v7.1.1} } ``` @@ -96,7 +96,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDA}, year = {2024}, - note = {v7.1.0} + note = {v7.1.1} } ``` @@ -105,7 +105,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDAS}, year = {2024}, - note = {v6.1.0} + note = {v6.1.1} } ``` @@ -114,6 +114,6 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for KINSOL}, year = {2024}, - note = {v7.1.0} + note = {v7.1.1} } ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index d16ee2e0a9..b5cca95afd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ include(FindPackageHandleStandardArgs) # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") -set(PACKAGE_STRING "SUNDIALS 7.1.0") +set(PACKAGE_STRING "SUNDIALS 7.1.1") set(PACKAGE_TARNAME "sundials") # Set SUNDIALS version numbers @@ -58,7 +58,7 @@ message(STATUS "SUNDIALS_GIT_VERSION: ${SUNDIALS_GIT_VERSION}") # (use "" for the version label if none is needed) set(PACKAGE_VERSION_MAJOR "7") set(PACKAGE_VERSION_MINOR "1") -set(PACKAGE_VERSION_PATCH "0") +set(PACKAGE_VERSION_PATCH "1") set(PACKAGE_VERSION_LABEL "") if(PACKAGE_VERSION_LABEL) @@ -73,37 +73,37 @@ endif() # Specify the VERSION and SOVERSION for shared libraries -set(arkodelib_VERSION "6.1.0") +set(arkodelib_VERSION "6.1.1") set(arkodelib_SOVERSION "6") -set(cvodelib_VERSION "7.1.0") +set(cvodelib_VERSION "7.1.1") set(cvodelib_SOVERSION "7") -set(cvodeslib_VERSION "7.1.0") +set(cvodeslib_VERSION "7.1.1") set(cvodeslib_SOVERSION "7") -set(idalib_VERSION "7.1.0") +set(idalib_VERSION "7.1.1") set(idalib_SOVERSION "7") -set(idaslib_VERSION "6.1.0") +set(idaslib_VERSION "6.1.1") set(idaslib_SOVERSION "6") -set(kinsollib_VERSION "7.1.0") +set(kinsollib_VERSION "7.1.1") set(kinsollib_SOVERSION "7") set(cpodeslib_VERSION "0.0.0") set(cpodeslib_SOVERSION "0") -set(nveclib_VERSION "7.1.0") +set(nveclib_VERSION "7.1.1") set(nveclib_SOVERSION "7") -set(sunmatrixlib_VERSION "5.1.0") +set(sunmatrixlib_VERSION "5.1.1") set(sunmatrixlib_SOVERSION "5") -set(sunlinsollib_VERSION "5.1.0") +set(sunlinsollib_VERSION "5.1.1") set(sunlinsollib_SOVERSION "5") -set(sunnonlinsollib_VERSION "4.1.0") +set(sunnonlinsollib_VERSION "4.1.1") set(sunnonlinsollib_SOVERSION "4") set(sundialslib_VERSION diff --git a/README.md b/README.md index 9a21db1d4d..c410afb6ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic equation Solvers # -### Version 7.1.0 (Jun 2024) ### +### Version 7.1.1 (Jun 2024) ### **Center for Applied Scientific Computing, Lawrence Livermore National Laboratory** diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 4c3126e836..2ce7b9c951 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,7 +21,7 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.1.1 ==================================== .. include:: RecentChanges_link.rst diff --git a/doc/shared/History.rst b/doc/shared/History.rst index b5c79886e3..f2f4e0842d 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -21,6 +21,8 @@ Release History +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Date | SUNDIALS | ARKODE | CVODE | CVODES | IDA | IDAS | KINSOL | +==========+===================+===================+===================+===================+===================+===================+===================+ +| Jun 2024 | 7.1.1 | 6.1.1 | 7.1.1 | 7.1.1 | 7.1.1 | 6.1.1 | 7.1.1 | ++----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Jun 2024 | 7.1.0 | 6.1.0 | 7.1.0 | 7.1.0 | 7.1.0 | 6.1.0 | 7.1.0 | +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Feb 2024 | 7.0.0 | 6.0.0 | 7.0.0 | 7.0.0 | 7.0.0 | 6.0.0 | 7.0.0 | diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index c10634340f..0340eed7c8 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,9 +1,3 @@ -**Major Features** - -**New Features and Enhancements** - **Bug Fixes** Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`_ in v7.1.0 with the SYCL N_Vector ``N_VSpace`` function. - -**Deprecation Notices** diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index afa6de0c0d..1f9d585a91 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -27,7 +27,7 @@ % @techreport{arkode_ug, author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Rujeko Chinomona and Cody J. Balos}, -title = {{User Documentation for ARKODE v6.1.0}}, +title = {{User Documentation for ARKODE v6.1.1}}, institution = {LLNL}, number = {LLNL-SM-668082}, year = 2024 @@ -37,7 +37,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author = {Daniel R. Reynolds}, -title = {{Example Programs for ARKODE v6.1.0}}, +title = {{Example Programs for ARKODE v6.1.1}}, institution = {Southern Methodist University}, year = 2024 } @@ -46,7 +46,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODE v7.1.0}}, +title = {{User Documentation for CVODE v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208108}, year = 2024 @@ -56,7 +56,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author = {Alan C. Hindmarsh and Radu Serban}, -title = {{Example Programs for CVODE v7.1.0}}, +title = {{Example Programs for CVODE v7.1.1}}, institution = {LLNL}, note = {UCRL-SM-208110}, year = 2024 @@ -66,7 +66,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODES v7.1.0}}, +title = {{User Documentation for CVODES v7.1.1}}, institution = {LLNL}, note = {UCRL-SM-208111}, year = 2024 @@ -76,7 +76,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for CVODES v7.1.0}}, +title = {{Example Programs for CVODES v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208115}, year = 2024 @@ -86,7 +86,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDA v7.1.0}}, +title = {{User Documentation for IDA v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208112}, year = 2024 @@ -96,7 +96,7 @@ @techreport{ida_ug % @techreport{ida_ex, author = {Alan C. Hindmarsh and Radu Serban and Aaron Collier}, -title = {{Example Programs for IDA v7.1.0}}, +title = {{Example Programs for IDA v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208113}, year = 2024 @@ -106,7 +106,7 @@ @techreport{ida_ex % @techreport{idas_ug, author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDAS v6.1.0}}, +title = {{User Documentation for IDAS v6.1.1}}, institution = {LLNL}, number = {UCRL-SM-234051}, year = 2024 @@ -116,7 +116,7 @@ @techreport{idas_ug % @techreport{idas_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for IDAS v6.1.0}}, +title = {{Example Programs for IDAS v6.1.1}}, institution = {LLNL}, number = {LLNL-TR-437091}, year = 2024 @@ -126,7 +126,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for KINSOL v7.1.0}}, +title = {{User Documentation for KINSOL v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208116}, year = 2024 @@ -136,7 +136,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author = {Aaron M. Collier and Radu Serban}, -title = {{Example Programs for KINSOL v7.1.0}}, +title = {{Example Programs for KINSOL v7.1.1}}, institution = {LLNL}, number = {UCRL-SM-208114}, year = 2024 diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py index 1b9406fa69..7fdf28446e 100644 --- a/doc/shared/sundials_vars.py +++ b/doc/shared/sundials_vars.py @@ -9,14 +9,14 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -doc_version = 'develop' -sundials_version = 'v7.1.0' -arkode_version = 'v6.1.0' -cvode_version = 'v7.1.0' -cvodes_version = 'v7.1.0' -ida_version = 'v7.1.0' -idas_version = 'v6.1.0' -kinsol_version = 'v7.1.0' +doc_version = 'v7.1.1' +sundials_version = 'v7.1.1' +arkode_version = 'v6.1.1' +cvode_version = 'v7.1.1' +cvodes_version = 'v7.1.1' +ida_version = 'v7.1.1' +idas_version = 'v6.1.1' +kinsol_version = 'v7.1.1' year = '2024' # Warn about all references where the target cannot be found diff --git a/doc/sundials/biblio.bib b/doc/sundials/biblio.bib index b0470d62e6..56b49481c8 100644 --- a/doc/sundials/biblio.bib +++ b/doc/sundials/biblio.bib @@ -16,7 +16,7 @@ @techreport{arkode_ug, author={Daniel R. Reynolds and David J. Gardner and Alan C. Hindmarsh and Carol S. Woodward and Jean M. Sexton}, -title={{User Documentation for ARKODE v6.1.0}}, +title={{User Documentation for ARKODE v6.1.1}}, institution={LLNL}, number={LLNL-SM-668082}, year = 2024 @@ -26,7 +26,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author={Daniel R. Reynolds}, -title={{Example Programs for ARKODE v6.1.0}}, +title={{Example Programs for ARKODE v6.1.1}}, institution={Southern Methodist University}, year = 2024 } @@ -35,7 +35,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODE v7.1.0}}, +title={{User Documentation for CVODE v7.1.1}}, institution={LLNL}, number={UCRL-SM-208108}, year = 2024 @@ -45,7 +45,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author={A. C. Hindmarsh and R. Serban and D. R. Reynolds}, -title={{Example Programs for CVODE v7.1.0}}, +title={{Example Programs for CVODE v7.1.1}}, institution={LLNL}, note={UCRL-SM-208110}, year = 2024 @@ -55,7 +55,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODES v7.1.0}}, +title={{User Documentation for CVODES v7.1.1}}, institution={LLNL}, note={UCRL-SM-208111}, year = 2024 @@ -65,7 +65,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for CVODES v7.1.0}}, +title={{Example Programs for CVODES v7.1.1}}, institution={LLNL}, number={UCRL-SM-208115}, year = 2024 @@ -75,7 +75,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{User Documentation for IDA v7.1.0}}, +title={{User Documentation for IDA v7.1.1}}, institution={LLNL}, number={UCRL-SM-208112}, year = 2024 @@ -85,7 +85,7 @@ @techreport{ida_ug % @techreport{ida_ex, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{Example Programs for IDA v7.1.0}}, +title={{Example Programs for IDA v7.1.1}}, institution={LLNL}, number={UCRL-SM-208113}, year = 2024 @@ -95,7 +95,7 @@ @techreport{ida_ex % @techreport{idas_ug, author={R. Serban and C. Petra and A. C. Hindmarsh}, -title={{User Documentation for IDAS v6.1.0}}, +title={{User Documentation for IDAS v6.1.1}}, institution={LLNL}, number={UCRL-SM-234051}, year = 2024 @@ -105,7 +105,7 @@ @techreport{idas_ug % @techreport{idas_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for IDAS v6.1.0}}, +title={{Example Programs for IDAS v6.1.1}}, institution={LLNL}, number={LLNL-TR-437091}, year = 2024 @@ -115,7 +115,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author={A. M. Collier and A. C. Hindmarsh and R. Serban and C.S. Woodward}, -title={{User Documentation for KINSOL v7.1.0}}, +title={{User Documentation for KINSOL v7.1.1}}, institution={LLNL}, number={UCRL-SM-208116}, year = 2024 @@ -125,7 +125,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author={A. M. Collier and R. Serban}, -title={{Example Programs for KINSOL v7.1.0}}, +title={{Example Programs for KINSOL v7.1.1}}, institution={LLNL}, number={UCRL-SM-208114}, year = 2024 diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index 721acd879d..aa3d25945c 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -59,29 +59,29 @@ %----- VERSIONS AND UCRL NUMBERS OF SUNDIALS CODES -\newcommand{\sunrelease}{v7.1.0} +\newcommand{\sunrelease}{v7.1.1} -\newcommand{\cvrelease}{v7.1.0} +\newcommand{\cvrelease}{v7.1.1} \newcommand{\cvucrlug}{UCRL-SM-208108} \newcommand{\cvucrlex}{UCRL-SM-208110} -\newcommand{\cvsrelease}{v7.1.0} +\newcommand{\cvsrelease}{v7.1.1} \newcommand{\cvsucrlug}{UCRL-SM-208111} \newcommand{\cvsucrlex}{UCRL-SM-208115} -\newcommand{\idarelease}{v7.1.0} +\newcommand{\idarelease}{v7.1.1} \newcommand{\idaucrlug}{UCRL-SM-208112} \newcommand{\idaucrlex}{UCRL-SM-208113} -\newcommand{\idasrelease}{v6.1.0} +\newcommand{\idasrelease}{v6.1.1} \newcommand{\idasucrlug}{UCRL-SM-234051} \newcommand{\idasucrlex}{LLNL-TR-437091} -\newcommand{\kinrelease}{v7.1.0} +\newcommand{\kinrelease}{v7.1.1} \newcommand{\kinucrlug}{UCRL-SM-208116} \newcommand{\kinucrlex}{UCRL-SM-208114} -\newcommand{\arkrelease}{v6.1.0} +\newcommand{\arkrelease}{v6.1.1} \newcommand{\arkucrlug}{LLNL-SM-668082} \newcommand{\arkucrlex}{????-??-??????} diff --git a/scripts/tarscript b/scripts/tarscript index 642dec13aa..8a95748e56 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -57,13 +57,13 @@ function print_usage # VERSION NUMBERS #--------------------------------------------------------- -SUN_VER="7.1.0" -CV_VER="7.1.0" -CVS_VER="7.1.0" -IDA_VER="7.1.0" -IDAS_VER="6.1.0" -KIN_VER="7.1.0" -ARK_VER="6.1.0" +SUN_VER="7.1.1" +CV_VER="7.1.1" +CVS_VER="7.1.1" +IDA_VER="7.1.1" +IDAS_VER="6.1.1" +KIN_VER="7.1.1" +ARK_VER="6.1.1" #--------------------------------------------------------- # Test if the script is executed from within its directory diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index e91e846bde..89d68697e0 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -20,7 +20,7 @@ # releases the label string is "". sun_major=${1:-7} sun_minor=${2:-1} -sun_patch=${3:-0} +sun_patch=${3:-1} sun_label=${4:-""} month=${5:-$(date +"%b")} year=${6:-$(date +"%Y")} diff --git a/src/arkode/README.md b/src/arkode/README.md index d71f6b43ef..8ae6ccd1cc 100644 --- a/src/arkode/README.md +++ b/src/arkode/README.md @@ -1,5 +1,5 @@ # ARKODE -### Version 6.1.0 (Jun 2024) +### Version 6.1.1 (Jun 2024) **Daniel R. Reynolds, Department of Mathematics, SMU** @@ -44,8 +44,8 @@ the "SUNDIALS Release History" appendix of the ARKODE User Guide. ## References * D. R. Reynolds, D. J. Gardner, C. S. Woodward, and C. J. Balos, - "User Documentation for ARKODE v6.1.0," LLNL technical report + "User Documentation for ARKODE v6.1.1," LLNL technical report LLNL-SM-668082, Jun 2024. -* D. R. Reynolds, "Example Programs for ARKODE v6.1.0," Technical Report, +* D. R. Reynolds, "Example Programs for ARKODE v6.1.1," Technical Report, Southern Methodist University Center for Scientific Computation, Jun 2024. diff --git a/src/cvode/README.md b/src/cvode/README.md index 7e17d2a68c..04e3c19f74 100644 --- a/src/cvode/README.md +++ b/src/cvode/README.md @@ -1,5 +1,5 @@ # CVODE -### Version 7.1.0 (Jun 2024) +### Version 7.1.1 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,10 +47,10 @@ the "SUNDIALS Release History" appendix of the CVODE User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODE v7.1.0," + and C. S. Woodward, "User Documentation for CVODE v7.1.1," LLNL technical report UCRL-SM-208108, Jun 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.1.0," +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.1.1," LLNL technical report UCRL-SM-208110, Jun 2024. * S.D. Cohen and A.C. Hindmarsh, "CVODE, a Stiff/nonstiff ODE Solver in C," diff --git a/src/cvodes/README.md b/src/cvodes/README.md index 8e4259efdd..0c4171ee58 100644 --- a/src/cvodes/README.md +++ b/src/cvodes/README.md @@ -1,5 +1,5 @@ # CVODES -### Version 7.1.0 (Jun 2024) +### Version 7.1.1 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -44,10 +44,10 @@ the "SUNDIALS Release History" appendix of the CVODES User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODES v7.1.0," + and C. S. Woodward, "User Documentation for CVODES v7.1.1," LLNL technical report UCRL-SM-208111, Jun 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.1.0," +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.1.1," LLNL technical report UCRL-SM-208115, Jun 2024. * R. Serban and A. C. Hindmarsh, "CVODES: the Sensitivity-Enabled ODE diff --git a/src/ida/README.md b/src/ida/README.md index 086ea1c262..3e668d9e42 100644 --- a/src/ida/README.md +++ b/src/ida/README.md @@ -1,5 +1,5 @@ # IDA -### Version 7.1.0 (Jun 2024) +### Version 7.1.1 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,10 +47,10 @@ the "SUNDIALS Release History" appendix of the IDA User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for IDA v7.1.0," + and C. S. Woodward, "User Documentation for IDA v7.1.1," LLNL technical report UCRL-SM-208112, Jun 2024. -* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.1.0," +* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.1.1," LLNL technical report UCRL-SM-208113, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, diff --git a/src/idas/README.md b/src/idas/README.md index 0b34eb22e7..db24f4c494 100644 --- a/src/idas/README.md +++ b/src/idas/README.md @@ -1,5 +1,5 @@ # IDAS -### Version 6.1.0 (Jun 2024) +### Version 6.1.1 (Jun 2024) **Radu Serban, Cosmin Petra, Alan C. Hindmarsh, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -43,10 +43,10 @@ the "SUNDIALS Release History" appendix of the IDAS User Guide. ## References * R. Serban, C. Petra, A. C. Hindmarsh, C. J. Balos, D. J. Gardner, - D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.1.0," + D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.1.1," LLNL technical report UCRL-SM-234051, Jun 2024. -* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.1.0," +* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.1.1," LLNL technical report LLNL-TR-437091, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, diff --git a/src/kinsol/README.md b/src/kinsol/README.md index 84678f7713..37d11bec6d 100644 --- a/src/kinsol/README.md +++ b/src/kinsol/README.md @@ -1,5 +1,5 @@ # KINSOL -### Version 7.1.0 (Jun 2024) +### Version 7.1.1 (Jun 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -48,10 +48,10 @@ the "SUNDIALS Release History" appendix of the KINSOL User Guide. * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds and C. S. Woodward, - "User Documentation for KINSOL v7.1.0," LLNL technical report + "User Documentation for KINSOL v7.1.1," LLNL technical report UCRL-SM-208116, Jun 2024. -* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.1.0," +* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.1.1," LLNL technical report UCRL-SM-208114, Jun 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, From c0555cfba3d85a86a6e39fcd77c17963b4f1a292 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 26 Jun 2024 14:57:35 -0700 Subject: [PATCH 080/137] Maintenance: Start recent changes for next release (#532) --- CHANGELOG.md | 13 ++++++++++++- doc/shared/Changelog.rst | 10 +++++++++- doc/shared/RecentChanges.rst | 6 +++++- doc/shared/sundials_vars.py | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee9a428a5..141b16720c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,21 @@ # SUNDIALS Changelog +## Changes to SUNDIALS in release X.Y.Z + +### Major Features + +### New Features and Enhancements + +### Bug Fixes + +### Deprecation Notices + ## Changes to SUNDIALS in release 7.1.1 ### Bug Fixes -Fixed a [bug](https://github.com/LLNL/sundials/pull/523) in v7.1.0 with the SYCL N_Vector `N_VSpace` function. +Fixed a [bug](https://github.com/LLNL/sundials/pull/523) in v7.1.0 with the SYCL +N_Vector `N_VSpace` function. ## Changes to SUNDIALS in release 7.1.0 diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 2ce7b9c951..5bf5c04203 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,11 +21,19 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release 7.1.1 +Changes to SUNDIALS in release X.Y.Z ==================================== .. include:: RecentChanges_link.rst +Changes to SUNDIALS in release 7.1.1 +==================================== + +**Bug Fixes** + +Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`_ in v7.1.0 with the +SYCL N_Vector ``N_VSpace`` function. + Changes to SUNDIALS in release 7.1.0 ==================================== diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 0340eed7c8..4f1514700e 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,3 +1,7 @@ +**Major Features** + +**New Features and Enhancements** + **Bug Fixes** -Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`_ in v7.1.0 with the SYCL N_Vector ``N_VSpace`` function. +**Deprecation Notices** diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py index 7fdf28446e..4c5f76c563 100644 --- a/doc/shared/sundials_vars.py +++ b/doc/shared/sundials_vars.py @@ -9,7 +9,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -doc_version = 'v7.1.1' +doc_version = 'develop' sundials_version = 'v7.1.1' arkode_version = 'v6.1.1' cvode_version = 'v7.1.1' From 0749c816594668e49b6a08f196b49c96256ba6e1 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 26 Jun 2024 16:16:52 -0700 Subject: [PATCH 081/137] Bugfix: Correct typo in example comment (#531) --- examples/arkode/C_serial/ark_reaction_diffusion_mri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index 65a4ca73bf..56754bb625 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -135,7 +135,7 @@ int main(void) if (check_retval(&retval, "SetInitialCondition", 1)) { return 1; } /* - * Create the slow integrator and set options + * Create the fast integrator and set options */ /* Initialize the fast integrator. Specify the explicit fast right-hand side From b578eabccd77b7642b04ddda9d8530f05890d1b4 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Sun, 30 Jun 2024 22:50:58 -0700 Subject: [PATCH 082/137] Maintenance: format python scripts with black (#534) --- .github/workflows/check-clang-format.yml | 6 + .../scripts/compare_error.py | 83 +- .../scripts/compute_error.py | 77 +- .../scripts/make_plots.py | 305 +-- .../scripts/pickle_solution_output.py | 64 +- .../plot_nvector_performance_results.py | 345 ++-- .../plot_nvector_performance_speedup.py | 222 ++- .../developers/style_guide/SourceCode.rst | 24 +- .../arkode/CXX_parallel/plot_brusselator1D.py | 63 +- examples/arkode/CXX_parallel/plot_heat2D_p.py | 85 +- examples/arkode/CXX_parhyp/plot_heat2D_p.py | 85 +- examples/arkode/CXX_serial/plot_heat2D.py | 53 +- examples/arkode/CXX_serial/plot_sol.py | 26 +- examples/arkode/CXX_xbraid/plot_heat2D.py | 51 +- .../arkode/C_manyvector/plot_brusselator1D.py | 40 +- .../arkode/C_openmp/plot_brusselator1D.py | 40 +- .../arkode/C_parallel/plot_brusselator1D.py | 63 +- examples/arkode/C_serial/ark_kepler_plot.py | 74 +- .../arkode/C_serial/plot_brusselator1D.py | 40 +- .../arkode/C_serial/plot_brusselator1D_FEM.py | 48 +- examples/arkode/C_serial/plot_heat1D.py | 20 +- examples/arkode/C_serial/plot_heat1D_adapt.py | 32 +- examples/arkode/C_serial/plot_sol.py | 26 +- examples/arkode/C_serial/plot_sol_log.py | 26 +- examples/cvode/CXX_parallel/plot_heat2D_p.py | 81 +- examples/cvode/CXX_parhyp/plot_heat2D_p.py | 81 +- examples/cvode/CXX_serial/plot_heat2D.py | 49 +- examples/cvode/serial/plot_cvParticle.py | 82 +- examples/cvode/serial/plot_cvPendulum.py | 63 +- examples/cvodes/serial/plot_cvsParticle.py | 82 +- examples/cvodes/serial/plot_cvsPendulum.py | 63 +- examples/utilities/plot_data_2d.py | 677 ++++--- examples/utilities/plot_data_time_series.py | 97 +- scripts/format.sh | 2 + test/compare_benchmarks.py | 97 +- test/compare_examples.py | 86 +- test/config_cmake.py | 1732 ++++++++++++----- test/notify.py | 53 +- test/test_install.py | 76 +- 39 files changed, 3220 insertions(+), 1999 deletions(-) diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-clang-format.yml index 2a87a2a35d..24f44b45ee 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-clang-format.yml @@ -15,6 +15,12 @@ jobs: apt update apt install -y git python3-pip + - name: Install black + run: pip install black + + - name: Print black version + run: black --version + - name: Install fprettify run: pip install fprettify diff --git a/benchmarks/advection_reaction_3D/scripts/compare_error.py b/benchmarks/advection_reaction_3D/scripts/compare_error.py index 2dc66d23fa..4dd1ff7ee1 100755 --- a/benchmarks/advection_reaction_3D/scripts/compare_error.py +++ b/benchmarks/advection_reaction_3D/scripts/compare_error.py @@ -15,7 +15,8 @@ import glob import sys import matplotlib -matplotlib.use('Agg') + +matplotlib.use("Agg") from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import pandas as pd @@ -25,57 +26,57 @@ # load pickled data def load_data(file): data = np.load(file) - m = data['mesh'] - t = data['t'] - u = data['u'] - v = data['v'] - w = data['w'] + m = data["mesh"] + t = data["t"] + u = data["u"] + v = data["v"] + w = data["w"] - hx = m[0,1] - m[0,0] - hy = m[1,1] - m[1,0] - hz = m[2,1] - m[2,0] + hx = m[0, 1] - m[0, 0] + hy = m[1, 1] - m[1, 0] + hz = m[2, 1] - m[2, 0] - return { 'm': m, 'h': (hx,hy,hz), 't': t, 'u': u, 'v': v, 'w': w } + return {"m": m, "h": (hx, hy, hz), "t": t, "u": u, "v": v, "w": w} # grid function norm def norm_3Dgrid(h, x, q=1): - hx,hy,hz = h + hx, hy, hz = h s = np.shape(x) - return (hx*hy*hz*np.sum(np.abs(x)**q, axis=(1,2,3)))**(1./q) + return (hx * hy * hz * np.sum(np.abs(x) ** q, axis=(1, 2, 3))) ** (1.0 / q) # load data files -np111 = load_data('np-111/output-with-h-8.33e-02.npz') -np211 = load_data('np-211/output-with-h-8.33e-02.npz') -np311 = load_data('np-311/output-with-h-8.33e-02.npz') -np131 = load_data('np-131/output-with-h-8.33e-02.npz') -np113 = load_data('np-113/output-with-h-8.33e-02.npz') -np911 = load_data('np-911/output-with-h-8.33e-02.npz') +np111 = load_data("np-111/output-with-h-8.33e-02.npz") +np211 = load_data("np-211/output-with-h-8.33e-02.npz") +np311 = load_data("np-311/output-with-h-8.33e-02.npz") +np131 = load_data("np-131/output-with-h-8.33e-02.npz") +np113 = load_data("np-113/output-with-h-8.33e-02.npz") +np911 = load_data("np-911/output-with-h-8.33e-02.npz") # np133 = load_data('np-133/output-with-h-8.33e-02.npz') -np313 = load_data('np-313/output-with-h-8.33e-02.npz') -np331 = load_data('np-331/output-with-h-8.33e-02.npz') -np333 = load_data('np-333/output-with-h-8.33e-02.npz') +np313 = load_data("np-313/output-with-h-8.33e-02.npz") +np331 = load_data("np-331/output-with-h-8.33e-02.npz") +np333 = load_data("np-333/output-with-h-8.33e-02.npz") # np666 = load_data('np-666/output-with-h-8.33e-02.npz') -for component in ['u', 'v', 'w']: +for component in ["u", "v", "w"]: # Reference solution ref = np111[component] # Now compute E(h) = ||U(h) - \bar{U}(h)|| using the grid-function norm - E_np211 = norm_3Dgrid(np211['h'], np211[component] - ref) - E_np311 = norm_3Dgrid(np311['h'], np311[component] - ref) - E_np131 = norm_3Dgrid(np131['h'], np131[component] - ref) - E_np113 = norm_3Dgrid(np113['h'], np113[component] - ref) - E_np911 = norm_3Dgrid(np911['h'], np911[component] - ref) + E_np211 = norm_3Dgrid(np211["h"], np211[component] - ref) + E_np311 = norm_3Dgrid(np311["h"], np311[component] - ref) + E_np131 = norm_3Dgrid(np131["h"], np131[component] - ref) + E_np113 = norm_3Dgrid(np113["h"], np113[component] - ref) + E_np911 = norm_3Dgrid(np911["h"], np911[component] - ref) # E_np133 = norm_3Dgrid(np133['h'], np133[component] - ref) - E_np313 = norm_3Dgrid(np313['h'], np313[component] - ref) - E_np331 = norm_3Dgrid(np331['h'], np331[component] - ref) - E_np333 = norm_3Dgrid(np333['h'], np333[component] - ref) + E_np313 = norm_3Dgrid(np313["h"], np313[component] - ref) + E_np331 = norm_3Dgrid(np331["h"], np331[component] - ref) + E_np333 = norm_3Dgrid(np333["h"], np333[component] - ref) # E_np666 = norm_3Dgrid(np666['h'], np666[component] - ref) # Plot error across time - X, Y = np.meshgrid(np111['m'][0,:], np111['t']) + X, Y = np.meshgrid(np111["m"][0, :], np111["t"]) # fig = plt.figure() # ax = plt.subplot(311, projection='3d') # ax.plot_surface(X, Y, np.abs(np911[component][:,:,0,0] - ref[:,:,0,0])) @@ -83,17 +84,17 @@ def norm_3Dgrid(h, x, q=1): # ax.plot_surface(X, Y, np.abs(np911[component][:,0,:,0] - ref[:,0,:,0])) # ax = plt.subplot(313, projection='3d') # ax.plot_surface(X, Y, np.abs(np911[component][:,0,0,:] - ref[:,0,0,:])) - plt.plot(np111['t'], E_np211) - plt.plot(np111['t'], E_np131) - plt.plot(np111['t'], E_np113) - plt.plot(np111['t'], E_np911) + plt.plot(np111["t"], E_np211) + plt.plot(np111["t"], E_np131) + plt.plot(np111["t"], E_np113) + plt.plot(np111["t"], E_np911) # plt.plot(np111['t'], E_np133) - plt.plot(np111['t'], E_np313) - plt.plot(np111['t'], E_np331) - plt.plot(np111['t'], E_np333) + plt.plot(np111["t"], E_np313) + plt.plot(np111["t"], E_np331) + plt.plot(np111["t"], E_np333) # plt.plot(np111['t'], E_np666) # plt.legend(['2 1 1', '3 1 1', '1 3 3', '3 1 3', '3 3 1', '3 3 3', '6 6 6']) # plt.legend(['3 1 1', '1 3 1', '1 1 3', '9 1 1', '1 3 3', '3 1 3', '3 3 1']) - plt.ylabel('||E(hx,hy,hz)||') - plt.xlabel('time') - plt.savefig('compare-error-plot-%s.png' % component) + plt.ylabel("||E(hx,hy,hz)||") + plt.xlabel("time") + plt.savefig("compare-error-plot-%s.png" % component) diff --git a/benchmarks/advection_reaction_3D/scripts/compute_error.py b/benchmarks/advection_reaction_3D/scripts/compute_error.py index 2c01826b29..85f151ed59 100755 --- a/benchmarks/advection_reaction_3D/scripts/compute_error.py +++ b/benchmarks/advection_reaction_3D/scripts/compute_error.py @@ -15,7 +15,8 @@ import glob import sys import matplotlib -matplotlib.use('Agg') + +matplotlib.use("Agg") import matplotlib.pyplot as plt import pandas as pd import numpy as np @@ -24,65 +25,67 @@ # load pickled data def load_data(file): data = np.load(file) - m = data['mesh'] - t = data['t'] - u = data['u'] - v = data['v'] - w = data['w'] + m = data["mesh"] + t = data["t"] + u = data["u"] + v = data["v"] + w = data["w"] - hx = m[0,1] - m[0,0] - hy = m[1,1] - m[1,0] - hz = m[2,1] - m[2,0] + hx = m[0, 1] - m[0, 0] + hy = m[1, 1] - m[1, 0] + hz = m[2, 1] - m[2, 0] - return { 'm': m, 'h': (hx,hy,hz), 't': t, 'u': u, 'v': v, 'w': w } + return {"m": m, "h": (hx, hy, hz), "t": t, "u": u, "v": v, "w": w} # grid function norm def norm_3Dgrid(h, x, q=1): - hx,hy,hz = h - return (hx*hy*hz*np.sum(np.abs(x)**q, axis=(1,2,3)))**(1/q) + hx, hy, hz = h + return (hx * hy * hz * np.sum(np.abs(x) ** q, axis=(1, 2, 3))) ** (1 / q) # computer order of accuracy p def calc_order(h1, Eh1, h2, Eh2): - return np.log( Eh1/Eh2 ) / np.log( np.prod(h1)/np.prod(h2) ) + return np.log(Eh1 / Eh2) / np.log(np.prod(h1) / np.prod(h2)) # load data files -h_over_8 = load_data('middle-h/output-with-h-1.04e-02.npz') -h_over_4 = load_data('large-h/output-with-h-2.08e-02.npz') +h_over_8 = load_data("middle-h/output-with-h-1.04e-02.npz") +h_over_4 = load_data("large-h/output-with-h-2.08e-02.npz") # h_over_2 = load_data('larger-h/output-with-h-4.16e-02.npz') -h_over_1 = load_data('largest-h/output-with-h-8.33e-02.npz') +h_over_1 = load_data("largest-h/output-with-h-8.33e-02.npz") -for component in ['u', 'v', 'w']: +for component in ["u", "v", "w"]: # Restrict reference to the coarsest grid - ref = h_over_8[component][:,::8,::8,::8] + ref = h_over_8[component][:, ::8, ::8, ::8] # Now compute E(h) = ||U(h) - \bar{U}(h)|| using the grid-function norm - Eh_over_4 = norm_3Dgrid(h_over_4['h'], h_over_4[component][:,::4,::4,::4] - ref) - Eh_over_1 = norm_3Dgrid(h_over_1['h'], h_over_1[component][:,:,:,:] - ref) + Eh_over_4 = norm_3Dgrid(h_over_4["h"], h_over_4[component][:, ::4, ::4, ::4] - ref) + Eh_over_1 = norm_3Dgrid(h_over_1["h"], h_over_1[component][:, :, :, :] - ref) # Compute order p as in O(h^p) - p = calc_order(h_over_1['h'], Eh_over_1, h_over_4['h'], Eh_over_4) - print('min p for %s component: %.4f' % (component, np.min(p))) + p = calc_order(h_over_1["h"], Eh_over_1, h_over_4["h"], Eh_over_4) + print("min p for %s component: %.4f" % (component, np.min(p))) # Plot error across time plt.figure() - plt.plot(h_over_8['t'], Eh_over_4, 'r-') - plt.plot(h_over_8['t'], Eh_over_1, 'b-') - plt.ylabel('||E(hx,hy,hz)||') - plt.xlabel('time') - plt.savefig('error-in-time-plot-%s.png' % component) + plt.plot(h_over_8["t"], Eh_over_4, "r-") + plt.plot(h_over_8["t"], Eh_over_1, "b-") + plt.ylabel("||E(hx,hy,hz)||") + plt.xlabel("time") + plt.savefig("error-in-time-plot-%s.png" % component) # Plot error norm with respect to h plt.figure() - x = np.array([np.prod(h_over_4['h']), np.prod(h_over_1['h'])]) - plt.plot(x, x, 'k-') - plt.plot(x, x**2, 'k-') - plt.plot(x, [np.linalg.norm(Eh_over_4, np.Inf), np.linalg.norm(Eh_over_1, np.Inf)], 'r-') - plt.legend(['1st order', '2nd order', 'actual']) - plt.ylabel('|| ||E(hx,hy,hz)|| ||_inf') - plt.xlabel('hx * hy * hz') - plt.yscale('log') - plt.xscale('log') - plt.savefig('error-plot-%s.png' % component) + x = np.array([np.prod(h_over_4["h"]), np.prod(h_over_1["h"])]) + plt.plot(x, x, "k-") + plt.plot(x, x**2, "k-") + plt.plot( + x, [np.linalg.norm(Eh_over_4, np.Inf), np.linalg.norm(Eh_over_1, np.Inf)], "r-" + ) + plt.legend(["1st order", "2nd order", "actual"]) + plt.ylabel("|| ||E(hx,hy,hz)|| ||_inf") + plt.xlabel("hx * hy * hz") + plt.yscale("log") + plt.xscale("log") + plt.savefig("error-plot-%s.png" % component) diff --git a/benchmarks/advection_reaction_3D/scripts/make_plots.py b/benchmarks/advection_reaction_3D/scripts/make_plots.py index 69a0168d79..a4dfa87840 100755 --- a/benchmarks/advection_reaction_3D/scripts/make_plots.py +++ b/benchmarks/advection_reaction_3D/scripts/make_plots.py @@ -22,218 +22,265 @@ # ------------------------------------------------------------------------------ + # utility functions def parallel_coords(rank): - if (rank == 0): + if rank == 0: return [0, 0, 0] - if (rank == 1): + if rank == 1: return [0, 0, 1] - if (rank == 2): + if rank == 2: return [0, 1, 0] - if (rank == 3): + if rank == 3: return [0, 1, 1] - if (rank == 4): + if rank == 4: return [1, 0, 0] - if (rank == 5): + if rank == 5: return [1, 0, 1] - if (rank == 6): + if rank == 6: return [1, 1, 0] - if (rank == 7): + if rank == 7: return [1, 1, 1] -def xslice(u,it,ix): - return u[it,ix,:,:] -def yslice(u,it,iy): - return u[it,:,iy,:] +def xslice(u, it, ix): + return u[it, ix, :, :] + + +def yslice(u, it, iy): + return u[it, :, iy, :] + + +def zslice(u, it, iz): + return u[it, :, :, iz] -def zslice(u,it,iz): - return u[it,:,:,iz] -def xproj(u,it): - return np.average(u[it,:,:,:], axis=0) +def xproj(u, it): + return np.average(u[it, :, :, :], axis=0) -def yproj(u,it): - return np.average(u[it,:,:,:], axis=1) -def zproj(u,it): - return np.average(u[it,:,:,:], axis=2) +def yproj(u, it): + return np.average(u[it, :, :, :], axis=1) -def myplot(axis, X, Y, Z, xlabel='none', ylabel='none'): + +def zproj(u, it): + return np.average(u[it, :, :, :], axis=2) + + +def myplot(axis, X, Y, Z, xlabel="none", ylabel="none"): frame = axis.contourf(X, Y, Z) plt.colorbar(frame, ax=axis) - if (xlabel != 'none'): + if xlabel != "none": axis.set_xlabel(xlabel) - if (ylabel != 'none'): + if ylabel != "none": axis.set_ylabel(ylabel) - # read time mesh times = np.loadtxt("t.000000.txt") nt = times.size # read spatial mesh mesh = np.loadtxt("mesh.txt", dtype=float) -x = mesh[0,:] -y = mesh[1,:] -z = mesh[2,:] +x = mesh[0, :] +y = mesh[1, :] +z = mesh[2, :] nx = x.size ny = y.size nz = z.size # ensure that the run used exactly 1 or 8 MPI ranks for i in range(9): - if (exists("u.00000" + str(i) + ".txt" ) and - not exists("u.00000" + str(i+1) + ".txt" )): - nprocs = i+1 -if ((nprocs != 1) and (nprocs != 8)): + if exists("u.00000" + str(i) + ".txt") and not exists( + "u.00000" + str(i + 1) + ".txt" + ): + nprocs = i + 1 +if (nprocs != 1) and (nprocs != 8): print("make_plots.py error: run must have used either 1 or 8 MPI ranks") exit() # load data for run -if (nprocs == 1): - u = np.zeros((nt,nx,ny,nz), dtype=float) - v = np.zeros((nt,nx,ny,nz), dtype=float) - w = np.zeros((nt,nx,ny,nz), dtype=float) +if nprocs == 1: + u = np.zeros((nt, nx, ny, nz), dtype=float) + v = np.zeros((nt, nx, ny, nz), dtype=float) + w = np.zeros((nt, nx, ny, nz), dtype=float) udata = np.loadtxt("u.000000.txt") vdata = np.loadtxt("v.000000.txt") wdata = np.loadtxt("w.000000.txt") - if (nt != udata.shape[0]): + if nt != udata.shape[0]: print("make_plots.py error: mesh and data have incompatible sizes") exit() - if (nx*ny*nz != udata.shape[1]): + if nx * ny * nz != udata.shape[1]: print("make_plots.py error: mesh and data have incompatible sizes") exit() for it in range(nt): - u[it,:,:,:] = np.reshape(udata[it,:], (nx,ny,nz), order='C') - v[it,:,:,:] = np.reshape(vdata[it,:], (nx,ny,nz), order='C') - w[it,:,:,:] = np.reshape(wdata[it,:], (nx,ny,nz), order='C') + u[it, :, :, :] = np.reshape(udata[it, :], (nx, ny, nz), order="C") + v[it, :, :, :] = np.reshape(vdata[it, :], (nx, ny, nz), order="C") + w[it, :, :, :] = np.reshape(wdata[it, :], (nx, ny, nz), order="C") else: - u = np.zeros((nt,nx,ny,nz), dtype=float) - v = np.zeros((nt,nx,ny,nz), dtype=float) - w = np.zeros((nt,nx,ny,nz), dtype=float) - nxl = nx//2 - nyl = ny//2 - nzl = nz//2 + u = np.zeros((nt, nx, ny, nz), dtype=float) + v = np.zeros((nt, nx, ny, nz), dtype=float) + w = np.zeros((nt, nx, ny, nz), dtype=float) + nxl = nx // 2 + nyl = ny // 2 + nzl = nz // 2 for ip in range(8): udata = np.loadtxt("u.00000" + str(ip) + ".txt") vdata = np.loadtxt("v.00000" + str(ip) + ".txt") wdata = np.loadtxt("w.00000" + str(ip) + ".txt") - if (nt != udata.shape[0]): + if nt != udata.shape[0]: print("make_plots.py error: mesh and data have incompatible sizes") exit() - if (nxl*nyl*nzl != udata.shape[1]): + if nxl * nyl * nzl != udata.shape[1]: print("make_plots.py error: mesh and data have incompatible sizes") exit() coords = parallel_coords(ip) - ilo = coords[0]*nxl - ihi = (coords[0]+1)*nxl - jlo = coords[1]*nyl - jhi = (coords[1]+1)*nyl - klo = coords[2]*nzl - khi = (coords[2]+1)*nzl + ilo = coords[0] * nxl + ihi = (coords[0] + 1) * nxl + jlo = coords[1] * nyl + jhi = (coords[1] + 1) * nyl + klo = coords[2] * nzl + khi = (coords[2] + 1) * nzl for it in range(nt): - u[it,ilo:ihi,jlo:jhi,klo:khi] = np.reshape(udata[it,:], (nxl,nyl,nzl), order='C') - v[it,ilo:ihi,jlo:jhi,klo:khi] = np.reshape(vdata[it,:], (nxl,nyl,nzl), order='C') - w[it,ilo:ihi,jlo:jhi,klo:khi] = np.reshape(wdata[it,:], (nxl,nyl,nzl), order='C') + u[it, ilo:ihi, jlo:jhi, klo:khi] = np.reshape( + udata[it, :], (nxl, nyl, nzl), order="C" + ) + v[it, ilo:ihi, jlo:jhi, klo:khi] = np.reshape( + vdata[it, :], (nxl, nyl, nzl), order="C" + ) + w[it, ilo:ihi, jlo:jhi, klo:khi] = np.reshape( + wdata[it, :], (nxl, nyl, nzl), order="C" + ) # set meshgrid objects -xy0,xy1 = np.meshgrid(x, y) -yz0,yz1 = np.meshgrid(y, z) -xz0,xz1 = np.meshgrid(x, z) +xy0, xy1 = np.meshgrid(x, y) +yz0, yz1 = np.meshgrid(y, z) +xz0, xz1 = np.meshgrid(x, z) # generate plots sliceidx = 25 tslice = [0, 5, 10] -figsize = (9,7) +figsize = (9, 7) # xy slices at various times plt.figure(1) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, xy0, xy1, zslice(u,tslice[0],sliceidx), ylabel = 'u') -myplot(ax2, xy0, xy1, zslice(u,tslice[1],sliceidx)) -myplot(ax3, xy0, xy1, zslice(u,tslice[2],sliceidx)) -myplot(ax4, xy0, xy1, zslice(v,tslice[0],sliceidx), ylabel = 'v') -myplot(ax5, xy0, xy1, zslice(v,tslice[1],sliceidx)) -myplot(ax6, xy0, xy1, zslice(v,tslice[2],sliceidx)) -myplot(ax7, xy0, xy1, zslice(w,tslice[0],sliceidx), ylabel = 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, xy0, xy1, zslice(w,tslice[1],sliceidx), xlabel = 't = ' + str(times[1])) -myplot(ax9, xy0, xy1, zslice(w,tslice[2],sliceidx), xlabel = 't = ' + str(times[2])) -plt.savefig('xy-slices.png') +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, xy0, xy1, zslice(u, tslice[0], sliceidx), ylabel="u") +myplot(ax2, xy0, xy1, zslice(u, tslice[1], sliceidx)) +myplot(ax3, xy0, xy1, zslice(u, tslice[2], sliceidx)) +myplot(ax4, xy0, xy1, zslice(v, tslice[0], sliceidx), ylabel="v") +myplot(ax5, xy0, xy1, zslice(v, tslice[1], sliceidx)) +myplot(ax6, xy0, xy1, zslice(v, tslice[2], sliceidx)) +myplot( + ax7, + xy0, + xy1, + zslice(w, tslice[0], sliceidx), + ylabel="w", + xlabel="t = " + str(times[0]), +) +myplot(ax8, xy0, xy1, zslice(w, tslice[1], sliceidx), xlabel="t = " + str(times[1])) +myplot(ax9, xy0, xy1, zslice(w, tslice[2], sliceidx), xlabel="t = " + str(times[2])) +plt.savefig("xy-slices.png") # yz slices at various times plt.figure(2) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, yz0, yz1, xslice(u,tslice[0],sliceidx), ylabel = 'u') -myplot(ax2, yz0, yz1, xslice(u,tslice[1],sliceidx)) -myplot(ax3, yz0, yz1, xslice(u,tslice[2],sliceidx)) -myplot(ax4, yz0, yz1, xslice(v,tslice[0],sliceidx), ylabel = 'v') -myplot(ax5, yz0, yz1, xslice(v,tslice[1],sliceidx)) -myplot(ax6, yz0, yz1, xslice(v,tslice[2],sliceidx)) -myplot(ax7, yz0, yz1, xslice(w,tslice[0],sliceidx), ylabel = 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, yz0, yz1, xslice(w,tslice[1],sliceidx), xlabel = 't = ' + str(times[1])) -myplot(ax9, yz0, yz1, xslice(w,tslice[2],sliceidx), xlabel = 't = ' + str(times[2])) -plt.savefig('yz-slices.png') +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, yz0, yz1, xslice(u, tslice[0], sliceidx), ylabel="u") +myplot(ax2, yz0, yz1, xslice(u, tslice[1], sliceidx)) +myplot(ax3, yz0, yz1, xslice(u, tslice[2], sliceidx)) +myplot(ax4, yz0, yz1, xslice(v, tslice[0], sliceidx), ylabel="v") +myplot(ax5, yz0, yz1, xslice(v, tslice[1], sliceidx)) +myplot(ax6, yz0, yz1, xslice(v, tslice[2], sliceidx)) +myplot( + ax7, + yz0, + yz1, + xslice(w, tslice[0], sliceidx), + ylabel="w", + xlabel="t = " + str(times[0]), +) +myplot(ax8, yz0, yz1, xslice(w, tslice[1], sliceidx), xlabel="t = " + str(times[1])) +myplot(ax9, yz0, yz1, xslice(w, tslice[2], sliceidx), xlabel="t = " + str(times[2])) +plt.savefig("yz-slices.png") # xz slices at various times plt.figure(3) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, xz0, xz1, yslice(u,tslice[0],sliceidx), ylabel ='u') -myplot(ax2, xz0, xz1, yslice(u,tslice[1],sliceidx)) -myplot(ax3, xz0, xz1, yslice(u,tslice[2],sliceidx)) -myplot(ax4, xz0, xz1, yslice(v,tslice[0],sliceidx), ylabel = 'v') -myplot(ax5, xz0, xz1, yslice(v,tslice[1],sliceidx)) -myplot(ax6, xz0, xz1, yslice(v,tslice[2],sliceidx)) -myplot(ax7, xz0, xz1, yslice(w,tslice[0],sliceidx), ylabel= 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, xz0, xz1, yslice(w,tslice[1],sliceidx), xlabel ='t = ' + str(times[1])) -myplot(ax9, xz0, xz1, yslice(w,tslice[2],sliceidx), xlabel = 't = ' + str(times[2])) -plt.savefig('xz-slices.png') +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, xz0, xz1, yslice(u, tslice[0], sliceidx), ylabel="u") +myplot(ax2, xz0, xz1, yslice(u, tslice[1], sliceidx)) +myplot(ax3, xz0, xz1, yslice(u, tslice[2], sliceidx)) +myplot(ax4, xz0, xz1, yslice(v, tslice[0], sliceidx), ylabel="v") +myplot(ax5, xz0, xz1, yslice(v, tslice[1], sliceidx)) +myplot(ax6, xz0, xz1, yslice(v, tslice[2], sliceidx)) +myplot( + ax7, + xz0, + xz1, + yslice(w, tslice[0], sliceidx), + ylabel="w", + xlabel="t = " + str(times[0]), +) +myplot(ax8, xz0, xz1, yslice(w, tslice[1], sliceidx), xlabel="t = " + str(times[1])) +myplot(ax9, xz0, xz1, yslice(w, tslice[2], sliceidx), xlabel="t = " + str(times[2])) +plt.savefig("xz-slices.png") # xy projection at various times plt.figure(4) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, xy0, xy1, zproj(u,tslice[0]), ylabel = 'u') -myplot(ax2, xy0, xy1, zproj(u,tslice[1])) -myplot(ax3, xy0, xy1, zproj(u,tslice[2])) -myplot(ax4, xy0, xy1, zproj(v,tslice[0]), ylabel = 'v') -myplot(ax5, xy0, xy1, zproj(v,tslice[1])) -myplot(ax6, xy0, xy1, zproj(v,tslice[2])) -myplot(ax7, xy0, xy1, zproj(w,tslice[0]), ylabel = 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, xy0, xy1, zproj(w,tslice[1]), xlabel = 't = ' + str(times[1])) -myplot(ax9, xy0, xy1, zproj(w,tslice[2]), xlabel = 't = ' + str(times[2])) -plt.savefig('xy-projections.png') +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, xy0, xy1, zproj(u, tslice[0]), ylabel="u") +myplot(ax2, xy0, xy1, zproj(u, tslice[1])) +myplot(ax3, xy0, xy1, zproj(u, tslice[2])) +myplot(ax4, xy0, xy1, zproj(v, tslice[0]), ylabel="v") +myplot(ax5, xy0, xy1, zproj(v, tslice[1])) +myplot(ax6, xy0, xy1, zproj(v, tslice[2])) +myplot(ax7, xy0, xy1, zproj(w, tslice[0]), ylabel="w", xlabel="t = " + str(times[0])) +myplot(ax8, xy0, xy1, zproj(w, tslice[1]), xlabel="t = " + str(times[1])) +myplot(ax9, xy0, xy1, zproj(w, tslice[2]), xlabel="t = " + str(times[2])) +plt.savefig("xy-projections.png") # yz projection at various times fig = plt.figure(5) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, yz0, yz1, xproj(u,tslice[0]), ylabel = 'u') -myplot(ax2, yz0, yz1, xproj(u,tslice[1])) -myplot(ax3, yz0, yz1, xproj(u,tslice[2])) -myplot(ax4, yz0, yz1, xproj(v,tslice[0]), ylabel = 'v') -myplot(ax5, yz0, yz1, xproj(v,tslice[1])) -myplot(ax6, yz0, yz1, xproj(v,tslice[2])) -myplot(ax7, yz0, yz1, xproj(w,tslice[0]), ylabel = 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, yz0, yz1, xproj(w,tslice[1]), xlabel = 't = ' + str(times[1])) -myplot(ax9, yz0, yz1, xproj(w,tslice[2]), xlabel = 't = ' + str(times[2])) -plt.savefig('yz-projections.png') +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, yz0, yz1, xproj(u, tslice[0]), ylabel="u") +myplot(ax2, yz0, yz1, xproj(u, tslice[1])) +myplot(ax3, yz0, yz1, xproj(u, tslice[2])) +myplot(ax4, yz0, yz1, xproj(v, tslice[0]), ylabel="v") +myplot(ax5, yz0, yz1, xproj(v, tslice[1])) +myplot(ax6, yz0, yz1, xproj(v, tslice[2])) +myplot(ax7, yz0, yz1, xproj(w, tslice[0]), ylabel="w", xlabel="t = " + str(times[0])) +myplot(ax8, yz0, yz1, xproj(w, tslice[1]), xlabel="t = " + str(times[1])) +myplot(ax9, yz0, yz1, xproj(w, tslice[2]), xlabel="t = " + str(times[2])) +plt.savefig("yz-projections.png") # xz projection at various times fig = plt.figure(6) -fig, ((ax1,ax2,ax3), (ax4,ax5,ax6), (ax7,ax8,ax9)) = plt.subplots(3, 3, sharex=True, sharey=True, figsize=figsize) -myplot(ax1, xz0, xz1, yproj(u,tslice[0]), ylabel = 'u') -myplot(ax2, xz0, xz1, yproj(u,tslice[1])) -myplot(ax3, xz0, xz1, yproj(u,tslice[2])) -myplot(ax4, xz0, xz1, yproj(v,tslice[0]), ylabel = 'v') -myplot(ax5, xz0, xz1, yproj(v,tslice[1])) -myplot(ax6, xz0, xz1, yproj(v,tslice[2])) -myplot(ax7, xz0, xz1, yproj(w,tslice[0]), ylabel = 'w', xlabel = 't = ' + str(times[0])) -myplot(ax8, xz0, xz1, yproj(w,tslice[1]), xlabel = 't = ' + str(times[1])) -myplot(ax9, xz0, xz1, yproj(w,tslice[2]), xlabel = 't = ' + str(times[2])) -plt.savefig('xz-projections.png') - -#plt.show() +fig, ((ax1, ax2, ax3), (ax4, ax5, ax6), (ax7, ax8, ax9)) = plt.subplots( + 3, 3, sharex=True, sharey=True, figsize=figsize +) +myplot(ax1, xz0, xz1, yproj(u, tslice[0]), ylabel="u") +myplot(ax2, xz0, xz1, yproj(u, tslice[1])) +myplot(ax3, xz0, xz1, yproj(u, tslice[2])) +myplot(ax4, xz0, xz1, yproj(v, tslice[0]), ylabel="v") +myplot(ax5, xz0, xz1, yproj(v, tslice[1])) +myplot(ax6, xz0, xz1, yproj(v, tslice[2])) +myplot(ax7, xz0, xz1, yproj(w, tslice[0]), ylabel="w", xlabel="t = " + str(times[0])) +myplot(ax8, xz0, xz1, yproj(w, tslice[1]), xlabel="t = " + str(times[1])) +myplot(ax9, xz0, xz1, yproj(w, tslice[2]), xlabel="t = " + str(times[2])) +plt.savefig("xz-projections.png") + +# plt.show() plt.close() ##### end of script ##### diff --git a/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py b/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py index 407c34921a..a51fade40f 100755 --- a/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py +++ b/benchmarks/advection_reaction_3D/scripts/pickle_solution_output.py @@ -19,39 +19,66 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('mesh.txt', dtype=np.double) +mesh = np.loadtxt("mesh.txt", dtype=np.double) # X,Y,Z = np.meshgrid(mesh[0,:], mesh[1,:], mesh[2,:]) # calculate h -hx = mesh[0,1] - mesh[0,0] -hy = mesh[1,1] - mesh[1,0] -hz = mesh[2,1] - mesh[2,0] -nx = len(mesh[0,:]) -ny = len(mesh[1,:]) -nz = len(mesh[2,:]) +hx = mesh[0, 1] - mesh[0, 0] +hy = mesh[1, 1] - mesh[1, 0] +hz = mesh[2, 1] - mesh[2, 0] +nx = len(mesh[0, :]) +ny = len(mesh[1, :]) +nz = len(mesh[2, :]) print("nx, ny, nz = %d, %d, %d" % (nx, ny, nz)) print("hx, hy, hz = %g, %g, %g" % (hx, hy, hz)) # load output time file -times = np.loadtxt('t.000000.txt', dtype=np.double) +times = np.loadtxt("t.000000.txt", dtype=np.double) # load solution data files -ufiles = glob.glob('u.' + ('[0-9]'*6) + '.txt'); ufiles.sort() -vfiles = glob.glob('v.' + ('[0-9]'*6) + '.txt'); vfiles.sort() -wfiles = glob.glob('w.' + ('[0-9]'*6) + '.txt'); wfiles.sort() +ufiles = glob.glob("u." + ("[0-9]" * 6) + ".txt") +ufiles.sort() +vfiles = glob.glob("v." + ("[0-9]" * 6) + ".txt") +vfiles.sort() +wfiles = glob.glob("w." + ("[0-9]" * 6) + ".txt") +wfiles.sort() udata = [] vdata = [] wdata = [] sys.stdout.write("reading 1/%d...\r" % len(ufiles)) sys.stdout.flush() -for idx in range(0,len(ufiles)): - sys.stdout.write("reading %d/%d...\r" % (idx+1,len(ufiles))) +for idx in range(0, len(ufiles)): + sys.stdout.write("reading %d/%d...\r" % (idx + 1, len(ufiles))) sys.stdout.flush() - udata.append(pd.read_csv(ufiles[idx], header=None, delimiter=' ', skipinitialspace=True, dtype=np.double)) - vdata.append(pd.read_csv(vfiles[idx], header=None, delimiter=' ', skipinitialspace=True, dtype=np.double)) - wdata.append(pd.read_csv(wfiles[idx], header=None, delimiter=' ', skipinitialspace=True, dtype=np.double)) + udata.append( + pd.read_csv( + ufiles[idx], + header=None, + delimiter=" ", + skipinitialspace=True, + dtype=np.double, + ) + ) + vdata.append( + pd.read_csv( + vfiles[idx], + header=None, + delimiter=" ", + skipinitialspace=True, + dtype=np.double, + ) + ) + wdata.append( + pd.read_csv( + wfiles[idx], + header=None, + delimiter=" ", + skipinitialspace=True, + dtype=np.double, + ) + ) sys.stdout.write("\n") sys.stdout.flush() @@ -69,5 +96,6 @@ # save data to pickle print("saving...") -np.savez_compressed('output-with-h-%.2e.npz' % hx, t=times, u=udata, v=vdata, w=wdata, mesh=mesh) - +np.savez_compressed( + "output-with-h-%.2e.npz" % hx, t=times, u=udata, v=vdata, w=wdata, mesh=mesh +) diff --git a/benchmarks/nvector/plot_nvector_performance_results.py b/benchmarks/nvector/plot_nvector_performance_results.py index 02c45665e6..55bb5ae32e 100755 --- a/benchmarks/nvector/plot_nvector_performance_results.py +++ b/benchmarks/nvector/plot_nvector_performance_results.py @@ -20,6 +20,7 @@ # indicates if timing was enabled. # ----------------------------------------------------------------------------- + def main(): import argparse @@ -35,42 +36,60 @@ def main(): import matplotlib.ticker as mtick parser = argparse.ArgumentParser( - description='Plot data from NVector performance tests') - - parser.add_argument('op', type=str, - help='Which NVector operation to plot') - - parser.add_argument('datadir', type=str, - help='Directory where test output files are located') - - parser.add_argument('--timevelem', dest='timevelem', action='store_true', - help='Turn on plots for time vs number of elements') - - parser.add_argument('--noheatmap', dest='heatmap', action='store_false', - help='Turn off heatmap plots') - - parser.add_argument('--loglog', dest='loglog', action='store_true', - help='Generate loglog plots for time vs number of elements') - - parser.add_argument('--show', dest='show', action='store_true', - help='Display plots rather than saving to file') - - parser.add_argument('--debug', dest='debug', action='store_true', - help='Turn on debugging output') + description="Plot data from NVector performance tests" + ) + + parser.add_argument("op", type=str, help="Which NVector operation to plot") + + parser.add_argument( + "datadir", type=str, help="Directory where test output files are located" + ) + + parser.add_argument( + "--timevelem", + dest="timevelem", + action="store_true", + help="Turn on plots for time vs number of elements", + ) + + parser.add_argument( + "--noheatmap", + dest="heatmap", + action="store_false", + help="Turn off heatmap plots", + ) + + parser.add_argument( + "--loglog", + dest="loglog", + action="store_true", + help="Generate loglog plots for time vs number of elements", + ) + + parser.add_argument( + "--show", + dest="show", + action="store_true", + help="Display plots rather than saving to file", + ) + + parser.add_argument( + "--debug", dest="debug", action="store_true", help="Turn on debugging output" + ) # parse command line args args = parser.parse_args() - if (args.debug): + if args.debug: print(args) # check for test data directory - if (not os.path.isdir(args.datadir)): - print("ERROR:",args.datadir,"does not exist") + if not os.path.isdir(args.datadir): + print("ERROR:", args.datadir, "does not exist") sys.exit() # sort output files - output = sorted(glob.glob(args.datadir+'/output*.txt')) + output = sorted(glob.glob(args.datadir + "/output*.txt")) # if (args.debug): # print("output files") @@ -80,8 +99,8 @@ def main(): # figure out vector sizes, number of vectors, and number of sums nelem = [] - nvec = [] - nsum = [] + nvec = [] + nsum = [] ntest = [] # parse file names to get input parameters @@ -95,32 +114,32 @@ def main(): ns = int(split_fout[3]) nt = int(split_fout[4]) - if (not ne in nelem): + if not ne in nelem: nelem.append(ne) - if (not nv in nvec): + if not nv in nvec: nvec.append(nv) - if (not ns in nsum): + if not ns in nsum: nsum.append(ns) - if (not nt in ntest): + if not nt in ntest: ntest.append(nt) - if (len(ntest) != 1): + if len(ntest) != 1: print("Warning: Unequal numbers of tests") - if (args.debug): - print("nelem:",nelem, len(nelem)) - print("nvec: ",nvec, len(nvec)) - print("nsum: ",nsum, len(nsum)) - print("ntest:",ntest, len(ntest)) + if args.debug: + print("nelem:", nelem, len(nelem)) + print("nvec: ", nvec, len(nvec)) + print("nsum: ", nsum, len(nsum)) + print("ntest:", ntest, len(ntest)) # allocate numpy arrays for timing data - avg_fused = np.zeros([len(nvec), len(nelem)]) + avg_fused = np.zeros([len(nvec), len(nelem)]) sdev_fused = np.zeros([len(nvec), len(nelem)]) - avg_unfused = np.zeros([len(nvec), len(nelem)]) + avg_unfused = np.zeros([len(nvec), len(nelem)]) sdev_unfused = np.zeros([len(nvec), len(nelem)]) avg_ratio = np.zeros([len(nvec), len(nelem)]) @@ -131,8 +150,8 @@ def main(): # read output files for f in output: - if (args.debug): - print("Reading:",f) + if args.debug: + print("Reading:", f) # get test inputs from file name split_fout = f.split("/")[-1] @@ -149,15 +168,15 @@ def main(): split_line = shlex.split(line) # skip blank lines - if (not split_line): + if not split_line: continue # tests finished, stop reading file - if (split_line[0] == "Finished"): + if split_line[0] == "Finished": break # check if the operation is the one we want and get data - if (args.op == split_line[0]): + if args.op == split_line[0]: i = nvec.index(nv) j = nelem.index(ne) @@ -165,15 +184,15 @@ def main(): # NVEC[i][j] = nv # NELM[i][j] = ne - avg_fused[i][j] = float(split_line[1]) + avg_fused[i][j] = float(split_line[1]) sdev_fused[i][j] = float(split_line[2]) - avg_unfused[i][j] = float(split_line[5]) + avg_unfused[i][j] = float(split_line[5]) sdev_unfused[i][j] = float(split_line[6]) avg_ratio[i][j] = avg_fused[i][j] / avg_unfused[i][j] - if (args.debug): + if args.debug: print(avg_fused) print(avg_unfused) print(avg_ratio) @@ -185,35 +204,37 @@ def main(): # -------------------------------------------------------------------------- # allocate arrays for the upper and lower bounds of the confidence interval - lower_fused = np.zeros([len(nvec), len(nelem)]) - upper_fused = np.zeros([len(nvec), len(nelem)]) + lower_fused = np.zeros([len(nvec), len(nelem)]) + upper_fused = np.zeros([len(nvec), len(nelem)]) lower_unfused = np.zeros([len(nvec), len(nelem)]) upper_unfused = np.zeros([len(nvec), len(nelem)]) # critical value for 99% confidence interval - if (ntest[0] < 30): + if ntest[0] < 30: # student's t distribution - cv = st.t.interval(0.99, ntest[0]-1)[1] + cv = st.t.interval(0.99, ntest[0] - 1)[1] else: # normal distribution cv = st.norm.ppf(0.995) # confidence intervals - cdev_fused = cv * sdev_fused / np.sqrt(ntest[0]) + cdev_fused = cv * sdev_fused / np.sqrt(ntest[0]) lower_fused = avg_fused - cdev_fused upper_fused = avg_fused + cdev_fused - cdev_unfused = cv * sdev_unfused / np.sqrt(ntest[0]) + cdev_unfused = cv * sdev_unfused / np.sqrt(ntest[0]) lower_unfused = avg_unfused - cdev_unfused upper_unfused = avg_unfused + cdev_unfused # check if the fused average times are within the unfused confidence interval - fused_in = np.where(np.logical_and(avg_fused < upper_unfused, - avg_fused > lower_unfused)) + fused_in = np.where( + np.logical_and(avg_fused < upper_unfused, avg_fused > lower_unfused) + ) # check if the unfused average times are within the fused confidence interval - unfused_in = np.where(np.logical_and(avg_unfused < upper_fused, - avg_unfused > lower_fused)) + unfused_in = np.where( + np.logical_and(avg_unfused < upper_fused, avg_unfused > lower_fused) + ) # get which numbers of vectors and elements for fused tests are in the # confidence interval of the unfused times @@ -226,7 +247,7 @@ def main(): ef[i] = np.log2(nelem[fused_in[1][i]]) df[i] = 1 - if (args.debug): + if args.debug: print(vf) print(ef) @@ -241,7 +262,7 @@ def main(): eu[i] = np.log2(nelem[unfused_in[1][i]]) du[i] = 1 - if (args.debug): + if args.debug: print(vu) print(eu) @@ -266,20 +287,20 @@ def main(): # print(NELM) # print(avg_ratio) for i in reversed(range(len(nvec))): - print('%2d' % int(i+1), str(avg_ratio[i]).replace('\n', '')) + print("%2d" % int(i + 1), str(avg_ratio[i]).replace("\n", "")) print # -------------------------------------------------------------------------- # Heat Map # -------------------------------------------------------------------------- - if (args.heatmap): + if args.heatmap: - x = np.arange(len(nelem)+1)-0.5 # x = log2(number of elements) = 0,1,2,... - y = np.arange(len(nvec)+1)+1.5 # y = number of vectors = 2,3,4,... + x = np.arange(len(nelem) + 1) - 0.5 # x = log2(number of elements) = 0,1,2,... + y = np.arange(len(nvec) + 1) + 1.5 # y = number of vectors = 2,3,4,... # y = np.arange(len(nvec)+1)+0.5 # y = number of vectors = 1,2,3,... X, Y = np.meshgrid(x, y) - if (args.debug): + if args.debug: print(x) print(y) @@ -287,67 +308,79 @@ def main(): rmax = np.amax(avg_ratio) rmin = np.amin(avg_ratio) - ext = 'neither' - if (rmin > 1): - cmap='Reds' - norm = mpl.colors.Normalize(vmin=rmin, vmax=min(rmax,2)) - v = np.linspace(rmin, min(rmax,2), 10, endpoint=True) - if (rmax > 2): - ext = 'max' + ext = "neither" + if rmin > 1: + cmap = "Reds" + norm = mpl.colors.Normalize(vmin=rmin, vmax=min(rmax, 2)) + v = np.linspace(rmin, min(rmax, 2), 10, endpoint=True) + if rmax > 2: + ext = "max" else: - cmap='seismic' - if (rmax-1 > 1): + cmap = "seismic" + if rmax - 1 > 1: rrange = 1 - ext = 'max' + ext = "max" else: - rrange = max(abs(rmax-1),abs(rmin-1)) + rrange = max(abs(rmax - 1), abs(rmin - 1)) - v1 = np.linspace(1-rrange, 1, 5, endpoint=True) - v2 = np.linspace(1, 1+rrange, 5, endpoint=True) - v = np.append(v1,v2[1:]) - norm = mpl.colors.Normalize(vmin=1-rrange, vmax=1+rrange) + v1 = np.linspace(1 - rrange, 1, 5, endpoint=True) + v2 = np.linspace(1, 1 + rrange, 5, endpoint=True) + v = np.append(v1, v2[1:]) + norm = mpl.colors.Normalize(vmin=1 - rrange, vmax=1 + rrange) # plot heatmap plt.pcolormesh(X, Y, avg_ratio, cmap=cmap, norm=norm) clb = plt.colorbar(ticks=v, extend=ext) - clb.ax.set_title('Max = {0:.2f}\nMin = {1:.2f}'.format(rmax,rmin)) + clb.ax.set_title("Max = {0:.2f}\nMin = {1:.2f}".format(rmax, rmin)) # aff markers to indicate if the average time falls in a confidence interval - plt.scatter(ef,vf,s=40,marker='^',c=df,label='fused') - plt.scatter(eu,vu,s=40,marker='v',c=du,label='unfused') + plt.scatter(ef, vf, s=40, marker="^", c=df, label="fused") + plt.scatter(eu, vu, s=40, marker="v", c=du, label="unfused") plt.legend(loc=9, bbox_to_anchor=(0.5, -0.1), ncol=2) # add legend for scatter plot art = [] - lgd = plt.legend(loc='lower right', bbox_to_anchor=(1.34, -0.17)) + lgd = plt.legend(loc="lower right", bbox_to_anchor=(1.34, -0.17)) art.append(lgd) # add labels and title plt.xticks(np.log2(nelem)) plt.yticks(nvec) - plt.xlabel('log2(num elements)') - plt.ylabel('num vectors') - plt.title('avg fused time / avg unfused time \n'+args.op) + plt.xlabel("log2(num elements)") + plt.ylabel("num vectors") + plt.title("avg fused time / avg unfused time \n" + args.op) # display or save figure - if (args.show): + if args.show: plt.show() else: - plt.savefig(args.op+'-heatmap.pdf', - additional_artists=art, - bbox_inches="tight") + plt.savefig( + args.op + "-heatmap.pdf", additional_artists=art, bbox_inches="tight" + ) plt.close() # -------------------------------------------------------------------------- # Time vs Number of Elements Plots # -------------------------------------------------------------------------- - if (args.timevelem): - - colors = ['#000000','#a6cee3','#1f78b4','#b2df8a','#33a02c', - '#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6', - '#6a3d9a','#ffff99','#b15928'] - - hatch = [ '/','\\','-','+','x','o','O','.','*'] + if args.timevelem: + + colors = [ + "#000000", + "#a6cee3", + "#1f78b4", + "#b2df8a", + "#33a02c", + "#fb9a99", + "#e31a1c", + "#fdbf6f", + "#ff7f00", + "#cab2d6", + "#6a3d9a", + "#ffff99", + "#b15928", + ] + + hatch = ["/", "\\", "-", "+", "x", "o", "O", ".", "*"] # -------------------------------------------------------------------------- # Combined Number of Vectors Plots @@ -359,38 +392,45 @@ def main(): i = nvec.index(nv) - if (args.loglog): - ax.loglog(nelem, avg_fused[i], - color=colors[i], linestyle='-', label=nv) - ax.loglog(nelem, avg_unfused[i], - color=colors[i], linestyle='--', label=None) + if args.loglog: + ax.loglog(nelem, avg_fused[i], color=colors[i], linestyle="-", label=nv) + ax.loglog( + nelem, avg_unfused[i], color=colors[i], linestyle="--", label=None + ) else: - ax.plot(nelem, avg_fused[i], - color=colors[i], linestyle='-', label=nv) - ax.plot(nelem, avg_unfused[i], - color=colors[i], linestyle='--', label=None) + ax.plot(nelem, avg_fused[i], color=colors[i], linestyle="-", label=nv) + ax.plot( + nelem, avg_unfused[i], color=colors[i], linestyle="--", label=None + ) # plot confidence interval - ax.fill_between(nelem, lower_fused[i], upper_fused[i], - color=colors[i], alpha=0.3) - ax.fill_between(nelem, lower_unfused[i], upper_unfused[i], - color=colors[i], hatch='.', alpha=0.3) + ax.fill_between( + nelem, lower_fused[i], upper_fused[i], color=colors[i], alpha=0.3 + ) + ax.fill_between( + nelem, + lower_unfused[i], + upper_unfused[i], + color=colors[i], + hatch=".", + alpha=0.3, + ) ax.legend() ax.grid() - plt.title('Average Time Fused vs Unfused \n'+args.op) - plt.xlabel('vector length') - plt.ylabel('time (s)') + plt.title("Average Time Fused vs Unfused \n" + args.op) + plt.xlabel("vector length") + plt.ylabel("time (s)") - if (args.show): + if args.show: plt.show() else: - if (args.loglog): - fname=args.op+'-nvec-all-loglog.pdf' + if args.loglog: + fname = args.op + "-nvec-all-loglog.pdf" else: - fname=args.op+'-nvec-all.pdf' - plt.ticklabel_format(axis='both',style='sci') + fname = args.op + "-nvec-all.pdf" + plt.ticklabel_format(axis="both", style="sci") plt.savefig(fname) plt.close() @@ -400,49 +440,70 @@ def main(): for nv in nvec: fig = plt.figure() - ax = fig.add_subplot(111) + ax = fig.add_subplot(111) idx = nvec.index(nv) # plot run times - if (args.loglog): - ax.loglog(nelem, avg_fused[idx], - color='red', linestyle='-', label='Fused') - ax.loglog(nelem, avg_unfused[idx], - color='blue', linestyle='--', label='Unfused') + if args.loglog: + ax.loglog( + nelem, avg_fused[idx], color="red", linestyle="-", label="Fused" + ) + ax.loglog( + nelem, + avg_unfused[idx], + color="blue", + linestyle="--", + label="Unfused", + ) else: - ax.plot(nelem, avg_fused[idx], - color='red', linestyle='-', label='Fused') - ax.plot(nelem, avg_unfused[idx], - color='blue', linestyle='--', label='Unfused') + ax.plot( + nelem, avg_fused[idx], color="red", linestyle="-", label="Fused" + ) + ax.plot( + nelem, + avg_unfused[idx], + color="blue", + linestyle="--", + label="Unfused", + ) # plot confidence intervals - ax.fill_between(nelem, lower_fused[idx], upper_fused[idx], - color='red', alpha=0.2) - ax.fill_between(nelem, lower_unfused[idx], upper_unfused[idx], - color='blue', hatch='.', alpha=0.2) + ax.fill_between( + nelem, lower_fused[idx], upper_fused[idx], color="red", alpha=0.2 + ) + ax.fill_between( + nelem, + lower_unfused[idx], + upper_unfused[idx], + color="blue", + hatch=".", + alpha=0.2, + ) ax.legend() ax.grid() - plt.title('Average Time Fused vs Unfused with '+str(nv)+' vectors\n'+args.op) - plt.xlabel('vector length') - ax.set_ylabel('time (s)') + plt.title( + "Average Time Fused vs Unfused with " + str(nv) + " vectors\n" + args.op + ) + plt.xlabel("vector length") + ax.set_ylabel("time (s)") - if (args.show): + if args.show: plt.show() else: - if (args.loglog): - fname=args.op+'-nvec-'+str(nv)+'-loglog.pdf' + if args.loglog: + fname = args.op + "-nvec-" + str(nv) + "-loglog.pdf" else: - fname=args.op+'-nvec-'+str(nv)+'.pdf' - plt.ticklabel_format(axis='both',style='sci') + fname = args.op + "-nvec-" + str(nv) + ".pdf" + plt.ticklabel_format(axis="both", style="sci") plt.savefig(fname) plt.close() + # =============================================================================== if __name__ == "__main__": main() # EOF - diff --git a/benchmarks/nvector/plot_nvector_performance_speedup.py b/benchmarks/nvector/plot_nvector_performance_speedup.py index fb421f5573..623d716c01 100755 --- a/benchmarks/nvector/plot_nvector_performance_speedup.py +++ b/benchmarks/nvector/plot_nvector_performance_speedup.py @@ -20,6 +20,7 @@ # indicates if timing was enabled. # ----------------------------------------------------------------------------- + def main(): import argparse @@ -35,46 +36,61 @@ def main(): import matplotlib.ticker as mtick parser = argparse.ArgumentParser( - description='Plot data from NVector performance tests') - - parser.add_argument('op', type=str, - help='Which NVector operation to plot') - - parser.add_argument('datadir', type=str, - help='Directory where test output files are located') - - parser.add_argument('--noplots', dest='noplots', action='store_true', - help='Turn on plots for time vs number of elements') - - parser.add_argument('--logx', dest='logx', action='store_true', - help='Generate plots for speedup with log scale for the x axis (number of elements') - - parser.add_argument('--fused', dest='fused', action='store_true', - help='Operation is a fused op') - - parser.add_argument('--show', dest='show', action='store_true', - help='Display plots rather than saving to file') - - parser.add_argument('--debug', dest='debug', action='store_true', - help='Turn on debugging output') + description="Plot data from NVector performance tests" + ) + + parser.add_argument("op", type=str, help="Which NVector operation to plot") + + parser.add_argument( + "datadir", type=str, help="Directory where test output files are located" + ) + + parser.add_argument( + "--noplots", + dest="noplots", + action="store_true", + help="Turn on plots for time vs number of elements", + ) + + parser.add_argument( + "--logx", + dest="logx", + action="store_true", + help="Generate plots for speedup with log scale for the x axis (number of elements", + ) + + parser.add_argument( + "--fused", dest="fused", action="store_true", help="Operation is a fused op" + ) + + parser.add_argument( + "--show", + dest="show", + action="store_true", + help="Display plots rather than saving to file", + ) + + parser.add_argument( + "--debug", dest="debug", action="store_true", help="Turn on debugging output" + ) # parse command line args args = parser.parse_args() - if (args.debug): + if args.debug: print(args) # check for test data directory - if (not os.path.isdir(args.datadir)): - print("ERROR:",args.datadir,"does not exist") + if not os.path.isdir(args.datadir): + print("ERROR:", args.datadir, "does not exist") sys.exit() # sort output files - output_baseline = sorted(glob.glob(args.datadir+'/output*-old.log')) - output_new = sorted(glob.glob(args.datadir+'/output*-new.log')) + output_baseline = sorted(glob.glob(args.datadir + "/output*-old.log")) + output_new = sorted(glob.glob(args.datadir + "/output*-new.log")) output = output_baseline + output_new - if (args.debug): + if args.debug: print("output files") print(len(output)) for i in range(len(output)): @@ -82,8 +98,8 @@ def main(): # figure out vector sizes, number of vectors, and number of sums nelem = [] - nvec = [] - nsum = [] + nvec = [] + nsum = [] ntest = [] # parse file names to get input parameters @@ -97,40 +113,40 @@ def main(): ns = int(split_fout[3]) nt = int(split_fout[4]) - if (not ne in nelem): + if not ne in nelem: nelem.append(ne) - if (not nv in nvec): + if not nv in nvec: nvec.append(nv) - if (not ns in nsum): + if not ns in nsum: nsum.append(ns) - if (not nt in ntest): + if not nt in ntest: ntest.append(nt) - if (len(ntest) != 1): + if len(ntest) != 1: print("Warning: Unequal numbers of tests") nelem.sort() - if (args.debug): - print("nelem:",nelem, len(nelem)) - print("nvec: ",nvec, len(nvec)) - print("nsum: ",nsum, len(nsum)) - print("ntest:",ntest, len(ntest)) + if args.debug: + print("nelem:", nelem, len(nelem)) + print("nvec: ", nvec, len(nvec)) + print("nsum: ", nsum, len(nsum)) + print("ntest:", ntest, len(ntest)) # allocate numpy arrays for timing data - avg_denom = np.zeros([len(nvec), len(nelem)]) + avg_denom = np.zeros([len(nvec), len(nelem)]) sdev_denom = np.zeros([len(nvec), len(nelem)]) - avg_numer = np.zeros([len(nvec), len(nelem)]) + avg_numer = np.zeros([len(nvec), len(nelem)]) sdev_numer = np.zeros([len(nvec), len(nelem)]) avg_ratio = np.zeros([len(nvec), len(nelem)]) # read 'baseline' files for f in output_baseline: - if (args.debug): - print("Reading:",f) + if args.debug: + print("Reading:", f) # get test inputs from file name split_fout = f.split("/")[-1] split_fout = split_fout.split("_") @@ -142,22 +158,22 @@ def main(): # split line into list split_line = shlex.split(line) # skip blank lines - if (not split_line): + if not split_line: continue # tests finished, stop reading file - if (split_line[0] == "Finished"): + if split_line[0] == "Finished": break # check if the operation is the one we want and get data - if (args.op == split_line[0]): + if args.op == split_line[0]: i = nvec.index(nv) j = nelem.index(ne) - avg_numer[i][j] = float(split_line[1]) + avg_numer[i][j] = float(split_line[1]) sdev_numer[i][j] = float(split_line[2]) # read output files for f in output_new: - if (args.debug): - print("Reading:",f) + if args.debug: + print("Reading:", f) # get test inputs from file name split_fout = f.split("/")[-1] split_fout = split_fout.split("_") @@ -169,16 +185,16 @@ def main(): # split line into list split_line = shlex.split(line) # skip blank lines - if (not split_line): + if not split_line: continue # tests finished, stop reading file - if (split_line[0] == "Finished"): + if split_line[0] == "Finished": break # check if the operation is the one we want and get data - if (args.op == split_line[0]): + if args.op == split_line[0]: i = nvec.index(nv) j = nelem.index(ne) - avg_denom[i][j] = float(split_line[1]) + avg_denom[i][j] = float(split_line[1]) sdev_denom[i][j] = float(split_line[2]) avg_ratio[i][j] = avg_numer[i][j] / avg_denom[i][j] @@ -187,35 +203,37 @@ def main(): # -------------------------------------------------------------------------- # allocate arrays for the upper and lower bounds of the confidence interval - lower_denom = np.zeros([len(nvec), len(nelem)]) - upper_denom = np.zeros([len(nvec), len(nelem)]) + lower_denom = np.zeros([len(nvec), len(nelem)]) + upper_denom = np.zeros([len(nvec), len(nelem)]) lower_numer = np.zeros([len(nvec), len(nelem)]) upper_numer = np.zeros([len(nvec), len(nelem)]) # critical value for 99% confidence interval - if (ntest[0] < 30): + if ntest[0] < 30: # student's t distribution - cv = st.t.interval(0.99, ntest[0]-1)[1] + cv = st.t.interval(0.99, ntest[0] - 1)[1] else: # normal distribution cv = st.norm.ppf(0.995) # confidence intervals - cdev_denom = cv * sdev_denom / np.sqrt(ntest[0]) + cdev_denom = cv * sdev_denom / np.sqrt(ntest[0]) lower_denom = avg_denom - cdev_denom upper_denom = avg_denom + cdev_denom - cdev_numer = cv * sdev_numer / np.sqrt(ntest[0]) + cdev_numer = cv * sdev_numer / np.sqrt(ntest[0]) lower_numer = avg_numer - cdev_numer upper_numer = avg_numer + cdev_numer # check if the new average times are within the baseline confidence interval - denom_in = np.where(np.logical_and(avg_denom < upper_numer, - avg_denom > lower_numer)) + denom_in = np.where( + np.logical_and(avg_denom < upper_numer, avg_denom > lower_numer) + ) # check if the baseline average times are within the new confidence interval - numer_in = np.where(np.logical_and(avg_numer < upper_denom, - avg_numer > lower_denom)) + numer_in = np.where( + np.logical_and(avg_numer < upper_denom, avg_numer > lower_denom) + ) # get which numbers of vectors and elements for new tests are in the # confidence interval of the baseline times @@ -228,9 +246,9 @@ def main(): ef[i] = np.log2(nelem[denom_in[1][i]]) df[i] = 1 - if (args.debug): - print('vf:', vf) - print('ef:', ef) + if args.debug: + print("vf:", vf) + print("ef:", ef) # get which numbers of vectors and elements for baseline tests are in the # confidence interval of the new times @@ -243,9 +261,9 @@ def main(): eu[i] = np.log2(nelem[numer_in[1][i]]) du[i] = 1 - if (args.debug): - print('vu:', vu) - print('eu:', eu) + if args.debug: + print("vu:", vu) + print("eu:", eu) # -------------------------------------------------------------------------- # Output ratios @@ -256,29 +274,41 @@ def main(): print("avg. new") for i in reversed(range(len(nvec))): - print('%2d' % int(i+1), str(avg_denom[i]).replace('\n', '')) + print("%2d" % int(i + 1), str(avg_denom[i]).replace("\n", "")) print() print("avg. baseline") for i in reversed(range(len(nvec))): - print('%2d' % int(i+1), str(avg_numer[i]).replace('\n', '')) + print("%2d" % int(i + 1), str(avg_numer[i]).replace("\n", "")) print() print("avg. ratio (speedup)") for i in reversed(range(len(nvec))): - print('%2d' % int(i+1), str(avg_ratio[i]).replace('\n', '')) + print("%2d" % int(i + 1), str(avg_ratio[i]).replace("\n", "")) print() # -------------------------------------------------------------------------- # Speedup v. Number of Elements Plots # -------------------------------------------------------------------------- - if (not args.noplots): - - colors = ['#000000','#a6cee3','#1f78b4','#b2df8a','#33a02c', - '#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6', - '#6a3d9a','#ffff99','#b15928'] - - hatch = [ '/','\\','-','+','x','o','O','.','*'] + if not args.noplots: + + colors = [ + "#000000", + "#a6cee3", + "#1f78b4", + "#b2df8a", + "#33a02c", + "#fb9a99", + "#e31a1c", + "#fdbf6f", + "#ff7f00", + "#cab2d6", + "#6a3d9a", + "#ffff99", + "#b15928", + ] + + hatch = ["/", "\\", "-", "+", "x", "o", "O", ".", "*"] # -------------------------------------------------------------------------- # Combined Number of Vectors Plots @@ -287,19 +317,17 @@ def main(): ax = fig.add_subplot(111) if args.fused: - indices = range(0,len(nvec)) + indices = range(0, len(nvec)) else: - indices = range(len(nvec)-1,len(nvec)) + indices = range(len(nvec) - 1, len(nvec)) for i in indices: - lab = 'num. vecs %d' % nvec[i] - if (args.logx): - ax.plot(nelem, avg_ratio[i], - color=colors[i], linestyle='-', label=lab) - ax.set_xscale('log') + lab = "num. vecs %d" % nvec[i] + if args.logx: + ax.plot(nelem, avg_ratio[i], color=colors[i], linestyle="-", label=lab) + ax.set_xscale("log") else: - ax.plot(nelem, avg_ratio[i], - color=colors[i], linestyle='-', label=lab) + ax.plot(nelem, avg_ratio[i], color=colors[i], linestyle="-", label=lab) # # plot confidence interval # ax.fill_between(nelem, lower_denom[i], upper_denom[i], # color=colors[i], alpha=0.3) @@ -309,18 +337,18 @@ def main(): ax.legend() ax.grid() - plt.title('Average Speedup \n'+args.op) - plt.xlabel('vector length') - plt.ylabel('speedup (baseline/new)') + plt.title("Average Speedup \n" + args.op) + plt.xlabel("vector length") + plt.ylabel("speedup (baseline/new)") - if (args.show): + if args.show: plt.show() else: - if (args.logx): - fname=args.op+'-nvec-all-logx.pdf' + if args.logx: + fname = args.op + "-nvec-all-logx.pdf" else: - fname=args.op+'-nvec-all.pdf' - plt.ticklabel_format(axis='both',style='sci') + fname = args.op + "-nvec-all.pdf" + plt.ticklabel_format(axis="both", style="sci") plt.savefig(fname) plt.close() diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 473409d987..a01897bdf2 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -184,10 +184,11 @@ not adhere to all of these rules. variable-length arrays. Exceptions are allowed when interfacing with a library which requires a newer standard. -#. All new code added to SUNDIALS should be - formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_, - and `fprettify <https://github.com/fortran-lang/fprettify>`_. - See :ref:`Style.Formatting` for details. +#. All new code added to SUNDIALS should be formatted with `clang-format + <https://clang.llvm.org/docs/ClangFormat.html>`_ for C/C++, `fprettify + <https://github.com/fortran-lang/fprettify>`_ for Fortran, and `black + <https://black.readthedocs.io>`_ for Python. See :ref:`Style.Formatting` for + details. #. Spaces not tabs. @@ -378,11 +379,14 @@ Formatting ---------- All new code added to SUNDIALS should be formatted with `clang-format -<https://clang.llvm.org/docs/ClangFormat.html>`_ and -`fprettify <https://github.com/fortran-lang/fprettify>`_. The -``.clang-format`` file in the root of the project defines our configuration -for clang-format. We use the default fprettify settings, except we use -2-space indentation. To apply ``clang-format`` and ``fprettify`` you can run: +<https://clang.llvm.org/docs/ClangFormat.html>`_ for C/C++, `fprettify +<https://github.com/fortran-lang/fprettify>`_ for Fortran, and `black +<https://black.readthedocs.io>`_ for Python. The ``.clang-format`` file in the +root of the project defines our configuration for clang-format. We use the +default fprettify settings, except we use 2-space indentation. We also use the +default black settings. + +To apply ``clang-format``, ``fprettify``, and ``black`` you can run: .. code-block:: shell @@ -395,7 +399,7 @@ for clang-format. We use the default fprettify settings, except we use that you use version ``17.0.4``, which can be installed from source or with Spack. Alternatively, when you open a pull request on GitHub, an action will run ``clang-format`` on the code. If any formatting is required, the action will fail and produce a git patch artifact that you can download - (from the job artifacts section) and apply with `git apply`. + (from the job artifacts section) and apply with ``git apply``. If clang-format breaks lines in a way that is unreadable, use ``//`` to break the line. For example, diff --git a/examples/arkode/CXX_parallel/plot_brusselator1D.py b/examples/arkode/CXX_parallel/plot_brusselator1D.py index 2bcc7d1af7..087577ff0e 100755 --- a/examples/arkode/CXX_parallel/plot_brusselator1D.py +++ b/examples/arkode/CXX_parallel/plot_brusselator1D.py @@ -22,33 +22,36 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('mesh.txt', dtype=np.double) +mesh = np.loadtxt("mesh.txt", dtype=np.double) # load output time file -times = np.loadtxt('t.000000.txt', dtype=np.double) +times = np.loadtxt("t.000000.txt", dtype=np.double) # load solution data files -ufiles = glob.glob('u.' + ('[0-9]'*6) + '.txt'); ufiles.sort() -vfiles = glob.glob('v.' + ('[0-9]'*6) + '.txt'); vfiles.sort() -wfiles = glob.glob('w.' + ('[0-9]'*6) + '.txt'); wfiles.sort() +ufiles = glob.glob("u." + ("[0-9]" * 6) + ".txt") +ufiles.sort() +vfiles = glob.glob("v." + ("[0-9]" * 6) + ".txt") +vfiles.sort() +wfiles = glob.glob("w." + ("[0-9]" * 6) + ".txt") +wfiles.sort() udata = np.loadtxt(ufiles[0], dtype=np.double) vdata = np.loadtxt(vfiles[0], dtype=np.double) wdata = np.loadtxt(wfiles[0], dtype=np.double) -for idx in range(1,len(ufiles)): +for idx in range(1, len(ufiles)): udata = np.hstack((udata, np.loadtxt(ufiles[idx], dtype=np.double))) vdata = np.hstack((vdata, np.loadtxt(vfiles[idx], dtype=np.double))) wdata = np.hstack((wdata, np.loadtxt(wfiles[idx], dtype=np.double))) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() xmax = mesh.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() @@ -57,39 +60,39 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'solution.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "solution." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, xmax, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() # set string constants for output plots, current time, mesh size -pname = 'solution_at_x0.png' +pname = "solution_at_x0.png" xstr = repr(mesh[0]) # plot current solution and save to disk plt.figure(1) -plt.plot(times,udata[:,0],label="u") -plt.plot(times,vdata[:,0],label="v") -plt.plot(times,wdata[:,0],label="w") -plt.xlabel('t') -plt.ylabel('solution') -plt.title('Solutions at output at x = '+xstr) +plt.plot(times, udata[:, 0], label="u") +plt.plot(times, vdata[:, 0], label="v") +plt.plot(times, wdata[:, 0], label="w") +plt.xlabel("t") +plt.ylabel("solution") +plt.title("Solutions at output at x = " + xstr) plt.axis((times[0], times[-1], minval, maxval)) plt.grid() -plt.legend(loc='upper right', shadow=True) +plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/CXX_parallel/plot_heat2D_p.py b/examples/arkode/CXX_parallel/plot_heat2D_p.py index 7b7f83d929..0a99dfbc5e 100755 --- a/examples/arkode/CXX_parallel/plot_heat2D_p.py +++ b/examples/arkode/CXX_parallel/plot_heat2D_p.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read MPI root process problem info file -infofile = 'heat2d_info.00000.txt' +infofile = "heat2d_info.00000.txt" with open(infofile) as fn: @@ -59,7 +59,7 @@ continue # total number of MPI processes - if "np"in line: + if "np" in line: nprocs = int(text[1]) continue @@ -71,11 +71,11 @@ # ------------------------------------------------------------------------------ # load subdomain information, store in table -subdomains = np.zeros((nprocs,4), dtype=np.int) +subdomains = np.zeros((nprocs, 4), dtype=np.int) for i in range(nprocs): - infofile = 'heat2d_info.' + repr(i).zfill(5) + '.txt' + infofile = "heat2d_info." + repr(i).zfill(5) + ".txt" with open(infofile) as fn: @@ -87,62 +87,64 @@ # x-direction starting index if "is" in line: - subdomains[i,0] = float(text[1]) + subdomains[i, 0] = float(text[1]) continue # x-direction ending index if "ie" in line: - subdomains[i,1] = float(text[1]) + subdomains[i, 1] = float(text[1]) continue # y-direction starting index if "js" in line: - subdomains[i,2] = float(text[1]) + subdomains[i, 2] = float(text[1]) continue # y-direction ending index if "je" in line: - subdomains[i,3] = float(text[1]) + subdomains[i, 3] = float(text[1]) continue # ------------------------------------------------------------------------------ # check if the error was output -fname = 'heat2d_error.00000.txt' +fname = "heat2d_error.00000.txt" if os.path.isfile(fname): - plottype = ['solution', 'error'] + plottype = ["solution", "error"] else: - plottype = ['solution'] + plottype = ["solution"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) for i in range(nprocs): - datafile = 'heat2d_' + pt + '.' + repr(i).zfill(5) + '.txt' + datafile = "heat2d_" + pt + "." + repr(i).zfill(5) + ".txt" # load data data = np.loadtxt(datafile, dtype=np.double) - if (np.shape(data)[0] != nt): - sys.exit('error: subdomain ' + i + ' has an incorrect number of time steps') + if np.shape(data)[0] != nt: + sys.exit("error: subdomain " + i + " has an incorrect number of time steps") # subdomain indices - istart = subdomains[i,0] - iend = subdomains[i,1] - jstart = subdomains[i,2] - jend = subdomains[i,3] - nxl = iend - istart + 1 - nyl = jend - jstart + 1 + istart = subdomains[i, 0] + iend = subdomains[i, 1] + jstart = subdomains[i, 2] + jend = subdomains[i, 3] + nxl = iend - istart + 1 + nyl = jend - jstart + 1 # extract data for i in range(nt): - time[i] = data[i,0] - result[i,jstart:jend+1,istart:iend+1] = np.reshape(data[i,1:], (nyl,nxl)) + time[i] = data[i, 0] + result[i, jstart : jend + 1, istart : iend + 1] = np.reshape( + data[i, 1:], (nyl, nxl) + ) # determine extents of plots maxtemp = 1.1 * result.max() @@ -151,7 +153,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -160,24 +162,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/arkode/CXX_parhyp/plot_heat2D_p.py b/examples/arkode/CXX_parhyp/plot_heat2D_p.py index 7b7f83d929..0a99dfbc5e 100755 --- a/examples/arkode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/arkode/CXX_parhyp/plot_heat2D_p.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read MPI root process problem info file -infofile = 'heat2d_info.00000.txt' +infofile = "heat2d_info.00000.txt" with open(infofile) as fn: @@ -59,7 +59,7 @@ continue # total number of MPI processes - if "np"in line: + if "np" in line: nprocs = int(text[1]) continue @@ -71,11 +71,11 @@ # ------------------------------------------------------------------------------ # load subdomain information, store in table -subdomains = np.zeros((nprocs,4), dtype=np.int) +subdomains = np.zeros((nprocs, 4), dtype=np.int) for i in range(nprocs): - infofile = 'heat2d_info.' + repr(i).zfill(5) + '.txt' + infofile = "heat2d_info." + repr(i).zfill(5) + ".txt" with open(infofile) as fn: @@ -87,62 +87,64 @@ # x-direction starting index if "is" in line: - subdomains[i,0] = float(text[1]) + subdomains[i, 0] = float(text[1]) continue # x-direction ending index if "ie" in line: - subdomains[i,1] = float(text[1]) + subdomains[i, 1] = float(text[1]) continue # y-direction starting index if "js" in line: - subdomains[i,2] = float(text[1]) + subdomains[i, 2] = float(text[1]) continue # y-direction ending index if "je" in line: - subdomains[i,3] = float(text[1]) + subdomains[i, 3] = float(text[1]) continue # ------------------------------------------------------------------------------ # check if the error was output -fname = 'heat2d_error.00000.txt' +fname = "heat2d_error.00000.txt" if os.path.isfile(fname): - plottype = ['solution', 'error'] + plottype = ["solution", "error"] else: - plottype = ['solution'] + plottype = ["solution"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) for i in range(nprocs): - datafile = 'heat2d_' + pt + '.' + repr(i).zfill(5) + '.txt' + datafile = "heat2d_" + pt + "." + repr(i).zfill(5) + ".txt" # load data data = np.loadtxt(datafile, dtype=np.double) - if (np.shape(data)[0] != nt): - sys.exit('error: subdomain ' + i + ' has an incorrect number of time steps') + if np.shape(data)[0] != nt: + sys.exit("error: subdomain " + i + " has an incorrect number of time steps") # subdomain indices - istart = subdomains[i,0] - iend = subdomains[i,1] - jstart = subdomains[i,2] - jend = subdomains[i,3] - nxl = iend - istart + 1 - nyl = jend - jstart + 1 + istart = subdomains[i, 0] + iend = subdomains[i, 1] + jstart = subdomains[i, 2] + jend = subdomains[i, 3] + nxl = iend - istart + 1 + nyl = jend - jstart + 1 # extract data for i in range(nt): - time[i] = data[i,0] - result[i,jstart:jend+1,istart:iend+1] = np.reshape(data[i,1:], (nyl,nxl)) + time[i] = data[i, 0] + result[i, jstart : jend + 1, istart : iend + 1] = np.reshape( + data[i, 1:], (nyl, nxl) + ) # determine extents of plots maxtemp = 1.1 * result.max() @@ -151,7 +153,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -160,24 +162,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/arkode/CXX_serial/plot_heat2D.py b/examples/arkode/CXX_serial/plot_heat2D.py index 6c97cdc112..c494bc06de 100755 --- a/examples/arkode/CXX_serial/plot_heat2D.py +++ b/examples/arkode/CXX_serial/plot_heat2D.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read problem info file -infofile = 'heat2d_info.txt' +infofile = "heat2d_info.txt" with open(infofile) as fn: @@ -66,26 +66,26 @@ # ------------------------------------------------------------------------------ # check if the error was output -fname = 'heat2d_error.txt' +fname = "heat2d_error.txt" if os.path.isfile(fname): - plottype = ['solution', 'error'] + plottype = ["solution", "error"] else: - plottype = ['solution'] + plottype = ["solution"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) # load data - data = np.loadtxt('heat2d_' + pt + '.txt', dtype=np.double) + data = np.loadtxt("heat2d_" + pt + ".txt", dtype=np.double) # extract data for i in range(nt): - time[i] = data[i,0] - result[i,0:ny+1,0:nx+1] = np.reshape(data[i,1:], (ny,nx)) + time[i] = data[i, 0] + result[i, 0 : ny + 1, 0 : nx + 1] = np.reshape(data[i, 1:], (ny, nx)) # determine extents of plots maxtemp = 1.1 * result.max() @@ -94,7 +94,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -103,24 +103,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/arkode/CXX_serial/plot_sol.py b/examples/arkode/CXX_serial/plot_sol.py index ab463fac6c..fe3d875340 100755 --- a/examples/arkode/CXX_serial/plot_sol.py +++ b/examples/arkode/CXX_serial/plot_sol.py @@ -20,16 +20,16 @@ import numpy as np # load solution data file -data = np.loadtxt('solution.txt', dtype=np.double) +data = np.loadtxt("solution.txt", dtype=np.double) # determine number of time steps, number of fields -nt,nv = np.shape(data) +nt, nv = np.shape(data) # extract time array -times = data[:,0] +times = data[:, 0] # parse comment line to determine solution names -f = open('solution.txt', 'r') +f = open("solution.txt", "r") commentline = f.readline() commentsplit = commentline.split() names = commentsplit[2:] @@ -38,18 +38,16 @@ plt.figure() # add curves to figure -for i in range(nv-1): - plt.plot(times,data[:,i+1],label=names[i]) -plt.xlabel('t') -if (nv > 2): - plt.ylabel('solutions') +for i in range(nv - 1): + plt.plot(times, data[:, i + 1], label=names[i]) +plt.xlabel("t") +if nv > 2: + plt.ylabel("solutions") else: - plt.ylabel('solution') -plt.legend(loc='upper right', shadow=True) + plt.ylabel("solution") +plt.legend(loc="upper right", shadow=True) plt.grid() -plt.savefig('solution.png') - - +plt.savefig("solution.png") ##### end of script ##### diff --git a/examples/arkode/CXX_xbraid/plot_heat2D.py b/examples/arkode/CXX_xbraid/plot_heat2D.py index 72aaa2adea..f24592bfdc 100755 --- a/examples/arkode/CXX_xbraid/plot_heat2D.py +++ b/examples/arkode/CXX_xbraid/plot_heat2D.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read problem info file -infofile = 'heat2d_info.txt' +infofile = "heat2d_info.txt" with open(infofile) as fn: @@ -66,17 +66,17 @@ # ------------------------------------------------------------------------------ # check if the error was output -fname = 'heat2d_error.000000.txt' +fname = "heat2d_error.000000.txt" if os.path.isfile(fname): - plottype = ['solution', 'error'] + plottype = ["solution", "error"] else: - plottype = ['solution'] + plottype = ["solution"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) tindex = range(0, nt) @@ -86,14 +86,14 @@ for t in tindex: # output file name - datafile = 'heat2d_' + pt + '.' + repr(t).zfill(6) + '.txt' + datafile = "heat2d_" + pt + "." + repr(t).zfill(6) + ".txt" # load data data = np.loadtxt(datafile, dtype=np.double) # extract data time[i] = data[0] - result[i,0:ny+1,0:nx+1] = np.reshape(data[1:], (ny,nx)) + result[i, 0 : ny + 1, 0 : nx + 1] = np.reshape(data[1:], (ny, nx)) i += 1 # determine extents of plots @@ -103,7 +103,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -112,24 +112,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(6) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(6) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/arkode/C_manyvector/plot_brusselator1D.py b/examples/arkode/C_manyvector/plot_brusselator1D.py index 3cc29051e5..72a3402c4a 100755 --- a/examples/arkode/C_manyvector/plot_brusselator1D.py +++ b/examples/arkode/C_manyvector/plot_brusselator1D.py @@ -20,23 +20,23 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('bruss_mesh.txt', dtype=np.double) +mesh = np.loadtxt("bruss_mesh.txt", dtype=np.double) # load solution data files -udata = np.loadtxt('bruss_u.txt', dtype=np.double) -vdata = np.loadtxt('bruss_v.txt', dtype=np.double) -wdata = np.loadtxt('bruss_w.txt', dtype=np.double) +udata = np.loadtxt("bruss_u.txt", dtype=np.double) +vdata = np.loadtxt("bruss_v.txt", dtype=np.double) +wdata = np.loadtxt("bruss_w.txt", dtype=np.double) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() @@ -44,21 +44,21 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'brusselator1D.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "brusselator1D." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/C_openmp/plot_brusselator1D.py b/examples/arkode/C_openmp/plot_brusselator1D.py index 3cc29051e5..72a3402c4a 100755 --- a/examples/arkode/C_openmp/plot_brusselator1D.py +++ b/examples/arkode/C_openmp/plot_brusselator1D.py @@ -20,23 +20,23 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('bruss_mesh.txt', dtype=np.double) +mesh = np.loadtxt("bruss_mesh.txt", dtype=np.double) # load solution data files -udata = np.loadtxt('bruss_u.txt', dtype=np.double) -vdata = np.loadtxt('bruss_v.txt', dtype=np.double) -wdata = np.loadtxt('bruss_w.txt', dtype=np.double) +udata = np.loadtxt("bruss_u.txt", dtype=np.double) +vdata = np.loadtxt("bruss_v.txt", dtype=np.double) +wdata = np.loadtxt("bruss_w.txt", dtype=np.double) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() @@ -44,21 +44,21 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'brusselator1D.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "brusselator1D." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/C_parallel/plot_brusselator1D.py b/examples/arkode/C_parallel/plot_brusselator1D.py index 2bcc7d1af7..087577ff0e 100755 --- a/examples/arkode/C_parallel/plot_brusselator1D.py +++ b/examples/arkode/C_parallel/plot_brusselator1D.py @@ -22,33 +22,36 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('mesh.txt', dtype=np.double) +mesh = np.loadtxt("mesh.txt", dtype=np.double) # load output time file -times = np.loadtxt('t.000000.txt', dtype=np.double) +times = np.loadtxt("t.000000.txt", dtype=np.double) # load solution data files -ufiles = glob.glob('u.' + ('[0-9]'*6) + '.txt'); ufiles.sort() -vfiles = glob.glob('v.' + ('[0-9]'*6) + '.txt'); vfiles.sort() -wfiles = glob.glob('w.' + ('[0-9]'*6) + '.txt'); wfiles.sort() +ufiles = glob.glob("u." + ("[0-9]" * 6) + ".txt") +ufiles.sort() +vfiles = glob.glob("v." + ("[0-9]" * 6) + ".txt") +vfiles.sort() +wfiles = glob.glob("w." + ("[0-9]" * 6) + ".txt") +wfiles.sort() udata = np.loadtxt(ufiles[0], dtype=np.double) vdata = np.loadtxt(vfiles[0], dtype=np.double) wdata = np.loadtxt(wfiles[0], dtype=np.double) -for idx in range(1,len(ufiles)): +for idx in range(1, len(ufiles)): udata = np.hstack((udata, np.loadtxt(ufiles[idx], dtype=np.double))) vdata = np.hstack((vdata, np.loadtxt(vfiles[idx], dtype=np.double))) wdata = np.hstack((wdata, np.loadtxt(wfiles[idx], dtype=np.double))) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() xmax = mesh.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() @@ -57,39 +60,39 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'solution.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "solution." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, xmax, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() # set string constants for output plots, current time, mesh size -pname = 'solution_at_x0.png' +pname = "solution_at_x0.png" xstr = repr(mesh[0]) # plot current solution and save to disk plt.figure(1) -plt.plot(times,udata[:,0],label="u") -plt.plot(times,vdata[:,0],label="v") -plt.plot(times,wdata[:,0],label="w") -plt.xlabel('t') -plt.ylabel('solution') -plt.title('Solutions at output at x = '+xstr) +plt.plot(times, udata[:, 0], label="u") +plt.plot(times, vdata[:, 0], label="v") +plt.plot(times, wdata[:, 0], label="w") +plt.xlabel("t") +plt.ylabel("solution") +plt.title("Solutions at output at x = " + xstr) plt.axis((times[0], times[-1], minval, maxval)) plt.grid() -plt.legend(loc='upper right', shadow=True) +plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/C_serial/ark_kepler_plot.py b/examples/arkode/C_serial/ark_kepler_plot.py index 2d499d850e..7a50dc3ebb 100755 --- a/examples/arkode/C_serial/ark_kepler_plot.py +++ b/examples/arkode/C_serial/ark_kepler_plot.py @@ -19,70 +19,72 @@ import matplotlib.pyplot as plt import argparse -parser = argparse.ArgumentParser(description='Script for plotting the energy, angular momentum, and phase space solution for ark_kepler.c') -parser.add_argument('output_times', help='file with the output times') -parser.add_argument('solution', help='file with the solution') -parser.add_argument('conserved_quantities', help='file with conserved quantities') +parser = argparse.ArgumentParser( + description="Script for plotting the energy, angular momentum, and phase space solution for ark_kepler.c" +) +parser.add_argument("output_times", help="file with the output times") +parser.add_argument("solution", help="file with the solution") +parser.add_argument("conserved_quantities", help="file with conserved quantities") args = parser.parse_args() t = np.loadtxt(args.output_times, dtype=np.float64) y = np.loadtxt(args.solution, dtype=np.float64) -y = np.reshape(y, (y.shape[0]//4, 4)) +y = np.reshape(y, (y.shape[0] // 4, 4)) plt.figure(dpi=200) -plt.plot(y[:,0], y[:,1]) -plt.savefig('ark_kepler_phase.png') +plt.plot(y[:, 0], y[:, 1]) +plt.savefig("ark_kepler_phase.png") plt.close() -conserved = np.loadtxt(args.conserved_quantities, delimiter=',', dtype=np.float64) -energy = conserved[:,0] -energy_0 = conserved[0,0] -L = conserved[:,1] -L_0 = conserved[0,1] +conserved = np.loadtxt(args.conserved_quantities, delimiter=",", dtype=np.float64) +energy = conserved[:, 0] +energy_0 = conserved[0, 0] +L = conserved[:, 1] +L_0 = conserved[0, 1] plt.figure(dpi=200) -plt.title('Energy') +plt.title("Energy") plt.plot(t, np.abs(energy)) -plt.ylabel('H(t,p,q)') -plt.xlabel('<--- t --->') -plt.xscale('log') -plt.savefig('ark_kepler_energy.png') +plt.ylabel("H(t,p,q)") +plt.xlabel("<--- t --->") +plt.xscale("log") +plt.savefig("ark_kepler_energy.png") plt.close() plt.figure(dpi=200) -plt.title('Momentum') +plt.title("Momentum") plt.plot(t, L) -plt.ylabel('L(t,p,q)') -plt.xlabel('<--- t --->') -plt.xscale('log') -plt.savefig('ark_kepler_momentum.png') +plt.ylabel("L(t,p,q)") +plt.xlabel("<--- t --->") +plt.xscale("log") +plt.savefig("ark_kepler_momentum.png") plt.close() # # Time plot. # plt.figure(dpi=200) -plt.plot(t, y[:,0], linewidth = 2) -plt.plot(t, y[:,1], linewidth = 2) -plt.plot(t, y[:,2], linewidth = 2) -plt.plot(t, y[:,3], linewidth = 2) +plt.plot(t, y[:, 0], linewidth=2) +plt.plot(t, y[:, 1], linewidth=2) +plt.plot(t, y[:, 2], linewidth=2) +plt.plot(t, y[:, 3], linewidth=2) plt.grid(True) -plt.legend(['P', 'P\'', 'Q', 'Q\'']) -plt.xlabel('<--- t --->') -plt.ylabel('<--- y(1:4) --->') -plt.title('Solution in Time') -plt.savefig('ark_kepler_plot.png') +plt.legend(["P", "P'", "Q", "Q'"]) +plt.xlabel("<--- t --->") +plt.ylabel("<--- y(1:4) --->") +plt.title("Solution in Time") +plt.savefig("ark_kepler_plot.png") plt.close() # # Phase plot. # plt.figure(dpi=200) -plt.plot(y[:,0], y[:,1], linewidth=0.1) +plt.plot(y[:, 0], y[:, 1], linewidth=0.1) plt.grid(True) -plt.xlabel('<--- y1 --->') -plt.ylabel('<--- y2 --->') -plt.title('Phase Plot') -plt.savefig('ark_kepler_phase.png') +plt.xlabel("<--- y1 --->") +plt.ylabel("<--- y2 --->") +plt.title("Phase Plot") +plt.savefig("ark_kepler_phase.png") plt.close() diff --git a/examples/arkode/C_serial/plot_brusselator1D.py b/examples/arkode/C_serial/plot_brusselator1D.py index 3cc29051e5..72a3402c4a 100755 --- a/examples/arkode/C_serial/plot_brusselator1D.py +++ b/examples/arkode/C_serial/plot_brusselator1D.py @@ -20,23 +20,23 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('bruss_mesh.txt', dtype=np.double) +mesh = np.loadtxt("bruss_mesh.txt", dtype=np.double) # load solution data files -udata = np.loadtxt('bruss_u.txt', dtype=np.double) -vdata = np.loadtxt('bruss_v.txt', dtype=np.double) -wdata = np.loadtxt('bruss_w.txt', dtype=np.double) +udata = np.loadtxt("bruss_u.txt", dtype=np.double) +vdata = np.loadtxt("bruss_v.txt", dtype=np.double) +wdata = np.loadtxt("bruss_w.txt", dtype=np.double) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() @@ -44,21 +44,21 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'brusselator1D.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "brusselator1D." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/C_serial/plot_brusselator1D_FEM.py b/examples/arkode/C_serial/plot_brusselator1D_FEM.py index d47bf2b40e..61bbf4f069 100755 --- a/examples/arkode/C_serial/plot_brusselator1D_FEM.py +++ b/examples/arkode/C_serial/plot_brusselator1D_FEM.py @@ -20,52 +20,52 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('bruss_FEM_mesh.txt', dtype=np.double) +mesh = np.loadtxt("bruss_FEM_mesh.txt", dtype=np.double) # load solution data files -udata = np.loadtxt('bruss_FEM_u.txt', dtype=np.double) -vdata = np.loadtxt('bruss_FEM_v.txt', dtype=np.double) -wdata = np.loadtxt('bruss_FEM_w.txt', dtype=np.double) +udata = np.loadtxt("bruss_FEM_u.txt", dtype=np.double) +vdata = np.loadtxt("bruss_FEM_v.txt", dtype=np.double) +wdata = np.loadtxt("bruss_FEM_w.txt", dtype=np.double) # determine number of time steps, mesh size -nt,nx = np.shape(udata) +nt, nx = np.shape(udata) # determine min/max values -umin = 0.9*udata.min() -umax = 1.1*udata.max() -vmin = 0.9*vdata.min() -vmax = 1.1*vdata.max() -wmin = 0.9*wdata.min() -wmax = 1.1*wdata.max() +umin = 0.9 * udata.min() +umax = 1.1 * udata.max() +vmin = 0.9 * vdata.min() +vmax = 1.1 * vdata.max() +wmin = 0.9 * wdata.min() +wmax = 1.1 * wdata.max() minval = np.array([umin, vmin, wmin]).min() maxval = np.array([umax, vmax, wmax]).max() # plot the mesh plt.figure(1) -plt.plot(mesh,0.0*mesh,'o') -plt.xlabel('x') -plt.title('FEM mesh') -plt.savefig('brusselator1D_FEM_mesh.png') +plt.plot(mesh, 0.0 * mesh, "o") +plt.xlabel("x") +plt.title("FEM mesh") +plt.savefig("brusselator1D_FEM_mesh.png") # generate plots of results for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'brusselator1D_FEM.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "brusselator1D_FEM." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,udata[tstep,:],label="u") - plt.plot(mesh,vdata[tstep,:],label="v") - plt.plot(mesh,wdata[tstep,:],label="w") - plt.xlabel('x') - plt.ylabel('solution') - plt.title('Solutions at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, udata[tstep, :], label="u") + plt.plot(mesh, vdata[tstep, :], label="v") + plt.plot(mesh, wdata[tstep, :], label="w") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("Solutions at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, minval, maxval)) plt.grid() - plt.legend(loc='upper right', shadow=True) + plt.legend(loc="upper right", shadow=True) plt.savefig(pname) plt.close() diff --git a/examples/arkode/C_serial/plot_heat1D.py b/examples/arkode/C_serial/plot_heat1D.py index d1c8e2bfdf..7b7b0e3fd2 100755 --- a/examples/arkode/C_serial/plot_heat1D.py +++ b/examples/arkode/C_serial/plot_heat1D.py @@ -20,31 +20,31 @@ import numpy as np # load mesh data file -mesh = np.loadtxt('heat_mesh.txt', dtype=np.double) +mesh = np.loadtxt("heat_mesh.txt", dtype=np.double) # load solution data file -data = np.loadtxt('heat1D.txt', dtype=np.double) +data = np.loadtxt("heat1D.txt", dtype=np.double) # determine number of time steps, mesh size -nt,nx = np.shape(data) +nt, nx = np.shape(data) # determine maximum temperature -maxtemp = 1.1*data.max() +maxtemp = 1.1 * data.max() # generate plots of results for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat1d.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "heat1d." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(nx) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh,data[tstep,:]) - plt.xlabel('x') - plt.ylabel('solution') - plt.title('u(x) at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh, data[tstep, :]) + plt.xlabel("x") + plt.ylabel("solution") + plt.title("u(x) at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, 0.0, maxtemp)) plt.grid() plt.savefig(pname) diff --git a/examples/arkode/C_serial/plot_heat1D_adapt.py b/examples/arkode/C_serial/plot_heat1D_adapt.py index fa813fff04..ab361a968e 100755 --- a/examples/arkode/C_serial/plot_heat1D_adapt.py +++ b/examples/arkode/C_serial/plot_heat1D_adapt.py @@ -20,39 +20,41 @@ import numpy as np # load mesh data file as list of NumPy arrays -inp = open('heat_mesh.txt').readlines() +inp = open("heat_mesh.txt").readlines() mesh = [] for line in inp: mesh.append(np.array(str.split(line), dtype=np.double)) # load solution data file as list of NumPy arrays -inp = open('heat1D.txt').readlines() +inp = open("heat1D.txt").readlines() data = [] for line in inp: data.append(np.array(str.split(line), dtype=np.double)) # determine number of time steps -nt = len(mesh) +nt = len(mesh) nt2 = len(data) -if (nt != nt2): - sys.exit('plot_heat1D_adapt.py error: data and mesh files have different numbers of time steps') +if nt != nt2: + sys.exit( + "plot_heat1D_adapt.py error: data and mesh files have different numbers of time steps" + ) # determine minimum/maximum temperature mintemp = 0.0 maxtemp = 0.0 for tstep in range(nt): mx = data[tstep].max() - if (mx > maxtemp): + if mx > maxtemp: maxtemp = mx mn = data[tstep].min() - if (mn < mintemp): + if mn < mintemp: mintemp = mn -if (maxtemp > 0.0): +if maxtemp > 0.0: maxtemp *= 1.1 else: maxtemp *= 0.9 -if (mintemp > 0.0): +if mintemp > 0.0: mintemp *= 0.9 else: mintemp *= 1.1 @@ -62,16 +64,16 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat1d.' + repr(tstep).zfill(3) + '.png' - tstr = repr(tstep) + pname = "heat1d." + repr(tstep).zfill(3) + ".png" + tstr = repr(tstep) nxstr = repr(len(data[tstep])) # plot current solution and save to disk plt.figure(1) - plt.plot(mesh[tstep],data[tstep],'-o') - plt.xlabel('x') - plt.ylabel('solution') - plt.title('u(x) at output ' + tstr + ', mesh = ' + nxstr) + plt.plot(mesh[tstep], data[tstep], "-o") + plt.xlabel("x") + plt.ylabel("solution") + plt.title("u(x) at output " + tstr + ", mesh = " + nxstr) plt.axis((0.0, 1.0, mintemp, maxtemp)) plt.grid() plt.savefig(pname) diff --git a/examples/arkode/C_serial/plot_sol.py b/examples/arkode/C_serial/plot_sol.py index af783fb053..813f35bec2 100755 --- a/examples/arkode/C_serial/plot_sol.py +++ b/examples/arkode/C_serial/plot_sol.py @@ -20,16 +20,16 @@ import numpy as np # load solution data file -data = np.loadtxt('solution.txt', dtype=np.double) +data = np.loadtxt("solution.txt", dtype=np.double) # determine number of time steps, number of fields -nt,nv = np.shape(data) +nt, nv = np.shape(data) # extract time array -times = data[:,0] +times = data[:, 0] # parse comment line to determine solution names -f = open('solution.txt', 'r') +f = open("solution.txt", "r") commentline = f.readline() commentsplit = commentline.split() names = commentsplit[2:] @@ -38,18 +38,16 @@ plt.figure() # add curves to figure -for i in range(nv-1): - plt.plot(times,data[:,i+1],label=names[i]) -plt.xlabel('t') -if (nv > 2): - plt.ylabel('solutions') +for i in range(nv - 1): + plt.plot(times, data[:, i + 1], label=names[i]) +plt.xlabel("t") +if nv > 2: + plt.ylabel("solutions") else: - plt.ylabel('solution') -plt.legend(loc='upper right', shadow=True) + plt.ylabel("solution") +plt.legend(loc="upper right", shadow=True) plt.grid() -plt.savefig('solution.png') - - +plt.savefig("solution.png") ##### end of script ##### diff --git a/examples/arkode/C_serial/plot_sol_log.py b/examples/arkode/C_serial/plot_sol_log.py index ca27f9eb59..2437cce448 100755 --- a/examples/arkode/C_serial/plot_sol_log.py +++ b/examples/arkode/C_serial/plot_sol_log.py @@ -20,16 +20,16 @@ import numpy as np # load solution data file -data = np.loadtxt('solution.txt', dtype=np.double) +data = np.loadtxt("solution.txt", dtype=np.double) # determine number of time steps, number of fields -nt,nv = np.shape(data) +nt, nv = np.shape(data) # extract time array -times = data[:,0] +times = data[:, 0] # parse comment line to determine solution names -f = open('solution.txt', 'r') +f = open("solution.txt", "r") commentline = f.readline() commentsplit = commentline.split() names = commentsplit[2:] @@ -38,18 +38,16 @@ plt.figure() # add curves to figure -for i in range(nv-1): - plt.loglog(times,data[:,i+1],label=names[i]) -plt.xlabel('t') -if (nv > 2): - plt.ylabel('solutions') +for i in range(nv - 1): + plt.loglog(times, data[:, i + 1], label=names[i]) +plt.xlabel("t") +if nv > 2: + plt.ylabel("solutions") else: - plt.ylabel('solution') -plt.legend(loc='upper right', shadow=True) + plt.ylabel("solution") +plt.legend(loc="upper right", shadow=True) plt.grid() -plt.savefig('solution.png') - - +plt.savefig("solution.png") ##### end of script ##### diff --git a/examples/cvode/CXX_parallel/plot_heat2D_p.py b/examples/cvode/CXX_parallel/plot_heat2D_p.py index 5e5357873a..9f320f609b 100755 --- a/examples/cvode/CXX_parallel/plot_heat2D_p.py +++ b/examples/cvode/CXX_parallel/plot_heat2D_p.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read MPI root process problem info file -infofile = 'heat2d_info.00000.txt' +infofile = "heat2d_info.00000.txt" with open(infofile) as fn: @@ -59,7 +59,7 @@ continue # total number of MPI processes - if "np"in line: + if "np" in line: nprocs = int(text[1]) continue @@ -71,11 +71,11 @@ # ------------------------------------------------------------------------------ # load subdomain information, store in table -subdomains = np.zeros((nprocs,4), dtype=np.int) +subdomains = np.zeros((nprocs, 4), dtype=np.int) for i in range(nprocs): - infofile = 'heat2d_info.' + repr(i).zfill(5) + '.txt' + infofile = "heat2d_info." + repr(i).zfill(5) + ".txt" with open(infofile) as fn: @@ -87,56 +87,58 @@ # x-direction starting index if "is" in line: - subdomains[i,0] = float(text[1]) + subdomains[i, 0] = float(text[1]) continue # x-direction ending index if "ie" in line: - subdomains[i,1] = float(text[1]) + subdomains[i, 1] = float(text[1]) continue # y-direction starting index if "js" in line: - subdomains[i,2] = float(text[1]) + subdomains[i, 2] = float(text[1]) continue # y-direction ending index if "je" in line: - subdomains[i,3] = float(text[1]) + subdomains[i, 3] = float(text[1]) continue # ------------------------------------------------------------------------------ -plottype = ['solution', 'error'] +plottype = ["solution", "error"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) for i in range(nprocs): - datafile = 'heat2d_' + pt + '.' + repr(i).zfill(5) + '.txt' + datafile = "heat2d_" + pt + "." + repr(i).zfill(5) + ".txt" # load data data = np.loadtxt(datafile, dtype=np.double) - if (np.shape(data)[0] != nt): - sys.exit('error: subdomain ' + i + ' has an incorrect number of time steps') + if np.shape(data)[0] != nt: + sys.exit("error: subdomain " + i + " has an incorrect number of time steps") # subdomain indices - istart = subdomains[i,0] - iend = subdomains[i,1] - jstart = subdomains[i,2] - jend = subdomains[i,3] - nxl = iend - istart + 1 - nyl = jend - jstart + 1 + istart = subdomains[i, 0] + iend = subdomains[i, 1] + jstart = subdomains[i, 2] + jend = subdomains[i, 3] + nxl = iend - istart + 1 + nyl = jend - jstart + 1 # extract data for i in range(nt): - time[i] = data[i,0] - result[i,jstart:jend+1,istart:iend+1] = np.reshape(data[i,1:], (nyl,nxl)) + time[i] = data[i, 0] + result[i, jstart : jend + 1, istart : iend + 1] = np.reshape( + data[i, 1:], (nyl, nxl) + ) # determine extents of plots maxtemp = 1.1 * result.max() @@ -145,7 +147,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -154,24 +156,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/cvode/CXX_parhyp/plot_heat2D_p.py b/examples/cvode/CXX_parhyp/plot_heat2D_p.py index 58673d17b2..f567f1c621 100755 --- a/examples/cvode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/cvode/CXX_parhyp/plot_heat2D_p.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read MPI root process problem info file -infofile = 'heat2d_info.00000.txt' +infofile = "heat2d_info.00000.txt" with open(infofile) as fn: @@ -59,7 +59,7 @@ continue # total number of MPI processes - if "np"in line: + if "np" in line: nprocs = int(text[1]) continue @@ -71,11 +71,11 @@ # ------------------------------------------------------------------------------ # load subdomain information, store in table -subdomains = np.zeros((nprocs,4), dtype=np.int) +subdomains = np.zeros((nprocs, 4), dtype=np.int) for i in range(nprocs): - infofile = 'heat2d_info.' + repr(i).zfill(5) + '.txt' + infofile = "heat2d_info." + repr(i).zfill(5) + ".txt" with open(infofile) as fn: @@ -87,56 +87,58 @@ # x-direction starting index if "is" in line: - subdomains[i,0] = float(text[1]) + subdomains[i, 0] = float(text[1]) continue # x-direction ending index if "ie" in line: - subdomains[i,1] = float(text[1]) + subdomains[i, 1] = float(text[1]) continue # y-direction starting index if "js" in line: - subdomains[i,2] = float(text[1]) + subdomains[i, 2] = float(text[1]) continue # y-direction ending index if "je" in line: - subdomains[i,3] = float(text[1]) + subdomains[i, 3] = float(text[1]) continue # ------------------------------------------------------------------------------ -plottype = ['solution', 'error'] +plottype = ["solution", "error"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) for i in range(nprocs): - datafile = 'heat2d_' + pt + '.' + repr(i).zfill(5) + '.txt' + datafile = "heat2d_" + pt + "." + repr(i).zfill(5) + ".txt" # load data data = np.loadtxt(datafile, dtype=np.double) - if (np.shape(data)[0] != nt): - sys.exit('error: subdomain ' + i + ' has an incorrect number of time steps') + if np.shape(data)[0] != nt: + sys.exit("error: subdomain " + i + " has an incorrect number of time steps") # subdomain indices - istart = subdomains[i,0] - iend = subdomains[i,1] - jstart = subdomains[i,2] - jend = subdomains[i,3] - nxl = iend - istart + 1 - nyl = jend - jstart + 1 + istart = subdomains[i, 0] + iend = subdomains[i, 1] + jstart = subdomains[i, 2] + jend = subdomains[i, 3] + nxl = iend - istart + 1 + nyl = jend - jstart + 1 # extract data for i in range(nt): - time[i] = data[i,0] - result[i,jstart:jend+1,istart:iend+1] = np.reshape(data[i,1:], (nyl,nxl)) + time[i] = data[i, 0] + result[i, jstart : jend + 1, istart : iend + 1] = np.reshape( + data[i, 1:], (nyl, nxl) + ) # determine extents of plots maxtemp = 1.1 * result.max() @@ -145,7 +147,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -154,24 +156,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/cvode/CXX_serial/plot_heat2D.py b/examples/cvode/CXX_serial/plot_heat2D.py index bbadc4de32..90ceba7d96 100755 --- a/examples/cvode/CXX_serial/plot_heat2D.py +++ b/examples/cvode/CXX_serial/plot_heat2D.py @@ -28,7 +28,7 @@ # ------------------------------------------------------------------------------ # read problem info file -infofile = 'heat2d_info.txt' +infofile = "heat2d_info.txt" with open(infofile) as fn: @@ -65,21 +65,21 @@ # ------------------------------------------------------------------------------ -plottype = ['solution', 'error'] +plottype = ["solution", "error"] for pt in plottype: # fill array with data - time = np.zeros(nt) + time = np.zeros(nt) result = np.zeros((nt, ny, nx)) # load data - data = np.loadtxt('heat2d_' + pt + '.txt', dtype=np.double) + data = np.loadtxt("heat2d_" + pt + ".txt", dtype=np.double) # extract data for i in range(nt): - time[i] = data[i,0] - result[i,0:ny+1,0:nx+1] = np.reshape(data[i,1:], (ny,nx)) + time[i] = data[i, 0] + result[i, 0 : ny + 1, 0 : nx + 1] = np.reshape(data[i, 1:], (ny, nx)) # determine extents of plots maxtemp = 1.1 * result.max() @@ -88,7 +88,7 @@ # set x and y meshgrid objects xspan = np.linspace(0.0, xu, nx) yspan = np.linspace(0.0, yu, ny) - X,Y = np.meshgrid(xspan, yspan) + X, Y = np.meshgrid(xspan, yspan) nxstr = repr(nx) nystr = repr(ny) @@ -97,24 +97,33 @@ for tstep in range(nt): # set string constants for output plots, current time, mesh size - pname = 'heat2d_surf_' + pt + '.' + repr(tstep).zfill(3) + '.png' - tstr = str(time[tstep]) + pname = "heat2d_surf_" + pt + "." + repr(tstep).zfill(3) + ".png" + tstr = str(time[tstep]) # plot surface and save to disk fig = plt.figure(1) - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, result[tstep,:,:], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, shade=True) - - ax.set_xlabel('x') - ax.set_ylabel('y') + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + result[tstep, :, :], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + + ax.set_xlabel("x") + ax.set_ylabel("y") ax.set_zlim((mintemp, maxtemp)) - ax.view_init(20,45) - if (pt == 'solution'): - title('u(x,y) at t = ' + tstr) + ax.view_init(20, 45) + if pt == "solution": + title("u(x,y) at t = " + tstr) else: - title('error(x,y) at t = ' + tstr) + title("error(x,y) at t = " + tstr) savefig(pname) plt.close() diff --git a/examples/cvode/serial/plot_cvParticle.py b/examples/cvode/serial/plot_cvParticle.py index 6557000a0a..f686312a78 100755 --- a/examples/cvode/serial/plot_cvParticle.py +++ b/examples/cvode/serial/plot_cvParticle.py @@ -21,20 +21,26 @@ import matplotlib.pyplot as plt # command line options -parser = argparse.ArgumentParser(description='Plots cvPraticle_dns output') -parser.add_argument('--sfile', type=str, - default='cvParticle_solution.txt', - help='solution output file to read') -parser.add_argument('--efile', type=str, - default='cvParticle_error.txt', - help='error output file to read') -parser.add_argument('--alpha', type=float, nargs=1, - default=1.0, - help='set a non-default alpha value') -parser.add_argument('--slim', type=float, nargs=2, - help='x and y limits for solution plot') -parser.add_argument('--eylim', type=float, nargs=2, - help='y limits for error plot') +parser = argparse.ArgumentParser(description="Plots cvPraticle_dns output") +parser.add_argument( + "--sfile", + type=str, + default="cvParticle_solution.txt", + help="solution output file to read", +) +parser.add_argument( + "--efile", + type=str, + default="cvParticle_error.txt", + help="error output file to read", +) +parser.add_argument( + "--alpha", type=float, nargs=1, default=1.0, help="set a non-default alpha value" +) +parser.add_argument( + "--slim", type=float, nargs=2, help="x and y limits for solution plot" +) +parser.add_argument("--eylim", type=float, nargs=2, help="y limits for error plot") # parse inputs args = parser.parse_args() @@ -48,23 +54,23 @@ y = data[:, 2] # unit circle -tt = np.linspace(0,np.pi*2,10000) +tt = np.linspace(0, np.pi * 2, 10000) xt = np.cos(tt) yt = np.sin(tt) # plot solution fig, ax = plt.subplots() -plt.plot(xt, yt, color='black', linestyle='--') -plt.scatter(x, y, color='red') +plt.plot(xt, yt, color="black", linestyle="--") +plt.scatter(x, y, color="red") -if (args.slim): +if args.slim: plt.xlim((args.slim[0], args.slim[1])) plt.ylim((args.slim[0], args.slim[1])) -plt.xlabel('x') -plt.ylabel('y') -plt.title('Solution') -ax.set_aspect('equal') +plt.xlabel("x") +plt.ylabel("y") +plt.title("Solution") +ax.set_aspect("equal") # true solution xt = np.cos(args.alpha * t) @@ -72,15 +78,15 @@ # plot solution fig, ax = plt.subplots() -plt.plot(t, x, linestyle='-', label='x') -plt.plot(t, xt, linestyle='--', label='x true') -plt.plot(t, y, linestyle='-', label='y') -plt.plot(t, yt, linestyle='--', label='y true') +plt.plot(t, x, linestyle="-", label="x") +plt.plot(t, xt, linestyle="--", label="x true") +plt.plot(t, y, linestyle="-", label="y") +plt.plot(t, yt, linestyle="--", label="y true") -plt.xlabel('t') -plt.ylabel('position') -plt.title('Particle Position Over Time') -plt.legend(loc='lower right') +plt.xlabel("t") +plt.ylabel("position") +plt.title("Particle Position Over Time") +plt.legend(loc="lower right") # read error output file data = np.loadtxt(args.efile, dtype=np.double) @@ -93,17 +99,17 @@ # plot solution fig, ax = plt.subplots() -plt.semilogy(t, xerr, label='x err') -plt.semilogy(t, yerr, label='y err') -plt.semilogy(t, cerr, label='c err') +plt.semilogy(t, xerr, label="x err") +plt.semilogy(t, yerr, label="y err") +plt.semilogy(t, cerr, label="c err") -if (args.eylim): +if args.eylim: plt.ylim((args.eylim[0], args.eylim[1])) -plt.xlabel('time') -plt.ylabel('error') -plt.legend(loc='lower right') -plt.title('Error in position and constraint') +plt.xlabel("time") +plt.ylabel("error") +plt.legend(loc="lower right") +plt.title("Error in position and constraint") plt.grid() # display plots diff --git a/examples/cvode/serial/plot_cvPendulum.py b/examples/cvode/serial/plot_cvPendulum.py index 07314f2936..c855c70d6d 100755 --- a/examples/cvode/serial/plot_cvPendulum.py +++ b/examples/cvode/serial/plot_cvPendulum.py @@ -21,9 +21,8 @@ import matplotlib.pyplot as plt # command line options -parser = argparse.ArgumentParser(description='Plots cvPendulum_dns output') -parser.add_argument('sfile', type=str, - help='solution output file to read') +parser = argparse.ArgumentParser(description="Plots cvPendulum_dns output") +parser.add_argument("sfile", type=str, help="solution output file to read") # parse inputs args = parser.parse_args() @@ -32,9 +31,9 @@ data = np.loadtxt(args.sfile, dtype=np.double) # extract times, positions, and velocities -t = data[:, 0] -x = data[:, 1] -y = data[:, 2] +t = data[:, 0] +x = data[:, 1] +y = data[:, 2] vx = data[:, 3] vy = data[:, 4] @@ -42,50 +41,50 @@ ref = np.loadtxt("cvPendulum_dns_ref.txt", dtype=np.double) # extract positions and velocities -xr = ref[:, 1] -yr = ref[:, 2] +xr = ref[:, 1] +yr = ref[:, 2] vxr = ref[:, 3] vyr = ref[:, 4] # lower half of unit circle -tt = np.linspace(np.pi, 2*np.pi, 10000) +tt = np.linspace(np.pi, 2 * np.pi, 10000) xt = np.cos(tt) yt = np.sin(tt) # plot solution in xy plane fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--', label=None) -ax.axvline(x=0, color='black', linestyle='--', label=None) -plt.plot(xt, yt, color='black', linestyle='--', label=None) -plt.scatter(x, y, color='red', label='comp') -plt.scatter(xr, yr, color='blue', label='ref') - -plt.xlabel('x') -plt.ylabel('y') -plt.title('Pendulum') -ax.set_aspect('equal') -plt.legend(loc='lower right') +ax.axhline(y=0, color="black", linestyle="--", label=None) +ax.axvline(x=0, color="black", linestyle="--", label=None) +plt.plot(xt, yt, color="black", linestyle="--", label=None) +plt.scatter(x, y, color="red", label="comp") +plt.scatter(xr, yr, color="blue", label="ref") + +plt.xlabel("x") +plt.ylabel("y") +plt.title("Pendulum") +ax.set_aspect("equal") +plt.legend(loc="lower right") # plot position over time fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--') -plt.plot(t, x, label='x') -plt.plot(t, y, label='y') +ax.axhline(y=0, color="black", linestyle="--") +plt.plot(t, x, label="x") +plt.plot(t, y, label="y") -plt.xlabel('t') -plt.ylabel('position') -plt.title('Pendulum Position') +plt.xlabel("t") +plt.ylabel("position") +plt.title("Pendulum Position") plt.legend() # plot velocity over time fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--') -plt.plot(t, vx, label='$v_x$') -plt.plot(t, vy, label='$v_y$') +ax.axhline(y=0, color="black", linestyle="--") +plt.plot(t, vx, label="$v_x$") +plt.plot(t, vy, label="$v_y$") -plt.xlabel('t') -plt.ylabel('velocity') -plt.title('Pendulum Velocity') +plt.xlabel("t") +plt.ylabel("velocity") +plt.title("Pendulum Velocity") plt.legend() # display plots diff --git a/examples/cvodes/serial/plot_cvsParticle.py b/examples/cvodes/serial/plot_cvsParticle.py index fb0c66da1c..72e8736388 100755 --- a/examples/cvodes/serial/plot_cvsParticle.py +++ b/examples/cvodes/serial/plot_cvsParticle.py @@ -21,20 +21,26 @@ import matplotlib.pyplot as plt # command line options -parser = argparse.ArgumentParser(description='Plots cvsPraticle_dns output') -parser.add_argument('--sfile', type=str, - default='cvsParticle_solution.txt', - help='solution output file to read') -parser.add_argument('--efile', type=str, - default='cvsParticle_error.txt', - help='error output file to read') -parser.add_argument('--alpha', type=float, nargs=1, - default=1.0, - help='set a non-default alpha value') -parser.add_argument('--slim', type=float, nargs=2, - help='x and y limits for solution plot') -parser.add_argument('--eylim', type=float, nargs=2, - help='y limits for error plot') +parser = argparse.ArgumentParser(description="Plots cvsPraticle_dns output") +parser.add_argument( + "--sfile", + type=str, + default="cvsParticle_solution.txt", + help="solution output file to read", +) +parser.add_argument( + "--efile", + type=str, + default="cvsParticle_error.txt", + help="error output file to read", +) +parser.add_argument( + "--alpha", type=float, nargs=1, default=1.0, help="set a non-default alpha value" +) +parser.add_argument( + "--slim", type=float, nargs=2, help="x and y limits for solution plot" +) +parser.add_argument("--eylim", type=float, nargs=2, help="y limits for error plot") # parse inputs args = parser.parse_args() @@ -48,23 +54,23 @@ y = data[:, 2] # unit circle -tt = np.linspace(0,np.pi*2,10000) +tt = np.linspace(0, np.pi * 2, 10000) xt = np.cos(tt) yt = np.sin(tt) # plot solution fig, ax = plt.subplots() -plt.plot(xt, yt, color='black', linestyle='--') -plt.scatter(x, y, color='red') +plt.plot(xt, yt, color="black", linestyle="--") +plt.scatter(x, y, color="red") -if (args.slim): +if args.slim: plt.xlim((args.slim[0], args.slim[1])) plt.ylim((args.slim[0], args.slim[1])) -plt.xlabel('x') -plt.ylabel('y') -plt.title('Solution') -ax.set_aspect('equal') +plt.xlabel("x") +plt.ylabel("y") +plt.title("Solution") +ax.set_aspect("equal") # true solution xt = np.cos(args.alpha * t) @@ -72,15 +78,15 @@ # plot solution fig, ax = plt.subplots() -plt.plot(t, x, linestyle='-', label='x') -plt.plot(t, xt, linestyle='--', label='x true') -plt.plot(t, y, linestyle='-', label='y') -plt.plot(t, yt, linestyle='--', label='y true') +plt.plot(t, x, linestyle="-", label="x") +plt.plot(t, xt, linestyle="--", label="x true") +plt.plot(t, y, linestyle="-", label="y") +plt.plot(t, yt, linestyle="--", label="y true") -plt.xlabel('t') -plt.ylabel('position') -plt.title('Particle Position Over Time') -plt.legend(loc='lower right') +plt.xlabel("t") +plt.ylabel("position") +plt.title("Particle Position Over Time") +plt.legend(loc="lower right") # read error output file data = np.loadtxt(args.efile, dtype=np.double) @@ -93,17 +99,17 @@ # plot solution fig, ax = plt.subplots() -plt.semilogy(t, xerr, label='x err') -plt.semilogy(t, yerr, label='y err') -plt.semilogy(t, cerr, label='c err') +plt.semilogy(t, xerr, label="x err") +plt.semilogy(t, yerr, label="y err") +plt.semilogy(t, cerr, label="c err") -if (args.eylim): +if args.eylim: plt.ylim((args.eylim[0], args.eylim[1])) -plt.xlabel('time') -plt.ylabel('error') -plt.legend(loc='lower right') -plt.title('Error in position and constraint') +plt.xlabel("time") +plt.ylabel("error") +plt.legend(loc="lower right") +plt.title("Error in position and constraint") plt.grid() # display plots diff --git a/examples/cvodes/serial/plot_cvsPendulum.py b/examples/cvodes/serial/plot_cvsPendulum.py index 0376a755bb..87408f4634 100755 --- a/examples/cvodes/serial/plot_cvsPendulum.py +++ b/examples/cvodes/serial/plot_cvsPendulum.py @@ -21,9 +21,8 @@ import matplotlib.pyplot as plt # command line options -parser = argparse.ArgumentParser(description='Plots cvsPendulum_dns output') -parser.add_argument('sfile', type=str, - help='solution output file to read') +parser = argparse.ArgumentParser(description="Plots cvsPendulum_dns output") +parser.add_argument("sfile", type=str, help="solution output file to read") # parse inputs args = parser.parse_args() @@ -32,9 +31,9 @@ data = np.loadtxt(args.sfile, dtype=np.double) # extract times, positions, and velocities -t = data[:, 0] -x = data[:, 1] -y = data[:, 2] +t = data[:, 0] +x = data[:, 1] +y = data[:, 2] vx = data[:, 3] vy = data[:, 4] @@ -42,50 +41,50 @@ ref = np.loadtxt("cvsPendulum_dns_ref.txt", dtype=np.double) # extract positions and velocities -xr = ref[:, 1] -yr = ref[:, 2] +xr = ref[:, 1] +yr = ref[:, 2] vxr = ref[:, 3] vyr = ref[:, 4] # lower half of unit circle -tt = np.linspace(np.pi, 2*np.pi, 10000) +tt = np.linspace(np.pi, 2 * np.pi, 10000) xt = np.cos(tt) yt = np.sin(tt) # plot solution in xy plane fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--', label=None) -ax.axvline(x=0, color='black', linestyle='--', label=None) -plt.plot(xt, yt, color='black', linestyle='--', label=None) -plt.scatter(x, y, color='red', label='comp') -plt.scatter(xr, yr, color='blue', label='ref') - -plt.xlabel('x') -plt.ylabel('y') -plt.title('Pendulum') -ax.set_aspect('equal') -plt.legend(loc='lower right') +ax.axhline(y=0, color="black", linestyle="--", label=None) +ax.axvline(x=0, color="black", linestyle="--", label=None) +plt.plot(xt, yt, color="black", linestyle="--", label=None) +plt.scatter(x, y, color="red", label="comp") +plt.scatter(xr, yr, color="blue", label="ref") + +plt.xlabel("x") +plt.ylabel("y") +plt.title("Pendulum") +ax.set_aspect("equal") +plt.legend(loc="lower right") # plot position over time fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--') -plt.plot(t, x, label='x') -plt.plot(t, y, label='y') +ax.axhline(y=0, color="black", linestyle="--") +plt.plot(t, x, label="x") +plt.plot(t, y, label="y") -plt.xlabel('t') -plt.ylabel('position') -plt.title('Pendulum Position') +plt.xlabel("t") +plt.ylabel("position") +plt.title("Pendulum Position") plt.legend() # plot velocity over time fig, ax = plt.subplots() -ax.axhline(y=0, color='black', linestyle='--') -plt.plot(t, vx, label='$v_x$') -plt.plot(t, vy, label='$v_y$') +ax.axhline(y=0, color="black", linestyle="--") +plt.plot(t, vx, label="$v_x$") +plt.plot(t, vy, label="$v_y$") -plt.xlabel('t') -plt.ylabel('velocity') -plt.title('Pendulum Velocity') +plt.xlabel("t") +plt.ylabel("velocity") +plt.title("Pendulum Velocity") plt.legend() # display plots diff --git a/examples/utilities/plot_data_2d.py b/examples/utilities/plot_data_2d.py index 0303e252ff..ecf15ab7e6 100755 --- a/examples/utilities/plot_data_2d.py +++ b/examples/utilities/plot_data_2d.py @@ -78,101 +78,111 @@ def main(): import sys import argparse - parser = argparse.ArgumentParser(description='''Plot 2D data files''') + parser = argparse.ArgumentParser(description="""Plot 2D data files""") # List of input data files - parser.add_argument('datafiles', type=str, nargs='+', - help='Data files to plot') + parser.add_argument("datafiles", type=str, nargs="+", help="Data files to plot") # Plot type options - group = parser.add_argument_group('Plot Options', - '''Options to specify the type of plot to - generate and what data to plot''') + group = parser.add_argument_group( + "Plot Options", + """Options to specify the type of plot to + generate and what data to plot""", + ) - group.add_argument('--plottype', type=str, - choices=['surface', 'surface-ani', - 'contour', 'contour-ani', - 'slice', 'point'], - default='surface', - help='''Set the plot type''') + group.add_argument( + "--plottype", + type=str, + choices=["surface", "surface-ani", "contour", "contour-ani", "slice", "point"], + default="surface", + help="""Set the plot type""", + ) - group.add_argument('--plotvars', type=int, nargs='+', - help='''Variable indices to plot''') + group.add_argument( + "--plotvars", type=int, nargs="+", help="""Variable indices to plot""" + ) - group.add_argument('--plottimes', type=int, nargs='+', - help='''Time indices to plot''') + group.add_argument( + "--plottimes", type=int, nargs="+", help="""Time indices to plot""" + ) # Slice plot options - group = parser.add_argument_group('Slice Plot Options', - '''Options specific to the slice plot - type''') + group = parser.add_argument_group( + "Slice Plot Options", + """Options specific to the slice plot + type""", + ) - group.add_argument('--slicetype', type=str, default='var', - choices=['var', 'time'], - help='''The slice plot type''') + group.add_argument( + "--slicetype", + type=str, + default="var", + choices=["var", "time"], + help="""The slice plot type""", + ) mxgroup = group.add_mutually_exclusive_group() - mxgroup.add_argument('--yslice', type=int, default=-1, - help='''y index to plot''') + mxgroup.add_argument("--yslice", type=int, default=-1, help="""y index to plot""") - mxgroup.add_argument('--xslice', type=int, default=-1, - help='''x index to plot''') + mxgroup.add_argument("--xslice", type=int, default=-1, help="""x index to plot""") # Point plot options - group = parser.add_argument_group('Point Plot Options', - '''Options specific to the point plot - type''') + group = parser.add_argument_group( + "Point Plot Options", + """Options specific to the point plot + type""", + ) - group.add_argument('--point', type=int, nargs=2, default=[0, 0], - help='''x and y index to plot''') + group.add_argument( + "--point", type=int, nargs=2, default=[0, 0], help="""x and y index to plot""" + ) # Output options - group = parser.add_argument_group('Output Options', - '''Options for saving plots''') + group = parser.add_argument_group("Output Options", """Options for saving plots""") - group.add_argument('--save', action='store_true', - help='''Save figure to file''') + group.add_argument("--save", action="store_true", help="""Save figure to file""") - group.add_argument('--prefix', type=str, - help='''File name prefix for saving the figure''') + group.add_argument( + "--prefix", type=str, help="""File name prefix for saving the figure""" + ) - group.add_argument('--merge', action='store_true', - help='''Merge PDF output files into a single file''') + group.add_argument( + "--merge", + action="store_true", + help="""Merge PDF output files into a single file""", + ) # Figure options - group = parser.add_argument_group('Figure Options', - '''Options to specify various figure - properties''') + group = parser.add_argument_group( + "Figure Options", + """Options to specify various figure + properties""", + ) - group.add_argument('--labels', type=str, nargs='+', - help='''Data labels for the plot legend''') + group.add_argument( + "--labels", type=str, nargs="+", help="""Data labels for the plot legend""" + ) - group.add_argument('--title', type=str, - help='''Plot title''') + group.add_argument("--title", type=str, help="""Plot title""") - group.add_argument('--xlabel', type=str, - help='''x-axis label''') + group.add_argument("--xlabel", type=str, help="""x-axis label""") - group.add_argument('--ylabel', type=str, - help='''y-axis label''') + group.add_argument("--ylabel", type=str, help="""y-axis label""") - group.add_argument('--zlabel', type=str, - help='''z-axis label''') + group.add_argument("--zlabel", type=str, help="""z-axis label""") - group.add_argument('--grid', action='store_true', - help='''Add grid to plot''') + group.add_argument("--grid", action="store_true", help="""Add grid to plot""") # Debugging options - parser.add_argument('--debug', action='store_true', - help='Enable debugging') + parser.add_argument("--debug", action="store_true", help="Enable debugging") # parse command line args args = parser.parse_args() @@ -190,52 +200,53 @@ def main(): plot_settings(args, info, time, xvals, yvals, zdata) # Create plots - if args.plottype == 'surface': + if args.plottype == "surface": plot_surface(args, info, time, xvals, yvals, zdata) - if args.plottype == 'surface-ani': + if args.plottype == "surface-ani": plot_surface_ani(args, info, time, xvals, yvals, zdata) - if args.plottype == 'contour': + if args.plottype == "contour": plot_contour(args, info, time, xvals, yvals, zdata) - if args.plottype == 'contour-ani': + if args.plottype == "contour-ani": plot_contour_ani(args, info, time, xvals, yvals, zdata) - if args.plottype == 'slice': + if args.plottype == "slice": # slice data - if (args.yslice > -1) and (args.yslice < info['ny']): + if (args.yslice > -1) and (args.yslice < info["ny"]): svals = xvals sdata = zdata[:, args.yslice, :, :] if args.xlabel: hlabel = args.xlabel else: - hlabel = 'x' + hlabel = "x" suffix = " at y = {:.4f}".format(yvals[args.yslice]) - elif (args.xslice > -1) and (args.xslice < info['nx']): + elif (args.xslice > -1) and (args.xslice < info["nx"]): svals = yvals sdata = zdata[:, :, args.xslice, :] if args.ylabel: hlabel = args.ylabel else: - hlabel = 'y' + hlabel = "y" suffix = " at x = {:.4f}".format(xvals[args.xslice]) else: print("ERROR: invalid xslice or yslice option") sys.exit() - if args.slicetype == 'var': + if args.slicetype == "var": plot_slice_vars(args, info, time, svals, sdata, hlabel, suffix) else: plot_slice_time(args, info, time, svals, sdata, hlabel, suffix) - if args.plottype == 'point': + if args.plottype == "point": # point data pdata = zdata[:, args.point[1], args.point[0], :] - suffix = " at x = {:.4f}, y = {:.4f}".format(xvals[args.point[0]], - yvals[args.point[1]]) + suffix = " at x = {:.4f}, y = {:.4f}".format( + xvals[args.point[0]], yvals[args.point[1]] + ) plot_point(args, info, time, pdata, suffix) @@ -264,8 +275,19 @@ def read_header(args): import numpy as np # initialize dictionary of header info variables to None - keys = ['title', 'varnames', 'nprocs', 'nvar', 'nt', 'nx', 'xl', 'xu', - 'ny', 'yl', 'yu'] + keys = [ + "title", + "varnames", + "nprocs", + "nvar", + "nt", + "nx", + "xl", + "xu", + "ny", + "yl", + "yu", + ] info = dict() for k in keys: @@ -290,62 +312,62 @@ def read_header(args): # plot title if "title" in line: - info['title'] = " ".join(text[2:]) + info["title"] = " ".join(text[2:]) continue # plot variable names if "vars" in line: - info['varnames'] = text[2:] + info["varnames"] = text[2:] continue # total number of processes if "nprocs" in line: - info['nprocs'] = int(text[2]) + info["nprocs"] = int(text[2]) continue # number of variables (at each spatial node) if "nvar" in line: - info['nvar'] = int(text[2]) + info["nvar"] = int(text[2]) continue # number of output times if "nt" in line: - info['nt'] = int(text[2]) + info["nt"] = int(text[2]) continue # the global number of nodes in the x-direction, the x lower bound # (west) and the x upper bound (east) if "nx" in line: - info['nx'] = int(text[2]) + info["nx"] = int(text[2]) continue if "xl" in line: - info['xl'] = float(text[2]) + info["xl"] = float(text[2]) continue if "xu" in line: - info['xu'] = float(text[2]) + info["xu"] = float(text[2]) continue # the global number of nodes in the y-direction, the y lower bound # (south) and the y upper bound (north) if "ny" in line: - info['ny'] = int(text[2]) + info["ny"] = int(text[2]) continue if "yl" in line: - info['yl'] = float(text[2]) + info["yl"] = float(text[2]) continue if "yu" in line: - info['yu'] = float(text[2]) + info["yu"] = float(text[2]) continue # load data to deduce values and perform sanity checks data = np.loadtxt(args.datafiles[0], dtype=np.double) # try to fill in missing values - if info['nvar'] is None: - info['nvar'] = 1 + if info["nvar"] is None: + info["nvar"] = 1 print("WARNING: nvar not provided. Using nvar = 1") - if info['nt'] is None or info['nx'] is None or info['ny'] is None: + if info["nt"] is None or info["nx"] is None or info["ny"] is None: # check if data exists if data.ndim != 2: @@ -353,72 +375,76 @@ def read_header(args): sys.exit() # number of output times - if info['nt'] is None: - info['nt'] = np.shape(data)[0] + if info["nt"] is None: + info["nt"] = np.shape(data)[0] # number of spatial nodes - if info['nx'] is None or info['ny'] is None: + if info["nx"] is None or info["ny"] is None: col = np.shape(data)[1] - 1 # exclude output times - if info['nx'] is None and info['ny'] is not None: - info['nx'] = col // (info['nvar'] * info['ny']) - elif info['nx'] is not None and info['ny'] is None: - info['ny'] = col // (info['nvar'] * info['nx']) + if info["nx"] is None and info["ny"] is not None: + info["nx"] = col // (info["nvar"] * info["ny"]) + elif info["nx"] is not None and info["ny"] is None: + info["ny"] = col // (info["nvar"] * info["nx"]) else: - info['nx'] = int(np.sqrt(col // info['nvar'])) - info['ny'] = info['nx'] - print("WARNING: nx and ny not provided. Using nx = ny =", - info['nx']) + info["nx"] = int(np.sqrt(col // info["nvar"])) + info["ny"] = info["nx"] + print("WARNING: nx and ny not provided. Using nx = ny =", info["nx"]) # sanity checks - if info['nt'] != np.shape(data)[0]: - print("ERROR: nt != nrows", info['nt'], np.shape(data)[0]) + if info["nt"] != np.shape(data)[0]: + print("ERROR: nt != nrows", info["nt"], np.shape(data)[0]) sys.exit() - if (info['nvar'] * info['nx'] * info['ny']) != (np.shape(data)[1] - 1): + if (info["nvar"] * info["nx"] * info["ny"]) != (np.shape(data)[1] - 1): print("ERROR: nvar * nx * ny != ncols - 1") sys.exit() # check x-dimension lower and upper bounds - if info['xl'] is None: + if info["xl"] is None: print("WARNING: xl not provided, using xl = 0") - info['xl'] = 0.0 + info["xl"] = 0.0 - if info['xu'] is None: + if info["xu"] is None: print("WARNING: xu not provided, using xu = 1") - info['xu'] = 1.0 + info["xu"] = 1.0 # check y-dimension lower and upper bounds - if info['yl'] is None: + if info["yl"] is None: print("WARNING: yl not provided, using yl = 0") - info['yl'] = 0.0 + info["yl"] = 0.0 - if info['yu'] is None: + if info["yu"] is None: print("WARNING: yu not provided, using yu = 1") - info['yu'] = 1.0 + info["yu"] = 1.0 # check number of processes - if info['nprocs'] is None: - info['nprocs'] = len(args.datafiles) - print("WARNING: nprocs not provided, using nprocs =", info['nprocs']) + if info["nprocs"] is None: + info["nprocs"] = len(args.datafiles) + print("WARNING: nprocs not provided, using nprocs =", info["nprocs"]) # check if all the expected input files were provided - if len(args.datafiles) != info['nprocs']: - print("ERROR: number of data files (", len(args.datafiles), - ") does not match number of processes (", info['nprocs'], ")") + if len(args.datafiles) != info["nprocs"]: + print( + "ERROR: number of data files (", + len(args.datafiles), + ") does not match number of processes (", + info["nprocs"], + ")", + ) sys.exit() if args.debug: - print('title = ', info['title']) - print('varnames = ', info['varnames']) - print('nprocs = ', info['nprocs']) - print('nvar = ', info['nvar']) - print('nt = ', info['nt']) - print('nx = ', info['nx']) - print('xl = ', info['xl']) - print('xu = ', info['xu']) - print('ny = ', info['ny']) - print('yl = ', info['yl']) - print('yu = ', info['yu']) + print("title = ", info["title"]) + print("varnames = ", info["varnames"]) + print("nprocs = ", info["nprocs"]) + print("nvar = ", info["nvar"]) + print("nt = ", info["nt"]) + print("nx = ", info["nx"]) + print("xl = ", info["xl"]) + print("xu = ", info["xu"]) + print("ny = ", info["ny"]) + print("yl = ", info["yl"]) + print("yu = ", info["yu"]) return info @@ -435,14 +461,14 @@ def read_subdomains(args, info): import numpy as np # load subdomain information, store in table - subdomains = np.zeros((info['nprocs'], 4), dtype=int) + subdomains = np.zeros((info["nprocs"], 4), dtype=int) # get the spatial subdomain owned by each process - if info['nprocs'] == 1: + if info["nprocs"] == 1: subdomains[0, 0] = 0 - subdomains[0, 1] = info['nx'] - 1 + subdomains[0, 1] = info["nx"] - 1 subdomains[0, 2] = 0 - subdomains[0, 3] = info['ny'] - 1 + subdomains[0, 3] = info["ny"] - 1 else: for idx, datafile in enumerate(args.datafiles): @@ -490,8 +516,7 @@ def read_subdomains(args, info): # check if subdomain indices were found if not (found_is and found_ie and found_js and found_je): - print("ERROR: could not find subdomain indices in", - datafile) + print("ERROR: could not find subdomain indices in", datafile) sys.exit() return subdomains @@ -507,10 +532,10 @@ def read_data(args, info, subdomains): import numpy as np # initialize data arrays - time = np.zeros(info['nt']) - xvals = np.linspace(info['xl'], info['xu'], info['nx']) - yvals = np.linspace(info['yl'], info['yu'], info['ny']) - zdata = np.zeros((info['nt'], info['ny'], info['nx'], info['nvar'])) + time = np.zeros(info["nt"]) + xvals = np.linspace(info["xl"], info["xu"], info["nx"]) + yvals = np.linspace(info["yl"], info["yu"], info["ny"]) + zdata = np.zeros((info["nt"], info["ny"], info["nx"], info["nvar"])) # extract data for idx, datafile in enumerate(args.datafiles): @@ -524,10 +549,17 @@ def read_data(args, info, subdomains): if args.debug: print(np.shape(data)) - if np.shape(data)[0] != info['nt']: - print("WARNING: subdomain", str(idx), "has an incorrect number of" - "output times (", np.shape(data)[0], "vs", info['nt'], ")") - info['nt'] = np.shape(data)[0] + if np.shape(data)[0] != info["nt"]: + print( + "WARNING: subdomain", + str(idx), + "has an incorrect number of" "output times (", + np.shape(data)[0], + "vs", + info["nt"], + ")", + ) + info["nt"] = np.shape(data)[0] # x-subdomain indices istart = subdomains[idx, 0] @@ -547,10 +579,11 @@ def read_data(args, info, subdomains): # reshape and save data time[:] = data[:, 0] - for v in range(info['nvar']): - for i in range(info['nt']): - zdata[i, jstart:jend+1, istart:iend+1, v] = \ - np.reshape(data[i, 1+v::info['nvar']], (nyl, nxl)) + for v in range(info["nvar"]): + for i in range(info["nt"]): + zdata[i, jstart : jend + 1, istart : iend + 1, v] = np.reshape( + data[i, 1 + v :: info["nvar"]], (nyl, nxl) + ) return time, xvals, yvals, zdata @@ -565,40 +598,40 @@ def plot_settings(args, info, time, xvals, yvals, zdata): import numpy as np # determine extents of plots - info['zmin'] = np.zeros(info['nvar']) - info['zmax'] = np.zeros(info['nvar']) + info["zmin"] = np.zeros(info["nvar"]) + info["zmax"] = np.zeros(info["nvar"]) - for v in range(info['nvar']): - info['zmin'][v] = np.amin(zdata[:, :, :, v]) - info['zmax'][v] = np.amax(zdata[:, :, :, v]) + for v in range(info["nvar"]): + info["zmin"][v] = np.amin(zdata[:, :, :, v]) + info["zmax"][v] = np.amax(zdata[:, :, :, v]) if args.debug: - print("z max = ", info['zmax']) - print("z min = ", info['zmin']) + print("z max = ", info["zmax"]) + print("z min = ", info["zmin"]) # which variables to plot if args.plotvars: - info['pltvars'] = args.plotvars + info["pltvars"] = args.plotvars else: - info['pltvars'] = range(info['nvar']) + info["pltvars"] = range(info["nvar"]) # which times to plot if args.plottimes: - info['plttimes'] = args.plottimes + info["plttimes"] = args.plottimes else: - info['plttimes'] = range(info['nt']) + info["plttimes"] = range(info["nt"]) # x-axis label if args.xlabel: - info['xlabel'] = args.xlabel + info["xlabel"] = args.xlabel else: - info['xlabel'] = 'x' + info["xlabel"] = "x" # y-axis label if args.ylabel: - info['ylabel'] = args.ylabel + info["ylabel"] = args.ylabel else: - info['ylabel'] = 'y' + info["ylabel"] = "y" # ----------------------------------------------------------------------------- @@ -638,50 +671,58 @@ def plot_surface(args, info, time, xvals, yvals, zdata): X, Y = np.meshgrid(xvals, yvals) # generate plots - for v in info['pltvars']: + for v in info["pltvars"]: if args.merge: mergefiles = list() - for t in info['plttimes']: + for t in info["plttimes"]: # create figure and axes fig = plt.figure() - ax = fig.add_subplot(111, projection='3d') - - ax.plot_surface(X, Y, zdata[t, :, :, v], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, - shade=True) + ax = fig.add_subplot(111, projection="3d") + + ax.plot_surface( + X, + Y, + zdata[t, :, :, v], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) # set axis limits - ax.set_xlim([info['xl'], info['xu']]) - ax.set_ylim([info['yl'], info['yu']]) - ax.set_zlim(info['zmin'][v], info['zmax'][v]) + ax.set_xlim([info["xl"], info["xu"]]) + ax.set_ylim([info["yl"], info["yu"]]) + ax.set_zlim(info["zmin"][v], info["zmax"][v]) # initial perspective ax.view_init(20, -120) # add axis labels - plt.xlabel(info['xlabel']) - plt.ylabel(info['ylabel']) + plt.xlabel(info["xlabel"]) + plt.ylabel(info["ylabel"]) # add z-axis label if args.zlabel: ax.set_zlabel(args.zlabel) - elif info['varnames']: - ax.set_zlabel(info['varnames'][v]) + elif info["varnames"]: + ax.set_zlabel(info["varnames"][v]) else: - ax.set_zlabel('z') + ax.set_zlabel("z") # add title tstr = str(time[t]) if args.title: title = args.title - elif info['title']: - title = info['title'] + elif info["title"]: + title = info["title"] else: - title = 'Solution' - plt.title(title + '\nt = ' + tstr) + title = "Solution" + plt.title(title + "\nt = " + tstr) # add grid if args.grid: @@ -690,15 +731,15 @@ def plot_surface(args, info, time, xvals, yvals, zdata): # save plot to file if args.save: if args.prefix: - fname = args.prefix + '_fig_surface_' + fname = args.prefix + "_fig_surface_" else: - fname = 'fig_surface_' - if info['varnames']: - fname += info['varnames'][v] + fname = "fig_surface_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - fname += '_t_' + repr(t).zfill(3) + '.pdf' - plt.savefig(fname, bbox_inches='tight') + fname += "var_" + repr(v).zfill(3) + fname += "_t_" + repr(t).zfill(3) + ".pdf" + plt.savefig(fname, bbox_inches="tight") if args.merge: mergefiles.append(fname) else: @@ -707,14 +748,14 @@ def plot_surface(args, info, time, xvals, yvals, zdata): if args.merge: if args.prefix: - fname = args.prefix + '_fig_surface_' + fname = args.prefix + "_fig_surface_" else: - fname = 'fig_surface_' - if info['varnames']: - fname += info['varnames'][v] + fname = "fig_surface_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - fname += '.pdf' + fname += "var_" + repr(v).zfill(3) + fname += ".pdf" merge_pdf(mergefiles, fname) @@ -732,38 +773,47 @@ def plot_surface_ani(args, info, time, xvals, yvals, zdata): def update_plot(frame_number, zarray, v, plot): plot[0].remove() - plot[0] = ax.plot_surface(X, Y, zarray[frame_number, :, :, v], - cmap=cm.jet) + plot[0] = ax.plot_surface(X, Y, zarray[frame_number, :, :, v], cmap=cm.jet) tstr = str(time[frame_number]) if args.title: title = args.title - elif info['title']: - title = info['title'] + elif info["title"]: + title = info["title"] else: - title = 'Solution' - plt.title(title + '\nt = ' + tstr) + title = "Solution" + plt.title(title + "\nt = " + tstr) - return plot, + return (plot,) # set x and y meshgrid objects X, Y = np.meshgrid(xvals, yvals) # generate plots - for v in info['pltvars']: + for v in info["pltvars"]: # create figure and axes fig = plt.figure() - ax = plt.axes(projection='3d') - - plot = [ax.plot_surface(X, Y, zdata[0, :, :, v], rstride=1, cstride=1, - cmap=cm.jet, linewidth=0, antialiased=True, - shade=True)] + ax = plt.axes(projection="3d") + + plot = [ + ax.plot_surface( + X, + Y, + zdata[0, :, :, v], + rstride=1, + cstride=1, + cmap=cm.jet, + linewidth=0, + antialiased=True, + shade=True, + ) + ] # set axis limits - ax.set_xlim([info['xl'], info['xu']]) - ax.set_ylim([info['yl'], info['yu']]) - ax.set_zlim([info['zmin'][v], info['zmax'][v]]) + ax.set_xlim([info["xl"], info["xu"]]) + ax.set_ylim([info["yl"], info["yu"]]) + ax.set_zlim([info["zmin"][v], info["zmax"][v]]) # initial perspective ax.view_init(20, -120) @@ -772,45 +822,45 @@ def update_plot(frame_number, zarray, v, plot): if args.xlabel: plt.xlabel(args.xlabel) else: - ax.set_xlabel('x') + ax.set_xlabel("x") # add y-axis label if args.ylabel: plt.ylabel(args.ylabel) else: - ax.set_ylabel('y') + ax.set_ylabel("y") # add z-axis label if args.zlabel: ax.set_zlabel(args.zlabel) - elif info['varnames']: - ax.set_zlabel(info['varnames'][v]) + elif info["varnames"]: + ax.set_zlabel(info["varnames"][v]) else: - ax.set_zlabel('z') + ax.set_zlabel("z") # add grid if args.grid: plt.grid() - fps = 2 # frame per sec + fps = 2 # frame per sec frn = len(time) # number of frames in the animation # create animation - ani = animation.FuncAnimation(fig, update_plot, frn, - fargs=(zdata, v, plot), - interval=1000/fps) + ani = animation.FuncAnimation( + fig, update_plot, frn, fargs=(zdata, v, plot), interval=1000 / fps + ) # save animation to file if args.save: if args.prefix: - fname = args.prefix + '_ani_surface_' + fname = args.prefix + "_ani_surface_" else: - fname = 'ani_surface_' - if info['varnames']: - fname += info['varnames'][v] + fname = "ani_surface_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - ani.save(fname + '.mp4', dpi=200, fps=fps) + fname += "var_" + repr(v).zfill(3) + ani.save(fname + ".mp4", dpi=200, fps=fps) else: plt.show() plt.close() @@ -830,36 +880,37 @@ def plot_contour(args, info, time, xvals, yvals, zdata): X, Y = np.meshgrid(xvals, yvals) # generate plots - for v in info['pltvars']: + for v in info["pltvars"]: - levels = np.linspace(info['zmin'][v], info['zmax'][v], 100) - ticks = np.linspace(info['zmin'][v], info['zmax'][v], 10) + levels = np.linspace(info["zmin"][v], info["zmax"][v], 100) + ticks = np.linspace(info["zmin"][v], info["zmax"][v], 10) - for t in info['plttimes']: + for t in info["plttimes"]: # create figure and axes fig, ax = plt.subplots() - cf = ax.contourf(X, Y, zdata[t, :, :, v], levels=levels, - cmap="coolwarm", extend="both") + cf = ax.contourf( + X, Y, zdata[t, :, :, v], levels=levels, cmap="coolwarm", extend="both" + ) fig.colorbar(cf, ax=ax, fraction=0.046, pad=0.04, ticks=ticks) # set axis limits - ax.set_xlim([info['xl'], info['xu']]) - ax.set_ylim([info['yl'], info['yu']]) + ax.set_xlim([info["xl"], info["xu"]]) + ax.set_ylim([info["yl"], info["yu"]]) # add axis labels - plt.xlabel(info['xlabel']) - plt.ylabel(info['ylabel']) + plt.xlabel(info["xlabel"]) + plt.ylabel(info["ylabel"]) # add title tstr = str(time[t]) if args.title: - plt.title(args.title + ' at t = ' + tstr) - elif info['title']: - plt.title(info['title'] + ' at t = ' + tstr) + plt.title(args.title + " at t = " + tstr) + elif info["title"]: + plt.title(info["title"] + " at t = " + tstr) else: - plt.title('Solution at t = ' + tstr) + plt.title("Solution at t = " + tstr) # add grid if args.grid: @@ -868,15 +919,15 @@ def plot_contour(args, info, time, xvals, yvals, zdata): # save plot to file if args.save: if args.prefix: - fname = args.prefix + '_fig_contour_' + fname = args.prefix + "_fig_contour_" else: - fname = 'fig_contour_' - if info['varnames']: - fname += info['varnames'][v] + fname = "fig_contour_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - fname += '_t_' + repr(t).zfill(3) + '.pdf' - plt.savefig(fname, bbox_inches='tight') + fname += "var_" + repr(v).zfill(3) + fname += "_t_" + repr(t).zfill(3) + ".pdf" + plt.savefig(fname, bbox_inches="tight") else: plt.show() plt.close() @@ -894,67 +945,76 @@ def plot_contour_ani(args, info, time, xvals, yvals, zdata): import matplotlib.animation as animation def update_plot(frame_number, zarray, v, plot): - plot[0] = ax.contourf(X, Y, zdata[frame_number, :, :, v], - levels=levels, cmap="coolwarm", extend="both") + plot[0] = ax.contourf( + X, + Y, + zdata[frame_number, :, :, v], + levels=levels, + cmap="coolwarm", + extend="both", + ) tstr = str(time[frame_number]) if args.title: title = args.title - elif info['title']: - title = info['title'] + elif info["title"]: + title = info["title"] else: - title = 'Solution' - plt.title(title + '\nt = ' + tstr) + title = "Solution" + plt.title(title + "\nt = " + tstr) - return plot, + return (plot,) # set x and y meshgrid objects X, Y = np.meshgrid(xvals, yvals) # generate plots - for v in info['pltvars']: + for v in info["pltvars"]: - levels = np.linspace(info['zmin'][v], info['zmax'][v], 100) - ticks = np.linspace(info['zmin'][v], info['zmax'][v], 10) + levels = np.linspace(info["zmin"][v], info["zmax"][v], 100) + ticks = np.linspace(info["zmin"][v], info["zmax"][v], 10) # create figure and axes fig, ax = plt.subplots() - plot = [ax.contourf(X, Y, zdata[0, :, :, v], levels=levels, - cmap="coolwarm", extend="both")] + plot = [ + ax.contourf( + X, Y, zdata[0, :, :, v], levels=levels, cmap="coolwarm", extend="both" + ) + ] fig.colorbar(plot[0], ax=ax, fraction=0.046, pad=0.04, ticks=ticks) # set axis limits - ax.set_xlim([info['xl'], info['xu']]) - ax.set_ylim([info['yl'], info['yu']]) + ax.set_xlim([info["xl"], info["xu"]]) + ax.set_ylim([info["yl"], info["yu"]]) # add axis labels - plt.xlabel(info['xlabel']) - plt.ylabel(info['ylabel']) + plt.xlabel(info["xlabel"]) + plt.ylabel(info["ylabel"]) # add grid if args.grid: plt.grid() - fps = 2 # frame per sec + fps = 2 # frame per sec frn = len(time) # number of frames in the animation # create animation - ani = animation.FuncAnimation(fig, update_plot, frn, - fargs=(zdata, v, plot), - interval=1000/fps) + ani = animation.FuncAnimation( + fig, update_plot, frn, fargs=(zdata, v, plot), interval=1000 / fps + ) # save animation to file if args.save: if args.prefix: - fname = args.prefix + '_ani_contour_' + fname = args.prefix + "_ani_contour_" else: - fname = 'ani_contour_' - if info['varnames']: - fname += info['varnames'][v] + fname = "ani_contour_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - ani.save(fname + '.mp4', dpi=200, fps=fps) + fname += "var_" + repr(v).zfill(3) + ani.save(fname + ".mp4", dpi=200, fps=fps) else: plt.show() plt.close() @@ -971,10 +1031,10 @@ def plot_slice_vars(args, info, time, svals, sdata, hlabel, suffix): import matplotlib.pyplot as plt # determine extents of slice plot - smin = np.zeros(info['nvar']) - smax = np.zeros(info['nvar']) + smin = np.zeros(info["nvar"]) + smax = np.zeros(info["nvar"]) - for v in range(info['nvar']): + for v in range(info["nvar"]): smin[v] = np.amin(sdata[:, :, v]) smax[v] = np.amax(sdata[:, :, v]) @@ -989,13 +1049,13 @@ def plot_slice_vars(args, info, time, svals, sdata, hlabel, suffix): label = ["%.2f" % t for t in time] # create plot for each variable - for v in info['pltvars']: + for v in info["pltvars"]: # create figure and axes fig, ax = plt.subplots() # add each output time to the plot - for t in info['plttimes']: + for t in info["plttimes"]: ax.plot(svals, sdata[t, :, v], label=label[t]) # set axis limits @@ -1012,19 +1072,19 @@ def plot_slice_vars(args, info, time, svals, sdata, hlabel, suffix): if args.zlabel: ax.set_ylabel(args.zlabel) else: - if info['varnames']: - ax.set_ylabel(info['varnames'][v]) + if info["varnames"]: + ax.set_ylabel(info["varnames"][v]) else: - ax.set_ylabel('variable ' + repr(v)) + ax.set_ylabel("variable " + repr(v)) # add title if args.title: plt.title(args.title + suffix) - elif info['title']: - plt.title(info['title'] + suffix) + elif info["title"]: + plt.title(info["title"] + suffix) else: - if info['varnames']: - plt.title("Evolution of " + info['varnames'][v] + suffix) + if info["varnames"]: + plt.title("Evolution of " + info["varnames"][v] + suffix) else: plt.title("Evolution of variable " + repr(v) + suffix) @@ -1035,14 +1095,14 @@ def plot_slice_vars(args, info, time, svals, sdata, hlabel, suffix): # save plot to file if args.save: if args.prefix: - fname = args.prefix + '_fig_slice_' + fname = args.prefix + "_fig_slice_" else: - fname = 'fig_slice_' - if info['varnames']: - fname += info['varnames'][v] + fname = "fig_slice_" + if info["varnames"]: + fname += info["varnames"][v] else: - fname += 'var_' + repr(v).zfill(3) - plt.savefig(fname + '.pdf', bbox_inches='tight') + fname += "var_" + repr(v).zfill(3) + plt.savefig(fname + ".pdf", bbox_inches="tight") else: plt.show() plt.close() @@ -1069,19 +1129,19 @@ def plot_slice_time(args, info, time, svals, sdata, hlabel, suffix): # set labels for the plot legend if args.labels: label = args.labels - elif info['varnames']: - label = info['varnames'] + elif info["varnames"]: + label = info["varnames"] else: - label = [None] * info['nvar'] + label = [None] * info["nvar"] # create plot for each variable - for t in info['plttimes']: + for t in info["plttimes"]: # create figure and axes fig, ax = plt.subplots() # add each output time to the plot - for v in info['pltvars']: + for v in info["pltvars"]: ax.plot(svals, sdata[t, :, v], label=label[v]) # set axis limits @@ -1101,11 +1161,11 @@ def plot_slice_time(args, info, time, svals, sdata, hlabel, suffix): # add title tstr = str(time[t]) if args.title: - plt.title(args.title + suffix + ' and t = ' + tstr) - elif info['title']: - plt.title(info['title'] + suffix + ' and t = ' + tstr) + plt.title(args.title + suffix + " and t = " + tstr) + elif info["title"]: + plt.title(info["title"] + suffix + " and t = " + tstr) else: - plt.title("Evolution" + suffix + ' and t = ' + tstr) + plt.title("Evolution" + suffix + " and t = " + tstr) # add grid if args.grid: @@ -1114,11 +1174,11 @@ def plot_slice_time(args, info, time, svals, sdata, hlabel, suffix): # save plot to file if args.save: if args.prefix: - fname = args.prefix + '_fig_slice_t_' + fname = args.prefix + "_fig_slice_t_" else: - fname = 'fig_slice_t_' - fname += repr(t).zfill(3) + '.pdf' - plt.savefig(fname, bbox_inches='tight') + fname = "fig_slice_t_" + fname += repr(t).zfill(3) + ".pdf" + plt.savefig(fname, bbox_inches="tight") else: plt.show() plt.close() @@ -1136,16 +1196,16 @@ def plot_point(args, info, time, pdata, suffix): # set labels for the plot legend if args.labels: label = args.labels - elif info['varnames']: - label = info['varnames'] + elif info["varnames"]: + label = info["varnames"] else: - label = [None] * info['nvar'] + label = [None] * info["nvar"] # create figure and axes fig, ax = plt.subplots() # create plot for each variable - for v in info['pltvars']: + for v in info["pltvars"]: ax.plot(time, pdata[:, v], label=label[v]) # add legend @@ -1157,8 +1217,8 @@ def plot_point(args, info, time, pdata, suffix): # add title if args.title: plt.title(args.title + suffix) - elif info['title']: - plt.title(info['title'] + suffix) + elif info["title"]: + plt.title(info["title"] + suffix) else: plt.title("Evolution" + suffix) @@ -1169,10 +1229,10 @@ def plot_point(args, info, time, pdata, suffix): # save plot to file if args.save: if args.prefix: - fname = args.prefix + '_fig_point' + fname = args.prefix + "_fig_point" else: - fname = 'fig_point' - plt.savefig(fname + '.pdf', bbox_inches='tight') + fname = "fig_point" + plt.savefig(fname + ".pdf", bbox_inches="tight") else: plt.show() plt.close() @@ -1183,6 +1243,7 @@ def plot_point(args, info, time, pdata, suffix): # ----------------------------------------------------------------------------- -if __name__ == '__main__': +if __name__ == "__main__": import sys + sys.exit(main()) diff --git a/examples/utilities/plot_data_time_series.py b/examples/utilities/plot_data_time_series.py index f96aeec538..02e3c34f7c 100755 --- a/examples/utilities/plot_data_time_series.py +++ b/examples/utilities/plot_data_time_series.py @@ -31,6 +31,7 @@ # output time. # ----------------------------------------------------------------------------- + # ----------------------------------------------------------------------------- # main routine # ----------------------------------------------------------------------------- @@ -41,50 +42,46 @@ def main(): import numpy as np import shlex - parser = argparse.ArgumentParser(description='''Plot data files''') + parser = argparse.ArgumentParser(description="""Plot data files""") - parser.add_argument('quantity', type=str, - help='''Quantity to plot''') + parser.add_argument("quantity", type=str, help="""Quantity to plot""") - parser.add_argument('datafiles', type=str, nargs='+', - help='''Data files to plot''') + parser.add_argument("datafiles", type=str, nargs="+", help="""Data files to plot""") # Plot display options - parser.add_argument('--save', action='store_true', - help='''Save figure to file''') + parser.add_argument("--save", action="store_true", help="""Save figure to file""") - parser.add_argument('--labels', type=str, nargs='+', - help='''Data file labels for plot legend''') + parser.add_argument( + "--labels", type=str, nargs="+", help="""Data file labels for plot legend""" + ) - parser.add_argument('--title', type=str, - help='''Plot title''') + parser.add_argument("--title", type=str, help="""Plot title""") - parser.add_argument('--xlabel', type=str, - help='''x-axis label''') + parser.add_argument("--xlabel", type=str, help="""x-axis label""") - parser.add_argument('--ylabel', type=str, - help='''y-axis label''') + parser.add_argument("--ylabel", type=str, help="""y-axis label""") - parser.add_argument('--grid', action='store_true', - help='''Add grid to plot''') + parser.add_argument("--grid", action="store_true", help="""Add grid to plot""") # Axis scaling logscale = parser.add_mutually_exclusive_group() - logscale.add_argument('--logx', action='store_true', - help='''Plot with log scale x-axis''') + logscale.add_argument( + "--logx", action="store_true", help="""Plot with log scale x-axis""" + ) - logscale.add_argument('--logy', action='store_true', - help='''Plot with log scale y-axis''') + logscale.add_argument( + "--logy", action="store_true", help="""Plot with log scale y-axis""" + ) - logscale.add_argument('--loglog', action='store_true', - help='''Use log scale x and y axes''') + logscale.add_argument( + "--loglog", action="store_true", help="""Use log scale x and y axes""" + ) # Debugging options - parser.add_argument('--debug', action='store_true', - help='Enable debugging') + parser.add_argument("--debug", action="store_true", help="Enable debugging") # Parse command line args args = parser.parse_args() @@ -132,33 +129,49 @@ def main(): print(data) # Extract t and q data - tdata = data[:,0] # first column has t values - qdata = data[:,idx] # remaining columns have q values + tdata = data[:, 0] # first column has t values + qdata = data[:, idx] # remaining columns have q values # line colors: matplotlib.org/stable/tutorials/colors/colormaps.html # and colorbrewer2.org) if len(args.datafiles) < 22: - colors = ["#d62728", "#1f77b4", "#2ca02c", "#9467bd", "#ff7f0e", - "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf", - "#000000", "#ff9896", "#aec7e8", "#98df8a", "#c5b0d5", - "#ffbb78", "#c49c94", "#f7b6d2", "#c7c7c7", "#dbdb8d", - "#9edae5"] + colors = [ + "#d62728", + "#1f77b4", + "#2ca02c", + "#9467bd", + "#ff7f0e", + "#8c564b", + "#e377c2", + "#7f7f7f", + "#bcbd22", + "#17becf", + "#000000", + "#ff9896", + "#aec7e8", + "#98df8a", + "#c5b0d5", + "#ffbb78", + "#c49c94", + "#f7b6d2", + "#c7c7c7", + "#dbdb8d", + "#9edae5", + ] else: print("ERROR: ncols > ncolors") sys.exit() # Set plot label for legend - if (args.labels): - label=args.labels[i] + if args.labels: + label = args.labels[i] else: - label=None + label = None if args.logx or args.logy or args.loglog: - ax.plot(tdata, np.abs(qdata), label=label, - color=colors[i]) + ax.plot(tdata, np.abs(qdata), label=label, color=colors[i]) else: - ax.plot(tdata, qdata, label=label, - color=colors[i]) + ax.plot(tdata, qdata, label=label, color=colors[i]) # Change axis scale if args.logx: @@ -183,7 +196,7 @@ def main(): if args.ylabel: plt.ylabel(args.ylabel) else: - plt.ylabel(args.quantity.replace("_"," ")); + plt.ylabel(args.quantity.replace("_", " ")) # Add legend if args.labels: @@ -199,10 +212,12 @@ def main(): else: plt.show() + # ----------------------------------------------------------------------------- # run the main routine # ----------------------------------------------------------------------------- -if __name__ == '__main__': +if __name__ == "__main__": import sys + sys.exit(main()) diff --git a/scripts/format.sh b/scripts/format.sh index b145adcfad..38011b85c0 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -31,3 +31,5 @@ find "${paths[@]}" -iname '*.h' -o -iname '*.hpp' -o \ -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i find "${paths[@]}" -iname '*.f90' | grep -v fmod | xargs fprettify --indent 2 --enable-replacements --c-relations + +find "${paths[@]}" -iname '*.py' -exec black {} ';' diff --git a/test/compare_benchmarks.py b/test/compare_benchmarks.py index 2df5e7249e..1f76c60519 100644 --- a/test/compare_benchmarks.py +++ b/test/compare_benchmarks.py @@ -22,19 +22,55 @@ def main(): - parser = argparse.ArgumentParser(description='Compare Sundials performance results against previous results') - - parser.add_argument('--release', dest='release', action='store_true', help='indicate if the current run to process is a release') - - parser.add_argument('--calidir', dest='caliDir', type=str, help='path to directory containing caliper files', default="/usr/workspace/sundials/califiles") - - parser.add_argument('--releasedir', dest='releaseDir', type=str, help='path to directory containing release caliper files', default="/usr/workspace/sundials/califiles/Release") - - parser.add_argument('--outpath', dest='outPath', type=str, help='path to directory to write results to', default="/dev/null") - - parser.add_argument('--jobid', dest='jobID', type=int, help='job id of the current run to identify .cali files') - - parser.add_argument('--threshold', dest="threshold", type=float, help='the percentage threshold in performance difference that indicates a regression', default=2.0) + parser = argparse.ArgumentParser( + description="Compare Sundials performance results against previous results" + ) + + parser.add_argument( + "--release", + dest="release", + action="store_true", + help="indicate if the current run to process is a release", + ) + + parser.add_argument( + "--calidir", + dest="caliDir", + type=str, + help="path to directory containing caliper files", + default="/usr/workspace/sundials/califiles", + ) + + parser.add_argument( + "--releasedir", + dest="releaseDir", + type=str, + help="path to directory containing release caliper files", + default="/usr/workspace/sundials/califiles/Release", + ) + + parser.add_argument( + "--outpath", + dest="outPath", + type=str, + help="path to directory to write results to", + default="/dev/null", + ) + + parser.add_argument( + "--jobid", + dest="jobID", + type=int, + help="job id of the current run to identify .cali files", + ) + + parser.add_argument( + "--threshold", + dest="threshold", + type=float, + help="the percentage threshold in performance difference that indicates a regression", + default=2.0, + ) args = parser.parse_args() @@ -50,38 +86,42 @@ def main(): if not os.path.exists(outPath): os.makedirs(outPath) - outFile = open("%s/benchmark_output.out" % outPath, 'w') + outFile = open("%s/benchmark_output.out" % outPath, "w") # thread per file with mp.Pool() as pool: - for res in pool.starmap(process_benchmark, [(jobID, release, releaseDir, i, threshold) for i in benchFiles]): + for res in pool.starmap( + process_benchmark, + [(jobID, release, releaseDir, i, threshold) for i in benchFiles], + ): if res: outFile.write(res + "\n") outFile.close() - outFile = open("%s/benchmark_output.out" % outPath, 'r') + outFile = open("%s/benchmark_output.out" % outPath, "r") try: outLines = outFile.readlines() finally: outFile.close() - if (len(outLines) == 0): + if len(outLines) == 0: return -1 return 0 + def process_benchmark(jobID, isRelease, releaseDir, benchmarkDir, threshold): # Get the current benchmark run benchmarkFiles = glob.glob("%s/*.cali" % benchmarkDir) # Don't compare if the run didn't include this benchmark - if (len(benchmarkFiles) == 0): + if len(benchmarkFiles) == 0: return th_files = tt.Thicket.from_caliperreader(benchmarkFiles) - curFilter = lambda x: x['job_id'] == jobID + curFilter = lambda x: x["job_id"] == jobID th_current = th_files.filter_metadata(curFilter) # Get the release caliper file - cluster = th_current.metadata['cluster'].values[0] + cluster = th_current.metadata["cluster"].values[0] if isRelease: # Get the last release versionDirs = glob.glob("%s/%s/*" % (releaseDir, cluster)) @@ -89,18 +129,23 @@ def process_benchmark(jobID, isRelease, releaseDir, benchmarkDir, threshold): versionDir = versionDirs[1] else: # Get the release the run is a part of - version = th_current.metadata['sundials_version'].values[0] + version = th_current.metadata["sundials_version"].values[0] versionDir = "%s/%s/%s" % (releaseDir, cluster, version) - benchmarkName = th_current.metadata['env.TEST_NAME'].values[0] - releaseFile = glob.glob("%s/Benchmarking/*/%s/*.cali" % (versionDir, benchmarkName), recursive=True) + benchmarkName = th_current.metadata["env.TEST_NAME"].values[0] + releaseFile = glob.glob( + "%s/Benchmarking/*/%s/*.cali" % (versionDir, benchmarkName), recursive=True + ) th_compare = tt.Thicket.from_caliperreader(releaseFile) - metrics = ['Max time/rank'] + metrics = ["Max time/rank"] tt.mean(th_current, columns=metrics) tt.mean(th_compare, columns=metrics) - ratio = th_current.statsframe.dataframe['Max time/rank_mean'] / th_compare.statsframe.dataframe['Max time/rank_mean'] + ratio = ( + th_current.statsframe.dataframe["Max time/rank_mean"] + / th_compare.statsframe.dataframe["Max time/rank_mean"] + ) - tolerance = threshold/100 + tolerance = threshold / 100 if 1 - ratio[0] < tolerance: return benchmarkName diff --git a/test/compare_examples.py b/test/compare_examples.py index 046b9d620b..3383fa91f6 100644 --- a/test/compare_examples.py +++ b/test/compare_examples.py @@ -27,18 +27,50 @@ import hatchet as ht import thicket as tt -def main(): - parser = argparse.ArgumentParser(description='Compare Sundials performance results against previous results') - - parser.add_argument('--release', dest='release', action='store_true', help='indicate if the current run to process is a release') - - parser.add_argument('--calidir', dest='caliDir', type=str, help='path to directory containing caliper files', default="/usr/workspace/sundials/califiles") - - parser.add_argument('--releasedir', dest='releaseDir', type=str, help='path to directory containing release caliper files', default="/usr/workspace/sundials/califiles/Release") - parser.add_argument('--outpath', dest='outPath', type=str, help='path to directory to write results to', default="/dev/null") - - parser.add_argument('--threshold', dest="threshold", type=float, help='the percentage threshold in performance difference that indicates a regression', default=2.0) +def main(): + parser = argparse.ArgumentParser( + description="Compare Sundials performance results against previous results" + ) + + parser.add_argument( + "--release", + dest="release", + action="store_true", + help="indicate if the current run to process is a release", + ) + + parser.add_argument( + "--calidir", + dest="caliDir", + type=str, + help="path to directory containing caliper files", + default="/usr/workspace/sundials/califiles", + ) + + parser.add_argument( + "--releasedir", + dest="releaseDir", + type=str, + help="path to directory containing release caliper files", + default="/usr/workspace/sundials/califiles/Release", + ) + + parser.add_argument( + "--outpath", + dest="outPath", + type=str, + help="path to directory to write results to", + default="/dev/null", + ) + + parser.add_argument( + "--threshold", + dest="threshold", + type=float, + help="the percentage threshold in performance difference that indicates a regression", + default=2.0, + ) args = parser.parse_args() @@ -49,13 +81,13 @@ def main(): threshold = args.threshold # Get the latest test run - runDirs = glob.glob("%s/Testing/*" % caliDir, recursive = True) + runDirs = glob.glob("%s/Testing/*" % caliDir, recursive=True) runDirs.sort(key=os.path.getmtime, reverse=True) runDir = runDirs[0] runFile = glob.glob(runDir)[0] th_temp = tt.Thicket.from_caliperreader(runFile) - cluster = th_temp.metadata['cluster'] + cluster = th_temp.metadata["cluster"] # get machine from the file if release: # Compare against the last release @@ -64,7 +96,7 @@ def main(): versionDir = versionDirs[1] else: # Compare against the release the run is a part of - version = th_temp.metadata['sundials_version'].values[0] + version = th_temp.metadata["sundials_version"].values[0] versionDir = "%s/%s/%s" % (releaseDir, cluster, version) # Gather files to process @@ -72,22 +104,24 @@ def main(): if not os.path.exists(outPath): os.makedirs(outPath) - outFile = open("%s/output.out" % outPath, 'w') + outFile = open("%s/output.out" % outPath, "w") # Compare test results against past runs. If a test performs below a threshold, output test name to outFile. with mp.Pool() as pool: - for res in pool.starmap(compare_against_release, [(versionDir, i, threshold) for i in runFiles]): + for res in pool.starmap( + compare_against_release, [(versionDir, i, threshold) for i in runFiles] + ): if res: outFile.write(res + "\n") outFile.close() - outFile = open("%s/example_output.out" % outPath, 'r') + outFile = open("%s/example_output.out" % outPath, "r") try: outLines = outFile.readlines() finally: outFile.close() - if (len(outLines) == 0): + if len(outLines) == 0: return -1 return 0 @@ -95,21 +129,27 @@ def main(): def compare_against_release(releaseDir, file, threshold): th = tt.Thicket.from_caliperreader(file) - testName = th.metadata['env.TEST_NAME'].values[0] + testName = th.metadata["env.TEST_NAME"].values[0] # Gather release run - releaseFile = glob.glob("%s/Testing/*/%s.*.cali" % (releaseDir, testName), recursive=True) + releaseFile = glob.glob( + "%s/Testing/*/%s.*.cali" % (releaseDir, testName), recursive=True + ) th_release = tt.Thicket.from_caliperreader(releaseFile) - metrics = ['Max time/rank'] + metrics = ["Max time/rank"] tt.mean(th_release, columns=metrics) tt.mean(th, columns=metrics) - ratio = th.statsframe.dataframe['Max time/rank_mean'] / th_release.statsframe.dataframe['Max time/rank_mean'] + ratio = ( + th.statsframe.dataframe["Max time/rank_mean"] + / th_release.statsframe.dataframe["Max time/rank_mean"] + ) print(ratio[0]) - tolerance = threshold/100 + tolerance = threshold / 100 if 1 - ratio[0] < tolerance: return testName + if __name__ == "__main__": main() diff --git a/test/config_cmake.py b/test/config_cmake.py index e916d1bcc0..f1574b6257 100644 --- a/test/config_cmake.py +++ b/test/config_cmake.py @@ -21,109 +21,252 @@ def main(): import argparse - parser = argparse.ArgumentParser(description='''Create a SUNDIALS CMake - cache file''') - - parser.add_argument('--filetype', type=str, choices=['cache', 'script'], - default='cache', - help='''Create a CMake cache file or configuration - script (default cache)''') - - parser.add_argument('--filename', type=str, default="sundials.cmake", - help='''Set the cache file or script name (default - sundials.cmake)''') - - parser.add_argument('--readenv', action='store_true', - help='''Read environment variables (command line + parser = argparse.ArgumentParser( + description="""Create a SUNDIALS CMake + cache file""" + ) + + parser.add_argument( + "--filetype", + type=str, + choices=["cache", "script"], + default="cache", + help="""Create a CMake cache file or configuration + script (default cache)""", + ) + + parser.add_argument( + "--filename", + type=str, + default="sundials.cmake", + help="""Set the cache file or script name (default + sundials.cmake)""", + ) + + parser.add_argument( + "--readenv", + action="store_true", + help="""Read environment variables (command line arguments will override any settings from the - environment variables)''') + environment variables)""", + ) - parser.add_argument('--debugscript', action='store_true', - help='Enable debugging output for this script') + parser.add_argument( + "--debugscript", + action="store_true", + help="Enable debugging output for this script", + ) # ----------------- # Compiler Options # ----------------- - group = parser.add_argument_group('Compilers and Flags', - '''Options for setting the C, C++, - Fortran, and CUDA compiler and flags.''') + group = parser.add_argument_group( + "Compilers and Flags", + """Options for setting the C, C++, + Fortran, and CUDA compiler and flags.""", + ) # Build type - add_arg(group, '--build-type', 'CMAKE_BUILD_TYPE', 'CMAKE_BUILD_TYPE', - 'RelWithDebInfo', 'STRING', - 'CMake build type (Debug, RelWithDebInfo, Release)') + add_arg( + group, + "--build-type", + "CMAKE_BUILD_TYPE", + "CMAKE_BUILD_TYPE", + "RelWithDebInfo", + "STRING", + "CMake build type (Debug, RelWithDebInfo, Release)", + ) # C compiler - add_arg(group, '--c-compiler', 'CC', 'CMAKE_C_COMPILER', None, 'FILEPATH', - 'C compiler') - - add_arg(group, '--c-flags', 'CFLAGS', 'CMAKE_C_FLAGS', None, 'STRING', - 'C compiler flags') - - add_arg(group, '--c-std', 'CMAKE_C_STANDARD', 'CMAKE_C_STANDARD', '99', - 'STRING', 'C standard') - - add_arg(group, '--c-ext', 'CMAKE_C_EXTENSIONS', 'CMAKE_C_EXTENSIONS', - 'OFF', 'STRING', 'C compiler extensions') + add_arg( + group, "--c-compiler", "CC", "CMAKE_C_COMPILER", None, "FILEPATH", "C compiler" + ) + + add_arg( + group, + "--c-flags", + "CFLAGS", + "CMAKE_C_FLAGS", + None, + "STRING", + "C compiler flags", + ) + + add_arg( + group, + "--c-std", + "CMAKE_C_STANDARD", + "CMAKE_C_STANDARD", + "99", + "STRING", + "C standard", + ) + + add_arg( + group, + "--c-ext", + "CMAKE_C_EXTENSIONS", + "CMAKE_C_EXTENSIONS", + "OFF", + "STRING", + "C compiler extensions", + ) # C++ compiler - add_arg(group, '--cxx-compiler', 'CXX', 'CMAKE_CXX_COMPILER', None, - 'FILEPATH', 'C++ compiler') - - add_arg(group, '--cxx-flags', 'CXXFLAGS', 'CMAKE_CXX_FLAGS', None, - 'STRING', 'C++ compiler flags') - - add_arg(group, '--cxx-std', 'CMAKE_CXX_STANDARD', 'CMAKE_CXX_STANDARD', - '14', 'STRING', 'C++ standard') - - add_arg(group, '--cxx-ext', 'CMAKE_CXX_EXTENSIONS', 'CMAKE_CXX_EXTENSIONS', - 'OFF', 'STRING', 'C++ compiler extensions') + add_arg( + group, + "--cxx-compiler", + "CXX", + "CMAKE_CXX_COMPILER", + None, + "FILEPATH", + "C++ compiler", + ) + + add_arg( + group, + "--cxx-flags", + "CXXFLAGS", + "CMAKE_CXX_FLAGS", + None, + "STRING", + "C++ compiler flags", + ) + + add_arg( + group, + "--cxx-std", + "CMAKE_CXX_STANDARD", + "CMAKE_CXX_STANDARD", + "14", + "STRING", + "C++ standard", + ) + + add_arg( + group, + "--cxx-ext", + "CMAKE_CXX_EXTENSIONS", + "CMAKE_CXX_EXTENSIONS", + "OFF", + "STRING", + "C++ compiler extensions", + ) # Fortran compiler - add_arg(group, '--fortran-compiler', 'FC', 'CMAKE_Fortran_COMPILER', None, - 'FILEPATH', 'Fortran compiler') - - add_arg(group, '--fortran-flags', 'FFLAGS', 'CMAKE_Fortran_FLAGS', None, - 'STRING', 'Fortran compiler flags') + add_arg( + group, + "--fortran-compiler", + "FC", + "CMAKE_Fortran_COMPILER", + None, + "FILEPATH", + "Fortran compiler", + ) + + add_arg( + group, + "--fortran-flags", + "FFLAGS", + "CMAKE_Fortran_FLAGS", + None, + "STRING", + "Fortran compiler flags", + ) # CUDA compiler - add_arg(group, '--cuda-compiler', 'CUDACXX', 'CMAKE_CUDA_COMPILER', None, - 'FILEPATH', 'CUDA compiler') - - add_arg(group, '--cuda-flags', 'CUDAFLAGS', 'CMAKE_CUDA_FLAGS', None, - 'STRING', 'CUDA compiler flags') - - add_arg(group, '--cuda-std', 'CMAKE_CUDA_STANDARD', 'CMAKE_CUDA_STANDARD', - '14', 'STRING', 'CUDA standard') - - add_arg(group, '--cuda-arch', 'CUDAARCHS', 'CMAKE_CUDA_ARCHITECTURES', - None, 'STRING', 'CUDA architecture') + add_arg( + group, + "--cuda-compiler", + "CUDACXX", + "CMAKE_CUDA_COMPILER", + None, + "FILEPATH", + "CUDA compiler", + ) + + add_arg( + group, + "--cuda-flags", + "CUDAFLAGS", + "CMAKE_CUDA_FLAGS", + None, + "STRING", + "CUDA compiler flags", + ) + + add_arg( + group, + "--cuda-std", + "CMAKE_CUDA_STANDARD", + "CMAKE_CUDA_STANDARD", + "14", + "STRING", + "CUDA standard", + ) + + add_arg( + group, + "--cuda-arch", + "CUDAARCHS", + "CMAKE_CUDA_ARCHITECTURES", + None, + "STRING", + "CUDA architecture", + ) # Additional compiler options - add_arg(group, '--Wall', 'SUNDIALS_ENABLE_ALL_WARNINGS', - 'ENABLE_ALL_WARNINGS', 'OFF', 'BOOL', - 'Enable all compiler warnings') - - add_arg(group, '--Werror', 'SUNDIALS_ENABLE_WARNINGS_AS_ERRORS', - 'ENABLE_WARNINGS_AS_ERRORS', 'OFF', 'BOOL', - 'Enable compiler warnings as errors') - - add_arg(group, '--address-sanitizer', 'SUNDIALS_ENABLE_ADDRESS_SANITIZER', - 'ENABLE_ADDRESS_SANITIZER', 'OFF', 'BOOL', - 'Enable address sanitizer') + add_arg( + group, + "--Wall", + "SUNDIALS_ENABLE_ALL_WARNINGS", + "ENABLE_ALL_WARNINGS", + "OFF", + "BOOL", + "Enable all compiler warnings", + ) + + add_arg( + group, + "--Werror", + "SUNDIALS_ENABLE_WARNINGS_AS_ERRORS", + "ENABLE_WARNINGS_AS_ERRORS", + "OFF", + "BOOL", + "Enable compiler warnings as errors", + ) + + add_arg( + group, + "--address-sanitizer", + "SUNDIALS_ENABLE_ADDRESS_SANITIZER", + "ENABLE_ADDRESS_SANITIZER", + "OFF", + "BOOL", + "Enable address sanitizer", + ) # ---------------- # Install Options # ---------------- - group = parser.add_argument_group('Install Options', - '''Options for where SUNDIALS should be - installed.''') + group = parser.add_argument_group( + "Install Options", + """Options for where SUNDIALS should be + installed.""", + ) # install prefix - add_arg(group, '--install-prefix', 'SUNDIALS_INSTALL_PREFIX', - 'CMAKE_INSTALL_PREFIX', None, 'PATH', 'SUNDIALS install location') + add_arg( + group, + "--install-prefix", + "SUNDIALS_INSTALL_PREFIX", + "CMAKE_INSTALL_PREFIX", + None, + "PATH", + "SUNDIALS install location", + ) # library directory @@ -131,148 +274,333 @@ def main(): # Debugging Options # ------------------ - group = parser.add_argument_group('Debugging Options', - '''Options debugging SUNDIALS.''') - - add_arg(group, '--debug', 'SUNDIALS_DEBUG', 'SUNDIALS_DEBUG', 'OFF', - 'BOOL', 'SUNDIALS debugging output') - - add_arg(group, '--debug-assert', 'SUNDIALS_DEBUG_ASSERT', - 'SUNDIALS_DEBUG_ASSERT', 'OFF', 'BOOL', - 'SUNDIALS debugging asserts', dependson='--debug') - - add_arg(group, '--debug-cuda', 'SUNDIALS_DEBUG_CUDA_LASTERROR', - 'SUNDIALS_DEBUG_CUDA_LASTERROR', 'OFF', 'BOOL', - 'SUNDIALS debugging cuda errors', dependson='--debug') - - add_arg(group, '--debug-hip', 'SUNDIALS_DEBUG_HIP_LASTERROR', - 'SUNDIALS_DEBUG_HIP_LASTERROR', 'OFF', 'BOOL', - 'SUNDIALS debugging hip errors', dependson='--debug') - - add_arg(group, '--debug-printvec', 'SUNDIALS_DEBUG_PRINTVEC', - 'SUNDIALS_DEBUG_PRINTVEC', 'OFF', 'BOOL', - 'SUNDIALS debugging vector output', dependson='--debug') + group = parser.add_argument_group( + "Debugging Options", """Options debugging SUNDIALS.""" + ) + + add_arg( + group, + "--debug", + "SUNDIALS_DEBUG", + "SUNDIALS_DEBUG", + "OFF", + "BOOL", + "SUNDIALS debugging output", + ) + + add_arg( + group, + "--debug-assert", + "SUNDIALS_DEBUG_ASSERT", + "SUNDIALS_DEBUG_ASSERT", + "OFF", + "BOOL", + "SUNDIALS debugging asserts", + dependson="--debug", + ) + + add_arg( + group, + "--debug-cuda", + "SUNDIALS_DEBUG_CUDA_LASTERROR", + "SUNDIALS_DEBUG_CUDA_LASTERROR", + "OFF", + "BOOL", + "SUNDIALS debugging cuda errors", + dependson="--debug", + ) + + add_arg( + group, + "--debug-hip", + "SUNDIALS_DEBUG_HIP_LASTERROR", + "SUNDIALS_DEBUG_HIP_LASTERROR", + "OFF", + "BOOL", + "SUNDIALS debugging hip errors", + dependson="--debug", + ) + + add_arg( + group, + "--debug-printvec", + "SUNDIALS_DEBUG_PRINTVEC", + "SUNDIALS_DEBUG_PRINTVEC", + "OFF", + "BOOL", + "SUNDIALS debugging vector output", + dependson="--debug", + ) # -------------- # Library Types # -------------- - group = parser.add_argument_group('Library Type Options', - '''Options to specify if shared and/or - static libraries are build.''') - add_arg(group, '--static', 'SUNDIALS_STATIC_LIBRARIES', - 'BUILD_STATIC_LIBS', 'ON', 'BOOL', - 'Build static SUNDIALS libraries') - - add_arg(group, '--shared', 'SUNDIALS_SHARED_LIBRARIES', - 'BUILD_SHARED_LIBS', 'ON', 'BOOL', - 'Build shared SUNDIALS libraries') + group = parser.add_argument_group( + "Library Type Options", + """Options to specify if shared and/or + static libraries are build.""", + ) + add_arg( + group, + "--static", + "SUNDIALS_STATIC_LIBRARIES", + "BUILD_STATIC_LIBS", + "ON", + "BOOL", + "Build static SUNDIALS libraries", + ) + + add_arg( + group, + "--shared", + "SUNDIALS_SHARED_LIBRARIES", + "BUILD_SHARED_LIBS", + "ON", + "BOOL", + "Build shared SUNDIALS libraries", + ) # --------- # Packages # --------- # packages TODO(DJG): Add support for ONLY option - group = parser.add_argument_group('SUNDIALS Packages', - '''Options to specify which SUNDIALS - packages should be built.''') - add_arg(group, '--arkode', 'SUNDIALS_ARKODE', 'BUILD_ARKODE', 'ON', 'BOOL', - 'Build the ARKODE library') - - add_arg(group, '--cvode', 'SUNDIALS_CVODE', 'BUILD_CVODE', 'ON', 'BOOL', - 'Build the CVODE library') - - add_arg(group, '--cvodes', 'SUNDIALS_CVODES', 'BUILD_CVODES', 'ON', 'BOOL', - 'Build the CVODES library') - - add_arg(group, '--ida', 'SUNDIALS_IDA', 'BUILD_IDA', 'ON', 'BOOL', - 'Build the IDA library') - - add_arg(group, '--idas', 'SUNDIALS_IDAS', 'BUILD_IDAS', 'ON', 'BOOL', - 'Build the IDAS library') - - add_arg(group, '--kinsol', 'SUNDIALS_KINSOL', 'BUILD_KINSOL', 'ON', 'BOOL', - 'Build the KINSOL library') + group = parser.add_argument_group( + "SUNDIALS Packages", + """Options to specify which SUNDIALS + packages should be built.""", + ) + add_arg( + group, + "--arkode", + "SUNDIALS_ARKODE", + "BUILD_ARKODE", + "ON", + "BOOL", + "Build the ARKODE library", + ) + + add_arg( + group, + "--cvode", + "SUNDIALS_CVODE", + "BUILD_CVODE", + "ON", + "BOOL", + "Build the CVODE library", + ) + + add_arg( + group, + "--cvodes", + "SUNDIALS_CVODES", + "BUILD_CVODES", + "ON", + "BOOL", + "Build the CVODES library", + ) + + add_arg( + group, + "--ida", + "SUNDIALS_IDA", + "BUILD_IDA", + "ON", + "BOOL", + "Build the IDA library", + ) + + add_arg( + group, + "--idas", + "SUNDIALS_IDAS", + "BUILD_IDAS", + "ON", + "BOOL", + "Build the IDAS library", + ) + + add_arg( + group, + "--kinsol", + "SUNDIALS_KINSOL", + "BUILD_KINSOL", + "ON", + "BOOL", + "Build the KINSOL library", + ) # ----------------- # Packages Options # ----------------- - group = parser.add_argument_group('SUNDIALS Package Options', - '''Options for configuring SUNDIALS types + group = parser.add_argument_group( + "SUNDIALS Package Options", + """Options for configuring SUNDIALS types and enabling special compile time - features.''') + features.""", + ) # index size - add_arg(group, '--indexsize', 'SUNDIALS_INDEX_SIZE', 'SUNDIALS_INDEX_SIZE', - '64', 'STRING', 'index size', choices=['32', '64']) + add_arg( + group, + "--indexsize", + "SUNDIALS_INDEX_SIZE", + "SUNDIALS_INDEX_SIZE", + "64", + "STRING", + "index size", + choices=["32", "64"], + ) # precision - add_arg(group, '--precision', 'SUNDIALS_PRECISION', 'SUNDIALS_PRECISION', - 'double', 'STRING', 'real type precision', - choices=['single', 'double', 'extended']) + add_arg( + group, + "--precision", + "SUNDIALS_PRECISION", + "SUNDIALS_PRECISION", + "double", + "STRING", + "real type precision", + choices=["single", "double", "extended"], + ) # monitoring - add_arg(group, '--monitoring', 'SUNDIALS_MONITORING', - 'SUNDIALS_BUILD_WITH_MONITORING', 'OFF', 'BOOL', - 'integrator and solver monitoring') + add_arg( + group, + "--monitoring", + "SUNDIALS_MONITORING", + "SUNDIALS_BUILD_WITH_MONITORING", + "OFF", + "BOOL", + "integrator and solver monitoring", + ) # profiling - add_arg(group, '--profiling', 'SUNDIALS_PROFILING', - 'SUNDIALS_BUILD_WITH_PROFILING', 'OFF', 'BOOL', - 'fine-grained profiling') - - add_arg(group, '--logging-level', 'SUNDIALS_LOGGING_LEVEL', - 'SUNDIALS_LOGGING_LEVEL', '0', 'STRING', - 'logging', choices=['0', '1', '2', '3', '4', '5']) + add_arg( + group, + "--profiling", + "SUNDIALS_PROFILING", + "SUNDIALS_BUILD_WITH_PROFILING", + "OFF", + "BOOL", + "fine-grained profiling", + ) + + add_arg( + group, + "--logging-level", + "SUNDIALS_LOGGING_LEVEL", + "SUNDIALS_LOGGING_LEVEL", + "0", + "STRING", + "logging", + choices=["0", "1", "2", "3", "4", "5"], + ) # fused kernels - add_arg(group, '--fused-kernels', 'SUNDIALS_FUSED_KERNELS', - 'SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS', 'OFF', 'BOOL', - 'package fused kernels') + add_arg( + group, + "--fused-kernels", + "SUNDIALS_FUSED_KERNELS", + "SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS", + "OFF", + "BOOL", + "package fused kernels", + ) # error checks - add_arg(group, '--enable-error-checks', 'SUNDIALS_ENABLE_ERROR_CHECKS', - 'SUNDIALS_ENABLE_ERROR_CHECKS', 'OFF', 'BOOL', - 'enable error checks') - + add_arg( + group, + "--enable-error-checks", + "SUNDIALS_ENABLE_ERROR_CHECKS", + "SUNDIALS_ENABLE_ERROR_CHECKS", + "OFF", + "BOOL", + "enable error checks", + ) # ----------- # Interfaces # ----------- - group = parser.add_argument_group('SUNDIALS Interfaces', - '''These options enable or disable the - SUNDIALS Fortran interfaces.''') + group = parser.add_argument_group( + "SUNDIALS Interfaces", + """These options enable or disable the + SUNDIALS Fortran interfaces.""", + ) # Fortran interfaces - add_arg(group, '--fmod-interface', 'SUNDIALS_FMOD_INTERFACE', - 'BUILD_FORTRAN_MODULE_INTERFACE', 'OFF', 'BOOL', - 'Fortran module interface') + add_arg( + group, + "--fmod-interface", + "SUNDIALS_FMOD_INTERFACE", + "BUILD_FORTRAN_MODULE_INTERFACE", + "OFF", + "BOOL", + "Fortran module interface", + ) # --------- # Examples # --------- - group = parser.add_argument_group('Example and Benchmark Programs', - '''These options enable or disable + group = parser.add_argument_group( + "Example and Benchmark Programs", + """These options enable or disable building and installing the SUNDIALS - example and Benchmark programs.''') - - add_arg(group, '--examples-c', 'SUNDIALS_EXAMPLES_C', - 'EXAMPLES_ENABLE_C', 'ON', 'BOOL', 'C examples') - - add_arg(group, '--examples-cxx', 'SUNDIALS_EXAMPLES_CXX', - 'EXAMPLES_ENABLE_CXX', None, 'BOOL', 'C++ examples') - - add_arg(group, '--examples-f03', 'SUNDIALS_EXAMPLES_F03', - 'EXAMPLES_ENABLE_F2003', None, 'BOOL', - 'Fortran 2003 examples') - - add_arg(group, '--examples-cuda', 'SUNDIALS_EXAMPLES_CUDA', - 'EXAMPLES_ENABLE_CUDA', None, 'BOOL', 'CUDA examples') - - add_arg(group, '--benchmarks', 'SUNDIALS_BENCHMARKS', - 'BUILD_BENCHMARKS', 'OFF', 'BOOL', 'Benchmarks') + example and Benchmark programs.""", + ) + + add_arg( + group, + "--examples-c", + "SUNDIALS_EXAMPLES_C", + "EXAMPLES_ENABLE_C", + "ON", + "BOOL", + "C examples", + ) + + add_arg( + group, + "--examples-cxx", + "SUNDIALS_EXAMPLES_CXX", + "EXAMPLES_ENABLE_CXX", + None, + "BOOL", + "C++ examples", + ) + + add_arg( + group, + "--examples-f03", + "SUNDIALS_EXAMPLES_F03", + "EXAMPLES_ENABLE_F2003", + None, + "BOOL", + "Fortran 2003 examples", + ) + + add_arg( + group, + "--examples-cuda", + "SUNDIALS_EXAMPLES_CUDA", + "EXAMPLES_ENABLE_CUDA", + None, + "BOOL", + "CUDA examples", + ) + + add_arg( + group, + "--benchmarks", + "SUNDIALS_BENCHMARKS", + "BUILD_BENCHMARKS", + "OFF", + "BOOL", + "Benchmarks", + ) # ------------ # TPL Options @@ -282,317 +610,745 @@ def main(): # MPI # ---- - group = parser.add_argument_group('MPI Options', - '''Options for enabling MPI support in + group = parser.add_argument_group( + "MPI Options", + """Options for enabling MPI support in SUNDIALS and setting the MPI C, C++, and - Fortran compilers.''') - - add_arg(group, '--mpi', 'SUNDIALS_MPI', 'ENABLE_MPI', 'OFF', - 'FILEPATH', 'SUNDIALS MPI support') - - add_arg(group, '--mpicc', 'MPICC', 'MPI_C_COMPILER', None, - 'FILEPATH', 'MPI C compiler', dependson='--mpi') - - add_arg(group, '--mpicxx', 'MPICXX', 'MPI_CXX_COMPILER', None, - 'FILEPATH', 'MPI C++ compiler', dependson='--mpi') - - add_arg(group, '--mpifort', 'MPIFC', 'MPI_Fortran_COMPILER', None, - 'FILEPATH', 'MPI Fortran compiler', dependson='--mpi') - - add_arg(group, '--mpiexec', 'MPIEXEC', 'MPIEXEC_EXECUTABLE', None, - 'FILEPATH', 'MPI executable', dependson='--mpi') - - add_arg(group, '--mpiexec-pre-flags', 'MPIEXEC_PREFLAGS', 'MPIEXEC_PREFLAGS', None, - 'STRING', 'MPI executable extra flags', dependson='--mpi') + Fortran compilers.""", + ) + + add_arg( + group, + "--mpi", + "SUNDIALS_MPI", + "ENABLE_MPI", + "OFF", + "FILEPATH", + "SUNDIALS MPI support", + ) + + add_arg( + group, + "--mpicc", + "MPICC", + "MPI_C_COMPILER", + None, + "FILEPATH", + "MPI C compiler", + dependson="--mpi", + ) + + add_arg( + group, + "--mpicxx", + "MPICXX", + "MPI_CXX_COMPILER", + None, + "FILEPATH", + "MPI C++ compiler", + dependson="--mpi", + ) + + add_arg( + group, + "--mpifort", + "MPIFC", + "MPI_Fortran_COMPILER", + None, + "FILEPATH", + "MPI Fortran compiler", + dependson="--mpi", + ) + + add_arg( + group, + "--mpiexec", + "MPIEXEC", + "MPIEXEC_EXECUTABLE", + None, + "FILEPATH", + "MPI executable", + dependson="--mpi", + ) + + add_arg( + group, + "--mpiexec-pre-flags", + "MPIEXEC_PREFLAGS", + "MPIEXEC_PREFLAGS", + None, + "STRING", + "MPI executable extra flags", + dependson="--mpi", + ) # ---------- # Threading # ---------- # OpenMP - group = parser.add_argument_group('OpenMP Options', - '''Options for enabling OpenMP support in - SUNDIALS.''') - - add_arg(group, '--openmp', 'SUNDIALS_OPENMP', 'ENABLE_OPENMP', 'OFF', - 'BOOL', 'SUNDIALS OpenMP support') - - add_arg(group, '--openmp-device-works', 'SUNDIALS_OPENMP_DEVICE_WORKS', - 'OPENMP_DEVICE_WORKS', 'OFF', 'BOOL', - 'Disable OpenMP Device Support Checks (assume OpenMP 4.5+)') - + group = parser.add_argument_group( + "OpenMP Options", + """Options for enabling OpenMP support in + SUNDIALS.""", + ) + + add_arg( + group, + "--openmp", + "SUNDIALS_OPENMP", + "ENABLE_OPENMP", + "OFF", + "BOOL", + "SUNDIALS OpenMP support", + ) + + add_arg( + group, + "--openmp-device-works", + "SUNDIALS_OPENMP_DEVICE_WORKS", + "OPENMP_DEVICE_WORKS", + "OFF", + "BOOL", + "Disable OpenMP Device Support Checks (assume OpenMP 4.5+)", + ) # Pthread - group = parser.add_argument_group('Pthread Options', - '''Options for enabling - Pthread support in SUNDIALS.''') - - add_arg(group, '--pthread', 'SUNDIALS_PTHREAD', 'ENABLE_PTHREAD', 'OFF', - 'BOOL', 'SUNDIALS PThread support') + group = parser.add_argument_group( + "Pthread Options", + """Options for enabling + Pthread support in SUNDIALS.""", + ) + + add_arg( + group, + "--pthread", + "SUNDIALS_PTHREAD", + "ENABLE_PTHREAD", + "OFF", + "BOOL", + "SUNDIALS PThread support", + ) # ----- # GPUs # ----- # CUDA - group = parser.add_argument_group('CUDA Options', - '''Options for enabling CUDA support in - - SUNDIALS''') - add_arg(group, '--cuda', 'SUNDIALS_CUDA', 'ENABLE_CUDA', 'OFF', 'BOOL', - 'SUNDIALS CUDA support') + group = parser.add_argument_group( + "CUDA Options", + """Options for enabling CUDA support in + + SUNDIALS""", + ) + add_arg( + group, + "--cuda", + "SUNDIALS_CUDA", + "ENABLE_CUDA", + "OFF", + "BOOL", + "SUNDIALS CUDA support", + ) # HIP - group = parser.add_argument_group('HIP Options', - '''Options for enabling HIP support in - SUNDIALS.''') - - add_arg(group, '--hip', 'SUNDIALS_HIP', 'ENABLE_HIP', 'OFF', 'BOOL', - 'SUNDIALS HIP support') + group = parser.add_argument_group( + "HIP Options", + """Options for enabling HIP support in + SUNDIALS.""", + ) + + add_arg( + group, + "--hip", + "SUNDIALS_HIP", + "ENABLE_HIP", + "OFF", + "BOOL", + "SUNDIALS HIP support", + ) # OpenMP Offload - group = parser.add_argument_group('OpenMP Offload Options', - '''Options for enabling OpenMP offload - support in SUNDIALS.''') - - add_arg(group, '--openmp-offload', 'SUNDIALS_OPENMP_OFFLOAD', - 'ENABLE_OPENMP_DEVICE', 'OFF', 'BOOL', - 'SUNDIALS OpenMP offload support') + group = parser.add_argument_group( + "OpenMP Offload Options", + """Options for enabling OpenMP offload + support in SUNDIALS.""", + ) + + add_arg( + group, + "--openmp-offload", + "SUNDIALS_OPENMP_OFFLOAD", + "ENABLE_OPENMP_DEVICE", + "OFF", + "BOOL", + "SUNDIALS OpenMP offload support", + ) # ------------------------ # Performance portability # ------------------------ # Kokkos - group = parser.add_argument_group('Kokkos Options') - - add_arg(group, '--kokkos', 'SUNDIALS_KOKKOS', 'ENABLE_KOKKOS', 'OFF', - 'BOOL', 'SUNDIALS Kokkos support') - - add_arg(group, '--kokkos-dir', 'KOKKOS_ROOT', 'Kokkos_DIR', None, 'PATH', - 'Kokkos install directory', dependson='--kokkos') + group = parser.add_argument_group("Kokkos Options") + + add_arg( + group, + "--kokkos", + "SUNDIALS_KOKKOS", + "ENABLE_KOKKOS", + "OFF", + "BOOL", + "SUNDIALS Kokkos support", + ) + + add_arg( + group, + "--kokkos-dir", + "KOKKOS_ROOT", + "Kokkos_DIR", + None, + "PATH", + "Kokkos install directory", + dependson="--kokkos", + ) # RAJA - group = parser.add_argument_group('RAJA Options') - - add_arg(group, '--raja', 'SUNDIALS_RAJA', 'ENABLE_RAJA', 'OFF', 'BOOL', - 'SUNDIALS Raja support') - - add_arg(group, '--raja-dir', 'RAJA_ROOT', 'RAJA_DIR', None, 'PATH', - 'RAJA install directory', dependson='--raja') - - add_arg(group, '--raja-backends', 'RAJA_BACKENDS', - 'SUNDIALS_RAJA_BACKENDS', None, 'STRING', 'RAJA backends', - choices=['CUDA', 'HIP'], dependson='--raja') + group = parser.add_argument_group("RAJA Options") + + add_arg( + group, + "--raja", + "SUNDIALS_RAJA", + "ENABLE_RAJA", + "OFF", + "BOOL", + "SUNDIALS Raja support", + ) + + add_arg( + group, + "--raja-dir", + "RAJA_ROOT", + "RAJA_DIR", + None, + "PATH", + "RAJA install directory", + dependson="--raja", + ) + + add_arg( + group, + "--raja-backends", + "RAJA_BACKENDS", + "SUNDIALS_RAJA_BACKENDS", + None, + "STRING", + "RAJA backends", + choices=["CUDA", "HIP"], + dependson="--raja", + ) # SYCL - group = parser.add_argument_group('SYCL Options') - - add_arg(group, '--sycl', 'SUNDIALS_SYCL', 'ENABLE_SYCL', 'OFF', 'BOOL', - 'SUNDIALS SYCL support') + group = parser.add_argument_group("SYCL Options") + + add_arg( + group, + "--sycl", + "SUNDIALS_SYCL", + "ENABLE_SYCL", + "OFF", + "BOOL", + "SUNDIALS SYCL support", + ) # ------------------------ # Linear solver libraries # ------------------------ # Ginkgo - group = parser.add_argument_group('Ginkgo Options') - - add_arg(group, '--ginkgo', 'SUNDIALS_GINKGO', 'ENABLE_GINKGO', 'OFF', - 'BOOL', 'SUNDIALS Ginkgo support') - - add_arg(group, '--ginkgo-dir', 'GINKGO_ROOT', 'Ginkgo_DIR', None, 'PATH', - 'Ginkgo install directory', dependson='--ginkgo') - - add_arg(group, '--ginkgo-backends', 'GINKGO_BACKENDS', - 'SUNDIALS_GINKGO_BACKENDS', 'REF;OMP', 'STRING', 'Ginkgo backends', - choices=['REF', 'OMP', 'CUDA', 'HIP', 'DPCPP'], dependson='--ginkgo') + group = parser.add_argument_group("Ginkgo Options") + + add_arg( + group, + "--ginkgo", + "SUNDIALS_GINKGO", + "ENABLE_GINKGO", + "OFF", + "BOOL", + "SUNDIALS Ginkgo support", + ) + + add_arg( + group, + "--ginkgo-dir", + "GINKGO_ROOT", + "Ginkgo_DIR", + None, + "PATH", + "Ginkgo install directory", + dependson="--ginkgo", + ) + + add_arg( + group, + "--ginkgo-backends", + "GINKGO_BACKENDS", + "SUNDIALS_GINKGO_BACKENDS", + "REF;OMP", + "STRING", + "Ginkgo backends", + choices=["REF", "OMP", "CUDA", "HIP", "DPCPP"], + dependson="--ginkgo", + ) # LAPACK - group = parser.add_argument_group('LAPACK Options') - - add_arg(group, '--lapack', 'SUNDIALS_LAPACK', 'ENABLE_LAPACK', 'OFF', - 'BOOL', 'SUNDIALS LAPACK support') - - add_arg(group, '--lapack-libs', 'LAPACK_LIBRARIES', 'LAPACK_LIBRARIES', - None, 'STRING', 'LAPACK libraries', dependson='--lapack') + group = parser.add_argument_group("LAPACK Options") + + add_arg( + group, + "--lapack", + "SUNDIALS_LAPACK", + "ENABLE_LAPACK", + "OFF", + "BOOL", + "SUNDIALS LAPACK support", + ) + + add_arg( + group, + "--lapack-libs", + "LAPACK_LIBRARIES", + "LAPACK_LIBRARIES", + None, + "STRING", + "LAPACK libraries", + dependson="--lapack", + ) # KLU - group = parser.add_argument_group('KLU Options') - - add_arg(group, '--klu', 'SUNDIALS_KLU', 'ENABLE_KLU', 'OFF', 'BOOL', - 'SUNDIALS KLU support') - - add_arg(group, '--klu-incdir', 'SUITE_SPARSE_INCLUDE_DIR', - 'KLU_INCLUDE_DIR', None, 'PATH', 'KLU include directory', - dependson='--klu') - - add_arg(group, '--klu-libdir', 'SUITE_SPARSE_LIBRARY_DIR', - 'KLU_LIBRARY_DIR', None, 'PATH', 'KLU library directory', - dependson='--klu') + group = parser.add_argument_group("KLU Options") + + add_arg( + group, + "--klu", + "SUNDIALS_KLU", + "ENABLE_KLU", + "OFF", + "BOOL", + "SUNDIALS KLU support", + ) + + add_arg( + group, + "--klu-incdir", + "SUITE_SPARSE_INCLUDE_DIR", + "KLU_INCLUDE_DIR", + None, + "PATH", + "KLU include directory", + dependson="--klu", + ) + + add_arg( + group, + "--klu-libdir", + "SUITE_SPARSE_LIBRARY_DIR", + "KLU_LIBRARY_DIR", + None, + "PATH", + "KLU library directory", + dependson="--klu", + ) # KokkosKernels - group = parser.add_argument_group('KokkosKernels Options') - - add_arg(group, '--kokkos-kernels', 'SUNDIALS_KOKKOS_KERNELS', - 'ENABLE_KOKKOS_KERNELS', 'OFF', 'BOOL', - 'SUNDIALS Kokkos-Kernels support') - - add_arg(group, '--kokkos-kernels-dir', 'KOKKOS_KERNELS_ROOT', - 'KokkosKernels_DIR', None, 'PATH', - 'Kokkos-Kernels install directory', dependson='--kokkos-kernels') + group = parser.add_argument_group("KokkosKernels Options") + + add_arg( + group, + "--kokkos-kernels", + "SUNDIALS_KOKKOS_KERNELS", + "ENABLE_KOKKOS_KERNELS", + "OFF", + "BOOL", + "SUNDIALS Kokkos-Kernels support", + ) + + add_arg( + group, + "--kokkos-kernels-dir", + "KOKKOS_KERNELS_ROOT", + "KokkosKernels_DIR", + None, + "PATH", + "Kokkos-Kernels install directory", + dependson="--kokkos-kernels", + ) # SuperLU MT - group = parser.add_argument_group('SuperLU_MT Options') - - add_arg(group, '--superlu-mt', 'SUNDIALS_SUPERLU_MT', 'ENABLE_SUPERLUMT', - 'OFF', 'BOOL', 'SUNDIALS SuperLU MT support') - - add_arg(group, '--superlu-mt-incdir', 'SUPERLU_MT_INCLUDE_DIR', - 'SUPERLUMT_INCLUDE_DIR', None, 'PATH', - 'SuperLU_MT include directory', dependson='--superlu-mt') - - add_arg(group, '--superlu-mt-libdir', 'SUPERLU_MT_LIBRARY_DIR', - 'SUPERLUMT_LIBRARY_DIR', None, 'PATH', - 'SuperLU_MT library directory', dependson='--superlu-mt') - - add_arg(group, '--superlu-mt-libs', 'SUPERLU_MT_LIBRARIES', - 'SUPERLUMT_LIBRARIES', None, 'STRING', - 'SuperLU_MT additional libraries', dependson='--superlu-mt') - - add_arg(group, '--superlu-mt-thread-type', 'SUPERLU_MT_THREAD_TYPE', - 'SUPERLUMT_THREAD_TYPE', None, 'STRING', - 'SuperLU_MT thread type', choices=['OpenMP', 'Pthread'], - dependson='--superlu-mt') + group = parser.add_argument_group("SuperLU_MT Options") + + add_arg( + group, + "--superlu-mt", + "SUNDIALS_SUPERLU_MT", + "ENABLE_SUPERLUMT", + "OFF", + "BOOL", + "SUNDIALS SuperLU MT support", + ) + + add_arg( + group, + "--superlu-mt-incdir", + "SUPERLU_MT_INCLUDE_DIR", + "SUPERLUMT_INCLUDE_DIR", + None, + "PATH", + "SuperLU_MT include directory", + dependson="--superlu-mt", + ) + + add_arg( + group, + "--superlu-mt-libdir", + "SUPERLU_MT_LIBRARY_DIR", + "SUPERLUMT_LIBRARY_DIR", + None, + "PATH", + "SuperLU_MT library directory", + dependson="--superlu-mt", + ) + + add_arg( + group, + "--superlu-mt-libs", + "SUPERLU_MT_LIBRARIES", + "SUPERLUMT_LIBRARIES", + None, + "STRING", + "SuperLU_MT additional libraries", + dependson="--superlu-mt", + ) + + add_arg( + group, + "--superlu-mt-thread-type", + "SUPERLU_MT_THREAD_TYPE", + "SUPERLUMT_THREAD_TYPE", + None, + "STRING", + "SuperLU_MT thread type", + choices=["OpenMP", "Pthread"], + dependson="--superlu-mt", + ) # SuperLU DIST - group = parser.add_argument_group('SuperLU_DIST Options') - - add_arg(group, '--superlu-dist', 'SUNDIALS_SUPERLU_DIST', - 'ENABLE_SUPERLUDIST', 'OFF', 'BOOL', - 'SUNDIALS SuperLU DIST support') - - add_arg(group, '--superlu-dist-dir', 'SUPERLU_DIST_ROOT', - 'SUPERLUDIST_DIR', None, 'PATH', - 'SuperLU_DIST installation directory', dependson='--superlu-dist') - - add_arg(group, '--superlu-dist-incdir', 'SUPERLU_DIST_INCLUDE_DIR', - 'SUPERLUDIST_INCLUDE_DIR', None, 'PATH', - 'SuperLU_DIST include directory', dependson='--superlu-dist') - - add_arg(group, '--superlu-dist-libdir', 'SUPERLU_DIST_LIBRARY_DIR', - 'SUPERLUDIST_LIBRARY_DIR', None, 'PATH', - 'SuperLU_DIST library directory', dependson='--superlu-dist') - - add_arg(group, '--superlu-dist-libs', 'SUPERLU_DIST_LIBRARIES', - 'SUPERLUDIST_LIBRARIES', None, 'STRING', - 'SuperLU_DIST additional libraries', dependson='--superlu-dist') - - add_arg(group, '--superlu-dist-openmp', 'SUPERLU_DIST_OPENMP', - 'SUPERLUDIST_OpenMP', 'OFF', 'BOOL', 'SuperLU_DIST OpenMP enabled', - dependson='--superlu-dist') + group = parser.add_argument_group("SuperLU_DIST Options") + + add_arg( + group, + "--superlu-dist", + "SUNDIALS_SUPERLU_DIST", + "ENABLE_SUPERLUDIST", + "OFF", + "BOOL", + "SUNDIALS SuperLU DIST support", + ) + + add_arg( + group, + "--superlu-dist-dir", + "SUPERLU_DIST_ROOT", + "SUPERLUDIST_DIR", + None, + "PATH", + "SuperLU_DIST installation directory", + dependson="--superlu-dist", + ) + + add_arg( + group, + "--superlu-dist-incdir", + "SUPERLU_DIST_INCLUDE_DIR", + "SUPERLUDIST_INCLUDE_DIR", + None, + "PATH", + "SuperLU_DIST include directory", + dependson="--superlu-dist", + ) + + add_arg( + group, + "--superlu-dist-libdir", + "SUPERLU_DIST_LIBRARY_DIR", + "SUPERLUDIST_LIBRARY_DIR", + None, + "PATH", + "SuperLU_DIST library directory", + dependson="--superlu-dist", + ) + + add_arg( + group, + "--superlu-dist-libs", + "SUPERLU_DIST_LIBRARIES", + "SUPERLUDIST_LIBRARIES", + None, + "STRING", + "SuperLU_DIST additional libraries", + dependson="--superlu-dist", + ) + + add_arg( + group, + "--superlu-dist-openmp", + "SUPERLU_DIST_OPENMP", + "SUPERLUDIST_OpenMP", + "OFF", + "BOOL", + "SuperLU_DIST OpenMP enabled", + dependson="--superlu-dist", + ) # Magma - group = parser.add_argument_group('MAGMA Options') - - add_arg(group, '--magma', 'SUNDIALS_MAGMA', 'ENABLE_MAGMA', 'OFF', 'BOOL', - 'SUNDIALS MAGMA support') - - add_arg(group, '--magma-dir', 'MAGMA_ROOT', 'MAGMA_DIR', None, 'PATH', - 'MAGMA install directory', dependson='--magma') - - add_arg(group, '--magma-backends', 'MAGAMA_BACKENDS', - 'SUNDIALS_MAGMA_BACKENDS', None, 'STRING', 'MAGMA backends', - choices=['CUDA', 'HIP'], dependson='--magma') + group = parser.add_argument_group("MAGMA Options") + + add_arg( + group, + "--magma", + "SUNDIALS_MAGMA", + "ENABLE_MAGMA", + "OFF", + "BOOL", + "SUNDIALS MAGMA support", + ) + + add_arg( + group, + "--magma-dir", + "MAGMA_ROOT", + "MAGMA_DIR", + None, + "PATH", + "MAGMA install directory", + dependson="--magma", + ) + + add_arg( + group, + "--magma-backends", + "MAGAMA_BACKENDS", + "SUNDIALS_MAGMA_BACKENDS", + None, + "STRING", + "MAGMA backends", + choices=["CUDA", "HIP"], + dependson="--magma", + ) # ---------------- # Other libraries # ---------------- # hypre - group = parser.add_argument_group('hypre Options') - - add_arg(group, '--hypre', 'SUNDIALS_HYPRE', 'ENABLE_HYPRE', 'OFF', 'BOOL', - 'SUNDIALS hypre support') - - add_arg(group, '--hypre-incdir', 'HYPRE_INCLUDE_DIR', - 'HYPRE_INCLUDE_DIR', None, 'PATH', - 'Hypre include directory', dependson='--hypre') - - add_arg(group, '--hypre-libdir', 'HYPRE_LIBRARY_DIR', - 'HYPRE_LIBRARY_DIR', None, 'PATH', - 'Hypre library directory', dependson='--hypre') + group = parser.add_argument_group("hypre Options") + + add_arg( + group, + "--hypre", + "SUNDIALS_HYPRE", + "ENABLE_HYPRE", + "OFF", + "BOOL", + "SUNDIALS hypre support", + ) + + add_arg( + group, + "--hypre-incdir", + "HYPRE_INCLUDE_DIR", + "HYPRE_INCLUDE_DIR", + None, + "PATH", + "Hypre include directory", + dependson="--hypre", + ) + + add_arg( + group, + "--hypre-libdir", + "HYPRE_LIBRARY_DIR", + "HYPRE_LIBRARY_DIR", + None, + "PATH", + "Hypre library directory", + dependson="--hypre", + ) # PETSc - group = parser.add_argument_group('PTESc Options') - - add_arg(group, '--petsc', 'SUNDIALS_PETSC', 'ENABLE_PETSC', 'OFF', 'BOOL', - 'SUNDIALS PETSc support') - - add_arg(group, '--petsc-dir', 'PETSC_ROOT', 'PETSC_DIR', None, 'PATH', - 'PETSc install directory', dependson='--petsc') + group = parser.add_argument_group("PTESc Options") + + add_arg( + group, + "--petsc", + "SUNDIALS_PETSC", + "ENABLE_PETSC", + "OFF", + "BOOL", + "SUNDIALS PETSc support", + ) + + add_arg( + group, + "--petsc-dir", + "PETSC_ROOT", + "PETSC_DIR", + None, + "PATH", + "PETSc install directory", + dependson="--petsc", + ) # Trilinos - group = parser.add_argument_group('Trilinos Options') - - add_arg(group, '--trilinos', 'SUNDIALS_TRILINOS', 'ENABLE_TRILINOS', 'OFF', - 'BOOL', 'SUNDIALS Trilinos support') - - add_arg(group, '--trilinos-dir', 'TRILINOS_ROOT', 'Trilinos_DIR', None, - 'PATH', 'Trilinos install directory', dependson='--trilinos') + group = parser.add_argument_group("Trilinos Options") + + add_arg( + group, + "--trilinos", + "SUNDIALS_TRILINOS", + "ENABLE_TRILINOS", + "OFF", + "BOOL", + "SUNDIALS Trilinos support", + ) + + add_arg( + group, + "--trilinos-dir", + "TRILINOS_ROOT", + "Trilinos_DIR", + None, + "PATH", + "Trilinos install directory", + dependson="--trilinos", + ) # XBraid - group = parser.add_argument_group('XBraid Options') - - add_arg(group, '--xbraid', 'SUNDIALS_XBRAID', 'ENABLE_XBRAID', 'OFF', - 'BOOL', 'SUNDIALS XBraid support') - - add_arg(group, '--xbraid-dir', 'XBRAID_ROOT', 'XBRAID_DIR', None, 'PATH', - 'XBraid install directory', dependson='--xbraid') + group = parser.add_argument_group("XBraid Options") + + add_arg( + group, + "--xbraid", + "SUNDIALS_XBRAID", + "ENABLE_XBRAID", + "OFF", + "BOOL", + "SUNDIALS XBraid support", + ) + + add_arg( + group, + "--xbraid-dir", + "XBRAID_ROOT", + "XBRAID_DIR", + None, + "PATH", + "XBraid install directory", + dependson="--xbraid", + ) # -------- # Testing # -------- - group = parser.add_argument_group('Testing Options') + group = parser.add_argument_group("Testing Options") # development tests - add_arg(group, '--dev-tests', 'SUNDIALS_TEST_DEVTESTS', - 'SUNDIALS_TEST_DEVTESTS', 'OFF', 'BOOL', - 'SUNDIALS development tests') + add_arg( + group, + "--dev-tests", + "SUNDIALS_TEST_DEVTESTS", + "SUNDIALS_TEST_DEVTESTS", + "OFF", + "BOOL", + "SUNDIALS development tests", + ) # unit tests - add_arg(group, '--unit-tests', 'SUNDIALS_TEST_UNITTESTS', - 'SUNDIALS_TEST_UNITTESTS', 'OFF', 'BOOL', - 'SUNDIALS unit tests') - - add_arg(group, '--no-gtest', 'SUNDIALS_TEST_ENABLE_GTEST', - 'SUNDIALS_TEST_ENABLE_GTEST', 'ON', 'BOOL', - 'SUNDIALS GTest unit tests') + add_arg( + group, + "--unit-tests", + "SUNDIALS_TEST_UNITTESTS", + "SUNDIALS_TEST_UNITTESTS", + "OFF", + "BOOL", + "SUNDIALS unit tests", + ) + + add_arg( + group, + "--no-gtest", + "SUNDIALS_TEST_ENABLE_GTEST", + "SUNDIALS_TEST_ENABLE_GTEST", + "ON", + "BOOL", + "SUNDIALS GTest unit tests", + ) # test output directory - add_arg(group, '--test-output-dir', 'SUNDIALS_TEST_OUTPUT_DIR', - 'SUNDIALS_TEST_OUTPUT_DIR', None, 'PATH', - 'SUNDIALS test output directory') + add_arg( + group, + "--test-output-dir", + "SUNDIALS_TEST_OUTPUT_DIR", + "SUNDIALS_TEST_OUTPUT_DIR", + None, + "PATH", + "SUNDIALS test output directory", + ) # test answer directory - add_arg(group, '--test-answer-dir', 'SUNDIALS_TEST_ANSWER_DIR', - 'SUNDIALS_TEST_ANSWER_DIR', None, 'PATH', - 'SUNDIALS test answer directory') + add_arg( + group, + "--test-answer-dir", + "SUNDIALS_TEST_ANSWER_DIR", + "SUNDIALS_TEST_ANSWER_DIR", + None, + "PATH", + "SUNDIALS test answer directory", + ) # test float comparison precision - add_arg(group, '--test-float-precision', 'SUNDIALS_TEST_FLOAT_PRECISION', - 'SUNDIALS_TEST_FLOAT_PRECISION', None, 'STRING', - 'SUNDIALS test float comparison precision') + add_arg( + group, + "--test-float-precision", + "SUNDIALS_TEST_FLOAT_PRECISION", + "SUNDIALS_TEST_FLOAT_PRECISION", + None, + "STRING", + "SUNDIALS test float comparison precision", + ) # test integer comparison precision - add_arg(group, '--test-integer-precision', - 'SUNDIALS_TEST_INTEGER_PRECISION', - 'SUNDIALS_TEST_INTEGER_PRECISION', None, 'STRING', - 'SUNDIALS test integer comparison precision') - - add_arg(group, '--make-verbose', 'CMAKE_VERBOSE_MAKEFILE', - 'CMAKE_VERBOSE_MAKEFILE', 'OFF', 'BOOL', 'verbose make output') + add_arg( + group, + "--test-integer-precision", + "SUNDIALS_TEST_INTEGER_PRECISION", + "SUNDIALS_TEST_INTEGER_PRECISION", + None, + "STRING", + "SUNDIALS test integer comparison precision", + ) + + add_arg( + group, + "--make-verbose", + "CMAKE_VERBOSE_MAKEFILE", + "CMAKE_VERBOSE_MAKEFILE", + "OFF", + "BOOL", + "verbose make output", + ) # --------------------- # Parse and check args @@ -640,20 +1396,20 @@ def read_env(args): continue # don't overwite options already set at command line - value = args_dict[a]['value'] - default = args_dict[a]['default'] + value = args_dict[a]["value"] + default = args_dict[a]["default"] if value != default: continue # check for environment variable and set value - env_var = args_dict[a]['env_var'] + env_var = args_dict[a]["env_var"] if env_var is None: continue if env_var in os.environ: - args_dict[a]['value'] = os.environ[env_var] + args_dict[a]["value"] = os.environ[env_var] # ----------------------------------------------------------------------------- @@ -661,31 +1417,49 @@ def read_env(args): # ----------------------------------------------------------------------------- -def add_arg(parser, arg, env_var, cmake_var, cmake_default, cmake_type, msg, - choices=None, dependson=None): +def add_arg( + parser, + arg, + env_var, + cmake_var, + cmake_default, + cmake_type, + msg, + choices=None, + dependson=None, +): """Add a command SUNDIALS option command line arg""" # Use underscores in the arg variable name - arg_dest = arg[2:].replace('-', '_') + arg_dest = arg[2:].replace("-", "_") help_msg = msg # Define function to create an argparse SUNDIALS option type - arg_type = cmake_arg(env_var, cmake_var, cmake_default, cmake_type, msg, - choices=choices, dependson=dependson) + arg_type = cmake_arg( + env_var, + cmake_var, + cmake_default, + cmake_type, + msg, + choices=choices, + dependson=dependson, + ) # Replace 'None' with a default string to ensure a dictionary is created # even when a command line input is not provided. This is ensures the # dictionary exists when reading variables from the environment. if cmake_default is None: - cmake_default = '__default_none__' + cmake_default = "__default_none__" # Create command line arg - parser.add_argument(arg, dest=arg_dest, type=arg_type, - default=cmake_default, help=help_msg) + parser.add_argument( + arg, dest=arg_dest, type=arg_type, default=cmake_default, help=help_msg + ) -def cmake_arg(env_var, cmake_var, cmake_default, cmake_type, msg, - choices=None, dependson=None): +def cmake_arg( + env_var, cmake_var, cmake_default, cmake_type, msg, choices=None, dependson=None +): """Function factory for argparse SUNDIALS option type""" def _cmake_arg(str_var): @@ -694,19 +1468,19 @@ def _cmake_arg(str_var): import argparse # check if using None for the default value - if str_var == '__default_none__': + if str_var == "__default_none__": str_var = None # check for valid input options - if cmake_type == 'BOOL' and str_var not in ['ON', 'OFF', None]: - err_msg = 'Invalid option value ' + str_var + '. ' - err_msg += 'Input value must be ON or OFF.' + if cmake_type == "BOOL" and str_var not in ["ON", "OFF", None]: + err_msg = "Invalid option value " + str_var + ". " + err_msg += "Input value must be ON or OFF." raise argparse.ArgumentTypeError("Invaid Value for BOOL") if choices is not None and str_var is not None: raise_error = False if ";" in str_var: - for s in str_var.split(';'): + for s in str_var.split(";"): if s not in choices: raise_error = True else: @@ -714,24 +1488,24 @@ def _cmake_arg(str_var): raise_error = True if raise_error: - err_msg = 'Invalid option value ' + str_var + '. ' - err_msg += 'Input value must be ' + err_msg = "Invalid option value " + str_var + ". " + err_msg += "Input value must be " if len(choices) < 3: - err_msg += ' or '.join(choices) + '.' + err_msg += " or ".join(choices) + "." else: - err_msg += ', '.join(choices[:-1]) - err_msg += ', or ' + choices[-1] + '.' + err_msg += ", ".join(choices[:-1]) + err_msg += ", or " + choices[-1] + "." raise argparse.ArgumentTypeError(err_msg) # create dictionary for SUNDIALS option cmake_dict = {} - cmake_dict['env_var'] = env_var - cmake_dict['cmake_var'] = cmake_var - cmake_dict['default'] = cmake_default - cmake_dict['cmake_type'] = cmake_type - cmake_dict['msg'] = msg - cmake_dict['value'] = str_var - cmake_dict['depends_on'] = dependson + cmake_dict["env_var"] = env_var + cmake_dict["cmake_var"] = cmake_var + cmake_dict["default"] = cmake_default + cmake_dict["cmake_type"] = cmake_type + cmake_dict["msg"] = msg + cmake_dict["value"] = str_var + cmake_dict["depends_on"] = dependson return cmake_dict @@ -761,35 +1535,34 @@ def write_cmake(fn, args): # print(a, args_dict[a]) # don't wite output lines if using the default value - value = args_dict[a]['value'] - default = args_dict[a]['default'] + value = args_dict[a]["value"] + default = args_dict[a]["default"] if value is None or value == default: continue # don't wite output if TPL is not enabled - depends_on = args_dict[a]['depends_on'] + depends_on = args_dict[a]["depends_on"] if depends_on is not None: - depends_on = depends_on[2:].replace('-', '_') - depends_on_val = args_dict[depends_on]['value'] + depends_on = depends_on[2:].replace("-", "_") + depends_on_val = args_dict[depends_on]["value"] # print(depends_on, depends_on_val) - if depends_on_val != 'ON': + if depends_on_val != "ON": continue # write CMake output - cmake_var = args_dict[a]['cmake_var'] - cmake_type = args_dict[a]['cmake_type'] - cmake_msg = args_dict[a]['msg'] + cmake_var = args_dict[a]["cmake_var"] + cmake_type = args_dict[a]["cmake_type"] + cmake_msg = args_dict[a]["msg"] - if args.filetype == 'cache': - cmd = (f"set({cmake_var} \"{value}\" CACHE {cmake_type} " - f"\"{cmake_msg}\")\n") + if args.filetype == "cache": + cmd = f'set({cmake_var} "{value}" CACHE {cmake_type} ' f'"{cmake_msg}")\n' else: - cmd = f" \\\n -D {cmake_var}=\"{value}\"" + cmd = f' \\\n -D {cmake_var}="{value}"' fn.write(cmd) @@ -799,13 +1572,15 @@ def setup_file(cmakefile, filename, filetype): import os import stat - if filetype == 'cache': - msg = (f'# CMake cache file for configuring SUNDIALS\n' - f'#\n' - f'# Move this file to your build directory and configure ' - f'SUNDIALS with the\n' - f'# following command:\n' - f'# cmake <path to SUNDIALS source> -C {filename}\n') + if filetype == "cache": + msg = ( + f"# CMake cache file for configuring SUNDIALS\n" + f"#\n" + f"# Move this file to your build directory and configure " + f"SUNDIALS with the\n" + f"# following command:\n" + f"# cmake <path to SUNDIALS source> -C {filename}\n" + ) cmakefile.write(msg) # update permissions to make sure the file is not executable @@ -817,18 +1592,20 @@ def setup_file(cmakefile, filename, filetype): st = os.stat(filename) os.chmod(filename, st.st_mode & NO_EXE) else: - msg = (f'#!/bin/bash\n' - f'# Script for configuring SUNDIALS\n' - f'#\n' - f'# Move this file to your build directory and configure ' - f'SUNDIALS with the\n' - f'# following command:\n' - f'# ./{filename} <path to SUNDIALS source>\n' - f'if [ "$#" -lt 1 ]; then\n' - f' echo "ERROR: Path to SUNDIALS source required"\n' - f' exit 1\n' - f'fi\n' - f'cmake $1') + msg = ( + f"#!/bin/bash\n" + f"# Script for configuring SUNDIALS\n" + f"#\n" + f"# Move this file to your build directory and configure " + f"SUNDIALS with the\n" + f"# following command:\n" + f"# ./{filename} <path to SUNDIALS source>\n" + f'if [ "$#" -lt 1 ]; then\n' + f' echo "ERROR: Path to SUNDIALS source required"\n' + f" exit 1\n" + f"fi\n" + f"cmake $1" + ) cmakefile.write(msg) # update permissions to make sure the user can execute the script @@ -858,6 +1635,7 @@ def print_args(args): # ----------------------------------------------------------------------------- -if __name__ == '__main__': +if __name__ == "__main__": import sys + sys.exit(main()) diff --git a/test/notify.py b/test/notify.py index befdd721ab..ee19008d9a 100755 --- a/test/notify.py +++ b/test/notify.py @@ -15,24 +15,29 @@ # Send email notification if a SUNDIALS regression test status # ----------------------------------------------------------------------------- + def main(): import argparse import os parser = argparse.ArgumentParser( - description='Send email notification based on regression test status', - formatter_class=argparse.RawTextHelpFormatter) + description="Send email notification based on regression test status", + formatter_class=argparse.RawTextHelpFormatter, + ) - parser.add_argument('teststatus', type=str, - choices=['passed', 'failed', 'fixed'], - help='Status of regression test') + parser.add_argument( + "teststatus", + type=str, + choices=["passed", "failed", "fixed"], + help="Status of regression test", + ) - parser.add_argument('testname', type=str, - help='Name branch name or pull-request tested') + parser.add_argument( + "testname", type=str, help="Name branch name or pull-request tested" + ) - parser.add_argument('testurl', type=str, - help='URL for viewing test results') + parser.add_argument("testurl", type=str, help="URL for viewing test results") # parse command line args args = parser.parse_args() @@ -41,7 +46,7 @@ def main(): logfile = "suntest.log" # if log file exists add url, otherwise create log file - if (os.path.isfile(logfile)): + if os.path.isfile(logfile): with open(logfile, "a") as log: log.write("View test output at:\n") log.write(args.testurl) @@ -53,7 +58,7 @@ def main(): log.write(args.testurl) # determine notification recipient - special_branches = ['main', 'develop', 'release'] + special_branches = ["main", "develop", "release"] if any(branch in args.testname for branch in special_branches): # SUNDIALS developers list @@ -61,23 +66,23 @@ def main(): else: # author of most recent commit cmd = "git log --format='%ae' -1" - recipient = runCommand(cmd).rstrip().decode('UTF-8') + recipient = runCommand(cmd).rstrip().decode("UTF-8") # check if the last commit was a CI merge - if (recipient == 'nobody@nowhere'): + if recipient == "nobody@nowhere": cmd = "git log HEAD~1 --pretty=format:'%ae' -1" - recipient = runCommand(cmd).rstrip().decode('UTF-8') + recipient = runCommand(cmd).rstrip().decode("UTF-8") # send notification if tests fail, log file not found, or fixed - if (args.teststatus == 'failed'): + if args.teststatus == "failed": - subject = "FAILED: SUNDIALS "+args.testname+" failed regression tests" + subject = "FAILED: SUNDIALS " + args.testname + " failed regression tests" print("Tests failed, sending notification to", recipient) sendEmail(recipient, subject, logfile) - elif (args.teststatus == 'fixed'): + elif args.teststatus == "fixed": - subject = "FIXED: SUNDIALS "+args.testname+" passed regression tests" + subject = "FIXED: SUNDIALS " + args.testname + " passed regression tests" print("Tests fixed, sending notification to", recipient) sendEmail(recipient, subject, logfile) @@ -94,7 +99,7 @@ def runCommand(cmd): cmdout = subprocess.check_output(cmd, shell=True) - return(cmdout) + return cmdout # @@ -116,13 +121,13 @@ def sendEmail(recipient, subject, message): sender = "SUNDIALS.suntest@llnl.gov" # email settings - msg['Subject'] = subject - msg['From'] = sender - msg['To'] = recipient + msg["Subject"] = subject + msg["From"] = sender + msg["To"] = recipient # Send the message via our own SMTP server, but don't include the # envelope header. - s = smtplib.SMTP('smtp.llnl.gov') + s = smtplib.SMTP("smtp.llnl.gov") s.send_message(msg) s.quit() @@ -130,5 +135,5 @@ def sendEmail(recipient, subject, message): # # just run the main routine # -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/test/test_install.py b/test/test_install.py index 7b2dbe06e6..4dab1c4513 100755 --- a/test/test_install.py +++ b/test/test_install.py @@ -19,6 +19,7 @@ # main routine # ----------------------------------------------------------------------------- + def main(): import argparse @@ -28,29 +29,29 @@ def main(): import subprocess parser = argparse.ArgumentParser( - description='Find and build installed examples', - formatter_class=argparse.RawTextHelpFormatter) + description="Find and build installed examples", + formatter_class=argparse.RawTextHelpFormatter, + ) - parser.add_argument('directory', type=str, - help='Directory to search for build files') + parser.add_argument( + "directory", type=str, help="Directory to search for build files" + ) - parser.add_argument('--cmake', action='store_true', - help='CMake build') + parser.add_argument("--cmake", action="store_true", help="CMake build") - parser.add_argument('--test', action='store_true', - help='Test builds') + parser.add_argument("--test", action="store_true", help="Test builds") - parser.add_argument('--clean', action='store_true', - help='Clean builds') + parser.add_argument("--clean", action="store_true", help="Clean builds") - parser.add_argument('--regex', type=str, - help='Regular expression for filtering example directories') + parser.add_argument( + "--regex", type=str, help="Regular expression for filtering example directories" + ) - parser.add_argument('-v', '--verbose', action='count', default=0, - help='Verbose output') + parser.add_argument( + "-v", "--verbose", action="count", default=0, help="Verbose output" + ) - parser.add_argument('--failfast', action='store_true', - help='Stop on first failure') + parser.add_argument("--failfast", action="store_true", help="Stop on first failure") # parse command line args args = parser.parse_args() @@ -80,7 +81,7 @@ def main(): # filter files if args.regex: regex = re.compile(args.regex) - buildfiles = [ bf for bf in buildfiles if re.search(regex, bf) ] + buildfiles = [bf for bf in buildfiles if re.search(regex, bf)] if args.verbose > 0: print(f"Total files (filtered): {len(buildfiles)}") if args.verbose > 2: @@ -102,9 +103,12 @@ def main(): # clean and move on if args.clean: - ret = subprocess.call('make clean', shell=True, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) + ret = subprocess.call( + "make clean", + shell=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) # return to original directory os.chdir(cwd) continue @@ -112,11 +116,14 @@ def main(): # confgure cmake if necessary configfail = False if args.cmake: - if os.path.isfile('Makefile'): - os.remove('Makefile') - ret = subprocess.call('cmake -DCMAKE_VERBOSE_MAKEFILE=ON .', - shell=True, stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) + if os.path.isfile("Makefile"): + os.remove("Makefile") + ret = subprocess.call( + "cmake -DCMAKE_VERBOSE_MAKEFILE=ON .", + shell=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) if args.verbose > 0: print(f" Config return: {ret}") if ret != 0: @@ -126,9 +133,9 @@ def main(): # make examples buildfail = False if not configfail: - ret = subprocess.call('make', shell=True, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) + ret = subprocess.call( + "make", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL + ) if args.verbose > 0: print(f" Build return: {ret}") if ret != 0: @@ -138,9 +145,12 @@ def main(): # test examples testfail = False if not configfail and not buildfail and args.test: - ret = subprocess.call('make test', shell=True, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) + ret = subprocess.call( + "make test", + shell=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) if args.verbose > 0: print(f" Test return: {ret}") if ret != 0: @@ -167,10 +177,12 @@ def main(): else: print("All builds successful.") + # ----------------------------------------------------------------------------- # run the main routine # ----------------------------------------------------------------------------- -if __name__ == '__main__': +if __name__ == "__main__": import sys + sys.exit(main()) From d0a14ae320ac6416009963a818fd0709b9f52a2f Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Wed, 3 Jul 2024 16:49:21 -0700 Subject: [PATCH 083/137] Bugfix: Fix loading of default order 1 ERK method in ARKStep (#536) --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 2 ++ src/arkode/arkode_arkstep.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 141b16720c..3291523216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bug Fixes +Fixed the loading of ARKStep's default first order explicit method. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.1 diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 4f1514700e..cc4a9f919c 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -4,4 +4,6 @@ **Bug Fixes** +Fixed the loading of ARKStep's default first order explicit method. + **Deprecation Notices** diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 5f91285edb..4f6e403ccf 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2254,7 +2254,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) { switch (step_mem->q) { - case (1): itable = ARKSTEP_DEFAULT_ERK_1; break; + case (1): etable = ARKSTEP_DEFAULT_ERK_1; break; case (2): etable = ARKSTEP_DEFAULT_ERK_2; break; case (3): etable = ARKSTEP_DEFAULT_ERK_3; break; case (4): etable = ARKSTEP_DEFAULT_ERK_4; break; From c6b9a02f24a27081c471d63dfc524684a9f5a9e3 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 8 Jul 2024 18:55:56 -0700 Subject: [PATCH 084/137] CMake: Formatting with cmake-format (#520) Add CMake formatter --- .cmake-format.py | 330 +++++++++++++++ ...heck-clang-format.yml => check-format.yml} | 27 +- CMakeLists.txt | 81 ++-- benchmarks/CMakeLists.txt | 14 +- .../advection_reaction_3D/CMakeLists.txt | 1 - .../kokkos/CMakeLists.txt | 55 +-- .../advection_reaction_3D/raja/CMakeLists.txt | 164 ++++---- benchmarks/diffusion_2D/CMakeLists.txt | 13 +- .../diffusion_2D/mpi_gpu/CMakeLists.txt | 45 +-- .../diffusion_2D/mpi_serial/CMakeLists.txt | 29 +- benchmarks/nvector/cuda/CMakeLists.txt | 6 +- benchmarks/nvector/hip/CMakeLists.txt | 6 +- benchmarks/nvector/kokkos/CMakeLists.txt | 11 +- benchmarks/nvector/mpiplusx/CMakeLists.txt | 6 +- benchmarks/nvector/openmp/CMakeLists.txt | 15 +- benchmarks/nvector/openmpdev/CMakeLists.txt | 11 +- benchmarks/nvector/parallel/CMakeLists.txt | 6 +- benchmarks/nvector/parhyp/CMakeLists.txt | 6 +- benchmarks/nvector/petsc/CMakeLists.txt | 6 +- benchmarks/nvector/pthreads/CMakeLists.txt | 6 +- benchmarks/nvector/raja/CMakeLists.txt | 11 +- benchmarks/nvector/serial/CMakeLists.txt | 6 +- benchmarks/nvector/sycl/CMakeLists.txt | 3 +- cmake/SundialsBuildOptionsPost.cmake | 259 +++++++----- cmake/SundialsBuildOptionsPre.cmake | 159 +++++--- cmake/SundialsDeprecated.cmake | 113 ++++-- cmake/SundialsExampleOptions.cmake | 63 ++- cmake/SundialsIndexSize.cmake | 24 +- cmake/SundialsSetupCXX.cmake | 15 +- cmake/SundialsSetupCompilers.cmake | 222 ++++++----- cmake/SundialsSetupConfig.cmake | 14 +- cmake/SundialsSetupCuda.cmake | 31 +- cmake/SundialsSetupFortran.cmake | 40 +- cmake/SundialsSetupHIP.cmake | 27 +- cmake/SundialsSetupTPLs.cmake | 5 +- cmake/SundialsSetupTesting.cmake | 117 ++++-- cmake/SundialsTPLOptions.cmake | 377 +++++++++++------- cmake/macros/SundialsAddBenchmark.cmake | 51 ++- cmake/macros/SundialsAddExamplesGinkgo.cmake | 27 +- cmake/macros/SundialsAddExecutable.cmake | 26 +- cmake/macros/SundialsAddLibrary.cmake | 318 ++++++++------- cmake/macros/SundialsAddTest.cmake | 163 +++++--- cmake/macros/SundialsAddTestInstall.cmake | 60 +-- cmake/macros/SundialsCMakeMacros.cmake | 27 +- cmake/macros/SundialsInstallExamples.cmake | 90 +++-- .../SundialsInstallExamplesGinkgo.cmake | 61 +-- cmake/macros/SundialsOption.cmake | 37 +- cmake/macros/SundialsTryCompileExecute.cmake | 49 ++- cmake/tpl/FindHYPRE.cmake | 78 ++-- cmake/tpl/FindKLU.cmake | 118 +++--- cmake/tpl/FindMAGMA.cmake | 68 ++-- cmake/tpl/FindPETSC.cmake | 52 ++- cmake/tpl/FindSUPERLUDIST.cmake | 100 +++-- cmake/tpl/FindSUPERLUMT.cmake | 64 +-- cmake/tpl/FindTrilinos.cmake | 28 +- cmake/tpl/FindXBRAID.cmake | 202 +++++----- cmake/tpl/SundialsAdiak.cmake | 30 +- cmake/tpl/SundialsCaliper.cmake | 36 +- cmake/tpl/SundialsGinkgo.cmake | 35 +- cmake/tpl/SundialsHypre.cmake | 78 ++-- cmake/tpl/SundialsKLU.cmake | 66 +-- cmake/tpl/SundialsKokkos.cmake | 19 +- cmake/tpl/SundialsKokkosKernels.cmake | 16 +- cmake/tpl/SundialsLapack.cmake | 163 ++++---- cmake/tpl/SundialsMAGMA.cmake | 18 +- cmake/tpl/SundialsMPI.cmake | 45 +-- cmake/tpl/SundialsONEMKL.cmake | 25 +- cmake/tpl/SundialsOpenMP.cmake | 35 +- cmake/tpl/SundialsPETSC.cmake | 43 +- cmake/tpl/SundialsPOSIXTimers.cmake | 36 +- cmake/tpl/SundialsRAJA.cmake | 71 ++-- cmake/tpl/SundialsSuperLUDIST.cmake | 48 ++- cmake/tpl/SundialsSuperLUMT.cmake | 30 +- cmake/tpl/SundialsTrilinos.cmake | 101 +++-- cmake/tpl/SundialsXBRAID.cmake | 31 +- .../developers/style_guide/SourceCode.rst | 20 +- examples/CMakeLists.txt | 15 +- examples/arkode/CMakeLists.txt | 9 +- examples/arkode/CXX_parallel/CMakeLists.txt | 121 +++--- examples/arkode/CXX_parhyp/CMakeLists.txt | 60 ++- examples/arkode/CXX_serial/CMakeLists.txt | 86 ++-- .../arkode/CXX_superludist/CMakeLists.txt | 34 +- examples/arkode/CXX_xbraid/CMakeLists.txt | 76 ++-- examples/arkode/C_manyvector/CMakeLists.txt | 42 +- examples/arkode/C_openmp/CMakeLists.txt | 55 +-- examples/arkode/C_openmpdev/CMakeLists.txt | 44 +- examples/arkode/C_parallel/CMakeLists.txt | 65 ++- examples/arkode/C_parhyp/CMakeLists.txt | 44 +- examples/arkode/C_petsc/CMakeLists.txt | 42 +- examples/arkode/C_serial/CMakeLists.txt | 236 +++++------ examples/arkode/F2003_custom/CMakeLists.txt | 70 ++-- examples/arkode/F2003_parallel/CMakeLists.txt | 94 +++-- examples/arkode/F2003_serial/CMakeLists.txt | 101 +++-- examples/cvode/CMakeLists.txt | 4 +- examples/cvode/CXX_onemkl/CMakeLists.txt | 43 +- examples/cvode/CXX_parallel/CMakeLists.txt | 50 +-- examples/cvode/CXX_parhyp/CMakeLists.txt | 56 ++- examples/cvode/CXX_serial/CMakeLists.txt | 58 +-- examples/cvode/CXX_sycl/CMakeLists.txt | 35 +- examples/cvode/C_mpimanyvector/CMakeLists.txt | 39 +- examples/cvode/C_openmp/CMakeLists.txt | 42 +- examples/cvode/C_openmpdev/CMakeLists.txt | 39 +- examples/cvode/F2003_parallel/CMakeLists.txt | 52 +-- examples/cvode/F2003_serial/CMakeLists.txt | 82 ++-- examples/cvode/cuda/CMakeLists.txt | 60 ++- examples/cvode/ginkgo/CMakeLists.txt | 39 +- examples/cvode/hip/CMakeLists.txt | 42 +- examples/cvode/kokkos/CMakeLists.txt | 63 ++- examples/cvode/magma/CMakeLists.txt | 39 +- examples/cvode/parallel/CMakeLists.txt | 44 +- examples/cvode/parhyp/CMakeLists.txt | 48 +-- examples/cvode/petsc/CMakeLists.txt | 41 +- examples/cvode/raja/CMakeLists.txt | 58 +-- examples/cvode/serial/CMakeLists.txt | 144 +++---- examples/cvode/superludist/CMakeLists.txt | 44 +- examples/cvodes/CMakeLists.txt | 2 +- examples/cvodes/C_openmp/CMakeLists.txt | 46 +-- examples/cvodes/F2003_serial/CMakeLists.txt | 46 +-- examples/cvodes/parallel/CMakeLists.txt | 59 ++- examples/cvodes/serial/CMakeLists.txt | 180 ++++----- examples/ida/CMakeLists.txt | 4 +- examples/ida/C_openmp/CMakeLists.txt | 43 +- examples/ida/F2003_openmp/CMakeLists.txt | 52 +-- examples/ida/F2003_parallel/CMakeLists.txt | 52 +-- examples/ida/F2003_serial/CMakeLists.txt | 47 +-- examples/ida/cuda/CMakeLists.txt | 42 +- examples/ida/mpicuda/CMakeLists.txt | 44 +- examples/ida/mpiraja/CMakeLists.txt | 60 ++- examples/ida/parallel/CMakeLists.txt | 44 +- examples/ida/petsc/CMakeLists.txt | 50 +-- examples/ida/raja/CMakeLists.txt | 56 +-- examples/ida/serial/CMakeLists.txt | 121 +++--- examples/ida/trilinos/CMakeLists.txt | 50 +-- examples/idas/CMakeLists.txt | 2 +- examples/idas/C_openmp/CMakeLists.txt | 55 +-- examples/idas/F2003_serial/CMakeLists.txt | 47 +-- examples/idas/parallel/CMakeLists.txt | 57 ++- examples/idas/serial/CMakeLists.txt | 138 +++---- examples/kinsol/CMakeLists.txt | 8 +- examples/kinsol/CUDA_mpi/CMakeLists.txt | 48 +-- examples/kinsol/CXX_parallel/CMakeLists.txt | 48 +-- examples/kinsol/CXX_parhyp/CMakeLists.txt | 58 ++- examples/kinsol/C_openmp/CMakeLists.txt | 42 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 49 +-- examples/kinsol/F2003_serial/CMakeLists.txt | 47 +-- examples/kinsol/parallel/CMakeLists.txt | 41 +- examples/kinsol/serial/CMakeLists.txt | 116 +++--- examples/nvector/CMakeLists.txt | 10 +- examples/nvector/C_openmp/CMakeLists.txt | 77 ++-- examples/nvector/cuda/CMakeLists.txt | 57 ++- examples/nvector/hip/CMakeLists.txt | 42 +- examples/nvector/kokkos/CMakeLists.txt | 48 +-- examples/nvector/manyvector/CMakeLists.txt | 74 ++-- examples/nvector/mpicuda/CMakeLists.txt | 62 ++- examples/nvector/mpimanyvector/CMakeLists.txt | 93 +++-- examples/nvector/mpiplusx/CMakeLists.txt | 94 ++--- examples/nvector/mpiraja/CMakeLists.txt | 69 ++-- examples/nvector/openmpdev/CMakeLists.txt | 53 +-- examples/nvector/parallel/CMakeLists.txt | 97 ++--- examples/nvector/parhyp/CMakeLists.txt | 61 ++- examples/nvector/petsc/CMakeLists.txt | 64 ++- examples/nvector/pthreads/CMakeLists.txt | 80 ++-- examples/nvector/raja/CMakeLists.txt | 53 +-- examples/nvector/serial/CMakeLists.txt | 72 ++-- examples/nvector/sycl/CMakeLists.txt | 42 +- examples/nvector/trilinos/CMakeLists.txt | 78 ++-- examples/sunlinsol/CMakeLists.txt | 6 +- examples/sunlinsol/band/CMakeLists.txt | 92 ++--- examples/sunlinsol/cusolversp/CMakeLists.txt | 65 ++- examples/sunlinsol/dense/CMakeLists.txt | 90 ++--- examples/sunlinsol/ginkgo/CMakeLists.txt | 45 +-- examples/sunlinsol/klu/CMakeLists.txt | 87 ++-- examples/sunlinsol/kokkos/CMakeLists.txt | 63 ++- examples/sunlinsol/lapackband/CMakeLists.txt | 66 ++- examples/sunlinsol/lapackdense/CMakeLists.txt | 99 ++--- examples/sunlinsol/magmadense/CMakeLists.txt | 58 ++- examples/sunlinsol/onemkldense/CMakeLists.txt | 57 ++- .../sunlinsol/pcg/parallel/CMakeLists.txt | 56 +-- examples/sunlinsol/pcg/serial/CMakeLists.txt | 84 ++-- .../sunlinsol/spbcgs/parallel/CMakeLists.txt | 56 ++- .../sunlinsol/spbcgs/serial/CMakeLists.txt | 81 ++-- .../sunlinsol/spfgmr/parallel/CMakeLists.txt | 56 ++- .../sunlinsol/spfgmr/serial/CMakeLists.txt | 82 ++-- .../sunlinsol/spgmr/parallel/CMakeLists.txt | 59 ++- .../sunlinsol/spgmr/serial/CMakeLists.txt | 85 ++-- .../sunlinsol/sptfqmr/parallel/CMakeLists.txt | 59 ++- .../sunlinsol/sptfqmr/serial/CMakeLists.txt | 79 ++-- examples/sunlinsol/superludist/CMakeLists.txt | 70 ++-- examples/sunlinsol/superlumt/CMakeLists.txt | 70 ++-- examples/sunmatrix/CMakeLists.txt | 6 +- examples/sunmatrix/band/CMakeLists.txt | 87 ++-- examples/sunmatrix/cusparse/CMakeLists.txt | 60 ++- examples/sunmatrix/dense/CMakeLists.txt | 86 ++-- examples/sunmatrix/ginkgo/CMakeLists.txt | 42 +- examples/sunmatrix/kokkos/CMakeLists.txt | 66 ++- examples/sunmatrix/magmadense/CMakeLists.txt | 63 ++- examples/sunmatrix/onemkldense/CMakeLists.txt | 61 ++- examples/sunmatrix/slunrloc/CMakeLists.txt | 68 ++-- examples/sunmatrix/sparse/CMakeLists.txt | 94 ++--- examples/sunnonlinsol/CMakeLists.txt | 4 +- .../sunnonlinsol/fixedpoint/CMakeLists.txt | 67 ++-- examples/sunnonlinsol/newton/CMakeLists.txt | 67 ++-- examples/sunnonlinsol/petsc/CMakeLists.txt | 44 +- scripts/format.sh | 11 +- src/arkode/CMakeLists.txt | 101 +++-- src/arkode/fmod_int32/CMakeLists.txt | 19 +- src/arkode/fmod_int64/CMakeLists.txt | 19 +- src/arkode/xbraid/CMakeLists.txt | 29 +- src/cvode/CMakeLists.txt | 125 +++--- src/cvode/fmod_int32/CMakeLists.txt | 19 +- src/cvode/fmod_int64/CMakeLists.txt | 19 +- src/cvodes/CMakeLists.txt | 62 ++- src/cvodes/fmod_int32/CMakeLists.txt | 19 +- src/cvodes/fmod_int64/CMakeLists.txt | 19 +- src/ida/CMakeLists.txt | 40 +- src/ida/fmod_int32/CMakeLists.txt | 19 +- src/ida/fmod_int64/CMakeLists.txt | 19 +- src/idas/CMakeLists.txt | 52 +-- src/idas/fmod_int32/CMakeLists.txt | 19 +- src/idas/fmod_int64/CMakeLists.txt | 19 +- src/kinsol/CMakeLists.txt | 38 +- src/kinsol/fmod_int32/CMakeLists.txt | 19 +- src/kinsol/fmod_int64/CMakeLists.txt | 19 +- src/nvector/CMakeLists.txt | 24 +- src/nvector/cuda/CMakeLists.txt | 28 +- src/nvector/hip/CMakeLists.txt | 31 +- src/nvector/manyvector/CMakeLists.txt | 53 +-- .../manyvector/fmod_int32/CMakeLists.txt | 38 +- .../manyvector/fmod_int64/CMakeLists.txt | 38 +- src/nvector/mpiplusx/CMakeLists.txt | 28 +- .../mpiplusx/fmod_int32/CMakeLists.txt | 19 +- .../mpiplusx/fmod_int64/CMakeLists.txt | 19 +- src/nvector/openmp/CMakeLists.txt | 28 +- src/nvector/openmp/fmod_int32/CMakeLists.txt | 19 +- src/nvector/openmp/fmod_int64/CMakeLists.txt | 19 +- src/nvector/openmpdev/CMakeLists.txt | 28 +- src/nvector/parallel/CMakeLists.txt | 25 +- .../parallel/fmod_int32/CMakeLists.txt | 19 +- .../parallel/fmod_int64/CMakeLists.txt | 19 +- src/nvector/parhyp/CMakeLists.txt | 30 +- src/nvector/petsc/CMakeLists.txt | 28 +- src/nvector/pthreads/CMakeLists.txt | 28 +- .../pthreads/fmod_int32/CMakeLists.txt | 19 +- .../pthreads/fmod_int64/CMakeLists.txt | 19 +- src/nvector/raja/CMakeLists.txt | 47 +-- src/nvector/serial/CMakeLists.txt | 25 +- src/nvector/serial/fmod_int32/CMakeLists.txt | 19 +- src/nvector/serial/fmod_int64/CMakeLists.txt | 19 +- src/nvector/sycl/CMakeLists.txt | 31 +- src/nvector/trilinos/CMakeLists.txt | 42 +- src/sunadaptcontroller/imexgus/CMakeLists.txt | 15 +- .../imexgus/fmod_int32/CMakeLists.txt | 14 +- .../imexgus/fmod_int64/CMakeLists.txt | 14 +- .../soderlind/CMakeLists.txt | 15 +- .../soderlind/fmod_int32/CMakeLists.txt | 15 +- .../soderlind/fmod_int64/CMakeLists.txt | 15 +- src/sundials/CMakeLists.txt | 154 ++++--- src/sundials/fmod_int32/CMakeLists.txt | 10 +- src/sundials/fmod_int64/CMakeLists.txt | 10 +- src/sunlinsol/CMakeLists.txt | 40 +- src/sunlinsol/band/CMakeLists.txt | 28 +- src/sunlinsol/band/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/band/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/cusolversp/CMakeLists.txt | 27 +- src/sunlinsol/dense/CMakeLists.txt | 28 +- src/sunlinsol/dense/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/dense/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/klu/CMakeLists.txt | 28 +- src/sunlinsol/klu/fmod_int32/CMakeLists.txt | 22 +- src/sunlinsol/klu/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/lapackband/CMakeLists.txt | 28 +- src/sunlinsol/lapackdense/CMakeLists.txt | 28 +- .../lapackdense/fmod_int32/CMakeLists.txt | 19 +- .../lapackdense/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/magmadense/CMakeLists.txt | 28 +- src/sunlinsol/onemkldense/CMakeLists.txt | 35 +- src/sunlinsol/pcg/CMakeLists.txt | 25 +- src/sunlinsol/pcg/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/pcg/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spbcgs/CMakeLists.txt | 25 +- .../spbcgs/fmod_int32/CMakeLists.txt | 19 +- .../spbcgs/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spfgmr/CMakeLists.txt | 25 +- .../spfgmr/fmod_int32/CMakeLists.txt | 19 +- .../spfgmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spgmr/CMakeLists.txt | 25 +- src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/sptfqmr/CMakeLists.txt | 25 +- .../sptfqmr/fmod_int32/CMakeLists.txt | 19 +- .../sptfqmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/superludist/CMakeLists.txt | 35 +- src/sunlinsol/superlumt/CMakeLists.txt | 33 +- src/sunmatrix/CMakeLists.txt | 40 +- src/sunmatrix/band/CMakeLists.txt | 25 +- src/sunmatrix/band/fmod_int32/CMakeLists.txt | 19 +- src/sunmatrix/band/fmod_int64/CMakeLists.txt | 19 +- src/sunmatrix/cusparse/CMakeLists.txt | 31 +- src/sunmatrix/dense/CMakeLists.txt | 25 +- src/sunmatrix/dense/fmod_int32/CMakeLists.txt | 19 +- src/sunmatrix/dense/fmod_int64/CMakeLists.txt | 19 +- src/sunmatrix/magmadense/CMakeLists.txt | 40 +- src/sunmatrix/onemkldense/CMakeLists.txt | 37 +- src/sunmatrix/slunrloc/CMakeLists.txt | 33 +- src/sunmatrix/sparse/CMakeLists.txt | 25 +- .../sparse/fmod_int32/CMakeLists.txt | 19 +- .../sparse/fmod_int64/CMakeLists.txt | 19 +- src/sunmemory/cuda/CMakeLists.txt | 18 +- src/sunmemory/hip/CMakeLists.txt | 19 +- src/sunmemory/sycl/CMakeLists.txt | 18 +- src/sunmemory/system/CMakeLists.txt | 18 +- src/sunnonlinsol/fixedpoint/CMakeLists.txt | 25 +- .../fixedpoint/fmod_int32/CMakeLists.txt | 19 +- .../fixedpoint/fmod_int64/CMakeLists.txt | 19 +- src/sunnonlinsol/newton/CMakeLists.txt | 25 +- .../newton/fmod_int32/CMakeLists.txt | 19 +- .../newton/fmod_int64/CMakeLists.txt | 19 +- src/sunnonlinsol/petscsnes/CMakeLists.txt | 28 +- test/unit_tests/arkode/CMakeLists.txt | 1 - .../arkode/CXX_parallel/CMakeLists.txt | 33 +- .../arkode/CXX_serial/CMakeLists.txt | 71 ++-- .../unit_tests/arkode/C_serial/CMakeLists.txt | 49 ++- .../arkode/F2003_serial/CMakeLists.txt | 14 +- test/unit_tests/arkode/gtest/CMakeLists.txt | 50 +-- test/unit_tests/cvode/CMakeLists.txt | 2 +- .../cvode/CXX_serial/CMakeLists.txt | 46 +-- test/unit_tests/cvode/C_serial/CMakeLists.txt | 22 +- test/unit_tests/cvode/gtest/CMakeLists.txt | 48 +-- .../cvodes/CXX_serial/CMakeLists.txt | 46 +-- .../unit_tests/cvodes/C_serial/CMakeLists.txt | 22 +- test/unit_tests/cvodes/gtest/CMakeLists.txt | 46 +-- test/unit_tests/ida/CXX_serial/CMakeLists.txt | 40 +- test/unit_tests/ida/C_serial/CMakeLists.txt | 22 +- test/unit_tests/ida/gtest/CMakeLists.txt | 46 +-- .../unit_tests/idas/CXX_serial/CMakeLists.txt | 38 +- test/unit_tests/idas/C_serial/CMakeLists.txt | 22 +- test/unit_tests/idas/gtest/CMakeLists.txt | 47 +-- .../kinsol/CXX_serial/CMakeLists.txt | 25 +- .../unit_tests/kinsol/C_serial/CMakeLists.txt | 21 +- test/unit_tests/kinsol/gtest/CMakeLists.txt | 46 +-- test/unit_tests/profiling/CMakeLists.txt | 15 +- test/unit_tests/sundials/CMakeLists.txt | 5 +- .../sundials/reductions/CMakeLists.txt | 11 +- test/unit_tests/sunmemory/CMakeLists.txt | 1 - test/unit_tests/sunmemory/cuda/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/hip/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/sycl/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/sys/CMakeLists.txt | 15 +- 348 files changed, 7792 insertions(+), 8726 deletions(-) create mode 100644 .cmake-format.py rename .github/workflows/{check-clang-format.yml => check-format.yml} (71%) diff --git a/.cmake-format.py b/.cmake-format.py new file mode 100644 index 0000000000..c6d5938ef6 --- /dev/null +++ b/.cmake-format.py @@ -0,0 +1,330 @@ +# ---------------------------------- +# Options affecting listfile parsing +# ---------------------------------- +with section("parse"): + + # Specify structure for custom cmake functions + additional_commands = { + 'add_prefix': {'pargs': {'nargs': 2}}, + 'add_suffix': {'pargs': {'nargs': 2}}, + 'append_static_suffix': {'pargs': {'nargs': 2}}, + 'examples2string': {'pargs': {'nargs': 2}}, + 'force_variable': {'pargs': {'nargs': 4}}, + 'list2string': {'pargs': {'nargs': 2}}, + 'sundials_add_benchmark': { 'kwargs': { 'BENCHMARK_ARGS': 1, + 'IDENTIFIER': 1, + 'NUM_CORES': 1, + 'TEST_RUNNER_ARGS': '+'}, + 'pargs': { 'flags': ['ENABLE_GPU'], + 'nargs': '3+'}}, + 'sundials_add_examples_ginkgo': { 'kwargs': {'BACKENDS': '+', 'TARGETS': '+'}, + 'pargs': { 'flags': ['UNIT_TEST'], + 'nargs': '1+'}}, + 'sundials_add_f2003_library': { 'kwargs': { 'COMPILE_DEFINITIONS': '+', + 'COMPILE_OPTIONS': '+', + 'INCLUDE_DIRECTORIES': '+', + 'LINK_LIBRARIES': '+', + 'OBJECT_LIBRARIES': '+', + 'OUTPUT_NAME': 1, + 'PROPERTIES': '+', + 'SOURCES': '+', + 'SOVERSION': 1, + 'VERSION': 1}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_add_library': { 'kwargs': { 'COMPILE_DEFINITIONS': '+', + 'COMPILE_FEATURES': '+', + 'COMPILE_OPTIONS': '+', + 'HEADERS': '+', + 'INCLUDE_DIRECTORIES': '+', + 'INCLUDE_SUBDIR': 1, + 'LINK_LIBRARIES': '+', + 'OBJECT_LIBRARIES': '+', + 'OUTPUT_NAME': 1, + 'PROPERTIES': '+', + 'SOURCES': '+', + 'SOVERSION': 1, + 'VERSION': 1}, + 'pargs': { 'flags': [ 'STATIC_ONLY', + 'SHARED_ONLY', + 'OBJECT_LIB_ONLY'], + 'nargs': '1+'}}, + 'sundials_add_nvector_benchmark': { 'kwargs': { 'INSTALL_SUBDIR': '+', + 'LINK_LIBRARIES': '+', + 'SOURCES': '+', + 'SUNDIALS_TARGETS': '+'}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_add_test': { 'kwargs': { 'ANSWER_DIR': 1, + 'ANSWER_FILE': 1, + 'EXAMPLE_TYPE': 1, + 'EXTRA_ARGS': '+', + 'FLOAT_PRECISION': 1, + 'INTEGER_PRECISION': 1, + 'MPI_NPROCS': 1, + 'TEST_ARGS': '+'}, + 'pargs': {'flags': ['NODIFF'], 'nargs': '2+'}}, + 'sundials_add_test_install': { 'kwargs': {'EXECUTABLE': 1}, + 'pargs': {'flags': [], 'nargs': '2+'}}, + 'sundials_git_version': {'pargs': {'nargs': 0}}, + 'sundials_install_examples': { 'kwargs': { 'CMAKE_TEMPLATE': 1, + 'DESTINATION': 1, + 'EXAMPLES_DEPENDENCIES': '+', + 'EXTRA_FILES': '+', + 'EXTRA_INCLUDES': '+', + 'MAKE_TEMPLATE': 1, + 'OTHER_TARGETS': '+', + 'SOLVER_LIBRARY': 1, + 'SUNDIALS_COMPONENTS': '+', + 'SUNDIALS_TARGETS': '+', + 'TEST_INSTALL': 1}, + 'pargs': {'flags': [], 'nargs': '2+'}}, + 'sundials_install_examples_ginkgo': { 'kwargs': { 'CPU_EXAMPLES_VAR': '+', + 'CPU_GPU_EXAMPLES_VAR': '+', + 'DEPENDENCIES': '+', + 'DESTINATION': 1, + 'EXTRA_FILES': '+', + 'GPU_EXAMPLES_VAR': '+', + 'SUNDIALS_COMPONENTS': '+', + 'SUNDIALS_TARGETS': '+'}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_option': { 'kwargs': {'DEPENDS_ON': '+', 'OPTIONS': '+'}, + 'pargs': { 'flags': [ 'DEPENDS_ON_THROW_ERROR', + 'ADVANCED'], + 'nargs': '4+'}}, + 'sundials_trycompile_execute': { 'kwargs': { 'COMPILE_OUTPUT': 1, + 'RUN_OUTPUT': 1}, + 'pargs': {'flags': [], 'nargs': '4+'}}, + 'add_local_ci_target': {'pargs': {'nargs': 3}} + } + + # Override configurations per-command where available + override_spec = {} + + # Specify variable tags. + vartags = [] + + # Specify property tags. + proptags = [] + +# ----------------------------- +# Options affecting formatting. +# ----------------------------- +with section("format"): + + # Disable formatting entirely, making cmake-format a no-op + disable = False + + # How wide to allow formatted cmake files + line_width = 80 + + # How many spaces to tab for indent + tab_size = 2 + + # If true, lines are indented using tab characters (utf-8 0x09) instead of + # <tab_size> space characters (utf-8 0x20). In cases where the layout would + # require a fractional tab character, the behavior of the fractional + # indentation is governed by <fractional_tab_policy> + use_tabchars = False + + # If <use_tabchars> is True, then the value of this variable indicates how + # fractional indentions are handled during whitespace replacement. If set to + # 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set + # to `round-up` fractional indentation is replaced with a single tab character + # (utf-8 0x09) effectively shifting the column to the next tabstop + fractional_tab_policy = 'use-space' + + # If an argument group contains more than this many sub-groups (parg or kwarg + # groups) then force it to a vertical layout. + max_subgroups_hwrap = 2 + + # If a positional argument group contains more than this many arguments, then + # force it to a vertical layout. + max_pargs_hwrap = 6 + + # If a cmdline positional group consumes more than this many lines without + # nesting, then invalidate the layout (and nest) + max_rows_cmdline = 2 + + # If true, separate flow control names from their parentheses with a space + separate_ctrl_name_with_space = False + + # If true, separate function names from parentheses with a space + separate_fn_name_with_space = False + + # If a statement is wrapped to more than one line, than dangle the closing + # parenthesis on its own line. + dangle_parens = False + + # If the trailing parenthesis must be 'dangled' on its on line, then align it + # to this reference: `prefix`: the start of the statement, `prefix-indent`: + # the start of the statement, plus one indentation level, `child`: align to + # the column of the arguments + dangle_align = 'prefix' + + # If the statement spelling length (including space and parenthesis) is + # smaller than this amount, then force reject nested layouts. + min_prefix_chars = 4 + + # If the statement spelling length (including space and parenthesis) is larger + # than the tab width by more than this amount, then force reject un-nested + # layouts. + max_prefix_chars = 10 + + # If a candidate layout is wrapped horizontally but it exceeds this many + # lines, then reject the layout. + max_lines_hwrap = 2 + + # What style line endings to use in the output. + line_ending = 'unix' + + # Format command names consistently as 'lower' or 'upper' case + command_case = 'canonical' + + # Format keywords consistently as 'lower' or 'upper' case + keyword_case = 'unchanged' + + # A list of command names which should always be wrapped + always_wrap = [] + + # If true, the argument lists which are known to be sortable will be sorted + # lexicographicall + enable_sort = True + + # If true, the parsers may infer whether or not an argument list is sortable + # (without annotation). + autosort = False + + # By default, if cmake-format cannot successfully fit everything into the + # desired linewidth it will apply the last, most agressive attempt that it + # made. If this flag is True, however, cmake-format will print error, exit + # with non-zero status code, and write-out nothing + require_valid_layout = False + + # A dictionary mapping layout nodes to a list of wrap decisions. See the + # documentation for more information. + layout_passes = {} + +# ------------------------------------------------ +# Options affecting comment reflow and formatting. +# ------------------------------------------------ +with section("markup"): + + # What character to use for bulleted lists + bullet_char = '*' + + # What character to use as punctuation after numerals in an enumerated list + enum_char = '.' + + # If comment markup is enabled, don't reflow the first comment block in each + # listfile. Use this to preserve formatting of your copyright/license + # statements. + first_comment_is_literal = True + + # If comment markup is enabled, don't reflow any comment block which matches + # this (regex) pattern. Default is `None` (disabled). + literal_comment_pattern = None + + # Regular expression to match preformat fences in comments default= + # ``r'^\s*([`~]{3}[`~]*)(.*)$'`` + fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$' + + # Regular expression to match rulers in comments default= + # ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'`` + ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$' + + # If a comment line matches starts with this pattern then it is explicitly a + # trailing comment for the preceeding argument. Default is '#<' + explicit_trailing_pattern = '#<' + + # If a comment line starts with at least this many consecutive hash + # characters, then don't lstrip() them off. This allows for lazy hash rulers + # where the first hash char is not separated by space + hashruler_min_length = 10 + + # If true, then insert a space between the first hash char and remaining hash + # chars in a hash ruler, and normalize its length to fill the column + canonicalize_hashrulers = True + + # enable comment markup parsing and reflow + enable_markup = True + +# ---------------------------- +# Options affecting the linter +# ---------------------------- +with section("lint"): + + # a list of lint codes to disable + disabled_codes = [] + + # regular expression pattern describing valid function names + function_pattern = '[0-9a-z_]+' + + # regular expression pattern describing valid macro names + macro_pattern = '[0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with global + # (cache) scope + global_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with global + # scope (but internal semantic) + internal_var_pattern = '_[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with local + # scope + local_var_pattern = '[a-z][a-z0-9_]+' + + # regular expression pattern describing valid names for privatedirectory + # variables + private_var_pattern = '_[0-9a-z_]+' + + # regular expression pattern describing valid names for public directory + # variables + public_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for function/macro + # arguments and loop variables. + argument_var_pattern = '[a-z][a-z0-9_]+' + + # regular expression pattern describing valid names for keywords used in + # functions or macros + keyword_pattern = '[A-Z][0-9A-Z_]+' + + # In the heuristic for C0201, how many conditionals to match within a loop in + # before considering the loop a parser. + max_conditionals_custom_parser = 2 + + # Require at least this many newlines between statements + min_statement_spacing = 1 + + # Require no more than this many newlines between statements + max_statement_spacing = 2 + max_returns = 6 + max_branches = 12 + max_arguments = 5 + max_localvars = 15 + max_statements = 50 + +# ------------------------------- +# Options affecting file encoding +# ------------------------------- +with section("encode"): + + # If true, emit the unicode byte-order mark (BOM) at the start of the file + emit_byteorder_mark = False + + # Specify the encoding of the input file. Defaults to utf-8 + input_encoding = 'utf-8' + + # Specify the encoding of the output file. Defaults to utf-8. Note that cmake + # only claims to support utf-8 so be careful when using anything else + output_encoding = 'utf-8' + +# ------------------------------------- +# Miscellaneous configurations options. +# ------------------------------------- +with section("misc"): + + # A dictionary containing any per-command configuration overrides. Currently + # only `command_case` is supported. + per_command = {} + diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-format.yml similarity index 71% rename from .github/workflows/check-clang-format.yml rename to .github/workflows/check-format.yml index 24f44b45ee..b3d0850ca9 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-format.yml @@ -1,11 +1,11 @@ -name: Checks - clang-format +name: Checks - formatting on: pull_request: workflow_dispatch: jobs: - clang_format_check: + format_check: runs-on: ubuntu-latest container: image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack @@ -21,9 +21,21 @@ jobs: - name: Print black version run: black --version + - name: Install cmake-format + run: pip install cmakelang + + - name: Print cmake-format version + run: cmake-format --version + - name: Install fprettify run: pip install fprettify + - name: Print fprettify version + run: fprettify --version + + - name: Print clang-format version + run: clang-format --version + - name: Check out repository code uses: actions/checkout@v4 with: @@ -32,24 +44,21 @@ jobs: - name: Add safe directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Print clang-format version - run: clang-format --version - - name: Run checker on code run: | - ./scripts/format.sh benchmarks examples include src test + ./scripts/format.sh CMakeLists.txt benchmarks cmake examples include src test - name: Run git diff to see if anything changed run: /usr/bin/git diff --name-only --exit-code - name: Run git diff if we failed if: failure() - run: /usr/bin/git diff > clang_format.patch + run: /usr/bin/git diff > format.patch - name: Archive diff as a patch if we failed uses: actions/upload-artifact@v3 if: failure() with: - name: clang_format.patch + name: format.patch path: | - ${{ github.workspace }}/clang_format.patch + ${{ github.workspace }}/format.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index b5cca95afd..989c1d7f7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,17 +26,14 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") cmake_policy(SET CMP0135 NEW) endif() -# Project SUNDIALS (initially only C supported) -# sets PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR variables. +# Project SUNDIALS (initially only C supported) sets PROJECT_SOURCE_DIR and +# PROJECT_BINARY_DIR variables. project(SUNDIALS C) # Specify the location of additional CMAKE modules set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - ${PROJECT_SOURCE_DIR}/cmake - ${PROJECT_SOURCE_DIR}/cmake/macros - ${PROJECT_SOURCE_DIR}/cmake/tpl - ) + ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake + ${PROJECT_SOURCE_DIR}/cmake/macros ${PROJECT_SOURCE_DIR}/cmake/tpl) # MACRO definitions include(SundialsCMakeMacros) @@ -44,7 +41,6 @@ include(CMakePrintHelpers) include(CheckCSourceCompiles) include(FindPackageHandleStandardArgs) - # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") @@ -123,9 +119,9 @@ endif() # Organize targets into folders when using an IDE set_property(GLOBAL PROPERTY USE_FOLDERS ON) -# Get correct build paths automatically, but expose LIBDIR and -# INCLUDEDIR as a regular cache variable so that a user can more -# easily see what they were set to by GNUInstallDirs. +# Get correct build paths automatically, but expose LIBDIR and INCLUDEDIR as a +# regular cache variable so that a user can more easily see what they were set +# to by GNUInstallDirs. include(GNUInstallDirs) mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR) mark_as_advanced(CLEAR CMAKE_INSTALL_INCLUDEDIR) @@ -133,23 +129,28 @@ mark_as_advanced(CLEAR CMAKE_INSTALL_INCLUDEDIR) # Suffixes to use for static and shared targets. set(_STATIC_LIB_SUFFIX "_static" - CACHE INTERNAL "" FORCE -) + CACHE INTERNAL "" FORCE) set(_SHARED_LIB_SUFFIX "_shared" - CACHE INTERNAL "" FORCE -) + CACHE INTERNAL "" FORCE) # A list of all the alias targets created. -set(_SUNDIALS_ALIAS_TARGETS "" +set(_SUNDIALS_ALIAS_TARGETS + "" CACHE INTERNAL "" FORCE) # We default to release builds set(_DEFAULT_CMAKE_BUILD_TYPE RelWithDebInfo) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified.") - set(CMAKE_BUILD_TYPE "${_DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + message( + STATUS + "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified." + ) + set(CMAKE_BUILD_TYPE + "${_DEFAULT_CMAKE_BUILD_TYPE}" + CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") else() message(STATUS "Building SUNDIALS in '${CMAKE_BUILD_TYPE}' mode.") endif() @@ -192,8 +193,8 @@ include(SundialsSetupTPLs) include(SundialsBuildOptionsPost) # =============================================================== -# At this point all the configuration options are set. -# Setup the sundials_config.h. +# At this point all the configuration options are set. Setup the +# sundials_config.h. # =============================================================== include(SundialsSetupConfig) @@ -231,68 +232,56 @@ endif() # install sundials_export header file install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # install configured header file install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # install shared Fortran 2003 modules if(BUILD_FORTRAN_MODULE_INTERFACE) - # While the .mod files get generated for static and shared - # libraries, they are identical. So only install one set - # of the .mod files. + # While the .mod files get generated for static and shared libraries, they are + # identical. So only install one set of the .mod files. if(BUILD_STATIC_LIBS) install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_STATIC/ - DESTINATION ${Fortran_INSTALL_MODDIR} - ) + DESTINATION ${Fortran_INSTALL_MODDIR}) else() install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_SHARED/ - DESTINATION ${Fortran_INSTALL_MODDIR} - ) + DESTINATION ${Fortran_INSTALL_MODDIR}) endif() endif() # install license and notice files install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") install(FILES "${PROJECT_SOURCE_DIR}/NOTICE" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # create package version file include(CMakePackageConfigHelpers) write_basic_package_version_file( SUNDIALSConfigVersion.cmake VERSION ${PACKAGE_VERSION} - COMPATIBILITY AnyNewerVersion -) + COMPATIBILITY AnyNewerVersion) # install targets install( EXPORT sundials-targets FILE SUNDIALSTargets.cmake NAMESPACE SUNDIALS:: - DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") # install SUNDIALSConfig.cmake configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/SUNDIALSConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake" - INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfigVersion.cmake" - DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") # Export targets so build directory can be used directly export( EXPORT sundials-targets FILE "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSTargets.cmake" - NAMESPACE SUNDIALS:: -) + NAMESPACE SUNDIALS::) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 980e1e230d..090c1f5b26 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -14,10 +14,10 @@ # benchmarks level CMakeLists.txt for SUNDIALS # --------------------------------------------------------------- -if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR - CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) +if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL + "RelWithDebInfo")) message(WARNING "SUNDIALS is not being built in a \"Release\" mode, " - "benchmark performance will be affected") + "benchmark performance will be affected") endif() sundials_option(BENCHMARK_NVECTOR BOOL "NVector benchmarks are on" ON) @@ -28,13 +28,13 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") endif() -#---------------------------------------- +# ---------------------------------------- # Add specific benchmarks -#---------------------------------------- +# ---------------------------------------- if(ENABLE_MPI) -add_subdirectory(diffusion_2D) -add_subdirectory(advection_reaction_3D) + add_subdirectory(diffusion_2D) + add_subdirectory(advection_reaction_3D) endif() # Add the nvector benchmarks diff --git a/benchmarks/advection_reaction_3D/CMakeLists.txt b/benchmarks/advection_reaction_3D/CMakeLists.txt index 79c616818a..b4b953a437 100644 --- a/benchmarks/advection_reaction_3D/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/CMakeLists.txt @@ -19,4 +19,3 @@ endif() if(ENABLE_KOKKOS AND BUILD_NVECTOR_KOKKOS) add_subdirectory(kokkos) endif() - diff --git a/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt b/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt index 8a12ba022b..1bb7ac2c5e 100644 --- a/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt @@ -13,14 +13,17 @@ # --------------------------------------------------------------- # Add the build targets for each backend -if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) +if(BUILD_ARKODE + AND BUILD_CVODE + AND BUILD_IDA) foreach(backend ${KOKKOS_EXAMPLES_BACKENDS}) # set benchmark target name set(benchmark_target "advection_reaction_3D_kokkos.${backend}") # benchmark source files - add_executable(${benchmark_target} + add_executable( + ${benchmark_target} advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -29,32 +32,32 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) ParallelGrid.hpp check_retval.h) - # which backend to use - target_compile_definitions(${benchmark_target} PRIVATE USE_${backend}) - - # directories to include - target_include_directories(${benchmark_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS} - ) - - # libraries to link against - target_link_libraries(${benchmark_target} - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nveckokkos - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ) - - install(TARGETS ${benchmark_target} + # which backend to use + target_compile_definitions(${benchmark_target} PRIVATE USE_${backend}) + + # directories to include + target_include_directories( + ${benchmark_target} PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + # libraries to link against + target_link_libraries( + ${benchmark_target} + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nveckokkos + ${MPI_CXX_LIBRARIES} + ${EXE_EXTRA_LINK_LIBS}) + + install( + TARGETS ${benchmark_target} DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/kokkos") - install(FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py ../scripts/pickle_solution_output.py + install( + FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py + ../scripts/pickle_solution_output.py DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/kokkos") endforeach() diff --git a/benchmarks/advection_reaction_3D/raja/CMakeLists.txt b/benchmarks/advection_reaction_3D/raja/CMakeLists.txt index d816b35124..264e023b5a 100644 --- a/benchmarks/advection_reaction_3D/raja/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/raja/CMakeLists.txt @@ -13,24 +13,28 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) +if(BUILD_ARKODE + AND BUILD_CVODE + AND BUILD_IDA) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(OTHER_LIBS OpenMP::OpenMP_CXX) endif() # Set up parameters to run benchmarks with set(BENCHMARK_VAR - "--method ARK-IMEX --nls tl-newton --tf 0.01 --dont-save\;arkimex_tlnewton" - "--method ARK-DIRK --nls newton --tf 0.01 --dont-save\;arkdirk_newton" - "--method CV-BDF --nls newton --tf 0.01 --dont-save\;cvbdf_newton" - "--method IDA --nls newton --tf 0.01 --dont-save\;ida_newton") + "--method ARK-IMEX --nls tl-newton --tf 0.01 --dont-save\;arkimex_tlnewton" + "--method ARK-DIRK --nls newton --tf 0.01 --dont-save\;arkdirk_newton" + "--method CV-BDF --nls newton --tf 0.01 --dont-save\;cvbdf_newton" + "--method IDA --nls newton --tf 0.01 --dont-save\;ida_newton") # ---------------------------------------------------------------------------- # MPI only # ---------------------------------------------------------------------------- - add_executable(advection_reaction_3D_raja + add_executable( + advection_reaction_3D_raja advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -41,39 +45,41 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) backends.hpp) # ensure the linker language is reset to CXX - set_target_properties(advection_reaction_3D_raja PROPERTIES LINKER_LANGUAGE CXX) - - target_include_directories(advection_reaction_3D_raja - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nvecserial - RAJA - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) + set_target_properties(advection_reaction_3D_raja PROPERTIES LINKER_LANGUAGE + CXX) + + target_include_directories( + advection_reaction_3D_raja PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nvecserial + RAJA + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) install(TARGETS advection_reaction_3D_raja - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") - install(FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py ../scripts/pickle_solution_output.py - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + install(FILES README.md ../scripts/compare_error.py + ../scripts/compute_error.py ../scripts/pickle_solution_output.py + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja advection_reaction_3D_raja advection_reaction_3D + sundials_add_benchmark( + advection_reaction_3D_raja advection_reaction_3D_raja + advection_reaction_3D NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS} BENCHMARK_ARGS ${benchmark_args} - IDENTIFIER ${identifier} - ) + IDENTIFIER ${identifier}) endforeach() # ---------------------------------------------------------------------------- @@ -82,13 +88,14 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) if(BUILD_NVECTOR_CUDA) - set_source_files_properties(advection_reaction_3D.cpp - PROPERTIES LANGUAGE CUDA) + set_source_files_properties(advection_reaction_3D.cpp PROPERTIES LANGUAGE + CUDA) set_source_files_properties(arkode_driver.cpp PROPERTIES LANGUAGE CUDA) set_source_files_properties(cvode_driver.cpp PROPERTIES LANGUAGE CUDA) set_source_files_properties(ida_driver.cpp PROPERTIES LANGUAGE CUDA) - add_executable(advection_reaction_3D_raja_mpicuda + add_executable( + advection_reaction_3D_raja_mpicuda advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -100,35 +107,36 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) # ensure the linker language is reset to CXX set_target_properties(advection_reaction_3D_raja_mpicuda - PROPERTIES LINKER_LANGUAGE CXX) - - target_include_directories(advection_reaction_3D_raja_mpicuda - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja_mpicuda - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nveccuda - RAJA - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) - - target_compile_definitions(advection_reaction_3D_raja_mpicuda PRIVATE USE_CUDA_NVEC) + PROPERTIES LINKER_LANGUAGE CXX) + + target_include_directories( + advection_reaction_3D_raja_mpicuda PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja_mpicuda + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nveccuda + RAJA + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) + + target_compile_definitions(advection_reaction_3D_raja_mpicuda + PRIVATE USE_CUDA_NVEC) install(TARGETS advection_reaction_3D_raja_mpicuda - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja_mpicuda advection_reaction_3D_raja_mpicuda advection_reaction_3D - ENABLE_GPU + sundials_add_benchmark( + advection_reaction_3D_raja_mpicuda advection_reaction_3D_raja_mpicuda + advection_reaction_3D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} BENCHMARK_ARGS ${benchmark_args} IDENTIFIER ${identifier}) @@ -141,7 +149,8 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) if(BUILD_NVECTOR_HIP) - add_executable(advection_reaction_3D_raja_mpihip + add_executable( + advection_reaction_3D_raja_mpihip advection_reaction_3D.cpp advection_reaction_3D.hpp arkode_driver.cpp @@ -152,34 +161,35 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) check_retval.h backends.hpp) - target_include_directories(advection_reaction_3D_raja_mpihip - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja_mpihip - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nvechip - RAJA - hip::device - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) - - target_compile_definitions(advection_reaction_3D_raja_mpihip PRIVATE USE_HIP_NVEC) + target_include_directories( + advection_reaction_3D_raja_mpihip PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja_mpihip + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nvechip + RAJA + hip::device + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) + + target_compile_definitions(advection_reaction_3D_raja_mpihip + PRIVATE USE_HIP_NVEC) install(TARGETS advection_reaction_3D_raja_mpihip - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja_mpihip advection_reaction_3D_raja_mpihip advection_reaction_3D - ENABLE_GPU + sundials_add_benchmark( + advection_reaction_3D_raja_mpihip advection_reaction_3D_raja_mpihip + advection_reaction_3D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} BENCHMARK_ARGS ${benchmark_args} IDENTIFIER ${identifier}) diff --git a/benchmarks/diffusion_2D/CMakeLists.txt b/benchmarks/diffusion_2D/CMakeLists.txt index f64d3e90f3..f26f7397c2 100644 --- a/benchmarks/diffusion_2D/CMakeLists.txt +++ b/benchmarks/diffusion_2D/CMakeLists.txt @@ -12,13 +12,13 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -if(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA) +if(BUILD_ARKODE + OR BUILD_CVODE + OR BUILD_IDA) # Shared sources - set(shared_sources - diffusion_2D.hpp - diffusion_2D.cpp - preconditioner_jacobi.cpp) + set(shared_sources diffusion_2D.hpp diffusion_2D.cpp + preconditioner_jacobi.cpp) # Benchmark prefix set(benchmark_prefix ${SUNDIALS_SOURCE_DIR}/benchmarks/diffusion_2D/) @@ -33,7 +33,6 @@ if(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA) add_subdirectory(mpi_gpu) endif() - install(FILES README.md - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + install(FILES README.md DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") endif() diff --git a/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt b/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt index beb5d1a439..bedab66e97 100644 --- a/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt +++ b/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------ # list of tests -set(tests ) +set(tests) if(BUILD_ARKODE) if(BUILD_NVECTOR_CUDA) @@ -50,13 +50,8 @@ foreach(test_tuple ${tests}) list(GET test_tuple 1 problem_type) list(GET test_tuple 2 backend) - set(sources - ${benchmark_prefix}/main_${package}.cpp - ${shared_sources} - buffers.cpp - diffusion.cpp - solution.cpp - utils.cpp) + set(sources ${benchmark_prefix}/main_${package}.cpp ${shared_sources} + buffers.cpp diffusion.cpp solution.cpp utils.cpp) if("${backend}" STREQUAL "USE_CUDA") @@ -74,18 +69,13 @@ foreach(test_tuple ${tests}) add_executable(${target} ${sources}) - # if("${backend}" STREQUAL "USE_CUDA") - # sundials_add_benchmark(${target} ${target} diffusion_2D - # ENABLE_GPU - # NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} - # ) - #endif() + # if("${backend}" STREQUAL "USE_CUDA") sundials_add_benchmark(${target} + # ${target} diffusion_2D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} ) + # endif() if("${backend}" STREQUAL "USE_HIP") - sundials_add_benchmark(${target} ${target} diffusion_2D - ENABLE_GPU - NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} - ) + sundials_add_benchmark(${target} ${target} diffusion_2D ENABLE_GPU + NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS}) endif() @@ -99,11 +89,9 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecmpiplusx - sundials_nveccuda) + target_link_libraries( + ${target} PRIVATE sundials_${package} sundials_nvecmpiplusx + sundials_nveccuda) else() @@ -111,12 +99,9 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecmpiplusx - sundials_nvechip - hip::device) + target_link_libraries( + ${target} PRIVATE sundials_${package} sundials_nvecmpiplusx + sundials_nvechip hip::device) endif() @@ -125,6 +110,6 @@ foreach(test_tuple ${tests}) target_link_libraries(${target} PRIVATE ${MPI_CXX_LIBRARIES}) install(TARGETS ${target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") endforeach() diff --git a/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt b/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt index 5e1e5c8862..a5cccdf1ed 100644 --- a/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt +++ b/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------ # list of tests -set(tests ) +set(tests) if(BUILD_ARKODE) list(APPEND tests "arkode\;BENCHMARK_ODE") @@ -34,13 +34,8 @@ foreach(test_tuple ${tests}) list(GET test_tuple 0 package) list(GET test_tuple 1 problem_type) - set(sources - ${benchmark_prefix}/main_${package}.cpp - ${shared_sources} - buffers.cpp - diffusion.cpp - solution.cpp - utils.cpp) + set(sources ${benchmark_prefix}/main_${package}.cpp ${shared_sources} + buffers.cpp diffusion.cpp solution.cpp utils.cpp) # set the target name set(target ${package}_diffusion_2D_mpi) @@ -56,25 +51,19 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecparallel - MPI::MPI_CXX) + target_link_libraries(${target} PRIVATE sundials_${package} + sundials_nvecparallel MPI::MPI_CXX) if(BUILD_SUNLINSOL_SUPERLUDIST) target_compile_definitions(${target} PRIVATE USE_SUPERLU_DIST) - target_link_libraries(${target} - PRIVATE - sundials_sunlinsolsuperludist - sundials_sunmatrixslunrloc) + target_link_libraries(${target} PRIVATE sundials_sunlinsolsuperludist + sundials_sunmatrixslunrloc) endif() install(TARGETS ${target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") sundials_add_benchmark(${target} ${target} diffusion_2D - NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS} - ) + NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS}) endforeach() diff --git a/benchmarks/nvector/cuda/CMakeLists.txt b/benchmarks/nvector/cuda/CMakeLists.txt index d4db7b8c4d..2a6741fc40 100644 --- a/benchmarks/nvector/cuda/CMakeLists.txt +++ b/benchmarks/nvector/cuda/CMakeLists.txt @@ -14,8 +14,8 @@ message(STATUS "Added CUDA NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_cuda_benchmark +sundials_add_nvector_benchmark( + nvector_cuda_benchmark SOURCES test_nvector_performance_cuda.cu SUNDIALS_TARGETS sundials_nveccuda - INSTALL_SUBDIR nvector/cuda - ) + INSTALL_SUBDIR nvector/cuda) diff --git a/benchmarks/nvector/hip/CMakeLists.txt b/benchmarks/nvector/hip/CMakeLists.txt index f3b79304d1..f19d4df759 100644 --- a/benchmarks/nvector/hip/CMakeLists.txt +++ b/benchmarks/nvector/hip/CMakeLists.txt @@ -14,8 +14,8 @@ message(STATUS "Added HIP NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_hip_benchmark +sundials_add_nvector_benchmark( + nvector_hip_benchmark SOURCES test_nvector_performance_hip.cpp SUNDIALS_TARGETS sundials_nvechip - INSTALL_SUBDIR nvector/hip - ) + INSTALL_SUBDIR nvector/hip) diff --git a/benchmarks/nvector/kokkos/CMakeLists.txt b/benchmarks/nvector/kokkos/CMakeLists.txt index 43e7177166..2ca1539df0 100644 --- a/benchmarks/nvector/kokkos/CMakeLists.txt +++ b/benchmarks/nvector/kokkos/CMakeLists.txt @@ -14,15 +14,16 @@ message(STATUS "Added Kokkos NVECTOR benchmark") foreach(backend ${KOKKOS_EXAMPLES_BACKENDS}) - sundials_add_nvector_benchmark(test_nvector_performance_kokkos.${backend} + sundials_add_nvector_benchmark( + test_nvector_performance_kokkos.${backend} SOURCES test_nvector_performance_kokkos.cpp SUNDIALS_TARGETS sundials_core sundials_nveckokkos - INSTALL_SUBDIR nvector/kokkos - ) + INSTALL_SUBDIR nvector/kokkos) - target_compile_definitions(test_nvector_performance_kokkos.${backend} PRIVATE USE_${backend}) + target_compile_definitions(test_nvector_performance_kokkos.${backend} + PRIVATE USE_${backend}) install(TARGETS test_nvector_performance_kokkos.${backend} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/") endforeach() diff --git a/benchmarks/nvector/mpiplusx/CMakeLists.txt b/benchmarks/nvector/mpiplusx/CMakeLists.txt index ec6c3c49d9..6a1fd9c1f5 100644 --- a/benchmarks/nvector/mpiplusx/CMakeLists.txt +++ b/benchmarks/nvector/mpiplusx/CMakeLists.txt @@ -14,9 +14,9 @@ message(STATUS "Added MPIPlusX NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_mpiplusx_benchmark +sundials_add_nvector_benchmark( + nvector_mpiplusx_benchmark SOURCES test_nvector_performance_mpiplusx.c SUNDIALS_TARGETS sundials_nvecserial sundials_nvecmpiplusx LINK_LIBRARIES MPI::MPI_CXX - INSTALL_SUBDIR nvector/mpiplusx - ) \ No newline at end of file + INSTALL_SUBDIR nvector/mpiplusx) diff --git a/benchmarks/nvector/openmp/CMakeLists.txt b/benchmarks/nvector/openmp/CMakeLists.txt index 96c9f9e3b0..0980bb8ef4 100644 --- a/benchmarks/nvector/openmp/CMakeLists.txt +++ b/benchmarks/nvector/openmp/CMakeLists.txt @@ -16,14 +16,13 @@ message(STATUS "Added OpenMP NVECTOR benchmark") -# Set-up linker flags and link libraries -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}") +# Set-up linker flags and link libraries set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} +# ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} +# ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} +# ${OpenMP_C_FLAGS}") -sundials_add_nvector_benchmark(nvector_openmp_benchmark +sundials_add_nvector_benchmark( + nvector_openmp_benchmark SOURCES test_nvector_performance_openmp.c SUNDIALS_TARGETS sundials_nvecopenmp - INSTALL_SUBDIR nvector/openmp - ) - + INSTALL_SUBDIR nvector/openmp) diff --git a/benchmarks/nvector/openmpdev/CMakeLists.txt b/benchmarks/nvector/openmpdev/CMakeLists.txt index c78d4821d6..54789c9a95 100644 --- a/benchmarks/nvector/openmpdev/CMakeLists.txt +++ b/benchmarks/nvector/openmpdev/CMakeLists.txt @@ -22,13 +22,14 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}") -add_executable(test_nvector_performance_openmpdev - test_nvector_performance_openmpdev.c - ../test_nvector_performance.c +add_executable( + test_nvector_performance_openmpdev + test_nvector_performance_openmpdev.c ../test_nvector_performance.c ../../../src/sundials/sundials_nvector.c) # folder to organize targets in an IDE -set_target_properties(test_nvector_performance_openmp PROPERTIES FOLDER "Benchmarks") +set_target_properties(test_nvector_performance_openmp PROPERTIES FOLDER + "Benchmarks") target_include_directories(test_nvector_performance_openmpdev PRIVATE ..) @@ -36,4 +37,4 @@ target_include_directories(test_nvector_performance_openmpdev PRIVATE ..) target_link_libraries(test_nvector_performance_openmpdev ${SUNDIALS_LIBS}) install(TARGETS test_nvector_performance_openmpdev - DESTINATION "${BENCHMARKS_INSTALL_PATH}/nvector/openmpdev") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/nvector/openmpdev") diff --git a/benchmarks/nvector/parallel/CMakeLists.txt b/benchmarks/nvector/parallel/CMakeLists.txt index c096594f3d..87ed3138ba 100644 --- a/benchmarks/nvector/parallel/CMakeLists.txt +++ b/benchmarks/nvector/parallel/CMakeLists.txt @@ -14,9 +14,9 @@ message(STATUS "Added Parallel NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_parallel_benchmark +sundials_add_nvector_benchmark( + nvector_parallel_benchmark SOURCES test_nvector_performance_parallel.c SUNDIALS_TARGETS sundials_nvecparallel LINK_LIBRARIES MPI::MPI_CXX - INSTALL_SUBDIR nvector/parallel - ) + INSTALL_SUBDIR nvector/parallel) diff --git a/benchmarks/nvector/parhyp/CMakeLists.txt b/benchmarks/nvector/parhyp/CMakeLists.txt index 7e05ff3a0f..216085064b 100644 --- a/benchmarks/nvector/parhyp/CMakeLists.txt +++ b/benchmarks/nvector/parhyp/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added hypre NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_parhyp_benchmark +sundials_add_nvector_benchmark( + nvector_parhyp_benchmark SOURCES test_nvector_performance_parhyp.c SUNDIALS_TARGETS sundials_nvecparhyp LINK_LIBRARIES MPI::MPI_C SUNDIALS::HYPRE - INSTALL_SUBDIR nvector/parhyp - ) + INSTALL_SUBDIR nvector/parhyp) diff --git a/benchmarks/nvector/petsc/CMakeLists.txt b/benchmarks/nvector/petsc/CMakeLists.txt index 63e2f8a1e9..fd9183593d 100644 --- a/benchmarks/nvector/petsc/CMakeLists.txt +++ b/benchmarks/nvector/petsc/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added PETSc NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_petsc_benchmark +sundials_add_nvector_benchmark( + nvector_petsc_benchmark SOURCES test_nvector_performance_petsc.c SUNDIALS_TARGETS sundials_nvecpetsc LINK_LIBRARIES MPI::MPI_C PUBLIC SUNDIALS::PETSC - INSTALL_SUBDIR nvector/petsc - ) + INSTALL_SUBDIR nvector/petsc) diff --git a/benchmarks/nvector/pthreads/CMakeLists.txt b/benchmarks/nvector/pthreads/CMakeLists.txt index ae7ec038c0..bc7cac35f2 100644 --- a/benchmarks/nvector/pthreads/CMakeLists.txt +++ b/benchmarks/nvector/pthreads/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added PThreads NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_pthreads_benchmark +sundials_add_nvector_benchmark( + nvector_pthreads_benchmark SOURCES test_nvector_performance_pthreads.c SUNDIALS_TARGETS sundials_nvecpthreads LINK_LIBRARIES Threads::Threads - INSTALL_SUBDIR nvector/pthreads - ) + INSTALL_SUBDIR nvector/pthreads) diff --git a/benchmarks/nvector/raja/CMakeLists.txt b/benchmarks/nvector/raja/CMakeLists.txt index 4fe8575dbe..9c37eb6d99 100644 --- a/benchmarks/nvector/raja/CMakeLists.txt +++ b/benchmarks/nvector/raja/CMakeLists.txt @@ -37,13 +37,12 @@ foreach(backend ${SUNDIALS_RAJA_BACKENDS}) continue() endif() - sundials_add_nvector_benchmark(${example_target} + sundials_add_nvector_benchmark( + ${example_target} SOURCES test_nvector_performance_raja.cpp - SUNDIALS_TARGETS sundials_nvecraja - ) + SUNDIALS_TARGETS sundials_nvecraja) - target_compile_definitions(${example_target} - PRIVATE ${_defines}) + target_compile_definitions(${example_target} PRIVATE ${_defines}) if(backend MATCHES "CUDA") set_target_properties(${example_target} PROPERTIES LINKER_LANGUAGE CXX) @@ -54,6 +53,6 @@ foreach(backend ${SUNDIALS_RAJA_BACKENDS}) endif() install(TARGETS ${example_target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/benchmarks/nvector/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/benchmarks/nvector/raja") endforeach() diff --git a/benchmarks/nvector/serial/CMakeLists.txt b/benchmarks/nvector/serial/CMakeLists.txt index 01bb5c1c54..edac263500 100644 --- a/benchmarks/nvector/serial/CMakeLists.txt +++ b/benchmarks/nvector/serial/CMakeLists.txt @@ -16,8 +16,8 @@ message(STATUS "Added Serial NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_serial_benchmark +sundials_add_nvector_benchmark( + nvector_serial_benchmark SOURCES test_nvector_performance_serial.c SUNDIALS_TARGETS sundials_nvecserial - INSTALL_SUBDIR nvector/serial - ) + INSTALL_SUBDIR nvector/serial) diff --git a/benchmarks/nvector/sycl/CMakeLists.txt b/benchmarks/nvector/sycl/CMakeLists.txt index 6ff0ffbb9f..b92c202b53 100644 --- a/benchmarks/nvector/sycl/CMakeLists.txt +++ b/benchmarks/nvector/sycl/CMakeLists.txt @@ -16,7 +16,8 @@ message(STATUS "Added SYCL NVECTOR benchmark") set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks) -sundials_add_nvector_benchmark(test_nvector_performance_sycl +sundials_add_nvector_benchmark( + test_nvector_performance_sycl SOURCES test_nvector_performance_sycl.cpp SUNDIALS_TARGETS sundials_nvecsycl INSTALL_SUBDIR nvector/sycl) diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index 01d6969bc6..2bf6acd14f 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -16,8 +16,8 @@ # --------------------------------------------------------------- # --------------------------------------------------------------- -# Option to use specialized fused kernels in the packages. -# Currently only available in CVODE. +# Option to use specialized fused kernels in the packages. Currently only +# available in CVODE. # --------------------------------------------------------------- if(ENABLE_CUDA OR ENABLE_HIP) @@ -26,9 +26,11 @@ else() set(CUDA_OR_HIP FALSE) endif() -sundials_option(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL "Build specialized fused GPU kernels" OFF - DEPENDS_ON BUILD_CVODE CUDA_OR_HIP - DEPENDS_ON_THROW_ERROR) +sundials_option( + SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL + "Build specialized fused GPU kernels" OFF + DEPENDS_ON BUILD_CVODE CUDA_OR_HIP + DEPENDS_ON_THROW_ERROR) # --------------------------------------------------------------- # Options to enable/disable build for NVECTOR modules. @@ -38,81 +40,100 @@ sundials_option(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL "Build specialized fus set(BUILD_NVECTOR_SERIAL TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_SERIAL") -sundials_option(BUILD_NVECTOR_CUDA BOOL "Build the NVECTOR_CUDA module (requires CUDA)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER - ADVANCED) +sundials_option( + BUILD_NVECTOR_CUDA BOOL "Build the NVECTOR_CUDA module (requires CUDA)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_CUDA") -sundials_option(BUILD_NVECTOR_HIP BOOL "Build the NVECTOR_HIP module (requires HIP)" ON - DEPENDS_ON ENABLE_HIP - ADVANCED) +sundials_option( + BUILD_NVECTOR_HIP BOOL "Build the NVECTOR_HIP module (requires HIP)" ON + DEPENDS_ON ENABLE_HIP + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_HIP") -sundials_option(BUILD_NVECTOR_SYCL BOOL "Build the NVECTOR_SYCL module (requires SYCL)" ON - DEPENDS_ON ENABLE_SYCL - ADVANCED) +sundials_option( + BUILD_NVECTOR_SYCL BOOL "Build the NVECTOR_SYCL module (requires SYCL)" ON + DEPENDS_ON ENABLE_SYCL + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_SYCL") -sundials_option(BUILD_NVECTOR_MANYVECTOR BOOL "Build the NVECTOR_MANYVECTOR module" ON - ADVANCED) +sundials_option(BUILD_NVECTOR_MANYVECTOR BOOL + "Build the NVECTOR_MANYVECTOR module" ON ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MANYVECTOR") -sundials_option(BUILD_NVECTOR_MPIMANYVECTOR BOOL "Build the NVECTOR_MPIMANYVECTOR module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND - ADVANCED) +sundials_option( + BUILD_NVECTOR_MPIMANYVECTOR BOOL + "Build the NVECTOR_MPIMANYVECTOR module (requires MPI)" ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MPIMANYVECTOR") -sundials_option(BUILD_NVECTOR_MPIPLUSX BOOL "Build the NVECTOR_MPIPLUSX module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND BUILD_NVECTOR_MPIMANYVECTOR - ADVANCED) +sundials_option( + BUILD_NVECTOR_MPIPLUSX BOOL "Build the NVECTOR_MPIPLUSX module (requires MPI)" + ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND BUILD_NVECTOR_MPIMANYVECTOR + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MPIPLUSX") -sundials_option(BUILD_NVECTOR_PARALLEL BOOL "Build the NVECTOR_PARALLEL module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND - ADVANCED) +sundials_option( + BUILD_NVECTOR_PARALLEL BOOL "Build the NVECTOR_PARALLEL module (requires MPI)" + ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PARALLEL") -sundials_option(BUILD_NVECTOR_OPENMP BOOL "Build the NVECTOR_OPENMP module" ON - DEPENDS_ON ENABLE_OPENMP - ADVANCED) +sundials_option( + BUILD_NVECTOR_OPENMP BOOL "Build the NVECTOR_OPENMP module" ON + DEPENDS_ON ENABLE_OPENMP + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_OPENMP") -sundials_option(BUILD_NVECTOR_OPENMPDEV BOOL "Build the NVECTOR_OPENMPDEV module" ON - DEPENDS_ON ENABLE_OPENMP_DEVICE OPENMP_SUPPORTS_DEVICE_OFFLOADING - ADVANCED) +sundials_option( + BUILD_NVECTOR_OPENMPDEV BOOL "Build the NVECTOR_OPENMPDEV module" ON + DEPENDS_ON ENABLE_OPENMP_DEVICE OPENMP_SUPPORTS_DEVICE_OFFLOADING + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_OPENMPDEV") -sundials_option(BUILD_NVECTOR_PARHYP BOOL "Build the NVECTOR_PARHYP module (requires hypre)" ON - DEPENDS_ON ENABLE_HYPRE HYPRE_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_PARHYP BOOL "Build the NVECTOR_PARHYP module (requires hypre)" + ON + DEPENDS_ON ENABLE_HYPRE HYPRE_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PARHYP") -sundials_option(BUILD_NVECTOR_PETSC BOOL "Build the NVECTOR_PETSC module (requires PETSc)" ON - DEPENDS_ON ENABLE_PETSC PETSC_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_PETSC BOOL "Build the NVECTOR_PETSC module (requires PETSc)" ON + DEPENDS_ON ENABLE_PETSC PETSC_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PETSC") -sundials_option(BUILD_NVECTOR_PTHREADS BOOL "Build the NVECTOR_PTHREADS module" ON - DEPENDS_ON ENABLE_PTHREAD - ADVANCED) +sundials_option( + BUILD_NVECTOR_PTHREADS BOOL "Build the NVECTOR_PTHREADS module" ON + DEPENDS_ON ENABLE_PTHREAD + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PTHREADS") -sundials_option(BUILD_NVECTOR_RAJA BOOL "Build the NVECTOR_RAJA module (requires RAJA)" ON - DEPENDS_ON ENABLE_RAJA - ADVANCED) +sundials_option( + BUILD_NVECTOR_RAJA BOOL "Build the NVECTOR_RAJA module (requires RAJA)" ON + DEPENDS_ON ENABLE_RAJA + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_RAJA") -sundials_option(BUILD_NVECTOR_TRILINOS BOOL "Build the NVECTOR_TRILINOS module (requires Trilinos)" ON - DEPENDS_ON ENABLE_TRILINOS Trilinos_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_TRILINOS BOOL + "Build the NVECTOR_TRILINOS module (requires Trilinos)" ON + DEPENDS_ON ENABLE_TRILINOS Trilinos_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_TRILINOS") -sundials_option(BUILD_NVECTOR_KOKKOS BOOL "Build the NVECTOR_KOKKOS module (requires Kokkos)" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_KOKKOS BOOL "Build the NVECTOR_KOKKOS module (requires Kokkos)" + ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_KOKKOS") - # --------------------------------------------------------------- # Options to enable/disable build for SUNMATRIX modules. # --------------------------------------------------------------- @@ -129,34 +150,47 @@ set(_COMPATIBLE_INDEX_SIZE FALSE) if(SUNDIALS_INDEX_SIZE MATCHES "32") set(_COMPATIBLE_INDEX_SIZE TRUE) endif() -sundials_option(BUILD_SUNMATRIX_CUSPARSE BOOL "Build the SUNMATRIX_CUSPARSE module (requires CUDA and 32-bit indexing)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER _COMPATIBLE_INDEX_SIZE BUILD_NVECTOR_CUDA - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_CUSPARSE BOOL + "Build the SUNMATRIX_CUSPARSE module (requires CUDA and 32-bit indexing)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER _COMPATIBLE_INDEX_SIZE + BUILD_NVECTOR_CUDA + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_CUSPARSE") -sundials_option(BUILD_SUNMATRIX_GINKGO BOOL "Build the SUNMATRIX_GINKGO module (requires Ginkgo)" ON - DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_GINKGO BOOL + "Build the SUNMATRIX_GINKGO module (requires Ginkgo)" ON + DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_GINKGO") -sundials_option(BUILD_SUNMATRIX_KOKKOSDENSE BOOL "Build the SUNMATRIX_KOKKOSDENSE module" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS KOKKOS_KERNELS_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_KOKKOSDENSE BOOL "Build the SUNMATRIX_KOKKOSDENSE module" ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS + KOKKOS_KERNELS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_KOKKOSDENSE") -sundials_option(BUILD_SUNMATRIX_MAGMADENSE BOOL "Build the SUNMATRIX_MAGMADENSE module (requires MAGMA)" ON - DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_MAGMADENSE BOOL + "Build the SUNMATRIX_MAGMADENSE module (requires MAGMA)" ON + DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_MAGMADENSE") -sundials_option(BUILD_SUNMATRIX_ONEMKLDENSE BOOL "Build the SUNMATRIX_ONEMKLDENSE module (requires oneMKL)" ON - DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_ONEMKLDENSE BOOL + "Build the SUNMATRIX_ONEMKLDENSE module (requires oneMKL)" ON + DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_ONEMKLDENSE") -sundials_option(BUILD_SUNMATRIX_SLUNRLOC BOOL "Build the SUNMATRIX_SLUNRLOC module (requires SuperLU_DIST)" ON - DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_SLUNRLOC BOOL + "Build the SUNMATRIX_SLUNRLOC module (requires SuperLU_DIST)" ON + DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_SLUNRLOC") # --------------------------------------------------------------- @@ -179,57 +213,76 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SPGMR") set(BUILD_SUNLINSOL_SPTFQMR TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SPTFQMR") -sundials_option(BUILD_SUNLINSOL_CUSOLVERSP BOOL "Build the SUNLINSOL_CUSOLVERSP module (requires CUDA and 32-bit indexing)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER BUILD_NVECTOR_CUDA BUILD_SUNMATRIX_CUSPARSE - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_CUSOLVERSP BOOL + "Build the SUNLINSOL_CUSOLVERSP module (requires CUDA and 32-bit indexing)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER BUILD_NVECTOR_CUDA + BUILD_SUNMATRIX_CUSPARSE + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_CUSOLVERSP") -sundials_option(BUILD_SUNLINSOL_GINKGO BOOL "Build the SUNLINSOL_GINKGO module (requires Ginkgo)" ON - DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_GINKGO BOOL + "Build the SUNLINSOL_GINKGO module (requires Ginkgo)" ON + DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_GINKGO") -sundials_option(BUILD_SUNLINSOL_KLU BOOL "Build the SUNLINSOL_KLU module (requires KLU)" ON - DEPENDS_ON ENABLE_KLU KLU_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_KLU BOOL "Build the SUNLINSOL_KLU module (requires KLU)" ON + DEPENDS_ON ENABLE_KLU KLU_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_KLU") -sundials_option(BUILD_SUNLINSOL_KOKKOSDENSE BOOL "Build the SUNLINSOL_KOKKOSDENSE module" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS KOKKOS_KERNELS_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_KOKKOSDENSE BOOL "Build the SUNLINSOL_KOKKOSDENSE module" ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS + KOKKOS_KERNELS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_KOKKOSDENSE") -sundials_option(BUILD_SUNLINSOL_LAPACKBAND BOOL "Build the SUNLINSOL_LAPACKBAND module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_LAPACKBAND BOOL + "Build the SUNLINSOL_LAPACKBAND module (requires LAPACK)" ON + DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKBAND") -sundials_option(BUILD_SUNLINSOL_LAPACKDENSE BOOL "Build the SUNLINSOL_LAPACKDENSE module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_LAPACKDENSE BOOL + "Build the SUNLINSOL_LAPACKDENSE module (requires LAPACK)" ON + DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKDENSE") -sundials_option(BUILD_SUNLINSOL_MAGMADENSE BOOL "Build the SUNLINSOL_MAGMADENSE module (requires MAGMA)" ON - DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_MAGMADENSE BOOL + "Build the SUNLINSOL_MAGMADENSE module (requires MAGMA)" ON + DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_MAGMADENSE") -sundials_option(BUILD_SUNLINSOL_ONEMKLDENSE BOOL "Build the SUNLINSOL_ONEMKLDENSE module (requires oneMKL)" ON - DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_ONEMKLDENSE BOOL + "Build the SUNLINSOL_ONEMKLDENSE module (requires oneMKL)" ON + DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_ONEMKLDENSE") -sundials_option(BUILD_SUNLINSOL_SUPERLUDIST BOOL "Build the SUNLINSOL_SUPERLUDIST module (requires SUPERLUDIST)" ON - DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS BUILD_SUNMATRIX_SLUNRLOC - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_SUPERLUDIST BOOL + "Build the SUNLINSOL_SUPERLUDIST module (requires SUPERLUDIST)" ON + DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS BUILD_SUNMATRIX_SLUNRLOC + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SUPERLUDIST") -sundials_option(BUILD_SUNLINSOL_SUPERLUMT BOOL "Build the SUNLINSOL_SUPERLUMT module (requires SUPERLUMT)" ON - DEPENDS_ON ENABLE_SUPERLUMT SUPERLUMT_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_SUPERLUMT BOOL + "Build the SUNLINSOL_SUPERLUMT module (requires SUPERLUMT)" ON + DEPENDS_ON ENABLE_SUPERLUMT SUPERLUMT_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SUPERLUMT") - # --------------------------------------------------------------- # Options to enable/disable build for SUNNONLINSOL modules. # --------------------------------------------------------------- @@ -240,7 +293,9 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_NEWTON") set(BUILD_SUNNONLINSOL_FIXEDPOINT TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_FIXEDPOINT") -sundials_option(BUILD_SUNNONLINSOL_PETSCSNES BOOL "Build the SUNNONLINSOL_PETSCSNES module (requires PETSc)" ON - DEPENDS_ON ENABLE_PETSC PETSC_FOUND - ADVANCED) +sundials_option( + BUILD_SUNNONLINSOL_PETSCSNES BOOL + "Build the SUNNONLINSOL_PETSCSNES module (requires PETSc)" ON + DEPENDS_ON ENABLE_PETSC PETSC_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_PETSCSNES") diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 3c3f6b16cb..048137ff2d 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -33,7 +33,8 @@ endif() set(DOCSTR "single, double, or extended") sundials_option(SUNDIALS_PRECISION STRING "${DOCSTR}" "DOUBLE") string(TOUPPER ${SUNDIALS_PRECISION} _upper_SUNDIALS_PRECISION) -force_variable(SUNDIALS_PRECISION STRING "${DOCSTR}" ${_upper_SUNDIALS_PRECISION}) +force_variable(SUNDIALS_PRECISION STRING "${DOCSTR}" + ${_upper_SUNDIALS_PRECISION}) # --------------------------------------------------------------- # Option to specify index type @@ -65,7 +66,9 @@ set(DOCSTR "Build with simulation profiling capabilities enabled") sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) if(SUNDIALS_BUILD_WITH_PROFILING) - message(WARNING "SUNDIALS built with profiling turned on, performance may be affected.") + message( + WARNING + "SUNDIALS built with profiling turned on, performance may be affected.") endif() # --------------------------------------------------------------- @@ -78,24 +81,35 @@ else() set(_default_err_checks ON) endif() -set(DOCSTR "Build with error checking enabled/disabled. Enabling error checks may affect performance.") -sundials_option(SUNDIALS_ENABLE_ERROR_CHECKS BOOL "${DOCSTR}" ${_default_err_checks}) +set(DOCSTR + "Build with error checking enabled/disabled. Enabling error checks may affect performance." +) +sundials_option(SUNDIALS_ENABLE_ERROR_CHECKS BOOL "${DOCSTR}" + ${_default_err_checks}) if(SUNDIALS_ENABLE_ERROR_CHECKS) message(STATUS "SUNDIALS error checking enabled") - message(WARNING "SUNDIALS is being built with extensive error checks, performance may be affected.") + message( + WARNING + "SUNDIALS is being built with extensive error checks, performance may be affected." + ) endif() # --------------------------------------------------------------- # Option to enable logging # --------------------------------------------------------------- -set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") +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}" 2 OPTIONS "0;1;2;3;4;5") if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 3) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with additional logging turned on, performance may be affected.") + message( + WARNING + "SUNDIALS built with additional logging turned on, performance may be affected." + ) endif() # --------------------------------------------------------------- @@ -103,9 +117,11 @@ endif() # --------------------------------------------------------------- if(UNIX) - sundials_option(SUNDIALS_MATH_LIBRARY PATH "Which math library (e.g., libm) to link to" "-lm" ADVANCED) + sundials_option(SUNDIALS_MATH_LIBRARY PATH + "Which math library (e.g., libm) to link to" "-lm" ADVANCED) else() - sundials_option(SUNDIALS_MATH_LIBRARY PATH "Which math library (e.g., libm) to link to" "" ADVANCED) + sundials_option(SUNDIALS_MATH_LIBRARY PATH + "Which math library (e.g., libm) to link to" "" ADVANCED) endif() # all executables will be linked against the math library set(EXE_EXTRA_LINK_LIBS "${SUNDIALS_MATH_LIBRARY}") @@ -119,15 +135,16 @@ sundials_option(BUILD_SHARED_LIBS BOOL "Build shared libraries" ON) # Make sure we build at least one type of libraries if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS) - message(FATAL_ERROR "Both static and shared library generation were disabled.") + message( + FATAL_ERROR "Both static and shared library generation were disabled.") endif() # --------------------------------------------------------------- # Options to enable SUNDIALS packages and modules # --------------------------------------------------------------- -# For each SUNDIALS package available (i.e. for which we have the -# sources), give the user the option of enabling/disabling it. +# For each SUNDIALS package available (i.e. for which we have the sources), give +# the user the option of enabling/disabling it. if(IS_DIRECTORY "${SUNDIALS_SOURCE_DIR}/src/arkode") sundials_option(BUILD_ARKODE BOOL "Build the ARKODE library" ON) @@ -182,7 +199,10 @@ sundials_option(BUILD_FORTRAN_MODULE_INTERFACE BOOL "${DOCSTR}" OFF) if(BUILD_FORTRAN_MODULE_INTERFACE) # F2003 interface only supports double precision if(NOT (SUNDIALS_PRECISION MATCHES "DOUBLE")) - message(FATAL_ERROR "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision" + ) endif() # Allow a user to set where the Fortran modules will be installed @@ -196,7 +216,10 @@ endif() sundials_option(BUILD_BENCHMARKS BOOL "Build the SUNDIALS benchmark suite" OFF) -sundials_option(BENCHMARKS_INSTALL_PATH PATH "Output directory for installing benchmark executables" "${CMAKE_INSTALL_PREFIX}/benchmarks") +sundials_option( + BENCHMARKS_INSTALL_PATH PATH + "Output directory for installing benchmark executables" + "${CMAKE_INSTALL_PREFIX}/benchmarks") # --------------------------------------------------------------- # Options for CMake config installation @@ -210,14 +233,14 @@ sundials_option(SUNDIALS_INSTALL_CMAKEDIR STRING "${DOCSTR}" # Options to enable compiler warnings, address sanitizer # --------------------------------------------------------------- -sundials_option(ENABLE_ALL_WARNINGS BOOL - "Enable all compiler warnings" OFF ADVANCED) +sundials_option(ENABLE_ALL_WARNINGS BOOL "Enable all compiler warnings" OFF + ADVANCED) sundials_option(ENABLE_WARNINGS_AS_ERRORS BOOL - "Enable compiler warnings as errors" OFF ADVANCED) + "Enable compiler warnings as errors" OFF ADVANCED) -sundials_option(ENABLE_ADDRESS_SANITIZER BOOL - "Enable address sanitizer" OFF ADVANCED) +sundials_option(ENABLE_ADDRESS_SANITIZER BOOL "Enable address sanitizer" OFF + ADVANCED) # --------------------------------------------------------------- # Options to enable SUNDIALS debugging @@ -225,111 +248,127 @@ sundials_option(ENABLE_ADDRESS_SANITIZER BOOL # List of debugging options (used to add preprocessor directives) set(_SUNDIALS_DEBUG_OPTIONS - SUNDIALS_DEBUG - SUNDIALS_DEBUG_ASSERT - SUNDIALS_DEBUG_CUDA_LASTERROR - SUNDIALS_DEBUG_HIP_LASTERROR - SUNDIALS_DEBUG_PRINTVEC) + SUNDIALS_DEBUG SUNDIALS_DEBUG_ASSERT SUNDIALS_DEBUG_CUDA_LASTERROR + SUNDIALS_DEBUG_HIP_LASTERROR SUNDIALS_DEBUG_PRINTVEC) sundials_option(SUNDIALS_DEBUG BOOL - "Enable additional debugging output and options" OFF - ADVANCED) + "Enable additional debugging output and options" OFF ADVANCED) if(SUNDIALS_DEBUG AND SUNDIALS_LOGGING_LEVEL LESS 4) set(DOCSTR "SUNDIALS_DEBUG=ON forced the logging level to 4") message(STATUS "${DOCSTR}") - set(SUNDIALS_LOGGING_LEVEL "4" CACHE STRING "${DOCSTR}" FORCE) + set(SUNDIALS_LOGGING_LEVEL + "4" + CACHE STRING "${DOCSTR}" FORCE) endif() -sundials_option(SUNDIALS_DEBUG_ASSERT BOOL - "Enable assert when debugging" OFF +sundials_option( + SUNDIALS_DEBUG_ASSERT BOOL "Enable assert when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ADVANCED) -sundials_option(SUNDIALS_DEBUG_CUDA_LASTERROR BOOL +sundials_option( + SUNDIALS_DEBUG_CUDA_LASTERROR BOOL "Enable CUDA last error checks when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ENABLE_CUDA ADVANCED) -sundials_option(SUNDIALS_DEBUG_HIP_LASTERROR BOOL +sundials_option( + SUNDIALS_DEBUG_HIP_LASTERROR BOOL "Enable HIP last error checks when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ENABLE_HIP ADVANCED) -sundials_option(SUNDIALS_DEBUG_PRINTVEC BOOL - "Enable vector printing when debugging" OFF +sundials_option( + SUNDIALS_DEBUG_PRINTVEC BOOL "Enable vector printing when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ADVANCED) if(SUNDIALS_DEBUG_PRINTVEC AND SUNDIALS_LOGGING_LEVEL LESS 5) set(DOCSTR "SUNDIALS_DEBUG_PRINTVEC=ON forced the logging level to 5") message(STATUS "${DOCSTR}") - set(SUNDIALS_LOGGING_LEVEL "5" CACHE STRING "${DOCSTR}" FORCE) + set(SUNDIALS_LOGGING_LEVEL + "5" + CACHE STRING "${DOCSTR}" FORCE) endif() # --------------------------------------------------------------- # Options for SUNDIALS external # --------------------------------------------------------------- -sundials_option(SUNDIALS_ENABLE_EXTERNAL_ADDONS BOOL +sundials_option( + SUNDIALS_ENABLE_EXTERNAL_ADDONS BOOL "Enables including EXTERNALLY MAINTAINED addons in the SUNDIALS build." OFF) if(SUNDIALS_ENABLE_EXTERNAL_ADDONS) - message(WARNING "SUNDIALS_ENABLE_EXTERNAL_ADDONS=TRUE. External addons are not maintained by the SUNDIALS team. Use at your own risk.") + message( + WARNING + "SUNDIALS_ENABLE_EXTERNAL_ADDONS=TRUE. External addons are not maintained by the SUNDIALS team. Use at your own risk." + ) endif() # --------------------------------------------------------------- # Options for SUNDIALS testing # --------------------------------------------------------------- -sundials_option(SUNDIALS_TEST_FLOAT_PRECISION STRING +sundials_option( + SUNDIALS_TEST_FLOAT_PRECISION STRING "Precision for floating point comparisons (number of digits)" "-1" ADVANCED) -sundials_option(SUNDIALS_TEST_INTEGER_PRECISION STRING +sundials_option( + SUNDIALS_TEST_INTEGER_PRECISION STRING "Precision for integer comparisons (percent difference)" "-1" ADVANCED) sundials_option(SUNDIALS_TEST_OUTPUT_DIR PATH - "Location to write testing output files" "" ADVANCED) + "Location to write testing output files" "" ADVANCED) sundials_option(SUNDIALS_TEST_ANSWER_DIR PATH - "Location of testing answer files" "" ADVANCED) + "Location of testing answer files" "" ADVANCED) sundials_option(SUNDIALS_TEST_PROFILE BOOL - "Use Caliper to profile SUNDIALS tests" OFF ADVANCED) + "Use Caliper to profile SUNDIALS tests" OFF ADVANCED) -sundials_option(SUNDIALS_TEST_NODIFF BOOL +sundials_option( + SUNDIALS_TEST_NODIFF BOOL "Disable output comparison in the regression test suite" OFF ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_EXE PATH - "Path to docker or podman" "" ADVANCED) +sundials_option(SUNDIALS_TEST_CONTAINER_EXE PATH "Path to docker or podman" "" + ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS STRING - "Extra arguments to pass to docker/podman run command" "--tls-verify=false" ADVANCED) +sundials_option( + SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS STRING + "Extra arguments to pass to docker/podman run command" "--tls-verify=false" + ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_MNT STRING +sundials_option( + SUNDIALS_TEST_CONTAINER_MNT STRING "Path to project root inside the container" "/sundials" ADVANCED) # Include development examples in regression tests sundials_option(SUNDIALS_TEST_DEVTESTS BOOL - "Include development tests in make test" OFF ADVANCED) + "Include development tests in make test" OFF ADVANCED) # Include unit tests in regression tests -sundials_option(SUNDIALS_TEST_UNITTESTS BOOL - "Include unit tests in make test" OFF ADVANCED) +sundials_option(SUNDIALS_TEST_UNITTESTS BOOL "Include unit tests in make test" + OFF ADVANCED) # Include googletest unit tests in regression tests -sundials_option(SUNDIALS_TEST_ENABLE_GTEST BOOL - "Disable GTest unit tests" ON ADVANCED) +sundials_option(SUNDIALS_TEST_ENABLE_GTEST BOOL "Disable GTest unit tests" ON + ADVANCED) -sundials_option(SUNDIALS_DEV_IWYU BOOL - "Enable include-what-you-use" OFF ADVANCED) +sundials_option(SUNDIALS_DEV_IWYU BOOL "Enable include-what-you-use" OFF + ADVANCED) -sundials_option(SUNDIALS_DEV_CLANG_TIDY BOOL - "Enable clang-tidy" OFF ADVANCED) +sundials_option(SUNDIALS_DEV_CLANG_TIDY BOOL "Enable clang-tidy" OFF ADVANCED) -sundials_option(SUNDIALS_SCHEDULER_COMMAND STRING "Job scheduler command to use to launch SUNDIALS MPI tests" "" ADVANCED) +sundials_option( + SUNDIALS_SCHEDULER_COMMAND STRING + "Job scheduler command to use to launch SUNDIALS MPI tests" "" ADVANCED) -sundials_option(SUNDIALS_CALIPER_OUTPUT_DIR PATH "Location to write caliper output files" "" ADVANCED) +sundials_option(SUNDIALS_CALIPER_OUTPUT_DIR PATH + "Location to write caliper output files" "" ADVANCED) -sundials_option(SUNDIALS_BENCHMARK_NUM_CPUS STRING "Number of CPU cores to run benchmarks with" "40" ADVANCED) +sundials_option(SUNDIALS_BENCHMARK_NUM_CPUS STRING + "Number of CPU cores to run benchmarks with" "40" ADVANCED) -sundials_option(SUNDIALS_BENCHMARK_NUM_GPUS STRING "Number of GPUs to run benchmarks with" "4" ADVANCED) +sundials_option(SUNDIALS_BENCHMARK_NUM_GPUS STRING + "Number of GPUs to run benchmarks with" "4" ADVANCED) diff --git a/cmake/SundialsDeprecated.cmake b/cmake/SundialsDeprecated.cmake index 385a11361b..a426ac1814 100644 --- a/cmake/SundialsDeprecated.cmake +++ b/cmake/SundialsDeprecated.cmake @@ -18,8 +18,10 @@ if(DEFINED F2003_INTERFACE_ENABLE) message(DEPRECATION "The CMake option F2003_INTERFACE_ENABLE is deprecated. " - "Use BUILD_FORTRAN_MODULE_INTERFACE instead.") - set(BUILD_FORTRAN_MODULE_INTERFACE ${F2003_INTERFACE_ENABLE} CACHE BOOL "Enable Fortran 2003 module interfaces") + "Use BUILD_FORTRAN_MODULE_INTERFACE instead.") + set(BUILD_FORTRAN_MODULE_INTERFACE + ${F2003_INTERFACE_ENABLE} + CACHE BOOL "Enable Fortran 2003 module interfaces") endif() unset(F2003_INTERFACE_ENABLE CACHE) @@ -30,115 +32,146 @@ unset(F2003_INTERFACE_ENABLE CACHE) if(DEFINED MPI_ENABLE) message(DEPRECATION "The CMake option MPI_ENABLE is deprecated. " - "Use ENABLE_MPI instead.") - set(ENABLE_MPI ${MPI_ENABLE} CACHE BOOL "Enable MPI support" FORCE) + "Use ENABLE_MPI instead.") + set(ENABLE_MPI + ${MPI_ENABLE} + CACHE BOOL "Enable MPI support" FORCE) unset(MPI_ENABLE CACHE) endif() if(DEFINED OPENMP_ENABLE) message(DEPRECATION "The CMake option OPENMP_ENABLE is deprecated. " - "Use ENABLE_OPENMP instead.") - set(ENABLE_OPENMP ${OPENMP_ENABLE} CACHE BOOL "Enable OpenMP support" FORCE) + "Use ENABLE_OPENMP instead.") + set(ENABLE_OPENMP + ${OPENMP_ENABLE} + CACHE BOOL "Enable OpenMP support" FORCE) unset(OPENMP_ENABLE CACHE) endif() if(DEFINED OPENMP_DEVICE_ENABLE) message(DEPRECATION "The CMake option OPENMP_DEVICE_ENABLE is deprecated. " - "Use ENABLE_OPENMP_DEVICE instead.") - set(ENABLE_OPENMP_DEVICE ${OPENMP_DEVICE_ENABLE} CACHE BOOL - "Enable OpenMP device offloading support" FORCE) + "Use ENABLE_OPENMP_DEVICE instead.") + set(ENABLE_OPENMP_DEVICE + ${OPENMP_DEVICE_ENABLE} + CACHE BOOL "Enable OpenMP device offloading support" FORCE) unset(OPENMP_DEVICE_ENABLE CACHE) endif() if(DEFINED SKIP_OPENMP_DEVICE_CHECK) - message(DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. " - "Use OPENMP_DEVICE_WORKS instead.") - set(OPENMP_DEVICE_WORKS ${SKIP_OPENMP_DEVICE_CHECK} CACHE BOOL - "Skip the compiler check for OpenMP device offloading" FORCE) + message( + DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. " + "Use OPENMP_DEVICE_WORKS instead.") + set(OPENMP_DEVICE_WORKS + ${SKIP_OPENMP_DEVICE_CHECK} + CACHE BOOL "Skip the compiler check for OpenMP device offloading" FORCE) unset(SKIP_OPENMP_DEVICE_CHECK CACHE) endif() if(DEFINED PTHREAD_ENABLE) message(DEPRECATION "The CMake option PTHREAD_ENABLE is deprecated. " - "Use ENABLE_PTHREAD instead") - set(ENABLE_PTHREAD ${PTHREAD_ENABLE} CACHE BOOL "Enable Pthreads support" FORCE) + "Use ENABLE_PTHREAD instead") + set(ENABLE_PTHREAD + ${PTHREAD_ENABLE} + CACHE BOOL "Enable Pthreads support" FORCE) unset(PTHREAD_ENABLE CACHE) endif() if(DEFINED CUDA_ENABLE) message(DEPRECATION "The CMake option CUDA_ENABLE is deprecated. " - "Use ENABLE_CUDA instead.") - set(ENABLE_CUDA ${CUDA_ENABLE} CACHE BOOL "Enable CUDA support" FORCE) + "Use ENABLE_CUDA instead.") + set(ENABLE_CUDA + ${CUDA_ENABLE} + CACHE BOOL "Enable CUDA support" FORCE) unset(CUDA_ENABLE CACHE) endif() if(DEFINED LAPACK_ENABLE) message(DEPRECATION "The CMake option LAPACK_ENABLE is deprecated. " - "Use ENABLE_LAPACK instead.") - set(ENABLE_LAPACK ${LAPACK_ENABLE} CACHE BOOL "Enable LAPACK support" FORCE) + "Use ENABLE_LAPACK instead.") + set(ENABLE_LAPACK + ${LAPACK_ENABLE} + CACHE BOOL "Enable LAPACK support" FORCE) unset(LAPACK_ENABLE CACHE) endif() if(DEFINED SUPERLUDIST_ENABLE) message(DEPRECATION "The CMake option SUPERLUDIST_ENABLE is deprecated. " - "Use ENABLE_SUPERLUDIST instead.") - set(ENABLE_SUPERLUDIST ${SUPERLUDIST_ENABLE} CACHE BOOL "Enable SuperLU_DIST support" FORCE) + "Use ENABLE_SUPERLUDIST instead.") + set(ENABLE_SUPERLUDIST + ${SUPERLUDIST_ENABLE} + CACHE BOOL "Enable SuperLU_DIST support" FORCE) unset(SUPERLUDIST_ENABLE CACHE) endif() # Deprecated with SUNDIALS 6.4.0 if(DEFINED SUPERLUDIST_LIBRARY_DIR) message(DEPRECATION "The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated. " - "Use SUPERLUDIST_DIR instead.") - set(SUPERLUDIST_DIR "${SUPERLUDIST_LIBRARY_DIR}/../" CACHE BOOL "SuperLU_DIST root directory" FORCE) + "Use SUPERLUDIST_DIR instead.") + set(SUPERLUDIST_DIR + "${SUPERLUDIST_LIBRARY_DIR}/../" + CACHE BOOL "SuperLU_DIST root directory" FORCE) unset(SUPERLUDIST_LIBRARY_DIR CACHE) endif() if(DEFINED SUPERLUDIST_INCLUDE_DIR) message(DEPRECATION "The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated. " - "Use SUPERLUDIST_INCLUDE_DIRS instead.") - set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIR}" CACHE BOOL "SuperLU_DIST include directoroes" FORCE) + "Use SUPERLUDIST_INCLUDE_DIRS instead.") + set(SUPERLUDIST_INCLUDE_DIRS + "${SUPERLUDIST_INCLUDE_DIR}" + CACHE BOOL "SuperLU_DIST include directoroes" FORCE) unset(SUPERLUDIST_INCLUDE_DIR CACHE) endif() if(DEFINED SUPERLUMT_ENABLE) message(DEPRECATION "The CMake option SUPERLUMT_ENABLE is deprecated. " - "Use ENABLE_SUPERLUMT instead.") - set(ENABLE_SUPERLUMT ${SUPERLUMT_ENABLE} CACHE BOOL "Enable SuperLU_MT support" FORCE) + "Use ENABLE_SUPERLUMT instead.") + set(ENABLE_SUPERLUMT + ${SUPERLUMT_ENABLE} + CACHE BOOL "Enable SuperLU_MT support" FORCE) unset(SUPERLUMT_ENABLE CACHE) endif() if(DEFINED KLU_ENABLE) message(DEPRECATION "The CMake option KLU_ENABLE is deprecated. " - "Use ENABLE_KLU instead.") - set(ENABLE_KLU ${KLU_ENABLE} CACHE BOOL "Enable KLU support" FORCE) + "Use ENABLE_KLU instead.") + set(ENABLE_KLU + ${KLU_ENABLE} + CACHE BOOL "Enable KLU support" FORCE) unset(KLU_ENABLE CACHE) endif() if(DEFINED HYPRE_ENABLE) message(DEPRECATION "The CMake option HYPRE_ENABLE is deprecated. " - "Use ENABLE_HYPRE instead.") - set(ENABLE_HYPRE ${HYPRE_ENABLE} CACHE BOOL "Enable HYPRE support" FORCE) + "Use ENABLE_HYPRE instead.") + set(ENABLE_HYPRE + ${HYPRE_ENABLE} + CACHE BOOL "Enable HYPRE support" FORCE) unset(HYPRE_ENABLE CACHE) endif() if(DEFINED PETSC_ENABLE) message(DEPRECATION "The CMake option PETSC_ENABLE is deprecated. " - "Use ENABLE_PETSC instead.") - set(ENABLE_PETSC ${PETSC_ENABLE} CACHE BOOL "Enable PETSC support" FORCE) + "Use ENABLE_PETSC instead.") + set(ENABLE_PETSC + ${PETSC_ENABLE} + CACHE BOOL "Enable PETSC support" FORCE) unset(PETSC_ENABLE CACHE) endif() if(DEFINED Trilinos_ENABLE) message(DEPRECATION "The CMake option Trilinos_ENABLE is deprecated. " - "Use ENABLE_TRILINOS instead.") - set(ENABLE_TRILINOS ${Trilinos_ENABLE} CACHE BOOL "Enable Trilinos support" FORCE) + "Use ENABLE_TRILINOS instead.") + set(ENABLE_TRILINOS + ${Trilinos_ENABLE} + CACHE BOOL "Enable Trilinos support" FORCE) unset(Trilinos_ENABLE CACHE) endif() if(DEFINED RAJA_ENABLE) message(DEPRECATION "The CMake option RAJA_ENABLE is deprecated. " - "Use ENABLE_RAJA instead.") - set(ENABLE_RAJA ${RAJA_ENABLE} CACHE BOOL "Enable RAJA support" FORCE) + "Use ENABLE_RAJA instead.") + set(ENABLE_RAJA + ${RAJA_ENABLE} + CACHE BOOL "Enable RAJA support" FORCE) unset(RAJA_ENABLE CACHE) endif() @@ -148,9 +181,11 @@ endif() if(DEFINED CUDA_ARCH) print_warning("The CMake option CUDA_ARCH is deprecated. " - "Use CMAKE_CUDA_ARCHITECTURES instead.") + "Use CMAKE_CUDA_ARCHITECTURES instead.") # convert sm_** to just ** string(REGEX MATCH "[0-9]+" arch_name "${CUDA_ARCH}") - set(CMAKE_CUDA_ARCHITECTURES ${arch_name} CACHE STRING "CUDA Architectures" FORCE) + set(CMAKE_CUDA_ARCHITECTURES + ${arch_name} + CACHE STRING "CUDA Architectures" FORCE) unset(CUDA_ARCH) endif() diff --git a/cmake/SundialsExampleOptions.cmake b/cmake/SundialsExampleOptions.cmake index 40d692771f..8d54377bd6 100644 --- a/cmake/SundialsExampleOptions.cmake +++ b/cmake/SundialsExampleOptions.cmake @@ -22,9 +22,16 @@ sundials_option(EXAMPLES_ENABLE_C BOOL "Build SUNDIALS C examples" ON) # Some TPLs only have C++ examples. Default the C++ examples to ON if any of # these are enabled on the initial configuration pass. -if (ENABLE_TRILINOS OR ENABLE_SUPERLUDIST OR ENABLE_XBRAID OR ENABLE_HIP OR - ENABLE_MAGMA OR ENABLE_SYCL OR ENABLE_ONEMKL OR ENABLE_RAJA OR ENABLE_GINKGO OR - ENABLE_KOKKOS) +if(ENABLE_TRILINOS + OR ENABLE_SUPERLUDIST + OR ENABLE_XBRAID + OR ENABLE_HIP + OR ENABLE_MAGMA + OR ENABLE_SYCL + OR ENABLE_ONEMKL + OR ENABLE_RAJA + OR ENABLE_GINKGO + OR ENABLE_KOKKOS) sundials_option(EXAMPLES_ENABLE_CXX BOOL "Build SUNDIALS C++ examples" ON) else() sundials_option(EXAMPLES_ENABLE_CXX BOOL "Build SUNDIALS C++ examples" OFF) @@ -34,24 +41,30 @@ endif() # Options for Fortran Examples # ----------------------------------------------------------------------------- -# F2003 examples (on by default) are an option only if the -# Fortran 2003 interface is enabled. +# F2003 examples (on by default) are an option only if the Fortran 2003 +# interface is enabled. set(DOCSTR "Build SUNDIALS Fortran 2003 examples") if(BUILD_FORTRAN_MODULE_INTERFACE) - set(EXAMPLES_ENABLE_F2003 ON CACHE BOOL "${DOCSTR}") + set(EXAMPLES_ENABLE_F2003 + ON + CACHE BOOL "${DOCSTR}") # Fortran 2003 examples only support double precision if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))) - message(WARNING "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message( + WARNING + "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() else() # set back to OFF (in case it was ON) if(EXAMPLES_ENABLE_F2003) - message(WARNING "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message( + WARNING + "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() @@ -71,25 +84,33 @@ sundials_option(EXAMPLES_ENABLE_CUDA BOOL "Build SUNDIALS CUDA examples" ON # Enable installing examples by default sundials_option(EXAMPLES_INSTALL BOOL "Install SUNDIALS examples" ON) -sundials_option(EXAMPLES_INSTALL_PATH PATH "Output directory for installing example files" "${CMAKE_INSTALL_PREFIX}/examples") +sundials_option( + EXAMPLES_INSTALL_PATH PATH "Output directory for installing example files" + "${CMAKE_INSTALL_PREFIX}/examples") # If examples are to be exported, check where we should install them. if(EXAMPLES_INSTALL AND NOT EXAMPLES_INSTALL_PATH) - message(WARNING "The example installation path is empty. Example installation " - "path was reset to its default value") - set(EXAMPLES_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/examples" CACHE STRING - "Output directory for installing example files" FORCE) + message( + WARNING "The example installation path is empty. Example installation " + "path was reset to its default value") + set(EXAMPLES_INSTALL_PATH + "${CMAKE_INSTALL_PREFIX}/examples" + CACHE STRING "Output directory for installing example files" FORCE) endif() # ----------------------------------------------------------------------------- # Internal variables. # ----------------------------------------------------------------------------- -if(EXAMPLES_ENABLE_C OR - EXAMPLES_ENABLE_CXX OR - EXAMPLES_ENABLE_CUDA OR - EXAMPLES_ENABLE_F2003) - set(_BUILD_EXAMPLES TRUE CACHE INTERNAL "") +if(EXAMPLES_ENABLE_C + OR EXAMPLES_ENABLE_CXX + OR EXAMPLES_ENABLE_CUDA + OR EXAMPLES_ENABLE_F2003) + set(_BUILD_EXAMPLES + TRUE + CACHE INTERNAL "") else() - set(_BUILD_EXAMPLES FALSE CACHE INTERNAL "") + set(_BUILD_EXAMPLES + FALSE + CACHE INTERNAL "") endif() diff --git a/cmake/SundialsIndexSize.cmake b/cmake/SundialsIndexSize.cmake index 6498637bd3..f8f4836144 100644 --- a/cmake/SundialsIndexSize.cmake +++ b/cmake/SundialsIndexSize.cmake @@ -24,8 +24,9 @@ include(CheckTypeSize) if(SUNDIALS_INDEX_SIZE MATCHES "64") set(SUNDIALS_CINDEX_TYPE "") - # if the user specified an index type use it, otherwise try the standard options - if (SUNDIALS_INDEX_TYPE) + # if the user specified an index type use it, otherwise try the standard + # options + if(SUNDIALS_INDEX_TYPE) set(POSSIBLE_INT64 ${SUNDIALS_INDEX_TYPE}) else() set(POSSIBLE_INT64 int64_t;__int64;long long;long) @@ -42,8 +43,11 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - message(FATAL_ERROR "No integer type of size 8 was found. Tried " - "${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message( + FATAL_ERROR + "No integer type of size 8 was found. Tried " + "${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE." + ) endif() # set Fortran integer size too @@ -51,8 +55,9 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") elseif(SUNDIALS_INDEX_SIZE MATCHES "32") set(SUNDIALS_CINDEX_TYPE "") - # if the user specified an index type use it, otherwise try the standard options - if (SUNDIALS_INDEX_TYPE) + # if the user specified an index type use it, otherwise try the standard + # options + if(SUNDIALS_INDEX_TYPE) set(POSSIBLE_INT32 ${SUNDIALS_INDEX_TYPE}) else() set(POSSIBLE_INT32 int32_t;int;long) @@ -69,8 +74,11 @@ elseif(SUNDIALS_INDEX_SIZE MATCHES "32") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - message(FATAL_ERROR "No integer type of size 4 was found. Tried " - "${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message( + FATAL_ERROR + "No integer type of size 4 was found. Tried " + "${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE." + ) endif() # set Fortran integer size too diff --git a/cmake/SundialsSetupCXX.cmake b/cmake/SundialsSetupCXX.cmake index 32a6a9b003..f4967f16cc 100644 --- a/cmake/SundialsSetupCXX.cmake +++ b/cmake/SundialsSetupCXX.cmake @@ -19,24 +19,21 @@ enable_language(CXX) set(CXX_FOUND TRUE) # --------------------------------------------------------------- -# Option to specify the C++ standard SUNDIALS will use. Defined -# here so it is set in the same configuration pass as the C++ -# compiler and related options. +# Option to specify the C++ standard SUNDIALS will use. Defined here so it is +# set in the same configuration pass as the C++ compiler and related options. # --------------------------------------------------------------- # Do not allow decaying to previous standards -- generates error if the standard # is not supported -sundials_option(CMAKE_CXX_STANDARD_REQUIRED BOOL - "Require C++ standard version" ON) +sundials_option(CMAKE_CXX_STANDARD_REQUIRED BOOL "Require C++ standard version" + ON) if(ENABLE_SYCL) set(DOCSTR "The C++ standard to use if C++ is enabled (17, 20)") - sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "17" - OPTIONS "17;20") + sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "17" OPTIONS "17;20") else() set(DOCSTR "The C++ standard to use if C++ is enabled (14, 17, 20)") - sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "14" - OPTIONS "14;17;20") + sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "14" OPTIONS "14;17;20") endif() message(STATUS "CXX standard set to ${CMAKE_CXX_STANDARD}") diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 7790f61609..797c743a3f 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -25,12 +25,12 @@ include(SundialsIndexSize) # =============================================================== if(WIN32) - # Under Windows, add compiler directive to inhibit warnings - # about use of unsecure functions. + # Under Windows, add compiler directive to inhibit warnings about use of + # unsecure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) - # Under Windows, we need to have dll and exe files in the - # same directory to run the test suite properly. + # Under Windows, we need to have dll and exe files in the same directory to + # run the test suite properly. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") @@ -38,7 +38,8 @@ endif() if(APPLE) # Allow undefined symbols that will be resolved by a user program. - set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") + set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") endif() # =============================================================== @@ -50,18 +51,20 @@ if(BUILD_SHARED_LIBS) # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) - # when building, don't use the install RPATH already - # (but later on when installing) + # when building, don't use the install RPATH already (but later on when + # installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}") - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH + # add the automatically determined parts of the RPATH which point to + # directories outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - # the RPATH to be used when installing, but only if it's not a system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" isSystemDir) + # the RPATH to be used when installing, but only if it's not a system + # directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_FULL_LIBDIR}" isSystemDir) if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") endif() @@ -82,7 +85,8 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "-Wdouble-promotion ${CMAKE_CXX_FLAGS}") endif() - if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32")) + if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32" + )) set(CMAKE_C_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_CXX_FLAGS}") endif() @@ -100,15 +104,17 @@ if(ENABLE_ALL_WARNINGS) # to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem # no- options were added in gfortran 6 # - # Exclude run-time pointer checks (no-pointer) because passing null objects - # to SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a + # Exclude run-time pointer checks (no-pointer) because passing null objects to + # SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a # run-time error with this check # # Exclude checks for subroutines and functions not marked as recursive # (no-recursion) e.g., ark_brusselator1D_task_local_nls_f2003 calls # SUNNonlinsolFree from within a custom nonlinear solver implementation of # SUNNonlinsolFree which causes a run-time error with this check - set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}") + set(CMAKE_Fortran_FLAGS + "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}" + ) endif() if(ENABLE_WARNINGS_AS_ERRORS) @@ -122,16 +128,22 @@ endif() if(ENABLE_ADDRESS_SANITIZER) message(STATUS "Enabling address sanitizer") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) + set(CMAKE_Fortran_FLAGS + "${CMAKE_Fortran_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) endif() if(SUNDIALS_DEBUG) message(STATUS "Adding debugging preprocessor directives") foreach(debug ${_SUNDIALS_DEBUG_OPTIONS}) - if (${${debug}}) + if(${${debug}}) add_compile_definitions(${debug}) endif() endforeach() @@ -142,8 +154,7 @@ endif() # =============================================================== set(DOCSTR "The C standard to use (99, 11, 17)") -sundials_option(CMAKE_C_STANDARD STRING "${DOCSTR}" "99" - OPTIONS "99;11;17") +sundials_option(CMAKE_C_STANDARD STRING "${DOCSTR}" "99" OPTIONS "99;11;17") message(STATUS "C standard set to ${CMAKE_C_STANDARD}") set(DOCSTR "Enable C compiler specific extensions") @@ -154,7 +165,8 @@ message(STATUS "C extensions set to ${CMAKE_C_EXTENSIONS}") # Check for __builtin_expect # --------------------------------------------------------------- -check_c_source_compiles(" +check_c_source_compiles( + " #include <stdio.h> int main(void) { double a = 0.0; @@ -165,14 +177,16 @@ check_c_source_compiles(" printf(\"a=%g\", a); return 0; } -" SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT) +" + SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT) # --------------------------------------------------------------- # Check for assume related extensions # --------------------------------------------------------------- # gcc >= 13 should have __attribute__((assume)) -check_c_source_compiles(" +check_c_source_compiles( + " #include <stdio.h> int main(void) { double a = 0.0; @@ -188,11 +202,13 @@ check_c_source_compiles(" printf(\"a=%g\", a); return 0; } -" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) +" + SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) # LLVM based compilers should have __builtin_assume if(NOT SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) - check_c_source_compiles(" + check_c_source_compiles( + " #include <stdio.h> int main(void) { double a = 0.0; @@ -201,12 +217,15 @@ if(NOT SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) printf(\"a=%g\", a); return 0; } - " SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) + " + SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) endif() # MSVC provides __assume -if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME)) - check_c_source_compiles(" +if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME + OR SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME)) + check_c_source_compiles( + " #include <stdio.h> int main(void) { double a = 0.0; @@ -215,19 +234,22 @@ if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUIL printf(\"a=%g\", a); return 0; } - " SUNDIALS_C_COMPILER_HAS_ASSUME) + " + SUNDIALS_C_COMPILER_HAS_ASSUME) endif() # --------------------------------------------------------------- # Check for unused extension # --------------------------------------------------------------- -check_c_source_compiles(" +check_c_source_compiles( + " int main(void) { __attribute__((unused)) double a = 0.0; return 0; } -" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) +" + SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) # --------------------------------------------------------------- # Check for POSIX timers @@ -236,25 +258,29 @@ include(SundialsPOSIXTimers) if(SUNDIALS_POSIX_TIMERS AND POSIX_TIMERS_NEED_POSIX_C_SOURCE) set(DOCSTR "Value of _POSIX_C_SOURCE") - sundials_option(SUNDIALS_POSIX_C_SOURCE STRING "${DOCSTR}" "200112L" - ADVANCED) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=${SUNDIALS_POSIX_C_SOURCE}") + sundials_option(SUNDIALS_POSIX_C_SOURCE STRING "${DOCSTR}" "200112L" ADVANCED) + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=${SUNDIALS_POSIX_C_SOURCE}") endif() - # --------------------------------------------------------------- # Check for deprecated attribute with message # --------------------------------------------------------------- if(WIN32) - set(COMPILER_DEPRECATED_MSG_ATTRIBUTE "__declspec(deprecated(msg))" CACHE INTERNAL "") + set(COMPILER_DEPRECATED_MSG_ATTRIBUTE + "__declspec(deprecated(msg))" + CACHE INTERNAL "") else() - set(COMPILER_DEPRECATED_MSG_ATTRIBUTE "__attribute__ ((__deprecated__(msg)))" CACHE INTERNAL "") + set(COMPILER_DEPRECATED_MSG_ATTRIBUTE + "__attribute__ ((__deprecated__(msg)))" + CACHE INTERNAL "") endif() -check_c_source_compiles(" +check_c_source_compiles( + " #define msg \"test\" ${COMPILER_DEPRECATED_MSG_ATTRIBUTE} int somefunc(void) { return 0; } - int main(void) { return somefunc();}" COMPILER_HAS_DEPRECATED_MSG -) + int main(void) { return somefunc();}" + COMPILER_HAS_DEPRECATED_MSG) # =============================================================== # Fortran settings @@ -282,24 +308,22 @@ endif() # The case to use in the name-mangling scheme sundials_option(SUNDIALS_LAPACK_CASE STRING - "case of LAPACK function names (lower/upper)" - "" - ADVANCED) + "case of LAPACK function names (lower/upper)" "" ADVANCED) # The number of underscores of appended in the name-mangling scheme -sundials_option(SUNDIALS_LAPACK_UNDERSCORES STRING - "number of underscores appended to LAPACK function names (none/one/two)" - "" - ADVANCED) +sundials_option( + SUNDIALS_LAPACK_UNDERSCORES STRING + "number of underscores appended to LAPACK function names (none/one/two)" "" + ADVANCED) # If used, both case and underscores must be set if((NOT SUNDIALS_LAPACK_CASE) AND SUNDIALS_LAPACK_UNDERSCORES) message(FATAL_ERROR "If SUNDIALS_LAPACK_UNDERSCORES is set, " - "SUNDIALS_LAPACK_CASE must also be set.") + "SUNDIALS_LAPACK_CASE must also be set.") endif() if(SUNDIALS_LAPACK_CASE AND (NOT SUNDIALS_LAPACK_UNDERSCORES)) message(FATAL_ERROR "If SUNDIALS_LAPACK_CASE is set, " - "SUNDIALS_LAPACK_UNDERSCORES must also be set.") + "SUNDIALS_LAPACK_UNDERSCORES must also be set.") endif() # Did the user provide a name-mangling scheme? @@ -318,11 +342,15 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") else() message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() @@ -331,11 +359,15 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") else() message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() @@ -346,16 +378,13 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) # name-mangling scheme has been manually set set(NEED_FORTRAN_NAME_MANGLING FALSE) - configure_file( - ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in - ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h - ) + configure_file(${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h) endif() # Do we need a Fortran compiler? -if(BUILD_FORTRAN_MODULE_INTERFACE OR - NEED_FORTRAN_NAME_MANGLING) +if(BUILD_FORTRAN_MODULE_INTERFACE OR NEED_FORTRAN_NAME_MANGLING) include(SundialsSetupFortran) endif() @@ -363,17 +392,19 @@ endif() # C++ settings # =============================================================== -if(BUILD_BENCHMARKS OR SUNDIALS_TEST_UNITTESTS OR EXAMPLES_ENABLE_CXX OR - ENABLE_CUDA OR - ENABLE_HIP OR - ENABLE_SYCL OR - ENABLE_RAJA OR - ENABLE_TRILINOS OR - ENABLE_SUPERLUDIST OR - ENABLE_MAGMA OR - ENABLE_GINKGO OR - ENABLE_KOKKOS OR - ENABLE_ADIAK) +if(BUILD_BENCHMARKS + OR SUNDIALS_TEST_UNITTESTS + OR EXAMPLES_ENABLE_CXX + OR ENABLE_CUDA + OR ENABLE_HIP + OR ENABLE_SYCL + OR ENABLE_RAJA + OR ENABLE_TRILINOS + OR ENABLE_SUPERLUDIST + OR ENABLE_MAGMA + OR ENABLE_GINKGO + OR ENABLE_KOKKOS + OR ENABLE_ADIAK) include(SundialsSetupCXX) endif() @@ -416,8 +447,8 @@ endif() # Upper case version of build type string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type) -# Make build type specific flag options ADVANCED, -# except for the one corresponding to the current build type +# Make build type specific flag options ADVANCED, except for the one +# corresponding to the current build type foreach(lang ${_SUNDIALS_ENABLED_LANGS}) foreach(build_type DEBUG;RELEASE;RELWITHDEBINFO;MINSIZEREL) if("${_cmake_build_type}" STREQUAL "${build_type}") @@ -431,7 +462,6 @@ foreach(lang ${_SUNDIALS_ENABLED_LANGS}) mark_as_advanced(CLEAR CMAKE_${lang}_COMPILER CMAKE_${lang}_FLAGS) endforeach() - # =============================================================== # Configure compilers for installed examples # =============================================================== @@ -439,14 +469,17 @@ endforeach() foreach(lang ${_SUNDIALS_ENABLED_LANGS}) if(ENABLE_MPI) if(DEFINED MPI_${lang}_COMPILER) - set(_EXAMPLES_${lang}_COMPILER "${MPI_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${MPI_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() else() - set(_EXAMPLES_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${CMAKE_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() endforeach() - # =============================================================== # Configure clang-tidy for linting # =============================================================== @@ -456,7 +489,7 @@ set(SUNDIALS_DEV_CLANG_TIDY_DIR ${CMAKE_BINARY_DIR}/clang-tidy/) if(SUNDIALS_DEV_CLANG_TIDY) find_program(CLANG_TIDY_PATH NAMES clang-tidy) if(NOT CLANG_TIDY_PATH) - message(FATAL_ERROR "Could not find the program clang-tidy") + message(FATAL_ERROR "Could not find the program clang-tidy") endif() message(STATUS "Found clang-tidy: ${CLANG_TIDY_PATH}") @@ -465,15 +498,12 @@ if(SUNDIALS_DEV_CLANG_TIDY) set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_PATH} -format-style='file' --fix) set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_PATH} -format-style='file' --fix) else() - set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_PATH} - -format-style='file' - --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-fixes.yaml - ) + set(CMAKE_C_CLANG_TIDY + ${CLANG_TIDY_PATH} -format-style='file' + --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-fixes.yaml) set(CMAKE_CXX_CLANG_TIDY - ${CLANG_TIDY_PATH} - -format-style='file' - --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-cxx-fixes.yaml - ) + ${CLANG_TIDY_PATH} -format-style='file' + --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-cxx-fixes.yaml) endif() endif() @@ -483,10 +513,10 @@ if(SUNDIALS_DEV_IWYU) message(FATAL_ERROR "Could not find the program include-what-you-use") endif() message(STATUS "Found IWYU: ${IWYU_PATH}") - set(CMAKE_C_INCLUDE_WHAT_YOU_USE ${IWYU_PATH} - -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp - -Xiwyu --error_always) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH} - -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp - -Xiwyu --error_always) + set(CMAKE_C_INCLUDE_WHAT_YOU_USE + ${IWYU_PATH} -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp + -Xiwyu --error_always) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${IWYU_PATH} -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp + -Xiwyu --error_always) endif() diff --git a/cmake/SundialsSetupConfig.cmake b/cmake/SundialsSetupConfig.cmake index 482a267ac4..e1ea1f1929 100644 --- a/cmake/SundialsSetupConfig.cmake +++ b/cmake/SundialsSetupConfig.cmake @@ -44,10 +44,9 @@ else() string(TIMESTAMP JOB_START_TIME "%Y%m%d%H%M%S") endif() - # ============================================================================ -# Generate macros and substitution variables related to TPLs -# that SUNDIALS is being built with. +# Generate macros and substitution variables related to TPLs that SUNDIALS is +# being built with. # ============================================================================ # prepare substitution variables for modules that have been built @@ -59,7 +58,8 @@ foreach(_item ${SUNDIALS_BUILD_LIST}) endif() endforeach() -# prepare substitution variable SUNDIALS_${TPL NAME}_ENABLED for sundials_config.h +# prepare substitution variable SUNDIALS_${TPL NAME}_ENABLED for +# sundials_config.h foreach(tpl ${SUNDIALS_TPL_LIST}) set(SUNDIALS_${tpl}_ENABLED TRUE) endforeach() @@ -94,7 +94,5 @@ endif() # Generate the header file and place it in the binary dir. # ============================================================================= -configure_file( - ${PROJECT_SOURCE_DIR}/include/sundials/sundials_config.in - ${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h - ) +configure_file(${PROJECT_SOURCE_DIR}/include/sundials/sundials_config.in + ${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h) diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index f971e691a6..8a0703336b 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -19,9 +19,11 @@ # =============================================================== if(NOT CMAKE_CUDA_HOST_COMPILER) - # If a user did not provide the host compiler, then we - # assume that they want to use the CXX compiler that was set. - set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "NVCC host compiler") + # If a user did not provide the host compiler, then we assume that they want + # to use the CXX compiler that was set. + set(CMAKE_CUDA_HOST_COMPILER + ${CMAKE_CXX_COMPILER} + CACHE FILEPATH "NVCC host compiler") endif() # =============================================================== @@ -31,18 +33,19 @@ endif() # Do not allow decaying to previous standards -- generates error if the standard # is not supported sundials_option(CMAKE_CUDA_STANDARD_REQUIRED BOOL - "Require C++ standard version" ON) + "Require C++ standard version" ON) set(DOCSTR "The CUDA standard to use if CUDA is enabled (14, 17, 20)") sundials_option(CMAKE_CUDA_STANDARD STRING "${DOCSTR}" "${CMAKE_CXX_STANDARD}" OPTIONS "14;17;20") message(STATUS "CUDA standard set to ${CMAKE_CUDA_STANDARD}") -set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") +set(CMAKE_CUDA_FLAGS + "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") -if( (CMAKE_CXX_COMPILER_ID MATCHES GNU) - OR (CMAKE_CXX_COMPILER_ID MATCHES Clang) - AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le) ) +if((CMAKE_CXX_COMPILER_ID MATCHES GNU) + OR (CMAKE_CXX_COMPILER_ID MATCHES Clang) + AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le)) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-mno-float128 _hasflag) if(_hasflag) @@ -75,15 +78,19 @@ message(STATUS "CUDA Library Directory: ${CUDAToolkit_LIBRARY_DIR}") message(STATUS "CUDA Compile Flags: ${CMAKE_CUDA_FLAGS}") message(STATUS "CUDA Link Flags: ${CMAKE_CUDA_LINK_FLAGS}") message(STATUS "CUDA Link Executable: ${CMAKE_CUDA_LINK_EXECUTABLE}") -message(STATUS "CUDA Separable Compilation: ${CMAKE_CUDA_SEPARABLE_COMPILATION}") - +message( + STATUS "CUDA Separable Compilation: ${CMAKE_CUDA_SEPARABLE_COMPILATION}") # =============================================================== # Configure compiler for installed examples # =============================================================== if(ENABLE_MPI) - set(_EXAMPLES_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_CUDA_HOST_COMPILER + "${MPI_CXX_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") else() - set(_EXAMPLES_CUDA_HOST_COMPILER "${CMAKE_CUDA_HOST_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_CUDA_HOST_COMPILER + "${CMAKE_CUDA_HOST_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index de9beea905..bdef010422 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -39,7 +39,8 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) file(MAKE_DIRECTORY ${F2003Test_DIR}) # Create a CMakeLists.txt file - file(WRITE ${F2003Test_DIR}/CMakeLists.txt + file( + WRITE ${F2003Test_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ftest Fortran)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -54,29 +55,42 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) # Create a Fortran source file which tries to use iso_c_binding file(WRITE ${F2003Test_DIR}/ftest.f90 - "program main\n" - "use, intrinsic :: iso_c_binding\n" - "end program main\n") + "program main\n" "use, intrinsic :: iso_c_binding\n" + "end program main\n") # Attempt compile the executable - try_compile(FTEST_OK ${F2003Test_DIR} ${F2003Test_DIR} - ftest OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + FTEST_OK ${F2003Test_DIR} + ${F2003Test_DIR} ftest + OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove + # the CMakeFiles directory. file(REMOVE_RECURSE ${F2003Test_DIR}/CMakeFiles) if(FTEST_OK) - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- yes") - set(F2003_FOUND TRUE CACHE BOOL "${CMAKE_Fortran_COMPILER} supports F2003" FORCE) + message( + STATUS + "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- yes") + set(F2003_FOUND + TRUE + CACHE BOOL "${CMAKE_Fortran_COMPILER} supports F2003" FORCE) else() - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no") + message( + STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no" + ) message(STATUS "Check output:") message("${COMPILE_OUTPUT}") - message(FATAL_ERROR "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003") + message( + FATAL_ERROR + "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003" + ) endif() else() - message(STATUS "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE.") + message( + STATUS + "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE." + ) endif() endif() diff --git a/cmake/SundialsSetupHIP.cmake b/cmake/SundialsSetupHIP.cmake index bc5a6c3776..709e335d55 100644 --- a/cmake/SundialsSetupHIP.cmake +++ b/cmake/SundialsSetupHIP.cmake @@ -16,25 +16,37 @@ if(NOT DEFINED ROCM_PATH) if(NOT DEFINED ENV{ROCM_PATH}) - set(ROCM_PATH "/opt/rocm/" CACHE PATH "Path to which ROCm has been installed") + set(ROCM_PATH + "/opt/rocm/" + CACHE PATH "Path to which ROCm has been installed") else() - set(ROCM_PATH "$ENV{ROCM_PATH}" CACHE PATH "Path to which ROCm has been installed") + set(ROCM_PATH + "$ENV{ROCM_PATH}" + CACHE PATH "Path to which ROCm has been installed") endif() endif() if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH + "/opt/rocm/hip" + CACHE PATH "Path to which HIP has been installed") else() - set(HIP_PATH "$ENV{HIP_PATH}" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH + "$ENV{HIP_PATH}" + CACHE PATH "Path to which HIP has been installed") endif() endif() if(NOT DEFINED HIP_PLATFORM) if(NOT DEFINED ENV{HIP_PLATFORM}) - set(HIP_PLATFORM "amd" CACHE STRING "HIP platform (amd, nvidia)") + set(HIP_PLATFORM + "amd" + CACHE STRING "HIP platform (amd, nvidia)") else() - set(HIP_PLATFORM "$ENV{HIP_PLATFORM}" CACHE STRING "HIP platform (amd, nvidia)") + set(HIP_PLATFORM + "$ENV{HIP_PLATFORM}" + CACHE STRING "HIP platform (amd, nvidia)") endif() endif() @@ -46,7 +58,8 @@ set(CMAKE_PREFIX_PATH "${ROCM_PATH};${HIP_PATH}") find_package(HIP REQUIRED) if("${HIP_COMPILER}" STREQUAL "hcc") - message(FATAL_ERROR "Deprecated HCC compiler is not supported" "Please update ROCm") + message(FATAL_ERROR "Deprecated HCC compiler is not supported" + "Please update ROCm") endif() message(STATUS "HIP version: ${HIP_VERSION}") diff --git a/cmake/SundialsSetupTPLs.cmake b/cmake/SundialsSetupTPLs.cmake index fe57c20a7c..d23bb95503 100644 --- a/cmake/SundialsSetupTPLs.cmake +++ b/cmake/SundialsSetupTPLs.cmake @@ -15,8 +15,8 @@ # --------------------------------------------------------------- # --------------------------------------------------------------- -# Setup MPI, OpenMP, and OpenMP offload first as other TPLs may -# need targets or variables corresponding to these TPLs. +# Setup MPI, OpenMP, and OpenMP offload first as other TPLs may need targets or +# variables corresponding to these TPLs. # --------------------------------------------------------------- # --------------------------------------------------------------- @@ -77,7 +77,6 @@ if(ENABLE_GINKGO) list(APPEND SUNDIALS_TPL_LIST "GINKGO") endif() - # --------------------------------------------------------------- # Find (and test) the hypre libraries # --------------------------------------------------------------- diff --git a/cmake/SundialsSetupTesting.cmake b/cmake/SundialsSetupTesting.cmake index 11a445900d..b261ffe385 100644 --- a/cmake/SundialsSetupTesting.cmake +++ b/cmake/SundialsSetupTesting.cmake @@ -18,17 +18,25 @@ include(CTest) # Check if development tests are enabled -if (SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS) +if(SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS) # Python is needed to use the test runner find_package(Python3 REQUIRED) # look for the testRunner script in the test directory - find_program(TESTRUNNER testRunner PATHS test NO_DEFAULT_PATH) + find_program( + TESTRUNNER testRunner + PATHS test + NO_DEFAULT_PATH) if(NOT TESTRUNNER) - message(FATAL_ERROR "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.") + message( + FATAL_ERROR + "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue." + ) endif() message(STATUS "Found testRunner: ${TESTRUNNER}") - set(TESTRUNNER ${TESTRUNNER} CACHE INTERNAL "") + set(TESTRUNNER + ${TESTRUNNER} + CACHE INTERNAL "") endif() @@ -46,7 +54,9 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default output directory was provided make sure it exists if(SUNDIALS_TEST_OUTPUT_DIR) - message(STATUS "Using non-default test output directory: ${SUNDIALS_TEST_OUTPUT_DIR}") + message( + STATUS + "Using non-default test output directory: ${SUNDIALS_TEST_OUTPUT_DIR}") if(NOT EXISTS ${SUNDIALS_TEST_OUTPUT_DIR}) file(MAKE_DIRECTORY ${SUNDIALS_TEST_OUTPUT_DIR}) endif() @@ -54,7 +64,9 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default answer directory was provided make sure it exists if(SUNDIALS_TEST_ANSWER_DIR) - message(STATUS "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}") + message( + STATUS + "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}") if(NOT EXISTS ${SUNDIALS_TEST_ANSWER_DIR}) message(FATAL_ERROR "SUNDIALS_TEST_ANSWER_DIR does not exist!") endif() @@ -62,7 +74,10 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default caliper output directory was provided make sure it exists if(SUNDIALS_CALIPER_OUTPUT_DIR) - message(STATUS "Using non-default caliper output directory: ${SUNDIALS_CALIPER_OUTPUT_DIR}") + message( + STATUS + "Using non-default caliper output directory: ${SUNDIALS_CALIPER_OUTPUT_DIR}" + ) if(NOT EXISTS ${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}) file(MAKE_DIRECTORY ${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}) endif() @@ -70,11 +85,16 @@ if(SUNDIALS_TEST_DEVTESTS) # Check if using non-default comparison precisions when testing if(SUNDIALS_TEST_FLOAT_PRECISION GREATER_EQUAL "0") - message(STATUS "Using non-default float precision: ${SUNDIALS_TEST_FLOAT_PRECISION}") + message( + STATUS + "Using non-default float precision: ${SUNDIALS_TEST_FLOAT_PRECISION}") endif() if(SUNDIALS_TEST_INTEGER_PRECISION GREATER_EQUAL "0") - message(STATUS "Using non-default integer precision: ${SUNDIALS_TEST_INTEGER_PRECISION}") + message( + STATUS + "Using non-default integer precision: ${SUNDIALS_TEST_INTEGER_PRECISION}" + ) endif() # @@ -85,32 +105,57 @@ if(SUNDIALS_TEST_DEVTESTS) if(NOT container_exe) find_program(container_exe podman) endif() - set(SUNDIALS_TEST_CONTAINER_EXE ${container_exe} CACHE PATH "Path to docker or podman" FORCE) + set(SUNDIALS_TEST_CONTAINER_EXE + ${container_exe} + CACHE PATH "Path to docker or podman" FORCE) endif() if(SUNDIALS_TEST_CONTAINER_EXE) - add_custom_target(setup_local_ci - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "Pulled SUNDIALS CI containers.") + add_custom_target(setup_local_ci ${CMAKE_COMMAND} -E cmake_echo_color + --cyan "Pulled SUNDIALS CI containers.") - add_custom_target(test_local_ci - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All testing with SUNDIALS CI containers complete.") + add_custom_target( + test_local_ci ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All testing with SUNDIALS CI containers complete.") macro(add_local_ci_target index_size precision tag) string(TOLOWER "${precision}" precision_) set(container sundials-ci-int${index_size}-${precision_}) - set(container_exe_args run ${SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS} -t -d --name ${container} --cap-add SYS_PTRACE - -v ${CMAKE_SOURCE_DIR}:${SUNDIALS_TEST_CONTAINER_MNT} ghcr.io/llnl/${container}:${tag}) - add_custom_target(setup_local_ci_${index_size}_${precision_} + set(container_exe_args + run + ${SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS} + -t + -d + --name + ${container} + --cap-add + SYS_PTRACE + -v + ${CMAKE_SOURCE_DIR}:${SUNDIALS_TEST_CONTAINER_MNT} + ghcr.io/llnl/${container}:${tag}) + add_custom_target( + setup_local_ci_${index_size}_${precision_} COMMENT "Pulling SUNDIALS CI container ghcr.io/llnl/${container}:${tag}" COMMAND ${SUNDIALS_TEST_CONTAINER_EXE} ${container_exe_args}) - add_dependencies(setup_local_ci setup_local_ci_${index_size}_${precision_}) + add_dependencies(setup_local_ci + setup_local_ci_${index_size}_${precision_}) set(container_test_exe ./test_driver.sh) - set(container_test_exe_args --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${precision_} --indexsize ${index_size}) - set(container_exe_args exec -w ${SUNDIALS_TEST_CONTAINER_MNT}/test ${container} ${container_test_exe} ${container_test_exe_args}) - add_custom_target(test_local_ci_${index_size}_${precision_} + set(container_test_exe_args + --testtype + CUSTOM + --env + env/docker.sh + --tpls + --sunrealtype + ${precision_} + --indexsize + ${index_size}) + set(container_exe_args + exec -w ${SUNDIALS_TEST_CONTAINER_MNT}/test ${container} + ${container_test_exe} ${container_test_exe_args}) + add_custom_target( + test_local_ci_${index_size}_${precision_} COMMENT "Running tests in CI container ${container}:${tag}" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${SUNDIALS_TEST_CONTAINER_EXE} ${container_exe_args} @@ -136,11 +181,13 @@ if(SUNDIALS_TEST_UNITTESTS AND SUNDIALS_TEST_ENABLE_GTEST) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip - GIT_TAG v1.14.0 - ) + GIT_TAG v1.14.0) if(WIN32) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + # For Windows: Prevent overriding the parent project's compiler/linker + # settings + set(gtest_force_shared_crt + ON + CACHE BOOL "" FORCE) endif() FetchContent_MakeAvailable(googletest) include(GoogleTest) @@ -164,13 +211,11 @@ if(EXAMPLES_INSTALL) endif() # Create test_install and test_install_all targets - add_custom_target(test_install - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All installation tests complete.") + add_custom_target(test_install ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All installation tests complete.") - add_custom_target(test_install_all - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All installation tests complete.") + add_custom_target(test_install_all ${CMAKE_COMMAND} -E cmake_echo_color + --cyan "All installation tests complete.") endif() @@ -180,8 +225,6 @@ if(BUILD_BENCHMARKS) message("SUNDIALS Benchmarking") # Create benchmark targets - add_custom_target(benchmark - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All benchmarks complete." - ) + add_custom_target(benchmark ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All benchmarks complete.") endif() diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 36e0dc5a1b..40110eed74 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -30,12 +30,11 @@ sundials_option(ENABLE_OPENMP BOOL "Enable OpenMP support" OFF) sundials_option(ENABLE_OPENMP_DEVICE BOOL "Enable OpenMP device offloading support" OFF) -# Advanced option to skip OpenMP device offloading support check. -# This is needed for a specific compiler that doesn't correctly -# report its OpenMP spec date (with CMake >= 3.9). +# Advanced option to skip OpenMP device offloading support check. This is needed +# for a specific compiler that doesn't correctly report its OpenMP spec date +# (with CMake >= 3.9). sundials_option(OPENMP_DEVICE_WORKS BOOL - "Skip the OpenMP device offloading support check" OFF - ADVANCED) + "Skip the OpenMP device offloading support check" OFF ADVANCED) # --------------------------------------------------------------- # Enable Pthread support? @@ -61,112 +60,145 @@ sundials_option(ENABLE_HIP BOOL "Enable HIP support" OFF) # ------------------------------------------------------------- sundials_option(ENABLE_SYCL BOOL "Enable SYCL support" OFF) -sundials_option(SUNDIALS_SYCL_2020_UNSUPPORTED BOOL - "Disable the use of some SYCL 2020 features in SUNDIALS libraries and examples" OFF - DEPENDS_ON ENABLE_SYCL - ADVANCED) +sundials_option( + SUNDIALS_SYCL_2020_UNSUPPORTED + BOOL + "Disable the use of some SYCL 2020 features in SUNDIALS libraries and examples" + OFF + DEPENDS_ON ENABLE_SYCL + ADVANCED) # --------------------------------------------------------------- # Enable LAPACK support? # --------------------------------------------------------------- sundials_option(ENABLE_LAPACK BOOL "Enable Lapack support" OFF) -sundials_option(LAPACK_LIBRARIES STRING "Lapack and Blas libraries" "${LAPACK_LIBRARIES}" - DEPENDS_ON ENABLE_LAPACK) +sundials_option(LAPACK_LIBRARIES STRING "Lapack and Blas libraries" + "${LAPACK_LIBRARIES}" DEPENDS_ON ENABLE_LAPACK) -sundials_option(LAPACK_WORKS BOOL "Set to ON to force CMake to accept a given LAPACK configuration" OFF - DEPENDS_ON ENABLE_LAPACK - ADVANCED) +sundials_option( + LAPACK_WORKS BOOL + "Set to ON to force CMake to accept a given LAPACK configuration" OFF + DEPENDS_ON ENABLE_LAPACK + ADVANCED) # --------------------------------------------------------------- # Enable Ginkgo support? # --------------------------------------------------------------- sundials_option(ENABLE_GINKGO BOOL "Enable Ginkgo support" OFF) -sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" "${Ginkgo_DIR}" - DEPENDS_ON ENABLE_GINKGO) +sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" + "${Ginkgo_DIR}" DEPENDS_ON ENABLE_GINKGO) -sundials_option(SUNDIALS_GINKGO_BACKENDS STRING "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, SYCL)" "REF;OMP" - DEPENDS_ON ENABLE_GINKGO) +sundials_option( + SUNDIALS_GINKGO_BACKENDS + STRING + "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, SYCL)" + "REF;OMP" + DEPENDS_ON ENABLE_GINKGO) -sundials_option(GINKGO_WORKS BOOL "Set to ON to force CMake to accept a given Ginkgo configuration" OFF - DEPENDS_ON ENABLE_GINKGO - ADVANCED) +sundials_option( + GINKGO_WORKS BOOL + "Set to ON to force CMake to accept a given Ginkgo configuration" OFF + DEPENDS_ON ENABLE_GINKGO + ADVANCED) # --------------------------------------------------------------- # Enable MAGMA support? # --------------------------------------------------------------- sundials_option(ENABLE_MAGMA BOOL "Enable MAGMA support" OFF) -sundials_option(MAGMA_DIR PATH "Path to the root of a MAGMA installation" "${MAGMA_DIR}" - DEPENDS_ON ENABLE_MAGMA) +sundials_option(MAGMA_DIR PATH "Path to the root of a MAGMA installation" + "${MAGMA_DIR}" DEPENDS_ON ENABLE_MAGMA) -sundials_option(SUNDIALS_MAGMA_BACKENDS STRING "Which MAGMA backend to use under the SUNDIALS MAGMA interfaces (CUDA, HIP)" "CUDA" - OPTIONS "CUDA;HIP" - DEPENDS_ON ENABLE_MAGMA) +sundials_option( + SUNDIALS_MAGMA_BACKENDS STRING + "Which MAGMA backend to use under the SUNDIALS MAGMA interfaces (CUDA, HIP)" + "CUDA" + OPTIONS "CUDA;HIP" + DEPENDS_ON ENABLE_MAGMA) -sundials_option(MAGMA_WORKS BOOL "Set to ON to force CMake to accept a given MAGMA configuration" OFF - DEPENDS_ON ENABLE_MAGMA - ADVANCED) +sundials_option( + MAGMA_WORKS BOOL + "Set to ON to force CMake to accept a given MAGMA configuration" OFF + DEPENDS_ON ENABLE_MAGMA + ADVANCED) # --------------------------------------------------------------- # Enable SuperLU_DIST support? # --------------------------------------------------------------- sundials_option(ENABLE_SUPERLUDIST BOOL "Enable SuperLU_DIST support" OFF) -sundials_option(SUPERLUDIST_DIR PATH "Path to the root of the SuperLU_DIST installation" "${SUPERLUDIST_DIR}" - DEPENDS_ON ENABLE_SUPERLUDIST) +sundials_option( + SUPERLUDIST_DIR PATH "Path to the root of the SuperLU_DIST installation" + "${SUPERLUDIST_DIR}" DEPENDS_ON ENABLE_SUPERLUDIST) -sundials_option(SUPERLUDIST_INCLUDE_DIRS PATH "SuperLU_DIST include directories" "${SUPERLUDIST_INCLUDE_DIRS}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_INCLUDE_DIRS PATH "SuperLU_DIST include directories" + "${SUPERLUDIST_INCLUDE_DIRS}" + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) -sundials_option(SUPERLUDIST_LIBRARIES STRING "Semi-colon separated list of libraries needed for SuperLU_DIST." "${SUPERLUDIST_LIBRARIES}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_LIBRARIES STRING + "Semi-colon separated list of libraries needed for SuperLU_DIST." + "${SUPERLUDIST_LIBRARIES}" + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) -sundials_option(SUPERLUDIST_OpenMP BOOL "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF - DEPENDS_ON ENABLE_SUPERLUDIST) +sundials_option( + SUPERLUDIST_OpenMP BOOL + "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF + DEPENDS_ON ENABLE_SUPERLUDIST) -sundials_option(SUPERLUDIST_WORKS BOOL "Set to ON to force CMake to accept a given SuperLU_DIST configuration" OFF - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_WORKS BOOL + "Set to ON to force CMake to accept a given SuperLU_DIST configuration" OFF + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) # --------------------------------------------------------------- # Enable SuperLU_MT support? # --------------------------------------------------------------- sundials_option(ENABLE_SUPERLUMT BOOL "Enable SuperLU_MT support" OFF) -sundials_option(SUPERLUMT_INCLUDE_DIR PATH "SuperLU_MT include directory" "${SUPERLUMT_INCLUDE_DIR}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option(SUPERLUMT_INCLUDE_DIR PATH "SuperLU_MT include directory" + "${SUPERLUMT_INCLUDE_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_LIBRARY_DIR PATH "SuperLU_MT library directory" "${SUPERLUMT_LIBRARY_DIR}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option(SUPERLUMT_LIBRARY_DIR PATH "SuperLU_MT library directory" + "${SUPERLUMT_LIBRARY_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_LIBRARIES STRING "Semi-colon separated list of additional libraries needed for SuperLU_MT." "${SUPERLUMT_LIBRARIES}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option( + SUPERLUMT_LIBRARIES STRING + "Semi-colon separated list of additional libraries needed for SuperLU_MT." + "${SUPERLUMT_LIBRARIES}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" "PTHREAD" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option( + SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" + "PTHREAD" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_WORKS BOOL "Set to ON to force CMake to accept a given SUPERLUMT configuration" OFF - DEPENDS_ON ENABLE_SUPERLUMT - ADVANCED) +sundials_option( + SUPERLUMT_WORKS BOOL + "Set to ON to force CMake to accept a given SUPERLUMT configuration" OFF + DEPENDS_ON ENABLE_SUPERLUMT + ADVANCED) # --------------------------------------------------------------- # Enable KLU support? # --------------------------------------------------------------- sundials_option(ENABLE_KLU BOOL "Enable KLU support" OFF) -sundials_option(KLU_INCLUDE_DIR PATH "KLU include directory" "${KLU_INCLUDE_DIR}" - DEPENDS_ON ENABLE_KLU) +sundials_option(KLU_INCLUDE_DIR PATH "KLU include directory" + "${KLU_INCLUDE_DIR}" DEPENDS_ON ENABLE_KLU) -sundials_option(KLU_LIBRARY_DIR PATH "KLU library directory" "${KLU_LIBRARY_DIR}" - DEPENDS_ON ENABLE_KLU) +sundials_option(KLU_LIBRARY_DIR PATH "KLU library directory" + "${KLU_LIBRARY_DIR}" DEPENDS_ON ENABLE_KLU) -sundials_option(KLU_WORKS BOOL "Set to ON to force CMake to accept a given KLU configuration" OFF - DEPENDS_ON ENABLE_KLU - ADVANCED) +sundials_option( + KLU_WORKS BOOL "Set to ON to force CMake to accept a given KLU configuration" + OFF + DEPENDS_ON ENABLE_KLU + ADVANCED) # --------------------------------------------------------------- # Enable hypre support? @@ -176,15 +208,17 @@ sundials_option(ENABLE_HYPRE BOOL "Enable hypre support" OFF) sundials_option(HYPRE_DIR PATH "Path to hypre installation" "${HYPRE_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_INCLUDE_DIR PATH "HYPRE include directory" "${HYPRE_INCLUDE_DIR}" - DEPENDS_ON ENABLE_HYPRE) +sundials_option(HYPRE_INCLUDE_DIR PATH "HYPRE include directory" + "${HYPRE_INCLUDE_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_LIBRARY_DIR PATH "HYPRE library directory" "${HYPRE_LIBRARY_DIR}" - DEPENDS_ON ENABLE_HYPRE) +sundials_option(HYPRE_LIBRARY_DIR PATH "HYPRE library directory" + "${HYPRE_LIBRARY_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_WORKS BOOL "Set to ON to force CMake to accept a given hypre configuration" OFF - DEPENDS_ON ENABLE_HYPRE - ADVANCED) +sundials_option( + HYPRE_WORKS BOOL + "Set to ON to force CMake to accept a given hypre configuration" OFF + DEPENDS_ON ENABLE_HYPRE + ADVANCED) # --------------------------------------------------------------- # Enable PETSc support? @@ -192,23 +226,29 @@ sundials_option(HYPRE_WORKS BOOL "Set to ON to force CMake to accept a given hyp sundials_option(ENABLE_PETSC BOOL "Enable PETSc support" OFF) -sundials_option(PETSC_DIR PATH "Path to the root of a PETSc installation" "${PETSC_DIR}" - DEPENDS_ON ENABLE_PETSC) +sundials_option(PETSC_DIR PATH "Path to the root of a PETSc installation" + "${PETSC_DIR}" DEPENDS_ON ENABLE_PETSC) -sundials_option(PETSC_ARCH STRING "PETSc architecture (optional)" "${PETSC_ARCH}" - DEPENDS_ON ENABLE_PETSC) +sundials_option(PETSC_ARCH STRING "PETSc architecture (optional)" + "${PETSC_ARCH}" DEPENDS_ON ENABLE_PETSC) -sundials_option(PETSC_LIBRARIES STRING "Semi-colon separated list of PETSc link libraries" "${PETSC_LIBRARIES}" - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_LIBRARIES STRING "Semi-colon separated list of PETSc link libraries" + "${PETSC_LIBRARIES}" + DEPENDS_ON ENABLE_PETSC + ADVANCED) -sundials_option(PETSC_INCLUDES STRING "Semi-colon separated list of PETSc include directories" "${PETSC_INCLUDES}" - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_INCLUDES STRING "Semi-colon separated list of PETSc include directories" + "${PETSC_INCLUDES}" + DEPENDS_ON ENABLE_PETSC + ADVANCED) -sundials_option(PETSC_WORKS BOOL "Set to ON to force CMake to accept a given PETSc configuration" OFF - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_WORKS BOOL + "Set to ON to force CMake to accept a given PETSc configuration" OFF + DEPENDS_ON ENABLE_PETSC + ADVANCED) # ------------------------------------------------------------- # Enable RAJA support? @@ -218,46 +258,56 @@ sundials_option(ENABLE_RAJA BOOL "Enable RAJA support" OFF) sundials_option(RAJA_DIR PATH "Path to root of RAJA installation" "${RAJA_DIR}" DEPENDS_ON ENABLE_RAJA) -sundials_option(SUNDIALS_RAJA_BACKENDS STRING "Which RAJA backend under the SUNDIALS RAJA interfaces (CUDA, HIP, SYCL)" "CUDA" - OPTIONS "CUDA;HIP;SYCL" - DEPENDS_ON ENABLE_RAJA) +sundials_option( + SUNDIALS_RAJA_BACKENDS STRING + "Which RAJA backend under the SUNDIALS RAJA interfaces (CUDA, HIP, SYCL)" + "CUDA" + OPTIONS "CUDA;HIP;SYCL" + DEPENDS_ON ENABLE_RAJA) # --------------------------------------------------------------- # Enable Trilinos support? # --------------------------------------------------------------- sundials_option(ENABLE_TRILINOS BOOL "Enable Trilinos support" OFF) -sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" "${Trilinos_DIR}" - DEPENDS_ON ENABLE_TRILINOS) - -sundials_option(Trilinos_INTERFACE_CXX_COMPILER STRING - "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_C_COMPILER STRING - "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING - "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING - "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_MPIEXEC STRING - "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_WORKS BOOL "Set to ON to force CMake to accept a given Trilinos configuration" OFF - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) +sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" + "${Trilinos_DIR}" DEPENDS_ON ENABLE_TRILINOS) + +sundials_option( + Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" + "${Trilinos_CXX_COMPILER}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" + "${Trilinos_C_COMPILER}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" + "${Trilinos_MPI_EXEC}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_WORKS BOOL + "Set to ON to force CMake to accept a given Trilinos configuration" OFF + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) # --------------------------------------------------------------- # Enable XBraid support? @@ -265,20 +315,26 @@ sundials_option(Trilinos_WORKS BOOL "Set to ON to force CMake to accept a given sundials_option(ENABLE_XBRAID BOOL "Enable XBraid support" OFF) -sundials_option(XBRAID_DIR PATH "Path to the root of an XBraid installation" "${XBRAID_DIR}" - DEPENDS_ON ENABLE_XBRAID) +sundials_option(XBRAID_DIR PATH "Path to the root of an XBraid installation" + "${XBRAID_DIR}" DEPENDS_ON ENABLE_XBRAID) -sundials_option(XBRAID_LIBRARIES STRING "Semi-colon separated list of XBraid link libraries" "${XBRAID_LIBRARIES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_LIBRARIES STRING "Semi-colon separated list of XBraid link libraries" + "${XBRAID_LIBRARIES}" + DEPENDS_ON ENABLE_XBRAID + ADVANCED) -sundials_option(XBRAID_INCLUDES STRING "Semi-colon separated list of XBraid include directories" "${XBRAID_INCLUDES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_INCLUDES STRING + "Semi-colon separated list of XBraid include directories" "${XBRAID_INCLUDES}" + DEPENDS_ON ENABLE_XBRAID + ADVANCED) -sundials_option(XBRAID_WORKS BOOL "Set to ON to force CMake to accept a given XBraid configuration" OFF - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_WORKS BOOL + "Set to ON to force CMake to accept a given XBraid configuration" OFF + DEPENDS_ON ENABLE_XBRAID + ADVANCED) # ------------------------------------------------------------- # Enable oneMKL support? @@ -286,22 +342,26 @@ sundials_option(XBRAID_WORKS BOOL "Set to ON to force CMake to accept a given XB sundials_option(ENABLE_ONEMKL BOOL "Enable oneMKL support" OFF) -sundials_option(ONEMKL_DIR PATH "Path to root of oneMKL installation" "${ONEMKL_DIR}" - DEPENDS_ON ENABLE_ONEMKL) +sundials_option(ONEMKL_DIR PATH "Path to root of oneMKL installation" + "${ONEMKL_DIR}" DEPENDS_ON ENABLE_ONEMKL) -sundials_option(ONEMKL_WORKS BOOL "Set to ON to force CMake to accept a given oneMKL configuration" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + ONEMKL_WORKS BOOL + "Set to ON to force CMake to accept a given oneMKL configuration" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) -sundials_option(SUNDIALS_ONEMKL_USE_GETRF_LOOP BOOL - "Replace batched getrf call with loop over getrf" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + SUNDIALS_ONEMKL_USE_GETRF_LOOP BOOL + "Replace batched getrf call with loop over getrf" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) -sundials_option(SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL - "Replace batched getrs call with loop over getrs" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL + "Replace batched getrs call with loop over getrs" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) # --------------------------------------------------------------- # Enable Caliper support? @@ -310,20 +370,24 @@ sundials_option(SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL sundials_option(ENABLE_CALIPER BOOL "Enable CALIPER support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) -sundials_option(CALIPER_DIR PATH "Path to the root of an CALIPER installation" "${CALIPER_DIR}" - DEPENDS_ON ENABLE_CALIPER) +sundials_option(CALIPER_DIR PATH "Path to the root of an CALIPER installation" + "${CALIPER_DIR}" DEPENDS_ON ENABLE_CALIPER) -sundials_option(CALIPER_WORKS BOOL "Set to ON to force CMake to accept a given CALIPER configuration" OFF - DEPENDS_ON ENABLE_CALIPER - ADVANCED) +sundials_option( + CALIPER_WORKS BOOL + "Set to ON to force CMake to accept a given CALIPER configuration" OFF + DEPENDS_ON ENABLE_CALIPER + ADVANCED) # --------------------------------------------------------------- # Enable Adiak support? # --------------------------------------------------------------- -sundials_option(ENABLE_ADIAK BOOL "Enable Adiak support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) +sundials_option(ENABLE_ADIAK BOOL "Enable Adiak support" OFF + DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) -sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" "${ADIAK_DIR}" DEPENDS_ON ENABLE_ADIAK) +sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" + "${ADIAK_DIR}" DEPENDS_ON ENABLE_ADIAK) # --------------------------------------------------------------- # Enable Kokkos support? @@ -331,11 +395,14 @@ sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" "${AD sundials_option(ENABLE_KOKKOS BOOL "Enable Kokkos support" OFF) -sundials_option(Kokkos_DIR PATH "Path to the root of a Kokkos installation" "${Kokkos_DIR}") +sundials_option(Kokkos_DIR PATH "Path to the root of a Kokkos installation" + "${Kokkos_DIR}") -sundials_option(KOKKOS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS - ADVANCED) +sundials_option( + KOKKOS_WORKS BOOL + "Set to ON to force CMake to accept a given Kokkos configuration" OFF + DEPENDS_ON ENABLE_KOKKOS + ADVANCED) # --------------------------------------------------------------- # Enable Kokkos Kernels support? @@ -343,8 +410,12 @@ sundials_option(KOKKOS_WORKS BOOL "Set to ON to force CMake to accept a given Ko sundials_option(ENABLE_KOKKOS_KERNELS BOOL "Enable Kokkos Kernels support" OFF) -sundials_option(KokkosKernels_DIR PATH "Path to the root of a Kokkos Kernels installation" "${KokkosKernels_DIR}") +sundials_option( + KokkosKernels_DIR PATH "Path to the root of a Kokkos Kernels installation" + "${KokkosKernels_DIR}") -sundials_option(KOKKOS_KERNELS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS ENABLE_KOKKOS_KERNELS - ADVANCED) +sundials_option( + KOKKOS_KERNELS_WORKS BOOL + "Set to ON to force CMake to accept a given Kokkos configuration" OFF + DEPENDS_ON ENABLE_KOKKOS ENABLE_KOKKOS_KERNELS + ADVANCED) diff --git a/cmake/macros/SundialsAddBenchmark.cmake b/cmake/macros/SundialsAddBenchmark.cmake index f3b3aec4e6..f5352f2d29 100644 --- a/cmake/macros/SundialsAddBenchmark.cmake +++ b/cmake/macros/SundialsAddBenchmark.cmake @@ -18,37 +18,41 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) # Define single value parameters the macro takes in to set up the test runner # - # NUM_CORES = number of cores (GPU count or CPU count) to run on/number of resource sets - # BENCHMARK_ARGS = arguments to pass to the executable - # IDENTIFIER = suffix to append to end of benchmark name + # NUM_CORES = number of cores (GPU count or CPU count) to run + # on/number of resource sets BENCHMARK_ARGS = arguments to pass to the + # executable IDENTIFIER = suffix to append to end of benchmark name set(oneValueArgs NUM_CORES BENCHMARK_ARGS IDENTIFIER) # TEST_RUNNER_ARGS = command line arguments to pass to the test executable - set(multiValueArgs TEST_RUNNER_ARGS ) + set(multiValueArgs TEST_RUNNER_ARGS) # ENABLE_GPU = indicate this benchmark should be run with GPUs set(options ENABLE_GPU) - cmake_parse_arguments(sundials_add_benchmark - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_benchmark "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # set the target name if(sundials_add_benchmark_IDENTIFIER) set(TARGET_NAME ${NAME}_${sundials_add_benchmark_IDENTIFIER}) else() if(sundials_add_benchmark_BENCHMARK_ARGS) - string(REPLACE " " "_" TEST_SUFFIX "${sundials_add_benchmark_BENCHMARK_ARGS}") + string(REPLACE " " "_" TEST_SUFFIX + "${sundials_add_benchmark_BENCHMARK_ARGS}") set(TARGET_NAME ${NAME}_${TEST_SUFFIX}) else() set(TARGET_NAME ${NAME}_run) endif() endif() - # Create default benchmark caliper output directory if custom directory is not defined + # Create default benchmark caliper output directory if custom directory is not + # defined if(SUNDIALS_CALIPER_OUTPUT_DIR) - set(SUNDIALS_BENCHMARK_OUTPUT_DIR ${SUNDIALS_CALIPER_OUTPUT_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) + set(SUNDIALS_BENCHMARK_OUTPUT_DIR + ${SUNDIALS_CALIPER_OUTPUT_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) else() - set(SUNDIALS_BENCHMARK_OUTPUT_DIR ${PROJECT_BINARY_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) + set(SUNDIALS_BENCHMARK_OUTPUT_DIR + ${PROJECT_BINARY_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) endif() # make the caliper output directory if it doesn't exist @@ -63,22 +67,24 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) # command line arguments for the test runner script set(TEST_RUNNER_ARGS - "--profile" - "--verbose" - "--executablename=$<TARGET_FILE:${EXECUTABLE}>" - "--outputdir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/output" - "--calidir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/${TARGET_NAME}" - "--nodiff") + "--profile" "--verbose" "--executablename=$<TARGET_FILE:${EXECUTABLE}>" + "--outputdir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/output" + "--calidir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/${TARGET_NAME}" "--nodiff") # incorporate scheduler arguments into test_runner if(SUNDIALS_SCHEDULER_COMMAND STREQUAL "flux run") set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES}") - elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun" AND ${sundials_add_benchmark_ENABLE_GPU}) - set(SCHEDULER_STRING " --smpiargs=\\\"-gpu\\\" -n${sundials_add_benchmark_NUM_CORES} -a1 -c1 -g1") + elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun" + AND ${sundials_add_benchmark_ENABLE_GPU}) + set(SCHEDULER_STRING + " --smpiargs=\\\"-gpu\\\" -n${sundials_add_benchmark_NUM_CORES} -a1 -c1 -g1" + ) elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun") set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES} -a1 -c1") elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "srun") - set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES} --cpus-per-task=1 --ntasks-per-node=1") + set(SCHEDULER_STRING + " -n${sundials_add_benchmark_NUM_CORES} --cpus-per-task=1 --ntasks-per-node=1" + ) endif() string(REPLACE " " ";" SCHEDULER_ARGS "${SCHEDULER_STRING}") string(REPLACE " " ";" SCHEDULER_COMMAND_ARGS "${SUNDIALS_SCHEDULER_COMMAND}") @@ -87,8 +93,11 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) set(RUN_COMMAND ${SCHEDULER_COMMAND_ARGS} ${SCHEDULER_ARGS}) list(APPEND TEST_RUNNER_ARGS "--runcommand=\"${RUN_COMMAND}\"") - list(APPEND TEST_RUNNER_ARGS "--runargs=${sundials_add_benchmark_BENCHMARK_ARGS}" "--testname=${TARGET_NAME}") - add_custom_target(${TARGET_NAME} + list(APPEND TEST_RUNNER_ARGS + "--runargs=${sundials_add_benchmark_BENCHMARK_ARGS}" + "--testname=${TARGET_NAME}") + add_custom_target( + ${TARGET_NAME} COMMENT "Running ${TARGET_NAME}" COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} ${TEST_RUNNER_ARGS}) add_dependencies(benchmark ${TARGET_NAME}) diff --git a/cmake/macros/SundialsAddExamplesGinkgo.cmake b/cmake/macros/SundialsAddExamplesGinkgo.cmake index 1e23dfdb58..c723f68f29 100644 --- a/cmake/macros/SundialsAddExamplesGinkgo.cmake +++ b/cmake/macros/SundialsAddExamplesGinkgo.cmake @@ -40,8 +40,8 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) set(multiValueArgs TARGETS BACKENDS) # Parse keyword arguments and options - cmake_parse_arguments(arg - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN}) foreach(example_tuple ${${EXAMPLES_VAR}}) foreach(backend ${arg_BACKENDS}) @@ -87,17 +87,13 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # directories to include - target_include_directories(${example_target} - PRIVATE - "${PROJECT_SOURCE_DIR}/examples/utilities") + target_include_directories( + ${example_target} PRIVATE "${PROJECT_SOURCE_DIR}/examples/utilities") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - ${arg_TARGETS} - sundials_${vector} - Ginkgo::ginkgo - ${EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE ${arg_TARGETS} sundials_${vector} + Ginkgo::ginkgo ${EXTRA_LINK_LIBS}) endif() @@ -105,17 +101,20 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) if("${example_args}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${example_args}) endif() # add example to regression tests if(${arg_UNIT_TEST}) - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} EXAMPLE_TYPE ${example_type} TEST_ARGS ${example_args} NODIFF) else() - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} EXAMPLE_TYPE ${example_type} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/cmake/macros/SundialsAddExecutable.cmake b/cmake/macros/SundialsAddExecutable.cmake index a2582a3485..00508c76b2 100644 --- a/cmake/macros/SundialsAddExecutable.cmake +++ b/cmake/macros/SundialsAddExecutable.cmake @@ -16,30 +16,26 @@ macro(sundials_add_nvector_benchmark NAME) - set(options ) - set(singleValueArgs ) - set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES - INSTALL_SUBDIR) + set(options) + set(singleValueArgs) + set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES INSTALL_SUBDIR) - cmake_parse_arguments(arg - "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${singleValueArgs}" + "${multiValueArgs}" ${ARGN}) set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks) - add_executable(${NAME} - ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c - ${arg_SOURCES}) + add_executable(${NAME} ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c + ${arg_SOURCES}) set_target_properties(${NAME} PROPERTIES FOLDER "Benchmarks") - target_include_directories(${NAME} PRIVATE - ${BENCHMARKS_DIR}/nvector) + target_include_directories(${NAME} PRIVATE ${BENCHMARKS_DIR}/nvector) - target_link_libraries(${NAME} PRIVATE - ${arg_SUNDIALS_TARGETS} ${arg_LINK_LIBRARIES} -lm) + target_link_libraries(${NAME} PRIVATE ${arg_SUNDIALS_TARGETS} + ${arg_LINK_LIBRARIES} -lm) install(TARGETS ${NAME} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}") endmacro(sundials_add_nvector_benchmark) - diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 199f790e66..e3d0bb893d 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -15,45 +15,49 @@ # Wraps the add_library command for sundials specific needs. # --------------------------------------------------------------- - -# The macro: -# -# SUNDIALS_ADD_LIBRARY(<target> -# SOURCES source1 source2 ... -# [HEADERS header1 header2 ...] -# [OBJECT_LIBRARIES objlib1 objlib2 ...] -# [LINK_LIBRARIES <PRIVATE|PUBLIC|INTERFACE> <item>... +# ~~~ +# sundials_add_library(<target> +# SOURCES source1 source2 ... +# [HEADERS header1 header2 ...] +# [OBJECT_LIBRARIES objlib1 objlib2 ...] +# [LINK_LIBRARIES <PRIVATE|PUBLIC|INTERFACE> <item>... +# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] +# [INCLUDE_DIRECTORIES <PRIVATE|PUBLIC|INTERFACE> <item>... +# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] +# [COMPILE_DEFINITIONS <PRIVATE|PUBLIC|INTERFACE> <item>... +# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] +# [COMPILE_OPTIONS <PRIVATE|PUBLIC|INTERFACE> <item>... +# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] +# [COMPILE_FEATURES <PRIVATE|PUBLIC|INTERFACE> <item>... # [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] -# [INCLUDE_DIRECTORIES <PRIVATE|PUBLIC|INTERFACE> <item>... -# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] -# [COMPILE_DEFINITIONS <PRIVATE|PUBLIC|INTERFACE> <item>... -# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] -# [COMPILE_OPTIONS <PRIVATE|PUBLIC|INTERFACE> <item>... -# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] -# [COMPILE_FEATURES <PRIVATE|PUBLIC|INTERFACE> <item>... -# [<PRIVATE|PUBLIC|INTERFACE> <item>...] ] -# [PROPERTIES <PROPERTY> <value> ... [<PROPERTY> <value> ...] ] -# [INCLUDE_SUBDIR] -# [OUTPUT_NAME name] -# [VERSION version] -# [SOVERSION version] -# [STATIC_ONLY | SHARED_ONLY] -# [OBJECT_LIB_ONLY]) +# [PROPERTIES <PROPERTY> <value> ... [<PROPERTY> <value> ...] ] +# [INCLUDE_SUBDIR] +# [OUTPUT_NAME name] +# [VERSION version] +# [SOVERSION version] +# [STATIC_ONLY | SHARED_ONLY] +# [OBJECT_LIB_ONLY]) +# ~~~ # -# adds libraries to be built from the source files listed in the command +# Adds libraries to be built from the source files listed in the command # invocation. It is a convenient wrapper of the CMake add_library command that # is specific to our usage of add_library in SUNDIALS. # # By default, the macro uses the CMake add_library command to create the # targets: -# - <target>${_SHARED_LIB_SUFFIX} (will be a shared library) -# - <target>${_STATIC_LIB_SUFFIX} (will be a static library) -# - <target>_obj${_SHARED_LIB_SUFFIX} (an object library that is used to -# create <target>${_SHARED_LIB_SUFFIX}) -# - <target>_obj${_STATIC_LIB_SUFFIX} (an object library that is used to -# create <target>${_STATIC_LIB_SUFFIX}) -# - <target> (an alias to the shared library, if enabled, otherwise an -# alias to the static library) +# +# * <target>${_SHARED_LIB_SUFFIX} (will be a shared library) +# +# * <target>${_STATIC_LIB_SUFFIX} (will be a static library) +# +# * <target>_obj${_SHARED_LIB_SUFFIX} (an object library that is used to create +# <target>${_SHARED_LIB_SUFFIX}) +# +# * <target>_obj${_STATIC_LIB_SUFFIX} (an object library that is used to create +# <target>${_STATIC_LIB_SUFFIX}) +# +# * <target> (an alias to the shared library, if enabled, otherwise an alias to +# the static library) # # The SOURCES input is a list of source files used to create the library. # @@ -108,17 +112,25 @@ # # The option OBJECT_LIB_ONLY will cause the macro to only create the object # library targets. + macro(sundials_add_library target) set(options STATIC_ONLY SHARED_ONLY OBJECT_LIB_ONLY) set(oneValueArgs INCLUDE_SUBDIR OUTPUT_NAME VERSION SOVERSION) - set(multiValueArgs SOURCES HEADERS OBJECT_LIBRARIES LINK_LIBRARIES - INCLUDE_DIRECTORIES COMPILE_DEFINITIONS COMPILE_OPTIONS - COMPILE_FEATURES PROPERTIES) + set(multiValueArgs + SOURCES + HEADERS + OBJECT_LIBRARIES + LINK_LIBRARIES + INCLUDE_DIRECTORIES + COMPILE_DEFINITIONS + COMPILE_OPTIONS + COMPILE_FEATURES + PROPERTIES) # parse keyword arguments/options - cmake_parse_arguments(sundials_add_library - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_library "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # library types to create set(_libtypes "") @@ -150,14 +162,15 @@ macro(sundials_add_library target) # -------------------------------------------------------------------------- # create the target for the object library - add_library(${obj_target} OBJECT ${sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) + add_library(${obj_target} OBJECT ${sources} + ${sundials_add_library_UNPARSED_ARGUMENTS}) set_target_properties(${obj_target} PROPERTIES FOLDER "obj") # add all object libraries to object library if(sundials_add_library_OBJECT_LIBRARIES) target_link_libraries(${obj_target} - PRIVATE ${sundials_add_library_OBJECT_LIBRARIES}) + PRIVATE ${sundials_add_library_OBJECT_LIBRARIES}) endif() # add all link libraries to object library @@ -173,9 +186,11 @@ macro(sundials_add_library target) else() set(_all_libs ${sundials_add_library_LINK_LIBRARIES}) endif() - # Due to various issues in CMake, particularly https://gitlab.kitware.com/cmake/cmake/-/issues/25365, - # we create a fake custom target to enforce a build order. Without this, parallel builds - # might fail with an error about a missing '.mod' file when Fortran is enabled (see GitHub #410). + # Due to various issues in CMake, particularly + # https://gitlab.kitware.com/cmake/cmake/-/issues/25365, we create a fake + # custom target to enforce a build order. Without this, parallel builds + # might fail with an error about a missing '.mod' file when Fortran is + # enabled (see GitHub #410). set(_stripped_all_libs ${_all_libs}) list(FILTER _stripped_all_libs EXCLUDE REGEX "PUBLIC|INTERFACE|PRIVATE") foreach(_item ${_stripped_all_libs}) @@ -184,7 +199,8 @@ macro(sundials_add_library target) endif() endforeach() add_custom_target(fake_to_force_build_order_${obj_target}) - add_dependencies(fake_to_force_build_order_${obj_target} ${_stripped_all_libs}) + add_dependencies(fake_to_force_build_order_${obj_target} + ${_stripped_all_libs}) add_dependencies(${obj_target} fake_to_force_build_order_${obj_target}) target_link_libraries(${obj_target} ${_all_libs}) endif() @@ -194,20 +210,21 @@ macro(sundials_add_library target) target_link_libraries(${obj_target} PUBLIC caliper) endif() if(ENABLE_ADIAK) - target_link_libraries(${obj_target} PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) + target_link_libraries(${obj_target} PUBLIC adiak::adiak + ${CMAKE_DL_LIBS}) endif() endif() # add includes to object library - target_include_directories(${obj_target} - PUBLIC - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/sundials> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src/sundials> - ) + target_include_directories( + ${obj_target} + PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/sundials> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src/sundials>) if(sundials_add_library_INCLUDE_DIRECTORIES) - string(REPLACE "{{libtype}}" "${_libtype}" _includes "${sundials_add_library_INCLUDE_DIRECTORIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _includes + "${sundials_add_library_INCLUDE_DIRECTORIES}") target_include_directories(${obj_target} ${_includes}) endif() @@ -220,25 +237,30 @@ macro(sundials_add_library target) # add all other compile definitions to object library if(sundials_add_library_COMPILE_DEFINITIONS) - target_compile_definitions(${obj_target} ${sundials_add_library_COMPILE_DEFINITIONS}) + target_compile_definitions(${obj_target} + ${sundials_add_library_COMPILE_DEFINITIONS}) endif() # add compile options to object library if(sundials_add_library_COMPILE_OPTIONS) - target_compile_options(${obj_target} ${sundials_add_library_COMPILE_OPTIONS}) + target_compile_options(${obj_target} + ${sundials_add_library_COMPILE_OPTIONS}) endif() # add compile features if(sundials_add_library_COMPILE_FEATURES) - target_compile_features(${obj_target} ${sundials_add_library_COMPILE_FEATURES}) + target_compile_features(${obj_target} + ${sundials_add_library_COMPILE_FEATURES}) endif() # object files going into shared libs need PIC code - set_target_properties(${obj_target} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + set_target_properties(${obj_target} PROPERTIES POSITION_INDEPENDENT_CODE + TRUE) # set any other properties if(sundials_add_library_PROPERTIES) - string(REPLACE "{{libtype}}" "${_libtype}" _properties "${sundials_add_library_PROPERTIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _properties + "${sundials_add_library_PROPERTIES}") set_target_properties(${obj_target} PROPERTIES ${_properties}) endif() @@ -264,19 +286,24 @@ macro(sundials_add_library target) endforeach() endif() - add_library(${_actual_target_name} ${_libtype} ${_object_sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) + add_library( + ${_actual_target_name} ${_libtype} ${_object_sources} + ${sundials_add_library_UNPARSED_ARGUMENTS}) set_target_properties(${_actual_target_name} PROPERTIES FOLDER "src") # add all link libraries if(SUNDIALS_MATH_LIBRARY) - target_link_libraries(${_actual_target_name} PRIVATE "${SUNDIALS_MATH_LIBRARY}") + target_link_libraries(${_actual_target_name} + PRIVATE "${SUNDIALS_MATH_LIBRARY}") endif() if(SUNDIALS_RT_LIBRARY) - target_link_libraries(${_actual_target_name} PRIVATE "${SUNDIALS_RT_LIBRARY}") + target_link_libraries(${_actual_target_name} + PRIVATE "${SUNDIALS_RT_LIBRARY}") endif() if(sundials_add_library_LINK_LIBRARIES) - target_link_libraries(${_actual_target_name} ${sundials_add_library_LINK_LIBRARIES}) + target_link_libraries(${_actual_target_name} + ${sundials_add_library_LINK_LIBRARIES}) endif() if(SUNDIALS_BUILD_WITH_PROFILING) @@ -284,90 +311,103 @@ macro(sundials_add_library target) target_link_libraries(${_actual_target_name} PUBLIC caliper) endif() if(ENABLE_ADIAK) - target_link_libraries(${_actual_target_name} PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) + target_link_libraries(${_actual_target_name} PUBLIC adiak::adiak + ${CMAKE_DL_LIBS}) endif() endif() # add common includes + # # Building: public, config/export generated, and shared private headers + # # Installing: installed include directory - target_include_directories(${_actual_target_name} PUBLIC - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/sundials> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + target_include_directories( + ${_actual_target_name} + PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/sundials> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) # add all other includes if(sundials_add_library_INCLUDE_DIRECTORIES) - string(REPLACE "{{libtype}}" "${_libtype}" _includes "${sundials_add_library_INCLUDE_DIRECTORIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _includes + "${sundials_add_library_INCLUDE_DIRECTORIES}") target_include_directories(${_actual_target_name} ${_includes}) endif() # add compile definitions for SUNDIALS_EXPORT if(${_libtype} MATCHES "STATIC") - target_compile_definitions(${_actual_target_name} PUBLIC SUNDIALS_STATIC_DEFINE) + target_compile_definitions(${_actual_target_name} + PUBLIC SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() # add all other compile definitions if(sundials_add_library_COMPILE_DEFINITIONS) - target_compile_definitions(${_actual_target_name} ${sundials_add_library_COMPILE_DEFINITIONS}) + target_compile_definitions(${_actual_target_name} + ${sundials_add_library_COMPILE_DEFINITIONS}) endif() # add all compile options if(sundials_add_library_COMPILE_OPTIONS) - target_compile_options(${_actual_target_name} ${sundials_add_library_COMPILE_OPTIONS}) + target_compile_options(${_actual_target_name} + ${sundials_add_library_COMPILE_OPTIONS}) endif() # add compile features if(sundials_add_library_COMPILE_FEATURES) - target_compile_features(${_actual_target_name} ${sundials_add_library_COMPILE_FEATURES}) + target_compile_features(${_actual_target_name} + ${sundials_add_library_COMPILE_FEATURES}) endif() - # exported targets are in the SUNDIALS:: namespace, so we remove the sundials_ prefix from the exported name + # exported targets are in the SUNDIALS:: namespace, so we remove the + # sundials_ prefix from the exported name string(REPLACE "sundials_" "" _export_name "${_actual_target_name}") - set_target_properties(${_actual_target_name} PROPERTIES EXPORT_NAME ${_export_name}) + set_target_properties(${_actual_target_name} PROPERTIES EXPORT_NAME + ${_export_name}) - # create an alias to match the exported target name, this way another projects can use it with either find_package() or add_subdirectory() + # create an alias to match the exported target name, this way another + # projects can use it with either find_package() or add_subdirectory() add_library(SUNDIALS::${_export_name} ALIAS ${_actual_target_name}) # set the correct output name if(sundials_add_library_OUTPUT_NAME) - if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) AND ${_libtype} MATCHES "STATIC") - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static" - CLEAN_DIRECT_OUTPUT 1 - ) + if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + AND ${_libtype} MATCHES "STATIC") + set_target_properties( + ${_actual_target_name} + PROPERTIES OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static" + CLEAN_DIRECT_OUTPUT 1) else() - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} - CLEAN_DIRECT_OUTPUT 1 - ) + set_target_properties( + ${_actual_target_name} + PROPERTIES OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} + CLEAN_DIRECT_OUTPUT 1) endif() else() - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${target} - CLEAN_DIRECT_OUTPUT 1 - ) + set_target_properties( + ${_actual_target_name} PROPERTIES OUTPUT_NAME ${target} + CLEAN_DIRECT_OUTPUT 1) endif() # set the library versions if(sundials_add_library_VERSION) - set_target_properties(${_actual_target_name} PROPERTIES - VERSION ${sundials_add_library_VERSION} - ) + set_target_properties( + ${_actual_target_name} PROPERTIES VERSION + ${sundials_add_library_VERSION}) endif() if(sundials_add_library_SOVERSION) - set_target_properties(${_actual_target_name} PROPERTIES - SOVERSION ${sundials_add_library_SOVERSION} - ) + set_target_properties( + ${_actual_target_name} PROPERTIES SOVERSION + ${sundials_add_library_SOVERSION}) endif() # set any other properties if(sundials_add_library_PROPERTIES) - string(REPLACE "{{libtype}}" "${_libtype}" _properties "${sundials_add_library_PROPERTIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _properties + "${sundials_add_library_PROPERTIES}") set_target_properties(${_actual_target_name} PROPERTIES ${_properties}) endif() @@ -383,8 +423,10 @@ macro(sundials_add_library target) # -------------------------------------------------------------------------- if(sundials_add_library_HEADERS) - install(FILES ${sundials_add_library_HEADERS} - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${sundials_add_library_INCLUDE_SUBDIR}") + install( + FILES ${sundials_add_library_HEADERS} + DESTINATION + "${CMAKE_INSTALL_INCLUDEDIR}/${sundials_add_library_INCLUDE_SUBDIR}") endif() # -------------------------------------------------------------------------- @@ -395,21 +437,27 @@ macro(sundials_add_library target) add_library(${target}_obj ALIAS ${target}_obj${_SHARED_LIB_SUFFIX}) if(NOT sundials_add_library_OBJECT_LIB_ONLY) add_library(${target} ALIAS ${target}${_SHARED_LIB_SUFFIX}) - set(_SUNDIALS_ALIAS_TARGETS "${target}->${target}${_SHARED_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_ALIAS_TARGETS + "${target}->${target}${_SHARED_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" + CACHE INTERNAL "" FORCE) # Namespaced alias for using build directory directly string(REPLACE "sundials_" "" _export_name "${target}") - add_library(SUNDIALS::${_export_name} ALIAS ${target}${_SHARED_LIB_SUFFIX}) + add_library(SUNDIALS::${_export_name} ALIAS + ${target}${_SHARED_LIB_SUFFIX}) endif() else() add_library(${target}_obj ALIAS ${target}_obj${_STATIC_LIB_SUFFIX}) if(NOT sundials_add_library_OBJECT_LIB_ONLY) add_library(${target} ALIAS ${target}${_STATIC_LIB_SUFFIX}) - set(_SUNDIALS_ALIAS_TARGETS "${target}->${target}${_STATIC_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_ALIAS_TARGETS + "${target}->${target}${_STATIC_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" + CACHE INTERNAL "" FORCE) # Namespaced alias for using build directory directly string(REPLACE "sundials_" "" _export_name "${target}") - add_library(SUNDIALS::${_export_name} ALIAS ${target}${_STATIC_LIB_SUFFIX}) + add_library(SUNDIALS::${_export_name} ALIAS + ${target}${_STATIC_LIB_SUFFIX}) endif() endif() @@ -419,40 +467,45 @@ macro(sundials_add_library target) if(NOT sundials_add_library_OBJECT_LIB_ONLY) string(REPLACE "sundials_" "" _comp_name "${target}") - set(_SUNDIALS_INSTALLED_COMPONENTS "${_comp_name};${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "${_comp_name};${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() endmacro(sundials_add_library) - macro(sundials_add_f2003_library target) - set(options ) + set(options) set(oneValueArgs OUTPUT_NAME VERSION SOVERSION) - set(multiValueArgs SOURCES OBJECT_LIBRARIES LINK_LIBRARIES INCLUDE_DIRECTORIES - COMPILE_DEFINITIONS COMPILE_OPTIONS PROPERTIES) + set(multiValueArgs + SOURCES + OBJECT_LIBRARIES + LINK_LIBRARIES + INCLUDE_DIRECTORIES + COMPILE_DEFINITIONS + COMPILE_OPTIONS + PROPERTIES) # parse keyword arguments/options - cmake_parse_arguments(sundials_add_f2003_library - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_f2003_library "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(CMAKE_Fortran_MODULE_DIRECTORY) set(_includes - PUBLIC - $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> - $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}> - ) - set(_properties PROPERTIES - Fortran_MODULE_DIRECTORY "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}" + PUBLIC $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> + $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}>) + set(_properties + PROPERTIES Fortran_MODULE_DIRECTORY + "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}" WINDOWS_EXPORT_ALL_SYMBOLS ON) else() set(_includes - PUBLIC - $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> - $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}> - ) - set(_properties PROPERTIES - Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir" + PUBLIC $<BUILD_INTERFACE:${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}> + $<INSTALL_INTERFACE:${Fortran_INSTALL_MODDIR}>) + set(_properties + PROPERTIES Fortran_MODULE_DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir" WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() @@ -462,30 +515,27 @@ macro(sundials_add_f2003_library target) if(TARGET ${_clib_name}) set(_clib_target ${_clib_name}) else() - set(_clib_target ) + set(_clib_target) endif() - sundials_add_library(${target} + sundials_add_library( + ${target} SOURCES ${sundials_add_f2003_library_SOURCES} OBJECT_LIBRARIES ${sundials_add_f2003_library_OBJECT_LIBRARIES} - LINK_LIBRARIES - PUBLIC ${_clib_target} # depend on the c library - ${sundials_add_f2003_library_LINK_LIBRARIES} - INCLUDE_DIRECTORIES - ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} - ${_includes} - COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} - PUBLIC "SUNDIALS_INT${SUNDIALS_INDEX_SIZE}_T" + LINK_LIBRARIES PUBLIC ${_clib_target} # depend on the c library + ${sundials_add_f2003_library_LINK_LIBRARIES} + INCLUDE_DIRECTORIES ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} + ${_includes} + COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} PUBLIC + "SUNDIALS_INT${SUNDIALS_INDEX_SIZE}_T" COMPILE_OPTIONS ${sundials_add_f2003_library_COMPILE_OPTIONS} PROPERTIES ${sundials_add_f2003_library_PROPERTIES} ${_properties} OUTPUT_NAME ${sundials_add_f2003_library_OUTPUT_NAME} VERSION ${sundials_add_f2003_library_VERSION} SOVERSION ${sundials_add_f2003_library_SOVERSION} - ${sundials_add_f2003_library_UNPARSED_ARGUMENTS} - ) + ${sundials_add_f2003_library_UNPARSED_ARGUMENTS}) endmacro() - macro(append_static_suffix libs_in libs_out) set(${libs_out} "") foreach(_lib ${${libs_in}}) diff --git a/cmake/macros/SundialsAddTest.cmake b/cmake/macros/SundialsAddTest.cmake index 33eb8d7fa1..a1eb373b67 100644 --- a/cmake/macros/SundialsAddTest.cmake +++ b/cmake/macros/SundialsAddTest.cmake @@ -11,12 +11,40 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# -# SUNDIALS_ADD_TEST(<test name> <executable>) + +# ~~~ +# sundials_add_test(<test name> <executable> +# [NODIFF] +# [MPI_NPROCS num_processes] +# [FLOAT_PRECISION num_digits] +# [INTEGER_PRECISION percent_difference] +# [ANSWER_DIR path] +# [ANSWER_FIEL file] +# [EXAMPLE_TYPE type] +# [TEST_ARGS arg1 arg2 ...]) +# ~~~ # # CMake macro to add a SUNDIALS regression test. Keyword input arguments can be -# added after <executable> to set regression test options (see oneValueArgs and -# multiValueArgs below). +# added after <executable> to set regression test options. +# +# The option NODIFF disables comparison of the test output against the answer +# file +# +# The option MPI_NPROCS sets the number of mpi tasks to use in parallel tests +# +# The option FLOAT_PRECISION set the precision (number of digits) for floating +# point failure comparisons. To use the default value, either don't provide the +# keyword, or provide the value "default". +# +# The option INTEGER_PRECISION sets the integer percentage difference for +# failure comparison. +# +# The option ANSWER_DIR sets the path to the directory containing the test +# answer file +# +# The option ANSWER_FILE set the name of test answer file +# +# The option EXAMPLE_TYPE set the example type i.e., release or develop examples # # When SUNDIALS_TEST_DEVTESTS is OFF (default) the executable is run and success # or failure is determined by the executable return value (zero or non-zero @@ -32,56 +60,44 @@ # for all tests with the cache variables SUNDIALS_TEST_FLOAT_PRECISION and # SUNDIALS_TEST_INTEGER_PRECISION. # -# -D SUNDIALS_TEST_FLOAT_PRECISION=<number of digits> -# -D SUNDIALS_TEST_INTEGER_PRECISION=<% difference> +# -D SUNDIALS_TEST_FLOAT_PRECISION=<number of digits> +# +# -D SUNDIALS_TEST_INTEGER_PRECISION=<% difference> # # By default testing output is written to builddir/Testing/output and the .out # answer file directory is set using the ANSWER_DIR keyword input to # sourcedir/examples/package/testdir. These can be changed by setting the cache # variables SUNDIALS_TEST_OUTPUT_DIR and SUNDIALS_TEST_ANSWER_DIR. # -# -D SUNDIALS_TEST_OUTPUT_DIR=<path to output directory> -# -D SUNDIALS_TEST_ANSWER_DIR=<path to answer directory> +# -D SUNDIALS_TEST_OUTPUT_DIR=<path to output directory> +# +# -D SUNDIALS_TEST_ANSWER_DIR=<path to answer directory> # # By default the caliper output is written to builddir/Caliper. This can be # changed by setting the cache variable SUNDIALS_CALIPER_OUTPUT_DIR. # # -D SUNDIALS_CALIPER_OUTPUT_DIR=<path to caliper output directory> -# -# ------------------------------------------------------------------------------ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) - # macro options - # NODIFF = do not diff the test output against an answer file set(options "NODIFF") - - # macro keyword inputs followed by a single value - # MPI_NPROCS = number of mpi tasks to use in parallel tests - # FLOAT_PRECISION = precision for floating point failure comparision (num digits), - # to use the default, either don't provide the keyword, or - # provide the value "default" - # INTEGER_PRECISION = integer percentage difference for failure comparison - # ANSWER_DIR = path to the directory containing the test answer file - # ANSWER_FILE = name of test answer file - # EXAMPLE_TYPE = release or develop examples set(oneValueArgs "MPI_NPROCS" "FLOAT_PRECISION" "INTEGER_PRECISION" - "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE") - - # macro keyword inputs followed by multiple values - # TEST_ARGS = command line arguments to pass to the test executable + "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE") set(multiValueArgs "TEST_ARGS" "EXTRA_ARGS") # parse inputs and create variables SUNDIALS_ADD_TEST_<keyword> - cmake_parse_arguments(SUNDIALS_ADD_TEST - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(SUNDIALS_ADD_TEST "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # check that the test is not excluded string(TOLOWER "exclude-${SUNDIALS_PRECISION}" _exclude_precision) - if( ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL "exclude") OR - ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL _exclude_precision) ) + if(("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL "exclude") + OR ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL _exclude_precision)) - message(STATUS "Skipped test ${NAME} because it had type ${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}") + message( + STATUS + "Skipped test ${NAME} because it had type ${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" + ) else() @@ -90,16 +106,14 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) # run all tests (standard and develop) with the test runner # command line arguments for the test runner script - set(TEST_ARGS - "--verbose" - "--testname=${NAME}" - "--executablename=$<TARGET_FILE:${EXECUTABLE}>" - ) + set(TEST_ARGS "--verbose" "--testname=${NAME}" + "--executablename=$<TARGET_FILE:${EXECUTABLE}>") if(SUNDIALS_TEST_PROFILE) list(APPEND TEST_ARGS "--profile") - if (SUNDIALS_CALIPER_OUTPUT_DIR) - list(APPEND TEST_ARGS "--calidir=${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}") + if(SUNDIALS_CALIPER_OUTPUT_DIR) + list(APPEND TEST_ARGS + "--calidir=${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}") else() list(APPEND TEST_ARGS "--calidir=${TEST_OUTPUT_DIR}/Caliper/Example") endif() @@ -129,28 +143,40 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) # do not diff the output and answer files list(APPEND TEST_ARGS "--nodiff") else() - # set a non-default floating point precision (number of digits, default 4) - if(SUNDIALS_ADD_TEST_FLOAT_PRECISION AND - (NOT SUNDIALS_ADD_TEST_FLOAT_PRECISION MATCHES "DEFAULT|default")) - list(APPEND TEST_ARGS "--floatprecision=${SUNDIALS_ADD_TEST_FLOAT_PRECISION}") + # set a non-default floating point precision (number of digits, default + # 4) + if(SUNDIALS_ADD_TEST_FLOAT_PRECISION + AND (NOT SUNDIALS_ADD_TEST_FLOAT_PRECISION MATCHES "DEFAULT|default" + )) + list(APPEND TEST_ARGS + "--floatprecision=${SUNDIALS_ADD_TEST_FLOAT_PRECISION}") elseif(SUNDIALS_TEST_FLOAT_PRECISION GREATER_EQUAL "0") - list(APPEND TEST_ARGS "--floatprecision=${SUNDIALS_TEST_FLOAT_PRECISION}") + list(APPEND TEST_ARGS + "--floatprecision=${SUNDIALS_TEST_FLOAT_PRECISION}") endif() # set a non-default integer precision (percent difference, default 10%) - if(SUNDIALS_ADD_TEST_INTEGER_PRECISION AND - (NOT SUNDIALS_ADD_TEST_INTEGER_PRECISION MATCHES "DEFAULT|default")) - list(APPEND TEST_ARGS "--integerpercentage=${SUNDIALS_ADD_TEST_INTEGER_PRECISION}") + if(SUNDIALS_ADD_TEST_INTEGER_PRECISION + AND (NOT SUNDIALS_ADD_TEST_INTEGER_PRECISION MATCHES + "DEFAULT|default")) + list(APPEND TEST_ARGS + "--integerpercentage=${SUNDIALS_ADD_TEST_INTEGER_PRECISION}") elseif(SUNDIALS_TEST_INTEGER_PRECISION GREATER_EQUAL "0") - list(APPEND TEST_ARGS "--integerpercentage=${SUNDIALS_TEST_INTEGER_PRECISION}") + list(APPEND TEST_ARGS + "--integerpercentage=${SUNDIALS_TEST_INTEGER_PRECISION}") endif() endif() # check if this test is run with MPI and set the MPI run command - if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) OR (SUNDIALS_TEST_MPIRUN_COMMAND))) - if (SUNDIALS_TEST_MPIRUN_COMMAND) - set(RUN_COMMAND "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}") + if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) + OR (SUNDIALS_TEST_MPIRUN_COMMAND))) + if(SUNDIALS_TEST_MPIRUN_COMMAND) + set(RUN_COMMAND + "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" + ) elseif(MPIEXEC_EXECUTABLE) - set(RUN_COMMAND "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}") + set(RUN_COMMAND + "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" + ) endif() # remove trailing white space (empty MPIEXEC_PREFLAGS) as it can cause @@ -170,19 +196,22 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) set(_run_args "${_run_args} ${_extra_args}") unset(_extra_args) endif() - if (_run_args) + if(_run_args) string(STRIP "${_run_args}" _run_args) list(APPEND TEST_ARGS "--runargs=\"${_run_args}\"") unset(_run_args) endif() - # create test case with the corresponding test runner command and arguments - # all tests are added during development and only unlabeled tests when released - add_test(NAME ${NAME} COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} ${TEST_ARGS}) + # create test case with the corresponding test runner command and + # arguments all tests are added during development and only unlabeled + # tests when released + add_test(NAME ${NAME} COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} + ${TEST_ARGS}) elseif(NOT SUNDIALS_ADD_TEST_EXAMPLE_TYPE) - # if a test type was not set then it is a standard test that returns pass/fail + # if a test type was not set then it is a standard test that returns + # pass/fail # convert string to list if(SUNDIALS_ADD_TEST_TEST_ARGS) @@ -190,15 +219,27 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) endif() # check if this test is run with MPI and add the test run command - if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) OR (SUNDIALS_TEST_MPIRUN_COMMAND))) + if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) + OR (SUNDIALS_TEST_MPIRUN_COMMAND))) if(MPIEXEC_PREFLAGS) string(REPLACE " " ";" PREFLAGS "${MPIEXEC_PREFLAGS}") endif() - if (SUNDIALS_TEST_MPIRUN_COMMAND) - string(REPLACE " " ";" MPI_EXEC_ARGS "${SUNDIALS_TEST_MPIRUN_COMMAND}") - add_test(NAME ${NAME} COMMAND ${MPI_EXEC_ARGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) + if(SUNDIALS_TEST_MPIRUN_COMMAND) + string(REPLACE " " ";" MPI_EXEC_ARGS + "${SUNDIALS_TEST_MPIRUN_COMMAND}") + add_test( + NAME ${NAME} + COMMAND + ${MPI_EXEC_ARGS} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} + $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) else() - add_test(NAME ${NAME} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) + add_test( + NAME ${NAME} + COMMAND + ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} + $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) endif() else() add_test(NAME ${NAME} COMMAND $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) diff --git a/cmake/macros/SundialsAddTestInstall.cmake b/cmake/macros/SundialsAddTestInstall.cmake index cf2a6fb76b..159fc54cd6 100644 --- a/cmake/macros/SundialsAddTestInstall.cmake +++ b/cmake/macros/SundialsAddTestInstall.cmake @@ -11,31 +11,30 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# -# SUNDIALS_ADD_TEST_INSTALL(<package name> <test dir>) + +# ~~~ +# sundials_add_test_install(<package name> <test dir> +# EXECUTABLE exec) +# ~~~ # # CMake macro to add a Sundials installation smoke tests. -# --------------------------------------------------------------- +# +# The input <package name> is the SUNDIALS package name e.g., cvode, arkode, +# etc. +# +# The input <test dir> is the test directory name e.g., serial, C_parallel, etc. +# +# The input EXECUTABLE is the executable to add to make test_install target macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) - # required macro args - # PACKAGE = Sundials package name (e.g., cvode, arkode, etc.) - # TESTDIR = Test directory name (e.g., serial, C_parallel, etc.) - - # macro options - set(options ) - - # macro keyword inputs followed by a single value - # EXECUTABLE = executable to add to make test_install target + set(options) set(oneValueArgs EXECUTABLE) - - # macro keyword inputs followed by multiple values - set(multiValueArgs ) + set(multiValueArgs) # parse inputs and create variables SUNDIALS_ADD_TEST_<keyword> - cmake_parse_arguments(SUNDIALS_ADD_TEST_INSTALL - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(SUNDIALS_ADD_TEST_INSTALL "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE) @@ -45,22 +44,26 @@ macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) endif() # build and run only the desired install test - add_custom_target(test_install_${PACKAGE}_${TESTDIR} + add_custom_target( + test_install_${PACKAGE}_${TESTDIR} COMMENT "Running ${PACKAGE} installation tests" WORKING_DIRECTORY ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} VERBATIM - COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > cmake.out - COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} --target ${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE} > make.out - COMMAND ${CMAKE_CTEST_COMMAND} -R ^${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE}$) + COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > + cmake.out + COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} + --target ${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE} > make.out + COMMAND ${CMAKE_CTEST_COMMAND} -R + ^${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE}$) # make test_install depend on test_install_package add_dependencies(test_install test_install_${PACKAGE}_${TESTDIR}) endif() - # Possible extensions: - # * Make EXECUTABLE a multiple value option to add several tests to test_install - # * Make test_install_all only available when development tests are turned on + # Possible extensions: * Make EXECUTABLE a multiple value option to add + # several tests to test_install * Make test_install_all only available when + # development tests are turned on # create testing directory if necessary if(NOT EXISTS ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR}) @@ -68,12 +71,15 @@ macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) endif() # build and run all install tests - add_custom_target(test_install_all_${PACKAGE}_${TESTDIR} + add_custom_target( + test_install_all_${PACKAGE}_${TESTDIR} COMMENT "Running ${PACKAGE} installation tests" WORKING_DIRECTORY ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} VERBATIM - COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > cmake.out - COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} > make.out) + COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > + cmake.out + COMMAND ${CMAKE_COMMAND} --build + ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} > make.out) # In the future add "COMMAND ${CMAKE_CTEST_COMMAND}" here to run ctest with # the installed examples. Left out for now as some MPI tests require running # with a specific number of MPI tasks. diff --git a/cmake/macros/SundialsCMakeMacros.cmake b/cmake/macros/SundialsCMakeMacros.cmake index 20d101c834..513ada4288 100644 --- a/cmake/macros/SundialsCMakeMacros.cmake +++ b/cmake/macros/SundialsCMakeMacros.cmake @@ -19,13 +19,15 @@ # show variable (set as cache) and overwrite (force) its value macro(FORCE_VARIABLE var type doc val) - set(${var} "${val}" CACHE "${type}" "${doc}" FORCE) + set(${var} + "${val}" + CACHE "${type}" "${doc}" FORCE) endmacro(FORCE_VARIABLE) # Macros to append a common suffix or prefix to the elements of a list macro(ADD_SUFFIX rootlist suffix) - set(outlist ) + set(outlist) foreach(root ${${rootlist}}) list(APPEND outlist ${root}${suffix}) endforeach(root) @@ -33,20 +35,20 @@ macro(ADD_SUFFIX rootlist suffix) endmacro(ADD_SUFFIX) macro(ADD_PREFIX prefix rootlist) - set(outlist ) + set(outlist) foreach(root ${${rootlist}}) list(APPEND outlist ${prefix}${root}) endforeach(root) set(${rootlist} ${outlist}) endmacro(ADD_PREFIX) -# Returns an unquoted string. Note that CMake will readily turn such -# strings back into lists, due to the duality of lists and -# semicolon-separated strings. So be careful how you use it. +# Returns an unquoted string. Note that CMake will readily turn such strings +# back into lists, due to the duality of lists and semicolon-separated strings. +# So be careful how you use it. macro(LIST2STRING alist astring) foreach(elem ${${alist}}) - set(${astring} "${${astring}} ${elem}") + set(${astring} "${${astring}} ${elem}") endforeach(elem) endmacro(LIST2STRING) @@ -70,13 +72,16 @@ function(sundials_git_version) set(_tmp "") if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/.git AND ${GIT_FOUND}) - execute_process(COMMAND git describe --abbrev=12 --dirty --always --tags - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE _tmp) + execute_process( + COMMAND git describe --abbrev=12 --dirty --always --tags + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE _tmp) string(STRIP "${_tmp}" _tmp) endif() - set(SUNDIALS_GIT_VERSION "${_tmp}" CACHE INTERNAL "") + set(SUNDIALS_GIT_VERSION + "${_tmp}" + CACHE INTERNAL "") unset(_tmp) endfunction() diff --git a/cmake/macros/SundialsInstallExamples.cmake b/cmake/macros/SundialsInstallExamples.cmake index 7f40b7af6e..471c18e0a5 100644 --- a/cmake/macros/SundialsInstallExamples.cmake +++ b/cmake/macros/SundialsInstallExamples.cmake @@ -14,21 +14,20 @@ # CMake macro for installing examples. # ------------------------------------------------------------------------------ -# The macro: -# -# SUNDIALS_INSTALL_EXAMPLES(<MODULE> <EXAMPLES_VAR> -# DESTINATION path -# CMAKE_TEMPLATE name -# [MAKE_TEMPLATE name [SOLVER_LIBRARY target]] -# [SUNDIALS_COMPONENTS components] -# [SUNDIALS_TARGETS targets] -# [DEPENDENCIES files] -# [TEST_INSTALL target] -# [EXTRA_FILES files] -# [EXTRA_INCLUDES includes] -# ) -# -# adds an install target for examples in EXAMPLES_VAR that go with MODULE (e.g. +# ~~~ +# sundials_install_examples(<MODULE> <EXAMPLES_VAR> +# DESTINATION path +# CMAKE_TEMPLATE name +# [MAKE_TEMPLATE name [SOLVER_LIBRARY target]] +# [SUNDIALS_COMPONENTS components] +# [SUNDIALS_TARGETS targets] +# [DEPENDENCIES files] +# [TEST_INSTALL target] +# [EXTRA_FILES files] +# [EXTRA_INCLUDES includes]) +# ~~~ +# +# Adds an install target for examples in EXAMPLES_VAR that go with MODULE (e.g. # arkode, nvecserial). # # The DESTINATION option is the path *within* EXAMPLES_INSTALL_PATH that the @@ -68,39 +67,45 @@ # # The EXTRA_INCLUDES option is a list of additional includes to set with # INCLUDE_DIRECTORIES. -# ------------------------------------------------------------------------------ macro(sundials_install_examples MODULE EXAMPLES_VAR) - set(options ) + set(options) set(oneValueArgs SOLVER_LIBRARY DESTINATION CMAKE_TEMPLATE MAKE_TEMPLATE - TEST_INSTALL) + TEST_INSTALL) set(multiValueArgs SUNDIALS_TARGETS SUNDIALS_COMPONENTS OTHER_TARGETS - EXAMPLES_DEPENDENCIES EXTRA_FILES EXTRA_INCLUDES) + EXAMPLES_DEPENDENCIES EXTRA_FILES EXTRA_INCLUDES) # Parse keyword arguments/options - cmake_parse_arguments(sundials_install_examples - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_install_examples "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # Install the extra files foreach(file ${sundials_install_examples_EXTRA_FILES}) - install(FILES ${file} DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) + install( + FILES ${file} + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) endforeach() # Install the examples foreach(example_tuple ${${EXAMPLES_VAR}}) - list(GET example_tuple 0 example) # filename always has to be the first item in the example tuple + list(GET example_tuple 0 example) # filename always has to be the first item + # in the example tuple get_filename_component(example_noext ${example} NAME_WE) file(GLOB example_header ${example_noext}.h*) file(GLOB example_out ${example_noext}*.out) - install(FILES ${example} ${example_header} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) + install( + FILES ${example} ${example_header} ${example_out} + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates string(TOUPPER "${MODULE}" SOLVER) set(SOLVER_LIB "${sundials_install_examples_SOLVER_LIBRARY}") - set(EXAMPLES_DEPENDENCIES "${sundials_install_examples_EXAMPLES_DEPENDENCIES}") + set(EXAMPLES_DEPENDENCIES + "${sundials_install_examples_EXAMPLES_DEPENDENCIES}") set(EXTRA_INCLUDES "${sundials_install_examples_EXTRA_INCLUDES}") examples2string(${EXAMPLES_VAR} EXAMPLES) @@ -129,43 +134,44 @@ macro(sundials_install_examples MODULE EXAMPLES_VAR) list2string(libs_list EXAMPLES_MAKEFILE_LIBS) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used as + # a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/${sundials_install_examples_CMAKE_TEMPLATE} ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} - ) + FILES + ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX AND (DEFINED sundials_install_examples_MAKE_TEMPLATE)) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/${sundials_install_examples_MAKE_TEMPLATE} ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( - FILES ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} - RENAME Makefile - ) + FILES + ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} + RENAME Makefile) endif() # Add test_install target if(DEFINED sundials_install_examples_TEST_INSTALL) - sundials_add_test_install(${MODULE} ${sundials_install_examples_TEST_INSTALL}) + sundials_add_test_install(${MODULE} + ${sundials_install_examples_TEST_INSTALL}) endif() endmacro() diff --git a/cmake/macros/SundialsInstallExamplesGinkgo.cmake b/cmake/macros/SundialsInstallExamplesGinkgo.cmake index 05427f2051..6d89b13875 100644 --- a/cmake/macros/SundialsInstallExamplesGinkgo.cmake +++ b/cmake/macros/SundialsInstallExamplesGinkgo.cmake @@ -11,20 +11,20 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# The macro: -# -# sundials_install_examples_ginkgo(<MODULE> -# [CPU_EXAMPLES_VAR var] -# [GPU_EXAMPLES_VAR var] -# [CPU_GPU_EXAMPLES_VAR var] -# [DESTINATION path] -# [SUNDIALS_COMPONENTS components] -# [SUNDIALS_TARGETS targets] -# [DEPENDENCIES files] -# [EXTRA_FILES files] -# ) + +# ~~~ +# sundials_install_examples_ginkgo(<MODULE> +# [CPU_EXAMPLES_VAR var] +# [GPU_EXAMPLES_VAR var] +# [CPU_GPU_EXAMPLES_VAR var] +# [DESTINATION path] +# [SUNDIALS_COMPONENTS components] +# [SUNDIALS_TARGETS targets] +# [DEPENDENCIES files] +# [EXTRA_FILES files]) +# ~~~ # -# adds an install target for each example tuple in CPU_EXAMPLES_VAR, +# Adds an install target for each example tuple in CPU_EXAMPLES_VAR, # GPU_EXAMPLES_VAR, and CPU_GPU_EXAMPLES_VAR that go with MODULE (e.g. cvode, # sunlinsol). # @@ -39,23 +39,28 @@ # namespace provided to target_link_libraries. Note this may be the same as or a # subset of SUNDIALS_COMPONENTS depending on the CMakeLists.txt template. # -# The DEPENDENCIES option is a list of additional source files that the -# examples are dependent on. +# The DEPENDENCIES option is a list of additional source files that the examples +# are dependent on. # # The EXTRA_FILES option is a list of files to install that are not example # source code. -# ------------------------------------------------------------------------------ macro(sundials_install_examples_ginkgo MODULE) - set(options ) + set(options) set(oneValueArgs DESTINATION) - set(multiValueArgs CPU_EXAMPLES_VAR GPU_EXAMPLES_VAR CPU_GPU_EXAMPLES_VAR - SUNDIALS_COMPONENTS SUNDIALS_TARGETS EXTRA_FILES DEPENDENCIES) + set(multiValueArgs + CPU_EXAMPLES_VAR + GPU_EXAMPLES_VAR + CPU_GPU_EXAMPLES_VAR + SUNDIALS_COMPONENTS + SUNDIALS_TARGETS + EXTRA_FILES + DEPENDENCIES) # Parse keyword arguments/options - cmake_parse_arguments(arg - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN}) # Install the example source, header, and output file foreach(example_type CPU GPU CPU_GPU) @@ -73,7 +78,7 @@ macro(sundials_install_examples_ginkgo MODULE) # install files install(FILES ${example} ${example_header} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) endforeach() endforeach() @@ -81,7 +86,7 @@ macro(sundials_install_examples_ginkgo MODULE) # Install the extra files and dependencies if(arg_EXTRA_FILES OR arg_DEPENDENCIES) install(FILES ${arg_EXTRA_FILES} ${arg_DEPENDENCIES} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) endif() # Prepare substitution variables for CMakeLists and/or Makefile templates @@ -115,15 +120,11 @@ macro(sundials_install_examples_ginkgo MODULE) # Generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_CXX_ginkgo_ex.in - ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt @ONLY) # Install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION} - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) # Add test_install target sundials_add_test_install(${MODULE} ginkgo) diff --git a/cmake/macros/SundialsOption.cmake b/cmake/macros/SundialsOption.cmake index e80ed5aac8..0bb5c4d359 100644 --- a/cmake/macros/SundialsOption.cmake +++ b/cmake/macros/SundialsOption.cmake @@ -11,11 +11,12 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------------------- -# Provides the macro: -# -# SUNDIALS_OPTION(<variable> <type> <docstring> <default value> -# [DEPENDS_ON dependencies] -# [DEPNDS_ON_THROW_ERROR]) + +# ~~~ +# sundials_option(<variable> <type> <docstring> <default value> +# [DEPENDS_ON dependencies] +# [DEPNDS_ON_THROW_ERROR]) +# ~~~ # # Within CMake creates a cache variable <variable> and sets it to the value # <default value> if <variable> is not yet defined and, if provided, all of its @@ -32,7 +33,6 @@ # The OPTIONS option can be used to provide a list of valid <variable> values. # # The ADVANCED option can be used to make <variable> an advanced CMake option. -# --------------------------------------------------------------------------- macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) @@ -42,7 +42,7 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) # parse inputs and create variables sundials_option_<keyword> cmake_parse_arguments(sundials_option "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) + "${multiValueArgs}" ${ARGN}) # check if dependencies for this option have been met set(all_depends_on_dependencies_met TRUE) @@ -58,9 +58,13 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) if(all_depends_on_dependencies_met) if(NOT DEFINED ${NAME}) - set(${NAME} "${DEFAULT_VALUE}" CACHE ${TYPE} ${DOCSTR}) + set(${NAME} + "${DEFAULT_VALUE}" + CACHE ${TYPE} ${DOCSTR}) else() - set(${NAME} "${${NAME}}" CACHE ${TYPE} ${DOCSTR}) + set(${NAME} + "${${NAME}}" + CACHE ${TYPE} ${DOCSTR}) endif() # make the option advanced if necessary @@ -73,10 +77,12 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) # if necessary, remove the CACHE variable i.e., all the variable # dependencies were previously met but are no longer satisfied if(DEFINED ${NAME}) - string(CONCAT _warn_msg_string - "The variable ${NAME} was set to ${${NAME}} but not all of its " - "dependencies (${depends_on_dependencies_not_met}) evaluate to TRUE. " - "Unsetting ${NAME}.") + string( + CONCAT + _warn_msg_string + "The variable ${NAME} was set to ${${NAME}} but not all of its " + "dependencies (${depends_on_dependencies_not_met}) evaluate to TRUE. " + "Unsetting ${NAME}.") unset(${NAME} CACHE) if(sundials_option_DEPENDS_ON_THROW_ERROR) message(FATAL_ERROR "${_warn_msg_string}") @@ -95,7 +101,10 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) message(FATAL_ERROR "Value of ${NAME} must be one of ${_options_msg}") endif() endforeach() - get_property(is_in_cache CACHE ${NAME} PROPERTY TYPE) + get_property( + is_in_cache + CACHE ${NAME} + PROPERTY TYPE) if(is_in_cache) set_property(CACHE ${NAME} PROPERTY STRINGS ${sundials_option_OPTIONS}) endif() diff --git a/cmake/macros/SundialsTryCompileExecute.cmake b/cmake/macros/SundialsTryCompileExecute.cmake index 81e972b92d..da4f88b535 100644 --- a/cmake/macros/SundialsTryCompileExecute.cmake +++ b/cmake/macros/SundialsTryCompileExecute.cmake @@ -11,44 +11,53 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ----------------------------------------------------------------------------- -# Defines the macro: -# -# sundials_trycompile_execute(<EXECUTABLE> <CWD> <COMPILE_OK> <RUN_OK> -# [COMPILE_OUTPUT variable] -# [RUN_OUTPUT variable]) + +# ~~~ +# sundials_trycompile_execute(<EXECUTABLE> <CWD> <COMPILE_OK> <RUN_OK> +# [COMPILE_OUTPUT variable] +# [RUN_OUTPUT variable]) +# ~~~ # -# This macro attempts to compile and then execute <CWD>/<EXECUTABLE>. -# The variable COMPILE_OK is TRUE if the source code compiles successfully. +# This macro attempts to compile and then execute <CWD>/<EXECUTABLE>. The +# variable COMPILE_OK is TRUE if the source code compiles successfully. # Otherwise COMPILE_OK is FALSE. The variable RUN_OK is TRUE if -# <CWD>/<EXECUTABLE> runs and returns zero. Otherwise it is FALSE. -# The optional COMPILE_OUTPUT variable is set to the generated output during -# compilation. It is useful for debugging compile failures. The option -# RUN_OUTPUT is set to the generated output during runtime. +# <CWD>/<EXECUTABLE> runs and returns zero. Otherwise it is FALSE. The optional +# COMPILE_OUTPUT variable is set to the generated output during compilation. It +# is useful for debugging compile failures. The option RUN_OUTPUT is set to the +# generated output during runtime. # ----------------------------------------------------------------------------- macro(sundials_trycompile_execute EXECUTABLE CWD COMPILE_OK RUN_OK) - set(options ) + set(options) set(oneValueArgs COMPILE_OUTPUT RUN_OUTPUT) - set(multiValueArgs ) + set(multiValueArgs) set(COMPILE_OK FALSE) set(RUN_OK FALSE) - set(COMPILE_OUTPUT ) - set(RUN_OUTPUT ) + set(COMPILE_OUTPUT) + set(RUN_OUTPUT) - cmake_parse_arguments(sundials_trycompile_execute "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + cmake_parse_arguments(sundials_trycompile_execute "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # compile the code and then try to run it - try_compile(COMPILE_OK ${CWD} ${CWD} ${EXECUTABLE} OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + COMPILE_OK ${CWD} + ${CWD} ${EXECUTABLE} + OUTPUT_VARIABLE COMPILE_OUTPUT) if(COMPILE_OK) - execute_process(COMMAND "./${EXECUTABLE}" WORKING_DIRECTORY ${CWD} RESULT_VARIABLE RUN_OK OUTPUT_VARIABLE RUN_OUTPUT) + execute_process( + COMMAND "./${EXECUTABLE}" + WORKING_DIRECTORY ${CWD} + RESULT_VARIABLE RUN_OK + OUTPUT_VARIABLE RUN_OUTPUT) if(RUN_OK MATCHES "0") set(RUN_OK TRUE) endif() endif() - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${CWD}/CMakeFiles) # set the optional outputs if used diff --git a/cmake/tpl/FindHYPRE.cmake b/cmake/tpl/FindHYPRE.cmake index 691647544a..156356b24e 100644 --- a/cmake/tpl/FindHYPRE.cmake +++ b/cmake/tpl/FindHYPRE.cmake @@ -32,53 +32,58 @@ # HYPRE_LIBRARIES - all of the libraries needed for HYPRE # --------------------------------------------------------------- -### Find include dir -find_path(temp_HYPRE_INCLUDE_DIR - NAMES HYPRE.h hypre.h - HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/include" "${HYPRE_INCLUDE_DIR}") -if (temp_HYPRE_INCLUDE_DIR) - set(HYPRE_INCLUDE_DIR "${temp_HYPRE_INCLUDE_DIR}" CACHE PATH "" FORCE) +# Find include dir +find_path( + temp_HYPRE_INCLUDE_DIR + NAMES HYPRE.h hypre.h + HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/include" "${HYPRE_INCLUDE_DIR}") +if(temp_HYPRE_INCLUDE_DIR) + set(HYPRE_INCLUDE_DIR + "${temp_HYPRE_INCLUDE_DIR}" + CACHE PATH "" FORCE) endif() unset(temp_HYPRE_INCLUDE_DIR CACHE) -if (HYPRE_LIBRARY) - # We have (or were given) HYPRE_LIBRARY - get path to use for any related libs - get_filename_component(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY} PATH) +if(HYPRE_LIBRARY) + # We have (or were given) HYPRE_LIBRARY - get path to use for any related libs + get_filename_component(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY} PATH) - # force CACHE update to show user DIR that will be used - set(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY_DIR} CACHE PATH "" FORCE) -else () - # find library with user provided directory path - set(HYPRE_LIBRARY_NAMES hypre HYPRE) - find_library(HYPRE_LIBRARY - NAMES ${HYPRE_LIBRARY_NAMES} - HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/lib" "${HYPRE_DIR}/lib64" "${HYPRE_LIBRARY_DIR}" - NO_DEFAULT_PATH - ) -endif () + # force CACHE update to show user DIR that will be used + set(HYPRE_LIBRARY_DIR + ${HYPRE_LIBRARY_DIR} + CACHE PATH "" FORCE) +else() + # find library with user provided directory path + set(HYPRE_LIBRARY_NAMES hypre HYPRE) + find_library( + HYPRE_LIBRARY + NAMES ${HYPRE_LIBRARY_NAMES} + HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/lib" "${HYPRE_DIR}/lib64" + "${HYPRE_LIBRARY_DIR}" + NO_DEFAULT_PATH) +endif() mark_as_advanced(HYPRE_LIBRARY) list(FIND HYPRE_LIBRARIES ${HYPRE_LIBRARY} _idx) -if (_idx EQUAL -1) - set(HYPRE_LIBRARIES "${HYPRE_LIBRARY};${HYPRE_LIBRARIES}" CACHE STRING "" FORCE) -endif () +if(_idx EQUAL -1) + set(HYPRE_LIBRARIES + "${HYPRE_LIBRARY};${HYPRE_LIBRARIES}" + CACHE STRING "" FORCE) +endif() # set a more informative error message in case the library was not found -set(HYPRE_NOT_FOUND_MESSAGE "\ +set(HYPRE_NOT_FOUND_MESSAGE + "\ ************************************************************************\n\ ERROR: Could not find HYPRE. Please check the variables:\n\ HYPRE_INCLUDE_DIR and HYPRE_LIBRARY_DIR\n\ ************************************************************************") # set package variables including HYPRE_FOUND -find_package_handle_standard_args(HYPRE - REQUIRED_VARS - HYPRE_LIBRARY - HYPRE_LIBRARIES - HYPRE_INCLUDE_DIR - FAIL_MESSAGE - "${HYPRE_NOT_FOUND_MESSAGE}" - ) +find_package_handle_standard_args( + HYPRE + REQUIRED_VARS HYPRE_LIBRARY HYPRE_LIBRARIES HYPRE_INCLUDE_DIR + FAIL_MESSAGE "${HYPRE_NOT_FOUND_MESSAGE}") # Create target for HYPRE if(HYPRE_FOUND) @@ -87,9 +92,10 @@ if(HYPRE_FOUND) add_library(SUNDIALS::HYPRE UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::HYPRE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${HYPRE_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${HYPRE_LIBRARIES}" - IMPORTED_LOCATION "${HYPRE_LIBRARY}") + set_target_properties( + SUNDIALS::HYPRE + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HYPRE_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${HYPRE_LIBRARIES}" + IMPORTED_LOCATION "${HYPRE_LIBRARY}") endif() diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index a3d817d037..08b77d3773 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -30,9 +30,12 @@ # KLU_LIBRARIES - all of the libraries needed for KLU # --------------------------------------------------------------- -if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) - # Prefer the import target from upstream SuiteSparse if it is available - # and the user didn't point to a specific (different) version. +if(NOT + (KLU_INCLUDE_DIR + OR KLU_LIBRARY_DIR + OR KLU_LIBRARY)) + # Prefer the import target from upstream SuiteSparse if it is available and + # the user didn't point to a specific (different) version. find_package(KLU CONFIG) if(TARGET SuiteSparse::KLU) @@ -53,63 +56,69 @@ elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES d.a ${CMAKE_FIND_LIBRARY_SUFFIXES}) endif() -### Find include dir +# Find include dir find_path(temp_KLU_INCLUDE_DIR klu.h ${KLU_INCLUDE_DIR}) -if (temp_KLU_INCLUDE_DIR) - set(KLU_INCLUDE_DIR ${temp_KLU_INCLUDE_DIR}) +if(temp_KLU_INCLUDE_DIR) + set(KLU_INCLUDE_DIR ${temp_KLU_INCLUDE_DIR}) endif() unset(temp_KLU_INCLUDE_DIR CACHE) -if (KLU_LIBRARY) - # We have (or were given) KLU_LIBRARY - get path to use for other Suitesparse libs - get_filename_component(KLU_LIBRARY_DIR ${KLU_LIBRARY} PATH) +if(KLU_LIBRARY) + # We have (or were given) KLU_LIBRARY - get path to use for other Suitesparse + # libs + get_filename_component(KLU_LIBRARY_DIR ${KLU_LIBRARY} PATH) + + # force CACHE update to show user DIR that will be used + set(KLU_LIBRARY_DIR + ${KLU_LIBRARY_DIR} + CACHE PATH "" FORCE) + +else() + # find library with user provided directory path + set(KLU_LIBRARY_NAME klu) + find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) +endif() +mark_as_advanced(KLU_LIBRARY) - # force CACHE update to show user DIR that will be used - set(KLU_LIBRARY_DIR ${KLU_LIBRARY_DIR} CACHE PATH "" FORCE) +if(NOT AMD_LIBRARY) + set(AMD_LIBRARY_NAME amd) + find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(AMD_LIBRARY) +endif() -else () - # find library with user provided directory path - set(KLU_LIBRARY_NAME klu) - find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) -endif () -mark_as_advanced(KLU_LIBRARY) +if(NOT COLAMD_LIBRARY) + set(COLAMD_LIBRARY_NAME colamd) + find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(COLAMD_LIBRARY) +endif() -if (NOT AMD_LIBRARY) - set(AMD_LIBRARY_NAME amd) - find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(AMD_LIBRARY) -endif () - -if (NOT COLAMD_LIBRARY) - set(COLAMD_LIBRARY_NAME colamd) - find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(COLAMD_LIBRARY) -endif () - -if (NOT BTF_LIBRARY) - set(BTF_LIBRARY_NAME btf) - find_library( BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(BTF_LIBRARY) -endif () - -if (NOT SUITESPARSECONFIG_LIBRARY) - set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) - # NOTE: no prefix for this library on windows - if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) - set(CMAKE_FIND_LIBRARY_PREFIXES "") - endif() - find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(SUITESPARSECONFIG_LIBRARY) -endif () +if(NOT BTF_LIBRARY) + set(BTF_LIBRARY_NAME btf) + find_library(BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(BTF_LIBRARY) +endif() + +if(NOT SUITESPARSECONFIG_LIBRARY) + set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) + # NOTE: no prefix for this library on windows + if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + set(CMAKE_FIND_LIBRARY_PREFIXES "") + endif() + find_library(SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} + ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) + mark_as_advanced(SUITESPARSECONFIG_LIBRARY) +endif() -set(KLU_LIBRARIES ${KLU_LIBRARY} ${AMD_LIBRARY} ${COLAMD_LIBRARY} ${BTF_LIBRARY} ${SUITESPARSECONFIG_LIBRARY}) +set(KLU_LIBRARIES ${KLU_LIBRARY} ${AMD_LIBRARY} ${COLAMD_LIBRARY} + ${BTF_LIBRARY} ${SUITESPARSECONFIG_LIBRARY}) # set package variables including KLU_FOUND -find_package_handle_standard_args(KLU - REQUIRED_VARS - KLU_LIBRARY - KLU_LIBRARIES - KLU_INCLUDE_DIR) +find_package_handle_standard_args(KLU REQUIRED_VARS KLU_LIBRARY KLU_LIBRARIES + KLU_INCLUDE_DIR) # Create target for KLU if(KLU_FOUND) @@ -118,9 +127,10 @@ if(KLU_FOUND) add_library(SUNDIALS::KLU UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::KLU PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${KLU_LIBRARIES}" - IMPORTED_LOCATION "${KLU_LIBRARY}") + set_target_properties( + SUNDIALS::KLU + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${KLU_LIBRARIES}" + IMPORTED_LOCATION "${KLU_LIBRARY}") endif() diff --git a/cmake/tpl/FindMAGMA.cmake b/cmake/tpl/FindMAGMA.cmake index 28b8fa8c7d..0d71560b72 100644 --- a/cmake/tpl/FindMAGMA.cmake +++ b/cmake/tpl/FindMAGMA.cmake @@ -15,16 +15,17 @@ # ----------------------------------------------------------------------------- # find the MAGMA include path -find_path(MAGMA_INCLUDE_DIR magma_v2.h +find_path( + MAGMA_INCLUDE_DIR magma_v2.h NAMES magma_v2.h HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES include NO_DEFAULT_PATH - DOC "Directory with MAGMA header" -) + DOC "Directory with MAGMA header") # find the main MAGMA library -find_library(MAGMA_LIBRARY +find_library( + MAGMA_LIBRARY NAMES magma HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES lib lib64 @@ -34,14 +35,15 @@ find_library(MAGMA_LIBRARY # Find the optional sparse component if("SPARSE" IN_LIST MAGMA_FIND_COMPONENTS) set(_sparse_required MAGMA_SPARSE_LIBRARY) - find_library(MAGMA_SPARSE_LIBRARY + find_library( + MAGMA_SPARSE_LIBRARY NAMES magma_sparse HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES lib lib64 NO_DEFAULT_PATH DOC "The MAGMA sparse library.") else() - set(_sparse_required ) + set(_sparse_required) endif() # Determine MAGMA version and libraries it depends on @@ -52,7 +54,8 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) if(MAGMA_PKG_CONFIG_PATH) - file(STRINGS ${MAGMA_PKG_CONFIG_PATH} _version_string REGEX "Version: [0-9].[0-9].[0-9]") + file(STRINGS ${MAGMA_PKG_CONFIG_PATH} _version_string + REGEX "Version: [0-9].[0-9].[0-9]") string(REGEX MATCHALL "[0-9]" _version_full "${_version_string}") list(GET _version_full 0 _version_major) @@ -65,7 +68,7 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) string(REPLACE " " ";" _libraries_list ${_libraries_string}) list(SUBLIST _libraries_list 1 -1 _libraries_list) # remove 'Libs:' part - set(_interface_libraires ) + set(_interface_libraires) if(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") if(NOT TARGET roc::hipblas) @@ -79,20 +82,24 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) endif() if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - if (NOT TARGET CUDA::cudart) + if(NOT TARGET CUDA::cudart) find_package(CUDAToolkit REQUIRED) endif() endif() foreach(lib ${_libraries_list}) - if(NOT (lib STREQUAL "-lmagma" OR lib STREQUAL "-lmagma_sparse" - OR lib STREQUAL "-L\${libdir}" OR lib STREQUAL "") ) + if(NOT + (lib STREQUAL "-lmagma" + OR lib STREQUAL "-lmagma_sparse" + OR lib STREQUAL "-L\${libdir}" + OR lib STREQUAL "")) # Check if we need to find cusparse or cublas if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - # Replace cublas, cusparse with the CMake targets because the library path in - # the magma pkgconfig is not reliable. Sepcifically, the path is wrong on systems - # like Perlmutter where the NVIDIA HPC SDK is used. + # Replace cublas, cusparse with the CMake targets because the library + # path in the magma pkgconfig is not reliable. Sepcifically, the path + # is wrong on systems like Perlmutter where the NVIDIA HPC SDK is + # used. if(lib STREQUAL "-lcublas") set(lib CUDA::cublas) endif() @@ -110,15 +117,11 @@ endif() set(MAGMA_LIBRARIES "${MAGMA_LIBRARY};${_interface_libraires}") -find_package_handle_standard_args(MAGMA - REQUIRED_VARS - MAGMA_LIBRARY - MAGMA_LIBRARIES - MAGMA_INCLUDE_DIR - ${_sparse_required} - VERSION_VAR - MAGMA_VERSION - ) +find_package_handle_standard_args( + MAGMA + REQUIRED_VARS MAGMA_LIBRARY MAGMA_LIBRARIES MAGMA_INCLUDE_DIR + ${_sparse_required} + VERSION_VAR MAGMA_VERSION) # Create target for MAGMA if(MAGMA_FOUND) @@ -127,20 +130,23 @@ if(MAGMA_FOUND) add_library(SUNDIALS::MAGMA UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::MAGMA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_interface_libraires}" - IMPORTED_LOCATION "${MAGMA_LIBRARY}") + set_target_properties( + SUNDIALS::MAGMA + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${_interface_libraires}" + IMPORTED_LOCATION "${MAGMA_LIBRARY}") if(MAGMA_SPARSE_LIBRARY) if(NOT TARGET SUNDIALS::MAGMA_SPARSE) add_library(SUNDIALS::MAGMA_SPARSE UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::MAGMA_SPARSE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${MAGMA_LIBRARY};${_interface_libraires}" - IMPORTED_LOCATION "${MAGMA_SPARSE_LIBRARY}") + set_target_properties( + SUNDIALS::MAGMA_SPARSE + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES + "${MAGMA_LIBRARY};${_interface_libraires}" + IMPORTED_LOCATION "${MAGMA_SPARSE_LIBRARY}") endif() endif() diff --git a/cmake/tpl/FindPETSC.cmake b/cmake/tpl/FindPETSC.cmake index 80a01f69ad..d85e199f9b 100644 --- a/cmake/tpl/FindPETSC.cmake +++ b/cmake/tpl/FindPETSC.cmake @@ -38,9 +38,12 @@ pkg_check_modules(PKG_PETSC "PETSc${_pkg_version_spec}") unset(_pkg_version_spec) # Find the PETSC libraries -set(_petsc_libs ) +set(_petsc_libs) foreach(_next_lib IN LISTS PKG_PETSC_LIBRARIES) - find_library(_petsc_lib_${_next_lib} NAMES ${_next_lib} HINTS ${PKG_PETSC_LIBRARY_DIRS}) + find_library( + _petsc_lib_${_next_lib} + NAMES ${_next_lib} + HINTS ${PKG_PETSC_LIBRARY_DIRS}) if(_petsc_lib_${_next_lib}) list(APPEND _petsc_libs "${_petsc_lib_${_next_lib}}") endif() @@ -56,17 +59,15 @@ foreach(_next_lib IN LISTS PKG_PETSC_STATIC_LIBRARIES) endif() if(_next_lib MATCHES "kokkoskernels") if(NOT TARGET Kokkos::kokkoskernels) - find_package(KokkosKernels REQUIRED - HINTS "${KokkosKernels_DIR}" "${PKG_PETSC_LIBRARY_DIRS}" - NO_DEFAULT_PATH) + find_package(KokkosKernels REQUIRED HINTS "${KokkosKernels_DIR}" + "${PKG_PETSC_LIBRARY_DIRS}" NO_DEFAULT_PATH) endif() list(APPEND _petsc_libs "Kokkos::kokkoskernels") endif() if(_next_lib MATCHES "kokkos") if(NOT TARGET Kokkos::kokkos) - find_package(Kokkos REQUIRED - HINTS "${Kokkos_DIR}" "${PKG_PETSC_LIBRARY_DIRS}" - NO_DEFAULT_PATH) + find_package(Kokkos REQUIRED HINTS "${Kokkos_DIR}" + "${PKG_PETSC_LIBRARY_DIRS}" NO_DEFAULT_PATH) endif() list(APPEND _petsc_libs "Kokkos::kokkos") endif() @@ -87,10 +88,18 @@ if(PKG_PETSC_VERSION) list(GET _petsc_versions 1 _petsc_version_minor) list(GET _petsc_versions 2 _petsc_version_patch) - set(PETSC_VERSION ${PKG_PETSC_VERSION} CACHE STRING "Full version of PETSC") - set(PETSC_VERSION_MAJOR ${_petsc_version_major} CACHE INTERNAL "Major version of PETSC") - set(PETSC_VERSION_MINOR ${_petsc_version_minor} CACHE INTERNAL "Minor version of PETSC") - set(PETSC_VERSION_PATCH ${_petsc_version_patch} CACHE INTERNAL "Patch version of PETSC") + set(PETSC_VERSION + ${PKG_PETSC_VERSION} + CACHE STRING "Full version of PETSC") + set(PETSC_VERSION_MAJOR + ${_petsc_version_major} + CACHE INTERNAL "Major version of PETSC") + set(PETSC_VERSION_MINOR + ${_petsc_version_minor} + CACHE INTERNAL "Minor version of PETSC") + set(PETSC_VERSION_PATCH + ${_petsc_version_patch} + CACHE INTERNAL "Patch version of PETSC") unset(_petsc_versions) unset(_petsc_version_major) @@ -98,18 +107,19 @@ if(PKG_PETSC_VERSION) unset(_petsc_version_patch) endif() -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (PETSC +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + PETSC REQUIRED_VARS PETSC_FOUND PETSC_INCLUDE_DIRS PETSC_LIBRARIES - VERSION_VAR PETSC_VERSION - ) + VERSION_VAR PETSC_VERSION) if(NOT TARGET SUNDIALS::PETSC) add_library(SUNDIALS::PETSC INTERFACE IMPORTED) - set_target_properties(SUNDIALS::PETSC PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${PETSC_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${PETSC_LIBRARIES}" - ) + set_target_properties( + SUNDIALS::PETSC + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PETSC_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${PETSC_LIBRARIES}") endif() -mark_as_advanced(PETSC_INCLUDE_DIRS PETSC_LIBRARIES PETSC_VERSION_MAJOR PETSC_VERSION_MINOR PETSC_VERSION_PATCH PETSC_VERSION) +mark_as_advanced(PETSC_INCLUDE_DIRS PETSC_LIBRARIES PETSC_VERSION_MAJOR + PETSC_VERSION_MINOR PETSC_VERSION_PATCH PETSC_VERSION) diff --git a/cmake/tpl/FindSUPERLUDIST.cmake b/cmake/tpl/FindSUPERLUDIST.cmake index 016f1c8ecf..1dcaf00c20 100644 --- a/cmake/tpl/FindSUPERLUDIST.cmake +++ b/cmake/tpl/FindSUPERLUDIST.cmake @@ -35,7 +35,9 @@ # --------------------------------------------------------------- if(NOT SUPERLUDIST_LINK_LIBRARIES AND SUPERLUDIST_LIBRARIES) - set(SUPERLUDIST_LINK_LIBRARIES "${SUPERLUDIST_LIBRARIES}" CACHE INTERNAL "") + set(SUPERLUDIST_LINK_LIBRARIES + "${SUPERLUDIST_LIBRARIES}" + CACHE INTERNAL "") elseif(NOT SUPERLUDIST_LINK_LIBRARIES) find_package(PkgConfig REQUIRED) list(APPEND CMAKE_PREFIX_PATH "${SUPERLUDIST_DIR}") @@ -47,39 +49,61 @@ elseif(NOT SUPERLUDIST_LINK_LIBRARIES) endif() endif() pkg_search_module(SUPERLUDIST REQUIRED "superlu_dist${_pkg_version_spec}") - set(SUPERLUDIST_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}" CACHE INTERNAL "") - set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIRS}" CACHE INTERNAL "") + set(SUPERLUDIST_LINK_LIBRARIES + "${SUPERLUDIST_LINK_LIBRARIES}" + CACHE INTERNAL "") + set(SUPERLUDIST_INCLUDE_DIRS + "${SUPERLUDIST_INCLUDE_DIRS}" + CACHE INTERNAL "") endif() # find the library configuration file -set(SUPERLUDIST_CUDA FALSE CACHE BOOL "SuperLU DIST was built with CUDA support") -set(SUPERLUDIST_ROCM FALSE CACHE BOOL "SuperLU DIST was built with ROCm support") +set(SUPERLUDIST_CUDA + FALSE + CACHE BOOL "SuperLU DIST was built with CUDA support") +set(SUPERLUDIST_ROCM + FALSE + CACHE BOOL "SuperLU DIST was built with ROCm support") if(SUPERLUDIST_INCLUDE_DIRS) - find_file(SUPERLUDIST_CONFIG_PATH superlu_dist_config.h PATHS "${SUPERLUDIST_INCLUDE_DIRS}") + find_file(SUPERLUDIST_CONFIG_PATH superlu_dist_config.h + PATHS "${SUPERLUDIST_INCLUDE_DIRS}") mark_as_advanced(FORCE SUPERLUDIST_CONFIG_PATH) if(SUPERLUDIST_VERSION VERSION_GREATER_EQUAL "8.0.0") - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_64 REGEX "#define XSDK_INDEX_SIZE 64") - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_32 REGEX "#undef XSDK_INDEX_SIZE") - if(_index_size_64) - set(SUPERLUDIST_INDEX_SIZE 64 CACHE STRING "SuperLU DIST index size (bit width)" FORCE) - else() - set(SUPERLUDIST_INDEX_SIZE 32 CACHE STRING "SuperLU DIST index size (bit width)" FORCE) - endif() - mark_as_advanced(FORCE SUPERLUDIST_INDEX_SIZE) + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_64 + REGEX "#define XSDK_INDEX_SIZE 64") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_32 + REGEX "#undef XSDK_INDEX_SIZE") + if(_index_size_64) + set(SUPERLUDIST_INDEX_SIZE + 64 + CACHE STRING "SuperLU DIST index size (bit width)" FORCE) + else() + set(SUPERLUDIST_INDEX_SIZE + 32 + CACHE STRING "SuperLU DIST index size (bit width)" FORCE) + endif() + mark_as_advanced(FORCE SUPERLUDIST_INDEX_SIZE) else() - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_with_index_size REGEX "XSDK_INDEX_SIZE") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_with_index_size + REGEX "XSDK_INDEX_SIZE") list(GET _strings_with_index_size 0 _index_size_string) - string(REGEX MATCHALL "[0-9][0-9]" SUPERLUDIST_INDEX_SIZE "${_index_size_string}") + string(REGEX MATCHALL "[0-9][0-9]" SUPERLUDIST_INDEX_SIZE + "${_index_size_string}") endif() - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_cuda REGEX "HAVE_CUDA") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_cuda + REGEX "HAVE_CUDA") string(REGEX MATCH "TRUE|FALSE" _has_cuda "${_strings_have_cuda}") file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_rocm REGEX "HAVE_HIP") string(REGEX MATCH "TRUE|FALSE" _has_rocm "${_strings_have_rocm}") if(_has_cuda) - set(SUPERLUDIST_CUDA TRUE CACHE BOOL "SuperLU DIST was built with CUDA support" FORCE) + set(SUPERLUDIST_CUDA + TRUE + CACHE BOOL "SuperLU DIST was built with CUDA support" FORCE) endif() if(_has_rocm) - set(SUPERLUDIST_ROCM TRUE CACHE BOOL "SuperLU DIST was built with ROCm support" FORCE) + set(SUPERLUDIST_ROCM + TRUE + CACHE BOOL "SuperLU DIST was built with ROCm support" FORCE) endif() unset(_has_cuda) unset(_has_rocm) @@ -87,21 +111,26 @@ endif() # find the library version file if(NOT SUPERLUDIST_VERSION AND SUPERLUDIST_INCLUDE_DIRS) - find_file(SUPERLUDIST_VERSION_PATH superlu_defs.h PATHS "${SUPERLUDIST_INCLUDE_DIRS}") + find_file(SUPERLUDIST_VERSION_PATH superlu_defs.h + PATHS "${SUPERLUDIST_INCLUDE_DIRS}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_major REGEX "SUPERLU_DIST_MAJOR_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_major + REGEX "SUPERLU_DIST_MAJOR_VERSION") list(GET _version_major 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_major "${_version_string}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_minor REGEX "SUPERLU_DIST_MINOR_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_minor + REGEX "SUPERLU_DIST_MINOR_VERSION") list(GET _version_minor 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_minor "${_version_string}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_patch REGEX "SUPERLU_DIST_PATCH_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_patch + REGEX "SUPERLU_DIST_PATCH_VERSION") list(GET _version_patch 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_patch "${_version_string}") - set(SUPERLUDIST_VERSION "${_version_major}.${_version_minor}.${_version_patch}") + set(SUPERLUDIST_VERSION + "${_version_major}.${_version_minor}.${_version_patch}") mark_as_advanced(FORCE SUPERLUDIST_VERSION_PATH) endif() @@ -117,18 +146,16 @@ if(SUPERLUDIST_ROCM) find_package(hipblas REQUIRED) find_package(rocsolver REQUIRED) find_package(rocblas REQUIRED) - list(APPEND SUPERLUDIST_LINK_LIBRARIES hip::device roc::hipblas roc::rocblas roc::rocsolver) + list(APPEND SUPERLUDIST_LINK_LIBRARIES hip::device roc::hipblas roc::rocblas + roc::rocsolver) endif() # set package variables including SUPERLUDIST_FOUND -find_package_handle_standard_args(SUPERLUDIST - REQUIRED_VARS - SUPERLUDIST_LINK_LIBRARIES - SUPERLUDIST_INCLUDE_DIRS - SUPERLUDIST_INDEX_SIZE - VERSION_VAR - SUPERLUDIST_VERSION - ) +find_package_handle_standard_args( + SUPERLUDIST + REQUIRED_VARS SUPERLUDIST_LINK_LIBRARIES SUPERLUDIST_INCLUDE_DIRS + SUPERLUDIST_INDEX_SIZE + VERSION_VAR SUPERLUDIST_VERSION) # Create target for SuperLU_DIST if(SUPERLUDIST_FOUND) @@ -137,8 +164,9 @@ if(SUPERLUDIST_FOUND) add_library(SUNDIALS::SUPERLUDIST INTERFACE IMPORTED) endif() - set_target_properties(SUNDIALS::SUPERLUDIST PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUDIST_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}") + set_target_properties( + SUNDIALS::SUPERLUDIST + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUDIST_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}") endif() diff --git a/cmake/tpl/FindSUPERLUMT.cmake b/cmake/tpl/FindSUPERLUMT.cmake index 4e1acb30b0..b9fb949549 100644 --- a/cmake/tpl/FindSUPERLUMT.cmake +++ b/cmake/tpl/FindSUPERLUMT.cmake @@ -33,13 +33,15 @@ # check for valid thread type string(TOUPPER ${SUPERLUMT_THREAD_TYPE} _upper_SUPERLUMT_THREAD_TYPE) -force_variable(SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" ${_upper_SUPERLUMT_THREAD_TYPE}) +force_variable( + SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" + ${_upper_SUPERLUMT_THREAD_TYPE}) -if(SUPERLUMT_THREAD_TYPE AND - NOT SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP" AND - NOT SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") +if(SUPERLUMT_THREAD_TYPE + AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP" + AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") message(FATAL_ERROR "Unknown thread type: ${SUPERLUMT_THREAD_TYPE} " - "Please enter PTHREAD or OPENMP") + "Please enter PTHREAD or OPENMP") endif() # check if the threading library has been found @@ -69,9 +71,8 @@ if(MSVC) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) endif() -# Check if SUPERLUMT_LIBRARIES contains the superlu_mt -# library as well as TPLs. If so, extract it into the -# SUPERLUMT_LIBRARY variable. +# Check if SUPERLUMT_LIBRARIES contains the superlu_mt library as well as TPLs. +# If so, extract it into the SUPERLUMT_LIBRARY variable. if(SUPERLUMT_LIBRARIES MATCHES "${SUPERLUMT_LIBRARY_NAME}") foreach(lib ${SUPERLUMT_LIBRARIES}) if(lib MATCHES "${SUPERLUMT_LIBRARY_NAME}") @@ -83,8 +84,10 @@ endif() # find library if(NOT SUPERLUMT_LIBRARY) # search user provided directory path - find_library(SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME} - PATHS ${SUPERLUMT_LIBRARY_DIR} NO_DEFAULT_PATH) + find_library( + SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME} + PATHS ${SUPERLUMT_LIBRARY_DIR} + NO_DEFAULT_PATH) # if user didn't provide a path, search anywhere if(NOT (SUPERLUMT_LIBRARY_DIR OR SUPERLUMT_LIBRARY)) find_library(SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME}) @@ -94,38 +97,42 @@ endif() # set the libraries, stripping out 'NOTFOUND' from previous attempts if(NOT (SUPERLUMT_LIBRARIES MATCHES "${SUPERLUMT_LIBRARY_NAME}")) - set(SUPERLUMT_LIBRARIES "${SUPERLUMT_LIBRARY};${SUPERLUMT_LIBRARIES}" CACHE STRING "" FORCE) + set(SUPERLUMT_LIBRARIES + "${SUPERLUMT_LIBRARY};${SUPERLUMT_LIBRARIES}" + CACHE STRING "" FORCE) endif() # set the library dir option if it wasn't preset if(SUPERLUMT_LIBRARY AND (NOT SUPERLUMT_LIBRARY_DIR)) get_filename_component(SUPERLUMT_LIBRARY_DIR ${SUPERLUMT_LIBRARY} DIRECTORY) - set(SUPERLUMT_LIBRARY_DIR ${SUPERLUMT_LIBRARY_DIR} CACHE PATH "" FORCE) + set(SUPERLUMT_LIBRARY_DIR + ${SUPERLUMT_LIBRARY_DIR} + CACHE PATH "" FORCE) endif() # set the include dir option if it wasn't preset if(SUPERLUMT_LIBRARY AND (NOT SUPERLUMT_INCLUDE_DIR)) - get_filename_component(SUPERLUMT_INCLUDE_DIR ${SUPERLUMT_LIBRARY_DIR} DIRECTORY) - set(SUPERLUMT_INCLUDE_DIR "${SUPERLUMT_INCLUDE_DIR}/include" CACHE PATH "" FORCE) + get_filename_component(SUPERLUMT_INCLUDE_DIR ${SUPERLUMT_LIBRARY_DIR} + DIRECTORY) + set(SUPERLUMT_INCLUDE_DIR + "${SUPERLUMT_INCLUDE_DIR}/include" + CACHE PATH "" FORCE) endif() # set a more informative error message in case the library was not found -set(SUPERLUMT_NOT_FOUND_MESSAGE "\ +set(SUPERLUMT_NOT_FOUND_MESSAGE + "\ ************************************************************************\n\ ERROR: Could not find SuperLU_MT. Please check the variables:\n\ SUPERLUMT_INCLUDE_DIR and SUPERLUMT_LIBRARY_DIR\n\ ************************************************************************") # set package variables including SUPERLUMT_FOUND -find_package_handle_standard_args(SUPERLUMT - REQUIRED_VARS - SUPERLUMT_LIBRARY - SUPERLUMT_LIBRARIES - SUPERLUMT_INCLUDE_DIR - SUPERLUMT_THREAD_TYPE - FAIL_MESSAGE - "${SUPERLUMT_NOT_FOUND_MESSAGE}" - ) +find_package_handle_standard_args( + SUPERLUMT + REQUIRED_VARS SUPERLUMT_LIBRARY SUPERLUMT_LIBRARIES SUPERLUMT_INCLUDE_DIR + SUPERLUMT_THREAD_TYPE + FAIL_MESSAGE "${SUPERLUMT_NOT_FOUND_MESSAGE}") # Create target for SuperLU_MT if(SUPERLUMT_FOUND) @@ -134,10 +141,11 @@ if(SUPERLUMT_FOUND) add_library(SUNDIALS::SUPERLUMT UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::SUPERLUMT PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUMT_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${SUPERLUMT_LIBRARIES}" - IMPORTED_LOCATION "${SUPERLUMT_LIBRARY}") + set_target_properties( + SUNDIALS::SUPERLUMT + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUMT_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${SUPERLUMT_LIBRARIES}" + IMPORTED_LOCATION "${SUPERLUMT_LIBRARY}") list2string(SUPERLUMT_LIBRARIES EXAMPLES_SUPERLUMT_LIBRARIES) diff --git a/cmake/tpl/FindTrilinos.cmake b/cmake/tpl/FindTrilinos.cmake index af4dff69b3..42be691041 100644 --- a/cmake/tpl/FindTrilinos.cmake +++ b/cmake/tpl/FindTrilinos.cmake @@ -16,20 +16,23 @@ # ----------------------------------------------------------------------------- # First try and find Trilinos using Trilinos_DIR only. -find_package(Trilinos - NAMES Trilinos TRILINOS +find_package( + Trilinos + NAMES + Trilinos + TRILINOS PATHS - ${Trilinos_DIR}/lib/cmake/Trilinos - ${Trilinos_DIR} + ${Trilinos_DIR}/lib/cmake/Trilinos + ${Trilinos_DIR} NO_DEFAULT_PATH QUIET) # set package variables including Trilinos_FOUND -find_package_handle_standard_args(Trilinos - REQUIRED_VARS - Trilinos_LIBRARIES # defined in TrilinosConfig.cmake - Trilinos_INCLUDE_DIRS # defined in TrilinosConfig.cmake - ) +find_package_handle_standard_args( + Trilinos + REQUIRED_VARS Trilinos_LIBRARIES # defined in TrilinosConfig.cmake + Trilinos_INCLUDE_DIRS # defined in TrilinosConfig.cmake +) # Create Trilinos target if(Trilinos_FOUND) @@ -38,8 +41,9 @@ if(Trilinos_FOUND) add_library(SUNDIALS::TRILINOS IMPORTED INTERFACE) endif() - set_target_properties(SUNDIALS::TRILINOS PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${Trilinos_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${Trilinos_LIBRARIES}") + set_target_properties( + SUNDIALS::TRILINOS + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Trilinos_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${Trilinos_LIBRARIES}") endif() diff --git a/cmake/tpl/FindXBRAID.cmake b/cmake/tpl/FindXBRAID.cmake index 8b60d4eec6..d46299a337 100644 --- a/cmake/tpl/FindXBRAID.cmake +++ b/cmake/tpl/FindXBRAID.cmake @@ -29,28 +29,36 @@ # Check if we are locating XBraid using the root install directory or a list of # include directories and link libraries -if (XBRAID_INCLUDES OR XBRAID_LIBRARIES) +if(XBRAID_INCLUDES OR XBRAID_LIBRARIES) - if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) + if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) - set(XBRAID_DIR "" CACHE PATH "Path to the root of XBraid installation" FORCE) + set(XBRAID_DIR + "" + CACHE PATH "Path to the root of XBraid installation" FORCE) - else () + else() - string(CONCAT msg - "Both XBRAID_INCLUDES and XBRAID_LIBRARIES must be provided:\n" - " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n" - " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") + string( + CONCAT msg + "Both XBRAID_INCLUDES and XBRAID_LIBRARIES must be provided:\n" + " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n" + " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") message(FATAL_ERROR ${msg}) - endif () + endif() -else () +else() - set(XBRAID_INCLUDES "" CACHE STRING "Semi-colon separated list of XBraid include directories" FORCE) - set(XBRAID_LIBRARIES "" CACHE STRING "Semi-colon separated list of XBraid link libraries" FORCE) + set(XBRAID_INCLUDES + "" + CACHE STRING "Semi-colon separated list of XBraid include directories" + FORCE) + set(XBRAID_LIBRARIES + "" + CACHE STRING "Semi-colon separated list of XBraid link libraries" FORCE) -endif () +endif() # unset cache values for multiple passes unset(XBRAID_INCLUDE_DIR CACHE) @@ -59,138 +67,140 @@ unset(XBRAID_LIBRARY CACHE) unset(XBRAID_INCS CACHE) unset(XBRAID_LIBS CACHE) -if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) +if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) message(STATUS "Finding XBraid using XBRAID_INCLUDES and XBRAID_LIBRARIES") # extract path from XBRAID_INCLUDES - foreach (include_dir ${XBRAID_INCLUDES}) - if (EXISTS "${include_dir}/braid.h") - set(XBRAID_INCLUDE_DIR "${include_dir}" CACHE "XBraid include directory") + foreach(include_dir ${XBRAID_INCLUDES}) + if(EXISTS "${include_dir}/braid.h") + set(XBRAID_INCLUDE_DIR + "${include_dir}" + CACHE "XBraid include directory") break() - endif () - endforeach () + endif() + endforeach() # check if the include directory was found - if (NOT XBRAID_INCLUDE_DIR) - string(CONCAT msg - "Could not determine XBraid include directory from XBRAID_INCLUDES:\n" - " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n") + if(NOT XBRAID_INCLUDE_DIR) + string( + CONCAT + msg + "Could not determine XBraid include directory from XBRAID_INCLUDES:\n" + " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n") message(FATAL_ERROR ${msg}) - endif () + endif() # extract library from XBRAID_LIBRARIES - foreach (library_path ${XBRAID_LIBRARIES}) + foreach(library_path ${XBRAID_LIBRARIES}) get_filename_component(library_name "${library_path}" NAME) - if (library_name MATCHES "braid") - set(XBRAID_LIBRARY "${library_path}" CACHE "XBraid library") + if(library_name MATCHES "braid") + set(XBRAID_LIBRARY + "${library_path}" + CACHE "XBraid library") break() - endif () - endforeach () + endif() + endforeach() # check if the library directory was found - if (NOT XBRAID_LIBRARY) + if(NOT XBRAID_LIBRARY) string(CONCAT msg - "Could not determine XBraid library from XBRAID_LIBRARIES:\n" - " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") + "Could not determine XBraid library from XBRAID_LIBRARIES:\n" + " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") message(FATAL_ERROR ${msg}) - endif () + endif() -else () +else() message(STATUS "Finding XBraid using XBRAID_DIR") # find XBRAID_DIR - if (NOT XBRAID_DIR) + if(NOT XBRAID_DIR) message(STATUS "Looking for XBraid in common install locations") find_path(XBRAID_DIR include/braid.h braid/braid.h) - endif () + endif() # check if XBRAID_DIR was set/found - if (NOT XBRAID_DIR) + if(NOT XBRAID_DIR) - string(CONCAT msg - "Could not locate XBraid install directory please set:\n" - " - XBRAID_DIR\n" - "or used the advanced options\n" - " - XBRAID_INCLUDES and XBRAID_LIBRARIES.") + string(CONCAT msg "Could not locate XBraid install directory please set:\n" + " - XBRAID_DIR\n" "or used the advanced options\n" + " - XBRAID_INCLUDES and XBRAID_LIBRARIES.") message(FATAL_ERROR ${msg}) - endif () + endif() # Find the include dir - find_path(XBRAID_INCLUDE_DIR braid.h - PATHS - ${XBRAID_DIR} - PATH_SUFFIXES - include braid - DOC - "XBraid include directory" + find_path( + XBRAID_INCLUDE_DIR braid.h + PATHS ${XBRAID_DIR} + PATH_SUFFIXES include braid + DOC "XBraid include directory" NO_DEFAULT_PATH) # check if the include directory was found - if (NOT XBRAID_INCLUDE_DIR) - string(CONCAT msg - "Could not determine XBraid include directory from XBRAID_DIR:\n" - " XBRAID_DIR=${XBRAID_DIR}\n") + if(NOT XBRAID_INCLUDE_DIR) + string( + CONCAT msg + "Could not determine XBraid include directory from XBRAID_DIR:\n" + " XBRAID_DIR=${XBRAID_DIR}\n") message(FATAL_ERROR ${msg}) - endif () + endif() # Find the library - find_library(XBRAID_LIBRARY braid - PATHS - ${XBRAID_DIR} - PATH_SUFFIXES - lib braid - DOC - "XBraid library" + find_library( + XBRAID_LIBRARY braid + PATHS ${XBRAID_DIR} + PATH_SUFFIXES lib braid + DOC "XBraid library" NO_DEFAULT_PATH) # check if the library was found - if (NOT XBRAID_LIBRARY) - string(CONCAT msg - "Could not determine XBraid library from XBRAID_DIR:\n" - " XBRAID_DIR=${XBRAID_DIR}\n") + if(NOT XBRAID_LIBRARY) + string(CONCAT msg "Could not determine XBraid library from XBRAID_DIR:\n" + " XBRAID_DIR=${XBRAID_DIR}\n") message(FATAL_ERROR ${msg}) - endif () + endif() -endif () +endif() # set package variables including XBRAID_FOUND -find_package_handle_standard_args(XBRAID - REQUIRED_VARS - XBRAID_INCLUDE_DIR - XBRAID_LIBRARY - ) +find_package_handle_standard_args(XBRAID REQUIRED_VARS XBRAID_INCLUDE_DIR + XBRAID_LIBRARY) # XBraid target -if (XBRAID_FOUND) +if(XBRAID_FOUND) # create target if necessary - if (NOT TARGET SUNDIALS::XBRAID) + if(NOT TARGET SUNDIALS::XBRAID) add_library(SUNDIALS::XBRAID UNKNOWN IMPORTED) - endif () + endif() # update target properties (for multiple passes) - set_target_properties(SUNDIALS::XBRAID PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${XBRAID_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${XBRAID_LIBRARIES}" - IMPORTED_LOCATION "${XBRAID_LIBRARY}") - - # set variables for output message, compile tests, and - # CMake/Makefile templates - if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) - set(XBRAID_INCS "${XBRAID_INCLUDES}" CACHE INTERNAL - "Internal XBraid includes") - set(XBRAID_LIBS "${XBRAID_LIBRARIES}" CACHE INTERNAL - "Internal XBraid libraries") - else () - set(XBRAID_INCS "${XBRAID_INCLUDE_DIR}" CACHE INTERNAL - "Internal XBraid includes") - set(XBRAID_LIBS "${XBRAID_LIBRARY}" CACHE INTERNAL - "Internal XBraid libraries") - endif () - -endif () + set_target_properties( + SUNDIALS::XBRAID + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${XBRAID_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${XBRAID_LIBRARIES}" + IMPORTED_LOCATION "${XBRAID_LIBRARY}") + + # set variables for output message, compile tests, and CMake/Makefile + # templates + if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) + set(XBRAID_INCS + "${XBRAID_INCLUDES}" + CACHE INTERNAL "Internal XBraid includes") + set(XBRAID_LIBS + "${XBRAID_LIBRARIES}" + CACHE INTERNAL "Internal XBraid libraries") + else() + set(XBRAID_INCS + "${XBRAID_INCLUDE_DIR}" + CACHE INTERNAL "Internal XBraid includes") + set(XBRAID_LIBS + "${XBRAID_LIBRARY}" + CACHE INTERNAL "Internal XBraid libraries") + endif() + +endif() diff --git a/cmake/tpl/SundialsAdiak.cmake b/cmake/tpl/SundialsAdiak.cmake index b5342a7216..8a6483e308 100644 --- a/cmake/tpl/SundialsAdiak.cmake +++ b/cmake/tpl/SundialsAdiak.cmake @@ -44,7 +44,6 @@ find_package(adiak REQUIRED) message(STATUS "ADIAK_LIBRARIES: ${adiak_LIBRARIES}") message(STATUS "ADIAK_INCLUDE_DIR: ${adiak_INCLUDE_DIR}") - # ----------------------------------------------------------------------------- # Section 4: Test the TPL # ----------------------------------------------------------------------------- @@ -57,28 +56,33 @@ if(adiak_FOUND AND (NOT adiak_WORKS)) file(MAKE_DIRECTORY ${adiak_TEST_DIR}) # Create a C source file - file(WRITE ${adiak_TEST_DIR}/ltest.c - "\#include <adiak.h>\n" - "int main(void)\n" - "{\n" - " adiak_init(NULL);\n" - " adiak_fini();\n" - " return 0;\n" - "}\n") + file( + WRITE ${adiak_TEST_DIR}/ltest.c + "\#include <adiak.h>\n" + "int main(void)\n" + "{\n" + " adiak_init(NULL);\n" + " adiak_fini();\n" + " return 0;\n" + "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${adiak_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${adiak_TEST_DIR} ${adiak_TEST_DIR}/ltest.c + try_compile( + COMPILE_OK ${adiak_TEST_DIR} + ${adiak_TEST_DIR}/ltest.c OUTPUT_VARIABLE COMPILE_OUTPUT LINK_LIBRARIES adiak::adiak ${CMAKE_DL_LIBS}) # Process test result if(COMPILE_OK) message(STATUS "Checking if adiak works with SUNDIALS... OK") - set(adiak_WORKS TRUE CACHE BOOL "adiak works with SUNDIALS as configured" FORCE) + set(adiak_WORKS + TRUE + CACHE BOOL "adiak works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if adiak works with SUNDIALS... FAILED") message(STATUS "Check output: ") diff --git a/cmake/tpl/SundialsCaliper.cmake b/cmake/tpl/SundialsCaliper.cmake index 998376266d..a07ad39556 100644 --- a/cmake/tpl/SundialsCaliper.cmake +++ b/cmake/tpl/SundialsCaliper.cmake @@ -40,9 +40,7 @@ endif() # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(CALIPER - PATHS "${CALIPER_DIR}" - REQUIRED) +find_package(CALIPER PATHS "${CALIPER_DIR}" REQUIRED) message(STATUS "CALIPER_LIB_DIR: ${caliper_LIB_DIR}") message(STATUS "CALIPER_INCLUDE_DIR: ${caliper_INCLUDE_DIR}") @@ -59,7 +57,8 @@ if(CALIPER_FOUND AND (NOT CALIPER_WORKS)) file(MAKE_DIRECTORY ${CALIPER_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${CALIPER_TEST_DIR}/CMakeLists.txt + file( + WRITE ${CALIPER_TEST_DIR}/CMakeLists.txt "cmake_minimum_required(VERSION ${CMAKE_VERSION})\n" "project(ltest C)\n" "set(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -77,27 +76,32 @@ if(CALIPER_FOUND AND (NOT CALIPER_WORKS)) "target_link_libraries(ltest caliper)\n") # Create a C source file - file(WRITE ${CALIPER_TEST_DIR}/ltest.c - "\#include <caliper/cali.h>\n" - "int main(void)\n" - "{\n" - " CALI_MARK_FUNCTION_BEGIN;\n" - " CALI_MARK_FUNCTION_END;\n" - " return 0;\n" - "}\n") + file( + WRITE ${CALIPER_TEST_DIR}/ltest.c + "\#include <caliper/cali.h>\n" + "int main(void)\n" + "{\n" + " CALI_MARK_FUNCTION_BEGIN;\n" + " CALI_MARK_FUNCTION_END;\n" + " return 0;\n" + "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${CALIPER_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${CALIPER_TEST_DIR} ${CALIPER_TEST_DIR} ltest + try_compile( + COMPILE_OK ${CALIPER_TEST_DIR} + ${CALIPER_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if CALIPER works with SUNDIALS... OK") - set(CALIPER_WORKS TRUE CACHE BOOL "CALIPER works with SUNDIALS as configured" FORCE) + set(CALIPER_WORKS + TRUE + CACHE BOOL "CALIPER works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if CALIPER works with SUNDIALS... FAILED") message(STATUS "Check output: ") diff --git a/cmake/tpl/SundialsGinkgo.cmake b/cmake/tpl/SundialsGinkgo.cmake index 37dd821a2b..715f30e6bd 100644 --- a/cmake/tpl/SundialsGinkgo.cmake +++ b/cmake/tpl/SundialsGinkgo.cmake @@ -36,13 +36,10 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(Ginkgo REQUIRED - HINTS "${Ginkgo_DIR}" - NO_DEFAULT_PATH) +find_package(Ginkgo REQUIRED HINTS "${Ginkgo_DIR}" NO_DEFAULT_PATH) message(STATUS "GINKGO VERSION: ${GINKGO_PROJECT_VERSION}") message(STATUS "GINKGO BUILD TYPE: ${GINKGO_BUILD_TYPE}") @@ -55,27 +52,43 @@ message(STATUS "GINKGO CXX FLAGS: ${GINKGO_INTERFACE_CXX_FLAGS}") # ----------------------------------------------------------------------------- if(Ginkgo_FOUND AND (NOT GINKGO_WORKS)) if(SUNDIALS_PRECISION MATCHES "extended|EXTENDED") - message(FATAL_ERROR "SUNDIALS GINKGO interface is not compatible with extended precision") + message( + FATAL_ERROR + "SUNDIALS GINKGO interface is not compatible with extended precision") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend." + ) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend." + ) endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend.") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend." + ) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP" AND NOT ENABLE_OPENMP) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend." + ) endif() message(STATUS "Checking if GINKGO works... OK") - set(GINKGO_WORKS TRUE CACHE BOOL "GINKGO works with SUNDIALS as configured" FORCE) + set(GINKGO_WORKS + TRUE + CACHE BOOL "GINKGO works with SUNDIALS as configured" FORCE) elseif(Ginkgo_FOUND AND GINKGO_WORKS) message(STATUS "Skipped GINKGO tests, assuming GINKGO works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake index ea27e32973..9d880d2562 100644 --- a/cmake/tpl/SundialsHypre.cmake +++ b/cmake/tpl/SundialsHypre.cmake @@ -39,7 +39,8 @@ endif() if(ENABLE_HYPRE) # Using hypre requres building with MPI enabled if(NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") endif() # Using hypre requres C99 or newer if(CMAKE_C_STANDARD STREQUAL "90") @@ -68,46 +69,52 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS)) file(MAKE_DIRECTORY ${HYPRE_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${HYPRE_TEST_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})\n" - "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "SET(CMAKE_EXE_LINKER_FLAGS \"${LINK_MATH_LIB}\")\n" - "INCLUDE_DIRECTORIES(${HYPRE_INCLUDE_DIR})\n" - "ADD_EXECUTABLE(ltest ltest.c)\n" - "TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n") - - file(WRITE ${HYPRE_TEST_DIR}/ltest.c - "\#include \"HYPRE_parcsr_ls.h\"\n" - "int main(void) {\n" - "HYPRE_ParVector par_b;\n" - "HYPRE_IJVector b;\n" - "par_b = 0;\n" - "b = 0;\n" - "if (par_b != 0 || b != 0) return(1);\n" - "else return(0);\n" - "}\n") - - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + file( + WRITE ${HYPRE_TEST_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ltest C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})\n" + "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "SET(CMAKE_EXE_LINKER_FLAGS \"${LINK_MATH_LIB}\")\n" + "INCLUDE_DIRECTORIES(${HYPRE_INCLUDE_DIR})\n" + "ADD_EXECUTABLE(ltest ltest.c)\n" + "TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n") + + file( + WRITE ${HYPRE_TEST_DIR}/ltest.c + "\#include \"HYPRE_parcsr_ls.h\"\n" + "int main(void) {\n" + "HYPRE_ParVector par_b;\n" + "HYPRE_IJVector b;\n" + "par_b = 0;\n" + "b = 0;\n" + "if (par_b != 0 || b != 0) return(1);\n" + "else return(0);\n" + "}\n") + + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${HYPRE_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${HYPRE_TEST_DIR} ${HYPRE_TEST_DIR} ltest + try_compile( + COMPILE_OK ${HYPRE_TEST_DIR} + ${HYPRE_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if HYPRE works... OK") - set(HYPRE_WORKS TRUE CACHE BOOL "HYPRE works with SUNDIALS as configured" FORCE) + set(HYPRE_WORKS + TRUE + CACHE BOOL "HYPRE works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if HYPRE works... FAILED") message(STATUS "Check output: ") @@ -116,5 +123,8 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS)) endif() elseif(HYPRE_FOUND AND HYPRE_WORKS) - message(STATUS "Skipped HYPRE tests, assuming HYPRE works with SUNDIALS. Set HYPRE_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped HYPRE tests, assuming HYPRE works with SUNDIALS. Set HYPRE_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsKLU.cmake b/cmake/tpl/SundialsKLU.cmake index f3c006608c..3f56e809a8 100644 --- a/cmake/tpl/SundialsKLU.cmake +++ b/cmake/tpl/SundialsKLU.cmake @@ -38,7 +38,8 @@ endif() # KLU does not support single or extended precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "KLU is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "KLU is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -69,7 +70,10 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) set(CMAKE_REQUIRED_INCLUDES ${save_CMAKE_REQUIRED_INCLUDES}) message(STATUS "Size of SuiteSparse_long is ${SIZEOF_SUITESPARSE_LONG}") if(NOT SIZEOF_SUITESPARSE_LONG EQUAL "8") - message(FATAL_ERROR "Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used.") + message( + FATAL_ERROR + "Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used." + ) endif() endif() @@ -78,43 +82,44 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) file(MAKE_DIRECTORY ${KLU_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${KLU_TEST_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" - "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "INCLUDE_DIRECTORIES(${KLU_INCLUDE_DIR})\n" - "ADD_EXECUTABLE(ltest ltest.c)\n" - "TARGET_LINK_LIBRARIES(ltest ${KLU_LIBRARIES})\n") + file( + WRITE ${KLU_TEST_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ltest C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" + "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "INCLUDE_DIRECTORIES(${KLU_INCLUDE_DIR})\n" + "ADD_EXECUTABLE(ltest ltest.c)\n" + "TARGET_LINK_LIBRARIES(ltest ${KLU_LIBRARIES})\n") # Create a C source file which calls a KLU function file(WRITE ${KLU_TEST_DIR}/ltest.c - "\#include \"klu.h\"\n" - "int main(void) {\n" - "klu_common Common;\n" - "klu_defaults (&Common);\n" - "return(0);\n" - "}\n") - - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + "\#include \"klu.h\"\n" "int main(void) {\n" "klu_common Common;\n" + "klu_defaults (&Common);\n" "return(0);\n" "}\n") + + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${KLU_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${KLU_TEST_DIR} ${KLU_TEST_DIR} ltest + try_compile( + COMPILE_OK ${KLU_TEST_DIR} + ${KLU_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if KLU works... OK") - set(KLU_WORKS TRUE CACHE BOOL "KLU works with SUNDIALS as configured" FORCE) + set(KLU_WORKS + TRUE + CACHE BOOL "KLU works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if KLU works... FAILED") message(STATUS "Check output: ") @@ -123,5 +128,8 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) endif() elseif(KLU_FOUND AND KLU_WORKS) - message(STATUS "Skipped KLU tests, assuming KLU works with SUNDIALS. Set KLU_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped KLU tests, assuming KLU works with SUNDIALS. Set KLU_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsKokkos.cmake b/cmake/tpl/SundialsKokkos.cmake index c082a14e87..ad13181b30 100644 --- a/cmake/tpl/SundialsKokkos.cmake +++ b/cmake/tpl/SundialsKokkos.cmake @@ -36,18 +36,16 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(Kokkos REQUIRED - HINTS "${Kokkos_DIR}" - NO_DEFAULT_PATH) +find_package(Kokkos REQUIRED HINTS "${Kokkos_DIR}" NO_DEFAULT_PATH) -# We should be able to use Kokkos_DEVICES directly but it seems to get -# removed or unset in some CMake versions -set(KOKKOS_EXAMPLES_BACKENDS "${Kokkos_DEVICES}" CACHE STRING - "Kokkos backends to build examples with") +# We should be able to use Kokkos_DEVICES directly but it seems to get removed +# or unset in some CMake versions +set(KOKKOS_EXAMPLES_BACKENDS + "${Kokkos_DEVICES}" + CACHE STRING "Kokkos backends to build examples with") mark_as_advanced(FORCE KOKKOS_EXAMPLES_BACKENDS) message(STATUS "Kokkos VERSION: ${Kokkos_VERSION}") @@ -57,8 +55,9 @@ message(STATUS "Kokkos VERSION: ${Kokkos_VERSION}") if(Kokkos_FOUND AND (NOT KOKKOS_WORKS)) message(STATUS "Checking if Kokkos works... OK") - set(KOKKOS_WORKS TRUE CACHE BOOL "Kokkos works with SUNDIALS as configured" - FORCE) + set(KOKKOS_WORKS + TRUE + CACHE BOOL "Kokkos works with SUNDIALS as configured" FORCE) elseif(Kokkos_FOUND AND KOKKOS_WORKS) message(STATUS "Skipped Kokkos tests, assuming Kokkos works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsKokkosKernels.cmake b/cmake/tpl/SundialsKokkosKernels.cmake index 93d68152bf..4f495725ee 100644 --- a/cmake/tpl/SundialsKokkosKernels.cmake +++ b/cmake/tpl/SundialsKokkosKernels.cmake @@ -36,13 +36,11 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(KokkosKernels REQUIRED - HINTS "${KokkosKernels_DIR}" - NO_DEFAULT_PATH) +find_package(KokkosKernels REQUIRED HINTS "${KokkosKernels_DIR}" + NO_DEFAULT_PATH) message(STATUS "Kokkos Kernels VERSION: ${KokkosKernels_VERSION}") @@ -52,8 +50,12 @@ message(STATUS "Kokkos Kernels VERSION: ${KokkosKernels_VERSION}") if(KokkosKernels_FOUND AND (NOT KOKKOS_KERNELS_WORKS)) message(STATUS "Checking if Kokkos Kernels works... OK") - set(KOKKOS_KERNELS_WORKS TRUE CACHE BOOL - "Kokkos Kernels works with SUNDIALS as configured" FORCE) + set(KOKKOS_KERNELS_WORKS + TRUE + CACHE BOOL "Kokkos Kernels works with SUNDIALS as configured" FORCE) elseif(KokkosKernels_FOUND AND KOKKOS_WORKS) - message(STATUS "Skipped Kokkos Kernels tests, assuming Kokkos Kernels works with SUNDIALS.") + message( + STATUS + "Skipped Kokkos Kernels tests, assuming Kokkos Kernels works with SUNDIALS." + ) endif() diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index 0047d6afd5..74261bb469 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -69,15 +69,16 @@ message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}") # Determining the name-mangling scheme if needed # --------------------------------------------------------------- # In general, names of symbols with and without underscore may be mangled -# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), -# we have to consider both cases. +# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), we have +# to consider both cases. # # Method: -# 1) create a library from a Fortran source file which defines a function "mysub" -# 2) attempt to link with this library a C source file which calls the "mysub" -# function using various possible schemes (6 different schemes, corresponding -# to all combinations lower/upper case and none/one/two underscores). -# 3) define the name-mangling scheme based on the test that was successful. +# +# 1. create a library from a Fortran source file which defines a function "mysub" +# 2. attempt to link with this library a C source file which calls the "mysub" +# function using various possible schemes (6 different schemes, corresponding +# to all combinations lower/upper case and none/one/two underscores). +# 3. define the name-mangling scheme based on the test that was successful. # # On exit, if we were able to infer the scheme, the variables # CMAKE_Fortran_SCHEME_NO_UNDERSCORES and CMAKE_Fortran_SCHEME_WITH_UNDERSCORES @@ -92,9 +93,10 @@ if(NEED_FORTRAN_NAME_MANGLING) set(FortranTest_DIR ${PROJECT_BINARY_DIR}/FortranTest) file(MAKE_DIRECTORY ${FortranTest_DIR}) - # Create a CMakeLists.txt file which will generate the "flib" library - # and an executable "ftest" - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + # Create a CMakeLists.txt file which will generate the "flib" library and an + # executable "ftest" + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ftest Fortran)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -109,36 +111,35 @@ if(NEED_FORTRAN_NAME_MANGLING) "ADD_EXECUTABLE(ftest ftest.f)\n" "TARGET_LINK_LIBRARIES(ftest flib)\n") - # Create the Fortran source flib.f which defines two subroutines, "mysub" and "my_sub" + # Create the Fortran source flib.f which defines two subroutines, "mysub" and + # "my_sub" file(WRITE ${FortranTest_DIR}/flib.f - " SUBROUTINE mysub\n" - " RETURN\n" - " END\n" - " SUBROUTINE my_sub\n" - " RETURN\n" - " END\n") + " SUBROUTINE mysub\n" " RETURN\n" " END\n" + " SUBROUTINE my_sub\n" " RETURN\n" " END\n") # Create the Fortran source ftest.f which calls "mysub" and "my_sub" file(WRITE ${FortranTest_DIR}/ftest.f - " PROGRAM ftest\n" - " CALL mysub()\n" - " CALL my_sub()\n" - " END\n") + " PROGRAM ftest\n" " CALL mysub()\n" + " CALL my_sub()\n" " END\n") # Use TRY_COMPILE to make the targets "flib" and "ftest" - try_compile(FTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ftest OUTPUT_VARIABLE MY_OUTPUT) + try_compile( + FTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ftest + OUTPUT_VARIABLE MY_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) # Proceed based on test results if(FTEST_OK) # Infer Fortran name-mangling scheme for symbols WITHOUT underscores. - # Overwrite CMakeLists.txt with one which will generate the "ctest1" executable - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + # Overwrite CMakeLists.txt with one which will generate the "ctest1" + # executable + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ctest1 C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -164,23 +165,25 @@ if(NEED_FORTRAN_NAME_MANGLING) while(${iopt} LESS ${imax}) # Get the current list entry (current scheme) list(GET options ${iopt} opt) - # Generate C source which calls the "mysub" function using the current scheme + # Generate C source which calls the "mysub" function using the current + # scheme file(WRITE ${FortranTest_DIR}/ctest1.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - # Use TRY_COMPILE to make the "ctest1" executable from the current C source - # and linking to the previously created "flib" library. - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest1 OUTPUT_VARIABLE MY_OUTPUT) + "extern void ${opt}();\n" "int main(void){${opt}();return(0);}\n") + # Use TRY_COMPILE to make the "ctest1" executable from the current C + # source and linking to the previously created "flib" library. + try_compile( + CTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ctest1 + OUTPUT_VARIABLE MY_OUTPUT) # Write output compiling the test code file(WRITE ${FortranTest_DIR}/ctest1_${opt}.out "${MY_OUTPUT}") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove + # the CMakeFiles directory. file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) - # Test if we successfully created the "ctest" executable. - # If yes, save the current scheme, and set the counter "iopt" to "imax" - # so that we exit the while loop. - # Otherwise, increment the counter "iopt" and go back in the while loop. + # Test if we successfully created the "ctest" executable. If yes, save the + # current scheme, and set the counter "iopt" to "imax" so that we exit the + # while loop. Otherwise, increment the counter "iopt" and go back in the + # while loop. if(CTEST_OK) set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES ${opt}) set(iopt ${imax}) @@ -191,7 +194,8 @@ if(NEED_FORTRAN_NAME_MANGLING) # Infer Fortran name-mangling scheme for symbols WITH underscores. # Practically a duplicate of the previous steps. - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ctest2 C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -212,10 +216,11 @@ if(NEED_FORTRAN_NAME_MANGLING) while(${iopt} LESS ${imax}) list(GET options ${iopt} opt) file(WRITE ${FortranTest_DIR}/ctest2.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest2 OUTPUT_VARIABLE MY_OUTPUT) + "extern void ${opt}();\n" "int main(void){${opt}();return(0);}\n") + try_compile( + CTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ctest2 + OUTPUT_VARIABLE MY_OUTPUT) file(WRITE ${FortranTest_DIR}/ctest2_${opt}.out "${MY_OUTPUT}") file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) if(CTEST_OK) @@ -228,7 +233,8 @@ if(NEED_FORTRAN_NAME_MANGLING) # If a name-mangling scheme was found set the C preprocessor macros to use # that scheme. Otherwise default to lower case with one underscore. - if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) + if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES + AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) message(STATUS "Determining Fortran name-mangling scheme... OK") else() message(STATUS "Determining Fortran name-mangling scheme... DEFAULT") @@ -241,19 +247,23 @@ if(NEED_FORTRAN_NAME_MANGLING) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB") set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") endif() # Symbols WITH underscores @@ -261,28 +271,30 @@ if(NEED_FORTRAN_NAME_MANGLING) set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub_") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub__") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB_") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB__") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") endif() # name-mangling scheme has been set set(NEED_FORTRAN_NAME_MANGLING FALSE) - configure_file( - ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in - ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h - ) + configure_file(${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h) else(FTEST_OK) message(STATUS "Determining Fortran name-mangling scheme... FAILED") @@ -297,7 +309,8 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) file(MAKE_DIRECTORY ${LapackTest_DIR}) # Create a CMakeLists.txt file - file(WRITE ${LapackTest_DIR}/CMakeLists.txt + file( + WRITE ${LapackTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -312,8 +325,10 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) "ADD_EXECUTABLE(ltest ltest.c)\n" "TARGET_LINK_LIBRARIES(ltest ${LAPACK_LIBRARIES})\n") - # Create a C source file which calls a Blas function (dcopy) and an Lapack function (dgetrf) - file(WRITE ${LapackTest_DIR}/ltest.c + # Create a C source file which calls a Blas function (dcopy) and an Lapack + # function (dgetrf) + file( + WRITE ${LapackTest_DIR}/ltest.c "${LAPACK_MANGLE_MACRO1}\n" "#define dcopy_f77 SUNDIALS_LAPACK_FUNC(dcopy, DCOPY)\n" "#define dgetrf_f77 SUNDIALS_LAPACK_FUNC(dgetrf, DGETRF)\n" @@ -329,20 +344,25 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) "}\n") # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${LapackTest_DIR} ${LapackTest_DIR} - ltest OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + COMPILE_OK ${LapackTest_DIR} + ${LapackTest_DIR} ltest + OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${LapackTest_DIR}/CMakeFiles) # Process test result if(COMPILE_OK) message(STATUS "Checking if LAPACK works with SUNDIALS... OK") - set(LAPACK_WORKS TRUE CACHE BOOL "LAPACK works with SUNDIALS as configured" FORCE) + set(LAPACK_WORKS + TRUE + CACHE BOOL "LAPACK works with SUNDIALS as configured" FORCE) # get path to LAPACK library to use in generated makefiles for examples, if - # LAPACK_LIBRARIES contains multiple items only use the path of the first entry + # LAPACK_LIBRARIES contains multiple items only use the path of the first + # entry list(LENGTH LAPACK_LIBRARIES len) if(len EQUAL 1) get_filename_component(LAPACK_LIBRARY_DIR ${LAPACK_LIBRARIES} PATH) @@ -351,7 +371,9 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) get_filename_component(LAPACK_LIBRARY_DIR ${TMP_LAPACK_LIBRARIES} PATH) endif() else(COMPILE_OK) - set(LAPACK_WORKS FALSE CACHE BOOL "LAPACK does not work with SUNDIALS as configured" FORCE) + set(LAPACK_WORKS + FALSE + CACHE BOOL "LAPACK does not work with SUNDIALS as configured" FORCE) message(STATUS "Checking if LAPACK works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") @@ -359,5 +381,8 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) endif() elseif(LAPACK_LIBRARIES AND LAPACK_WORKS) - message(STATUS "Skipped LAPACK tests, assuming LAPACK works with SUNDIALS. Set LAPACK_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped LAPACK tests, assuming LAPACK works with SUNDIALS. Set LAPACK_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsMAGMA.cmake b/cmake/tpl/SundialsMAGMA.cmake index 6b11a92b8d..6fb0284713 100644 --- a/cmake/tpl/SundialsMAGMA.cmake +++ b/cmake/tpl/SundialsMAGMA.cmake @@ -37,7 +37,9 @@ endif() # ----------------------------------------------------------------------------- if(SUNDIALS_PRECISION MATCHES "extended") - message(FATAL_ERROR "SUNDIALS MAGMA interface is not compatible with extended precision") + message( + FATAL_ERROR + "SUNDIALS MAGMA interface is not compatible with extended precision") endif() # ----------------------------------------------------------------------------- @@ -57,13 +59,21 @@ message(STATUS "SUNDIALS_MAGMA_BACKENDS: ${SUNDIALS_MAGMA_BACKENDS}") if(MAGMA_FOUND AND (NOT MAGMA_WORKS)) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend." + ) endif() if(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend." + ) endif() - set(MAGMA_WORKS TRUE CACHE BOOL "MAGMA works with SUNDIALS as configured" FORCE) + set(MAGMA_WORKS + TRUE + CACHE BOOL "MAGMA works with SUNDIALS as configured" FORCE) elseif(MAGMA_FOUND AND MAGMA_WORKS) message(STATUS "Skipped MAGMA tests, assuming MAGMA works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsMPI.cmake b/cmake/tpl/SundialsMPI.cmake index 63beb052c3..1905c66d5d 100644 --- a/cmake/tpl/SundialsMPI.cmake +++ b/cmake/tpl/SundialsMPI.cmake @@ -13,15 +13,11 @@ # --------------------------------------------------------------------------- # Setup MPI for SUNDIALS CMake-based configuration. # --------------------------------------------------------------------------- -# Prior to CMake 3.10 the CMake FindMPI module considers: -# 1. Inspect MPI wrappers (MPI_<lang>_COMPILER) -# 2. Try guesses -# 3. Try the compiler (CMAKE_<lang>_COMPILER) -# # Starting with CMake 3.10 the CMake FindMPI module considers: -# 1. Try the compiler (CMAKE_<lang>_COMPILER) -# 2. Inspect MPI wrappers (MPI_<lang>_COMPILER) -# 3. Try guesses +# +# 1. Try the compiler (CMAKE_<lang>_COMPILER) +# 2. Inspect MPI wrappers (MPI_<lang>_COMPILER) +# 3. Try guesses # --------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -35,25 +31,22 @@ else() endif() # --------------------------------------------------------------------------- -# If MPI_<lang>_COMPILER is set, FindMPI will try to set the below variables -# for the given compiler wrapper. If MPI_<lang>_COMPILER is unset FindMPI -# will attempt to locate an installed MPI library and set the below -# variables. -# -# MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang> -# MPI_<lang>_COMPILER MPI Compiler wrapper for <lang> -# MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs -# MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header -# MPI_<lang>_LINK_FLAGS Linking flags for MPI programs -# MPI_<lang>_LIBRARIES All libraries to link MPI programs against +# If MPI_<lang>_COMPILER is set, FindMPI will try to set the below variables for +# the given compiler wrapper. If MPI_<lang>_COMPILER is unset FindMPI will +# attempt to locate an installed MPI library and set the below variables. # -# MPIEXEC_EXECUTABLE Executable for running MPI programs -# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC_EXECUTABLE before -# giving it the number of processors to run on -# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC_EXECUTABLE directly -# before the executable to run. -# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC_EXECUTABLE after -# other flags +# * MPI_<lang>_FOUND -- TRUE if FindMPI found MPI flags for <lang> +# * MPI_<lang>_COMPILER -- MPI Compiler wrapper for <lang> +# * MPI_<lang>_COMPILE_FLAGS -- Compilation flags for MPI programs +# * MPI_<lang>_INCLUDE_PATH -- Include path(s) for MPI header +# * MPI_<lang>_LINK_FLAGS -- Linking flags for MPI programs +# * MPI_<lang>_LIBRARIES -- All libraries to link MPI programs against +# * MPIEXEC_EXECUTABLE -- Executable for running MPI programs +# * MPIEXEC_NUMPROC_FLAG -- Flag to pass to MPIEXEC_EXECUTABLE before giving it +# the number of processors to run on +# * MPIEXEC_PREFLAGS -- Flags to pass to MPIEXEC_EXECUTABLE directly before the +# executable to run. +# * MPIEXEC_POSTFLAGS -- Flags to pass to MPIEXEC_EXECUTABLE after other flags # --------------------------------------------------------------------------- mark_as_advanced(MPI_EXTRA_LIBRARY) diff --git a/cmake/tpl/SundialsONEMKL.cmake b/cmake/tpl/SundialsONEMKL.cmake index 693474e523..8fe11a2207 100644 --- a/cmake/tpl/SundialsONEMKL.cmake +++ b/cmake/tpl/SundialsONEMKL.cmake @@ -38,14 +38,15 @@ endif() # oneMKL does not support extended precision if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR - "oneMKL is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "oneMKL is not compatible with ${SUNDIALS_PRECISION} precision") endif() # oneMKL does not support 32-bit index sizes if(SUNDIALS_INDEX_SIZE MATCHES "32") - message(FATAL_ERROR - "oneMKL is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") + message( + FATAL_ERROR + "oneMKL is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") endif() # ----------------------------------------------------------------------------- @@ -59,10 +60,14 @@ if(ENABLE_SYCL) endif() # Look for CMake configuration file in oneMKL installation -find_package(MKL CONFIG - PATHS "${ONEMKL_DIR}" "${ONEMKL_DIR}/lib/cmake/mkl" - NO_DEFAULT_PATH - REQUIRED) +find_package( + MKL + CONFIG + PATHS + "${ONEMKL_DIR}" + "${ONEMKL_DIR}/lib/cmake/mkl" + NO_DEFAULT_PATH + REQUIRED) message(STATUS "MKL Version: ${MKL_VERSION}") message(STATUS "MKL Targets: ${MKL_IMPORTED_TARGETS}") @@ -73,7 +78,9 @@ message(STATUS "MKL Targets: ${MKL_IMPORTED_TARGETS}") if(MKL_FOUND AND (NOT ONEMKL_WORKS)) message(STATUS "Checking if oneMKL works... OK") - set(ONEMKL_WORKS TRUE CACHE BOOL "oneMKL works with SUNDIALS as configured" FORCE) + set(ONEMKL_WORKS + TRUE + CACHE BOOL "oneMKL works with SUNDIALS as configured" FORCE) else() message(STATUS "Skipped oneMKL tests, assuming oneMKL works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsOpenMP.cmake b/cmake/tpl/SundialsOpenMP.cmake index d845a27888..e59b47b670 100644 --- a/cmake/tpl/SundialsOpenMP.cmake +++ b/cmake/tpl/SundialsOpenMP.cmake @@ -54,37 +54,52 @@ find_package(OpenMP REQUIRED) # ----------------------------------------------------------------------------- # Work around a bug in setting OpenMP version variables in CMake >= 3.9. The -# OpenMP version information is not stored in cache variables and is not set -# on repeated calls to find OpenMP (i.e., when using ccmake). To ensure these +# OpenMP version information is not stored in cache variables and is not set on +# repeated calls to find OpenMP (i.e., when using ccmake). To ensure these # variables exist store copies of the values. -set(OpenMP_C_VERSION "${OpenMP_C_VERSION}" CACHE INTERNAL "" FORCE) -set(OpenMP_CXX_VERSION "${OpenMP_CXX_VERSION}" CACHE INTERNAL "" FORCE) -set(OpenMP_Fortran_VERSION "${OpenMP_Fortran_VERSION}" CACHE INTERNAL "" FORCE) +set(OpenMP_C_VERSION + "${OpenMP_C_VERSION}" + CACHE INTERNAL "" FORCE) +set(OpenMP_CXX_VERSION + "${OpenMP_CXX_VERSION}" + CACHE INTERNAL "" FORCE) +set(OpenMP_Fortran_VERSION + "${OpenMP_Fortran_VERSION}" + CACHE INTERNAL "" FORCE) # Check for OpenMP offloading support if(OPENMP_FOUND AND (ENABLE_OPENMP_DEVICE OR SUPERLUDIST_OpenMP)) if(OPENMP_DEVICE_WORKS) - # The user has asked for checks to be skipped, assume offloading is supported + # The user has asked for checks to be skipped, assume offloading is + # supported set(OPENMP45_FOUND TRUE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING TRUE) - message(WARNING "Skipping OpenMP device/version check." "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed.") + message( + WARNING + "Skipping OpenMP device/version check." + "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed." + ) else() # Check the OpenMP version message(STATUS "Checking whether OpenMP supports device offloading") - if((OpenMP_C_VERSION VERSION_EQUAL 4.5) OR (OpenMP_C_VERSION VERSION_GREATER 4.5)) - message(STATUS "Checking whether OpenMP supports device offloading -- yes") + if((OpenMP_C_VERSION VERSION_EQUAL 4.5) OR (OpenMP_C_VERSION VERSION_GREATER + 4.5)) + message( + STATUS "Checking whether OpenMP supports device offloading -- yes") set(OPENMP45_FOUND TRUE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING TRUE) else() message(STATUS "Checking whether OpenMP supports device offloading -- no") set(OPENMP45_FOUND FALSE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING FALSE) - message(FATAL_ERROR "The found OpenMP version does not support device offloading.") + message( + FATAL_ERROR + "The found OpenMP version does not support device offloading.") endif() endif() diff --git a/cmake/tpl/SundialsPETSC.cmake b/cmake/tpl/SundialsPETSC.cmake index dddcf47180..e31b46c397 100644 --- a/cmake/tpl/SundialsPETSC.cmake +++ b/cmake/tpl/SundialsPETSC.cmake @@ -38,11 +38,15 @@ endif() # Using PETSc requires building with MPI enabled if(ENABLE_PETSC AND NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for PETSc support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for PETSc support. Set ENABLE_MPI to ON.") endif() if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision" + ) endif() # ----------------------------------------------------------------------------- @@ -63,30 +67,37 @@ message(STATUS "PETSC_PRECISION: ${PETSC_PRECISION}") # ----------------------------------------------------------------------------- if(PETSC_FOUND AND (NOT PETSC_WORKS)) - # No need for any compile tests because the FindPETSC module - # does compile tests already. + # No need for any compile tests because the FindPETSC module does compile + # tests already. if(NOT ("${SUNDIALS_INDEX_SIZE}" MATCHES "${PETSC_INDEX_SIZE}")) - string(CONCAT _err_msg_string - "PETSc not functional due to index size mismatch:\n" - "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " - "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" - "PETSC_DIR: ${PETSC_DIR}\n") + string( + CONCAT _err_msg_string + "PETSc not functional due to index size mismatch:\n" + "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " + "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" + "PETSC_DIR: ${PETSC_DIR}\n") message(FATAL_ERROR "${_err_msg_string}") endif() string(TOUPPER "${PETSC_PRECISION}" _petsc_precision) string(TOUPPER "${SUNDIALS_PRECISION}" _sundials_precision) if(NOT ("${_sundials_precision}" MATCHES "${_petsc_precision}")) - string(CONCAT _err_msg_string - "PETSc not functional due to real type precision mismatch:\n" - "SUNDIALS_PRECISION=${_sundials_precision}, " - "but PETSc was built with ${_petsc_precision} precision\n" - "PETSC_DIR: ${PETSC_DIR}\n") + string( + CONCAT _err_msg_string + "PETSc not functional due to real type precision mismatch:\n" + "SUNDIALS_PRECISION=${_sundials_precision}, " + "but PETSc was built with ${_petsc_precision} precision\n" + "PETSC_DIR: ${PETSC_DIR}\n") message(FATAL_ERROR "${_err_msg_string}") endif() - set(PETSC_WORKS TRUE CACHE BOOL "PETSC works with SUNDIALS as configured" FORCE) + set(PETSC_WORKS + TRUE + CACHE BOOL "PETSC works with SUNDIALS as configured" FORCE) elseif(PETSC_FOUND AND PETSC_WORKS) - message(STATUS "Skipped PETSC tests, assuming PETSC works with SUNDIALS. Set PETSC_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped PETSC tests, assuming PETSC works with SUNDIALS. Set PETSC_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsPOSIXTimers.cmake b/cmake/tpl/SundialsPOSIXTimers.cmake index 4670849ac5..edf9e4cf29 100644 --- a/cmake/tpl/SundialsPOSIXTimers.cmake +++ b/cmake/tpl/SundialsPOSIXTimers.cmake @@ -17,20 +17,21 @@ macro(posix_timers_test) - set(options ) + set(options) set(oneValueArgs POSIX RT_LIB) - set(multiValueArgs ) + set(multiValueArgs) # parse keyword arguments/options - cmake_parse_arguments(posix_timers_test - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(posix_timers_test "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # Test timers with a simple program set(POSIX_TIMER_TEST_DIR ${PROJECT_BINARY_DIR}/POSIX_TIMER_TEST) file(MAKE_DIRECTORY ${POSIX_TIMER_TEST_DIR}) # Create a CMakeLists.txt file which will generate the test executable - file(WRITE ${POSIX_TIMER_TEST_DIR}/CMakeLists.txt + file( + WRITE ${POSIX_TIMER_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -48,7 +49,8 @@ macro(posix_timers_test) "TARGET_LINK_LIBRARIES(ltest \"${posix_timers_test_RT_LIB}\")\n") # Create a simple C source for testing - file(WRITE ${POSIX_TIMER_TEST_DIR}/ltest.c + file( + WRITE ${POSIX_TIMER_TEST_DIR}/ltest.c "#include <time.h>\n" "#include <unistd.h>\n" "int main(void) {\n" @@ -58,18 +60,19 @@ macro(posix_timers_test) "return(0);\n" "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${POSIX_TIMER_TEST_DIR}/CMakeFiles) # Use TRY_COMPILE to make the target - try_compile(COMPILE_OK ${POSIX_TIMER_TEST_DIR} ${POSIX_TIMER_TEST_DIR} ltest + try_compile( + COMPILE_OK ${POSIX_TIMER_TEST_DIR} + ${POSIX_TIMER_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) endmacro() - -if (NOT SUNDIALS_POSIX_TIMERS) +if(NOT SUNDIALS_POSIX_TIMERS) # Test for timers without any modifications posix_timers_test() @@ -81,7 +84,8 @@ if (NOT SUNDIALS_POSIX_TIMERS) if(NOT COMPILE_OK) posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L") if(COMPILE_OK) - message(STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE)... found") + message( + STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE)... found") set(POSIX_TIMERS_NEED_POSIX_C_SOURCE TRUE) endif() endif() @@ -109,9 +113,13 @@ if (NOT SUNDIALS_POSIX_TIMERS) # Test failed, try again linking to rt and with -D_POSIX_C_SOURCE=200112L if((NOT COMPILE_OK) AND SUNDIALS_RT_LIBRARY) - posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L" RT_LIB "${SUNDIALS_RT_LIBRARY}") + posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L" RT_LIB + "${SUNDIALS_RT_LIBRARY}") if(COMPILE_OK) - message(STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE and linking to rt)... found") + message( + STATUS + "Looking for POSIX timers (setting _POSIX_C_SOURCE and linking to rt)... found" + ) set(POSIX_TIMERS_NEED_POSIX_C_SOURCE TRUE) set(POSIX_TIMERS_NEED_RT_LIBRARY TRUE) set(EXE_EXTRA_LINK_LIBS ${EXE_EXTRA_LINK_LIBS} ${SUNDIALS_RT_LIBRARY}) diff --git a/cmake/tpl/SundialsRAJA.cmake b/cmake/tpl/SundialsRAJA.cmake index 1084eb9f6f..64404801b0 100644 --- a/cmake/tpl/SundialsRAJA.cmake +++ b/cmake/tpl/SundialsRAJA.cmake @@ -53,27 +53,36 @@ endif() # ----------------------------------------------------------------------------- # find the library configuration file -find_file(RAJA_CONFIGHPP_PATH config.hpp - HINTS "${RAJA_DIR}" - PATH_SUFFIXES include include/RAJA - NO_DEFAULT_PATH) +find_file( + RAJA_CONFIGHPP_PATH config.hpp + HINTS "${RAJA_DIR}" + PATH_SUFFIXES include include/RAJA + NO_DEFAULT_PATH) mark_as_advanced(FORCE RAJA_CONFIGHPP_PATH) # Look for CMake configuration file in RAJA installation -find_package(RAJA CONFIG - PATHS "${RAJA_DIR}" "${RAJA_DIR}/share/raja/cmake" - NO_DEFAULT_PATH - REQUIRED) +find_package( + RAJA + CONFIG + PATHS + "${RAJA_DIR}" + "${RAJA_DIR}/share/raja/cmake" + NO_DEFAULT_PATH + REQUIRED) # determine the backends foreach(_backend CUDA HIP OPENMP TARGET_OPENMP SYCL) - file(STRINGS "${RAJA_CONFIGHPP_PATH}" _raja_has_backend REGEX "^#define RAJA_ENABLE_${_backend}\$") + file(STRINGS "${RAJA_CONFIGHPP_PATH}" _raja_has_backend + REGEX "^#define RAJA_ENABLE_${_backend}\$") if(_raja_has_backend) set(RAJA_BACKENDS "${_backend};${RAJA_BACKENDS}") endif() endforeach() -message(STATUS "RAJA Version: ${RAJA_VERSION_MAJOR}.${RAJA_VERSION_MINOR}.${RAJA_VERSION_PATCHLEVEL}") +message( + STATUS + "RAJA Version: ${RAJA_VERSION_MAJOR}.${RAJA_VERSION_MINOR}.${RAJA_VERSION_PATCHLEVEL}" +) message(STATUS "RAJA Backends: ${RAJA_BACKENDS}") set(RAJA_NEEDS_THREADS OFF) @@ -82,9 +91,9 @@ if("${RAJA_BACKENDS}" MATCHES "CUDA") if(NOT TARGET Threads::Threads) find_package(Threads) endif() - # The RAJA target links to camp which links to a target 'cuda_runtime' - # which is normally provided by BLT. Since we do not use BLT, we instead - # create the target here and tell it to link to CUDA::cudart. + # The RAJA target links to camp which links to a target 'cuda_runtime' which + # is normally provided by BLT. Since we do not use BLT, we instead create the + # target here and tell it to link to CUDA::cudart. if(NOT TARGET cuda_runtime) add_library(cuda_runtime INTERFACE IMPORTED) target_link_libraries(cuda_runtime INTERFACE CUDA::cudart) @@ -94,25 +103,39 @@ endif() # Section 4: Test the TPL # ----------------------------------------------------------------------------- -if((SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") AND - (NOT RAJA_BACKENDS MATCHES "CUDA")) - message(FATAL_ERROR "Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") AND (NOT RAJA_BACKENDS MATCHES "CUDA" + )) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend." + ) endif() -if((SUNDIALS_RAJA_BACKENDS MATCHES "HIP") AND - (NOT RAJA_BACKENDS MATCHES "HIP")) - message(FATAL_ERROR "Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "HIP") AND (NOT RAJA_BACKENDS MATCHES "HIP")) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend." + ) endif() if(NOT ENABLE_OPENMP AND RAJA_BACKENDS MATCHES "OPENMP") - message(FATAL_ERROR "RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON.") + message( + FATAL_ERROR + "RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON." + ) endif() if(NOT ENABLE_OPENMP_DEVICE AND RAJA_BACKENDS MATCHES "TARGET_OPENMP") - message(FATAL_ERROR "RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON.") + message( + FATAL_ERROR + "RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON." + ) endif() -if((SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") AND - (NOT RAJA_BACKENDS MATCHES "SYCL")) - message(FATAL_ERROR "Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") AND (NOT RAJA_BACKENDS MATCHES "SYCL" + )) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend." + ) endif() diff --git a/cmake/tpl/SundialsSuperLUDIST.cmake b/cmake/tpl/SundialsSuperLUDIST.cmake index 2dfc84a565..cd5d63421f 100644 --- a/cmake/tpl/SundialsSuperLUDIST.cmake +++ b/cmake/tpl/SundialsSuperLUDIST.cmake @@ -38,17 +38,25 @@ endif() # SuperLU_DIST only supports double precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") endif() # Using SUPERLUDIST requires building with MPI enabled if(ENABLE_SUPERLUDIST AND NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR + "MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") endif() # Using SUPERLUDIST with OpenMP requires building with OpenMP enabled -if(ENABLE_SUPERLUDIST AND SUPERLUDIST_OpenMP AND NOT ENABLE_OPENMP) - message(FATAL_ERROR "OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") +if(ENABLE_SUPERLUDIST + AND SUPERLUDIST_OpenMP + AND NOT ENABLE_OPENMP) + message( + FATAL_ERROR + "OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") endif() # ----------------------------------------------------------------------------- @@ -77,25 +85,41 @@ message(STATUS "SUPERLUDIST_ROCM: ${SUPERLUDIST_ROCM}") if(SUPERLUDIST_FOUND AND (NOT SUPERLUDIST_WORKS)) if(SUPERLUDIST_CUDA AND (NOT ENABLE_CUDA)) - message(FATAL_ERROR "SuperLU_DIST was built with CUDA but SUNDIALS does not have CUDA enabled. Set ENABLE_CUDA=TRUE.") + message( + FATAL_ERROR + "SuperLU_DIST was built with CUDA but SUNDIALS does not have CUDA enabled. Set ENABLE_CUDA=TRUE." + ) endif() if(SUPERLUDIST_HIP AND (NOT ENABLE_HIP)) - message(FATAL_ERROR "SuperLU_DIST was built with HIP but SUNDIALS does not have HIP enabled. Set ENABLE_HIP=TRUE.") + message( + FATAL_ERROR + "SuperLU_DIST was built with HIP but SUNDIALS does not have HIP enabled. Set ENABLE_HIP=TRUE." + ) endif() # Check index size if(NOT (SUNDIALS_INDEX_SIZE STREQUAL SUPERLUDIST_INDEX_SIZE)) - set(_err_msg_string "SuperLU_DIST not functional due to index size mismatch:\n") - string(APPEND _err_msg_string "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, but SuperLU_DIST was built with ${SUPERLUDIST_INDEX_SIZE}-bit indices\n") - string(APPEND _err_msg_string "SUPERLUDIST_INCLUDE_DIRS: ${SUPERLUDIST_INCLUDE_DIRS}\n") + set(_err_msg_string + "SuperLU_DIST not functional due to index size mismatch:\n") + string( + APPEND + _err_msg_string + "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, but SuperLU_DIST was built with ${SUPERLUDIST_INDEX_SIZE}-bit indices\n" + ) + string(APPEND _err_msg_string + "SUPERLUDIST_INCLUDE_DIRS: ${SUPERLUDIST_INCLUDE_DIRS}\n") message(FATAL_ERROR "${_err_msg_string}") endif() - message(STATUS "Checking if SuperLU_DIST works with SUNDIALS... OK") - set(SUPERLUDIST_WORKS TRUE CACHE BOOL "SuperLU_DIST works with SUNDIALS as configured" FORCE) + set(SUPERLUDIST_WORKS + TRUE + CACHE BOOL "SuperLU_DIST works with SUNDIALS as configured" FORCE) elseif(SUPERLUDIST_FOUND AND SUPERLUDIST_WORKS) - message(STATUS "Skipped SuperLU_DIST tests, assuming SuperLU_DIST works with SUNDIALS. Set SUPERLUDIST_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped SuperLU_DIST tests, assuming SuperLU_DIST works with SUNDIALS. Set SUPERLUDIST_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsSuperLUMT.cmake b/cmake/tpl/SundialsSuperLUMT.cmake index a7b6bf863a..a6c62d8649 100644 --- a/cmake/tpl/SundialsSuperLUMT.cmake +++ b/cmake/tpl/SundialsSuperLUMT.cmake @@ -38,7 +38,9 @@ endif() # SUPERLUMT does not support extended precision if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -61,7 +63,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) file(MAKE_DIRECTORY ${SUPERLUMT_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${SUPERLUMT_TEST_DIR}/CMakeLists.txt + file( + WRITE ${SUPERLUMT_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -78,7 +81,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) "TARGET_LINK_LIBRARIES(ltest ${SUPERLUMT_LIBRARIES})\n") # Create a C source file which calls a SUPERLUMT function - file(WRITE ${SUPERLUMT_TEST_DIR}/ltest.c + file( + WRITE ${SUPERLUMT_TEST_DIR}/ltest.c "\#include \"slu_mt_ddefs.h\"\n" "int main(void) {\n" "SuperMatrix *A;\n" @@ -89,19 +93,22 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) "else return(0);\n" "}\n") - # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${SUPERLUMT_TEST_DIR} ${SUPERLUMT_TEST_DIR} ltest + try_compile( + COMPILE_OK ${SUPERLUMT_TEST_DIR} + ${SUPERLUMT_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${SUPERLUMT_TEST_DIR}/CMakeFiles) - # Process test result + # Process test result if(COMPILE_OK) message(STATUS "Checking if SuperLU_MT works with SUNDIALS... OK") - set(SUPERLUMT_WORKS TRUE CACHE BOOL "SuperLU_MT works with SUNDIALS as configured" FORCE) + set(SUPERLUMT_WORKS + TRUE + CACHE BOOL "SuperLU_MT works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if SuperLU_MT works with SUNDIALS... FAILED") message(STATUS "Check output: ") @@ -110,5 +117,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) endif() elseif(SUPERLUMT_FOUND AND SUPERLUMT_WORKS) - message(STATUS "Skipped SuperLU_MT tests, assuming SuperLU_MT works with SUNDIALS. Set SUPERLUMT_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped SuperLU_MT tests, assuming SuperLU_MT works with SUNDIALS. Set SUPERLUMT_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsTrilinos.cmake b/cmake/tpl/SundialsTrilinos.cmake index 849eef6319..7f8940ef90 100644 --- a/cmake/tpl/SundialsTrilinos.cmake +++ b/cmake/tpl/SundialsTrilinos.cmake @@ -43,9 +43,8 @@ endif() # Find Trilinos find_package(Trilinos REQUIRED) -# Check if Trilinos was built with MPI -# Starting with TriBITS 2022-10-16 <Project_TPL_LIST> is no longer defined so we -# base MPI support on ENABLE_MPI +# Check if Trilinos was built with MPI Starting with TriBITS 2022-10-16 +# <Project_TPL_LIST> is no longer defined so we base MPI support on ENABLE_MPI if(Trilinos_TPL_LIST) if(";${Trilinos_TPL_LIST};" MATCHES ";MPI;") set(Trilinos_MPI TRUE) @@ -60,37 +59,66 @@ else() endif() endif() -# For XSDK compatibility, only use the user/spack provided compiler and flags to build -# SUNDIALS modules that use Trilinos. If we are not in XSDK mode, we can use the imported -# Trilinos compiler and flags by default, but allow the user to change it through CMake -# the Trilinos_INTERFACE_* options. +# For XSDK compatibility, only use the user/spack provided compiler and flags to +# build SUNDIALS modules that use Trilinos. If we are not in XSDK mode, we can +# use the imported Trilinos compiler and flags by default, but allow the user to +# change it through CMake the Trilinos_INTERFACE_* options. if(USE_XSDK_DEFAULTS) if(Trilinos_MPI AND MPI_CXX_FOUND) - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" "${MPI_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING + "C++ compiler for Trilinos interface" "${MPI_CXX_COMPILER}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") else() - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C compiler for Trilinos interface" "${CMAKE_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND FALSE CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING + "C compiler for Trilinos interface" "${CMAKE_CXX_COMPILER}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + FALSE + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") endif() if(Trilinos_MPI AND MPI_C_FOUND) - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${MPI_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${MPI_C_COMPILER}") + set(Trilinos_INTERFACE_MPI_C_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C compiler MPI") else() - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${CMAKE_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND FALSE CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${CMAKE_C_COMPILER}") + set(Trilinos_INTERFACE_MPI_C_FOUND + FALSE + CACHE INTERNAL "Is Trilinos interface C compiler MPI") endif() - force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING "C++ compiler flags specific to Trilinos interface" "") - force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING "C compiler flags specific to Trilinos interface" "") - force_variable(Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" "${MPIEXEC_EXECUTABLE}") + force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags specific to Trilinos interface" "") + force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags specific to Trilinos interface" "") + force_variable( + Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" + "${MPIEXEC_EXECUTABLE}") else() - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}") - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}") - force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}") - force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}") - force_variable(Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") - set(Trilinos_INTERFACE_MPI_C_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable( + Trilinos_INTERFACE_CXX_COMPILER STRING + "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}") + force_variable( + Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags for Trilinos interface" + "${Trilinos_CXX_COMPILER_FLAGS}") + force_variable( + Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}") + force_variable(Trilinos_INTERFACE_MPIEXEC STRING + "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + set(Trilinos_INTERFACE_MPI_C_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C compiler MPI") endif() message(STATUS "Trilinos_MPI: ${Trilinos_MPI}") @@ -109,7 +137,8 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) file(MAKE_DIRECTORY ${Trilinos_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${Trilinos_TEST_DIR}/CMakeLists.txt + file( + WRITE ${Trilinos_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest CXX)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -125,20 +154,21 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) # Create a C++ source file which calls a Trilinos function file(WRITE ${Trilinos_TEST_DIR}/ltest.cpp - "#include <Tpetra_Version.hpp>\n" - "int main(void) {\n" - "std::cout << Tpetra::version() << std::endl;\n" - "return(0);\n" - "}\n") + "#include <Tpetra_Version.hpp>\n" "int main(void) {\n" + "std::cout << Tpetra::version() << std::endl;\n" "return(0);\n" "}\n") # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${Trilinos_TEST_DIR} ${Trilinos_TEST_DIR} ltest + try_compile( + COMPILE_OK ${Trilinos_TEST_DIR} + ${Trilinos_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if Trilinos works with SUNDIALS... OK") - set(Trilinos_WORKS TRUE CACHE BOOL "Trilinos works with SUNDIALS as configured" FORCE) + set(Trilinos_WORKS + TRUE + CACHE BOOL "Trilinos works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if Trilinos works with SUNDIALS... FAILED") message(STATUS "Check output: ") @@ -147,5 +177,8 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) endif() elseif(Trilinos_FOUND AND Trilinos_WORKS) - message(STATUS "Skipped Trilinos tests, assuming Trilinos works with SUNDIALS. Set Trilinos_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped Trilinos tests, assuming Trilinos works with SUNDIALS. Set Trilinos_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsXBRAID.cmake b/cmake/tpl/SundialsXBRAID.cmake index e8e8ceb941..ede169ade0 100644 --- a/cmake/tpl/SundialsXBRAID.cmake +++ b/cmake/tpl/SundialsXBRAID.cmake @@ -38,20 +38,21 @@ endif() # Using XBRAID requires building with MPI enabled if(NOT ENABLE_MPI) - message(FATAL_ERROR - "MPI is required for XBraid support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for XBraid support. Set ENABLE_MPI to ON.") endif() # XBraid does not support single or extended precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR - "XBraid is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "XBraid is not compatible with ${SUNDIALS_PRECISION} precision") endif() # XBraid does not support 64-bit index sizes if(SUNDIALS_INDEX_SIZE MATCHES "64") - message(FATAL_ERROR - "XBraid is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") + message( + FATAL_ERROR + "XBraid is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") endif() # ----------------------------------------------------------------------------- @@ -76,7 +77,8 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) file(MAKE_DIRECTORY ${XBRAID_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${XBRAID_TEST_DIR}/CMakeLists.txt + file( + WRITE ${XBRAID_TEST_DIR}/CMakeLists.txt "cmake_minimum_required(VERSION ${CMAKE_VERSION})\n" "project(ltest C)\n" "set(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -94,7 +96,8 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) "target_link_libraries(ltest m)\n") # Create a C source file - file(WRITE ${XBRAID_TEST_DIR}/ltest.c + file( + WRITE ${XBRAID_TEST_DIR}/ltest.c "\#include <stdlib.h>\n" "\#include \"braid.h\"\n" "int main(void) {\n" @@ -104,18 +107,22 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) "return 0;\n" "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${XBRAID_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${XBRAID_TEST_DIR} ${XBRAID_TEST_DIR} ltest + try_compile( + COMPILE_OK ${XBRAID_TEST_DIR} + ${XBRAID_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if XBRAID works... OK") - set(XBRAID_WORKS TRUE CACHE BOOL "XBRAID works as configured" FORCE) + set(XBRAID_WORKS + TRUE + CACHE BOOL "XBRAID works as configured" FORCE) else() message(STATUS "Checking if XBRAID works... FAILED") message(STATUS "Check output: ") diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index a01897bdf2..5a05602867 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -186,7 +186,8 @@ not adhere to all of these rules. #. All new code added to SUNDIALS should be formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_ for C/C++, `fprettify - <https://github.com/fortran-lang/fprettify>`_ for Fortran, and `black + <https://github.com/fortran-lang/fprettify>`_ for Fortran, `cmake-format + <https://cmake-format.readthedocs.io>`_ for CMake, and `black <https://black.readthedocs.io>`_ for Python. See :ref:`Style.Formatting` for details. @@ -380,18 +381,21 @@ Formatting All new code added to SUNDIALS should be formatted with `clang-format <https://clang.llvm.org/docs/ClangFormat.html>`_ for C/C++, `fprettify -<https://github.com/fortran-lang/fprettify>`_ for Fortran, and `black +<https://github.com/fortran-lang/fprettify>`_ for Fortran, `cmake-format +<https://cmake-format.readthedocs.io>`_ for CMake, and `black <https://black.readthedocs.io>`_ for Python. The ``.clang-format`` file in the root of the project defines our configuration for clang-format. We use the -default fprettify settings, except we use 2-space indentation. We also use the -default black settings. +default fprettify settings, except we use 2-space indentation. The +``.cmake-format.py`` file in the root of the project defines our configuration +for cmake-format. We also use the default black settings. -To apply ``clang-format``, ``fprettify``, and ``black`` you can run: -.. code-block:: shell +To apply ``clang-format``, ``fprettify``, ``cmake-format``, and ``black`` you +can run: - ./scripts/format.sh <path to directories to format> +.. code-block:: shell + ./scripts/format.sh <path to directories or files to format> .. warning:: @@ -401,7 +405,6 @@ To apply ``clang-format``, ``fprettify``, and ``black`` you can run: formatting is required, the action will fail and produce a git patch artifact that you can download (from the job artifacts section) and apply with ``git apply``. - If clang-format breaks lines in a way that is unreadable, use ``//`` to break the line. For example, sometimes (mostly in C++ code) you may have code like this: @@ -457,4 +460,3 @@ There are other scenarios (e.g., a function call with a lot of parameters) where .. }; .. See the clang-tidy documentation for more details. - diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 55b1e52db4..45990b05da 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,8 @@ # --------------------------------------------------------------- # We need this to ensure the installed templates have MPI when ENABLE_MPI=TRUE, -# at least until we convert all of the templates to use the SUNDIALS CMake target. +# at least until we convert all of the templates to use the SUNDIALS CMake +# target. # =================================================================== # Configure compilers for installed examples @@ -24,10 +25,14 @@ foreach(lang ${_SUNDIALS_ENABLED_LANGS}) if(ENABLE_MPI) if(DEFINED MPI_${lang}_COMPILER) - set(_EXAMPLES_${lang}_COMPILER "${MPI_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${MPI_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() else() - set(_EXAMPLES_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${CMAKE_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() endforeach() @@ -62,7 +67,9 @@ if(EXAMPLES_INSTALL) if(CXX_FOUND) set(CXX "${_EXAMPLES_CXX_COMPILER}") set(CXX_LNKR "${_EXAMPLES_CXX_COMPILER}") - set(CXXFLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}") + set(CXXFLAGS + "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" + ) set(CXX_LDFLAGS "${CMAKE_CXX_FLAGS_RELEASE}") list2string(EXE_EXTRA_LINK_LIBS CXX_LIBS) endif() diff --git a/examples/arkode/CMakeLists.txt b/examples/arkode/CMakeLists.txt index defe97ed7c..bfcbe267fd 100644 --- a/examples/arkode/CMakeLists.txt +++ b/examples/arkode/CMakeLists.txt @@ -23,7 +23,9 @@ if(EXAMPLES_ENABLE_C) if(ENABLE_OPENMP AND OPENMP_FOUND) add_subdirectory(C_openmp) endif() - if(ENABLE_OPENMP_DEVICE AND OPENMP_FOUND AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) + if(ENABLE_OPENMP_DEVICE + AND OPENMP_FOUND + AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) add_subdirectory(C_openmpdev) endif() if(ENABLE_MPI AND MPI_C_FOUND) @@ -43,7 +45,10 @@ if(EXAMPLES_ENABLE_CXX) if(ENABLE_MPI AND MPI_CXX_FOUND) add_subdirectory(CXX_parallel) endif() - if(ENABLE_MPI AND MPI_CXX_FOUND AND ENABLE_HYPRE AND HYPRE_FOUND) + if(ENABLE_MPI + AND MPI_CXX_FOUND + AND ENABLE_HYPRE + AND HYPRE_FOUND) add_subdirectory(CXX_parhyp) endif() if(MPI_CXX_FOUND AND ENABLE_SUPERLUDIST) diff --git a/examples/arkode/CXX_parallel/CMakeLists.txt b/examples/arkode/CXX_parallel/CMakeLists.txt index 9e11a5cfe5..2ebc00df7e 100644 --- a/examples/arkode/CXX_parallel/CMakeLists.txt +++ b/examples/arkode/CXX_parallel/CMakeLists.txt @@ -37,8 +37,8 @@ macro(build_examples examples_to_build lang) set(example_target "${example_target}.${example_defines}") endif() - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) set_source_files_properties(${example} PROPERTIES LANGUAGE ${lang}) @@ -54,10 +54,11 @@ macro(build_examples examples_to_build lang) # libraries to link against target_include_directories(${example_target} - PRIVATE ${MPI_CXX_INCLUDE_DIRS}) + PRIVATE ${MPI_CXX_INCLUDE_DIRS}) - target_link_libraries(${example_target} - PRIVATE ${OTHER_LIBS} ${SUNDIALS_LIBS} ${MPI_CXX_LIBRARIES}) + target_link_libraries( + ${example_target} PRIVATE ${OTHER_LIBS} ${SUNDIALS_LIBS} + ${MPI_CXX_LIBRARIES}) # compile definitions if(example_defines) @@ -74,7 +75,8 @@ macro(build_examples examples_to_build lang) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -91,7 +93,7 @@ macro(build_examples examples_to_build lang) # Install example source and out files install(FILES ${example} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parallel) endif() @@ -102,11 +104,12 @@ endmacro() # Examples to build and install # ----------------------------- -# Example lists are tuples "name\;compile defs\;args\;nodes\;tasks\;type\;float precision" -# where the type develop is for examples excluded from 'make test' in releases. +# Example lists are tuples "name\;compile defs\;args\;nodes\;tasks\;type\;float +# precision" where the type develop is for examples excluded from 'make test' in +# releases. # List of headers to install (appended to below) -set(ARKODE_headers ) +set(ARKODE_headers) # List of additional files to install (appended to below) set(ARKODE_extras) @@ -118,8 +121,7 @@ set(OTHER_LIBS ${EXE_EXTRA_LINK_LIBS}) # MPI examples # ------------ -set(serial_examples - "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default") +set(serial_examples "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default") set(SUNDIALS_LIBS sundials_arkode sundials_nvecparallel) build_examples(serial_examples CXX) @@ -132,11 +134,13 @@ list(APPEND ARKODE_extras plot_heat2D_p.py) if(BUILD_CVODE) set(examples_cvode - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --imex\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-arkstep\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-global\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-local\;1\;4\;exclude-single\;default") - set(SUNDIALS_LIBS sundials_arkode sundials_cvode sundials_nvecparallel sundials_nvecmpiplusx) + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --imex\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-arkstep\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-global\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-local\;1\;4\;exclude-single\;default" + ) + set(SUNDIALS_LIBS sundials_arkode sundials_cvode sundials_nvecparallel + sundials_nvecmpiplusx) build_examples(examples_cvode CXX) endif() @@ -144,8 +148,9 @@ endif() # RAJA Examples # ------------- -if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND - (SUNDIALS_INDEX_SIZE MATCHES "32")) +if(ENABLE_RAJA + AND (SUNDIALS_PRECISION MATCHES "DOUBLE") + AND (SUNDIALS_INDEX_SIZE MATCHES "32")) # Header files to install list(APPEND ARKODE_headers ark_brusselator1D.h) @@ -160,7 +165,8 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND endif() # If RAJA has OpenMP enabled, we have to link to OpenMP even if we dont use it - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(OTHER_LIBS OpenMP::OpenMP_CXX ${OTHER_LIBS}) endif() @@ -169,9 +175,10 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND # ------------- set(serial_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --explicit --tf 1\;1\;4\;develop\;2") + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --explicit --tf 1\;1\;4\;develop\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx) build_examples(serial_raja_examples CXX) @@ -183,16 +190,18 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_CUDA) set(cuda_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDAUVM_NVEC\;--monitor\;1\;4\;exclude\;2" - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor --global-nls\;1\;4\;develop\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDAUVM_NVEC\;--monitor\;1\;4\;exclude\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor --global-nls\;1\;4\;develop\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nveccuda) build_examples(cuda_raja_examples CUDA) endif() if(BUILD_NVECTOR_RAJA AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) set(raja_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_RAJA_NVEC\;--monitor\;1\;4\;exclude\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_RAJA_NVEC\;--monitor\;1\;4\;exclude\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvecraja) build_examples(raja_raja_examples CUDA) endif() @@ -203,7 +212,8 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_HIP AND (RAJA_BACKENDS MATCHES "HIP")) set(hip_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_HIP_NVEC\;--monitor\;1\;4\;exclude\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_HIP_NVEC\;--monitor\;1\;4\;exclude\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvechip) build_examples(hip_raja_examples CXX) endif() @@ -214,16 +224,18 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_OPENMPDEV AND (RAJA_BACKENDS MATCHES "TARGET_OPENMP")) set(openmpdev_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_OMPDEV_NVEC\;--monitor\;1\;4\;exclude\;2") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvecopenmpdev) + "ark_brusselator1D_task_local_nls.cpp\;USE_OMPDEV_NVEC\;--monitor\;1\;4\;exclude\;2" + ) + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx + sundials_nvecopenmpdev) build_examples(openmpdev_raja_examples CXX) endif() endif() endif() - if(EXAMPLES_INSTALL) set(examples_to_install "${serial_examples}") @@ -235,35 +247,24 @@ if(EXAMPLES_INSTALL) endif() # For now do not install the RAJA examples because they need to built as CUDA - # code when RAJA is built with CUDA - # if(serial_raja_examples) - # list(APPEND examples_to_install "${serial_raja_examples}") - # list(APPEND _sundials_targets nvecmpiplusx) - - # if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) - # set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") - # endif() - - # if(RAJA_NEEDS_THREADS) - # set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") - # endif() + # code when RAJA is built with CUDA if(serial_raja_examples) list(APPEND + # examples_to_install "${serial_raja_examples}") list(APPEND _sundials_targets + # nvecmpiplusx) + + # if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES + # "OPENMP")) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") # endif() - sundials_install_examples(arkode examples_to_install - CMAKE_TEMPLATE - cmakelists_CXX_MPI_ex.in - SUNDIALS_TARGETS - ${_sundials_targets} - OTHER_TARGETS - ${EXE_EXTRA_LINK_LIBS} - DESTINATION - arkode/CXX_parallel - EXTRA_FILES - ${ARKODE_headers} - ${ARKODE_extras} - README - TEST_INSTALL - CXX_parallel - ) + # if(RAJA_NEEDS_THREADS) set(EXAMPLES_FIND_PACKAGE + # "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() endif() + + sundials_install_examples( + arkode examples_to_install + CMAKE_TEMPLATE cmakelists_CXX_MPI_ex.in + SUNDIALS_TARGETS ${_sundials_targets} + OTHER_TARGETS ${EXE_EXTRA_LINK_LIBS} + DESTINATION arkode/CXX_parallel + EXTRA_FILES ${ARKODE_headers} ${ARKODE_extras} README + TEST_INSTALL CXX_parallel) endif() diff --git a/examples/arkode/CXX_parhyp/CMakeLists.txt b/examples/arkode/CXX_parhyp/CMakeLists.txt index 40e7fb13d5..a56531b5e1 100644 --- a/examples/arkode/CXX_parhyp/CMakeLists.txt +++ b/examples/arkode/CXX_parhyp/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for ARKODE C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg_mri\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg_imex\;--np 2 2\;1\;4\;develop" - ) + "ark_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg_mri\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg_imex\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(ARKODE_extras - plot_heat2D_p.py - ) +set(ARKODE_extras plot_heat2D_p.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -37,7 +34,6 @@ 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 example foreach(example_tuple ${ARKODE_examples}) @@ -48,8 +44,8 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -58,8 +54,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -70,7 +66,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -83,12 +80,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -97,7 +93,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -107,39 +104,32 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/CXX_serial/CMakeLists.txt b/examples/arkode/CXX_serial/CMakeLists.txt index 24ca919088..cdd673c777 100644 --- a/examples/arkode/CXX_serial/CMakeLists.txt +++ b/examples/arkode/CXX_serial/CMakeLists.txt @@ -15,42 +15,37 @@ # CMakeLists.txt file for ARKODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_analytic_sys.cpp\;\;develop" - "ark_heat2D.cpp\;\;develop" - "ark_kpr_Mt.cpp\;0 5\;develop" - "ark_kpr_Mt.cpp\;1 4\;develop" - "ark_kpr_Mt.cpp\;2 8 0 -10\;develop" - "ark_kpr_Mt.cpp\;0 4 1\;develop" - "ark_kpr_Mt.cpp\;0 -4\;exclude-single" - "ark_kpr_Mt.cpp\;1 -5\;exclude-single" - "ark_kpr_Mt.cpp\;2 -5 0 -10\;develop" - "ark_kpr_Mt.cpp\;1 -3 0 -10 0\;exclude-single" - "ark_kpr_Mt.cpp\;0 3 0 -10 0\;develop" - "ark_kpr_Mt.cpp\;2 4 0 -10 0\;develop" - "ark_kpr_Mt.cpp\;0 4 0 -10 1 10 1\;develop" - "ark_kpr_Mt.cpp\;0 4 0 -10 0 10 1\;develop" - "ark_pendulum.cpp\;\;develop" - ) + "ark_analytic_sys.cpp\;\;develop" + "ark_heat2D.cpp\;\;develop" + "ark_kpr_Mt.cpp\;0 5\;develop" + "ark_kpr_Mt.cpp\;1 4\;develop" + "ark_kpr_Mt.cpp\;2 8 0 -10\;develop" + "ark_kpr_Mt.cpp\;0 4 1\;develop" + "ark_kpr_Mt.cpp\;0 -4\;exclude-single" + "ark_kpr_Mt.cpp\;1 -5\;exclude-single" + "ark_kpr_Mt.cpp\;2 -5 0 -10\;develop" + "ark_kpr_Mt.cpp\;1 -3 0 -10 0\;exclude-single" + "ark_kpr_Mt.cpp\;0 3 0 -10 0\;develop" + "ark_kpr_Mt.cpp\;2 4 0 -10 0\;develop" + "ark_kpr_Mt.cpp\;0 4 0 -10 1 10 1\;develop" + "ark_kpr_Mt.cpp\;0 4 0 -10 0 10 1\;develop" + "ark_pendulum.cpp\;\;develop") # Header files to install set(ARKODE_headers) if(BUILD_CVODE) - list(APPEND ARKODE_examples - "ark_advection_diffusion_reaction.cpp\;\;develop") - list(APPEND ARKODE_headers - "ark_advection_diffusion_reaction.hpp") + list(APPEND ARKODE_examples "ark_advection_diffusion_reaction.cpp\;\;develop") + list(APPEND ARKODE_headers "ark_advection_diffusion_reaction.hpp") endif() # Auxiliary files to install -set(ARKODE_extras - plot_heat2D.py - plot_sol.py) +set(ARKODE_extras plot_heat2D.py plot_sol.py) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -71,14 +66,11 @@ foreach(example_tuple ${ARKODE_examples}) # directories to include target_include_directories(${example_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/examples/utilities) + PRIVATE ${PROJECT_SOURCE_DIR}/examples/utilities) # libraries to link against - target_link_libraries(${example_target} - sundials_arkode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_arkode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) if(BUILD_CVODE) target_link_libraries(${example_target} sundials_cvode) @@ -93,7 +85,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -110,25 +103,14 @@ if(EXAMPLES_INSTALL) endif() endif() - sundials_install_examples(arkode ARKODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - MAKE_TEMPLATE - makefile_serial_CXX_ex.in - SUNDIALS_TARGETS - nvecserial - arkode - ${_include_cvode} - ${_include_cvode_stubs} - DESTINATION - arkode/CXX_serial - EXTRA_FILES - README - ${ARKODE_extras} - ${ARKODE_headers} - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - TEST_INSTALL - CXX_serial - ) + sundials_install_examples( + arkode ARKODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + MAKE_TEMPLATE makefile_serial_CXX_ex.in + SUNDIALS_TARGETS nvecserial arkode ${_include_cvode} ${_include_cvode_stubs} + DESTINATION arkode/CXX_serial + EXTRA_FILES README ${ARKODE_extras} ${ARKODE_headers} + "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + TEST_INSTALL CXX_serial) endif() diff --git a/examples/arkode/CXX_superludist/CMakeLists.txt b/examples/arkode/CXX_superludist/CMakeLists.txt index 7d92aaf9ce..b9e286c11c 100644 --- a/examples/arkode/CXX_superludist/CMakeLists.txt +++ b/examples/arkode/CXX_superludist/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for ARKODE C++ SuperLU_DIST examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases list(APPEND ARKODE_examples "ark_brusselator1D_FEM_sludist.cpp\;1\;1\;develop") # Auxiliary files to install -set(ARKODE_extras - ) +set(ARKODE_extras) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -41,17 +40,16 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - MPI::MPI_CXX - sundials_arkode - sundials_sunlinsolsuperludist) + target_link_libraries(${example_target} PRIVATE MPI::MPI_CXX sundials_arkode + sundials_sunlinsolsuperludist) endforeach(example_tuple ${ARKODE_examples}) @@ -66,18 +64,12 @@ endif() # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(arkode_superludist ARKODE_examples - EXTRA_FILES - README - ${ARKODE_extras} - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - arkode - sunlinsolsuperludist - DESTINATION - arkode/CXX_superludist - ) + sundials_install_examples( + arkode_superludist ARKODE_examples + EXTRA_FILES README ${ARKODE_extras} + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS arkode sunlinsolsuperludist + DESTINATION arkode/CXX_superludist) # add test_install target sundials_add_test_install(arkode CXX_superludist) diff --git a/examples/arkode/CXX_xbraid/CMakeLists.txt b/examples/arkode/CXX_xbraid/CMakeLists.txt index 302d0f3232..b788cf1016 100644 --- a/examples/arkode/CXX_xbraid/CMakeLists.txt +++ b/examples/arkode/CXX_xbraid/CMakeLists.txt @@ -14,25 +14,22 @@ # CMakeLists.txt file for ARKODE C++ XBraid examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_heat2D_xbraid\;--x_print_level 0\;1\;4\;develop" - "ark_heat2D_p_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" - ) + "ark_heat2D_xbraid\;--x_print_level 0\;1\;4\;develop" + "ark_heat2D_p_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop") if(ENABLE_HYPRE AND HYPRE_FOUND) set(ARKODE_examples_hypre - "ark_heat2D_hypre_pfmg_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" - ) + "ark_heat2D_hypre_pfmg_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" + ) endif() # Auxiliary files to install -set(ARKODE_extras - plot_heat2D.py - ) +set(ARKODE_extras plot_heat2D.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -40,7 +37,8 @@ set(ARKODE_XBRAID_LIB sundials_arkode_xbraid) set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries -set(SUNDIALS_LIBS ${ARKODE_LIB} ${ARKODE_XBRAID_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS ${ARKODE_LIB} ${ARKODE_XBRAID_LIB} ${NVECP_LIB} + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -52,8 +50,8 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -75,7 +73,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -88,13 +87,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endif() endforeach(example_tuple ${ARKODE_examples}) - - if(ENABLE_HYPRE AND HYPRE_FOUND) # Add the build and install targets for each example @@ -107,8 +104,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -118,8 +115,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE SUNDIALS::XBRAID) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE SUNDIALS::XBRAID) endif() @@ -131,7 +128,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -144,23 +142,24 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endif() endforeach(example_tuple ${ARKODE_examples}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file - install(FILES README.md DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + install(FILES README.md + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -172,41 +171,34 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples_hypre EXAMPLES_HYPRE) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_xbraid_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_xbraid_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) diff --git a/examples/arkode/C_manyvector/CMakeLists.txt b/examples/arkode/C_manyvector/CMakeLists.txt index 380212a16c..25ead792fd 100644 --- a/examples/arkode/C_manyvector/CMakeLists.txt +++ b/examples/arkode/C_manyvector/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for ARKODE ManyVector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_brusselator1D_manyvec\;develop" - ) +set(ARKODE_examples "ark_brusselator1D_manyvec\;develop") # Auxiliary files to install -set(ARKODE_extras - plot_brusselator1D.py - ) +set(ARKODE_extras plot_brusselator1D.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -47,7 +43,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,7 +55,7 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) endif() endforeach(example_tuple ${ARKODE_examples}) @@ -71,7 +68,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -81,39 +79,33 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_openmp/CMakeLists.txt b/examples/arkode/C_openmp/CMakeLists.txt index 1415e70ceb..8bd1f15e44 100644 --- a/examples/arkode/C_openmp/CMakeLists.txt +++ b/examples/arkode/C_openmp/CMakeLists.txt @@ -14,20 +14,15 @@ # CMakeLists.txt file for ARKODE OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples -# "name\;args\;type\;float precision\;int precision" where the type -# is 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type\;float precision\;int precision" +# where the type is 'develop' for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_brusselator1D_omp\;4\;exclude-single\;default\;default" - "ark_heat1D_omp\;4\;develop\;default\;10" - ) +set(ARKODE_examples "ark_brusselator1D_omp\;4\;exclude-single\;default\;default" + "ark_heat1D_omp\;4\;develop\;default\;10") # Auxiliary files to install -set(ARKODE_extras_OMP - plot_brusselator1D.py - ) +set(ARKODE_extras_OMP plot_brusselator1D.py) # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -45,7 +40,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -54,20 +50,17 @@ foreach(example_tuple ${ARKODE_examples}) INTEGER_PRECISION ${example_int_precision}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecopenmp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecopenmp + ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -76,7 +69,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -86,39 +80,32 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_openmpdev/CMakeLists.txt b/examples/arkode/C_openmpdev/CMakeLists.txt index aa1ebdd13f..9c94239a2e 100644 --- a/examples/arkode/C_openmpdev/CMakeLists.txt +++ b/examples/arkode/C_openmpdev/CMakeLists.txt @@ -14,15 +14,13 @@ # CMakeLists.txt file for ARKODE OpenMPDEV examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_analytic_nonlin_ompdev\;4\;develop" - "ark_heat1D_ompdev\;4\;develop" - "ark_heat1D_adapt_ompdev\;4\;develop" - ) + "ark_analytic_nonlin_ompdev\;4\;develop" "ark_heat1D_ompdev\;4\;develop" + "ark_heat1D_adapt_ompdev\;4\;develop") # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -45,7 +43,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -57,12 +56,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -71,7 +69,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -81,39 +80,32 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_parallel/CMakeLists.txt b/examples/arkode/C_parallel/CMakeLists.txt index 1ad69580eb..7ace3f347f 100644 --- a/examples/arkode/C_parallel/CMakeLists.txt +++ b/examples/arkode/C_parallel/CMakeLists.txt @@ -14,26 +14,29 @@ # CMakeLists.txt file for ARKODE parallel C examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_diurnal_kry_p\;\;1\;4\;exclude-single\;default" - "ark_diurnal_kry_bbd_p\;\;1\;4\;exclude-single\;default" - ) +set(ARKODE_examples "ark_diurnal_kry_p\;\;1\;4\;exclude-single\;default" + "ark_diurnal_kry_bbd_p\;\;1\;4\;exclude-single\;default") -if(SUNDIALS_PRECISION MATCHES "DOUBLE" AND - SUNDIALS_INDEX_SIZE MATCHES "64") +if(SUNDIALS_PRECISION MATCHES "DOUBLE" AND SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor\;1\;4\;develop\;2") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor --global-nls\;1\;4\;develop\;2") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor --explicit --tf 3\;1\;4\;develop\;2") + list(APPEND ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor\;1\;4\;develop\;2") + list( + APPEND ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor --global-nls\;1\;4\;develop\;2" + ) + list( + APPEND + ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor --explicit --tf 3\;1\;4\;develop\;2" + ) # Auxiliary files to install - set(ARKODE_extras - "plot_brusselator1D.py" - ) + set(ARKODE_extras "plot_brusselator1D.py") endif() if(MPI_C_COMPILER) @@ -82,7 +85,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -96,12 +100,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -110,7 +113,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -120,39 +124,32 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_parhyp/CMakeLists.txt b/examples/arkode/C_parhyp/CMakeLists.txt index 546e17a814..e4d8ebfff2 100644 --- a/examples/arkode/C_parhyp/CMakeLists.txt +++ b/examples/arkode/C_parhyp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for ARKODE parhyp C examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_diurnal_kry_ph.c\;1\;4\;develop" - ) +set(ARKODE_examples "ark_diurnal_kry_ph.c\;1\;4\;develop") # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -39,13 +37,12 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - sundials_arkode - sundials_nvecparhyp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_arkode sundials_nvecparhyp + ${EXE_EXTRA_LINK_LIBS}) # add to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -53,25 +50,16 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) - if(EXAMPLES_INSTALL) - sundials_install_examples(arkode ARKODE_examples - CMAKE_TEMPLATE - cmakelists_C_MPI_ex.in - MAKE_TEMPLATE - makefile_parhyp_C_ex.in - SOLVER_LIBRARY - sundials_arkode - SUNDIALS_TARGETS - arkode - nvecparhyp - DESTINATION - arkode/C_parhyp - EXTRA_FILES - README - TEST_INSTALL - C_parhyp - ) + sundials_install_examples( + arkode ARKODE_examples + CMAKE_TEMPLATE cmakelists_C_MPI_ex.in + MAKE_TEMPLATE makefile_parhyp_C_ex.in + SOLVER_LIBRARY sundials_arkode + SUNDIALS_TARGETS arkode nvecparhyp + DESTINATION arkode/C_parhyp + EXTRA_FILES README + TEST_INSTALL C_parhyp) endif() diff --git a/examples/arkode/C_petsc/CMakeLists.txt b/examples/arkode/C_petsc/CMakeLists.txt index e62a4d57b6..cf32c23863 100644 --- a/examples/arkode/C_petsc/CMakeLists.txt +++ b/examples/arkode/C_petsc/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for ARKODE PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers if(BUILD_SUNNONLINSOL_PETSCSNES) - set(ARKODE_examples - "ark_petsc_ex25\;1\;1\;develop" - ) + set(ARKODE_examples "ark_petsc_ex25\;1\;1\;develop") endif() if(MPI_C_COMPILER) @@ -40,7 +38,8 @@ if(BUILD_SUNNONLINSOL_PETSCSNES) endif() # set-up linker flags and link libraries -set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${SUNNLS_LIB} ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${SUNNLS_LIB} + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -56,7 +55,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -72,12 +72,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) endif() endforeach(example_tuple ${ARKODE_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -90,39 +89,32 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc - RENAME Makefile - ) + RENAME Makefile) endif() sundials_add_test_install(arkode C_petsc) diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index 5eca809665..86b7633bb4 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -15,106 +15,100 @@ # CMakeLists.txt file for ARKODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - # tests that are always run - "ark_analytic\;\;" - # develop tests - "ark_analytic_mels\;\;develop" - "ark_analytic_nonlin\;\;develop" - "ark_brusselator_1D_mri\;\;develop" - "ark_brusselator_fp\;\;exclude-single" - "ark_brusselator_mri\;\;develop" - "ark_brusselator\;\;develop" - "ark_brusselator1D_imexmri\;0 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;2 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;3 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;4 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;5 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;6 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;7 0.001\;exclude-single" - "ark_brusselator1D\;\;exclude-single" - "ark_conserved_exp_entropy_ark\;1 0\;develop" - "ark_conserved_exp_entropy_ark\;1 1\;develop" - "ark_conserved_exp_entropy_erk\;1\;develop" - "ark_damped_harmonic_symplectic\;\;exclude-single" - "ark_dissipated_exp_entropy\;1 0\;develop" - "ark_dissipated_exp_entropy\;1 1\;develop" - "ark_harmonic_symplectic\;\;exclude-single" - "ark_heat1D_adapt\;\;develop" - "ark_heat1D\;\;develop" - "ark_kepler\;--stepper ERK --step-mode adapt\;develop" - "ark_kepler\;--stepper ERK --step-mode fixed --count-orbits\;develop" - "ark_kepler\;--stepper SPRK --step-mode fixed --count-orbits --use-compensated-sums\;develop" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_EULER_1_1 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_3_3 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_4_4 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_5_6 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_RUTH_3_3 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_YOSHIDA_6_8 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;\;develop" - "ark_kpr_mri\;\;develop" - "ark_kpr_mri\;0 0.002\;develop" - "ark_kpr_mri\;1 0.002\;develop" - "ark_kpr_mri\;2 0.005\;develop" - "ark_kpr_mri\;3 0.01\;develop" - "ark_kpr_mri\;4 0.002\;develop" - "ark_kpr_mri\;5 0.002\;develop" - "ark_kpr_mri\;6 0.005\;develop" - "ark_kpr_mri\;7 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;7 0.001\;exclude-single" - "ark_kpr_mri\;8 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;8 0.001\;exclude-single" - "ark_kpr_mri\;9 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;9 0.001\;exclude-single" - "ark_KrylovDemo_prec\;\;exclude-single" - "ark_KrylovDemo_prec\;1\;exclude-single" - "ark_KrylovDemo_prec\;2\;exclude-single" - "ark_onewaycouple_mri\;\;develop" - "ark_reaction_diffusion_mri\;\;develop" - "ark_robertson_constraints\;\;exclude-single" - "ark_robertson_root\;\;exclude-single" - "ark_robertson\;\;exclude-single" - "ark_twowaycouple_mri\;\;develop" - ) + # tests that are always run + "ark_analytic\;\;" + # develop tests + "ark_analytic_mels\;\;develop" + "ark_analytic_nonlin\;\;develop" + "ark_brusselator_1D_mri\;\;develop" + "ark_brusselator_fp\;\;exclude-single" + "ark_brusselator_mri\;\;develop" + "ark_brusselator\;\;develop" + "ark_brusselator1D_imexmri\;0 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;2 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;3 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;4 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;5 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;6 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;7 0.001\;exclude-single" + "ark_brusselator1D\;\;exclude-single" + "ark_conserved_exp_entropy_ark\;1 0\;develop" + "ark_conserved_exp_entropy_ark\;1 1\;develop" + "ark_conserved_exp_entropy_erk\;1\;develop" + "ark_damped_harmonic_symplectic\;\;exclude-single" + "ark_dissipated_exp_entropy\;1 0\;develop" + "ark_dissipated_exp_entropy\;1 1\;develop" + "ark_harmonic_symplectic\;\;exclude-single" + "ark_heat1D_adapt\;\;develop" + "ark_heat1D\;\;develop" + "ark_kepler\;--stepper ERK --step-mode adapt\;develop" + "ark_kepler\;--stepper ERK --step-mode fixed --count-orbits\;develop" + "ark_kepler\;--stepper SPRK --step-mode fixed --count-orbits --use-compensated-sums\;develop" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_EULER_1_1 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_3_3 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_4_4 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_5_6 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_RUTH_3_3 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_YOSHIDA_6_8 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;\;develop" + "ark_kpr_mri\;\;develop" + "ark_kpr_mri\;0 0.002\;develop" + "ark_kpr_mri\;1 0.002\;develop" + "ark_kpr_mri\;2 0.005\;develop" + "ark_kpr_mri\;3 0.01\;develop" + "ark_kpr_mri\;4 0.002\;develop" + "ark_kpr_mri\;5 0.002\;develop" + "ark_kpr_mri\;6 0.005\;develop" + "ark_kpr_mri\;7 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;7 0.001\;exclude-single" + "ark_kpr_mri\;8 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;8 0.001\;exclude-single" + "ark_kpr_mri\;9 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;9 0.001\;exclude-single" + "ark_KrylovDemo_prec\;\;exclude-single" + "ark_KrylovDemo_prec\;1\;exclude-single" + "ark_KrylovDemo_prec\;2\;exclude-single" + "ark_onewaycouple_mri\;\;develop" + "ark_reaction_diffusion_mri\;\;develop" + "ark_robertson_constraints\;\;exclude-single" + "ark_robertson_root\;\;exclude-single" + "ark_robertson\;\;exclude-single" + "ark_twowaycouple_mri\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND ARKODE_examples "ark_brusselator_fp\;1\;exclude-single") endif() # Examples using KLU linear solver -set(ARKODE_examples_KLU - "ark_brusselator1D_klu\;develop" - ) +set(ARKODE_examples_KLU "ark_brusselator1D_klu\;develop") # Examples using SuperLU_MT linear solver -set(ARKODE_examples_SUPERLUMT - "ark_brusselator1D_FEM_slu\;exclude-single" - ) +set(ARKODE_examples_SUPERLUMT "ark_brusselator1D_FEM_slu\;exclude-single") # Auxiliary files to install set(ARKODE_extras - ark_analytic_nonlin_stats.csv - ark_damped_harmonic_symplectic.h - ark_harmonic_symplectic.h - ark_kepler_plot.py - ark_kepler.h - ark_reaction_diffusion_mri_fast_stats.csv - ark_reaction_diffusion_mri_slow_stats.csv - ark_robertson_stats.csv - plot_brusselator1D_FEM.py - plot_brusselator1D.py - plot_heat1D_adapt.py - plot_heat1D.py - plot_sol_log.py - plot_sol.py - ) + ark_analytic_nonlin_stats.csv + ark_damped_harmonic_symplectic.h + ark_harmonic_symplectic.h + ark_kepler_plot.py + ark_kepler.h + ark_reaction_diffusion_mri_fast_stats.csv + ark_reaction_diffusion_mri_slow_stats.csv + ark_robertson_stats.csv + plot_brusselator1D_FEM.py + plot_brusselator1D.py + plot_heat1D_adapt.py + plot_heat1D.py + plot_sol_log.py + plot_sol.py) # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -124,7 +118,7 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -132,10 +126,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -146,7 +138,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -155,12 +148,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples}) - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -176,29 +168,26 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - sundials_sunlinsolklu - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + sundials_sunlinsolklu ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -214,29 +203,26 @@ if(BUILD_SUNLINSOL_SUPERLUMT) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - sundials_sunlinsolsuperlumt - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + sundials_sunlinsolsuperlumt ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -245,7 +231,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -262,7 +249,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(ARKODE_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -273,39 +260,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 98abe2d887..e2392396bc 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -14,33 +14,25 @@ # CMakeLists.txt file for the ARKode F2003 custom module examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - set(FARKODE_examples - "ark_brusselator1D_f2003\;develop" - "ark_analytic_complex_f2003\;develop" - ) + set(FARKODE_examples "ark_brusselator1D_f2003\;develop" + "ark_analytic_complex_f2003\;develop") set(FARKODE_tests - "test_fnvector_complex_mod\;develop" - "test_fnvector_fortran_mod\;develop" - "test_fsunmatrix_fortran_mod\;develop" - "test_fsunlinsol_fortran_mod\;develop" - ) + "test_fnvector_complex_mod\;develop" "test_fnvector_fortran_mod\;develop" + "test_fsunmatrix_fortran_mod\;develop" + "test_fsunlinsol_fortran_mod\;develop") endif() # note the order matters when auto-generating the installed Makefile -set(FARKODEsources - fnvector_complex_mod.f90 - fnvector_fortran_mod.f90 - fsunmatrix_fortran_mod.f90 - fsunlinsol_fortran_mod.f90 - ) +set(FARKODEsources fnvector_complex_mod.f90 fnvector_fortran_mod.f90 + fsunmatrix_fortran_mod.f90 fsunlinsol_fortran_mod.f90) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -57,7 +49,8 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90 ${FARKODEsources}) @@ -65,7 +58,8 @@ foreach(example_tuple ${FARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -73,10 +67,10 @@ foreach(example_tuple ${FARKODE_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out ${FARKODEsources} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endif() endforeach(example_tuple ${FARKODE_examples}) @@ -89,7 +83,8 @@ foreach(example_tuple ${FARKODE_tests}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90 ${FARKODEsources}) @@ -97,7 +92,8 @@ foreach(example_tuple ${FARKODE_tests}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS "" EXAMPLE_TYPE ${example_type} NODIFF) @@ -108,18 +104,18 @@ foreach(example_tuple ${FARKODE_tests}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${FARKODEsources} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endif() endforeach(example_tuple ${FARKODE_tests}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -135,25 +131,22 @@ if(EXAMPLES_INSTALL) examples2string(FARKODEsources EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # remove file extensions from dependencies for generated Makefile @@ -162,15 +155,12 @@ if(EXAMPLES_INSTALL) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_parallel/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index 63c87909cf..e8065f43c8 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -15,31 +15,31 @@ # CMakeLists.txt file for the ARKode F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases set(FARKODE_examples - "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" ) if(SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND FARKODE_examples - "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" - "ark_diag_non_f2003\;\;1\;4\;develop\;2" - "ark_heat2D_f2003\;\;1\;4\;develop\;2") + list(APPEND FARKODE_examples "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "ark_diag_non_f2003\;\;1\;4\;develop\;2" + "ark_heat2D_f2003\;\;1\;4\;develop\;2") endif() # Set-up linker flags and link libraries -set(SUNDIALS_LIBS sundials_arkode - sundials_farkode_mod - sundials_nvecparallel - sundials_fnvecparallel_mod - sundials_nvecmpiplusx - sundials_fnvecmpiplusx_mod - sundials_nvecmpimanyvector - sundials_fnvecmpimanyvector_mod - ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS + sundials_arkode + sundials_farkode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod + sundials_nvecmpiplusx + sundials_fnvecmpiplusx_mod + sundials_nvecmpimanyvector + sundials_fnvecmpimanyvector_mod + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${FARKODE_examples}) @@ -54,7 +54,8 @@ foreach(example_tuple ${FARKODE_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -73,7 +74,8 @@ foreach(example_tuple ${FARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -87,19 +89,18 @@ foreach(example_tuple ${FARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) endif() endforeach(example_tuple ${FARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -107,60 +108,55 @@ if(EXAMPLES_INSTALL) # Makefile: convert semi-colon separated target list to space separated string set(EXAMPLE_LIBS_LIST - sundials_farkode_mod - sundials_nvecparallel - sundials_fnvecparallel_mod - sundials_arkode - sundials_fnvecmpiplusx_mod - sundials_nvecmpiplusx - sundials_fnvecmpimanyvector_mod - sundials_nvecmpimanyvector - sundials_fcore_mod - sundials_core) + sundials_farkode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod + sundials_arkode + sundials_fnvecmpiplusx_mod + sundials_nvecmpiplusx + sundials_fnvecmpimanyvector_mod + sundials_nvecmpimanyvector + sundials_fcore_mod + sundials_core) list2string(EXAMPLE_LIBS_LIST EXAMPLE_LIBS) # CMakeLists: replace sundials_ prefix and convert to space separted string - list(TRANSFORM EXAMPLE_LIBS_LIST REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + list(TRANSFORM EXAMPLE_LIBS_LIST + REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE + EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index f755a4695b..bac936e149 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -15,22 +15,20 @@ # CMakeLists.txt file for the ARKode F2003 module serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases -set(FARKODE_examples - "ark_analytic_f2003\;\;develop" -) +set(FARKODE_examples "ark_analytic_f2003\;\;develop") # Regression tests -set(FARKODE_tests - "test_ark_butcher_f2003\;develop" -) +set(FARKODE_tests "test_ark_butcher_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FARKODE_examples + list( + APPEND + FARKODE_examples "ark_bruss_f2003\;\;develop" "ark_diurnal_kry_bp_f2003\;\;develop" "ark_roberts_dns_f2003\;\;develop" @@ -44,16 +42,11 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") "ark_kpr_mri_f2003\;6 0.005\;develop" "ark_kpr_mri_f2003\;7 0.001\;develop" "ark_kpr_mri_f2003\;8 0.001\;develop" - "ark_kpr_mri_f2003\;9 0.001\;develop" - ) + "ark_kpr_mri_f2003\;9 0.001\;develop") - set(FARKODE_examples_KLU - "ark_bruss1D_FEM_klu_f2003\;develop" - ) + set(FARKODE_examples_KLU "ark_bruss1D_FEM_klu_f2003\;develop") - set(FARKODE_examples_LAPACK - "ark_roberts_dnsL_f2003\;\;develop" - ) + set(FARKODE_examples_LAPACK "ark_roberts_dnsL_f2003\;\;develop") endif() @@ -72,9 +65,10 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -94,7 +88,8 @@ foreach(example_tuple ${FARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -103,18 +98,15 @@ foreach(example_tuple ${FARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples}) - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) # Sundials KLU linear solver module - set(SUNLINSOLKLU_LIBS - sundials_sunlinsolklu - sundials_fsunlinsolklu_mod) + set(SUNLINSOLKLU_LIBS sundials_sunlinsolklu sundials_fsunlinsolklu_mod) # KLU libraries list(APPEND SUNLINSOLKLU_LIBS) @@ -126,14 +118,16 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # create the cmake executable target add_executable(${example} ${example}.f90) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -144,21 +138,19 @@ if(BUILD_SUNLINSOL_KLU) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples_KLU}) endif() - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -170,7 +162,8 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -178,7 +171,8 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -186,17 +180,16 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples_LAPACK}) endif() - # Add the build and install targets for regression test foreach(example_tuple ${FARKODE_tests}) @@ -205,7 +198,8 @@ foreach(example_tuple ${FARKODE_tests}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -213,7 +207,8 @@ foreach(example_tuple ${FARKODE_tests}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS "" EXAMPLE_TYPE ${example_type} NODIFF) @@ -224,18 +219,18 @@ foreach(example_tuple ${FARKODE_tests}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_tests}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -248,39 +243,33 @@ if(EXAMPLES_INSTALL) set(EXAMPLES "${EXAMPLES} ${TESTFILES}") # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index eab3a925e9..a7e76cef55 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -21,7 +21,9 @@ if(EXAMPLES_ENABLE_C) if(ENABLE_OPENMP AND OPENMP_FOUND) add_subdirectory(C_openmp) endif() - if(ENABLE_OPENMP_DEVICE AND OPENMP_FOUND AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) + if(ENABLE_OPENMP_DEVICE + AND OPENMP_FOUND + AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) add_subdirectory(C_openmpdev) endif() if(ENABLE_MPI AND MPI_C_FOUND) diff --git a/examples/cvode/CXX_onemkl/CMakeLists.txt b/examples/cvode/CXX_onemkl/CMakeLists.txt index db3d93f5c5..b586e70b06 100644 --- a/examples/cvode/CXX_onemkl/CMakeLists.txt +++ b/examples/cvode/CXX_onemkl/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -set(CVODE_examples - "cvRoberts_blockdiag_onemkl.cpp\;\;develop" -) +set(CVODE_examples "cvRoberts_blockdiag_onemkl.cpp\;\;develop") # Add the build targets for each CVODE example foreach(example_tuple ${CVODE_examples}) @@ -30,7 +28,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -39,14 +37,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecsycl - sundials_sunlinsolonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_nvecsycl sundials_sunlinsolonemkldense + MKL::MKL_DPCPP ${EXE_EXTRA_LINK_LIBS}) endif() @@ -58,7 +52,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -69,17 +64,11 @@ endforeach() # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecsycl - sunlinsolonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - cvode/CXX_onemkl - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS cvode nvecsycl sunlinsolonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION cvode/CXX_onemkl) endif() diff --git a/examples/cvode/CXX_parallel/CMakeLists.txt b/examples/cvode/CXX_parallel/CMakeLists.txt index e325cd6d37..59c3419283 100644 --- a/examples/cvode/CXX_parallel/CMakeLists.txt +++ b/examples/cvode/CXX_parallel/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for CVODE C++ parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D_p\;--np 2 2\;1\;4\;develop" - ) +set(CVODE_examples "cv_heat2D_p\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(CVODE_extras - plot_heat2D_p.py - ) +set(CVODE_extras plot_heat2D_p.py) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -48,8 +44,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -69,7 +65,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -82,12 +79,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -96,7 +92,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -109,39 +106,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) # add test_install target diff --git a/examples/cvode/CXX_parhyp/CMakeLists.txt b/examples/cvode/CXX_parhyp/CMakeLists.txt index cef160eeee..5c18f590d1 100644 --- a/examples/cvode/CXX_parhyp/CMakeLists.txt +++ b/examples/cvode/CXX_parhyp/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for CVODE C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" - "cv_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - ) +set(CVODE_examples "cv_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" + "cv_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(CVODE_extras - plot_heat2D_p.py - ) +set(CVODE_extras plot_heat2D_p.py) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -49,8 +45,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -59,8 +55,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -71,7 +67,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -84,12 +81,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -98,7 +94,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -111,39 +108,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) # add test_install target diff --git a/examples/cvode/CXX_serial/CMakeLists.txt b/examples/cvode/CXX_serial/CMakeLists.txt index 428b5909fa..d48dd57cec 100644 --- a/examples/cvode/CXX_serial/CMakeLists.txt +++ b/examples/cvode/CXX_serial/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for CVODE C++ serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D.cpp\;\;\;\;exclude-single" - "cv_kpr.cpp\;\;\;\;develop" - ) +set(CVODE_examples "cv_heat2D.cpp\;\;\;\;exclude-single" + "cv_kpr.cpp\;\;\;\;develop") # Add the build and install targets for each example foreach(example_tuple ${CVODE_examples}) @@ -36,8 +34,8 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -47,19 +45,14 @@ foreach(example_tuple ${CVODE_examples}) # directories to include target_include_directories(${example_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/examples/utilities - ) + PRIVATE ${PROJECT_SOURCE_DIR}/examples/utilities) # libraries to link against - target_link_libraries(${example_target} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) - target_link_libraries(${example_target} - sundials_cvode_fused_stubs) + target_link_libraries(${example_target} sundials_cvode_fused_stubs) endif() endif() @@ -71,7 +64,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -79,7 +73,6 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -87,23 +80,14 @@ if(EXAMPLES_INSTALL) set(_fused_stubs cvode_fused_stubs) endif() - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - MAKE_TEMPLATE - makefile_serial_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecserial - ${_fused_stubs} - DESTINATION - cvode/CXX_serial - EXTRA_FILES - README - plot_heat2D.py - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - TEST_INSTALL - CXX_serial - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + MAKE_TEMPLATE makefile_serial_CXX_ex.in + SUNDIALS_TARGETS cvode nvecserial ${_fused_stubs} + DESTINATION cvode/CXX_serial + EXTRA_FILES README plot_heat2D.py + "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + TEST_INSTALL CXX_serial) endif(EXAMPLES_INSTALL) diff --git a/examples/cvode/CXX_sycl/CMakeLists.txt b/examples/cvode/CXX_sycl/CMakeLists.txt index 67969b8d4d..35fcd18d2a 100644 --- a/examples/cvode/CXX_sycl/CMakeLists.txt +++ b/examples/cvode/CXX_sycl/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE SYCL examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_sycl.cpp\;\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_sycl.cpp\;\;develop") # Add the build and install targets for each CVODE example foreach(example_tuple ${CVODE_examples}) @@ -33,7 +31,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -42,11 +40,9 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_cvode - sundials_nvecsycl - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecsycl + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -58,7 +54,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -66,17 +63,13 @@ foreach(example_tuple ${CVODE_examples}) endforeach() - # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecsycl - DESTINATION - cvode/CXX_sycl) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS cvode nvecsycl + DESTINATION cvode/CXX_sycl) endif() diff --git a/examples/cvode/C_mpimanyvector/CMakeLists.txt b/examples/cvode/C_mpimanyvector/CMakeLists.txt index 6ec51d724e..4a2feaf182 100644 --- a/examples/cvode/C_mpimanyvector/CMakeLists.txt +++ b/examples/cvode/C_mpimanyvector/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE MPIManyVector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvDiurnal_kry_mpimanyvec\;2\;4\;develop" - ) +set(CVODE_examples "cvDiurnal_kry_mpimanyvec\;2\;4\;develop") if(MPI_C_COMPILER) set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) @@ -54,7 +52,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -70,17 +69,17 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) + install(FILES README + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODE") @@ -92,39 +91,33 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/C_openmp/CMakeLists.txt b/examples/cvode/C_openmp/CMakeLists.txt index 88e1093b79..004dc50ffe 100644 --- a/examples/cvode/C_openmp/CMakeLists.txt +++ b/examples/cvode/C_openmp/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for CVODE OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_bnd_omp\;4\;develop" - #"cvAdvDiffReac_kry_omp\;4\;develop" - ) +set(CVODE_examples "cvAdvDiff_bnd_omp\;4\;develop" + # "cvAdvDiffReac_kry_omp\;4\;develop" +) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -48,7 +47,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -60,12 +60,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -82,39 +81,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/C_openmpdev/CMakeLists.txt b/examples/cvode/C_openmpdev/CMakeLists.txt index 3899750ae4..78bd030836 100644 --- a/examples/cvode/C_openmpdev/CMakeLists.txt +++ b/examples/cvode/C_openmpdev/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE OpenMPDEV examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_ompdev\;4\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_ompdev\;4\;develop") # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -47,7 +45,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -59,12 +58,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -81,39 +79,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt index e686e97fa3..997a83cbc1 100644 --- a/examples/cvode/F2003_parallel/CMakeLists.txt +++ b/examples/cvode/F2003_parallel/CMakeLists.txt @@ -15,21 +15,18 @@ # CMakeLists.txt file for the CVode F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") set(FCVODE_examples - "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" - "cv_diag_kry_f2003\;\;1\;4\;develop\;2" - "cv_diag_non_p_f2003\;\;1\;4\;develop\;2") + "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "cv_diag_kry_f2003\;\;1\;4\;develop\;2" + "cv_diag_non_p_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(CVODE_LIBS - sundials_cvode - sundials_fcvode_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(CVODE_LIBS sundials_cvode sundials_fcvode_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${CVODE_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -47,7 +44,8 @@ foreach(example_tuple ${FCVODE_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -66,7 +64,8 @@ foreach(example_tuple ${FCVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -80,19 +79,18 @@ foreach(example_tuple ${FCVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) endif() endforeach(example_tuple ${FCVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -103,45 +101,39 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM CVODE_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FCVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 1a0458a11e..28d3e9db36 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -15,18 +15,18 @@ # CMakeLists.txt file for the FCVODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(FCVODE_examples - "cv_advdiff_bnd_f2003\;develop" - ) +set(FCVODE_examples "cv_advdiff_bnd_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FCVODE_examples + list( + APPEND + FCVODE_examples "cv_analytic_fp_f2003\;develop" "cv_analytic_sys_dns_f2003\;develop" "cv_analytic_sys_dns_jac_f2003\;develop" @@ -34,18 +34,13 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") "cv_diurnal_kry_f2003\;develop" "cv_diurnal_kry_bp_f2003\;develop" "cv_roberts_dns_constraints_f2003\;develop" - "cv_roberts_dns_f2003\;develop" - ) + "cv_roberts_dns_f2003\;develop") - set(FCVODE_examples_LAPACK - "cv_roberts_dnsL_f2003\;develop" - ) + set(FCVODE_examples_LAPACK "cv_roberts_dnsL_f2003\;develop") # Examples using KLU linear solver - set(FCVODE_examples_KLU - "cv_analytic_sys_klu_f2003\;develop" - "cv_roberts_klu_f2003\;develop" - ) + set(FCVODE_examples_KLU "cv_analytic_sys_klu_f2003\;develop" + "cv_roberts_klu_f2003\;develop") endif() @@ -67,7 +62,8 @@ foreach(example_tuple ${FCVODE_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -75,7 +71,8 @@ foreach(example_tuple ${FCVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -83,10 +80,10 @@ foreach(example_tuple ${FCVODE_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples}) @@ -103,7 +100,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -111,7 +109,8 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -119,10 +118,10 @@ if(BUILD_SUNLINSOL_KLU) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLKLU_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples_KLU}) @@ -133,9 +132,8 @@ endif() if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -152,7 +150,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -160,10 +159,10 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples_LAPACK}) @@ -194,39 +193,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/cuda/CMakeLists.txt b/examples/cvode/cuda/CMakeLists.txt index ecf39d378f..aeb2587f14 100644 --- a/examples/cvode/cuda/CMakeLists.txt +++ b/examples/cvode/cuda/CMakeLists.txt @@ -16,22 +16,17 @@ # CMakeLists.txt file for CVODE CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_kry_cuda\;\;develop" - "cvAdvDiff_kry_cuda_managed\;\;develop" - "cvAdvDiff_diag_cuda\;0 0\;develop" - "cvAdvDiff_diag_cuda\;0 1\;develop" - "cvAdvDiff_diag_cuda\;1 1\;develop" - ) + "cvAdvDiff_kry_cuda\;\;develop" "cvAdvDiff_kry_cuda_managed\;\;develop" + "cvAdvDiff_diag_cuda\;0 0\;develop" "cvAdvDiff_diag_cuda\;0 1\;develop" + "cvAdvDiff_diag_cuda\;1 1\;develop") # Examples using cuSolverSP linear solvers -set(CVODE_examples_cusolver - "cvRoberts_block_cusolversp_batchqr\;\;develop" -) +set(CVODE_examples_cusolver "cvRoberts_block_cusolversp_batchqr\;\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "32") set(all_examples "${CVODE_examples_cusolver}") @@ -42,9 +37,7 @@ endif() list(APPEND all_examples "${CVODE_examples}") # Specify libraries to link against -set(SUNDIALS_LIBS ${SUNDIALS_LIBS} - sundials_cvode - sundials_nveccuda) +set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode sundials_nveccuda) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode_fused_cuda) @@ -61,9 +54,10 @@ foreach(example_tuple ${all_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) @@ -71,7 +65,8 @@ foreach(example_tuple ${all_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -82,7 +77,8 @@ foreach(example_tuple ${all_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -91,11 +87,10 @@ foreach(example_tuple ${all_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -119,39 +114,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/ginkgo/CMakeLists.txt b/examples/cvode/ginkgo/CMakeLists.txt index 5d1e706371..adaebb7b0c 100644 --- a/examples/cvode/ginkgo/CMakeLists.txt +++ b/examples/cvode/ginkgo/CMakeLists.txt @@ -15,18 +15,18 @@ # Example lists are tuples "name\;args\;type" # Examples that support CPU and GPU Ginkgo backends -set(cpu_gpu_examples - "cv_heat2D_ginkgo.cpp\;\;develop") +set(cpu_gpu_examples "cv_heat2D_ginkgo.cpp\;\;develop") -sundials_add_examples_ginkgo(cpu_gpu_examples +sundials_add_examples_ginkgo( + cpu_gpu_examples TARGETS sundials_cvode BACKENDS REF OMP CUDA HIP SYCL) # Examples that only support CPU Ginkgo backends -set(cpu_examples - "cv_kpr_ginkgo.cpp\;\;develop") +set(cpu_examples "cv_kpr_ginkgo.cpp\;\;develop") -sundials_add_examples_ginkgo(cpu_examples +sundials_add_examples_ginkgo( + cpu_examples TARGETS sundials_cvode BACKENDS REF OMP) @@ -42,25 +42,18 @@ if(EXAMPLES_INSTALL) if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL") list(APPEND vectors nvecsycl) endif() - if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR - (SUNDIALS_GINKGO_BACKENDS MATCHES "REF")) + if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR (SUNDIALS_GINKGO_BACKENDS + MATCHES "REF")) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(cvode - CPU_EXAMPLES_VAR - cpu_examples - CPU_GPU_EXAMPLES_VAR - cpu_gpu_examples - SUNDIALS_COMPONENTS - cvode - ${vectors} - SUNDIALS_TARGETS - cvode - EXTRA_FILES - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - DESTINATION - cvode/ginkgo - ) + sundials_install_examples_ginkgo( + cvode + CPU_EXAMPLES_VAR cpu_examples + CPU_GPU_EXAMPLES_VAR cpu_gpu_examples + SUNDIALS_COMPONENTS cvode ${vectors} + SUNDIALS_TARGETS cvode + EXTRA_FILES "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + DESTINATION cvode/ginkgo) endif() diff --git a/examples/cvode/hip/CMakeLists.txt b/examples/cvode/hip/CMakeLists.txt index 8de1bb3721..18427801b1 100644 --- a/examples/cvode/hip/CMakeLists.txt +++ b/examples/cvode/hip/CMakeLists.txt @@ -14,21 +14,17 @@ # CMakeLists.txt file for CVODE HIP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(all_examples - "cvAdvDiff_kry_hip.cpp\;\;develop" - "cvAdvDiff_diag_hip.cpp\;0 0\;develop" - "cvAdvDiff_diag_hip.cpp\;0 1\;develop" - "cvAdvDiff_diag_hip.cpp\;1 1\;develop" - ) + "cvAdvDiff_kry_hip.cpp\;\;develop" "cvAdvDiff_diag_hip.cpp\;0 0\;develop" + "cvAdvDiff_diag_hip.cpp\;0 1\;develop" + "cvAdvDiff_diag_hip.cpp\;1 1\;develop") # Specify libraries to link against -set(SUNDIALS_LIBS - sundials_cvode - sundials_nvechip) +set(SUNDIALS_LIBS sundials_cvode sundials_nvechip) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode_fused_hip) @@ -48,7 +44,7 @@ foreach(example_tuple ${all_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -56,7 +52,9 @@ foreach(example_tuple ${all_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE hip::device ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE hip::device ${SUNDIALS_LIBS} + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -67,31 +65,27 @@ foreach(example_tuple ${all_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${all_examples}) - # Install the targets if(EXAMPLES_INSTALL) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_kernels_if_enabled cvode_fused_hip) else() - set(_fused_kernels_if_enabled ) + set(_fused_kernels_if_enabled) endif() - sundials_install_examples(cvode all_examples - CMAKE_TEMPLATE - cmakelists_HIP_ex.in - SUNDIALS_TARGETS - cvode - nvechip - ${_fused_kernels_if_enabled} - DESTINATION - cvode/hip) + sundials_install_examples( + cvode all_examples + CMAKE_TEMPLATE cmakelists_HIP_ex.in + SUNDIALS_TARGETS cvode nvechip ${_fused_kernels_if_enabled} + DESTINATION cvode/hip) endif() diff --git a/examples/cvode/kokkos/CMakeLists.txt b/examples/cvode/kokkos/CMakeLists.txt index c5c1cd4d19..533d3bf630 100644 --- a/examples/cvode/kokkos/CMakeLists.txt +++ b/examples/cvode/kokkos/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(examples_list - "cv_bruss_batched_kokkos.cpp\;\;develop" - "cv_bruss_batched_kokkos_2D.cpp\;\;develop" -) +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases +set(examples_list "cv_bruss_batched_kokkos.cpp\;\;develop" + "cv_bruss_batched_kokkos_2D.cpp\;\;develop") # Add the build targets for each example foreach(example_tuple ${examples_list}) @@ -32,7 +30,7 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -44,23 +42,19 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # directories to include - target_include_directories(${example_target} - PRIVATE - "${PROJECT_SOURCE_DIR}/examples/utilities") + target_include_directories( + ${example_target} PRIVATE "${PROJECT_SOURCE_DIR}/examples/utilities") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nveckokkos - sundials_sunmatrixkokkosdense - sundials_sunlinsolkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_nveckokkos + sundials_sunmatrixkokkosdense sundials_sunlinsolkokkosdense + ${EXE_EXTRA_LINK_LIBS}) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) - target_link_libraries(${example_target} PRIVATE - sundials_cvode_fused_stubs) + target_link_libraries(${example_target} + PRIVATE sundials_cvode_fused_stubs) endif() endif() @@ -72,7 +66,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXTRA_ARGS --kokkos-disable-warnings ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -89,22 +84,12 @@ if(EXAMPLES_INSTALL) set(_fused_stubs cvode_fused_stubs) endif() - sundials_install_examples(cvode examples_list - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - sunlinsolkokkosdense - SUNDIALS_TARGETS - cvode - ${_fused_stubs} - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - EXTRA_FILES - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - DESTINATION - cvode/kokkos - ) + sundials_install_examples( + cvode examples_list + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense sunlinsolkokkosdense + SUNDIALS_TARGETS cvode ${_fused_stubs} + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + EXTRA_FILES "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + DESTINATION cvode/kokkos) endif() diff --git a/examples/cvode/magma/CMakeLists.txt b/examples/cvode/magma/CMakeLists.txt index 55e81a8f6b..756205e83c 100644 --- a/examples/cvode/magma/CMakeLists.txt +++ b/examples/cvode/magma/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -set(CVODE_examples - "cv_bruss_batched_magma.cpp\;\;develop" -) +set(CVODE_examples "cv_bruss_batched_magma.cpp\;\;develop") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set(vector nveccuda) @@ -38,7 +36,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set_source_files_properties(${example} PROPERTIES LANGUAGE CUDA) @@ -53,13 +51,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_${vector} - sundials_sunlinsolmagmadense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_${vector} sundials_sunlinsolmagmadense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -70,7 +65,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -81,15 +77,10 @@ endforeach(example_tuple ${CVODE_examples}) # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - cvode - ${vector} - sunlinsolmagmadense - DESTINATION - cvode/magma - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS cvode ${vector} sunlinsolmagmadense + DESTINATION cvode/magma) endif() diff --git a/examples/cvode/parallel/CMakeLists.txt b/examples/cvode/parallel/CMakeLists.txt index 598feb1f8c..1f3239f22f 100644 --- a/examples/cvode/parallel/CMakeLists.txt +++ b/examples/cvode/parallel/CMakeLists.txt @@ -14,16 +14,15 @@ # CMakeLists.txt file for CVODE parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_diag_p\;2\;4\;exclude-single" - "cvAdvDiff_non_p\;2\;2\;exclude-single" - "cvDiurnal_kry_bbd_p\;2\;4\;exclude-sigle" - "cvDiurnal_kry_p\;2\;4\;exclude-single" - ) + "cvAdvDiff_diag_p\;2\;4\;exclude-single" + "cvAdvDiff_non_p\;2\;2\;exclude-single" + "cvDiurnal_kry_bbd_p\;2\;4\;exclude-sigle" + "cvDiurnal_kry_p\;2\;4\;exclude-single") if(MPI_C_COMPILER) set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) @@ -57,7 +56,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -73,12 +73,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -95,39 +94,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/parhyp/CMakeLists.txt b/examples/cvode/parhyp/CMakeLists.txt index 043133a4ca..9571c36ae5 100644 --- a/examples/cvode/parhyp/CMakeLists.txt +++ b/examples/cvode/parhyp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_non_ph.c\;2\;2\;develop" - ) +set(CVODE_examples "cvAdvDiff_non_ph.c\;2\;2\;develop") if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_stubs sundials_cvode_fused_stubs) @@ -44,15 +42,13 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecparhyp - ${_fused_stubs} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecparhyp + ${_fused_stubs} ${EXE_EXTRA_LINK_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -60,7 +56,6 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -69,23 +64,14 @@ if(EXAMPLES_INSTALL) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_C_MPI_ex.in - MAKE_TEMPLATE - makefile_parhyp_C_ex.in - SOLVER_LIBRARY - sundials_cvode - SUNDIALS_TARGETS - cvode - nvecparhyp - ${_fused_stubs_target} - DESTINATION - cvode/parhyp - EXTRA_FILES - README - TEST_INSTALL - parhyp - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_C_MPI_ex.in + MAKE_TEMPLATE makefile_parhyp_C_ex.in + SOLVER_LIBRARY sundials_cvode + SUNDIALS_TARGETS cvode nvecparhyp ${_fused_stubs_target} + DESTINATION cvode/parhyp + EXTRA_FILES README + TEST_INSTALL parhyp) endif() diff --git a/examples/cvode/petsc/CMakeLists.txt b/examples/cvode/petsc/CMakeLists.txt index 52def46e9e..0525f8f0e4 100644 --- a/examples/cvode/petsc/CMakeLists.txt +++ b/examples/cvode/petsc/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for CVODE PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_petsc_ex7\;1\;1\;develop" - "cvAdvDiff_petsc\;1\;4\;develop" - ) +set(CVODE_examples "cv_petsc_ex7\;1\;1\;develop" + "cvAdvDiff_petsc\;1\;4\;develop") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -57,7 +55,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -73,12 +72,11 @@ foreach(example_tuple ${CVODE_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) endif() endforeach(example_tuple ${CVODE_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -94,39 +92,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc - RENAME Makefile - ) + RENAME Makefile) endif() sundials_add_test_install(cvode petsc) diff --git a/examples/cvode/raja/CMakeLists.txt b/examples/cvode/raja/CMakeLists.txt index 2c2e64319b..1cbc5d13ca 100644 --- a/examples/cvode/raja/CMakeLists.txt +++ b/examples/cvode/raja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE RAJA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_raja.cpp\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_raja.cpp\;develop") # Add source directory to include directories include_directories(.) @@ -57,23 +55,19 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecraja - ${_fused_stubs} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecraja ${_fused_stubs} + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -82,34 +76,26 @@ if(EXAMPLES_INSTALL) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - MAKE_TEMPLATE - makefile_serial_RAJA_ex.in - SOLVER_LIBRARY - sundials_cvode - SUNDIALS_TARGETS - cvode - nvecraja - ${_fused_stubs_target} - OTHER_TARGETS - ${_openmp_target} - DESTINATION - cvode/raja - EXTRA_FILES - README - TEST_INSTALL - raja - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + MAKE_TEMPLATE makefile_serial_RAJA_ex.in + SOLVER_LIBRARY sundials_cvode + SUNDIALS_TARGETS cvode nvecraja ${_fused_stubs_target} + OTHER_TARGETS ${_openmp_target} + DESTINATION cvode/raja + EXTRA_FILES README + TEST_INSTALL raja) endif() diff --git a/examples/cvode/serial/CMakeLists.txt b/examples/cvode/serial/CMakeLists.txt index 71abd3cf91..be033dce06 100644 --- a/examples/cvode/serial/CMakeLists.txt +++ b/examples/cvode/serial/CMakeLists.txt @@ -15,57 +15,46 @@ # CMakeLists.txt file for CVODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_bnd\;\;develop" - "cvAnalytic_mels\;\;develop" - "cvDirectDemo_ls\;\;develop" - "cvDisc_dns\;\;develop" - "cvDiurnal_kry_bp\;\;develop" - "cvDiurnal_kry\;\;develop" - "cvKrylovDemo_ls\;\;develop" - "cvKrylovDemo_ls\;1\;develop" - "cvKrylovDemo_ls\;2\;develop" - "cvKrylovDemo_prec\;\;develop" - "cvParticle_dns\;\;develop" - "cvPendulum_dns\;\;exclude-single" - "cvRoberts_dns\;\;" - "cvRoberts_dns_constraints\;\;develop" - "cvRoberts_dns_negsol\;\;exclude-single" - "cvRoberts_dns_uw\;\;develop" - "cvRocket_dns\;\;develop" - ) + "cvAdvDiff_bnd\;\;develop" + "cvAnalytic_mels\;\;develop" + "cvDirectDemo_ls\;\;develop" + "cvDisc_dns\;\;develop" + "cvDiurnal_kry_bp\;\;develop" + "cvDiurnal_kry\;\;develop" + "cvKrylovDemo_ls\;\;develop" + "cvKrylovDemo_ls\;1\;develop" + "cvKrylovDemo_ls\;2\;develop" + "cvKrylovDemo_prec\;\;develop" + "cvParticle_dns\;\;develop" + "cvPendulum_dns\;\;exclude-single" + "cvRoberts_dns\;\;" + "cvRoberts_dns_constraints\;\;develop" + "cvRoberts_dns_negsol\;\;exclude-single" + "cvRoberts_dns_uw\;\;develop" + "cvRocket_dns\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND CVODE_examples "cvKrylovDemo_ls\;0 1\;develop") endif() # Examples using LAPACK linear solvers -set(CVODE_examples_BL - "cvAdvDiff_bndL\;\;exclude-single" - "cvRoberts_dnsL\;\;exclude-single" - ) +set(CVODE_examples_BL "cvAdvDiff_bndL\;\;exclude-single" + "cvRoberts_dnsL\;\;exclude-single") # Examples using KLU linear solver -set(CVODE_examples_KLU - "cvRoberts_block_klu\;\;develop" - "cvRoberts_klu\;\;develop" - ) +set(CVODE_examples_KLU "cvRoberts_block_klu\;\;develop" + "cvRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver -set(CVODE_examples_SUPERLUMT - "cvRoberts_sps\;\;develop" - ) +set(CVODE_examples_SUPERLUMT "cvRoberts_sps\;\;develop") # Auxiliary files to install -set(CVODE_extras - plot_cvParticle.py - plot_cvPendulum.py - cvRoberts_dns_stats.csv - ) +set(CVODE_extras plot_cvParticle.py plot_cvPendulum.py cvRoberts_dns_stats.csv) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -86,8 +75,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -107,7 +96,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -119,19 +109,17 @@ foreach(example_tuple ${CVODE_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -143,8 +131,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -164,7 +152,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -176,14 +165,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -200,8 +188,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -221,7 +209,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -233,14 +222,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -257,8 +245,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -277,13 +265,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -296,14 +285,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -312,7 +300,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -338,7 +327,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(CVODE_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -349,39 +338,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/superludist/CMakeLists.txt b/examples/cvode/superludist/CMakeLists.txt index a6ec3ad259..d0c25e651c 100644 --- a/examples/cvode/superludist/CMakeLists.txt +++ b/examples/cvode/superludist/CMakeLists.txt @@ -14,8 +14,8 @@ # CMakeLists.txt file for CVODE SuperLU_DIST examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the type is develop +# for examples excluded from 'make test' in releases list(APPEND CVODE_examples "cvAdvDiff_sludist.cpp\;2 1\;2\;develop") @@ -41,7 +41,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") if(SUNDIALS_INDEX_SIZE STREQUAL "32") - set(integer_precision "15") # superlu-dist seems to result in more output variability (maybe due to a bug with 32-bit indices?) + set(integer_precision "15") + + # superlu-dist seems to result in more output variability (maybe due to a + # bug with 32-bit indices?) set(float_precision "3") else() set(integer_precision "default") @@ -49,24 +52,21 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}_${SUNDIALS_INDEX_SIZE}.out EXAMPLE_TYPE ${example_type} INTEGER_PRECISION ${integer_precision} - FLOAT_PRECISION ${float_precision} - ) + FLOAT_PRECISION ${float_precision}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - MPI::MPI_CXX - sundials_cvode - sundials_nvecparallel - sundials_sunlinsolsuperludist - ${_fused_lib} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE MPI::MPI_CXX sundials_cvode sundials_nvecparallel + sundials_sunlinsolsuperludist ${_fused_lib} ${EXE_EXTRA_LINK_LIBS}) endforeach(example_tuple ${CVODE_examples}) @@ -81,18 +81,12 @@ endif() # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(cvode_superludist CVODE_examples - EXTRA_FILES - README - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - cvode - nvecparallel - sunlinsolsuperludist - DESTINATION - cvode/superludist - ) + sundials_install_examples( + cvode_superludist CVODE_examples + EXTRA_FILES README + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS cvode nvecparallel sunlinsolsuperludist + DESTINATION cvode/superludist) # add test_install target sundials_add_test_install(cvode superludist) diff --git a/examples/cvodes/CMakeLists.txt b/examples/cvodes/CMakeLists.txt index bb57f3e400..58dacdd293 100644 --- a/examples/cvodes/CMakeLists.txt +++ b/examples/cvodes/CMakeLists.txt @@ -27,4 +27,4 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) -endif() \ No newline at end of file +endif() diff --git a/examples/cvodes/C_openmp/CMakeLists.txt b/examples/cvodes/C_openmp/CMakeLists.txt index 02fab6bb9f..cc344d5e07 100644 --- a/examples/cvodes/C_openmp/CMakeLists.txt +++ b/examples/cvodes/C_openmp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODES OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODES_examples_OMP - "cvsAdvDiff_bnd_omp\;4\;develop" - ) +set(CVODES_examples_OMP "cvsAdvDiff_bnd_omp\;4\;develop") # Specify libraries to link against set(CVODES_LIB sundials_cvodes) @@ -37,8 +35,8 @@ foreach(example_tuple ${CVODES_examples_OMP}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -51,7 +49,8 @@ foreach(example_tuple ${CVODES_examples_OMP}) endif() # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -60,12 +59,11 @@ foreach(example_tuple ${CVODES_examples_OMP}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) endif() endforeach(example_tuple ${CVODES_examples_OMP}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -74,7 +72,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODES_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -84,39 +83,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODES_examples_OMP EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index 5e5bac8953..aa175b2a93 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -14,12 +14,12 @@ # CMakeLists.txt file for the F2003 CVODES serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(FCVODES_examples - "cvs_analytic_fp_f2003\;\;develop" - "cvsAdvDiff_FSA_non_f2003\;-sensi stg t\;develop" - "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop") + "cvs_analytic_fp_f2003\;\;develop" + "cvsAdvDiff_FSA_non_f2003\;-sensi stg t\;develop" + "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop") # Specify libraries to link against set(CVODES_LIB sundials_fcvodes_mod) @@ -34,11 +34,12 @@ foreach(example_tuple ${FCVODES_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -58,7 +59,8 @@ foreach(example_tuple ${FCVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -67,10 +69,10 @@ foreach(example_tuple ${FCVODES_examples}) # find all .out files for this example file(GLOB example_out ${example}*.out) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) endif() endforeach(example_tuple ${FCVODES_examples}) @@ -85,39 +87,33 @@ if(EXAMPLES_INSTALL) examples2string(FCVODES_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/parallel/CMakeLists.txt b/examples/cvodes/parallel/CMakeLists.txt index dc985978ce..1a1ede9689 100644 --- a/examples/cvodes/parallel/CMakeLists.txt +++ b/examples/cvodes/parallel/CMakeLists.txt @@ -14,21 +14,20 @@ # CMakeLists.txt file for CVODES parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODES_examples - "cvsAdvDiff_ASAp_non_p\;\;2\;2\;exclude-single" - "cvsAdvDiff_FSA_non_p\;-sensi stg t\;2\;2\;exclude-single" - "cvsAdvDiff_FSA_non_p\;-sensi sim t\;2\;2\;exclude-single" - "cvsAdvDiff_non_p\;\;2\;2\;exclude-single" - "cvsAtmDisp_ASAi_kry_bbd_p\;\;2\;4\;exclude-single" - "cvsDiurnal_FSA_kry_p\;-sensi stg t\;2\;4\;exclude-single" - "cvsDiurnal_FSA_kry_p\;-sensi sim t\;2\;4\;exclude-single" - "cvsDiurnal_kry_bbd_p\;\;2\;4\;exclude-single" - "cvsDiurnal_kry_p\;\;2\;4\;exclude-single" - ) + "cvsAdvDiff_ASAp_non_p\;\;2\;2\;exclude-single" + "cvsAdvDiff_FSA_non_p\;-sensi stg t\;2\;2\;exclude-single" + "cvsAdvDiff_FSA_non_p\;-sensi sim t\;2\;2\;exclude-single" + "cvsAdvDiff_non_p\;\;2\;2\;exclude-single" + "cvsAtmDisp_ASAi_kry_bbd_p\;\;2\;4\;exclude-single" + "cvsDiurnal_FSA_kry_p\;-sensi stg t\;2\;4\;exclude-single" + "cvsDiurnal_FSA_kry_p\;-sensi sim t\;2\;4\;exclude-single" + "cvsDiurnal_kry_bbd_p\;\;2\;4\;exclude-single" + "cvsDiurnal_kry_p\;\;2\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -45,7 +44,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${CVODES_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${CVODES_examples}) @@ -56,8 +54,8 @@ foreach(example_tuple ${CVODES_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -81,7 +79,8 @@ foreach(example_tuple ${CVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -94,12 +93,11 @@ foreach(example_tuple ${CVODES_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel) endif() endforeach(example_tuple ${CVODES_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -113,39 +111,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODES_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/serial/CMakeLists.txt b/examples/cvodes/serial/CMakeLists.txt index 48cfb72f99..4089accc24 100644 --- a/examples/cvodes/serial/CMakeLists.txt +++ b/examples/cvodes/serial/CMakeLists.txt @@ -15,76 +15,69 @@ # CMakeLists.txt file for CVODES serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODES_examples - "cvsAdvDiff_ASAi_bnd\;\;develop" - "cvsAdvDiff_FSA_non\;-sensi sim t\;exclude-single" - "cvsAdvDiff_FSA_non\;-sensi stg t\;exclude-single" - "cvsAdvDiff_bnd\;\;develop" - "cvsAnalytic_mels\;\;develop" - "cvsDirectDemo_ls\;\;develop" - "cvsDiurnal_FSA_kry\;-sensi sim t\;exclude-single" - "cvsDiurnal_FSA_kry\;-sensi stg t\;exclude-single" - "cvsDiurnal_kry\;\;develop" - "cvsDiurnal_kry_bp\;\;develop" - "cvsFoodWeb_ASAi_kry\;\;develop" - "cvsFoodWeb_ASAp_kry\;\;develop" - "cvsHessian_ASA_FSA\;\;exclude-single" - "cvsKrylovDemo_ls\;\;develop" - "cvsKrylovDemo_ls\;1\;develop" - "cvsKrylovDemo_ls\;2\;develop" - "cvsKrylovDemo_prec\;\;develop" - "cvsParticle_dns\;\;develop" - "cvsPendulum_dns\;\;exclude-single" - "cvsRoberts_ASAi_dns\;\;exclude-single" - "cvsRoberts_ASAi_dns_constraints\;\;develop" - "cvsRoberts_FSA_dns\;-sensi sim t\;exclude-single" - "cvsRoberts_FSA_dns\;-sensi stg1 t\;exclude-single" - "cvsRoberts_FSA_dns_Switch\;\;exclude-single" - "cvsRoberts_FSA_dns_constraints\;-sensi stg1 t\;exclude-single" - "cvsRoberts_dns\;\;" - "cvsRoberts_dns_constraints\;\;develop" - "cvsRoberts_dns_uw\;\;develop" - ) + "cvsAdvDiff_ASAi_bnd\;\;develop" + "cvsAdvDiff_FSA_non\;-sensi sim t\;exclude-single" + "cvsAdvDiff_FSA_non\;-sensi stg t\;exclude-single" + "cvsAdvDiff_bnd\;\;develop" + "cvsAnalytic_mels\;\;develop" + "cvsDirectDemo_ls\;\;develop" + "cvsDiurnal_FSA_kry\;-sensi sim t\;exclude-single" + "cvsDiurnal_FSA_kry\;-sensi stg t\;exclude-single" + "cvsDiurnal_kry\;\;develop" + "cvsDiurnal_kry_bp\;\;develop" + "cvsFoodWeb_ASAi_kry\;\;develop" + "cvsFoodWeb_ASAp_kry\;\;develop" + "cvsHessian_ASA_FSA\;\;exclude-single" + "cvsKrylovDemo_ls\;\;develop" + "cvsKrylovDemo_ls\;1\;develop" + "cvsKrylovDemo_ls\;2\;develop" + "cvsKrylovDemo_prec\;\;develop" + "cvsParticle_dns\;\;develop" + "cvsPendulum_dns\;\;exclude-single" + "cvsRoberts_ASAi_dns\;\;exclude-single" + "cvsRoberts_ASAi_dns_constraints\;\;develop" + "cvsRoberts_FSA_dns\;-sensi sim t\;exclude-single" + "cvsRoberts_FSA_dns\;-sensi stg1 t\;exclude-single" + "cvsRoberts_FSA_dns_Switch\;\;exclude-single" + "cvsRoberts_FSA_dns_constraints\;-sensi stg1 t\;exclude-single" + "cvsRoberts_dns\;\;" + "cvsRoberts_dns_constraints\;\;develop" + "cvsRoberts_dns_uw\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND CVODE_examples "cvsKrylovDemo_ls\;0 1\;develop") endif() # Examples using LAPACK linear solvers -set(CVODES_examples_BL - "cvsAdvDiff_bndL\;\;exclude-single" - "cvsRoberts_dnsL\;\;exclude-single" - ) +set(CVODES_examples_BL "cvsAdvDiff_bndL\;\;exclude-single" + "cvsRoberts_dnsL\;\;exclude-single") # Examples using KLU linear solver set(CVODES_examples_KLU - "cvsRoberts_ASAi_klu\;\;develop" - "cvsRoberts_FSA_klu\;-sensi stg1 t\;develop" - "cvsRoberts_klu\;\;develop" - ) + "cvsRoberts_ASAi_klu\;\;develop" + "cvsRoberts_FSA_klu\;-sensi stg1 t\;develop" "cvsRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(CVODES_examples_SUPERLUMT - "cvsRoberts_ASAi_sps\;\;exclude-single" - "cvsRoberts_FSA_sps\;-sensi stg1 t\;exclude-single" - "cvsRoberts_sps\;\;develop" - ) + "cvsRoberts_ASAi_sps\;\;exclude-single" + "cvsRoberts_FSA_sps\;-sensi stg1 t\;exclude-single" + "cvsRoberts_sps\;\;develop") # Auxiliary files to install set(CVODES_extras - plot_cvsParticle.py - plot_cvsPendulum.py - cvsRoberts_ASAi_dns_bkw1_stats.csv - cvsRoberts_ASAi_dns_bkw2_stats.csv - cvsRoberts_ASAi_dns_fwd_stats.csv - cvsRoberts_dns_stats.csv - cvsRoberts_FSA_dns_stats_-sensi_sim_t.csv - cvsRoberts_FSA_dns_stats_-sensi_stg1_t.csv - ) + plot_cvsParticle.py + plot_cvsPendulum.py + cvsRoberts_ASAi_dns_bkw1_stats.csv + cvsRoberts_ASAi_dns_bkw2_stats.csv + cvsRoberts_ASAi_dns_fwd_stats.csv + cvsRoberts_dns_stats.csv + cvsRoberts_FSA_dns_stats_-sensi_sim_t.csv + cvsRoberts_FSA_dns_stats_-sensi_stg1_t.csv) # Specify libraries to link against set(CVODES_LIB sundials_cvodes) @@ -101,8 +94,8 @@ foreach(example_tuple ${CVODES_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -122,7 +115,8 @@ foreach(example_tuple ${CVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -134,19 +128,17 @@ foreach(example_tuple ${CVODES_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -158,8 +150,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -179,7 +171,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -191,14 +184,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -215,8 +207,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -236,7 +228,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -248,14 +241,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -272,8 +264,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -292,13 +284,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int32_t. - # Answer files were generated with int64_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int32_t. Answer files were generated with int64_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "64") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -311,14 +304,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -327,7 +319,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODES_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -350,7 +343,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(CVODES_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -361,39 +354,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/CMakeLists.txt b/examples/ida/CMakeLists.txt index 60b3867f90..c018807336 100644 --- a/examples/ida/CMakeLists.txt +++ b/examples/ida/CMakeLists.txt @@ -33,7 +33,9 @@ endif() if(EXAMPLES_ENABLE_CXX) if(ENABLE_RAJA AND RAJA_FOUND) add_subdirectory(raja) - if(ENABLE_MPI AND MPI_C_FOUND AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) + if(ENABLE_MPI + AND MPI_C_FOUND + AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) add_subdirectory(mpiraja) endif() endif() diff --git a/examples/ida/C_openmp/CMakeLists.txt b/examples/ida/C_openmp/CMakeLists.txt index bd5632d0c0..6fcf691c6e 100644 --- a/examples/ida/C_openmp/CMakeLists.txt +++ b/examples/ida/C_openmp/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for IDA OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaFoodWeb_bnd_omp\;4\;develop" - "idaFoodWeb_kry_omp\;4\;develop" - ) +set(IDA_examples "idaFoodWeb_bnd_omp\;4\;develop" + "idaFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -43,9 +41,10 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") - if (NOT ${example} MATCHES "idaFoodWeb_kry_omp") + if(NOT ${example} MATCHES "idaFoodWeb_kry_omp") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -58,12 +57,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -77,39 +75,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_openmp/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt index 63fb888572..77a99633c0 100644 --- a/examples/ida/F2003_openmp/CMakeLists.txt +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -15,15 +15,13 @@ # CMakeLists.txt file for the F2003 IDA OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - set(FIDA_examples_OMP - "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" - "idaHeat2D_kry_omp_f2003.f90\;8\;exclude" - ) + set(FIDA_examples_OMP "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" + "idaHeat2D_kry_omp_f2003.f90\;8\;exclude") endif() # Specify libraries to link against @@ -48,15 +46,13 @@ foreach(example_tuple ${FIDA_examples_OMP}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_ida - sundials_fida_mod - sundials_nvecopenmp - sundials_fnvecopenmp_mod - ${SUNDIALS_LIBS}) + target_link_libraries( + ${example} sundials_ida sundials_fida_mod sundials_nvecopenmp + sundials_fnvecopenmp_mod ${SUNDIALS_LIBS}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) endif() @@ -68,7 +64,8 @@ foreach(example_tuple ${FIDA_examples_OMP}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -77,7 +74,7 @@ foreach(example_tuple ${FIDA_examples_OMP}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) endif() endforeach(example_tuple ${FIDA_examples_OMP}) @@ -92,39 +89,32 @@ if(EXAMPLES_INSTALL) examples2string(FIDA_examples_OMP EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_parallel/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt index af50a152e3..afaea82c5f 100644 --- a/examples/ida/F2003_parallel/CMakeLists.txt +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -15,19 +15,15 @@ # CMakeLists.txt file for the IDA F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") - set(FIDA_examples - "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") + set(FIDA_examples "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(IDA_LIBS - sundials_ida - sundials_fida_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(IDA_LIBS sundials_ida sundials_fida_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${IDA_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -45,7 +41,8 @@ foreach(example_tuple ${FIDA_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -64,7 +61,8 @@ foreach(example_tuple ${FIDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -78,19 +76,18 @@ foreach(example_tuple ${FIDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) endif() endforeach(example_tuple ${FIDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${IDA_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -101,45 +98,38 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM IDA_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FIDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_serial/CMakeLists.txt b/examples/ida/F2003_serial/CMakeLists.txt index 107b423e41..8d0ddb1e75 100644 --- a/examples/ida/F2003_serial/CMakeLists.txt +++ b/examples/ida/F2003_serial/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for the F2003 IDA serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(FIDA_examples - "idaRoberts_dns_f2003\;develop" -) +set(FIDA_examples "idaRoberts_dns_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FIDA_examples - "idaHeat2D_kry_f2003\;develop" - ) + list(APPEND FIDA_examples "idaHeat2D_kry_f2003\;develop") endif() # Specify libraries to link against @@ -42,7 +38,8 @@ foreach(example_tuple ${FIDA_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -50,7 +47,8 @@ foreach(example_tuple ${FIDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,10 +56,10 @@ foreach(example_tuple ${FIDA_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) endif() endforeach(example_tuple ${FIDA_examples}) @@ -76,39 +74,32 @@ if(EXAMPLES_INSTALL) examples2string(FIDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/cuda/CMakeLists.txt b/examples/ida/cuda/CMakeLists.txt index cc420c0721..81c74e96df 100644 --- a/examples/ida/cuda/CMakeLists.txt +++ b/examples/ida/cuda/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_cuda\;develop" - ) +set(IDA_examples "idaHeat2D_kry_cuda\;develop") # Add source directory to include directories include_directories(.) @@ -39,7 +37,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) # add example source files add_executable(${example} ${example}.cu) @@ -47,7 +46,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,12 +58,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -78,39 +77,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/mpicuda/CMakeLists.txt b/examples/ida/mpicuda/CMakeLists.txt index ff3129ba28..fb01b8b3b6 100644 --- a/examples/ida/mpicuda/CMakeLists.txt +++ b/examples/ida/mpicuda/CMakeLists.txt @@ -14,12 +14,11 @@ # CMakeLists.txt file for IDA CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_p_mpicuda\;1\;4\;develop") +set(IDA_examples "idaHeat2D_kry_p_mpicuda\;1\;4\;develop") # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -37,7 +36,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 2 number_of_tasks) list(GET example_tuple 3 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) # add example source files add_executable(${example} ${example}.cu) @@ -45,25 +45,24 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS}) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -77,39 +76,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/mpiraja/CMakeLists.txt b/examples/ida/mpiraja/CMakeLists.txt index ede0737c54..9db66e0922 100644 --- a/examples/ida/mpiraja/CMakeLists.txt +++ b/examples/ida/mpiraja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA raja examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_p_mpiraja.cpp\;1\;4\;develop" - ) +set(IDA_examples "idaHeat2D_kry_p_mpiraja.cpp\;1\;4\;develop") if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_lang CUDA) @@ -54,17 +52,14 @@ foreach(example_tuple ${IDA_examples}) target_include_directories(${example_target} PUBLIC ${MPI_CXX_INCLUDE_DIRS}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_ida - sundials_nvecmpiplusx - sundials_nvecraja - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_ida sundials_nvecmpiplusx sundials_nvecraja + ${MPI_CXX_LIBRARIES} ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -72,38 +67,29 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(ida IDA_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_RAJA_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - ida - nvecmpiplusx - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - ida/mpiraja - EXTRA_FILES - README - TEST_INSTALL - mpiraja - ) + sundials_install_examples( + ida IDA_examples + CMAKE_TEMPLATE cmakelists_${_lang}_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_RAJA_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS ida nvecmpiplusx nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION ida/mpiraja + EXTRA_FILES README + TEST_INSTALL mpiraja) endif() diff --git a/examples/ida/parallel/CMakeLists.txt b/examples/ida/parallel/CMakeLists.txt index 726502d5f9..0eff8ed069 100644 --- a/examples/ida/parallel/CMakeLists.txt +++ b/examples/ida/parallel/CMakeLists.txt @@ -14,16 +14,15 @@ # CMakeLists.txt file for IDA parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaFoodWeb_kry_bbd_p\;1\;4\;exclude-single" - "idaFoodWeb_kry_p\;1\;4\;exclude-single" - "idaHeat2D_kry_bbd_p\;1\;4\;exclude-single" - "idaHeat2D_kry_p\;1\;4\;exclude-single" - ) + "idaFoodWeb_kry_bbd_p\;1\;4\;exclude-single" + "idaFoodWeb_kry_p\;1\;4\;exclude-single" + "idaHeat2D_kry_bbd_p\;1\;4\;exclude-single" + "idaHeat2D_kry_p\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -54,7 +53,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -70,12 +70,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -89,39 +88,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/petsc/CMakeLists.txt b/examples/ida/petsc/CMakeLists.txt index d75471d8c4..098ce24569 100644 --- a/examples/ida/petsc/CMakeLists.txt +++ b/examples/ida/petsc/CMakeLists.txt @@ -14,17 +14,16 @@ # CMakeLists.txt file for IDA PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args;\nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args;\nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaHeat2D_petsc_spgmr\;\;1\;4\;develop" - "idaHeat2D_petsc_snes\;\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop" - ) + "idaHeat2D_petsc_spgmr\;\;1\;4\;develop" + "idaHeat2D_petsc_snes\;\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -51,8 +50,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) add_executable(${example} ${example}.c) @@ -75,7 +74,8 @@ foreach(example_tuple ${IDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -88,12 +88,11 @@ foreach(example_tuple ${IDA_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) endif() endforeach(example_tuple ${IDA_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +105,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/raja/CMakeLists.txt b/examples/ida/raja/CMakeLists.txt index 2117b9c1bc..98ea198a79 100644 --- a/examples/ida/raja/CMakeLists.txt +++ b/examples/ida/raja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA raja examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_raja.cpp\;develop" - ) +set(IDA_examples "idaHeat2D_kry_raja.cpp\;develop") # Add source directory to include directories include_directories(.) @@ -53,52 +51,42 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_ida - sundials_nvecraja - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_ida sundials_nvecraja + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(ida IDA_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - MAKE_TEMPLATE - makefile_serial_RAJA_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - ida - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - ida/raja - EXTRA_FILES - README - TEST_INSTALL - raja - ) + sundials_install_examples( + ida IDA_examples + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + MAKE_TEMPLATE makefile_serial_RAJA_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS ida nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION ida/raja + EXTRA_FILES README + TEST_INSTALL raja) endif() diff --git a/examples/ida/serial/CMakeLists.txt b/examples/ida/serial/CMakeLists.txt index e11c3fd56a..809c6be76d 100644 --- a/examples/ida/serial/CMakeLists.txt +++ b/examples/ida/serial/CMakeLists.txt @@ -15,43 +15,36 @@ # CMakeLists.txt file for IDA serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaAnalytic_mels\;\;exclude-single" - "idaFoodWeb_bnd\;\;develop" - "idaFoodWeb_kry\;\;develop" - "idaHeat2D_bnd\;\;develop" - "idaHeat2D_kry\;\;develop" - "idaKrylovDemo_ls\;\;develop" - "idaKrylovDemo_ls\;1\;develop" - "idaKrylovDemo_ls\;2\;develop" - "idaRoberts_dns\;\;" - "idaSlCrank_dns\;\;exclude-single" - ) + "idaAnalytic_mels\;\;exclude-single" + "idaFoodWeb_bnd\;\;develop" + "idaFoodWeb_kry\;\;develop" + "idaHeat2D_bnd\;\;develop" + "idaHeat2D_kry\;\;develop" + "idaKrylovDemo_ls\;\;develop" + "idaKrylovDemo_ls\;1\;develop" + "idaKrylovDemo_ls\;2\;develop" + "idaRoberts_dns\;\;" + "idaSlCrank_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(IDA_examples_BL - ) +set(IDA_examples_BL) # Examples using KLU linear solver -set(IDA_examples_KLU - "idaHeat2D_klu\;\;develop" - "idaRoberts_klu\;\;develop" - ) +set(IDA_examples_KLU "idaHeat2D_klu\;\;develop" "idaRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(IDA_examples_SUPERLUMT "idaRoberts_sps\;\;develop" - #"idaHeat2D_sps\;develop" # not ready yet, incorrect answer. - ) + # "idaHeat2D_sps\;develop" # not ready yet, incorrect answer. +) # Auxiliary files to install -set(IDA_extras - idaRoberts_dns_stats.csv - ) +set(IDA_extras idaRoberts_dns_stats.csv) # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -68,8 +61,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -89,7 +82,8 @@ foreach(example_tuple ${IDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -101,19 +95,17 @@ foreach(example_tuple ${IDA_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -125,8 +117,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -146,7 +138,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -158,14 +151,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -182,8 +174,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -203,7 +195,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -215,14 +208,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -239,8 +231,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -259,13 +251,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -278,14 +271,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -317,7 +309,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(IDA_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -328,39 +320,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/trilinos/CMakeLists.txt b/examples/ida/trilinos/CMakeLists.txt index 384d549478..9a11456931 100644 --- a/examples/ida/trilinos/CMakeLists.txt +++ b/examples/ida/trilinos/CMakeLists.txt @@ -14,25 +14,22 @@ # CMakeLists.txt file for IDA Trilinos examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers if(Trilinos_INTERFACE_MPI_CXX_FOUND) - set(IDA_examples - "idaHeat2D_kry_tpetra\;1\;1\;develop" - "idaHeat2D_kry_p_tpetra\;1\;4\;develop" - ) + set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop" + "idaHeat2D_kry_p_tpetra\;1\;4\;develop") else() - set(IDA_examples - "idaHeat2D_kry_tpetra\;1\;1\;develop" - ) + set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop") endif() # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") set(MPIEXEC_EXECUTABLE ${Trilinos_INTERFACE_MPIEXEC}) @@ -59,7 +56,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -71,12 +69,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -90,39 +87,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/CMakeLists.txt b/examples/idas/CMakeLists.txt index b191f2effa..90617df855 100644 --- a/examples/idas/CMakeLists.txt +++ b/examples/idas/CMakeLists.txt @@ -27,4 +27,4 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) -endif() \ No newline at end of file +endif() diff --git a/examples/idas/C_openmp/CMakeLists.txt b/examples/idas/C_openmp/CMakeLists.txt index 1a0eb6c8f3..d9bf8c422a 100644 --- a/examples/idas/C_openmp/CMakeLists.txt +++ b/examples/idas/C_openmp/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for IDAS OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDAS_examples - "idasFoodWeb_bnd_omp\;4\;develop" - "idasFoodWeb_kry_omp\;4\;develop" - ) +set(IDAS_examples "idasFoodWeb_bnd_omp\;4\;develop" + "idasFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(IDAS_LIB sundials_idas) @@ -38,8 +36,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -52,16 +50,14 @@ foreach(example_tuple ${IDAS_examples}) endif() # check if example args are provided and set the test name - # IF("${example_args}" STREQUAL "") - # SET(test_name ${example}) - # ELSE() - # STRING(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - # ENDIF() + # IF("${example_args}" STREQUAL "") SET(test_name ${example}) ELSE() + # STRING(REGEX REPLACE " " "_" test_name ${example}_${example_args}) ENDIF() # LEB NOTE: This goes away with TestRunner fix for OpenMP if(NOT ${example} MATCHES "idasFoodWeb_kry_omp") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -71,12 +67,11 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) endif() endforeach(example_tuple ${IDAS_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -85,7 +80,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${IDAS_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -95,39 +91,32 @@ if(EXAMPLES_INSTALL) examples2string(IDAS_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/F2003_serial/CMakeLists.txt b/examples/idas/F2003_serial/CMakeLists.txt index d66b309729..d019e822c9 100644 --- a/examples/idas/F2003_serial/CMakeLists.txt +++ b/examples/idas/F2003_serial/CMakeLists.txt @@ -14,17 +14,13 @@ # CMakeLists.txt file for the F2003 IDAS serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(FIDAS_examples - "idasAkzoNob_ASAi_dns_f2003\;develop" - ) +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases +set(FIDAS_examples "idasAkzoNob_ASAi_dns_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FIDAS_examples - "idasHeat2D_kry_f2003\;develop" - ) + list(APPEND FIDAS_examples "idasHeat2D_kry_f2003\;develop") endif() # Specify libraries to link against @@ -40,7 +36,8 @@ foreach(example_tuple ${FIDAS_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -48,7 +45,8 @@ foreach(example_tuple ${FIDAS_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -56,10 +54,10 @@ foreach(example_tuple ${FIDAS_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) endif() endforeach(example_tuple ${FIDAS_examples}) @@ -74,39 +72,32 @@ if(EXAMPLES_INSTALL) examples2string(FIDAS_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/parallel/CMakeLists.txt b/examples/idas/parallel/CMakeLists.txt index f6cd322534..3c18e878fc 100644 --- a/examples/idas/parallel/CMakeLists.txt +++ b/examples/idas/parallel/CMakeLists.txt @@ -14,20 +14,19 @@ # CMakeLists.txt file for IDAS parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDAS_examples - "idasBruss_ASAp_kry_bbd_p\;\;1\;4\;exclude-single" - "idasBruss_FSA_kry_bbd_p\;\;1\;4\;exclude-single" - "idasBruss_kry_bbd_p\;\;1\;4\;exclude-single" - "idasFoodWeb_kry_bbd_p\;\;1\;4\;exclude-single" - "idasFoodWeb_kry_p\;\;1\;4\;exclude-single" - "idasHeat2D_FSA_kry_bbd_p\;-sensi stg t\;1\;4\;exclude-single" - "idasHeat2D_kry_bbd_p\;\;1\;4\;exclude-single" - "idasHeat2D_kry_p\;\;1\;4\;exclude-single" - ) + "idasBruss_ASAp_kry_bbd_p\;\;1\;4\;exclude-single" + "idasBruss_FSA_kry_bbd_p\;\;1\;4\;exclude-single" + "idasBruss_kry_bbd_p\;\;1\;4\;exclude-single" + "idasFoodWeb_kry_bbd_p\;\;1\;4\;exclude-single" + "idasFoodWeb_kry_p\;\;1\;4\;exclude-single" + "idasHeat2D_FSA_kry_bbd_p\;-sensi stg t\;1\;4\;exclude-single" + "idasHeat2D_kry_bbd_p\;\;1\;4\;exclude-single" + "idasHeat2D_kry_p\;\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -44,7 +43,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${IDAS_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${IDAS_examples}) @@ -55,8 +53,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -80,7 +78,8 @@ foreach(example_tuple ${IDAS_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -93,12 +92,11 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel) endif() endforeach(example_tuple ${IDAS_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -112,39 +110,32 @@ if(EXAMPLES_INSTALL) examples2string(IDAS_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/serial/CMakeLists.txt b/examples/idas/serial/CMakeLists.txt index b4531f52c5..c90e776019 100644 --- a/examples/idas/serial/CMakeLists.txt +++ b/examples/idas/serial/CMakeLists.txt @@ -15,53 +15,45 @@ # CMakeLists.txt file for IDAS serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDAS_examples - "idasAkzoNob_ASAi_dns\;\;exclude-single" - "idasAkzoNob_dns\;\;exclude-single" - "idasAnalytic_mels\;\;exclude-single" - "idasFoodWeb_bnd\;\;develop" - "idasHeat2D_bnd\;\;exclude-single" - "idasHeat2D_kry\;\;exclude-single" - "idasHessian_ASA_FSA\;\;exclude-single" - "idasKrylovDemo_ls\;\;develop" - "idasKrylovDemo_ls\;1\;develop" - "idasKrylovDemo_ls\;2\;develop" - "idasRoberts_ASAi_dns\;\;exclude-single" - "idasRoberts_FSA_dns\;-sensi stg t\;exclude-single" - "idasRoberts_dns\;\;" - "idasSlCrank_dns\;\;exclude-single" - "idasSlCrank_FSA_dns\;\;exclude-single" - ) + "idasAkzoNob_ASAi_dns\;\;exclude-single" + "idasAkzoNob_dns\;\;exclude-single" + "idasAnalytic_mels\;\;exclude-single" + "idasFoodWeb_bnd\;\;develop" + "idasHeat2D_bnd\;\;exclude-single" + "idasHeat2D_kry\;\;exclude-single" + "idasHessian_ASA_FSA\;\;exclude-single" + "idasKrylovDemo_ls\;\;develop" + "idasKrylovDemo_ls\;1\;develop" + "idasKrylovDemo_ls\;2\;develop" + "idasRoberts_ASAi_dns\;\;exclude-single" + "idasRoberts_FSA_dns\;-sensi stg t\;exclude-single" + "idasRoberts_dns\;\;" + "idasSlCrank_dns\;\;exclude-single" + "idasSlCrank_FSA_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(IDAS_examples_BL - ) +set(IDAS_examples_BL) # Examples using KLU linear solver set(IDAS_examples_KLU - "idasRoberts_ASAi_klu\;\;develop" - "idasRoberts_FSA_klu\;-sensi stg t\;develop" - "idasRoberts_klu\;\;develop" - ) + "idasRoberts_ASAi_klu\;\;develop" + "idasRoberts_FSA_klu\;-sensi stg t\;develop" "idasRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(IDAS_examples_SUPERLUMT - "idasRoberts_ASAi_sps\;\;exclude-single" - "idasRoberts_FSA_sps\;-sensi stg t\;exclude-single" - "idasRoberts_sps\;\;exclude-single" - ) + "idasRoberts_ASAi_sps\;\;exclude-single" + "idasRoberts_FSA_sps\;-sensi stg t\;exclude-single" + "idasRoberts_sps\;\;exclude-single") # Auxiliary files to install set(IDAS_extras - idasRoberts_ASAi_dns_bkw1_stats.csv - idasRoberts_ASAi_dns_fwd_stats.csv - idasRoberts_dns_stats.csv - idasRoberts_FSA_dns_stats_-sensi_stg_t.csv - ) + idasRoberts_ASAi_dns_bkw1_stats.csv idasRoberts_ASAi_dns_fwd_stats.csv + idasRoberts_dns_stats.csv idasRoberts_FSA_dns_stats_-sensi_stg_t.csv) # Specify libraries to link against set(IDAS_LIB sundials_idas) @@ -78,8 +70,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -99,7 +91,8 @@ foreach(example_tuple ${IDAS_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -111,19 +104,17 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -135,8 +126,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -156,7 +147,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -168,14 +160,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -192,8 +183,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -213,7 +204,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -225,14 +217,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -249,8 +240,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -269,13 +260,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -288,14 +280,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -327,7 +318,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(IDAS_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -338,39 +329,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/CMakeLists.txt b/examples/kinsol/CMakeLists.txt index 67657f9399..46c2da46a9 100644 --- a/examples/kinsol/CMakeLists.txt +++ b/examples/kinsol/CMakeLists.txt @@ -19,7 +19,8 @@ if(EXAMPLES_ENABLE_C) add_subdirectory(serial) if(ENABLE_OPENMP AND OPENMP_FOUND) - # the only example here need special handling from testrunner (not yet implemented) + # the only example here need special handling from testrunner (not yet + # implemented) add_subdirectory(C_openmp) endif() if(ENABLE_MPI AND MPI_C_FOUND) @@ -32,7 +33,10 @@ if(EXAMPLES_ENABLE_CXX) if(ENABLE_MPI AND MPI_CXX_FOUND) add_subdirectory(CXX_parallel) endif() - if(ENABLE_MPI AND MPI_CXX_FOUND AND ENABLE_HYPRE AND HYPRE_FOUND) + if(ENABLE_MPI + AND MPI_CXX_FOUND + AND ENABLE_HYPRE + AND HYPRE_FOUND) add_subdirectory(CXX_parhyp) endif() endif() diff --git a/examples/kinsol/CUDA_mpi/CMakeLists.txt b/examples/kinsol/CUDA_mpi/CMakeLists.txt index cc134aacfe..c938ca7702 100644 --- a/examples/kinsol/CUDA_mpi/CMakeLists.txt +++ b/examples/kinsol/CUDA_mpi/CMakeLists.txt @@ -18,12 +18,10 @@ # for examples excluded from 'make test' in releases. # Examples to build -set(KINSOL_examples - "kin_em_mpicuda.cu\;1\;2\;develop") +set(KINSOL_examples "kin_em_mpicuda.cu\;1\;2\;develop") # Header files to install -set(KINSOL_headers - "kin_em_mpicuda.hpp") +set(KINSOL_headers "kin_em_mpicuda.hpp") # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -46,15 +44,14 @@ foreach(example_tuple ${KINSOL_examples}) target_include_directories(${example_target} PRIVATE ${MPI_CXX_INCLUDE_DIRS}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_kinsol - sundials_nvecmpiplusx - sundials_nveccuda - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_kinsol sundials_nvecmpiplusx sundials_nveccuda + ${MPI_CXX_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -62,28 +59,17 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(kinsol KINSOL_examples - CMAKE_TEMPLATE - cmakelists_CUDA_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_CUDA_ex.in - SOLVER_LIBRARY - sundials_kinsol - SUNDIALS_TARGETS - kinsol - nvecmpiplusx - nveccuda - DESTINATION - kinsol/CUDA_mpi - EXTRA_FILES - ${KINSOL_headers} - README - TEST_INSTALL - CUDA_mpi - ) + sundials_install_examples( + kinsol KINSOL_examples + CMAKE_TEMPLATE cmakelists_CUDA_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_CUDA_ex.in + SOLVER_LIBRARY sundials_kinsol + SUNDIALS_TARGETS kinsol nvecmpiplusx nveccuda + DESTINATION kinsol/CUDA_mpi + EXTRA_FILES ${KINSOL_headers} README + TEST_INSTALL CUDA_mpi) endif() diff --git a/examples/kinsol/CXX_parallel/CMakeLists.txt b/examples/kinsol/CXX_parallel/CMakeLists.txt index 83c6501b77..64657bdae9 100644 --- a/examples/kinsol/CXX_parallel/CMakeLists.txt +++ b/examples/kinsol/CXX_parallel/CMakeLists.txt @@ -18,9 +18,8 @@ # develop for examples excluded from 'make test' in releases. # Examples to build -set(KINSOL_examples - "kin_heat2D_nonlin_p.cpp\;--np 2 2\;1\;4\;exclude-single" - "kin_em_p.cpp\;\;1\;2\;exclude-single") +set(KINSOL_examples "kin_heat2D_nonlin_p.cpp\;--np 2 2\;1\;4\;exclude-single" + "kin_em_p.cpp\;\;1\;2\;exclude-single") # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -43,13 +42,10 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_kinsol - sundials_nvecparallel - sundials_nvecmpiplusx - sundials_nvecserial - MPI::MPI_CXX - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_kinsol sundials_nvecparallel sundials_nvecmpiplusx + sundials_nvecserial MPI::MPI_CXX ${EXE_EXTRA_LINK_LIBS}) endif() @@ -61,7 +57,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add regression test - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -70,28 +67,17 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(kinsol KINSOL_examples - CMAKE_TEMPLATE - cmakelists_CXX_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_CXX_ex.in - SOLVER_LIBRARY - sundials_kinsol - SUNDIALS_TARGETS - kinsol - nvecparallel - nvecmpiplusx - nvecserial - DESTINATION - kinsol/CXX_parallel - EXTRA_FILES - README - TEST_INSTALL - CXX_parallel - ) + sundials_install_examples( + kinsol KINSOL_examples + CMAKE_TEMPLATE cmakelists_CXX_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_CXX_ex.in + SOLVER_LIBRARY sundials_kinsol + SUNDIALS_TARGETS kinsol nvecparallel nvecmpiplusx nvecserial + DESTINATION kinsol/CXX_parallel + EXTRA_FILES README + TEST_INSTALL CXX_parallel) endif() diff --git a/examples/kinsol/CXX_parhyp/CMakeLists.txt b/examples/kinsol/CXX_parhyp/CMakeLists.txt index fb9e2540df..6f5fe21285 100644 --- a/examples/kinsol/CXX_parhyp/CMakeLists.txt +++ b/examples/kinsol/CXX_parhyp/CMakeLists.txt @@ -14,18 +14,15 @@ # CMakeLists.txt file for KINSOL C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kin_bratu2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - "kin_heat2D_nonlin_hypre_pfmg\;--np 2 2\;1\;4\;develop" - ) +set(KINSOL_examples "kin_bratu2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" + "kin_heat2D_nonlin_hypre_pfmg\;--np 2 2\;1\;4\;develop") -set(KINSOL_headers - "kin_bratu2D_hypre_pfmg.hpp" - "kin_heat2D_nonlin_hypre_pfmg.hpp") +set(KINSOL_headers "kin_bratu2D_hypre_pfmg.hpp" + "kin_heat2D_nonlin_hypre_pfmg.hpp") # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -34,7 +31,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -45,8 +41,8 @@ foreach(example_tuple ${KINSOL_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -55,8 +51,8 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -67,7 +63,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -80,18 +77,18 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) endif() endforeach(example_tuple ${KINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the header files foreach(extrafile ${KINSOL_headers}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) endforeach() # Install the README file @@ -104,39 +101,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/C_openmp/CMakeLists.txt b/examples/kinsol/C_openmp/CMakeLists.txt index 1fa6c190c9..80beb7a8aa 100644 --- a/examples/kinsol/C_openmp/CMakeLists.txt +++ b/examples/kinsol/C_openmp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for KINSOL OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kinFoodWeb_kry_omp\;4\;develop" - ) +set(KINSOL_examples "kinFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -42,9 +40,11 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") - if (NOT ${example} MATCHES "kinFoodWeb_kry_omp") # No test until TestRunner modified for OpenMP + if(NOT ${example} MATCHES "kinFoodWeb_kry_omp") # No test until TestRunner + # modified for OpenMP # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -57,12 +57,11 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) endif() endforeach(example_tuple ${KINSOL_examples_OMP}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -76,39 +75,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt index d6ea17cb03..53fe77561c 100644 --- a/examples/kinsol/F2003_parallel/CMakeLists.txt +++ b/examples/kinsol/F2003_parallel/CMakeLists.txt @@ -15,19 +15,15 @@ # CMakeLists.txt file for the KINsol F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") - set(FKINSOL_examples - "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") + set(FKINSOL_examples "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(KINSOL_LIBS - sundials_kinsol - sundials_fkinsol_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(KINSOL_LIBS sundials_kinsol sundials_fkinsol_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -45,7 +41,8 @@ foreach(example_tuple ${FKINSOL_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -64,7 +61,8 @@ foreach(example_tuple ${FKINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -78,19 +76,18 @@ foreach(example_tuple ${FKINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) endif() endforeach(example_tuple ${FKINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${KINSOL_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -101,45 +98,39 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM KINSOL_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FKINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/F2003_serial/CMakeLists.txt b/examples/kinsol/F2003_serial/CMakeLists.txt index 1bca9e8dd3..6a71b7c40a 100644 --- a/examples/kinsol/F2003_serial/CMakeLists.txt +++ b/examples/kinsol/F2003_serial/CMakeLists.txt @@ -14,17 +14,14 @@ # CMakeLists.txt file for the F2003 KINSOL serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(FKINSOL_examples - "kinDiagon_kry_f2003\;\;develop") +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases +set(FKINSOL_examples "kinDiagon_kry_f2003\;\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND FKINSOL_examples - "kinRoboKin_dns_f2003\;\;develop" - "kinLaplace_bnd_f2003\;\;develop" - "kinLaplace_picard_kry_f2003\;\;develop" - ) + list(APPEND FKINSOL_examples "kinRoboKin_dns_f2003\;\;develop" + "kinLaplace_bnd_f2003\;\;develop" + "kinLaplace_picard_kry_f2003\;\;develop") endif() # Specify libraries to link against @@ -41,7 +38,8 @@ foreach(example_tuple ${FKINSOL_examples}) list(GET example_tuple 2 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -49,7 +47,8 @@ foreach(example_tuple ${FKINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -58,10 +57,10 @@ foreach(example_tuple ${FKINSOL_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) endif() endforeach(example_tuple ${FKINSOL_examples}) @@ -76,39 +75,33 @@ if(EXAMPLES_INSTALL) examples2string(FKINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/parallel/CMakeLists.txt b/examples/kinsol/parallel/CMakeLists.txt index 2b3cbf7c88..e043a6b221 100644 --- a/examples/kinsol/parallel/CMakeLists.txt +++ b/examples/kinsol/parallel/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for KINSOL parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kinFoodWeb_kry_bbd_p\;1\;4\;exclude-single" - "kinFoodWeb_kry_p\;1\;4\;exclude-single" - ) +set(KINSOL_examples "kinFoodWeb_kry_bbd_p\;1\;4\;exclude-single" + "kinFoodWeb_kry_p\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -53,7 +51,8 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -69,12 +68,11 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel) endif() endforeach(example_tuple ${KINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -88,39 +86,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/serial/CMakeLists.txt b/examples/kinsol/serial/CMakeLists.txt index 9ca7edb76f..47d5fae83a 100644 --- a/examples/kinsol/serial/CMakeLists.txt +++ b/examples/kinsol/serial/CMakeLists.txt @@ -15,47 +15,39 @@ # CMakeLists.txt file for KINSOL serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(KINSOL_examples - "kinAnalytic_fp\;\;" - "kinAnalytic_fp\;--damping_fp 0.5\;develop" - "kinAnalytic_fp\;--m_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --delay_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --damping_aa 0.5\;develop" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 1\;" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 3\;" - "kinFerTron_dns\;\;develop" - "kinFoodWeb_kry\;\;exclude-single" - "kinKrylovDemo_ls\;\;exclude-single" - "kinLaplace_bnd\;\;exclude-single" - "kinLaplace_picard_bnd\;\;exclude-single" - "kinLaplace_picard_kry\;\;exclude-single" - "kinRoberts_fp\;\;develop" - "kinRoboKin_dns\;\;exclude-single" - ) + "kinAnalytic_fp\;\;" + "kinAnalytic_fp\;--damping_fp 0.5\;develop" + "kinAnalytic_fp\;--m_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --delay_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --damping_aa 0.5\;develop" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 1\;" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 3\;" + "kinFerTron_dns\;\;develop" + "kinFoodWeb_kry\;\;exclude-single" + "kinKrylovDemo_ls\;\;exclude-single" + "kinLaplace_bnd\;\;exclude-single" + "kinLaplace_picard_bnd\;\;exclude-single" + "kinLaplace_picard_kry\;\;exclude-single" + "kinRoberts_fp\;\;develop" + "kinRoboKin_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(KINSOL_examples_BL - ) +set(KINSOL_examples_BL) # Examples using KLU linear solver -set(KINSOL_examples_KLU - "kinFerTron_klu\;develop" - ) +set(KINSOL_examples_KLU "kinFerTron_klu\;develop") # Examples using SuperLU_MT linear solver -set(KINSOL_examples_SUPERLUMT - "kinRoboKin_slu\;develop" - ) +set(KINSOL_examples_SUPERLUMT "kinRoboKin_slu\;develop") # Auxiliary files to install -set(KINSOL_extras - kinRoboKin_dns_stats.csv - ) +set(KINSOL_extras kinRoboKin_dns_stats.csv) # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -64,7 +56,6 @@ set(NVECS_LIB sundials_nvecserial) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIB} ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${KINSOL_examples}) @@ -73,8 +64,8 @@ foreach(example_tuple ${KINSOL_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -95,7 +86,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -107,19 +99,17 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -136,7 +126,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -147,14 +138,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -176,7 +166,8 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -187,14 +178,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -216,7 +206,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -227,14 +218,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -243,7 +233,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${KINSOL_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -266,7 +257,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(KINSOL_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -277,39 +268,32 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/nvector/CMakeLists.txt b/examples/nvector/CMakeLists.txt index 54aa22f08d..35a9279997 100644 --- a/examples/nvector/CMakeLists.txt +++ b/examples/nvector/CMakeLists.txt @@ -26,12 +26,12 @@ add_subdirectory(serial) # Build the nvector test utilities add_library(test_nvector_obj OBJECT test_nvector.c) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib + # need PIC when shared libs are used since the example executables will link + # to the shared lib set_property(TARGET test_nvector_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) endif() target_link_libraries(test_nvector_obj PRIVATE sundials_nvecserial) - if(ENABLE_MPI AND MPI_C_FOUND) add_subdirectory(parallel) if(BUILD_NVECTOR_MPIMANYVECTOR) @@ -41,9 +41,11 @@ if(ENABLE_MPI AND MPI_C_FOUND) # Build the mpi nvector test utilities add_library(test_nvectormpi_obj OBJECT test_mpinvector.c) if(BUILD_SHARED_LIBS) - set_property(TARGET test_nvectormpi_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET test_nvectormpi_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() - target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C sundials_nvecparallel) + target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C + sundials_nvecparallel) endif() if(BUILD_NVECTOR_MANYVECTOR) add_subdirectory(manyvector) diff --git a/examples/nvector/C_openmp/CMakeLists.txt b/examples/nvector/C_openmp/CMakeLists.txt index b332f20064..5ed142e6da 100644 --- a/examples/nvector/C_openmp/CMakeLists.txt +++ b/examples/nvector/C_openmp/CMakeLists.txt @@ -14,28 +14,21 @@ # CMakeLists.txt file for OpenMP nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS OpenMP nvector set(nvector_openmp_examples - "test_nvector_openmp\;1000 1 0\;" - "test_nvector_openmp\;1000 2 0\;" - "test_nvector_openmp\;1000 4 0\;" - "test_nvector_openmp\;10000 1 0\;" - "test_nvector_openmp\;10000 2 0\;" - "test_nvector_openmp\;10000 4 0\;" - ) + "test_nvector_openmp\;1000 1 0\;" "test_nvector_openmp\;1000 2 0\;" + "test_nvector_openmp\;1000 4 0\;" "test_nvector_openmp\;10000 1 0\;" + "test_nvector_openmp\;10000 2 0\;" "test_nvector_openmp\;10000 4 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_openmp_fortran_examples - "test_fnvector_openmp_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_openmp_fortran_examples "test_fnvector_openmp_mod\;\;") endif() # Add source directory to include directories @@ -43,7 +36,7 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecopenmp) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecopenmp_mod) endif() @@ -58,8 +51,8 @@ foreach(example_tuple ${nvector_openmp_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -82,17 +75,16 @@ foreach(example_tuple ${nvector_openmp_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp) endif() endforeach(example_tuple ${nvector_openmp_examples}) @@ -105,14 +97,17 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -131,7 +126,8 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -150,39 +146,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/cuda/CMakeLists.txt b/examples/nvector/cuda/CMakeLists.txt index 99893704f8..e60c7f11ef 100644 --- a/examples/nvector/cuda/CMakeLists.txt +++ b/examples/nvector/cuda/CMakeLists.txt @@ -14,20 +14,16 @@ # CMakeLists.txt file for CUDA nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS cuda nvector set(nvector_cuda_examples - "test_nvector_cuda\;3 32 0\;\;\;" - "test_nvector_cuda\;500 128 0\;\;\;" - "test_nvector_cuda\;1000 0 0\;\;\;" - ) + "test_nvector_cuda\;3 32 0\;\;\;" "test_nvector_cuda\;500 128 0\;\;\;" + "test_nvector_cuda\;1000 0 0\;\;\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -48,8 +44,8 @@ foreach(example_tuple ${nvector_cuda_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) @@ -75,28 +71,28 @@ foreach(example_tuple ${nvector_cuda_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cu - ../test_nvector.c - ../test_nvector.h - ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h + install( + FILES ${example}.cu ../test_nvector.c ../test_nvector.h + ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda) endif() endforeach(example_tuple ${nvector_cuda_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -109,39 +105,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/hip/CMakeLists.txt b/examples/nvector/hip/CMakeLists.txt index f2ef2e7621..9d303d2ccd 100644 --- a/examples/nvector/hip/CMakeLists.txt +++ b/examples/nvector/hip/CMakeLists.txt @@ -14,8 +14,8 @@ # CMakeLists.txt file for HIP nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases if(HIP_PLATFORM STREQUAL "nvcc") set(_warp_size 32) @@ -25,10 +25,9 @@ endif() # Examples using SUNDIALS hip nvector set(nvector_hip_examples - "test_nvector_hip.cpp\;3 ${_warp_size} 0\;\;\;" - "test_nvector_hip.cpp\;500 128 0\;\;\;" - "test_nvector_hip.cpp\;1000 0 0\;\;\;" - ) + "test_nvector_hip.cpp\;3 ${_warp_size} 0\;\;\;" + "test_nvector_hip.cpp\;500 128 0\;\;\;" + "test_nvector_hip.cpp\;1000 0 0\;\;\;") # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -52,8 +51,8 @@ foreach(example_tuple ${nvector_hip_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -73,18 +72,21 @@ foreach(example_tuple ${nvector_hip_examples}) if("${number_of_tasks}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_tasks}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_tasks}) endif() else() if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -93,18 +95,14 @@ endforeach(example_tuple ${nvector_hip_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(nvector nvector_hip_examples - SUNDIALS_TARGETS - nvechip - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvector nvector_hip_examples + SUNDIALS_TARGETS nvechip + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES - ../test_nvector.c - ../test_nvector.h + ../test_nvector.c ../test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h - CMAKE_TEMPLATE - cmakelists_HIP_ex.in - DESTINATION - nvector/hip) + CMAKE_TEMPLATE cmakelists_HIP_ex.in + DESTINATION nvector/hip) endif(EXAMPLES_INSTALL) diff --git a/examples/nvector/kokkos/CMakeLists.txt b/examples/nvector/kokkos/CMakeLists.txt index 6f1d8bf9f6..648d867ea0 100644 --- a/examples/nvector/kokkos/CMakeLists.txt +++ b/examples/nvector/kokkos/CMakeLists.txt @@ -14,11 +14,9 @@ # CMakeLists.txt file for Kokkos nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_nvector_kokkos.cpp\;1000 0\;" -) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_nvector_kokkos.cpp\;1000 0\;") include_directories(..) @@ -35,8 +33,8 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -48,10 +46,8 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # link vector test utilties - target_link_libraries(${example_target} PRIVATE - test_nvector_obj - sundials_nveckokkos - ) + target_link_libraries(${example_target} PRIVATE test_nvector_obj + sundials_nveckokkos) endif() # check if example args are provided and set the test name @@ -62,7 +58,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -72,22 +69,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(nvec_kokkos examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c - ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - DESTINATION - nvector/kokkos - ) + sundials_install_examples( + nvec_kokkos examples_list + EXAMPLES_DEPENDENCIES test_nvector.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c + ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos + DESTINATION nvector/kokkos) endif() diff --git a/examples/nvector/manyvector/CMakeLists.txt b/examples/nvector/manyvector/CMakeLists.txt index a43d1e4c15..abba295138 100644 --- a/examples/nvector/manyvector/CMakeLists.txt +++ b/examples/nvector/manyvector/CMakeLists.txt @@ -14,24 +14,19 @@ # CMakeLists.txt file for ManyVector nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS manyvector nvector -set(nvector_manyvector_examples - "test_nvector_manyvector\;1000 100 0\;" - "test_nvector_manyvector\;100 1000 0\;" - ) +set(nvector_manyvector_examples "test_nvector_manyvector\;1000 100 0\;" + "test_nvector_manyvector\;100 1000 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_manyvector_fortran_examples - "test_fnvector_manyvector_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_manyvector_fortran_examples "test_fnvector_manyvector_mod\;\;") endif() # Add source directory to include directories @@ -39,14 +34,13 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecserial sundials_nvecmanyvector) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecserial_mod sundials_fnvecmanyvector_mod) endif() # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${nvector_manyvector_examples}) @@ -55,8 +49,8 @@ foreach(example_tuple ${nvector_manyvector_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -79,17 +73,16 @@ foreach(example_tuple ${nvector_manyvector_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector) endif() endforeach(example_tuple ${nvector_manyvector_examples}) @@ -102,14 +95,17 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -128,7 +124,8 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -147,39 +144,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpicuda/CMakeLists.txt b/examples/nvector/mpicuda/CMakeLists.txt index ce44c0c26e..35f33a5e1b 100644 --- a/examples/nvector/mpicuda/CMakeLists.txt +++ b/examples/nvector/mpicuda/CMakeLists.txt @@ -14,20 +14,17 @@ # CMakeLists.txt file for MPIPlusX, X = CUDA NVECTOR examples. # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI+cuda nvector set(nvector_cuda_examples - "test_nvector_mpicuda\;1000 0\;\;\;" # run sequentially - "test_nvector_mpicuda\;1000 0\;1\;4\;" # run parallel on 4 - ) + "test_nvector_mpicuda\;1000 0\;\;\;" # run sequentially + "test_nvector_mpicuda\;1000 0\;1\;4\;" # run parallel on 4 +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -48,14 +45,15 @@ foreach(example_tuple ${nvector_cuda_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -79,12 +77,14 @@ foreach(example_tuple ${nvector_cuda_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -92,16 +92,13 @@ foreach(example_tuple ${nvector_cuda_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cu - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) + install(FILES ${example}.cu ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) endif() endforeach(example_tuple ${nvector_cuda_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -111,39 +108,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpimanyvector/CMakeLists.txt b/examples/nvector/mpimanyvector/CMakeLists.txt index 66c7253bc9..b6f185aa1f 100644 --- a/examples/nvector/mpimanyvector/CMakeLists.txt +++ b/examples/nvector/mpimanyvector/CMakeLists.txt @@ -14,38 +14,36 @@ # CMakeLists.txt file for MPIManyVector nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPIManyVector module set(nvector_mpimanyvector_examples - "test_nvector_mpimanyvector_parallel1\;1000 200 0\;1\;4\;" # run parallel on 4 procs - "test_nvector_mpimanyvector_parallel2\;200 1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpimanyvector_parallel1\;1000 200 0\;1\;4\;" # run parallel on + # 4 procs + "test_nvector_mpimanyvector_parallel2\;200 1000 0\;1\;4\;" # run parallel on + # 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(nvector_mpimanyvector_fortran_examples - "test_fnvector_mpimanyvector_mod\;\;1\;1\;" - "test_fnvector_mpimanyvector_mod\;\;1\;4\;") + "test_fnvector_mpimanyvector_mod\;\;1\;1\;" + "test_fnvector_mpimanyvector_mod\;\;1\;4\;") endif() # Add source directory to include directories include_directories(. ..) # Specify libraries to link against -set(NVECS_LIB sundials_nvecmpimanyvector - sundials_nvecparallel +set(NVECS_LIB sundials_nvecmpimanyvector sundials_nvecparallel sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecmpimanyvector_mod - sundials_fnvecserial_mod) + sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries @@ -59,7 +57,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -69,7 +67,6 @@ if (BUILD_FORTRAN_MODULE_INTERFACE) endif() endif() - # Add the build and install targets for each example foreach(example_tuple ${nvector_mpimanyvector_examples}) @@ -80,14 +77,15 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -111,12 +109,14 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -124,11 +124,9 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) endif() endforeach(example_tuple ${nvector_mpimanyvector_examples}) @@ -143,14 +141,17 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -176,12 +177,14 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -201,39 +204,33 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpiplusx/CMakeLists.txt b/examples/nvector/mpiplusx/CMakeLists.txt index 195bcb6868..88e551386b 100644 --- a/examples/nvector/mpiplusx/CMakeLists.txt +++ b/examples/nvector/mpiplusx/CMakeLists.txt @@ -14,37 +14,30 @@ # CMakeLists.txt file for parallel MPIPlusX nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI nvector set(nvector_mpiplusx_examples - "test_nvector_mpiplusx\;1000 9\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpiplusx\;1000 9\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_mpiplusx_fortran_examples - "test_fnvector_mpiplusx_mod\;\;1\;1\;" - "test_fnvector_mpiplusx_mod\;\;1\;4\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_mpiplusx_fortran_examples "test_fnvector_mpiplusx_mod\;\;1\;1\;" + "test_fnvector_mpiplusx_mod\;\;1\;4\;") endif() # Add source directory to include directories include_directories(. ..) # Specify libraries to link against -set(NVECS_LIB sundials_nvecmpiplusx - sundials_nvecparallel - sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) - list(APPEND NVECS_LIB sundials_fnvecmpiplusx_mod - sundials_fnvecserial_mod) +set(NVECS_LIB sundials_nvecmpiplusx sundials_nvecparallel sundials_nvecserial) +if(BUILD_FORTRAN_MODULE_INTERFACE) + list(APPEND NVECS_LIB sundials_fnvecmpiplusx_mod sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries @@ -58,7 +51,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -78,14 +71,15 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -109,12 +103,14 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -122,11 +118,9 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) endif() endforeach(example_tuple ${nvector_mpiplusx_examples}) @@ -141,14 +135,17 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -174,12 +171,14 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -199,39 +198,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpiraja/CMakeLists.txt b/examples/nvector/mpiraja/CMakeLists.txt index ffd97ab5a1..bd64a2cf78 100644 --- a/examples/nvector/mpiraja/CMakeLists.txt +++ b/examples/nvector/mpiraja/CMakeLists.txt @@ -14,12 +14,12 @@ # CMakeLists.txt file for raja nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases set(examples_list - "test_nvector_mpiraja.cpp\;1000 0\;\;\;" # run sequentially - "test_nvector_mpiraja.cpp\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpiraja.cpp\;1000 0\;\;\;" # run sequentially + "test_nvector_mpiraja.cpp\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Add source directory to include directories include_directories(. ..) @@ -47,8 +47,8 @@ foreach(example_tuple ${nvector_raja_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -60,15 +60,15 @@ foreach(example_tuple ${nvector_raja_examples}) target_include_directories(${example_target} PUBLIC ${MPI_CXX_INCLUDE_DIRS}) - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - test_nvectormpi_obj - sundials_nvecmpiplusx - sundials_nvecraja - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE test_nvector_obj + test_nvectormpi_obj + sundials_nvecmpiplusx + sundials_nvecraja + ${MPI_CXX_LIBRARIES} + ${EXE_EXTRA_LINK_LIBS} + ${OTHER_LIBS}) endif() @@ -83,12 +83,14 @@ foreach(example_tuple ${nvector_raja_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -98,35 +100,28 @@ endforeach() if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(nvec_mpiraja examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c - test_mpinvector.c + sundials_install_examples( + nvec_mpiraja examples_list + EXAMPLES_DEPENDENCIES test_nvector.c test_mpinvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_mpinvector.c - CMAKE_TEMPLATE - cmakelists_${_lang}_MPI_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - generic - nvecmpiplusx - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - nvector/mpiraja - ) + CMAKE_TEMPLATE cmakelists_${_lang}_MPI_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS generic nvecmpiplusx nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION nvector/mpiraja) endif() diff --git a/examples/nvector/openmpdev/CMakeLists.txt b/examples/nvector/openmpdev/CMakeLists.txt index f115e3c982..d1d301e125 100644 --- a/examples/nvector/openmpdev/CMakeLists.txt +++ b/examples/nvector/openmpdev/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for OpenMP DEV nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS OpenMP DEV nvector -set(nvector_openmpdev_examples - "test_nvector_openmpdev\;1000 0\;" - "test_nvector_openmpdev\;10000 0\;" - ) +set(nvector_openmpdev_examples "test_nvector_openmpdev\;1000 0\;" + "test_nvector_openmpdev\;10000 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # Add source directory to include directories include_directories(. ..) @@ -47,8 +43,8 @@ foreach(example_tuple ${nvector_openmpdev_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -71,22 +67,20 @@ foreach(example_tuple ${nvector_openmpdev_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev) endif() endforeach() - if(EXAMPLES_INSTALL) # Install the README file @@ -99,39 +93,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmpdev_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/parallel/CMakeLists.txt b/examples/nvector/parallel/CMakeLists.txt index bfdf74eec8..c49f6e2f6f 100644 --- a/examples/nvector/parallel/CMakeLists.txt +++ b/examples/nvector/parallel/CMakeLists.txt @@ -14,25 +14,21 @@ # CMakeLists.txt file for MPI nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI nvector set(nvector_parallel_examples - "test_nvector_mpi\;1000 0\;\;\;" # run sequentially - "test_nvector_mpi\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpi\;1000 0\;\;\;" # run sequentially + "test_nvector_mpi\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_parallel_fortran_examples - "test_fnvector_parallel_mod\;\;1\;4\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_parallel_fortran_examples "test_fnvector_parallel_mod\;\;1\;4\;") endif() # Add source directory to include directories @@ -46,7 +42,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -66,8 +62,8 @@ foreach(example_tuple ${nvector_parallel_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -76,11 +72,9 @@ foreach(example_tuple ${nvector_parallel_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - test_nvector_obj - test_nvectormpi_obj - sundials_nvecparallel - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} PRIVATE test_nvector_obj test_nvectormpi_obj + sundials_nvecparallel ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} PRIVATE ${MPI_LIBRARIES}) @@ -98,12 +92,14 @@ foreach(example_tuple ${nvector_parallel_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -111,11 +107,9 @@ foreach(example_tuple ${nvector_parallel_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel) endif() endforeach(example_tuple ${nvector_parallel_examples}) @@ -130,14 +124,17 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -145,10 +142,8 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_fnvecparallel_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_fnvecparallel_mod ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_Fortran_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -166,12 +161,14 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -179,7 +176,6 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) endforeach(example_tuple ${nvector_parallel_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -192,39 +188,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/parhyp/CMakeLists.txt b/examples/nvector/parhyp/CMakeLists.txt index 2c51e65c59..90b2f7e11a 100644 --- a/examples/nvector/parhyp/CMakeLists.txt +++ b/examples/nvector/parhyp/CMakeLists.txt @@ -14,20 +14,17 @@ # CMakeLists.txt file for hypre nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS parallel hypre nvector set(nvector_parhyp_examples - "test_nvector_parhyp\;1000 0\;1\;1\;" # run sequentially - "test_nvector_parhyp\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_parhyp\;1000 0\;1\;1\;" # run sequentially + "test_nvector_parhyp\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -61,14 +58,15 @@ foreach(example_tuple ${nvector_parhyp_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -92,12 +90,14 @@ foreach(example_tuple ${nvector_parhyp_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -105,11 +105,9 @@ foreach(example_tuple ${nvector_parhyp_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - ../test_mpinvector.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + ../test_mpinvector.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) endif() endforeach(example_tuple ${nvector_parhyp_examples}) @@ -126,39 +124,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parhyp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parhyp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/petsc/CMakeLists.txt b/examples/nvector/petsc/CMakeLists.txt index 7c838ee724..db3d53c851 100644 --- a/examples/nvector/petsc/CMakeLists.txt +++ b/examples/nvector/petsc/CMakeLists.txt @@ -14,20 +14,16 @@ # CMakeLists.txt file for PETSc nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS PETSc nvector -set(nvector_petsc_examples - "test_nvector_petsc\;1000 0\;\;\;" # run sequentially - "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs - ) +set(nvector_petsc_examples "test_nvector_petsc\;1000 0\;\;\;" # run sequentially + "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -47,7 +43,6 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() - # Add the build and install targets for each nvector example foreach(example_tuple ${nvector_petsc_examples}) @@ -58,14 +53,15 @@ foreach(example_tuple ${nvector_petsc_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -89,12 +85,14 @@ foreach(example_tuple ${nvector_petsc_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -102,16 +100,13 @@ foreach(example_tuple ${nvector_petsc_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) endif() endforeach(example_tuple ${nvector_petsc_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -124,39 +119,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/pthreads/CMakeLists.txt b/examples/nvector/pthreads/CMakeLists.txt index e9fefd7191..4dc45ff76d 100644 --- a/examples/nvector/pthreads/CMakeLists.txt +++ b/examples/nvector/pthreads/CMakeLists.txt @@ -14,28 +14,21 @@ # CMakeLists.txt file for PThread nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS pthread nvector set(nvector_pthreads_examples - "test_nvector_pthreads\;1000 1 0\;" - "test_nvector_pthreads\;1000 2 0\;" - "test_nvector_pthreads\;1000 4 0\;" - "test_nvector_pthreads\;10000 1 0\;" - "test_nvector_pthreads\;10000 2 0\;" - "test_nvector_pthreads\;10000 4 0\;" - ) + "test_nvector_pthreads\;1000 1 0\;" "test_nvector_pthreads\;1000 2 0\;" + "test_nvector_pthreads\;1000 4 0\;" "test_nvector_pthreads\;10000 1 0\;" + "test_nvector_pthreads\;10000 2 0\;" "test_nvector_pthreads\;10000 4 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_pthreads_fortran_examples - "test_fnvector_pthreads_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_pthreads_fortran_examples "test_fnvector_pthreads_mod\;\;") endif() # Add source directory to include directories @@ -43,7 +36,7 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecpthreads) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecpthreads_mod) endif() @@ -58,8 +51,8 @@ foreach(example_tuple ${nvector_pthreads_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -71,7 +64,8 @@ foreach(example_tuple ${nvector_pthreads_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} + ${CMAKE_THREAD_LIBS_INIT}) endif() # check if example args are provided and set the test name @@ -82,17 +76,16 @@ foreach(example_tuple ${nvector_pthreads_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) endif() endforeach(example_tuple ${nvector_pthreads_examples}) @@ -105,14 +98,17 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -131,7 +127,8 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -150,39 +147,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_pthreads_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_pthreads_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/raja/CMakeLists.txt b/examples/nvector/raja/CMakeLists.txt index ad87ee3902..3e8d716eaf 100644 --- a/examples/nvector/raja/CMakeLists.txt +++ b/examples/nvector/raja/CMakeLists.txt @@ -14,15 +14,12 @@ # CMakeLists.txt file for raja nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_nvector_raja.cpp\;1000 0\;" - ) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_nvector_raja.cpp\;1000 0\;") # Add source directory to include directories -include_directories(. .. - ${SUNDIALS_SOURCE_DIR}/examples/utilities) +include_directories(. .. ${SUNDIALS_SOURCE_DIR}/examples/utilities) if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_lang CUDA) @@ -51,8 +48,8 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # add example source files @@ -63,12 +60,9 @@ foreach(example_tuple ${examples_list}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - sundials_nvecraja - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE test_nvector_obj sundials_nvecraja + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) endif() @@ -80,7 +74,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -89,31 +84,27 @@ endforeach() if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(nvec_raja examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvec_raja examples_list + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/${_custom_memhelper} - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - SUNDIALS_TARGETS - generic - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - nvector/raja - ) + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + SUNDIALS_TARGETS generic nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION nvector/raja) endif() diff --git a/examples/nvector/serial/CMakeLists.txt b/examples/nvector/serial/CMakeLists.txt index 6807562188..5e74daf715 100644 --- a/examples/nvector/serial/CMakeLists.txt +++ b/examples/nvector/serial/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for serial nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS serial nvector -set(nvector_serial_examples - "test_nvector_serial\;1000 0\;" - "test_nvector_serial\;10000 0\;" - ) +set(nvector_serial_examples "test_nvector_serial\;1000 0\;" + "test_nvector_serial\;10000 0\;") # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_serial_fortran_examples - "test_fnvector_serial_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_serial_fortran_examples "test_fnvector_serial_mod\;\;") endif() # Add source directory to include directories @@ -34,14 +31,13 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${nvector_serial_examples}) @@ -50,8 +46,8 @@ foreach(example_tuple ${nvector_serial_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -74,17 +70,16 @@ foreach(example_tuple ${nvector_serial_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial) endif() endforeach(example_tuple ${nvector_serial_examples}) @@ -97,14 +92,17 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -123,7 +121,8 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -143,26 +142,22 @@ if(EXAMPLES_INSTALL) examples2string(nvector_serial_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. - set(EXAMPLES_DEPENDENCIES ) + # building the examples. This makefile can then be used as a template for the + # user's own programs. + set(EXAMPLES_DEPENDENCIES) set(nvector_serial_dependencies test_nvector) examples2string(nvector_serial_dependencies EXAMPLES_DEPENDENCIES) @@ -170,15 +165,12 @@ if(EXAMPLES_INSTALL) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/sycl/CMakeLists.txt b/examples/nvector/sycl/CMakeLists.txt index f667464755..70e7b04121 100644 --- a/examples/nvector/sycl/CMakeLists.txt +++ b/examples/nvector/sycl/CMakeLists.txt @@ -14,15 +14,13 @@ # CMakeLists.txt file for SYCL nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS sycl nvector set(nvector_sycl_examples - "test_nvector_sycl.cpp\;7 32 0\;" - "test_nvector_sycl.cpp\;500 128 0\;" - "test_nvector_sycl.cpp\;1000 0 0\;" - ) + "test_nvector_sycl.cpp\;7 32 0\;" "test_nvector_sycl.cpp\;500 128 0\;" + "test_nvector_sycl.cpp\;1000 0 0\;") # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -38,8 +36,8 @@ foreach(example_tuple ${nvector_sycl_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files @@ -49,11 +47,9 @@ foreach(example_tuple ${nvector_sycl_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - sundials_nvecsycl - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE test_nvector_obj sundials_nvecsycl + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -65,29 +61,25 @@ foreach(example_tuple ${nvector_sycl_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(nvector_sycl nvector_sycl_examples - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvector_sycl nvector_sycl_examples + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_sycl.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - DESTINATION - nvector/sycl - ) + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl + DESTINATION nvector/sycl) endif() diff --git a/examples/nvector/trilinos/CMakeLists.txt b/examples/nvector/trilinos/CMakeLists.txt index 0bda6e0cb7..909b1366b9 100644 --- a/examples/nvector/trilinos/CMakeLists.txt +++ b/examples/nvector/trilinos/CMakeLists.txt @@ -14,37 +14,33 @@ # CMakeLists.txt file for Trilinos nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;tasks\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;tasks\;type" where the type is 'develop' +# for examples excluded from 'make test' in releases # Examples using SUNDIALS Trilinos nvector wrapper if(Trilinos_INTERFACE_MPI_CXX_FOUND) set(nvector_trilinos_examples - "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially - "test_nvector_trilinos\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially + "test_nvector_trilinos\;1000 0\;1\;4\;" # run parallel on 4 procs + ) else() set(nvector_trilinos_examples - "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially - ) + "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially + ) endif() # Dependencies for nvector examples if(Trilinos_MPI) - set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) + set(nvector_examples_dependencies test_nvector test_mpinvector) else() - set(nvector_examples_dependencies - test_nvector - ) + set(nvector_examples_dependencies test_nvector) endif() # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") # Set Trilinos MPI executable for trilinos tests @@ -69,22 +65,22 @@ foreach(example_tuple ${nvector_trilinos_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) # link vector test utilties target_link_libraries(${example} PRIVATE test_nvector_obj) - if (Trilinos_MPI) + if(Trilinos_MPI) target_link_libraries(${example} PRIVATE test_nvectormpi_obj) endif() set_target_properties(${example} PROPERTIES FOLDER "Examples") - # Trilinos libraries must be linked after SUNDIALS libraries! - # Otherwise, segfaults may occur; something to do with RCPs. + # Trilinos libraries must be linked after SUNDIALS libraries! Otherwise, + # segfaults may occur; something to do with RCPs. target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS}) endif() @@ -99,12 +95,14 @@ foreach(example_tuple ${nvector_trilinos_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -112,16 +110,13 @@ foreach(example_tuple ${nvector_trilinos_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cpp - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) + install(FILES ${example}.cpp ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) endif() endforeach(example_tuple ${nvector_trilinos_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -134,39 +129,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/CMakeLists.txt b/examples/sunlinsol/CMakeLists.txt index c57c73797f..34eecd211b 100644 --- a/examples/sunlinsol/CMakeLists.txt +++ b/examples/sunlinsol/CMakeLists.txt @@ -33,8 +33,10 @@ add_subdirectory(pcg/serial) # Build the sunlinsol test utilities add_library(test_sunlinsol_obj OBJECT test_sunlinsol.c test_sunlinsol.h) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib - set_property(TARGET test_sunlinsol_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + # need PIC when shared libs are used since the example executables will link + # to the shared lib + set_property(TARGET test_sunlinsol_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() target_link_libraries(test_sunlinsol_obj PRIVATE sundials_sunlinsoldense) diff --git a/examples/sunlinsol/band/CMakeLists.txt b/examples/sunlinsol/band/CMakeLists.txt index 8a6d09997e..ef4cf305f2 100644 --- a/examples/sunlinsol/band/CMakeLists.txt +++ b/examples/sunlinsol/band/CMakeLists.txt @@ -14,26 +14,20 @@ # CMakeLists.txt file for sunlinsol band examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS band linear solver set(sunlinsol_band_examples - "test_sunlinsol_band\;10 2 3 0\;" - "test_sunlinsol_band\;300 7 4 0\;" - "test_sunlinsol_band\;1000 8 8 0\;" - "test_sunlinsol_band\;5000 3 100 0\;" -) + "test_sunlinsol_band\;10 2 3 0\;" "test_sunlinsol_band\;300 7 4 0\;" + "test_sunlinsol_band\;1000 8 8 0\;" "test_sunlinsol_band\;5000 3 100 0\;") # Dependencies for nvector examples -set(sunlinsol_band_dependencies - test_sunlinsol - ) +set(sunlinsol_band_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_band_fortran_examples - "test_fsunlinsol_band_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_band_fortran_examples "test_fsunlinsol_band_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +41,8 @@ foreach(example_tuple ${sunlinsol_band_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -57,10 +51,8 @@ foreach(example_tuple ${sunlinsol_band_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolband - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunlinsolband + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,17 +63,16 @@ foreach(example_tuple ${sunlinsol_band_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) endif() endforeach(example_tuple ${sunlinsol_band_examples}) @@ -94,14 +85,17 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -109,12 +103,9 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolband - sundials_fsunlinsolband_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolband sundials_fsunlinsolband_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name if("${example_args}" STREQUAL "") @@ -124,7 +115,8 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -132,7 +124,6 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) endforeach(example_tuple ${sunlinsol_band_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -142,47 +133,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolband") set(LIBS "${LIBS} -lsundials_sunmatrixband") - # Set the link directory for the band sunmatrix library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the band sunmatrix library The generated + # CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_band_examples EXAMPLES) examples2string(sunlinsol_band_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/cusolversp/CMakeLists.txt b/examples/sunlinsol/cusolversp/CMakeLists.txt index ed288d8014..69bc49e030 100644 --- a/examples/sunlinsol/cusolversp/CMakeLists.txt +++ b/examples/sunlinsol/cusolversp/CMakeLists.txt @@ -14,12 +14,10 @@ # CMakeLists.txt file for cuSolverSp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_sunlinsol_cusolversp_batchqr.cu\;100 1 0\;" - "test_sunlinsol_cusolversp_batchqr.cu\;10 10 0\;" - ) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_sunlinsol_cusolversp_batchqr.cu\;100 1 0\;" + "test_sunlinsol_cusolversp_batchqr.cu\;10 10 0\;") # Add source directory to include directories include_directories(. ..) @@ -35,25 +33,26 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_nveccuda - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunmatrixcusparse - sundials_sunlinsolcusolversp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_nveccuda + sundials_nvecserial + sundials_sunmatrixdense + sundials_sunmatrixsparse + sundials_sunmatrixcusparse + sundials_sunlinsolcusolversp + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -64,7 +63,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -73,23 +73,14 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_cusolversp examples_list - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CUDA_ex.in - SUNDIALS_TARGETS - nveccuda - nvecserial - sunmatrixdense - sunmatrixsparse - sunmatrixcusparse - sunlinsolcusolversp - DESTINATION - sunlinsol/cusolversp - ) + sundials_install_examples( + sunlinsol_cusolversp examples_list + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CUDA_ex.in + SUNDIALS_TARGETS nveccuda nvecserial sunmatrixdense sunmatrixsparse + sunmatrixcusparse sunlinsolcusolversp + DESTINATION sunlinsol/cusolversp) endif() diff --git a/examples/sunlinsol/dense/CMakeLists.txt b/examples/sunlinsol/dense/CMakeLists.txt index 03b6155811..7dec711c8a 100644 --- a/examples/sunlinsol/dense/CMakeLists.txt +++ b/examples/sunlinsol/dense/CMakeLists.txt @@ -15,26 +15,20 @@ # CMakeLists.txt file for sunlinsol dense examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS dense linear solver set(sunlinsol_dense_examples - "test_sunlinsol_dense\;10 0\;" - "test_sunlinsol_dense\;100 0\;" - "test_sunlinsol_dense\;500 0\;" - "test_sunlinsol_dense\;1000 0\;" -) + "test_sunlinsol_dense\;10 0\;" "test_sunlinsol_dense\;100 0\;" + "test_sunlinsol_dense\;500 0\;" "test_sunlinsol_dense\;1000 0\;") # Dependencies for nvector examples -set(sunlinsol_dense_dependencies - test_sunlinsol - ) +set(sunlinsol_dense_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_dense_fortran_examples - "test_fsunlinsol_dense_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_dense_fortran_examples "test_fsunlinsol_dense_mod\;\;") endif() # Add source directory to include directories @@ -48,8 +42,8 @@ foreach(example_tuple ${sunlinsol_dense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -58,10 +52,8 @@ foreach(example_tuple ${sunlinsol_dense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsoldense - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsoldense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,16 +64,15 @@ foreach(example_tuple ${sunlinsol_dense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) endif() endforeach(example_tuple ${sunlinsol_dense_examples}) @@ -94,14 +85,17 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -109,11 +103,9 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsoldense - sundials_fsunlinsoldense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsoldense sundials_fsunlinsoldense_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -124,7 +116,8 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -141,47 +134,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsoldense") set(LIBS "${LIBS} -lsundials_sunmatrixdense") - # Set the link directory for the dense sunmatrix library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix library The generated + # CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_dense_examples EXAMPLES) examples2string(sunlinsol_dense_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/ginkgo/CMakeLists.txt b/examples/sunlinsol/ginkgo/CMakeLists.txt index 6d3cae204f..c701ffc672 100644 --- a/examples/sunlinsol/ginkgo/CMakeLists.txt +++ b/examples/sunlinsol/ginkgo/CMakeLists.txt @@ -12,25 +12,26 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples - "test_sunlinsol_ginkgo.cpp\;bicg csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;bicg dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;cgs csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;cgs dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;gmres csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;gmres dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;idr csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;idr dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;bicg csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;bicg dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;cgs csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;cgs dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;gmres csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;gmres dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;idr csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;idr dense 100 0 100 0\;" ) # Add source directory to include directories include_directories(..) -sundials_add_examples_ginkgo(examples +sundials_add_examples_ginkgo( + examples TARGETS test_sunlinsol_obj BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) @@ -54,16 +55,12 @@ if(EXAMPLES_INSTALL) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(sunlinsol - CPU_GPU_EXAMPLES_VAR - examples - SUNDIALS_COMPONENTS - ${vectors} - DEPENDENCIES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - DESTINATION - sunlinsol/ginkgo - ) + sundials_install_examples_ginkgo( + sunlinsol + CPU_GPU_EXAMPLES_VAR examples + SUNDIALS_COMPONENTS ${vectors} + DEPENDENCIES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + DESTINATION sunlinsol/ginkgo) endif() diff --git a/examples/sunlinsol/klu/CMakeLists.txt b/examples/sunlinsol/klu/CMakeLists.txt index 664ec266a1..e3f54ce991 100644 --- a/examples/sunlinsol/klu/CMakeLists.txt +++ b/examples/sunlinsol/klu/CMakeLists.txt @@ -14,26 +14,20 @@ # CMakeLists.txt file for sunlinsol KLU examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the KLU linear solver set(sunlinsol_klu_examples - "test_sunlinsol_klu\;300 0 0\;" - "test_sunlinsol_klu\;300 1 0\;" - "test_sunlinsol_klu\;1000 0 0\;" - "test_sunlinsol_klu\;1000 1 0\;" - ) + "test_sunlinsol_klu\;300 0 0\;" "test_sunlinsol_klu\;300 1 0\;" + "test_sunlinsol_klu\;1000 0 0\;" "test_sunlinsol_klu\;1000 1 0\;") # Dependencies for nvector examples -set(sunlinsol_klu_dependencies - test_sunlinsol - ) +set(sunlinsol_klu_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_klu_fortran_examples - "test_fsunlinsol_klu_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_klu_fortran_examples "test_fsunlinsol_klu_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +41,8 @@ foreach(example_tuple ${sunlinsol_klu_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -57,11 +51,9 @@ foreach(example_tuple ${sunlinsol_klu_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunlinsolklu - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunlinsolklu ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,17 +64,16 @@ foreach(example_tuple ${sunlinsol_klu_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) endif() endforeach(example_tuple ${sunlinsol_klu_examples}) @@ -95,14 +86,17 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -110,7 +104,8 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod sundials_sunmatrixdense @@ -127,7 +122,8 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -144,47 +140,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolklu") set(LIBS "${LIBS} -lsundials_sunmatrixsparse -lsundials_sunmatrixdense") - # Set the link directory for the sparse and dense sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the sparse and dense sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_klu_examples EXAMPLES_KLU) examples2string(sunlinsol_klu_dependencies EXAMPLES_DEPENDENCIES_KLU) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/kokkos/CMakeLists.txt b/examples/sunlinsol/kokkos/CMakeLists.txt index 7a4c9e0f5c..08964355dc 100644 --- a/examples/sunlinsol/kokkos/CMakeLists.txt +++ b/examples/sunlinsol/kokkos/CMakeLists.txt @@ -12,14 +12,13 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples_list - "test_sunlinsol_kokkosdense.cpp\;10 1 0\;" - "test_sunlinsol_kokkosdense.cpp\;100 1 0\;" - "test_sunlinsol_kokkosdense.cpp\;10 1000 0\;" - "test_sunlinsol_kokkosdense.cpp\;100 50 0\;" - ) + "test_sunlinsol_kokkosdense.cpp\;10 1 0\;" + "test_sunlinsol_kokkosdense.cpp\;100 1 0\;" + "test_sunlinsol_kokkosdense.cpp\;10 1000 0\;" + "test_sunlinsol_kokkosdense.cpp\;100 50 0\;") # Add source directory to include directories include_directories(..) @@ -37,10 +36,10 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -49,13 +48,10 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_nveckokkos - sundials_sunmatrixkokkosdense - sundials_sunlinsolkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_nveckokkos sundials_sunmatrixkokkosdense + sundials_sunlinsolkokkosdense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -66,7 +62,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -76,25 +73,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_kokkosdense examples_list - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - sunlinsolkokkosdense - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - DESTINATION - sunlinsol/kokkos - ) + sundials_install_examples( + sunlinsol_kokkosdense examples_list + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense sunlinsolkokkosdense + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + DESTINATION sunlinsol/kokkos) endif() diff --git a/examples/sunlinsol/lapackband/CMakeLists.txt b/examples/sunlinsol/lapackband/CMakeLists.txt index 672a6ab46f..fefcb00eb3 100644 --- a/examples/sunlinsol/lapackband/CMakeLists.txt +++ b/examples/sunlinsol/lapackband/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for sunlinsol LAPACK band examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the LAPACK band linear solver set(sunlinsol_lapackband_examples - "test_sunlinsol_lapackband\;10 2 3 0 0\;" - "test_sunlinsol_lapackband\;300 7 4 0 0\;" - "test_sunlinsol_lapackband\;1000 8 8 0 0\;" - "test_sunlinsol_lapackband\;5000 3 100 0 0\;" - ) + "test_sunlinsol_lapackband\;10 2 3 0 0\;" + "test_sunlinsol_lapackband\;300 7 4 0 0\;" + "test_sunlinsol_lapackband\;1000 8 8 0 0\;" + "test_sunlinsol_lapackband\;5000 3 100 0 0\;") # Dependencies for nvector examples -set(sunlinsol_lapackband_dependencies - test_sunlinsol - ) +set(sunlinsol_lapackband_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ..) @@ -41,8 +38,8 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -51,12 +48,9 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixband - sundials_sunlinsollapackband - ${LAPACK_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixband + sundials_sunlinsollapackband ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -67,22 +61,20 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) endif() endforeach(example_tuple ${sunlinsol_lapackband_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -92,47 +84,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsollapackband") set(LIBS "${LIBS} -lsundials_sunmatrixband -lsundials_sunmatrixdense") - # Set the link directory for the band and dense sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the band and dense sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_lapackband_examples EXAMPLES_BL) examples2string(sunlinsol_lapackband_dependencies EXAMPLES_DEPENDENCIES_BL) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index 0dd6ea947e..e5ff8e32b4 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -14,30 +14,26 @@ # CMakeLists.txt file for sunlinsol LAPACK dense examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the LAPACK dense linear solver set(sunlinsol_lapackdense_examples - "test_sunlinsol_lapackdense\;10 0 0\;" - "test_sunlinsol_lapackdense\;100 0 0\;" - "test_sunlinsol_lapackdense\;500 0 0\;" - "test_sunlinsol_lapackdense\;1000 0 0\;" -) + "test_sunlinsol_lapackdense\;10 0 0\;" + "test_sunlinsol_lapackdense\;100 0 0\;" + "test_sunlinsol_lapackdense\;500 0 0\;" + "test_sunlinsol_lapackdense\;1000 0 0\;") # Dependencies for nvector examples -set(sunlinsol_lapackdense_dependencies - test_sunlinsol -) +set(sunlinsol_lapackdense_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(sunlinsol_lapackdense_fortran_examples - "test_fsunlinsol_lapackdense_mod\;10 0 0\;" - "test_fsunlinsol_lapackdense_mod\;100 0 0\;" - "test_fsunlinsol_lapackdense_mod\;500 0 0\;" - "test_fsunlinsol_lapackdense_mod\;1000 0 0\;" - ) + "test_fsunlinsol_lapackdense_mod\;10 0 0\;" + "test_fsunlinsol_lapackdense_mod\;100 0 0\;" + "test_fsunlinsol_lapackdense_mod\;500 0 0\;" + "test_fsunlinsol_lapackdense_mod\;1000 0 0\;") endif() # Add source directory to include directories @@ -51,8 +47,8 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -61,12 +57,9 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunlinsollapackdense - ${LAPACK_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunlinsollapackdense ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -77,17 +70,16 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) endif() endforeach(example_tuple ${sunlinsol_lapackdense_examples}) @@ -100,14 +92,17 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -115,11 +110,9 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsollapackdense sundials_fsunlinsollapackdense_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -130,7 +123,8 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -138,7 +132,6 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) endforeach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -148,47 +141,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsollapackdense") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixband") - # Set the link directory for the dense and band sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and band sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_lapackdense_examples EXAMPLES_BL) examples2string(sunlinsol_lapackdense_dependencies EXAMPLES_DEPENDENCIES_BL) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/magmadense/CMakeLists.txt b/examples/sunlinsol/magmadense/CMakeLists.txt index 0d58eed8f3..9a2b4460c6 100644 --- a/examples/sunlinsol/magmadense/CMakeLists.txt +++ b/examples/sunlinsol/magmadense/CMakeLists.txt @@ -12,23 +12,24 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS MAGMA dense matrix set(sunlinsols_magmadense_examples - "test_sunlinsol_magmadense.cpp\;10 1 0\;" - "test_sunlinsol_magmadense.cpp\;100 1 0\;" - "test_sunlinsol_magmadense.cpp\;10 1000 0\;" - "test_sunlinsol_magmadense.cpp\;100 100 0\;" - ) + "test_sunlinsol_magmadense.cpp\;10 1 0\;" + "test_sunlinsol_magmadense.cpp\;100 1 0\;" + "test_sunlinsol_magmadense.cpp\;10 1000 0\;" + "test_sunlinsol_magmadense.cpp\;100 100 0\;") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE CUDA) + set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE + CUDA) set(vector nveccuda) set(cuda_or_hip CUDA) elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") - set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE CXX) + set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE + CXX) set(vector nvechip) set(cuda_or_hip HIP) endif() @@ -47,20 +48,18 @@ foreach(example_tuple ${sunlinsols_magmadense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_${vector} - sundials_sunlinsolmagmadense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_${vector} sundials_sunlinsolmagmadense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,7 +70,8 @@ foreach(example_tuple ${sunlinsols_magmadense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -80,19 +80,13 @@ endforeach(example_tuple ${sunlinsols_magmadense_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_magma sunlinsols_magmadense_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - ${vector} - sunlinsolmagmadense - DESTINATION - sunlinsol/magmadense - ) + sundials_install_examples( + sunlinsol_magma sunlinsols_magmadense_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS ${vector} sunlinsolmagmadense + DESTINATION sunlinsol/magmadense) endif() diff --git a/examples/sunlinsol/onemkldense/CMakeLists.txt b/examples/sunlinsol/onemkldense/CMakeLists.txt index de5cf8b81a..bdf4c4fb5c 100644 --- a/examples/sunlinsol/onemkldense/CMakeLists.txt +++ b/examples/sunlinsol/onemkldense/CMakeLists.txt @@ -12,16 +12,15 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS ONEMKL dense matrix set(sunlinsols_onemkldense_examples - "test_sunlinsol_onemkldense.cpp\;10 1 0\;" - "test_sunlinsol_onemkldense.cpp\;100 1 0\;" - "test_sunlinsol_onemkldense.cpp\;10 1000 0\;" - "test_sunlinsol_onemkldense.cpp\;100 100 0\;" - ) + "test_sunlinsol_onemkldense.cpp\;10 1 0\;" + "test_sunlinsol_onemkldense.cpp\;100 1 0\;" + "test_sunlinsol_onemkldense.cpp\;10 1000 0\;" + "test_sunlinsol_onemkldense.cpp\;100 100 0\;") # Add source directory to include directories include_directories(..) @@ -37,7 +36,7 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -46,14 +45,11 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_sunlinsol_obj - sundials_nvecsycl - sundials_sunlinsolonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE test_sunlinsol_obj sundials_nvecsycl + sundials_sunlinsolonemkldense MKL::MKL_DPCPP + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -65,31 +61,24 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_onemkl sunlinsols_onemkldense_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - sunlinsolonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - sunlinsol/onemkldense - ) + sundials_install_examples( + sunlinsol_onemkl sunlinsols_onemkldense_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl sunlinsolonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION sunlinsol/onemkldense) endif() diff --git a/examples/sunlinsol/pcg/parallel/CMakeLists.txt b/examples/sunlinsol/pcg/parallel/CMakeLists.txt index 35982c87cf..7048c8f022 100644 --- a/examples/sunlinsol/pcg/parallel/CMakeLists.txt +++ b/examples/sunlinsol/pcg/parallel/CMakeLists.txt @@ -23,18 +23,15 @@ else() set(TOL "1e-13") endif() -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS PCG linear solver set(sunlinsol_pcg_examples - "test_sunlinsol_pcg_parallel\;100 500 ${TOL} 0\;1\;4\;" - ) + "test_sunlinsol_pcg_parallel\;100 500 ${TOL} 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_pcg_dependencies - test_sunlinsol - ) +set(sunlinsol_pcg_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -57,21 +54,18 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files - add_executable(${example} ${example}.c - ../../test_sunlinsol.c) + add_executable(${example} ${example}.c ../../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolpcg - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolpcg ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -86,7 +80,8 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -94,15 +89,12 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel) endif() endforeach(example_tuple ${sunlinsol_pcg_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -115,39 +107,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_pcg_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/pcg/serial/CMakeLists.txt b/examples/sunlinsol/pcg/serial/CMakeLists.txt index 4d6be609ee..353c4a4b97 100644 --- a/examples/sunlinsol/pcg/serial/CMakeLists.txt +++ b/examples/sunlinsol/pcg/serial/CMakeLists.txt @@ -23,23 +23,18 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS PCG linear solver -set(sunlinsol_pcg_examples - "test_sunlinsol_pcg_serial\;100 500 ${TOL} 0\;" - ) +set(sunlinsol_pcg_examples "test_sunlinsol_pcg_serial\;100 500 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_pcg_dependencies - test_sunlinsol - ) +set(sunlinsol_pcg_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_pcg_fortran_examples - "test_fsunlinsol_pcg_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_pcg_fortran_examples "test_fsunlinsol_pcg_mod_serial\;\;") endif() # Add source directory to include directories @@ -53,21 +48,18 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files - add_executable(${example} ${example}.c - ../../test_sunlinsol.c) + add_executable(${example} ${example}.c ../../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolpcg - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunlinsolpcg + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +70,16 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial) endif() endforeach(example_tuple ${sunlinsol_pcg_examples}) @@ -101,14 +92,17 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,12 +110,9 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolpcg - sundials_fsunlinsolpcg_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolpcg sundials_fsunlinsolpcg_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name if("${example_args}" STREQUAL "") @@ -131,7 +122,8 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +143,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_pcg_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt b/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt index 2423663c52..d5934add2f 100644 --- a/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPBCGS parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPBCGS linear solver set(sunlinsol_spbcgs_examples - "test_sunlinsol_spbcgs_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spbcgs_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spbcgs_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spbcgs_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spbcgs_dependencies - test_sunlinsol - ) +set(sunlinsol_spbcgs_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspbcgs - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspbcgs ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_include_directories(${example} ${MPI_INCLUDE_PATH}) @@ -78,7 +73,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -86,15 +82,12 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel) endif() endforeach(example_tuple ${sunlinsol_spbcgs_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -107,39 +100,36 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spbcgs_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt index 005f743cdf..1868e93bee 100644 --- a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @@ -23,24 +23,20 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPBCGS linear solver set(sunlinsol_spbcgs_examples - "test_sunlinsol_spbcgs_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_spbcgs_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spbcgs_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_spbcgs_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spbcgs_dependencies - test_sunlinsol - ) +set(sunlinsol_spbcgs_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spbcgs_fortran_examples - "test_fsunlinsol_spbcgs_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spbcgs_fortran_examples "test_fsunlinsol_spbcgs_mod_serial\;\;") endif() # Add source directory to include directories @@ -54,8 +50,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -64,10 +60,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspbcgs - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspbcgs ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +72,16 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial) endif() endforeach(example_tuple ${sunlinsol_spbcgs_examples}) @@ -101,14 +94,17 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,11 +112,9 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspbcgs - sundials_fsunlinsolspbcgs_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspbcgs sundials_fsunlinsolspbcgs_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -131,7 +125,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +146,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spbcgs_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt b/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt index c687877fcb..0d95eb0e53 100644 --- a/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPFGMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPTFQMR linear solver set(sunlinsol_spfgmr_examples - "test_sunlinsol_spfgmr_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spfgmr_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spfgmr_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spfgmr_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spfgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spfgmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspfgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspfgmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -77,7 +72,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -85,15 +81,12 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) # add example to regression tests if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel) endif() endforeach(example_tuple ${sunlinsol_spfgmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +99,36 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spfgmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt index daa7d9fca3..aca3e453af 100644 --- a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @@ -23,23 +23,19 @@ else() set(TOL "1e-14") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPFGMR linear solver set(sunlinsol_spfgmr_examples - "test_sunlinsol_spfgmr_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_spfgmr_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spfgmr_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_spfgmr_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spfgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spfgmr_dependencies test_sunlinsol) -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spfgmr_fortran_examples - "test_fsunlinsol_spfgmr_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spfgmr_fortran_examples "test_fsunlinsol_spfgmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -53,8 +49,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -63,10 +59,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspfgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspfgmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -77,17 +71,16 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial) endif() endforeach(example_tuple ${sunlinsol_spfgmr_examples}) @@ -100,14 +93,17 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -115,11 +111,9 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspfgmr - sundials_fsunlinsolspfgmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspfgmr sundials_fsunlinsolspfgmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -130,7 +124,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -138,7 +133,6 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) endforeach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -151,39 +145,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spfgmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spgmr/parallel/CMakeLists.txt b/examples/sunlinsol/spgmr/parallel/CMakeLists.txt index db280af33d..3dbda67ac8 100644 --- a/examples/sunlinsol/spgmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/parallel/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for sunlinsol SPGMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPGMR linear solver set(sunlinsol_spgmr_examples - "test_sunlinsol_spgmr_parallel\;100 1 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 1 2 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 2 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 2 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spgmr_parallel\;100 1 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 1 2 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 2 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 2 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spgmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -41,7 +38,6 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() - # Add the build and install targets for each example foreach(example_tuple ${sunlinsol_spgmr_examples}) @@ -52,8 +48,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -62,10 +58,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspgmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -80,7 +74,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -88,15 +83,12 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel) endif() endforeach(example_tuple ${sunlinsol_spgmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -109,39 +101,34 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spgmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spgmr/serial/CMakeLists.txt b/examples/sunlinsol/spgmr/serial/CMakeLists.txt index 3353f2a829..e318ed93a0 100644 --- a/examples/sunlinsol/spgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/serial/CMakeLists.txt @@ -23,26 +23,22 @@ else() set(TOL "1e-14") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPGMR linear solver set(sunlinsol_spgmr_examples - "test_sunlinsol_spgmr_serial\;100 1 1 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 2 1 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 1 2 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 2 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spgmr_serial\;100 1 1 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 2 1 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 1 2 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 2 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spgmr_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spgmr_fortran_examples - "test_fsunlinsol_spgmr_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spgmr_fortran_examples "test_fsunlinsol_spgmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -56,8 +52,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -66,10 +62,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspgmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -80,17 +74,16 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial) endif() endforeach(example_tuple ${sunlinsol_spgmr_examples}) @@ -103,14 +96,17 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -118,11 +114,9 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspgmr - sundials_fsunlinsolspgmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspgmr sundials_fsunlinsolspgmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -133,7 +127,8 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -153,39 +148,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spgmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt b/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt index bb6b44935f..247c68ef57 100644 --- a/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPTFQMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPTFQMR linear solver set(sunlinsol_sptfqmr_examples - "test_sunlinsol_sptfqmr_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_sptfqmr_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_sptfqmr_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_sptfqmr_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_sptfqmr_dependencies - test_sunlinsol - ) +set(sunlinsol_sptfqmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolsptfqmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolsptfqmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -77,7 +72,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -85,15 +81,12 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel) endif() endforeach(example_tuple ${sunlinsol_sptfqmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +99,37 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_sptfqmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt index c985445c51..5d64fd308e 100644 --- a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt @@ -23,24 +23,21 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPTFQMR linear solver set(sunlinsol_sptfqmr_examples - "test_sunlinsol_sptfqmr_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_sptfqmr_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_sptfqmr_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_sptfqmr_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_sptfqmr_dependencies - test_sunlinsol - ) +set(sunlinsol_sptfqmr_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(sunlinsol_sptfqmr_fortran_examples - "test_fsunlinsol_sptfqmr_mod_serial\;\;") + "test_fsunlinsol_sptfqmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -54,8 +51,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -64,10 +61,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolsptfqmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolsptfqmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +73,16 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial) endif() endforeach(example_tuple ${sunlinsol_sptfqmr_examples}) @@ -101,14 +95,17 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,11 +113,9 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolsptfqmr - sundials_fsunlinsolsptfqmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolsptfqmr sundials_fsunlinsolsptfqmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -131,7 +126,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +147,34 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_sptfqmr_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/superludist/CMakeLists.txt b/examples/sunlinsol/superludist/CMakeLists.txt index bba860e2eb..03f7e028cc 100644 --- a/examples/sunlinsol/superludist/CMakeLists.txt +++ b/examples/sunlinsol/superludist/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for the superlu-dist SUNLinearSolver examples # ----------------------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the 'develop' for +# examples excluded from 'make test' in releases # Examples using the SuperLU_MT linear solver set(sunlinsol_superludist_examples - "test_sunlinsol_superludist.cpp\;100 1 1 0\;1\;" - "test_sunlinsol_superludist.cpp\;400 1 2 0\;2\;" - "test_sunlinsol_superludist.cpp\;900 3 1 0\;3\;" - "test_sunlinsol_superludist.cpp\;1000 2 2 0\;4\;" -) + "test_sunlinsol_superludist.cpp\;100 1 1 0\;1\;" + "test_sunlinsol_superludist.cpp\;400 1 2 0\;2\;" + "test_sunlinsol_superludist.cpp\;900 3 1 0\;3\;" + "test_sunlinsol_superludist.cpp\;1000 2 2 0\;4\;") # Dependencies for nvector examples -set(sunlinsol_superludist_dependencies - test_sunlinsol - ) +set(sunlinsol_superludist_dependencies test_sunlinsol) if(SUPERLUDIST_CUDA) set(_ex_lang CUDA) @@ -53,26 +50,22 @@ foreach(example_tuple ${sunlinsol_superludist_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c) + add_executable(${example_target} ${example} ../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_sunlinsolsuperludist - sundials_sunmatrixslunrloc - sundials_sunmatrixdense - sundials_nvecparallel - sundials_nvecserial - MPI::MPI_CXX) + target_link_libraries( + ${example_target} + PRIVATE sundials_sunlinsolsuperludist sundials_sunmatrixslunrloc + sundials_sunmatrixdense sundials_nvecparallel sundials_nvecserial + MPI::MPI_CXX) endif() # check if example args are provided and set the test name @@ -80,18 +73,21 @@ foreach(example_tuple ${sunlinsol_superludist_examples}) if("${number_of_nodes}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}) endif() else() if("${number_of_nodes}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} EXAMPLE_TYPE ${example_type} @@ -101,21 +97,13 @@ endforeach(example_tuple ${sunlinsol_superludist_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_superludist sunlinsol_superludist_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - nvecserial - nvecparallel - sunlinsoldense - sunlinsolsuperludist - DESTINATION - sunlinsol/superludist - ) + sundials_install_examples( + sunlinsol_superludist sunlinsol_superludist_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS nvecserial nvecparallel sunlinsoldense sunlinsolsuperludist + DESTINATION sunlinsol/superludist) endif() diff --git a/examples/sunlinsol/superlumt/CMakeLists.txt b/examples/sunlinsol/superlumt/CMakeLists.txt index c2142f7bf2..794d69fe5f 100644 --- a/examples/sunlinsol/superlumt/CMakeLists.txt +++ b/examples/sunlinsol/superlumt/CMakeLists.txt @@ -14,23 +14,19 @@ # CMakeLists.txt file for sunlinsol SuperLU_MT examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -# Examples using the SuperLU_MT linear solver -# Note: threaded tests are excluded because of a potential bug in -# SuperLU_MT that causes random test failures +# Examples using the SuperLU_MT linear solver Note: threaded tests are excluded +# because of a potential bug in SuperLU_MT that causes random test failures set(sunlinsol_superlumt_examples - "test_sunlinsol_superlumt\;300 0 1 0\;" - "test_sunlinsol_superlumt\;300 1 1 0\;" - "test_sunlinsol_superlumt\;1000 0 3 0\;exclude" - "test_sunlinsol_superlumt\;1000 1 3 0\;exclude" -) + "test_sunlinsol_superlumt\;300 0 1 0\;" + "test_sunlinsol_superlumt\;300 1 1 0\;" + "test_sunlinsol_superlumt\;1000 0 3 0\;exclude" + "test_sunlinsol_superlumt\;1000 1 3 0\;exclude") # Dependencies for nvector examples -set(sunlinsol_superlumt_dependencies - test_sunlinsol -) +set(sunlinsol_superlumt_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ..) @@ -43,8 +39,8 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -53,11 +49,9 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunlinsolsuperlumt + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunmatrixsparse sundials_sunlinsolsuperlumt ${EXE_EXTRA_LINK_LIBS}) endif() @@ -69,21 +63,19 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) endif() endforeach(example_tuple ${sunlinsol_superlumt_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -93,8 +85,8 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolsuperlumt") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixsparse") - # Set the link directory for the dense and sparse sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and sparse sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_superlumt_examples EXAMPLES_SLUMT) @@ -107,39 +99,33 @@ if(EXAMPLES_INSTALL) endif() # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/CMakeLists.txt b/examples/sunmatrix/CMakeLists.txt index ecb74f6faa..97fe929142 100644 --- a/examples/sunmatrix/CMakeLists.txt +++ b/examples/sunmatrix/CMakeLists.txt @@ -28,8 +28,10 @@ add_subdirectory(sparse) # Build the sunmatrix test utilities add_library(test_sunmatrix_obj OBJECT test_sunmatrix.c test_sunmatrix.h) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib - set_property(TARGET test_sunmatrix_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + # need PIC when shared libs are used since the example executables will link + # to the shared lib + set_property(TARGET test_sunmatrix_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() target_link_libraries(test_sunmatrix_obj PRIVATE sundials_sunmatrixdense) diff --git a/examples/sunmatrix/band/CMakeLists.txt b/examples/sunmatrix/band/CMakeLists.txt index 1db5a837a3..fa6848a4c9 100644 --- a/examples/sunmatrix/band/CMakeLists.txt +++ b/examples/sunmatrix/band/CMakeLists.txt @@ -15,26 +15,20 @@ # CMakeLists.txt file for banded sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS banded matrix set(sunmatrix_band_examples - "test_sunmatrix_band\;10 2 3 0\;" - "test_sunmatrix_band\;300 7 4 0\;" - "test_sunmatrix_band\;1000 8 8 0\;" - "test_sunmatrix_band\;5000 3 20 0\;" -) + "test_sunmatrix_band\;10 2 3 0\;" "test_sunmatrix_band\;300 7 4 0\;" + "test_sunmatrix_band\;1000 8 8 0\;" "test_sunmatrix_band\;5000 3 20 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_band_dependencies - test_sunmatrix - ) +set(sunmatrix_band_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_band_fortran_examples - "test_fsunmatrix_band_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_band_fortran_examples "test_fsunmatrix_band_mod\;\;") endif() # Add source directory to include directories @@ -48,8 +42,8 @@ foreach(example_tuple ${sunmatrix_band_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -58,10 +52,8 @@ foreach(example_tuple ${sunmatrix_band_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixband - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunmatrixband + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,17 +64,16 @@ foreach(example_tuple ${sunmatrix_band_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) endif() endforeach(example_tuple ${sunmatrix_band_examples}) @@ -95,14 +86,17 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -110,12 +104,9 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunmatrixband - sundials_fsunmatrixband_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunmatrixband sundials_fsunmatrixband_mod ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -126,7 +117,8 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -145,39 +137,32 @@ if(EXAMPLES_INSTALL) examples2string(sunmatrix_band_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/cusparse/CMakeLists.txt b/examples/sunmatrix/cusparse/CMakeLists.txt index 5f3e2d0707..d3b3782fea 100644 --- a/examples/sunmatrix/cusparse/CMakeLists.txt +++ b/examples/sunmatrix/cusparse/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for SUNMATRIX_CUSPARSE examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases set(examples_list - "test_sunmatrix_cusparse.cu\;random 100 100 1 CSR 0\;" - "test_sunmatrix_cusparse.cu\;random 101 100 1 CSR 0\;" - "test_sunmatrix_cusparse.cu\;random 10 10 50 BCSR 0\;" - "test_sunmatrix_cusparse.cu\;random 100 100 5 BCSR 0\;" - ) + "test_sunmatrix_cusparse.cu\;random 100 100 1 CSR 0\;" + "test_sunmatrix_cusparse.cu\;random 101 100 1 CSR 0\;" + "test_sunmatrix_cusparse.cu\;random 10 10 50 BCSR 0\;" + "test_sunmatrix_cusparse.cu\;random 100 100 5 BCSR 0\;") # Add source directory to include directories include_directories(. ..) @@ -37,24 +36,22 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c ../dreadrb.c) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../dreadrb.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_nvecserial - sundials_nveccuda - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunmatrixcusparse - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_nvecserial sundials_nveccuda sundials_sunmatrixdense + sundials_sunmatrixsparse sundials_sunmatrixcusparse + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -65,7 +62,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -74,27 +72,17 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_cusparse examples_list - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - test_sunmatrix.h - dreadrb.c - dreadrb.h + sundials_install_examples( + sunmatrix_cusparse examples_list + EXAMPLES_DEPENDENCIES test_sunmatrix.c test_sunmatrix.h dreadrb.c dreadrb.h EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/dreadrb.c ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/dreadrb.h - CMAKE_TEMPLATE - cmakelists_CUDA_ex.in - SUNDIALS_TARGETS - nveccuda - nvecserial - sunmatrixdense - sunmatrixsparse - sunmatrixcusparse - DESTINATION - sunmatrix/cusparse - ) + CMAKE_TEMPLATE cmakelists_CUDA_ex.in + SUNDIALS_TARGETS nveccuda nvecserial sunmatrixdense sunmatrixsparse + sunmatrixcusparse + DESTINATION sunmatrix/cusparse) endif() diff --git a/examples/sunmatrix/dense/CMakeLists.txt b/examples/sunmatrix/dense/CMakeLists.txt index e5e5f9a346..577abf7011 100644 --- a/examples/sunmatrix/dense/CMakeLists.txt +++ b/examples/sunmatrix/dense/CMakeLists.txt @@ -15,25 +15,20 @@ # CMakeLists.txt file for dense sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS dense matrix set(sunmatrix_dense_examples - "test_sunmatrix_dense\;100 100 0\;" - "test_sunmatrix_dense\;200 1000 0\;" - "test_sunmatrix_dense\;2000 100 0\;" - ) + "test_sunmatrix_dense\;100 100 0\;" "test_sunmatrix_dense\;200 1000 0\;" + "test_sunmatrix_dense\;2000 100 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_dense_dependencies - test_sunmatrix - ) +set(sunmatrix_dense_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_dense_fortran_examples - "test_fsunmatrix_dense_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_dense_fortran_examples "test_fsunmatrix_dense_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +42,8 @@ foreach(example_tuple ${sunmatrix_dense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -57,10 +52,8 @@ foreach(example_tuple ${sunmatrix_dense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunmatrixdense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,17 +64,16 @@ foreach(example_tuple ${sunmatrix_dense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) endif() endforeach(example_tuple ${sunmatrix_dense_examples}) @@ -94,13 +86,16 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -108,11 +103,9 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunmatrixdense - sundials_fsunmatrixdense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunmatrixdense sundials_fsunmatrixdense_mod ${EXE_EXTRA_LINK_LIBS}) endif() @@ -124,14 +117,14 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${sunmatrix_dense_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -144,39 +137,32 @@ if(EXAMPLES_INSTALL) examples2string(sunmatrix_dense_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/ginkgo/CMakeLists.txt b/examples/sunmatrix/ginkgo/CMakeLists.txt index 0e17ab0821..84c7a14873 100644 --- a/examples/sunmatrix/ginkgo/CMakeLists.txt +++ b/examples/sunmatrix/ginkgo/CMakeLists.txt @@ -12,21 +12,21 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples - "test_sunmatrix_ginkgo.cpp\;100 100 0\;" - "test_sunmatrix_ginkgo.cpp\;100 10 0\;" - "test_sunmatrix_ginkgo.cpp\;10 100 0\;" - "test_sunmatrix_ginkgo.cpp\;100 100 1\;" - "test_sunmatrix_ginkgo.cpp\;100 10 1\;" - "test_sunmatrix_ginkgo.cpp\;10 100 1\;" -) + "test_sunmatrix_ginkgo.cpp\;100 100 0\;" + "test_sunmatrix_ginkgo.cpp\;100 10 0\;" + "test_sunmatrix_ginkgo.cpp\;10 100 0\;" + "test_sunmatrix_ginkgo.cpp\;100 100 1\;" + "test_sunmatrix_ginkgo.cpp\;100 10 1\;" + "test_sunmatrix_ginkgo.cpp\;10 100 1\;") # Add source directory to include directories include_directories(..) -sundials_add_examples_ginkgo(examples +sundials_add_examples_ginkgo( + examples TARGETS test_sunmatrix_obj sundials_sunmatrixdense BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) @@ -50,19 +50,13 @@ if(EXAMPLES_INSTALL) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(sunmatrix - CPU_GPU_EXAMPLES_VAR - examples - SUNDIALS_COMPONENTS - sunmatrixdense - ${vectors} - SUNDIALS_TARGETS - sunmatrixdense - DEPENDENCIES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - DESTINATION - sunmatrix/ginkgo - ) + sundials_install_examples_ginkgo( + sunmatrix + CPU_GPU_EXAMPLES_VAR examples + SUNDIALS_COMPONENTS sunmatrixdense ${vectors} + SUNDIALS_TARGETS sunmatrixdense + DEPENDENCIES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + DESTINATION sunmatrix/ginkgo) endif() diff --git a/examples/sunmatrix/kokkos/CMakeLists.txt b/examples/sunmatrix/kokkos/CMakeLists.txt index 7a0b0ad6b7..3a8a96b61b 100644 --- a/examples/sunmatrix/kokkos/CMakeLists.txt +++ b/examples/sunmatrix/kokkos/CMakeLists.txt @@ -12,16 +12,15 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples_list - "test_sunmatrix_kokkosdense.cpp\;100 100 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;200 1000 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;2000 100 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;10 10 100 0\;" - "test_sunmatrix_kokkosdense.cpp\;200 10 100 0\;" - "test_sunmatrix_kokkosdense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_kokkosdense.cpp\;100 100 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;200 1000 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;2000 100 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;10 10 100 0\;" + "test_sunmatrix_kokkosdense.cpp\;200 10 100 0\;" + "test_sunmatrix_kokkosdense.cpp\;10 200 100 0\;") # Add source directory to include directories include_directories(..) @@ -39,10 +38,10 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c ../test_sunmatrix.h) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../test_sunmatrix.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -51,13 +50,10 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_core - sundials_nveckokkos - sundials_sunmatrixkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_core sundials_nveckokkos sundials_sunmatrixkokkosdense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -68,7 +64,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -78,24 +75,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_kokkosdense examples_list - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - DESTINATION - sunmatrix/kokkos - ) + sundials_install_examples( + sunmatrix_kokkosdense examples_list + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + DESTINATION sunmatrix/kokkos) endif() diff --git a/examples/sunmatrix/magmadense/CMakeLists.txt b/examples/sunmatrix/magmadense/CMakeLists.txt index 5879aabb33..e860458d25 100644 --- a/examples/sunmatrix/magmadense/CMakeLists.txt +++ b/examples/sunmatrix/magmadense/CMakeLists.txt @@ -12,25 +12,26 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS MAGMA dense matrix set(sunmatrix_magmadense_examples - "test_sunmatrix_magmadense.cpp\;100 100 1 0\;" - "test_sunmatrix_magmadense.cpp\;200 1000 1 0\;" - "test_sunmatrix_magmadense.cpp\;2000 100 1 0\;" - "test_sunmatrix_magmadense.cpp\;10 10 100 0\;" - "test_sunmatrix_magmadense.cpp\;200 10 100 0\;" - "test_sunmatrix_magmadense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_magmadense.cpp\;100 100 1 0\;" + "test_sunmatrix_magmadense.cpp\;200 1000 1 0\;" + "test_sunmatrix_magmadense.cpp\;2000 100 1 0\;" + "test_sunmatrix_magmadense.cpp\;10 10 100 0\;" + "test_sunmatrix_magmadense.cpp\;200 10 100 0\;" + "test_sunmatrix_magmadense.cpp\;10 200 100 0\;") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CUDA) + set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE + CUDA) set(vector nveccuda) set(cuda_or_hip CUDA) elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") - set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CXX) + set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE + CXX) set(vector nvechip) set(cuda_or_hip HIP) endif() @@ -49,21 +50,18 @@ foreach(example_tuple ${sunmatrix_magmadense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} ../test_sunmatrix.c ../test_sunmatrix.h) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../test_sunmatrix.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_${vector} - sundials_sunmatrixmagmadense - SUNDIALS::MAGMA - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_${vector} sundials_sunmatrixmagmadense + SUNDIALS::MAGMA ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -74,7 +72,8 @@ foreach(example_tuple ${sunmatrix_magmadense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -83,19 +82,13 @@ endforeach(example_tuple ${sunmatrix_magmadense_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_magma sunmatrix_magmadense_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - ${vector} - sunmatrixmagmadense - DESTINATION - sunmatrix/magmadense - ) + sundials_install_examples( + sunmatrix_magma sunmatrix_magmadense_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS ${vector} sunmatrixmagmadense + DESTINATION sunmatrix/magmadense) endif() diff --git a/examples/sunmatrix/onemkldense/CMakeLists.txt b/examples/sunmatrix/onemkldense/CMakeLists.txt index f893de6ec7..80f51a86ea 100644 --- a/examples/sunmatrix/onemkldense/CMakeLists.txt +++ b/examples/sunmatrix/onemkldense/CMakeLists.txt @@ -12,18 +12,17 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS ONEMKL dense matrix set(sunmatrix_onemkldense_examples - "test_sunmatrix_onemkldense.cpp\;100 100 1 0\;" - "test_sunmatrix_onemkldense.cpp\;200 1000 1 0\;" - "test_sunmatrix_onemkldense.cpp\;2000 100 1 0\;" - "test_sunmatrix_onemkldense.cpp\;10 10 100 0\;" - "test_sunmatrix_onemkldense.cpp\;200 10 100 0\;" - "test_sunmatrix_onemkldense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_onemkldense.cpp\;100 100 1 0\;" + "test_sunmatrix_onemkldense.cpp\;200 1000 1 0\;" + "test_sunmatrix_onemkldense.cpp\;2000 100 1 0\;" + "test_sunmatrix_onemkldense.cpp\;10 10 100 0\;" + "test_sunmatrix_onemkldense.cpp\;200 10 100 0\;" + "test_sunmatrix_onemkldense.cpp\;10 200 100 0\;") # Add source directory to include directories include_directories(. ..) @@ -39,7 +38,7 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -48,14 +47,11 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_sunmatrix_obj - sundials_nvecsycl - sundials_sunmatrixonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE test_sunmatrix_obj sundials_nvecsycl + sundials_sunmatrixonemkldense MKL::MKL_DPCPP + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -67,31 +63,24 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_onemkl sunmatrix_onemkldense_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - sunmatrixonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - sunmatrix/onemkldense - ) + sundials_install_examples( + sunmatrix_onemkl sunmatrix_onemkldense_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl sunmatrixonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION sunmatrix/onemkldense) endif() diff --git a/examples/sunmatrix/slunrloc/CMakeLists.txt b/examples/sunmatrix/slunrloc/CMakeLists.txt index 94f96cf354..5e71ed0580 100644 --- a/examples/sunmatrix/slunrloc/CMakeLists.txt +++ b/examples/sunmatrix/slunrloc/CMakeLists.txt @@ -14,22 +14,19 @@ # CMakeLists.txt file for slunrloc_sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SUNMatrix wrapper of the SuperLU SLU_NR_loc # SuperMatrix. set(sunmatrix_slunrloc_examples - "test_sunmatrix_slunrloc.cpp\;100 1 1 0 0\;1\;\;" - "test_sunmatrix_slunrloc.cpp\;400 2 1 0 0\;2\;\;" - "test_sunmatrix_slunrloc.cpp\;600 3 1 0 0\;3\;\;" - "test_sunmatrix_slunrloc.cpp\;1000 1 4 0 0\;4\;\;" -) + "test_sunmatrix_slunrloc.cpp\;100 1 1 0 0\;1\;\;" + "test_sunmatrix_slunrloc.cpp\;400 2 1 0 0\;2\;\;" + "test_sunmatrix_slunrloc.cpp\;600 3 1 0 0\;3\;\;" + "test_sunmatrix_slunrloc.cpp\;1000 1 4 0 0\;4\;\;") # Dependencies for sunmatrix examples -set(sunmatrix_slunrloc_dependencies - test_sunmatrix - ) +set(sunmatrix_slunrloc_dependencies test_sunmatrix) # Add the build and install targets for each example foreach(example_tuple ${sunmatrix_slunrloc_examples}) @@ -42,12 +39,11 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c) + add_executable(${example_target} ${example} ../test_sunmatrix.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -55,13 +51,10 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) target_include_directories(${example_target} PRIVATE . ..) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - MPI::MPI_CXX - sundials_sunmatrixslunrloc - sundials_sunmatrixdense - sundials_nvecparallel - sundials_nvecserial) + target_link_libraries( + ${example_target} + PRIVATE MPI::MPI_CXX sundials_sunmatrixslunrloc sundials_sunmatrixdense + sundials_nvecparallel sundials_nvecserial) endif() # check if example args are provided and set the test name @@ -69,18 +62,21 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) if("${number_of_nodes}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}) endif() else() if("${number_of_nodes}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} EXAMPLE_TYPE ${example_type} @@ -98,21 +94,13 @@ endif() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_slunrloc sunmatrix_slunrloc_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - nvecserial - nvecparallel - sunmatrixdense - sunmatrixslunrloc - DESTINATION - sunmatrix/slunrloc - ) + sundials_install_examples( + sunmatrix_slunrloc sunmatrix_slunrloc_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS nvecserial nvecparallel sunmatrixdense sunmatrixslunrloc + DESTINATION sunmatrix/slunrloc) endif() diff --git a/examples/sunmatrix/sparse/CMakeLists.txt b/examples/sunmatrix/sparse/CMakeLists.txt index ee04a96b8d..9e2ad0d9db 100644 --- a/examples/sunmatrix/sparse/CMakeLists.txt +++ b/examples/sunmatrix/sparse/CMakeLists.txt @@ -15,28 +15,24 @@ # CMakeLists.txt file for sparse sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS sparse matrix set(sunmatrix_sparse_examples - "test_sunmatrix_sparse\;400 400 0 0\;" - "test_sunmatrix_sparse\;450 450 1 0\;" - "test_sunmatrix_sparse\;200 1000 0 0\;" - "test_sunmatrix_sparse\;6000 350 0 0\;" - "test_sunmatrix_sparse\;500 5000 1 0\;" - "test_sunmatrix_sparse\;4000 800 1 0\;" -) + "test_sunmatrix_sparse\;400 400 0 0\;" + "test_sunmatrix_sparse\;450 450 1 0\;" + "test_sunmatrix_sparse\;200 1000 0 0\;" + "test_sunmatrix_sparse\;6000 350 0 0\;" + "test_sunmatrix_sparse\;500 5000 1 0\;" + "test_sunmatrix_sparse\;4000 800 1 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_sparse_dependencies - test_sunmatrix - ) +set(sunmatrix_sparse_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_sparse_fortran_examples - "test_fsunmatrix_sparse_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_sparse_fortran_examples "test_fsunmatrix_sparse_mod\;\;") endif() # Add source directory to include directories @@ -50,8 +46,8 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -60,12 +56,9 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixband - sundials_sunmatrixsparse - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunmatrixband sundials_sunmatrixsparse ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -76,17 +69,16 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) endif() endforeach(example_tuple ${sunmatrix_sparse_examples}) @@ -99,13 +91,16 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -113,7 +108,8 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod sundials_sunmatrixdense @@ -133,7 +129,8 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -149,47 +146,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunmatrixsparse") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixband") - # Set the link directory for the dense and band sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and band sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunmatrix_sparse_examples EXAMPLES) examples2string(sunmatrix_sparse_dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/CMakeLists.txt b/examples/sunnonlinsol/CMakeLists.txt index 1ddeaa93d9..e6e1866860 100644 --- a/examples/sunnonlinsol/CMakeLists.txt +++ b/examples/sunnonlinsol/CMakeLists.txt @@ -24,5 +24,5 @@ add_subdirectory(newton) add_subdirectory(fixedpoint) if(BUILD_SUNNONLINSOL_PETSCSNES) - add_subdirectory(petsc) -endif() \ No newline at end of file + add_subdirectory(petsc) +endif() diff --git a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 834af69c2e..240259040a 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -14,21 +14,17 @@ # CMakeLists.txt file for sunnonlinsol fixedpoint examples # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs set(examples - "test_sunnonlinsol_fixedpoint\;\;" - "test_sunnonlinsol_fixedpoint\;2\;" - "test_sunnonlinsol_fixedpoint\;2 0.5\;" -) + "test_sunnonlinsol_fixedpoint\;\;" "test_sunnonlinsol_fixedpoint\;2\;" + "test_sunnonlinsol_fixedpoint\;2 0.5\;") # if building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(fortran_examples - "test_fsunnonlinsol_fixedpoint_mod\;\;" - ) +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(fortran_examples "test_fsunnonlinsol_fixedpoint_mod\;\;") endif() # Add source directory to include directories @@ -53,8 +49,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -74,14 +70,15 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) endif() endforeach(example_tuple ${examples}) @@ -94,15 +91,17 @@ foreach(example_tuple ${fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 - ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) + add_executable( + ${example} ${example}.f90 + ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -119,14 +118,14 @@ foreach(example_tuple ${fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -136,46 +135,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolfixedpoint") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunlinsoldense") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 2f3413bd0b..d440789afb 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for sunnonlinsol Newton examples # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs -set(examples - "test_sunnonlinsol_newton\;\;" -) - -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(fortran_examples - "test_fsunnonlinsol_newton_mod\;\;" - ) +set(examples "test_sunnonlinsol_newton\;\;") + +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(fortran_examples "test_fsunnonlinsol_newton_mod\;\;") endif() # Add source directory to include directories @@ -54,8 +50,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -75,14 +71,15 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) endif() endforeach(example_tuple ${examples}) @@ -95,15 +92,17 @@ foreach(example_tuple ${fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 - ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) + add_executable( + ${example} ${example}.f90 + ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -120,14 +119,14 @@ foreach(example_tuple ${fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -137,46 +136,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolnewton") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunlinsoldense") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(examples EXAMPLES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/petsc/CMakeLists.txt b/examples/sunnonlinsol/petsc/CMakeLists.txt index 59a5dbd2c0..7146134ea8 100644 --- a/examples/sunnonlinsol/petsc/CMakeLists.txt +++ b/examples/sunnonlinsol/petsc/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for sunnonlinsol PetscSNES tests # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs -set(examples - "test_sunnonlinsol_petscsnes\;\;" -) +set(examples "test_sunnonlinsol_petscsnes\;\;") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -45,8 +43,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -66,19 +64,19 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) endif() endforeach(example_tuple ${examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -88,47 +86,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolpetscsnes") set(LIBS "${LIBS}") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(examples EXAMPLES) examples2string(dependencies EXAMPLES_DEPENDENCIES) # Regardless of the platform we're on, we will generate and install - # CMakeLists.txt file for building the examples. This file can then - # be used as a template for the user's own programs. + # CMakeLists.txt file for building the examples. This file can then be used + # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) # On UNIX-type platforms, we also generate and install a makefile for - # building the examples. This makefile can then be used as a template - # for the user's own programs. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/scripts/format.sh b/scripts/format.sh index 38011b85c0..1c3c553e25 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -10,8 +10,8 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------------------------- -# This script will use clang-tidy and clang-format to format C/C++ code and -# fprettify for Fortran code. +# This script will use clang-format to format C/C++ code, fprettify for Fortran +# code, cmake-format for CMake files, and black for Python code. # # Usage: # ./format.sh <paths to directories or files to format> @@ -27,9 +27,12 @@ fi paths=( "$@" ) find "${paths[@]}" -iname '*.h' -o -iname '*.hpp' -o \ - -iname '*.c' -o -iname '*.cpp' -o \ - -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i + -iname '*.c' -o -iname '*.cpp' -o \ + -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i find "${paths[@]}" -iname '*.f90' | grep -v fmod | xargs fprettify --indent 2 --enable-replacements --c-relations +find "${paths[@]}" \( -iname '*.cmake' -o -iname 'CMakeLists.txt' \) \ + -exec cmake-format -i {} ';' + find "${paths[@]}" -iname '*.py' -exec black {} ';' diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index 267bc89a33..f8a0f4be63 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -18,62 +18,57 @@ install(CODE "MESSAGE(\"\nInstall ARKODE\n\")") # Add variable arkode_SOURCES with the sources for the ARKODE library set(arkode_SOURCES - arkode_adapt.c - arkode_arkstep_io.c - arkode_arkstep_nls.c - arkode_arkstep.c - arkode_bandpre.c - arkode_bbdpre.c - arkode_butcher_dirk.c - arkode_butcher_erk.c - arkode_butcher.c - arkode_erkstep_io.c - arkode_erkstep.c - arkode_interp.c - arkode_io.c - arkode_ls.c - arkode_mri_tables.c - arkode_mristep_io.c - arkode_mristep_nls.c - arkode_mristep.c - arkode_relaxation.c - arkode_root.c - arkode_sprkstep_io.c - arkode_sprkstep.c - arkode_sprk.c - arkode_user_controller.c - arkode.c -) + arkode_adapt.c + arkode_arkstep_io.c + arkode_arkstep_nls.c + arkode_arkstep.c + arkode_bandpre.c + arkode_bbdpre.c + arkode_butcher_dirk.c + arkode_butcher_erk.c + arkode_butcher.c + arkode_erkstep_io.c + arkode_erkstep.c + arkode_interp.c + arkode_io.c + arkode_ls.c + arkode_mri_tables.c + arkode_mristep_io.c + arkode_mristep_nls.c + arkode_mristep.c + arkode_relaxation.c + arkode_root.c + arkode_sprkstep_io.c + arkode_sprkstep.c + arkode_sprk.c + arkode_user_controller.c + arkode.c) # Add variable arkode_HEADERS with the exported ARKODE header files set(arkode_HEADERS - arkode.h - arkode_arkstep.h - arkode_bandpre.h - arkode_bbdpre.h - arkode_butcher.h - arkode_butcher_dirk.h - arkode_butcher_erk.h - arkode_erkstep.h - arkode_ls.h - arkode_mristep.h - arkode_sprk.h - arkode_sprkstep.h -) + arkode.h + arkode_arkstep.h + arkode_bandpre.h + arkode_bbdpre.h + arkode_butcher.h + arkode_butcher_dirk.h + arkode_butcher_erk.h + arkode_erkstep.h + arkode_ls.h + arkode_mristep.h + arkode_sprk.h + arkode_sprkstep.h) # Add prefix with complete path to the ARKODE header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/arkode/ arkode_HEADERS) # Create the sundials_arkode library -sundials_add_library(sundials_arkode - SOURCES - ${arkode_SOURCES} - HEADERS - ${arkode_HEADERS} - INCLUDE_SUBDIR - arkode - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_arkode + SOURCES ${arkode_SOURCES} + HEADERS ${arkode_HEADERS} + INCLUDE_SUBDIR arkode + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -91,13 +86,9 @@ sundials_add_library(sundials_arkode sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_arkode - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_arkode + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) # Finished ARKODE message(STATUS "Added ARKODE module") diff --git a/src/arkode/fmod_int32/CMakeLists.txt b/src/arkode/fmod_int32/CMakeLists.txt index 32e5c935d7..4ae3e19a54 100644 --- a/src/arkode/fmod_int32/CMakeLists.txt +++ b/src/arkode/fmod_int32/CMakeLists.txt @@ -27,11 +27,10 @@ set(arkode_SOURCES farkode_mristep_mod.c) # Create the library -sundials_add_f2003_library(sundials_farkode_mod - SOURCES - ${arkode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_farkode_mod + SOURCES ${arkode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunadaptcontrollersoderlind_mod_obj @@ -48,12 +47,8 @@ sundials_add_f2003_library(sundials_farkode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_farkode_mod - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_farkode_mod + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) message(STATUS "Added ARKODE F2003 interface") diff --git a/src/arkode/fmod_int64/CMakeLists.txt b/src/arkode/fmod_int64/CMakeLists.txt index 32e5c935d7..4ae3e19a54 100644 --- a/src/arkode/fmod_int64/CMakeLists.txt +++ b/src/arkode/fmod_int64/CMakeLists.txt @@ -27,11 +27,10 @@ set(arkode_SOURCES farkode_mristep_mod.c) # Create the library -sundials_add_f2003_library(sundials_farkode_mod - SOURCES - ${arkode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_farkode_mod + SOURCES ${arkode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunadaptcontrollersoderlind_mod_obj @@ -48,12 +47,8 @@ sundials_add_f2003_library(sundials_farkode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_farkode_mod - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_farkode_mod + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) message(STATUS "Added ARKODE F2003 interface") diff --git a/src/arkode/xbraid/CMakeLists.txt b/src/arkode/xbraid/CMakeLists.txt index 8d700848c1..e9e469ae82 100644 --- a/src/arkode/xbraid/CMakeLists.txt +++ b/src/arkode/xbraid/CMakeLists.txt @@ -18,25 +18,16 @@ install(CODE "MESSAGE(\"\nInstall ARKODE XBraid interface\n\")") # Create the sundials_arkode_xbraid library -sundials_add_library(sundials_arkode_xbraid - SOURCES - arkode_xbraid.c - ${SUNDIALS_SOURCE_DIR}/src/sundials/sundials_xbraid.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/arkode/arkode_xbraid.h - INCLUDE_SUBDIR - arkode - LINK_LIBRARIES - PUBLIC sundials_arkode SUNDIALS::XBRAID MPI::MPI_C - INCLUDE_DIRECTORIES - PRIVATE ../ - OUTPUT_NAME - sundials_arkode_xbraid - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) +sundials_add_library( + sundials_arkode_xbraid + SOURCES arkode_xbraid.c ${SUNDIALS_SOURCE_DIR}/src/sundials/sundials_xbraid.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/arkode/arkode_xbraid.h + INCLUDE_SUBDIR arkode + LINK_LIBRARIES PUBLIC sundials_arkode SUNDIALS::XBRAID MPI::MPI_C + INCLUDE_DIRECTORIES PRIVATE ../ + OUTPUT_NAME sundials_arkode_xbraid + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) # Finished message(STATUS "Added ARKODE Xbraid interface") diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index 7a3e01613a..7301a5bb11 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -19,25 +19,18 @@ install(CODE "MESSAGE(\"\nInstall CVODE\n\")") # Add variable cvode_SOURCES with the sources for the CVODE library set(cvode_SOURCES - cvode.c - cvode_bandpre.c - cvode_bbdpre.c - cvode_diag.c - cvode_io.c - cvode_ls.c - cvode_nls.c - cvode_proj.c - ) + cvode.c + cvode_bandpre.c + cvode_bbdpre.c + cvode_diag.c + cvode_io.c + cvode_ls.c + cvode_nls.c + cvode_proj.c) # Add variable cvode_HEADERS with the exported CVODE header files -set(cvode_HEADERS - cvode.h - cvode_bandpre.h - cvode_bbdpre.h - cvode_diag.h - cvode_ls.h - cvode_proj.h - ) +set(cvode_HEADERS cvode.h cvode_bandpre.h cvode_bbdpre.h cvode_diag.h + cvode_ls.h cvode_proj.h) # Add prefix with complete path to the CVODE header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/cvode/ cvode_HEADERS) @@ -47,70 +40,47 @@ if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) if(BUILD_NVECTOR_CUDA) - set_source_files_properties(cvode_fused_gpu.cpp PROPERTIES - LANGUAGE CUDA) + set_source_files_properties(cvode_fused_gpu.cpp PROPERTIES LANGUAGE CUDA) - sundials_add_library(sundials_cvode_fused_cuda - SOURCES - cvode_fused_gpu.cpp - COMPILE_DEFINITIONS - PRIVATE USE_CUDA - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE sundials_nveccuda - OUTPUT_NAME - sundials_cvode_fused_cuda - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_cuda + SOURCES cvode_fused_gpu.cpp + COMPILE_DEFINITIONS PRIVATE USE_CUDA + LINK_LIBRARIES PUBLIC sundials_core PRIVATE sundials_nveccuda + OUTPUT_NAME sundials_cvode_fused_cuda + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) endif() if(BUILD_NVECTOR_HIP) - sundials_add_library(sundials_cvode_fused_hip - SOURCES - cvode_fused_gpu.cpp - COMPILE_DEFINITIONS - PRIVATE USE_HIP - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE sundials_nvechip - OUTPUT_NAME - sundials_cvode_fused_hip - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_hip + SOURCES cvode_fused_gpu.cpp + COMPILE_DEFINITIONS PRIVATE USE_HIP + LINK_LIBRARIES PUBLIC sundials_core PRIVATE sundials_nvechip + OUTPUT_NAME sundials_cvode_fused_hip + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) endif() - sundials_add_library(sundials_cvode_fused_stubs - SOURCES - cvode_fused_stubs.c - LINK_LIBRARIES - PUBLIC sundials_core - OUTPUT_NAME - sundials_cvode_fused_stubs - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_stubs + SOURCES cvode_fused_stubs.c + LINK_LIBRARIES PUBLIC sundials_core + OUTPUT_NAME sundials_cvode_fused_stubs + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) set(_fused_link_lib sundials_cvode_fused_stubs) endif() # Create the library -sundials_add_library(sundials_cvode - SOURCES - ${cvode_SOURCES} - HEADERS - ${cvode_HEADERS} - INCLUDE_SUBDIR - cvode - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_cvode + SOURCES ${cvode_SOURCES} + HEADERS ${cvode_HEADERS} + INCLUDE_SUBDIR cvode + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -126,16 +96,11 @@ sundials_add_library(sundials_cvode sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - LINK_LIBRARIES - # Link to stubs so examples work. - PRIVATE ${_fused_link_lib} - OUTPUT_NAME - sundials_cvode - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + LINK_LIBRARIES # Link to stubs so examples work. + PRIVATE ${_fused_link_lib} + OUTPUT_NAME sundials_cvode + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) # Finished CVODE message(STATUS "Added CVODE module") diff --git a/src/cvode/fmod_int32/CMakeLists.txt b/src/cvode/fmod_int32/CMakeLists.txt index e27c43ae02..38581e558f 100644 --- a/src/cvode/fmod_int32/CMakeLists.txt +++ b/src/cvode/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(cvode_SOURCES fcvode_mod.f90 fcvode_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvode_mod - SOURCES - ${cvode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvode_mod + SOURCES ${cvode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fcvode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvode_mod - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + OUTPUT_NAME sundials_fcvode_mod + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) message(STATUS "Added CVODE F2003 interface") diff --git a/src/cvode/fmod_int64/CMakeLists.txt b/src/cvode/fmod_int64/CMakeLists.txt index e27c43ae02..38581e558f 100644 --- a/src/cvode/fmod_int64/CMakeLists.txt +++ b/src/cvode/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(cvode_SOURCES fcvode_mod.f90 fcvode_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvode_mod - SOURCES - ${cvode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvode_mod + SOURCES ${cvode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fcvode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvode_mod - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + OUTPUT_NAME sundials_fcvode_mod + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) message(STATUS "Added CVODE F2003 interface") diff --git a/src/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 1879c49614..388ed2f57d 100644 --- a/src/cvodes/CMakeLists.txt +++ b/src/cvodes/CMakeLists.txt @@ -19,44 +19,34 @@ install(CODE "MESSAGE(\"\nInstall CVODES\n\")") # Add variable cvodes_SOURCES with the sources for the CVODES library set(cvodes_SOURCES - cvodea.c - cvodea_io.c - cvodes.c - cvodes_bandpre.c - cvodes_bbdpre.c - cvodes_diag.c - cvodes_io.c - cvodes_ls.c - cvodes_nls.c - cvodes_nls_sim.c - cvodes_nls_stg.c - cvodes_nls_stg1.c - cvodes_proj.c - ) + cvodea.c + cvodea_io.c + cvodes.c + cvodes_bandpre.c + cvodes_bbdpre.c + cvodes_diag.c + cvodes_io.c + cvodes_ls.c + cvodes_nls.c + cvodes_nls_sim.c + cvodes_nls_stg.c + cvodes_nls_stg1.c + cvodes_proj.c) # Add variable cvodes_HEADERS with the exported CVODES header files -set(cvodes_HEADERS - cvodes.h - cvodes_bandpre.h - cvodes_bbdpre.h - cvodes_diag.h - cvodes_ls.h - cvodes_proj.h - ) +set(cvodes_HEADERS cvodes.h cvodes_bandpre.h cvodes_bbdpre.h cvodes_diag.h + cvodes_ls.h cvodes_proj.h) # Add prefix with complete path to the CVODES header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/cvodes/ cvodes_HEADERS) # Create the library -sundials_add_library(sundials_cvodes - SOURCES - ${cvodes_SOURCES} - HEADERS - ${cvodes_HEADERS} - INCLUDE_SUBDIR - cvodes - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_cvodes + SOURCES ${cvodes_SOURCES} + HEADERS ${cvodes_HEADERS} + INCLUDE_SUBDIR cvodes + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -72,13 +62,9 @@ sundials_add_library(sundials_cvodes sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_cvodes - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_cvodes + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) # Finished CVODES message(STATUS "Added CVODES module") diff --git a/src/cvodes/fmod_int32/CMakeLists.txt b/src/cvodes/fmod_int32/CMakeLists.txt index 031ac9c6f9..100a28feed 100644 --- a/src/cvodes/fmod_int32/CMakeLists.txt +++ b/src/cvodes/fmod_int32/CMakeLists.txt @@ -16,11 +16,10 @@ set(cvodes_SOURCES fcvodes_mod.f90 fcvodes_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvodes_mod - SOURCES - ${cvodes_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvodes_mod + SOURCES ${cvodes_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,12 +34,8 @@ sundials_add_f2003_library(sundials_fcvodes_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvodes_mod - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_fcvodes_mod + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) message(STATUS "Added CVODES F2003 interface") diff --git a/src/cvodes/fmod_int64/CMakeLists.txt b/src/cvodes/fmod_int64/CMakeLists.txt index 031ac9c6f9..100a28feed 100644 --- a/src/cvodes/fmod_int64/CMakeLists.txt +++ b/src/cvodes/fmod_int64/CMakeLists.txt @@ -16,11 +16,10 @@ set(cvodes_SOURCES fcvodes_mod.f90 fcvodes_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvodes_mod - SOURCES - ${cvodes_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvodes_mod + SOURCES ${cvodes_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,12 +34,8 @@ sundials_add_f2003_library(sundials_fcvodes_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvodes_mod - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_fcvodes_mod + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) message(STATUS "Added CVODES F2003 interface") diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 8a7e5ae25e..d8985eef26 100644 --- a/src/ida/CMakeLists.txt +++ b/src/ida/CMakeLists.txt @@ -18,35 +18,21 @@ install(CODE "MESSAGE(\"\nInstall IDA\n\")") # Add variable ida_SOURCES with the sources for the IDA library -set(ida_SOURCES - ida.c - ida_bbdpre.c - ida_ic.c - ida_io.c - ida_ls.c - ida_nls.c - ) +set(ida_SOURCES ida.c ida_bbdpre.c ida_ic.c ida_io.c ida_ls.c ida_nls.c) # Add variable ida_HEADERS with the exported IDA header files -set(ida_HEADERS - ida.h - ida_bbdpre.h - ida_ls.h - ) +set(ida_HEADERS ida.h ida_bbdpre.h ida_ls.h) # Add prefix with complete path to the IDA header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/ida/ ida_HEADERS) # Create the library -sundials_add_library(sundials_ida - SOURCES - ${ida_SOURCES} - HEADERS - ${ida_HEADERS} - INCLUDE_SUBDIR - ida - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_ida + SOURCES ${ida_SOURCES} + HEADERS ${ida_HEADERS} + INCLUDE_SUBDIR ida + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -62,13 +48,9 @@ sundials_add_library(sundials_ida sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_ida - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_ida + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) # Finished IDA message(STATUS "Added IDA module") diff --git a/src/ida/fmod_int32/CMakeLists.txt b/src/ida/fmod_int32/CMakeLists.txt index e305f237d0..928acaa4a5 100644 --- a/src/ida/fmod_int32/CMakeLists.txt +++ b/src/ida/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(ida_SOURCES fida_mod.f90 fida_mod.c) # Create the library -sundials_add_f2003_library(sundials_fida_mod - SOURCES - ${ida_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fida_mod + SOURCES ${ida_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fida_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fida_mod - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_fida_mod + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) message(STATUS "Added IDA F2003 interface") diff --git a/src/ida/fmod_int64/CMakeLists.txt b/src/ida/fmod_int64/CMakeLists.txt index e305f237d0..928acaa4a5 100644 --- a/src/ida/fmod_int64/CMakeLists.txt +++ b/src/ida/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(ida_SOURCES fida_mod.f90 fida_mod.c) # Create the library -sundials_add_f2003_library(sundials_fida_mod - SOURCES - ${ida_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fida_mod + SOURCES ${ida_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fida_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fida_mod - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_fida_mod + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) message(STATUS "Added IDA F2003 interface") diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index a5ed8b4739..21ebab4869 100644 --- a/src/idas/CMakeLists.txt +++ b/src/idas/CMakeLists.txt @@ -19,38 +19,30 @@ install(CODE "MESSAGE(\"\nInstall IDAS\n\")") # Add variable idas_SOURCES with the sources for the IDAS library set(idas_SOURCES - idas.c - idaa.c - idas_io.c - idas_ic.c - idaa_io.c - idas_ls.c - idas_bbdpre.c - idas_nls.c - idas_nls_sim.c - idas_nls_stg.c - ) + idas.c + idaa.c + idas_io.c + idas_ic.c + idaa_io.c + idas_ls.c + idas_bbdpre.c + idas_nls.c + idas_nls_sim.c + idas_nls_stg.c) # Add variable idas_HEADERS with the exported IDAS header files -set(idas_HEADERS - idas.h - idas_bbdpre.h - idas_ls.h - ) +set(idas_HEADERS idas.h idas_bbdpre.h idas_ls.h) # Add prefix with complete path to the IDAS header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/idas/ idas_HEADERS) # Create the library -sundials_add_library(sundials_idas - SOURCES - ${idas_SOURCES} - HEADERS - ${idas_HEADERS} - INCLUDE_SUBDIR - idas - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_idas + SOURCES ${idas_SOURCES} + HEADERS ${idas_HEADERS} + INCLUDE_SUBDIR idas + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -66,13 +58,9 @@ sundials_add_library(sundials_idas sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_idas - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_idas + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) # Finished IDAS message(STATUS "Added IDAS module") diff --git a/src/idas/fmod_int32/CMakeLists.txt b/src/idas/fmod_int32/CMakeLists.txt index a6abe6516b..5db3a92327 100644 --- a/src/idas/fmod_int32/CMakeLists.txt +++ b/src/idas/fmod_int32/CMakeLists.txt @@ -16,11 +16,10 @@ set(idas_SOURCES fidas_mod.f90 fidas_mod.c) # Create the library -sundials_add_f2003_library(sundials_fidas_mod - SOURCES - ${idas_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fidas_mod + SOURCES ${idas_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,11 +34,7 @@ sundials_add_f2003_library(sundials_fidas_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fidas_mod - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_fidas_mod + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) message(STATUS "Added IDAS F2003 interface") diff --git a/src/idas/fmod_int64/CMakeLists.txt b/src/idas/fmod_int64/CMakeLists.txt index a6abe6516b..5db3a92327 100644 --- a/src/idas/fmod_int64/CMakeLists.txt +++ b/src/idas/fmod_int64/CMakeLists.txt @@ -16,11 +16,10 @@ set(idas_SOURCES fidas_mod.f90 fidas_mod.c) # Create the library -sundials_add_f2003_library(sundials_fidas_mod - SOURCES - ${idas_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fidas_mod + SOURCES ${idas_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,11 +34,7 @@ sundials_add_f2003_library(sundials_fidas_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fidas_mod - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_fidas_mod + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) message(STATUS "Added IDAS F2003 interface") diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index 7306c3f449..cc03b1511d 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -18,33 +18,21 @@ install(CODE "MESSAGE(\"\nInstall KINSOL\n\")") # Add variable kinsol_SOURCES with the sources for the KINSOL library -set(kinsol_SOURCES - kinsol.c - kinsol_bbdpre.c - kinsol_io.c - kinsol_ls.c - ) +set(kinsol_SOURCES kinsol.c kinsol_bbdpre.c kinsol_io.c kinsol_ls.c) # Add variable kinsol_HEADERS with the exported KINSOL header files -set(kinsol_HEADERS - kinsol.h - kinsol_bbdpre.h - kinsol_ls.h - ) +set(kinsol_HEADERS kinsol.h kinsol_bbdpre.h kinsol_ls.h) # Add prefix with complete path to the KINSOL header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/kinsol/ kinsol_HEADERS) # Create the library -sundials_add_library(sundials_kinsol - SOURCES - ${kinsol_SOURCES} - HEADERS - ${kinsol_HEADERS} - INCLUDE_SUBDIR - kinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_kinsol + SOURCES ${kinsol_SOURCES} + HEADERS ${kinsol_HEADERS} + INCLUDE_SUBDIR kinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -58,13 +46,9 @@ sundials_add_library(sundials_kinsol sundials_sunlinsolspgmr_obj sundials_sunlinsolsptfqmr_obj sundials_sunlinsolpcg_obj - OUTPUT_NAME - sundials_kinsol - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_kinsol + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) # Finished KINSOL message(STATUS "Added KINSOL module") diff --git a/src/kinsol/fmod_int32/CMakeLists.txt b/src/kinsol/fmod_int32/CMakeLists.txt index a154a8b865..8f127375de 100644 --- a/src/kinsol/fmod_int32/CMakeLists.txt +++ b/src/kinsol/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(kinsol_SOURCES fkinsol_mod.f90 fkinsol_mod.c) # Create the library -sundials_add_f2003_library(sundials_fkinsol_mod - SOURCES - ${kinsol_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fkinsol_mod + SOURCES ${kinsol_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -34,12 +33,8 @@ sundials_add_f2003_library(sundials_fkinsol_mod sundials_fsunlinsolspgmr_mod_obj sundials_fsunlinsolsptfqmr_mod_obj sundials_fsunlinsolpcg_mod_obj - OUTPUT_NAME - sundials_fkinsol_mod - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fkinsol_mod + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) message(STATUS "Added KINSOL F2003 interface") diff --git a/src/kinsol/fmod_int64/CMakeLists.txt b/src/kinsol/fmod_int64/CMakeLists.txt index a154a8b865..8f127375de 100644 --- a/src/kinsol/fmod_int64/CMakeLists.txt +++ b/src/kinsol/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(kinsol_SOURCES fkinsol_mod.f90 fkinsol_mod.c) # Create the library -sundials_add_f2003_library(sundials_fkinsol_mod - SOURCES - ${kinsol_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fkinsol_mod + SOURCES ${kinsol_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -34,12 +33,8 @@ sundials_add_f2003_library(sundials_fkinsol_mod sundials_fsunlinsolspgmr_mod_obj sundials_fsunlinsolsptfqmr_mod_obj sundials_fsunlinsolpcg_mod_obj - OUTPUT_NAME - sundials_fkinsol_mod - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fkinsol_mod + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) message(STATUS "Added KINSOL F2003 interface") diff --git a/src/nvector/CMakeLists.txt b/src/nvector/CMakeLists.txt index 182a2bc3c8..5c9c1307ef 100644 --- a/src/nvector/CMakeLists.txt +++ b/src/nvector/CMakeLists.txt @@ -75,18 +75,20 @@ if(BUILD_NVECTOR_KOKKOS) add_library(sundials_nveckokkos INTERFACE) target_link_libraries(sundials_nveckokkos INTERFACE sundials_core) if(ENABLE_HIP) - target_link_libraries(sundials_nveckokkos INTERFACE - Kokkos::kokkos hip::device) + target_link_libraries(sundials_nveckokkos INTERFACE Kokkos::kokkos + hip::device) else() - target_link_libraries(sundials_nveckokkos INTERFACE - Kokkos::kokkos) + target_link_libraries(sundials_nveckokkos INTERFACE Kokkos::kokkos) endif() - target_include_directories(sundials_nveckokkos INTERFACE - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + target_include_directories( + sundials_nveckokkos + INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) install(FILES ${PROJECT_SOURCE_DIR}/include/nvector/nvector_kokkos.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector") - set(_SUNDIALS_INSTALLED_COMPONENTS "nveckokkos;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector") + set(_SUNDIALS_INSTALLED_COMPONENTS + "nveckokkos;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() diff --git a/src/nvector/cuda/CMakeLists.txt b/src/nvector/cuda/CMakeLists.txt index 8452b9eef2..117373035c 100644 --- a/src/nvector/cuda/CMakeLists.txt +++ b/src/nvector/cuda/CMakeLists.txt @@ -17,23 +17,15 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_CUDA\n\")") # Create the library -sundials_add_library(sundials_nveccuda - SOURCES - nvector_cuda.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_cuda.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemcuda_obj - OUTPUT_NAME - sundials_nveccuda - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nveccuda + SOURCES nvector_cuda.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_cuda.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemcuda_obj + OUTPUT_NAME sundials_nveccuda + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_CUDA module") diff --git a/src/nvector/hip/CMakeLists.txt b/src/nvector/hip/CMakeLists.txt index 71736301ee..71ef53f40f 100644 --- a/src/nvector/hip/CMakeLists.txt +++ b/src/nvector/hip/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_HIP\n\")") # Create the library -sundials_add_library(sundials_nvechip - SOURCES - nvector_hip.hip.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_hip.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemhip_obj - LINK_LIBRARIES - PUBLIC hip::device - OUTPUT_NAME - sundials_nvechip - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvechip + SOURCES nvector_hip.hip.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_hip.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemhip_obj + LINK_LIBRARIES PUBLIC hip::device + OUTPUT_NAME sundials_nvechip + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_HIP module") diff --git a/src/nvector/manyvector/CMakeLists.txt b/src/nvector/manyvector/CMakeLists.txt index 4080f60ffc..e5bd67c722 100644 --- a/src/nvector/manyvector/CMakeLists.txt +++ b/src/nvector/manyvector/CMakeLists.txt @@ -19,22 +19,15 @@ if(BUILD_NVECTOR_MANYVECTOR) install(CODE "MESSAGE(\"\nInstall NVECTOR_MANYVECTOR\n\")") - sundials_add_library(sundials_nvecmanyvector - SOURCES - nvector_manyvector.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_manyvector.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OUTPUT_NAME - sundials_nvecmanyvector - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_library( + sundials_nvecmanyvector + SOURCES nvector_manyvector.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_manyvector.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OUTPUT_NAME sundials_nvecmanyvector + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR module") endif() @@ -52,24 +45,16 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) endif() # Create the sundials_nvecmpimanyvector library - sundials_add_library(sundials_nvecmpimanyvector - SOURCES - nvector_manyvector.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpimanyvector.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - COMPILE_DEFINITIONS - PRIVATE MANYVECTOR_BUILD_WITH_MPI - OUTPUT_NAME - sundials_nvecmpimanyvector - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_library( + sundials_nvecmpimanyvector + SOURCES nvector_manyvector.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpimanyvector.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + COMPILE_DEFINITIONS PRIVATE MANYVECTOR_BUILD_WITH_MPI + OUTPUT_NAME sundials_nvecmpimanyvector + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR module") endif() diff --git a/src/nvector/manyvector/fmod_int32/CMakeLists.txt b/src/nvector/manyvector/fmod_int32/CMakeLists.txt index 8033da01f7..2908e42e37 100644 --- a/src/nvector/manyvector/fmod_int32/CMakeLists.txt +++ b/src/nvector/manyvector/fmod_int32/CMakeLists.txt @@ -15,18 +15,13 @@ # --------------------------------------------------------------- if(BUILD_NVECTOR_MANYVECTOR) - sundials_add_f2003_library(sundials_fnvecmanyvector_mod - SOURCES - fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmanyvector_mod + SOURCES fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR F2003 Interface") endif() @@ -44,18 +39,13 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() - sundials_add_f2003_library(sundials_fnvecmpimanyvector_mod - SOURCES - fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmpimanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmpimanyvector_mod + SOURCES fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmpimanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR F2003 Interface") endif() diff --git a/src/nvector/manyvector/fmod_int64/CMakeLists.txt b/src/nvector/manyvector/fmod_int64/CMakeLists.txt index 8033da01f7..2908e42e37 100644 --- a/src/nvector/manyvector/fmod_int64/CMakeLists.txt +++ b/src/nvector/manyvector/fmod_int64/CMakeLists.txt @@ -15,18 +15,13 @@ # --------------------------------------------------------------- if(BUILD_NVECTOR_MANYVECTOR) - sundials_add_f2003_library(sundials_fnvecmanyvector_mod - SOURCES - fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmanyvector_mod + SOURCES fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR F2003 Interface") endif() @@ -44,18 +39,13 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() - sundials_add_f2003_library(sundials_fnvecmpimanyvector_mod - SOURCES - fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmpimanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmpimanyvector_mod + SOURCES fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmpimanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR F2003 Interface") endif() diff --git a/src/nvector/mpiplusx/CMakeLists.txt b/src/nvector/mpiplusx/CMakeLists.txt index 1be179696d..98f3fa36dc 100644 --- a/src/nvector/mpiplusx/CMakeLists.txt +++ b/src/nvector/mpiplusx/CMakeLists.txt @@ -25,24 +25,16 @@ elseif(MPI_C_FOUND) endif() # Create the library -sundials_add_library(sundials_nvecmpiplusx - SOURCES - nvector_mpiplusx.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpiplusx.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_nvecmpimanyvector_obj - OUTPUT_NAME - sundials_nvecmpiplusx - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecmpiplusx + SOURCES nvector_mpiplusx.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpiplusx.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_nvecmpimanyvector_obj + OUTPUT_NAME sundials_nvecmpiplusx + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX module") diff --git a/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt index d068b3609f..aaa836eba9 100644 --- a/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt +++ b/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt @@ -26,18 +26,13 @@ if(MPI_Fortran_COMPILER) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() -sundials_add_f2003_library(sundials_fnvecmpiplusx_mod - SOURCES - fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecmpiplusx_mod + SOURCES fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecmpiplusx_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecmpiplusx_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX F2003 interface") diff --git a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt index d068b3609f..aaa836eba9 100644 --- a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt +++ b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt @@ -26,18 +26,13 @@ if(MPI_Fortran_COMPILER) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() -sundials_add_f2003_library(sundials_fnvecmpiplusx_mod - SOURCES - fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecmpiplusx_mod + SOURCES fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecmpiplusx_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecmpiplusx_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX F2003 interface") diff --git a/src/nvector/openmp/CMakeLists.txt b/src/nvector/openmp/CMakeLists.txt index 9cbc2f35fe..bb3387b8f1 100644 --- a/src/nvector/openmp/CMakeLists.txt +++ b/src/nvector/openmp/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_OPENMP\n\")") # Create the library -sundials_add_library(sundials_nvecopenmp - SOURCES - nvector_openmp.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmp.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecopenmp + SOURCES nvector_openmp.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmp.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC OpenMP::OpenMP_C - OUTPUT_NAME - sundials_nvecopenmp - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC OpenMP::OpenMP_C + OUTPUT_NAME sundials_nvecopenmp + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP module") diff --git a/src/nvector/openmp/fmod_int32/CMakeLists.txt b/src/nvector/openmp/fmod_int32/CMakeLists.txt index 31f4363b84..6510270db2 100644 --- a/src/nvector/openmp/fmod_int32/CMakeLists.txt +++ b/src/nvector/openmp/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 openmp NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecopenmp_mod - SOURCES - fnvector_openmp_mod.f90 fnvector_openmp_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecopenmp_mod + SOURCES fnvector_openmp_mod.f90 fnvector_openmp_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecopenmp_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecopenmp_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP F2003 interface") diff --git a/src/nvector/openmp/fmod_int64/CMakeLists.txt b/src/nvector/openmp/fmod_int64/CMakeLists.txt index 31f4363b84..6510270db2 100644 --- a/src/nvector/openmp/fmod_int64/CMakeLists.txt +++ b/src/nvector/openmp/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 openmp NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecopenmp_mod - SOURCES - fnvector_openmp_mod.f90 fnvector_openmp_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecopenmp_mod + SOURCES fnvector_openmp_mod.f90 fnvector_openmp_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecopenmp_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecopenmp_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP F2003 interface") diff --git a/src/nvector/openmpdev/CMakeLists.txt b/src/nvector/openmpdev/CMakeLists.txt index 015a3ecbcf..fb3d7f988b 100644 --- a/src/nvector/openmpdev/CMakeLists.txt +++ b/src/nvector/openmpdev/CMakeLists.txt @@ -17,24 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_OPENMPDEV\n\")") # Create the library -sundials_add_library(sundials_nvecopenmpdev - SOURCES - nvector_openmpdev.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmpdev.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecopenmpdev + SOURCES nvector_openmpdev.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmpdev.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC OpenMP::OpenMP_C - OUTPUT_NAME - sundials_nvecopenmpdev - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC OpenMP::OpenMP_C + OUTPUT_NAME sundials_nvecopenmpdev + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMPDEV module") diff --git a/src/nvector/parallel/CMakeLists.txt b/src/nvector/parallel/CMakeLists.txt index 55effd6b9a..df960a9a77 100644 --- a/src/nvector/parallel/CMakeLists.txt +++ b/src/nvector/parallel/CMakeLists.txt @@ -25,23 +25,16 @@ else() endif() # Create the library -sundials_add_library(sundials_nvecparallel - SOURCES - nvector_parallel.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parallel.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecparallel + SOURCES nvector_parallel.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parallel.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_nvecparallel - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_nvecparallel + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL module") diff --git a/src/nvector/parallel/fmod_int32/CMakeLists.txt b/src/nvector/parallel/fmod_int32/CMakeLists.txt index 3b4031b8c9..98c301b871 100644 --- a/src/nvector/parallel/fmod_int32/CMakeLists.txt +++ b/src/nvector/parallel/fmod_int32/CMakeLists.txt @@ -32,18 +32,13 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -sundials_add_f2003_library(sundials_fnvecparallel_mod - SOURCES - fnvector_parallel_mod.f90 fnvector_parallel_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecparallel_mod + SOURCES fnvector_parallel_mod.f90 fnvector_parallel_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecparallel_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecparallel_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL F2003 interface") diff --git a/src/nvector/parallel/fmod_int64/CMakeLists.txt b/src/nvector/parallel/fmod_int64/CMakeLists.txt index 3b4031b8c9..98c301b871 100644 --- a/src/nvector/parallel/fmod_int64/CMakeLists.txt +++ b/src/nvector/parallel/fmod_int64/CMakeLists.txt @@ -32,18 +32,13 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -sundials_add_f2003_library(sundials_fnvecparallel_mod - SOURCES - fnvector_parallel_mod.f90 fnvector_parallel_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecparallel_mod + SOURCES fnvector_parallel_mod.f90 fnvector_parallel_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecparallel_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecparallel_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL F2003 interface") diff --git a/src/nvector/parhyp/CMakeLists.txt b/src/nvector/parhyp/CMakeLists.txt index f4ef295681..56724e1c9d 100644 --- a/src/nvector/parhyp/CMakeLists.txt +++ b/src/nvector/parhyp/CMakeLists.txt @@ -17,26 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_PARHYP\n\")") # Create the library -sundials_add_library(sundials_nvecparhyp - SOURCES - nvector_parhyp.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parhyp.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecparhyp + SOURCES nvector_parhyp.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parhyp.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC - SUNDIALS::HYPRE - MPI::MPI_C - OUTPUT_NAME - sundials_nvecparhyp - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::HYPRE MPI::MPI_C + OUTPUT_NAME sundials_nvecparhyp + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARHYP module") diff --git a/src/nvector/petsc/CMakeLists.txt b/src/nvector/petsc/CMakeLists.txt index 34fe418818..ed3dcab60e 100644 --- a/src/nvector/petsc/CMakeLists.txt +++ b/src/nvector/petsc/CMakeLists.txt @@ -25,24 +25,16 @@ else() endif() # Create the library -sundials_add_library(sundials_nvecpetsc - SOURCES - nvector_petsc.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_petsc.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecpetsc + SOURCES nvector_petsc.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_petsc.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::PETSC - OUTPUT_NAME - sundials_nvecpetsc - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::PETSC + OUTPUT_NAME sundials_nvecpetsc + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PETSC module") diff --git a/src/nvector/pthreads/CMakeLists.txt b/src/nvector/pthreads/CMakeLists.txt index 2aafa31e4a..447f1c91e5 100644 --- a/src/nvector/pthreads/CMakeLists.txt +++ b/src/nvector/pthreads/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_PTHREADS\n\")") # Create the library -sundials_add_library(sundials_nvecpthreads - SOURCES - nvector_pthreads.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_pthreads.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecpthreads + SOURCES nvector_pthreads.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_pthreads.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PRIVATE Threads::Threads - OUTPUT_NAME - sundials_nvecpthreads - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PRIVATE Threads::Threads + OUTPUT_NAME sundials_nvecpthreads + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS module") diff --git a/src/nvector/pthreads/fmod_int32/CMakeLists.txt b/src/nvector/pthreads/fmod_int32/CMakeLists.txt index e43ebc9c08..5fcf786118 100644 --- a/src/nvector/pthreads/fmod_int32/CMakeLists.txt +++ b/src/nvector/pthreads/fmod_int32/CMakeLists.txt @@ -16,18 +16,13 @@ set(nvecpthreads_SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c) -sundials_add_f2003_library(sundials_fnvecpthreads_mod - SOURCES - fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecpthreads_mod + SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecpthreads_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecpthreads_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS F2003 interface") diff --git a/src/nvector/pthreads/fmod_int64/CMakeLists.txt b/src/nvector/pthreads/fmod_int64/CMakeLists.txt index e43ebc9c08..5fcf786118 100644 --- a/src/nvector/pthreads/fmod_int64/CMakeLists.txt +++ b/src/nvector/pthreads/fmod_int64/CMakeLists.txt @@ -16,18 +16,13 @@ set(nvecpthreads_SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c) -sundials_add_f2003_library(sundials_fnvecpthreads_mod - SOURCES - fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecpthreads_mod + SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecpthreads_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecpthreads_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS F2003 interface") diff --git a/src/nvector/raja/CMakeLists.txt b/src/nvector/raja/CMakeLists.txt index 1dbfd8197a..247f8bf424 100644 --- a/src/nvector/raja/CMakeLists.txt +++ b/src/nvector/raja/CMakeLists.txt @@ -14,7 +14,9 @@ # CMakeLists.txt file for the RAJA NVECTOR library # --------------------------------------------------------------- -install(CODE "MESSAGE(\"\nInstall NVECTOR_RAJA with ${SUNDIALS_RAJA_BACKENDS} backend(s)\n\")") +install( + CODE "MESSAGE(\"\nInstall NVECTOR_RAJA with ${SUNDIALS_RAJA_BACKENDS} backend(s)\n\")" +) if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_sunmemlib sundials_sunmemcuda_obj) @@ -33,31 +35,20 @@ elseif(SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") endif() # Create the library -sundials_add_library(sundials_nvecraja - SOURCES - nvector_raja.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_raja.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - ${_sunmemlib} - LINK_LIBRARIES - PUBLIC ${_hip_lib_or_not} RAJA - COMPILE_OPTIONS - PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda> - COMPILE_DEFINITIONS - PRIVATE ${_compile_defs} - COMPILE_FEATURES - PUBLIC ${_cxx_std} - OUTPUT_NAME - ${_lib_output_name} - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecraja + SOURCES nvector_raja.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_raja.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES ${_sunmemlib} + LINK_LIBRARIES PUBLIC ${_hip_lib_or_not} RAJA + COMPILE_OPTIONS PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda> + COMPILE_DEFINITIONS PRIVATE ${_compile_defs} + COMPILE_FEATURES PUBLIC ${_cxx_std} + OUTPUT_NAME ${_lib_output_name} + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) -message(STATUS "Added NVECTOR_RAJA module with ${SUNDIALS_RAJA_BACKENDS} backend") +message( + STATUS "Added NVECTOR_RAJA module with ${SUNDIALS_RAJA_BACKENDS} backend") diff --git a/src/nvector/serial/CMakeLists.txt b/src/nvector/serial/CMakeLists.txt index c8e867daa8..976b8440f2 100644 --- a/src/nvector/serial/CMakeLists.txt +++ b/src/nvector/serial/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_SERIAL\n\")") # Create the sundials_nvecserial library -sundials_add_library(sundials_nvecserial - SOURCES - nvector_serial.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_serial.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecserial + SOURCES nvector_serial.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_serial.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_nvecserial - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_nvecserial + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL module") diff --git a/src/nvector/serial/fmod_int32/CMakeLists.txt b/src/nvector/serial/fmod_int32/CMakeLists.txt index ebf2ec0182..fbfc2e3344 100644 --- a/src/nvector/serial/fmod_int32/CMakeLists.txt +++ b/src/nvector/serial/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 serial NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecserial_mod - SOURCES - fnvector_serial_mod.f90 fnvector_serial_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecserial_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fnvecserial_mod + SOURCES fnvector_serial_mod.f90 fnvector_serial_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecserial_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL F2003 interface") diff --git a/src/nvector/serial/fmod_int64/CMakeLists.txt b/src/nvector/serial/fmod_int64/CMakeLists.txt index 293239b9fb..e52f2ae867 100644 --- a/src/nvector/serial/fmod_int64/CMakeLists.txt +++ b/src/nvector/serial/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 serial NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecserial_mod - SOURCES - fnvector_serial_mod.f90 fnvector_serial_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecserial_mod + SOURCES fnvector_serial_mod.f90 fnvector_serial_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecserial_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecserial_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL F2003 interface") diff --git a/src/nvector/sycl/CMakeLists.txt b/src/nvector/sycl/CMakeLists.txt index 47fac19d77..51dc3ddc8c 100644 --- a/src/nvector/sycl/CMakeLists.txt +++ b/src/nvector/sycl/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_SYCL\n\")") # Create the library -sundials_add_library(sundials_nvecsycl - SOURCES - nvector_sycl.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_sycl.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemsycl_obj - COMPILE_FEATURES - PUBLIC cxx_std_17 - OUTPUT_NAME - sundials_nvecsycl - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecsycl + SOURCES nvector_sycl.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_sycl.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemsycl_obj + COMPILE_FEATURES PUBLIC cxx_std_17 + OUTPUT_NAME sundials_nvecsycl + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SYCL module") diff --git a/src/nvector/trilinos/CMakeLists.txt b/src/nvector/trilinos/CMakeLists.txt index 8b98960d0c..d2d119cb3e 100644 --- a/src/nvector/trilinos/CMakeLists.txt +++ b/src/nvector/trilinos/CMakeLists.txt @@ -18,35 +18,29 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_Trilinos\n\")") # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") # Create the library -sundials_add_library(sundials_nvectrilinos - SOURCES - nvector_trilinos.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_trilinos.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvectrilinos + SOURCES nvector_trilinos.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_trilinos.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::TRILINOS - OUTPUT_NAME - sundials_nvectrilinos - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::TRILINOS + OUTPUT_NAME sundials_nvectrilinos + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) # Install the exported NVECTRILINOS CXX header files in a separate subdirectory -install(FILES - ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp - ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector/trilinos") +install( + FILES + ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp + ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector/trilinos") message(STATUS "Added NVECTOR_Trilinos module") diff --git a/src/sunadaptcontroller/imexgus/CMakeLists.txt b/src/sunadaptcontroller/imexgus/CMakeLists.txt index 8bbef68cdf..91367cf3ba 100644 --- a/src/sunadaptcontroller/imexgus/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/CMakeLists.txt @@ -13,17 +13,14 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunadaptcontrollerimexgus - SOURCES - sunadaptcontroller_imexgus.c +sundials_add_library( + sundials_sunadaptcontrollerimexgus + SOURCES sunadaptcontroller_imexgus.c HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_imexgus.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunadaptcontroller - OBJECT_LIB_ONLY -) + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunadaptcontroller + OBJECT_LIB_ONLY) # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt index 0c4142417c..8fe6e45f40 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt @@ -12,14 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod - SOURCES - fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollerimexgus_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollerimexgus_mod + SOURCES fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt index 0c4142417c..8fe6e45f40 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt @@ -12,14 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod - SOURCES - fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollerimexgus_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollerimexgus_mod + SOURCES fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/CMakeLists.txt b/src/sunadaptcontroller/soderlind/CMakeLists.txt index 50cf7330bc..9c2613703c 100644 --- a/src/sunadaptcontroller/soderlind/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/CMakeLists.txt @@ -13,17 +13,14 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunadaptcontrollersoderlind - SOURCES - sunadaptcontroller_soderlind.c +sundials_add_library( + sundials_sunadaptcontrollersoderlind + SOURCES sunadaptcontroller_soderlind.c HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_soderlind.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunadaptcontroller - OBJECT_LIB_ONLY -) + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunadaptcontroller + OBJECT_LIB_ONLY) # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt index cdf9d3825e..81863c3a8c 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt @@ -12,14 +12,11 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod - SOURCES - fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollersoderlind_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollersoderlind_mod + SOURCES fsunadaptcontroller_soderlind_mod.f90 + fsunadaptcontroller_soderlind_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt index cdf9d3825e..81863c3a8c 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt @@ -12,14 +12,11 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod - SOURCES - fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollersoderlind_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollersoderlind_mod + SOURCES fsunadaptcontroller_soderlind_mod.f90 + fsunadaptcontroller_soderlind_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index b8a19e2ff2..cf31cb497e 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -14,45 +14,44 @@ # CMakeLists.txt file for the generic SUNDIALS modules # --------------------------------------------------------------- -# From here we only install the generic SUNDIALS headers. -# The implementations themselves are incorporated in the individual SUNDIALS solver libraries. +# From here we only install the generic SUNDIALS headers. The implementations +# themselves are incorporated in the individual SUNDIALS solver libraries. install(CODE "MESSAGE(\"\nInstall shared components\n\")") # Add variable sundials_HEADERS with the exported SUNDIALS header files set(sundials_HEADERS - sundials_adaptcontroller.h - sundials_band.h - sundials_base.hpp - sundials_context.h - sundials_context.hpp - sundials_convertibleto.hpp - sundials_core.h - sundials_core.hpp - sundials_dense.h - sundials_direct.h - sundials_errors.h - sundials_futils.h - sundials_iterative.h - sundials_linearsolver.h - sundials_linearsolver.hpp - sundials_logger.h - sundials_math.h - sundials_matrix.h - sundials_matrix.hpp - sundials_memory.h - sundials_memory.hpp - sundials_mpi_types.h - sundials_nonlinearsolver.h - sundials_nonlinearsolver.hpp - sundials_nvector.h - sundials_nvector.hpp - sundials_profiler.h - sundials_profiler.hpp - sundials_types_deprecated.h - sundials_types.h - sundials_version.h - ) + sundials_adaptcontroller.h + sundials_band.h + sundials_base.hpp + sundials_context.h + sundials_context.hpp + sundials_convertibleto.hpp + sundials_core.h + sundials_core.hpp + sundials_dense.h + sundials_direct.h + sundials_errors.h + sundials_futils.h + sundials_iterative.h + sundials_linearsolver.h + sundials_linearsolver.hpp + sundials_logger.h + sundials_math.h + sundials_matrix.h + sundials_matrix.hpp + sundials_memory.h + sundials_memory.hpp + sundials_mpi_types.h + sundials_nonlinearsolver.h + sundials_nonlinearsolver.hpp + sundials_nvector.h + sundials_nvector.hpp + sundials_profiler.h + sundials_profiler.hpp + sundials_types_deprecated.h + sundials_types.h + sundials_version.h) if(ENABLE_MPI) list(APPEND sundials_HEADERS sundials_mpi_errors.h) @@ -79,26 +78,25 @@ 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 - sundials_direct.c - sundials_errors.c - sundials_futils.c - sundials_hashmap.c - sundials_iterative.c - sundials_linearsolver.c - sundials_logger.c - sundials_math.c - sundials_matrix.c - sundials_memory.c - sundials_nonlinearsolver.c - sundials_nvector_senswrapper.c - sundials_nvector.c - sundials_profiler.c - sundials_version.c - ) + sundials_adaptcontroller.c + sundials_band.c + sundials_context.c + sundials_dense.c + sundials_direct.c + sundials_errors.c + sundials_futils.c + sundials_hashmap.c + sundials_iterative.c + sundials_linearsolver.c + sundials_logger.c + sundials_math.c + sundials_matrix.c + sundials_memory.c + sundials_nonlinearsolver.c + sundials_nvector_senswrapper.c + sundials_nvector.c + sundials_profiler.c + sundials_version.c) if(ENABLE_MPI) list(APPEND sundials_SOURCES sundials_mpi_errors.c) @@ -108,12 +106,10 @@ endif() add_prefix(${SUNDIALS_SOURCE_DIR}/src/sundials/ sundials_SOURCES) if(ENABLE_MPI) - set(_link_mpi_if_needed PUBLIC - MPI::MPI_C - $<$<LINK_LANGUAGE:CXX>:MPI::MPI_CXX>) + set(_link_mpi_if_needed PUBLIC MPI::MPI_C + $<$<LINK_LANGUAGE:CXX>:MPI::MPI_CXX>) endif() - if(SUNDIALS_BUILD_WITH_PROFILING) if(ENABLE_CALIPER) set(_link_caliper_if_needed PUBLIC caliper) @@ -124,42 +120,34 @@ if(SUNDIALS_BUILD_WITH_PROFILING) endif() # Create a library out of the generic sundials modules -sundials_add_library(sundials_core - SOURCES - ${sundials_SOURCES} - HEADERS - ${sundials_HEADERS} - INCLUDE_SUBDIR - sundials - LINK_LIBRARIES - ${_link_mpi_if_needed} - OUTPUT_NAME - sundials_core - VERSION - ${sundialslib_VERSION} - SOVERSION - ${sundialslib_SOVERSION} -) +sundials_add_library( + sundials_core + SOURCES ${sundials_SOURCES} + HEADERS ${sundials_HEADERS} + INCLUDE_SUBDIR sundials + LINK_LIBRARIES ${_link_mpi_if_needed} + OUTPUT_NAME sundials_core + VERSION ${sundialslib_VERSION} + SOVERSION ${sundialslib_SOVERSION}) # Install private headers -install(FILES - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_context_impl.h - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_errors_impl.h +install( + FILES ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_context_impl.h + ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_errors_impl.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials/priv") if(ENABLE_MPI) - install(FILES - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_mpi_errors_impl.h + install( + FILES + ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_mpi_errors_impl.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials/priv") endif() # SUNDIALS_EXPORT macro include(GenerateExportHeader) generate_export_header( - sundials_core BASE_NAME SUNDIALS - EXPORT_FILE_NAME - "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h" -) + sundials_core BASE_NAME SUNDIALS EXPORT_FILE_NAME + "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sundials/fmod_int32/CMakeLists.txt b/src/sundials/fmod_int32/CMakeLists.txt index 957328e8ff..b9a43aeded 100644 --- a/src/sundials/fmod_int32/CMakeLists.txt +++ b/src/sundials/fmod_int32/CMakeLists.txt @@ -14,12 +14,6 @@ # CMakeLists.txt file for the F2003 SUNDIALS object library # --------------------------------------------------------------- -set(sundials_SOURCES - fsundials_core_mod.c - fsundials_core_mod.f90 - ) +set(sundials_SOURCES fsundials_core_mod.c fsundials_core_mod.f90) -sundials_add_f2003_library(sundials_fcore_mod - SOURCES - ${sundials_SOURCES} -) +sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES}) diff --git a/src/sundials/fmod_int64/CMakeLists.txt b/src/sundials/fmod_int64/CMakeLists.txt index 957328e8ff..b9a43aeded 100644 --- a/src/sundials/fmod_int64/CMakeLists.txt +++ b/src/sundials/fmod_int64/CMakeLists.txt @@ -14,12 +14,6 @@ # CMakeLists.txt file for the F2003 SUNDIALS object library # --------------------------------------------------------------- -set(sundials_SOURCES - fsundials_core_mod.c - fsundials_core_mod.f90 - ) +set(sundials_SOURCES fsundials_core_mod.c fsundials_core_mod.f90) -sundials_add_f2003_library(sundials_fcore_mod - SOURCES - ${sundials_SOURCES} -) +sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES}) diff --git a/src/sunlinsol/CMakeLists.txt b/src/sunlinsol/CMakeLists.txt index a39352ec6a..976a77a2a5 100644 --- a/src/sunlinsol/CMakeLists.txt +++ b/src/sunlinsol/CMakeLists.txt @@ -33,14 +33,17 @@ if(BUILD_SUNLINSOL_GINKGO) message(STATUS "Added BUILD_SUNLINSOL_GINKGO module") add_library(sundials_sunlinsolginkgo INTERFACE) target_link_libraries(sundials_sunlinsolginkgo INTERFACE sundials_core) - target_include_directories(sundials_sunlinsolginkgo INTERFACE - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + target_include_directories( + sundials_sunlinsolginkgo + INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) install(FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_ginkgo.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunlinsolginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunlinsolginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNLINSOL_KLU) @@ -51,16 +54,21 @@ if(BUILD_SUNLINSOL_KOKKOSDENSE) install(CODE "MESSAGE(\"\nInstall SUNLINSOL_KOKKOSDENSE\n\")") message(STATUS "Added BUILD_SUNLINSOL_KOKKOSDENSE module") add_library(sundials_sunlinsolkokkosdense INTERFACE) - target_link_libraries(sundials_sunlinsolkokkosdense INTERFACE - sundials_core Kokkos::kokkos Kokkos::kokkoskernels) - target_include_directories(sundials_sunlinsolkokkosdense INTERFACE - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) - install(FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_kokkosdense.hpp + target_link_libraries( + sundials_sunlinsolkokkosdense INTERFACE sundials_core Kokkos::kokkos + Kokkos::kokkoskernels) + target_include_directories( + sundials_sunlinsolkokkosdense + INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + install( + FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_kokkosdense.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunlinsolkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunlinsolkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNLINSOL_LAPACKBAND) diff --git a/src/sunlinsol/band/CMakeLists.txt b/src/sunlinsol/band/CMakeLists.txt index 0b2035e0ef..2fd2ffadf3 100644 --- a/src/sunlinsol/band/CMakeLists.txt +++ b/src/sunlinsol/band/CMakeLists.txt @@ -18,25 +18,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_BAND\n\")") # Add the library -sundials_add_library(sundials_sunlinsolband - SOURCES - sunlinsol_band.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_band.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolband + SOURCES sunlinsol_band.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_band.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixband - OUTPUT_NAME - sundials_sunlinsolband - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixband + OUTPUT_NAME sundials_sunlinsolband + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND module") diff --git a/src/sunlinsol/band/fmod_int32/CMakeLists.txt b/src/sunlinsol/band/fmod_int32/CMakeLists.txt index 8b6e38724e..4a348ffb70 100644 --- a/src/sunlinsol/band/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/band/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 band SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolband_mod - SOURCES - fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixband_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolband_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolband_mod + SOURCES fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixband_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolband_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND F2003 interface") diff --git a/src/sunlinsol/band/fmod_int64/CMakeLists.txt b/src/sunlinsol/band/fmod_int64/CMakeLists.txt index 250f17c914..759321d170 100644 --- a/src/sunlinsol/band/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/band/fmod_int64/CMakeLists.txt @@ -14,20 +14,14 @@ # CMakeLists.txt file for the F2003 band SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolband_mod - SOURCES - fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolband_mod + SOURCES fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixband_mod - OUTPUT_NAME - sundials_fsunlinsolband_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixband_mod + OUTPUT_NAME sundials_fsunlinsolband_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND F2003 interface") diff --git a/src/sunlinsol/cusolversp/CMakeLists.txt b/src/sunlinsol/cusolversp/CMakeLists.txt index 830ddb0ab9..2663fc77dc 100644 --- a/src/sunlinsol/cusolversp/CMakeLists.txt +++ b/src/sunlinsol/cusolversp/CMakeLists.txt @@ -16,25 +16,18 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_CUSOLVERSP\n\")") -sundials_add_library(sundials_sunlinsolcusolversp - SOURCES - sunlinsol_cusolversp_batchqr.cu +sundials_add_library( + sundials_sunlinsolcusolversp + SOURCES sunlinsol_cusolversp_batchqr.cu HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_cusolversp_batchqr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixcusparse CUDA::cusolver - PRIVATE CUDA::cusparse - OUTPUT_NAME - sundials_sunlinsolcusolversp - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixcusparse CUDA::cusolver PRIVATE + CUDA::cusparse + OUTPUT_NAME sundials_sunlinsolcusolversp + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_CUSOLVERSP module") diff --git a/src/sunlinsol/dense/CMakeLists.txt b/src/sunlinsol/dense/CMakeLists.txt index 1661deca42..27eb05e6f8 100644 --- a/src/sunlinsol/dense/CMakeLists.txt +++ b/src/sunlinsol/dense/CMakeLists.txt @@ -18,25 +18,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_DENSE\n\")") # Add the sunlinsol_dense library -sundials_add_library(sundials_sunlinsoldense - SOURCES - sunlinsol_dense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_dense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsoldense + SOURCES sunlinsol_dense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_dense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixdense - OUTPUT_NAME - sundials_sunlinsoldense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixdense + OUTPUT_NAME sundials_sunlinsoldense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE module") diff --git a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt index 3a1329e120..eb904dc764 100644 --- a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt @@ -14,16 +14,11 @@ # CMakeLists.txt file for the F2003 dense SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsoldense_mod - SOURCES - fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsoldense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsoldense_mod + SOURCES fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsoldense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE F2003 interface") diff --git a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt index 61bdf87108..8a6401a143 100644 --- a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt @@ -14,19 +14,13 @@ # CMakeLists.txt file for the F2003 dense SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsoldense_mod - SOURCES - fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsoldense_mod + SOURCES fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod - OUTPUT_NAME - sundials_fsunlinsoldense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME sundials_fsunlinsoldense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE F2003 interface") diff --git a/src/sunlinsol/klu/CMakeLists.txt b/src/sunlinsol/klu/CMakeLists.txt index c78a547deb..781a60819d 100644 --- a/src/sunlinsol/klu/CMakeLists.txt +++ b/src/sunlinsol/klu/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_KLU\n\")") # Add the library -sundials_add_library(sundials_sunlinsolklu - SOURCES - sunlinsol_klu.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_klu.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolklu + SOURCES sunlinsol_klu.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_klu.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixsparse SUNDIALS::KLU - OUTPUT_NAME - sundials_sunlinsolklu - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixsparse SUNDIALS::KLU + OUTPUT_NAME sundials_sunlinsolklu + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU module") diff --git a/src/sunlinsol/klu/fmod_int32/CMakeLists.txt b/src/sunlinsol/klu/fmod_int32/CMakeLists.txt index 4a0323d921..04a6624e77 100644 --- a/src/sunlinsol/klu/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/klu/fmod_int32/CMakeLists.txt @@ -14,20 +14,14 @@ # CMakeLists.txt file for the F2003 KLU SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolklu_mod - SOURCES - fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolklu_mod + SOURCES fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixsparse_mod - OUTPUT_NAME - sundials_fsunlinsolklu_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixsparse_mod + OUTPUT_NAME sundials_fsunlinsolklu_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU F2003 interface") diff --git a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt index 683f76cc3b..c24c56f863 100644 --- a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 KLU SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolklu_mod - SOURCES - fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixsparse_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolklu_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolklu_mod + SOURCES fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixsparse_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolklu_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU F2003 interface") diff --git a/src/sunlinsol/lapackband/CMakeLists.txt b/src/sunlinsol/lapackband/CMakeLists.txt index 8cba988623..4da37454dd 100644 --- a/src/sunlinsol/lapackband/CMakeLists.txt +++ b/src/sunlinsol/lapackband/CMakeLists.txt @@ -17,24 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKBAND\n\")") # Add the library -sundials_add_library(sundials_sunlinsollapackband - SOURCES - sunlinsol_lapackband.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackband.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsollapackband + SOURCES sunlinsol_lapackband.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackband.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixband "${LAPACK_LIBRARIES}" - OUTPUT_NAME - sundials_sunlinsollapackband - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixband "${LAPACK_LIBRARIES}" + OUTPUT_NAME sundials_sunlinsollapackband + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKBAND module") diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index 41ab2a5fa7..f8161667f3 100644 --- a/src/sunlinsol/lapackdense/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKDENSE\n\")") # Add the library -sundials_add_library(sundials_sunlinsollapackdense - SOURCES - sunlinsol_lapackdense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackdense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsollapackdense + SOURCES sunlinsol_lapackdense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackdense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixdense "${LAPACK_LIBRARIES}" - OUTPUT_NAME - sundials_sunlinsollapackdense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixdense "${LAPACK_LIBRARIES}" + OUTPUT_NAME sundials_sunlinsollapackdense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE module") diff --git a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt index 72b9d5acda..ed20a78200 100644 --- a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt @@ -15,16 +15,11 @@ # object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod - SOURCES - fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsollapackdense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsollapackdense_mod + SOURCES fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsollapackdense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt index 12bcb2fae2..b2eb2b329b 100644 --- a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt @@ -15,19 +15,13 @@ # object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod - SOURCES - fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsollapackdense_mod + SOURCES fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod - OUTPUT_NAME - sundials_fsunlinsollapackdense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME sundials_fsunlinsollapackdense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/magmadense/CMakeLists.txt b/src/sunlinsol/magmadense/CMakeLists.txt index 4fbaaaf49f..2928669307 100644 --- a/src/sunlinsol/magmadense/CMakeLists.txt +++ b/src/sunlinsol/magmadense/CMakeLists.txt @@ -23,24 +23,16 @@ elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") endif() # Add the sunlinsol_magmadense library -sundials_add_library(sundials_sunlinsolmagmadense - SOURCES - sunlinsol_magmadense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_magmadense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolmagmadense + SOURCES sunlinsol_magmadense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_magmadense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::MAGMA ${_libs_needed} - OUTPUT_NAME - sundials_sunlinsolmagmadense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::MAGMA ${_libs_needed} + OUTPUT_NAME sundials_sunlinsolmagmadense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_MAGMADENSE module") diff --git a/src/sunlinsol/onemkldense/CMakeLists.txt b/src/sunlinsol/onemkldense/CMakeLists.txt index ccf16f5740..9fbecb5886 100644 --- a/src/sunlinsol/onemkldense/CMakeLists.txt +++ b/src/sunlinsol/onemkldense/CMakeLists.txt @@ -15,28 +15,19 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_ONEMKLDENSE\n\")") # Add the sunlinsol_onemkldense library -sundials_add_library(sundials_sunlinsolonemkldense - SOURCES - sunlinsol_onemkldense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_onemkldense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolonemkldense + SOURCES sunlinsol_onemkldense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_onemkldense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - COMPILE_FEATURES - PUBLIC cxx_std_17 - INCLUDE_DIRECTORIES - PUBLIC ${MKL_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC MKL::MKL_DPCPP sundials_sunmatrixonemkldense sundials_nvecsycl - OUTPUT_NAME - sundials_sunlinsolonemkldense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + COMPILE_FEATURES PUBLIC cxx_std_17 + INCLUDE_DIRECTORIES PUBLIC ${MKL_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC MKL::MKL_DPCPP sundials_sunmatrixonemkldense + sundials_nvecsycl + OUTPUT_NAME sundials_sunlinsolonemkldense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNLINSOL_ONEMKLDENSE module") diff --git a/src/sunlinsol/pcg/CMakeLists.txt b/src/sunlinsol/pcg/CMakeLists.txt index e8e37003f2..9a872e3e73 100644 --- a/src/sunlinsol/pcg/CMakeLists.txt +++ b/src/sunlinsol/pcg/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_PCG\n\")") # Add the sunlinsol_pcg library -sundials_add_library(sundials_sunlinsolpcg - SOURCES - sunlinsol_pcg.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_pcg.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolpcg + SOURCES sunlinsol_pcg.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_pcg.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolpcg - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolpcg + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG module") diff --git a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt index e863f286ee..b89dc76f74 100644 --- a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 PCG SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolpcg_mod - SOURCES - fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolpcg_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolpcg_mod + SOURCES fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolpcg_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG F2003 interface") diff --git a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt index 535741e7d6..ad5985e0b8 100644 --- a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 PCG SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolpcg_mod - SOURCES - fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolpcg_mod + SOURCES fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolpcg_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolpcg_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG F2003 interface") diff --git a/src/sunlinsol/spbcgs/CMakeLists.txt b/src/sunlinsol/spbcgs/CMakeLists.txt index 331c788606..71f4118a63 100644 --- a/src/sunlinsol/spbcgs/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPBCGS\n\")") # Add the sunlinsol_spbcgs library -sundials_add_library(sundials_sunlinsolspbcgs - SOURCES - sunlinsol_spbcgs.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spbcgs.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspbcgs + SOURCES sunlinsol_spbcgs.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spbcgs.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspbcgs - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspbcgs + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS module") diff --git a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt index d05fdd7d0c..23db9490eb 100644 --- a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPBCGS SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod - SOURCES - fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspbcgs_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspbcgs_mod + SOURCES fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspbcgs_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS F2003 interface") diff --git a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt index d1b588396f..903402f4de 100644 --- a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPBCGS SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod - SOURCES - fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspbcgs_mod + SOURCES fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspbcgs_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspbcgs_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS F2003 interface") diff --git a/src/sunlinsol/spfgmr/CMakeLists.txt b/src/sunlinsol/spfgmr/CMakeLists.txt index 38b9d784e9..fc2765c584 100644 --- a/src/sunlinsol/spfgmr/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPFGMR\n\")") # Add the sunlinsol_spfgmr library -sundials_add_library(sundials_sunlinsolspfgmr - SOURCES - sunlinsol_spfgmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spfgmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspfgmr + SOURCES sunlinsol_spfgmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spfgmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspfgmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspfgmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR module") diff --git a/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt index c2cbd50123..4d52831daa 100644 --- a/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPFGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod - SOURCES - fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspfgmr_mod + SOURCES fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspfgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspfgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt index 4a236368f8..335cb9a895 100644 --- a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPFGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod - SOURCES - fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspfgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspfgmr_mod + SOURCES fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspfgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/CMakeLists.txt b/src/sunlinsol/spgmr/CMakeLists.txt index 712f07731a..d6a36526b0 100644 --- a/src/sunlinsol/spgmr/CMakeLists.txt +++ b/src/sunlinsol/spgmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPGMR\n\")") # Add the sunlinsol_spgmr library -sundials_add_library(sundials_sunlinsolspgmr - SOURCES - sunlinsol_spgmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spgmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspgmr + SOURCES sunlinsol_spgmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spgmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspgmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspgmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR module") diff --git a/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt index 9ea74e0e45..b359729811 100644 --- a/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod - SOURCES - fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspgmr_mod + SOURCES fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt index 005f891f6c..bfbb2e11ad 100644 --- a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod - SOURCES - fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspgmr_mod + SOURCES fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/CMakeLists.txt b/src/sunlinsol/sptfqmr/CMakeLists.txt index 60bb70ef1f..8eb8a9795f 100644 --- a/src/sunlinsol/sptfqmr/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPTFQMR\n\")") # Add the sunlinsol_sptfqmr library -sundials_add_library(sundials_sunlinsolsptfqmr - SOURCES - sunlinsol_sptfqmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_sptfqmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsptfqmr + SOURCES sunlinsol_sptfqmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_sptfqmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolsptfqmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolsptfqmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR module") diff --git a/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt index ff3dc41956..f38d135a57 100644 --- a/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPTFQMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod - SOURCES - fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolsptfqmr_mod + SOURCES fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolsptfqmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolsptfqmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt index 2aa92f9022..00ac061002 100644 --- a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPTFQMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod - SOURCES - fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolsptfqmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolsptfqmr_mod + SOURCES fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolsptfqmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/superludist/CMakeLists.txt b/src/sunlinsol/superludist/CMakeLists.txt index ecff5b1e52..acd34e103e 100644 --- a/src/sunlinsol/superludist/CMakeLists.txt +++ b/src/sunlinsol/superludist/CMakeLists.txt @@ -17,30 +17,19 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SUPERLUDIST\n\")") # Add the library -sundials_add_library(sundials_sunlinsolsuperludist - SOURCES - sunlinsol_superludist.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superludist.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsuperludist + SOURCES sunlinsol_superludist.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superludist.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES LINK_LIBRARIES - PUBLIC - sundials_sunmatrixslunrloc - SUNDIALS::SUPERLUDIST - $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,> - MPI::MPI_C - COMPILE_OPTIONS - PRIVATE ${_compile_options} - OUTPUT_NAME - sundials_sunlinsolsuperludist - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + PUBLIC sundials_sunmatrixslunrloc SUNDIALS::SUPERLUDIST + $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,> MPI::MPI_C + COMPILE_OPTIONS PRIVATE ${_compile_options} + OUTPUT_NAME sundials_sunlinsolsuperludist + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SUPERLUDIST module") diff --git a/src/sunlinsol/superlumt/CMakeLists.txt b/src/sunlinsol/superlumt/CMakeLists.txt index c4b665bb47..745fde598a 100644 --- a/src/sunlinsol/superlumt/CMakeLists.txt +++ b/src/sunlinsol/superlumt/CMakeLists.txt @@ -16,8 +16,7 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SUPERLUMT\n\")") -# Include OpenMP flags if SuperLU_MT is using OpenMP, -# otherwise we use threads. +# Include OpenMP flags if SuperLU_MT is using OpenMP, otherwise we use threads. if(SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP") set(_threads OpenMP::OpenMP_C) else() @@ -25,26 +24,16 @@ else() endif() # Add the library -sundials_add_library(sundials_sunlinsolsuperlumt - SOURCES - sunlinsol_superlumt.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superlumt.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsuperlumt + SOURCES sunlinsol_superlumt.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superlumt.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC - sundials_sunmatrixsparse - SUNDIALS::SUPERLUMT ${_threads} - OUTPUT_NAME - sundials_sunlinsolsuperlumt - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixsparse SUNDIALS::SUPERLUMT ${_threads} + OUTPUT_NAME sundials_sunlinsolsuperlumt + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SUPERLUMT module") diff --git a/src/sunmatrix/CMakeLists.txt b/src/sunmatrix/CMakeLists.txt index eec6be4f72..f9f9ce95da 100644 --- a/src/sunmatrix/CMakeLists.txt +++ b/src/sunmatrix/CMakeLists.txt @@ -29,30 +29,38 @@ if(BUILD_SUNMATRIX_GINKGO) message(STATUS "Added BUILD_SUNMATRIX_GINKGO module") add_library(sundials_sunmatrixginkgo INTERFACE) target_link_libraries(sundials_sunmatrixginkgo INTERFACE sundials_core) - target_include_directories(sundials_sunmatrixginkgo INTERFACE - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + target_include_directories( + sundials_sunmatrixginkgo + INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) install(FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_ginkgo.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunmatrixginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunmatrixginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNMATRIX_KOKKOSDENSE) install(CODE "MESSAGE(\"\nInstall SUNMATRIX_KOKKOSDENSE\n\")") message(STATUS "Added BUILD_SUNMATRIX_KOKKOSDENSE module") add_library(sundials_sunmatrixkokkosdense INTERFACE) - target_link_libraries(sundials_sunmatrixkokkosdense INTERFACE - sundials_core Kokkos::kokkos Kokkos::kokkoskernels) - target_include_directories(sundials_sunmatrixkokkosdense INTERFACE - $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> - $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> - $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) - install(FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_kokkosdense.hpp + target_link_libraries( + sundials_sunmatrixkokkosdense INTERFACE sundials_core Kokkos::kokkos + Kokkos::kokkoskernels) + target_include_directories( + sundials_sunmatrixkokkosdense + INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> + $<BUILD_INTERFACE:${SUNDIALS_SOURCE_DIR}/src/sundials> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + install( + FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_kokkosdense.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunmatrixkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunmatrixkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNMATRIX_MAGMADENSE) diff --git a/src/sunmatrix/band/CMakeLists.txt b/src/sunmatrix/band/CMakeLists.txt index 240fcf7ed4..3cbb540a45 100644 --- a/src/sunmatrix/band/CMakeLists.txt +++ b/src/sunmatrix/band/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_BAND\n\")") # Add the sunmatrix_band library -sundials_add_library(sundials_sunmatrixband - SOURCES - sunmatrix_band.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_band.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixband + SOURCES sunmatrix_band.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_band.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixband - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixband + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND module") diff --git a/src/sunmatrix/band/fmod_int32/CMakeLists.txt b/src/sunmatrix/band/fmod_int32/CMakeLists.txt index 6026568af8..44e9fc667a 100644 --- a/src/sunmatrix/band/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/band/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 band SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixband_mod - SOURCES - fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixband_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixband_mod + SOURCES fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixband_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND F2003 interface") diff --git a/src/sunmatrix/band/fmod_int64/CMakeLists.txt b/src/sunmatrix/band/fmod_int64/CMakeLists.txt index 465260d783..2c4bac0524 100644 --- a/src/sunmatrix/band/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/band/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 band SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixband_mod - SOURCES - fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixband_mod + SOURCES fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixband_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixband_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND F2003 interface") diff --git a/src/sunmatrix/cusparse/CMakeLists.txt b/src/sunmatrix/cusparse/CMakeLists.txt index b1bf8a069a..d56ebf3566 100644 --- a/src/sunmatrix/cusparse/CMakeLists.txt +++ b/src/sunmatrix/cusparse/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_CUSPARSE\n\")") # Add the library -sundials_add_library(sundials_sunmatrixcusparse - SOURCES - sunmatrix_cusparse.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_cusparse.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemcuda_obj - LINK_LIBRARIES - PUBLIC CUDA::cusparse CUDA::cusolver - OUTPUT_NAME - sundials_sunmatrixcusparse - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_library( + sundials_sunmatrixcusparse + SOURCES sunmatrix_cusparse.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_cusparse.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemcuda_obj + LINK_LIBRARIES PUBLIC CUDA::cusparse CUDA::cusolver + OUTPUT_NAME sundials_sunmatrixcusparse + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_CUSPARSE module") diff --git a/src/sunmatrix/dense/CMakeLists.txt b/src/sunmatrix/dense/CMakeLists.txt index e9e1b9ad85..83b3e993b1 100644 --- a/src/sunmatrix/dense/CMakeLists.txt +++ b/src/sunmatrix/dense/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_DENSE\n\")") # Add the sunmatrix_dense library -sundials_add_library(sundials_sunmatrixdense - SOURCES - sunmatrix_dense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_dense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixdense + SOURCES sunmatrix_dense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_dense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixdense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixdense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE module") diff --git a/src/sunmatrix/dense/fmod_int32/CMakeLists.txt b/src/sunmatrix/dense/fmod_int32/CMakeLists.txt index 987102b9f6..1bd612002e 100644 --- a/src/sunmatrix/dense/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/dense/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 dense SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixdense_mod - SOURCES - fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixdense_mod + SOURCES fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixdense_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixdense_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt index 6b11defa31..a4baea3b35 100644 --- a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 dense SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixdense_mod - SOURCES - fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixdense_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixdense_mod + SOURCES fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixdense_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/magmadense/CMakeLists.txt b/src/sunmatrix/magmadense/CMakeLists.txt index 07eb539943..256cb6b3ab 100644 --- a/src/sunmatrix/magmadense/CMakeLists.txt +++ b/src/sunmatrix/magmadense/CMakeLists.txt @@ -12,7 +12,9 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -install(CODE "MESSAGE(\"\nInstall SUNMATRIX_MAGMADENSE with ${SUNDIALS_MAGMA_BACKENDS} backend(s)\n\")") +install( + CODE "MESSAGE(\"\nInstall SUNMATRIX_MAGMADENSE with ${SUNDIALS_MAGMA_BACKENDS} backend(s)\n\")" +) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set_source_files_properties(sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CUDA) @@ -23,26 +25,20 @@ elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") endif() # Add the sunmatrix_magmadense library -sundials_add_library(sundials_sunmatrixmagmadense - SOURCES - sunmatrix_magmadense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_magmadense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixmagmadense + SOURCES sunmatrix_magmadense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_magmadense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - INCLUDE_DIRECTORIES - PUBLIC ${MAGMA_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC SUNDIALS::MAGMA ${_libs_needed} - OUTPUT_NAME - sundials_sunmatrixmagmadense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + INCLUDE_DIRECTORIES PUBLIC ${MAGMA_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC SUNDIALS::MAGMA ${_libs_needed} + OUTPUT_NAME sundials_sunmatrixmagmadense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) -message(STATUS "Added SUNMATRIX_MAGMADENSE module with ${SUNDIALS_MAGMA_BACKENDS} backend(s)") +message( + STATUS + "Added SUNMATRIX_MAGMADENSE module with ${SUNDIALS_MAGMA_BACKENDS} backend(s)" +) diff --git a/src/sunmatrix/onemkldense/CMakeLists.txt b/src/sunmatrix/onemkldense/CMakeLists.txt index c9547a8cf6..b6ab57855a 100644 --- a/src/sunmatrix/onemkldense/CMakeLists.txt +++ b/src/sunmatrix/onemkldense/CMakeLists.txt @@ -15,29 +15,18 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_ONEMKLDENSE\n\")") # Create the library -sundials_add_library(sundials_sunmatrixonemkldense - SOURCES - sunmatrix_onemkldense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_onemkldense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemsycl_obj - COMPILE_FEATURES - PUBLIC cxx_std_17 - INCLUDE_DIRECTORIES - PUBLIC ${MKL_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC MKL::MKL_DPCPP - OUTPUT_NAME - sundials_sunmatrixonemkldense - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_sunmatrixonemkldense + SOURCES sunmatrix_onemkldense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_onemkldense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemsycl_obj + COMPILE_FEATURES PUBLIC cxx_std_17 + INCLUDE_DIRECTORIES PUBLIC ${MKL_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC MKL::MKL_DPCPP + OUTPUT_NAME sundials_sunmatrixonemkldense + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added SUNMATRIX_ONEMKLDENSE module") diff --git a/src/sunmatrix/slunrloc/CMakeLists.txt b/src/sunmatrix/slunrloc/CMakeLists.txt index 73f9857870..7d49a136c8 100644 --- a/src/sunmatrix/slunrloc/CMakeLists.txt +++ b/src/sunmatrix/slunrloc/CMakeLists.txt @@ -21,27 +21,18 @@ set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER}) # Add the library -sundials_add_library(sundials_sunmatrixslunrloc - SOURCES - sunmatrix_slunrloc.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_slunrloc.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixslunrloc + SOURCES sunmatrix_slunrloc.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_slunrloc.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::SUPERLUDIST - $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,> - COMPILE_OPTIONS - PRIVATE ${_compile_options} - OUTPUT_NAME - sundials_sunmatrixslunrloc - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_VERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::SUPERLUDIST + $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,> + COMPILE_OPTIONS PRIVATE ${_compile_options} + OUTPUT_NAME sundials_sunmatrixslunrloc + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_VERSION}) message(STATUS "Added SUNMATRIX_SLUNRLOC module") diff --git a/src/sunmatrix/sparse/CMakeLists.txt b/src/sunmatrix/sparse/CMakeLists.txt index 3ca9363150..8795ae3cdf 100644 --- a/src/sunmatrix/sparse/CMakeLists.txt +++ b/src/sunmatrix/sparse/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_SPARSE\n\")") # Add the sunmatrix_sparse library -sundials_add_library(sundials_sunmatrixsparse - SOURCES - sunmatrix_sparse.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_sparse.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixsparse + SOURCES sunmatrix_sparse.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_sparse.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixsparse - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixsparse + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE module") diff --git a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt index 407bddff70..e9792d9e35 100644 --- a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 sparse SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixsparse_mod - SOURCES - fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixsparse_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixsparse_mod + SOURCES fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixsparse_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE F2003 interface") diff --git a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt index fb0ed79b4c..e7d02abf11 100644 --- a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 sparse SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixsparse_mod - SOURCES - fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixsparse_mod + SOURCES fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixsparse_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixsparse_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE F2003 interface") diff --git a/src/sunmemory/cuda/CMakeLists.txt b/src/sunmemory/cuda/CMakeLists.txt index bd20b95824..6dadcc8e4b 100644 --- a/src/sunmemory/cuda/CMakeLists.txt +++ b/src/sunmemory/cuda/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemcuda - SOURCES - sundials_cuda_memory.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_cuda.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunmemory - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemcuda + SOURCES sundials_cuda_memory.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_cuda.h + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunmemory + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/hip/CMakeLists.txt b/src/sunmemory/hip/CMakeLists.txt index 64c650dae3..eda739ebc6 100644 --- a/src/sunmemory/hip/CMakeLists.txt +++ b/src/sunmemory/hip/CMakeLists.txt @@ -13,15 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemhip - SOURCES - sundials_hip_memory.hip.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_hip.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE hip::device - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemhip + SOURCES sundials_hip_memory.hip.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_hip.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core PRIVATE hip::device + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/sycl/CMakeLists.txt b/src/sunmemory/sycl/CMakeLists.txt index b425e09745..46dd11eb4d 100644 --- a/src/sunmemory/sycl/CMakeLists.txt +++ b/src/sunmemory/sycl/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create library -sundials_add_library(sundials_sunmemsycl - SOURCES - sundials_sycl_memory.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_sycl.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemsycl + SOURCES sundials_sycl_memory.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_sycl.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/system/CMakeLists.txt b/src/sunmemory/system/CMakeLists.txt index 70157d78d8..d3368974a1 100644 --- a/src/sunmemory/system/CMakeLists.txt +++ b/src/sunmemory/system/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemsys - SOURCES - sundials_system_memory.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_system.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemsys + SOURCES sundials_system_memory.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_system.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIB_ONLY) diff --git a/src/sunnonlinsol/fixedpoint/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/CMakeLists.txt index 257fe8f97b..82821d35ce 100644 --- a/src/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNNONLINSOL_FIXEDPOINT\n\")") # Add the library -sundials_add_library(sundials_sunnonlinsolfixedpoint - SOURCES - sunnonlinsol_fixedpoint.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_fixedpoint.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolfixedpoint + SOURCES sunnonlinsol_fixedpoint.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_fixedpoint.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunnonlinsolfixedpoint - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunnonlinsolfixedpoint + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT module") diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt index bb2f0097b6..2b695d6ba3 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt @@ -15,18 +15,13 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod - SOURCES - fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunnonlinsolfixedpoint_mod + SOURCES fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunnonlinsolfixedpoint_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunnonlinsolfixedpoint_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT F2003 interface") diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt index 6e24d5269c..4b064101b2 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt @@ -15,17 +15,12 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod - SOURCES - fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunnonlinsolfixedpoint_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunnonlinsolfixedpoint_mod + SOURCES fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunnonlinsolfixedpoint_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT F2003 interface") diff --git a/src/sunnonlinsol/newton/CMakeLists.txt b/src/sunnonlinsol/newton/CMakeLists.txt index 718b026d3f..2664fe18e2 100644 --- a/src/sunnonlinsol/newton/CMakeLists.txt +++ b/src/sunnonlinsol/newton/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNNONLINSOL_NEWTON\n\")") # Add the library -sundials_add_library(sundials_sunnonlinsolnewton - SOURCES - sunnonlinsol_newton.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_newton.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolnewton + SOURCES sunnonlinsol_newton.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_newton.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunnonlinsolnewton - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunnonlinsolnewton + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON module") diff --git a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt index 883fac35ed..6851b86153 100644 --- a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt +++ b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt @@ -15,17 +15,12 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod - SOURCES - fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunnonlinsolnewton_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunnonlinsolnewton_mod + SOURCES fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunnonlinsolnewton_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON F2003 interface") diff --git a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt index 46be1ab585..25108f7457 100644 --- a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt +++ b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt @@ -15,18 +15,13 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod - SOURCES - fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunnonlinsolnewton_mod + SOURCES fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunnonlinsolnewton_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunnonlinsolnewton_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON F2003 interface") diff --git a/src/sunnonlinsol/petscsnes/CMakeLists.txt b/src/sunnonlinsol/petscsnes/CMakeLists.txt index 4334d0a654..909dbecad5 100644 --- a/src/sunnonlinsol/petscsnes/CMakeLists.txt +++ b/src/sunnonlinsol/petscsnes/CMakeLists.txt @@ -24,24 +24,16 @@ else() endif() # Create the library -sundials_add_library(sundials_sunnonlinsolpetscsnes - SOURCES - sunnonlinsol_petscsnes.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_petscsnes.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolpetscsnes + SOURCES sunnonlinsol_petscsnes.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_petscsnes.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_nvecpetsc SUNDIALS::PETSC - OUTPUT_NAME - sundials_sunnonlinsolpetscsnes - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_nvecpetsc SUNDIALS::PETSC + OUTPUT_NAME sundials_sunnonlinsolpetscsnes + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_PETSCSNES module") diff --git a/test/unit_tests/arkode/CMakeLists.txt b/test/unit_tests/arkode/CMakeLists.txt index 7c06a015f5..a758ab3131 100644 --- a/test/unit_tests/arkode/CMakeLists.txt +++ b/test/unit_tests/arkode/CMakeLists.txt @@ -32,4 +32,3 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE) add_subdirectory(F2003_serial) endif() - diff --git a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt index 90661c5a22..825141646a 100644 --- a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt @@ -15,11 +15,9 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;tasks\;args" -if (NOT SUNDIALS_PRECISION MATCHES "SINGLE") - set(unit_tests - "ark_test_heat2D_mri.cpp\;2\;0" - "ark_test_heat2D_mri.cpp\;4\;1" - ) +if(NOT SUNDIALS_PRECISION MATCHES "SINGLE") + set(unit_tests "ark_test_heat2D_mri.cpp\;2\;0" + "ark_test_heat2D_mri.cpp\;4\;1") endif() # Add the build and install targets for each test @@ -33,8 +31,8 @@ foreach(test_tuple ${unit_tests}) # 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 + # 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_target}) # test source files @@ -43,17 +41,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test_target} - MPI::MPI_CXX - sundials_arkode - sundials_nvecparallel - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} MPI::MPI_CXX sundials_arkode + sundials_nvecparallel ${EXE_EXTRA_LINK_LIBS}) endif() @@ -71,12 +66,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + 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} - ${diff_output}) + MPI_NPROCS ${number_of_tasks} ${diff_output}) endforeach() diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 0d2bc15460..c1f22fc6bc 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -16,33 +16,32 @@ # List of test tuples of the form "name\;args" set(unit_tests - "ark_test_analytic_sys_mri.cpp\;0" - "ark_test_analytic_sys_mri.cpp\;1" - "ark_test_dahlquist_ark.cpp\;0 -1 0" - "ark_test_dahlquist_ark.cpp\;0 0 0" - "ark_test_dahlquist_ark.cpp\;0 0 1" - "ark_test_dahlquist_ark.cpp\;0 1 0" - "ark_test_dahlquist_ark.cpp\;0 1 1" - "ark_test_dahlquist_ark.cpp\;1 -1 0" - "ark_test_dahlquist_ark.cpp\;1 0 0" - "ark_test_dahlquist_ark.cpp\;1 0 1" - "ark_test_dahlquist_ark.cpp\;1 1 0" - "ark_test_dahlquist_ark.cpp\;1 1 1" - "ark_test_dahlquist_ark.cpp\;2 -1 0" - "ark_test_dahlquist_ark.cpp\;2 0 0" - "ark_test_dahlquist_ark.cpp\;2 0 1" - "ark_test_dahlquist_ark.cpp\;2 1 0" - "ark_test_dahlquist_ark.cpp\;2 1 1" - "ark_test_dahlquist_erk.cpp\;-1" - "ark_test_dahlquist_erk.cpp\;0" - "ark_test_dahlquist_erk.cpp\;1" - "ark_test_dahlquist_mri.cpp\;-1" - "ark_test_dahlquist_mri.cpp\;0" - "ark_test_dahlquist_mri.cpp\;1" - "ark_test_butcher.cpp\;" - "ark_test_getjac.cpp\;" - "ark_test_getjac_mri.cpp\;" -) + "ark_test_analytic_sys_mri.cpp\;0" + "ark_test_analytic_sys_mri.cpp\;1" + "ark_test_dahlquist_ark.cpp\;0 -1 0" + "ark_test_dahlquist_ark.cpp\;0 0 0" + "ark_test_dahlquist_ark.cpp\;0 0 1" + "ark_test_dahlquist_ark.cpp\;0 1 0" + "ark_test_dahlquist_ark.cpp\;0 1 1" + "ark_test_dahlquist_ark.cpp\;1 -1 0" + "ark_test_dahlquist_ark.cpp\;1 0 0" + "ark_test_dahlquist_ark.cpp\;1 0 1" + "ark_test_dahlquist_ark.cpp\;1 1 0" + "ark_test_dahlquist_ark.cpp\;1 1 1" + "ark_test_dahlquist_ark.cpp\;2 -1 0" + "ark_test_dahlquist_ark.cpp\;2 0 0" + "ark_test_dahlquist_ark.cpp\;2 0 1" + "ark_test_dahlquist_ark.cpp\;2 1 0" + "ark_test_dahlquist_ark.cpp\;2 1 1" + "ark_test_dahlquist_erk.cpp\;-1" + "ark_test_dahlquist_erk.cpp\;0" + "ark_test_dahlquist_erk.cpp\;1" + "ark_test_dahlquist_mri.cpp\;-1" + "ark_test_dahlquist_mri.cpp\;0" + "ark_test_dahlquist_mri.cpp\;1" + "ark_test_butcher.cpp\;" + "ark_test_getjac.cpp\;" + "ark_test_getjac_mri.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -65,15 +64,16 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # 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. - target_link_libraries(${test_target} + target_link_libraries( + ${test_target} $<TARGET_OBJECTS:sundials_arkode_obj> sundials_sunmemsys_obj sundials_nvecserial_obj @@ -105,13 +105,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index 720e4e6019..6794a213b4 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -16,24 +16,23 @@ # List of test tuples of the form "name\;args" set(ARKODE_unit_tests - "ark_test_arkstepsetforcing\;1 0" - "ark_test_arkstepsetforcing\;1 1" - "ark_test_arkstepsetforcing\;1 2" - "ark_test_arkstepsetforcing\;1 3" - "ark_test_arkstepsetforcing\;1 4" - "ark_test_arkstepsetforcing\;1 5" - "ark_test_arkstepsetforcing\;1 3 2.0 10.0" - "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" - "ark_test_mass\;" - "ark_test_reset\;" - "ark_test_tstop\;" - ) + "ark_test_arkstepsetforcing\;1 0" + "ark_test_arkstepsetforcing\;1 1" + "ark_test_arkstepsetforcing\;1 2" + "ark_test_arkstepsetforcing\;1 3" + "ark_test_arkstepsetforcing\;1 4" + "ark_test_arkstepsetforcing\;1 5" + "ark_test_arkstepsetforcing\;1 3 2.0 10.0" + "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" + "ark_test_mass\;" + "ark_test_reset\;" + "ark_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${ARKODE_unit_tests}) @@ -42,8 +41,8 @@ foreach(test_tuple ${ARKODE_unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -52,15 +51,15 @@ foreach(test_tuple ${ARKODE_unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # 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. - target_link_libraries(${test} + target_link_libraries( + ${test} $<TARGET_OBJECTS:sundials_arkode_obj> sundials_sunmemsys_obj sundials_nvecserial_obj diff --git a/test/unit_tests/arkode/F2003_serial/CMakeLists.txt b/test/unit_tests/arkode/F2003_serial/CMakeLists.txt index 1125ac771d..ab48e3a4c3 100644 --- a/test/unit_tests/arkode/F2003_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/F2003_serial/CMakeLists.txt @@ -15,19 +15,16 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(ARKODE_unit_tests - "ark_test_table_f2003\;" - ) +set(ARKODE_unit_tests "ark_test_table_f2003\;") foreach(test_tuple ${ARKODE_unit_tests}) - # parse the test tuple list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -36,9 +33,7 @@ foreach(test_tuple ${ARKODE_unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # libraries to link against - target_link_libraries(${test} - sundials_farkode_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_farkode_mod ${EXE_EXTRA_LINK_LIBS}) endif() @@ -56,4 +51,3 @@ foreach(test_tuple ${ARKODE_unit_tests}) endforeach() message(STATUS "Added ARKODE F2003 serial unit tests") - diff --git a/test/unit_tests/arkode/gtest/CMakeLists.txt b/test/unit_tests/arkode/gtest/CMakeLists.txt index 0d6871f63b..071faee5c0 100644 --- a/test/unit_tests/arkode/gtest/CMakeLists.txt +++ b/test/unit_tests/arkode/gtest/CMakeLists.txt @@ -13,37 +13,31 @@ # include location of public and private header files add_executable(test_arkode_error_handling test_arkode_error_handling.cpp) -target_include_directories(test_arkode_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_arkode_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# 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. -target_link_libraries(test_arkode_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_arkode_obj> - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - sundials_sunadaptcontrollerimexgus_obj - sundials_sunadaptcontrollersoderlind_obj - ${EXE_EXTRA_LINK_LIBS} -) +# 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. +target_link_libraries( + test_arkode_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_arkode_obj> + sundials_sunmemsys_obj + sundials_nvecserial_obj + 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 -# that up from $<TARGET_OBJECTS:sundials_arkode_obj>. +# Tell CMake that we depend on the ARKODE library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_arkode_obj>. add_dependencies(test_arkode_error_handling sundials_arkode_obj) -target_link_libraries(test_arkode_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_arkode_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_arkode_error_handling) diff --git a/test/unit_tests/cvode/CMakeLists.txt b/test/unit_tests/cvode/CMakeLists.txt index b0ac9c4ad9..13c49d32f1 100644 --- a/test/unit_tests/cvode/CMakeLists.txt +++ b/test/unit_tests/cvode/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(C_serial) # C++ unit tests if(CXX_FOUND) add_subdirectory(CXX_serial) - if (SUNDIALS_TEST_ENABLE_GTEST) + if(SUNDIALS_TEST_ENABLE_GTEST) add_subdirectory(gtest) endif() endif() diff --git a/test/unit_tests/cvode/CXX_serial/CMakeLists.txt b/test/unit_tests/cvode/CXX_serial/CMakeLists.txt index 30a48464c5..9c5cec05b6 100644 --- a/test/unit_tests/cvode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/cvode/CXX_serial/CMakeLists.txt @@ -16,19 +16,18 @@ # List of test tuples of the form "name\;args" set(unit_tests - "cv_test_kpr.cpp\;" - "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "cv_test_kpr.cpp\;--eta_max_fs 2" - "cv_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" - "cv_test_kpr.cpp\;--eta_min_gs 2" - "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "cv_test_kpr.cpp\;--eta_min_ef 0.5" - "cv_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" - "cv_test_kpr.cpp\;--eta_cf 0.5" - "cv_test_kpr.cpp\;--dgmax_lsetup 0.0" - "cv_test_kpr.cpp\;--dgmax_jbad 1.0" - "cv_test_getjac.cpp\;" -) + "cv_test_kpr.cpp\;" + "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "cv_test_kpr.cpp\;--eta_max_fs 2" + "cv_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" + "cv_test_kpr.cpp\;--eta_min_gs 2" + "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "cv_test_kpr.cpp\;--eta_min_ef 0.5" + "cv_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" + "cv_test_kpr.cpp\;--eta_cf 0.5" + "cv_test_kpr.cpp\;--dgmax_lsetup 0.0" + "cv_test_kpr.cpp\;--dgmax_jbad 1.0" + "cv_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -51,16 +50,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -78,13 +75,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/cvode/C_serial/CMakeLists.txt b/test/unit_tests/cvode/C_serial/CMakeLists.txt index 2c9708d32c..cf406d87b7 100644 --- a/test/unit_tests/cvode/C_serial/CMakeLists.txt +++ b/test/unit_tests/cvode/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "cv_test_getuserdata\;" - "cv_test_tstop\;" - ) +set(unit_tests "cv_test_getuserdata\;" "cv_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/cvode/gtest/CMakeLists.txt b/test/unit_tests/cvode/gtest/CMakeLists.txt index df16114295..43574de435 100644 --- a/test/unit_tests/cvode/gtest/CMakeLists.txt +++ b/test/unit_tests/cvode/gtest/CMakeLists.txt @@ -13,40 +13,34 @@ # include location of public and private header files add_executable(test_cvode_error_handling test_cvode_error_handling.cpp) -target_include_directories(test_cvode_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_cvode_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_link_lib sundials_cvode_fused_stubs_obj) endif() -# We explicitly choose which object libraries to link to and link in the -# cvode objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_cvode_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_cvode_obj> - ${_fused_link_lib} - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the cvode +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_cvode_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_cvode_obj> + ${_fused_link_lib} + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the CVODE library since it does not pick -# that up from $<TARGET_OBJECTS:sundials_cvode_obj>. +# Tell CMake that we depend on the CVODE library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_cvode_obj>. add_dependencies(test_cvode_error_handling sundials_cvode_obj) -target_link_libraries(test_cvode_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_cvode_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_cvode_error_handling) diff --git a/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt b/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt index b6988e1e54..5c635050ef 100644 --- a/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt @@ -16,19 +16,18 @@ # List of test tuples of the form "name\;args" set(unit_tests - "cvs_test_kpr.cpp\;" - "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "cvs_test_kpr.cpp\;--eta_max_fs 2" - "cvs_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" - "cvs_test_kpr.cpp\;--eta_min_gs 2" - "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "cvs_test_kpr.cpp\;--eta_min_ef 0.5" - "cvs_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" - "cvs_test_kpr.cpp\;--eta_cf 0.5" - "cvs_test_kpr.cpp\;--dgmax_lsetup 0.0" - "cvs_test_kpr.cpp\;--dgmax_jbad 1.0" - "cvs_test_getjac.cpp\;" -) + "cvs_test_kpr.cpp\;" + "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "cvs_test_kpr.cpp\;--eta_max_fs 2" + "cvs_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" + "cvs_test_kpr.cpp\;--eta_min_gs 2" + "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "cvs_test_kpr.cpp\;--eta_min_ef 0.5" + "cvs_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" + "cvs_test_kpr.cpp\;--eta_cf 0.5" + "cvs_test_kpr.cpp\;--dgmax_lsetup 0.0" + "cvs_test_kpr.cpp\;--dgmax_jbad 1.0" + "cvs_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -51,16 +50,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_cvodes - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_cvodes sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -78,13 +75,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/cvodes/C_serial/CMakeLists.txt b/test/unit_tests/cvodes/C_serial/CMakeLists.txt index 1b0c39e951..cebc506bed 100644 --- a/test/unit_tests/cvodes/C_serial/CMakeLists.txt +++ b/test/unit_tests/cvodes/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "cvs_test_getuserdata\;" - "cvs_test_tstop\;" - ) +set(unit_tests "cvs_test_getuserdata\;" "cvs_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_cvodes - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_cvodes sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/cvodes/gtest/CMakeLists.txt b/test/unit_tests/cvodes/gtest/CMakeLists.txt index c3ccf0b7b4..92739e4f19 100644 --- a/test/unit_tests/cvodes/gtest/CMakeLists.txt +++ b/test/unit_tests/cvodes/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_cvodes_error_handling test_cvodes_error_handling.cpp) -target_include_directories(test_cvodes_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_cvodes_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# cvode objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_cvodes_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_cvodes_obj> - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the cvode +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_cvodes_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_cvodes_obj> + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the CVODE library since it does not pick -# that up from $<TARGET_OBJECTS:sundials_cvode_obj>. +# Tell CMake that we depend on the CVODE library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_cvode_obj>. add_dependencies(test_cvodes_error_handling sundials_cvodes_obj) -target_link_libraries(test_cvodes_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_cvodes_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_cvodes_error_handling) diff --git a/test/unit_tests/ida/CXX_serial/CMakeLists.txt b/test/unit_tests/ida/CXX_serial/CMakeLists.txt index f97d03edf3..503f525543 100644 --- a/test/unit_tests/ida/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/ida/CXX_serial/CMakeLists.txt @@ -16,16 +16,15 @@ # List of test tuples of the form "name\;args" set(unit_tests - "ida_test_kpr.cpp\;" - "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "ida_test_kpr.cpp\;--eta_max_fs 2" - "ida_test_kpr.cpp\;--eta_min 2" - "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "ida_test_kpr.cpp\;--eta_min_ef 0.5" - "ida_test_kpr.cpp\;--eta_cf 0.5" - "ida_test_kpr.cpp\;--dcj 0.9" - "ida_test_getjac.cpp\;" -) + "ida_test_kpr.cpp\;" + "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "ida_test_kpr.cpp\;--eta_max_fs 2" + "ida_test_kpr.cpp\;--eta_min 2" + "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "ida_test_kpr.cpp\;--eta_min_ef 0.5" + "ida_test_kpr.cpp\;--eta_cf 0.5" + "ida_test_kpr.cpp\;--dcj 0.9" + "ida_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -48,16 +47,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_ida - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_ida sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -75,13 +72,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/ida/C_serial/CMakeLists.txt b/test/unit_tests/ida/C_serial/CMakeLists.txt index a6bcb567c2..202a88fe58 100644 --- a/test/unit_tests/ida/C_serial/CMakeLists.txt +++ b/test/unit_tests/ida/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "ida_test_getuserdata\;" - "ida_test_tstop\;" - ) +set(unit_tests "ida_test_getuserdata\;" "ida_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_ida - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_ida sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/ida/gtest/CMakeLists.txt b/test/unit_tests/ida/gtest/CMakeLists.txt index cb57cde05f..38c5a3e92b 100644 --- a/test/unit_tests/ida/gtest/CMakeLists.txt +++ b/test/unit_tests/ida/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_ida_error_handling test_ida_error_handling.cpp) -target_include_directories(test_ida_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_ida_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# ida objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_ida_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_ida_obj> - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the ida +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_ida_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_ida_obj> + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the IDA library since it does not pick -# that up from $<TARGET_OBJECTS:sundials_ida_obj>. +# Tell CMake that we depend on the IDA library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_ida_obj>. add_dependencies(test_ida_error_handling sundials_ida_obj) -target_link_libraries(test_ida_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_ida_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_ida_error_handling) diff --git a/test/unit_tests/idas/CXX_serial/CMakeLists.txt b/test/unit_tests/idas/CXX_serial/CMakeLists.txt index 6aa818b999..6f1e59c892 100644 --- a/test/unit_tests/idas/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/idas/CXX_serial/CMakeLists.txt @@ -16,15 +16,14 @@ # List of test tuples of the form "name\;args" set(unit_tests - "idas_test_kpr.cpp\;" - "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "idas_test_kpr.cpp\;--eta_min 2" - "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "idas_test_kpr.cpp\;--eta_min_ef 0.5" - "idas_test_kpr.cpp\;--eta_cf 0.5" - "idas_test_kpr.cpp\;--dcj 0.9" - "idas_test_getjac.cpp\;" -) + "idas_test_kpr.cpp\;" + "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "idas_test_kpr.cpp\;--eta_min 2" + "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "idas_test_kpr.cpp\;--eta_min_ef 0.5" + "idas_test_kpr.cpp\;--eta_cf 0.5" + "idas_test_kpr.cpp\;--dcj 0.9" + "idas_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -47,16 +46,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_idas - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_idas sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -74,13 +71,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/idas/C_serial/CMakeLists.txt b/test/unit_tests/idas/C_serial/CMakeLists.txt index 1cef7d6e72..16f9384ee6 100644 --- a/test/unit_tests/idas/C_serial/CMakeLists.txt +++ b/test/unit_tests/idas/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "idas_test_getuserdata\;" - "idas_test_tstop\;" - ) +set(unit_tests "idas_test_getuserdata\;" "idas_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_idas - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_idas sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/idas/gtest/CMakeLists.txt b/test/unit_tests/idas/gtest/CMakeLists.txt index ac85d86b9b..8f6c0b292e 100644 --- a/test/unit_tests/idas/gtest/CMakeLists.txt +++ b/test/unit_tests/idas/gtest/CMakeLists.txt @@ -13,36 +13,29 @@ # include location of public and private header files add_executable(test_idas_error_handling test_idas_error_handling.cpp) -target_include_directories(test_idas_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_idas_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# ida objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_idas_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_idas_obj> - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the ida +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_idas_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_idas_obj> + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the IDA library since it does not pick -# that up from $<TARGET_OBJECTS:sundials_ida_obj>. +# Tell CMake that we depend on the IDA library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_ida_obj>. add_dependencies(test_idas_error_handling sundials_idas_obj) -target_link_libraries(test_idas_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_idas_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_idas_error_handling) - diff --git a/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt b/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt index 2ab550476c..f83ef171b7 100644 --- a/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt @@ -15,9 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "kin_test_getjac.cpp\;" -) +set(unit_tests "kin_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -40,16 +38,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_kinsol - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_kinsol sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -67,13 +63,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/kinsol/C_serial/CMakeLists.txt b/test/unit_tests/kinsol/C_serial/CMakeLists.txt index 9715b8e3e6..a3db85d254 100644 --- a/test/unit_tests/kinsol/C_serial/CMakeLists.txt +++ b/test/unit_tests/kinsol/C_serial/CMakeLists.txt @@ -15,9 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "kin_test_getuserdata\;" - ) +set(unit_tests "kin_test_getuserdata\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -26,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -36,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_kinsol - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_kinsol sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/kinsol/gtest/CMakeLists.txt b/test/unit_tests/kinsol/gtest/CMakeLists.txt index d620c6d05f..5b6d650402 100644 --- a/test/unit_tests/kinsol/gtest/CMakeLists.txt +++ b/test/unit_tests/kinsol/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_kinsol_error_handling test_kinsol_error_handling.cpp) -target_include_directories(test_kinsol_error_handling - PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_kinsol_error_handling + PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# KINSOL objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_kinsol_error_handling - PRIVATE - $<TARGET_OBJECTS:sundials_kinsol_obj> - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the KINSOL +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_kinsol_error_handling + PRIVATE $<TARGET_OBJECTS:sundials_kinsol_obj> + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the KINSOL library since it does not pick -# that up from $<TARGET_OBJECTS:sundials_kinsol_obj>. +# Tell CMake that we depend on the KINSOL library since it does not pick that up +# from $<TARGET_OBJECTS:sundials_kinsol_obj>. add_dependencies(test_kinsol_error_handling sundials_kinsol_obj) -target_link_libraries(test_kinsol_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_kinsol_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_kinsol_error_handling) diff --git a/test/unit_tests/profiling/CMakeLists.txt b/test/unit_tests/profiling/CMakeLists.txt index d3023f7f22..1403bbbefc 100644 --- a/test/unit_tests/profiling/CMakeLists.txt +++ b/test/unit_tests/profiling/CMakeLists.txt @@ -22,8 +22,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -32,15 +32,12 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_core - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_core ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/sundials/CMakeLists.txt b/test/unit_tests/sundials/CMakeLists.txt index d48c707f07..1883aa072b 100644 --- a/test/unit_tests/sundials/CMakeLists.txt +++ b/test/unit_tests/sundials/CMakeLists.txt @@ -13,8 +13,9 @@ if(SUNDIALS_ENABLE_ERROR_CHECKS) if(TARGET GTest::gtest_main AND TARGET GTest::gmock) add_executable(test_sundials_errors test_sundials_errors.cpp) - target_link_libraries(test_sundials_errors - PRIVATE sundials_core sundials_nvecserial GTest::gtest_main GTest::gmock) + target_link_libraries( + test_sundials_errors PRIVATE sundials_core sundials_nvecserial + GTest::gtest_main GTest::gmock) gtest_discover_tests(test_sundials_errors) endif() endif() diff --git a/test/unit_tests/sundials/reductions/CMakeLists.txt b/test/unit_tests/sundials/reductions/CMakeLists.txt index 70ca8a15a0..bee7ed7707 100644 --- a/test/unit_tests/sundials/reductions/CMakeLists.txt +++ b/test/unit_tests/sundials/reductions/CMakeLists.txt @@ -22,8 +22,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -32,10 +32,9 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against target_link_libraries(${test} ${EXE_EXTRA_LINK_LIBS}) diff --git a/test/unit_tests/sunmemory/CMakeLists.txt b/test/unit_tests/sunmemory/CMakeLists.txt index 2a399b5bce..aba5a544d7 100644 --- a/test/unit_tests/sunmemory/CMakeLists.txt +++ b/test/unit_tests/sunmemory/CMakeLists.txt @@ -23,4 +23,3 @@ endif() if(ENABLE_SYCL) add_subdirectory(sycl) endif() - diff --git a/test/unit_tests/sunmemory/cuda/CMakeLists.txt b/test/unit_tests/sunmemory/cuda/CMakeLists.txt index c66b570bf7..f8fc7f3643 100644 --- a/test/unit_tests/sunmemory/cuda/CMakeLists.txt +++ b/test/unit_tests/sunmemory/cuda/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemcuda_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemcuda_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Cuda units tests") - diff --git a/test/unit_tests/sunmemory/hip/CMakeLists.txt b/test/unit_tests/sunmemory/hip/CMakeLists.txt index 509a02d038..383417561c 100644 --- a/test/unit_tests/sunmemory/hip/CMakeLists.txt +++ b/test/unit_tests/sunmemory/hip/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemhip_obj hip::device ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemhip_obj + hip::device ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Hip units tests") - diff --git a/test/unit_tests/sunmemory/sycl/CMakeLists.txt b/test/unit_tests/sunmemory/sycl/CMakeLists.txt index 744bb95b7a..de3abc84e7 100644 --- a/test/unit_tests/sunmemory/sycl/CMakeLists.txt +++ b/test/unit_tests/sunmemory/sycl/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsycl_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsycl_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Sycl units tests") - diff --git a/test/unit_tests/sunmemory/sys/CMakeLists.txt b/test/unit_tests/sunmemory/sys/CMakeLists.txt index 8f11528123..3dc597c941 100644 --- a/test/unit_tests/sunmemory/sys/CMakeLists.txt +++ b/test/unit_tests/sunmemory/sys/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # 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}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsys_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsys_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Sys units tests") - From fe230801bdbe0a64813999713e0dfdf1bc8a345a Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 9 Jul 2024 09:40:56 -0700 Subject: [PATCH 085/137] Maintenance: update ignore revs (#540) Ignore recent revisions for Python and CMake formatting in git blame --- .git-blame-ignore-revs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 51ab03ac92..870b004be9 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,3 +4,7 @@ fab1cecb7d91cff53b31730af5d00ff154c3b6ce cc6960349aa92e2bcad9168a6dacff99b21c329c # Apply formatting to Fortran files 23581e8454955283139e551a7bcd1b85d8b7c77b +# Apply formatting to Python files +b578eabccd77b7642b04ddda9d8530f05890d1b4 +# Apply formatting to CMake files +c6b9a02f24a27081c471d63dfc524684a9f5a9e3 From eb010a0c087502cf7582f0af03f1218ecacad711 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:41:26 -0700 Subject: [PATCH 086/137] Build(deps): Bump docker/build-push-action from 6.0.2 to 6.3.0 (#539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.2 to 6.3.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/docker/build-push-action/releases">docker/build-push-action's releases</a>.</em></p> <blockquote> <h2>v6.3.0</h2> <ul> <li><code>DOCKER_BUILD_RECORD_UPLOAD</code> environment variable to enable/disable build record upload by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1172">docker/build-push-action#1172</a></li> <li><code>DOCKER_BUILD_NO_SUMMARY</code> has been deprecated. Set <code>DOCKER_BUILD_SUMMARY</code> to <code>false</code> instead by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1170">docker/build-push-action#1170</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1173">docker/build-push-action#1173</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.28.0 to 0.31.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1171">docker/build-push-action#1171</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1159">docker/build-push-action#1159</a> <a href="https://redirect.github.com/docker/build-push-action/pull/1169">docker/build-push-action#1169</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v6.2.0...v6.3.0">https://github.com/docker/build-push-action/compare/v6.2.0...v6.3.0</a></p> <h2>v6.2.0</h2> <ul> <li>Use default retention days for build export artifact by <a href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a href="https://redirect.github.com/docker/build-push-action/pull/1153">docker/build-push-action#1153</a></li> <li>Bump <code>@​docker/actions-toolkit</code> from 0.27.0 to 0.28.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1158">docker/build-push-action#1158</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v6.1.0...v6.2.0">https://github.com/docker/build-push-action/compare/v6.1.0...v6.2.0</a></p> <h2>v6.1.0</h2> <ul> <li>Bump <code>@​docker/actions-toolkit</code> from 0.26.2 to 0.27.0 in <a href="https://redirect.github.com/docker/build-push-action/pull/1149">docker/build-push-action#1149</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/docker/build-push-action/compare/v6.0.2...v6.1.0">https://github.com/docker/build-push-action/compare/v6.0.2...v6.1.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/docker/build-push-action/commit/1a162644f9a7e87d8f4b053101d1d9a712edc18c"><code>1a16264</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1172">#1172</a> from crazy-max/build-export-disable</li> <li><a href="https://github.com/docker/build-push-action/commit/9eea5481959e459ec651b7e822a59ca2589d7eeb"><code>9eea548</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/build-push-action/commit/11c2faaa9eaca329b60ac7e06d5b0a39bb83ceee"><code>11c2faa</code></a> rename DOCKER_BUILD_EXPORT_RETENTION_DAYS to DOCKER_BUILD_RECORD_RETENTION_DAYS</li> <li><a href="https://github.com/docker/build-push-action/commit/de2365af33b297214817371552545c663ca68972"><code>de2365a</code></a> opt to disable build record upload</li> <li><a href="https://github.com/docker/build-push-action/commit/bca5082da7f40c0685bc546726266df13a2f9f4b"><code>bca5082</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1173">#1173</a> from crazy-max/build-summary-env-change</li> <li><a href="https://github.com/docker/build-push-action/commit/e7aab408d9276621021be0d58bf5cc6eefc65a64"><code>e7aab40</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/build-push-action/commit/63eb7590c6ed8db55bbbcb073d24d65171303129"><code>63eb759</code></a> switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY</li> <li><a href="https://github.com/docker/build-push-action/commit/53ec48606f270c370d678a3fbd9ab27117ba8cfd"><code>53ec486</code></a> Merge pull request <a href="https://redirect.github.com/docker/build-push-action/issues/1171">#1171</a> from docker/dependabot/npm_and_yarn/docker/actions-t...</li> <li><a href="https://github.com/docker/build-push-action/commit/fe9d9f1d0c920806ce6c73b48d1b95bc542ccbbb"><code>fe9d9f1</code></a> chore: update generated content</li> <li><a href="https://github.com/docker/build-push-action/commit/ad37ba1ad00503d50aa7b3835d3ac83f4372c199"><code>ad37ba1</code></a> chore(deps): Bump <code>@​docker/actions-toolkit</code> from 0.30.0 to 0.31.0</li> <li>Additional commits viewable in <a href="https://github.com/docker/build-push-action/compare/v6.0.2...v6.3.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=6.0.2&new-version=6.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Cody Balos <balos1@llnl.gov> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index fe76443ae2..53a629aa3a 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -26,7 +26,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -56,7 +56,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/e4s-quarterly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 7f9fdd9e3e..a40af5b1b4 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -32,7 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml From e9a6d86a8b30c50c330e8836631dd1de7ccd5061 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 17 Jul 2024 07:48:02 +0800 Subject: [PATCH 087/137] Maintenance: Add codespell to check spelling (#544) Add codespell workflow to CI to check for common spelling errors --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- .github/workflows/check-spelling.yml | 44 +++++++++++++++++++ CHANGELOG.md | 8 ++-- CMakeLists.txt | 2 +- CODEOWNERS | 2 +- CONTRIBUTING.md | 2 +- .../kokkos/ParallelGrid.hpp | 4 +- .../kokkos/arkode_driver.cpp | 2 +- .../kokkos/check_retval.h | 2 +- .../advection_reaction_3D/kokkos/rhs3D.hpp | 2 +- .../raja/ParallelGrid.hpp | 4 +- .../raja/advection_reaction_3D.hpp | 2 +- .../raja/arkode_driver.cpp | 2 +- .../advection_reaction_3D/raja/check_retval.h | 2 +- benchmarks/diffusion_2D/diffusion_2D.cpp | 2 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 4 +- benchmarks/diffusion_2D/main_arkode.cpp | 4 +- benchmarks/diffusion_2D/main_cvode.cpp | 4 +- benchmarks/diffusion_2D/main_ida.cpp | 4 +- .../plot_nvector_performance_results.py | 2 +- .../plot_nvector_performance_speedup.py | 2 +- .../sycl/test_nvector_performance_sycl.cpp | 2 +- benchmarks/nvector/test_nvector_performance.h | 2 +- cmake/SundialsBuildOptionsPost.cmake | 2 +- cmake/SundialsBuildOptionsPre.cmake | 2 +- cmake/SundialsSetupCXX.cmake | 2 +- cmake/SundialsSetupCompilers.cmake | 4 +- cmake/SundialsSetupCuda.cmake | 2 +- cmake/tpl/FindMAGMA.cmake | 2 +- cmake/tpl/SundialsHypre.cmake | 4 +- cmake/tpl/SundialsLapack.cmake | 6 +-- doc/arkode/examples/source/c_serial.rst | 4 +- doc/arkode/examples/source/conf.py | 2 +- doc/arkode/guide/source/Mathematics.rst | 2 +- .../source/Usage/ARKStep/User_callable.rst | 4 +- .../guide/source/Usage/ARKStep/XBraid.rst | 10 ++--- .../source/Usage/ERKStep/User_callable.rst | 4 +- .../source/Usage/MRIStep/MRIStepCoupling.rst | 2 +- .../source/Usage/MRIStep/User_callable.rst | 6 +-- .../source/Usage/SPRKStep/User_callable.rst | 6 +-- .../guide/source/Usage/User_callable.rst | 4 +- doc/arkode/guide/source/conf.py | 2 +- .../source/sunlinsol/ARKODE_interface.rst | 2 +- .../source/sunnonlinsol/ARKODE_interface.rst | 12 ++--- doc/cvode/cv_ex_cuda.tex | 2 +- doc/cvode/cv_ex_intro.tex | 2 +- doc/cvode/cv_ex_parallel.tex | 2 +- doc/cvode/cv_ex_serial.tex | 6 +-- doc/cvode/cv_ex_tests.tex | 2 +- doc/cvode/guide/source/Constants.rst | 2 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvode/guide/source/Usage/index.rst | 24 +++++----- doc/cvode/guide/source/conf.py | 2 +- .../source/sunnonlinsol/CVODE_interface.rst | 2 +- doc/cvodes/cvs_ex_adj.tex | 4 +- doc/cvodes/cvs_ex_fwd.tex | 4 +- doc/cvodes/cvs_ex_intro.tex | 2 +- doc/cvodes/guide/source/Constants.rst | 8 ++-- doc/cvodes/guide/source/Introduction.rst | 6 +-- doc/cvodes/guide/source/Mathematics.rst | 4 +- doc/cvodes/guide/source/Usage/ADJ.rst | 24 +++++----- doc/cvodes/guide/source/Usage/FSA.rst | 6 +-- doc/cvodes/guide/source/Usage/SIM.rst | 24 +++++----- doc/cvodes/guide/source/conf.py | 2 +- .../source/sunnonlinsol/CVODES_interface.rst | 10 ++--- doc/ida/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Usage/index.rst | 22 +++++----- doc/ida/guide/source/conf.py | 2 +- .../source/sunnonlinsol/IDA_interface.rst | 4 +- doc/ida/ida_ex_fortran.tex | 2 +- doc/ida/ida_ex_serial.tex | 4 +- doc/ida/ida_ex_trilinos.tex | 2 +- doc/idas/guide/source/Introduction.rst | 4 +- doc/idas/guide/source/Usage/ADJ.rst | 8 ++-- doc/idas/guide/source/Usage/FSA.rst | 2 +- doc/idas/guide/source/Usage/SIM.rst | 24 +++++----- doc/idas/guide/source/conf.py | 2 +- .../source/sunnonlinsol/IDAS_interface.rst | 10 ++--- doc/idas/idas_ex_intro.tex | 2 +- doc/kinsol/guide/source/Usage/index.rst | 10 ++--- doc/kinsol/guide/source/conf.py | 2 +- doc/kinsol/kin_ex_c.tex | 6 +-- doc/kinsol/kin_ex_fortran.tex | 2 +- doc/shared/Changelog.rst | 8 ++-- doc/shared/nvectors/NVector_CUDA.rst | 10 ++--- doc/shared/nvectors/NVector_HIP.rst | 10 ++--- doc/shared/nvectors/NVector_MPIManyVector.rst | 2 +- doc/shared/nvectors/NVector_MPIPlusX.rst | 2 +- doc/shared/nvectors/NVector_ManyVector.rst | 2 +- doc/shared/nvectors/NVector_OpenMP.rst | 2 +- doc/shared/nvectors/NVector_Operations.rst | 2 +- doc/shared/nvectors/NVector_PETSc.rst | 2 +- doc/shared/nvectors/NVector_Trilinos.rst | 2 +- .../SUNAdaptController_Soderlind.rst | 4 +- doc/shared/sundials/Errors.rst | 36 +++++++-------- doc/shared/sundials/GPU.rst | 6 +-- doc/shared/sundials/Install.rst | 20 ++++----- doc/shared/sunlinsol/SUNLinSol_API.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst | 8 ++-- .../sunlinsol/SUNLinSol_SuperLUDIST.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst | 2 +- .../sunmatrix/SUNMatrix_Description.rst | 2 +- .../sunmatrix/SUNMatrix_KokkosDense.rst | 4 +- .../sunmemory/SUNMemory_Description.rst | 2 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 8 ++-- .../sunnonlinsol/SUNNonlinSol_PetscSNES.rst | 4 +- doc/sundials/ug.tex | 4 +- doc/superbuild/source/contributing/index.rst | 2 +- .../developers/appendix/GitCheatSheet.rst | 2 +- .../developers/getting_started/Workflow.rst | 6 +-- .../developers/style_guide/SourceCode.rst | 2 +- .../source/developers/testing/Answers.rst | 2 +- .../source/developers/testing/CI.rst | 4 +- .../arkode/CXX_parallel/ark_brusselator1D.h | 4 +- .../ark_brusselator1D_task_local_nls.cpp | 4 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 18 ++++---- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 8 ++-- examples/arkode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/arkode/CXX_parhyp/CMakeLists.txt | 2 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 14 +++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 12 ++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 12 ++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 12 ++--- examples/arkode/CXX_parhyp/plot_heat2D_p.py | 2 +- .../ark_advection_diffusion_reaction.cpp | 2 +- .../ark_advection_diffusion_reaction.hpp | 2 +- .../arkode/CXX_serial/ark_analytic_sys.cpp | 12 ++--- .../arkode/CXX_serial/ark_analytic_sys.out | 2 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 6 +-- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 2 +- examples/arkode/CXX_serial/plot_heat2D.py | 2 +- .../arkode/CXX_superludist/CMakeLists.txt | 2 +- .../ark_brusselator1D_FEM_sludist.cpp | 4 +- examples/arkode/CXX_xbraid/CMakeLists.txt | 2 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 14 +++--- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 10 ++--- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 8 ++-- examples/arkode/CXX_xbraid/plot_heat2D.py | 2 +- examples/arkode/C_manyvector/CMakeLists.txt | 2 +- .../C_manyvector/ark_brusselator1D_manyvec.c | 2 +- examples/arkode/C_openmp/CMakeLists.txt | 2 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 2 +- examples/arkode/C_openmpdev/CMakeLists.txt | 2 +- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 2 +- examples/arkode/C_parallel/CMakeLists.txt | 2 +- .../ark_brusselator1D_task_local_nls.c | 8 ++-- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 2 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 2 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 2 +- examples/arkode/C_petsc/ark_petsc_ex25.c | 2 +- examples/arkode/C_serial/CMakeLists.txt | 2 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 18 ++++---- examples/arkode/C_serial/ark_analytic.c | 24 +++++----- examples/arkode/C_serial/ark_analytic.out | 2 +- examples/arkode/C_serial/ark_analytic_mels.c | 30 ++++++------- .../arkode/C_serial/ark_analytic_mels.out | 2 +- .../arkode/C_serial/ark_analytic_nonlin.c | 2 +- examples/arkode/C_serial/ark_brusselator.c | 2 +- examples/arkode/C_serial/ark_brusselator1D.c | 2 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 4 +- .../C_serial/ark_brusselator1D_imexmri.c | 4 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 2 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 6 +-- examples/arkode/C_serial/ark_brusselator_fp.c | 2 +- .../arkode/C_serial/ark_brusselator_mri.c | 4 +- .../arkode/C_serial/ark_harmonic_symplectic.c | 2 +- examples/arkode/C_serial/ark_heat1D.c | 2 +- examples/arkode/C_serial/ark_kpr_mri.c | 4 +- .../arkode/C_serial/ark_onewaycouple_mri.c | 8 ++-- .../C_serial/ark_reaction_diffusion_mri.c | 4 +- examples/arkode/C_serial/ark_robertson.c | 4 +- .../C_serial/ark_robertson_constraints.c | 4 +- examples/arkode/C_serial/ark_robertson_root.c | 2 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 6 +-- examples/arkode/F2003_custom/CMakeLists.txt | 2 +- .../ark_analytic_complex_f2003.f90 | 8 ++-- examples/arkode/F2003_parallel/CMakeLists.txt | 4 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 18 ++++---- .../F2003_parallel/ark_heat2D_f2003.f90 | 2 +- examples/arkode/F2003_serial/CMakeLists.txt | 2 +- .../F2003_serial/ark_analytic_f2003.f90 | 8 ++-- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 2 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 4 +- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 2 +- examples/cvode/CXX_parallel/CMakeLists.txt | 2 +- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 8 ++-- examples/cvode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/cvode/CXX_parhyp/CMakeLists.txt | 2 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 14 +++--- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 12 ++--- examples/cvode/CXX_parhyp/plot_heat2D_p.py | 2 +- examples/cvode/CXX_serial/CMakeLists.txt | 2 +- examples/cvode/CXX_serial/cv_heat2D.cpp | 2 +- examples/cvode/CXX_serial/cv_heat2D.hpp | 4 +- examples/cvode/CXX_serial/plot_heat2D.py | 2 +- .../cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp | 2 +- examples/cvode/C_mpimanyvector/CMakeLists.txt | 2 +- .../cvDiurnal_kry_mpimanyvec.c | 2 +- examples/cvode/C_openmp/CMakeLists.txt | 2 +- examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c | 2 +- examples/cvode/C_openmpdev/CMakeLists.txt | 2 +- examples/cvode/F2003_parallel/CMakeLists.txt | 4 +- .../F2003_serial/cv_analytic_fp_f2003.f90 | 10 ++--- .../cv_analytic_sys_dns_f2003.f90 | 22 +++++----- .../cv_analytic_sys_dns_jac_f2003.f90 | 32 +++++++------- .../cv_analytic_sys_klu_f2003.f90 | 32 +++++++------- .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 2 +- .../F2003_serial/cv_diurnal_kry_f2003.f90 | 2 +- examples/cvode/cuda/CMakeLists.txt | 2 +- examples/cvode/cuda/cvAdvDiff_diag_cuda.cu | 2 +- .../cvRoberts_block_cusolversp_batchqr.cu | 6 +-- examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp | 2 +- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 4 +- examples/cvode/hip/cvAdvDiff_diag_hip.cpp | 2 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 4 +- examples/cvode/parallel/CMakeLists.txt | 2 +- examples/cvode/parallel/cvAdvDiff_diag_p.c | 2 +- examples/cvode/parallel/cvAdvDiff_non_p.c | 2 +- examples/cvode/parallel/cvDiurnal_kry_bbd_p.c | 2 +- examples/cvode/parallel/cvDiurnal_kry_p.c | 2 +- examples/cvode/parhyp/CMakeLists.txt | 2 +- examples/cvode/parhyp/cvAdvDiff_non_ph.c | 2 +- examples/cvode/petsc/cvAdvDiff_petsc.c | 2 +- examples/cvode/raja/CMakeLists.txt | 2 +- examples/cvode/serial/CMakeLists.txt | 2 +- examples/cvode/serial/cvAdvDiff_bnd.c | 2 +- examples/cvode/serial/cvAdvDiff_bndL.c | 2 +- examples/cvode/serial/cvAnalytic_mels.c | 30 ++++++------- examples/cvode/serial/cvAnalytic_mels.out | 2 +- examples/cvode/serial/cvDiurnal_kry.c | 4 +- examples/cvode/serial/cvDiurnal_kry_bp.c | 4 +- examples/cvode/serial/cvKrylovDemo_ls.c | 4 +- examples/cvode/serial/cvKrylovDemo_prec.c | 18 ++++---- examples/cvode/serial/cvParticle_dns.c | 2 +- examples/cvode/serial/cvRoberts_block_klu.c | 2 +- examples/cvode/serial/cvRoberts_dns.c | 2 +- .../cvode/serial/cvRoberts_dns_constraints.c | 2 +- examples/cvode/serial/cvRocket_dns.c | 2 +- examples/cvode/superludist/CMakeLists.txt | 2 +- .../cvode/superludist/cvAdvDiff_sludist.cpp | 2 +- examples/cvodes/C_openmp/CMakeLists.txt | 2 +- examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c | 2 +- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 2 +- .../F2003_serial/cvs_analytic_fp_f2003.f90 | 10 ++--- examples/cvodes/parallel/CMakeLists.txt | 2 +- examples/cvodes/parallel/README | 2 +- .../cvodes/parallel/cvsAdvDiff_ASAp_non_p.c | 4 +- .../cvodes/parallel/cvsAdvDiff_FSA_non_p.c | 2 +- examples/cvodes/parallel/cvsAdvDiff_non_p.c | 2 +- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.c | 2 +- examples/cvodes/parallel/cvsDiurnal_kry_p.c | 2 +- examples/cvodes/serial/CMakeLists.txt | 2 +- examples/cvodes/serial/README | 2 +- examples/cvodes/serial/cvsAdvDiff_bnd.c | 2 +- examples/cvodes/serial/cvsAdvDiff_bndL.c | 2 +- examples/cvodes/serial/cvsAnalytic_mels.c | 30 ++++++------- examples/cvodes/serial/cvsAnalytic_mels.out | 2 +- examples/cvodes/serial/cvsDiurnal_FSA_kry.c | 2 +- examples/cvodes/serial/cvsDiurnal_kry.c | 4 +- examples/cvodes/serial/cvsDiurnal_kry_bp.c | 4 +- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 10 ++--- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 10 ++--- examples/cvodes/serial/cvsKrylovDemo_ls.c | 2 +- examples/cvodes/serial/cvsKrylovDemo_prec.c | 18 ++++---- examples/cvodes/serial/cvsParticle_dns.c | 2 +- examples/cvodes/serial/cvsRoberts_ASAi_dns.c | 6 +-- .../serial/cvsRoberts_ASAi_dns_constraints.c | 6 +-- examples/cvodes/serial/cvsRoberts_ASAi_klu.c | 6 +-- examples/cvodes/serial/cvsRoberts_ASAi_sps.c | 6 +-- .../cvodes/serial/cvsRoberts_FSA_dns_Switch.c | 8 ++-- examples/cvodes/serial/cvsRoberts_dns.c | 2 +- .../serial/cvsRoberts_dns_constraints.c | 2 +- examples/ida/C_openmp/CMakeLists.txt | 2 +- examples/ida/C_openmp/idaFoodWeb_bnd_omp.c | 2 +- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 2 +- examples/ida/F2003_parallel/CMakeLists.txt | 4 +- examples/ida/cuda/CMakeLists.txt | 2 +- examples/ida/cuda/idaHeat2D_kry_cuda.cu | 4 +- examples/ida/mpicuda/CMakeLists.txt | 2 +- .../ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu | 4 +- examples/ida/mpiraja/CMakeLists.txt | 2 +- .../ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp | 4 +- examples/ida/parallel/CMakeLists.txt | 2 +- examples/ida/parallel/idaFoodWeb_kry_bbd_p.c | 2 +- examples/ida/parallel/idaFoodWeb_kry_p.c | 4 +- examples/ida/parallel/idaHeat2D_kry_p.c | 4 +- examples/ida/petsc/idaHeat2D_petsc_snes.c | 4 +- examples/ida/petsc/idaHeat2D_petsc_spgmr.c | 4 +- examples/ida/raja/CMakeLists.txt | 2 +- examples/ida/raja/idaHeat2D_kry_raja.cpp | 4 +- examples/ida/serial/CMakeLists.txt | 2 +- examples/ida/serial/idaFoodWeb_kry.c | 4 +- examples/ida/serial/idaHeat2D_kry.c | 2 +- examples/ida/serial/idaKrylovDemo_ls.c | 2 +- examples/ida/serial/idaRoberts_dns.c | 4 +- examples/ida/trilinos/CMakeLists.txt | 2 +- .../ida/trilinos/idaHeat2D_kry_p_tpetra.cpp | 8 ++-- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 8 ++-- examples/idas/C_openmp/CMakeLists.txt | 2 +- examples/idas/C_openmp/idasFoodWeb_bnd_omp.c | 2 +- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 2 +- examples/idas/parallel/CMakeLists.txt | 2 +- .../idas/parallel/idasBruss_ASAp_kry_bbd_p.c | 2 +- .../idas/parallel/idasBruss_FSA_kry_bbd_p.c | 4 +- examples/idas/parallel/idasBruss_kry_bbd_p.c | 4 +- .../idas/parallel/idasFoodWeb_kry_bbd_p.c | 2 +- examples/idas/parallel/idasFoodWeb_kry_p.c | 4 +- .../idas/parallel/idasHeat2D_FSA_kry_bbd_p.c | 2 +- examples/idas/parallel/idasHeat2D_kry_p.c | 4 +- examples/idas/serial/CMakeLists.txt | 2 +- examples/idas/serial/idasHeat2D_kry.c | 4 +- examples/idas/serial/idasHessian_ASA_FSA.c | 4 +- examples/idas/serial/idasKrylovDemo_ls.c | 2 +- examples/idas/serial/idasRoberts_ASAi_dns.c | 2 +- examples/idas/serial/idasRoberts_ASAi_klu.c | 2 +- examples/idas/serial/idasRoberts_ASAi_sps.c | 2 +- examples/idas/serial/idasRoberts_dns.c | 4 +- examples/kinsol/CUDA_mpi/CMakeLists.txt | 2 +- examples/kinsol/CUDA_mpi/README | 2 +- examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu | 6 +-- examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp | 4 +- examples/kinsol/CXX_parallel/CMakeLists.txt | 2 +- examples/kinsol/CXX_parallel/README | 2 +- examples/kinsol/CXX_parallel/kin_em_p.cpp | 6 +-- examples/kinsol/CXX_parallel/kin_em_p.hpp | 4 +- .../CXX_parallel/kin_heat2D_nonlin_p.cpp | 6 +-- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 6 +-- examples/kinsol/CXX_parhyp/CMakeLists.txt | 2 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 4 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 4 +- .../kin_heat2D_nonlin_hypre_pfmg.cpp | 4 +- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 6 +-- examples/kinsol/C_openmp/CMakeLists.txt | 2 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 4 +- examples/kinsol/parallel/CMakeLists.txt | 2 +- examples/kinsol/serial/CMakeLists.txt | 2 +- .../kinsol/serial/kinLaplace_picard_bnd.c | 2 +- .../kinsol/serial/kinLaplace_picard_kry.c | 2 +- examples/kinsol/serial/kinRoboKin_slu.c | 2 +- examples/nvector/C_openmp/CMakeLists.txt | 2 +- examples/nvector/cuda/CMakeLists.txt | 2 +- examples/nvector/hip/CMakeLists.txt | 2 +- examples/nvector/kokkos/CMakeLists.txt | 2 +- .../nvector/kokkos/test_nvector_kokkos.cpp | 2 +- examples/nvector/manyvector/CMakeLists.txt | 2 +- examples/nvector/mpicuda/CMakeLists.txt | 2 +- examples/nvector/mpimanyvector/CMakeLists.txt | 2 +- examples/nvector/mpiplusx/CMakeLists.txt | 2 +- examples/nvector/openmpdev/CMakeLists.txt | 2 +- examples/nvector/parhyp/CMakeLists.txt | 2 +- examples/nvector/petsc/CMakeLists.txt | 2 +- examples/nvector/pthreads/CMakeLists.txt | 2 +- examples/nvector/serial/CMakeLists.txt | 2 +- examples/nvector/sycl/test_nvector_sycl.cpp | 2 +- examples/nvector/test_nvector.c | 4 +- examples/nvector/trilinos/CMakeLists.txt | 2 +- .../trilinos/test_nvector_trilinos.cpp | 2 +- .../test_sunlinsol_cusolversp_batchqr.cu | 2 +- .../test_sunlinsol_onemkldense.cpp | 2 +- .../serial/test_fsunlinsol_pcg_mod_serial.f90 | 2 +- .../test_fsunlinsol_spbcgs_mod_serial.f90 | 2 +- .../test_fsunlinsol_spfgmr_mod_serial.f90 | 2 +- .../test_fsunlinsol_spgmr_mod_serial.f90 | 2 +- .../test_fsunlinsol_sptfqmr_mod_serial.f90 | 2 +- .../test_sunlinsol_superludist.cpp | 6 +-- examples/sunlinsol/test_sunlinsol.h | 2 +- examples/sunmatrix/dreadrb.c | 2 +- .../test_sunmatrix_onemkldense.cpp | 2 +- .../slunrloc/test_sunmatrix_slunrloc.cpp | 8 ++-- examples/sunmatrix/test_sunmatrix.c | 2 +- examples/sunmatrix/test_sunmatrix.f90 | 2 +- examples/sunmatrix/test_sunmatrix.h | 2 +- .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 2 +- .../templates/cmakelists_serial_F2003_ex.in | 4 +- include/arkode/arkode_bandpre.h | 2 +- include/cvode/cvode_bandpre.h | 2 +- include/cvodes/cvodes_bandpre.h | 2 +- include/sundials/priv/sundials_errors_impl.h | 16 +++---- .../sundials/priv/sundials_mpi_errors_impl.h | 8 ++-- include/sundials/sundials_base.hpp | 2 +- include/sundials/sundials_convertibleto.hpp | 2 +- include/sundials/sundials_cuda_policies.hpp | 2 +- include/sundials/sundials_errors.h | 2 +- include/sundials/sundials_hip_policies.hpp | 2 +- include/sundials/sundials_memory.h | 4 +- include/sundials/sundials_nvector.h | 2 +- include/sundials/sundials_sycl_policies.hpp | 2 +- include/sundials/sundials_xbraid.h | 2 +- include/sunlinsol/sunlinsol_ginkgo.hpp | 2 +- include/sunmatrix/sunmatrix_ginkgo.hpp | 2 +- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 2 +- scripts/spelling.sh | 19 ++++++++ src/arkode/arkode.c | 10 ++--- src/arkode/arkode_bandpre.c | 4 +- src/arkode/arkode_butcher.c | 2 +- src/arkode/arkode_butcher_erk.def | 2 +- src/arkode/arkode_impl.h | 4 +- src/arkode/arkode_io.c | 2 +- src/arkode/arkode_ls.c | 6 +-- src/arkode/arkode_ls_impl.h | 2 +- src/arkode/arkode_mri_tables.c | 2 +- src/arkode/arkode_mristep.c | 2 +- src/arkode/arkode_sprkstep.c | 2 +- src/arkode/xbraid/arkode_xbraid.c | 4 +- src/cvode/cvode.c | 6 +-- src/cvode/cvode_bandpre.c | 4 +- src/cvode/cvode_impl.h | 2 +- src/cvode/cvode_io.c | 4 +- src/cvode/cvode_ls.c | 4 +- src/cvode/cvode_ls_impl.h | 4 +- src/cvode/cvode_proj.c | 6 +-- src/cvodes/cvodea.c | 10 ++--- src/cvodes/cvodes.c | 32 +++++++------- src/cvodes/cvodes_bandpre.c | 4 +- src/cvodes/cvodes_impl.h | 9 ++-- src/cvodes/cvodes_io.c | 6 +-- src/cvodes/cvodes_ls.c | 4 +- src/cvodes/cvodes_ls_impl.h | 4 +- src/cvodes/cvodes_proj.c | 6 +-- src/ida/ida.c | 10 ++--- src/ida/ida_impl.h | 4 +- src/ida/ida_ls.c | 6 +-- src/ida/ida_ls_impl.h | 4 +- src/idas/idaa.c | 14 +++--- src/idas/idas.c | 38 ++++++++-------- src/idas/idas_bbdpre.c | 4 +- src/idas/idas_impl.h | 11 ++--- src/idas/idas_ls.c | 6 +-- src/idas/idas_ls_impl.h | 4 +- src/kinsol/kinsol.c | 8 ++-- src/kinsol/kinsol_ls.c | 6 +-- src/kinsol/kinsol_ls_impl.h | 4 +- src/nvector/openmpdev/nvector_openmpdev.c | 4 +- src/nvector/pthreads/nvector_pthreads.c | 2 +- src/sundials/sundials_logger_impl.h | 2 +- src/sundials/sundials_nvector.c | 4 +- src/sundials/sundials_sycl.h | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 2 +- .../onemkldense/sunlinsol_onemkldense.cpp | 16 +++---- src/sunlinsol/pcg/sunlinsol_pcg.c | 2 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 4 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 2 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 2 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 2 +- .../superludist/sunlinsol_superludist.c | 4 +- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 4 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 2 +- swig/nvector/fnvector_pthreads_mod.i | 2 +- test/answers | 2 +- test/config_cmake.py | 8 ++-- test/env/docker.sh | 2 +- test/jenkins/README.md | 2 +- test/testRunner | 6 +-- test/test_driver.sh | 14 +++--- test/test_install.py | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 4 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 8 ++-- .../ark_test_analytic_sys_mri_0.out | 2 +- .../ark_test_analytic_sys_mri_1.out | 2 +- .../arkode/C_serial/ark_test_reset.c | 4 +- 459 files changed, 1129 insertions(+), 1064 deletions(-) create mode 100644 .github/workflows/check-spelling.yml create mode 100755 scripts/spelling.sh diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 0000000000..8825e58b06 --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,44 @@ +name: Checks - spelling + +on: + pull_request: + workflow_dispatch: + +jobs: + spelling_check: + runs-on: ubuntu-latest + steps: + - name: Install python3-pip + run: | + sudo apt update + sudo apt install -y --no-install-recommends python3-pip + + - name: Install codespell + run: pip install codespell + + - name: Print codespell version + run: codespell --version + + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Run codespell + run: | + ./scripts/spelling.sh + + - name: Run git diff to see if anything changed + run: /usr/bin/git diff --name-only --exit-code + + - name: Run git diff if we failed + if: failure() + run: /usr/bin/git diff > spelling.patch + + - name: Archive diff as a patch if we failed + uses: actions/upload-artifact@v3 + if: failure() + with: + name: spelling.patch + path: | + ${{ github.workspace }}/spelling.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 3291523216..c77cdcbdfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1789,7 +1789,7 @@ update their code to set the corresponding `ops` structure member, `matvecsetup`, to `NULL`. The generic SUNMatrix API now defines error codes to be returned by SUNMatrix -operations. Operations which return an integer flag indiciating success/failure +operations. Operations which return an integer flag indicating success/failure may return different values than previously. A new SUNMatrix (and SUNLinearSolver) implementation was added to facilitate @@ -1901,7 +1901,7 @@ function signatures have been changed including MRIStepCreate which now takes an ARKStep memory structure for the fast integration as an input. The reinitialization functions `ERKStepReInit`, `ARKStepReInit`, and -`MRIStepReInit` have been updated to retain the minimum and maxiumum step +`MRIStepReInit` have been updated to retain the minimum and maximum step size values from before reinitialization rather than resetting them to the default values. @@ -1926,7 +1926,7 @@ being built. Fixed a memory leak in the PETSc `N_Vector` clone function. -Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +Fixed a memory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using the default nonlinear solver. Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in @@ -2638,7 +2638,7 @@ with sparse direct solvers. #### KINSOL -The Picard iteration return was chanegd to always return the newest iterate upon +The Picard iteration return was changed to always return the newest iterate upon success. A minor bug in the line search was fixed to prevent an infinite loop when the diff --git a/CMakeLists.txt b/CMakeLists.txt index 989c1d7f7d..61b164f678 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,7 @@ include(SundialsSetupCompilers) include(SundialsSetupTPLs) # =============================================================== -# Build options to be proccessed last +# Build options to be processed last # =============================================================== include(SundialsBuildOptionsPost) diff --git a/CODEOWNERS b/CODEOWNERS index 8d465ce4e5..e017386f2b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,6 +3,6 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -# globabl owners will be requested for review when someone +# global owners will be requested for review when someone # opens a pull request. * @balos1 @gardner48 @cswoodward @drreynolds diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4106e3738b..be273c77a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing to SUNDIALS -There are two primary ways of contributing to SUNDIALS. The first way is by particpating +There are two primary ways of contributing to SUNDIALS. The first way is by participating in the development of SUNDIALS directly through contributions of code to the primary [SUNDIALS repository](https://github.com/LLNL/sundials). This is the best way to contribute bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources diff --git a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp index 7bbf8743a7..78fafd71ad 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp @@ -72,7 +72,7 @@ class ParallelGrid public: // Constructor that creates a new ParallelGrid object. // [in] - the memory helper to use for allocating the MPI buffers - // [in,out] comm - on input, the overal MPI communicator, on output, the cartesian communicator + // [in,out] comm - on input, the overall MPI communicator, on output, the cartesian communicator // [in] a[] - an array of length 3 which defines the domain [a,b] // [in] b[] - an array of length 3 which defines the domain [a,b] // [in] npts[] - an array of length 3 which defines the number of mesh points in each dimension @@ -563,7 +563,7 @@ class ParallelGrid GLOBALINT nx, ny, nz; /* number of intervals globally */ int nxl, nyl, nzl; /* number of intervals locally */ - int npx, npy, npz; /* numner of processes */ + int npx, npy, npz; /* number of processes */ sunrealtype dx, dy, dz; /* mesh spacing */ sunrealtype ax, ay, az; /* domain in [a, b] */ sunrealtype bx, by, bz; diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 2001c2736a..4f606bd7bf 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -33,7 +33,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) diff --git a/benchmarks/advection_reaction_3D/kokkos/check_retval.h b/benchmarks/advection_reaction_3D/kokkos/check_retval.h index b72575c517..a64f816976 100644 --- a/benchmarks/advection_reaction_3D/kokkos/check_retval.h +++ b/benchmarks/advection_reaction_3D/kokkos/check_retval.h @@ -23,7 +23,7 @@ * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ static int check_retval(void* returnvalue, const char* funcname, int opt, int myid) { diff --git a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp index 0dee917835..ea714ecaeb 100644 --- a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp @@ -23,7 +23,7 @@ * --------------------------------------------------------------*/ /* Compute the advection term f(t,y) = -c (grad * y). This is done using - upwind 1st order finite differences. At present, only periodic boudary + upwind 1st order finite differences. At present, only periodic boundary conditions are supported, which are handled via MPI's Cartesian communicator (even for serial runs). */ static int Advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) diff --git a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp index e818194047..f234aa089a 100644 --- a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp @@ -45,7 +45,7 @@ class ParallelGrid public: // Constructor that creates a new ParallelGrid object. // [in] - the memory helper to use for allocating the MPI buffers - // [in,out] comm - on input, the overal MPI communicator, on output, the cartesian communicator + // [in,out] comm - on input, the overall MPI communicator, on output, the cartesian communicator // [in] a[] - an array of length 3 which defines the domain [a,b] // [in] b[] - an array of length 3 which defines the domain [a,b] // [in] npts[] - an array of length 3 which defines the number of mesh points in each dimension @@ -508,7 +508,7 @@ class ParallelGrid GLOBALINT nx, ny, nz; /* number of intervals globally */ int nxl, nyl, nzl; /* number of intervals locally */ - int npx, npy, npz; /* numner of processes */ + int npx, npy, npz; /* number of processes */ REAL dx, dy, dz; /* mesh spacing */ REAL ax, ay, az; /* domain in [a, b] */ REAL bx, by, bz; diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp index 8499be6f0b..2caa282af9 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp @@ -89,7 +89,7 @@ struct UserData N_Vector vmask; N_Vector wmask; - /* problem paramaters */ + /* problem parameters */ sunrealtype xmax; /* maximum x value */ sunrealtype A; /* concentration of species A */ sunrealtype B; /* w source rate */ diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 49dcc6d8cf..420c9d63c9 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -33,7 +33,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) diff --git a/benchmarks/advection_reaction_3D/raja/check_retval.h b/benchmarks/advection_reaction_3D/raja/check_retval.h index b72575c517..a64f816976 100644 --- a/benchmarks/advection_reaction_3D/raja/check_retval.h +++ b/benchmarks/advection_reaction_3D/raja/check_retval.h @@ -23,7 +23,7 @@ * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ static int check_retval(void* returnvalue, const char* funcname, int opt, int myid) { diff --git a/benchmarks/diffusion_2D/diffusion_2D.cpp b/benchmarks/diffusion_2D/diffusion_2D.cpp index bd18cf1dfb..2a64400938 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.cpp +++ b/benchmarks/diffusion_2D/diffusion_2D.cpp @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------------------- - * Shared implementaiton file for 2D diffusion benchmark problem + * Shared implementation file for 2D diffusion benchmark problem * ---------------------------------------------------------------------------*/ #include "diffusion_2D.hpp" diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index 1ebb3394aa..a27c004e63 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -159,7 +159,7 @@ struct UserData sunrealtype* Ssend = NULL; sunrealtype* Nsend = NULL; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -192,7 +192,7 @@ struct UserData struct UserOutput { - // Ouput variables + // Output variables int output = 1; // 0 = no output, 1 = stats output, 2 = output to disk int nout = 20; // number of output times N_Vector error = NULL; // error vector diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index c35bf9e9c7..39c6274a6e 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -329,7 +329,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -524,7 +524,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --fixedstep <step> : used fixed step size" << endl; diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index 71172e4ce9..47420cdc98 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -310,7 +310,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -479,7 +479,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --ls <cg|gmres|sludist> : linear solver" << endl; cout << " --lsinfo : output residual history" << endl; cout << " --liniters <iters> : max number of iterations" << endl; diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index 515256ddd9..ccd86c7ad5 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -305,7 +305,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -460,7 +460,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --ls <cg|gmres|sludist> : linear solver" << endl; cout << " --liniters <iters> : max number of iterations" << endl; cout << " --epslin <factor> : linear tolerance factor" << endl; diff --git a/benchmarks/nvector/plot_nvector_performance_results.py b/benchmarks/nvector/plot_nvector_performance_results.py index 55bb5ae32e..c5e9f69301 100755 --- a/benchmarks/nvector/plot_nvector_performance_results.py +++ b/benchmarks/nvector/plot_nvector_performance_results.py @@ -15,7 +15,7 @@ # This script plots the output from test_nector_performance_* and assumes: # 1. vector lengths are powers of two starting from 0, and # 2. output files are named: output_nelem_nvec_nsum_ntest_timing.txt -# where nelem is the number of elements in the vector, nvec is the nuber of +# where nelem is the number of elements in the vector, nvec is the number of # vectors, nsum is the number of sums, ntest is the number of tests, and timing # indicates if timing was enabled. # ----------------------------------------------------------------------------- diff --git a/benchmarks/nvector/plot_nvector_performance_speedup.py b/benchmarks/nvector/plot_nvector_performance_speedup.py index 623d716c01..baaaf43682 100755 --- a/benchmarks/nvector/plot_nvector_performance_speedup.py +++ b/benchmarks/nvector/plot_nvector_performance_speedup.py @@ -15,7 +15,7 @@ # This script plots the output from test_nector_performance_* and assumes: # 1. vector lengths are powers of two starting from 0, and # 2. output files are named: output_nelem_nvec_nsum_ntest_timing.txt -# where nelem is the number of elements in the vector, nvec is the nuber of +# where nelem is the number of elements in the vector, nvec is the number of # vectors, nsum is the number of sums, ntest is the number of tests, and timing # indicates if timing was enabled. # ----------------------------------------------------------------------------- diff --git a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp index 0691d036e4..52b12e966f 100644 --- a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp +++ b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) ? "Yes" : "No") << std::endl; - std::cout << " suports usm shared allocations? " + std::cout << " supports usm shared allocations? " << (dev.get_info<::sycl::info::device::usm_shared_allocations>() ? "Yes" : "No") diff --git a/benchmarks/nvector/test_nvector_performance.h b/benchmarks/nvector/test_nvector_performance.h index 23af102a8e..74528b749d 100644 --- a/benchmarks/nvector/test_nvector_performance.h +++ b/benchmarks/nvector/test_nvector_performance.h @@ -17,7 +17,7 @@ #include <math.h> -/* define constatnts */ +/* define constants */ #define NEG_ONE SUN_RCONST(-1.0) #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index 2bf6acd14f..e914eefd1f 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# SUNDIALS build options that are interepreted after all other +# SUNDIALS build options that are interpreted after all other # CMake configuration. # --------------------------------------------------------------- diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 048137ff2d..96e17ea087 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# SUNDIALS build options that are interepreted prior to any +# SUNDIALS build options that are interpreted prior to any # other CMake configuration. # --------------------------------------------------------------- diff --git a/cmake/SundialsSetupCXX.cmake b/cmake/SundialsSetupCXX.cmake index f4967f16cc..187e597d40 100644 --- a/cmake/SundialsSetupCXX.cmake +++ b/cmake/SundialsSetupCXX.cmake @@ -41,7 +41,7 @@ set(DOCSTR "Enable C++ compiler specific extensions") sundials_option(CMAKE_CXX_EXTENSIONS BOOL "${DOCSTR}" ON) message(STATUS "C++ extensions set to ${CMAKE_CXX_EXTENSIONS}") -# SYCL requries C++17 +# SYCL requires C++17 if(ENABLE_SYCL AND (CMAKE_CXX_STANDARD LESS "17")) message(SEND_ERROR "CMAKE_CXX_STANDARD must be >= 17 because ENABLE_SYCL=ON") endif() diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 797c743a3f..aad26bdaf7 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -21,12 +21,12 @@ include(SundialsIndexSize) # =============================================================== -# Platform specifc settings +# Platform specific settings # =============================================================== if(WIN32) # Under Windows, add compiler directive to inhibit warnings about use of - # unsecure functions. + # insecure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) # Under Windows, we need to have dll and exe files in the same directory to diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index 8a0703336b..ef01d0faba 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# Setup the CUDA languge and CUDA libraries. +# Setup the CUDA language and CUDA libraries. # --------------------------------------------------------------- # =============================================================== diff --git a/cmake/tpl/FindMAGMA.cmake b/cmake/tpl/FindMAGMA.cmake index 0d71560b72..f28780129f 100644 --- a/cmake/tpl/FindMAGMA.cmake +++ b/cmake/tpl/FindMAGMA.cmake @@ -97,7 +97,7 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) # Check if we need to find cusparse or cublas if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") # Replace cublas, cusparse with the CMake targets because the library - # path in the magma pkgconfig is not reliable. Sepcifically, the path + # path in the magma pkgconfig is not reliable. Specifically, the path # is wrong on systems like Perlmutter where the NVIDIA HPC SDK is # used. if(lib STREQUAL "-lcublas") diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake index 9d880d2562..12d7b550b1 100644 --- a/cmake/tpl/SundialsHypre.cmake +++ b/cmake/tpl/SundialsHypre.cmake @@ -37,12 +37,12 @@ endif() # ----------------------------------------------------------------------------- if(ENABLE_HYPRE) - # Using hypre requres building with MPI enabled + # Using hypre requires building with MPI enabled if(NOT ENABLE_MPI) message( FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") endif() - # Using hypre requres C99 or newer + # Using hypre requires C99 or newer if(CMAKE_C_STANDARD STREQUAL "90") message(SEND_ERROR "CMAKE_C_STANDARD must be >= c99 with ENABLE_HYPRE=ON") endif() diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index 74261bb469..ecc3e4475b 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ----------------------------------------------------------------------------- -# Module to find and setup LAPACK/BLAS corrrectly. +# Module to find and setup LAPACK/BLAS correctly. # Created from the SundialsTPL.cmake template. # All SUNDIALS modules that find and setup a TPL must: # @@ -160,8 +160,8 @@ if(NEED_FORTRAN_NAME_MANGLING) list(LENGTH options imax) set(iopt 0) - # We will attempt to sucessfully generate the "ctest1" executable as long as - # there still are entries in the "options" list + # We will attempt to successfully generate the "ctest1" executable as long + # as there still are entries in the "options" list while(${iopt} LESS ${imax}) # Get the current list entry (current scheme) list(GET options ${iopt} opt) diff --git a/doc/arkode/examples/source/c_serial.rst b/doc/arkode/examples/source/c_serial.rst index 4a9fce62cf..81d8b6b248 100644 --- a/doc/arkode/examples/source/c_serial.rst +++ b/doc/arkode/examples/source/c_serial.rst @@ -326,7 +326,7 @@ The problem implements the following testing scenario: :math:`u_0=1.2`, Numerical method ---------------- -This program solves the problem with the default thrid order method. +This program solves the problem with the default third order method. The problem is run using a fixed slow step size :math:`hs=0.025` and fast step size :math:`0.001`. @@ -854,7 +854,7 @@ is the product of two matrices: only a subset of the :math:`3\times3` blocks). Four different runs are made for this problem. The product -preconditoner is applied on the left and on the right. In each case, +preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt orthogonalization options are tested. In the series of runs, ``ARKodeInit``, ``SUNSPGMR``, ``ARKSpilsSetLinearSolver``, ``SUNSPGMRSetGSType``, diff --git a/doc/arkode/examples/source/conf.py b/doc/arkode/examples/source/conf.py index 826730c1f7..703861d658 100644 --- a/doc/arkode/examples/source/conf.py +++ b/doc/arkode/examples/source/conf.py @@ -442,7 +442,7 @@ texinfo_documents = [ ('index', 'ARKODE_example', u'ARKODE Example Documentation', u'Daniel R. Reynolds', 'ARKODE_example', - 'Example programs for the ARKODE time integration package for multi-rate systems of ordinary differntial equations.', + 'Example programs for the ARKODE time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index ddbd7c4122..9d9835c53d 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -548,7 +548,7 @@ can be ignored). Optionally, a different algorithm leveraging compensated summation can be used that is more robust to roundoff error at the expense of 2 extra vector operations per stage and an additional 5 per time step. It also requires one extra vector to -be stored. However, it is signficantly more robust to roundoff error accumulation +be stored. However, it is significantly more robust to roundoff error accumulation :cite:p:`Sof:02`. When compensated summation is enabled, the following incremental form is used to compute a time step: diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index a6c07ac5e6..5a21f7ea15 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -841,7 +841,7 @@ Optional inputs for ARKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ARKStepSetStopTime`). A stop time not reached before a call to :c:func:`ARKStepReInit` or @@ -886,7 +886,7 @@ Optional inputs for ARKStep * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ARKStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst index 665610283a..8245f0efc9 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst @@ -79,9 +79,9 @@ operations (e.g., computing vector sums or norms) as well as functions to initialize the problem state, access the current solution, and take a time step. The ARKBraid interface, built on the SUNBraidApp and SUNBraidVector structures, -provides all the functionaly needed combine ARKODE and XBraid for +provides all the functionality needed combine ARKODE and XBraid for parallel-in-time integration. As such, only a minimal number of changes are -necessary to update an exsting code that uses ARKODE to also use XBraid. +necessary to update an existing code that uses ARKODE to also use XBraid. @@ -123,7 +123,7 @@ Here, the SUNBraidOps structure is defined as typedef struct _SUNBraidOps *SUNBraidOps; The generic SUNBraidApp defines and implements the generic operations acting on -a SUNBraidApp obejct. These generic functions are nothing but wrappers to access +a SUNBraidApp object. These generic functions are nothing but wrappers to access the specific implementation through the object's operations structure. To illustrate this point we show below the implementation of the :c:func:`SUNBraidApp_GetVecTmpl()` function: @@ -876,7 +876,7 @@ A skeleton of the user's main program with XBraid In addition to the header files required for the integration of the ODE problem (see the section :numref:`ARKODE.Usage.Headers`), to use the ARKBraid -interace, the user's program must include the header file +interface, the user's program must include the header file ``arkode/arkode_xbraid.h`` which declares the needed function prototypes. The following is a skeleton of the user's main program (or calling program) for @@ -965,7 +965,7 @@ Advanced ARKBraid Utility Functions This section describes utility functions utilized in the ARKODE + XBraid interfacing. These functions are used internally by the above ARKBraid interface functions but are exposed to the user to assist in advanced usage of -ARKODE and XBraid that requries defining a custom SUNBraidApp implementation. +ARKODE and XBraid that requires defining a custom SUNBraidApp implementation. diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 017aa17110..5bbb3e1f63 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -625,7 +625,7 @@ Optional inputs for ERKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ERKStepSetStopTime`). A stop time not reached before a call to :c:func:`ERKStepReInit` or @@ -672,7 +672,7 @@ Optional inputs for ERKStep * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ERKStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst index 88fb32a748..53d5a8c7d5 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst @@ -24,7 +24,7 @@ supply a custom set of slow-to-fast time scale coupling coefficients by constructing a coupling table and attaching it with :c:func:`MRIStepSetCoupling`. The MRI coupling tables are stored in an :c:func:`MRIStepCoupling` object which is a pointer to a -:c:struct:`MRIStepCouplingMem` strucutre: +:c:struct:`MRIStepCouplingMem` structure: .. c:type:: MRIStepCouplingMem *MRIStepCoupling diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 95f13fb608..24e8497c04 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -303,7 +303,7 @@ Rootfinding initialization function *nrtfn = 0*. Rootfinding is only supported for the slow (outer) integrator and should not - be actived for the fast (inner) integrator. + be activated for the fast (inner) integrator. .. deprecated:: 6.1.0 @@ -676,7 +676,7 @@ Optional inputs for MRIStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`MRIStepSetStopTime`). A stop time not reached before a call to :c:func:`MRIStepReInit` or @@ -723,7 +723,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`MRIStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index d8f4dec8f9..14d45133d1 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -336,7 +336,7 @@ Optional inputs for SPRKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`SPRKStepSetStopTime`). A stop time not reached before a call to :c:func:`SPRKStepReInit` or @@ -359,7 +359,7 @@ Optional inputs for SPRKStep Disables the stop time set with :c:func:`SPRKStepSetStopTime`. - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`SPRKStepSetStopTime`. :param arkode_mem: pointer to the SPRKStep memory block. @@ -486,7 +486,7 @@ Optional inputs for IVP method selection This increases the computational cost by 2 extra vector operations per stage and an additional 5 per time step. It also requires one extra vector to be - stored. However, it is signficantly more robust to roundoff error + stored. However, it is significantly more robust to roundoff error accumulation. :param arkode_mem: pointer to the SPRKStep memory block. diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index fd9261eaa3..fd9b572382 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -1235,7 +1235,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ARKodeSetStopTime`). A stop time not reached before a call to ``*StepReInit`` or @@ -1271,7 +1271,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr .. note:: - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ARKodeSetStopTime`. .. versionadded:: 6.1.0 diff --git a/doc/arkode/guide/source/conf.py b/doc/arkode/guide/source/conf.py index a0817d416f..2975c7bd36 100644 --- a/doc/arkode/guide/source/conf.py +++ b/doc/arkode/guide/source/conf.py @@ -290,7 +290,7 @@ texinfo_documents = [ ('index', 'ARKODE', u'ARKODE Documentation', u'Daniel R. Reynolds, David J. Gardner, Carol S. Woodward, Rujeko Chinomona, and Cody J. Balos', 'ARKODE', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst index ea807ed00c..ab90aae357 100644 --- a/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst @@ -184,7 +184,7 @@ In certain instances, users may wish to provide a custom SUNLinSol implementation to ARKODE in order to leverage the structure of a problem. While the "standard" API for these routines is typically sufficient for most users, others may need additional ARKODE-specific information on top of what is -provided. For these purposes, we note the following advanced ouptut functions +provided. For these purposes, we note the following advanced output functions available in ARKStep and MRIStep: diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index 92046f510c..5d0f0b02f3 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -141,7 +141,7 @@ of user-supplied SUNNonlinSol modules are as follows. This is only compatible with time-stepping modules that support implicit algebraic solvers. - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -150,7 +150,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`ARKodeGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKODE (through @@ -259,7 +259,7 @@ of user-supplied SUNNonlinSol modules are as follows. .. note:: - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -268,7 +268,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`ARKStepGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKStep (through @@ -362,7 +362,7 @@ of user-supplied SUNNonlinSol modules are as follows. .. note:: - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn()`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -371,7 +371,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`MRIStepGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by MRIStep (through diff --git a/doc/cvode/cv_ex_cuda.tex b/doc/cvode/cv_ex_cuda.tex index 26578e73d2..c6a0e0645a 100644 --- a/doc/cvode/cv_ex_cuda.tex +++ b/doc/cvode/cv_ex_cuda.tex @@ -28,7 +28,7 @@ \subsection{An unpreconditioned Krylov example: cvAdvDiff\_kry\_cuda}\label{ss:c model at the device. In the example, model right hand side and Jacobian-vector product are implemented as {\cuda} kernels \id{fKernel} and \id{jtvKernel}, respectively. User provided {\CC} functions \id{f} and \id{jtv}, which are called -directly by {\cvode}, set thread partitioning and launch thier respective +directly by {\cvode}, set thread partitioning and launch their respective {\cuda} kernels. Vector data on the device is accessed using \id{N\_VGetDeviceArrayPointer\_Cuda} function. diff --git a/doc/cvode/cv_ex_intro.tex b/doc/cvode/cv_ex_intro.tex index e761486efd..efd01e2b72 100644 --- a/doc/cvode/cv_ex_intro.tex +++ b/doc/cvode/cv_ex_intro.tex @@ -121,7 +121,7 @@ \section{Introduction}\label{s:ex_intro} interaction terms only, using block-grouping. \newline Four different runs are made for this problem. - The product preconditoner is applied on the left and on the right. + The product preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt options are tested. \item \id{cvHeat2D\_klu} solves a discretized 2D heat equation using diff --git a/doc/cvode/cv_ex_parallel.tex b/doc/cvode/cv_ex_parallel.tex index 146df50eba..d2a5102456 100644 --- a/doc/cvode/cv_ex_parallel.tex +++ b/doc/cvode/cv_ex_parallel.tex @@ -149,7 +149,7 @@ \subsection{A user preconditioner example: cvDiurnal\_kry\_p}\label{ss:cvDiurnal iteration and {\spgmr}. The left preconditioner is the block-diagonal part of the Newton matrix, with $2 \times 2$ blocks, and the corresponding diagonal blocks of the Jacobian are saved each time the -preconditioner is generated, for re-use later under certain conditions. +preconditioner is generated, for reuse later under certain conditions. The organization of the \id{cvDiurnal\_kry\_p} program deserves some comments. The right-hand side routine \id{f} calls two other routines: \id{ucomm}, which diff --git a/doc/cvode/cv_ex_serial.tex b/doc/cvode/cv_ex_serial.tex index 35d62d5f79..4e48db6c25 100644 --- a/doc/cvode/cv_ex_serial.tex +++ b/doc/cvode/cv_ex_serial.tex @@ -79,7 +79,7 @@ \subsection{A dense example: cvRoberts\_dns}\label{ss:cvRoberts} \id{SUNLinearSolver}. The next several lines allocate memory for the \id{y} and \id{abstol} vectors using \id{N\_VNew\_Serial} with a length argument of \id{NEQ} ($= 3$). The -lines following that load the initial values of the dependendent +lines following that load the initial values of the dependent variable vector into \id{y} and the absolute tolerances into \id{abstol} using the \id{Ith} macro. @@ -492,14 +492,14 @@ \subsection{A Krylov example: cvDiurnal\_kry}\label{ss:cvDiurnal} to allocate space for $J_{bd}$, $P$, and the pivot arrays; \id{InitUserData} to load problem constants in the \id{data} block; \id{FreeUserData} to free that block; \id{SetInitialProfiles} to load the initial values in \id{y}; -\id{PrintOutput} to retreive and print selected solution values and +\id{PrintOutput} to retrieve and print selected solution values and statistics; \id{PrintFinalStats} to print statistics; and \id{check\_flag} to check return values for error conditions. The output generated by \id{cvDiurnal\_kry.c} is shown below. Note that the number of preconditioner evaluations, \id{npe}, is much smaller than the number of preconditioner setups, \id{nsetups}, as a result of the -Jacobian re-use scheme. +Jacobian reuse scheme. %% \includeOutput{cvDiurnal\_dns}{../../examples/cvode/serial/cvDiurnal_kry.out} diff --git a/doc/cvode/cv_ex_tests.tex b/doc/cvode/cv_ex_tests.tex index 8b747c2ff9..177da0e766 100644 --- a/doc/cvode/cv_ex_tests.tex +++ b/doc/cvode/cv_ex_tests.tex @@ -94,7 +94,7 @@ \section{Parallel tests}\label{s:ex_tests} grows. This means that the highly portable MPI version of {\cvode}, with an appropriate choice of MPI implementation, is fully competitive with the Cray-specific version using the SHMEM library. While the overall costs do -not prepresent a well-scaled parallel algorithm (because of the +not represent a well-scaled parallel algorithm (because of the preconditioner choice), the cost per function evaluation is quite flat for EPCC and SHMEM, at .033 to .037 (for MPICH it ranges from .044 to .068). diff --git a/doc/cvode/guide/source/Constants.rst b/doc/cvode/guide/source/Constants.rst index bf2a8a40d5..ebb0971921 100644 --- a/doc/cvode/guide/source/Constants.rst +++ b/doc/cvode/guide/source/Constants.rst @@ -84,7 +84,7 @@ the CVODE output constants. +----------------------------+-----+----------------------------------------------------------------------------------------+ | ``CV_FIRST_RHSFUNC_ERR`` | -9 | The right-hand side function failed at the first call. | +----------------------------+-----+----------------------------------------------------------------------------------------+ - | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repetead recoverable errors. | + | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repeated recoverable errors. | +----------------------------+-----+----------------------------------------------------------------------------------------+ | ``CV_UNREC_RHSFUNC_ERR`` | -11 | The right-hand side function had a recoverable error, but no recovery is possible. | +----------------------------+-----+----------------------------------------------------------------------------------------+ diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 651efba809..ba5bd22a84 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -47,7 +47,7 @@ and VODPK have been combined in the C-language package CVODE :cite:p:`CoHi:96`. At present, CVODE may utilize a variety of Krylov methods provided -in SUNDIALS that can be used in conjuction with Newton iteration: +in SUNDIALS that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 722e20533e..3c56d48587 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -440,7 +440,7 @@ makes no sense (and is overly costly) after ``y[i]`` is below some noise level. ``abstol`` (if scalar) or ``abstol[i]`` (if a vector) needs to be set to that noise level. If the different components have different noise levels, then ``abstol`` should be a vector. See the example ``cvsRoberts_dns`` in the CVODE package, and the discussion of it in the CVODE Examples document -:cite:p:`cvodes_ex`. In that problem, the three components vary betwen 0 and 1, +:cite:p:`cvodes_ex`. In that problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as to what those @@ -764,7 +764,7 @@ rootfinding. In the ``CV_ONE_STEP`` mode, ``tout`` is used only on the first call, and only to get the direction and a rough scale of the independent variable. - If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). All failure return values are negative and so the test ``flag < 0`` will trap all ``CVode`` failures. @@ -909,7 +909,7 @@ Main solver optional input functions **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``nst`` -- number of successful steps inbetween calls to the monitor function 0 by default; a 0 input will turn off monitoring. + * ``nst`` -- number of successful steps in between calls to the monitor function 0 by default; a 0 input will turn off monitoring. **Return value:** * ``CV_SUCCESS`` -- The optional value has been successfully set. @@ -1051,7 +1051,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. - Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. @@ -1084,7 +1084,7 @@ Main solver optional input functions * ``CV_MEM_NULL`` if the CVODE memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`CVodeSetStopTime`. .. versionadded:: 6.5.1 @@ -2627,7 +2627,7 @@ described next. The values returned in ``ele`` are valid only if :c:func:`CVode` returned a non-negative value. - The ``ele`` vector, togther with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. @@ -3145,7 +3145,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** - * ``CVDIAG_SUCCESS`` -- The optional output valus have been successfully set. + * ``CVDIAG_SUCCESS`` -- The optional output values have been successfully set. * ``CVDIAG_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. @@ -3232,7 +3232,7 @@ known, simply make that location a value of tout. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the RHS function *not* incorporate the discontinuity, but rather have a smooth -extention over the discontinuity, so that the step across it (and +extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the RHS function (communicated through ``user_data``) that can be flipped between the stopping of the integration and the restart, so that @@ -3383,7 +3383,7 @@ These weights will be used in place of those defined by Eq. .. warning:: - The error weight vector must have all components positive. It is the user's responsiblity to perform this test and return -1 if it is not satisfied. + The error weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it is not satisfied. .. _CVODE.Usage.CC.user_fct_sim.rootFn: @@ -3406,7 +3406,7 @@ follows: * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. **Return value:** - A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occured (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. + A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occurred (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. **Notes:** Allocation of memory for ``gout`` is automatically handled within CVODE. @@ -3429,7 +3429,7 @@ user-defined projection operation the projection function must have type * ``t`` -- the current value of the independent variable. * ``ycur`` -- the current value of the dependent variable vector :math:`y(t)`. * ``corr`` -- the correction, :math:`c`, to the dependent variable vector so that :math:`y(t) + c` satisfies the constraint equation. - * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrainted least squares problem. + * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrained least squares problem. * ``err`` -- is on input the current error estimate, if error projection is enabled (the default) then this should be overwritten with the projected error on output. If error projection is disabled then ``err`` is ``NULL``. * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. @@ -3934,7 +3934,7 @@ the CVBANDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwBP`` -- the number of ``sunrealtype`` values in teh CVBANDPRE workspace. + * ``lenrwBP`` -- the number of ``sunrealtype`` values in the CVBANDPRE workspace. * ``leniwBP`` -- the number of integer values in the CVBANDPRE workspace. **Return value:** diff --git a/doc/cvode/guide/source/conf.py b/doc/cvode/guide/source/conf.py index 3d86ad65cb..4377102f1e 100644 --- a/doc/cvode/guide/source/conf.py +++ b/doc/cvode/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'CVODE', u'CVODE Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'CVODE', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst index be0259cf57..4300c48f3f 100644 --- a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst +++ b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst @@ -111,7 +111,7 @@ might need access to the current value of :math:`\gamma` to compute Jacobian dat custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemData` inside the - nonlinear system function to access the requisite data for evaluting + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` diff --git a/doc/cvodes/cvs_ex_adj.tex b/doc/cvodes/cvs_ex_adj.tex index 00269acf6f..e7b6fc8ebb 100644 --- a/doc/cvodes/cvs_ex_adj.tex +++ b/doc/cvodes/cvs_ex_adj.tex @@ -132,7 +132,7 @@ \subsection{A serial dense example: cvsRoberts\_ASAi\_dns}\label{ss:cvsRoberts_A checkpoint information printed). The next segment of code deals with the setup of the backward problem. -First, a serial vector \id{yB} of length \id{NEQ} is allocated and initalized with the +First, a serial vector \id{yB} of length \id{NEQ} is allocated and initialized with the value of $\lambda (= 0.0)$ at the final time (\id{TB1} = 4.0E7). A second serial vector \id{qB} of dimension \id{NP} is created and initialized to $0.0$. This vector corresponds to the quadrature variables $\xi$ whose values at $t_0$ @@ -415,7 +415,7 @@ \subsection{A parallel example using CVBBDPRE: cvsAtmDisp\_ASAi\_kry\_bbd\_p} \id{f\_comm}, called in \id{f} and \id{fB} before evaluation of the local residual components. Since there is no additional communication required for the {\cvbbdpre} preconditioner, a \id{NULL} pointer is passed for \id{gloc} and \id{glocB} in the -calls to \id{CVBBDPrecInit} and \id{CVBBDPrecInitB}, respectivley. +calls to \id{CVBBDPrecInit} and \id{CVBBDPrecInitB}, respectively. For the sake of clarity, the \id{cvsAtmDisp\_ASAi\_kry\_bbd\_p} example does not use the most memory-efficient implementation possible, as the local segment of the diff --git a/doc/cvodes/cvs_ex_fwd.tex b/doc/cvodes/cvs_ex_fwd.tex index ec8f23fa9e..6c1d8f8803 100644 --- a/doc/cvodes/cvs_ex_fwd.tex +++ b/doc/cvodes/cvs_ex_fwd.tex @@ -252,7 +252,7 @@ \subsection{A serial dense example: cvsRoberts\_FSA\_dns} \id{pbar} (\id{pbar}$_i$ = \id{p}$_i$, which can typically be used for nonzero model parameters). Next, the program allocates memory for \id{yS}, by calling the {\nvecs} function -\id{N\_VCloneVectorArray\_Serial}, and initializaes all sensitivity variables to $0.0$. +\id{N\_VCloneVectorArray\_Serial}, and initializes all sensitivity variables to $0.0$. The call to \id{CVodeSensInit1} specifies the sensitivity solution method through the argument \id{sensi\_meth} (read from the command @@ -290,7 +290,7 @@ \subsection{A serial dense example: cvsRoberts\_FSA\_dns} The user-supplied functions \id{f} (for the right-hand side of the original ODEs) and \id{Jac} (for the system Jacobian) are identical to those in \id{cvRoberts\_dns.c}, -with the notable exeption that model parameters are extracted from the user-defined +with the notable exception that model parameters are extracted from the user-defined data structure \id{data}, which must first be cast to the \id{UserData} type. Similarly, the user-supplied function \id{ewt} is identical to that in \id{cvRoberts\_dns\_uw.c}. The user-supplied function \id{fS} computes the diff --git a/doc/cvodes/cvs_ex_intro.tex b/doc/cvodes/cvs_ex_intro.tex index 6ac7624626..efa1a58264 100644 --- a/doc/cvodes/cvs_ex_intro.tex +++ b/doc/cvodes/cvs_ex_intro.tex @@ -167,7 +167,7 @@ \section{Introduction}\label{s:ex_intro} interaction terms only, using block-grouping. \newline Four different runs are made for this problem. - The product preconditoner is applied on the left and on the right. + The product preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt options are tested. diff --git a/doc/cvodes/guide/source/Constants.rst b/doc/cvodes/guide/source/Constants.rst index cbd469ad51..4be7173ac0 100644 --- a/doc/cvodes/guide/source/Constants.rst +++ b/doc/cvodes/guide/source/Constants.rst @@ -137,7 +137,7 @@ CVODES output constants | ``CV_FIRST_RHSFUNC_ERR`` | -9 | The right-hand side function failed at the first | | | | call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repetead | + | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_RHSFUNC_ERR`` | -11 | The right-hand side function had a recoverable | @@ -180,7 +180,7 @@ CVODES output constants | ``CV_FIRST_QRHSFUNC_ERR`` | -32 | The quadrature right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_QRHSFUNC_ERR`` | -33 | The quadrature ight-hand side function had repetead | + | ``CV_REPTD_QRHSFUNC_ERR`` | -33 | The quadrature ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_QRHSFUNC_ERR`` | -34 | The quadrature right-hand side function had a | @@ -194,7 +194,7 @@ CVODES output constants | ``CV_FIRST_SRHSFUNC_ERR`` | -42 | The sensitivity right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_SRHSFUNC_ERR`` | -43 | The sensitivity ight-hand side function had repetead | + | ``CV_REPTD_SRHSFUNC_ERR`` | -43 | The sensitivity ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_SRHSFUNC_ERR`` | -44 | The sensitivity right-hand side function had a | @@ -211,7 +211,7 @@ CVODES output constants | ``CV_FIRST_QSRHSFUNC_ERR`` | -52 | The sensitivity right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_QSRHSFUNC_ERR`` | -53 | The sensitivity ight-hand side function had repetead | + | ``CV_REPTD_QSRHSFUNC_ERR`` | -53 | The sensitivity ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_QSRHSFUNC_ERR`` | -54 | The sensitivity right-hand side function had a | diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index fbf0685067..419fd7ee20 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -46,7 +46,7 @@ capabilities of both VODE and VODPK have been combined in the C-language package CVODE :cite:p:`CoHi:96`. At present, CVODE may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) @@ -77,7 +77,7 @@ resulting in PVODE :cite:p:`ByHi:99`, the parallel variant of CVODE. CVODES is written with a functionality that is a superset of that of the pair CVODE/PVODE. Sensitivity analysis capabilities, both forward and adjoint, have -been added to the main integrator. Enabling forward sensititivity computations +been added to the main integrator. Enabling forward sensitivity computations in CVODES will result in the code integrating the so-called *sensitivity equations* simultaneously with the original IVP, yielding both the solution and its sensitivity with respect to parameters in the model. Adjoint sensitivity @@ -181,7 +181,7 @@ The structure of this document is as follows: addition to those already described in Chapter :numref:`CVODES.Usage.SIM`. Following that we provide detailed descriptions of the user-callable interface routines specific to forward sensitivity analysis and - of the additonal optional user-defined routines. + of the additional optional user-defined routines. - Chapter :numref:`CVODES.Usage.ADJ` describes the usage of CVODES for adjoint sensitivity analysis. We begin by describing the CVODES checkpointing implementation for interpolation of diff --git a/doc/cvodes/guide/source/Mathematics.rst b/doc/cvodes/guide/source/Mathematics.rst index 6424a6b98f..6f5ec2b285 100644 --- a/doc/cvodes/guide/source/Mathematics.rst +++ b/doc/cvodes/guide/source/Mathematics.rst @@ -850,7 +850,7 @@ the solution of the combined ODE and sensitivity system for the vector matrix of the above linear system is based on exactly the same information as the matrix :math:`M` in :eq:`CVODES_Newtonmat`, it must be updated and factored at every step of the integration, in contrast to an - evalutaion of :math:`M` which is updated only occasionally. For problems with + evaluation of :math:`M` which is updated only occasionally. For problems with many parameters (relative to the problem size), the staggered direct method can outperform the methods described below :cite:p:`LPZ:99`. However, the computational cost associated with matrix updates and factorizations makes @@ -1132,7 +1132,7 @@ the gradient of :math:`G` with respect to :math:`p` is nothing but :label: CVODES_dgdp_1 The gradient of :math:`g(T,y,p)` with respect to :math:`p` can be then obtained -by using the Leibnitz differentiation rule. Indeed, from :eq:`CVODES_G`, +by using the Leibniz differentiation rule. Indeed, from :eq:`CVODES_G`, .. math:: \frac{\mathrm dg}{\mathrm dp}(T) = \frac{\mathrm d}{\mathrm dT}\frac{\mathrm dG}{\mathrm dp} diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index fde6cd2261..6ab2b68396 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -1142,7 +1142,7 @@ potentially non-differentiable factor. Krylov linear solver's convergence test constant is reduced from the nonlinear iteration test constant. This routine can be used in both the cases where the backward problem does and does not depend on the forward - sensitvities. + sensitivities. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. @@ -1171,7 +1171,7 @@ potentially non-differentiable factor. converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. This routine can be used in both the cases wherethe backward - problem does and does not depend on the forward sensitvities. + problem does and does not depend on the forward sensitivities. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. @@ -1527,7 +1527,7 @@ provide a ``rhsBS`` function of type :c:type:`CVRhsFnBS` defined as follows: **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``yBdot`` -- is the output vector containing the right-hand side. * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. @@ -1596,7 +1596,7 @@ by of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations provided with CVODES do not perform any - consistency checks with repsect to their ``N_Vector`` arguments + consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQB`` function every time it is called and can be the same as the ``user_data`` pointer used for the forward problem. @@ -1626,7 +1626,7 @@ defined by **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors continaing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``qBdot`` -- is the output vector containing the right-hand side ``fQBS`` of the backward quadrature equations. * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. @@ -1645,7 +1645,7 @@ defined by data consistently (including the use of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations - provided with CVODES do not perform any consistency checks with repsect to + provided with CVODES do not perform any consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQBS`` function every time it is called and can be the same as the ``user_data`` pointer used @@ -1729,7 +1729,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``JacB`` -- is the output approximate Jacobian matrix. @@ -1795,7 +1795,7 @@ J_B` (or an approximation of it) for the backward problem. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``AB`` -- is the output approximate linear system matrix. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -1838,7 +1838,7 @@ J_B` (or an approximation of it) for the backward problem. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``AB`` -- is the output approximate linear system matrix. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -2010,7 +2010,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the dependent variable vector, :math:`y(t)`. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the right-hand-side function for the backward problem. * ``user_dataB`` -- is a pointer to the same user data provided to ``CVodeSetUserDataB``. @@ -2128,7 +2128,7 @@ function of one of the following two types: * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invocation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -2156,7 +2156,7 @@ function of one of the following two types: * ``yS`` -- is a pointer to an array containing the forward sensitivity vectors. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invocation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index bec66d6d76..17723f0607 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -320,7 +320,7 @@ one, respectively. The form of the call to each of these routines is as follows: Passing ``fS1 = NULL`` indicates using the default internal difference quotient sensitivity right-hand side routine. If an error occurred, :c:func:`CVodeSensInit1` also sends an error message to the error handler - funciton. + function. In terms of the problem size :math:`N`, number of sensitivity vectors @@ -1317,7 +1317,7 @@ steps are in bold. #. :silver:`Create sensitivity nonlinear solver object` -#. :silver:`Attach the sensitvity nonlinear solver module` +#. :silver:`Attach the sensitivity nonlinear solver module` #. :silver:`Set sensitivity nonlinear solver optional inputs` @@ -1394,7 +1394,7 @@ of the call to this function is as follows: **Notes:** .. warning:: Before calling :c:func:`CVodeQuadSensInit`, the user must enable the - sensitivites by calling :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. If + sensitivities by calling :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. If an error occurred, :c:func:`CVodeQuadSensInit` also sends an error message to the error handler function. diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 18dce59206..8bc54ff2a2 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -443,7 +443,7 @@ makes no sense (and is overly costly) after ``y[i]`` is below some noise level. ``abstol`` (if scalar) or ``abstol[i]`` (if a vector) needs to be set to that noise level. If the different components have different noise levels, then ``abstol`` should be a vector. See the example ``cvsRoberts_dns`` in the CVODES package, and the discussion of it in the CVODES Examples document -:cite:p:`cvodes_ex`. In that problem, the three components vary betwen 0 and 1, +:cite:p:`cvodes_ex`. In that problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as to what those @@ -772,7 +772,7 @@ rootfinding. In the ``CV_ONE_STEP`` mode, ``tout`` is used only on the first call, and only to get the direction and a rough scale of the independent variable. - If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). All failure return values are negative and so the test ``flag < 0`` will trap all ``CVode`` failures. @@ -914,7 +914,7 @@ Main solver optional input functions **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``nst`` -- number of successful steps inbetween calls to the monitor function 0 by default; a 0 input will turn off monitoring. + * ``nst`` -- number of successful steps in between calls to the monitor function 0 by default; a 0 input will turn off monitoring. **Return value:** * ``CV_SUCCESS`` -- The optional value has been successfully set. @@ -1056,7 +1056,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. - Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. @@ -1089,7 +1089,7 @@ Main solver optional input functions * ``CV_MEM_NULL`` if the CVODES memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`CVodeSetStopTime`. .. versionadded:: 6.5.1 @@ -2627,7 +2627,7 @@ described next. The values returned in ``ele`` are valid only if :c:func:`CVode` returned a non-negative value. - The ``ele`` vector, togther with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. @@ -3136,7 +3136,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** - * ``CVDIAG_SUCCESS`` -- The optional output valus have been successfully set. + * ``CVDIAG_SUCCESS`` -- The optional output values have been successfully set. * ``CVDIAG_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. @@ -3223,7 +3223,7 @@ known, simply make that location a value of tout. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the RHS function *not* incorporate the discontinuity, but rather have a smooth -extention over the discontinuity, so that the step across it (and +extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the RHS function (communicated through ``user_data``) that can be flipped between the stopping of the integration and the restart, so that @@ -3382,7 +3382,7 @@ These weights will be used in place of those defined by Eq. .. warning:: - The error weight vector must have all components positive. It is the user's responsiblity to perform this test and return -1 if it is not satisfied. + The error weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it is not satisfied. .. _CVODES.Usage.SIM.user_supplied.rootFn: @@ -3405,7 +3405,7 @@ follows: * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. **Return value:** - A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occured (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. + A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occurred (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. **Notes:** Allocation of memory for ``gout`` is automatically handled within CVODES. @@ -3428,7 +3428,7 @@ user-defined projection operation the projection function must have type * ``t`` -- the current value of the independent variable. * ``ycur`` -- the current value of the dependent variable vector :math:`y(t)`. * ``corr`` -- the correction, :math:`c`, to the dependent variable vector so that :math:`y(t) + c` satisfies the constraint equation. - * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrainted least squares problem. + * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrained least squares problem. * ``err`` -- is on input the current error estimate, if error projection is enabled (the default) then this should be overwritten with the projected error on output. If error projection is disabled then ``err`` is ``NULL``. * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. @@ -3855,7 +3855,7 @@ are in bold. #. **Set optional inputs for quadrature integration** Call :c:func:`CVodeSetQuadErrCon` to indicate whether or not quadrature - variables shoule be used in the step size control mechanism, and to specify + variables should be used in the step size control mechanism, and to specify the integration tolerances for quadrature variables. See :numref:`CVODES.Usage.purequad.optional_inputs` for details. diff --git a/doc/cvodes/guide/source/conf.py b/doc/cvodes/guide/source/conf.py index a8a21e28a1..a8e4f703f7 100644 --- a/doc/cvodes/guide/source/conf.py +++ b/doc/cvodes/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'CVODES', u'CVODES Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'CVODES', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst index fa046db709..3d4a42140d 100644 --- a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst +++ b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst @@ -49,7 +49,7 @@ the combined state and sensitivity nonlinear systems are also reformulated in terms of the correction to the predicted state and sensitivities. The nonlinear system functions provided by CVODES to the nonlinear solver module -internally update the current value of the new state (and the sensitvities) +internally update the current value of the new state (and the sensitivities) based on the input correction vector(s) i.e., :math:`y^n = y_{pred} + y_{cor}` and :math:`s_i^n = s_{i,pred} + s_{i,cor}`. The updated vector(s) are used when calling the right-hand side function and when setting up linear solves (e.g., @@ -125,7 +125,7 @@ need access to the current value of :math:`\gamma` to compute Jacobian data. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemData` inside the - nonlinear system function to access the requisite data for evaluting + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` @@ -208,15 +208,15 @@ need access to the current value of :math:`\gamma` to compute Jacobian data. * ``CV_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. **Notes:** - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to ``SUNNonlinSolSetSysFn``) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemDataSens` inside the nonlinear system function used in the sensitivity nonlinear solve to access the - requisite data for evaluting the nonlinear system function of their + requisite data for evaluating the nonlinear system function of their choosing. This could be the same function used for solving for the new state (the simultaneous approach) or a different function (the staggered or stagggered1 approaches). Additionlly, the vectors ``ySn`` are only diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 029b9a3523..b100289002 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -37,7 +37,7 @@ LLNL to support the ordinary differential equation (ODE) solvers CVODE nonlinear system solver KINSOL :cite:p:`kinsol_ug`. At present, IDA may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 2402ae83eb..36b20b743e 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -449,7 +449,7 @@ For many users, the appropriate choices for tolerance values in ``reltol`` and different components have different noise levels, then ``abstol`` should be a vector. See the example ``idaRoberts_dns`` in the IDA package, and the discussion of it in the IDA Examples document :cite:p:`ida_ex`. In that - problem, the three components vary betwen 0 and 1, and have different noise + problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as @@ -840,7 +840,7 @@ rootfinding (with :c:func:`IDARootInit`). If a stop time is enabled (through a call to :c:func:`IDASetStopTime`), then :c:func:`IDASolve` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and - can be reenabled only though a new call to :c:func:`IDASetStopTime`). + can be re-enabled only though a new call to :c:func:`IDASetStopTime`). All failure return values are negative and therefore a test ``flag < 0`` will trap all :c:func:`IDASolve` failures. @@ -1067,7 +1067,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for ``tstop`` - is disabled (and can be reenabled only though a new call to + is disabled (and can be re-enabled only though a new call to :c:func:`IDASetStopTime`). A stop time not reached before a call to :c:func:`IDAReInit` will @@ -1085,7 +1085,7 @@ Main solver optional input functions * ``IDA_MEM_NULL`` if the IDA memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`IDASetStopTime`. .. versionadded:: 6.5.1 @@ -2492,7 +2492,7 @@ described next. .. note:: - The ``ele`` vector, togther with the ``eweight`` vector from + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`IDAGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose @@ -3054,7 +3054,7 @@ To stop when the location of the discontinuity is known, simply make that location a value of :math:`t_{\text{out}}`. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the residual function *not* incorporate the -discontinuity, but rather have a smooth extention over the discontinuity, so +discontinuity, but rather have a smooth extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the residual function (communicated through ``user_data``) that can be flipped between the stopping of the @@ -3164,7 +3164,7 @@ Error weight function **Return value:** * ``0`` -- if it the error weights were successfully set. - * ``-1`` -- if any error occured. + * ``-1`` -- if any error occurred. **Notes:** Allocation of memory for ``ewt`` is handled within IDA. @@ -3172,7 +3172,7 @@ Error weight function .. warning:: The error weight vector must have all components positive. It is the - user's responsiblity to perform this test and return -1 if it is not + user's responsibility to perform this test and return -1 if it is not satisfied. @@ -3203,8 +3203,8 @@ as follows: parameter passed to :c:func:`IDASetUserData`. **Return value:** - ``0`` if successful or non-zero if an error occured (in which case the - integration is halted and :c:func:`IDASolve` returs ``IDA_RTFUNC_FAIL``). + ``0`` if successful or non-zero if an error occurred (in which case the + integration is halted and :c:func:`IDASolve` returns ``IDA_RTFUNC_FAIL``). **Notes:** Allocation of memory for ``gout`` is handled within IDA. @@ -3247,7 +3247,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: value if a recoverable error occurred, or a negative value if a nonrecoverable error occurred. - In the case of a recoverable eror return, the integrator will attempt to + In the case of a recoverable error return, the integrator will attempt to recover by reducing the stepsize, and hence changing :math:`\alpha` in :eq:`IDA_DAE_Jacobian`. diff --git a/doc/ida/guide/source/conf.py b/doc/ida/guide/source/conf.py index a92a878cf5..53f27fadba 100644 --- a/doc/ida/guide/source/conf.py +++ b/doc/ida/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'IDA', u'IDA Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'IDA', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst index 36feccee89..2ec40ffb7a 100644 --- a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst +++ b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst @@ -117,13 +117,13 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of a + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemData` inside the nonlinear system function to - access the requisite data for evaluting the nonlinear system function of + access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by IDA (through calls to diff --git a/doc/ida/ida_ex_fortran.tex b/doc/ida/ida_ex_fortran.tex index af9260e4dc..60ab483870 100644 --- a/doc/ida/ida_ex_fortran.tex +++ b/doc/ida/ida_ex_fortran.tex @@ -66,7 +66,7 @@ \subsection{A parallel example: fidaHeat2D\_kry\_bbd\_p}\label{ss:fidaHeat2D_bbd a call to \id{FNVINITP} to initialize {\nvecp}, and a call to \id{SETINITPROFILE} to initialize the \id{UU}, \id{UP}, \id{ID}, and \id{CONSTR} arrays (containing the solution vector, solution derivative vector, -the differential/algebraic bit vector, and the contraint specification +the differential/algebraic bit vector, and the constraint specification vector, respectively). A call to \id{FIDASETIIN} and two calls to \id{FIDASETVIN} are made to suppress error control on the algebraic variables, and to supply the \id{ID} array and constraints array (making diff --git a/doc/ida/ida_ex_serial.tex b/doc/ida/ida_ex_serial.tex index fb9e8fd934..6322125609 100644 --- a/doc/ida/ida_ex_serial.tex +++ b/doc/ida/ida_ex_serial.tex @@ -61,7 +61,7 @@ \subsection{A dense example: idaRoberts\_dns}\label{ss:idaRoberts} After various declarations, the \id{main} program begins by allocating memory for the \id{yy}, \id{yp}, and \id{avtol} vectors using \id{N\_VNew\_Serial} with a length argument of \id{NEQ} ($= 3$). The -lines following that load the initial values of the dependendent +lines following that load the initial values of the dependent variable vectors into \id{yy} and \id{yp}, and set the relative tolerance \id{rtol} and absolute tolerance vector \id{avtol}. Serial \id{N\_Vector} values are set by first accessing the pointer to their underlying data using @@ -389,7 +389,7 @@ \subsection{A Krylov example: idaHeat2D\_kry}\label{ss:idaHeat2D} of the PDE (using central differences) in the rest of the domain. The user-supplied functions \id{PsetupHeat} and \id{PsolveHeat} together define the -left preconditoner matrix $P$ approximating the system Jacobian matrix +left preconditioner matrix $P$ approximating the system Jacobian matrix $J = \partial F/ \partial u + \alpha \partial F/ \partial u'$ (where the DAE system is $F(t,u,u') = 0$), and solve the linear systems $P z = r$. Preconditioning is done in this case by keeping only the diagonal elements of diff --git a/doc/ida/ida_ex_trilinos.tex b/doc/ida/ida_ex_trilinos.tex index aa4ad1140e..58dc769c4b 100644 --- a/doc/ida/ida_ex_trilinos.tex +++ b/doc/ida/ida_ex_trilinos.tex @@ -49,7 +49,7 @@ \subsection{A nonstiff shared memory parallel example: idaHeat2D\_kry\_tpetra} changing the example code. Once the communicator and map are set, a Tpetra vector is created as: \begin{verbatim} - /* Create a Tpetra vector and return refernce counting pointer to it. */ + /* Create a Tpetra vector and return reference counting pointer to it. */ Teuchos::RCP<vector_type> rcpuu = Teuchos::rcp(new vector_type(mpiMap)); \end{verbatim} diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 771da6ec5b..5f1b554c5f 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -37,7 +37,7 @@ at LLNL to support the ordinary differential equation (ODE) solvers CVODE nonlinear system solver KINSOL :cite:p:`kinsol_ug`. At present, IDAS may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) @@ -119,7 +119,7 @@ The structure of this document is as follows: that are required in addition to those already described in Chapter :numref:`IDAS.Usage.SIM`. Following that we provide detailed descriptions of the user-callable interface routines specific to forward - sensitivity analysis and of the additonal optional user-defined routines. + sensitivity analysis and of the additional optional user-defined routines. * Chapter :numref:`IDAS.Usage.ADJ` describes the usage of IDAS for adjoint sensitivity analysis. We begin by describing the IDAS checkpointing diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 60c76147d7..af8b782a28 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -1115,7 +1115,7 @@ setting increments for the finite-difference approximation, via a call to increments used in the difference quotient approximations to matrix-vector products for the backward problem. This routine can be used in both the cases where the backward problem does and does not depend on the forward - sensitvities. + sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1245,7 +1245,7 @@ These may be accomplished through calling the following functions: Krylov linear solver's convergence test constant is reduced from the nonlinear iteration test constant. (See :numref:`IDAS.Mathematics.ivp_sol`). This routine can be used in both the cases wherethe backward problem does - and does not depend on the forward sensitvities. + and does not depend on the forward sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1275,7 +1275,7 @@ These may be accomplished through calling the following functions: converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. This routine can be used in both the cases wherethe backward - problem does and does not depend on the forward sensitvities. + problem does and does not depend on the forward sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1746,7 +1746,7 @@ The user must provide an ``fQB`` function of type ``IDAQuadRhsFnB`` defined by data consistently (including the use of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations - provided with IDAS do not perform any consistency checks with repsect to + provided with IDAS do not perform any consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQB`` function every time it is called and can be the same as the ``user_data`` pointer used for the forward diff --git a/doc/idas/guide/source/Usage/FSA.rst b/doc/idas/guide/source/Usage/FSA.rst index 6309026184..38f5608634 100644 --- a/doc/idas/guide/source/Usage/FSA.rst +++ b/doc/idas/guide/source/Usage/FSA.rst @@ -1224,7 +1224,7 @@ in the notation of :eq:`IDAS_QUAD`. The form of the call to this function is as .. warning:: Before calling :c:func:`IDAQuadSensInit`, the user must enable the - sensitivites by calling :c:func:`IDASensInit`. If an error occurred, + sensitivities by calling :c:func:`IDASensInit`. If an error occurred, :c:func:`IDAQuadSensInit` also sends an error message to the error handler function. diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index 981291a4aa..f8bbe96021 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -447,7 +447,7 @@ For many users, the appropriate choices for tolerance values in ``reltol`` and different components have different noise levels, then ``abstol`` should be a vector. See the example ``idaRoberts_dns`` in the IDAS package, and the discussion of it in the IDAS Examples document :cite:p:`ida_ex`. In that - problem, the three components vary betwen 0 and 1, and have different noise + problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as @@ -845,7 +845,7 @@ rootfinding (with :c:func:`IDARootInit`). If a stop time is enabled (through a call to :c:func:`IDASetStopTime`), then :c:func:`IDASolve` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and - can be reenabled only though a new call to :c:func:`IDASetStopTime`). + can be re-enabled only though a new call to :c:func:`IDASetStopTime`). All failure return values are negative and therefore a test ``flag < 0`` will trap all :c:func:`IDASolve` failures. @@ -1072,7 +1072,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for ``tstop`` - is disabled (and can be reenabled only though a new call to + is disabled (and can be re-enabled only though a new call to :c:func:`IDASetStopTime`). A stop time not reached before a call to :c:func:`IDAReInit` will @@ -1090,7 +1090,7 @@ Main solver optional input functions * ``IDA_MEM_NULL`` if the IDA memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`IDASetStopTime`. .. versionadded:: 6.5.1 @@ -1802,7 +1802,7 @@ to set optional inputs controlling the initial condition calculation. If :c:func:`IDASetMaxBacksIC` is called in a Forward Sensitivity Analysis, the the limit ``maxbacks`` applies in the calculation of both the initial state - values and the initial sensititivies. + values and the initial sensitivities. .. c:function:: int IDASetLineSearchOffIC(void * ida_mem, sunbooleantype lsoff) @@ -2518,7 +2518,7 @@ described next. .. note:: - The ``ele`` vector, togther with the ``eweight`` vector from + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`IDAGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose @@ -3084,7 +3084,7 @@ To stop when the location of the discontinuity is known, simply make that location a value of :math:`t_{\text{out}}`. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the residual function *not* incorporate the -discontinuity, but rather have a smooth extention over the discontinuity, so +discontinuity, but rather have a smooth extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the residual function (communicated through ``user_data``) that can be flipped between the stopping of the @@ -3204,7 +3204,7 @@ Error weight function **Return value:** * ``0`` -- if it the error weights were successfully set. - * ``-1`` -- if any error occured. + * ``-1`` -- if any error occurred. **Notes:** Allocation of memory for ``ewt`` is handled within IDAS. @@ -3212,7 +3212,7 @@ Error weight function .. warning:: The error weight vector must have all components positive. It is the - user's responsiblity to perform this test and return -1 if it is not + user's responsibility to perform this test and return -1 if it is not satisfied. @@ -3243,7 +3243,7 @@ as follows: parameter passed to :c:func:`IDASetUserData`. **Return value:** - ``0`` if successful or non-zero if an error occured (in which case the + ``0`` if successful or non-zero if an error occurred (in which case the integration is halted and :c:func:`IDASolve` returns ``IDA_RTFUNC_FAIL``). **Notes:** @@ -3287,7 +3287,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: value if a recoverable error occurred, or a negative value if a nonrecoverable error occurred. - In the case of a recoverable eror return, the integrator will attempt to + In the case of a recoverable error return, the integrator will attempt to recover by reducing the stepsize, and hence changing :math:`\alpha` in :eq:`IDAS_DAE_Jacobian`. @@ -3658,7 +3658,7 @@ steps are in bold. #. **Set optional inputs for quadrature integration** Call :c:func:`IDASetQuadErrCon` to indicate whether or not quadrature - variables shoule be used in the step size control mechanism, and to specify + variables should be used in the step size control mechanism, and to specify the integration tolerances for quadrature variables. See :numref:`IDAS.Usage.Purequad.quad_optional_input` for details. diff --git a/doc/idas/guide/source/conf.py b/doc/idas/guide/source/conf.py index 8613adcf6a..e0da18474a 100644 --- a/doc/idas/guide/source/conf.py +++ b/doc/idas/guide/source/conf.py @@ -292,7 +292,7 @@ texinfo_documents = [ ('index', 'IDAS', u'IDAS Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'IDAS', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst index d2d6cc8746..54f8375db9 100644 --- a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst +++ b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst @@ -40,7 +40,7 @@ reformulated in terms of the correction to the predicted sensitivities. The nonlinear system function provided by IDAS to the nonlinear solver module internally updates the current value of the new state and its derivative based -on the current corretion passed to the function (as well as the sensitivities). +on the current correction passed to the function (as well as the sensitivities). These values are used when calling the DAE residual function and when setting up linear solves (e.g., for updating the Jacobian or preconditioner). @@ -149,13 +149,13 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of a + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemData` inside the nonlinear system function to - access the requisite data for evaluting the nonlinear system function of + access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by IDAS (through calls to @@ -203,11 +203,11 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemDataSens` inside the - nonlinear system function to access the requisite data for evaluting the + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the the vectors ``yySn`` and ``ypSn`` are provided as additional workspace and do not need to be filled in by the user's :c:type:`SUNNonlinSolSysFn`. If diff --git a/doc/idas/idas_ex_intro.tex b/doc/idas/idas_ex_intro.tex index fde54914d3..d2ca2de7eb 100644 --- a/doc/idas/idas_ex_intro.tex +++ b/doc/idas/idas_ex_intro.tex @@ -296,7 +296,7 @@ \section{Introduction}\label{s:ex_intro} {\em builddir}\id{/lib/libsundials\_idas.}{\em lib} instead of {\em builddir}\id{/lib/libsundials\_ida.}{\em lib}. -We also give our output files for each of thes examples described below, +We also give our output files for each of the examples described below, but users should be cautioned that their results may differ slightly from these. Differences in solution values may differ within the tolerances, and differences in cumulative counters, such as numbers of steps or Newton iterations, may differ diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index dd1bcacec1..ebe2aeef76 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -1030,7 +1030,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. .. c:function:: int KINSetDampingAA(void * kin_mem, sunrealtype beta) The function :c:func:`KINSetDampingAA` specifies the value of the Anderson - acceleration damping paramter. + acceleration damping parameter. **Arguments:** * ``kin_mem`` -- pointer to the KINSOL memory block. @@ -1946,7 +1946,7 @@ supplied, the default is a difference quotient approximation to these products. This function computes the product :math:`J v` (or an approximation to it). **Arguments:** - * ``v`` -- is the vector by which the Jacobian must be multplied to the right. + * ``v`` -- is the vector by which the Jacobian must be multiplied to the right. * ``Jv`` -- is the computed output vector. * ``u`` -- is the current value of the dependent variable vector. * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` @@ -1999,7 +1999,7 @@ of type :c:type:`KINLsPrecSolveFn`, defined as follows: * ``uscale`` -- is a vector containing diagonal elements of the scaling matrix ``u`` * ``fval`` -- is the vector :math:`F(u)` evaluated at ``u`` * ``fscale`` -- is a vector containing diagonal elements of the scaling matrix for ``fval`` - * ``v`` -- on inpuut, ``v`` is set to the right-hand side vector of the linear system, ``r``. On output, ``v`` must contain the solution ``z`` of the linear system :math:`Pz=r` + * ``v`` -- on input, ``v`` is set to the right-hand side vector of the linear system, ``r``. On output, ``v`` must contain the solution ``z`` of the linear system :math:`Pz=r` * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`KINSetUserData`. @@ -2131,7 +2131,7 @@ communication. **Return value:** An :c:type:`KINBBDLocalFn` function type should return 0 to indicate success, - or non-zero if an error occured. + or non-zero if an error occurred. **Notes:** This function must assume that all inter-processor communication of data @@ -2155,7 +2155,7 @@ communication. **Return value:** An :c:type:`KINBBDLocalFn` function type should return 0 to indicate success, - or non-zero if an error occured. + or non-zero if an error occurred. **Notes:** The ``Gcomm`` function is expected to save communicated data in space defined diff --git a/doc/kinsol/guide/source/conf.py b/doc/kinsol/guide/source/conf.py index c8cef7c6ac..074821a0a3 100644 --- a/doc/kinsol/guide/source/conf.py +++ b/doc/kinsol/guide/source/conf.py @@ -296,7 +296,7 @@ texinfo_documents = [ ('index', 'KINSOL', u'KINSOL Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'KINSOL', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/kinsol/kin_ex_c.tex b/doc/kinsol/kin_ex_c.tex index 74fd91f289..8fea81bf05 100644 --- a/doc/kinsol/kin_ex_c.tex +++ b/doc/kinsol/kin_ex_c.tex @@ -89,7 +89,7 @@ \subsection{A serial dense example: kinFerTron\_dns}\label{ss:kinFerTron_dns} functions \id{SetInitialGuess1} and \id{SetInitialGuess2} and the constraint vector \id{c} is initialized to $[0,0,1,-1,1,-1]$ indicating that there are no additional constraints on the first two components of \id{u} (i.e. $x_1$ and -$x_2$) and that the 3rd and 5th compnents should be non-negative, while +$x_2$) and that the 3rd and 5th components should be non-negative, while the 4th and 6th should be non-positive. The calls to \id{N\_VNew\_Serial}, and also later calls to various \id{KIN***} @@ -275,7 +275,7 @@ \subsection{A serial Krylov example: kinFoodWeb\_kry}\label{ss:kinFoodWeb_kry} to load problem constants in the \id{data} block; \id{FreeUserData} to free that block; \id{SetInitialProfiles} to load the initial values in \id{cc}; \id{PrintHeader} to print the heading for the output; -\id{PrintOutput} to retreive and print selected solution values; +\id{PrintOutput} to retrieve and print selected solution values; \id{PrintFinalStats} to print statistics; and \id{check\_flag} to check return values for error conditions. @@ -326,7 +326,7 @@ \subsection{A parallel example: kinFoodWeb\_kry\_bbd\_p}\label{ss:kinFoodWeb_kry The function \id{func\_local} is also passed as the \id{gloc} argument to \id{KINBBDPrecInit}. Since all communication needed for the evaluation of the -local aproximation of $f$ used in building the band-block-diagonal preconditioner +local approximation of $f$ used in building the band-block-diagonal preconditioner is already done for the evaluation of $f$ in \id{func}, a \id{NULL} pointer is passed as the \id{gcomm} argument to \id{KINBBDPrecInit}. diff --git a/doc/kinsol/kin_ex_fortran.tex b/doc/kinsol/kin_ex_fortran.tex index 2c7b263144..c8c1f25c69 100644 --- a/doc/kinsol/kin_ex_fortran.tex +++ b/doc/kinsol/kin_ex_fortran.tex @@ -95,7 +95,7 @@ \subsection{A parallel example: fkinDiagon\_kry\_p}\label{ss:fkinDiagon_kry_p} \id{fkinDiagon\_kry}. Upon successful return from \id{fkinsol}, the solution segment local to the process with id equal to $0$ is printed to unit 6. Finally, the {\kinsol} memory is released and the {\mpi} -environent is terminated. +environment is terminated. For this simple example, no inter-process communication is required to evaluate the nonlinear system function $f$ or the preconditioner. diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 5bf5c04203..bc9d5c1ad9 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -1999,7 +1999,7 @@ implemented a custom :c:type:`SUNMatrix` will need to at least update their code to set the corresponding ``ops`` structure member, ``matvecsetup``, to ``NULL``. The generic :c:type:`SUNMatrix` API now defines error codes to be returned by -matrix operations. Operations which return an integer flag indiciating +matrix operations. Operations which return an integer flag indicating success/failure may return different values than previously. A new :c:type:`SUNMatrix` (and :c:type:`SUNLinearSolver`) implementation was @@ -2112,7 +2112,7 @@ function signatures have been changed including :c:func:`MRIStepCreate` which now takes an ARKStep memory structure for the fast integration as an input. The reinitialization functions :c:func:`ERKStepReInit`, :c:func:`ARKStepReInit`, -and :c:func:`MRIStepReInit` have been updated to retain the minimum and maxiumum +and :c:func:`MRIStepReInit` have been updated to retain the minimum and maximum step size values from before reinitialization rather than resetting them to the default values. @@ -2138,7 +2138,7 @@ being built. Fixed a memory leak in the PETSc :c:type:`N_Vector` clone function. -Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +Fixed a memory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using the default nonlinear solver. Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in @@ -2878,7 +2878,7 @@ with sparse direct solvers. *KINSOL* -The Picard iteration return was chanegd to always return the newest iterate upon +The Picard iteration return was changed to always return the newest iterate upon success. A minor bug in the line search was fixed to prevent an infinite loop when the diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index df27c93672..d81ba70e7c 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -45,7 +45,7 @@ if the vector owns the execution policies and memory helper objects (i.e., it is in change of freeing the objects), :c:type:`SUNMemory` objects for the vector data on the host and device, pointers to execution policies that control how streaming and reduction kernels are launched, a :c:type:`SUNMemoryHelper` for performing memory -operations, and a private data structure which holds additonal members that +operations, and a private data structure which holds additional members that should not be accessed directly. When instantiated with :c:func:`N_VNew_Cuda`, the underlying data will be @@ -84,7 +84,7 @@ accessor functions: .. c:function:: sunbooleantype N_VIsManagedMemory_Cuda(N_Vector v) - This function returns a boolean flag indiciating if the vector + This function returns a boolean flag indicating if the vector data array is in managed memory or not. @@ -272,7 +272,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Cuda``, ``v``, - it is recommeded to use functions :c:func:`N_VGetDeviceArrayPointer_Cuda()` or + it is recommended to use functions :c:func:`N_VGetDeviceArrayPointer_Cuda()` or :c:func:`N_VGetHostArrayPointer_Cuda()`. However, when using managed memory, the function :c:func:`N_VGetArrayPointer` may also be used. @@ -375,7 +375,7 @@ In total, SUNDIALS provides 3 execution policies: .. cpp:function:: SUNCudaBlockReduceExecPolicy(const size_t blockDim, const cudaStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks. The + Is for kernels performing a reduction across individual thread blocks. The number of threads per block (blockDim) can be set to any valid multiple of the CUDA warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size will be chosen so @@ -384,7 +384,7 @@ In total, SUNDIALS provides 3 execution policies: .. cpp:function:: SUNCudaBlockReduceAtomicExecPolicy(const size_t blockDim, const cudaStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks using + Is for kernels performing a reduction across individual thread blocks using atomic operations. The number of threads per block (blockDim) can be set to any valid multiple of the CUDA warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index f722e9cfac..050e379982 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -44,7 +44,7 @@ The content members are the vector length (size), a boolean flag that signals if the vector owns the data (i.e. it is in charge of freeing the data), pointers to vector data on the host and the device, pointers to :cpp:type:`SUNHipExecPolicy` implementations that control how the HIP kernels are launched for streaming and -reduction vector kernels, and a private data structure which holds additonal members +reduction vector kernels, and a private data structure which holds additional members that should not be accessed directly. When instantiated with :c:func:`N_VNew_Hip`, the underlying data will be @@ -81,7 +81,7 @@ accessor functions: .. c:function:: sunbooleantype N_VIsManagedMemory_Hip(N_Vector v) - This function returns a boolean flag indiciating if the vector + This function returns a boolean flag indicating if the vector data array is in managed memory or not. @@ -255,7 +255,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Hip``, ``v``, - it is recommeded to use functions :c:func:`N_VGetDeviceArrayPointer_Hip()` or + it is recommended to use functions :c:func:`N_VGetDeviceArrayPointer_Hip()` or :c:func:`N_VGetHostArrayPointer_Hip()`. However, when using managed memory, the function :c:func:`N_VGetArrayPointer` may also be used. @@ -359,7 +359,7 @@ In total, SUNDIALS provides 4 execution policies: .. cpp:function:: SUNHipBlockReduceExecPolicy(const size_t blockDim, const hipStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks. The + Is for kernels performing a reduction across individual thread blocks. The number of threads per block (blockDim) can be set to any valid multiple of the HIP warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size will be chosen so that there @@ -368,7 +368,7 @@ In total, SUNDIALS provides 4 execution policies: .. cpp:function:: SUNHipBlockReduceAtomicExecPolicy(const size_t blockDim, const hipStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks using + Is for kernels performing a reduction across individual thread blocks using atomic operations. The number of threads per block (blockDim) can be set to any valid multiple of the HIP warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size diff --git a/doc/shared/nvectors/NVector_MPIManyVector.rst b/doc/shared/nvectors/NVector_MPIManyVector.rst index fdaeaf31c9..f7907c446c 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -27,7 +27,7 @@ construction of distinct NVECTOR modules for each component, that are then combined together to form the NVECTOR_MPIMANYVECTOR. Three potential use cases for this module include: -A. *Heterogenous computational architectures (single-node or multi-node)*: +A. *Heterogeneous computational architectures (single-node or multi-node)*: for data partitioning between different computing resources on a node, architecture-specific subvectors may be created for each partition. For example, a user could create one MPI-parallel component based on diff --git a/doc/shared/nvectors/NVector_MPIPlusX.rst b/doc/shared/nvectors/NVector_MPIPlusX.rst index 88905edd50..d22070eaef 100644 --- a/doc/shared/nvectors/NVector_MPIPlusX.rst +++ b/doc/shared/nvectors/NVector_MPIPlusX.rst @@ -71,7 +71,7 @@ user-callable routines: .. c:function:: N_Vector N_VMake_MPIPlusX(MPI_Comm comm, N_Vector *local_vector, SUNContext sunctx) - This function creates a MPIPlusX vector from an exisiting local + This function creates a MPIPlusX vector from an existing local (i.e. on node) NVECTOR object, and a user-created MPI communicator. The input *comm* should be this user-created MPI communicator. diff --git a/doc/shared/nvectors/NVector_ManyVector.rst b/doc/shared/nvectors/NVector_ManyVector.rst index cded89fd73..5afeccb8dc 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -24,7 +24,7 @@ construction of distinct NVECTOR modules for each component, that are then combined together to form the NVECTOR_MANYVECTOR. Two potential use cases for this flexibility include: -A. *Heterogenous computational architectures*: +A. *Heterogeneous computational architectures*: for data partitioning between different computing resources on a node, architecture-specific subvectors may be created for each partition. For example, a user could create one GPU-accelerated component based diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index 4f84694770..2947c403db 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -276,7 +276,7 @@ options as the vector they are cloned from while vectors created with loop than it is to use ``NV_Ith_OMP(v,i)`` within the loop. * :c:func:`N_VNewEmpty_OpenMP` and :c:func:`N_VMake_OpenMP` set the field - *own_data* to ``SUNFALSE``. The implemenation of :c:func:`N_VDestroy` will + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` 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. diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index e184b829de..475abc4a84 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -104,7 +104,7 @@ operations below. Returns a pointer to a ``sunrealtype`` array from the ``N_Vector`` *v*. Note that this assumes that the internal data in the ``N_Vector`` is a contiguous array of ``sunrealtype`` and is - accesible from the CPU. + accessible from the CPU. This routine is only used in the solver-specific interfaces to the dense and banded diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index f7284ae7f8..3d0983e149 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -162,7 +162,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Petsc v``, it - is recommeded to extract the PETSc vector via ``x_vec = N_VGetVector_Petsc(v);`` + is recommended 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` and :c:func:`N_VMake_Petsc`, set the diff --git a/doc/shared/nvectors/NVector_Trilinos.rst b/doc/shared/nvectors/NVector_Trilinos.rst index c891f07ab6..d5b404ea58 100644 --- a/doc/shared/nvectors/NVector_Trilinos.rst +++ b/doc/shared/nvectors/NVector_Trilinos.rst @@ -104,7 +104,7 @@ The module NVECTOR_TRILINOS provides the following additional user-callable rout in SUNDIALS. * When there is a need to access components of an ``N_Vector_Trilinos v``, - it is recommeded to extract the Trilinos vector object via ``x_vec = + it is recommended to extract the Trilinos vector object via ``x_vec = N_VGetVector_Trilinos(v)`` and then access components using the appropriate Trilinos functions. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst index 6c8a77bcb8..0c1b0cc620 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst @@ -254,7 +254,7 @@ also provides the following additional user-callable routines: 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` + which are internally transformed into the Soderlind coefficients :math:`k_1 = \hat{k}_1+\hat{k}_2` and :math:`k_2 = -\hat{k}_2`. :param C: the SUNAdaptController_Soderlind object. @@ -300,7 +300,7 @@ also provides the following additional user-callable routines: 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`, + which are internally transformed into the Soderlind coefficients :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. diff --git a/doc/shared/sundials/Errors.rst b/doc/shared/sundials/Errors.rst index 20cbcc5405..ce273ea76e 100644 --- a/doc/shared/sundials/Errors.rst +++ b/doc/shared/sundials/Errors.rst @@ -18,7 +18,7 @@ Error Checking .. versionadded:: 7.0.0 Until version 7.0.0, error reporting and handling was inconsistent throughout SUNDIALS. Starting with version 7.0.0 all of SUNDIALS (the core, implementations of core modules, and -packages) reports error mesages through the :c:type:`SUNLogger` API. Furthermore, functions in the +packages) reports error messages through the :c:type:`SUNLogger` API. Furthermore, functions in the SUNDIALS core API (i.e., ``SUN`` or ``N_V`` functions only) either return a :c:type:`SUNErrCode`, or (if they don't return a :c:type:`SUNErrCode`) they internally record an error code (if an error occurs) within the :c:type:`SUNContext` for the execution stream. This "last error" is accessible @@ -45,17 +45,17 @@ Thus, in user code, SUNDIALS core API functions can be checked for errors in one length = 2; v = N_VNew_Serial(length, sunctx); sunerr = SUNContext_GetLastError(sunctx); - if (sunerr) { /* an error occured, do something */ } + if (sunerr) { /* an error occurred, do something */ } // If the function returns a SUNErrCode, we can check it directly sunerr = N_VLinearCombination(...); - if (sunerr) { /* an error occured, do something */ } + if (sunerr) { /* an error occurred, do something */ } // Another function that does not return a SUNErrCode. dotprod = N_VDotProd(...); SUNContext_GetLastError(sunctx); if (sunerr) { - /* an error occured, do something */ + /* an error occurred, do something */ } else { print("dotprod = %.2f\n", dotprod); } @@ -114,11 +114,11 @@ The error handlers provided in SUNDIALS are: Logs the error that occurred using the :c:type:`SUNLogger` from ``sunctx``. This is the default error handler. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: the message to log, if this is ``NULL`` then the default error message for the error code will be used - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object @@ -128,13 +128,13 @@ The error handlers provided in SUNDIALS are: const char* msg, SUNErrCode err_code, \ void* err_user_data, SUNContext sunctx) - Logs the error and aborts the program if an error occured. + Logs the error and aborts the program if an error occurred. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: this parameter is ignored - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object @@ -145,13 +145,13 @@ The error handlers provided in SUNDIALS are: const char* msg, SUNErrCode err_code, \ void* err_user_data, SUNContext sunctx) - Logs the error and calls ``MPI_Abort`` if an error occured. + Logs the error and calls ``MPI_Abort`` if an error occurred. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: this parameter is ignored - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object diff --git a/doc/shared/sundials/GPU.rst b/doc/shared/sundials/GPU.rst index 8607643adf..e3c12bb41c 100644 --- a/doc/shared/sundials/GPU.rst +++ b/doc/shared/sundials/GPU.rst @@ -64,7 +64,7 @@ data partitioning (achievable with the NVECTOR_MANYVECTOR, see programming environments they support, and what class of memory they support (unmanaged or UVM). Users may also supply their own GPU-enabled :c:type:`N_Vector`, :c:type:`SUNMatrix`, or :c:type:`SUNLinearSolver` - implementation, and the capabilties will be leveraged since SUNDIALS operates + implementation, and the capabilities will be leveraged since SUNDIALS operates on data through these APIs. .. ifconfig:: package_name != 'kinsol' @@ -77,7 +77,7 @@ data partitioning (achievable with the NVECTOR_MANYVECTOR, see programming environments they support, and what class of memory they support (unmanaged or UVM). Users may also supply their own GPU-enabled :c:type:`N_Vector`, :c:type:`SUNMatrix`, :c:type:`SUNLinearSolver`, or - :c:type:`SUNNonlinearSolver` implementation, and the capabilties will be + :c:type:`SUNNonlinearSolver` implementation, and the capabilities will be leveraged since SUNDIALS operates on data through these APIs. In addition, SUNDIALS provides a memory management helper module @@ -174,7 +174,7 @@ accelerated SUNDIALS are: #. Write user-supplied functions so that they use data only in the device memory space (again, unless an atypical data partitioning is used). A few examples of these functions are the right-hand side evaluation function, the Jacobian - evalution function, or the preconditioner evaulation function. In the context + evaluation function, or the preconditioner evaluation function. In the context of CUDA and the right-hand side function, one way a user might ensure data is accessed on the device is, for example, calling a CUDA kernel, which does all of the computation, from a CPU function which simply extracts the underlying diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index d666fc7b29..d75eca6e9e 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -31,7 +31,7 @@ by cloning the `SUNDIALS GitHub repository <https://github.com/LLNL/sundials>`_ SUNDIALS release compressed archives (``.tar.gz``) from the SUNDIALS `website <https://computing.llnl.gov/projects/sundials/sundials-software>`_. -The compressed archives allow for downloading of indvidual SUNDIALS packages. +The compressed archives allow for downloading of individual SUNDIALS packages. The name of the distribution archive is of the form ``SOLVER-7.1.0.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, ``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``7.1.0`` @@ -187,7 +187,7 @@ Using CMake with the ``cmake-gui`` GUI follows a similar process: #. The first time you click ``Configure``, make sure to pick the appropriate generator (the following will assume generation of Unix - Makfiles). + Makefiles). #. New values are highlighted in red @@ -591,7 +591,7 @@ illustration only. Default: ``OFF`` .. warning:: There is a known issue with MSYS/gfortran and SUNDIALS shared libraries - that causes linking the Fortran interfaces to fail when buidling SUNDIALS. For + that causes linking the Fortran interfaces to fail when building SUNDIALS. For now the work around is to only build with static libraries when using MSYS with gfortran on Windows. @@ -612,7 +612,7 @@ illustration only. .. cmakeoption:: SUNDIALS_BUILD_WITH_MONITORING - Build SUNDIALS with capabilties for fine-grained monitoring of solver progress + Build SUNDIALS with capabilities for fine-grained monitoring of solver progress and statistics. This is primarily useful for debugging. Default: OFF @@ -624,7 +624,7 @@ illustration only. .. cmakeoption:: SUNDIALS_BUILD_WITH_PROFILING - Build SUNDIALS with capabilties for fine-grained profiling. + Build SUNDIALS with capabilities for fine-grained profiling. This requires POSIX timers or the Windows ``profileapi.h`` timers. Default: OFF @@ -669,8 +669,8 @@ illustration only. .. cmakeoption:: SUNDIALS_GINKGO_BACKENDS - Semi-colon separated list of Ginkgo target architecutres/executors to build for. - Options currenty supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and SYCL. + Semi-colon separated list of Ginkgo target architectures/executors to build for. + Options currently supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and SYCL. Default: "REF;OMP" @@ -901,7 +901,7 @@ illustration only. .. cmakeoption:: PETSC_INCLUDES - Semi-colon separated list of PETSc include directroies. Unless provided by + Semi-colon separated list of PETSc include directories. Unless provided by the user, this is autopopulated based on the PETSc installation found in ``PETSC_DIR``. @@ -935,7 +935,7 @@ illustration only. Default: ``OFF`` - .. note:: See additional information on building wtih + .. note:: See additional information on building with SuperLU_DIST enabled in :numref:`Installation.CMake.ExternalLibraries`. .. cmakeoption:: SUPERLUDIST_DIR @@ -1264,7 +1264,7 @@ CUDA (for NVIDIA devices), HIP (for AMD devices) and SYCL/DPC++ (for Intel devic supported hardware). To enable Ginkgo in SUNDIALS, set the :cmakeop:`ENABLE_GINKGO` to ``ON`` and provide the path to the root of the Ginkgo installation in :cmakeop:`Ginkgo_DIR`. Additionally, :cmakeop:`SUNDIALS_GINKGO_BACKENDS` must be set to a list of Ginkgo target -architecutres/executors. E.g., +architectures/executors. E.g., .. code-block:: bash diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 6650b88d20..9bc00e30da 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -900,7 +900,7 @@ SUNLinSol implementations. As SUNDIALS packages utilize generic SUNLinSol modules they may naturally leverage user-supplied ``SUNLinearSolver`` implementations, thus there exist a wide range of possible linear solver combinations. Some intended use cases for both the -SUNDIALS-provided and user-supplied SUNLinSol modules are discussd in the +SUNDIALS-provided and user-supplied SUNLinSol modules are discussed in the sections below. @@ -949,7 +949,7 @@ Matrix-based iterative linear solvers (reusing :math:`A`) Matrix-based iterative linear solver modules require a matrix and compute an inexact solution to the linear system *defined by the matrix*. This -matrix will be updated infrequently and resued across multiple solves +matrix will be updated infrequently and reused across multiple solves to amortize the cost of matrix construction. As in the direct linear solver case, only thin SUNMATRIX and SUNLinSol wrappers for the underlying matrix and linear solver structures need to be created to utilize diff --git a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst index 34fd25c82d..5b1a4e0a3d 100644 --- a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst +++ b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst @@ -45,9 +45,9 @@ Using SUNLINEARSOLVER_GINKGO After choosing a compatible ``N_Vector`` (see :numref:`SUNMatrix.Ginkgo.CompatibleNVectors`) and creating a Ginkgo-enabled ``SUNMatrix`` (see :numref:`SUNMatrix.Ginkgo`) to use the SUNLINEARSOLVER_GINKGO module, we first create a Ginkgo stopping criteria object. Importantly, the ``sundials::ginkgo::DefaultStop`` class provided -by SUNDIALS implements a stopping critierion that matches the default SUNDIALS stopping critierion. +by SUNDIALS implements a stopping criterion that matches the default SUNDIALS stopping criterion. Namely, it checks if the max iterations (5 by default) were reached or if the absolute residual -norm was below a speicified tolerance. The critierion can be created just like any other +norm was below a specified tolerance. The criterion can be created just like any other Ginkgo stopping criteria: .. code-block:: cpp @@ -59,7 +59,7 @@ Ginkgo stopping criteria: but it is optional. However, to use the Ginkgo multigrid or cbgmres linear solvers, different Ginkgo criterion must be used. -Once we have created our stopping critierion, we create a Ginkgo solver factory object and +Once we have created our stopping criterion, we create a Ginkgo solver factory object and wrap it in a :cpp:type:`sundials::ginkgo::LinearSolver` object. In this example, we create a Ginkgo conjugate gradient solver: @@ -185,7 +185,7 @@ In this section we list the public API of the :cpp:type:`sundials::ginkgo::Linea .. cpp:function:: gko::LinOp* Solve(N_Vector b, N_Vector x, sunrealtype tol) - Solve the linear system Ax = b to the specificed tolerance. + Solve the linear system Ax = b to the specified tolerance. :param b: the right-hand side vector :param x: the solution vector diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst index 177d9558b2..462c0c7c7e 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst @@ -164,7 +164,7 @@ information: * ``berr`` -- the componentwise relative backward error of the computed solution, -* ``grid`` -- pointer to the SuperLU_DIST structure that strores the 2D process grid +* ``grid`` -- pointer to the SuperLU_DIST structure that stores the 2D process grid * ``lu`` -- pointer to the SuperLU_DIST structure that stores the distributed ``L`` and ``U`` factors, @@ -172,7 +172,7 @@ information: * ``scaleperm`` -- pointer to the SuperLU_DIST structure that stores vectors describing the transformations done to the matrix ``A``, -* ``options`` -- pointer to the SuperLU_DIST stucture which contains options that control +* ``options`` -- pointer to the SuperLU_DIST structure which contains options that control how the linear system is factorized and solved, * ``solve`` -- pointer to the SuperLU_DIST solve structure, diff --git a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst index 23894bd7ef..58ce79681d 100644 --- a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst +++ b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst @@ -125,7 +125,7 @@ In addition, the module provides the following user-callable routines: The function ``SUNLinSol_cuSolverSp_batchQR_GetDeviceSpace`` returns the cuSOLVER batch QR method internal buffer size, in bytes, in the argument ``cuSolverInternal`` and the cuSOLVER - batch QR workspace buffer size, in bytes, in the agrument + batch QR workspace buffer size, in bytes, in the argument ``cuSolverWorkspace``. The size of the internal buffer is proportional to the number of matrix blocks while the size of the workspace is almost independent of the number of blocks. diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index 11f69ab896..fe17e6f3f2 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -207,7 +207,7 @@ set and all operations are copied when cloning a matrix. SUNMATRIX_CUSPARSE CUDA sparse CSR matrix SUNMATRIX_CUSTOM User-provided custom matrix SUNMATRIX_DENSE Dense :math:`M \times N` matrix - SUNMATRIX_GINKGO SUNMatrix wraper for Ginkgo matrices + SUNMATRIX_GINKGO SUNMatrix wrapper for Ginkgo matrices SUNMATRIX_MAGMADENSE Dense :math:`M \times N` matrix SUNMATRIX_ONEMKLDENSE oneMKL dense :math:`M \times N` matrix SUNMATRIX_SLUNRLOC SUNMatrix wrapper for SuperLU_DIST SuperMatrix diff --git a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst index 899782dcbf..bbcadfe20c 100644 --- a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst @@ -142,7 +142,7 @@ class. :param rows: number of matrix rows :param cols: number of matrix columns - :param ex: an execuation space + :param ex: an execution space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(size_type blocks, size_type block_rows, \ @@ -166,7 +166,7 @@ class. :param blocks: number of matrix blocks :param block_rows: number of rows in a block :param block_cols: number of columns in a block - :param ex: an execuation space + :param ex: an execution space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(DenseMatrix&& that_matrix) noexcept diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 3499367c7b..2efc154aa4 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -70,7 +70,7 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, .. c:enumerator:: SUNMEMTYPE_PINNED - Page-locked memory accesible on the host + Page-locked memory accessible on the host .. c:enumerator:: SUNMEMTYPE_DEVICE diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index d169c83001..4715ee8e29 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -122,7 +122,7 @@ initialization (:c:func:`SUNNonlinSolInitialize`), setup * *mem* -- the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value + The return value is zero for a successful solve, a positive value for a recoverable error (i.e., the solve failed and the integrator should reduce the step size and reattempt the step), and a negative value for an unrecoverable error (i.e., the solve failed the and @@ -357,7 +357,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** @@ -383,7 +383,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** @@ -415,7 +415,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst index e9d9c856f1..1cb332300d 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst @@ -25,7 +25,7 @@ configured to use PETSc. Instructions on how to do this are given in SUNNonlinSol_PetscSNES module, include the header file ``sunnonlinsol/sunnonlinsol_petscsnes.h``. The library to link to is ``libsundials_sunnonlinsolpetsc.lib`` where ``.lib`` is typically ``.so`` for -shared libaries and ``.a`` for static libraries. Users of the +shared libraries and ``.a`` for static libraries. Users of the SUNNonlinSol_PetscSNES module should also see :numref:`NVectors.NVPETSc` which discusses the NVECTOR interface to the PETSc ``Vec`` API. @@ -184,4 +184,4 @@ These entries of the *content* field contain the following information: * ``r`` -- the nonlinear residual, * ``y`` -- wrapper for PETSc vectors used in the system function, * ``f`` -- wrapper for PETSc vectors used in the system function, -* ``Sys`` -- nonlinear system definining function. +* ``Sys`` -- nonlinear system defining function. diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index aa3d25945c..a7478dc4e8 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -486,7 +486,7 @@ \setlength{\leftmargin}{\labelwidth+\labelsep}}} {\end{list}} %%----------------------------------------------------- -%% Underlying list environemnt for function definitions +%% Underlying list environment for function definitions %%----------------------------------------------------- \newenvironment{Ventry}[1][\quad] {\begin{list}{}{ @@ -652,7 +652,7 @@ \makeatletter \long\def\addDepName#1{\def\@tempa{#1}\ifx\@tempa\empty\item[Deprecated Name]{None}\else\item[Deprecated Name]{For backward compatibility, the wrapper - function \id{#1} with idential input and output arguments is also + function \id{#1} with identical input and output arguments is also provided.}\fi} \makeatother diff --git a/doc/superbuild/source/contributing/index.rst b/doc/superbuild/source/contributing/index.rst index 947443d9f5..4bc71a6bc5 100644 --- a/doc/superbuild/source/contributing/index.rst +++ b/doc/superbuild/source/contributing/index.rst @@ -16,7 +16,7 @@ Contributing ============ -There are two primary ways of contributing to SUNDIALS. The first way is by particpating +There are two primary ways of contributing to SUNDIALS. The first way is by participating in the development of SUNDIALS directly through contributions of code to the primary `SUNDIALS repository <https://github.com/LLNL/sundials>`_. This is the best way to contribute bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources diff --git a/doc/superbuild/source/developers/appendix/GitCheatSheet.rst b/doc/superbuild/source/developers/appendix/GitCheatSheet.rst index 3e3c7f2a5c..1f7d86fa7d 100644 --- a/doc/superbuild/source/developers/appendix/GitCheatSheet.rst +++ b/doc/superbuild/source/developers/appendix/GitCheatSheet.rst @@ -248,7 +248,7 @@ the :ref:`Workflow` section. reordering, squashing, updating commit messages, etc.) before pushing to the remote repository. - Rebase the commited but not pushed changes on the current branch and execute + Rebase the committed but not pushed changes on the current branch and execute a given command (``cmd``) between each step in the rebase .. code-block:: none diff --git a/doc/superbuild/source/developers/getting_started/Workflow.rst b/doc/superbuild/source/developers/getting_started/Workflow.rst index 5da388e53a..52967d44b8 100644 --- a/doc/superbuild/source/developers/getting_started/Workflow.rst +++ b/doc/superbuild/source/developers/getting_started/Workflow.rst @@ -149,7 +149,7 @@ branches and the ``master`` for maintenance branches. work. #. During the development cycle it is a good practice to periodically push local - commits to the remote repo. To push your locally commited changes use: + commits to the remote repo. To push your locally committed changes use: .. code-block:: none @@ -259,7 +259,7 @@ Manually resolve the conflicts in an editor: $ git rebase --continue -#. If desired, push the updated local brach to the remote repo with +#. If desired, push the updated local branch to the remote repo with .. code-block:: none @@ -293,7 +293,7 @@ merge tool: $ git rebase --continue -#. If desired, push the updated local brach to the remote repo with +#. If desired, push the updated local branch to the remote repo with .. code-block:: none diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 5a05602867..ba5a9c4ff8 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -17,7 +17,7 @@ Naming ====== -All exported symbols that will be publically available must be namespaced +All exported symbols that will be publicly available must be namespaced appropriately! * ``SUN_`` or ``SUNDIALS_`` for macros diff --git a/doc/superbuild/source/developers/testing/Answers.rst b/doc/superbuild/source/developers/testing/Answers.rst index ecefcfbd4d..6d64f7e4ea 100644 --- a/doc/superbuild/source/developers/testing/Answers.rst +++ b/doc/superbuild/source/developers/testing/Answers.rst @@ -32,7 +32,7 @@ Due to difference in microarichtectures and the nature of floating point arithme possible that the output generated on one machine may differ from the output generated on another. As such, we specify that the the answer files that are embedded in ``examples/`` (the ``.out`` files) should match what is produced on the Jenkins CI machine. We also have a `separate git -repostiory <https://github.com/sundials-codes/answers>`_ which holds answers for other machines, +repository <https://github.com/sundials-codes/answers>`_ which holds answers for other machines, such as the GitHub Actions virtual machines. diff --git a/doc/superbuild/source/developers/testing/CI.rst b/doc/superbuild/source/developers/testing/CI.rst index 00ded30a77..a71b4e5930 100644 --- a/doc/superbuild/source/developers/testing/CI.rst +++ b/doc/superbuild/source/developers/testing/CI.rst @@ -94,7 +94,7 @@ environment so that its buildcache can be leveraged. We also maintain two containers for the {int32, double} pair that are built automatically (in a GitHub action) every week against the latest Spack develop commit. This allows us to test against -the latest versions of dependencies reguarly and detect interface breakages. +the latest versions of dependencies regularly and detect interface breakages. GitLab CI Testing @@ -264,7 +264,7 @@ These submodules work in conjunction with ``spack_packages/sundials/package.py`` to configure and build any third-party libraries needed by the SUNDIALS configuration and generates an initial CMake cache file for building SUNDIALS. Other packages can be added to ``spack_packages/<package name>/package.py`` -if the default Spack package needs to be overriden. We do this currently for +if the default Spack package needs to be overridden. We do this currently for Caliper, as we need a newer version than in the Spack commit currently used. Updating Spack diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index b95390bc4a..8f4b873e9e 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -148,7 +148,7 @@ struct UserData N_Vector vmask; N_Vector wmask; - /* problem paramaters */ + /* problem parameters */ int nvar; /* number of species */ long int nx; /* number of intervals globally */ int nxl; /* number of intervals locally */ @@ -197,7 +197,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) 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 8bee143d0b..b5029ca9a5 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -22,7 +22,7 @@ * w_t = -c * w_x + (B - w) / ep - w * u * * for t in [0, 10], x in [0, xmax] with periodic boundary conditions. The - * initial condition is a Gaussian pertubation of the steady state + * initial condition is a Gaussian perturbation of the steady state * solution without advection * * u(0,x) = k1 * A / k4 + p(x) @@ -1730,7 +1730,7 @@ void InputError(char* name) * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ int check_retval(void* returnvalue, const char* funcname, int opt) { diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 63108a9bd2..5643211620 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -16,7 +16,7 @@ * u_t = Dux u_xx + Duy u_yy + A + u * u * v - (B + 1) * u * v_t = Dvx u_xx + Dvy u_yy + B * u - u * u * v * - * where u and v represent the concentrations of the two chemcial species, the + * where u and v represent the concentrations of the two chemical species, the * diffusion rates are Dux = Duy = Dvx = Dvy = 1e-3, and the species with * constant concentration over time are A = 1 and B = 3. * @@ -159,7 +159,7 @@ struct UserData bool reaction = true; // -------------------------- - // Discretization parameteres + // Discretization parameters // -------------------------- // Global and local number of nodes in the x and y directions @@ -228,7 +228,7 @@ struct UserData sunrealtype* SWsend = NULL; sunrealtype* NErecv = NULL; - // Recieve and send requests + // Receive and send requests MPI_Request reqRW, reqRE, reqRS, reqRN; MPI_Request reqSW, reqSE, reqSS, reqSN; MPI_Request reqRC, reqSC; @@ -307,7 +307,7 @@ struct UserData N_Vector diag = NULL; // inverse of Jacobian diagonal // --------------- - // Ouput variables + // Output variables // --------------- int output = 1; // 0 = no output, 1 = output stats, 2 = write to disk @@ -597,7 +597,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / udata.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(&udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -2349,14 +2349,14 @@ static void InputHelp() << " --mri-cvode-local : use MRI with CVODE task-local stepper" << endl; cout << " --rtol_imex <rtol> : IMEX relative tolerance" << endl; - cout << " --atol_imex <atol> : IMEX absoltue tolerance" << endl; + cout << " --atol_imex <atol> : IMEX absolute tolerance" << endl; cout << " --h_imex <h> : IMEX fixed step size" << endl; cout << " --order_imex <ord> : IMEX method order" << endl; cout << " --rtol_slow <rtol> : MRI slow relative tolerance" << endl; - cout << " --atol_slow <atol> : MRI slow absoltue tolerance" << endl; + cout << " --atol_slow <atol> : MRI slow absolute tolerance" << endl; cout << " --h_slow <h> : MRI slow step size" << endl; cout << " --rtol_fast <rtol> : MRI fast relative tolerance" << endl; - cout << " --atol_fast <atol> : MRI fast absoltue tolerance" << endl; + cout << " --atol_fast <atol> : MRI fast absolute tolerance" << endl; cout << " --h_fast <h> : MRI fast step size" << endl; cout << " --controller <ctr> : time step adaptivity" << endl; cout << " --nonlinear : nonlinearly implicit" << endl; @@ -2839,7 +2839,7 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, return 0; } -// Ouput timing stats +// Output timing stats static int OutputTiming(UserData* udata) { if (udata->outproc) diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 566a7a4b41..0bf8d97ba7 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -153,7 +153,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -180,7 +180,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -486,7 +486,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1576,7 +1576,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --fixedstep <step> : used fixed step size" << endl; diff --git a/examples/arkode/CXX_parallel/plot_heat2D_p.py b/examples/arkode/CXX_parallel/plot_heat2D_p.py index 0a99dfbc5e..55a0649978 100755 --- a/examples/arkode/CXX_parallel/plot_heat2D_p.py +++ b/examples/arkode/CXX_parallel/plot_heat2D_p.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/arkode/CXX_parhyp/CMakeLists.txt b/examples/arkode/CXX_parhyp/CMakeLists.txt index a56531b5e1..291a8cc33f 100644 --- a/examples/arkode/CXX_parhyp/CMakeLists.txt +++ b/examples/arkode/CXX_parhyp/CMakeLists.txt @@ -85,7 +85,7 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index d5cb124652..e80c842bd4 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -155,7 +155,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -185,7 +185,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -518,7 +518,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1852,7 +1852,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --fixedstep <step> : used fixed step size" << endl; @@ -2620,7 +2620,7 @@ int HypreLS_Setup(SUNLinearSolver LS, SUNMatrix A) flag = HYPRE_StructPFMGCreate(udata->comm_c, &(HLS_PRECOND(LS))); if (flag != 0) { return (flag); } - // Signal that the inital guess is zero + // Signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(HLS_PRECOND(LS)); if (flag != 0) { return (flag); } @@ -2744,14 +2744,14 @@ int HypreLS_Solve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, HLS_X(LS)); } - // If a convergence error occured, clear the error, and return with a + // If a convergence error occurred, clear the error, and return with a // recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); return SUNLS_CONV_FAIL; } - // If any other error occured return with an unrecoverable error. + // If any other error occurred return with an unrecoverable error. else if (flag != 0) { return SUN_ERR_EXT_FAIL; } // Update iteration count diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index 2582758ef7..51e2673424 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -155,7 +155,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -208,7 +208,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -523,7 +523,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1094,7 +1094,7 @@ static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, flag = HYPRE_StructPFMGCreate(udata->comm_c, &(udata->precond)); if (flag != 0) { return -1; } - // Signal that the inital guess is zero + // Signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (flag != 0) { return -1; } @@ -1167,7 +1167,7 @@ static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, flag = HYPRE_StructPFMGSolve(udata->precond, udata->Amatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (flag != 0) { return 1; } @@ -2386,7 +2386,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --fixedstep <step> : used fixed step size" << endl; 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 8410570911..caa5aaa5ad 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -160,7 +160,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -209,7 +209,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file streams @@ -481,7 +481,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / udata.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(&udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1411,7 +1411,7 @@ static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, flag = HYPRE_StructPFMGSolve(udata->precond, udata->Amatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (flag != 0) { return 1; } @@ -1610,7 +1610,7 @@ static int HyprePFMG(UserData* udata) return -1; } - // signal that the inital guess is zero + // signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (flag != 0) { @@ -2543,7 +2543,7 @@ static void InputHelp() cout << " --r <r> : reaction coefficient" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --linear : enable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --hf <step> : used fixed step size" << endl; 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 1f90ddcc7a..da67100875 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -159,7 +159,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -210,7 +210,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file streams @@ -543,7 +543,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / udata.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(&udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1365,7 +1365,7 @@ static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, flag = HYPRE_StructPFMGSolve(udata->precond, udata->Amatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (flag != 0) { return 1; } @@ -1564,7 +1564,7 @@ static int HyprePFMG(UserData* udata) return -1; } - // signal that the inital guess is zero + // signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (flag != 0) { @@ -2509,7 +2509,7 @@ static void InputHelp() cout << " --r <r> : reaction coefficient" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --linear : enable linearly implicit flag" << endl; cout << " --sorder <ord> : slow method order" << endl; cout << " --forder <ord> : fast method order" << endl; diff --git a/examples/arkode/CXX_parhyp/plot_heat2D_p.py b/examples/arkode/CXX_parhyp/plot_heat2D_p.py index 0a99dfbc5e..55a0649978 100755 --- a/examples/arkode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/arkode/CXX_parhyp/plot_heat2D_p.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index 9afe3e1ac3..4ee2587c82 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -223,7 +223,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uopts.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata, uopts); if (check_flag(flag, "OpenOutput")) { return 1; } diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index bdf4102903..9b50109742 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -591,7 +591,7 @@ static void InputHelp() cout << " --order_fast <int> : MRI fast method order\n"; cout << " --ark_dirk : Use DIRK method from ARK method\n"; cout << " --rtol <real> : relative tolerance\n"; - cout << " --atol <real> : absoltue tolerance\n"; + cout << " --atol <real> : absolute tolerance\n"; cout << " --rtol_fast <real> : MRI fast relative tolerance\n"; cout << " --atol_fast <real> : MRI fast absolute tolerance\n"; cout << " --fixed_h <real> : fixed step size\n"; diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index 6ce667770c..944c40be1a 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -27,11 +27,11 @@ * y(0) = [1,1,1]'. * * The stiffness of the problem is directly proportional to the - * value of "lamda". The value of lamda should be negative to + * value of "lambda". The value of lambda should be negative to * result in a well-posed ODE; for values with magnitude larger than * 100 the problem becomes quite stiff. * - * In this example, we choose lamda = -100. + * In this example, we choose lambda = -100. * * This program solves the problem with the DIRK method, * Newton iteration with the dense linear solver, and a @@ -86,7 +86,7 @@ int main() sunindextype NEQ = 3; // number of dependent vars. sunrealtype reltol = SUN_RCONST(1.0e-6); // tolerances sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); // stiffness parameter + sunrealtype lambda = SUN_RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag @@ -97,7 +97,7 @@ int main() // Initial problem output cout << "\nAnalytical ODE test problem:\n"; - cout << " lamda = " << lamda << "\n"; + cout << " lambda = " << lambda << "\n"; cout << " reltol = " << reltol << "\n"; cout << " abstol = " << abstol << "\n\n"; @@ -167,7 +167,7 @@ int main() if (check_flag((void*)LS, "SUNLinSol_Dense", 0)) { return 1; } /* Call ARKStepCreate to initialize the ARK timestepper memory and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, sunctx); @@ -175,7 +175,7 @@ int main() // Set routines flag = ARKodeSetUserData(arkode_mem, - (void*)&lamda); // Pass lamda to user functions + (void*)&lambda); // Pass lambda to user functions if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } flag = ARKodeSStolerances(arkode_mem, reltol, abstol); // Specify tolerances diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.out b/examples/arkode/CXX_serial/ark_analytic_sys.out index 92c5378f2e..955ee55f38 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.out +++ b/examples/arkode/CXX_serial/ark_analytic_sys.out @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1e-06 abstol = 1e-10 diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index bf18a6fbb0..3298eac1f9 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -122,7 +122,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -394,7 +394,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -881,7 +881,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --fixedstep <step> : used fixed step size" << endl; diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index ff1d6daa05..bd945fa00b 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -245,7 +245,7 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "Ytrue", 1)) { return 1; } // Initialize ARKStep. Specify the right-hand side function(s) for - // M(t) * y' = fe(t,y) + fi(t,y), the inital time T0, and the + // M(t) * y' = fe(t,y) + fi(t,y), the initial time T0, and the // initial dependent variable vector y. if (rk_type == 0) { // ARK method diff --git a/examples/arkode/CXX_serial/plot_heat2D.py b/examples/arkode/CXX_serial/plot_heat2D.py index c494bc06de..23ebfb9e1e 100755 --- a/examples/arkode/CXX_serial/plot_heat2D.py +++ b/examples/arkode/CXX_serial/plot_heat2D.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/arkode/CXX_superludist/CMakeLists.txt b/examples/arkode/CXX_superludist/CMakeLists.txt index b9e286c11c..96583a5564 100644 --- a/examples/arkode/CXX_superludist/CMakeLists.txt +++ b/examples/arkode/CXX_superludist/CMakeLists.txt @@ -61,7 +61,7 @@ else() set(_ex_lang CXX) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) sundials_install_examples( diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 25b366c677..15f50ea46e 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -330,7 +330,7 @@ int main(int argc, char* argv[]) for (i = 0; i < N; i++) { data[IDX(i, 2)] = ONE; } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -1024,7 +1024,7 @@ static int MassMatrix(sunrealtype t, SUNMatrix M, void* user_data, Mr = Mr + Quad(ChiL1 * ChiR1, ChiL2 * ChiR2, ChiL3 * ChiR3, xc, xr); } - /* insert mass matrix entires into CSR matrix structure */ + /* insert mass matrix entries into CSR matrix structure */ /* u row */ rowptrs[IDX(i, 0)] = nz; diff --git a/examples/arkode/CXX_xbraid/CMakeLists.txt b/examples/arkode/CXX_xbraid/CMakeLists.txt index b788cf1016..36f792c459 100644 --- a/examples/arkode/CXX_xbraid/CMakeLists.txt +++ b/examples/arkode/CXX_xbraid/CMakeLists.txt @@ -149,7 +149,7 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file 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 3d11f6a539..0dd094d8b6 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -165,7 +165,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -215,7 +215,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -238,13 +238,13 @@ struct UserData int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels - int x_min_coarse; // min possible coarse gird size + int x_min_coarse; // min possible coarse grid size int x_nrelax; // number of CF relaxation sweeps on all levels int x_nrelax0; // number of CF relaxation sweeps on level 0 int x_tnorm; // temporal stopping norm int x_cfactor; // coarsening factor int x_cfactor0; // coarsening factor on level 0 - int x_max_iter; // max number of interations + int x_max_iter; // max number of iterations int x_storage; // Full storage on levels >= storage int x_print_level; // xbraid output level int x_access_level; // access level @@ -1400,7 +1400,7 @@ static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, flag = HYPRE_StructPFMGCreate(udata->comm_c, &(udata->precond)); if (flag != 0) { return -1; } - // Signal that the inital guess is zero + // Signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (flag != 0) { return -1; } @@ -1473,7 +1473,7 @@ static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, flag = HYPRE_StructPFMGSolve(udata->precond, udata->Amatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (flag != 0) { return 1; } @@ -2781,7 +2781,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --gmres : use GMRES linear solver" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index 686862ea5a..d6cc3b7319 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -163,7 +163,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -185,7 +185,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -206,13 +206,13 @@ struct UserData int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels - int x_min_coarse; // min possible coarse gird size + int x_min_coarse; // min possible coarse grid size int x_nrelax; // number of CF relaxation sweeps on all levels int x_nrelax0; // number of CF relaxation sweeps on level 0 int x_tnorm; // temporal stopping norm int x_cfactor; // coarsening factor int x_cfactor0; // coarsening factor on level 0 - int x_max_iter; // max number of interations + int x_max_iter; // max number of iterations int x_storage; // Full storage on levels >= storage int x_print_level; // xbraid output level int x_access_level; // access level @@ -1951,7 +1951,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --gmres : use GMRES linear solver" << endl; diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 3ca94f8fcf..3e6cd8b1d5 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -130,7 +130,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -150,13 +150,13 @@ struct UserData int x_nt; // number of fine grid time points int x_skip; // skip all work on first down cycle int x_max_levels; // max number of levels - int x_min_coarse; // min possible coarse gird size + int x_min_coarse; // min possible coarse grid size int x_nrelax; // number of CF relaxation sweeps on all levels int x_nrelax0; // number of CF relaxation sweeps on level 0 int x_tnorm; // temporal stopping norm int x_cfactor; // coarsening factor int x_cfactor0; // coarsening factor on level 0 - int x_max_iter; // max number of interations + int x_max_iter; // max number of iterations int x_storage; // Full storage on levels >= storage int x_print_level; // xbraid output level int x_access_level; // access level @@ -1255,7 +1255,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; cout << " --gmres : use GMRES linear solver" << endl; diff --git a/examples/arkode/CXX_xbraid/plot_heat2D.py b/examples/arkode/CXX_xbraid/plot_heat2D.py index f24592bfdc..a2789089c4 100755 --- a/examples/arkode/CXX_xbraid/plot_heat2D.py +++ b/examples/arkode/CXX_xbraid/plot_heat2D.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/arkode/C_manyvector/CMakeLists.txt b/examples/arkode/C_manyvector/CMakeLists.txt index 25ead792fd..e22b802ce3 100644 --- a/examples/arkode/C_manyvector/CMakeLists.txt +++ b/examples/arkode/C_manyvector/CMakeLists.txt @@ -60,7 +60,7 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c index dca37e62d8..45ab77e455 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c @@ -194,7 +194,7 @@ int main(void) } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(fe, fi, T0, y, ctx); diff --git a/examples/arkode/C_openmp/CMakeLists.txt b/examples/arkode/C_openmp/CMakeLists.txt index 8bd1f15e44..100d89527d 100644 --- a/examples/arkode/C_openmp/CMakeLists.txt +++ b/examples/arkode/C_openmp/CMakeLists.txt @@ -61,7 +61,7 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 9fa052cc15..1fc53f29d2 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -230,7 +230,7 @@ int main(int argc, char* argv[]) if (check_flag((void*)LS, "SUNLinSol_Band", 0)) { return 1; } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_openmpdev/CMakeLists.txt b/examples/arkode/C_openmpdev/CMakeLists.txt index 9c94239a2e..11dca6aafc 100644 --- a/examples/arkode/C_openmpdev/CMakeLists.txt +++ b/examples/arkode/C_openmpdev/CMakeLists.txt @@ -61,7 +61,7 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c index 82e13c66a7..c6307e226f 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c @@ -125,7 +125,7 @@ int main(void) N_VConst(0.0, y); /* Set initial conditions */ /* Call ARKStepCreate to initialize the integrator memory and specify the - right-hand side function in y'=f(t,y), the inital time T0, and + right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_parallel/CMakeLists.txt b/examples/arkode/C_parallel/CMakeLists.txt index 7ace3f347f..c3c58469ac 100644 --- a/examples/arkode/C_parallel/CMakeLists.txt +++ b/examples/arkode/C_parallel/CMakeLists.txt @@ -105,7 +105,7 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file 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 73825d1221..c76464681c 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -22,7 +22,7 @@ * w_t = -c * w_x + (B - w) / ep - w * u * * for t in [0, 10], x in [0, xmax] with periodic boundary conditions. The - * initial condition is a Gaussian pertubation of the steady state + * initial condition is a Gaussian perturbation of the steady state * solution without advection * * u(0,x) = k1 * A / k4 + p(x) @@ -141,7 +141,7 @@ typedef struct N_Vector vmask; N_Vector wmask; - /* problem paramaters */ + /* problem parameters */ long long nvar; /* number of species */ long long nx; /* number of intervals globally */ long long nxl; /* number of intervals locally */ @@ -175,7 +175,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) @@ -1817,7 +1817,7 @@ void InputError(char* name) * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ int check_retval(void* returnvalue, const char* funcname, int opt) { 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 97802077ee..190b7c40ce 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -221,7 +221,7 @@ int main(int argc, char* argv[]) /* Call ARKStepCreate to initialize the integrator memory and specify the user's right hand side function in u'=fi(t,u) [here fe is NULL], - the inital time T0, and the initial dependent variable vector u. */ + the initial time T0, and the initial dependent variable vector u. */ arkode_mem = ARKStepCreate(NULL, f, T0, u, ctx); if (check_flag((void*)arkode_mem, "ARKStepCreate", 0, my_pe)) { diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index b7b08ab4c3..b5d9941480 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -235,7 +235,7 @@ int main(int argc, char* argv[]) /* Call ARKStepCreate to initialize the integrator memory and specify the user's right hand side functions in u'=fi(t,u) [here fe is NULL], - the inital time T0, and the initial dependent variable vector u. */ + the initial time T0, and the initial dependent variable vector u. */ arkode_mem = ARKStepCreate(NULL, f, T0, u, ctx); if (check_flag((void*)arkode_mem, "ARKStepCreate", 0, my_pe)) { diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index ab5090e86f..59dfc3d0f4 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -243,7 +243,7 @@ int main(int argc, char* argv[]) /* Call ARKStepCreate to initialize the integrator memory and specify the user's right hand side function in u'=fi(t,u) [here fe is NULL], - the inital time T0, and the initial dependent variable vector u. */ + the initial time T0, and the initial dependent variable vector u. */ arkode_mem = ARKStepCreate(NULL, f, T0, u, sunctx); if (check_flag((void*)arkode_mem, "ARKStepCreate", 0, my_pe)) { diff --git a/examples/arkode/C_petsc/ark_petsc_ex25.c b/examples/arkode/C_petsc/ark_petsc_ex25.c index 0c0bf03fba..7e35816933 100644 --- a/examples/arkode/C_petsc/ark_petsc_ex25.c +++ b/examples/arkode/C_petsc/ark_petsc_ex25.c @@ -192,7 +192,7 @@ int main(int argc, char** argv) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y),the inital time + specify the right-hand side function in y'=f(t,y),the initial time T0,and the initial dependent variable vector y. */ arkode_mem = ARKStepCreate(f_E, f_I, T0, nvecx, ctx); if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index 86b7633bb4..fbba99ffb9 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -223,7 +223,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index 9f160e8df1..732eb5a5b4 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -65,7 +65,7 @@ * subset of the ns by ns blocks). * * Four different runs are made for this problem. The product - * preconditoner is applied on the left and on the right. In each + * preconditioner is applied on the left and on the right. In each * case, both the modified and classical Gram-Schmidt options are * tested. In the series of runs, ARKStepCreate, SUNLinSol_SPGMR and * ARKodeSetLinearSolver are called only for the first run, whereas @@ -137,7 +137,7 @@ #define BB ONE /* BB = b */ #define DPREY ONE #define DPRED SUN_RCONST(0.5) -#define ALPH ONE +#define ALPHA ONE #define NP 3 #define NS (2 * NP) @@ -167,8 +167,8 @@ /* Spgmr Constants */ -#define MAXL 0 /* => use default = MIN(NEQ, 5) */ -#define DELT ZERO /* => use default = 0.05 */ +#define MAXL 0 /* => use default = MIN(NEQ, 5) */ +#define DELTA ZERO /* => use default = 0.05 */ /* Output Constants */ @@ -322,7 +322,7 @@ int main(int argc, char* argv[]) flag = SUNLinSol_SPGMRSetGSType(LS, gstype); if (check_flag(&flag, "SUNLinSol_SPGMRSetGSType", 1)) { return (1); } - flag = ARKodeSetEpsLin(arkode_mem, DELT); + flag = ARKodeSetEpsLin(arkode_mem, DELTA); if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return (1); } flag = ARKodeSetPreconditioner(arkode_mem, Precond, PSolve); @@ -535,17 +535,17 @@ static void PrintIntro(void) printf("Matrix parameters: a = %.2Lg e = %.2Lg g = %.2Lg\n", AA, EE, GG); printf("b parameter = %.2Lg\n", BB); printf("Diffusion coefficients: Dprey = %.2Lg Dpred = %.2Lg\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2Lg\n\n", ALPH); + printf("Rate parameter alpha = %.2Lg\n\n", ALPHA); #elif defined(SUNDIALS_DOUBLE_PRECISION) printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #else printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #endif printf("Mesh dimensions (mx,my) are %d, %d. ", MX, MY); printf("Total system size is neq = %d \n\n", NEQ); @@ -818,7 +818,7 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, for (i = 0; i < ns; i++) { rate[i] += c[j] * acoef[i][j]; } } - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = c[i] * (bcoef[i] * fac + rate[i]); } } diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index c13bd87b15..a21a59b285 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -15,11 +15,11 @@ * * The following is a simple example problem with analytical * solution, - * dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) * for t in the interval [0.0, 10.0], with initial condition: y=0. * * The stiffness of the problem is directly proportional to the - * value of "lamda". The value of lamda should be negative to + * value of "lambda". The value of lambda should be negative to * result in a well-posed ODE; for values with magnitude larger * than 100 the problem becomes quite stiff. * @@ -71,7 +71,7 @@ int main(void) sunindextype NEQ = 1; /* number of dependent vars. */ sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ + sunrealtype lambda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int flag; /* reusable error-checking flag */ @@ -90,7 +90,7 @@ int main(void) /* Initial diagnostics output */ printf("\nAnalytical ODE test problem:\n"); - printf(" lamda = %" GSYM "\n", lamda); + printf(" lambda = %" GSYM "\n", lambda); printf(" reltol = %.1" ESYM "\n", reltol); printf(" abstol = %.1" ESYM "\n\n", abstol); @@ -100,7 +100,7 @@ int main(void) N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -108,7 +108,7 @@ int main(void) /* Set routines */ flag = ARKodeSetUserData(arkode_mem, - (void*)&lamda); /* Pass lamda to user functions */ + (void*)&lambda); /* Pass lambda to user functions */ if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } flag = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } @@ -215,12 +215,12 @@ int main(void) static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ - sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot, 0) = lamda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - - lamda * atan(t); + NV_Ith_S(ydot, 0) = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - + lambda * atan(t); return 0; /* return with success */ } @@ -230,11 +230,11 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) { sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ - sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ sunrealtype* Jdata = SUNDenseMatrix_Data(J); /* Fill in Jacobian of f: set the first entry of the data array to set the (0,0) entry */ - Jdata[0] = lamda; + Jdata[0] = lambda; return 0; /* return with success */ } diff --git a/examples/arkode/C_serial/ark_analytic.out b/examples/arkode/C_serial/ark_analytic.out index f91f4a3492..83a4c0f4d3 100644 --- a/examples/arkode/C_serial/ark_analytic.out +++ b/examples/arkode/C_serial/ark_analytic.out @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1.0e-06 abstol = 1.0e-10 diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index 08d0fa5884..4b59063b1d 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -15,11 +15,11 @@ * * The following is a simple example problem with analytical * solution, - * dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) * for t in the interval [0.0, 10.0], with initial condition: y=0. * * The stiffness of the problem is directly proportional to the - * value of "lamda". The value of lamda should be negative to + * value of "lambda". The value of lambda should be negative to * result in a well-posed ODE; for values with magnitude larger * than 100 the problem becomes quite stiff. * @@ -73,7 +73,7 @@ int main(void) sunindextype NEQ = 1; /* number of dependent vars. */ sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ + sunrealtype lambda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -90,7 +90,7 @@ int main(void) /* Initial diagnostics output */ printf("\nAnalytical ODE test problem:\n"); - printf(" lamda = %" GSYM "\n", lamda); + printf(" lambda = %" GSYM "\n", lambda); printf(" reltol = %.1" ESYM "\n", reltol); printf(" abstol = %.1" ESYM "\n\n", abstol); @@ -100,7 +100,7 @@ int main(void) N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -108,7 +108,7 @@ int main(void) /* Set routines */ retval = ARKodeSetUserData(arkode_mem, - (void*)&lamda); /* Pass lamda to user functions */ + (void*)&lambda); /* Pass lambda to user functions */ if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } retval = ARKodeSStolerances(arkode_mem, reltol, abstol); /* Specify tolerances */ if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } @@ -198,12 +198,12 @@ int main(void) static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ - sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot, 0) = lamda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - - lamda * atan(t); + NV_Ith_S(ydot, 0) = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - + lambda * atan(t); return 0; /* return with success */ } @@ -247,7 +247,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype tcur, gamma; void* user_data; sunrealtype* rdata; - sunrealtype lamda; + sunrealtype lambda; /* retrieve implicit system data from ARKODE */ retval = ARKodeGetNonlinearSystemData(LS->content, &tcur, &zpred, &z, &Fi, @@ -258,11 +258,11 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, } /* extract stiffness parameter from user_data */ - rdata = (sunrealtype*)user_data; - lamda = rdata[0]; + rdata = (sunrealtype*)user_data; + lambda = rdata[0]; - /* perform linear solve: (1-gamma*lamda)*x = b */ - NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lamda); + /* perform linear solve: (1-gamma*lambda)*x = b */ + NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lambda); /* return with success */ return (SUN_SUCCESS); diff --git a/examples/arkode/C_serial/ark_analytic_mels.out b/examples/arkode/C_serial/ark_analytic_mels.out index 33b31c9050..dbe45fe83d 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.out +++ b/examples/arkode/C_serial/ark_analytic_mels.out @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1.0e-06 abstol = 1.0e-10 diff --git a/examples/arkode/C_serial/ark_analytic_nonlin.c b/examples/arkode/C_serial/ark_analytic_nonlin.c index 1bb5f99987..c39c3e80d1 100644 --- a/examples/arkode/C_serial/ark_analytic_nonlin.c +++ b/examples/arkode/C_serial/ark_analytic_nonlin.c @@ -83,7 +83,7 @@ int main(void) NV_Ith_S(y, 0) = 0.0; /* Specify initial condition */ /* Call ERKStepCreate to initialize the ERK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. */ arkode_mem = ERKStepCreate(f, T0, y, ctx); if (check_flag((void*)arkode_mem, "ERKStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index f2ab415dbf..a501f997e2 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -161,7 +161,7 @@ int main(void) NV_Ith_S(y, 2) = w0; /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index 38f312756c..e0c803561e 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -200,7 +200,7 @@ int main(void) for (i = 0; i < N; i++) { data[IDX(i, 2)] = SUN_RCONST(1.0); } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index b0ddf2295d..2978d2f77c 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -276,7 +276,7 @@ int main(int argc, char* argv[]) for (i = 0; i < N; i++) { data[IDX(i, 2)] = ONE; } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -837,7 +837,7 @@ static int MassMatrix(sunrealtype t, SUNMatrix M, void* user_data, Mr = Mr + Quad(ChiL1 * ChiR1, ChiL2 * ChiR2, ChiL3 * ChiR3, xc, xr); } - /* insert mass matrix entires into CSR matrix structure */ + /* insert mass matrix entries into CSR matrix structure */ /* u row */ rowptrs[IDX(i, 0)] = nz; diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index c1245a4f4e..1d52164719 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -365,7 +365,7 @@ int main(int argc, char* argv[]) */ /* Initialize the fast integrator. Specify the fast right-hand side - function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time T0, + function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ switch (solve_type) { @@ -534,7 +534,7 @@ int main(int argc, char* argv[]) */ /* Initialize the slow integrator. Specify the slow right-hand side - function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time + function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ switch (solve_type) { diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index f5fc65b396..d9831a948a 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -216,7 +216,7 @@ int main(void) for (i = 0; i < N; i++) { data[IDX(i, 2)] = ONE; } /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index ba858f7a0e..54398dcf71 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -100,7 +100,7 @@ static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, /* function for setting initial condition */ static int SetIC(N_Vector y, void* user_data); -/* function for checking retrun values */ +/* function for checking return values */ static int check_retval(void* flagvalue, const char* funcname, int opt); /* Main Program */ @@ -222,7 +222,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)LS, "SUNLinSol_Band", 0)) { return 1; } /* Initialize the fast integrator. Specify the implicit fast right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, and the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ inner_arkode_mem = ARKStepCreate(NULL, ff, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } @@ -259,7 +259,7 @@ int main(int argc, char* argv[]) */ /* Initialize the slow integrator. Specify the explicit slow right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index 25380ff79e..518eeccdb8 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -181,7 +181,7 @@ int main(int argc, char* argv[]) /* Call ARKStepCreate to initialize the ARK timestepper module and specify the right-hand side functions in y'=fe(t,y)+fi(t,y), - the inital time T0, and the initial dependent variable vector y. */ + the initial time T0, and the initial dependent variable vector y. */ arkode_mem = ARKStepCreate(fe, fi, T0, y, ctx); if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_brusselator_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 0b636fd3a7..1ea84c3ee5 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_mri.c @@ -129,7 +129,7 @@ int main(void) */ /* Initialize the fast integrator. Specify the explicit fast right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, and the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } @@ -158,7 +158,7 @@ int main(void) */ /* Initialize the slow integrator. Specify the explicit slow right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.c b/examples/arkode/C_serial/ark_harmonic_symplectic.c index 72ddfa656c..1071c3000a 100644 --- a/examples/arkode/C_serial/ark_harmonic_symplectic.c +++ b/examples/arkode/C_serial/ark_harmonic_symplectic.c @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) if (args.use_tstop) { ARKodeSetStopTime(arkode_mem, tout); } retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); - /* Compute the anaytical solution */ + /* Compute the analytical solution */ Solution(tret, y, solution, &udata); /* Compute L2 error */ diff --git a/examples/arkode/C_serial/ark_heat1D.c b/examples/arkode/C_serial/ark_heat1D.c index c5e7597ecb..6bed4a20c8 100644 --- a/examples/arkode/C_serial/ark_heat1D.c +++ b/examples/arkode/C_serial/ark_heat1D.c @@ -117,7 +117,7 @@ int main(void) N_VConst(0.0, y); /* Set initial conditions */ /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 6ba73c89ae..2ae783435e 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -286,7 +286,7 @@ int main(int argc, char* argv[]) */ /* Initialize the fast integrator. Specify the fast right-hand side - function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time T0, + function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ switch (solve_type) { @@ -428,7 +428,7 @@ int main(int argc, char* argv[]) */ /* Initialize the slow integrator. Specify the slow right-hand side - function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time + function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ switch (solve_type) { diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index d6993383fe..ad6776e7bb 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -25,11 +25,11 @@ * dv/dt = 50u * dw/dt = -w+u+v * - * for t in the interval [0.0, 1.0] with intial conditions u(0)=1.0, + * for t in the interval [0.0, 1.0] with initial conditions u(0)=1.0, * v(0)=0.0, and w(0)=2.0. In this problem the slow time scale (w) * depends on the fast components (u and v), but the fast components * are independent of the slow component. This system has the - * analytic soltuion, + * analytic solution, * * u(t) = cos(50t) * v(t) = sin(50t) @@ -134,7 +134,7 @@ int main(void) */ /* Initialize the fast integrator. Specify the explicit fast right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, and the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } @@ -159,7 +159,7 @@ int main(void) */ /* Initialize the slow integrator. Specify the explicit slow right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index 56754bb625..e6a5b6d138 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -139,7 +139,7 @@ int main(void) */ /* Initialize the fast integrator. Specify the explicit fast right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, and the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } @@ -168,7 +168,7 @@ int main(void) */ /* Initialize the slow integrator. Specify the explicit slow right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/examples/arkode/C_serial/ark_robertson.c b/examples/arkode/C_serial/ark_robertson.c index 833861243d..d0fdbb52d2 100644 --- a/examples/arkode/C_serial/ark_robertson.c +++ b/examples/arkode/C_serial/ark_robertson.c @@ -110,7 +110,7 @@ int main(void) NV_Ith_S(y, 2) = w0; /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -298,7 +298,7 @@ static int check_flag(void* flagvalue, const char* funcname, int opt) } /* compare the solution at the final time 1e11s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/arkode/C_serial/ark_robertson_constraints.c b/examples/arkode/C_serial/ark_robertson_constraints.c index 8c247dbf28..2e5062d0e5 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.c +++ b/examples/arkode/C_serial/ark_robertson_constraints.c @@ -120,7 +120,7 @@ int main(void) N_VConst(ONE, constraints); /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); @@ -338,7 +338,7 @@ static int check_flag(void* flagvalue, const char* funcname, int opt) } /* compare the solution at the final time 1e11s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/arkode/C_serial/ark_robertson_root.c b/examples/arkode/C_serial/ark_robertson_root.c index a4aa8fb066..846a1bdb04 100644 --- a/examples/arkode/C_serial/ark_robertson_root.c +++ b/examples/arkode/C_serial/ark_robertson_root.c @@ -122,7 +122,7 @@ int main(void) NV_Ith_S(atols, 2) = SUN_RCONST(1.0e-8); /* Call ARKStepCreate to initialize the ARK timestepper module and - specify the right-hand side function in y'=f(t,y), the inital time + specify the right-hand side function in y'=f(t,y), the initial time T0, and the initial dependent variable vector y. Note: since this problem is fully implicit, we set f_E to NULL and f_I to f. */ arkode_mem = ARKStepCreate(NULL, f, T0, y, ctx); diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index d44204d38f..4a099d99a4 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -22,7 +22,7 @@ * dv/dt = -100u * dw/dt = -w+u * - * for t in the interval [0.0, 2.0] with intial conditions + * for t in the interval [0.0, 2.0] with initial conditions * u(0)=9001/10001, v(0)=-1e-5/10001, and w(0)=1000. In this problem * the slow (w) and fast (u and v) components depend on one another. * @@ -113,7 +113,7 @@ int main(void) */ /* Initialize the fast integrator. Specify the explicit fast right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, and the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, and the initial dependent variable vector y. */ inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } @@ -138,7 +138,7 @@ int main(void) */ /* Initialize the slow integrator. Specify the explicit slow right-hand side - function in y'=fe(t,y)+fi(t,y)+ff(t,y), the inital time T0, the + function in y'=fe(t,y)+fi(t,y)+ff(t,y), the initial time T0, the initial dependent variable vector y, and the fast integrator. */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index e2392396bc..2682328575 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -109,7 +109,7 @@ foreach(example_tuple ${FARKODE_tests}) endforeach(example_tuple ${FARKODE_tests}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index ad1c64c8fa..e371c7af08 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 @@ -15,15 +15,15 @@ ! ! The following is a simple example problem with analytical ! solution, -! dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) +! dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) ! ! The stiffness of the problem is directly proportional to the -! value of "lamda", which is specified through an input file. The -! real part of lamda should be negative to result in a well-posed +! value of "lambda", which is specified through an input file. The +! real part of lambda should be negative to result in a well-posed ! ODE; for lambdas with magnitude larger than 100 the problem ! becomes quite stiff. ! -! Here we choose lamda = -0.1 + 10 i. +! Here we choose lambda = -0.1 + 10 i. ! ! This program solves the problem with the ERK method and ! a user-supplied complex vector module. diff --git a/examples/arkode/F2003_parallel/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index e8065f43c8..63b7634201 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -94,7 +94,7 @@ foreach(example_tuple ${FARKODE_examples}) endforeach(example_tuple ${FARKODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files @@ -121,7 +121,7 @@ if(EXAMPLES_INSTALL) list2string(EXAMPLE_LIBS_LIST EXAMPLE_LIBS) - # CMakeLists: replace sundials_ prefix and convert to space separted string + # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM EXAMPLE_LIBS_LIST REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) 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 f35968c09b..7d17efaaf3 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 @@ -22,7 +22,7 @@ ! w_t = -c * w_x + (B - w) / ep - w * u ! ! for t in [0, 10], x in [0, xmax] with periodic boundary conditions. The -! initial condition is a Gaussian pertubation of the steady state +! initial condition is a Gaussian perturbation of the steady state ! solution without advection ! ! u(0,x) = k1 * A / k4 + p(x) @@ -92,7 +92,7 @@ module ode_mod integer :: reqS ! MPI send request handle integer :: reqR ! MPI receive request handle - ! Excahnge buffers + ! Exchange buffers real(c_double) :: Wsend(Nvar), Wrecv(Nvar) real(c_double) :: Esend(Nvar), Erecv(Nvar) @@ -245,7 +245,7 @@ integer(c_int) function Reaction(t, sunvec_y, sunvec_f, user_data) & real(c_double), pointer :: fdata(:) ! local variables - real(c_double) :: u, v, w ! chemcial species + real(c_double) :: u, v, w ! chemical species integer(kind=myindextype) :: j, idx ! loop counter and array index !======= Internals ============ @@ -371,7 +371,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_f ! rhs N_Vector integer(c_int), value :: jok ! flag to signal for Jacobian update - integer(c_int) :: jcurPtr ! flag to singal Jacobian is current + integer(c_int) :: jcurPtr ! flag to signal Jacobian is current real(c_double), value :: gamma ! current gamma value type(c_ptr), value :: user_data ! user-defined data @@ -424,7 +424,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_f, jok, jcurPtr, gamma, & pdata(offset + 2) = -k3*u*u pdata(offset + 3) = 0.0d0 - ! thrid column (derivative with respect to v) + ! third column (derivative with respect to v) offset = offset + Neq pdata(offset + 1) = -k2*u @@ -648,7 +648,7 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & implicit none ! calling variables - type(N_Vector) :: sunvec_delta ! input linear system rhs, ouput solution + type(N_Vector) :: sunvec_delta ! input linear system rhs, output solution type(c_ptr), value :: arkode_mem ! ARKODE memory structure ! residual data @@ -710,7 +710,7 @@ integer(c_int) function TaskLocalLSolve(sunvec_delta, arkode_mem) & J_data(5) = -k3*u*u J_data(6) = 0.0d0 - ! thrid column (derivative with respect to v) + ! third column (derivative with respect to v) J_data(7) = -k2*u J_data(8) = k2*u J_data(9) = -k2*u - k6 @@ -1536,7 +1536,7 @@ subroutine EvolveProblemExplicit(sunvec_y) tout = t(1) + dtout iout = 0 - ! Ouput initial condition + ! Output initial condition if (myid == 0 .and. monitor) then print *, "" print *, " t ||u||_rms ||v||_rms ||w||_rms" @@ -1598,7 +1598,7 @@ subroutine EvolveProblemExplicit(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - ! Print final statistcs + ! Print final statistics if (myid == 0) then print "(A)", "Final Solver Statistics (for processor 0):" print "(2x,A,i0)", "Steps = ", nst diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index 36e1d9e315..e024dc9dff 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -561,7 +561,7 @@ integer(c_int) function PSetup(t, sunvec_y, sunvec_ydot, jok, jcurPtr, & type(N_Vector) :: sunvec_y ! solution N_Vector type(N_Vector) :: sunvec_ydot ! rhs N_Vector integer(c_int), value :: jok ! flag to signal for Jacobian update - integer(c_int) :: jcurPtr ! flag to singal Jacobian is current + integer(c_int) :: jcurPtr ! flag to signal Jacobian is current real(c_double), value :: gamma ! current gamma value type(c_ptr), value :: user_data ! user-defined data diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index bac936e149..2d0d7e9547 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -224,7 +224,7 @@ foreach(example_tuple ${FARKODE_tests}) endforeach(example_tuple ${FARKODE_tests}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 974e0cea02..62551f623f 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -15,12 +15,12 @@ ! The following is a simple example problem with an analytical ! solution. ! -! dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) +! dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) ! ! for t in the interval [0.0, 10.0], with initial condition: y=0. ! ! The stiffness of the problem is directly proportional to the -! value of lamda. The value of lamda should be negative to +! value of lambda. The value of lambda should be negative to ! result in a well-posed ODE; for values with magnitude larger ! than 100 the problem becomes quite stiff. ! ------------------------------------------------------------------ @@ -48,7 +48,7 @@ module analytic_mod integer(kind=myindextype), parameter :: neq = 1 ! ODE parameters - real(c_double), parameter :: lamda = -100.0d0 + real(c_double), parameter :: lambda = -100.0d0 contains @@ -87,7 +87,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn); + fvec(1) = lambda*yvec(1) + 1.0/(1.0 + tn*tn) - lambda*atan(tn); ! return success ierr = 0 return diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index 6cdc9bad24..ae64d613b6 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -79,7 +79,7 @@ module DiurnalKryBP_mod real(c_double), parameter :: twohr = 7200.0D0 real(c_double), parameter :: rtol = 1.0d-5 real(c_double), parameter :: floor = 100.0d0 - real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: delta = 0.0d0 real(c_double), parameter :: atol = rtol*floor integer(c_int), parameter :: Jpretype = 1 integer(c_int), parameter :: iGStype = 1 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index 2b5cc5747e..330e54f6b7 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -736,7 +736,7 @@ program main ! ! Initialize the fast integrator. Specify the fast right-hand side - ! function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time T0, + ! function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, ! and the initial dependent variable vector y. if (solve_type == 0 .or. solve_type == 6 .or. solve_type == 7 .or. solve_type == 8) then @@ -897,7 +897,7 @@ program main ! ! Initialize the slow integrator. Specify the slow right-hand side - ! function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the inital time + ! function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time ! T0, the initial dependent variable vector y, and the fast integrator. if (solve_type == 0) then ! KW3 slow solver diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index 8a3045cf85..c071550638 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -120,7 +120,7 @@ int main(int argc, char* argv[]) int ngroups = 100; if (argc > 1) { ngroups = atoi(argv[1]); } - // Use a direct or iterative linear sovler + // Use a direct or iterative linear solver bool direct = true; if (argc > 2) { direct = (atoi(argv[2])) ? true : false; } diff --git a/examples/cvode/CXX_parallel/CMakeLists.txt b/examples/cvode/CXX_parallel/CMakeLists.txt index 59c3419283..880f040c90 100644 --- a/examples/cvode/CXX_parallel/CMakeLists.txt +++ b/examples/cvode/CXX_parallel/CMakeLists.txt @@ -84,7 +84,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp index aabfef2e64..a4fc90e7fc 100644 --- a/examples/cvode/CXX_parallel/cv_heat2D_p.cpp +++ b/examples/cvode/CXX_parallel/cv_heat2D_p.cpp @@ -154,7 +154,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -175,7 +175,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -418,7 +418,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1486,7 +1486,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --liniters <iters> : max number of iterations" << endl; cout << " --epslin <factor> : linear tolerance factor" << endl; diff --git a/examples/cvode/CXX_parallel/plot_heat2D_p.py b/examples/cvode/CXX_parallel/plot_heat2D_p.py index 9f320f609b..d1c306f7f2 100755 --- a/examples/cvode/CXX_parallel/plot_heat2D_p.py +++ b/examples/cvode/CXX_parallel/plot_heat2D_p.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/cvode/CXX_parhyp/CMakeLists.txt b/examples/cvode/CXX_parhyp/CMakeLists.txt index 5c18f590d1..3c9f1d106b 100644 --- a/examples/cvode/CXX_parhyp/CMakeLists.txt +++ b/examples/cvode/CXX_parhyp/CMakeLists.txt @@ -86,7 +86,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp index c213aeaca2..6a80f99acf 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp @@ -161,7 +161,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -187,7 +187,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -485,7 +485,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1794,7 +1794,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --liniters <iters> : max number of iterations" << endl; cout << " --epslin <factor> : linear tolerance factor" << endl; @@ -2551,7 +2551,7 @@ int HypreLS_Setup(SUNLinearSolver LS, SUNMatrix A) flag = HYPRE_StructPFMGCreate(udata->comm_c, &(HLS_PRECOND(LS))); if (flag != 0) { return (flag); } - // Signal that the inital guess is zero + // Signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(HLS_PRECOND(LS)); if (flag != 0) { return (flag); } @@ -2675,14 +2675,14 @@ int HypreLS_Solve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, HLS_X(LS)); } - // If a convergence error occured, clear the error, and return with a + // If a convergence error occurred, clear the error, and return with a // recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); return SUNLS_CONV_FAIL; } - // If any other error occured return with an unrecoverable error. + // If any other error occurred return with an unrecoverable error. else if (flag != 0) { return SUN_ERR_EXT_FAIL; } // Update iteration count diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 5d74df7818..6322b09aec 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -161,7 +161,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -210,7 +210,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -468,7 +468,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1038,7 +1038,7 @@ static int PSetup(sunrealtype t, N_Vector u, N_Vector f, sunbooleantype jok, flag = HYPRE_StructPFMGCreate(udata->comm_c, &(udata->precond)); if (flag != 0) { return -1; } - // Signal that the inital guess is zero + // Signal that the initial guess is zero flag = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (flag != 0) { return -1; } @@ -1111,7 +1111,7 @@ static int PSolve(sunrealtype t, N_Vector u, N_Vector f, N_Vector r, N_Vector z, flag = HYPRE_StructPFMGSolve(udata->precond, udata->Amatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (flag == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (flag != 0) { return 1; } @@ -2306,7 +2306,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf <time> : final time" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; - cout << " --atol <atol> : absoltue tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; cout << " --gmres : use GMRES linear solver" << endl; cout << " --matvec : use hypre matrix-vector product" << endl; cout << " --liniters <iters> : max number of iterations" << endl; diff --git a/examples/cvode/CXX_parhyp/plot_heat2D_p.py b/examples/cvode/CXX_parhyp/plot_heat2D_p.py index f567f1c621..339dc9986c 100755 --- a/examples/cvode/CXX_parhyp/plot_heat2D_p.py +++ b/examples/cvode/CXX_parhyp/plot_heat2D_p.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/cvode/CXX_serial/CMakeLists.txt b/examples/cvode/CXX_serial/CMakeLists.txt index d48dd57cec..aac99a3e5b 100644 --- a/examples/cvode/CXX_serial/CMakeLists.txt +++ b/examples/cvode/CXX_serial/CMakeLists.txt @@ -73,7 +73,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) diff --git a/examples/cvode/CXX_serial/cv_heat2D.cpp b/examples/cvode/CXX_serial/cv_heat2D.cpp index e0e65c590f..f95d9beaad 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.cpp +++ b/examples/cvode/CXX_serial/cv_heat2D.cpp @@ -184,7 +184,7 @@ int main(int argc, char* argv[]) auto dTout = static_cast<sunrealtype>(udata.tf / udata.nout); auto tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(flag, "OpenOutput")) { return 1; } diff --git a/examples/cvode/CXX_serial/cv_heat2D.hpp b/examples/cvode/CXX_serial/cv_heat2D.hpp index 35bfa1ef84..c8b0bc779c 100644 --- a/examples/cvode/CXX_serial/cv_heat2D.hpp +++ b/examples/cvode/CXX_serial/cv_heat2D.hpp @@ -81,7 +81,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d = nullptr; - // Ouput variables + // Output variables bool output = false; // write solution to disk int nout = 20; // number of output times std::ofstream uout; // output file stream @@ -163,7 +163,7 @@ static void InputHelp() << " --kx <ky> : y diffusion coefficient\n" << " --tf <time> : final time\n" << " --rtol <rtol> : relative tolerance\n" - << " --atol <atol> : absoltue tolerance\n" + << " --atol <atol> : absolute tolerance\n" << " --gmres : use GMRES linear solver\n" << " --noprec : disable preconditioner\n" << " --liniters <iters> : max number of iterations\n" diff --git a/examples/cvode/CXX_serial/plot_heat2D.py b/examples/cvode/CXX_serial/plot_heat2D.py index 90ceba7d96..7b415ca810 100755 --- a/examples/cvode/CXX_serial/plot_heat2D.py +++ b/examples/cvode/CXX_serial/plot_heat2D.py @@ -38,7 +38,7 @@ # split line into list text = shlex.split(line) - # x-direction upper domian bound + # x-direction upper domain bound if "xu" in line: xu = float(text[1]) continue diff --git a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp index 928bc9f3a9..9997ad52d9 100644 --- a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp +++ b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp @@ -180,7 +180,7 @@ int main(int argc, char** argv) SUNLinearSolver LS = SUNLinSol_SPGMR(u, SUN_PREC_NONE, 0, sunctx); if (check_retval(&retval, "SUNLinSol_SPGMR", 1)) { return 1; } - // Attach the linear sovler to CVODE + // Attach the linear solver to CVODE retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvode/C_mpimanyvector/CMakeLists.txt b/examples/cvode/C_mpimanyvector/CMakeLists.txt index 4a2feaf182..af6ea6ad0c 100644 --- a/examples/cvode/C_mpimanyvector/CMakeLists.txt +++ b/examples/cvode/C_mpimanyvector/CMakeLists.txt @@ -74,7 +74,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c index 9283594ae2..553776c580 100644 --- a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c +++ b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.c @@ -278,7 +278,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { MPI_Abort(comm, 1); } diff --git a/examples/cvode/C_openmp/CMakeLists.txt b/examples/cvode/C_openmp/CMakeLists.txt index 004dc50ffe..4e96eab5ba 100644 --- a/examples/cvode/C_openmp/CMakeLists.txt +++ b/examples/cvode/C_openmp/CMakeLists.txt @@ -65,7 +65,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c b/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c index 4529c1ab6d..6aeb992d74 100644 --- a/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c +++ b/examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/C_openmpdev/CMakeLists.txt b/examples/cvode/C_openmpdev/CMakeLists.txt index 78bd030836..35ee73efd3 100644 --- a/examples/cvode/C_openmpdev/CMakeLists.txt +++ b/examples/cvode/C_openmpdev/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt index 997a83cbc1..0ae66ca838 100644 --- a/examples/cvode/F2003_parallel/CMakeLists.txt +++ b/examples/cvode/F2003_parallel/CMakeLists.txt @@ -84,7 +84,7 @@ foreach(example_tuple ${FCVODE_examples}) endforeach(example_tuple ${FCVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files @@ -99,7 +99,7 @@ if(EXAMPLES_INSTALL) # Makefile: convert semi-colon separated target list to space separated string list2string(CVODE_LIBS EXAMPLE_LIBS) - # CMakeLists: replace sundials_ prefix and convert to space separted string + # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM CVODE_LIBS REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) diff --git a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 index 3135171b42..37b1c3810a 100644 --- a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.f90 @@ -14,12 +14,12 @@ ! The following is a simple example problem with an analytical ! solution. ! -! dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) +! dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) ! ! for t in the interval [0.0, 10.0], with initial condition: y=0. ! ! The stiffness of the problem is directly proportional to the -! value of lamda. The value of lamda should be negative to +! value of lambda. The value of lambda should be negative to ! result in a well-posed ODE; for values with magnitude larger ! than 100 the problem becomes quite stiff. ! ------------------------------------------------------------------ @@ -37,7 +37,7 @@ module ode_mod integer(c_int64_t), parameter :: neq = 1 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + double precision, parameter :: lambda = -100.0d0 contains @@ -76,7 +76,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn) + fvec(1) = lambda*yvec(1) + 1.0/(1.0 + tn*tn) - lambda*atan(tn) ! return success ierr = 0 @@ -171,7 +171,7 @@ program main stop 1 end if - ! attache nonlinear solver object to CVode + ! attach nonlinear solver object to CVode ierr = FCVodeSetNonlinearSolver(cvode_mem, sunnls) if (ierr /= 0) then print *, 'Error in FCVodeSetNonlinearSolver, ierr = ', ierr, '; halting' diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 index 541f0433e0..fc2e57ecf7 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_f2003.f90 @@ -18,15 +18,15 @@ ! ! where A = V * D * Vi ! -! [ lamda/4 - 23/40 | lamda/4 - 3/40 | lamda/4 + 13/40 ] -! A = [ lamda/4 + 21/40 | lamda/4 + 1/40 | lamda/4 - 11/40 ] -! [ lamda/2 + 1/20 | lamda/2 + 1/20 | lamda/2 - 1/20 ] +! [ lambda/4 - 23/40 | lambda/4 - 3/40 | lambda/4 + 13/40 ] +! A = [ lambda/4 + 21/40 | lambda/4 + 1/40 | lambda/4 - 11/40 ] +! [ lambda/2 + 1/20 | lambda/2 + 1/20 | lambda/2 - 1/20 ] ! ! [ 1 -1 1 ] [ -1/2 0 0 ] [ 5/4 1/4 -3/4 ] ! V = [ -1 2 1 ] D = [ 0 -1/10 0 ] Vi = [ 1/2 1/2 -1/2 ] -! [ 0 -1 2 ] [ 0 0 lamda ] [ 1/4 1/4 1/4 ] +! [ 0 -1 2 ] [ 0 0 lambda ] [ 1/4 1/4 1/4 ] ! -! and lamda is a large negative number. The analytical solution to +! and lambda is a large negative number. The analytical solution to ! this problem is ! ! y(t) = V * exp(D * t) * Vi * y0 @@ -35,11 +35,11 @@ ! y(0) = [1,1,1]'. ! ! The stiffness of the problem is directly proportional to the value -! of lamda. The value of lamda should be negative to result in a +! of lambda. The value of lambda should be negative to result in a ! well-posed ODE; for values with magnitude larger than 100 the ! problem becomes quite stiff. ! -! In this example, we choose lamda = -100. +! In this example, we choose lambda = -100. ! ! Output is printed every 1.0 units of time (10 total). ! Run statistics (optional outputs) are printed at the end. @@ -58,7 +58,7 @@ module ode_mod integer(c_int64_t), parameter :: neq = 3 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + double precision, parameter :: lambda = -100.0d0 contains @@ -100,9 +100,9 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & ! fill A matrix (column major ordering) Amat = reshape([ & - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + lambda/4.d0 - 23.d0/40.d0, lambda/4.d0 + 21.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 - 3.d0/40.d0, lambda/4.d0 + 1.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 + 13.d0/40.d0, lambda/4.d0 - 11.d0/40, lambda/2.d0 - 1.d0/20.d0], & [3, 3]) ! fill RHS vector f(t,y) = A*y diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 index fa55dda7d9..84ad47c50e 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_dns_jac_f2003.f90 @@ -18,15 +18,15 @@ ! ! where A = V * D * Vi ! -! [ lamda/4 - 23/40 | lamda/4 - 3/40 | lamda/4 + 13/40 ] -! A = [ lamda/4 + 21/40 | lamda/4 + 1/40 | lamda/4 - 11/40 ] -! [ lamda/2 + 1/20 | lamda/2 + 1/20 | lamda/2 - 1/20 ] +! [ lambda/4 - 23/40 | lambda/4 - 3/40 | lambda/4 + 13/40 ] +! A = [ lambda/4 + 21/40 | lambda/4 + 1/40 | lambda/4 - 11/40 ] +! [ lambda/2 + 1/20 | lambda/2 + 1/20 | lambda/2 - 1/20 ] ! -! [ 1 -1 1 ] [ -1/2 0 0 ] [ 5/4 1/4 -3/4 ] -! V = [ -1 2 1 ] D = [ 0 -1/10 0 ] Vi = [ 1/2 1/2 -1/2 ] -! [ 0 -1 2 ] [ 0 0 lamda ] [ 1/4 1/4 1/4 ] +! [ 1 -1 1 ] [ -1/2 0 0 ] [ 5/4 1/4 -3/4 ] +! V = [ -1 2 1 ] D = [ 0 -1/10 0 ] Vi = [ 1/2 1/2 -1/2 ] +! [ 0 -1 2 ] [ 0 0 lambda ] [ 1/4 1/4 1/4 ] ! -! and lamda is a large negative number. The analytical solution to +! and lambda is a large negative number. The analytical solution to ! this problem is ! ! y(t) = V * exp(D * t) * Vi * y0 @@ -35,11 +35,11 @@ ! y(0) = [1,1,1]'. ! ! The stiffness of the problem is directly proportional to the value -! of lamda. The value of lamda should be negative to result in a +! of lambda. The value of lambda should be negative to result in a ! well-posed ODE; for values with magnitude larger than 100 the ! problem becomes quite stiff. ! -! In this example, we choose lamda = -100. +! In this example, we choose lambda = -100. ! ! Output is printed every 1.0 units of time (10 total). ! Run statistics (optional outputs) are printed at the end. @@ -58,7 +58,7 @@ module ode_mod integer(c_int64_t), parameter :: neq = 3 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + double precision, parameter :: lambda = -100.0d0 contains @@ -100,9 +100,9 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & ! fill A matrix (column major ordering) Amat = reshape([ & - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + lambda/4.d0 - 23.d0/40.d0, lambda/4.d0 + 21.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 - 3.d0/40.d0, lambda/4.d0 + 1.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 + 13.d0/40.d0, lambda/4.d0 - 11.d0/40, lambda/2.d0 - 1.d0/20.d0], & [3, 3]) ! fill RHS vector f(t,y) = A*y @@ -152,9 +152,9 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & ! fill J matrix (column major ordering) Jmat = & - [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] + [lambda/4.d0 - 23.d0/40.d0, lambda/4.d0 + 21.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 - 3.d0/40.d0, lambda/4.d0 + 1.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 + 13.d0/40.d0, lambda/4.d0 - 11.d0/40, lambda/2.d0 - 1.d0/20.d0] ! return success ierr = 0 diff --git a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 index 33fd2ad507..e8a63683e0 100644 --- a/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_analytic_sys_klu_f2003.f90 @@ -18,15 +18,15 @@ ! ! where A = V * D * Vi ! -! [ lamda/4 - 23/40 | lamda/4 - 3/40 | lamda/4 + 13/40 ] -! A = [ lamda/4 + 21/40 | lamda/4 + 1/40 | lamda/4 - 11/40 ] -! [ lamda/2 + 1/20 | lamda/2 + 1/20 | lamda/2 - 1/20 ] +! [ lambda/4 - 23/40 | lambda/4 - 3/40 | lambda/4 + 13/40 ] +! A = [ lambda/4 + 21/40 | lambda/4 + 1/40 | lambda/4 - 11/40 ] +! [ lambda/2 + 1/20 | lambda/2 + 1/20 | lambda/2 - 1/20 ] ! -! [ 1 -1 1 ] [ -1/2 0 0 ] [ 5/4 1/4 -3/4 ] -! V = [ -1 2 1 ] D = [ 0 -1/10 0 ] Vi = [ 1/2 1/2 -1/2 ] -! [ 0 -1 2 ] [ 0 0 lamda ] [ 1/4 1/4 1/4 ] +! [ 1 -1 1 ] [ -1/2 0 0 ] [ 5/4 1/4 -3/4 ] +! V = [ -1 2 1 ] D = [ 0 -1/10 0 ] Vi = [ 1/2 1/2 -1/2 ] +! [ 0 -1 2 ] [ 0 0 lambda ] [ 1/4 1/4 1/4 ] ! -! and lamda is a large negative number. The analytical solution to +! and lambda is a large negative number. The analytical solution to ! this problem is ! ! y(t) = V * exp(D * t) * Vi * y0 @@ -35,11 +35,11 @@ ! y(0) = [1,1,1]'. ! ! The stiffness of the problem is directly proportional to the value -! of lamda. The value of lamda should be negative to result in a +! of lambda. The value of lambda should be negative to result in a ! well-posed ODE; for values with magnitude larger than 100 the ! problem becomes quite stiff. ! -! In this example, we choose lamda = -100. +! In this example, we choose lambda = -100. ! ! Output is printed every 1.0 units of time (10 total). ! Run statistics (optional outputs) are printed at the end. @@ -58,7 +58,7 @@ module ode_mod integer(c_int64_t), parameter :: neq = 3 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + double precision, parameter :: lambda = -100.0d0 contains @@ -100,9 +100,9 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & ! fill A matrix (column major ordering) Amat = reshape([ & - lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0], & + lambda/4.d0 - 23.d0/40.d0, lambda/4.d0 + 21.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 - 3.d0/40.d0, lambda/4.d0 + 1.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 + 13.d0/40.d0, lambda/4.d0 - 11.d0/40, lambda/2.d0 - 1.d0/20.d0], & [3, 3]) ! fill RHS vector f(t,y) = A*y @@ -158,9 +158,9 @@ integer(c_int) function JacFn(tn, sunvec_y, sunvec_f, sunmat_J, & ! fill J matrix (column major ordering) Jmat = & - [lamda/4.d0 - 23.d0/40.d0, lamda/4.d0 + 21.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 - 3.d0/40.d0, lamda/4.d0 + 1.d0/40, lamda/2.d0 + 1.d0/20.d0, & - lamda/4.d0 + 13.d0/40.d0, lamda/4.d0 - 11.d0/40, lamda/2.d0 - 1.d0/20.d0] + [lambda/4.d0 - 23.d0/40.d0, lambda/4.d0 + 21.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 - 3.d0/40.d0, lambda/4.d0 + 1.d0/40, lambda/2.d0 + 1.d0/20.d0, & + lambda/4.d0 + 13.d0/40.d0, lambda/4.d0 - 11.d0/40, lambda/2.d0 - 1.d0/20.d0] Jidxptr = [0, 3, 6, 9] Jidxval = [0, 1, 2, 0, 1, 2, 0, 1, 2] diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 index cc543fdab2..6d0f527690 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.f90 @@ -80,7 +80,7 @@ module diurnal_bp_mod real(c_double), parameter :: twohr = 7200.0d0 real(c_double), parameter :: rtol = 1.0d-5 real(c_double), parameter :: floor = 100.0d0 - real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: delta = 0.0d0 real(c_double), parameter :: atol = rtol*floor integer(c_int), parameter :: Jpretype = 1 integer(c_int), parameter :: iGStype = 1 diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 index 0dbd71e32c..60b382d7e0 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_f2003.f90 @@ -80,7 +80,7 @@ module diurnal_mod real(c_double), parameter :: twohr = 7200.0d0 real(c_double), parameter :: rtol = 1.0d-5 real(c_double), parameter :: floor = 100.0d0 - real(c_double), parameter :: delt = 0.0d0 + real(c_double), parameter :: delta = 0.0d0 real(c_double), parameter :: atol = rtol*floor integer(c_int), parameter :: Jpretype = 1 integer(c_int), parameter :: iGStype = 1 diff --git a/examples/cvode/cuda/CMakeLists.txt b/examples/cvode/cuda/CMakeLists.txt index aeb2587f14..331ea7b76b 100644 --- a/examples/cvode/cuda/CMakeLists.txt +++ b/examples/cvode/cuda/CMakeLists.txt @@ -91,7 +91,7 @@ foreach(example_tuple ${all_examples}) endif() endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu b/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu index 2e0f08abc3..9fbf6c1207 100644 --- a/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu +++ b/examples/cvode/cuda/cvAdvDiff_diag_cuda.cu @@ -143,7 +143,7 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "CVodeSetUserData", 1)) { return 1; } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu index 4804c70250..097928b0be 100644 --- a/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu +++ b/examples/cvode/cuda/cvRoberts_block_cusolversp_batchqr.cu @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in y'=f(t,y), the inital time T0, and + * user's right hand side function in y'=f(t,y), the initial time T0, and * the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -198,7 +198,7 @@ int main(int argc, char* argv[]) } /* Set the sparsity pattern to be fixed so that the row pointers - * and column indicies are not zeroed out by SUNMatZero */ + * and column indices are not zeroed out by SUNMatZero */ retval = SUNMatrix_cuSparse_SetFixedPattern(A, 1); /* Initialiize the Jacobian with its fixed sparsity pattern */ @@ -309,7 +309,7 @@ static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) return (0); } -/* Right hand side function evalutation kernel. */ +/* Right hand side function evaluation kernel. */ __global__ static void f_kernel(sunrealtype t, sunrealtype* ydata, sunrealtype* ydotdata, int neq, int ngroups) { diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp index eaa7627e09..0d96af65fc 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp @@ -223,7 +223,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / udata.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(flag, "OpenOutput")) { return 1; } diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp index 75bc3ba8c9..e25866c747 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp @@ -86,7 +86,7 @@ struct UserData int liniters = 20; // number of linear iterations sunrealtype epslin = ZERO; // linear solver tolerance factor - // Ouput variables + // Output variables bool output = false; // write solution to disk int nout = 20; // number of output times std::ofstream uout; // output file stream @@ -232,7 +232,7 @@ static void InputHelp() << " --kx <ky> : y diffusion coefficient\n" << " --tf <time> : final time\n" << " --rtol <rtol> : relative tolerance\n" - << " --atol <atol> : absoltue tolerance\n" + << " --atol <atol> : absolute tolerance\n" << " --liniters <iters> : max number of iterations\n" << " --epslin <factor> : linear tolerance factor\n" << " --msbp <steps> : max steps between prec setups\n" diff --git a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp index a88cddd3f3..6107164e8a 100644 --- a/examples/cvode/hip/cvAdvDiff_diag_hip.cpp +++ b/examples/cvode/hip/cvAdvDiff_diag_hip.cpp @@ -138,7 +138,7 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "CVodeSetUserData", 1)) { return 1; } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/magma/cv_bruss_batched_magma.cpp b/examples/cvode/magma/cv_bruss_batched_magma.cpp index a50f0e5a9b..c7a7912ccb 100644 --- a/examples/cvode/magma/cv_bruss_batched_magma.cpp +++ b/examples/cvode/magma/cv_bruss_batched_magma.cpp @@ -282,7 +282,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in y'=f(t,y), the inital time T0, and + * user's right hand side function in y'=f(t,y), the initial time T0, and * the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -412,7 +412,7 @@ int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) return (0); } -/* Right hand side function evalutation kernel. +/* Right hand side function evaluation kernel. This kernel needs threads >= nbatches. */ __global__ void f_kernel(sunrealtype t, sunrealtype* ydata, sunrealtype* ydotdata, sunrealtype* A, sunrealtype* B, diff --git a/examples/cvode/parallel/CMakeLists.txt b/examples/cvode/parallel/CMakeLists.txt index 1f3239f22f..92ef974204 100644 --- a/examples/cvode/parallel/CMakeLists.txt +++ b/examples/cvode/parallel/CMakeLists.txt @@ -78,7 +78,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/parallel/cvAdvDiff_diag_p.c b/examples/cvode/parallel/cvAdvDiff_diag_p.c index 1b0a55b3c5..81c6f18ddd 100644 --- a/examples/cvode/parallel/cvAdvDiff_diag_p.c +++ b/examples/cvode/parallel/cvAdvDiff_diag_p.c @@ -233,7 +233,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/parallel/cvAdvDiff_non_p.c b/examples/cvode/parallel/cvAdvDiff_non_p.c index 265c3d252a..a4a6f955cb 100644 --- a/examples/cvode/parallel/cvAdvDiff_non_p.c +++ b/examples/cvode/parallel/cvAdvDiff_non_p.c @@ -164,7 +164,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c index e6088f29f8..abad0f61cc 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.c @@ -245,7 +245,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/parallel/cvDiurnal_kry_p.c b/examples/cvode/parallel/cvDiurnal_kry_p.c index 641fbd0051..f1f317952c 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_p.c +++ b/examples/cvode/parallel/cvDiurnal_kry_p.c @@ -255,7 +255,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/parhyp/CMakeLists.txt b/examples/cvode/parhyp/CMakeLists.txt index 9571c36ae5..0d29a4766b 100644 --- a/examples/cvode/parhyp/CMakeLists.txt +++ b/examples/cvode/parhyp/CMakeLists.txt @@ -56,7 +56,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) diff --git a/examples/cvode/parhyp/cvAdvDiff_non_ph.c b/examples/cvode/parhyp/cvAdvDiff_non_ph.c index f099dd0ddb..51e927fc9d 100644 --- a/examples/cvode/parhyp/cvAdvDiff_non_ph.c +++ b/examples/cvode/parhyp/cvAdvDiff_non_ph.c @@ -184,7 +184,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/petsc/cvAdvDiff_petsc.c b/examples/cvode/petsc/cvAdvDiff_petsc.c index dbaf34dc41..9e8ffd58e3 100644 --- a/examples/cvode/petsc/cvAdvDiff_petsc.c +++ b/examples/cvode/petsc/cvAdvDiff_petsc.c @@ -183,7 +183,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { return (1); } diff --git a/examples/cvode/raja/CMakeLists.txt b/examples/cvode/raja/CMakeLists.txt index 1cbc5d13ca..79066d771f 100644 --- a/examples/cvode/raja/CMakeLists.txt +++ b/examples/cvode/raja/CMakeLists.txt @@ -68,7 +68,7 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) diff --git a/examples/cvode/serial/CMakeLists.txt b/examples/cvode/serial/CMakeLists.txt index be033dce06..7dff99bd8e 100644 --- a/examples/cvode/serial/CMakeLists.txt +++ b/examples/cvode/serial/CMakeLists.txt @@ -292,7 +292,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvode/serial/cvAdvDiff_bnd.c b/examples/cvode/serial/cvAdvDiff_bnd.c index ee76167619..17010f18ac 100644 --- a/examples/cvode/serial/cvAdvDiff_bnd.c +++ b/examples/cvode/serial/cvAdvDiff_bnd.c @@ -180,7 +180,7 @@ int main(void) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(retval, "CVodeInit")) { return (1); } diff --git a/examples/cvode/serial/cvAdvDiff_bndL.c b/examples/cvode/serial/cvAdvDiff_bndL.c index b945b521e0..d757a38363 100644 --- a/examples/cvode/serial/cvAdvDiff_bndL.c +++ b/examples/cvode/serial/cvAdvDiff_bndL.c @@ -151,7 +151,7 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/serial/cvAnalytic_mels.c b/examples/cvode/serial/cvAnalytic_mels.c index 1509c39843..9a84c380c9 100644 --- a/examples/cvode/serial/cvAnalytic_mels.c +++ b/examples/cvode/serial/cvAnalytic_mels.c @@ -15,11 +15,11 @@ * * The following is a simple example problem with analytical solution, * solution, - * dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) * for t in the interval [0.0, 10.0], with initial condition: y=0. * * The stiffness of the problem is directly proportional to the - * value of "lamda". The value of lamda should be negative to + * value of "lambda". The value of lambda should be negative to * result in a well-posed ODE; for values with magnitude larger * than 100 the problem becomes quite stiff. * @@ -75,7 +75,7 @@ int main(void) sunindextype NEQ = 1; /* number of dependent vars. */ sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ + sunrealtype lambda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -91,7 +91,7 @@ int main(void) /* Initial diagnostics output */ printf("\nAnalytical ODE test problem:\n"); - printf(" lamda = %" GSYM "\n", lamda); + printf(" lambda = %" GSYM "\n", lambda); printf(" reltol = %.1" ESYM "\n", reltol); printf(" abstol = %.1" ESYM "\n\n", abstol); @@ -106,13 +106,13 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in y'=f(t,y), the inital time T0, and + * user's right hand side function in y'=f(t,y), the initial time T0, and * the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } /* Call CVodeSetUserData to specify the stiffness factor */ - retval = CVodeSetUserData(cvode_mem, (void*)&lamda); + retval = CVodeSetUserData(cvode_mem, (void*)&lambda); if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeSStolerances to specify the scalar relative and absolute tolerances */ @@ -200,12 +200,12 @@ int main(void) static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ - sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot, 0) = lamda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - - lamda * atan(t); + NV_Ith_S(ydot, 0) = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - + lambda * atan(t); return 0; /* return with success */ } @@ -249,7 +249,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype tcur, gamma, rl1; void* user_data; sunrealtype* rdata; - sunrealtype lamda; + sunrealtype lambda; /* retrieve implicit system data from CVode */ retval = CVodeGetNonlinearSystemData(LS->content, &tcur, &ypred, &y, &fn, @@ -260,11 +260,11 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, } /* extract stiffness parameter from user_data */ - rdata = (sunrealtype*)user_data; - lamda = rdata[0]; + rdata = (sunrealtype*)user_data; + lambda = rdata[0]; - /* perform linear solve: (1-gamma*lamda)*x = b */ - NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lamda); + /* perform linear solve: (1-gamma*lambda)*x = b */ + NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lambda); /* return with success */ return (SUN_SUCCESS); diff --git a/examples/cvode/serial/cvAnalytic_mels.out b/examples/cvode/serial/cvAnalytic_mels.out index 21458daf24..6d0fecd3e7 100644 --- a/examples/cvode/serial/cvAnalytic_mels.out +++ b/examples/cvode/serial/cvAnalytic_mels.out @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1.0e-06 abstol = 1.0e-10 diff --git a/examples/cvode/serial/cvDiurnal_kry.c b/examples/cvode/serial/cvDiurnal_kry.c index e48440636b..0a2f3935db 100644 --- a/examples/cvode/serial/cvDiurnal_kry.c +++ b/examples/cvode/serial/cvDiurnal_kry.c @@ -199,7 +199,7 @@ int main(void) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -214,7 +214,7 @@ int main(void) LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Call CVodeSetLinearSolver to attach the linear sovler to CVode */ + /* Call CVodeSetLinearSolver to attach the linear solver to CVode */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvode/serial/cvDiurnal_kry_bp.c b/examples/cvode/serial/cvDiurnal_kry_bp.c index 432003215d..5bb0081686 100644 --- a/examples/cvode/serial/cvDiurnal_kry_bp.c +++ b/examples/cvode/serial/cvDiurnal_kry_bp.c @@ -187,7 +187,7 @@ int main(void) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -202,7 +202,7 @@ int main(void) LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Call CVodeSetLinearSolver to attach the linear sovler to CVode */ + /* Call CVodeSetLinearSolver to attach the linear solver to CVode */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvode/serial/cvKrylovDemo_ls.c b/examples/cvode/serial/cvKrylovDemo_ls.c index a527219e2b..19b45cdcc7 100644 --- a/examples/cvode/serial/cvKrylovDemo_ls.c +++ b/examples/cvode/serial/cvKrylovDemo_ls.c @@ -250,7 +250,7 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -296,7 +296,7 @@ int main(int argc, char* argv[]) /* Free previous linear solver and attach a new linear solver module */ SUNLinSolFree(LS); - /* Set the linear sovler type in user data */ + /* Set the linear solver type in user data */ data->linsolver = linsolver; switch (linsolver) diff --git a/examples/cvode/serial/cvKrylovDemo_prec.c b/examples/cvode/serial/cvKrylovDemo_prec.c index ff5b38339f..c3c886f6d3 100644 --- a/examples/cvode/serial/cvKrylovDemo_prec.c +++ b/examples/cvode/serial/cvKrylovDemo_prec.c @@ -67,7 +67,7 @@ * subset of the ns by ns blocks). * * Four different runs are made for this problem. The product - * preconditoner is applied on the left and on the right. In each + * preconditioner is applied on the left and on the right. In each * case, both the modified and classical Gram-Schmidt options are * tested. In the series of runs, CVodeInit, SUNLinSol_SPGMR, and * CVSetLinearSolver are called only for the first run, whereas @@ -130,7 +130,7 @@ #define BB ONE /* BB = b */ #define DPREY ONE #define DPRED SUN_RCONST(0.5) -#define ALPH ONE +#define ALPHA ONE #define NP 3 #define NS (2 * NP) @@ -160,8 +160,8 @@ /* Spgmr/CVLS Constants */ -#define MAXL 0 /* => use default = MIN(NEQ, 5) */ -#define DELT ZERO /* => use default = 0.05 */ +#define MAXL 0 /* => use default = MIN(NEQ, 5) */ +#define DELTA ZERO /* => use default = 0.05 */ /* Output Constants */ @@ -310,7 +310,7 @@ int main(void) return (1); } - retval = CVodeSetEpsLin(cvode_mem, DELT); + retval = CVodeSetEpsLin(cvode_mem, DELTA); if (check_retval(&retval, "CVodeSetEpsLin", 1)) { return (1); } retval = CVodeSetPreconditioner(cvode_mem, Precond, PSolve); @@ -506,17 +506,17 @@ static void PrintIntro(void) printf("Matrix parameters: a = %.2Lg e = %.2Lg g = %.2Lg\n", AA, EE, GG); printf("b parameter = %.2Lg\n", BB); printf("Diffusion coefficients: Dprey = %.2Lg Dpred = %.2Lg\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2Lg\n\n", ALPH); + printf("Rate parameter alpha = %.2Lg\n\n", ALPHA); #elif defined(SUNDIALS_DOUBLE_PRECISION) printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #else printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #endif printf("Mesh dimensions (mx,my) are %d, %d. ", MX, MY); printf("Total system size is neq = %d \n\n", NEQ); @@ -787,7 +787,7 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, for (i = 0; i < ns; i++) { rate[i] += c[j] * acoef[i][j]; } } - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = c[i] * (bcoef[i] * fac + rate[i]); } } diff --git a/examples/cvode/serial/cvParticle_dns.c b/examples/cvode/serial/cvParticle_dns.c index f3d6cbc363..ab716a0eae 100644 --- a/examples/cvode/serial/cvParticle_dns.c +++ b/examples/cvode/serial/cvParticle_dns.c @@ -479,7 +479,7 @@ static void InputHelp(void) printf(" --alpha <vel> : particle velocity\n"); printf(" --orbits <orbits> : number of orbits to perform\n"); printf(" --rtol <rtol> : relative tolerance\n"); - printf(" --atol <atol> : absoltue tolerance\n"); + printf(" --atol <atol> : absolute tolerance\n"); printf(" --proj <1 or 0> : enable (1) / disable (0) projection\n"); printf(" --projerr <1 or 0> : enable (1) / disable (0) error projection\n"); printf(" --nout <nout> : outputs per period\n"); diff --git a/examples/cvode/serial/cvRoberts_block_klu.c b/examples/cvode/serial/cvRoberts_block_klu.c index 02f19e837a..c93f9b642e 100644 --- a/examples/cvode/serial/cvRoberts_block_klu.c +++ b/examples/cvode/serial/cvRoberts_block_klu.c @@ -165,7 +165,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in y'=f(t,y), the inital time T0, and + * user's right hand side function in y'=f(t,y), the initial time T0, and * the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/serial/cvRoberts_dns.c b/examples/cvode/serial/cvRoberts_dns.c index 3c1f5ed2f5..5f6c873b04 100644 --- a/examples/cvode/serial/cvRoberts_dns.c +++ b/examples/cvode/serial/cvRoberts_dns.c @@ -384,7 +384,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/cvode/serial/cvRoberts_dns_constraints.c b/examples/cvode/serial/cvRoberts_dns_constraints.c index 5c7a1300fe..aa5ca9a938 100644 --- a/examples/cvode/serial/cvRoberts_dns_constraints.c +++ b/examples/cvode/serial/cvRoberts_dns_constraints.c @@ -435,7 +435,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/cvode/serial/cvRocket_dns.c b/examples/cvode/serial/cvRocket_dns.c index a040079a6c..0dbe37448d 100644 --- a/examples/cvode/serial/cvRocket_dns.c +++ b/examples/cvode/serial/cvRocket_dns.c @@ -151,7 +151,7 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the right-hand side function in - * y'=f(t,y), the inital time T0, and the initial dependent variable vector y. */ + * y'=f(t,y), the initial time T0, and the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvode/superludist/CMakeLists.txt b/examples/cvode/superludist/CMakeLists.txt index d0c25e651c..4df705a32d 100644 --- a/examples/cvode/superludist/CMakeLists.txt +++ b/examples/cvode/superludist/CMakeLists.txt @@ -78,7 +78,7 @@ else() set(_ex_lang CXX) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) sundials_install_examples( diff --git a/examples/cvode/superludist/cvAdvDiff_sludist.cpp b/examples/cvode/superludist/cvAdvDiff_sludist.cpp index 9c1a0fee35..5a9ddc2b3a 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist.cpp +++ b/examples/cvode/superludist/cvAdvDiff_sludist.cpp @@ -228,7 +228,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { MPI_Abort(grid.comm, 1); } diff --git a/examples/cvodes/C_openmp/CMakeLists.txt b/examples/cvodes/C_openmp/CMakeLists.txt index cc344d5e07..418e5969ed 100644 --- a/examples/cvodes/C_openmp/CMakeLists.txt +++ b/examples/cvodes/C_openmp/CMakeLists.txt @@ -64,7 +64,7 @@ foreach(example_tuple ${CVODES_examples_OMP}) endforeach(example_tuple ${CVODES_examples_OMP}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c index debbe84b3c..66ed23f301 100644 --- a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c +++ b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 index e42e33e0b8..7b9e626405 100644 --- a/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 @@ -255,7 +255,7 @@ program main retval = FCVodeInit(cvodes_mem, c_funloc(RhsFn), T0, u) call check_retval(retval, "FCVodeInit") - ! Set relative and absolute tolerences + ! Set relative and absolute tolerances retval = FCVodeSStolerances(cvodes_mem, reltol, abstol) call check_retval(retval, "FCVodeSStolerances") diff --git a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 index 3087baab20..5642103db1 100644 --- a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 +++ b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.f90 @@ -14,12 +14,12 @@ ! The following is a simple example problem with an analytical ! solution. ! -! dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) +! dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) ! ! for t in the interval [0.0, 10.0], with initial condition: y=0. ! ! The stiffness of the problem is directly proportional to the -! value of lamda. The value of lamda should be negative to +! value of lambda. The value of lambda should be negative to ! result in a well-posed ODE; for values with magnitude larger ! than 100 the problem becomes quite stiff. ! ------------------------------------------------------------------ @@ -47,7 +47,7 @@ module ode_mod integer(kind=myindextype), parameter :: neq = 1 ! ODE parameters - double precision, parameter :: lamda = -100.0d0 + double precision, parameter :: lambda = -100.0d0 contains @@ -86,7 +86,7 @@ integer(c_int) function RhsFn(tn, sunvec_y, sunvec_f, user_data) & fvec => FN_VGetArrayPointer(sunvec_f) ! fill RHS vector - fvec(1) = lamda*yvec(1) + 1.0/(1.0 + tn*tn) - lamda*atan(tn) + fvec(1) = lambda*yvec(1) + 1.0/(1.0 + tn*tn) - lambda*atan(tn) ! return success ierr = 0 @@ -181,7 +181,7 @@ program main stop 1 end if - ! attache nonlinear solver object to CVode + ! attach nonlinear solver object to CVode ierr = FCVodeSetNonlinearSolver(cvodes_mem, sunnls) if (ierr /= 0) then print *, 'Error in FCVodeSetNonlinearSolver, ierr = ', ierr, '; halting' diff --git a/examples/cvodes/parallel/CMakeLists.txt b/examples/cvodes/parallel/CMakeLists.txt index 1a1ede9689..9c1c310b28 100644 --- a/examples/cvodes/parallel/CMakeLists.txt +++ b/examples/cvodes/parallel/CMakeLists.txt @@ -98,7 +98,7 @@ foreach(example_tuple ${CVODES_examples}) endforeach(example_tuple ${CVODES_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvodes/parallel/README b/examples/cvodes/parallel/README index e40954a0fa..b67d7cc4ee 100644 --- a/examples/cvodes/parallel/README +++ b/examples/cvodes/parallel/README @@ -10,7 +10,7 @@ List of parallel CVODES examples (2) Forward sensitivity - cvsAdvDiff_FSA_non_p : 1-D advection difusion PDE - + cvsAdvDiff_FSA_non_p : 1-D advection diffusion PDE - Adams with Functional iteration cvsDiurnal_FSA_kry_p : 2-D 2-species diurnal advection-diffusion PDE - BDF with Newton GMRES diff --git a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c index 88d7c1e964..cf7ee104e2 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c @@ -91,7 +91,7 @@ typedef struct sunrealtype *z1, *z2; /* work space */ }* UserData; -/* Prototypes of user-supplied funcitons */ +/* Prototypes of user-supplied functions */ static int f(sunrealtype t, N_Vector u, N_Vector udot, void* user_data); static int fB(sunrealtype t, N_Vector u, N_Vector uB, N_Vector uBdot, @@ -172,7 +172,7 @@ int main(int argc, char* argv[]) nrem = NEQ - npes * nperpe; if (my_pe < npes) { - /* PDE vars. distributed to this proccess */ + /* PDE vars. distributed to this process */ local_N = (my_pe < nrem) ? nperpe + 1 : nperpe; my_base = (my_pe < nrem) ? my_pe * local_N : my_pe * nperpe + nrem; } diff --git a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c index 7332fa259c..152421a27e 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c @@ -93,7 +93,7 @@ typedef struct sunrealtype z[100]; }* UserData; -/* Prototypes of user-supplied functins */ +/* Prototypes of user-supplied functions */ static int f(sunrealtype t, N_Vector u, N_Vector udot, void* user_data); diff --git a/examples/cvodes/parallel/cvsAdvDiff_non_p.c b/examples/cvodes/parallel/cvsAdvDiff_non_p.c index 8181de7561..6aef37a056 100644 --- a/examples/cvodes/parallel/cvsAdvDiff_non_p.c +++ b/examples/cvodes/parallel/cvsAdvDiff_non_p.c @@ -165,7 +165,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { MPI_Abort(comm, 1); } diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c index 6fc10c5d55..f2dddfaaac 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c @@ -246,7 +246,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { MPI_Abort(comm, 1); } diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_p.c b/examples/cvodes/parallel/cvsDiurnal_kry_p.c index c05b64e122..01e2388165 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_p.c +++ b/examples/cvodes/parallel/cvsDiurnal_kry_p.c @@ -246,7 +246,7 @@ int main(int argc, char* argv[]) } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1, my_pe)) { MPI_Abort(comm, 1); } diff --git a/examples/cvodes/serial/CMakeLists.txt b/examples/cvodes/serial/CMakeLists.txt index 4089accc24..bd2a3a0be7 100644 --- a/examples/cvodes/serial/CMakeLists.txt +++ b/examples/cvodes/serial/CMakeLists.txt @@ -311,7 +311,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/cvodes/serial/README b/examples/cvodes/serial/README index 29fe8ea472..dfa2889c9c 100644 --- a/examples/cvodes/serial/README +++ b/examples/cvodes/serial/README @@ -18,7 +18,7 @@ List of serial CVODES examples (2) Forward sensitivity - cvsAdvDiff_FSA_non : 1-D advection difusion PDE - + cvsAdvDiff_FSA_non : 1-D advection diffusion PDE - Adams with Functional iteration cvsDiurnal_FSA_kry : 2-D 2-species diurnal advection-diffusion PDE - BDF with Newton GMRES diff --git a/examples/cvodes/serial/cvsAdvDiff_bnd.c b/examples/cvodes/serial/cvsAdvDiff_bnd.c index a8caf7738f..aa86375480 100644 --- a/examples/cvodes/serial/cvsAdvDiff_bnd.c +++ b/examples/cvodes/serial/cvsAdvDiff_bnd.c @@ -154,7 +154,7 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvodes/serial/cvsAdvDiff_bndL.c b/examples/cvodes/serial/cvsAdvDiff_bndL.c index 312dd2f1e1..6bee5f1054 100644 --- a/examples/cvodes/serial/cvsAdvDiff_bndL.c +++ b/examples/cvodes/serial/cvsAdvDiff_bndL.c @@ -150,7 +150,7 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvodes/serial/cvsAnalytic_mels.c b/examples/cvodes/serial/cvsAnalytic_mels.c index a7a4f93b0e..33d957a0e2 100644 --- a/examples/cvodes/serial/cvsAnalytic_mels.c +++ b/examples/cvodes/serial/cvsAnalytic_mels.c @@ -15,11 +15,11 @@ * * The following is a simple example problem with analytical solution, * solution, - * dy/dt = lamda*y + 1/(1+t^2) - lamda*atan(t) + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) * for t in the interval [0.0, 10.0], with initial condition: y=0. * * The stiffness of the problem is directly proportional to the - * value of "lamda". The value of lamda should be negative to + * value of "lambda". The value of lambda should be negative to * result in a well-posed ODE; for values with magnitude larger * than 100 the problem becomes quite stiff. * @@ -75,7 +75,7 @@ int main(void) sunindextype NEQ = 1; /* number of dependent vars. */ sunrealtype reltol = SUN_RCONST(1.0e-6); /* tolerances */ sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); /* stiffness parameter */ + sunrealtype lambda = SUN_RCONST(-100.0); /* stiffness parameter */ /* general problem variables */ int retval; /* reusable error-checking flag */ @@ -87,7 +87,7 @@ int main(void) /* Initial diagnostics output */ printf("\nAnalytical ODE test problem:\n"); - printf(" lamda = %" GSYM "\n", lamda); + printf(" lambda = %" GSYM "\n", lambda); printf(" reltol = %.1" ESYM "\n", reltol); printf(" abstol = %.1" ESYM "\n\n", abstol); @@ -106,13 +106,13 @@ int main(void) if (check_retval((void*)cvode_mem, "CVodeCreate", 0)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in y'=f(t,y), the inital time T0, and + * user's right hand side function in y'=f(t,y), the initial time T0, and * the initial dependent variable vector y. */ retval = CVodeInit(cvode_mem, f, T0, y); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } /* Call CVodeSetUserData to specify the stiffness factor */ - retval = CVodeSetUserData(cvode_mem, (void*)&lamda); + retval = CVodeSetUserData(cvode_mem, (void*)&lambda); if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeSStolerances to specify the scalar relative and absolute tolerances */ @@ -200,12 +200,12 @@ int main(void) static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) { sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ - sunrealtype lamda = rdata[0]; /* set shortcut for stiffness parameter */ - sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = NV_Ith_S(y, 0); /* access current solution value */ /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */ - NV_Ith_S(ydot, 0) = lamda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - - lamda * atan(t); + NV_Ith_S(ydot, 0) = lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - + lambda * atan(t); return 0; /* return with success */ } @@ -249,7 +249,7 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, sunrealtype tcur, gamma, rl1; void* user_data; sunrealtype* rdata; - sunrealtype lamda; + sunrealtype lambda; /* retrieve implicit system data from CVode */ retval = CVodeGetNonlinearSystemData(LS->content, &tcur, &ypred, &y, &fn, @@ -260,11 +260,11 @@ static int MatrixEmbeddedLSSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, } /* extract stiffness parameter from user_data */ - rdata = (sunrealtype*)user_data; - lamda = rdata[0]; + rdata = (sunrealtype*)user_data; + lambda = rdata[0]; - /* perform linear solve: (1-gamma*lamda)*x = b */ - NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lamda); + /* perform linear solve: (1-gamma*lambda)*x = b */ + NV_Ith_S(x, 0) = NV_Ith_S(b, 0) / (1 - gamma * lambda); /* return with success */ return (SUN_SUCCESS); diff --git a/examples/cvodes/serial/cvsAnalytic_mels.out b/examples/cvodes/serial/cvsAnalytic_mels.out index 21458daf24..6d0fecd3e7 100644 --- a/examples/cvodes/serial/cvsAnalytic_mels.out +++ b/examples/cvodes/serial/cvsAnalytic_mels.out @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1.0e-06 abstol = 1.0e-10 diff --git a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c index 3be69e5d18..b23040ad1b 100644 --- a/examples/cvodes/serial/cvsDiurnal_FSA_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_FSA_kry.c @@ -239,7 +239,7 @@ int main(int argc, char* argv[]) LS = SUNLinSol_SPGMR(y, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvodes/serial/cvsDiurnal_kry.c b/examples/cvodes/serial/cvsDiurnal_kry.c index 9c58daba24..599aa7a2a5 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry.c +++ b/examples/cvodes/serial/cvsDiurnal_kry.c @@ -197,7 +197,7 @@ int main(void) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -212,7 +212,7 @@ int main(void) LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Call CVodeSetLinearSolver to attach the linear sovler to CVode */ + /* Call CVodeSetLinearSolver to attach the linear solver to CVode */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvodes/serial/cvsDiurnal_kry_bp.c b/examples/cvodes/serial/cvsDiurnal_kry_bp.c index ab06a9c72c..2962e8afc1 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry_bp.c +++ b/examples/cvodes/serial/cvsDiurnal_kry_bp.c @@ -188,7 +188,7 @@ int main(void) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -203,7 +203,7 @@ int main(void) LS = SUNLinSol_SPGMR(u, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Call CVodeSetLinearSolver to attach the linear sovler to CVode */ + /* Call CVodeSetLinearSolver to attach the linear solver to CVode */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c index a365379f7c..e8409e6e91 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c @@ -120,7 +120,7 @@ #define BB ONE /* BB = b */ #define DPREY ONE #define DPRED SUN_RCONST(0.5) -#define ALPH ONE +#define ALPHA ONE #define NP 3 #define NS (2 * NP) @@ -295,7 +295,7 @@ int main(int argc, char* argv[]) LS = SUNLinSol_SPGMR(c, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } @@ -358,7 +358,7 @@ int main(int argc, char* argv[]) LSB = SUNLinSol_SPGMR(cB, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LSB, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = CVodeSetLinearSolverB(cvode_mem, indexB, LSB, NULL); if (check_retval(&retval, "CVodeSetLinearSolverB", 1)) { return 1; } @@ -1014,7 +1014,7 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, for (i = 0; i < ns; i++) { rate[i] += c[j] * acoef[i][j]; } } - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = c[i] * (bcoef[i] * fac + rate[i]); } } @@ -1034,7 +1034,7 @@ static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, acoef = wdata->acoef; bcoef = wdata->bcoef; - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = bcoef[i] * fac; } diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c index ac57a68378..35f470bc45 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c @@ -113,7 +113,7 @@ #define BB ONE /* BB = b */ #define DPREY ONE #define DPRED SUN_RCONST(0.5) -#define ALPH ONE +#define ALPHA ONE #define NP 3 #define NS (2 * NP) @@ -287,7 +287,7 @@ int main(int argc, char* argv[]) LS = SUNLinSol_SPGMR(c, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LS, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = CVodeSetLinearSolver(cvode_mem, LS, NULL); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return 1; } @@ -348,7 +348,7 @@ int main(int argc, char* argv[]) LSB = SUNLinSol_SPGMR(cB, SUN_PREC_LEFT, 0, sunctx); if (check_retval((void*)LSB, "SUNLinSol_SPGMR", 0)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = CVodeSetLinearSolverB(cvode_mem, indexB, LSB, NULL); if (check_retval(&retval, "CVodeSetLinearSolverB", 1)) { return 1; } @@ -1018,7 +1018,7 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, for (i = 0; i < ns; i++) { rate[i] += c[j] * acoef[i][j]; } } - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = c[i] * (bcoef[i] * fac + rate[i]); } } @@ -1038,7 +1038,7 @@ static void WebRatesB(sunrealtype x, sunrealtype y, sunrealtype t, acoef = wdata->acoef; bcoef = wdata->bcoef; - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = bcoef[i] * fac; } diff --git a/examples/cvodes/serial/cvsKrylovDemo_ls.c b/examples/cvodes/serial/cvsKrylovDemo_ls.c index ad45ae68a8..68b69906ff 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_ls.c +++ b/examples/cvodes/serial/cvsKrylovDemo_ls.c @@ -245,7 +245,7 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "CVodeSetUserData", 1)) { return (1); } /* Call CVodeInit to initialize the integrator memory and specify the - * user's right hand side function in u'=f(t,u), the inital time T0, and + * user's right hand side function in u'=f(t,u), the initial time T0, and * the initial dependent variable vector u. */ retval = CVodeInit(cvode_mem, f, T0, u); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } diff --git a/examples/cvodes/serial/cvsKrylovDemo_prec.c b/examples/cvodes/serial/cvsKrylovDemo_prec.c index cb889704cc..376cd698fc 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_prec.c +++ b/examples/cvodes/serial/cvsKrylovDemo_prec.c @@ -66,7 +66,7 @@ * only a subset of the ns by ns blocks). * * Four different runs are made for this problem. - * The product preconditoner is applied on the left and on the + * The product preconditioner is applied on the left and on the * right. In each case, both the modified and classical Gram-Schmidt * options are tested. * In the series of runs, CVodeInit, SUNLinSol_SPGMR, and @@ -129,7 +129,7 @@ #define BB ONE /* BB = b */ #define DPREY ONE #define DPRED SUN_RCONST(0.5) -#define ALPH ONE +#define ALPHA ONE #define NP 3 #define NS (2 * NP) @@ -159,8 +159,8 @@ /* Spgmr/CVLS Constants */ -#define MAXL 0 /* => use default = MIN(NEQ, 5) */ -#define DELT ZERO /* => use default = 0.05 */ +#define MAXL 0 /* => use default = MIN(NEQ, 5) */ +#define DELTA ZERO /* => use default = 0.05 */ /* Output Constants */ @@ -309,7 +309,7 @@ int main(void) return (1); } - retval = CVodeSetEpsLin(cvode_mem, DELT); + retval = CVodeSetEpsLin(cvode_mem, DELTA); if (check_retval(&retval, "CVodeSetEpsLin", 1)) { return (1); } retval = CVodeSetPreconditioner(cvode_mem, Precond, PSolve); @@ -507,17 +507,17 @@ static void PrintIntro(void) printf("Matrix parameters: a = %.2Lg e = %.2Lg g = %.2Lg\n", AA, EE, GG); printf("b parameter = %.2Lg\n", BB); printf("Diffusion coefficients: Dprey = %.2Lg Dpred = %.2Lg\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2Lg\n\n", ALPH); + printf("Rate parameter alpha = %.2Lg\n\n", ALPHA); #elif defined(SUNDIALS_DOUBLE_PRECISION) printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #else printf("Matrix parameters: a = %.2g e = %.2g g = %.2g\n", AA, EE, GG); printf("b parameter = %.2g\n", BB); printf("Diffusion coefficients: Dprey = %.2g Dpred = %.2g\n", DPREY, DPRED); - printf("Rate parameter alpha = %.2g\n\n", ALPH); + printf("Rate parameter alpha = %.2g\n\n", ALPHA); #endif printf("Mesh dimensions (mx,my) are %d, %d. ", MX, MY); printf("Total system size is neq = %d \n\n", NEQ); @@ -788,7 +788,7 @@ static void WebRates(sunrealtype x, sunrealtype y, sunrealtype t, for (i = 0; i < ns; i++) { rate[i] += c[j] * acoef[i][j]; } } - fac = ONE + ALPH * x * y; + fac = ONE + ALPHA * x * y; for (i = 0; i < ns; i++) { rate[i] = c[i] * (bcoef[i] * fac + rate[i]); } } diff --git a/examples/cvodes/serial/cvsParticle_dns.c b/examples/cvodes/serial/cvsParticle_dns.c index 85230afa99..f1ef964ffd 100644 --- a/examples/cvodes/serial/cvsParticle_dns.c +++ b/examples/cvodes/serial/cvsParticle_dns.c @@ -479,7 +479,7 @@ static void InputHelp(void) printf(" --alpha <vel> : particle velocity\n"); printf(" --orbits <orbits> : number of orbits to perform\n"); printf(" --rtol <rtol> : relative tolerance\n"); - printf(" --atol <atol> : absoltue tolerance\n"); + printf(" --atol <atol> : absolute tolerance\n"); printf(" --proj <1 or 0> : enable (1) / disable (0) projection\n"); printf(" --projerr <1 or 0> : enable (1) / disable (0) error projection\n"); printf(" --nout <nout> : outputs per period\n"); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c index a4c121d977..8006539006 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns.c @@ -195,7 +195,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLq; @@ -263,9 +263,9 @@ int main(int argc, char* argv[]) /* Allocate global memory */ - /* Call CVodeAdjInit to update CVODES memory block by allocting the internal + /* Call CVodeAdjInit to update CVODES memory block by allocating the internal memory needed for backward integration.*/ - steps = STEPS; /* no. of integration steps between two consecutive ckeckpoints*/ + steps = STEPS; /* no. of integration steps between two consecutive checkpoints*/ retval = CVodeAdjInit(cvode_mem, steps, CV_HERMITE); /* retval = CVodeAdjInit(cvode_mem, steps, CV_POLYNOMIAL); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c index 9466029378..6b21b0e073 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_dns_constraints.c @@ -207,7 +207,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLq; @@ -274,9 +274,9 @@ int main(int argc, char* argv[]) /* Allocate global memory */ - /* Call CVodeAdjInit to update CVODES memory block by allocting the internal + /* Call CVodeAdjInit to update CVODES memory block by allocating the internal memory needed for backward integration.*/ - steps = STEPS; /* no. of integration steps between two consecutive ckeckpoints*/ + steps = STEPS; /* no. of integration steps between two consecutive checkpoints*/ retval = CVodeAdjInit(cvode_mem, steps, CV_HERMITE); /* retval = CVodeAdjInit(cvode_mem, steps, CV_POLYNOMIAL); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c index 8fbd965a1c..0a92295d86 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_klu.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_klu.c @@ -197,7 +197,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLq; @@ -266,9 +266,9 @@ int main(int argc, char* argv[]) /* Allocate global memory */ - /* Call CVodeAdjInit to update CVODES memory block by allocting the internal + /* Call CVodeAdjInit to update CVODES memory block by allocating the internal memory needed for backward integration.*/ - steps = STEPS; /* no. of integration steps between two consecutive ckeckpoints*/ + steps = STEPS; /* no. of integration steps between two consecutive checkpoints*/ retval = CVodeAdjInit(cvode_mem, steps, CV_HERMITE); /* retval = CVodeAdjInit(cvode_mem, steps, CV_POLYNOMIAL); diff --git a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c index aedc025c19..e7183f1816 100644 --- a/examples/cvodes/serial/cvsRoberts_ASAi_sps.c +++ b/examples/cvodes/serial/cvsRoberts_ASAi_sps.c @@ -197,7 +197,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLq; @@ -267,9 +267,9 @@ int main(int argc, char* argv[]) /* Allocate global memory */ - /* Call CVodeAdjInit to update CVODES memory block by allocting the internal + /* Call CVodeAdjInit to update CVODES memory block by allocating the internal memory needed for backward integration.*/ - steps = STEPS; /* no. of integration steps between two consecutive ckeckpoints*/ + steps = STEPS; /* no. of integration steps between two consecutive checkpoints*/ retval = CVodeAdjInit(cvode_mem, steps, CV_HERMITE); /* retval = CVodeAdjInit(cvode_mem, steps, CV_POLYNOMIAL); diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c index e7359edae7..1b31f9d990 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_Switch.c @@ -74,7 +74,7 @@ static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* udata, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* User provided routine called by the solver to compute - * r.h.s. sensititivy. */ + * r.h.s. sensitivity. */ static int fS(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void* udata, N_Vector tmp1, N_Vector tmp2); @@ -149,7 +149,7 @@ int main(int argc, char* argv[]) /* Call CVodeInit to initialize the integrator memory and specify the * user's right hand side function y'=f(t,y), the initial time T0, and - * the intiial dependenet variable vector y0. */ + * the initial dependenet variable vector y0. */ retval = CVodeInit(cvode_mem, f, T0, y0); if (check_retval(&retval, "CVodeInit", 1)) { return (1); } @@ -180,7 +180,7 @@ int main(int argc, char* argv[]) retval = CVodeSetLinearSolver(cvode_mem, LS, A); if (check_retval(&retval, "CVodeSetLinearSolver", 1)) { return (1); } - /* Specifiy the Jacobian approximation routine to be used */ + /* Specify the Jacobian approximation routine to be used */ retval = CVodeSetJacFn(cvode_mem, Jac); if (check_retval(&retval, "CVodeSetJacFn", 1)) { return (1); } @@ -188,7 +188,7 @@ int main(int argc, char* argv[]) data->sensi = SUNTRUE; /* sensitivity ON */ data->meth = CV_SIMULTANEOUS; /* simultaneous corrector method */ data->errconS = SUNTRUE; /* full error control */ - data->fsDQ = SUNFALSE; /* user-provided sensitvity RHS */ + data->fsDQ = SUNFALSE; /* user-provided sensitivity RHS */ Ns = 3; diff --git a/examples/cvodes/serial/cvsRoberts_dns.c b/examples/cvodes/serial/cvsRoberts_dns.c index 0fdbc0d7ce..b5d069ca81 100644 --- a/examples/cvodes/serial/cvsRoberts_dns.c +++ b/examples/cvodes/serial/cvsRoberts_dns.c @@ -384,7 +384,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/cvodes/serial/cvsRoberts_dns_constraints.c b/examples/cvodes/serial/cvsRoberts_dns_constraints.c index 1db7baa4fa..12ea2aefd2 100644 --- a/examples/cvodes/serial/cvsRoberts_dns_constraints.c +++ b/examples/cvodes/serial/cvsRoberts_dns_constraints.c @@ -435,7 +435,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) flag */ diff --git a/examples/ida/C_openmp/CMakeLists.txt b/examples/ida/C_openmp/CMakeLists.txt index 6fcf691c6e..a1a0ba35bc 100644 --- a/examples/ida/C_openmp/CMakeLists.txt +++ b/examples/ida/C_openmp/CMakeLists.txt @@ -62,7 +62,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c index d6c6c85f84..049c988242 100644 --- a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c @@ -220,7 +220,7 @@ int main(int argc, char* argv[]) num_threads = 1; /* default value */ #ifdef _OPENMP num_threads = - omp_get_max_threads(); /* overwrite with OMP_NUM_THREADS enviroment variable */ + omp_get_max_threads(); /* overwrite with OMP_NUM_THREADS environment variable */ #endif if (argc > 1) { /* overwrite with command line value, if supplied */ diff --git a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c index 9e73934310..eb15b44994 100644 --- a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c @@ -503,7 +503,7 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, sunrealtype cj, - sunrealtype dalta, void* user_data) + sunrealtype delta, void* user_data) { sunrealtype **Pxy, *zxy; sunindextype* pivot; diff --git a/examples/ida/F2003_parallel/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt index afaea82c5f..b43dee6744 100644 --- a/examples/ida/F2003_parallel/CMakeLists.txt +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -81,7 +81,7 @@ foreach(example_tuple ${FIDA_examples}) endforeach(example_tuple ${FIDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files @@ -96,7 +96,7 @@ if(EXAMPLES_INSTALL) # Makefile: convert semi-colon separated target list to space separated string list2string(IDA_LIBS EXAMPLE_LIBS) - # CMakeLists: replace sundials_ prefix and convert to space separted string + # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM IDA_LIBS REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) diff --git a/examples/ida/cuda/CMakeLists.txt b/examples/ida/cuda/CMakeLists.txt index 81c74e96df..41a8fcfa8e 100644 --- a/examples/ida/cuda/CMakeLists.txt +++ b/examples/ida/cuda/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/cuda/idaHeat2D_kry_cuda.cu b/examples/ida/cuda/idaHeat2D_kry_cuda.cu index 5274650e9e..a72e740bf9 100644 --- a/examples/ida/cuda/idaHeat2D_kry_cuda.cu +++ b/examples/ida/cuda/idaHeat2D_kry_cuda.cu @@ -252,7 +252,7 @@ int main(int argc, char* argv[]) ier = SUNLinSol_SPGMRSetMaxRestarts(LS, 5); if (check_flag(&ier, "SUNLinSol_SPGMRSetMaxRestarts", 1)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ ier = IDASetLinearSolver(mem, LS, NULL); if (check_flag(&ier, "IDASetLinearSolver", 1)) { return (1); } @@ -412,7 +412,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for idaHeat2D_kry. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/mpicuda/CMakeLists.txt b/examples/ida/mpicuda/CMakeLists.txt index fb01b8b3b6..4f3e4ad98d 100644 --- a/examples/ida/mpicuda/CMakeLists.txt +++ b/examples/ida/mpicuda/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu index 1fc3f8de3b..68f876abbb 100644 --- a/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu +++ b/examples/ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu @@ -435,7 +435,7 @@ int main(int argc, char* argv[]) MPI_Abort(comm, 1); } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(rtol, atol, data); } PrintOutput(thispe, ida_mem, t0, uu); @@ -513,7 +513,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/mpiraja/CMakeLists.txt b/examples/ida/mpiraja/CMakeLists.txt index 9db66e0922..0d22ba336c 100644 --- a/examples/ida/mpiraja/CMakeLists.txt +++ b/examples/ida/mpiraja/CMakeLists.txt @@ -67,7 +67,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" diff --git a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp index 297342e316..173abed97e 100644 --- a/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp +++ b/examples/ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp @@ -283,7 +283,7 @@ int main(int argc, char* argv[]) MPI_Abort(comm, 1); } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(rtol, atol, data); } PrintOutput(thispe, ida_mem, t0, uu); @@ -361,7 +361,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/parallel/CMakeLists.txt b/examples/ida/parallel/CMakeLists.txt index 0eff8ed069..0ca3efc0ad 100644 --- a/examples/ida/parallel/CMakeLists.txt +++ b/examples/ida/parallel/CMakeLists.txt @@ -75,7 +75,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c index e0ea638524..e60fe3d7be 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_bbd_p.c @@ -563,7 +563,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, /* * Print first lines of output (problem description) - * and table headerr + * and table header */ static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, diff --git a/examples/ida/parallel/idaFoodWeb_kry_p.c b/examples/ida/parallel/idaFoodWeb_kry_p.c index c099f13161..b916fb63c9 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_p.c @@ -80,7 +80,7 @@ * * The DAE system is solved by IDA using the SUNLinSol_SPGMR linear * solver, which uses the preconditioned GMRES iterative method to - * solve linear systems. The precondtioner supplied to SUNLinSol_SPGMR is + * solve linear systems. The preconditioner supplied to SUNLinSol_SPGMR is * the block-diagonal part of the Jacobian with ns by ns blocks * arising from the reaction terms only. Output is printed at * t = 0, .001, .01, .1, .4, .7, 1. @@ -1240,7 +1240,7 @@ static sunrealtype dotprod(int size, sunrealtype* x1, sunrealtype* x2) /* * Preconbd: Preconditioner setup routine. * This routine generates and preprocesses the block-diagonal - * preconditoner PP. At each spatial point, a block of PP is computed + * preconditioner PP. At each spatial point, a block of PP is computed * by way of difference quotients on the reaction rates R. * The base value of R are taken from webdata->rates, as set by webres. * Each block is LU-factored, for later solution of the linear systems. diff --git a/examples/ida/parallel/idaHeat2D_kry_p.c b/examples/ida/parallel/idaHeat2D_kry_p.c index 6fd9b73c61..84b80482aa 100644 --- a/examples/ida/parallel/idaHeat2D_kry_p.c +++ b/examples/ida/parallel/idaHeat2D_kry_p.c @@ -287,7 +287,7 @@ int main(int argc, char* argv[]) MPI_Abort(comm, 1); } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(rtol, atol, data); } PrintOutput(thispe, ida_mem, t0, uu); @@ -365,7 +365,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes.c b/examples/ida/petsc/idaHeat2D_petsc_snes.c index f5bb085913..e0f4557ce4 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes.c +++ b/examples/ida/petsc/idaHeat2D_petsc_snes.c @@ -368,7 +368,7 @@ int main(int argc, char* argv[]) * Solve the problem, printing output at the desired points in time */ - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(Neq, rtol, atol); } PrintOutput(thispe, ida_mem, t0, uu, snes); @@ -600,7 +600,7 @@ int jacHeat(SNES snes, Vec x, Mat Jpre, Mat J, void* user_data) * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c index 2e64e83eed..9cc4ab3731 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_spgmr.c +++ b/examples/ida/petsc/idaHeat2D_petsc_spgmr.c @@ -303,7 +303,7 @@ int main(int argc, char* argv[]) MPI_Abort(comm, 1); } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(Neq, rtol, atol); } PrintOutput(thispe, ida_mem, t0, uu); @@ -454,7 +454,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/raja/CMakeLists.txt b/examples/ida/raja/CMakeLists.txt index 98ea198a79..5c2bddeed5 100644 --- a/examples/ida/raja/CMakeLists.txt +++ b/examples/ida/raja/CMakeLists.txt @@ -64,7 +64,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" diff --git a/examples/ida/raja/idaHeat2D_kry_raja.cpp b/examples/ida/raja/idaHeat2D_kry_raja.cpp index 9655563d5f..0f65f76b4e 100644 --- a/examples/ida/raja/idaHeat2D_kry_raja.cpp +++ b/examples/ida/raja/idaHeat2D_kry_raja.cpp @@ -196,7 +196,7 @@ int main(int argc, char* argv[]) ier = SUNLinSol_SPGMRSetMaxRestarts(LS, 5); if (check_flag(&ier, "SUNSPGMRSetMaxRestarts", 1)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ ier = IDASetLinearSolver(mem, LS, NULL); if (check_flag(&ier, "IDASetLinearSolver", 1)) { return (1); } @@ -375,7 +375,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for idaHeat2D_kry. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/serial/CMakeLists.txt b/examples/ida/serial/CMakeLists.txt index 809c6be76d..005f35d945 100644 --- a/examples/ida/serial/CMakeLists.txt +++ b/examples/ida/serial/CMakeLists.txt @@ -278,7 +278,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/serial/idaFoodWeb_kry.c b/examples/ida/serial/idaFoodWeb_kry.c index ed8004ffc5..e81e07c0ad 100644 --- a/examples/ida/serial/idaFoodWeb_kry.c +++ b/examples/ida/serial/idaFoodWeb_kry.c @@ -276,7 +276,7 @@ int main(void) retval = SUNLinSol_SPGMRSetMaxRestarts(LS, 5); if (check_retval(&retval, "SUNLinSol_SPGMRSetMaxRestarts", 1)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = IDASetLinearSolver(mem, LS, NULL); if (check_retval(&retval, "IDASetLinearSolver", 1)) { return (1); } @@ -471,7 +471,7 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, sunrealtype cj, - sunrealtype dalta, void* user_data) + sunrealtype delta, void* user_data) { sunrealtype **Pxy, *zxy; sunindextype* pivot; diff --git a/examples/ida/serial/idaHeat2D_kry.c b/examples/ida/serial/idaHeat2D_kry.c index b46a106fdc..5b07f271f9 100644 --- a/examples/ida/serial/idaHeat2D_kry.c +++ b/examples/ida/serial/idaHeat2D_kry.c @@ -350,7 +350,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for idaHeat2D_kry. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/serial/idaKrylovDemo_ls.c b/examples/ida/serial/idaKrylovDemo_ls.c index bf44ef72f7..4d8b40e82d 100644 --- a/examples/ida/serial/idaKrylovDemo_ls.c +++ b/examples/ida/serial/idaKrylovDemo_ls.c @@ -414,7 +414,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/serial/idaRoberts_dns.c b/examples/ida/serial/idaRoberts_dns.c index c00849ffd3..c235c210ec 100644 --- a/examples/ida/serial/idaRoberts_dns.c +++ b/examples/ida/serial/idaRoberts_dns.c @@ -176,7 +176,7 @@ int main(void) if (check_retval(&retval, "IDASetJacFn", 1)) { return (1); } /* Create Newton SUNNonlinearSolver object. IDA uses a - * Newton SUNNonlinearSolver by default, so it is unecessary + * Newton SUNNonlinearSolver by default, so it is unnecessary * to create it and attach it. It is done in this example code * solely for demonstration purposes. */ NLS = SUNNonlinSol_Newton(yy, ctx); @@ -434,7 +434,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) retval */ diff --git a/examples/ida/trilinos/CMakeLists.txt b/examples/ida/trilinos/CMakeLists.txt index 9a11456931..0a1a28eac4 100644 --- a/examples/ida/trilinos/CMakeLists.txt +++ b/examples/ida/trilinos/CMakeLists.txt @@ -74,7 +74,7 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp index d8d72bcbee..c7b69ffd9a 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_p_tpetra.cpp @@ -32,7 +32,7 @@ * is suppressed. Output is taken at t = 0, .01, .02, .04, * ..., 10.24. * ----------------------------------------------------------------- - * When running this example for unit testing, set the environemnt + * When running this example for unit testing, set the environment * variables OMP_PROC_BIND=false and OMP_NUM_THREADS=2 to run * without thread binding and with two OpenMP threads. * ----------------------------------------------------------------- @@ -219,7 +219,7 @@ int main(int argc, char* argv[]) return 1; } - /* Construct a Tpetra vector and return refernce counting pointer to it. */ + /* Construct a Tpetra vector and return reference counting pointer to it. */ Teuchos::RCP<vector_type> rcpuu = Teuchos::rcp(new vector_type(testMap)); /* Allocate and initialize N-vectors. */ @@ -292,7 +292,7 @@ int main(int argc, char* argv[]) retval = IDASetPreconditioner(ida_mem, PsetupHeat, PsolveHeat); if (check_retval(&retval, "IDASetPreconditioner", 1, thispe)) { return -1; } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(rtol, atol, data); } PrintOutput(thispe, ida_mem, t0, uu); @@ -372,7 +372,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp index d3f5cbf27b..4f9af8da74 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp +++ b/examples/ida/trilinos/idaHeat2D_kry_tpetra.cpp @@ -28,7 +28,7 @@ * being Modified in the first case, and Classical in the second. * The second run uses IDAReInit. * ----------------------------------------------------------------- - * When running this example for unit testing, set the environemnt + * When running this example for unit testing, set the environment * variables OMP_PROC_BIND=false and OMP_NUM_THREADS=2 to run * without thread binding and with two OpenMP threads. * ----------------------------------------------------------------- @@ -157,7 +157,7 @@ int main(int argc, char* argv[]) Teuchos::RCP<const map_type> testMap = Teuchos::rcp( new map_type(global_length, index_base, comm, Tpetra::GloballyDistributed)); - /* Construct a Tpetra vector and return refernce counting pointer to it. */ + /* Construct a Tpetra vector and return reference counting pointer to it. */ Teuchos::RCP<vector_type> rcpuu = Teuchos::rcp(new vector_type(testMap)); if (comm->getSize() != 1) @@ -225,7 +225,7 @@ int main(int argc, char* argv[]) retval = SUNLinSol_SPGMRSetMaxRestarts(LS, 5); if (check_retval(&retval, "SUNSPGMRSetMaxRestarts", 1)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = IDASetLinearSolver(mem, LS, NULL); if (check_retval(&retval, "IDASetLinearSolver", 1)) { return (1); } @@ -415,7 +415,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for idaHeat2D_kry. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/idas/C_openmp/CMakeLists.txt b/examples/idas/C_openmp/CMakeLists.txt index d9bf8c422a..a92eebe4a4 100644 --- a/examples/idas/C_openmp/CMakeLists.txt +++ b/examples/idas/C_openmp/CMakeLists.txt @@ -72,7 +72,7 @@ foreach(example_tuple ${IDAS_examples}) endforeach(example_tuple ${IDAS_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c index 5c38c558bc..4569bbc6a8 100644 --- a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c @@ -220,7 +220,7 @@ int main(int argc, char* argv[]) num_threads = 1; /* default value */ #ifdef _OPENMP num_threads = - omp_get_max_threads(); /* overwrite with OMP_NUM_THREADS enviroment variable */ + omp_get_max_threads(); /* overwrite with OMP_NUM_THREADS environment variable */ #endif if (argc > 1) { /* overwrite with command line value, if supplied */ diff --git a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c index ab8be2b081..91fa4f4c4d 100644 --- a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c @@ -501,7 +501,7 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, static int PSolve(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, N_Vector rvec, N_Vector zvec, sunrealtype cj, - sunrealtype dalta, void* user_data) + sunrealtype delta, void* user_data) { sunrealtype **Pxy, *zxy; sunindextype* pivot; diff --git a/examples/idas/parallel/CMakeLists.txt b/examples/idas/parallel/CMakeLists.txt index 3c18e878fc..69fb954292 100644 --- a/examples/idas/parallel/CMakeLists.txt +++ b/examples/idas/parallel/CMakeLists.txt @@ -97,7 +97,7 @@ foreach(example_tuple ${IDAS_examples}) endforeach(example_tuple ${IDAS_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c index d87f82d620..b44eb9029c 100644 --- a/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_ASAp_kry_bbd_p.c @@ -683,7 +683,7 @@ static void SetInitialProfilesB(N_Vector uv, N_Vector uvp, N_Vector uvB, /* * Print first lines of output (problem description) - * and table headerr + * and table header */ static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, diff --git a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c index 1134ce4571..06fef2f5e7 100644 --- a/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_FSA_kry_bbd_p.c @@ -563,7 +563,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, /* * Print first lines of output (problem description) - * and table headerr + * and table header */ static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, @@ -1192,7 +1192,7 @@ static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, } } - /* Algebraic equation correspoding to boundary mesh point. */ + /* Algebraic equation corresponding to boundary mesh point. */ if (jysub == 0) { for (ix = 0; ix < mxsub; ix++) diff --git a/examples/idas/parallel/idasBruss_kry_bbd_p.c b/examples/idas/parallel/idasBruss_kry_bbd_p.c index 7e73109a86..6e98a00b87 100644 --- a/examples/idas/parallel/idasBruss_kry_bbd_p.c +++ b/examples/idas/parallel/idasBruss_kry_bbd_p.c @@ -482,7 +482,7 @@ static void SetInitialProfiles(N_Vector uv, N_Vector uvp, N_Vector id, /* * Print first lines of output (problem description) - * and table headerr + * and table header */ static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, @@ -1112,7 +1112,7 @@ static int reslocal(sunindextype Nlocal, sunrealtype tt, N_Vector uv, } } - /* Algebraic equation correspoding to boundary mesh point. */ + /* Algebraic equation corresponding to boundary mesh point. */ if (jysub == 0) { for (ix = 0; ix < mxsub; ix++) diff --git a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c index ddaecfcb9b..f5f848bcdf 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_bbd_p.c @@ -563,7 +563,7 @@ static void SetInitialProfiles(N_Vector cc, N_Vector cp, N_Vector id, /* * Print first lines of output (problem description) - * and table headerr + * and table header */ static void PrintHeader(sunindextype SystemSize, int maxl, sunindextype mudq, diff --git a/examples/idas/parallel/idasFoodWeb_kry_p.c b/examples/idas/parallel/idasFoodWeb_kry_p.c index 6f56d0c7dc..be9e4e1abb 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_p.c @@ -79,7 +79,7 @@ * * The DAE system is solved by IDAS using the SUNLinSol_SPGMR linear * solver, which uses the preconditioned GMRES iterative method to - * solve linear systems. The precondtioner supplied to SUNLinSol_SPGMR is + * solve linear systems. The preconditioner supplied to SUNLinSol_SPGMR is * the block-diagonal part of the Jacobian with ns by ns blocks * arising from the reaction terms only. Output is printed at * t = 0, .001, .01, .1, .4, .7, 1. @@ -1239,7 +1239,7 @@ static sunrealtype dotprod(int size, sunrealtype* x1, sunrealtype* x2) /* * Preconbd: Preconditioner setup routine. * This routine generates and preprocesses the block-diagonal - * preconditoner PP. At each spatial point, a block of PP is computed + * preconditioner PP. At each spatial point, a block of PP is computed * by way of difference quotients on the reaction rates R. * The base value of R are taken from webdata->rates, as set by webres. * Each block is LU-factored, for later solution of the linear systems. diff --git a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c index 8a141e305d..d9ef279fb0 100644 --- a/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c +++ b/examples/idas/parallel/idasHeat2D_FSA_kry_bbd_p.c @@ -330,7 +330,7 @@ int main(int argc, char* argv[]) /* Allocate sensitivity solution vectors uuS and upS and set them to an initial guess for the sensitivity ICs (the IC for uuS are - 0.0 since the state IC do not depend on the porblem parameters; + 0.0 since the state IC do not depend on the problem parameters; however, the derivatives upS may not and therefore we will have to call IDACalcIC to find them) */ diff --git a/examples/idas/parallel/idasHeat2D_kry_p.c b/examples/idas/parallel/idasHeat2D_kry_p.c index 8b6c40e95e..f856f940a2 100644 --- a/examples/idas/parallel/idasHeat2D_kry_p.c +++ b/examples/idas/parallel/idasHeat2D_kry_p.c @@ -297,7 +297,7 @@ int main(int argc, char* argv[]) MPI_Abort(comm, 1); } - /* Print output heading (on processor 0 only) and intial solution */ + /* Print output heading (on processor 0 only) and initial solution */ if (thispe == 0) { PrintHeader(Neq, rtol, atol); } PrintOutput(thispe, ida_mem, t0, uu); @@ -375,7 +375,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner for heatsk. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/idas/serial/CMakeLists.txt b/examples/idas/serial/CMakeLists.txt index c90e776019..56388c088f 100644 --- a/examples/idas/serial/CMakeLists.txt +++ b/examples/idas/serial/CMakeLists.txt @@ -287,7 +287,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/idas/serial/idasHeat2D_kry.c b/examples/idas/serial/idasHeat2D_kry.c index 6f3b1c30d9..c25b9b99aa 100644 --- a/examples/idas/serial/idasHeat2D_kry.c +++ b/examples/idas/serial/idasHeat2D_kry.c @@ -179,7 +179,7 @@ int main(void) retval = SUNLinSol_SPGMRSetMaxRestarts(LS, 5); if (check_retval(&retval, "SUNLinSol_SPGMRSetMaxRestarts", 1)) { return (1); } - /* Attach the linear sovler */ + /* Attach the linear solver */ retval = IDASetLinearSolver(mem, LS, NULL); if (check_retval(&retval, "IDASetLinearSolver", 1)) { return (1); } @@ -349,7 +349,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/idas/serial/idasHessian_ASA_FSA.c b/examples/idas/serial/idasHessian_ASA_FSA.c index ced0cb22dc..c13d890e3e 100644 --- a/examples/idas/serial/idasHessian_ASA_FSA.c +++ b/examples/idas/serial/idasHessian_ASA_FSA.c @@ -36,7 +36,7 @@ * * Reference: D.B. Ozyurt and P.I. Barton, SISC 26(5) 1725-1743, 2005. * - * Error handling was suppressed for code readibility reasons. + * Error handling was suppressed for code readability reasons. * -----------------------------------------------------------------*/ #include <idas/idas.h> /* prototypes for IDA fcts., consts. */ @@ -144,7 +144,7 @@ int main(int argc, char* argv[]) printf(" G = int_t0^tB0 g(t,p,y) dt\n"); printf(" g(t,p,y) = y3\n\n\n"); - /* Alocate and initialize user data. */ + /* Allocate and initialize user data. */ data = (UserData)malloc(sizeof(*data)); data->p[0] = P1; data->p[1] = P2; diff --git a/examples/idas/serial/idasKrylovDemo_ls.c b/examples/idas/serial/idasKrylovDemo_ls.c index eea87ad31c..e10f83250b 100644 --- a/examples/idas/serial/idasKrylovDemo_ls.c +++ b/examples/idas/serial/idasKrylovDemo_ls.c @@ -413,7 +413,7 @@ int resHeat(sunrealtype tt, N_Vector uu, N_Vector up, N_Vector rr, void* user_da * PsetupHeat: setup for diagonal preconditioner. * * The optional user-supplied functions PsetupHeat and - * PsolveHeat together must define the left preconditoner + * PsolveHeat together must define the left preconditioner * matrix P approximating the system Jacobian matrix * J = dF/du + cj*dF/du' * (where the DAE system is F(t,u,u') = 0), and solve the linear diff --git a/examples/idas/serial/idasRoberts_ASAi_dns.c b/examples/idas/serial/idasRoberts_ASAi_dns.c index ed4ded6f79..50a3b3f805 100644 --- a/examples/idas/serial/idasRoberts_ASAi_dns.c +++ b/examples/idas/serial/idasRoberts_ASAi_dns.c @@ -206,7 +206,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLQ; diff --git a/examples/idas/serial/idasRoberts_ASAi_klu.c b/examples/idas/serial/idasRoberts_ASAi_klu.c index 709d259d9a..38490aa654 100644 --- a/examples/idas/serial/idasRoberts_ASAi_klu.c +++ b/examples/idas/serial/idasRoberts_ASAi_klu.c @@ -205,7 +205,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLQ; diff --git a/examples/idas/serial/idasRoberts_ASAi_sps.c b/examples/idas/serial/idasRoberts_ASAi_sps.c index 4a92f0a846..a7c321fe19 100644 --- a/examples/idas/serial/idasRoberts_ASAi_sps.c +++ b/examples/idas/serial/idasRoberts_ASAi_sps.c @@ -205,7 +205,7 @@ int main(int argc, char* argv[]) if (check_retval((void*)q, "N_VNew_Serial", 0)) { return (1); } Ith(q, 1) = ZERO; - /* Set the scalar realtive and absolute tolerances reltolQ and abstolQ */ + /* Set the scalar relative and absolute tolerances reltolQ and abstolQ */ reltolQ = RTOL; abstolQ = ATOLQ; diff --git a/examples/idas/serial/idasRoberts_dns.c b/examples/idas/serial/idasRoberts_dns.c index 015b3b2ee5..2594ba2a1c 100644 --- a/examples/idas/serial/idasRoberts_dns.c +++ b/examples/idas/serial/idasRoberts_dns.c @@ -176,7 +176,7 @@ int main(void) if (check_retval(&retval, "IDASetJacFn", 1)) { return (1); } /* Create Newton SUNNonlinearSolver object. IDA uses a - * Newton SUNNonlinearSolver by default, so it is unecessary + * Newton SUNNonlinearSolver by default, so it is unnecessary * to create it and attach it. It is done in this example code * solely for demonstration purposes. */ NLS = SUNNonlinSol_Newton(yy, ctx); @@ -434,7 +434,7 @@ static int check_retval(void* returnvalue, const char* funcname, int opt) } /* compare the solution at the final time 4e10s to a reference solution computed - using a relative tolerance of 1e-8 and absoltue tolerance of 1e-14 */ + using a relative tolerance of 1e-8 and absolute tolerance of 1e-14 */ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, N_Vector atol) { int passfail = 0; /* answer pass (0) or fail (1) retval */ diff --git a/examples/kinsol/CUDA_mpi/CMakeLists.txt b/examples/kinsol/CUDA_mpi/CMakeLists.txt index c938ca7702..eef0be7cf4 100644 --- a/examples/kinsol/CUDA_mpi/CMakeLists.txt +++ b/examples/kinsol/CUDA_mpi/CMakeLists.txt @@ -59,7 +59,7 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) sundials_install_examples( diff --git a/examples/kinsol/CUDA_mpi/README b/examples/kinsol/CUDA_mpi/README index 1b8772be3a..eb193185a3 100644 --- a/examples/kinsol/CUDA_mpi/README +++ b/examples/kinsol/CUDA_mpi/README @@ -1,3 +1,3 @@ # KINSOL MPI+CUDA examples -* kin_em_mpicuda - expectation-maximazation probelm for mixture densities +* kin_em_mpicuda - expectation-maximazation problem for mixture densities diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu index e7eed330e4..02e3d79aa2 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu @@ -283,11 +283,11 @@ int main(int argc, char* argv[]) void* kin_mem = KINCreate(sunctx); if (check_retval((void*)kin_mem, "KINCreate", 0)) { return 1; } - // Set number of prior residuals used in Anderson Accleration + // Set number of prior residuals used in Anderson Acceleration retval = KINSetMAA(kin_mem, udata->maa); if (check_retval(&retval, "KINSetMAA", 0)) { return 1; } - // Set orthogonlization routine used in Anderson Accleration + // Set orthogonlization routine used in Anderson Acceleration retval = KINSetOrthAA(kin_mem, udata->orthaa); if (check_retval(&retval, "KINSetOrthAA", 0)) { return 1; } @@ -329,7 +329,7 @@ int main(int argc, char* argv[]) // Call main solver retval = KINSol(kin_mem, // KINSol memory block - u, // inital guess on input; solution vector + u, // initial guess on input; solution vector KIN_FP, // global strategy choice scale, // scaling vector, for the variable u scale); // scaling vector for function values fval diff --git a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp index a386a3d305..d81b6b0567 100644 --- a/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp +++ b/examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp @@ -80,7 +80,7 @@ struct UserData // Fixed Point Solver settings sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - double damping; // daming for Anderson Acceleration + double damping; // damping for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -93,7 +93,7 @@ struct UserData int num_samples; - // Ouput variables + // Output variables int output; // output level N_Vector vtemp; // error vector ofstream uout; // output file stream diff --git a/examples/kinsol/CXX_parallel/CMakeLists.txt b/examples/kinsol/CXX_parallel/CMakeLists.txt index 64657bdae9..c14a5bc2f0 100644 --- a/examples/kinsol/CXX_parallel/CMakeLists.txt +++ b/examples/kinsol/CXX_parallel/CMakeLists.txt @@ -67,7 +67,7 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) sundials_install_examples( diff --git a/examples/kinsol/CXX_parallel/README b/examples/kinsol/CXX_parallel/README index e9182acea9..58018e3e14 100644 --- a/examples/kinsol/CXX_parallel/README +++ b/examples/kinsol/CXX_parallel/README @@ -1,7 +1,7 @@ List of parallel KINSOL C++ examples kin_heat2D_nonlin_p : steady-state 2-D heat equation with added nonlinear term - kin_em_p : expectation-maximization probelm for mixture densities + kin_em_p : expectation-maximization problem for mixture densities Sample results: diff --git a/examples/kinsol/CXX_parallel/kin_em_p.cpp b/examples/kinsol/CXX_parallel/kin_em_p.cpp index 0344f8ac58..cb47e454b9 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.cpp @@ -215,11 +215,11 @@ int main(int argc, char* argv[]) void* kin_mem = KINCreate(sunctx); if (check_retval((void*)kin_mem, "KINCreate", 0)) { return 1; } - // Set number of prior residuals used in Anderson Accleration + // Set number of prior residuals used in Anderson Acceleration retval = KINSetMAA(kin_mem, udata->maa); if (check_retval(&retval, "KINSetMAA", 0)) { return 1; } - // Set orthogonlization routine used in Anderson Accleration + // Set orthogonlization routine used in Anderson Acceleration retval = KINSetOrthAA(kin_mem, udata->orthaa); if (check_retval(&retval, "KINSetOrthAA", 0)) { return 1; } @@ -261,7 +261,7 @@ int main(int argc, char* argv[]) // Call main solver retval = KINSol(kin_mem, // KINSol memory block - u, // inital guess on input; solution vector + u, // initial guess on input; solution vector KIN_FP, // global strategy choice scale, // scaling vector, for the variable u scale); // scaling vector for function values fval diff --git a/examples/kinsol/CXX_parallel/kin_em_p.hpp b/examples/kinsol/CXX_parallel/kin_em_p.hpp index fdb13a55be..0df17d81ff 100644 --- a/examples/kinsol/CXX_parallel/kin_em_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_em_p.hpp @@ -78,7 +78,7 @@ struct UserData // Fixed Point Solver settings sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - double damping; // daming for Anderson Acceleration + double damping; // damping for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -91,7 +91,7 @@ struct UserData int num_samples; - // Ouput variables + // Output variables int output; // output level N_Vector vtemp; // error vector ofstream uout; // output file stream diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp index ec4db70878..a6161aa4a1 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.cpp @@ -155,11 +155,11 @@ int main(int argc, char* argv[]) void* kin_mem = KINCreate(sunctx); if (check_retval((void*)kin_mem, "KINCreate", 0)) { return 1; } - // Set number of prior residuals used in Anderson Accleration + // Set number of prior residuals used in Anderson Acceleration retval = KINSetMAA(kin_mem, udata->maa); if (check_retval(&retval, "KINSetMAA", 0)) { return 1; } - // Set orthogonlization routine used in Anderson Accleration + // Set orthogonlization routine used in Anderson Acceleration retval = KINSetOrthAA(kin_mem, udata->orthaa); if (check_retval(&retval, "KINSetOrthAA", 0)) { return 1; } @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) // Call main solver retval = KINSol(kin_mem, // KINSol memory block - u, // inital guess on input; solution vector + u, // initial guess on input; solution vector KIN_FP, // global strategy choice scale, // scaling vector, for the variable u scale); // scaling vector for function values fval diff --git a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp index 35de74bfff..33a70df726 100644 --- a/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp +++ b/examples/kinsol/CXX_parallel/kin_heat2D_nonlin_p.hpp @@ -122,7 +122,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -131,7 +131,7 @@ struct UserData // Fixed Point Solver settings sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - double damping; // daming for Anderson Acceleration + double damping; // damping for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -143,7 +143,7 @@ struct UserData N_Vector b; // defined using c(u_exact) N_Vector vtemp; // temporary vector for function evaluation - // Ouput variables + // Output variables int output; // output level N_Vector e; // error vector ofstream uout; // output file stream diff --git a/examples/kinsol/CXX_parhyp/CMakeLists.txt b/examples/kinsol/CXX_parhyp/CMakeLists.txt index 6f5fe21285..793d82c75f 100644 --- a/examples/kinsol/CXX_parhyp/CMakeLists.txt +++ b/examples/kinsol/CXX_parhyp/CMakeLists.txt @@ -82,7 +82,7 @@ foreach(example_tuple ${KINSOL_examples}) endforeach(example_tuple ${KINSOL_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the header files diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index e64af29090..baf7ecd847 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -606,7 +606,7 @@ static int PSetup(void* user_data) retval = HYPRE_StructPFMGCreate(udata->comm_c, &(udata->precond)); if (retval != 0) { return -1; } - // Signal that the inital guess is zero + // Signal that the initial guess is zero retval = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (retval != 0) { return -1; } @@ -678,7 +678,7 @@ static int PSolve(void* user_data, N_Vector r, N_Vector z, sunrealtype tol, int retval = HYPRE_StructPFMGSolve(udata->precond, udata->Jmatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (retval == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (retval != 0) { return 1; } diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp index a9c542a5b8..b527b19b43 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp @@ -104,7 +104,7 @@ struct UserData // Fixed Point Solver settings sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - sunrealtype damping; // daming for Anderson Acceleration + sunrealtype damping; // damping for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -145,7 +145,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level ofstream uout; // output file stream ofstream rout; // output residual file stream diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index ab5bae7bc7..ae43c84d5f 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -798,7 +798,7 @@ static int PSetup(void* user_data) retval = HYPRE_StructPFMGCreate(udata->comm_c, &(udata->precond)); if (retval != 0) { return -1; } - // Signal that the inital guess is zero + // Signal that the initial guess is zero retval = HYPRE_StructPFMGSetZeroGuess(udata->precond); if (retval != 0) { return -1; } @@ -870,7 +870,7 @@ static int PSolve(void* user_data, N_Vector r, N_Vector z, sunrealtype tol, int retval = HYPRE_StructPFMGSolve(udata->precond, udata->Jmatrix, udata->bvec, udata->xvec); - // If a convergence error occured, clear the error and continue. For any + // If a convergence error occurred, clear the error and continue. For any // other error return with a recoverable error. if (retval == HYPRE_ERROR_CONV) { HYPRE_ClearError(HYPRE_ERROR_CONV); } else if (retval != 0) { return 1; } diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp index 05d6f6d09c..f156d8c7a3 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.hpp @@ -126,7 +126,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -135,7 +135,7 @@ struct UserData // Fixed Point Solver settings sunrealtype rtol; // relative tolerance int maa; // m for Anderson Acceleration - sunrealtype damping; // daming for Anderson Acceleration + sunrealtype damping; // damping for Anderson Acceleration int orthaa; // orthogonalization routine for AA int maxits; // max number of fixed point iterations @@ -184,7 +184,7 @@ struct UserData // 3 - nonsymmetric R/B Gauss-Seidel HYPRE_Int pfmg_nrelax; // number of pre and post relaxation sweeps (2) - // Ouput variables + // Output variables int output; // output level ofstream uout; // output file stream ofstream rout; // output residual file stream diff --git a/examples/kinsol/C_openmp/CMakeLists.txt b/examples/kinsol/C_openmp/CMakeLists.txt index 80beb7a8aa..71d83e6470 100644 --- a/examples/kinsol/C_openmp/CMakeLists.txt +++ b/examples/kinsol/C_openmp/CMakeLists.txt @@ -62,7 +62,7 @@ foreach(example_tuple ${KINSOL_examples}) endforeach(example_tuple ${KINSOL_examples_OMP}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt index 53fe77561c..ed36b5e8f3 100644 --- a/examples/kinsol/F2003_parallel/CMakeLists.txt +++ b/examples/kinsol/F2003_parallel/CMakeLists.txt @@ -81,7 +81,7 @@ foreach(example_tuple ${FKINSOL_examples}) endforeach(example_tuple ${FKINSOL_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files @@ -96,7 +96,7 @@ if(EXAMPLES_INSTALL) # Makefile: convert semi-colon separated target list to space separated string list2string(KINSOL_LIBS EXAMPLE_LIBS) - # CMakeLists: replace sundials_ prefix and convert to space separted string + # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM KINSOL_LIBS REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) diff --git a/examples/kinsol/parallel/CMakeLists.txt b/examples/kinsol/parallel/CMakeLists.txt index e043a6b221..d8c9febec6 100644 --- a/examples/kinsol/parallel/CMakeLists.txt +++ b/examples/kinsol/parallel/CMakeLists.txt @@ -73,7 +73,7 @@ foreach(example_tuple ${KINSOL_examples}) endforeach(example_tuple ${KINSOL_examples}) -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/kinsol/serial/CMakeLists.txt b/examples/kinsol/serial/CMakeLists.txt index 47d5fae83a..fe41d282ad 100644 --- a/examples/kinsol/serial/CMakeLists.txt +++ b/examples/kinsol/serial/CMakeLists.txt @@ -225,7 +225,7 @@ if(BUILD_SUNLINSOL_SUPERLUMT) endif() -# create Makfile and CMakeLists.txt for examples +# create Makefile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file diff --git a/examples/kinsol/serial/kinLaplace_picard_bnd.c b/examples/kinsol/serial/kinLaplace_picard_bnd.c index 2174418874..44d7e66c07 100644 --- a/examples/kinsol/serial/kinLaplace_picard_bnd.c +++ b/examples/kinsol/serial/kinLaplace_picard_bnd.c @@ -119,7 +119,7 @@ int main(void) if (check_retval((void*)scale, "N_VNew_Serial", 0)) { return (1); } /* ---------------------------------------------------------------------------------- - * Initialize and allocate memory for KINSOL, set parametrs for Anderson acceleration + * Initialize and allocate memory for KINSOL, set parameters for Anderson acceleration * ---------------------------------------------------------------------------------- */ kmem = KINCreate(sunctx); diff --git a/examples/kinsol/serial/kinLaplace_picard_kry.c b/examples/kinsol/serial/kinLaplace_picard_kry.c index 8013a1449e..e643d773d7 100644 --- a/examples/kinsol/serial/kinLaplace_picard_kry.c +++ b/examples/kinsol/serial/kinLaplace_picard_kry.c @@ -116,7 +116,7 @@ int main(void) if (check_retval((void*)scale, "N_VNew_Serial", 0)) { return (1); } /* ---------------------------------------------------------------------------------- - * Initialize and allocate memory for KINSOL, set parametrs for Anderson acceleration + * Initialize and allocate memory for KINSOL, set parameters for Anderson acceleration * ---------------------------------------------------------------------------------- */ kmem = KINCreate(sunctx); diff --git a/examples/kinsol/serial/kinRoboKin_slu.c b/examples/kinsol/serial/kinRoboKin_slu.c index f58434d210..e8d7d41e70 100644 --- a/examples/kinsol/serial/kinRoboKin_slu.c +++ b/examples/kinsol/serial/kinRoboKin_slu.c @@ -131,7 +131,7 @@ int main(void) if (check_retval((void*)J, "SUNSparseMatrix", 0)) { return (1); } /* Create SuperLUMT solver object */ - num_threads = 2; /* number fo threads to use */ + num_threads = 2; /* number of threads to use */ LS = SUNLinSol_SuperLUMT(y, J, num_threads, sunctx); if (check_retval((void*)LS, "SUNLinSol_SuperLUMT", 0)) { return (1); } diff --git a/examples/nvector/C_openmp/CMakeLists.txt b/examples/nvector/C_openmp/CMakeLists.txt index 5ed142e6da..f80fd19a8e 100644 --- a/examples/nvector/C_openmp/CMakeLists.txt +++ b/examples/nvector/C_openmp/CMakeLists.txt @@ -57,7 +57,7 @@ foreach(example_tuple ${nvector_openmp_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/cuda/CMakeLists.txt b/examples/nvector/cuda/CMakeLists.txt index e60c7f11ef..b8379d6d74 100644 --- a/examples/nvector/cuda/CMakeLists.txt +++ b/examples/nvector/cuda/CMakeLists.txt @@ -50,7 +50,7 @@ foreach(example_tuple ${nvector_cuda_examples}) # example source files add_executable(${example} ${example}.cu) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/hip/CMakeLists.txt b/examples/nvector/hip/CMakeLists.txt index 9d303d2ccd..dbeba9966f 100644 --- a/examples/nvector/hip/CMakeLists.txt +++ b/examples/nvector/hip/CMakeLists.txt @@ -57,7 +57,7 @@ foreach(example_tuple ${nvector_hip_examples}) # example source files add_executable(${example_target} ${example}) - # link vector test utilties + # link vector test utilities target_link_libraries(${example_target} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/kokkos/CMakeLists.txt b/examples/nvector/kokkos/CMakeLists.txt index 648d867ea0..6199d0628c 100644 --- a/examples/nvector/kokkos/CMakeLists.txt +++ b/examples/nvector/kokkos/CMakeLists.txt @@ -45,7 +45,7 @@ foreach(example_tuple ${examples_list}) # which backend to use target_compile_definitions(${example_target} PRIVATE USE_${backend}) - # link vector test utilties + # link vector test utilities target_link_libraries(${example_target} PRIVATE test_nvector_obj sundials_nveckokkos) endif() diff --git a/examples/nvector/kokkos/test_nvector_kokkos.cpp b/examples/nvector/kokkos/test_nvector_kokkos.cpp index 63d0a6d76d..e75d317314 100644 --- a/examples/nvector/kokkos/test_nvector_kokkos.cpp +++ b/examples/nvector/kokkos/test_nvector_kokkos.cpp @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------------------- - * This is the testing routine for the NVector implemenation using Kokkos. + * This is the testing routine for the NVector implementation using Kokkos. * ---------------------------------------------------------------------------*/ #include <nvector/nvector_kokkos.hpp> diff --git a/examples/nvector/manyvector/CMakeLists.txt b/examples/nvector/manyvector/CMakeLists.txt index abba295138..a0210aae8d 100644 --- a/examples/nvector/manyvector/CMakeLists.txt +++ b/examples/nvector/manyvector/CMakeLists.txt @@ -55,7 +55,7 @@ foreach(example_tuple ${nvector_manyvector_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/mpicuda/CMakeLists.txt b/examples/nvector/mpicuda/CMakeLists.txt index 35f33a5e1b..bf630375f7 100644 --- a/examples/nvector/mpicuda/CMakeLists.txt +++ b/examples/nvector/mpicuda/CMakeLists.txt @@ -51,7 +51,7 @@ foreach(example_tuple ${nvector_cuda_examples}) # example source files add_executable(${example} ${example}.cu) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) diff --git a/examples/nvector/mpimanyvector/CMakeLists.txt b/examples/nvector/mpimanyvector/CMakeLists.txt index b6f185aa1f..348793b8ee 100644 --- a/examples/nvector/mpimanyvector/CMakeLists.txt +++ b/examples/nvector/mpimanyvector/CMakeLists.txt @@ -83,7 +83,7 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) diff --git a/examples/nvector/mpiplusx/CMakeLists.txt b/examples/nvector/mpiplusx/CMakeLists.txt index 88e551386b..4f91dc4923 100644 --- a/examples/nvector/mpiplusx/CMakeLists.txt +++ b/examples/nvector/mpiplusx/CMakeLists.txt @@ -77,7 +77,7 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) diff --git a/examples/nvector/openmpdev/CMakeLists.txt b/examples/nvector/openmpdev/CMakeLists.txt index d1d301e125..0f47067cb7 100644 --- a/examples/nvector/openmpdev/CMakeLists.txt +++ b/examples/nvector/openmpdev/CMakeLists.txt @@ -49,7 +49,7 @@ foreach(example_tuple ${nvector_openmpdev_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/parhyp/CMakeLists.txt b/examples/nvector/parhyp/CMakeLists.txt index 90b2f7e11a..2ca8394551 100644 --- a/examples/nvector/parhyp/CMakeLists.txt +++ b/examples/nvector/parhyp/CMakeLists.txt @@ -64,7 +64,7 @@ foreach(example_tuple ${nvector_parhyp_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) diff --git a/examples/nvector/petsc/CMakeLists.txt b/examples/nvector/petsc/CMakeLists.txt index db3d53c851..9b18176bee 100644 --- a/examples/nvector/petsc/CMakeLists.txt +++ b/examples/nvector/petsc/CMakeLists.txt @@ -59,7 +59,7 @@ foreach(example_tuple ${nvector_petsc_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) diff --git a/examples/nvector/pthreads/CMakeLists.txt b/examples/nvector/pthreads/CMakeLists.txt index 4dc45ff76d..e44822ed61 100644 --- a/examples/nvector/pthreads/CMakeLists.txt +++ b/examples/nvector/pthreads/CMakeLists.txt @@ -57,7 +57,7 @@ foreach(example_tuple ${nvector_pthreads_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # folder to organize targets in an IDE diff --git a/examples/nvector/serial/CMakeLists.txt b/examples/nvector/serial/CMakeLists.txt index 5e74daf715..5d6d00685e 100644 --- a/examples/nvector/serial/CMakeLists.txt +++ b/examples/nvector/serial/CMakeLists.txt @@ -52,7 +52,7 @@ foreach(example_tuple ${nvector_serial_examples}) # example source files add_executable(${example} ${example}.c) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) # libraries to link against diff --git a/examples/nvector/sycl/test_nvector_sycl.cpp b/examples/nvector/sycl/test_nvector_sycl.cpp index abbe8c802c..9b659df49c 100644 --- a/examples/nvector/sycl/test_nvector_sycl.cpp +++ b/examples/nvector/sycl/test_nvector_sycl.cpp @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) ? "Yes" : "No") << std::endl; - std::cout << " suports usm shared allocations? " + std::cout << " supports usm shared allocations? " << (dev.get_info<sycl::info::device::usm_shared_allocations>() ? "Yes" : "No") diff --git a/examples/nvector/test_nvector.c b/examples/nvector/test_nvector.c index c38d7ef239..4cd581001a 100644 --- a/examples/nvector/test_nvector.c +++ b/examples/nvector/test_nvector.c @@ -365,7 +365,7 @@ int Test_N_VClone(N_Vector W, sunindextype local_length, int myid) /* ---------------------------------------------------------------------- * N_VGetArrayPointer Test * - * For now commenting this out to surpress warning messages (pointer set, + * For now commenting this out to suppress warning messages (pointer set, * but not used). Do we really need to time access to the vector * data pointer? * @@ -390,7 +390,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[0] = ONE; /* Do something with pointer to surpress warning */ + Wdata[0] = ONE; /* Do something with pointer to suppress warning */ /* check vector data */ if (!has_data(W)) diff --git a/examples/nvector/trilinos/CMakeLists.txt b/examples/nvector/trilinos/CMakeLists.txt index 909b1366b9..06874d0e41 100644 --- a/examples/nvector/trilinos/CMakeLists.txt +++ b/examples/nvector/trilinos/CMakeLists.txt @@ -71,7 +71,7 @@ foreach(example_tuple ${nvector_trilinos_examples}) # example source files add_executable(${example} ${example}.cpp) - # link vector test utilties + # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) if(Trilinos_MPI) target_link_libraries(${example} PRIVATE test_nvectormpi_obj) diff --git a/examples/nvector/trilinos/test_nvector_trilinos.cpp b/examples/nvector/trilinos/test_nvector_trilinos.cpp index 7b6e1503c4..32031c778d 100644 --- a/examples/nvector/trilinos/test_nvector_trilinos.cpp +++ b/examples/nvector/trilinos/test_nvector_trilinos.cpp @@ -92,7 +92,7 @@ int main(int argc, char* argv[]) RCP<const map_type> testMap = rcp( new map_type(global_length, index_base, comm, Tpetra::GloballyDistributed)); - /* Construct a Tpetra vector and return refernce counting pointer to it. */ + /* Construct a Tpetra vector and return reference counting pointer to it. */ RCP<vector_type> px = rcp(new vector_type(testMap)); int fails = 0; /* counter for test failures */ diff --git a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu index 0d30dd8c7c..28e953ae14 100644 --- a/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu +++ b/examples/sunlinsol/cusolversp/test_sunlinsol_cusolversp_batchqr.cu @@ -186,7 +186,7 @@ int main(int argc, char* argv[]) N_VCopyToDevice_Cuda(d_x); N_VCopyToDevice_Cuda(d_xref); - /* Synchronize before peforming dense operation on CPU */ + /* Synchronize before performing dense operation on CPU */ cudaDeviceSynchronize(); /* create right-hand side vector for linear solve */ diff --git a/examples/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp b/examples/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp index dd00ea0fea..6208f3b225 100644 --- a/examples/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp +++ b/examples/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp @@ -102,7 +102,7 @@ int main(int argc, char* argv[]) ? "Yes" : "No") << std::endl; - std::cout << " suports usm shared allocations? " + std::cout << " supports usm shared allocations? " << (dev.get_info<sycl::info::device::usm_shared_allocations>() ? "Yes" : "No") diff --git a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 index b5bad44d77..e08ebc6f85 100644 --- a/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 +++ b/examples/sunlinsol/pcg/serial/test_fsunlinsol_pcg_mod_serial.f90 @@ -27,7 +27,7 @@ module test_fsunlinsol_pcg_serial integer(kind=myindextype), private, parameter :: N = 100 integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(c_int), private, parameter :: maxl = 500 ! maxium Krylov subspace dimension (> 0) + integer(c_int), private, parameter :: maxl = 500 ! maximum Krylov subspace dimension (> 0) real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData diff --git a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 index 7d5d2dfae6..4aa48fc8c1 100644 --- a/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 +++ b/examples/sunlinsol/spbcgs/serial/test_fsunlinsol_spbcgs_mod_serial.f90 @@ -27,7 +27,7 @@ module test_fsunlinsol_spbcgs_serial integer(kind=myindextype), private, parameter :: N = 100 integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + integer(c_int), private, parameter :: maxl = 100 ! maximum Krylov subspace dimension (> 0) real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData diff --git a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 index 0a14009745..cf68cf6207 100644 --- a/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 +++ b/examples/sunlinsol/spfgmr/serial/test_fsunlinsol_spfgmr_mod_serial.f90 @@ -27,7 +27,7 @@ module test_fsunlinsol_spfgmr_serial integer(kind=myindextype), private, parameter :: N = 100 integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(c_int), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) - integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + integer(c_int), private, parameter :: maxl = 100 ! maximum Krylov subspace dimension (> 0) real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData diff --git a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 index 0f9dec6568..2fc0e7f889 100644 --- a/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 +++ b/examples/sunlinsol/spgmr/serial/test_fsunlinsol_spgmr_mod_serial.f90 @@ -27,7 +27,7 @@ module test_fsunlinsol_spgmr_serial integer(kind=myindextype), private, parameter :: N = 100 integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) integer(c_int), private, parameter :: gstype = 1 ! Gram-Schmidt orthoognalization type (1 or 2) - integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + integer(c_int), private, parameter :: maxl = 100 ! maximum Krylov subspace dimension (> 0) real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData diff --git a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 index 85c89199f2..929704b6a9 100644 --- a/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 +++ b/examples/sunlinsol/sptfqmr/serial/test_fsunlinsol_sptfqmr_mod_serial.f90 @@ -27,7 +27,7 @@ module test_fsunlinsol_sptfqmr_serial integer(kind=myindextype), private, parameter :: N = 100 integer(c_int), private, parameter :: pretype = 1 ! Preconditioning type (1 or 2) - integer(c_int), private, parameter :: maxl = 100 ! maxium Krylov subspace dimension (> 0) + integer(c_int), private, parameter :: maxl = 100 ! maximum Krylov subspace dimension (> 0) real(c_double), private, parameter :: tol = 1e-13 ! solver tolerance type, private :: UserData diff --git a/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp b/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp index 74f3637d54..6ef9bc9189 100644 --- a/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp +++ b/examples/sunlinsol/superludist/test_sunlinsol_superludist.cpp @@ -144,7 +144,7 @@ int main(int argc, char* argv[]) print_timing = atoi(argv[4]); SetTiming(print_timing); - /* intiailize SuperLU-DIST process grid */ + /* initialize SuperLU-DIST process grid */ superlu_gridinit(comm, nprow, npcol, &grid); /* excess processes just exit */ if (grid.iam >= nprow * npcol) @@ -299,7 +299,7 @@ int main(int argc, char* argv[]) { sunindextype shift; - /* recieve number of local nnz */ + /* receive number of local nnz */ MPI_Recv(&NNZ_local, 1, MPI_SUNINDEXTYPE, 0, grid.iam, grid.comm, &mpistatus); /* Allocate memory for matrix members */ @@ -345,7 +345,7 @@ int main(int argc, char* argv[]) ydata = N_VGetArrayPointer(y); bdata = N_VGetArrayPointer(b); - /* recieve vectors */ + /* receive vectors */ MPI_Recv(xdata, M_loc, MPI_SUNREALTYPE, 0, grid.iam, grid.comm, &mpistatus); MPI_Recv(ydata, M_loc, MPI_SUNREALTYPE, 0, grid.iam, grid.comm, &mpistatus); MPI_Recv(bdata, M_loc, MPI_SUNREALTYPE, 0, grid.iam, grid.comm, &mpistatus); diff --git a/examples/sunlinsol/test_sunlinsol.h b/examples/sunlinsol/test_sunlinsol.h index 80c3aad109..ef7feadc1d 100644 --- a/examples/sunlinsol/test_sunlinsol.h +++ b/examples/sunlinsol/test_sunlinsol.h @@ -20,7 +20,7 @@ #include <math.h> #include <sundials/sundials_core.h> -/* define constatnts */ +/* define constants */ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) diff --git a/examples/sunmatrix/dreadrb.c b/examples/sunmatrix/dreadrb.c index 9d24da993a..1b9bf05605 100644 --- a/examples/sunmatrix/dreadrb.c +++ b/examples/sunmatrix/dreadrb.c @@ -82,7 +82,7 @@ * Col. 30 - 42 Compressed Column: Number of columns (NCOL) * Elemental: Number of element matrices (NELT) * Col. 44 - 56 Compressed Column: Number of entries (NNZERO) - * Elemental: Number of variable indeces (NVARIX) + * Elemental: Number of variable indices (NVARIX) * Col. 58 - 70 Compressed Column: Unused, explicitly zero * Elemental: Number of elemental matrix entries (NELTVL) * diff --git a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index 3ab1919f01..12a9bd80b0 100644 --- a/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/examples/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -108,7 +108,7 @@ int main(int argc, char* argv[]) ? "Yes" : "No") << std::endl; - std::cout << " suports usm shared allocations? " + std::cout << " supports usm shared allocations? " << (dev.get_info<sycl::info::device::usm_shared_allocations>() ? "Yes" : "No") diff --git a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp index afffbd7329..c23018ec6e 100644 --- a/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp +++ b/examples/sunmatrix/slunrloc/test_sunmatrix_slunrloc.cpp @@ -272,7 +272,7 @@ int main(int argc, char* argv[]) { sunindextype shift; - /* recieve number of local nnz */ + /* receive number of local nnz */ MPI_Recv(&NNZ_local, 1, MPI_SUNINDEXTYPE, 0, grid.iam, grid.comm, &mpistatus); /* Allocate memory for matrix members */ @@ -316,7 +316,7 @@ int main(int argc, char* argv[]) xdata = N_VGetArrayPointer(x); ydata = N_VGetArrayPointer(y); - /* recieve vectors */ + /* receive vectors */ MPI_Recv(xdata, M_local, MPI_SUNREALTYPE, 0, grid.iam, grid.comm, &mpistatus); MPI_Recv(ydata, M_local, MPI_SUNREALTYPE, 0, grid.iam, grid.comm, &mpistatus); } @@ -382,7 +382,7 @@ int main(int argc, char* argv[]) free(Asuper); Asuper = NULL; - /* Destroy matricies and vectors */ + /* Destroy matrices and vectors */ if (grid.iam == 0) { SUNMatDestroy(D); @@ -490,7 +490,7 @@ int check_matrix(SUNMatrix A, SUNMatrix B, sunrealtype tol) /* compare global start index */ if (Astore->fst_row != Bstore->fst_row) { - TEST_STATUS(">>> ERRROR: check_matrix: Different globalidx \n", grid->iam); + TEST_STATUS(">>> ERROR: check_matrix: Different globalidx \n", grid->iam); return (1); } diff --git a/examples/sunmatrix/test_sunmatrix.c b/examples/sunmatrix/test_sunmatrix.c index f6041c1983..9849e308b2 100644 --- a/examples/sunmatrix/test_sunmatrix.c +++ b/examples/sunmatrix/test_sunmatrix.c @@ -241,7 +241,7 @@ int Test_SUNMatScaleAdd(SUNMatrix A, SUNMatrix I, int myid) sunrealtype tol = 10 * SUN_UNIT_ROUNDOFF; /* - * Case 1: same sparsity/bandwith pattern + * Case 1: same sparsity/bandwidth pattern */ /* protect A */ diff --git a/examples/sunmatrix/test_sunmatrix.f90 b/examples/sunmatrix/test_sunmatrix.f90 index 30c1f5f2ca..75869c244b 100644 --- a/examples/sunmatrix/test_sunmatrix.f90 +++ b/examples/sunmatrix/test_sunmatrix.f90 @@ -256,7 +256,7 @@ integer(c_int) function Test_FSUNMatScaleAdd(A, I, myid) result(failure) failure = 0 ! - ! Case 1: same sparsity/bandwith pattern + ! Case 1: same sparsity/bandwidth pattern ! ! protect A diff --git a/examples/sunmatrix/test_sunmatrix.h b/examples/sunmatrix/test_sunmatrix.h index 5b031c590e..476b15d50d 100644 --- a/examples/sunmatrix/test_sunmatrix.h +++ b/examples/sunmatrix/test_sunmatrix.h @@ -21,7 +21,7 @@ #include <math.h> #include <sundials/sundials_core.h> -/* define constatnts */ +/* define constants */ #define NEG_TWO SUN_RCONST(-2.0) #define NEG_ONE SUN_RCONST(-1.0) #define NEG_HALF SUN_RCONST(-0.5) diff --git a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c index 440739e147..a9e9c5435e 100644 --- a/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c +++ b/examples/sunnonlinsol/fixedpoint/test_sunnonlinsol_fixedpoint.c @@ -174,7 +174,7 @@ int main(int argc, char* argv[]) data[1] = PTONE; data[2] = -PTONE; - /* set inital correction */ + /* set initial correction */ N_VConst(ZERO, Imem->ycor); /* set weights */ diff --git a/examples/templates/cmakelists_serial_F2003_ex.in b/examples/templates/cmakelists_serial_F2003_ex.in index fdc2568027..ae8b255a07 100644 --- a/examples/templates/cmakelists_serial_F2003_ex.in +++ b/examples/templates/cmakelists_serial_F2003_ex.in @@ -77,7 +77,7 @@ find_library(SUNDIALS_SOLVER_FLIB if("${NVEC_LIB}" STREQUAL "") # No additional NVECTOR library necessary else() - # Find the additonal NVECTOR library + # Find the additional NVECTOR library find_library(SUNDIALS_NVEC_LIB @NVEC_LIB@ ${SUNDIALS_LIBRARY_DIR} DOC "NVECTOR library") @@ -185,7 +185,7 @@ if(KLU_LIBRARIES AND examples_klu) # directories to include target_include_directories(${example} PRIVATE ${SUNDIALS_INCLUDE_DIR}) - # libraries to link agaisnt + # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBRARIES}) target_link_libraries(${example} ${KLU_LIBRARIES}) diff --git a/include/arkode/arkode_bandpre.h b/include/arkode/arkode_bandpre.h index 526c65773e..88c4c7c036 100644 --- a/include/arkode/arkode_bandpre.h +++ b/include/arkode/arkode_bandpre.h @@ -24,7 +24,7 @@ extern "C" { #endif -/* BandPrec inititialization function */ +/* BandPrec initialization function */ SUNDIALS_EXPORT int ARKBandPrecInit(void* arkode_mem, sunindextype N, sunindextype mu, sunindextype ml); diff --git a/include/cvode/cvode_bandpre.h b/include/cvode/cvode_bandpre.h index bde2d10ac7..93dc658fd4 100644 --- a/include/cvode/cvode_bandpre.h +++ b/include/cvode/cvode_bandpre.h @@ -25,7 +25,7 @@ extern "C" { #endif -/* BandPrec inititialization function */ +/* BandPrec initialization function */ SUNDIALS_EXPORT int CVBandPrecInit(void* cvode_mem, sunindextype N, sunindextype mu, sunindextype ml); diff --git a/include/cvodes/cvodes_bandpre.h b/include/cvodes/cvodes_bandpre.h index fe5869884c..426e3f6230 100644 --- a/include/cvodes/cvodes_bandpre.h +++ b/include/cvodes/cvodes_bandpre.h @@ -29,7 +29,7 @@ extern "C" { FORWARD PROBLEMS -----------------*/ -/* BandPrec inititialization function */ +/* BandPrec initialization function */ SUNDIALS_EXPORT int CVBandPrecInit(void* cvode_mem, sunindextype N, sunindextype mu, sunindextype ml); diff --git a/include/sundials/priv/sundials_errors_impl.h b/include/sundials/priv/sundials_errors_impl.h index 115b5eefd9..e05bbd4382 100644 --- a/include/sundials/priv/sundials_errors_impl.h +++ b/include/sundials/priv/sundials_errors_impl.h @@ -328,7 +328,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckCallMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then return the error code**. :param call: the function call @@ -352,7 +352,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckCallNoRetMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, and call the error handler. **It does not return**. :param call: the function call @@ -375,7 +375,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckCallNullMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then returns NULL**. :param call: the function call @@ -399,7 +399,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckCallNullMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then returns void**. :param call: the function call @@ -429,7 +429,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, #define SUNCheckCallVoid(call) SUNCheckCallVoidMsg(call, NULL) /* SUNCheckLastErrMsg checks the last_err value in the SUNContext. - If an error occured, then it will log the error, set the last_err + If an error occurred, then it will log the error, set the last_err value, and call the error handler, **and then returns the code**. */ #if defined(SUNDIALS_ENABLE_ERROR_CHECKS) #define SUNCheckLastErrMsg(msg) \ @@ -440,7 +440,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckLastErrNoRetMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler. **It does not return.** :param msg: an error message @@ -453,7 +453,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckLastErrNullMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then returns NULL**. :param msg: an error message @@ -466,7 +466,7 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, /* SUNCheckLastErrVoidMsg performs the SUNDIALS function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then returns void**. :param msg: an error message diff --git a/include/sundials/priv/sundials_mpi_errors_impl.h b/include/sundials/priv/sundials_mpi_errors_impl.h index 003cccfda5..58ffb26053 100644 --- a/include/sundials/priv/sundials_mpi_errors_impl.h +++ b/include/sundials/priv/sundials_mpi_errors_impl.h @@ -30,7 +30,7 @@ extern "C" { /* SUNCheckMPICallMsg performs the MPI function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then return SUN_ERR_MPI_FAIL**. :param call: the MPI function call @@ -54,7 +54,7 @@ extern "C" { /* SUNCheckMPICallNullMsg performs the MPI function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then return NULL**. :param call: the MPI function call @@ -78,7 +78,7 @@ extern "C" { /* SUNCheckMPICallVoidMsg performs the MPI function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, call the error handler, **and then return void**. :param call: the MPI function call @@ -102,7 +102,7 @@ extern "C" { /* SUNCheckMPICallNoRetMsg performs the MPI function call, and checks the - returned error code. If an error occured, then it will log the error, set the + returned error code. If an error occurred, then it will log the error, set the last_err value, and call the error handler. **It does not return**. :param call: the MPI function call diff --git a/include/sundials/sundials_base.hpp b/include/sundials/sundials_base.hpp index 9a43da93f1..cc6cc1be0e 100644 --- a/include/sundials/sundials_base.hpp +++ b/include/sundials/sundials_base.hpp @@ -90,7 +90,7 @@ class BaseObject return *this; } - // We have a pure virtual destructor to make this an asbtract class + // We have a pure virtual destructor to make this an abstract class virtual ~BaseObject() = 0; // Getters diff --git a/include/sundials/sundials_convertibleto.hpp b/include/sundials/sundials_convertibleto.hpp index 7443ed4cfa..4afe7bf7d9 100644 --- a/include/sundials/sundials_convertibleto.hpp +++ b/include/sundials/sundials_convertibleto.hpp @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------------------- - * Base class for converting C++ wappers (views) to SUNDIALS objects + * Base class for converting C++ wrappers (views) to SUNDIALS objects * ---------------------------------------------------------------------------*/ #ifndef _SUNDIALS_CONVERTIBLETO_HPP diff --git a/include/sundials/sundials_cuda_policies.hpp b/include/sundials/sundials_cuda_policies.hpp index 32660136b5..cd973c11b6 100644 --- a/include/sundials/sundials_cuda_policies.hpp +++ b/include/sundials/sundials_cuda_policies.hpp @@ -135,7 +135,7 @@ class GridStrideExecPolicy : public ExecPolicy }; /* - * A kernel execution policy for performing a reduction across indvidual thread + * A kernel execution policy for performing a reduction across individual thread * blocks. The number of threads per block (blockSize) can be set to any valid * multiple of the CUDA warp size. The number of blocks (gridSize) can be set to * any value greater or equal to 0. If it is set to 0, then the grid size will diff --git a/include/sundials/sundials_errors.h b/include/sundials/sundials_errors.h index b132b0f3b0..3aefc0ea57 100644 --- a/include/sundials/sundials_errors.h +++ b/include/sundials/sundials_errors.h @@ -64,7 +64,7 @@ ENTRY(SUN_ERR_UNREACHABLE, \ "Reached code that should be unreachable: open an issue at: " \ "https://github.com/LLNL/sundials") \ - ENTRY(SUN_ERR_UNKNOWN, "Unknown error occured: open an issue at " \ + ENTRY(SUN_ERR_UNKNOWN, "Unknown error occurred: open an issue at " \ "https://github.com/LLNL/sundials") /* Expand SUN_ERR_CODE_LIST to enum */ diff --git a/include/sundials/sundials_hip_policies.hpp b/include/sundials/sundials_hip_policies.hpp index f7950f8c35..30f05a62fc 100644 --- a/include/sundials/sundials_hip_policies.hpp +++ b/include/sundials/sundials_hip_policies.hpp @@ -141,7 +141,7 @@ class GridStrideExecPolicy : public ExecPolicy }; /* - * A kernel execution policy for performing a reduction across indvidual thread + * A kernel execution policy for performing a reduction across individual thread * blocks. The number of threads per block (blockSize) can be set to any valid * multiple of the HIP warp size. The number of blocks (gridSize) can be set to * any value greater or equal to 0. If it is set to 0, then the grid size will diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index b2ac7c64a8..53b01f6790 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -28,14 +28,14 @@ extern "C" { typedef enum { SUNMEMTYPE_HOST, /* pageable memory accessible on the host */ - SUNMEMTYPE_PINNED, /* page-locked memory accesible on the host */ + SUNMEMTYPE_PINNED, /* page-locked memory accessible on the host */ SUNMEMTYPE_DEVICE, /* memory accessible from the device */ SUNMEMTYPE_UVM /* memory accessible from the host or device */ } SUNMemoryType; /* * SUNMemory is a simple abstraction of a pointer to some - * contiguos memory, so that we can keep track of its type + * contiguous memory, so that we can keep track of its type * and its ownership. */ diff --git a/include/sundials/sundials_nvector.h b/include/sundials/sundials_nvector.h index 68ea9340e7..1af6aef88b 100644 --- a/include/sundials/sundials_nvector.h +++ b/include/sundials/sundials_nvector.h @@ -140,7 +140,7 @@ struct _generic_N_Vector_Ops /* * OPTIONAL operations. * - * These operations provide default implementations that may be overriden. + * These operations provide default implementations that may be overridden. */ /* OPTIONAL fused vector operations */ diff --git a/include/sundials/sundials_sycl_policies.hpp b/include/sundials/sundials_sycl_policies.hpp index 523425211b..db0a887bfa 100644 --- a/include/sundials/sundials_sycl_policies.hpp +++ b/include/sundials/sundials_sycl_policies.hpp @@ -107,7 +107,7 @@ class GridStrideExecPolicy : public ExecPolicy }; /* - * A kernel execution policy for performing a reduction across indvidual thread + * A kernel execution policy for performing a reduction across individual thread * blocks. The number of threads per block (blockSize) can be set to anything. * The number of blocks (gridSize) can be set to any value greater than or equal * to 0. If it is set to 0, then the grid size will be chosen so that there are diff --git a/include/sundials/sundials_xbraid.h b/include/sundials/sundials_xbraid.h index 4bb17ca1d3..ece50fd8b4 100644 --- a/include/sundials/sundials_xbraid.h +++ b/include/sundials/sundials_xbraid.h @@ -35,7 +35,7 @@ struct _braid_Vector_struct N_Vector y; }; -/* Poiner to vector wrapper (same as braid_Vector) */ +/* Pointer to vector wrapper (same as braid_Vector) */ typedef struct _braid_Vector_struct* SUNBraidVector; /* ----------------------------- diff --git a/include/sunlinsol/sunlinsol_ginkgo.hpp b/include/sunlinsol/sunlinsol_ginkgo.hpp index 2817d426a9..42780627c2 100644 --- a/include/sunlinsol/sunlinsol_ginkgo.hpp +++ b/include/sunlinsol/sunlinsol_ginkgo.hpp @@ -289,7 +289,7 @@ class LinearSolver : public ConvertibleTo<SUNLinearSolver> return gko_solver_.get(); } - /// Solve the linear system Ax = b to the specificed tolerance. + /// Solve the linear system Ax = b to the specified tolerance. /// \param b the right-hand side vector /// \param x the solution vector /// \param tol the tolerance to solve the system to diff --git a/include/sunmatrix/sunmatrix_ginkgo.hpp b/include/sunmatrix/sunmatrix_ginkgo.hpp index 1b73520468..bc9ce0ab7d 100644 --- a/include/sunmatrix/sunmatrix_ginkgo.hpp +++ b/include/sunmatrix/sunmatrix_ginkgo.hpp @@ -28,7 +28,7 @@ namespace sundials { namespace ginkgo { -// Forward decalaration of regular Matrix class +// Forward declaration of regular Matrix class template<typename GkoMatType> class Matrix; diff --git a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h index 779538abfa..cb368d44b7 100644 --- a/include/sunnonlinsol/sunnonlinsol_fixedpoint.h +++ b/include/sunnonlinsol/sunnonlinsol_fixedpoint.h @@ -44,7 +44,7 @@ struct _SUNNonlinearSolverContent_FixedPoint int m; /* number of acceleration vectors to use */ int* imap; /* array of length m */ sunbooleantype damping; /* flag to apply dampling in acceleration */ - sunrealtype beta; /* damping paramter */ + sunrealtype beta; /* damping parameter */ sunrealtype* R; /* array of length m*m */ sunrealtype* gamma; /* array of length m */ sunrealtype* cvals; /* array of length m+1 for fused vector op */ diff --git a/scripts/spelling.sh b/scripts/spelling.sh new file mode 100755 index 0000000000..bfa599787c --- /dev/null +++ b/scripts/spelling.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# --------------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 script will use codespell to check for common misspellings +# --------------------------------------------------------------------------------- + +codespell \ + --skip="*.git,*.bib,*.eps,*.pdf,*/fmod_int*,*/_themes,*/test/answers" \ + -L "inout,ans,Numer,KnWo,Wit,MaPe,ASAi,crate,htmp,thist,thi,MIS,dout,usin,alph,wQS,delt,ue,Bu,ue,nd,ist,strat" \ + --write-changes diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index f21c51d46e..1473b8f204 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -135,7 +135,7 @@ int ARKodeResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, } } - /* Determing change in vector sizes */ + /* Determining change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -2767,7 +2767,7 @@ int arkEwtSetSmallReal(SUNDIALS_MAYBE_UNUSED N_Vector ycur, N_Vector weight, /*--------------------------------------------------------------- arkRwtSetSS - This routine sets rwt as decribed above in the case tol_type = ARK_SS. + This routine sets rwt as described above in the case tol_type = ARK_SS. When the absolute tolerance is zero, it tests for non-positive components before inverting. arkRwtSetSS returns 0 if rwt is successfully set to a positive vector and -1 otherwise. In the @@ -2789,7 +2789,7 @@ int arkRwtSetSS(ARKodeMem ark_mem, N_Vector My, N_Vector weight) /*--------------------------------------------------------------- arkRwtSetSV - This routine sets rwt as decribed above in the case tol_type = ARK_SV. + This routine sets rwt as described above in the case tol_type = ARK_SV. When any absolute tolerance is zero, it tests for non-positive components before inverting. arkRwtSetSV returns 0 if rwt is successfully set to a positive vector and -1 otherwise. In the @@ -3183,7 +3183,7 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, SUNTRUE is returned if the allocation is successful (or if the target vector or vector array already exists) otherwise SUNFALSE - is retured. + is returned. ---------------------------------------------------------------*/ sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v) { @@ -3264,7 +3264,7 @@ void arkFreeVecArray(int count, N_Vector** v, sunindextype lrw1, long int* lrw, integer work spaces. SUNTRUE is returned if the resize is successful otherwise - SUNFALSE is retured. + SUNFALSE is returned. ---------------------------------------------------------------*/ sunbooleantype arkResizeVec(ARKodeMem ark_mem, ARKVecResizeFn resize, void* resize_data, sunindextype lrw_diff, diff --git a/src/arkode/arkode_bandpre.c b/src/arkode/arkode_bandpre.c index 5355311d98..dc334788b6 100644 --- a/src/arkode/arkode_bandpre.c +++ b/src/arkode/arkode_bandpre.c @@ -315,7 +315,7 @@ int ARKBandPrecGetNumRhsEvals(void* arkode_mem, long int* nfevalsBP) gamma is the scalar appearing in the Newton matrix. - bp_data is a pointer to preconditoner data (set by ARKBandPrecInit) + bp_data is a pointer to preconditioner data (set by ARKBandPrecInit) The value to be returned by the ARKBandPrecSetup function is 0 if successful, or @@ -403,7 +403,7 @@ static int ARKBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, r is the right-hand side vector of the linear system. - bp_data is a pointer to preconditoner data (set by ARKBandPrecInit) + bp_data is a pointer to preconditioner data (set by ARKBandPrecInit) z is the output vector computed by ARKBandPrecSolve. diff --git a/src/arkode/arkode_butcher.c b/src/arkode/arkode_butcher.c index f0d4326d39..6b9a71cdeb 100644 --- a/src/arkode/arkode_butcher.c +++ b/src/arkode/arkode_butcher.c @@ -376,7 +376,7 @@ void ARKodeButcherTable_Write(ARKodeButcherTable B, FILE* outfile) { int i, j; - /* check for vaild table */ + /* check for valid table */ if (B == NULL) { return; } if (B->A == NULL) { return; } for (i = 0; i < B->stages; i++) diff --git a/src/arkode/arkode_butcher_erk.def b/src/arkode/arkode_butcher_erk.def index a29292e27d..4da35f9d07 100644 --- a/src/arkode/arkode_butcher_erk.def +++ b/src/arkode/arkode_butcher_erk.def @@ -29,7 +29,7 @@ Methods in an ARK pair are marked with a *. Methods that satisfy the additional third order multirate - infinitesimal step condition and are suppored by the MRIStep + infinitesimal step condition and are supported by the MRIStep module (c_i > c_{i-1} and c_s != 1) are marked with a ^. The 'QP' column denotes whether the coefficients of the method diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 2b4ad70e3a..fff9d2e693 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -415,7 +415,7 @@ struct ARKodeMemRec sunbooleantype step_supports_relaxation; ARKTimestepSetRelaxFn step_setrelaxfn; - /* Time stepper module -- implcit solvers */ + /* Time stepper module -- implicit solvers */ sunbooleantype step_supports_implicit; ARKTimestepAttachLinsolFn step_attachlinsol; ARKTimestepDisableLSetup step_disablelsetup; @@ -1148,7 +1148,7 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); ARKTimestepGetEstLocalErrors This routine requests the stepper to copy its internal - estimate of the local trunction error to the output (called by + estimate of the local truncation error to the output (called by ARKodeGetEstLocalErrors). =============================================================== diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index b8a12c6a33..357912409d 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -2991,7 +2991,7 @@ int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass) /*--------------------------------------------------------------- arkGetLastKFlag: - The last kflag value retured by the temporal error test. + The last kflag value returned by the temporal error test. ---------------------------------------------------------------*/ int arkGetLastKFlag(void* arkode_mem, int* last_kflag) { diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 646b87ab6f..1ed0939246 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -730,7 +730,7 @@ int ARKodeSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ arkls_mem->nrmfac = SUNRsqrt(N_VGetLength(ark_mem->tempv1)); } @@ -1682,7 +1682,7 @@ int ARKodeSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ arkls_mem->nrmfac = SUNRsqrt(N_VGetLength(ark_mem->tempv1)); } @@ -2634,7 +2634,7 @@ int arkLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, /* access matrix dimension */ N = SUNDenseMatrix_Columns(Jac); - /* Rename work vector for readibility */ + /* Rename work vector for readability */ ftemp = tmp1; /* Create an empty vector for matrix column calculations */ diff --git a/src/arkode/arkode_ls_impl.h b/src/arkode/arkode_ls_impl.h index 8a296d83d5..fa7026af11 100644 --- a/src/arkode/arkode_ls_impl.h +++ b/src/arkode/arkode_ls_impl.h @@ -234,7 +234,7 @@ int arkLsMassMult(void* arkode_mem, N_Vector v, N_Vector Mv); int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef); int arkLsMassFree(ARKodeMem ark_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int arkLsInitializeCounters(ARKLsMem arkls_mem); int arkLsInitializeMassCounters(ARKLsMassMem arkls_mem); int arkLs_AccessARKODELMem(void* arkode_mem, const char* fname, diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index fa6dd9b256..7d68143884 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -525,7 +525,7 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) { int i, j, k; - /* check for vaild coupling structure */ + /* check for valid coupling structure */ if (!MRIC) { return; } if (!(MRIC->W) && !(MRIC->G)) { return; } if (!(MRIC->c)) { return; } diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 3e856a724a..0989e43a7c 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1891,7 +1891,7 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) if (step_mem->MRIC->W || !(step_mem->MRIC->G)) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Invalid coupling table fro an implicit problem!"); + "Invalid coupling table for an implicit problem!"); return (ARK_ILL_INPUT); } } diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 0ae21c2741..a88a78235d 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -670,7 +670,7 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, N_VLinearSum(ONE, delta_Yi, ark_mem->h * ai, step_mem->sdata, delta_Yi); /* if user-supplied stage postprocessing function, we error out since it - * wont work with the increment form */ + * won't work with the increment form */ if (ark_mem->ProcessStage != NULL) { arkProcessError(ark_mem, ARK_POSTPROCESS_STAGE_FAIL, __LINE__, __func__, diff --git a/src/arkode/xbraid/arkode_xbraid.c b/src/arkode/xbraid/arkode_xbraid.c index 208c2c2888..870d0ae3b8 100644 --- a/src/arkode/xbraid/arkode_xbraid.c +++ b/src/arkode/xbraid/arkode_xbraid.c @@ -27,7 +27,7 @@ * Construct, initialize, and free * ------------------------------- */ -/* Create XBraid app strucutre */ +/* Create XBraid app structure */ int ARKBraid_Create(void* arkode_mem, braid_App* app) { int flag; @@ -67,7 +67,7 @@ int ARKBraid_Create(void* arkode_mem, braid_App* app) content->last_flag_braid = SUNBRAID_SUCCESS; content->last_flag_arkode = SUNBRAID_SUCCESS; - /* Output time and solution (allocaed in access if necessary) */ + /* Output time and solution (allocated in access if necessary) */ content->tout = content->ark_mem->tn; content->yout = NULL; diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 0558991e85..3dc22b9a40 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -1108,7 +1108,7 @@ int CVode(void* cvode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, { cv_mem->cv_tretlast = *tret = cv_mem->cv_tn; - /* Check inputs for corectness */ + /* Check inputs for correctness */ ier = cvInitialSetup(cv_mem); if (ier != CV_SUCCESS) @@ -4723,7 +4723,7 @@ int cvEwtSet(N_Vector ycur, N_Vector weight, void* data) /* * cvEwtSetSS * - * This routine sets ewt as decribed above in the case tol_type = CV_SS. + * This routine sets ewt as described above in the case tol_type = CV_SS. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. cvEwtSetSS returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -4763,7 +4763,7 @@ static int cvEwtSetSS(CVodeMem cv_mem, N_Vector ycur, N_Vector weight) /* * cvEwtSetSV * - * This routine sets ewt as decribed above in the case tol_type = CV_SV. + * This routine sets ewt as described above in the case tol_type = CV_SV. * If any absolute tolerance is zero, it tests for non-positive components * before inverting. cvEwtSetSV returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered diff --git a/src/cvode/cvode_bandpre.c b/src/cvode/cvode_bandpre.c index b19c32e1e5..88196439d5 100644 --- a/src/cvode/cvode_bandpre.c +++ b/src/cvode/cvode_bandpre.c @@ -345,7 +345,7 @@ int CVBandPrecGetNumRhsEvals(void* cvode_mem, long int* nfevalsBP) gamma is the scalar appearing in the Newton matrix. - bp_data is a pointer to preconditoner data (set by CVBandPrecInit) + bp_data is a pointer to preconditioner data (set by CVBandPrecInit) The value to be returned by the CVBandPrecSetup function is 0 if successful, or @@ -428,7 +428,7 @@ static int CVBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, r is the right-hand side vector of the linear system. - bp_data is a pointer to preconditoner data (set by CVBandPrecInit) + bp_data is a pointer to preconditioner data (set by CVBandPrecInit) z is the output vector computed by CVBandPrecSolve. diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index e2f3a36350..5cfd0a6b78 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -296,7 +296,7 @@ typedef struct CVodeMemRec sunrealtype cv_delp; /* norm of previous nonlinear solver update */ sunrealtype cv_acnrm; /* | acor | */ sunbooleantype cv_acnrmcur; /* is | acor | current? */ - sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ + sunrealtype cv_nlscoef; /* coefficient in nonlinear convergence test */ /*------ Limits diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index 1f23b850c0..7897a844dc 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -811,7 +811,7 @@ int CVodeSetMaxNonlinIters(void* cvode_mem, int maxcor) /* * CVodeSetNonlinConvCoef * - * Specifies the coeficient in the nonlinear solver convergence + * Specifies the coefficient in the nonlinear solver convergence * test */ @@ -1134,7 +1134,7 @@ int CVodeGetNumErrTestFails(void* cvode_mem, long int* netfails) /* * CVodeGetLastOrder * - * Returns the order on the last succesful step + * Returns the order on the last successful step */ int CVodeGetLastOrder(void* cvode_mem, int* qlast) diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index 50c60c6e8b..c5b7755151 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -389,7 +389,7 @@ int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ cvls_mem->nrmfac = SUNRsqrt(N_VGetLength(cvls_mem->ytemp)); } @@ -1063,7 +1063,7 @@ int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, /* access matrix dimension */ N = SUNDenseMatrix_Columns(Jac); - /* Rename work vector for readibility */ + /* Rename work vector for readability */ ftemp = tmp1; /* Create an empty vector for matrix column calculations */ diff --git a/src/cvode/cvode_ls_impl.h b/src/cvode/cvode_ls_impl.h index 4f3c209c18..b2f679462e 100644 --- a/src/cvode/cvode_ls_impl.h +++ b/src/cvode/cvode_ls_impl.h @@ -102,7 +102,7 @@ typedef struct CVLsMemRec int (*pfree)(CVodeMem cv_mem); void* P_data; - /* Jacobian times vector compuation + /* Jacobian times vector computation * (a) jtimes function provided by the user: * - jt_data == user_data * - jtimesDQ == SUNFALSE @@ -160,7 +160,7 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur); int cvLsFree(CVodeMem cv_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int cvLsInitializeCounters(CVLsMem cvls_mem); int cvLs_AccessLMem(void* cvode_mem, const char* fname, CVodeMem* cv_mem, CVLsMem* cvls_mem); diff --git a/src/cvode/cvode_proj.c b/src/cvode/cvode_proj.c index 63c823dc9a..02de98df7f 100644 --- a/src/cvode/cvode_proj.c +++ b/src/cvode/cvode_proj.c @@ -212,12 +212,12 @@ int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) /* Set the step size reduction factor for a projection failure */ if ((eta <= ZERO) || (eta > ONE)) { - /* Restore detault */ + /* Restore default */ proj_mem->eta_pfail = PROJ_FAIL_ETA; } else { - /* Udpate the eta value */ + /* Update the eta value */ proj_mem->eta_pfail = PROJ_FAIL_ETA; } @@ -269,7 +269,7 @@ int CVodeGetNumProjFails(void* cvode_mem, long int* npfails) * * For user supplied projection function, use ftemp as temporary storage * for the current error estimate (acor) and use tempv to store the - * accumulated corection due to projection, acorP (tempv is not touched + * accumulated correction due to projection, acorP (tempv is not touched * until it is potentially used in cvCompleteStep). */ diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index 2df97cf712..0365c56a59 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -174,7 +174,7 @@ int CVodeAdjInit(void* cvode_mem, long int steps, int interp) ca_mem->ca_nsteps = steps; - /* Last index used in CVAfindIndex, initailize to invalid value */ + /* Last index used in CVAfindIndex, initialize to invalid value */ ca_mem->ca_ilast = -1; /* Allocate space for the array of Data Point structures */ @@ -606,7 +606,7 @@ int CVodeF(void* cvode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, ca_mem->ca_IMstore(cv_mem, dt_mem[cv_mem->cv_nst % ca_mem->ca_nsteps]); } - /* Set t1 field of the current ckeck point structure + /* Set t1 field of the current check point structure for the case in which there will be no future check points */ ca_mem->ck_mem->ck_t1 = cv_mem->cv_tn; @@ -1611,7 +1611,7 @@ int CVodeB(void* cvode_mem, sunrealtype tBout, int itaskB) if (itaskB == CV_ONE_STEP) { break; } - /* If all backward problems have succesfully reached tBout, return now */ + /* If all backward problems have successfully reached tBout, return now */ reachedTBout = SUNTRUE; @@ -2535,7 +2535,7 @@ static int CVAckpntGet(CVodeMem cv_mem, CVckpntMem ck_mem) /* * CVAfindIndex * - * Finds the index in the array of data point strctures such that + * Finds the index in the array of data point structures such that * dt_mem[indx-1].t <= t < dt_mem[indx].t * If indx is changed from the previous invocation, then newpoint = SUNTRUE * @@ -3191,7 +3191,7 @@ static sunbooleantype CVApolynomialMalloc(CVodeMem cv_mem) /* * CVApolynomialFree * - * This routine frees the memeory allocated for data storage. + * This routine frees the memory allocated for data storage. */ static void CVApolynomialFree(CVodeMem cv_mem) diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 55399d7349..5350674269 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -1193,7 +1193,7 @@ int CVodeQuadInit(void* cvode_mem, CVQuadRhsFn fQ, N_Vector yQ0) cv_mem->cv_quadr = SUNTRUE; cv_mem->cv_QuadMallocDone = SUNTRUE; - /* Quadrature initialization was successfull */ + /* Quadrature initialization was successful */ return (CV_SUCCESS); } @@ -1224,7 +1224,7 @@ int CVodeQuadReInit(void* cvode_mem, N_Vector yQ0) } cv_mem = (CVodeMem)cvode_mem; - /* Ckeck if quadrature was initialized? */ + /* Check if quadrature was initialized? */ if (cv_mem->cv_QuadMallocDone == SUNFALSE) { cvProcessError(cv_mem, CV_NO_QUAD, __LINE__, __func__, __FILE__, @@ -1242,7 +1242,7 @@ int CVodeQuadReInit(void* cvode_mem, N_Vector yQ0) /* Quadrature integration turned ON */ cv_mem->cv_quadr = SUNTRUE; - /* Quadrature re-initialization was successfull */ + /* Quadrature re-initialization was successful */ return (CV_SUCCESS); } @@ -1275,7 +1275,7 @@ int CVodeQuadSStolerances(void* cvode_mem, sunrealtype reltolQ, } cv_mem = (CVodeMem)cvode_mem; - /* Ckeck if quadrature was initialized? */ + /* Check if quadrature was initialized? */ if (cv_mem->cv_QuadMallocDone == SUNFALSE) { @@ -1323,7 +1323,7 @@ int CVodeQuadSVtolerances(void* cvode_mem, sunrealtype reltolQ, N_Vector abstolQ } cv_mem = (CVodeMem)cvode_mem; - /* Ckeck if quadrature was initialized? */ + /* Check if quadrature was initialized? */ if (cv_mem->cv_QuadMallocDone == SUNFALSE) { @@ -1588,7 +1588,7 @@ int CVodeSensInit(void* cvode_mem, int Ns, int ism, CVSensRhsFn fS, N_Vector* yS if (ism == CV_SIMULTANEOUS) { cv_mem->ownNLSsim = SUNTRUE; } else { cv_mem->ownNLSstg = SUNTRUE; } - /* Sensitivity initialization was successfull */ + /* Sensitivity initialization was successful */ return (CV_SUCCESS); } @@ -1844,7 +1844,7 @@ int CVodeSensInit1(void* cvode_mem, int Ns, int ism, CVSensRhs1Fn fS1, else if (ism == CV_STAGGERED) { cv_mem->ownNLSstg = SUNTRUE; } else { cv_mem->ownNLSstg1 = SUNTRUE; } - /* Sensitivity initialization was successfull */ + /* Sensitivity initialization was successful */ return (CV_SUCCESS); } @@ -2039,7 +2039,7 @@ int CVodeSensReInit(void* cvode_mem, int ism, N_Vector* yS0) } } - /* Sensitivity re-initialization was successfull */ + /* Sensitivity re-initialization was successful */ return (CV_SUCCESS); } @@ -2329,7 +2329,7 @@ int CVodeQuadSensInit(void* cvode_mem, CVQuadSensRhsFn fQS, N_Vector* yQS0) cv_mem->cv_quadr_sensi = SUNTRUE; cv_mem->cv_QuadSensMallocDone = SUNTRUE; - /* Sensitivity initialization was successfull */ + /* Sensitivity initialization was successful */ return (CV_SUCCESS); } @@ -2439,7 +2439,7 @@ int CVodeQuadSensSStolerances(void* cvode_mem, sunrealtype reltolQS, return (CV_NO_SENS); } - /* Ckeck if quadrature sensitivity was initialized? */ + /* Check if quadrature sensitivity was initialized? */ if (cv_mem->cv_QuadSensMallocDone == SUNFALSE) { @@ -2523,7 +2523,7 @@ int CVodeQuadSensSVtolerances(void* cvode_mem, sunrealtype reltolQS, return (CV_NO_SENS); } - /* Ckeck if quadrature sensitivity was initialized? */ + /* Check if quadrature sensitivity was initialized? */ if (cv_mem->cv_QuadSensMallocDone == SUNFALSE) { @@ -2617,7 +2617,7 @@ int CVodeQuadSensEEtolerances(void* cvode_mem) return (CV_NO_SENS); } - /* Ckeck if quadrature sensitivity was initialized? */ + /* Check if quadrature sensitivity was initialized? */ if (cv_mem->cv_QuadSensMallocDone == SUNFALSE) { @@ -2967,7 +2967,7 @@ int CVode(void* cvode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, { cv_mem->cv_tretlast = *tret = cv_mem->cv_tn; - /* Check inputs for corectness */ + /* Check inputs for correctness */ ier = cvInitialSetup(cv_mem); if (ier != CV_SUCCESS) @@ -9108,7 +9108,7 @@ int cvEwtSet(N_Vector ycur, N_Vector weight, void* data) /* * cvEwtSetSS * - * This routine sets ewt as decribed above in the case tol_type = CV_SS. + * This routine sets ewt as described above in the case tol_type = CV_SS. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. cvEwtSetSS returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -9131,7 +9131,7 @@ static int cvEwtSetSS(CVodeMem cv_mem, N_Vector ycur, N_Vector weight) /* * cvEwtSetSV * - * This routine sets ewt as decribed above in the case tol_type = CV_SV. + * This routine sets ewt as described above in the case tol_type = CV_SV. * If any absolute tolerance is zero, it tests for non-positive components * before inverting. cvEwtSetSV returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -9583,7 +9583,7 @@ int cvSensRhs1Wrapper(CVodeMem cv_mem, sunrealtype time, N_Vector ycur, * ----------------------------------------------------------------- */ -/* Undefine Readibility Constants */ +/* Undefine Readability Constants */ #undef y diff --git a/src/cvodes/cvodes_bandpre.c b/src/cvodes/cvodes_bandpre.c index 55dbe1afbb..fde28ebd1b 100644 --- a/src/cvodes/cvodes_bandpre.c +++ b/src/cvodes/cvodes_bandpre.c @@ -348,7 +348,7 @@ int CVBandPrecGetNumRhsEvals(void* cvode_mem, long int* nfevalsBP) gamma is the scalar appearing in the Newton matrix. - bp_data is a pointer to preconditoner data (set by cvBandPrecInit) + bp_data is a pointer to preconditioner data (set by cvBandPrecInit) The value to be returned by the cvBandPrecSetup function is 0 if successful, or @@ -431,7 +431,7 @@ static int cvBandPrecSetup(sunrealtype t, N_Vector y, N_Vector fy, r is the right-hand side vector of the linear system. - bp_data is a pointer to preconditoner data (set by CVBandPrecInit) + bp_data is a pointer to preconditioner data (set by CVBandPrecInit) z is the output vector computed by cvBandPrecSolve. diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index c22d166359..e6dce188d4 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -305,7 +305,7 @@ typedef struct CVodeMemRec Quadrature Sensitivity Related Data -----------------------------------*/ - sunbooleantype cv_quadr_sensi; /* SUNTRUE if computing sensitivties of quadrs. */ + sunbooleantype cv_quadr_sensi; /* SUNTRUE if computing sensitivities of quadrs. */ CVQuadSensRhsFn cv_fQS; /* fQS = (dfQ/dy)*yS + (dfQ/dp) */ void* cv_fQS_data; /* data pointer passed to fQS */ @@ -430,7 +430,7 @@ typedef struct CVodeMemRec sunrealtype cv_acnrmS; /* | acorS | */ sunbooleantype cv_acnrmScur; /* is | acorS | current? */ sunrealtype cv_acnrmQS; /* | acorQS | */ - sunrealtype cv_nlscoef; /* coeficient in nonlinear convergence test */ + sunrealtype cv_nlscoef; /* coefficient in nonlinear convergence test */ int* cv_ncfS1; /* Array of Ns local counters for conv. * failures (used in CVStep for STAGGERED1) */ @@ -881,7 +881,7 @@ struct CVodeBMemRec * Type : struct CVadjMemRec * ----------------------------------------------------------------- * The type CVadjMem is type pointer to struct CVadjMemRec. - * This structure contins fields to store all information + * This structure contains fields to store all information * necessary for adjoint sensitivity analysis. * ----------------------------------------------------------------- */ @@ -1446,7 +1446,8 @@ int cvSensRhs1InternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, #define MSGCV_BAD_TBOUT \ "The final time tBout is outside the interval over which the forward " \ "problem was solved." -#define MSGCV_BACK_ERROR "Error occured while integrating backward problem # %d" +#define MSGCV_BACK_ERROR \ + "Error occurred while integrating backward problem # %d" #define MSGCV_BAD_TINTERP "Bad t = %g for interpolation." #define MSGCV_WRONG_INTERP \ "This function cannot be called for the specified interp type." diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index e4599bd853..ff3eff489e 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -833,7 +833,7 @@ int CVodeSetMaxNonlinIters(void* cvode_mem, int maxcor) /* * CVodeSetNonlinConvCoef * - * Specifies the coeficient in the nonlinear solver convergence + * Specifies the coefficient in the nonlinear solver convergence * test */ @@ -1234,7 +1234,7 @@ int CVodeSetQuadSensErrCon(void* cvode_mem, sunbooleantype errconQS) return (CV_NO_SENS); } - /* Ckeck if quadrature sensitivity was initialized? */ + /* Check if quadrature sensitivity was initialized? */ if (cv_mem->cv_QuadSensMallocDone == SUNFALSE) { @@ -1349,7 +1349,7 @@ int CVodeGetNumErrTestFails(void* cvode_mem, long int* netfails) /* * CVodeGetLastOrder * - * Returns the order on the last succesful step + * Returns the order on the last successful step */ int CVodeGetLastOrder(void* cvode_mem, int* qlast) diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index 539a69a1d4..0e3d550499 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -465,7 +465,7 @@ int CVodeSetLSNormFactor(void* cvode_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ cvls_mem->nrmfac = SUNRsqrt(N_VGetLength(cvls_mem->ytemp)); } @@ -1141,7 +1141,7 @@ int cvLsDenseDQJac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, /* access matrix dimension */ N = SUNDenseMatrix_Columns(Jac); - /* Rename work vector for readibility */ + /* Rename work vector for readability */ ftemp = tmp1; /* Create an empty vector for matrix column calculations */ diff --git a/src/cvodes/cvodes_ls_impl.h b/src/cvodes/cvodes_ls_impl.h index 4fd13c850e..bef549e15e 100644 --- a/src/cvodes/cvodes_ls_impl.h +++ b/src/cvodes/cvodes_ls_impl.h @@ -106,7 +106,7 @@ typedef struct CVLsMemRec int (*pfree)(CVodeMem cv_mem); void* P_data; - /* Jacobian times vector compuation + /* Jacobian times vector computation * (a) jtimes function provided by the user: * - jt_data == user_data * - jtimesDQ == SUNFALSE @@ -164,7 +164,7 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur); int cvLsFree(CVodeMem cv_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int cvLsInitializeCounters(CVLsMem cvls_mem); int cvLs_AccessLMem(void* cvode_mem, const char* fname, CVodeMem* cv_mem, CVLsMem* cvls_mem); diff --git a/src/cvodes/cvodes_proj.c b/src/cvodes/cvodes_proj.c index e50682fdd1..109bc8699c 100644 --- a/src/cvodes/cvodes_proj.c +++ b/src/cvodes/cvodes_proj.c @@ -212,12 +212,12 @@ int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) /* Set the step size reduction factor for a projection failure */ if ((eta <= ZERO) || (eta > ONE)) { - /* Restore detault */ + /* Restore default */ proj_mem->eta_pfail = PROJ_FAIL_ETA; } else { - /* Udpate the eta value */ + /* Update the eta value */ proj_mem->eta_pfail = PROJ_FAIL_ETA; } @@ -269,7 +269,7 @@ int CVodeGetNumProjFails(void* cvode_mem, long int* npfails) * * For user supplied projection function, use ftemp as temporary storage * for the current error estimate (acor) and use tempv to store the - * accumulated corection due to projection, acorP (tempv is not touched + * accumulated correction due to projection, acorP (tempv is not touched * until it is potentially used in cvCompleteStep). */ diff --git a/src/ida/ida.c b/src/ida/ida.c index ea06a7a0b3..a349b63bb0 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -552,7 +552,7 @@ int IDAInit(void* ida_mem, IDAResFn res, sunrealtype t0, N_Vector yy0, * IDAReInit * * IDAReInit re-initializes IDA's memory for a problem, assuming - * it has already beeen allocated in a prior IDAInit call. + * it has already been allocated in a prior IDAInit call. * All problem specification inputs are checked for errors. * The problem size Neq is assumed to be unchanged since the call * to IDAInit, and the maximum order maxord must not be larger. @@ -1561,7 +1561,7 @@ int IDAGetDky(void* ida_mem, sunrealtype t, int k, N_Vector dky) for (i = 0; i <= k; i++) { - /* The below reccurence is used to compute the k-th derivative of the solution: + /* The below recurrence is used to compute the k-th derivative of the solution: c_j^(k) = ( k * c_{j-1}^(k-1) + c_{j-1}^{k} (Delta+psi_{j-1}) ) / psi_j Translated in indexes notation: @@ -2106,7 +2106,7 @@ int IDAEwtSet(N_Vector ycur, N_Vector weight, void* data) /* * IDAEwtSetSS * - * This routine sets ewt as decribed above in the case itol=IDA_SS. + * This routine sets ewt as described above in the case itol=IDA_SS. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. IDAEwtSetSS returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -2129,7 +2129,7 @@ static int IDAEwtSetSS(IDAMem IDA_mem, N_Vector ycur, N_Vector weight) /* * IDAEwtSetSV * - * This routine sets ewt as decribed above in the case itol=IDA_SV. + * This routine sets ewt as described above in the case itol=IDA_SV. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. IDAEwtSetSV returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -3193,7 +3193,7 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k stepsize and order are set by the usual local error algorithm. Note that, after the first step, the order is not increased, as not all - of the neccessary information is available yet. */ + of the necessary information is available yet. */ if (IDA_mem->ida_phase == 0) { diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index f61a79381e..f116cd4b2b 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -202,14 +202,14 @@ typedef struct IDAMemRec sunrealtype ida_ss; /* scalar used in Newton iteration convergence test */ sunrealtype ida_oldnrm; /* norm of previous nonlinear solver update */ sunrealtype ida_epsNewt; /* test constant in Newton convergence test */ - sunrealtype ida_epcon; /* coeficient of the Newton covergence test */ + sunrealtype ida_epcon; /* coefficient of the Newton convergence test */ sunrealtype ida_toldel; /* tolerance in direct test on Newton corrections */ /*------ Limits ------*/ - int ida_maxncf; /* max numer of convergence failures */ + int ida_maxncf; /* max number of convergence failures */ int ida_maxnef; /* max number of error test failures */ int ida_maxord; /* max value of method order k: */ diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index a8e2707208..c317a1e1c6 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -372,7 +372,7 @@ int IDASetLSNormFactor(void* ida_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ idals_mem->nrmfac = SUNRsqrt(N_VGetLength(idals_mem->ytemp)); } @@ -970,7 +970,7 @@ int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, /* access matrix dimension */ N = SUNDenseMatrix_Columns(Jac); - /* Rename work vectors for readibility */ + /* Rename work vectors for readability */ rtemp = tmp1; /* Create an empty vector for matrix column calculations */ @@ -1223,7 +1223,7 @@ int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, } else { sig = idals_mem->dqincfac / N_VWrmsNorm(v, IDA_mem->ida_ewt); } - /* Rename work1 and work2 for readibility */ + /* Rename work1 and work2 for readability */ y_tmp = work1; yp_tmp = work2; diff --git a/src/ida/ida_ls_impl.h b/src/ida/ida_ls_impl.h index 6248e52e9d..1875c95496 100644 --- a/src/ida/ida_ls_impl.h +++ b/src/ida/ida_ls_impl.h @@ -93,7 +93,7 @@ typedef struct IDALsMemRec int (*pfree)(IDAMem IDA_mem); void* pdata; - /* Jacobian times vector compuation + /* Jacobian times vector computation (a) jtimes function provided by the user: - jt_data == user_data - jtimesDQ == SUNFALSE @@ -141,7 +141,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, int idaLsPerf(IDAMem IDA_mem, int perftask); int idaLsFree(IDAMem IDA_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int idaLsInitializeCounters(IDALsMem idals_mem); int idaLs_AccessLMem(void* ida_mem, const char* fname, IDAMem* IDA_mem, IDALsMem* idals_mem); diff --git a/src/idas/idaa.c b/src/idas/idaa.c index 803d1efa87..486afee06c 100644 --- a/src/idas/idaa.c +++ b/src/idas/idaa.c @@ -153,7 +153,7 @@ int IDAAdjInit(void* ida_mem, long int steps, int interp) IDAADJ_mem->ia_interpType = interp; IDAADJ_mem->ia_nsteps = steps; - /* Last index used in IDAAfindIndex, initailize to invalid value */ + /* Last index used in IDAAfindIndex, initialize to invalid value */ IDAADJ_mem->ia_ilast = -1; /* Allocate space for the array of Data Point structures. */ @@ -594,7 +594,7 @@ int IDASolveF(void* ida_mem, sunrealtype tout, sunrealtype* tret, N_Vector yret, dt_mem[IDA_mem->ida_nst % IDAADJ_mem->ia_nsteps]); } - /* Set t1 field of the current ckeck point structure + /* Set t1 field of the current check point structure for the case in which there will be no future check points */ IDAADJ_mem->ck_mem->ck_t1 = IDA_mem->ida_tn; @@ -1415,7 +1415,7 @@ int IDACalcICB(void* ida_mem, int which, sunrealtype tout1, N_Vector yy0, ida_memB = (void*)IDAB_mem->IDA_mem; /* The wrapper for user supplied res function requires ia_bckpbCrt from - IDAAdjMem to be set to curent problem. */ + IDAAdjMem to be set to current problem. */ IDAADJ_mem->ia_bckpbCrt = IDAB_mem; /* Save (y, y') in yyTmp and ypTmp for use in the res wrapper.*/ @@ -1515,7 +1515,7 @@ int IDACalcICBS(void* ida_mem, int which, sunrealtype tout1, N_Vector yy0, } /* The wrapper for user supplied res function requires ia_bckpbCrt from - IDAAdjMem to be set to curent problem. */ + IDAAdjMem to be set to current problem. */ IDAADJ_mem->ia_bckpbCrt = IDAB_mem; /* Save (y, y') and (y_p, y'_p) in yyTmp, ypTmp and yySTmp, ypSTmp.The wrapper @@ -1815,7 +1815,7 @@ int IDASolveB(void* ida_mem, sunrealtype tBout, int itaskB) /* If in IDA_ONE_STEP mode, return now (flag = IDA_SUCCESS) */ if (itaskB == IDA_ONE_STEP) { break; } - /* If all backward problems have succesfully reached tBout, return now */ + /* If all backward problems have successfully reached tBout, return now */ reachedTBout = SUNTRUE; tmp_IDAB_mem = IDAB_mem; @@ -3452,7 +3452,7 @@ static int IDAApolynomialGetY(IDAMem IDA_mem, sunrealtype t, N_Vector yy, The formula used for p'(t) is: - p'(t) = f[t0,t1] + psi_1'(t)*f[t0,t1,t2] + ... + psi_n'(t)*f[t0,t1,...,tn] - We reccursively compute psi_k'(t) from: + We recursively compute psi_k'(t) from: - psi_k'(t) = (t-tk)*psi_{k-1}'(t) + psi_{k-1} psi_k is rescaled with 1/delt each time is computed, because the Newton DDs from Y were @@ -3586,7 +3586,7 @@ static int IDAAGettnSolutionYpS(IDAMem IDA_mem, N_Vector* ypS) /* * IDAAfindIndex * - * Finds the index in the array of data point strctures such that + * Finds the index in the array of data point structures such that * dt_mem[indx-1].t <= t < dt_mem[indx].t * If indx is changed from the previous invocation, then newpoint = SUNTRUE * diff --git a/src/idas/idas.c b/src/idas/idas.c index 3174660c12..3702dc6963 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -767,7 +767,7 @@ int IDAInit(void* ida_mem, IDAResFn res, sunrealtype t0, N_Vector yy0, * IDAReInit * * IDAReInit re-initializes IDA's memory for a problem, assuming - * it has already beeen allocated in a prior IDAInit call. + * it has already been allocated in a prior IDAInit call. * All problem specification inputs are checked for errors. * The problem size Neq is assumed to be unchanged since the call * to IDAInit, and the maximum order maxord must not be larger. @@ -1080,7 +1080,7 @@ int IDAQuadInit(void* ida_mem, IDAQuadRhsFn rhsQ, N_Vector yQ0) IDA_mem->ida_quadr = SUNTRUE; IDA_mem->ida_quadMallocDone = SUNTRUE; - /* Quadrature initialization was successfull */ + /* Quadrature initialization was successful */ SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); return (IDA_SUCCESS); } @@ -1115,7 +1115,7 @@ int IDAQuadReInit(void* ida_mem, N_Vector yQ0) SUNDIALS_MARK_FUNCTION_BEGIN(IDA_PROFILER); - /* Ckeck if quadrature was initialized */ + /* Check if quadrature was initialized */ if (IDA_mem->ida_quadMallocDone == SUNFALSE) { IDAProcessError(IDA_mem, IDA_NO_QUAD, __LINE__, __func__, __FILE__, @@ -1141,7 +1141,7 @@ int IDAQuadReInit(void* ida_mem, N_Vector yQ0) /* Quadrature integration turned ON */ IDA_mem->ida_quadr = SUNTRUE; - /* Quadrature re-initialization was successfull */ + /* Quadrature re-initialization was successful */ SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); return (IDA_SUCCESS); } @@ -1173,7 +1173,7 @@ int IDAQuadSStolerances(void* ida_mem, sunrealtype reltolQ, sunrealtype abstolQ) } IDA_mem = (IDAMem)ida_mem; - /* Ckeck if quadrature was initialized */ + /* Check if quadrature was initialized */ if (IDA_mem->ida_quadMallocDone == SUNFALSE) { IDAProcessError(IDA_mem, IDA_NO_QUAD, __LINE__, __func__, __FILE__, @@ -1219,7 +1219,7 @@ int IDAQuadSVtolerances(void* ida_mem, sunrealtype reltolQ, N_Vector abstolQ) } IDA_mem = (IDAMem)ida_mem; - /* Ckeck if quadrature was initialized */ + /* Check if quadrature was initialized */ if (IDA_mem->ida_quadMallocDone == SUNFALSE) { IDAProcessError(IDA_mem, IDA_NO_QUAD, __LINE__, __func__, __FILE__, @@ -1472,7 +1472,7 @@ int IDASensInit(void* ida_mem, int Ns, int ism, IDASensResFn fS, N_Vector* yS0, if (ism == IDA_SIMULTANEOUS) { IDA_mem->ownNLSsim = SUNTRUE; } else { IDA_mem->ownNLSstg = SUNTRUE; } - /* Sensitivity initialization was successfull */ + /* Sensitivity initialization was successful */ SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); return (IDA_SUCCESS); } @@ -1647,7 +1647,7 @@ int IDASensReInit(void* ida_mem, int ism, N_Vector* yS0, N_Vector* ypS0) } } - /* Sensitivity re-initialization was successfull */ + /* Sensitivity re-initialization was successful */ SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); return (IDA_SUCCESS); } @@ -1873,7 +1873,7 @@ int IDAQuadSensInit(void* ida_mem, IDAQuadSensRhsFn rhsQS, N_Vector* yQS0) return (IDA_NO_SENS); } - /* Verifiy yQS0 parameter. */ + /* Verify yQS0 parameter. */ if (yQS0 == NULL) { IDAProcessError(NULL, IDA_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -1924,7 +1924,7 @@ int IDAQuadSensInit(void* ida_mem, IDAQuadSensRhsFn rhsQS, N_Vector* yQS0) IDA_mem->ida_nrQeS = 0; IDA_mem->ida_netfQS = 0; - /* Everything allright, set the flags and return with success. */ + /* Everything all right, set the flags and return with success. */ IDA_mem->ida_quadr_sensi = SUNTRUE; IDA_mem->ida_quadSensMallocDone = SUNTRUE; @@ -1964,7 +1964,7 @@ int IDAQuadSensReInit(void* ida_mem, N_Vector* yQS0) return (IDA_NO_QUADSENS); } - /* Verifiy yQS0 parameter. */ + /* Verify yQS0 parameter. */ if (yQS0 == NULL) { IDAProcessError(NULL, IDA_ILL_INPUT, __LINE__, __func__, __FILE__, @@ -1991,7 +1991,7 @@ int IDAQuadSensReInit(void* ida_mem, N_Vector* yQS0) IDA_mem->ida_nrQeS = 0; IDA_mem->ida_netfQS = 0; - /* Everything allright, set the flags and return with success. */ + /* Everything all right, set the flags and return with success. */ IDA_mem->ida_quadr_sensi = SUNTRUE; SUNDIALS_MARK_FUNCTION_END(IDA_PROFILER); @@ -3144,7 +3144,7 @@ int IDAGetDky(void* ida_mem, sunrealtype t, int k, N_Vector dky) for (i = 0; i <= k; i++) { - /* The below reccurence is used to compute the k-th derivative of the solution: + /* The below recurrence is used to compute the k-th derivative of the solution: c_j^(k) = ( k * c_{j-1}^(k-1) + c_{j-1}^{k} (Delta+psi_{j-1}) ) / psi_j Translated in indexes notation: @@ -3258,7 +3258,7 @@ int IDAGetQuadDky(void* ida_mem, sunrealtype t, int k, N_Vector dkyQ) SUNDIALS_MARK_FUNCTION_BEGIN(IDA_PROFILER); - /* Ckeck if quadrature was initialized */ + /* Check if quadrature was initialized */ if (IDA_mem->ida_quadr != SUNTRUE) { IDAProcessError(IDA_mem, IDA_NO_QUAD, __LINE__, __func__, __FILE__, @@ -3584,7 +3584,7 @@ int IDAGetSensDky1(void* ida_mem, sunrealtype t, int k, int is, N_Vector dkyS) psij_1 = IDA_mem->ida_psi[i - 1]; } - /* Update cjk based on the reccurence */ + /* Update cjk based on the recurrence */ for (j = i + 1; j <= IDA_mem->ida_kused - k + i; j++) { cjk[j] = (i * cjk_1[j - 1] + cjk[j - 1] * (delt + psij_1)) / @@ -3898,7 +3898,7 @@ int IDAGetQuadSensDky1(void* ida_mem, sunrealtype t, int k, int is, N_Vector dky psij_1 = IDA_mem->ida_psi[i - 1]; } - /* Update cjk based on the reccurence */ + /* Update cjk based on the recurrence */ for (j = i + 1; j <= IDA_mem->ida_kused - k + i; j++) { cjk[j] = (i * cjk_1[j - 1] + cjk[j - 1] * (delt + psij_1)) / @@ -5211,7 +5211,7 @@ int IDAEwtSet(N_Vector ycur, N_Vector weight, void* data) /* * IDAEwtSetSS * - * This routine sets ewt as decribed above in the case itol=IDA_SS. + * This routine sets ewt as described above in the case itol=IDA_SS. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. IDAEwtSetSS returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -5234,7 +5234,7 @@ static int IDAEwtSetSS(IDAMem IDA_mem, N_Vector ycur, N_Vector weight) /* * IDAEwtSetSV * - * This routine sets ewt as decribed above in the case itol=IDA_SV. + * This routine sets ewt as described above in the case itol=IDA_SV. * If the absolute tolerance is zero, it tests for non-positive components * before inverting. IDAEwtSetSV returns 0 if ewt is successfully set to a * positive vector and -1 otherwise. In the latter case, ewt is considered @@ -7385,7 +7385,7 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k stepsize and order are set by the usual local error algorithm. Note that, after the first step, the order is not increased, as not all - of the neccessary information is available yet. */ + of the necessary information is available yet. */ if (IDA_mem->ida_phase == 0) { diff --git a/src/idas/idas_bbdpre.c b/src/idas/idas_bbdpre.c index 25521a90d1..338c92ba0c 100644 --- a/src/idas/idas_bbdpre.c +++ b/src/idas/idas_bbdpre.c @@ -741,7 +741,7 @@ int IDABBDPrecInitB(void* ida_mem, int which, sunindextype NlocalB, void* ida_memB; int flag; - /* Check if ida_mem is allright. */ + /* Check if ida_mem is all right. */ if (ida_mem == NULL) { IDAProcessError(NULL, IDALS_MEM_NULL, __LINE__, __func__, __FILE__, @@ -815,7 +815,7 @@ int IDABBDPrecReInitB(void* ida_mem, int which, sunindextype mudqB, void* ida_memB; int flag; - /* Check if ida_mem is allright. */ + /* Check if ida_mem is all right. */ if (ida_mem == NULL) { IDAProcessError(NULL, IDALS_MEM_NULL, __LINE__, __func__, __FILE__, diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index e54b593bc5..4efa8f7180 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -324,7 +324,7 @@ typedef struct IDAMemRec sunrealtype ida_ss; /* scalar used in Newton iteration convergence test */ sunrealtype ida_oldnrm; /* norm of previous nonlinear solver update */ sunrealtype ida_epsNewt; /* test constant in Newton convergence test */ - sunrealtype ida_epcon; /* coeficient of the Newton covergence test */ + sunrealtype ida_epcon; /* coefficient of the Newton convergence test */ sunrealtype ida_toldel; /* tolerance in direct test on Newton corrections */ sunrealtype ida_ssS; /* scalar ss for staggered sensitivities */ @@ -333,7 +333,7 @@ typedef struct IDAMemRec Limits ------*/ - int ida_maxncf; /* max numer of convergence failures */ + int ida_maxncf; /* max number of convergence failures */ int ida_maxnef; /* max number of error test failures */ int ida_maxord; /* max value of method order k: */ @@ -746,7 +746,7 @@ struct IDABMemRec * Type : struct IDAadjMemRec * ----------------------------------------------------------------- * The type IDAadjMem is type pointer to struct IDAadjMemRec. - * This structure contins fields to store all information + * This structure contains fields to store all information * necessary for adjoint sensitivity analysis. * ----------------------------------------------------------------- */ @@ -833,7 +833,7 @@ struct IDAadjMemRec sunbooleantype ia_storeSensi; /* store sensitivities? */ sunbooleantype ia_interpSensi; /* interpolate sensitivities? */ - sunbooleantype ia_noInterp; /* interpolations are temporarly */ + sunbooleantype ia_noInterp; /* interpolations are temporarily */ /* disabled ( IDACalcICB ) */ /* Workspace for polynomial interpolation */ @@ -1243,7 +1243,8 @@ int IDASensResDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, #define MSGAM_BAD_TBOUT \ "The final time tBout is outside the interval over which the forward " \ "problem was solved." -#define MSGAM_BACK_ERROR "Error occured while integrating backward problem # %d" +#define MSGAM_BACK_ERROR \ + "Error occurred while integrating backward problem # %d" #define MSGAM_BAD_TINTERP "Bad t = %g for interpolation." #define MSGAM_BAD_T "Bad t for interpolation." #define MSGAM_WRONG_INTERP \ diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index 088bcbb015..9df01ba85c 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -413,7 +413,7 @@ int IDASetLSNormFactor(void* ida_mem, sunrealtype nrmfac) } else { - /* compute default factor for WRMS norm from vector legnth */ + /* compute default factor for WRMS norm from vector length */ idals_mem->nrmfac = SUNRsqrt(N_VGetLength(idals_mem->ytemp)); } @@ -1011,7 +1011,7 @@ int idaLsDenseDQJac(sunrealtype tt, sunrealtype c_j, N_Vector yy, N_Vector yp, /* access matrix dimension */ N = SUNDenseMatrix_Columns(Jac); - /* Rename work vectors for readibility */ + /* Rename work vectors for readability */ rtemp = tmp1; /* Create an empty vector for matrix column calculations */ @@ -1264,7 +1264,7 @@ int idaLsDQJtimes(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, } else { sig = idals_mem->dqincfac / N_VWrmsNorm(v, IDA_mem->ida_ewt); } - /* Rename work1 and work2 for readibility */ + /* Rename work1 and work2 for readability */ y_tmp = work1; yp_tmp = work2; diff --git a/src/idas/idas_ls_impl.h b/src/idas/idas_ls_impl.h index f219cb1d31..dfb6f50f71 100644 --- a/src/idas/idas_ls_impl.h +++ b/src/idas/idas_ls_impl.h @@ -93,7 +93,7 @@ typedef struct IDALsMemRec int (*pfree)(IDAMem IDA_mem); void* pdata; - /* Jacobian times vector compuation + /* Jacobian times vector computation (a) jtimes function provided by the user: - jt_data == user_data - jtimesDQ == SUNFALSE @@ -141,7 +141,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, int idaLsPerf(IDAMem IDA_mem, int perftask); int idaLsFree(IDAMem IDA_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int idaLsInitializeCounters(IDALsMem idals_mem); int idaLs_AccessLMem(void* ida_mem, const char* fname, IDAMem* IDA_mem, IDALsMem* idals_mem); diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index acfe65fd9b..d35c9b3393 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -480,7 +480,7 @@ int KINSol(void* kinmem, N_Vector u, int strategy_in, N_Vector u_scale, int ret, sflag; sunbooleantype maxStepTaken; - /* intialize to avoid compiler warning messages */ + /* initialize to avoid compiler warning messages */ maxStepTaken = SUNFALSE; f1normp = fnormp = -ONE; @@ -1837,7 +1837,7 @@ static int KINFullNewton(KINMem kin_mem, sunrealtype* fnormp, * If the system function fails unrecoverably at any time, KINLineSearch * returns KIN_SYSFUNC_FAIL which will halt the solver. * - * We attempt to corect recoverable system function failures only before + * We attempt to correct recoverable system function failures only before * the alpha-condition loop; i.e. when the solution is updated with the * full Newton step (possibly reduced due to constraint violations). * Once we find a feasible pp, we assume that any update up to pp is @@ -2621,7 +2621,7 @@ void KINProcessError(KINMem kin_mem, int error_code, int line, const char* func, * KINPicardAA * * This routine is the main driver for the Picard iteration with - * acclerated fixed point. + * accelerated fixed point. */ static int KINPicardAA(KINMem kin_mem) @@ -3061,7 +3061,7 @@ static int AndersonAcc(KINMem kin_mem, N_Vector gval, N_Vector fv, N_Vector x, s = b / temp; R[(i + 1) * kin_mem->kin_m_aa + i] = temp; R[(i + 1) * kin_mem->kin_m_aa + i + 1] = ZERO; - /* OK to re-use temp */ + /* OK to reuse temp */ if (i < kin_mem->kin_m_aa - 1) { for (j = i + 2; j < kin_mem->kin_m_aa; j++) diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 37c706e01d..750c713c3b 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -516,7 +516,7 @@ int KINGetNumLinIters(void* kinmem, long int* nliters) } /*------------------------------------------------------------------ - KINGetNumLinConvFails returns the total numbe of convergence + KINGetNumLinConvFails returns the total number of convergence failures ------------------------------------------------------------------*/ int KINGetNumLinConvFails(void* kinmem, long int* nlcfails) @@ -792,7 +792,7 @@ int kinLsDenseDQJac(N_Vector u, N_Vector fu, SUNMatrix Jac, KINMem kin_mem, /* Save pointer to the array in tmp2 */ tmp2_data = N_VGetArrayPointer(tmp2); - /* Rename work vectors for readibility */ + /* Rename work vectors for readability */ ftemp = tmp1; jthCol = tmp2; @@ -1076,7 +1076,7 @@ int kinLsInitialize(KINMem kin_mem) return (KINLS_ILL_INPUT); } - /** error-checking is complete, begin initializtions **/ + /** error-checking is complete, begin initializations **/ /* Initialize counters */ kinLsInitializeCounters(kinls_mem); diff --git a/src/kinsol/kinsol_ls_impl.h b/src/kinsol/kinsol_ls_impl.h index 6a47b9ba9a..98a47c15c6 100644 --- a/src/kinsol/kinsol_ls_impl.h +++ b/src/kinsol/kinsol_ls_impl.h @@ -86,7 +86,7 @@ typedef struct KINLsMemRec int (*pfree)(KINMem kin_mem); void* pdata; - /* Jacobian times vector compuation + /* Jacobian times vector computation (a) jtimes function provided by the user: - jt_data == user_data - jtimesDQ == SUNFALSE @@ -130,7 +130,7 @@ int kinLsSolve(KINMem kin_mem, N_Vector x, N_Vector b, sunrealtype* sJpnorm, sunrealtype* sFdotJp); int kinLsFree(KINMem kin_mem); -/* Auxilliary functions */ +/* Auxiliary functions */ int kinLsInitializeCounters(KINLsMem kinls_mem); int kinLs_AccessLMem(void* kinmem, const char* fname, KINMem* kin_mem, KINLsMem* kinls_mem); diff --git a/src/nvector/openmpdev/nvector_openmpdev.c b/src/nvector/openmpdev/nvector_openmpdev.c index 773feae94e..7fc83de9c8 100644 --- a/src/nvector/openmpdev/nvector_openmpdev.c +++ b/src/nvector/openmpdev/nvector_openmpdev.c @@ -942,7 +942,7 @@ sunrealtype N_VWSqrSumMaskLocal_OpenMPDEV(N_Vector x, N_Vector w, N_Vector id) } /* ---------------------------------------------------------------------------- - * Finds the minimun component of a vector + * Finds the minimum component of a vector */ sunrealtype N_VMin_OpenMPDEV(N_Vector x) @@ -2584,7 +2584,7 @@ static int VScaleDiffVectorArray_OpenMPDEV(int nvec, sunrealtype c, N_Vector* X, /* get default device identifier */ dev = omp_get_default_device(); - /* Allocate and store dev ointer to copy to device */ + /* Allocate and store dev pointer to copy to device */ xd_dev_ptrs = (sunrealtype**)malloc(nvec * sizeof(sunrealtype*)); yd_dev_ptrs = (sunrealtype**)malloc(nvec * sizeof(sunrealtype*)); zd_dev_ptrs = (sunrealtype**)malloc(nvec * sizeof(sunrealtype*)); diff --git a/src/nvector/pthreads/nvector_pthreads.c b/src/nvector/pthreads/nvector_pthreads.c index 5e5314afb3..d7000c8289 100644 --- a/src/nvector/pthreads/nvector_pthreads.c +++ b/src/nvector/pthreads/nvector_pthreads.c @@ -1671,7 +1671,7 @@ static void* nvWSqrSumMaskPt(void* thread_data) } /* ---------------------------------------------------------------------------- - * Finds the minimun component of a vector + * Finds the minimum component of a vector */ sunrealtype N_VMin_Pthreads(N_Vector x) diff --git a/src/sundials/sundials_logger_impl.h b/src/sundials/sundials_logger_impl.h index 6fbb7cac49..b6f93eeeae 100644 --- a/src/sundials/sundials_logger_impl.h +++ b/src/sundials/sundials_logger_impl.h @@ -38,7 +38,7 @@ struct SUNLogger_ SUNComm comm; int output_rank; - /* Ouput files */ + /* Output files */ FILE* debug_fp; FILE* warning_fp; FILE* info_fp; diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index 9b15332993..37a15741d9 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -102,7 +102,7 @@ N_Vector N_VNewEmpty(SUNContext sunctx) /* * OPTIONAL operations. * - * These operations provide default implementations that may be overriden. + * These operations provide default implementations that may be overridden. */ /* fused vector operations (optional) */ @@ -226,7 +226,7 @@ SUNErrCode N_VCopyOps(N_Vector w, N_Vector v) /* * OPTIONAL operations. * - * These operations provide default implementations that may be overriden. + * These operations provide default implementations that may be overridden. */ /* fused vector operations */ diff --git a/src/sundials/sundials_sycl.h b/src/sundials/sundials_sycl.h index 57cf4a4d9a..148c09c7b0 100644 --- a/src/sundials/sundials_sycl.h +++ b/src/sundials/sundials_sycl.h @@ -43,7 +43,7 @@ extern "C" { [=](::sycl::nd_item<1> item) { loop }); \ }); -/* Sycl parallel for loop with stream for ouput */ +/* Sycl parallel for loop with stream for output */ #define SYCL_FOR_DEBUG(q, total, block, item, loop) \ q->submit( \ [&](::sycl::handler& h) \ @@ -63,7 +63,7 @@ extern "C" { [=](::sycl::nd_item<1> item, auto& rvar) { loop }); \ }); -/* Sycl parallel for loop with reduction and stream for ouput */ +/* Sycl parallel for loop with reduction and stream for output */ #define SYCL_FOR_REDUCE_DEBUG(q, total, block, item, rvar, rop, loop) \ q->submit( \ [&](::sycl::handler& h) \ diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 563fcd75b5..8bfc04a218 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -96,7 +96,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc M = A->M; nblocks = A->nblocks; - /* Check that the matirx and vector dimensions agree */ + /* Check that the matrix and vector dimensions agree */ if (M * nblocks != N_VGetLength(y)) { return (NULL); } /* Create the linear solver */ diff --git a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp index bd1e6dc610..4ca2fe3d2f 100644 --- a/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp +++ b/src/sunlinsol/onemkldense/sunlinsol_onemkldense.cpp @@ -211,7 +211,7 @@ SUNLinearSolver SUNLinSol_OneMklDense(N_Vector y, SUNMatrix Amat, oneapi::mkl::transpose::nontrans, M, // number of rows in A_i 1, // number of right-hand sides - M, // leading dimensino of A_i + M, // leading dimension of A_i M * N, // stride between A_i M, // stride between pivots M, // leading dimension of B_i @@ -348,7 +348,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrf\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrf\n"); if (e.info()) { // An illegal value was providied or the scratch pad is too small @@ -377,7 +377,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrf_batch\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrf_batch\n"); if (e.info()) { // An illegal value was providied or the scratch pad is too small @@ -406,7 +406,7 @@ int SUNLinSolSetup_OneMklDense(SUNLinearSolver S, SUNMatrix A) } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrf\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrf\n"); if (e.info()) { // An illegal value was providied or the scratch pad is too small @@ -522,7 +522,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrs\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrs\n"); ier = -1; } #else @@ -546,7 +546,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrs_batch\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrs_batch\n"); ier = -1; } #endif @@ -569,7 +569,7 @@ int SUNLinSolSolve_OneMklDense(SUNLinearSolver S, SUNMatrix A, N_Vector x, } catch (oneapi::mkl::lapack::exception const& e) { - SUNDIALS_DEBUG_ERROR("An exception occured in getrs\n"); + SUNDIALS_DEBUG_ERROR("An exception occurred in getrs\n"); ier = -1; } } @@ -619,7 +619,7 @@ SUNErrCode SUNLinSolFree_OneMklDense(SUNLinearSolver S) SUNMemoryHelper_Dealloc(LS_MEM_HELPER(S), LS_PIVOTS(S), LS_QUEUE(S)); } - // Factorization scrach memory + // Factorization scratch memory if (LS_F_SCRATCH(S)) { SUNMemoryHelper_Dealloc(LS_MEM_HELPER(S), LS_F_SCRATCH(S), LS_QUEUE(S)); diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index 100183e82c..30a7647a1d 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -280,7 +280,7 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, int* nli; int status; - /* Make local shorcuts to solver variables. */ + /* Make local shortcuts to solver variables. */ l_max = PCG_CONTENT(S)->maxl; r = PCG_CONTENT(S)->r; p = PCG_CONTENT(S)->p; diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index 67df9bcdfe..daa873987c 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -319,7 +319,7 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, sunrealtype cv[3]; N_Vector Xv[3]; - /* Make local shorcuts to solver variables. */ + /* Make local shortcuts to solver variables. */ l_max = SPBCGS_CONTENT(S)->maxl; r_star = SPBCGS_CONTENT(S)->r_star; r = SPBCGS_CONTENT(S)->r; @@ -685,7 +685,7 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, SUNCheckCall(N_VLinearCombination(3, cv, Xv, p)); - /* udpate beta_denom for next iteration */ + /* update beta_denom for next iteration */ beta_denom = beta_num; } diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index a1d3ea27ad..63a2c2940a 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -386,7 +386,7 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* Initialize some variables */ krydim = 0; - /* Make local shorcuts to solver variables. */ + /* Make local shortcuts to solver variables. */ l_max = SPFGMR_CONTENT(S)->maxl; max_restarts = SPFGMR_CONTENT(S)->max_restarts; gstype = SPFGMR_CONTENT(S)->gstype; diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 6ef57661ae..221a2f5660 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -370,7 +370,7 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, l_plus_1 = 0; krydim = 0; - /* Make local shorcuts to solver variables. */ + /* Make local shortcuts to solver variables. */ l_max = SPGMR_CONTENT(S)->maxl; max_restarts = SPGMR_CONTENT(S)->max_restarts; gstype = SPGMR_CONTENT(S)->gstype; diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 28ad1ef883..247b2548cf 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -314,7 +314,7 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, N_Vector Xv[3]; int status = SUN_SUCCESS; - /* Make local shorcuts to solver variables. */ + /* Make local shortcuts to solver variables. */ l_max = SPTFQMR_CONTENT(S)->maxl; r_star = SPTFQMR_CONTENT(S)->r_star; q = SPTFQMR_CONTENT(S)->q; diff --git a/src/sunlinsol/superludist/sunlinsol_superludist.c b/src/sunlinsol/superludist/sunlinsol_superludist.c index 8b58d1d22b..82c6b20f1d 100644 --- a/src/sunlinsol/superludist/sunlinsol_superludist.c +++ b/src/sunlinsol/superludist/sunlinsol_superludist.c @@ -249,7 +249,7 @@ int SUNLinSolSolve_SuperLUDIST(SUNLinearSolver S, SUNMatrix A, N_Vector x, if (retval != 0) { /* retval should never be < 0, and if it is > than ncol it means a memory - allocation error occured. If 0 < retval <= ncol, then U is singular and + allocation error occurred. If 0 < retval <= ncol, then U is singular and the solve couldn't be completed. */ if (retval < 0 || retval > Asuper->ncol) { @@ -277,7 +277,7 @@ SUNErrCode SUNLinSolFree_SuperLUDIST(SUNLinearSolver S) if (S == NULL) { return SUN_SUCCESS; } /* Call SuperLU DIST destroy/finalize routines, - but don't free the sturctures themselves - that is the user's job */ + but don't free the structures themselves - that is the user's job */ xDestroy_LU(SLU_SIZE(S), SLU_GRID(S), SLU_LU(S)); dSolveFinalize(SLU_OPTIONS(S), SLU_SOLVESTRUCT(S)); diff --git a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c index 5c84fc3b76..585f702349 100644 --- a/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c +++ b/src/sunmatrix/slunrloc/sunmatrix_slunrloc.c @@ -13,7 +13,7 @@ * SUNDIALS Copyright End * ---------------------------------------------------------------------------- * This is the implementation file for the SuperLU SuperMatrix SLU_NR_loc - * format compatibile SUNMatrix. + * format compatible SUNMatrix. * ---------------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ SUNMatrix SUNMatrix_SLUNRloc(SuperMatrix* A_super, gridinfo_t* grid, SUNMatrix A; SUNMatrixContent_SLUNRloc content; - /* Check for valid intputs */ + /* Check for valid inputs */ if (A_super == NULL || grid == NULL) { return (NULL); } if (A_super->Stype != SLU_NR_loc || A_super->Dtype != SLU_D || diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index c4c0af932a..94364f20ac 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -204,7 +204,7 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, /* looping point for attempts at solution of the nonlinear system: Evaluate the nonlinear residual function (store in delta) Setup the linear solver if necessary - Preform Newton iteraion */ + Perform Newton iteration */ for (;;) { /* initialize current iteration counter for this solve attempt */ diff --git a/swig/nvector/fnvector_pthreads_mod.i b/swig/nvector/fnvector_pthreads_mod.i index 69de29cf1e..dcdea595ac 100644 --- a/swig/nvector/fnvector_pthreads_mod.i +++ b/swig/nvector/fnvector_pthreads_mod.i @@ -19,7 +19,7 @@ // include code common to all nvector implementations %include "fnvector.i" -// include the header file in the swig wraper +// include the header file in the swig wrapper %{ #include "nvector/nvector_pthreads.h" %} diff --git a/test/answers b/test/answers index dd4aebcaa5..6426658117 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit dd4aebcaa5a886746fa281c528d452fdae825cd2 +Subproject commit 64266581174b2a2c31283e82f5d28ea5683f6bce diff --git a/test/config_cmake.py b/test/config_cmake.py index f1574b6257..1120d597ea 100644 --- a/test/config_cmake.py +++ b/test/config_cmake.py @@ -1395,7 +1395,7 @@ def read_env(args): if type(args_dict[a]) is not dict: continue - # don't overwite options already set at command line + # don't overwrite options already set at command line value = args_dict[a]["value"] default = args_dict[a]["default"] @@ -1475,7 +1475,7 @@ def _cmake_arg(str_var): if cmake_type == "BOOL" and str_var not in ["ON", "OFF", None]: err_msg = "Invalid option value " + str_var + ". " err_msg += "Input value must be ON or OFF." - raise argparse.ArgumentTypeError("Invaid Value for BOOL") + raise argparse.ArgumentTypeError("Invalid Value for BOOL") if choices is not None and str_var is not None: raise_error = False @@ -1534,14 +1534,14 @@ def write_cmake(fn, args): # print(a, args_dict[a]) - # don't wite output lines if using the default value + # don't write output lines if using the default value value = args_dict[a]["value"] default = args_dict[a]["default"] if value is None or value == default: continue - # don't wite output if TPL is not enabled + # don't write output if TPL is not enabled depends_on = args_dict[a]["depends_on"] if depends_on is not None: diff --git a/test/env/docker.sh b/test/env/docker.sh index 361d91646c..3d235839ce 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -294,7 +294,7 @@ if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUPERLU_DIST_LIBRARIES="${BLAS_LIBRARIES};${PARMETIS_LIBRARIES};${METIS_LIBRARIES};${SUPERLU_DIST_ROOT}/lib/libsuperlu_dist.a" export SUPERLU_DIST_OPENMP=OFF - # if BLAS wasnt found, then dont build SuperLU_DIST + # if BLAS wasn't found, then dont build SuperLU_DIST if [ -z "$BLAS_LIBRARIES" ]; then export SUNDIALS_SUPERLU_DIST=OFF else diff --git a/test/jenkins/README.md b/test/jenkins/README.md index 1eb1d382d8..5d51bc531a 100644 --- a/test/jenkins/README.md +++ b/test/jenkins/README.md @@ -83,7 +83,7 @@ Suggested plugins: * Dashboard view -- Customizable dashboard that can present various views of job information. -* Rebuilder -- allows ther user to rebuild a parametrized build without entering +* Rebuilder -- allows the user to rebuild a parameterized build without entering the parameters again. diff --git a/test/testRunner b/test/testRunner index 5a18d9b420..4021209582 100755 --- a/test/testRunner +++ b/test/testRunner @@ -188,7 +188,7 @@ def main(): else: answerFileName = testName - # if user supplies filename overide default choices + # if user supplies filename override default choices if(args.answerFile): answerFileName = args.answerFile @@ -205,7 +205,7 @@ def main(): os.environ['CALI_ENV_EXTRA'] = 'TEST_NAME' os.environ['CALI_CONFIG'] = 'spot(output=%s)' % profilePath - # if user supplies precision info overide the default choices + # if user supplies precision info override the default choices if(args.floatPrecision >= 0): testInfo.floatPrecision=args.floatPrecision @@ -409,7 +409,7 @@ def getInfo(testName, testDir): if len(testInfos) == 0: # Note: If no info is found in the testInfo file then run the test - # without arguments and use the default comparisions values + # without arguments and use the default comparisons values testInfos.append(TestInfo(4,10,"")) return testInfos diff --git a/test/test_driver.sh b/test/test_driver.sh index 019bd2f2ae..3a1d25f4ec 100755 --- a/test/test_driver.sh +++ b/test/test_driver.sh @@ -183,7 +183,7 @@ while [[ $# -gt 0 ]]; do testtype=CUSTOM ;; *) - echo "ERROR: Invaid test type $testtype" + echo "ERROR: Invalid test type $testtype" help exit 1;; esac @@ -213,7 +213,7 @@ while [[ $# -gt 0 ]]; do sundials|arkode|cvode|cvodes|ida|idas|kinsol|all) ;; *) - echo "ERROR: Invaid tarball option $tarball" + echo "ERROR: Invalid tarball option $tarball" help exit 1;; esac @@ -232,7 +232,7 @@ while [[ $# -gt 0 ]]; do sunrealtype=extended ;; *) - echo "ERROR: Invaid real type option $sunrealtype" + echo "ERROR: Invalid real type option $sunrealtype" help exit 1;; esac @@ -244,7 +244,7 @@ while [[ $# -gt 0 ]]; do 32|64) ;; *) - echo "ERROR: Invaid index size option $indexsize" + echo "ERROR: Invalid index size option $indexsize" help exit 1;; esac @@ -263,7 +263,7 @@ while [[ $# -gt 0 ]]; do libtype=both ;; *) - echo "ERROR: Invaid library type option $libtype" + echo "ERROR: Invalid library type option $libtype" help exit 1;; esac @@ -286,7 +286,7 @@ while [[ $# -gt 0 ]]; do suntesttype=NONE ;; *) - echo "ERROR: Invaid SUNDIALS test type option $suntesttype" + echo "ERROR: Invalid SUNDIALS test type option $suntesttype" help exit 1;; esac @@ -317,7 +317,7 @@ while [[ $# -gt 0 ]]; do phase=TEST_INSTALL_ALL ;; *) - echo "ERROR: Invaid phase option $phase" + echo "ERROR: Invalid phase option $phase" help exit 1;; esac diff --git a/test/test_install.py b/test/test_install.py index 4dab1c4513..97df74fa55 100755 --- a/test/test_install.py +++ b/test/test_install.py @@ -113,7 +113,7 @@ def main(): os.chdir(cwd) continue - # confgure cmake if necessary + # configure cmake if necessary configfail = False if args.cmake: if os.path.isfile("Makefile"): 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 86b8efb0d3..00008a1f11 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 @@ -294,13 +294,13 @@ int main(int argc, char* argv[]) flag = ARKodeSetLinearSolver(arkstep_mem, LSa, NULL); // Attach linear solver if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } flag = ARKodeSetPreconditioner(arkstep_mem, PSet, - PSol); // Specify the Preconditoner + PSol); // Specify the Preconditioner if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } flag = ARKodeSetLinearSolver(mristep_mem, LSm, NULL); // Attach linear solver if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } flag = ARKodeSetPreconditioner(mristep_mem, PSet, - PSol); // Specify the Preconditoner + PSol); // Specify the Preconditioner if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } // Optionally specify linearly implicit RHS, with non-time-dependent preconditioner 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 e2cb57a011..a31e3d81e0 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 @@ -81,7 +81,7 @@ int main(int argc, char* argv[]) sunindextype NEQ = 3; // number of dependent vars. sunrealtype reltol = SUN_RCONST(1.0e-6); // tolerances sunrealtype abstol = SUN_RCONST(1.0e-10); - sunrealtype lamda = SUN_RCONST(-100.0); // stiffness parameter + sunrealtype lambda = SUN_RCONST(-100.0); // stiffness parameter // general problem variables int flag; // reusable error-checking flag @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) // Initial problem output cout << "\nAnalytical ODE test problem:\n"; - cout << " lamda = " << lamda << "\n"; + cout << " lambda = " << lambda << "\n"; cout << " reltol = " << reltol << "\n"; cout << " abstol = " << abstol << "\n\n"; if (fixedpoint) { cout << " Fixed-point nonlinear solver\n"; } @@ -163,7 +163,7 @@ int main(int argc, char* argv[]) // Set routines flag = ARKodeSetUserData(arkstep_mem, - (void*)&lamda); // Pass lamda to user functions + (void*)&lambda); // Pass lambda to user functions if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } flag = ARKodeSStolerances(arkstep_mem, reltol, abstol); // Specify tolerances if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } @@ -175,7 +175,7 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } flag = ARKodeSetUserData(mristep_mem, - (void*)&lamda); // Pass lamda to user functions + (void*)&lambda); // Pass lambda to user functions if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } flag = ARKodeSStolerances(mristep_mem, reltol, abstol); // Specify tolerances if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } 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 384859a985..3068d63bdd 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 @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1e-06 abstol = 1e-10 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 bd5acb803f..f49a7e34c1 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 @@ -1,6 +1,6 @@ Analytical ODE test problem: - lamda = -100 + lambda = -100 reltol = 1e-06 abstol = 1e-10 diff --git a/test/unit_tests/arkode/C_serial/ark_test_reset.c b/test/unit_tests/arkode/C_serial/ark_test_reset.c index 445850399f..529a3d62cf 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -15,7 +15,7 @@ * * This runs the same test problem as in * examples/arkode/C_serial/ark_analytic.c: - * dy/dt = lamda*y + 1/(1+t^2) - lambda*atan(t) + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) * for t in various time intervals, with the initial condition * y(0)=0, and having analytical solution y(t) = atan(t). * @@ -97,7 +97,7 @@ int main(void) retval = SUNContext_Create(SUN_COMM_NULL, &ctx); if (check_retval(&retval, "SUNContext_Create", 1)) { return 1; } - /* Initialize vector, matrix, and linaer solver data structures */ + /* Initialize vector, matrix, and linear solver data structures */ y = N_VNew_Serial(1, ctx); if (check_retval((void*)y, "N_VNew_Serial", 0)) { return 1; } A = SUNDenseMatrix(1, 1, ctx); From b67a3cb73fee66c7c0eb2a4f8eca49ddca3a1c42 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 26 Jul 2024 14:09:59 -0700 Subject: [PATCH 088/137] Docs: Fix ARKODE_VERNER_8_5_6 reference (#546) --- doc/arkode/guide/source/Butcher.rst | 2 +- doc/shared/sundials.bib | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index 678510cd4f..0b7e401a56 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -915,7 +915,7 @@ or :c:func:`ARKodeButcherTable_LoadERK`. Accessible via the string ``"ARKODE_VERNER_8_5_6"`` to :c:func:`ARKStepSetTableName`, :c:func:`ERKStepSetTableName` or :c:func:`ARKodeButcherTable_LoadERKByName`. -This is the default 6th order explicit method (from :cite:p:`Ver:78`). +This is the default 6th order explicit method (from :cite:p:`HEJ:76`). .. math:: diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index 1f9d585a91..b000f2c3dc 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -1880,6 +1880,14 @@ @article{Gust:94 doi = {10.1145/198429.198437} } +@techreport{HEJ:76, + title = {User's guide for {DVERK}: {A} subroutine for solving non-stiff {ODE}'s}, + author = {Hull, TE and Enright, WH and Jackson, KR}, + year = {1976}, + number = {100}, + institution={University of Toronto. Department of Computer Science} +} + @article{Jay:21, title = {Symplecticness conditions of some low order partitioned methods for non-autonomous Hamiltonian systems}, author = {Jay, Laurent O}, @@ -2133,17 +2141,6 @@ @article{Sof:04 doi = {10.1016/j.mcm.2005.01.010} } -@article{Ver:78, - author = {Verner, J.H}, - title = {Explicit Runge-Kutta methods with estimates of the local truncation error}, - journal = {SIAM Journal of Numerical Analysis}, - volume = {15}, - number = {4}, - pages = {772-790}, - year = {1978}, - doi = {10.1137/0715051} -} - @article{Ver:10, author = {Verner, J.H}, title = {Numerically optimal {Runge–Kutta} pairs with interpolants}, From 737e6cb1cda25d362fd9281b74ae15ab0c815b42 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Mon, 5 Aug 2024 09:20:54 -0700 Subject: [PATCH 089/137] README Updates (#550) View of the rendered markdown: https://github.com/LLNL/sundials/blob/maintenance/readme/README.md --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- README.md | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c410afb6ca..1d84b9b6e2 100644 --- a/README.md +++ b/README.md @@ -15,50 +15,62 @@ equation (ODE) systems, differential-algebraic equation (DAE) systems, and nonlinear algebraic systems: * ARKODE - for integrating stiff, nonstiff, and multirate ODEs of the form + $$M(t) \\, y' = f_1(t,y) + f_2(t,y), \quad y(t_0) = y_0$$ * CVODE - for integrating stiff and nonstiff ODEs of the form + $$y' = f(t,y), \quad y(t_0) = y_0$$ * CVODES - for integrating and sensitivity analysis (forward and adjoint) of ODEs of the form + $$y' = f(t,y,p), \quad y(t_0) = y_0(p)$$ * IDA - for integrating DAEs of the form + $$F(t,y,y') = 0, \quad y(t_0) = y_0, \quad y'(t_0) = y_0'$$ * IDAS - for integrating and sensitivity analysis (forward and adjoint) of DAEs of the form + $$F(t,y,y',p) = 0, \quad y(t_0) = y_0(p), \quad y'(t_0) = y_0'(p)$$ * KINSOL - for solving nonlinear algebraic systems of the form + $$F(u) = 0 \quad \text{or} \quad G(u) = u$$ ## Installation ## -For installation directions see the [online install guide](https://sundials.readthedocs.io/en/latest/Install_link.html), -the installation chapter in any of the package user guides, or INSTALL_GUIDE.pdf. +For installation directions, see the [getting started](https://sundials.readthedocs.io/en/latest/sundials/index.html#getting-started) +section in the online documentation. In the [released tarballs](https://github.com/LLNL/sundials/releases), +installation directions are also available in `INSTALL_GUIDE.pdf` and the +installation chapter of the user guides in the `doc` directory. Warning to users who receive more than one of the individual packages at -different times: Mixing old and new versions of SUNDIALS may fail. To avoid -such failures, obtain all desired package at the same time. +different times: Mixing old and new versions of SUNDIALS may fail. To avoid such +failures, obtain all desired package at the same time. ## Support ## -Full user guides for all of the SUNDIALS packages are available [online](https://sundials.readthedocs.io) -and in the [doc](./doc) directory. Additionally, the [doc](./doc) directory -contains documentation for the package example programs. +Full user guides for all of the SUNDIALS packages are available [online](https://sundials.readthedocs.io). +In the [released tarballs](https://github.com/LLNL/sundials/releases), the `doc` +directory includes PDFs of the user guides and documentation for the example +programs. The example program documentation PDFs are also available on the +[releases page](https://github.com/LLNL/sundials/releases). For information on recent changes to SUNDIALS see the [CHANGELOG](./CHANGELOG.md) or the introduction chapter of any package user guide. A list of Frequently Asked Questions on build and installation procedures as -well as common usage issues is available on the SUNDIALS [FAQ](https://computing.llnl.gov/projects/sundials/faq). -For dealing with systems with unphysical solutions or discontinuities see the -SUNDIALS [usage notes](https://computing.llnl.gov/projects/sundials/usage-notes). +well as common usage issues is available on the SUNDIALS +[FAQ](https://computing.llnl.gov/projects/sundials/faq). For dealing with +systems with nonphysical solutions or discontinuities see the SUNDIALS +[usage notes](https://computing.llnl.gov/projects/sundials/usage-notes). -If you have a question not covered in the FAQ or usage notes, please submit -your question to the SUNDIALS [mailing list](https://computing.llnl.gov/projects/sundials/mailing-list). +If you have a question not covered in the FAQ or usage notes, please submit your +question as a [GitHub issue](https://github.com/LLNL/sundials/issues) or to the +SUNDIALS [mailing list](https://computing.llnl.gov/projects/sundials/mailing-list). ## Contributing ## @@ -76,14 +88,15 @@ any publications reporting work done using SUNDIALS packages. The SUNDIALS library has been developed over many years by a number of contributors. The current SUNDIALS team consists of Cody J. Balos, -David J. Gardner, Alan C. Hindmarsh, Daniel R. Reynolds, and Carol S. Woodward. -We thank Radu Serban for significant and critical past contributions. +David J. Gardner, Alan C. Hindmarsh, Daniel R. Reynolds, Steven B. Roberts, and +Carol S. Woodward. We thank Radu Serban for significant and critical past +contributions. Other contributors to SUNDIALS include: James Almgren-Bell, Lawrence E. Banks, Peter N. Brown, George Byrne, Rujeko Chinomona, Scott D. Cohen, Aaron Collier, Keith E. Grant, Steven L. Lee, Shelby L. Lockhart, John Loffeld, Daniel McGreer, -Yu Pan, Slaven Peles, Cosmin Petra, Steven B. Roberts, H. Hunter Schwartz, -Jean M. Sexton, Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, +Yu Pan, Slaven Peles, Cosmin Petra, H. Hunter Schwartz, Jean M. Sexton, +Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang. ## License ## @@ -93,7 +106,7 @@ and [NOTICE](./NOTICE) files for details. All new contributions must be made under the BSD 3-clause license. **Please Note** If you are using SUNDIALS with any third party libraries linked -in (e.g., LAPACK, KLU, SuperLU_MT, PETSc, or *hypre*), be sure to review the +in (e.g., LAPACK, KLU, SuperLU_MT, PETSc, *hypre*, etc.), be sure to review the respective license of the package as that license may have more restrictive terms than the SUNDIALS license. From 115914d3b91f9ef1447729e36cd69d489906d6f1 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Tue, 6 Aug 2024 10:09:47 -0700 Subject: [PATCH 090/137] Bugfix: remove CMake print warning (#552) Remove usage of print_warning macro that was missed previously --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 +++ cmake/SundialsDeprecated.cmake | 4 ++-- doc/shared/RecentChanges.rst | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c77cdcbdfb..61bf6ea6d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ Fixed the loading of ARKStep's default first order explicit method. +Fixed a CMake bug regarding usage of missing "print_warning" macro +that was only triggered when the deprecated `CUDA_ARCH` option was used. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.1 diff --git a/cmake/SundialsDeprecated.cmake b/cmake/SundialsDeprecated.cmake index a426ac1814..017e867c73 100644 --- a/cmake/SundialsDeprecated.cmake +++ b/cmake/SundialsDeprecated.cmake @@ -180,8 +180,8 @@ endif() # if(DEFINED CUDA_ARCH) - print_warning("The CMake option CUDA_ARCH is deprecated. " - "Use CMAKE_CUDA_ARCHITECTURES instead.") + message(DEPRECATION "The CMake option CUDA_ARCH is deprecated. " + "Use CMAKE_CUDA_ARCHITECTURES instead.") # convert sm_** to just ** string(REGEX MATCH "[0-9]+" arch_name "${CUDA_ARCH}") set(CMAKE_CUDA_ARCHITECTURES diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index cc4a9f919c..2002b0ffd6 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -6,4 +6,7 @@ Fixed the loading of ARKStep's default first order explicit method. +Fixed a CMake bug regarding usage of missing "print_warning" macro +that was only triggered when the deprecated ``CUDA_ARCH`` option was used. + **Deprecation Notices** From 0b5b2c36426722ae9ea3704fd56716e592d1d50c Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 15 Aug 2024 09:09:06 -0700 Subject: [PATCH 091/137] CMake: remove CMAKE_CUDA_ARCHITECTURES default (#553) Allow CMake to automatically determine `CMAKE_CUDA_ARCHITECTURES` if it is not set rather than defaulting to `70` --- CHANGELOG.md | 6 ++++++ cmake/SundialsTPLOptions.cmake | 4 ---- doc/shared/RecentChanges.rst | 6 ++++++ doc/shared/sundials/Install.rst | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61bf6ea6d0..3a82dd8621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ ### New Features and Enhancements +The default value of `CMAKE_CUDA_ARCHITECTURES` is no longer set to `70` and is +now determined automatically by CMake. The previous default was only valid for +Volta GPUs while the automatically selected value will vary across compilers and +compiler versions. As such, users are encouraged to override this value with the +architecture for their system. + ### Bug Fixes Fixed the loading of ARKStep's default first order explicit method. diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 40110eed74..9d186c887f 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -46,10 +46,6 @@ sundials_option(ENABLE_PTHREAD BOOL "Enable Pthreads support" OFF) # ------------------------------------------------------------- sundials_option(ENABLE_CUDA BOOL "Enable CUDA support" OFF) -# CMake 3.18 adds this option. -sundials_option(CMAKE_CUDA_ARCHITECTURES STRING "Target CUDA architecture" "70" - DEPENDS_ON ENABLE_CUDA) - # ------------------------------------------------------------- # Enable HIP support? # ------------------------------------------------------------- diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 2002b0ffd6..0cd3986ee3 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -2,6 +2,12 @@ **New Features and Enhancements** +The default value of :cmakeop:`CMAKE_CUDA_ARCHITECTURES` is no longer set to +``70`` and is now determined automatically by CMake. The previous default was +only valid for Volta GPUs while the automatically selected value will vary +across compilers and compiler versions. As such, users are encouraged to +override this value with the architecture for their system. + **Bug Fixes** Fixed the loading of ARKStep's default first order explicit method. diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index d75eca6e9e..3d730dd594 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -523,9 +523,19 @@ illustration only. .. cmakeoption:: CMAKE_CUDA_ARCHITECTURES - Specifies the CUDA architecture to compile for. + Specifies the CUDA architecture to compile for i.e., ``60`` for Pascal, + ``70`` Volta, ``80`` for Ampere, ``90`` for Hopper, etc. See the `GPU compute + capability tables <https://developer.nvidia.com/cuda-gpus>`_ on the NVIDIA + webpage and the `GPU Compilation <https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-compilation>`_ + section of the CUDA documentation for more information. - Default: ``sm_30`` + Default: Determined automatically by CMake. Users are encouraged to override + this value with the architecture for their system as the default varies + across compilers and compiler versions. + + .. versionchanged:: x.y.z + + In prior versions ``CMAKE_CUDA_ARCHITECTURES`` defaulted to ``70``. .. cmakeoption:: EXAMPLES_ENABLE_C From 858edc428011cc75a4fb66bb5464e372e1e27890 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Tue, 20 Aug 2024 15:45:32 -0700 Subject: [PATCH 092/137] Docs: Fix minor typo in user callable docs (#557) Correct ERKStep to MRIStep or SPRKStep --- doc/arkode/guide/source/Usage/MRIStep/User_callable.rst | 2 +- doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 24e8497c04..6da3a217f5 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -23,7 +23,7 @@ by the user to setup and then solve an IVP using the MRIStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated -- each of these are clearly marked. However, some -of these user-callable functions are specific to ERKStep, as explained +of these user-callable functions are specific to MRIStep, as explained below. As discussed in the main :ref:`ARKODE user-callable function introduction diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 14d45133d1..7d5950fa77 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -20,7 +20,7 @@ by the user to setup and then solve an IVP using the SPRKStep time-stepping module. The large majority of these routines merely wrap :ref:`underlying ARKODE functions <ARKODE.Usage.UserCallable>`, and are now deprecated -- each of these are clearly marked. However, some -of these user-callable functions are specific to ERKStep, as explained +of these user-callable functions are specific to SPRKStep, as explained below. As discussed in the main :ref:`ARKODE user-callable function introduction From 8578bd3885547f0b513865905726d468ea0eddb0 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Tue, 3 Sep 2024 08:58:58 -0700 Subject: [PATCH 093/137] Fix variable arguments start/end (#549) The `test_sundials_errors` test was failing for me which I traced down to the handling of variable arguments. It's the same issue discussed in https://github.com/LLNL/sundials/issues/461 which was partially fixed in https://github.com/LLNL/sundials/pull/462. This PR should finish it off. --------- Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> --- include/sundials/priv/sundials_errors_impl.h | 6 ++++-- src/sundials/sundials_errors.c | 8 ++++---- src/sundials/sundials_logger.c | 11 ++++++----- test/unit_tests/sundials/test_sundials_errors.cpp | 15 +++++++++------ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/include/sundials/priv/sundials_errors_impl.h b/include/sundials/priv/sundials_errors_impl.h index e05bbd4382..eea844c861 100644 --- a/include/sundials/priv/sundials_errors_impl.h +++ b/include/sundials/priv/sundials_errors_impl.h @@ -186,10 +186,12 @@ static inline void SUNHandleErrWithFmtMsg(int line, const char* func, msglen = (size_t)vsnprintf(NULL, (size_t)0, msgfmt, values); /* determine size of buffer needed */ - msg = (char*)malloc(msglen + 1); + va_end(values); + msg = (char*)malloc(msglen + 1); + va_start(values, sunctx); vsnprintf(msg, msglen + 1, msgfmt, values); - SUNHandleErrWithMsg(line, func, file, msg, code, sunctx); va_end(values); + SUNHandleErrWithMsg(line, func, file, msg, code, sunctx); free(msg); } diff --git a/src/sundials/sundials_errors.c b/src/sundials/sundials_errors.c index acc3a0e5bc..456d7134e9 100644 --- a/src/sundials/sundials_errors.c +++ b/src/sundials/sundials_errors.c @@ -94,23 +94,23 @@ void SUNGlobalFallbackErrHandler(int line, const char* func, const char* file, char* log_msg = NULL; char* file_and_line = NULL; - va_start(ap, err_code); - file_and_line = sunCombineFileAndLine(__LINE__, __FILE__); + va_start(ap, err_code); sunCreateLogMessage(SUN_LOGLEVEL_ERROR, 0, file_and_line, __func__, "The SUNDIALS SUNContext was corrupt or NULL when an error occurred. As such, error messages have been printed to stderr.", ap, &log_msg); + va_end(ap); fprintf(stderr, "%s", log_msg); free(log_msg); free(file_and_line); file_and_line = sunCombineFileAndLine(line, file); if (msgfmt == NULL) { msgfmt = SUNGetErrMsg(err_code); } + va_start(ap, err_code); sunCreateLogMessage(SUN_LOGLEVEL_ERROR, 0, file_and_line, func, msgfmt, ap, &log_msg); + va_end(ap); fprintf(stderr, "%s", log_msg); free(log_msg); free(file_and_line); - - va_end(ap); } diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index bc4d6869ae..6038d5f137 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -333,12 +333,12 @@ SUNErrCode SUNLogger_QueueMsg(SUNLogger logger, SUNLogLevel lvl, return retval; } - va_list args; - va_start(args, msg_txt); - if (logger->queuemsg) { + va_list args; + va_start(args, msg_txt); retval = logger->queuemsg(logger, lvl, scope, label, msg_txt, args); + va_end(args); } else { @@ -347,7 +347,10 @@ SUNErrCode SUNLogger_QueueMsg(SUNLogger logger, SUNLogLevel lvl, if (sunLoggerIsOutputRank(logger, &rank)) { char* log_msg = NULL; + va_list args; + va_start(args, msg_txt); sunCreateLogMessage(lvl, rank, scope, label, msg_txt, args, &log_msg); + va_end(args); switch (lvl) { @@ -372,8 +375,6 @@ SUNErrCode SUNLogger_QueueMsg(SUNLogger logger, SUNLogLevel lvl, free(log_msg); } } - - va_end(args); } #else /* silence warnings when all logging is disabled */ diff --git a/test/unit_tests/sundials/test_sundials_errors.cpp b/test/unit_tests/sundials/test_sundials_errors.cpp index 73b3b2ea7c..22dc8b97df 100644 --- a/test/unit_tests/sundials/test_sundials_errors.cpp +++ b/test/unit_tests/sundials/test_sundials_errors.cpp @@ -171,22 +171,25 @@ class SUNContextErrFunctionTests : public testing::Test SUNContext sunctx; }; -void firstHandler(int line, const char* func, const char* file, const char* msg, - SUNErrCode err_code, void* err_user_data, SUNContext sunctx) +static void firstHandler(int line, const char* func, const char* file, + const char* msg, SUNErrCode err_code, + void* err_user_data, SUNContext sunctx) { std::vector<int>* order = static_cast<std::vector<int>*>(err_user_data); order->push_back(0); } -void secondHandler(int line, const char* func, const char* file, const char* msg, - SUNErrCode err_code, void* err_user_data, SUNContext sunctx) +static void secondHandler(int line, const char* func, const char* file, + const char* msg, SUNErrCode err_code, + void* err_user_data, SUNContext sunctx) { std::vector<int>* order = static_cast<std::vector<int>*>(err_user_data); order->push_back(1); } -void thirdHandler(int line, const char* func, const char* file, const char* msg, - SUNErrCode err_code, void* err_user_data, SUNContext sunctx) +static void thirdHandler(int line, const char* func, const char* file, + const char* msg, SUNErrCode err_code, + void* err_user_data, SUNContext sunctx) { std::vector<int>* order = static_cast<std::vector<int>*>(err_user_data); order->push_back(2); From 7f8c35bf2fbfa5e1b32d1e2eaccf2d363577d224 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Wed, 4 Sep 2024 08:50:08 -0700 Subject: [PATCH 094/137] Docs: Fix MRIStepSetOrder Min Order (#562) Update this documentation for `MRIStepSetOrder` from #439 where low order methods were added --- doc/arkode/guide/source/Usage/MRIStep/User_callable.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 6da3a217f5..bf00365669 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -830,7 +830,7 @@ Optional inputs for IVP method selection Select the default MRI method of a given order. - The default order is 3. An order less than 3 or greater than 4 will result in + The default order is 3. An order less than 1 or greater than 4 will result in using the default. **Arguments:** From bb6cf3e7ecf6c7c1fbbc85bc320e2a5100b03e16 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 10 Sep 2024 14:37:27 -0700 Subject: [PATCH 095/137] CI: Update Jenkins (#568) Update testing with Jenkins * New TPL versions * Address warnings with RAJA 2024+, Ginkgo 1.8.0 and 1.7.0, KLU 6+ * Update hypre examples to work with v2.20.0+ * Use Trilinos imported targets (added in v14.0.0) * Fix output file name collisions with ARKODE RAJA example * Fix warnings with gcc 11.4.1 * Fix Trilinos vector interface build with CUDA * Update output files --------- Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- CHANGELOG.md | 10 + benchmarks/CMakeLists.txt | 6 +- .../advection_reaction_3D/raja/backends.hpp | 15 +- cmake/SUNDIALSConfig.cmake.in | 6 +- cmake/SundialsBuildOptionsPost.cmake | 2 +- cmake/SundialsSetupConfig.cmake | 2 +- cmake/SundialsTPLOptions.cmake | 36 ---- cmake/tpl/FindHYPRE.cmake | 21 +- cmake/tpl/FindTrilinos.cmake | 49 ----- cmake/tpl/SundialsTrilinos.cmake | 152 ++------------- doc/shared/RecentChanges.rst | 10 + doc/shared/sundials/Install.rst | 31 +++ examples/arkode/CXX_parallel/CMakeLists.txt | 6 +- ...k_local_nls.USE_SERIAL_NVEC_--monitor.out} | 0 ...RIAL_NVEC_--monitor_--explicit_--tf_1.out} | 0 ...SE_SERIAL_NVEC_--monitor_--global-nls.out} | 0 .../ark_brusselator1D_task_local_nls.cpp | 16 +- ...reaction_p_--np_2_2_--mri-cvode-global.out | 30 +-- ..._reaction_p_--np_2_2_--mri-cvode-local.out | 16 +- .../CXX_parallel/ark_heat2D_p_--np_2_2.out | 36 ++-- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 14 ++ .../ark_heat2D_hypre_ls_--np_2_2.out | 22 +-- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 14 ++ .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 14 ++ .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 13 ++ examples/arkode/CXX_serial/ark_heat2D.out | 50 ++--- .../arkode/CXX_serial/ark_kpr_Mt_0_4_1.out | 10 +- examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out | 2 +- examples/arkode/CXX_serial/ark_pendulum.out | 36 ++-- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 14 ++ ...mg_xbraid_--np_2_1_2_--x_print_level_0.out | 2 +- ..._p_xbraid_--np_2_1_2_--x_print_level_0.out | 12 +- .../ark_heat2D_xbraid_--x_print_level_0.out | 12 +- .../ark_brusselator1D_task_local_nls.c | 75 ++++---- ..._task_local_nls_--monitor_--global-nls.out | 44 ++--- .../C_parallel/ark_diurnal_kry_bbd_p.out | 160 ++++++++-------- .../arkode/C_parallel/ark_diurnal_kry_p.out | 81 ++++---- .../arkode/C_parhyp/ark_diurnal_kry_ph.out | 79 ++++---- .../arkode/C_serial/ark_KrylovDemo_prec.c | 14 +- examples/arkode/C_serial/ark_analytic.c | 4 +- examples/arkode/C_serial/ark_analytic_mels.c | 4 +- .../ark_conserved_exp_entropy_ark_1_0.out | 2 +- .../ark_conserved_exp_entropy_ark_1_1.out | 35 ++-- .../ark_dissipated_exp_entropy_1_1.out | 21 +- examples/arkode/C_serial/ark_heat1D_adapt.c | 2 +- ..._--count-orbits_--use-compensated-sums.out | 130 ++++++------- ...ROG_2_2_--tf_50_--check-order_--nout_1.out | 2 +- ...LAN_5_6_--tf_50_--check-order_--nout_1.out | 8 +- ...ROG_2_2_--tf_50_--check-order_--nout_1.out | 2 +- .../arkode/C_serial/ark_kpr_mri_9_0.001.out | 2 +- ...local_nls_f2003_--monitor_--global-nls.out | 42 ++-- .../F2003_serial/ark_diurnal_kry_bp_f2003.out | 39 ++-- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 14 ++ .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 14 ++ examples/cvode/CXX_serial/cv_kpr.out | 40 ++-- .../cvDiurnal_kry_mpimanyvec.out | 58 +++--- .../F2003_serial/cv_advdiff_bnd_f2003.out | 2 +- .../F2003_serial/cv_analytic_fp_f2003.out | 14 +- .../F2003_serial/cv_diurnal_kry_bp_f2003.out | 14 +- .../cvode/ginkgo/cv_heat2D_ginkgo.OMP.out | 46 ++--- examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp | 8 + examples/cvode/ginkgo/cv_kpr_ginkgo.OMP.out | 48 ++--- examples/cvode/ginkgo/cv_kpr_ginkgo.REF.out | 54 +++--- .../cvode/parallel/cvDiurnal_kry_bbd_p.out | 48 ++--- examples/cvode/parallel/cvDiurnal_kry_p.out | 58 +++--- examples/cvode/petsc/cvAdvDiff_petsc.out | 4 +- examples/cvode/petsc/cv_petsc_ex7.out | 32 ++-- examples/cvode/serial/cvAnalytic_mels.c | 4 +- examples/cvode/serial/cvDirectDemo_ls.c | 6 +- examples/cvode/serial/cvDiurnal_kry.out | 34 ++-- examples/cvode/serial/cvDiurnal_kry_bp.out | 38 ++-- examples/cvode/serial/cvKrylovDemo_prec.c | 4 +- examples/cvode/serial/cvParticle_dns.out | 16 +- .../superludist/cvAdvDiff_sludist_64.out | 16 +- .../F2003_serial/cvs_analytic_fp_f2003.out | 14 +- .../cvsDiurnal_FSA_kry_p_-sensi_sim_t.out | 80 ++++---- .../cvsDiurnal_FSA_kry_p_-sensi_stg_t.out | 88 ++++----- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.out | 48 ++--- examples/cvodes/parallel/cvsDiurnal_kry_p.out | 58 +++--- examples/cvodes/serial/cvsAnalytic_mels.c | 4 +- examples/cvodes/serial/cvsDirectDemo_ls.c | 6 +- .../cvsDiurnal_FSA_kry_-sensi_sim_t.out | 96 +++++----- examples/cvodes/serial/cvsDiurnal_kry.out | 34 ++-- examples/cvodes/serial/cvsDiurnal_kry_bp.out | 38 ++-- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 10 +- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 10 +- examples/cvodes/serial/cvsKrylovDemo_prec.c | 4 +- examples/cvodes/serial/cvsParticle_dns.out | 16 +- .../cvsRoberts_FSA_dns_-sensi_sim_t.out | 6 +- .../cvsRoberts_FSA_dns_-sensi_stg1_t.out | 10 +- .../cvsRoberts_FSA_sps_-sensi_stg1_t.out | 4 +- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 4 +- examples/ida/parallel/idaFoodWeb_kry_p.c | 4 +- examples/ida/petsc/CMakeLists.txt | 13 +- examples/ida/petsc/idaHeat2D_petsc_snes.out | 14 +- .../ida/petsc/idaHeat2D_petsc_snes_-jac.out | 10 +- .../petsc/idaHeat2D_petsc_snes_-jac_-pre.out | 6 +- .../ida/petsc/idaHeat2D_petsc_snes_-pre.out | 14 +- examples/ida/petsc/idaHeat2D_petsc_spgmr.out | 10 +- examples/ida/serial/idaFoodWeb_kry.c | 4 +- examples/ida/trilinos/CMakeLists.txt | 11 +- .../ida/trilinos/idaHeat2D_kry_tpetra.out | 10 +- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 4 +- examples/idas/parallel/idasFoodWeb_kry_p.c | 4 +- examples/idas/serial/idasSlCrank_FSA_dns.out | 16 +- examples/idas/serial/idasSlCrank_dns.out | 2 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 14 ++ .../kin_heat2D_nonlin_hypre_pfmg.cpp | 14 ++ examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c | 2 +- examples/kinsol/parallel/kinFoodWeb_kry_p.c | 2 +- examples/kinsol/serial/kinKrylovDemo_ls.c | 2 +- examples/nvector/trilinos/CMakeLists.txt | 16 +- examples/sunlinsol/ginkgo/CMakeLists.txt | 16 +- .../ginkgo/test_sunlinsol_ginkgo.cpp | 8 + .../ginkgo/test_sunmatrix_ginkgo.cpp | 31 +-- .../trilinos/SundialsTpetraVectorKernels.hpp | 86 +++++---- include/sundials/sundials_config.in | 3 + include/sunlinsol/sunlinsol_klu.h | 5 + include/sunmatrix/sunmatrix_ginkgo.hpp | 6 + src/arkode/arkode.c | 3 +- src/cvode/cvode.c | 3 +- src/cvodes/cvodes.c | 3 +- src/ida/ida.c | 3 +- src/idas/idas.c | 3 +- src/kinsol/kinsol.c | 3 +- src/nvector/trilinos/CMakeLists.txt | 11 +- src/nvector/trilinos/nvector_trilinos.cpp | 2 +- test/answers | 2 +- test/env/default.sh | 180 +++++------------- test/env/docker.sh | 2 +- test/jenkins/README.md | 4 +- .../arkode/C_serial/ark_test_reset.c | 4 +- .../cvode/CXX_serial/cv_test_kpr.out | 40 ++-- .../cv_test_kpr_--dgmax_jbad_1.0.out | 40 ++-- .../cv_test_kpr_--dgmax_lsetup_0.0.out | 40 ++-- .../CXX_serial/cv_test_kpr_--eta_cf_0.5.out | 40 ++-- ...est_kpr_--eta_max_ef_0.1_--small_nef_1.out | 42 ++-- .../CXX_serial/cv_test_kpr_--eta_max_fs_2.out | 40 ++-- .../cv_test_kpr_--eta_min_ef_0.5.out | 42 ++-- ..._test_kpr_--eta_min_es_2_--small_nst_5.out | 40 ++-- ..._kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out | 44 ++--- ...est_kpr_--eta_min_fx_1.0_--eta_min_0.5.out | 40 ++-- .../CXX_serial/cv_test_kpr_--eta_min_gs_2.out | 40 ++-- .../cvodes/CXX_serial/cvs_test_kpr.out | 40 ++-- .../cvs_test_kpr_--dgmax_jbad_1.0.out | 40 ++-- .../cvs_test_kpr_--dgmax_lsetup_0.0.out | 40 ++-- .../CXX_serial/cvs_test_kpr_--eta_cf_0.5.out | 40 ++-- ...est_kpr_--eta_max_ef_0.1_--small_nef_1.out | 42 ++-- .../cvs_test_kpr_--eta_max_fs_2.out | 40 ++-- .../cvs_test_kpr_--eta_min_ef_0.5.out | 42 ++-- ..._test_kpr_--eta_min_es_2_--small_nst_5.out | 40 ++-- ..._kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out | 44 ++--- ...est_kpr_--eta_min_fx_1.0_--eta_min_0.5.out | 40 ++-- .../cvs_test_kpr_--eta_min_gs_2.out | 40 ++-- .../ida/CXX_serial/ida_test_kpr.out | 44 ++--- .../ida/CXX_serial/ida_test_kpr_--dcj_0.9.out | 38 ++-- .../CXX_serial/ida_test_kpr_--eta_cf_0.5.out | 44 ++--- .../ida_test_kpr_--eta_max_fs_2.out | 44 ++--- .../CXX_serial/ida_test_kpr_--eta_min_2.out | 44 ++--- .../ida_test_kpr_--eta_min_ef_0.5.out | 42 ++-- ..._kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out | 44 ++--- ...est_kpr_--eta_min_fx_1.0_--eta_min_0.5.out | 44 ++--- .../idas/CXX_serial/idas_test_kpr.out | 44 ++--- .../CXX_serial/idas_test_kpr_--dcj_0.9.out | 38 ++-- .../CXX_serial/idas_test_kpr_--eta_cf_0.5.out | 44 ++--- .../CXX_serial/idas_test_kpr_--eta_min_2.out | 44 ++--- .../idas_test_kpr_--eta_min_ef_0.5.out | 42 ++-- ..._kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out | 44 ++--- ...est_kpr_--eta_min_fx_1.0_--eta_min_0.5.out | 44 ++--- 169 files changed, 2286 insertions(+), 2311 deletions(-) delete mode 100644 cmake/tpl/FindTrilinos.cmake rename examples/arkode/CXX_parallel/{ark_brusselator1D_task_local_nls_--monitor.out => ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor.out} (100%) rename examples/arkode/CXX_parallel/{ark_brusselator1D_task_local_nls_--monitor_--explicit_--tf_1.out => ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--explicit_--tf_1.out} (100%) rename examples/arkode/CXX_parallel/{ark_brusselator1D_task_local_nls_--monitor_--global-nls.out => ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--global-nls.out} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a82dd8621..247f6f26ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,13 @@ Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. +The Trilinos Teptra NVector interface has been updated to utilize CMake +imported targets added in Trilinos 14 to improve support for different Kokkos +backends with Trilinos. As such, Trilinos 14 or newer is required and the +`Trilinos_INTERFACE_*` CMake options have been removed. + +Example programs using *hypre* have been updated to support v2.20 and newer. + ### Bug Fixes Fixed the loading of ARKStep's default first order explicit method. @@ -19,6 +26,9 @@ Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated `CUDA_ARCH` option was used. +Fixed compilation errors when building the Trilinos Teptra NVector with CUDA +support. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.1 diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 090c1f5b26..2c139fc356 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -24,8 +24,10 @@ sundials_option(BENCHMARK_NVECTOR BOOL "NVector benchmarks are on" ON) # Disable some warnings for benchmarks if(ENABLE_ALL_WARNINGS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-unused-function") + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wno-unused-parameter -Wno-unused-function") endif() # ---------------------------------------- diff --git a/benchmarks/advection_reaction_3D/raja/backends.hpp b/benchmarks/advection_reaction_3D/raja/backends.hpp index c7cbd790ee..c258c68598 100644 --- a/benchmarks/advection_reaction_3D/raja/backends.hpp +++ b/benchmarks/advection_reaction_3D/raja/backends.hpp @@ -114,12 +114,23 @@ using XYZ_KERNEL_POL = #else #define NVECTOR_ID_STRING "Serial" -using EXEC_POLICY = RAJA::seq_exec; -using XYZ_KERNEL_POL = RAJA::KernelPolicy<RAJA::statement::For< + +#if RAJA_VERSION_MAJOR < 2024 +using EXEC_POLICY = RAJA::seq_exec; +using XYZ_KERNEL_POL = RAJA::KernelPolicy<RAJA::statement::For< 2, RAJA::loop_exec, RAJA::statement::For< 1, RAJA::loop_exec, RAJA::statement::For<0, RAJA::loop_exec, RAJA::statement::Lambda<0>>>>>; +#else +using EXEC_POLICY = RAJA::seq_exec; +using XYZ_KERNEL_POL = RAJA::KernelPolicy<RAJA::statement::For< + 2, RAJA::seq_exec, + RAJA::statement::For< + 1, RAJA::seq_exec, + RAJA::statement::For<0, RAJA::seq_exec, RAJA::statement::Lambda<0>>>>>; +#endif + constexpr auto LocalNvector = N_VNew_Serial; #define CopyVecFromDevice(v) diff --git a/cmake/SUNDIALSConfig.cmake.in b/cmake/SUNDIALSConfig.cmake.in index 9cbe9e6c23..399309f67e 100644 --- a/cmake/SUNDIALSConfig.cmake.in +++ b/cmake/SUNDIALSConfig.cmake.in @@ -161,10 +161,8 @@ if("@ENABLE_RAJA@" AND NOT TARGET RAJA) find_dependency(RAJA PATHS "@RAJA_DIR@") endif() -if("@ENABLE_TRILINOS@" AND NOT TARGET SUNDIALS::TRILINOS) - add_library(SUNDIALS::TRILINOS INTERFACE IMPORTED) - target_link_libraries(SUNDIALS::TRILINOS INTERFACE "@Trilinos_LIBRARIES@") - set_target_properties(SUNDIALS::TRILINOS PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@Trilinos_INCLUDE_DIRS@") +if("@ENABLE_TRILINOS@" AND NOT TARGET Tpetra::all_libs) + find_dependency(Trilinos COMPONENTS Tpetra PATHS "@Trilinos_DIR@") endif() if("@ENABLE_XBRAID@" AND NOT TARGET SUNDIALS::XBRAID) diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index e914eefd1f..d6d02c5565 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -123,7 +123,7 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_RAJA") sundials_option( BUILD_NVECTOR_TRILINOS BOOL "Build the NVECTOR_TRILINOS module (requires Trilinos)" ON - DEPENDS_ON ENABLE_TRILINOS Trilinos_WORKS + DEPENDS_ON ENABLE_TRILINOS ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_TRILINOS") diff --git a/cmake/SundialsSetupConfig.cmake b/cmake/SundialsSetupConfig.cmake index e1ea1f1929..7000a90396 100644 --- a/cmake/SundialsSetupConfig.cmake +++ b/cmake/SundialsSetupConfig.cmake @@ -65,7 +65,7 @@ foreach(tpl ${SUNDIALS_TPL_LIST}) endforeach() # prepare substitution variable SUNDIALS_TRILINOS_HAVE_MPI for sundials_config.h -if(Trilinos_MPI) +if(ENABLE_MPI) set(SUNDIALS_TRILINOS_HAVE_MPI TRUE) endif() diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 9d186c887f..291709c8a8 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -269,42 +269,6 @@ sundials_option(ENABLE_TRILINOS BOOL "Enable Trilinos support" OFF) sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" "${Trilinos_DIR}" DEPENDS_ON ENABLE_TRILINOS) -sundials_option( - Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" - "${Trilinos_CXX_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option( - Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" - "${Trilinos_C_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option( - Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING - "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option( - Trilinos_INTERFACE_C_COMPILER_FLAGS STRING - "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option( - Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" - "${Trilinos_MPI_EXEC}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option( - Trilinos_WORKS BOOL - "Set to ON to force CMake to accept a given Trilinos configuration" OFF - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - # --------------------------------------------------------------- # Enable XBraid support? # --------------------------------------------------------------- diff --git a/cmake/tpl/FindHYPRE.cmake b/cmake/tpl/FindHYPRE.cmake index 156356b24e..c9f0fa1258 100644 --- a/cmake/tpl/FindHYPRE.cmake +++ b/cmake/tpl/FindHYPRE.cmake @@ -59,8 +59,7 @@ else() HYPRE_LIBRARY NAMES ${HYPRE_LIBRARY_NAMES} HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/lib" "${HYPRE_DIR}/lib64" - "${HYPRE_LIBRARY_DIR}" - NO_DEFAULT_PATH) + "${HYPRE_LIBRARY_DIR}") endif() mark_as_advanced(HYPRE_LIBRARY) @@ -71,6 +70,23 @@ if(_idx EQUAL -1) CACHE STRING "" FORCE) endif() +# Extract version parts from the version information +if(HYPRE_INCLUDE_DIR) + + # HYPRE_config.h file added in at least v2.11.0 (possibly sooner) + find_file(HYPRE_CONFIG_FILE HYPRE_config.h PATHS "${HYPRE_INCLUDE_DIR}") + + file(STRINGS "${HYPRE_CONFIG_FILE}" _hypre_release_version + REGEX "HYPRE_RELEASE_VERSION") + string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" HYPRE_VERSION + "${_hypre_release_version}") + string(REGEX MATCHALL "[0-9]+" _hypre_version_numbers "${HYPRE_VERSION}") + list(GET _hypre_version_numbers 0 HYPRE_VERSION_MAJOR) + list(GET _hypre_version_numbers 1 HYPRE_VERSION_MINOR) + list(GET _hypre_version_numbers 2 HYPRE_VERSION_PATCH) + +endif() + # set a more informative error message in case the library was not found set(HYPRE_NOT_FOUND_MESSAGE "\ @@ -83,6 +99,7 @@ ERROR: Could not find HYPRE. Please check the variables:\n\ find_package_handle_standard_args( HYPRE REQUIRED_VARS HYPRE_LIBRARY HYPRE_LIBRARIES HYPRE_INCLUDE_DIR + VERSION_VAR HYPRE_VERSION FAIL_MESSAGE "${HYPRE_NOT_FOUND_MESSAGE}") # Create target for HYPRE diff --git a/cmake/tpl/FindTrilinos.cmake b/cmake/tpl/FindTrilinos.cmake deleted file mode 100644 index 42be691041..0000000000 --- a/cmake/tpl/FindTrilinos.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# ----------------------------------------------------------------------------- -# Programmer(s): Slaven Peles and Cody J. Balos @ LLNL -# ----------------------------------------------------------------------------- -# SUNDIALS Copyright Start -# Copyright (c) 2002-2024, 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 -# ----------------------------------------------------------------------------- -# Find module for Trilinos that uses the TrilinosConfig.cmake that is installed -# with Trilinos. The module will also create a SUNDIALS::TRILINOS target. -# ----------------------------------------------------------------------------- - -# First try and find Trilinos using Trilinos_DIR only. -find_package( - Trilinos - NAMES - Trilinos - TRILINOS - PATHS - ${Trilinos_DIR}/lib/cmake/Trilinos - ${Trilinos_DIR} - NO_DEFAULT_PATH - QUIET) - -# set package variables including Trilinos_FOUND -find_package_handle_standard_args( - Trilinos - REQUIRED_VARS Trilinos_LIBRARIES # defined in TrilinosConfig.cmake - Trilinos_INCLUDE_DIRS # defined in TrilinosConfig.cmake -) - -# Create Trilinos target -if(Trilinos_FOUND) - - if(NOT TARGET SUNDIALS::TRILINOS) - add_library(SUNDIALS::TRILINOS IMPORTED INTERFACE) - endif() - - set_target_properties( - SUNDIALS::TRILINOS - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Trilinos_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${Trilinos_LIBRARIES}") - -endif() diff --git a/cmake/tpl/SundialsTrilinos.cmake b/cmake/tpl/SundialsTrilinos.cmake index 7f8940ef90..ea6aa6393b 100644 --- a/cmake/tpl/SundialsTrilinos.cmake +++ b/cmake/tpl/SundialsTrilinos.cmake @@ -26,11 +26,7 @@ # Section 1: Include guard # ----------------------------------------------------------------------------- -if(NOT DEFINED SUNDIALS_TRILINOS_INCLUDED) - set(SUNDIALS_TRILINOS_INCLUDED) -else() - return() -endif() +include_guard(GLOBAL) # ----------------------------------------------------------------------------- # Section 2: Check to make sure options are compatible @@ -41,144 +37,20 @@ endif() # ----------------------------------------------------------------------------- # Find Trilinos -find_package(Trilinos REQUIRED) +find_package( + Trilinos REQUIRED + COMPONENTS Tpetra HINTS "${Trilinos_DIR}/lib/cmake/Trilinos" + "${Trilinos_DIR}") -# Check if Trilinos was built with MPI Starting with TriBITS 2022-10-16 -# <Project_TPL_LIST> is no longer defined so we base MPI support on ENABLE_MPI -if(Trilinos_TPL_LIST) - if(";${Trilinos_TPL_LIST};" MATCHES ";MPI;") - set(Trilinos_MPI TRUE) - else() - set(Trilinos_MPI FALSE) - endif() -else() - if(ENABLE_MPI) - set(Trilinos_MPI TRUE) - else() - set(Trilinos_MPI FALSE) - endif() -endif() - -# For XSDK compatibility, only use the user/spack provided compiler and flags to -# build SUNDIALS modules that use Trilinos. If we are not in XSDK mode, we can -# use the imported Trilinos compiler and flags by default, but allow the user to -# change it through CMake the Trilinos_INTERFACE_* options. - -if(USE_XSDK_DEFAULTS) - if(Trilinos_MPI AND MPI_CXX_FOUND) - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING - "C++ compiler for Trilinos interface" "${MPI_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND - ${Trilinos_MPI} - CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") - else() - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING - "C compiler for Trilinos interface" "${CMAKE_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND - FALSE - CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") - endif() - if(Trilinos_MPI AND MPI_C_FOUND) - force_variable(Trilinos_INTERFACE_C_COMPILER STRING - "C compiler for Trilinos interface" "${MPI_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND - ${Trilinos_MPI} - CACHE INTERNAL "Is Trilinos interface C compiler MPI") - else() - force_variable(Trilinos_INTERFACE_C_COMPILER STRING - "C compiler for Trilinos interface" "${CMAKE_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND - FALSE - CACHE INTERNAL "Is Trilinos interface C compiler MPI") - endif() - force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING - "C++ compiler flags specific to Trilinos interface" "") - force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING - "C compiler flags specific to Trilinos interface" "") - force_variable( - Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" - "${MPIEXEC_EXECUTABLE}") -else() - force_variable( - Trilinos_INTERFACE_CXX_COMPILER STRING - "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}") - force_variable(Trilinos_INTERFACE_C_COMPILER STRING - "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}") - force_variable( - Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING - "C++ compiler flags for Trilinos interface" - "${Trilinos_CXX_COMPILER_FLAGS}") - force_variable( - Trilinos_INTERFACE_C_COMPILER_FLAGS STRING - "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}") - force_variable(Trilinos_INTERFACE_MPIEXEC STRING - "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND - ${Trilinos_MPI} - CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") - set(Trilinos_INTERFACE_MPI_C_FOUND - ${Trilinos_MPI} - CACHE INTERNAL "Is Trilinos interface C compiler MPI") -endif() - -message(STATUS "Trilinos_MPI: ${Trilinos_MPI}") -message(STATUS "Trilinos_LIBRARIES: ${Trilinos_LIBRARIES}") -message(STATUS "Trilinos_INCLUDE_DIRS: ${Trilinos_INCLUDE_DIRS}") +message(STATUS "Trilinos Libraries: ${Trilinos_LIBRARIES}") +message(STATUS "Trilinos Includes: ${Trilinos_INCLUDE_DIRS}") +message(STATUS "Trilinos Devices: ${Kokkos_DEVICES}") # ----------------------------------------------------------------------------- # Section 4: Test the TPL # ----------------------------------------------------------------------------- -if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) - # Do any checks which don't require compilation first. - - # Create the Trilinos_TEST directory - set(Trilinos_TEST_DIR ${PROJECT_BINARY_DIR}/Trilinos_TEST) - file(MAKE_DIRECTORY ${Trilinos_TEST_DIR}) - - # Create a CMakeLists.txt file - file( - WRITE ${Trilinos_TEST_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest CXX)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_CXX_COMPILER \"${Trilinos_INTERFACE_CXX_COMPILER}\")\n" - "SET(CMAKE_CXX_STANDARD \"${CMAKE_CXX_STANDARD}\")\n" - "SET(CMAKE_CXX_FLAGS \"${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}\")\n" - "SET(Trilinos_DIR \"${Trilinos_DIR}\")\n" - "INCLUDE(FindPackageHandleStandardArgs)\n" - "INCLUDE(${PROJECT_SOURCE_DIR}/cmake/tpl/FindTrilinos.cmake)\n" - "ADD_EXECUTABLE(ltest ltest.cpp)\n" - "TARGET_LINK_LIBRARIES(ltest SUNDIALS::TRILINOS)\n") - - # Create a C++ source file which calls a Trilinos function - file(WRITE ${Trilinos_TEST_DIR}/ltest.cpp - "#include <Tpetra_Version.hpp>\n" "int main(void) {\n" - "std::cout << Tpetra::version() << std::endl;\n" "return(0);\n" "}\n") - - # Attempt to build and link the "ltest" executable - try_compile( - COMPILE_OK ${Trilinos_TEST_DIR} - ${Trilinos_TEST_DIR} ltest - OUTPUT_VARIABLE COMPILE_OUTPUT) - - # Process test result - if(COMPILE_OK) - message(STATUS "Checking if Trilinos works with SUNDIALS... OK") - set(Trilinos_WORKS - TRUE - CACHE BOOL "Trilinos works with SUNDIALS as configured" FORCE) - else() - message(STATUS "Checking if Trilinos works with SUNDIALS... FAILED") - message(STATUS "Check output: ") - message("${COMPILE_OUTPUT}") - message(FATAL_ERROR "SUNDIALS interface to Trilinos is not functional.") - endif() - -elseif(Trilinos_FOUND AND Trilinos_WORKS) - message( - STATUS - "Skipped Trilinos tests, assuming Trilinos works with SUNDIALS. Set Trilinos_WORKS=FALSE to (re)run compatibility test." - ) -endif() +# Does not currently work with Trilinos imported targets due to an error from +# evaluating generator expression: $<LINK_LANGUAGE:CXX> may only be used with +# binary targets to specify link libraries, link directories, link options and +# link depends. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 0cd3986ee3..ed8b0b13a6 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -8,6 +8,13 @@ only valid for Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. +The Trilinos Tpetra NVector interface has been updated to utilize CMake +imported targets added in Trilinos 14 to improve support for different Kokkos +backends with Trilinos. As such, Trilinos 14 or newer is required and the +``Trilinos_INTERFACE_*`` CMake options have been removed. + +Example programs using *hypre* have been updated to support v2.20 and newer. + **Bug Fixes** Fixed the loading of ARKStep's default first order explicit method. @@ -15,4 +22,7 @@ Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated ``CUDA_ARCH`` option was used. +Fixed compilation errors when building the Trilinos Teptra NVector with CUDA +support. + **Deprecation Notices** diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 3d730dd594..f80b9f8fa5 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -1060,6 +1060,18 @@ illustration only. Default: OFF +.. cmakeoption:: ENABLE_TRILINOS + + Enable Trilinos (Tpetra) support + + Default: OFF + +.. cmakeoption:: Trilinos_DIR + + Path to the Trilinos installation. + + Default: None + .. cmakeoption:: ENABLE_CALIPER Enable CALIPER support @@ -1590,6 +1602,25 @@ repository. SUNDIALS has been tested with XBraid version 3.0.0. +.. _Installation.CMake.ExternalLibraries.Trilinos: + +Building with Trilinos +^^^^^^^^^^^^^^^^^^^^^^ + +`Trilinos <https://trilinos.github.io/>`_ is a collection of C++ libraries of +linear solvers, non-linear solvers, optimization solvers, etc. To enable the +SUNDIALS interface to the Trilinos Tpetra vector, set the +:cmakeop:`ENABLE_TRILINOS` to ``ON`` and provide the path to the root of the +Trilinos installation in :cmakeop:`Trilinos_DIR`. + +.. code-block:: bash + + % cmake \ + > -DENABLE_TRILONOS=ON \ + > -DTRILINOS_DIR=/path/to/ginkgo/installation \ + > /home/myname/sundials/srcdir + + .. _Installation.CMake.Testing: Testing the build and installation diff --git a/examples/arkode/CXX_parallel/CMakeLists.txt b/examples/arkode/CXX_parallel/CMakeLists.txt index 2ebc00df7e..05b2a87861 100644 --- a/examples/arkode/CXX_parallel/CMakeLists.txt +++ b/examples/arkode/CXX_parallel/CMakeLists.txt @@ -175,9 +175,9 @@ if(ENABLE_RAJA # ------------- set(serial_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --explicit --tf 1\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_SERIAL_NVEC\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_SERIAL_NVEC\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_SERIAL_NVEC\;--monitor --explicit --tf 1\;1\;4\;develop\;2" ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx) build_examples(serial_raja_examples CXX) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor.out b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor.out similarity index 100% rename from examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor.out rename to examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor.out diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor_--explicit_--tf_1.out b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--explicit_--tf_1.out similarity index 100% rename from examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor_--explicit_--tf_1.out rename to examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--explicit_--tf_1.out diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--global-nls.out similarity index 100% rename from examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out rename to examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.USE_SERIAL_NVEC_--monitor_--global-nls.out 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 b5029ca9a5..a44b52ea67 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -93,12 +93,14 @@ using EXEC_POLICY = RAJA::hip_exec<512, false>; constexpr auto LocalNvector = N_VNew_Hip; constexpr auto CopyVecFromDevice = N_VCopyFromDevice_Hip; -#else +#elif USE_SERIAL_NVEC #define NVECTOR_ID_STRING "Serial" using EXEC_POLICY = RAJA::seq_exec; constexpr auto LocalNvector = N_VNew_Serial; #define CopyVecFromDevice(v) +#else +#error "Unknown backend" #endif // USE_RAJA_NVEC #ifdef USE_CUDA_OR_HIP @@ -1355,9 +1357,11 @@ int EnableFusedVectorOps(N_Vector y) #elif defined(USE_OMPDEV_NVEC) retval = N_VEnableFusedOps_OpenMPDEV(N_VGetLocalVector_MPIPlusX(y), 1); if (check_retval(&retval, "N_VEnableFusedOps_OpenMPDEV", 1)) return (-1); -#else +#elif defined(USE_SERIAL_NVEC) retval = N_VEnableFusedOps_Serial(N_VGetLocalVector_MPIPlusX(y), 1); if (check_retval(&retval, "N_VEnableFusedOps_Serial", 1)) { return (-1); } +#else +#error "Unknown backend" #endif return (0); @@ -1562,11 +1566,13 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, udata->Erecv = (double*)omp_target_alloc(udata->nvar * sizeof(double), dev); if (check_retval((void*)udata->Erecv, "omp_target_alloc", 0)) return 1; -#else +#elif defined(USE_SERIAL_NVEC) udata->Wsend = new double[udata->nvar]; udata->Wrecv = new double[udata->nvar]; udata->Esend = new double[udata->nvar]; udata->Erecv = new double[udata->nvar]; +#else +#error "Unknown backend" #endif /* Create the solution masks */ @@ -1670,11 +1676,13 @@ UserData::~UserData() omp_target_free(Wrecv); omp_target_free(Esend); omp_target_free(Erecv); -#else +#elif USE_SERIAL_NVEC delete[] Wsend; delete[] Wrecv; delete[] Esend; delete[] Erecv; +#else +#error "Unknown backend" #endif /* close output streams */ 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 eb6c3b2f7a..9b913a3b91 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 @@ -61,16 +61,16 @@ 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 + 5.500000000000000e+00 3.343640002216235e+00 + 6.000000000000000e+00 3.233844046127573e+00 + 6.500000000000000e+00 3.082251062694890e+00 + 7.000000000000000e+00 2.890585369424727e+00 + 7.500000000000000e+00 2.837315452756403e+00 + 8.000000000000000e+00 2.898424893360023e+00 + 8.500000000000000e+00 3.140291028418674e+00 + 9.000000000000000e+00 3.442457327179101e+00 + 9.500000000000000e+00 3.740600281376645e+00 + 1.000000000000000e+01 4.014633156501281e+00 ---------------------------------------------- Final integrator statistics: @@ -80,17 +80,17 @@ Slow Integrator: RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 2640 + LS iters = 2641 LS fails = 0 LS setups = 0 - LS RHS evals = 2640 - Jv products = 2640 + LS RHS evals = 2641 + Jv products = 2641 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 6.666667 + Avg LS iters per NLS iter = 6.669192 Preconditioner setups = 0 - Preconditioner solves = 2640 + Preconditioner solves = 2641 Fast Integrator: Steps = 2057 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 2069d3daf0..0dd0389711 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 @@ -63,14 +63,14 @@ 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 + 6.500000000000000e+00 3.082406527906665e+00 + 7.000000000000000e+00 2.890736516064349e+00 + 7.500000000000000e+00 2.837432528460562e+00 + 8.000000000000000e+00 2.898441248595020e+00 + 8.500000000000000e+00 3.140256919387674e+00 + 9.000000000000000e+00 3.442407086782958e+00 + 9.500000000000000e+00 3.740539247767240e+00 + 1.000000000000000e+01 4.014559182371761e+00 ---------------------------------------------- Final integrator statistics: 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 7ab208a80b..015642ed18 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 @@ -45,18 +45,18 @@ 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 + 4.500000000000000e-01 9.023693955015859e-03 3.135810295420080e-04 + 4.999999999999999e-01 5.528701560828762e-05 1.158664423513919e-04 + 5.499999999999999e-01 8.918915917892657e-03 7.372606708900761e-05 + 6.000000000000000e-01 3.475275193022622e-02 1.914158609587074e-04 + 6.500000000000000e-01 7.502609251490090e-02 4.577116702588202e-04 + 7.000000000000001e-01 1.257965751111169e-01 8.461653361390153e-04 + 7.500000000000001e-01 1.820941861365472e-01 1.318095291393762e-03 + 8.000000000000002e-01 2.384093995701346e-01 1.830603310791989e-03 + 8.500000000000002e-01 2.892274536261998e-01 2.327914469715142e-03 + 9.000000000000002e-01 3.295751200290455e-01 2.764242715480814e-03 + 9.500000000000003e-01 3.555039203482325e-01 3.099492713609875e-03 + 1.000000000000000e+00 3.644737419511721e-01 3.296010382883741e-03 ----------------------------------------------------------------------- Final integrator statistics: @@ -66,16 +66,16 @@ Final integrator statistics: RHS evals = 753 NLS iters = 375 NLS fails = 0 - LS iters = 12925 + LS iters = 12926 LS fails = 36 LS setups = 56 - LS RHS evals = 12925 - Jv products = 12925 + LS RHS evals = 12926 + Jv products = 12926 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 34.466667 + Avg LS iters per NLS iter = 34.469333 Preconditioner setups = 4 - Preconditioner solves = 12925 + Preconditioner solves = 12926 - Max error = 3.296010382116465e-03 + Max error = 3.296010382883741e-03 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index e80c842bd4..14786d9c98 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -382,6 +382,13 @@ int main(int argc, char* argv[]) flag = SUNContext_Create(comm_w, &ctx); if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // Set output process flag bool outproc = (myid == 0); @@ -592,6 +599,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + ARKodeFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver SUNMatDestroy(A); // Free matrix 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 caced8662d..b39cea2617 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 @@ -49,16 +49,16 @@ 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 + 5.499999999999999e-01 9.040623249804480e-03 1.797011257116676e-05 + 6.000000000000000e-01 3.526521493542879e-02 4.668318201424271e-05 + 6.500000000000000e-01 7.611978800168766e-02 1.113065272941860e-04 + 7.000000000000001e-01 1.276052139795589e-01 2.055077733629229e-04 + 7.500000000000001e-01 1.846816872915429e-01 3.198180091369962e-04 + 8.000000000000002e-01 2.417622665897317e-01 4.436012686840352e-04 + 8.500000000000002e-01 2.932595626759314e-01 5.646812043708094e-04 + 9.000000000000002e-01 3.341325736187309e-01 6.709855218919314e-04 + 9.500000000000003e-01 3.603805168237892e-01 7.524532351735891e-04 + 1.000000000000000e+00 3.694333172786592e-01 7.994041731184121e-04 ----------------------------------------------------------------------- Final integrator statistics: @@ -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.994041731159696e-04 + Max error = 7.994041731184121e-04 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index 51e2673424..d408bcdf78 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -339,6 +339,13 @@ int main(int argc, char* argv[]) flag = SUNContext_Create(comm_w, &ctx); if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // Set output process flag bool outproc = (myid == 0); @@ -597,6 +604,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + ARKodeFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors 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 caa5aaa5ad..ddf689ac47 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -339,6 +339,13 @@ int main(int argc, char* argv[]) // Create SUNDIALS context sundials::Context sunctx(comm_w); + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // ------------------------------------------ // Setup UserData and parallel decomposition // ------------------------------------------ @@ -539,6 +546,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + ARKodeFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors 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 da67100875..aa75c8b61c 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -346,6 +346,12 @@ int main(int argc, char* argv[]) // Create SUNDIALS context sundials::Context sunctx(comm_w); +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // ------------------------------------------ // Setup UserData and parallel decomposition // ------------------------------------------ @@ -605,6 +611,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + ARKodeFree(&arkode_mem); // Free slow integrator memory ARKodeFree(&inner_arkode_mem); // Free fast integrator memory MRIStepInnerStepper_Free(&inner_stepper); // Free inner stepper diff --git a/examples/arkode/CXX_serial/ark_heat2D.out b/examples/arkode/CXX_serial/ark_heat2D.out index 07fbd3c159..c7146f1b2b 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.out +++ b/examples/arkode/CXX_serial/ark_heat2D.out @@ -33,24 +33,24 @@ 0.000000000000000e+00 3.632812500000000e-01 0.000000000000000e+00 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 + 1.500000000000000e-01 2.894441909307264e-01 2.832303876386777e-03 + 2.000000000000000e-01 2.387114783346062e-01 2.525802281702627e-03 + 2.500000000000000e-01 1.824256479329715e-01 2.078269451951664e-03 + 3.000000000000000e-01 1.261168083582418e-01 1.580109388325313e-03 + 3.500000000000000e-01 7.529981276644941e-02 1.084790361132459e-03 + 4.000000000000000e-01 3.495180902493194e-02 6.472682865382440e-04 + 4.500000000000000e-01 9.023693953952201e-03 3.135810269774553e-04 + 4.999999999999999e-01 5.528701564976438e-05 1.158664424579011e-04 + 5.499999999999999e-01 8.918915918150624e-03 7.372606719366695e-05 + 6.000000000000000e-01 3.475275193254342e-02 1.914158656317888e-04 + 6.500000000000000e-01 7.502609250596767e-02 4.577116486274846e-04 + 7.000000000000001e-01 1.257965751168525e-01 8.461653407310088e-04 + 7.500000000000001e-01 1.820941861476670e-01 1.318095319222168e-03 + 8.000000000000002e-01 2.384093995816105e-01 1.830603307639511e-03 + 8.500000000000002e-01 2.892274536103360e-01 2.327914403585929e-03 + 9.000000000000002e-01 3.295751199825840e-01 2.764242586895782e-03 + 9.500000000000003e-01 3.555039203016255e-01 3.099492598853892e-03 + 1.000000000000000e+00 3.644737419736066e-01 3.296010432179086e-03 ----------------------------------------------------------------------- Final integrator statistics: @@ -60,16 +60,16 @@ Final integrator statistics: RHS evals = 753 NLS iters = 375 NLS fails = 0 - LS iters = 12926 - LS fails = 37 + LS iters = 12927 + LS fails = 36 LS setups = 56 - LS RHS evals = 12926 - Jv products = 12926 + LS RHS evals = 12927 + Jv products = 12927 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 34.469333 + Avg LS iters per NLS iter = 34.472000 Preconditioner setups = 4 - Preconditioner solves = 12926 + Preconditioner solves = 12927 - Max error = 3.296010393803339e-03 + Max error = 3.296010432179086e-03 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 b27df8ddb3..a662ca0306 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 @@ -19,7 +19,7 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: -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.200000 0.840089 1.091560 4.63e-10 2.29e-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 @@ -84,8 +84,8 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: 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.300000 0.894204 1.041074 4.18e-10 8.17e-12 + 4.400000 0.919964 1.023913 7.04e-12 4.12e-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 @@ -102,7 +102,7 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: 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.100000 1.221325 1.348272 7.60e-10 6.05e-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 @@ -125,4 +125,4 @@ Final Solver Statistics: Total linear solver setups = 0 Total number of Nonlinear iterations = 36712 Total number of Nonlinear convergence failures = 1130 - Errors: u = 7.56688e-08, v = 4.52391e-10, total = 5.35069e-08 + Errors: u = 7.56688e-08, v = 4.5239e-10, total = 5.35069e-08 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 8f2cfc2057..c652708cf1 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out +++ b/examples/arkode/CXX_serial/ark_kpr_Mt_1_4.out @@ -79,7 +79,7 @@ Nonlinear Kvaerno-Prothero-Robinson test problem with mass matrix: 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.800000 0.777505 1.178189 1.74e-06 5.19e-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 diff --git a/examples/arkode/CXX_serial/ark_pendulum.out b/examples/arkode/CXX_serial/ark_pendulum.out index d2ff98a75c..3731825864 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.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 + 1000 1.225851561786450e+00 3.464109134211063e-01 2.123155979447245e+00 5.846976941318597e-01 -5.551115123125783e-16 + 2000 2.418921543882608e+00 -6.603296538020499e-01 1.946234339702692e+00 5.846976941317183e-01 -1.418865025470950e-13 + 3000 3.660145898154469e+00 -1.735667181339737e+00 3.986842131931391e-01 5.846976941317146e-01 -1.456612608308205e-13 + 4000 4.623633228460875e+00 -1.372222744424223e+00 -1.205956213413156e+00 5.846976941317116e-01 -1.486588629973085e-13 + 5000 5.935194112987728e+00 -1.554657188553769e-01 -2.180485787130640e+00 5.846976941317086e-01 -1.516564651637964e-13 + 6000 7.205549998128942e+00 9.556191519474134e-01 -1.699242944703125e+00 5.846976941316105e-01 -2.496891582381977e-13 + 7000 8.435071967628154e+00 1.776079125914080e+00 1.222986509241673e-01 5.846976941316141e-01 -2.461364445593972e-13 + 8000 9.428792778266162e+00 1.053566258330932e+00 1.600497457231273e+00 5.846976941316125e-01 -2.476907567938724e-13 --------------------------------------------------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 8552 (attempted = 8562) - Total number of error test failures = 10 - Total RHS evals: Fe = 0, Fi = 35561 - 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 + Internal solver steps = 8416 (attempted = 8425) + Total number of error test failures = 9 + Total RHS evals: Fe = 0, Fi = 35032 + Total number of Newton iterations = 26624 + Total number of linear solver convergence failures = 10 + Total linear solver setups = 459 + Total number of Jacobian evaluations = 147 Total RHS evals for setting up the linear system = 0 - Total Relaxation Fn evals = 25424 - Total Relaxation Jac evals = 25424 + Total Relaxation Fn evals = 25036 + Total Relaxation Jac evals = 25036 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 8300 + Total Relaxation NLS iters = 8186 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 0dd094d8b6..987ba94a5d 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -375,6 +375,13 @@ int main(int argc, char* argv[]) flag = SUNContext_Create(comm_w, &ctx); if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // Set output process flag bool outproc = (myid == 0); @@ -701,6 +708,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + ARKodeFree(&arkode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors 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 978c7d9928..e8bf3bb4cf 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,7 +45,7 @@ output = 1 --------------------------------- - Max error = 3.297223495382084e-03 + Max error = 3.297223495728918e-03 Final max integrator statistics: Steps = 1780 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 744747849a..b9a01b542f 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,7 +42,7 @@ output = 1 --------------------------------- - Max error = 3.297223330406052e-03 + Max error = 3.297223209148270e-03 Final max integrator statistics: Steps = 1780 @@ -51,15 +51,15 @@ Final max integrator statistics: RHS evals = 12460 NLS iters = 5340 NLS fails = 0 - LS iters = 188622 + LS iters = 188490 LS fails = 0 LS setups = 1780 - LS RHS evals = 188622 - Jv products = 188622 + LS RHS evals = 188490 + Jv products = 188490 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 35.322472 + Avg LS iters per NLS iter = 35.297753 Preconditioner setups = 1780 - Preconditioner solves = 188622 + Preconditioner solves = 188490 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 90b4dedf7a..2f66e11ae8 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,7 +37,7 @@ output = 1 --------------------------------- - Max error = 3.297223425028251e-03 + Max error = 3.297223554637685e-03 Final max integrator statistics: Steps = 895 @@ -46,15 +46,15 @@ Final max integrator statistics: RHS evals = 6265 NLS iters = 2685 NLS fails = 0 - LS iters = 97779 + LS iters = 97791 LS fails = 0 LS setups = 895 - LS RHS evals = 97779 - Jv products = 97779 + LS RHS evals = 97791 + Jv products = 97791 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 36.416760 + Avg LS iters per NLS iter = 36.421229 Preconditioner setups = 895 - Preconditioner solves = 97779 + Preconditioner solves = 97791 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 c76464681c..a35437e611 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -180,7 +180,7 @@ typedef struct #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) /* SUNNonlinearSolver constructor */ -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); +static SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y); /* * RHS functions provided to the integrator @@ -352,7 +352,8 @@ int main(int argc, char* argv[]) } /* Setup ARKODE and evolve problem in time with IMEX method*/ -int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext ctx) +static int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, + SUNContext ctx) { void* arkode_mem = NULL; /* empty ARKODE memory structure */ SUNNonlinearSolver NLS = NULL; /* empty nonlinear solver structure */ @@ -503,8 +504,8 @@ int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, SUNContext c } /* Setup ARKODE and evolve problem in time explicitly */ -int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, - SUNContext ctx) +static int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, + SUNContext ctx) { void* arkode_mem = NULL; /* empty ARKODE memory structure */ double t, dtout, tout; /* current/output time data */ @@ -591,7 +592,7 @@ int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, } /* Write time and solution to disk */ -int WriteOutput(double t, N_Vector y, UserData udata, UserOptions uopt) +static int WriteOutput(double t, N_Vector y, UserData udata, UserOptions uopt) { long long i; long long nvar = udata->nvar; @@ -652,7 +653,7 @@ int WriteOutput(double t, N_Vector y, UserData udata, UserOptions uopt) } /* Initial Condition Functions */ -int SetIC(N_Vector y, UserData udata) +static int SetIC(N_Vector y, UserData udata) { /* Variable shortcuts */ long long nvar = udata->nvar; @@ -703,7 +704,7 @@ int SetIC(N_Vector y, UserData udata) * --------------------------------------------------------------*/ /* Compute the advection term. */ -int Advection(double t, N_Vector y, N_Vector ydot, void* user_data) +static int Advection(double t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData udata = (UserData)user_data; @@ -792,7 +793,7 @@ int Advection(double t, N_Vector y, N_Vector ydot, void* user_data) } /* Compute the reaction term. */ -int Reaction(double t, N_Vector y, N_Vector ydot, void* user_data) +static int Reaction(double t, N_Vector y, N_Vector ydot, void* user_data) { /* access problem data */ UserData udata = (UserData)user_data; @@ -858,7 +859,7 @@ int Reaction(double t, N_Vector y, N_Vector ydot, void* user_data) } /* Compute the RHS as Advection+Reaction. */ -int AdvectionReaction(double t, N_Vector y, N_Vector ydot, void* user_data) +static int AdvectionReaction(double t, N_Vector y, N_Vector ydot, void* user_data) { int retval; @@ -879,7 +880,7 @@ int AdvectionReaction(double t, N_Vector y, N_Vector ydot, void* user_data) * (Non)linear system functions * --------------------------------------------------------------*/ -int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) +static int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) { /* temporary variables */ UserData udata; @@ -926,7 +927,7 @@ int TaskLocalNlsResidual(N_Vector ycor, N_Vector F, void* arkode_mem) return (0); } -int TaskLocalLSolve(N_Vector delta, void* arkode_mem) +static int TaskLocalLSolve(N_Vector delta, void* arkode_mem) { /* local variables */ UserData udata = NULL; @@ -1027,12 +1028,12 @@ int TaskLocalLSolve(N_Vector delta, void* arkode_mem) return (retval); } -SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) +static SUNNonlinearSolver_Type TaskLocalNewton_GetType(SUNNonlinearSolver NLS) { return SUNNONLINEARSOLVER_ROOTFIND; } -SUNErrCode TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) +static SUNErrCode TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -1044,9 +1045,9 @@ SUNErrCode TaskLocalNewton_Initialize(SUNNonlinearSolver NLS) return (SUNNonlinSolInitialize(LOCAL_NLS(NLS))); } -int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, - N_Vector w, double tol, sunbooleantype callLSetup, - void* mem) +static int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, + N_Vector ycor, N_Vector w, double tol, + sunbooleantype callLSetup, void* mem) { /* local variables */ MPI_Comm comm; @@ -1080,7 +1081,7 @@ int TaskLocalNewton_Solve(SUNNonlinearSolver NLS, N_Vector y0, N_Vector ycor, return recover; } -SUNErrCode TaskLocalNewton_Free(SUNNonlinearSolver NLS) +static SUNErrCode TaskLocalNewton_Free(SUNNonlinearSolver NLS) { /* return if NLS is already free */ if (NLS == NULL) { return SUN_SUCCESS; } @@ -1106,8 +1107,8 @@ SUNErrCode TaskLocalNewton_Free(SUNNonlinearSolver NLS) return SUN_SUCCESS; } -SUNErrCode TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, - SUNNonlinSolSysFn SysFn) +static SUNErrCode TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, + SUNNonlinSolSysFn SysFn) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -1115,9 +1116,9 @@ SUNErrCode TaskLocalNewton_SetSysFn(SUNNonlinearSolver NLS, return (SUNNonlinSolSetSysFn(LOCAL_NLS(NLS), SysFn)); } -SUNErrCode TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, - SUNNonlinSolConvTestFn CTestFn, - void* ctest_data) +static SUNErrCode TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, + SUNNonlinSolConvTestFn CTestFn, + void* ctest_data) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -1125,8 +1126,8 @@ SUNErrCode TaskLocalNewton_SetConvTestFn(SUNNonlinearSolver NLS, return (SUNNonlinSolSetConvTestFn(LOCAL_NLS(NLS), CTestFn, ctest_data)); } -SUNErrCode TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, - long int* nconvfails) +static SUNErrCode TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, + long int* nconvfails) { /* check that the nonlinear solver is non-null */ if (NLS == NULL) { return SUN_ERR_ARG_CORRUPT; } @@ -1134,7 +1135,7 @@ SUNErrCode TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, return (GET_NLS_CONTENT(NLS)->ncnf); } -SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) +static SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { SUNNonlinearSolver NLS; TaskLocalNewton_Content content; @@ -1201,8 +1202,8 @@ SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) * --------------------------------------------------------------*/ /* Sets P = I - gamma * J */ -int PSetup(double t, N_Vector y, N_Vector ydot, sunbooleantype jok, - sunbooleantype* jcurPtr, double gamma, void* user_data) +static int PSetup(double t, N_Vector y, N_Vector ydot, sunbooleantype jok, + sunbooleantype* jcurPtr, double gamma, void* user_data) { /* local variables */ UserData udata = (UserData)user_data; @@ -1274,8 +1275,8 @@ int PSetup(double t, N_Vector y, N_Vector ydot, sunbooleantype jok, } /* Solves Pz = r */ -int PSolve(double t, N_Vector y, N_Vector ydot, N_Vector r, N_Vector z, - double gamma, double delta, int lr, void* user_data) +static int PSolve(double t, N_Vector y, N_Vector ydot, N_Vector r, N_Vector z, + double gamma, double delta, int lr, void* user_data) { /* local variables */ UserData udata = (UserData)user_data; @@ -1303,7 +1304,7 @@ int PSolve(double t, N_Vector y, N_Vector ydot, N_Vector r, N_Vector z, /* Exchanges the periodic BCs only by sending the first mesh node to the last processor. */ -int ExchangeBCOnly(N_Vector y, UserData udata) +static int ExchangeBCOnly(N_Vector y, UserData udata) { int var, ierr; MPI_Status stat; @@ -1360,7 +1361,7 @@ int ExchangeBCOnly(N_Vector y, UserData udata) } /* Starts the exchange of the neighbor information */ -int ExchangeAllStart(N_Vector y, UserData udata) +static int ExchangeAllStart(N_Vector y, UserData udata) { int var; int retval; @@ -1419,7 +1420,7 @@ int ExchangeAllStart(N_Vector y, UserData udata) } /* Completes the exchange of the neighbor information */ -int ExchangeAllEnd(UserData udata) +static int ExchangeAllEnd(UserData udata) { int ierr; MPI_Status stat; @@ -1445,8 +1446,8 @@ int ExchangeAllEnd(UserData udata) return 0; } -int SetupProblem(int argc, char* argv[], UserData udata, UserOptions uopt, - SUNContext ctx) +static int SetupProblem(int argc, char* argv[], UserData udata, + UserOptions uopt, SUNContext ctx) { /* local variables */ int i, retval; @@ -1736,7 +1737,7 @@ int SetupProblem(int argc, char* argv[], UserData udata, UserOptions uopt, return (0); } -void FreeProblem(UserData udata, UserOptions uopt) +static void FreeProblem(UserData udata, UserOptions uopt) { if (!uopt->explicit) { @@ -1777,7 +1778,7 @@ void FreeProblem(UserData udata, UserOptions uopt) } } -void InputError(char* name) +static void InputError(char* name) { int myid; @@ -1819,7 +1820,7 @@ void InputError(char* name) * opt == 1 means the function returns an integer where a * value < 0 indicates an error occurred * --------------------------------------------------------------*/ -int check_retval(void* returnvalue, const char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int *errvalue, myid; diff --git a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out index 8035ea4112..2af3945f09 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls_--monitor_--global-nls.out @@ -30,47 +30,47 @@ Output directory: . 1.000000 1.617972 2.789695 3.499972 1.250000 1.738611 2.525641 3.499970 1.500000 1.724313 2.346645 3.499970 - 1.750000 1.609332 2.267405 3.499972 - 2.000000 1.441938 2.284790 3.499975 - 2.250000 1.254548 2.387110 3.499978 - 2.500000 1.067861 2.552978 3.499982 - 2.750000 0.894914 2.755797 3.499985 - 3.000000 0.742698 2.972707 3.499988 - 3.250000 0.614424 3.189681 3.499990 + 1.750000 1.609332 2.267405 3.499980 + 2.000000 1.441938 2.284790 3.499964 + 2.250000 1.254548 2.387110 3.500108 + 2.500000 1.067861 2.552978 3.499971 + 2.750000 0.894914 2.755797 3.499978 + 3.000000 0.742698 2.972707 3.499968 + 3.250000 0.614424 3.189681 3.499987 3.500000 0.511703 3.400292 3.499992 3.750000 0.435022 3.602349 3.499993 4.000000 0.382884 3.795611 3.499993 4.250000 0.351268 3.980789 3.499994 4.500000 0.334675 4.159066 3.499994 - 4.750000 0.327999 4.331676 3.499994 - 5.000000 0.327576 4.499585 3.499994 + 4.750000 0.327999 4.331676 3.499996 + 5.000000 0.327576 4.499585 3.499998 5.250000 0.331182 4.663357 3.499994 5.500000 0.337619 4.823164 3.499994 - 5.750000 0.346346 4.978846 3.499994 - 6.000000 0.357245 5.129937 3.499994 - 6.250000 0.370526 5.275660 3.499994 - 6.500000 0.386740 5.414810 3.499993 - 6.750000 0.406897 5.545549 3.499993 + 5.750000 0.346346 4.978846 3.499754 + 6.000000 0.357245 5.129937 3.499811 + 6.250000 0.370526 5.275660 3.499996 + 6.500000 0.386740 5.414810 3.500062 + 6.750000 0.406897 5.545549 3.499988 7.000000 0.432797 5.664942 3.499992 7.250000 0.467856 5.767888 3.499992 7.500000 0.519324 5.844481 3.499991 - 7.750000 0.605996 5.871569 3.499989 + 7.750000 0.605996 5.871569 3.499969 8.000000 0.797170 5.775343 3.499986 8.250000 1.629022 5.135025 3.499974 8.500000 3.774898 3.499505 3.499941 8.750000 4.025788 2.194933 3.499932 9.000000 3.877379 0.967603 3.499933 - 9.250000 3.148899 1.087229 3.499946 + 9.250000 3.148899 1.087229 3.499958 9.500000 2.471560 1.322866 3.499958 9.750000 1.912340 1.594917 3.499967 - 10.000000 1.450253 1.896162 3.499975 + 10.000000 1.450253 1.896164 3.499975 Final Solver Statistics (for processor 0): - Internal solver steps = 482 (attempted = 482) - Total RHS evals: Fe = 1931, Fi = 4835 + Internal solver steps = 483 (attempted = 483) + Total RHS evals: Fe = 1935, Fi = 4845 Total number of error test failures = 0 Total number of nonlinear solver convergence failures = 2 - Total number of nonlinear iterations = 2904 - Total number of linear iterations = 9286 + Total number of nonlinear iterations = 2910 + Total number of linear iterations = 9307 Total number of preconditioner setups = 9 - Total number of preconditioner solves = 12085 + Total number of preconditioner solves = 12112 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 6ec12802af..33fd09b78d 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.out @@ -8,63 +8,63 @@ Preconditioner type is: jpre = SUN_PREC_LEFT 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 +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 = 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 +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 = 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 = 2.88e+04 no. steps = 4686 stepsize = 4.31e+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 = 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 = 3.60e+04 no. steps = 5981 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 = 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 = 4.32e+04 no. steps = 7170 stepsize = 4.78e+02 +At bottom left: c1, c2 = -3.557e-10 3.382e+11 +At top right: c1, c2 = 1.033e-09 3.804e+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.04e+04 no. steps = 7187 stepsize = 4.82e+02 +At bottom left: c1, c2 = -4.936e-07 3.358e+11 +At top right: c1, c2 = -1.075e-12 3.864e+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 = 5.76e+04 no. steps = 7202 stepsize = 3.74e+02 +At bottom left: c1, c2 = -9.646e-07 3.320e+11 +At top right: c1, c2 = 1.101e-19 3.909e+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 = 6.48e+04 no. steps = 7216 stepsize = 5.82e+02 +At bottom left: c1, c2 = 1.665e-07 3.313e+11 +At top right: c1, c2 = 3.501e-19 3.963e+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.20e+04 no. steps = 7228 stepsize = 5.82e+02 +At bottom left: c1, c2 = -1.045e-08 3.330e+11 +At top right: c1, c2 = -6.502e-20 4.039e+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 = 7.92e+04 no. steps = 7241 stepsize = 5.82e+02 +At bottom left: c1, c2 = -1.269e-07 3.334e+11 +At top right: c1, c2 = 4.639e-19 4.120e+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 +t = 8.64e+04 no. steps = 7253 stepsize = 5.82e+02 +At bottom left: c1, c2 = -3.193e-07 3.352e+11 +At top right: c1, c2 = -7.979e-21 4.163e+11 -Final Statistics: +Final Statistics: lenrw = 3902 leniw = 279 lenrwls = 2455 leniwls = 126 -nst = 7252 nfe = 0 -nfe = 76929 nfels = 102816 -nni = 40521 nli = 102816 -nsetups = 439 netf = 29 -npe = 122 nps = 140398 +nst = 7253 nfe = 0 +nfe = 76956 nfels = 102729 +nni = 40543 nli = 102729 +nsetups = 441 netf = 29 +npe = 122 nps = 140344 ncfn = 0 ncfl = 0 In ARKBBDPRE: real/integer local work space sizes = 1300, 192 @@ -77,64 +77,64 @@ In ARKBBDPRE: real/integer local work space sizes = 1300, 192 Preconditioner type is: jpre = SUN_PREC_RIGHT 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 +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 = 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 +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 = 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 = 2.88e+04 no. steps = 4684 stepsize = 4.55e+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 = 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 = 3.60e+04 no. steps = 5947 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 = 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 = 4.32e+04 no. steps = 7133 stepsize = 4.36e+02 +At bottom left: c1, c2 = -1.512e-12 3.382e+11 +At top right: c1, c2 = -1.226e-11 3.804e+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.04e+04 no. steps = 7150 stepsize = 4.19e+02 +At bottom left: c1, c2 = 8.712e-16 3.358e+11 +At top right: c1, c2 = -1.011e-06 3.864e+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 = 5.76e+04 no. steps = 7168 stepsize = 2.29e+02 +At bottom left: c1, c2 = 8.678e-21 3.320e+11 +At top right: c1, c2 = 9.801e-10 3.909e+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 = 6.48e+04 no. steps = 7181 stepsize = 6.37e+02 +At bottom left: c1, c2 = -1.578e-24 3.313e+11 +At top right: c1, c2 = 1.788e-09 3.963e+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.20e+04 no. steps = 7193 stepsize = 6.37e+02 +At bottom left: c1, c2 = -1.410e-23 3.330e+11 +At top right: c1, c2 = -9.726e-07 4.039e+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 = 7.92e+04 no. steps = 7204 stepsize = 6.37e+02 +At bottom left: c1, c2 = -1.897e-24 3.334e+11 +At top right: c1, c2 = -1.322e-06 4.120e+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 +t = 8.64e+04 no. steps = 7215 stepsize = 6.37e+02 +At bottom left: c1, c2 = 3.801e-23 3.352e+11 +At top right: c1, c2 = 3.984e-11 4.163e+11 -Final Statistics: +Final Statistics: lenrw = 3902 leniw = 284 lenrwls = 2455 leniwls = 126 -nst = 7427 nfe = 0 -nfe = 78794 nfels = 111450 -nni = 41511 nli = 111450 -nsetups = 453 netf = 29 -npe = 125 nps = 149218 -ncfn = 0 ncfl = 38 +nst = 7215 nfe = 0 +nfe = 76537 nfels = 108364 +nni = 40314 nli = 108364 +nsetups = 438 netf = 29 +npe = 122 nps = 145149 +ncfn = 0 ncfl = 43 In ARKBBDPRE: real/integer local work space sizes = 1300, 192 - no. flocal evals. = 2750 + no. flocal evals. = 2684 diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.out b/examples/arkode/C_parallel/ark_diurnal_kry_p.out index b2a0ee2812..2fc4afceac 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.out +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.out @@ -2,61 +2,62 @@ 2-species diurnal advection-diffusion problem 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 +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 = 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 +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 -At top right: c1, c2 = 9.650e+06 3.751e+11 +t = 2.88e+04 no. steps = 4707 stepsize = 4.53e+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 = 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 = 3.60e+04 no. steps = 5973 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 = 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 = 4.32e+04 no. steps = 7161 stepsize = 4.81e+02 +At bottom left: c1, c2 = -5.680e-13 3.382e+11 +At top right: c1, c2 = 1.958e-12 3.804e+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.04e+04 no. steps = 7176 stepsize = 4.29e+02 +At bottom left: c1, c2 = -6.614e-11 3.358e+11 +At top right: c1, c2 = 9.416e-11 3.864e+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 = 5.76e+04 no. steps = 7196 stepsize = 2.18e+02 +At bottom left: c1, c2 = 4.884e-13 3.320e+11 +At top right: c1, c2 = 3.038e-13 3.909e+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 = 6.48e+04 no. steps = 7209 stepsize = 6.39e+02 +At bottom left: c1, c2 = 3.911e-12 3.313e+11 +At top right: c1, c2 = -1.118e-11 3.963e+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.20e+04 no. steps = 7220 stepsize = 6.39e+02 +At bottom left: c1, c2 = -2.160e-12 3.330e+11 +At top right: c1, c2 = -2.041e-11 4.039e+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 = 7.92e+04 no. steps = 7231 stepsize = 6.39e+02 +At bottom left: c1, c2 = -2.099e-26 3.334e+11 +At top right: c1, c2 = -4.407e-25 4.120e+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 +t = 8.64e+04 no. steps = 7243 stepsize = 6.39e+02 +At bottom left: c1, c2 = -5.876e-25 3.352e+11 +At top right: c1, c2 = -9.344e-24 4.163e+11 -Final Statistics: +Final Statistics: lenrw = 3302 leniw = 255 lenrwls = 2455 leniwls = 126 -nst = 7447 nfe = 0 -nfi = 79041 nfels = 108536 -nni = 41643 nli = 108536 -nsetups = 456 netf = 32 -npe = 125 nps = 147035 -ncfn = 0 ncfl = 83 +nst = 7243 nfe = 0 +nfi = 76825 nfels = 105271 +nni = 40467 nli = 105271 +nsetups = 439 netf = 28 +npe = 122 nps = 142747 +ncfn = 0 ncfl = 141 + diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out index a6c5f580fa..1d0747bbf7 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.out @@ -2,61 +2,62 @@ 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 -At top right: c1, c2 = 7.301e+06 2.833e+11 +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 = 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 +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 = 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 = 2.88e+04 no. steps = 4603 stepsize = 4.79e+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 = 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 = 3.60e+04 no. steps = 5841 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 = 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 = 4.32e+04 no. steps = 7028 stepsize = 5.25e+02 +At bottom left: c1, c2 = -1.384e-10 3.382e+11 +At top right: c1, c2 = 4.912e-10 3.804e+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.04e+04 no. steps = 7045 stepsize = 4.32e+02 +At bottom left: c1, c2 = -1.726e-08 3.358e+11 +At top right: c1, c2 = 3.060e-08 3.864e+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 = 5.76e+04 no. steps = 7060 stepsize = 2.24e+02 +At bottom left: c1, c2 = -2.215e-10 3.320e+11 +At top right: c1, c2 = -3.625e-10 3.909e+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 = 6.48e+04 no. steps = 7074 stepsize = 6.21e+02 +At bottom left: c1, c2 = -1.004e-22 3.313e+11 +At top right: c1, c2 = -3.771e-23 3.963e+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.20e+04 no. steps = 7085 stepsize = 6.21e+02 +At bottom left: c1, c2 = -2.029e-23 3.330e+11 +At top right: c1, c2 = 2.084e-23 4.039e+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 = 7.92e+04 no. steps = 7097 stepsize = 6.21e+02 +At bottom left: c1, c2 = -5.112e-23 3.334e+11 +At top right: c1, c2 = 1.320e-23 4.120e+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 +t = 8.64e+04 no. steps = 7109 stepsize = 6.21e+02 +At bottom left: c1, c2 = 1.584e-22 3.352e+11 +At top right: c1, c2 = -2.798e-23 4.163e+11 -Final Statistics: +Final Statistics: lenrw = 3302 leniw = 255 lenrwls = 2455 leniwls = 126 -nst = 7102 nfe = 0 -nfi = 74579 nfels = 87090 -nni = 38921 nli = 87090 -nsetups = 429 netf = 29 -npe = 119 nps = 123765 +nst = 7109 nfe = 0 +nfi = 74641 nfels = 87206 +nni = 38963 nli = 87206 +nsetups = 431 netf = 26 +npe = 119 nps = 123911 ncfn = 0 ncfl = 0 + diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index 732eb5a5b4..501ff55e80 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -124,6 +124,16 @@ #endif #endif +#ifndef ABS +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define ABS(x) (fabs((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define ABS(x) (fabsf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define ABS(x) (fabsl((x))) +#endif +#endif + /* Constants */ #define ZERO SUN_RCONST(0.0) @@ -878,7 +888,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm(fc, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * ABS(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -896,7 +906,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * ABS(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = -gamma / r; fblock(t, cdata, jx, jy, f1, wdata); diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index a21a59b285..152a95133d 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -294,8 +294,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); - err = ewt * fabs(NV_Ith_S(y, 0) - ans); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(NV_Ith_S(y, 0) - ans); /* is the solution within the tolerances? */ passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index 4b59063b1d..95dca9fbc2 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -332,8 +332,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); - err = ewt * fabs(NV_Ith_S(y, 0) - ans); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(NV_Ith_S(y, 0) - ans); /* is the solution within the tolerances? */ passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; 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 76cfdd2a7e..bbaf5142f3 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 @@ -9,7 +9,7 @@ Conserved Exponential Entropy problem: ------------------------------------------------------------------------------- 0 0.000000e+00 1.000000e+00 5.000000e-01 4.367003e+00 0.000000e+00 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 + 80 2.733674e+00 -9.963899e+00 1.474066e+00 4.367003e+00 7.993606e-15 ------------------------------------------------------------------------------- Final Solver Statistics: 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 8ab099ceb4..411353b0a1 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 @@ -14,20 +14,20 @@ Conserved Exponential Entropy problem: 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 + 280 3.389142e-01 1.753685e-01 1.155408e+00 4.367003e+00 4.618528e-14 + 320 3.715233e-01 6.985629e-02 1.192300e+00 4.367003e+00 4.440892e-14 + 360 3.897050e-01 9.378019e-03 1.211221e+00 4.367003e+00 4.440892e-14 + 400 3.941218e-01 -5.484616e-03 1.215646e+00 4.367003e+00 5.329071e-14 + 440 4.041300e-01 -3.940364e-02 1.225433e+00 4.367003e+00 5.240253e-14 + 480 4.249355e-01 -1.109566e-01 1.244738e+00 4.367003e+00 4.263256e-14 + 520 4.567105e-01 -2.228060e-01 1.271650e+00 4.367003e+00 5.240253e-14 + 560 5.018939e-01 -3.867565e-01 1.305016e+00 4.367003e+00 5.151435e-14 + 600 5.637002e-01 -6.191769e-01 1.342503e+00 4.367003e+00 5.417888e-14 + 640 6.475411e-01 -9.467796e-01 1.381034e+00 4.367003e+00 5.506706e-14 + 680 7.633005e-01 -1.416410e+00 1.416925e+00 4.367003e+00 6.572520e-14 + 720 9.297484e-01 -2.114173e+00 1.446041e+00 4.367003e+00 7.638334e-14 + 760 1.217690e+00 -3.351631e+00 1.466024e+00 4.367003e+00 8.704149e-14 + 800 2.256863e+00 -7.881740e+00 1.473991e+00 4.367003e+00 8.792966e-14 ------------------------------------------------------------------------------- Final Solver Statistics: @@ -39,9 +39,10 @@ Final Solver Statistics: 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 = 2689 - Total Relaxation Jac evals = 3521 + Total Relaxation Fn evals = 2692 + Total Relaxation Jac evals = 3524 Total Relaxation fails = 15 Total Relaxation bound fails = 15 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 1025 + Total Relaxation NLS iters = 1028 + 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 176dffd2b8..d10cdad5ac 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 @@ -22,19 +22,19 @@ Dissipated Exponential Entropy problem: 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 + 600 6.694857e-01 -3.668375e-02 9.639809e-01 -2.804267e-01 -1.754301e+00 + 640 7.021782e-01 -6.771234e-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 + 720 8.007408e-01 -1.558236e-01 8.557101e-01 -4.974763e-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 + 800 9.636774e-01 -2.863486e-01 7.510008e-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 + 880 1.204472e+00 -4.525717e-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 + 1000 1.797284e+00 -7.724955e-01 4.618590e-01 -1.649552e+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 + 1080 2.422755e+00 -1.026269e+00 3.583416e-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 @@ -50,9 +50,10 @@ Final Solver Statistics: 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 = 4403 - Total Relaxation Jac evals = 5649 + Total Relaxation Fn evals = 4401 + Total Relaxation Jac evals = 5647 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 1911 + Total Relaxation NLS iters = 1909 + diff --git a/examples/arkode/C_serial/ark_heat1D_adapt.c b/examples/arkode/C_serial/ark_heat1D_adapt.c index 3f9e349073..8e846e592e 100644 --- a/examples/arkode/C_serial/ark_heat1D_adapt.c +++ b/examples/arkode/C_serial/ark_heat1D_adapt.c @@ -408,7 +408,7 @@ sunrealtype* adapt_mesh(N_Vector y, sunindextype* Nnew, UserData udata) ydd = Y[i - 1] - TWO * Y[i] + Y[i + 1]; /* check for refinement */ - if (fabs(ydd) > udata->refine_tol) + if (SUNRabs(ydd) > udata->refine_tol) { marks[i - 1] = 1; marks[i] = 1; 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 4ac4c1c821..f9b0aca194 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 @@ -51,78 +51,78 @@ t = 34.0000, H(p,q)-H0 = 2.1904265623540198e-09, L(p,q)-L0 = -2.2204460492503131 ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.9092e-13, num. orbits is now 5.50 t = 34.5575, H(p,q)-H0 = 2.1547714723624267e-09, L(p,q)-L0 = -9.2910568127990700e-11 t = 36.0000, H(p,q)-H0 = 2.1893326040967054e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 5.18837e-13, num. orbits is now 6.00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 5.1883e-13, num. orbits is now 6.00 t = 37.6991, H(p,q)-H0 = 1.4644406864938730e-06, L(p,q)-L0 = 3.3085088491091597e-07 t = 38.0000, H(p,q)-H0 = 1.4440848516983351e-10, L(p,q)-L0 = -1.1102230246251565e-16 -t = 40.0000, H(p,q)-H0 = 2.1902958335928702e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -2.26967e-13, num. orbits is now 6.50 +t = 40.0000, H(p,q)-H0 = 2.1902958335928702e-09, L(p,q)-L0 = -2.2204460492503131e-16 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -2.2689e-13, num. orbits is now 6.50 t = 40.8407, H(p,q)-H0 = 2.1847282871689799e-09, L(p,q)-L0 = -1.5020873433968518e-11 -t = 42.0000, H(p,q)-H0 = 2.1899792534973983e-09, L(p,q)-L0 = 0.0000000000000000e+00 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 9.77503e-13, num. orbits is now 7.00 -t = 43.9823, H(p,q)-H0 = 1.5984138088676048e-06, L(p,q)-L0 = 3.6095561650739683e-07 -t = 44.0000, H(p,q)-H0 = -8.7564400175210721e-11, L(p,q)-L0 = 0.0000000000000000e+00 -t = 46.0000, H(p,q)-H0 = 2.1900307123345897e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -5.21501e-16, num. orbits is now 7.50 -t = 47.1239, H(p,q)-H0 = 2.1591558541089739e-09, L(p,q)-L0 = -8.1509909932719893e-11 -t = 48.0000, H(p,q)-H0 = 2.1902712976640260e-09, L(p,q)-L0 = -1.1102230246251565e-16 +t = 42.0000, H(p,q)-H0 = 2.1899791979862471e-09, L(p,q)-L0 = -1.1102230246251565e-16 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 9.77139e-13, num. orbits is now 7.00 +t = 43.9823, H(p,q)-H0 = 1.5984138084235155e-06, L(p,q)-L0 = 3.6095561639637452e-07 +t = 44.0000, H(p,q)-H0 = -8.7565066309025497e-11, L(p,q)-L0 = -1.1102230246251565e-16 +t = 46.0000, H(p,q)-H0 = 2.1900307678457409e-09, L(p,q)-L0 = -1.1102230246251565e-16 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.18503e-16, num. orbits is now 7.50 +t = 47.1239, H(p,q)-H0 = 2.1591557430866715e-09, L(p,q)-L0 = -8.1510020955022355e-11 +t = 48.0000, H(p,q)-H0 = 2.1902712421528747e-09, L(p,q)-L0 = -1.1102230246251565e-16 t = 50.0000, H(p,q)-H0 = -4.5252468439116456e-10, L(p,q)-L0 = 0.0000000000000000e+00 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 6.09365e-15, num. orbits is now 8.00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 5.4041e-15, num. orbits is now 8.00 t = 50.2655, H(p,q)-H0 = 3.2033230468186957e-06, L(p,q)-L0 = 7.2350434687784571e-07 -t = 52.0000, H(p,q)-H0 = 2.1894521751164575e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.38778e-16, num. orbits is now 8.50 -t = 53.4071, H(p,q)-H0 = 2.1524908522252417e-09, L(p,q)-L0 = -9.8839714191001349e-11 -t = 54.0000, H(p,q)-H0 = 2.1904144609230514e-09, L(p,q)-L0 = 0.0000000000000000e+00 -t = 56.0000, H(p,q)-H0 = 1.9337540457797786e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.71703e-12, num. orbits is now 9.00 -t = 56.5487, H(p,q)-H0 = 2.0121016088836541e-06, L(p,q)-L0 = 4.5456268404908684e-07 -t = 58.0000, H(p,q)-H0 = 2.1879919542833193e-09, L(p,q)-L0 = -2.2204460492503131e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -7.71159e-16, num. orbits is now 9.50 -t = 59.6903, H(p,q)-H0 = 2.1883964640423414e-09, L(p,q)-L0 = -5.4833915186236482e-12 -t = 60.0000, H(p,q)-H0 = 2.1904827951502170e-09, L(p,q)-L0 = -1.1102230246251565e-16 -t = 62.0000, H(p,q)-H0 = 2.1533409499951972e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 2.65131e-15, num. orbits is now 10.00 -t = 62.8319, H(p,q)-H0 = 1.2891478551324553e-06, L(p,q)-L0 = 2.9111120158908932e-07 -t = 64.0000, H(p,q)-H0 = 2.1833788110825481e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.13744e-15, num. orbits is now 10.50 -t = 65.9734, H(p,q)-H0 = 2.1621995305309838e-09, L(p,q)-L0 = -7.3596240213191777e-11 -t = 66.0000, H(p,q)-H0 = 2.1905053881887682e-09, L(p,q)-L0 = 0.0000000000000000e+00 -t = 68.0000, H(p,q)-H0 = 2.1815430018001791e-09, L(p,q)-L0 = 0.0000000000000000e+00 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.23713e-12, num. orbits is now 11.00 -t = 69.1150, H(p,q)-H0 = 3.0882619195260474e-06, L(p,q)-L0 = 6.9749695053022975e-07 +t = 52.0000, H(p,q)-H0 = 2.1894519530718526e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -2.94728e-13, num. orbits is now 8.50 +t = 53.4071, H(p,q)-H0 = 2.1524909632475442e-09, L(p,q)-L0 = -9.8839381124093961e-11 +t = 54.0000, H(p,q)-H0 = 2.1904142943895977e-09, L(p,q)-L0 = 0.0000000000000000e+00 +t = 56.0000, H(p,q)-H0 = 1.9337542678243835e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.71884e-12, num. orbits is now 9.00 +t = 56.5487, H(p,q)-H0 = 2.0121016079954757e-06, L(p,q)-L0 = 4.5456268382704224e-07 +t = 58.0000, H(p,q)-H0 = 2.1879922873502267e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.0166e-15, num. orbits is now 9.50 +t = 59.6903, H(p,q)-H0 = 2.1883965195534927e-09, L(p,q)-L0 = -5.4833915186236482e-12 +t = 60.0000, H(p,q)-H0 = 2.1904828506613683e-09, L(p,q)-L0 = -1.1102230246251565e-16 +t = 62.0000, H(p,q)-H0 = 2.1533411720398021e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.78677e-15, num. orbits is now 10.00 +t = 62.8319, H(p,q)-H0 = 1.2891478542442769e-06, L(p,q)-L0 = 2.9111120147806702e-07 +t = 64.0000, H(p,q)-H0 = 2.1833788110825481e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -6.74591e-16, num. orbits is now 10.50 +t = 65.9734, H(p,q)-H0 = 2.1621999746201936e-09, L(p,q)-L0 = -7.3595796123981927e-11 +t = 66.0000, H(p,q)-H0 = 2.1905055547222219e-09, L(p,q)-L0 = -1.1102230246251565e-16 +t = 68.0000, H(p,q)-H0 = 2.1815429462890279e-09, L(p,q)-L0 = -1.1102230246251565e-16 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.25993e-12, num. orbits is now 11.00 +t = 69.1150, H(p,q)-H0 = 3.0882619195260474e-06, L(p,q)-L0 = 6.9749695041920745e-07 t = 70.0000, H(p,q)-H0 = 2.1630525148808033e-09, L(p,q)-L0 = -1.1102230246251565e-16 -t = 72.0000, H(p,q)-H0 = 2.1904902336444820e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -3.96608e-13, num. orbits is now 11.50 -t = 72.2566, H(p,q)-H0 = 2.1511883385727515e-09, L(p,q)-L0 = -1.0222600543841054e-10 -t = 74.0000, H(p,q)-H0 = 2.1874849154279730e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 5.75581e-15, num. orbits is now 12.00 +t = 72.0000, H(p,q)-H0 = 2.1904902891556333e-09, L(p,q)-L0 = -2.2204460492503131e-16 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -3.75904e-15, num. orbits is now 11.50 +t = 72.2566, H(p,q)-H0 = 2.1511886161285076e-09, L(p,q)-L0 = -1.0222600543841054e-10 +t = 74.0000, H(p,q)-H0 = 2.1874850819614267e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.66894e-12, num. orbits is now 12.00 t = 75.3982, H(p,q)-H0 = 2.4488947434342379e-06, L(p,q)-L0 = 5.5322002912028267e-07 -t = 76.0000, H(p,q)-H0 = 2.0191779359635120e-09, L(p,q)-L0 = -1.1102230246251565e-16 -t = 78.0000, H(p,q)-H0 = 2.1904320024468404e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -4.30512e-13, num. orbits is now 12.50 -t = 78.5398, H(p,q)-H0 = 2.1863212351647121e-09, L(p,q)-L0 = -1.0879075418301909e-11 -t = 80.0000, H(p,q)-H0 = 2.1892699875181165e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.8114e-12, num. orbits is now 13.00 -t = 81.6814, H(p,q)-H0 = 9.7535366494483355e-07, L(p,q)-L0 = 2.2024722368119143e-07 -t = 82.0000, H(p,q)-H0 = 4.1583381182874746e-10, L(p,q)-L0 = -2.2204460492503131e-16 -t = 84.0000, H(p,q)-H0 = 2.1903069358231164e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -6.01949e-16, num. orbits is now 13.50 -t = 84.8230, H(p,q)-H0 = 2.1655218729321746e-09, L(p,q)-L0 = -6.4957705880885896e-11 -t = 86.0000, H(p,q)-H0 = 2.1899523861002024e-09, L(p,q)-L0 = 0.0000000000000000e+00 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 8.92949e-16, num. orbits is now 14.00 -t = 87.9646, H(p,q)-H0 = 2.9269917813934399e-06, L(p,q)-L0 = 6.6105562701590515e-07 -t = 88.0000, H(p,q)-H0 = -3.5649505569779194e-10, L(p,q)-L0 = 0.0000000000000000e+00 -t = 90.0000, H(p,q)-H0 = 2.1900535829288970e-09, L(p,q)-L0 = 0.0000000000000000e+00 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.25442e-16, num. orbits is now 14.50 -t = 91.1062, H(p,q)-H0 = 2.1507646774665545e-09, L(p,q)-L0 = -1.0332734667883869e-10 -t = 92.0000, H(p,q)-H0 = 2.1902584745880915e-09, L(p,q)-L0 = 0.0000000000000000e+00 -t = 94.0000, H(p,q)-H0 = -7.9522965990008743e-10, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 2.10223e-12, num. orbits is now 15.00 +t = 76.0000, H(p,q)-H0 = 2.0191780469858145e-09, L(p,q)-L0 = -1.1102230246251565e-16 +t = 78.0000, H(p,q)-H0 = 2.1904322244914454e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -4.98042e-16, num. orbits is now 12.50 +t = 78.5398, H(p,q)-H0 = 2.1863216237427707e-09, L(p,q)-L0 = -1.0878853373696984e-11 +t = 80.0000, H(p,q)-H0 = 2.1892702095627214e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 1.09916e-15, num. orbits is now 13.00 +t = 81.6814, H(p,q)-H0 = 9.7535366450074434e-07, L(p,q)-L0 = 2.2024722357016913e-07 +t = 82.0000, H(p,q)-H0 = 4.1583425591795731e-10, L(p,q)-L0 = 0.0000000000000000e+00 +t = 84.0000, H(p,q)-H0 = 2.1903071578677213e-09, L(p,q)-L0 = -1.1102230246251565e-16 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -2.06996e-15, num. orbits is now 13.50 +t = 84.8230, H(p,q)-H0 = 2.1655219839544770e-09, L(p,q)-L0 = -6.4957816903188359e-11 +t = 86.0000, H(p,q)-H0 = 2.1899527191671098e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 3.21574e-15, num. orbits is now 14.00 +t = 87.9646, H(p,q)-H0 = 2.9269917809493506e-06, L(p,q)-L0 = 6.6105562690488284e-07 +t = 88.0000, H(p,q)-H0 = -3.5649527774239687e-10, L(p,q)-L0 = -1.1102230246251565e-16 +t = 90.0000, H(p,q)-H0 = 2.1900536939511994e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -5.0435e-13, num. orbits is now 14.50 +t = 91.1062, H(p,q)-H0 = 2.1507648440000082e-09, L(p,q)-L0 = -1.0332712463423377e-10 +t = 92.0000, H(p,q)-H0 = 2.1902585300992428e-09, L(p,q)-L0 = -1.1102230246251565e-16 +t = 94.0000, H(p,q)-H0 = -7.9522965990008743e-10, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = 1, y[0] = 0.4, y[1] = 2.0991e-12, num. orbits is now 15.00 t = 94.2478, H(p,q)-H0 = 2.7836469302933153e-06, L(p,q)-L0 = 6.2882004014941373e-07 -t = 96.0000, H(p,q)-H0 = 2.1895043000874637e-09, L(p,q)-L0 = -1.1102230246251565e-16 -ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -5.37004e-13, num. orbits is now 15.50 -t = 97.3894, H(p,q)-H0 = 2.1772518232765492e-09, L(p,q)-L0 = -3.4459657349827921e-11 -t = 98.0000, H(p,q)-H0 = 2.1904077440737524e-09, L(p,q)-L0 = -2.2204460492503131e-16 -t = 100.0000, H(p,q)-H0 = 1.8950301328146679e-09, L(p,q)-L0 = -2.2204460492503131e-16 +t = 96.0000, H(p,q)-H0 = 2.1895045221320686e-09, L(p,q)-L0 = 0.0000000000000000e+00 +ROOT RETURN: g[0] = -1, y[0] = -1.6, y[1] = -1.7756e-15, num. orbits is now 15.50 +t = 97.3894, H(p,q)-H0 = 2.1772523228769103e-09, L(p,q)-L0 = -3.4459213260618071e-11 +t = 98.0000, H(p,q)-H0 = 2.1904080771406598e-09, L(p,q)-L0 = 0.0000000000000000e+00 +t = 100.0000, H(p,q)-H0 = 1.8950303548592728e-09, L(p,q)-L0 = 0.0000000000000000e+00 Current time = 100 Steps = 10000 Step attempts = 10000 @@ -134,6 +134,6 @@ Inequality constraint fails = 0 Initial step size = 0.01 Last step size = 0.01 Current step size = 0.01 -Root fn evals = 10297 +Root fn evals = 10280 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_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 f6270cd29f..b68cd78622 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 @@ -126,7 +126,7 @@ Problem Arguments: nout: 1 t = 0.0000, H(p,q) = -0.5000000000000000, L(p,q) = 0.8000000000000000 -t = 50.0000, H(p,q)-H0 = -1.6152086335097238e-09, L(p,q)-L0 = -6.2394533983933798e-14 +t = 50.0000, H(p,q)-H0 = -1.6151293635857655e-09, L(p,q)-L0 = -3.3972824553529790e-14 Current time = 50 Steps = 400001 Step attempts = 400001 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 78f14dd179..9249767e85 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 @@ -70,7 +70,7 @@ Problem Arguments: nout: 1 t = 0.0000, H(p,q) = -0.5000000000000000, L(p,q) = 0.8000000000000000 -t = 50.0000, H(p,q)-H0 = 1.3166233214789713e-07, L(p,q)-L0 = -1.1102230246251565e-15 +t = 50.0000, H(p,q)-H0 = 1.3166233259198634e-07, L(p,q)-L0 = -6.6613381477509392e-16 Current time = 50 Steps = 1000 Step attempts = 1000 @@ -210,7 +210,7 @@ Problem Arguments: nout: 1 t = 0.0000, H(p,q) = -0.5000000000000000, L(p,q) = 0.8000000000000000 -t = 50.0000, H(p,q)-H0 = 3.9968028886505635e-15, L(p,q)-L0 = 2.9864999362416711e-14 +t = 50.0000, H(p,q)-H0 = 1.2878587085651816e-14, L(p,q)-L0 = 1.9317880628477724e-14 Current time = 50 Steps = 32001 Step attempts = 32001 @@ -253,5 +253,5 @@ Current step size = 0.00078125 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 +Order of accuracy wrt solution: expected = 5, max = 5.9898, avg = 3.4143, overall = 3.7912 +Order of accuracy wrt Hamiltonian: expected = 5, max = 5.8607, avg = 3.9728, overall = 4.3555 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 1289fd72b9..de9d86f8fc 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 @@ -210,7 +210,7 @@ Problem Arguments: nout: 1 t = 0.0000, H(p,q) = -0.5000000000000000, L(p,q) = 0.8000000000000000 -t = 50.0000, H(p,q)-H0 = 7.8297457406506510e-10, L(p,q)-L0 = -9.2703622556200571e-14 +t = 50.0000, H(p,q)-H0 = 7.8271966685861116e-10, L(p,q)-L0 = -1.8152146452621309e-13 Current time = 50 Steps = 3200000 Step attempts = 3200000 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 8da07cba27..665cd0a588 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 @@ -14,7 +14,7 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: 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.22e-13 + 0.400000 1.208524 1.154583 1.51e-11 9.21e-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 diff --git a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003_--monitor_--global-nls.out b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003_--monitor_--global-nls.out index 87a64e82de..59d97ba67a 100644 --- a/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003_--monitor_--global-nls.out +++ b/examples/arkode/F2003_parallel/ark_brusselator1D_task_local_nls_f2003_--monitor_--global-nls.out @@ -30,50 +30,50 @@ Integrator Options: 1.00000E+00 1.61797E+00 2.78970E+00 3.49997E+00 1.25000E+00 1.73861E+00 2.52564E+00 3.49997E+00 1.50000E+00 1.72431E+00 2.34664E+00 3.49997E+00 - 1.75000E+00 1.60933E+00 2.26740E+00 3.49997E+00 - 2.00000E+00 1.44194E+00 2.28479E+00 3.49997E+00 - 2.25000E+00 1.25455E+00 2.38711E+00 3.49998E+00 - 2.50000E+00 1.06786E+00 2.55298E+00 3.49998E+00 - 2.75000E+00 8.94914E-01 2.75580E+00 3.49999E+00 - 3.00000E+00 7.42698E-01 2.97271E+00 3.49999E+00 + 1.75000E+00 1.60933E+00 2.26740E+00 3.49998E+00 + 2.00000E+00 1.44194E+00 2.28479E+00 3.49996E+00 + 2.25000E+00 1.25455E+00 2.38711E+00 3.50011E+00 + 2.50000E+00 1.06786E+00 2.55298E+00 3.49997E+00 + 2.75000E+00 8.94914E-01 2.75580E+00 3.49998E+00 + 3.00000E+00 7.42698E-01 2.97271E+00 3.49997E+00 3.25000E+00 6.14424E-01 3.18968E+00 3.49999E+00 3.50000E+00 5.11703E-01 3.40029E+00 3.49999E+00 3.75000E+00 4.35022E-01 3.60235E+00 3.49999E+00 4.00000E+00 3.82884E-01 3.79561E+00 3.49999E+00 4.25000E+00 3.51268E-01 3.98079E+00 3.49999E+00 4.50000E+00 3.34675E-01 4.15907E+00 3.49999E+00 - 4.75000E+00 3.27999E-01 4.33168E+00 3.49999E+00 - 5.00000E+00 3.27576E-01 4.49959E+00 3.49999E+00 + 4.75000E+00 3.27999E-01 4.33168E+00 3.50000E+00 + 5.00000E+00 3.27576E-01 4.49959E+00 3.50000E+00 5.25000E+00 3.31182E-01 4.66336E+00 3.49999E+00 5.50000E+00 3.37619E-01 4.82316E+00 3.49999E+00 - 5.75000E+00 3.46346E-01 4.97885E+00 3.49999E+00 - 6.00000E+00 3.57245E-01 5.12994E+00 3.49999E+00 - 6.25000E+00 3.70526E-01 5.27566E+00 3.49999E+00 - 6.50000E+00 3.86740E-01 5.41481E+00 3.49999E+00 + 5.75000E+00 3.46346E-01 4.97885E+00 3.49975E+00 + 6.00000E+00 3.57245E-01 5.12994E+00 3.49981E+00 + 6.25000E+00 3.70526E-01 5.27566E+00 3.50000E+00 + 6.50000E+00 3.86740E-01 5.41481E+00 3.50006E+00 6.75000E+00 4.06897E-01 5.54555E+00 3.49999E+00 7.00000E+00 4.32797E-01 5.66494E+00 3.49999E+00 7.25000E+00 4.67856E-01 5.76789E+00 3.49999E+00 7.50000E+00 5.19324E-01 5.84448E+00 3.49999E+00 - 7.75000E+00 6.05996E-01 5.87157E+00 3.49999E+00 + 7.75000E+00 6.05996E-01 5.87157E+00 3.49997E+00 8.00000E+00 7.97170E-01 5.77534E+00 3.49999E+00 8.25000E+00 1.62902E+00 5.13503E+00 3.49997E+00 8.50000E+00 3.77490E+00 3.49950E+00 3.49994E+00 8.75000E+00 4.02579E+00 2.19493E+00 3.49993E+00 9.00000E+00 3.87738E+00 9.67603E-01 3.49993E+00 - 9.25000E+00 3.14890E+00 1.08723E+00 3.49995E+00 + 9.25000E+00 3.14890E+00 1.08723E+00 3.49996E+00 9.50000E+00 2.47156E+00 1.32287E+00 3.49996E+00 9.75000E+00 1.91234E+00 1.59492E+00 3.49997E+00 1.00000E+01 1.45025E+00 1.89616E+00 3.49998E+00 ----------------------------------------------------------- Final Solver Statistics (for processor 0): - Steps = 482 - Step attempts = 482 + Steps = 483 + Step attempts = 483 Error test fails = 0 NLS fails = 2 - RHS evals Fe = 1931 - RHS evals Fi = 4835 - NLS iters = 2904 - LS iters = 9286 + RHS evals Fe = 1935 + RHS evals Fi = 4845 + NLS iters = 2910 + LS iters = 9307 P setups = 9 - P solves = 12085 + P solves = 12112 diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out index 68e0609dbb..90517794f0 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.out @@ -1,6 +1,6 @@ - + Finished initialization, starting time steps - + t c1 (bottom left middle top right) | lnst lnst_att lh t c2 (bottom left middle top right) | lnst lnst_att lh ---------------------------------------------------------------------------------------- @@ -8,42 +8,43 @@ 4.440310E+11 7.263637E+11 3.820591E+11 1.440000E+04 1.149716E+07 1.249098E+07 1.329954E+07 2780 2784 1.022085E+01 4.473684E+11 4.862283E+11 5.178450E+11 - 2.160000E+04 2.525270E+07 7.837587E+07 3.018990E+07 3325 3329 1.467507E+01 + 2.160000E+04 2.525270E+07 7.837587E+07 3.018990E+07 3325 3329 1.467514E+01 2.824256E+11 9.233209E+11 3.419869E+11 - 2.880000E+04 1.189287E+07 2.395791E+07 1.042605E+07 3816 3820 1.467507E+01 + 2.880000E+04 1.189287E+07 2.395791E+07 1.042605E+07 3816 3820 1.467514E+01 4.627840E+11 9.345089E+11 4.054359E+11 - 3.600000E+04 2.342948E+04 2.291472E+04 2.522324E+04 4629 4633 4.334128E+00 + 3.600000E+04 2.342949E+04 2.291472E+04 2.522325E+04 4629 4633 4.333728E+00 5.651673E+11 5.527495E+11 6.084385E+11 - 4.320000E+04 1.194709E-04 5.892092E-05 -1.674879E-04 5635 5639 6.277419E+02 + 4.320000E+04 -3.718382E-05 -1.465487E-05 2.611385E-05 5635 5639 6.272609E+02 3.689222E+11 8.238330E+11 4.623703E+11 - 5.040000E+04 -8.456488E-06 -9.187620E-06 3.659273E-05 5647 5651 6.277419E+02 - 3.862510E+11 1.017897E+12 3.536889E+11 - 5.760000E+04 -1.301882E-05 -3.846503E-06 5.896852E-06 5658 5662 6.277419E+02 - 5.832932E+11 6.187928E+11 5.788981E+11 - 6.480000E+04 3.467015E-05 1.276786E-05 -3.337236E-05 5670 5674 6.277419E+02 - 4.274401E+11 6.788806E+11 5.386844E+11 - 7.200000E+04 -7.456958E-06 8.227805E-17 3.511631E-10 5681 5685 6.277419E+02 + 5.040000E+04 5.522194E-07 -9.160075E-06 4.014494E-05 5647 5651 6.272609E+02 + 3.862509E+11 1.017897E+12 3.536890E+11 + 5.760000E+04 -1.084359E-05 -3.724411E-06 1.288549E-06 5658 5662 6.272609E+02 + 5.832933E+11 6.187928E+11 5.788981E+11 + 6.480000E+04 2.972416E-05 1.471335E-05 -3.876329E-05 5670 5674 6.272609E+02 + 4.274400E+11 6.788806E+11 5.386844E+11 + 7.200000E+04 -2.141097E-16 6.301814E-17 1.652460E-15 5681 5685 6.272609E+02 3.453624E+11 1.030182E+12 3.448304E+11 - 7.920000E+04 -1.368994E-06 2.401515E-15 -7.272100E-13 5693 5697 6.277419E+02 + 7.920000E+04 2.795850E-14 6.145328E-15 1.996900E-14 5693 5697 6.272609E+02 5.450919E+11 7.330919E+11 5.109883E+11 - 8.640000E+04 8.946777E-06 2.191861E-15 1.700622E-10 5704 5708 6.277419E+02 + 8.640000E+04 4.560340E-15 2.221125E-15 1.793820E-14 5704 5708 6.272609E+02 5.090704E+11 5.755864E+11 5.984224E+11 ---------------------------------------------------------------------------------------- - + General Solver Stats: Total internal steps taken = 5704 Total internal steps attempts = 5708 Total rhs exp function call = 0 Total rhs imp function call = 59357 Total num preconditioner evals = 96 - Total num preconditioner solves = 89026 + Total num preconditioner solves = 89028 Num error test failures = 4 Num nonlinear solver iters = 30814 - Num linear solver iters = 59967 - Avg Krylov subspace dim = 1.946096E+00 + Num linear solver iters = 59966 + Avg Krylov subspace dim = 1.946063E+00 Num nonlinear solver fails = 0 Num linear solver fails = 0 main solver real/int workspace sizes = 3702 145 linear solver real/int workspace sizes = 2455 42 ARKBandPre real/int workspace sizes = 2800 622 ARKBandPre number of f evaluations = 480 + diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp index 6a80f99acf..57b407923a 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp @@ -379,6 +379,13 @@ int main(int argc, char* argv[]) // SUNDIALS context sundials::Context sunctx(comm_w); + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // Set output process flag bool outproc = (myid == 0); @@ -559,6 +566,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver SUNMatDestroy(A); // Free matrix diff --git a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp index 6322b09aec..cb722ec2d9 100644 --- a/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp +++ b/examples/cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp @@ -336,6 +336,13 @@ int main(int argc, char* argv[]) // SUNDIALS context sundials::Context sunctx(comm_w); + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Init(); + if (check_flag(&flag, "HYPRE_Init", 1)) { return 1; } +#endif + // Set output process flag bool outproc = (myid == 0); @@ -542,6 +549,13 @@ int main(int argc, char* argv[]) // Clean up and return // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + flag = HYPRE_Finalize(); + if (check_flag(&flag, "HYPRE_Finalize", 1)) { return 1; } +#endif + CVodeFree(&cvode_mem); // Free integrator memory SUNLinSolFree(LS); // Free linear solver N_VDestroy(u); // Free vectors diff --git a/examples/cvode/CXX_serial/cv_kpr.out b/examples/cvode/CXX_serial/cv_kpr.out index bc74d07ec1..e08dd2f10a 100644 --- a/examples/cvode/CXX_serial/cv_kpr.out +++ b/examples/cvode/CXX_serial/cv_kpr.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.out b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.out index a91a41dfe8..761d4006e9 100644 --- a/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.out +++ b/examples/cvode/C_mpimanyvector/cvDiurnal_kry_mpimanyvec.out @@ -17,51 +17,51 @@ t = 2.16e+04 no. steps = 289 order = 4 stepsize = 2.96e+02 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 = 330 order = 4 stepsize = 1.58e+02 +t = 2.88e+04 no. steps = 330 order = 4 stepsize = 1.00e+02 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 = 369 order = 5 stepsize = 1.29e+02 +t = 3.60e+04 no. steps = 371 order = 4 stepsize = 7.53e+01 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 = 420 order = 5 stepsize = 5.76e+02 -At bottom left: c1, c2 = 6.108e-10 3.382e+11 -At top right: c1, c2 = 7.055e-10 3.804e+11 +t = 4.32e+04 no. steps = 442 order = 4 stepsize = 3.67e+02 +At bottom left: c1, c2 = 1.540e-09 3.382e+11 +At top right: c1, c2 = 1.086e-09 3.804e+11 -t = 5.04e+04 no. steps = 433 order = 5 stepsize = 6.48e+02 -At bottom left: c1, c2 = -3.799e-10 3.358e+11 -At top right: c1, c2 = 4.316e-10 3.864e+11 +t = 5.04e+04 no. steps = 455 order = 5 stepsize = 3.88e+02 +At bottom left: c1, c2 = -5.142e-12 3.358e+11 +At top right: c1, c2 = -1.575e-11 3.864e+11 -t = 5.76e+04 no. steps = 445 order = 5 stepsize = 3.90e+02 -At bottom left: c1, c2 = 9.462e-12 3.320e+11 -At top right: c1, c2 = -2.609e-12 3.909e+11 +t = 5.76e+04 no. steps = 469 order = 4 stepsize = 2.10e+02 +At bottom left: c1, c2 = -4.462e-07 3.320e+11 +At top right: c1, c2 = -4.738e-07 3.909e+11 -t = 6.48e+04 no. steps = 455 order = 5 stepsize = 7.79e+02 -At bottom left: c1, c2 = 6.361e-12 3.313e+11 -At top right: c1, c2 = -2.663e-11 3.963e+11 +t = 6.48e+04 no. steps = 484 order = 4 stepsize = 5.41e+02 +At bottom left: c1, c2 = 1.188e-10 3.313e+11 +At top right: c1, c2 = 4.248e-12 3.963e+11 -t = 7.20e+04 no. steps = 465 order = 5 stepsize = 7.79e+02 -At bottom left: c1, c2 = 3.382e-12 3.330e+11 -At top right: c1, c2 = 3.011e-12 4.039e+11 +t = 7.20e+04 no. steps = 498 order = 4 stepsize = 5.41e+02 +At bottom left: c1, c2 = -1.561e-11 3.330e+11 +At top right: c1, c2 = 3.527e-12 4.039e+11 -t = 7.92e+04 no. steps = 474 order = 5 stepsize = 7.79e+02 -At bottom left: c1, c2 = 3.075e-13 3.334e+11 -At top right: c1, c2 = 6.124e-13 4.120e+11 +t = 7.92e+04 no. steps = 511 order = 4 stepsize = 5.41e+02 +At bottom left: c1, c2 = 4.246e-11 3.334e+11 +At top right: c1, c2 = 4.577e-11 4.120e+11 -t = 8.64e+04 no. steps = 483 order = 5 stepsize = 7.79e+02 -At bottom left: c1, c2 = -1.232e-13 3.352e+11 -At top right: c1, c2 = -7.096e-14 4.163e+11 +t = 8.64e+04 no. steps = 524 order = 4 stepsize = 5.41e+02 +At bottom left: c1, c2 = 1.106e-10 3.352e+11 +At top right: c1, c2 = -2.106e-11 4.163e+11 Final Statistics: lenrw = 2689 leniw = 248 lenrwls = 2454 leniwls = 222 -nst = 483 -nfe = 601 nfels = 1149 -nni = 598 nli = 1149 -nsetups = 82 netf = 25 -npe = 9 nps = 1658 -ncfn = 0 ncfl = 2 +nst = 524 +nfe = 660 nfels = 1250 +nni = 657 nli = 1250 +nsetups = 92 netf = 28 +npe = 9 nps = 1801 +ncfn = 0 ncfl = 1 diff --git a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out index b4fd7acec7..42d504bc9d 100644 --- a/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out +++ b/examples/cvode/F2003_serial/cv_advdiff_bnd_f2003.out @@ -6,7 +6,7 @@ t max.norm(u) | lnst ------------------------------ - 0.00 8.954716E+01 0 + 0.00 8.954716E+01 ***** 0.10 4.132887E+00 83 0.20 1.039298E+00 113 0.30 2.980039E-01 142 diff --git a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.out b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.out index 37d74b40fa..b2cb071fb8 100644 --- a/examples/cvode/F2003_serial/cv_analytic_fp_f2003.out +++ b/examples/cvode/F2003_serial/cv_analytic_fp_f2003.out @@ -16,16 +16,16 @@ 1.00000E+01 1.47113E+00 General Solver Stats: - Total internal steps taken = 1817 - Total rhs function calls = 3933 + Total internal steps taken = 2065 + Total rhs function calls = 4552 Num lin solver setup calls = 0 Num error test failures = 0 Last method order = 1 Next method order = 1 First internal step size = 6.10352E-12 - Last internal step size = 3.95234E-03 - Next internal step size = 3.95234E-03 - Current internal time = 1.00010E+01 - Num nonlinear solver iters = 3930 - Num nonlinear solver fails = 614 + Last internal step size = 3.95126E-03 + Next internal step size = 1.58240E-02 + Current internal time = 1.00031E+01 + Num nonlinear solver iters = 4549 + Num nonlinear solver fails = 755 diff --git a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out index 4eb0e6fa74..688422952d 100644 --- a/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out +++ b/examples/cvode/F2003_serial/cv_diurnal_kry_bp_f2003.out @@ -14,19 +14,19 @@ 4.627736E+11 9.345413E+11 4.054191E+11 3.600000E+04 2.342995E+04 2.291401E+04 2.522350E+04 285 1.992953E+02 5.651797E+11 5.527335E+11 6.084463E+11 - 4.320000E+04 2.608063E-04 4.048821E-05 -4.802744E-04 336 5.653068E+02 + 4.320000E+04 2.608064E-04 4.048834E-05 -4.802745E-04 336 5.653068E+02 3.689229E+11 8.238195E+11 4.623800E+11 - 5.040000E+04 1.817289E-04 -1.516970E-06 3.755188E-04 349 5.653068E+02 + 5.040000E+04 1.817288E-04 -1.516972E-06 3.755188E-04 349 5.653068E+02 3.862522E+11 1.017917E+12 3.536680E+11 - 5.760000E+04 3.523733E-10 1.237556E-11 -3.779706E-10 362 5.653068E+02 + 5.760000E+04 3.523725E-10 1.253596E-11 -3.779776E-10 362 5.653068E+02 5.833332E+11 6.187025E+11 5.789597E+11 - 6.480000E+04 1.065643E-13 -1.378092E-13 -2.363348E-12 374 5.653068E+02 + 6.480000E+04 1.065643E-13 -4.111258E-14 -2.363348E-12 374 5.653068E+02 4.273617E+11 6.789731E+11 5.386164E+11 - 7.200000E+04 -2.565418E-14 -7.919368E-14 -2.889844E-13 387 5.653068E+02 + 7.200000E+04 -2.565418E-14 -9.575273E-16 -2.889844E-13 387 5.653068E+02 3.453809E+11 1.030257E+12 3.448164E+11 - 7.920000E+04 -7.212118E-14 1.770733E-13 1.512967E-12 400 5.653068E+02 + 7.920000E+04 -7.212118E-14 5.339836E-13 1.512967E-12 400 5.653068E+02 5.451911E+11 7.328821E+11 5.110635E+11 - 8.640000E+04 5.298797E-14 -2.802708E-14 2.918795E-13 413 5.653068E+02 + 8.640000E+04 5.298797E-14 -4.298260E-14 2.918795E-13 413 5.653068E+02 5.089882E+11 5.756321E+11 5.984473E+11 ----------------------------------------------------------------------------------- diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.OMP.out b/examples/cvode/ginkgo/cv_heat2D_ginkgo.OMP.out index d7dbab5971..b3d51005b2 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.OMP.out +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.OMP.out @@ -23,26 +23,26 @@ t ||u||_rms max error ----------------------------------------------------------------------- 0.000000000000000e+00 1.273091462283007e+00 0.000000000000000e+00 - 5.000000000000000e-02 1.265953031236582e+00 5.779434651704829e-04 - 1.000000000000000e-01 1.245126468059233e+00 8.596371323619234e-04 - 1.500000000000000e-01 1.212971694671920e+00 1.027159741342043e-03 - 2.000000000000000e-01 1.173149587107013e+00 1.048316291904605e-03 - 2.500000000000000e-01 1.129971459465251e+00 7.766164878266757e-04 - 3.000000000000000e-01 1.088069232733257e+00 3.879012295047168e-04 - 3.500000000000000e-01 1.051569636593604e+00 2.299338882598700e-04 - 4.000000000000000e-01 1.023519626560000e+00 1.143503203353546e-04 - 4.500000000000000e-01 1.005966581054818e+00 3.504386739527909e-05 - 4.999999999999999e-01 9.999944352133132e-01 6.530782157398995e-05 - 5.499999999999999e-01 1.005919953930694e+00 1.083573684623751e-04 - 6.000000000000000e-01 1.023439764352228e+00 1.261608201565956e-04 - 6.500000000000000e-01 1.051474377941265e+00 4.413607713593670e-05 - 7.000000000000001e-01 1.087966646175562e+00 8.355938233250981e-05 - 7.500000000000001e-01 1.129793345784647e+00 2.407556608268191e-04 - 8.000000000000002e-01 1.172918894918144e+00 4.328061049605481e-04 - 8.500000000000002e-01 1.212839721967015e+00 6.911881401023834e-04 - 9.000000000000002e-01 1.245175023335623e+00 9.860117994393569e-04 - 9.500000000000003e-01 1.266235164300803e+00 1.302162239507298e-03 - 1.000000000000000e+00 1.273469520598684e+00 1.184360647055183e-03 + 5.000000000000000e-02 1.265953031236583e+00 5.779434651733695e-04 + 1.000000000000000e-01 1.245126468059200e+00 8.596371367310951e-04 + 1.500000000000000e-01 1.212971694644337e+00 1.027159986731085e-03 + 2.000000000000000e-01 1.173149587049374e+00 1.048316587442200e-03 + 2.500000000000000e-01 1.129971459090234e+00 7.766184896484951e-04 + 3.000000000000000e-01 1.088069234095868e+00 3.879011885818962e-04 + 3.500000000000000e-01 1.051569637595707e+00 2.299295020968817e-04 + 4.000000000000000e-01 1.023519628936071e+00 1.143420744249557e-04 + 4.500000000000000e-01 1.005966588534454e+00 3.506424150501175e-05 + 4.999999999999999e-01 9.999944391885425e-01 6.530584026864794e-05 + 5.499999999999999e-01 1.005919954217393e+00 1.083578170322230e-04 + 6.000000000000000e-01 1.023439763252210e+00 1.261630754589849e-04 + 6.500000000000000e-01 1.051474371068769e+00 4.411406485393954e-05 + 7.000000000000001e-01 1.087966638327127e+00 8.354289701761886e-05 + 7.500000000000001e-01 1.129793345365315e+00 2.407617851292176e-04 + 8.000000000000002e-01 1.172918896916807e+00 4.328196443814658e-04 + 8.500000000000002e-01 1.212839701048727e+00 6.911742323112424e-04 + 9.000000000000002e-01 1.245175023462088e+00 9.860170630831000e-04 + 9.500000000000003e-01 1.266235199813977e+00 1.302391563965610e-03 + 1.000000000000000e+00 1.273469507667277e+00 1.184379500988708e-03 ----------------------------------------------------------------------- Final integrator statistics: @@ -51,8 +51,8 @@ Steps = 41 Error test fails = 0 NLS step fails = 0 Initial step size = 0.002110117768486902 -Last step size = 0.02867848038434426 -Current step size = 0.02867848038434426 +Last step size = 0.02865120722136558 +Current step size = 0.02865120722136558 Last method order = 3 Current method order = 3 Stab. lim. order reductions = 0 @@ -74,4 +74,4 @@ Jac evals per NLS iter = 0.02040816326530612 Prec evals per NLS iter = 0 Root fn evals = 0 -Max error = 1.184360647055183e-03 +Max error = 1.184379500988708e-03 diff --git a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp index 0d96af65fc..3d8c918bb8 100644 --- a/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp +++ b/examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp @@ -117,11 +117,19 @@ int main(int argc, char* argv[]) // --------------------------------------- #if defined(USE_CUDA) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create())}; +#else auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; +#endif #elif defined(USE_HIP) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create())}; +#else auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; +#endif #elif defined(USE_SYCL) auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; #elif defined(USE_OMP) diff --git a/examples/cvode/ginkgo/cv_kpr_ginkgo.OMP.out b/examples/cvode/ginkgo/cv_kpr_ginkgo.OMP.out index 48c9b54e29..5e97148a81 100644 --- a/examples/cvode/ginkgo/cv_kpr_ginkgo.OMP.out +++ b/examples/cvode/ginkgo/cv_kpr_ginkgo.OMP.out @@ -2,40 +2,40 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127015255760251e+00 1.551834236014491e+00 5.427527120849263e-06 3.461563388551525e-05 - 2.000000000000000e+00 8.899063052159882e-01 1.154580618898990e+00 3.736545446164641e-06 2.396023600637065e-06 - 3.000000000000000e+00 7.106357897254315e-01 1.023511014117009e+00 3.701340125505936e-07 5.971372163626754e-06 - 4.000000000000000e+00 8.204730434770026e-01 1.374633204303529e+00 1.325146535946509e-06 1.342254291936129e-06 - 5.000000000000000e+00 1.068567206732827e+00 1.691859872652205e+00 2.237846230324081e-06 2.097007084955749e-05 - 6.000000000000000e+00 1.216591477076802e+00 1.677549905979624e+00 3.977829344581352e-06 2.170865254003118e-06 - 7.000000000000000e+00 1.173440398485579e+00 1.342489756549872e+00 4.790038462987312e-06 3.438448131332095e-05 - 8.000000000000000e+00 9.629422734371874e-01 1.012130360056326e+00 4.070282024759564e-06 1.836664612886452e-05 - 9.000000000000000e+00 7.378653508314323e-01 1.183912595295466e+00 7.052065563950549e-06 4.607792868904781e-05 - 1.000000000000000e+01 7.618860082744591e-01 1.577087825621668e+00 3.973139246160606e-06 5.812850294883987e-06 + 2.000000000000000e+00 8.899063052160227e-01 1.154580618899685e+00 3.736545480581555e-06 2.396022905637452e-06 + 3.000000000000000e+00 7.106357897282861e-01 1.023511014266122e+00 3.701311579451527e-07 5.971223050904584e-06 + 4.000000000000000e+00 8.204737066423865e-01 1.374645697471208e+00 6.619811520058860e-07 1.383542197141985e-05 + 5.000000000000000e+00 1.068565569299513e+00 1.691845504002911e+00 6.004129167180849e-07 6.601421555618714e-06 + 6.000000000000000e+00 1.216590434430995e+00 1.677565465618063e+00 2.935183537555730e-06 1.338877318590725e-05 + 7.000000000000000e+00 1.173442077390312e+00 1.342502650714524e+00 6.468943196447086e-06 4.727864596532072e-05 + 8.000000000000000e+00 9.629502113806588e-01 1.012158812621809e+00 1.200822549618508e-05 4.681921161231450e-05 + 9.000000000000000e+00 7.378653673097488e-01 1.183877036028049e+00 7.068543880439648e-06 1.051866127199652e-05 + 1.000000000000000e+01 7.618846538383774e-01 1.577088845530052e+00 2.618703164536385e-06 6.832758678632089e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.0065538929512 -Steps = 1561 -Error test fails = 126 -NLS step fails = 2 +Current time = 10.00589721581489 +Steps = 1540 +Error test fails = 145 +NLS step fails = 1 Initial step size = 0.0001029860256095084 -Last step size = 0.01296396850522329 -Current step size = 0.01296396850522329 +Last step size = 0.00839188185788128 +Current step size = 0.00839188185788128 Last method order = 5 Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 2127 -NLS iters = 2124 -NLS fails = 4 -NLS iters per step = 1.360666239590006 -LS setups = 241 -Jac fn evals = 31 +RHS fn evals = 2153 +NLS iters = 2150 +NLS fails = 2 +NLS iters per step = 1.396103896103896 +LS setups = 269 +Jac fn evals = 28 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 -LS iters = 1978 +LS iters = 1996 LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 -LS iters per NLS iter = 0.931261770244821 -Jac evals per NLS iter = 0.01459510357815443 +LS iters per NLS iter = 0.9283720930232559 +Jac evals per NLS iter = 0.01302325581395349 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/examples/cvode/ginkgo/cv_kpr_ginkgo.REF.out b/examples/cvode/ginkgo/cv_kpr_ginkgo.REF.out index 0f09653946..0c2beb53b0 100644 --- a/examples/cvode/ginkgo/cv_kpr_ginkgo.REF.out +++ b/examples/cvode/ginkgo/cv_kpr_ginkgo.REF.out @@ -1,41 +1,41 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127015255760460e+00 1.551834235951876e+00 5.427527329349147e-06 3.461557127049097e-05 - 2.000000000000000e+00 8.899062418025651e-01 1.154579388557133e+00 3.673132022985470e-06 3.626365457032321e-06 - 3.000000000000000e+00 7.106372003170185e-01 1.023541117584009e+00 1.040457574430498e-06 2.413209483664858e-05 - 4.000000000000000e+00 8.204792893366972e-01 1.374660701807539e+00 4.920713158718115e-06 2.883975830236807e-05 - 5.000000000000000e+00 1.068569458535815e+00 1.691842152674116e+00 4.489649217953584e-06 3.250092760476164e-06 - 6.000000000000000e+00 1.216591319830518e+00 1.677575467762750e+00 3.820583059921390e-06 2.339091787217917e-05 - 7.000000000000000e+00 1.173438706764417e+00 1.342470449257923e+00 3.098317301830633e-06 1.507718936410996e-05 - 8.000000000000000e+00 9.629406197442182e-01 1.012135520323376e+00 2.416589055531659e-06 2.352691317852873e-05 - 9.000000000000000e+00 7.378601815098237e-01 1.183877132313276e+00 1.882743955294863e-06 1.061494649823302e-05 - 1.000000000000000e+01 7.618901162607479e-01 1.577111105965819e+00 8.081125534964428e-06 2.909319444577285e-05 + 1.000000000000000e+00 1.127015255760461e+00 1.551834235951888e+00 5.427527330681414e-06 3.461557128225934e-05 + 2.000000000000000e+00 8.899062418311091e-01 1.154579389055788e+00 3.673160567041478e-06 3.625866802137168e-06 + 3.000000000000000e+00 7.106372003676831e-01 1.023541117637381e+00 1.040508239014137e-06 2.413214820862208e-05 + 4.000000000000000e+00 8.204776106355206e-01 1.374644898383895e+00 3.242011982096393e-06 1.303633465776777e-05 + 5.000000000000000e+00 1.068564489425404e+00 1.691825292483085e+00 4.794611920821978e-07 1.361009826994497e-05 + 6.000000000000000e+00 1.216589874084136e+00 1.677560264733187e+00 2.374836678420422e-06 8.187888309807434e-06 + 7.000000000000000e+00 1.173439604619271e+00 1.342482029285117e+00 3.996172155185107e-06 2.665721655881192e-05 + 8.000000000000000e+00 9.629431686313948e-01 1.012139331244370e+00 4.965476232188237e-06 2.733783417285807e-05 + 9.000000000000000e+00 7.378655717825112e-01 1.183894485535914e+00 7.273016642828090e-06 2.796816913663847e-05 + 1.000000000000000e+01 7.618861274994186e-01 1.577091661650115e+00 4.092364205732224e-06 9.648878741996825e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.0062929489372 -Steps = 1569 -Error test fails = 141 -NLS step fails = 2 +Current time = 10.00101108153275 +Steps = 1560 +Error test fails = 129 +NLS step fails = 1 Initial step size = 0.0001029860256095084 -Last step size = 0.01309369414763129 -Current step size = 0.02449709879261396 -Last method order = 5 -Current method order = 5 +Last step size = 0.00583268159666712 +Current step size = 0.00583268159666712 +Last method order = 4 +Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2185 -NLS iters = 2182 -NLS fails = 4 -NLS iters per step = 1.390694710006374 -LS setups = 267 -Jac fn evals = 31 +RHS fn evals = 2131 +NLS iters = 2128 +NLS fails = 2 +NLS iters per step = 1.364102564102564 +LS setups = 242 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 -LS iters = 2027 +LS iters = 1982 LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 -LS iters per NLS iter = 0.9289642529789184 -Jac evals per NLS iter = 0.01420714940421632 +LS iters per NLS iter = 0.931390977443609 +Jac evals per NLS iter = 0.01362781954887218 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.out b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.out index 43405a3728..80ef50f734 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_bbd_p.out +++ b/examples/cvode/parallel/cvDiurnal_kry_bbd_p.out @@ -28,43 +28,43 @@ 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 = 368 order = 4 stepsize = 3.95e+02 -At bottom left: c1, c2 = 6.243e-08 3.382e+11 -At top right: c1, c2 = 7.021e-08 3.804e+11 +At bottom left: c1, c2 = 6.245e-08 3.382e+11 +At top right: c1, c2 = 7.023e-08 3.804e+11 t = 5.04e+04 no. steps = 388 order = 5 stepsize = 4.74e+02 -At bottom left: c1, c2 = 3.000e-07 3.358e+11 -At top right: c1, c2 = 3.306e-07 3.864e+11 +At bottom left: c1, c2 = 3.031e-07 3.358e+11 +At top right: c1, c2 = 3.340e-07 3.864e+11 -t = 5.76e+04 no. steps = 401 order = 5 stepsize = 3.61e+02 -At bottom left: c1, c2 = -1.096e-10 3.320e+11 -At top right: c1, c2 = -6.268e-11 3.909e+11 +t = 5.76e+04 no. steps = 401 order = 5 stepsize = 3.50e+02 +At bottom left: c1, c2 = 4.503e-11 3.320e+11 +At top right: c1, c2 = 1.065e-10 3.909e+11 -t = 6.48e+04 no. steps = 414 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 1.186e-11 3.313e+11 -At top right: c1, c2 = 6.568e-14 3.963e+11 +t = 6.48e+04 no. steps = 418 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = -5.893e-09 3.313e+11 +At top right: c1, c2 = -1.672e-08 3.963e+11 -t = 7.20e+04 no. steps = 425 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = -7.713e-12 3.330e+11 -At top right: c1, c2 = 5.432e-13 4.039e+11 +t = 7.20e+04 no. steps = 430 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = -7.098e-11 3.330e+11 +At top right: c1, c2 = -2.001e-10 4.039e+11 -t = 7.92e+04 no. steps = 436 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 2.525e-13 3.334e+11 -At top right: c1, c2 = -2.072e-14 4.120e+11 +t = 7.92e+04 no. steps = 443 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = 7.023e-13 3.334e+11 +At top right: c1, c2 = 1.967e-12 4.120e+11 -t = 8.64e+04 no. steps = 448 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 4.758e-15 3.352e+11 -At top right: c1, c2 = 7.572e-17 4.163e+11 +t = 8.64e+04 no. steps = 455 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = 5.803e-14 3.352e+11 +At top right: c1, c2 = 1.602e-13 4.163e+11 Final Statistics: lenrw = 2689 leniw = 144 lenrwls = 2454 leniwls = 126 -nst = 448 -nfe = 580 nfels = 509 -nni = 577 nli = 509 -nsetups = 76 netf = 26 -npe = 8 nps = 1029 +nst = 455 +nfe = 596 nfels = 531 +nni = 593 nli = 531 +nsetups = 83 netf = 30 +npe = 8 nps = 1066 ncfn = 0 ncfl = 0 In CVBBDPRE: real/integer local work space sizes = 1300, 192 diff --git a/examples/cvode/parallel/cvDiurnal_kry_p.out b/examples/cvode/parallel/cvDiurnal_kry_p.out index 184735ecbd..9639084c30 100644 --- a/examples/cvode/parallel/cvDiurnal_kry_p.out +++ b/examples/cvode/parallel/cvDiurnal_kry_p.out @@ -13,51 +13,51 @@ t = 2.16e+04 no. steps = 277 order = 5 stepsize = 2.75e+02 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 = 321 order = 3 stepsize = 5.19e+01 +t = 2.88e+04 no. steps = 316 order = 4 stepsize = 1.51e+02 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 = 384 order = 4 stepsize = 8.70e+01 +t = 3.60e+04 no. steps = 355 order = 4 stepsize = 7.19e+01 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 = 456 order = 4 stepsize = 8.77e+02 -At bottom left: c1, c2 = 1.077e-06 3.382e+11 -At top right: c1, c2 = 4.057e-07 3.804e+11 +t = 4.32e+04 no. steps = 416 order = 4 stepsize = 3.62e+02 +At bottom left: c1, c2 = -1.316e-07 3.382e+11 +At top right: c1, c2 = -1.475e-07 3.804e+11 -t = 5.04e+04 no. steps = 471 order = 4 stepsize = 3.29e+02 -At bottom left: c1, c2 = -1.176e-08 3.358e+11 -At top right: c1, c2 = -5.053e-08 3.864e+11 +t = 5.04e+04 no. steps = 430 order = 5 stepsize = 6.16e+02 +At bottom left: c1, c2 = -3.937e-07 3.358e+11 +At top right: c1, c2 = -4.373e-07 3.864e+11 -t = 5.76e+04 no. steps = 488 order = 5 stepsize = 3.95e+02 -At bottom left: c1, c2 = -9.464e-11 3.320e+11 -At top right: c1, c2 = -3.493e-10 3.909e+11 +t = 5.76e+04 no. steps = 442 order = 5 stepsize = 4.00e+02 +At bottom left: c1, c2 = -4.342e-10 3.320e+11 +At top right: c1, c2 = -4.873e-10 3.909e+11 -t = 6.48e+04 no. steps = 501 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = 5.057e-11 3.313e+11 -At top right: c1, c2 = 1.868e-10 3.963e+11 +t = 6.48e+04 no. steps = 453 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = 2.031e-10 3.313e+11 +At top right: c1, c2 = 2.236e-10 3.963e+11 -t = 7.20e+04 no. steps = 512 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = -4.454e-11 3.330e+11 -At top right: c1, c2 = -1.629e-10 4.039e+11 +t = 7.20e+04 no. steps = 465 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -2.118e-12 3.330e+11 +At top right: c1, c2 = -2.335e-12 4.039e+11 -t = 7.92e+04 no. steps = 524 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = -2.189e-13 3.334e+11 -At top right: c1, c2 = -8.112e-13 4.120e+11 +t = 7.92e+04 no. steps = 476 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -6.684e-14 3.334e+11 +At top right: c1, c2 = -7.358e-14 4.120e+11 -t = 8.64e+04 no. steps = 535 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = 1.080e-15 3.352e+11 -At top right: c1, c2 = 3.729e-15 4.163e+11 +t = 8.64e+04 no. steps = 487 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -1.055e-15 3.352e+11 +At top right: c1, c2 = -1.168e-15 4.163e+11 Final Statistics: lenrw = 2689 leniw = 144 lenrwls = 2454 leniwls = 126 -nst = 535 -nfe = 687 nfels = 668 -nni = 684 nli = 668 -nsetups = 92 netf = 33 -npe = 10 nps = 1294 -ncfn = 0 ncfl = 1 +nst = 487 +nfe = 618 nfels = 623 +nni = 615 nli = 623 +nsetups = 79 netf = 26 +npe = 9 nps = 1179 +ncfn = 0 ncfl = 0 diff --git a/examples/cvode/petsc/cvAdvDiff_petsc.out b/examples/cvode/petsc/cvAdvDiff_petsc.out index 2a57756f73..f77d5079dc 100644 --- a/examples/cvode/petsc/cvAdvDiff_petsc.out +++ b/examples/cvode/petsc/cvAdvDiff_petsc.out @@ -11,9 +11,9 @@ At t = 2.00 max.norm(u) = 7.110166e-02 nst = 191 At t = 2.50 max.norm(u) = 2.026588e-02 nst = 200 At t = 3.00 max.norm(u) = 5.777465e-03 nst = 208 At t = 3.50 max.norm(u) = 1.648873e-03 nst = 215 -At t = 4.00 max.norm(u) = 4.618997e-04 nst = 222 +At t = 4.00 max.norm(u) = 4.618996e-04 nst = 222 At t = 4.50 max.norm(u) = 1.368196e-04 nst = 233 -At t = 5.00 max.norm(u) = 3.827558e-05 nst = 245 +At t = 5.00 max.norm(u) = 3.827557e-05 nst = 245 Final Statistics: diff --git a/examples/cvode/petsc/cv_petsc_ex7.out b/examples/cvode/petsc/cv_petsc_ex7.out index 77afe7dcd7..7eff31b1f7 100644 --- a/examples/cvode/petsc/cv_petsc_ex7.out +++ b/examples/cvode/petsc/cv_petsc_ex7.out @@ -4,35 +4,35 @@ timestep 0 time 0. norm 1.9391 0 SNES Function norm < 1.e-11 1 SNES Function norm < 1.e-11 timestep 1 time 2.02546e-09 norm 1.9391 - 0 SNES Function norm 3.89123e-05 - 1 SNES Function norm 1.914e-11 + 0 SNES Function norm 3.89123e-05 + 1 SNES Function norm 1.914e-11 2 SNES Function norm < 1.e-11 timestep 2 time 2.02566e-05 norm 1.93261 - 0 SNES Function norm 0.000467204 - 1 SNES Function norm 3.68438e-09 + 0 SNES Function norm 0.000467204 + 1 SNES Function norm 3.68438e-09 2 SNES Function norm < 1.e-11 timestep 3 time 9.08689e-05 norm 1.91043 - 0 SNES Function norm 0.000453649 - 1 SNES Function norm 3.32905e-09 + 0 SNES Function norm 0.000453649 + 1 SNES Function norm 3.32905e-09 2 SNES Function norm < 1.e-11 timestep 4 time 0.000161481 norm 1.88869 - 0 SNES Function norm 0.000440607 - 1 SNES Function norm 2.95853e-09 + 0 SNES Function norm 0.000440607 + 1 SNES Function norm 2.95853e-09 2 SNES Function norm < 1.e-11 timestep 5 time 0.000232093 norm 1.8674 - 0 SNES Function norm 0.000428052 - 1 SNES Function norm 2.57762e-09 + 0 SNES Function norm 0.000428052 + 1 SNES Function norm 2.57763e-09 2 SNES Function norm < 1.e-11 timestep 6 time 0.000302706 norm 1.84652 - 0 SNES Function norm 0.000415963 - 1 SNES Function norm 2.19265e-09 + 0 SNES Function norm 0.000415963 + 1 SNES Function norm 2.19265e-09 2 SNES Function norm < 1.e-11 timestep 7 time 0.000373318 norm 1.82607 - 0 SNES Function norm 0.000404318 - 1 SNES Function norm 1.81429e-09 + 0 SNES Function norm 0.000404318 + 1 SNES Function norm 1.81429e-09 2 SNES Function norm < 1.e-11 timestep 8 time 0.00044393 norm 1.80601 - 0 SNES Function norm 0.000393097 - 1 SNES Function norm 1.46241e-09 + 0 SNES Function norm 0.000393097 + 1 SNES Function norm 1.46239e-09 2 SNES Function norm < 1.e-11 timestep 9 time 0.000514542 norm 1.78634 diff --git a/examples/cvode/serial/cvAnalytic_mels.c b/examples/cvode/serial/cvAnalytic_mels.c index 9a84c380c9..b16b5dd7e3 100644 --- a/examples/cvode/serial/cvAnalytic_mels.c +++ b/examples/cvode/serial/cvAnalytic_mels.c @@ -334,8 +334,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); - err = ewt * fabs(NV_Ith_S(y, 0) - ans); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(NV_Ith_S(y, 0) - ans); /* is the solution within the tolerances? */ passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; diff --git a/examples/cvode/serial/cvDirectDemo_ls.c b/examples/cvode/serial/cvDirectDemo_ls.c index 82b841682d..7f4564dcf4 100644 --- a/examples/cvode/serial/cvDirectDemo_ls.c +++ b/examples/cvode/serial/cvDirectDemo_ls.c @@ -252,7 +252,7 @@ static int Problem1(void) } if (iout % 2 == 0) { - er = fabs(NV_Ith_S(y, 0)) / abstol; + er = SUNRabs(NV_Ith_S(y, 0)) / abstol; if (er > ero) { ero = er; } if (er > P1_TOL_FACTOR) { @@ -320,7 +320,7 @@ static int Problem1(void) } if (iout % 2 == 0) { - er = fabs(NV_Ith_S(y, 0)) / abstol; + er = SUNRabs(NV_Ith_S(y, 0)) / abstol; if (er > ero) { ero = er; } if (er > P1_TOL_FACTOR) { @@ -701,7 +701,7 @@ static sunrealtype MaxError(N_Vector y, sunrealtype t) { k = i + j * P2_MESHX; yt = pow(t, i + j) * ex * ifact_inv * jfact_inv; - er = fabs(ydata[k] - yt); + er = SUNRabs(ydata[k] - yt); if (er > maxError) { maxError = er; } ifact_inv /= (i + 1); } diff --git a/examples/cvode/serial/cvDiurnal_kry.out b/examples/cvode/serial/cvDiurnal_kry.out index 5cb024040e..3db1024d7c 100644 --- a/examples/cvode/serial/cvDiurnal_kry.out +++ b/examples/cvode/serial/cvDiurnal_kry.out @@ -22,31 +22,31 @@ c1 (bot.left/middle/top rt.) = 1.404e+04 2.029e+04 1.561e+04 c2 (bot.left/middle/top rt.) = 3.387e+11 4.894e+11 3.765e+11 t = 4.32e+04 no. steps = 393 order = 4 stepsize = 2.57e+02 -c1 (bot.left/middle/top rt.) = -7.891e-06 -1.123e-06 -8.723e-06 +c1 (bot.left/middle/top rt.) = -7.924e-06 -1.148e-06 -8.759e-06 c2 (bot.left/middle/top rt.) = 3.382e+11 1.355e+11 3.804e+11 t = 5.04e+04 no. steps = 421 order = 5 stepsize = 4.96e+02 -c1 (bot.left/middle/top rt.) = -1.595e-08 -1.771e-06 -3.117e-08 +c1 (bot.left/middle/top rt.) = -1.599e-08 -1.775e-06 -3.124e-08 c2 (bot.left/middle/top rt.) = 3.358e+11 4.930e+11 3.864e+11 -t = 5.76e+04 no. steps = 439 order = 4 stepsize = 1.19e+02 -c1 (bot.left/middle/top rt.) = -2.127e-06 -1.513e-04 -2.951e-06 +t = 5.76e+04 no. steps = 437 order = 5 stepsize = 2.10e+02 +c1 (bot.left/middle/top rt.) = -1.239e-08 -8.964e-07 -1.736e-08 c2 (bot.left/middle/top rt.) = 3.320e+11 9.650e+11 3.909e+11 -t = 6.48e+04 no. steps = 458 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.084e-09 -7.686e-08 -1.499e-09 +t = 6.48e+04 no. steps = 464 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = 4.297e-11 2.962e-09 5.854e-11 c2 (bot.left/middle/top rt.) = 3.313e+11 8.922e+11 3.963e+11 -t = 7.20e+04 no. steps = 469 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.093e-10 -7.736e-09 -1.510e-10 +t = 7.20e+04 no. steps = 473 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = 1.150e-11 7.919e-10 1.566e-11 c2 (bot.left/middle/top rt.) = 3.330e+11 6.186e+11 4.039e+11 -t = 7.92e+04 no. steps = 480 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.624e-12 -1.151e-10 -2.246e-12 +t = 7.92e+04 no. steps = 483 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = -4.188e-13 -2.884e-11 -5.703e-13 c2 (bot.left/middle/top rt.) = 3.334e+11 6.669e+11 4.120e+11 -t = 8.64e+04 no. steps = 491 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = 3.501e-14 2.474e-12 4.816e-14 +t = 8.64e+04 no. steps = 492 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = -3.268e-14 -2.246e-12 -4.447e-14 c2 (bot.left/middle/top rt.) = 3.352e+11 9.107e+11 4.163e+11 @@ -54,10 +54,10 @@ Final Statistics.. lenrw = 2689 leniw = 53 lenrwLS = 2454 leniwLS = 42 -nst = 491 -nfe = 630 nfeLS = 0 -nni = 627 nli = 643 -nsetups = 82 netf = 29 -npe = 9 nps = 1214 +nst = 492 +nfe = 637 nfeLS = 0 +nni = 634 nli = 649 +nsetups = 88 netf = 32 +npe = 9 nps = 1223 ncfn = 0 ncfl = 0 diff --git a/examples/cvode/serial/cvDiurnal_kry_bp.out b/examples/cvode/serial/cvDiurnal_kry_bp.out index 715f28bf22..06b0c57bcd 100644 --- a/examples/cvode/serial/cvDiurnal_kry_bp.out +++ b/examples/cvode/serial/cvDiurnal_kry_bp.out @@ -26,32 +26,32 @@ c1 (bot.left/middle/top rt.) = 1.404e+04 2.029e+04 1.561e+04 c2 (bot.left/middle/top rt.) = 3.387e+11 4.894e+11 3.765e+11 t = 4.32e+04 no. steps = 402 order = 4 stepsize = 4.48e+02 -c1 (bot.left/middle/top rt.) = 1.915e-07 -6.130e-06 4.395e-07 +c1 (bot.left/middle/top rt.) = 1.929e-07 -6.029e-06 4.403e-07 c2 (bot.left/middle/top rt.) = 3.382e+11 1.355e+11 3.804e+11 -t = 5.04e+04 no. steps = 422 order = 4 stepsize = 3.17e+02 -c1 (bot.left/middle/top rt.) = -7.746e-11 -3.073e-08 -3.512e-11 +t = 5.04e+04 no. steps = 421 order = 4 stepsize = 3.30e+02 +c1 (bot.left/middle/top rt.) = 1.559e-09 6.319e-07 6.062e-10 c2 (bot.left/middle/top rt.) = 3.358e+11 4.930e+11 3.864e+11 -t = 5.76e+04 no. steps = 436 order = 5 stepsize = 3.58e+02 -c1 (bot.left/middle/top rt.) = 1.801e-11 7.177e-09 8.588e-12 +t = 5.76e+04 no. steps = 435 order = 5 stepsize = 4.67e+02 +c1 (bot.left/middle/top rt.) = -2.660e-12 -1.080e-09 -1.030e-12 c2 (bot.left/middle/top rt.) = 3.320e+11 9.650e+11 3.909e+11 -t = 6.48e+04 no. steps = 449 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = -2.845e-14 -1.063e-11 -1.382e-14 +t = 6.48e+04 no. steps = 447 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -7.375e-15 -2.742e-12 -2.920e-15 c2 (bot.left/middle/top rt.) = 3.313e+11 8.922e+11 3.963e+11 -t = 7.20e+04 no. steps = 461 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 2.710e-16 1.011e-13 1.307e-16 +t = 7.20e+04 no. steps = 457 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -1.202e-17 -4.105e-15 -5.445e-18 c2 (bot.left/middle/top rt.) = 3.330e+11 6.186e+11 4.039e+11 -t = 7.92e+04 no. steps = 473 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 5.698e-16 2.058e-13 2.690e-16 +t = 7.92e+04 no. steps = 467 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -8.193e-21 -1.461e-15 -7.837e-19 c2 (bot.left/middle/top rt.) = 3.334e+11 6.669e+11 4.120e+11 -t = 8.64e+04 no. steps = 485 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 2.707e-16 1.899e-17 2.156e-15 -c2 (bot.left/middle/top rt.) = 3.352e+11 9.106e+11 4.163e+11 +t = 8.64e+04 no. steps = 477 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -7.290e-20 -3.730e-15 -4.364e-20 +c2 (bot.left/middle/top rt.) = 3.352e+11 9.106e+11 4.162e+11 Final Statistics.. @@ -59,12 +59,12 @@ Final Statistics.. lenrw = 2689 leniw = 53 lenrwls = 2454 leniwls = 42 lenrwbp = 2800 leniwbp = 622 -nst = 485 -nfe = 616 nfetot = 1258 -nfeLS = 597 nfeBP = 45 -nni = 613 nli = 597 +nst = 477 +nfe = 613 nfetot = 1267 +nfeLS = 614 nfeBP = 40 +nni = 610 nli = 614 nsetups = 85 netf = 28 -npe = 9 nps = 1134 +npe = 8 nps = 1142 ncfn = 0 ncfl = 0 diff --git a/examples/cvode/serial/cvKrylovDemo_prec.c b/examples/cvode/serial/cvKrylovDemo_prec.c index c3c886f6d3..da68763269 100644 --- a/examples/cvode/serial/cvKrylovDemo_prec.c +++ b/examples/cvode/serial/cvKrylovDemo_prec.c @@ -847,7 +847,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm(fc, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -865,7 +865,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = -gamma / r; fblock(t, cdata, jx, jy, f1, wdata); diff --git a/examples/cvode/serial/cvParticle_dns.out b/examples/cvode/serial/cvParticle_dns.out index 15517a2bd3..0901a32138 100644 --- a/examples/cvode/serial/cvParticle_dns.out +++ b/examples/cvode/serial/cvParticle_dns.out @@ -14,13 +14,13 @@ tstop = 0 t x y err x err y err constr 0.0000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -6.2832e+02 9.977240e-01 6.742947e-02 -2.275957e-03 6.742947e-02 2.220446e-16 +6.2832e+02 9.979545e-01 6.392827e-02 -2.045504e-03 6.392827e-02 0.000000e+00 Integration Statistics: -Number of steps taken = 4044 -Number of function evaluations = 5831 -Number of linear solver setups = 806 -Number of Jacobian evaluations = 103 -Number of nonlinear solver iterations = 5828 -Number of convergence failures = 40 -Number of error test failures = 329 +Number of steps taken = 4131 +Number of function evaluations = 6030 +Number of linear solver setups = 862 +Number of Jacobian evaluations = 115 +Number of nonlinear solver iterations = 6027 +Number of convergence failures = 52 +Number of error test failures = 343 diff --git a/examples/cvode/superludist/cvAdvDiff_sludist_64.out b/examples/cvode/superludist/cvAdvDiff_sludist_64.out index 952fa6165b..3b78452b29 100644 --- a/examples/cvode/superludist/cvAdvDiff_sludist_64.out +++ b/examples/cvode/superludist/cvAdvDiff_sludist_64.out @@ -7,15 +7,15 @@ At t = 0.00 max.norm(u) = 1.569909e+01 nst = 0 At t = 0.50 max.norm(u) = 3.052882e+00 nst = 87 At t = 1.00 max.norm(u) = 8.753282e-01 nst = 111 At t = 1.50 max.norm(u) = 2.494975e-01 nst = 127 -At t = 2.00 max.norm(u) = 7.110209e-02 nst = 140 -At t = 2.50 max.norm(u) = 2.026483e-02 nst = 152 -At t = 3.00 max.norm(u) = 5.779707e-03 nst = 160 -At t = 3.50 max.norm(u) = 1.647758e-03 nst = 169 -At t = 4.00 max.norm(u) = 4.804265e-04 nst = 177 -At t = 4.50 max.norm(u) = 1.379288e-04 nst = 190 -At t = 5.00 max.norm(u) = 3.850547e-05 nst = 201 +At t = 2.00 max.norm(u) = 7.110208e-02 nst = 140 +At t = 2.50 max.norm(u) = 2.025919e-02 nst = 152 +At t = 3.00 max.norm(u) = 5.773399e-03 nst = 164 +At t = 3.50 max.norm(u) = 1.643311e-03 nst = 171 +At t = 4.00 max.norm(u) = 4.687907e-04 nst = 175 +At t = 4.50 max.norm(u) = 1.389315e-04 nst = 178 +At t = 5.00 max.norm(u) = 4.703179e-05 nst = 183 Final Statistics: -nst = 201 nfe = 285 nni = 282 ncfn = 0 netf = 17 +nst = 183 nfe = 259 nni = 256 ncfn = 0 netf = 15 diff --git a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.out b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.out index 37d74b40fa..b2cb071fb8 100644 --- a/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.out +++ b/examples/cvodes/F2003_serial/cvs_analytic_fp_f2003.out @@ -16,16 +16,16 @@ 1.00000E+01 1.47113E+00 General Solver Stats: - Total internal steps taken = 1817 - Total rhs function calls = 3933 + Total internal steps taken = 2065 + Total rhs function calls = 4552 Num lin solver setup calls = 0 Num error test failures = 0 Last method order = 1 Next method order = 1 First internal step size = 6.10352E-12 - Last internal step size = 3.95234E-03 - Next internal step size = 3.95234E-03 - Current internal time = 1.00010E+01 - Num nonlinear solver iters = 3930 - Num nonlinear solver fails = 614 + Last internal step size = 3.95126E-03 + Next internal step size = 1.58240E-02 + Current internal time = 1.00031E+01 + Num nonlinear solver iters = 4549 + Num nonlinear solver fails = 755 diff --git a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_sim_t.out b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_sim_t.out index f75c143a94..41a2300a7b 100644 --- a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_sim_t.out +++ b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_sim_t.out @@ -15,7 +15,7 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -4.3853e+14 -5.0065e+14 -2.4407e+18 -2.7843e+18 ------------------------------------------------------------------------ -1.440e+04 3 5.071e+01 862 +1.440e+04 3 1.064e+02 612 Solution 6.6590e+06 7.3008e+06 2.5819e+11 2.8329e+11 ---------------------------------------- @@ -25,7 +25,7 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -4.5235e+17 -5.4318e+17 -6.5418e+21 -7.8315e+21 ------------------------------------------------------------------------ -2.160e+04 3 5.422e+01 1115 +2.160e+04 3 7.174e+01 890 Solution 2.6650e+07 2.9308e+07 2.9928e+11 3.3134e+11 ---------------------------------------- @@ -35,8 +35,8 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -7.6601e+18 -9.4433e+18 -7.6459e+22 -9.4501e+22 ------------------------------------------------------------------------ -2.880e+04 3 4.027e+01 1446 - Solution 8.7021e+06 9.6501e+06 +2.880e+04 3 6.438e+01 1123 + Solution 8.7021e+06 9.6500e+06 3.3804e+11 3.7510e+11 ---------------------------------------- Sensitivity 1 -5.3375e+22 -5.9187e+22 @@ -45,95 +45,95 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -4.8855e+18 -6.1040e+18 -1.7194e+23 -2.1518e+23 ------------------------------------------------------------------------ -3.600e+04 4 6.446e+01 1550 +3.600e+04 4 3.134e+01 1265 Solution 1.4040e+04 1.5609e+04 3.3868e+11 3.7652e+11 ---------------------------------------- - Sensitivity 1 -8.6141e+19 -9.5762e+19 + Sensitivity 1 -8.6141e+19 -9.5761e+19 5.2718e+23 6.6030e+23 ---------------------------------------- Sensitivity 2 -8.4328e+15 -1.0549e+16 -1.8439e+23 -2.3096e+23 ------------------------------------------------------------------------ -4.320e+04 4 1.552e+02 1802 - Solution -6.7943e-09 -1.7531e-08 +4.320e+04 4 2.857e+02 1891 + Solution -3.3615e-10 -3.9530e-10 3.3823e+11 3.8035e+11 ---------------------------------------- - Sensitivity 1 1.5377e+08 -1.8226e+09 + Sensitivity 1 7.3630e+08 8.0958e+08 5.2753e+23 6.7448e+23 ---------------------------------------- - Sensitivity 2 4.9296e+03 -1.7707e+04 + Sensitivity 2 2.1809e+05 1.1760e+05 -1.8454e+23 -2.3595e+23 ------------------------------------------------------------------------ -5.040e+04 4 1.552e+02 1848 - Solution -3.3333e-09 -1.0074e-08 +5.040e+04 5 3.151e+02 1962 + Solution -8.0116e-11 -2.5727e-10 3.3582e+11 3.8645e+11 ---------------------------------------- - Sensitivity 1 7.6593e+08 2.3212e+09 - 5.2067e+23 6.9664e+23 + Sensitivity 1 3.5267e+07 1.1344e+08 + 5.2066e+23 6.9664e+23 ---------------------------------------- - Sensitivity 2 3.2953e+07 1.2254e+08 + Sensitivity 2 8.5297e+02 3.2356e+03 -1.8214e+23 -2.4370e+23 ------------------------------------------------------------------------ -5.760e+04 5 2.333e+02 1871 - Solution -8.0165e-13 -2.6806e-12 +5.760e+04 5 4.748e+02 1978 + Solution -9.9136e-10 -3.1770e-09 3.3203e+11 3.9090e+11 ---------------------------------------- - Sensitivity 1 -1.3115e+05 -4.2823e+05 + Sensitivity 1 -1.1351e+08 -3.5554e+08 5.0825e+23 7.1205e+23 ---------------------------------------- - Sensitivity 2 6.8742e+01 1.6059e+02 + Sensitivity 2 -7.2327e+02 -2.6860e+03 -1.7780e+23 -2.4910e+23 ------------------------------------------------------------------------ -6.480e+04 5 2.801e+02 1893 - Solution -2.8173e-08 -9.8429e-08 +6.480e+04 3 1.695e+02 2091 + Solution 2.2622e-12 5.4339e-13 3.3130e+11 3.9634e+11 ---------------------------------------- - Sensitivity 1 2.2918e+09 7.9585e+09 + Sensitivity 1 2.6502e+07 7.2017e+06 5.0442e+23 7.3274e+23 ---------------------------------------- - Sensitivity 2 7.1238e+05 2.7790e+06 + Sensitivity 2 1.3184e+06 1.8801e+06 -1.7646e+23 -2.5633e+23 ------------------------------------------------------------------------ -7.200e+04 4 1.003e+02 2580 - Solution -1.1403e-08 -6.9110e-08 +7.200e+04 4 3.017e+02 2123 + Solution -1.3609e-12 -5.8149e-13 3.3297e+11 4.0389e+11 ---------------------------------------- - Sensitivity 1 6.8126e+08 4.1340e+09 + Sensitivity 1 -3.3229e+06 -1.2125e+06 5.0783e+23 7.6382e+23 ---------------------------------------- - Sensitivity 2 -3.8340e+07 -2.6839e+08 + Sensitivity 2 -4.3073e+03 -6.2477e+03 -1.7765e+23 -2.6721e+23 ------------------------------------------------------------------------ -7.920e+04 4 4.453e+02 2608 - Solution 4.8775e-18 2.7563e-17 +7.920e+04 5 5.440e+02 2140 + Solution 7.8343e-11 1.5542e-11 3.3344e+11 4.1203e+11 ---------------------------------------- - Sensitivity 1 1.2984e+02 7.7701e+02 + Sensitivity 1 3.3505e+06 6.6024e+05 5.0730e+23 7.9960e+23 ---------------------------------------- - Sensitivity 2 -4.4037e-01 -3.1248e+00 + Sensitivity 2 2.3901e+01 -2.0257e+00 -1.7747e+23 -2.7972e+23 ------------------------------------------------------------------------ -8.640e+04 5 7.396e+02 2619 - Solution -2.5590e-20 -1.5317e-19 +8.640e+04 5 5.440e+02 2153 + Solution 3.1822e-13 3.6061e-14 3.3518e+11 4.1625e+11 ---------------------------------------- - Sensitivity 1 1.6342e+00 9.8016e+00 + Sensitivity 1 6.2294e+05 1.8989e+05 5.1171e+23 8.2142e+23 ---------------------------------------- - Sensitivity 2 -5.6895e-03 -4.0306e-02 + Sensitivity 2 5.8847e+00 2.9717e+00 -1.7901e+23 -2.8736e+23 ------------------------------------------------------------------------ Final Statistics -nst = 2619 +nst = 2153 -nfe = 3582 -netf = 150 nsetups = 436 -nni = 3580 ncfn = 12 +nfe = 3024 +netf = 130 nsetups = 383 +nni = 3020 ncfn = 8 -nfSe = 7164 nfeS = 14328 +nfSe = 6048 nfeS = 12096 netfs = 0 nsetupsS = 0 nniS = 0 ncfnS = 0 diff --git a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_stg_t.out b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_stg_t.out index e18e1f5274..436d47edd6 100644 --- a/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_stg_t.out +++ b/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p_-sensi_stg_t.out @@ -5,7 +5,7 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) ======================================================================== T Q H NST Bottom left Top right ======================================================================== -7.200e+03 4 3.759e+01 457 +7.200e+03 4 6.240e+01 456 Solution 1.0468e+04 1.1185e+04 2.5267e+11 2.6998e+11 ---------------------------------------- @@ -15,7 +15,7 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) Sensitivity 2 -4.3853e+14 -5.0065e+14 -2.4408e+18 -2.7843e+18 ------------------------------------------------------------------------ -1.440e+04 5 1.700e+02 504 +1.440e+04 4 1.666e+02 521 Solution 6.6590e+06 7.3008e+06 2.5819e+11 2.8329e+11 ---------------------------------------- @@ -25,7 +25,7 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) Sensitivity 2 -4.5235e+17 -5.4317e+17 -6.5418e+21 -7.8315e+21 ------------------------------------------------------------------------ -2.160e+04 5 1.741e+02 533 +2.160e+04 4 1.992e+02 606 Solution 2.6650e+07 2.9308e+07 2.9928e+11 3.3134e+11 ---------------------------------------- @@ -33,10 +33,10 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) 3.8203e+23 4.4991e+23 ---------------------------------------- Sensitivity 2 -7.6601e+18 -9.4433e+18 - -7.6459e+22 -9.4502e+22 + -7.6459e+22 -9.4501e+22 ------------------------------------------------------------------------ -2.880e+04 3 7.386e+01 591 - Solution 8.7021e+06 9.6501e+06 +2.880e+04 3 1.091e+02 673 + Solution 8.7021e+06 9.6500e+06 3.3804e+11 3.7510e+11 ---------------------------------------- Sensitivity 1 -5.3375e+22 -5.9187e+22 @@ -45,7 +45,7 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) Sensitivity 2 -4.8855e+18 -6.1040e+18 -1.7194e+23 -2.1518e+23 ------------------------------------------------------------------------ -3.600e+04 4 6.747e+01 640 +3.600e+04 4 8.486e+01 726 Solution 1.4040e+04 1.5609e+04 3.3868e+11 3.7652e+11 ---------------------------------------- @@ -55,85 +55,85 @@ Sensitivity: YES ( STAGGERED + FULL ERROR CONTROL ) Sensitivity 2 -8.4328e+15 -1.0549e+16 -1.8439e+23 -2.3096e+23 ------------------------------------------------------------------------ -4.320e+04 4 5.501e+01 711 - Solution -3.4085e-05 -3.8038e-05 +4.320e+04 5 2.007e+02 799 + Solution -3.2053e-07 -8.2067e-08 3.3823e+11 3.8035e+11 ---------------------------------------- - Sensitivity 1 2.0457e+11 2.2833e+11 + Sensitivity 1 2.5041e+09 1.1068e+09 5.2753e+23 6.7448e+23 ---------------------------------------- - Sensitivity 2 -3.7432e+07 -4.4338e+07 + Sensitivity 2 -2.7306e+08 -3.2516e+08 -1.8454e+23 -2.3595e+23 ------------------------------------------------------------------------ -5.040e+04 4 3.193e+02 749 - Solution 4.9786e-09 1.8755e-08 +5.040e+04 4 3.505e+02 834 + Solution -3.8285e-06 -4.1822e-06 3.3582e+11 3.8645e+11 ---------------------------------------- - Sensitivity 1 -5.9351e+05 -1.4673e+06 + Sensitivity 1 1.6643e+10 1.8174e+10 5.2067e+23 6.9664e+23 ---------------------------------------- - Sensitivity 2 -5.0185e+03 -7.2241e+03 + Sensitivity 2 4.0895e+10 4.6693e+10 -1.8214e+23 -2.4371e+23 ------------------------------------------------------------------------ -5.760e+04 5 3.685e+02 765 - Solution 3.6528e-09 1.3449e-08 +5.760e+04 5 3.805e+02 851 + Solution -3.3001e-09 -3.6176e-09 3.3203e+11 3.9090e+11 ---------------------------------------- - Sensitivity 1 -1.3328e+07 -4.9088e+07 - 5.0825e+23 7.1206e+23 + Sensitivity 1 -8.4985e+07 -9.3979e+07 + 5.0825e+23 7.1205e+23 ---------------------------------------- - Sensitivity 2 -1.2606e+02 -5.3214e+02 + Sensitivity 2 2.0322e+07 2.4170e+07 -1.7780e+23 -2.4910e+23 ------------------------------------------------------------------------ -6.480e+04 5 4.028e+02 787 - Solution -2.6095e-08 -1.2673e-07 +6.480e+04 5 3.938e+02 872 + Solution 1.1051e-06 1.2213e-06 3.3130e+11 3.9634e+11 ---------------------------------------- - Sensitivity 1 -4.5250e+08 -1.4629e+09 + Sensitivity 1 7.1018e+10 7.8084e+10 5.0442e+23 7.3274e+23 ---------------------------------------- - Sensitivity 2 1.2621e+08 5.4709e+08 + Sensitivity 2 -4.9939e+06 -5.8955e+06 -1.7646e+23 -2.5633e+23 ------------------------------------------------------------------------ -7.200e+04 5 4.028e+02 805 - Solution 1.3468e-08 7.3586e-08 +7.200e+04 5 3.938e+02 890 + Solution -4.0822e-06 -4.3014e-06 3.3297e+11 4.0389e+11 ---------------------------------------- - Sensitivity 1 -1.8639e+08 -9.6848e+08 + Sensitivity 1 3.7438e+10 3.9806e+10 5.0783e+23 7.6382e+23 ---------------------------------------- - Sensitivity 2 4.8773e+07 2.1183e+08 + Sensitivity 2 -2.8120e+07 -3.3371e+07 -1.7765e+23 -2.6721e+23 ------------------------------------------------------------------------ -7.920e+04 5 6.063e+02 818 - Solution 3.2625e-11 7.7753e-11 +7.920e+04 5 6.446e+02 905 + Solution -5.9523e-06 -6.1213e-06 3.3344e+11 4.1203e+11 ---------------------------------------- - Sensitivity 1 -7.3331e+05 -1.7444e+06 - 5.0731e+23 7.9960e+23 + Sensitivity 1 7.5332e+10 7.7483e+10 + 5.0730e+23 7.9960e+23 ---------------------------------------- - Sensitivity 2 9.4023e+04 4.0719e+05 + Sensitivity 2 7.4326e+05 9.4687e+05 -1.7747e+23 -2.7972e+23 ------------------------------------------------------------------------ -8.640e+04 5 6.063e+02 830 - Solution 4.0699e-13 1.0930e-12 +8.640e+04 5 6.446e+02 916 + Solution -1.2279e-07 -1.2697e-07 3.3518e+11 4.1625e+11 ---------------------------------------- - Sensitivity 1 -7.8747e+04 -1.7295e+05 + Sensitivity 1 3.2765e+09 3.3795e+09 5.1171e+23 8.2142e+23 ---------------------------------------- - Sensitivity 2 -2.8540e+02 -1.2871e+03 + Sensitivity 2 3.1113e+04 4.0059e+04 -1.7901e+23 -2.8736e+23 ------------------------------------------------------------------------ Final Statistics -nst = 830 +nst = 916 -nfe = 1789 -netf = 12 nsetups = 115 -nni = 937 ncfn = 0 +nfe = 1986 +netf = 12 nsetups = 134 +nni = 1039 ncfn = 0 -nfSe = 1938 nfeS = 3876 -netfs = 20 nsetupsS = 0 -nniS = 967 ncfnS = 0 +nfSe = 2198 nfeS = 4396 +netfs = 29 nsetupsS = 0 +nniS = 1097 ncfnS = 0 diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.out b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.out index 288a631346..e526a71063 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.out +++ b/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.out @@ -28,43 +28,43 @@ 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 = 368 order = 4 stepsize = 3.95e+02 -At bottom left: c1, c2 = 6.243e-08 3.382e+11 -At top right: c1, c2 = 7.021e-08 3.804e+11 +At bottom left: c1, c2 = 6.245e-08 3.382e+11 +At top right: c1, c2 = 7.023e-08 3.804e+11 t = 5.04e+04 no. steps = 388 order = 5 stepsize = 4.74e+02 -At bottom left: c1, c2 = 3.000e-07 3.358e+11 -At top right: c1, c2 = 3.306e-07 3.864e+11 +At bottom left: c1, c2 = 3.031e-07 3.358e+11 +At top right: c1, c2 = 3.340e-07 3.864e+11 -t = 5.76e+04 no. steps = 401 order = 5 stepsize = 3.61e+02 -At bottom left: c1, c2 = -1.096e-10 3.320e+11 -At top right: c1, c2 = -6.268e-11 3.909e+11 +t = 5.76e+04 no. steps = 401 order = 5 stepsize = 3.50e+02 +At bottom left: c1, c2 = 4.503e-11 3.320e+11 +At top right: c1, c2 = 1.065e-10 3.909e+11 -t = 6.48e+04 no. steps = 414 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 1.186e-11 3.313e+11 -At top right: c1, c2 = 6.568e-14 3.963e+11 +t = 6.48e+04 no. steps = 418 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = -5.893e-09 3.313e+11 +At top right: c1, c2 = -1.672e-08 3.963e+11 -t = 7.20e+04 no. steps = 425 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = -7.713e-12 3.330e+11 -At top right: c1, c2 = 5.432e-13 4.039e+11 +t = 7.20e+04 no. steps = 430 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = -7.098e-11 3.330e+11 +At top right: c1, c2 = -2.001e-10 4.039e+11 -t = 7.92e+04 no. steps = 436 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 2.525e-13 3.334e+11 -At top right: c1, c2 = -2.072e-14 4.120e+11 +t = 7.92e+04 no. steps = 443 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = 7.023e-13 3.334e+11 +At top right: c1, c2 = 1.967e-12 4.120e+11 -t = 8.64e+04 no. steps = 448 order = 5 stepsize = 6.38e+02 -At bottom left: c1, c2 = 4.758e-15 3.352e+11 -At top right: c1, c2 = 7.572e-17 4.163e+11 +t = 8.64e+04 no. steps = 455 order = 5 stepsize = 5.80e+02 +At bottom left: c1, c2 = 5.803e-14 3.352e+11 +At top right: c1, c2 = 1.602e-13 4.163e+11 Final Statistics: lenrw = 2696 leniw = 156 lenrwls = 2454 leniwls = 126 -nst = 448 -nfe = 580 nfels = 509 -nni = 577 nli = 509 -nsetups = 76 netf = 26 -npe = 8 nps = 1029 +nst = 455 +nfe = 596 nfels = 531 +nni = 593 nli = 531 +nsetups = 83 netf = 30 +npe = 8 nps = 1066 ncfn = 0 ncfl = 0 In CVBBDPRE: real/integer local work space sizes = 1300, 192 diff --git a/examples/cvodes/parallel/cvsDiurnal_kry_p.out b/examples/cvodes/parallel/cvsDiurnal_kry_p.out index cd02887cf2..9d51f8eb28 100644 --- a/examples/cvodes/parallel/cvsDiurnal_kry_p.out +++ b/examples/cvodes/parallel/cvsDiurnal_kry_p.out @@ -13,51 +13,51 @@ t = 2.16e+04 no. steps = 277 order = 5 stepsize = 2.75e+02 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 = 321 order = 3 stepsize = 5.19e+01 +t = 2.88e+04 no. steps = 316 order = 4 stepsize = 1.51e+02 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 = 384 order = 4 stepsize = 8.70e+01 +t = 3.60e+04 no. steps = 355 order = 4 stepsize = 7.19e+01 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 = 456 order = 4 stepsize = 8.77e+02 -At bottom left: c1, c2 = 1.077e-06 3.382e+11 -At top right: c1, c2 = 4.057e-07 3.804e+11 +t = 4.32e+04 no. steps = 416 order = 4 stepsize = 3.62e+02 +At bottom left: c1, c2 = -1.316e-07 3.382e+11 +At top right: c1, c2 = -1.475e-07 3.804e+11 -t = 5.04e+04 no. steps = 471 order = 4 stepsize = 3.29e+02 -At bottom left: c1, c2 = -1.176e-08 3.358e+11 -At top right: c1, c2 = -5.053e-08 3.864e+11 +t = 5.04e+04 no. steps = 430 order = 5 stepsize = 6.16e+02 +At bottom left: c1, c2 = -3.937e-07 3.358e+11 +At top right: c1, c2 = -4.373e-07 3.864e+11 -t = 5.76e+04 no. steps = 488 order = 5 stepsize = 3.95e+02 -At bottom left: c1, c2 = -9.464e-11 3.320e+11 -At top right: c1, c2 = -3.493e-10 3.909e+11 +t = 5.76e+04 no. steps = 442 order = 5 stepsize = 4.00e+02 +At bottom left: c1, c2 = -4.342e-10 3.320e+11 +At top right: c1, c2 = -4.873e-10 3.909e+11 -t = 6.48e+04 no. steps = 501 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = 5.057e-11 3.313e+11 -At top right: c1, c2 = 1.868e-10 3.963e+11 +t = 6.48e+04 no. steps = 453 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = 2.031e-10 3.313e+11 +At top right: c1, c2 = 2.236e-10 3.963e+11 -t = 7.20e+04 no. steps = 512 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = -4.454e-11 3.330e+11 -At top right: c1, c2 = -1.629e-10 4.039e+11 +t = 7.20e+04 no. steps = 465 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -2.118e-12 3.330e+11 +At top right: c1, c2 = -2.335e-12 4.039e+11 -t = 7.92e+04 no. steps = 524 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = -2.189e-13 3.334e+11 -At top right: c1, c2 = -8.112e-13 4.120e+11 +t = 7.92e+04 no. steps = 476 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -6.684e-14 3.334e+11 +At top right: c1, c2 = -7.358e-14 4.120e+11 -t = 8.64e+04 no. steps = 535 order = 5 stepsize = 6.20e+02 -At bottom left: c1, c2 = 1.080e-15 3.352e+11 -At top right: c1, c2 = 3.729e-15 4.163e+11 +t = 8.64e+04 no. steps = 487 order = 5 stepsize = 6.52e+02 +At bottom left: c1, c2 = -1.055e-15 3.352e+11 +At top right: c1, c2 = -1.168e-15 4.163e+11 Final Statistics: lenrw = 2696 leniw = 156 lenrwls = 2454 leniwls = 126 -nst = 535 -nfe = 687 nfels = 668 -nni = 684 nli = 668 -nsetups = 92 netf = 33 -npe = 10 nps = 1294 -ncfn = 0 ncfl = 1 +nst = 487 +nfe = 618 nfels = 623 +nni = 615 nli = 623 +nsetups = 79 netf = 26 +npe = 9 nps = 1179 +ncfn = 0 ncfl = 0 diff --git a/examples/cvodes/serial/cvsAnalytic_mels.c b/examples/cvodes/serial/cvsAnalytic_mels.c index 33d957a0e2..2eb17bda9d 100644 --- a/examples/cvodes/serial/cvsAnalytic_mels.c +++ b/examples/cvodes/serial/cvsAnalytic_mels.c @@ -334,8 +334,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = atan(t); - ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); - err = ewt * fabs(NV_Ith_S(y, 0) - ans); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(NV_Ith_S(y, 0) - ans); /* is the solution within the tolerances? */ passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; diff --git a/examples/cvodes/serial/cvsDirectDemo_ls.c b/examples/cvodes/serial/cvsDirectDemo_ls.c index 8303f1e8cf..acfc7eed51 100644 --- a/examples/cvodes/serial/cvsDirectDemo_ls.c +++ b/examples/cvodes/serial/cvsDirectDemo_ls.c @@ -251,7 +251,7 @@ static int Problem1(void) } if (iout % 2 == 0) { - er = fabs(NV_Ith_S(y, 0)) / abstol; + er = SUNRabs(NV_Ith_S(y, 0)) / abstol; if (er > ero) { ero = er; } if (er > P1_TOL_FACTOR) { @@ -319,7 +319,7 @@ static int Problem1(void) } if (iout % 2 == 0) { - er = fabs(NV_Ith_S(y, 0)) / abstol; + er = SUNRabs(NV_Ith_S(y, 0)) / abstol; if (er > ero) { ero = er; } if (er > P1_TOL_FACTOR) { @@ -700,7 +700,7 @@ static sunrealtype MaxError(N_Vector y, sunrealtype t) { k = i + j * P2_MESHX; yt = pow(t, i + j) * ex * ifact_inv * jfact_inv; - er = fabs(ydata[k] - yt); + er = SUNRabs(ydata[k] - yt); if (er > maxError) { maxError = er; } ifact_inv /= (i + 1); } diff --git a/examples/cvodes/serial/cvsDiurnal_FSA_kry_-sensi_sim_t.out b/examples/cvodes/serial/cvsDiurnal_FSA_kry_-sensi_sim_t.out index 199714823c..337b222f38 100644 --- a/examples/cvodes/serial/cvsDiurnal_FSA_kry_-sensi_sim_t.out +++ b/examples/cvodes/serial/cvsDiurnal_FSA_kry_-sensi_sim_t.out @@ -5,7 +5,7 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) ======================================================================== T Q H NST Bottom left Top right ======================================================================== -7.200e+03 3 3.239e+01 644 +7.200e+03 3 3.247e+01 644 Solution 1.0593e+04 1.1152e+04 2.5567e+11 2.6917e+11 ---------------------------------------- @@ -15,27 +15,27 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -4.4900e+14 -4.9768e+14 -2.5039e+18 -2.7672e+18 ------------------------------------------------------------------------ -1.440e+04 2 2.205e+01 1009 +1.440e+04 2 2.683e+01 1018 Solution 6.9172e+06 7.2517e+06 2.6829e+11 2.8137e+11 ---------------------------------------- Sensitivity 1 -4.2432e+22 -4.4483e+22 - 6.2762e+22 6.6564e+22 + 6.2762e+22 6.6563e+22 ---------------------------------------- Sensitivity 2 -4.8955e+17 -5.3580e+17 - -7.1116e+21 -7.7237e+21 + -7.1116e+21 -7.7236e+21 ------------------------------------------------------------------------ -2.160e+04 2 4.049e+01 1600 +2.160e+04 2 1.865e+01 1614 Solution 2.7558e+07 2.9196e+07 3.1024e+11 3.3000e+11 ---------------------------------------- Sensitivity 1 -1.6903e+23 -1.7907e+23 4.0588e+23 4.4683e+23 ---------------------------------------- - Sensitivity 2 -8.2851e+18 -9.3611e+18 - -8.2852e+22 -9.3662e+22 + Sensitivity 2 -8.2851e+18 -9.3610e+18 + -8.2851e+22 -9.3662e+22 ------------------------------------------------------------------------ -2.880e+04 3 6.108e+01 1899 +2.880e+04 3 8.477e+01 1863 Solution 8.9631e+06 9.8602e+06 3.4824e+11 3.8331e+11 ---------------------------------------- @@ -45,98 +45,98 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) Sensitivity 2 -5.2367e+18 -6.4007e+18 -1.8450e+23 -2.2574e+23 ------------------------------------------------------------------------ -3.600e+04 3 3.424e+01 2018 +3.600e+04 2 8.923e+00 2073 Solution 1.4433e+04 1.6660e+04 3.4814e+11 4.0186e+11 ---------------------------------------- - Sensitivity 1 -8.8547e+19 -1.0220e+20 + Sensitivity 1 -8.8547e+19 -1.0221e+20 5.6474e+23 7.6273e+23 ---------------------------------------- - Sensitivity 2 -9.0220e+15 -1.2170e+16 + Sensitivity 2 -9.0221e+15 -1.2170e+16 -1.9753e+23 -2.6679e+23 ------------------------------------------------------------------------ -4.320e+04 4 3.490e+02 2538 - Solution 2.5038e-13 2.7023e-13 +4.320e+04 4 4.127e+02 2392 + Solution -7.6378e-13 -5.2974e-13 3.4900e+11 4.0867e+11 ---------------------------------------- - Sensitivity 1 -1.5796e+05 -2.3807e+05 + Sensitivity 1 2.3442e+05 2.2420e+05 5.7083e+23 7.9553e+23 ---------------------------------------- - Sensitivity 2 -1.7187e+00 -5.1787e+01 + Sensitivity 2 -9.0425e+00 -4.6301e+01 -1.9969e+23 -2.7830e+23 ------------------------------------------------------------------------ -5.040e+04 4 3.490e+02 2559 - Solution -6.0654e-16 -1.7637e-15 +5.040e+04 4 4.127e+02 2410 + Solution -1.2200e-16 -1.0627e-16 3.5570e+11 4.1225e+11 ---------------------------------------- - Sensitivity 1 -1.0195e+03 -2.4393e+03 + Sensitivity 1 2.6846e+02 2.0083e+02 5.9553e+23 8.1823e+23 ---------------------------------------- - Sensitivity 2 -1.0096e-02 -2.7454e-02 + Sensitivity 2 1.1054e-03 -3.9916e-03 -2.0833e+23 -2.8624e+23 ------------------------------------------------------------------------ -5.760e+04 4 1.634e+02 2584 - Solution 4.4474e-08 1.1903e-07 +5.760e+04 3 5.281e+01 2549 + Solution -4.7059e-08 -4.8769e-08 3.6425e+11 4.1628e+11 ---------------------------------------- - Sensitivity 1 -1.8179e+09 -4.8687e+09 + Sensitivity 1 -6.4064e+08 -6.6478e+08 6.2592e+23 8.4334e+23 ---------------------------------------- - Sensitivity 2 -1.7780e+04 -5.4422e+04 - -2.1896e+23 -2.9502e+23 + Sensitivity 2 4.3302e+05 1.7919e+05 + -2.1897e+23 -2.9503e+23 ------------------------------------------------------------------------ -6.480e+04 3 9.518e+01 2636 - Solution -3.1083e-09 -1.3895e-08 +6.480e+04 4 1.937e+02 2599 + Solution 2.1648e-07 2.3190e-07 3.6334e+11 4.2182e+11 ---------------------------------------- - Sensitivity 1 -5.8937e+08 -2.6001e+09 + Sensitivity 1 -6.6816e+09 -7.1969e+09 6.2461e+23 8.7310e+23 ---------------------------------------- - Sensitivity 2 -5.2314e+03 -2.6357e+04 + Sensitivity 2 9.5725e+04 1.2031e+05 -2.1851e+23 -3.0544e+23 ------------------------------------------------------------------------ -7.200e+04 4 1.729e+02 2699 - Solution -1.8227e-08 5.8153e-08 +7.200e+04 4 3.045e+02 2634 + Solution 6.7125e-09 6.6994e-09 3.6192e+11 4.3354e+11 ---------------------------------------- - Sensitivity 1 1.2752e+09 -4.6275e+09 - 6.2310e+23 9.2797e+23 + Sensitivity 1 6.3368e+09 6.3708e+09 + 6.2311e+23 9.2797e+23 ---------------------------------------- - Sensitivity 2 8.7152e+06 -4.0981e+07 + Sensitivity 2 -2.0880e+07 -2.5165e+07 -2.1798e+23 -3.2463e+23 ------------------------------------------------------------------------ -7.920e+04 4 1.729e+02 2741 - Solution -1.1560e-08 8.4429e-09 +7.920e+04 5 4.818e+02 2652 + Solution 5.4650e-12 5.4746e-12 3.6148e+11 4.4474e+11 ---------------------------------------- - Sensitivity 1 -3.9209e+09 3.0221e+09 + Sensitivity 1 -2.4107e+07 -2.3698e+07 6.2481e+23 9.8067e+23 ---------------------------------------- - Sensitivity 2 2.4469e+07 -1.1022e+07 + Sensitivity 2 -1.6403e+06 -1.9530e+06 -2.1858e+23 -3.4307e+23 ------------------------------------------------------------------------ -8.640e+04 4 1.729e+02 2783 - Solution -2.0626e-09 3.2649e-10 +8.640e+04 5 4.818e+02 2667 + Solution 1.6088e-14 1.6027e-14 3.6318e+11 4.4524e+11 ---------------------------------------- - Sensitivity 1 -3.1145e+09 6.7710e+08 + Sensitivity 1 3.5626e+04 3.5472e+04 6.3248e+23 9.8820e+23 ---------------------------------------- - Sensitivity 2 -2.1820e+07 -4.8408e+06 + Sensitivity 2 2.6242e+03 3.1708e+03 -2.2126e+23 -3.4570e+23 ------------------------------------------------------------------------ Final Statistics -nst = 2783 +nst = 2667 -nfe = 3955 -netf = 186 nsetups = 534 -nni = 3952 ncfn = 24 +nfe = 3902 +netf = 166 nsetups = 477 +nni = 3899 ncfn = 8 -nfSe = 7910 nfeS = 15820 +nfSe = 7804 nfeS = 15608 netfs = 0 nsetupsS = 0 nniS = 0 ncfnS = 0 -nli = 8402 ncfl = 0 -npe = 69 nps = 18230 +nli = 8496 ncfl = 0 +npe = 52 nps = 18412 diff --git a/examples/cvodes/serial/cvsDiurnal_kry.out b/examples/cvodes/serial/cvsDiurnal_kry.out index 4d695384cc..56aae6c198 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry.out +++ b/examples/cvodes/serial/cvsDiurnal_kry.out @@ -22,31 +22,31 @@ c1 (bot.left/middle/top rt.) = 1.404e+04 2.029e+04 1.561e+04 c2 (bot.left/middle/top rt.) = 3.387e+11 4.894e+11 3.765e+11 t = 4.32e+04 no. steps = 393 order = 4 stepsize = 2.57e+02 -c1 (bot.left/middle/top rt.) = -7.891e-06 -1.123e-06 -8.723e-06 +c1 (bot.left/middle/top rt.) = -7.924e-06 -1.148e-06 -8.759e-06 c2 (bot.left/middle/top rt.) = 3.382e+11 1.355e+11 3.804e+11 t = 5.04e+04 no. steps = 421 order = 5 stepsize = 4.96e+02 -c1 (bot.left/middle/top rt.) = -1.595e-08 -1.771e-06 -3.117e-08 +c1 (bot.left/middle/top rt.) = -1.599e-08 -1.775e-06 -3.124e-08 c2 (bot.left/middle/top rt.) = 3.358e+11 4.930e+11 3.864e+11 -t = 5.76e+04 no. steps = 439 order = 4 stepsize = 1.19e+02 -c1 (bot.left/middle/top rt.) = -2.127e-06 -1.513e-04 -2.951e-06 +t = 5.76e+04 no. steps = 437 order = 5 stepsize = 2.10e+02 +c1 (bot.left/middle/top rt.) = -1.239e-08 -8.964e-07 -1.736e-08 c2 (bot.left/middle/top rt.) = 3.320e+11 9.650e+11 3.909e+11 -t = 6.48e+04 no. steps = 458 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.084e-09 -7.686e-08 -1.499e-09 +t = 6.48e+04 no. steps = 464 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = 4.297e-11 2.962e-09 5.854e-11 c2 (bot.left/middle/top rt.) = 3.313e+11 8.922e+11 3.963e+11 -t = 7.20e+04 no. steps = 469 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.093e-10 -7.736e-09 -1.510e-10 +t = 7.20e+04 no. steps = 473 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = 1.150e-11 7.919e-10 1.566e-11 c2 (bot.left/middle/top rt.) = 3.330e+11 6.186e+11 4.039e+11 -t = 7.92e+04 no. steps = 480 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = -1.624e-12 -1.151e-10 -2.246e-12 +t = 7.92e+04 no. steps = 483 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = -4.188e-13 -2.884e-11 -5.703e-13 c2 (bot.left/middle/top rt.) = 3.334e+11 6.669e+11 4.120e+11 -t = 8.64e+04 no. steps = 491 order = 5 stepsize = 6.60e+02 -c1 (bot.left/middle/top rt.) = 3.501e-14 2.474e-12 4.816e-14 +t = 8.64e+04 no. steps = 492 order = 5 stepsize = 7.69e+02 +c1 (bot.left/middle/top rt.) = -3.268e-14 -2.246e-12 -4.447e-14 c2 (bot.left/middle/top rt.) = 3.352e+11 9.107e+11 4.163e+11 @@ -54,10 +54,10 @@ Final Statistics.. lenrw = 2696 leniw = 65 lenrwLS = 2454 leniwLS = 42 -nst = 491 -nfe = 630 nfeLS = 0 -nni = 627 nli = 643 -nsetups = 82 netf = 29 -npe = 9 nps = 1214 +nst = 492 +nfe = 637 nfeLS = 0 +nni = 634 nli = 649 +nsetups = 88 netf = 32 +npe = 9 nps = 1223 ncfn = 0 ncfl = 0 diff --git a/examples/cvodes/serial/cvsDiurnal_kry_bp.out b/examples/cvodes/serial/cvsDiurnal_kry_bp.out index df9b31edb1..8f837871a9 100644 --- a/examples/cvodes/serial/cvsDiurnal_kry_bp.out +++ b/examples/cvodes/serial/cvsDiurnal_kry_bp.out @@ -26,32 +26,32 @@ c1 (bot.left/middle/top rt.) = 1.404e+04 2.029e+04 1.561e+04 c2 (bot.left/middle/top rt.) = 3.387e+11 4.894e+11 3.765e+11 t = 4.32e+04 no. steps = 402 order = 4 stepsize = 4.48e+02 -c1 (bot.left/middle/top rt.) = 1.915e-07 -6.130e-06 4.395e-07 +c1 (bot.left/middle/top rt.) = 1.929e-07 -6.029e-06 4.403e-07 c2 (bot.left/middle/top rt.) = 3.382e+11 1.355e+11 3.804e+11 -t = 5.04e+04 no. steps = 422 order = 4 stepsize = 3.17e+02 -c1 (bot.left/middle/top rt.) = -7.746e-11 -3.073e-08 -3.512e-11 +t = 5.04e+04 no. steps = 421 order = 4 stepsize = 3.30e+02 +c1 (bot.left/middle/top rt.) = 1.559e-09 6.319e-07 6.062e-10 c2 (bot.left/middle/top rt.) = 3.358e+11 4.930e+11 3.864e+11 -t = 5.76e+04 no. steps = 436 order = 5 stepsize = 3.58e+02 -c1 (bot.left/middle/top rt.) = 1.801e-11 7.177e-09 8.588e-12 +t = 5.76e+04 no. steps = 435 order = 5 stepsize = 4.67e+02 +c1 (bot.left/middle/top rt.) = -2.660e-12 -1.080e-09 -1.030e-12 c2 (bot.left/middle/top rt.) = 3.320e+11 9.650e+11 3.909e+11 -t = 6.48e+04 no. steps = 449 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = -2.845e-14 -1.063e-11 -1.382e-14 +t = 6.48e+04 no. steps = 447 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -7.375e-15 -2.742e-12 -2.920e-15 c2 (bot.left/middle/top rt.) = 3.313e+11 8.922e+11 3.963e+11 -t = 7.20e+04 no. steps = 461 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 2.710e-16 1.011e-13 1.307e-16 +t = 7.20e+04 no. steps = 457 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -1.202e-17 -4.105e-15 -5.445e-18 c2 (bot.left/middle/top rt.) = 3.330e+11 6.186e+11 4.039e+11 -t = 7.92e+04 no. steps = 473 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 5.698e-16 2.058e-13 2.690e-16 +t = 7.92e+04 no. steps = 467 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -8.193e-21 -1.461e-15 -7.837e-19 c2 (bot.left/middle/top rt.) = 3.334e+11 6.669e+11 4.120e+11 -t = 8.64e+04 no. steps = 485 order = 5 stepsize = 5.95e+02 -c1 (bot.left/middle/top rt.) = 2.707e-16 1.899e-17 2.156e-15 -c2 (bot.left/middle/top rt.) = 3.352e+11 9.106e+11 4.163e+11 +t = 8.64e+04 no. steps = 477 order = 5 stepsize = 7.06e+02 +c1 (bot.left/middle/top rt.) = -7.290e-20 -3.730e-15 -4.364e-20 +c2 (bot.left/middle/top rt.) = 3.352e+11 9.106e+11 4.162e+11 Final Statistics.. @@ -59,12 +59,12 @@ Final Statistics.. lenrw = 2696 leniw = 65 lenrwls = 2454 leniwls = 42 lenrwbp = 2800 leniwbp = 622 -nst = 485 -nfe = 616 nfetot = 1258 -nfeLS = 597 nfeBP = 45 -nni = 613 nli = 597 +nst = 477 +nfe = 613 nfetot = 1267 +nfeLS = 614 nfeBP = 40 +nni = 610 nli = 614 nsetups = 85 netf = 28 -npe = 9 nps = 1134 +npe = 8 nps = 1142 ncfn = 0 ncfl = 0 diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c index e8409e6e91..03817e3ad7 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c @@ -516,7 +516,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm(fc, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * (NEQ + 1) * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * (NEQ + 1) * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -534,7 +534,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = -gamma / r; fblock(t, cdata, jx, jy, f1, wdata); @@ -736,7 +736,7 @@ static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, f1 = N_VGetArrayPointer(wdata->vtempB); fac = N_VWrmsNorm(fcB, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -754,7 +754,7 @@ static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = gamma / r; fblock(t, cdata, jx, jy, f1, wdata); @@ -1291,7 +1291,7 @@ static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) for (jx = 0; jx < MX; jx++) { cij = cdata[(i - 1) + jx * ns + jy * mxns]; - if (fabs(cij) > cmax) + if (SUNRabs(cij) > cmax) { cmax = cij; x = jx * wdata->dx; diff --git a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c index 35f470bc45..67e46c484b 100644 --- a/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c +++ b/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c @@ -503,7 +503,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm(fc, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -521,7 +521,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = -gamma / r; fblock(t, cdata, jx, jy, f1, wdata); @@ -714,7 +714,7 @@ static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, f1 = N_VGetArrayPointer(wdata->vtemp); fac = N_VWrmsNorm(fcB, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -732,7 +732,7 @@ static int PrecondB(sunrealtype t, N_Vector c, N_Vector cB, N_Vector fcB, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = gamma / r; fblock(t, cdata, jx, jy, f1, wdata); @@ -1295,7 +1295,7 @@ static void PrintOutput(N_Vector cB, int ns, int mxns, WebData wdata) for (jx = 0; jx < MX; jx++) { cij = cdata[(i - 1) + jx * ns + jy * mxns]; - if (fabs(cij) > cmax) + if (SUNRabs(cij) > cmax) { cmax = cij; x = jx * wdata->dx; diff --git a/examples/cvodes/serial/cvsKrylovDemo_prec.c b/examples/cvodes/serial/cvsKrylovDemo_prec.c index 376cd698fc..a64794640c 100644 --- a/examples/cvodes/serial/cvsKrylovDemo_prec.c +++ b/examples/cvodes/serial/cvsKrylovDemo_prec.c @@ -848,7 +848,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, f1 = N_VGetArrayPointer(wdata->tmp); fac = N_VWrmsNorm(fc, rewt); - r0 = SUN_RCONST(1000.0) * fabs(gamma) * uround * NEQ * fac; + r0 = SUN_RCONST(1000.0) * SUNRabs(gamma) * uround * NEQ * fac; if (r0 == ZERO) { r0 = ONE; } for (igy = 0; igy < ngy; igy++) @@ -866,7 +866,7 @@ static int Precond(sunrealtype t, N_Vector c, N_Vector fc, sunbooleantype jok, /* Generate the jth column as a difference quotient */ jj = if0 + j; save = cdata[jj]; - r = MAX(srur * fabs(save), r0 / rewtdata[jj]); + r = MAX(srur * SUNRabs(save), r0 / rewtdata[jj]); cdata[jj] += r; fac = -gamma / r; fblock(t, cdata, jx, jy, f1, wdata); diff --git a/examples/cvodes/serial/cvsParticle_dns.out b/examples/cvodes/serial/cvsParticle_dns.out index 15517a2bd3..0901a32138 100644 --- a/examples/cvodes/serial/cvsParticle_dns.out +++ b/examples/cvodes/serial/cvsParticle_dns.out @@ -14,13 +14,13 @@ tstop = 0 t x y err x err y err constr 0.0000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -6.2832e+02 9.977240e-01 6.742947e-02 -2.275957e-03 6.742947e-02 2.220446e-16 +6.2832e+02 9.979545e-01 6.392827e-02 -2.045504e-03 6.392827e-02 0.000000e+00 Integration Statistics: -Number of steps taken = 4044 -Number of function evaluations = 5831 -Number of linear solver setups = 806 -Number of Jacobian evaluations = 103 -Number of nonlinear solver iterations = 5828 -Number of convergence failures = 40 -Number of error test failures = 329 +Number of steps taken = 4131 +Number of function evaluations = 6030 +Number of linear solver setups = 862 +Number of Jacobian evaluations = 115 +Number of nonlinear solver iterations = 6027 +Number of convergence failures = 52 +Number of error test failures = 343 diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_sim_t.out b/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_sim_t.out index 9eda7cba0d..4482815e02 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_sim_t.out +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_sim_t.out @@ -79,13 +79,13 @@ Sensitivity: YES ( SIMULTANEOUS + FULL ERROR CONTROL ) ----------------------------------------------------------------------- Final Statistics: -Current time = 43900737657.75381 +Current time = 43900558490.17576 Steps = 818 Error test fails = 28 NLS step fails = 2 Initial step size = 8.236259832589498e-14 -Last step size = 7184288709.869884 -Current step size = 7184288709.869884 +Last step size = 7184239983.513188 +Current step size = 7184239983.513188 Last method order = 3 Current method order = 3 Stab. lim. order reductions = 0 diff --git a/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_stg1_t.out b/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_stg1_t.out index 63f99b8085..984fb6bad1 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_stg1_t.out +++ b/examples/cvodes/serial/cvsRoberts_FSA_dns_-sensi_stg1_t.out @@ -73,19 +73,19 @@ Sensitivity: YES ( STAGGERED1 + FULL ERROR CONTROL ) ----------------------------------------------------------------------- 4.000e+10 3 1.237e+09 930 Solution 5.1573e-08 2.0629e-13 1.0000e+00 - Sensitivity 1 -2.6618e-06 -5.4901e-12 2.6619e-06 - Sensitivity 2 1.0763e-11 2.2422e-17 -1.0763e-11 + Sensitivity 1 -2.6618e-06 -5.4900e-12 2.6618e-06 + Sensitivity 2 1.0763e-11 2.2421e-17 -1.0763e-11 Sensitivity 3 -1.7339e-15 -6.9355e-21 1.7339e-15 ----------------------------------------------------------------------- Final Statistics: -Current time = 41016848848.50709 +Current time = 41016872194.61566 Steps = 930 Error test fails = 0 NLS step fails = 0 Initial step size = 8.236259832589498e-14 -Last step size = 1236650880.556721 -Current step size = 1236650880.556721 +Last step size = 1236651497.958958 +Current step size = 1236651497.958958 Last method order = 3 Current method order = 3 Stab. lim. order reductions = 0 diff --git a/examples/cvodes/serial/cvsRoberts_FSA_sps_-sensi_stg1_t.out b/examples/cvodes/serial/cvsRoberts_FSA_sps_-sensi_stg1_t.out index baccc08523..c6190b4a05 100644 --- a/examples/cvodes/serial/cvsRoberts_FSA_sps_-sensi_stg1_t.out +++ b/examples/cvodes/serial/cvsRoberts_FSA_sps_-sensi_stg1_t.out @@ -73,8 +73,8 @@ Sensitivity: YES ( STAGGERED1 + FULL ERROR CONTROL ) ----------------------------------------------------------------------- 4.000e+10 3 1.237e+09 930 Solution 5.1573e-08 2.0629e-13 1.0000e+00 - Sensitivity 1 -2.6618e-06 -5.4901e-12 2.6619e-06 - Sensitivity 2 1.0763e-11 2.2422e-17 -1.0763e-11 + Sensitivity 1 -2.6618e-06 -5.4900e-12 2.6618e-06 + Sensitivity 2 1.0763e-11 2.2421e-17 -1.0763e-11 Sensitivity 3 -1.7339e-15 -6.9355e-21 1.7339e-15 ----------------------------------------------------------------------- diff --git a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c index eb15b44994..68e497b9cf 100644 --- a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c @@ -471,8 +471,8 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, for (js = 0; js < NUM_SPECIES; js++) { - inc = sqru * - (MAX(fabs(cxy[js]), MAX(hh * fabs(cpxy[js]), ONE / ewtxy[js]))); + inc = sqru * (MAX(SUNRabs(cxy[js]), + MAX(hh * SUNRabs(cpxy[js]), ONE / ewtxy[js]))); cctmp = cxy[js]; cxy[js] += inc; fac = -ONE / inc; diff --git a/examples/ida/parallel/idaFoodWeb_kry_p.c b/examples/ida/parallel/idaFoodWeb_kry_p.c index b916fb63c9..befc25cdb6 100644 --- a/examples/ida/parallel/idaFoodWeb_kry_p.c +++ b/examples/ida/parallel/idaFoodWeb_kry_p.c @@ -1287,8 +1287,8 @@ static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, for (js = 0; js < ns; js++) { - inc = sqru * - (MAX(fabs(cxy[js]), MAX(hh * fabs(cpxy[js]), ONE / ewtxy[js]))); + inc = sqru * (MAX(SUNRabs(cxy[js]), + MAX(hh * SUNRabs(cpxy[js]), ONE / ewtxy[js]))); cctemp = cxy[js]; /* Save the (js,ix,jy) element of cc. */ cxy[js] += inc; /* Perturb the (js,ix,jy) element of cc. */ fac = -ONE / inc; diff --git a/examples/ida/petsc/CMakeLists.txt b/examples/ida/petsc/CMakeLists.txt index 098ce24569..b57438a03a 100644 --- a/examples/ida/petsc/CMakeLists.txt +++ b/examples/ida/petsc/CMakeLists.txt @@ -21,9 +21,16 @@ set(IDA_examples "idaHeat2D_petsc_spgmr\;\;1\;4\;develop" "idaHeat2D_petsc_snes\;\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop") + "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop") + +# Previous tests with PETSc v3.17.1 installed with Spack v0.18.1 had identical +# results with 32 and 64-bit indexing. Now with PETSc v3.21.4 installed with +# Spack v0.23.0.dev0 (73fc86cbc3ae6dea5f69e3a0516e1a7691864fa3) the results are +# slightly different. +if(SUNDIALS_INDEX_SIZE STREQUAL "32") + list(APPEND IDA_examples "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop") +endif() if(MPI_C_COMPILER) # use MPI wrapper as the compiler diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes.out b/examples/ida/petsc/idaHeat2D_petsc_snes.out index cff5c7495a..1d8792161b 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes.out +++ b/examples/ida/petsc/idaHeat2D_petsc_snes.out @@ -22,13 +22,13 @@ Use the SNES command line options to override defaults. 0.02 6.88087e-01 3 19 38 156 251 2.38e-03 0.04 4.70971e-01 4 24 48 216 336 4.75e-03 0.08 2.16290e-01 5 30 60 295 445 9.50e-03 - 0.16 4.53347e-02 5 37 74 401 586 1.71e-02 - 0.32 1.99922e-03 5 46 92 543 773 1.71e-02 - 0.64 7.56973e-18 2 54 108 670 940 6.84e-02 - 1.28 1.48329e-17 1 57 114 753 1038 5.47e-01 - 2.56 3.78999e-19 1 58 116 778 1068 1.09e+00 - 5.12 1.71542e-21 1 60 120 823 1123 4.38e+00 - 10.24 1.84930e-23 1 61 122 842 1147 8.75e+00 + 0.16 4.53347e-02 5 37 74 400 585 1.71e-02 + 0.32 1.99922e-03 5 46 92 542 772 1.71e-02 + 0.64 7.51674e-18 2 54 108 669 939 6.84e-02 + 1.28 1.47260e-17 1 57 114 752 1037 5.47e-01 + 2.56 3.76285e-19 1 58 116 777 1067 1.09e+00 + 5.12 1.70319e-21 1 60 120 822 1122 4.38e+00 + 10.24 1.83612e-23 1 61 122 841 1146 8.75e+00 Error test failures = 0 Nonlinear convergence failures = 0 diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes_-jac.out b/examples/ida/petsc/idaHeat2D_petsc_snes_-jac.out index 987b965635..45d5dfdec8 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes_-jac.out +++ b/examples/ida/petsc/idaHeat2D_petsc_snes_-jac.out @@ -24,11 +24,11 @@ Use the SNES command line options to override defaults. 0.08 2.16290e-01 5 30 60 247 90 9.50e-03 0.16 4.53347e-02 5 37 74 337 111 1.71e-02 0.32 1.99922e-03 5 46 92 463 138 1.71e-02 - 0.64 5.55626e-18 2 54 108 598 162 6.84e-02 - 1.28 3.39532e-18 1 57 114 663 171 5.47e-01 - 2.56 9.12051e-20 1 58 116 683 174 1.09e+00 - 5.12 4.17001e-22 1 60 120 723 180 4.38e+00 - 10.24 4.49674e-24 1 61 122 744 183 8.75e+00 + 0.64 5.55615e-18 2 54 108 598 162 6.84e-02 + 1.28 3.39520e-18 1 57 114 663 171 5.47e-01 + 2.56 9.12020e-20 1 58 116 683 174 1.09e+00 + 5.12 4.16987e-22 1 60 120 723 180 4.38e+00 + 10.24 4.49659e-24 1 61 122 744 183 8.75e+00 Error test failures = 0 Nonlinear convergence failures = 0 diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes_-jac_-pre.out b/examples/ida/petsc/idaHeat2D_petsc_snes_-jac_-pre.out index afdc6e6303..83682d8291 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes_-jac_-pre.out +++ b/examples/ida/petsc/idaHeat2D_petsc_snes_-jac_-pre.out @@ -24,10 +24,10 @@ Use the SNES command line options to override defaults. 0.08 2.16290e-01 5 30 60 295 90 9.50e-03 0.16 4.53347e-02 5 37 74 401 111 1.71e-02 0.32 1.99922e-03 5 46 92 543 138 1.71e-02 - 0.64 7.53458e-18 2 54 108 669 162 6.84e-02 - 1.28 1.47695e-17 1 57 114 744 171 5.47e-01 + 0.64 7.53534e-18 2 54 108 670 162 6.84e-02 + 1.28 1.47695e-17 1 57 114 745 171 5.47e-01 2.56 3.77409e-19 1 58 116 767 174 1.09e+00 - 5.12 1.70831e-21 1 60 120 804 180 4.38e+00 + 5.12 1.70831e-21 1 60 120 803 180 4.38e+00 10.24 1.84164e-23 1 61 122 820 183 8.75e+00 Error test failures = 0 diff --git a/examples/ida/petsc/idaHeat2D_petsc_snes_-pre.out b/examples/ida/petsc/idaHeat2D_petsc_snes_-pre.out index 79c47d1eef..0321697c8a 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_snes_-pre.out +++ b/examples/ida/petsc/idaHeat2D_petsc_snes_-pre.out @@ -22,13 +22,13 @@ Use the SNES command line options to override defaults. 0.02 6.88087e-01 3 19 38 156 251 2.38e-03 0.04 4.70971e-01 4 24 48 216 336 4.75e-03 0.08 2.16290e-01 5 30 60 295 445 9.50e-03 - 0.16 4.53347e-02 5 37 74 400 585 1.71e-02 - 0.32 1.99922e-03 5 46 92 542 772 1.71e-02 - 0.64 7.46526e-18 2 54 108 669 939 6.84e-02 - 1.28 1.46307e-17 1 57 114 752 1037 5.47e-01 - 2.56 3.73813e-19 1 58 116 778 1068 1.09e+00 - 5.12 1.69191e-21 1 60 120 824 1124 4.38e+00 - 10.24 1.82395e-23 1 61 122 842 1147 8.75e+00 + 0.16 4.53347e-02 5 37 74 401 586 1.71e-02 + 0.32 1.99922e-03 5 46 92 543 773 1.71e-02 + 0.64 7.53164e-18 2 54 108 670 940 6.84e-02 + 1.28 1.47601e-17 1 57 114 753 1038 5.47e-01 + 2.56 3.77136e-19 1 58 116 778 1068 1.09e+00 + 5.12 1.70699e-21 1 60 120 823 1123 4.38e+00 + 10.24 1.84021e-23 1 61 122 842 1147 8.75e+00 Error test failures = 0 Nonlinear convergence failures = 0 diff --git a/examples/ida/petsc/idaHeat2D_petsc_spgmr.out b/examples/ida/petsc/idaHeat2D_petsc_spgmr.out index a04af4d126..295f347232 100644 --- a/examples/ida/petsc/idaHeat2D_petsc_spgmr.out +++ b/examples/ida/petsc/idaHeat2D_petsc_spgmr.out @@ -22,11 +22,11 @@ This example uses the PETSc N_Vector. 0.08 2.16330e-01 4 30 38 36 36 38 36 8.55e-03 10 74 0.16 4.52095e-02 4 37 47 54 54 47 54 1.50e-02 11 101 0.32 1.96868e-03 5 48 59 82 82 59 82 1.50e-02 11 141 - 0.64 1.21506e-05 1 57 73 108 108 73 108 1.20e-01 14 181 - 1.28 6.51352e-22 1 59 75 108 108 75 108 4.78e-01 16 183 - 2.56 7.44406e-22 1 61 77 108 108 77 108 1.91e+00 18 185 - 5.12 1.43242e-21 1 62 78 108 108 78 108 3.83e+00 19 186 - 10.24 2.62776e-21 1 63 79 108 108 79 108 7.66e+00 20 187 + 0.64 1.22783e-05 1 57 73 108 108 73 108 1.20e-01 14 181 + 1.28 6.17716e-22 1 59 75 108 108 75 108 4.78e-01 16 183 + 2.56 4.38516e-22 1 61 77 108 108 77 108 1.91e+00 18 185 + 5.12 1.00191e-21 1 62 78 108 108 78 108 3.83e+00 19 186 + 10.24 1.64570e-21 1 63 79 108 108 79 108 7.66e+00 20 187 Error test failures = 0 Nonlinear convergence failures = 0 diff --git a/examples/ida/serial/idaFoodWeb_kry.c b/examples/ida/serial/idaFoodWeb_kry.c index e81e07c0ad..9ce75a1191 100644 --- a/examples/ida/serial/idaFoodWeb_kry.c +++ b/examples/ida/serial/idaFoodWeb_kry.c @@ -439,8 +439,8 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, for (js = 0; js < NUM_SPECIES; js++) { - inc = sqru * - (MAX(fabs(cxy[js]), MAX(hh * fabs(cpxy[js]), ONE / ewtxy[js]))); + inc = sqru * (MAX(SUNRabs(cxy[js]), + MAX(hh * SUNRabs(cpxy[js]), ONE / ewtxy[js]))); cctmp = cxy[js]; cxy[js] += inc; fac = -ONE / inc; diff --git a/examples/ida/trilinos/CMakeLists.txt b/examples/ida/trilinos/CMakeLists.txt index 0a1a28eac4..b9ee330ad8 100644 --- a/examples/ida/trilinos/CMakeLists.txt +++ b/examples/ida/trilinos/CMakeLists.txt @@ -18,22 +18,13 @@ # for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -if(Trilinos_INTERFACE_MPI_CXX_FOUND) +if(MPI_CXX_FOUND) set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop" "idaHeat2D_kry_p_tpetra\;1\;4\;develop") else() set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop") endif() -# Set Trilinos compilers/flags -set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") - -set(MPIEXEC_EXECUTABLE ${Trilinos_INTERFACE_MPIEXEC}) - # Specify libraries to link against set(IDA_LIB sundials_ida) set(NVECS_LIB sundials_nvectrilinos) diff --git a/examples/ida/trilinos/idaHeat2D_kry_tpetra.out b/examples/ida/trilinos/idaHeat2D_kry_tpetra.out index 8c7d6596db..fadcabe348 100644 --- a/examples/ida/trilinos/idaHeat2D_kry_tpetra.out +++ b/examples/ida/trilinos/idaHeat2D_kry_tpetra.out @@ -44,11 +44,11 @@ Case 2: gstype = SUN_CLASSICAL_GS 0.08 2.16509e-01 3 22 29 30 29 30 1.32e-02 9 59 0.16 4.57687e-02 4 28 36 44 36 44 1.32e-02 9 80 0.32 2.09938e-03 4 35 44 67 44 67 2.63e-02 10 111 - 0.64 2.15648e-20 1 39 51 77 51 77 1.05e-01 12 128 - 1.28 5.77813e-20 1 41 53 77 53 77 4.21e-01 14 130 - 2.56 7.49337e-20 1 43 55 77 55 77 1.69e+00 16 132 - 5.12 2.26172e-19 1 44 56 77 56 77 3.37e+00 17 133 - 10.24 6.90227e-19 1 45 57 77 57 77 6.74e+00 18 134 + 0.64 0.00000e+00 1 39 51 77 51 77 1.05e-01 12 128 + 1.28 0.00000e+00 1 41 53 77 53 77 4.21e-01 14 130 + 2.56 0.00000e+00 1 43 55 77 55 77 1.69e+00 16 132 + 5.12 0.00000e+00 1 44 56 77 56 77 3.37e+00 17 133 + 10.24 0.00000e+00 1 45 57 77 57 77 6.74e+00 18 134 Error test failures = 1 Nonlinear convergence failures = 0 diff --git a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c index 91fa4f4c4d..00b2487143 100644 --- a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c @@ -469,8 +469,8 @@ static int Precond(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, for (js = 0; js < NUM_SPECIES; js++) { - inc = sqru * - (MAX(fabs(cxy[js]), MAX(hh * fabs(cpxy[js]), ONE / ewtxy[js]))); + inc = sqru * (MAX(SUNRabs(cxy[js]), + MAX(hh * SUNRabs(cpxy[js]), ONE / ewtxy[js]))); cctmp = cxy[js]; cxy[js] += inc; fac = -ONE / inc; diff --git a/examples/idas/parallel/idasFoodWeb_kry_p.c b/examples/idas/parallel/idasFoodWeb_kry_p.c index be9e4e1abb..795c8f5d98 100644 --- a/examples/idas/parallel/idasFoodWeb_kry_p.c +++ b/examples/idas/parallel/idasFoodWeb_kry_p.c @@ -1286,8 +1286,8 @@ static int Precondbd(sunrealtype tt, N_Vector cc, N_Vector cp, N_Vector rr, for (js = 0; js < ns; js++) { - inc = sqru * - (MAX(fabs(cxy[js]), MAX(hh * fabs(cpxy[js]), ONE / ewtxy[js]))); + inc = sqru * (MAX(SUNRabs(cxy[js]), + MAX(hh * SUNRabs(cpxy[js]), ONE / ewtxy[js]))); cctemp = cxy[js]; /* Save the (js,ix,jy) element of cc. */ cxy[js] += inc; /* Perturb the (js,ix,jy) element of cc. */ fac = -ONE / inc; diff --git a/examples/idas/serial/idasSlCrank_FSA_dns.out b/examples/idas/serial/idasSlCrank_FSA_dns.out index 25ff86dfc0..be03615949 100644 --- a/examples/idas/serial/idasSlCrank_FSA_dns.out +++ b/examples/idas/serial/idasSlCrank_FSA_dns.out @@ -5,15 +5,15 @@ Forward integration ... done! Final Run Statistics: -Number of steps = 231 -Number of residual evaluations = 1131 -Number of Jacobian evaluations = 42 -Number of nonlinear iterations = 711 +Number of steps = 233 +Number of residual evaluations = 1180 +Number of Jacobian evaluations = 46 +Number of nonlinear iterations = 720 Number of error test failures = 0 -Number of nonlinear conv. failures = 24 -Number of step solver failures = 0 +Number of nonlinear conv. failures = 26 +Number of step solver failures = 1 -------------------------------------------- - G = 3.3366157997761721 + G = 3.3366155611545363 -------------------------------------------- -------------F O R W A R D------------------ @@ -25,7 +25,7 @@ Number of step solver failures = 0 Checking using Finite Differences ---------------BACKWARD------------------ - dG/dp: 3.3344e-01 -3.6375e-01 + dG/dp: 3.3345e-01 -3.6375e-01 ----------------------------------------- ---------------FORWARD------------------- diff --git a/examples/idas/serial/idasSlCrank_dns.out b/examples/idas/serial/idasSlCrank_dns.out index 81ef2cc330..dc79d2a775 100644 --- a/examples/idas/serial/idasSlCrank_dns.out +++ b/examples/idas/serial/idasSlCrank_dns.out @@ -42,6 +42,6 @@ Number of error test failures = 1 Number of nonlinear conv. failures = 20 Number of step solver failures = 0 -------------------------------------------- - G = 3.3366160662934146 + G = 3.3366160662909388 -------------------------------------------- diff --git a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp index baf7ecd847..a25c16dfe5 100644 --- a/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp @@ -87,6 +87,13 @@ int main(int argc, char* argv[]) // SUNDIALS context sundials::Context sunctx(comm_w); + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + retval = HYPRE_Init(); + if (check_retval(&retval, "HYPRE_Init", 1)) { return 1; } +#endif + // ------------------------------------------ // Setup UserData and parallel decomposition // ------------------------------------------ @@ -246,6 +253,13 @@ int main(int argc, char* argv[]) // Free memory // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + retval = HYPRE_Finalize(); + if (check_retval(&retval, "HYPRE_Finalize", 1)) { return 1; } +#endif + KINFree(&kin_mem); // Free solver memory N_VDestroy(u); // Free vectors N_VDestroy(scale); diff --git a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp index ae43c84d5f..34681d2449 100644 --- a/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp +++ b/examples/kinsol/CXX_parhyp/kin_heat2D_nonlin_hypre_pfmg.cpp @@ -87,6 +87,13 @@ int main(int argc, char* argv[]) // SUNDIALS context sundials::Context sunctx(comm_w); + // Initialize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + retval = HYPRE_Init(); + if (check_retval(&retval, "HYPRE_Init", 1)) { return 1; } +#endif + // ------------------------------------------ // Setup UserData and parallel decomposition // ------------------------------------------ @@ -275,6 +282,13 @@ int main(int argc, char* argv[]) // Free memory // -------------------- + // Finalize hypre if v2.20.0 or newer +#if HYPRE_RELEASE_NUMBER >= 22000 || SUN_HYPRE_VERSION_MAJOR > 2 || \ + (SUN_HYPRE_VERSION_MAJOR == 2 && SUN_HYPRE_VERSION_MINOR >= 20) + retval = HYPRE_Finalize(); + if (check_retval(&retval, "HYPRE_Finalize", 1)) { return 1; } +#endif + KINFree(&kin_mem); // Free solver memory N_VDestroy(u); // Free vectors N_VDestroy(scale); diff --git a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c index d6b979581a..3ca40e26e6 100644 --- a/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c +++ b/examples/kinsol/C_openmp/kinFoodWeb_kry_omp.c @@ -444,7 +444,7 @@ static int PrecSetupBD(N_Vector cc, N_Vector cscale, N_Vector fval, for (j = 0; j < NUM_SPECIES; j++) { csave = cxy[j]; /* Save the j,jx,jy element of cc */ - r = MAX(sqruround * fabs(csave), r0 / scxy[j]); + r = MAX(sqruround * SUNRabs(csave), r0 / scxy[j]); cxy[j] += r; /* Perturb the j,jx,jy element of cc */ fac = ONE / r; diff --git a/examples/kinsol/parallel/kinFoodWeb_kry_p.c b/examples/kinsol/parallel/kinFoodWeb_kry_p.c index f434e1522c..b1c2ce3868 100644 --- a/examples/kinsol/parallel/kinFoodWeb_kry_p.c +++ b/examples/kinsol/parallel/kinFoodWeb_kry_p.c @@ -466,7 +466,7 @@ static int Precondbd(N_Vector cc, N_Vector cscale, N_Vector fval, for (j = 0; j < NUM_SPECIES; j++) { csave = cxy[j]; /* Save the j,jx,jy element of cc */ - r = MAX(sqruround * fabs(csave), r0 / scxy[j]); + r = MAX(sqruround * SUNRabs(csave), r0 / scxy[j]); cxy[j] += r; /* Perturb the j,jx,jy element of cc */ fac = ONE / r; diff --git a/examples/kinsol/serial/kinKrylovDemo_ls.c b/examples/kinsol/serial/kinKrylovDemo_ls.c index 631ef36efd..1647da2297 100644 --- a/examples/kinsol/serial/kinKrylovDemo_ls.c +++ b/examples/kinsol/serial/kinKrylovDemo_ls.c @@ -506,7 +506,7 @@ static int PrecSetupBD(N_Vector cc, N_Vector cscale, N_Vector fval, for (j = 0; j < NUM_SPECIES; j++) { csave = cxy[j]; /* Save the j,jx,jy element of cc */ - r = MAX(sqruround * fabs(csave), r0 / scxy[j]); + r = MAX(sqruround * SUNRabs(csave), r0 / scxy[j]); cxy[j] += r; /* Perturb the j,jx,jy element of cc */ fac = ONE / r; diff --git a/examples/nvector/trilinos/CMakeLists.txt b/examples/nvector/trilinos/CMakeLists.txt index 06874d0e41..6713c5a9f3 100644 --- a/examples/nvector/trilinos/CMakeLists.txt +++ b/examples/nvector/trilinos/CMakeLists.txt @@ -18,7 +18,7 @@ # for examples excluded from 'make test' in releases # Examples using SUNDIALS Trilinos nvector wrapper -if(Trilinos_INTERFACE_MPI_CXX_FOUND) +if(MPI_CXX_FOUND) set(nvector_trilinos_examples "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially "test_nvector_trilinos\;1000 0\;1\;4\;" # run parallel on 4 procs @@ -30,22 +30,12 @@ else() endif() # Dependencies for nvector examples -if(Trilinos_MPI) +if(ENABLE_MPI) set(nvector_examples_dependencies test_nvector test_mpinvector) else() set(nvector_examples_dependencies test_nvector) endif() -# Set Trilinos compilers/flags -set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") - -# Set Trilinos MPI executable for trilinos tests -set(MPIEXEC_EXECUTABLE ${Trilinos_INTERFACE_MPIEXEC}) - # Add source directory to include directories include_directories(. ..) @@ -73,7 +63,7 @@ foreach(example_tuple ${nvector_trilinos_examples}) # link vector test utilities target_link_libraries(${example} PRIVATE test_nvector_obj) - if(Trilinos_MPI) + if(ENABLE_MPI) target_link_libraries(${example} PRIVATE test_nvectormpi_obj) endif() diff --git a/examples/sunlinsol/ginkgo/CMakeLists.txt b/examples/sunlinsol/ginkgo/CMakeLists.txt index c701ffc672..97eb4f69e5 100644 --- a/examples/sunlinsol/ginkgo/CMakeLists.txt +++ b/examples/sunlinsol/ginkgo/CMakeLists.txt @@ -17,8 +17,6 @@ set(examples "test_sunlinsol_ginkgo.cpp\;bicg csr 100 0 100 0\;" # "test_sunlinsol_ginkgo.cpp\;bicg dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" - # "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" "test_sunlinsol_ginkgo.cpp\;cgs csr 100 0 100 0\;" # "test_sunlinsol_ginkgo.cpp\;cgs dense 100 0 100 0\;" "test_sunlinsol_ginkgo.cpp\;gmres csr 100 0 100 0\;" @@ -27,6 +25,14 @@ set(examples # "test_sunlinsol_ginkgo.cpp\;idr dense 100 0 100 0\;" ) +# The BiCGStab solver has a known bug with the OpenMP backend +# https://github.com/ginkgo-project/ginkgo/issues/1563 which should be fixed in +# the next release (1.9.0) by https://github.com/ginkgo-project/ginkgo/pull/1676 +set(examples_bicgstab + "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" +) + # Add source directory to include directories include_directories(..) @@ -36,6 +42,12 @@ sundials_add_examples_ginkgo( BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) +sundials_add_examples_ginkgo( + examples_bicgstab + TARGETS test_sunlinsol_obj + BACKENDS REF CUDA HIP SYCL + UNIT_TEST) + # Install the targets if(EXAMPLES_INSTALL) diff --git a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp index 9a979b2c9a..521be82167 100644 --- a/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp +++ b/examples/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp @@ -350,11 +350,19 @@ int main(int argc, char* argv[]) sundials::Context sunctx; #if defined(USE_HIP) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create())}; +#else auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; +#endif #elif defined(USE_CUDA) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create())}; +#else auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create(), false, gko::allocation_mode::device)}; +#endif #elif defined(USE_SYCL) auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; #elif defined(USE_OMP) diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index b29ac171aa..cbb1ff3d5a 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -96,18 +96,25 @@ int main(int argc, char* argv[]) /* Create SUNDIALS context before calling any other SUNDIALS function*/ sundials::Context sunctx; - auto gko_exec{ - REF_OR_OMP_OR_HIP_OR_CUDA_OR_SYCL(gko::ReferenceExecutor::create(), - gko::OmpExecutor::create(), - gko::HipExecutor::create(0, - gko::OmpExecutor::create(), - true), - gko::CudaExecutor::create(0, - gko::OmpExecutor::create(), - true), - gko::DpcppExecutor:: - create(0, - gko::ReferenceExecutor::create()))}; +#if defined(USE_CUDA) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create())}; +#else + auto gko_exec{gko::CudaExecutor::create(0, gko::OmpExecutor::create(), true)}; +#endif +#elif defined(USE_HIP) +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) + auto gko_exec { gko::HipExecutor::create(0, gko::OmpExecutor::create()) } +#else + auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create(), true)}; +#endif +#elif defined(USE_SYCL) + auto gko_exec{gko::DpcppExecutor::create(0, gko::ReferenceExecutor::create())}; +#elif defined(USE_OMP) + auto gko_exec{gko::OmpExecutor::create()}; +#else + auto gko_exec{gko::ReferenceExecutor::create()}; +#endif /* check input and set vector length */ if (argc < 4) diff --git a/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp b/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp index 8b2d68eb08..c8742ba4bf 100644 --- a/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp +++ b/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp @@ -48,11 +48,6 @@ typedef vector_type::local_ordinal_type local_ordinal_type; typedef vector_type::node_type::memory_space memory_space; typedef vector_type::execution_space execution_space; -static constexpr scalar_type zero = 0; -static constexpr scalar_type half = 0.5; -static constexpr scalar_type one = 1.0; -static constexpr scalar_type onept5 = 1.5; - /*---------------------------------------------------------------- * Streaming vector kernels *---------------------------------------------------------------*/ @@ -147,7 +142,8 @@ inline void compare(scalar_type c, const vector_type& x, vector_type& z) Kokkos::parallel_for( "compare", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i) { - z_1d(i) = std::abs(x_1d(i)) >= c ? one : zero; + z_1d(i) = std::abs(x_1d(i)) >= c ? static_cast<scalar_type>(1.0) + : static_cast<scalar_type>(0.0); }); } @@ -180,7 +176,7 @@ inline mag_type normWrms(const vector_type& x, const vector_type& w) auto w_1d = Kokkos::subview(w_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "normWrms", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { @@ -188,7 +184,7 @@ inline mag_type normWrms(const vector_type& x, const vector_type& w) }, sum); - mag_type globalSum = zero; + mag_type globalSum = static_cast<scalar_type>(0.0); reduceAll<int, mag_type>(*comm, REDUCE_SUM, sum, outArg(globalSum)); return std::sqrt(globalSum / static_cast<mag_type>(Nglob)); } @@ -225,15 +221,16 @@ inline mag_type normWrmsMask(const vector_type& x, const vector_type& w, auto id_1d = Kokkos::subview(id_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "normWrmsMask", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { - if (id_1d(i) > zero) local_sum += x_1d(i) * w_1d(i) * (x_1d(i) * w_1d(i)); + if (id_1d(i) > static_cast<scalar_type>(0.0)) + local_sum += x_1d(i) * w_1d(i) * (x_1d(i) * w_1d(i)); }, sum); - mag_type globalSum = zero; + mag_type globalSum = static_cast<scalar_type>(0.0); reduceAll<int, mag_type>(*comm, REDUCE_SUM, sum, outArg(globalSum)); return std::sqrt(globalSum / static_cast<mag_type>(Nglob)); } @@ -295,7 +292,7 @@ inline mag_type normWL2(const vector_type& x, const vector_type& w) auto w_1d = Kokkos::subview(w_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "normWL2", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { @@ -303,7 +300,7 @@ inline mag_type normWL2(const vector_type& x, const vector_type& w) }, sum); - mag_type globalSum = zero; + mag_type globalSum = static_cast<scalar_type>(0.0); reduceAll<int, mag_type>(*comm, REDUCE_SUM, sum, outArg(globalSum)); return std::sqrt(globalSum); } @@ -339,14 +336,17 @@ inline bool invTest(const vector_type& x, vector_type& z) Kokkos::parallel_reduce( "invTest", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - if (x_1d(i) == zero) { min_reducer.join(local_min, zero); } - else { z_1d(i) = one / x_1d(i); } + if (x_1d(i) == static_cast<scalar_type>(0.0)) + { + min_reducer.join(local_min, static_cast<scalar_type>(0.0)); + } + else { z_1d(i) = static_cast<scalar_type>(1.0) / x_1d(i); } }, min_reducer); scalar_type globalMin; reduceAll<int, scalar_type>(*comm, REDUCE_MIN, minimum, outArg(globalMin)); - return (globalMin > half); + return (globalMin > static_cast<scalar_type>(0.5)); } /// Find constraint violations @@ -379,20 +379,23 @@ inline bool constraintMask(const vector_type& c, const vector_type& x, auto m_1d = Kokkos::subview(m_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "constraintMask", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { - const bool test = (std::abs(c_1d(i)) > onept5 && c_1d(i) * x_1d(i) <= zero) || - (std::abs(c_1d(i)) > half && c_1d(i) * x_1d(i) < zero); - m_1d(i) = test ? one : zero; + const bool test = (std::abs(c_1d(i)) > static_cast<scalar_type>(1.5) && + c_1d(i) * x_1d(i) <= static_cast<scalar_type>(0.0)) || + (std::abs(c_1d(i)) > static_cast<scalar_type>(0.5) && + c_1d(i) * x_1d(i) < static_cast<scalar_type>(0.0)); + m_1d(i) = test ? static_cast<scalar_type>(1.0) + : static_cast<scalar_type>(0.0); local_sum += m_1d(i); }, sum); - mag_type globalSum = zero; + mag_type globalSum = static_cast<scalar_type>(0.0); reduceAll<int, mag_type>(*comm, REDUCE_SUM, sum, outArg(globalSum)); - return (globalSum < half); + return (globalSum < static_cast<scalar_type>(0.5)); } /// Minimum quotient: min_i(num(i)/den(i)) @@ -427,7 +430,8 @@ inline scalar_type minQuotient(const vector_type& num, const vector_type& den) Kokkos::parallel_reduce( "minQuotient", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - if (den_1d(i) != zero) min_reducer.join(local_min, num_1d(i) / den_1d(i)); + if (den_1d(i) != static_cast<scalar_type>(0.0)) + min_reducer.join(local_min, num_1d(i) / den_1d(i)); }, min_reducer); @@ -458,7 +462,7 @@ inline scalar_type dotProdLocal(const vector_type& x, const vector_type& y) auto y_1d = Kokkos::subview(y_2d, Kokkos::ALL(), 0); #endif - scalar_type sum = zero; + scalar_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "dotProdLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_sum) { @@ -549,7 +553,7 @@ inline mag_type L1NormLocal(const vector_type& x) auto x_1d = Kokkos::subview(x_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "L1NormLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { @@ -582,7 +586,7 @@ inline mag_type WSqrSumLocal(const vector_type& x, const vector_type& w) auto w_1d = Kokkos::subview(w_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "WSqrSumLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { @@ -622,11 +626,12 @@ inline mag_type WSqrSumMaskLocal(const vector_type& x, const vector_type& w, auto id_1d = Kokkos::subview(id_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "WSqrSumMaskLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { - if (id_1d(i) > zero) local_sum += x_1d(i) * w_1d(i) * (x_1d(i) * w_1d(i)); + if (id_1d(i) > static_cast<scalar_type>(0.0)) + local_sum += x_1d(i) * w_1d(i) * (x_1d(i) * w_1d(i)); }, sum); @@ -663,12 +668,15 @@ inline bool invTestLocal(const vector_type& x, vector_type& z) Kokkos::parallel_reduce( "invTestLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - if (x_1d(i) == zero) { min_reducer.join(local_min, zero); } - else { z_1d(i) = one / x_1d(i); } + if (x_1d(i) == static_cast<scalar_type>(0.0)) + { + min_reducer.join(local_min, static_cast<scalar_type>(0.0)); + } + else { z_1d(i) = static_cast<scalar_type>(1.0) / x_1d(i); } }, min_reducer); - return (minimum > half); + return (minimum > static_cast<scalar_type>(0.5)); } /// MPI task-local constraint violation check @@ -700,18 +708,21 @@ inline bool constraintMaskLocal(const vector_type& c, const vector_type& x, auto m_1d = Kokkos::subview(m_2d, Kokkos::ALL(), 0); #endif - mag_type sum = zero; + mag_type sum = static_cast<scalar_type>(0.0); Kokkos::parallel_reduce( "constraintMaskLocal", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, mag_type& local_sum) { - const bool test = (std::abs(c_1d(i)) > onept5 && c_1d(i) * x_1d(i) <= zero) || - (std::abs(c_1d(i)) > half && c_1d(i) * x_1d(i) < zero); - m_1d(i) = test ? one : zero; + const bool test = (std::abs(c_1d(i)) > static_cast<scalar_type>(1.5) && + c_1d(i) * x_1d(i) <= static_cast<scalar_type>(0.0)) || + (std::abs(c_1d(i)) > static_cast<scalar_type>(0.5) && + c_1d(i) * x_1d(i) < static_cast<scalar_type>(0.0)); + m_1d(i) = test ? static_cast<scalar_type>(1.0) + : static_cast<scalar_type>(0.0); local_sum += m_1d(i); }, sum); - return (sum < half); + return (sum < static_cast<scalar_type>(0.5)); } /// MPI task-local minimum quotient: min_i(num(i)/den(i)) @@ -745,7 +756,8 @@ inline scalar_type minQuotientLocal(const vector_type& num, const vector_type& d Kokkos::parallel_reduce( "minQuotient", Kokkos::RangePolicy<execution_space>(0, N), KOKKOS_LAMBDA(const local_ordinal_type& i, scalar_type& local_min) { - if (den_1d(i) != zero) min_reducer.join(local_min, num_1d(i) / den_1d(i)); + if (den_1d(i) != static_cast<scalar_type>(0.0)) + min_reducer.join(local_min, num_1d(i) / den_1d(i)); }, min_reducer); diff --git a/include/sundials/sundials_config.in b/include/sundials/sundials_config.in index def1a87414..35422a73a6 100644 --- a/include/sundials/sundials_config.in +++ b/include/sundials/sundials_config.in @@ -144,6 +144,9 @@ /* HYPRE */ #cmakedefine SUNDIALS_HYPRE_ENABLED #define SUN_HYPRE_VERSION "@HYPRE_VERSION@" +#define SUN_HYPRE_VERSION_MAJOR @HYPRE_VERSION_MAJOR@ +#define SUN_HYPRE_VERSION_MINOR @HYPRE_VERSION_MINOR@ +#define SUN_HYPRE_VERSION_PATCH @HYPRE_VERSION_PATCH@ /* KLU */ #cmakedefine SUNDIALS_KLU_ENABLED diff --git a/include/sunlinsol/sunlinsol_klu.h b/include/sunlinsol/sunlinsol_klu.h index cdedc9d1d3..9c52c77c8f 100644 --- a/include/sunlinsol/sunlinsol_klu.h +++ b/include/sunlinsol/sunlinsol_klu.h @@ -84,9 +84,14 @@ extern "C" { /* Create a typedef for the KLU solver function pointer to suppress compiler * warning messages about sunindextype vs internal KLU index types. */ +#if SUITESPARSE_MAIN_VERSION >= 6 +typedef int (*KLUSolveFn)(sun_klu_symbolic*, sun_klu_numeric*, sunindextype, + sunindextype, double*, sun_klu_common*); +#else typedef sunindextype (*KLUSolveFn)(sun_klu_symbolic*, sun_klu_numeric*, sunindextype, sunindextype, double*, sun_klu_common*); +#endif struct _SUNLinearSolverContent_KLU { diff --git a/include/sunmatrix/sunmatrix_ginkgo.hpp b/include/sunmatrix/sunmatrix_ginkgo.hpp index bc9ce0ab7d..d21e400643 100644 --- a/include/sunmatrix/sunmatrix_ginkgo.hpp +++ b/include/sunmatrix/sunmatrix_ginkgo.hpp @@ -324,8 +324,14 @@ void Matvec(Matrix<GkoMatType>& A, N_Vector x, N_Vector y) template<typename GkoMatType> void ScaleAdd(const sunrealtype c, Matrix<GkoMatType>& A, Matrix<GkoMatType>& B) { +#if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 8) + // Identity constructor always creates a square matrix + const auto I{ + gko::matrix::Identity<sunrealtype>::create(A.GkoExec(), A.GkoSize()[1])}; +#else const auto I{ gko::matrix::Identity<sunrealtype>::create(A.GkoExec(), A.GkoSize())}; +#endif const auto one{gko::initialize<GkoDenseMat>({1.0}, A.GkoExec())}; const auto cmat{gko::initialize<GkoDenseMat>({c}, A.GkoExec())}; // A = B + cA diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 1473b8f204..be15bd2b2f 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -3536,7 +3536,8 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, int line, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 3dc22b9a40..8b5e62b22d 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -4815,7 +4815,8 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 5350674269..1966d560c7 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -9914,7 +9914,8 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/ida/ida.c b/src/ida/ida.c index a349b63bb0..c532e2c7a5 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -3998,7 +3998,8 @@ void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/idas/idas.c b/src/idas/idas.c index 3702dc6963..05f5c976cf 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -8763,7 +8763,8 @@ void IDAProcessError(IDAMem IDA_mem, int error_code, int line, const char* func, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index d35c9b3393..cc3081e7b5 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -2571,7 +2571,8 @@ void KINProcessError(KINMem kin_mem, int error_code, int line, const char* func, /* Compose the message */ va_start(ap, msgfmt); - size_t msglen = vsnprintf(NULL, 0, msgfmt, ap) + 1; + size_t msglen = 1; + if (msgfmt) { msglen += vsnprintf(NULL, 0, msgfmt, ap); } va_end(ap); char* msg = (char*)malloc(msglen); diff --git a/src/nvector/trilinos/CMakeLists.txt b/src/nvector/trilinos/CMakeLists.txt index d2d119cb3e..dfe25d87ab 100644 --- a/src/nvector/trilinos/CMakeLists.txt +++ b/src/nvector/trilinos/CMakeLists.txt @@ -16,22 +16,13 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_Trilinos\n\")") -# Set Trilinos compilers/flags -set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") - # Create the library sundials_add_library( sundials_nvectrilinos SOURCES nvector_trilinos.cpp HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_trilinos.h INCLUDE_SUBDIR nvector - LINK_LIBRARIES PUBLIC sundials_core - OBJECT_LIBRARIES - LINK_LIBRARIES PUBLIC SUNDIALS::TRILINOS + LINK_LIBRARIES PUBLIC sundials_core Tpetra::all_libs OUTPUT_NAME sundials_nvectrilinos VERSION ${nveclib_VERSION} SOVERSION ${nveclib_SOVERSION}) diff --git a/src/nvector/trilinos/nvector_trilinos.cpp b/src/nvector/trilinos/nvector_trilinos.cpp index 880bb33c95..85381e0850 100644 --- a/src/nvector/trilinos/nvector_trilinos.cpp +++ b/src/nvector/trilinos/nvector_trilinos.cpp @@ -238,7 +238,7 @@ void N_VSpace_Trilinos(N_Vector x, sunindextype* lrw, sunindextype* liw) /* * MPI communicator accessor */ -SUNComm N_VGetCommunicator_Trilinos(N_Vector x) +SUNComm N_VGetCommunicator_Trilinos(SUNDIALS_MAYBE_UNUSED N_Vector x) { #ifdef SUNDIALS_TRILINOS_HAVE_MPI Teuchos::RCP<const vector_type> xv = N_VGetVector_Trilinos(x); diff --git a/test/answers b/test/answers index 6426658117..c9da3649ff 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 64266581174b2a2c31283e82f5d28ea5683f6bce +Subproject commit c9da3649ffcf693b0a6f8c12690e42ef83993bdd diff --git a/test/env/default.sh b/test/env/default.sh index 4f72c3f7f5..6ca282cb07 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -14,35 +14,11 @@ # ------------------------------------------------------------------------------ # Script that sets up the default SUNDIALS testing environment. # -# Usage: source default.sh <compiler spec> <build type> -# -# Optional Inputs: -# <compiler spec> = Compiler to build sundials with: -# gcc@4.9.4 -# <build type> = SUNDIALS build type: -# dbg : debug build -# opt : optimized build +# Usage: source default.sh # ------------------------------------------------------------------------------ echo "./default.sh $*" | tee -a setup_env.log -# set defaults for optional inputs -compiler="gcc@5.5.0" # compiler spec -bldtype="dbg" # build type dbg = debug or opt = optimized - -# set optional inputs if provided -if [ "$#" -gt 0 ]; then - compiler=$1 -fi - -if [ "$#" -gt 1 ]; then - bldtype=$2 -fi - -# get compiler name and version from spec -compilername="${compiler%%@*}" -compilerversion="${compiler##*@}" - # ------------------------------------------------------------------------------ # Check input values # ------------------------------------------------------------------------------ @@ -63,22 +39,6 @@ case "$SUNDIALS_INDEX_SIZE" in ;; esac -case "$compiler" in - gcc@5.5.0) ;; - *) - echo "ERROR: Unknown compiler spec: $compiler" - return 1 - ;; -esac - -case "$bldtype" in - dbg|opt) ;; - *) - echo "ERROR: Unknown build type: $bldtype" - return 1 - ;; -esac - # ------------------------------------------------------------------------------ # Setup environment # ------------------------------------------------------------------------------ @@ -86,77 +46,40 @@ esac # set file permissions (rwxrwxr-x) umask 002 -# path to shared installs -APPROOT=/usr/casc/sundials/share - # setup the python environment -source ${APPROOT}/python-venv/sundocs/bin/activate +source /usr/local/suntest/pyevn/sundials/bin/activate # setup spack -export SPACK_ROOT=${APPROOT}/sundials-tpls-spack-v0.18.1/spack - -# shellcheck disable=SC1090 +export SPACK_ROOT=/usr/local/suntest/spack source ${SPACK_ROOT}/share/spack/setup-env.sh -# load compiler -spack load "${compiler}" - -# make sure spack knows about the compiler -spack compiler find - -spack load cmake@3.18.6 - # add CUDA -if [[ ":${PATH}:" != *":/usr/local/cuda-11.5/bin:"* ]]; then - export PATH="/usr/local/cuda-11.5/bin${PATH:+:${PATH}}" +export CUDAARCHS=60 + +if [[ ":${PATH}:" != *":/usr/local/cuda/bin:"* ]]; then + export PATH="/usr/local/cuda/bin${PATH:+:${PATH}}" fi -if [[ ":${LD_LIBRARY_PATH}:" != *":/usr/local/cuda-11.5/lib64:"* ]]; then - export LD_LIBRARY_PATH="/usr/local/cuda-11.5/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" +if [[ ":${LD_LIBRARY_PATH}:" != *":/usr/local/cuda/lib64:"* ]]; then + export LD_LIBRARY_PATH="/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" fi +# load CMake +spack load cmake@3.18.6 + # ------------------------------------------------------------------------------ # Compilers and flags # ------------------------------------------------------------------------------ -if [ "$compilername" == "gcc" ]; then - - COMPILER_ROOT="$(spack location -i "$compiler")" - export CC="${COMPILER_ROOT}/bin/gcc" - export CXX="${COMPILER_ROOT}/bin/g++" - export FC="${COMPILER_ROOT}/bin/gfortran" - - # optimization flags - if [ "$bldtype" == "dbg" ]; then - export CFLAGS="-g -O0" - export CXXFLAGS="-g -O0" - export FFLAGS="-g -O0" - export CUDAFLAGS="-g -O0" - else - export CFLAGS="-g -O3" - export CXXFLAGS="-g -O3" - export FFLAGS="-g -O3" - export CUDAFLAGS="-g -O3" - fi - -else - - COMPILER_ROOT="$(spack location -i "llvm@$compilerversion")" - export CC="${COMPILER_ROOT}/bin/clang" - export CXX="${COMPILER_ROOT}/bin/clang++" - - # optimization flags - if [ "$bldtype" == "dbg" ]; then - export CFLAGS="-g -O0" - export CXXFLAGS="-g -O0" - export CUDAFLAGS="-g -O0" - else - export CFLAGS="-g -O3" - export CXXFLAGS="-g -O3" - export CUDAFLAGS="-g -O3" - fi +export CC="$(which gcc)" +export CXX="$(which g++)" +export FC="$(which gfortran)" -fi +# disable optimization +export CFLAGS="-O0" +export CXXFLAGS="-O0" +export FFLAGS="-O0" +export CUDAFLAGS="-O0" # ------------------------------------------------------------------------------ # SUNDIALS Options @@ -180,12 +103,8 @@ export SUNDIALS_IDAS=ON export SUNDIALS_KINSOL=ON # Fortran interface status -if [ "$compilername" == "gcc" ]; then - if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then - export SUNDIALS_FMOD_INTERFACE=ON - else - export SUNDIALS_FMOD_INTERFACE=OFF - fi +if [[ ("$SUNDIALS_PRECISION" == "double") ]]; then + export SUNDIALS_FMOD_INTERFACE=ON else export SUNDIALS_FMOD_INTERFACE=OFF fi @@ -238,7 +157,6 @@ export SUNDIALS_OPENMP_OFFLOAD=OFF if [ "$SUNDIALS_PRECISION" != "extended" ]; then export SUNDIALS_CUDA=ON - export CUDAARCHS=60 export SUNDIALS_FUSED_KERNELS=ON else export SUNDIALS_CUDA=OFF @@ -249,7 +167,7 @@ fi # MPI # --- -MPI_ROOT="$(spack location -i openmpi@4.1.3 % "$compiler")" +MPI_ROOT="$(spack location -i openmpi@5.0.5)" export SUNDIALS_MPI=ON export MPICC="${MPI_ROOT}/bin/mpicc" @@ -264,9 +182,9 @@ export MPIEXEC="${MPI_ROOT}/bin/mpirun" if [ "$SUNDIALS_PRECISION" != "extended" ]; then export SUNDIALS_LAPACK=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - LAPACK_ROOT="$(spack location -i openblas@0.3.20 ~ilp64 %"$compiler")" + LAPACK_ROOT="$(spack location -i openblas@0.3.27 ~ilp64)" else - LAPACK_ROOT="$(spack location -i openblas@0.3.20 +ilp64 %"$compiler")" + LAPACK_ROOT="$(spack location -i openblas@0.3.27 +ilp64)" fi export LAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libopenblas.so" else @@ -281,9 +199,9 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_KLU=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - SUITE_SPARSE_ROOT="$(spack location -i suite-sparse@5.10.1 ^openblas ~ilp64 %"$compiler")" + SUITE_SPARSE_ROOT="$(spack location -i suite-sparse@7.7.0 ^openblas ~ilp64)" else - SUITE_SPARSE_ROOT="$(spack location -i suite-sparse@5.10.1 ^openblas +ilp64 %"$compiler")" + SUITE_SPARSE_ROOT="$(spack location -i suite-sparse@7.7.0 ^openblas +ilp64)" fi export SUITE_SPARSE_INCLUDE_DIR="${SUITE_SPARSE_ROOT}/include" export SUITE_SPARSE_LIBRARY_DIR="${SUITE_SPARSE_ROOT}/lib" @@ -297,11 +215,10 @@ fi # ------ if [ "$SUNDIALS_PRECISION" != "extended" ]; then - # @develop install is GitHub hash 4c3320c9c4e116a2d5aedf9d042b36d1f327a217 if [ "$SUNDIALS_CUDA" == "ON" ]; then if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then export SUNDIALS_GINKGO=ON - export GINKGO_ROOT="$(spack location -i ginkgo@develop +cuda %"$compiler")" + export GINKGO_ROOT="$(spack location -i ginkgo@1.8.0 +cuda)" export GINKGO_BACKENDS="REF;OMP;CUDA" else export SUNDIALS_GINKGO=OFF @@ -310,7 +227,7 @@ if [ "$SUNDIALS_PRECISION" != "extended" ]; then fi else export SUNDIALS_GINKGO=ON - export GINKGO_ROOT="$(spack location -i ginkgo@develop ~cuda %"$compiler")" + export GINKGO_ROOT="$(spack location -i ginkgo@1.8.0 ~cuda)" export GINKGO_BACKENDS="REF;OMP" fi else @@ -319,15 +236,13 @@ else unset GINKGO_BACKENDS fi - # ------ # Kokkos # ------ -# @master install is 3.7.00 = 61d7db55fceac3318c987a291f77b844fd94c165 if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_KOKKOS=ON - export KOKKOS_ROOT="$(spack location -i kokkos@master %"$compiler")" + export KOKKOS_ROOT="$(spack location -i kokkos@4.3.01 ~cuda)" else export SUNDIALS_KOKKOS=OFF unset KOKKOS_ROOT @@ -337,10 +252,9 @@ fi # Kokkos-Kernels # -------------- -# @master install is 3.7.00 = 04821ac3bb916b19fad6b3dabc1f4b9e1049aa0e if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_KOKKOS_KERNELS=ON - export KOKKOS_KERNELS_ROOT="$(spack location -i kokkos-kernels@master %"$compiler")" + export KOKKOS_KERNELS_ROOT="$(spack location -i kokkos-kernels@4.3.01 ~cuda)" else export SUNDIALS_KOKKOS_KERNELS=OFF unset KOKKOS_KERNELS_ROOT @@ -354,9 +268,7 @@ if [ "$SUNDIALS_PRECISION" != "extended" ] && \ [ "$SUNDIALS_INDEX_SIZE" == "32" ] && \ [ "$SUNDIALS_CUDA" == "ON" ]; then export SUNDIALS_MAGMA=ON - # Bug in magma@2.6.2 causes tests to fail with certain system sizes - #export MAGMA_ROOT="$(spack location -i magma@2.6.2 +cuda %"$compiler")" - export MAGMA_ROOT="$(spack location -i magma@2.6.1 +cuda %"$compiler")" + export MAGMA_ROOT="$(spack location -i magma@2.8.0 +cuda)" export MAGMA_BACKENDS="CUDA" else export SUNDIALS_MAGMA=OFF @@ -370,10 +282,12 @@ fi if [ "$SUNDIALS_PRECISION" != "extended" ]; then export SUNDIALS_SUPERLU_MT=ON + # Using @master (sha 9e23fe72652afc28c97829e69e7c6966050541a7) as it + # additional fixes necessary for building with newer versions of GCC if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - SUPERLU_MT_ROOT="$(spack location -i superlu-mt@3.1 ~int64 %"$compiler")" + SUPERLU_MT_ROOT="$(spack location -i superlu-mt@master ~int64)" else - SUPERLU_MT_ROOT="$(spack location -i superlu-mt@3.1 +int64 %"$compiler")" + SUPERLU_MT_ROOT="$(spack location -i superlu-mt@master +int64)" fi export SUPERLU_MT_INCLUDE_DIR="${SUPERLU_MT_ROOT}/include" export SUPERLU_MT_LIBRARY_DIR="${SUPERLU_MT_ROOT}/lib" @@ -395,9 +309,9 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_SUPERLU_DIST=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - export SUPERLU_DIST_ROOT="$(spack location -i superlu-dist@7.2.0 ~int64 ~cuda %"$compiler")" + export SUPERLU_DIST_ROOT="$(spack location -i superlu-dist@8.2.1 ~int64 ~cuda)" else - export SUPERLU_DIST_ROOT="$(spack location -i superlu-dist@7.2.0 +int64 ~cuda ^parmetis+int64 ^metis+int64 ^openblas~ilp64 %"$compiler")" + export SUPERLU_DIST_ROOT="$(spack location -i superlu-dist@8.2.1 +int64 ~cuda)" fi export SUPERLU_DIST_OPENMP=OFF else @@ -413,9 +327,9 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_HYPRE=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - HYPRE_ROOT="$(spack location -i hypre@2.24.0 ~int64 ~cuda %"$compiler")" + HYPRE_ROOT="$(spack location -i hypre@2.31.0 ~int64 ~cuda)" else - HYPRE_ROOT="$(spack location -i hypre@2.24.0 +int64 ~cuda %"$compiler")" + HYPRE_ROOT="$(spack location -i hypre@2.31.0 +int64 ~cuda)" fi export HYPRE_INCLUDE_DIR="${HYPRE_ROOT}/include" export HYPRE_LIBRARY_DIR="${HYPRE_ROOT}/lib" @@ -432,9 +346,9 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_PETSC=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - PETSC_ROOT="$(spack location -i petsc@3.17.1 +double ~int64 ~cuda %"$compiler")" + PETSC_ROOT="$(spack location -i petsc@3.21.4 +double ~int64 ~cuda)" else - PETSC_ROOT="$(spack location -i petsc@3.17.1 +double +int64 ~cuda %"$compiler")" + PETSC_ROOT="$(spack location -i petsc@3.21.4 +double +int64 ~cuda)" fi export PETSC_ROOT else @@ -449,9 +363,9 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ] && [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then export SUNDIALS_TRILINOS=ON if [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - TRILINOS_ROOT="$(spack location -i trilinos@13.0.1 gotype=int ~cuda %"$compiler")" + TRILINOS_ROOT="$(spack location -i trilinos@16.0.0 gotype=int ~cuda)" else - TRILINOS_ROOT="$(spack location -i trilinos@13.0.1 gotype=long_long ~cuda %"$compiler")" + TRILINOS_ROOT="$(spack location -i trilinos@16.0.0 gotype=long_long ~cuda)" fi export TRILINOS_ROOT else @@ -465,10 +379,10 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ]; then export SUNDIALS_RAJA=ON - export RAJA_ROOT="$(spack location -i raja@2022.03.1 ~openmp +cuda %"$compiler")" + export RAJA_ROOT="$(spack location -i raja@2024.02.2 +cuda)" export RAJA_BACKENDS="CUDA" # RAJA does not find camp on its own? - export camp_ROOT="$(spack location -i camp@2022.03.2 +cuda %"$compiler")" + export camp_ROOT="$(spack location -i camp@2024.02.1 +cuda)" else export SUNDIALS_RAJA=OFF unset RAJA_ROOT @@ -482,7 +396,7 @@ fi if [ "$SUNDIALS_PRECISION" == "double" ] && [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then export SUNDIALS_XBRAID=ON - export XBRAID_ROOT="$(spack location -i xbraid@3.0.0 %"$compiler")" + export XBRAID_ROOT="$(spack location -i xbraid@3.0.0)" else export SUNDIALS_XBRAID=OFF unset XBRAID_ROOT diff --git a/test/env/docker.sh b/test/env/docker.sh index 3d235839ce..0645ccbfed 100644 --- a/test/env/docker.sh +++ b/test/env/docker.sh @@ -339,7 +339,7 @@ fi # -------- if [ "$SUNDIALS_PRECISION" == "double" ] && [ "$SUNDIALS_INDEX_SIZE" == "32" ]; then - export SUNDIALS_TRILINOS=ON + export SUNDIALS_TRILINOS=OFF export TRILINOS_ROOT=/opt/view else export SUNDIALS_TRILINOS=OFF diff --git a/test/jenkins/README.md b/test/jenkins/README.md index 5d51bc531a..ebefb998a9 100644 --- a/test/jenkins/README.md +++ b/test/jenkins/README.md @@ -127,8 +127,8 @@ and end of a collapsible section. enter/do the following: Section name: {1} - Section starts with: START TEST - Section ends with: (PASSED|FAILED) + Section starts with: TEST: (.*) + Section ends with: (PASSED|FAILED): (.*) Check the box next to "Collapse Sections by default" 7. To create a INSTALLING section, click on "Add Console Section" and diff --git a/test/unit_tests/arkode/C_serial/ark_test_reset.c b/test/unit_tests/arkode/C_serial/ark_test_reset.c index 529a3d62cf..537adbf978 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -498,8 +498,8 @@ static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype at /* compute solution error */ ans = ytrue(t); - ewt = SUN_RCONST(1.0) / (rtol * fabs(ans) + atol); - err = ewt * fabs(NV_Ith_S(y, 0) - ans); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(NV_Ith_S(y, 0) - ans); /* is the solution within the tolerances? */ passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_jbad_1.0.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_jbad_1.0.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_jbad_1.0.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_jbad_1.0.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_lsetup_0.0.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_lsetup_0.0.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_lsetup_0.0.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--dgmax_lsetup_0.0.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_cf_0.5.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_cf_0.5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_cf_0.5.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_cf_0.5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_ef_0.1_--small_nef_1.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_ef_0.1_--small_nef_1.out index 0a4e2b826b..0a14173f9d 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_ef_0.1_--small_nef_1.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_ef_0.1_--small_nef_1.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127007526754027e+00 1.551798865570904e+00 2.301479103516968e-06 7.548097018528210e-07 - 2.000000000000000e+00 8.899039207780429e-01 1.154591213714133e+00 1.352107500851574e-06 8.198791543012618e-06 - 3.000000000000000e+00 7.106357482521893e-01 1.023517382507561e+00 4.116072547244443e-07 3.970183883872380e-07 - 4.000000000000000e+00 8.204798818139928e-01 1.374656498648397e+00 5.513190454276007e-06 2.463659915963312e-05 - 5.000000000000000e+00 1.068564963322506e+00 1.691834094334029e+00 5.564090299614577e-09 4.808247326515414e-06 - 6.000000000000000e+00 1.216591810654471e+00 1.677567596214340e+00 4.311407013402047e-06 1.551936946242449e-05 - 7.000000000000000e+00 1.173435748816172e+00 1.342473383443199e+00 1.403690566004201e-07 1.801137464019220e-05 - 8.000000000000000e+00 9.629391196580445e-01 1.012109414731435e+00 9.165028818092225e-07 2.578678761855357e-06 - 9.000000000000000e+00 7.378667583329571e-01 1.183902498984600e+00 8.459567088725528e-06 3.598161782281117e-05 - 1.000000000000000e+01 7.618881720180362e-01 1.577082165589996e+00 6.136882823248868e-06 1.528186226451567e-07 + 2.000000000000000e+00 8.899039207901290e-01 1.154591213259856e+00 1.352119586961464e-06 8.198337265508115e-06 + 3.000000000000000e+00 7.106357095240244e-01 1.023533553968366e+00 4.503354196216947e-07 1.656847919329074e-05 + 4.000000000000000e+00 8.204797090224738e-01 1.374674798175743e+00 5.340398935294033e-06 4.293612650640988e-05 + 5.000000000000000e+00 1.068568799206777e+00 1.691846388757366e+00 3.830320180586710e-06 7.486176010651491e-06 + 6.000000000000000e+00 1.216593431224251e+00 1.677563096846002e+00 5.931976793549509e-06 1.102000112496171e-05 + 7.000000000000000e+00 1.173436919049330e+00 1.342481412337947e+00 1.310602214310563e-06 2.604026938879400e-05 + 8.000000000000000e+00 9.629477831479546e-01 1.012160095609326e+00 9.579992791941550e-06 4.810219912920743e-05 + 9.000000000000000e+00 7.378633330120637e-01 1.183890879406442e+00 5.034246195356751e-06 2.436203966471595e-05 + 1.000000000000000e+01 7.618899385439418e-01 1.577125935900683e+00 7.903408728915373e-06 4.392312930967535e-05 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00451093359436 -Steps = 2207 -Error test fails = 185 +Current time = 10.00425372374186 +Steps = 2329 +Error test fails = 209 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.007683783711129318 -Current step size = 0.007683783711129318 +Last step size = 0.00604072055819684 +Current step size = 0.01119929556740219 Last method order = 4 -Current method order = 4 +Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 3004 -NLS iters = 3001 +RHS fn evals = 3188 +NLS iters = 3185 NLS fails = 0 -NLS iters per step = 1.359764386044404 -LS setups = 751 -Jac fn evals = 41 +NLS iters per step = 1.367539716616574 +LS setups = 823 +Jac fn evals = 43 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01366211262912363 +Jac evals per NLS iter = 0.01350078492935636 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_fs_2.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_fs_2.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_fs_2.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_max_fs_2.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_ef_0.5.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_ef_0.5.out index cc2f56d0f9..8d72a04472 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_ef_0.5.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_ef_0.5.out @@ -1,32 +1,32 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127015798965803e+00 1.551817101165368e+00 5.970732673166168e-06 1.748078476238035e-05 - 2.000000000000000e+00 8.899077623052392e-01 1.154605790521889e+00 5.193634697087113e-06 2.277559929919626e-05 - 3.000000000000000e+00 7.106404517217246e-01 1.023538681494556e+00 4.291862280569880e-06 2.169600538337590e-05 - 4.000000000000000e+00 8.204753960502632e-01 1.374635909783589e+00 1.027426724697911e-06 4.047734351475540e-06 - 5.000000000000000e+00 1.068564502769698e+00 1.691818039836895e+00 4.661168988562281e-07 2.086274445978198e-05 - 6.000000000000000e+00 1.216587851997169e+00 1.677546347146822e+00 3.527497114408362e-07 5.729698055789711e-06 - 7.000000000000000e+00 1.173437871476192e+00 1.342487857991437e+00 2.263029076576828e-06 3.248592287796725e-05 - 8.000000000000000e+00 9.629429628371622e-01 1.012128557748354e+00 4.759681999533250e-06 1.656433815688807e-05 - 9.000000000000000e+00 7.378705116374682e-01 1.183937587786273e+00 1.221287159980378e-05 7.107041949527826e-05 - 1.000000000000000e+01 7.618905380496568e-01 1.577089346437596e+00 8.502914443875298e-06 7.333666222963942e-06 + 1.000000000000000e+00 1.127015798965806e+00 1.551817101164785e+00 5.970732675608659e-06 1.748078417929122e-05 + 2.000000000000000e+00 8.899077623050877e-01 1.154605790521226e+00 5.193634545652692e-06 2.277559863617107e-05 + 3.000000000000000e+00 7.106404517183447e-01 1.023538680954640e+00 4.291858900606904e-06 2.169546546704204e-05 + 4.000000000000000e+00 8.204753489673684e-01 1.374635326513250e+00 9.803438298927603e-07 3.464464013003266e-06 + 5.000000000000000e+00 1.068564576357820e+00 1.691828549227964e+00 3.925287770378816e-07 1.035335339105714e-05 + 6.000000000000000e+00 1.216590045030178e+00 1.677572323554410e+00 2.545782720186907e-06 2.024670953293395e-05 + 7.000000000000000e+00 1.173440258251221e+00 1.342486064374871e+00 4.649804105305577e-06 3.069230631269626e-05 + 8.000000000000000e+00 9.629458547609638e-01 1.012157904944172e+00 7.651605801184402e-06 4.591153397504044e-05 + 9.000000000000000e+00 7.378719831470653e-01 1.183933689447477e+00 1.368438119686566e-05 6.717208069995095e-05 + 1.000000000000000e+01 7.618916076913168e-01 1.577104660749360e+00 9.572556103898400e-06 2.264797798678941e-05 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00477688331602 -Steps = 1587 -Error test fails = 141 +Current time = 10.00203638578589 +Steps = 1593 +Error test fails = 152 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.005751532513273557 -Current step size = 0.01173715213294061 +Last step size = 0.006712297137966068 +Current step size = 0.006712297137966068 Last method order = 5 Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 2189 -NLS iters = 2186 -NLS fails = 1 -NLS iters per step = 1.377441713925646 -LS setups = 270 +RHS fn evals = 2225 +NLS iters = 2222 +NLS fails = 0 +NLS iters per step = 1.394852479598242 +LS setups = 283 Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01326623970722781 +Jac evals per NLS iter = 0.01305130513051305 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_es_2_--small_nst_5.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_es_2_--small_nst_5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_es_2_--small_nst_5.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_es_2_--small_nst_5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out index ec141c1925..d6cbb37abc 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127010231169071e+00 1.551807554033271e+00 4.029359408352917e-07 7.933652665048641e-06 - 2.000000000000000e+00 8.899061205561563e-01 1.154606179589197e+00 3.551885614183625e-06 2.316466660645666e-05 - 3.000000000000000e+00 7.106424210639757e-01 1.023549409701108e+00 6.261204531621267e-06 3.242421193494494e-05 - 4.000000000000000e+00 8.204814601813510e-01 1.374657421210761e+00 7.091557812533011e-06 2.555916152413573e-05 - 5.000000000000000e+00 1.068572372339015e+00 1.691864172592888e+00 7.403452418897061e-06 2.527001153240782e-05 - 6.000000000000000e+00 1.216592470265054e+00 1.677579961463762e+00 4.971017596444582e-06 2.788461888481031e-05 - 7.000000000000000e+00 1.173447050388805e+00 1.342528207391852e+00 1.144194168967161e-05 7.283532329349640e-05 - 8.000000000000000e+00 9.629518083856625e-01 1.012162097171965e+00 1.360523049986906e-05 5.010376176772802e-05 - 9.000000000000000e+00 7.378729059558163e-01 1.183922375566823e+00 1.460718994794608e-05 5.585820004605502e-05 - 1.000000000000000e+01 7.618958276795634e-01 1.577122317502578e+00 1.379254435052157e-05 4.030473120475442e-05 + 1.000000000000000e+00 1.127010231169071e+00 1.551807554033266e+00 4.029359408352917e-07 7.933652660385704e-06 + 2.000000000000000e+00 8.899061205559413e-01 1.154606179579956e+00 3.551885399244448e-06 2.316465736562634e-05 + 3.000000000000000e+00 7.106424212341577e-01 1.023549411912243e+00 6.261374713600887e-06 3.242642307044186e-05 + 4.000000000000000e+00 8.204814571358759e-01 1.374657408976591e+00 7.088512337438679e-06 2.554692735379227e-05 + 5.000000000000000e+00 1.068572364198821e+00 1.691864129787617e+00 7.395312224378614e-06 2.522720626196850e-05 + 6.000000000000000e+00 1.216592227118846e+00 1.677571467388444e+00 4.727871388388039e-06 1.939054356636660e-05 + 7.000000000000000e+00 1.173443618841214e+00 1.342493467296904e+00 8.010394098256768e-06 3.809522834541390e-05 + 8.000000000000000e+00 9.629424396388875e-01 1.012121124268885e+00 4.236483724828766e-06 9.130858687589338e-06 + 9.000000000000000e+00 7.378604981968989e-01 1.183872079873866e+00 2.199431030525112e-06 5.562507089162949e-06 + 1.000000000000000e+01 7.618819895397966e-01 1.577086853397597e+00 4.559541633142317e-08 4.840626223412414e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00714850788732 -Steps = 1502 -Error test fails = 92 +Current time = 10.00417454325856 +Steps = 1575 +Error test fails = 96 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.009862197222912128 -Current step size = 0.009862197222912128 +Last step size = 0.01182372679957014 +Current step size = 0.01182372679957014 Last method order = 5 Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 1897 -NLS iters = 1894 -NLS fails = 1 -NLS iters per step = 1.26098535286285 -LS setups = 166 -Jac fn evals = 27 +RHS fn evals = 2002 +NLS iters = 1999 +NLS fails = 0 +NLS iters per step = 1.269206349206349 +LS setups = 178 +Jac fn evals = 28 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01425554382259768 +Jac evals per NLS iter = 0.01400700350175088 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_gs_2.out b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_gs_2.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_gs_2.out +++ b/test/unit_tests/cvode/CXX_serial/cv_test_kpr_--eta_min_gs_2.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_jbad_1.0.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_jbad_1.0.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_jbad_1.0.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_jbad_1.0.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_lsetup_0.0.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_lsetup_0.0.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_lsetup_0.0.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--dgmax_lsetup_0.0.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_cf_0.5.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_cf_0.5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_cf_0.5.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_cf_0.5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_ef_0.1_--small_nef_1.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_ef_0.1_--small_nef_1.out index 0a4e2b826b..0a14173f9d 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_ef_0.1_--small_nef_1.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_ef_0.1_--small_nef_1.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127007526754027e+00 1.551798865570904e+00 2.301479103516968e-06 7.548097018528210e-07 - 2.000000000000000e+00 8.899039207780429e-01 1.154591213714133e+00 1.352107500851574e-06 8.198791543012618e-06 - 3.000000000000000e+00 7.106357482521893e-01 1.023517382507561e+00 4.116072547244443e-07 3.970183883872380e-07 - 4.000000000000000e+00 8.204798818139928e-01 1.374656498648397e+00 5.513190454276007e-06 2.463659915963312e-05 - 5.000000000000000e+00 1.068564963322506e+00 1.691834094334029e+00 5.564090299614577e-09 4.808247326515414e-06 - 6.000000000000000e+00 1.216591810654471e+00 1.677567596214340e+00 4.311407013402047e-06 1.551936946242449e-05 - 7.000000000000000e+00 1.173435748816172e+00 1.342473383443199e+00 1.403690566004201e-07 1.801137464019220e-05 - 8.000000000000000e+00 9.629391196580445e-01 1.012109414731435e+00 9.165028818092225e-07 2.578678761855357e-06 - 9.000000000000000e+00 7.378667583329571e-01 1.183902498984600e+00 8.459567088725528e-06 3.598161782281117e-05 - 1.000000000000000e+01 7.618881720180362e-01 1.577082165589996e+00 6.136882823248868e-06 1.528186226451567e-07 + 2.000000000000000e+00 8.899039207901290e-01 1.154591213259856e+00 1.352119586961464e-06 8.198337265508115e-06 + 3.000000000000000e+00 7.106357095240244e-01 1.023533553968366e+00 4.503354196216947e-07 1.656847919329074e-05 + 4.000000000000000e+00 8.204797090224738e-01 1.374674798175743e+00 5.340398935294033e-06 4.293612650640988e-05 + 5.000000000000000e+00 1.068568799206777e+00 1.691846388757366e+00 3.830320180586710e-06 7.486176010651491e-06 + 6.000000000000000e+00 1.216593431224251e+00 1.677563096846002e+00 5.931976793549509e-06 1.102000112496171e-05 + 7.000000000000000e+00 1.173436919049330e+00 1.342481412337947e+00 1.310602214310563e-06 2.604026938879400e-05 + 8.000000000000000e+00 9.629477831479546e-01 1.012160095609326e+00 9.579992791941550e-06 4.810219912920743e-05 + 9.000000000000000e+00 7.378633330120637e-01 1.183890879406442e+00 5.034246195356751e-06 2.436203966471595e-05 + 1.000000000000000e+01 7.618899385439418e-01 1.577125935900683e+00 7.903408728915373e-06 4.392312930967535e-05 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00451093359436 -Steps = 2207 -Error test fails = 185 +Current time = 10.00425372374186 +Steps = 2329 +Error test fails = 209 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.007683783711129318 -Current step size = 0.007683783711129318 +Last step size = 0.00604072055819684 +Current step size = 0.01119929556740219 Last method order = 4 -Current method order = 4 +Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 3004 -NLS iters = 3001 +RHS fn evals = 3188 +NLS iters = 3185 NLS fails = 0 -NLS iters per step = 1.359764386044404 -LS setups = 751 -Jac fn evals = 41 +NLS iters per step = 1.367539716616574 +LS setups = 823 +Jac fn evals = 43 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01366211262912363 +Jac evals per NLS iter = 0.01350078492935636 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_fs_2.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_fs_2.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_fs_2.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_max_fs_2.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_ef_0.5.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_ef_0.5.out index cc2f56d0f9..8d72a04472 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_ef_0.5.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_ef_0.5.out @@ -1,32 +1,32 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127015798965803e+00 1.551817101165368e+00 5.970732673166168e-06 1.748078476238035e-05 - 2.000000000000000e+00 8.899077623052392e-01 1.154605790521889e+00 5.193634697087113e-06 2.277559929919626e-05 - 3.000000000000000e+00 7.106404517217246e-01 1.023538681494556e+00 4.291862280569880e-06 2.169600538337590e-05 - 4.000000000000000e+00 8.204753960502632e-01 1.374635909783589e+00 1.027426724697911e-06 4.047734351475540e-06 - 5.000000000000000e+00 1.068564502769698e+00 1.691818039836895e+00 4.661168988562281e-07 2.086274445978198e-05 - 6.000000000000000e+00 1.216587851997169e+00 1.677546347146822e+00 3.527497114408362e-07 5.729698055789711e-06 - 7.000000000000000e+00 1.173437871476192e+00 1.342487857991437e+00 2.263029076576828e-06 3.248592287796725e-05 - 8.000000000000000e+00 9.629429628371622e-01 1.012128557748354e+00 4.759681999533250e-06 1.656433815688807e-05 - 9.000000000000000e+00 7.378705116374682e-01 1.183937587786273e+00 1.221287159980378e-05 7.107041949527826e-05 - 1.000000000000000e+01 7.618905380496568e-01 1.577089346437596e+00 8.502914443875298e-06 7.333666222963942e-06 + 1.000000000000000e+00 1.127015798965806e+00 1.551817101164785e+00 5.970732675608659e-06 1.748078417929122e-05 + 2.000000000000000e+00 8.899077623050877e-01 1.154605790521226e+00 5.193634545652692e-06 2.277559863617107e-05 + 3.000000000000000e+00 7.106404517183447e-01 1.023538680954640e+00 4.291858900606904e-06 2.169546546704204e-05 + 4.000000000000000e+00 8.204753489673684e-01 1.374635326513250e+00 9.803438298927603e-07 3.464464013003266e-06 + 5.000000000000000e+00 1.068564576357820e+00 1.691828549227964e+00 3.925287770378816e-07 1.035335339105714e-05 + 6.000000000000000e+00 1.216590045030178e+00 1.677572323554410e+00 2.545782720186907e-06 2.024670953293395e-05 + 7.000000000000000e+00 1.173440258251221e+00 1.342486064374871e+00 4.649804105305577e-06 3.069230631269626e-05 + 8.000000000000000e+00 9.629458547609638e-01 1.012157904944172e+00 7.651605801184402e-06 4.591153397504044e-05 + 9.000000000000000e+00 7.378719831470653e-01 1.183933689447477e+00 1.368438119686566e-05 6.717208069995095e-05 + 1.000000000000000e+01 7.618916076913168e-01 1.577104660749360e+00 9.572556103898400e-06 2.264797798678941e-05 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00477688331602 -Steps = 1587 -Error test fails = 141 +Current time = 10.00203638578589 +Steps = 1593 +Error test fails = 152 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.005751532513273557 -Current step size = 0.01173715213294061 +Last step size = 0.006712297137966068 +Current step size = 0.006712297137966068 Last method order = 5 Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 2189 -NLS iters = 2186 -NLS fails = 1 -NLS iters per step = 1.377441713925646 -LS setups = 270 +RHS fn evals = 2225 +NLS iters = 2222 +NLS fails = 0 +NLS iters per step = 1.394852479598242 +LS setups = 283 Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01326623970722781 +Jac evals per NLS iter = 0.01305130513051305 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_es_2_--small_nst_5.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_es_2_--small_nst_5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_es_2_--small_nst_5.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_es_2_--small_nst_5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out index ec141c1925..d6cbb37abc 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127010231169071e+00 1.551807554033271e+00 4.029359408352917e-07 7.933652665048641e-06 - 2.000000000000000e+00 8.899061205561563e-01 1.154606179589197e+00 3.551885614183625e-06 2.316466660645666e-05 - 3.000000000000000e+00 7.106424210639757e-01 1.023549409701108e+00 6.261204531621267e-06 3.242421193494494e-05 - 4.000000000000000e+00 8.204814601813510e-01 1.374657421210761e+00 7.091557812533011e-06 2.555916152413573e-05 - 5.000000000000000e+00 1.068572372339015e+00 1.691864172592888e+00 7.403452418897061e-06 2.527001153240782e-05 - 6.000000000000000e+00 1.216592470265054e+00 1.677579961463762e+00 4.971017596444582e-06 2.788461888481031e-05 - 7.000000000000000e+00 1.173447050388805e+00 1.342528207391852e+00 1.144194168967161e-05 7.283532329349640e-05 - 8.000000000000000e+00 9.629518083856625e-01 1.012162097171965e+00 1.360523049986906e-05 5.010376176772802e-05 - 9.000000000000000e+00 7.378729059558163e-01 1.183922375566823e+00 1.460718994794608e-05 5.585820004605502e-05 - 1.000000000000000e+01 7.618958276795634e-01 1.577122317502578e+00 1.379254435052157e-05 4.030473120475442e-05 + 1.000000000000000e+00 1.127010231169071e+00 1.551807554033266e+00 4.029359408352917e-07 7.933652660385704e-06 + 2.000000000000000e+00 8.899061205559413e-01 1.154606179579956e+00 3.551885399244448e-06 2.316465736562634e-05 + 3.000000000000000e+00 7.106424212341577e-01 1.023549411912243e+00 6.261374713600887e-06 3.242642307044186e-05 + 4.000000000000000e+00 8.204814571358759e-01 1.374657408976591e+00 7.088512337438679e-06 2.554692735379227e-05 + 5.000000000000000e+00 1.068572364198821e+00 1.691864129787617e+00 7.395312224378614e-06 2.522720626196850e-05 + 6.000000000000000e+00 1.216592227118846e+00 1.677571467388444e+00 4.727871388388039e-06 1.939054356636660e-05 + 7.000000000000000e+00 1.173443618841214e+00 1.342493467296904e+00 8.010394098256768e-06 3.809522834541390e-05 + 8.000000000000000e+00 9.629424396388875e-01 1.012121124268885e+00 4.236483724828766e-06 9.130858687589338e-06 + 9.000000000000000e+00 7.378604981968989e-01 1.183872079873866e+00 2.199431030525112e-06 5.562507089162949e-06 + 1.000000000000000e+01 7.618819895397966e-01 1.577086853397597e+00 4.559541633142317e-08 4.840626223412414e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00714850788732 -Steps = 1502 -Error test fails = 92 +Current time = 10.00417454325856 +Steps = 1575 +Error test fails = 96 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.009862197222912128 -Current step size = 0.009862197222912128 +Last step size = 0.01182372679957014 +Current step size = 0.01182372679957014 Last method order = 5 Current method order = 5 Stab. lim. order reductions = 0 -RHS fn evals = 1897 -NLS iters = 1894 -NLS fails = 1 -NLS iters per step = 1.26098535286285 -LS setups = 166 -Jac fn evals = 27 +RHS fn evals = 2002 +NLS iters = 1999 +NLS fails = 0 +NLS iters per step = 1.269206349206349 +LS setups = 178 +Jac fn evals = 28 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01425554382259768 +Jac evals per NLS iter = 0.01400700350175088 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_gs_2.out b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_gs_2.out index c4664a2deb..cafa9f1252 100644 --- a/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_gs_2.out +++ b/test/unit_tests/cvodes/CXX_serial/cvs_test_kpr_--eta_min_gs_2.out @@ -2,32 +2,32 @@ ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 1.127017686767897e+00 1.551821503613988e+00 7.858534767146708e-06 2.188323338225828e-05 - 2.000000000000000e+00 8.899103332792471e-01 1.154608370771088e+00 7.764608704996512e-06 2.535584849794326e-05 - 3.000000000000000e+00 7.106411292975151e-01 1.023536808224800e+00 4.969438071045218e-06 1.982273562739501e-05 - 4.000000000000000e+00 8.204838923453025e-01 1.374669642759487e+00 9.523721763993187e-06 3.778071025029028e-05 - 5.000000000000000e+00 1.068571738765126e+00 1.691858739922128e+00 6.769878529766515e-06 1.983734077248833e-05 - 6.000000000000000e+00 1.216596138753578e+00 1.677586205148419e+00 8.639506119845208e-06 3.412830354121432e-05 - 7.000000000000000e+00 1.173445555523058e+00 1.342501389353217e+00 9.947075942040584e-06 4.601728465791766e-05 - 8.000000000000000e+00 9.629437694992675e-01 1.012111079263365e+00 5.566344104868115e-06 9.141468324536106e-07 - 9.000000000000000e+00 7.378567118749449e-01 1.183847487150188e+00 1.586890923443995e-06 1.903021658944404e-05 - 1.000000000000000e+01 7.618782369340520e-01 1.577065913116525e+00 3.798201160920556e-06 1.609965484838938e-05 + 2.000000000000000e+00 8.899103332791866e-01 1.154608370768354e+00 7.764608644489357e-06 2.535584576346395e-05 + 3.000000000000000e+00 7.106410660756778e-01 1.023529279576880e+00 4.906216233724336e-06 1.229408770742069e-05 + 4.000000000000000e+00 8.204730617922310e-01 1.374621086116680e+00 1.306831307501533e-06 1.077593255716103e-05 + 5.000000000000000e+00 1.068564764620663e+00 1.691839212204075e+00 2.042659332790464e-07 3.096227194632206e-07 + 6.000000000000000e+00 1.216586539798704e+00 1.677542924381987e+00 9.594487537789576e-07 9.152462890238411e-06 + 7.000000000000000e+00 1.173434026092493e+00 1.342453786414837e+00 1.582354622442494e-06 1.585653721880576e-06 + 8.000000000000000e+00 9.629416122015924e-01 1.012142316337908e+00 3.409046429703189e-06 3.032292771099065e-05 + 9.000000000000000e+00 7.378651980553826e-01 1.183892379308912e+00 6.899289514250562e-06 2.586194213471948e-05 + 1.000000000000000e+01 7.618838841024592e-01 1.577079185839070e+00 1.848967246309563e-06 2.826932303578999e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00040955930806 -Steps = 1559 -Error test fails = 143 +Current time = 10.00136810102964 +Steps = 1577 +Error test fails = 147 NLS step fails = 0 Initial step size = 0.0001029860256095084 -Last step size = 0.006823439174537314 -Current step size = 0.006823439174537314 +Last step size = 0.006383607841908422 +Current step size = 0.006383607841908422 Last method order = 4 Current method order = 4 Stab. lim. order reductions = 0 -RHS fn evals = 2155 -NLS iters = 2152 +RHS fn evals = 2197 +NLS iters = 2194 NLS fails = 0 -NLS iters per step = 1.380372033354714 -LS setups = 266 -Jac fn evals = 28 +NLS iters per step = 1.391249207355739 +LS setups = 272 +Jac fn evals = 29 LS RHS fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.01301115241635688 +Jac evals per NLS iter = 0.01321786690975387 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--dcj_0.9.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--dcj_0.9.out index a5157bd5b6..23fee605c1 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--dcj_0.9.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--dcj_0.9.out @@ -1,31 +1,31 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008796560332e+00 1.551802384449904e+00 1.031672798301742e-06 2.764069298111238e-06 - 2.000000000000000e+00 8.899024587137806e-01 1.154584099853341e+00 1.099567614737396e-07 1.084930751238389e-06 - 3.000000000000000e+00 7.106360858945575e-01 1.023513423631075e+00 7.396488654887179e-08 3.561858098244386e-06 - 4.000000000000000e+00 8.204739309480567e-01 1.374628697376117e+00 4.376754818569140e-07 3.164673120226169e-06 - 5.000000000000000e+00 1.068565080910622e+00 1.691836445942001e+00 1.120240256113902e-07 2.456639354164736e-06 - 6.000000000000000e+00 1.216588606994998e+00 1.677547963528577e+00 1.107747540585180e-06 4.113316300902170e-06 - 7.000000000000000e+00 1.173435937501828e+00 1.342464725916630e+00 3.290547128109722e-07 9.353848071658177e-06 - 8.000000000000000e+00 9.629398000974635e-01 1.012112901634551e+00 1.596942300841064e-06 9.082243537239520e-07 - 9.000000000000000e+00 7.378589522466482e-01 1.183873325967590e+00 6.534807798219688e-07 6.808600812702181e-06 - 1.000000000000000e+01 7.618820715520634e-01 1.577083311348172e+00 3.641685053512589e-08 1.298576798980378e-06 + 1.000000000000000e+00 1.127008796560090e+00 1.551802384450390e+00 1.031673040552405e-06 2.764069783944834e-06 + 2.000000000000000e+00 8.899024587061005e-01 1.154584099829441e+00 1.099644415525347e-07 1.084906850579159e-06 + 3.000000000000000e+00 7.106341381245095e-01 1.023516125817520e+00 2.021734934576358e-06 8.596716523090464e-07 + 4.000000000000000e+00 8.204761103543468e-01 1.374623695480249e+00 1.741730808246800e-06 8.166568988166034e-06 + 5.000000000000000e+00 1.068566455849070e+00 1.691836406184612e+00 1.486962473151721e-06 2.496396743323359e-06 + 6.000000000000000e+00 1.216587396276122e+00 1.677549862786460e+00 1.029713361244688e-07 2.214058417271403e-06 + 7.000000000000000e+00 1.173432831494270e+00 1.342453586052060e+00 2.776952845673364e-06 1.786016498472875e-06 + 8.000000000000000e+00 9.629368111847777e-01 1.012117431854594e+00 1.391970384956309e-06 5.438444397487530e-06 + 9.000000000000000e+00 7.378576386596475e-01 1.183859435812292e+00 6.601062209066200e-07 7.081554485699471e-06 + 1.000000000000000e+01 7.618809862203583e-01 1.577081905588531e+00 1.048914854639982e-06 1.071828417131826e-07 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00260922004195 -Steps = 2294 -Error test fails = 35 +Current time = 10.00297949228985 +Steps = 2246 +Error test fails = 38 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.004118302466636572 -Current step size = 0.004118302466636572 +Last step size = 0.004072547150731173 +Current step size = 0.004072547150731173 Last method order = 5 Current method order = 5 -Residual fn evals = 4368 +Residual fn evals = 4297 IC linesearch backtrack ops = 0 -NLS iters = 4368 +NLS iters = 4297 NLS fails = 1 -NLS iters per step = 1.90409764603313 +NLS iters per step = 1.913178984861977 LS setups = 5 Jac fn evals = 5 LS residual fn evals = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.001144688644688645 +Jac evals per NLS iter = 0.001163602513381429 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_cf_0.5.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_cf_0.5.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_cf_0.5.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_cf_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_max_fs_2.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_max_fs_2.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_max_fs_2.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_max_fs_2.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_2.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_2.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_2.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_2.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_ef_0.5.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_ef_0.5.out index 94f08efdce..bd783e9155 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_ef_0.5.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_ef_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127010934815940e+00 1.551804577771051e+00 1.106582809606849e-06 4.957390445259335e-06 - 2.000000000000000e+00 8.899037379529532e-01 1.154587457548306e+00 1.169282411117578e-06 4.442625715528337e-06 - 3.000000000000000e+00 7.106373258289668e-01 1.023525952783798e+00 1.165969522709531e-06 8.967294625517042e-06 - 4.000000000000000e+00 8.204767070144955e-01 1.374642569697146e+00 2.338390956979630e-06 1.070764790855883e-05 - 5.000000000000000e+00 1.068568876973751e+00 1.691849793088502e+00 3.908087154114170e-06 1.089050714697670e-05 - 6.000000000000000e+00 1.216589706020479e+00 1.677562428308899e+00 2.206773020985153e-06 1.035146402172948e-05 - 7.000000000000000e+00 1.173438010775863e+00 1.342468911009537e+00 2.402328747042048e-06 1.353894097877451e-05 - 8.000000000000000e+00 9.629425468345103e-01 1.012129827732488e+00 4.343679347651452e-06 1.783432229074400e-05 - 9.000000000000000e+00 7.378627353947157e-01 1.183886759184423e+00 4.436628847304114e-06 2.024181764559430e-05 - 1.000000000000000e+01 7.618854790077282e-01 1.577091323024696e+00 3.443872515274116e-06 9.310253322958317e-06 + 1.000000000000000e+00 1.127010934815940e+00 1.551804577771052e+00 1.106582809828893e-06 4.957390446369558e-06 + 2.000000000000000e+00 8.899037379529640e-01 1.154587457548333e+00 1.169282421886741e-06 4.442625742839823e-06 + 3.000000000000000e+00 7.106373258289136e-01 1.023525952781695e+00 1.165969469529848e-06 8.967292522532588e-06 + 4.000000000000000e+00 8.204767070163577e-01 1.374642569717103e+00 2.338392819156709e-06 1.070766786548383e-05 + 5.000000000000000e+00 1.068568876973022e+00 1.691849793032933e+00 3.908086425807866e-06 1.089045157764978e-05 + 6.000000000000000e+00 1.216589705164396e+00 1.677562428336776e+00 2.205916938669006e-06 1.035149189809736e-05 + 7.000000000000000e+00 1.173438426040947e+00 1.342476942416445e+00 2.817593831361265e-06 2.157034788607959e-05 + 8.000000000000000e+00 9.629412087571725e-01 1.012125432139581e+00 3.005602009831243e-06 1.343872938441848e-05 + 9.000000000000000e+00 7.378620211826220e-01 1.183879667396247e+00 3.722416753615398e-06 1.315002946999932e-05 + 1.000000000000000e+01 7.618816820118458e-01 1.577075168231631e+00 3.531233671028033e-07 6.844539742090205e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00034658755718 -Steps = 1858 -Error test fails = 78 +Current time = 10.00007889792687 +Steps = 1893 +Error test fails = 74 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.007155339774580808 -Current step size = 0.007155339774580808 +Last step size = 0.004133870052408764 +Current step size = 0.004133870052408764 Last method order = 5 Current method order = 5 -Residual fn evals = 2480 +Residual fn evals = 2517 IC linesearch backtrack ops = 0 -NLS iters = 2480 +NLS iters = 2517 NLS fails = 0 -NLS iters per step = 1.334768568353068 -LS setups = 76 -Jac fn evals = 76 +NLS iters per step = 1.329635499207607 +LS setups = 75 +Jac fn evals = 75 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03064516129032258 +Jac evals per NLS iter = 0.0297973778307509 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--dcj_0.9.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--dcj_0.9.out index a5157bd5b6..23fee605c1 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--dcj_0.9.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--dcj_0.9.out @@ -1,31 +1,31 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008796560332e+00 1.551802384449904e+00 1.031672798301742e-06 2.764069298111238e-06 - 2.000000000000000e+00 8.899024587137806e-01 1.154584099853341e+00 1.099567614737396e-07 1.084930751238389e-06 - 3.000000000000000e+00 7.106360858945575e-01 1.023513423631075e+00 7.396488654887179e-08 3.561858098244386e-06 - 4.000000000000000e+00 8.204739309480567e-01 1.374628697376117e+00 4.376754818569140e-07 3.164673120226169e-06 - 5.000000000000000e+00 1.068565080910622e+00 1.691836445942001e+00 1.120240256113902e-07 2.456639354164736e-06 - 6.000000000000000e+00 1.216588606994998e+00 1.677547963528577e+00 1.107747540585180e-06 4.113316300902170e-06 - 7.000000000000000e+00 1.173435937501828e+00 1.342464725916630e+00 3.290547128109722e-07 9.353848071658177e-06 - 8.000000000000000e+00 9.629398000974635e-01 1.012112901634551e+00 1.596942300841064e-06 9.082243537239520e-07 - 9.000000000000000e+00 7.378589522466482e-01 1.183873325967590e+00 6.534807798219688e-07 6.808600812702181e-06 - 1.000000000000000e+01 7.618820715520634e-01 1.577083311348172e+00 3.641685053512589e-08 1.298576798980378e-06 + 1.000000000000000e+00 1.127008796560090e+00 1.551802384450390e+00 1.031673040552405e-06 2.764069783944834e-06 + 2.000000000000000e+00 8.899024587061005e-01 1.154584099829441e+00 1.099644415525347e-07 1.084906850579159e-06 + 3.000000000000000e+00 7.106341381245095e-01 1.023516125817520e+00 2.021734934576358e-06 8.596716523090464e-07 + 4.000000000000000e+00 8.204761103543468e-01 1.374623695480249e+00 1.741730808246800e-06 8.166568988166034e-06 + 5.000000000000000e+00 1.068566455849070e+00 1.691836406184612e+00 1.486962473151721e-06 2.496396743323359e-06 + 6.000000000000000e+00 1.216587396276122e+00 1.677549862786460e+00 1.029713361244688e-07 2.214058417271403e-06 + 7.000000000000000e+00 1.173432831494270e+00 1.342453586052060e+00 2.776952845673364e-06 1.786016498472875e-06 + 8.000000000000000e+00 9.629368111847777e-01 1.012117431854594e+00 1.391970384956309e-06 5.438444397487530e-06 + 9.000000000000000e+00 7.378576386596475e-01 1.183859435812292e+00 6.601062209066200e-07 7.081554485699471e-06 + 1.000000000000000e+01 7.618809862203583e-01 1.577081905588531e+00 1.048914854639982e-06 1.071828417131826e-07 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00260922004195 -Steps = 2294 -Error test fails = 35 +Current time = 10.00297949228985 +Steps = 2246 +Error test fails = 38 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.004118302466636572 -Current step size = 0.004118302466636572 +Last step size = 0.004072547150731173 +Current step size = 0.004072547150731173 Last method order = 5 Current method order = 5 -Residual fn evals = 4368 +Residual fn evals = 4297 IC linesearch backtrack ops = 0 -NLS iters = 4368 +NLS iters = 4297 NLS fails = 1 -NLS iters per step = 1.90409764603313 +NLS iters per step = 1.913178984861977 LS setups = 5 Jac fn evals = 5 LS residual fn evals = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.001144688644688645 +Jac evals per NLS iter = 0.001163602513381429 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_cf_0.5.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_cf_0.5.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_cf_0.5.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_cf_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_2.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_2.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_2.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_2.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_ef_0.5.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_ef_0.5.out index 94f08efdce..bd783e9155 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_ef_0.5.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_ef_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127010934815940e+00 1.551804577771051e+00 1.106582809606849e-06 4.957390445259335e-06 - 2.000000000000000e+00 8.899037379529532e-01 1.154587457548306e+00 1.169282411117578e-06 4.442625715528337e-06 - 3.000000000000000e+00 7.106373258289668e-01 1.023525952783798e+00 1.165969522709531e-06 8.967294625517042e-06 - 4.000000000000000e+00 8.204767070144955e-01 1.374642569697146e+00 2.338390956979630e-06 1.070764790855883e-05 - 5.000000000000000e+00 1.068568876973751e+00 1.691849793088502e+00 3.908087154114170e-06 1.089050714697670e-05 - 6.000000000000000e+00 1.216589706020479e+00 1.677562428308899e+00 2.206773020985153e-06 1.035146402172948e-05 - 7.000000000000000e+00 1.173438010775863e+00 1.342468911009537e+00 2.402328747042048e-06 1.353894097877451e-05 - 8.000000000000000e+00 9.629425468345103e-01 1.012129827732488e+00 4.343679347651452e-06 1.783432229074400e-05 - 9.000000000000000e+00 7.378627353947157e-01 1.183886759184423e+00 4.436628847304114e-06 2.024181764559430e-05 - 1.000000000000000e+01 7.618854790077282e-01 1.577091323024696e+00 3.443872515274116e-06 9.310253322958317e-06 + 1.000000000000000e+00 1.127010934815940e+00 1.551804577771052e+00 1.106582809828893e-06 4.957390446369558e-06 + 2.000000000000000e+00 8.899037379529640e-01 1.154587457548333e+00 1.169282421886741e-06 4.442625742839823e-06 + 3.000000000000000e+00 7.106373258289136e-01 1.023525952781695e+00 1.165969469529848e-06 8.967292522532588e-06 + 4.000000000000000e+00 8.204767070163577e-01 1.374642569717103e+00 2.338392819156709e-06 1.070766786548383e-05 + 5.000000000000000e+00 1.068568876973022e+00 1.691849793032933e+00 3.908086425807866e-06 1.089045157764978e-05 + 6.000000000000000e+00 1.216589705164396e+00 1.677562428336776e+00 2.205916938669006e-06 1.035149189809736e-05 + 7.000000000000000e+00 1.173438426040947e+00 1.342476942416445e+00 2.817593831361265e-06 2.157034788607959e-05 + 8.000000000000000e+00 9.629412087571725e-01 1.012125432139581e+00 3.005602009831243e-06 1.343872938441848e-05 + 9.000000000000000e+00 7.378620211826220e-01 1.183879667396247e+00 3.722416753615398e-06 1.315002946999932e-05 + 1.000000000000000e+01 7.618816820118458e-01 1.577075168231631e+00 3.531233671028033e-07 6.844539742090205e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00034658755718 -Steps = 1858 -Error test fails = 78 +Current time = 10.00007889792687 +Steps = 1893 +Error test fails = 74 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.007155339774580808 -Current step size = 0.007155339774580808 +Last step size = 0.004133870052408764 +Current step size = 0.004133870052408764 Last method order = 5 Current method order = 5 -Residual fn evals = 2480 +Residual fn evals = 2517 IC linesearch backtrack ops = 0 -NLS iters = 2480 +NLS iters = 2517 NLS fails = 0 -NLS iters per step = 1.334768568353068 -LS setups = 76 -Jac fn evals = 76 +NLS iters per step = 1.329635499207607 +LS setups = 75 +Jac fn evals = 75 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03064516129032258 +Jac evals per NLS iter = 0.0297973778307509 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_max_fx_2.0.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out index af4992fa58..c6a5d6971f 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr_--eta_min_fx_1.0_--eta_min_0.5.out @@ -1,33 +1,33 @@ t u v u err v err ------------------------------------------------------------------------------------------------------------------------------ 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 - 1.000000000000000e+00 1.127008886931081e+00 1.551800624068247e+00 9.413020496396030e-07 1.003687641665252e-06 - 2.000000000000000e+00 8.899033257012232e-01 1.154581589731097e+00 7.570306811421901e-07 1.425191492820943e-06 - 3.000000000000000e+00 7.106359156304887e-01 1.023509838887233e+00 2.442289553927779e-07 7.146601939345132e-06 - 4.000000000000000e+00 8.204744562446226e-01 1.374632991052660e+00 8.762108405502289e-08 1.129003422972730e-06 - 5.000000000000000e+00 1.068567367706359e+00 1.691845610743153e+00 2.398819762383653e-06 6.708161797819301e-06 - 6.000000000000000e+00 1.216589366856727e+00 1.677560644996338e+00 1.867609269012860e-06 8.568151460774942e-06 - 7.000000000000000e+00 1.173439187063617e+00 1.342474213911926e+00 3.578616501576093e-06 1.884184336709005e-05 - 8.000000000000000e+00 9.629417174589088e-01 1.012119988627952e+00 3.514303746121605e-06 7.995217754963591e-06 - 9.000000000000000e+00 7.378606025350759e-01 1.183877114777252e+00 2.303769207512296e-06 1.059741047493290e-05 - 1.000000000000000e+01 7.618838737365803e-01 1.577084968262613e+00 1.838601367376569e-06 2.955491239520214e-06 + 1.000000000000000e+00 1.127008886931081e+00 1.551800624068248e+00 9.413020487514245e-07 1.003687642553430e-06 + 2.000000000000000e+00 8.899033257012224e-01 1.154581589731098e+00 7.570306803650340e-07 1.425191492376854e-06 + 3.000000000000000e+00 7.106359156305051e-01 1.023509838887361e+00 2.442289389614771e-07 7.146601811891529e-06 + 4.000000000000000e+00 8.204744562446277e-01 1.374632991052715e+00 8.762108916204880e-08 1.129003477817747e-06 + 5.000000000000000e+00 1.068567367706273e+00 1.691845610742846e+00 2.398819676674435e-06 6.708161490731612e-06 + 6.000000000000000e+00 1.216589366856521e+00 1.677560644963124e+00 1.867609063621600e-06 8.568118246898848e-06 + 7.000000000000000e+00 1.173439187151612e+00 1.342474213415192e+00 3.578704496520757e-06 1.884134663332482e-05 + 8.000000000000000e+00 9.629416032539853e-01 1.012115556387471e+00 3.400098822603503e-06 3.562977273663392e-06 + 9.000000000000000e+00 7.378627045323199e-01 1.183882592399333e+00 4.405766451553994e-06 1.607503255574017e-05 + 1.000000000000000e+01 7.618850249117836e-01 1.577090524690380e+00 2.989776570649916e-06 8.511919006970459e-06 ------------------------------------------------------------------------------------------------------------------------------ -Current time = 10.00592015471712 -Steps = 1841 +Current time = 10.00070463206685 +Steps = 1851 Error test fails = 79 NLS step fails = 0 Initial step size = 0.001 -Last step size = 0.006029980790852448 -Current step size = 0.006029980790852448 -Last method order = 4 -Current method order = 4 -Residual fn evals = 2397 +Last step size = 0.008223200209206106 +Current step size = 0.008223200209206106 +Last method order = 5 +Current method order = 5 +Residual fn evals = 2458 IC linesearch backtrack ops = 0 -NLS iters = 2397 +NLS iters = 2458 NLS fails = 0 -NLS iters per step = 1.302009777294948 -LS setups = 85 -Jac fn evals = 85 +NLS iters per step = 1.327930848190167 +LS setups = 84 +Jac fn evals = 84 LS residual fn evals = 0 Prec setup evals = 0 Prec solves = 0 @@ -36,6 +36,6 @@ LS fails = 0 Jac-times setups = 0 Jac-times evals = 0 LS iters per NLS iter = 0 -Jac evals per NLS iter = 0.03546099290780142 +Jac evals per NLS iter = 0.03417412530512612 Prec evals per NLS iter = 0 Root fn evals = 0 From 9f0f33712ddfdeb9b96adb5337af0b137a9d4622 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Tue, 10 Sep 2024 20:08:23 -0700 Subject: [PATCH 096/137] Maintenance: Warning when invalid order is chosen (#563) Issue a warning message rather than an error when an invalid order is selected in ARKODE. --- src/arkode/arkode_arkstep.c | 6 +++--- src/arkode/arkode_erkstep.c | 2 +- src/arkode/arkode_mristep.c | 2 +- src/arkode/arkode_sprkstep.c | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 4f6e403ccf..3a4b00622a 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2223,7 +2223,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) itable = ARKSTEP_DEFAULT_ARK_ITABLE_5; break; default: /* no available method, set default */ - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, "No ImEx method at requested order, using q=5."); etable = ARKSTEP_DEFAULT_ARK_ETABLE_5; itable = ARKSTEP_DEFAULT_ARK_ITABLE_5; @@ -2242,7 +2242,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) case (4): itable = ARKSTEP_DEFAULT_DIRK_4; break; case (5): itable = ARKSTEP_DEFAULT_DIRK_5; break; default: /* no available method, set default */ - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, "No implicit method at requested order, using q=5."); itable = ARKSTEP_DEFAULT_DIRK_5; break; @@ -2264,7 +2264,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) case (8): etable = ARKSTEP_DEFAULT_ERK_8; break; case (9): etable = ARKSTEP_DEFAULT_ERK_9; break; default: /* no available method, set default */ - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, "No explicit method at requested order, using q=9."); etable = ARKSTEP_DEFAULT_ERK_9; break; diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 5cc09d2390..766ca9e217 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -839,7 +839,7 @@ int erkStep_SetButcherTable(ARKodeMem ark_mem) case (8): etable = ERKSTEP_DEFAULT_8; break; case (9): etable = ERKSTEP_DEFAULT_9; break; default: /* no available method, set default */ - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, "No explicit method at requested order, using q=9."); etable = ERKSTEP_DEFAULT_9; break; diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 0989e43a7c..8e5875c12f 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1745,7 +1745,7 @@ int mriStep_SetCoupling(ARKodeMem ark_mem) if (q_actual < 1 || q_actual > 4) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, "No MRI method at requested order, using q=3."); q_actual = 3; } diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index a88a78235d..f7f67248c4 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -407,6 +407,8 @@ int sprkStep_Init(ARKodeMem ark_mem, int init_type) step_mem->method = ARKodeSPRKTable_Load(SPRKSTEP_DEFAULT_10); break; default: + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, + "No SPRK method at requested order, using q=4."); step_mem->method = ARKodeSPRKTable_Load(SPRKSTEP_DEFAULT_4); break; } From 8d3eff4200fba74f3b9260402117b0833f802c3a Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Wed, 11 Sep 2024 16:27:27 -0500 Subject: [PATCH 097/137] Bugfix: ARKODE Stepper SetDefaults memory leak fix (#560) Updated stepper `SetDefaults` routines to deallocate pre-existing structures before nullifying, and moved initial creation of the `SUNAdaptController` into stepper `SetDefaults` routines instead of `arkCreate`. This allows non-adaptive steppers to leave the SUNAdaptController object unallocated. --------- Co-authored-by: Steven Roberts <roberts115@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 3 ++ doc/shared/RecentChanges.rst | 3 ++ src/arkode/arkode.c | 46 +++++++----------- src/arkode/arkode_adapt.c | 12 ++++- src/arkode/arkode_arkstep_io.c | 62 +++++++++++++++++++++-- src/arkode/arkode_erkstep_io.c | 43 ++++++++++------ src/arkode/arkode_io.c | 89 +++++++++++++++++++++------------- src/arkode/arkode_mristep_io.c | 31 ++++++++---- 8 files changed, 198 insertions(+), 91 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 247f6f26ea..b73b8b7131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated `CUDA_ARCH` option was used. +Fixed a memory leak that could occur if ``ARKodeSetDefaults`` is called +repeatedly. + Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ed8b0b13a6..5d4e6e9554 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -22,6 +22,9 @@ Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated ``CUDA_ARCH`` option was used. +Fixed a memory leak that could occur if :c:func:`ARKodeSetDefaults` is called +repeatedly. + Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index be15bd2b2f..082a2c1755 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1364,7 +1364,6 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) ARKodeMem arkCreate(SUNContext sunctx) { int iret; - long int lenrw, leniw; ARKodeMem ark_mem; if (!sunctx) @@ -1485,21 +1484,6 @@ 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, __LINE__, __func__, __FILE__, - "Allocation of step controller object failed"); - ARKodeFree((void**)&ark_mem); - 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 = ARK_INTERP_HERMITE; @@ -1523,7 +1507,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->h = ZERO; ark_mem->h0u = ZERO; - /* Set default values for integrator optional inputs */ + /* Set default values for integrator and stepper optional inputs */ iret = ARKodeSetDefaults(ark_mem); if (iret != ARK_SUCCESS) { @@ -1706,12 +1690,15 @@ int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) ark_mem->tolsf = ONE; /* Reset error controller object */ - retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); - if (retval != SUN_SUCCESS) + if (ark_mem->hadapt_mem->hcontroller) { - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, - "Unable to reset error controller object"); - return (ARK_CONTROLLER_ERR); + retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "Unable to reset error controller object"); + return (ARK_CONTROLLER_ERR); + } } /* Adaptivity counters */ @@ -2543,13 +2530,16 @@ int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm) ark_mem->fn_is_current = SUNFALSE; /* Notify time step controller object of successful step */ - retval = SUNAdaptController_UpdateH(ark_mem->hadapt_mem->hcontroller, - ark_mem->h, dsm); - if (retval != SUN_SUCCESS) + if (ark_mem->hadapt_mem->hcontroller) { - arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, - "Failure updating controller object"); - return (ARK_CONTROLLER_ERR); + retval = SUNAdaptController_UpdateH(ark_mem->hadapt_mem->hcontroller, + ark_mem->h, dsm); + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, __FILE__, + "Failure updating controller object"); + return (ARK_CONTROLLER_ERR); + } } /* update scalar quantities */ diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index 7fef0ec2ae..ada5cda343 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -82,7 +82,10 @@ 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); + if (hadapt_mem->hcontroller != NULL) + { + (void)SUNAdaptController_Write(hadapt_mem->hcontroller, outfile); + } } } @@ -98,6 +101,13 @@ int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, sunrealtype h_acc, h_cfl, int_dir; int controller_order; + /* Return with no stepsize adjustment if the controller is NULL */ + if (hadapt_mem->hcontroller == NULL) + { + ark_mem->eta = ONE; + return (ARK_SUCCESS); + } + /* Request error-based step size from adaptivity controller */ if (hadapt_mem->pq == 0) { diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 7df74cb590..ae90b65387 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -653,6 +653,8 @@ int arkStep_SetUserData(ARKodeMem ark_mem, void* user_data) int arkStep_SetDefaults(ARKodeMem ark_mem) { ARKodeARKStepMem step_mem; + sunindextype Blrw, Bliw; + long int lenrw, leniw; int retval; /* access ARKodeARKStepMem structure */ @@ -677,12 +679,66 @@ int arkStep_SetDefaults(ARKodeMem ark_mem) step_mem->msbp = MSBP; /* max steps between updates to J or P */ step_mem->stages = 0; /* no stages */ step_mem->istage = 0; /* current stage */ - step_mem->Be = NULL; /* no Butcher tables */ - step_mem->Bi = NULL; - step_mem->NLS = NULL; /* no nonlinear solver object */ step_mem->jcur = SUNFALSE; step_mem->convfail = ARK_NO_FAILURES; step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + + /* Remove pre-existing Butcher tables */ + if (step_mem->Be) + { + ARKodeButcherTable_Space(step_mem->Be, &Bliw, &Blrw); + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + ARKodeButcherTable_Free(step_mem->Be); + } + step_mem->Be = NULL; + if (step_mem->Bi) + { + ARKodeButcherTable_Space(step_mem->Bi, &Bliw, &Blrw); + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + ARKodeButcherTable_Free(step_mem->Bi); + } + step_mem->Bi = NULL; + + /* Remove pre-existing nonlinear solver object */ + if (step_mem->NLS && step_mem->ownNLS) { SUNNonlinSolFree(step_mem->NLS); } + step_mem->NLS = NULL; + + /* Remove pre-existing SUNAdaptController object, and replace with "PID" */ + if (ark_mem->hadapt_mem->owncontroller) + { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_Destroy failure"); + return (ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptControllerPID allocation failure"); + return (ARK_MEM_FAIL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_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 ffbf9a18fb..77987b4245 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -259,23 +259,42 @@ int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac) int erkStep_SetDefaults(ARKodeMem ark_mem) { ARKodeERKStepMem step_mem; - int retval; + sunindextype Blrw, Bliw; long int lenrw, leniw; + int retval; /* access ARKodeERKStepMem structure */ retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } - /* Remove current SUNAdaptController object, and replace with "PI" */ - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_SUCCESS) + /* Set default values for integrator optional inputs */ + step_mem->q = Q_DEFAULT; /* method order */ + step_mem->p = 0; /* embedding order */ + step_mem->stages = 0; /* no stages */ + ark_mem->hadapt_mem->etamxf = SUN_RCONST(0.3); /* max change on error-failed step */ + ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ + ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ + + /* Remove pre-existing Butcher table */ + if (step_mem->B) { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; + ARKodeButcherTable_Space(step_mem->B, &Bliw, &Blrw); + ark_mem->liw -= Bliw; + ark_mem->lrw -= Blrw; + ARKodeButcherTable_Free(step_mem->B); } + step_mem->B = NULL; + + /* Remove current SUNAdaptController object, and replace with "PI" */ if (ark_mem->hadapt_mem->owncontroller) { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); ark_mem->hadapt_mem->owncontroller = SUNFALSE; if (retval != SUN_SUCCESS) @@ -302,15 +321,7 @@ int erkStep_SetDefaults(ARKodeMem ark_mem) 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 = SUN_RCONST(0.3); /* max change on error-failed step */ - ark_mem->hadapt_mem->safety = SUN_RCONST(0.99); /* step adaptivity safety factor */ - ark_mem->hadapt_mem->growth = SUN_RCONST(25.0); /* step adaptivity growth factor */ + /* Update some controller parameters */ (void)SUNAdaptController_SetErrorBias(ark_mem->hadapt_mem->hcontroller, SUN_RCONST(1.2)); (void)SUNAdaptController_SetParams_PI(ark_mem->hadapt_mem->hcontroller, diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 357912409d..dd1325f794 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -55,13 +55,6 @@ int ARKodeSetDefaults(void* arkode_mem) } ark_mem = (ARKodeMem)arkode_mem; - /* Set stepper defaults (if provided) */ - if (ark_mem->step_setdefaults) - { - retval = ark_mem->step_setdefaults(arkode_mem); - if (retval != ARK_SUCCESS) { return retval; } - } - /* Set default values for integrator optional inputs */ ark_mem->use_compensated_sums = SUNFALSE; ark_mem->fixedstep = SUNFALSE; /* default to use adaptive steps */ @@ -106,6 +99,14 @@ int ARKodeSetDefaults(void* arkode_mem) 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 */ + + /* Set stepper defaults (if provided) */ + if (ark_mem->step_setdefaults) + { + retval = ark_mem->step_setdefaults(arkode_mem); + if (retval != ARK_SUCCESS) { return retval; } + } + return (ARK_SUCCESS); } @@ -910,15 +911,17 @@ int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) /* Remove current SUNAdaptController object (delete if owned, and then nullify pointer) */ - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; - } - if (ark_mem->hadapt_mem->owncontroller) + if (ark_mem->hadapt_mem->owncontroller && + (ark_mem->hadapt_mem->hcontroller != NULL)) { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); ark_mem->hadapt_mem->owncontroller = SUNFALSE; if (retval != SUN_SUCCESS) @@ -1043,8 +1046,11 @@ int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) ark_mem->h0u = ZERO; /* Reset error controller (e.g., error and step size history) */ - retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); - if (retval != SUN_SUCCESS) { return (ARK_CONTROLLER_ERR); } + if (ark_mem->hadapt_mem->hcontroller != NULL) + { + retval = SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (retval != SUN_SUCCESS) { return (ARK_CONTROLLER_ERR); } + } return (ARK_SUCCESS); } @@ -1641,6 +1647,14 @@ int ARKodeSetErrorBias(void* arkode_mem, sunrealtype bias) return (ARK_STEPPER_UNSUPPORTED); } + /* Return an error if there is not a current SUNAdaptController */ + if (ark_mem->hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, + __FILE__, "SUNAdaptController NULL -- must be set before setting the error bias"); + return (ARK_MEM_NULL); + } + /* set allowed value, otherwise set default */ if (bias < ONE) { @@ -2947,7 +2961,10 @@ int ARKodeWriteParameters(void* arkode_mem, FILE* fp) 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); + if (ark_mem->hadapt_mem->hcontroller != NULL) + { + (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", @@ -3050,15 +3067,17 @@ int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, /* Remove current SUNAdaptController object (delete if owned, and then nullify pointer) */ - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; - } - if (ark_mem->hadapt_mem->owncontroller) + if (ark_mem->hadapt_mem->owncontroller && + (ark_mem->hadapt_mem->hcontroller != NULL)) { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); ark_mem->hadapt_mem->owncontroller = SUNFALSE; if (retval != SUN_SUCCESS) @@ -3251,15 +3270,17 @@ int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data) /* Remove current SUNAdaptController object (delete if owned, and then nullify pointer) */ - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; - } - if (ark_mem->hadapt_mem->owncontroller) + if (ark_mem->hadapt_mem->owncontroller && + (ark_mem->hadapt_mem->hcontroller != NULL)) { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); ark_mem->hadapt_mem->owncontroller = SUNFALSE; if (retval != SUN_SUCCESS) diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index d803141044..1ad11ab59e 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -231,6 +231,7 @@ int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) int mriStep_SetDefaults(ARKodeMem ark_mem) { ARKodeMRIStepMem step_mem; + sunindextype lenrw, leniw; int retval; /* access ARKodeMRIStepMem structure */ @@ -248,15 +249,27 @@ int mriStep_SetDefaults(ARKodeMem ark_mem) step_mem->nlscoef = NLSCOEF; /* nonlinear tolerance coefficient */ step_mem->crdown = CRDOWN; /* nonlinear convergence estimate coeff. */ step_mem->rdiv = RDIV; /* nonlinear divergence tolerance */ - step_mem->dgmax = DGMAX; /* max gamma change before recomputing J or P */ - step_mem->msbp = MSBP; /* max steps between updates to J or P */ - step_mem->stages = 0; /* no stages */ - step_mem->istage = 0; /* current stage index */ - step_mem->MRIC = NULL; /* no slow->fast coupling */ - step_mem->NLS = NULL; /* no nonlinear solver object */ - step_mem->jcur = SUNFALSE; - step_mem->convfail = ARK_NO_FAILURES; - step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + step_mem->dgmax = DGMAX; /* max gamma change to recompute J or P */ + step_mem->msbp = MSBP; /* max steps between updating J or P */ + step_mem->stages = 0; /* no stages */ + step_mem->istage = 0; /* current stage index */ + step_mem->jcur = SUNFALSE; + step_mem->convfail = ARK_NO_FAILURES; + step_mem->stage_predict = NULL; /* no user-supplied stage predictor */ + + /* Remove pre-existing nonlinear solver object */ + if (step_mem->NLS && step_mem->ownNLS) { SUNNonlinSolFree(step_mem->NLS); } + step_mem->NLS = NULL; + + /* Remove pre-existing coupling table */ + if (step_mem->MRIC) + { + MRIStepCoupling_Space(step_mem->MRIC, &leniw, &lenrw); + ark_mem->lrw -= lenrw; + ark_mem->liw -= leniw; + MRIStepCoupling_Free(step_mem->MRIC); + } + step_mem->MRIC = NULL; return (ARK_SUCCESS); } From 75c01aa28092eaf8a6425e10d0271102c2376579 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:16:02 -0700 Subject: [PATCH 098/137] Build(deps): Bump docker/build-push-action from 6.0.2 to 6.7.0 (#556) --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index 53a629aa3a..ad6cb16a2f 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -26,7 +26,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.3.0 + uses: docker/build-push-action@v6.7.0 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -56,7 +56,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.3.0 + uses: docker/build-push-action@v6.7.0 with: context: "./docker/sundials-ci/e4s-quarterly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index a40af5b1b4..5045a62a3b 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -32,7 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.3.0 + uses: docker/build-push-action@v6.7.0 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml From 5c48888a18d7b77d6dabe8d5ba139c1da1d03ebf Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 11 Sep 2024 17:37:40 -0700 Subject: [PATCH 099/137] CI Bugfix: Correctly detect single false test arg (#558) Fix the checks in `sundials_add_test` to work correctly when a single command line input for a test is provided and the input corresponds to a false value in CMake. --------- Co-authored-by: Cody Balos <balos1@llnl.gov> --- cmake/macros/SundialsAddTest.cmake | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/cmake/macros/SundialsAddTest.cmake b/cmake/macros/SundialsAddTest.cmake index a1eb373b67..a1b491dc49 100644 --- a/cmake/macros/SundialsAddTest.cmake +++ b/cmake/macros/SundialsAddTest.cmake @@ -89,6 +89,21 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) cmake_parse_arguments(SUNDIALS_ADD_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + # check if any options for setting command line args have been provided by + # comparing them against an empty string -- this is needed to avoid missing + # single args that are a false constant in CMake e.g., 0, FALSE, OFF, etc. + if("${SUNDIALS_ADD_TEST_TEST_ARGS}" STREQUAL "") + set(_have_test_args FALSE) + else() + set(_have_test_args TRUE) + endif() + + if("${SUNDIALS_ADD_TEST_EXTRA_ARGS}" STREQUAL "") + set(_have_extra_test_args FALSE) + else() + set(_have_extra_test_args TRUE) + endif() + # check that the test is not excluded string(TOLOWER "exclude-${SUNDIALS_PRECISION}" _exclude_precision) if(("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL "exclude") @@ -186,17 +201,17 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) endif() # set the test input args - if(SUNDIALS_ADD_TEST_TEST_ARGS) + if(_have_test_args) string(REPLACE ";" " " _user_args "${SUNDIALS_ADD_TEST_TEST_ARGS}") set(_run_args "${_user_args}") unset(_user_args) endif() - if(SUNDIALS_ADD_TEST_EXTRA_ARGS) + if(_have_extra_test_args) string(REPLACE ";" " " _extra_args "${SUNDIALS_ADD_TEST_EXTRA_ARGS}") set(_run_args "${_run_args} ${_extra_args}") unset(_extra_args) endif() - if(_run_args) + if(_have_test_args OR _have_extra_test_args) string(STRIP "${_run_args}" _run_args) list(APPEND TEST_ARGS "--runargs=\"${_run_args}\"") unset(_run_args) @@ -214,7 +229,7 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) # pass/fail # convert string to list - if(SUNDIALS_ADD_TEST_TEST_ARGS) + if(_have_test_args) string(REPLACE " " ";" TEST_ARGS "${SUNDIALS_ADD_TEST_TEST_ARGS}") endif() From 4c59383a0db58e861ce9e3f488ea766e72b3cf5f Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 12 Sep 2024 11:40:17 -0700 Subject: [PATCH 100/137] Bugfix: Make hscale=0 for ARKodeResize consistent with docs (#571) The docs state that if a value hscale<=0 is specified, the default of 1.0 will be used. --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/arkode/arkode.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b73b8b7131..e2d7b82449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ Example programs using *hypre* have been updated to support v2.20 and newer. ### Bug Fixes +Fixed `ARKodeResize` not using the default `hscale` when an argument of `0` was +provided. + Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 5d4e6e9554..24f61f9719 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -17,6 +17,9 @@ Example programs using *hypre* have been updated to support v2.20 and newer. **Bug Fixes** +Fixed c:func:`ARKodeResize` not using the default ``hscale`` when an argument of +``0`` was provided. + Fixed the loading of ARKStep's default first order explicit method. Fixed a CMake bug regarding usage of missing "print_warning" macro diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 082a2c1755..378471e507 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -115,7 +115,7 @@ int ARKodeResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, /* Update time-stepping parameters */ /* adjust upcoming step size depending on hscale */ - if (hscale < ZERO) { hscale = ONE; } + if (hscale <= ZERO) { hscale = ONE; } if (hscale != ONE) { /* Encode hscale into ark_mem structure */ From 4e60ad61ec6492764fb92d2cbd55b35c60fd7760 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Thu, 12 Sep 2024 14:59:19 -0700 Subject: [PATCH 101/137] Docs: Add FAQ section (#566) This copies (with updates of outdated info) https://computing.llnl.gov/projects/sundials/faq to our online documentation. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- doc/requirements.txt | 3 +- doc/shared/FAQ.rst | 333 +++++++++++++++++++++++++++++ doc/shared/History.rst | 2 +- doc/shared/sundials/Install.rst | 12 ++ doc/superbuild/source/FAQ_link.rst | 13 ++ doc/superbuild/source/conf.py | 3 +- doc/superbuild/source/index.rst | 1 + 7 files changed, 364 insertions(+), 3 deletions(-) create mode 100644 doc/shared/FAQ.rst create mode 100644 doc/superbuild/source/FAQ_link.rst diff --git a/doc/requirements.txt b/doc/requirements.txt index 7de16a3961..1916bb46a8 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,4 +2,5 @@ sphinx >=4.0.0 sphinx-fortran sphinx_rtd_theme sphinxcontrib.bibtex -sphinx-copybutton \ No newline at end of file +sphinx-copybutton +sphinx-toolbox diff --git a/doc/shared/FAQ.rst b/doc/shared/FAQ.rst new file mode 100644 index 0000000000..f81e96f3a8 --- /dev/null +++ b/doc/shared/FAQ.rst @@ -0,0 +1,333 @@ +.. + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + +.. _FAQ: + +########################## +Frequently Asked Questions +########################## + +The following are some questions frequently asked by SUNDIALS users. +If you do not see your question here, please do not hesitate to ask the +SUNDIALS mailing list by emailing your question to ``sundials-users@llnl.gov``, +or by opening an issue on our `GitHub <https://github.com/LLNL/sundials>`_. + +Installation +------------ + +.. collapse:: I have the sundials source, how do I build it? + + See the :ref:`Installation.CMake` section. + + +.. collapse:: Can I use a non-default compiler to build SUNDIALS? + + Yes, specific compilers can be specified on the CMake command line. + The following example specifies gcc and g++ for the C and CXX compilers, respectively: + + .. code-block:: cpp + + cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ../srcdir + + .. note:: + If you wish to change the compiler after already configuring, then you must start + with a fresh build directory and specify the compiler on the command line as shown. + + +.. collapse:: How do I install SUNDIALS on Windows systems? + + One way of obtaining Windows libraries for the SUNDIALS solvers is to use cygwin + `cygwin <www.cygwin.com>`_, in which case the installation procedure is the same + as for any other Linux system. + + Otherwise, refer to :ref:`Installation.CMake.Windows`. + + +.. collapse:: Everything installed fine! How do I link the SUNDIALS libraries to my own application? + + Refer to :ref:`Installation.Results`. + + +CVODE(S) / IDA(S) / ARKODE +-------------------------- + +.. collapse:: How do I choose tolerances? + + The same advice applies to CVODE(S), IDA(S), and ARKODE: + + 1. The scalar relative tolerance ``reltol`` is to be set to control relative errors. So + :math:`\texttt{reltol} = 10^{-4}` means that errors are controlled to .01%. We do not recommend + using ``reltol`` larger than :math:`10^{-3}`. On the other hand, ``reltol`` should not be so small + that it is comparable to the unit roundoff of the machine arithmetic (generally + around :math:`10^{-15}` for double-precision). + + 2. The absolute tolerances ``abstol`` (whether scalar or vector) need to be set to control + absolute errors when any components of the solution vector ``y`` may be so small that + pure relative error control is meaningless. For example, if ``y[i]`` starts at some + nonzero value, but in time decays to zero, then pure relative error control on ``y[i]`` + makes no sense (and is overly costly) after ``y[i]`` is below some noise level. Then + ``abstol`` (if scalar) or ``abstol[i]`` (if a vector) needs to be set to that noise level. If the different + components have different noise levels, then ``abstol`` should be a vector. See the example ``cvsRoberts_dns`` + in the CVODE package, and the discussion of it in the CVODE Examples document + :cite:p:`cvodes_ex`. In that problem, the three components vary between 0 and 1, + and have different noise levels; hence the ``abstol`` vector. It is impossible to give any + general advice on ``abstol`` values, because the appropriate noise levels are completely + problem-dependent. The user or modeler hopefully has some idea as to what those + noise levels are. + + 3. Finally, it is important to pick all the tolerance values conservatively, + because they control the error committed on each individual time step. The final + (global) errors are some sort of accumulation of those per-step errors. A good + rule of thumb is to reduce the tolerances by a factor of .01 from the actual + desired limits on errors. So if you want .01% accuracy (globally), a good choice + is :math:`\texttt{reltol} = 10^{-6}`. But in any case, it is a good idea to do a few experiments + with the tolerances to see how the computed solution values vary as tolerances + are reduced. + + +.. collapse:: How do I choose what linear solver to use for the stiff case? + + If the problem size is fairly small (say :math:`N < 100`), then using the dense solver is + probably best; it is the simplest to use, and reasonably inexpensive for small :math:`N`. For larger :math:`N`, it + is important to take advantage of sparsity (zero-nonzero) structure within the problem. If there + is local (nearest-neighbor) coupling, or if the coupling is local after a suitable reordering of + :math:`y`, then use the banded linear solver. Local coupling means that the :math:`i`-th component of the RHS or + residual function depends only on components :math:`y_j` for which :math:`|i-j|` is small relative + to :math:`N`. (Note that the dense and band solvers are only applicable for the single node versions of the + solver.) For even larger problems, consider one of the Krylov iterative methods. These are hardest + to use, because for best results they usually require preconditioning. However, they offer the best + opportunity to exploit the sparsity structure in the problem. The preconditioner is a matrix + which, at least crudely, approximates the actual matrix in the linear system to be solved, and is + typically built from an approximation of the relevant Jacobian matrix. Typically, that + approximation uses only part of the true Jacobian, but as a result is much less expensive to + solve. If the Jacobian can be approximated by a matrix that is banded (serial case) or + block-diagonal with banded blocks (distributed parallel case), SUNDIALS includes preconditioner modules for + such cases. In each of the user guides, the section 'Linear solver specification functions' and + the section on preconditioner modules contain more detailed comments on preconditioning. On the + construction of preconditioners for problems arising from the spatial discretization of + time-dependent partial differential equation systems, there is considerable discussion in the + paper :cite:p:`BrHi:89`. + +.. collapse:: How do I handle a data-defined function within the RHS or residual function? + + Often the RHS or residual function depends on some function :math:`A(t)` that is data-defined, + i.e. defined only at a set of discrete set of times :math:`t`. The solver must be able to obtain values of + the user-supplied functions at arbitrary times :math:`t` in the integration interval. So the user must fit + the data with a reasonably smooth function :math:`A(t)` that is defined continuously for all + relevant :math:`t`, and incorporate an evaluation of that fit function in the user function involved. This + may be as simple as a piecewise linear fit, but a smoother fit (e.g. spline) would make the + integration more efficient. If there is noise in the data, the fit should be a least-squares fit + instead of a straight interpolation. The same advice applies if the user function has a + data-defined function :math:`A(y)` that involves one or more components of the dependent variable + vector :math:`y`. Of course, if more that one component is involved, the fit is more complicated. + +.. collapse:: How do I control unphysical negative values? + + In many applications, some components in the true solution are always positive + or non-negative, though at times very small. In the numerical solution, however, + small negative (hence unphysical) values can then occur. In most cases, these + values are harmless, and simply need to be controlled, not eliminated. The + following pieces of advice are relevant. + + 1. The way to control the size of unwanted negative computed values is with + tighter absolute tolerances. Again this requires some knowledge of the noise + level of these components, which may or may not be different for different + components. Some experimentation may be needed. + + 2. If output plots or tables are being generated, and it is important to avoid + having negative numbers appear there (for the sake of avoiding a long + explanation of them, if nothing else), then eliminate them, but only in the + context of the output medium. Then the internal values carried by the solver are + unaffected. Remember that a small negative value in ``y`` returned by CVODE, with + magnitude comparable to ``abstol`` or less, is equivalent to zero as far as the computation + is concerned. + + 3. The user’s right-hand side routine ``f`` (or residual ``F``) should never change a negative value in + the solution vector ``y`` to a non-negative value, as a "solution" to this problem. + This can cause instability. If the ``f`` (or ``F``) routine cannot tolerate a zero or negative + value (e.g. because there is a square root or log of it), then the offending + value should be changed to zero or a tiny positive number in a temporary + variable (not in the input ``y`` vector) for the purposes of computing :math:`f(t,y)` (or :math:`F(t,y,y')`). + + 4. Positivity and non-negativity constraints on components can be enforced by + use of the recoverable error return feature in the user-supplied right-hand side + function. However, because this option involves some extra overhead cost, it + should only be exercised if the use of absolute tolerances to control the + computed values is unsuccessful. + + In addition, SUNDIALS integrators provide the option of enforcing positivity or non-negativity on components. But + these constraint options should only be exercised if the use of absolute tolerances to control the + computed values is unsuccessful, because they involve some extra overhead cost. + + +.. collapse:: How do I treat discontinuities in the RHS or residual function? + + If the jumps at the discontinuities are relatively small, simply keep them in the RHS (or residual) function, + and let the integrator respond to them (possibly taking smaller steps through each point of + discontinuity). If the jumps are large, it is more efficient to stop at the point of discontinuity + and restart the integrator with a readjusted ODE (or DAE) model. To stop when the location of the + discontinuity is known, simply make that location a value of ``tout``. To stop when the location of + the discontinuity is determined by the solution, use the rootfinding feature. In either case, it + is critical that the RHS (or residual) function not incorporate the discontinuity, but rather have a smooth + extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) + can be done efficiently. Then use a switch within the RHS (or residual) function that can be flipped between the + stopping of the integration and the restart, so that the restarted problem uses the new values + (which have jumped). + + +.. collapse:: When is it advantageous to supply my own error weight function? + + The main situation where supplying an ``EwtFn`` function is a good idea is where the problem needs something "in between" the + cases covered by scalar and vector absolute tolerances. Namely, suppose there are a few groups of + variables (relative to the total number of variables) such that all the variables in each group + require the same value of ``abstol``, but these values are very different from one group to another. + Then a user ``EwtFn`` function can keep an array of those values and construct the ``ewt`` vector without + any additional storage. Also, in rare cases, one may want to use this option to apply different + values of ``reltol`` to different variables (or groups of variables). + + +.. collapse:: How do switch on/off forward sensitivity computations in CVODES? + + If you want to turn on and off forward sensitivity calculations during several successive + integrations (such as if you were using CVODES within a dynamically-constrained optimization loop, + when sometimes you want to only integrate the states and sometimes you also need sensitivities + computed), it is most efficient to use :c:func:`CVodeSensToggleOff`. + + +.. collapse:: What is the role of plist in CVODES? + + The argument ``plist`` to :c:func:`CVodeSetSensParams` is used to specify the problem parameters with + respect to which solution sensitivities are to be computed. + + ``plist`` is used only if the sensitivity right-hand sides are evaluated using the internal + difference-quotient approximation function. In that case, ``plist`` should be declared as an array of + ``Ns`` integers and should contain the indices in the array of problem parameters ``p`` with respect to + which sensitivities are desired. For example, if you want to compute sensitivities with respect to + the first and third parameters in the ``p`` array, ``p[0]`` and ``p[2]``, you need to set + + .. code-block:: C + + plist[0] = 0 + plist[1] = 2 + + + If ``plist`` is not provided, CVODES will compute sensitivities with respect to the first ``Ns`` + parameters in the array ``p`` (i.e. it will use ``plist[i]=i, i=0,1,...Ns``). If the user provides a + function to evaluate the right-hand sides of the sensitivity equations or if the default values + are desired, a ``NULL`` pointer can be passed to :c:func:`CVodeSetSensParams`. + + +.. collapse:: What is the role of pbar in CVODES? + + The argument ``pbar`` to :c:func:`CVodeSetSensParams` is used to specify scaling factors for the + problem parameters. + + ``pbar`` is used only if + + * the internal difference-quotient functions are used for the evaluation of the sensitivity + right-hand sides, in which case ``pbar`` is used in computing an appropriate perturbation for + the finite-difference approximation + + or + + * the tolerances for the sensitivity variables are estimated automatically by CVODES from those + specified for the state variables. + + If provided, ``pbar`` should be declared as an array of ``Ns`` real types and should contain non-zero + scaling factors for the ``Ns`` parameters with respect to which sensitivities are to be computed. For + non-zero problem parameters, a good choice is + + .. code-block:: C + + pbar[i] = p[plist[i]] + + + If ``pbar`` is not provided, CVODES will use ``pbar[i]=1.0, i=0,1,...Ns-1``. + + If the user provides a function to evaluate the right-hand sides of the sensitivity equations and + also specifies tolerances for the sensitivity variables (through the ``CVodeSens*tolerances`` + functions) or if the default values are desired, a ``NULL`` pointer can be passed to + :c:func:`CVodeSetSensParams`. + + +.. collapse:: What is pure quadrature integration? + + Suppose your ODE is :math:`y'=f(t,y)` and you integrate it from :math:`0` to :math:`T` and that you are also interested in computing an integral of the form + + .. math:: + + z(t) = int_0^t g(t,y(t)) dt + + for some function :math:`g`. The most efficient way of computing :math:`z` is by appending one additional differential equation to your ODE system: + + .. math:: + + z' = g(t,y) + + with initial condition :math:`z(0)=0`, in which case the integral from :math:`0` to :math:`T` is `z(T)`. + + This additional equation is "a pure quadrature equation" and its main characteristic is that the + new differential variable :math:`z` does not appear in the right hand side of the extended ODE system. If + CVODES is notified of such "pure quadrature equations", it can take advantage of this property and + do less work than if it didn't know about them (these variables need not be considered in the + nonlinear system solution). + + The main reason for the special treatment of "pure quadrature equations" in CVODES is that such + integrals (very often a large number of them) need to be computed for adjoint sensitivity. + + +KINSOL +------ + +.. collapse:: How do I reinitialize KINSOL within a C/C++ program? + + Although KINSOL does not provide a reinitialization function, it is possible to reinitialize the + solver (meaning reuse a KINSOL object), but only if the problem size remains unchanged. To + reinitialize KINSOL, begin by making any necessary changes to the problem definition by calling + the appropriate ``KINSet*`` functions (e.g., :c:func:`KINSetSysFunc`). Next, if you would like to use + a different linear solver, call the appropriate function, followed by any calls to the + corresponding ``KIN*Set*`` functions. Then you can call the ``KINSol`` function to solve the updated + nonlinear algebraic system. + + +.. collapse:: Why is the system function being evaluated at points that violate the constraints? + + If you have not supplied a function to compute either :math:`J(u)` (of type :c:type:`KINLsJacFn`) or :math:`J(u) v` + (of type :c:type:`KINLsJacTimesVecFn`), then the internal function may be the culprit. The + default function used to compute a difference quotient approximation to the Jacobian (direct + methods) or Jacobian matrix-vector product (Kylov methods) evaluates the user-supplied system + function at a slightly perturbed point, but does not check if that point violates the constraints. + + +Miscellaneous +------------- + +.. collapse:: How do I determine which version of SUNDIALS I have? + + If you still have access to the distribution files, then the SUNDIALS release number is indicated + in the top-level ``README.md`` and the corresponding solver versions can be determined by + reading the appropriate row of the :ref:`release history <ReleaseHistory>` table or from the files, ``sundials/src/<solver>/README.md``. You can also call the functions + :c:func:`SUNDIALSGetVersion` and :c:func:`SUNDIALSGetVersionNumber` from your program, or + use the ``SUNDIALS_VERSION*`` macros found in the header file ``sundials/sundials_config.h``. + + + +.. collapse:: SUNDIALS Wiki + + Some additional information might be found at `http://sundials.wikidot.com + <http://sundials.wikidot.com/>`_ however the wikidot page has not been maintained in many years so + it contains plenty of outdated information. + + .. warning:: + + The SUNDIALS team does not maintain the wikidot web page. diff --git a/doc/shared/History.rst b/doc/shared/History.rst index f2f4e0842d..f5cda1f326 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -12,7 +12,7 @@ SUNDIALS Copyright End ---------------------------------------------------------------- -.. _History: +.. _ReleaseHistory: ############### Release History diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index f80b9f8fa5..dc3c447aa6 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -1785,6 +1785,18 @@ the first example and ``libsundials_cvode``, ``libsundials_nveccuda``, Refer to the documentations sections for the individual packages and modules of SUNDIALS that interest you for the proper includes and libraries to link to. +Furthermore, each of the sundials solvers is distributed with a set of examples demonstrating basic +usage. To build and install the examples, set both ``EXAMPLES_ENABLE_<lang>`` and +:cmakeop:`EXAMPLES_INSTALL` to ``ON`` and specify the example installation directory +:cmakeop:`EXAMPLES_INSTALL_PATH`. CMake will generate a ``CMakeLists.txt`` configuration file (and +``Makefile`` files if on Linux/Unix) that reference the installed sundials headers and libraries. Either +the ``CMakeLists.txt`` file or the traditional ``Makefile`` may be used to build the examples as well as +serve as a template for creating user developed solutions. To use the supplied ``Makefile`` simply run +``make`` to compile and generate the executables. To use CMake, from within the installed example +directory, run ``cmake`` (or ``ccmake`` to use the GUI) followed by make to compile the example code. Note +that if CMake is used, it will overwrite the traditional ``Makefile`` with a new CMake generated +``Makefile``. + Using SUNDIALS as a Third Party Library in other CMake Projects --------------------------------------------------------------- diff --git a/doc/superbuild/source/FAQ_link.rst b/doc/superbuild/source/FAQ_link.rst new file mode 100644 index 0000000000..859d7b2c2d --- /dev/null +++ b/doc/superbuild/source/FAQ_link.rst @@ -0,0 +1,13 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/FAQ.rst diff --git a/doc/superbuild/source/conf.py b/doc/superbuild/source/conf.py index b5c8189bac..2a6fe2431c 100644 --- a/doc/superbuild/source/conf.py +++ b/doc/superbuild/source/conf.py @@ -28,7 +28,8 @@ # 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', 'sphinx.ext.graphviz', 'sphinx_sundials'] + 'sphinx_copybutton', 'sphinx.ext.graphviz', 'sphinx_sundials', + 'sphinx_toolbox.collapse'] # References bibtex_bibfiles = ['../../shared/sundials.bib'] diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index 1d9fde63a7..e61162c884 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -177,6 +177,7 @@ SUNDIALS License and Notices sunmemory/index.rst History_link.rst Changelog_link.rst + FAQ_link.rst .. toctree:: :caption: DEVELOPMENT From 83f6e6e1b4e9ed322717a8e7d2219d01ed45ffc4 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Mon, 16 Sep 2024 10:23:00 -0700 Subject: [PATCH 102/137] fix missing semicolon (#573) Fixes https://github.com/xsdk-project/xsdk-issues/issues/266. --- examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp index cbb1ff3d5a..e9151a9b65 100644 --- a/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp +++ b/examples/sunmatrix/ginkgo/test_sunmatrix_ginkgo.cpp @@ -104,7 +104,7 @@ int main(int argc, char* argv[]) #endif #elif defined(USE_HIP) #if GKO_VERSION_MAJOR > 1 || (GKO_VERSION_MAJOR == 1 && GKO_VERSION_MINOR >= 7) - auto gko_exec { gko::HipExecutor::create(0, gko::OmpExecutor::create()) } + auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create())}; #else auto gko_exec{gko::HipExecutor::create(0, gko::OmpExecutor::create(), true)}; #endif From 83a4c3c3e0538c6b920d5341186b4c6290ebc116 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 16 Sep 2024 13:30:42 -0700 Subject: [PATCH 103/137] CMake: Use LAPACK imported target (#542) 1. Use `LAPACK::LAPACK` rather than `LAPACK_LIBRARIES` 2. Simplify `try_compile` test 3. Don't overwrite `LAPACK_WORKS` (test every configuration pass) 4. Use `CHECK_START`, `CHECK_PASSED`, and `CHECK_FAILED` messages in compile test 5. Replace manual include guard with `include_guard(GLOBAL)` 6. Update `SundialsTPL.cmake.template` with above changes --------- Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 4 + cmake/SUNDIALSConfig.cmake.in | 10 ++ cmake/SundialsBuildOptionsPost.cmake | 4 +- cmake/tpl/SundialsLapack.cmake | 125 ++++++------------ cmake/tpl/SundialsTPL.cmake.template | 52 ++++---- doc/Makefile | 4 +- doc/shared/RecentChanges.rst | 4 + doc/shared/sundials/Install.rst | 42 ++++-- examples/arkode/F2003_serial/CMakeLists.txt | 3 - examples/cvode/F2003_serial/CMakeLists.txt | 3 - examples/cvode/serial/CMakeLists.txt | 3 - examples/cvodes/serial/CMakeLists.txt | 3 - examples/ida/serial/CMakeLists.txt | 3 - examples/idas/serial/CMakeLists.txt | 3 - examples/kinsol/serial/CMakeLists.txt | 3 - examples/sunlinsol/lapackband/CMakeLists.txt | 5 +- examples/sunlinsol/lapackdense/CMakeLists.txt | 2 +- src/sunlinsol/lapackband/CMakeLists.txt | 9 +- src/sunlinsol/lapackdense/CMakeLists.txt | 9 +- test/config_cmake.py | 11 ++ test/env/default.sh | 2 + 21 files changed, 148 insertions(+), 156 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2d7b82449..74abb6520e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ backends with Trilinos. As such, Trilinos 14 or newer is required and the Example programs using *hypre* have been updated to support v2.20 and newer. +The build system has been updated to utilize the CMake LAPACK imported target +which should ease building SUNDIALS with LAPACK libraries that require setting +specific linker flags e.g., MKL. + ### Bug Fixes Fixed `ARKodeResize` not using the default `hscale` when an argument of `0` was diff --git a/cmake/SUNDIALSConfig.cmake.in b/cmake/SUNDIALSConfig.cmake.in index 399309f67e..a5f255f035 100644 --- a/cmake/SUNDIALSConfig.cmake.in +++ b/cmake/SUNDIALSConfig.cmake.in @@ -108,6 +108,16 @@ if("@ENABLE_KOKKOS_KERNELS@" AND NOT TARGET Kokkos::kokkoskernels) find_dependency(KokkosKernels PATHS "@KokkosKernels_DIR@") endif() +if("@ENABLE_LAPACK@" AND NOT TARGET LAPACK::LAPACK) + # For some reason find_dependency does not find the libraries if the variables + # below are internal rather than CACHE variables + set(BLAS_LIBRARIES "@BLAS_LIBRARIES@" CACHE "FILEPATH" "BLAS libraries") + set(BLAS_LINKER_FLAGS "@BLAS_LINKER_FLAGS@" CACHE "STRING" "BLAS linker flags") + set(LAPACK_LIBRARIES "@LAPACK_LIBRARIES@" CACHE "FILEPATH" "LAPACK libraries") + set(LAPACK_LINKER_FLAGS "@LAPACK_LINKER_FLAGS@" CACHE "STRING" "LAPACK linker flags") + find_dependency(LAPACK) +endif() + if("@ENABLE_PETSC@" AND NOT TARGET SUNDIALS::PETSC) add_library(SUNDIALS::PETSC INTERFACE IMPORTED) target_link_libraries(SUNDIALS::PETSC INTERFACE "@PETSC_LIBRARIES@") diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index d6d02c5565..6d05b9846e 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -244,14 +244,14 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_KOKKOSDENSE") sundials_option( BUILD_SUNLINSOL_LAPACKBAND BOOL "Build the SUNLINSOL_LAPACKBAND module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + DEPENDS_ON ENABLE_LAPACK ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKBAND") sundials_option( BUILD_SUNLINSOL_LAPACKDENSE BOOL "Build the SUNLINSOL_LAPACKDENSE module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + DEPENDS_ON ENABLE_LAPACK ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKDENSE") diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index ecc3e4475b..1af930d388 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -26,11 +26,7 @@ # Section 1: Include guard # ----------------------------------------------------------------------------- -if(NOT DEFINED SUNDIALS_LAPACK_INCLUDED) - set(SUNDIALS_LAPACK_INCLUDED) -else() - return() -endif() +include_guard(GLOBAL) # ----------------------------------------------------------------------------- # Section 2: Check to make sure options are compatible @@ -38,28 +34,20 @@ endif() # LAPACK does not support extended precision if(ENABLE_LAPACK AND SUNDIALS_PRECISION MATCHES "EXTENDED") - print_error("LAPACK is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "LAPACK is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -# If LAPACK libraries are undefined, try to find them. -if(NOT LAPACK_LIBRARIES) - find_package(LAPACK REQUIRED) -endif() +find_package(LAPACK REQUIRED) -# If we have the LAPACK libraries, display progress message. -if(LAPACK_LIBRARIES) - message(STATUS "Looking for LAPACK libraries... OK") - set(LAPACK_FOUND TRUE) -else() - message(STATUS "Looking for LAPACK libraries... FAILED") - set(LAPACK_FOUND FALSE) -endif() - -message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}") +# get path to LAPACK library to use in generated makefiles for examples, if +# LAPACK_LIBRARIES contains multiple items only use the path of the first entry +list(GET LAPACK_LIBRARIES 0 TMP_LAPACK_LIBRARIES) +get_filename_component(LAPACK_LIBRARY_DIR ${TMP_LAPACK_LIBRARIES} PATH) # ----------------------------------------------------------------------------- # Section 4: Test the TPL @@ -302,33 +290,17 @@ if(NEED_FORTRAN_NAME_MANGLING) endif() -# If we have the LAPACK libraries, determine if they work. -if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) - # Create the LapackTest directory - set(LapackTest_DIR ${PROJECT_BINARY_DIR}/LapackTest) - file(MAKE_DIRECTORY ${LapackTest_DIR}) +# Try building a simple test +if(NOT LAPACK_WORKS) - # Create a CMakeLists.txt file - file( - WRITE ${LapackTest_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" - "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "ADD_EXECUTABLE(ltest ltest.c)\n" - "TARGET_LINK_LIBRARIES(ltest ${LAPACK_LIBRARIES})\n") - - # Create a C source file which calls a Blas function (dcopy) and an Lapack - # function (dgetrf) + message(CHECK_START "Testing LAPACK") + + # Create the test directory + set(LAPACK_TEST_DIR ${PROJECT_BINARY_DIR}/LAPACK_TEST) + + # Create a C source file calling a BLAS (dcopy) and LAPACK (dgetrf) function file( - WRITE ${LapackTest_DIR}/ltest.c + WRITE ${LAPACK_TEST_DIR}/test.c "${LAPACK_MANGLE_MACRO1}\n" "#define dcopy_f77 SUNDIALS_LAPACK_FUNC(dcopy, DCOPY)\n" "#define dgetrf_f77 SUNDIALS_LAPACK_FUNC(dgetrf, DGETRF)\n" @@ -340,49 +312,38 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) "double y=1.0;\n" "dcopy_f77(&n, &x, &n, &y, &n);\n" "dgetrf_f77(&n, &n, &x, &n, &n, &n);\n" - "return(0);\n" + "return 0;\n" "}\n") - # Attempt to build and link the "ltest" executable + # Workaround bug in older versions of CMake where the BLAS::BLAS target, which + # LAPACK::LAPACK depends on, is not defined in the file + # ${LAPACK_TEST_DIR}/CMakeFiles/CMakeTmp/<random_name>Targets.cmake created by + # try_compile + set(_lapack_targets LAPACK::LAPACK) + if(CMAKE_VERSION VERSION_LESS 3.20) + list(APPEND _lapack_targets BLAS::BLAS) + endif() + + # Attempt to build and link the test executable, pass --debug-trycompile to + # the cmake command to save build files for debugging try_compile( - COMPILE_OK ${LapackTest_DIR} - ${LapackTest_DIR} ltest + COMPILE_OK ${LAPACK_TEST_DIR} + ${LAPACK_TEST_DIR}/test.c + LINK_LIBRARIES ${_lapack_targets} OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, we must remove the - # CMakeFiles directory. - file(REMOVE_RECURSE ${LapackTest_DIR}/CMakeFiles) - - # Process test result + # Check the result if(COMPILE_OK) - message(STATUS "Checking if LAPACK works with SUNDIALS... OK") - set(LAPACK_WORKS - TRUE - CACHE BOOL "LAPACK works with SUNDIALS as configured" FORCE) - - # get path to LAPACK library to use in generated makefiles for examples, if - # LAPACK_LIBRARIES contains multiple items only use the path of the first - # entry - list(LENGTH LAPACK_LIBRARIES len) - if(len EQUAL 1) - get_filename_component(LAPACK_LIBRARY_DIR ${LAPACK_LIBRARIES} PATH) - else() - list(GET LAPACK_LIBRARIES 0 TMP_LAPACK_LIBRARIES) - get_filename_component(LAPACK_LIBRARY_DIR ${TMP_LAPACK_LIBRARIES} PATH) - endif() - else(COMPILE_OK) - set(LAPACK_WORKS - FALSE - CACHE BOOL "LAPACK does not work with SUNDIALS as configured" FORCE) - message(STATUS "Checking if LAPACK works with SUNDIALS... FAILED") - message(STATUS "Check output: ") - message("${COMPILE_OUTPUT}") - message(FATAL_ERROR "SUNDIALS interface to LAPACK is not functional.") + message(CHECK_PASS "success") + else() + message(CHECK_FAIL "failed") + file(WRITE ${LAPACK_TEST_DIR}/compile.out "${COMPILE_OUTPUT}") + message( + FATAL_ERROR + "Could not compile LAPACK test. Check output in ${LAPACK_TEST_DIR}/compile.out" + ) endif() -elseif(LAPACK_LIBRARIES AND LAPACK_WORKS) - message( - STATUS - "Skipped LAPACK tests, assuming LAPACK works with SUNDIALS. Set LAPACK_WORKS=FALSE to (re)run compatibility test." - ) +else() + message(STATUS "Skipped LAPACK test. Set LAPACK_WORKS=FALSE to test.") endif() diff --git a/cmake/tpl/SundialsTPL.cmake.template b/cmake/tpl/SundialsTPL.cmake.template index e95255b18e..a199a1b8c4 100644 --- a/cmake/tpl/SundialsTPL.cmake.template +++ b/cmake/tpl/SundialsTPL.cmake.template @@ -26,11 +26,7 @@ # Section 1: Include guard # ----------------------------------------------------------------------------- -if(NOT DEFINED SUNDIALS_<TPL>_INCLUDED) - set(SUNDIALS_<TPL>_INCLUDED) -else() - return() -endif() +include_guard(GLOBAL) # ----------------------------------------------------------------------------- # Section 2: Check to make sure options are compatible @@ -46,38 +42,36 @@ find_package(<TPL> REQUIRED) # Section 4: Test the TPL # ----------------------------------------------------------------------------- -if(<TPL>_FOUND AND (NOT <TPL>_WORKS)) - # Do any checks which don't require compilation first. +# Do any checks which don't require compilation first. - # Create the <TPL>_TEST directory - set(<TPL>_TEST_DIR ${PROJECT_BINARY_DIR}/<TPL>_TEST) - file(MAKE_DIRECTORY ${<TPL>_TEST_DIR}) +# Try building a simple test +if(NOT <TPL>_WORKS) - # Create a CMakeLists.txt file - file(WRITE ${<TPL>_TEST_DIR}/CMakeLists.txt "") + message(CHECK_START "Testing <TPL>") - # Create a C source file - file(WRITE ${<TPL>_TEST_DIR}/ltest.c "") + # Create the test directory + set(<TPL>_TEST_DIR ${PROJECT_BINARY_DIR}/<TPL>_TEST) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. - file(REMOVE_RECURSE ${<TPL>_TEST_DIR}/CMakeFiles) + # Create a C source file + file(WRITE ${<TPL>_TEST_DIR}/test.c + "int main(void) {\n" + "return 0;\n" + "}\n") - # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${<TPL>_TEST_DIR} ${<TPL>_TEST_DIR} ltest - OUTPUT_VARIABLE COMPILE_OUTPUT) + # Attempt to build and link the test executable, pass --debug-trycompile to + # the cmake command to save build files for debugging + try_compile(COMPILE_OK ${<TPL>_TEST_DIR} ${<TPL>_TEST_DIR}/test.c + LINK_LIBRARIES <TPL target> OUTPUT_VARIABLE COMPILE_OUTPUT) - # Process test result + # Check the result if(COMPILE_OK) - message(STATUS "Checking if <TPL> works with SUNDIALS... OK") - set(<TPL>_WORKS TRUE CACHE BOOL "<TPL> works with SUNDIALS as configured" FORCE) + message(CHECK_PASS "success") else() - message(STATUS "Checking if <TPL> works with SUNDIALS... FAILED") - message(STATUS "Check output: ") - message("${COMPILE_OUTPUT}") - message(FATAL_ERROR "SUNDIALS interface to <TPL> is not functional.") + message(CHECK_FAIL "failed") + file(WRITE ${<TPL>_TEST_DIR}/compile.out "${COMPILE_OUTPUT}") + message(FATAL_ERROR "Could not compile <TPL> test. Check output in ${<TPL>_TEST_DIR}/compile.out") endif() -elseif(<TPL>_FOUND AND <TPL>_WORKS) - message(STATUS "Skipped <TPL> tests, assuming <TPL> works with SUNDIALS.") +else() + message(STATUS "Skipped <TPL> test. Set <TPL>_WORKS=FALSE to test.") endif() diff --git a/doc/Makefile b/doc/Makefile index 3788c1d82a..4b25c396fa 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -22,9 +22,9 @@ DIRS = arkode/guide arkode/examples \ kinsol/guide # prefix with desired command to create unique dependencies/targets -LATEXDIRS = $(DIRS:%=latexpdf-%) +LATEXDIRS = $(DIRS:%=latexpdf-%) latexpdf-install_guide HTMLDIRS = $(DIRS:%=html-%) html-superbuild -CLEANDIRS = $(DIRS:%=clean-%) clean-superbuild +CLEANDIRS = $(DIRS:%=clean-%) clean-superbuild clean-install_guide latexpdf: $(LATEXDIRS) $(LATEXDIRS): diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 24f61f9719..fc2568901e 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -15,6 +15,10 @@ backends with Trilinos. As such, Trilinos 14 or newer is required and the Example programs using *hypre* have been updated to support v2.20 and newer. +The build system has been updated to utilize the CMake LAPACK imported target +which should ease building SUNDIALS with LAPACK libraries that require setting +specific linker flags e.g., MKL. + **Bug Fixes** Fixed c:func:`ARKodeResize` not using the default ``hscale`` when an argument of diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index dc3c447aa6..2a5068e5c9 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -776,15 +776,29 @@ illustration only. options. See additional information on building with LAPACK enabled in :numref:`Installation.CMake.ExternalLibraries`. +.. cmakeoption:: BLAS_LIBRARIES + + BLAS libraries + + Default: none (CMake will try to find a BLAS installation) + +.. cmakeoption:: BLAS_LINKER_FLAGS + + BLAS required linker flags + + Default: none (CMake will try to determine the necessary flags) + .. cmakeoption:: LAPACK_LIBRARIES - LAPACK (and BLAS) libraries + LAPACK libraries + + Default: none (CMake will try to find a LAPACK installation) + +.. cmakeoption:: LAPACK_LINKER_FLAGS - Default: ``/usr/lib/liblapack.so;/usr/lib/libblas.so`` + LAPACK required linker flags - .. note:: CMake will search for libraries in your - ``LD_LIBRARY_PATH`` prior to searching default system - paths. + Default: none (CMake will try to determine the necessary flags) .. cmakeoption:: ENABLE_MAGMA @@ -1334,13 +1348,12 @@ path to the root of the Kokkos-Kernels installation in Building with LAPACK ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To enable LAPACK, set the ``ENABLE_LAPACK`` option to ``ON``. -If the directory containing the LAPACK library is in the -``LD_LIBRARY_PATH`` environment variable, CMake will set the -``LAPACK_LIBRARIES`` variable accordingly, otherwise CMake will -attempt to find the LAPACK library in standard system locations. To -explicitly tell CMake what library to use, the ``LAPACK_LIBRARIES`` -variable can be set to the desired libraries required for LAPACK. +To enable LAPACK, set the :cmakeop:`ENABLE_LAPACK` option to ``ON``. CMake will +attempt to find BLAS and LAPACK installations on the system and set the +variables :cmakeop:`BLAS_LIBRARIES`, :cmakeop:`BLAS_LINKER_FLAGS`, +:cmakeop:`LAPACK_LIBRARIES`, and :cmakeop:`LAPACK_LINKER_FLAGS`. To explicitly +specify the LAPACK library to build with, manually set the aforementioned +variables to the desired values when configuring the build. .. code-block:: bash @@ -1348,7 +1361,8 @@ variable can be set to the desired libraries required for LAPACK. > -DCMAKE_INSTALL_PREFIX=/home/myname/sundials/instdir \ > -DEXAMPLES_INSTALL_PATH=/home/myname/sundials/instdir/examples \ > -DENABLE_LAPACK=ON \ - > -DLAPACK_LIBRARIES=/mylapackpath/lib/libblas.so;/mylapackpath/lib/liblapack.so \ + > -DBLAS_LIBRARIES=/mylapackpath/lib/libblas.so \ + > -DLAPACK_LIBRARIES=/mylapackpath/lib/liblapack.so \ > /home/myname/sundials/srcdir % make install @@ -1362,7 +1376,7 @@ variable can be set to the desired libraries required for LAPACK. these options in earlier versions of SUNDIALS were ``lower`` and ``one``, respectively. -SUNDIALS has been tested with OpenBLAS 0.3.18. +SUNDIALS has been tested with OpenBLAS 0.3.27. .. _Installation.CMake.ExternalLibraries.KLU: diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index 2d0d7e9547..21b3e56598 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -152,9 +152,6 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense sundials_fsunlinsollapackdense_mod) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${FARKODE_examples_LAPACK}) # parse the example tuple diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 28d3e9db36..b6ab36ffa4 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -135,9 +135,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense sundials_fsunlinsollapackdense_mod) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${FCVODE_examples_LAPACK}) # parse the example tuple diff --git a/examples/cvode/serial/CMakeLists.txt b/examples/cvode/serial/CMakeLists.txt index 7dff99bd8e..51b2482034 100644 --- a/examples/cvode/serial/CMakeLists.txt +++ b/examples/cvode/serial/CMakeLists.txt @@ -121,9 +121,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband sundials_sunlinsollapackdense) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${CVODE_examples_BL}) # parse the example tuple diff --git a/examples/cvodes/serial/CMakeLists.txt b/examples/cvodes/serial/CMakeLists.txt index bd2a3a0be7..b8433dc751 100644 --- a/examples/cvodes/serial/CMakeLists.txt +++ b/examples/cvodes/serial/CMakeLists.txt @@ -140,9 +140,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband sundials_sunlinsollapackdense) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${CVODES_examples_BL}) # parse the example tuple diff --git a/examples/ida/serial/CMakeLists.txt b/examples/ida/serial/CMakeLists.txt index 005f35d945..e93cbb2c49 100644 --- a/examples/ida/serial/CMakeLists.txt +++ b/examples/ida/serial/CMakeLists.txt @@ -107,9 +107,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband sundials_sunlinsollapackdense) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${IDA_examples_BL}) # parse the example tuple diff --git a/examples/idas/serial/CMakeLists.txt b/examples/idas/serial/CMakeLists.txt index 56388c088f..00d4b39f90 100644 --- a/examples/idas/serial/CMakeLists.txt +++ b/examples/idas/serial/CMakeLists.txt @@ -116,9 +116,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband sundials_sunlinsollapackdense) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${IDAS_examples_BL}) # parse the example tuple diff --git a/examples/kinsol/serial/CMakeLists.txt b/examples/kinsol/serial/CMakeLists.txt index fe41d282ad..65610d2bb7 100644 --- a/examples/kinsol/serial/CMakeLists.txt +++ b/examples/kinsol/serial/CMakeLists.txt @@ -111,9 +111,6 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband sundials_sunlinsollapackdense) - # LAPACK libraries - list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) - foreach(example_tuple ${KINSOL_examples_BL}) # parse the example tuple diff --git a/examples/sunlinsol/lapackband/CMakeLists.txt b/examples/sunlinsol/lapackband/CMakeLists.txt index fefcb00eb3..8e4b763763 100644 --- a/examples/sunlinsol/lapackband/CMakeLists.txt +++ b/examples/sunlinsol/lapackband/CMakeLists.txt @@ -48,9 +48,8 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries( - ${example} sundials_nvecserial sundials_sunmatrixband - sundials_sunlinsollapackband ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunmatrixband + sundials_sunlinsollapackband ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name diff --git a/examples/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index e5ff8e32b4..5cb269fbe2 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -59,7 +59,7 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) # libraries to link against target_link_libraries( ${example} sundials_nvecserial sundials_sunmatrixdense - sundials_sunlinsollapackdense ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) + sundials_sunlinsollapackdense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name diff --git a/src/sunlinsol/lapackband/CMakeLists.txt b/src/sunlinsol/lapackband/CMakeLists.txt index 4da37454dd..7c72c37209 100644 --- a/src/sunlinsol/lapackband/CMakeLists.txt +++ b/src/sunlinsol/lapackband/CMakeLists.txt @@ -16,6 +16,13 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKBAND\n\")") +# Workaround bug in older versions of CMake where the BLAS::BLAS target, which +# LAPACK::LAPACK depends on, is not picked up by LINK_LIBRARIES +set(_lapack_targets LAPACK::LAPACK) +if(CMAKE_VERSION VERSION_LESS 3.20) + list(APPEND _lapack_targets BLAS::BLAS) +endif() + # Add the library sundials_add_library( sundials_sunlinsollapackband @@ -24,7 +31,7 @@ sundials_add_library( INCLUDE_SUBDIR sunlinsol LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES PUBLIC sundials_sunmatrixband "${LAPACK_LIBRARIES}" + LINK_LIBRARIES PUBLIC sundials_sunmatrixband ${_lapack_targets} OUTPUT_NAME sundials_sunlinsollapackband VERSION ${sunlinsollib_VERSION} SOVERSION ${sunlinsollib_SOVERSION}) diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index f8161667f3..c6e5689a36 100644 --- a/src/sunlinsol/lapackdense/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/CMakeLists.txt @@ -16,6 +16,13 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKDENSE\n\")") +# Workaround bug in older versions of CMake where the BLAS::BLAS target, which +# LAPACK::LAPACK depends on, is not picked up by LINK_LIBRARIES +set(_lapack_targets LAPACK::LAPACK) +if(CMAKE_VERSION VERSION_LESS 3.20) + list(APPEND _lapack_targets BLAS::BLAS) +endif() + # Add the library sundials_add_library( sundials_sunlinsollapackdense @@ -24,7 +31,7 @@ sundials_add_library( INCLUDE_SUBDIR sunlinsol LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES PUBLIC sundials_sunmatrixdense "${LAPACK_LIBRARIES}" + LINK_LIBRARIES PUBLIC sundials_sunmatrixdense ${_lapack_targets} OUTPUT_NAME sundials_sunlinsollapackdense VERSION ${sunlinsollib_VERSION} SOVERSION ${sunlinsollib_SOVERSION}) diff --git a/test/config_cmake.py b/test/config_cmake.py index 1120d597ea..1c09cb9369 100644 --- a/test/config_cmake.py +++ b/test/config_cmake.py @@ -926,6 +926,17 @@ def main(): dependson="--lapack", ) + add_arg( + group, + "--blas-libs", + "BLAS_LIBRARIES", + "BLAS_LIBRARIES", + None, + "STRING", + "BLAS libraries", + dependson="--lapack", + ) + # KLU group = parser.add_argument_group("KLU Options") diff --git a/test/env/default.sh b/test/env/default.sh index 6ca282cb07..2ed8dd59e8 100644 --- a/test/env/default.sh +++ b/test/env/default.sh @@ -187,9 +187,11 @@ if [ "$SUNDIALS_PRECISION" != "extended" ]; then LAPACK_ROOT="$(spack location -i openblas@0.3.27 +ilp64)" fi export LAPACK_LIBRARIES="${LAPACK_ROOT}/lib/libopenblas.so" + export BLAS_LIBRARIES="${LAPACK_LIBRARIES}" else export SUNDIALS_LAPACK=OFF unset LAPACK_LIBRARIES + unset BLAS_LIBRARIES fi # --- From 380cf82c1c5a2c99af96b51e21971f0baed44eb5 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 18 Sep 2024 09:31:09 -0700 Subject: [PATCH 104/137] Docs: Fix typo in FAQ (#575) Fix small typo in FAQ --- doc/shared/FAQ.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/shared/FAQ.rst b/doc/shared/FAQ.rst index f81e96f3a8..09b824fb68 100644 --- a/doc/shared/FAQ.rst +++ b/doc/shared/FAQ.rst @@ -266,7 +266,7 @@ CVODE(S) / IDA(S) / ARKODE .. math:: - z(t) = int_0^t g(t,y(t)) dt + z(t) = \int_0^t g(t,y(t)) dt for some function :math:`g`. The most efficient way of computing :math:`z` is by appending one additional differential equation to your ODE system: From 25ea7af34a6bd527e17184cfc6ccfa52b806a347 Mon Sep 17 00:00:00 2001 From: Daniel Weindl <dweindl@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:18:12 +0200 Subject: [PATCH 105/137] Fix aliasing potential `ALIAS` target `SuiteSparse::KLU` (#582) Fixes a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. See #579 for details. Fixes #579. --------- Signed-off-by: Daniel Weindl <daniel.weindl@helmholtz-munich.de> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- CHANGELOG.md | 3 +++ cmake/tpl/FindKLU.cmake | 9 ++++++++- doc/shared/RecentChanges.rst | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74abb6520e..82e24b6382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,9 @@ repeatedly. Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. +Fixed a CMake configuration issue related to aliasing an `ALIAS` target when +using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.1 diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index 08b77d3773..0818f31209 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -40,7 +40,14 @@ if(NOT if(TARGET SuiteSparse::KLU) if(NOT TARGET SUNDIALS::KLU) - add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU) + # For static-only builds of SuiteSparse, SuiteSparse::KLU will itself be + # an ALIAS target which can't be aliased. + get_target_property(klu_aliased_target SuiteSparse::KLU ALIASED_TARGET) + if(klu_aliased_target) + add_library(SUNDIALS::KLU ALIAS ${klu_aliased_target}) + else() + add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU) + endif() set(KLU_SUITESPARSE_TARGET ON) mark_as_advanced(KLU_SUITESPARSE_TARGET) endif() diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index fc2568901e..015e111fb9 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -35,4 +35,7 @@ repeatedly. Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. +Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when +using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. + **Deprecation Notices** From 271c0ed6cc60e723b49d12f8254b530975cc53a7 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Tue, 1 Oct 2024 21:48:04 -0700 Subject: [PATCH 106/137] CI: add magic /autofix ability for PRs (#577) Comment `/autofix` on your PR and a GitHub action will fix the spelling, formatting, and swig errors. --- .github/actions/apply-style/checkout.sh | 45 ++++++++++++++ .github/workflows/check-format.yml | 54 ++++++++++++++++- .github/workflows/check-spelling.yml | 54 ++++++++++++++++- .github/workflows/check-swig.yml | 59 +++++++++++++++++-- .github/workflows/spack-develop.yml | 4 +- .github/workflows/ubuntu-latest.yml | 4 +- doc/superbuild/source/developers/index.rst | 6 ++ .../developers/pull_requests/OpenPR.rst | 11 +++- .../developers/style_guide/SourceCode.rst | 4 +- 9 files changed, 228 insertions(+), 13 deletions(-) create mode 100755 .github/actions/apply-style/checkout.sh diff --git a/.github/actions/apply-style/checkout.sh b/.github/actions/apply-style/checkout.sh new file mode 100755 index 0000000000..34a6f15b43 --- /dev/null +++ b/.github/actions/apply-style/checkout.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +### +# Attempt to find the branch of the PR from the detached head state +## + +echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" +echo "Attempting to find branch that matches commit..." + +# Get the current commit SHA +current_commit_sha=$(git rev-parse HEAD) +# List all branches containing the current commit SHA +branches=$(git branch -r --contains $current_commit_sha) + +echo "all branches:" +echo "$(git branch -a)" +echo "branches with SHA $current_commit_sha:" +echo "$branches" + +# Loop over the string split by whitespace +branch="" +num_branches_found=0 +for _possible_branch in $branches; do + # Skip items that start with "pull/" + if [[ $_possible_branch == pull/* ]]; then + continue + fi + if [[ $_possible_branch == origin/* ]]; then + _possible_branch=$(echo "$_possible_branch" | sed 's/origin\///') + fi + echo "Possible Branch: $_possible_branch" + branch=$_possible_branch + num_branches_found=$((num_branches_found+1)) +done + +if [ "$num_branches_found" -ne 1 ]; then + echo "Error: Unable to find a single branch that matched git sha $current_commit_sha" + exit 1 +fi + +echo "Found branch: $branch" +echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + +git checkout $branch +git submodule update --init --recursive diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index b3d0850ca9..d052dfec97 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -3,9 +3,12 @@ name: Checks - formatting on: pull_request: workflow_dispatch: + issue_comment: + types: [created] jobs: format_check: + if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} runs-on: ubuntu-latest container: image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack @@ -37,10 +40,18 @@ jobs: run: clang-format --version - name: Check out repository code + if: github.event_name != 'issue_comment' uses: actions/checkout@v4 with: submodules: true + - name: Check out repository code + if: github.event_name == 'issue_comment' + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + - name: Add safe directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -56,9 +67,50 @@ jobs: run: /usr/bin/git diff > format.patch - name: Archive diff as a patch if we failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: format.patch path: | ${{ github.workspace }}/format.patch + + apply_format: + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} + needs: format_check + runs-on: ubuntu-latest + steps: + # Checkout the GitHub created reference for the PR. + # The only way to do this is by using the "issue" number + # but that is really the PR number in this context. + # This is due to using an `issue_comment` event which + # is due to the GitHub Actions API that does not have + # a `pull_request_comment` event or something similar. + # This leaves us in a detached head state which is corrected + # in `apply-style/checkout.sh` + - name: Checkout repository code + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + + - name: Checkout the right git ref + run: ./.github/actions/apply-style/checkout.sh + + - name: Download the git diff from format_check + uses: actions/download-artifact@v4 + with: + name: format.patch + + - name: Apply patch + run: | + git apply format.patch + rm format.patch + + - name: Commit fixes + run: | + git config user.name "format-robot" + git config user.email "no-reply@llnl.gov" + if [ -n "$(git status --porcelain)" ]; then + git commit -am 'apply format updates' + git push + fi diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 8825e58b06..16349e8891 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -3,9 +3,12 @@ name: Checks - spelling on: pull_request: workflow_dispatch: + issue_comment: + types: [created] jobs: spelling_check: + if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} runs-on: ubuntu-latest steps: - name: Install python3-pip @@ -20,10 +23,18 @@ jobs: run: codespell --version - name: Check out repository code + if: github.event_name != 'issue_comment' uses: actions/checkout@v4 with: submodules: true + - name: Check out repository code + if: github.event_name == 'issue_comment' + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + - name: Run codespell run: | ./scripts/spelling.sh @@ -36,9 +47,50 @@ jobs: run: /usr/bin/git diff > spelling.patch - name: Archive diff as a patch if we failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: spelling.patch path: | ${{ github.workspace }}/spelling.patch + + apply_spelling: + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} + needs: spelling_check + runs-on: ubuntu-latest + steps: + # Checkout the GitHub created reference for the PR. + # The only way to do this is by using the "issue" number + # but that is really the PR number in this context. + # This is due to using an `issue_comment` event which + # is due to the GitHub Actions API that does not have + # a `pull_request_comment` event or something similar. + # This leaves us in a detached head state which is corrected + # in `apply-style/checkout.sh` + - name: Checkout repository code + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + + - name: Checkout the right git ref + run: ./.github/actions/apply-style/checkout.sh + + - name: Download the git diff from spelling_check + uses: actions/download-artifact@v4 + with: + name: spelling.patch + + - name: Apply patch + run: | + git apply spelling.patch + rm spelling.patch + + - name: Commit fixes + run: | + git config user.name "format-robot" + git config user.email "no-reply@llnl.gov" + if [ -n "$(git status --porcelain)" ]; then + git commit -am 'apply spelling updates' + git push + fi diff --git a/.github/workflows/check-swig.yml b/.github/workflows/check-swig.yml index 2a4193a239..25a0bc16a2 100644 --- a/.github/workflows/check-swig.yml +++ b/.github/workflows/check-swig.yml @@ -3,11 +3,13 @@ name: Checks - swig on: pull_request: workflow_dispatch: + issue_comment: + types: [created] jobs: - swig: + swig_check: + if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} runs-on: ubuntu-latest - steps: - name: Install swig run: | @@ -15,15 +17,23 @@ jobs: cd swig ./autogen.sh ./configure --prefix=/usr/ - make + make sudo make install swig -version - name: Check out repository code + if: github.event_name != 'issue_comment' uses: actions/checkout@v4 with: submodules: true + - name: Check out repository code + if: github.event_name == 'issue_comment' + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + - name: Add safe directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" @@ -41,9 +51,50 @@ jobs: run: /usr/bin/git diff > swig.patch - name: Archive diff as a patch if we failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: swig.patch path: | ${{ github.workspace }}/swig.patch + + apply_swig: + if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} + needs: swig_check + runs-on: ubuntu-latest + steps: + # Checkout the GitHub created reference for the PR. + # The only way to do this is by using the "issue" number + # but that is really the PR number in this context. + # This is due to using an `issue_comment` event which + # is due to the GitHub Actions API that does not have + # a `pull_request_comment` event or something similar. + # This leaves us in a detached head state which is corrected + # in `apply-style/checkout.sh` + - name: Checkout repository code + uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + + - name: Checkout the right git ref + run: ./.github/actions/apply-style/checkout.sh + + - name: Download the git diff from swig_check + uses: actions/download-artifact@v4 + with: + name: swig.patch + + - name: Apply patch + run: | + git apply swig.patch + rm swig.patch + + - name: Commit fixes + run: | + git config user.name "format-robot" + git config user.email "no-reply@llnl.gov" + if [ -n "$(git status --porcelain)" ]; then + git commit -am 'apply swig updates' + git push + fi diff --git a/.github/workflows/spack-develop.yml b/.github/workflows/spack-develop.yml index 41f312164f..adf15d2de3 100644 --- a/.github/workflows/spack-develop.yml +++ b/.github/workflows/spack-develop.yml @@ -33,7 +33,7 @@ jobs: indexsize: ${{ matrix.indexsize }} precision: ${{ matrix.precision }} - name: Archive build files from failed build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: build_files @@ -41,7 +41,7 @@ jobs: ${{ github.workspace }}/test/build_* !${{ github.workspace }}/test/build_*/Testing/output - name: Archive output files from failed build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: output_files diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 0bc9ab7510..9b83c16c30 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -52,7 +52,7 @@ jobs: env: CMAKE_BUILD_TYPE: ${{ matrix.buildtype }} - name: Archive build files from failed build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: build_files @@ -60,7 +60,7 @@ jobs: ${{ github.workspace }}/test/build_* !${{ github.workspace }}/test/build_*/Testing/output - name: Archive output files from failed build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: output_files diff --git a/doc/superbuild/source/developers/index.rst b/doc/superbuild/source/developers/index.rst index b0737c8792..9b1d381e1d 100644 --- a/doc/superbuild/source/developers/index.rst +++ b/doc/superbuild/source/developers/index.rst @@ -23,6 +23,12 @@ integration packages CVODE, IDA, and ARKODE, the sensitivity analysis enabled va IDAS, and the nonlinear solver package KINSOL. This is the part of the SUNDIALS documentation is meant for SUNDIALS developers. +.. note:: + + New SUNDIALS developers should review this developer guide. In particular, the + :ref:`Style` section should be *carefully* read. + + .. toctree:: :maxdepth: 1 diff --git a/doc/superbuild/source/developers/pull_requests/OpenPR.rst b/doc/superbuild/source/developers/pull_requests/OpenPR.rst index 71ddd39ee1..f7e4f8e0a8 100644 --- a/doc/superbuild/source/developers/pull_requests/OpenPR.rst +++ b/doc/superbuild/source/developers/pull_requests/OpenPR.rst @@ -45,8 +45,17 @@ merged, delete the local copy the branch: $ git branch -D <branch-name> +.. note:: + + When you open a PR, various "checks" will run on your code. You can see the status of these + checks at the bottom of the PR page on GitHub. Any fixes needed to pass the checks for + formatting, spelling, and SWIG updates can be automatically addressed by leaving a comment + ``/autofix``. Checks that build the code, run more extensive tests, etc., will not automatically + be fixed. + + .. warning:: Almost all pull requests should be issued against the ``develop`` branch. Generally, the only branches we merge to ``main`` are special PRs to synchronize - ``develop`` and ``main``. \ No newline at end of file + ``develop`` and ``main``. diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index ba5a9c4ff8..022cffbc7e 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -402,8 +402,8 @@ can run: The output of ``clang-format`` is sensitive to the ``clang-format`` version. We recommend that you use version ``17.0.4``, which can be installed from source or with Spack. Alternatively, when you open a pull request on GitHub, an action will run ``clang-format`` on the code. If any - formatting is required, the action will fail and produce a git patch artifact that you can download - (from the job artifacts section) and apply with ``git apply``. + formatting is required, the action will fail. Commenting with the magic keyword ``/autofix`` will + kick off a GitHub action which will automatically apply the formatting changes needed. If clang-format breaks lines in a way that is unreadable, use ``//`` to break the line. For example, sometimes (mostly in C++ code) you may have code like this: From 04525fd54de8cf5d7f7e72f2b4bca454127bf785 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 2 Oct 2024 06:49:39 -0700 Subject: [PATCH 107/137] Maintenance: dependabot target (#585) Tell dependabot to target develop instead of `main` --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index df4d15b35c..3bc7efbf9d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,4 @@ updates: schedule: # Check for updates to GitHub Actions every week interval: "weekly" + target-branch: "develop" From a549e93341e3e21b544478d9ef82c1a08a794d22 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Thu, 3 Oct 2024 07:19:55 -0700 Subject: [PATCH 108/137] Docs: Fix orderd list indentation (#586) Fix indentation so the ordered list is enumerated correctly --- doc/shared/sundials/SUNContext.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/shared/sundials/SUNContext.rst b/doc/shared/sundials/SUNContext.rst index 18b1bf050d..de5c4d05d5 100644 --- a/doc/shared/sundials/SUNContext.rst +++ b/doc/shared/sundials/SUNContext.rst @@ -187,7 +187,7 @@ Applications that need to have *concurrently initialized* SUNDIALS simulations need to take care to understand the following: #. A :c:type:`SUNContext` object must only be associated with *one* SUNDIALS simulation -(a solver object and its associated vectors etc.) at a time. + (a solver object and its associated vectors etc.) at a time. - Concurrently initialized is not the same as concurrently executing. Even if two SUNDIALS simulations execute sequentially, if both are initialized @@ -199,7 +199,7 @@ need to take care to understand the following: destroyed. #. The creation and destruction of a :c:type:`SUNContext` object is cheap, especially -in comparison to the cost of creating/destroying a SUNDIALS solver object. + in comparison to the cost of creating/destroying a SUNDIALS solver object. The following (incomplete) code examples demonstrate these points using CVODE as the example SUNDIALS package. From a1bc87904dc7970abe453afc9f65914cb3ad91ee Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 4 Oct 2024 09:45:27 -0700 Subject: [PATCH 109/137] Bugfix/sparse add i (#584) Fixes https://github.com/LLNL/sundials/issues/581 The new implementation eliminates all temporary storage/mallocs and only traverses the matrix entries once when diagonal elements don't need to be added. The sparse matrix example shows about a 1.5x speedup on 50000x50000 matrices. --- CHANGELOG.md | 4 + benchmarks/nvector/test_nvector_performance.c | 6 +- doc/shared/Changelog.rst | 38 +-- doc/shared/RecentChanges.rst | 8 +- examples/nvector/test_nvector.c | 6 +- examples/sunlinsol/test_sunlinsol.c | 8 +- examples/sunmatrix/test_sunmatrix.c | 8 +- src/sunmatrix/sparse/sunmatrix_sparse.c | 243 +++--------------- 8 files changed, 84 insertions(+), 237 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82e24b6382..138ba4ada0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ specific linker flags e.g., MKL. ### Bug Fixes +Fixed a [bug](https://github.com/LLNL/sundials/issues/581) in the sparse matrix +implementation of `SUNMatScaleAddI` which caused out of bounds writes unless +`indexvals` were in ascending order for each row/column. + Fixed `ARKodeResize` not using the default `hscale` when an argument of `0` was provided. diff --git a/benchmarks/nvector/test_nvector_performance.c b/benchmarks/nvector/test_nvector_performance.c index 36224a9c38..c0f0870da2 100644 --- a/benchmarks/nvector/test_nvector_performance.c +++ b/benchmarks/nvector/test_nvector_performance.c @@ -43,7 +43,7 @@ static void time_stats(N_Vector X, double* times, int start, int ntimes, int print_time = 0; /* flag for printing timing data */ int nwarmups = 1; /* number of extra tests to perform and ignore in average */ -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) time_t base_time_tv_sec = 0; /* Base time; makes time values returned by get_time easier to read when printed since they will be zero @@ -2723,7 +2723,7 @@ void SetNumWarmups(int num_warmups) void SetTiming(int onoff, int myid) { -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); base_time_tv_sec = spec.tv_sec; @@ -2812,7 +2812,7 @@ void rand_realtype_constraints(sunrealtype* data, sunindextype len) static double get_time(void) { double time; -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); time = (double)(spec.tv_sec - base_time_tv_sec) + diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index bc9d5c1ad9..2824b85a83 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -31,7 +31,7 @@ Changes to SUNDIALS in release 7.1.1 **Bug Fixes** -Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`_ in v7.1.0 with the +Fixed a `bug <https://github.com/LLNL/sundials/pull/523>`__ in v7.1.0 with the SYCL N_Vector ``N_VSpace`` function. Changes to SUNDIALS in release 7.1.0 @@ -109,11 +109,11 @@ to ``SYCL`` to match Ginkgo's updated naming convention. Changed the CMake version compatibility mode for SUNDIALS to ``AnyNewerVersion`` instead of ``SameMajorVersion``. This fixes the issue seen `here -<https://github.com/AMReX-Codes/amrex/pull/3835>`_. +<https://github.com/AMReX-Codes/amrex/pull/3835>`__. Fixed a CMake bug that caused an MPI linking error for our C++ examples in some instances. Fixes `GitHub Issue #464 -<https://github.com/LLNL/sundials/issues/464>`_. +<https://github.com/LLNL/sundials/issues/464>`__. Fixed the runtime library installation path for windows systems. This fix changes the default library installation path from @@ -134,11 +134,11 @@ Fixed a bug in the HIP execution policies where ``WARP_SIZE`` would not be set with ROCm 6.0.0 or newer. Fixed a bug that caused error messages to be cut off in some cases. Fixes -`GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`_. +`GitHub Issue #461 <https://github.com/LLNL/sundials/issues/461>`__. Fixed a memory leak when an error handler was added to a :c:type:`SUNContext`. Fixes `GitHub Issue #466 -<https://github.com/LLNL/sundials/issues/466>`_. +<https://github.com/LLNL/sundials/issues/466>`__. Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error produced from evolving the inner stepper. @@ -187,7 +187,7 @@ be built with additional error checking by default. See SUNDIALS now requires using a compiler that supports a subset of the C99 standard. Note with the Microsoft C/C++ compiler the subset of C99 features utilized by SUNDIALS are available starting with `Visual Studio 2015 -<https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`_. +<https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170#c-standard-library-features-1>`__. *Minimum CMake Version* @@ -297,7 +297,7 @@ and a typedef to a ``MPI_Comm`` in builds with MPI. As a result: The change away from type-erased pointers for :c:type:`SUNComm` fixes problems like the one described in -`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`_. +`GitHub Issue #275 <https://github.com/LLNL/sundials/issues/275>`__. The SUNLogger is now always MPI-aware if MPI is enabled in SUNDIALS and the ``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option and macro definition were removed @@ -358,12 +358,12 @@ interface. **Bug Fixes** -Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so +Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`__ so that C++20 aggregate initialization can be used. Fixed integer overflow in the internal SUNDIALS hashmap. This resolves -`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`_ and -`#249 <https://github.com/LLNL/sundials/issues/249>`_. +`GitHub Issues #409 <https://github.com/LLNL/sundials/issues/409>`__ and +`#249 <https://github.com/LLNL/sundials/issues/249>`__. **Deprecation Notice** @@ -431,7 +431,7 @@ an :c:type:`MRIStepInnerFullRhsFn` optional. **Bug Fixes** Changed the :c:type:`SUNProfiler` so that it does not rely on ``MPI_WTime`` in -any case. This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`_. +any case. This fixes `GitHub Issue #312 <https://github.com/LLNL/sundials/issues/312>`__. Fixed scaling bug in ``SUNMatScaleAddI_Sparse`` for non-square matrices. @@ -587,7 +587,7 @@ Added support for the SYCL backend with RAJA 2022.x.y. **Bug Fixes** Fixed an underflow bug during root finding in ARKODE, CVODE, CVODES, IDA and -IDAS. This fixes `GitHub Issue #57 <https://github.com/LLNL/sundials/issues/57>`_. +IDAS. This fixes `GitHub Issue #57 <https://github.com/LLNL/sundials/issues/57>`__. Fixed an issue with finding oneMKL when using the ``icpx`` compiler with the ``-fsycl`` flag as the C++ compiler instead of ``dpcpp``. @@ -624,13 +624,13 @@ e.g., CUDA, HIP, RAJA, Trilinos, SuperLU_DIST, MAGMA, Ginkgo, and Kokkos. **Major Features** -Added support for the `Ginkgo <https://ginkgo-project.github.io/>`_ linear +Added support for the `Ginkgo <https://ginkgo-project.github.io/>`__ linear algebra library. This support includes new SUNDIALS matrix and linear solver implementations, see the sections :numref:`SUNMatrix.Ginkgo` and :numref:`SUNLinSol.Ginkgo`. Added new SUNDIALS vector, dense matrix, and dense linear solver implementations -utilizing the `Kokkos Ecosystem <https://kokkos.org/>`_ for performance +utilizing the `Kokkos Ecosystem <https://kokkos.org/>`__ for performance portability, see sections :numref:`NVectors.Kokkos`, :numref:`SUNMatrix.Kokkos`, and :numref:`SUNLinSol.Kokkos` for more information. @@ -702,7 +702,7 @@ functions when they are available and the user may provide the math library to link to via the advanced CMake option :cmakeop:`SUNDIALS_MATH_LIBRARY`. Changed ``SUNDIALS_LOGGING_ENABLE_MPI`` CMake option default to be ``OFF``. This -fixes `GitHub Issue #177 <https://github.com/LLNL/sundials/issues/177>`_. +fixes `GitHub Issue #177 <https://github.com/LLNL/sundials/issues/177>`__. Changes to SUNDIALS in release 6.2.0 ==================================== @@ -1052,7 +1052,7 @@ namespace. A capability to profile/instrument SUNDIALS library code has been added. This can be enabled with the CMake option :cmakeop:`SUNDIALS_BUILD_WITH_PROFILING`. A built-in profiler will be used by default, but the `Caliper -<https://github.com/LLNL/Caliper>`_ library can also be used instead with the +<https://github.com/LLNL/Caliper>`__ library can also be used instead with the CMake option :cmakeop:`ENABLE_CALIPER`. See the documentation section on profiling for more details. @@ -2656,7 +2656,7 @@ these vectors both move all data to the GPU device upon construction, and speedup will only be realized if the user also conducts the right-hand-side function evaluation on the device. In addition, these vectors assume the problem fits on one GPU. For further information about RAJA, users are referred to the -`RAJA web site <https://software.llnl.gov/RAJA/>`_. +`RAJA web site <https://software.llnl.gov/RAJA/>`__. Added the type :c:type:`sunindextype` to support using 32-bit or 64-bit integer types for indexing arrays within all SUNDIALS structures. :c:type:`sunindextype` @@ -2680,11 +2680,11 @@ The file ``include/sundials_fconfig.h`` was added. This file contains SUNDIALS type information for use in Fortran programs. Added support for many xSDK-compliant build system keys. For more information on -on xSDK compliance the `xSDK policies <https://xsdk.info/policies/>`_. The xSDK +on xSDK compliance the `xSDK policies <https://xsdk.info/policies/>`__. The xSDK is a movement in scientific software to provide a foundation for the rapid and efficient production of high-quality, sustainable extreme-scale scientific applications. For more information visit the -`xSDK web site <https://xsdk.info>`_. +`xSDK web site <https://xsdk.info>`__. Added functions :c:func:`SUNDIALSGetVersion` and :c:func:`SUNDIALSGetVersionNumber` to get SUNDIALS release version information diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 015e111fb9..6965215f07 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -21,8 +21,12 @@ specific linker flags e.g., MKL. **Bug Fixes** -Fixed c:func:`ARKodeResize` not using the default ``hscale`` when an argument of -``0`` was provided. +Fixed a `bug <https://github.com/LLNL/sundials/issues/581>`__ in the sparse +matrix implementation of :c:func:`SUNMatScaleAddI` which caused out of bounds +writes unless ``indexvals`` were in ascending order for each row/column. + +Fixed :c:func:`ARKodeResize` not using the default ``hscale`` when an argument +of ``0`` was provided. Fixed the loading of ARKStep's default first order explicit method. diff --git a/examples/nvector/test_nvector.c b/examples/nvector/test_nvector.c index 4cd581001a..a7d5741522 100644 --- a/examples/nvector/test_nvector.c +++ b/examples/nvector/test_nvector.c @@ -48,7 +48,7 @@ /* all tests need a SUNContext */ SUNContext sunctx = NULL; -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) static time_t base_time_tv_sec = 0; /* Base time; makes time values returned by get_time easier to read when printed since they will be zero @@ -5993,7 +5993,7 @@ int Test_N_VBufUnpack(N_Vector x, sunindextype local_length, int myid) void SetTiming(int onoff, int myid) { -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); base_time_tv_sec = spec.tv_sec; @@ -6016,7 +6016,7 @@ void SetTiming(int onoff, int myid) static double get_time(void) { double time; -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); time = (double)(spec.tv_sec - base_time_tv_sec) + diff --git a/examples/sunlinsol/test_sunlinsol.c b/examples/sunlinsol/test_sunlinsol.c index 2a6900e666..cec2cc9648 100644 --- a/examples/sunlinsol/test_sunlinsol.c +++ b/examples/sunlinsol/test_sunlinsol.c @@ -27,7 +27,7 @@ #include <sundials/sundials_math.h> #include <sundials/sundials_types.h> -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) #include <time.h> #include <unistd.h> #endif @@ -519,7 +519,7 @@ int Test_SUNLinSolSolve(SUNLinearSolver S, SUNMatrix A, N_Vector x, N_Vector b, * Private functions * ====================================================================*/ -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) time_t base_time_tv_sec = 0; /* Base time; makes time values returned by get_time easier to read when printed since they will be zero @@ -531,7 +531,7 @@ void SetTiming(int onoff) { print_time = onoff; -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); base_time_tv_sec = spec.tv_sec; @@ -543,7 +543,7 @@ void SetTiming(int onoff) * --------------------------------------------------------------------*/ static double get_time(void) { -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); double time = (double)(spec.tv_sec - base_time_tv_sec) + diff --git a/examples/sunmatrix/test_sunmatrix.c b/examples/sunmatrix/test_sunmatrix.c index 9849e308b2..47b2cf9296 100644 --- a/examples/sunmatrix/test_sunmatrix.c +++ b/examples/sunmatrix/test_sunmatrix.c @@ -27,7 +27,7 @@ #include <sundials/sundials_matrix.h> #include <sundials/sundials_types.h> -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) #include <time.h> #include <unistd.h> #endif @@ -611,7 +611,7 @@ int Test_SUNMatSpace(SUNMatrix A, int myid) * Private functions * ====================================================================*/ -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) time_t base_time_tv_sec = 0; /* Base time; makes time values returned by get_time easier to read when printed since they will be zero @@ -623,7 +623,7 @@ void SetTiming(int onoff) { print_time = onoff; -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); base_time_tv_sec = spec.tv_sec; @@ -637,7 +637,7 @@ void SetPrintAllRanks(int onoff) { print_all_ranks = onoff; } * --------------------------------------------------------------------*/ static double get_time(void) { -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) && defined(_POSIX_TIMERS) +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); double time = (double)(spec.tv_sec - base_time_tv_sec) + diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index bbdbc344d2..89a1ca576a 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -2,6 +2,7 @@ * ----------------------------------------------------------------- * Programmer(s): Daniel Reynolds @ SMU * David Gardner @ LLNL + * Steven B. Roberts @ LLNL * Based on code sundials_sparse.c by: Carol Woodward and * Slaven Peles @ LLNL, and Daniel R. Reynolds @ SMU * ----------------------------------------------------------------- @@ -623,234 +624,72 @@ SUNErrCode SUNMatCopy_Sparse(SUNMatrix A, SUNMatrix B) SUNErrCode SUNMatScaleAddI_Sparse(sunrealtype c, SUNMatrix A) { - sunindextype j, i, p, nz, newvals, M, N, cend, nw; - sunbooleantype newmat, found; - sunindextype *w, *Ap, *Ai, *Cp, *Ci; - sunrealtype *x, *Ax, *Cx; - SUNMatrix C; SUNFunctionBegin(A->sunctx); + const sunindextype N = SM_SPARSETYPE_S(A) == CSC_MAT ? SM_COLUMNS_S(A) + : SM_ROWS_S(A); + const sunindextype M = SM_SPARSETYPE_S(A) == CSC_MAT ? SM_ROWS_S(A) + : SM_COLUMNS_S(A); - /* store shortcuts to matrix dimensions (M is inner dimension, N is outer) */ - if (SM_SPARSETYPE_S(A) == CSC_MAT) - { - M = SM_ROWS_S(A); - N = SM_COLUMNS_S(A); - } - else - { - M = SM_COLUMNS_S(A); - N = SM_ROWS_S(A); - } - - /* access data arrays from A */ - Ap = NULL; - Ai = NULL; - Ax = NULL; - Ap = SM_INDEXPTRS_S(A); + sunindextype* Ap = SM_INDEXPTRS_S(A); SUNAssert(Ap, SUN_ERR_ARG_CORRUPT); - Ai = SM_INDEXVALS_S(A); + sunindextype* Ai = SM_INDEXVALS_S(A); SUNAssert(Ai, SUN_ERR_ARG_CORRUPT); - Ax = SM_DATA_S(A); + sunrealtype* Ax = SM_DATA_S(A); SUNAssert(Ax, SUN_ERR_ARG_CORRUPT); - /* determine if A: contains values on the diagonal (so I can just be added - in); if not, then increment counter for extra storage that should be - required. */ - newvals = 0; - for (j = 0; j < SUNMIN(M, N); j++) + sunindextype newvals = 0; + for (sunindextype j = 0; j < N; j++) { /* scan column (row if CSR) of A, searching for diagonal value */ - found = SUNFALSE; - for (i = Ap[j]; i < Ap[j + 1]; i++) + sunbooleantype found = SUNFALSE; + for (sunindextype i = Ap[j]; i < Ap[j + 1]; i++) { if (Ai[i] == j) { found = SUNTRUE; - break; + Ax[i] = ONE + c * Ax[i]; } + else { Ax[i] *= c; } } - /* if no diagonal found, increment necessary storage counter */ - if (!found) { newvals += 1; } + /* If no diagonal element found and the current column (row) can actually + * contain a diagonal element, increment the storage counter */ + if (!found && j < M) { newvals++; } } - /* If extra nonzeros required, check whether matrix has sufficient storage - space for new nonzero entries (so I can be inserted into existing storage) - */ - newmat = SUNFALSE; /* no reallocation needed */ - if (newvals > (SM_NNZ_S(A) - Ap[N])) { newmat = SUNTRUE; } - - /* perform operation based on existing/necessary structure */ - - /* case 1: A already contains a diagonal */ - if (newvals == 0) + /* At this point, A has the correctly updated values except for any new + * diagonal elements that need to be added (of which there are newvals). Now, + * we allocate additional storage if needed */ + const sunindextype new_nnz = Ap[N] + newvals; + if (new_nnz > SM_NNZ_S(A)) { - /* iterate through columns, adding 1.0 to diagonal */ - for (j = 0; j < SUNMIN(M, N); j++) - { - for (i = Ap[j]; i < Ap[j + 1]; i++) - { - if (Ai[i] == j) { Ax[i] = ONE + c * Ax[i]; } - else { Ax[i] = c * Ax[i]; } - } - } - - /* case 2: A has sufficient storage, but does not already contain a - * diagonal */ + SUNCheckCall(SUNSparseMatrix_Reallocate(A, new_nnz)); + Ap = SM_INDEXPTRS_S(A); + Ai = SM_INDEXVALS_S(A); + Ax = SM_DATA_S(A); } - else if (!newmat) - { - /* create work arrays for nonzero row (column) indices and values in a - * single column (row) */ - w = (sunindextype*)malloc(M * sizeof(sunindextype)); - SUNAssert(w, SUN_ERR_MALLOC_FAIL); - x = (sunrealtype*)malloc(M * sizeof(sunrealtype)); - SUNAssert(x, SUN_ERR_MALLOC_FAIL); - /* determine storage location where last column (row) should end */ - nz = Ap[N] + newvals; - - /* store pointer past last column (row) from original A, - and store updated value in revised A */ - cend = Ap[N]; - Ap[N] = nz; - - /* iterate through columns (rows) backwards */ - for (j = N - 1; j >= 0; j--) + for (sunindextype j = N - 1; newvals > 0; j--) + { + sunbooleantype found = SUNFALSE; + for (sunindextype i = Ap[j + 1] - 1; i >= Ap[j]; i--) { - /* reset diagonal entry, in case it's not in A */ - x[j] = ZERO; - - /* iterate down column (row) of A, collecting nonzeros */ - for (p = Ap[j], i = 0; p < cend; p++, i++) - { - w[i] = Ai[p]; /* collect row (column) index */ - x[Ai[p]] = c * Ax[p]; /* collect/scale value */ - } + if (Ai[i] == j) { found = SUNTRUE; } - /* NNZ in this column (row) */ - nw = cend - Ap[j]; - - /* add identity to this column (row) */ - if (j < M) { x[j] += ONE; /* update value */ } - - /* fill entries of A with this column's (row's) data */ - /* fill entries past diagonal */ - for (i = nw - 1; i >= 0 && w[i] > j; i--) - { - Ai[--nz] = w[i]; - Ax[nz] = x[w[i]]; - } - /* fill diagonal if applicable */ - if (i < 0 /* empty or insert at front */ || - w[i] != j /* insert behind front */) - { - Ai[--nz] = j; - Ax[nz] = x[j]; - } - /* fill entries before diagonal */ - for (; i >= 0; i--) - { - Ai[--nz] = w[i]; - Ax[nz] = x[w[i]]; - } - - /* store ptr past this col (row) from orig A, update value for new A */ - cend = Ap[j]; - Ap[j] = nz; + /* Shift elements to make room for diagonal elements */ + Ai[i + newvals] = Ai[i]; + Ax[i + newvals] = Ax[i]; } - /* clean up */ - free(w); - free(x); - - /* case 3: A must be reallocated with sufficient storage */ - } - else - { - /* create work array for nonzero values in a single column (row) */ - x = (sunrealtype*)malloc(M * sizeof(sunrealtype)); - - /* create new matrix for sum */ - C = SUNSparseMatrix(SM_ROWS_S(A), SM_COLUMNS_S(A), Ap[N] + newvals, - SM_SPARSETYPE_S(A), A->sunctx); - SUNCheckLastErr(); - - /* access data from CSR structures (return if failure) */ - Cp = NULL; - Ci = NULL; - Cx = NULL; - Cp = SM_INDEXPTRS_S(C); - SUNAssert(Cp, SUN_ERR_ARG_CORRUPT); - Ci = SM_INDEXVALS_S(C); - SUNAssert(Ci, SUN_ERR_ARG_CORRUPT); - Cx = SM_DATA_S(C); - SUNAssert(Cx, SUN_ERR_ARG_CORRUPT); - - /* initialize total nonzero count */ - nz = 0; - - /* iterate through columns (rows for CSR) */ - for (j = 0; j < N; j++) + Ap[j + 1] += newvals; + if (!found && j < M) { - /* set current column (row) pointer to current # nonzeros */ - Cp[j] = nz; - - /* reset diagonal entry, in case it's not in A */ - x[j] = ZERO; - - /* iterate down column (along row) of A, collecting nonzeros */ - for (p = Ap[j]; p < Ap[j + 1]; p++) - { - x[Ai[p]] = c * Ax[p]; /* collect/scale value */ - } - - /* add identity to this column (row) */ - if (j < M) { x[j] += ONE; /* update value */ } - - /* fill entries of C with this column's (row's) data */ - /* fill entries before diagonal */ - for (p = Ap[j]; p < Ap[j + 1] && Ai[p] < j; p++) - { - Ci[nz] = Ai[p]; - Cx[nz++] = x[Ai[p]]; - } - /* fill diagonal if applicable */ - if (p >= Ap[j + 1] /* empty or insert at end */ || - Ai[p] != j /* insert before end */) - { - Ci[nz] = j; - Cx[nz++] = x[j]; - } - /* fill entries past diagonal */ - for (; p < Ap[j + 1]; p++) - { - Ci[nz] = Ai[p]; - Cx[nz++] = x[Ai[p]]; - } + /* This column (row) needs a diagonal element added */ + newvals--; + Ai[Ap[j] + newvals] = j; + Ax[Ap[j] + newvals] = ONE; } - - /* indicate end of data */ - Cp[N] = nz; - - /* update A's structure with C's values; nullify C's pointers */ - SM_NNZ_S(A) = SM_NNZ_S(C); - - if (SM_DATA_S(A)) { free(SM_DATA_S(A)); } - SM_DATA_S(A) = SM_DATA_S(C); - SM_DATA_S(C) = NULL; - - if (SM_INDEXVALS_S(A)) { free(SM_INDEXVALS_S(A)); } - SM_INDEXVALS_S(A) = SM_INDEXVALS_S(C); - SM_INDEXVALS_S(C) = NULL; - - if (SM_INDEXPTRS_S(A)) { free(SM_INDEXPTRS_S(A)); } - SM_INDEXPTRS_S(A) = SM_INDEXPTRS_S(C); - SM_INDEXPTRS_S(C) = NULL; - - /* clean up */ - SUNMatDestroy_Sparse(C); - free(x); } + return SUN_SUCCESS; } From 1770cd765ce1faf3c3de27b1f2e224ef6b2a33dd Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 8 Oct 2024 08:43:24 -0700 Subject: [PATCH 110/137] Doc: Add Function Documentation Style Guide (#588) Some recent PRs have included comments about stylistic inconsistencies in the documentation. This PR adds a style guide for documenting user-callable and user-supplied functions to hopefully reduce this kind of traffic in future PRs. --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- doc/superbuild/source/conf.py | 11 +- .../developers/style_guide/Documentation.rst | 282 ++++++++++++++++-- 2 files changed, 271 insertions(+), 22 deletions(-) diff --git a/doc/superbuild/source/conf.py b/doc/superbuild/source/conf.py index 2a6fe2431c..5a4a6414b1 100644 --- a/doc/superbuild/source/conf.py +++ b/doc/superbuild/source/conf.py @@ -27,9 +27,14 @@ # 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', 'sphinx.ext.graphviz', 'sphinx_sundials', - 'sphinx_toolbox.collapse'] + 'sphinx.ext.intersphinx', 'sphinxfortran.fortran_domain', + 'sphinxcontrib.bibtex', 'sphinx_copybutton', 'sphinx.ext.graphviz', + 'sphinx_sundials', 'sphinx_toolbox.collapse'] + +intersphinx_mapping = {"sphinx": ("https://www.sphinx-doc.org/en/master/", None),} + +# No non-external references will be resolved by intersphinx +intersphinx_disabled_reftypes = ["*"] # References bibtex_bibfiles = ['../../shared/sundials.bib'] diff --git a/doc/superbuild/source/developers/style_guide/Documentation.rst b/doc/superbuild/source/developers/style_guide/Documentation.rst index 63c9b294c1..92b6d02e86 100644 --- a/doc/superbuild/source/developers/style_guide/Documentation.rst +++ b/doc/superbuild/source/developers/style_guide/Documentation.rst @@ -127,28 +127,272 @@ All citations go into `doc/shared/sundials.bib`. TODO: add citation and reference key style. -Documenting Functions -===================== +User-Callable Functions +======================= -Adding New Functions --------------------- +Document user-callable functions with the :external+sphinx:rst:dir:`c:function` +or :external+sphinx:rst:dir:`cpp:function` directives, as appropriate. The +directive is followed by the C/C++ function signature. Under the signature +(skipping a line and indenting 3 spaces) provide a brief description of the +function followed by any information on its usage. When describing the function +parameters use ``:param <name>:``. If the function returns a specific set of +SUNDIALS error codes, describe the possible return values using ``:retval +<value>:`` for each value. Otherwise, use a single ``:returns:`` item to +describe the result of the function. If the function returns ``void``, a return +entry should not be included. Below we give two examples, the first returns an +error code (int) while the second is a constructor that returns an object +(pointer). -The documentation for new functions should include the ``.. versionadded::`` -directive at the end of the documentation text noting the *package version* -number in which the function was added. +.. code-block:: rst -Changes to Existing Functions ------------------------------ + .. c:function:: int SetFoo(param_type p1, param_type p2) -If the signature or behavior of a function changes in any release the -``.. versionchanged::`` directive should be added to the function documentation -noting the *package version* number in which the change happened and describing -the change. + Brief description of what the user-callable function does. -Deprecating Functions ---------------------- + Additional information about the function and its usage. -When a function is deprecated the ``.. deprecated::`` directive should be added -to the function documentation noting the *package version* number in which the -function was deprecated and describing what function should be used instead -if appropriate. + :param p1: description of the first parameter. + :param p2: description of the second parameter. + + :retval SUCCESS: under some conditions. + :retval FAILURE_1: under some other conditions. + :retval FAILURE_2: under yet some other conditions. + +.. code-block:: rst + + .. c:function:: FooObject CreateFooObject(param_type p1, param_type p2) + + Brief description of what the user-callable function does. + + Additional information about the function and its usage. + + :param p1: description of the first parameter. + :param p2: description of the second parameter. + + :returns: If successful some object, otherwise ``NULL``. + +When adding, updating, or deprecating a function, use the +:external+sphinx:rst:dir:`versionadded`, +:external+sphinx:rst:dir:`versionchanged`, or +:external+sphinx:rst:dir:`deprecated` directives with the placeholder version +number ``x.y.z`` after the return description. The release script will find and +replace all instances of ``x.y.z`` in the documentation with the actual release +number. When altering the behavior of a function or deprecating a function +include a description for the change under the directive (skipping a line and +indenting 3 spaces). For example, + +.. code-block:: rst + + .. versionadded:: x.y.z + +.. code-block:: rst + + .. versionchanged:: x.y.z + + Describe how the function behavior has changed from before. + +.. code-block:: rst + + .. deprecated:: x.y.z + + If a replacement function/procedure is available, describe what users + should do to replace the deprecated function e.g., cross reference the + function superseding this one or list the new steps to follow. Otherwise, + note the feature/capability is no longer supported/provided and, if + possible, state why this function was removed. + +If special attention needs to be drawn to some behavior, consideration, or +limitation of a function that could be overlooked in the description, use the +:external+sphinx:rst:dir:`note` or :external+sphinx:rst:dir:`warning` directives +as appropriate. These should be used sparingly to avoid diluting their impact. +For example, + +.. code-block:: rst + + .. note:: + + Something users should not over look e.g., a feature is only compatible + with a subset of methods. + +.. code-block:: rst + + .. warning:: + + Something critical users should be aware of e.g., performance impacts. + +Finally, at the end of the function documentation, you may include (a +non-trivial) example usage of the function and/or a list of example programs +that utilize the function. For example, + +.. code-block:: rst + + **Example usage:** + + .. code-block:: C + + /* Short code block demonstrating typical usage */ + + /* Create the object */ + FooObject foo_obj = CreateFooObject(p1, p2); + if (foo_obj == NULL) { return 1; } + + /* Attach the object to mem */ + int retval = SetFoo(mem, foo_obj); + if (retval != 0) { return 1; } + + /* Perform some actions */ + ... + + /* Destroy the object */ + retval = DestroyFooObject(&foo_obj); + if (retval != 0) { return 1; } + +.. code-block:: rst + + **Examples codes:** + + * ``examples/package/subdir/pkg_some_code.c`` + +Putting it all together, the rendered documentation should look like the +following. + +.. c:function:: int FooSetBar(void* foo_obj, int bar_value) + :nocontentsentry: + :noindexentry: + + This function sets the value of Bar in a FooObject. + + The default value for Bar is :math:`10`. An input value :math:`< 0` will + reset Bar to the default value. + + :param foo_obj: the FooObject. + :param bar_value: the value of Bar. + + :retval SUCCESS: if the value was successfully set. + :retval NULL_OBJ: if the ``foo_obj`` was ``NULL``. + + .. versionadded:: 1.1.0 + + .. versionchanged:: 2.0.0 + + The type of p1 was changed from ``unsigned int`` to ``int`` + + .. note:: + + Utilizing this capability requires building with Bar enabled. + + .. warning:: + + Setting values greater than 100 may degrade performance. + + **Example usage:** + + .. code-block:: C + + /* Create the object */ + void* foo_obj = CreateFooObject(p1, p2); + if (foo_obj == NULL) { return 1; } + + /* Update the value of Bar */ + int retval = FooSetBar(foo_obj, 50); + if (retval != 0) { return 1; } + + /* Perform some actions */ + ... + + **Examples codes:** + + * ``examples/package/subdir/pkg_foo_demo.c`` + + +User-Supplied Functions +======================= + +Document user-supplied functions with the :external+sphinx:rst:dir:`c:type` +directive. The directive is followed by the ``typedef`` for the function +pointer. The description of the function type mirrors the style used for +user-callable function with one exception. As :external+sphinx:rst:dir:`c:type` +does not currently support the ``param``, ``retval``, and ``returns`` fields, +these sections must be manually created. The style that follows is chosen to +reflect that of ``param``, ``retval``, and ``returns`` fields as much as +possible. Function parameters should be listed under a boldface "Parameters:" +section with the parameters in boldface and separated from their description by +an en-dash. As user-supplied functions typically return a ``int``, but specific +values are not required, a description of how the return value is interpreted +should be given under a boldface "Returns:" section (skipping a line and +indenting 2 spaces). If specific return values are required, these should be +documented similarly to the function parameters and listed under a boldface +"Return values:" section. If the function returns ``void``, a return section +should not be included. Below we give, two examples describing user-supplied +functions. + +.. code-block:: rst + + .. c:type:: int (*FooFn)(param_type p1, param_type p2) + + Brief description of what the user-provided function should do. + + Additional information about the function and its usage. + + **Parameters:** + + * **p1** -- description of the first parameter. + * **p2** -- description of the second parameter. + + **Returns:** + + A :c:type:`FooFn` function should return 0 if successful, a positive + value if a recoverable error occurred, or a negative value if an + unrecoverable error occurred. + +.. code-block:: rst + + .. c:type:: int (*BarFn)(param_type p1, param_type p2) + + Brief description of what the user-provided function should do. + + Additional information about the function and its usage. + + **Parameters:** + + * **p1** -- description of the first parameter. + * **p2** -- description of the second parameter. + + **Return values:** + + * **VALUE_1** -- under some circumstances. + * **VALUE_2** -- under some other circumstances. + +Other than the difference in the function parameter and return value sections +the remaining guidelines from the user-callable function documentation are the +same. Putting it all together, the rendered documentation should look like the +following. + +.. c:type:: int (*FooFn)(double* p1, double* p2) + :nocontentsentry: + :noindexentry: + + Brief description of what the user-provided function should do. + + Additional information about the function and its usage. + + **Parameters:** + + * **p1** -- the input array of values. + * **p2** -- the output array of values. + + **Returns:** + + A :c:type:`FooFn` function should return 0 if successful, a positive value + if a recoverable error occurred, or a negative value if an unrecoverable + error occurred. + + .. versionadded:: 2.2.0 + + .. note:: + + This function is required when using the Foo option. + + **Examples codes:** + + * ``examples/package/subdir/pkg_bar_demo.c`` From f7483ed9e30837253834ca5317bb93f75ce70c17 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 14 Oct 2024 10:17:22 -0700 Subject: [PATCH 111/137] CI: Add concurrency in format/swig/spelling checks (#591) Cancel running formatting, swing, and spelling checks on new pushes to prevent redundant failure messages --- .github/workflows/check-format.yml | 4 ++++ .github/workflows/check-spelling.yml | 4 ++++ .github/workflows/check-swig.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index d052dfec97..f96e3cdaf7 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -6,6 +6,10 @@ on: issue_comment: types: [created] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: format_check: if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml index 16349e8891..70da910142 100644 --- a/.github/workflows/check-spelling.yml +++ b/.github/workflows/check-spelling.yml @@ -6,6 +6,10 @@ on: issue_comment: types: [created] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: spelling_check: if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} diff --git a/.github/workflows/check-swig.yml b/.github/workflows/check-swig.yml index 25a0bc16a2..2f9fad653d 100644 --- a/.github/workflows/check-swig.yml +++ b/.github/workflows/check-swig.yml @@ -6,6 +6,10 @@ on: issue_comment: types: [created] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: swig_check: if: ${{ github.event_name != 'issue_comment' || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/autofix')) }} From 99215eeca696e2d8a37cd54e2dbc3220f5bf5c0b Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Tue, 15 Oct 2024 12:35:29 -0500 Subject: [PATCH 112/137] Bugfix: Erroneous deprecation warnings (#589) When moving the ARKODE user interface to a shared level and adding deprecation warnings to stepper-specific routines, some of the deprecation warnings seemed to have search/replace issues. This PR fixes those. --- include/arkode/arkode_erkstep.h | 30 +++++++++++++++--------------- include/arkode/arkode_mristep.h | 14 +++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index ed93a240b9..c40bab8112 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -109,7 +109,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetFiARKodeBounds instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, @@ -128,15 +128,15 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetMaxARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetIARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); @@ -144,7 +144,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") int ERKStepClearStopTime(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetFiARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); @@ -154,7 +154,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") int ERKStepSetNoInactiveRootWarn(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") int ERKStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepSetPostprocARKodeFn instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); @@ -163,11 +163,11 @@ int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, sunrealtype* tret, int itask); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetNumARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetARKodeAttempts instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); @@ -175,13 +175,13 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetActualIARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetLARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepGetCurrARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); @@ -206,7 +206,7 @@ int ERKStepWriteParameters(void* arkode_mem, FILE* fp); SUNDIALS_DEPRECATED_EXPORT_MSG( "use ERKStepGetCurrentButcherTable and ARKodeButcherTable_Write instead") int ERKStepWriteButcher(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ERKStepARKodeStats instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 000bae135a..7fa2219e1e 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -223,7 +223,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") int MRIStepSetLinear(void* arkode_mem, int timedepend); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") int MRIStepSetNonlinear(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetMaxARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); @@ -247,7 +247,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") int MRIStepClearStopTime(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetFiARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") int MRIStepSetRootDirection(void* arkode_mem, int* rootdir); @@ -255,7 +255,7 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") int MRIStepSetNoInactiveRootWarn(void* arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") int MRIStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepSetPostprocARKodeFn instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); @@ -294,9 +294,9 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetWorkSpace instead") int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetLARKode instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); @@ -335,13 +335,13 @@ int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, long int* nnfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetARKodeSolveFails instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J); -SUNDIALS_DEPRECATED_EXPORT_MSG("use MRIStepGetJacARKodes instead") +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinWorkSpace instead") int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, From 554fa923c8216662219f277c4ea50e9e5996c077 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 15 Oct 2024 12:58:53 -0700 Subject: [PATCH 113/137] Feature: ARKodeGetNumRhsEvals (#587) Add an ARKODE level function to get the number of RHS evaluations --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: Steven Roberts <roberts115@llnl.gov> --- CHANGELOG.md | 3 + .../kokkos/arkode_driver.cpp | 16 +++-- .../raja/arkode_driver.cpp | 16 +++-- .../source/Usage/ARKStep/User_callable.rst | 3 + .../source/Usage/ERKStep/User_callable.rst | 3 + .../source/Usage/MRIStep/User_callable.rst | 3 + .../source/Usage/SPRKStep/User_callable.rst | 3 + .../guide/source/Usage/User_callable.rst | 34 +++++++++++ doc/shared/RecentChanges.rst | 4 ++ .../ark_brusselator1D_task_local_nls.cpp | 10 ++-- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 24 ++++---- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 6 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 6 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 6 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 9 ++- .../ark_heat2D_hypre_pfmg_imex_--np_2_2.out | 3 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 15 +++-- .../ark_heat2D_hypre_pfmg_mri_--np_2_2.out | 3 +- .../ark_advection_diffusion_reaction.hpp | 28 +++++---- .../arkode/CXX_serial/ark_analytic_sys.cpp | 6 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 6 +- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 6 +- examples/arkode/CXX_serial/ark_pendulum.cpp | 7 ++- .../ark_brusselator1D_FEM_sludist.cpp | 6 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 6 +- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 6 +- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 6 +- .../C_manyvector/ark_brusselator1D_manyvec.c | 6 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 6 +- examples/arkode/C_openmp/ark_heat1D_omp.c | 6 +- .../C_openmpdev/ark_analytic_nonlin_ompdev.c | 4 +- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 6 +- .../ark_brusselator1D_task_local_nls.c | 10 ++-- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 6 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 6 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 6 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 12 ++-- examples/arkode/C_serial/ark_analytic.c | 6 +- examples/arkode/C_serial/ark_analytic_mels.c | 6 +- examples/arkode/C_serial/ark_brusselator.c | 6 +- examples/arkode/C_serial/ark_brusselator1D.c | 6 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 6 +- .../C_serial/ark_brusselator1D_imexmri.c | 12 ++-- .../arkode/C_serial/ark_brusselator1D_klu.c | 6 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 10 ++-- examples/arkode/C_serial/ark_brusselator_fp.c | 6 +- .../arkode/C_serial/ark_brusselator_mri.c | 10 ++-- .../C_serial/ark_conserved_exp_entropy_ark.c | 7 ++- .../C_serial/ark_conserved_exp_entropy_erk.c | 4 +- .../C_serial/ark_dissipated_exp_entropy.c | 7 ++- examples/arkode/C_serial/ark_heat1D.c | 6 +- examples/arkode/C_serial/ark_kpr_mri.c | 12 ++-- .../arkode/C_serial/ark_onewaycouple_mri.c | 10 ++-- .../C_serial/ark_robertson_constraints.c | 6 +- examples/arkode/C_serial/ark_robertson_root.c | 6 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 10 ++-- .../ark_analytic_complex_f2003.f90 | 3 +- .../F2003_custom/ark_brusselator1D_f2003.f90 | 3 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 14 +++-- .../F2003_parallel/ark_diag_kry_bbd_f2003.f90 | 20 +++++-- .../F2003_parallel/ark_diag_non_f2003.f90 | 8 +-- .../F2003_parallel/ark_heat2D_f2003.f90 | 10 +++- .../F2003_serial/ark_analytic_f2003.f90 | 7 +-- .../ark_bruss1D_FEM_klu_f2003.f90 | 10 +++- .../arkode/F2003_serial/ark_bruss_f2003.f90 | 10 +++- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 10 +++- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 7 ++- .../F2003_serial/ark_roberts_dnsL_f2003.f90 | 10 +++- .../F2003_serial/ark_roberts_dns_f2003.f90 | 10 +++- include/arkode/arkode.h | 2 + include/arkode/arkode_arkstep.h | 6 +- include/arkode/arkode_erkstep.h | 3 +- include/arkode/arkode_mristep.h | 5 +- include/arkode/arkode_sprkstep.h | 4 +- src/arkode/arkode.c | 1 + src/arkode/arkode_arkstep.c | 1 + src/arkode/arkode_arkstep_impl.h | 2 + src/arkode/arkode_arkstep_io.c | 51 ++++++++++++---- src/arkode/arkode_erkstep.c | 1 + src/arkode/arkode_erkstep_impl.h | 2 + src/arkode/arkode_erkstep_io.c | 39 ++++++++---- src/arkode/arkode_impl.h | 3 + src/arkode/arkode_io.c | 32 ++++++++++ src/arkode/arkode_mristep.c | 1 + src/arkode/arkode_mristep_impl.h | 2 + src/arkode/arkode_mristep_io.c | 51 ++++++++++++---- src/arkode/arkode_sprkstep.c | 1 + src/arkode/arkode_sprkstep_impl.h | 2 + src/arkode/arkode_sprkstep_io.c | 51 ++++++++++++---- src/arkode/fmod_int32/farkode_arkstep_mod.c | 32 +++++----- src/arkode/fmod_int32/farkode_arkstep_mod.f90 | 60 +++++++++---------- src/arkode/fmod_int32/farkode_erkstep_mod.c | 28 ++++----- src/arkode/fmod_int32/farkode_erkstep_mod.f90 | 52 ++++++++-------- src/arkode/fmod_int32/farkode_mod.c | 16 +++++ src/arkode/fmod_int32/farkode_mod.f90 | 30 ++++++++++ src/arkode/fmod_int32/farkode_mristep_mod.c | 32 +++++----- src/arkode/fmod_int32/farkode_mristep_mod.f90 | 60 +++++++++---------- src/arkode/fmod_int32/farkode_sprkstep_mod.c | 32 +++++----- .../fmod_int32/farkode_sprkstep_mod.f90 | 60 +++++++++---------- src/arkode/fmod_int64/farkode_arkstep_mod.c | 32 +++++----- src/arkode/fmod_int64/farkode_arkstep_mod.f90 | 60 +++++++++---------- src/arkode/fmod_int64/farkode_erkstep_mod.c | 28 ++++----- src/arkode/fmod_int64/farkode_erkstep_mod.f90 | 52 ++++++++-------- src/arkode/fmod_int64/farkode_mod.c | 16 +++++ src/arkode/fmod_int64/farkode_mod.f90 | 30 ++++++++++ src/arkode/fmod_int64/farkode_mristep_mod.c | 32 +++++----- src/arkode/fmod_int64/farkode_mristep_mod.f90 | 60 +++++++++---------- src/arkode/fmod_int64/farkode_sprkstep_mod.c | 32 +++++----- .../fmod_int64/farkode_sprkstep_mod.f90 | 60 +++++++++---------- test/answers | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 12 ++-- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 12 ++-- .../CXX_serial/ark_test_dahlquist_ark.cpp | 7 ++- .../CXX_serial/ark_test_dahlquist_erk.cpp | 4 +- .../CXX_serial/ark_test_dahlquist_mri.cpp | 7 ++- 115 files changed, 1070 insertions(+), 614 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 138ba4ada0..2aff004841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,9 @@ using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. ### Deprecation Notices +The ARKODE stepper specific functions to retrieve the number of right-hand side +function evaluations have been deprecated. Use `ARKodeGetNumRhsEvals` instead. + ## Changes to SUNDIALS in release 7.1.1 ### Bug Fixes diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 4f606bd7bf..8330eafb70 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -189,8 +189,10 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -392,8 +394,10 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -516,8 +520,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 420c9d63c9..fd59c98f87 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -190,8 +190,10 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -394,8 +396,10 @@ int EvolveProblemIMEX(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -519,8 +523,8 @@ int EvolveProblemExplicit(N_Vector y, UserData* udata, UserOptions* uopt) check_retval(&retval, "ARKodeGetNumSteps", 1, udata->myid); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1, udata->myid); - retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_retval(&retval, "ERKStepGetNumRhsEvals", 1, udata->myid); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1, udata->myid); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1, udata->myid); diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index 5a21f7ea15..bef540030c 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -3155,6 +3155,9 @@ Main solver optional output functions The *nfi_evals* value does not account for calls made to :math:`f^I` by a linear solver or preconditioner module. + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRhsEvals` instead. .. c:function:: int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 5bbb3e1f63..6c7b7b9cdf 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -1739,6 +1739,9 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRhsEvals` instead. .. c:function:: int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails) diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index bf00365669..a6354a6037 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -1895,6 +1895,9 @@ Main solver optional output functions * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRhsEvals` instead. .. c:function:: int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* ncnf) diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 7d5950fa77..73bde21f90 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -784,6 +784,9 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` + .. deprecated:: x.y.z + + Use :c:func:`ARKodeGetNumRhsEvals` instead. .. c:function:: int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable *sprk_table) diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index fd9b572382..98de3a33b6 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -3165,6 +3165,7 @@ Name of constant associated with a return flag :c:func:`ARKodeGetReturnF No. of explicit stability-limited steps :c:func:`ARKodeGetNumExpSteps` No. of accuracy-limited steps :c:func:`ARKodeGetNumAccSteps` No. of attempted steps :c:func:`ARKodeGetNumStepAttempts` +No. of RHS evaluations :c:func:`ARKodeGetNumRhsEvals` No. of local error test failures that have occurred :c:func:`ARKodeGetNumErrTestFails` No. of failed steps due to a nonlinear solver failure :c:func:`ARKodeGetNumStepSolveFails` Estimated local truncation error vector :c:func:`ARKodeGetEstLocalErrors` @@ -3470,6 +3471,39 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat .. versionadded:: 6.1.0 +.. c:function:: int ARKodeGetNumRhsEvals(void* arkode_mem, int partition_index, long int* num_rhs_evals) + + Returns the number of calls to the user's right-hand side function (so far). + For implicit methods or methods with an implicit partition, the count does + not include calls made by a linear solver or preconditioner. + + :param arkode_mem: pointer to the ARKODE memory block. + :param num_partition: the right-hand side partition index: + + * For ERKStep, ``0`` corresponds to :math:`f(t,y)` + + * For ARKStep, ``0`` corresponds to :math:`f^E(t,y)` and + ``1`` to :math:`f^I(t,y)` + + * For MRIStep, ``0`` corresponds to :math:`f^E(t,y)` and + ``1`` to :math:`f^I(t,y)` + + * For SPRKStep, ``0`` corresponds to :math:`f_1(t,p)` and + ``1`` to :math:`f_2(t,q)` + + A negative index will return the sum of the evaluations for + each partition. + + :param num_rhs_evals: the number of right-hand side evaluations. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: if ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: if ``num_partiton`` was invalid for the stepper or + ``num_rhs_evals`` was ``NULL`` + + .. versionadded:: x.y.z + + .. c:function:: int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) Returns the number of local error test failures that diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 6965215f07..875d45c9b7 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -43,3 +43,7 @@ Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. **Deprecation Notices** + +The ARKODE stepper specific functions to retrieve the number of right-hand side +function evaluations have been deprecated. Use :c:func:`ARKodeGetNumRhsEvals` +instead. 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 a44b52ea67..cbf3f23bd4 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -334,8 +334,10 @@ int EvolveProblemIMEX(SUNContext ctx, N_Vector y, UserData* udata, check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -443,8 +445,8 @@ int EvolveProblemExplicit(SUNContext ctx, N_Vector y, UserData* udata, check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_retval(&retval, "ERKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1); diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 5643211620..5dd2bbd43b 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -2600,8 +2600,10 @@ static int OutputStatsIMEX(void* arkode_mem, UserData* udata) if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } if (udata->diffusion) { @@ -2675,11 +2677,11 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, int flag; // Get slow integrator and solver stats - long int nsts, nfse, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nsts, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nsts); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } - flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); @@ -2736,7 +2738,7 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, void* inner_arkode_mem; MRIStepInnerStepper_GetContent(stepper, &inner_arkode_mem); - long int nstf, nstf_a, netff, nffe, nffi; + long int nstf, nstf_a, netff, nffe; flag = ARKodeGetNumSteps(inner_arkode_mem, &nstf); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } @@ -2744,8 +2746,8 @@ static int OutputStatsMRI(void* arkode_mem, MRIStepInnerStepper stepper, if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(inner_arkode_mem, &netff); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nffe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } cout << "Fast Integrator:" << endl; cout << " Steps = " << nstf << endl; @@ -2763,11 +2765,11 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, int flag; // Get slow integrator and solver stats - long int nsts, nfse, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nsts, nfsi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nsts); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } - flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 0bf8d97ba7..ed59996da6 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -1819,15 +1819,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) int flag; // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp index 14786d9c98..997bd4d787 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp @@ -2111,15 +2111,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) int flag; // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJeval; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nJeval; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index d408bcdf78..69aa444334 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -2647,15 +2647,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) int flag; // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); 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 ddf689ac47..9ca07cbfe1 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp @@ -2740,8 +2740,10 @@ static int OutputStats(void* arkode_mem, UserData* udata) if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); @@ -2761,7 +2763,8 @@ static int OutputStats(void* arkode_mem, UserData* udata) cout << " Steps = " << nst << endl; cout << " Step attempts = " << nst_a << endl; cout << " Error test fails = " << netf << endl; - cout << " RHS evals = " << nfi << endl; + cout << " Fe RHS evals = " << nfe << endl; + cout << " Fi RHS evals = " << nfi << endl; cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; cout << " LS iters = " << nli << endl; 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 66fc95aae1..429b9634d9 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 @@ -56,7 +56,8 @@ Final fast integrator statistics: Steps = 722 Step attempts = 722 Error test fails = 0 - RHS evals = 5444 + Fe RHS evals = 2890 + Fi RHS evals = 5444 NLS iters = 2554 NLS fails = 0 LS iters = 8545 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 aa75c8b61c..ab2789c7ef 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -2707,15 +2707,15 @@ static int OutputFastStats(void* arkode_mem, UserData* udata) int flag; // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); @@ -2778,8 +2778,10 @@ static int OutputSlowStats(void* arkode_mem, UserData* udata) long int nst, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } - flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); @@ -2797,7 +2799,8 @@ static int OutputSlowStats(void* arkode_mem, UserData* udata) cout << setprecision(6); cout << " Steps = " << nst << endl; - cout << " RHS evals = " << nfi << endl; + cout << " Fe RHS evals = " << nfe << endl; + cout << " Fi RHS evals = " << nfi << endl; cout << " NLS iters = " << nni << endl; cout << " NLS fails = " << ncfn << endl; cout << " LS iters = " << nli << endl; 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 5c1a518ea8..2a91f4f2ba 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 @@ -56,7 +56,8 @@ Final slow integrator statistics: Steps = 1000 - RHS evals = 7355 + Fe RHS evals = 4000 + Fi RHS evals = 7355 NLS iters = 3355 NLS fails = 0 LS iters = 10603 diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp index 9b50109742..59a429f09b 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.hpp @@ -297,8 +297,8 @@ static int OutputStatsERK(void* arkode_mem, UserData& udata) if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } - flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - if (check_flag(flag, "ERKStepGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } cout << " Steps = " << nst << endl; cout << " Step attempts = " << nst_a << endl; @@ -321,8 +321,10 @@ static int OutputStatsARK(void* arkode_mem, UserData& udata) if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } cout << fixed << setprecision(6); cout << " Steps = " << nst << endl; @@ -371,8 +373,10 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, long int nst, nst_a, netf, nfe, nfi; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } - flag = MRIStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } cout << fixed << setprecision(6); cout << endl << "Slow Integrator:" << endl; @@ -419,8 +423,10 @@ static int OutputStatsMRIARK(void* arkode_mem, MRIStepInnerStepper fast_mem, if (check_flag(flag, "ARKodeGetNumStepAttempts")) { return -1; } flag = ARKodeGetNumErrTestFails(fast_arkode_mem, &netf); if (check_flag(flag, "ARKodeGetNumErrTestFails")) { return -1; } - flag = ARKStepGetNumRhsEvals(fast_arkode_mem, &nfe, &nfi); - if (check_flag(flag, "ARKStepGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(fast_arkode_mem, 0, &nfe); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(fast_arkode_mem, 1, &nfi); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } cout << fixed << setprecision(6); cout << endl << "Fast Integrator:" << endl; @@ -507,8 +513,10 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper fast_mem, long int nsts, nfse, nfsi; flag = ARKodeGetNumSteps(arkode_mem, &nsts); if (check_flag(flag, "ARKodeGetNumSteps")) { return -1; } - flag = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - if (check_flag(flag, "MRIStepGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + if (check_flag(flag, "ARKodeGetNumRhsEvals")) { return -1; } long int nni, ncfn; flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); diff --git a/examples/arkode/CXX_serial/ark_analytic_sys.cpp b/examples/arkode/CXX_serial/ark_analytic_sys.cpp index 944c40be1a..d48ce0abb9 100644 --- a/examples/arkode/CXX_serial/ark_analytic_sys.cpp +++ b/examples/arkode/CXX_serial/ark_analytic_sys.cpp @@ -239,8 +239,10 @@ int main() check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/CXX_serial/ark_heat2D.cpp b/examples/arkode/CXX_serial/ark_heat2D.cpp index 3298eac1f9..4b75d703bb 100644 --- a/examples/arkode/CXX_serial/ark_heat2D.cpp +++ b/examples/arkode/CXX_serial/ark_heat2D.cpp @@ -1086,15 +1086,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) int flag; // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp index bd945fa00b..f48f81bc84 100644 --- a/examples/arkode/CXX_serial/ark_kpr_Mt.cpp +++ b/examples/arkode/CXX_serial/ark_kpr_Mt.cpp @@ -575,8 +575,10 @@ static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, if (check_retval(&retval, "ARKodeGetNumSteps", 1)) { return 1; } retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_retval(&retval, "ARKodeGetNumStepAttempts", 1)) { return 1; } - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_retval(&retval, "ARKStepGetNumRhsEvals", 1)) { return 1; } + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + if (check_retval(&retval, "ARKodeGetNumRhsEvals", 1)) { return 1; } + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_retval(&retval, "ARKodeGetNumRhsEvals", 1)) { return 1; } retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_retval(&retval, "ARKodeGetNumErrTestFails", 1)) { return 1; } retval = ARKodeGetNumMassSetups(arkode_mem, &nmset); diff --git a/examples/arkode/CXX_serial/ark_pendulum.cpp b/examples/arkode/CXX_serial/ark_pendulum.cpp index 57c23ccc99..3cee00125b 100644 --- a/examples/arkode/CXX_serial/ark_pendulum.cpp +++ b/examples/arkode/CXX_serial/ark_pendulum.cpp @@ -300,8 +300,11 @@ int main(int argc, char* argv[]) flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(flag, "ARKodeGetNumErrTestFails"); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(flag, "ARKStepGetNumRhsEvals"); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(flag, "ARKodeGetNumRhsEvals"); + + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(flag, "ARKodeGetNumRhsEvals"); std::cout << std::endl; std::cout << "Final Solver Statistics:\n"; diff --git a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp index 15f50ea46e..64ffd741a9 100644 --- a/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp +++ b/examples/arkode/CXX_superludist/ark_brusselator1D_FEM_sludist.cpp @@ -575,8 +575,10 @@ int main(int argc, char* argv[]) check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); 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 987ba94a5d..0c4da9c70e 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp @@ -2902,15 +2902,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) bool outproc = (udata->myid_w == 0); // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp index d6cc3b7319..466b1f7f9c 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp @@ -2052,15 +2052,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) bool outproc = (udata->myid_w == 0); // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp index 3e6cd8b1d5..c330571584 100644 --- a/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp +++ b/examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp @@ -1351,15 +1351,15 @@ static int OutputStats(void* arkode_mem, UserData* udata) bool outproc = (udata->myid_w == 0); // Get integrator and solver stats - long int nst, nst_a, netf, nfe, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; + long int nst, nst_a, netf, nfi, nni, ncfn, nli, nlcf, nsetups, nfi_ls, nJv; flag = ARKodeGetNumSteps(arkode_mem, &nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return -1; } flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); if (check_flag(&flag, "ARKodeGetNumStepAttempts", 1)) { return -1; } flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); if (check_flag(&flag, "ARKodeGetNumErrTestFails", 1)) { return -1; } - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return -1; } + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return -1; } flag = ARKodeGetNumNonlinSolvConvFails(arkode_mem, &ncfn); diff --git a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c index 45ab77e455..fe21069373 100644 --- a/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c +++ b/examples/arkode/C_manyvector/ark_brusselator1D_manyvec.c @@ -292,8 +292,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_openmp/ark_brusselator1D_omp.c b/examples/arkode/C_openmp/ark_brusselator1D_omp.c index 1fc53f29d2..81cc915abc 100644 --- a/examples/arkode/C_openmp/ark_brusselator1D_omp.c +++ b/examples/arkode/C_openmp/ark_brusselator1D_omp.c @@ -323,8 +323,10 @@ int main(int argc, char* argv[]) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_openmp/ark_heat1D_omp.c b/examples/arkode/C_openmp/ark_heat1D_omp.c index 4fc8eb998b..2bdaa71ea4 100644 --- a/examples/arkode/C_openmp/ark_heat1D_omp.c +++ b/examples/arkode/C_openmp/ark_heat1D_omp.c @@ -215,8 +215,10 @@ int main(int argc, char* argv[]) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c index 1f847e9dfe..15c909a73f 100644 --- a/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c @@ -140,8 +140,8 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_flag(&flag, "ERKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(&flag, "ARKodeGetNumErrTestFails", 1); diff --git a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c index c6307e226f..56bad92e9b 100644 --- a/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c +++ b/examples/arkode/C_openmpdev/ark_heat1D_ompdev.c @@ -211,8 +211,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); 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 a35437e611..d3a71248c6 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -458,8 +458,10 @@ static int EvolveProblemIMEX(N_Vector y, UserData udata, UserOptions uopt, check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1); retval = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); @@ -570,8 +572,8 @@ static int EvolveProblemExplicit(N_Vector y, UserData udata, UserOptions uopt, check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_retval(&retval, "ERKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_retval(&retval, "ARKodeGetNumErrTestFails", 1); 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 190b7c40ce..ced0c56894 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_bbd_p.c @@ -481,8 +481,10 @@ static void PrintFinalStats(void* arkode_mem) check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); flag = ARKodeGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKodeGetNumSteps", 1, 0); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_parallel/ark_diurnal_kry_p.c b/examples/arkode/C_parallel/ark_diurnal_kry_p.c index b5d9941480..4f8f39634a 100644 --- a/examples/arkode/C_parallel/ark_diurnal_kry_p.c +++ b/examples/arkode/C_parallel/ark_diurnal_kry_p.c @@ -474,8 +474,10 @@ static void PrintFinalStats(void* arkode_mem) check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); flag = ARKodeGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKodeGetNumSteps", 1, 0); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c index 59dfc3d0f4..10f88144aa 100644 --- a/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c +++ b/examples/arkode/C_parhyp/ark_diurnal_kry_ph.c @@ -486,8 +486,10 @@ static void PrintFinalStats(void* arkode_mem) check_flag(&flag, "ARKodeGetWorkSpace", 1, 0); flag = ARKodeGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKodeGetNumSteps", 1, 0); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1, 0); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1, 0); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_KrylovDemo_prec.c b/examples/arkode/C_serial/ark_KrylovDemo_prec.c index 501ff55e80..31ba755240 100644 --- a/examples/arkode/C_serial/ark_KrylovDemo_prec.c +++ b/examples/arkode/C_serial/ark_KrylovDemo_prec.c @@ -643,8 +643,10 @@ static void PrintOutput(void* arkode_mem, sunrealtype t) flag = ARKodeGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1); flag = ARKodeGetLastStep(arkode_mem, &hu); @@ -678,8 +680,10 @@ static void PrintFinalStats(void* arkode_mem) check_flag(&flag, "ARKodeGetWorkSpace", 1); flag = ARKodeGetNumSteps(arkode_mem, &nst); check_flag(&flag, "ARKodeGetNumSteps", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_analytic.c b/examples/arkode/C_serial/ark_analytic.c index 152a95133d..a15bde944d 100644 --- a/examples/arkode/C_serial/ark_analytic.c +++ b/examples/arkode/C_serial/ark_analytic.c @@ -169,8 +169,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_analytic_mels.c b/examples/arkode/C_serial/ark_analytic_mels.c index 95dca9fbc2..eaa7236d0f 100644 --- a/examples/arkode/C_serial/ark_analytic_mels.c +++ b/examples/arkode/C_serial/ark_analytic_mels.c @@ -153,8 +153,10 @@ int main(void) check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator.c b/examples/arkode/C_serial/ark_brusselator.c index a501f997e2..d766a773d6 100644 --- a/examples/arkode/C_serial/ark_brusselator.c +++ b/examples/arkode/C_serial/ark_brusselator.c @@ -250,8 +250,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator1D.c b/examples/arkode/C_serial/ark_brusselator1D.c index e0c803561e..28a40201c8 100644 --- a/examples/arkode/C_serial/ark_brusselator1D.c +++ b/examples/arkode/C_serial/ark_brusselator1D.c @@ -299,8 +299,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c index 2978d2f77c..d3dcbc36e6 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_FEM_slu.c @@ -404,8 +404,10 @@ int main(int argc, char* argv[]) check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); retval = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index 1d52164719..a779faeb04 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -752,14 +752,18 @@ int main(int argc, char* argv[]) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nffe); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 1, &nffi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); diff --git a/examples/arkode/C_serial/ark_brusselator1D_klu.c b/examples/arkode/C_serial/ark_brusselator1D_klu.c index d9831a948a..19d25fc221 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_klu.c +++ b/examples/arkode/C_serial/ark_brusselator1D_klu.c @@ -314,8 +314,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index 54398dcf71..0dc4323bc3 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -136,7 +136,7 @@ int main(int argc, char* argv[]) FILE *FID, *UFID, *VFID, *WFID; /* output file pointers */ int iout; /* output counter */ long int nsts, nstf, nstf_a, netf; /* step stats */ - long int nfse, nfsi, nffe, nffi; /* RHS stats */ + long int nfse, nffi; /* RHS stats */ long int nsetups, nje, nfeLS; /* linear solver stats */ long int nni, ncfn; /* nonlinear solver stats */ sunindextype NEQ; /* number of equations */ @@ -349,16 +349,16 @@ int main(int argc, char* argv[]) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); retval = ARKodeGetNumStepAttempts(inner_arkode_mem, &nstf_a); check_retval(&retval, "ARKodeGetNumStepAttempts", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nffe, &nffi); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 1, &nffi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); retval = ARKodeGetNumLinSolvSetups(inner_arkode_mem, &nsetups); check_retval(&retval, "ARKodeGetNumLinSolvSetups", 1); retval = ARKodeGetNumErrTestFails(inner_arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_brusselator_fp.c b/examples/arkode/C_serial/ark_brusselator_fp.c index 518eeccdb8..56f93c1423 100644 --- a/examples/arkode/C_serial/ark_brusselator_fp.c +++ b/examples/arkode/C_serial/ark_brusselator_fp.c @@ -249,8 +249,10 @@ int main(int argc, char* argv[]) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(&flag, "ARKodeGetNumErrTestFails", 1); flag = ARKodeGetNumNonlinSolvIters(arkode_mem, &nni); diff --git a/examples/arkode/C_serial/ark_brusselator_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 1ea84c3ee5..67d2c57b80 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_mri.c @@ -81,7 +81,7 @@ int main(void) FILE* UFID; sunrealtype t, tout; int iout; - long int nsts, nstf, nfse, nfsi, nff, tmp; + long int nsts, nstf, nfse, nff; /* * Initialization @@ -219,14 +219,14 @@ int main(void) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); 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 c9570e8bec..e1962d01fe 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c @@ -340,8 +340,11 @@ int main(int argc, char* argv[]) flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(flag, "ARKodeGetNumErrTestFails"); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(flag, "ARKStepGetNumRhsEvals"); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(flag, "ARKodeGetNumRhsEvals"); + + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(flag, "ARKodeGetNumRhsEvals"); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); diff --git a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c index 6b73b0d999..47bd3fa6e6 100644 --- a/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c +++ b/examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c @@ -300,8 +300,8 @@ int main(int argc, char* argv[]) flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(flag, "ARKodeGetNumErrTestFails"); - flag = ERKStepGetNumRhsEvals(arkode_mem, &nfe); - check_flag(flag, "ERKStepGetNumRhsEvals"); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(flag, "ARKodeGetNumRhsEvals"); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c index 5b071b61ae..1b7dc0ad38 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c @@ -318,8 +318,11 @@ int main(int argc, char* argv[]) flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); check_flag(flag, "ARKodeGetNumErrTestFails"); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(flag, "ARKStepGetNumRhsEvals"); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(flag, "ARKodeGetNumRhsEvals"); + + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(flag, "ARKodeGetNumRhsEvals"); printf("\nFinal Solver Statistics:\n"); printf(" Internal solver steps = %li (attempted = %li)\n", nst, nst_a); diff --git a/examples/arkode/C_serial/ark_heat1D.c b/examples/arkode/C_serial/ark_heat1D.c index 6bed4a20c8..e796d0119f 100644 --- a/examples/arkode/C_serial/ark_heat1D.c +++ b/examples/arkode/C_serial/ark_heat1D.c @@ -200,8 +200,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index 2ae783435e..f119998632 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) sunrealtype hf, gamma, beta, t, tout, rpar[3]; sunrealtype uerr, verr, uerrtot, verrtot, errtot; int iout; - long int nsts, nstf, nfse, nfsi, nff, nnif, nncf, njef, nnis, nncs, njes, tmp; + long int nsts, nstf, nfse, nfsi, nff, nnif, nncf, njef, nnis, nncs, njes; /* * Initialization @@ -626,14 +626,16 @@ int main(int argc, char* argv[]) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index ad6776e7bb..78e1ede79c 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -95,7 +95,7 @@ int main(void) sunrealtype t, tout; sunrealtype error = SUN_RCONST(0.0); int iout; - long int nsts, nstf, nfse, nfsi, nff, tmp; + long int nsts, nstf, nfse, nff; /* * Initialization @@ -228,14 +228,14 @@ int main(void) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); diff --git a/examples/arkode/C_serial/ark_robertson_constraints.c b/examples/arkode/C_serial/ark_robertson_constraints.c index 2e5062d0e5..532149b212 100644 --- a/examples/arkode/C_serial/ark_robertson_constraints.c +++ b/examples/arkode/C_serial/ark_robertson_constraints.c @@ -204,8 +204,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_robertson_root.c b/examples/arkode/C_serial/ark_robertson_root.c index 846a1bdb04..ae8e476394 100644 --- a/examples/arkode/C_serial/ark_robertson_root.c +++ b/examples/arkode/C_serial/ark_robertson_root.c @@ -214,8 +214,10 @@ int main(void) check_flag(&flag, "ARKodeGetNumSteps", 1); flag = ARKodeGetNumStepAttempts(arkode_mem, &nst_a); check_flag(&flag, "ARKodeGetNumStepAttempts", 1); - flag = ARKStepGetNumRhsEvals(arkode_mem, &nfe, &nfi); - check_flag(&flag, "ARKStepGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfe); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); + flag = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfi); + check_flag(&flag, "ARKodeGetNumRhsEvals", 1); flag = ARKodeGetNumLinSolvSetups(arkode_mem, &nsetups); check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1); flag = ARKodeGetNumErrTestFails(arkode_mem, &netf); diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index 4a099d99a4..67b5415850 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -78,7 +78,7 @@ int main(void) FILE* UFID; sunrealtype t, tout; int iout; - long int nsts, nstf, nfse, nfsi, nff, tmp; + long int nsts, nstf, nfse, nff; /* Create the SUNDIALS context object for this simulation */ SUNContext ctx; @@ -195,14 +195,14 @@ int main(void) /* Get some slow integrator statistics */ retval = ARKodeGetNumSteps(arkode_mem, &nsts); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = MRIStepGetNumRhsEvals(arkode_mem, &nfse, &nfsi); - check_retval(&retval, "MRIStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Get some fast integrator statistics */ retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); check_retval(&retval, "ARKodeGetNumSteps", 1); - retval = ARKStepGetNumRhsEvals(inner_arkode_mem, &nff, &tmp); - check_retval(&retval, "ARKStepGetNumRhsEvals", 1); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_retval(&retval, "ARKodeGetNumRhsEvals", 1); /* Print some final statistics */ printf("\nFinal Solver Statistics:\n"); diff --git a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 index e371c7af08..23a5919068 100644 --- a/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_analytic_complex_f2003.f90 @@ -235,14 +235,13 @@ subroutine ARKStepStats(arkode_mem) integer(c_long) :: nsteps(1) ! num steps integer(c_long) :: nst_a(1) ! num steps attempted integer(c_long) :: nfe(1) ! num explicit function evals - integer(c_long) :: nfi(1) ! num implicit function evals integer(c_long) :: netfails(1) ! num error test fails !======= Internals ============ ierr = FARKodeGetNumSteps(arkode_mem, nsteps) ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) ierr = FARKodeGetNumErrTestFails(arkode_mem, netfails) print *, ' ' diff --git a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 index 71e577acd5..e837b4e684 100644 --- a/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 +++ b/examples/arkode/F2003_custom/ark_brusselator1D_f2003.f90 @@ -433,7 +433,8 @@ subroutine ARKStepStats(arkode_mem) ierr = FARKodeGetNumSteps(arkode_mem, nsteps) ierr = FARKodeGetNumStepAttempts(arkode_mem, nst_a) - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) ierr = FARKodeGetNumLinRhsEvals(arkode_mem, nfeLS) ierr = FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) ierr = FARKodeGetNumJacEvals(arkode_mem, nje) 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 7d17efaaf3..9b30cbc70a 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 @@ -1362,9 +1362,15 @@ subroutine EvolveProblemIMEX(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ", retval + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (retval /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' call MPI_Abort(comm, 1, ierr) end if @@ -1586,9 +1592,9 @@ subroutine EvolveProblemExplicit(sunvec_y) call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ", retval + print *, "Error: FARKodeGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) end if diff --git a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 index 8c67715974..d963fea725 100644 --- a/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_kry_bbd_f2003.f90 @@ -360,9 +360,15 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ", retval + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (retval /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' call MPI_Abort(comm, 1, ierr) end if @@ -406,9 +412,15 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) + if (retval /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ", retval + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' call MPI_Abort(comm, 1, ierr) end if diff --git a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 index d3bfc3a55f..3282e22832 100644 --- a/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_diag_non_f2003.f90 @@ -235,9 +235,9 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ", retval + print *, "Error: FARKodeGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) end if @@ -281,9 +281,9 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FERKStepGetNumRhsEvals(arkode_mem, nfe) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FERKStepGetNumRhsEvals returned ", retval + print *, "Error: FARKodeGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) end if diff --git a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 index e024dc9dff..60fd288894 100644 --- a/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 +++ b/examples/arkode/F2003_parallel/ark_heat2D_f2003.f90 @@ -884,9 +884,15 @@ program driver call MPI_Abort(comm, 1, ierr) end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, "Error: FARKStepGetNumRhsEvals returned ", retval + print *, "Error: FARKodeGetNumRhsEvals returned ", retval + call MPI_Abort(comm, 1, ierr) + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (retval /= 0) then + print *, "Error: FARKodeGetNumRhsEvals returned ", retval call MPI_Abort(comm, 1, ierr) end if diff --git a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 index 62551f623f..0fa90fe945 100644 --- a/examples/arkode/F2003_serial/ark_analytic_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_analytic_f2003.f90 @@ -267,8 +267,6 @@ subroutine ARKStepStats(arkode_mem) integer(c_long) :: nsteps(1) ! num steps integer(c_long) :: nst_a(1) ! num steps attempted - integer(c_long) :: nfe(1) ! num explicit function evals - integer(c_long) :: nfi(1) ! num implicit function evals integer(c_long) :: nfevals(1) ! num function evals integer(c_long) :: nlinsetups(1) ! num linear solver setups integer(c_long) :: netfails(1) ! num error test fails @@ -296,12 +294,11 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, -1, nfevals) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' stop 1 end if - nfevals = nfe + nfi ierr = FARKodeGetActualInitStep(arkode_mem, hinused) if (ierr /= 0) then diff --git a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 index 0d63e260cf..4072dc30f8 100644 --- a/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss1D_FEM_klu_f2003.f90 @@ -1342,9 +1342,15 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (ierr /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 index 2b6579cf20..0f9905740e 100644 --- a/examples/arkode/F2003_serial/ark_bruss_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_bruss_f2003.f90 @@ -450,9 +450,15 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (ierr /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 index ae64d613b6..8c6b9aa594 100644 --- a/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_diurnal_kry_bp_f2003.f90 @@ -438,9 +438,15 @@ subroutine ARKStepStats(arkode_mem) stop 1 end if - ierr = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + ierr = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (ierr /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, ierr = ', ierr, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' + stop 1 + end if + + ierr = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (ierr /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', ierr, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index 330e54f6b7..7556117b4d 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -602,7 +602,7 @@ program main real(c_double), allocatable :: As(:, :), bs(:), cs(:), ds(:) ! Arrays for slow Butcher table, NOTE: must be in row-major order integer(c_int) :: iout, argc, argi integer(c_long) :: nsts(1), nstf(1), nfse(1), nfsi(1), nff(1) - integer(c_long) :: nnif(1), nncf(1), njef(1), nnis(1), nncs(1), njes(1), tmp(1) + integer(c_long) :: nnif(1), nncf(1), njef(1), nnis(1), nncs(1), njes(1) character(len=32), dimension(:), allocatable :: argv ! @@ -1057,11 +1057,12 @@ program main ! Get some slow integrator statistics retval = FARKodeGetNumSteps(arkode_mem, nsts) - retval = FMRIStepGetNumRhsEvals(arkode_mem, nfse, nfsi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfse) + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfsi) ! Get some fast integrator statistics retval = FARKodeGetNumSteps(inner_arkode_mem, nstf) - retval = FARKStepGetNumRhsEvals(inner_arkode_mem, nff, tmp) + retval = FARKodeGetNumRhsEvals(inner_arkode_mem, 0, nff) ! Print some final statistics print *, "Final Solver Statistics:" diff --git a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 index 2c5016d2d2..6739eb4f2b 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dnsL_f2003.f90 @@ -568,9 +568,15 @@ subroutine PrintFinalStats(arkode_mem) stop 1 end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (retval /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index 79c3395ffa..d26cf5f56f 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -570,9 +570,15 @@ subroutine PrintFinalStats(arkode_mem) stop 1 end if - retval = FARKStepGetNumRhsEvals(arkode_mem, nfe, nfi) + retval = FARKodeGetNumRhsEvals(arkode_mem, 0, nfe) if (retval /= 0) then - print *, 'Error in FARKStepGetNumRhsEvals, retval = ', retval, '; halting' + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' + stop 1 + end if + + retval = FARKodeGetNumRhsEvals(arkode_mem, 1, nfi) + if (retval /= 0) then + print *, 'Error in FARKodeGetNumRhsEvals, retval = ', retval, '; halting' stop 1 end if diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index f4e0667d72..f33ec560dc 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -294,6 +294,8 @@ SUNDIALS_EXPORT int ARKodeComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); /* Optional output functions (general) */ +SUNDIALS_EXPORT int ARKodeGetNumRhsEvals(void* arkode_mem, int partition_index, + long int* num_rhs_evals); SUNDIALS_EXPORT int ARKodeGetNumStepAttempts(void* arkode_mem, long int* step_attempts); SUNDIALS_EXPORT int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index f7a6f112f5..9a0cfbb5a1 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -86,8 +86,6 @@ SUNDIALS_EXPORT int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable); /* Optional output functions */ -SUNDIALS_EXPORT int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, - long int* nfi_evals); SUNDIALS_EXPORT int ARKStepGetCurrentButcherTables(void* arkode_mem, ARKodeButcherTable* Bi, ARKodeButcherTable* Be); @@ -430,7 +428,9 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); - +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, + long int* nfi_evals); #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index c40bab8112..ea5ad629b9 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -59,7 +59,6 @@ SUNDIALS_EXPORT int ERKStepSetTableNum(void* arkode_mem, SUNDIALS_EXPORT int ERKStepSetTableName(void* arkode_mem, const char* etable); /* Optional output functions */ -SUNDIALS_EXPORT int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); SUNDIALS_EXPORT int ERKStepGetCurrentButcherTable(void* arkode_mem, ARKodeButcherTable* B); @@ -244,6 +243,8 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); #ifdef __cplusplus } diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 7fa2219e1e..828272948a 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -160,8 +160,6 @@ SUNDIALS_EXPORT int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn); /* Optional output functions */ -SUNDIALS_EXPORT int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, - long int* nfsi_evals); SUNDIALS_EXPORT int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC); SUNDIALS_EXPORT int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); @@ -370,6 +368,9 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void MRIStepFree(void** arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") void MRIStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, + long int* nfsi_evals); #ifdef __cplusplus } diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index 3e4519cd40..e4ed5733ff 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -57,8 +57,6 @@ SUNDIALS_EXPORT int SPRKStepSetMethodName(void* arkode_mem, const char* method); /* Optional output functions */ SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage); -SUNDIALS_EXPORT int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, - long int* nf2); /* -------------------------------------------------------------------------- * Deprecated Functions -- all are superseded by shared ARKODE-level routines @@ -126,6 +124,8 @@ int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hcur, sunrealtype* tcur); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void SPRKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); #ifdef __cplusplus } diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 378471e507..6d66929483 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1429,6 +1429,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->step_setmaxnonliniters = NULL; ark_mem->step_setnonlinconvcoef = NULL; ark_mem->step_setstagepredictfn = NULL; + ark_mem->step_getnumrhsevals = NULL; ark_mem->step_getnumlinsolvsetups = NULL; ark_mem->step_getestlocalerrors = NULL; ark_mem->step_getcurrentgamma = NULL; diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 3a4b00622a..e1ed9c0f66 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -131,6 +131,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, ark_mem->step_setmaxnonliniters = arkStep_SetMaxNonlinIters; ark_mem->step_setnonlinconvcoef = arkStep_SetNonlinConvCoef; ark_mem->step_setstagepredictfn = arkStep_SetStagePredictFn; + ark_mem->step_getnumrhsevals = arkStep_GetNumRhsEvals; ark_mem->step_getnumlinsolvsetups = arkStep_GetNumLinSolvSetups; ark_mem->step_getcurrentgamma = arkStep_GetCurrentGamma; ark_mem->step_getestlocalerrors = arkStep_GetEstLocalErrors; diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 8af982cd1b..806101a98b 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -207,6 +207,8 @@ int arkStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor); int arkStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef); int arkStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); int arkStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce); +int arkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals); int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); int arkStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma); int arkStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index ae90b65387..c629e4d8e6 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -521,23 +521,52 @@ int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable /*--------------------------------------------------------------- ARKStepGetNumRhsEvals: - Returns the current number of calls to fe and fi + Returns the current number of calls ---------------------------------------------------------------*/ +int arkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals) +{ + ARKodeARKStepMem step_mem = NULL; + + /* access ARKodeARKStepMem structure */ + int retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (rhs_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "rhs_evals is NULL"); + return ARK_ILL_INPUT; + } + + if (partition_index > 1) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid partition index"); + return ARK_ILL_INPUT; + } + + switch (partition_index) + { + case 0: *rhs_evals = step_mem->nfe; break; + case 1: *rhs_evals = step_mem->nfi; break; + default: *rhs_evals = step_mem->nfe + step_mem->nfi; break; + } + + return ARK_SUCCESS; +} + int ARKStepGetNumRhsEvals(void* arkode_mem, long int* fe_evals, long int* fi_evals) { - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - int retval; + int retval = ARK_SUCCESS; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, fe_evals); + if (retval != ARK_SUCCESS) { return retval; } - /* get values from step_mem */ - *fe_evals = step_mem->nfe; - *fi_evals = step_mem->nfi; + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, fi_evals); + if (retval != ARK_SUCCESS) { return retval; } - return (ARK_SUCCESS); + return ARK_SUCCESS; } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 766ca9e217..3eaa11ca9d 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -102,6 +102,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) ark_mem->step_setdefaults = erkStep_SetDefaults; ark_mem->step_setrelaxfn = erkStep_SetRelaxFn; ark_mem->step_setorder = erkStep_SetOrder; + ark_mem->step_getnumrhsevals = erkStep_GetNumRhsEvals; ark_mem->step_getestlocalerrors = erkStep_GetEstLocalErrors; ark_mem->step_supports_adaptive = SUNTRUE; ark_mem->step_supports_relaxation = SUNTRUE; diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index 794f112550..fc30ad1651 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -82,6 +82,8 @@ int erkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); void erkStep_Free(ARKodeMem ark_mem); void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int erkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals); int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); /* Internal utility routines */ diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 77987b4245..61bb740654 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -167,22 +167,39 @@ int ERKStepSetTableName(void* arkode_mem, const char* etable) /*--------------------------------------------------------------- ERKStepGetNumRhsEvals: - Returns the current number of calls to f + Returns the current number of RHS calls ---------------------------------------------------------------*/ -int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) +int erkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals) { - ARKodeMem ark_mem; - ARKodeERKStepMem step_mem; - int retval; + ARKodeERKStepMem step_mem = NULL; - /* access ARKodeMem and ARKodeERKStepMem structures */ - retval = erkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + /* access ARKodeERKStepMem structure */ + int retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } - /* get values from step_mem */ - *fevals = step_mem->nfe; + if (rhs_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "rhs_evals is NULL"); + return ARK_ILL_INPUT; + } - return (ARK_SUCCESS); + if (partition_index > 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid partition index"); + return ARK_ILL_INPUT; + } + + *rhs_evals = step_mem->nfe; + + return ARK_SUCCESS; +} + +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* fevals) +{ + return ARKodeGetNumRhsEvals(arkode_mem, 0, fevals); } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index fff9d2e693..f9383fe1de 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -224,6 +224,8 @@ typedef void (*ARKTimestepFree)(ARKodeMem ark_mem); typedef void (*ARKTimestepPrintMem)(ARKodeMem ark_mem, FILE* outfile); typedef int (*ARKTimestepSetDefaults)(ARKodeMem ark_mem); typedef int (*ARKTimestepSetOrder)(ARKodeMem ark_mem, int maxord); +typedef int (*ARKTimestepGetNumRhsEvals)(ARKodeMem ark_mem, int partition_index, + long int* num_rhs_evals); /* time stepper interface functions -- temporal adaptivity */ typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); @@ -406,6 +408,7 @@ struct ARKodeMemRec ARKTimestepPrintMem step_printmem; ARKTimestepSetDefaults step_setdefaults; ARKTimestepSetOrder step_setorder; + ARKTimestepGetNumRhsEvals step_getnumrhsevals; /* Time stepper module -- temporal adaptivity */ sunbooleantype step_supports_adaptive; diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index dd1325f794..670b1fd9d0 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -1999,6 +1999,38 @@ int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) ARKODE optional output utility functions ===============================================================*/ +/*--------------------------------------------------------------- + ARKodeGetNumStepAttempts: + + Returns the current number of RHS evaluations + ---------------------------------------------------------------*/ +int ARKodeGetNumRhsEvals(void* arkode_mem, int partition_index, + long int* num_rhs_evals) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Call stepper routine (if provided) */ + if (ark_mem->step_getnumrhsevals) + { + return ark_mem->step_getnumrhsevals(arkode_mem, partition_index, + num_rhs_evals); + } + else + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, + "time-stepping module does not support this function"); + return ARK_STEPPER_UNSUPPORTED; + } +} + /*--------------------------------------------------------------- ARKodeGetNumStepAttempts: diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 8e5875c12f..32c26e1de0 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -131,6 +131,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, ark_mem->step_setmaxnonliniters = mriStep_SetMaxNonlinIters; ark_mem->step_setnonlinconvcoef = mriStep_SetNonlinConvCoef; ark_mem->step_setstagepredictfn = mriStep_SetStagePredictFn; + ark_mem->step_getnumrhsevals = mriStep_GetNumRhsEvals; ark_mem->step_getnumlinsolvsetups = mriStep_GetNumLinSolvSetups; ark_mem->step_getcurrentgamma = mriStep_GetCurrentGamma; ark_mem->step_getnonlinearsystemdata = mriStep_GetNonlinearSystemData; diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index 29caf263c3..f631307e07 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -219,6 +219,8 @@ int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor); int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef); int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce); +int mriStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals); int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma); int mriStep_GetNonlinearSystemData(ARKodeMem ark_mem, sunrealtype* tcur, N_Vector* zpred, N_Vector* z, N_Vector* Fi, diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 1ad11ab59e..712debfaea 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -131,24 +131,53 @@ int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) /*--------------------------------------------------------------- MRIStepGetNumRhsEvals: - Returns the current number of calls to fse and fsi + Returns the current number of RHS calls ---------------------------------------------------------------*/ +int mriStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals) +{ + ARKodeMRIStepMem step_mem = NULL; + + /* access ARKodeMRIStepMem structure */ + int retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (rhs_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "rhs_evals is NULL"); + return ARK_ILL_INPUT; + } + + if (partition_index > 1) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid partition index"); + return ARK_ILL_INPUT; + } + + switch (partition_index) + { + case 0: *rhs_evals = step_mem->nfse; break; + case 1: *rhs_evals = step_mem->nfsi; break; + default: *rhs_evals = step_mem->nfse + step_mem->nfsi; break; + } + + return ARK_SUCCESS; +} + int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, long int* nfsi_evals) { - ARKodeMem ark_mem; - ARKodeMRIStepMem step_mem; - int retval; + int retval = ARK_SUCCESS; - /* access ARKodeMem and ARKodeMRIStepMem structures */ - retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, nfse_evals); + if (retval != ARK_SUCCESS) { return retval; } - /* get number of fse and fsi evals from step_mem */ - *nfse_evals = step_mem->nfse; - *nfsi_evals = step_mem->nfsi; + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, nfsi_evals); + if (retval != ARK_SUCCESS) { return retval; } - return (ARK_SUCCESS); + return ARK_SUCCESS; } /*--------------------------------------------------------------- diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index f7f67248c4..6c3cf4a669 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -125,6 +125,7 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, ark_mem->step_free = sprkStep_Free; ark_mem->step_setdefaults = sprkStep_SetDefaults; ark_mem->step_setorder = sprkStep_SetOrder; + ark_mem->step_getnumrhsevals = sprkStep_GetNumRhsEvals; ark_mem->step_mem = (void*)step_mem; /* Set default values for optional inputs */ diff --git a/src/arkode/arkode_sprkstep_impl.h b/src/arkode/arkode_sprkstep_impl.h index 0493106586..d94f5c5c80 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -83,6 +83,8 @@ int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); void sprkStep_Free(ARKodeMem ark_mem); void sprkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int sprkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals); /* Internal utility routines */ int sprkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index 88378f14ca..8dc76a9234 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -154,23 +154,52 @@ int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) /*--------------------------------------------------------------- SPRKStepGetNumRhsEvals: - Returns the current number of calls to f1 and f2 + Returns the current number of RHS calls ---------------------------------------------------------------*/ -int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) +int sprkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals) { - ARKodeMem ark_mem = NULL; ARKodeSPRKStepMem step_mem = NULL; - int retval = 0; - /* access ARKodeMem and ARKodeSPRKStepMem structures */ - retval = sprkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, - &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + /* access ARKodeSPRKStepMem structure */ + int retval = sprkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } - *nf1 = step_mem->nf1; - *nf2 = step_mem->nf2; + if (rhs_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "rhs_evals is NULL"); + return ARK_ILL_INPUT; + } - return (ARK_SUCCESS); + if (partition_index > 1) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid partition index"); + return ARK_ILL_INPUT; + } + + switch (partition_index) + { + case 0: *rhs_evals = step_mem->nf1; break; + case 1: *rhs_evals = step_mem->nf2; break; + default: *rhs_evals = step_mem->nf1 + step_mem->nf2; break; + } + + return ARK_SUCCESS; +} + +int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2) +{ + int retval = ARK_SUCCESS; + + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, nf1); + if (retval != ARK_SUCCESS) { return retval; } + + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, nf2); + if (retval != ARK_SUCCESS) { return retval; } + + return ARK_SUCCESS; } /*=============================================================== diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.c b/src/arkode/fmod_int32/farkode_arkstep_mod.c index 4791bedcdc..944fd591b0 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.c @@ -361,22 +361,6 @@ SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, } -SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepGetCurrentButcherTables(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -2657,4 +2641,20 @@ SWIGEXPORT int _wrap_FARKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 index cc0373f1eb..ae1f6659eb 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 @@ -60,7 +60,6 @@ module farkode_arkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FARKStepSetTableName - public :: FARKStepGetNumRhsEvals public :: FARKStepGetCurrentButcherTables public :: FARKStepGetTimestepperStats public :: FARKStepCreateMRIStepInnerStepper @@ -218,6 +217,7 @@ module farkode_arkstep_mod public :: FARKStepGetNumRelaxBoundFails public :: FARKStepGetNumRelaxSolveFails public :: FARKStepGetNumRelaxSolveIters + public :: FARKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -302,16 +302,6 @@ function swigc_FARKStepSetTableName(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepGetNumRhsEvals") & -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_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) & bind(C, name="_wrap_FARKStepGetCurrentButcherTables") & result(fresult) @@ -1772,6 +1762,16 @@ function swigc_FARKStepGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetNumRhsEvals") & +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 @@ -1949,25 +1949,6 @@ function FARKStepSetTableName(arkode_mem, itable, etable) & swig_result = fresult end function -function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfe_evals(1)) -farg3 = c_loc(nfi_evals(1)) -fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FARKStepGetCurrentButcherTables(arkode_mem, bi, be) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4621,5 +4602,24 @@ function FARKStepGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfe_evals(1)) +farg3 = c_loc(nfi_evals(1)) +fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.c b/src/arkode/fmod_int32/farkode_erkstep_mod.c index 5def57befc..c5fee45581 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.c @@ -311,20 +311,6 @@ SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) } -SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ERKStepGetNumRhsEvals(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepGetCurrentButcherTable(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1560,4 +1546,18 @@ SWIGEXPORT int _wrap_FERKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 index 291dc643d5..70531d6a64 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 @@ -44,7 +44,6 @@ module farkode_erkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FERKStepSetTableName - public :: FERKStepGetNumRhsEvals public :: FERKStepGetCurrentButcherTable public :: FERKStepGetTimestepperStats public :: FERKStepResize @@ -130,6 +129,7 @@ module farkode_erkstep_mod public :: FERKStepGetNumRelaxBoundFails public :: FERKStepGetNumRelaxSolveFails public :: FERKStepGetNumRelaxSolveIters + public :: FERKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -183,15 +183,6 @@ function swigc_FERKStepSetTableName(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetNumRhsEvals") & -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_FERKStepGetCurrentButcherTable(farg1, farg2) & bind(C, name="_wrap_FERKStepGetCurrentButcherTable") & result(fresult) @@ -985,6 +976,15 @@ function swigc_FERKStepGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRhsEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -1101,22 +1101,6 @@ function FERKStepSetTableName(arkode_mem, etable) & swig_result = fresult end function -function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfevals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(nfevals(1)) -fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) -swig_result = fresult -end function - function FERKStepGetCurrentButcherTable(arkode_mem, b) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2562,5 +2546,21 @@ function FERKStepGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c index 1423d2e582..52f187e8c4 100644 --- a/src/arkode/fmod_int32/farkode_mod.c +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -1193,6 +1193,22 @@ SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector f } +SWIGEXPORT int _wrap_FARKodeGetNumRhsEvals(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 366867f40a..d5eefa63da 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -163,6 +163,7 @@ module farkode_mod public :: FARKodeEvolve public :: FARKodeGetDky public :: FARKodeComputeState + public :: FARKodeGetNumRhsEvals public :: FARKodeGetNumStepAttempts public :: FARKodeGetWorkSpace public :: FARKodeGetNumSteps @@ -1019,6 +1020,16 @@ function swigc_FARKodeComputeState(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetNumRhsEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FARKodeGetNumStepAttempts(farg1, farg2) & bind(C, name="_wrap_FARKodeGetNumStepAttempts") & result(fresult) @@ -3381,6 +3392,25 @@ function FARKodeComputeState(arkode_mem, zcor, z) & swig_result = fresult end function +function FARKodeGetNumRhsEvals(arkode_mem, partition_index, num_rhs_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition_index +integer(C_LONG), dimension(*), target, intent(inout) :: num_rhs_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition_index +farg3 = c_loc(num_rhs_evals(1)) +fresult = swigc_FARKodeGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.c b/src/arkode/fmod_int32/farkode_mristep_mod.c index 35721938c4..8b6a72b660 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.c +++ b/src/arkode/fmod_int32/farkode_mristep_mod.c @@ -713,22 +713,6 @@ SWIGEXPORT int _wrap_FMRIStepSetPostInnerFn(void *farg1, MRIStepPostInnerFn farg } -SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepGetCurrentCoupling(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -2111,4 +2095,20 @@ SWIGEXPORT void _wrap_FMRIStepPrintMem(void *farg1, void *farg2) { } +SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index 74a3de5637..ecba398b89 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -129,7 +129,6 @@ module farkode_mristep_mod public :: FMRIStepSetCoupling public :: FMRIStepSetPreInnerFn public :: FMRIStepSetPostInnerFn - public :: FMRIStepGetNumRhsEvals public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepInnerStepper_Create @@ -226,6 +225,7 @@ module farkode_mristep_mod public :: FMRIStepGetLinReturnFlagName public :: FMRIStepFree public :: FMRIStepPrintMem + public :: FMRIStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -503,16 +503,6 @@ function swigc_FMRIStepSetPostInnerFn(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & -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_FMRIStepGetCurrentCoupling(farg1, farg2) & bind(C, name="_wrap_FMRIStepGetCurrentCoupling") & result(fresult) @@ -1402,6 +1392,16 @@ subroutine swigc_FMRIStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine +function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & +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 @@ -1883,25 +1883,6 @@ function FMRIStepSetPostInnerFn(arkode_mem, postfn) & swig_result = fresult end function -function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfse_evals(1)) -farg3 = c_loc(nfsi_evals(1)) -fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FMRIStepGetCurrentCoupling(arkode_mem, mric) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3512,5 +3493,24 @@ subroutine FMRIStepPrintMem(arkode_mem, outfile) call swigc_FMRIStepPrintMem(farg1, farg2) end subroutine +function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfse_evals(1)) +farg3 = c_loc(nfsi_evals(1)) +fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.c b/src/arkode/fmod_int32/farkode_sprkstep_mod.c index 28cfb297d4..f2888129b1 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.c @@ -329,22 +329,6 @@ SWIGEXPORT int _wrap_FSPRKStepGetCurrentMethod(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -764,4 +748,20 @@ SWIGEXPORT void _wrap_FSPRKStepFree(void *farg1) { } +SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 index 82217e7b1b..55f3b8f3f0 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 @@ -44,7 +44,6 @@ module farkode_sprkstep_mod end type public :: FSPRKStepSetMethodName public :: FSPRKStepGetCurrentMethod - public :: FSPRKStepGetNumRhsEvals public :: FSPRKStepReset public :: FSPRKStepRootInit public :: FSPRKStepSetRootDirection @@ -74,6 +73,7 @@ module farkode_sprkstep_mod public :: FSPRKStepWriteParameters public :: FSPRKStepGetStepStats public :: FSPRKStepFree + public :: FSPRKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -138,16 +138,6 @@ function swigc_FSPRKStepGetCurrentMethod(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & -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_FSPRKStepReset(farg1, farg2, farg3) & bind(C, name="_wrap_FSPRKStepReset") & result(fresult) @@ -421,6 +411,16 @@ subroutine swigc_FSPRKStepFree(farg1) & type(C_PTR), value :: farg1 end subroutine +function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & +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 @@ -559,25 +559,6 @@ function FSPRKStepGetCurrentMethod(arkode_mem, sprk_storage) & swig_result = fresult end function -function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nf1 -integer(C_LONG), dimension(*), target, intent(inout) :: nf2 -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nf1(1)) -farg3 = c_loc(nf2(1)) -fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FSPRKStepReset(arkode_mem, tr, yr) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1077,5 +1058,24 @@ subroutine FSPRKStepFree(arkode_mem) call swigc_FSPRKStepFree(farg1) end subroutine +function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nf1 +integer(C_LONG), dimension(*), target, intent(inout) :: nf2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nf1(1)) +farg3 = c_loc(nf2(1)) +fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.c b/src/arkode/fmod_int64/farkode_arkstep_mod.c index 4791bedcdc..944fd591b0 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.c @@ -361,22 +361,6 @@ SWIGEXPORT int _wrap_FARKStepSetTableName(void *farg1, SwigArrayWrapper *farg2, } -SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepGetCurrentButcherTables(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -2657,4 +2641,20 @@ SWIGEXPORT int _wrap_FARKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FARKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)ARKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 index cc0373f1eb..ae1f6659eb 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 @@ -60,7 +60,6 @@ module farkode_arkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FARKStepSetTableName - public :: FARKStepGetNumRhsEvals public :: FARKStepGetCurrentButcherTables public :: FARKStepGetTimestepperStats public :: FARKStepCreateMRIStepInnerStepper @@ -218,6 +217,7 @@ module farkode_arkstep_mod public :: FARKStepGetNumRelaxBoundFails public :: FARKStepGetNumRelaxSolveFails public :: FARKStepGetNumRelaxSolveIters + public :: FARKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -302,16 +302,6 @@ function swigc_FARKStepSetTableName(farg1, farg2, farg3) & integer(C_INT) :: fresult end function -function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FARKStepGetNumRhsEvals") & -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_FARKStepGetCurrentButcherTables(farg1, farg2, farg3) & bind(C, name="_wrap_FARKStepGetCurrentButcherTables") & result(fresult) @@ -1772,6 +1762,16 @@ function swigc_FARKStepGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKStepGetNumRhsEvals") & +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 @@ -1949,25 +1949,6 @@ function FARKStepSetTableName(arkode_mem, itable, etable) & swig_result = fresult end function -function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfe_evals(1)) -farg3 = c_loc(nfi_evals(1)) -fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FARKStepGetCurrentButcherTables(arkode_mem, bi, be) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4621,5 +4602,24 @@ function FARKStepGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfe_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfe_evals(1)) +farg3 = c_loc(nfi_evals(1)) +fresult = swigc_FARKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.c b/src/arkode/fmod_int64/farkode_erkstep_mod.c index 5def57befc..c5fee45581 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.c @@ -311,20 +311,6 @@ SWIGEXPORT int _wrap_FERKStepSetTableName(void *farg1, SwigArrayWrapper *farg2) } -SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - result = (int)ERKStepGetNumRhsEvals(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FERKStepGetCurrentButcherTable(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1560,4 +1546,18 @@ SWIGEXPORT int _wrap_FERKStepGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FERKStepGetNumRhsEvals(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)ERKStepGetNumRhsEvals(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 index 291dc643d5..70531d6a64 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 @@ -44,7 +44,6 @@ module farkode_erkstep_mod integer(C_SIZE_T), public :: size = 0 end type public :: FERKStepSetTableName - public :: FERKStepGetNumRhsEvals public :: FERKStepGetCurrentButcherTable public :: FERKStepGetTimestepperStats public :: FERKStepResize @@ -130,6 +129,7 @@ module farkode_erkstep_mod public :: FERKStepGetNumRelaxBoundFails public :: FERKStepGetNumRelaxSolveFails public :: FERKStepGetNumRelaxSolveIters + public :: FERKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -183,15 +183,6 @@ function swigc_FERKStepSetTableName(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & -bind(C, name="_wrap_FERKStepGetNumRhsEvals") & -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_FERKStepGetCurrentButcherTable(farg1, farg2) & bind(C, name="_wrap_FERKStepGetCurrentButcherTable") & result(fresult) @@ -985,6 +976,15 @@ function swigc_FERKStepGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FERKStepGetNumRhsEvals(farg1, farg2) & +bind(C, name="_wrap_FERKStepGetNumRhsEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -1101,22 +1101,6 @@ function FERKStepSetTableName(arkode_mem, etable) & swig_result = fresult end function -function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfevals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 - -farg1 = arkode_mem -farg2 = c_loc(nfevals(1)) -fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) -swig_result = fresult -end function - function FERKStepGetCurrentButcherTable(arkode_mem, b) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2562,5 +2546,21 @@ function FERKStepGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FERKStepGetNumRhsEvals(arkode_mem, nfevals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfevals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(nfevals(1)) +fresult = swigc_FERKStepGetNumRhsEvals(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int64/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c index 7b2c3c9811..b092ee9d57 100644 --- a/src/arkode/fmod_int64/farkode_mod.c +++ b/src/arkode/fmod_int64/farkode_mod.c @@ -1193,6 +1193,22 @@ SWIGEXPORT int _wrap_FARKodeComputeState(void *farg1, N_Vector farg2, N_Vector f } +SWIGEXPORT int _wrap_FARKodeGetNumRhsEvals(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)ARKodeGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetNumStepAttempts(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index e627472572..ffb3eedfac 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -163,6 +163,7 @@ module farkode_mod public :: FARKodeEvolve public :: FARKodeGetDky public :: FARKodeComputeState + public :: FARKodeGetNumRhsEvals public :: FARKodeGetNumStepAttempts public :: FARKodeGetWorkSpace public :: FARKodeGetNumSteps @@ -1019,6 +1020,16 @@ function swigc_FARKodeComputeState(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FARKodeGetNumRhsEvals") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FARKodeGetNumStepAttempts(farg1, farg2) & bind(C, name="_wrap_FARKodeGetNumStepAttempts") & result(fresult) @@ -3381,6 +3392,25 @@ function FARKodeComputeState(arkode_mem, zcor, z) & swig_result = fresult end function +function FARKodeGetNumRhsEvals(arkode_mem, partition_index, num_rhs_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition_index +integer(C_LONG), dimension(*), target, intent(inout) :: num_rhs_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition_index +farg3 = c_loc(num_rhs_evals(1)) +fresult = swigc_FARKodeGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + function FARKodeGetNumStepAttempts(arkode_mem, step_attempts) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.c b/src/arkode/fmod_int64/farkode_mristep_mod.c index c2e254fa54..5ddb7d077a 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.c +++ b/src/arkode/fmod_int64/farkode_mristep_mod.c @@ -713,22 +713,6 @@ SWIGEXPORT int _wrap_FMRIStepSetPostInnerFn(void *farg1, MRIStepPostInnerFn farg } -SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FMRIStepGetCurrentCoupling(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -2111,4 +2095,20 @@ SWIGEXPORT void _wrap_FMRIStepPrintMem(void *farg1, void *farg2) { } +SWIGEXPORT int _wrap_FMRIStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)MRIStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index 782c3c1df9..be5bb7445a 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -129,7 +129,6 @@ module farkode_mristep_mod public :: FMRIStepSetCoupling public :: FMRIStepSetPreInnerFn public :: FMRIStepSetPostInnerFn - public :: FMRIStepGetNumRhsEvals public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepInnerStepper_Create @@ -226,6 +225,7 @@ module farkode_mristep_mod public :: FMRIStepGetLinReturnFlagName public :: FMRIStepFree public :: FMRIStepPrintMem + public :: FMRIStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -503,16 +503,6 @@ function swigc_FMRIStepSetPostInnerFn(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & -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_FMRIStepGetCurrentCoupling(farg1, farg2) & bind(C, name="_wrap_FMRIStepGetCurrentCoupling") & result(fresult) @@ -1402,6 +1392,16 @@ subroutine swigc_FMRIStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine +function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FMRIStepGetNumRhsEvals") & +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 @@ -1883,25 +1883,6 @@ function FMRIStepSetPostInnerFn(arkode_mem, postfn) & swig_result = fresult end function -function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals -integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nfse_evals(1)) -farg3 = c_loc(nfsi_evals(1)) -fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FMRIStepGetCurrentCoupling(arkode_mem, mric) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3512,5 +3493,24 @@ subroutine FMRIStepPrintMem(arkode_mem, outfile) call swigc_FMRIStepPrintMem(farg1, farg2) end subroutine +function FMRIStepGetNumRhsEvals(arkode_mem, nfse_evals, nfsi_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nfse_evals +integer(C_LONG), dimension(*), target, intent(inout) :: nfsi_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nfse_evals(1)) +farg3 = c_loc(nfsi_evals(1)) +fresult = swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.c b/src/arkode/fmod_int64/farkode_sprkstep_mod.c index 28cfb297d4..f2888129b1 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.c @@ -329,22 +329,6 @@ SWIGEXPORT int _wrap_FSPRKStepGetCurrentMethod(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { - int fresult ; - void *arg1 = (void *) 0 ; - long *arg2 = (long *) 0 ; - long *arg3 = (long *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (long *)(farg2); - arg3 = (long *)(farg3); - result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepReset(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -764,4 +748,20 @@ SWIGEXPORT void _wrap_FSPRKStepFree(void *farg1) { } +SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + arg3 = (long *)(farg3); + result = (int)SPRKStepGetNumRhsEvals(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 index 82217e7b1b..55f3b8f3f0 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 @@ -44,7 +44,6 @@ module farkode_sprkstep_mod end type public :: FSPRKStepSetMethodName public :: FSPRKStepGetCurrentMethod - public :: FSPRKStepGetNumRhsEvals public :: FSPRKStepReset public :: FSPRKStepRootInit public :: FSPRKStepSetRootDirection @@ -74,6 +73,7 @@ module farkode_sprkstep_mod public :: FSPRKStepWriteParameters public :: FSPRKStepGetStepStats public :: FSPRKStepFree + public :: FSPRKStepGetNumRhsEvals ! WRAPPER DECLARATIONS interface @@ -138,16 +138,6 @@ function swigc_FSPRKStepGetCurrentMethod(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & -bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & -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_FSPRKStepReset(farg1, farg2, farg3) & bind(C, name="_wrap_FSPRKStepReset") & result(fresult) @@ -421,6 +411,16 @@ subroutine swigc_FSPRKStepFree(farg1) & type(C_PTR), value :: farg1 end subroutine +function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & +bind(C, name="_wrap_FSPRKStepGetNumRhsEvals") & +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 @@ -559,25 +559,6 @@ function FSPRKStepGetCurrentMethod(arkode_mem, sprk_storage) & swig_result = fresult end function -function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_LONG), dimension(*), target, intent(inout) :: nf1 -integer(C_LONG), dimension(*), target, intent(inout) :: nf2 -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_PTR) :: farg2 -type(C_PTR) :: farg3 - -farg1 = arkode_mem -farg2 = c_loc(nf1(1)) -farg3 = c_loc(nf2(1)) -fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) -swig_result = fresult -end function - function FSPRKStepReset(arkode_mem, tr, yr) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1077,5 +1058,24 @@ subroutine FSPRKStepFree(arkode_mem) call swigc_FSPRKStepFree(farg1) end subroutine +function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: nf1 +integer(C_LONG), dimension(*), target, intent(inout) :: nf2 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = c_loc(nf1(1)) +farg3 = c_loc(nf2(1)) +fresult = swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) +swig_result = fresult +end function + end module diff --git a/test/answers b/test/answers index c9da3649ff..b8fc1d686f 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit c9da3649ffcf693b0a6f8c12690e42ef83993bdd +Subproject commit b8fc1d686fabbc1c8e609ff3253cedf9588986ac 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 00008a1f11..303d85f057 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 @@ -320,8 +320,10 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } flag = ARKodeGetNumSteps(arkstep_mem, &ark_nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } - flag = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(arkstep_mem, 0, &ark_nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(arkstep_mem, 1, &ark_nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } flag = ARKodeGetNumLinSolvSetups(arkstep_mem, &ark_nsetups); if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &ark_nni); @@ -363,8 +365,10 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } - flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(mristep_mem, 0, &mri_nfse); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(mristep_mem, 1, &mri_nfsi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } flag = ARKodeGetNumLinSolvSetups(mristep_mem, &mri_nsetups); if (check_flag(&flag, "ARKodeGetNumLinSolvSetups", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); 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 a31e3d81e0..c56ac4292d 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 @@ -243,8 +243,10 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeGetCurrentTime", 1)) { return 1; } flag = ARKodeGetNumSteps(arkstep_mem, &ark_nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } - flag = ARKStepGetNumRhsEvals(arkstep_mem, &ark_nfe, &ark_nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(arkstep_mem, 0, &ark_nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(arkstep_mem, 1, &ark_nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvIters(arkstep_mem, &ark_nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvConvFails(arkstep_mem, &ark_ncfn); @@ -284,8 +286,10 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeGetCurrentTime", 1)) { return 1; } flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } - flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(mristep_mem, 0, &mri_nfse); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(mristep_mem, 1, &mri_nfsi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } flag = ARKodeGetNumNonlinSolvConvFails(mristep_mem, &mri_ncfn); 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 index 22d6856800..0a0fe13fe5 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_ark.cpp @@ -866,8 +866,11 @@ int check_rhs_evals(rk_type r_type, void* arkstep_mem, long int nfe_expected, if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } long int nfe, nfi; - flag = ARKStepGetNumRhsEvals(arkstep_mem, &nfe, &nfi); - if (check_flag(&flag, "ARKStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(arkstep_mem, 0, &nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + + flag = ARKodeGetNumRhsEvals(arkstep_mem, 1, &nfi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } if (r_type == rk_type::expl || r_type == rk_type::imex) { 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 index 2de9d17dca..525da5509f 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_erk.cpp @@ -452,8 +452,8 @@ int check_rhs_evals(void* erkstep_mem, long int nfe_expected) if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } long int nfe; - flag = ERKStepGetNumRhsEvals(erkstep_mem, &nfe); - if (check_flag(&flag, "ERKStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(erkstep_mem, 0, &nfe); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } std::cout << "Fe RHS evals:\n" << " actual: " << nfe << "\n" 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 202e1780ef..966d5425fb 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 @@ -402,8 +402,11 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, flag = ARKodeGetNumSteps(mristep_mem, &mri_nst); if (check_flag(&flag, "ARKodeGetNumSteps", 1)) { return 1; } - flag = MRIStepGetNumRhsEvals(mristep_mem, &mri_nfse, &mri_nfsi); - if (check_flag(&flag, "MRIStepGetNumRhsEvals", 1)) { return 1; } + flag = ARKodeGetNumRhsEvals(mristep_mem, 0, &mri_nfse); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } + + flag = ARKodeGetNumRhsEvals(mristep_mem, 1, &mri_nfsi); + if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) { From 5473f16f062b699d148fa5080f1ae57b7bc6ff97 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Mon, 21 Oct 2024 10:53:26 -0700 Subject: [PATCH 114/137] Feature: Extending Precision for Some DIRK Methods (#593) The Billington, Cash, and Kvaerno DIRK method coefficients only had ~10-14 digits of accuracy which can be insufficient for double and extended precision. This PR extends the coefficients to 40 digits. --- CHANGELOG.md | 8 + doc/arkode/guide/source/Butcher.rst | 10 +- doc/shared/RecentChanges.rst | 14 ++ src/arkode/arkode_butcher_dirk.def | 306 ++++++++++++++-------------- 4 files changed, 180 insertions(+), 158 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aff004841..7a2184439e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ ### New Features and Enhancements +The following DIRK schemes now have coefficients accurate to quad precision: +* `ARKODE_BILLINGTON_3_3_2` +* `ARKODE_KVAERNO_4_2_3` +* `ARKODE_CASH_5_2_4` +* `ARKODE_CASH_5_3_4` +* `ARKODE_KVAERNO_5_3_4` +* `ARKODE_KVAERNO_7_4_5` + The default value of `CMAKE_CUDA_ARCHITECTURES` is no longer set to `70` and is now determined automatically by CMake. The previous default was only valid for Volta GPUs while the automatically selected value will vary across compilers and diff --git a/doc/arkode/guide/source/Butcher.rst b/doc/arkode/guide/source/Butcher.rst index 0b7e401a56..4e6aec608a 100644 --- a/doc/arkode/guide/source/Butcher.rst +++ b/doc/arkode/guide/source/Butcher.rst @@ -1407,12 +1407,12 @@ Here, the higher-order embedding is less stable than the lower-order method \renewcommand{\arraystretch}{1.5} \begin{array}{r|ccc} - 0.292893218813 & 0.292893218813 & 0 & 0 \\ - 1.091883092037 & 0.798989873223 & 0.292893218813 & 0 \\ - 1.292893218813 & 0.740789228841 & 0.259210771159 & 0.292893218813 \\ + 1 - \frac{1}{\sqrt{2}} & 1 - \frac{1}{\sqrt{2}} & 0 & 0 \\ + \frac{27}{\sqrt{2}} - 18 & 14 \sqrt{2} - 19 & 1 - \frac{1}{\sqrt{2}} & 0 \\ + 2 - \frac{1}{\sqrt{2}} & \frac{53 - 5 \sqrt{2}}{62} & \frac{9 + 5 \sqrt{2}}{62} & 1 - \frac{1}{\sqrt{2}} \\ \hline - 2 & 0.740789228840 & 0.259210771159 & 0 \\ - 3 & 0.691665115992 & 0.503597029883 & -0.195262145876 + 2 & \frac{53 - 5 \sqrt{2}}{62} & \frac{9 + 5 \sqrt{2}}{62} & 0 \\ + 3 & \frac{263 - 95 \sqrt{2}}{186} & \frac{47 + 33 \sqrt{2}}{186} & \frac{\sqrt{2} - 2}{3} \end{array} .. figure:: /figs/arkode/stab_region_12.png diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 875d45c9b7..2be479f59c 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -2,6 +2,20 @@ **New Features and Enhancements** +The following DIRK schemes now have coefficients accurate to quad precision: + +* ``ARKODE_BILLINGTON_3_3_2`` + +* ``ARKODE_KVAERNO_4_2_3`` + +* ``ARKODE_CASH_5_2_4`` + +* ``ARKODE_CASH_5_3_4`` + +* ``ARKODE_KVAERNO_5_3_4`` + +* ``ARKODE_KVAERNO_7_4_5`` + The default value of :cmakeop:`CMAKE_CUDA_ARCHITECTURES` is no longer set to ``70`` and is now determined automatically by CMake. The previous default was only valid for Volta GPUs while the automatically selected value will vary diff --git a/src/arkode/arkode_butcher_dirk.def b/src/arkode/arkode_butcher_dirk.def index 40d13e60bd..06fdfb82bd 100644 --- a/src/arkode/arkode_butcher_dirk.def +++ b/src/arkode/arkode_butcher_dirk.def @@ -39,24 +39,24 @@ ARKODE_ARK2_DIRK_3_1_2 ESDIRK Y Y Y ARKODE_IMPLICIT_MIDPOINT_1_2 SDIRK Y N Y ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 ESDIRK Y N Y - ARKODE_BILLINGTON_3_3_2 SDIRK N N N + ARKODE_BILLINGTON_3_3_2 SDIRK N N Y ARKODE_TRBDF2_3_3_2 ESDIRK N N Y - ARKODE_KVAERNO_4_2_3 ESDIRK Y Y N + ARKODE_KVAERNO_4_2_3 ESDIRK Y Y Y ARKODE_ARK324L2SA_DIRK_4_2_3* ESDIRK Y Y N ARKODE_ESDIRK324L2SA_4_2_3 ESDIRK Y Y Y ARKODE_ESDIRK325L2SA_5_2_3 ESDIRK Y Y Y ARKODE_ESDIRK32I5L2SA_5_2_3 ESDIRK Y Y Y - ARKODE_CASH_5_2_4 SDIRK Y Y N - ARKODE_CASH_5_3_4 SDIRK Y Y N + ARKODE_CASH_5_2_4 SDIRK Y Y Y + ARKODE_CASH_5_3_4 SDIRK Y Y Y ARKODE_SDIRK_5_3_4 SDIRK Y Y Y - ARKODE_KVAERNO_5_3_4 ESDIRK Y N N + ARKODE_KVAERNO_5_3_4 ESDIRK Y N Y ARKODE_ARK436L2SA_DIRK_6_3_4* ESDIRK Y Y N ARKODE_ARK437L2SA_DIRK_7_3_4* ESDIRK Y Y N ARKODE_ESDIRK436L2SA_6_3_4 ESDIRK Y Y N ARKODE_ESDIRK43I6L2SA_6_3_4 ESDIRK Y Y N ARKODE_QESDIRK436L2SA_6_3_4 ESDIRK Y Y N ARKODE_ESDIRK437L2SA_7_3_4 ESDIRK Y Y N - ARKODE_KVAERNO_7_4_5 ESDIRK Y Y N + ARKODE_KVAERNO_7_4_5 ESDIRK Y Y Y ARKODE_ARK548L2SA_DIRK_8_4_5* ESDIRK Y Y N ARKODE_ARK548L2SAb_DIRK_8_4_5* ESDIRK Y Y N ARKODE_ESDIRK547L2SA_7_4_5 ESDIRK Y Y N @@ -169,23 +169,23 @@ ARK_BUTCHER_TABLE(ARKODE_BILLINGTON_3_3_2, { /* Billington-SDIRK */ B->q = 2; B->p = 3; - B->A[0][0] = SUN_RCONST(0.292893218813); - B->A[1][0] = SUN_RCONST(0.798989873223); - B->A[1][1] = SUN_RCONST(0.292893218813); - B->A[2][0] = SUN_RCONST(0.740789228841); - B->A[2][1] = SUN_RCONST(0.259210771159); - B->A[2][2] = SUN_RCONST(0.292893218813); + B->A[0][0] = SUN_RCONST(0.2928932188134524755991556378951509607152); + B->A[1][0] = SUN_RCONST(0.7989898732233306832236421389357730999754); + B->A[1][1] = SUN_RCONST(0.2928932188134524755991556378951509607152); + B->A[2][0] = SUN_RCONST(0.7407892288408794315482509093379275743089); + B->A[2][1] = SUN_RCONST(0.2592107711591205684517490906620724256911); + B->A[2][2] = SUN_RCONST(0.2928932188134524755991556378951509607152); - B->d[0] = SUN_RCONST(0.691665115992); - B->d[1] = SUN_RCONST(0.503597029883); - B->d[2] = SUN_RCONST(-0.195262145876); + B->d[0] = SUN_RCONST(0.6916651159922363998055890924735413039564); + B->d[1] = SUN_RCONST(0.5035970298833985839271813327898926698538); + B->d[2] = SUN_RCONST(-0.1952621458756349837327704252634339738101); - B->b[0] = SUN_RCONST(0.740789228840); - B->b[1] = SUN_RCONST(0.259210771159); + B->b[0] = SUN_RCONST(0.7407892288408794315482509093379275743089); + B->b[1] = SUN_RCONST(0.2592107711591205684517490906620724256911); - B->c[0] = SUN_RCONST(0.292893218813); - B->c[1] = SUN_RCONST(1.091883092037); - B->c[2] = SUN_RCONST(1.292893218813); + B->c[0] = SUN_RCONST(0.2928932188134524755991556378951509607152); + B->c[1] = SUN_RCONST(1.091883092036783158822797776830924060691); + B->c[2] = SUN_RCONST(1.292893218813452475599155637895150960715); return B; }) @@ -217,26 +217,26 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_4_2_3, { /* Kvaerno(4,2,3)-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(4, SUNTRUE); B->q = 3; B->p = 2; - B->A[1][0] = SUN_RCONST(0.4358665215); - B->A[1][1] = SUN_RCONST(0.4358665215); - B->A[2][0] = SUN_RCONST(0.490563388419108); - B->A[2][1] = SUN_RCONST(0.073570090080892); - B->A[2][2] = SUN_RCONST(0.4358665215); - B->A[3][0] = SUN_RCONST(0.308809969973036); - B->A[3][1] = SUN_RCONST(1.490563388254106); - B->A[3][2] = SUN_RCONST(-1.235239879727145); - B->A[3][3] = SUN_RCONST(0.4358665215); - - B->b[0] = SUN_RCONST(0.308809969973036); - B->b[1] = SUN_RCONST(1.490563388254106); - B->b[2] = SUN_RCONST(-1.235239879727145); - B->b[3] = SUN_RCONST(0.4358665215); - - B->d[0] = SUN_RCONST(0.490563388419108); - B->d[1] = SUN_RCONST(0.073570090080892); - B->d[2] = SUN_RCONST(0.4358665215); - - B->c[1] = SUN_RCONST(0.871733043); + B->A[1][0] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[1][1] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[2][0] = SUN_RCONST(0.4905633884217805706284679584665446902307); + B->A[2][1] = SUN_RCONST(0.07357009006976042995551259033989846723997); + B->A[2][2] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[3][0] = SUN_RCONST(0.3088099699767465233481624698867005109200); + B->A[3][1] = SUN_RCONST(1.490563388421780570628467958466544690231); + B->A[3][2] = SUN_RCONST(-1.235239879906986093392649879546802043680); + B->A[3][3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->b[0] = SUN_RCONST(0.3088099699767465233481624698867005109200); + B->b[1] = SUN_RCONST(1.490563388421780570628467958466544690231); + B->b[2] = SUN_RCONST(-1.235239879906986093392649879546802043680); + B->b[3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->d[0] = SUN_RCONST(0.4905633884217805706284679584665446902307); + B->d[1] = SUN_RCONST(0.07357009006976042995551259033989846723997); + B->d[2] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->c[1] = SUN_RCONST(0.8717330430169179988320389023871136850586); B->c[2] = SUN_RCONST(1.0); B->c[3] = SUN_RCONST(1.0); return B; @@ -276,35 +276,35 @@ ARK_BUTCHER_TABLE(ARKODE_CASH_5_2_4, { /* Cash(5,2,4)-SDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 2; - B->A[0][0] = SUN_RCONST(0.435866521508); - B->A[1][0] = SUN_RCONST(-1.13586652150); - B->A[1][1] = SUN_RCONST(0.435866521508); - B->A[2][0] = SUN_RCONST(1.08543330679); - B->A[2][1] = SUN_RCONST(-0.721299828287); - B->A[2][2] = SUN_RCONST(0.435866521508); - B->A[3][0] = SUN_RCONST(0.416349501547); - B->A[3][1] = SUN_RCONST(0.190984004184); - B->A[3][2] = SUN_RCONST(-0.118643265417); - B->A[3][3] = SUN_RCONST(0.435866521508); - B->A[4][0] = SUN_RCONST(0.896869652944); - B->A[4][1] = SUN_RCONST(0.0182725272734); - B->A[4][2] = SUN_RCONST(-0.0845900310706); - B->A[4][3] = SUN_RCONST(-0.266418670647); - B->A[4][4] = SUN_RCONST(0.435866521508); - - B->b[0] = SUN_RCONST(0.896869652944); - B->b[1] = SUN_RCONST(0.0182725272734); - B->b[2] = SUN_RCONST(-0.0845900310706); - B->b[3] = SUN_RCONST(-0.266418670647); - B->b[4] = SUN_RCONST(0.435866521508); - - B->d[0] = (SUN_RCONST(-0.7)-SUN_RCONST(0.5))/(SUN_RCONST(-0.7)-SUN_RCONST(0.435866521508)); - B->d[1] = (SUN_RCONST(0.5)-SUN_RCONST(0.435866521508))/(SUN_RCONST(-0.7)-SUN_RCONST(0.435866521508)); - - B->c[0] = SUN_RCONST(0.435866521508); + B->A[0][0] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[1][0] = SUN_RCONST(-1.135866521508458999416019451193556842529); + B->A[1][1] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[2][0] = SUN_RCONST(1.085433306501187798233740932177548948256); + B->A[2][1] = SUN_RCONST(-0.7212998280096467976497603833711057907848); + B->A[2][2] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[3][0] = SUN_RCONST(0.4163495015787799872439975203112232915822); + B->A[3][1] = SUN_RCONST(0.1909840041795561340637290424182710083545); + B->A[3][2] = SUN_RCONST(-0.1186432654601150605249854908172545332519); + B->A[3][3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[4][0] = SUN_RCONST(0.8968696529704295827357809984030487598656); + B->A[4][1] = SUN_RCONST(0.01827252727396890379954420931708867645445); + B->A[4][2] = SUN_RCONST(-0.08459003110197203803096641412326485130547); + B->A[4][3] = SUN_RCONST(-0.2664186706508854479203782447904294275438); + B->A[4][4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->b[0] = SUN_RCONST(0.8968696529704295827357809984030487598656); + B->b[1] = SUN_RCONST(0.01827252727396890379954420931708867645445); + B->b[2] = SUN_RCONST(-0.08459003110197203803096641412326485130547); + B->b[3] = SUN_RCONST(-0.2664186706508854479203782447904294275438); + B->b[4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->d[0] = SUN_RCONST(1.056462161070096639164359247420837614501); + B->d[1] = SUN_RCONST(-0.05646216107009663916435924742083761450128); + + B->c[0] = SUN_RCONST(0.4358665215084589994160194511935568425293); B->c[1] = SUN_RCONST(-0.7); B->c[2] = SUN_RCONST(0.8); - B->c[3] = SUN_RCONST(0.924556761814); + B->c[3] = SUN_RCONST(0.9245567618066800601987605231057966092142); B->c[4] = SUN_RCONST(1.0); return B; }) @@ -313,37 +313,37 @@ ARK_BUTCHER_TABLE(ARKODE_CASH_5_3_4, { /* Cash(5,3,4)-SDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[0][0] = SUN_RCONST(0.435866521508); - B->A[1][0] = SUN_RCONST(-1.13586652150); - B->A[1][1] = SUN_RCONST(0.435866521508); - B->A[2][0] = SUN_RCONST(1.08543330679); - B->A[2][1] = SUN_RCONST(-0.721299828287); - B->A[2][2] = SUN_RCONST(0.435866521508); - B->A[3][0] = SUN_RCONST(0.416349501547); - B->A[3][1] = SUN_RCONST(0.190984004184); - B->A[3][2] = SUN_RCONST(-0.118643265417); - B->A[3][3] = SUN_RCONST(0.435866521508); - B->A[4][0] = SUN_RCONST(0.896869652944); - B->A[4][1] = SUN_RCONST(0.0182725272734); - B->A[4][2] = SUN_RCONST(-0.0845900310706); - B->A[4][3] = SUN_RCONST(-0.266418670647); - B->A[4][4] = SUN_RCONST(0.435866521508); - - B->b[0] = SUN_RCONST(0.896869652944); - B->b[1] = SUN_RCONST(0.0182725272734); - B->b[2] = SUN_RCONST(-0.0845900310706); - B->b[3] = SUN_RCONST(-0.266418670647); - B->b[4] = SUN_RCONST(0.435866521508); - - B->d[0] = SUN_RCONST(0.776691932910); - B->d[1] = SUN_RCONST(0.0297472791484); - B->d[2] = SUN_RCONST(-0.0267440239074); - B->d[3] = SUN_RCONST(0.220304811849); - - B->c[0] = SUN_RCONST(0.435866521508); + B->A[0][0] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[1][0] = SUN_RCONST(-1.135866521508458999416019451193556842529); + B->A[1][1] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[2][0] = SUN_RCONST(1.085433306501187798233740932177548948256); + B->A[2][1] = SUN_RCONST(-0.7212998280096467976497603833711057907848); + B->A[2][2] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[3][0] = SUN_RCONST(0.4163495015787799872439975203112232915822); + B->A[3][1] = SUN_RCONST(0.1909840041795561340637290424182710083545); + B->A[3][2] = SUN_RCONST(-0.1186432654601150605249854908172545332519); + B->A[3][3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[4][0] = SUN_RCONST(0.8968696529704295827357809984030487598656); + B->A[4][1] = SUN_RCONST(0.01827252727396890379954420931708867645445); + B->A[4][2] = SUN_RCONST(-0.08459003110197203803096641412326485130547); + B->A[4][3] = SUN_RCONST(-0.2664186706508854479203782447904294275438); + B->A[4][4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->b[0] = SUN_RCONST(0.8968696529704295827357809984030487598656); + B->b[1] = SUN_RCONST(0.01827252727396890379954420931708867645445); + B->b[2] = SUN_RCONST(-0.08459003110197203803096641412326485130547); + B->b[3] = SUN_RCONST(-0.2664186706508854479203782447904294275438); + B->b[4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->d[0] = SUN_RCONST(0.7766919329157524221967851040635650689914); + B->d[1] = SUN_RCONST(0.02974727915032039108861503804581544141749); + B->d[2] = SUN_RCONST(-0.02674402391564096382835552392654800827276); + B->d[3] = SUN_RCONST(0.2203048118495681505429553818171674978639); + + B->c[0] = SUN_RCONST(0.4358665215084589994160194511935568425293); B->c[1] = SUN_RCONST(-0.7); B->c[2] = SUN_RCONST(0.8); - B->c[3] = SUN_RCONST(0.924556761814); + B->c[3] = SUN_RCONST(0.9245567618066800601987605231057966092142); B->c[4] = SUN_RCONST(1.0); return B; }) @@ -391,34 +391,34 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_5_3_4, { /* Kvaerno(5,3,4)-ESDIRK */ ARKodeButcherTable B = ARKodeButcherTable_Alloc(5, SUNTRUE); B->q = 4; B->p = 3; - B->A[1][0] = SUN_RCONST(0.4358665215); - B->A[1][1] = SUN_RCONST(0.4358665215); - B->A[2][0] = SUN_RCONST(0.140737774731968); - B->A[2][1] = SUN_RCONST(-0.108365551378832); - B->A[2][2] = SUN_RCONST(0.4358665215); - B->A[3][0] = SUN_RCONST(0.102399400616089); - B->A[3][1] = SUN_RCONST(-0.376878452267324); - B->A[3][2] = SUN_RCONST(0.838612530151233); - B->A[3][3] = SUN_RCONST(0.4358665215); - B->A[4][0] = SUN_RCONST(0.157024897860995); - B->A[4][1] = SUN_RCONST(0.117330441357768); - B->A[4][2] = SUN_RCONST(0.61667803039168); - B->A[4][3] = SUN_RCONST(-0.326899891110444); - B->A[4][4] = SUN_RCONST(0.4358665215); - - B->b[0] = SUN_RCONST(0.157024897860995); - B->b[1] = SUN_RCONST(0.117330441357768); - B->b[2] = SUN_RCONST(0.61667803039168); - B->b[3] = SUN_RCONST(-0.326899891110444); - B->b[4] = SUN_RCONST(0.4358665215); - - B->d[0] = SUN_RCONST(0.102399400616089); - B->d[1] = SUN_RCONST(-0.376878452267324); - B->d[2] = SUN_RCONST(0.838612530151233); - B->d[3] = SUN_RCONST(0.4358665215); - - B->c[1] = SUN_RCONST(0.871733043); - B->c[2] = SUN_RCONST(0.468238744853136); + B->A[1][0] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[1][1] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[2][0] = SUN_RCONST(0.1407377747247061961864132309262694299296); + B->A[2][1] = SUN_RCONST(-0.1083655513813207999782253192353360264820); + B->A[2][2] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[3][0] = SUN_RCONST(0.1023994006199109976822794150595997362069); + B->A[3][1] = SUN_RCONST(-0.3768784522555561060886970749014278247138); + B->A[3][2] = SUN_RCONST(0.8386125301271861089903982086482712459776); + B->A[3][3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + B->A[4][0] = SUN_RCONST(0.1570248978603249371007885739812418750001); + B->A[4][1] = SUN_RCONST(0.1173304413704388486968184370770592278731); + B->A[4][2] = SUN_RCONST(0.6166780303921214643483881261433096864945); + B->A[4][3] = SUN_RCONST(-0.3268998911313442495620145883951676318970); + B->A[4][4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->b[0] = SUN_RCONST(0.1570248978603249371007885739812418750001); + B->b[1] = SUN_RCONST(0.1173304413704388486968184370770592278731); + B->b[2] = SUN_RCONST(0.6166780303921214643483881261433096864945); + B->b[3] = SUN_RCONST(-0.3268998911313442495620145883951676318970); + B->b[4] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->d[0] = SUN_RCONST(0.1023994006199109976822794150595997362069); + B->d[1] = SUN_RCONST(-0.3768784522555561060886970749014278247138); + B->d[2] = SUN_RCONST(0.8386125301271861089903982086482712459776); + B->d[3] = SUN_RCONST(0.4358665215084589994160194511935568425293); + + B->c[1] = SUN_RCONST(0.8717330430169179988320389023871136850586); + B->c[2] = SUN_RCONST(0.4682387448518443956242073628844902459769); B->c[3] = SUN_RCONST(1.0); B->c[4] = SUN_RCONST(1.0); return B; @@ -527,46 +527,46 @@ ARK_BUTCHER_TABLE(ARKODE_KVAERNO_7_4_5, { /* Kvaerno(7,4,5)-ESDIRK */ B->A[1][0] = SUN_RCONST(0.26); B->A[1][1] = SUN_RCONST(0.26); B->A[2][0] = SUN_RCONST(0.13); - B->A[2][1] = SUN_RCONST(0.84033320996790809); + B->A[2][1] = SUN_RCONST(0.8403332099679080963171360487915268154051); B->A[2][2] = SUN_RCONST(0.26); - B->A[3][0] = SUN_RCONST(0.22371961478320505); - B->A[3][1] = SUN_RCONST(0.47675532319799699); - B->A[3][2] = SUN_RCONST(-0.06470895363112615); + B->A[3][0] = SUN_RCONST(0.2237196147832050559163143898290529441991); + B->A[3][1] = SUN_RCONST(0.4767553231979969983278927937270874162429); + B->A[3][2] = SUN_RCONST(-0.06470895363112615133816161180658488282681); B->A[3][3] = SUN_RCONST(0.26); - B->A[4][0] = SUN_RCONST(0.16648564323248321); - B->A[4][1] = SUN_RCONST(0.10450018841591720); - B->A[4][2] = SUN_RCONST(0.03631482272098715); - B->A[4][3] = SUN_RCONST(-0.13090704451073998); + B->A[4][0] = SUN_RCONST(0.1664856432324832152535151725360430044452); + B->A[4][1] = SUN_RCONST(0.1045001884159172041151167240328967362455); + B->A[4][2] = SUN_RCONST(0.03631482272098715161651993758285203251909); + B->A[4][3] = SUN_RCONST(-0.1309070445107399857071749645700052401819); B->A[4][4] = SUN_RCONST(0.26); - B->A[5][0] = SUN_RCONST(0.13855640231268224); - B->A[5][2] = SUN_RCONST(-0.04245337201752043); - B->A[5][3] = SUN_RCONST(0.02446657898003141); - B->A[5][4] = SUN_RCONST(0.61943039072480676); + B->A[5][0] = SUN_RCONST(0.1385564023126822495054973091161581456582); + B->A[5][2] = SUN_RCONST(-0.04245337201752043098884399725982168512523); + B->A[5][3] = SUN_RCONST(0.02446657898003141965963581513879101305561); + B->A[5][4] = SUN_RCONST(0.6194303907248067618237108730048725264114); B->A[5][5] = SUN_RCONST(0.26); - B->A[6][0] = SUN_RCONST(0.13659751177640291); - B->A[6][2] = SUN_RCONST(-0.05496908796538376); - B->A[6][3] = SUN_RCONST(-0.04118626728321046); - B->A[6][4] = SUN_RCONST(0.62993304899016403); - B->A[6][5] = SUN_RCONST(0.06962479448202728); + B->A[6][0] = SUN_RCONST(0.1365975117764029144062783844146127033921); + B->A[6][2] = SUN_RCONST(-0.05496908796538376712487773114648630009105); + B->A[6][3] = SUN_RCONST(-0.04118626728321046868299776958296295741592); + B->A[6][4] = SUN_RCONST(0.6299330489901640319161060392667246534806); + B->A[6][5] = SUN_RCONST(0.06962479448202728948549107704811190063421); B->A[6][6] = SUN_RCONST(0.26); - B->b[0] = SUN_RCONST(0.13659751177640291); - B->b[2] = SUN_RCONST(-0.05496908796538376); - B->b[3] = SUN_RCONST(-0.04118626728321046); - B->b[4] = SUN_RCONST(0.62993304899016403); - B->b[5] = SUN_RCONST(0.06962479448202728); + B->b[0] = SUN_RCONST(0.1365975117764029144062783844146127033921); + B->b[2] = SUN_RCONST(-0.05496908796538376712487773114648630009105); + B->b[3] = SUN_RCONST(-0.04118626728321046868299776958296295741592); + B->b[4] = SUN_RCONST(0.6299330489901640319161060392667246534806); + B->b[5] = SUN_RCONST(0.06962479448202728948549107704811190063421); B->b[6] = SUN_RCONST(0.26); - B->d[0] = SUN_RCONST(0.13855640231268224); - B->d[2] = SUN_RCONST(-0.04245337201752043); - B->d[3] = SUN_RCONST(0.02446657898003141); - B->d[4] = SUN_RCONST(0.61943039072480676); + B->d[0] = SUN_RCONST(0.1385564023126822495054973091161581456582); + B->d[2] = SUN_RCONST(-0.04245337201752043098884399725982168512523); + B->d[3] = SUN_RCONST(0.02446657898003141965963581513879101305561); + B->d[4] = SUN_RCONST(0.6194303907248067618237108730048725264114); B->d[5] = SUN_RCONST(0.26); B->c[1] = SUN_RCONST(0.52); - B->c[2] = SUN_RCONST(1.230333209967908); - B->c[3] = SUN_RCONST(0.895765984350076); - B->c[4] = SUN_RCONST(0.436393609858648); + B->c[2] = SUN_RCONST(1.230333209967908096317136048791526815405); + B->c[3] = SUN_RCONST(0.8957659843500759029060455717495554776153); + B->c[4] = SUN_RCONST(0.4363936098586475852779768695817865330279); B->c[5] = SUN_RCONST(1.0); B->c[6] = SUN_RCONST(1.0); return B; From 166cd2275e1eba689191ea4df92b3fd8d4b5da62 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Wed, 30 Oct 2024 11:46:08 -0700 Subject: [PATCH 115/137] CI: Enable GitLab CI on Tioga and Dane (#595) --- .gitlab-ci.yml | 203 ++++++++-------- .gitlab/build_and_test.sh | 62 ++--- .gitlab/corona-jobs.yml | 48 ---- .gitlab/corona-templates.yml | 35 --- .gitlab/custom-jobs-and-variables.yml | 84 +++++++ .gitlab/jobs/dane.yml | 66 +++++ .gitlab/jobs/tioga.yml | 92 +++++++ .gitlab/lassen-jobs.yml | 45 ---- .gitlab/lassen-templates.yml | 56 ----- .gitlab/quartz-jobs.yml | 85 ------- .gitlab/quartz-templates.yml | 35 --- .gitlab/radiuss-spack-configs | 2 +- .../netlib-lapack/ibm-xl-3.9.1.patch | 108 --------- .../spack_packages/netlib-lapack/ibm-xl.patch | 53 ---- .../spack_packages/netlib-lapack/package.py | 223 ----------------- .../netlib-lapack/testing.patch | 13 - .../undefined_declarations.patch | 26 -- .gitlab/subscribed-pipelines.yml | 77 ++++++ .gitlab/uberenv | 2 +- .gitmodules | 2 +- .uberenv_config.json | 5 +- cmake/macros/SundialsAddTest.cmake | 46 +++- doc/shared/sundials/Install.rst | 17 ++ .../developers/style_guide/Documentation.rst | 12 + .../source/developers/testing/CI.rst | 226 +++++++++--------- examples/nvector/petsc/CMakeLists.txt | 5 +- examples/sunnonlinsol/petsc/CMakeLists.txt | 7 +- .../petsc/test_sunnonlinsol_petscsnes.c | 1 + ...missing-README-to-examples-cvode-hip.patch | 0 .../sundials/5.5.0-xsdk-patches.patch | 0 .../sundials/FindPackageMultipass.cmake.patch | 0 .../packages}/sundials/nvector-pic.patch | 0 .../spack/packages}/sundials/package.py | 26 +- .../remove-links-to-OpenMP-vector.patch | 0 .../packages}/sundials/sundials-v5.8.0.patch | 0 .../sundials/test_nvector_parhyp.patch | 0 scripts/spack/repo.yaml | 2 + 37 files changed, 642 insertions(+), 1022 deletions(-) delete mode 100644 .gitlab/corona-jobs.yml delete mode 100644 .gitlab/corona-templates.yml create mode 100644 .gitlab/custom-jobs-and-variables.yml create mode 100644 .gitlab/jobs/dane.yml create mode 100644 .gitlab/jobs/tioga.yml delete mode 100644 .gitlab/lassen-jobs.yml delete mode 100644 .gitlab/lassen-templates.yml delete mode 100644 .gitlab/quartz-jobs.yml delete mode 100644 .gitlab/quartz-templates.yml delete mode 100644 .gitlab/spack_packages/netlib-lapack/ibm-xl-3.9.1.patch delete mode 100644 .gitlab/spack_packages/netlib-lapack/ibm-xl.patch delete mode 100644 .gitlab/spack_packages/netlib-lapack/package.py delete mode 100644 .gitlab/spack_packages/netlib-lapack/testing.patch delete mode 100644 .gitlab/spack_packages/netlib-lapack/undefined_declarations.patch create mode 100644 .gitlab/subscribed-pipelines.yml rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/0001-add-missing-README-to-examples-cvode-hip.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/5.5.0-xsdk-patches.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/FindPackageMultipass.cmake.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/nvector-pic.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/package.py (98%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/remove-links-to-OpenMP-vector.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/sundials-v5.8.0.patch (100%) rename {.gitlab/spack_packages => scripts/spack/packages}/sundials/test_nvector_parhyp.patch (100%) create mode 100644 scripts/spack/repo.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c02b239373..b748728bc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,23 @@ -# --------------------------------------------------------------- +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# SPDX-License-Identifier: (MIT) +############################################################################### +# Modifications to this file have been made under the folllowing copyright. +# ----------------------------------------------------------------------------- # SUNDIALS Copyright Start -# Copyright (c) 2002-2021, Lawrence Livermore National Security +# Copyright (c) 2002-2024, Lawrence Livermore National Security # and Southern Methodist University. # All rights reserved. # @@ -8,129 +25,97 @@ # # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End -# --------------------------------------------------------------- +# ----------------------------------------------------------------------------- +# DESCRIPTION: ############################################################################### # General GitLab pipelines configurations for supercomputers and Linux clusters # at Lawrence Livermore National Laboratory (LLNL). -############################################################################### - -# We define the following GitLab pipeline variables (all of which can be -# set from the GitLab CI "run pipeline" UI): -# -# GIT_SUBMODULE_STRATEGY: -# Tells Gitlab to recursively update the submodules when cloning. -# -# ALLOC_NAME: -# Allocation unique name. -# -# BUILD_ROOT: -# The path to the shared resources between all jobs. The BUILD_ROOT is unique to -# the pipeline, preventing any form of concurrency with other pipelines. This -# also means that the BUILD_ROOT directory will never be cleaned. -# -# DEFAULT_TIME: -# Default time to let the jobs run will be 30 minutes. -# -# BUILD_JOBS: -# Number of threads to use for builds. -# -# NCPU: -# Number of CPUs to alloc. +# This entire pipeline is LLNL-specific # -# VERBOSE_BUILD: -# Sets CMAKE_VERBOSE_MAKEFILE to TRUE when "ON". +# Important note: This file is a template provided by llnl/radiuss-shared-ci. +# Remains to set variable values, change the reference to the radiuss-shared-ci +# repo, opt-in and out optional features. The project can then extend it with +# additional stages. # -# VERBOSE_TEST: -# Passes --verbose to CTest when "ON". +# In addition, each project should copy over and complete: +# - .gitlab/custom-jobs-and-variables.yml +# - .gitlab/subscribed-pipelines.yml # -# ON_LASSEN: -# Should the Lassen pipeline run? Set to "ON" or "OFF" to enable/disable. -# -# ON_QUARTZ: -# Should the Quartz pipeline run? Set to "ON" or "OFF" to enable/disable. -# -# SPACK_PREFIX: prefix used for shared spack installation. -# Usually this a spack version number that matches the version set in the uberenv_config.json file. -# Spack installs go in /usr/workspace/sundials/spack_installs/${SPACK_PREFIX}/$(hostname). -# -# SHARED_SPACK: -# If "ON", then a shared spack install that has been pre-configured is utilized. -# If "OFF", then a new spack instance is created for every build (meaning all TPLs have to be installed). -# If "UPSTREAM" (the default), then the shared spack is used as an upstream for a build specific spack. -# -# BENCHMARK: -# If "ON", then the SUNDIALS benchmark problems are run and generate profiles. -# -# BENCHMARK_NNODES: -# Number of nodes to use for benchmarks. Default is 4. -# -# BENCHMARK_QUEUE: -# What queue to submit the benchmarks too. Default is pbatch (for Livermore). +# The jobs should be specified in a file local to the project, +# - .gitlab/jobs/${CI_MACHINE}.yml +# or generated (see LLNL/Umpire for an example). +############################################################################### +# We define the following GitLab pipeline variables: variables: +##### LC GITLAB CONFIGURATION +# Use an LLNL service user to run CI. This prevents from running pipelines as +# an actual user. + LLNL_SERVICE_USER: "" +# Use the service user workspace. Solves permission issues, stores everything +# at the same location whoever triggers a pipeline. + CUSTOM_CI_BUILDS_DIR: "/usr/workspace/sundials/ci/.builds/" +# Tells Gitlab to recursively update the submodules when cloning the project. GIT_SUBMODULE_STRATEGY: recursive - ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} - BUILD_ROOT: ${CI_PROJECT_DIR} - DEFAULT_TIME: 30 - BUILD_JOBS: 32 - NCPUS: 12 - VERBOSE_BUILD: "OFF" - VERBOSE_TEST: "OFF" - ON_LASSEN: "ON" - ON_QUARTZ: "ON" - ON_CORONA: "ON" - SPACK_PREFIX: "v0.19.1" - SHARED_SPACK: "UPSTREAM" - BENCHMARK: "OFF" - BENCHMARK_NNODES: 4 - BENCHMARK_QUEUE: "pbatch" - -# Normally, stages are blocking in Gitlab. However, using the keyword "needs" we -# can express dependencies between job that break the ordering of stages, in -# favor of a DAG. -# In practice q_*, l_* and c_* stages are independently run and start immediately. -stages: - - q_build_and_test - - l_build_and_test - - l_build_and_bench - - c_build_and_test +##### PROJECT VARIABLES +# We build the projects in the CI clone directory. +# Used in script/gitlab/build_and_test.sh script. +# TODO: add a clean-up mechanism. + BUILD_ROOT: ${CI_PROJECT_DIR} + SPACK_REF: "594a376c521cc746978571b1181a47bbcff30a21" # v0.22.2 -# These are also templates (.name) that define project specific build commands. -# If an allocation exist with the name defined in this pipeline, the job will -# use it (slurm specific). -.build_toss_3_x86_64_ib_script: - script: - - echo ${ALLOC_NAME} - - srun -p pdebug -N 1 -n ${NCPUS} --interactive -t ${DEFAULT_TIME} - --job-name=${ALLOC_NAME} .gitlab/build_and_test.sh +##### SHARED_CI CONFIGURATION +# Required information about GitHub repository + GITHUB_PROJECT_NAME: "sundials" + GITHUB_PROJECT_ORG: "LLNL" +# Set the build-and-test command. +# Nested variables are allowed and useful to customize the job command. We +# prevent variable expansion so that you can define them at job level. + JOB_CMD: + value: ".gitlab/build_and_test.sh" + expand: false +# Override the pattern describing branches that will skip the "draft PR filter +# test". Add protected branches here. See default value in +# preliminary-ignore-draft-pr.yml. +# ALWAYS_RUN_PATTERN: "" -# Corona -.build_toss_4_x86_64_ib_corona_script: - script: - - echo ${ALLOC_NAME} - - flux alloc -N 1 -t ${DEFAULT_TIME} .gitlab/build_and_test.sh +# We organize the build-and-test stage with sub-pipelines. Each sub-pipeline +# corresponds to a test batch on a given machine. -# CORAL systems use spectrum LSF instead of SLURM -.build_blueos_3_ppc64le_ib_script: - script: - - echo ${ALLOC_NAME} - - bsub -q pdebug -J ${ALLOC_NAME} -nnodes 1 -W ${DEFAULT_TIME} -Is .gitlab/build_and_test.sh +# High level stages +stages: + - prerequisites + - build-and-test -# Benchmark job for CORAL systems -.build_blueos_3_ppc64le_ib_bench: - script: - - echo ${ALLOC_NAME} - - bsub -q ${BENCHMARK_QUEUE} -J ${ALLOC_NAME} -nnodes ${BENCHMARK_NNODES} -W ${DEFAULT_TIME} -Is .gitlab/build_and_bench.sh +# Template for jobs triggering a build-and-test sub-pipeline: +.build-and-test: + stage: build-and-test + trigger: + include: + - local: '.gitlab/custom-jobs-and-variables.yml' + - project: 'sundials/radiuss-shared-ci' # https://lc.llnl.gov/gitlab/sundials/radiuss-shared-ci + ref: 'ae1f3786591beed83abc6a0de2229f6e9532e2d4' + file: 'pipelines/${CI_MACHINE}.yml' + # Add your jobs + # you can use a local file + - local: '.gitlab/jobs/${CI_MACHINE}.yml' + # or a file generated in the previous steps + # - artifact: '${CI_MACHINE}-jobs.yml' + # job: 'generate-job-file' + # (See Umpire CI setup for an example). + strategy: depend + forward: + pipeline_variables: true -# This is where jobs are included. include: + # Sets ID tokens for every job using `default:` - project: 'lc-templates/id_tokens' file: 'id_tokens.yml' - - local: .gitlab/quartz-templates.yml - - local: .gitlab/quartz-jobs.yml - - local: .gitlab/lassen-templates.yml - - local: .gitlab/lassen-jobs.yml - - local: .gitlab/corona-templates.yml - - local: .gitlab/corona-jobs.yml + # # [Optional] checks preliminary to running the actual CI test + # - project: 'radiuss/radiuss-shared-ci' + # ref: 'v2024.04.0' + # file: 'utilities/preliminary-ignore-draft-pr.yml' + # pipelines subscribed by the project + - local: '.gitlab/subscribed-pipelines.yml' diff --git a/.gitlab/build_and_test.sh b/.gitlab/build_and_test.sh index cf7ab193fa..04abb537ea 100755 --- a/.gitlab/build_and_test.sh +++ b/.gitlab/build_and_test.sh @@ -20,9 +20,6 @@ job_unique_id=${CI_JOB_ID:-""} sys_type=${SYS_TYPE:-""} py_env_path=${PYTHON_ENVIRONMENT_PATH:-""} -spack_prefix=${SHARED_SPACK_PREFIX:-"v0.19.1"} -shared_spack=${SHARED_SPACK:-"UPSTREAM"} - # Dependencies date @@ -38,7 +35,6 @@ echo "spec = ${spec}" echo "job_unique_id = ${job_unique_id}" echo "sys_type = ${sys_type}" echo "py_env_path = ${py_env_path}" -echo "shared_spack = ${shared_spack}" # remove tailing number from hostname hostname=${hostname%%[0-9]*} @@ -46,19 +42,6 @@ hostname=${hostname%%[0-9]*} # number of parallel build jobs BUILD_JOBS=${BUILD_JOBS:-"1"} -# load newer python to try the clingo concretizer -# machine specific loads -if [[ "${hostname}" == "lassen" ]]; then - echo "module load python/3.8.2" - module load python/3.8.2 -elif [[ "${hostname}" == "corona" ]]; then - echo "module load python/3.9.12" - module load python/3.9.12 -else - echo "module load python" - module load python -fi - if [[ "${option}" != "--build-only" && "${option}" != "--test-only" ]] then echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" @@ -97,35 +80,29 @@ then mkdir -p ${spack_user_cache} fi - if [[ -d /usr/workspace/sundials ]] - then - upstream="/usr/workspace/sundials/spack_installs/${spack_prefix}/${hostname}" - mkdir -p "${upstream}" - upstream_opt="--upstream=${upstream}" - fi + mirror_opt="" + buildcache="/usr/workspace/sundials/ci/spack_stuff/build_caches/${SPACK_REF}" - if [[ "${shared_spack}" == "UPSTREAM" ]] + if [[ ! -d "${buildcache}" ]] then - python3 .gitlab/uberenv/uberenv.py --spec="${spec}" "${prefix_opt}" "${upstream_opt}" - elif [[ "${shared_spack}" == "ON" ]] - then - python3 .gitlab/uberenv/uberenv.py --spec="${spec}" --prefix="${upstream}" - else - python3 .gitlab/uberenv/uberenv.py --spec="${spec}" "${prefix_opt}" + mkdir "${buildcache}" fi - # Ensure correct CUDA module is loaded, only works for module naming - # convention on Lassen. Only needed for CUDA 11 (unclear why). - if [[ -n "${CUDA_SPEC}" ]]; then - cuda_version="${CUDA_SPEC##*@}" - echo "module load cuda/${cuda_version}" - module load cuda/"${cuda_version}" - fi + mirror_opt=("--mirror=${buildcache}" "--mirror-autopush") - module load cmake/3.23 + key_path=/usr/workspace/sundials/ci/spack_stuff/gpg_backup + python3 .gitlab/uberenv/uberenv.py \ + --trust-key ${key_path}/pubring.gpg --trust-key ${key_path}/secring.gpg \ + --spec="${spec}" "${mirror_opt[@]}" "${prefix_opt}" \ + --spack-commit="${SPACK_REF}" fi + date +# Reload the spack environment created by uberenv +. ${prefix}/spack/share/spack/setup-env.sh +spack load + # Host config file if [[ -z ${hostconfig} ]] then @@ -173,6 +150,9 @@ then echo "~ Host-config: ${hostconfig_path}" echo "~ Build Dir: ${build_dir}" echo "~ Project Dir: ${project_dir}" + echo "~ MPIEXEC_EXECUTABLE: ${MPIEXEC_EXECUTABLE}" + echo "~ MPIEXEC_PREFLAGS: ${MPIEXEC_PREFLAGS}" + echo "~ MPIEXEC_POSTFLAGS: ${MPIEXEC_POSTFLAGS}" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" @@ -195,6 +175,9 @@ then $cmake_exe \ -C "${hostconfig_path}" \ -DCMAKE_INSTALL_PREFIX=${install_dir} \ + -DMPIEXEC_EXECUTABLE=$(which $MPIEXEC_EXECUTABLE) \ + -DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS} \ + -DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS} \ -DSUNDIALS_CALIPER_OUTPUT_DIR="${CALIPER_DIR}/Release/${hostname}/${sundials_version}" \ "${project_dir}" @@ -202,6 +185,9 @@ then $cmake_exe \ -C "${hostconfig_path}" \ -DCMAKE_INSTALL_PREFIX=${install_dir} \ + -DMPIEXEC_EXECUTABLE=$(which $MPIEXEC_EXECUTABLE) \ + -DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS} \ + -DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS} \ "${project_dir}" fi diff --git a/.gitlab/corona-jobs.yml b/.gitlab/corona-jobs.yml deleted file mode 100644 index f694611c39..0000000000 --- a/.gitlab/corona-jobs.yml +++ /dev/null @@ -1,48 +0,0 @@ -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# ------------------------------------------------------------------------------ - -# ------------------------------------------------------------------------------ -# HIP -# ------------------------------------------------------------------------------ - -# Builds with HIP -corona_rocmcc_550: - parallel: - matrix: - - COMPILER_SPEC: rocmcc@5.5.0 - AMDGPU_TARGET: [gfx906] - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double amdgpu_target=${AMDGPU_TARGET} scheduler=flux +rocm+mpi" - extends: .corona_build_and_test - -# ------------------------------------------------------------------------------ -# HIP + TPLs -# ------------------------------------------------------------------------------ -corona_rocmcc_550_tpls: - parallel: - matrix: - - COMPILER_SPEC: rocmcc@5.5.0 - AMDGPU_TARGET: [gfx906] - ROCM_VERSION: 5.5.0 - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double ~int64 amdgpu_target=${AMDGPU_TARGET} scheduler=flux +rocm+mpi+magma+raja+kokkos+kokkos-kernels~ginkgo ^magma+rocm amdgpu_target=${AMDGPU_TARGET} ^raja+rocm~openmp~examples~exercises amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm~profiling amdgpu_target=${AMDGPU_TARGET} ^hipblas@${ROCM_VERSION} ^hipsparse@${ROCM_VERSION} ^hip@${ROCM_VERSION} ^hsa-rocr-dev@${ROCM_VERSION} ^llvm-amdgpu@${ROCM_VERSION}" - extends: .corona_build_and_test - -corona_rocmcc_523_tpls: - parallel: - matrix: - - COMPILER_SPEC: rocmcc@5.2.3 - AMDGPU_TARGET: [gfx906] - ROCM_VERSION: 5.2.3 - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double ~int64 amdgpu_target=${AMDGPU_TARGET} scheduler=flux +rocm+mpi+magma+raja+kokkos+kokkos-kernels+ginkgo ^magma+rocm amdgpu_target=${AMDGPU_TARGET} ^raja+rocm~openmp~examples~exercises amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm~profiling amdgpu_target=${AMDGPU_TARGET} ^ginkgo+rocm amdgpu_target=${AMDGPU_TARGET} ^hipblas@${ROCM_VERSION} ^hipsparse@${ROCM_VERSION} ^rocrand@${ROCM_VERSION} ^rocthrust@${ROCM_VERSION} ^hip@${ROCM_VERSION} ^hsa-rocr-dev@${ROCM_VERSION} ^llvm-amdgpu@${ROCM_VERSION} ^rocprim@${ROCM_VERSION}" - extends: .corona_build_and_test diff --git a/.gitlab/corona-templates.yml b/.gitlab/corona-templates.yml deleted file mode 100644 index a901f4fa48..0000000000 --- a/.gitlab/corona-templates.yml +++ /dev/null @@ -1,35 +0,0 @@ -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# ------------------------------------------------------------------------------ - -# ------------------------------------------------------------------------------ -# Tags and rules to run tests on Corona -# ------------------------------------------------------------------------------ - -# Generic Corona build job, extending build script for Toss 4 x86_64 Systems -.corona_build_and_test: - tags: - - shell - - corona - extends: [.build_toss_4_x86_64_ib_corona_script] - stage: c_build_and_test - needs: [] - artifacts: - paths: - - spack-*.txt - - build_*/* - when: always - rules: - # Don't run if... - - if: '$CI_COMMIT_BRANCH =~ /_cnone/ || $ON_CORONA == "OFF" || $BENCHMARK == "ON"' - when: never - # Default is to run if previous stage succeeded - - when: on_success diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml new file mode 100644 index 0000000000..1b830e2e3c --- /dev/null +++ b/.gitlab/custom-jobs-and-variables.yml @@ -0,0 +1,84 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# SPDX-License-Identifier: (MIT) +############################################################################### +# Modifications to this file have been made under the folllowing copyright. +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ----------------------------------------------------------------------------- + +# We define the following GitLab pipeline variables: +variables: +# In some pipelines we create only one allocation shared among jobs in +# order to save time and resources. This allocation has to be uniquely +# named so that we are sure to retrieve it and avoid collisions. + ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} + +# Dane +# Arguments for top level allocation + DANE_SHARED_ALLOC: "--exclusive --reservation=ci --time=60 --nodes=1" +# Arguments for job level allocation + DANE_JOB_ALLOC: "--time=55 --nodes=1 --overlap" +# Add variables that should apply to all the jobs on a machine: +# DANE_MY_VAR: "..." + +# Tioga +# Arguments for top level allocation + TIOGA_SHARED_ALLOC: "--exclusive --queue pci --time-limit=60m --nodes=1" +# Arguments for job level allocation + TIOGA_JOB_ALLOC: "--time-limit=55m --nodes=1" +# Add variables that should apply to all the jobs on a machine: +# TIOGA_MY_VAR: "..." + +# Number of threads to use for builds. + BUILD_JOBS: 32 + +# Sets CMAKE_VERBOSE_MAKEFILE to TRUE when "ON". + VERBOSE_BUILD: "ON" + +# Passes --verbose to CTest when "ON". + VERBOSE_TEST: "ON" + +# Should the Dane pipeline run? Set to "ON" or "OFF" to enable/disable. + ON_DANE: "ON" + +# Should the Tioga pipeline run? Set to "ON" or "OFF" to enable/disable. + ON_TIOGA: "ON" + +# If "ON", then the SUNDIALS benchmark problems are run and generate profiles. + BENCHMARK: "OFF" + +# Number of nodes to use for benchmarks. Default is 4. + BENCHMARK_NNODES: 4 + +# What queue to submit the benchmarks too. Default is pbatch (for Livermore). + BENCHMARK_QUEUE: "pbatch" + +# Configuration shared by build and test jobs specific to this project. +# Not all configuration can be shared. Here projects can fine tune the +# CI behavior. +# See Umpire for an example (export junit test reports). +.custom_job: + variables: + SPACK_DISABLE_LOCAL_CONFIG: "true" + SPACK_USER_CACHE_PATH: /tmp/spack diff --git a/.gitlab/jobs/dane.yml b/.gitlab/jobs/dane.yml new file mode 100644 index 0000000000..bcb31c8bc8 --- /dev/null +++ b/.gitlab/jobs/dane.yml @@ -0,0 +1,66 @@ +############################################################################## +# Copyright (c) 2022-24, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################## +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ + +########################################## +# Overridden shared radiuss-shared-ci jobs +########################################## + +# We duplicate the shared jobs description and add necessary changes for this +# project. We keep ${PROJECT_<MACHINE>_VARIANTS} and ${PROJECT_<MACHINE>_DEPS} +# So that the comparison with the original job is easier. + +# No overridden jobs so far. + +######################## +# Extra jobs +######################## + +.sundials_job_on_dane: + variables: + MPIEXEC_EXECUTABLE: "srun" + extends: [.custom_job, .job_on_dane] + +dane_clang_tpls: + parallel: + matrix: + - COMPILER_SPEC: clang@14.0.6 + INDEX_SPEC: [~int64] + PRECISION_SPEC: [double] + variables: + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} +f2003+mpi+openmp+hypre+superlu-dist+lapack+klu+petsc+ginkgo+kokkos+kokkos-kernels~trilinos ^openblas" + extends: .sundials_job_on_dane + +dane_gcc_tpls: + parallel: + matrix: + - COMPILER_SPEC: gcc@10.3.1 + INDEX_SPEC: [~int64] + PRECISION_SPEC: [double] + variables: + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} +f2003+mpi+openmp+hypre+superlu-dist+lapack+klu+petsc+ginkgo+kokkos+kokkos-kernels~trilinos ^netlib-lapack" + extends: .sundials_job_on_dane + +dane_intel_tpls: + parallel: + matrix: + - COMPILER_SPEC: intel@2023.2.1 + INDEX_SPEC: [~int64] + PRECISION_SPEC: [double] + variables: + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} ~f2003+mpi+openmp+hypre+superlu-dist+lapack~klu+petsc+ginkgo+kokkos+kokkos-kernels~trilinos ^intel-oneapi-mkl" + extends: .sundials_job_on_dane diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml new file mode 100644 index 0000000000..3a38476cca --- /dev/null +++ b/.gitlab/jobs/tioga.yml @@ -0,0 +1,92 @@ +############################################################################## +# Copyright (c) 2022-24, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################## +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ + +########################################## +# Overridden shared radiuss-shared-ci jobs +########################################## + +# We duplicate the shared jobs description and add necessary changes for this +# project. We keep ${PROJECT_<MACHINE>_VARIANTS} and ${PROJECT_<MACHINE>_DEPS} +# So that the comparison with the original job is easier. + +# No overridden jobs so far. + +######################## +# Extra jobs +######################## + +.sundials_job_on_tioga: + variables: + MPIEXEC_EXECUTABLE: "flux" + MPIEXEC_PREFLAGS: "run" + extends: [.custom_job, .job_on_tioga] + +# --- Builds with HIP + +# Builds fine but non-mpi tests fail to execute due to a missing so: +# error while loading shared libraries: libpgmath.so: cannot open shared object file: No such file or directory +# This seems like it might be an LC environment issue, so disabling the job for now. +tioga_rocmcc_571_tpls: + parallel: + matrix: + - COMPILER_SPEC: rocmcc@5.7.1 + AMDGPU_TARGET: [gfx90a] + variables: + ON_TIOGA: "OFF" # disable until we can figure out libpgmath.so error + # have to use ginkgo@master because our spack version does not have ginkgo@1.8.0: yet (which seems to be needed) + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double amdgpu_target=${AMDGPU_TARGET} +rocm+mpi+magma+ginkgo+kokkos ^magma+rocm amdgpu_target=${AMDGPU_TARGET} ^ginkgo@master+rocm amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm amdgpu_target=${AMDGPU_TARGET}" + before_script: + - module load rocmcc/5.7.1-magic + extends: [.sundials_job_on_tioga] + +tioga_rocmcc_620_tpls: + parallel: + matrix: + - COMPILER_SPEC: rocmcc@6.2.0 + AMDGPU_TARGET: [gfx90a] + variables: + # have to use ginkgo@master because our spack version does not have ginkgo@1.8.0: yet (which seems to be needed) + # similarly, we need a newer magma than available to compile with 'rocm@6:' so we turn it off + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double amdgpu_target=${AMDGPU_TARGET} +rocm+mpi~magma+ginkgo+kokkos ^ginkgo@master+rocm amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm amdgpu_target=${AMDGPU_TARGET}" + before_script: + - module load rocmcc/6.2.0-magic + extends: [.sundials_job_on_tioga] + +# --- Builds without HIP + +tioga_cce_1800_mpi_only: + parallel: + matrix: + - COMPILER_SPEC: cce@18.0.0 + variables: + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double +mpi" + extends: [.sundials_job_on_tioga] + + +# --- Benchmark jobs + +tioga_rocmcc_620_benchmark: + parallel: + matrix: + - COMPILER_SPEC: rocmcc@6.2.0 + AMDGPU_TARGET: [gfx90a] + CALIPER_DIR: /usr/workspace/sundials/ci/performance/califiles + variables: + ON_TIOGA: "OFF" # disable until we re-baseline on Tioga + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 build_type=Release precision=double scheduler=flux caliper-dir=${CALIPER_DIR} ~int64 +benchmarks+profiling+caliper+adiak+mpi+openmp+rocm+raja amdgpu_target=${AMDGPU_TARGET} ^raja+rocm~openmp~examples~exercises amdgpu_target=${AMDGPU_TARGET} ^caliper+adiak+rocm amdgpu_target=${AMDGPU_TARGET}" + extends: [.sundials_job_on_tioga] diff --git a/.gitlab/lassen-jobs.yml b/.gitlab/lassen-jobs.yml deleted file mode 100644 index 1ffca71d46..0000000000 --- a/.gitlab/lassen-jobs.yml +++ /dev/null @@ -1,45 +0,0 @@ -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# ------------------------------------------------------------------------------ - -# Builds with CUDA, RAJA and other TPLs -lassen_cuda_no_tpls: - parallel: - matrix: - - COMPILER_SPEC: [xl@16.1.1.14] - CUDA_SPEC: [cuda@10.1.243] - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double ~int64 +mpi+openmp+cuda~raja~magma~superlu-dist~petsc~hypre~ginkgo cuda_arch=70 ^${CUDA_SPEC}+allow-unsupported-compilers" - extends: .lassen_build_and_test - -lassen_gcc_cuda_tpls: - parallel: - matrix: - - COMPILER_SPEC: gcc@8.3.1 - CUDA_SPEC: [cuda@11.8.0] - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double ~int64 +mpi+openmp+cuda+raja+magma+superlu-dist+petsc+hypre+ginkgo cuda_arch=70 ^ginkgo+cuda cuda_arch=70 ^hypre~cuda ^petsc~cuda ^superlu-dist+cuda cuda_arch=70 ^magma+cuda cuda_arch=70 ^raja+cuda~openmp~examples~exercises cuda_arch=70 ^${CUDA_SPEC}+allow-unsupported-compilers" - extends: .lassen_build_and_test - -# ------------------------------------------------------------------------------ -# Benchmark jobs -# ------------------------------------------------------------------------------ - -lassen_gcc_cuda_bench: - parallel: - matrix: - - COMPILER_SPEC: gcc@8.3.1 - CUDA_SPEC: [cuda@11.8.0] - CALIPER_DIR: /usr/workspace/sundials/califiles - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 build_type=Release precision=double scheduler=lsf caliper-dir=${CALIPER_DIR} ~int64 +benchmarks+profiling+caliper+adiak+mpi+openmp+cuda+raja cuda_arch=70 ^raja+cuda~openmp~examples~exercises cuda_arch=70 ^caliper+adiak+cuda cuda_arch=70 ^${CUDA_SPEC}+allow-unsupported-compilers" - extends: .lassen_build_and_bench - diff --git a/.gitlab/lassen-templates.yml b/.gitlab/lassen-templates.yml deleted file mode 100644 index 450a3134c2..0000000000 --- a/.gitlab/lassen-templates.yml +++ /dev/null @@ -1,56 +0,0 @@ -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# ------------------------------------------------------------------------------ - -# ------------------------------------------------------------------------------ -# Tags and rules to run tests on Lassen -# ------------------------------------------------------------------------------ - -# Generic lassen build job, extending build script for IBM P9 systems -.lassen_build_and_test: - tags: - - shell - - lassen - extends: [.build_blueos_3_ppc64le_ib_script] - stage: l_build_and_test - needs: [] - artifacts: - paths: - - spack-*.txt - - build_*/* - when: always - rules: - # Don't run if... - - if: '$CI_COMMIT_BRANCH =~ /_lnone/ || $ON_LASSEN == "OFF" || $BENCHMARK == "ON"' - when: never - # Default is to run if previous stage succeeded - - when: on_success - -.lassen_build_and_bench: - tags: - - shell - - lassen - extends: [.build_blueos_3_ppc64le_ib_bench] - stage: l_build_and_bench - needs: [] - artifacts: - paths: - - spack-*.txt - - build_*/* - - '*.cali' - when: always - expire_in: never - rules: - # Don't run if... - - if: '$CI_COMMIT_BRANCH =~ /_lnone/ || $ON_LASSEN == "OFF" || $BENCHMARK == "OFF"' - when: never - # Default is to run if previous stage succeeded - - when: on_success diff --git a/.gitlab/quartz-jobs.yml b/.gitlab/quartz-jobs.yml deleted file mode 100644 index a0c96755a6..0000000000 --- a/.gitlab/quartz-jobs.yml +++ /dev/null @@ -1,85 +0,0 @@ -# --------------------------------------------------------------- -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# --------------------------------------------------------------- - -# ------------------------------------------------------------------------------ -# Basic builds w/o TPLs -# ------------------------------------------------------------------------------ -### Builds without TPLs -# How to easily add +f2003 when int64 and double? - -# quartz_clang: -# parallel: -# matrix: -# - COMPILER_SPEC: clang@12.0.0 -# INDEX_SPEC: [~int64, +int64] -# PRECISION_SPEC: [double] -# variables: -# SPEC: "%${COMPILER_SPEC} ${INDEX_SPEC} precision=${PRECISION_SPEC}" -# extends: .quartz_build_and_test - -# quartz_gcc: -# parallel: -# matrix: -# - COMPILER_SPEC: gcc@10.3.1 -# INDEX_SPEC: [~int64, +int64] -# PRECISION_SPEC: [double] -# variables: -# SPEC: "%${COMPILER_SPEC} ${INDEX_SPEC} precision=${PRECISION_SPEC}" -# extends: .quartz_build_and_test - -# quartz_intel: -# parallel: -# matrix: -# - COMPILER_SPEC: intel@19.1.2 -# INDEX_SPEC: [~int64, +int64] -# PRECISION_SPEC: [double] -# variables: -# SPEC: "%${COMPILER_SPEC} ${INDEX_SPEC} precision=${PRECISION_SPEC}" -# extends: .quartz_build_and_test - -# ------------------------------------------------------------------------------ -# Builds with TPLs -# ------------------------------------------------------------------------------ -# +petsc ~hypre ~superlu-dist ~int64 ~hdf5 -# +superlu-dist == segfaults - -quartz_clang_tpls: - parallel: - matrix: - - COMPILER_SPEC: clang@14.0.6 - INDEX_SPEC: [~int64] - PRECISION_SPEC: [double] - variables: - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} +mpi +openmp +hypre +superlu-dist +lapack +klu +petsc ^suite-sparse@5.13.0 ^openblas" - extends: .quartz_build_and_test - -quartz_gcc_tpls: - parallel: - matrix: - - COMPILER_SPEC: gcc@10.3.1 - INDEX_SPEC: [~int64] - PRECISION_SPEC: [double] - variables: - # For some reason nvhpc gets picked up for lapack w/o ^openblas - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} +mpi +openmp +hypre +superlu-dist +lapack +klu +petsc ^suite-sparse@5.13.0 ^openblas" - extends: .quartz_build_and_test - -quartz_intel_tpls: - parallel: - matrix: - - COMPILER_SPEC: intel@19.1.2 - INDEX_SPEC: [~int64] - PRECISION_SPEC: [double] - variables: - # perl@5.32.0 needed until spack v0.20.0: https://github.com/spack/spack/pull/35666 - SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 ${INDEX_SPEC} precision=${PRECISION_SPEC} +mpi +openmp +hypre ~superlu-dist +lapack +klu ^suite-sparse@5.13.0 ^perl@5.32.0" - extends: .quartz_build_and_test diff --git a/.gitlab/quartz-templates.yml b/.gitlab/quartz-templates.yml deleted file mode 100644 index bfc33a3fd5..0000000000 --- a/.gitlab/quartz-templates.yml +++ /dev/null @@ -1,35 +0,0 @@ -# ------------------------------------------------------------------------------ -# SUNDIALS Copyright Start -# Copyright (c) 2002-2021, 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 -# ------------------------------------------------------------------------------ - -# ------------------------------------------------------------------------------ -# Tags and rules to run tests on Quartz -# ------------------------------------------------------------------------------ - -# Generic quartz build job, extending build script -.quartz_build_and_test: - tags: - - shell - - quartz - extends: [.build_toss_3_x86_64_ib_script] - stage: q_build_and_test - needs: [] - artifacts: - paths: - - spack-*.txt - - build_*/* - when: always - rules: - # Don't run if... - - if: '$CI_COMMIT_BRANCH =~ /_lnone/ || $ON_QUARTZ == "OFF" || $BENCHMARK == "ON"' - when: never - # Default is to run if previous stage succeeded - - when: on_success diff --git a/.gitlab/radiuss-spack-configs b/.gitlab/radiuss-spack-configs index 1264a6db12..89c2074e46 160000 --- a/.gitlab/radiuss-spack-configs +++ b/.gitlab/radiuss-spack-configs @@ -1 +1 @@ -Subproject commit 1264a6db12f451153a5cb22a32a1b7ba2faa5fc2 +Subproject commit 89c2074e466d454c77ec17249cbdf8555d183388 diff --git a/.gitlab/spack_packages/netlib-lapack/ibm-xl-3.9.1.patch b/.gitlab/spack_packages/netlib-lapack/ibm-xl-3.9.1.patch deleted file mode 100644 index c9e1707857..0000000000 --- a/.gitlab/spack_packages/netlib-lapack/ibm-xl-3.9.1.patch +++ /dev/null @@ -1,108 +0,0 @@ -Fixes for IBM XL and Cray CCE builds: - -* Correct path to the fallback configuration used to handle mangling for - C++/Fortran compatibility (CCE, XL) - -* Change logic for detecting recursive fortran flags to (a) Include XL -(qrecur), and (b) Be explicit, since not every compiler will correctly reject -an incorrect option (ALL) - -NOTE: This patch has been accepted upstream -(see https://github.com/Reference-LAPACK/lapack/pull/621) - -############################################################################## - -diff -Naur a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt ---- a/CBLAS/CMakeLists.txt 2021-03-25 12:25:15.000000000 -0600 -+++ b/CBLAS/CMakeLists.txt 2021-09-01 16:27:23.561355382 -0600 -@@ -11,9 +11,7 @@ - MACRO_NAMESPACE "F77_" - SYMBOL_NAMESPACE "F77_") - if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND) -- message(WARNING "Reverting to pre-defined include/lapacke_mangling.h") -- configure_file(include/lapacke_mangling_with_flags.h.in -- ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h) -+ message(WARNING "Reverting to pre-defined include/cblas_mangling.h") - configure_file(include/cblas_mangling_with_flags.h.in - ${LAPACK_BINARY_DIR}/include/cblas_mangling.h) - endif() -diff -Naur a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2021-03-25 12:25:15.000000000 -0600 -+++ b/CMakeLists.txt 2021-09-02 09:49:18.070436958 -0600 -@@ -94,16 +94,22 @@ - - # Check if recursive flag exists - include(CheckFortranCompilerFlag) --check_fortran_compiler_flag("-recursive" _recursiveFlag) --check_fortran_compiler_flag("-frecursive" _frecursiveFlag) --check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag) -+if(CMAKE_Fortran_COMPILER_ID STREQUAL Flang) -+ check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag) -+elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) -+ check_fortran_compiler_flag("-frecursive" _frecursiveFlag) -+elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) -+ check_fortran_compiler_flag("-recursive" _recursiveFlag) -+elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL) -+ check_fortran_compiler_flag("-qrecur" _qrecurFlag) -+endif() - - # Add recursive flag --if(_recursiveFlag) -- string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}") -+if(_MrecursiveFlag) -+ string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}") - if(NOT output_test) -- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive" -- CACHE STRING "Recursive flag must be set" FORCE) -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive" -+ CACHE STRING "Recursive flag must be set" FORCE) - endif() - elseif(_frecursiveFlag) - string(REGEX MATCH "-frecursive" output_test <string> "${CMAKE_Fortran_FLAGS}") -@@ -111,11 +117,17 @@ - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -frecursive" - CACHE STRING "Recursive flag must be set" FORCE) - endif() --elseif(_MrecursiveFlag) -- string(REGEX MATCH "-Mrecursive" output_test <string> "${CMAKE_Fortran_FLAGS}") -+elseif(_recursiveFlag) -+ string(REGEX MATCH "-recursive" output_test <string> "${CMAKE_Fortran_FLAGS}") - if(NOT output_test) -- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive" -- CACHE STRING "Recursive flag must be set" FORCE) -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive" -+ CACHE STRING "Recursive flag must be set" FORCE) -+ endif() -+elseif(_qrecurFlag) -+ string(REGEX MATCH "-qrecur" output_test <string> "${CMAKE_Fortran_FLAGS}") -+ if(NOT output_test) -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qrecur" -+ CACHE STRING "Recursive flag must be set" FORCE) - endif() - endif() - -@@ -124,7 +136,7 @@ - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict") - endif() - if(CMAKE_Fortran_COMPILER_ID STREQUAL XL) -- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict=none") -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict") - endif() - # Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler. - # This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin -diff -Naur a/INSTALL/make.inc.XLF b/INSTALL/make.inc.XLF ---- a/INSTALL/make.inc.XLF 2021-03-25 12:25:15.000000000 -0600 -+++ b/INSTALL/make.inc.XLF 2021-09-02 09:50:02.664646455 -0600 -@@ -14,10 +14,10 @@ - # the compiler options desired when NO OPTIMIZATION is selected. - # - FC = xlf --FFLAGS = -O3 -qfixed -qnosave -+FFLAGS = -O3 -qfixed -qnosave -qrecur - # For -O2, add -qstrict=none - FFLAGS_DRV = $(FFLAGS) --FFLAGS_NOOPT = -O0 -qfixed -qnosave -+FFLAGS_NOOPT = -O0 -qfixed -qnosave -qrecur - - # Define LDFLAGS to the desired linker options for your machine. - # diff --git a/.gitlab/spack_packages/netlib-lapack/ibm-xl.patch b/.gitlab/spack_packages/netlib-lapack/ibm-xl.patch deleted file mode 100644 index 52b5f19719..0000000000 --- a/.gitlab/spack_packages/netlib-lapack/ibm-xl.patch +++ /dev/null @@ -1,53 +0,0 @@ -Fixes for IBM XL and Cray CCE builds: - -* Avoid optimizations that would alter program semantics by changing the - qstrict activation threshold from O3 to O2 (XL) - -* Don't assume Fortran code is all in fixed source form; disable qfixed (XL) - -* Correct path to the fallback configuration used to handle mangling for - C++/Fortran compatibility (CCE, XL) -############################################################################## - ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -62,7 +62,7 @@ - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fp-model strict") - endif() - if("${CMAKE_Fortran_COMPILER}" MATCHES "xlf") -- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict=none") -+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qnosave -qstrict") - endif() - # Delete libmtsk in linking sequence for Sun/Oracle Fortran Compiler. - # This library is not present in the Sun package SolarisStudio12.3-linux-x86-bin - ---- a/CMAKE/CheckLAPACKCompilerFlags.cmake -+++ b/CMAKE/CheckLAPACKCompilerFlags.cmake -@@ -43,12 +43,6 @@ - if( "${CMAKE_Fortran_FLAGS}" MATCHES "-qflttrap=[a-zA-Z:]:enable" ) - set( FPE_EXIT TRUE ) - endif() -- -- if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-qfixed") ) -- message( STATUS "Enabling fixed format F90/F95 with -qfixed" ) -- set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qfixed" -- CACHE STRING "Flags for Fortran compiler." FORCE ) -- endif() - - # HP Fortran - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "HP" ) - ---- a/CBLAS/CMakeLists.txt -+++ b/CBLAS/CMakeLists.txt -@@ -12,8 +12,8 @@ - SYMBOL_NAMESPACE "F77_") - if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND) - message(WARNING "Reverting to pre-defined include/lapacke_mangling.h") -- configure_file(include/lapacke_mangling_with_flags.h.in -- ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h) -+ configure_file(include/cblas_mangling_with_flags.h.in -+ ${LAPACK_BINARY_DIR}/include/cblas_mangling.h) - endif() - - include_directories(include ${LAPACK_BINARY_DIR}/include) - diff --git a/.gitlab/spack_packages/netlib-lapack/package.py b/.gitlab/spack_packages/netlib-lapack/package.py deleted file mode 100644 index cb1832d061..0000000000 --- a/.gitlab/spack_packages/netlib-lapack/package.py +++ /dev/null @@ -1,223 +0,0 @@ -# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) -import spack.build_systems.cmake -from spack.package import * - - -class NetlibLapack(CMakePackage): - """LAPACK version 3.X is a comprehensive FORTRAN library that does - linear algebra operations including matrix inversions, least squared - solutions to linear sets of equations, eigenvector analysis, singular - value decomposition, etc. It is a very comprehensive and reputable - package that has found extensive use in the scientific community. - - """ - - homepage = "https://www.netlib.org/lapack/" - url = "https://www.netlib.org/lapack/lapack-3.5.0.tgz" - tags = ["windows"] - - version( - "3.10.1", - sha256="cd005cd021f144d7d5f7f33c943942db9f03a28d110d6a3b80d718a295f7f714", - url="https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.10.1.tar.gz", - ) - version( - "3.10.0", - sha256="328c1bea493a32cac5257d84157dc686cc3ab0b004e2bea22044e0a59f6f8a19", - url="https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.10.0.tar.gz", - ) - version( - "3.9.1", - sha256="d0085d2caf997ff39299c05d4bacb6f3d27001d25a4cc613d48c1f352b73e7e0", - url="https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz", - ) - version( - "3.9.0", - sha256="106087f1bb5f46afdfba7f569d0cbe23dacb9a07cd24733765a0e89dbe1ad573", - url="https://github.com/Reference-LAPACK/lapack/archive/v3.9.0.tar.gz", - ) - version( - "3.8.0", - sha256="deb22cc4a6120bff72621155a9917f485f96ef8319ac074a7afbc68aab88bcf6", - url="https://www.netlib.org/lapack/lapack-3.8.0.tar.gz", - ) - version("3.7.1", sha256="f6c53fd9f56932f3ddb3d5e24c1c07e4cd9b3b08e7f89de9c867125eecc9a1c8") - version("3.7.0", sha256="ed967e4307e986474ab02eb810eed1d1adc73f5e1e3bc78fb009f6fe766db3be") - version("3.6.1", sha256="888a50d787a9d828074db581c80b2d22bdb91435a673b1bf6cd6eb51aa50d1de") - version("3.6.0", sha256="a9a0082c918fe14e377bbd570057616768dca76cbdc713457d8199aaa233ffc3") - version("3.5.0", sha256="9ad8f0d3f3fb5521db49f2dd716463b8fb2b6bc9dc386a9956b8c6144f726352") - version("3.4.2", sha256="60a65daaf16ec315034675942618a2230521ea7adf85eea788ee54841072faf0") - version("3.4.1", sha256="93b910f94f6091a2e71b59809c4db4a14655db527cfc5821ade2e8c8ab75380f") - version("3.4.0", sha256="a7139ef97004d0e3c4c30f1c52d508fd7ae84b5fbaf0dd8e792c167dc306c3e9") - version("3.3.1", sha256="56821ab51c29369a34e5085728f92c549a9aa926f26acf7eeac87b61eed329e4") - - # netlib-lapack is the reference implementation of LAPACK - for ver in [ - "3.10.1", - "3.10.0", - "3.9.1", - "3.9.0", - "3.8.0", - "3.7.1", - "3.7.0", - "3.6.1", - "3.6.0", - "3.5.0", - "3.4.2", - "3.4.1", - "3.4.0", - "3.3.1", - ]: - provides("lapack@" + ver, when="@" + ver) - - variant("shared", default=True, description="Build shared library version") - variant("external-blas", default=False, description="Build lapack with an external blas") - - variant("lapacke", default=True, description="Activates the build of the LAPACKE C interface") - variant("xblas", default=False, description="Builds extended precision routines using XBLAS") - - # Fixes for IBM XL and Cray CCE builds: - # Avoid optimizations that alter program semantics - # Don't assume fixed source form for Fortran - # Correct path to mangling config - patch("ibm-xl.patch", when="@3.7:3.8 %xl") - patch("ibm-xl.patch", when="@3.7:3.8 %xl_r") - patch("ibm-xl.patch", when="@3.7:3.8 %cce@9:") - - # https://github.com/Reference-LAPACK/lapack/pull/621 - # Fixes for IBM XL and Cray CCE builds: - # Correct path to mangling config - # Fix logic for detecting recursive Fortran flags - patch("ibm-xl-3.9.1.patch", when="@3.9.1 %xl") - patch("ibm-xl-3.9.1.patch", when="@3.9.1 %xl_r") - patch("ibm-xl-3.9.1.patch", when="@3.9.1 %cce@13:") - - # https://github.com/Reference-LAPACK/lapack/issues/228 - patch("undefined_declarations.patch", when="@3.8.0:3.8") - - # https://github.com/Reference-LAPACK/lapack/pull/268 - patch("testing.patch", when="@3.7.0:3.8") - - # virtual dependency - provides("blas", when="~external-blas") - provides("lapack") - - depends_on("blas", when="+external-blas") - depends_on("netlib-xblas+fortran+plain_blas", when="+xblas") - depends_on("python@2.7:", type="test") - - # We need to run every phase twice in order to get static and shared - # versions of the libraries. When ~shared, we run the default - # implementations of the CMakePackage's phases and get only one building - # directory 'spack-build-static' with -DBUILD_SHARED_LIBS:BOOL=OFF (see - # implementations of self.build_directory and self.cmake_args() below). - # When +shared, we run the overridden methods for the phases, each - # running the default implementation twice with different values for - # self._building_shared. As a result, we get two building directories: - # 'spack-build-static' with -DBUILD_SHARED_LIBS:BOOL=OFF and - # 'spack-build-shared' with -DBUILD_SHARED_LIBS:BOOL=ON. - _building_shared = False - - def patch(self): - # Fix cblas CMakeLists.txt -- has wrong case for subdirectory name. - if self.spec.satisfies("@3.6.0:"): - filter_file( - "${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/", - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/", - "CBLAS/CMakeLists.txt", - string=True, - ) - - # Remove duplicate header file that gets generated during CMake shared - # builds: https://github.com/Reference-LAPACK/lapack/issues/583 - if self.spec.satisfies("platform=windows @0:3.9.1"): - force_remove("LAPACKE/include/lapacke_mangling.h") - - @property - def blas_libs(self): - shared = True if "+shared" in self.spec else False - query_parameters = self.spec.last_query.extra_parameters - query2libraries = { - tuple(): ["libblas"], - ("c", "fortran"): ["libcblas", "libblas"], - ("c",): ["libcblas"], - ("fortran",): ["libblas"], - } - key = tuple(sorted(query_parameters)) - libraries = query2libraries[key] - return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) - - @property - def lapack_libs(self): - shared = True if "+shared" in self.spec else False - query_parameters = self.spec.last_query.extra_parameters - query2libraries = { - tuple(): ["liblapack"], - ("c", "fortran"): ["liblapacke", "liblapack"], - ("c",): ["liblapacke"], - ("fortran",): ["liblapack"], - } - key = tuple(sorted(query_parameters)) - libraries = query2libraries[key] - return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) - - @property - def headers(self): - include_dir = self.spec.prefix.include - cblas_h = join_path(include_dir, "cblas.h") - lapacke_h = join_path(include_dir, "lapacke.h") - return HeaderList([cblas_h, lapacke_h]) - - -class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): - def cmake_args(self): - args = [ - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("LAPACKE", "lapacke"), - self.define_from_variant("LAPACKE_WITH_TMG", "lapacke"), - self.define("CBLAS", self.spec.satisfies("@3.6.0:")), - ] - - if self.spec.satisfies("%intel"): - # Intel compiler finds serious syntax issues when trying to - # build CBLAS and LapackE - args.extend([self.define("CBLAS", False), self.define("LAPACKE", False)]) - - if self.spec.satisfies("%xl") or self.spec.satisfies("%xl_r"): - # use F77 compiler if IBM XL - args.extend( - [ - self.define("CMAKE_Fortran_COMPILER", self.pkg.compiler.f77), - self.define( - "CMAKE_Fortran_FLAGS", - " ".join(self.spec.compiler_flags["fflags"]) + " -O3 -qnohot", - ), - ] - ) - - # deprecated routines are commonly needed by, for example, suitesparse - # Note that OpenBLAS spack is built with deprecated routines - args.append(self.define("BUILD_DEPRECATED", True)) - - if self.spec.satisfies("+external-blas"): - args.extend( - [ - self.define("USE_OPTIMIZED_BLAS", True), - self.define("BLAS_LIBRARIES:PATH", self.spec["blas"].libs.joined(";")), - ] - ) - - if self.spec.satisfies("+xblas"): - args.extend( - [ - self.define("XBLAS_INCLUDE_DIR", self.spec["netlib-xblas"].prefix.include), - self.define("XBLAS_LIBRARY", self.spec["netlib-xblas"].libs.joined(";")), - ] - ) - - args.append(self.define("BUILD_TESTING", self.pkg.run_tests)) - - return args diff --git a/.gitlab/spack_packages/netlib-lapack/testing.patch b/.gitlab/spack_packages/netlib-lapack/testing.patch deleted file mode 100644 index fce18548c4..0000000000 --- a/.gitlab/spack_packages/netlib-lapack/testing.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/TESTING/LIN/alahd.f b/TESTING/LIN/alahd.f -index 8f4cd58d..6a4946e0 100644 ---- a/TESTING/LIN/alahd.f -+++ b/TESTING/LIN/alahd.f -@@ -1036,7 +1036,7 @@ - 9929 FORMAT( ' Test ratios (1-3: ', A1, 'TZRZF):' ) - 9920 FORMAT( 3X, ' 7-10: same as 3-6', 3X, ' 11-14: same as 3-6' ) - 9921 FORMAT( ' Test ratios:', / ' (1-2: ', A1, 'GELS, 3-6: ', A1, -- $ 'GELSY, 7-10: ', A1, 'GELSS, 11-14: ', A1, 'GELSD, 15-16: ' -+ $ 'GELSY, 7-10: ', A1, 'GELSS, 11-14: ', A1, 'GELSD, 15-16: ', - $ A1, 'GETSLS)') - 9928 FORMAT( 7X, 'where ALPHA = ( 1 + SQRT( 17 ) ) / 8' ) - 9927 FORMAT( 3X, I2, ': ABS( Largest element in L )', / 12X, diff --git a/.gitlab/spack_packages/netlib-lapack/undefined_declarations.patch b/.gitlab/spack_packages/netlib-lapack/undefined_declarations.patch deleted file mode 100644 index 9dac2562f7..0000000000 --- a/.gitlab/spack_packages/netlib-lapack/undefined_declarations.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/SRC/dsytrf_aa_2stage.f b/SRC/dsytrf_aa_2stage.f -index 2991305..f5f06cc 100644 ---- a/SRC/dsytrf_aa_2stage.f -+++ b/SRC/dsytrf_aa_2stage.f -@@ -191,7 +191,7 @@ - EXTERNAL LSAME, ILAENV - * .. - * .. External Subroutines .. -- EXTERNAL XERBLA, DCOPY, DLACGV, DLACPY, -+ EXTERNAL XERBLA, DCOPY, DLACPY, - $ DLASET, DGBTRF, DGEMM, DGETRF, - $ DSYGST, DSWAP, DTRSM - * .. -diff --git a/SRC/ssytrf_aa_2stage.f b/SRC/ssytrf_aa_2stage.f -index be6809d..a929749 100644 ---- a/SRC/ssytrf_aa_2stage.f -+++ b/SRC/ssytrf_aa_2stage.f -@@ -191,7 +191,7 @@ - EXTERNAL LSAME, ILAENV - * .. - * .. External Subroutines .. -- EXTERNAL XERBLA, SCOPY, SLACGV, SLACPY, -+ EXTERNAL XERBLA, SCOPY, SLACPY, - $ SLASET, SGBTRF, SGEMM, SGETRF, - $ SSYGST, SSWAP, STRSM - * .. diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml new file mode 100644 index 0000000000..879dcc7be6 --- /dev/null +++ b/.gitlab/subscribed-pipelines.yml @@ -0,0 +1,77 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# SPDX-License-Identifier: (MIT) +############################################################################### +# Modifications to this file have been made under the folllowing copyright. +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ----------------------------------------------------------------------------- + +# The template job to test whether a machine is up. +# Expects CI_MACHINE defined to machine name. +.machine-check: + stage: prerequisites + tags: [shell, oslic] + variables: + GIT_STRATEGY: none + script: + - | + if [[ $(jq '.[env.CI_MACHINE].total_nodes_up' /usr/global/tools/lorenz/data/loginnodeStatus) == 0 ]] + then + echo -e "\e[31mNo node available on ${CI_MACHINE}\e[0m" + curl --url "https://api.github.com/repos/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}/statuses/${CI_COMMIT_SHA}" \ + --header 'Content-Type: application/json' \ + --header "authorization: Bearer ${GITHUB_TOKEN}" \ + --data "{ \"state\": \"failure\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"GitLab ${CI_MACHINE} down\", \"context\": \"ci/gitlab/${CI_MACHINE}\" }" + exit 1 + fi + +### +# Trigger a build-and-test pipeline for a machine. +# Comment the jobs for machines you don’t need. +### + +# DANE +dane-up-check: + variables: + CI_MACHINE: "dane" + extends: [.machine-check] + +dane-build-and-test: + variables: + CI_MACHINE: "dane" + needs: [dane-up-check] + extends: [.build-and-test] + +# TIOGA +tioga-up-check: + variables: + CI_MACHINE: "tioga" + extends: [.machine-check] + +tioga-build-and-test: + variables: + CI_MACHINE: "tioga" + needs: [tioga-up-check] + extends: [.build-and-test] + diff --git a/.gitlab/uberenv b/.gitlab/uberenv index 0d00dc8e19..ec6fd144c8 160000 --- a/.gitlab/uberenv +++ b/.gitlab/uberenv @@ -1 +1 @@ -Subproject commit 0d00dc8e19a889ba07ae433590b87533c4b5b3da +Subproject commit ec6fd144c814ce30a6487db9fb8294def606afda diff --git a/.gitmodules b/.gitmodules index 659855b75f..e915f32aa6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,7 @@ url = https://github.com/sundials-codes/radiuss-spack-configs.git [submodule "uberenv"] path = .gitlab/uberenv - url = https://github.com/LLNL/uberenv.git + url = https://github.com/sundials-codes/uberenv.git [submodule "test/answers"] path = test/answers url = https://github.com/sundials-codes/answers.git diff --git a/.uberenv_config.json b/.uberenv_config.json index 67618cca2f..3264fe5b05 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -4,8 +4,7 @@ "package_final_phase": "initconfig", "package_source_dir": "../..", "spack_url": "https://github.com/spack/spack", - "spack_commit": "5e0d2107348eed6cbe6deca43a30f5b06c5e40af", "spack_activate": {}, "spack_configs_path": ".gitlab/radiuss-spack-configs", - "spack_packages_path": ".gitlab/spack_packages" -} + "spack_packages_path": "scripts/spack/packages" +} \ No newline at end of file diff --git a/cmake/macros/SundialsAddTest.cmake b/cmake/macros/SundialsAddTest.cmake index a1b491dc49..4b4733820e 100644 --- a/cmake/macros/SundialsAddTest.cmake +++ b/cmake/macros/SundialsAddTest.cmake @@ -185,13 +185,25 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) OR (SUNDIALS_TEST_MPIRUN_COMMAND))) if(SUNDIALS_TEST_MPIRUN_COMMAND) - set(RUN_COMMAND - "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" - ) + if(MPIEXEC_PREFLAGS) + set(RUN_COMMAND + "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}" + ) + else() + set(RUN_COMMAND + "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}" + ) + endif() elseif(MPIEXEC_EXECUTABLE) - set(RUN_COMMAND - "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" - ) + if(MPIEXEC_PREFLAGS) + set(RUN_COMMAND + "${MPIEXEC_EXECUTABLE} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}" + ) + else() + set(RUN_COMMAND + "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS}" + ) + endif() endif() # remove trailing white space (empty MPIEXEC_PREFLAGS) as it can cause @@ -211,7 +223,12 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) set(_run_args "${_run_args} ${_extra_args}") unset(_extra_args) endif() - if(_have_test_args OR _have_extra_test_args) + if(MPIEXEC_POSTFLAGS) + set(_run_args "${MPIEXEC_POSTFLAGS} ${_run_args}") + endif() + if(_have_test_args + OR _have_extra_test_args + OR MPIEXEC_POSTFLAGS) string(STRIP "${_run_args}" _run_args) list(APPEND TEST_ARGS "--runargs=\"${_run_args}\"") unset(_run_args) @@ -239,22 +256,25 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) if(MPIEXEC_PREFLAGS) string(REPLACE " " ";" PREFLAGS "${MPIEXEC_PREFLAGS}") endif() + if(MPIEXEC_POSTFLAGS) + string(REPLACE " " ";" POSTLAGS "${MPIEXEC_POSTFLAGS}") + endif() if(SUNDIALS_TEST_MPIRUN_COMMAND) string(REPLACE " " ";" MPI_EXEC_ARGS "${SUNDIALS_TEST_MPIRUN_COMMAND}") add_test( NAME ${NAME} COMMAND - ${MPI_EXEC_ARGS} ${MPIEXEC_NUMPROC_FLAG} - ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} - $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) + ${MPI_EXEC_ARGS} ${PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} $<TARGET_FILE:${EXECUTABLE}> + ${POSTFLAGS} ${TEST_ARGS}) else() add_test( NAME ${NAME} COMMAND - ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} - ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} - $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) + ${MPIEXEC_EXECUTABLE} ${PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${POSTFLAGS} + $<TARGET_FILE:${EXECUTABLE}> ${POSTFLAGS} ${TEST_ARGS}) endif() else() add_test(NAME ${NAME} COMMAND $<TARGET_FILE:${EXECUTABLE}> ${TEST_ARGS}) diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 2a5068e5c9..0b778bb07c 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -868,6 +868,23 @@ illustration only. .. note:: This option is triggered only if MPI is enabled (``ENABLE_MPI`` is ``ON``). +.. cmakeoption:: MPIEXEC_PREFLAGS + + Specifies flags that come directly after ``MPIEXEC_EXECUTABLE`` and before + ``MPIEXEC_NUMPROC_FLAG`` and ``MPIEXEC_MAX_NUMPROCS``. + + Default: none + + .. note:: This option is triggered only if MPI is enabled (``ENABLE_MPI`` is ``ON``). + +.. cmakeoption:: MPIEXEC_POSTFLAGS + + Specifies flags that come after the executable to run but before any other program arguments. + + Default: none + + .. note:: This option is triggered only if MPI is enabled (``ENABLE_MPI`` is ``ON``). + .. cmakeoption:: ENABLE_ONEMKL Enable oneMKL support. diff --git a/doc/superbuild/source/developers/style_guide/Documentation.rst b/doc/superbuild/source/developers/style_guide/Documentation.rst index 92b6d02e86..c21f600714 100644 --- a/doc/superbuild/source/developers/style_guide/Documentation.rst +++ b/doc/superbuild/source/developers/style_guide/Documentation.rst @@ -126,6 +126,18 @@ References All citations go into `doc/shared/sundials.bib`. TODO: add citation and reference key style. +Links +===== + +Links to websites should typically use the anonymous link syntax. + +.. code-block:: rst + + `SUNDIALS documentation <https://sundials.readthedocs.io>`__ + +Pay special attention to the two trailing underscores - two underscores +indicates an anonymous link. + User-Callable Functions ======================= diff --git a/doc/superbuild/source/developers/testing/CI.rst b/doc/superbuild/source/developers/testing/CI.rst index a71b4e5930..e891ed3e74 100644 --- a/doc/superbuild/source/developers/testing/CI.rst +++ b/doc/superbuild/source/developers/testing/CI.rst @@ -13,7 +13,7 @@ .. _CI: -GitHub CI Testing +GitHub CI Testing ================= There are two categories of CI testing that we run on GitHub via `GitHub actions <https://github.com/LLNL/sundials/actions>`_: @@ -111,6 +111,11 @@ For information specific to the LLNL GitLab CI see: * `LLNL GitLab Runner Tags <https://lc.llnl.gov/gitlab/public-info/gitlab-ci/-/wikis/Gitlab-CI-Basic-Information>`_ +SUNDIALS utilizes the GitLab CI pipeline code repository shared by LLNL RADIUSS +projects. The `docs <https://radiuss-shared-ci.readthedocs.io/en/latest/>`__ for +the shared project should be reviewed before reading the docs below. + + CI Pipelines and Jobs --------------------- @@ -123,124 +128,120 @@ the jobs in a stage succeed, the pipeline moves on to the next stage. If any job in a stage fails, the next stage is usually (see below) not executed and the pipeline ends early. +Some pipelines are run automatically on new commits (after they are mirrored +from GitHub to LC GitLab). Other pipelines, such as the benchmarking pipeline, +are run on a schedule that is configured through the +`GitLab UI <https://lc.llnl.gov/gitlab/sundials/sundials/-/pipeline_schedules>`__. + +Structure +^^^^^^^^^ + +As previously stated, most of our code for the LC GitLab CI pipelines is sourced from +the templates provided in the +`radiuss-shared-ci <https://radiuss-shared-ci.readthedocs.io/en/latest/>`__ repo. +Here we briefly outline the relevant files: + +The ``.gitlab-ci.yml`` file in the root of the repository is the starting point for +defining the SUNDIALS GitLab CI pipelines. The only thing that is typically changed +in this file is the ``SPACK_REF`` variable in the ``variables`` section (this +is done when we update the version of Spack we use for installing dependencies). +Currently, we also override the `.build-and-test` job defined in this file so +that we can pull in some files from our fork of `radiuss-shared-ci` +(maintained `here <https://lc.llnl.gov/gitlab/sundials/radiuss-shared-ci>`__) +instead of the upstream repository. + +The ``.gitlab/subscribed-pipelines.yml`` defines which machines we will test on. +This file may be modified if you need to add a new machine to test on. + +The ``.gitlab/custom-jobs-and-variables.yml`` defines variables available in all +pipelines and jobs. This file may be modified if you need to add a new variable +that needs to be accessible to all pipelines and jobs. + +The ``.gitlab/jobs/<machine>.yaml`` files define the jobs for a specific machine. +A "hidden" job of the form `.sundials_job_on_<machine>` is defined first in these +files and typically defines variables specific to that machine, such as what command +to use for executing MPI programs. The rest of the jobs in the file extend the +`.sundials_job_on_<machine>` and define the Spack spec that we will build and test. +Take for example, this Tioga job: -CI Pipeline -^^^^^^^^^^^ - -The YAML file ``.gitlab-ci.yml`` at the top-level of the repository defines the -GitLab CI pipeline. The SUNDIALS CI configuration file is organized as follows: - -* The ``variables:`` keyword defines environment variables shared by all stages - and jobs. Variables can be used to alter the CI pipeline behavior when - launching a job from the GitLab "Run pipeline" UI or from the GitLab pipeline - scheduling UI. See the ``.gitlab-ci.yml`` file for details about all of the - available variables and what they do. - - .. code-block:: YAML +.. code-block:: YAML + tioga_rocmcc_620_tpls: + parallel: + matrix: + - COMPILER_SPEC: rocmcc@6.2.0 + AMDGPU_TARGET: [gfx90a] variables: - GIT_SUBMODULE_STRATEGY: recursive - ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} - BUILD_ROOT: ${CI_PROJECT_DIR} - # ... - -* The ``stages:`` keyword defines independent CI stages targeting a specific - test machine following the prefix naming convention: + # have to use ginkgo@master because our spack version does not have ginkgo@1.8.0: yet (which seems to be needed) + # similarly, we need a newer magma than available to compile with 'rocm@6:' so we turn it off + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double amdgpu_target=${AMDGPU_TARGET} +rocm+mpi~magma+ginkgo+kokkos ^ginkgo@master+rocm amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm amdgpu_target=${AMDGPU_TARGET}" + before_script: + - module load rocmcc/6.2.0-magic + extends: [.sundials_job_on_tioga] - * ``q_`` jobs run on Quartz - * ``l_`` jobs run on Lassen +The ``parallel:`` and ``matrix:`` keywords could be used to enable creating multiple jobs +with different variable values for each instance of the job, e.g., one job using +``rocmcc@6.2.0`` and another using ``rocmcc@6.2.1``. However, right now they only create +a single job (hence why ``COMPILER_SPEC`` and ``AMDGPU_TARGET`` only have one value). These +variables values are then used to create an environment variable ``SPEC`` which is the Spack spec +used by ``build_and_test.sh`` (discussed below) to configure and build SUNDIALS and the +necessary dependencies. - .. code-block:: YAML +Disabling a Job +^^^^^^^^^^^^^^^ - stages: - - q_build_and_test - - l_build_and_test - # ... +A job can be disabled by adding the variable ``.ON_<machine>: "OFF"`` to the ``variables:`` +section of the job, e.g., -* Several hidden job templates (job names start with ``.``) are defined for - specific architectures and batch queue systems. These jobs provide the batch - system command to run the ``build_and_test.sh`` script that configures, - builds, and tests SUNDIALS. - .. code-block:: YAML - - .build_toss_3_x86_64_ib_script: - script: - - echo ${ALLOC_NAME} - - srun -p pdebug -N 1 -n ${NCPUS} --interactive -t ${DEFAULT_TIME} - --job-name=${ALLOC_NAME} .gitlab/build_and_test.sh - - # ... - -* The ``include:`` keyword loads YAML files defining the jobs for specific - machines. - - .. code-block:: YAML - - include: - - local: .gitlab/quartz-jobs.yml - - local: .gitlab/lassen-jobs.yml - # ... - - -CI Jobs -^^^^^^^ +.. code-block:: YAML -As noted above, each stage in the CI pipeline corresponds to testing on a -specific machine. For example, jobs run on Lassen are associated with the -``l_build_and_test`` stage. The actual jobs to run are defined in the YAML -file ``.gitlab/lassen-jobs.yml``. + tioga_rocmcc_620_tpls: + parallel: + matrix: + - COMPILER_SPEC: rocmcc@6.2.0 + AMDGPU_TARGET: [gfx90a] + variables: + ON_TIOGA: "OFF" # disable this job + SPEC: "%${COMPILER_SPEC} cstd=99 cxxstd=14 precision=double amdgpu_target=${AMDGPU_TARGET} +rocm+mpi~magma+ginkgo+kokkos ^ginkgo@master+rocm amdgpu_target=${AMDGPU_TARGET} ^kokkos+rocm amdgpu_target=${AMDGPU_TARGET}" + before_script: + - module load rocmcc/6.2.0-magic + extends: [.sundials_job_on_tioga] -The Lassen build and test jobs inherit from three job templates: +These variables can also be set when manually or scheduling a pipeline in the GitLab UI. -* ``.build_blueos_3_ppc64le_ib_script`` executes the LSF command to run the - testing script. +Updating Spack +^^^^^^^^^^^^^^ -* ``.on_lassen`` defines the tags (``tags:`` keyword) to select a shell runner - on Lassen and the rules (``rules:`` keyword) for when a job should run. +To update the spack commit used for the CI simply replace the commit hash in the +``SPACK_REF`` variable inside the ``.gitlab-ci.yml`` file with the new commit hash. +The first time a pipeline runs with a new ``SPACK_REF`` the pipeline will take longer than +normal as a new Spack build cache must be created and populated (so all packages will be +built from source). -* ``.lassen_build_and_test`` inherits from the prior two job templates using the - ``extends:`` keyword and acts as the base jobs that all other Lassen jobs - inherit from. The base template includes: - * The ``stage:`` keyword defines which stage the jobs run in. +Benchmark Jobs +^^^^^^^^^^^^^^ - * The ``needs:`` keyword lists the job dependencies. Normally, GitLab stages - are blocking however, by providing the dependencies we can break the - ordering of stages, in favor of using a DAG. This allows jobs to be run - out-of-order rather than waiting on the jobs in other stages to complete. +See :ref:`SUNDIALS Continuous Performance Testing (CPT)<CPT>` for more details. - * The ``artifacts:`` keyword defines ``files:`` and directories (``paths:``) - created by the job that should be retained and ``when:`` they should be - attached to the job. -The Lassen tests are defined by jobs that extend the ``.lassen_build_and_test`` -template and use the naming convention ``lassen_<compiler>_<test identifiers>``. -For example, tests using GCC, CUDA, and third-party libraries enabled are -defined by the job: +Directories and Permissions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: YAML +* ``/usr/workspace/sundials`` is the workspace directory associated with the ``sundials`` LC group. + Users must be added to this group through the LC IDM application. - lassen_gcc_cuda_tpls: - parallel: - matrix: - - COMPILER_SPEC: gcc@7.3.1 - CUDA_SPEC: [cuda@10.1.243, cuda@11.2.0] - variables: - SPEC: "%${COMPILER_SPEC} precision=double ~int64 +openmp +cuda +raja cuda_arch=70 \ - ^raja+cuda~examples~exercises cuda_arch=70 ^${CUDA_SPEC}" - extends: .lassen_build_and_test +* ``/usr/workspace/sundials/ci`` is where all GitLab CI related files are stored. + The correct permissions for this directory are ``drwxrws---``. -The ``parallel:`` and ``matrix:`` keywords enable creating multiple jobs with -different variable values for each instance of the job i.e., one job using -``cuda@10.1.243`` and another using ``cuda@11.2.0``. These variables values are -then used to create an environment variable ``SPEC`` with a Spack spec used by -``build_and_test.sh`` when configuring SUNDIALS. +* ``/usr/workspace/sundials/ci/.builds`` is where GitLab CI pipelines are run. The permissions + for this directory are ``drwxrwx---``, but directories within it must be ``drwx------``. + Files within it should be ``-rw-rw----`` (can add ``x`` for group and owner as appropriate). -Benchmark Jobs -^^^^^^^^^^^^^^ +* ``/usr/workspace/sundials/ci/spack_stuff`` contains the Spack build caches amongst other Spack + files. The permissions for this directory and directories below should be ``drwxrws---``. -See :ref:`SUNDIALS Continuous Performance Testing (CPT)<CPT>` for more details. GitLab CI Test Script --------------------- @@ -257,26 +258,27 @@ build, and test SUNDIALS. This script leverages two Git submodules: * `radiuss-spack-configs <https://github.com/sundials-codes/radiuss-spack-configs.git>`_ -- is the SUNDIALS fork of the `LLNL radiuss-spack-configs <https://github.com/LLNL/radiuss-spack-configs>`_ - repository that provides spack configuration files for various LLNL platfornms - i.e., ``compilers.yaml`` and ``packages.yaml`` files for Quartz, Lassen, etc. + repository that provides spack environment files for various LLNL platfornms + i.e., ``spack.yaml`` for Dane, Tioga, etc. -These submodules work in conjunction with ``spack_packages/sundials/package.py`` +These submodules work in conjunction with ``scripts/sundials/package.py`` to configure and build any third-party libraries needed by the SUNDIALS configuration and generates an initial CMake cache file for building SUNDIALS. -Other packages can be added to ``spack_packages/<package name>/package.py`` -if the default Spack package needs to be overridden. We do this currently for -Caliper, as we need a newer version than in the Spack commit currently used. +Other packages can be added to ``spack/packages`` if the default Spack package +needs to be overridden. -Updating Spack --------------- +Spack Build Cache +^^^^^^^^^^^^^^^^^ + +The ``build_and_test.sh`` script leverage Spack build caches in ``/usr/workspace/sundials/ci/spack_stuff/<SPACK_REF>`` +to speedup builds. These caches store binaries of packages that have been built previously. Separate caches are +made for each ``SPACK_REF`` to avoid conflicts across Spack versions. -To update the spack commit used for the CI: -1. The first thing to do is update the spack commit in the -``.uberenv_config.json`` file. -2. Then, a pipeline should be manually launched from the GitLab UI with the -``SHARED_SPACK`` CI variable set to ``ON`` and the ``SPACK_PREFIX`` variable to -the version of spack being set in the uberenv_config.json. +Running Locally +^^^^^^^^^^^^^^^ -This will create a new spack installation and rebuild all of the specs. +It is possible to run these scripts locally on an LC machine. First set a ``SPACK_REF`` +environment variable to a spack commit that you want to use, and then set a ``SPEC`` +environment variable with a SUNDIALS spack spec that you want to test. diff --git a/examples/nvector/petsc/CMakeLists.txt b/examples/nvector/petsc/CMakeLists.txt index 9b18176bee..83809bab49 100644 --- a/examples/nvector/petsc/CMakeLists.txt +++ b/examples/nvector/petsc/CMakeLists.txt @@ -18,8 +18,9 @@ # develop for examples excluded from 'make test' in releases # Examples using SUNDIALS PETSc nvector -set(nvector_petsc_examples "test_nvector_petsc\;1000 0\;\;\;" # run sequentially - "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs +set(nvector_petsc_examples + "test_nvector_petsc\;1000 0\;1\;1\;" # run sequentially + "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs ) # Dependencies for nvector examples diff --git a/examples/sunnonlinsol/petsc/CMakeLists.txt b/examples/sunnonlinsol/petsc/CMakeLists.txt index 7146134ea8..2c366597a6 100644 --- a/examples/sunnonlinsol/petsc/CMakeLists.txt +++ b/examples/sunnonlinsol/petsc/CMakeLists.txt @@ -18,7 +18,7 @@ # examples excluded from 'make test' in releases # Example programs -set(examples "test_sunnonlinsol_petscsnes\;\;") +set(examples "test_sunnonlinsol_petscsnes\;\;1\;1\;") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -41,7 +41,9 @@ foreach(example_tuple ${examples}) # parse the example tuple list(GET example_tuple 0 example) list(GET example_tuple 1 example_args) - list(GET example_tuple 2 example_type) + list(GET example_tuple 2 number_of_nodes) + list(GET example_tuple 3 number_of_tasks) + list(GET example_tuple 4 example_type) # check if this example has already been added, only need to add example # source files once for testing with different inputs @@ -67,6 +69,7 @@ foreach(example_tuple ${examples}) sundials_add_test( ${test_name} ${example} TEST_ARGS ${example_args} + MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} NODIFF) diff --git a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c index b9486208b8..d66fb5526a 100644 --- a/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c +++ b/examples/sunnonlinsol/petsc/test_sunnonlinsol_petscsnes.c @@ -157,6 +157,7 @@ int main(int argc, char* argv[]) N_VDestroy(y0); N_VDestroy(w); SUNNonlinSolFree(NLS); + PetscFinalize(); SUNContext_Free(&sunctx); /* Print result */ diff --git a/.gitlab/spack_packages/sundials/0001-add-missing-README-to-examples-cvode-hip.patch b/scripts/spack/packages/sundials/0001-add-missing-README-to-examples-cvode-hip.patch similarity index 100% rename from .gitlab/spack_packages/sundials/0001-add-missing-README-to-examples-cvode-hip.patch rename to scripts/spack/packages/sundials/0001-add-missing-README-to-examples-cvode-hip.patch diff --git a/.gitlab/spack_packages/sundials/5.5.0-xsdk-patches.patch b/scripts/spack/packages/sundials/5.5.0-xsdk-patches.patch similarity index 100% rename from .gitlab/spack_packages/sundials/5.5.0-xsdk-patches.patch rename to scripts/spack/packages/sundials/5.5.0-xsdk-patches.patch diff --git a/.gitlab/spack_packages/sundials/FindPackageMultipass.cmake.patch b/scripts/spack/packages/sundials/FindPackageMultipass.cmake.patch similarity index 100% rename from .gitlab/spack_packages/sundials/FindPackageMultipass.cmake.patch rename to scripts/spack/packages/sundials/FindPackageMultipass.cmake.patch diff --git a/.gitlab/spack_packages/sundials/nvector-pic.patch b/scripts/spack/packages/sundials/nvector-pic.patch similarity index 100% rename from .gitlab/spack_packages/sundials/nvector-pic.patch rename to scripts/spack/packages/sundials/nvector-pic.patch diff --git a/.gitlab/spack_packages/sundials/package.py b/scripts/spack/packages/sundials/package.py similarity index 98% rename from .gitlab/spack_packages/sundials/package.py rename to scripts/spack/packages/sundials/package.py index ce7f4ece91..2257576317 100644 --- a/.gitlab/spack_packages/sundials/package.py +++ b/scripts/spack/packages/sundials/package.py @@ -183,9 +183,9 @@ class Sundials(CachedCMakePackage, CudaPackage, ROCmPackage): # Scheduler variant( - "scheduler", - default="slurm", - description="Specify which scheduler the system runs on", + "scheduler", + default="slurm", + description="Specify which scheduler the system runs on", values=("flux", "lsf", "slurm") ) @@ -194,9 +194,9 @@ class Sundials(CachedCMakePackage, CudaPackage, ROCmPackage): # Profiling examples variant( - "profile-examples", - default=False, - when="+adiak +caliper", + "profile-examples", + default=False, + when="+adiak +caliper", description="Build examples with profiling capabilities") # Caliper Directory @@ -251,7 +251,8 @@ class Sundials(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("superlu-dist@6.3.0:", when="@5.5.0:6.3.0 +superlu-dist") depends_on("superlu-dist@6.1.1:", when="@:5.4.0 +superlu-dist") depends_on("superlu-mt+blas", when="+superlu-mt") - depends_on("trilinos+tpetra", when="+trilinos") + depends_on("trilinos+tpetra@:13", when="@:7.1.1 +trilinos") + depends_on("trilinos+tpetra@14:", when="@7.2.0: +trilinos") # Require that external libraries built with the same precision depends_on("petsc~double~complex", when="+petsc precision=single") @@ -697,7 +698,7 @@ def initconfig_mpi_entries(self): entries.append(cmake_cache_string("SUNDIALS_SCHEDULER_COMMAND", "srun")) if "scheduler=lsf" in spec: entries.append(cmake_cache_string("SUNDIALS_SCHEDULER_COMMAND", "jsrun")) - + return entries @@ -719,11 +720,10 @@ def initconfig_hardware_entries(self): entries.extend( [ self.cache_option_from_variant("ENABLE_HIP", "rocm"), - cmake_cache_path("CMAKE_C_COMPILER", spec["llvm-amdgpu"].prefix.bin.clang), - cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc), cmake_cache_path("HIP_PATH", spec["hip"].prefix), + cmake_cache_path("HIP_DIR", spec["hip"].prefix.cmake), cmake_cache_path("HIP_CLANG_INCLUDE_PATH", spec["llvm-amdgpu"].prefix.include), - cmake_cache_path("ROCM_PATH", spec["llvm-amdgpu"].prefix), + cmake_cache_path("ROCM_PATH", spec["hsa-rocr-dev"].prefix), cmake_cache_string("AMDGPU_TARGETS", ";".join(spec.variants["amdgpu_target"].value)) ] ) @@ -763,7 +763,7 @@ def initconfig_package_entries(self): self.cache_option_from_variant("SUNDIALS_TEST_PROFILE", "profile-examples"), self.cache_option_from_variant("SUNDIALS_TEST_DEVTESTS", "profile-examples"), cmake_cache_string("SPACK_VERSION", ".".join(map(str, spack.spack_version_info))) - + ] ) @@ -799,7 +799,7 @@ def initconfig_package_entries(self): ) # Building with Adiak - if "+adiak" in spec: + if "+adiak" in spec: entries.append(cmake_cache_path("adiak_DIR", spec["adiak"].prefix.lib.cmake + "/adiak")) # Building with Caliper diff --git a/.gitlab/spack_packages/sundials/remove-links-to-OpenMP-vector.patch b/scripts/spack/packages/sundials/remove-links-to-OpenMP-vector.patch similarity index 100% rename from .gitlab/spack_packages/sundials/remove-links-to-OpenMP-vector.patch rename to scripts/spack/packages/sundials/remove-links-to-OpenMP-vector.patch diff --git a/.gitlab/spack_packages/sundials/sundials-v5.8.0.patch b/scripts/spack/packages/sundials/sundials-v5.8.0.patch similarity index 100% rename from .gitlab/spack_packages/sundials/sundials-v5.8.0.patch rename to scripts/spack/packages/sundials/sundials-v5.8.0.patch diff --git a/.gitlab/spack_packages/sundials/test_nvector_parhyp.patch b/scripts/spack/packages/sundials/test_nvector_parhyp.patch similarity index 100% rename from .gitlab/spack_packages/sundials/test_nvector_parhyp.patch rename to scripts/spack/packages/sundials/test_nvector_parhyp.patch diff --git a/scripts/spack/repo.yaml b/scripts/spack/repo.yaml new file mode 100644 index 0000000000..97f36d22aa --- /dev/null +++ b/scripts/spack/repo.yaml @@ -0,0 +1,2 @@ +repo: + namespace: 'sundials' From 8c72a8b601384443bb5fc0484fcbcf829656af6c Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 1 Nov 2024 13:13:54 -0700 Subject: [PATCH 116/137] Docs: Fix typos in linear solver section of CVODE skeleton (#599) --- doc/cvode/guide/source/Usage/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 3c56d48587..b2e793d5e3 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -208,15 +208,15 @@ function to be called or macro to be referenced. If a nonlinear solver requiring a linear solver is chosen (e.g., the default Newton iteration), then initialize the CVLS linear solver interface by attaching the linear solver object (and matrix object, - if applicable) with a call ``ier = CVodeSetLinearSolver(cvode_mem, NLS)`` (for details see - :numref:`CVODE.Usage.CC.callable_fct_sim.lin_solv_init`): + if applicable) with a call ``ier = CVodeSetLinearSolver(cvode_mem, LS, A)`` + (for details see :numref:`CVODE.Usage.CC.callable_fct_sim.lin_solv_init`). Alternately, if the CVODE-specific diagonal linear solver module, CVDIAG, is desired, initialize the linear solver module and attach it to CVODE with the call to :c:func:`CVodeSetLinearSolver`. #. **Set optional inputs** - Call ```CVodeSet***`` functions to change any optional inputs that control the + Call ``CVodeSet***`` functions to change any optional inputs that control the behavior of CVODE from their default values. See :numref:`CVODE.Usage.CC.optional_input` for details. From a3fa77f75657754a5b9659c14a120e46c188a5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20A=C4=9Fg=C3=BCl?= <33010171+maggul@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:36:02 -0600 Subject: [PATCH 117/137] Feature: Add STS and SSPs method to ARKODE (#541) Add LSRKStep module to ARKODE with RKC, RKL, and SSPs methods. --------- Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: David Gardner <gardner48@llnl.gov> --- .gitignore | 2 + CHANGELOG.md | 5 + benchmarks/diffusion_2D/main_arkode.cpp | 392 ++- doc/arkode/guide/source/Constants.rst | 25 + doc/arkode/guide/source/Mathematics.rst | 71 +- .../source/Usage/ARKStep/User_callable.rst | 106 +- .../source/Usage/ERKStep/User_callable.rst | 76 +- doc/arkode/guide/source/Usage/General.rst | 3 +- .../source/Usage/LSRKStep/User_callable.rst | 389 +++ .../source/Usage/LSRKStep/User_supplied.rst | 52 + .../guide/source/Usage/LSRKStep/index.rst | 32 + .../source/Usage/MRIStep/User_callable.rst | 63 +- .../source/Usage/SPRKStep/User_callable.rst | 28 +- .../guide/source/Usage/User_callable.rst | 8 +- doc/arkode/guide/source/Usage/index.rst | 5 +- doc/shared/RecentChanges.rst | 6 + doc/shared/sundials.bib | 69 +- examples/arkode/CMakeLists.txt | 3 + examples/arkode/CXX_manyvector/CMakeLists.txt | 84 + .../arkode/CXX_manyvector/ark_sod_lsrk.cpp | 580 +++++ .../arkode/CXX_manyvector/ark_sod_lsrk.hpp | 538 ++++ .../arkode/CXX_manyvector/ark_sod_lsrk.out | 48 + examples/arkode/CXX_manyvector/plot_sod.py | 231 ++ examples/arkode/CXX_parallel/CMakeLists.txt | 9 +- .../arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp | 1743 +++++++++++++ .../ark_heat2D_lsrk_p_--np_2_2.out | 77 + .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 105 +- examples/arkode/CXX_serial/CMakeLists.txt | 1 + .../arkode/CXX_serial/ark_heat2D_lsrk.cpp | 986 ++++++++ .../arkode/CXX_serial/ark_heat2D_lsrk.out | 71 + examples/arkode/C_serial/CMakeLists.txt | 3 + examples/arkode/C_serial/ark_analytic_lsrk.c | 328 +++ .../arkode/C_serial/ark_analytic_lsrk.out | 40 + .../C_serial/ark_analytic_lsrk_varjac.c | 364 +++ .../C_serial/ark_analytic_lsrk_varjac.out | 43 + examples/arkode/C_serial/ark_analytic_ssprk.c | 271 ++ .../arkode/C_serial/ark_analytic_ssprk.out | 36 + include/arkode/arkode.h | 3 + include/arkode/arkode_lsrkstep.h | 99 + include/sundials/sundials_math.h | 26 + src/arkode/CMakeLists.txt | 3 + src/arkode/arkode.c | 43 +- src/arkode/arkode_arkstep_io.c | 2 +- src/arkode/arkode_erkstep_impl.h | 1 - src/arkode/arkode_erkstep_io.c | 3 +- src/arkode/arkode_impl.h | 1 + src/arkode/arkode_io.c | 4 + src/arkode/arkode_lsrkstep.c | 2236 +++++++++++++++++ src/arkode/arkode_lsrkstep_impl.h | 219 ++ src/arkode/arkode_lsrkstep_io.c | 759 ++++++ src/arkode/arkode_mristep_io.c | 2 +- src/arkode/arkode_sprkstep_io.c | 2 +- src/arkode/fmod_int32/farkode_lsrkstep_mod.c | 459 ++++ .../fmod_int32/farkode_lsrkstep_mod.f90 | 496 ++++ src/arkode/fmod_int32/farkode_mod.f90 | 2 + src/arkode/fmod_int64/farkode_lsrkstep_mod.c | 459 ++++ .../fmod_int64/farkode_lsrkstep_mod.f90 | 496 ++++ src/arkode/fmod_int64/farkode_mod.f90 | 2 + swig/Makefile | 2 +- swig/arkode/farkode_lsrkstep_mod.i | 30 + test/answers | 2 +- 61 files changed, 11930 insertions(+), 314 deletions(-) create mode 100644 doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst create mode 100644 doc/arkode/guide/source/Usage/LSRKStep/User_supplied.rst create mode 100644 doc/arkode/guide/source/Usage/LSRKStep/index.rst create mode 100644 examples/arkode/CXX_manyvector/CMakeLists.txt create mode 100644 examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp create mode 100644 examples/arkode/CXX_manyvector/ark_sod_lsrk.hpp create mode 100644 examples/arkode/CXX_manyvector/ark_sod_lsrk.out create mode 100755 examples/arkode/CXX_manyvector/plot_sod.py create mode 100644 examples/arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp create mode 100644 examples/arkode/CXX_parallel/ark_heat2D_lsrk_p_--np_2_2.out create mode 100644 examples/arkode/CXX_serial/ark_heat2D_lsrk.cpp create mode 100644 examples/arkode/CXX_serial/ark_heat2D_lsrk.out create mode 100644 examples/arkode/C_serial/ark_analytic_lsrk.c create mode 100644 examples/arkode/C_serial/ark_analytic_lsrk.out create mode 100644 examples/arkode/C_serial/ark_analytic_lsrk_varjac.c create mode 100644 examples/arkode/C_serial/ark_analytic_lsrk_varjac.out create mode 100644 examples/arkode/C_serial/ark_analytic_ssprk.c create mode 100644 examples/arkode/C_serial/ark_analytic_ssprk.out create mode 100644 include/arkode/arkode_lsrkstep.h create mode 100644 src/arkode/arkode_lsrkstep.c create mode 100644 src/arkode/arkode_lsrkstep_impl.h create mode 100644 src/arkode/arkode_lsrkstep_io.c create mode 100644 src/arkode/fmod_int32/farkode_lsrkstep_mod.c create mode 100644 src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 create mode 100644 src/arkode/fmod_int64/farkode_lsrkstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 create mode 100644 swig/arkode/farkode_lsrkstep_mod.i diff --git a/.gitignore b/.gitignore index 3e9185713d..763405865e 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ compile_commands.json *.orig *.nvvp *.ptp-sync* +*.project +*.cproject *~ \#* diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a2184439e..ee1021d575 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, LSRKStep. +This currently supports five explicit low-storage methods: the second-order Runge--Kutta--Chebyshev +and Runge--Kutta--Legendre methods, and the second- through fourth-order optimal strong stability +preserving Runge--Kutta methods. All methods include embeddings for temporal adaptivity. + The Trilinos Teptra NVector interface has been updated to utilize CMake imported targets added in Trilinos 14 to improve support for different Kokkos backends with Trilinos. As such, Trilinos 14 or newer is required and the diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index 39c6274a6e..e569cffec2 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -15,7 +15,10 @@ * ---------------------------------------------------------------------------*/ #include "arkode/arkode_arkstep.h" +#include "arkode/arkode_lsrkstep.h" #include "diffusion_2D.hpp" +#include "sunadaptcontroller/sunadaptcontroller_imexgus.h" +#include "sunadaptcontroller/sunadaptcontroller_soderlind.h" struct UserOptions { @@ -28,6 +31,8 @@ struct UserOptions int maxsteps = 0; // max steps between outputs int onestep = 0; // one step mode, number of steps bool linear = true; // linearly implicit RHS + bool implicit = true; // implicit (ARKStep) vs explicit STS (LSRKStep) + ARKODE_LSRKMethodType lsrkmethod = ARKODE_LSRK_RKC_2; // LSRK method type // Linear solver and preconditioner settings std::string ls = "cg"; // linear solver to use @@ -43,6 +48,14 @@ struct UserOptions void print(); }; +// ----------------------------------------------------------------------------- +// LSRKStep-specific dominant eigenvalue function prototype +// ----------------------------------------------------------------------------- + +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3); + // ----------------------------------------------------------------------------- // Main Program // ----------------------------------------------------------------------------- @@ -58,8 +71,8 @@ int main(int argc, char* argv[]) // Create SUNDIALS context MPI_Comm comm = MPI_COMM_WORLD; - SUNContext ctx = NULL; - SUNProfiler prof = NULL; + SUNContext ctx = nullptr; + SUNProfiler prof = nullptr; flag = SUNContext_Create(comm, &ctx); if (check_flag(&flag, "SUNContextCreate", 1)) { return 1; } @@ -109,6 +122,17 @@ int main(int argc, char* argv[]) return 1; } + // Return with error on unsupported LSRK method type + if (!uopts.implicit) + { + if ((uopts.lsrkmethod != ARKODE_LSRK_RKC_2) && + (uopts.lsrkmethod != ARKODE_LSRK_RKL_2)) + { + cerr << "ERROR: illegal lsrkmethod" << endl; + return 1; + } + } + // ----------------------------- // Setup parallel decomposition // ----------------------------- @@ -152,12 +176,8 @@ int main(int argc, char* argv[]) if (check_flag((void*)(uout.error), "N_VClone", 0)) { return 1; } } - // --------------------- - // Create linear solver - // --------------------- - - // Create linear solver - SUNLinearSolver LS = NULL; + // Set up implicit solver, if applicable + SUNLinearSolver LS = nullptr; SUNMatrix A = nullptr; #if defined(USE_SUPERLU_DIST) // SuperLU-DIST objects @@ -172,77 +192,96 @@ int main(int argc, char* argv[]) sunindextype* A_col_idxs = nullptr; sunindextype* A_row_ptrs = nullptr; #endif - - int prectype = (uopts.preconditioning) ? SUN_PREC_RIGHT : SUN_PREC_NONE; - - if (uopts.ls == "cg") - { - LS = SUNLinSol_PCG(u, prectype, uopts.liniters, ctx); - if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } - } - else if (uopts.ls == "gmres") + if (uopts.implicit) { - LS = SUNLinSol_SPGMR(u, prectype, uopts.liniters, ctx); - if (check_flag((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; } - } - else - { -#if defined(USE_SUPERLU_DIST) - // Initialize SuperLU-DIST grid - superlu_gridinit(udata.comm_c, udata.npx, udata.npy, &grid); - - // Create arrays for CSR matrix: data, column indices, and row pointers - sunindextype nnz_loc = 5 * udata.nodes_loc; - - A_data = (sunrealtype*)malloc(nnz_loc * sizeof(sunrealtype)); - if (check_flag((void*)A_data, "malloc Adata", 0)) return 1; - - A_col_idxs = (sunindextype*)malloc(nnz_loc * sizeof(sunindextype)); - if (check_flag((void*)A_col_idxs, "malloc Acolind", 0)) return 1; + // --------------------- + // Create linear solver + // --------------------- - A_row_ptrs = - (sunindextype*)malloc((udata.nodes_loc + 1) * sizeof(sunindextype)); - if (check_flag((void*)A_row_ptrs, "malloc Arowptr", 0)) return 1; + // Create linear solver - // Create and initialize SuperLU_DIST structures - dCreate_CompRowLoc_Matrix_dist(&A_super, udata.nodes, udata.nodes, nnz_loc, - udata.nodes_loc, 0, A_data, A_col_idxs, - A_row_ptrs, SLU_NR_loc, SLU_D, SLU_GE); - dScalePermstructInit(udata.nodes, udata.nodes, &A_scaleperm); - dLUstructInit(udata.nodes, &A_lu); - PStatInit(&A_stat); - set_default_options_dist(&A_opts); - A_opts.PrintStat = NO; + int prectype = (uopts.preconditioning) ? SUN_PREC_RIGHT : SUN_PREC_NONE; - // SUNDIALS structures - A = SUNMatrix_SLUNRloc(&A_super, &grid, ctx); - if (check_flag((void*)A, "SUNMatrix_SLUNRloc", 0)) return 1; - - LS = SUNLinSol_SuperLUDIST(u, A, &grid, &A_lu, &A_scaleperm, &A_solve, - &A_stat, &A_opts, ctx); - if (check_flag((void*)LS, "SUNLinSol_SuperLUDIST", 0)) return 1; - - uopts.preconditioning = false; + if (uopts.ls == "cg") + { + LS = SUNLinSol_PCG(u, prectype, uopts.liniters, ctx); + if (check_flag((void*)LS, "SUNLinSol_PCG", 0)) { return 1; } + } + else if (uopts.ls == "gmres") + { + LS = SUNLinSol_SPGMR(u, prectype, uopts.liniters, ctx); + if (check_flag((void*)LS, "SUNLinSol_SPGMR", 0)) { return 1; } + } + else + { +#if defined(USE_SUPERLU_DIST) + // Initialize SuperLU-DIST grid + superlu_gridinit(udata.comm_c, udata.npx, udata.npy, &grid); + + // Create arrays for CSR matrix: data, column indices, and row pointers + sunindextype nnz_loc = 5 * udata.nodes_loc; + + A_data = (sunrealtype*)malloc(nnz_loc * sizeof(sunrealtype)); + if (check_flag((void*)A_data, "malloc Adata", 0)) return 1; + + A_col_idxs = (sunindextype*)malloc(nnz_loc * sizeof(sunindextype)); + if (check_flag((void*)A_col_idxs, "malloc Acolind", 0)) return 1; + + A_row_ptrs = + (sunindextype*)malloc((udata.nodes_loc + 1) * sizeof(sunindextype)); + if (check_flag((void*)A_row_ptrs, "malloc Arowptr", 0)) return 1; + + // Create and initialize SuperLU_DIST structures + dCreate_CompRowLoc_Matrix_dist(&A_super, udata.nodes, udata.nodes, + nnz_loc, udata.nodes_loc, 0, A_data, + A_col_idxs, A_row_ptrs, SLU_NR_loc, + SLU_D, SLU_GE); + dScalePermstructInit(udata.nodes, udata.nodes, &A_scaleperm); + dLUstructInit(udata.nodes, &A_lu); + PStatInit(&A_stat); + set_default_options_dist(&A_opts); + A_opts.PrintStat = NO; + + // SUNDIALS structures + A = SUNMatrix_SLUNRloc(&A_super, &grid, ctx); + if (check_flag((void*)A, "SUNMatrix_SLUNRloc", 0)) return 1; + + LS = SUNLinSol_SuperLUDIST(u, A, &grid, &A_lu, &A_scaleperm, &A_solve, + &A_stat, &A_opts, ctx); + if (check_flag((void*)LS, "SUNLinSol_SuperLUDIST", 0)) return 1; + + uopts.preconditioning = false; #else - std::cerr << "ERROR: Benchmark was not built with SuperLU_DIST enabled\n"; - return 1; + std::cerr + << "ERROR: Benchmark was not built with SuperLU_DIST enabled\n"; + return 1; #endif - } + } - // Allocate preconditioner workspace - if (uopts.preconditioning) - { - udata.diag = N_VClone(u); - if (check_flag((void*)(udata.diag), "N_VClone", 0)) { return 1; } + // Allocate preconditioner workspace + if (uopts.preconditioning) + { + udata.diag = N_VClone(u); + if (check_flag((void*)(udata.diag), "N_VClone", 0)) { return 1; } + } } - // -------------- - // Setup ARKStep - // -------------- + // ---------------------- + // Setup ARKStep/LSRKStep + // ---------------------- // Create integrator - void* arkode_mem = ARKStepCreate(NULL, diffusion, ZERO, u, ctx); - if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } + void* arkode_mem = nullptr; + if (uopts.implicit) + { + arkode_mem = ARKStepCreate(nullptr, diffusion, ZERO, u, ctx); + if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } + } + else + { + arkode_mem = LSRKStepCreateSTS(diffusion, ZERO, u, ctx); + if (check_flag((void*)arkode_mem, "LSRKStepCreateSTS", 0)) { return 1; } + } // Specify tolerances flag = ARKodeSStolerances(arkode_mem, uopts.rtol, uopts.atol); @@ -252,38 +291,60 @@ int main(int argc, char* argv[]) flag = ARKodeSetUserData(arkode_mem, (void*)&udata); if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } - // Attach linear solver - flag = ARKodeSetLinearSolver(arkode_mem, LS, A); - if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } + // Configure implicit solver + if (uopts.implicit) + { + // Attach linear solver + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(&flag, "ARKodeSetLinearSolver", 1)) { return 1; } #if defined(USE_SUPERLU_DIST) - if (uopts.ls == "sludist") - { - ARKodeSetJacFn(arkode_mem, diffusion_jac); - if (check_flag(&flag, "ARKodeSetJacFn", 1)) return 1; - } + if (uopts.ls == "sludist") + { + ARKodeSetJacFn(arkode_mem, diffusion_jac); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) return 1; + } #endif - if (uopts.preconditioning) - { - // Attach preconditioner - flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); - if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } + if (uopts.preconditioning) + { + // Attach preconditioner + flag = ARKodeSetPreconditioner(arkode_mem, PSetup, PSolve); + if (check_flag(&flag, "ARKodeSetPreconditioner", 1)) { return 1; } - // Set linear solver setup frequency (update preconditioner) - flag = ARKodeSetLSetupFrequency(arkode_mem, uopts.msbp); - if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } - } + // Set linear solver setup frequency (update preconditioner) + flag = ARKodeSetLSetupFrequency(arkode_mem, uopts.msbp); + if (check_flag(&flag, "ARKodeSetLSetupFrequency", 1)) { return 1; } + } + + // Set linear solver tolerance factor + flag = ARKodeSetEpsLin(arkode_mem, uopts.epslin); + if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + + // Select method order + flag = ARKodeSetOrder(arkode_mem, uopts.order); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } - // Set linear solver tolerance factor - flag = ARKodeSetEpsLin(arkode_mem, uopts.epslin); - if (check_flag(&flag, "ARKodeSetEpsLin", 1)) { return 1; } + // Specify linearly implicit non-time-dependent RHS + if (uopts.linear) + { + flag = ARKodeSetLinear(arkode_mem, 0); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + } + } + else // Configure explicit STS solver + { + // Select LSRK method + flag = LSRKStepSetSTSMethod(arkode_mem, uopts.lsrkmethod); + if (check_flag(&flag, "LSRKStepSetSTSMethod", 1)) { return 1; } - // Select method order - flag = ARKodeSetOrder(arkode_mem, uopts.order); - if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + // Provide dominant eigenvalue function + flag = LSRKStepSetDomEigFn(arkode_mem, dom_eig); + if (check_flag(&flag, "LSRKStepSetDomEigFn", 1)) { return 1; } + } // Set fixed step size or adaptivity method + SUNAdaptController C = nullptr; if (uopts.hfixed > ZERO) { flag = ARKodeSetFixedStep(arkode_mem, uopts.hfixed); @@ -291,16 +352,17 @@ int main(int argc, char* argv[]) } else { - flag = ARKStepSetAdaptivityMethod(arkode_mem, uopts.controller, SUNTRUE, - SUNFALSE, NULL); - if (check_flag(&flag, "ARKStepSetAdaptivityMethod", 1)) { return 1; } - } - - // Specify linearly implicit non-time-dependent RHS - if (uopts.linear) - { - flag = ARKodeSetLinear(arkode_mem, 0); - if (check_flag(&flag, "ARKodeSetLinear", 1)) { 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 = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } } // Set max steps between outputs @@ -377,22 +439,26 @@ int main(int argc, char* argv[]) // Free MPI Cartesian communicator MPI_Comm_free(&(udata.comm_c)); + (void)SUNAdaptController_Destroy(C); // Free timestep adaptivity controller ARKodeFree(&arkode_mem); - SUNLinSolFree(LS); + if (uopts.implicit) + { + SUNLinSolFree(LS); - // Free the SuperLU_DIST structures (also frees user allocated arrays - // A_data, A_col_idxs, and A_row_ptrs) + // Free the SuperLU_DIST structures (also frees user allocated arrays + // A_data, A_col_idxs, and A_row_ptrs) #if defined(USE_SUPERLU_DIST) - if (uopts.ls == "sludist") - { - PStatFree(&A_stat); - dScalePermstructFree(&A_scaleperm); - dLUstructFree(&A_lu); - Destroy_CompRowLoc_Matrix_dist(&A_super); - superlu_gridexit(&grid); - } + if (uopts.ls == "sludist") + { + PStatFree(&A_stat); + dScalePermstructFree(&A_scaleperm); + dLUstructFree(&A_lu); + Destroy_CompRowLoc_Matrix_dist(&A_super); + superlu_gridexit(&grid); + } #endif + } // Free vectors #if defined(USE_HIP) || defined(USE_CUDA) @@ -409,6 +475,26 @@ int main(int argc, char* argv[]) return 0; } +// ----------------------------------------------------------------------------- +// Dominant eigenvalue estimation function +// ----------------------------------------------------------------------------- + +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3) +{ + // Access problem data + UserData* udata = (UserData*)user_data; + + // Fill in spectral radius value + *lambdaR = -SUN_RCONST(8.0) * std::max(udata->kx / udata->dx / udata->dx, + udata->ky / udata->dy / udata->dy); + *lambdaI = SUN_RCONST(0.0); + + // return with success + return 0; +} + // ----------------------------------------------------------------------------- // UserOptions Helper functions // ----------------------------------------------------------------------------- @@ -445,6 +531,13 @@ int UserOptions::parse_args(vector<string>& args, bool outproc) args.erase(it, it + 2); } + it = find(args.begin(), args.end(), "--explicitSTS"); + if (it != args.end()) + { + implicit = false; + args.erase(it); + } + it = find(args.begin(), args.end(), "--order"); if (it != args.end()) { @@ -452,6 +545,13 @@ int UserOptions::parse_args(vector<string>& args, bool outproc) args.erase(it, it + 2); } + it = find(args.begin(), args.end(), "--lsrkmethod"); + if (it != args.end()) + { + lsrkmethod = (ARKODE_LSRKMethodType)stoi(*(it + 1)); + args.erase(it, it + 2); + } + it = find(args.begin(), args.end(), "--controller"); if (it != args.end()) { @@ -525,16 +625,22 @@ void UserOptions::help() cout << "Integrator command line options:" << endl; cout << " --rtol <rtol> : relative tolerance" << endl; cout << " --atol <atol> : absolute tolerance" << endl; + cout << " --controller <ctr> : time step adaptivity controller" << endl; + cout << " --fixedstep <step> : used fixed step size" << endl; + cout << " --explicitSTS : use LSRKStep (instead of ARKStep)" << endl; + cout << endl; + cout << "Implicit (ARKStep) solver command line options:" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order <ord> : method order" << endl; - cout << " --fixedstep <step> : used fixed step size" << endl; - cout << " --controller <ctr> : time step adaptivity controller" << endl; cout << " --ls <cg|gmres|sludist> : linear solver" << endl; cout << " --lsinfo : output residual history" << endl; cout << " --liniters <iters> : max number of iterations" << endl; cout << " --epslin <factor> : linear tolerance factor" << endl; cout << " --noprec : disable preconditioner" << endl; cout << " --msbp <steps> : max steps between prec setups" << endl; + cout << endl; + cout << "Explicit STS (LSRKStep) solver command line options:" << endl; + cout << " --lsrkmethod : LSRK method choice" << endl; } // Print user options @@ -545,39 +651,57 @@ void UserOptions::print() cout << " --------------------------------- " << endl; cout << " rtol = " << rtol << endl; cout << " atol = " << atol << endl; - cout << " hfixed = " << hfixed << endl; - cout << " order = " << order << endl; cout << " controller = " << controller << endl; - cout << " max steps = " << maxsteps << endl; - cout << " linear RHS = " << linear << endl; + cout << " hfixed = " << hfixed << endl; cout << " --------------------------------- " << endl; - cout << endl; - if (ls == "sludist") + if (implicit) { - cout << " Linear solver options:" << endl; + cout << " ARKStep options:" << endl; cout << " --------------------------------- " << endl; + cout << " order = " << order << endl; + cout << " max steps = " << maxsteps << endl; + cout << " linear RHS = " << linear << endl; + cout << " --------------------------------- " << endl; + cout << endl; + if (ls == "sludist") + { + cout << " Linear solver options:" << endl; + cout << " --------------------------------- " << endl; #if defined(HAVE_HIP) - cout << " LS = SuperLU_DIST (HIP enabled)" << endl; + cout << " LS = SuperLU_DIST (HIP enabled)" << endl; #elif defined(HAVE_CUDA) - cout << " LS = SuperLU_DIST (CUDA enabled)" << endl; + cout << " LS = SuperLU_DIST (CUDA enabled)" << endl; #else - cout << " LS = SuperLU_DIST" << endl; + cout << " LS = SuperLU_DIST" << endl; #endif - cout << " LS info = " << lsinfo << endl; - cout << " msbp = " << msbp << endl; - cout << " --------------------------------- " << endl; + cout << " LS info = " << lsinfo << endl; + cout << " msbp = " << msbp << endl; + cout << " --------------------------------- " << endl; + } + else + { + cout << " Linear solver options:" << endl; + cout << " --------------------------------- " << endl; + cout << " LS = " << ls << endl; + cout << " precond = " << preconditioning << endl; + cout << " LS info = " << lsinfo << endl; + cout << " LS iters = " << liniters << endl; + cout << " msbp = " << msbp << endl; + cout << " epslin = " << epslin << endl; + cout << " --------------------------------- " << endl; + } } else { - cout << " Linear solver options:" << endl; + cout << " LSRKStep options:" << endl; cout << " --------------------------------- " << endl; - cout << " LS = " << ls << endl; - cout << " precond = " << preconditioning << endl; - cout << " LS info = " << lsinfo << endl; - cout << " LS iters = " << liniters << endl; - cout << " msbp = " << msbp << endl; - cout << " epslin = " << epslin << endl; + switch (lsrkmethod) + { + case (ARKODE_LSRK_RKC_2): cout << " method = RKC_2 " << endl; break; + case (ARKODE_LSRK_RKL_2): cout << " method = RKL_2 " << endl; break; + default: cout << " ERROR: illegal lsrkmethod " << endl; + } cout << " --------------------------------- " << endl; } } diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 22363ef243..695a517ee5 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -317,6 +317,25 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | | | +-----------------------------------------------+------------------------------------------------------------+ + | **LSRK method types** | | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_LSRK_RKC_2` | 2nd order Runge-Kutta-Chebyshev (RKC) method | + | | :c:enumerator:`ARKODE_LSRK_RKC_2` | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_LSRK_RKL_2` | 2nd order Runge-Kutta-Legendre (RKL) method | + | | :c:enumerator:`ARKODE_LSRK_RKL_2` | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_LSRK_SSP_S_2` | Optimal 2nd order s-stage SSP RK method | + | | :c:enumerator:`ARKODE_LSRK_SSP_S_2` | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_LSRK_SSP_S_3` | Optimal 3rd order s-stage SSP RK method | + | | :c:enumerator:`ARKODE_LSRK_SSP_S_3` | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_LSRK_SSP_10_4` | Optimal 4th order 10-stage SSP RK method | + | | :c:enumerator:`ARKODE_LSRK_SSP_10_4` | + +-----------------------------------------------+------------------------------------------------------------+ + | | | + +-----------------------------------------------+------------------------------------------------------------+ | **MRI method types** | | +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_EXPLICIT` | Use an explicit (at the slow time scale) MRI method. | @@ -538,6 +557,12 @@ contains the ARKODE output constants. | :index:`ARK_STEPPER_UNSUPPORTED` | -48 | An operation was not supported by the current | | | | time-stepping module. | +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_DOMEIG_FAIL` | -49 | The dominant eigenvalue function failed. It is either not | + | | | provided or returns an illegal value. | + +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_MAX_STAGE_LIMIT_FAIL` | -50 | Stepper failed to achieve stable results. Either reduce | + | | | the step size or increase the stage_max_limit | + +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_UNRECOGNIZED_ERROR` | -99 | An unknown error was encountered. | +-------------------------------------+------+------------------------------------------------------------+ | | diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index 9d9835c53d..10a053b879 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -61,13 +61,15 @@ for interpolated solution output. We then discuss the current suite of time-stepping modules supplied with ARKODE, including the ARKStep module for :ref:`additive Runge--Kutta methods <ARKODE.Mathematics.ARK>`, the ERKStep module that is optimized for :ref:`explicit Runge--Kutta -methods <ARKODE.Mathematics.ERK>`, and the MRIStep module for :ref:`multirate -infinitesimal step (MIS), multirate infinitesimal GARK (MRI-GARK), and -implicit-explicit MRI-GARK (IMEX-MRI-GARK) methods <ARKODE.Mathematics.MRIStep>`. -We then discuss the :ref:`adaptive temporal error controllers -<ARKODE.Mathematics.Adaptivity>` shared by the time-stepping modules, including -discussion of our choice of norms for measuring errors within various components -of the solver. +methods <ARKODE.Mathematics.ERK>`, the SPRKStep module that provides +:ref:`symplectic partitioned Runge--Kutta methods <ARKODE.Mathematics.SPRKStep>` +for Hamiltonian dynamics, the MRIStep module that provides a variety of +:ref:`multirate infinitesimal methods <ARKODE.Mathematics.MRIStep>`, and the +LSRKStep module that supports :ref:`low-storage Runge--Kutta methods +<ARKODE.Mathematics.LSRK>`. We then discuss the :ref:`adaptive temporal +error controllers <ARKODE.Mathematics.Adaptivity>` shared by the time-stepping +modules, including discussion of our choice of norms for measuring errors +within various components of the solver. We then discuss the nonlinear and linear solver strategies used by ARKODE for solving implicit algebraic systems that arise in computing each @@ -729,6 +731,61 @@ may supply their own method by defining and attaching a coupling table, see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling` for more information. +.. _ARKODE.Mathematics.LSRK: + +LSRKStep -- Low-Storage Runge--Kutta methods +============================================ + +The LSRKStep time-stepping module in ARKODE supports a variety of so-called +"low-storage" Runge--Kutta (LSRK) methods, :cite:p:`VSH:04, MBA:14, K:08, FCS:22`. This category includes traditional explicit +fixed-step and low-storage Runge--Kutta methods, adaptive +low-storage Runge--Kutta methods, and others. These are characterized by coefficient tables +that have an exploitable structure, such that their implementation does not require +that all stages be stored simultaneously. At present, this module supports explicit, +adaptive "super-time-stepping" (STS) and "strong-stability-preserving" (SSP) methods. + +The LSRK time-stepping module in ARKODE currently supports IVP +of the form :eq:`ARKODE_IVP_simple_explicit`, i.e., unlike the more general problem form :eq:`ARKODE_IMEX_IVP`, LSRKStep +requires that problems have an identity mass matrix (i.e., :math:`M(t)=I`) +and that the right-hand side function is not split into separate +components. + +LSRKStep currently supports two families of second-order, explicit, and temporally adaptive STS methods: +Runge--Kutta--Chebyshev (RKC), :cite:p:`VSH:04` and Runge--Kutta--Legendre (RKL), :cite:p:`MBA:14`. These methods have the form + +.. math:: + z_0 &= y_n,\\ + z_1 &= z_0 + h \tilde{\mu}_1 f(t_n,z_0),\\ + z_j &= (1-\mu_j-\nu_j)z_0 + \mu_j z_{j-1} + \nu_jz_{j-2} + h \tilde{\gamma}_j f(t_n,z_0) + h \tilde{\mu}_j f(t_n + c_{j-1}h, z_{j-1}) \\ + y_{n+1} &= z_s. + :label: ARKODE_RKC_RKL + +The corresponding coefficients can be found in :cite:p:`VSH:04` and :cite:p:`MBA:14`, respectively. + +LSRK methods of STS type are designed for stiff problems characterized by +having Jacobians with eigenvalues that have large real and small imaginary parts. +While those problems are traditionally treated using implicit methods, STS methods +are explicit. To achieve stability for these stiff problems, STS methods use more stages than +conventional Runge-Kutta methods to extend the stability region along the negative +real axis. The extent of this stability region is proportional to the square of the number +of stages used. + +LSRK methods of the SSP type are designed to preserve the so-called "strong-stability" properties of advection-type equations. +For details, see :cite:p:`K:08`. +The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p:`SO:88` of explicit Runge--Kutta methods: + +.. math:: + z_1 &= y_n,\\ + z_i &= \sum_{j = 1}^{i-1} \left(\alpha_{i,j}y_j + \beta_{i,j}h f(t_n + c_jh, z_j)\right),\\ + y_{n+1} &= z_s. + :label: ARKODE_SSP + +The coefficients of the Shu--Osher representation are not uniquely determined by the Butcher table :cite:p:`SR:02`. +In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in +:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and +:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The +corresponding coefficients and embedding weights can be found in :cite:p:`K:08` and :cite:p:`FCS:22`, respectively. + .. _ARKODE.Mathematics.Error.Norm: Error norms diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index bef540030c..0795c81651 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -98,7 +98,7 @@ ARKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -121,7 +121,7 @@ ARKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -161,7 +161,7 @@ ARKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -181,7 +181,7 @@ ARKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ARKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -536,7 +536,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Does not change the *user_data* pointer or any @@ -572,7 +572,7 @@ Optional inputs for ARKStep * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory or interpolation module are ``NULL`` * *ARK_INTERP_FAIL* if this is called after :c:func:`ARKStepEvolve()` - * *ARK_ILL_INPUT* if an argument has an illegal value or the + * *ARK_ILL_INPUT* if an argument had an illegal value or the interpolation module has already been initialized **Notes:** @@ -622,7 +622,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This parameter can be ``stdout`` or ``stderr``, although the @@ -651,7 +651,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass 0.0 to return ARKStep to the default (adaptive-step) mode. @@ -712,7 +712,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass 0.0 to use the default value. @@ -742,7 +742,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 10; set *mxhnil* to zero to specify @@ -768,7 +768,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Passing *mxsteps* = 0 results in ARKStep using the @@ -792,7 +792,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. @@ -813,7 +813,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. @@ -835,7 +835,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default is that no stop time is imposed. @@ -908,7 +908,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** If specified, the pointer to *user_data* is passed to all @@ -936,7 +936,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 7; set *maxnef* :math:`\le 0` @@ -959,7 +959,7 @@ Optional inputs for ARKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Should only be called after the method order and integration @@ -1214,7 +1214,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** For explicit methods, the allowed values are :math:`2 \le` @@ -1243,7 +1243,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This is automatically deduced when neither of the function @@ -1263,7 +1263,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This is automatically deduced when the function pointer `fi` @@ -1286,7 +1286,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This is automatically deduced when the function pointer `fe` @@ -1309,7 +1309,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** For a description of the :c:type:`ARKodeButcherTable` type and related @@ -1366,7 +1366,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The allowable values for both the *itable* and *etable* arguments @@ -1408,7 +1408,7 @@ Set additive RK tables via their names :c:func:`ARKStepSetTableName()` int **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The allowable values for both the *itable* and *etable* arguments @@ -1477,7 +1477,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This function should focus on accuracy-based time step @@ -1515,7 +1515,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** If custom parameters are supplied, they will be checked @@ -1549,7 +1549,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This should be called prior to calling :c:func:`ARKStepEvolve()`, and can only be @@ -1574,7 +1574,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default @@ -1598,7 +1598,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value below 1.0 will imply a reset to the default value. @@ -1624,7 +1624,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. @@ -1648,7 +1648,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. @@ -1670,7 +1670,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. @@ -1693,7 +1693,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. @@ -1715,7 +1715,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 1.0` will imply a reset to the default @@ -1740,7 +1740,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value outside the interval :math:`(0,1)` will imply a reset to @@ -1763,7 +1763,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 0` will imply a reset to the default @@ -1787,7 +1787,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 0` will imply a reset to the default value. @@ -1811,7 +1811,7 @@ Optional inputs for time step adaptivity **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This function should return an estimate of the absolute @@ -1845,7 +1845,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Tightens the linear solver tolerances and takes only a @@ -1876,7 +1876,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This is the default behavior of ARKStep, so the function @@ -1922,7 +1922,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 0. If *method* is set to an @@ -2001,7 +2001,7 @@ Optional inputs for implicit stage solves **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 or if the SUNNONLINSOL module is ``NULL`` + * *ARK_ILL_INPUT* if an argument had an illegal value or if the SUNNONLINSOL module is ``NULL`` * *ARK_NLS_OP_ERR* if the SUNNONLINSOL object returned a failure flag **Notes:** @@ -2025,7 +2025,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` @@ -2047,7 +2047,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -2070,7 +2070,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -2095,7 +2095,7 @@ Optional inputs for implicit stage solves **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 10; set *maxncf* :math:`\le 0` @@ -2162,7 +2162,7 @@ Optional inputs for the ARKLS linear solver interface **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -2321,7 +2321,7 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules * *ARKLS_SUCCESS* if successful * *ARKLS_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARKLS_MASSMEM_NULL* if the mass matrix solver memory was ``NULL`` - * *ARKLS_ILL_INPUT* if an argument has an illegal value + * *ARKLS_ILL_INPUT* if an argument had an illegal value **Notes:** This routine must be called after the ARKLS mass matrix @@ -2701,7 +2701,7 @@ Rootfinding optional input functions **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default behavior is to monitor for both zero-crossing directions. @@ -4225,7 +4225,7 @@ vector. * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** All previously set options are retained but may be updated by calling @@ -4257,7 +4257,7 @@ ARKStep reset function * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** By default the next call to :c:func:`ARKStepEvolve()` will use the step size @@ -4304,7 +4304,7 @@ ARKStep system resize function * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` * *ARK_NO_MALLOC* if *arkode_mem* was not allocated. - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** If an error occurred, :c:func:`ARKStepResize()` also sends an error @@ -4375,7 +4375,7 @@ wrap an ARKStep memory block as an :c:type:`MRIStepInnerStepper`. **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Example usage:** .. code-block:: C diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 6c7b7b9cdf..1f4dc8f140 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -95,7 +95,7 @@ ERKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -119,7 +119,7 @@ ERKStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_NO_MALLOC* if the ERKStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -312,7 +312,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Does not change problem-defining function pointer *f* @@ -350,7 +350,7 @@ Optional inputs for ERKStep * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory or interpolation module are ``NULL`` * *ARK_INTERP_FAIL* if this is called after :c:func:`ERKStepEvolve()` - * *ARK_ILL_INPUT* if an argument has an illegal value or the + * *ARK_ILL_INPUT* if an argument had an illegal value or the interpolation module has already been initialized **Notes:** @@ -402,7 +402,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This parameter can be ``stdout`` or ``stderr``, although the @@ -431,7 +431,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass 0.0 to return ERKStep to the default (adaptive-step) mode. @@ -491,7 +491,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass 0.0 to use the default value. @@ -522,7 +522,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 10; set *mxhnil* to zero to specify @@ -549,7 +549,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Passing *mxsteps* = 0 results in ERKStep using the @@ -574,7 +574,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass *hmax* :math:`\le 0.0` to set the default value of :math:`\infty`. @@ -596,7 +596,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Pass *hmin* :math:`\le 0.0` to set the default value of 0. @@ -619,7 +619,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default is that no stop time is imposed. @@ -650,7 +650,7 @@ Optional inputs for ERKStep **Return value:** * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` + * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` .. versionadded:: 5.6.0 @@ -695,7 +695,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** If specified, the pointer to *user_data* is passed to all @@ -720,7 +720,7 @@ Optional inputs for ERKStep **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 7; set *maxnef* :math:`\le 0` @@ -836,7 +836,7 @@ Optional inputs for IVP method selection **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The allowed values are :math:`2 \le` *ord* :math:`\le @@ -863,7 +863,7 @@ Optional inputs for IVP method selection **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** @@ -896,7 +896,7 @@ Optional inputs for IVP method selection **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** *etable* should match an existing explicit method from @@ -919,7 +919,7 @@ Optional inputs for IVP method selection **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** *etable* should match an existing explicit method from @@ -982,7 +982,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This function should focus on accuracy-based time step @@ -1019,7 +1019,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** If custom parameters are supplied, they will be checked @@ -1051,7 +1051,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This should be called prior to calling :c:func:`ERKStepEvolve()`, and can only be @@ -1076,7 +1076,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default @@ -1101,7 +1101,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value below 1.0 will imply a reset to the default value. @@ -1128,7 +1128,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any interval *not* containing 1.0 will imply a reset to the default values. @@ -1151,7 +1151,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value outside the interval :math:`(0,1]` will imply a reset to the default value. @@ -1175,7 +1175,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 1.0` will imply a reset to the default value. @@ -1198,7 +1198,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\le 1.0` will imply a reset to the default @@ -1224,7 +1224,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any value :math:`\ge 1.0` or :math:`\le 0.0` will imply a reset to @@ -1248,7 +1248,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default @@ -1273,7 +1273,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -1298,7 +1298,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This function should return an estimate of the absolute @@ -1338,7 +1338,7 @@ Rootfinding optional input functions **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 + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default behavior is to monitor for both zero-crossing directions. @@ -1877,7 +1877,7 @@ Main solver optional output functions **Return value:** * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` .. versionadded:: 5.3.0 @@ -2016,7 +2016,7 @@ user must call the function :c:func:`ERKStepReInit()`. The new problem must have the same size as the previous one. This routine retains the current settings for all ERKstep module options and performs the same input checking and initializations that are done in -:c:func:`ERKStepCreate`, but it performs no memory allocation as is +:c:func:`ERKStepCreate`, but it performs no memory allocation as it assumes that the existing internal memory is sufficient for the new problem. A call to this re-initialization routine deletes the solution history that was stored internally during the previous @@ -2065,7 +2065,7 @@ vector. * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** All previously set options are retained but may be updated by calling @@ -2097,7 +2097,7 @@ ERKStep reset function * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** By default the next call to :c:func:`ERKStepEvolve()` will use the step size @@ -2146,7 +2146,7 @@ ERKStep system resize function * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` * *ARK_NO_MALLOC* if *arkode_mem* was not allocated. - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** If an error occurred, :c:func:`ERKStepResize()` also sends an error diff --git a/doc/arkode/guide/source/Usage/General.rst b/doc/arkode/guide/source/Usage/General.rst index c0980dfcee..745e9e9ed9 100644 --- a/doc/arkode/guide/source/Usage/General.rst +++ b/doc/arkode/guide/source/Usage/General.rst @@ -56,7 +56,8 @@ to the SUNDIALS core header file. #include <arkode/arkode_arkstep.h> // ARKStep provides explicit, implicit, IMEX additive RK methods. #include <arkode/arkode_mristep.h> // MRIStep provides mutlirate RK methods. #include <arkode/arkode_sprkstep.h> // SPRKStep provides symplectic partition RK methods. - + #include <arkode/arkode_lsrkstep.h> // LSRKStep provides low-storage RK methods. + Each of these define several types and various constants, include function prototypes, and include the shared ``arkode/arkode.h`` and ``arkode/arkode_ls.h`` header files. No other header files are required to be diff --git a/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst new file mode 100644 index 0000000000..a08e5918b4 --- /dev/null +++ b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst @@ -0,0 +1,389 @@ +.. ---------------------------------------------------------------- + Programmer(s): Mustafa Aggul @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.LSRKStep.UserCallable: + +LSRKStep User-callable functions +================================== + +This section describes the LSRKStep-specific functions that may be called +by the user to setup and then solve an IVP using the LSRKStep time-stepping +module. As mentioned in Section :numref:`ARKODE.Usage.UserCallable`, +shared ARKODE-level routines may be used for the large majority of LSRKStep +configuration and use. In this section, we describe only those routines +that are specific to LSRKStep. + +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +LSRKStep supports the following categories: + +* temporal adaptivity + + + +.. _ARKODE.Usage.LSRKStep.Initialization: + +LSRKStep initialization functions +--------------------------------- + + +.. c:function:: void* LSRKStepCreateSTS(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, SUNContext sunctx); + + This function allocates and initializes memory for a problem to + be solved using STS methods from the LSRKStep time-stepping module in ARKODE. + + **Arguments:** + * *rhs* -- the name of the C function (of type :c:func:`ARKRhsFn()`) + defining the right-hand side function. + * *t0* -- the initial value of :math:`t`. + * *y0* -- the initial condition vector :math:`y(t_0)`. + * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) + + **Return value:** + If successful, a pointer to initialized problem memory + of type ``void*``, to be passed to all user-facing LSRKStep routines + listed below. If unsuccessful, a ``NULL`` pointer will be + returned, and an error message will be printed to ``stderr``. + + +.. c:function:: void* LSRKStepCreateSSP(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, SUNContext sunctx); + + This function allocates and initializes memory for a problem to + be solved using SSP methods from the LSRKStep time-stepping module in ARKODE. + + **Arguments:** + * *rhs* -- the name of the C function (of type :c:func:`ARKRhsFn()`) + defining the right-hand side function. + * *t0* -- the initial value of :math:`t`. + * *y0* -- the initial condition vector :math:`y(t_0)`. + * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) + + **Return value:** + If successful, a pointer to initialized problem memory + of type ``void*``, to be passed to all user-facing LSRKStep routines + listed below. If unsuccessful, a ``NULL`` pointer will be + returned, and an error message will be printed to ``stderr``. + + +.. _ARKODE.Usage.LSRKStep.OptionalInputs: + +Optional input functions +------------------------- + + +.. c:function:: int LSRKStepSetSTSMethod(void* arkode_mem, ARKODE_LSRKMethodType method); + + This function selects the LSRK STS method that should be used. The list of allowable + values for this input is below. :c:func:`LSRKStepCreateSTS` defaults to using + :c:enumerator:`ARKODE_LSRK_RKC_2`. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *method* -- Type of the method. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method type). + + +.. c:function:: int LSRKStepSetSSPMethod(void* arkode_mem, ARKODE_LSRKMethodType method); + + This function selects the LSRK SSP method that should be used. The list of allowable + values for this input is below. :c:func:`LSRKStepCreateSSP` defaults to using + :c:enumerator:`ARKODE_LSRK_SSP_S_2`. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *method* -- Type of the method. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method type). + + +Allowable Method Families + +.. c:enum:: ARKODE_LSRKMethodType + + .. c:enumerator:: ARKODE_LSRK_RKC_2 + + Second order Runge--Kutta--Chebyshev method + + .. c:enumerator:: ARKODE_LSRK_RKL_2 + + Second order Runge--Kutta--Legendre method + + .. c:enumerator:: ARKODE_LSRK_SSP_S_2 + + Second order, s-stage SSP(s,2) method + + .. c:enumerator:: ARKODE_LSRK_SSP_S_3 + + Third order, s-stage SSP(s,3) method + + .. c:enumerator:: ARKODE_LSRK_SSP_10_4 + + Fourth order, 10-stage SSP(10,4) method + + +.. c:function:: int LSRKStepSetSTSMethodByName(void* arkode_mem, const char* emethod); + + This function selects the LSRK STS method by name. The list of allowable values + for this input is above. :c:func:`LSRKStepCreateSTS` defaults to using + :c:enumerator:`ARKODE_LSRK_RKC_2`. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *emethod* -- the method name. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name). + + +.. c:function:: int LSRKStepSetSSPMethodByName(void* arkode_mem, const char* emethod); + + This function selects the LSRK SSP method by name. The list of allowable values + for this input is above. :c:func:`LSRKStepCreateSSP` defaults to using + :c:enumerator:`ARKODE_LSRK_SSP_S_2`. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *emethod* -- the method name. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. typo in the method name). + + +.. c:function:: int LSRKStepSetDomEigFn(void* arkode_mem, ARKDomEigFn dom_eig); + + Specifies the dominant eigenvalue approximation routine to + be used for determining the number of stages that will be used by either the + RKC or RKL methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *dom_eig* -- name of user-supplied dominant eigenvalue approximation function (of type :c:func:`ARKDomEigFn()`). + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. + * *ARK_ILL_INPUT* ``dom_eig = NULL`` and LSRKStep does not currently estimate this internally. + + .. note:: This function is currently required when either the RKC or RKL methods are used. + + +.. c:function:: int LSRKStepSetDomEigFrequency(void* arkode_mem, long int nsteps); + + Specifies the number of steps after which the dominant eigenvalue information is + considered out-of-date, and should be recomputed. This only applies to RKL and RKC methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *nsteps* -- the dominant eigenvalue re-computation update frequency. A value ``nsteps = 0`` indicates that the dominant eigenvalue will not change throughout the simulation. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. + +.. note:: If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps`` is set to :math:`25` as recommended in :cite:p:`VSH:04`. + Calling this function with ``nsteps < 0`` resets the default value while ``nsteps = 0`` refers to constant dominant eigenvalue. + + +.. c:function:: int LSRKStepSetMaxNumStages(void* arkode_mem, int stage_max_limit); + + Specifies the maximum number of stages allowed within each time step. This bound only applies to + RKL and RKC methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *stage_max_limit* -- maximum allowed number of stages :math:`(>=2)`. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. + +.. note:: If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit`` is + set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the default value. + This limit should be chosen with consideration of the following proportionality: :math:`s^2 \sim - h\lambda`, + where :math:`s` is the number of stages used, :math:`h` is the current step size and :math:`\lambda` is the dominant eigenvalue. + + +.. c:function:: int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety); + + Specifies a safety factor to use for the result of the dominant eigenvalue estimation function. + This value is used to scale the magnitude of the dominant eigenvalue, in the hope of ensuring + a sufficient number of stages for the method to be stable. This input is only used for RKC + and RKL methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *dom_eig_safety* -- safety factor :math:`(\ge 1)`. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. + +.. note:: If LSRKStepSetDomEigSafetyFactor routine is not called, then the default ``dom_eig_safety`` is + set to :math:`1.01`. Calling this function with ``dom_eig_safety < 1`` resets the default value. + + +.. c:function:: int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages); + + Sets the number of stages, ``s`` in ``SSP(s, p)`` methods. This input is only utilized by SSPRK methods. + + * :c:enumerator:`ARKODE_LSRK_SSP_S_2` -- ``num_of_stages`` must be greater than or equal to 2 + * :c:enumerator:`ARKODE_LSRK_SSP_S_3` -- ``num_of_stages`` must be a perfect-square greater than or equal to 4 + * :c:enumerator:`ARKODE_LSRK_SSP_10_4` -- ``num_of_stages`` cannot be modified from 10, so this function should not be called. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *num_of_stages* -- number of stages :math:`(>1)` for ``SSP(s,2)`` and :math:`(n^2 = s \geq 4)` for ``SSP(s,3)``. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. SSP method is not declared) + +.. note:: If LSRKStepSetSSPStageNum routine is not called, then the default ``num_of_stages`` is + set. Calling this function with ``num_of_stages <= 0`` resets the default values: + + * ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2` + * ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3` + * ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4` + +.. _ARKODE.Usage.LSRKStep.OptionalOutputs: + +Optional output functions +------------------------------ + +.. c:function:: int LSRKStepGetNumDomEigUpdates(void* arkode_mem, long int* dom_eig_num_evals); + + Returns the number of dominant eigenvalue evaluations (so far). + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *dom_eig_num_evals* -- number of calls to the user's ``dom_eig`` function. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the LSRKStep memory was ``NULL`` + + +.. c:function:: int LSRKStepGetMaxNumStages(void* arkode_mem, int* stage_max); + + Returns the max number of stages used in any single step (so far). + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *stage_max* -- max number of stages used. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the LSRKStep memory was ``NULL`` + +.. _ARKODE.Usage.LSRKStep.Reinitialization: + +LSRKStep re-initialization function +------------------------------------- + +To reinitialize the LSRKStep module for the solution of a new problem, +where a prior call to :c:func:`LSRKStepCreateSTS` or :c:func:`LSRKStepCreateSSP` +has been made, the user must call the function :c:func:`LSRKStepReInitSTS()` +or :c:func:`LSRKStepReInitSSP()`, accordingly. The new problem must have +the same size as the previous one. This routine retains the current settings +for all LSRKstep module options and performs the same input checking and +initializations that are done in :c:func:`LSRKStepCreateSTS` or +:c:func:`LSRKStepCreateSSP`, but it performs no memory allocation as it +assumes that the existing internal memory is sufficient for the new problem. +A call to this re-initialization routine deletes the solution history that +was stored internally during the previous integration, and deletes any +previously-set *tstop* value specified via a call to +:c:func:`ARKodeSetStopTime()`. Following a successful call to +:c:func:`LSRKStepReInitSTS()` or :c:func:`LSRKStepReInitSSP()`, +call :c:func:`ARKodeEvolve()` again for the solution of the new problem. + +One important use of the :c:func:`LSRKStepReInitSTS()` and +:c:func:`LSRKStepReInitSSP()` function is in the treating of jump +discontinuities in the RHS function. Except in cases of fairly small +jumps, it is usually more efficient to stop at each point of discontinuity +and restart the integrator with a readjusted ODE model, using a call to this +routine. To stop when the location of the discontinuity is known, simply +make that location a value of ``tout``. To stop when the location of +the discontinuity is determined by the solution, use the rootfinding feature. +In either case, it is critical that the RHS function *not* incorporate the +discontinuity, but rather have a smooth extension over the discontinuity, +so that the step across it (and subsequent rootfinding, if used) can be done +efficiently. Then use a switch within the RHS function (communicated through +``user_data``) that can be flipped between the stopping of the integration +and the restart, so that the restarted problem uses the new values (which +have jumped). Similar comments apply if there is to be a jump in the +dependent variable vector. + + +.. c:function:: int LSRKStepReInitSTS(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, N_Vector y0); + + Provides required problem specifications and re-initializes the + LSRKStep time-stepper module when using STS methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *rhs* -- the name of the C function (of type :c:func:`ARKRhsFn()`) + defining the right-hand side function. + * *t0* -- the initial value of :math:`t`. + * *y0* -- the initial condition vector :math:`y(t_0)`. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the LSRKStep memory was ``NULL`` + * *ARK_MEM_FAIL* if memory allocation failed + * *ARK_NO_MALLOC* if memory allocation failed + * *ARK_CONTROLLER_ERR* if unable to reset error controller object + * *ARK_ILL_INPUT* if an argument had an illegal value. + + .. note:: + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. + + If an error occurred, :c:func:`LSRKStepReInitSTS()` also + sends an error message to the error handler function. + +.. c:function:: int LSRKStepReInitSSP(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, N_Vector y0); + + Provides required problem specifications and re-initializes the + LSRKStep time-stepper module when using SSP methods. + + **Arguments:** + * *arkode_mem* -- pointer to the LSRKStep memory block. + * *rhs* -- the name of the C function (of type :c:func:`ARKRhsFn()`) + defining the right-hand side function. + * *t0* -- the initial value of :math:`t`. + * *y0* -- the initial condition vector :math:`y(t_0)`. + + **Return value:** + * *ARK_SUCCESS* if successful + * *ARK_MEM_NULL* if the LSRKStep memory was ``NULL`` + * *ARK_MEM_FAIL* if memory allocation failed + * *ARK_NO_MALLOC* if memory allocation failed + * *ARK_CONTROLLER_ERR* if unable to reset error controller object + * *ARK_ILL_INPUT* if an argument had an illegal value. + + .. note:: + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. + + If an error occurred, :c:func:`LSRKStepReInitSSP()` also + sends an error message to the error handler function. \ No newline at end of file diff --git a/doc/arkode/guide/source/Usage/LSRKStep/User_supplied.rst b/doc/arkode/guide/source/Usage/LSRKStep/User_supplied.rst new file mode 100644 index 0000000000..2363898955 --- /dev/null +++ b/doc/arkode/guide/source/Usage/LSRKStep/User_supplied.rst @@ -0,0 +1,52 @@ +.. ---------------------------------------------------------------- + Programmer(s): Mustafa Aggul @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + +.. _LSRKSTEP.Usage.UserSupplied: + +User-supplied functions +============================= + +In addition to the required :c:type:`ARKRhsFn` arguments that define the IVP, +RKL and RKC methods additionally require an :c:type:`ARKDomEigFn` function to +estimate the dominant eigenvalue. + + + + +.. _LSRKStep.Usage.dom_eig: + +The dominant eigenvalue estimation +---------------------------------- + +When running LSRKStep with either the RKC or RKL methods, the user must supply +a dominant eigenvalue estimation function of type :c:type:`ARKDomEigFn`: + +.. c:type:: int (*ARKDomEigFn)(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, sunrealtype* lambdaI, void* user_data, N_Vector temp1, N_Vector temp2, N_Vector temp3); + + These functions compute the dominant eigenvalue of the Jacobian of the ODE + right-hand side for a given value of the independent variable :math:`t` and + state vector :math:`y`. + + :param t: the current value of the independent variable. + :param y: the current value of the dependent variable vector. + :param fn: the current value of the vector :math:`f(t,y)`. + :param lambdaR: The real part of the dominant eigenvalue. + :param lambdaI: The imaginary part of the dominant eigenvalue. + :param user_data: the `user_data` pointer that was passed to + :c:func:`ARKodeSetUserData`. + :param tmp*: pointers to memory allocated to + variables of type ``N_Vector`` which can be used by an + ARKDomEigFn as temporary storage or work space. + + :return: An *ARKDomEigFn* should return 0 if successful and any nonzero for a failure. \ No newline at end of file diff --git a/doc/arkode/guide/source/Usage/LSRKStep/index.rst b/doc/arkode/guide/source/Usage/LSRKStep/index.rst new file mode 100644 index 0000000000..ca07bfffc3 --- /dev/null +++ b/doc/arkode/guide/source/Usage/LSRKStep/index.rst @@ -0,0 +1,32 @@ +.. ---------------------------------------------------------------- + Programmer(s): Mustafa Aggul @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.LSRKStep: + +======================================= +Using the LSRKStep time-stepping module +======================================= + +This section is concerned with the use of the LSRKStep time-stepping +module for the solution of initial value problems (IVPs) in a C or C++ +language setting. Usage of LSRKStep follows that of the rest of ARKODE, +and so in this section we primarily focus on those usage aspects that +are specific to LSRKStep. + +.. toctree:: + :maxdepth: 1 + + User_callable + User_supplied + \ No newline at end of file diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index a6354a6037..967e8e7c12 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -134,7 +134,7 @@ MRIStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -158,7 +158,7 @@ MRIStep tolerance specification functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument has an illegal value (e.g. a negative tolerance). + * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -361,7 +361,7 @@ MRIStep solver function internal time-stepping. (b) The linear solver initialization function (called by the - user after calling :c:func:`ARKStepCreate`) failed to set + user after calling :c:func:`MRIStepCreate`) failed to set the linear solver-specific *lsolve* field in *arkode_mem*. @@ -447,7 +447,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This function does not change problem-defining function pointers *fs* and *ff* or the *user_data* pointer. It also does not affect any data @@ -489,7 +489,7 @@ Optional inputs for MRIStep * *ARK_INTERP_FAIL* if this is called after :c:func:`MRIStepEvolve()` - * *ARK_ILL_INPUT* if an argument has an illegal value or the + * *ARK_ILL_INPUT* if an argument had an illegal value or the interpolation module has already been initialized **Notes:** Allowed values are between 0 and 5. @@ -544,7 +544,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This parameter can be ``stdout`` or ``stderr``, although the suggested approach is to specify a pointer to a unique file opened @@ -577,7 +577,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** @@ -608,7 +608,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 10; set *mxhnil* to zero to specify this default. @@ -639,7 +639,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Passing *mxsteps* = 0 results in MRIStep using the default value (500). @@ -669,7 +669,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** @@ -701,7 +701,7 @@ Optional inputs for MRIStep **Return value:** * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` + * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` .. versionadded:: 5.6.0 @@ -751,17 +751,16 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** If specified, the pointer to *user_data* is passed to all user-supplied functions called by the outer integrator for which it is an argument; otherwise ``NULL`` is passed. - To attach a user data block to the inner integrator call the appropriate - *SetUserData* function for the inner integrator memory structure (e.g., - :c:func:`ARKStepSetUserData()` if the inner stepper is ARKStep). This pointer - may be the same as or different from the pointer attached to the outer - integrator depending on what is required by the user code. + To attach a user data block to the inner integrator call :c:func:`ARKodeSetUserData` + for the inner integrator memory structure. This pointer may be the same as or + different from the pointer attached to the outer integrator depending on what is + required by the user code. .. deprecated:: 6.1.0 @@ -867,7 +866,7 @@ Optional inputs for IVP method selection * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** @@ -900,7 +899,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Tightens the linear solver tolerances and takes only a single Newton iteration. Calls :c:func:`MRIStepSetDeltaGammaMax()` @@ -930,7 +929,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** This is the default behavior of MRIStep, so the function is primarily useful to undo a previous call to @@ -970,7 +969,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 0. If *method* is set to an undefined value, this default predictor will be used. @@ -996,7 +995,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value or if the SUNNONLINSOL module is ``NULL`` + * *ARK_ILL_INPUT* if an argument had an illegal value or if the SUNNONLINSOL module is ``NULL`` * *ARK_NLS_OP_ERR* if the SUNNONLINSOL object returned a failure flag **Notes:** The default value is 3; set *maxcor* :math:`\le 0` @@ -1019,7 +1018,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. @@ -1041,7 +1040,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -1064,7 +1063,7 @@ Optional inputs for implicit stage solves **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -1173,7 +1172,7 @@ Optional inputs for the ARKLS linear solver interface **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** Any non-positive parameter will imply a reset to the default value. @@ -1534,7 +1533,7 @@ Rootfinding optional input functions **Return value:** * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument has an illegal value + * *ARK_ILL_INPUT* if an argument had an illegal value **Notes:** The default behavior is to monitor for both zero-crossing directions. @@ -1990,7 +1989,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the ARKStep memory was ``NULL`` + * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` .. versionadded:: 5.3.0 @@ -2645,7 +2644,7 @@ To reinitialize the MRIStep module for the solution of a new problem, where a prior call to :c:func:`MRIStepCreate()` has been made, the user must call the function :c:func:`MRIStepReInit()`. The new problem must have the same size as the previous one. This routine -retains the current settings for all ARKstep module options and +retains the current settings for all MRIStep module options and performs the same input checking and initializations that are done in :c:func:`MRIStepCreate()`, but it performs no memory allocation as is assumes that the existing internal memory is sufficient for the new @@ -2708,7 +2707,7 @@ vector. * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** If the inner (fast) stepper also needs to be reinitialized, its @@ -2749,7 +2748,7 @@ MRIStep reset function * *ARK_MEM_FAIL* if a memory allocation failed - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** If the inner (fast) stepper also needs to be reset, its reset function should @@ -2806,7 +2805,7 @@ MRIStep system resize function * *ARK_NO_MALLOC* if *arkode_mem* was not allocated. - * *ARK_ILL_INPUT* if an argument has an illegal value. + * *ARK_ILL_INPUT* if an argument had an illegal value. **Notes:** If an error occurred, :c:func:`MRIStepResize()` also sends an error message to the error handler function. diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 73bde21f90..e4a88b1d18 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -227,7 +227,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. note:: @@ -262,7 +262,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory or interpolation module are ``NULL`` :retval ARK_INTERP_FAIL: if this is called after :c:func:`SPRKStepEvolve()` - :retval ARK_ILL_INPUT: if an argument has an illegal value or the + :retval ARK_ILL_INPUT: if an argument had an illegal value or the interpolation module has already been initialized .. note:: @@ -298,7 +298,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. deprecated:: 6.1.0 @@ -321,7 +321,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. deprecated:: 6.1.0 @@ -348,7 +348,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. deprecated:: 6.1.0 @@ -386,7 +386,7 @@ Optional inputs for SPRKStep :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. deprecated:: 6.1.0 @@ -430,7 +430,7 @@ Optional inputs for IVP method selection :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. warning:: @@ -451,7 +451,7 @@ Optional inputs for IVP method selection :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. note:: @@ -472,7 +472,7 @@ Optional inputs for IVP method selection :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. warning:: @@ -494,7 +494,7 @@ Optional inputs for IVP method selection :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value @@ -522,7 +522,7 @@ Rootfinding optional input functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory is ``NULL`` - :retval ARK_ILL_INPUT: if an argument has an illegal value + :retval ARK_ILL_INPUT: if an argument had an illegal value .. deprecated:: 6.1.0 @@ -809,7 +809,7 @@ Main solver optional output functions :param user_data: memory reference to a user data pointer :retval ARK_SUCCESS: if successful - :retval ARK_MEM_NULL: if the ARKStep memory was ``NULL`` + :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -945,7 +945,7 @@ the RHS function should not incorporate the discontinuity. :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` :retval ARK_MEM_FAIL: if a memory allocation failed - :retval ARK_ILL_INPUT: if an argument has an illegal value. + :retval ARK_ILL_INPUT: if an argument had an illegal value. .. _ARKODE.Usage.SPRKStep.Reset: @@ -971,7 +971,7 @@ SPRKStep reset function :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` :retval ARK_MEM_FAIL: if a memory allocation failed - :retval ARK_ILL_INPUTL: if an argument has an illegal value. + :retval ARK_ILL_INPUTL: if an argument had an illegal value. .. note:: diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 98de3a33b6..8737483ddd 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -790,6 +790,10 @@ the user has set a stop time (with a call to the optional input function :retval ARK_MASSSETUP_FAIL: the mass matrix solver's setup routine failed. :retval ARK_MASSSOLVE_FAIL: the mass matrix solver's solve routine failed. :retval ARK_VECTOROP_ERR: a vector operation error occurred. + :retval ARK_DOMEIG_FAIL: the dominant eigenvalue function failed. It is either + not provided or returns an illegal value. + :retval ARK_MAX_STAGE_LIMIT_FAIL: stepper failed to achieve stable results. Either + reduce the step size or increase the stage_max_limit .. note:: @@ -3421,7 +3425,9 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat .. c:function:: int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps) Returns the cumulative number of stability-limited steps - taken by the solver (so far). + taken by the solver (so far). If the combination of the maximum number of stages + and the current time step size in the LSRKStep module will not allow for a stable + step, the counter also accounts for such returns. :param arkode_mem: pointer to the ARKODE memory block. :param expsteps: number of stability-limited steps taken in the solver. diff --git a/doc/arkode/guide/source/Usage/index.rst b/doc/arkode/guide/source/Usage/index.rst index 93b63d84b8..88cbfa7d3d 100644 --- a/doc/arkode/guide/source/Usage/index.rst +++ b/doc/arkode/guide/source/Usage/index.rst @@ -37,8 +37,8 @@ ARKODE's time stepping modules, including "relaxation" methods and preconitioners. Following our discussion of these commonalities, we separately discuss the usage details that that are specific to each of ARKODE's time stepping modules: :ref:`ARKStep <ARKODE.Usage.ARKStep>`, -:ref:`ERKStep <ARKODE.Usage.ERKStep>`, :ref:`SPRKStep <ARKODE.Usage.SPRKStep>` -and :ref:`MRIStep <ARKODE.Usage.MRIStep>`. +:ref:`ERKStep <ARKODE.Usage.ERKStep>`, :ref:`SPRKStep <ARKODE.Usage.SPRKStep>`, +:ref:`MRIStep <ARKODE.Usage.MRIStep>`, and :ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. ARKODE also uses various input and output constants; these are defined as needed throughout this chapter, but for convenience the full list is provided @@ -77,5 +77,6 @@ ARKBBDPRE can only be used with NVECTOR_PARALLEL. Preconditioners ARKStep/index.rst ERKStep/index.rst + LSRKStep/index.rst SPRKStep/index.rst MRIStep/index.rst diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 2be479f59c..d487a4a8d0 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -22,6 +22,12 @@ only valid for Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, +:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. This currently supports five explicit low-storage +methods: the second-order Runge--Kutta--Chebyshev and Runge--Kutta--Legendre methods, +and the second- through fourth-order optimal strong stability preserving Runge--Kutta methods. +All methods include embeddings for temporal adaptivity. + The Trilinos Tpetra NVector interface has been updated to utilize CMake imported targets added in Trilinos 14 to improve support for different Kokkos backends with Trilinos. As such, Trilinos 14 or newer is required and the diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index b000f2c3dc..8d3ccec6e6 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -713,7 +713,7 @@ @article{ginkgo-toms-2022 copyright = {All rights reserved}, issn = {0098-3500}, shorttitle = {Ginkgo}, -url = {https://doi.org/10.1145/3480935}, +url = {10.1145/3480935}, doi = {10.1145/3480935}, number = {1}, urldate = {2022-02-17}, @@ -2114,7 +2114,7 @@ @article{Sof:03 year = {2003}, note = {Special Issue on Geometric Numerical Algorithms}, issn = {0167-739X}, - doi = {https://doi.org/10.1016/S0167-739X(02)00164-4}, + doi = {10.1016/S0167-739X(02)00164-4}, url = {https://www.sciencedirect.com/science/article/pii/S0167739X02001644}, author = {Mark Sofroniou and Giulia Spaletta} } @@ -2199,7 +2199,7 @@ @article{Tao:22 pages = {110846}, year = {2022}, issn = {0021-9991}, - doi = {https://doi.org/10.1016/j.jcp.2021.110846}, + doi = {10.1016/j.jcp.2021.110846}, url = {https://www.sciencedirect.com/science/article/pii/S0021999121007415}, author = {Molei Tao and Shi Jin}, keywords = {Symplectic integrator, Time-reversible / symmetric integrator, Hamiltonian with discontinuous potential, Contact and impact at interface, Reflection and refraction, Sauteed mushroom} @@ -2369,3 +2369,66 @@ @article{edwards2014kokkos issn = {0743-7315}, doi = {10.1016/j.jpdc.2014.07.003} } + +@article{VSH:04, +title = {{RKC} time-stepping for advection–diffusion–reaction problems}, +journal = {Journal of Computational Physics}, +volume = {201}, +number = {1}, +pages = {61-79}, +year = {2004}, +issn = {0021-9991}, +doi = {10.1016/j.jcp.2004.05.002}, +author = {J.G. Verwer and B.P. Sommeijer and W. Hundsdorfer}} + +@article{MBA:14, +title = {A stabilized {Runge--Kutta--Legendre} method for explicit super-time-stepping of parabolic and mixed equations}, +journal = {Journal of Computational Physics}, +volume = {257}, +pages = {594-626}, +year = {2014}, +issn = {0021-9991}, +doi = {10.1016/j.jcp.2013.08.021}, +author = {Chad D. Meyer and Dinshaw S. Balsara and Tariq D. Aslam}} + +@article{K:08, +title = {Highly Efficient Strong Stability-Preserving {Runge--Kutta} Methods with Low-Storage Implementations}, +journal = {SIAM Journal on Scientific Computing}, +volume = {30}, +number = {4}, +pages = {2113-2136}, +year = {2008}, +doi = {10.1137/07070485X}, +author = {Ketcheson, David I.}} + +@article{FCS:22, +title = {Embedded pairs for optimal explicit strong stability preserving {Runge--Kutta} methods}, +journal = {Journal of Computational and Applied Mathematics}, +volume = {412}, +pages = {114325}, +year = {2022}, +issn = {0377-0427}, +doi = {10.1016/j.cam.2022.114325}, +author = {Imre Fekete and Sidafa Conde and John N. Shadid}} + +@article{SO:88, +title={Efficient implementation of essentially non-oscillatory shock-capturing schemes}, +journal={Journal of computational physics}, +volume={77}, +number={2}, +pages={439--471}, +year={1988}, +publisher={Elsevier}, +doi={10.1016/0021-9991(88)90177-5}, +author={Shu, Chi-Wang and Osher, Stanley}} + +@article{SR:02, +title={A new class of optimal high-order strong-stability-preserving time discretization methods}, +journal={SIAM Journal on Numerical Analysis}, +volume={40}, +number={2}, +pages={469--491}, +year={2002}, +publisher={SIAM}, +doi={10.1137/S0036142901389025}, +author={Spiteri, Raymond J and Ruuth, Steven J}} \ No newline at end of file diff --git a/examples/arkode/CMakeLists.txt b/examples/arkode/CMakeLists.txt index bfcbe267fd..611ac56cd8 100644 --- a/examples/arkode/CMakeLists.txt +++ b/examples/arkode/CMakeLists.txt @@ -42,6 +42,9 @@ endif() # C++ examples if(EXAMPLES_ENABLE_CXX) add_subdirectory(CXX_serial) + if(BUILD_NVECTOR_MANYVECTOR) + add_subdirectory(CXX_manyvector) + endif() if(ENABLE_MPI AND MPI_CXX_FOUND) add_subdirectory(CXX_parallel) endif() diff --git a/examples/arkode/CXX_manyvector/CMakeLists.txt b/examples/arkode/CXX_manyvector/CMakeLists.txt new file mode 100644 index 0000000000..037f1fd83b --- /dev/null +++ b/examples/arkode/CXX_manyvector/CMakeLists.txt @@ -0,0 +1,84 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# --------------------------------------------------------------- +# CMakeLists.txt file for ARKODE C++ manyvector examples +# --------------------------------------------------------------- + +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases + +# Examples using SUNDIALS linear solvers +set(ARKODE_examples "ark_sod_lsrk.cpp\;\;exclude-single") + +# Header files to install +set(ARKODE_headers) + +# Auxiliary files to install +set(ARKODE_extras plot_sod.py) + +# Add the build and install targets for each example +foreach(example_tuple ${ARKODE_examples}) + + # parse the example tuple + list(GET example_tuple 0 example) + list(GET example_tuple 1 example_args) + list(GET example_tuple 2 example_type) + + # extract the file name without extension + get_filename_component(example_target ${example} NAME_WE) + + # add example executable + if(NOT TARGET ${example_target}) + add_executable(${example_target} ${example}) + + set_target_properties(${example_target} PROPERTIES FOLDER "Examples") + + # directories to include + target_include_directories(${example_target} + PRIVATE ${PROJECT_SOURCE_DIR}/examples/utilities) + + # libraries to link against + target_link_libraries(${example_target} sundials_arkode sundials_nvecserial + sundials_nvecmanyvector ${EXE_EXTRA_LINK_LIBS}) + + endif() + + # check if example args are provided and set the test name + if("${example_args}" STREQUAL "") + set(test_name ${example_target}) + else() + string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) + endif() + + # add example to regression tests + sundials_add_test( + ${test_name} ${example_target} + TEST_ARGS ${example_args} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + EXAMPLE_TYPE ${example_type}) + +endforeach(example_tuple ${ARKODE_examples}) + +if(EXAMPLES_INSTALL) + + sundials_install_examples( + arkode ARKODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + MAKE_TEMPLATE makefile_serial_CXX_ex.in + SUNDIALS_TARGETS nvecserial nvecmanyvector arkode + DESTINATION arkode/CXX_manyvector + EXTRA_FILES ${ARKODE_extras} ${ARKODE_headers} + TEST_INSTALL CXX_manyvector) + +endif() diff --git a/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp b/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp new file mode 100644 index 0000000000..2813b150bf --- /dev/null +++ b/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp @@ -0,0 +1,580 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 example performs a standard 1D sod shock tube (see section 5.2 of J.A. + * Greenough and W.J. Rider, "A quantitative comparison of numerical methods for + * the compressible Euler equations: fifth-order WENO and piecewise-linear + * Godunov," J. Comput. Phys., 196:259-281, 2004) + * [rho, vx, p] = { [1, 0, 1] if x < 0.5 + * { [0.125, 0, 0.1] if x > 0.5 + * + * The code solves the 1D compressible Euler equations in conserved variables, + * over the domain (t,x) in [0, 0.2] x [0, 1]. + * + * Since the Sod shock tube is specified in terms of primitive variables, we + * convert between primitive and conserved variables for the initial conditions + * and accuracy results. + * + * This problem should be run with homogeneous Neumann boundary conditions. + * + * The system is advanced in time using one of the strong-stability-preserving + * Runge--Kutta methods from LSRKStep, based on the --integrator METHOD input + * value. The following options are available: + * + * SSPRK(s,2) -- specified via METHOD = ARKODE_LSRK_SSP_S_2. The number of + * stages to use defaults to 10. + * + * SSPRK(s,3) -- specified via METHOD = ARKODE_LSRK_SSP_S_3. The number of + * stages to use defaults to 9. + * + * SSPRK(10,4) -- specified via METHOD = ARKODE_LSRK_SSP_10_4. + * + * Both the SSPRK(s,2) and SSPRK(s,3) methods allow specification of a + * non-default number of stages. This may be specified using the --stages S + * input value, where S is an integer. Note: SSPRK(s,2) requires S at least + * 2, and SSPRK(s,3) requires S be a perfect square, with S at least 4. + * + * Alternately, if METHOD corresponds with a valid ARKODE_ERKTableID then + * the system will be advanced using that method in ERKStep. + * + * Several additional command line options are available to change the + * and integrator settings. Use the flag --help for more information. + * ---------------------------------------------------------------------------*/ + +#include "ark_sod_lsrk.hpp" +using namespace std; + +int main(int argc, char* argv[]) +{ + // SUNDIALS context object for this simulation + sundials::Context ctx; + + // ----------------- + // Setup the problem + // ----------------- + + EulerData udata; + ARKODEParameters uopts; + + vector<string> args(argv + 1, argv + argc); + + int flag = ReadInputs(args, udata, uopts, ctx); + if (check_flag(flag, "ReadInputs")) { return 1; } + if (flag > 0) { return 0; } + + flag = PrintSetup(udata, uopts); + if (check_flag(flag, "PrintSetup")) { return 1; } + + // Create state vector and set initial condition + N_Vector vecs[NSPECIES]; + for (int i = 0; i < NSPECIES; i++) + { + vecs[i] = N_VNew_Serial((sunindextype)udata.nx, ctx); // rho (density) + if (check_ptr(vecs[i], "N_VNew_Serial")) { return 1; } + } + N_Vector y = N_VNew_ManyVector(NSPECIES, vecs, ctx); + if (check_ptr(y, "N_VNew_ManyVector")) { return 1; } + + flag = SetIC(y, udata); + if (check_flag(flag, "SetIC")) { return 1; } + + // -------------------- + // Setup the integrator + // -------------------- + void* arkode_mem = nullptr; + + // Determine type (LSRKStep vs ERKStep) + bool lsrk = false; + if (uopts.integrator == "ARKODE_LSRK_SSP_S_2") { lsrk = true; } + if (uopts.integrator == "ARKODE_LSRK_SSP_S_3") { lsrk = true; } + if (uopts.integrator == "ARKODE_LSRK_SSP_10_4") { lsrk = true; } + + if (lsrk) // Setup LSRKStep + { + // ARKODE memory structure + arkode_mem = LSRKStepCreateSSP(frhs, udata.t0, y, ctx); + if (check_ptr(arkode_mem, "LSRKStepCreateSSP")) { return 1; } + + // Select SSPRK method type + flag = LSRKStepSetSSPMethodByName(arkode_mem, uopts.integrator.c_str()); + if (check_flag(flag, "LSRKStepSetSSPMethodByName")) { return 1; } + + // Select number of SSPRK stages + if (uopts.stages > 0) + { + flag = LSRKStepSetSSPStageNum(arkode_mem, uopts.stages); + if (check_flag(flag, "LSRKStepSetSSPStageNum")) { return 1; } + } + } + else + { // Setup ERKStep + + // ARKODE memory structure + arkode_mem = ERKStepCreate(frhs, udata.t0, y, ctx); + if (check_ptr(arkode_mem, "ERKStepCreate")) { return 1; } + + // Select ERK method + flag = ERKStepSetTableName(arkode_mem, uopts.integrator.c_str()); + if (check_flag(flag, "ERKStepSetTableName")) { return 1; } + } + + // Shared setup + + // Specify tolerances + flag = ARKodeSStolerances(arkode_mem, uopts.rtol, uopts.atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + // Attach user data + flag = ARKodeSetUserData(arkode_mem, &udata); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Set fixed step size or adaptivity method + if (uopts.fixed_h > ZERO) + { + flag = ARKodeSetFixedStep(arkode_mem, uopts.fixed_h); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + } + + // Set max steps between outputs + flag = ARKodeSetMaxNumSteps(arkode_mem, uopts.maxsteps); + if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } + + // Set stopping time + flag = ARKodeSetStopTime(arkode_mem, udata.tf); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + + // ---------------------- + // Evolve problem in time + // ---------------------- + + // Initial time, time between outputs, output time + sunrealtype t = ZERO; + sunrealtype dTout = udata.tf / uopts.nout; + sunrealtype tout = dTout; + + // initial output + flag = OpenOutput(udata, uopts); + if (check_flag(flag, "OpenOutput")) { return 1; } + + flag = WriteOutput(t, y, udata, uopts); + if (check_flag(flag, "WriteOutput")) { return 1; } + + // Loop over output times + for (int iout = 0; iout < uopts.nout; iout++) + { + // Evolve + if (uopts.output == 3) + { + // Stop at output time (do not interpolate output) + flag = ARKodeSetStopTime(arkode_mem, tout); + if (check_flag(flag, "ARKodeSetStopTime")) { return 1; } + } + + // Advance in time + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); + if (check_flag(flag, "ARKodeEvolve")) { break; } + + // Output solution + flag = WriteOutput(t, y, udata, uopts); + if (check_flag(flag, "WriteOutput")) { return 1; } + + // Update output time + tout += dTout; + tout = (tout > udata.tf) ? udata.tf : tout; + } + + // Close output + flag = CloseOutput(uopts); + if (check_flag(flag, "CloseOutput")) { return 1; } + + // ------------ + // Output stats + // ------------ + + if (uopts.output) + { + cout << "Final integrator statistics:" << endl; + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + } + + // -------- + // Clean up + // -------- + + ARKodeFree(&arkode_mem); + for (int i = 0; i < NSPECIES; i++) { N_VDestroy(vecs[i]); } + N_VDestroy(y); + + return 0; +} + +// ----------------------------------------------------------------------------- +// Functions called by the integrator +// ----------------------------------------------------------------------------- + +// ODE RHS function +int frhs(sunrealtype t, N_Vector y, N_Vector f, void* user_data) +{ + // Access problem data + EulerData* udata = (EulerData*)user_data; + + // initialize output to zeros + N_VConst(ZERO, f); + + // Access data arrays + sunrealtype* rho = N_VGetSubvectorArrayPointer_ManyVector(y, 0); + if (check_ptr(rho, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mx = N_VGetSubvectorArrayPointer_ManyVector(y, 1); + if (check_ptr(mx, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* my = N_VGetSubvectorArrayPointer_ManyVector(y, 2); + if (check_ptr(my, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mz = N_VGetSubvectorArrayPointer_ManyVector(y, 3); + if (check_ptr(mz, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* et = N_VGetSubvectorArrayPointer_ManyVector(y, 4); + if (check_ptr(et, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + + sunrealtype* rhodot = N_VGetSubvectorArrayPointer_ManyVector(f, 0); + if (check_ptr(rhodot, "N_VGetSubvectorArrayPointer_ManyVector")) + { + return -1; + } + sunrealtype* mxdot = N_VGetSubvectorArrayPointer_ManyVector(f, 1); + if (check_ptr(mxdot, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mydot = N_VGetSubvectorArrayPointer_ManyVector(f, 2); + if (check_ptr(mydot, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mzdot = N_VGetSubvectorArrayPointer_ManyVector(f, 3); + if (check_ptr(mzdot, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* etdot = N_VGetSubvectorArrayPointer_ManyVector(f, 4); + if (check_ptr(etdot, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + + // Set shortcut variables + const long int nx = udata->nx; + const sunrealtype dx = udata->dx; + sunrealtype* flux = udata->flux; + + // compute face-centered fluxes over domain interior: pack 1D x-directional array + // of variable shortcuts, and compute flux at lower x-directional face + for (long int i = 3; i < nx - 2; i++) + { + udata->pack1D(rho, mx, my, mz, et, i); + face_flux(udata->w1d, &(flux[i * NSPECIES]), *udata); + } + + // compute face-centered fluxes at left boundary + for (long int i = 0; i < 3; i++) + { + udata->pack1D_bdry(rho, mx, my, mz, et, i); + face_flux(udata->w1d, &(flux[i * NSPECIES]), *udata); + } + + // compute face-centered fluxes at right boundary + for (long int i = nx - 2; i <= nx; i++) + { + udata->pack1D_bdry(rho, mx, my, mz, et, i); + face_flux(udata->w1d, &(flux[i * NSPECIES]), *udata); + } + + // iterate over subdomain, updating RHS + for (long int i = 0; i < nx; i++) + { + rhodot[i] -= (flux[(i + 1) * NSPECIES + 0] - flux[i * NSPECIES + 0]) / dx; + mxdot[i] -= (flux[(i + 1) * NSPECIES + 1] - flux[i * NSPECIES + 1]) / dx; + mydot[i] -= (flux[(i + 1) * NSPECIES + 2] - flux[i * NSPECIES + 2]) / dx; + mzdot[i] -= (flux[(i + 1) * NSPECIES + 3] - flux[i * NSPECIES + 3]) / dx; + etdot[i] -= (flux[(i + 1) * NSPECIES + 4] - flux[i * NSPECIES + 4]) / dx; + } + + return 0; +} + +// given a 6-point stencil of solution values, +// w(x_{j-3}) w(x_{j-2}) w(x_{j-1}), w(x_j), w(x_{j+1}), w(x_{j+2}), +// compute the face-centered flux (flux) at the center of the stencil, x_{j-1/2}. +// +// This precisely follows the recipe laid out in: +// Chi-Wang Shu (2003) "High-order Finite Difference and Finite Volume WENO +// Schemes and Discontinuous Galerkin Methods for CFD," International Journal of +// Computational Fluid Dynamics, 17:2, 107-118, DOI: 10.1080/1061856031000104851 +// with the only change that since this is 1D, we manually set the y- and +// z-velocities, v and w, to zero. +void face_flux(sunrealtype (&w1d)[STSIZE][NSPECIES], sunrealtype* f_face, + const EulerData& udata) +{ + // local data + int i, j; + sunrealtype rhosqrL, rhosqrR, rhosqrbar, u, v, w, H, qsq, csnd, cinv, gamm, + alpha, beta1, beta2, beta3, w1, w2, w3, f1, f2, f3; + sunrealtype RV[5][5], LV[5][5], p[STSIZE], flux[STSIZE][NSPECIES], + fproj[5][NSPECIES], fs[5][NSPECIES], ff[NSPECIES]; + const sunrealtype bc = + SUN_RCONST(1.083333333333333333333333333333333333333); // 13/12 + const sunrealtype epsilon = SUN_RCONST(1.0e-6); + + // compute pressures over stencil + for (i = 0; i < STSIZE; i++) + { + p[i] = udata.eos(w1d[i][0], w1d[i][1], w1d[i][2], w1d[i][3], w1d[i][4]); + } + + // compute Roe-average state at face: + // wbar = [sqrt(rho), sqrt(rho)*vx, sqrt(rho)*vy, sqrt(rho)*vz, (e+p)/sqrt(rho)] + // [sqrt(rho), mx/sqrt(rho), my/sqrt(rho), mz/sqrt(rho), (e+p)/sqrt(rho)] + // u = wbar_2 / wbar_1 + // v = wbar_3 / wbar_1 + // w = wbar_4 / wbar_1 + // H = wbar_5 / wbar_1 + rhosqrL = sqrt(w1d[2][0]); + rhosqrR = sqrt(w1d[3][0]); + rhosqrbar = HALF * (rhosqrL + rhosqrR); + u = HALF * (w1d[2][1] / rhosqrL + w1d[3][1] / rhosqrR) / rhosqrbar; + v = HALF * (w1d[2][2] / rhosqrL + w1d[3][2] / rhosqrR) / rhosqrbar; + w = HALF * (w1d[2][3] / rhosqrL + w1d[3][3] / rhosqrR) / rhosqrbar; + H = HALF * ((p[2] + w1d[2][4]) / rhosqrL + (p[3] + w1d[3][4]) / rhosqrR) / + rhosqrbar; + + // compute eigenvectors at face (note: eigenvectors for tracers are just identity) + qsq = u * u + v * v + w * w; + gamm = udata.gamma - ONE; + csnd = gamm * (H - HALF * qsq); + cinv = ONE / csnd; + for (i = 0; i < 5; i++) + { + for (j = 0; j < 5; j++) + { + RV[i][j] = ZERO; + LV[i][j] = ZERO; + } + } + + RV[0][0] = ONE; + RV[0][3] = ONE; + RV[0][4] = ONE; + + RV[1][0] = u - csnd; + RV[1][3] = u; + RV[1][4] = u + csnd; + + RV[2][0] = v; + RV[2][1] = ONE; + RV[2][3] = v; + RV[2][4] = v; + + RV[3][0] = w; + RV[3][2] = ONE; + RV[3][3] = w; + RV[3][4] = w; + + RV[4][0] = H - u * csnd; + RV[4][1] = v; + RV[4][2] = w; + RV[4][3] = HALF * qsq; + RV[4][4] = H + u * csnd; + + LV[0][0] = HALF * cinv * (u + HALF * gamm * qsq); + LV[0][1] = -HALF * cinv * (gamm * u + ONE); + LV[0][2] = -HALF * v * gamm * cinv; + LV[0][3] = -HALF * w * gamm * cinv; + LV[0][4] = HALF * gamm * cinv; + + LV[1][0] = -v; + LV[1][2] = ONE; + + LV[2][0] = -w; + LV[2][3] = ONE; + + LV[3][0] = -gamm * cinv * (qsq - H); + LV[3][1] = u * gamm * cinv; + LV[3][2] = v * gamm * cinv; + LV[3][3] = w * gamm * cinv; + LV[3][4] = -gamm * cinv; + + LV[4][0] = -HALF * cinv * (u - HALF * gamm * qsq); + LV[4][1] = -HALF * cinv * (gamm * u - ONE); + LV[4][2] = -HALF * v * gamm * cinv; + LV[4][3] = -HALF * w * gamm * cinv; + LV[4][4] = HALF * gamm * cinv; + + // compute fluxes and max wave speed over stencil + alpha = ZERO; + for (j = 0; j < STSIZE; j++) + { + u = w1d[j][1] / w1d[j][0]; // u = vx = mx/rho + flux[j][0] = w1d[j][1]; // f_rho = rho*u = mx + flux[j][1] = u * w1d[j][1] + p[j]; // f_mx = rho*u*u + p = mx*u + p + flux[j][2] = u * w1d[j][2]; // f_my = rho*v*u = my*u + flux[j][3] = u * w1d[j][3]; // f_mz = rho*w*u = mz*u + flux[j][4] = u * (w1d[j][4] + p[j]); // f_et = u*(et + p) + csnd = sqrt(udata.gamma * p[j] / w1d[j][0]); // csnd = sqrt(gamma*p/rho) + alpha = max(alpha, abs(u) + csnd); + } + + // compute flux from right side of face at x_{i+1/2}: + + // compute right-shifted Lax-Friedrichs flux over left portion of patch + for (j = 0; j < 5; j++) + { + for (i = 0; i < NSPECIES; i++) + { + fs[j][i] = HALF * (flux[j][i] + alpha * w1d[j][i]); + } + } + + // compute projected flux for fluid fields + for (j = 0; j < 5; j++) + { + for (i = 0; i < 5; i++) + { + fproj[j][i] = LV[i][0] * fs[j][0] + LV[i][1] * fs[j][1] + + LV[i][2] * fs[j][2] + LV[i][3] * fs[j][3] + + LV[i][4] * fs[j][4]; + } + } + + // compute WENO signed flux + for (i = 0; i < NSPECIES; i++) + { + // smoothness indicators + beta1 = bc * pow(fproj[2][i] - SUN_RCONST(2.0) * fproj[3][i] + fproj[4][i], + 2) + + FOURTH * pow(SUN_RCONST(3.0) * fproj[2][i] - + SUN_RCONST(4.0) * fproj[3][i] + fproj[4][i], + 2); + beta2 = bc * pow(fproj[1][i] - SUN_RCONST(2.0) * fproj[2][i] + fproj[3][i], + 2) + + FOURTH * pow(fproj[1][i] - fproj[3][i], 2); + beta3 = bc * pow(fproj[0][i] - SUN_RCONST(2.0) * fproj[1][i] + fproj[2][i], + 2) + + FOURTH * pow(fproj[0][i] - SUN_RCONST(4.0) * fproj[1][i] + + SUN_RCONST(3.0) * fproj[2][i], + 2); + // nonlinear weights + w1 = SUN_RCONST(0.3) / ((epsilon + beta1) * (epsilon + beta1)); + w2 = SUN_RCONST(0.6) / ((epsilon + beta2) * (epsilon + beta2)); + w3 = SUN_RCONST(0.1) / ((epsilon + beta3) * (epsilon + beta3)); + // flux stencils + f1 = SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[2][i] + + SUN_RCONST(0.8333333333333333333333333333333333333333) * fproj[3][i] - + SUN_RCONST(0.1666666666666666666666666666666666666667) * fproj[4][i]; + f2 = -SUN_RCONST(0.1666666666666666666666666666666666666667) * fproj[1][i] + + SUN_RCONST(0.8333333333333333333333333333333333333333) * fproj[2][i] + + SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[3][i]; + f3 = SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[0][i] - + SUN_RCONST(1.166666666666666666666666666666666666667) * fproj[1][i] + + SUN_RCONST(1.833333333333333333333333333333333333333) * fproj[2][i]; + // resulting signed flux at face + ff[i] = (f1 * w1 + f2 * w2 + f3 * w3) / (w1 + w2 + w3); + } + + // compute flux from left side of face at x_{i+1/2}: + + // compute left-shifted Lax-Friedrichs flux over right portion of patch + for (j = 0; j < 5; j++) + { + for (i = 0; i < NSPECIES; i++) + { + fs[j][i] = HALF * (flux[j + 1][i] - alpha * w1d[j + 1][i]); + } + } + + // compute projected flux for fluid fields + for (j = 0; j < 5; j++) + { + for (i = 0; i < 5; i++) + { + fproj[j][i] = LV[i][0] * fs[j][0] + LV[i][1] * fs[j][1] + + LV[i][2] * fs[j][2] + LV[i][3] * fs[j][3] + + LV[i][4] * fs[j][4]; + } + } + + // compute WENO signed fluxes + for (i = 0; i < NSPECIES; i++) + { + // smoothness indicators + beta1 = bc * pow(fproj[2][i] - SUN_RCONST(2.0) * fproj[3][i] + fproj[4][i], + 2) + + FOURTH * pow(SUN_RCONST(3.0) * fproj[2][i] - + SUN_RCONST(4.0) * fproj[3][i] + fproj[4][i], + 2); + beta2 = bc * pow(fproj[1][i] - SUN_RCONST(2.0) * fproj[2][i] + fproj[3][i], + 2) + + FOURTH * pow(fproj[1][i] - fproj[3][i], 2); + beta3 = bc * pow(fproj[0][i] - SUN_RCONST(2.0) * fproj[1][i] + fproj[2][i], + 2) + + FOURTH * pow(fproj[0][i] - SUN_RCONST(4.0) * fproj[1][i] + + SUN_RCONST(3.0) * fproj[2][i], + 2); + // nonlinear weights + w1 = SUN_RCONST(0.1) / ((epsilon + beta1) * (epsilon + beta1)); + w2 = SUN_RCONST(0.6) / ((epsilon + beta2) * (epsilon + beta2)); + w3 = SUN_RCONST(0.3) / ((epsilon + beta3) * (epsilon + beta3)); + // flux stencils + f1 = SUN_RCONST(1.833333333333333333333333333333333333333) * fproj[2][i] - + SUN_RCONST(1.166666666666666666666666666666666666667) * fproj[3][i] + + SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[4][i]; + f2 = SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[1][i] + + SUN_RCONST(0.8333333333333333333333333333333333333333) * fproj[2][i] - + SUN_RCONST(0.1666666666666666666666666666666666666667) * fproj[3][i]; + f3 = -SUN_RCONST(0.1666666666666666666666666666666666666667) * fproj[0][i] + + SUN_RCONST(0.8333333333333333333333333333333333333333) * fproj[1][i] + + SUN_RCONST(0.3333333333333333333333333333333333333333) * fproj[2][i]; + // resulting signed flux (add to ff) + ff[i] += (f1 * w1 + f2 * w2 + f3 * w3) / (w1 + w2 + w3); + } + + // combine signed fluxes into output, converting back to conserved variables + for (i = 0; i < NSPECIES; i++) + { + f_face[i] = RV[i][0] * ff[0] + RV[i][1] * ff[1] + RV[i][2] * ff[2] + + RV[i][3] * ff[3] + RV[i][4] * ff[4]; + } + return; +} + +// Compute the initial condition +int SetIC(N_Vector y, EulerData& udata) +{ + sunrealtype* rho = N_VGetSubvectorArrayPointer_ManyVector(y, 0); + if (check_ptr(rho, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mx = N_VGetSubvectorArrayPointer_ManyVector(y, 1); + if (check_ptr(mx, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* my = N_VGetSubvectorArrayPointer_ManyVector(y, 2); + if (check_ptr(my, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* mz = N_VGetSubvectorArrayPointer_ManyVector(y, 3); + if (check_ptr(mz, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + sunrealtype* et = N_VGetSubvectorArrayPointer_ManyVector(y, 4); + if (check_ptr(et, "N_VGetSubvectorArrayPointer_ManyVector")) { return -1; } + + for (long int i = 0; i < udata.nx; i++) + { + sunrealtype xloc = ((sunrealtype)i + HALF) * udata.dx + udata.xl; + if (xloc < HALF) + { + rho[i] = rhoL; + et[i] = udata.eos_inv(rhoL, uL, ZERO, ZERO, pL); + mx[i] = rhoL * uL; + } + else + { + rho[i] = rhoR; + et[i] = udata.eos_inv(rhoR, uR, ZERO, ZERO, pR); + mx[i] = rhoR * uR; + } + my[i] = ZERO; + mz[i] = ZERO; + } + + return 0; +} + +//---- end of file ---- diff --git a/examples/arkode/CXX_manyvector/ark_sod_lsrk.hpp b/examples/arkode/CXX_manyvector/ark_sod_lsrk.hpp new file mode 100644 index 0000000000..0ccd7959df --- /dev/null +++ b/examples/arkode/CXX_manyvector/ark_sod_lsrk.hpp @@ -0,0 +1,538 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Header file for ARKODE LSRKStep Sod shock tube example, see + * ark_sod_lsrk.cpp for more details. + * ---------------------------------------------------------------------------*/ + +#include <algorithm> +#include <cmath> +#include <cstdio> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <limits> +#include <sstream> +#include <string> +#include <vector> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode_erkstep.h" +#include "arkode/arkode_lsrkstep.h" +#include "nvector/nvector_manyvector.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_core.hpp" + +// Macros for problem constants +#define rhoL SUN_RCONST(1.0) +#define rhoR SUN_RCONST(0.125) +#define pL SUN_RCONST(1.0) +#define pR SUN_RCONST(0.1) +#define uL SUN_RCONST(0.0) +#define uR SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define FOURTH SUN_RCONST(0.25) + +#define NSPECIES 5 +#define STSIZE 6 + +#define WIDTH (10 + std::numeric_limits<sunrealtype>::digits10) + +// ----------------------------------------------------------------------------- +// Problem options +// ----------------------------------------------------------------------------- + +class ARKODEParameters +{ +public: + // Integration method (ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4, + // or any valid ARKODE_ERKTableID for ERK methods) + std::string integrator; + + // Method stages (0 => to use the default; ignored if using ARKODE_LSRK_SSP_10_4 or + // an ERK method) + int stages; + + // Relative and absolute tolerances + sunrealtype rtol; + sunrealtype atol; + + // Step size selection (ZERO = adaptive steps) + sunrealtype fixed_h; + + // Maximum number of time steps between outputs + int maxsteps; + + // Output-related information + int output; // 0 = none, 1 = stats, 2 = disk, 3 = disk with tstop + int nout; // number of output times + std::ofstream uout; // output file stream + + // constructor (with default values) + ARKODEParameters() + : integrator("ARKODE_LSRK_SSP_10_4"), + stages(0), + rtol(SUN_RCONST(1.e-4)), + atol(SUN_RCONST(1.e-11)), + fixed_h(ZERO), + maxsteps(10000), + output(1), + nout(10){}; + +}; // end ARKODEParameters + +// ----------------------------------------------------------------------------- +// Problem parameters +// ----------------------------------------------------------------------------- + +// user data class +class EulerData +{ +public: + ///// domain related data ///// + long int nx; // global number of x grid points + sunrealtype t0; // time domain extents + sunrealtype tf; + sunrealtype xl; // spatial domain extents + sunrealtype xr; + sunrealtype dx; // spatial mesh spacing + + ///// problem-defining data ///// + sunrealtype gamma; // ratio of specific heat capacities, cp/cv + + ///// reusable arrays for WENO flux calculations ///// + sunrealtype* flux; + sunrealtype w1d[STSIZE][NSPECIES]; + + ///// class operations ///// + + // constructor + EulerData() + : nx(512), + t0(ZERO), + tf(SUN_RCONST(0.1)), + xl(ZERO), + xr(ONE), + dx(ZERO), + gamma(SUN_RCONST(1.4)), + flux(nullptr){}; + + // manual destructor + void FreeData() + { + delete[] flux; + flux = nullptr; + }; + + // destructor + ~EulerData() { this->FreeData(); }; + + // Utility routine to pack 1-dimensional data for *interior only* data; + // e.g., in the x-direction given a location (i), we return values at + // the 6 nodal values closest to the (i-1/2) face along the x-direction, + // {w(i-3), w(i-2), w(i-1), w(i), w(i+1), w(i+2)}. + inline void pack1D(const sunrealtype* rho, const sunrealtype* mx, + const sunrealtype* my, const sunrealtype* mz, + const sunrealtype* et, const long int& i) + { + for (int l = 0; l < STSIZE; l++) { this->w1d[l][0] = rho[i - 3 + l]; } + for (int l = 0; l < STSIZE; l++) { this->w1d[l][1] = mx[i - 3 + l]; } + for (int l = 0; l < STSIZE; l++) { this->w1d[l][2] = my[i - 3 + l]; } + for (int l = 0; l < STSIZE; l++) { this->w1d[l][3] = mz[i - 3 + l]; } + for (int l = 0; l < STSIZE; l++) { this->w1d[l][4] = et[i - 3 + l]; } + } + + // Utility routine to pack 1-dimensional data for locations near the + // boundary; like the routine above this packs the 6 closest + // entries aligned with, e.g., the (i-1/2) face, but now some entries + // are set to satisfy homogeneous Neumann boundary conditions. + inline void pack1D_bdry(const sunrealtype* rho, const sunrealtype* mx, + const sunrealtype* my, const sunrealtype* mz, + const sunrealtype* et, const long int& i) + { + for (int l = 0; l < 3; l++) + { + this->w1d[l][0] = (i < (3 - l)) ? rho[2 - (i + l)] : rho[i - 3 + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l][1] = (i < (3 - l)) ? mx[2 - (i + l)] : mx[i - 3 + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l][2] = (i < (3 - l)) ? my[2 - (i + l)] : my[i - 3 + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l][3] = (i < (3 - l)) ? mz[2 - (i + l)] : mz[i - 3 + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l][4] = (i < (3 - l)) ? et[2 - (i + l)] : et[i - 3 + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l + 3][0] = (i > (nx - l - 1)) ? rho[i + l - 3] : rho[i + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l + 3][1] = (i > (nx - l - 1)) ? mx[i + l - 3] : mx[i + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l + 3][2] = (i > (nx - l - 1)) ? my[i + l - 3] : my[i + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l + 3][3] = (i > (nx - l - 1)) ? mz[i + l - 3] : mz[i + l]; + } + for (int l = 0; l < 3; l++) + { + this->w1d[l + 3][4] = (i > (nx - l - 1)) ? et[i + l - 3] : et[i + l]; + } + } + + // Equation of state -- compute and return pressure, + // p = (gamma-1)*(e - rho/2*(vx^2+vy^2+vz^2)), or equivalently + // p = (gamma-1)*(e - (mx^2+my^2+mz^2)/(2*rho)) + inline sunrealtype eos(const sunrealtype& rho, const sunrealtype& mx, + const sunrealtype& my, const sunrealtype& mz, + const sunrealtype& et) const + { + return ((gamma - ONE) * (et - (mx * mx + my * my + mz * mz) * HALF / rho)); + } + + // Equation of state inverse -- compute and return energy, + // e_t = p/(gamma-1) + rho/2*(vx^2+vy^2+vz^2), or equivalently + // e_t = p/(gamma-1) + (mx^2+my^2+mz^2)/(2*rho) + inline sunrealtype eos_inv(const sunrealtype& rho, const sunrealtype& mx, + const sunrealtype& my, const sunrealtype& mz, + const sunrealtype& pr) const + { + return (pr / (gamma - ONE) + (mx * mx + my * my + mz * mz) * HALF / rho); + } + +}; // end EulerData; + +// ----------------------------------------------------------------------------- +// Functions provided to the SUNDIALS integrators +// ----------------------------------------------------------------------------- + +// ODE right hand side (RHS) functions +int frhs(sunrealtype t, N_Vector y, N_Vector f, void* user_data); + +// ----------------------------------------------------------------------------- +// Helper functions +// ----------------------------------------------------------------------------- + +// WENO flux calculation helper function +void face_flux(sunrealtype (&w1d)[6][NSPECIES], sunrealtype* f_face, + const EulerData& udata); + +// Compute the initial condition +int SetIC(N_Vector y, EulerData& udata); + +// ----------------------------------------------------------------------------- +// Output and utility functions +// ----------------------------------------------------------------------------- + +// Check function return flag +static int check_flag(int flag, const std::string funcname) +{ + if (flag < 0) + { + std::cerr << "ERROR: " << funcname << " returned " << flag << std::endl; + return 1; + } + return 0; +} + +// Check if a function returned a NULL pointer +static int check_ptr(void* ptr, const std::string funcname) +{ + if (ptr) { return 0; } + std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; + return 1; +} + +// Print command line options +static void InputHelp() +{ + std::cout << std::endl; + std::cout << "Command line options:" << std::endl; + std::cout << " --integrator <str> : method (ARKODE_LSRK_SSP_S_2, " + "ARKODE_LSRK_SSP_S_3, " + "ARKODE_LSRK_SSP_10_4, or any valid ARKODE_ERKTableID)\n"; + std::cout << " --stages <int> : number of stages (ignored for " + "ARKODE_LSRK_SSP_10_4 and ERK)\n"; + std::cout << " --tf <real> : final time\n"; + std::cout << " --xl <real> : domain lower boundary\n"; + std::cout << " --xr <real> : domain upper boundary\n"; + std::cout << " --gamma <real> : ideal gas constant\n"; + std::cout << " --nx <int> : number of mesh points\n"; + std::cout << " --rtol <real> : relative tolerance\n"; + std::cout << " --atol <real> : absolute tolerance\n"; + std::cout << " --fixed_h <real> : fixed step size\n"; + std::cout << " --maxsteps <int> : max steps between outputs\n"; + std::cout << " --output <int> : output level\n"; + std::cout << " --nout <int> : number of outputs\n"; + std::cout << " --help : print options and exit\n"; +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + sunrealtype& dest) +{ + auto it = find(args.begin(), args.end(), key); + if (it != args.end()) + { +#if defined(SUNDIALS_SINGLE_PRECISION) + dest = stof(*(it + 1)); +#elif defined(SUNDIALS_DOUBLE_PRECISION) + dest = stod(*(it + 1)); +#elif defined(SUNDIALS_EXTENDED_PRECISION) + dest = stold(*(it + 1)); +#endif + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + long int& dest) +{ + auto it = find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = stoll(*(it + 1)); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + int& dest) +{ + auto it = find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = stoi(*(it + 1)); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + std::string& dest) +{ + auto it = find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = *(it + 1); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + bool& dest, bool store = true) +{ + auto it = find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = store; + args.erase(it); + } +} + +static int ReadInputs(std::vector<std::string>& args, EulerData& udata, + ARKODEParameters& uopts, SUNContext ctx) +{ + if (find(args.begin(), args.end(), "--help") != args.end()) + { + InputHelp(); + return 1; + } + + // Problem parameters + find_arg(args, "--gamma", udata.gamma); + find_arg(args, "--tf", udata.tf); + find_arg(args, "--xl", udata.xl); + find_arg(args, "--xr", udata.xr); + find_arg(args, "--nx", udata.nx); + + // Integrator options + find_arg(args, "--integrator", uopts.integrator); + find_arg(args, "--stages", uopts.stages); + find_arg(args, "--rtol", uopts.rtol); + find_arg(args, "--atol", uopts.atol); + find_arg(args, "--fixed_h", uopts.fixed_h); + find_arg(args, "--maxsteps", uopts.maxsteps); + find_arg(args, "--output", uopts.output); + find_arg(args, "--nout", uopts.nout); + + // Recompute mesh spacing and [re]allocate flux array + udata.dx = (udata.xr - udata.xl) / ((sunrealtype)udata.nx); + if (udata.flux) { delete[] udata.flux; } + udata.flux = new sunrealtype[NSPECIES * (udata.nx + 1)]; + + if (uopts.stages < 0) + { + std::cerr << "ERROR: Invalid number of stages" << std::endl; + return -1; + } + + return 0; +} + +// Print user data +static int PrintSetup(EulerData& udata, ARKODEParameters& uopts) +{ + std::cout << std::endl; + std::cout << "Problem parameters and options:" << std::endl; + std::cout << " --------------------------------- " << std::endl; + std::cout << " gamma = " << udata.gamma << std::endl; + std::cout << " --------------------------------- " << std::endl; + std::cout << " tf = " << udata.tf << std::endl; + std::cout << " xl = " << udata.xl << std::endl; + std::cout << " xr = " << udata.xr << std::endl; + std::cout << " nx = " << udata.nx << std::endl; + std::cout << " dx = " << udata.dx << std::endl; + std::cout << " --------------------------------- " << std::endl; + std::cout << " integrator = " << uopts.integrator << std::endl; + if (uopts.stages > 0) + { + std::cout << " stages = " << uopts.stages << std::endl; + } + std::cout << " rtol = " << uopts.rtol << std::endl; + std::cout << " atol = " << uopts.atol << std::endl; + std::cout << " fixed h = " << uopts.fixed_h << std::endl; + std::cout << " --------------------------------- " << std::endl; + std::cout << " output = " << uopts.output << std::endl; + std::cout << " --------------------------------- " << std::endl; + std::cout << std::endl; + + return 0; +} + +// Initialize output +static int OpenOutput(EulerData& udata, ARKODEParameters& uopts) +{ + // Header for status output + if (uopts.output) + { + std::cout << std::scientific; + std::cout << std::setprecision(std::numeric_limits<sunrealtype>::digits10); + std::cout << " t " + << " ||rho|| " + << " ||mx|| " + << " ||my|| " + << " ||mz|| " + << " ||et||" << std::endl; + std::cout + << " -----------------------------------------------------------------" + "---------" + << std::endl; + } + + // Open output stream and output problem information + if (uopts.output >= 2) + { + // Open output stream + std::stringstream fname; + fname << "sod.out"; + uopts.uout.open(fname.str()); + + uopts.uout << std::scientific; + uopts.uout << std::setprecision(std::numeric_limits<sunrealtype>::digits10); + uopts.uout << "# title Sod Shock Tube" << std::endl; + uopts.uout << "# nvar 5" << std::endl; + uopts.uout << "# vars rho mx my mz et" << std::endl; + uopts.uout << "# nt " << uopts.nout + 1 << std::endl; + uopts.uout << "# nx " << udata.nx << std::endl; + uopts.uout << "# xl " << udata.xl << std::endl; + uopts.uout << "# xr " << udata.xr << std::endl; + } + + return 0; +} + +// Write output +static int WriteOutput(sunrealtype t, N_Vector y, EulerData& udata, + ARKODEParameters& uopts) +{ + if (uopts.output) + { + // Compute rms norm of the state + N_Vector rho = N_VGetSubvector_ManyVector(y, 0); + N_Vector mx = N_VGetSubvector_ManyVector(y, 1); + N_Vector my = N_VGetSubvector_ManyVector(y, 2); + N_Vector mz = N_VGetSubvector_ManyVector(y, 3); + N_Vector et = N_VGetSubvector_ManyVector(y, 4); + sunrealtype rhorms = sqrt(N_VDotProd(rho, rho) / (sunrealtype)udata.nx); + sunrealtype mxrms = sqrt(N_VDotProd(mx, mx) / (sunrealtype)udata.nx); + sunrealtype myrms = sqrt(N_VDotProd(my, my) / (sunrealtype)udata.nx); + sunrealtype mzrms = sqrt(N_VDotProd(mz, mz) / (sunrealtype)udata.nx); + sunrealtype etrms = sqrt(N_VDotProd(et, et) / (sunrealtype)udata.nx); + std::cout << std::setprecision(2) << " " << t << std::setprecision(5) + << " " << rhorms << " " << mxrms << " " << myrms << " " + << mzrms << " " << etrms << std::endl; + + // Write solution to disk + if (uopts.output >= 2) + { + sunrealtype* rhodata = N_VGetArrayPointer(rho); + if (check_ptr(rhodata, "N_VGetArrayPointer")) { return -1; } + sunrealtype* mxdata = N_VGetArrayPointer(mx); + if (check_ptr(mxdata, "N_VGetArrayPointer")) { return -1; } + sunrealtype* mydata = N_VGetArrayPointer(my); + if (check_ptr(mydata, "N_VGetArrayPointer")) { return -1; } + sunrealtype* mzdata = N_VGetArrayPointer(mz); + if (check_ptr(mzdata, "N_VGetArrayPointer")) { return -1; } + sunrealtype* etdata = N_VGetArrayPointer(et); + if (check_ptr(etdata, "N_VGetArrayPointer")) { return -1; } + + uopts.uout << t; + for (sunindextype i = 0; i < udata.nx; i++) + { + uopts.uout << std::setw(WIDTH) << rhodata[i]; + uopts.uout << std::setw(WIDTH) << mxdata[i]; + uopts.uout << std::setw(WIDTH) << mydata[i]; + uopts.uout << std::setw(WIDTH) << mzdata[i]; + uopts.uout << std::setw(WIDTH) << etdata[i]; + } + uopts.uout << std::endl; + } + } + + return 0; +} + +// Finalize output +static int CloseOutput(ARKODEParameters& uopts) +{ + // Footer for status output + if (uopts.output) + { + std::cout + << " -----------------------------------------------------------------" + "---------" + << std::endl; + std::cout << std::endl; + } + + // Close output streams + if (uopts.output >= 2) { uopts.uout.close(); } + + return 0; +} + +//---- end of file ---- diff --git a/examples/arkode/CXX_manyvector/ark_sod_lsrk.out b/examples/arkode/CXX_manyvector/ark_sod_lsrk.out new file mode 100644 index 0000000000..24abdf255d --- /dev/null +++ b/examples/arkode/CXX_manyvector/ark_sod_lsrk.out @@ -0,0 +1,48 @@ + +Problem parameters and options: + --------------------------------- + gamma = 1.4 + --------------------------------- + tf = 0.1 + xl = 0 + xr = 1 + nx = 512 + dx = 0.00195312 + --------------------------------- + integrator = ARKODE_LSRK_SSP_10_4 + rtol = 0.0001 + atol = 1e-11 + fixed h = 0 + --------------------------------- + output = 1 + --------------------------------- + + t ||rho|| ||mx|| ||my|| ||mz|| ||et|| + -------------------------------------------------------------------------- + 0.00e+00 7.12610e-01 0.00000e+00 0.00000e+00 0.00000e+00 1.77658e+00 + 1.00e-02 7.09460e-01 5.28096e-02 0.00000e+00 0.00000e+00 1.76732e+00 + 2.00e-02 7.06459e-01 7.61804e-02 0.00000e+00 0.00000e+00 1.75863e+00 + 3.00e-02 7.03444e-01 9.39395e-02 0.00000e+00 0.00000e+00 1.74990e+00 + 4.00e-02 7.00418e-01 1.08850e-01 0.00000e+00 0.00000e+00 1.74113e+00 + 5.00e-02 6.97379e-01 1.21955e-01 0.00000e+00 0.00000e+00 1.73232e+00 + 6.00e-02 6.94326e-01 1.33784e-01 0.00000e+00 0.00000e+00 1.72346e+00 + 7.00e-02 6.91261e-01 1.44650e-01 0.00000e+00 0.00000e+00 1.71456e+00 + 8.00e-02 6.88182e-01 1.54756e-01 0.00000e+00 0.00000e+00 1.70561e+00 + 9.00e-02 6.85089e-01 1.64242e-01 0.00000e+00 0.00000e+00 1.69661e+00 + 1.00e-01 6.81982e-01 1.73210e-01 0.00000e+00 0.00000e+00 1.68756e+00 + -------------------------------------------------------------------------- + +Final integrator statistics: +Current time = 0.1 +Steps = 382 +Step attempts = 397 +Stability limited steps = 0 +Accuracy limited steps = 397 +Error test fails = 15 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 1.122284259749542e-14 +Last step size = 0.0002334416078592081 +Current step size = 0.0002334416078592081 +RHS fn evals = 3957 +Number of stages used = 10 diff --git a/examples/arkode/CXX_manyvector/plot_sod.py b/examples/arkode/CXX_manyvector/plot_sod.py new file mode 100755 index 0000000000..2e87566718 --- /dev/null +++ b/examples/arkode/CXX_manyvector/plot_sod.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python3 +# ------------------------------------------------------------------------------ +# Programmer(s): Daniel R. Reynolds @ SMU +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ +# matplotlib-based plotting script for the serial ark_sod_lsrk example +# ------------------------------------------------------------------------------ + +# imports +import sys, os +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.gridspec import GridSpec + +# data file name +datafile = "sod.out" + +# return with an error if the file does not exist +if not os.path.isfile(datafile): + msg = "Error: file " + datafile + " does not exist" + sys.exit(msg) + +# read solution file, storing each line as a string in a list +with open(datafile, "r") as file: + lines = file.readlines() + + # extract header information + title = lines.pop(0) + nvar = int((lines.pop(0).split())[2]) + varnames = lines.pop(0) + nt = int((lines.pop(0).split())[2]) + nx = int((lines.pop(0).split())[2]) + xl = float((lines.pop(0).split())[2]) + xr = float((lines.pop(0).split())[2]) + + # allocate solution data as 2D Python arrays + t = np.zeros((nt), dtype=float) + rho = np.zeros((nt, nx), dtype=float) + mx = np.zeros((nt, nx), dtype=float) + my = np.zeros((nt, nx), dtype=float) + mz = np.zeros((nt, nx), dtype=float) + et = np.zeros((nt, nx), dtype=float) + x = np.linspace(xl, xr, nx) + + # store remaining data into numpy arrays + for it in range(nt): + line = (lines.pop(0)).split() + t[it] = line.pop(0) + for ix in range(nx): + rho[it, ix] = line.pop(0) + mx[it, ix] = line.pop(0) + my[it, ix] = line.pop(0) + mz[it, ix] = line.pop(0) + et[it, ix] = line.pop(0) + + gamma = 1.4 + u = mx / rho + p = (gamma - 1.0) * (et - (mx * mx + my * my + mz * mz) / (2.0 * rho)) + + +# utility routines for computing the analytical solution +def fsecant(p4, p1, p5, rho1, rho5, gamma): + """ + Utility routine for exact_Riemann function below + """ + z = p4 / p5 - 1.0 + c1 = np.sqrt(gamma * p1 / rho1) + c5 = np.sqrt(gamma * p5 / rho5) + gm1 = gamma - 1.0 + gp1 = gamma + 1.0 + g2 = 2.0 * gamma + fact = gm1 / g2 * (c5 / c1) * z / np.sqrt(1.0 + gp1 / g2 * z) + fact = (1.0 - fact) ** (g2 / gm1) + return p1 * fact - p4 + + +def exact_Riemann(t, x, xI): + """ + Exact 1D Riemann problem solver (retrieves domain from EulerData structure), + based on Fortran code at http://cococubed.asu.edu/codes/riemann/exact_riemann.f + + Inputs: (t,x) location for desired solution, + xI location of discontinuity at t=0, + gamma parameter for gas equation of state + Outputs: rho, u, p (density, velocity, and pressure at (t,x)) + """ + + # begin solution + rho1 = 1.0 + p1 = 1.0 + u1 = 0.0 + rho5 = 0.125 + p5 = 0.1 + u5 = 0.0 + + # solve for post-shock pressure by secant method initial guesses + p40 = p1 + p41 = p5 + f0 = fsecant(p40, p1, p5, rho1, rho5, gamma) + itmax = 50 + eps = 1.0e-14 + for iter in range(itmax): + f1 = fsecant(p41, p1, p5, rho1, rho5, gamma) + if f1 == f0: + break + p4 = p41 - (p41 - p40) * f1 / (f1 - f0) + if (np.abs(p4 - p41) / np.abs(p41)) < eps: + break + p40 = p41 + p41 = p4 + f0 = f1 + if iter == itmax - 1: + raise ValueError("exact_Riemann iteration failed to converge") + + # compute post-shock density and velocity + z = p4 / p5 - 1.0 + c5 = np.sqrt(gamma * p5 / rho5) + + gm1 = gamma - 1.0 + gp1 = gamma + 1.0 + + fact = np.sqrt(1.0 + 0.5 * gp1 * z / gamma) + + u4 = c5 * z / (gamma * fact) + rho4 = rho5 * (1.0 + 0.5 * gp1 * z / gamma) / (1.0 + 0.5 * gm1 * z / gamma) + + # shock speed + w = c5 * fact + + # compute values at foot of rarefaction + p3 = p4 + u3 = u4 + rho3 = rho1 * (p3 / p1) ** (1.0 / gamma) + + # compute positions of waves + c1 = np.sqrt(gamma * p1 / rho1) + c3 = np.sqrt(gamma * p3 / rho3) + + xsh = xI + w * t + xcd = xI + u3 * t + xft = xI + (u3 - c3) * t + xhd = xI - c1 * t + + # compute solution as a function of position + if x < xhd: + rho = rho1 + p = p1 + u = u1 + elif x < xft: + u = 2.0 / gp1 * (c1 + (x - xI) / t) + fact = 1.0 - 0.5 * gm1 * u / c1 + rho = rho1 * fact ** (2.0 / gm1) + p = p1 * fact ** (2.0 * gamma / gm1) + elif x < xcd: + rho = rho3 + p = p3 + u = u3 + elif x < xsh: + rho = rho4 + p = p4 + u = u4 + else: + rho = rho5 + p = p5 + u = u5 + + # return with success + return rho, u, p + + +# generate analytical solutions over same mesh and times as loaded from data file +rhotrue = np.zeros((nt, nx), dtype=float) +utrue = np.zeros((nt, nx), dtype=float) +ptrue = np.zeros((nt, nx), dtype=float) +for it in range(nt): + for ix in range(nx): + rhotrue[it, ix], utrue[it, ix], ptrue[it, ix] = exact_Riemann(t[it], x[ix], 0.5) + +# plot defaults: increase default font size, increase plot width, enable LaTeX rendering +plt.rc("font", size=15) +plt.rcParams["figure.figsize"] = [7.2, 4.8] +plt.rcParams["text.usetex"] = True +plt.rcParams["figure.constrained_layout.use"] = True + +# subplots with time snapshots of the density, x-velocity, and pressure +fig = plt.figure(figsize=(10, 5)) +gs = GridSpec(3, 3, figure=fig) +ax00 = fig.add_subplot(gs[0, 0]) # left column +ax10 = fig.add_subplot(gs[1, 0]) +ax20 = fig.add_subplot(gs[2, 0]) +ax01 = fig.add_subplot(gs[0, 1]) # middle column +ax11 = fig.add_subplot(gs[1, 1]) +ax21 = fig.add_subplot(gs[2, 1]) +ax02 = fig.add_subplot(gs[0, 2]) # right column +ax12 = fig.add_subplot(gs[1, 2]) +ax22 = fig.add_subplot(gs[2, 2]) +it = 0 +ax00.plot(x, rho[it, :], "-b", x, rhotrue[it, :], ":k") +ax10.plot(x, u[it, :], "-b", x, utrue[it, :], ":k") +ax20.plot(x, p[it, :], "-b", x, ptrue[it, :], ":k") +ax00.set_title(r"$t =$ " + repr(t[it]).zfill(3)) +ax00.set_ylabel(r"$\rho$") +ax10.set_ylabel(r"$v_x$") +ax20.set_ylabel(r"$p$") +ax20.set_xlabel(r"$x$") +it = nt // 2 +ax01.plot(x, rho[it, :], "-b", x, rhotrue[it, :], ":k") +ax11.plot(x, u[it, :], "-b", x, utrue[it, :], ":k") +ax21.plot(x, p[it, :], "-b", x, ptrue[it, :], ":k") +ax01.set_title(r"$t =$ " + repr(t[it]).zfill(3)) +ax21.set_xlabel(r"$x$") +it = nt - 1 +ax02.plot(x, rho[it, :], "-b", x, rhotrue[it, :], ":k") +ax12.plot(x, u[it, :], "-b", x, utrue[it, :], ":k") +ax22.plot(x, p[it, :], "-b", x, ptrue[it, :], ":k") +ax02.set_title(r"$t =$ " + repr(t[it]).zfill(3)) +ax22.set_xlabel(r"$x$") +plt.savefig("sod_frames.png") + +plt.show() + +##### end of script ##### diff --git a/examples/arkode/CXX_parallel/CMakeLists.txt b/examples/arkode/CXX_parallel/CMakeLists.txt index 05b2a87861..45b01819d5 100644 --- a/examples/arkode/CXX_parallel/CMakeLists.txt +++ b/examples/arkode/CXX_parallel/CMakeLists.txt @@ -121,9 +121,12 @@ set(OTHER_LIBS ${EXE_EXTRA_LINK_LIBS}) # MPI examples # ------------ -set(serial_examples "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default") +set(parallel_examples + "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default" + "ark_heat2D_lsrk_p.cpp\;\;--np 2 2\;1\;4\;exclude-single\;default") + set(SUNDIALS_LIBS sundials_arkode sundials_nvecparallel) -build_examples(serial_examples CXX) +build_examples(parallel_examples CXX) # Auxiliary files to install list(APPEND ARKODE_extras plot_heat2D_p.py) @@ -238,7 +241,7 @@ endif() if(EXAMPLES_INSTALL) - set(examples_to_install "${serial_examples}") + set(examples_to_install "${parallel_examples}") set(_sundials_targets arkode nvecparallel) if(examples_cvode) diff --git a/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp new file mode 100644 index 0000000000..5a69244b8b --- /dev/null +++ b/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp @@ -0,0 +1,1743 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * + * (adapted from ark_heat2D_p.cpp, co-authored by Daniel Reynolds and David + * Gardner (LLNL)) + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Example problem: + * + * The following test simulates a simple anisotropic 2D heat equation, + * + * u_t = kx u_xx + ky u_yy + b, + * + * for t in [0, 1] and (x,y) in [0, 1]^2, with initial conditions + * + * u(0,x,y) = sin^2(pi x) sin^2(pi y), + * + * stationary boundary conditions + * + * u_t(t,0,y) = u_t(t,1,y) = u_t(t,x,0) = u_t(t,x,1) = 0, + * + * and the heat source + * + * b(t,x,y) = -2 pi sin^2(pi x) sin^2(pi y) sin(pi t) cos(pi t) + * - kx 2 pi^2 (cos^2(pi x) - sin^2(pi x)) sin^2(pi y) cos^2(pi t) + * - ky 2 pi^2 (cos^2(pi y) - sin^2(pi y)) sin^2(pi x) cos^2(pi t). + * + * Under this setup, the problem has the analytical solution + * + * u(t,x,y) = sin^2(pi x) sin^2(pi y) cos^2(pi t). + * + * The spatial derivatives are computed using second-order centered differences, + * with the data distributed over nx * ny points on a uniform spatial grid. The + * problem is advanced in time with the LSRKStep module in ARKODE. + * Several command line options are available to change the problem parameters + * and ARKODE settings. Use the flag --help for more information. + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <limits> +#include <sstream> + +#include "arkode/arkode_lsrkstep.h" // access to LSRKStep +#include "mpi.h" // MPI header file +#include "nvector/nvector_parallel.h" // access to the MPI N_Vector +#include "sunadaptcontroller/sunadaptcontroller_imexgus.h" +#include "sunadaptcontroller/sunadaptcontroller_soderlind.h" + +// Macros for problem constants +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) + +// Macro to access (x,y) location in 1D NVector array +#define IDX(x, y, n) ((n) * (y) + (x)) + +using namespace std; + +// ----------------------------------------------------------------------------- +// User data structure +// ----------------------------------------------------------------------------- + +struct UserData +{ + // Diffusion coefficients in the x and y directions + sunrealtype kx; + sunrealtype ky; + + // Enable/disable forcing + bool forcing; + + // Final time + sunrealtype tf; + + // Upper bounds in x and y directions + sunrealtype xu; + sunrealtype yu; + + // Global number of nodes in the x and y directions + sunindextype nx; + sunindextype ny; + + // Global total number of nodes + sunindextype nodes; + + // Mesh spacing in the x and y directions + sunrealtype dx; + sunrealtype dy; + + // Local number of nodes in the x and y directions + sunindextype nx_loc; + sunindextype ny_loc; + + // Overall number of local nodes + sunindextype nodes_loc; + + // Global x and y indices of this subdomain + sunindextype is; // x starting index + sunindextype ie; // x ending index + sunindextype js; // y starting index + sunindextype je; // y ending index + + // MPI variables + MPI_Comm comm_c; // Cartesian communicator in space + + int nprocs_w; // total number of MPI processes in Comm world + int npx; // number of MPI processes in the x-direction + int npy; // number of MPI processes in the y-direction + + int myid_c; // process ID in Cartesian communicator + + // Flags denoting if this process has a neighbor + bool HaveNbrW; + bool HaveNbrE; + bool HaveNbrS; + bool HaveNbrN; + + // Neighbor IDs for exchange + int ipW; + int ipE; + int ipS; + int ipN; + + // Receive buffers for neighbor exchange + sunrealtype* Wrecv; + sunrealtype* Erecv; + sunrealtype* Srecv; + sunrealtype* Nrecv; + + // Receive requests for neighbor exchange + MPI_Request reqRW; + MPI_Request reqRE; + MPI_Request reqRS; + MPI_Request reqRN; + + // Send buffers for neighbor exchange + sunrealtype* Wsend; + sunrealtype* Esend; + sunrealtype* Ssend; + sunrealtype* Nsend; + + // Send requests for neighbor exchange + MPI_Request reqSW; + MPI_Request reqSE; + MPI_Request reqSS; + MPI_Request reqSN; + + // Integrator settings + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size + int controller; // step size adaptivity method + int maxsteps; // max number of steps between outputs + bool diagnostics; // output diagnostics + + // LSRKStep options + ARKODE_LSRKMethodType method; // LSRK method choice + long int eigfrequency; // dominant eigenvalue update frequency + int stage_max_limit; // maximum number of stages per step + sunrealtype eigsafety; // dominant eigenvalue safety factor + + // Output variables + int output; // output level + int nout; // number of output times + ofstream uout; // output file stream + ofstream eout; // error file stream + N_Vector e; // error vector + + // Timing variables + bool timing; // print timings + double evolvetime; + double rhstime; + double exchangetime; +}; + +// ----------------------------------------------------------------------------- +// Functions provided to the SUNDIALS integrator +// ----------------------------------------------------------------------------- + +// ODE right hand side function +static int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data); + +// Spectral radius estimation routine +static int eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3); + +// ----------------------------------------------------------------------------- +// Helper functions +// ----------------------------------------------------------------------------- + +// Setup the parallel decomposition +static int SetupDecomp(MPI_Comm comm_w, UserData* udata); + +// Perform neighbor exchange +static int PostRecv(UserData* udata); +static int SendData(N_Vector y, UserData* udata); +static int WaitRecv(UserData* udata); + +// ----------------------------------------------------------------------------- +// UserData and input functions +// ----------------------------------------------------------------------------- + +// Set the default values in the UserData structure +static int InitUserData(UserData* udata); + +// Free memory allocated within UserData +static int FreeUserData(UserData* udata); + +// Read the command line inputs and set UserData values +static int ReadInputs(int* argc, char*** argv, UserData* udata, bool outproc); + +// ----------------------------------------------------------------------------- +// Output and utility functions +// ----------------------------------------------------------------------------- + +// Compute the true solution +static int Solution(sunrealtype t, N_Vector u, UserData* udata); + +// Compute the solution error solution +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata); + +// Print the command line options +static void InputHelp(); + +// Print some UserData information +static int PrintUserData(UserData* udata); + +// Output solution and error +static int OpenOutput(UserData* udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata); +static int CloseOutput(UserData* udata); + +// Print integration timing +static int OutputTiming(UserData* udata); + +// Check function return values +static int check_flag(void* flagvalue, const string funcname, int opt); + +// ----------------------------------------------------------------------------- +// Main Program +// ----------------------------------------------------------------------------- + +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 + void* arkode_mem = NULL; // ARKODE memory structure + SUNAdaptController C = NULL; // timestep adaptivity controller + + // Timing variables + double t1 = 0.0; + double t2 = 0.0; + + // MPI variables + MPI_Comm comm_w = MPI_COMM_WORLD; // MPI communicator + int myid; // MPI process ID + + // Initialize MPI + flag = MPI_Init(&argc, &argv); + if (check_flag(&flag, "MPI_Init", 1)) { return 1; } + + flag = MPI_Comm_rank(comm_w, &myid); + if (check_flag(&flag, "MPI_Comm_rank", 1)) { return 1; } + + // Create the SUNDIALS context object for this simulation + SUNContext ctx; + flag = SUNContext_Create(comm_w, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + // Set output process flag + bool outproc = (myid == 0); + + // ------------------------------------------ + // Setup UserData and parallel decomposition + // ------------------------------------------ + + // Allocate and initialize user data structure with default values. The + // defaults may be overwritten by command line inputs in ReadInputs below. + udata = new UserData; + flag = InitUserData(udata); + if (check_flag(&flag, "InitUserData", 1)) { return 1; } + + // Parse command line inputs + flag = ReadInputs(&argc, &argv, udata, outproc); + if (flag != 0) { return 1; } + + // Setup parallel decomposition + flag = SetupDecomp(comm_w, udata); + if (check_flag(&flag, "SetupDecomp", 1)) { return 1; } + + // Output problem setup/options + if (outproc) + { + flag = PrintUserData(udata); + if (check_flag(&flag, "PrintUserData", 1)) { return 1; } + } + + if (udata->diagnostics) + { + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) { return 1; } + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) { return 1; } + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) { return 1; } + } + + // ------------------------ + // Create parallel vectors + // ------------------------ + + // Create vector for solution + u = N_VNew_Parallel(udata->comm_c, udata->nodes_loc, udata->nodes, ctx); + if (check_flag((void*)u, "N_VNew_Parallel", 0)) { return 1; } + + // Set initial condition + flag = Solution(ZERO, u, udata); + if (check_flag(&flag, "Solution", 1)) { return 1; } + + // Create vector for error + udata->e = N_VClone(u); + if (check_flag((void*)(udata->e), "N_VClone", 0)) { return 1; } + + // -------------- + // Setup ARKODE + // -------------- + + // Create integrator + arkode_mem = LSRKStepCreateSTS(f, ZERO, u, ctx); + if (check_flag((void*)arkode_mem, "LSRKStepCreateSTS", 0)) { return 1; } + + // Specify tolerances + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + + // Attach user data + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + // Select LSRK method + flag = LSRKStepSetSTSMethod(arkode_mem, udata->method); + if (check_flag(&flag, "LSRKStepSetSTSMethod", 1)) { return 1; } + + // Select LSRK spectral radius function and options + flag = LSRKStepSetDomEigFn(arkode_mem, eig); + if (check_flag(&flag, "LSRKStepSetDomEigFn", 1)) { return 1; } + flag = LSRKStepSetDomEigFrequency(arkode_mem, udata->eigfrequency); + if (check_flag(&flag, "LSRKStepSetDomEigFrequency", 1)) { return 1; } + + // Set maximum number of stages per step + flag = LSRKStepSetMaxNumStages(arkode_mem, udata->stage_max_limit); + if (check_flag(&flag, "LSRKStepSetMaxNumStages", 1)) { return 1; } + + // Set spectral radius safety factor + flag = LSRKStepSetDomEigSafetyFactor(arkode_mem, udata->eigsafety); + if (check_flag(&flag, "LSRKStepSetDomEigSafetyFactor", 1)) { return 1; } + + // Set fixed step size or adaptivity method + if (udata->hfixed > ZERO) + { + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + } + else + { + 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 = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + } + + // Set max steps between outputs + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + // Set stopping time + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + + // ----------------------- + // Loop over output times + // ----------------------- + + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; + + // Initial output + flag = OpenOutput(udata); + if (check_flag(&flag, "OpenOutput", 1)) { return 1; } + + flag = WriteOutput(t, u, udata); + if (check_flag(&flag, "WriteOutput", 1)) { return 1; } + + for (int iout = 0; iout < udata->nout; iout++) + { + // Start timer + t1 = MPI_Wtime(); + + // Evolve in time + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + + // Stop timer + t2 = MPI_Wtime(); + + // Update timer + udata->evolvetime += t2 - t1; + + // Output solution and error + flag = WriteOutput(t, u, udata); + if (check_flag(&flag, "WriteOutput", 1)) { return 1; } + + // Update output time + tout += dTout; + tout = (tout > udata->tf) ? udata->tf : tout; + } + + // Close output + flag = CloseOutput(udata); + if (check_flag(&flag, "CloseOutput", 1)) { return 1; } + + // -------------- + // Final outputs + // -------------- + + // Print final integrator stats + if (udata->output > 0 && outproc) + { + cout << "Final integrator statistics:" << endl; + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + } + + if (udata->forcing) + { + // Output final error + flag = SolutionError(t, u, udata->e, udata); + if (check_flag(&flag, "SolutionError", 1)) { return 1; } + + sunrealtype maxerr = N_VMaxNorm(udata->e); + + if (outproc) + { + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " Max error = " << maxerr << endl; + } + } + + // Print timing + if (udata->timing) + { + flag = OutputTiming(udata); + if (check_flag(&flag, "OutputTiming", 1)) { return 1; } + } + + // -------------------- + // Clean up and return + // -------------------- + + ARKodeFree(&arkode_mem); // Free integrator memory + 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; +} + +// ----------------------------------------------------------------------------- +// Setup the parallel decomposition +// ----------------------------------------------------------------------------- + +static int SetupDecomp(MPI_Comm comm_w, UserData* udata) +{ + int flag; + + // Check that this has not been called before + if (udata->Erecv != NULL || udata->Wrecv != NULL || udata->Srecv != NULL || + udata->Nrecv != NULL) + { + cerr << "SetupDecomp error: parallel decomposition already set up" << endl; + return -1; + } + + // Get the number of processes + flag = MPI_Comm_size(comm_w, &(udata->nprocs_w)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Comm_size = " << flag << endl; + return -1; + } + + // Check the processor grid + if ((udata->npx * udata->npy) != udata->nprocs_w) + { + cerr << "Error: npx * npy != nproc" << endl; + return -1; + } + + // Set up 2D Cartesian communicator + int dims[2]; + dims[0] = udata->npx; + dims[1] = udata->npy; + + int periods[2]; + periods[0] = 0; + periods[1] = 0; + + flag = MPI_Cart_create(comm_w, 2, dims, periods, 0, &(udata->comm_c)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_create = " << flag << endl; + return -1; + } + + // Get my rank in the new Cartesian communicator + flag = MPI_Comm_rank(udata->comm_c, &(udata->myid_c)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Comm_rank = " << flag << endl; + return -1; + } + + // Get dimension of the Cartesian communicator and my coordinates + int coords[2]; + flag = MPI_Cart_get(udata->comm_c, 2, dims, periods, coords); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_get = " << flag << endl; + return -1; + } + + // Determine local extents in x-direction + int idx = coords[0]; + sunindextype qx = udata->nx / dims[0]; + sunindextype rx = udata->nx % dims[0]; + + udata->is = qx * idx + (idx < rx ? idx : rx); + udata->ie = udata->is + qx - 1 + (idx < rx ? 1 : 0); + + // Sanity check + if (udata->ie > (udata->nx - 1)) + { + cerr << "Error ie > nx - 1" << endl; + return -1; + } + + // Determine local extents in y-direction + int idy = coords[1]; + sunindextype qy = udata->ny / dims[1]; + sunindextype ry = udata->ny % dims[1]; + + udata->js = qy * idy + (idy < ry ? idy : ry); + udata->je = udata->js + qy - 1 + (idy < ry ? 1 : 0); + + // Sanity check + if (udata->je > (udata->ny - 1)) + { + cerr << "Error je > ny - 1" << endl; + return -1; + } + + // Number of local nodes + udata->nx_loc = (udata->ie) - (udata->is) + 1; + udata->ny_loc = (udata->je) - (udata->js) + 1; + + // Initialize global and local vector lengths + udata->nodes = udata->nx * udata->ny; + udata->nodes_loc = udata->nx_loc * udata->ny_loc; + + // Determine if this proc has neighbors + udata->HaveNbrW = (udata->is != 0); + udata->HaveNbrE = (udata->ie != udata->nx - 1); + udata->HaveNbrS = (udata->js != 0); + udata->HaveNbrN = (udata->je != udata->ny - 1); + + // Allocate exchange buffers if necessary + if (udata->HaveNbrW) + { + udata->Wrecv = new sunrealtype[udata->ny_loc]; + udata->Wsend = new sunrealtype[udata->ny_loc]; + } + if (udata->HaveNbrE) + { + udata->Erecv = new sunrealtype[udata->ny_loc]; + udata->Esend = new sunrealtype[udata->ny_loc]; + } + if (udata->HaveNbrS) + { + udata->Srecv = new sunrealtype[udata->nx_loc]; + udata->Ssend = new sunrealtype[udata->nx_loc]; + } + if (udata->HaveNbrN) + { + udata->Nrecv = new sunrealtype[udata->nx_loc]; + udata->Nsend = new sunrealtype[udata->nx_loc]; + } + + // MPI neighborhood information + int nbcoords[2]; + + // West neighbor + if (udata->HaveNbrW) + { + nbcoords[0] = coords[0] - 1; + nbcoords[1] = coords[1]; + flag = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipW)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_rank = " << flag << endl; + return -1; + } + } + + // East neighbor + if (udata->HaveNbrE) + { + nbcoords[0] = coords[0] + 1; + nbcoords[1] = coords[1]; + flag = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipE)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_rank = " << flag << endl; + return -1; + } + } + + // South neighbor + if (udata->HaveNbrS) + { + nbcoords[0] = coords[0]; + nbcoords[1] = coords[1] - 1; + flag = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipS)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_rank = " << flag << endl; + return -1; + } + } + + // North neighbor + if (udata->HaveNbrN) + { + nbcoords[0] = coords[0]; + nbcoords[1] = coords[1] + 1; + flag = MPI_Cart_rank(udata->comm_c, nbcoords, &(udata->ipN)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Cart_rank = " << flag << endl; + return -1; + } + } + + // Return success + return 0; +} + +// ----------------------------------------------------------------------------- +// Functions called by the integrator +// ----------------------------------------------------------------------------- + +// f routine to compute the ODE RHS function f(t,y). +static int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data) +{ + int flag; + sunindextype i, j; + + // Start timer + double t1 = MPI_Wtime(); + + // Access problem data + UserData* udata = (UserData*)user_data; + + // Open exchange receives + flag = PostRecv(udata); + if (check_flag(&flag, "PostRecv", 1)) { return -1; } + + // Send exchange data + flag = SendData(u, udata); + if (check_flag(&flag, "SendData", 1)) { return -1; } + + // Shortcuts to local number of nodes + sunindextype nx_loc = udata->nx_loc; + sunindextype ny_loc = udata->ny_loc; + + // Determine iteration range excluding the overall domain boundary + sunindextype istart = (udata->HaveNbrW) ? 0 : 1; + sunindextype iend = (udata->HaveNbrE) ? nx_loc : nx_loc - 1; + sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; + sunindextype jend = (udata->HaveNbrN) ? ny_loc : ny_loc - 1; + + // Constants for computing diffusion term + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); + + // Access data arrays + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + sunrealtype* farray = N_VGetArrayPointer(f); + if (check_flag((void*)farray, "N_VGetArrayPointer", 0)) { return -1; } + + // Initialize rhs vector to zero (handles boundary conditions) + N_VConst(ZERO, f); + + // Iterate over subdomain and compute rhs forcing term + if (udata->forcing) + { + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; + + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; + + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); + + for (j = jstart; j < jend; j++) + { + for (i = istart; i < iend; i++) + { + x = (udata->is + i) * udata->dx; + y = (udata->js + j) * udata->dy; + + sin_sqr_x = sin(PI * x) * sin(PI * x); + sin_sqr_y = sin(PI * y) * sin(PI * y); + + cos_sqr_x = cos(PI * x) * cos(PI * x); + cos_sqr_y = cos(PI * y) * cos(PI * y); + + farray[IDX(i, j, nx_loc)] = + -TWO * PI * sin_sqr_x * sin_sqr_y * sin_t_cos_t - + bx * (cos_sqr_x - sin_sqr_x) * sin_sqr_y * cos_sqr_t - + by * (cos_sqr_y - sin_sqr_y) * sin_sqr_x * cos_sqr_t; + } + } + } + + // Iterate over subdomain interior and add rhs diffusion term + for (j = 1; j < ny_loc - 1; j++) + { + for (i = 1; i < nx_loc - 1; i++) + { + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + uarray[IDX(i, j + 1, nx_loc)]); + } + } + + // Wait for exchange receives + flag = WaitRecv(udata); + if (check_flag(&flag, "WaitRecv", 1)) { return -1; } + + // Iterate over subdomain boundaries and add rhs diffusion term + sunrealtype* Warray = udata->Wrecv; + sunrealtype* Earray = udata->Erecv; + sunrealtype* Sarray = udata->Srecv; + sunrealtype* Narray = udata->Nrecv; + + // West face (updates south-west and north-west corners if necessary) + if (udata->HaveNbrW) + { + i = 0; + if (udata->HaveNbrS) // South-West corner + { + j = 0; + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (Warray[j] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (Sarray[i] + uarray[IDX(i, j + 1, nx_loc)]); + } + + for (j = 1; j < ny_loc - 1; j++) + { + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (Warray[j] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + uarray[IDX(i, j + 1, nx_loc)]); + } + + if (udata->HaveNbrN) // North-West corner + { + j = ny_loc - 1; + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (Warray[j] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + Narray[i]); + } + } + + // East face (updates south-east and north-east corners if necessary) + if (udata->HaveNbrE) + { + i = nx_loc - 1; + if (udata->HaveNbrS) // South-East corner + { + j = 0; + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + Earray[j]) + + cy * (Sarray[i] + uarray[IDX(i, j + 1, nx_loc)]); + } + + for (j = 1; j < ny_loc - 1; j++) + { + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + Earray[j]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + uarray[IDX(i, j + 1, nx_loc)]); + } + + if (udata->HaveNbrN) // North-East corner + { + j = ny_loc - 1; + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + Earray[j]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + Narray[i]); + } + } + + // South face (excludes corners) + if (udata->HaveNbrS) + { + j = 0; + for (i = 1; i < nx_loc - 1; i++) + { + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (Sarray[i] + uarray[IDX(i, j + 1, nx_loc)]); + } + } + + // North face (excludes corners) + if (udata->HaveNbrN) + { + j = udata->ny_loc - 1; + for (i = 1; i < nx_loc - 1; i++) + { + farray[IDX(i, j, nx_loc)] += + cc * uarray[IDX(i, j, nx_loc)] + + cx * (uarray[IDX(i - 1, j, nx_loc)] + uarray[IDX(i + 1, j, nx_loc)]) + + cy * (uarray[IDX(i, j - 1, nx_loc)] + Narray[i]); + } + } + + // Stop timer + double t2 = MPI_Wtime(); + + // Update timer + udata->rhstime += t2 - t1; + + // Return success + return 0; +} + +// ----------------------------------------------------------------------------- +// RHS helper functions +// ----------------------------------------------------------------------------- + +// Post exchange receives +static int PostRecv(UserData* udata) +{ + int flag; + + // Start timer + double t1 = MPI_Wtime(); + + // Open Irecv buffers + if (udata->HaveNbrW) + { + flag = MPI_Irecv(udata->Wrecv, (int)udata->ny_loc, MPI_SUNREALTYPE, + udata->ipW, MPI_ANY_TAG, udata->comm_c, &(udata->reqRW)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Irecv = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrE) + { + flag = MPI_Irecv(udata->Erecv, (int)udata->ny_loc, MPI_SUNREALTYPE, + udata->ipE, MPI_ANY_TAG, udata->comm_c, &(udata->reqRE)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Irecv = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrS) + { + flag = MPI_Irecv(udata->Srecv, (int)udata->nx_loc, MPI_SUNREALTYPE, + udata->ipS, MPI_ANY_TAG, udata->comm_c, &(udata->reqRS)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Irecv = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrN) + { + flag = MPI_Irecv(udata->Nrecv, (int)udata->nx_loc, MPI_SUNREALTYPE, + udata->ipN, MPI_ANY_TAG, udata->comm_c, &(udata->reqRN)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Irecv = " << flag << endl; + return -1; + } + } + + // Stop timer + double t2 = MPI_Wtime(); + + // Update timer + udata->exchangetime += t2 - t1; + + // Return success + return 0; +} + +// Send exchange data +static int SendData(N_Vector y, UserData* udata) +{ + int flag, i; + sunindextype ny_loc = udata->ny_loc; + sunindextype nx_loc = udata->nx_loc; + + // Start timer + double t1 = MPI_Wtime(); + + // Access data array + sunrealtype* Y = N_VGetArrayPointer(y); + if (check_flag((void*)Y, "N_VGetArrayPointer", 0)) { return -1; } + + // Send data + if (udata->HaveNbrW) + { + for (i = 0; i < ny_loc; i++) { udata->Wsend[i] = Y[IDX(0, i, nx_loc)]; } + flag = MPI_Isend(udata->Wsend, (int)udata->ny_loc, MPI_SUNREALTYPE, + udata->ipW, 0, udata->comm_c, &(udata->reqSW)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Isend = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrE) + { + for (i = 0; i < ny_loc; i++) + { + udata->Esend[i] = Y[IDX(nx_loc - 1, i, nx_loc)]; + } + flag = MPI_Isend(udata->Esend, (int)udata->ny_loc, MPI_SUNREALTYPE, + udata->ipE, 1, udata->comm_c, &(udata->reqSE)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Isend = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrS) + { + for (i = 0; i < nx_loc; i++) { udata->Ssend[i] = Y[IDX(i, 0, nx_loc)]; } + flag = MPI_Isend(udata->Ssend, (int)udata->nx_loc, MPI_SUNREALTYPE, + udata->ipS, 2, udata->comm_c, &(udata->reqSS)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Isend = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrN) + { + for (i = 0; i < nx_loc; i++) + { + udata->Nsend[i] = Y[IDX(i, ny_loc - 1, nx_loc)]; + } + flag = MPI_Isend(udata->Nsend, (int)udata->nx_loc, MPI_SUNREALTYPE, + udata->ipN, 3, udata->comm_c, &(udata->reqSN)); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Isend = " << flag << endl; + return -1; + } + } + + // Stop timer + double t2 = MPI_Wtime(); + + // Update timer + udata->exchangetime += t2 - t1; + + // Return success + return 0; +} + +// Wait for exchange data +static int WaitRecv(UserData* udata) +{ + // Local variables + int flag; + MPI_Status stat; + + // Start timer + double t1 = MPI_Wtime(); + + // Wait for messages to finish + if (udata->HaveNbrW) + { + flag = MPI_Wait(&(udata->reqRW), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + flag = MPI_Wait(&(udata->reqSW), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrE) + { + flag = MPI_Wait(&(udata->reqRE), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + flag = MPI_Wait(&(udata->reqSE), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrS) + { + flag = MPI_Wait(&(udata->reqRS), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + flag = MPI_Wait(&(udata->reqSS), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + } + + if (udata->HaveNbrN) + { + flag = MPI_Wait(&(udata->reqRN), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + flag = MPI_Wait(&(udata->reqSN), &stat); + if (flag != MPI_SUCCESS) + { + cerr << "Error in MPI_Wait = " << flag << endl; + return -1; + } + } + + // Stop timer + double t2 = MPI_Wtime(); + + // Update timer + udata->exchangetime += t2 - t1; + + // Return success + return 0; +} + +// Spectral radius estimation routine +static int eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3) +{ + // Access problem data + UserData* udata = (UserData*)user_data; + + // Fill in spectral radius value + *lambdaR = -SUN_RCONST(8.0) * max(udata->kx / udata->dx / udata->dx, + udata->ky / udata->dy / udata->dy); + *lambdaI = SUN_RCONST(0.0); + + // return with success + return 0; +} + +// ----------------------------------------------------------------------------- +// UserData and input functions +// ----------------------------------------------------------------------------- + +// Initialize memory allocated within Userdata +static int InitUserData(UserData* udata) +{ + // Diffusion coefficient + udata->kx = SUN_RCONST(10.0); + udata->ky = SUN_RCONST(10.0); + + // Enable forcing + udata->forcing = true; + + // Final time + udata->tf = ONE; + + // Upper bounds in x and y directions + udata->xu = ONE; + udata->yu = ONE; + + // Global number of nodes in the x and y directions + udata->nx = 64; + udata->ny = 64; + udata->nodes = udata->nx * udata->ny; + + // Mesh spacing in the x and y directions + udata->dx = udata->xu / (udata->nx - 1); + udata->dy = udata->yu / (udata->ny - 1); + + // Locals number of nodes in the x and y directions (set in SetupDecomp) + udata->nx_loc = 0; + udata->ny_loc = 0; + udata->nodes_loc = 0; + + // Global indices of this subdomain (set in SetupDecomp) + udata->is = 0; + udata->ie = 0; + udata->js = 0; + udata->je = 0; + + // MPI variables (set in SetupDecomp) + udata->comm_c = MPI_COMM_NULL; + + udata->nprocs_w = 1; + udata->npx = 1; + udata->npy = 1; + + udata->myid_c = 0; + + // Flags denoting neighbors (set in SetupDecomp) + udata->HaveNbrW = true; + udata->HaveNbrE = true; + udata->HaveNbrS = true; + udata->HaveNbrN = true; + + // Exchange receive buffers (allocated in SetupDecomp) + udata->Erecv = NULL; + udata->Wrecv = NULL; + udata->Nrecv = NULL; + udata->Srecv = NULL; + + // Exchange send buffers (allocated in SetupDecomp) + udata->Esend = NULL; + udata->Wsend = NULL; + udata->Nsend = NULL; + udata->Ssend = NULL; + + // Neighbors IDs (set in SetupDecomp) + udata->ipW = -1; + udata->ipE = -1; + udata->ipS = -1; + udata->ipN = -1; + + // Integrator settings + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance + udata->hfixed = ZERO; // using adaptive step sizes + udata->controller = 0; // PID controller + udata->maxsteps = 0; // use default + udata->diagnostics = false; // output diagnostics + + // LSRKStep options + udata->method = ARKODE_LSRK_RKC_2; // RKC + udata->eigfrequency = 25; // update eigenvalue at least every 20 steps + udata->stage_max_limit = 1000; // allow up to 1000 stages/step + udata->eigsafety = SUN_RCONST(1.01); // 1% safety factor + + // Output variables + udata->output = 1; // 0 = no output, 1 = stats output, 2 = output to disk + udata->nout = 20; // Number of output times + udata->e = NULL; + + // Timing variables + udata->timing = false; + udata->evolvetime = 0.0; + udata->rhstime = 0.0; + udata->exchangetime = 0.0; + + // Return success + return 0; +} + +// Free memory allocated within Userdata +static int FreeUserData(UserData* udata) +{ + // Free exchange buffers + if (udata->Wrecv != NULL) { delete[] udata->Wrecv; } + if (udata->Wsend != NULL) { delete[] udata->Wsend; } + if (udata->Erecv != NULL) { delete[] udata->Erecv; } + if (udata->Esend != NULL) { delete[] udata->Esend; } + if (udata->Srecv != NULL) { delete[] udata->Srecv; } + if (udata->Ssend != NULL) { delete[] udata->Ssend; } + if (udata->Nrecv != NULL) { delete[] udata->Nrecv; } + if (udata->Nsend != NULL) { delete[] udata->Nsend; } + + // Free MPI Cartesian communicator + if (udata->comm_c != MPI_COMM_NULL) { MPI_Comm_free(&(udata->comm_c)); } + + // Free error vector + if (udata->e) + { + N_VDestroy(udata->e); + udata->e = NULL; + } + + // Return success + return 0; +} + +// Read command line inputs +static int ReadInputs(int* argc, char*** argv, UserData* udata, bool outproc) +{ + // Check for input args + int arg_idx = 1; + + while (arg_idx < (*argc)) + { + string arg = (*argv)[arg_idx++]; + + // Mesh points + if (arg == "--mesh") + { + udata->nx = stoi((*argv)[arg_idx++]); + udata->ny = stoi((*argv)[arg_idx++]); + } + // MPI processes + else if (arg == "--np") + { + udata->npx = stoi((*argv)[arg_idx++]); + udata->npy = stoi((*argv)[arg_idx++]); + } + // Domain upper bounds + else if (arg == "--domain") + { + udata->xu = stoi((*argv)[arg_idx++]); + udata->yu = stoi((*argv)[arg_idx++]); + } + // Diffusion parameters + else if (arg == "--k") + { + udata->kx = stod((*argv)[arg_idx++]); + udata->ky = stod((*argv)[arg_idx++]); + } + // Disable forcing + else if (arg == "--noforcing") { udata->forcing = false; } + // Temporal domain settings + else if (arg == "--tf") { udata->tf = stod((*argv)[arg_idx++]); } + // Integrator settings + else if (arg == "--rtol") { udata->rtol = stod((*argv)[arg_idx++]); } + else if (arg == "--atol") { udata->atol = stod((*argv)[arg_idx++]); } + else if (arg == "--fixedstep") { udata->hfixed = stod((*argv)[arg_idx++]); } + else if (arg == "--controller") + { + udata->controller = stoi((*argv)[arg_idx++]); + } + else if (arg == "--diagnostics") { udata->diagnostics = true; } + else if (arg == "--method") + { + udata->method = (ARKODE_LSRKMethodType)stoi((*argv)[arg_idx++]); + } + else if (arg == "--eigfrequency") + { + udata->eigfrequency = stoi((*argv)[arg_idx++]); + } + else if (arg == "--stage_max_limit") + { + udata->stage_max_limit = stoi((*argv)[arg_idx++]); + } + else if (arg == "--eigsafety") + { + udata->eigsafety = stod((*argv)[arg_idx++]); + } + // Output settings + else if (arg == "--output") { udata->output = stoi((*argv)[arg_idx++]); } + else if (arg == "--nout") { udata->nout = stoi((*argv)[arg_idx++]); } + else if (arg == "--maxsteps") + { + udata->maxsteps = stoi((*argv)[arg_idx++]); + } + else if (arg == "--timing") { udata->timing = true; } + // Help + else if (arg == "--help") + { + if (outproc) { InputHelp(); } + return -1; + } + // Unknown input + else + { + if (outproc) + { + cerr << "ERROR: Invalid input " << arg << endl; + InputHelp(); + } + return -1; + } + } + + // Recompute total number of nodes + udata->nodes = udata->nx * udata->ny; + + // Recompute x and y mesh spacing + udata->dx = (udata->xu) / (udata->nx - 1); + udata->dy = (udata->yu) / (udata->ny - 1); + + // Return success + return 0; +} + +// ----------------------------------------------------------------------------- +// Output and utility functions +// ----------------------------------------------------------------------------- + +// Compute the exact solution +static int Solution(sunrealtype t, N_Vector u, UserData* udata) +{ + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; + + // Constants for computing solution + cos_sqr_t = cos(PI * t) * cos(PI * t); + + // Initialize u to zero (handles boundary conditions) + N_VConst(ZERO, u); + + // Iterative over domain interior + sunindextype istart = (udata->HaveNbrW) ? 0 : 1; + sunindextype iend = (udata->HaveNbrE) ? udata->nx_loc : udata->nx_loc - 1; + + sunindextype jstart = (udata->HaveNbrS) ? 0 : 1; + sunindextype jend = (udata->HaveNbrN) ? udata->ny_loc : udata->ny_loc - 1; + + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + for (sunindextype j = jstart; j < jend; j++) + { + for (sunindextype i = istart; i < iend; i++) + { + x = (udata->is + i) * udata->dx; + y = (udata->js + j) * udata->dy; + + sin_sqr_x = sin(PI * x) * sin(PI * x); + sin_sqr_y = sin(PI * y) * sin(PI * y); + + uarray[IDX(i, j, udata->nx_loc)] = sin_sqr_x * sin_sqr_y * cos_sqr_t; + } + } + + return 0; +} + +// Compute the solution error +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata) +{ + // Compute true solution + int flag = Solution(t, e, udata); + if (flag != 0) { return -1; } + + // Compute absolute error + N_VLinearSum(ONE, u, -ONE, e, e); + N_VAbs(e, e); + + return 0; +} + +// Print command line options +static void InputHelp() +{ + cout << endl; + cout << "Command line options:" << endl; + cout << " --mesh <nx> <ny> : mesh points in the x and y directions" + << endl; + cout << " --np <npx> <npy> : number of MPI processes in the x and y " + "directions" + << endl; + cout + << " --domain <xu> <yu> : domain upper bound in the x and y direction" + << endl; + cout << " --k <kx> <ky> : diffusion coefficients" << endl; + cout << " --noforcing : disable forcing term" << endl; + cout << " --tf <time> : final time" << endl; + cout << " --rtol <rtol> : relative tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; + cout << " --fixedstep <step> : used fixed step size" << endl; + cout << " --controller <ctr> : time step adaptivity controller" << endl; + cout << " --method <mth> : LSRK method choice" << endl; + cout << " --eigfrequency <nst> : dominant eigenvalue update frequency" + << endl; + cout << " --stage_max_limit <smax> : maximum number of stages per step" + << endl; + cout << " --eigsafety <safety> : dominant eigenvalue safety factor" << endl; + cout << " --diagnostics : output diagnostics" << endl; + cout << " --output <level> : output level" << endl; + cout << " --nout <nout> : number of outputs" << endl; + cout << " --maxsteps <steps> : max steps between outputs" << endl; + cout << " --timing : print timing data" << endl; + cout << " --help : print this message and exit" << endl; +} + +// Print user data +static int PrintUserData(UserData* udata) +{ + cout << endl; + cout << "2D Heat PDE test problem:" << endl; + cout << " --------------------------------- " << endl; + cout << " nprocs = " << udata->nprocs_w << endl; + cout << " npx = " << udata->npx << endl; + cout << " npy = " << udata->npy << endl; + cout << " --------------------------------- " << endl; + cout << " kx = " << udata->kx << endl; + cout << " ky = " << udata->ky << endl; + cout << " forcing = " << udata->forcing << endl; + cout << " tf = " << udata->tf << endl; + cout << " xu = " << udata->xu << endl; + cout << " yu = " << udata->yu << endl; + cout << " nx = " << udata->nx << endl; + cout << " ny = " << udata->ny << endl; + cout << " nxl (proc 0) = " << udata->nx_loc << endl; + cout << " nyl (proc 0) = " << udata->ny_loc << endl; + cout << " dx = " << udata->dx << endl; + cout << " dy = " << udata->dy << endl; + cout << " --------------------------------- " << endl; + cout << " rtol = " << udata->rtol << endl; + cout << " atol = " << udata->atol << endl; + cout << " fixed h = " << udata->hfixed << endl; + cout << " controller = " << udata->controller << endl; + cout << " method = " << udata->method << endl; + cout << " eigfrequency = " << udata->eigfrequency << endl; + cout << " stage_max_limit = " << udata->stage_max_limit << endl; + cout << " eigsafety = " << udata->eigsafety << endl; + cout << " --------------------------------- " << endl; + cout << " output = " << udata->output << endl; + cout << " max steps = " << udata->maxsteps << endl; + cout << " --------------------------------- " << endl; + cout << endl; + + return 0; +} + +// Initialize output +static int OpenOutput(UserData* udata) +{ + bool outproc = (udata->myid_c == 0); + + // Header for status output + if (udata->output > 0 && outproc) + { + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + if (udata->forcing) + { + cout << " t "; + cout << " ||u||_rms "; + cout << " max error " << endl; + cout << " ---------------------"; + cout << "-------------------------"; + cout << "-------------------------" << endl; + } + else + { + cout << " t "; + cout << " ||u||_rms " << endl; + cout << " ---------------------"; + cout << "-------------------------" << endl; + } + } + + // Output problem information and open output streams + if (udata->output == 2) + { + // Each processor outputs subdomain information + stringstream fname; + fname << "heat2d_info." << setfill('0') << setw(5) << udata->myid_c << ".txt"; + + ofstream dout; + dout.open(fname.str()); + dout << "xu " << udata->xu << endl; + dout << "yu " << udata->yu << endl; + dout << "nx " << udata->nx << endl; + dout << "ny " << udata->ny << endl; + dout << "px " << udata->npx << endl; + dout << "py " << udata->npy << endl; + dout << "np " << udata->nprocs_w << endl; + dout << "is " << udata->is << endl; + dout << "ie " << udata->ie << endl; + dout << "js " << udata->js << endl; + dout << "je " << udata->je << endl; + dout << "nt " << udata->nout + 1 << endl; + dout.close(); + + // Open output streams for solution and error + fname.str(""); + fname.clear(); + fname << "heat2d_solution." << setfill('0') << setw(5) << udata->myid_c + << ".txt"; + udata->uout.open(fname.str()); + + udata->uout << scientific; + udata->uout << setprecision(numeric_limits<sunrealtype>::digits10); + + if (udata->forcing) + { + fname.str(""); + fname.clear(); + fname << "heat2d_error." << setfill('0') << setw(5) << udata->myid_c + << ".txt"; + udata->eout.open(fname.str()); + + udata->eout << scientific; + udata->eout << setprecision(numeric_limits<sunrealtype>::digits10); + } + } + + return 0; +} + +// Write output +static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) +{ + int flag; + sunrealtype max = ZERO; + bool outproc = (udata->myid_c == 0); + + if (udata->output > 0) + { + if (udata->forcing) + { + // Compute the error + flag = SolutionError(t, u, udata->e, udata); + if (check_flag(&flag, "SolutionError", 1)) { return 1; } + + // Compute max error + max = N_VMaxNorm(udata->e); + } + + // Compute rms norm of the state + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + + // Output current status + if (outproc) + { + if (udata->forcing) + { + cout << setw(22) << t << setw(25) << urms << setw(25) << max << endl; + } + else { cout << setw(22) << t << setw(25) << urms << endl; } + } + + // Write solution and error to disk + if (udata->output == 2) + { + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + udata->uout << t << " "; + for (sunindextype i = 0; i < udata->nodes_loc; i++) + { + udata->uout << uarray[i] << " "; + } + udata->uout << endl; + + if (udata->forcing) + { + // Output error to disk + sunrealtype* earray = N_VGetArrayPointer(udata->e); + if (check_flag((void*)earray, "N_VGetArrayPointer", 0)) { return -1; } + + udata->eout << t << " "; + for (sunindextype i = 0; i < udata->nodes_loc; i++) + { + udata->eout << earray[i] << " "; + } + udata->eout << endl; + } + } + } + + return 0; +} + +// Finalize output +static int CloseOutput(UserData* udata) +{ + bool outproc = (udata->myid_c == 0); + + // Footer for status output + if (outproc && (udata->output > 0)) + { + if (udata->forcing) + { + cout << " ---------------------"; + cout << "-------------------------"; + cout << "-------------------------" << endl; + cout << endl; + } + else + { + cout << " ---------------------"; + cout << "-------------------------" << endl; + cout << endl; + } + } + + if (udata->output == 2) + { + // Close output streams + udata->uout.close(); + if (udata->forcing) { udata->eout.close(); } + } + + return 0; +} + +static int OutputTiming(UserData* udata) +{ + bool outproc = (udata->myid_c == 0); + + if (outproc) + { + cout << scientific; + cout << setprecision(6); + } + + double maxtime = 0.0; + + MPI_Reduce(&(udata->evolvetime), &maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, + udata->comm_c); + if (outproc) { cout << " Evolve time = " << maxtime << " sec" << endl; } + + MPI_Reduce(&(udata->rhstime), &maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, + udata->comm_c); + if (outproc) { cout << " RHS time = " << maxtime << " sec" << endl; } + + MPI_Reduce(&(udata->exchangetime), &maxtime, 1, MPI_DOUBLE, MPI_MAX, 0, + udata->comm_c); + if (outproc) + { + cout << " Exchange time = " << maxtime << " sec" << endl; + cout << endl; + } + + return 0; +} + +// Check function return value +static int check_flag(void* flagvalue, const string funcname, int opt) +{ + // Check if the function returned a NULL pointer + if (opt == 0) + { + if (flagvalue == NULL) + { + cerr << endl + << "ERROR: " << funcname << " returned NULL pointer" << endl + << endl; + return 1; + } + } + // Check the function return flag value + else if (opt == 1 || opt == 2) + { + int errflag = *((int*)flagvalue); + if ((opt == 1 && errflag < 0) || (opt == 2 && errflag != 0)) + { + cerr << endl + << "ERROR: " << funcname << " returned with flag = " << errflag << endl + << endl; + return 1; + } + } + else + { + cerr << endl + << "ERROR: check_flag called with an invalid option value" << endl; + return 1; + } + + return 0; +} + +//---- end of file ---- diff --git a/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p_--np_2_2.out b/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p_--np_2_2.out new file mode 100644 index 0000000000..2e427c1f68 --- /dev/null +++ b/examples/arkode/CXX_parallel/ark_heat2D_lsrk_p_--np_2_2.out @@ -0,0 +1,77 @@ + +2D Heat PDE test problem: + --------------------------------- + nprocs = 4 + npx = 2 + npy = 2 + --------------------------------- + kx = 10 + ky = 10 + forcing = 1 + tf = 1 + xu = 1 + yu = 1 + nx = 64 + ny = 64 + nxl (proc 0) = 32 + nyl (proc 0) = 32 + dx = 0.015873 + dy = 0.015873 + --------------------------------- + rtol = 1e-05 + atol = 1e-10 + fixed h = 0 + controller = 0 + method = 0 + eigfrequency = 25 + stage_max_limit = 1000 + eigsafety = 1.01 + --------------------------------- + output = 1 + max steps = 0 + --------------------------------- + + t ||u||_rms max error + ----------------------------------------------------------------------- + 0.000000000000000e+00 3.691406249999997e-01 0.000000000000000e+00 + 5.000000000000000e-02 3.604068953517967e-01 8.105295833209514e-04 + 1.000000000000000e-01 3.341701389364218e-01 7.545034548108731e-04 + 1.500000000000000e-01 2.933045814986309e-01 6.655020864086980e-04 + 2.000000000000000e-01 2.418102694055522e-01 5.516214337898395e-04 + 2.500000000000000e-01 1.847278700508768e-01 4.242334062354858e-04 + 3.000000000000000e-01 1.276450308942233e-01 2.958580787605358e-04 + 3.500000000000000e-01 7.614944266702617e-02 1.791094087855438e-04 + 4.000000000000000e-01 3.528179910109314e-02 8.530904694552255e-05 + 4.500000000000000e-01 9.042542522694921e-03 2.370608965900772e-05 + 4.999999999999999e-01 1.483315166225389e-07 3.059603009683608e-07 + 5.499999999999999e-01 9.039739042784675e-03 1.741090593756697e-05 + 6.000000000000000e-01 3.527647409287470e-02 7.335124006428717e-05 + 6.500000000000000e-01 7.614211328432417e-02 1.626500495444660e-04 + 7.000000000000001e-01 1.276364431256062e-01 2.765661014183518e-04 + 7.500000000000001e-01 1.847188398298133e-01 4.039484922465642e-04 + 8.000000000000002e-01 2.418016806911184e-01 5.323281450848594e-04 + 8.500000000000002e-01 2.932973330369171e-01 6.492070716110909e-04 + 9.000000000000002e-01 3.341649712653251e-01 7.429941071179780e-04 + 9.500000000000003e-01 3.604042250428204e-01 8.045913925563974e-04 + 1.000000000000000e+00 3.694466133673749e-01 8.279696807845793e-04 + ----------------------------------------------------------------------- + +Final integrator statistics: +Current time = 1 +Steps = 617 +Step attempts = 617 +Stability limited steps = 0 +Accuracy limited steps = 617 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 2.877680248425019e-06 +Last step size = 0.0003228665778641779 +Current step size = 0.0003228665778641779 +RHS fn evals = 17225 +Number of dom_eig updates = 25 +Max. num. of stages used = 46 +Max. num. of stages allowed = 1000 +Max. spectral radius = 320695.2 +Min. spectral radius = 320695.2 + Max error = 8.279696807845793e-04 diff --git a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp index 69aa444334..3950d8c482 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp @@ -1250,6 +1250,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructGridCreate(udata->comm_c, 2, &(udata->grid)); if (flag != 0) { + cerr << "Error in HYPRE_StructGridCreate = " << flag << endl; FreeUserData(udata); return -1; } @@ -1264,6 +1265,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructGridSetExtents(udata->grid, udata->ilower, udata->iupper); if (flag != 0) { + cerr << "Error in HYPRE_StructGridSetExtents = " << flag << endl; FreeUserData(udata); return -1; } @@ -1272,6 +1274,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructGridAssemble(udata->grid); if (flag != 0) { + cerr << "Error in HYPRE_StructGridAssemble = " << flag << endl; FreeUserData(udata); return -1; } @@ -1284,6 +1287,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructStencilCreate(2, 5, &(udata->stencil)); if (flag != 0) { + cerr << "Error in HYPRE_StructStencilCreate = " << flag << endl; FreeUserData(udata); return -1; } @@ -1296,6 +1300,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructStencilSetElement(udata->stencil, entry, offsets[entry]); if (flag != 0) { + cerr << "Error in HYPRE_StructStencilSetElement = " << flag << endl; FreeUserData(udata); return -1; } @@ -1310,6 +1315,7 @@ static int SetupHypre(UserData* udata) udata->work = new HYPRE_Real[udata->nwork]; if (udata->work == NULL) { + cerr << "Error: unable to allocate work array" << endl; FreeUserData(udata); return -1; } @@ -1321,6 +1327,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorCreate(udata->comm_c, udata->grid, &(udata->xvec)); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorCreate (x) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1328,6 +1335,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorInitialize(udata->xvec); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorInitialize (x) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1339,6 +1347,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorCreate(udata->comm_c, udata->grid, &(udata->bvec)); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorCreate (b) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1346,6 +1355,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorInitialize(udata->bvec); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorInitialize (b) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1359,6 +1369,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorCreate(udata->comm_c, udata->grid, &(udata->vvec)); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorCreate (v) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1366,6 +1377,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorInitialize(udata->vvec); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorInitialize (v) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1377,6 +1389,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorCreate(udata->comm_c, udata->grid, &(udata->Jvvec)); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorCreate (Jv) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1384,6 +1397,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructVectorInitialize(udata->Jvvec); if (flag != 0) { + cerr << "Error in HYPRE_StructVectorInitialize (Jv) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1397,6 +1411,7 @@ static int SetupHypre(UserData* udata) &(udata->Jmatrix)); if (flag != 0) { + cerr << "Error in HYPRE_StructMatrixCreate (J) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1404,6 +1419,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructMatrixInitialize(udata->Jmatrix); if (flag != 0) { + cerr << "Error in HYPRE_StructMatrixInitialize (A) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1416,6 +1432,7 @@ static int SetupHypre(UserData* udata) &(udata->Amatrix)); if (flag != 0) { + cerr << "Error in HYPRE_StructMatrixCreate (A) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1423,6 +1440,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructMatrixInitialize(udata->Amatrix); if (flag != 0) { + cerr << "Error in HYPRE_StructMatrixInitialize (A) = " << flag << endl; FreeUserData(udata); return -1; } @@ -1445,6 +1463,7 @@ static int SetupHypre(UserData* udata) flag = Jac(udata); if (flag != 0) { + cerr << "Error in Jac = " << flag << endl; FreeUserData(udata); return -1; } @@ -1452,6 +1471,7 @@ static int SetupHypre(UserData* udata) flag = HYPRE_StructMatrixAssemble(udata->Jmatrix); if (flag != 0) { + cerr << "Error in HYPRE_StructMatrixAssemble = " << flag << endl; FreeUserData(udata); return -1; } @@ -1532,7 +1552,12 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, ilower, iupper, 5, entries, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (interior) = " << flag + << endl; + return -1; + } // ---------------------------------------- // Correct matrix values at boundary nodes @@ -1574,7 +1599,12 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 5, entries, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (west bdry) = " << flag + << endl; + return -1; + } } } @@ -1595,7 +1625,12 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 5, entries, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (east bdry) = " << flag + << endl; + return -1; + } } } @@ -1616,7 +1651,12 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 5, entries, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (south bdry) = " + << flag << endl; + return -1; + } } } @@ -1637,7 +1677,12 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 5, entries, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (north bdry) = " + << flag << endl; + return -1; + } } } @@ -1668,7 +1713,13 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 1, entry, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (disconnect west " + "bdry) = " + << flag << endl; + return -1; + } } } @@ -1692,7 +1743,13 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 1, entry, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (disconnect east " + "bdry) = " + << flag << endl; + return -1; + } } } @@ -1716,7 +1773,13 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 1, entry, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (disconnect south " + "bdry) = " + << flag << endl; + return -1; + } } } @@ -1740,7 +1803,13 @@ static int Jac(UserData* udata) // Modify the matrix flag = HYPRE_StructMatrixSetBoxValues(Jmatrix, bc_ilower, bc_iupper, 1, entry, work); - if (flag != 0) { return -1; } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues (disconnect north " + "bdry) = " + << flag << endl; + return -1; + } } } } @@ -1781,7 +1850,11 @@ static int ScaleAddI(UserData* udata, sunrealtype gamma) // Copy all matrix values into work array from J flag = HYPRE_StructMatrixGetBoxValues(udata->Jmatrix, ilower, iupper, 5, entries, work); - if (flag != 0) { return (flag); } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixGetBoxValues = " << flag << endl; + return (flag); + } // Scale work array by c for (HYPRE_Int i = 0; i < nwork; i++) { work[i] *= -gamma; } @@ -1789,7 +1862,11 @@ static int ScaleAddI(UserData* udata, sunrealtype gamma) // Insert scaled values into A flag = HYPRE_StructMatrixSetBoxValues(udata->Amatrix, ilower, iupper, 5, entries, work); - if (flag != 0) { return (flag); } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixSetBoxValues = " << flag << endl; + return (flag); + } // Set first 1/5 of work array to 1 for (HYPRE_Int i = 0; i < nwork / 5; i++) { work[i] = ONE; } @@ -1798,7 +1875,11 @@ static int ScaleAddI(UserData* udata, sunrealtype gamma) HYPRE_Int entry[1] = {0}; flag = HYPRE_StructMatrixAddToBoxValues(udata->Amatrix, ilower, iupper, 1, entry, work); - if (flag != 0) { return (flag); } + if (flag != 0) + { + cerr << "Error in HYPRE_StructMatrixAddToBoxValues = " << flag << endl; + return (flag); + } // Return success return 0; diff --git a/examples/arkode/CXX_serial/CMakeLists.txt b/examples/arkode/CXX_serial/CMakeLists.txt index cdd673c777..a8bdf871af 100644 --- a/examples/arkode/CXX_serial/CMakeLists.txt +++ b/examples/arkode/CXX_serial/CMakeLists.txt @@ -22,6 +22,7 @@ set(ARKODE_examples "ark_analytic_sys.cpp\;\;develop" "ark_heat2D.cpp\;\;develop" + "ark_heat2D_lsrk.cpp\;\;exclude-single" "ark_kpr_Mt.cpp\;0 5\;develop" "ark_kpr_Mt.cpp\;1 4\;develop" "ark_kpr_Mt.cpp\;2 8 0 -10\;develop" diff --git a/examples/arkode/CXX_serial/ark_heat2D_lsrk.cpp b/examples/arkode/CXX_serial/ark_heat2D_lsrk.cpp new file mode 100644 index 0000000000..52549e1544 --- /dev/null +++ b/examples/arkode/CXX_serial/ark_heat2D_lsrk.cpp @@ -0,0 +1,986 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * + * (adapted from ark_heat2D.cpp, co-authored by Daniel Reynolds and David + * Gardner (LLNL)) + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Example problem: + * + * The following test simulates a simple anisotropic 2D heat equation, + * + * u_t = kx u_xx + ky u_yy + b, + * + * TO-DO: update this to kx(t) and ky(t), and determine the corresponding + * changes required for b to ensure the same analytical solution. + * + * for t in [0, 1] and (x,y) in [0, 1]^2, with initial condition + * + * u(0,x,y) = sin^2(pi x) sin^2(pi y), + * + * stationary boundary conditions + * + * u_t(t,0,y) = u_t(t,1,y) = u_t(t,x,0) = u_t(t,x,1) = 0, + * + * and the heat source + * + * b(t,x,y) = -2 pi sin^2(pi x) sin^2(pi y) sin(pi t) cos(pi t) + * - kx 2 pi^2 (cos^2(pi x) - sin^2(pi x)) sin^2(pi y) cos^2(pi t) + * - ky 2 pi^2 (cos^2(pi y) - sin^2(pi y)) sin^2(pi x) cos^2(pi t). + * + * Under this setup, the problem has the analytical solution + * + * u(t,x,y) = sin^2(pi x) sin^2(pi y) cos^2(pi t). + * + * The spatial derivatives are computed using second-order centered differences, + * with the data distributed over nx * ny points on a uniform spatial grid. The + * problem is advanced in time with the LSRKStep module in ARKODE. + * Several command line options are available to change the problem parameters + * and ARKODE settings. Use the flag --help for more information. + * ---------------------------------------------------------------------------*/ + +#include <chrono> +#include <cmath> +#include <cstdio> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <limits> +#include <string> + +#include "arkode/arkode_lsrkstep.h" // access to LSRKStep +#include "nvector/nvector_serial.h" // access to the serial N_Vector +#include "sunadaptcontroller/sunadaptcontroller_imexgus.h" +#include "sunadaptcontroller/sunadaptcontroller_soderlind.h" + +// Macros for problem constants +#define PI SUN_RCONST(3.141592653589793238462643383279502884197169) +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define EIGHT SUN_RCONST(8.0) + +// Macro to access (x,y) location in 1D NVector array +#define IDX(x, y, n) ((n) * (y) + (x)) + +using namespace std; + +// ----------------------------------------------------------------------------- +// User data structure +// ----------------------------------------------------------------------------- + +struct UserData +{ + // Diffusion coefficients in the x and y directions + sunrealtype kx; + sunrealtype ky; + + // Enable/disable forcing + bool forcing; + + // Final time + sunrealtype tf; + + // Upper bounds in x and y directions + sunrealtype xu; + sunrealtype yu; + + // Number of nodes in the x and y directions + sunindextype nx; + sunindextype ny; + + // Total number of nodes + sunindextype nodes; + + // Mesh spacing in the x and y directions + sunrealtype dx; + sunrealtype dy; + + // Integrator settings + sunrealtype rtol; // relative tolerance + sunrealtype atol; // absolute tolerance + sunrealtype hfixed; // fixed step size + int controller; // step size adaptivity method + int maxsteps; // max number of steps between outputs + bool diagnostics; // output diagnostics + + // LSRKStep options + ARKODE_LSRKMethodType method; // LSRK method choice + long int eigfrequency; // dominant eigenvalue update frequency + int stage_max_limit; // maximum number of stages per step + sunrealtype eigsafety; // dominant eigenvalue safety factor + + // Output variables + int output; // output level + int nout; // number of output times + ofstream uout; // output file stream + ofstream eout; // error file stream + N_Vector e; // error vector + + // Timing variables + bool timing; // print timings + double evolvetime; + double rhstime; +}; + +// ----------------------------------------------------------------------------- +// Functions provided to the SUNDIALS integrator +// ----------------------------------------------------------------------------- + +// ODE right hand side function +static int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data); + +// Spectral radius estimation routine +static int eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3); + +// ----------------------------------------------------------------------------- +// UserData and input functions +// ----------------------------------------------------------------------------- + +// Set the default values in the UserData structure +static int InitUserData(UserData* udata); + +// Free memory allocated within UserData +static int FreeUserData(UserData* udata); + +// Read the command line inputs and set UserData values +static int ReadInputs(int* argc, char*** argv, UserData* udata); + +// ----------------------------------------------------------------------------- +// Output and utility functions +// ----------------------------------------------------------------------------- + +// Compute the true solution +static int Solution(sunrealtype t, N_Vector u, UserData* udata); + +// Compute the solution error solution +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata); + +// Print the command line options +static void InputHelp(); + +// Print some UserData information +static int PrintUserData(UserData* udata); + +// Output solution and error +static int OpenOutput(UserData* udata); +static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata); +static int CloseOutput(UserData* udata); + +// Print integration timing +static int OutputTiming(UserData* udata); + +// Check function return values +static int check_flag(void* flagvalue, const string funcname, int opt); + +// ----------------------------------------------------------------------------- +// Main Program +// ----------------------------------------------------------------------------- + +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 + void* arkode_mem = NULL; // ARKODE memory structure + SUNAdaptController C = NULL; // Adaptivity controller + + // Timing variables + chrono::time_point<chrono::steady_clock> t1; + chrono::time_point<chrono::steady_clock> t2; + + // Create the SUNDIALS context object for this simulation + SUNContext ctx; + flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + // --------------- + // Setup UserData + // --------------- + + // Allocate and initialize user data structure with default values. The + // defaults may be overwritten by command line inputs in ReadInputs below. + udata = new UserData; + flag = InitUserData(udata); + if (check_flag(&flag, "InitUserData", 1)) { return 1; } + + // Parse command line inputs + flag = ReadInputs(&argc, &argv, udata); + if (flag != 0) { return 1; } + + // Output problem setup/options + flag = PrintUserData(udata); + if (check_flag(&flag, "PrintUserData", 1)) { return 1; } + + if (udata->diagnostics) + { + SUNLogger logger = NULL; + + flag = SUNContext_GetLogger(ctx, &logger); + if (check_flag(&flag, "SUNContext_GetLogger", 1)) { return 1; } + + flag = SUNLogger_SetInfoFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetInfoFilename", 1)) { return 1; } + + flag = SUNLogger_SetDebugFilename(logger, "diagnostics.txt"); + if (check_flag(&flag, "SUNLogger_SetDebugFilename", 1)) { return 1; } + } + + // ---------------------- + // Create serial vectors + // ---------------------- + + // Create vector for solution + u = N_VNew_Serial(udata->nodes, ctx); + if (check_flag((void*)u, "N_VNew_Serial", 0)) { return 1; } + + // Set initial condition + flag = Solution(ZERO, u, udata); + if (check_flag(&flag, "Solution", 1)) { return 1; } + + // Create vector for error + udata->e = N_VClone(u); + if (check_flag((void*)(udata->e), "N_VClone", 0)) { return 1; } + + // -------------- + // Setup ARKODE + // -------------- + + // Create integrator + arkode_mem = LSRKStepCreateSTS(f, ZERO, u, ctx); + if (check_flag((void*)arkode_mem, "LSRKStepCreateSTS", 0)) { return 1; } + + // Specify tolerances + flag = ARKodeSStolerances(arkode_mem, udata->rtol, udata->atol); + if (check_flag(&flag, "ARKodeSStolerances", 1)) { return 1; } + + // Attach user data + flag = ARKodeSetUserData(arkode_mem, (void*)udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + // Select LSRK method + flag = LSRKStepSetSTSMethod(arkode_mem, udata->method); + if (check_flag(&flag, "LSRKStepSetSTSMethod", 1)) { return 1; } + + // Select LSRK spectral radius function and options + flag = LSRKStepSetDomEigFn(arkode_mem, eig); + if (check_flag(&flag, "LSRKStepSetDomEigFn", 1)) { return 1; } + flag = LSRKStepSetDomEigFrequency(arkode_mem, udata->eigfrequency); + if (check_flag(&flag, "LSRKStepSetDomEigFrequency", 1)) { return 1; } + + // Set maximum number of stages per step + flag = LSRKStepSetMaxNumStages(arkode_mem, udata->stage_max_limit); + if (check_flag(&flag, "LSRKStepSetMaxNumStages", 1)) { return 1; } + + // Set spectral radius safety factor + flag = LSRKStepSetDomEigSafetyFactor(arkode_mem, udata->eigsafety); + if (check_flag(&flag, "LSRKStepSetDomEigSafetyFactor", 1)) { return 1; } + + // Set fixed step size or adaptivity method + if (udata->hfixed > ZERO) + { + flag = ARKodeSetFixedStep(arkode_mem, udata->hfixed); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + } + else + { + 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 = ARKodeSetAdaptController(arkode_mem, C); + if (check_flag(&flag, "ARKodeSetAdaptController", 1)) { return 1; } + } + + // Set max steps between outputs + flag = ARKodeSetMaxNumSteps(arkode_mem, udata->maxsteps); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + // Set stopping time + flag = ARKodeSetStopTime(arkode_mem, udata->tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + + // ----------------------- + // Loop over output times + // ----------------------- + + sunrealtype t = ZERO; + sunrealtype dTout = udata->tf / udata->nout; + sunrealtype tout = dTout; + + // initial output + flag = OpenOutput(udata); + if (check_flag(&flag, "OpenOutput", 1)) { return 1; } + + flag = WriteOutput(t, u, udata); + if (check_flag(&flag, "WriteOutput", 1)) { return 1; } + + for (int iout = 0; iout < udata->nout; iout++) + { + // Start timer + t1 = chrono::steady_clock::now(); + + // Evolve in time + flag = ARKodeEvolve(arkode_mem, tout, u, &t, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + + // Stop timer + t2 = chrono::steady_clock::now(); + + // Update timer + udata->evolvetime += chrono::duration<double>(t2 - t1).count(); + + // Output solution and error + flag = WriteOutput(t, u, udata); + if (check_flag(&flag, "WriteOutput", 1)) { return 1; } + + // Update output time + tout += dTout; + tout = (tout > udata->tf) ? udata->tf : tout; + } + + // Close output + flag = CloseOutput(udata); + if (check_flag(&flag, "CloseOutput", 1)) { return 1; } + + // -------------- + // Final outputs + // -------------- + + // Print final integrator stats + if (udata->output > 0) + { + cout << "Final integrator statistics:" << endl; + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + } + + if (udata->forcing) + { + // Output final error + flag = SolutionError(t, u, udata->e, udata); + if (check_flag(&flag, "SolutionError", 1)) { return 1; } + + sunrealtype maxerr = N_VMaxNorm(udata->e); + + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " Max error = " << maxerr << endl; + } + + // Print timing + if (udata->timing) + { + flag = OutputTiming(udata); + if (check_flag(&flag, "OutputTiming", 1)) { return 1; } + } + + // -------------------- + // Clean up and return + // -------------------- + + ARKodeFree(&arkode_mem); // Free integrator memory + 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; +} + +// ----------------------------------------------------------------------------- +// Functions called by the integrator +// ----------------------------------------------------------------------------- + +// f routine to compute the ODE RHS function f(t,y). +static int f(sunrealtype t, N_Vector u, N_Vector f, void* user_data) +{ + // Timing variables + chrono::time_point<chrono::steady_clock> t1; + chrono::time_point<chrono::steady_clock> t2; + + // Start timer + t1 = chrono::steady_clock::now(); + + // Access problem data + UserData* udata = (UserData*)user_data; + + // Shortcuts to number of nodes + sunindextype nx = udata->nx; + sunindextype ny = udata->ny; + + // Constants for computing diffusion term + sunrealtype cx = udata->kx / (udata->dx * udata->dx); + sunrealtype cy = udata->ky / (udata->dy * udata->dy); + sunrealtype cc = -TWO * (cx + cy); + + // Access data arrays + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + sunrealtype* farray = N_VGetArrayPointer(f); + if (check_flag((void*)farray, "N_VGetArrayPointer", 0)) { return -1; } + + // Initialize rhs vector to zero (handles boundary conditions) + N_VConst(ZERO, f); + + // Iterate over domain interior and compute rhs forcing term + if (udata->forcing) + { + sunrealtype x, y; + sunrealtype sin_sqr_x, sin_sqr_y; + sunrealtype cos_sqr_x, cos_sqr_y; + + sunrealtype bx = (udata->kx) * TWO * PI * PI; + sunrealtype by = (udata->ky) * TWO * PI * PI; + + sunrealtype sin_t_cos_t = sin(PI * t) * cos(PI * t); + sunrealtype cos_sqr_t = cos(PI * t) * cos(PI * t); + + for (sunindextype j = 1; j < ny - 1; j++) + { + for (sunindextype i = 1; i < nx - 1; i++) + { + x = i * udata->dx; + y = j * udata->dy; + + sin_sqr_x = sin(PI * x) * sin(PI * x); + sin_sqr_y = sin(PI * y) * sin(PI * y); + + cos_sqr_x = cos(PI * x) * cos(PI * x); + cos_sqr_y = cos(PI * y) * cos(PI * y); + + farray[IDX(i, j, nx)] = + -TWO * PI * sin_sqr_x * sin_sqr_y * sin_t_cos_t - + bx * (cos_sqr_x - sin_sqr_x) * sin_sqr_y * cos_sqr_t - + by * (cos_sqr_y - sin_sqr_y) * sin_sqr_x * cos_sqr_t; + } + } + } + + // Iterate over domain interior and add rhs diffusion term + for (sunindextype j = 1; j < ny - 1; j++) + { + for (sunindextype i = 1; i < nx - 1; i++) + { + farray[IDX(i, j, nx)] += + cc * uarray[IDX(i, j, nx)] + + cx * (uarray[IDX(i - 1, j, nx)] + uarray[IDX(i + 1, j, nx)]) + + cy * (uarray[IDX(i, j - 1, nx)] + uarray[IDX(i, j + 1, nx)]); + } + } + + // Stop timer + t2 = chrono::steady_clock::now(); + + // Update timer + udata->rhstime += chrono::duration<double>(t2 - t1).count(); + + // Return success + return 0; +} + +// Spectral radius estimation routine +static int eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3) +{ + // Access problem data + UserData* udata = (UserData*)user_data; + + // Fill in spectral radius value + *lambdaR = -SUN_RCONST(8.0) * max(udata->kx / udata->dx / udata->dx, + udata->ky / udata->dy / udata->dy); + *lambdaI = SUN_RCONST(0.0); + + // return with success + return 0; +} + +// ----------------------------------------------------------------------------- +// UserData and input functions +// ----------------------------------------------------------------------------- + +// Initialize memory allocated within Userdata +static int InitUserData(UserData* udata) +{ + // Diffusion coefficient + udata->kx = SUN_RCONST(10.0); + udata->ky = SUN_RCONST(10.0); + + // Enable forcing + udata->forcing = true; + + // Final time + udata->tf = ONE; + + // Upper bounds in x and y directions + udata->xu = ONE; + udata->yu = ONE; + + // Number of nodes in the x and y directions + udata->nx = 64; + udata->ny = 64; + udata->nodes = udata->nx * udata->ny; + + // Mesh spacing in the x and y directions + udata->dx = udata->xu / (udata->nx - 1); + udata->dy = udata->yu / (udata->ny - 1); + + // Integrator settings + udata->rtol = SUN_RCONST(1.e-5); // relative tolerance + udata->atol = SUN_RCONST(1.e-10); // absolute tolerance + udata->hfixed = ZERO; // using adaptive step sizes + udata->controller = 0; // PID controller + udata->maxsteps = 0; // use default + udata->diagnostics = false; // output diagnostics + + // LSRKStep options + udata->method = ARKODE_LSRK_RKC_2; // RKC + udata->eigfrequency = 25; // update eigenvalue at least every 20 steps + udata->stage_max_limit = 1000; // allow up to 1000 stages/step + udata->eigsafety = SUN_RCONST(1.01); // 1% safety factor + + // Output variables + udata->output = 1; // 0 = no output, 1 = stats output, 2 = output to disk + udata->nout = 20; // Number of output times + udata->e = NULL; + + // Timing variables + udata->timing = false; + udata->evolvetime = 0.0; + udata->rhstime = 0.0; + + // Return success + return 0; +} + +// Free memory allocated within Userdata +static int FreeUserData(UserData* udata) +{ + // Free error vector + if (udata->e) + { + N_VDestroy(udata->e); + udata->e = NULL; + } + + // Return success + return 0; +} + +// Read command line inputs +static int ReadInputs(int* argc, char*** argv, UserData* udata) +{ + // Check for input args + int arg_idx = 1; + + while (arg_idx < (*argc)) + { + string arg = (*argv)[arg_idx++]; + + // Mesh points + if (arg == "--mesh") + { + udata->nx = stoi((*argv)[arg_idx++]); + udata->ny = stoi((*argv)[arg_idx++]); + } + // Domain upper bounds + else if (arg == "--domain") + { + udata->xu = stoi((*argv)[arg_idx++]); + udata->yu = stoi((*argv)[arg_idx++]); + } + // Diffusion parameters + else if (arg == "--k") + { + udata->kx = stod((*argv)[arg_idx++]); + udata->ky = stod((*argv)[arg_idx++]); + } + // Disable forcing + else if (arg == "--noforcing") { udata->forcing = false; } + // Temporal domain settings + else if (arg == "--tf") { udata->tf = stod((*argv)[arg_idx++]); } + // Integrator settings + else if (arg == "--rtol") { udata->rtol = stod((*argv)[arg_idx++]); } + else if (arg == "--atol") { udata->atol = stod((*argv)[arg_idx++]); } + else if (arg == "--fixedstep") { udata->hfixed = stod((*argv)[arg_idx++]); } + else if (arg == "--controller") + { + udata->controller = stoi((*argv)[arg_idx++]); + } + else if (arg == "--diagnostics") { udata->diagnostics = true; } + else if (arg == "--method") + { + udata->method = (ARKODE_LSRKMethodType)stoi((*argv)[arg_idx++]); + } + else if (arg == "--eigfrequency") + { + udata->eigfrequency = stoi((*argv)[arg_idx++]); + } + else if (arg == "--stage_max_limit") + { + udata->stage_max_limit = stoi((*argv)[arg_idx++]); + } + else if (arg == "--eigsafety") + { + udata->eigsafety = stod((*argv)[arg_idx++]); + } + // Output settings + else if (arg == "--output") { udata->output = stoi((*argv)[arg_idx++]); } + else if (arg == "--nout") { udata->nout = stoi((*argv)[arg_idx++]); } + else if (arg == "--maxsteps") + { + udata->maxsteps = stoi((*argv)[arg_idx++]); + } + else if (arg == "--timing") { udata->timing = true; } + // Help + else if (arg == "--help") + { + InputHelp(); + return -1; + } + // Unknown input + else + { + cerr << "ERROR: Invalid input " << arg << endl; + InputHelp(); + return -1; + } + } + + // Recompute total number of nodes + udata->nodes = udata->nx * udata->ny; + + // Recompute x and y mesh spacing + udata->dx = (udata->xu) / (udata->nx - 1); + udata->dy = (udata->yu) / (udata->ny - 1); + + // Return success + return 0; +} + +// ----------------------------------------------------------------------------- +// Output and utility functions +// ----------------------------------------------------------------------------- + +// Compute the exact solution +static int Solution(sunrealtype t, N_Vector u, UserData* udata) +{ + sunrealtype x, y; + sunrealtype cos_sqr_t; + sunrealtype sin_sqr_x, sin_sqr_y; + + // Constants for computing solution + cos_sqr_t = cos(PI * t) * cos(PI * t); + + // Initialize u to zero (handles boundary conditions) + N_VConst(ZERO, u); + + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + for (sunindextype j = 1; j < udata->ny - 1; j++) + { + for (sunindextype i = 1; i < udata->nx - 1; i++) + { + x = i * udata->dx; + y = j * udata->dy; + + sin_sqr_x = sin(PI * x) * sin(PI * x); + sin_sqr_y = sin(PI * y) * sin(PI * y); + + uarray[IDX(i, j, udata->nx)] = sin_sqr_x * sin_sqr_y * cos_sqr_t; + } + } + + return 0; +} + +// Compute the solution error +static int SolutionError(sunrealtype t, N_Vector u, N_Vector e, UserData* udata) +{ + // Compute true solution + int flag = Solution(t, e, udata); + if (flag != 0) { return -1; } + + // Compute absolute error + N_VLinearSum(ONE, u, -ONE, e, e); + N_VAbs(e, e); + + return 0; +} + +// Print command line options +static void InputHelp() +{ + cout << endl; + cout << "Command line options:" << endl; + cout << " --mesh <nx> <ny> : mesh points in the x and y directions" + << endl; + cout + << " --domain <xu> <yu> : domain upper bound in the x and y direction" + << endl; + cout << " --k <kx> <ky> : diffusion coefficients" << endl; + cout << " --noforcing : disable forcing term" << endl; + cout << " --tf <time> : final time" << endl; + cout << " --rtol <rtol> : relative tolerance" << endl; + cout << " --atol <atol> : absolute tolerance" << endl; + cout << " --fixedstep <step> : used fixed step size" << endl; + cout << " --controller <ctr> : time step adaptivity controller" << endl; + cout << " --method <mth> : LSRK method choice" << endl; + cout << " --eigfrequency <nst> : dominant eigenvalue update frequency" + << endl; + cout << " --stage_max_limit <smax> : maximum number of stages per step" + << endl; + cout << " --eigsafety <safety> : dominant eigenvalue safety factor" << endl; + cout << " --diagnostics : output diagnostics" << endl; + cout << " --output <level> : output level" << endl; + cout << " --nout <nout> : number of outputs" << endl; + cout << " --maxsteps <steps> : max steps between outputs" << endl; + cout << " --timing : print timing data" << endl; + cout << " --help : print this message and exit" << endl; +} + +// Print user data +static int PrintUserData(UserData* udata) +{ + cout << endl; + cout << "2D Heat PDE test problem:" << endl; + cout << " --------------------------------- " << endl; + cout << " kx = " << udata->kx << endl; + cout << " ky = " << udata->ky << endl; + cout << " forcing = " << udata->forcing << endl; + cout << " tf = " << udata->tf << endl; + cout << " xu = " << udata->xu << endl; + cout << " yu = " << udata->yu << endl; + cout << " nx = " << udata->nx << endl; + cout << " ny = " << udata->ny << endl; + cout << " dx = " << udata->dx << endl; + cout << " dy = " << udata->dy << endl; + cout << " --------------------------------- " << endl; + cout << " rtol = " << udata->rtol << endl; + cout << " atol = " << udata->atol << endl; + cout << " fixed h = " << udata->hfixed << endl; + cout << " controller = " << udata->controller << endl; + cout << " method = " << udata->method << endl; + cout << " eigfrequency = " << udata->eigfrequency << endl; + cout << " stage_max_limit = " << udata->stage_max_limit << endl; + cout << " eigsafety = " << udata->eigsafety << endl; + cout << " --------------------------------- " << endl; + cout << " output = " << udata->output << endl; + cout << " max steps = " << udata->maxsteps << endl; + cout << " --------------------------------- " << endl; + cout << endl; + + return 0; +} + +// Initialize output +static int OpenOutput(UserData* udata) +{ + // Header for status output + if (udata->output > 0) + { + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + if (udata->forcing) + { + cout << " t "; + cout << " ||u||_rms "; + cout << " max error " << endl; + cout << " ---------------------"; + cout << "-------------------------"; + cout << "-------------------------" << endl; + } + else + { + cout << " t "; + cout << " ||u||_rms " << endl; + cout << " ---------------------"; + cout << "-------------------------" << endl; + } + } + + // Output problem information and open output streams + if (udata->output == 2) + { + // Each processor outputs subdomain information + ofstream dout; + dout.open("heat2d_info.txt"); + dout << "xu " << udata->xu << endl; + dout << "yu " << udata->yu << endl; + dout << "nx " << udata->nx << endl; + dout << "ny " << udata->ny << endl; + dout << "nt " << udata->nout + 1 << endl; + dout.close(); + + // Open output streams for solution and error + udata->uout.open("heat2d_solution.txt"); + udata->uout << scientific; + udata->uout << setprecision(numeric_limits<sunrealtype>::digits10); + + if (udata->forcing) + { + udata->eout.open("heat2d_error.txt"); + udata->eout << scientific; + udata->eout << setprecision(numeric_limits<sunrealtype>::digits10); + } + } + + return 0; +} + +// Write output +static int WriteOutput(sunrealtype t, N_Vector u, UserData* udata) +{ + int flag; + + if (udata->output > 0) + { + // Compute rms norm of the state + sunrealtype urms = sqrt(N_VDotProd(u, u) / udata->nx / udata->ny); + + // Output current status + if (udata->forcing) + { + // Compute the error + flag = SolutionError(t, u, udata->e, udata); + if (check_flag(&flag, "SolutionError", 1)) { return 1; } + + // Compute max error + sunrealtype max = N_VMaxNorm(udata->e); + + cout << setw(22) << t << setw(25) << urms << setw(25) << max << endl; + } + else { cout << setw(22) << t << setw(25) << urms << endl; } + + // Write solution and error to disk + if (udata->output == 2) + { + sunrealtype* uarray = N_VGetArrayPointer(u); + if (check_flag((void*)uarray, "N_VGetArrayPointer", 0)) { return -1; } + + udata->uout << t << " "; + for (sunindextype i = 0; i < udata->nodes; i++) + { + udata->uout << uarray[i] << " "; + } + udata->uout << endl; + + if (udata->forcing) + { + // Output error to disk + sunrealtype* earray = N_VGetArrayPointer(udata->e); + if (check_flag((void*)earray, "N_VGetArrayPointer", 0)) { return -1; } + + udata->eout << t << " "; + for (sunindextype i = 0; i < udata->nodes; i++) + { + udata->eout << earray[i] << " "; + } + udata->eout << endl; + } + } + } + + return 0; +} + +// Finalize output +static int CloseOutput(UserData* udata) +{ + // Footer for status output + if (udata->output > 0) + { + if (udata->forcing) + { + cout << " ---------------------"; + cout << "-------------------------"; + cout << "-------------------------" << endl; + cout << endl; + } + else + { + cout << " ---------------------"; + cout << "-------------------------" << endl; + cout << endl; + } + } + + if (udata->output == 2) + { + // Close output streams + udata->uout.close(); + if (udata->forcing) { udata->eout.close(); } + } + + return 0; +} + +static int OutputTiming(UserData* udata) +{ + cout << scientific; + cout << setprecision(6); + + cout << " Evolve time = " << udata->evolvetime << " sec" << endl; + cout << " RHS time = " << udata->rhstime << " sec" << endl; + cout << endl; + + return 0; +} + +// Check function return value +static int check_flag(void* flagvalue, const string funcname, int opt) +{ + // Check if the function returned a NULL pointer + if (opt == 0) + { + if (flagvalue == NULL) + { + cerr << endl + << "ERROR: " << funcname << " returned NULL pointer" << endl + << endl; + return 1; + } + } + // Check the function return flag value + else if (opt == 1 || opt == 2) + { + int errflag = *((int*)flagvalue); + if ((opt == 1 && errflag < 0) || (opt == 2 && errflag != 0)) + { + cerr << endl + << "ERROR: " << funcname << " returned with flag = " << errflag << endl + << endl; + return 1; + } + } + else + { + cerr << endl + << "ERROR: check_flag called with an invalid option value" << endl; + return 1; + } + + return 0; +} + +//---- end of file ---- diff --git a/examples/arkode/CXX_serial/ark_heat2D_lsrk.out b/examples/arkode/CXX_serial/ark_heat2D_lsrk.out new file mode 100644 index 0000000000..90a997b1ec --- /dev/null +++ b/examples/arkode/CXX_serial/ark_heat2D_lsrk.out @@ -0,0 +1,71 @@ + +2D Heat PDE test problem: + --------------------------------- + kx = 10 + ky = 10 + forcing = 1 + tf = 1 + xu = 1 + yu = 1 + nx = 64 + ny = 64 + dx = 0.015873 + dy = 0.015873 + --------------------------------- + rtol = 1e-05 + atol = 1e-10 + fixed h = 0 + controller = 0 + method = 0 + eigfrequency = 25 + stage_max_limit = 1000 + eigsafety = 1.01 + --------------------------------- + output = 1 + max steps = 0 + --------------------------------- + + t ||u||_rms max error + ----------------------------------------------------------------------- + 0.000000000000000e+00 3.691406250000004e-01 0.000000000000000e+00 + 5.000000000000000e-02 3.604068953520301e-01 8.105295841017712e-04 + 1.000000000000000e-01 3.341701389350745e-01 7.545034505144210e-04 + 1.500000000000000e-01 2.933045814980530e-01 6.655020848065352e-04 + 2.000000000000000e-01 2.418102694052765e-01 5.516214332939029e-04 + 2.500000000000000e-01 1.847278700505845e-01 4.242334056734909e-04 + 3.000000000000000e-01 1.276450308939409e-01 2.958580782215225e-04 + 3.500000000000000e-01 7.614944266700012e-02 1.791094087538192e-04 + 4.000000000000000e-01 3.528179910107998e-02 8.530904691973762e-05 + 4.500000000000000e-01 9.042542522688570e-03 2.370608964642751e-05 + 4.999999999999999e-01 1.483315165963637e-07 3.059603009336159e-07 + 5.499999999999999e-01 9.039739042933443e-03 1.741090628159039e-05 + 6.000000000000000e-01 3.527647409317574e-02 7.335124075792676e-05 + 6.500000000000000e-01 7.614211328474822e-02 1.626500505197415e-04 + 7.000000000000001e-01 1.276364431261110e-01 2.765661025802557e-04 + 7.500000000000001e-01 1.847188398303503e-01 4.039484934804660e-04 + 8.000000000000002e-01 2.418016806916353e-01 5.323281462729090e-04 + 8.500000000000002e-01 2.932973330370502e-01 6.492070720421905e-04 + 9.000000000000002e-01 3.341649712654264e-01 7.429941073312518e-04 + 9.500000000000003e-01 3.604042250428761e-01 8.045913926612025e-04 + 1.000000000000000e+00 3.694466133676554e-01 8.279696748304533e-04 + ----------------------------------------------------------------------- + +Final integrator statistics: +Current time = 1 +Steps = 617 +Step attempts = 617 +Stability limited steps = 0 +Accuracy limited steps = 617 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 2.877680248425025e-06 +Last step size = 0.0003199001977636226 +Current step size = 0.0003199001977636226 +RHS fn evals = 17225 +Number of dom_eig updates = 25 +Max. num. of stages used = 46 +Max. num. of stages allowed = 1000 +Max. spectral radius = 320695.2 +Min. spectral radius = 320695.2 + Max error = 8.279696748304533e-04 diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index fbba99ffb9..de26c61e18 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -23,8 +23,11 @@ set(ARKODE_examples # tests that are always run "ark_analytic\;\;" # develop tests + "ark_analytic_lsrk\;\;develop" + "ark_analytic_lsrk_varjac\;\;develop" "ark_analytic_mels\;\;develop" "ark_analytic_nonlin\;\;develop" + "ark_analytic_ssprk\;\;develop" "ark_brusselator_1D_mri\;\;develop" "ark_brusselator_fp\;\;exclude-single" "ark_brusselator_mri\;\;develop" diff --git a/examples/arkode/C_serial/ark_analytic_lsrk.c b/examples/arkode/C_serial/ark_analytic_lsrk.c new file mode 100644 index 0000000000..7f184a7f90 --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_lsrk.c @@ -0,0 +1,328 @@ +/*----------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Example problem: + * + * The following is a simple example problem with analytical + * solution, + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) + * for t in the interval [0.0, 10.0], with initial condition: y=0. + * + * The stiffness of the problem is directly proportional to the + * value of "lambda". The value of lambda should be negative to + * result in a well-posed ODE; for values with magnitude larger + * than 100 the problem becomes quite stiff. + * + * This program solves the problem with the LSRK method. + * Output is printed every 1.0 units of time (10 total). + * Run statistics (optional outputs) are printed at the end. + *-----------------------------------------------------------------*/ + +/* Header files */ +#include <arkode/arkode_lsrkstep.h> /* prototypes for LSRKStep fcts., consts */ +#include <math.h> +#include <nvector/nvector_serial.h> /* serial N_Vector types, fcts., macros */ +#include <stdio.h> +#include <sundials/sundials_math.h> /* def. of SUNRsqrt, etc. */ +#include <sundials/sundials_types.h> /* definition of type sunrealtype */ + +#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 + +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define ATAN(x) (atan((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define ATAN(x) (atanf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define ATAN(x) (atanl((x))) +#endif + +/* User-supplied Functions Called by the Solver */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); + +/* User-supplied Dominated Eigenvalue Called by the Solver */ +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3); + +/* Private function to check function return values */ +static int check_flag(void* flagvalue, const char* funcname, int opt); + +/* Private function to check computed solution */ +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, + sunrealtype atol); + +/* Private function to compute error */ +static int compute_error(N_Vector y, sunrealtype t); + +/* Main Program */ +int main(void) +{ + /* general problem parameters */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ + sunindextype NEQ = 1; /* number of dependent vars. */ + +#if defined(SUNDIALS_DOUBLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1000000.0); /* stiffness parameter */ +#elif defined(SUNDIALS_SINGLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1000.0); /* stiffness parameter */ +#elif defined(SUNDIALS_EXTENDED_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1000000.0); /* stiffness parameter */ +#endif + + /* general problem variables */ + int flag; /* reusable error-checking flag */ + N_Vector y = NULL; /* empty vector for storing solution */ + void* arkode_mem = NULL; /* empty ARKode memory structure */ + FILE *UFID, *FID; + sunrealtype t, tout; + + /* Create the SUNDIALS context object for this simulation */ + SUNContext ctx; + flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + /* Initial diagnostics output */ + printf("\nAnalytical ODE test problem:\n"); + printf(" lambda = %" GSYM "\n", lambda); + printf(" reltol = %.1" ESYM "\n", reltol); + printf(" abstol = %.1" ESYM "\n\n", abstol); + + /* Initialize data structures */ + y = N_VNew_Serial(NEQ, ctx); /* Create serial vector for solution */ + if (check_flag((void*)y, "N_VNew_Serial", 0)) { return 1; } + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ + + /* Call LSRKStepCreateSTS to initialize the ARK timestepper module and + specify the right-hand side function in y'=f(t,y), the initial time + T0, and the initial dependent variable vector y. */ + arkode_mem = LSRKStepCreateSTS(f, T0, y, ctx); + if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } + + /* Set routines */ + flag = ARKodeSetUserData(arkode_mem, + (void*)&lambda); /* Pass lambda to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + /* Specify tolerances */ + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + + /* Specify user provided spectral radius */ + flag = LSRKStepSetDomEigFn(arkode_mem, dom_eig); + if (check_flag(&flag, "LSRKStepSetDomEigFn", 1)) { return 1; } + + /* Specify after how many successful steps dom_eig is recomputed + Note that nsteps = 0 refers to constant dominant eigenvalue */ + flag = LSRKStepSetDomEigFrequency(arkode_mem, 0); + if (check_flag(&flag, "LSRKStepSetDomEigFrequency", 1)) { return 1; } + + /* Specify max number of stages allowed */ + flag = LSRKStepSetMaxNumStages(arkode_mem, 200); + if (check_flag(&flag, "LSRKStepSetMaxNumStages", 1)) { return 1; } + + /* Specify max number of steps allowed */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 1000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + /* Specify safety factor for user provided dom_eig */ + flag = LSRKStepSetDomEigSafetyFactor(arkode_mem, SUN_RCONST(1.01)); + if (check_flag(&flag, "LSRKStepSetDomEigSafetyFactor", 1)) { return 1; } + + /* Specify the Runge--Kutta--Legendre LSRK method */ + flag = LSRKStepSetSTSMethod(arkode_mem, ARKODE_LSRK_RKL_2); + if (check_flag(&flag, "LSRKStepSetSTSMethod", 1)) { return 1; } + + /* Open output stream for results, output comment line */ + UFID = fopen("solution.txt", "w"); + fprintf(UFID, "# t u\n"); + + /* output initial condition to disk */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, N_VGetArrayPointer(y)[0]); + + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + prints results. Stops when the final time has been reached */ + t = T0; + tout = T0 + dTout; + printf(" t u\n"); + printf(" ---------------------\n"); + while (Tf - t > SUN_RCONST(1.0e-15)) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + printf(" %10.6" FSYM " %10.6" FSYM "\n", t, + N_VGetArrayPointer(y)[0]); /* access/print solution */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", t, N_VGetArrayPointer(y)[0]); + if (flag < 0) + { /* unsuccessful solve: break */ + fprintf(stderr, "Solver failure, stopping integration\n"); + break; + } + else + { /* successful solve: update time */ + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + } + } + printf(" ---------------------\n"); + fclose(UFID); + + /* Print final statistics */ + printf("\nFinal Statistics:\n"); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + /* Print final statistics to a file in CSV format */ + FID = fopen("ark_analytic_nonlin_stats.csv", "w"); + flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + fclose(FID); + + /* check the solution error */ + flag = check_ans(y, t, reltol, abstol); + flag = compute_error(y, t); + + /* Clean up and return */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNContext_Free(&ctx); /* Free context */ + + return flag; +} + +/*------------------------------- + * Functions called by the solver + *-------------------------------*/ + +/* f routine to compute the ODE RHS function f(t,y). */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = N_VGetArrayPointer(y)[0]; /* access current solution value */ + + /* fill in the RHS function: "N_VGetArrayPointer" accesses the 0th entry of ydot */ + N_VGetArrayPointer(ydot)[0] = + lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * ATAN(t); + + return 0; /* return with success */ +} + +/* dom_eig routine to estimate the dominated eigenvalue */ +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3) +{ + sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + *lambdaR = lambda; + *lambdaI = SUN_RCONST(0.0); + return 0; /* return with success */ +} + +/*------------------------------- + * Private helper functions + *-------------------------------*/ + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a flag so check if + flag >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_flag(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with flag = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/* check the computed solution */ +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) +{ + int passfail = 0; /* answer pass (0) or fail (1) flag */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ + + /* compute solution error */ + ans = ATAN(t); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(N_VGetArrayPointer(y)[0] - ans); + + /* is the solution within the tolerances? */ + passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; + + if (passfail) + { + fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%" GSYM "\n\n", err); + } + + return (passfail); +} + +/* check the error */ +static int compute_error(N_Vector y, sunrealtype t) +{ + sunrealtype ans, err; /* answer data, error */ + + /* compute solution error */ + ans = ATAN(t); + err = SUNRabs(N_VGetArrayPointer(y)[0] - ans); + + fprintf(stdout, "\nACCURACY at the final time = %" GSYM "\n", err); + return 0; +} + +/*---- end of file ----*/ diff --git a/examples/arkode/C_serial/ark_analytic_lsrk.out b/examples/arkode/C_serial/ark_analytic_lsrk.out new file mode 100644 index 0000000000..5e58b272db --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_lsrk.out @@ -0,0 +1,40 @@ + +Analytical ODE test problem: + lambda = -1e+06 + reltol = 1.0e-08 + abstol = 1.0e-08 + + t u + --------------------- + 1.000000 0.785398 + 2.000000 1.107149 + 3.000000 1.249046 + 4.000000 1.325818 + 5.000000 1.373401 + 6.000000 1.405648 + 7.000000 1.428899 + 8.000000 1.446441 + 9.000000 1.460139 + 10.000000 1.471128 + --------------------- + +Final Statistics: +Current time = 10.00468816776983 +Steps = 1454 +Step attempts = 1457 +Stability limited steps = 30 +Accuracy limited steps = 1457 +Error test fails = 3 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 1.930101110942615e-10 +Last step size = 0.019104 +Current step size = 0.02996850857415225 +RHS fn evals = 160396 +Number of dom_eig updates = 1 +Max. num. of stages used = 196 +Max. num. of stages allowed = 200 +Max. spectral radius = 1010000 +Min. spectral radius = 1010000 + +ACCURACY at the final time = 9.76996e-14 \ No newline at end of file diff --git a/examples/arkode/C_serial/ark_analytic_lsrk_varjac.c b/examples/arkode/C_serial/ark_analytic_lsrk_varjac.c new file mode 100644 index 0000000000..b9642f9dcb --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_lsrk_varjac.c @@ -0,0 +1,364 @@ +/*----------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Example problem: + * + * The following is a simple example problem that solves the ODE + * + * dy/dt = (lambda - alpha*cos((10 - t)/10*pi)*y + 1/(1+t^2) + * - (lambda - alpha*cos((10 - t)/10*pi)*atan(t), + * + * for t in the interval [0.0, 10.0], with an initial condition: y=0. + * This initial value problem has the analytical solution + * + * y(t) = arctan(t). + * + * The stiffness of the problem depends on both lambda and alpha together. + * While lambda determines the center of the stiffness parameter, + * the value of alpha determines the radius of the interval in which + * the stiffness parameter lies. + * + * The value of lambda - alpha*cos((10 - t)/10*pi) should + * be negative to result in a well-posed ODE; for values with magnitude + * larger than 100 the problem becomes quite stiff. + * + * This program solves the problem with the LSRK method. + * Output is printed every 1.0 units of time (10 total). + * Run statistics (optional outputs) are printed at the end. + *-----------------------------------------------------------------*/ + +/* Header files */ +#include <arkode/arkode_lsrkstep.h> /* prototypes for LSRKStep fcts., consts */ +#include <math.h> +#include <nvector/nvector_serial.h> /* serial N_Vector types, fcts., macros */ +#include <stdio.h> +#include <sundials/sundials_math.h> /* def. of SUNRsqrt, etc. */ +#include <sundials/sundials_types.h> /* definition of type sunrealtype */ + +#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 + +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define ATAN(x) (atan((x))) +#define ACOS(x) (acos((x))) +#define COS(x) (cos((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define ATAN(x) (atanf((x))) +#define ACOS(x) (acosf((x))) +#define COS(x) (cosf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define ATAN(x) (atanl((x))) +#define ACOS(x) (acosl((x))) +#define COS(x) (cosl((x))) +#endif + +/* User-supplied Functions Called by the Solver */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); + +/* User-supplied Dominated Eigenvalue Called by the Solver */ +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3); + +/* Private function to check function return values */ +static int check_flag(void* flagvalue, const char* funcname, int opt); + +/* Private function to check computed solution */ +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, + sunrealtype atol); + +/* Private function to compute error */ +static int compute_error(N_Vector y, sunrealtype t); + +/* Main Program */ +int main(void) +{ + /* general problem parameters */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ + sunindextype NEQ = 1; /* number of dependent vars. */ + +#if defined(SUNDIALS_DOUBLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1.0e+6); /* stiffness parameter 1 */ + sunrealtype alpha = SUN_RCONST(1.0e+2); /* stiffness parameter 2 */ +#elif defined(SUNDIALS_SINGLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1.0e+3); /* stiffness parameter 1 */ + sunrealtype alpha = SUN_RCONST(1.0e+1); /* stiffness parameter 2 */ +#elif defined(SUNDIALS_EXTENDED_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-1.0e+6); /* stiffness parameter 1 */ + sunrealtype alpha = SUN_RCONST(1.0e+2); /* stiffness parameter 2 */ +#endif + + sunrealtype UserData[2]; + UserData[0] = lambda; + UserData[1] = alpha; + + /* general problem variables */ + int flag; /* reusable error-checking flag */ + N_Vector y = NULL; /* empty vector for storing solution */ + void* arkode_mem = NULL; /* empty ARKode memory structure */ + FILE *UFID, *FID; + sunrealtype t, tout; + + /* Create the SUNDIALS context object for this simulation */ + SUNContext ctx; + flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + /* Initial diagnostics output */ + printf("\nAnalytical ODE test problem with a variable Jacobian:"); + printf("\nThe stiffness of the problem is directly proportional to"); + printf("\n\"lambda - alpha*cos((10 - t)/10*pi)\"\n\n"); + printf(" lambda = %" GSYM "\n", lambda); + printf(" alpha = %" GSYM "\n", alpha); + printf(" reltol = %.1" ESYM "\n", reltol); + printf(" abstol = %.1" ESYM "\n\n", abstol); + + /* Initialize data structures */ + y = N_VNew_Serial(NEQ, ctx); /* Create serial vector for solution */ + if (check_flag((void*)y, "N_VNew_Serial", 0)) { return 1; } + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ + + /* Call LSRKStepCreateSTS to initialize the ARK timestepper module and + specify the right-hand side function in y'=f(t,y), the initial time + T0, and the initial dependent variable vector y. */ + arkode_mem = LSRKStepCreateSTS(f, T0, y, ctx); + if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } + + /* Set routines */ + flag = ARKodeSetUserData(arkode_mem, + (void*)&UserData); /* Pass lambda to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + /* Specify tolerances */ + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + + /* Specify user provided spectral radius */ + flag = LSRKStepSetDomEigFn(arkode_mem, dom_eig); + if (check_flag(&flag, "LSRKStepSetDomEigFn", 1)) { return 1; } + + /* Specify after how many successful steps dom_eig is recomputed */ + flag = LSRKStepSetDomEigFrequency(arkode_mem, 25); + if (check_flag(&flag, "LSRKStepSetDomEigFrequency", 1)) { return 1; } + + /* Specify max number of stages allowed */ + flag = LSRKStepSetMaxNumStages(arkode_mem, 200); + if (check_flag(&flag, "LSRKStepSetMaxNumStages", 1)) { return 1; } + + /* Specify max number of steps allowed */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 1000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + /* Specify safety factor for user provided dom_eig */ + flag = LSRKStepSetDomEigSafetyFactor(arkode_mem, SUN_RCONST(1.01)); + if (check_flag(&flag, "LSRKStepSetDomEigSafetyFactor", 1)) { return 1; } + + /* Specify the Runge--Kutta--Chebyshev LSRK method by name */ + flag = LSRKStepSetSTSMethodByName(arkode_mem, "ARKODE_LSRK_RKC_2"); + if (check_flag(&flag, "LSRKStepSetSTSMethodByName", 1)) { return 1; } + + /* Open output stream for results, output comment line */ + UFID = fopen("solution.txt", "w"); + fprintf(UFID, "# t u\n"); + + /* output initial condition to disk */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, N_VGetArrayPointer(y)[0]); + + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + prints results. Stops when the final time has been reached */ + t = T0; + tout = T0 + dTout; + printf(" t u\n"); + printf(" ---------------------\n"); + while (Tf - t > SUN_RCONST(1.0e-15)) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "LSRKodeEvolve", 1)) { break; } + printf(" %10.6" FSYM " %10.6" FSYM "\n", t, + N_VGetArrayPointer(y)[0]); /* access/print solution */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", t, N_VGetArrayPointer(y)[0]); + if (flag < 0) + { /* unsuccessful solve: break */ + fprintf(stderr, "Solver failure, stopping integration\n"); + break; + } + else + { /* successful solve: update time */ + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + } + } + printf(" ---------------------\n"); + fclose(UFID); + + /* Print final statistics */ + printf("\nFinal Statistics:\n"); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + /* Print final statistics to a file in CSV format */ + FID = fopen("ark_analytic_nonlin_stats.csv", "w"); + flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + fclose(FID); + + /* check the solution error */ + flag = check_ans(y, t, reltol, abstol); + flag = compute_error(y, t); + + /* Clean up and return */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNContext_Free(&ctx); /* Free context */ + + return flag; +} + +/*------------------------------- + * Functions called by the solver + *-------------------------------*/ + +/* f routine to compute the ODE RHS function f(t,y). */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter 1 */ + sunrealtype alpha = rdata[1]; /* set shortcut for stiffness parameter 2 */ + sunrealtype u = N_VGetArrayPointer(y)[0]; /* access current solution value */ + + /* fill in the RHS function: "N_VGetArrayPointer" accesses the 0th entry of ydot */ + N_VGetArrayPointer(ydot)[0] = + (lambda - alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) * + ACOS(SUN_RCONST(-1.0)))) * + u + + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - + (lambda - alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) * + ACOS(SUN_RCONST(-1.0)))) * + ATAN(t); + + return 0; /* return with success */ +} + +/* dom_eig routine to estimate the dominated eigenvalue */ +static int dom_eig(sunrealtype t, N_Vector y, N_Vector fn, sunrealtype* lambdaR, + sunrealtype* lambdaI, void* user_data, N_Vector temp1, + N_Vector temp2, N_Vector temp3) +{ + sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter 1 */ + sunrealtype alpha = rdata[1]; /* set shortcut for stiffness parameter 2 */ + *lambdaR = + (lambda - + alpha * COS((SUN_RCONST(10.0) - t) / SUN_RCONST(10.0) * + ACOS(SUN_RCONST(-1.0)))); /* access current solution value */ + *lambdaI = SUN_RCONST(0.0); + + return 0; /* return with success */ +} + +/*------------------------------- + * Private helper functions + *-------------------------------*/ + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a flag so check if + flag >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_flag(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with flag = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/* check the computed solution */ +static int check_ans(N_Vector y, sunrealtype t, sunrealtype rtol, sunrealtype atol) +{ + int passfail = 0; /* answer pass (0) or fail (1) flag */ + sunrealtype ans, err, ewt; /* answer data, error, and error weight */ + + /* compute solution error */ + ans = ATAN(t); + ewt = SUN_RCONST(1.0) / (rtol * SUNRabs(ans) + atol); + err = ewt * SUNRabs(N_VGetArrayPointer(y)[0] - ans); + + /* is the solution within the tolerances? */ + passfail = (err < SUN_RCONST(1.0)) ? 0 : 1; + + if (passfail) + { + fprintf(stdout, "\nSUNDIALS_WARNING: check_ans error=%" GSYM "\n\n", err); + } + + return (passfail); +} + +/* check the error */ +static int compute_error(N_Vector y, sunrealtype t) +{ + sunrealtype ans, err; /* answer data, error */ + + /* compute solution error */ + ans = ATAN(t); + err = SUNRabs(N_VGetArrayPointer(y)[0] - ans); + + fprintf(stdout, "\nACCURACY at the final time = %" GSYM "\n", err); + return 0; +} + +/*---- end of file ----*/ diff --git a/examples/arkode/C_serial/ark_analytic_lsrk_varjac.out b/examples/arkode/C_serial/ark_analytic_lsrk_varjac.out new file mode 100644 index 0000000000..b25873066e --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_lsrk_varjac.out @@ -0,0 +1,43 @@ +Analytical ODE test problem with a variable Jacobian: +The stiffness of the problem is directly proportional to +"lambda - alpha*cos((10 - t)/10*pi)" + + lambda = -1e+06 + alpha = 100 + reltol = 1.0e-08 + abstol = 1.0e-08 + + t u + --------------------- + 1.000000 0.785398 + 2.000000 1.107149 + 3.000000 1.249046 + 4.000000 1.325818 + 5.000000 1.373401 + 6.000000 1.405648 + 7.000000 1.428899 + 8.000000 1.446441 + 9.000000 1.460139 + 10.000000 1.471128 + --------------------- + +Final Statistics: +Current time = 10.0056139321959 +Steps = 1651 +Step attempts = 1653 +Stability limited steps = 0 +Accuracy limited steps = 1653 +Error test fails = 2 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 1.930101110942615e-10 +Last step size = 0.02203090645841201 +Current step size = 0.02203090645841201 +RHS fn evals = 150640 +Number of dom_eig updates = 68 +Max. num. of stages used = 187 +Max. num. of stages allowed = 200 +Max. spectral radius = 1010099.739553962 +Min. spectral radius = 1009899 + +ACCURACY at the final time = 1.54099e-13 \ No newline at end of file diff --git a/examples/arkode/C_serial/ark_analytic_ssprk.c b/examples/arkode/C_serial/ark_analytic_ssprk.c new file mode 100644 index 0000000000..c0f611f999 --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_ssprk.c @@ -0,0 +1,271 @@ +/*----------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Example problem: + * + * The following is a simple example problem with analytical + * solution, + * dy/dt = lambda*y + 1/(1+t^2) - lambda*atan(t) + * for t in the interval [0.0, 10.0], with initial condition: y=0. + * + * The stiffness of the problem is directly proportional to the + * value of "lambda". The value of lambda should be negative to + * result in a well-posed ODE; for values with magnitude larger + * than 100 the problem becomes quite stiff. + * + * This program solves the problem with the SSP(s,3) method from LSRK. + * Output is printed every 1.0 units of time (10 total). + * Run statistics (optional outputs) are printed at the end. + *-----------------------------------------------------------------*/ + +/* Header files */ +#include <arkode/arkode_lsrkstep.h> /* prototypes for LSRKStep fcts., consts */ +#include <math.h> +#include <nvector/nvector_serial.h> /* serial N_Vector types, fcts., macros */ +#include <stdio.h> +#include <sundials/sundials_math.h> /* def. of SUNRsqrt, etc. */ +#include <sundials/sundials_types.h> /* definition of type sunrealtype */ + +#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 + +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define ATAN(x) (atan((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define ATAN(x) (atanf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define ATAN(x) (atanl((x))) +#endif + +/* User-supplied Functions Called by the Solver */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); + +/* Private function to check function return values */ +static int check_flag(void* flagvalue, const char* funcname, int opt); + +/* Private function to compute error */ +static int compute_error(N_Vector y, sunrealtype t); + +/* Main Program */ +int main(void) +{ + /* general problem parameters */ + sunrealtype T0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype Tf = SUN_RCONST(10.0); /* final time */ + sunrealtype dTout = SUN_RCONST(1.0); /* time between outputs */ + sunindextype NEQ = 1; /* number of dependent vars. */ + +#if defined(SUNDIALS_DOUBLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-10.0); /* stiffness parameter */ +#elif defined(SUNDIALS_SINGLE_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-4); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-10.0); /* stiffness parameter */ +#elif defined(SUNDIALS_EXTENDED_PRECISION) + sunrealtype reltol = SUN_RCONST(1.0e-8); /* tolerances */ + sunrealtype abstol = SUN_RCONST(1.0e-8); + sunrealtype lambda = SUN_RCONST(-10.0); /* stiffness parameter */ +#endif + + /* general problem variables */ + int flag; /* reusable error-checking flag */ + N_Vector y = NULL; /* empty vector for storing solution */ + void* arkode_mem = NULL; /* empty ARKode memory structure */ + FILE *UFID, *FID; + sunrealtype t, tout; + + /* Create the SUNDIALS context object for this simulation */ + SUNContext ctx; + flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + /* Initial diagnostics output */ + printf("\nAnalytical ODE test problem:\n"); + printf(" lambda = %" GSYM "\n", lambda); + printf(" reltol = %.1" ESYM "\n", reltol); + printf(" abstol = %.1" ESYM "\n\n", abstol); + + /* Initialize data structures */ + y = N_VNew_Serial(NEQ, ctx); /* Create serial vector for solution */ + if (check_flag((void*)y, "N_VNew_Serial", 0)) { return 1; } + N_VConst(SUN_RCONST(0.0), y); /* Specify initial condition */ + + /* Call LSRKStepCreateSSP to initialize the ARK timestepper module and + specify the right-hand side function in y'=f(t,y), the initial time + T0, and the initial dependent variable vector y. */ + arkode_mem = LSRKStepCreateSSP(f, T0, y, ctx); + if (check_flag((void*)arkode_mem, "ARKStepCreate", 0)) { return 1; } + + /* Set routines */ + flag = ARKodeSetUserData(arkode_mem, + (void*)&lambda); /* Pass lambda to user functions */ + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + /* Specify tolerances */ + flag = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_flag(&flag, "ARKStepSStolerances", 1)) { return 1; } + + /* Specify max number of steps allowed */ + flag = ARKodeSetMaxNumSteps(arkode_mem, 1000); + if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } + + /* Specify the SSP(s,3) LSRK method */ + flag = LSRKStepSetSSPMethod(arkode_mem, ARKODE_LSRK_SSP_S_3); + if (check_flag(&flag, "LSRKStepSetSSPMethod", 1)) { return 1; } + + /* Specify the SSP number of stages */ + flag = LSRKStepSetSSPStageNum(arkode_mem, 9); + if (check_flag(&flag, "LSRKStepSetSSPStageNum", 1)) { return 1; } + + /* Open output stream for results, output comment line */ + UFID = fopen("solution.txt", "w"); + fprintf(UFID, "# t u\n"); + + /* output initial condition to disk */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", T0, N_VGetArrayPointer(y)[0]); + + /* Main time-stepping loop: calls ARKodeEvolve to perform the integration, then + prints results. Stops when the final time has been reached */ + t = T0; + tout = T0 + dTout; + printf(" t u\n"); + printf(" ---------------------\n"); + while (Tf - t > SUN_RCONST(1.0e-15)) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_NORMAL); /* call integrator */ + if (check_flag(&flag, "ARKodeEvolve", 1)) { break; } + printf(" %10.6" FSYM " %10.6" FSYM "\n", t, + N_VGetArrayPointer(y)[0]); /* access/print solution */ + fprintf(UFID, " %.16" ESYM " %.16" ESYM "\n", t, N_VGetArrayPointer(y)[0]); + if (flag < 0) + { /* unsuccessful solve: break */ + fprintf(stderr, "Solver failure, stopping integration\n"); + break; + } + else + { /* successful solve: update time */ + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + } + } + printf(" ---------------------\n"); + fclose(UFID); + + /* Print final statistics */ + printf("\nFinal Statistics:\n"); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + /* Print final statistics to a file in CSV format */ + FID = fopen("ark_analytic_nonlin_stats.csv", "w"); + flag = ARKodePrintAllStats(arkode_mem, FID, SUN_OUTPUTFORMAT_CSV); + fclose(FID); + + /* check the solution error */ + flag = compute_error(y, t); + + /* Clean up and return */ + N_VDestroy(y); /* Free y vector */ + ARKodeFree(&arkode_mem); /* Free integrator memory */ + SUNContext_Free(&ctx); /* Free context */ + + return flag; +} + +/*------------------------------- + * Functions called by the solver + *-------------------------------*/ + +/* f routine to compute the ODE RHS function f(t,y). */ +static int f(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* rdata = (sunrealtype*)user_data; /* cast user_data to sunrealtype */ + sunrealtype lambda = rdata[0]; /* set shortcut for stiffness parameter */ + sunrealtype u = N_VGetArrayPointer(y)[0]; /* access current solution value */ + + /* fill in the RHS function: "N_VGetArrayPointer" accesses the 0th entry of ydot */ + N_VGetArrayPointer(ydot)[0] = + lambda * u + SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t * t) - lambda * ATAN(t); + + return 0; /* return with success */ +} + +/*------------------------------- + * Private helper functions + *-------------------------------*/ + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a flag so check if + flag >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_flag(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with flag = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/* check the error */ +static int compute_error(N_Vector y, sunrealtype t) +{ + sunrealtype ans, err; /* answer data, error */ + + /* compute solution error */ + ans = ATAN(t); + err = SUNRabs(N_VGetArrayPointer(y)[0] - ans); + + fprintf(stdout, "\nACCURACY at the final time = %" GSYM "\n", err); + return 0; +} + +/*---- end of file ----*/ diff --git a/examples/arkode/C_serial/ark_analytic_ssprk.out b/examples/arkode/C_serial/ark_analytic_ssprk.out new file mode 100644 index 0000000000..457b5827d3 --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_ssprk.out @@ -0,0 +1,36 @@ + +Analytical ODE test problem: + lambda = -10 + reltol = 1.0e-08 + abstol = 1.0e-08 + + t u + --------------------- + 1.000000 0.785398 + 2.000000 1.107149 + 3.000000 1.249046 + 4.000000 1.325818 + 5.000000 1.373401 + 6.000000 1.405648 + 7.000000 1.428899 + 8.000000 1.446441 + 9.000000 1.460139 + 10.000000 1.471128 + --------------------- + +Final Statistics: +Current time = 10.01679801682566 +Steps = 1047 +Step attempts = 1048 +Stability limited steps = 0 +Accuracy limited steps = 1048 +Error test fails = 1 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 1.930101110942615e-10 +Last step size = 0.02305133855414821 +Current step size = 0.02305133855414821 +RHS fn evals = 9433 +Number of stages used = 9 + +ACCURACY at the final time = 1.69688e-09 diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index f33ec560dc..3f934b78af 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -140,6 +140,9 @@ extern "C" { #define ARK_STEPPER_UNSUPPORTED -48 +#define ARK_DOMEIG_FAIL -49 +#define ARK_MAX_STAGE_LIMIT_FAIL -50 + #define ARK_UNRECOGNIZED_ERROR -99 /* ------------------------------ diff --git a/include/arkode/arkode_lsrkstep.h b/include/arkode/arkode_lsrkstep.h new file mode 100644 index 0000000000..1f3c281233 --- /dev/null +++ b/include/arkode/arkode_lsrkstep.h @@ -0,0 +1,99 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds and Mustafa Aggul @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE LSRKStep module. + * -----------------------------------------------------------------*/ + +#ifndef _LSRKSTEP_H +#define _LSRKSTEP_H + +#include <arkode/arkode.h> + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +typedef int (*ARKDomEigFn)(sunrealtype t, N_Vector y, N_Vector fn, + sunrealtype* lambdaR, sunrealtype* lambdaI, + void* user_data, N_Vector temp1, N_Vector temp2, + N_Vector temp3); + +/* ------------------ + * LSRKStep Constants + * ------------------ */ + +typedef enum +{ + ARKODE_LSRK_RKC_2, + ARKODE_LSRK_RKL_2, + ARKODE_LSRK_SSP_S_2, + ARKODE_LSRK_SSP_S_3, + ARKODE_LSRK_SSP_10_4 +} ARKODE_LSRKMethodType; + +/* ------------------- + * Exported Functions + * ------------------- */ + +/* Creation and Reinitialization functions */ + +SUNDIALS_EXPORT void* LSRKStepCreateSTS(ARKRhsFn rhs, sunrealtype t0, + N_Vector y0, SUNContext sunctx); + +SUNDIALS_EXPORT void* LSRKStepCreateSSP(ARKRhsFn rhs, sunrealtype t0, + N_Vector y0, SUNContext sunctx); + +SUNDIALS_EXPORT int LSRKStepReInitSTS(void* arkode_mem, ARKRhsFn rhs, + sunrealtype t0, N_Vector y0); + +SUNDIALS_EXPORT int LSRKStepReInitSSP(void* arkode_mem, ARKRhsFn rhs, + sunrealtype t0, N_Vector y0); + +/* Optional input functions -- must be called AFTER a creation routine above */ + +SUNDIALS_EXPORT int LSRKStepSetSTSMethod(void* arkode_mem, + ARKODE_LSRKMethodType method); + +SUNDIALS_EXPORT int LSRKStepSetSSPMethod(void* arkode_mem, + ARKODE_LSRKMethodType method); + +SUNDIALS_EXPORT int LSRKStepSetSTSMethodByName(void* arkode_mem, + const char* emethod); + +SUNDIALS_EXPORT int LSRKStepSetSSPMethodByName(void* arkode_mem, + const char* emethod); + +SUNDIALS_EXPORT int LSRKStepSetDomEigFn(void* arkode_mem, ARKDomEigFn dom_eig); + +SUNDIALS_EXPORT int LSRKStepSetDomEigFrequency(void* arkode_mem, long int nsteps); + +SUNDIALS_EXPORT int LSRKStepSetMaxNumStages(void* arkode_mem, + int stage_max_limit); + +SUNDIALS_EXPORT int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, + sunrealtype dom_eig_safety); + +SUNDIALS_EXPORT int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages); + +/* Optional output functions */ + +SUNDIALS_EXPORT int LSRKStepGetNumDomEigUpdates(void* arkode_mem, + long int* dom_eig_num_evals); + +SUNDIALS_EXPORT int LSRKStepGetMaxNumStages(void* arkode_mem, int* stage_max); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/sundials/sundials_math.h b/include/sundials/sundials_math.h index 4585c7c7f4..bf7a96dab7 100644 --- a/include/sundials/sundials_math.h +++ b/include/sundials/sundials_math.h @@ -46,6 +46,8 @@ extern "C" { * SUNRexp calls the appropriate version of exp * * SUNRceil calls the appropriate version of ceil + * + * SUNRround calls the appropriate version of round * ----------------------------------------------------------------- */ @@ -158,6 +160,30 @@ extern "C" { #endif #endif +/* + * ----------------------------------------------------------------- + * Function : SUNRround + * ----------------------------------------------------------------- + * Usage : sunrealtype round_x; + * round_x = SUNRround(x); + * ----------------------------------------------------------------- + * SUNRround(x) returns the smallest integer value not less than x. + * ----------------------------------------------------------------- + */ + +#ifndef SUNRround +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define SUNRround(x) (round((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define SUNRround(x) (roundf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define SUNRround(x) (roundl((x))) +#else +#error \ + "SUNDIALS precision not defined, report to github.com/LLNL/sundials/issues" +#endif +#endif + /* * ----------------------------------------------------------------- * Function : SUNRpowerI diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index f8a0f4be63..45386c0d87 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -32,6 +32,8 @@ set(arkode_SOURCES arkode_interp.c arkode_io.c arkode_ls.c + arkode_lsrkstep_io.c + arkode_lsrkstep.c arkode_mri_tables.c arkode_mristep_io.c arkode_mristep_nls.c @@ -55,6 +57,7 @@ set(arkode_HEADERS arkode_butcher_erk.h arkode_erkstep.h arkode_ls.h + arkode_lsrkstep.h arkode_mristep.h arkode_sprk.h arkode_sprkstep.h) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 6d66929483..7211e50984 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -735,6 +735,10 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - loop over attempts at a new step: * try to take step (via time stepper module), handle solver convergence or other failures + * if the stepper requests ARK_RETRY_STEP, we + retry the step without accumulating failures. + A stepper should never request this multiple + times in a row. * perform constraint-handling (if selected) * check temporal error * if all of the above pass, complete step by @@ -870,9 +874,15 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, nflag = FIRST_CALL; for (;;) { - /* increment attempt counters */ - attempts++; - ark_mem->nst_attempts++; + /* increment attempt counters + Note: kflag can only equal ARK_RETRY_STEP if the stepper rejected + the current step size before performing calculations. Thus, we do + not include those when keeping track of step "attempts". */ + if (kflag != ARK_RETRY_STEP) + { + attempts++; + ark_mem->nst_attempts++; + } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::ARKodeEvolve", @@ -1884,17 +1894,23 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) } } - /* Create default Hermite interpolation module (if needed) */ + /* Create default interpolation module (if needed) */ if (ark_mem->interp_type != ARK_INTERP_NONE && !(ark_mem->interp)) { - ark_mem->interp = arkInterpCreate_Hermite(ark_mem, ark_mem->interp_degree); + if (ark_mem->interp_type == ARK_INTERP_LAGRANGE) + { + ark_mem->interp = arkInterpCreate_Lagrange(ark_mem, ark_mem->interp_degree); + } + else + { + ark_mem->interp = arkInterpCreate_Hermite(ark_mem, ark_mem->interp_degree); + } if (ark_mem->interp == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, "Unable to allocate interpolation module"); return ARK_MEM_FAIL; } - ark_mem->interp_type = ARK_INTERP_HERMITE; } /* Fill initial interpolation data (if needed) */ @@ -2670,6 +2686,14 @@ int arkHandleFailure(ARKodeMem ark_mem, int flag) arkProcessError(ark_mem, ARK_RELAX_JAC_FAIL, __LINE__, __func__, __FILE__, "The relaxation Jacobian failed unrecoverably"); break; + case ARK_DOMEIG_FAIL: + arkProcessError(ark_mem, ARK_DOMEIG_FAIL, __LINE__, __func__, __FILE__, + "The dominant eigenvalue function failed unrecoverably"); + break; + case ARK_MAX_STAGE_LIMIT_FAIL: + arkProcessError(ark_mem, ARK_MAX_STAGE_LIMIT_FAIL, __LINE__, __func__, + __FILE__, "The max stage limit failed unrecoverably"); + break; default: /* This return should never happen */ arkProcessError(ark_mem, ARK_UNRECOGNIZED_ERROR, __LINE__, __func__, __FILE__, @@ -2986,6 +3010,13 @@ int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr) ARKodeHAdaptMem hadapt_mem; if (*nflagPtr == ARK_SUCCESS) { return (ARK_SUCCESS); } + /* Returns with an ARK_RETRY_STEP flag occur at a stage well before + any algebraic solvers are involved. On the other hand, + the arkCheckConvergence function handles the results from algebraic + solvers, which never take place with an ARK_RETRY_STEP flag. + Therefore, we immediately return from arkCheckConvergence, + as it is irrelevant in the case of an ARK_RETRY_STEP */ + if (*nflagPtr == ARK_RETRY_STEP) { return (ARK_RETRY_STEP); } /* The nonlinear soln. failed; increment ncfn */ ark_mem->ncfn++; diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index c629e4d8e6..8a0ee66761 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -519,7 +519,7 @@ int ARKStepSetTableName(void* arkode_mem, const char* itable, const char* etable ===============================================================*/ /*--------------------------------------------------------------- - ARKStepGetNumRhsEvals: + arkStep_GetNumRhsEvals: Returns the current number of calls ---------------------------------------------------------------*/ diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index fc30ad1651..8b99460ca7 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -72,7 +72,6 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type); int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); -int erkStep_SetUserData(ARKodeMem ark_mem, void* user_data); int erkStep_SetDefaults(ARKodeMem ark_mem); int erkStep_SetOrder(ARKodeMem ark_mem, int ord); int erkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 61bb740654..748736098e 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -165,7 +165,7 @@ int ERKStepSetTableName(void* arkode_mem, const char* etable) ===============================================================*/ /*--------------------------------------------------------------- - ERKStepGetNumRhsEvals: + erkStep_GetNumRhsEvals: Returns the current number of RHS calls ---------------------------------------------------------------*/ @@ -321,7 +321,6 @@ int erkStep_SetDefaults(ARKodeMem ark_mem) 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) { diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index f9383fe1de..4e03a9ff59 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -119,6 +119,7 @@ extern "C" { #define PREV_ERR_FAIL +8 #define RHSFUNC_RECVR +9 #define CONSTR_RECVR +10 +#define ARK_RETRY_STEP +11 /*--------------------------------------------------------------- Return values for lower-level rootfinding functions diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 670b1fd9d0..1ae4e4c1a7 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -2899,6 +2899,10 @@ char* ARKodeGetReturnFlagName(long int flag) case ARK_RELAX_JAC_FAIL: sprintf(name, "ARK_RELAX_JAC_FAIL"); break; case ARK_CONTROLLER_ERR: sprintf(name, "ARK_CONTROLLER_ERR"); break; case ARK_STEPPER_UNSUPPORTED: sprintf(name, "ARK_STEPPER_UNSUPPORTED"); break; + case ARK_DOMEIG_FAIL: sprintf(name, "ARK_DOMEIG_FAIL"); break; + case ARK_MAX_STAGE_LIMIT_FAIL: + sprintf(name, "ARK_MAX_STAGE_LIMIT_FAIL"); + break; case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; default: sprintf(name, "NONE"); } diff --git a/src/arkode/arkode_lsrkstep.c b/src/arkode/arkode_lsrkstep.c new file mode 100644 index 0000000000..9cae2f4300 --- /dev/null +++ b/src/arkode/arkode_lsrkstep.c @@ -0,0 +1,2236 @@ +/*--------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE's LSRK time stepper + * module. + *--------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sundials/sundials_context.h> +#include <sundials/sundials_math.h> + +#include "arkode_impl.h" +#include "arkode_interp_impl.h" +#include "arkode_lsrkstep_impl.h" + +/*=============================================================== + Exported functions + ===============================================================*/ + +void* LSRKStepCreateSTS(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, + SUNContext sunctx) +{ + ARKodeMem ark_mem; + int retval; + + /* Create shared LSRKStep memory structure */ + ark_mem = lsrkStep_Create_Commons(rhs, t0, y0, sunctx); + + /* set default ARKODE_LSRK_RKC_2 method */ + retval = LSRKStepSetSTSMethod((void*)ark_mem, ARKODE_LSRK_RKC_2); + if (retval != ARK_SUCCESS) + { + lsrkStep_Free(ark_mem); + return NULL; + } + + return (void*)ark_mem; +} + +void* LSRKStepCreateSSP(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, + SUNContext sunctx) +{ + ARKodeMem ark_mem; + int retval; + + /* Create shared LSRKStep memory structure */ + ark_mem = lsrkStep_Create_Commons(rhs, t0, y0, sunctx); + + /* set default ARKODE_LSRK_SSP_S_2 method */ + retval = LSRKStepSetSSPMethod((void*)ark_mem, ARKODE_LSRK_SSP_S_2); + if (retval != ARK_SUCCESS) + { + lsrkStep_Free(ark_mem); + return NULL; + } + + return (void*)ark_mem; +} + +/*--------------------------------------------------------------- + LSRKStepReInitSTS: + + This routine re-initializes the LSRK STS module to solve a new + problem of the same size as was previously solved. This routine + should also be called when the problem dynamics or desired solvers + have changed dramatically, so that the problem integration should + resume as if started from scratch. + + Note all internal counters are set to 0 on re-initialization. + ---------------------------------------------------------------*/ +int LSRKStepReInitSTS(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, N_Vector y0) +{ + int retval; + retval = lsrkStep_ReInit_Commons(arkode_mem, rhs, t0, y0); + return retval; +} + +/*--------------------------------------------------------------- + LSRKStepReInitSSP: + + This routine re-initializes the LSRK SSP module to solve a new + problem of the same size as was previously solved. This routine + should also be called when the problem dynamics or desired solvers + have changed dramatically, so that the problem integration should + resume as if started from scratch. + + Note all internal counters are set to 0 on re-initialization. + ---------------------------------------------------------------*/ +int LSRKStepReInitSSP(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, N_Vector y0) +{ + int retval; + retval = lsrkStep_ReInit_Commons(arkode_mem, rhs, t0, y0); + return retval; +} + +/*=============================================================== + Interface routines supplied to ARKODE + ===============================================================*/ + +/*--------------------------------------------------------------- + lsrkStep_Create_Commons: + + A submodule for creating the common features of + LSRKStepCreateSTS and LSRKStepCreateSSP. + ---------------------------------------------------------------*/ + +void* lsrkStep_Create_Commons(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, + SUNContext sunctx) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + sunbooleantype nvectorOK; + int retval; + + /* Check that rhs is supplied */ + if (rhs == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_F); + return NULL; + } + + /* Check for legal input parameters */ + if (y0 == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return NULL; + } + + if (sunctx == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_SUNCTX); + return NULL; + } + + /* Test if all required vector operations are implemented */ + nvectorOK = lsrkStep_CheckNVector(y0); + if (!nvectorOK) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_NVECTOR); + return NULL; + } + + /* Create ark_mem structure and set default values */ + ark_mem = arkCreate(sunctx); + if (ark_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return NULL; + } + + /* Allocate ARKodeLSRKStepMem structure, and initialize to zero */ + step_mem = (ARKodeLSRKStepMem)calloc(1, sizeof(*step_mem)); + if (step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_ARKMEM_FAIL); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Attach step_mem structure and function pointers to ark_mem */ + ark_mem->step_init = lsrkStep_Init; + ark_mem->step_fullrhs = lsrkStep_FullRHS; + ark_mem->step = lsrkStep_TakeStepRKC; + ark_mem->step_printallstats = lsrkStep_PrintAllStats; + ark_mem->step_writeparameters = lsrkStep_WriteParameters; + ark_mem->step_free = lsrkStep_Free; + ark_mem->step_printmem = lsrkStep_PrintMem; + ark_mem->step_setdefaults = lsrkStep_SetDefaults; + ark_mem->step_getnumrhsevals = lsrkStep_GetNumRhsEvals; + ark_mem->step_getestlocalerrors = lsrkStep_GetEstLocalErrors; + ark_mem->step_mem = (void*)step_mem; + ark_mem->step_supports_adaptive = SUNTRUE; + + /* Set default values for optional inputs */ + retval = lsrkStep_SetDefaults((void*)ark_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Error setting default solver options"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Copy the input parameters into ARKODE state */ + step_mem->fe = rhs; + + /* Set NULL for dom_eig_fn */ + step_mem->dom_eig_fn = NULL; + + /* Initialize all the counters */ + step_mem->nfe = 0; + step_mem->stage_max = 0; + step_mem->dom_eig_num_evals = 0; + step_mem->stage_max_limit = STAGE_MAX_LIMIT_DEFAULT; + step_mem->dom_eig_nst = 0; + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Specify preferred interpolation type */ + ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + + return (void*)ark_mem; +} + +/*--------------------------------------------------------------- + lsrkStep_ReInit_Commons: + + A submodule designed to reinitialize the common features of + LSRKStepCreateSTS and LSRKStepCreateSSP. + ---------------------------------------------------------------*/ + +int lsrkStep_ReInit_Commons(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, + N_Vector y0) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* Check if ark_mem was allocated */ + if (ark_mem->MallocDone == SUNFALSE) + { + arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MALLOC); + return ARK_NO_MALLOC; + } + + /* Check that rhs is supplied */ + if (rhs == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_F); + return ARK_ILL_INPUT; + } + + /* Check for legal input parameters */ + if (y0 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return ARK_ILL_INPUT; + } + + /* Copy the input parameters into ARKODE state */ + step_mem->fe = rhs; + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(arkode_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + return retval; + } + + /* Initialize all the counters, flags and stats */ + step_mem->nfe = 0; + step_mem->dom_eig_num_evals = 0; + step_mem->stage_max = 0; + step_mem->spectral_radius_max = 0; + step_mem->spectral_radius_min = 0; + step_mem->dom_eig_nst = 0; + step_mem->dom_eig_update = SUNTRUE; + step_mem->dom_eig_is_current = SUNFALSE; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_Init: + + This routine is called just prior to performing internal time + steps (after all user "set" routines have been called) from + within arkInitialSetup. + + With initialization types FIRST_INIT this routine performs + setup and allocations needed for the method and sets + the call_fullrhs flag. + + With other initialization types, this routine does nothing. + ---------------------------------------------------------------*/ +int lsrkStep_Init(ARKodeMem ark_mem, int init_type) +{ + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* immediately return if resize or reset */ + if (init_type == RESIZE_INIT || init_type == RESET_INIT) + { + return ARK_SUCCESS; + } + /* enforce use of arkEwtSmallReal if using a fixed step size + and an internal error weight function */ + if (ark_mem->fixedstep && !ark_mem->user_efun) + { + ark_mem->user_efun = SUNFALSE; + ark_mem->efun = arkEwtSetSmallReal; + ark_mem->e_data = ark_mem; + } + + /* Check if user has provided dom_eig_fn */ + if (!step_mem->is_SSP && step_mem->dom_eig_fn == NULL) + { + arkProcessError(ark_mem, ARK_DOMEIG_FAIL, __LINE__, __func__, + __FILE__, "STS methods require a user provided dominant eigenvalue function"); + return ARK_DOMEIG_FAIL; + } + + /* Allocate reusable arrays for fused vector interface */ + if (step_mem->cvals == NULL) + { + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); + if (step_mem->cvals == NULL) { return ARK_MEM_FAIL; } + ark_mem->lrw += step_mem->nfusedopvecs; + } + if (step_mem->Xvecs == NULL) + { + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, sizeof(N_Vector)); + if (step_mem->Xvecs == NULL) { return ARK_MEM_FAIL; } + ark_mem->liw += step_mem->nfusedopvecs; /* pointers */ + } + + /* While LSRKStep does not currently call the full RHS function directly (later + optimizations might) we do need the fn vector to always be allocated. Signaling + to shared arkode module that full RHS evaluations are required will ensure + fn is always allocated. */ + ark_mem->call_fullrhs = SUNTRUE; + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + lsrkStep_FullRHS: + + 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 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 the RHS function is always + evaluated. + + In ARK_FULLRHS_END mode we evaluate the RHS if an SSP method is being + used otherwise we copy the RHS evaluation from the end of the STS 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 lsrkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, + int mode) +{ + int retval; + ARKodeLSRKStepMem step_mem; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* perform RHS functions contingent on 'mode' argument */ + switch (mode) + { + case ARK_FULLRHS_START: + + /* compute the RHS */ + if (!ark_mem->fn_is_current) + { + retval = step_mem->fe(t, y, f, ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + } + + break; + + case ARK_FULLRHS_END: + /* No further action is needed if STS since the currently available STS methods + evaluate the RHS at the end of each time step. If the stepper is an SSP, fn is + updated and reused at the beginning of the step unless + ark_mem->fn_is_current is changed by ARKODE. */ + if (step_mem->is_SSP) + { + retval = step_mem->fe(t, y, ark_mem->fn, ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + } + N_VScale(ONE, ark_mem->fn, f); + + break; + + case ARK_FULLRHS_OTHER: + + /* call f */ + retval = step_mem->fe(t, y, f, ark_mem->user_data); + step_mem->nfe++; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + + break; + + default: + /* return with RHS failure if unknown mode is passed */ + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + "Unknown full RHS mode"); + return ARK_RHSFUNC_FAIL; + } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepRKC: + + This routine serves the primary purpose of the LSRKStepRKC module: + it performs a single RKC step (with embedding, if possible). + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is generally used in ARKODE + to gauge the convergence of any algebraic solvers. However, since + the STS step routines do not involve an algebraic solve, this variable + instead serves to identify possible ARK_RETRY_STEP returns within this + routine. + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + ARK_RETRY_STEP indicates that the required stage + number has reached the stage_max_limit with the + current value of h. The step is then returned to + adjust the step size. + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + sunrealtype hmax, w0, w1, temp1, temp2, arg, bjm1, bjm2, mus, thjm1, thjm2, + zjm1, zjm2, dzjm1, dzjm2, d2zjm1, d2zjm2, zj, dzj, d2zj, bj, ajm1, mu, nu, + thj; + const sunrealtype onep54 = SUN_RCONST(1.54), c13 = SUN_RCONST(13.0), + p8 = SUN_RCONST(0.8), p4 = SUN_RCONST(0.4); + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + + /* Compute dominant eigenvalue and update stats */ + if (step_mem->dom_eig_update) + { + retval = lsrkStep_ComputeNewDomEig(ark_mem, step_mem); + if (retval != ARK_SUCCESS) { return retval; } + } + + sunrealtype ss = + SUNRceil(SUNRsqrt(onep54 * SUNRabs(ark_mem->h) * step_mem->spectral_radius)); + ss = SUNMAX(ss, SUN_RCONST(2.0)); + + if (ss >= step_mem->stage_max_limit) + { + if (!ark_mem->fixedstep) + { + hmax = ark_mem->hadapt_mem->safety * SUNSQR(step_mem->stage_max_limit) / + (onep54 * step_mem->spectral_radius); + ark_mem->eta = hmax / ark_mem->h; + *nflagPtr = ARK_RETRY_STEP; + ark_mem->hadapt_mem->nst_exp++; + return ARK_RETRY_STEP; + } + else + { + arkProcessError(ark_mem, ARK_MAX_STAGE_LIMIT_FAIL, __LINE__, __func__, + __FILE__, + "Unable to achieve stable results: Either reduce the " + "step size or increase the stage_max_limit"); + return ARK_MAX_STAGE_LIMIT_FAIL; + } + } + + step_mem->req_stages = (int)ss; + step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max); + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* Compute RHS function, if necessary. */ + if ((!ark_mem->fn_is_current && ark_mem->initsetup) || + (step_mem->step_nst != ark_mem->nst)) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + + /* Track the number of successful steps to determine if the previous step failed. */ + step_mem->step_nst = ark_mem->nst + 1; + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "stage RHS", "F(:) =", ""); + N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); +#endif + + w0 = (ONE + TWO / (c13 * SUNSQR((sunrealtype)(step_mem->req_stages)))); + + temp1 = SUNSQR(w0) - ONE; + temp2 = SUNRsqrt(temp1); + arg = step_mem->req_stages * SUNRlog(w0 + temp2); + + w1 = SUNRsinh(arg) * temp1 / + (SUNRcosh(arg) * step_mem->req_stages * temp2 - w0 * SUNRsinh(arg)); + + bjm1 = ONE / SUNSQR(TWO * w0); + bjm2 = bjm1; + + /* Evaluate the first stage */ + N_VScale(ONE, ark_mem->yn, ark_mem->tempv1); + + mus = w1 * bjm1; + + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * mus, ark_mem->fn, ark_mem->tempv2); + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * mus, + ark_mem->tempv2, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + thjm2 = ZERO; + thjm1 = mus; + zjm1 = w0; + zjm2 = ONE; + dzjm1 = ONE; + dzjm2 = ZERO; + d2zjm1 = ZERO; + d2zjm2 = ZERO; + + /* Evaluate stages j = 2,...,step_mem->req_stages */ + for (int j = 2; j <= step_mem->req_stages; j++) + { + zj = TWO * w0 * zjm1 - zjm2; + dzj = TWO * w0 * dzjm1 - dzjm2 + TWO * zjm1; + d2zj = TWO * w0 * d2zjm1 - d2zjm2 + FOUR * dzjm1; + bj = d2zj / SUNSQR(dzj); + ajm1 = ONE - zjm1 * bjm1; + mu = TWO * w0 * bj / bjm1; + nu = -bj / bjm2; + mus = mu * w1 / w0; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + ark_mem->h * thjm1); +#endif + + /* Use the ycur array for temporary storage here */ + retval = step_mem->fe(ark_mem->tcur + ark_mem->h * thjm1, ark_mem->tempv2, + ark_mem->ycur, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = mus * ark_mem->h; + Xvecs[0] = ark_mem->ycur; + cvals[1] = nu; + Xvecs[1] = ark_mem->tempv1; + cvals[2] = ONE - mu - nu; + Xvecs[2] = ark_mem->yn; + cvals[3] = mu; + Xvecs[3] = ark_mem->tempv2; + cvals[4] = -mus * ajm1 * ark_mem->h; + Xvecs[4] = ark_mem->fn; + + retval = N_VLinearCombination(5, cvals, Xvecs, ark_mem->ycur); + if (retval != 0) { return ARK_VECTOROP_ERR; } + + /* compute new stage time factor */ + thj = mu * thjm1 + nu * thjm2 + mus * (ONE - ajm1); + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL && j < step_mem->req_stages) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * thj, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + /* Shift the data for the next stage */ + if (j < step_mem->req_stages) + { + /* To avoid two data copies we swap ARKODE's tempv1 and tempv2 pointers*/ + N_Vector temp = ark_mem->tempv1; + ark_mem->tempv1 = ark_mem->tempv2; + ark_mem->tempv2 = temp; + + N_VScale(ONE, ark_mem->ycur, ark_mem->tempv2); + + thjm2 = thjm1; + thjm1 = thj; + bjm2 = bjm1; + bjm1 = bj; + zjm2 = zjm1; + zjm1 = zj; + dzjm2 = dzjm1; + dzjm1 = dzj; + d2zjm2 = d2zjm1; + d2zjm1 = d2zj; + } + } + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + + /* Estimate the local error and compute its weighted RMS norm */ + cvals[0] = p8; + Xvecs[0] = ark_mem->yn; + cvals[1] = -p8; + Xvecs[1] = ark_mem->ycur; + cvals[2] = p4 * ark_mem->h; + Xvecs[2] = ark_mem->fn; + cvals[3] = p4 * ark_mem->h; + Xvecs[3] = ark_mem->tempv2; + + retval = N_VLinearCombination(4, cvals, Xvecs, ark_mem->tempv1); + if (retval != 0) { return ARK_VECTOROP_ERR; } + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); + } + else + { + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + + lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKC", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepRKL: + + This routine serves the primary purpose of the LSRKStepRKL module: + it performs a single RKL step (with embedding, if possible). + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is generally used in ARKODE + to gauge the convergence of any algebraic solvers. However, since + the STS step routines do not involve an algebraic solve, this variable + instead serves to identify possible ARK_RETRY_STEP returns within this + routine. + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + ARK_RETRY_STEP indicates that the required stage + number has reached the stage_max_limit with the + current value of h. The step is then returned to + adjust the step size. + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + sunrealtype hmax, w1, bjm1, bjm2, mus, bj, ajm1, cjm1, temj, cj, mu, nu; + const sunrealtype p8 = SUN_RCONST(0.8), p4 = SUN_RCONST(0.4); + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + + /* Compute dominant eigenvalue and update stats */ + if (step_mem->dom_eig_update) + { + retval = lsrkStep_ComputeNewDomEig(ark_mem, step_mem); + if (retval != ARK_SUCCESS) { return retval; } + } + + sunrealtype ss = + SUNRceil((SUNRsqrt(SUN_RCONST(9.0) + SUN_RCONST(8.0) * SUNRabs(ark_mem->h) * + step_mem->spectral_radius) - + ONE) / + TWO); + + ss = SUNMAX(ss, SUN_RCONST(2.0)); + + if (ss >= step_mem->stage_max_limit) + { + if (!ark_mem->fixedstep) + { + hmax = + ark_mem->hadapt_mem->safety * + (SUNSQR(step_mem->stage_max_limit) + step_mem->stage_max_limit - TWO) / + (TWO * step_mem->spectral_radius); + ark_mem->eta = hmax / ark_mem->h; + *nflagPtr = ARK_RETRY_STEP; + ark_mem->hadapt_mem->nst_exp++; + return ARK_RETRY_STEP; + } + else + { + arkProcessError(ark_mem, ARK_MAX_STAGE_LIMIT_FAIL, __LINE__, __func__, + __FILE__, + "Unable to achieve stable results: Either reduce the " + "step size or increase the stage_max_limit"); + return ARK_MAX_STAGE_LIMIT_FAIL; + } + } + + step_mem->req_stages = (int)ss; + step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max); + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* Compute RHS function, if necessary. */ + if ((!ark_mem->fn_is_current && ark_mem->initsetup) || + (step_mem->step_nst != ark_mem->nst)) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + + /* Track the number of successful steps to determine if the previous step failed. */ + step_mem->step_nst = ark_mem->nst + 1; + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "stage RHS", "F(:) =", ""); + N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); +#endif + + w1 = FOUR / ((step_mem->req_stages + TWO) * (step_mem->req_stages - ONE)); + + bjm2 = ONE / THREE; + bjm1 = bjm2; + + /* Evaluate the first stage */ + N_VScale(ONE, ark_mem->yn, ark_mem->tempv1); + + mus = w1 * bjm1; + cjm1 = mus; + + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * mus, ark_mem->fn, ark_mem->tempv2); + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * mus, + ark_mem->tempv2, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + /* Evaluate stages j = 2,...,step_mem->req_stages */ + for (int j = 2; j <= step_mem->req_stages; j++) + { + temj = (j + TWO) * (j - ONE); + bj = temj / (TWO * j * (j + ONE)); + ajm1 = ONE - bjm1; + mu = (TWO * j - ONE) / j * (bj / bjm1); + nu = -(j - ONE) / j * (bj / bjm2); + mus = w1 * mu; + cj = temj * w1 / FOUR; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + ark_mem->h * cjm1); +#endif + + /* Use the ycur array for temporary storage here */ + retval = step_mem->fe(ark_mem->tcur + ark_mem->h * cjm1, ark_mem->tempv2, + ark_mem->ycur, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = mus * ark_mem->h; + Xvecs[0] = ark_mem->ycur; + cvals[1] = nu; + Xvecs[1] = ark_mem->tempv1; + cvals[2] = ONE - mu - nu; + Xvecs[2] = ark_mem->yn; + cvals[3] = mu; + Xvecs[3] = ark_mem->tempv2; + cvals[4] = -mus * ajm1 * ark_mem->h; + Xvecs[4] = ark_mem->fn; + + retval = N_VLinearCombination(5, cvals, Xvecs, ark_mem->ycur); + if (retval != 0) { return ARK_VECTOROP_ERR; } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL && j < step_mem->req_stages) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * cj, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + /* Shift the data for the next stage */ + if (j < step_mem->req_stages) + { + /* To avoid two data copies we swap ARKODE's tempv1 and tempv2 pointers*/ + N_Vector temp = ark_mem->tempv1; + ark_mem->tempv1 = ark_mem->tempv2; + ark_mem->tempv2 = temp; + + N_VScale(ONE, ark_mem->ycur, ark_mem->tempv2); + + cjm1 = cj; + bjm2 = bjm1; + bjm1 = bj; + } + } + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + + /* Estimate the local error and compute its weighted RMS norm */ + cvals[0] = p8; + Xvecs[0] = ark_mem->yn; + cvals[1] = -p8; + Xvecs[1] = ark_mem->ycur; + cvals[2] = p4 * ark_mem->h; + Xvecs[2] = ark_mem->fn; + cvals[3] = p4 * ark_mem->h; + Xvecs[3] = ark_mem->tempv2; + + retval = N_VLinearCombination(4, cvals, Xvecs, ark_mem->tempv1); + if (retval != 0) { return ARK_VECTOROP_ERR; } + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); + } + else + { + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + + lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepRKL", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepSSPs2: + + This routine serves the primary purpose of the LSRKStepSSPs2 module: + it performs a single SSPs2 step (with embedding). + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. As this routine + involves no algebraic solve, it is set to 0 (success). + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + + sunrealtype rs = (sunrealtype)step_mem->req_stages; + sunrealtype sm1inv = ONE / (rs - ONE); + sunrealtype bt1, bt2, bt3; + + /* Embedding coefficients differ when req_stages == 2 */ + if (step_mem->req_stages == 2) + { + bt1 = SUN_RCONST( + 0.694021459207626); // due to https://doi.org/10.1016/j.cam.2022.114325 pg 5 + bt2 = ZERO; + bt3 = ONE - bt1; + } + else + { + bt1 = (rs + ONE) / (rs * rs); + bt2 = ONE / rs; + bt3 = (rs - ONE) / (rs * rs); + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* The method is not FSAL. Therefore, fn ​is computed at the beginning + of the step unless a renewed step or ARKODE updated fn. */ + if (!ark_mem->fn_is_current) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", "F(:) =", ""); + N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->yn, sm1inv * ark_mem->h, ark_mem->fn, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->yn, bt1 * ark_mem->h, ark_mem->fn, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tn + sm1inv * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + /* Evaluate stages j = 2,...,step_mem->req_stages - 1 */ + for (int j = 2; j < step_mem->req_stages; j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + + ((sunrealtype)j - ONE) * sm1inv * ark_mem->h); +#endif + + retval = + step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * sm1inv * ark_mem->h, + ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, sm1inv * ark_mem->h, ark_mem->tempv2, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, bt2 * ark_mem->h, ark_mem->tempv2, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + j * sm1inv * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, step_mem->req_stages, ark_mem->h, + ark_mem->tcur + ark_mem->h); +#endif + + /* Evaluate the last stage for j = step_mem->req_stages */ + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv2, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", + "F_%i(:) =", step_mem->req_stages); + N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = ONE / (sm1inv * rs); + Xvecs[0] = ark_mem->ycur; + cvals[1] = ONE / rs; + Xvecs[1] = ark_mem->yn; + cvals[2] = ark_mem->h / rs; + Xvecs[2] = ark_mem->tempv2; + + retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, bt3 * ark_mem->h, ark_mem->tempv2, + ark_mem->tempv1); + } + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs2", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepSSPs3: + + This routine serves the primary purpose of the LSRKStepSSPs3 module: + it performs a single SSPs3 step (with embedding). + + The SSP3 method differs significantly when s = 4. Therefore, the case + where num_of_stages = 4 is considered separately to avoid unnecessary + boolean checks and improve computational efficiency. + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. As this routine + involves no algebraic solve, it is set to 0 (success). + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + + sunrealtype rs = (sunrealtype)step_mem->req_stages; + sunrealtype rn = SUNRsqrt(rs); + sunrealtype rat = ONE / (rs - rn); + int in = (int)SUNRround(rn); + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* The method is not FSAL. Therefore, fn ​is computed at the beginning + of the step unless ARKODE updated fn. */ + if (!ark_mem->fn_is_current) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * rat, ark_mem->fn, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h / rs, ark_mem->fn, ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * rat, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + /* Evaluate stages j = 2,...,step_mem->req_stages */ + for (int j = 2; j <= ((in - 1) * (in - 2) / 2); j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h); +#endif + + retval = + step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + j * rat * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + } + + N_VScale(ONE, ark_mem->ycur, ark_mem->tempv2); + + for (int j = ((in - 1) * (in - 2) / 2 + 1); j <= (in * (in + 1) / 2 - 1); j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h); +#endif + + retval = + step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + j * rat * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, (in * (in + 1) / 2), ark_mem->h, + ark_mem->tcur + + rat * (rn * (rn + ONE) / TWO - ONE) * ark_mem->h); +#endif + + retval = step_mem->fe(ark_mem->tcur + + rat * (rn * (rn + ONE) / TWO - ONE) * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", + "F_%i(:) =", (in * (in + 1) / 2)); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = (rn - ONE) / (TWO * rn - ONE); + Xvecs[0] = ark_mem->ycur; + cvals[1] = rn / (TWO * rn - ONE); + Xvecs[1] = ark_mem->tempv2; + cvals[2] = (rn - ONE) * rat * ark_mem->h / (TWO * rn - ONE); + Xvecs[2] = ark_mem->tempv3; + + retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = + ark_mem->ProcessStage(ark_mem->tcur + + rat * (rn * (rn + ONE) / TWO - rn) * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + for (int j = (in * (in + 1) / 2 + 1); j <= step_mem->req_stages; j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + + ((sunrealtype)j - rn - ONE) * rat * ark_mem->h); +#endif + + retval = step_mem->fe(ark_mem->tcur + + ((sunrealtype)j - rn - ONE) * rat * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL && j < step_mem->req_stages) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + + ((sunrealtype)j - rn) * rat * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + } + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSPs3", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepSSP43: + + This routine serves the primary purpose of the LSRKStepSSP43 module: + it performs a single SSP43 step (with embedding). + + The SSP3 method differs significantly when s = 4. Therefore, the case + where num_of_stages = 4 is considered separately to avoid unnecessary + boolean checks and improve computational efficiency. + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. As this routine + involves no algebraic solve, it is set to 0 (success). + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + + sunrealtype rs = SUN_RCONST(4.0); + sunrealtype p5 = SUN_RCONST(0.5); + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* The method is not FSAL. Therefore, fn ​is computed at the beginning + of the step unless ARKODE updated fn. */ + if (!ark_mem->fn_is_current) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", "F(:) =", ""); + N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * p5, ark_mem->fn, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h / rs, ark_mem->fn, ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * p5, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, 2, ark_mem->h, + ark_mem->tcur + ark_mem->h * p5); +#endif + + retval = step_mem->fe(ark_mem->tcur + ark_mem->h * p5, ark_mem->ycur, + ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", + "F_%i(:) =", 2); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * p5, ark_mem->tempv3, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, 3, ark_mem->h, ark_mem->tcur + ark_mem->h); +#endif + + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", + "F_%i(:) =", 3); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = ONE / THREE; + Xvecs[0] = ark_mem->ycur; + cvals[1] = TWO / THREE; + Xvecs[1] = ark_mem->yn; + cvals[2] = ONE / SIX * ark_mem->h; + Xvecs[2] = ark_mem->tempv3; + + retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * p5, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, 4, ark_mem->h, + ark_mem->tcur + ark_mem->h * p5); +#endif + + retval = step_mem->fe(ark_mem->tcur + ark_mem->h * p5, ark_mem->ycur, + ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", + "F_%i(:) =", 4); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * p5, ark_mem->tempv3, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, + ark_mem->tempv1); + } + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP43", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_TakeStepSSP104: + + This routine serves the primary purpose of the LSRKStepSSP104 module: + it performs a single SSP104 step (with embedding). + + The output variable dsmPtr should contain estimate of the + weighted local error if an embedding is present; otherwise it + should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. As this routine + involves no algebraic solve, it is set to 0 (success). + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + int retval; + ARKodeLSRKStepMem step_mem; + + /* initialize algebraic solver convergence flag to success, + temporal error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + const sunrealtype onesixth = ONE / SIX, onefifth = ONE / FIVE; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + sunrealtype* cvals = step_mem->cvals; + N_Vector* Xvecs = step_mem->Xvecs; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", + "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, ark_mem->h, ark_mem->tcur); +#endif + + /* The method is not FSAL. Therefore, fn ​is computed at the beginning + of the step unless ARKODE updated fn. */ + if (!ark_mem->fn_is_current) + { + retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, + ark_mem->user_data); + step_mem->nfe++; + ark_mem->fn_is_current = SUNTRUE; + if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", + "F(:) =", ""); + N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); +#endif + + N_VScale(ONE, ark_mem->yn, ark_mem->tempv2); + + N_VLinearSum(ONE, ark_mem->yn, onesixth * ark_mem->h, ark_mem->fn, + ark_mem->ycur); + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->yn, onefifth * ark_mem->h, ark_mem->fn, + ark_mem->tempv1); + } + + /* Evaluate stages j = 2,...,step_mem->req_stages */ + for (int j = 2; j <= 5; j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + + ((sunrealtype)j - ONE) * onesixth * ark_mem->h); +#endif + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ((sunrealtype)j - ONE) * + onesixth * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + retval = step_mem->fe(ark_mem->tcur + + ((sunrealtype)j - ONE) * onesixth * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, onesixth * ark_mem->h, ark_mem->tempv3, + ark_mem->ycur); + if (j == 4 && !ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, SUN_RCONST(0.3) * ark_mem->h, + ark_mem->tempv3, ark_mem->tempv1); + } + } + N_VLinearSum(SUN_RCONST(1.0) / SUN_RCONST(25.0), ark_mem->tempv2, + SUN_RCONST(9.0) / SUN_RCONST(25.0), ark_mem->ycur, + ark_mem->tempv2); + N_VLinearSum(SUN_RCONST(15.0), ark_mem->tempv2, SUN_RCONST(-5.0), + ark_mem->ycur, ark_mem->ycur); + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + TWO * onesixth * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + + for (int j = 6; j <= 9; j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, j, ark_mem->h, + ark_mem->tcur + + ((sunrealtype)j - FOUR) * onesixth * ark_mem->h); +#endif + + retval = step_mem->fe(ark_mem->tcur + + ((sunrealtype)j - FOUR) * onesixth * ark_mem->h, + ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", + "F_%i(:) =", j); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + N_VLinearSum(ONE, ark_mem->ycur, onesixth * ark_mem->h, ark_mem->tempv3, + ark_mem->ycur); + + if (j == 7 && !ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, onefifth * ark_mem->h, ark_mem->tempv3, + ark_mem->tempv1); + } + if (j == 9 && !ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->tempv1, SUN_RCONST(0.3) * ark_mem->h, + ark_mem->tempv3, ark_mem->tempv1); + } + + /* apply user-supplied stage postprocessing function (if supplied) */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur + ((sunrealtype)j - THREE) * + onesixth * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); + if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + } + } + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", + "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, + ark_mem->nst, 10, ark_mem->h, ark_mem->tcur + ark_mem->h); +#endif + + retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, + ark_mem->tempv3, ark_mem->user_data); + step_mem->nfe++; + if (retval < 0) { return ARK_RHSFUNC_FAIL; } + if (retval > 0) { return RHSFUNC_RECVR; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", + "F_%i(:) =", 10); + N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); +#endif + + cvals[0] = SUN_RCONST(0.6); + Xvecs[0] = ark_mem->ycur; + cvals[1] = ONE; + Xvecs[1] = ark_mem->tempv2; + cvals[2] = SUN_RCONST(0.1) * ark_mem->h; + Xvecs[2] = ark_mem->tempv3; + + retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + + /* Compute yerr (if step adaptivity enabled) */ + if (!ark_mem->fixedstep) + { + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); + + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "updated solution", + "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::lsrkStep_TakeStepSSP104", "error-test", + "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, + ark_mem->h, *dsmPtr); +#endif + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_Free frees all LSRKStep memory. + ---------------------------------------------------------------*/ +void lsrkStep_Free(ARKodeMem ark_mem) +{ + ARKodeLSRKStepMem step_mem; + + /* nothing to do if ark_mem is already NULL */ + if (ark_mem == NULL) { return; } + + /* conditional frees on non-NULL LSRKStep module */ + if (ark_mem->step_mem != NULL) + { + step_mem = (ARKodeLSRKStepMem)ark_mem->step_mem; + + /* free the reusable arrays for fused vector interface */ + if (step_mem->cvals != NULL) + { + free(step_mem->cvals); + step_mem->cvals = NULL; + ark_mem->lrw -= step_mem->nfusedopvecs; + } + if (step_mem->Xvecs != NULL) + { + free(step_mem->Xvecs); + step_mem->Xvecs = NULL; + ark_mem->liw -= step_mem->nfusedopvecs; + } + + /* free the time stepper module itself */ + free(ark_mem->step_mem); + ark_mem->step_mem = NULL; + } +} + +/*--------------------------------------------------------------- + lsrkStep_PrintMem: + + This routine outputs the memory from the LSRKStep structure to + a specified file pointer (useful when debugging). + ---------------------------------------------------------------*/ +void lsrkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +{ + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return; } + + /* print integrator memory to file */ + switch (step_mem->LSRKmethod) + { + case ARKODE_LSRK_RKC_2: + fprintf(outfile, "LSRKStep RKC time step module memory:\n"); + break; + case ARKODE_LSRK_RKL_2: + fprintf(outfile, "LSRKStep RKL time step module memory:\n"); + break; + case ARKODE_LSRK_SSP_S_2: + fprintf(outfile, "LSRKStep SSP(s,2) time step module memory:\n"); + break; + case ARKODE_LSRK_SSP_S_3: + fprintf(outfile, "LSRKStep SSP(s,3) time step module memory:\n"); + break; + case ARKODE_LSRK_SSP_10_4: + fprintf(outfile, "LSRKStep SSP(10,4) time step module memory:\n"); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method option."); + return; + } + + fprintf(outfile, "LSRKStep: q = %i\n", step_mem->q); + fprintf(outfile, "LSRKStep: p = %i\n", step_mem->p); + + if (step_mem->is_SSP) + { + fprintf(outfile, "LSRKStep: req_stages = %i\n", + step_mem->req_stages); + fprintf(outfile, "LSRKStep: nfe = %li\n", step_mem->nfe); + } + else if (!step_mem->is_SSP) + { + /* output integer quantities */ + fprintf(outfile, "LSRKStep: req_stages = %i\n", + step_mem->req_stages); + fprintf(outfile, "LSRKStep: dom_eig_nst = %li\n", + step_mem->dom_eig_nst); + fprintf(outfile, "LSRKStep: stage_max = %i\n", + step_mem->stage_max); + fprintf(outfile, "LSRKStep: stage_max_limit = %i\n", + step_mem->stage_max_limit); + fprintf(outfile, "LSRKStep: dom_eig_freq = %li\n", + step_mem->dom_eig_freq); + + /* output long integer quantities */ + fprintf(outfile, "LSRKStep: nfe = %li\n", step_mem->nfe); + fprintf(outfile, "LSRKStep: dom_eig_num_evals = %li\n", + step_mem->dom_eig_num_evals); + + /* output sunrealtype quantities */ + fprintf(outfile, "LSRKStep: dom_eig = %" RSYM " %+" RSYM "i\n", + step_mem->lambdaR, step_mem->lambdaI); + fprintf(outfile, "LSRKStep: spectral_radius = %" RSYM "\n", + step_mem->spectral_radius); + fprintf(outfile, "LSRKStep: spectral_radius_max = %" RSYM "\n", + step_mem->spectral_radius_max); + fprintf(outfile, "LSRKStep: spectral_radius_min = %" RSYM "\n", + step_mem->spectral_radius_min); + fprintf(outfile, "LSRKStep: dom_eig_safety = %" RSYM "\n", + step_mem->dom_eig_safety); + + /* output sunbooleantype quantities */ + fprintf(outfile, "LSRKStep: dom_eig_update = %d\n", + step_mem->dom_eig_update); + fprintf(outfile, "LSRKStep: dom_eig_is_current = %d\n", + step_mem->dom_eig_is_current); + } + else + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method type."); + return; + } +} + +/*=============================================================== + Internal utility routines + ===============================================================*/ + +/*--------------------------------------------------------------- + lsrkStep_AccessARKODEStepMem: + + Shortcut routine to unpack both ark_mem and step_mem structures + from void* pointer. If either is missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int lsrkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeLSRKStepMem* step_mem) +{ + /* access ARKodeMem structure */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + *ark_mem = (ARKodeMem)arkode_mem; + + /* access ARKodeLSRKStepMem structure */ + if ((*ark_mem)->step_mem == NULL) + { + arkProcessError(*ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_LSRKSTEP_NO_MEM); + return ARK_MEM_NULL; + } + *step_mem = (ARKodeLSRKStepMem)(*ark_mem)->step_mem; + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_AccessStepMem: + + Shortcut routine to unpack the step_mem structure from + ark_mem. If missing it returns ARK_MEM_NULL. + ---------------------------------------------------------------*/ +int lsrkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeLSRKStepMem* step_mem) +{ + /* access ARKodeLSRKStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_LSRKSTEP_NO_MEM); + return ARK_MEM_NULL; + } + *step_mem = (ARKodeLSRKStepMem)ark_mem->step_mem; + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_CheckNVector: + + This routine checks if all required vector operations are + present. If any of them is missing it returns SUNFALSE. + ---------------------------------------------------------------*/ +sunbooleantype lsrkStep_CheckNVector(N_Vector tmpl) +{ + if ((tmpl->ops->nvclone == NULL) || (tmpl->ops->nvdestroy == NULL) || + (tmpl->ops->nvlinearsum == NULL) || (tmpl->ops->nvconst == NULL) || + (tmpl->ops->nvscale == NULL) || (tmpl->ops->nvwrmsnorm == NULL) || + (tmpl->ops->nvspace == NULL)) + { + return SUNFALSE; + } + return SUNTRUE; +} + +/*--------------------------------------------------------------- + lsrkStep_DomEigUpdateLogic: + + This routine checks if the step is accepted or not and reassigns + the dom_eig update flags accordingly. + ---------------------------------------------------------------*/ + +void lsrkStep_DomEigUpdateLogic(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem, + sunrealtype dsm) +{ + if (dsm <= ONE) + { + N_VScale(ONE, ark_mem->tempv2, ark_mem->fn); + ark_mem->fn_is_current = SUNTRUE; + + step_mem->dom_eig_is_current = (step_mem->const_Jac == SUNTRUE); + + step_mem->dom_eig_update = SUNFALSE; + if (ark_mem->nst + 1 >= step_mem->dom_eig_nst + step_mem->dom_eig_freq) + { + step_mem->dom_eig_update = !step_mem->dom_eig_is_current; + } + } + else { step_mem->dom_eig_update = !step_mem->dom_eig_is_current; } +} + +/*--------------------------------------------------------------- + lsrkStep_ComputeNewDomEig: + + This routine computes new dom_eig and returns SUN_SUCCESS. + ---------------------------------------------------------------*/ + +int lsrkStep_ComputeNewDomEig(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem) +{ + int retval = SUN_SUCCESS; + + retval = step_mem->dom_eig_fn(ark_mem->tn, ark_mem->ycur, ark_mem->fn, + &step_mem->lambdaR, &step_mem->lambdaI, + ark_mem->user_data, ark_mem->tempv1, + ark_mem->tempv2, ark_mem->tempv3); + step_mem->dom_eig_num_evals++; + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_DOMEIG_FAIL, __LINE__, __func__, __FILE__, + "Unable to estimate the dominant eigenvalue"); + return ARK_DOMEIG_FAIL; + } + + if (step_mem->lambdaR * ark_mem->h > ZERO) + { + arkProcessError(NULL, ARK_DOMEIG_FAIL, __LINE__, __func__, __FILE__, + "lambdaR*h must be nonpositive"); + return ARK_DOMEIG_FAIL; + } + else if (step_mem->lambdaR == SUN_RCONST(0.0) && + SUNRabs(step_mem->lambdaI) > SUN_RCONST(0.0)) + { + arkProcessError(NULL, ARK_DOMEIG_FAIL, __LINE__, __func__, __FILE__, + "DomEig cannot be purely imaginary"); + return ARK_DOMEIG_FAIL; + } + + step_mem->lambdaR *= step_mem->dom_eig_safety; + step_mem->lambdaI *= step_mem->dom_eig_safety; + step_mem->spectral_radius = + SUNRsqrt(SUNSQR(step_mem->lambdaR) + SUNSQR(step_mem->lambdaI)); + + step_mem->dom_eig_is_current = SUNTRUE; + step_mem->dom_eig_nst = ark_mem->nst; + + step_mem->spectral_radius_max = + (step_mem->spectral_radius > step_mem->spectral_radius_max) + ? step_mem->spectral_radius + : step_mem->spectral_radius_max; + + if (step_mem->spectral_radius < step_mem->spectral_radius_min || + ark_mem->nst == 0) + { + step_mem->spectral_radius_min = step_mem->spectral_radius; + } + + step_mem->dom_eig_update = SUNFALSE; + + return retval; +} + +/*=============================================================== + EOF + ===============================================================*/ diff --git a/src/arkode/arkode_lsrkstep_impl.h b/src/arkode/arkode_lsrkstep_impl.h new file mode 100644 index 0000000000..d6cec7f545 --- /dev/null +++ b/src/arkode/arkode_lsrkstep_impl.h @@ -0,0 +1,219 @@ +/*--------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Implementation header file for ARKODE's LSRK time stepper + * module. + *--------------------------------------------------------------*/ + +#ifndef _ARKODE_LSRKSTEP_IMPL_H +#define _ARKODE_LSRKSTEP_IMPL_H + +#include <arkode/arkode_lsrkstep.h> + +#include "arkode_impl.h" + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +#define STAGE_MAX_LIMIT_DEFAULT 200 +#define DOM_EIG_SAFETY_DEFAULT SUN_RCONST(1.01) +#define DOM_EIG_FREQ_DEFAULT 25 + +/*=============================================================== + LSRK time step module private math function macros + =============================================================== + * SUNRlog calls the appropriate version of log + * + * SUNRsinh calls the appropriate version of sinh + * + * SUNRcosh calls the appropriate version of cosh + * ----------------------------------------------------------------- + */ + +/* + * ----------------------------------------------------------------- + * Function : SUNRlog + * ----------------------------------------------------------------- + * Usage : sunrealtype log_x; + * log_x = SUNRlog(x); + * ----------------------------------------------------------------- + * SUNRlog(x) returns log(x) (base-e logarithmic function). + * ----------------------------------------------------------------- + */ + +#ifndef SUNRlog +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define SUNRlog(x) (log((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define SUNRlog(x) (logf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define SUNRlog(x) (logl((x))) +#else +#error \ + "SUNDIALS precision not defined, report to github.com/LLNL/sundials/issues" +#endif +#endif + +/* + * ----------------------------------------------------------------- + * Function : SUNRsinh + * ----------------------------------------------------------------- + * Usage : sunrealtype sinh_x; + * sinh_x = SUNRsinh(x); + * ----------------------------------------------------------------- + * SUNRsinh(x) returns sinh(x) (the hyperbolic sine of x). + * ----------------------------------------------------------------- + */ + +#ifndef SUNRsinh +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define SUNRsinh(x) (sinh((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define SUNRsinh(x) (sinhf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define SUNRsinh(x) (sinhl((x))) +#else +#error \ + "SUNDIALS precision not defined, report to github.com/LLNL/sundials/issues" +#endif +#endif + +/* + * ----------------------------------------------------------------- + * Function : SUNRcosh + * ----------------------------------------------------------------- + * Usage : sunrealtype cosh_x; + * cosh_x = SUNRcosh(x); + * ----------------------------------------------------------------- + * SUNRcosh(x) returns cosh(x) (the hyperbolic cosine of x). + * ----------------------------------------------------------------- + */ + +#ifndef SUNRcosh +#if defined(SUNDIALS_DOUBLE_PRECISION) +#define SUNRcosh(x) (cosh((x))) +#elif defined(SUNDIALS_SINGLE_PRECISION) +#define SUNRcosh(x) (coshf((x))) +#elif defined(SUNDIALS_EXTENDED_PRECISION) +#define SUNRcosh(x) (coshl((x))) +#else +#error \ + "SUNDIALS precision not defined, report to github.com/LLNL/sundials/issues" +#endif +#endif + +/*=============================================================== + LSRK time step module data structure + ===============================================================*/ + +/*--------------------------------------------------------------- + Types : struct ARKodeLSRKStepMemRec, ARKodeLSRKStepMem + --------------------------------------------------------------- + The type ARKodeLSRKStepMem is type pointer to struct + ARKodeLSRKStepMemRec. This structure contains fields to + perform an explicit Runge-Kutta time step. + ---------------------------------------------------------------*/ +typedef struct ARKodeLSRKStepMemRec +{ + /* LSRK problem specification */ + ARKRhsFn fe; + ARKDomEigFn dom_eig_fn; + + int q; /* method order */ + int p; /* embedding order */ + + int req_stages; /* number of requested stages */ + + ARKODE_LSRKMethodType LSRKmethod; + + /* Counters and stats*/ + long int nfe; /* num fe calls */ + long int dom_eig_num_evals; /* num of dom_eig computations */ + int stage_max; /* num of max stages used */ + int stage_max_limit; /* max allowed num of stages */ + long int dom_eig_nst; /* num of step at which the last domainant eigenvalue was computed */ + long int step_nst; /* The number of successful steps. */ + + /* Spectral info */ + sunrealtype lambdaR; /* Real part of the dominated eigenvalue*/ + sunrealtype lambdaI; /* Imaginary part of the dominated eigenvalue*/ + sunrealtype spectral_radius; /* spectral radius*/ + sunrealtype spectral_radius_max; /* max spectral radius*/ + sunrealtype spectral_radius_min; /* min spectral radius*/ + sunrealtype dom_eig_safety; /* some safety factor for the user provided dom_eig*/ + long int dom_eig_freq; /* indicates dom_eig update after dom_eig_freq successful steps*/ + + /* Flags */ + sunbooleantype dom_eig_update; /* flag indicating new dom_eig is needed */ + sunbooleantype const_Jac; /* flag indicating Jacobian is constant */ + sunbooleantype dom_eig_is_current; /* SUNTRUE if dom_eig has been evaluated at tn */ + sunbooleantype is_SSP; /* flag indicating SSP method*/ + + /* Reusable fused vector operation arrays */ + sunrealtype* cvals; + N_Vector* Xvecs; + int nfusedopvecs; /* length of cvals and Xvecs arrays */ + +}* ARKodeLSRKStepMem; + +/*=============================================================== + LSRK time step module private function prototypes + ===============================================================*/ + +/* Interface routines supplied to ARKODE */ +void* lsrkStep_Create_Commons(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, + SUNContext sunctx); +int lsrkStep_ReInit_Commons(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, + N_Vector y0); +int lsrkStep_Init(ARKodeMem ark_mem, int init_type); +int lsrkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, + int mode); +int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, + int* nflagPtr); +int lsrkStep_SetDefaults(ARKodeMem ark_mem); +int lsrkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt); +int lsrkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp); +void lsrkStep_Free(ARKodeMem ark_mem); +void lsrkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int lsrkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals); +int lsrkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); + +/* Internal utility routines */ +int lsrkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, ARKodeLSRKStepMem* step_mem); +int lsrkStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeLSRKStepMem* step_mem); +sunbooleantype lsrkStep_CheckNVector(N_Vector tmpl); +void lsrkStep_DomEigUpdateLogic(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem, + sunrealtype dsm); +int lsrkStep_ComputeNewDomEig(ARKodeMem ark_mem, ARKodeLSRKStepMem step_mem); + +/*=============================================================== + Reusable LSRKStep Error Messages + ===============================================================*/ + +/* Initialization and I/O error messages */ +#define MSG_LSRKSTEP_NO_MEM "Time step module memory is NULL." + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/arkode/arkode_lsrkstep_io.c b/src/arkode/arkode_lsrkstep_io.c new file mode 100644 index 0000000000..a80df94efe --- /dev/null +++ b/src/arkode/arkode_lsrkstep_io.c @@ -0,0 +1,759 @@ +/*--------------------------------------------------------------- + * Programmer(s): Mustafa Aggul @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 optional input and + * output functions for the ARKODE LSRKStep time stepper module. + *--------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> +#include <sundials/sundials_math.h> +#include <sundials/sundials_types.h> + +#include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include "arkode_lsrkstep_impl.h" + +/*=============================================================== + Exported optional input functions. + ===============================================================*/ + +/*--------------------------------------------------------------- + LSRKStepSetSTSMethod sets method + ARKODE_LSRK_RKC_2 + ARKODE_LSRK_RKL_2 + ---------------------------------------------------------------*/ +int LSRKStepSetSTSMethod(void* arkode_mem, ARKODE_LSRKMethodType method) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + switch (method) + { + case ARKODE_LSRK_RKC_2: + ark_mem->step = lsrkStep_TakeStepRKC; + step_mem->is_SSP = SUNFALSE; + step_mem->nfusedopvecs = 5; + step_mem->q = ark_mem->hadapt_mem->q = 2; + step_mem->p = ark_mem->hadapt_mem->p = 2; + step_mem->step_nst = 0; + break; + case ARKODE_LSRK_RKL_2: + ark_mem->step = lsrkStep_TakeStepRKL; + step_mem->is_SSP = SUNFALSE; + step_mem->nfusedopvecs = 5; + step_mem->q = ark_mem->hadapt_mem->q = 2; + step_mem->p = ark_mem->hadapt_mem->p = 2; + step_mem->step_nst = 0; + break; + case ARKODE_LSRK_SSP_S_2: + case ARKODE_LSRK_SSP_S_3: + case ARKODE_LSRK_SSP_10_4: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Invalid method option: Call LSRKStepCreateSSP to create an SSP method first."); + break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method option."); + return ARK_ILL_INPUT; + } + + step_mem->LSRKmethod = method; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + LSRKStepSetSSPMethod sets method + ARKODE_LSRK_SSP_S_2 + ARKODE_LSRK_SSP_S_3 + ARKODE_LSRK_SSP_10_4 + ---------------------------------------------------------------*/ + +int LSRKStepSetSSPMethod(void* arkode_mem, ARKODE_LSRKMethodType method) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + switch (method) + { + case ARKODE_LSRK_RKC_2: + case ARKODE_LSRK_RKL_2: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Invalid method option: Call LSRKStepCreateSTS to create an STS method first."); + break; + case ARKODE_LSRK_SSP_S_2: + ark_mem->step = lsrkStep_TakeStepSSPs2; + step_mem->is_SSP = SUNTRUE; + step_mem->req_stages = 10; + step_mem->nfusedopvecs = 3; + step_mem->q = ark_mem->hadapt_mem->q = 2; + step_mem->p = ark_mem->hadapt_mem->p = 1; + break; + case ARKODE_LSRK_SSP_S_3: + ark_mem->step = lsrkStep_TakeStepSSPs3; + step_mem->is_SSP = SUNTRUE; + step_mem->req_stages = 9; + step_mem->nfusedopvecs = 3; + step_mem->q = ark_mem->hadapt_mem->q = 3; + step_mem->p = ark_mem->hadapt_mem->p = 2; + break; + case ARKODE_LSRK_SSP_10_4: + ark_mem->step = lsrkStep_TakeStepSSP104; + step_mem->is_SSP = SUNTRUE; + step_mem->req_stages = 10; + step_mem->nfusedopvecs = 3; + step_mem->q = ark_mem->hadapt_mem->q = 4; + step_mem->p = ark_mem->hadapt_mem->p = 3; + break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method option."); + return ARK_ILL_INPUT; + } + + step_mem->LSRKmethod = method; + + return ARK_SUCCESS; +} + +int LSRKStepSetSTSMethodByName(void* arkode_mem, const char* emethod) +{ + if (strcmp(emethod, "ARKODE_LSRK_RKC_2") == 0) + { + return LSRKStepSetSTSMethod(arkode_mem, ARKODE_LSRK_RKC_2); + } + if (strcmp(emethod, "ARKODE_LSRK_RKL_2") == 0) + { + return LSRKStepSetSTSMethod(arkode_mem, ARKODE_LSRK_RKL_2); + } + if ((strcmp(emethod, "ARKODE_LSRK_SSP_S_2") == 0) || + (strcmp(emethod, "ARKODE_LSRK_SSP_S_3") == 0) || + (strcmp(emethod, "ARKODE_LSRK_SSP_10_4") == 0)) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Invalid method option: Call LSRKStepCreateSTS to create an STS method first."); + } + + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown method type"); + + return ARK_ILL_INPUT; +} + +int LSRKStepSetSSPMethodByName(void* arkode_mem, const char* emethod) +{ + if ((strcmp(emethod, "ARKODE_LSRK_RKC_2") == 0) || + (strcmp(emethod, "ARKODE_LSRK_RKL_2") == 0)) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Invalid method option: Call LSRKStepCreateSSP to create an SSP method first."); + } + if (strcmp(emethod, "ARKODE_LSRK_SSP_S_2") == 0) + { + return LSRKStepSetSSPMethod(arkode_mem, ARKODE_LSRK_SSP_S_2); + } + if (strcmp(emethod, "ARKODE_LSRK_SSP_S_3") == 0) + { + return LSRKStepSetSSPMethod(arkode_mem, ARKODE_LSRK_SSP_S_3); + } + if (strcmp(emethod, "ARKODE_LSRK_SSP_10_4") == 0) + { + return LSRKStepSetSSPMethod(arkode_mem, ARKODE_LSRK_SSP_10_4); + } + + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown method type"); + + return ARK_ILL_INPUT; +} + +/*--------------------------------------------------------------- + LSRKStepSetDomEigFn specifies the dom_eig function. + Specifies the dominant eigenvalue approximation routine to be used for determining + the number of stages that will be used by either the RKC or RKL methods. + ---------------------------------------------------------------*/ +int LSRKStepSetDomEigFn(void* arkode_mem, ARKDomEigFn dom_eig) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* set the dom_eig routine pointer, and update relevant flags */ + if (dom_eig != NULL) + { + step_mem->dom_eig_fn = dom_eig; + + return ARK_SUCCESS; + } + else + { + step_mem->dom_eig_fn = NULL; + + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Internal dom_eig is not supported yet!"); + return ARK_ILL_INPUT; + } +} + +/*--------------------------------------------------------------- + LSRKStepSetDomEigFrequency sets dom_eig computation frequency - + Dominated Eigenvalue is recomputed after "nsteps" successful steps. + + nsteps = 0 refers to constant dominant eigenvalue + nsteps < 0 resets the default value 25 and sets nonconstant dominant eigenvalue + ---------------------------------------------------------------*/ +int LSRKStepSetDomEigFrequency(void* arkode_mem, long int nsteps) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (nsteps < 0) + { + step_mem->dom_eig_freq = DOM_EIG_FREQ_DEFAULT; + step_mem->const_Jac = SUNFALSE; + } + + if (nsteps == 0) + { + step_mem->const_Jac = SUNTRUE; + step_mem->dom_eig_freq = 1; + } + else + { + step_mem->dom_eig_freq = nsteps; + step_mem->const_Jac = SUNFALSE; + } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + LSRKStepSetMaxNumStages sets the maximum number of stages allowed. + If the combination of the maximum number of stages and the current + time step size in the LSRKStep module does not allow for a stable + step, the step routine returns to ARKODE for an updated (refined) + step size. The number of such returns is tracked in a counter, + which can be accessed using ARKodeGetNumExpSteps. + ---------------------------------------------------------------*/ +int LSRKStepSetMaxNumStages(void* arkode_mem, int stage_max_limit) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (stage_max_limit < 2) + { + step_mem->stage_max_limit = STAGE_MAX_LIMIT_DEFAULT; + } + else { step_mem->stage_max_limit = stage_max_limit; } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + LSRKStepSetDomEigSafetyFactor sets the safety factor for the DomEigs. + Specifies a safety factor to use for the result of the dominant eigenvalue estimation function. + This value is used to scale the magnitude of the dominant eigenvalue, in the hope of ensuring + a sufficient number of stages for the method to be stable. This input is only used for RKC + and RKL methods. + + Calling this function with dom_eig_safety < 0 resets the default value + ---------------------------------------------------------------*/ +int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (dom_eig_safety < SUN_RCONST(1.0)) + { + step_mem->dom_eig_safety = DOM_EIG_SAFETY_DEFAULT; + } + else { step_mem->dom_eig_safety = dom_eig_safety; } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + LSRKStepSetSSPStageNum sets the number of stages in the following + SSP methods: + + ARKODE_LSRK_SSP_S_2 -- num_of_stages must be greater than or equal to 2 + ARKODE_LSRK_SSP_S_3 -- num_of_stages must be a perfect square greater than or equal to 4 + ARKODE_LSRK_SSP_10_4 -- num_of_stages must be equal to 10 - no need to call! + + Sets the number of stages, s in SSP(s, p) methods. This input is only utilized by + SSPRK methods. Thus, this set routine must be called after calling LSRKStepSetSSPMethod. + + Calling this function with num_of_stages =< 0 resets the default value. + ---------------------------------------------------------------*/ +int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (!step_mem->is_SSP) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Call this function only for SSP methods: Use " + "LSRKStepSetSSPMethod to declare SSP method type first!"); + return ARK_ILL_INPUT; + } + + if (num_of_stages <= 0) + { + switch (step_mem->LSRKmethod) + { + case ARKODE_LSRK_SSP_S_2: step_mem->req_stages = 10; break; + + case ARKODE_LSRK_SSP_S_3: step_mem->req_stages = 9; break; + + case ARKODE_LSRK_SSP_10_4: step_mem->req_stages = 10; break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Call LSRKStepSetSSPMethod to declare SSP method type first!"); + return ARK_ILL_INPUT; + break; + } + return ARK_SUCCESS; + } + else + { + switch (step_mem->LSRKmethod) + { + case ARKODE_LSRK_SSP_S_2: + if (num_of_stages < 2) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "num_of_stages must be greater than or equal to 2, or " + "set it less than or equal to 0 to reset the default " + "value"); + return ARK_ILL_INPUT; + } + break; + + case ARKODE_LSRK_SSP_S_3: + /* The SSP3 method differs significantly when s = 4. Therefore, the case + where num_of_stages = 4 is considered separately to avoid unnecessary + boolean checks and improve computational efficiency. */ + + /* We check that num_of_stages is a perfect square. Note the call to sqrt + * rather than SUNRsqrt which could cause loss of precision if + * sunrealtype is float. sqrt cannot produce a number bigger than INT_MAX + * here so there's no problem with the cast back to int */ + if (num_of_stages < 4 || SUNSQR((int)sqrt(num_of_stages)) != num_of_stages) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "num_of_stages must be a perfect square greater than " + "or equal to 4, or set it less than or equal to 0 to " + "reset the default value"); + return ARK_ILL_INPUT; + } + if (num_of_stages == 4) { ark_mem->step = lsrkStep_TakeStepSSP43; } + break; + + case ARKODE_LSRK_SSP_10_4: + if (num_of_stages != 10) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "SSP10_4 method has a prefixed num_of_stages = 10"); + return ARK_ILL_INPUT; + } + break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Call LSRKStepSetSSPMethod to declare SSP method type first!"); + return ARK_ILL_INPUT; + break; + } + step_mem->req_stages = num_of_stages; + } + + return ARK_SUCCESS; +} + +/*=============================================================== + Exported optional output functions. + ===============================================================*/ + +/*--------------------------------------------------------------- + LSRKStepGetNumDomEigUpdates: + + Returns the number of dominant eigenvalue updates + ---------------------------------------------------------------*/ +int LSRKStepGetNumDomEigUpdates(void* arkode_mem, long int* dom_eig_num_evals) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (dom_eig_num_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "dom_eig_num_evals cannot be NULL"); + return ARK_ILL_INPUT; + } + + /* get values from step_mem */ + *dom_eig_num_evals = step_mem->dom_eig_num_evals; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + LSRKStepGetMaxNumStages: + + Returns the max number of stages used + ---------------------------------------------------------------*/ +int LSRKStepGetMaxNumStages(void* arkode_mem, int* stage_max) +{ + ARKodeMem ark_mem; + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeLSRKStepMem structures */ + retval = lsrkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (stage_max == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stage_max cannot be NULL"); + return ARK_ILL_INPUT; + } + + /* get values from step_mem */ + *stage_max = step_mem->stage_max; + + return ARK_SUCCESS; +} + +/*=============================================================== + Private functions attached to ARKODE + ===============================================================*/ + +/*--------------------------------------------------------------- + lsrkStep_SetDefaults: + + Resets all LSRKStep optional inputs to their default values. + Does not change problem-defining function pointers or + user_data pointer. + ---------------------------------------------------------------*/ +int lsrkStep_SetDefaults(ARKodeMem ark_mem) +{ + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* Set default values for integrator optional inputs + (overwrite some adaptivity params for LSRKStep use) */ + step_mem->req_stages = 0; /* no stages */ + + /* Spectral info */ + step_mem->lambdaR = ZERO; + step_mem->lambdaI = ZERO; + step_mem->spectral_radius = ZERO; + step_mem->spectral_radius_max = ZERO; + step_mem->spectral_radius_min = ZERO; + step_mem->dom_eig_safety = DOM_EIG_SAFETY_DEFAULT; + step_mem->dom_eig_freq = DOM_EIG_FREQ_DEFAULT; + + /* Flags */ + step_mem->dom_eig_update = SUNTRUE; + step_mem->const_Jac = SUNFALSE; + step_mem->dom_eig_is_current = SUNFALSE; + step_mem->is_SSP = SUNFALSE; + + /* Remove current SUNAdaptController object if exists, + and replace with the ARKODE-default "PID" */ + if (ark_mem->hadapt_mem->owncontroller) + { + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_Destroy failure"); + return (ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptControllerPID allocation failure"); + return (ARK_MEM_FAIL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_PrintAllStats: + + Prints integrator statistics for STS methods + ---------------------------------------------------------------*/ +int lsrkStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) +{ + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (step_mem->is_SSP) + { + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + fprintf(outfile, "RHS fn evals = %ld\n", step_mem->nfe); + fprintf(outfile, "Number of stages used = %d\n", + step_mem->req_stages); + break; + case SUN_OUTPUTFORMAT_CSV: + fprintf(outfile, ",RHS fn evals,%ld", step_mem->nfe); + fprintf(outfile, ",Number of stages used,%d", step_mem->req_stages); + fprintf(outfile, "\n"); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return ARK_ILL_INPUT; + } + } + else if (!step_mem->is_SSP) + { + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + fprintf(outfile, "RHS fn evals = %ld\n", step_mem->nfe); + fprintf(outfile, "Number of dom_eig updates = %ld\n", + step_mem->dom_eig_num_evals); + fprintf(outfile, "Max. num. of stages used = %d\n", + step_mem->stage_max); + fprintf(outfile, "Max. num. of stages allowed = %d\n", + step_mem->stage_max_limit); + fprintf(outfile, "Max. spectral radius = %" RSYM "\n", + step_mem->spectral_radius_max); + fprintf(outfile, "Min. spectral radius = %" RSYM "\n", + step_mem->spectral_radius_min); + break; + case SUN_OUTPUTFORMAT_CSV: + fprintf(outfile, ",RHS fn evals,%ld", step_mem->nfe); + fprintf(outfile, ",Number of dom_eig update calls,%ld", + step_mem->dom_eig_num_evals); + fprintf(outfile, ",Max. num. of stages used,%d", step_mem->stage_max); + fprintf(outfile, ",Max. num. of stages allowed,%d", + step_mem->stage_max_limit); + fprintf(outfile, ",Max. spectral radius,%" RSYM "", + step_mem->spectral_radius_max); + fprintf(outfile, ",Min. spectral radius,%" RSYM "", + step_mem->spectral_radius_min); + fprintf(outfile, "\n"); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return ARK_ILL_INPUT; + } + } + else + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method type."); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_WriteParameters: + + Outputs all solver parameters to the provided file pointer. + ---------------------------------------------------------------*/ +int lsrkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +{ + ARKodeLSRKStepMem step_mem; + int retval; + + /* access ARKodeLSRKStepMem structure */ + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* print integrator parameters to file */ + switch (step_mem->LSRKmethod) + { + case ARKODE_LSRK_RKC_2: + fprintf(fp, "LSRKStep RKC time step module parameters:\n"); + break; + case ARKODE_LSRK_RKL_2: + fprintf(fp, "LSRKStep RKL time step module parameters:\n"); + break; + case ARKODE_LSRK_SSP_S_2: + fprintf(fp, "LSRKStep SSP(s,2) time step module parameters:\n"); + break; + case ARKODE_LSRK_SSP_S_3: + fprintf(fp, "LSRKStep SSP(s,3) time step module parameters:\n"); + break; + case ARKODE_LSRK_SSP_10_4: + fprintf(fp, "LSRKStep SSP(10,4) time step module parameters:\n"); + + break; + + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method option."); + return ARK_ILL_INPUT; + } + + fprintf(fp, " Method order %i\n", step_mem->q); + fprintf(fp, " Embedding order %i\n", step_mem->p); + + switch (step_mem->is_SSP) + { + case SUNTRUE: + fprintf(fp, " Number of stages used = %i\n", step_mem->req_stages); + break; + case SUNFALSE: + fprintf(fp, " Maximum number of stages allowed = %i\n", + step_mem->stage_max_limit); + fprintf(fp, " Current spectral radius = %" RSYM "\n", + step_mem->spectral_radius); + fprintf(fp, " Safety factor for the dom eig = %" RSYM "\n", + step_mem->dom_eig_safety); + fprintf(fp, " Max num of successful steps before new dom eig update = %li\n", + step_mem->dom_eig_freq); + fprintf(fp, " Flag to indicate Jacobian is constant = %d\n", + step_mem->const_Jac); + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid method type."); + return ARK_ILL_INPUT; + } + + fprintf(fp, "\n"); + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_GetNumRhsEvals: + + Returns the current number of RHS calls + ---------------------------------------------------------------*/ +int lsrkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, + long int* rhs_evals) +{ + ARKodeLSRKStepMem step_mem = NULL; + + /* access ARKodeLSRKStepMem structure */ + int retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (rhs_evals == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "rhs_evals is NULL"); + return ARK_ILL_INPUT; + } + + if (partition_index > 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid partition index"); + return ARK_ILL_INPUT; + } + + *rhs_evals = step_mem->nfe; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + lsrkStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector + ---------------------------------------------------------------*/ +int lsrkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) +{ + int retval; + ARKodeLSRKStepMem step_mem; + retval = lsrkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* return an error if local truncation error is not computed */ + if (ark_mem->fixedstep) { return ARK_STEPPER_UNSUPPORTED; } + + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); + return ARK_SUCCESS; +} + +/*=============================================================== + EOF + ===============================================================*/ diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index 712debfaea..f7b75eaf9f 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -129,7 +129,7 @@ int MRIStepSetPostInnerFn(void* arkode_mem, MRIStepPostInnerFn postfn) ===============================================================*/ /*--------------------------------------------------------------- - MRIStepGetNumRhsEvals: + mriStep_GetNumRhsEvals: Returns the current number of RHS calls ---------------------------------------------------------------*/ diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index 8dc76a9234..4ae9775e68 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -152,7 +152,7 @@ int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage) } /*--------------------------------------------------------------- - SPRKStepGetNumRhsEvals: + sprkStep_GetNumRhsEvals: Returns the current number of RHS calls ---------------------------------------------------------------*/ diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.c b/src/arkode/fmod_int32/farkode_lsrkstep_mod.c new file mode 100644 index 0000000000..6bd21a6cca --- /dev/null +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.c @@ -0,0 +1,459 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_lsrkstep.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + +SWIGEXPORT void * _wrap_FLSRKStepCreateSTS(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (SUNContext)(farg4); + result = (void *)LSRKStepCreateSTS(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FLSRKStepCreateSSP(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (SUNContext)(farg4); + result = (void *)LSRKStepCreateSSP(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepReInitSTS(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)LSRKStepReInitSTS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepReInitSSP(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)LSRKStepReInitSSP(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSTSMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_LSRKMethodType arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_LSRKMethodType)(*farg2); + result = (int)LSRKStepSetSTSMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_LSRKMethodType arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_LSRKMethodType)(*farg2); + result = (int)LSRKStepSetSSPMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSTSMethodByName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)LSRKStepSetSTSMethodByName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPMethodByName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)LSRKStepSetSSPMethodByName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigFn(void *farg1, ARKDomEigFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKDomEigFn arg2 = (ARKDomEigFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKDomEigFn)(farg2); + result = (int)LSRKStepSetDomEigFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)LSRKStepSetDomEigFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetMaxNumStages(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)LSRKStepSetMaxNumStages(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)LSRKStepSetDomEigSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)LSRKStepSetSSPStageNum(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepGetNumDomEigUpdates(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)LSRKStepGetNumDomEigUpdates(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepGetMaxNumStages(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)LSRKStepGetMaxNumStages(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 new file mode 100644 index 0000000000..b00334f720 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 @@ -0,0 +1,496 @@ +! 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-2024, 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 farkode_lsrkstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + ! typedef enum ARKODE_LSRKMethodType + enum, bind(c) + enumerator :: ARKODE_LSRK_RKC_2 + enumerator :: ARKODE_LSRK_RKL_2 + enumerator :: ARKODE_LSRK_SSP_S_2 + enumerator :: ARKODE_LSRK_SSP_S_3 + enumerator :: ARKODE_LSRK_SSP_10_4 + end enum + integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) + public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 + public :: FLSRKStepCreateSTS + public :: FLSRKStepCreateSSP + public :: FLSRKStepReInitSTS + public :: FLSRKStepReInitSSP + public :: FLSRKStepSetSTSMethod + public :: FLSRKStepSetSSPMethod + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FLSRKStepSetSTSMethodByName + public :: FLSRKStepSetSSPMethodByName + public :: FLSRKStepSetDomEigFn + public :: FLSRKStepSetDomEigFrequency + public :: FLSRKStepSetMaxNumStages + public :: FLSRKStepSetDomEigSafetyFactor + public :: FLSRKStepSetSSPStageNum + public :: FLSRKStepGetNumDomEigUpdates + public :: FLSRKStepGetMaxNumStages + +! WRAPPER DECLARATIONS +interface +function swigc_FLSRKStepCreateSTS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepCreateSTS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FLSRKStepCreateSSP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepCreateSSP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FLSRKStepReInitSTS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepReInitSTS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepReInitSSP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepReInitSSP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetSTSMethod(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSTSMethod") & +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_FLSRKStepSetSSPMethod(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPMethod") & +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_FLSRKStepSetSTSMethodByName(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSTSMethodByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetSSPMethodByName(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPMethodByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetDomEigFn(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetDomEigFrequency(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetMaxNumStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetMaxNumStages") & +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_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigSafetyFactor") & +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_FLSRKStepSetSSPStageNum(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPStageNum") & +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_FLSRKStepGetNumDomEigUpdates(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepGetNumDomEigUpdates") & +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_FLSRKStepGetMaxNumStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepGetMaxNumStages") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FLSRKStepCreateSTS(rhs, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = rhs +farg2 = t0 +farg3 = c_loc(y0) +farg4 = sunctx +fresult = swigc_FLSRKStepCreateSTS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepCreateSSP(rhs, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = rhs +farg2 = t0 +farg3 = c_loc(y0) +farg4 = sunctx +fresult = swigc_FLSRKStepCreateSSP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepReInitSTS(arkode_mem, rhs, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = rhs +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FLSRKStepReInitSTS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepReInitSSP(arkode_mem, rhs, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = rhs +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FLSRKStepReInitSSP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepSetSTSMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FLSRKStepSetSTSMethod(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FLSRKStepSetSSPMethod(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FLSRKStepSetSTSMethodByName(arkode_mem, emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: emethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(emethod, farg2_chars, farg2) +fresult = swigc_FLSRKStepSetSTSMethodByName(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPMethodByName(arkode_mem, emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: emethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(emethod, farg2_chars, farg2) +fresult = swigc_FLSRKStepSetSSPMethodByName(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigFn(arkode_mem, dom_eig) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: dom_eig +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = dom_eig +fresult = swigc_FLSRKStepSetDomEigFn(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigFrequency(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = nsteps +fresult = swigc_FLSRKStepSetDomEigFrequency(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetMaxNumStages(arkode_mem, stage_max_limit) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: stage_max_limit +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = stage_max_limit +fresult = swigc_FLSRKStepSetMaxNumStages(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigSafetyFactor(arkode_mem, dom_eig_safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dom_eig_safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dom_eig_safety +fresult = swigc_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: num_of_stages +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = num_of_stages +fresult = swigc_FLSRKStepSetSSPStageNum(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepGetNumDomEigUpdates(arkode_mem, dom_eig_num_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: dom_eig_num_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(dom_eig_num_evals(1)) +fresult = swigc_FLSRKStepGetNumDomEigUpdates(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepGetMaxNumStages(arkode_mem, stage_max) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: stage_max +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stage_max(1)) +fresult = swigc_FLSRKStepGetMaxNumStages(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index d5eefa63da..5dca9b3b38 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -94,6 +94,8 @@ module farkode_mod 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_STEPPER_UNSUPPORTED = -48_C_INT + integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT + integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.c b/src/arkode/fmod_int64/farkode_lsrkstep_mod.c new file mode 100644 index 0000000000..6bd21a6cca --- /dev/null +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.c @@ -0,0 +1,459 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_lsrkstep.h" + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + +SWIGEXPORT void * _wrap_FLSRKStepCreateSTS(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (SUNContext)(farg4); + result = (void *)LSRKStepCreateSTS(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT void * _wrap_FLSRKStepCreateSSP(ARKRhsFn farg1, double const *farg2, N_Vector farg3, void *farg4) { + void * fresult ; + ARKRhsFn arg1 = (ARKRhsFn) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNContext arg4 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (ARKRhsFn)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (SUNContext)(farg4); + result = (void *)LSRKStepCreateSSP(arg1,arg2,arg3,arg4); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepReInitSTS(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)LSRKStepReInitSTS(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepReInitSSP(void *farg1, ARKRhsFn farg2, double const *farg3, N_Vector farg4) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKRhsFn arg2 = (ARKRhsFn) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKRhsFn)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + result = (int)LSRKStepReInitSSP(arg1,arg2,arg3,arg4); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSTSMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_LSRKMethodType arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_LSRKMethodType)(*farg2); + result = (int)LSRKStepSetSTSMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPMethod(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKODE_LSRKMethodType arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKODE_LSRKMethodType)(*farg2); + result = (int)LSRKStepSetSSPMethod(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSTSMethodByName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)LSRKStepSetSTSMethodByName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPMethodByName(void *farg1, SwigArrayWrapper *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + char *arg2 = (char *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (char *)(farg2->data); + result = (int)LSRKStepSetSSPMethodByName(arg1,(char const *)arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigFn(void *farg1, ARKDomEigFn farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKDomEigFn arg2 = (ARKDomEigFn) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKDomEigFn)(farg2); + result = (int)LSRKStepSetDomEigFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigFrequency(void *farg1, long const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long)(*farg2); + result = (int)LSRKStepSetDomEigFrequency(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetMaxNumStages(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)LSRKStepSetMaxNumStages(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetDomEigSafetyFactor(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)LSRKStepSetDomEigSafetyFactor(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)LSRKStepSetSSPStageNum(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepGetNumDomEigUpdates(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)LSRKStepGetNumDomEigUpdates(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FLSRKStepGetMaxNumStages(void *farg1, int *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int *arg2 = (int *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int *)(farg2); + result = (int)LSRKStepGetMaxNumStages(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 new file mode 100644 index 0000000000..b00334f720 --- /dev/null +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 @@ -0,0 +1,496 @@ +! 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-2024, 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 farkode_lsrkstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + ! typedef enum ARKODE_LSRKMethodType + enum, bind(c) + enumerator :: ARKODE_LSRK_RKC_2 + enumerator :: ARKODE_LSRK_RKL_2 + enumerator :: ARKODE_LSRK_SSP_S_2 + enumerator :: ARKODE_LSRK_SSP_S_3 + enumerator :: ARKODE_LSRK_SSP_10_4 + end enum + integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) + public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 + public :: FLSRKStepCreateSTS + public :: FLSRKStepCreateSSP + public :: FLSRKStepReInitSTS + public :: FLSRKStepReInitSSP + public :: FLSRKStepSetSTSMethod + public :: FLSRKStepSetSSPMethod + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FLSRKStepSetSTSMethodByName + public :: FLSRKStepSetSSPMethodByName + public :: FLSRKStepSetDomEigFn + public :: FLSRKStepSetDomEigFrequency + public :: FLSRKStepSetMaxNumStages + public :: FLSRKStepSetDomEigSafetyFactor + public :: FLSRKStepSetSSPStageNum + public :: FLSRKStepGetNumDomEigUpdates + public :: FLSRKStepGetMaxNumStages + +! WRAPPER DECLARATIONS +interface +function swigc_FLSRKStepCreateSTS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepCreateSTS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FLSRKStepCreateSSP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepCreateSSP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_FUNPTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR) :: fresult +end function + +function swigc_FLSRKStepReInitSTS(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepReInitSTS") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepReInitSSP(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FLSRKStepReInitSSP") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetSTSMethod(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSTSMethod") & +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_FLSRKStepSetSSPMethod(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPMethod") & +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_FLSRKStepSetSTSMethodByName(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSTSMethodByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetSSPMethodByName(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPMethodByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(C_PTR), value :: farg1 +type(SwigArrayWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetDomEigFn(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetDomEigFrequency(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigFrequency") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_LONG), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FLSRKStepSetMaxNumStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetMaxNumStages") & +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_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetDomEigSafetyFactor") & +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_FLSRKStepSetSSPStageNum(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetSSPStageNum") & +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_FLSRKStepGetNumDomEigUpdates(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepGetNumDomEigUpdates") & +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_FLSRKStepGetMaxNumStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepGetMaxNumStages") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FLSRKStepCreateSTS(rhs, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = rhs +farg2 = t0 +farg3 = c_loc(y0) +farg4 = sunctx +fresult = swigc_FLSRKStepCreateSTS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepCreateSSP(rhs, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_FUNPTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = rhs +farg2 = t0 +farg3 = c_loc(y0) +farg4 = sunctx +fresult = swigc_FLSRKStepCreateSSP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepReInitSTS(arkode_mem, rhs, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = rhs +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FLSRKStepReInitSTS(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepReInitSSP(arkode_mem, rhs, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: rhs +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 + +farg1 = arkode_mem +farg2 = rhs +farg3 = t0 +farg4 = c_loc(y0) +fresult = swigc_FLSRKStepReInitSSP(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FLSRKStepSetSTSMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FLSRKStepSetSTSMethod(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPMethod(arkode_mem, method) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = method +fresult = swigc_FLSRKStepSetSSPMethod(farg1, farg2) +swig_result = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FLSRKStepSetSTSMethodByName(arkode_mem, emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: emethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(emethod, farg2_chars, farg2) +fresult = swigc_FLSRKStepSetSTSMethodByName(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPMethodByName(arkode_mem, emethod) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +character(kind=C_CHAR, len=*), target :: emethod +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigArrayWrapper) :: farg2 + +farg1 = arkode_mem +call SWIG_string_to_chararray(emethod, farg2_chars, farg2) +fresult = swigc_FLSRKStepSetSSPMethodByName(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigFn(arkode_mem, dom_eig) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: dom_eig +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = arkode_mem +farg2 = dom_eig +fresult = swigc_FLSRKStepSetDomEigFn(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigFrequency(arkode_mem, nsteps) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), intent(in) :: nsteps +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_LONG) :: farg2 + +farg1 = arkode_mem +farg2 = nsteps +fresult = swigc_FLSRKStepSetDomEigFrequency(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetMaxNumStages(arkode_mem, stage_max_limit) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: stage_max_limit +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = stage_max_limit +fresult = swigc_FLSRKStepSetMaxNumStages(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetDomEigSafetyFactor(arkode_mem, dom_eig_safety) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: dom_eig_safety +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = dom_eig_safety +fresult = swigc_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: num_of_stages +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = num_of_stages +fresult = swigc_FLSRKStepSetSSPStageNum(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepGetNumDomEigUpdates(arkode_mem, dom_eig_num_evals) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: dom_eig_num_evals +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(dom_eig_num_evals(1)) +fresult = swigc_FLSRKStepGetNumDomEigUpdates(farg1, farg2) +swig_result = fresult +end function + +function FLSRKStepGetMaxNumStages(arkode_mem, stage_max) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), dimension(*), target, intent(inout) :: stage_max +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stage_max(1)) +fresult = swigc_FLSRKStepGetMaxNumStages(farg1, farg2) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index ffb3eedfac..f2239fc011 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -94,6 +94,8 @@ module farkode_mod 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_STEPPER_UNSUPPORTED = -48_C_INT + integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT + integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) diff --git a/swig/Makefile b/swig/Makefile index eb772623e9..4bcefe8423 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -16,7 +16,7 @@ SWIG ?= swig -ARKODE=farkode_mod farkode_arkstep_mod farkode_erkstep_mod farkode_sprkstep_mod farkode_mristep_mod +ARKODE=farkode_mod farkode_arkstep_mod farkode_erkstep_mod farkode_sprkstep_mod farkode_mristep_mod farkode_lsrkstep_mod CVODE=fcvode_mod CVODES=fcvodes_mod IDA=fida_mod diff --git a/swig/arkode/farkode_lsrkstep_mod.i b/swig/arkode/farkode_lsrkstep_mod.i new file mode 100644 index 0000000000..4d619031be --- /dev/null +++ b/swig/arkode/farkode_lsrkstep_mod.i @@ -0,0 +1,30 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2024, 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 farkode_lsrkstep_mod + +%include "../sundials/fsundials.i" + +// include the header file(s) in the c wrapper that is generated +%{ +#include "arkode/arkode_lsrkstep.h" +%} + +// Load the typedefs and generate a "use" statements in the module +%import "farkode_mod.i" + +// Process definitions from these files +%include "arkode/arkode_lsrkstep.h" diff --git a/test/answers b/test/answers index b8fc1d686f..5dca98a66d 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit b8fc1d686fabbc1c8e609ff3253cedf9588986ac +Subproject commit 5dca98a66d4f833c19a4fd63163f466ac5f50b56 From 7320d085ce354e4b9679c312b1e14050ce639f6e Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Thu, 21 Nov 2024 20:58:05 -0500 Subject: [PATCH 118/137] Feature: SUNStepper (#463) Add SUNStepper class for evolving IVPs --------- Co-authored-by: Steven Roberts <roberts115@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> --- CHANGELOG.md | 6 + doc/arkode/guide/source/Constants.rst | 2 + .../source/Usage/ARKStep/User_callable.rst | 5 + .../source/Usage/ERKStep/User_callable.rst | 4 + .../Custom_Inner_Stepper/Description.rst | 26 + .../source/Usage/MRIStep/User_callable.rst | 4 + .../source/Usage/SPRKStep/User_callable.rst | 5 + .../guide/source/Usage/User_callable.rst | 28 + doc/arkode/guide/source/index.rst | 1 + .../source/sunstepper/SUNStepper_links.rst | 14 + doc/arkode/guide/source/sunstepper/index.rst | 20 + doc/shared/RecentChanges.rst | 6 + .../sunstepper/SUNStepper_Description.rst | 395 +++++++++++++ .../sunstepper/SUNStepper_Implementing.rst | 54 ++ .../sunstepper/SUNStepper_Structure.rst | 39 ++ doc/superbuild/source/index.rst | 1 + .../source/sunstepper/SUNStepper_links.rst | 14 + doc/superbuild/source/sunstepper/index.rst | 20 + include/arkode/arkode.h | 6 + include/arkode/arkode_mristep.h | 5 + include/sundials/sundials_stepper.h | 129 +++++ src/arkode/CMakeLists.txt | 1 + src/arkode/arkode.c | 5 + src/arkode/arkode_arkstep.c | 18 +- src/arkode/arkode_arkstep_impl.h | 2 +- src/arkode/arkode_impl.h | 9 + src/arkode/arkode_io.c | 1 + src/arkode/arkode_mristep.c | 92 ++- src/arkode/arkode_mristep_impl.h | 8 + src/arkode/arkode_sunstepper.c | 214 +++++++ src/arkode/fmod_int32/farkode_mod.c | 14 + src/arkode/fmod_int32/farkode_mod.f90 | 27 + src/arkode/fmod_int32/farkode_mristep_mod.c | 14 + src/arkode/fmod_int32/farkode_mristep_mod.f90 | 26 + src/arkode/fmod_int64/farkode_mod.c | 14 + src/arkode/fmod_int64/farkode_mod.f90 | 27 + src/arkode/fmod_int64/farkode_mristep_mod.c | 14 + src/arkode/fmod_int64/farkode_mristep_mod.f90 | 26 + src/sundials/CMakeLists.txt | 2 + src/sundials/fmod_int32/fsundials_core_mod.c | 289 ++++++++++ .../fmod_int32/fsundials_core_mod.f90 | 542 ++++++++++++++++++ src/sundials/fmod_int64/fsundials_core_mod.c | 289 ++++++++++ .../fmod_int64/fsundials_core_mod.f90 | 542 ++++++++++++++++++ src/sundials/sundials_stepper.c | 202 +++++++ src/sundials/sundials_stepper_impl.h | 53 ++ swig/sundials/fsundials_core_mod.i | 1 + swig/sundials/fsundials_stepper.i | 25 + 47 files changed, 3227 insertions(+), 14 deletions(-) create mode 100644 doc/arkode/guide/source/sunstepper/SUNStepper_links.rst create mode 100644 doc/arkode/guide/source/sunstepper/index.rst create mode 100644 doc/shared/sunstepper/SUNStepper_Description.rst create mode 100644 doc/shared/sunstepper/SUNStepper_Implementing.rst create mode 100644 doc/shared/sunstepper/SUNStepper_Structure.rst create mode 100644 doc/superbuild/source/sunstepper/SUNStepper_links.rst create mode 100644 doc/superbuild/source/sunstepper/index.rst create mode 100644 include/sundials/sundials_stepper.h create mode 100644 src/arkode/arkode_sunstepper.c create mode 100644 src/sundials/sundials_stepper.c create mode 100644 src/sundials/sundials_stepper_impl.h create mode 100644 swig/sundials/fsundials_stepper.i diff --git a/CHANGELOG.md b/CHANGELOG.md index ee1021d575..b9232cd3c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ ### New Features and Enhancements +Added the `SUNStepper` base class to represent a generic solution procedure for +IVPs. A SUNStepper can be created from an ARKODE memory block with the new +function `ARKodeCreateSUNStepper`. To enable interoperability with +`MRIStepInnerStepper`, the function `MRIStepInnerStepper_CreateFromSUNStepper` +was added. + The following DIRK schemes now have coefficients accurate to quad precision: * `ARKODE_BILLINGTON_3_3_2` * `ARKODE_KVAERNO_4_2_3` diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 695a517ee5..fc300c802a 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -563,6 +563,8 @@ contains the ARKODE output constants. | :index:`ARK_MAX_STAGE_LIMIT_FAIL` | -50 | Stepper failed to achieve stable results. Either reduce | | | | the step size or increase the stage_max_limit | +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_SUNSTEPPER_ERR` | -51 | An error occurred in the SUNStepper module. | + +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_UNRECOGNIZED_ERROR` | -99 | An unknown error was encountered. | +-------------------------------------+------+------------------------------------------------------------+ | | diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index 0795c81651..ae01be6b25 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -35,6 +35,11 @@ ARKStep supports *all categories*: * non-identity mass matrices * relaxation Runge--Kutta methods +ARKStep also has forcing function support when converted to a +:c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See +:c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` +for additional details. + .. _ARKODE.Usage.ARKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 1f4dc8f140..865e4c3e25 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -33,6 +33,10 @@ ERKStep supports the following categories: * temporal adaptivity * relaxation Runge--Kutta methods +ERKStep does not have forcing function support when converted to a +:c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See +:c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` +for additional details. .. _ARKODE.Usage.ERKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst index 523bd8a7be..f327d5a76c 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst @@ -79,6 +79,32 @@ Creating and Destroying an Object for details on how to attach member data and method function pointers. +.. c:function:: int MRIStepInnerStepper_CreateFromSUNStepper(SUNStepper sunstepper, MRIStepInnerStepper* stepper) + + This utility function wraps a :c:type:`SUNStepper` as an + :c:type:`MRIStepInnerStepper`. + + :param sunctx: the SUNDIALS simulation context. + :param sunstepper: the c:type:`SUNStepper` to wrap. + :param stepper: a pointer to an MRI inner stepper object. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_FAIL: if a memory allocation error occurs + + **Example usage:** + + .. code-block:: C + + SUNStepper sunstepper = NULL; + SUNStepper_Create(ctx, &sunstepper); + /* Attach content and functions to the SUNStepper... */ + + MRIStepInnerStepper inner_stepper = NULL; + flag = MRIStepInnerStepper_CreateFromSUNStepper(sunstepper, &inner_stepper); + + .. versionadded:: x.y.z + + .. c:function:: int MRIStepInnerStepper_Free(MRIStepInnerStepper *stepper) This function destroys an :c:type:`MRIStepInnerStepper` object. diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 967e8e7c12..695c28ad5c 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -33,6 +33,10 @@ MRIStep supports the following categories: * implicit nonlinear and/or linear solvers +MRIStep does not have forcing function support when converted to a +:c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See +:c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` +for additional details. .. _ARKODE.Usage.MRIStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index e4a88b1d18..41710d2461 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -30,6 +30,11 @@ SPRKStep supports only the basic set of user-callable functions, and does not support any of the restricted groups (time adaptivity, implicit solvers, etc.). +SPRKStep does not have forcing function support when converted to a +:c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See +:c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` +for additional details. + .. _ARKODE.Usage.SPRKStep.Initialization: diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 8737483ddd..d147c1560c 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -4725,3 +4725,31 @@ rescale the upcoming time step by the specified factor. If a value * ``examples/arkode/C_serial/ark_heat1D_adapt.c`` .. versionadded:: 6.1.0 + + + +.. _ARKODE.Usage.SUNStepperInterface: + +Using an ARKODE solver as a SUNStepper +-------------------------------------- + +The utility function :c:func:`ARKodeCreateSUNStepper` wraps an ARKODE memory +block as a :c:type:`SUNStepper`. + +.. c:function:: int ARKodeCreateSUNStepper(void *inner_arkode_mem, SUNStepper *stepper) + + Wraps an ARKODE integrator as a :c:type:`SUNStepper`. + + :param arkode_mem: pointer to the ARKODE memory block. + :param stepper: the :c:type:`SUNStepper` object. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_FAIL: a memory allocation failed. + :retval ARK_SUNSTEPPER_ERR: the :c:type:`SUNStepper` initialization failed. + + .. warning:: + Currently, ``stepper`` will be equipped with an implementation for the + :c:func:`SUNStepper_SetForcing` function only if ``inner_arkode_mem`` is + an ARKStep integrator. + + .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/index.rst b/doc/arkode/guide/source/index.rst index e809010fd0..edb093b943 100644 --- a/doc/arkode/guide/source/index.rst +++ b/doc/arkode/guide/source/index.rst @@ -65,6 +65,7 @@ with support by the `US Department of Energy <http://www.doe.gov>`_, sunlinsol/index.rst sunnonlinsol/index.rst sunadaptcontroller/index.rst + sunstepper/index.rst sunmemory/index.rst sundials/Install_link.rst Constants diff --git a/doc/arkode/guide/source/sunstepper/SUNStepper_links.rst b/doc/arkode/guide/source/sunstepper/SUNStepper_links.rst new file mode 100644 index 0000000000..938c5f5d9d --- /dev/null +++ b/doc/arkode/guide/source/sunstepper/SUNStepper_links.rst @@ -0,0 +1,14 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/sunstepper/SUNStepper_Description.rst +.. include:: ../../../../shared/sunstepper/SUNStepper_Implementing.rst diff --git a/doc/arkode/guide/source/sunstepper/index.rst b/doc/arkode/guide/source/sunstepper/index.rst new file mode 100644 index 0000000000..86e89bd4c0 --- /dev/null +++ b/doc/arkode/guide/source/sunstepper/index.rst @@ -0,0 +1,20 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/sunstepper/SUNStepper_Structure.rst + +.. toctree:: + :maxdepth: 1 + + SUNStepper_links.rst diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index d487a4a8d0..fa710070db 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -2,6 +2,12 @@ **New Features and Enhancements** +Added the :c:type:`SUNStepper` base class to represent a generic solution +procedure for IVPs. A SUNStepper can be created from an ARKODE memory block with +the new function :c:func:`ARKodeCreateSUNStepper`. To enable interoperability +with :c:type:`MRIStepInnerStepper`, the function +:c:func:`MRIStepInnerStepper_CreateFromSUNStepper` was added. + The following DIRK schemes now have coefficients accurate to quad precision: * ``ARKODE_BILLINGTON_3_3_2`` diff --git a/doc/shared/sunstepper/SUNStepper_Description.rst b/doc/shared/sunstepper/SUNStepper_Description.rst new file mode 100644 index 0000000000..cb4b62d962 --- /dev/null +++ b/doc/shared/sunstepper/SUNStepper_Description.rst @@ -0,0 +1,395 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @LLNL + David J. Gardner @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + +.. _SUNStepper.Description: + +The SUNStepper API +================== + +.. versionadded:: x.y.z + +As with other SUNDIALS classes, the :c:type:`SUNStepper` abstract base class is +implemented using a C structure containing a ``content`` pointer to the derived +class member data and a structure of function pointers to the derived class +implementations of the virtual methods. + +.. c:type:: SUNStepper + + An object for solving the IVP :eq:`SUNStepper_IVP`. + + The actual definition of the ``SUNStepper`` structure is kept private to + allow for the object internals to change without impacting user code. The + following sections describe the base class methods and the virtual methods + that a must be provided by a derived class. + +.. _SUNStepper.Description.BaseMethods: + +Base Class Methods +------------------ + +This section describes methods provided by the :c:type:`SUNStepper` abstract +base class that aid the user in implementing derived classes. This includes +functions for creating and destroying a generic base class object, attaching and +retrieving the derived class ``content`` pointer, and setting function pointers +to derived class method implementations. + +.. _SUNStepper.Description.BaseMethods.CreateDestroy: + +Creating and Destroying an Object +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In addition to creating an empty :c:type:`SUNStepper` using +:c:func:`SUNStepper_Create` described below, there is the +:c:func:`ARKodeCreateSUNStepper` function to construct a :c:type:`SUNStepper` +from an ARKODE integrator. + +.. c:function:: SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper *stepper) + + This function creates a :c:type:`SUNStepper` object to which a user should + attach the member data (content) pointer and method function pointers. + + :param sunctx: the SUNDIALS simulation context. + :param stepper: a pointer to a stepper object. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + **Example usage:** + + .. code-block:: C + + /* create an instance of the base class */ + SUNStepper stepper = NULL; + SUNErrCode err = SUNStepper_Create(sunctx, &stepper); + + .. note:: + + See :numref:`SUNStepper.Description.BaseMethods.Content` and + :numref:`SUNStepper.Description.BaseMethods.AttachFunctions` + for details on how to attach member data and method function pointers. + + +.. c:function:: SUNErrCode SUNStepper_Destroy(SUNStepper *stepper) + + This function frees memory allocated by the :c:type:`SUNStepper` base class + and uses the function pointer optionally specified with + :c:func:`SUNStepper_SetDestroyFn` to free the content. + + :param stepper: a pointer to a stepper object. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + .. note:: + + This function only frees memory allocated within the base class and the + base class structure itself. The user is responsible for freeing any + memory allocated for the member data (content). + + +.. _SUNStepper.Description.BaseMethods.SteppingFunctions: + +Stepping Functions +^^^^^^^^^^^^^^^^^^ + +.. c:function:: SUNErrCode SUNStepper_Evolve(SUNStepper stepper, sunrealtype tout, N_Vector vret, sunrealtype* tret) + + This function evolves the ODE :eq:`SUNStepper_IVP` towards the time ``tout`` + and stores the solution at time ``tret`` in ``vret``. + + :param stepper: the stepper object. + :param tout: the time to evolve towards. + :param vret: on output, the state at time ``tret``. + :param tret: the time corresponding to the output value ``vret``. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_OneStep(SUNStepper stepper, sunrealtype tout, N_Vector vret, sunrealtype* tret) + + This function evolves the ODE :eq:`SUNStepper_IVP` *one timestep* towards + the time ``tout`` and stores the solution at time ``tret`` in ``vret``. + + :param stepper: the stepper object. + :param tout: the time to evolve towards. + :param vret: on output, the state at time ``tret``. + :param tret: the time corresponding to the output value ``vret``. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f, SUNFullRhsMode mode) + + This function computes the full right-hand side function of the ODE, + :math:`f(t, v) + r(t)` in :eq:`SUNStepper_IVP` for a given value of the + independent variable ``t`` and state vector ``v``. + + :param stepper: the stepper object. + :param t: the current value of the independent variable. + :param v: the current value of the dependent variable vector. + :param f: the output vector for the ODE right-hand side, + :math:`f(t, v) + r(t)`, in :eq:`SUNStepper_IVP`. + :param mode: the purpose of the right-hand side evaluation. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector vR) + + This function resets the stepper state to the provided independent variable + value and dependent variable vector. + + :param stepper: the stepper object. + :param tR: the value of the independent variable :math:`t_R`. + :param vR: the value of the dependent variable vector :math:`v(t_R)`. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetStopTime(SUNStepper stepper, sunrealtype tstop) + + This function specifies the value of the independent variable :math:`t` past + which the solution is not to proceed. + + :param stepper: the stepper object. + :param tstop: stopping time for the stepper. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) + + This function sets the data necessary to compute the forcing term + :eq:`SUNStepper_forcing`. This includes the shift and scaling factors for the + normalized time :math:`\frac{t - t_{\text{shift}}}{t_{\text{scale}}}` and the + array of polynomial coefficient vectors :math:`\widehat{f}_k`. + + :param stepper: a stepper object. + :param tshift: the time shift to apply to the current time when computing + the forcing, :math:`t_{\text{shift}}`. + :param tscale: the time scaling to apply to the current time when computing + the forcing, :math:`t_{\text{scale}}`. + :param forcing: a pointer to an array of forcing vectors, + :math:`\widehat{f}_k`. + :param nforcing: the number of forcing vectors, :math:`n_{\text{forcing}}`. A + value of 0 effectively eliminates the forcing term. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + .. note:: + + When integrating the ODE :eq:`SUNStepper_IVP` the :c:type:`SUNStepper` is + responsible for evaluating ODE right-hand side function :math:`f(t, v)` as + well as computing and applying the forcing term :eq:`SUNStepper_forcing` + to obtain the full right-hand side of the ODE :eq:`SUNStepper_IVP`. + + +.. _SUNStepper.Description.BaseMethods.RhsMode: + +The Right-Hand Side Evaluation Mode +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. c:enum:: SUNFullRhsMode + + A flag indicating the purpose of a right-hand side function evaluation. + + .. c:enumerator:: SUN_FULLRHS_START + + Evaluate at the beginning of the simulation. + + .. c:enumerator:: SUN_FULLRHS_END + + Evaluate at the end of a successful step. + + .. c:enumerator:: SUN_FULLRHS_OTHER + + Evaluate elsewhere, e.g., for dense output. + + +.. _SUNStepper.Description.BaseMethods.Content: + +Attaching and Accessing the Content Pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. c:function:: SUNErrCode SUNStepper_SetContent(SUNStepper stepper, void *content) + + This function attaches a member data (content) pointer to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param content: a pointer to the stepper member data. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_GetContent(SUNStepper stepper, void **content) + + This function retrieves the member data (content) pointer from a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param content: a pointer to set to the stepper member data pointer. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +Handling Warnings and Errors +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +An implementation of a :c:type:`SUNStepper` may have a system of warning and error +handling that cannot be encoded as a :c:type:`SUNErrCode` which is the return +type of all :c:type:`SUNStepper` functions. Therefore, we provide the following +function to get and set a separate flag associated with a stepper. + +.. c:function:: SUNErrCode SUNStepper_SetLastFlag(SUNStepper stepper, int last_flag) + + This function sets a flag that can be used by :c:type:`SUNStepper` implementations to + indicate warnings or errors that occurred during an operation, e.g., + :c:func:`SUNStepper_Evolve`. + + :param stepper: the stepper object. + :param last_flag: the flag value. + :return: A :c:type:`SUNErrCode` indicating success or failure. + +.. c:function:: SUNErrCode SUNStepper_GetLastFlag(SUNStepper stepper, int *last_flag) + + This function provides the last value of the flag used by the :c:type:`SUNStepper` + implementation to indicate warnings or errors that occurred during an + operation, e.g., :c:func:`SUNStepper_Evolve`. + + :param stepper: the stepper object. + :param last_flag: A pointer to where the flag value will be written. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. _SUNStepper.Description.BaseMethods.AttachFunctions: + +Setting Member Functions +^^^^^^^^^^^^^^^^^^^^^^^^ + +The functions in this section are used to specify how each operation on a +:c:type:`SUNStepper` implementation is performed. Technically, all of these +functions are optional to call; the functions that need to be attached are +determined by the "consumer" of the :c:type:`SUNStepper`. + +.. c:function:: SUNErrCode SUNStepper_SetEvolveFn(SUNStepper stepper, SUNStepperEvolveFn fn) + + This function attaches a :c:type:`SUNStepperEvolveFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperEvolveFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetOneStepFn(SUNStepper stepper, SUNStepperOneStepFn fn) + + This function attaches a :c:type:`SUNStepperOneStepFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperOneStepFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetFullRhsFn(SUNStepper stepper, SUNStepperFullRhsFn fn) + + This function attaches a :c:type:`SUNStepperFullRhsFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperFullRhsFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetResetFn(SUNStepper stepper, SUNStepperResetFn fn) + + This function attaches a :c:type:`SUNStepperResetFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperResetFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetStopTimeFn(SUNStepper stepper, SUNStepperSetStopTimeFn fn) + + This function attaches a :c:type:`SUNStepperSetStopTimeFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperSetStopTimeFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, SUNStepperSetForcingFn fn) + + This function attaches a :c:type:`SUNStepperSetForcingFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperSetForcingFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. c:function:: SUNErrCode SUNStepper_SetDestroyFn(SUNStepper stepper, SUNStepperDestroyFn fn) + + This function attaches a :c:type:`SUNStepperDestroyFn` function to a + :c:type:`SUNStepper`. The provided function is responsible for freeing any + memory allocated for the :c:type:`SUNStepper` content. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperDestroyFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + +.. _SUNStepper.Description.ImplMethods: + +Implementation Specific Methods +------------------------------- + +This section describes the virtual methods defined by the :c:type:`SUNStepper` +abstract base class. + + +.. c:type:: SUNErrCode (*SUNStepperEvolveFn)(SUNStepper stepper, sunrealtype tout, N_Vector vret, sunrealtype* tret) + + This type represents a function with the signature of + :c:func:`SUNStepper_Evolve`. + + +.. c:type:: SUNErrCode (*SUNStepperOneStepFn)(SUNStepper stepper, sunrealtype tout, N_Vector vret, sunrealtype* tret) + + This type represents a function with the signature of + :c:func:`SUNStepper_OneStep`. + + +.. c:type:: SUNErrCode (*SUNStepperFullRhsFn)(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f, SUNFullRhsMode mode) + + This type represents a function with the signature of + :c:func:`SUNStepper_FullRhs`. + + +.. c:type:: SUNErrCode (*SUNStepperResetFn)(SUNStepper stepper, sunrealtype tR, N_Vector vR) + + This type represents a function with the signature of + :c:func:`SUNStepper_Reset`. + + +.. c:type:: SUNErrCode (*SUNStepperSetStopTimeFn)(SUNStepper stepper, sunrealtype tstop) + + This type represents a function with the signature of + :c:func:`SUNStepper_SetStopTime`. + + +.. c:type:: SUNErrCode (*SUNStepperSetForcingFn)(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) + + This type represents a function with the signature of + :c:func:`SUNStepper_SetForcing`. + + +.. c:type:: SUNErrCode (*SUNStepperDestroyFn)(SUNStepper stepper) + + This type represents a function with the signature similar to + :c:func:`SUNStepper_Destroy` for freeing the content associated with a + :c:type:`SUNStepper`. diff --git a/doc/shared/sunstepper/SUNStepper_Implementing.rst b/doc/shared/sunstepper/SUNStepper_Implementing.rst new file mode 100644 index 0000000000..1f57de65de --- /dev/null +++ b/doc/shared/sunstepper/SUNStepper_Implementing.rst @@ -0,0 +1,54 @@ +.. ---------------------------------------------------------------- + Programmer(s): David J. Gardner @ LLNL + Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + +.. _SUNStepper.Implementing: + +Implementing a SUNStepper +========================= + +To create a SUNStepper implementation: + +#. Define the stepper-specific content. + + This is typically a user-defined structure in C codes, a user-defined class + or structure in C++ codes, or a user-defined module in Fortran codes. This + content should hold any data necessary to perform the operations defined by + the :c:type:`SUNStepper` member functions. + +#. Define implementations of the required member functions (see + :numref:`SUNStepper.Description.ImplMethods`). + + These are typically user-defined functions in C, member functions of the + user-defined structure or class in C++, or functions contained in the + user-defined module in Fortran. + + Note that all member functions are passed the :c:type:`SUNStepper` object and + the stepper-specific content can, if necessary, be retrieved using + :c:func:`SUNStepper_GetContent`. Stepper-specific warnings and errors can be + recorded with :c:func:`SUNStepper_SetLastFlag`. + +#. In the user code, before creating the outer memory structure that uses the + :c:type:`SUNStepper`, do the following: + + #. Create a :c:type:`SUNStepper` object with :c:func:`SUNStepper_Create`. + + #. Attach a pointer to the stepper content to the :c:type:`SUNStepper` object + with :c:func:`SUNStepper_SetContent` if necessary, e.g., when the content + is a C structure. + + #. Attach the member function implementations using the functions described + in :numref:`SUNStepper.Description.BaseMethods.AttachFunctions`. + +#. Attach the :c:type:`SUNStepper` object to the outer memory structure. diff --git a/doc/shared/sunstepper/SUNStepper_Structure.rst b/doc/shared/sunstepper/SUNStepper_Structure.rst new file mode 100644 index 0000000000..bce90f5c57 --- /dev/null +++ b/doc/shared/sunstepper/SUNStepper_Structure.rst @@ -0,0 +1,39 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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 + ---------------------------------------------------------------- + +.. _SUNStepper: + +##################################### +Stepper Data Structure +##################################### + +This section presents the :c:type:`SUNStepper` base class which represents a +generic solution procedure for IVPs of the form + +.. math:: + \dot{v}(t) = f(t, v) + r(t), \qquad v(t_0) = v_0, + :label: SUNStepper_IVP + +on an interval :math:`t \in [t_0, t_f]`. The time dependent forcing term, +:math:`r_i(t)`, is given by + +.. math:: + r(t) = \sum_{k = 0}^{n_{\text{forcing}}-1} + \left( \frac{t - t_{\text{shift}}}{t_{\text{scale}}} \right)^{k} \widehat{f}_k. + :label: SUNStepper_forcing + +:c:type:`SUNStepper` provides an abstraction over SUNDIALS integrators, custom +integrators, exact solution procedures, or other approaches for solving +:eq:`SUNStepper_IVP`. These are used, for example, in operator splitting and +forcing methods to solve inner IVPs in a flexible way. diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index e61162c884..d597a82a0c 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -174,6 +174,7 @@ SUNDIALS License and Notices sunlinsol/index.rst sunnonlinsol/index.rst sunadaptcontroller/index.rst + sunstepper/index.rst sunmemory/index.rst History_link.rst Changelog_link.rst diff --git a/doc/superbuild/source/sunstepper/SUNStepper_links.rst b/doc/superbuild/source/sunstepper/SUNStepper_links.rst new file mode 100644 index 0000000000..925278111c --- /dev/null +++ b/doc/superbuild/source/sunstepper/SUNStepper_links.rst @@ -0,0 +1,14 @@ +.. ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/sunstepper/SUNStepper_Description.rst +.. include:: ../../../shared/sunstepper/SUNStepper_Implementing.rst diff --git a/doc/superbuild/source/sunstepper/index.rst b/doc/superbuild/source/sunstepper/index.rst new file mode 100644 index 0000000000..37c94c70d7 --- /dev/null +++ b/doc/superbuild/source/sunstepper/index.rst @@ -0,0 +1,20 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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/sunstepper/SUNStepper_Structure.rst + +.. toctree:: + :maxdepth: 1 + + SUNStepper_links.rst diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 3f934b78af..684e4fadab 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -31,6 +31,7 @@ #include <arkode/arkode_butcher.h> #include <stdio.h> #include <sundials/sundials_core.h> +#include <sundials/sundials_stepper.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -143,6 +144,8 @@ extern "C" { #define ARK_DOMEIG_FAIL -49 #define ARK_MAX_STAGE_LIMIT_FAIL -50 +#define ARK_SUNSTEPPER_ERR -51 + #define ARK_UNRECOGNIZED_ERROR -99 /* ------------------------------ @@ -417,6 +420,9 @@ SUNDIALS_EXPORT int ARKodeGetNumRelaxSolveFails(void* arkode_mem, SUNDIALS_EXPORT int ARKodeGetNumRelaxSolveIters(void* arkode_mem, long int* iters); +/* SUNStepper functions */ +SUNDIALS_EXPORT int ARKodeCreateSUNStepper(void* arkode_mem, SUNStepper* stepper); + #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 828272948a..506534b9db 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -22,6 +22,7 @@ #include <arkode/arkode_butcher_dirk.h> #include <arkode/arkode_butcher_erk.h> #include <arkode/arkode_ls.h> +#include <sundials/sundials_stepper.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -167,6 +168,10 @@ SUNDIALS_EXPORT int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); /* Custom inner stepper functions */ SUNDIALS_EXPORT int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper); + +SUNDIALS_EXPORT int MRIStepInnerStepper_CreateFromSUNStepper( + SUNStepper sunstepper, MRIStepInnerStepper* stepper); + SUNDIALS_EXPORT int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper); SUNDIALS_EXPORT int MRIStepInnerStepper_SetContent(MRIStepInnerStepper stepper, void* content); diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h new file mode 100644 index 0000000000..e735792e89 --- /dev/null +++ b/include/sundials/sundials_stepper.h @@ -0,0 +1,129 @@ +/* ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * -----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_STEPPER_H +#define _SUNDIALS_STEPPER_H + +#include <sundials/sundials_core.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + SUN_FULLRHS_START, + SUN_FULLRHS_END, + SUN_FULLRHS_OTHER +} SUNFullRhsMode; + +typedef int (*SUNRhsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, + SUNMatrix Jac, void* user_data, N_Vector tmp1, + N_Vector tmp2, N_Vector tmp3); + +typedef int (*SUNRhsJacTimesFn)(N_Vector v, N_Vector Jv, sunrealtype t, + N_Vector y, N_Vector fy, void* user_data, + N_Vector tmp); + +typedef _SUNDIALS_STRUCT_ SUNStepper_* SUNStepper; + +typedef SUNErrCode (*SUNStepperEvolveFn)(SUNStepper stepper, sunrealtype tout, + N_Vector vret, sunrealtype* tret); + +typedef SUNErrCode (*SUNStepperOneStepFn)(SUNStepper stepper, sunrealtype tout, + N_Vector vret, sunrealtype* tret); + +typedef SUNErrCode (*SUNStepperFullRhsFn)(SUNStepper stepper, sunrealtype t, + N_Vector v, N_Vector f, + SUNFullRhsMode mode); + +typedef SUNErrCode (*SUNStepperResetFn)(SUNStepper stepper, sunrealtype tR, + N_Vector vR); + +typedef SUNErrCode (*SUNStepperSetStopTimeFn)(SUNStepper stepper, + sunrealtype tstop); + +typedef SUNErrCode (*SUNStepperSetForcingFn)(SUNStepper stepper, + sunrealtype tshift, + sunrealtype tscale, + N_Vector* forcing, int nforcing); + +typedef SUNErrCode (*SUNStepperDestroyFn)(SUNStepper stepper); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Destroy(SUNStepper* stepper); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Evolve(SUNStepper stepper, sunrealtype tout, + N_Vector vret, sunrealtype* tret); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_OneStep(SUNStepper stepper, sunrealtype tout, + N_Vector vret, sunrealtype* tret); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, + N_Vector f, SUNFullRhsMode mode); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector vR); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetStopTime(SUNStepper stepper, sunrealtype tstop); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, + sunrealtype tscale, N_Vector* forcing, + int nforcing); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetContent(SUNStepper stepper, void* content); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_GetContent(SUNStepper stepper, void** content); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetLastFlag(SUNStepper stepper, int last_flag); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_GetLastFlag(SUNStepper stepper, int* last_flag); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetEvolveFn(SUNStepper stepper, SUNStepperEvolveFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetOneStepFn(SUNStepper stepper, SUNStepperOneStepFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetFullRhsFn(SUNStepper stepper, SUNStepperFullRhsFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetResetFn(SUNStepper stepper, SUNStepperResetFn fn); + +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetStopTimeFn(SUNStepper stepper, + SUNStepperSetStopTimeFn fn); + +SUNDIALS_EXPORT SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, + SUNStepperSetForcingFn fn); + +SUNDIALS_EXPORT SUNErrCode SUNStepper_SetDestroyFn(SUNStepper stepper, + SUNStepperDestroyFn fn); + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_STEPPER_H */ diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index 45386c0d87..f5019337f9 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -43,6 +43,7 @@ set(arkode_SOURCES arkode_sprkstep_io.c arkode_sprkstep.c arkode_sprk.c + arkode_sunstepper.c arkode_user_controller.c arkode.c) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 7211e50984..2234cc653b 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1447,6 +1447,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->step_getnumnonlinsolviters = NULL; ark_mem->step_getnumnonlinsolvconvfails = NULL; ark_mem->step_getnonlinsolvstats = NULL; + ark_mem->step_setforcing = NULL; ark_mem->step_mem = NULL; ark_mem->step_supports_adaptive = SUNFALSE; ark_mem->step_supports_implicit = SUNFALSE; @@ -2694,6 +2695,10 @@ int arkHandleFailure(ARKodeMem ark_mem, int flag) arkProcessError(ark_mem, ARK_MAX_STAGE_LIMIT_FAIL, __LINE__, __func__, __FILE__, "The max stage limit failed unrecoverably"); break; + case ARK_SUNSTEPPER_ERR: + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "An inner SUNStepper error occurred"); + break; default: /* This return should never happen */ arkProcessError(ark_mem, ARK_UNRECOGNIZED_ERROR, __LINE__, __func__, __FILE__, diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index e1ed9c0f66..93ac87e227 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -21,10 +21,12 @@ #include <sundials/sundials_math.h> #include <sunnonlinsol/sunnonlinsol_newton.h> +#include "arkode/arkode.h" #include "arkode/arkode_butcher.h" #include "arkode_arkstep_impl.h" #include "arkode_impl.h" #include "arkode_interp_impl.h" +#include "sundials/sundials_types.h" #define FIXED_LIN_TOL @@ -139,6 +141,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0, ark_mem->step_getnumnonlinsolviters = arkStep_GetNumNonlinSolvIters; ark_mem->step_getnumnonlinsolvconvfails = arkStep_GetNumNonlinSolvConvFails; ark_mem->step_getnonlinsolvstats = arkStep_GetNonlinSolvStats; + ark_mem->step_setforcing = arkStep_SetInnerForcing; ark_mem->step_supports_adaptive = SUNTRUE; ark_mem->step_supports_implicit = SUNTRUE; ark_mem->step_supports_massmatrix = SUNTRUE; @@ -3325,16 +3328,19 @@ void arkStep_ApplyForcing(ARKodeARKStepMem step_mem, sunrealtype* stage_times, methods). ----------------------------------------------------------------------------*/ -int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, +int arkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nvecs) { - ARKodeMem ark_mem; ARKodeARKStepMem step_mem; - int retval; - /* access ARKodeMem and ARKodeARKStepMem structures */ - retval = arkStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + /* access ARKodeARKStepMem structure */ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARKSTEP_NO_MEM); + return ARK_MEM_NULL; + } + step_mem = (ARKodeARKStepMem)ark_mem->step_mem; if (nvecs > 0) { diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 806101a98b..21e0231a89 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -271,7 +271,7 @@ int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem); /* private functions for interfacing with MRIStep */ -int arkStep_SetInnerForcing(void* arkode_mem, sunrealtype tshift, +int arkStep_SetInnerForcing(ARKodeMem arkode_mem, sunrealtype tshift, sunrealtype tscale, N_Vector* f, int nvecs); int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector y); diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 4e03a9ff59..a79f3e0d91 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -35,6 +35,7 @@ #include "arkode_types_impl.h" #include "sundials_logger_impl.h" #include "sundials_macros.h" +#include "sundials_stepper_impl.h" #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -290,6 +291,11 @@ typedef int (*ARKTimestepAttachMasssolFn)( typedef void (*ARKTimestepDisableMSetup)(ARKodeMem ark_mem); typedef void* (*ARKTimestepGetMassMemFn)(ARKodeMem ark_mem); +/* time stepper interface functions -- forcing */ +typedef int (*ARKTimestepSetForcingFn)(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* f, + int nvecs); + /*=============================================================== ARKODE interpolation module definition ===============================================================*/ @@ -455,6 +461,9 @@ struct ARKodeMemRec ARKTimestepGetMassMemFn step_getmassmem; ARKMassMultFn step_mmult; + /* Time stepper module -- forcing */ + ARKTimestepSetForcingFn step_setforcing; + /* N_Vector storage */ N_Vector ewt; /* error weight vector */ N_Vector rwt; /* residual weight vector */ diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 1ae4e4c1a7..2ae790ed86 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -2903,6 +2903,7 @@ char* ARKodeGetReturnFlagName(long int flag) case ARK_MAX_STAGE_LIMIT_FAIL: sprintf(name, "ARK_MAX_STAGE_LIMIT_FAIL"); break; + case ARK_SUNSTEPPER_ERR: sprintf(name, "ARK_SUNSTEPPER_ERR"); break; case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; default: sprintf(name, "NONE"); } diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 32c26e1de0..a078d19a33 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -16,12 +16,15 @@ * This is the implementation file for ARKODE's MRI time stepper module. * ---------------------------------------------------------------------------*/ +#include "arkode/arkode_mristep.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sundials/sundials_math.h> #include <sunnonlinsol/sunnonlinsol_newton.h> +#include "arkode/arkode.h" #include "arkode_impl.h" #include "arkode_interp_impl.h" #include "arkode_mristep_impl.h" @@ -2591,9 +2594,9 @@ int mriStep_StageSetup(ARKodeMem ark_mem) return (ARK_SUCCESS); } -/*=============================================================== +/*--------------------------------------------------------------- User-callable functions for a custom inner integrator - ===============================================================*/ + ---------------------------------------------------------------*/ int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper) { @@ -2626,6 +2629,30 @@ int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper) return (ARK_SUCCESS); } +int MRIStepInnerStepper_CreateFromSUNStepper(SUNStepper sunstepper, + MRIStepInnerStepper* stepper) +{ + int retval = MRIStepInnerStepper_Create(sunstepper->sunctx, stepper); + if (retval != ARK_SUCCESS) { return retval; } + + retval = MRIStepInnerStepper_SetContent(*stepper, sunstepper); + if (retval != ARK_SUCCESS) { return retval; } + + retval = MRIStepInnerStepper_SetEvolveFn(*stepper, + mriStepInnerStepper_EvolveSUNStepper); + if (retval != ARK_SUCCESS) { return retval; } + + retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, + mriStepInnerStepper_FullRhsSUNStepper); + if (retval != ARK_SUCCESS) { return retval; } + + retval = MRIStepInnerStepper_SetResetFn(*stepper, + mriStepInnerStepper_ResetSUNStepper); + if (retval != ARK_SUCCESS) { return retval; } + + return ARK_SUCCESS; +} + int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper) { if (*stepper == NULL) { return ARK_SUCCESS; } @@ -2787,9 +2814,9 @@ int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, return ARK_SUCCESS; } -/*=============================================================== - Private inner integrator functions - ===============================================================*/ +/*--------------------------------------------------------------- + Internal inner integrator functions + ---------------------------------------------------------------*/ /* Check for required operations */ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper) @@ -2826,6 +2853,27 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, return stepper->last_flag; } +int mriStepInnerStepper_EvolveSUNStepper(MRIStepInnerStepper stepper, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, + sunrealtype tout, N_Vector y) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + sunrealtype tret; + + SUNErrCode err = sunstepper->ops->setstoptime(sunstepper, tout); + if (err != SUN_SUCCESS) + { + stepper->last_flag = sunstepper->last_flag; + return ARK_SUNSTEPPER_ERR; + } + + err = sunstepper->ops->evolve(sunstepper, tout, y, &tret); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + return ARK_SUCCESS; +} + /* Compute the full RHS for inner (fast) time scale TODO(DJG): This function can be made optional when fullrhs is not called unconditionally by the ARKODE infrastructure e.g., in arkInitialSetup, arkYddNorm, and arkCompleteStep. */ @@ -2840,6 +2888,26 @@ int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, sunrealtype t, return stepper->last_flag; } +int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, + sunrealtype t, N_Vector y, N_Vector f, + int ark_mode) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + + SUNFullRhsMode mode; + switch (ark_mode) + { + case ARK_FULLRHS_START: mode = SUN_FULLRHS_START; break; + case ARK_FULLRHS_END: mode = SUN_FULLRHS_END; break; + default: mode = SUN_FULLRHS_OTHER; break; + } + + SUNErrCode err = sunstepper->ops->fullrhs(sunstepper, t, y, f, mode); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + return ARK_SUCCESS; +} + /* Reset the inner (fast) stepper state */ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR) @@ -2865,6 +2933,16 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, } } +int mriStepInnerStepper_ResetSUNStepper(MRIStepInnerStepper stepper, + sunrealtype tR, N_Vector yR) +{ + SUNStepper sunstepper = (SUNStepper)stepper->content; + SUNErrCode err = sunstepper->ops->reset(sunstepper, tR, yR); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + return ARK_SUCCESS; +} + /* Allocate MRI forcing and fused op workspace vectors if necessary */ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, N_Vector tmpl) @@ -2907,7 +2985,7 @@ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, /* Allocate fused operation workspace arrays */ if (stepper->vecs == NULL) { - stepper->vecs = (N_Vector*)calloc(count + 1, sizeof(*stepper->vecs)); + stepper->vecs = (N_Vector*)calloc(count + 1, sizeof(N_Vector)); if (stepper->vecs == NULL) { mriStepInnerStepper_FreeVecs(stepper); @@ -2917,7 +2995,7 @@ int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, if (stepper->vals == NULL) { - stepper->vals = (sunrealtype*)calloc(count + 1, sizeof(*stepper->vals)); + stepper->vals = (sunrealtype*)calloc(count + 1, sizeof(sunrealtype)); if (stepper->vals == NULL) { mriStepInnerStepper_FreeVecs(stepper); diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index f631307e07..3ae944b12d 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -272,10 +272,18 @@ int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper); int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector y); +int mriStepInnerStepper_EvolveSUNStepper(MRIStepInnerStepper stepper, + sunrealtype t0, sunrealtype tout, + N_Vector y); int mriStepInnerStepper_FullRhs(MRIStepInnerStepper stepper, sunrealtype t, N_Vector y, N_Vector f, int mode); +int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, + sunrealtype t, N_Vector y, N_Vector f, + int mode); int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); +int mriStepInnerStepper_ResetSUNStepper(MRIStepInnerStepper stepper, + sunrealtype tR, N_Vector yR); int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, N_Vector tmpl); int mriStepInnerStepper_Resize(MRIStepInnerStepper stepper, ARKVecResizeFn resize, diff --git a/src/arkode/arkode_sunstepper.c b/src/arkode/arkode_sunstepper.c new file mode 100644 index 0000000000..261379bf2a --- /dev/null +++ b/src/arkode/arkode_sunstepper.c @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + Cody J. Balos @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE's interfacing with + * SUNStepper + *--------------------------------------------------------------*/ + +#include <arkode/arkode.h> +#include <sundials/sundials_stepper.h> +#include "arkode_impl.h" +#include "sundials_macros.h" + +static SUNErrCode arkSUNStepperEvolveHelper(SUNStepper stepper, + sunrealtype tout, N_Vector y, + sunrealtype* tret, int mode) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + + /* evolve inner ODE */ + stepper->last_flag = ARKodeEvolve(arkode_mem, tout, y, tret, mode); + if (stepper->last_flag < 0) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + +static SUNErrCode arkSUNStepperEvolve(SUNStepper stepper, sunrealtype tout, + N_Vector y, sunrealtype* tret) +{ + return arkSUNStepperEvolveHelper(stepper, tout, y, tret, ARK_NORMAL); +} + +static SUNErrCode arkSUNStepperOneStep(SUNStepper stepper, sunrealtype tout, + N_Vector y, sunrealtype* tret) +{ + return arkSUNStepperEvolveHelper(stepper, tout, y, tret, ARK_ONE_STEP); +} + +/*------------------------------------------------------------------------------ + Implementation of SUNStepperFullRhsFn to compute the full inner + (fast) ODE IVP RHS. + ----------------------------------------------------------------------------*/ + +static SUNErrCode arkSUNStepperFullRhs(SUNStepper stepper, sunrealtype t, + N_Vector y, N_Vector f, + SUNFullRhsMode mode) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + ARKodeMem ark_mem = (ARKodeMem)arkode_mem; + + int ark_mode; + switch (mode) + { + case SUN_FULLRHS_START: ark_mode = ARK_FULLRHS_START; break; + case SUN_FULLRHS_END: ark_mode = ARK_FULLRHS_END; break; + case SUN_FULLRHS_OTHER: ark_mode = ARK_FULLRHS_OTHER; break; + default: ark_mode = -1; break; + } + + stepper->last_flag = ark_mem->step_fullrhs(ark_mem, t, y, f, ark_mode); + if (stepper->last_flag != ARK_SUCCESS) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Implementation of SUNStepperResetFn to reset the inner (fast) stepper + state. + ----------------------------------------------------------------------------*/ + +static SUNErrCode arkSUNStepperReset(SUNStepper stepper, sunrealtype tR, + N_Vector yR) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + + stepper->last_flag = ARKodeReset(arkode_mem, tR, yR); + if (stepper->last_flag != ARK_SUCCESS) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Implementation of SUNStepperStopTimeFn to set the tstop time + ----------------------------------------------------------------------------*/ + +static SUNErrCode arkSUNStepperSetStopTime(SUNStepper stepper, sunrealtype tstop) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + + stepper->last_flag = ARKodeSetStopTime(arkode_mem, tstop); + if (stepper->last_flag != ARK_SUCCESS) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + +static SUNErrCode arkSUNStepperSetForcing(SUNStepper stepper, sunrealtype tshift, + sunrealtype tscale, N_Vector* forcing, + int nforcing) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + ARKodeMem ark_mem = (ARKodeMem)arkode_mem; + + stepper->last_flag = ark_mem->step_setforcing(ark_mem, tshift, tscale, + forcing, nforcing); + if (stepper->last_flag != ARK_SUCCESS) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + +int ARKodeCreateSUNStepper(void* arkode_mem, SUNStepper* stepper) +{ + /* unpack ark_mem */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + ARKodeMem ark_mem = (ARKodeMem)arkode_mem; + + SUNErrCode err = SUNStepper_Create(ark_mem->sunctx, stepper); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to create SUNStepper"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetContent(*stepper, arkode_mem); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper content"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetEvolveFn(*stepper, arkSUNStepperEvolve); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper evolve function"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetOneStepFn(*stepper, arkSUNStepperOneStep); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper one step function"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetFullRhsFn(*stepper, arkSUNStepperFullRhs); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper full RHS function"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetResetFn(*stepper, arkSUNStepperReset); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper reset function"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetStopTimeFn(*stepper, arkSUNStepperSetStopTime); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper stop time function"); + return ARK_SUNSTEPPER_ERR; + } + + if (ark_mem->step_setforcing != NULL) + { + err = SUNStepper_SetForcingFn(*stepper, arkSUNStepperSetForcing); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Failed to set SUNStepper forcing function"); + return ARK_SUNSTEPPER_ERR; + } + } + + return ARK_SUCCESS; +} diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c index 52f187e8c4..4bfdf17364 100644 --- a/src/arkode/fmod_int32/farkode_mod.c +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -2253,6 +2253,20 @@ SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FARKodeCreateSUNStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper *)(farg2); + result = (int)ARKodeCreateSUNStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKBandPrecInit(void *farg1, int32_t const *farg2, int32_t const *farg3, int32_t const *farg4) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 5dca9b3b38..3cd700fa7e 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -96,6 +96,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_STEPPER_UNSUPPORTED = -48_C_INT integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT + integer(C_INT), parameter, public :: ARK_SUNSTEPPER_ERR = -51_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -243,6 +244,7 @@ module farkode_mod public :: FARKodeGetNumRelaxBoundFails public :: FARKodeGetNumRelaxSolveFails public :: FARKodeGetNumRelaxSolveIters + public :: FARKodeCreateSUNStepper public :: FARKBandPrecInit public :: FARKBandPrecGetWorkSpace public :: FARKBandPrecGetNumRhsEvals @@ -1706,6 +1708,15 @@ function swigc_FARKodeGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeCreateSUNStepper(farg1, farg2) & +bind(C, name="_wrap_FARKodeCreateSUNStepper") & +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_FARKBandPrecInit(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FARKBandPrecInit") & result(fresult) @@ -4631,6 +4642,22 @@ function FARKodeGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FARKodeCreateSUNStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKodeCreateSUNStepper(farg1, farg2) +swig_result = fresult +end function + function FARKBandPrecInit(arkode_mem, n, mu, ml) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.c b/src/arkode/fmod_int32/farkode_mristep_mod.c index 8b6a72b660..b454003c6d 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.c +++ b/src/arkode/fmod_int32/farkode_mristep_mod.c @@ -755,6 +755,20 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { } +SWIGEXPORT int _wrap_FMRIStepInnerStepper_CreateFromSUNStepper(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (SUNStepper)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)MRIStepInnerStepper_CreateFromSUNStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_Free(void *farg1) { int fresult ; MRIStepInnerStepper *arg1 = (MRIStepInnerStepper *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index ecba398b89..9505d486cb 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -132,6 +132,7 @@ module farkode_mristep_mod public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepInnerStepper_Create + public :: FMRIStepInnerStepper_CreateFromSUNStepper public :: FMRIStepInnerStepper_Free public :: FMRIStepInnerStepper_SetContent public :: FMRIStepInnerStepper_GetContent @@ -530,6 +531,15 @@ function swigc_FMRIStepInnerStepper_Create(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepInnerStepper_CreateFromSUNStepper(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_CreateFromSUNStepper") & +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_FMRIStepInnerStepper_Free(farg1) & bind(C, name="_wrap_FMRIStepInnerStepper_Free") & result(fresult) @@ -1931,6 +1941,22 @@ function FMRIStepInnerStepper_Create(sunctx, stepper) & swig_result = fresult end function +function FMRIStepInnerStepper_CreateFromSUNStepper(sunstepper, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunstepper +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunstepper +farg2 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_CreateFromSUNStepper(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_Free(stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c index b092ee9d57..5a63d50210 100644 --- a/src/arkode/fmod_int64/farkode_mod.c +++ b/src/arkode/fmod_int64/farkode_mod.c @@ -2253,6 +2253,20 @@ SWIGEXPORT int _wrap_FARKodeGetNumRelaxSolveIters(void *farg1, long *farg2) { } +SWIGEXPORT int _wrap_FARKodeCreateSUNStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper *)(farg2); + result = (int)ARKodeCreateSUNStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKBandPrecInit(void *farg1, int64_t const *farg2, int64_t const *farg3, int64_t const *farg4) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index f2239fc011..3b255deb0d 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -96,6 +96,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_STEPPER_UNSUPPORTED = -48_C_INT integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT + integer(C_INT), parameter, public :: ARK_SUNSTEPPER_ERR = -51_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -243,6 +244,7 @@ module farkode_mod public :: FARKodeGetNumRelaxBoundFails public :: FARKodeGetNumRelaxSolveFails public :: FARKodeGetNumRelaxSolveIters + public :: FARKodeCreateSUNStepper public :: FARKBandPrecInit public :: FARKBandPrecGetWorkSpace public :: FARKBandPrecGetNumRhsEvals @@ -1706,6 +1708,15 @@ function swigc_FARKodeGetNumRelaxSolveIters(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeCreateSUNStepper(farg1, farg2) & +bind(C, name="_wrap_FARKodeCreateSUNStepper") & +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_FARKBandPrecInit(farg1, farg2, farg3, farg4) & bind(C, name="_wrap_FARKBandPrecInit") & result(fresult) @@ -4631,6 +4642,22 @@ function FARKodeGetNumRelaxSolveIters(arkode_mem, iters) & swig_result = fresult end function +function FARKodeCreateSUNStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKodeCreateSUNStepper(farg1, farg2) +swig_result = fresult +end function + function FARKBandPrecInit(arkode_mem, n, mu, ml) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.c b/src/arkode/fmod_int64/farkode_mristep_mod.c index 5ddb7d077a..d5597bea4f 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.c +++ b/src/arkode/fmod_int64/farkode_mristep_mod.c @@ -755,6 +755,20 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { } +SWIGEXPORT int _wrap_FMRIStepInnerStepper_CreateFromSUNStepper(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (SUNStepper)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)MRIStepInnerStepper_CreateFromSUNStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_Free(void *farg1) { int fresult ; MRIStepInnerStepper *arg1 = (MRIStepInnerStepper *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index be5bb7445a..e2202c73da 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -132,6 +132,7 @@ module farkode_mristep_mod public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag public :: FMRIStepInnerStepper_Create + public :: FMRIStepInnerStepper_CreateFromSUNStepper public :: FMRIStepInnerStepper_Free public :: FMRIStepInnerStepper_SetContent public :: FMRIStepInnerStepper_GetContent @@ -530,6 +531,15 @@ function swigc_FMRIStepInnerStepper_Create(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepInnerStepper_CreateFromSUNStepper(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_CreateFromSUNStepper") & +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_FMRIStepInnerStepper_Free(farg1) & bind(C, name="_wrap_FMRIStepInnerStepper_Free") & result(fresult) @@ -1931,6 +1941,22 @@ function FMRIStepInnerStepper_Create(sunctx, stepper) & swig_result = fresult end function +function FMRIStepInnerStepper_CreateFromSUNStepper(sunstepper, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunstepper +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunstepper +farg2 = c_loc(stepper) +fresult = swigc_FMRIStepInnerStepper_CreateFromSUNStepper(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_Free(stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index cf31cb497e..e3d82d88a3 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -49,6 +49,7 @@ set(sundials_HEADERS sundials_nvector.hpp sundials_profiler.h sundials_profiler.hpp + sundials_stepper.h sundials_types_deprecated.h sundials_types.h sundials_version.h) @@ -95,6 +96,7 @@ set(sundials_SOURCES sundials_nonlinearsolver.c sundials_nvector_senswrapper.c sundials_nvector.c + sundials_stepper.c sundials_profiler.c sundials_version.c) diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index 62e0215249..9cec8422c8 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -291,6 +291,9 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { #include "sundials/sundials_adaptcontroller.h" + +#include "sundials/sundials_stepper.h" + SWIGEXPORT void _wrap_FSUNLogErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { int arg1 ; char *arg2 = (char *) 0 ; @@ -2641,4 +2644,290 @@ SWIGEXPORT int _wrap_FSUNAdaptController_Space(SUNAdaptController farg1, long *f } +SWIGEXPORT int _wrap_FSUNStepper_Create(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNStepper *)(farg2); + result = (SUNErrCode)SUNStepper_Create(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Destroy(void *farg1) { + int fresult ; + SUNStepper *arg1 = (SUNStepper *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper *)(farg1); + result = (SUNErrCode)SUNStepper_Destroy(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Evolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)SUNStepper_Evolve(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_OneStep(void *farg1, double const *farg2, N_Vector farg3, double *farg4) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)SUNStepper_OneStep(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_FullRhs(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4, int const *farg5) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNFullRhsMode arg5 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNFullRhsMode)(*farg5); + result = (SUNErrCode)SUNStepper_FullRhs(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Reset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNStepper_Reset(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStopTime(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int arg5 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (int)(*farg5); + result = (SUNErrCode)SUNStepper_SetForcing(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetContent(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)SUNStepper_SetContent(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetContent(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + void **arg2 = (void **) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (void **)(farg2); + result = (SUNErrCode)SUNStepper_GetContent(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetLastFlag(void *farg1, int const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNStepper_SetLastFlag(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetLastFlag(void *farg1, int *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNStepper_GetLastFlag(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetEvolveFn(void *farg1, SUNStepperEvolveFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperEvolveFn arg2 = (SUNStepperEvolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperEvolveFn)(farg2); + result = (SUNErrCode)SUNStepper_SetEvolveFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetOneStepFn(void *farg1, SUNStepperOneStepFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperOneStepFn arg2 = (SUNStepperOneStepFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperOneStepFn)(farg2); + result = (SUNErrCode)SUNStepper_SetOneStepFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetFullRhsFn(void *farg1, SUNStepperFullRhsFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperFullRhsFn arg2 = (SUNStepperFullRhsFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperFullRhsFn)(farg2); + result = (SUNErrCode)SUNStepper_SetFullRhsFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetResetFn(void *farg1, SUNStepperResetFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperResetFn arg2 = (SUNStepperResetFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperResetFn)(farg2); + result = (SUNErrCode)SUNStepper_SetResetFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTimeFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetStopTimeFn arg2 = (SUNStepperSetStopTimeFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetStopTimeFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStopTimeFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetForcingFn)(farg2); + result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetDestroyFn(void *farg1, SUNStepperDestroyFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperDestroyFn arg2 = (SUNStepperDestroyFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperDestroyFn)(farg2); + result = (SUNErrCode)SUNStepper_SetDestroyFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index 2bda4cb0fe..0b95e5c880 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -543,6 +543,33 @@ module fsundials_core_mod public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_Space + ! typedef enum SUNFullRhsMode + enum, bind(c) + enumerator :: SUN_FULLRHS_START + enumerator :: SUN_FULLRHS_END + enumerator :: SUN_FULLRHS_OTHER + end enum + integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) + public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER + public :: FSUNStepper_Create + public :: FSUNStepper_Destroy + public :: FSUNStepper_Evolve + public :: FSUNStepper_OneStep + public :: FSUNStepper_FullRhs + public :: FSUNStepper_Reset + public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetForcing + public :: FSUNStepper_SetContent + public :: FSUNStepper_GetContent + public :: FSUNStepper_SetLastFlag + public :: FSUNStepper_GetLastFlag + public :: FSUNStepper_SetEvolveFn + public :: FSUNStepper_SetOneStepFn + public :: FSUNStepper_SetFullRhsFn + public :: FSUNStepper_SetResetFn + public :: FSUNStepper_SetStopTimeFn + public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetDestroyFn ! WRAPPER DECLARATIONS interface @@ -2041,6 +2068,187 @@ function swigc_FSUNAdaptController_Space(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_Create(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_Create") & +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_FSUNStepper_Destroy(farg1) & +bind(C, name="_wrap_FSUNStepper_Destroy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_Evolve(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNStepper_Evolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_OneStep(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNStepper_OneStep") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_FullRhs(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNStepper_FullRhs") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_Reset(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNStepper_Reset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStopTime(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStopTime") & +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_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNStepper_SetForcing") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetContent(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetContent") & +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_FSUNStepper_GetContent(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetContent") & +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_FSUNStepper_SetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetLastFlag") & +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_FSUNStepper_GetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetLastFlag") & +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_FSUNStepper_SetEvolveFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetEvolveFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetOneStepFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetOneStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetFullRhsFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetFullRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetResetFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStopTimeFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetDestroyFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetDestroyFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -4782,5 +4990,339 @@ function FSUNAdaptController_Space(c, lenrw, leniw) & swig_result = fresult end function +function FSUNStepper_Create(sunctx, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(stepper) +fresult = swigc_FSUNStepper_Create(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_Destroy(stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(stepper) +fresult = swigc_FSUNStepper_Destroy(farg1) +swig_result = fresult +end function + +function FSUNStepper_Evolve(stepper, tout, vret, tret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: vret +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = stepper +farg2 = tout +farg3 = c_loc(vret) +farg4 = c_loc(tret(1)) +fresult = swigc_FSUNStepper_Evolve(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNStepper_OneStep(stepper, tout, vret, tret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: vret +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = stepper +farg2 = tout +farg3 = c_loc(vret) +farg4 = c_loc(tret(1)) +fresult = swigc_FSUNStepper_OneStep(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNStepper_FullRhs(stepper, t, v, f, mode) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: v +type(N_Vector), target, intent(inout) :: f +integer(SUNFullRhsMode), intent(in) :: mode +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = stepper +farg2 = t +farg3 = c_loc(v) +farg4 = c_loc(f) +farg5 = mode +fresult = swigc_FSUNStepper_FullRhs(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNStepper_Reset(stepper, tr, vr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: vr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = stepper +farg2 = tr +farg3 = c_loc(vr) +fresult = swigc_FSUNStepper_Reset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNStepper_SetStopTime(stepper, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = tstop +fresult = swigc_FSUNStepper_SetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tshift +real(C_DOUBLE), intent(in) :: tscale +type(C_PTR) :: forcing +integer(C_INT), intent(in) :: nforcing +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = stepper +farg2 = tshift +farg3 = tscale +farg4 = forcing +farg5 = nforcing +fresult = swigc_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNStepper_SetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = content +fresult = swigc_FSUNStepper_SetContent(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR), target, intent(inout) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(content) +fresult = swigc_FSUNStepper_GetContent(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetLastFlag(stepper, last_flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +integer(C_INT), intent(in) :: last_flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = stepper +farg2 = last_flag +fresult = swigc_FSUNStepper_SetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetLastFlag(stepper, last_flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +integer(C_INT), dimension(*), target, intent(inout) :: last_flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(last_flag(1)) +fresult = swigc_FSUNStepper_GetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetEvolveFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetEvolveFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetOneStepFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetOneStepFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetFullRhsFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetFullRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetResetFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetStopTimeFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetForcingFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetDestroyFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetDestroyFn(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index 2478b92d68..b1f96d2b55 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -291,6 +291,9 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { #include "sundials/sundials_adaptcontroller.h" + +#include "sundials/sundials_stepper.h" + SWIGEXPORT void _wrap_FSUNLogErrHandlerFn(int const *farg1, SwigArrayWrapper *farg2, SwigArrayWrapper *farg3, SwigArrayWrapper *farg4, int const *farg5, void *farg6, void *farg7) { int arg1 ; char *arg2 = (char *) 0 ; @@ -2641,4 +2644,290 @@ SWIGEXPORT int _wrap_FSUNAdaptController_Space(SUNAdaptController farg1, long *f } +SWIGEXPORT int _wrap_FSUNStepper_Create(void *farg1, void *farg2) { + int fresult ; + SUNContext arg1 = (SUNContext) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + SUNErrCode result; + + arg1 = (SUNContext)(farg1); + arg2 = (SUNStepper *)(farg2); + result = (SUNErrCode)SUNStepper_Create(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Destroy(void *farg1) { + int fresult ; + SUNStepper *arg1 = (SUNStepper *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper *)(farg1); + result = (SUNErrCode)SUNStepper_Destroy(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Evolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)SUNStepper_Evolve(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_OneStep(void *farg1, double const *farg2, N_Vector farg3, double *farg4) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + sunrealtype *arg4 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (sunrealtype *)(farg4); + result = (SUNErrCode)SUNStepper_OneStep(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_FullRhs(void *farg1, double const *farg2, N_Vector farg3, N_Vector farg4, int const *farg5) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNFullRhsMode arg5 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNFullRhsMode)(*farg5); + result = (SUNErrCode)SUNStepper_FullRhs(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_Reset(void *farg1, double const *farg2, N_Vector farg3) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + N_Vector arg3 = (N_Vector) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (N_Vector)(farg3); + result = (SUNErrCode)SUNStepper_Reset(arg1,arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStopTime(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + N_Vector *arg4 = (N_Vector *) 0 ; + int arg5 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector *)(farg4); + arg5 = (int)(*farg5); + result = (SUNErrCode)SUNStepper_SetForcing(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetContent(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + void *arg2 = (void *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (void *)(farg2); + result = (SUNErrCode)SUNStepper_SetContent(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetContent(void *farg1, void *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + void **arg2 = (void **) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (void **)(farg2); + result = (SUNErrCode)SUNStepper_GetContent(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetLastFlag(void *farg1, int const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + int arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (int)(*farg2); + result = (SUNErrCode)SUNStepper_SetLastFlag(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetLastFlag(void *farg1, int *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + int *arg2 = (int *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (int *)(farg2); + result = (SUNErrCode)SUNStepper_GetLastFlag(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetEvolveFn(void *farg1, SUNStepperEvolveFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperEvolveFn arg2 = (SUNStepperEvolveFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperEvolveFn)(farg2); + result = (SUNErrCode)SUNStepper_SetEvolveFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetOneStepFn(void *farg1, SUNStepperOneStepFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperOneStepFn arg2 = (SUNStepperOneStepFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperOneStepFn)(farg2); + result = (SUNErrCode)SUNStepper_SetOneStepFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetFullRhsFn(void *farg1, SUNStepperFullRhsFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperFullRhsFn arg2 = (SUNStepperFullRhsFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperFullRhsFn)(farg2); + result = (SUNErrCode)SUNStepper_SetFullRhsFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetResetFn(void *farg1, SUNStepperResetFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperResetFn arg2 = (SUNStepperResetFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperResetFn)(farg2); + result = (SUNErrCode)SUNStepper_SetResetFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTimeFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetStopTimeFn arg2 = (SUNStepperSetStopTimeFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetStopTimeFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStopTimeFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetForcingFn)(farg2); + result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetDestroyFn(void *farg1, SUNStepperDestroyFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperDestroyFn arg2 = (SUNStepperDestroyFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperDestroyFn)(farg2); + result = (SUNErrCode)SUNStepper_SetDestroyFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 7096d0c6ce..13be2c2a2a 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -543,6 +543,33 @@ module fsundials_core_mod public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_Space + ! typedef enum SUNFullRhsMode + enum, bind(c) + enumerator :: SUN_FULLRHS_START + enumerator :: SUN_FULLRHS_END + enumerator :: SUN_FULLRHS_OTHER + end enum + integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) + public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER + public :: FSUNStepper_Create + public :: FSUNStepper_Destroy + public :: FSUNStepper_Evolve + public :: FSUNStepper_OneStep + public :: FSUNStepper_FullRhs + public :: FSUNStepper_Reset + public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetForcing + public :: FSUNStepper_SetContent + public :: FSUNStepper_GetContent + public :: FSUNStepper_SetLastFlag + public :: FSUNStepper_GetLastFlag + public :: FSUNStepper_SetEvolveFn + public :: FSUNStepper_SetOneStepFn + public :: FSUNStepper_SetFullRhsFn + public :: FSUNStepper_SetResetFn + public :: FSUNStepper_SetStopTimeFn + public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetDestroyFn ! WRAPPER DECLARATIONS interface @@ -2041,6 +2068,187 @@ function swigc_FSUNAdaptController_Space(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_Create(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_Create") & +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_FSUNStepper_Destroy(farg1) & +bind(C, name="_wrap_FSUNStepper_Destroy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_Evolve(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNStepper_Evolve") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_OneStep(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNStepper_OneStep") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_FullRhs(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNStepper_FullRhs") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_Reset(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNStepper_Reset") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStopTime(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStopTime") & +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_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNStepper_SetForcing") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +integer(C_INT), intent(in) :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetContent(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetContent") & +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_FSUNStepper_GetContent(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetContent") & +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_FSUNStepper_SetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetLastFlag") & +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_FSUNStepper_GetLastFlag(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetLastFlag") & +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_FSUNStepper_SetEvolveFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetEvolveFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetOneStepFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetOneStepFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetFullRhsFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetFullRhsFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetResetFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStopTimeFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetDestroyFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetDestroyFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -4782,5 +4990,339 @@ function FSUNAdaptController_Space(c, lenrw, leniw) & swig_result = fresult end function +function FSUNStepper_Create(sunctx, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = sunctx +farg2 = c_loc(stepper) +fresult = swigc_FSUNStepper_Create(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_Destroy(stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(stepper) +fresult = swigc_FSUNStepper_Destroy(farg1) +swig_result = fresult +end function + +function FSUNStepper_Evolve(stepper, tout, vret, tret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: vret +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = stepper +farg2 = tout +farg3 = c_loc(vret) +farg4 = c_loc(tret(1)) +fresult = swigc_FSUNStepper_Evolve(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNStepper_OneStep(stepper, tout, vret, tret) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tout +type(N_Vector), target, intent(inout) :: vret +real(C_DOUBLE), dimension(*), target, intent(inout) :: tret +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 + +farg1 = stepper +farg2 = tout +farg3 = c_loc(vret) +farg4 = c_loc(tret(1)) +fresult = swigc_FSUNStepper_OneStep(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNStepper_FullRhs(stepper, t, v, f, mode) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: t +type(N_Vector), target, intent(inout) :: v +type(N_Vector), target, intent(inout) :: f +integer(SUNFullRhsMode), intent(in) :: mode +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = stepper +farg2 = t +farg3 = c_loc(v) +farg4 = c_loc(f) +farg5 = mode +fresult = swigc_FSUNStepper_FullRhs(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNStepper_Reset(stepper, tr, vr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tr +type(N_Vector), target, intent(inout) :: vr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +type(C_PTR) :: farg3 + +farg1 = stepper +farg2 = tr +farg3 = c_loc(vr) +fresult = swigc_FSUNStepper_Reset(farg1, farg2, farg3) +swig_result = fresult +end function + +function FSUNStepper_SetStopTime(stepper, tstop) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tstop +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = tstop +fresult = swigc_FSUNStepper_SetStopTime(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: tshift +real(C_DOUBLE), intent(in) :: tscale +type(C_PTR) :: forcing +integer(C_INT), intent(in) :: nforcing +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +integer(C_INT) :: farg5 + +farg1 = stepper +farg2 = tshift +farg3 = tscale +farg4 = forcing +farg5 = nforcing +fresult = swigc_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNStepper_SetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = content +fresult = swigc_FSUNStepper_SetContent(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetContent(stepper, content) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_PTR), target, intent(inout) :: content +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(content) +fresult = swigc_FSUNStepper_GetContent(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetLastFlag(stepper, last_flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +integer(C_INT), intent(in) :: last_flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = stepper +farg2 = last_flag +fresult = swigc_FSUNStepper_SetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetLastFlag(stepper, last_flag) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +integer(C_INT), dimension(*), target, intent(inout) :: last_flag +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(last_flag(1)) +fresult = swigc_FSUNStepper_GetLastFlag(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetEvolveFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetEvolveFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetOneStepFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetOneStepFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetFullRhsFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetFullRhsFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetResetFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetStopTimeFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetForcingFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetDestroyFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetDestroyFn(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/sundials/sundials_stepper.c b/src/sundials/sundials_stepper.c new file mode 100644 index 0000000000..def6592823 --- /dev/null +++ b/src/sundials/sundials_stepper.c @@ -0,0 +1,202 @@ +/* ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 <stdlib.h> +#include <string.h> +#include <sundials/priv/sundials_errors_impl.h> +#include <sundials/sundials_core.h> + +#include "sundials/sundials_errors.h" +#include "sundials/sundials_nvector.h" +#include "sundials/sundials_types.h" +#include "sundials_stepper_impl.h" + +SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper_ptr) +{ + SUNFunctionBegin(sunctx); + SUNCheck(stepper_ptr, SUN_ERR_ARG_CORRUPT); + + SUNStepper stepper = malloc(sizeof(*stepper)); + SUNAssert(stepper, SUN_ERR_MALLOC_FAIL); + + stepper->content = NULL; + stepper->sunctx = sunctx; + stepper->last_flag = SUN_SUCCESS; + + stepper->ops = malloc(sizeof(*(stepper->ops))); + SUNAssert(stepper->ops, SUN_ERR_MALLOC_FAIL); + + stepper->ops->evolve = NULL; + stepper->ops->onestep = NULL; + stepper->ops->fullrhs = NULL; + stepper->ops->reset = NULL; + stepper->ops->setstoptime = NULL; + stepper->ops->setforcing = NULL; + stepper->ops->destroy = NULL; + + *stepper_ptr = stepper; + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_Destroy(SUNStepper* stepper_ptr) +{ + if (stepper_ptr != NULL) + { + const SUNStepper_Ops ops = (*stepper_ptr)->ops; + if (ops && ops->destroy) { ops->destroy(*stepper_ptr); } + free(ops); + free(*stepper_ptr); + *stepper_ptr = NULL; + } + + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_Evolve(SUNStepper stepper, sunrealtype tout, N_Vector y, + sunrealtype* tret) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->evolve) + { + return stepper->ops->evolve(stepper, tout, y, tret); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_OneStep(SUNStepper stepper, sunrealtype tout, N_Vector y, + sunrealtype* tret) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->onestep) + { + return stepper->ops->onestep(stepper, tout, y, tret); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, + N_Vector f, SUNFullRhsMode mode) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->fullrhs) + { + return stepper->ops->fullrhs(stepper, t, v, f, mode); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector yR) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->reset) { return stepper->ops->reset(stepper, tR, yR); } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_SetStopTime(SUNStepper stepper, sunrealtype tstop) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->setstoptime) + { + return stepper->ops->setstoptime(stepper, tstop); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, + sunrealtype tscale, N_Vector* forcing, + int nforcing) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->setforcing) + { + return stepper->ops->setforcing(stepper, tshift, tscale, forcing, nforcing); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + +SUNErrCode SUNStepper_SetContent(SUNStepper stepper, void* content) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->content = content; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_GetContent(SUNStepper stepper, void** content) +{ + SUNFunctionBegin(stepper->sunctx); + *content = stepper->content; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetLastFlag(SUNStepper stepper, int last_flag) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->last_flag = last_flag; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_GetLastFlag(SUNStepper stepper, int* last_flag) +{ + SUNFunctionBegin(stepper->sunctx); + *last_flag = stepper->last_flag; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetEvolveFn(SUNStepper stepper, SUNStepperEvolveFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->evolve = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetOneStepFn(SUNStepper stepper, SUNStepperOneStepFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->onestep = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetFullRhsFn(SUNStepper stepper, SUNStepperFullRhsFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->fullrhs = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetResetFn(SUNStepper stepper, SUNStepperResetFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->reset = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetStopTimeFn(SUNStepper stepper, SUNStepperSetStopTimeFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->setstoptime = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, SUNStepperSetForcingFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->setforcing = fn; + return SUN_SUCCESS; +} + +SUNErrCode SUNStepper_SetDestroyFn(SUNStepper stepper, SUNStepperDestroyFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->destroy = fn; + return SUN_SUCCESS; +} diff --git a/src/sundials/sundials_stepper_impl.h b/src/sundials/sundials_stepper_impl.h new file mode 100644 index 0000000000..ab3b763c51 --- /dev/null +++ b/src/sundials/sundials_stepper_impl.h @@ -0,0 +1,53 @@ +/* ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * -----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_STEPPER_IMPL_H +#define _SUNDIALS_STEPPER_IMPL_H + +#include <sundials/sundials_core.h> +#include <sundials/sundials_stepper.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct SUNStepper_Ops_* SUNStepper_Ops; + +struct SUNStepper_Ops_ +{ + SUNStepperEvolveFn evolve; + SUNStepperOneStepFn onestep; + SUNStepperFullRhsFn fullrhs; + SUNStepperResetFn reset; + SUNStepperSetStopTimeFn setstoptime; + SUNStepperSetForcingFn setforcing; + SUNStepperDestroyFn destroy; +}; + +struct SUNStepper_ +{ + /* stepper specific content and operations */ + void* content; + SUNStepper_Ops ops; + + /* stepper context */ + SUNContext sunctx; + + /* last stepper return flag */ + int last_flag; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNDIALS_STEPPER_IMPL_H */ diff --git a/swig/sundials/fsundials_core_mod.i b/swig/sundials/fsundials_core_mod.i index 344f9372bb..930e55c702 100644 --- a/swig/sundials/fsundials_core_mod.i +++ b/swig/sundials/fsundials_core_mod.i @@ -25,4 +25,5 @@ %include "fsundials_linearsolver.i" %include "fsundials_nonlinearsolver.i" %include "fsundials_adaptcontroller.i" +%include "fsundials_stepper.i" %include "fcopyright.i" diff --git a/swig/sundials/fsundials_stepper.i b/swig/sundials/fsundials_stepper.i new file mode 100644 index 0000000000..c72ea64546 --- /dev/null +++ b/swig/sundials/fsundials_stepper.i @@ -0,0 +1,25 @@ +// --------------------------------------------------------------- +// Programmer: Steven B. Roberts @ LLNL +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2024, 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 "sundials/sundials_stepper.h" +%} + +%apply void* { SUNStepper }; + +// Process and wrap functions in the following files +%include "sundials/sundials_stepper.h" + From f23fe784fb2c77cc537d428ac3b187096c835624 Mon Sep 17 00:00:00 2001 From: Peter Hill <zed.three@gmail.com> Date: Tue, 3 Dec 2024 21:40:17 +0000 Subject: [PATCH 119/137] CMake: Don't clobber un-namespaced options (#600) Non-`SUNDIALS` namespaced variables may be used by other projects so don't `unset` them. Fixes #538 --------- Signed-off-by: Peter Hill <peter.hill@york.ac.uk> Co-authored-by: Cody Balos <balos1@llnl.gov> --- CHANGELOG.md | 4 ++ cmake/SundialsTPLOptions.cmake | 99 ++++++++++++---------------------- doc/shared/RecentChanges.rst | 4 ++ 3 files changed, 42 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9232cd3c7..6aba1c0f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,10 @@ support. Fixed a CMake configuration issue related to aliasing an `ALIAS` target when using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. +Fixed a CMake issue which caused third-party CMake variables to be unset. +Users may see more options in the CMake GUI now as a result of the fix. +See details in GitHub Issue [#538](https://github.com/LLNL/sundials/issues/538). + ### Deprecation Notices The ARKODE stepper specific functions to retrieve the number of right-hand side diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 291709c8a8..765dcb4120 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -70,12 +70,11 @@ sundials_option( sundials_option(ENABLE_LAPACK BOOL "Enable Lapack support" OFF) sundials_option(LAPACK_LIBRARIES STRING "Lapack and Blas libraries" - "${LAPACK_LIBRARIES}" DEPENDS_ON ENABLE_LAPACK) + "${LAPACK_LIBRARIES}") sundials_option( LAPACK_WORKS BOOL "Set to ON to force CMake to accept a given LAPACK configuration" OFF - DEPENDS_ON ENABLE_LAPACK ADVANCED) # --------------------------------------------------------------- @@ -84,7 +83,7 @@ sundials_option( sundials_option(ENABLE_GINKGO BOOL "Enable Ginkgo support" OFF) sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" - "${Ginkgo_DIR}" DEPENDS_ON ENABLE_GINKGO) + "${Ginkgo_DIR}") sundials_option( SUNDIALS_GINKGO_BACKENDS @@ -96,7 +95,6 @@ sundials_option( sundials_option( GINKGO_WORKS BOOL "Set to ON to force CMake to accept a given Ginkgo configuration" OFF - DEPENDS_ON ENABLE_GINKGO ADVANCED) # --------------------------------------------------------------- @@ -105,7 +103,7 @@ sundials_option( sundials_option(ENABLE_MAGMA BOOL "Enable MAGMA support" OFF) sundials_option(MAGMA_DIR PATH "Path to the root of a MAGMA installation" - "${MAGMA_DIR}" DEPENDS_ON ENABLE_MAGMA) + "${MAGMA_DIR}") sundials_option( SUNDIALS_MAGMA_BACKENDS STRING @@ -116,9 +114,7 @@ sundials_option( sundials_option( MAGMA_WORKS BOOL - "Set to ON to force CMake to accept a given MAGMA configuration" OFF - DEPENDS_ON ENABLE_MAGMA - ADVANCED) + "Set to ON to force CMake to accept a given MAGMA configuration" OFF ADVANCED) # --------------------------------------------------------------- # Enable SuperLU_DIST support? @@ -127,30 +123,24 @@ sundials_option(ENABLE_SUPERLUDIST BOOL "Enable SuperLU_DIST support" OFF) sundials_option( SUPERLUDIST_DIR PATH "Path to the root of the SuperLU_DIST installation" - "${SUPERLUDIST_DIR}" DEPENDS_ON ENABLE_SUPERLUDIST) + "${SUPERLUDIST_DIR}") sundials_option( SUPERLUDIST_INCLUDE_DIRS PATH "SuperLU_DIST include directories" - "${SUPERLUDIST_INCLUDE_DIRS}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) + "${SUPERLUDIST_INCLUDE_DIRS}" ADVANCED) sundials_option( SUPERLUDIST_LIBRARIES STRING "Semi-colon separated list of libraries needed for SuperLU_DIST." - "${SUPERLUDIST_LIBRARIES}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) + "${SUPERLUDIST_LIBRARIES}" ADVANCED) sundials_option( SUPERLUDIST_OpenMP BOOL - "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF - DEPENDS_ON ENABLE_SUPERLUDIST) + "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF) sundials_option( SUPERLUDIST_WORKS BOOL "Set to ON to force CMake to accept a given SuperLU_DIST configuration" OFF - DEPENDS_ON ENABLE_SUPERLUDIST ADVANCED) # --------------------------------------------------------------- @@ -159,24 +149,22 @@ sundials_option( sundials_option(ENABLE_SUPERLUMT BOOL "Enable SuperLU_MT support" OFF) sundials_option(SUPERLUMT_INCLUDE_DIR PATH "SuperLU_MT include directory" - "${SUPERLUMT_INCLUDE_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) + "${SUPERLUMT_INCLUDE_DIR}") sundials_option(SUPERLUMT_LIBRARY_DIR PATH "SuperLU_MT library directory" - "${SUPERLUMT_LIBRARY_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) + "${SUPERLUMT_LIBRARY_DIR}") sundials_option( SUPERLUMT_LIBRARIES STRING "Semi-colon separated list of additional libraries needed for SuperLU_MT." - "${SUPERLUMT_LIBRARIES}" DEPENDS_ON ENABLE_SUPERLUMT) + "${SUPERLUMT_LIBRARIES}") -sundials_option( - SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" - "PTHREAD" DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option(SUPERLUMT_THREAD_TYPE STRING + "SuperLU_MT threading type: OPENMP or PTHREAD" "PTHREAD") sundials_option( SUPERLUMT_WORKS BOOL "Set to ON to force CMake to accept a given SUPERLUMT configuration" OFF - DEPENDS_ON ENABLE_SUPERLUMT ADVANCED) # --------------------------------------------------------------- @@ -185,36 +173,31 @@ sundials_option( sundials_option(ENABLE_KLU BOOL "Enable KLU support" OFF) sundials_option(KLU_INCLUDE_DIR PATH "KLU include directory" - "${KLU_INCLUDE_DIR}" DEPENDS_ON ENABLE_KLU) + "${KLU_INCLUDE_DIR}") sundials_option(KLU_LIBRARY_DIR PATH "KLU library directory" - "${KLU_LIBRARY_DIR}" DEPENDS_ON ENABLE_KLU) + "${KLU_LIBRARY_DIR}") sundials_option( KLU_WORKS BOOL "Set to ON to force CMake to accept a given KLU configuration" - OFF - DEPENDS_ON ENABLE_KLU - ADVANCED) + OFF ADVANCED) # --------------------------------------------------------------- # Enable hypre support? # --------------------------------------------------------------- sundials_option(ENABLE_HYPRE BOOL "Enable hypre support" OFF) -sundials_option(HYPRE_DIR PATH "Path to hypre installation" "${HYPRE_DIR}" - DEPENDS_ON ENABLE_HYPRE) +sundials_option(HYPRE_DIR PATH "Path to hypre installation" "${HYPRE_DIR}") sundials_option(HYPRE_INCLUDE_DIR PATH "HYPRE include directory" - "${HYPRE_INCLUDE_DIR}" DEPENDS_ON ENABLE_HYPRE) + "${HYPRE_INCLUDE_DIR}") sundials_option(HYPRE_LIBRARY_DIR PATH "HYPRE library directory" - "${HYPRE_LIBRARY_DIR}" DEPENDS_ON ENABLE_HYPRE) + "${HYPRE_LIBRARY_DIR}") sundials_option( HYPRE_WORKS BOOL - "Set to ON to force CMake to accept a given hypre configuration" OFF - DEPENDS_ON ENABLE_HYPRE - ADVANCED) + "Set to ON to force CMake to accept a given hypre configuration" OFF ADVANCED) # --------------------------------------------------------------- # Enable PETSc support? @@ -223,36 +206,30 @@ sundials_option( sundials_option(ENABLE_PETSC BOOL "Enable PETSc support" OFF) sundials_option(PETSC_DIR PATH "Path to the root of a PETSc installation" - "${PETSC_DIR}" DEPENDS_ON ENABLE_PETSC) + "${PETSC_DIR}") sundials_option(PETSC_ARCH STRING "PETSc architecture (optional)" - "${PETSC_ARCH}" DEPENDS_ON ENABLE_PETSC) + "${PETSC_ARCH}") sundials_option( PETSC_LIBRARIES STRING "Semi-colon separated list of PETSc link libraries" - "${PETSC_LIBRARIES}" - DEPENDS_ON ENABLE_PETSC - ADVANCED) + "${PETSC_LIBRARIES}" ADVANCED) sundials_option( - PETSC_INCLUDES STRING "Semi-colon separated list of PETSc include directories" - "${PETSC_INCLUDES}" - DEPENDS_ON ENABLE_PETSC + PETSC_INCLUDES STRING + "Semi-colon separated list of PETSc include directories" "${PETSC_INCLUDES}" ADVANCED) sundials_option( PETSC_WORKS BOOL - "Set to ON to force CMake to accept a given PETSc configuration" OFF - DEPENDS_ON ENABLE_PETSC - ADVANCED) + "Set to ON to force CMake to accept a given PETSc configuration" OFF ADVANCED) # ------------------------------------------------------------- # Enable RAJA support? # ------------------------------------------------------------- sundials_option(ENABLE_RAJA BOOL "Enable RAJA support" OFF) -sundials_option(RAJA_DIR PATH "Path to root of RAJA installation" "${RAJA_DIR}" - DEPENDS_ON ENABLE_RAJA) +sundials_option(RAJA_DIR PATH "Path to root of RAJA installation" "${RAJA_DIR}") sundials_option( SUNDIALS_RAJA_BACKENDS STRING @@ -276,24 +253,20 @@ sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" sundials_option(ENABLE_XBRAID BOOL "Enable XBraid support" OFF) sundials_option(XBRAID_DIR PATH "Path to the root of an XBraid installation" - "${XBRAID_DIR}" DEPENDS_ON ENABLE_XBRAID) + "${XBRAID_DIR}") sundials_option( XBRAID_LIBRARIES STRING "Semi-colon separated list of XBraid link libraries" - "${XBRAID_LIBRARIES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) + "${XBRAID_LIBRARIES}" ADVANCED) sundials_option( XBRAID_INCLUDES STRING - "Semi-colon separated list of XBraid include directories" "${XBRAID_INCLUDES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) + "Semi-colon separated list of XBraid include directories" + "${XBRAID_INCLUDES}" ADVANCED) sundials_option( XBRAID_WORKS BOOL "Set to ON to force CMake to accept a given XBraid configuration" OFF - DEPENDS_ON ENABLE_XBRAID ADVANCED) # ------------------------------------------------------------- @@ -303,12 +276,11 @@ sundials_option( sundials_option(ENABLE_ONEMKL BOOL "Enable oneMKL support" OFF) sundials_option(ONEMKL_DIR PATH "Path to root of oneMKL installation" - "${ONEMKL_DIR}" DEPENDS_ON ENABLE_ONEMKL) + "${ONEMKL_DIR}") sundials_option( ONEMKL_WORKS BOOL "Set to ON to force CMake to accept a given oneMKL configuration" OFF - DEPENDS_ON ENABLE_ONEMKL ADVANCED) sundials_option( @@ -331,12 +303,11 @@ sundials_option(ENABLE_CALIPER BOOL "Enable CALIPER support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) sundials_option(CALIPER_DIR PATH "Path to the root of an CALIPER installation" - "${CALIPER_DIR}" DEPENDS_ON ENABLE_CALIPER) + "${CALIPER_DIR}") sundials_option( CALIPER_WORKS BOOL "Set to ON to force CMake to accept a given CALIPER configuration" OFF - DEPENDS_ON ENABLE_CALIPER ADVANCED) # --------------------------------------------------------------- @@ -347,7 +318,7 @@ sundials_option(ENABLE_ADIAK BOOL "Enable Adiak support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" - "${ADIAK_DIR}" DEPENDS_ON ENABLE_ADIAK) + "${ADIAK_DIR}") # --------------------------------------------------------------- # Enable Kokkos support? @@ -361,7 +332,6 @@ sundials_option(Kokkos_DIR PATH "Path to the root of a Kokkos installation" sundials_option( KOKKOS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS ADVANCED) # --------------------------------------------------------------- @@ -377,5 +347,4 @@ sundials_option( sundials_option( KOKKOS_KERNELS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS ENABLE_KOKKOS_KERNELS ADVANCED) diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index fa710070db..c13e19c596 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -68,6 +68,10 @@ support. Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. +Fixed a CMake issue which caused third-party CMake variables to be unset. +Users may see more options in the CMake GUI now as a result of the fix. +See details in GitHub Issue `#538 <https://github.com/LLNL/sundials/issues/538>`__. + **Deprecation Notices** The ARKODE stepper specific functions to retrieve the number of right-hand side From 0eb57c237ed906ed107819c20aa5d8847fc192ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:48:28 -0800 Subject: [PATCH 120/137] Build(deps): Bump docker/build-push-action from 6.0.2 to 6.10.0 (#604) Bumps docker/build-push-action from 6.0.2 to 6.10.0. ---------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Cody Balos <balos1@llnl.gov> Co-authored-by: David Gardner <gardner48@llnl.gov> --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index ad6cb16a2f..ee7c931f8d 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -26,7 +26,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.10.0 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -56,7 +56,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.10.0 with: context: "./docker/sundials-ci/e4s-quarterly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 5045a62a3b..176b3a3d88 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -32,7 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.10.0 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml From 122f709af7ee88a9f09fcdccc6a4133c8a868fb8 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Tue, 3 Dec 2024 18:08:47 -0600 Subject: [PATCH 121/137] CMake: Add config error for CUDA with extended precision (#605) Updated CMake to prohibit CUDA interfaces when sunrealtype is set to extended precision. Currently, this configuration just results in build failures later on, so this PR heads this off with a clear error message. --- cmake/SundialsSetupCuda.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index ef01d0faba..09703288bc 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -53,6 +53,15 @@ if((CMAKE_CXX_COMPILER_ID MATCHES GNU) endif() endif() +# =============================================================== +# Prohibit CUDA interface when using extended precision. +# =============================================================== + +if(SUNDIALS_PRECISION MATCHES "EXTENDED") + message( + FATAL_ERROR "CUDA interfaces are incompatible with extended precision.") +endif() + # =============================================================== # Enable CUDA lang and find the CUDA libraries. # =============================================================== From a5850b92637915cfe0e79868e6922c5bf8575c7a Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" <reynolds@smu.edu> Date: Wed, 4 Dec 2024 14:21:56 -0600 Subject: [PATCH 122/137] Feature: Add adaptive MRI-GARK, MRI-SR, and MERK methods (#564) Add slow time scale adaptivity to MRI-GARK methods Add adaptive MRI-SR and MERK methods --------- Co-authored-by: David J. Gardner <gardner48@llnl.gov> Co-authored-by: Steven Roberts <roberts115@llnl.gov> --- CHANGELOG.md | 28 + doc/arkode/guide/source/Constants.rst | 95 +- doc/arkode/guide/source/Mathematics.rst | 602 +++- .../source/Usage/ARKStep/User_callable.rst | 6 +- .../source/Usage/ERKStep/User_callable.rst | 8 +- .../source/Usage/LSRKStep/User_callable.rst | 84 +- .../Custom_Inner_Stepper/Description.rst | 266 +- .../MRIStep/Custom_Inner_Stepper/index.rst | 33 +- .../source/Usage/MRIStep/MRIStepCoupling.rst | 465 ++- .../guide/source/Usage/MRIStep/Skeleton.rst | 24 +- .../source/Usage/MRIStep/User_callable.rst | 2299 ++++++------- .../guide/source/Usage/User_callable.rst | 189 +- .../SUNAdaptController_links.rst | 1 + doc/shared/RecentChanges.rst | 29 + .../SUNAdaptController_Description.rst | 113 +- .../SUNAdaptController_MRIHTol.rst | 215 ++ doc/shared/sundials.bib | 31 + .../SUNAdaptController_links.rst | 1 + .../CXX_parallel/ark_diffusion_reaction_p.cpp | 4 +- ...sion_reaction_p_--np_2_2_--mri-arkstep.out | 72 +- ...reaction_p_--np_2_2_--mri-cvode-global.out | 69 +- ..._reaction_p_--np_2_2_--mri-cvode-local.out | 69 +- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 4 +- .../ark_heat2D_hypre_pfmg_mri_--np_2_2.out | 37 +- examples/arkode/CXX_serial/CMakeLists.txt | 1 + .../ark_advection_diffusion_reaction.cpp | 4 +- .../arkode/CXX_serial/ark_kpr_nestedmri.cpp | 2011 ++++++++++++ .../arkode/CXX_serial/ark_kpr_nestedmri.out | 51 + examples/arkode/C_serial/CMakeLists.txt | 29 +- .../C_serial/ark_brusselator1D_imexmri.c | 7 +- .../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_brusselator_1D_mri.c | 7 +- .../C_serial/ark_brusselator_1D_mri.out | 2 +- .../arkode/C_serial/ark_brusselator_mri.c | 7 +- .../arkode/C_serial/ark_brusselator_mri.out | 2 +- examples/arkode/C_serial/ark_kpr_mri.c | 606 ++-- examples/arkode/C_serial/ark_kpr_mri.out | 69 - .../arkode/C_serial/ark_kpr_mri_0_0.002.out | 69 - ..._2_0.005.out => ark_kpr_mri_0_1_0.005.out} | 6 +- .../ark_kpr_mri_10_4_0.001_-100_100_0.5_1.out | 73 + .../C_serial/ark_kpr_mri_11_2_0.001.out | 73 + .../C_serial/ark_kpr_mri_12_3_0.005.out | 73 + .../arkode/C_serial/ark_kpr_mri_13_4_0.01.out | 73 + .../arkode/C_serial/ark_kpr_mri_1_0.002.out | 69 - ...ri_3_0.01.out => ark_kpr_mri_1_0_0.01.out} | 5 +- .../arkode/C_serial/ark_kpr_mri_1_1_0.002.out | 73 + .../arkode/C_serial/ark_kpr_mri_2_4_0.002.out | 69 + .../arkode/C_serial/ark_kpr_mri_3_2_0.001.out | 69 + .../arkode/C_serial/ark_kpr_mri_4_0.002.out | 72 - .../arkode/C_serial/ark_kpr_mri_4_3_0.001.out | 69 + .../arkode/C_serial/ark_kpr_mri_5_0.002.out | 69 - .../arkode/C_serial/ark_kpr_mri_5_4_0.001.out | 69 + .../arkode/C_serial/ark_kpr_mri_6_0.005.out | 69 - .../arkode/C_serial/ark_kpr_mri_6_5_0.001.out | 69 + .../arkode/C_serial/ark_kpr_mri_7_0.001.out | 72 - .../arkode/C_serial/ark_kpr_mri_7_2_0.002.out | 73 + .../arkode/C_serial/ark_kpr_mri_8_0.001.out | 72 - ... ark_kpr_mri_8_3_0.001_-100_100_0.5_1.out} | 9 +- .../arkode/C_serial/ark_kpr_mri_9_0.001.out | 72 - .../ark_kpr_mri_9_0.001_-100_100_0.5_1.out | 72 - ... ark_kpr_mri_9_3_0.001_-100_100_0.5_1.out} | 7 +- .../arkode/C_serial/ark_onewaycouple_mri.c | 7 +- .../arkode/C_serial/ark_onewaycouple_mri.out | 2 +- .../C_serial/ark_reaction_diffusion_mri.c | 7 +- .../C_serial/ark_reaction_diffusion_mri.out | 3 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 7 +- .../arkode/C_serial/ark_twowaycouple_mri.out | 2 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 4 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.out | 2 +- .../ark_kpr_mri_f2003_0_0.002.out | 2 +- .../ark_kpr_mri_f2003_1_0.002.out | 2 +- .../F2003_serial/ark_kpr_mri_f2003_3_0.01.out | 2 +- .../ark_kpr_mri_f2003_4_0.002.out | 2 +- .../ark_kpr_mri_f2003_5_0.002.out | 56 +- .../ark_kpr_mri_f2003_6_0.005.out | 4 +- .../ark_kpr_mri_f2003_7_0.001.out | 2 +- .../ark_kpr_mri_f2003_8_0.001.out | 2 +- .../ark_kpr_mri_f2003_9_0.001.out | 82 +- examples/utilities/example_utilities.hpp | 25 +- include/arkode/arkode.h | 21 + include/arkode/arkode_arkstep.h | 7 +- include/arkode/arkode_mristep.h | 59 +- .../sunadaptcontroller_mrihtol.h | 88 + include/sundials/sundials_adaptcontroller.h | 39 +- scripts/shared | 1 + src/arkode/CMakeLists.txt | 4 +- src/arkode/arkode.c | 313 +- src/arkode/arkode_arkstep.c | 239 +- src/arkode/arkode_arkstep_impl.h | 4 +- src/arkode/arkode_arkstep_io.c | 14 +- src/arkode/arkode_erkstep.c | 378 ++- src/arkode/arkode_erkstep_impl.h | 15 +- src/arkode/arkode_erkstep_io.c | 8 +- src/arkode/arkode_impl.h | 126 +- src/arkode/arkode_io.c | 213 +- src/arkode/arkode_lsrkstep.c | 3 +- src/arkode/arkode_lsrkstep_impl.h | 4 +- src/arkode/arkode_mri_tables.c | 330 +- src/arkode/arkode_mri_tables.def | 574 +++- src/arkode/arkode_mristep.c | 2843 ++++++++++++++--- src/arkode/arkode_mristep_controller.c | 142 + src/arkode/arkode_mristep_impl.h | 115 +- src/arkode/arkode_mristep_io.c | 122 +- src/arkode/arkode_sprkstep.c | 3 +- src/arkode/arkode_sprkstep_impl.h | 2 +- src/arkode/fmod_int32/farkode_mod.c | 54 + src/arkode/fmod_int32/farkode_mod.f90 | 109 + src/arkode/fmod_int32/farkode_mristep_mod.c | 128 + src/arkode/fmod_int32/farkode_mristep_mod.f90 | 259 +- src/arkode/fmod_int64/farkode_mod.c | 54 + src/arkode/fmod_int64/farkode_mod.f90 | 109 + src/arkode/fmod_int64/farkode_mristep_mod.c | 128 + src/arkode/fmod_int64/farkode_mristep_mod.f90 | 259 +- src/sunadaptcontroller/CMakeLists.txt | 5 +- src/sunadaptcontroller/mrihtol/CMakeLists.txt | 28 + .../mrihtol/fmod_int32/CMakeLists.txt | 21 + .../fsunadaptcontroller_mrihtol_mod.c | 639 ++++ .../fsunadaptcontroller_mrihtol_mod.f90 | 688 ++++ .../mrihtol/fmod_int64/CMakeLists.txt | 21 + .../fsunadaptcontroller_mrihtol_mod.c | 639 ++++ .../fsunadaptcontroller_mrihtol_mod.f90 | 688 ++++ .../mrihtol/sunadaptcontroller_mrihtol.c | 274 ++ src/sundials/fmod_int32/fsundials_core_mod.c | 46 + .../fmod_int32/fsundials_core_mod.f90 | 93 +- src/sundials/fmod_int64/fsundials_core_mod.c | 46 + .../fmod_int64/fsundials_core_mod.f90 | 93 +- src/sundials/sundials_adaptcontroller.c | 54 +- swig/Makefile | 2 +- .../fsunadaptcontroller_mrihtol_mod.i | 29 + test/answers | 2 +- test/test_driver.sh | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 4 +- .../CXX_parallel/ark_test_heat2D_mri_0.out | 6 +- .../CXX_parallel/ark_test_heat2D_mri_1.out | 6 +- .../arkode/CXX_serial/CMakeLists.txt | 72 +- .../ark_test_accumerror_brusselator.cpp | 717 +++++ ...rk_test_accumerror_brusselator_20_-4_0.out | 329 ++ ...ark_test_accumerror_brusselator_20_3_1.out | 189 ++ ...ark_test_accumerror_brusselator_20_5_0.out | 189 ++ .../CXX_serial/ark_test_accumerror_kpr.cpp | 725 +++++ .../ark_test_accumerror_kpr_20_-4_1.out | 330 ++ .../ark_test_accumerror_kpr_20_2_0.out | 190 ++ .../ark_test_accumerror_kpr_20_3_1.out | 190 ++ .../CXX_serial/ark_test_analytic_sys_mri.cpp | 4 +- .../ark_test_brusselator_mriadapt.cpp | 1388 ++++++++ ..._mriadapt_--rtol_0.000004_--scontrol_0.out | 43 + .../CXX_serial/ark_test_dahlquist_mri.cpp | 75 +- .../CXX_serial/ark_test_dahlquist_mri_-1.out | 534 +++- .../CXX_serial/ark_test_dahlquist_mri_0.out | 534 +++- .../CXX_serial/ark_test_dahlquist_mri_1.out | 534 +++- .../arkode/CXX_serial/ark_test_getjac_mri.cpp | 4 +- .../CXX_serial/ark_test_kpr_mriadapt.cpp | 1442 +++++++++ ...-hs_0.002_--rtol_0.000004_--scontrol_0.out | 45 + .../ark_test_slowerror_brusselator.cpp | 623 ++++ .../ark_test_slowerror_brusselator.out | 114 + .../CXX_serial/ark_test_slowerror_kpr.cpp | 576 ++++ .../CXX_serial/ark_test_slowerror_kpr.out | 113 + .../ark_test_slowerror_polynomial.cpp | 414 +++ .../ark_test_slowerror_polynomial.out | 9 + .../arkode/C_serial/ark_test_getuserdata.c | 4 +- .../arkode/C_serial/ark_test_reset.c | 33 +- test/unit_tests/utilities/test_utilities.hpp | 110 + 168 files changed, 24685 insertions(+), 4211 deletions(-) create mode 100644 doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst create mode 100644 examples/arkode/CXX_serial/ark_kpr_nestedmri.cpp create mode 100644 examples/arkode/CXX_serial/ark_kpr_nestedmri.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_0_0.002.out rename examples/arkode/C_serial/{ark_kpr_mri_2_0.005.out => ark_kpr_mri_0_1_0.005.out} (97%) create mode 100644 examples/arkode/C_serial/ark_kpr_mri_10_4_0.001_-100_100_0.5_1.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_11_2_0.001.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_12_3_0.005.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_13_4_0.01.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_1_0.002.out rename examples/arkode/C_serial/{ark_kpr_mri_3_0.01.out => ark_kpr_mri_1_0_0.01.out} (97%) create mode 100644 examples/arkode/C_serial/ark_kpr_mri_1_1_0.002.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_2_4_0.002.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_3_2_0.001.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_4_0.002.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_4_3_0.001.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_5_0.002.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_5_4_0.001.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_6_0.005.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_6_5_0.001.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_7_0.001.out create mode 100644 examples/arkode/C_serial/ark_kpr_mri_7_2_0.002.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_8_0.001.out rename examples/arkode/C_serial/{ark_kpr_mri_7_0.001_-100_100_0.5_1.out => ark_kpr_mri_8_3_0.001_-100_100_0.5_1.out} (93%) delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_9_0.001.out delete mode 100644 examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out rename examples/arkode/C_serial/{ark_kpr_mri_8_0.001_-100_100_0.5_1.out => ark_kpr_mri_9_3_0.001_-100_100_0.5_1.out} (95%) create mode 100644 include/sunadaptcontroller/sunadaptcontroller_mrihtol.h create mode 100644 src/arkode/arkode_mristep_controller.c create mode 100644 src/sunadaptcontroller/mrihtol/CMakeLists.txt create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int32/CMakeLists.txt create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.c create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int64/CMakeLists.txt create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.c create mode 100644 src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 create mode 100644 src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c create mode 100644 swig/sunadaptcontroller/fsunadaptcontroller_mrihtol_mod.i create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_-4_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_3_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_5_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_-4_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_2_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_3_1.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt_--rtol_0.000004_--scontrol_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt_--hs_0.002_--rtol_0.000004_--scontrol_0.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.out create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.out create mode 100644 test/unit_tests/utilities/test_utilities.hpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 6aba1c0f50..aa56fad501 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,21 @@ The build system has been updated to utilize the CMake LAPACK imported target which should ease building SUNDIALS with LAPACK libraries that require setting specific linker flags e.g., MKL. +Added support for multirate time step adaptivity controllers, based on the +recently introduced `SUNAdaptController` base class, to ARKODE's MRIStep module. +As a part of this, we added embeddings for existing MRI-GARK methods, as well as +support for embedded MERK and IMEX-MRI-SR methods. Added new default MRI methods +for temporally adaptive versus fixed-step runs. Added the function +`MRIStepGetNumInnerStepperFails` to retrieve the number of recoverable +failures reported by the MRIStepInnerStepper. + +Added functionality to ARKODE to accumulate a temporal error +estimate over multiple time steps. See the routines `ARKodeSetAccumulatedErrorType`, +`ARKodeResetAccumulatedError`, and `ARKodeGetAccumulatedError` for details. + +Added a utility routine to wrap any valid ARKODE integrator for use as an MRIStep +inner stepper object, `ARKodeCreateMRIStepInnerStepper`. + ### Bug Fixes Fixed a [bug](https://github.com/LLNL/sundials/issues/581) in the sparse matrix @@ -62,6 +77,15 @@ repeatedly. Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. +Fixed loading the default IMEX-MRI method if `ARKodeSetOrder` is used to specify +a third or fourth order method. Previously, the default second order method +was loaded in both cases. + +Fixed a bug in MRIStep where the data supplied to the Hermite interpolation module did +not include contributions from the fast right-hand side function. With this fix, users +will see one additional fast right-hand side function evaluation per slow step with the +Hermite interpolation option. + Fixed a CMake configuration issue related to aliasing an `ALIAS` target when using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. @@ -71,6 +95,10 @@ See details in GitHub Issue [#538](https://github.com/LLNL/sundials/issues/538). ### Deprecation Notices +Deprecated the ARKStep-specific utility routine for wrapping an ARKStep instance +as an MRIStep inner stepper object, `ARKStepCreateMRIStepInnerStepper`. Use +`ARKodeCreateMRIStepInnerStepper` instead. + The ARKODE stepper specific functions to retrieve the number of right-hand side function evaluations have been deprecated. Use `ARKodeGetNumRhsEvals` instead. diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index fc300c802a..46f4e143b6 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -64,7 +64,7 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | | | +-----------------------------------------------+------------------------------------------------------------+ - | **Relaxtion module input constants** | | + | **Relaxation module input constants** | | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARK_RELAX_BRENT` | Specifies Brent's method as the relaxation nonlinear | | | solver. | @@ -350,13 +350,13 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_FORWARD_EULER` | Use the forward Euler MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`ARKODE_MRI_GARK_ERK22b` | Use the ERK22b MRI-GARK method. | - +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ERK22a` | Use the ERK22a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MRI_GARK_ERK22b` | Use the ERK22b MRI-GARK method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_RALSTON2` | Use the second order Ralston MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`ARKODE_MIS_MW3` | Use the Knoth-Wolke-3 MIS method. | + | :index:`ARKODE_MIS_KW3` | Use the Knoth-Wolke-3 MIS method (non-embedded). | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ERK33a` | Use the ERK33a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ @@ -364,6 +364,14 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_ERK45a` | Use the ERK45a MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MERK21` | Use the MERK21 method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MERK32` | Use the MERK32 method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MERK43` | Use the MERK43 method. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_MERK54` | Use the MERK54 method. | + +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_BACKWARD_EULER` | Use the backward Euler MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_MRI_GARK_IRK21a` | Use the IRK21a MRI-GARK method. | @@ -380,47 +388,74 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | :index:`ARKODE_IMEX_MRI_GARK_MIDPOINT` | Use the midpoint rule IMEX-MRI-GARK method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`ARKODE_IMEX_MRI_GARK3a` | Use the IMEX-MRI-GARK3a method. | + | :index:`ARKODE_IMEX_MRI_GARK3a` | Use the IMEX-MRI-GARK3a method (non-embedded). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_IMEX_MRI_GARK3b` | Use the IMEX-MRI-GARK3b method (non-embedded). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`ARKODE_IMEX_MRI_GARK3b` | Use the IMEX-MRI-GARK3b method. | + | :index:`ARKODE_IMEX_MRI_GARK4` | Use the IMEX-MRI-GARK4 method (non-embedded). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`ARKODE_IMEX_MRI_GARK4` | Use the IMEX-MRI-GARK4 method. | + | :index:`ARKODE_IMEX_MRI_SR21` | Use the IMEX-MRI-SR21 method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_EXPL_TABLE_1` | Use MRIStep's default 1st-order explicit method | - | | (MRI_GARK_FORWARD_EULER). | + | :index:`ARKODE_IMEX_MRI_SR32` | Use the IMEX-MRI-SR32 method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_EXPL_TABLE_2` | Use MRIStep's default 2nd-order explicit method | - | | (MRI_GARK_ERK22b). | + | :index:`ARKODE_IMEX_MRI_SR43` | Use the IMEX-MRI-SR43 method. | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_EXPL_TABLE_3` | Use MRIStep's default 3rd-order explicit method | - | | (MIS_MW3). | + | :index:`MRISTEP_DEFAULT_EXPL_1` | Use MRIStep's default 1st-order explicit method | + | | (ARKODE_MRI_GARK_FORWARD_EULER). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_EXPL_TABLE_4` | Use MRIStep's default 4th-order explicit method | - | | (MRI_GARK_ERK45a). | + | :index:`MRISTEP_DEFAULT_EXPL_2` | Use MRIStep's default 2nd-order explicit method | + | | (ARKODE_MRI_GARK_ERK22b). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_1` | Use MRIStep's default 1st-order solve-decoupled implicit | - | | method (MRI_GARK_BACKWARD_EULER). | + | :index:`MRISTEP_DEFAULT_EXPL_3` | Use MRIStep's default 3rd-order explicit method | + | | (ARKODE_MIS_KW3). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_2` | Use MRIStep's default 2nd-order solve-decoupled implicit | - | | method (MRI_GARK_IRK21a). | + | :index:`MRISTEP_DEFAULT_EXPL_4` | Use MRIStep's default 4th-order explicit method | + | | (ARKODE_MRI_GARK_ERK45a). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_3` | Use MRIStep's default 3rd-order solve-decoupled implicit | - | | method (MRI_GARK_ESDIRK34a). | + | :index:`MRISTEP_DEFAULT_EXPL_2_AD` | Use MRIStep's default 2nd-order adaptive explicit method | + | | (ARKODE_MRI_GARK_ERK22a). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMPL_SD_TABLE_4` | Use MRIStep's default 4th-order solve-decoupled implicit | - | | method (MRI_GARK_ESDIRK46a). | + | :index:`MRISTEP_DEFAULT_EXPL_3_AD` | Use MRIStep's default 3rd-order adaptive explicit method | + | | (ARKODE_MRI_GARK_ERK33a). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_1` | Use MRIStep's default 1st-order solve-decoupled ImEx | - | | method (IMEX_MRI_GARK_EULER). | + | :index:`MRISTEP_DEFAULT_EXPL_4_AD` | Use MRIStep's default 4th-order adaptive explicit method | + | | (ARKODE_MRI_GARK_ERK45a). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_2` | Use MRIStep's default 2nd-order solve-decoupled ImEx | + | :index:`MRISTEP_DEFAULT_EXPL_5_AD` | Use MRIStep's default 5th-order adaptive explicit method | + | | (ARKODE_MERK54). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMPL_SD_1` | Use MRIStep's default 1st-order solve-decoupled implicit | + | | method (ARKODE_MRI_GARK_BACKWARD_EULER). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMPL_SD_2` | Use MRIStep's default 2nd-order solve-decoupled implicit | + | | method (ARKODE_MRI_GARK_IRK21a). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMPL_SD_3` | Use MRIStep's default 3rd-order solve-decoupled implicit | + | | method (ARKODE_MRI_GARK_ESDIRK34a). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMPL_SD_4` | Use MRIStep's default 4th-order solve-decoupled implicit | + | | method (ARKODE_MRI_GARK_ESDIRK46a). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_1` | Use MRIStep's default 1st-order solve-decoupled ImEx | + | | method (ARKODE_IMEX_MRI_GARK_EULER). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_2` | Use MRIStep's default 2nd-order solve-decoupled ImEx | | | method (ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_3` | Use MRIStep's default 3rd-order solve-decoupled ImEx | - | | method (IMEX_MRI_GARK3b). | + | :index:`MRISTEP_DEFAULT_IMEX_SD_3` | Use MRIStep's default 3rd-order solve-decoupled ImEx | + | | method (ARKODE_IMEX_MRI_GARK3b). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_4` | Use MRIStep's default 4th-order solve-decoupled ImEx | + | | method (ARKODE_IMEX_MRI_GARK4). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_2_AD` | Use MRIStep's default 2nd-order solve-decoupled adaptive | + | | ImEx method (ARKODE_IMEX_MRI_SR21). | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`MRISTEP_DEFAULT_IMEX_SD_3_AD` | Use MRIStep's default 3rd-order solve-decoupled adaptive | + | | ImEx method (ARKODE_IMEX_MRI_SR32). | +-----------------------------------------------+------------------------------------------------------------+ - | :index:`MRISTEP_DEFAULT_IMEX_SD_TABLE_4` | Use MRIStep's default 4th-order solve-decoupled ImEx | - | | method (IMEX_MRI_GARK4). | + | :index:`MRISTEP_DEFAULT_IMEX_SD_4_AD` | Use MRIStep's default 4th-order solve-decoupled adaptive | + | | ImEx method (ARKODE_IMEX_MRI_SR43). | +-----------------------------------------------+------------------------------------------------------------+ diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index 10a053b879..d550d65635 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -606,129 +606,231 @@ an identity mass matrix, :math:`M(t)=I`. The slow time scale may consist of only nonstiff terms (:math:`f^I \equiv 0`), only stiff terms (:math:`f^E \equiv 0`), or both nonstiff and stiff terms. -For cases with only a single slow right-hand side function (i.e., -:math:`f^E \equiv 0` or :math:`f^I \equiv 0`), MRIStep provides fixed-slow-step -multirate infinitesimal step (MIS) :cite:p:`Schlegel:09, Schlegel:12a, -Schlegel:12b` and multirate infinitesimal GARK (MRI-GARK) :cite:p:`Sandu:19` -methods. For problems with an additively split slow right-hand side MRIStep -provides fixed-slow-step implicit-explicit MRI-GARK (IMEX-MRI-GARK) -:cite:p:`ChiRen:21` methods. The slow (outer) method derives from an :math:`s` -stage Runge--Kutta method for MIS and MRI-GARK methods or an additive Runge--Kutta -method for IMEX-MRI-GARK methods. In either case, the stage values and the new -solution are computed by solving an auxiliary ODE with a fast (inner) time -integration method. This corresponds to the following algorithm for a single -step: +For cases with only a single slow right-hand side function (i.e., :math:`f^E +\equiv 0` or :math:`f^I \equiv 0`), MRIStep provides multirate infinitesimal +step (MIS) :cite:p:`Schlegel:09, Schlegel:12a, Schlegel:12b`, first through +fourth order multirate infinitesimal GARK (MRI-GARK) :cite:p:`Sandu:19`, and +second through fifth order multirate exponential Runge--Kutta (MERK) +:cite:p:`Luan:20` methods. For problems with an additively split slow right-hand +side, MRIStep provides first through fourth order implicit-explicit MRI-GARK +(IMEX-MRI-GARK) :cite:p:`ChiRen:21` and second through fourth order +implicit-explicit multirate infinitesimal stage-restart (IMEX-MRI-SR) +:cite:p:`Fish:24` methods. For a complete list of the methods available in +MRIStep see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables`. Additionally, +users may supply their own method by defining and attaching a coupling table, +see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling` for more information. + +Generally, the slow (outer) method for each family derives from a single-rate +method: MIS and MRI-GARK methods derive from explicit or +diagonally-implicit Runge--Kutta methods, MERK methods derive from exponential +Runge--Kutta methods, while IMEX-MRI-GARK and IMEX-MRI-SR methods derive from +additive Runge--Kutta methods. In each case, the "infinitesimal" nature of the +multirate methods derives from the fact that slow stages are computed by solving +a set of auxiliary ODEs with a fast (inner) time integration method. Generally +speaking, an :math:`s`-stage method from of each family adheres to the following +algorithm for a single step: #. Set :math:`z_1 = y_{n-1}`. -#. For :math:`i = 2,\ldots,s+1` do: +#. For :math:`i = 2,\ldots,s`, compute the stage solutions, :math:`z_i`, by + evolving the fast IVP - #. Let :math:`t_{n,i-1}^S = t_{n-1} + c_{i-1}^S h^S` and - :math:`v(t_{n,i-1}^S) = z_{i-1}`. + .. math:: + {v}_i'(t) = f^F(t, v_i) + r_i(t) \quad\text{for}\quad t \in [t_{0,i},t_{F,i}] \quad\text{with}\quad v_i(t_{0,i}) = v_{0,i} + :label: MRI_fast_IVP - #. Let :math:`r_i(t) = - \frac{1}{\Delta c_i^S} - \sum\limits_{j=1}^{i-1} \omega_{i,j}(\tau) f^E(t_{n,j}^I, z_j) + - \frac{1}{\Delta c_i^S} - \sum\limits_{j=1}^i \gamma_{i,j}(\tau) f^I(t_{n,j}^I, z_j)` - where :math:`\Delta c_i^S=\left(c^S_i - c^S_{i-1}\right)` and the - normalized time is :math:`\tau = (t - t_{n,i-1}^S)/(h^S \Delta c_i^S)`. + and setting :math:`z_i = v(t_{F,i})`, and/or performing a standard explicit, + diagonally-implicit, or additive Runge--Kutta stage update, - #. For :math:`t \in [t_{n,i-1}^S, t_{n,i}^S]` solve - :math:`\dot{v}(t) = f^F(t, v) + r_i(t)`. + .. math:: + z_i - \theta_{i,i} h^S f^I(t_{n,i}^S, z_i) = a_i. + :label: MRI_implicit_solve - #. Set :math:`z_i = v(t_{n,i}^S)`. + where :math:`t_{n,j}^S = t_{n-1} + h^S c^S_j`. -#. Set :math:`y_{n} = z_{s+1}`. +#. Set :math:`y_{n} = z_{s}`. -The fast (inner) IVP solve can be carried out using either the ARKStep module -(allowing for explicit, implicit, or ImEx treatments of the fast time scale with -fixed or adaptive steps), or a user-defined integration method (see section +#. If the method has an embedding, compute the embedded solution, + :math:`\tilde{y}`, by evolving the fast IVP + + .. math:: + \tilde{v}'(t) = f^F(t, \tilde{v}) + \tilde{r}(t) \quad\text{for}\quad t \in [\tilde{t}_{0},\tilde{t}_{F}] \quad\text{with}\quad \tilde{v}(\tilde{t}_{0}) = \tilde{v}_{0} + :label: MRI_embedding_fast_IVP + + and setting :math:`\tilde{y}_{n} = \tilde{v}(\tilde{t}_{F})`, and/or + performing a standard explicit, diagonally-implicit, or additive Runge--Kutta + stage update, + + .. math:: + \tilde{y}_n - \tilde{\theta} h^S f^I(t_n, \tilde{y}_n) = \tilde{a}. + :label: MRI_embedding_implicit_solve + +Whether a fast IVP evolution or a stage update (or both) is needed depends on +the method family (MRI-GARK, MERK, etc.). The specific aspects of the fast IVP +forcing function (:math:`r_i(t)` or :math:`\tilde{r}(t)`), the interval over +which the IVP must be evolved (:math:`[t_{0,i},t_{F,i}])`, the Runge--Kutta +coefficients (:math:`\theta_{i,i}` and :math:`\tilde{\theta}`), and the +Runge--Kutta data (:math:`a_i` and :math:`\tilde{a}`), are also determined by +the method family. Generally, the forcing functions and data, are constructed +using evaluations of the slow RHS functions, :math:`f^E` and :math:`f^I`, at +preceding stages, :math:`z_j`. The fast IVP solves can be carried out using any +valid ARKODE integrator or a user-defined integration method (see section :numref:`ARKODE.Usage.MRIStep.CustomInnerStepper`). -The final abscissa is :math:`c^S_{s+1}=1` and the coefficients -:math:`\omega_{i,j}` and :math:`\gamma_{i,j}` are polynomials in time that -dictate the couplings from the slow to the fast time scale; these can be -expressed as in :cite:p:`ChiRen:21` and :cite:p:`Sandu:19` as +Below we summarize the details for each method family. For additional +information, please see the references listed above. -.. math:: - \omega_{i,j}(\tau) = \sum_{k\geq 0} \omega_{i,j}^{\{k\}} \tau^k - \quad\text{and}\quad - \gamma_{i,j}(\tau) = \sum_{k\geq 0} \gamma_{i,j}^{\{k\}} \tau^k, - :label: ARKODE_MRI_coupling -and where the tables :math:`\Omega^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}` and -:math:`\Gamma^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}` define the slow-to-fast -coupling for the explicit and implicit components respectively. +MIS, MRI-GARK, and IMEX-MRI-GARK Methods +---------------------------------------- -For traditional MIS methods, the coupling coefficients are uniquely defined -based on a slow Butcher table :math:`(A^S,b^S,c^S)` having an explicit first -stage (i.e., :math:`c^S_1=0` and :math:`A^S_{1,j}=0` for :math:`1\le j\le s`), -sorted abscissae (i.e., :math:`c^S_{i} \ge c^S_{i-1}` for :math:`2\le i\le s`), -and the final abscissa is :math:`c^S_s \leq 1`. With these properties met, the -coupling coefficients for an explicit-slow method are given as +The methods in IMEX-MRI-GARK family, which includes MIS and MRI-GARK methods, +are defined by a vector of slow stage time abscissae, :math:`c^S \in +\mathbb{R}^{s}`, and a set of coupling tensors, +:math:`\Omega\in\mathbb{R}^{(s+1)\times s \times k}` and +:math:`\Gamma\in\mathbb{R}^{(s+1)\times s \times k}`, that specify the +slow-to-fast coupling for the explicit and implicit components, respectively. + +The fast stage IVPs, :eq:`MRI_fast_IVP`, are evolved over non-overlapping +intervals :math:`[t_{0,i},t_{F,i}] = [t_{n,i-1}^S, t_{n,i}^S]` with +the initial condition :math:`v_{0,i}=z_{i-1}`. The fast IVP forcing function is +given by .. math:: - \omega_{i,j}^{\{0\}} = \begin{cases} - 0, & \text{if}\; i=1,\\ - A^S_{i,j} - A^S_{i-1,j}, & \text{if}\; 2\le i\le s,\\ - b^S_j - A^S_{s,j}, & \text{if}\; i=s+1. - \end{cases} - :label: ARKODE_MIS_to_MRI + r_i(t) = \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^{i-1} \omega_{i,j}(\tau) f^E(t_{n,j}^S, z_j) + + \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^i \gamma_{i,j}(\tau) f^I(t_{n,j}^S, z_j) -For general slow tables :math:`(A^S,b^S,c^S)` with at least second-order -accuracy, the corresponding MIS method will be second order. However, if this -slow table is at least third order and satisfies the additional condition +where :math:`\Delta c_i^S=\left(c^S_i - c^S_{i-1}\right)`, :math:`\tau = (t - +t_{n,i-1}^S)/(h^S \Delta c_i^S)` is the normalized time, the coefficients +:math:`\omega_{i,j}` and :math:`\gamma_{i,j}` are polynomials in time of degree +:math:`k-1` given by .. math:: - \sum_{i=2}^{s} \left(c_i^S-c_{i-1}^S\right) - \left(\mathbf{e}_i+\mathbf{e}_{i-1}\right)^T A^S c^S - + \left(1-c_{s}^S\right) \left( \frac12+\mathbf{e}_{s}^T A^S c^S \right) - = \frac13, - :label: ARKODE_MIS_order3 - -where :math:`\mathbf{e}_j` corresponds to the :math:`j`-th column from the -:math:`s \times s` identity matrix, then the overall MIS method will be third -order. + \omega_{i,j}(\tau) = \sum_{\ell = 1}^{k} \Omega_{i,j,\ell} \, \tau^{\ell-1} + \quad\text{and}\quad + \gamma_{i,j}(\tau) = \sum_{\ell = 1}^{k} \Gamma_{i,j,\ell} \, \tau^{\ell-1}. + :label: ARKODE_MRI_coupling -In the above algorithm, when the slow (outer) method has repeated abscissa, i.e. -:math:`\Delta c_i^S = 0` for stage :math:`i`, the fast (inner) IVP can be -rescaled and integrated analytically. In this case the stage is computed as +When the slow abscissa are repeated, i.e. :math:`\Delta c_i^S = 0`, the fast IVP +can be rescaled and integrated analytically leading to the Runge--Kutta update +:eq:`MRI_implicit_solve` instead of the fast IVP evolution. In this case the +stage is computed as .. math:: z_i = z_{i-1} - + h^S \sum_{j=1}^{i-1} \left(\sum_{k\geq 0} - \frac{\omega_{i,j}^{\{k\}}}{k+1}\right) f^E(t_{n,j}^S, z_j) - + h^S \sum_{j=1}^i \left(\sum_{k\geq 0} - \frac{\gamma_{i,j}^{\{k\}}}{k+1}\right) f^I(t_{n,j}^S, z_j), + + h^S \sum_{j=1}^{i-1} \left(\sum_{\ell = 1}^{k} + \frac{\Omega_{i,j,\ell}}{\ell}\right) f^E(t_{n,j}^S, z_j) + + h^S \sum_{j=1}^i \left(\sum_{\ell = 1}^{k} + \frac{\Gamma_{i,j,\ell}}{\ell}\right) f^I(t_{n,j}^S, z_j). :label: ARKODE_MRI_delta_c_zero -which corresponds to a standard ARK, DIRK, or ERK stage computation depending on -whether the summations over :math:`k` are zero or nonzero. +Similarly, the embedded solution IVP, :eq:`MRI_embedding_fast_IVP`, is evolved +over the interval :math:`[\tilde{t}_{0},\tilde{t}_{F}] = [t_{n,s-1}^S, t_{n}]` +with the initial condition :math:`\tilde{v}_0=z_{s-1}`. As with standard ARK and DIRK methods, implicitness at the slow time scale is -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 +characterized by nonzero values on or above the diagonal of the :math:`k` +matrices in :math:`\Gamma`. Typically, MRI-GARK and IMEX-MRI-GARK methods are at +most diagonally-implicit (i.e., :math:`\Gamma_{i,j,\ell}=0` for all :math:`\ell` and :math:`j>i`). Furthermore, diagonally-implicit stages are characterized as being -"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, +"solve-decoupled" if :math:`\Delta c_i^S = 0` when :math:`\Gamma_{i,i,\ell} \ne 0`, +in which case the stage is computed as a 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 -case the stage solution :math:`z_i` is *both* an input to :math:`r(t)` and the +:math:`\Delta c^S_i \, \Gamma_{i,j,\ell} \ne 0`, in which +case the stage solution :math:`z_i` is *both* an input to :math:`r_i(t)` and the result of time-evolution of the fast IVP, necessitating an implicit solve that -is coupled to the fast (inner) solver. At present, only "solve-decoupled" +is coupled to the fast evolution. At present, only "solve-decoupled" diagonally-implicit MRI-GARK and IMEX-MRI-GARK methods are supported. -For problems with only a slow-nonstiff term (:math:`f^I \equiv 0`), MRIStep -provides third and fourth order explicit MRI-GARK methods. In cases with only a -slow-stiff term (:math:`f^E \equiv 0`), MRIStep supplies second, third, and -fourth order implicit solve-decoupled MRI-GARK methods. For applications -with both stiff and nonstiff slow terms, MRIStep implements third and fourth -order IMEX-MRI-GARK methods. For a complete list of the methods available in -MRIStep see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables`. Additionally, users -may supply their own method by defining and attaching a coupling table, see -:numref:`ARKODE.Usage.MRIStep.MRIStepCoupling` for more information. + +IMEX-MRI-SR Methods +------------------- + +The IMEX-MRI-SR family of methods perform *both* the fast IVP evolution, +:eq:`MRI_fast_IVP` or :eq:`MRI_embedding_fast_IVP`, *and* stage update, +:eq:`MRI_implicit_solve` or :eq:`MRI_embedding_implicit_solve`, in every stage +(but these methods typically have far fewer stages than implicit MRI-GARK or +IMEX-MRI-GARK methods). These methods are defined by a vector of slow stage +time abscissae :math:`c^S \in \mathbb{R}^{s}`, a set of coupling tensors +:math:`\Omega\in\mathbb{R}^{(s+1)\times s\times k}`, and a Butcher table of +slow-implicit coefficients, :math:`\Gamma\in\mathbb{R}^{(s+1) \times s}`. + +The fast stage IVPs, :eq:`MRI_fast_IVP`, are evolved on overlapping +intervals :math:`[t_{0,i},t_{F,i}] = [t_{n-1}, t_{n,i}^S]` with +the initial condition :math:`v_{0,i}=y_{n-1}`. The fast IVP forcing function is +given by + +.. math:: + r_i(t) = \frac{1}{c_i^S} \sum\limits_{j=1}^{i-1} \omega_{i,j}(\tau) \left( f^E(t_{n,j}^S, z_j) + f^I(t_{n,j}^S, z_j)\right), + :label: IMEXMRISR_forcing + +where :math:`\tau = (t - t_n)/(h^S c_i^S)` is the normalized time, and the coefficients +:math:`\omega_{i,j}` are polynomials in time of degree :math:`k-1` that are also given by +:eq:`ARKODE_MRI_coupling`. The solution of these fast IVPs defines an intermediate stage +solution, :math:`\tilde{z}_i`. + +The implicit solve that follows each fast IVP must solve the algebraic equation for :math:`z_i` + +.. math:: + z_i = \tilde{z}_i + h^S \sum_{j=1}^{i} \gamma_{i,j} f^I(t_{n,j}^S, z_j). + :label: ARKODE_MRISR_implicit + +We note that IMEX-MRI-SR methods are solve-decoupled by construction, and thus the structure +of a given stage never needs to be deduced based on :math:`\Delta c_i^S`. However, ARKODE +still checks the value of :math:`\gamma_{i,i}`, since if it zero then the stage update +equation :eq:`ARKODE_MRISR_implicit` simplifies to a simple explicit Runge--Kutta-like stage +update. + +The overall time step solution is given by the final internal stage solution, +i.e., :math:`y_{n} = z_{s}`. The embedded solution is computing using the above +algorithm for stage index :math:`s+1`, under the definition that :math:`c_{s+1}^S=1` +(and thus the fast IVP portion is evolved over the full time step, +:math:`[\tilde{t}_{0}, \tilde{t}_{F}] = [t_{n-1}, t_{n}]`). + + + +MERK Methods +------------ + +The MERK family of methods are only defined for multirate applications that +are explicit at the slow time scale, i.e., :math:`f^I=0`, but otherwise they are +nearly identical to IMEX-MRI-SR methods. Specifically, like IMEX-MRI-SR methods, +these evolve the fast IVPs +:eq:`MRI_fast_IVP` and :eq:`MRI_embedding_fast_IVP` over the intervals +:math:`[t_{0,i},t_{F,i}] = [t_{n-1}, t_{n,i}^S]` and +:math:`[\tilde{t}_{0}, \tilde{t}_{F}] = [t_{n-1}, t_{n}]`, respectively, and begin +with the initial condition :math:`v_{0,i}=y_{n-1}`. Furthermore, the fast IVP +forcing functions are given by :eq:`IMEXMRISR_forcing` with :math:`f^I=0`. +As MERK-based applications lack the implicit slow operator, they do not require +the solution of implicit algebraic equations. + +However, unlike other MRI families, MERK methods were designed to admit a useful +efficiency improvement. Since each fast IVP begins with the same initial condition, +:math:`v_{0,i}=y_{n-1}`, if multiple stages share the same forcing function +:math:`r_i(t)`, then they may be "grouped" together. This is achieved by sorting the +final IVP solution time for each stage, :math:`t_{n,i}^S`, and then evolving the inner +solver to each of these stage times in order, storing the corresponding inner solver +solutions at these times as the stages :math:`z_i`. For example, the +:index:`ARKODE_MERK54` method involves 11 stages, that may be combined into 5 distinct +groups. The fourth group contains stages 7, 8, 9, and the embedding, corresponding to +the :math:`c_i^S` values :math:`7/10`, :math:`1/2`, :math:`2/3`, and :math:`1`. +Sorting these, a single fast IVP for this group must be evolved over the interval +:math:`[t_{0,i},t_{F,i}] = [t_{n-1}, t_{n}]`, first pausing at :math:`t_{n-1}+\frac12 h^S` +to store :math:`z_8`, then pausing at :math:`t_{n-1}+\frac{2}{3} h^S` to store +:math:`z_9`, then pausing at :math:`t_{n-1}+\frac{7}{10} h^S` to store :math:`z_7`, +and finally finishing the IVP solve to :math:`t_{n-1}+h^S` to obtain :math:`\tilde{y}_n`. + +.. note:: + + Although all MERK methods were derived in :cite:p:`Luan:20` under an assumption that + the fast function :math:`f^F(t,y)` is linear in :math:`y`, in :cite:p:`Fish:24` it + was proven that MERK methods also satisfy all nonlinear order conditions up through + their linear order. The lone exception is :index:`ARKODE_MERK54`, where it was only + proven to satisfy all nonlinear conditions up to order 4 (since :cite:p:`Fish:24` did + not establish the formulas for the order 5 conditions). All our numerical tests to + date have shown :index:`ARKODE_MERK54` to achieve fifth order for nonlinear problems, + and so we conjecture that it also satisfies the nonlinear fifth order conditions. + .. _ARKODE.Mathematics.LSRK: @@ -737,11 +839,11 @@ LSRKStep -- Low-Storage Runge--Kutta methods ============================================ The LSRKStep time-stepping module in ARKODE supports a variety of so-called -"low-storage" Runge--Kutta (LSRK) methods, :cite:p:`VSH:04, MBA:14, K:08, FCS:22`. This category includes traditional explicit -fixed-step and low-storage Runge--Kutta methods, adaptive +"low-storage" Runge--Kutta (LSRK) methods, :cite:p:`VSH:04, MBA:14, K:08, FCS:22`. This category includes traditional explicit +fixed-step and low-storage Runge--Kutta methods, adaptive low-storage Runge--Kutta methods, and others. These are characterized by coefficient tables that have an exploitable structure, such that their implementation does not require -that all stages be stored simultaneously. At present, this module supports explicit, +that all stages be stored simultaneously. At present, this module supports explicit, adaptive "super-time-stepping" (STS) and "strong-stability-preserving" (SSP) methods. The LSRK time-stepping module in ARKODE currently supports IVP @@ -750,7 +852,7 @@ requires that problems have an identity mass matrix (i.e., :math:`M(t)=I`) and that the right-hand side function is not split into separate components. -LSRKStep currently supports two families of second-order, explicit, and temporally adaptive STS methods: +LSRKStep currently supports two families of second-order, explicit, and temporally adaptive STS methods: Runge--Kutta--Chebyshev (RKC), :cite:p:`VSH:04` and Runge--Kutta--Legendre (RKL), :cite:p:`MBA:14`. These methods have the form .. math:: @@ -762,15 +864,15 @@ Runge--Kutta--Chebyshev (RKC), :cite:p:`VSH:04` and Runge--Kutta--Legendre (RKL) The corresponding coefficients can be found in :cite:p:`VSH:04` and :cite:p:`MBA:14`, respectively. -LSRK methods of STS type are designed for stiff problems characterized by -having Jacobians with eigenvalues that have large real and small imaginary parts. +LSRK methods of STS type are designed for stiff problems characterized by +having Jacobians with eigenvalues that have large real and small imaginary parts. While those problems are traditionally treated using implicit methods, STS methods -are explicit. To achieve stability for these stiff problems, STS methods use more stages than -conventional Runge-Kutta methods to extend the stability region along the negative -real axis. The extent of this stability region is proportional to the square of the number +are explicit. To achieve stability for these stiff problems, STS methods use more stages than +conventional Runge-Kutta methods to extend the stability region along the negative +real axis. The extent of this stability region is proportional to the square of the number of stages used. -LSRK methods of the SSP type are designed to preserve the so-called "strong-stability" properties of advection-type equations. +LSRK methods of the SSP type are designed to preserve the so-called "strong-stability" properties of advection-type equations. For details, see :cite:p:`K:08`. The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p:`SO:88` of explicit Runge--Kutta methods: @@ -781,9 +883,9 @@ The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p: :label: ARKODE_SSP The coefficients of the Shu--Osher representation are not uniquely determined by the Butcher table :cite:p:`SR:02`. -In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in -:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and -:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The +In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in +:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and +:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The corresponding coefficients and embedding weights can be found in :cite:p:`K:08` and :cite:p:`FCS:22`, respectively. .. _ARKODE.Mathematics.Error.Norm: @@ -847,13 +949,14 @@ time-steppers) is their adaptive control of local truncation error (LTE). At every step, we estimate the local error, and ensure that it satisfies tolerance conditions. If this local error test fails, then the step is recomputed with a reduced step size. To this end, the -Runge--Kutta methods packaged within both the ARKStep and ERKStep -modules admit an embedded solution :math:`\tilde{y}_n`, as shown in -equations :eq:`ARKODE_ARK` and :eq:`ARKODE_ERK`. Generally, these embedded -solutions attain a slightly lower order of accuracy than the computed -solution :math:`y_n`. Denoting the order of accuracy for :math:`y_n` -as :math:`q` and for :math:`\tilde{y}_n` as :math:`p`, most of these -embedded methods satisfy :math:`p = q-1`. These values of :math:`q` +majority of the Runge--Kutta methods and many of the MRI methods in ARKODE +admit an embedded solution :math:`\tilde{y}_n`, as shown in +equations :eq:`ARKODE_ARK`, :eq:`ARKODE_ERK`, and +:eq:`MRI_embedding_fast_IVP`-:eq:`MRI_embedding_implicit_solve`. Generally, +these embedded solutions attain a slightly lower order of accuracy than the +computed solution :math:`y_n`. Denoting the order of accuracy for +:math:`y_n` as :math:`q` and for :math:`\tilde{y}_n` as :math:`p`, most of +these embedded methods satisfy :math:`p = q-1`. These values of :math:`q` and :math:`p` correspond to the *global* orders of accuracy for the method and embedding, hence each admit local truncation errors satisfying :cite:p:`HWN:87` @@ -983,6 +1086,238 @@ support has been deprecated in favor of the SUNAdaptController class, and will be removed in a future release. +.. _ARKODE.Mathematics.MultirateAdaptivity: + +Multirate time step adaptivity (MRIStep) +---------------------------------------- + +Since multirate applications evolve on multiple time scales, +MRIStep supports additional forms of temporal adaptivity. Specifically, +we consider time steps at two adjacent levels, :math:`h^S > h^F`, where +:math:`h^S` is the step size used by MRIStep, and :math:`h^F` is the +step size used to solve the corresponding fast-time-scale IVPs in +MRIStep, :eq:`MRI_fast_IVP` and :eq:`MRI_embedding_fast_IVP`. + + +.. _ARKODE.Mathematics.MultirateControllers: + +Multirate temporal controls +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We consider two categories of temporal controllers that may be used within MRI +methods. The first (and simplest), are "decoupled" controllers, that consist of +two separate single-rate temporal controllers: one that adapts the slow time scale +step size, :math:`h^S`, and the other that adapts the fast time scale step size, +:math:`h^F`. As these ignore any coupling between the two time scales, these +methods should work well for multirate problems where the time scales are somewhat +decoupled, and that errors introduced at one scale do not "pollute" the other. + +The second category of controllers that we provide are :math:`h^S`-:math:`Tol` multirate +controllers. The basic idea is that an adaptive time integration method will +attempt to adapt step sizes to control the *local error* within each step to +achieve a requested tolerance. However, MRI methods must ask an adaptive "inner" +solver to produce the stage solutions :math:`v_i(t_{F,i})` and +:math:`\tilde{v}(\tilde{t}_{F})`, that result from sub-stepping over intervals +:math:`[t_{0,i},t_{F,i}]` or :math:`[\tilde{t}_{0},\tilde{t}_{F}]`, respectively. +Local errors within the inner integrator may accumulate, resulting in an overall +inner solver error :math:`\varepsilon^F_n` that exceeds the requested tolerance. +If that inner solver can produce *both* :math:`v_i(t_{F,i})` and +an estimation of the accumulated error, :math:`\varepsilon^F_{n,approx}`, then the +tolerances provided to that inner solver can be adjusted accordingly to +ensure stage solutions that are within the overall tolerances requested of the outer +MRI method. + +To this end, we assume that the inner solver will provide accumulated errors +over each fast interval having the form + +.. math:: + \varepsilon^F_{n} = c(t_n) h^S_n \left(\text{RTOL}_n^F\right), + :label: fast_error_accumulation_assumption + +where :math:`c(t)` is independent of the tolerance or step size, but may vary in time. +Single-scale adaptive controllers assume that the local error at a step :math:`n` with step +size :math:`h_n` has order :math:`p`, i.e., + +.. math:: + LTE_n = c(t_n) (h_n)^{p+1}, + +to predict candidate values :math:`h_{n+1}`. We may therefore repurpose an existing +single-scale controller to predict candidate values :math:`\text{RTOL}^F_{n+1}` by +supplying an "order" :math:`p=0` and a "control parameter" +:math:`h_n=\left(\text{RTOL}_n^F\right)`. + +Thus to construct an :math:`h^S`-:math:`Tol` controller, we require three separate single-rate +adaptivity controllers: + +* scontrol-H -- this is a single-rate controller that adapts :math:`h^S_n` within the + slow integrator to achieve user-requested solution tolerances. + +* scontrol-Tol -- this is a single-rate controller that adapts :math:`\text{RTOL}^F_n` + using the strategy described above. + +* fcontrol -- this adapts time steps :math:`h^F` within the fast integrator to achieve + the current tolerance, :math:`\text{RTOL}^F_n`. + +We note that both the decoupled and :math:`h^S`-:math:`Tol` controller families may be used in +multirate calculations with an arbitrary number of time scales, since these focus on only +one scale at a time, or on how a given time scale relates to the next-faster scale. + + +.. _ARKODE.Mathematics.MultirateFastError: + +Fast temporal error estimation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +MRI temporal adaptivity requires estimation of the temporal errors that +arise at *both* the slow and fast time scales, which we denote here as +:math:`\varepsilon^S` and :math:`\varepsilon^F`, respectively. While the +slow error may be estimated as :math:`\varepsilon^S = \|y_n - \tilde{y}_n\|`, +non-intrusive approaches for estimating :math:`\varepsilon^F` are more +challenging. ARKODE provides several strategies to help provide this estimate, all +of which assume the fast integrator is temporally adaptive and, at each of its +:math:`m` steps to reach :math:`t_n`, computes an estimate of the local +temporal error, :math:`\varepsilon^F_{n,m}`. In this case, we assume that the +fast integrator was run with the same absolute tolerances as the slow integrator, but +that it may have used a potentially different relative solution tolerance, +:math:`\text{RTOL}^F`. The fast integrator then accumulates these local error +estimates using either a "maximum accumulation" strategy, + +.. math:: + \varepsilon^F_{max} = \text{RTOL}^F \max_{m\in \mathcal{S}} \|\varepsilon^F_{n,m}\|_{WRMS}, + :label: maximum_accumulation + +an "additive accumulation" strategy, + +.. math:: + \varepsilon^F_{sum} = \text{RTOL}^F \sum_{m\in \mathcal{S}} \|\varepsilon^F_{n,m}\|_{WRMS}, + :label: additive_accumulation + +or using an "averaged accumulation" strategy, + +.. math:: + \varepsilon^F_{avg} = \frac{\text{RTOL}^F}{\Delta t_{\mathcal{S}}} \sum_{m\in \mathcal{S}} h_{n,m} \|\varepsilon^F_{n,m}\|_{WRMS}, + :label: average_accumulation + +where :math:`h_{n,m}` is the step size that gave rise to :math:`\varepsilon^F_{n,m}`, +:math:`\Delta t_{\mathcal{S}}` denotes the elapsed time over which :math:`\mathcal{S}` +is taken, and the norms are taken using the tolerance-informed error-weight vector. In +each case, the sum or the maximum is taken over the set of all steps :math:`\mathcal{S}` +since the fast error accumulator has been reset. + + + +.. _ARKODE.Mathematics.InitialStep: + +Initial step size estimation +============================== + +Before time step adaptivity can be accomplished, an initial step must be taken. These +values may always be provided by the user; however, if these are not provided then +ARKODE will estimate a suitable choice. Typically +with adaptive methods, the first step should be chosen conservatively to ensure +that it succeeds both in its internal solver algorithms, and its eventual temporal error +test. However, if this initial step is too conservative then its computational cost will +essentially be wasted. We thus strive to construct a conservative step that will succeed +while also progressing toward the eventual solution. + +Before commenting on the specifics of ARKODE, we first summarize two common +approaches to initial step size selection. To this end, consider a simple +single-time-scale ODE, + +.. math:: + y'(t) = f(t,y), \quad y(t_0) = y_0 + :label: IVP_single + +For this, we may consider two Taylor series expansions of :math:`y(t_0+h)` around the +initial time, + +.. math:: + y(t_0+h) = y_0 + h f(t_0,y_0) + \frac{h^2}{2} \frac{\mathrm d}{\mathrm dt} f(t_0+\tau,y_0+\eta),\\ + :label: TSExp1 + +and + +.. math:: + y(t_0+h) = y_0 + h f(t_0+\tau,y_0+\eta), + :label: TSExp0 + +where :math:`t_0+\tau` is between :math:`t_0` and :math:`t_0+h`, and :math:`y_0+\eta` +is on the line segment connecting :math:`y_0` and :math:`y(t_0+h)`. + +Initial step size estimation based on the first-order Taylor expansion :eq:`TSExp1` +typically attempts to determine a step size such that an explicit Euler method +for :eq:`IVP_single` would be sufficiently accurate, i.e., + +.. math:: + \|y(t_0+h_0) - \left(y_0 + h_0 f(t_0,y_0)\right)\| \approx \left\|\frac{h^2}{2} \frac{\mathrm d}{\mathrm dt} f(t_0,y_0)\right\| < 1, + +where we have assumed that :math:`y(t)` is sufficiently differentiable, and that the +norms include user-specified tolerances such that an error with norm less than one is +deemed "acceptable." Satisfying this inequality with a value of :math:`\frac12` and +solving for :math:`h_0`, we have + +.. math:: + |h_0| = \frac{1}{\left\|\frac{\mathrm d}{\mathrm dt} f(t_0,y_0)\right\|^{1/2}}. + +Finally, by estimating the time derivative with finite-differences, + +.. math:: + \frac{\mathrm d}{\mathrm dt} f(t_0,y_0) \approx \frac{1}{\delta t} \left(f(t_0+\delta t,y_0+\delta t f(t_0,y_0)) - f(t_0,y_0)\right), + +we obtain + +.. math:: + |h_0| = \frac{{\delta t}^{1/2}}{\|f(t_0+\delta t,y_0+\delta t f(t_0,y_0)) - f(t_0,y_0)\|^{1/2}}. + :label: H0_TSExp1 + +Initial step size estimation based on the simpler Taylor expansion :eq:`TSExp0` +instead assumes that the first calculated time step should be "close" to the +initial state, + +.. math:: + \|y(t_0+h_0) - y_0 \| \approx \left\|h_0 f(t_0,y_0)\right\| < 1, + +where we again satisfy the inequality with a value of :math:`\frac12` to obtain + +.. math:: + |h_0| = \frac{1}{2\left\| f(t_0,y_0)\right\|}. + :label: H0_TSExp0 + + + +Comparing the two estimates :eq:`H0_TSExp1` and :eq:`H0_TSExp0`, we see that the +former has double the number of :math:`f` evaluations, but that it has a less +conservative estimate of :math:`h_0`, particularly since we expect any valid +time integration method to have at least :math:`\mathcal{O}(h)` accuracy. + +Of these two approaches, for calculations at a single time scale (e.g., using ARKStep), +formula :eq:`H0_TSExp1` is used, due to its more aggressive estimate for :math:`h_0`. + + +.. _ARKODE.Mathematics.MultirateInitialSteps: + +Initial multirate step sizes +------------------------------ + +In MRI methods, initial time step selection is complicated by the fact that not only must +an initial slow step size, :math:`h_0^S`, be chosen, but a smaller initial step, +:math:`h_0^F`, must also be selected. Additionally, it is typically assumed that within +MRI methods, evaluation of :math:`f^S` is significantly more costly than evaluation of +:math:`f^F`, and thus we wish to construct these initial steps accordingly. + +Under an assumption that conservative steps will be selected for both time scales, +the error arising from temporal coupling between the slow and fast methods may be +negligible. Thus, we estimate initial values of :math:`h^S_0` and :math:`h^F_0` +independently. Due to our assumed higher cost of :math:`f^S`, then for the slow +time scale we employ the initial estimate :eq:`H0_TSExp0` for :math:`h^S_0` using +:math:`f = f^S`. Since the function :math:`f^F` is assumed to be cheaper, we +instead apply the estimate :eq:`H0_TSExp1` for :math:`h^F_0` using :math:`f=f^F`, +and enforce an upper bound :math:`|h^F_0| \le \frac{|h^S_0|}{10}`. + +.. note:: + + If the fast integrator does not supply its "full RHS function" :math:`f^F` + for the MRI method to call, then we simply initialize :math:`h^F_0 = \frac{h^S_0}{100}`. @@ -1048,10 +1383,10 @@ Here the explicit stability step factor :math:`c>0` (often called the Fixed time stepping =================== -While both the ARKStep and ERKStep time-stepping modules are +While most of the time-stepping modules are designed for tolerance-based time step adaptivity, they additionally support a "fixed-step" mode. This mode is typically used for debugging -purposes, for verification against hand-coded Runge--Kutta methods, or for +purposes, for verification against hand-coded methods, or for problems where the time steps should be chosen based on other problem-specific information. In this mode, all internal time step adaptivity is disabled: @@ -1068,7 +1403,7 @@ information. In this mode, all internal time step adaptivity is disabled: size by default. .. note:: - Fixed-step mode is currently required for the slow time scale in the MRIStep module. + Any methods that do not provide an embedding are required to be run in fixed-step mode. Additional information on this mode is provided in the section @@ -1104,17 +1439,14 @@ Nonlinear solver methods ------------------------------------ -For the DIRK and ARK methods corresponding to :eq:`ARKODE_IMEX_IVP` and -:eq:`ARKODE_IVP_implicit` in ARKStep, and the solve-decoupled implicit slow -stages :eq:`ARKODE_MRI_delta_c_zero` in MRIStep, an implicit system +Methods with an implicit partition require solving implicit systems of the form .. math:: - G(z_i) = 0 + G(z_i) = 0. :label: ARKODE_Residual -must be solved for each implicit stage :math:`z_i`. In order to -maximize solver efficiency, we define this root-finding problem differently -based on the type of mass-matrix supplied by the user. +In order to maximize solver efficiency, we define this root-finding problem +differently based on the type of mass-matrix supplied by the user. * In the case that :math:`M=I` within ARKStep, we define the residual as @@ -1170,18 +1502,30 @@ based on the type of mass-matrix supplied by the user. As above, this form of the residual is chosen to remove excessive mass-matrix solves from the nonlinear solve process. -* Similarly, in MRIStep (that always assumes :math:`M=I`), we have the residual +* Similarly, in MRIStep (that always assumes :math:`M=I`), MRI-GARK and IMEX-MRI-GARK methods + have the residual .. math:: - G(z_i) \equiv z_i - h^S \left(\sum_{k\geq 0} \frac{\gamma_{i,i}^{\{k\}}}{k+1}\right) + G(z_i) \equiv z_i - h^S \left(\sum_{k\geq 1} \frac{\Gamma_{i,i,k}}{k}\right) f^I(t_{n,i}^S, z_i) - a_i = 0 - :label: ARKODE_MRIStep_Residual + :label: ARKODE_IMEX-MRI-GARK_Residual + + where + + .. math:: + a_i \equiv z_{i-1} + h^S \sum_{j=1}^{i-1} \left(\sum_{k\geq 1} + \frac{\Gamma_{i,j,k}}{k}\right)f^I(t_{n,j}^S, z_j). + + IMEX-MRI-SR methods have the residual + + .. math:: + G(z_i) \equiv z_i - h^S \Gamma_{i,i} f^I(t_{n,i}^S, z_i) - a_i = 0 + :label: ARKODE_IMEX-MRI-SR_Residual where .. math:: - a_i \equiv z_{i-1} + h^S \sum_{j=1}^{i-1} \left(\sum_{k\geq 0} - \frac{\gamma_{i,j}^{\{k\}}}{k+1}\right)f^I(t_{n,j}^S, z_j). + a_i \equiv z_{i-1} + h^S \sum_{j=1}^{i-1} \Gamma_{i,j} f^I(t_{n,j}^S, z_j). Upon solving for :math:`z_i`, method stages must store @@ -1240,7 +1584,7 @@ within ARKStep, or .. math:: {\mathcal A}(t,z) \approx I - \gamma J(t,z), \quad J(t,z) = \frac{\partial f^I(t,z)}{\partial z}, \quad\text{and}\quad - \gamma = h^S \sum_{k\geq 0} \frac{\gamma_{i,i}^{\{k\}}}{k+1} + \gamma = h^S \sum_{k\geq 1} \frac{\Gamma_{i,i,k}}{k} :label: ARKODE_NewtonMatrix_MRIStep within MRIStep. @@ -1335,7 +1679,7 @@ or .. math:: \tilde{\mathcal A}(\tilde{t},\tilde{z}) \approx I - \tilde{\gamma} J(\tilde{t},\tilde{z}), \quad\text{and}\quad - \tilde{\gamma} = \tilde{h} \sum_{k\geq 0} \frac{\gamma_{i,i}^{\{k\}}}{k+1}\quad\text{(MRIStep)}. + \tilde{\gamma} = \tilde{h} \sum_{k\geq 1} \frac{\Gamma_{i,i,k}}{k}\quad\text{(MRIStep)}. :label: ARKODE_modified_NewtonMatrix_MRI Here, the solution :math:`\tilde{z}`, time :math:`\tilde{t}`, and step @@ -1349,7 +1693,7 @@ but may be modified by the user. When using the dense and band SUNMatrix objects for the linear systems :eq:`ARKODE_modified_Newton_system`, the Jacobian :math:`J` may be supplied -by a user routine, or approximated internally by finite-differences. +by a user routine, or approximated internally with finite-differences. In the case of differencing, we use the standard approximation .. math:: diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index ae01be6b25..65cbe33287 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -4404,7 +4404,11 @@ wrap an ARKStep memory block as an :c:type:`MRIStepInnerStepper`. /* create an MRIStep object, setting the slow (outer) right-hand side functions and the initial condition */ - outer_arkode_mem = MRIStepCreate(fse, fsi, t0, y0, stepper, sunctx) + outer_arkode_mem = MRIStepCreate(fse, fsi, t0, y0, stepper, sunctx); **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` + + .. deprecated:: x.y.z + + Use :c:func:`ARKodeCreateMRIStepInnerStepper` instead. diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 865e4c3e25..4d9506ff76 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -33,7 +33,7 @@ ERKStep supports the following categories: * temporal adaptivity * relaxation Runge--Kutta methods -ERKStep does not have forcing function support when converted to a +ERKStep also has forcing function support when converted to a :c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See :c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` for additional details. @@ -1787,9 +1787,9 @@ Main solver optional output functions typedef struct ARKodeButcherTableMem { - int q; /* method order of accuracy */ - int p; /* embedding order of accuracy */ - int stages; /* number of stages */ + int q; /* method order of accuracy */ + int p; /* embedding order of accuracy */ + int stages; /* number of stages */ sunrealtype **A; /* Butcher table coefficients */ sunrealtype *c; /* canopy node coefficients */ sunrealtype *b; /* root node coefficients */ diff --git a/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst index a08e5918b4..0f9d53f581 100644 --- a/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst @@ -31,6 +31,10 @@ LSRKStep supports the following categories: * temporal adaptivity +LSRKStep does not have forcing function support when converted to a +:c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See +:c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` +for additional details. .. _ARKODE.Usage.LSRKStep.Initialization: @@ -85,7 +89,7 @@ Optional input functions .. c:function:: int LSRKStepSetSTSMethod(void* arkode_mem, ARKODE_LSRKMethodType method); - This function selects the LSRK STS method that should be used. The list of allowable + This function selects the LSRK STS method that should be used. The list of allowable values for this input is below. :c:func:`LSRKStepCreateSTS` defaults to using :c:enumerator:`ARKODE_LSRK_RKC_2`. @@ -100,7 +104,7 @@ Optional input functions .. c:function:: int LSRKStepSetSSPMethod(void* arkode_mem, ARKODE_LSRKMethodType method); - This function selects the LSRK SSP method that should be used. The list of allowable + This function selects the LSRK SSP method that should be used. The list of allowable values for this input is below. :c:func:`LSRKStepCreateSSP` defaults to using :c:enumerator:`ARKODE_LSRK_SSP_S_2`. @@ -123,20 +127,20 @@ Allowable Method Families .. c:enumerator:: ARKODE_LSRK_RKL_2 - Second order Runge--Kutta--Legendre method + Second order Runge--Kutta--Legendre method .. c:enumerator:: ARKODE_LSRK_SSP_S_2 - Second order, s-stage SSP(s,2) method + Second order, s-stage SSP(s,2) method .. c:enumerator:: ARKODE_LSRK_SSP_S_3 - Third order, s-stage SSP(s,3) method + Third order, s-stage SSP(s,3) method .. c:enumerator:: ARKODE_LSRK_SSP_10_4 Fourth order, 10-stage SSP(10,4) method - + .. c:function:: int LSRKStepSetSTSMethodByName(void* arkode_mem, const char* emethod); @@ -199,7 +203,7 @@ Allowable Method Families * *ARK_SUCCESS* if successful * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. -.. note:: If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps`` is set to :math:`25` as recommended in :cite:p:`VSH:04`. +.. note:: If LSRKStepSetDomEigFrequency routine is not called, then the default ``nsteps`` is set to :math:`25` as recommended in :cite:p:`VSH:04`. Calling this function with ``nsteps < 0`` resets the default value while ``nsteps = 0`` refers to constant dominant eigenvalue. @@ -217,16 +221,16 @@ Allowable Method Families * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. .. note:: If LSRKStepSetMaxNumStages routine is not called, then the default ``stage_max_limit`` is - set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the default value. - This limit should be chosen with consideration of the following proportionality: :math:`s^2 \sim - h\lambda`, + set to :math:`200`. Calling this function with ``stage_max_limit < 2`` resets the default value. + This limit should be chosen with consideration of the following proportionality: :math:`s^2 \sim - h\lambda`, where :math:`s` is the number of stages used, :math:`h` is the current step size and :math:`\lambda` is the dominant eigenvalue. .. c:function:: int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety); - Specifies a safety factor to use for the result of the dominant eigenvalue estimation function. - This value is used to scale the magnitude of the dominant eigenvalue, in the hope of ensuring - a sufficient number of stages for the method to be stable. This input is only used for RKC + Specifies a safety factor to use for the result of the dominant eigenvalue estimation function. + This value is used to scale the magnitude of the dominant eigenvalue, in the hope of ensuring + a sufficient number of stages for the method to be stable. This input is only used for RKC and RKL methods. **Arguments:** @@ -244,7 +248,7 @@ Allowable Method Families .. c:function:: int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages); Sets the number of stages, ``s`` in ``SSP(s, p)`` methods. This input is only utilized by SSPRK methods. - + * :c:enumerator:`ARKODE_LSRK_SSP_S_2` -- ``num_of_stages`` must be greater than or equal to 2 * :c:enumerator:`ARKODE_LSRK_SSP_S_3` -- ``num_of_stages`` must be a perfect-square greater than or equal to 4 * :c:enumerator:`ARKODE_LSRK_SSP_10_4` -- ``num_of_stages`` cannot be modified from 10, so this function should not be called. @@ -259,8 +263,8 @@ Allowable Method Families * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. SSP method is not declared) .. note:: If LSRKStepSetSSPStageNum routine is not called, then the default ``num_of_stages`` is - set. Calling this function with ``num_of_stages <= 0`` resets the default values: - + set. Calling this function with ``num_of_stages <= 0`` resets the default values: + * ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2` * ``num_of_stages = 9`` for :c:enumerator:`ARKODE_LSRK_SSP_S_3` * ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_10_4` @@ -301,36 +305,36 @@ LSRKStep re-initialization function ------------------------------------- To reinitialize the LSRKStep module for the solution of a new problem, -where a prior call to :c:func:`LSRKStepCreateSTS` or :c:func:`LSRKStepCreateSSP` -has been made, the user must call the function :c:func:`LSRKStepReInitSTS()` -or :c:func:`LSRKStepReInitSSP()`, accordingly. The new problem must have -the same size as the previous one. This routine retains the current settings -for all LSRKstep module options and performs the same input checking and -initializations that are done in :c:func:`LSRKStepCreateSTS` or +where a prior call to :c:func:`LSRKStepCreateSTS` or :c:func:`LSRKStepCreateSSP` +has been made, the user must call the function :c:func:`LSRKStepReInitSTS()` +or :c:func:`LSRKStepReInitSSP()`, accordingly. The new problem must have +the same size as the previous one. This routine retains the current settings +for all LSRKstep module options and performs the same input checking and +initializations that are done in :c:func:`LSRKStepCreateSTS` or :c:func:`LSRKStepCreateSSP`, but it performs no memory allocation as it -assumes that the existing internal memory is sufficient for the new problem. -A call to this re-initialization routine deletes the solution history that -was stored internally during the previous integration, and deletes any -previously-set *tstop* value specified via a call to +assumes that the existing internal memory is sufficient for the new problem. +A call to this re-initialization routine deletes the solution history that +was stored internally during the previous integration, and deletes any +previously-set *tstop* value specified via a call to :c:func:`ARKodeSetStopTime()`. Following a successful call to -:c:func:`LSRKStepReInitSTS()` or :c:func:`LSRKStepReInitSSP()`, +:c:func:`LSRKStepReInitSTS()` or :c:func:`LSRKStepReInitSSP()`, call :c:func:`ARKodeEvolve()` again for the solution of the new problem. -One important use of the :c:func:`LSRKStepReInitSTS()` and -:c:func:`LSRKStepReInitSSP()` function is in the treating of jump -discontinuities in the RHS function. Except in cases of fairly small -jumps, it is usually more efficient to stop at each point of discontinuity -and restart the integrator with a readjusted ODE model, using a call to this -routine. To stop when the location of the discontinuity is known, simply -make that location a value of ``tout``. To stop when the location of -the discontinuity is determined by the solution, use the rootfinding feature. +One important use of the :c:func:`LSRKStepReInitSTS()` and +:c:func:`LSRKStepReInitSSP()` function is in the treating of jump +discontinuities in the RHS function. Except in cases of fairly small +jumps, it is usually more efficient to stop at each point of discontinuity +and restart the integrator with a readjusted ODE model, using a call to this +routine. To stop when the location of the discontinuity is known, simply +make that location a value of ``tout``. To stop when the location of +the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the RHS function *not* incorporate the -discontinuity, but rather have a smooth extension over the discontinuity, -so that the step across it (and subsequent rootfinding, if used) can be done -efficiently. Then use a switch within the RHS function (communicated through -``user_data``) that can be flipped between the stopping of the integration -and the restart, so that the restarted problem uses the new values (which -have jumped). Similar comments apply if there is to be a jump in the +discontinuity, but rather have a smooth extension over the discontinuity, +so that the step across it (and subsequent rootfinding, if used) can be done +efficiently. Then use a switch within the RHS function (communicated through +``user_data``) that can be flipped between the stopping of the integration +and the restart, so that the restarted problem uses the new values (which +have jumped). Similar comments apply if there is to be a jump in the dependent variable vector. diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst index f327d5a76c..9a9590bb9b 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst @@ -19,17 +19,19 @@ The MRIStepInnerStepper Class As with other SUNDIALS classes, the :c:type:`MRIStepInnerStepper` abstract base class is implemented using a C structure containing a ``content`` pointer to the -derived class member data and a structure of function pointers the derived class -implementations of the virtual methods. +derived class member data and a structure of function pointers (vtable) to the +derived class implementations of the base class virtual methods. .. c:type:: MRIStepInnerStepper An object for solving the fast (inner) ODE in an MRI method. - The actual definition of the ``MRIStepInnerStepper`` structure is kept - private to allow for the object internals to change without impacting user - code. The following sections describe the base class methods and the virtual - methods that a must be provided by a derived class. +The actual definitions of the structure and the +corresponding operations structure are kept private to allow for the object +internals to change without impacting user code. The following sections describe +the base (:numref:`ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods`) +and virtual methods (:numref:`ARKODE.Usage.MRIStep.CustomInnerStepper.Description.ImplMethods`) +that a must be provided by a derived class. .. _ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods: @@ -53,13 +55,11 @@ Creating and Destroying an Object This function creates an :c:type:`MRIStepInnerStepper` object to which a user should attach the member data (content) pointer and method function pointers. - **Arguments:** - * ``sunctx`` -- the SUNDIALS simulation context. - * ``stepper`` -- a pointer to an inner stepper object. + :param sunctx: the SUNDIALS simulation context. + :param stepper: a pointer to an inner stepper object. - **Return value:** - * ARK_SUCCESS if successful - * ARK_MEM_FAIL if a memory allocation error occurs + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_FAIL: if a memory allocation error occurs **Example usage:** @@ -109,11 +109,9 @@ Creating and Destroying an Object This function destroys an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- a pointer to an inner stepper object. + :param stepper: a pointer to an inner stepper object. - **Return value:** - * ARK_SUCCESS if successful + :retval ARK_SUCCESS: if successful **Example usage:** @@ -141,13 +139,11 @@ Attaching and Accessing the Content Pointer This function attaches a member data (content) pointer to an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- an inner stepper object. - * *content* -- a pointer to the stepper member data. + :param stepper: an inner stepper object. + :param content: a pointer to the stepper member data. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -166,13 +162,11 @@ Attaching and Accessing the Content Pointer This function retrieves the member data (content) pointer from an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- an inner stepper object. - * *content* -- a pointer to set to the stepper member data pointer. + :param stepper: an inner stepper object. + :param content: a pointer to set to the stepper member data pointer. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -199,13 +193,11 @@ Setting Member Functions This function attaches an :c:type:`MRIStepInnerEvolveFn` function to an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- an inner stepper object. - * *fn* -- the :c:type:`MRIStepInnerStepper` function to attach. + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerStepper` function to attach. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -223,13 +215,11 @@ Setting Member Functions This function attaches an :c:type:`MRIStepInnerFullRhsFn` function to an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- an inner stepper object. - * *fn* -- the :c:type:`MRIStepInnerFullRhsFn` function to attach. + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerFullRhsFn` function to attach. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -247,13 +237,11 @@ Setting Member Functions This function attaches an :c:type:`MRIStepInnerResetFn` function to an :c:type:`MRIStepInnerStepper` object. - **Arguments:** - * *stepper* -- an inner stepper object. - * *fn* -- the :c:type:`MRIStepInnerResetFn` function to attach. + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerResetFn` function to attach. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -265,6 +253,49 @@ Setting Member Functions **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` +.. c:function:: int MRIStepInnerStepper_SetAccumulatedErrorGetFn(MRIStepInnerStepper stepper, MRIStepInnerGetAccumulatedError fn) + + This function attaches an :c:type:`MRIStepInnerGetAccumulatedError` function to an + :c:type:`MRIStepInnerStepper` object. + + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerGetAccumulatedError` function to attach. + + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` + + .. versionadded: x.y.z + + +.. c:function:: int MRIStepInnerStepper_SetAccumulatedErrorResetFn(MRIStepInnerStepper stepper, MRIStepInnerResetAccumulatedError fn) + + This function attaches an :c:type:`MRIStepInnerResetAccumulatedError` function to an + :c:type:`MRIStepInnerStepper` object. + + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerResetAccumulatedError` function to attach. + + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` + + .. versionadded: x.y.z + + +.. c:function:: int MRIStepInnerStepper_SetRTolFn(MRIStepInnerStepper stepper, MRIStepInnerSetRTol fn) + + This function attaches an :c:type:`MRIStepInnerSetRTol` function to an + :c:type:`MRIStepInnerStepper` object. + + :param stepper: an inner stepper object. + :param fn: the :c:type:`MRIStepInnerSetRTol` function to attach. + + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` + + .. versionadded: x.y.z + + + .. _ARKODE.Usage.MRIStep.CustomInnerStepper.Description.BaseMethods.Forcing: Applying and Accessing Forcing Data @@ -275,7 +306,10 @@ responsible for evaluating ODE right-hand side function :math:`f^F(t,v)` as well as computing and applying the forcing term :eq:`ARKODE_MRI_forcing_poly` to obtain the full right-hand side of the inner (fast) ODE :eq:`ARKODE_MRI_IVP`. The functions in this section can be used to either apply the inner (fast) forcing or access the -data necessary to construct the inner (fast) forcing polynomial. +data necessary to construct the inner (fast) forcing polynomial. While the first of +these is less intrusive and may be used to package an existing black-box IVP solver +as an MRIStepInnerStepper, the latter may be more computationally efficient since it +does not traverse the data directly. .. c:function:: int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, sunrealtype t, N_Vector ff) @@ -284,46 +318,36 @@ data necessary to construct the inner (fast) forcing polynomial. time *t* and adds it to input vector *ff*, i.e., the inner (fast) right-hand side vector. - **Arguments:** - * *stepper* -- an inner stepper object. - * *t* -- the time at which the forcing should be evaluated. - * *f* -- the vector to which the forcing should be applied. - - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` - - **Example usage:** + :param stepper: an inner stepper object. + :param t: the time at which the forcing should be evaluated. + :param f: the vector to which the forcing should be applied. - .. code-block:: C - - /* compute the forcing term and add it the fast RHS vector */ - flag = MRIStepInnerStepper_AddForcing(inner_stepper, t, f_fast); + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` + .. c:function:: int MRIStepInnerStepper_GetForcingData(MRIStepInnerStepper stepper, sunrealtype *tshift, sunrealtype *tscale, N_Vector **forcing, int *nforcing) This function provides access to data necessary to compute the forcing term :eq:`ARKODE_MRI_forcing_poly`. This includes the shift and scaling factors for the normalized time :math:`\tau = (t - t_{n,i-1}^S)/(h^S \Delta c_i^S)` and the - array of polynomial coefficient vectors :math:`\hat{\gamma}^{\{k\}}_i`. + array of polynomial coefficient vectors :math:`\hat{\gamma}^{i,k}`. - **Arguments:** - * *stepper* -- an inner stepper object. - * *tshift* -- the time shift to apply to the current time when computing the + :param stepper: an inner stepper object. + :param tshift: the time shift to apply to the current time when computing the forcing, :math:`t_{n,i-1}^S`. - * *tscale* -- the time scaling to apply to the current time when computing + :param tscale: the time scaling to apply to the current time when computing the forcing, :math:`h^S \Delta c_i^S`. - * *forcing* -- a pointer to an array of forcing vectors, - :math:`\hat{\gamma}^{\{k\}}_i`. - * *nforcing* -- the number of forcing vectors. + :param forcing: a pointer to an array of forcing vectors, + :math:`\hat{\gamma}_{i,k}`. + :param nforcing: the number of forcing vectors. - **Return value:** - * ARK_SUCCESS if successful - * ARK_ILL_INPUT if the stepper is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_ILL_INPUT: if the stepper is ``NULL`` **Example usage:** @@ -384,8 +408,9 @@ member functions: **Return value:** An :c:type:`MRIStepInnerEvolveFn` should return 0 if successful, a positive - value if a recoverable error occurred, or a negative value if it failed - unrecoverably. + value if a recoverable error occurred (i.e., the function could be successful if + called over a smaller time interval :math:`[t0,tout]`), or a negative value if + it failed unrecoverably. **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` @@ -400,7 +425,8 @@ following member functions: This function computes the full right-hand side function of the inner (fast) ODE, :math:`f^F(t,v)` in :eq:`ARKODE_MRI_IVP` for a given value of the independent - variable *t* and state vector *y*. + variable *t* and state vector *y*. We note that this routine should *not* include + contributions from the forcing term :eq:`ARKODE_MRI_forcing_poly`. **Arguments:** * *stepper* -- the inner stepper object. @@ -416,9 +442,8 @@ following member functions: * ``ARK_FULLRHS_OTHER`` -- called elsewhere e.g., for dense output **Return value:** - An :c:type:`MRIStepInnerFullRhsFn` should return 0 if successful, a positive - value if a recoverable error occurred, or a negative value if it failed - unrecoverably. + An :c:type:`MRIStepInnerFullRhsFn` should return 0 if successful, or + a nonzero value upon failure. **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` @@ -432,15 +457,94 @@ following member functions: This function resets the inner (fast) stepper state to the provided independent variable value and dependent variable vector. + If provided, the :c:type:`MRIStepInnerResetFn` function will be called + *before* a call to :c:type:`MRIStepInnerEvolveFn` when the state was + updated at the slow timescale. + **Arguments:** * *stepper* -- the inner stepper object. * *tR* -- the value of the independent variable :math:`t_R`. * *vR* -- the value of the dependent variable vector :math:`v(t_R)`. **Return value:** - An :c:type:`MRIStepInnerResetFn` should return 0 if successful, a positive - value if a recoverable error occurred, or a negative value if it failed - unrecoverably. + An :c:type:`MRIStepInnerResetFn` should return 0 if successful, or a nonzero + value upon failure. **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` + + +.. c:type:: int (*MRIStepInnerGetAccumulatedError)(MRIStepInnerStepper stepper, sunrealtype* accum_error) + + This function returns an estimate of the accumulated solution error arising from the + inner stepper. Both the :c:type:`MRIStepInnerGetAccumulatedError` and + :c:type:`MRIStepInnerResetAccumulatedError` functions should be provided, or not; if only + one is provided then MRIStep will disable multirate temporal adaptivity and call neither. + + + **Arguments:** + * *stepper* -- the inner stepper object. + * *accum_error* -- estimation of the accumulated solution error. + + **Return value:** + An :c:type:`MRIStepInnerGetAccumulatedError` should return 0 if successful, a positive + value if a recoverable error occurred (i.e., the function could be successful if + called over a smaller time interval :math:`[t0,tout]`), or a negative value if it + failed unrecoverably. + + .. note:: + + This function is required when multirate temporal adaptivity has been enabled, + using a :c:type:`SUNAdaptController` module having type :c:enumerator:`SUN_ADAPTCONTROLLER_MRI_H_TOL`. + + If provided, the :c:type:`MRIStepInnerGetAccumulatedError` function will always + be called *after* a preceding call to the :c:type:`MRIStepInnerResetAccumulatedError` + function. + + +.. c:type:: int (*MRIStepInnerResetAccumulatedError)(MRIStepInnerStepper stepper) + + This function resets the inner stepper's accumulated solution error to zero. + This function performs a different role within MRIStep than the + :c:type:`MRIStepInnerResetFn`, and thus an implementation should make no + assumptions about the frequency/ordering of calls to either. + + **Arguments:** + * *stepper* -- the inner stepper object. + + **Return value:** + An :c:type:`MRIStepInnerResetAccumulatedError` should return 0 if successful, or + a nonzero value upon failure. + + .. note:: + + This function is required when multirate temporal adaptivity has been enabled, + using a :c:type:`SUNAdaptController` module having type :c:enumerator:`SUN_ADAPTCONTROLLER_MRI_H_TOL`. + + The :c:type:`MRIStepInnerResetAccumulatedError` function will always be called + *before* any calls to the :c:type:`MRIStepInnerGetAccumulatedError` function. + + Both the :c:type:`MRIStepInnerGetAccumulatedError` and + :c:type:`MRIStepInnerResetAccumulatedError` functions should be provided, or not; if only + one is provided then MRIStep will disable multirate temporal adaptivity and call neither. + + +.. c:type:: int (*MRIStepInnerSetRTol)(MRIStepInnerStepper stepper, sunrealtype rtol) + + This function accepts a relative tolerance for the inner stepper to use in its + upcoming adaptive solve. It is assumed that if the inner stepper supports absolute + tolerances as well, then these have been set up directly by the user to indicate the + "noise" level for solution components. + + **Arguments:** + * *stepper* -- the inner stepper object. + * *rtol* -- relative tolerance to use on the upcoming solve. + + **Return value:** + An :c:type:`MRIStepInnerSetRTol` should return 0 if successful, or a nonzero value + upon failure. + + .. note:: + + This function is required when multirate temporal adaptivity has been enabled + using a :c:type:`SUNAdaptController` module having type :c:enumerator:`SUN_ADAPTCONTROLLER_MRI_H_TOL`. diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst index 9ce5b94aa9..a1f5272aae 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/index.rst @@ -17,36 +17,41 @@ MRIStep Custom Inner Steppers ============================= -Recall, MIS and MRI-GARK methods require solving the auxiliary IVP +Recall that infinitesimal multirate methods require solving a set of auxiliary IVPs .. math:: - \dot{v}(t) = f^F(t, v) + r_i(t), \qquad v(t_{n,i-1}^S) = z_{i-1} + \dot{v}(t) = f^F(t, v) + r_i(t), \qquad v(t_{i,0}) = v_{i,0}, :label: ARKODE_MRI_IVP -for :math:`i \geq 2` on the interval :math:`t \in [t_{n,i-1}^S, t_{n,i}^S]` -where :math:`t_{n,i-1}^S = t_{n-1} + c_{i-1}^S h^S`. The forcing term -:math:`r_i(t)` presented in :numref:`ARKODE.Mathematics.MRIStep` can be equivalently -written as +on intervals :math:`t \in [t_{i,0}, t_{i,f}]`. For the MIS, MRI-GARK and IMEX-MRI-GARK +methods implemented in MRIStep, the forcing term :math:`r_i(t)` +presented in :numref:`ARKODE.Mathematics.MRIStep` can be equivalently written as .. math:: r_i(t) = - \sum\limits_{k \geq 0} \hat{\omega}^{\{k\}}_i \tau^k + \sum\limits_{k \geq 1} \hat{\omega}_{i,k} \tau^{k-1} + - \sum\limits_{k \geq 0} \hat{\gamma}^{\{k\}}_i \tau^k + \sum\limits_{k \geq 1} \hat{\gamma}_{i,k} \tau^{k-1} :label: ARKODE_MRI_forcing_poly where :math:`\tau = (t - t_{n,i-1}^S)/(h^S \Delta c_i^S)` is the normalized time -with :math:`\Delta c_i^S=\left(c^S_i - c^S_{i-1}\right)` and the polynomial -coefficient vectors are +with :math:`\Delta c_i^S=\left(c^S_i - c^S_{i-1}\right)`, the slow stage times are +:math:`t_{n,i-1}^S = t_{n-1} + c_{i-1}^S h^S`, and the polynomial coefficient +vectors are .. math:: - \hat{\omega}^{\{k\}}_i = \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^{i-1} - \omega^{\{k\}}_{i,j} f^E(t_{n,j}^S, z_j) + \hat{\omega}_{i,k} = \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^{i-1} + \Omega_{i,j,k} f^E(t_{n,j}^S, z_j) \quad\text{and}\quad - \hat{\gamma}^{\{k\}}_i = \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^i - \gamma^{\{k\}}_{i,j} f^I(t_{n,j}^S, z_j). + \hat{\gamma}_{i,k} = \frac{1}{\Delta c_i^S} \sum\limits_{j=1}^i + \Gamma_{i,j,k} f^I(t_{n,j}^S, z_j). :label: ARKODE_MRI_forcing_coefficients +The MERK and IMEX-MRI-SR methods included in MRIStep compute the forcing polynomial +:eq:`ARKODE_MRI_forcing_poly` similarly, with appropriate modifications to +:math:`\Delta c_i^S`, :math:`t_{n,i-1}^S`, and the coefficients +:eq:`ARKODE_MRI_forcing_coefficients`. + To evolve the IVP :eq:`ARKODE_MRI_IVP` MRIStep utilizes a generic time integrator interface defined by the :c:type:`MRIStepInnerStepper` base class. This section presents the :c:type:`MRIStepInnerStepper` base class and methods that define diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst index 53d5a8c7d5..6da195368f 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst @@ -22,7 +22,36 @@ MRIStep supplies several built-in MIS, MRI-GARK, and IMEX-MRI-GARK methods, see coupling tables and their corresponding identifiers. Additionally, a user may supply a custom set of slow-to-fast time scale coupling coefficients by constructing a coupling table and attaching it with -:c:func:`MRIStepSetCoupling`. The MRI coupling tables are stored in an +:c:func:`MRIStepSetCoupling`. A given MRI coupling table can encode any of +the MRI methods supported by MRIStep. The family of MRI method encoded +by the table is determined by an enumerated type, :c:enum:`MRISTEP_METHOD_TYPE`: + +.. c:enum:: MRISTEP_METHOD_TYPE + + The MRI method family encoded by a :c:type:`MRIStepCoupling` table + + .. c:enumerator:: MRISTEP_EXPLICIT + + An explicit MRI-GARK method (does not support a slow implicit operator, :math:`f^I`). + + .. c:enumerator:: MRISTEP_IMPLICIT + + An implicit MRI-GARK method (does not support a slow explicit operator, :math:`f^E`). + + .. c:enumerator:: MRISTEP_IMEX + + An IMEX-MRK-GARK method. + + .. c:enumerator:: MRISTEP_MERK + + A explicit MERK method (does not support a slow implicit operator, :math:`f^I`). + + .. c:enumerator:: MRISTEP_SR + + An IMEX-MRI-SR method. + + +The MRI coupling tables themselves are stored in an :c:func:`MRIStepCoupling` object which is a pointer to a :c:struct:`MRIStepCouplingMem` structure: @@ -36,43 +65,57 @@ constructing a coupling table and attaching it with As described in :numref:`ARKODE.Mathematics.MRIStep`, the coupling from the slow time scale to the fast time scale is encoded by a vector of slow stage time abscissae, :math:`c^S \in \mathbb{R}^{s+1}` and a set of coupling - matrices :math:`\Gamma^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}` and - :math:`\Omega^{\{k\}}\in\mathbb{R}^{(s+1)\times(s+1)}`. + tensors :math:`\Gamma\in\mathbb{R}^{(s+1)\times(s+1)\times k}` and + :math:`\Omega\in\mathbb{R}^{(s+1)\times(s+1)\times k}`. + + .. c:member:: MRISTEP_METHOD_TYPE type + + Flag indicating the type of MRI method encoded by this table. .. c:member:: int nmat - The number of coupling matrices :math:`\Omega^{\{k\}}` for the - slow-nonstiff terms and/or :math:`\Gamma^{\{k\}}` for the slow-stiff terms - in :eq:`ARKODE_IVP_two_rate`, + The value of :math:`k` above i.e., number of coupling matrices in + :math:`\Omega` for the slow-nonstiff terms and/or in :math:`\Gamma` for + the slow-stiff terms in :eq:`ARKODE_IVP_two_rate`. .. c:member:: int stages - The number of abscissae i.e., :math:`s+1` above + The number of abscissae i.e., :math:`s+1` above. .. c:member:: int q - The method order of accuracy + The method order of accuracy. .. c:member:: int p - The embedding order of accuracy + The embedding order of accuracy. + + .. c:member:: sunrealtype* c + + An array of length ``[stages]`` containing the slow abscissae :math:`c^S` + for the method. .. c:member:: sunrealtype*** W - A three-dimensional array with dimensions ``[nmat][stages][stages]`` - containing the method's :math:`\Omega^{\{k\}}` coupling matrices for the - slow-nonstiff (explicit) terms in :eq:`ARKODE_IVP_two_rate` + A three-dimensional array with dimensions ``[nmat][stages+1][stages]`` + containing the method's :math:`\Omega` coupling coefficients for the + slow-nonstiff (explicit) terms in :eq:`ARKODE_IVP_two_rate`. .. c:member:: sunrealtype*** G - A three-dimensional array with dimensions ``[nmat][stages][stages]`` - containing the method's :math:`\Gamma^{\{k\}}` coupling matrices for the - slow-stiff (implicit) terms in :eq:`ARKODE_IVP_two_rate` + A three-dimensional array with dimensions ``[nmat][stages+1][stages]`` + containing the method's :math:`\Gamma` coupling coefficients for the + slow-stiff (implicit) terms in :eq:`ARKODE_IVP_two_rate`. - .. c:member:: sunrealtype* c + .. c:member:: int ngroup - An array of length ``[stages]`` containing the slow abscissae :math:`c^S` - for the method + Number of stage groups for the method (only relevant for MERK methods). + + .. c:member:: int** group + + A two-dimensional array with dimensions ``[stages][stages]`` that encodes + which stages should be combined together within fast integration groups + (only relevant for MERK methods). .. _ARKODE.Usage.MRIStep.MRIStepCoupling.Functions: @@ -87,27 +130,27 @@ are defined ``arkode/arkode_mristep.h``. .. _ARKODE.Usage.MRIStep.MRIStepCoupling.Functions.Table: .. table:: MRIStepCoupling functions - +---------------------------------------------+--------------------------------------------------------------------+ - | Function name | Description | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_LoadTable()` | Loads a pre-defined MRIStepCoupling table by ID | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_LoadTableByName()` | Loads a pre-defined MRIStepCoupling table by name | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Alloc()` | Allocate an empty MRIStepCoupling table | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Create()` | Create a new MRIStepCoupling table from coefficients | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_MIStoMRI()` | Create a new MRIStepCoupling table from a slow Butcher table | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Copy()` | Create a copy of a MRIStepCoupling table | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Space()` | Get the MRIStepCoupling table real and integer workspace sizes | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Free()` | Deallocate a MRIStepCoupling table | - +---------------------------------------------+--------------------------------------------------------------------+ - | :c:func:`MRIStepCoupling_Write()` | Write the MRIStepCoupling table to an output file | - +---------------------------------------------+--------------------------------------------------------------------+ + +-------------------------------------------+--------------------------------------------------------------------+ + | Function name | Description | + +===========================================+====================================================================+ + | :c:func:`MRIStepCoupling_LoadTable` | Loads a pre-defined MRIStepCoupling table by ID | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_LoadTableByName` | Loads a pre-defined MRIStepCoupling table by name | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Alloc` | Allocate an empty MRIStepCoupling table | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Create` | Create a new MRIStepCoupling table from coefficients | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_MIStoMRI` | Create a new MRIStepCoupling table from a Butcher table | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Copy` | Create a copy of a MRIStepCoupling table | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Space` | Get the MRIStepCoupling table real and integer workspace sizes | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Free` | Deallocate a MRIStepCoupling table | + +-------------------------------------------+--------------------------------------------------------------------+ + | :c:func:`MRIStepCoupling_Write` | Write the MRIStepCoupling table to an output file | + +-------------------------------------------+--------------------------------------------------------------------+ .. c:function:: MRIStepCoupling MRIStepCoupling_LoadTable(ARKODE_MRITableID method) @@ -116,160 +159,215 @@ are defined ``arkode/arkode_mristep.h``. set of coupling tables and their corresponding identifiers, see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables`. + :param method: the coupling table identifier. - **Arguments:** - * ``method`` -- the coupling table identifier. - - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if *method* was invalid or an allocation error occurred. + :returns: An :c:type:`MRIStepCoupling` structure if successful. A ``NULL`` + pointer if *method* was invalid or an allocation error occurred. -.. c:function:: MRIStepCoupling MRIStepCoupling_LoadTableByName(const char *method) +.. c:function:: MRIStepCoupling MRIStepCoupling_LoadTableByName(const char* method) Retrieves a specified coupling table. For further information on the current set of coupling tables and their corresponding name, see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling.Tables`. + :param method: the coupling table name. - **Arguments:** - * ``method`` -- the coupling table name. - - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if *method* was invalid, *method* was - ``"ARKODE_MRI_NONE"``, or an allocation error occurred. + :returns: An :c:type:`MRIStepCoupling` structure if successful. + A ``NULL`` pointer if *method* was invalid, *method* was + ``"ARKODE_MRI_NONE"``, or an allocation error occurred. .. note:: This function is case sensitive. -.. c:function:: MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, int type) +.. c:function:: MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, MRISTEP_METHOD_TYPE type) Allocates an empty MRIStepCoupling table. - **Arguments:** - * ``nmat`` -- number of :math:`\Omega^{\{k\}}` and/or :math:`\Gamma^{\{k\}}` - matrices in the coupling table. - * ``stages`` -- number of stages in the coupling table. - * ``type`` -- the method type: explicit (0), implicit (1), or ImEx (2). + :param nmat: the value of :math:`k` i.e., number of number of coupling + matrices in :math:`\Omega` for the slow-nonstiff terms and/or in + :math:`\Gamma` for the slow-stiff terms in :eq:`ARKODE_IVP_two_rate`. + :param stages: number of stages in the coupling table. + :param type: the type of MRI method the table will encode. - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if *stages* or *type* was invalid or an allocation error - occurred. + :returns: An :c:type:`MRIStepCoupling` structure if successful. + A ``NULL`` pointer if *stages* or *type* was invalid or an allocation error + occurred. .. note:: - For explicit methods only the W array is allocated, with implicit methods - only the G array is allocated, and for ImEx methods both W and G are - allocated. + For :c:enumerator:`MRISTEP_EXPLICIT` tables, the *G* and *group* arrays are not allocated. + + For :c:enumerator:`MRISTEP_IMPLICIT` tables, the *W* and *group* arrays are not allocated. + + For :c:enumerator:`MRISTEP_IMEX` tables, the *group* array is not allocated. + + For :c:enumerator:`MRISTEP_MERK` tables, the *G* array is not allocated. + + For :c:enumerator:`MRISTEP_SR` tables, the *group* array is not allocated. + + When allocated, both :math:`\Omega` and :math:`\Gamma` + are initialized to all zeros, so only nonzero coefficients need to be provided. + + When allocated, all entries in *group* are initialized to ``-1``, + indicating an unused group and/or the end of a stage group. Users who + supply a custom MRISTEP_MERK table should overwrite all active stages in + each group. For example the ``ARKODE_MERK32`` method has 4 stages that + are evolved in 3 groups -- the first group consists of stage 1, the second + group consists of stages 2 and 4, while the third group consists of + stage 3. Thus *ngroup* should equal 3, and *group* should have + non-default entries + + .. code-block:: C + + C->group[0][0] = 1; + C->group[1][0] = 2; + C->group[1][1] = 4; + C->group[2][0] = 3; + + .. versionchanged:: x.y.z + + This function now supports a broader range of MRI method types. + .. c:function:: MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, sunrealtype *W, sunrealtype *G, sunrealtype *c) Allocates a coupling table and fills it with the given values. - **Arguments:** - * ``nmat`` -- number of :math:`\Omega^{\{k\}}` and/or :math:`\Gamma^{\{k\}}` - matrices in the coupling table. - * ``stages`` -- number of stages in the method. - * ``q`` -- global order of accuracy for the method. - * ``p`` -- global order of accuracy for the embedded method. - * ``W`` -- array of coefficients defining the explicit coupling matrices - :math:`\Omega^{\{k\}}`. The entries should be stored as a 1D array of size - ``nmat * stages * stages``, in row-major order. If the slow method is - implicit pass ``NULL``. - * ``G`` -- array of coefficients defining the implicit coupling matrices - :math:`\Gamma^{\{k\}}`. The entries should be stored as a 1D array of size - ``nmat * stages * stages``, in row-major order. If the slow method is - explicit pass ``NULL``. - * ``c`` -- array of slow abscissae for the MRI method. The entries should be - stored as a 1D array of length ``stages``. - - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if ``stages`` was invalid, an allocation error occurred, - or the input data arrays are inconsistent with the method type. - - .. note:: + This routine can only be used to create coupling tables with type + ``MRISTEP_EXPLICIT``, ``MRISTEP_IMPLICIT``, or ``MRISTEP_IMEX``. The + routine determines the relevant type based on whether either of the + arguments *W* and *G* are ``NULL``. Users who wish to create MRI + methods of type ``MRISTEP_MERK`` or ``MRISTEP_SR`` must currently + do so manually. + + The assumed size of the input arrays *W* and *G* depends on the + input value for the embedding order of accuracy, *p*. + + * Non-embedded methods should be indicated by an input *p=0*, in which + case *W* and/or *G* should have entries stored as a 1D array of size + ``nmat * stages * stages``, in row-major order. + + * Embedded methods should be indicated by an input *p>0*, in which + case *W* and/or *G* should have entries stored as a 1D array of size + ``nmat * (stages+1) * stages``, in row-major order. The additional + "row" is assumed to hold the embedding coefficients. + + :param nmat: the value of :math:`k` i.e., number of number of coupling + matrices in :math:`\Omega` for the slow-nonstiff terms and/or in + :math:`\Gamma` for the slow-stiff terms in :eq:`ARKODE_IVP_two_rate`. + :param stages: number of stages in the method. + :param q: global order of accuracy for the method. + :param p: global order of accuracy for the embedded method. + :param W: array of values defining the explicit coupling coefficients + :math:`\Omega`. If the slow method is implicit pass ``NULL``. + :param G: array of values defining the implicit coupling coefficients + :math:`\Gamma`. If the slow method is explicit pass ``NULL``. + :param c: array of slow abscissae for the MRI method. The entries should be + stored as a 1D array of length ``stages``. + + :returns: An :c:type:`MRIStepCoupling` structure if successful. + A ``NULL`` pointer if ``stages`` was invalid, an allocation error occurred, + or the input data arrays are inconsistent with the method type. - As embeddings are not currently supported in MRIStep, ``p`` should be - equal to zero. .. c:function:: MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) Creates an MRI coupling table for a traditional MIS method based on the slow - Butcher table *B*, following the formula shown in :eq:`ARKODE_MIS_to_MRI` + Butcher table *B*. - **Arguments:** - * ``B`` -- the :c:type:`ARKodeButcherTable` for the 'slow' MIS method. - * ``q`` -- the overall order of the MIS/MRI method. - * ``p`` -- the overall order of the MIS/MRI embedding. + The :math:`s`-stage slow Butcher table must have an explicit first stage + (i.e., :math:`c_1=0` and :math:`A_{1,j}=0` for :math:`1\le j\le s`), + sorted abscissae (i.e., :math:`c_{i} \ge c_{i-1}` for :math:`2\le i\le s`), + and a final abscissa value :math:`c_s \le 1`. In this case, the + :math:`(s+1)`-stage coupling table is computed as - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if an allocation error occurred. + .. math:: - .. note:: + \Omega_{i,j,1} \;\text{or}\; \Gamma_{i,j,1} = + \begin{cases} + 0, & \text{if}\; i=1,\\ + A_{i,j}-A_{i-1,j}, & \text{if}\; 2\le i\le s,\\ + b_{j}-A_{s,j}, & \text{if}\; i= s+1. + \end{cases} + + and the embedding coefficients (if applicable) are computed as + + .. math:: - The :math:`s`-stage slow Butcher table must have an explicit first stage - (i.e., :math:`c_1=0` and :math:`A_{1,j}=0` for :math:`1\le j\le s`) and - sorted abscissae (i.e., :math:`c_{i} \ge c_{i-1}` for :math:`2\le i\le s`). + \tilde{\Omega}_{i,j,1} \;\text{or}\; \tilde{\Gamma}_{i,j,1} = \tilde{b}_{j}-A_{s,j}. - Since an MIS method is at most third order accurate, and even then only if - it meets certain compatibility criteria (see :eq:`ARKODE_MIS_order3`), the values - of *q* and *p* may differ from the method and embedding orders of accuracy - for the Runge--Kutta method encoded in *B*, which is why these arguments - should be supplied separately. + We note that only one of :math:`\Omega` or :math:`\Gamma` will + be filled in. If *B* corresponded to an explicit method, then this routine + fills :math:`\Omega`; if *B* is diagonally-implicit, then this routine + inserts redundant "padding" stages to ensure a solve-decoupled structure and + then uses the above formula to fill :math:`\Gamma`. - As embeddings are not currently supported in MRIStep, then *p* should be - equal to zero. + For general slow tables with at least second-order accuracy, the MIS method will + be second order. However, if the slow table is at least third order and + additionally satisfies + + .. math:: + + \sum_{i=2}^s (c_i-c_{i-1})(\mathbf{e}_i+\mathbf{e}_{i-1})^T A c + (1-c_s) \left(\frac12 + \mathbf{e}_s^T A c\right) = \frac13, + + where :math:`\mathbf{e}_j` corresponds to the :math:`j`-th column from the + :math:`s \times s` identity matrix, then the overall MIS method will be third order. + + As a result, the values of *q* and *p* may differ from the method and + embedding orders of accuracy for the Runge--Kutta method encoded in *B*, + which is why these arguments should be supplied separately. + + If *p>0* is input, then the table *B* must include embedding coefficients. + + + :param B: the :c:type:`ARKodeButcherTable` for the "slow" MIS method. + :param q: the overall order of the MIS/MRI method. + :param p: the overall order of the MIS/MRI embedding. + + :returns: An :c:type:`MRIStepCoupling` structure if successful. + A ``NULL`` pointer if an allocation error occurred. .. c:function:: MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling C) Creates copy of the given coupling table. - **Arguments:** - * ``C`` -- the coupling table to copy. + :param C: the coupling table to copy. - **Return value:** - * An :c:type:`MRIStepCoupling` structure if successful. - * A ``NULL`` pointer if an allocation error occurred. + :returns: An :c:type:`MRIStepCoupling` structure if successful. + A ``NULL`` pointer if an allocation error occurred. .. c:function:: void MRIStepCoupling_Space(MRIStepCoupling C, sunindextype *liw, sunindextype *lrw) Get the real and integer workspace size for a coupling table. - **Arguments:** - * ``C`` -- the coupling table. - * ``lenrw`` -- the number of ``sunrealtype`` values in the coupling table - workspace. - * ``leniw`` -- the number of integer values in the coupling table workspace. + :param C: the coupling table. + :param lenrw: the number of ``sunrealtype`` values in the coupling table + workspace. + :param leniw: the number of integer values in the coupling table workspace. - **Return value:** - * *ARK_SUCCESS* if successful. - * *ARK_MEM_NULL* if the Butcher table memory was ``NULL``. + :retval ARK_SUCCESS: if successful. + :retval ARK_MEM_NULL: if the Butcher table memory was ``NULL``. .. c:function:: void MRIStepCoupling_Free(MRIStepCoupling C) Deallocate the coupling table memory. - **Arguments:** - * ``C`` -- the coupling table. + :param C: the coupling table. .. c:function:: void MRIStepCoupling_Write(MRIStepCoupling C, FILE *outfile) Write the coupling table to the provided file pointer. - **Arguments:** - * ``C`` -- the coupling table. - * ``outfile`` -- pointer to use for printing the table. + :param C: the coupling table. + :param outfile: pointer to use for printing the table. .. note:: @@ -303,49 +401,82 @@ with values specified for each method below (e.g., ``ARKODE_MIS_KW3``). -.. table:: Explicit MRI-GARK coupling tables. The default method for each order - is marked with an asterisk (:math:`^*`). +.. table:: Explicit MRIStep coupling tables. + + ====================================== ================== =============== ============== ===================== + Table name Method Order Embedding Order Slow RHS Calls Reference + ====================================== ================== =============== ============== ===================== + :index:`ARKODE_MRI_GARK_FORWARD_EULER` :math:`1^*` -- 1 + :index:`ARKODE_MRI_GARK_ERK22a` 2 1 2 :cite:p:`Sandu:19` + :index:`ARKODE_MRI_GARK_ERK22b` :math:`2^{*\circ}` 1 2 :cite:p:`Sandu:19` + :index:`ARKODE_MRI_GARK_RALSTON2` 2 1 2 :cite:p:`Roberts:22` + :index:`ARKODE_MERK21` 2 1 2 :cite:p:`Luan:20` + :index:`ARKODE_MIS_KW3` :math:`3^*` -- 3 :cite:p:`Schlegel:09` + :index:`ARKODE_MRI_GARK_ERK33a` :math:`3^{\circ}` 2 3 :cite:p:`Sandu:19` + :index:`ARKODE_MRI_GARK_RALSTON3` 3 2 3 :cite:p:`Roberts:22` + :index:`ARKODE_MERK32` 3 2 3 :cite:p:`Luan:20` + :index:`ARKODE_MRI_GARK_ERK45a` :math:`4^{*\circ}` 3 5 :cite:p:`Sandu:19` + :index:`ARKODE_MERK43` 4 3 6 :cite:p:`Luan:20` + :index:`ARKODE_MERK54` :math:`5^{A}` 4 10 :cite:p:`Luan:20` + ====================================== ================== =============== ============== ===================== + + +Notes regarding the above table: + +#. The default method for each order when using fixed step sizes is marked with an + asterisk (:math:`^*`). + +#. The default method for each order when using adaptive time stepping is marked + with a circle (:math:`^\circ`). + +#. The "Slow RHS Calls" column corresponds to the number of calls to the slow + right-hand side function, :math:`f^E`, per time step. - ================================= =========== ===================== - Table name Order Reference - ================================= =========== ===================== - ``ARKODE_MRI_GARK_FORWARD_EULER`` :math:`1^*` - ``ARKODE_MRI_GARK_ERK22b`` :math:`2^*` :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_ERK22a`` 2 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_RALSTON2`` 2 :cite:p:`Roberts:22` - ``ARKODE_MIS_KW3`` :math:`3^*` :cite:p:`Schlegel:09` - ``ARKODE_MRI_GARK_ERK33a`` 3 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_RALSTON3`` 3 :cite:p:`Roberts:22` - ``ARKODE_MRI_GARK_ERK45a`` :math:`4^*` :cite:p:`Sandu:19` - ================================= =========== ===================== +#. Note A: although all MERK methods were derived in :cite:p:`Luan:20` under an assumption + that the fast function :math:`f^F(t,y)` is linear in :math:`y`, in :cite:p:`Fish:24` it + was proven that MERK methods also satisfy all nonlinear order conditions up through + their linear order. The lone exception is :index:`ARKODE_MERK54`, where it was only + proven to satisfy all nonlinear conditions up to order 4 (since :cite:p:`Fish:24` did + not establish the formulas for the order 5 conditions). All our numerical tests to + date have shown :index:`ARKODE_MERK54` to achieve fifth order for nonlinear problems, + and so we conjecture that it also satisfies the nonlinear fifth order conditions. -.. table:: Diagonally-implicit, solve-decoupled MRI-GARK coupling tables. The - default method for each order is marked with an asterisk - (:math:`^*`). +.. table:: Diagonally-implicit, solve-decoupled MRI-GARK coupling tables. The default + method for each order when using fixed step sizes is marked with an asterisk + (:math:`^*`); the default method for each order when using adaptive time + stepping is marked with a circle (:math:`^\circ`). The "Implicit Solves" + column corresponds to the number of slow implicit (non)linear solves required + per time step. - ===================================== =========== =============== ================== - Table name Order Implicit Solves Reference - ===================================== =========== =============== ================== - ``ARKODE_MRI_GARK_BACKWARD_EULER`` :math:`1^*` 1 - ``ARKODE_MRI_GARK_IRK21a`` :math:`2^*` 1 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_IMPLICIT_MIDPOINT`` 2 2 - ``ARKODE_MRI_GARK_ESDIRK34a`` :math:`3^*` 3 :cite:p:`Sandu:19` - ``ARKODE_MRI_GARK_ESDIRK46a`` :math:`4^*` 5 :cite:p:`Sandu:19` - ===================================== =========== =============== ================== + ========================================== ================== =============== =============== ================== + Table name Method Order Embedding Order Implicit Solves Reference + ========================================== ================== =============== =============== ================== + :index:`ARKODE_MRI_GARK_BACKWARD_EULER` :math:`1^{*\circ}` -- 1 + :index:`ARKODE_MRI_GARK_IRK21a` :math:`2^{*\circ}` 1 1 :cite:p:`Sandu:19` + :index:`ARKODE_MRI_GARK_IMPLICIT_MIDPOINT` 2 -- 2 + :index:`ARKODE_MRI_GARK_ESDIRK34a` :math:`3^{*\circ}` 2 3 :cite:p:`Sandu:19` + :index:`ARKODE_MRI_GARK_ESDIRK46a` :math:`4^{*\circ}` 3 5 :cite:p:`Sandu:19` + ========================================== ================== =============== =============== ================== .. table:: Diagonally-implicit, solve-decoupled IMEX-MRI-GARK coupling tables. - The default method for each order is marked with an asterisk - (:math:`^*`). - - ==================================== =========== =============== =================== - Table name Order Implicit Solves Reference - ==================================== =========== =============== =================== - ``ARKODE_IMEX_MRI_GARK_EULER`` :math:`1^*` 1 - ``ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL`` :math:`2^*` 1 - ``ARKODE_IMEX_MRI_GARK_MIDPOINT`` 2 2 - ``ARKODE_IMEX_MRI_GARK3a`` :math:`3^*` 2 :cite:p:`ChiRen:21` - ``ARKODE_IMEX_MRI_GARK3b`` 3 2 :cite:p:`ChiRen:21` - ``ARKODE_IMEX_MRI_GARK4`` :math:`4^*` 5 :cite:p:`ChiRen:21` - ==================================== =========== =============== =================== + The default method for each order when using fixed step sizes is marked + with an asterisk (:math:`^*`); the default method for each order when using + adaptive time stepping is marked with a circle (:math:`^\circ`). The + "Implicit Solves" column corresponds to the number of slow implicit + (non)linear solves required per time step. + + ========================================= ================= =============== =============== =================== + Table name Method Order Embedding Order Implicit Solves Reference + ========================================= ================= =============== =============== =================== + :index:`ARKODE_IMEX_MRI_GARK_EULER` :math:`1^*` -- 1 + :index:`ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL` :math:`2^*` -- 1 + :index:`ARKODE_IMEX_MRI_GARK_MIDPOINT` 2 -- 2 + :index:`ARKODE_IMEX_MRI_SR21` :math:`2^{\circ}` 1 3 :cite:p:`Fish:24` + :index:`ARKODE_IMEX_MRI_GARK3a` :math:`3^*` -- 2 :cite:p:`ChiRen:21` + :index:`ARKODE_IMEX_MRI_GARK3b` 3 -- 2 :cite:p:`ChiRen:21` + :index:`ARKODE_IMEX_MRI_SR32` :math:`3^{\circ}` 2 4 :cite:p:`Fish:24` + :index:`ARKODE_IMEX_MRI_GARK4` :math:`4^*` -- 5 :cite:p:`ChiRen:21` + :index:`ARKODE_IMEX_MRI_SR43` :math:`4^{\circ}` 3 5 :cite:p:`Fish:24` + ========================================= ================= =============== =============== =================== diff --git a/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst b/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst index f1275b0ae3..c8e239086c 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Skeleton.rst @@ -39,15 +39,12 @@ unchanged from the skeleton program presented in #. Create an inner stepper object to solve the fast (inner) IVP - * If using ARKStep as the fast (inner) integrator, create the ARKStep object - with :c:func:`ARKStepCreate` and configure the integrator as desired for - evolving the fast time scale. See sections :numref:`ARKODE.Usage.Skeleton`, - :numref:`ARKODE.Usage.OptionalInputs`, and - :numref:`ARKODE.Usage.ARKStep.OptionalInputs` for details on configuring - ARKStep. + * If using an ARKODE stepper module for the fast integrator, create and configure + the stepper as normal following the steps detailed in the section for the desired + stepper. - Once the ARKStep object is setup, create an ``MRIStepInnerStepper`` object - with :c:func:`ARKStepCreateMRIStepInnerStepper`. + Once the ARKODE stepper object is setup, create an ``MRIStepInnerStepper`` object + with :c:func:`ARKodeCreateMRIStepInnerStepper`. * If supplying a user-defined fast (inner) integrator, create the ``MRIStepInnerStepper`` object as described in section @@ -88,11 +85,16 @@ unchanged from the skeleton program presented in inputs to :c:func:`MRIStepCreate` is the ``MRIStepInnerStepper`` object for solving the fast (inner) IVP created in the previous step. -#. Set the slow step size - - Call :c:func:`ARKodeSetFixedStep()` on the MRIStep object to specify the +#. If using fixed step sizes, then set the slow step size by calling + :c:func:`ARKodeSetFixedStep()` on the MRIStep object to specify the slow time step size. + If using adaptive slow steps, then specify the desired integration tolerances + as normal. By default, MRIStep will use a "decoupled" (see + :numref:`ARKODE.Mathematics.MultirateControllers`) I controller (see + :numref:`SUNAdaptController.Soderlind`), Alternately, create and attach a + multirate temporal controller (see :numref:`SUNAdaptController.MRIHTol`). + #. Create and configure implicit solvers (*as appropriate*) Specifically, if MRIStep is configured with an implicit slow right-hand side diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 695c28ad5c..08cd106970 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -31,9 +31,10 @@ As discussed in the main :ref:`ARKODE user-callable function introduction clarifies the categories of user-callable functions that it supports. MRIStep supports the following categories: +* temporal adaptivity * implicit nonlinear and/or linear solvers -MRIStep does not have forcing function support when converted to a +MRIStep also has forcing function support when converted to a :c:type:`SUNStepper` or :c:type:`MRIStepInnerStepper`. See :c:func:`ARKodeCreateSUNStepper` and :c:func:`ARKStepCreateMRIStepInnerStepper` for additional details. @@ -50,24 +51,22 @@ MRIStep initialization and deallocation functions This function allocates and initializes memory for a problem to be solved using the MRIStep time-stepping module in ARKODE. - **Arguments:** - * *fse* -- the name of the function (of type :c:func:`ARKRhsFn()`) - defining the explicit slow portion of the right-hand side function in - :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. - * *fsi* -- the name of the function (of type :c:func:`ARKRhsFn()`) - defining the implicit slow portion of the right-hand side function in - :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. - * *t0* -- the initial value of :math:`t`. - * *y0* -- the initial condition vector :math:`y(t_0)`. - * *stepper* -- an :c:type:`MRIStepInnerStepper` for integrating the fast - time scale. - * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) - - **Return value:** - If successful, a pointer to initialized problem memory of type ``void*``, to - be passed to all user-facing MRIStep routines listed below. If unsuccessful, - a ``NULL`` pointer will be returned, and an error message will be printed to - ``stderr``. + :param fse: the name of the function (of type :c:func:`ARKRhsFn()`) + defining the explicit slow portion of the right-hand side function in + :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. + :param fsi: the name of the function (of type :c:func:`ARKRhsFn()`) + defining the implicit slow portion of the right-hand side function in + :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. + :param t0: the initial value of :math:`t`. + :param y0: the initial condition vector :math:`y(t_0)`. + :param stepper: an :c:type:`MRIStepInnerStepper` for integrating the fast + time scale. + :param sunctx: the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) + + :returns: If successful, a pointer to initialized problem memory of type ``void*``, to + be passed to all user-facing MRIStep routines listed below. If unsuccessful, + a ``NULL`` pointer will be returned, and an error message will be printed to + ``stderr``. **Example usage:** @@ -77,18 +76,18 @@ MRIStep initialization and deallocation functions void *inner_arkode_mem = NULL; void *outer_arkode_mem = NULL; - /* MRIStepInnerStepper to wrap the inner (fast) ARKStep object */ + /* MRIStepInnerStepper to wrap the inner (fast) object */ MRIStepInnerStepper stepper = NULL; - /* create an ARKStep object, setting fast (inner) right-hand side + /* create an ARKODE object, setting fast (inner) right-hand side functions and the initial condition */ - inner_arkode_mem = ARKStepCreate(ffe, ffi, t0, y0, sunctx); + inner_arkode_mem = *StepCreate(...); - /* setup ARKStep */ - . . . + /* configure the inner integrator */ + retval = ARKodeSet*(inner_arkode_mem, ...); - /* create MRIStepInnerStepper wrapper for the ARKStep memory block */ - flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &stepper); + /* create MRIStepInnerStepper wrapper for the ARKODE integrator */ + flag = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &stepper); /* create an MRIStep object, setting the slow (outer) right-hand side functions and the initial condition */ @@ -102,6 +101,8 @@ MRIStep initialization and deallocation functions * ``examples/arkode/C_serial/ark_reaction_diffusion_mri.c`` * ``examples/arkode/C_serial/ark_kpr_mri.c`` * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` + * ``examples/arkode/CXX_serial/ark_test_kpr_nestedmri.cpp`` + (uses MRIStep within itself) .. c:function:: void MRIStepFree(void** arkode_mem) @@ -109,10 +110,8 @@ MRIStep initialization and deallocation functions This function frees the problem memory *arkode_mem* created by :c:func:`MRIStepCreate`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. - **Return value:** None .. deprecated:: 6.1.0 @@ -129,16 +128,14 @@ MRIStep tolerance specification functions This function specifies scalar relative and absolute tolerances. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *reltol* -- scalar relative tolerance. - * *abstol* -- scalar absolute tolerance. + :param arkode_mem: pointer to the MRIStep memory block. + :param reltol: scalar relative tolerance. + :param abstol: scalar absolute tolerance. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NO_MALLOC: if the MRIStep memory was not allocated by the time-stepping module + :retval ARK_ILL_INPUT: if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -152,17 +149,15 @@ MRIStep tolerance specification functions absolute tolerance (a potentially different absolute tolerance for each vector component). - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *reltol* -- scalar relative tolerance. - * *abstol* -- vector containing the absolute tolerances for each - solution component. + :param arkode_mem: pointer to the MRIStep memory block. + :param reltol: scalar relative tolerance. + :param abstol: vector containing the absolute tolerances for each + solution component. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module - * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. a negative tolerance). + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NO_MALLOC: if the MRIStep memory was not allocated by the time-stepping module + :retval ARK_ILL_INPUT: if an argument had an illegal value (e.g. a negative tolerance). .. deprecated:: 6.1.0 @@ -175,15 +170,13 @@ MRIStep tolerance specification functions This function specifies a user-supplied function *efun* to compute the error weight vector ``ewt``. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *efun* -- the name of the function (of type :c:func:`ARKEwtFn()`) - that implements the error weight vector computation. + :param arkode_mem: pointer to the MRIStep memory block. + :param efun: the name of the function (of type :c:func:`ARKEwtFn()`) + that implements the error weight vector computation. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARK_NO_MALLOC* if the MRIStep memory was not allocated by the time-stepping module + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NO_MALLOC: if the MRIStep memory was not allocated by the time-stepping module .. deprecated:: 6.1.0 @@ -191,6 +184,7 @@ MRIStep tolerance specification functions + .. _ARKODE.Usage.MRIStep.LinearSolvers: Linear solver interface functions @@ -202,40 +196,40 @@ Linear solver interface functions should use, as well as a template Jacobian ``SUNMatrix`` object (if applicable). - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *LS* -- the ``SUNLinearSolver`` object to use. - * *J* -- the template Jacobian ``SUNMatrix`` object to use (or - ``NULL`` if not applicable). - - **Return value:** - * *ARKLS_SUCCESS* if successful - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARKLS_MEM_FAIL* if there was a memory allocation failure - * *ARKLS_ILL_INPUT* if ARKLS is incompatible with the - provided *LS* or *J* input objects, or the current - ``N_Vector`` module. - - **Notes:** If *LS* is a matrix-free linear solver, then the *J* - argument should be ``NULL``. - - If *LS* is a matrix-based linear solver, then the template Jacobian - matrix *J* will be used in the solve process, so if additional - storage is required within the ``SUNMatrix`` object (e.g. for - factorization of a banded matrix), ensure that the input object is - allocated with sufficient size (see the documentation of - the particular SUNMATRIX type in :numref:`SUNMatrix` for - further information). - - When using sparse linear solvers, it is typically much more - efficient to supply *J* so that it includes the full sparsity - pattern of the Newton system matrices :math:`\mathcal{A} = - I-\gamma J`, even if *J* itself has zeros in nonzero - locations of :math:`I`. The reasoning for this is - that :math:`\mathcal{A}` is constructed in-place, on top of the - user-specified values of *J*, so if the sparsity pattern in *J* is - insufficient to store :math:`\mathcal{A}` then it will need to be - resized internally by MRIStep. + :param arkode_mem: pointer to the MRIStep memory block. + :param LS: the ``SUNLinearSolver`` object to use. + :param J: the template Jacobian ``SUNMatrix`` object to use (or + ``NULL`` if not applicable). + + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_MEM_FAIL: if there was a memory allocation failure + :retval ARKLS_ILL_INPUT: if ARKLS is incompatible with the + provided *LS* or *J* input objects, or the current + ``N_Vector`` module. + + .. note:: + + If *LS* is a matrix-free linear solver, then the *J* + argument should be ``NULL``. + + If *LS* is a matrix-based linear solver, then the template Jacobian + matrix *J* will be used in the solve process, so if additional + storage is required within the ``SUNMatrix`` object (e.g. for + factorization of a banded matrix), ensure that the input object is + allocated with sufficient size (see the documentation of + the particular SUNMATRIX type in :numref:`SUNMatrix` for + further information). + + When using sparse linear solvers, it is typically much more + efficient to supply *J* so that it includes the full sparsity + pattern of the Newton system matrices :math:`\mathcal{A} = + I-\gamma J`, even if *J* itself has zeros in nonzero + locations of :math:`I`. The reasoning for this is + that :math:`\mathcal{A}` is constructed in-place, on top of the + user-specified values of *J*, so if the sparsity pattern in *J* is + insufficient to store :math:`\mathcal{A}` then it will need to be + resized internally by MRIStep. .. deprecated:: 6.1.0 @@ -253,20 +247,20 @@ Nonlinear solver interface functions This function specifies the ``SUNNonlinearSolver`` object that MRIStep should use for implicit stage solves. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *NLS* -- the ``SUNNonlinearSolver`` object to use. + :param arkode_mem: pointer to the MRIStep memory block. + :param NLS: the ``SUNNonlinearSolver`` object to use. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARK_MEM_FAIL* if there was a memory allocation failure - * *ARK_ILL_INPUT* if MRIStep is incompatible with the - provided *NLS* input object. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if there was a memory allocation failure + :retval ARK_ILL_INPUT: if MRIStep is incompatible with the + provided *NLS* input object. - **Notes:** MRIStep will use the Newton ``SUNNonlinearSolver`` module by - default; a call to this routine replaces that module with the - supplied *NLS* object. + .. note:: + + MRIStep will use the Newton ``SUNNonlinearSolver`` module by + default; a call to this routine replaces that module with the + supplied *NLS* object. .. deprecated:: 6.1.0 @@ -285,29 +279,29 @@ Rootfinding initialization function integration of the ODE system. It must be called after :c:func:`MRIStepCreate()`, and before :c:func:`MRIStepEvolve()`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *nrtfn* -- number of functions :math:`g_i`, an integer :math:`\ge` 0. - * *g* -- name of user-supplied function, of type :c:func:`ARKRootFn()`, - defining the functions :math:`g_i` whose roots are sought. + :param arkode_mem: pointer to the MRIStep memory block. + :param nrtfn: number of functions :math:`g_i`, an integer :math:`\ge` 0. + :param g: name of user-supplied function, of type :c:func:`ARKRootFn()`, + defining the functions :math:`g_i` whose roots are sought. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if there was a memory allocation failure + :retval ARK_ILL_INPUT: if *nrtfn* is greater than zero but *g* = ``NULL``. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARK_MEM_FAIL* if there was a memory allocation failure - * *ARK_ILL_INPUT* if *nrtfn* is greater than zero but *g* = ``NULL``. + .. note:: - **Notes:** To disable the rootfinding feature after it has already - been initialized, or to free memory associated with MRIStep's - rootfinding module, call *MRIStepRootInit* with *nrtfn = 0*. + To disable the rootfinding feature after it has already + been initialized, or to free memory associated with MRIStep's + rootfinding module, call *MRIStepRootInit* with *nrtfn = 0*. - Similarly, if a new IVP is to be solved with a call to - :c:func:`MRIStepReInit()`, where the new IVP has no rootfinding - problem but the prior one did, then call *MRIStepRootInit* with - *nrtfn = 0*. + Similarly, if a new IVP is to be solved with a call to + :c:func:`MRIStepReInit()`, where the new IVP has no rootfinding + problem but the prior one did, then call *MRIStepRootInit* with + *nrtfn = 0*. - Rootfinding is only supported for the slow (outer) integrator and should not - be activated for the fast (inner) integrator. + Rootfinding is only supported for the slow (outer) integrator and should not + be activated for the fast (inner) integrator. .. deprecated:: 6.1.0 @@ -324,72 +318,73 @@ MRIStep solver function Integrates the ODE over an interval in :math:`t`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *tout* -- the next time at which a computed solution is desired. - * *yout* -- the computed solution vector. - * *tret* -- the time corresponding to *yout* (output). - * *itask* -- a flag indicating the job of the solver for the next - user step. - - The *ARK_NORMAL* option causes the solver to take internal - steps until it has just overtaken a user-specified output - time, *tout*, in the direction of integration, - i.e. :math:`t_{n-1} <` *tout* :math:`\le t_{n}` for forward - integration, or :math:`t_{n} \le` *tout* :math:`< t_{n-1}` for - backward integration. It will then compute an approximation - to the solution :math:`y(tout)` by interpolation (as described - in :numref:`ARKODE.Mathematics.Interpolation`). - - The *ARK_ONE_STEP* option tells the solver to only take a - single internal step, :math:`y_{n-1} \to y_{n}`, and return the solution - at that point, :math:`y_{n}`, in the vector *yout*. - - **Return value:** - * *ARK_SUCCESS* if successful. - * *ARK_ROOT_RETURN* if :c:func:`MRIStepEvolve()` succeeded, and - found one or more roots. If the number of root functions, - *nrtfn*, is greater than 1, call - :c:func:`MRIStepGetRootInfo()` to see which :math:`g_i` were - found to have a root at (*\*tret*). - * *ARK_TSTOP_RETURN* if :c:func:`MRIStepEvolve()` succeeded and - returned at *tstop*. - * *ARK_MEM_NULL* if the *arkode_mem* argument was ``NULL``. - * *ARK_NO_MALLOC* if *arkode_mem* was not allocated. - * *ARK_ILL_INPUT* if one of the inputs to - :c:func:`MRIStepEvolve()` is illegal, or some other input to - the solver was either illegal or missing. Details will be - provided in the error message. Typical causes of this failure: - - (a) A component of the error weight vector became zero during - internal time-stepping. - - (b) The linear solver initialization function (called by the - user after calling :c:func:`MRIStepCreate`) failed to set - the linear solver-specific *lsolve* field in - *arkode_mem*. - - (c) A root of one of the root functions was found both at a - point :math:`t` and also very near :math:`t`. - - * *ARK_TOO_MUCH_WORK* if the solver took *mxstep* internal steps - but could not reach *tout*. The default value for *mxstep* is - *MXSTEP_DEFAULT = 500*. - * *ARK_CONV_FAILURE* if convergence test failures occurred - too many times (*ark_maxncf*) during one internal time step. - * *ARK_LINIT_FAIL* if the linear solver's initialization - function failed. - * *ARK_LSETUP_FAIL* if the linear solver's setup routine failed in - an unrecoverable manner. - * *ARK_LSOLVE_FAIL* if the linear solver's solve routine failed in - an unrecoverable manner. - * *ARK_VECTOROP_ERR* a vector operation error occurred. - * *ARK_INNERSTEP_FAILED* if the inner stepper returned with an - unrecoverable error. The value returned from the inner stepper can be - obtained with :c:func:`MRIStepGetLastInnerStepFlag()`. - * *ARK_INVALID_TABLE* if an invalid coupling table was provided. - - **Notes:** + :param arkode_mem: pointer to the MRIStep memory block. + :param tout: the next time at which a computed solution is desired. + :param yout: the computed solution vector. + :param tret: the time corresponding to *yout* (output). + :param itask: a flag indicating the job of the solver for the next + user step. + + The *ARK_NORMAL* option causes the solver to take internal + steps until it has just overtaken a user-specified output + time, *tout*, in the direction of integration, + i.e. :math:`t_{n-1} <` *tout* :math:`\le t_{n}` for forward + integration, or :math:`t_{n} \le` *tout* :math:`< t_{n-1}` for + backward integration. It will then compute an approximation + to the solution :math:`y(tout)` by interpolation (as described + in :numref:`ARKODE.Mathematics.Interpolation`). + + The *ARK_ONE_STEP* option tells the solver to only take a + single internal step, :math:`y_{n-1} \to y_{n}`, and return the + solution at that point, :math:`y_{n}`, in the vector *yout*. + + :retval ARK_SUCCESS: if successful. + :retval ARK_ROOT_RETURN: if :c:func:`MRIStepEvolve()` succeeded, and + found one or more roots. If the number of root + functions, *nrtfn*, is greater than 1, call + :c:func:`ARKodeGetRootInfo()` to see which + :math:`g_i` were found to have a root at (*\*tret*). + :retval ARK_TSTOP_RETURN: if :c:func:`MRIStepEvolve()` succeeded and + returned at *tstop*. + :retval ARK_MEM_NULL: if the *arkode_mem* argument was ``NULL``. + :retval ARK_NO_MALLOC: if *arkode_mem* was not allocated. + :retval ARK_ILL_INPUT: if one of the inputs to + :c:func:`MRIStepEvolve()` is illegal, or some other + input to the solver was either illegal or missing. + Details will be provided in the error message. + Typical causes of this failure: + + (a) A component of the error weight vector became + zero during internal time-stepping. + + (b) The linear solver initialization function + (called by the user after calling + :c:func:`ARKStepCreate`) failed to set + the linear solver-specific *lsolve* field in + *arkode_mem*. + + (c) A root of one of the root functions was found both + at a point :math:`t` and also very near :math:`t`. + + :retval ARK_TOO_MUCH_WORK: if the solver took *mxstep* internal steps + but could not reach *tout*. The default value for + *mxstep* is *MXSTEP_DEFAULT = 500*. + :retval ARK_CONV_FAILURE: if convergence test failures occurred too many + times (*ark_maxncf*) during one internal time step. + :retval ARK_LINIT_FAIL: if the linear solver's initialization function failed. + :retval ARK_LSETUP_FAIL: if the linear solver's setup routine failed in + an unrecoverable manner. + :retval ARK_LSOLVE_FAIL: if the linear solver's solve routine failed in + an unrecoverable manner. + :retval ARK_VECTOROP_ERR: a vector operation error occurred. + :retval ARK_INNERSTEP_FAILED: if the inner stepper returned with an + unrecoverable error. The value returned from the + inner stepper can be obtained with + :c:func:`MRIStepGetLastInnerStepFlag()`. + :retval ARK_INVALID_TABLE: if an invalid coupling table was provided. + + .. note:: + The input vector *yout* can use the same memory as the vector *y0* of initial conditions that was passed to :c:func:`MRIStepCreate`. @@ -441,22 +436,18 @@ Optional inputs for MRIStep Resets all optional input parameters to MRIStep's original default values. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. - **Return value:** + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** This function does not change problem-defining function pointers - *fs* and *ff* or the *user_data* pointer. It also does not affect any data - structures or options related to root-finding (those can be reset using - :c:func:`MRIStepRootInit()`). + This function does not change problem-defining function pointers + *fs* and *ff* or the *user_data* pointer. It also does not affect any data + structures or options related to root-finding (those can be reset using + :c:func:`MRIStepRootInit()`). .. deprecated:: 6.1.0 @@ -479,39 +470,32 @@ Optional inputs for MRIStep used for dense output (i.e. interpolation of solution output values and implicit method predictors). - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *degree* -- requested polynomial degree. + :param arkode_mem: pointer to the MRIStep memory block. + :param degree: requested polynomial degree. - **Return value:** + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory or interpolation module are ``NULL`` + :retval ARK_INTERP_FAIL: if this is called after :c:func:`MRIStepEvolve()` + :retval ARK_ILL_INPUT: if an argument has an illegal value or the + interpolation module has already been initialized - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory or interpolation module are ``NULL`` - - * *ARK_INTERP_FAIL* if this is called after :c:func:`MRIStepEvolve()` - - * *ARK_ILL_INPUT* if an argument had an illegal value or the - interpolation module has already been initialized - - **Notes:** Allowed values are between 0 and 5. + .. note:: - This routine should be called *after* :c:func:`MRIStepCreate()` and *before* - :c:func:`MRIStepEvolve()`. After the first call to :c:func:`MRIStepEvolve()` - the interpolation degree may not be changed without first calling - :c:func:`MRIStepReInit()`. + Allowed values are between 0 and 5. + This routine should be called *after* :c:func:`MRIStepCreate()` and *before* + :c:func:`MRIStepEvolve()`. After the first call to :c:func:`MRIStepEvolve()` + the interpolation degree may not be changed without first calling + :c:func:`MRIStepReInit()`. - If a user calls both this routine and :c:func:`MRIStepSetInterpolantType()`, then - :c:func:`MRIStepSetInterpolantType()` must be called first. + If a user calls both this routine and :c:func:`MRIStepSetInterpolantType()`, then + :c:func:`MRIStepSetInterpolantType()` must be called first. - Since the accuracy of any polynomial interpolant is limited by the accuracy - of the time-step solutions on which it is based, the *actual* polynomial - degree that is used by MRIStep will be the minimum of :math:`q-1` and the - input *degree*, for :math:`q > 1` where :math:`q` is the order of accuracy - for the time integration method. + Since the accuracy of any polynomial interpolant is limited by the accuracy + of the time-step solutions on which it is based, the *actual* polynomial + degree that is used by MRIStep will be the minimum of :math:`q-1` and the + input *degree*, for :math:`q > 1` where :math:`q` is the order of accuracy + for the time integration method. .. versionchanged:: 5.5.1 @@ -536,28 +520,23 @@ Optional inputs for MRIStep Specifies the file pointer for a diagnostics file where all MRIStep step adaptivity and solver information is written. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param diagfp: pointer to the diagnostics output file. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *diagfp* -- pointer to the diagnostics output file. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** This parameter can be ``stdout`` or ``stderr``, although the - suggested approach is to specify a pointer to a unique file opened - by the user and returned by ``fopen``. If not called, or if called - with a ``NULL`` file pointer, all diagnostics output is disabled. + This parameter can be ``stdout`` or ``stderr``, although the + suggested approach is to specify a pointer to a unique file opened + by the user and returned by ``fopen``. If not called, or if called + with a ``NULL`` file pointer, all diagnostics output is disabled. - When run in parallel, only one process should set a non-NULL value - for this pointer, since statistics from all processes would be - identical. + When run in parallel, only one process should set a non-NULL value + for this pointer, since statistics from all processes would be + identical. .. deprecated:: 5.2.0 @@ -569,24 +548,17 @@ Optional inputs for MRIStep Set the slow step size used within MRIStep for the following internal step(s). - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param hs: value of the outer (slow) step size. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *hs* -- value of the outer (slow) step size. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value - - **Notes:** + .. note:: - The step sizes used by the inner (fast) stepper may be controlled through calling the - appropriate "Set" routines on the inner integrator. + The step sizes used by the inner (fast) stepper may be controlled through calling the + appropriate "Set" routines on the inner integrator. .. deprecated:: 6.1.0 @@ -600,24 +572,18 @@ Optional inputs for MRIStep solver to warn that :math:`t+h=t` on the next internal step, before MRIStep will instead return with an error. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *mxhnil* -- maximum allowed number of warning messages :math:`(>0)`. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param mxhnil: maximum allowed number of warning messages :math:`(>0)`. - * *ARK_SUCCESS* if successful + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** The default value is 10; set *mxhnil* to zero to specify - this default. + The default value is 10; set *mxhnil* to zero to specify this default. - A negative value indicates that no warning messages should be issued. + A negative value indicates that no warning messages should be issued. .. deprecated:: 6.1.0 @@ -631,24 +597,19 @@ Optional inputs for MRIStep solver in its attempt to reach the next output time, before MRIStep will return with an error. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *mxsteps* -- maximum allowed number of internal steps. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param mxsteps: maximum allowed number of internal steps. - * *ARK_SUCCESS* if successful + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** Passing *mxsteps* = 0 results in MRIStep using the - default value (500). + Passing *mxsteps* = 0 results in MRIStep using the + default value (500). - Passing *mxsteps* < 0 disables the test (not recommended). + Passing *mxsteps* < 0 disables the test (not recommended). .. deprecated:: 6.1.0 @@ -661,21 +622,14 @@ Optional inputs for MRIStep Specifies the value of the independent variable :math:`t` past which the solution is not to proceed. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *tstop* -- stopping time for the integrator. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param tstop: stopping time for the integrator. - * *ARK_SUCCESS* if successful + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value - - **Notes:** + .. note:: The default is that no stop time is imposed. @@ -699,13 +653,11 @@ Optional inputs for MRIStep :math:`t` equals the specified ``tstop`` (instead of merely copying the internal solution :math:`y_n`). - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *interp* -- flag indicating to use interpolation (1) or copy (0). + :param arkode_mem: pointer to the MRIStep memory block. + :param interp: flag indicating to use interpolation (1) or copy (0). - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` .. versionadded:: 5.6.0 @@ -719,14 +671,13 @@ Optional inputs for MRIStep Disables the stop time set with :c:func:`MRIStepSetStopTime`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + + .. note:: - **Notes:** The stop time can be re-enabled though a new call to :c:func:`MRIStepSetStopTime`. @@ -743,28 +694,24 @@ Optional inputs for MRIStep Specifies the user data block *user_data* for the outer integrator and attaches it to the main MRIStep memory block. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param user_data: pointer to the user data. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *user_data* -- pointer to the user data. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** If specified, the pointer to *user_data* is passed to all - user-supplied functions called by the outer integrator for which it is an - argument; otherwise ``NULL`` is passed. + If specified, the pointer to *user_data* is passed to all + user-supplied functions called by the outer integrator for which it is an + argument; otherwise ``NULL`` is passed. - To attach a user data block to the inner integrator call :c:func:`ARKodeSetUserData` - for the inner integrator memory structure. This pointer may be the same as or - different from the pointer attached to the outer integrator depending on what is - required by the user code. + To attach a user data block to the inner integrator call the appropriate + *SetUserData* function for the inner integrator memory structure (e.g., + :c:func:`ARKStepSetUserData()` if the inner stepper is ARKStep). This pointer + may be the same as or different from the pointer attached to the outer + integrator depending on what is required by the user code. .. deprecated:: 6.1.0 @@ -776,18 +723,12 @@ Optional inputs for MRIStep Specifies the function called *before* each inner integration. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param prefn: the name of the C function (of type :c:func:`MRIStepPreInnerFn()`) + defining pre inner integration function. - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *prefn* -- the name of the C function (of type :c:func:`MRIStepPreInnerFn()`) - defining pre inner integration function. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` @@ -795,18 +736,13 @@ Optional inputs for MRIStep Specifies the function called *after* each inner integration. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param postfn: the name of the C function (of type :c:func:`MRIStepPostInnerFn()`) + defining post inner integration function. - * *postfn* -- the name of the C function (of type :c:func:`MRIStepPostInnerFn()`) - defining post inner integration function. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` @@ -821,7 +757,7 @@ Optional inputs for IVP method selection +--------------------------------+-------------------------------------+----------+ | Optional input | Function name | Default | - +--------------------------------+-------------------------------------+----------+ + +================================+=====================================+==========+ | Select the default MRI method | :c:func:`MRIStepSetOrder()` | 3 | | of a given order | | | +--------------------------------+-------------------------------------+----------+ @@ -833,20 +769,14 @@ Optional inputs for IVP method selection Select the default MRI method of a given order. - The default order is 3. An order less than 1 or greater than 4 will result in + The default order is 3. An order less than 1 will result in using the default. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *ord* -- the method order. + :param arkode_mem: pointer to the MRIStep memory block. + :param ord: the method order. - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` .. deprecated:: 6.1.0 @@ -858,28 +788,21 @@ Optional inputs for IVP method selection Specifies a customized set of slow-to-fast coupling coefficients for the MRI method. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *C* -- the table of coupling coefficients for the MRI method. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param C: the table of coupling coefficients for the MRI method. - * *ARK_SUCCESS* if successful + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - - * *ARK_ILL_INPUT* if an argument had an illegal value - - **Notes:** + .. note:: - For a description of the :c:type:`MRIStepCoupling` type and related - functions for creating Butcher tables see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. + For a description of the :c:type:`MRIStepCoupling` type and related + functions for creating Butcher tables see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. - **Warning:** + .. warning:: - This should not be used with :c:func:`ARKodeSetOrder`. + This should not be used with :c:func:`ARKodeSetOrder`. @@ -893,28 +816,28 @@ Optional inputs for implicit stage solves Specifies that the implicit slow right-hand side function, :math:`f^I(t,y)` is linear in :math:`y`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *timedepend* -- flag denoting whether the Jacobian of - :math:`f^I(t,y)` is time-dependent (1) or not (0). - Alternately, when using a matrix-free iterative linear solver - this flag denotes time dependence of the preconditioner. + :param arkode_mem: pointer to the MRIStep memory block. + :param timedepend: flag denoting whether the Jacobian of + :math:`f^I(t,y)` is time-dependent (1) or not (0). + Alternately, when using a matrix-free iterative linear solver + this flag denotes time dependence of the preconditioner. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Notes:** Tightens the linear solver tolerances and takes only a - single Newton iteration. Calls :c:func:`MRIStepSetDeltaGammaMax()` - to enforce Jacobian recomputation when the step size ratio changes - by more than 100 times the unit roundoff (since nonlinear - convergence is not tested). Only applicable when used in - combination with the modified or inexact Newton iteration (not the - fixed-point solver). + .. note:: + + Tightens the linear solver tolerances and takes only a + single Newton iteration. Calls :c:func:`MRIStepSetDeltaGammaMax()` + to enforce Jacobian recomputation when the step size ratio changes + by more than 100 times the unit roundoff (since nonlinear + convergence is not tested). Only applicable when used in + combination with the modified or inexact Newton iteration (not the + fixed-point solver). - The only SUNDIALS-provided SUNNonlinearSolver module that is compatible - with the :c:func:`MRIStepSetLinear()` option is the Newton solver. + The only SUNDIALS-provided SUNNonlinearSolver module that is compatible + with the :c:func:`MRIStepSetLinear()` option is the Newton solver. .. deprecated:: 6.1.0 @@ -927,19 +850,19 @@ Optional inputs for implicit stage solves Specifies that the implicit slow right-hand side function, :math:`f^I(t,y)` is nonlinear in :math:`y`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Notes:** This is the default behavior of MRIStep, so the function - is primarily useful to undo a previous call to - :c:func:`MRIStepSetLinear()`. Calls - :c:func:`MRIStepSetDeltaGammaMax()` to reset the step size ratio - threshold to the default value. + .. note:: + + This is the default behavior of MRIStep, so the function + is primarily useful to undo a previous call to + :c:func:`MRIStepSetLinear()`. Calls + :c:func:`MRIStepSetDeltaGammaMax()` to reset the step size ratio + threshold to the default value. .. deprecated:: 6.1.0 @@ -951,35 +874,37 @@ Optional inputs for implicit stage solves Specifies the method to use for predicting implicit solutions. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *method* -- method choice (0 :math:`\le` *method* :math:`\le` 4): + :param arkode_mem: pointer to the MRIStep memory block. + :param method: the predictor method + + * 0 is the trivial predictor, - * 0 is the trivial predictor, + * 1 is the maximum order (dense output) predictor, - * 1 is the maximum order (dense output) predictor, + * 2 is the variable order predictor, that decreases the + polynomial degree for more distant RK stages, - * 2 is the variable order predictor, that decreases the - polynomial degree for more distant RK stages, + * 3 is the cutoff order predictor, that uses the maximum order + for early RK stages, and a first-order predictor for distant + RK stages, - * 3 is the cutoff order predictor, that uses the maximum order - for early RK stages, and a first-order predictor for distant - RK stages, + * 4 is the bootstrap predictor, that uses a second-order + predictor based on only information within the current step. + **deprecated** - * 4 is the bootstrap predictor, that uses a second-order - predictor based on only information within the current step. - **deprecated** + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: + + The default value is 0. If *method* is set to an + undefined value, this default predictor will be used. - **Notes:** The default value is 0. If *method* is set to an - undefined value, this default predictor will be used. + .. warning:: - **The "bootstrap" predictor (option 4 above) has been deprecated, and - will be removed from a future release.** + The "bootstrap" predictor (option 4 above) has been deprecated, and + will be removed from a future release. .. deprecated:: 6.1.0 @@ -992,18 +917,17 @@ Optional inputs for implicit stage solves Specifies the maximum number of nonlinear solver iterations permitted per slow MRI stage within each time step. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *maxcor* -- maximum allowed solver iterations per stage :math:`(>0)`. + :param arkode_mem: pointer to the MRIStep memory block. + :param maxcor: maximum allowed solver iterations per stage :math:`(>0)`. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value or if the SUNNONLINSOL module is ``NULL`` - * *ARK_NLS_OP_ERR* if the SUNNONLINSOL object returned a failure flag + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value or if the SUNNONLINSOL module is ``NULL`` + :retval ARK_NLS_OP_ERR: if the SUNNONLINSOL object returned a failure flag + + .. note:: - **Notes:** The default value is 3; set *maxcor* :math:`\le 0` - to specify this default. + The default value is 3; set *maxcor* :math:`\le 0` to specify this default. .. deprecated:: 6.1.0 @@ -1015,17 +939,16 @@ Optional inputs for implicit stage solves Specifies the safety factor used within the nonlinear solver convergence test. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *nlscoef* -- coefficient in nonlinear solver convergence test :math:`(>0.0)`. + :param arkode_mem: pointer to the MRIStep memory block. + :param nlscoef: coefficient in nonlinear solver convergence test :math:`(>0.0)`. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Notes:** The default value is 0.1; set *nlscoef* :math:`\le 0` - to specify this default. + .. note:: + + The default value is 0.1; set *nlscoef* :math:`\le 0` to specify this default. .. deprecated:: 6.1.0 @@ -1037,16 +960,16 @@ Optional inputs for implicit stage solves Specifies the constant used in estimating the nonlinear solver convergence rate. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *crdown* -- nonlinear convergence rate estimation constant (default is 0.3). + :param arkode_mem: pointer to the MRIStep memory block. + :param crdown: nonlinear convergence rate estimation constant (default is 0.3). - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Notes:** Any non-positive parameter will imply a reset to the default value. + .. note:: + + Any non-positive parameter will imply a reset to the default value. .. deprecated:: 6.1.0 @@ -1059,17 +982,17 @@ Optional inputs for implicit stage solves Specifies the nonlinear correction threshold beyond which the iteration will be declared divergent. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *rdiv* -- tolerance on nonlinear correction size ratio to - declare divergence (default is 2.3). + :param arkode_mem: pointer to the MRIStep memory block. + :param rdiv: tolerance on nonlinear correction size ratio to + declare divergence (default is 2.3). + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + .. note:: - **Notes:** Any non-positive parameter will imply a reset to the default value. + Any non-positive parameter will imply a reset to the default value. .. deprecated:: 6.1.0 @@ -1082,17 +1005,17 @@ Optional inputs for implicit stage solves Sets the user-supplied function to update the implicit stage predictor prior to execution of the nonlinear or linear solver algorithms that compute the implicit stage solution. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *PredictStage* -- name of user-supplied predictor function. If ``NULL``, then any - previously-provided stage prediction function will be disabled. + :param arkode_mem: pointer to the MRIStep memory block. + :param PredictStage: name of user-supplied predictor function. If ``NULL``, then any + previously-provided stage prediction function will be disabled. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + .. note:: - **Notes:** See :numref:`ARKODE.Usage.StagePredictFn` for more information on - this user-supplied routine. + See :numref:`ARKODE.Usage.StagePredictFn` for more information on + this user-supplied routine. .. deprecated:: 6.1.0 @@ -1105,22 +1028,22 @@ Optional inputs for implicit stage solves Specifies an alternative implicit slow right-hand side function for evaluating :math:`f^I(t,y)` within nonlinear system function evaluations. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *nls_fs* -- the alternative C function for computing the right-hand side - function :math:`f^I(t,y)` in the ODE. + :param arkode_mem: pointer to the MRIStep memory block. + :param nls_fs: the alternative C function for computing the right-hand side + function :math:`f^I(t,y)` in the ODE. - **Return value:** - * *ARK_SUCCESS* if successful. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL``. + :retval ARK_SUCCESS: if successful. + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL``. + + .. note:: - **Notes:** The default is to use the implicit slow right-hand side function - provided to :c:func:`MRIStepCreate()` in nonlinear system functions. If the - input implicit slow right-hand side function is ``NULL``, the default is - used. + The default is to use the implicit slow right-hand side function + provided to :c:func:`MRIStepCreate()` in nonlinear system functions. If the + input implicit slow right-hand side function is ``NULL``, the default is + used. - When using a non-default nonlinear solver, this function must be called - *after* :c:func:`MRIStepSetNonlinearSolver()`. + When using a non-default nonlinear solver, this function must be called + *after* :c:func:`MRIStepSetNonlinearSolver()`. .. deprecated:: 6.1.0 @@ -1133,16 +1056,14 @@ Optional inputs for implicit stage solves Specifies if implicit stage derivatives are deduced without evaluating :math:`f^I`. See :numref:`ARKODE.Mathematics.Nonlinear` for more details. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *deduce* -- If ``SUNFALSE`` (default), the stage derivative is obtained - by evaluating :math:`f^I` with the stage solution returned from the - nonlinear solver. If ``SUNTRUE``, the stage derivative is deduced - without an additional evaluation of :math:`f^I`. + :param arkode_mem: pointer to the MRIStep memory block. + :param deduce: If ``SUNFALSE`` (default), the stage derivative is obtained + by evaluating :math:`f^I` with the stage solution returned from the + nonlinear solver. If ``SUNTRUE``, the stage derivative is deduced + without an additional evaluation of :math:`f^I`. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` .. versionadded:: 5.2.0 @@ -1168,17 +1089,17 @@ Optional inputs for the ARKLS linear solver interface Specifies a scaled step size ratio tolerance, beyond which the linear solver setup routine will be signaled. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *dgmax* -- tolerance on step size ratio change before calling - linear solver setup routine (default is 0.2). + :param arkode_mem: pointer to the MRIStep memory block. + :param dgmax: tolerance on step size ratio change before calling + linear solver setup routine (default is 0.2). - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value - **Notes:** Any non-positive parameter will imply a reset to the default value. + .. note:: + + Any non-positive parameter will imply a reset to the default value. .. deprecated:: 6.1.0 @@ -1191,20 +1112,19 @@ Optional inputs for the ARKLS linear solver interface Specifies the frequency of calls to the linear solver setup routine. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *msbp* -- the linear solver setup frequency. + :param arkode_mem: pointer to the MRIStep memory block. + :param msbp: the linear solver setup frequency. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` - **Notes:** - Positive values of **msbp** specify the linear solver setup frequency. For - example, an input of 1 means the setup function will be called every time - step while an input of 2 means it will be called called every other time - step. If **msbp** is 0, the default value of 20 will be used. A negative - value forces a linear solver step at each implicit stage. + .. note:: + + Positive values of **msbp** specify the linear solver setup frequency. For + example, an input of 1 means the setup function will be called every time + step while an input of 2 means it will be called called every other time + step. If **msbp** is 0, the default value of 20 will be used. A negative + value forces a linear solver step at each implicit stage. .. deprecated:: 6.1.0 @@ -1217,27 +1137,26 @@ Optional inputs for the ARKLS linear solver interface Specifies the frequency for recomputing the Jacobian or recommending a preconditioner update. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *msbj* -- the Jacobian re-computation or preconditioner update frequency. + :param arkode_mem: pointer to the MRIStep memory block. + :param msbj: the Jacobian re-computation or preconditioner update frequency. + + :retval ARKLS_SUCCESS: if successful. + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL``. - **Return value:** - * *ARKLS_SUCCESS* if successful. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL``. - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL``. + .. note:: - **Notes:** - The Jacobian update frequency is only checked *within* calls to the linear - solver setup routine, as such values of *msbj* :math:`<` *msbp* will result - in recomputing the Jacobian every *msbp* steps. See - :c:func:`MRIStepSetLSetupFrequency()` for setting the linear solver setup - frequency *msbp*. + The Jacobian update frequency is only checked *within* calls to the linear + solver setup routine, as such values of *msbj* :math:`<` *msbp* will result + in recomputing the Jacobian every *msbp* steps. See + :c:func:`MRIStepSetLSetupFrequency()` for setting the linear solver setup + frequency *msbp*. - Passing a value *msbj* :math:`\le 0` indicates to use the - default value of 50. + Passing a value *msbj* :math:`\le 0` indicates to use the + default value of 50. - This function must be called *after* the ARKLS system solver interface has - been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. .. deprecated:: 6.1.0 @@ -1256,26 +1175,26 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules Specifies the Jacobian approximation routine to be used for the matrix-based solver with the ARKLS interface. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *jac* -- name of user-supplied Jacobian approximation function. + :param arkode_mem: pointer to the MRIStep memory block. + :param jac: name of user-supplied Jacobian approximation function. + + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - * *ARKLS_SUCCESS* if successful - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This routine must be called after the ARKLS linear - solver interface has been initialized through a call to - :c:func:`MRIStepSetLinearSolver()`. + This routine must be called after the ARKLS linear + solver interface has been initialized through a call to + :c:func:`MRIStepSetLinearSolver()`. - By default, ARKLS uses an internal difference quotient function for - dense and band matrices. If ``NULL`` is passed in for *jac*, this - default is used. An error will occur if no *jac* is supplied when - using other matrix types. + By default, ARKLS uses an internal difference quotient function for + dense and band matrices. If ``NULL`` is passed in for *jac*, this + default is used. An error will occur if no *jac* is supplied when + using other matrix types. - The function type :c:func:`ARKLsJacFn()` is described in - :numref:`ARKODE.Usage.UserSupplied`. + The function type :c:func:`ARKLsJacFn()` is described in + :numref:`ARKODE.Usage.UserSupplied`. .. deprecated:: 6.1.0 @@ -1288,25 +1207,25 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules Specifies the linear system approximation routine to be used for the matrix-based solver with the ARKLS interface. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *linsys* -- name of user-supplied linear system approximation function. + :param arkode_mem: pointer to the MRIStep memory block. + :param linsys: name of user-supplied linear system approximation function. - **Return value:** - * *ARKLS_SUCCESS* if successful - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` + + .. note:: - **Notes:** This routine must be called after the ARKLS linear - solver interface has been initialized through a call to - :c:func:`MRIStepSetLinearSolver()`. + This routine must be called after the ARKLS linear + solver interface has been initialized through a call to + :c:func:`MRIStepSetLinearSolver()`. - By default, ARKLS uses an internal linear system function that leverages the - SUNMATRIX API to form the system :math:`I - \gamma J`. If ``NULL`` is passed - in for *linsys*, this default is used. + By default, ARKLS uses an internal linear system function that leverages the + SUNMATRIX API to form the system :math:`I - \gamma J`. If ``NULL`` is passed + in for *linsys*, this default is used. - The function type :c:func:`ARKLsLinSysFn()` is described in - :numref:`ARKODE.Usage.UserSupplied`. + The function type :c:func:`ARKLsLinSysFn()` is described in + :numref:`ARKODE.Usage.UserSupplied`. .. deprecated:: 6.1.0 @@ -1320,18 +1239,18 @@ Optional inputs for matrix-based ``SUNLinearSolver`` modules change in :math:`\gamma` in the linear system. For more details see :numref:`SUNLinSol.Lagged_matrix`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *onoff* -- flag to enable (``SUNTRUE``) or disable (``SUNFALSE``) - scaling + :param arkode_mem: pointer to the MRIStep memory block. + :param onoff: flag to enable (``SUNTRUE``) or disable (``SUNFALSE``) + scaling - **Return value:** - * *ARKLS_SUCCESS* if successful - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - * *ARKLS_ILL_INPUT* if the attached linear solver is not matrix-based + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_ILL_INPUT: if the attached linear solver is not matrix-based - **Notes:** Linear solution scaling is enabled by default when a matrix-based - linear solver is attached. + .. note:: + + Linear solution scaling is enabled by default when a matrix-based + linear solver is attached. .. deprecated:: 6.1.0 @@ -1348,33 +1267,33 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules Specifies the Jacobian-times-vector setup and product functions. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *jtsetup* -- user-defined Jacobian-vector setup function. - Pass ``NULL`` if no setup is necessary. - * *jtimes* -- user-defined Jacobian-vector product function. + :param arkode_mem: pointer to the MRIStep memory block. + :param jtsetup: user-defined Jacobian-vector setup function. + Pass ``NULL`` if no setup is necessary. + :param jtimes: user-defined Jacobian-vector product function. - **Return value:** - * *ARKLS_SUCCESS* if successful. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL``. - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL``. - * *ARKLS_ILL_INPUT* if an input has an illegal value. - * *ARKLS_SUNLS_FAIL* if an error occurred when setting up - the Jacobian-vector product in the ``SUNLinearSolver`` - object used by the ARKLS interface. + :retval ARKLS_SUCCESS: if successful. + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: if an input has an illegal value. + :retval ARKLS_SUNLS_FAIL: if an error occurred when setting up + the Jacobian-vector product in the ``SUNLinearSolver`` + object used by the ARKLS interface. - **Notes:** The default is to use an internal finite difference - quotient for *jtimes* and to leave out *jtsetup*. If ``NULL`` is - passed to *jtimes*, these defaults are used. A user may - specify non-``NULL`` *jtimes* and ``NULL`` *jtsetup* inputs. + .. note:: - This function must be called *after* the ARKLS system solver - interface has been initialized through a call to - :c:func:`MRIStepSetLinearSolver()`. + The default is to use an internal finite difference + quotient for *jtimes* and to leave out *jtsetup*. If ``NULL`` is + passed to *jtimes*, these defaults are used. A user may + specify non-``NULL`` *jtimes* and ``NULL`` *jtsetup* inputs. - The function types :c:type:`ARKLsJacTimesSetupFn` and - :c:type:`ARKLsJacTimesVecFn` are described in - :numref:`ARKODE.Usage.UserSupplied`. + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`MRIStepSetLinearSolver()`. + + The function types :c:type:`ARKLsJacTimesSetupFn` and + :c:type:`ARKLsJacTimesVecFn` are described in + :numref:`ARKODE.Usage.UserSupplied`. .. deprecated:: 6.1.0 @@ -1386,23 +1305,23 @@ Optional inputs for matrix-free ``SUNLinearSolver`` modules Specifies an alternative implicit right-hand side function for use in the internal Jacobian-vector product difference quotient approximation. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *jtimesRhsFn* -- the name of the C function (of type - :c:func:`ARKRhsFn()`) defining the alternative right-hand side function. + :param arkode_mem: pointer to the MRIStep memory block. + :param jtimesRhsFn: the name of the C function defining the alternative + right-hand side function. - **Return value:** - * *ARKLS_SUCCESS* if successful. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL``. - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL``. - * *ARKLS_ILL_INPUT* if an input has an illegal value. + :retval ARKLS_SUCCESS: if successful. + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: if an input has an illegal value. - **Notes:** The default is to use the implicit right-hand side function - provided to :c:func:`MRIStepCreate()` in the internal difference quotient. If - the input implicit right-hand side function is ``NULL``, the default is used. + .. note:: - This function must be called *after* the ARKLS system solver interface has - been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + The default is to use the implicit right-hand side function provided + to :c:func:`MRIStepCreate()` in the internal difference quotient. If + the input implicit right-hand side function is ``NULL``, the default is used. + + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. .. deprecated:: 6.1.0 @@ -1421,31 +1340,31 @@ Optional inputs for iterative ``SUNLinearSolver`` modules Specifies the user-supplied preconditioner setup and solve functions. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *psetup* -- user defined preconditioner setup function. Pass - ``NULL`` if no setup is needed. - * *psolve* -- user-defined preconditioner solve function. + :param arkode_mem: pointer to the MRIStep memory block. + :param psetup: user defined preconditioner setup function. Pass + ``NULL`` if no setup is needed. + :param psolve: user-defined preconditioner solve function. + + :retval ARKLS_SUCCESS: if successful. + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: if an input has an illegal value. + :retval ARKLS_SUNLS_FAIL: if an error occurred when setting up + preconditioning in the ``SUNLinearSolver`` object used + by the ARKLS interface. - **Return value:** - * *ARKLS_SUCCESS* if successful. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL``. - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL``. - * *ARKLS_ILL_INPUT* if an input has an illegal value. - * *ARKLS_SUNLS_FAIL* if an error occurred when setting up - preconditioning in the ``SUNLinearSolver`` object used - by the ARKLS interface. + .. note:: - **Notes:** The default is ``NULL`` for both arguments (i.e., no - preconditioning). + The default is ``NULL`` for both arguments (i.e., no + preconditioning). - This function must be called *after* the ARKLS system solver - interface has been initialized through a call to - :c:func:`MRIStepSetLinearSolver()`. + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`MRIStepSetLinearSolver()`. - Both of the function types :c:func:`ARKLsPrecSetupFn()` and - :c:func:`ARKLsPrecSolveFn()` are described in - :numref:`ARKODE.Usage.UserSupplied`. + Both of the function types :c:func:`ARKLsPrecSetupFn()` and + :c:func:`ARKLsPrecSolveFn()` are described in + :numref:`ARKODE.Usage.UserSupplied`. .. deprecated:: 6.1.0 @@ -1459,22 +1378,22 @@ Optional inputs for iterative ``SUNLinearSolver`` modules iteration is multiplied to get a tolerance on the linear iteration. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *eplifac* -- linear convergence safety factor. + :param arkode_mem: pointer to the MRIStep memory block. + :param eplifac: linear convergence safety factor. - **Return value:** - * *ARKLS_SUCCESS* if successful. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL``. - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL``. - * *ARKLS_ILL_INPUT* if an input has an illegal value. + :retval ARKLS_SUCCESS: if successful. + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL``. + :retval ARKLS_ILL_INPUT: if an input has an illegal value. - **Notes:** Passing a value *eplifac* :math:`\le 0` indicates to use the - default value of 0.05. + .. note:: - This function must be called *after* the ARKLS system solver - interface has been initialized through a call to - :c:func:`MRIStepSetLinearSolver()`. + Passing a value *eplifac* :math:`\le 0` indicates to use the + default value of 0.05. + + This function must be called *after* the ARKLS system solver + interface has been initialized through a call to + :c:func:`MRIStepSetLinearSolver()`. .. deprecated:: 6.1.0 @@ -1488,26 +1407,25 @@ Optional inputs for iterative ``SUNLinearSolver`` modules (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *nrmfac* -- the norm conversion factor. If *nrmfac* is: + :param arkode_mem: pointer to the MRIStep memory block. + :param nrmfac: the norm conversion factor. If *nrmfac* is: + + :math:`> 0` then the provided value is used. - :math:`> 0` then the provided value is used. + :math:`= 0` then the conversion factor is computed using the vector + length i.e., ``nrmfac = sqrt(N_VGetLength(y))`` (*default*). - :math:`= 0` then the conversion factor is computed using the vector - length i.e., ``nrmfac = sqrt(N_VGetLength(y))`` (*default*). + :math:`< 0` then the conversion factor is computed using the vector dot + product i.e., ``nrmfac = sqrt(N_VDotProd(v,v))`` where all the entries + of ``v`` are one. - :math:`< 0` then the conversion factor is computed using the vector dot - product i.e., ``nrmfac = sqrt(N_VDotProd(v,v))`` where all the entries - of ``v`` are one. + :retval ARK_SUCCESS: if successful. + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL``. - **Return value:** - * *ARK_SUCCESS* if successful. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL``. + .. note:: - **Notes:** - This function must be called *after* the ARKLS system solver interface has - been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. + This function must be called *after* the ARKLS system solver interface has + been initialized through a call to :c:func:`MRIStepSetLinearSolver()`. .. deprecated:: 6.1.0 @@ -1524,22 +1442,22 @@ Rootfinding optional input functions Specifies the direction of zero-crossings to be located and returned. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *rootdir* -- state array of length *nrtfn*, the number of root - functions :math:`g_i` (the value of *nrtfn* was supplied in - the call to :c:func:`MRIStepRootInit()`). If ``rootdir[i] == - 0`` then crossing in either direction for :math:`g_i` should be - reported. A value of +1 or -1 indicates that the solver - should report only zero-crossings where :math:`g_i` is - increasing or decreasing, respectively. + :param arkode_mem: pointer to the MRIStep memory block. + :param rootdir: state array of length *nrtfn*, the number of root + functions :math:`g_i` (the value of *nrtfn* was supplied in + the call to :c:func:`MRIStepRootInit()`). If + ``rootdir[i] == 0`` then crossing in either direction for + :math:`g_i` should be reported. A value of +1 or -1 indicates + that the solver should report only zero-crossings where + :math:`g_i` is increasing or decreasing, respectively. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` - * *ARK_ILL_INPUT* if an argument had an illegal value + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value + + .. note:: - **Notes:** The default behavior is to monitor for both zero-crossing directions. + The default behavior is to monitor for both zero-crossing directions. .. deprecated:: 6.1.0 @@ -1552,20 +1470,20 @@ Rootfinding optional input functions Disables issuing a warning if some root function appears to be identically zero at the beginning of the integration. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` - **Notes:** MRIStep will not report the initial conditions as a - possible zero-crossing (assuming that one or more components - :math:`g_i` are zero at the initial time). However, if it appears - that some :math:`g_i` is identically zero at the initial time - (i.e., :math:`g_i` is zero at the initial time *and* after the - first step), MRIStep will issue a warning which can be disabled with - this optional input function. + .. note:: + + MRIStep will not report the initial conditions as a + possible zero-crossing (assuming that one or more components + :math:`g_i` are zero at the initial time). However, if it appears + that some :math:`g_i` is identically zero at the initial time + (i.e., :math:`g_i` is zero at the initial time *and* after the + first step), MRIStep will issue a warning which can be disabled with + this optional input function. .. deprecated:: 6.1.0 @@ -1593,35 +1511,26 @@ Interpolated output function interpolation module. For Hermite interpolants *kmax = 5* and for Lagrange interpolants *kmax = 3*. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *t* -- the value of the independent variable at which the - derivative is to be evaluated. - - * *k* -- the derivative order requested. + :param arkode_mem: pointer to the MRIStep memory block. + :param t: the value of the independent variable at which the + derivative is to be evaluated. + :param k: the derivative order requested. + :param dky: output vector (must be allocated by the user). - * *dky* -- output vector (must be allocated by the user). + :retval ARK_SUCCESS: if successful + :retval ARK_BAD_K: if *k* is not in the range {0,..., *min(degree, kmax)*}. + :retval ARK_BAD_T: if *t* is not in the interval :math:`[t_n-h_n, t_n]` + :retval ARK_BAD_DKY: if the *dky* vector was ``NULL`` + :retval ARK_MEM_NULL: if the MRIStep memory is ``NULL`` - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_BAD_K* if *k* is not in the range {0,..., *min(degree, kmax)*}. - - * *ARK_BAD_T* if *t* is not in the interval :math:`[t_n-h_n, t_n]` - - * *ARK_BAD_DKY* if the *dky* vector was ``NULL`` - - * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` + .. note:: - **Notes:** It is only legal to call this function after a successful - return from :c:func:`MRIStepEvolve()`. + It is only legal to call this function after a successful + return from :c:func:`MRIStepEvolve()`. - A user may access the values :math:`t_n` and :math:`h_n` via the - functions :c:func:`MRIStepGetCurrentTime()` and - :c:func:`MRIStepGetLastStep()`, respectively. + A user may access the values :math:`t_n` and :math:`h_n` via the + functions :c:func:`MRIStepGetCurrentTime()` and + :c:func:`MRIStepGetLastStep()`, respectively. .. deprecated:: 6.1.0 @@ -1641,23 +1550,29 @@ Main solver optional output functions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. c:function:: int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) +.. c:function:: int MRIStepGetNumInnerStepperFails(void* arkode_mem, long int* inner_fails) - Returns the MRIStep real and integer workspace sizes. + Returns the number of recoverable failures reported by the inner stepper (so far). + + :param arkode_mem: pointer to the MRIStep memory block. + :param inner_fails: number of failed fast (inner) integrations. - **Arguments:** + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *arkode_mem* -- pointer to the MRIStep memory block. + .. versionadded:: x.y.z - * *lenrw* -- the number of ``sunrealtype`` values in the MRIStep workspace. - * *leniw* -- the number of integer values in the MRIStep workspace. +.. c:function:: int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) - **Return value:** + Returns the MRIStep real and integer workspace sizes. - * *ARK_SUCCESS* if successful + :param arkode_mem: pointer to the MRIStep memory block. + :param lenrw: the number of ``realtype`` values in the MRIStep workspace. + :param leniw: the number of integer values in the MRIStep workspace. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1670,19 +1585,12 @@ Main solver optional output functions Returns the cumulative number of slow and fast internal steps taken by the solver (so far). - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *nssteps* -- number of slow steps taken in the solver. - - * *nfsteps* -- number of fast steps taken in the solver. + :param arkode_mem: pointer to the MRIStep memory block. + :param nssteps: number of slow steps taken in the solver. + :param nfsteps: number of fast steps taken in the solver. - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1695,17 +1603,11 @@ Main solver optional output functions Returns the integration step size taken on the last successful internal step. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *hlast* -- step size taken on the last internal step. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param hlast: step size taken on the last internal step. - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1717,17 +1619,11 @@ Main solver optional output functions Returns the current internal time reached by the solver. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *tcur* -- current internal time reached. - - **Return value:** - - * *ARK_SUCCESS* if successful + :param arkode_mem: pointer to the MRIStep memory block. + :param tcur: current internal time reached. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1738,21 +1634,17 @@ Main solver optional output functions Returns the current internal solution reached by the solver. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param ycur: current internal solution. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *ycur* -- current internal solution. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** Users should exercise extreme caution when using this function, - as altering values of *ycur* may lead to undesirable behavior, depending - on the particular use case and on when this routine is called. + Users should exercise extreme caution when using this function, + as altering values of *ycur* may lead to undesirable behavior, depending + on the particular use case and on when this routine is called. .. deprecated:: 6.1.0 @@ -1764,17 +1656,11 @@ Main solver optional output functions Returns the current internal value of :math:`\gamma` used in the implicit solver Newton matrix (see equation :eq:`ARKODE_NewtonMatrix`). - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param gamma: current step size scaling factor in the Newton system. - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *gamma* -- current step size scaling factor in the Newton system. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1787,17 +1673,11 @@ Main solver optional output functions tolerances should be scaled when too much accuracy has been requested for some internal step. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param tolsfac: suggested scaling factor for user-supplied tolerances. - * *tolsfac* -- suggested scaling factor for user-supplied tolerances. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1808,20 +1688,16 @@ Main solver optional output functions Returns the current error weight vector. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *eweight* -- solution error weights at the current time. + :param arkode_mem: pointer to the MRIStep memory block. + :param eweight: solution error weights at the current time. - **Return value:** + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** The user must allocate space for *eweight*, that will be - filled in by this function. + The user must allocate space for *eweight*, that will be + filled in by this function. .. deprecated:: 6.1.0 @@ -1833,19 +1709,18 @@ Main solver optional output functions Outputs all of the integrator, nonlinear solver, linear solver, and other statistics. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *outfile* -- pointer to output file. - * *fmt* -- the output format: + :param arkode_mem: pointer to the MRIStep memory block. + :param outfile: pointer to output file. + :param fmt: the output format: + + * :c:enumerator:`SUN_OUTPUTFORMAT_TABLE` -- prints a table of values - * :c:enumerator:`SUN_OUTPUTFORMAT_TABLE` -- prints a table of values - * :c:enumerator:`SUN_OUTPUTFORMAT_CSV` -- prints a comma-separated list - of key and value pairs e.g., ``key1,value1,key2,value2,...`` + * :c:enumerator:`SUN_OUTPUTFORMAT_CSV` -- prints a comma-separated list + of key and value pairs e.g., ``key1,value1,key2,value2,...`` - **Return value:** - * *ARK_SUCCESS* -- if the output was successfully. - * *CV_MEM_NULL* -- if the MRIStep memory was ``NULL``. - * *CV_ILL_INPUT* -- if an invalid formatting option was provided. + :retval ARK_SUCCESS: if the output was successfully. + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL``. + :retval ARK_ILL_INPUT: if an invalid formatting option was provided. .. note:: @@ -1865,13 +1740,9 @@ Main solver optional output functions Returns the name of the MRIStep constant corresponding to *flag*. See :ref:`ARKODE.Constants`. - **Arguments:** + :param flag: a return flag from an MRIStep function. - * *flag* -- a return flag from an MRIStep function. - - **Return value:** - The return value is a string containing the name of - the corresponding constant. + :returns: A string containing the name of the corresponding constant. .. deprecated:: 6.1.0 @@ -1884,19 +1755,12 @@ Main solver optional output functions Returns the number of calls to the user's outer (slow) right-hand side functions, :math:`f^E` and :math:`f^I`, so far. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nfse_evals: number of calls to the user's :math:`f^E(t,y)` function. + :param nfsi_evals: number of calls to the user's :math:`f^I(t,y)` function. - * *nfse_evals* -- number of calls to the user's :math:`f^E(t,y)` function. - - * *nfsi_evals* -- number of calls to the user's :math:`f^I(t,y)` function. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: x.y.z @@ -1907,17 +1771,11 @@ Main solver optional output functions Returns the number of failed steps due to a nonlinear solver failure (so far). - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param ncnf: number of step failures. - * *ncnf* -- number of step failures. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -1928,54 +1786,29 @@ Main solver optional output functions Returns the MRI coupling table currently in use by the solver. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *C* -- pointer to slow-to-fast MRI coupling structure. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - **Notes:** The *MRIStepCoupling* data structure is defined in - the header file ``arkode/arkode_mristep.h``. It is defined as a - pointer to the following C structure: - - .. code-block:: c + :param arkode_mem: pointer to the MRIStep memory block. + :param C: pointer to slow-to-fast MRI coupling structure. - struct MRIStepCouplingMem { + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - int nmat; /* number of MRI coupling matrices */ - int stages; /* size of coupling matrices (stages * stages) */ - int q; /* method order of accuracy */ - int p; /* embedding order of accuracy */ - sunrealtype ***G; /* coupling matrices [nmat][stages][stages] */ - sunrealtype *c; /* abscissae */ - - }; - typedef MRIStepCouplingMem *MRIStepCoupling; + .. note:: - For more details see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. + The *MRIStepCoupling* data structure is defined in + the header file ``arkode/arkode_mristep.h``. For more details + see :numref:`ARKODE.Usage.MRIStep.MRIStepCoupling`. .. c:function:: int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) Returns the last return value from the inner stepper. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *flag* -- inner stepper return value. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param flag: inner stepper return value. - * *ARK_SUCCESS* if successful + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` .. c:function:: int MRIStepGetUserData(void* arkode_mem, void** user_data) @@ -1983,17 +1816,11 @@ Main solver optional output functions Returns the user data pointer previously set with :c:func:`MRIStepSetUserData`. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *user_data* -- memory reference to a user data pointer - - **Return value:** - - * *ARK_SUCCESS* if successful + :param arkode_mem: pointer to the MRIStep memory block. + :param user_data: memory reference to a user data pointer - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the ARKStep memory was ``NULL`` .. versionadded:: 5.3.0 @@ -2013,21 +1840,17 @@ Implicit solver optional output functions Returns the number of calls made to the linear solver's setup routine (so far). - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param nlinsetups: number of linear solver setup calls made. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *nlinsetups* -- number of linear solver setup calls made. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the nonlinear - solver object; the counter is reset whenever a new nonlinear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2038,23 +1861,18 @@ Implicit solver optional output functions Returns the number of nonlinear solver iterations performed (so far). - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nniters: number of nonlinear iterations performed. - * *nniters* -- number of nonlinear iterations performed. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NLS_OP_ERR: if the SUNNONLINSOL object returned a failure flag - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARK_NLS_OP_ERR* if the SUNNONLINSOL object returned a failure flag + .. note:: - **Notes:** This is only accumulated for the "life" of the nonlinear - solver object; the counter is reset whenever a new nonlinear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2067,21 +1885,17 @@ Implicit solver optional output functions Returns the number of nonlinear solver convergence failures that have occurred (so far). - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nncfails: number of nonlinear convergence failures. - * *nncfails* -- number of nonlinear convergence failures. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the nonlinear - solver object; the counter is reset whenever a new nonlinear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the nonlinear + solver object; the counter is reset whenever a new nonlinear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2093,25 +1907,19 @@ Implicit solver optional output functions Returns all of the nonlinear solver statistics in a single call. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *nniters* -- number of nonlinear iterations performed. + :param arkode_mem: pointer to the MRIStep memory block. + :param nniters: number of nonlinear iterations performed. + :param nncfails: number of nonlinear convergence failures. - * *nncfails* -- number of nonlinear convergence failures. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NLS_OP_ERR: if the SUNNONLINSOL object returned a failure flag - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARK_NLS_OP_ERR* if the SUNNONLINSOL object returned a failure flag + .. note:: - **Notes:** These are only accumulated for the "life" of the - nonlinear solver object; the counters are reset whenever a new - nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. + These are only accumulated for the "life" of the + nonlinear solver object; the counters are reset whenever a new + nonlinear solver module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2129,26 +1937,26 @@ Rootfinding optional output functions Returns an array showing which functions were found to have a root. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *rootsfound* -- array of length *nrtfn* with the indices of the - user functions :math:`g_i` found to have a root (the value of - *nrtfn* was supplied in the call to - :c:func:`MRIStepRootInit()`). For :math:`i = 0 \ldots` - *nrtfn*-1, ``rootsfound[i]`` is nonzero if :math:`g_i` has a - root, and 0 if not. + :param arkode_mem: pointer to the MRIStep memory block. + :param rootsfound: array of length *nrtfn* with the indices of the + user functions :math:`g_i` found to have a root (the value of + *nrtfn* was supplied in the call to + :c:func:`MRIStepRootInit()`). For :math:`i = 0 \ldots` + *nrtfn*-1, ``rootsfound[i]`` is nonzero if :math:`g_i` has a + root, and 0 if not. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - **Notes:** The user must allocate space for *rootsfound* prior to - calling this function. + .. note:: + + The user must allocate space for *rootsfound* prior to + calling this function. - For the components of :math:`g_i` for which a root was found, the - sign of ``rootsfound[i]`` indicates the direction of - zero-crossing. A value of +1 indicates that :math:`g_i` is - increasing, while a value of -1 indicates a decreasing :math:`g_i`. + For the components of :math:`g_i` for which a root was found, the + sign of ``rootsfound[i]`` indicates the direction of + zero-crossing. A value of +1 indicates that :math:`g_i` is + increasing, while a value of -1 indicates a decreasing :math:`g_i`. .. deprecated:: 6.1.0 @@ -2161,13 +1969,11 @@ Rootfinding optional output functions Returns the cumulative number of calls made to the user's root function :math:`g`. - **Arguments:** - * *arkode_mem* -- pointer to the MRIStep memory block. - * *ngevals* -- number of calls made to :math:`g` so far. + :param arkode_mem: pointer to the MRIStep memory block. + :param ngevals: number of calls made to :math:`g` so far. - **Return value:** - * *ARK_SUCCESS* if successful - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` .. deprecated:: 6.1.0 @@ -2241,30 +2047,24 @@ Linear solver interface optional output functions Returns the real and integer workspace used by the ARKLS linear solver interface. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *lenrwLS* -- the number of ``sunrealtype`` values in the ARKLS workspace. - - * *leniwLS* -- the number of integer values in the ARKLS workspace. + :param arkode_mem: pointer to the MRIStep memory block. + :param lenrwLS: the number of ``realtype`` values in the ARKLS workspace. + :param leniwLS: the number of integer values in the ARKLS workspace. - **Return value:** + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** The workspace requirements reported by this routine - correspond only to memory allocated within this interface and to - memory allocated by the ``SUNLinearSolver`` object attached - to it. The template Jacobian matrix allocated by the user outside - of ARKLS is not included in this report. + The workspace requirements reported by this routine + correspond only to memory allocated within this interface and to + memory allocated by the ``SUNLinearSolver`` object attached + to it. The template Jacobian matrix allocated by the user outside + of ARKLS is not included in this report. - In a parallel setting, the above values are global (i.e., summed over all - processors). + In a parallel setting, the above values are global (i.e., summed over all + processors). .. deprecated:: 6.1.0 @@ -2275,23 +2075,18 @@ Linear solver interface optional output functions Returns the number of Jacobian evaluations. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *njevals* -- number of Jacobian evaluations. + :param arkode_mem: pointer to the MRIStep memory block. + :param njevals: number of Jacobian evaluations. - **Return value:** + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2304,23 +2099,18 @@ Linear solver interface optional output functions i.e., the number of calls made to *psetup* with ``jok`` = ``SUNFALSE`` and that returned ``*jcurPtr`` = ``SUNTRUE``. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *npevals* -- the current number of calls to *psetup*. + :param arkode_mem: pointer to the MRIStep memory block. + :param npevals: the current number of calls to *psetup*. - **Return value:** + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2332,23 +2122,18 @@ Linear solver interface optional output functions Returns the number of calls made to the preconditioner solve function, *psolve*. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param npsolves: the number of calls to *psolve*. - * *npsolves* -- the number of calls to *psolve*. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2359,23 +2144,18 @@ Linear solver interface optional output functions Returns the cumulative number of linear iterations. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nliters: the current number of linear iterations. - * *nliters* -- the current number of linear iterations. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2386,23 +2166,18 @@ Linear solver interface optional output functions Returns the cumulative number of linear convergence failures. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nlcfails: the current number of linear convergence failures. - * *nlcfails* -- the current number of linear convergence failures. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2414,23 +2189,18 @@ Linear solver interface optional output functions Returns the cumulative number of calls made to the user-supplied Jacobian-vector setup function, *jtsetup*. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param njtsetup: the current number of calls to *jtsetup*. - * *njtsetup* -- the current number of calls to *jtsetup*. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2442,23 +2212,18 @@ Linear solver interface optional output functions Returns the cumulative number of calls made to the Jacobian-vector product function, *jtimes*. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param njvevals: the current number of calls to *jtimes*. - * *njvevals* -- the current number of calls to *jtimes*. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2471,27 +2236,22 @@ Linear solver interface optional output functions right-hand side function :math:`f^I` for finite difference Jacobian or Jacobian-vector product approximation. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. + :param arkode_mem: pointer to the MRIStep memory block. + :param nfevalsLS: the number of calls to the user implicit + right-hand side function. - * *nfevalsLS* -- the number of calls to the user implicit - right-hand side function. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - **Return value:** - - * *ARKLS_SUCCESS* if successful - - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + .. note:: - **Notes:** The value *nfevalsLS* is incremented only if the default - internal difference quotient function is used. + The value *nfevalsLS* is incremented only if the default + internal difference quotient function is used. - This is only accumulated for the "life" of the linear - solver object; the counter is reset whenever a new linear solver - module is "attached" to MRIStep, or when MRIStep is resized. + This is only accumulated for the "life" of the linear + solver object; the counter is reset whenever a new linear solver + module is "attached" to MRIStep, or when MRIStep is resized. .. deprecated:: 6.1.0 @@ -2502,55 +2262,58 @@ Linear solver interface optional output functions Returns the last return value from an ARKLS routine. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param lsflag: the value of the last return flag from an + ARKLS function. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARKLS_SUCCESS: if successful + :retval ARKLS_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARKLS_LMEM_NULL: if the linear solver memory was ``NULL`` - * *lsflag* -- the value of the last return flag from an - ARKLS function. + .. note:: - **Return value:** + If the ARKLS setup function failed when using the + ``SUNLINSOL_DENSE`` or ``SUNLINSOL_BAND`` modules, then the value + of *lsflag* is equal to the column index (numbered from one) at + which a zero diagonal element was encountered during the LU + factorization of the (dense or banded) Jacobian matrix. For all + other failures, *lsflag* is negative. - * *ARKLS_SUCCESS* if successful + Otherwise, if the ARKLS setup function failed + (:c:func:`MRIStepEvolve()` returned *ARK_LSETUP_FAIL*), then + *lsflag* will be *SUNLS_PSET_FAIL_UNREC*, *SUNLS_ASET_FAIL_UNREC* + or *SUNLS_PACKAGE_FAIL_UNREC*. - * *ARKLS_MEM_NULL* if the MRIStep memory was ``NULL`` + If the ARKLS solve function failed (:c:func:`MRIStepEvolve()` + returned *ARK_LSOLVE_FAIL*), then *lsflag* contains the error + return flag from the ``SUNLinearSolver`` object, which will + be one of: - * *ARKLS_LMEM_NULL* if the linear solver memory was ``NULL`` + * *SUNLS_MEM_NULL*, indicating that the ``SUNLinearSolver`` + memory is ``NULL``; - **Notes:** If the ARKLS setup function failed when using the - ``SUNLINSOL_DENSE`` or ``SUNLINSOL_BAND`` modules, then the value - of *lsflag* is equal to the column index (numbered from one) at - which a zero diagonal element was encountered during the LU - factorization of the (dense or banded) Jacobian matrix. For all - other failures, *lsflag* is negative. + * *SUNLS_ATIMES_NULL*, indicating that a matrix-free iterative solver + was provided, but is missing a routine for the matrix-vector product + approximation, - Otherwise, if the ARKLS setup function failed - (:c:func:`MRIStepEvolve()` returned *ARK_LSETUP_FAIL*), then - *lsflag* will be *SUNLS_PSET_FAIL_UNREC*, *SUNLS_ASET_FAIL_UNREC* - or *SUN_ERR_EXT_FAIL*. + * *SUNLS_ATIMES_FAIL_UNREC*, indicating an unrecoverable failure in + the :math:`Jv` function; - If the ARKLS solve function failed (:c:func:`MRIStepEvolve()` - returned *ARK_LSOLVE_FAIL*), then *lsflag* contains the error - return flag from the ``SUNLinearSolver`` object, which will - be one of: - *SUN_ERR_ARG_CORRUPTRRUPT*, indicating that the ``SUNLinearSolver`` - memory is ``NULL``; - *SUNLS_ATIMES_NULL*, indicating that a matrix-free iterative solver - was provided, but is missing a routine for the matrix-vector product - approximation, - *SUNLS_ATIMES_FAIL_UNREC*, indicating an unrecoverable failure in - the :math:`Jv` function; - *SUNLS_PSOLVE_NULL*, indicating that an iterative linear solver was - configured to use preconditioning, but no preconditioner solve - routine was provided, - *SUNLS_PSOLVE_FAIL_UNREC*, indicating that the preconditioner solve - function failed unrecoverably; - *SUNLS_GS_FAIL*, indicating a failure in the Gram-Schmidt procedure - (SPGMR and SPFGMR only); - *SUNLS_QRSOL_FAIL*, indicating that the matrix :math:`R` was found - to be singular during the QR solve phase (SPGMR and SPFGMR only); or - *SUN_ERR_EXT_FAIL*, indicating an unrecoverable failure in - an external iterative linear solver package. + * *SUNLS_PSOLVE_NULL*, indicating that an iterative linear solver was + configured to use preconditioning, but no preconditioner solve + routine was provided, + + * *SUNLS_PSOLVE_FAIL_UNREC*, indicating that the preconditioner solve + function failed unrecoverably; + + * *SUNLS_GS_FAIL*, indicating a failure in the Gram-Schmidt procedure + (SPGMR and SPFGMR only); + + * *SUNLS_QRSOL_FAIL*, indicating that the matrix :math:`R` was found + to be singular during the QR solve phase (SPGMR and SPFGMR only); or + + * *SUNLS_PACKAGE_FAIL_UNREC*, indicating an unrecoverable failure in + an external iterative linear solver package. .. deprecated:: 6.1.0 @@ -2561,14 +2324,13 @@ Linear solver interface optional output functions Returns the name of the ARKLS constant corresponding to *lsflag*. - **Arguments:** - - * *lsflag* -- a return flag from an ARKLS function. + :param lsflag: a return flag from an ARKLS function. - **Return value:** The return value is a string containing the name of - the corresponding constant. If using the ``SUNLINSOL_DENSE`` or - ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` - :math:`\le n` (LU factorization failed), this routine returns "NONE". + :returns: The return value is a string containing the name of + the corresponding constant. If using the ``SUNLINSOL_DENSE`` + or ``SUNLINSOL_BAND`` modules, then if 1 :math:`\le` `lsflag` + :math:`\le n` (LU factorization failed), this routine returns + "NONE". .. deprecated:: 6.1.0 @@ -2586,24 +2348,20 @@ General usability functions Outputs all MRIStep solver parameters to the provided file pointer. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param fp: pointer to use for printing the solver parameters. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARKS_SUCCESS: if successful + :retval ARKS_MEM_NULL: if the MRIStep memory was ``NULL`` - * *fp* -- pointer to use for printing the solver parameters. - - **Return value:** - - * *ARKS_SUCCESS* if successful - - * *ARKS_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** The *fp* argument can be ``stdout`` or ``stderr``, or it - may point to a specific file created using ``fopen``. + The *fp* argument can be ``stdout`` or ``stderr``, or it + may point to a specific file created using ``fopen``. - When run in parallel, only one process should set a non-NULL value - for this pointer, since parameters for all processes would be - identical. + When run in parallel, only one process should set a non-NULL value + for this pointer, since parameters for all processes would be + identical. .. deprecated:: 6.1.0 @@ -2614,24 +2372,20 @@ General usability functions Outputs the current MRI coupling table to the provided file pointer. - **Arguments:** + :param arkode_mem: pointer to the MRIStep memory block. + :param fp: pointer to use for printing the Butcher tables. - * *arkode_mem* -- pointer to the MRIStep memory block. + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - * *fp* -- pointer to use for printing the Butcher tables. - - **Return value:** - - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + .. note:: - **Notes:** The *fp* argument can be ``stdout`` or ``stderr``, or it - may point to a specific file created using ``fopen``. + The *fp* argument can be ``stdout`` or ``stderr``, or it + may point to a specific file created using ``fopen``. - When run in parallel, only one process should set a non-NULL value - for this pointer, since tables for all processes would be - identical. + When run in parallel, only one process should set a non-NULL value + for this pointer, since tables for all processes would be + identical. .. deprecated:: 6.1.0 @@ -2687,42 +2441,32 @@ vector. Provides required problem specifications and re-initializes the MRIStep outer (slow) stepper. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *fse* -- the name of the function (of type :c:func:`ARKRhsFn()`) - defining the explicit slow portion of the right-hand side function in - :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. - - * *fsi* -- the name of the function (of type :c:func:`ARKRhsFn()`) - defining the implicit slow portion of the right-hand side function in - :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. - - * *t0* -- the initial value of :math:`t`. - - * *y0* -- the initial condition vector :math:`y(t_0)`. - - **Return value:** + :param arkode_mem: pointer to the MRIStep memory block. + :param fse: the name of the function (of type :c:func:`ARKRhsFn()`) + defining the explicit slow portion of the right-hand side function in + :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. + :param fsi: the name of the function (of type :c:func:`ARKRhsFn()`) + defining the implicit slow portion of the right-hand side function in + :math:`\dot{y} = f^E(t,y) + f^I(t,y) + f^F(t,y)`. + :param t0: the initial value of :math:`t`. + :param y0: the initial condition vector :math:`y(t_0)`. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if a memory allocation failed + :retval ARK_ILL_INPUT: if an argument has an illegal value. - * *ARK_SUCCESS* if successful - - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARK_MEM_FAIL* if a memory allocation failed - - * *ARK_ILL_INPUT* if an argument had an illegal value. + .. note:: - **Notes:** - If the inner (fast) stepper also needs to be reinitialized, its - reinitialization function should be called before calling - :c:func:`MRIStepReInit()` to reinitialize the outer stepper. + If the inner (fast) stepper also needs to be reinitialized, its + reinitialization function should be called before calling + :c:func:`MRIStepReInit()` to reinitialize the outer stepper. - All previously set options are retained but may be updated by calling - the appropriate "Set" functions. + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. - If an error occurred, :c:func:`MRIStepReInit()` also - sends an error message to the error handler function. + If an error occurred, :c:func:`MRIStepReInit()` also + sends an error message to the error handler function. @@ -2736,33 +2480,25 @@ MRIStep reset function Resets the current MRIStep outer (slow) time-stepper module state to the provided independent variable value and dependent variable vector. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *tR* -- the value of the independent variable :math:`t`. - - * *yR* -- the value of the dependent variable vector :math:`y(t_R)`. - - **Return value:** - - * *ARK_SUCCESS* if successful + :param arkode_mem: pointer to the MRIStep memory block. + :param tR: the value of the independent variable :math:`t`. + :param yR: the value of the dependent variable vector :math:`y(t_R)`. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if a memory allocation failed + :retval ARK_ILL_INPUT: if an argument has an illegal value. - * *ARK_MEM_FAIL* if a memory allocation failed - - * *ARK_ILL_INPUT* if an argument had an illegal value. + .. note:: - **Notes:** - If the inner (fast) stepper also needs to be reset, its reset function should - be called before calling :c:func:`MRIStepReset()` to reset the outer stepper. + If the inner (fast) stepper also needs to be reset, its reset function should + be called before calling :c:func:`MRIStepReset()` to reset the outer stepper. - All previously set options are retained but may be updated by calling - the appropriate "Set" functions. + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. - If an error occurred, :c:func:`MRIStepReset()` also sends an error message to - the error handler function. + If an error occurred, :c:func:`MRIStepReset()` also sends an error message to + the error handler function. .. versionchanged:: 5.3.0 @@ -2776,6 +2512,7 @@ MRIStep reset function + .. _ARKODE.Usage.MRIStep.Resizing: MRIStep system resize function @@ -2785,68 +2522,58 @@ MRIStep system resize function Re-initializes MRIStep with a different state vector. - **Arguments:** - - * *arkode_mem* -- pointer to the MRIStep memory block. - - * *yR* -- the newly-sized solution vector, holding the current - dependent variable values :math:`y(t_R)`. - - * *tR* -- the current value of the independent variable - :math:`t_R` (this must be consistent with *yR*). - - * *resize* -- the user-supplied vector resize function (of type - :c:func:`ARKVecResizeFn()`. - - * *resize_data* -- the user-supplied data structure to be passed - to *resize* when modifying internal MRIStep vectors. - - **Return value:** - - * *ARK_SUCCESS* if successful + :param arkode_mem: pointer to the MRIStep memory block. + :param yR: the newly-sized solution vector, holding the current + dependent variable values :math:`y(t_R)`. + :param tR: the current value of the independent variable + :math:`t_R` (this must be consistent with *yR*). + :param resize: the user-supplied vector resize function (of type + :c:func:`ARKVecResizeFn()`. + :param resize_data: the user-supplied data structure to be passed + to *resize* when modifying internal MRIStep vectors. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` + :retval ARK_NO_MALLOC: if *arkode_mem* was not allocated. + :retval ARK_ILL_INPUT: if an argument has an illegal value. - * *ARK_MEM_NULL* if the MRIStep memory was ``NULL`` - - * *ARK_NO_MALLOC* if *arkode_mem* was not allocated. - - * *ARK_ILL_INPUT* if an argument had an illegal value. - - **Notes:** If an error occurred, :c:func:`MRIStepResize()` also sends an error - message to the error handler function. - - **Resizing the linear solver:** - When using any of the SUNDIALS-provided linear solver modules, the - linear solver memory structures must also be resized. At present, - none of these include a solver-specific "resize" function, so the linear - solver memory must be destroyed and re-allocated **following** each - call to :c:func:`MRIStepResize()`. Moreover, the existing ARKLS - interface should then be deleted and recreated by attaching the - updated ``SUNLinearSolver`` (and possibly ``SUNMatrix``) object(s) - through calls to :c:func:`MRIStepSetLinearSolver()`. - - If any user-supplied routines are provided to aid the linear solver - (e.g. Jacobian construction, Jacobian-vector product, - mass-matrix-vector product, preconditioning), then the corresponding - "set" routines must be called again **following** the solver - re-specification. - - **Resizing the absolute tolerance array:** - If using array-valued absolute tolerances, the absolute tolerance - vector will be invalid after the call to :c:func:`MRIStepResize()`, so - the new absolute tolerance vector should be re-set **following** each - call to :c:func:`MRIStepResize()` through a new call to - :c:func:`MRIStepSVtolerances()`. - - If scalar-valued tolerances or a tolerance function was specified - through either :c:func:`MRIStepSStolerances()` or - :c:func:`MRIStepWFtolerances()`, then these will remain valid and no - further action is necessary. - - .. note:: + .. note:: - For an example showing usage of the similar :c:func:`ARKStepResize()` - routine, see the supplied serial C example problem, - ``ark_heat1D_adapt.c``. + If an error occurred, :c:func:`MRIStepResize()` also sends an error + message to the error handler function. + + **Resizing the linear solver:** + When using any of the SUNDIALS-provided linear solver modules, the + linear solver memory structures must also be resized. At present, + none of these include a solver-specific "resize" function, so the linear + solver memory must be destroyed and re-allocated **following** each + call to :c:func:`MRIStepResize()`. Moreover, the existing ARKLS + interface should then be deleted and recreated by attaching the + updated ``SUNLinearSolver`` (and possibly ``SUNMatrix``) object(s) + through calls to :c:func:`MRIStepSetLinearSolver()`. + + If any user-supplied routines are provided to aid the linear solver + (e.g. Jacobian construction, Jacobian-vector product, + mass-matrix-vector product, preconditioning), then the corresponding + "set" routines must be called again **following** the solver + re-specification. + + **Resizing the absolute tolerance array:** + If using array-valued absolute tolerances, the absolute tolerance + vector will be invalid after the call to :c:func:`MRIStepResize()`, so + the new absolute tolerance vector should be re-set **following** each + call to :c:func:`MRIStepResize()` through a new call to + :c:func:`MRIStepSVtolerances()`. + + If scalar-valued tolerances or a tolerance function was specified + through either :c:func:`MRIStepSStolerances()` or + :c:func:`MRIStepWFtolerances()`, then these will remain valid and no + further action is necessary. + + **Example codes:** + For an example showing usage of the similar :c:func:`ARKStepResize()` + routine, see the supplied serial C example problem, + ``ark_heat1D_adapt.c``. .. deprecated:: 6.1.0 diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index d147c1560c..fc11496f61 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -790,9 +790,9 @@ the user has set a stop time (with a call to the optional input function :retval ARK_MASSSETUP_FAIL: the mass matrix solver's setup routine failed. :retval ARK_MASSSOLVE_FAIL: the mass matrix solver's solve routine failed. :retval ARK_VECTOROP_ERR: a vector operation error occurred. - :retval ARK_DOMEIG_FAIL: the dominant eigenvalue function failed. It is either + :retval ARK_DOMEIG_FAIL: the dominant eigenvalue function failed. It is either not provided or returns an illegal value. - :retval ARK_MAX_STAGE_LIMIT_FAIL: stepper failed to achieve stable results. Either + :retval ARK_MAX_STAGE_LIMIT_FAIL: stepper failed to achieve stable results. Either reduce the step size or increase the stage_max_limit .. note:: @@ -974,8 +974,8 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr Disabling interpolation will reduce the memory footprint of an integrator by two or more state vectors (depending on the interpolant type and degree) which can be beneficial when interpolation is not needed e.g., when - integrating to a final time without output in between or using ARKStep as an - explicit fast time scale integrator with MRI methods. + integrating to a final time without output in between or using a solver from + ARKODE as a fast time scale integrator with MRI methods. This routine frees any previously-allocated interpolation module, and re-creates one according to the specified argument. @@ -992,16 +992,14 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr .. versionchanged:: 6.1.0 + This function replaces stepper specific versions in ARKStep, ERKStep, + MRIStep, and SPRKStep. + Added the ``ARK_INTERP_NONE`` option to disable interpolation. Values set by a previous call to :c:func:`ARKStepSetInterpolantDegree` are no longer nullified by a call to :c:func:`ARKStepSetInterpolantType`. - .. versionadded:: 6.1.0 - - This function replaces stepper specific versions in ARKStep, ERKStep, - MRIStep, and SPRKStep. - .. c:function:: int ARKodeSetInterpolantDegree(void* arkode_mem, int degree) @@ -1418,7 +1416,7 @@ the code, is provided in :numref:`ARKODE.Mathematics.Adaptivity`. Optional input Function name Default ========================================================= ========================================== ======== Provide a :c:type:`SUNAdaptController` for ARKODE to use :c:func:`ARKodeSetAdaptController` PID -Adjust the method order used in the controller :c:func:`ERKStepSetAdaptivityAdjustment` -1 +Adjust the method order used in the controller :c:func:`ARKodeSetAdaptivityAdjustment` -1 Explicit stability safety factor :c:func:`ARKodeSetCFLFraction` 0.5 Time step error bias factor :c:func:`ARKodeSetErrorBias` 1.5 Bounds determining no change in step size :c:func:`ARKodeSetFixedStepBounds` 1.0 1.5 @@ -1428,8 +1426,10 @@ Maximum first step growth factor :c:func:`ARKodeSetMa Maximum allowed general step growth factor :c:func:`ARKodeSetMaxGrowth` 20.0 Minimum allowed step reduction factor on error test fail :c:func:`ARKodeSetMinReduction` 0.1 Time step safety factor :c:func:`ARKodeSetSafetyFactor` 0.96 -Error fails before MaxEFailGrowth takes effect :c:func:`ARKodeSetSmallNumEFails` 2 +Error fails before ``MaxEFailGrowth`` takes effect :c:func:`ARKodeSetSmallNumEFails` 2 Explicit stability function :c:func:`ARKodeSetStabilityFn` none +Set accumulated error estimation type :c:func:`ARKodeSetAccumulatedErrorType` none +Reset accumulated error :c:func:`ARKodeResetAccumulatedError` ========================================================= ========================================== ======== @@ -1439,8 +1439,7 @@ Explicit stability function :c:func:`ARKodeSetSt Sets a user-supplied time-step controller object. :param arkode_mem: pointer to the ARKODE memory block. - :param C: user-supplied time adaptivity controller. If ``NULL`` then the PID controller - will be created (see :numref:`SUNAdaptController.Soderlind`). + :param C: user-supplied time adaptivity controller. :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. @@ -1450,9 +1449,16 @@ Explicit stability function :c:func:`ARKodeSetSt .. note:: + If *C* is ``NULL`` then the PID controller will be created (see :numref:`SUNAdaptController.Soderlind`). + This is only compatible with time-stepping modules that support temporal adaptivity. - .. versionadded:: 6.1.0 + Not all time-stepping modules are compatible with all types of :c:type:`SUNAdaptController` + objects. While all steppers that support temporal adaptivity support controllers with + :c:type:`SUNAdaptController_Type` type ``SUN_ADAPTCONTROLLER_H``, only MRIStep supports + inputs with type ``SUN_ADAPTCONTROLLER_MRI_H_TOL``. + + .. versionadded:: 6.1.0 .. c:function:: int ARKodeSetAdaptivityAdjustment(void* arkode_mem, int adjust) @@ -1755,6 +1761,84 @@ Explicit stability function :c:func:`ARKodeSetSt .. versionadded:: 6.1.0 +The following routines are used to control algorithms that ARKODE can use to estimate +the accumulated temporal error over multiple time steps. While these may be informational +for users on their applications, this functionality is required when using multirate +temporal adaptivity in MRIStep via the :ref:`SUNAdaptController_MRIHTol <SUNAdaptController.MRIHTol>` +module. For time-stepping modules that compute both a solution and embedding, :math:`y_n` +and :math:`\tilde{y}_n`, these may be combined to create a vector-valued local temporal error +estimate for the current internal step, :math:`y_n - \tilde{y}_n`. These local errors may be +accumulated by ARKODE in a variety of ways, as determined by the enumerated type +:c:enum:`ARKAccumError`. In each of the cases below, the accumulation is taken over all steps +since the most recent call to either :c:func:`ARKodeSetAccumulatedErrorType` or +:c:func:`ARKodeResetAccumulatedError`. Below the set :math:`\mathcal{S}` contains +the indices of the steps since the last call to either of the aforementioned functions. +The norm is taken using the tolerance-informed error-weight vector (see +:c:func:`ARKodeGetErrWeights`), and ``reltol`` is the user-specified relative solution +tolerance. + +.. c:enum:: ARKAccumError + + The type of error accumulation that ARKODE should use. + + .. versionadded:: x.y.z + + .. c:enumerator:: ARK_ACCUMERROR_NONE + + No accumulation should be performed + + .. c:enumerator:: ARK_ACCUMERROR_MAX + + Computes :math:`\text{reltol} \max\limits_{i \in \mathcal{S}} \|y_i - \tilde{y}_i\|_{WRMS}` + + .. c:enumerator:: ARK_ACCUMERROR_SUM + + Computes :math:`\text{reltol} \sum\limits_{i \in \mathcal{S}} \|y_i - \tilde{y}_i\|_{WRMS}` + + .. c:enumerator:: ARK_ACCUMERROR_AVG + + Computes :math:`\frac{\text{reltol}}{\Delta t_{\mathcal{S}}} \sum\limits_{i \in \mathcal{S}} h_i \|y_i - \tilde{y}_i\|_{WRMS}`, + where :math:`h_i` is the step size used when computing :math:`y_i`, and + :math:`\Delta t_{\mathcal{S}}` denotes the elapsed time over which + :math:`\mathcal{S}` is taken. + + +.. c:function:: int ARKodeSetAccumulatedErrorType(void* arkode_mem, ARKAccumError accum_type) + + Sets the strategy to use for accumulating a temporal error estimate + over multiple time steps. By default, ARKODE will not accumulate any + local error estimates (i.e., the default *accum_type* is ``ARK_ACCUMERROR_NONE``). + + A non-default error accumulation strategy can be disabled by calling + :c:func:`ARKodeSetAccumulatedErrorType` with the argument ``ARK_ACCUMERROR_NONE``. + + + :param arkode_mem: pointer to the ARKODE memory block. + :param accum_type: accumulation strategy. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported + by the current time-stepping module. + + .. versionadded:: x.y.z + + +.. c:function:: int ARKodeResetAccumulatedError(void* arkode_mem) + + Resets the accumulated temporal error estimate, that was triggered by a previous call to + :c:func:`ARKodeSetAccumulatedErrorType`. + + :param arkode_mem: pointer to the ARKODE memory block. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL`` + :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported + by the current time-stepping module. + + .. versionadded:: x.y.z + + .. _ARKODE.Usage.ARKodeSolverInputTable: @@ -3175,6 +3259,7 @@ No. of failed steps due to a nonlinear solver failure :c:func:`ARKodeGetNumStep Estimated local truncation error vector :c:func:`ARKodeGetEstLocalErrors` Number of constraint test failures :c:func:`ARKodeGetNumConstrFails` Retrieve a pointer for user data :c:func:`ARKodeGetUserData` +Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumulatedError` ===================================================== ============================================ @@ -3425,8 +3510,8 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat .. c:function:: int ARKodeGetNumExpSteps(void* arkode_mem, long int* expsteps) Returns the cumulative number of stability-limited steps - taken by the solver (so far). If the combination of the maximum number of stages - and the current time step size in the LSRKStep module will not allow for a stable + taken by the solver (so far). If the combination of the maximum number of stages + and the current time step size in the LSRKStep module will not allow for a stable step, the counter also accounts for such returns. :param arkode_mem: pointer to the ARKODE memory block. @@ -3611,6 +3696,25 @@ Retrieve a pointer for user data :c:func:`ARKodeGetUserDat .. versionadded:: 6.1.0 +.. c:function:: int ARKodeGetAccumulatedError(void* arkode_mem, sunrealtype* accum_error) + + Returns the accumulated temporal error estimate. + + :param arkode_mem: pointer to the ARKODE memory block. + :param accum_error: pointer to accumulated error estimate. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_WARNING: accumulated error estimation is currently disabled. + :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported + by the current time-stepping module. + + .. versionadded:: x.y.z + + + + + .. _ARKODE.Usage.ARKodeImplicitSolverOutputs: Implicit solver optional output functions @@ -4728,6 +4832,57 @@ rescale the upcoming time step by the specified factor. If a value +.. _ARKODE.Usage.MRIStepInterface: + +Using an ARKODE solver as an MRIStep "inner" solver +--------------------------------------------------- + +When using an integrator from ARKODE as the inner (fast) integrator with MRIStep, the +utility function :c:func:`ARKodeCreateMRIStepInnerStepper` should be used to +wrap the ARKODE memory block as an :c:type:`MRIStepInnerStepper`. + +.. c:function:: int ARKodeCreateMRIStepInnerStepper(void *inner_arkode_mem, MRIStepInnerStepper *stepper) + + Wraps an ARKODE integrator as an :c:type:`MRIStepInnerStepper` for use + with MRIStep. + + :param arkode_mem: pointer to the ARKODE memory block. + :param stepper: the :c:type:`MRIStepInnerStepper` object to create. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_FAIL: a memory allocation failed. + :retval ARK_STEPPER_UNSUPPORTED: the time-stepping module does not currently support use as an inner stepper. + + .. note:: + + Currently, ARKODE integrators based on ARKStep, ERKStep, and MRIStep + support use as an MRIStep inner stepper. + + **Example usage:** + + .. code-block:: C + + /* fast (inner) and slow (outer) ARKODE objects */ + void *inner_arkode_mem = NULL; + void *outer_arkode_mem = NULL; + + /* MRIStepInnerStepper to wrap the inner (fast) object */ + MRIStepInnerStepper stepper = NULL; + + /* create an ARKODE object, setting fast (inner) right-hand side + functions and the initial condition */ + inner_arkode_mem = *StepCreate(...); + + /* configure the inner integrator */ + retval = ARKodeSet*(inner_arkode_mem, ...); + + /* create MRIStepInnerStepper wrapper for the ARKODE integrator */ + flag = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &stepper); + + /* create an MRIStep object, setting the slow (outer) right-hand side + functions and the initial condition */ + outer_arkode_mem = MRIStepCreate(fse, fsi, t0, y0, stepper, sunctx) + .. _ARKODE.Usage.SUNStepperInterface: Using an ARKODE solver as a SUNStepper @@ -4750,6 +4905,6 @@ block as a :c:type:`SUNStepper`. .. warning:: Currently, ``stepper`` will be equipped with an implementation for the :c:func:`SUNStepper_SetForcing` function only if ``inner_arkode_mem`` is - an ARKStep integrator. + an ARKStep, ERKStep, or MRIStep integrator. .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst b/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst index 081cb80650..9c90434a0c 100644 --- a/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst +++ b/doc/arkode/guide/source/sunadaptcontroller/SUNAdaptController_links.rst @@ -13,3 +13,4 @@ .. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_Description.rst .. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst .. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst +.. include:: ../../../../shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index c13e19c596..9885baca5a 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -45,6 +45,22 @@ The build system has been updated to utilize the CMake LAPACK imported target which should ease building SUNDIALS with LAPACK libraries that require setting specific linker flags e.g., MKL. +Added support for multirate time step adaptivity controllers, based on the +recently introduced :c:type:`SUNAdaptController` base class, to ARKODE's MRIStep module. +As a part of this, we added embeddings for existing MRI-GARK methods, as well as +support for embedded MERK and IMEX-MRI-SR methods. Added new default MRI methods +for temporally adaptive versus fixed-step runs. Added the function +:c:func:`MRIStepGetNumInnerStepperFails` to retrieve the number of recoverable +failures reported by the MRIStepInnerStepper. + +Added functionality to ARKODE to accumulate a temporal error +estimate over multiple time steps. See the routines +:c:func:`ARKodeSetAccumulatedErrorType`, :c:func:`ARKodeResetAccumulatedError`, +and :c:func:`ARKodeGetAccumulatedError` for details. + +Added a utility routine to wrap any valid ARKODE integrator for use as an MRIStep +inner stepper object, :c:func:`ARKodeCreateMRIStepInnerStepper`. + **Bug Fixes** Fixed a `bug <https://github.com/LLNL/sundials/issues/581>`__ in the sparse @@ -65,6 +81,15 @@ repeatedly. Fixed compilation errors when building the Trilinos Teptra NVector with CUDA support. +Fixed loading the default IMEX-MRI method if :c:func:`ARKodeSetOrder` is used to +specify a third or fourth order method. Previously, the default second order method +was loaded in both cases. + +Fixed a bug in MRIStep where the data supplied to the Hermite interpolation module did +not include contributions from the fast right-hand side function. With this fix, users +will see one additional fast right-hand side function evaluation per slow step with the +Hermite interpolation option. + Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. @@ -74,6 +99,10 @@ See details in GitHub Issue `#538 <https://github.com/LLNL/sundials/issues/538>` **Deprecation Notices** +Deprecated the ARKStep-specific utility routine for wrapping an ARKStep instance +as an MRIStep inner stepper object, :c:func:`ARKStepCreateMRIStepInnerStepper`. Use +:c:func:`ARKodeCreateMRIStepInnerStepper` instead. + The ARKODE stepper specific functions to retrieve the number of right-hand side function evaluations have been deprecated. Use :c:func:`ARKodeGetNumRhsEvals` instead. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index 91e94abbf0..3407edc9f4 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -18,6 +18,10 @@ The SUNAdaptController API .. versionadded:: 6.7.0 +.. versionchanged:: x.y.z + + Added support multirate time step adaptivity controllers + 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 @@ -75,10 +79,16 @@ The virtual table structure is defined as The function implementing :c:func:`SUNAdaptController_Destroy` - .. c:member:: SUNErrCode (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); + .. c:member:: SUNErrCode (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew) The function implementing :c:func:`SUNAdaptController_EstimateStep` + .. c:member:: SUNErrCode (*estimatesteptol)(SUNAdaptController C, sunrealtype H, sunrealtype tolfac, int P, sunrealtype DSM, sunrealtype dsm, sunrealtype* Hnew, sunrealtype* tolfacnew) + + The function implementing :c:func:`SUNAdaptController_EstimateStepTol` + + .. versionadded:: x.y.z + .. c:member:: SUNErrCode (*reset)(SUNAdaptController C) The function implementing :c:func:`SUNAdaptController_Reset` @@ -99,6 +109,12 @@ The virtual table structure is defined as The function implementing :c:func:`SUNAdaptController_UpdateH` + .. c:member:: SUNErrCode (*updatemritol)(SUNAdaptController C, sunrealtype H, sunrealtype tolfac, sunrealtype DSM, sunrealtype dsm) + + The function implementing :c:func:`SUNAdaptController_UpdateMRIHTol` + + .. versionadded:: x.y.z + .. c:member:: SUNErrCode (*space)(SUNAdaptController C, long int *lenrw, long int *leniw) The function implementing :c:func:`SUNAdaptController_Space` @@ -128,6 +144,13 @@ following set of SUNAdaptController types: Controls a single-rate step size. +.. c:enumerator:: SUN_ADAPTCONTROLLER_MRI_H_TOL + + Controls both a slow time step and a tolerance factor to apply on the next-faster + time scale within a multirate simulation that has an arbitrary number of time scales. + + .. versionadded:: x.y.z + .. _SUNAdaptController.Description.operations: @@ -168,11 +191,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c - - retval = SUNAdaptController_DestroyEmpty(C); .. c:function:: SUNAdaptController_Type SUNAdaptController_GetType(SUNAdaptController C) @@ -182,11 +200,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :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:: SUNErrCode SUNAdaptController_Destroy(SUNAdaptController C) @@ -200,11 +213,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c - - retval = SUNAdaptController_Destroy(C); .. c:function:: SUNErrCode SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew) @@ -219,25 +227,41 @@ note these requirements below. Additionally, we note the behavior of the base SU :param hnew: (output) the estimated step size. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - .. code-block:: c +.. c:function:: SUNErrCode SUNAdaptController_EstimateStepTol(SUNAdaptController C, sunrealtype H, sunrealtype tolfac, int P, sunrealtype DSM, sunrealtype dsm, sunrealtype* Hnew, sunrealtype* tolfacnew) + + Estimates a slow step size and a fast tolerance multiplication factor + for two adjacent time scales within a multirate application. + + This routine is required for controllers of type :c:enumerator`SUN_ADAPTCONTROLLER_MRI_H_TOL`. + If the current time scale has relative tolerance ``rtol``, then the + next-faster time scale will be called with relative tolerance ``tolfac * rtol``. + If this is not provided by the implementation, the base class method will set + ``*Hnew = H`` and ``*tolfacnew = tolfac`` and return. + + :param C: the :c:type:`SUNAdaptController` object. + :param H: the slow step size from the previous step attempt. + :param tolfac: the current relative tolerance factor for the next-faster time scale. + :param P: the current order of accuracy for the slow time scale integration method. + :param DSM: the slow time scale local temporal estimate from the previous step attempt. + :param dsm: the fast time scale local temporal estimate from the previous step attempt. + :param Hnew: (output) the estimated slow step size. + :param tolfacnew: (output) the estimated relative tolerance factor. + :return: :c:type:`SUNErrCode` indicating success or failure. + + .. versionadded:: x.y.z - retval = SUNAdaptController_EstimateStep(C, hcur, p, dsm, &hnew); .. c:function:: SUNErrCode 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. + of previous ``dsm`` or ``h`` values. :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: + .. versionadded:: x.y.z - .. code-block:: c - - retval = SUNAdaptController_Reset(C); .. c:function:: SUNErrCode SUNAdaptController_SetDefaults(SUNAdaptController C) @@ -246,11 +270,8 @@ note these requirements below. Additionally, we note the behavior of the base SU :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c + .. versionadded:: x.y.z - retval = SUNAdaptController_SetDefaults(C); .. c:function:: SUNErrCode SUNAdaptController_Write(SUNAdaptController C, FILE* fptr) @@ -260,11 +281,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :param fptr: the output stream to write the parameters to. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c - - retval = SUNAdaptController_Write(C, stdout); .. c:function:: SUNErrCode SUNAdaptController_SetErrorBias(SUNAdaptController C, sunrealtype bias) @@ -277,15 +293,10 @@ note these requirements below. Additionally, we note the behavior of the base SU the default value for the controller. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c - - retval = SUNAdaptController_SetErrorBias(C, 1.2); .. c:function:: SUNErrCode SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, sunrealtype dsm) - Notifies a controller of type SUN_ADAPTCONTROLLER_H that a successful time step + 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 @@ -296,11 +307,24 @@ note these requirements below. Additionally, we note the behavior of the base SU :param dsm: the successful temporal error estimate. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - .. code-block:: c +.. c:function:: SUNErrCode SUNAdaptController_UpdateMRIHTol(SUNAdaptController C, sunrealtype H, sunrealtype tolfac, sunrealtype DSM, sunrealtype dsm) + + Notifies a controller of type :c:enumerator:`SUN_ADAPTCONTROLLER_MRI_H_TOL` that a successful time step + was taken with slow stepsize ``H`` and fast relative tolerance factor ``tolfac``, and that the + step had slow and fast local error factors ``DSM`` and ``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 slow step size. + :param tolfac: the successful fast time scale relative tolerance factor. + :param DSM: the successful slow temporal error estimate. + :param dsm: the successful fast temporal error estimate. + :return: :c:type:`SUNErrCode` indicating success or failure. + + .. versionadded:: x.y.z - retval = SUNAdaptController_UpdateH(C, h, dsm); .. c:function:: SUNErrCode SUNAdaptController_Space(SUNAdaptController C, long int *lenrw, long int *leniw) @@ -315,11 +339,6 @@ note these requirements below. Additionally, we note the behavior of the base SU `long int` words. :return: :c:type:`SUNErrCode` indicating success or failure. - Usage: - - .. code-block:: c - - retval = SUNAdaptController_Space(C, &lenrw, &leniw); diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst new file mode 100644 index 0000000000..5d1e4c4fc6 --- /dev/null +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst @@ -0,0 +1,215 @@ +.. + Programmer(s): Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.MRIHTol: + +The SUNAdaptController_MRIHTol Module +====================================== + +.. versionadded:: x.y.z + +Mathematical motivation +----------------------- + +The MRIHTol implementation of the SUNAdaptController class, +SUNAdaptController_MRIHTol, implements a general structure for telescopic +multirate temporal control. A SUNAdaptController_MRIHTol object is constructed +using two single-rate controller objects, *HControl* and *TolControl*. The +MRIHTol controller assumes that overall solution error at a given time scale +results from two types of error: + +#. "Slow" temporal errors introduced at the current time scale, + + .. math:: + \varepsilon^S_{n} = C(t_n) \left(h_n^S\right)^{P+1}, + :label: slow_error_assumption + + where :math:`C(t)` is independent of the current time scale step size :math:`h_n^S` + but may vary in time. + +#. "Fast" errors introduced through calls to the next-fastest ("inner") solver, + :math:`\varepsilon^F_{n}`. If this inner solver is called to evolve IVPs over + time intervals :math:`[t_{0,i}, t_{F,i}]` with a relative tolerance + :math:`\text{RTOL}_n^F`, then it will result in accumulated errors over these + intervals of the form + + .. math:: + \varepsilon^F_{n} = c(t_n) h_n^S \left(\text{RTOL}_n^F\right), + + where :math:`c(t)` is independent of the tolerance or subinterval width but may vary in + time, or equivalently, + + .. math:: + \varepsilon^F_{n} = \kappa(t_n) \left(\text{tolfac}_n^F\right), + :label: inner_solver_assumption + + where :math:`\text{RTOL}_n^F = \text{RTOL}^S \text{tolfac}_n^F`, + the relative tolerance that was supplied to the current time scale + solver is :math:`\text{RTOL}^S`, and + :math:`\kappa(t_n) = c(t_n) h_n^S \text{RTOL}^S` is + independent of the relative tolerance factor, :math:`\text{tolfac}_n^F`. + +Single-rate controllers are constructed to adapt a single parameter, e.g., +:math:`\delta`, under an assumption that solution error :math:`\varepsilon` depends +asymptotically on this parameter via the form + +.. math:: + \varepsilon = \mathcal{O}(\delta^{q+1}). + +Both :eq:`slow_error_assumption` and :eq:`inner_solver_assumption` fit this form, +with control parameters :math:`h_n^S` and :math:`\text{tolfac}^F_n`, and "orders" +:math:`P` and :math:`0`, respectively. Thus an MRIHTol controller employs +*HControl* to adapt :math:`h_n^S` to control the current time scale error +:math:`\varepsilon^S_n`, and it employs *TolControl* to adapt +:math:`\text{tolfac}_n^F` to control the accumulated inner solver error +:math:`\varepsilon^F_n`. + +To avoid overly large changes in calls to the inner solver, we apply bounds on the +results from *TolControl*. If *TolControl* predicts a control parameter +:math:`\text{tolfac}'`, we obtain the eventual tolerance factor via +enforcing the following bounds: + +.. math:: + \frac{\text{tolfac}_{n}^F}{\text{tolfac}'} &\le relch_{\text{max}},\\ + \frac{\text{tolfac}'}{\text{tolfac}_{n}^F} &\le relch_{\text{max}},\\ + \text{tolfac}_{min} &\le \text{tolfac}' \le \text{tolfac}_{max}. + +The default values for these bounds are :math:`relch_{\text{max}} = 20`, +:math:`\text{tolfac}_{min} = 10^{-5}`, and :math:`\text{tolfac}_{max} = 1`. + + +Implementation +-------------- + +The SUNAdaptController_MRIHTol controller is implemented as a derived +:c:type:`SUNAdaptController` class, and its *content* field is defined by +the :c:struct:`SUNAdaptControllerContent_MRIHTol_` structure: + +.. c:struct:: SUNAdaptControllerContent_MRIHTol_ + + The member data structure for an MRIHTol controller + + .. c:member:: SUNAdaptController HControl + + A single time-scale controller to adapt the current step size, :math:`h^S_n`. + + .. c:member:: SUNAdaptController TolControl + + A single time-scale controller to adapt the inner solver relative tolerance + factor, :math:`\text{reltol}^F_n`. + + .. c:member:: sunrealtype inner_max_relch + + The parameter :math:`relch_{\text{max}}` above. + + .. c:member:: sunrealtype inner_min_tolfac + + The parameter :math:`\text{tolfac}_{min}` above. + + .. c:member:: sunrealtype inner_max_tolfac + + The parameter :math:`\text{tolfac}_{max}` above. + +The header file to be included when using this module is +``sunadaptcontroller/sunadaptcontroller_mrihtol.h``. + +The SUNAdaptController_MRIHTol class provides implementations of all operations +relevant to a :c:enumerator:`SUN_ADAPTCONTROLLER_MRI_H_TOL` controller listed in +:numref:`SUNAdaptController.Description.operations`. This class +also provides the following additional user-callable routines: + + +.. c:function:: SUNAdaptController SUNAdaptController_MRIHTol(SUNAdaptController HControl, SUNAdaptController TolControl, SUNContext sunctx) + + This constructor creates and allocates memory for a SUNAdaptController_MRIHTol + object, and inserts its default parameters. + + :param HControl: the slow time step adaptivity controller object. + :param TolControl: the inner solver tolerance factor adaptivity controller object. + :param sunctx: the current :c:type:`SUNContext` object. + + :returns: if successful, a usable :c:type:`SUNAdaptController` object; + otherwise it will return ``NULL``. + + +.. c:function:: SUNErrCode SUNAdaptController_SetParams_MRIHTol(SUNAdaptController C, sunrealtype inner_max_relch, sunrealtype inner_min_tolfac, sunrealtype inner_max_tolfac) + + 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. If any argument is outside the allowable range, that parameter + will be reset to its default value. + + :param C: the SUNAdaptController_MRIHTol object. + :param inner_max_relch: the parameter :math:`relch_{\text{max}}` (must be :math:`\ge 1`). + :param inner_min_tolfac: the parameter :math:`\text{tolfac}_{min}` (must be :math:`> 0`). + :param inner_max_tolfac: the parameter :math:`\text{tolfac}_{max}` (must be :math:`> 0` and :math:`\le 1`). + + :returns: :c:type:`SUNErrCode` indicating success or failure. + + +Usage +----- + +Since this adaptivity controller is constructed using multiple single-rate adaptivity +controllers, there are a few steps required when setting this up in an application +(the steps below in *italics* correspond to the surrounding steps described in the +:ref:`MRIStep usage skeleton <ARKODE.Usage.MRIStep.Skeleton>`. + +#. *Create an inner stepper object to solve the fast (inner) IVP* + +#. Configure the inner stepper to use temporal adaptivity. For example, when using + an ARKODE inner stepper and the :c:func:`ARKodeCreateMRIStepInnerStepper` + function, then either use its default adaptivity approach or supply a + single-rate SUNAdaptController object, e.g. + + .. code:: C + + void* inner_arkode_mem = ERKStepCreate(f_f, T0, y, sunctx); + MRIStepInnerStepper inner_stepper = nullptr; + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + SUNAdaptController fcontrol = SUNAdaptController_PID(sunctx); + retval = ARKodeSetAdaptController(inner_arkode_mem, fcontrol); + +#. If using an ARKODE inner stepper, then set the desired temporal error accumulation + estimation strategy via a call to :c:func:`ARKodeSetAccumulatedErrorType`, e.g., + + .. code:: C + + retval = ARKodeSetAccumulatedErrorType(inner_arkode_mem, ARK_ACCUMERROR_MAX); + +#. *Create an MRIStep object for the slow (outer) integration* + +#. Create single-rate controllers for both the slow step size and inner solver + tolerance, e.g., + + .. code:: C + + SUNAdaptController scontrol_H = SUNAdaptController_PI(sunctx); + SUNAdaptController scontrol_Tol = SUNAdaptController_I(sunctx); + +#. Create the multirate controller object, e.g., + + .. code:: C + + SUNAdaptController scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + +#. Attach the multirate controller object to MRIStep, e.g., + + .. code:: C + + retval = ARKodeSetAdaptController(arkode_mem, scontrol); + +An example showing the above steps is provided in +``examples/arkode/CXX_serial/ark_kpr_nestedmri.cpp``, where multirate controller objects +are used for both the slow and intermediate time scales in a 3-time-scale simulation. diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index 8d3ccec6e6..bdd9f72079 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -1845,6 +1845,26 @@ @techreport{Fehlberg:69 year = {1969} } +@article{Fish:23, + title = {Adaptive time step control for multirate infinitesimal methods}, + volume = {45}, + doi = {10.1137/22M1479798}, + number = {2}, + journal = {SIAM Journal of Scientific Computing}, + author = {Fish, Alex C. and Reynolds, Daniel R.}, + year = {2023}, + pages = {A958--A984}, +} + +@article{Fish:24, + title = {Implicit–explicit multirate infinitesimal stage-restart methods}, + volume = {438}, + doi = {10.1016/j.cam.2023.115534}, + journal = {Journal of Computational and Applied Mathematics}, + author = {Fish, Alex C. and Reynolds, Daniel R. and Roberts, Steven B.}, + year = {2024}, + pages = {115534}, +} @article{giraldo2013implicit, title = {Implicit-explicit formulations of a three-dimensional nonhydrostatic unified model of the atmosphere (NUMA)}, @@ -1949,6 +1969,17 @@ @article{Kva:04 doi = {10.1023/B:BITN.0000046811.70614.38} } +@article{Luan:20, + title = {A new class of high-order methods for multirate differential equations}, + volume = {42}, + doi = {10.1137/19M125621X}, + number = {2}, + journal = {SIAM Journal of Scientific Computing}, + author = {Luan, Vu Thai and Chinomona, Rujeko and Reynolds, Daniel R.}, + year = {2020}, + pages = {A1245--A1268}, +} + @article{Mclachlan:92, author = {Mclachlan, Robert I AND Atela, Pau}, title = {The accuracy of symplectic integrators}, diff --git a/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst b/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst index 716fccb705..a3841b0376 100644 --- a/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst +++ b/doc/superbuild/source/sunadaptcontroller/SUNAdaptController_links.rst @@ -13,3 +13,4 @@ .. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_Description.rst .. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst .. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_ImExGus.rst +.. include:: ../../../shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 5dd2bbd43b..6b46ddd9b4 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -1044,8 +1044,8 @@ static int SetupMRI(SUNContext ctx, UserData* udata, N_Vector y, if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper - flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, stepper); - if (check_flag(&flag, "ARKStepCreateMRIStepInnerStepper", 1)) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, stepper); + if (check_flag(&flag, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } // ------------------------- // Setup the slow integrator 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 ae206aafd4..2ffc7a6d53 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 @@ -1,23 +1,23 @@ 2D Heat PDE test problem: - --------------------------------- + --------------------------------- nprocs = 4 npx = 2 npy = 2 - --------------------------------- + --------------------------------- Dux = 0.001 Duy = 0.001 Dvx = 0.001 Dvy = 0.001 A = 1 B = 3 - --------------------------------- + --------------------------------- tf = 10 xl = -0.5 xu = 0.5 yl = -0.5 yu = 0.5 - --------------------------------- + --------------------------------- nx = 128 ny = 128 dx = 0.0078125 @@ -28,7 +28,7 @@ ie (proc 0) = 63 je (proc 0) = 0 je (proc 0) = 63 - --------------------------------- + --------------------------------- rtol_slow = 0.0001 atol_slow = 1e-08 rtol_fast = 1e-05 @@ -38,39 +38,39 @@ fixed h fast = 0 controller = 0 linear = 1 - --------------------------------- + --------------------------------- linear solver = PCG lin iters = 10 eps lin = 0 prec = 1 msbp = 0 - --------------------------------- + --------------------------------- output = 1 - --------------------------------- + --------------------------------- - t ||u||_rms + t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+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 + 5.000000000000000e-01 3.136741760652099e+00 + 1.000000000000000e+00 3.125063175301384e+00 + 1.500000000000000e+00 3.152612863412849e+00 + 2.000000000000000e+00 3.252046440476493e+00 + 2.500000000000000e+00 3.404770348632562e+00 + 3.000000000000000e+00 3.570197872739926e+00 + 3.500000000000000e+00 3.699979354348030e+00 + 4.000000000000000e+00 3.694673808835031e+00 + 4.500000000000000e+00 3.628192806293943e+00 + 5.000000000000000e+00 3.475181810897179e+00 + 5.500000000000000e+00 3.343883397076133e+00 + 6.000000000000000e+00 3.234019997282326e+00 + 6.500000000000000e+00 3.082396794749013e+00 + 7.000000000000000e+00 2.890645249288640e+00 + 7.500000000000000e+00 2.837264083079534e+00 + 8.000000000000000e+00 2.898204488519986e+00 + 8.500000000000000e+00 3.140043990739560e+00 + 9.000000000000000e+00 3.442235032838624e+00 + 9.500000000000000e+00 3.740410563929244e+00 + 1.000000000000000e+01 4.014486664210758e+00 ---------------------------------------------- Final integrator statistics: @@ -80,20 +80,20 @@ Slow Integrator: RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 2633 - LS fails = 1 + LS iters = 2648 + LS fails = 0 LS setups = 0 - LS RHS evals = 2633 - Jv products = 2633 + LS RHS evals = 2648 + Jv products = 2648 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 6.648990 + Avg LS iters per NLS iter = 6.686869 Preconditioner setups = 0 - Preconditioner solves = 2633 + Preconditioner solves = 2648 Fast Integrator: Steps = 470 Step attempts = 470 Error test fails = 0 - RHS reaction = 1827 + RHS reaction = 1940 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 9b913a3b91..841bdda608 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 @@ -1,23 +1,23 @@ 2D Heat PDE test problem: - --------------------------------- + --------------------------------- nprocs = 4 npx = 2 npy = 2 - --------------------------------- + --------------------------------- Dux = 0.001 Duy = 0.001 Dvx = 0.001 Dvy = 0.001 A = 1 B = 3 - --------------------------------- + --------------------------------- tf = 10 xl = -0.5 xu = 0.5 yl = -0.5 yu = 0.5 - --------------------------------- + --------------------------------- nx = 128 ny = 128 dx = 0.0078125 @@ -28,7 +28,7 @@ ie (proc 0) = 63 je (proc 0) = 0 je (proc 0) = 63 - --------------------------------- + --------------------------------- rtol_slow = 0.0001 atol_slow = 1e-08 rtol_fast = 1e-05 @@ -38,39 +38,39 @@ fixed h fast = 0 controller = 0 linear = 1 - --------------------------------- + --------------------------------- linear solver = PCG lin iters = 10 eps lin = 0 prec = 1 msbp = 0 - --------------------------------- + --------------------------------- output = 1 - --------------------------------- + --------------------------------- - t ||u||_rms + t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+00 - 5.000000000000000e-01 3.136722629465066e+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.343640002216235e+00 - 6.000000000000000e+00 3.233844046127573e+00 - 6.500000000000000e+00 3.082251062694890e+00 - 7.000000000000000e+00 2.890585369424727e+00 - 7.500000000000000e+00 2.837315452756403e+00 - 8.000000000000000e+00 2.898424893360023e+00 - 8.500000000000000e+00 3.140291028418674e+00 - 9.000000000000000e+00 3.442457327179101e+00 - 9.500000000000000e+00 3.740600281376645e+00 - 1.000000000000000e+01 4.014633156501281e+00 + 5.000000000000000e-01 3.136722629482694e+00 + 1.000000000000000e+00 3.125057552043193e+00 + 1.500000000000000e+00 3.152636979427879e+00 + 2.000000000000000e+00 3.252085798917689e+00 + 2.500000000000000e+00 3.404791659743048e+00 + 3.000000000000000e+00 3.570175896142432e+00 + 3.500000000000000e+00 3.699871775695501e+00 + 4.000000000000000e+00 3.694354328938385e+00 + 4.500000000000000e+00 3.627867445226587e+00 + 5.000000000000000e+00 3.474857036434463e+00 + 5.500000000000000e+00 3.343639835515735e+00 + 6.000000000000000e+00 3.233843797982778e+00 + 6.500000000000000e+00 3.082250805521703e+00 + 7.000000000000000e+00 2.890585190235564e+00 + 7.500000000000000e+00 2.837315402792927e+00 + 8.000000000000000e+00 2.898424997635716e+00 + 8.500000000000000e+00 3.140291193581129e+00 + 9.000000000000000e+00 3.442457501250356e+00 + 9.500000000000000e+00 3.740600449220181e+00 + 1.000000000000000e+01 4.014633315935895e+00 ---------------------------------------------- Final integrator statistics: @@ -80,17 +80,17 @@ Slow Integrator: RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 2641 + LS iters = 2645 LS fails = 0 LS setups = 0 - LS RHS evals = 2641 - Jv products = 2641 + LS RHS evals = 2645 + Jv products = 2645 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 6.669192 + Avg LS iters per NLS iter = 6.679293 Preconditioner setups = 0 - Preconditioner solves = 2641 + Preconditioner solves = 2645 Fast Integrator: Steps = 2057 @@ -98,4 +98,3 @@ Fast Integrator: 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 0dd0389711..896e702868 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 @@ -1,23 +1,23 @@ 2D Heat PDE test problem: - --------------------------------- + --------------------------------- nprocs = 4 npx = 2 npy = 2 - --------------------------------- + --------------------------------- Dux = 0.001 Duy = 0.001 Dvx = 0.001 Dvy = 0.001 A = 1 B = 3 - --------------------------------- + --------------------------------- tf = 10 xl = -0.5 xu = 0.5 yl = -0.5 yu = 0.5 - --------------------------------- + --------------------------------- nx = 128 ny = 128 dx = 0.0078125 @@ -28,7 +28,7 @@ ie (proc 0) = 63 je (proc 0) = 0 je (proc 0) = 63 - --------------------------------- + --------------------------------- rtol_slow = 0.0001 atol_slow = 1e-08 rtol_fast = 1e-05 @@ -38,39 +38,39 @@ fixed h fast = 0 controller = 0 linear = 1 - --------------------------------- + --------------------------------- linear solver = PCG lin iters = 10 eps lin = 0 prec = 1 msbp = 0 - --------------------------------- + --------------------------------- output = 1 - --------------------------------- + --------------------------------- - t ||u||_rms + t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.172144385112383e+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.082406527906665e+00 - 7.000000000000000e+00 2.890736516064349e+00 - 7.500000000000000e+00 2.837432528460562e+00 - 8.000000000000000e+00 2.898441248595020e+00 - 8.500000000000000e+00 3.140256919387674e+00 - 9.000000000000000e+00 3.442407086782958e+00 - 9.500000000000000e+00 3.740539247767240e+00 - 1.000000000000000e+01 4.014559182371761e+00 + 5.000000000000000e-01 3.136728141568426e+00 + 1.000000000000000e+00 3.125054078969577e+00 + 1.500000000000000e+00 3.152605475502359e+00 + 2.000000000000000e+00 3.252022912635215e+00 + 2.500000000000000e+00 3.404698691374345e+00 + 3.000000000000000e+00 3.570053772321209e+00 + 3.500000000000000e+00 3.699720878679964e+00 + 4.000000000000000e+00 3.694158055925352e+00 + 4.500000000000000e+00 3.627712121494570e+00 + 5.000000000000000e+00 3.474734332229006e+00 + 5.500000000000000e+00 3.343606665593759e+00 + 6.000000000000000e+00 3.233915182257314e+00 + 6.500000000000000e+00 3.082406235095853e+00 + 7.000000000000000e+00 2.890736346480939e+00 + 7.500000000000000e+00 2.837432523592805e+00 + 8.000000000000000e+00 2.898441382813875e+00 + 8.500000000000000e+00 3.140257099040540e+00 + 9.000000000000000e+00 3.442407273754965e+00 + 9.500000000000000e+00 3.740539414769367e+00 + 1.000000000000000e+01 4.014559307692970e+00 ---------------------------------------------- Final integrator statistics: @@ -80,17 +80,17 @@ Slow Integrator: RHS diffusion = 792 NLS iters = 396 NLS fails = 0 - LS iters = 2630 + LS iters = 2625 LS fails = 0 LS setups = 0 - LS RHS evals = 2630 - Jv products = 2630 + LS RHS evals = 2625 + Jv products = 2625 Avg NLS iters per step attempt = 3.000000 - Avg LS iters per NLS iter = 6.641414 + Avg LS iters per NLS iter = 6.628788 Preconditioner setups = 0 - Preconditioner solves = 2630 + Preconditioner solves = 2625 Fast Integrator: Steps = 2002 @@ -98,4 +98,3 @@ Fast Integrator: RHS reaction = 4898 NLS iters = 3710 NLS fails = 0 - 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 ab2789c7ef..bf090c0020 100644 --- a/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp +++ b/examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp @@ -466,8 +466,8 @@ int main(int argc, char* argv[]) if (check_flag(&flag, "ARKodeSetMaxNumSteps", 1)) { return 1; } // Create inner stepper - flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_flag(&flag, "ARKStepCreateMRIStepInnerStepper", 1)) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_flag(&flag, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } // ----------------------------------------------- // Set up MRIStep slow integrator and set options 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 2a91f4f2ba..6a538dcc0e 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 @@ -1,10 +1,10 @@ 2D Heat PDE test problem: - --------------------------------- + --------------------------------- nprocs = 4 npx = 2 npy = 2 - --------------------------------- + --------------------------------- kx = 1 ky = 1 ax = 1 @@ -19,7 +19,7 @@ nyl (proc 0) = 32 dx = 0.015873 dy = 0.015873 - --------------------------------- + --------------------------------- rtol = 1e-05 atol = 1e-10 sorder = 3 @@ -28,30 +28,30 @@ hs = 0.001 controller = 0 linear = 0 - --------------------------------- + --------------------------------- lin iters = 10 eps lins = -1 prectype = 1 msbp = 0 pfmg_relax = 2 pfmg_nrelax = 2 - --------------------------------- + --------------------------------- output = 1 - --------------------------------- + --------------------------------- - t ||u||_rms + t ||u||_rms ---------------------------------------------- 0.000000000000000e+00 3.691406249999997e-01 - 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 + 1.000000000000000e-01 5.162014241945451e-02 + 2.000000000000000e-01 7.426100187258647e-03 + 3.000000000000000e-01 1.067221316468833e-03 + 4.000000000000000e-01 1.533638016725418e-04 + 5.000000000000000e-01 2.203889954707766e-05 + 6.000000000000000e-01 3.167064268521805e-06 + 7.000000000000000e-01 4.551178805378924e-07 + 7.999999999999999e-01 6.540199603786467e-08 + 8.999999999999999e-01 9.398525782926989e-09 + 1.000000000000000e+00 1.350608880521382e-09 ---------------------------------------------- Final slow integrator statistics: @@ -75,7 +75,7 @@ Final fast integrator statistics: Steps = 3003 Step attempts = 3003 Error test fails = 0 - RHS evals = 29862 + RHS evals = 30853 NLS iters = 17842 NLS fails = 0 LS iters = 10048 @@ -89,4 +89,3 @@ Final fast integrator statistics: Preconditioner setups = 0 Preconditioner solves = 0 PFMG iters = 10603 - diff --git a/examples/arkode/CXX_serial/CMakeLists.txt b/examples/arkode/CXX_serial/CMakeLists.txt index a8bdf871af..539fd7cc72 100644 --- a/examples/arkode/CXX_serial/CMakeLists.txt +++ b/examples/arkode/CXX_serial/CMakeLists.txt @@ -35,6 +35,7 @@ set(ARKODE_examples "ark_kpr_Mt.cpp\;2 4 0 -10 0\;develop" "ark_kpr_Mt.cpp\;0 4 0 -10 1 10 1\;develop" "ark_kpr_Mt.cpp\;0 4 0 -10 0 10 1\;develop" + "ark_kpr_nestedmri.cpp\;\;exclude-single" "ark_pendulum.cpp\;\;develop") # Header files to install diff --git a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp index 4ee2587c82..3423bc5c56 100644 --- a/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp +++ b/examples/arkode/CXX_serial/ark_advection_diffusion_reaction.cpp @@ -783,8 +783,8 @@ int SetupMRIARK(SUNContext ctx, UserData& udata, UserOptions& uopts, N_Vector y, if (check_flag(flag, "ARKodeSetMaxNumSteps")) { return 1; } // Wrap ARKODE as an MRIStepInnerStepper - flag = ARKStepCreateMRIStepInnerStepper(fast_arkode_mem, fast_mem); - if (check_flag(flag, "ARKStepCreateMRIStepInnerStepper")) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(fast_arkode_mem, fast_mem); + if (check_flag(flag, "ARKodeCreateMRIStepInnerStepper")) { return 1; } // ------------------------- // Setup the slow integrator diff --git a/examples/arkode/CXX_serial/ark_kpr_nestedmri.cpp b/examples/arkode/CXX_serial/ark_kpr_nestedmri.cpp new file mode 100644 index 0000000000..0a486a7a95 --- /dev/null +++ b/examples/arkode/CXX_serial/ark_kpr_nestedmri.cpp @@ -0,0 +1,2011 @@ +/* ---------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ---------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ---------------------------------------------------------------- + * Nested multirate nonlinear Kvaerno-Prothero-Robinson ODE test + * problem: + * + * [u]' = [ G e e ] [(u^2-p-2)/(2u)] + [ p'(t)/(2u) ] + * [v] [ e al be ] [(v^2-q-2)/(2v)] [ q'(t)/(2v) ] + * [w] [ e -be al ] [(w^2-r-2)/(2w)] [ r'(t)/(2w) ] + * + * where p(t) = 0.5*cos(t), q(t) = cos(om*t*(1+exp(-(t-2)^2))), + * and r(t) = cos(om*om*t*(1+exp(-(t-3)^2))). + * + * The first row corresponds to the slowest time scale; when an ImEx method is applied + * to this time scale, we set + * + * fsi = [ G e e ] [(u^2-p-2)/(2u)] + * [ 0 0 0 ] [(v^2-q-2)/(2v)] + * [ 0 0 0 ] [(w^2-r-2)/(2w)] + * + * fse = [ p'(t)/(2u) ] + * [ 0 ] + * [ 0 ] + * + * The second row corresponds to the intermediate time scale; when an ImEx method + * is applied to this time scale, we set + * + * fmi = [ 0 0 0 ] [(u^2-p-2)/(2u)] + * [ e al be ] [(v^2-q-2)/(2v)] + * [ 0 0 0 ] [(w^2-r-2)/(2w)] + * + * fme = [ 0 ] + * [ q'(t)/(2v) ] + * [ 0 ] + * + * The fast RHS is always just the full third row of the IVP. + * + * This problem has analytical solution given by + * u(t) = sqrt(2+p(t)), v(t) = sqrt(2+q(t)), w(t) = sqrt(2+r(t)). + * However, we use a reference solver here to assess performance + * of the local multirate adaptivity controller. + * + * This program allows a number of parameters: + * G: stiffness at slow time scale [default = -10] + * e: fast/slow coupling strength [default = 0.5] + * al,be: oscillatory coupling between v and w [default al = -1, be = 1] + * om: time-scale separation factor [default = 50] + * + * The stiffness of the slow time scale is essentially determined + * by G, for |G| > 50 it is 'stiff' and ideally suited to a + * multirate method that is implicit at the slow time scale. + * + * Coupling between the slow and faster components is determined by e, with + * coupling strength proportional to |e|. Coupling between the intermediate + * and fast components is determined by (al,be). + * + * The "intermediate" variable, v, oscillates at a frequency "om" times + * faster than u, and the "fast" variable, w, oscillates at a frequency + * "om" times faster than v. + * + * Additional input options may be used to select between various + * solver options: + * - slow fixed/initial step size: hs [default = 0.01] + * - intermediate fixed/initial step size: hm [default = 0.001] + * - fast fixed/initial step size: hf [default = 0.0001] + * - set initial adaptive step size as hs/hm/hf above: set_h0 [default 0] + * - relative solution tolerance: rtol [default = 1e-4] + * - absolute solution tolerance: atol [default = 1e-11] + * - relative solution tolerance for each fast integrator (as compared + * to next-slower integrator): fast_rtol [default = 1e-4] + * - use p (0) vs q (1) for slow and intermediate adaptivity: slow_pq [default = 0] + * - use p (0) vs q (1) for fast adaptivity: fast_pq [default = 0] + * - slow stepsize safety factor: safety [default = 0.96] + * - "slow" MRI method: mri_method [default = ARKODE_MRI_GARK_ERK45a] + * - "intermediate" MRI method: mid_method [default = ARKODE_MRI_GARK_ERK45a] + * - "fast" ERKStep method order: fast_order [default 4] + * - "slow" and "intermediate" MRI temporal adaptivity controllers: scontrol [default = 1] + * 0: no controller [fixed time steps] + * 1: I controller (as part of MRI-HTOL) + * 2: PI controller (as part of MRI-HTOL) + * 3: PID controller (as part of MRI-HTOL) + * 4: ExpGus controller (as part of MRI-HTOL) + * 5: ImpGus controller (as part of MRI-HTOL) + * 6: ImExGus controller (as part of MRI-HTOL) + * 7: I controller (alone) + * 8: PI controller (alone) + * 9: PID controller (alone) + * 10: ExpGus controller (alone) + * 11: ImpGus controller (alone) + * 12: ImExGus controller (alone) + * - "fast" ERKStep temporal adaptivity controller: fcontrol [default = 1] + * 0: no controller [fixed time steps] + * 1: I controller + * 2: PI controller + * 3: PID controller + * 4: ExpGus controller + * 5: ImpGus controller + * 6: ImExGus controller + * - "intermediate" and "fast" accumulated error type: faccum [default = 0] + * -1: no accumulation + * 0: maximum accumulation + * 1: additive accumulation + * 2: average accumulation + * - controller parameters: (k1s, k2s, k3s, k1f, k2f, k3f, + * bias, htol_relch, htol_minfac, htol_maxfac) + * slow and intermediate single-rate controllers: use k1s through k3s, + * as appropriate. fast single-rate controllers: use k1f through k3f, + * as appropriate. MRIHTol controllers: use htol_relch, htol_minfac, + * htol_maxfac. all controllers use bias. + * ** if any one of a relevant set are "-1" then the defaults are used + * + * Outputs and solution error values are printed at equal intervals + * of 0.5 and run statistics are printed at the end. + * ----------------------------------------------------------------*/ + +// Header files +#include <arkode/arkode_erkstep.h> // prototypes for ERKStep fcts., consts +#include <arkode/arkode_mristep.h> // prototypes for MRIStep fcts., consts +#include <cmath> +#include <cstdio> +#include <example_utilities.hpp> // common utility functions +#include <fstream> +#include <iomanip> +#include <iostream> +#include <nvector/nvector_serial.h> // serial N_Vector type, fcts., macros +#include <sunadaptcontroller/sunadaptcontroller_imexgus.h> +#include <sunadaptcontroller/sunadaptcontroller_mrihtol.h> +#include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> // dense linear solver +#include <sunmatrix/sunmatrix_dense.h> // dense matrix type, fcts., macros + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define ESYM "Le" +#define FSYM "Lf" +#else +#define ESYM "e" +#define FSYM "f" +#endif + +#define ZERO SUN_RCONST(0.0) +#define HALF SUN_RCONST(0.5) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define THREE SUN_RCONST(3.0) + +// Problem options +struct Options +{ + // Problem parameters + sunrealtype e = SUN_RCONST(0.5); + sunrealtype G = SUN_RCONST(-10.0); + sunrealtype om = SUN_RCONST(50.0); + sunrealtype al = SUN_RCONST(-1.0); + sunrealtype be = SUN_RCONST(1.0); + + // Step sizes and tolerances + int set_h0 = 0; + sunrealtype hs = SUN_RCONST(1.0e-2); + sunrealtype hm = SUN_RCONST(1.0e-3); + sunrealtype hf = SUN_RCONST(1.0e-4); + sunrealtype rtol = SUN_RCONST(1.0e-4); + sunrealtype atol = SUN_RCONST(1.0e-11); + sunrealtype fast_rtol = SUN_RCONST(1.0e-4); + + // Method selection + std::string mri_method = "ARKODE_MRI_GARK_ERK45a"; + std::string mid_method = "ARKODE_MRI_GARK_ERK45a"; + int fast_order = 4; + int scontrol = 1; + int fcontrol = 1; + int faccum = 0; + int slow_pq = 0; + int fast_pq = 0; + + // controller parameters + sunrealtype k1s = NAN; + sunrealtype k2s = NAN; + sunrealtype k3s = NAN; + sunrealtype k1f = NAN; + sunrealtype k2f = NAN; + sunrealtype k3f = NAN; + sunrealtype bias = NAN; + sunrealtype htol_relch = NAN; + sunrealtype htol_minfac = NAN; + sunrealtype htol_maxfac = NAN; + sunrealtype slow_safety = NAN; +}; + +// User-supplied functions called by the solver +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fmi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fme(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fm(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jm(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jmi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Utility functions +static void InputHelp(); +static int ReadInputs(std::vector<std::string>& args, Options& opts, + SUNContext ctx); +static void PrintSlowAdaptivity(Options opts); +static void PrintFastAdaptivity(Options opts); +static sunrealtype p(sunrealtype t, const Options& opts); +static sunrealtype q(sunrealtype t, const Options& opts); +static sunrealtype r(sunrealtype t, const Options& opts); +static sunrealtype pdot(sunrealtype t, const Options& opts); +static sunrealtype qdot(sunrealtype t, const Options& opts); +static sunrealtype rdot(sunrealtype t, const Options& opts); +static sunrealtype utrue(sunrealtype t, const Options& opts); +static sunrealtype vtrue(sunrealtype t, const Options& opts); +static sunrealtype wtrue(sunrealtype t, const Options& opts); +static int Ytrue(sunrealtype t, N_Vector y, const Options& opts); + +// Main Program +int main(int argc, char* argv[]) +{ + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Read input options + Options opts; + std::vector<std::string> args(argv + 1, argv + argc); + int flag = ReadInputs(args, opts, sunctx); + if (check_flag(flag, "ReadInputs")) return 1; + + // General problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(5.0); // final time + sunindextype NEQ = 3; // number of dependent vars. + int Nt = 20; // number of output times + + // Initial problem output + // While traversing these, set various function pointers, table constants, and method orders. + ARKRhsFn f_f, f_me, f_mi, f_se, f_si; + ARKLsJacFn J_s, J_m; + int retval; + sunbooleantype slowimplicit, slowimex, midimplicit, midimex; + slowimplicit = slowimex = midimplicit = midimex = SUNFALSE; + + f_mi = nullptr; + f_me = fm; + f_si = nullptr; + f_se = fs; + J_m = nullptr; + J_s = nullptr; + f_f = ff; + + if ((opts.mri_method == "ARKODE_MRI_GARK_IRK21a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK34a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + slowimplicit = SUNTRUE; + f_se = nullptr; + f_si = fs; + J_s = Js; + } + if ((opts.mri_method == "ARKODE_IMEX_MRI_SR21") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR32") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR43")) + { + slowimex = SUNTRUE; + slowimplicit = SUNTRUE; + f_se = fse; + f_si = fsi; + J_s = Jsi; + } + if ((opts.mid_method == "ARKODE_MRI_GARK_IRK21a") || + (opts.mid_method == "ARKODE_MRI_GARK_ESDIRK34a") || + (opts.mid_method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + midimplicit = SUNTRUE; + f_me = nullptr; + f_mi = fm; + J_m = Jm; + } + if ((opts.mid_method == "ARKODE_IMEX_MRI_SR21") || + (opts.mid_method == "ARKODE_IMEX_MRI_SR32") || + (opts.mid_method == "ARKODE_IMEX_MRI_SR43")) + { + midimex = SUNTRUE; + midimplicit = SUNTRUE; + f_me = fme; + f_mi = fmi; + J_m = Jmi; + } + std::cout + << "\nAdaptive nested multirate nonlinear Kvaerno-Prothero-Robinson test " + "problem:\n"; + std::cout << " time domain: (" << T0 << "," << Tf << "]\n"; + std::cout << " G = " << opts.G << std::endl; + std::cout << " e = " << opts.e << std::endl; + std::cout << " al = " << opts.al << std::endl; + std::cout << " be = " << opts.be << std::endl; + std::cout << " om = " << opts.om << std::endl; + std::cout << "\n Slow integrator: " << opts.mri_method; + if (slowimex) { std::cout << " (ImEx)" << std::endl; } + else if (slowimplicit) { std::cout << " (implicit)" << std::endl; } + else { std::cout << " (explicit)" << std::endl; } + std::cout << "\n Intermediate integrator: " << opts.mid_method; + if (midimex) { std::cout << " (ImEx)" << std::endl; } + else if (midimplicit) { std::cout << " (implicit)" << std::endl; } + else { std::cout << " (explicit)" << std::endl; } + PrintSlowAdaptivity(opts); + std::cout << "\n Fast order " << opts.fast_order << std::endl; + PrintFastAdaptivity(opts); + + // Create and initialize serial vectors for the solution and reference + N_Vector y = N_VNew_Serial(NEQ, sunctx); + if (check_ptr((void*)y, "N_VNew_Serial")) return 1; + N_Vector yref = N_VClone(y); + if (check_ptr((void*)yref, "N_VClone")) return 1; + + // Set initial conditions + retval = Ytrue(T0, y, opts); + if (check_flag(retval, "Ytrue")) return 1; + N_VScale(ONE, y, yref); + + // Create and configure reference solver object + void* arkode_ref = ERKStepCreate(fn, T0, yref, sunctx); + if (check_ptr((void*)arkode_ref, "ERKStepCreate")) return 1; + retval = ARKodeSetUserData(arkode_ref, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + retval = ARKodeSetOrder(arkode_ref, 5); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(arkode_ref, SUN_RCONST(1.e-10), SUN_RCONST(1.e-12)); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_ref, 10000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return (1); + + // Create and configure fast controller object + SUNAdaptController fcontrol = nullptr; + switch (opts.fcontrol) + { + case (1): + fcontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_I")) return 1; + if (!std::isnan(opts.k1f)) + { + retval = SUNAdaptController_SetParams_I(fcontrol, opts.k1f); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + case (2): + fcontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PI")) return 1; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + retval = SUNAdaptController_SetParams_PI(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + case (3): + fcontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PID")) return 1; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f) || std::isnan(opts.k3f))) + { + retval = SUNAdaptController_SetParams_PID(fcontrol, opts.k1f, opts.k2f, + opts.k3f); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + case (4): + fcontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ExpGus")) return 1; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + retval = SUNAdaptController_SetParams_ExpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + case (5): + fcontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImpGus")) return 1; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + retval = SUNAdaptController_SetParams_ImpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + case (6): + fcontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImExGus")) return 1; + break; + } + if (!std::isnan(opts.bias) && (opts.fcontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(fcontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create ERKStep (fast) integrator + void* inner_arkode_mem = ERKStepCreate(f_f, T0, y, sunctx); + if (check_ptr((void*)inner_arkode_mem, "ERKStepCreate")) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, opts.fast_order); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, opts.fast_rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + if (opts.fcontrol != 0) + { + retval = ARKodeSetAdaptController(inner_arkode_mem, fcontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.fast_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(inner_arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + ARKAccumError acc_type = ARK_ACCUMERROR_NONE; + if (opts.faccum == 0) { acc_type = ARK_ACCUMERROR_MAX; } + if (opts.faccum == 1) { acc_type = ARK_ACCUMERROR_SUM; } + if (opts.faccum == 2) { acc_type = ARK_ACCUMERROR_AVG; } + retval = ARKodeSetAccumulatedErrorType(inner_arkode_mem, acc_type); + if (check_flag(retval, "ARKodeSetAccumulatedErrorType")) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(inner_arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + + // Create inner stepper + MRIStepInnerStepper inner_stepper = nullptr; + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_flag(retval, "ARKodeCreateMRIStepInnerStepper")) return 1; + + // Create intermediate and slow controller objects, and select orders of accuracy as relevant + SUNAdaptController scontrol = nullptr; + SUNAdaptController scontrol_H = nullptr; + SUNAdaptController scontrol_Tol = nullptr; + SUNAdaptController mcontrol = nullptr; + SUNAdaptController mcontrol_H = nullptr; + SUNAdaptController mcontrol_Tol = nullptr; + switch (opts.scontrol) + { + case (1): + { + scontrol_H = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_I (slow H)")) return 1; + scontrol_Tol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_I (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_I(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_I (mid H)")) return 1; + mcontrol_Tol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_I (mid Tol)")) + return 1; + if (!std::isnan(opts.k1s)) + { + retval = SUNAdaptController_SetParams_I(scontrol_H, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(scontrol_Tol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(mcontrol_H, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(mcontrol_Tol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(mcontrol_H, mcontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (2): + { + scontrol_H = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PI (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PI (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_PI (mid H)")) return 1; + mcontrol_Tol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_PI (mid Tol)")) + return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_PI(scontrol_H, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(scontrol_Tol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(mcontrol_H, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(mcontrol_Tol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(mcontrol_H, mcontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (3): + { + scontrol_H = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PID (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PID (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_PID (mid H)")) + return 1; + mcontrol_Tol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_PID (mid Tol)")) + return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s) || std::isnan(opts.k3s))) + { + retval = SUNAdaptController_SetParams_PID(scontrol_H, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(scontrol_Tol, opts.k1s, + opts.k2s, opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(mcontrol_H, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(mcontrol_Tol, opts.k1s, + opts.k2s, opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(mcontrol_H, mcontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (4): + { + scontrol_H = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ExpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ExpGus (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_ExpGus (mid H)")) + return 1; + mcontrol_Tol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_ExpGus (mid Tol)")) + return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(mcontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(mcontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(mcontrol_H, mcontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (5): + { + scontrol_H = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImpGus (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_ImpGus (mid H)")) + return 1; + mcontrol_Tol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_ImpGus (mid Tol)")) + return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(mcontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(mcontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(mcontrol_H, mcontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (6): + { + scontrol_H = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImExGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImExGus (slow Tol)")) + return 1; + mcontrol_H = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)mcontrol_H, "SUNAdaptController_ImExGus (mid H)")) + return 1; + mcontrol_Tol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)mcontrol_Tol, "SUNAdaptController_ImExGus (mid Tol)")) + return 1; + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + mcontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_MRIHTol")) return 1; + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + retval = SUNAdaptController_SetParams_MRIHTol(mcontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + } + case (7): + { + scontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptControllerI (slow)")) return 1; + mcontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptControllerI (mid)")) return 1; + if (!std::isnan(opts.k1s)) + { + retval = SUNAdaptController_SetParams_I(scontrol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(mcontrol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + } + case (8): + { + scontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PI (slow)")) return 1; + mcontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_PI (mid)")) return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_PI(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(mcontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + } + case (9): + { + scontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PID (slow)")) return 1; + mcontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_PID (mid)")) return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s) || std::isnan(opts.k3s))) + { + retval = SUNAdaptController_SetParams_PID(scontrol, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(mcontrol, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + } + case (10): + { + scontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ExpGus (slow)")) + return 1; + mcontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_ExpGus (mid)")) return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(mcontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + } + case (11): + { + scontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImpGus (slow)")) + return 1; + mcontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)mcontrol, "SUNAdaptController_ImpGus (mid)")) return 1; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(mcontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + } + case (12): + { + scontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImExGus (slow)")) + return 1; + mcontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImExGus (mid)")) + return 1; + break; + } + } + if (!std::isnan(opts.bias) && (opts.scontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(scontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + retval = SUNAdaptController_SetErrorBias(mcontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create MRI (intermediate) integrator + void* mid_arkode_mem = MRIStepCreate(f_me, f_mi, T0, y, inner_stepper, sunctx); + if (check_ptr((void*)mid_arkode_mem, "MRIStepCreate")) return 1; + MRIStepCoupling Cm = MRIStepCoupling_LoadTableByName((opts.mid_method).c_str()); + if (check_ptr((void*)Cm, "MRIStepCoupling_LoadTableByName")) return 1; + retval = MRIStepSetCoupling(mid_arkode_mem, Cm); + if (check_flag(retval, "MRIStepSetCoupling")) return 1; + SUNMatrix Am = nullptr; // matrix for intermediate solver + SUNLinearSolver LSm = nullptr; // intermediate linear solver object + if (midimplicit) + { + Am = SUNDenseMatrix(NEQ, NEQ, sunctx); + if (check_ptr((void*)Am, "SUNDenseMatrix")) return 1; + LSm = SUNLinSol_Dense(y, Am, sunctx); + if (check_ptr((void*)LSm, "SUNLinSol_Dense")) return 1; + retval = ARKodeSetLinearSolver(mid_arkode_mem, LSm, Am); + if (check_flag(retval, "ARKodeSetLinearSolver")) return 1; + retval = ARKodeSetJacFn(mid_arkode_mem, J_m); + if (check_flag(retval, "ARKodeSetJacFn")) return 1; + } + retval = ARKodeSStolerances(mid_arkode_mem, opts.rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(mid_arkode_mem, 100000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetAccumulatedErrorType(mid_arkode_mem, acc_type); + if (check_flag(retval, "ARKodeSetAccumulatedErrorType")) return 1; + retval = ARKodeSetUserData(mid_arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + if (opts.scontrol != 0) + { + retval = ARKodeSetAdaptController(mid_arkode_mem, mcontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(mid_arkode_mem, opts.hm); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.slow_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(mid_arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + if (!std::isnan(opts.slow_safety)) + { + retval = ARKodeSetSafetyFactor(mid_arkode_mem, opts.slow_safety); + if (check_flag(retval, "ARKodeSetSafetyFactor")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(mid_arkode_mem, opts.hm); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + + // Create intermediate stepper + MRIStepInnerStepper intermediate_stepper = nullptr; + retval = ARKodeCreateMRIStepInnerStepper(mid_arkode_mem, &intermediate_stepper); + if (check_flag(retval, "ARKodeCreateMRIStepInnerStepper")) return 1; + + // Create MRI (slow) integrator + void* arkode_mem = MRIStepCreate(f_se, f_si, T0, y, intermediate_stepper, + sunctx); + if (check_ptr((void*)arkode_mem, "MRIStepCreate")) return 1; + MRIStepCoupling Cs = MRIStepCoupling_LoadTableByName((opts.mri_method).c_str()); + if (check_ptr((void*)Cs, "MRIStepCoupling_LoadTableByName")) return 1; + retval = MRIStepSetCoupling(arkode_mem, Cs); + if (check_flag(retval, "MRIStepSetCoupling")) return 1; + SUNMatrix As = nullptr; // matrix for slow solver + SUNLinearSolver LSs = nullptr; // slow linear solver object + if (slowimplicit) + { + As = SUNDenseMatrix(NEQ, NEQ, sunctx); + if (check_ptr((void*)As, "SUNDenseMatrix")) return 1; + LSs = SUNLinSol_Dense(y, As, sunctx); + if (check_ptr((void*)LSs, "SUNLinSol_Dense")) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_flag(retval, "ARKodeSetLinearSolver")) return 1; + retval = ARKodeSetJacFn(arkode_mem, J_s); + if (check_flag(retval, "ARKodeSetJacFn")) return 1; + } + retval = ARKodeSStolerances(arkode_mem, opts.rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + if (opts.scontrol != 0) + { + retval = ARKodeSetAdaptController(arkode_mem, scontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.slow_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + if (!std::isnan(opts.slow_safety)) + { + retval = ARKodeSetSafetyFactor(arkode_mem, opts.slow_safety); + if (check_flag(retval, "ARKodeSetSafetyFactor")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + + // + // Integrate ODE + // + + // Main time-stepping loop: calls ARKodeEvolve to perform the + // integration, then prints results. Stops when the final time + // has been reached + sunrealtype t = T0; + sunrealtype t2 = T0; + sunrealtype dTout = (Tf - T0) / Nt; + sunrealtype tout = T0 + dTout; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* yrefdata = N_VGetArrayPointer(yref); + sunrealtype u, v, w, uerr, verr, werr, uerrtot, verrtot, werrtot, errtot, + accuracy; + uerr = verr = werr = uerrtot = verrtot = werrtot = errtot = accuracy = ZERO; + printf(" t u v w uerr verr " + " werr\n"); + printf(" " + "---------------------------------------------------------------------" + "-------\n"); + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %.2" ESYM + " %.2" ESYM " %.2" ESYM "\n", + t, ydata[0], ydata[1], ydata[2], uerr, verr, werr); + while (Tf - t > SUN_RCONST(1.0e-8)) + { + // reset reference solver so that it begins with identical state + retval = ARKodeReset(arkode_ref, t, y); + + // evolve solution in one-step mode + retval = ARKodeSetStopTime(arkode_mem, tout); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_ONE_STEP); + if (retval < 0) + { + printf("ARKodeEvolve error (%i)\n", retval); + return 1; + } + + // evolve reference solver to same time in "normal" mode + retval = ARKodeSetStopTime(arkode_ref, t); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_ref, t, yref, &t2, ARK_NORMAL); + if (retval < 0) + { + printf("ARKodeEvolve reference solution error (%i)\n", retval); + return 1; + } + + // access/print solution and error + u = ydata[0]; + v = ydata[1]; + w = ydata[2]; + uerr = std::abs(yrefdata[0] - u); + verr = std::abs(yrefdata[1] - v); + werr = std::abs(yrefdata[2] - w); + uerrtot += uerr * uerr; + verrtot += verr * verr; + werrtot += werr * werr; + errtot += uerr * uerr + verr * verr + werr * werr; + accuracy = std::max(accuracy, + uerr / std::abs(opts.atol + opts.rtol * yrefdata[0])); + accuracy = std::max(accuracy, + verr / std::abs(opts.atol + opts.rtol * yrefdata[1])); + accuracy = std::max(accuracy, + werr / std::abs(opts.atol + opts.rtol * yrefdata[2])); + + // Periodically output current results to screen + if (t >= tout) + { + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM + " %.2" ESYM " %.2" ESYM " %.2" ESYM "\n", + t, u, v, w, uerr, verr, werr); + } + } + printf(" " + "---------------------------------------------------------------------" + "-------\n"); + + // + // Finalize + // + + // Get some slow integrator statistics + long int nsts, natts, netfs, nfse, nfsi, nifs; + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(arkode_mem, &natts); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netfs); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = MRIStepGetNumInnerStepperFails(arkode_mem, &nifs); + check_flag(retval, "MRIStepGetNumInnerStepperFails"); + + // Get some intermediate integrator statistics + long int nstm, nattm, netfm, nfme, nfmi, nifm; + retval = ARKodeGetNumSteps(mid_arkode_mem, &nstm); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(mid_arkode_mem, &nattm); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(mid_arkode_mem, &netfm); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(mid_arkode_mem, 0, &nfme); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = ARKodeGetNumRhsEvals(mid_arkode_mem, 1, &nfmi); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = MRIStepGetNumInnerStepperFails(mid_arkode_mem, &nifm); + check_flag(retval, "MRIStepGetNumInnerStepperFails"); + + // Get some fast integrator statistics + long int nstf, nattf, netff, nff; + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(inner_arkode_mem, &nattf); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(inner_arkode_mem, &netff); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_flag(retval, "ARKodeGetNumRhsEvals"); + + // Print some final statistics + uerrtot = std::sqrt(uerrtot / (sunrealtype)nsts); + verrtot = std::sqrt(verrtot / (sunrealtype)nsts); + werrtot = std::sqrt(werrtot / (sunrealtype)nsts); + errtot = std::sqrt(errtot / SUN_RCONST(3.0) / (sunrealtype)nsts); + std::cout << "\nFinal Solver Statistics:\n"; + std::cout << " Slow steps = " << nsts << " (attempts = " << natts + << ", fails = " << netfs << ", innerfails = " << nifs << ")\n"; + std::cout << " Intermediate steps = " << nstm << " (attempts = " << nattm + << ", fails = " << netfm << ", innerfails = " << nifm << ")\n"; + std::cout << " Fast steps = " << nstf << " (attempts = " << nattf + << ", fails = " << netff << ")\n"; + std::cout << " u error = " << uerrtot << ", v error = " << verrtot + << ", total error = " << errtot << std::endl; + std::cout << " Relative accuracy = " << accuracy << std::endl; + std::cout << " Total RHS evals: Fse = " << nfse << ", Fsi = " << nfsi + << ", Fme = " << nfme << ", Fmi = " << nfmi << ", Ff = " << nff + << std::endl; + + // Get/print slow integrator implicit solver statistics + if (slowimplicit) + { + long int nnis, nncs, njes; + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_flag(retval, "ARKodeGetNonlinSolvStats"); + retval = ARKodeGetNumJacEvals(arkode_mem, &njes); + check_flag(retval, "ARKodeGetNumJacEvals"); + std::cout << " Slow Newton iters = " << nnis << std::endl; + std::cout << " Slow Newton iters/attempt = " + << (sunrealtype)nnis / (sunrealtype)natts << std::endl; + std::cout << " Slow Newton conv fails = " << nncs << std::endl; + std::cout << " Slow Jacobian evals = " << njes << std::endl; + std::cout << " Slow Jacobian evals/Newton = " + << (sunrealtype)njes / (sunrealtype)nnis << std::endl; + } + + // Get/print intermediate integrator implicit solver statistics + if (midimplicit) + { + long int nnim, nncm, njem; + retval = ARKodeGetNonlinSolvStats(mid_arkode_mem, &nnim, &nncm); + check_flag(retval, "ARKodeGetNonlinSolvStats"); + retval = ARKodeGetNumJacEvals(mid_arkode_mem, &njem); + check_flag(retval, "ARKodeGetNumJacEvals"); + std::cout << " Intermediate Newton iters = " << nnim << std::endl; + std::cout << " Intermediate Newton iters/attempt = " + << (sunrealtype)nnim / (sunrealtype)nattm << std::endl; + std::cout << " Intermediate Newton conv fails = " << nncm << std::endl; + std::cout << " Intermediate Jacobian evals = " << njem << std::endl; + std::cout << " Intermediate Jacobian evals/Newton = " + << (sunrealtype)njem / (sunrealtype)nnim << std::endl; + } + + // Clean up and return + N_VDestroy(y); + N_VDestroy(yref); + MRIStepCoupling_Free(Cs); + MRIStepCoupling_Free(Cm); + SUNMatDestroy(As); + SUNLinSolFree(LSs); + SUNMatDestroy(Am); + SUNLinSolFree(LSm); + SUNAdaptController_Destroy(scontrol); + SUNAdaptController_Destroy(scontrol_H); + SUNAdaptController_Destroy(scontrol_Tol); + SUNAdaptController_Destroy(mcontrol); + SUNAdaptController_Destroy(mcontrol_H); + SUNAdaptController_Destroy(mcontrol_Tol); + SUNAdaptController_Destroy(fcontrol); + ARKodeFree(&inner_arkode_mem); // Free fast integrator memory + ARKodeFree(&mid_arkode_mem); // Free intermediate integrator memory + MRIStepInnerStepper_Free(&inner_stepper); // Free inner stepper structures + MRIStepInnerStepper_Free(&intermediate_stepper); + ARKodeFree(&arkode_mem); // Free slow integrator memory + ARKodeFree(&arkode_ref); // Free reference solver memory + + return 0; +} + +// ------------------------------ +// Functions called by the solver +// ----------------------------- + +// fn routine to compute the full ODE RHS. +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype G = opts->G; + const sunrealtype e = opts->e; + const sunrealtype al = opts->al; + const sunrealtype be = opts->be; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ G e e ] [(u^2-p-2)/(2u)] + [ pdot(t)/(2u) ] + // [ e al be ] [(v^2-q-2)/(2v)] [ qdot(t)/(2v) ] + // [ e -be al ] [(w^2-r-2)/(2w)] [ rdot(t)/(2w) ] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = G * tmp1 + e * tmp2 + e * tmp3 + pdot(t, *opts) / (TWO * u); + ydotdata[1] = e * tmp1 + al * tmp2 + be * tmp3 + qdot(t, *opts) / (TWO * v); + ydotdata[2] = e * tmp1 - be * tmp2 + al * tmp3 + rdot(t, *opts) / (TWO * w); + + // Return with success + return 0; +} + +// ff routine to compute the fast portion of the ODE RHS. +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype e = opts->e; + const sunrealtype al = opts->al; + const sunrealtype be = opts->be; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ 0 0 0 ] [(u^2-p-2)/(2u)] + [ 0 ] + // [ 0 0 0 ] [(v^2-q-2)/(2v)] [ 0 ] + // [ e -be al ] [(w^2-r-2)/(2w)] [ rdot(t)/(2w) ] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = ZERO; + ydotdata[1] = ZERO; + ydotdata[2] = e * tmp1 - be * tmp2 + al * tmp3 + rdot(t, *opts) / (TWO * w); + + // Return with success + return 0; +} + +// fm routine to compute the intermediate portion of the ODE RHS. +static int fm(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype e = opts->e; + const sunrealtype al = opts->al; + const sunrealtype be = opts->be; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ 0 0 0 ] [(u^2-p-2)/(2u)] + [ 0 ] + // [ e al be ] [(v^2-q-2)/(2v)] [ qdot(t)/(2v) ] + // [ 0 0 0 ] [(w^2-r-2)/(2w)] [ 0 ] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = ZERO; + ydotdata[1] = e * tmp1 + al * tmp2 + be * tmp3 + qdot(t, *opts) / (TWO * v); + ydotdata[2] = ZERO; + + return 0; +} + +// fme routine to compute the explicit intermediate portion of the ODE RHS. +static int fme(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype v = ydata[1]; + + // fill in the RHS function: + // [ 0 ] + // [ qdot(t)/(2v) ] + // [ 0 ] + ydotdata[0] = ZERO; + ydotdata[1] = qdot(t, *opts) / (TWO * v); + ydotdata[2] = ZERO; + + return 0; +} + +// fmi routine to compute the implicit intermediate portion of the ODE RHS. +static int fmi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype e = opts->e; + const sunrealtype al = opts->al; + const sunrealtype be = opts->be; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ 0 0 0 ] [(u^2-p-2)/(2u)] + // [ e al be ] [(v^2-q-2)/(2v)] + // [ 0 0 0 ] [(w^2-r-2)/(2w)] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = ZERO; + ydotdata[1] = e * tmp1 + al * tmp2 + be * tmp3; + ydotdata[2] = ZERO; + + // Return with success + return 0; +} + +// fs routine to compute the slow portion of the ODE RHS. +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype G = opts->G; + const sunrealtype e = opts->e; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ G e e ] [(u^2-p-2)/(2u)] + [ pdot(t)/(2u) ] + // [ 0 0 0 ] [(v^2-q-2)/(2v)] [ 0 ] + // [ 0 0 0 ] [(w^2-r-2)/(2w)] [ 0 ] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = G * tmp1 + e * tmp2 + e * tmp3 + pdot(t, *opts) / (TWO * u); + ydotdata[1] = ZERO; + ydotdata[2] = ZERO; + + return 0; +} + +// fse routine to compute the explicit slow portion of the ODE RHS. +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + + // fill in the RHS function: + // [ pdot(t)/(2u) ] + // [ 0 ] + // [ 0 ] + ydotdata[0] = pdot(t, *opts) / (TWO * u); + ydotdata[1] = ZERO; + ydotdata[2] = ZERO; + + return 0; +} + +// fsi routine to compute the implicit slow portion of the ODE RHS. +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ydotdata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + const sunrealtype G = opts->G; + const sunrealtype e = opts->e; + sunrealtype tmp1, tmp2, tmp3; + + // fill in the RHS function: + // [ G e e ] [(u^2-p-2)/(2u)] + // [ 0 0 0 ] [(v^2-q-2)/(2v)] + // [ 0 0 0 ] [(w^2-r-2)/(2w)] + tmp1 = (-TWO + u * u - p(t, *opts)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *opts)) / (TWO * v); + tmp3 = (-TWO + w * w - r(t, *opts)) / (TWO * w); + ydotdata[0] = G * tmp1 + e * tmp2 + e * tmp3; + ydotdata[1] = ZERO; + ydotdata[2] = ZERO; + + // Return with success + return 0; +} + +// Jacobian of fm +static int Jm(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + sunrealtype t11, t22, t33; + + // fill in the Jacobian: + // [0 0 0]*[1-(u^2-p(t)-2)/(2*u^2), 0, 0] + [0, 0, 0] + // [e al be] [0, 1-(v^2-q(t)-2)/(2*v^2), 0] [0, -q'(t)/(2*v^2), 0] + // [0 0 0] [0, 0, 1-(w^2-r(t)-2)/(2*w^2)] [0, 0, 0] + t11 = ONE - (u * u - p(t, *opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *opts) - TWO) / (TWO * v * v); + t33 = ONE - (w * w - r(t, *opts) - TWO) / (TWO * w * w); + SM_ELEMENT_D(J, 0, 0) = ZERO; + SM_ELEMENT_D(J, 0, 1) = ZERO; + SM_ELEMENT_D(J, 0, 2) = ZERO; + SM_ELEMENT_D(J, 1, 0) = opts->e * t11; + SM_ELEMENT_D(J, 1, 1) = opts->al * t22 - qdot(t, *opts) / (TWO * v * v); + SM_ELEMENT_D(J, 1, 2) = opts->be * t33; + SM_ELEMENT_D(J, 2, 0) = ZERO; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = ZERO; + + // Return with success + return 0; +} + +// Jacobian of fmi +static int Jmi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + sunrealtype t11, t22, t33; + + // fill in the Jacobian: + // [0 0 0]*[1-(u^2-p(t)-2)/(2*u^2), 0, 0] + // [e al be] [0, 1-(v^2-q(t)-2)/(2*v^2), 0] + // [0 0 0] [0, 0, 1-(w^2-r(t)-2)/(2*w^2)] + t11 = ONE - (u * u - p(t, *opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *opts) - TWO) / (TWO * v * v); + t33 = ONE - (w * w - r(t, *opts) - TWO) / (TWO * w * w); + SM_ELEMENT_D(J, 0, 0) = ZERO; + SM_ELEMENT_D(J, 0, 1) = ZERO; + SM_ELEMENT_D(J, 0, 2) = ZERO; + SM_ELEMENT_D(J, 1, 0) = opts->e * t11; + SM_ELEMENT_D(J, 1, 1) = opts->al * t22; + SM_ELEMENT_D(J, 1, 2) = opts->be * t33; + SM_ELEMENT_D(J, 2, 0) = ZERO; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = ZERO; + + // Return with success + return 0; +} + +// Jacobian of fs +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + sunrealtype t11, t22, t33; + + // fill in the Jacobian: + // [G e e]*[1-(u^2-p(t)-2)/(2*u^2), 0, 0] + [-p'(t)/(2*u^2), 0, 0] + // [0 0 0] [0, 1-(v^2-q(t)-2)/(2*v^2), 0] [0, 0, 0] + // [0 0 0] [0, 0, 1-(w^2-r(t)-2)/(2*w^2)] [0, 0, 0] + t11 = ONE - (u * u - p(t, *opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *opts) - TWO) / (TWO * v * v); + t33 = ONE - (w * w - r(t, *opts) - TWO) / (TWO * w * w); + SM_ELEMENT_D(J, 0, 0) = opts->G * t11 - pdot(t, *opts) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = opts->e * t22; + SM_ELEMENT_D(J, 0, 2) = opts->e * t33; + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + SM_ELEMENT_D(J, 1, 2) = ZERO; + SM_ELEMENT_D(J, 2, 0) = ZERO; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = ZERO; + + // Return with success + return 0; +} + +// Jacobian of fsi +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = static_cast<Options*>(user_data); + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + sunrealtype t11, t22, t33; + + // fill in the Jacobian: + // [G e e]*[1-(u^2-p(t)-2)/(2*u^2), 0, 0] + // [0 0 0] [0, 1-(v^2-q(t)-2)/(2*v^2), 0] + // [0 0 0] [0, 0, 1-(w^2-r(t)-2)/(2*w^2)] + t11 = ONE - (u * u - p(t, *opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *opts) - TWO) / (TWO * v * v); + t33 = ONE - (w * w - r(t, *opts) - TWO) / (TWO * w * w); + SM_ELEMENT_D(J, 0, 0) = opts->G * t11; + SM_ELEMENT_D(J, 0, 1) = opts->e * t22; + SM_ELEMENT_D(J, 0, 2) = opts->e * t33; + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + SM_ELEMENT_D(J, 1, 2) = ZERO; + SM_ELEMENT_D(J, 2, 0) = ZERO; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = ZERO; + + // Return with success + return 0; +} + +// ------------------------------ +// Private helper functions +// ----------------------------- + +static sunrealtype p(sunrealtype t, const Options& opts) +{ + return HALF * cos(t); +} + +static sunrealtype q(sunrealtype t, const Options& opts) +{ + return (cos(opts.om * t * (ONE + exp(-(t - TWO) * (t - TWO))))); +} + +static sunrealtype r(sunrealtype t, const Options& opts) +{ + return (cos(opts.om * opts.om * t * (ONE + exp(-(t - THREE) * (t - THREE))))); +} + +static sunrealtype pdot(sunrealtype t, const Options& opts) +{ + return -HALF * sin(t); +} + +static sunrealtype qdot(sunrealtype t, const Options& opts) +{ + const sunrealtype tTwo = t - TWO; + const sunrealtype eterm = exp(-tTwo * tTwo); + return (-sin(opts.om * t * (ONE + eterm)) * opts.om * + (ONE + eterm * (ONE - TWO * t * tTwo))); +} + +static sunrealtype rdot(sunrealtype t, const Options& opts) +{ + const sunrealtype tThree = t - THREE; + const sunrealtype eterm = exp(-tThree * tThree); + return (-sin(opts.om * opts.om * t * (ONE + eterm)) * opts.om * opts.om * + (ONE + eterm * (ONE - TWO * t * tThree))); +} + +static sunrealtype utrue(sunrealtype t, const Options& opts) +{ + return (std::sqrt(TWO + p(t, opts))); +} + +static sunrealtype vtrue(sunrealtype t, const Options& opts) +{ + return (std::sqrt(TWO + q(t, opts))); +} + +static sunrealtype wtrue(sunrealtype t, const Options& opts) +{ + return (std::sqrt(TWO + r(t, opts))); +} + +static int Ytrue(sunrealtype t, N_Vector y, const Options& opts) +{ + NV_Ith_S(y, 0) = utrue(t, opts); + NV_Ith_S(y, 1) = vtrue(t, opts); + NV_Ith_S(y, 2) = wtrue(t, opts); + return (0); +} + +// ----------------------------------------------------------------------------- +// Utility functions +// ----------------------------------------------------------------------------- + +// Print command line options +void InputHelp() +{ + std::cout << std::endl; + std::cout << "Command line options:" << std::endl; + std::cout << " --help : print options and exit\n"; + std::cout << " --G : stiffness at slow time scale\n"; + std::cout << " --e : fast/slow coupling strength\n"; + std::cout << " --al : med/fast oscillation term\n"; + std::cout << " --be : med/fast oscillation term\n"; + std::cout << " --om : time-scale separation factor\n"; + std::cout << " --hs : slow (fixed/initial) step size\n"; + std::cout << " --hm : intermediate (fixed/initial) step size\n"; + std::cout << " --hf : fast (fixed/initial) step size\n"; + std::cout + << " --set_h0 : use hs/hf above to set the initial step size\n"; + std::cout << " --rtol : relative solution tolerance\n"; + std::cout << " --atol : absolute solution tolerance\n"; + std::cout + << " --fast_rtol : relative solution tolerance for fast method\n"; + std::cout << " --safety : slow time step safety factor\n"; + std::cout + << " --mri_method : slow MRI method name (valid ARKODE_MRITableID)\n"; + std::cout << " --mid_method : intermediate MRI method name (valid " + "ARKODE_MRITableID)\n"; + std::cout << " --fast_order : fast RK method order\n"; + std::cout << " --scontrol : slow/intermediate time step controllers, " + "int in [0,12] " + "(see source)\n"; + std::cout << " --fcontrol : fast time step controller, int in [0,6] " + "(see source)\n"; + std::cout << " --faccum : fast error accumulation type {-1,0,1,2}\n"; + std::cout << " --slow_pq : use p (0) vs q (1) for slow/intermediate " + "adaptivity\n"; + std::cout << " --fast_pq : use p (0) vs q (1) for fast adaptivity\n"; + std::cout + << " --k1s, --k2s, -k3s : slow/intermediate controller parameters\n"; + std::cout << " --k1f, --k2f, -k3f : fast controller parameters\n"; + std::cout << " --bias : slow and fast controller bias factors\n"; + std::cout + << " --htol_relch : HTol controller maximum relative tolerance change\n"; + std::cout + << " --htol_minfac : HTol controller minimum relative tolerance factor\n"; + std::cout + << " --htol_maxfac : HTol controller maximum relative tolerance factor\n"; +} + +// Read input options +int ReadInputs(std::vector<std::string>& args, Options& opts, SUNContext ctx) +{ + if (find(args.begin(), args.end(), "--help") != args.end()) + { + InputHelp(); + return 1; + } + + // Problem options + find_arg(args, "--G", opts.G); + find_arg(args, "--e", opts.e); + find_arg(args, "--al", opts.al); + find_arg(args, "--be", opts.be); + find_arg(args, "--om", opts.om); + find_arg(args, "--hs", opts.hs); + find_arg(args, "--hm", opts.hm); + find_arg(args, "--hf", opts.hf); + find_arg(args, "--set_h0", opts.set_h0); + find_arg(args, "--rtol", opts.rtol); + find_arg(args, "--atol", opts.atol); + find_arg(args, "--fast_rtol", opts.fast_rtol); + find_arg(args, "--safety", opts.slow_safety); + find_arg(args, "--mri_method", opts.mri_method); + find_arg(args, "--mid_method", opts.mid_method); + find_arg(args, "--fast_order", opts.fast_order); + find_arg(args, "--scontrol", opts.scontrol); + find_arg(args, "--fcontrol", opts.fcontrol); + find_arg(args, "--faccum", opts.faccum); + find_arg(args, "--slow_pq", opts.slow_pq); + find_arg(args, "--fast_pq", opts.fast_pq); + find_arg(args, "--k1s", opts.k1s); + find_arg(args, "--k2s", opts.k2s); + find_arg(args, "--k3s", opts.k3s); + find_arg(args, "--k1f", opts.k1f); + find_arg(args, "--k2f", opts.k2f); + find_arg(args, "--k3f", opts.k3f); + find_arg(args, "--bias", opts.bias); + find_arg(args, "--htol_relch", opts.htol_relch); + find_arg(args, "--htol_minfac", opts.htol_minfac); + find_arg(args, "--htol_maxfac", opts.htol_maxfac); + + // Check inputs for validity + // 0 < rtol < 1 + if ((opts.rtol <= ZERO) || (opts.rtol >= ONE)) + { + std::cerr << "ERROR: rtol must be in (0,1), (" << opts.rtol << " input)\n"; + return -1; + } + // 0 < atol < 1 + if ((opts.atol <= ZERO) || (opts.atol >= ONE)) + { + std::cerr << "ERROR: atol must be in (0,1), (" << opts.atol << " input)\n"; + return -1; + } + // 0 < fast_rtol < 1 + if ((opts.fast_rtol <= ZERO) || (opts.fast_rtol >= ONE)) + { + std::cerr << "ERROR: fast_rtol must be in (0,1), (" << opts.fast_rtol + << " input)\n"; + return -1; + } + // 0 < fast_order + if (opts.fast_order <= 0) + { + std::cerr << "ERROR: fast_order must be at least 1, (" << opts.fast_order + << " input)\n"; + return -1; + } + // slow_pq in {0,1} + if ((opts.slow_pq < 0) || (opts.slow_pq > 1)) + { + std::cerr << "ERROR: slow_pq must be in {0,1}, (" << opts.slow_pq + << " input)\n"; + return -1; + } + // fast_pq in {0,1} + if ((opts.fast_pq < 0) || (opts.fast_pq > 1)) + { + std::cerr << "ERROR: fast_pq must be in {0,1}, (" << opts.fast_pq + << " input)\n"; + return -1; + } + // scontrol in [0,12] + if ((opts.scontrol < 0) || (opts.scontrol > 12)) + { + std::cerr << "ERROR: scontrol must be in [0,12], (" << opts.scontrol + << " input)\n"; + return -1; + } + // fcontrol in [0,6] + if ((opts.fcontrol < 0) || (opts.fcontrol > 6)) + { + std::cerr << "ERROR: fcontrol must be in [0,6], (" << opts.fcontrol + << " input)\n"; + return -1; + } + // hs > 0 and hm > 0 if scontrol == 0 + if (((opts.hs <= 0) || (opts.hm <= 0)) && (opts.scontrol == 0)) + { + std::cerr << "ERROR: positive hs required with scontrol = 0, (" << opts.hs + << " input)\n"; + return -1; + } + // hf > 0 if fcontrol == 0 + if ((opts.hf <= 0) && (opts.fcontrol == 0)) + { + std::cerr << "ERROR: positive hf required with fcontrol = 0, (" << opts.hf + << " input)\n"; + return -1; + } + // G < 0.0 + if (opts.G >= ZERO) + { + std::cerr << "ERROR: G must be a negative real number, (" << opts.G + << " input)\n"; + return -1; + } + // om >= 1.0 + if (opts.om < ONE) + { + std::cerr << "ERROR: w must be >= 1.0, (" << opts.om << " input)\n"; + return -1; + } + + return 0; +} + +static void PrintSlowAdaptivity(Options opts) +{ + switch (opts.scontrol) + { + case (0): + { + std::cout << " fixed steps, hs = " << opts.hs << ", hm = " << opts.hm + << std::endl; + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + } + case (1): + { + std::cout + << " MRI-HTOL controller (using I for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (!std::isnan(opts.k1s)) + { + std::cout << " slow/intermediate controller parameter: " << opts.k1s + << "\n"; + } + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + } + case (2): + { + std::cout + << " MRI-HTOL controller (using PI for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + } + case (3): + { + std::cout + << " MRI-HTOL controller (using PID for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s) || std::isnan(opts.k3s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << " " << opts.k3s << "\n"; + } + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + } + case (4): + { + std::cout + << " MRI-HTOL controller (using ExpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + } + case (5): + { + std::cout + << " MRI-HTOL controller (using ImpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + if (!(std::isnan(opts.htol_relch) || std::isnan(opts.htol_minfac) || + std::isnan(opts.htol_maxfac))) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + } + case (6): + { + std::cout + << " MRI-HTOL controller (using ImExGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + break; + } + case (7): + { + std::cout << " Decoupled I controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (!std::isnan(opts.k1s)) + { + std::cout << " slow/intermediate controller parameter: " << opts.k1s + << "\n"; + } + break; + } + case (8): + { + std::cout << " Decoupled PI controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + break; + } + case (9): + { + std::cout << " Decoupled PID controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s) || std::isnan(opts.k3s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << " " << opts.k3s << "\n"; + } + break; + } + case (10): + { + std::cout << " Decoupled ExpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + break; + } + case (11): + { + std::cout << " Decoupled ImpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1s) || std::isnan(opts.k2s))) + { + std::cout << " slow/intermediate controller parameters: " << opts.k1s + << " " << opts.k2s << "\n"; + } + break; + } + case (12): + { + std::cout << " Decoupled ImExGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + } + } + if (!std::isnan(opts.bias)) + { + std::cout << " controller bias factor: " << opts.bias << "\n"; + } + if (!std::isnan(opts.slow_safety)) + { + std::cout << " slow step safety factor: " << opts.slow_safety << "\n"; + } +} + +static void PrintFastAdaptivity(Options opts) +{ + switch (opts.fcontrol) + { + case (0): + { + std::cout << " fixed steps, hf = " << opts.hf << std::endl; + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + } + case (1): + { + std::cout << " I controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (!std::isnan(opts.k1f)) + { + std::cout << " fast controller parameter: " << opts.k1f << "\n"; + } + break; + } + case (2): + { + std::cout << " PI controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + } + case (3): + { + std::cout << " PID controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f) || std::isnan(opts.k3f))) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << " " << opts.k3f << "\n"; + } + break; + } + case (4): + { + std::cout + << " ExpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + } + case (5): + { + std::cout + << " ImpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (!(std::isnan(opts.k1f) || std::isnan(opts.k2f))) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + } + case (6): + { + std::cout + << " ImExGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + } + } +} + +//---- end of file ----// diff --git a/examples/arkode/CXX_serial/ark_kpr_nestedmri.out b/examples/arkode/CXX_serial/ark_kpr_nestedmri.out new file mode 100644 index 0000000000..bc66d480bc --- /dev/null +++ b/examples/arkode/CXX_serial/ark_kpr_nestedmri.out @@ -0,0 +1,51 @@ + +Adaptive nested multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + G = -10 + e = 0.5 + al = -1 + be = 1 + om = 50 + + Slow integrator: ARKODE_MRI_GARK_ERK45a (explicit) + + Intermediate integrator: ARKODE_MRI_GARK_ERK45a (explicit) + MRI-HTOL controller (using I for H) based on order of MRI embedding + rtol = 0.0001, atol = 1e-11 + fast error accumulation strategy = 0 + + Fast order 4 + I controller for fast time scale, based on order of RK embedding + fast_rtol = 0.0001, atol = 1e-11 + t u v w uerr verr werr + ---------------------------------------------------------------------------- + 0.000000 1.581139 1.732051 1.732051 0.00e+00 0.00e+00 0.00e+00 + 0.250000 1.576193 1.693804 1.005260 3.23e-06 1.18e-04 7.57e-05 + 0.500000 1.561425 1.094399 1.236935 2.15e-08 1.54e-05 2.85e-05 + 0.750000 1.537204 1.480202 1.289772 8.95e-04 1.47e-04 2.43e-04 + 1.000000 1.506472 1.658437 1.566267 2.26e-07 2.27e-05 1.87e-05 + 1.250000 1.468674 1.117329 1.128753 4.45e-06 8.37e-05 5.27e-06 + 1.500000 1.426602 1.451384 1.383651 1.49e-07 4.03e-06 2.37e-05 + 1.750000 1.382272 1.731275 1.400561 3.01e-05 6.40e-05 1.96e-04 + 2.000000 1.338548 1.576713 1.004568 1.72e-05 4.85e-05 3.52e-04 + 2.250000 1.298433 1.357466 1.203013 3.98e-06 7.57e-06 1.04e-04 + 2.500000 1.264637 1.111610 1.079957 3.74e-07 2.59e-05 3.61e-04 + 2.750000 1.240344 1.181466 1.688515 2.92e-06 3.40e-06 6.04e-05 + 3.000000 1.226753 1.199667 1.243892 3.15e-06 2.39e-06 5.78e-05 + 3.250000 1.225940 1.337036 1.695808 8.05e-05 2.56e-05 5.93e-05 + 3.500000 1.237625 1.494269 1.577837 3.48e-05 1.55e-06 2.09e-05 + 3.750000 1.261615 1.441503 1.440542 1.35e-07 1.70e-08 6.25e-06 + 4.000000 1.293574 1.067975 1.718719 4.77e-05 2.22e-05 1.30e-04 + 4.250000 1.333622 1.725039 1.003950 1.49e-11 6.53e-14 5.93e-10 + 4.500000 1.376484 1.650381 1.499914 2.63e-08 1.70e-06 6.88e-07 + 4.750000 1.420897 1.555399 1.167629 4.82e-08 1.80e-08 5.03e-06 + 5.000000 1.463498 1.506851 1.644668 7.85e-07 1.26e-05 2.66e-05 + ---------------------------------------------------------------------------- + +Final Solver Statistics: + Slow steps = 47 (attempts = 48, fails = 1, innerfails = 0) + Intermediate steps = 714 (attempts = 868, fails = 154, innerfails = 0) + Fast steps = 129455 (attempts = 144940, fails = 15485) + u error = 0.000228112, v error = 8.70956e-05, total error = 0.000169225 + Relative accuracy = 6.75352 + Total RHS evals: Fse = 240, Fsi = 0, Fme = 4234, Fmi = 0, Ff = 709264 diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index de26c61e18..382a9f957c 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -62,20 +62,21 @@ set(ARKODE_examples "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_RUTH_3_3 --tf 50 --check-order --nout 1\;exclude-single" "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_YOSHIDA_6_8 --tf 50 --check-order --nout 1\;exclude-single" "ark_kepler\;\;develop" - "ark_kpr_mri\;\;develop" - "ark_kpr_mri\;0 0.002\;develop" - "ark_kpr_mri\;1 0.002\;develop" - "ark_kpr_mri\;2 0.005\;develop" - "ark_kpr_mri\;3 0.01\;develop" - "ark_kpr_mri\;4 0.002\;develop" - "ark_kpr_mri\;5 0.002\;develop" - "ark_kpr_mri\;6 0.005\;develop" - "ark_kpr_mri\;7 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;7 0.001\;exclude-single" - "ark_kpr_mri\;8 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;8 0.001\;exclude-single" - "ark_kpr_mri\;9 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;9 0.001\;exclude-single" + "ark_kpr_mri\;0 1 0.005\;develop" + "ark_kpr_mri\;1 0 0.01\;develop" + "ark_kpr_mri\;1 1 0.002\;exclude-single" + "ark_kpr_mri\;2 4 0.002\;develop" + "ark_kpr_mri\;3 2 0.001\;develop" + "ark_kpr_mri\;4 3 0.001\;develop" + "ark_kpr_mri\;5 4 0.001\;develop" + "ark_kpr_mri\;6 5 0.001\;develop" + "ark_kpr_mri\;7 2 0.002\;develop" + "ark_kpr_mri\;8 3 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;9 3 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;10 4 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;11 2 0.001\;develop" + "ark_kpr_mri\;12 3 0.005\;develop" + "ark_kpr_mri\;13 4 0.01\;exclude-single" "ark_KrylovDemo_prec\;\;exclude-single" "ark_KrylovDemo_prec\;1\;exclude-single" "ark_KrylovDemo_prec\;2\;exclude-single" diff --git a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c index a779faeb04..03bc844e73 100644 --- a/examples/arkode/C_serial/ark_brusselator1D_imexmri.c +++ b/examples/arkode/C_serial/ark_brusselator1D_imexmri.c @@ -523,11 +523,8 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options 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 cadd7e5310..e1abd55567 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 = 864983 + Total RHS evals: Fs = 30004, Ff = 874975 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 d8f1801e46..39c475b902 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 = 360046 + Total RHS evals: Fs = 68887, Ff = 370038 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 0e3c13961a..89bbf34f58 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 = 840121 + Total RHS evals: Fs = 68887, Ff = 850113 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 7059273d48..dce0ab719d 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 = 330043 + Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 340035 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 827c560b02..e8a70f3986 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 = 1024335 + Total RHS evals: Fse = 40005, Fsi = 78888, Ff = 1034327 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 79287bd749..4dba64aaf9 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 = 520062 + Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 530054 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 c8dd757582..0ebb4a0a14 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 = 1936011 + Total RHS evals: Fse = 60007, Fsi = 118894, Ff = 1946003 Slow Newton iters = 58887 Slow Newton conv fails = 0 Slow Jacobian evals = 501 diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.c b/examples/arkode/C_serial/ark_brusselator_1D_mri.c index 0dc4323bc3..b5379d12f8 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.c @@ -248,11 +248,8 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options diff --git a/examples/arkode/C_serial/ark_brusselator_1D_mri.out b/examples/arkode/C_serial/ark_brusselator_1D_mri.out index b1968f6e9d..4442e9e3f9 100644 --- a/examples/arkode/C_serial/ark_brusselator_1D_mri.out +++ b/examples/arkode/C_serial/ark_brusselator_1D_mri.out @@ -112,7 +112,7 @@ Final Solver Statistics: Slow Steps: nsts = 1001 Fast Steps: nstf = 3171 (attempted = 3171) - Total RHS evals: Fs = 3004, Ff = 30611 + Total RHS evals: Fs = 3004, Ff = 31513 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_mri.c b/examples/arkode/C_serial/ark_brusselator_mri.c index 67d2c57b80..2f1cc006c1 100644 --- a/examples/arkode/C_serial/ark_brusselator_mri.c +++ b/examples/arkode/C_serial/ark_brusselator_mri.c @@ -147,11 +147,8 @@ int main(void) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options diff --git a/examples/arkode/C_serial/ark_brusselator_mri.out b/examples/arkode/C_serial/ark_brusselator_mri.out index 602c2e4177..a9115a8c9e 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 = 6581 + Total RHS evals: Fs = 244, Ff = 6643 diff --git a/examples/arkode/C_serial/ark_kpr_mri.c b/examples/arkode/C_serial/ark_kpr_mri.c index f119998632..55f3dd3425 100644 --- a/examples/arkode/C_serial/ark_kpr_mri.c +++ b/examples/arkode/C_serial/ark_kpr_mri.c @@ -34,33 +34,42 @@ * by G, for |G| > 50 it is 'stiff' and ideally suited to a * multirate method that is implicit at the slow time scale. * - * We select the MRI method to use based on an additional input, - * solve_type; with options (slow type-order/fast type-order): - * 0. exp-3/exp-3 (standard MIS) [default] - * 1. none/exp-3 (no slow, explicit fast) - * 2. none/dirk-3 (no slow, dirk fast) - * 3. exp-3/none (explicit slow, no fast) - * 4. dirk-2/none (dirk slow, no fast) -- solve-decoupled - * 5. exp-4/exp-4 (MRI-GARK-ERK45a / ERK-4-4) - * 6. exp-4/exp-3 (MRI-GARK-ERK45a / ERK-3-3) - * 7. dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve decoupled - * 8. ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled - * 9. imexark4/exp-4 (IMEX-MRI4/ ERK-4-4) -- solve decoupled + * We select the MRI method to use based on additional inputs: * - * We note that once we have methods that are IMEX at the slow time - * scale, the nonstiff slow term, [ r'(t)/(2u) ], can be treated - * explicitly. + * slow_type: + * 0 - none (full problem at fast scale) + * 1 - ARKODE_MIS_KW3 + * 2 - ARKODE_MRI_GARK_ERK45a + * 3 - ARKODE_MERK21 + * 4 - ARKODE_MERK32 + * 5 - ARKODE_MERK43 + * 6 - ARKODE_MERK54 + * 7 - ARKODE_MRI_GARK_IRK21a + * 8 - ARKODE_MRI_GARK_ESDIRK34a + * 9 - ARKODE_IMEX_MRI_GARK3b + * 10 - ARKODE_IMEX_MRI_GARK4 + * 11 - ARKODE_IMEX_MRI_SR21 + * 12 - ARKODE_IMEX_MRI_SR32 + * 13 - ARKODE_IMEX_MRI_SR43 * + * fast_type: + * 0 - none (full problem at slow scale) + * 1 - esdirk-3-3 (manually entered non-embedded table) + * 2 - ARKODE_HEUN_EULER_2_1_2 + * 3 - erk-3-3 (manually entered non-embedded table) + * 4 - erk-4-4 (manually entered non-embeded table) + * 5 - ARKODE_DORMAND_PRINCE_7_4_5 + * * The program should be run with arguments in the following order: - * $ a.out solve_type h G w e deduce + * $ ark_kpr_mri slow_type fast_type h G w e deduce_rhs * Not all arguments are required, but these must be omitted from * end-to-beginning, i.e. any one of - * $ a.out solve_type h G w e - * $ a.out solve_type h G w - * $ a.out solve_type h G - * $ a.out solve_type h - * $ a.out solve_type - * $ a.out + * $ ark_kpr_mri slow_type fast_type h G w e deduce_rhs + * $ ark_kpr_mri slow_type fast_type h G w e + * $ ark_kpr_mri slow_type fast_type h G w + * $ ark_kpr_mri slow_type fast_type h G + * $ ark_kpr_mri slow_type fast_type h + * $ ark_kpr_mri slow_type fast_type * are acceptable. We require: * * 0 <= solve_type <= 9 * * 0 < h < 1/|G| @@ -109,6 +118,8 @@ static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); /* Private function to check function return values */ static sunrealtype r(sunrealtype t, void* user_data); @@ -131,7 +142,8 @@ int main(int argc, char* argv[]) sunrealtype dTout = SUN_RCONST(0.1); /* time between outputs */ sunindextype NEQ = 2; /* number of dependent vars. */ int Nt = (int)ceil(Tf / dTout); /* number of output times */ - int solve_type = 0; /* problem configuration type */ + int slow_type = 0; /* problem configuration type */ + int fast_type = 0; /* problem configuration type */ sunrealtype hs = SUN_RCONST(0.01); /* slow step size */ sunrealtype e = SUN_RCONST(0.5); /* fast/slow coupling strength */ sunrealtype G = SUN_RCONST(-100.0); /* stiffness at slow time scale */ @@ -151,9 +163,14 @@ int main(int argc, char* argv[]) SUNLinearSolver LSf = NULL; /* fast linear solver object */ SUNMatrix As = NULL; /* matrix for slow solver */ SUNLinearSolver LSs = NULL; /* slow linear solver object */ - sunbooleantype implicit_slow; - sunbooleantype imex_slow = SUNFALSE; - sunbooleantype deduce = SUNFALSE; + sunbooleantype implicit_slow = SUNFALSE; + sunbooleantype imex_slow = SUNFALSE; + sunbooleantype explicit_slow = SUNFALSE; + sunbooleantype no_slow = SUNFALSE; + sunbooleantype implicit_fast = SUNFALSE; + sunbooleantype explicit_fast = SUNFALSE; + sunbooleantype no_fast = SUNFALSE; + sunbooleantype deduce_rhs = SUNFALSE; FILE* UFID; sunrealtype hf, gamma, beta, t, tout, rpar[3]; sunrealtype uerr, verr, uerrtot, verrtot, errtot; @@ -164,36 +181,55 @@ int main(int argc, char* argv[]) * Initialization */ - /* Retrieve the command-line options: solve_type h G w e */ - if (argc > 1) { solve_type = (sunindextype)atol(argv[1]); } - if (argc > 2) { hs = SUNStrToReal(argv[2]); } - if (argc > 3) { G = SUNStrToReal(argv[3]); } - if (argc > 4) { w = SUNStrToReal(argv[4]); } - if (argc > 5) { e = SUNStrToReal(argv[5]); } - if (argc > 6) { deduce = (sunbooleantype)atoi(argv[6]); } + /* Retrieve the command-line options: slow_type fast_type h G w e deduce_rhs */ + if (argc < 3) + { + printf("ERROR: executable requires at least two arguments [slow_type " + "fast_type]\n"); + printf("Usage:\n"); + printf(" ark_kpr_mri slow_type fast_type h G w e deduce_rhs"); + return (-1); + } + slow_type = atoi(argv[1]); + fast_type = atoi(argv[2]); + if (argc > 3) { hs = SUNStrToReal(argv[3]); } + if (argc > 4) { G = SUNStrToReal(argv[4]); } + if (argc > 5) { w = SUNStrToReal(argv[5]); } + if (argc > 6) { e = SUNStrToReal(argv[6]); } + if (argc > 7) { deduce_rhs = (sunbooleantype)atoi(argv[7]); } /* Check arguments for validity */ - /* 0 <= solve_type <= 9 */ + /* 0 <= slow_type <= 13 */ + /* 0 <= fast_type <= 5 */ /* G < 0.0 */ /* h > 0 */ /* h < 1/|G| (explicit slow) */ /* w >= 1.0 */ - if ((solve_type < 0) || (solve_type > 9)) + if ((slow_type < 0) || (slow_type > 13)) { - printf("ERROR: solve_type be an integer in [0,9] \n"); + printf("ERROR: slow_type be an integer in [0,13] \n"); return (-1); } - if (G >= ZERO) + if ((fast_type < 0) || (fast_type > 5)) { - printf("ERROR: G must be a negative real number\n"); + printf("ERROR: fast_type be an integer in [0,5] \n"); return (-1); } - implicit_slow = SUNFALSE; - if ((solve_type == 4) || (solve_type == 7)) { implicit_slow = SUNTRUE; } - if ((solve_type == 8) || (solve_type == 9)) + if ((slow_type == 0) && (fast_type == 0)) { - implicit_slow = SUNTRUE; - imex_slow = SUNTRUE; + printf("ERROR: at least one of slow_type and fast_type must be nonzero\n"); + return (-1); + } + if ((slow_type >= 9) && (fast_type == 0)) + { + printf("ERROR: example not configured for ImEx slow solver with no fast " + "solver\n"); + return (-1); + } + if (G >= ZERO) + { + printf("ERROR: G must be a negative real number\n"); + return (-1); } if (hs <= ZERO) { @@ -223,51 +259,114 @@ int main(int argc, char* argv[]) printf(" G = %" GSYM "\n", G); printf(" w = %" GSYM "\n", w); printf(" e = %" GSYM "\n", e); - switch (solve_type) + switch (slow_type) { - case (0): printf(" solver: exp-3/exp-3 (standard MIS)\n\n"); break; + case (0): + printf(" slow solver: none\n"); + no_slow = SUNTRUE; + break; case (1): - printf(" solver: none/exp-3 (no slow, explicit fast)\n\n"); + printf(" slow solver: ARKODE_MIS_KW3\n"); + explicit_slow = SUNTRUE; break; case (2): - reltol = SUNMAX(hs * hs * hs, 1e-10); - abstol = 1e-11; - printf(" solver: none/dirk-3 (no slow, dirk fast)\n\n"); - printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + printf(" slow solver: ARKODE_MRI_GARK_ERK45a\n"); + explicit_slow = SUNTRUE; + break; + case (3): + printf(" slow solver: ARKODE_MERK21\n"); + explicit_slow = SUNTRUE; break; - case (3): printf(" solver: exp-3/none (explicit slow, no fast)\n"); break; case (4): - reltol = SUNMAX(hs * hs, 1e-10); - abstol = 1e-11; - printf(" solver: dirk-2/none (dirk slow, no fast)\n"); - printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + printf(" slow solver: ARKODE_MERK32\n"); + explicit_slow = SUNTRUE; break; case (5): - printf(" solver: exp-4/exp-4 (MRI-GARK-ERK45a / ERK-4-4)\n\n"); + printf(" slow solver: ARKODE_MERK43\n"); + explicit_slow = SUNTRUE; break; case (6): - printf(" solver: exp-4/exp-3 (MRI-GARK-ERK45a / ERK-3-3)\n\n"); + printf(" slow solver: ARKODE_MERK54\n"); + explicit_slow = SUNTRUE; break; case (7): - reltol = SUNMAX(hs * hs * hs, 1e-10); - abstol = 1e-11; - printf(" solver: dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve " - "decoupled\n"); - printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + printf(" slow solver: ARKODE_MRI_GARK_IRK21a\n"); + implicit_slow = SUNTRUE; + reltol = SUNMAX(hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); break; case (8): - reltol = SUNMAX(hs * hs * hs, 1e-10); - abstol = 1e-11; - printf( - " solver: ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled\n"); - printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + printf(" slow solver: ARKODE_MRI_GARK_ESDIRK34a\n"); + implicit_slow = SUNTRUE; + reltol = SUNMAX(hs * hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); break; case (9): - reltol = SUNMAX(hs * hs * hs * hs, 1e-14); - abstol = 1e-14; - printf( - " solver: imexark4/exp-4 (IMEX-MRI4 / ERK-4-4) -- solve decoupled\n"); - printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + printf(" slow solver: ARKODE_IMEX_MRI_GARK3b\n"); + imex_slow = SUNTRUE; + reltol = SUNMAX(hs * hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + case (10): + printf(" slow solver: ARKODE_IMEX_MRI_GARK4\n"); + imex_slow = SUNTRUE; + reltol = SUNMAX(hs * hs * hs * hs, 1e-14); + abstol = 1e-14; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + case (11): + printf(" slow solver: ARKODE_IMEX_MRI_SR21\n"); + imex_slow = SUNTRUE; + reltol = SUNMAX(hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + case (12): + printf(" slow solver: ARKODE_IMEX_MRI_SR32\n"); + imex_slow = SUNTRUE; + reltol = SUNMAX(hs * hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + case (13): + printf(" slow solver: ARKODE_IMEX_MRI_SR43\n"); + imex_slow = SUNTRUE; + reltol = SUNMAX(hs * hs * hs * hs, 1e-14); + abstol = 1e-14; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + } + switch (fast_type) + { + case (0): + printf(" fast solver: none\n"); + no_fast = SUNTRUE; + break; + case (1): + printf(" fast solver: esdirk-3-3\n"); + implicit_fast = SUNTRUE; + reltol = SUNMAX(hs * hs * hs, 1e-10); + abstol = 1e-11; + printf(" reltol = %.2" ESYM ", abstol = %.2" ESYM "\n", reltol, abstol); + break; + case (2): + printf(" fast solver: ARKODE_HEUN_EULER_2_1_2\n"); + explicit_fast = SUNTRUE; + break; + case (3): + printf(" fast solver: erk-3-3\n"); + explicit_fast = SUNTRUE; + break; + case (4): + printf(" fast solver: erk-4-4\n"); + explicit_fast = SUNTRUE; + break; + case (5): + printf(" fast solver: ARKODE_DORMAND_PRINCE_7_4_5\n"); + explicit_fast = SUNTRUE; break; } @@ -287,35 +386,53 @@ int main(int argc, char* argv[]) /* Initialize the fast integrator. Specify the fast right-hand side function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time T0, - and the initial dependent variable vector y. */ - switch (solve_type) + and the initial dependent variable vector y. If the fast scale is implicit, + set up matrix, linear solver, and Jacobian function */ + if (implicit_fast) + { + Af = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)Af, "SUNDenseMatrix", 0)) { return 1; } + LSf = SUNLinSol_Dense(y, Af, ctx); + if (check_retval((void*)LSf, "SUNLinSol_Dense", 0)) { return 1; } + } + if (no_fast) + { + inner_arkode_mem = ARKStepCreate(f0, NULL, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + } + else if (explicit_fast && !no_slow) { - case (0): - case (6): - case (7): - case (8): /* erk-3-3 fast solver */ inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } - B = ARKodeButcherTable_Alloc(3, SUNTRUE); - if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } - B->A[1][0] = SUN_RCONST(0.5); - B->A[2][0] = -ONE; - B->A[2][1] = TWO; - B->b[0] = ONE / SUN_RCONST(6.0); - B->b[1] = TWO / SUN_RCONST(3.0); - B->b[2] = ONE / SUN_RCONST(6.0); - B->d[1] = ONE; - B->c[1] = SUN_RCONST(0.5); - B->c[2] = ONE; - B->q = 3; - B->p = 2; - retval = ARKStepSetTables(inner_arkode_mem, 3, 2, NULL, B); - if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } - ARKodeButcherTable_Free(B); - break; - case (1): /* erk-3-3 fast solver (full problem) */ + } + else if (explicit_fast && no_slow) + { inner_arkode_mem = ARKStepCreate(fn, NULL, T0, y, ctx); if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + } + else if (implicit_fast && no_slow) + { + inner_arkode_mem = ARKStepCreate(NULL, fn, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + } + else if (implicit_fast && !no_slow) + { + inner_arkode_mem = ARKStepCreate(NULL, ff, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(inner_arkode_mem, Jf); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + } + + /* Set Butcher table for fast integrator */ + switch (fast_type) + { + case (0): B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } B->A[1][0] = SUN_RCONST(0.5); @@ -331,32 +448,8 @@ int main(int argc, char* argv[]) B->p = 2; retval = ARKStepSetTables(inner_arkode_mem, 3, 2, NULL, B); if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } - ARKodeButcherTable_Free(B); - break; - case (9): - case (5): /* erk-4-4 fast solver */ - inner_arkode_mem = ARKStepCreate(ff, NULL, T0, y, ctx); - if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } - B = ARKodeButcherTable_Alloc(4, SUNFALSE); - if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } - B->A[1][0] = SUN_RCONST(0.5); - B->A[2][1] = SUN_RCONST(0.5); - B->A[3][2] = ONE; - B->b[0] = ONE / SUN_RCONST(6.0); - B->b[1] = ONE / SUN_RCONST(3.0); - B->b[2] = ONE / SUN_RCONST(3.0); - B->b[3] = ONE / SUN_RCONST(6.0); - B->c[1] = SUN_RCONST(0.5); - B->c[2] = SUN_RCONST(0.5); - B->c[3] = ONE; - B->q = 4; - retval = ARKStepSetTables(inner_arkode_mem, 4, 0, NULL, B); - if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } - ARKodeButcherTable_Free(B); break; - case (2): /* esdirk-3-3 fast solver (full problem) */ - inner_arkode_mem = ARKStepCreate(NULL, fn, T0, y, ctx); - if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + case (1): B = ARKodeButcherTable_Alloc(3, SUNFALSE); if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } beta = SUNRsqrt(SUN_RCONST(3.0)) / SUN_RCONST(6.0) + SUN_RCONST(0.5); @@ -374,22 +467,14 @@ int main(int argc, char* argv[]) B->q = 3; retval = ARKStepSetTables(inner_arkode_mem, 3, 0, B, NULL); if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } - Af = SUNDenseMatrix(NEQ, NEQ, ctx); - if (check_retval((void*)Af, "SUNDenseMatrix", 0)) { return 1; } - LSf = SUNLinSol_Dense(y, Af, ctx); - if (check_retval((void*)LSf, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKodeSetLinearSolver(inner_arkode_mem, LSf, Af); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } - retval = ARKodeSetJacFn(inner_arkode_mem, Jn); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } - retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } - ARKodeButcherTable_Free(B); break; - case (3): /* no fast dynamics ('evolve' explicitly w/ erk-3-3) */ - case (4): - inner_arkode_mem = ARKStepCreate(f0, NULL, T0, y, ctx); - if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) { return 1; } + case (2): + B = ARKodeButcherTable_LoadERK(ARKODE_HEUN_EULER_2_1_2); + if (check_retval((void*)B, "ARKodeButcherTable_LoadERK", 0)) { return 1; } + retval = ARKStepSetTables(inner_arkode_mem, 2, 1, NULL, B); + if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } + break; + case (3): B = ARKodeButcherTable_Alloc(3, SUNTRUE); if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } B->A[1][0] = SUN_RCONST(0.5); @@ -405,8 +490,36 @@ int main(int argc, char* argv[]) B->p = 2; retval = ARKStepSetTables(inner_arkode_mem, 3, 2, NULL, B); if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } - ARKodeButcherTable_Free(B); + break; + case (4): + B = ARKodeButcherTable_Alloc(4, SUNFALSE); + if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } + B->A[1][0] = SUN_RCONST(0.5); + B->A[2][1] = SUN_RCONST(0.5); + B->A[3][2] = ONE; + B->b[0] = ONE / SUN_RCONST(6.0); + B->b[1] = ONE / SUN_RCONST(3.0); + B->b[2] = ONE / SUN_RCONST(3.0); + B->b[3] = ONE / SUN_RCONST(6.0); + B->c[1] = SUN_RCONST(0.5); + B->c[2] = SUN_RCONST(0.5); + B->c[3] = ONE; + B->q = 4; + retval = ARKStepSetTables(inner_arkode_mem, 4, 0, NULL, B); + if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } + break; + case (5): + B = ARKodeButcherTable_LoadERK(ARKODE_DORMAND_PRINCE_7_4_5); + if (check_retval((void*)B, "ARKodeButcherTable_LoadERK", 0)) { return 1; } + retval = ARKStepSetTables(inner_arkode_mem, 5, 4, NULL, B); + if (check_retval(&retval, "ARKStepSetTables", 1)) { return 1; } + break; } + ARKodeButcherTable_Free(B); + + /* Set the tolerances */ + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Set the user data pointer */ retval = ARKodeSetUserData(inner_arkode_mem, (void*)rpar); @@ -417,11 +530,8 @@ int main(int argc, char* argv[]) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options @@ -429,38 +539,63 @@ int main(int argc, char* argv[]) /* Initialize the slow integrator. Specify the slow right-hand side function in y'=fs(t,y)+ff(t,y) = fse(t,y)+fsi(t,y)+ff(t,y), the initial time - T0, the initial dependent variable vector y, and the fast integrator. */ - switch (solve_type) + T0, the initial dependent variable vector y, and the fast integrator. If + the slow scale contains an implicit component, set up matrix, linear solver, + and Jacobian function. */ + if (implicit_slow || imex_slow) + { + As = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } + LSs = SUNLinSol_Dense(y, As, ctx); + if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } + } + if (no_slow) + { + arkode_mem = MRIStepCreate(f0, NULL, T0, y, inner_stepper, ctx); + if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + } + else if (explicit_slow && !no_fast) { - case (0): /* KW3 slow solver */ arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } - C = MRIStepCoupling_LoadTable(ARKODE_MIS_KW3); - if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - break; - case (3): /* KW3 slow solver (full problem) */ + } + else if (explicit_slow && no_fast) + { arkode_mem = MRIStepCreate(fn, NULL, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } - C = MRIStepCoupling_LoadTable(ARKODE_MIS_KW3); - if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - break; - case (5): /* MRI-GARK-ERK45a slow solver */ - case (6): - arkode_mem = MRIStepCreate(fs, NULL, T0, y, inner_stepper, ctx); + } + else if (implicit_slow && !no_fast) + { + arkode_mem = MRIStepCreate(NULL, fs, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } - C = MRIStepCoupling_LoadTable(ARKODE_MRI_GARK_ERK45a); - if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - break; - case (1): - case (2): /* no slow dynamics (use ERK-2-2) */ - arkode_mem = MRIStepCreate(f0, NULL, T0, y, inner_stepper, ctx); + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Js); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + } + else if (implicit_slow && no_fast) + { + arkode_mem = MRIStepCreate(NULL, fn, T0, y, inner_stepper, ctx); + if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + } + else if (imex_slow) + { + arkode_mem = MRIStepCreate(fse, fsi, T0, y, inner_stepper, ctx); if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } + retval = ARKodeSetJacFn(arkode_mem, Jsi); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } + } + + /* Set coupling table for slow integrator */ + switch (slow_type) + { + case (0): /* no slow dynamics (use ERK-2-2) */ B = ARKodeButcherTable_Alloc(2, SUNFALSE); if (check_retval((void*)B, "ARKodeButcherTable_Alloc", 0)) { return 1; } B->A[1][0] = TWO / SUN_RCONST(3.0); @@ -470,89 +605,74 @@ int main(int argc, char* argv[]) B->q = 2; C = MRIStepCoupling_MIStoMRI(B, 2, 0); if (check_retval((void*)C, "MRIStepCoupling_MIStoMRI", 0)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } ARKodeButcherTable_Free(B); break; - case (4): /* dirk-2 (trapezoidal), solve-decoupled slow solver */ - arkode_mem = MRIStepCreate(NULL, fn, T0, y, inner_stepper, ctx); - if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + case (1): + C = MRIStepCoupling_LoadTable(ARKODE_MIS_KW3); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } + break; + case (2): + C = MRIStepCoupling_LoadTable(ARKODE_MRI_GARK_ERK45a); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } + break; + case (3): + C = MRIStepCoupling_LoadTable(ARKODE_MERK21); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } + break; + case (4): + C = MRIStepCoupling_LoadTable(ARKODE_MERK32); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } + break; + case (5): + C = MRIStepCoupling_LoadTable(ARKODE_MERK43); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } + break; + case (6): + C = MRIStepCoupling_LoadTable(ARKODE_MERK54); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } + break; + case (7): C = MRIStepCoupling_LoadTable(ARKODE_MRI_GARK_IRK21a); if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - As = SUNDenseMatrix(NEQ, NEQ, ctx); - if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } - LSs = SUNLinSol_Dense(y, As, ctx); - if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } - retval = ARKodeSetJacFn(arkode_mem, Jn); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; - case (7): /* MRI-GARK-ESDIRK34a, solve-decoupled slow solver */ - arkode_mem = MRIStepCreate(NULL, fs, T0, y, inner_stepper, ctx); - if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + case (8): C = MRIStepCoupling_LoadTable(ARKODE_MRI_GARK_ESDIRK34a); if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 1)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - As = SUNDenseMatrix(NEQ, NEQ, ctx); - if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } - LSs = SUNLinSol_Dense(y, As, ctx); - if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } - retval = ARKodeSetJacFn(arkode_mem, Js); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; - case (8): /* IMEX-MRI-GARK3b, solve-decoupled slow solver */ - arkode_mem = MRIStepCreate(fse, fsi, T0, y, inner_stepper, ctx); - if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + case (9): C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_GARK3b); if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - As = SUNDenseMatrix(NEQ, NEQ, ctx); - if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } - LSs = SUNLinSol_Dense(y, As, ctx); - if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } - retval = ARKodeSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } break; - case (9): /* IMEX-MRI-GARK4, solve-decoupled slow solver */ - arkode_mem = MRIStepCreate(fse, fsi, T0, y, inner_stepper, ctx); - if (check_retval((void*)arkode_mem, "MRIStepCreate", 0)) { return 1; } + case (10): C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_GARK4); if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } - retval = MRIStepSetCoupling(arkode_mem, C); - if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } - As = SUNDenseMatrix(NEQ, NEQ, ctx); - if (check_retval((void*)As, "SUNDenseMatrix", 0)) { return 1; } - LSs = SUNLinSol_Dense(y, As, ctx); - if (check_retval((void*)LSs, "SUNLinSol_Dense", 0)) { return 1; } - retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); - if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) { return 1; } - retval = ARKodeSetJacFn(arkode_mem, Jsi); - if (check_retval(&retval, "ARKodeSetJacFn", 1)) { return 1; } - retval = ARKodeSStolerances(arkode_mem, reltol, abstol); - if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } + break; + case (11): + C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_SR21); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } + break; + case (12): + C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_SR32); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } + break; + case (13): + C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_SR43); + if (check_retval((void*)C, "MRIStepCoupling_LoadTable", 0)) { return 1; } break; } + retval = MRIStepSetCoupling(arkode_mem, C); + if (check_retval(&retval, "MRIStepSetCoupling", 1)) { return 1; } + MRIStepCoupling_Free(C); /* free coupling coefficients */ + + /* Set the tolerances */ + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } /* Set the user data pointer */ retval = ARKodeSetUserData(arkode_mem, (void*)rpar); if (check_retval(&retval, "ARKodeSetUserData", 1)) { return 1; } - retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce); + retval = ARKodeSetDeduceImplicitRhs(arkode_mem, deduce_rhs); if (check_retval(&retval, "ARKodeSetDeduceImplicitRhs", 1)) { return 1; } /* Set the slow step size */ @@ -655,8 +775,7 @@ int main(int argc, char* argv[]) else { printf(" Total RHS evals: Fs = %li, Ff = %li\n", nfse, nff); } /* Get/print slow integrator decoupled implicit solver statistics */ - if ((solve_type == 4) || (solve_type == 7) || (solve_type == 8) || - (solve_type == 9)) + if (implicit_slow || imex_slow) { retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); @@ -668,7 +787,7 @@ int main(int argc, char* argv[]) } /* Get/print fast integrator implicit solver statistics */ - if (solve_type == 2) + if (implicit_fast) { retval = ARKodeGetNonlinSolvStats(inner_arkode_mem, &nnif, &nncf); check_retval(&retval, "ARKodeGetNonlinSolvStats", 1); @@ -681,7 +800,6 @@ int main(int argc, char* argv[]) /* Clean up and return */ N_VDestroy(y); /* Free y vector */ - MRIStepCoupling_Free(C); /* free coupling coefficients */ SUNMatDestroy(Af); /* free fast matrix */ SUNLinSolFree(LSf); /* free fast linear solver */ SUNMatDestroy(As); /* free fast matrix */ @@ -871,6 +989,26 @@ static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, return 0; } +static int Jf(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + sunrealtype* rpar = (sunrealtype*)user_data; + const sunrealtype e = rpar[2]; + const sunrealtype u = NV_Ith_S(y, 0); + const sunrealtype v = NV_Ith_S(y, 1); + + /* fill in the Jacobian: + [ 0 0 ] + [e/2+e*(1+r(t))/(2*u^2) -1/2-(2+s(t))/(2*v^2)] */ + SM_ELEMENT_D(J, 0, 0) = ZERO; + SM_ELEMENT_D(J, 0, 1) = ZERO; + SM_ELEMENT_D(J, 1, 0) = e / TWO + e * (ONE + r(t, rpar)) / (TWO * u * u); + SM_ELEMENT_D(J, 1, 1) = -ONE / TWO - (TWO + s(t, rpar)) / (TWO * v * v); + + /* Return with success */ + return 0; +} + /* ------------------------------ * Private helper functions * ------------------------------*/ diff --git a/examples/arkode/C_serial/ark_kpr_mri.out b/examples/arkode/C_serial/ark_kpr_mri.out deleted file mode 100644 index e551c2cee3..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri.out +++ /dev/null @@ -1,69 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.01 - hf = 0.0001 - G = -100 - w = 100 - e = 0.5 - 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 8.49e-07 8.80e-09 - 0.200000 1.220670 1.551800 8.43e-07 2.05e-08 - 0.300000 1.215595 1.467737 8.33e-07 3.10e-08 - 0.400000 1.208525 1.154583 8.19e-07 4.03e-08 - 0.500000 1.199497 1.721908 8.00e-07 4.85e-08 - 0.600000 1.188558 1.023517 7.77e-07 5.56e-08 - 0.700000 1.175765 1.622751 7.49e-07 6.17e-08 - 0.800000 1.161187 1.374632 7.16e-07 6.68e-08 - 0.900000 1.144905 1.245763 6.78e-07 7.09e-08 - 1.000000 1.127010 1.691839 6.36e-07 7.40e-08 - 1.100000 1.107610 1.000490 5.87e-07 7.62e-08 - 1.200000 1.086821 1.677552 5.33e-07 7.74e-08 - 1.300000 1.064777 1.277775 4.73e-07 7.77e-08 - 1.400000 1.041626 1.342455 4.06e-07 7.71e-08 - 1.500000 1.017531 1.642940 3.32e-07 7.55e-08 - 1.600000 0.992674 1.012112 2.51e-07 7.29e-08 - 1.700000 0.967253 1.714058 1.61e-07 6.93e-08 - 1.800000 0.941488 1.183867 6.33e-08 6.48e-08 - 1.900000 0.915617 1.437465 4.33e-08 5.91e-08 - 2.000000 0.889902 1.577082 1.59e-07 5.24e-08 - 2.100000 0.864625 1.056467 2.83e-07 4.46e-08 - 2.200000 0.840089 1.730920 4.16e-07 3.57e-08 - 2.300000 0.816616 1.101047 5.56e-07 2.56e-08 - 2.400000 0.794545 1.525051 7.01e-07 1.44e-08 - 2.500000 0.774227 1.496993 8.48e-07 2.09e-09 - 2.600000 0.756012 1.126857 9.92e-07 1.12e-08 - 2.700000 0.740245 1.727536 1.13e-06 2.54e-08 - 2.800000 0.727246 1.038393 1.25e-06 4.01e-08 - 2.900000 0.717300 1.600759 1.35e-06 5.53e-08 - 3.000000 0.710635 1.406379 1.43e-06 7.03e-08 - 3.100000 0.707411 1.214353 1.47e-06 8.49e-08 - 3.200000 0.707708 1.704026 1.47e-06 9.86e-08 - 3.300000 0.711518 1.004391 1.44e-06 1.11e-07 - 3.400000 0.718748 1.661225 1.37e-06 1.21e-07 - 3.500000 0.729225 1.310102 1.28e-06 1.30e-07 - 3.600000 0.742711 1.310080 1.16e-06 1.36e-07 - 3.700000 0.758913 1.661237 1.03e-06 1.40e-07 - 3.800000 0.777505 1.004387 8.82e-07 1.41e-07 - 3.900000 0.798143 1.704018 7.35e-07 1.40e-07 - 4.000000 0.820474 1.214374 5.88e-07 1.37e-07 - 4.100000 0.844149 1.406358 4.47e-07 1.32e-07 - 4.200000 0.868832 1.600774 3.11e-07 1.26e-07 - 4.300000 0.894204 1.038382 1.84e-07 1.18e-07 - 4.400000 0.919964 1.727533 6.62e-08 1.09e-07 - 4.500000 0.945834 1.126875 4.29e-08 9.90e-08 - 4.600000 0.971558 1.496973 1.43e-07 8.85e-08 - 4.700000 0.996898 1.525070 2.35e-07 7.76e-08 - 4.800000 1.021641 1.101030 3.18e-07 6.64e-08 - 4.900000 1.045589 1.730922 3.94e-07 5.51e-08 - 5.000000 1.068565 1.056480 4.62e-07 4.38e-08 - ------------------------------------------------------ - -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 = 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 deleted file mode 100644 index ef1ab12278..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_0_0.002.out +++ /dev/null @@ -1,69 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.002 - hf = 2e-05 - G = -100 - w = 100 - e = 0.5 - 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 4.99e-09 6.32e-11 - 0.200000 1.220669 1.551800 4.96e-09 1.43e-10 - 0.300000 1.215594 1.467737 4.90e-09 2.14e-10 - 0.400000 1.208524 1.154583 4.81e-09 2.78e-10 - 0.500000 1.199496 1.721908 4.70e-09 3.33e-10 - 0.600000 1.188557 1.023517 4.57e-09 3.82e-10 - 0.700000 1.175764 1.622751 4.40e-09 4.23e-10 - 0.800000 1.161186 1.374632 4.21e-09 4.57e-10 - 0.900000 1.144904 1.245763 3.98e-09 4.85e-10 - 1.000000 1.127010 1.691839 3.73e-09 5.06e-10 - 1.100000 1.107609 1.000489 3.45e-09 5.18e-10 - 1.200000 1.086821 1.677552 3.13e-09 5.29e-10 - 1.300000 1.064777 1.277775 2.77e-09 5.29e-10 - 1.400000 1.041625 1.342455 2.38e-09 5.25e-10 - 1.500000 1.017531 1.642940 1.94e-09 5.14e-10 - 1.600000 0.992673 1.012112 1.46e-09 4.94e-10 - 1.700000 0.967253 1.714058 9.32e-10 4.72e-10 - 1.800000 0.941488 1.183867 3.54e-10 4.39e-10 - 1.900000 0.915617 1.437465 2.75e-10 4.01e-10 - 2.000000 0.889903 1.577082 9.56e-10 3.55e-10 - 2.100000 0.864625 1.056467 1.69e-09 3.05e-10 - 2.200000 0.840089 1.730920 2.47e-09 2.38e-10 - 2.300000 0.816616 1.101047 3.30e-09 1.73e-10 - 2.400000 0.794546 1.525051 4.15e-09 9.32e-11 - 2.500000 0.774227 1.496993 5.01e-09 8.75e-12 - 2.600000 0.756013 1.126857 5.86e-09 8.02e-11 - 2.700000 0.740246 1.727536 6.67e-09 1.81e-10 - 2.800000 0.727247 1.038393 7.38e-09 2.78e-10 - 2.900000 0.717301 1.600759 7.97e-09 3.85e-10 - 3.000000 0.710636 1.406380 8.40e-09 4.87e-10 - 3.100000 0.707412 1.214353 8.63e-09 5.85e-10 - 3.200000 0.707709 1.704026 8.65e-09 6.81e-10 - 3.300000 0.711520 1.004391 8.46e-09 7.60e-10 - 3.400000 0.718750 1.661225 8.06e-09 8.35e-10 - 3.500000 0.729227 1.310102 7.50e-09 8.89e-10 - 3.600000 0.742712 1.310080 6.80e-09 9.30e-10 - 3.700000 0.758914 1.661237 6.01e-09 9.57e-10 - 3.800000 0.777506 1.004387 5.16e-09 9.60e-10 - 3.900000 0.798144 1.704019 4.29e-09 9.58e-10 - 4.000000 0.820474 1.214374 3.43e-09 9.33e-10 - 4.100000 0.844149 1.406358 2.60e-09 9.00e-10 - 4.200000 0.868832 1.600774 1.81e-09 8.56e-10 - 4.300000 0.894204 1.038382 1.06e-09 7.99e-10 - 4.400000 0.919964 1.727533 3.69e-10 7.42e-10 - 4.500000 0.945834 1.126875 2.71e-10 6.70e-10 - 4.600000 0.971557 1.496974 8.58e-10 6.01e-10 - 4.700000 0.996898 1.525070 1.40e-09 5.27e-10 - 4.800000 1.021641 1.101030 1.88e-09 4.48e-10 - 4.900000 1.045589 1.730922 2.33e-09 3.74e-10 - 5.000000 1.068565 1.056480 2.73e-09 2.92e-10 - ------------------------------------------------------ - -Final Solver Statistics: - Steps: nsts = 2501, nstf = 252601 - 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_2_0.005.out b/examples/arkode/C_serial/ark_kpr_mri_0_1_0.005.out similarity index 97% rename from examples/arkode/C_serial/ark_kpr_mri_2_0.005.out rename to examples/arkode/C_serial/ark_kpr_mri_0_1_0.005.out index abedbafb39..59f23631ed 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_2_0.005.out +++ b/examples/arkode/C_serial/ark_kpr_mri_0_1_0.005.out @@ -6,9 +6,9 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: G = -100 w = 100 e = 0.5 - solver: none/dirk-3 (no slow, dirk fast) - - reltol = 1.25e-07, abstol = 1.00e-11 + slow solver: none + fast solver: esdirk-3-3 + reltol = 1.25e-07, abstol = 1.00e-11 t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 diff --git a/examples/arkode/C_serial/ark_kpr_mri_10_4_0.001_-100_100_0.5_1.out b/examples/arkode/C_serial/ark_kpr_mri_10_4_0.001_-100_100_0.5_1.out new file mode 100644 index 0000000000..fe552cf2b6 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_10_4_0.001_-100_100_0.5_1.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_IMEX_MRI_GARK4 + reltol = 1.00e-12, abstol = 1.00e-14 + fast solver: 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 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 + 0.500000 1.199496 1.721908 1.57e-11 1.74e-12 + 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.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.92e-12 2.55e-12 + 1.300000 1.064777 1.277775 7.66e-12 1.74e-13 + 1.400000 1.041625 1.342455 6.65e-12 7.06e-13 + 1.500000 1.017531 1.642940 6.43e-12 2.73e-12 + 1.600000 0.992673 1.012112 4.49e-12 1.24e-12 + 1.700000 0.967253 1.714058 3.11e-12 3.19e-12 + 1.800000 0.941488 1.183867 5.76e-14 2.22e-13 + 1.900000 0.915617 1.437465 1.88e-12 1.29e-12 + 2.000000 0.889903 1.577082 4.65e-12 2.09e-12 + 2.100000 0.864625 1.056467 6.53e-12 1.44e-12 + 2.200000 0.840089 1.730920 7.39e-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.30e-13 + 2.500000 0.774227 1.496993 1.92e-11 2.40e-13 + 2.600000 0.756013 1.126857 2.04e-11 2.57e-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.89e-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.33e-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.59e-12 8.30e-12 + 4.200000 0.868832 1.600774 5.04e-12 1.14e-11 + 4.300000 0.894204 1.038382 2.82e-12 3.27e-13 + 4.400000 0.919964 1.727533 1.81e-12 1.24e-11 + 4.500000 0.945834 1.126875 1.89e-12 8.42e-13 + 4.600000 0.971557 1.496974 3.73e-12 6.99e-12 + 4.700000 0.996898 1.525070 5.90e-12 7.03e-12 + 4.800000 1.021641 1.101030 7.16e-12 1.43e-12 + 4.900000 1.045589 1.730922 6.80e-12 9.68e-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 = 2045001 + Slow Newton iters = 52554 + Slow Newton conv fails = 0 + Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_11_2_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_11_2_0.001.out new file mode 100644 index 0000000000..f34f31abb5 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_11_2_0.001.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_IMEX_MRI_SR21 + reltol = 1.00e-06, abstol = 1.00e-11 + fast solver: ARKODE_HEUN_EULER_2_1_2 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 + 0.100000 1.223724 1.077464 3.33e-07 4.20e-08 + 0.200000 1.220669 1.551800 4.24e-07 8.85e-09 + 0.300000 1.215593 1.467737 1.15e-06 1.86e-08 + 0.400000 1.208524 1.154583 5.07e-07 2.20e-09 + 0.500000 1.199497 1.721908 2.65e-07 4.68e-08 + 0.600000 1.188557 1.023517 7.96e-08 1.14e-08 + 0.700000 1.175764 1.622750 3.38e-07 5.33e-08 + 0.800000 1.161186 1.374632 2.38e-07 5.06e-08 + 0.900000 1.144903 1.245763 5.34e-07 3.98e-08 + 1.000000 1.127010 1.691839 2.21e-07 7.09e-08 + 1.100000 1.107609 1.000489 4.62e-08 9.12e-09 + 1.200000 1.086820 1.677552 2.34e-07 8.42e-08 + 1.300000 1.064776 1.277775 2.44e-07 6.08e-08 + 1.400000 1.041625 1.342455 5.10e-07 6.67e-08 + 1.500000 1.017531 1.642940 6.50e-08 8.39e-08 + 1.600000 0.992673 1.012112 1.90e-07 3.00e-08 + 1.700000 0.967253 1.714058 6.43e-08 9.87e-08 + 1.800000 0.941487 1.183866 9.42e-07 6.18e-08 + 1.900000 0.915617 1.437465 5.51e-07 8.36e-08 + 2.000000 0.889902 1.577082 5.63e-07 9.28e-08 + 2.100000 0.864625 1.056467 3.79e-07 4.72e-08 + 2.200000 0.840089 1.730920 1.91e-07 1.01e-07 + 2.300000 0.816616 1.101047 4.88e-07 5.28e-08 + 2.400000 0.794545 1.525051 4.88e-07 9.00e-08 + 2.500000 0.774227 1.496993 1.22e-07 9.18e-08 + 2.600000 0.756012 1.126857 5.41e-07 5.83e-08 + 2.700000 0.740246 1.727536 1.69e-07 1.03e-07 + 2.800000 0.727247 1.038393 2.16e-07 4.30e-08 + 2.900000 0.717301 1.600759 4.45e-07 9.81e-08 + 3.000000 0.710636 1.406379 1.65e-07 8.71e-08 + 3.100000 0.707412 1.214353 5.06e-07 6.86e-08 + 3.200000 0.707710 1.704026 1.90e-07 1.02e-07 + 3.300000 0.711519 1.004391 1.00e-07 3.73e-08 + 3.400000 0.718749 1.661225 2.14e-07 1.01e-07 + 3.500000 0.729226 1.310102 2.53e-07 7.93e-08 + 3.600000 0.742711 1.310080 3.52e-07 8.04e-08 + 3.700000 0.758914 1.661237 1.20e-08 9.89e-08 + 3.800000 0.777506 1.004387 1.70e-07 4.01e-08 + 3.900000 0.798144 1.704018 1.75e-08 1.03e-07 + 4.000000 0.820473 1.214374 1.10e-06 7.09e-08 + 4.100000 0.844149 1.406358 4.60e-07 8.77e-08 + 4.200000 0.868832 1.600774 3.92e-07 9.80e-08 + 4.300000 0.894203 1.038382 3.30e-07 5.31e-08 + 4.400000 0.919964 1.727533 1.58e-07 1.09e-07 + 4.500000 0.945833 1.126875 6.42e-07 6.63e-08 + 4.600000 0.971557 1.496973 4.87e-07 9.63e-08 + 4.700000 0.996897 1.525070 8.90e-07 1.01e-07 + 4.800000 1.021640 1.101030 4.60e-07 6.49e-08 + 4.900000 1.045589 1.730922 3.00e-07 1.08e-07 + 5.000000 1.068565 1.056480 2.32e-07 5.06e-08 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 5000, nstf = 935000 + u error = 4.409e-07, v error = 7.409e-08, total error = 3.161e-07 + Total RHS evals: Fse = 15001, Fsi = 32981, Ff = 1875001 + Slow Newton iters = 17980 + Slow Newton conv fails = 0 + Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_kpr_mri_12_3_0.005.out b/examples/arkode/C_serial/ark_kpr_mri_12_3_0.005.out new file mode 100644 index 0000000000..248f0c3b32 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_12_3_0.005.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.005 + hf = 5e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_IMEX_MRI_SR32 + reltol = 1.25e-07, abstol = 1.00e-11 + fast solver: 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 1.04e-07 1.78e-10 + 0.200000 1.220669 1.551800 1.03e-07 3.02e-10 + 0.300000 1.215594 1.467737 1.04e-07 7.49e-10 + 0.400000 1.208524 1.154583 1.03e-07 1.17e-09 + 0.500000 1.199496 1.721908 1.01e-07 1.58e-09 + 0.600000 1.188557 1.023517 9.63e-08 1.93e-09 + 0.700000 1.175764 1.622751 9.18e-08 2.23e-09 + 0.800000 1.161186 1.374632 9.21e-08 2.49e-09 + 0.900000 1.144904 1.245763 8.98e-08 2.75e-09 + 1.000000 1.127010 1.691839 8.66e-08 3.02e-09 + 1.100000 1.107609 1.000489 7.61e-08 3.25e-09 + 1.200000 1.086821 1.677552 6.53e-08 3.39e-09 + 1.300000 1.064777 1.277775 6.27e-08 3.48e-09 + 1.400000 1.041626 1.342455 5.85e-08 3.54e-09 + 1.500000 1.017531 1.642940 5.47e-08 3.65e-09 + 1.600000 0.992673 1.012112 3.94e-08 3.74e-09 + 1.700000 0.967253 1.714058 2.18e-08 3.76e-09 + 1.800000 0.941488 1.183867 1.09e-08 3.66e-09 + 1.900000 0.915617 1.437465 2.03e-09 3.48e-09 + 2.000000 0.889903 1.577082 3.28e-09 3.36e-09 + 2.100000 0.864625 1.056467 2.22e-08 3.24e-09 + 2.200000 0.840089 1.730920 4.49e-08 3.09e-09 + 2.300000 0.816616 1.101047 6.69e-08 2.78e-09 + 2.400000 0.794546 1.525051 8.32e-08 2.32e-09 + 2.500000 0.774227 1.496993 9.13e-08 1.89e-09 + 2.600000 0.756013 1.126857 1.10e-07 1.47e-09 + 2.700000 0.740246 1.727536 1.30e-07 1.05e-09 + 2.800000 0.727247 1.038393 1.52e-07 4.97e-10 + 2.900000 0.717301 1.600759 1.66e-07 1.62e-10 + 3.000000 0.710636 1.406380 1.70e-07 7.36e-10 + 3.100000 0.707412 1.214353 1.76e-07 1.36e-09 + 3.200000 0.707709 1.704026 1.78e-07 1.97e-09 + 3.300000 0.711519 1.004391 1.75e-07 2.57e-09 + 3.400000 0.718749 1.661225 1.66e-07 3.12e-09 + 3.500000 0.729227 1.310102 2.06e-07 4.23e-09 + 3.600000 0.742712 1.310080 1.46e-07 4.79e-09 + 3.700000 0.758914 1.661237 1.35e-07 5.10e-09 + 3.800000 0.777506 1.004387 1.13e-07 5.35e-09 + 3.900000 0.798144 1.704019 8.93e-08 5.73e-09 + 4.000000 0.820474 1.214374 7.47e-08 5.72e-09 + 4.100000 0.844149 1.406358 6.22e-08 5.61e-09 + 4.200000 0.868832 1.600774 5.40e-08 5.54e-09 + 4.300000 0.894204 1.038382 3.41e-08 5.46e-09 + 4.400000 0.919964 1.727533 1.30e-08 5.34e-09 + 4.500000 0.945834 1.126875 2.93e-09 5.06e-09 + 4.600000 0.971557 1.496974 1.25e-08 4.68e-09 + 4.700000 0.996898 1.525070 1.46e-08 4.35e-09 + 4.800000 1.021641 1.101030 2.63e-08 4.06e-09 + 4.900000 1.045589 1.730922 3.94e-08 3.79e-09 + 5.000000 1.068565 1.056480 5.40e-08 3.42e-09 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 1001, nstf = 362362 + u error = 9.913e-08, v error = 3.506e-09, total error = 7.014e-08 + Total RHS evals: Fse = 4005, Fsi = 12096, Ff = 1088088 + Slow Newton iters = 8091 + Slow Newton conv fails = 0 + Slow Jacobian evals = 51 diff --git a/examples/arkode/C_serial/ark_kpr_mri_13_4_0.01.out b/examples/arkode/C_serial/ark_kpr_mri_13_4_0.01.out new file mode 100644 index 0000000000..868d51e963 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_13_4_0.01.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.01 + hf = 0.0001 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_IMEX_MRI_SR43 + reltol = 1.00e-08, abstol = 1.00e-14 + fast solver: 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 7.51e-08 2.97e-08 + 0.200000 1.220669 1.551800 7.47e-08 5.67e-08 + 0.300000 1.215594 1.467737 7.40e-08 8.09e-08 + 0.400000 1.208524 1.154583 7.27e-08 1.02e-07 + 0.500000 1.199496 1.721908 7.14e-08 1.21e-07 + 0.600000 1.188557 1.023517 6.91e-08 1.37e-07 + 0.700000 1.175764 1.622750 6.68e-08 1.51e-07 + 0.800000 1.161186 1.374632 6.39e-08 1.63e-07 + 0.900000 1.144904 1.245763 6.08e-08 1.72e-07 + 1.000000 1.127010 1.691839 5.67e-08 1.79e-07 + 1.100000 1.107609 1.000489 5.49e-08 1.83e-07 + 1.200000 1.086820 1.677552 4.79e-08 1.85e-07 + 1.300000 1.064777 1.277775 4.43e-08 1.85e-07 + 1.400000 1.041625 1.342455 3.64e-08 1.83e-07 + 1.500000 1.017531 1.642940 3.04e-08 1.79e-07 + 1.600000 0.992673 1.012112 2.26e-08 1.72e-07 + 1.700000 0.967253 1.714058 1.02e-08 1.62e-07 + 1.800000 0.941488 1.183866 6.48e-09 1.51e-07 + 1.900000 0.915617 1.437465 3.83e-09 1.36e-07 + 2.000000 0.889903 1.577082 1.47e-08 1.20e-07 + 2.100000 0.864625 1.056467 2.48e-08 1.00e-07 + 2.200000 0.840089 1.730920 3.69e-08 7.78e-08 + 2.300000 0.816616 1.101047 5.28e-08 5.29e-08 + 2.400000 0.794546 1.525051 6.32e-08 2.51e-08 + 2.500000 0.774228 1.496993 7.57e-08 5.16e-09 + 2.600000 0.756013 1.126857 8.92e-08 3.76e-08 + 2.700000 0.740246 1.727536 1.01e-07 7.20e-08 + 2.800000 0.727248 1.038393 1.12e-07 1.08e-07 + 2.900000 0.717301 1.600759 1.21e-07 1.44e-07 + 3.000000 0.710636 1.406380 1.27e-07 1.79e-07 + 3.100000 0.707413 1.214353 1.31e-07 2.14e-07 + 3.200000 0.707710 1.704026 1.31e-07 2.45e-07 + 3.300000 0.711520 1.004391 1.28e-07 2.73e-07 + 3.400000 0.718750 1.661225 1.22e-07 2.97e-07 + 3.500000 0.729227 1.310102 1.14e-07 3.15e-07 + 3.600000 0.742712 1.310080 1.03e-07 3.28e-07 + 3.700000 0.758914 1.661237 9.11e-08 3.35e-07 + 3.800000 0.777506 1.004387 7.85e-08 3.36e-07 + 3.900000 0.798144 1.704019 6.30e-08 3.32e-07 + 4.000000 0.820474 1.214374 5.22e-08 3.24e-07 + 4.100000 0.844149 1.406358 4.01e-08 3.11e-07 + 4.200000 0.868832 1.600775 2.78e-08 2.94e-07 + 4.300000 0.894204 1.038382 1.74e-08 2.75e-07 + 4.400000 0.919964 1.727534 6.17e-09 2.53e-07 + 4.500000 0.945834 1.126875 2.12e-09 2.29e-07 + 4.600000 0.971557 1.496974 1.37e-08 2.03e-07 + 4.700000 0.996898 1.525070 1.98e-08 1.77e-07 + 4.800000 1.021641 1.101030 2.80e-08 1.50e-07 + 4.900000 1.045589 1.730922 4.06e-08 1.23e-07 + 5.000000 1.068565 1.056480 4.09e-08 9.61e-08 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 501, nstf = 202905 + u error = 7.089e-08, v error = 1.972e-07, total error = 1.482e-07 + Total RHS evals: Fse = 3007, Fsi = 8869, Ff = 812122 + Slow Newton iters = 5862 + Slow Newton conv fails = 0 + Slow Jacobian evals = 26 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 deleted file mode 100644 index 2cb8b8d4ff..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_1_0.002.out +++ /dev/null @@ -1,69 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.002 - hf = 2e-05 - G = -100 - w = 100 - e = 0.5 - 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 5.15e-13 1.86e-13 - 0.200000 1.220669 1.551800 3.61e-13 4.93e-14 - 0.300000 1.215594 1.467737 2.05e-13 2.51e-13 - 0.400000 1.208524 1.154583 9.50e-14 5.58e-13 - 0.500000 1.199496 1.721908 2.07e-13 4.33e-14 - 0.600000 1.188557 1.023517 4.75e-13 6.09e-13 - 0.700000 1.175764 1.622751 3.64e-13 3.18e-14 - 0.800000 1.161186 1.374632 3.10e-13 2.24e-13 - 0.900000 1.144904 1.245763 1.97e-13 3.70e-13 - 1.000000 1.127010 1.691839 1.30e-13 1.26e-13 - 1.100000 1.107609 1.000489 3.46e-13 3.11e-12 - 1.200000 1.086821 1.677552 3.71e-13 7.33e-14 - 1.300000 1.064777 1.277775 3.83e-13 1.61e-12 - 1.400000 1.041625 1.342455 2.93e-13 1.22e-12 - 1.500000 1.017531 1.642940 5.93e-14 2.38e-13 - 1.600000 0.992673 1.012112 2.03e-13 2.53e-12 - 1.700000 0.967253 1.714058 3.44e-13 7.20e-13 - 1.800000 0.941488 1.183867 4.52e-13 1.59e-12 - 1.900000 0.915617 1.437465 3.44e-13 3.82e-13 - 2.000000 0.889903 1.577082 3.50e-14 3.23e-13 - 2.100000 0.864625 1.056467 9.49e-14 3.63e-12 - 2.200000 0.840089 1.730920 2.82e-13 9.77e-13 - 2.300000 0.816616 1.101047 5.31e-13 3.10e-12 - 2.400000 0.794546 1.525051 3.55e-13 1.45e-13 - 2.500000 0.774227 1.496993 1.73e-13 1.47e-13 - 2.600000 0.756013 1.126857 5.61e-14 2.76e-12 - 2.700000 0.740246 1.727536 2.34e-13 1.63e-12 - 2.800000 0.727247 1.038393 4.93e-13 3.33e-12 - 2.900000 0.717301 1.600759 3.84e-13 8.97e-13 - 3.000000 0.710636 1.406380 2.69e-13 3.69e-13 - 3.100000 0.707412 1.214353 1.84e-13 1.89e-12 - 3.200000 0.707709 1.704026 1.75e-13 1.92e-12 - 3.300000 0.711520 1.004391 3.96e-13 3.62e-12 - 3.400000 0.718750 1.661225 3.90e-13 1.72e-12 - 3.500000 0.729227 1.310102 3.60e-13 8.16e-13 - 3.600000 0.742712 1.310080 2.78e-13 9.20e-13 - 3.700000 0.758914 1.661237 9.77e-14 1.96e-12 - 3.800000 0.777506 1.004387 2.59e-13 3.77e-12 - 3.900000 0.798144 1.704019 3.72e-13 2.32e-12 - 4.000000 0.820474 1.214374 4.43e-13 1.53e-12 - 4.100000 0.844149 1.406358 3.40e-13 1.78e-14 - 4.200000 0.868832 1.600774 6.66e-16 1.74e-12 - 4.300000 0.894204 1.038382 1.07e-13 3.58e-12 - 4.400000 0.919964 1.727533 3.31e-13 2.75e-12 - 4.500000 0.945834 1.126875 4.96e-13 2.41e-12 - 4.600000 0.971557 1.496974 3.76e-13 9.10e-13 - 4.700000 0.996898 1.525070 1.11e-13 1.32e-12 - 4.800000 1.021641 1.101030 3.06e-14 2.99e-12 - 4.900000 1.045589 1.730922 2.75e-13 3.00e-12 - 5.000000 1.068565 1.056480 5.02e-13 3.36e-12 - ------------------------------------------------------ - -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 = 757853 diff --git a/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out b/examples/arkode/C_serial/ark_kpr_mri_1_0_0.01.out similarity index 97% rename from examples/arkode/C_serial/ark_kpr_mri_3_0.01.out rename to examples/arkode/C_serial/ark_kpr_mri_1_0_0.01.out index 9504b4c524..ef66f4a445 100644 --- a/examples/arkode/C_serial/ark_kpr_mri_3_0.01.out +++ b/examples/arkode/C_serial/ark_kpr_mri_1_0_0.01.out @@ -6,7 +6,8 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: G = -100 w = 100 e = 0.5 - solver: exp-3/none (explicit slow, no fast) + slow solver: ARKODE_MIS_KW3 + fast solver: none t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 @@ -65,4 +66,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 = 151853 + Total RHS evals: Fs = 1504, Ff = 152305 diff --git a/examples/arkode/C_serial/ark_kpr_mri_1_1_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_1_1_0.002.out new file mode 100644 index 0000000000..ce045454c5 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_1_1_0.002.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.002 + hf = 2e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MIS_KW3 + fast solver: esdirk-3-3 + reltol = 8.00e-09, abstol = 1.00e-11 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 + 0.100000 1.223725 1.077464 4.99e-09 6.44e-11 + 0.200000 1.220669 1.551800 4.96e-09 1.43e-10 + 0.300000 1.215594 1.467737 4.90e-09 2.14e-10 + 0.400000 1.208524 1.154583 4.81e-09 2.79e-10 + 0.500000 1.199496 1.721908 4.70e-09 3.33e-10 + 0.600000 1.188557 1.023517 4.57e-09 3.84e-10 + 0.700000 1.175764 1.622751 4.40e-09 4.23e-10 + 0.800000 1.161186 1.374632 4.21e-09 4.58e-10 + 0.900000 1.144904 1.245763 3.98e-09 4.86e-10 + 1.000000 1.127010 1.691839 3.73e-09 5.06e-10 + 1.100000 1.107609 1.000489 3.45e-09 5.20e-10 + 1.200000 1.086821 1.677552 3.13e-09 5.29e-10 + 1.300000 1.064777 1.277775 2.77e-09 5.30e-10 + 1.400000 1.041625 1.342455 2.38e-09 5.25e-10 + 1.500000 1.017531 1.642940 1.94e-09 5.15e-10 + 1.600000 0.992673 1.012112 1.46e-09 4.96e-10 + 1.700000 0.967253 1.714058 9.32e-10 4.72e-10 + 1.800000 0.941488 1.183867 3.54e-10 4.40e-10 + 1.900000 0.915617 1.437465 2.75e-10 4.01e-10 + 2.000000 0.889903 1.577082 9.56e-10 3.55e-10 + 2.100000 0.864625 1.056467 1.69e-09 3.06e-10 + 2.200000 0.840089 1.730920 2.47e-09 2.39e-10 + 2.300000 0.816616 1.101047 3.30e-09 1.74e-10 + 2.400000 0.794546 1.525051 4.15e-09 9.35e-11 + 2.500000 0.774227 1.496993 5.01e-09 9.06e-12 + 2.600000 0.756013 1.126857 5.86e-09 7.92e-11 + 2.700000 0.740246 1.727536 6.67e-09 1.81e-10 + 2.800000 0.727247 1.038393 7.38e-09 2.77e-10 + 2.900000 0.717301 1.600759 7.97e-09 3.85e-10 + 3.000000 0.710636 1.406380 8.40e-09 4.86e-10 + 3.100000 0.707412 1.214353 8.63e-09 5.84e-10 + 3.200000 0.707709 1.704026 8.65e-09 6.81e-10 + 3.300000 0.711520 1.004391 8.46e-09 7.58e-10 + 3.400000 0.718750 1.661225 8.06e-09 8.35e-10 + 3.500000 0.729227 1.310102 7.50e-09 8.89e-10 + 3.600000 0.742712 1.310080 6.80e-09 9.29e-10 + 3.700000 0.758914 1.661237 6.01e-09 9.56e-10 + 3.800000 0.777506 1.004387 5.16e-09 9.59e-10 + 3.900000 0.798144 1.704019 4.29e-09 9.58e-10 + 4.000000 0.820474 1.214374 3.43e-09 9.32e-10 + 4.100000 0.844149 1.406358 2.60e-09 9.00e-10 + 4.200000 0.868832 1.600774 1.81e-09 8.56e-10 + 4.300000 0.894204 1.038382 1.06e-09 7.97e-10 + 4.400000 0.919964 1.727533 3.69e-10 7.42e-10 + 4.500000 0.945834 1.126875 2.71e-10 6.69e-10 + 4.600000 0.971557 1.496974 8.58e-10 6.01e-10 + 4.700000 0.996898 1.525070 1.40e-09 5.27e-10 + 4.800000 1.021641 1.101030 1.88e-09 4.46e-10 + 4.900000 1.045589 1.730922 2.33e-09 3.74e-10 + 5.000000 1.068565 1.056480 2.73e-09 2.91e-10 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 2501, nstf = 252601 + u error = 4.671e-09, v error = 5.637e-10, total error = 3.327e-09 + Total RHS evals: Fs = 7504, Ff = 0 + Fast Newton iters = 653849 + Fast Newton conv fails = 0 + Fast Jacobian evals = 4169 diff --git a/examples/arkode/C_serial/ark_kpr_mri_2_4_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_2_4_0.002.out new file mode 100644 index 0000000000..6a22e6fbc0 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_2_4_0.002.out @@ -0,0 +1,69 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.002 + hf = 2e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MRI_GARK_ERK45a + fast solver: 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 1.78e-10 1.07e-11 + 0.200000 1.220669 1.551800 1.77e-10 2.15e-11 + 0.300000 1.215594 1.467737 1.75e-10 3.07e-11 + 0.400000 1.208524 1.154583 1.72e-10 3.88e-11 + 0.500000 1.199496 1.721908 1.68e-10 4.68e-11 + 0.600000 1.188557 1.023517 1.63e-10 5.25e-11 + 0.700000 1.175764 1.622751 1.57e-10 5.85e-11 + 0.800000 1.161186 1.374632 1.50e-10 6.28e-11 + 0.900000 1.144904 1.245763 1.42e-10 6.63e-11 + 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.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.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 + 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 + ------------------------------------------------------ + +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 = 1002902 diff --git a/examples/arkode/C_serial/ark_kpr_mri_3_2_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_3_2_0.001.out new file mode 100644 index 0000000000..00f9fbb881 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_3_2_0.001.out @@ -0,0 +1,69 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MERK21 + fast solver: ARKODE_HEUN_EULER_2_1_2 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 + 0.100000 1.223725 1.077464 2.66e-08 4.86e-08 + 0.200000 1.220669 1.551800 2.66e-08 1.34e-09 + 0.300000 1.215594 1.467737 2.62e-08 4.29e-09 + 0.400000 1.208524 1.154583 2.58e-08 2.80e-08 + 0.500000 1.199496 1.721908 2.53e-08 1.39e-08 + 0.600000 1.188557 1.023517 2.44e-08 4.48e-08 + 0.700000 1.175764 1.622750 2.37e-08 1.39e-08 + 0.800000 1.161186 1.374632 2.25e-08 9.64e-11 + 0.900000 1.144904 1.245763 2.14e-08 8.43e-09 + 1.000000 1.127010 1.691839 2.01e-08 2.07e-08 + 1.100000 1.107609 1.000490 1.84e-08 4.20e-08 + 1.200000 1.086821 1.677552 1.69e-08 2.25e-08 + 1.300000 1.064777 1.277775 1.48e-08 2.79e-09 + 1.400000 1.041625 1.342455 1.28e-08 4.44e-09 + 1.500000 1.017531 1.642940 1.04e-08 2.19e-08 + 1.600000 0.992673 1.012112 7.76e-09 3.67e-08 + 1.700000 0.967253 1.714058 5.06e-09 2.59e-08 + 1.800000 0.941488 1.183867 1.75e-09 1.13e-08 + 1.900000 0.915617 1.437465 1.44e-09 1.16e-08 + 2.000000 0.889903 1.577082 5.21e-09 1.82e-08 + 2.100000 0.864625 1.056467 9.17e-09 2.94e-08 + 2.200000 0.840089 1.730920 1.33e-08 2.47e-08 + 2.300000 0.816616 1.101047 1.79e-08 2.45e-08 + 2.400000 0.794546 1.525051 2.23e-08 1.36e-08 + 2.500000 0.774228 1.496993 2.71e-08 9.85e-09 + 2.600000 0.756013 1.126857 3.16e-08 2.30e-08 + 2.700000 0.740246 1.727536 3.59e-08 1.92e-08 + 2.800000 0.727247 1.038393 3.99e-08 4.04e-08 + 2.900000 0.717301 1.600759 4.28e-08 1.12e-08 + 3.000000 0.710636 1.406380 4.52e-08 2.44e-09 + 3.100000 0.707413 1.214353 4.63e-08 1.90e-08 + 3.200000 0.707709 1.704026 4.64e-08 1.14e-08 + 3.300000 0.711520 1.004391 4.55e-08 5.32e-08 + 3.400000 0.718750 1.661225 4.31e-08 8.10e-09 + 3.500000 0.729227 1.310102 4.03e-08 1.50e-08 + 3.600000 0.742712 1.310080 3.64e-08 1.43e-08 + 3.700000 0.758914 1.661237 3.21e-08 6.04e-09 + 3.800000 0.777506 1.004387 2.77e-08 5.53e-08 + 3.900000 0.798144 1.704019 2.29e-08 8.68e-09 + 4.000000 0.820474 1.214374 1.85e-08 2.42e-08 + 4.100000 0.844149 1.406358 1.38e-08 6.00e-09 + 4.200000 0.868832 1.600774 9.67e-09 4.99e-09 + 4.300000 0.894204 1.038382 5.70e-09 4.57e-08 + 4.400000 0.919964 1.727533 1.89e-09 1.31e-08 + 4.500000 0.945834 1.126875 1.34e-09 3.06e-08 + 4.600000 0.971557 1.496974 4.69e-09 4.31e-09 + 4.700000 0.996898 1.525070 7.45e-09 5.97e-09 + 4.800000 1.021641 1.101030 1.01e-08 2.99e-08 + 4.900000 1.045589 1.730922 1.25e-08 1.86e-08 + 5.000000 1.068565 1.056480 1.45e-08 3.56e-08 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 5000, nstf = 750000 + u error = 2.508e-08, v error = 2.443e-08, total error = 2.476e-08 + Total RHS evals: Fs = 10001, Ff = 1505001 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 deleted file mode 100644 index 9f53b0e3b4..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_4_0.002.out +++ /dev/null @@ -1,72 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.002 - hf = 2e-05 - G = -100 - w = 100 - e = 0.5 - solver: dirk-2/none (dirk slow, no fast) - reltol = 4.00e-06, abstol = 1.00e-11 - t u v uerr verr - ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 0.100000 1.223734 1.079428 9.43e-06 1.96e-03 - 0.200000 1.220669 1.551975 3.21e-07 1.75e-04 - 0.300000 1.215599 1.468008 5.52e-06 2.71e-04 - 0.400000 1.208526 1.155919 2.23e-06 1.34e-03 - 0.500000 1.199497 1.721561 8.79e-07 3.47e-04 - 0.600000 1.188564 1.025537 7.38e-06 2.02e-03 - 0.700000 1.175763 1.622485 1.23e-06 2.66e-04 - 0.800000 1.161186 1.374900 2.52e-07 2.68e-04 - 0.900000 1.144904 1.246450 1.12e-07 6.87e-04 - 1.000000 1.127010 1.691322 5.38e-07 5.17e-04 - 1.100000 1.107615 1.002500 5.42e-06 2.01e-03 - 1.200000 1.086818 1.677003 2.06e-06 5.49e-04 - 1.300000 1.064782 1.278198 5.48e-06 4.23e-04 - 1.400000 1.041624 1.342655 1.37e-06 2.00e-04 - 1.500000 1.017531 1.642375 7.35e-07 5.65e-04 - 1.600000 0.992677 1.013911 3.39e-06 1.80e-03 - 1.700000 0.967249 1.713353 3.48e-06 7.05e-04 - 1.800000 0.941493 1.184579 5.35e-06 7.12e-04 - 1.900000 0.915615 1.437305 2.35e-06 1.61e-04 - 2.000000 0.889904 1.576564 1.28e-06 5.18e-04 - 2.100000 0.864627 1.057868 1.53e-06 1.40e-03 - 2.200000 0.840087 1.730117 2.43e-06 8.03e-04 - 2.300000 0.816622 1.102136 5.78e-06 1.09e-03 - 2.400000 0.794543 1.524625 3.12e-06 4.26e-04 - 2.500000 0.774230 1.496597 2.15e-06 3.96e-04 - 2.600000 0.756013 1.127800 7.68e-08 9.44e-04 - 2.700000 0.740244 1.726696 1.85e-06 8.41e-04 - 2.800000 0.727253 1.039861 5.33e-06 1.47e-03 - 2.900000 0.717298 1.600138 3.24e-06 6.21e-04 - 3.000000 0.710633 1.406200 3.03e-06 1.79e-04 - 3.100000 0.707411 1.214845 1.22e-06 4.92e-04 - 3.200000 0.707708 1.703196 1.21e-06 8.30e-04 - 3.300000 0.711524 1.006102 4.35e-06 1.71e-03 - 3.400000 0.718746 1.660466 3.40e-06 7.59e-04 - 3.500000 0.729231 1.310194 4.07e-06 9.26e-05 - 3.600000 0.742710 1.310190 2.18e-06 1.11e-04 - 3.700000 0.758913 1.660462 4.65e-07 7.74e-04 - 3.800000 0.777509 1.006087 3.06e-06 1.70e-03 - 3.900000 0.798140 1.703188 3.88e-06 8.31e-04 - 4.000000 0.820479 1.214819 4.63e-06 4.45e-04 - 4.100000 0.844147 1.406163 2.79e-06 1.95e-04 - 4.200000 0.868833 1.600102 4.16e-07 6.73e-04 - 4.300000 0.894205 1.039813 1.50e-06 1.43e-03 - 4.400000 0.919961 1.726651 2.81e-06 8.83e-04 - 4.500000 0.945839 1.127737 5.31e-06 8.63e-04 - 4.600000 0.971554 1.496541 3.29e-06 4.33e-04 - 4.700000 0.996899 1.524547 1.45e-06 5.23e-04 - 4.800000 1.021641 1.102066 8.60e-08 1.04e-03 - 4.900000 1.045587 1.730025 2.02e-06 8.96e-04 - 5.000000 1.068570 1.057773 5.26e-06 1.29e-03 - ------------------------------------------------------ - -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 = 750350 - Slow Newton iters = 4641 - Slow Newton conv fails = 0 - Slow Jacobian evals = 126 diff --git a/examples/arkode/C_serial/ark_kpr_mri_4_3_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_4_3_0.001.out new file mode 100644 index 0000000000..65f7d03033 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_4_3_0.001.out @@ -0,0 +1,69 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MERK32 + fast solver: 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 8.92e-10 3.75e-11 + 0.200000 1.220669 1.551800 8.86e-10 7.57e-11 + 0.300000 1.215594 1.467737 8.75e-10 1.10e-10 + 0.400000 1.208524 1.154583 8.59e-10 1.40e-10 + 0.500000 1.199496 1.721908 8.39e-10 1.66e-10 + 0.600000 1.188557 1.023517 8.15e-10 1.89e-10 + 0.700000 1.175764 1.622751 7.85e-10 2.09e-10 + 0.800000 1.161186 1.374632 7.50e-10 2.25e-10 + 0.900000 1.144904 1.245763 7.10e-10 2.38e-10 + 1.000000 1.127010 1.691839 6.65e-10 2.47e-10 + 1.100000 1.107609 1.000489 6.13e-10 2.58e-10 + 1.200000 1.086821 1.677552 5.56e-10 2.57e-10 + 1.300000 1.064777 1.277775 4.92e-10 2.59e-10 + 1.400000 1.041625 1.342455 4.21e-10 2.56e-10 + 1.500000 1.017531 1.642940 3.43e-10 2.47e-10 + 1.600000 0.992673 1.012112 2.56e-10 2.42e-10 + 1.700000 0.967253 1.714058 1.61e-10 2.25e-10 + 1.800000 0.941488 1.183867 5.78e-11 2.12e-10 + 1.900000 0.915617 1.437465 5.52e-11 1.90e-10 + 2.000000 0.889903 1.577082 1.78e-10 1.66e-10 + 2.100000 0.864625 1.056467 3.09e-10 1.42e-10 + 2.200000 0.840089 1.730920 4.50e-10 1.07e-10 + 2.300000 0.816616 1.101047 5.97e-10 7.65e-11 + 2.400000 0.794546 1.525051 7.50e-10 3.53e-11 + 2.500000 0.774227 1.496993 9.05e-10 6.53e-12 + 2.600000 0.756013 1.126857 1.06e-09 4.93e-11 + 2.700000 0.740246 1.727536 1.20e-09 1.01e-10 + 2.800000 0.727247 1.038393 1.33e-09 1.46e-10 + 2.900000 0.717301 1.600759 1.43e-09 2.00e-10 + 3.000000 0.710636 1.406380 1.50e-09 2.49e-10 + 3.100000 0.707412 1.214353 1.54e-09 2.95e-10 + 3.200000 0.707709 1.704026 1.55e-09 3.43e-10 + 3.300000 0.711520 1.004391 1.51e-09 3.77e-10 + 3.400000 0.718750 1.661225 1.44e-09 4.14e-10 + 3.500000 0.729227 1.310102 1.33e-09 4.38e-10 + 3.600000 0.742712 1.310080 1.21e-09 4.56e-10 + 3.700000 0.758914 1.661237 1.07e-09 4.68e-10 + 3.800000 0.777506 1.004387 9.14e-10 4.66e-10 + 3.900000 0.798144 1.704019 7.60e-10 4.65e-10 + 4.000000 0.820474 1.214374 6.06e-10 4.50e-10 + 4.100000 0.844149 1.406358 4.58e-10 4.31e-10 + 4.200000 0.868832 1.600774 3.16e-10 4.10e-10 + 4.300000 0.894204 1.038382 1.84e-10 3.81e-10 + 4.400000 0.919964 1.727533 6.02e-11 3.51e-10 + 4.500000 0.945834 1.126875 5.36e-11 3.19e-10 + 4.600000 0.971557 1.496974 1.58e-10 2.82e-10 + 4.700000 0.996898 1.525070 2.54e-10 2.47e-10 + 4.800000 1.021641 1.101030 3.41e-10 2.09e-10 + 4.900000 1.045589 1.730922 4.20e-10 1.72e-10 + 5.000000 1.068565 1.056480 4.91e-10 1.34e-10 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 5000, nstf = 1085000 + u error = 8.345e-10, v error = 2.743e-10, total error = 6.212e-10 + Total RHS evals: Fs = 15001, Ff = 3260001 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 deleted file mode 100644 index 1a38aa16e6..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_5_0.002.out +++ /dev/null @@ -1,69 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.002 - hf = 2e-05 - G = -100 - w = 100 - e = 0.5 - 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 1.78e-10 1.07e-11 - 0.200000 1.220669 1.551800 1.77e-10 2.15e-11 - 0.300000 1.215594 1.467737 1.75e-10 3.07e-11 - 0.400000 1.208524 1.154583 1.72e-10 3.88e-11 - 0.500000 1.199496 1.721908 1.68e-10 4.68e-11 - 0.600000 1.188557 1.023517 1.63e-10 5.25e-11 - 0.700000 1.175764 1.622751 1.57e-10 5.85e-11 - 0.800000 1.161186 1.374632 1.50e-10 6.28e-11 - 0.900000 1.144904 1.245763 1.42e-10 6.63e-11 - 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.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.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.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.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.714e-11, total error = 1.297e-10 - Total RHS evals: Fs = 12506, Ff = 1000450 diff --git a/examples/arkode/C_serial/ark_kpr_mri_5_4_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_5_4_0.001.out new file mode 100644 index 0000000000..817fa1eff9 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_5_4_0.001.out @@ -0,0 +1,69 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MERK43 + fast solver: 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 2.23e-11 1.15e-12 + 0.200000 1.220669 1.551800 2.21e-11 1.92e-12 + 0.300000 1.215594 1.467737 2.19e-11 2.71e-12 + 0.400000 1.208524 1.154583 2.15e-11 3.14e-12 + 0.500000 1.199496 1.721908 2.10e-11 4.37e-12 + 0.600000 1.188557 1.023517 2.03e-11 4.94e-12 + 0.700000 1.175764 1.622751 1.96e-11 5.31e-12 + 0.800000 1.161186 1.374632 1.87e-11 5.82e-12 + 0.900000 1.144904 1.245763 1.77e-11 5.97e-12 + 1.000000 1.127010 1.691839 1.66e-11 6.30e-12 + 1.100000 1.107609 1.000489 1.52e-11 2.13e-12 + 1.200000 1.086821 1.677552 1.38e-11 6.72e-12 + 1.300000 1.064777 1.277775 1.22e-11 4.31e-12 + 1.400000 1.041625 1.342455 1.04e-11 4.75e-12 + 1.500000 1.017531 1.642940 8.47e-12 6.69e-12 + 1.600000 0.992673 1.012112 6.30e-12 2.43e-12 + 1.700000 0.967253 1.714058 3.95e-12 6.77e-12 + 1.800000 0.941488 1.183867 1.35e-12 3.05e-12 + 1.900000 0.915617 1.437465 1.47e-12 4.22e-12 + 2.000000 0.889903 1.577082 4.53e-12 4.66e-12 + 2.100000 0.864625 1.056467 7.81e-12 6.12e-13 + 2.200000 0.840089 1.730920 1.13e-11 4.29e-12 + 2.300000 0.816616 1.101047 1.50e-11 6.09e-13 + 2.400000 0.794546 1.525051 1.88e-11 1.21e-12 + 2.500000 0.774227 1.496993 2.27e-11 7.39e-14 + 2.600000 0.756013 1.126857 2.64e-11 3.44e-12 + 2.700000 0.740246 1.727536 3.00e-11 6.68e-13 + 2.800000 0.727247 1.038393 3.32e-11 6.30e-12 + 2.900000 0.717301 1.600759 3.58e-11 3.89e-12 + 3.000000 0.710636 1.406380 3.76e-11 6.33e-12 + 3.100000 0.707412 1.214353 3.86e-11 8.76e-12 + 3.200000 0.707709 1.704026 3.86e-11 6.62e-12 + 3.300000 0.711520 1.004391 3.77e-11 1.21e-11 + 3.400000 0.718750 1.661225 3.59e-11 8.63e-12 + 3.500000 0.729227 1.310102 3.33e-11 1.15e-11 + 3.600000 0.742712 1.310080 3.02e-11 1.19e-11 + 3.700000 0.758914 1.661237 2.66e-11 9.88e-12 + 3.800000 0.777506 1.004387 2.28e-11 1.42e-11 + 3.900000 0.798144 1.704019 1.89e-11 9.52e-12 + 4.000000 0.820474 1.214374 1.51e-11 1.23e-11 + 4.100000 0.844149 1.406358 1.14e-11 1.30e-11 + 4.200000 0.868832 1.600774 7.85e-12 1.11e-11 + 4.300000 0.894204 1.038382 4.53e-12 1.12e-11 + 4.400000 0.919964 1.727533 1.45e-12 9.88e-12 + 4.500000 0.945834 1.126875 1.40e-12 8.44e-12 + 4.600000 0.971557 1.496974 4.01e-12 8.57e-12 + 4.700000 0.996898 1.525070 6.40e-12 6.35e-12 + 4.800000 1.021641 1.101030 8.58e-12 6.61e-12 + 4.900000 1.045589 1.730922 1.06e-11 4.80e-12 + 5.000000 1.068565 1.056480 1.23e-11 3.61e-12 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 5000, nstf = 1425000 + u error = 2.086e-11, v error = 7.078e-12, total error = 1.557e-11 + Total RHS evals: Fs = 30001, Ff = 5705001 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 deleted file mode 100644 index 7929d73e39..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_6_0.005.out +++ /dev/null @@ -1,69 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.005 - hf = 5e-05 - G = -100 - w = 100 - e = 0.5 - 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 8.08e-09 4.56e-10 - 0.200000 1.220669 1.551800 8.03e-09 9.03e-10 - 0.300000 1.215594 1.467737 7.94e-09 1.30e-09 - 0.400000 1.208524 1.154583 7.80e-09 1.66e-09 - 0.500000 1.199496 1.721908 7.62e-09 1.97e-09 - 0.600000 1.188557 1.023517 7.40e-09 2.24e-09 - 0.700000 1.175764 1.622751 7.13e-09 2.47e-09 - 0.800000 1.161186 1.374632 6.82e-09 2.66e-09 - 0.900000 1.144904 1.245763 6.46e-09 2.81e-09 - 1.000000 1.127010 1.691839 6.05e-09 2.92e-09 - 1.100000 1.107609 1.000489 5.59e-09 3.00e-09 - 1.200000 1.086821 1.677552 5.08e-09 3.04e-09 - 1.300000 1.064777 1.277775 4.50e-09 3.04e-09 - 1.400000 1.041625 1.342455 3.87e-09 3.00e-09 - 1.500000 1.017531 1.642940 3.17e-09 2.93e-09 - 1.600000 0.992673 1.012112 2.39e-09 2.82e-09 - 1.700000 0.967253 1.714058 1.54e-09 2.67e-09 - 1.800000 0.941488 1.183867 6.13e-10 2.48e-09 - 1.900000 0.915617 1.437465 4.00e-10 2.25e-09 - 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 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 - 3.000000 0.710636 1.406380 1.36e-08 2.89e-09 - 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.85e-09 - 3.500000 0.729227 1.310102 1.22e-08 5.15e-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.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 - 4.400000 0.919964 1.727533 6.51e-10 4.18e-09 - 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.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 - ------------------------------------------------------ - -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 = 300350 diff --git a/examples/arkode/C_serial/ark_kpr_mri_6_5_0.001.out b/examples/arkode/C_serial/ark_kpr_mri_6_5_0.001.out new file mode 100644 index 0000000000..8f12b1e794 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_6_5_0.001.out @@ -0,0 +1,69 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.001 + hf = 1e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MERK54 + fast solver: ARKODE_DORMAND_PRINCE_7_4_5 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 + 0.100000 1.223725 1.077464 4.46e-13 2.08e-13 + 0.200000 1.220669 1.551800 4.42e-13 6.88e-15 + 0.300000 1.215594 1.467737 4.37e-13 7.22e-14 + 0.400000 1.208524 1.154583 4.28e-13 3.99e-13 + 0.500000 1.199496 1.721908 4.18e-13 1.65e-13 + 0.600000 1.188557 1.023517 4.07e-13 1.50e-13 + 0.700000 1.175764 1.622751 3.88e-13 2.86e-14 + 0.800000 1.161186 1.374632 3.73e-13 1.48e-13 + 0.900000 1.144904 1.245763 3.52e-13 3.93e-14 + 1.000000 1.127010 1.691839 3.32e-13 4.77e-14 + 1.100000 1.107609 1.000489 3.33e-13 4.28e-12 + 1.200000 1.086821 1.677552 2.90e-13 2.44e-13 + 1.300000 1.064777 1.277775 2.73e-13 2.18e-12 + 1.400000 1.041625 1.342455 2.24e-13 1.65e-12 + 1.500000 1.017531 1.642940 1.91e-13 4.45e-13 + 1.600000 0.992673 1.012112 1.51e-13 3.56e-12 + 1.700000 0.967253 1.714058 9.28e-14 1.09e-12 + 1.800000 0.941488 1.183867 5.50e-14 2.24e-12 + 1.900000 0.915617 1.437465 1.53e-14 5.52e-13 + 2.000000 0.889903 1.577082 6.75e-14 4.87e-13 + 2.100000 0.864625 1.056467 1.36e-13 2.86e-12 + 2.200000 0.840089 1.730920 2.15e-13 1.59e-12 + 2.300000 0.816616 1.101047 2.74e-13 2.40e-12 + 2.400000 0.794546 1.525051 3.67e-13 3.79e-13 + 2.500000 0.774227 1.496993 4.35e-13 3.14e-13 + 2.600000 0.756013 1.126857 5.16e-13 2.06e-12 + 2.700000 0.740246 1.727536 5.92e-13 1.91e-12 + 2.800000 0.727247 1.038393 6.45e-13 2.49e-12 + 2.900000 0.717301 1.600759 7.16e-13 1.19e-12 + 3.000000 0.710636 1.406380 7.43e-13 6.88e-15 + 3.100000 0.707412 1.214353 7.73e-13 1.22e-12 + 3.200000 0.707709 1.704026 7.76e-13 2.02e-12 + 3.300000 0.711520 1.004391 7.50e-13 2.48e-12 + 3.400000 0.718750 1.661225 7.31e-13 1.78e-12 + 3.500000 0.729227 1.310102 6.67e-13 4.31e-13 + 3.600000 0.742712 1.310080 6.17e-13 4.42e-13 + 3.700000 0.758914 1.661237 5.44e-13 1.88e-12 + 3.800000 0.777506 1.004387 4.64e-13 2.38e-12 + 3.900000 0.798144 1.704019 4.01e-13 2.16e-12 + 4.000000 0.820474 1.214374 3.08e-13 9.57e-13 + 4.100000 0.844149 1.406358 2.21e-13 2.06e-12 + 4.200000 0.868832 1.600774 1.53e-13 7.17e-13 + 4.300000 0.894204 1.038382 8.45e-14 1.60e-12 + 4.400000 0.919964 1.727533 2.65e-14 1.04e-12 + 4.500000 0.945834 1.126875 3.23e-14 4.35e-13 + 4.600000 0.971557 1.496974 8.37e-14 1.42e-12 + 4.700000 0.996898 1.525070 1.30e-13 1.38e-13 + 4.800000 1.021641 1.101030 1.79e-13 1.33e-12 + 4.900000 1.045589 1.730922 2.13e-13 5.01e-13 + 5.000000 1.068565 1.056480 2.51e-13 2.92e-13 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 5000, nstf = 1615000 + u error = 4.177e-13, v error = 1.555e-12, total error = 1.139e-12 + Total RHS evals: Fs = 50051, Ff = 9715052 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 deleted file mode 100644 index 460bf53318..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_7_0.001.out +++ /dev/null @@ -1,72 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.001 - hf = 1e-05 - G = -100 - w = 100 - e = 0.5 - solver: dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve decoupled - reltol = 1.00e-09, abstol = 1.00e-11 - t u v uerr verr - ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 0.100000 1.223725 1.077464 4.01e-10 5.72e-11 - 0.200000 1.220669 1.551800 4.06e-10 1.12e-10 - 0.300000 1.215594 1.467737 3.95e-10 1.60e-10 - 0.400000 1.208524 1.154583 3.88e-10 2.03e-10 - 0.500000 1.199496 1.721908 3.80e-10 2.39e-10 - 0.600000 1.188557 1.023517 3.85e-10 2.71e-10 - 0.700000 1.175764 1.622751 3.48e-10 3.02e-10 - 0.800000 1.161186 1.374632 3.42e-10 3.23e-10 - 0.900000 1.144904 1.245763 3.24e-10 3.40e-10 - 1.000000 1.127010 1.691839 3.03e-10 3.56e-10 - 1.100000 1.107609 1.000489 2.77e-10 3.66e-10 - 1.200000 1.086821 1.677552 2.55e-10 3.66e-10 - 1.300000 1.064777 1.277775 2.29e-10 3.68e-10 - 1.400000 1.041625 1.342455 1.96e-10 3.63e-10 - 1.500000 1.017531 1.642940 1.59e-10 3.51e-10 - 1.600000 0.992673 1.012112 1.22e-10 3.42e-10 - 1.700000 0.967253 1.714058 7.84e-11 3.18e-10 - 1.800000 0.941488 1.183867 3.53e-11 2.98e-10 - 1.900000 0.915617 1.437465 1.65e-11 2.68e-10 - 2.000000 0.889903 1.577082 7.04e-11 2.33e-10 - 2.100000 0.864625 1.056467 1.30e-10 1.98e-10 - 2.200000 0.840089 1.730920 1.96e-10 1.49e-10 - 2.300000 0.816616 1.101047 2.60e-10 1.03e-10 - 2.400000 0.794546 1.525051 3.29e-10 4.53e-11 - 2.500000 0.774227 1.496993 4.02e-10 1.97e-11 - 2.600000 0.756013 1.126857 4.66e-10 8.15e-11 - 2.700000 0.740246 1.727536 5.35e-10 1.53e-10 - 2.800000 0.727247 1.038393 5.92e-10 2.19e-10 - 2.900000 0.717301 1.600759 7.54e-10 2.96e-10 - 3.000000 0.710636 1.406380 6.69e-10 3.66e-10 - 3.100000 0.707412 1.214353 6.92e-10 4.31e-10 - 3.200000 0.707709 1.704026 6.98e-10 4.97e-10 - 3.300000 0.711520 1.004391 6.80e-10 5.46e-10 - 3.400000 0.718750 1.661225 6.52e-10 5.96e-10 - 3.500000 0.729227 1.310102 6.05e-10 6.29e-10 - 3.600000 0.742712 1.310080 5.52e-10 6.53e-10 - 3.700000 0.758914 1.661237 4.96e-10 6.77e-10 - 3.800000 0.777506 1.004387 4.21e-10 6.74e-10 - 3.900000 0.798144 1.704019 3.55e-10 6.70e-10 - 4.000000 0.820474 1.214374 2.86e-10 6.48e-10 - 4.100000 0.844149 1.406358 2.57e-10 6.16e-10 - 4.200000 0.868832 1.600774 1.53e-10 5.75e-10 - 4.300000 0.894204 1.038382 9.25e-11 5.57e-10 - 4.400000 0.919964 1.727533 3.64e-11 4.94e-10 - 4.500000 0.945834 1.126875 1.44e-11 4.68e-10 - 4.600000 0.971557 1.496974 6.29e-11 4.03e-10 - 4.700000 0.996898 1.525070 1.03e-10 3.50e-10 - 4.800000 1.021641 1.101030 1.45e-10 3.12e-10 - 4.900000 1.045589 1.730922 1.85e-10 2.34e-10 - 5.000000 1.068565 1.056480 3.89e-11 2.06e-10 - ------------------------------------------------------ - -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 = 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_2_0.002.out b/examples/arkode/C_serial/ark_kpr_mri_7_2_0.002.out new file mode 100644 index 0000000000..899ff3f7a8 --- /dev/null +++ b/examples/arkode/C_serial/ark_kpr_mri_7_2_0.002.out @@ -0,0 +1,73 @@ + +Multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + hs = 0.002 + hf = 2e-05 + G = -100 + w = 100 + e = 0.5 + slow solver: ARKODE_MRI_GARK_IRK21a + reltol = 4.00e-06, abstol = 1.00e-11 + fast solver: ARKODE_HEUN_EULER_2_1_2 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 + 0.100000 1.223725 1.077464 2.77e-08 1.95e-07 + 0.200000 1.220666 1.551800 2.88e-06 1.72e-08 + 0.300000 1.215594 1.467737 5.07e-10 2.58e-08 + 0.400000 1.208524 1.154583 1.40e-07 8.86e-08 + 0.500000 1.199497 1.721908 3.78e-07 7.73e-08 + 0.600000 1.188557 1.023517 3.84e-07 1.66e-07 + 0.700000 1.175764 1.622750 1.13e-08 7.38e-08 + 0.800000 1.161181 1.374632 5.67e-06 2.19e-08 + 0.900000 1.144904 1.245763 5.40e-08 6.40e-09 + 1.000000 1.127010 1.691839 4.83e-09 1.22e-07 + 1.100000 1.107609 1.000490 3.50e-07 1.24e-07 + 1.200000 1.086820 1.677552 1.80e-07 1.28e-07 + 1.300000 1.064777 1.277775 2.08e-08 5.87e-08 + 1.400000 1.041625 1.342455 6.57e-08 8.60e-08 + 1.500000 1.017531 1.642940 1.02e-08 1.45e-07 + 1.600000 0.992673 1.012112 7.42e-10 8.75e-08 + 1.700000 0.967251 1.714058 1.26e-06 1.96e-07 + 1.800000 0.941487 1.183866 5.89e-07 4.82e-08 + 1.900000 0.915617 1.437465 8.48e-11 1.34e-07 + 2.000000 0.889902 1.577082 8.30e-08 1.60e-07 + 2.100000 0.864625 1.056467 2.81e-08 3.18e-08 + 2.200000 0.840089 1.730920 2.75e-07 2.23e-07 + 2.300000 0.816616 1.101047 1.41e-08 3.14e-08 + 2.400000 0.794545 1.525051 5.03e-07 1.81e-07 + 2.500000 0.774227 1.496993 7.88e-10 1.70e-07 + 2.600000 0.756013 1.126857 1.27e-07 8.49e-08 + 2.700000 0.740246 1.727536 2.32e-07 2.61e-07 + 2.800000 0.727247 1.038393 6.92e-08 2.11e-08 + 2.900000 0.717301 1.600759 1.26e-08 2.31e-07 + 3.000000 0.710630 1.406379 6.27e-06 1.95e-07 + 3.100000 0.707412 1.214352 2.29e-08 1.59e-07 + 3.200000 0.707709 1.704026 1.45e-09 2.91e-07 + 3.300000 0.711519 1.004391 8.68e-08 2.89e-08 + 3.400000 0.718749 1.661225 2.14e-07 2.74e-07 + 3.500000 0.729227 1.310102 1.60e-08 2.21e-07 + 3.600000 0.742712 1.310080 1.03e-08 2.20e-07 + 3.700000 0.758914 1.661236 2.40e-08 2.91e-07 + 3.800000 0.777506 1.004387 4.29e-09 3.73e-08 + 3.900000 0.798143 1.704018 8.32e-07 3.27e-07 + 4.000000 0.820474 1.214374 7.44e-07 1.84e-07 + 4.100000 0.844149 1.406358 2.75e-09 2.40e-07 + 4.200000 0.868832 1.600774 1.39e-07 2.70e-07 + 4.300000 0.894204 1.038382 6.99e-08 5.45e-08 + 4.400000 0.919964 1.727533 3.58e-07 3.16e-07 + 4.500000 0.945834 1.126875 7.57e-09 1.27e-07 + 4.600000 0.971557 1.496973 7.25e-07 2.44e-07 + 4.700000 0.996898 1.525070 4.95e-08 2.35e-07 + 4.800000 1.021640 1.101030 1.22e-07 1.22e-07 + 4.900000 1.045589 1.730922 1.36e-07 3.02e-07 + 5.000000 1.068565 1.056480 2.82e-07 6.29e-08 + ------------------------------------------------------ + +Final Solver Statistics: + Steps: nsts = 2501, nstf = 250100 + u error = 1.301e-06, v error = 1.744e-07, total error = 9.284e-07 + Total RHS evals: Fs = 7002, Ff = 502702 + Slow Newton iters = 4500 + Slow Newton conv fails = 0 + Slow Jacobian evals = 126 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 deleted file mode 100644 index f96e203514..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_8_0.001.out +++ /dev/null @@ -1,72 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.001 - hf = 1e-05 - G = -100 - w = 100 - e = 0.5 - solver: ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled - reltol = 1.00e-09, abstol = 1.00e-11 - t u v uerr verr - ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 0.100000 1.223725 1.077464 2.79e-10 2.64e-11 - 0.200000 1.220669 1.551800 1.84e-10 4.85e-11 - 0.300000 1.215594 1.467737 1.86e-10 6.94e-11 - 0.400000 1.208524 1.154583 1.83e-10 8.79e-11 - 0.500000 1.199496 1.721908 1.82e-10 1.04e-10 - 0.600000 1.188557 1.023517 1.72e-10 1.20e-10 - 0.700000 1.175764 1.622751 1.67e-10 1.28e-10 - 0.800000 1.161186 1.374632 1.63e-10 1.39e-10 - 0.900000 1.144904 1.245763 1.52e-10 1.47e-10 - 1.000000 1.127010 1.691839 1.39e-10 1.50e-10 - 1.100000 1.107609 1.000489 1.29e-10 1.51e-10 - 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.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.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.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 - 2.900000 0.717301 1.600759 3.04e-10 1.27e-10 - 3.000000 0.710636 1.406380 3.17e-10 1.58e-10 - 3.100000 0.707412 1.214353 3.28e-10 1.88e-10 - 3.200000 0.707709 1.704026 3.27e-10 2.11e-10 - 3.300000 0.711520 1.004391 3.17e-10 2.40e-10 - 3.400000 0.718750 1.661225 3.04e-10 2.54e-10 - 3.500000 0.729227 1.310102 2.87e-10 2.71e-10 - 3.600000 0.742712 1.310080 2.57e-10 2.81e-10 - 3.700000 0.758914 1.661237 2.23e-10 2.83e-10 - 3.800000 0.777506 1.004387 1.91e-10 2.87e-10 - 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.64e-11 2.60e-10 - 4.300000 0.894204 1.038382 3.79e-11 2.21e-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.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 - ------------------------------------------------------ - -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 = 1530050 - Slow Newton iters = 30341 - 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_8_3_0.001_-100_100_0.5_1.out similarity index 93% rename from examples/arkode/C_serial/ark_kpr_mri_7_0.001_-100_100_0.5_1.out rename to examples/arkode/C_serial/ark_kpr_mri_8_3_0.001_-100_100_0.5_1.out index 38dc23acf1..fe05e8f5db 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_8_3_0.001_-100_100_0.5_1.out @@ -6,8 +6,9 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: G = -100 w = 100 e = 0.5 - solver: dirk-3/exp-3 (MRI-GARK-ESDIRK34a / ERK-3-3) -- solve decoupled - reltol = 1.00e-09, abstol = 1.00e-11 + slow solver: ARKODE_MRI_GARK_ESDIRK34a + reltol = 1.00e-09, abstol = 1.00e-11 + fast solver: erk-3-3 t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 @@ -51,7 +52,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.43e-10 6.14e-10 + 4.100000 0.844149 1.406358 3.44e-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 +67,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 = 1530050 + Total RHS evals: Fs = 35313, Ff = 1535001 Slow Newton iters = 30312 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 deleted file mode 100644 index 665cd0a588..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_9_0.001.out +++ /dev/null @@ -1,72 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.001 - hf = 1e-05 - G = -100 - w = 100 - e = 0.5 - solver: imexark4/exp-4 (IMEX-MRI4 / ERK-4-4) -- solve decoupled - reltol = 1.00e-12, abstol = 1.00e-14 - 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.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.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.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 = 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 deleted file mode 100644 index a227a0db6a..0000000000 --- a/examples/arkode/C_serial/ark_kpr_mri_9_0.001_-100_100_0.5_1.out +++ /dev/null @@ -1,72 +0,0 @@ - -Multirate nonlinear Kvaerno-Prothero-Robinson test problem: - time domain: (0,5] - hs = 0.001 - hf = 1e-05 - G = -100 - w = 100 - e = 0.5 - solver: imexark4/exp-4 (IMEX-MRI4 / ERK-4-4) -- solve decoupled - reltol = 1.00e-12, abstol = 1.00e-14 - t u v uerr verr - ------------------------------------------------------ - 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 - 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 - 0.500000 1.199496 1.721908 1.57e-11 1.74e-12 - 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.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 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 = 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_kpr_mri_8_0.001_-100_100_0.5_1.out b/examples/arkode/C_serial/ark_kpr_mri_9_3_0.001_-100_100_0.5_1.out similarity index 95% rename from examples/arkode/C_serial/ark_kpr_mri_8_0.001_-100_100_0.5_1.out rename to examples/arkode/C_serial/ark_kpr_mri_9_3_0.001_-100_100_0.5_1.out index f9d68539de..6eaf5ec418 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_9_3_0.001_-100_100_0.5_1.out @@ -6,8 +6,9 @@ Multirate nonlinear Kvaerno-Prothero-Robinson test problem: G = -100 w = 100 e = 0.5 - solver: ars343/exp-3 (IMEX-MRI3b / ERK-3-3) -- solve decoupled - reltol = 1.00e-09, abstol = 1.00e-11 + slow solver: ARKODE_IMEX_MRI_GARK3b + reltol = 1.00e-09, abstol = 1.00e-11 + fast solver: erk-3-3 t u v uerr verr ------------------------------------------------------ 0.000000 1.224745 1.732051 0.00e+00 0.00e+00 @@ -66,7 +67,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 = 1530050 + Total RHS evals: Fse = 20001, Fsi = 35342, Ff = 1535001 Slow Newton iters = 30341 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.c b/examples/arkode/C_serial/ark_onewaycouple_mri.c index 78e1ede79c..623177acfc 100644 --- a/examples/arkode/C_serial/ark_onewaycouple_mri.c +++ b/examples/arkode/C_serial/ark_onewaycouple_mri.c @@ -148,11 +148,8 @@ int main(void) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options diff --git a/examples/arkode/C_serial/ark_onewaycouple_mri.out b/examples/arkode/C_serial/ark_onewaycouple_mri.out index 3769f0e775..6b5ad2f798 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 = 36010 + Total RHS evals: Fs = 3001, Ff = 37001 diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c index e6a5b6d138..2bb420efc2 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.c +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.c @@ -157,11 +157,8 @@ int main(void) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options diff --git a/examples/arkode/C_serial/ark_reaction_diffusion_mri.out b/examples/arkode/C_serial/ark_reaction_diffusion_mri.out index f8cd47dfdc..34af3937e9 100644 --- a/examples/arkode/C_serial/ark_reaction_diffusion_mri.out +++ b/examples/arkode/C_serial/ark_reaction_diffusion_mri.out @@ -51,6 +51,7 @@ Last step size = 0.001 Current step size = 0.001 Explicit slow RHS fn evals = 9004 Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 NLS iters = 0 NLS fails = 0 NLS iters per step = 0 @@ -68,7 +69,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 = 459183 +Explicit RHS fn evals = 462155 Implicit RHS fn evals = 0 NLS iters = 0 NLS fails = 0 diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.c b/examples/arkode/C_serial/ark_twowaycouple_mri.c index 67b5415850..de7263c9c2 100644 --- a/examples/arkode/C_serial/ark_twowaycouple_mri.c +++ b/examples/arkode/C_serial/ark_twowaycouple_mri.c @@ -127,11 +127,8 @@ int main(void) if (check_retval(&retval, "ARKodeSetFixedStep", 1)) { return 1; } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } /* * Create the slow integrator and set options diff --git a/examples/arkode/C_serial/ark_twowaycouple_mri.out b/examples/arkode/C_serial/ark_twowaycouple_mri.out index 8aee3f02b7..96603859bf 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 = 306173 + Total RHS evals: Fs = 6004, Ff = 308155 diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 index 7556117b4d..a4f520a28c 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.f90 @@ -886,9 +886,9 @@ program main end if ! Create inner stepper */ - retval = FARKStepCreateMRIStepInnerStepper(inner_arkode_mem, inner_stepper) + retval = FARKodeCreateMRIStepInnerStepper(inner_arkode_mem, inner_stepper) if (retval /= 0) then - print *, 'ERROR: FARKStepCreateMRIStepInnerStepper failed' + print *, 'ERROR: FARKodeCreateMRIStepInnerStepper failed' stop 1 end if diff --git a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out index 9bdbea5dcb..036ba341ee 100644 --- a/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out +++ b/examples/arkode/F2003_serial/ark_kpr_mri_f2003.out @@ -63,4 +63,4 @@ 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 = 151853 + Total RHS evals: Fs = 1504, Ff = 152305 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 c5001c9ed2..30dd3330cd 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 @@ -63,4 +63,4 @@ 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 = 757853 + Total RHS evals: Fs = 7504, Ff = 760305 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 c84e3cde4b..d49bb3b964 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 @@ -63,4 +63,4 @@ 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 = 757853 + Total RHS evals: Fs = 5003, Ff = 760305 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 fb98664760..b3260e55ab 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 @@ -63,4 +63,4 @@ 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 = 151853 + Total RHS evals: Fs = 1504, Ff = 152305 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 22fca6299a..3814478dc7 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 @@ -64,7 +64,7 @@ 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 = 750350 + Total RHS evals: Fs = 7143, Ff = 752802 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 48dd3ab5e5..848386387e 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 @@ -31,36 +31,36 @@ 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 + 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.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.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.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 + 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 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 2501, nstf = 250100 - u error = 0.166E-09, v error = 0.771E-10, total error = 0.130E-09 - Total RHS evals: Fs = 12506, Ff = 1000450 + u error = 0.166E-09, v error = 0.768E-10, total error = 0.130E-09 + Total RHS evals: Fs = 12506, Ff = 1002902 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 fa764c5633..20d2cb720a 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 @@ -33,7 +33,7 @@ 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.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 @@ -63,4 +63,4 @@ 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 = 300350 + Total RHS evals: Fs = 5006, Ff = 301302 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 925d9c3474..980984a104 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 @@ -64,7 +64,7 @@ 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 = 1530050 + Total RHS evals: Fs = 45313, Ff = 1535001 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 bd101638aa..5e9fd70305 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 @@ -64,7 +64,7 @@ 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 = 1530050 + Total RHS evals: Fse = 20001, Fsi = 50342, Ff = 1535001 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 6e504b619b..d4a07bc167 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 @@ -20,51 +20,51 @@ 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 + 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.83E-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.31E-11 + 1.800000 0.941488 1.183867 0.24E-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.68E-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.37E-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 ------------------------------------------------------ Final Solver Statistics: Steps: nsts = 5000, nstf = 510000 - u error = 0.153E-10, v error = 0.950E-11, total error = 0.127E-10 - Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2040050 + u error = 0.153E-10, v error = 0.419E-11, total error = 0.112E-10 + Total RHS evals: Fse = 30001, Fsi = 82555, Ff = 2045001 Slow Newton iters = 52554 Slow Newton conv fails = 0 Slow Jacobian evals = 250 diff --git a/examples/utilities/example_utilities.hpp b/examples/utilities/example_utilities.hpp index 00b4d843fc..448ac8e268 100644 --- a/examples/utilities/example_utilities.hpp +++ b/examples/utilities/example_utilities.hpp @@ -43,7 +43,7 @@ static int check_ptr(const void* ptr, const std::string funcname) inline void find_arg(std::vector<std::string>& args, const std::string key, float& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stof(*(it + 1)); @@ -54,7 +54,7 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, double& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stod(*(it + 1)); @@ -65,7 +65,7 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, long double& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stold(*(it + 1)); @@ -76,7 +76,7 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, long long& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stoll(*(it + 1)); @@ -87,7 +87,7 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, long int& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stol(*(it + 1)); @@ -98,7 +98,7 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, int& dest) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = stoi(*(it + 1)); @@ -109,10 +109,21 @@ inline void find_arg(std::vector<std::string>& args, const std::string key, inline void find_arg(std::vector<std::string>& args, const std::string key, bool& dest, bool store = true) { - auto it = std::find(args.begin(), args.end(), key); + auto it = std::find(args.cbegin(), args.cend(), key); if (it != args.end()) { dest = store; args.erase(it); } } + +inline void find_arg(std::vector<std::string>& args, const std::string key, + std::string& dest) +{ + auto it = std::find(args.cbegin(), args.cend(), key); + if (it != args.end()) + { + dest = std::move(*(it + 1)); + args.erase(it, it + 2); + } +} diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 684e4fadab..516dffd60c 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -196,6 +196,18 @@ typedef enum ARK_RELAX_NEWTON } ARKRelaxSolver; +/* -------------------------- + * Error Accumulation Options + * -------------------------- */ + +typedef enum +{ + ARK_ACCUMERROR_NONE, + ARK_ACCUMERROR_MAX, + ARK_ACCUMERROR_SUM, + ARK_ACCUMERROR_AVG +} ARKAccumError; + /* -------------------------- * Shared API routines * -------------------------- */ @@ -206,6 +218,10 @@ SUNDIALS_EXPORT int ARKodeResize(void* arkode_mem, N_Vector ynew, ARKVecResizeFn resize, void* resize_data); SUNDIALS_EXPORT int ARKodeReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +/* Utility to wrap ARKODE as an MRIStepInnerStepper */ +SUNDIALS_EXPORT int ARKodeCreateMRIStepInnerStepper(void* arkode_mem, + MRIStepInnerStepper* stepper); + /* Tolerance input functions */ SUNDIALS_EXPORT int ARKodeSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); @@ -286,6 +302,9 @@ SUNDIALS_EXPORT int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin); SUNDIALS_EXPORT int ARKodeSetMinStep(void* arkode_mem, sunrealtype hmin); SUNDIALS_EXPORT int ARKodeSetMaxStep(void* arkode_mem, sunrealtype hmax); SUNDIALS_EXPORT int ARKodeSetMaxNumConstrFails(void* arkode_mem, int maxfails); +SUNDIALS_EXPORT int ARKodeSetAccumulatedErrorType(void* arkode_mem, + ARKAccumError accum_type); +SUNDIALS_EXPORT int ARKodeResetAccumulatedError(void* arkode_mem); /* Integrate the ODE over an interval in t */ SUNDIALS_EXPORT int ARKodeEvolve(void* arkode_mem, sunrealtype tout, @@ -333,6 +352,8 @@ SUNDIALS_EXPORT int ARKodeGetNumConstrFails(void* arkode_mem, SUNDIALS_EXPORT int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_EXPORT int ARKodeGetAccumulatedError(void* arkode_mem, + sunrealtype* accum_error); /* Optional output functions (implicit solver) */ SUNDIALS_EXPORT int ARKodeGetNumLinSolvSetups(void* arkode_mem, diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 9a0cfbb5a1..777663da61 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -94,14 +94,13 @@ SUNDIALS_EXPORT int ARKStepGetTimestepperStats( long int* step_attempts, long int* nfe_evals, long int* nfi_evals, long int* nlinsetups, long int* netfails); -/* MRIStep interface functions */ -SUNDIALS_EXPORT int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, - MRIStepInnerStepper* stepper); - /* -------------------------------------------------------------------------- * Deprecated Functions -- all are superseded by shared ARKODE-level routines * -------------------------------------------------------------------------- */ +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeCreateMRIStepInnerStepper instead") +int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, + MRIStepInnerStepper* stepper); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") int ARKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data); diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 506534b9db..6b8fcda102 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -22,6 +22,7 @@ #include <arkode/arkode_butcher_dirk.h> #include <arkode/arkode_butcher_erk.h> #include <arkode/arkode_ls.h> +#include <sunadaptcontroller/sunadaptcontroller_soderlind.h> #include <sundials/sundials_stepper.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ @@ -37,9 +38,12 @@ typedef enum { MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, - MRISTEP_IMEX + MRISTEP_IMEX, + MRISTEP_MERK, + MRISTEP_SR } MRISTEP_METHOD_TYPE; +/* MRI coupling table IDs */ typedef enum { ARKODE_MRI_NONE = -1, /* ensure enum is signed int */ @@ -63,15 +67,27 @@ typedef enum ARKODE_IMEX_MRI_GARK_EULER, ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, ARKODE_IMEX_MRI_GARK_MIDPOINT, - ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT, + ARKODE_MERK21, + ARKODE_MERK32, + ARKODE_MERK43, + ARKODE_MERK54, + ARKODE_IMEX_MRI_SR21, + ARKODE_IMEX_MRI_SR32, + ARKODE_IMEX_MRI_SR43, + ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 } ARKODE_MRITableID; -/* Default MRI coupling tables for each order */ +/* Default MRI coupling tables for each order and type */ static const int MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER; static const int MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b; static const int MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3; static const int MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a; +static const int MRISTEP_DEFAULT_EXPL_2_AD = ARKODE_MRI_GARK_ERK22b; +static const int MRISTEP_DEFAULT_EXPL_3_AD = ARKODE_MRI_GARK_ERK33a; +static const int MRISTEP_DEFAULT_EXPL_4_AD = ARKODE_MRI_GARK_ERK45a; +static const int MRISTEP_DEFAULT_EXPL_5_AD = ARKODE_MERK54; + static const int MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER; static const int MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a; static const int MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a; @@ -82,6 +98,10 @@ static const int MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL; static const int MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b; static const int MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4; +static const int MRISTEP_DEFAULT_IMEX_SD_2_AD = ARKODE_IMEX_MRI_SR21; +static const int MRISTEP_DEFAULT_IMEX_SD_3_AD = ARKODE_IMEX_MRI_SR32; +static const int MRISTEP_DEFAULT_IMEX_SD_4_AD = ARKODE_IMEX_MRI_SR43; + /* ------------------------------------ * MRIStep Inner Stepper Function Types * ------------------------------------ */ @@ -95,18 +115,29 @@ typedef int (*MRIStepInnerFullRhsFn)(MRIStepInnerStepper stepper, sunrealtype t, typedef int (*MRIStepInnerResetFn)(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); +typedef int (*MRIStepInnerGetAccumulatedError)(MRIStepInnerStepper stepper, + sunrealtype* accum_error); + +typedef int (*MRIStepInnerResetAccumulatedError)(MRIStepInnerStepper stepper); + +typedef int (*MRIStepInnerSetRTol)(MRIStepInnerStepper stepper, sunrealtype rtol); + /*--------------------------------------------------------------- MRI coupling data structure and associated utility routines ---------------------------------------------------------------*/ struct MRIStepCouplingMem { - int nmat; /* number of MRI coupling matrices */ - int stages; /* size of coupling matrices (stages * stages) */ - int q; /* method order of accuracy */ - int p; /* embedding order of accuracy */ - sunrealtype* c; /* stage abscissae */ - sunrealtype*** W; /* explicit coupling matrices [nmat][stages][stages] */ - sunrealtype*** G; /* implicit coupling matrices [nmat][stages][stages] */ + MRISTEP_METHOD_TYPE type; /* flag to encode the MRI method type */ + int nmat; /* number of MRI coupling matrices */ + int stages; /* size of coupling matrices ((stages+1) * stages) */ + int q; /* method order of accuracy */ + int p; /* embedding order of accuracy */ + sunrealtype* c; /* stage abscissae */ + sunrealtype*** W; /* explicit coupling matrices [nmat][stages+1][stages] */ + sunrealtype*** G; /* implicit coupling matrices [nmat][stages+1][stages] */ + + int ngroup; /* number of stage groups (MERK-specific) */ + int** group; /* stages to integrate together (MERK-specific) */ }; typedef _SUNDIALS_STRUCT_ MRIStepCouplingMem* MRIStepCoupling; @@ -164,6 +195,8 @@ SUNDIALS_EXPORT int MRIStepSetPostInnerFn(void* arkode_mem, SUNDIALS_EXPORT int MRIStepGetCurrentCoupling(void* arkode_mem, MRIStepCoupling* MRIC); SUNDIALS_EXPORT int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag); +SUNDIALS_EXPORT int MRIStepGetNumInnerStepperFails(void* arkode_mem, + long int* inner_fails); /* Custom inner stepper functions */ SUNDIALS_EXPORT int MRIStepInnerStepper_Create(SUNContext sunctx, @@ -183,6 +216,12 @@ SUNDIALS_EXPORT int MRIStepInnerStepper_SetFullRhsFn(MRIStepInnerStepper stepper MRIStepInnerFullRhsFn fn); SUNDIALS_EXPORT int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, MRIStepInnerResetFn fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetAccumulatedErrorGetFn( + MRIStepInnerStepper stepper, MRIStepInnerGetAccumulatedError fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetAccumulatedErrorResetFn( + MRIStepInnerStepper stepper, MRIStepInnerResetAccumulatedError fn); +SUNDIALS_EXPORT int MRIStepInnerStepper_SetRTolFn(MRIStepInnerStepper stepper, + MRIStepInnerSetRTol fn); SUNDIALS_EXPORT int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, sunrealtype t, N_Vector f); SUNDIALS_EXPORT int MRIStepInnerStepper_GetForcingData( diff --git a/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h b/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h new file mode 100644 index 0000000000..baeffe7f73 --- /dev/null +++ b/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h @@ -0,0 +1,88 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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_MRIHTol module. + * -----------------------------------------------------------------*/ + +#ifndef _SUNADAPTCONTROLLER_MRIHTOL_H +#define _SUNADAPTCONTROLLER_MRIHTOL_H + +#include <stdio.h> +#include <sundials/sundials_adaptcontroller.h> + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* ---------------------------------------------------- + * MRI H+tolerance implementation of SUNAdaptController + * ---------------------------------------------------- */ + +struct SUNAdaptControllerContent_MRIHTol_ +{ + SUNAdaptController HControl; + SUNAdaptController TolControl; + sunrealtype inner_max_relch; + sunrealtype inner_min_tolfac; + sunrealtype inner_max_tolfac; +}; + +typedef struct SUNAdaptControllerContent_MRIHTol_* SUNAdaptControllerContent_MRIHTol; + +/* ------------------ + * Exported Functions + * ------------------ */ + +SUNDIALS_EXPORT +SUNAdaptController SUNAdaptController_MRIHTol(SUNAdaptController HControl, + SUNAdaptController TolControl, + SUNContext sunctx); +SUNDIALS_EXPORT +SUNErrCode SUNAdaptController_SetParams_MRIHTol(SUNAdaptController C, + sunrealtype inner_max_relch, + sunrealtype inner_min_tolfac, + sunrealtype inner_max_tolfac); +SUNDIALS_EXPORT +SUNErrCode SUNAdaptController_GetSlowController_MRIHTol(SUNAdaptController C, + SUNAdaptController* Cslow); +SUNDIALS_EXPORT +SUNErrCode SUNAdaptController_GetFastController_MRIHTol(SUNAdaptController C, + SUNAdaptController* Cfast); +SUNDIALS_EXPORT +SUNAdaptController_Type SUNAdaptController_GetType_MRIHTol(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_EstimateStepTol_MRIHTol( + SUNAdaptController C, sunrealtype H, sunrealtype tolfac, int P, + sunrealtype DSM, sunrealtype dsm, sunrealtype* Hnew, sunrealtype* tolfacnew); +SUNDIALS_EXPORT +int SUNAdaptController_Reset_MRIHTol(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_SetDefaults_MRIHTol(SUNAdaptController C); +SUNDIALS_EXPORT +int SUNAdaptController_Write_MRIHTol(SUNAdaptController C, FILE* fptr); +SUNDIALS_EXPORT +int SUNAdaptController_SetErrorBias_MRIHTol(SUNAdaptController C, + sunrealtype bias); +SUNDIALS_EXPORT +int SUNAdaptController_UpdateMRIHTol_MRIHTol(SUNAdaptController C, + sunrealtype H, sunrealtype tolfac, + sunrealtype DSM, sunrealtype dsm); +SUNDIALS_EXPORT +int SUNAdaptController_Space_MRIHTol(SUNAdaptController C, long int* lenrw, + long int* leniw); + +#ifdef __cplusplus +} +#endif + +#endif /* _SUNADAPTCONTROLLER_MRIHTOL_H */ diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index b27d7c73c8..4d5c9bf9ca 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -31,16 +31,17 @@ extern "C" { #endif /* ----------------------------------------------------------------- - * SUNAdaptController types (currently, only "H" is implemented; - * others are planned): + * SUNAdaptController types: * NONE - empty controller (does nothing) * H - controls a single-rate step size + * MRI_H_TOL - controls slow step and fast relative tolerances * ----------------------------------------------------------------- */ typedef enum { SUN_ADAPTCONTROLLER_NONE, - SUN_ADAPTCONTROLLER_H + SUN_ADAPTCONTROLLER_H, + SUN_ADAPTCONTROLLER_MRI_H_TOL } SUNAdaptController_Type; /* ----------------------------------------------------------------- @@ -63,6 +64,12 @@ struct _generic_SUNAdaptController_Ops SUNErrCode (*estimatestep)(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); + /* REQUIRED for controllers of SUN_ADAPTCONTROLLER_MRI_H_TOL type. */ + SUNErrCode (*estimatesteptol)(SUNAdaptController C, sunrealtype H, + sunrealtype tolfac, int P, sunrealtype DSM, + sunrealtype dsm, sunrealtype* Hnew, + sunrealtype* tolfacnew); + /* OPTIONAL for all SUNAdaptController implementations. */ SUNErrCode (*destroy)(SUNAdaptController C); SUNErrCode (*reset)(SUNAdaptController C); @@ -70,6 +77,9 @@ struct _generic_SUNAdaptController_Ops SUNErrCode (*write)(SUNAdaptController C, FILE* fptr); SUNErrCode (*seterrorbias)(SUNAdaptController C, sunrealtype bias); SUNErrCode (*updateh)(SUNAdaptController C, sunrealtype h, sunrealtype dsm); + SUNErrCode (*updatemrihtol)(SUNAdaptController C, sunrealtype H, + sunrealtype tolfac, sunrealtype DSM, + sunrealtype dsm); SUNErrCode (*space)(SUNAdaptController C, long int* lenrw, long int* leniw); }; @@ -118,6 +128,20 @@ SUNErrCode SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, int p, sunrealtype dsm, sunrealtype* hnew); +/* Combined slow step/fast tolerance multirate controller function. + This is called following a slow multirate time step with size 'H' + and fast/slow relative tolerance ratio 'tolfac', and error factors + 'DSM' and 'dsm' (slow and fast, resp.). The controller should + estimate slow stepsize 'Hnew' and updated relative tolerance ratio + 'tolfacnew', so that the ensuing step will have 'DSM' and 'dsm' + values JUST BELOW 1 with minimal computational effort. */ +SUNDIALS_EXPORT +SUNErrCode SUNAdaptController_EstimateStepTol(SUNAdaptController C, + sunrealtype H, sunrealtype tolfac, + int P, sunrealtype DSM, + sunrealtype dsm, sunrealtype* Hnew, + sunrealtype* tolfacnew); + /* 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 @@ -145,6 +169,15 @@ SUNDIALS_EXPORT SUNErrCode SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, sunrealtype dsm); +/* Function to notify the controller of a successful multirate time step + with size H and fast tolerance factor tolfac, and local error factors + DSM and dsm, indicating that the step size, tolerance factor, or local + error factors can be saved for subsequent controller functions. */ +SUNDIALS_EXPORT +SUNErrCode SUNAdaptController_UpdateMRIHTol(SUNAdaptController C, sunrealtype H, + sunrealtype tolfac, sunrealtype DSM, + sunrealtype dsm); + /* Function to return the memory requirements of the controller object. */ SUNDIALS_EXPORT SUNErrCode SUNAdaptController_Space(SUNAdaptController C, long int* lenrw, diff --git a/scripts/shared b/scripts/shared index fb6a1e0079..c6e5ae255c 100755 --- a/scripts/shared +++ b/scripts/shared @@ -101,6 +101,7 @@ $tar $tarfile $distrobase/test/unit_tests/CMakeLists.txt $tar $tarfile $distrobase/test/unit_tests/profiling $tar $tarfile $distrobase/test/unit_tests/sunmemory $tar $tarfile $distrobase/test/unit_tests/sundials +$tar $tarfile $distrobase/test/unit_tests/utilities echo " --- Add external files to $tarfile" $tar $tarfile $distrobase/external diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index f5019337f9..edcc90e1a2 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -35,6 +35,7 @@ set(arkode_SOURCES arkode_lsrkstep_io.c arkode_lsrkstep.c arkode_mri_tables.c + arkode_mristep_controller.c arkode_mristep_io.c arkode_mristep_nls.c arkode_mristep.c @@ -76,8 +77,9 @@ sundials_add_library( OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj - sundials_sunadaptcontrollerimexgus_obj sundials_sunadaptcontrollersoderlind_obj + sundials_sunadaptcontrollerimexgus_obj + sundials_sunadaptcontrollermrihtol_obj sundials_sunmatrixband_obj sundials_sunmatrixdense_obj sundials_sunmatrixsparse_obj diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 2234cc653b..c64713a320 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -135,7 +135,7 @@ int ARKodeResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, } } - /* Determining change in vector sizes */ + /* Determine change in vector sizes */ lrw1 = liw1 = 0; if (y0->ops->nvspace != NULL) { N_VSpace(y0, &lrw1, &liw1); } lrw_diff = lrw1 - ark_mem->lrw1; @@ -816,7 +816,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, /* Check for too much accuracy requested */ nrm = N_VWrmsNorm(ark_mem->yn, ark_mem->ewt); ark_mem->tolsf = ark_mem->uround * nrm; - if (ark_mem->tolsf > ONE) + if (ark_mem->tolsf > ONE && !ark_mem->fixedstep) { arkProcessError(ark_mem, ARK_TOO_MUCH_ACC, __LINE__, __func__, __FILE__, MSG_ARK_TOO_MUCH_ACC, ark_mem->tcur); @@ -1339,7 +1339,7 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) fprintf(outfile, "yn:\n"); N_VPrintFile(ark_mem->yn, outfile); fprintf(outfile, "fn:\n"); - N_VPrintFile(ark_mem->fn, outfile); + if (ark_mem->fn) { N_VPrintFile(ark_mem->fn, outfile); } fprintf(outfile, "tempv1:\n"); N_VPrintFile(ark_mem->tempv1, outfile); fprintf(outfile, "tempv2:\n"); @@ -1358,6 +1358,66 @@ void ARKodePrintMem(void* arkode_mem, FILE* outfile) if (ark_mem->step_printmem) { ark_mem->step_printmem(ark_mem, outfile); } } +/*------------------------------------------------------------------------------ + ARKodeCreateMRIStepInnerStepper + + Wraps an ARKODE integrator as an MRIStep inner stepper. + ----------------------------------------------------------------------------*/ + +int ARKodeCreateMRIStepInnerStepper(void* inner_arkode_mem, + MRIStepInnerStepper* stepper) +{ + ARKodeMem ark_mem; + int retval; + + /* Check if ark_mem exists */ + if (inner_arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)inner_arkode_mem; + + /* return with an error if the ARKODE solver does not support forcing */ + if (ark_mem->step_setforcing == NULL) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support forcing"); + return (ARK_STEPPER_UNSUPPORTED); + } + + retval = MRIStepInnerStepper_Create(ark_mem->sunctx, stepper); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetContent(*stepper, inner_arkode_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetEvolveFn(*stepper, ark_MRIStepInnerEvolve); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, ark_MRIStepInnerFullRhs); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetResetFn(*stepper, ark_MRIStepInnerReset); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = + MRIStepInnerStepper_SetAccumulatedErrorGetFn(*stepper, + ark_MRIStepInnerGetAccumulatedError); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = + MRIStepInnerStepper_SetAccumulatedErrorResetFn(*stepper, + ark_MRIStepInnerResetAccumulatedError); + if (retval != ARK_SUCCESS) { return (retval); } + + retval = MRIStepInnerStepper_SetRTolFn(*stepper, ark_MRIStepInnerSetRTol); + if (retval != ARK_SUCCESS) { return (retval); } + + return (ARK_SUCCESS); +} + /*=============================================================== Private internal functions ===============================================================*/ @@ -1441,6 +1501,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->step_setstagepredictfn = NULL; ark_mem->step_getnumrhsevals = NULL; ark_mem->step_getnumlinsolvsetups = NULL; + ark_mem->step_setadaptcontroller = NULL; ark_mem->step_getestlocalerrors = NULL; ark_mem->step_getcurrentgamma = NULL; ark_mem->step_getnonlinearsystemdata = NULL; @@ -1519,6 +1580,10 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->h = ZERO; ark_mem->h0u = ZERO; + /* Accumulated error estimation strategy */ + ark_mem->AccumErrorType = ARK_ACCUMERROR_NONE; + ark_mem->AccumError = ZERO; + /* Set default values for integrator and stepper optional inputs */ iret = ARKodeSetDefaults(ark_mem); if (iret != ARK_SUCCESS) @@ -1717,6 +1782,9 @@ int arkInit(ARKodeMem ark_mem, sunrealtype t0, N_Vector y0, int init_type) ark_mem->hadapt_mem->nst_acc = 0; ark_mem->hadapt_mem->nst_exp = 0; + /* Accumulated error estimate */ + ark_mem->AccumError = ZERO; + /* 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 */ @@ -1791,21 +1859,6 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) sunrealtype tout_hin, rh, htmp; sunbooleantype conOK; - /* Set up the time stepper module */ - if (ark_mem->step_init == NULL) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "Time stepper module is missing"); - return (ARK_ILL_INPUT); - } - retval = ark_mem->step_init(ark_mem, ark_mem->init_type); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Error in initialization of time stepper module"); - return (retval); - } - /* Check that user has supplied an initial step size if fixedstep mode is on */ if ((ark_mem->fixedstep) && (ark_mem->hin == ZERO)) { @@ -1871,6 +1924,21 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) return (ARK_ILL_INPUT); } + /* Set up the time stepper module */ + if (ark_mem->step_init == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Time stepper module is missing"); + return (ARK_ILL_INPUT); + } + retval = ark_mem->step_init(ark_mem, tout, ark_mem->init_type); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Error in initialization of time stepper module"); + return (retval); + } + /* Load initial residual weights */ if (ark_mem->rwt_is_ewt) { /* update pointer to ewt */ @@ -1950,7 +2018,8 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) /* 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. */ + ensure that it is provided, and space is allocated for fn. Otherwise, + we should free ark_mem->fn if it is allocated. */ if (ark_mem->call_fullrhs || (ark_mem->h0u == ZERO && ark_mem->hin == ZERO) || ark_mem->root_mem) { @@ -1968,6 +2037,10 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) return (ARK_MEM_FAIL); } } + else + { + if (ark_mem->fn != NULL) { arkFreeVec(ark_mem, &ark_mem->fn); } + } /* initialization complete */ ark_mem->initialized = SUNTRUE; @@ -1987,9 +2060,11 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) /* Estimate initial h if not set */ if (ark_mem->h == ZERO) { - /* Again, temporarily set h for estimating an optimal value */ + /* If necessary, temporarily set h as it is used to compute the tolerance + in a potential mass matrix solve when computing the full rhs */ ark_mem->h = SUNRabs(tout - ark_mem->tcur); if (ark_mem->h == ZERO) { ark_mem->h = ONE; } + /* Estimate the first step size */ tout_hin = tout; if (ark_mem->tstopset && @@ -2003,6 +2078,7 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) istate = arkHandleFailure(ark_mem, hflag); return (istate); } + /* Use first step growth factor for estimated h */ ark_mem->hadapt_mem->etamax = ark_mem->hadapt_mem->etamx1; } @@ -2526,6 +2602,20 @@ int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm) ark_mem->nst, ark_mem->h, ark_mem->tcur); #endif + /* store this step's contribution to accumulated temporal error */ + if (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE) + { + if (ark_mem->AccumErrorType == ARK_ACCUMERROR_MAX) + { + ark_mem->AccumError = SUNMAX(dsm, ark_mem->AccumError); + } + else if (ark_mem->AccumErrorType == ARK_ACCUMERROR_SUM) + { + ark_mem->AccumError += dsm; + } + else /* ARK_ACCUMERROR_AVG */ { ark_mem->AccumError += (dsm * ark_mem->h); } + } + /* apply user-supplied step postprocessing function (if supplied) */ if (ark_mem->ProcessStep != NULL) { @@ -3014,6 +3104,7 @@ int arkCheckConvergence(ARKodeMem ark_mem, int* nflagPtr, int* ncfPtr) { ARKodeHAdaptMem hadapt_mem; + /* If nonlinear solver succeeded, return with ARK_SUCCESS */ if (*nflagPtr == ARK_SUCCESS) { return (ARK_SUCCESS); } /* Returns with an ARK_RETRY_STEP flag occur at a stage well before any algebraic solvers are involved. On the other hand, @@ -3604,6 +3695,188 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, int line, return; } +/*--------------------------------------------------------------- + Utility routines for ARKODE to serve as an MRIStepInnerStepper + ---------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerEvolve + + Implementation of MRIStepInnerStepperEvolveFn to advance the inner (fast) + ODE IVP. Since the raw return value from an MRIStepInnerStepper is + meaningless, aside from whether it is 0 (success), >0 (recoverable failure), + and <0 (unrecoverable failure), we map various ARKODE return values + accordingly. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerEvolve(MRIStepInnerStepper stepper, + SUNDIALS_MAYBE_UNUSED sunrealtype t0, + sunrealtype tout, N_Vector y) +{ + void* arkode_mem; /* arkode memory */ + ARKodeMem ark_mem; + sunrealtype tret; /* return time */ + sunrealtype tshift, tscale; /* time normalization values */ + N_Vector* forcing; /* forcing vectors */ + int nforcing; /* number of forcing vectors */ + int retval; /* return value */ + + /* extract the ARKODE memory struct */ + retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return -1; + } + ark_mem = (ARKodeMem)arkode_mem; + + /* get the forcing data */ + retval = MRIStepInnerStepper_GetForcingData(stepper, &tshift, &tscale, + &forcing, &nforcing); + if (retval != ARK_SUCCESS) { return -1; } + + /* set the inner forcing data */ + retval = ark_mem->step_setforcing(ark_mem, tshift, tscale, forcing, nforcing); + if (retval != ARK_SUCCESS) { return -1; } + + /* set the stop time */ + retval = ARKodeSetStopTime(arkode_mem, tout); + if (retval != ARK_SUCCESS) { return -1; } + + /* evolve inner ODE, consider all positive return values as 'success' */ + retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); + if (retval > 0) { retval = 0; } + + /* set a recoverable failure for a few ARKODE failure modes; + on other ARKODE errors return with an unrecoverable failure */ + if (retval < 0) + { + if ((retval == ARK_TOO_MUCH_WORK) || (retval == ARK_CONV_FAILURE) || + (retval == ARK_ERR_FAILURE)) + { + retval = 1; + } + else { return -1; } + } + + /* disable inner forcing */ + if (ark_mem->step_setforcing(ark_mem, ZERO, ONE, NULL, 0) != ARK_SUCCESS) + { + return -1; + } + + return retval; +} + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerFullRhs + + Implementation of MRIStepInnerStepperFullRhsFn to compute the full inner + (fast) ODE IVP RHS. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, + N_Vector y, N_Vector f, int mode) +{ + void* arkode_mem; /* arkode memory */ + ARKodeMem ark_mem; + int retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return -1; + } + ark_mem = (ARKodeMem)arkode_mem; + retval = ark_mem->step_fullrhs(arkode_mem, t, y, f, mode); + if (retval == ARK_SUCCESS) { return 0; } + return -1; +} + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerReset + + Implementation of MRIStepInnerStepperResetFn to reset the inner (fast) stepper + state. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR) +{ + void* arkode_mem; + int retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + retval = ARKodeReset(arkode_mem, tR, yR); + if (retval == ARK_SUCCESS) { return 0; } + return -1; +} + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerGetAccumulatedError + + Implementation of MRIStepInnerGetAccumulatedError to retrieve the accumulated + temporal error estimate from the inner (fast) stepper. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerGetAccumulatedError(MRIStepInnerStepper stepper, + sunrealtype* accum_error) +{ + void* arkode_mem; + int retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + retval = ARKodeGetAccumulatedError(arkode_mem, accum_error); + if (retval == ARK_SUCCESS) { return 0; } + if (retval > 0) { return 1; } + return -1; +} + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerResetAccumulatedError + + Implementation of MRIStepInnerResetAccumulatedError to reset the accumulated + temporal error estimator in the inner (fast) stepper. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerResetAccumulatedError(MRIStepInnerStepper stepper) +{ + void* arkode_mem; + int retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + retval = ARKodeResetAccumulatedError(arkode_mem); + if (retval == ARK_SUCCESS) { return 0; } + return -1; +} + +/*------------------------------------------------------------------------------ + ark_MRIStepInnerSetRTol + + Implementation of MRIStepInnerSetRTol to set a relative tolerance for the + upcoming evolution using the inner (fast) stepper. + ----------------------------------------------------------------------------*/ + +int ark_MRIStepInnerSetRTol(MRIStepInnerStepper stepper, sunrealtype rtol) +{ + void* arkode_mem; + ARKodeMem ark_mem; + int retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); + if (retval != ARK_SUCCESS) { return -1; } + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return -1; + } + ark_mem = (ARKodeMem)arkode_mem; + if (rtol > ZERO) + { + ark_mem->reltol = rtol; + return 0; + } + else { return -1; } +} + /*=============================================================== EOF ===============================================================*/ diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 93ac87e227..eb7ccedc68 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -345,47 +345,6 @@ int ARKStepReInit(void* arkode_mem, ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, return (ARK_SUCCESS); } -/*------------------------------------------------------------------------------ - ARKStepCreateMRIStepInnerStepper - - Wraps an ARKStep memory structure as an MRIStep inner stepper. - ----------------------------------------------------------------------------*/ -int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, - MRIStepInnerStepper* stepper) -{ - int retval; - ARKodeMem ark_mem; - ARKodeARKStepMem step_mem; - - retval = arkStep_AccessARKODEStepMem(inner_arkode_mem, - "ARKStepCreateMRIStepInnerStepper", - &ark_mem, &step_mem); - if (retval) - { - arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, - "The ARKStep memory pointer is NULL"); - return ARK_ILL_INPUT; - } - - retval = MRIStepInnerStepper_Create(ark_mem->sunctx, stepper); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetContent(*stepper, inner_arkode_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetEvolveFn(*stepper, arkStep_MRIStepInnerEvolve); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetFullRhsFn(*stepper, - arkStep_MRIStepInnerFullRhs); - if (retval != ARK_SUCCESS) { return (retval); } - - retval = MRIStepInnerStepper_SetResetFn(*stepper, arkStep_MRIStepInnerReset); - if (retval != ARK_SUCCESS) { return (retval); } - - return (ARK_SUCCESS); -} - /*=============================================================== Interface routines supplied to ARKODE ===============================================================*/ @@ -982,7 +941,8 @@ int arkStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat With initialization type RESET_INIT, this routine does nothing. ---------------------------------------------------------------*/ -int arkStep_Init(ARKodeMem ark_mem, int init_type) +int arkStep_Init(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tout, + int init_type) { ARKodeARKStepMem step_mem; int j, retval; @@ -999,12 +959,17 @@ int arkStep_Init(ARKodeMem ark_mem, int init_type) if (init_type == FIRST_INIT) { /* enforce use of arkEwtSmallReal if using a fixed step size for - an explicit method, an internal error weight function, and not - using an iterative mass matrix solver with rwt=ewt */ + an explicit method, an internal error weight function, not + using an iterative mass matrix solver with rwt=ewt, and not + performing accumulated temporal error estimation */ reset_efun = SUNTRUE; if (step_mem->implicit) { reset_efun = SUNFALSE; } if (!ark_mem->fixedstep) { reset_efun = SUNFALSE; } if (ark_mem->user_efun) { reset_efun = SUNFALSE; } + if (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE) + { + reset_efun = SUNFALSE; + } if (ark_mem->rwt_is_ewt && (step_mem->msolve_type == SUNLINEARSOLVER_ITERATIVE)) { @@ -1052,11 +1017,13 @@ int arkStep_Init(ARKodeMem ark_mem, int init_type) step_mem->p = ark_mem->hadapt_mem->p = step_mem->Be->p; } - /* Ensure that if adaptivity is enabled, then method includes embedding coefficients */ - if (!ark_mem->fixedstep && (step_mem->p == 0)) + /* Ensure that if adaptivity or error accumulation is enabled, then + method includes embedding coefficients */ + if ((!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) && + (step_mem->p <= 0)) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "Adaptive timestepping cannot be performed without embedding coefficients"); + __FILE__, "Temporal error estimation cannot be performed without embedding coefficients"); return (ARK_ILL_INPUT); } @@ -1269,28 +1236,62 @@ int arkStep_Init(ARKodeMem ark_mem, int init_type) This will be called in one of three '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. + ARK_FULLRHS_START -> called in the following circumstances: + (a) at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR), + (b) when transitioning between time steps t_{n-1} + \to t_{n} to fill f_{n-1} within the Hermite + interpolation module, or + (c) potentially by ARKStep at the start of the first + internal step. + + In each case, we may check the fn_is_current flag to + know whether the values stored in Fe[0] and Fi[0] are + up-to-date, allowing us to copy those values instead of + recomputing. If these values are not current, then the RHS + should be stored in Fe[0] and Fi[0] for reuse later, + before copying the values into the output vector. + + ARK_FULLRHS_END -> called in the following circumstances: + (a) when temporal root-finding is enabled, this will be + called in-between steps t_{n-1} \to t_{n} to fill f_{n}, + (b) when high-order dense output is requested from the + Hermite interpolation module in-between steps t_{n-1} + \to t_{n} to fill f_{n}, + (c) when an implicit predictor is requested from the Hermite + interpolation module within the time step t_{n} \to + t_{n+1}, in which case f_{n} needs to be filled, or + (d) potentially by ARKStep when starting a time step t_{n} + \to t_{n+1}. + + Again, we may check the fn_is_current flag to know whether + ARKODE believes that the values stored in Fe[0] and Fi[0] + are up-to-date, and may just be copied. If those values + are not current, then the only instance where recomputation + is not needed is (d), since the values in Fe[stages - 1] + and Fi[stages - 1] may be copied into Fe[0] and Fi[0], + respectively. In all other cases, the RHS should be + recomputed and stored in Fe[0] and Fi[0] for reuse + later, before copying the values into the output vector. + + ARK_FULLRHS_OTHER -> called in the following circumstances: + (a) when estimating the initial time step size, + (b) for high-order dense output with the Hermite + interpolation module, + (c) by an "outer" stepper when ARKStep is used as an + inner solver), or + (d) when a high-order implicit predictor is requested from + the Hermite interpolation module within the time step + t_{n} \to t_{n+1}. + + While instances (a)-(c) will occur in-between ARKStep time + steps, instance (d) can occur at the start of each internal + ARKStep stage. Since the (t,y) input does not correspond + to an "official" time step, thus the RHS functions should + always be evaluated, and the values should *not* be stored + anywhere that will interfere with other reused ARKStep data + from one stage to the next (but it may use nonlinear solver + scratch space). ----------------------------------------------------------------------------*/ int arkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) @@ -2961,8 +2962,8 @@ int arkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsmPtr) if (retval != 0) { return (ARK_VECTOROP_ERR); } } - /* Compute yerr (if step adaptivity enabled) */ - if (!ark_mem->fixedstep) + /* Compute yerr (if temporal error estimation is enabled). */ + if (!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) { /* set arrays for fused vector operation */ nvec = 0; @@ -3166,92 +3167,6 @@ int arkStep_ComputeSolutions_MassFixed(ARKodeMem ark_mem, sunrealtype* dsmPtr) Internal utility routines for interacting with MRIStep ===============================================================*/ -/*------------------------------------------------------------------------------ - arkStep_MRIStepInnerEvolve - - Implementation of MRIStepInnerStepperEvolveFn to advance the inner (fast) - ODE IVP. - ----------------------------------------------------------------------------*/ - -int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, - SUNDIALS_MAYBE_UNUSED sunrealtype t0, - sunrealtype tout, N_Vector y) -{ - void* arkode_mem; /* arkode memory */ - sunrealtype tret; /* return time */ - sunrealtype tshift, tscale; /* time normalization values */ - N_Vector* forcing; /* forcing vectors */ - int nforcing; /* number of forcing vectors */ - int retval; /* return value */ - - /* extract the ARKODE memory struct */ - retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - /* get the forcing data */ - retval = MRIStepInnerStepper_GetForcingData(stepper, &tshift, &tscale, - &forcing, &nforcing); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set the inner forcing data */ - retval = arkStep_SetInnerForcing(arkode_mem, tshift, tscale, forcing, nforcing); - if (retval != ARK_SUCCESS) { return (retval); } - - /* set the stop time */ - retval = ARKodeSetStopTime(arkode_mem, tout); - if (retval != ARK_SUCCESS) { return (retval); } - - /* evolve inner ODE */ - retval = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_NORMAL); - if (retval < 0) { return (retval); } - - /* disable inner forcing */ - retval = arkStep_SetInnerForcing(arkode_mem, ZERO, ONE, NULL, 0); - if (retval != ARK_SUCCESS) { return (retval); } - - return (ARK_SUCCESS); -} - -/*------------------------------------------------------------------------------ - arkStep_MRIStepInnerFullRhs - - Implementation of MRIStepInnerStepperFullRhsFn to compute the full inner - (fast) ODE IVP RHS. - ----------------------------------------------------------------------------*/ - -int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, - N_Vector y, N_Vector f, int mode) -{ - void* arkode_mem; - int retval; - - /* extract the ARKODE memory struct */ - retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - return (arkStep_FullRHS(arkode_mem, t, y, f, mode)); -} - -/*------------------------------------------------------------------------------ - arkStep_MRIStepInnerReset - - Implementation of MRIStepInnerStepperResetFn to reset the inner (fast) stepper - state. - ----------------------------------------------------------------------------*/ - -int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, - N_Vector yR) -{ - void* arkode_mem; - int retval; - - /* extract the ARKODE memory struct */ - retval = MRIStepInnerStepper_GetContent(stepper, &arkode_mem); - if (retval != ARK_SUCCESS) { return (retval); } - - return (ARKodeReset(arkode_mem, tR, yR)); -} - /*------------------------------------------------------------------------------ arkStep_ApplyForcing @@ -3332,15 +3247,11 @@ int arkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nvecs) { ARKodeARKStepMem step_mem; + int retval; /* access ARKodeARKStepMem structure */ - if (ark_mem->step_mem == NULL) - { - arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, __func__, __FILE__, - MSG_ARKSTEP_NO_MEM); - return ARK_MEM_NULL; - } - step_mem = (ARKodeARKStepMem)ark_mem->step_mem; + retval = arkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } if (nvecs > 0) { diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index 21e0231a89..ce4d1b4e63 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -181,7 +181,7 @@ int arkStep_AttachMasssol(ARKodeMem ark_mem, ARKMassInitFn minit, SUNLinearSolver_Type msolve_type, void* mass_mem); void arkStep_DisableLSetup(ARKodeMem ark_mem); void arkStep_DisableMSetup(ARKodeMem ark_mem); -int arkStep_Init(ARKodeMem ark_mem, int init_type); +int arkStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type); void* arkStep_GetLmem(ARKodeMem ark_mem); void* arkStep_GetMassMem(ARKodeMem ark_mem); ARKRhsFn arkStep_GetImplicitRHS(ARKodeMem ark_mem); @@ -228,6 +228,8 @@ int arkStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, int arkStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z); void arkStep_Free(ARKodeMem ark_mem); void arkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int arkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* f, int nvecs); /* Internal utility routines */ int arkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, diff --git a/src/arkode/arkode_arkstep_io.c b/src/arkode/arkode_arkstep_io.c index 8a0ee66761..665f2e4e45 100644 --- a/src/arkode/arkode_arkstep_io.c +++ b/src/arkode/arkode_arkstep_io.c @@ -757,7 +757,7 @@ int arkStep_SetDefaults(ARKodeMem ark_mem) if (ark_mem->hadapt_mem->hcontroller == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptControllerPID allocation failure"); + "SUNAdaptController_PID allocation failure"); return (ARK_MEM_FAIL); } ark_mem->hadapt_mem->owncontroller = SUNTRUE; @@ -1183,7 +1183,11 @@ int arkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) if (retval != ARK_SUCCESS) { return (retval); } /* return an error if local truncation error is not computed */ - if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + if ((ark_mem->fixedstep && (ark_mem->AccumErrorType == ARK_ACCUMERROR_NONE)) || + (step_mem->p <= 0)) + { + return (ARK_STEPPER_UNSUPPORTED); + } /* otherwise, copy local truncation error vector to output */ N_VScale(ONE, ark_mem->tempv1, ele); @@ -1472,6 +1476,12 @@ int arkStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) Exported-but-deprecated user-callable functions. ===============================================================*/ +int ARKStepCreateMRIStepInnerStepper(void* inner_arkode_mem, + MRIStepInnerStepper* stepper) +{ + return (ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, stepper)); +} + int ARKStepResize(void* arkode_mem, N_Vector y0, sunrealtype hscale, sunrealtype t0, ARKVecResizeFn resize, void* resize_data) { diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index 3eaa11ca9d..a62b732afc 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -104,6 +104,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) ark_mem->step_setorder = erkStep_SetOrder; ark_mem->step_getnumrhsevals = erkStep_GetNumRhsEvals; ark_mem->step_getestlocalerrors = erkStep_GetEstLocalErrors; + ark_mem->step_setforcing = erkStep_SetInnerForcing; ark_mem->step_supports_adaptive = SUNTRUE; ark_mem->step_supports_relaxation = SUNTRUE; ark_mem->step_mem = (void*)step_mem; @@ -132,6 +133,15 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx) /* Initialize all the counters */ step_mem->nfe = 0; + /* Initialize fused op work space */ + step_mem->cvals = NULL; + step_mem->Xvecs = NULL; + step_mem->nfusedopvecs = 0; + + /* Initialize external polynomial forcing data */ + step_mem->forcing = NULL; + step_mem->nforcing = 0; + /* Initialize main ARKODE infrastructure */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); if (retval != ARK_SUCCESS) @@ -297,13 +307,29 @@ void erkStep_Free(ARKodeMem ark_mem) { free(step_mem->cvals); step_mem->cvals = NULL; - ark_mem->lrw -= (step_mem->stages + 1); + ark_mem->lrw -= step_mem->nfusedopvecs; } if (step_mem->Xvecs != NULL) { free(step_mem->Xvecs); step_mem->Xvecs = NULL; - ark_mem->liw -= (step_mem->stages + 1); + ark_mem->liw -= step_mem->nfusedopvecs; + } + 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 */ @@ -368,9 +394,11 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int erkStep_Init(ARKodeMem ark_mem, int init_type) +int erkStep_Init(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tout, + int init_type) { ARKodeERKStepMem step_mem; + sunbooleantype reset_efun; int retval, j; /* access ARKodeERKStepMem structure */ @@ -383,9 +411,14 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_SUCCESS); } - /* enforce use of arkEwtSmallReal if using a fixed step size - and an internal error weight function */ - if (ark_mem->fixedstep && !ark_mem->user_efun) + /* enforce use of arkEwtSmallReal if using a fixed step size, + an internal error weight function, and not performing accumulated + temporal error estimation */ + reset_efun = SUNTRUE; + if (!ark_mem->fixedstep) { reset_efun = SUNFALSE; } + if (ark_mem->user_efun) { reset_efun = SUNFALSE; } + if (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE) { reset_efun = SUNFALSE; } + if (reset_efun) { ark_mem->user_efun = SUNFALSE; ark_mem->efun = arkEwtSetSmallReal; @@ -414,11 +447,13 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) step_mem->q = ark_mem->hadapt_mem->q = step_mem->B->q; step_mem->p = ark_mem->hadapt_mem->p = step_mem->B->p; - /* Ensure that if adaptivity is enabled, then method includes embedding coefficients */ - if (!ark_mem->fixedstep && (step_mem->p == 0)) + /* Ensure that if adaptivity or error accumulation is enabled, then + method includes embedding coefficients */ + if ((!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) && + (step_mem->p == 0)) { arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "Adaptive timestepping cannot be performed without embedding coefficients"); + __FILE__, "Temporal error estimation cannot be performed without embedding coefficients"); return (ARK_ILL_INPUT); } @@ -438,18 +473,40 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) ark_mem->liw += step_mem->stages; /* pointers */ /* Allocate reusable arrays for fused vector interface */ + step_mem->nfusedopvecs = 2 * step_mem->stages + 2 + step_mem->nforcing; if (step_mem->cvals == NULL) { - step_mem->cvals = (sunrealtype*)calloc(step_mem->stages + 1, + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, sizeof(sunrealtype)); if (step_mem->cvals == NULL) { return (ARK_MEM_FAIL); } - ark_mem->lrw += (step_mem->stages + 1); + ark_mem->lrw += step_mem->nfusedopvecs; } if (step_mem->Xvecs == NULL) { - step_mem->Xvecs = (N_Vector*)calloc(step_mem->stages + 1, sizeof(N_Vector)); + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, sizeof(N_Vector)); if (step_mem->Xvecs == NULL) { return (ARK_MEM_FAIL); } - ark_mem->liw += (step_mem->stages + 1); /* pointers */ + 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->nforcing > 0) + { + if (!(step_mem->stage_times)) + { + step_mem->stage_times = (sunrealtype*)calloc(step_mem->stages, + sizeof(sunrealtype)); + ark_mem->lrw += step_mem->stages; + } + + if (!(step_mem->stage_coefs)) + { + step_mem->stage_coefs = (sunrealtype*)calloc(step_mem->stages, + sizeof(sunrealtype)); + ark_mem->lrw += step_mem->stages; + } } /* Override the interpolant degree (if needed), used in arkInitialSetup */ @@ -478,45 +535,75 @@ int erkStep_Init(ARKodeMem ark_mem, int init_type) This will be called in one of three '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. + ARK_FULLRHS_START -> called in the following circumstances: + (a) at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR), + (b) when transitioning between time steps t_{n-1} + \to t_{n} to fill f_{n-1} within the Hermite + interpolation module, or + (c) by ERKStep at the start of the first internal step. + + In each case, we may check the fn_is_current flag to + know whether the values stored in F[0] are up-to-date, + allowing us to copy those values instead of recomputing. + If these values are not current, then the RHS should be + stored in F[0] for reuse later, before copying the values + into the output vector. + + ARK_FULLRHS_END -> called in the following circumstances: + (a) when temporal root-finding is enabled, this will be + called in-between steps t_{n-1} \to t_{n} to fill f_{n}, + (b) when high-order dense output is requested from the + Hermite interpolation module in-between steps t_{n-1} + \to t_{n} to fill f_{n}, or + (c) by ERKStep when starting a time step t_{n} \to t_{n+1} + and when using an FSAL method. + + Again, we may check the fn_is_current flag to know whether + ARKODE believes that the values stored in F[0] are + up-to-date, and may just be copied. If the values stored + in F[0] are not current, then the only instance where + recomputation is not needed is (c), since the values in + F[stages - 1] may be copied into F[0]. In all other cases, + the RHS should be recomputed and stored in F[0] for reuse + later, before copying the values into the output vector. + + ARK_FULLRHS_OTHER -> called in the following circumstances: + (a) when estimating the initial time step size, + (b) for high-order dense output with the Hermite + interpolation module, or + (c) by an "outer" stepper when ERKStep is used as an + inner solver). + + All of these instances will occur in-between ERKStep time + steps, but the (t,y) input does not correspond to an + "official" time step, thus the RHS should always be + evaluated, with the values *not* stored in F[0]. ----------------------------------------------------------------------------*/ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { - int retval; + int nvec, retval; ARKodeERKStepMem step_mem; sunbooleantype recomputeRHS; + sunrealtype* cvals; + N_Vector* Xvecs; + sunrealtype stage_coefs = ONE; /* access ARKodeERKStepMem structure */ retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); if (retval != ARK_SUCCESS) { return (retval); } + /* local shortcuts for use with fused vector operations */ + cvals = step_mem->cvals; + Xvecs = step_mem->Xvecs; + /* perform RHS functions contingent on 'mode' argument */ switch (mode) { case ARK_FULLRHS_START: - /* compute the RHS */ + /* compute the RHS if needed */ if (!(ark_mem->fn_is_current)) { retval = step_mem->f(t, y, step_mem->F[0], ark_mem->user_data); @@ -529,9 +616,19 @@ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, } } - /* copy RHS vector into output */ + /* copy RHS into output */ N_VScale(ONE, step_mem->F[0], f); + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + erkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } + break; case ARK_FULLRHS_END: @@ -544,7 +641,7 @@ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, /* First Same As Last methods are not FSAL when relaxation is enabled */ if (ark_mem->relax_enabled) { recomputeRHS = SUNTRUE; } - /* base RHS calls on recomputeRHS argument */ + /* base RHS call on recomputeRHS argument */ if (recomputeRHS) { /* call f */ @@ -558,10 +655,20 @@ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, } } else { N_VScale(ONE, step_mem->F[step_mem->stages - 1], step_mem->F[0]); } - } - /* copy RHS vector into output */ - N_VScale(ONE, step_mem->F[0], f); + /* copy RHS vector into output */ + N_VScale(ONE, step_mem->F[0], f); + + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + erkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } + } break; @@ -576,6 +683,15 @@ int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, MSG_ARK_RHSFUNC_FAILED, t); return (ARK_RHSFUNC_FAIL); } + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + cvals[0] = ONE; + Xvecs[0] = f; + nvec = 1; + erkStep_ApplyForcing(step_mem, &t, &stage_coefs, 1, &nvec); + N_VLinearCombination(nvec, cvals, Xvecs, f); + } break; @@ -684,6 +800,18 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) Xvecs[nvec] = ark_mem->yn; nvec += 1; + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + for (js = 0; js < is; js++) + { + step_mem->stage_times[js] = ark_mem->tn + step_mem->B->c[js] * ark_mem->h; + step_mem->stage_coefs[js] = ark_mem->h * step_mem->B->A[is][js]; + } + erkStep_ApplyForcing(step_mem, step_mem->stage_times, + step_mem->stage_coefs, is, &nvec); + } + /* call fused vector operation to do the work */ retval = N_VLinearCombination(nvec, cvals, Xvecs, ark_mem->ycur); if (retval != 0) { return (ARK_VECTOROP_ERR); } @@ -1023,12 +1151,24 @@ int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsmPtr) Xvecs[nvec] = ark_mem->yn; nvec += 1; + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + for (j = 0; j < step_mem->stages; j++) + { + step_mem->stage_times[j] = ark_mem->tn + step_mem->B->c[j] * ark_mem->h; + step_mem->stage_coefs[j] = ark_mem->h * step_mem->B->b[j]; + } + erkStep_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) + /* Compute yerr (if step adaptivity or error accumulation enabled) */ + if (!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) { /* set arrays for fused vector operation */ nvec = 0; @@ -1039,6 +1179,19 @@ int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsmPtr) nvec += 1; } + /* apply external polynomial forcing */ + if (step_mem->nforcing > 0) + { + for (j = 0; j < step_mem->stages; j++) + { + step_mem->stage_times[j] = ark_mem->tn + step_mem->B->c[j] * ark_mem->h; + step_mem->stage_coefs[j] = ark_mem->h * + (step_mem->B->b[j] - step_mem->B->d[j]); + } + erkStep_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); } @@ -1145,6 +1298,145 @@ int erkStep_GetOrder(ARKodeMem ark_mem) return step_mem->q; } +/*--------------------------------------------------------------- + Utility routines for ERKStep to serve as an MRIStepInnerStepper + ---------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------ + erkStep_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. + ----------------------------------------------------------------------------*/ + +void erkStep_ApplyForcing(ARKodeERKStepMem step_mem, sunrealtype* stage_times, + sunrealtype* stage_coefs, int jmax, int* nvec) +{ + sunrealtype tau, taui; + int j, k; + + /* Shortcuts to step_mem data */ + sunrealtype* vals = step_mem->cvals; + N_Vector* vecs = step_mem->Xvecs; + sunrealtype tshift = step_mem->tshift; + sunrealtype tscale = step_mem->tscale; + int nforcing = step_mem->nforcing; + N_Vector* forcing = step_mem->forcing; + + /* Offset into vals and vecs arrays */ + int offset = *nvec; + + /* 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; +} + +/*------------------------------------------------------------------------------ + erkStep_SetInnerForcing + + Sets an array of coefficient vectors for a time-dependent external polynomial + forcing term in the ODE RHS i.e., y' = f(t,y) + p(t). This function is + primarily intended for use with multirate integration methods (e.g., MRIStep) + where ERKStep is used to solve a modified ODE at a fast time scale. The + polynomial is of the form + + p(t) = sum_{i = 0}^{nvecs - 1} forcing[i] * ((t - tshift) / (tscale))^i + + where tshift and tscale are used to normalize the time t (e.g., with MRIGARK + methods). + ----------------------------------------------------------------------------*/ + +int erkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* forcing, int nvecs) +{ + ARKodeERKStepMem step_mem; + int retval; + + /* access ARKodeERKStepMem structure */ + retval = erkStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + if (nvecs > 0) + { + /* store forcing inputs */ + step_mem->tshift = tshift; + step_mem->tscale = tscale; + step_mem->forcing = forcing; + step_mem->nforcing = nvecs; + + /* If cvals and Xvecs are not allocated then erkStep_Init has not been + called and the number of stages has not been set yet. These arrays will + be allocated in erkStep_Init and take into account the value of nforcing. + On subsequent calls will check if enough space has allocated in case + nforcing has increased since the original allocation. */ + if (step_mem->cvals != NULL && step_mem->Xvecs != NULL) + { + /* check if there are enough reusable arrays for fused operations */ + if ((step_mem->nfusedopvecs - nvecs) < (step_mem->stages + 1)) + { + /* free current work space */ + if (step_mem->cvals != NULL) + { + free(step_mem->cvals); + ark_mem->lrw -= step_mem->nfusedopvecs; + } + if (step_mem->Xvecs != NULL) + { + free(step_mem->Xvecs); + ark_mem->liw -= step_mem->nfusedopvecs; + } + + /* allocate reusable arrays for fused vector operations */ + step_mem->nfusedopvecs = step_mem->stages + 1 + nvecs; + + step_mem->cvals = NULL; + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); + if (step_mem->cvals == NULL) { return (ARK_MEM_FAIL); } + ark_mem->lrw += step_mem->nfusedopvecs; + + step_mem->Xvecs = NULL; + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, + sizeof(N_Vector)); + if (step_mem->Xvecs == NULL) { return (ARK_MEM_FAIL); } + ark_mem->liw += step_mem->nfusedopvecs; + } + } + } + else + { + /* disable forcing */ + step_mem->tshift = ZERO; + step_mem->tscale = ONE; + step_mem->forcing = NULL; + step_mem->nforcing = 0; + } + + return (ARK_SUCCESS); +} + /*=============================================================== EOF ===============================================================*/ diff --git a/src/arkode/arkode_erkstep_impl.h b/src/arkode/arkode_erkstep_impl.h index 8b99460ca7..11f5158f0b 100644 --- a/src/arkode/arkode_erkstep_impl.h +++ b/src/arkode/arkode_erkstep_impl.h @@ -60,6 +60,15 @@ typedef struct ARKodeERKStepMemRec /* Reusable arrays for fused vector operations */ sunrealtype* cvals; N_Vector* Xvecs; + int nfusedopvecs; /* length of cvals and Xvecs arrays */ + + /* Data for using ERKStep with external polynomial forcing */ + sunrealtype tshift; /* time normalization shift */ + sunrealtype tscale; /* time normalization scaling */ + N_Vector* forcing; /* array of forcing vectors */ + int nforcing; /* number of forcing vectors */ + sunrealtype* stage_times; /* workspace for applying forcing */ + sunrealtype* stage_coefs; /* workspace for applying forcing */ }* ARKodeERKStepMem; @@ -68,7 +77,7 @@ typedef struct ARKodeERKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int erkStep_Init(ARKodeMem ark_mem, int init_type); +int erkStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type); int erkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); @@ -84,6 +93,8 @@ void erkStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); int erkStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, long int* rhs_evals); int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); +int erkStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* f, int nvecs); /* Internal utility routines */ int erkStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, @@ -94,6 +105,8 @@ sunbooleantype erkStep_CheckNVector(N_Vector tmpl); int erkStep_SetButcherTable(ARKodeMem ark_mem); int erkStep_CheckButcherTable(ARKodeMem ark_mem); int erkStep_ComputeSolutions(ARKodeMem ark_mem, sunrealtype* dsm); +void erkStep_ApplyForcing(ARKodeERKStepMem step_mem, sunrealtype* stage_times, + sunrealtype* stage_coefs, int jmax, int* nvec); /* private functions for relaxation */ int erkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); diff --git a/src/arkode/arkode_erkstep_io.c b/src/arkode/arkode_erkstep_io.c index 748736098e..9708b535f6 100644 --- a/src/arkode/arkode_erkstep_io.c +++ b/src/arkode/arkode_erkstep_io.c @@ -325,7 +325,7 @@ int erkStep_SetDefaults(ARKodeMem ark_mem) if (ark_mem->hadapt_mem->hcontroller == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptControllerPI allocation failure"); + "SUNAdaptController_PI allocation failure"); return (ARK_MEM_FAIL); } ark_mem->hadapt_mem->owncontroller = SUNTRUE; @@ -390,7 +390,11 @@ int erkStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) if (retval != ARK_SUCCESS) { return (retval); } /* return an error if local truncation error is not computed */ - if (ark_mem->fixedstep) { return (ARK_STEPPER_UNSUPPORTED); } + if ((ark_mem->fixedstep && (ark_mem->AccumErrorType == ARK_ACCUMERROR_NONE)) || + (step_mem->p <= 0)) + { + return (ARK_STEPPER_UNSUPPORTED); + } /* otherwise, copy local truncation error vector to output */ N_VScale(ONE, ark_mem->tempv1, ele); diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index a79f3e0d91..020fc6f6aa 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -23,6 +23,7 @@ #include <arkode/arkode_butcher.h> #include <arkode/arkode_butcher_dirk.h> #include <arkode/arkode_butcher_erk.h> +#include <arkode/arkode_mristep.h> #include <sundials/priv/sundials_context_impl.h> #include <sundials/priv/sundials_errors_impl.h> #include <sundials/sundials_adaptcontroller.h> @@ -210,7 +211,8 @@ typedef int (*ARKMassSolveFn)(ARKodeMem ark_mem, N_Vector b, typedef int (*ARKMassFreeFn)(ARKodeMem ark_mem); /* time stepper interface functions -- general */ -typedef int (*ARKTimestepInitFn)(ARKodeMem ark_mem, int init_type); +typedef int (*ARKTimestepInitFn)(ARKodeMem ark_mem, sunrealtype tout, + int init_type); typedef int (*ARKTimestepFullRHSFn)(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); typedef int (*ARKTimestepStepFn)(ARKodeMem ark_mem, sunrealtype* dsm, int* nflag); @@ -231,6 +233,7 @@ typedef int (*ARKTimestepGetNumRhsEvals)(ARKodeMem ark_mem, int partition_index, /* time stepper interface functions -- temporal adaptivity */ typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); +typedef int (*ARKSetAdaptControllerFn)(ARKodeMem ark_mem, SUNAdaptController C); /* time stepper interface functions -- relaxation */ typedef int (*ARKTimestepSetRelaxFn)(ARKodeMem ark_mem, ARKRelaxFn rfn, @@ -419,6 +422,7 @@ struct ARKodeMemRec /* Time stepper module -- temporal adaptivity */ sunbooleantype step_supports_adaptive; + ARKSetAdaptControllerFn step_setadaptcontroller; ARKTimestepGetEstLocalErrors step_getestlocalerrors; /* Time stepper module -- relaxation */ @@ -503,7 +507,7 @@ struct ARKodeMemRec overtake tstop */ sunrealtype eta; /* eta = hprime / h */ sunrealtype tcur; /* current internal value of t - (changes with each stage) */ + (changes with each stage) */ sunrealtype tretlast; /* value of tret last returned by ARKODE */ sunbooleantype fixedstep; /* flag to disable temporal adaptivity */ ARKodeHAdaptMem hadapt_mem; /* time step adaptivity structure */ @@ -537,6 +541,9 @@ struct ARKodeMemRec sunrealtype terr; /* error in tn for compensated sums */ sunrealtype hold; /* last successful h value used */ sunrealtype tolsf; /* tolerance scale factor (suggestion to user) */ + ARKAccumError AccumErrorType; /* accumulated error estimation type */ + sunrealtype AccumErrorStart; /* time of last accumulated error reset */ + sunrealtype AccumError; /* accumulated error estimate */ sunbooleantype VabstolMallocDone; sunbooleantype VRabstolMallocDone; sunbooleantype MallocDone; @@ -649,6 +656,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 arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C); int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype adapt_params[3]); int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); @@ -656,6 +664,18 @@ int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); ARKODE_DIRKTableID arkButcherTableDIRKNameToID(const char* imethod); ARKODE_ERKTableID arkButcherTableERKNameToID(const char* emethod); +/* utility functions for wrapping ARKODE as an MRIStep inner stepper */ +int ark_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, + sunrealtype tout, N_Vector y); +int ark_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, + N_Vector y, N_Vector f, int mode); +int ark_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, + N_Vector yR); +int ark_MRIStepInnerGetAccumulatedError(MRIStepInnerStepper stepper, + sunrealtype* accum_error); +int ark_MRIStepInnerResetAccumulatedError(MRIStepInnerStepper stepper); +int ark_MRIStepInnerSetRTol(MRIStepInnerStepper stepper, sunrealtype rtol); + /* XBraid interface functions */ int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); int arkGetLastKFlag(void* arkode_mem, int* last_kflag); @@ -1004,31 +1024,95 @@ int arkGetLastKFlag(void* arkode_mem, int* last_kflag); This routine must compute the full ODE right-hand side function at the inputs (t,y), and store the result in the N_Vector f. Depending on the type of stepper, this may be just the single - ODE RHS function supplied (e.g. ERK, DIRK, IRK), or it may be + ODE RHS function supplied (e.g. ERK, DIRK), 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 - 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, + ARK_FULLRHS_START -> called in the following circumstances: + (a) at the beginning of a simulation + i.e., at (tn, yn) = (t0, y0) or + (tR, yR), or + (b) when transitioning between time + steps t_{n-1} \to t_{n} to fill + f_{n-1} within the Hermite + interpolation module. + + In each case, the stepper may check the + fn_is_current flag to know whether + ARKODE believes that the RHS may have + already been computed at this (t,y) + value, in which case the stepper can + copy the RHS data from its own internal + storage instead of recomputing. If + these values are not current, then the + RHS should be recomputed, and the + stepper should consider storing the + values internally, for potential reuse + later. + + ARK_FULLRHS_END -> called in the following circumstances: + (a) when temporal root-finding is + enabled, this will be called + in-between steps t_{n-1} \to t_{n} + to fill f_{n}, + (b) when high-order dense output is + requested from the Hermite + interpolation module in-between + steps t_{n-1} \to t_{n} to fill + f_{n}, or + (c) when an implicit predictor is + requested from the Hermite + interpolation module within the + time step t_{n} \to t_{n+1}, in + which case f_{n} needs to be + filled. + + Again, the stepper may check the + fn_is_current flag to know whether + ARKODE believes that the RHS may have + already been computed at this (t,y) + value, in which case the stepper can + copy the RHS data from its own + internal storage instead of + recomputing. If these values are not + current, then the RHS should be + recomputed, and the stepper should + consider storing the values internally, + for potential reuse later. + + ARK_FULLRHS_OTHER -> called in the following circumstances: + (a) when estimating the initial time + step size, + (b) for high-order dense output with the + Hermite interpolation module, + (c) by an "outer" stepper when ARKODE is + used as an inner solver), or + (d) when a high-order implicit predictor + is requested from the Hermite + interpolation module within the time + step t_{n} \to t_{n+1}. + + While instances (a)-(c) will occur + in-between calls to the stepper's + ARKTimestepStepFn, instance (d) would + occur from within the ARKTimestepStepFn + (only if it calls an arkPredict_* function + that internally calls arkInterpEvaluate). + Since the (t,y) input does not correspond + to an "official" time step, the RHS + functions should always be evaluated, and + the values should *not* be stored anywhere + that will interfere with other reused + stepper data. + + This routine is only *required* to be supplied to ARKODE if: + * ARKODE's initial time step selection algorithm (arkHin) is used, * the user requests temporal root-finding, * the Hermite interpolation module is used, or - * the user requests the "bootstrap" implicit predictor. + * the time-stepping module requests the "bootstrap" implicit predictor. Note that any stepper can itself require that this routine - exist for its own internal business (e.g., ERKStep). + exist for its own internal business (as in both ERKStep and ARKStep), + and/or call this routine for its own internal purposes. This routine should return 0 if successful, and a negative value otherwise. If an error does occur, an appropriate message diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 2ae790ed86..f8e1087b43 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -148,6 +148,7 @@ int ARKodeSetOrder(void* arkode_mem, int ord) interpolation module. itype == ARK_INTERP_LAGRANGE specifies the Lagrange (stiff) interpolation module. + itype == ARK_INTERP_NONE disables interpolation. Return values: ARK_SUCCESS on success. @@ -890,8 +891,6 @@ int ARKodeSetUserData(void* arkode_mem, void* user_data) ---------------------------------------------------------------*/ int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) { - int retval; - long int lenrw, leniw; ARKodeMem ark_mem; if (arkode_mem == NULL) { @@ -909,54 +908,14 @@ int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) return (ARK_STEPPER_UNSUPPORTED); } - /* Remove current SUNAdaptController object - (delete if owned, and then nullify pointer) */ - if (ark_mem->hadapt_mem->owncontroller && - (ark_mem->hadapt_mem->hcontroller != NULL)) - { - retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, - &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw -= leniw; - ark_mem->lrw -= lenrw; - } - - retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); - ark_mem->hadapt_mem->owncontroller = SUNFALSE; - if (retval != SUN_SUCCESS) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptController_Destroy failure"); - return (ARK_MEM_FAIL); - } - } - ark_mem->hadapt_mem->hcontroller = NULL; - - /* On NULL-valued input, create default SUNAdaptController object */ - if (C == NULL) + /* If the stepper has provided a custom function, then call it and return */ + if (ark_mem->step_setadaptcontroller) { - C = SUNAdaptController_PID(ark_mem->sunctx); - if (C == NULL) - { - arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, - "SUNAdaptControllerPID allocation failure"); - return (ARK_MEM_FAIL); - } - ark_mem->hadapt_mem->owncontroller = SUNTRUE; + return (ark_mem->step_setadaptcontroller(ark_mem, C)); } - else { ark_mem->hadapt_mem->owncontroller = SUNFALSE; } - /* Attach new SUNAdaptController object */ - retval = SUNAdaptController_Space(C, &lenrw, &leniw); - if (retval == SUN_SUCCESS) - { - ark_mem->liw += leniw; - ark_mem->lrw += lenrw; - } - ark_mem->hadapt_mem->hcontroller = C; - - return (ARK_SUCCESS); + /* Otherwise, call a utility routine to replace the current controller object */ + return (arkReplaceAdaptController(ark_mem, C)); } /*--------------------------------------------------------------- @@ -1995,6 +1954,50 @@ int ARKodeSetMaxConvFails(void* arkode_mem, int maxncf) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ARKodeSetAccumulatedErrorType: + + This routine sets the accumulated temporal error estimation + strategy. + ---------------------------------------------------------------*/ +int ARKodeSetAccumulatedErrorType(void* arkode_mem, ARKAccumError accum_type) +{ + int retval = ARKodeResetAccumulatedError(arkode_mem); + if (retval != ARK_SUCCESS) { return retval; } + ((ARKodeMem)arkode_mem)->AccumErrorType = accum_type; + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + ARKodeResetAccumulatedError: + + This routine resets the accumulated temporal error estimate. + ---------------------------------------------------------------*/ +int ARKodeResetAccumulatedError(void* arkode_mem) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Guard against use for non-adaptive time stepper modules */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support temporal adaptivity"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Reset value and counter, and return */ + ark_mem->AccumErrorStart = ark_mem->tn; + ark_mem->AccumError = ZERO; + return (ARK_SUCCESS); +} + /*=============================================================== ARKODE optional output utility functions ===============================================================*/ @@ -2427,6 +2430,56 @@ int ARKodeGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ARKodeGetAccumulatedError: + + This routine returns the accumulated temporal error estimate. + ---------------------------------------------------------------*/ +int ARKodeGetAccumulatedError(void* arkode_mem, sunrealtype* accum_error) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + /* Return an error if the stepper cannot accumulate temporal error */ + if (!ark_mem->step_supports_adaptive) + { + arkProcessError(ark_mem, ARK_STEPPER_UNSUPPORTED, __LINE__, __func__, + __FILE__, "time-stepping module does not support accumulated error estimation"); + return (ARK_STEPPER_UNSUPPORTED); + } + + /* Get time since last accumulated error reset */ + sunrealtype time_interval = ark_mem->tcur - ark_mem->AccumErrorStart; + + /* Fill output based on error accumulation type */ + if (ark_mem->AccumErrorType == ARK_ACCUMERROR_MAX) + { + *accum_error = ark_mem->AccumError * ark_mem->reltol; + } + else if (ark_mem->AccumErrorType == ARK_ACCUMERROR_SUM) + { + *accum_error = ark_mem->AccumError * ark_mem->reltol; + } + else if (ark_mem->AccumErrorType == ARK_ACCUMERROR_AVG) + { + *accum_error = ark_mem->AccumError * ark_mem->reltol / time_interval; + } + else + { + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, + "temporal error accumulation is currently disabled"); + return (ARK_WARNING); + } + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- ARKodeGetNumConstrFails: @@ -3016,6 +3069,72 @@ int ARKodeWriteParameters(void* arkode_mem, FILE* fp) return (ARK_SUCCESS); } +/*=============================================================== + ARKODE-IO internal utility functions + ===============================================================*/ + +/*--------------------------------------------------------------- + arkReplaceAdaptController + + Replaces the current SUNAdaptController time step controller + object. If a NULL-valued SUNAdaptController is input, the + default will be re-enabled. + ---------------------------------------------------------------*/ +int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C) +{ + int retval; + long int lenrw, leniw; + + /* Remove current SUNAdaptController object + (delete if owned, and then nullify pointer) */ + if (ark_mem->hadapt_mem->owncontroller && + (ark_mem->hadapt_mem->hcontroller != NULL)) + { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "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, __LINE__, __func__, __FILE__, + "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 == SUN_SUCCESS) + { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } + ark_mem->hadapt_mem->hcontroller = C; + + return (ARK_SUCCESS); +} + /*=============================================================== ARKODE + XBraid interface utility functions ===============================================================*/ diff --git a/src/arkode/arkode_lsrkstep.c b/src/arkode/arkode_lsrkstep.c index 9cae2f4300..ce6d56fc6b 100644 --- a/src/arkode/arkode_lsrkstep.c +++ b/src/arkode/arkode_lsrkstep.c @@ -309,7 +309,8 @@ int lsrkStep_ReInit_Commons(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int lsrkStep_Init(ARKodeMem ark_mem, int init_type) +int lsrkStep_Init(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tout, + int init_type) { ARKodeLSRKStepMem step_mem; int retval; diff --git a/src/arkode/arkode_lsrkstep_impl.h b/src/arkode/arkode_lsrkstep_impl.h index d6cec7f545..9b51b92963 100644 --- a/src/arkode/arkode_lsrkstep_impl.h +++ b/src/arkode/arkode_lsrkstep_impl.h @@ -34,7 +34,7 @@ extern "C" { LSRK time step module private math function macros =============================================================== * SUNRlog calls the appropriate version of log - * + * * SUNRsinh calls the appropriate version of sinh * * SUNRcosh calls the appropriate version of cosh @@ -176,7 +176,7 @@ void* lsrkStep_Create_Commons(ARKRhsFn rhs, sunrealtype t0, N_Vector y0, SUNContext sunctx); int lsrkStep_ReInit_Commons(void* arkode_mem, ARKRhsFn rhs, sunrealtype t0, N_Vector y0); -int lsrkStep_Init(ARKodeMem ark_mem, int init_type); +int lsrkStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type); int lsrkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index 7d68143884..75db52c6de 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -73,6 +73,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, MRISTEP_METHOD_TYPE type) { int i, j; + sunbooleantype hasOmegas, hasGammas; MRIStepCoupling MRIC = NULL; /* Check for legal input values */ @@ -85,6 +86,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, MRIC = (MRIStepCoupling)malloc(sizeof(struct MRIStepCouplingMem)); if (!MRIC) { return (NULL); } + MRIC->type = type; MRIC->nmat = nmat; MRIC->stages = stages; MRIC->q = 0; @@ -92,6 +94,24 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, MRIC->c = NULL; MRIC->W = NULL; MRIC->G = NULL; + MRIC->ngroup = 0; + MRIC->group = NULL; + + /* -------------------------------------------- + * Determine general storage format + * -------------------------------------------- */ + + hasOmegas = hasGammas = SUNFALSE; + if ((type == MRISTEP_EXPLICIT) || (type == MRISTEP_IMEX) || + (type == MRISTEP_MERK) || (type == MRISTEP_SR)) + { + hasOmegas = SUNTRUE; + } + if ((type == MRISTEP_IMPLICIT) || (type == MRISTEP_IMEX) || + (type == MRISTEP_SR)) + { + hasGammas = SUNTRUE; + } /* -------------------------------------------- * Allocate abscissae and coupling coefficients @@ -104,7 +124,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, return (NULL); } - if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) + if (hasOmegas) { /* allocate W matrices */ MRIC->W = (sunrealtype***)calloc(nmat, sizeof(sunrealtype**)); @@ -118,7 +138,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, for (i = 0; i < nmat; i++) { MRIC->W[i] = NULL; - MRIC->W[i] = (sunrealtype**)calloc(stages, sizeof(sunrealtype*)); + MRIC->W[i] = (sunrealtype**)calloc(stages + 1, sizeof(sunrealtype*)); if (!(MRIC->W[i])) { MRIStepCoupling_Free(MRIC); @@ -129,7 +149,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, /* allocate columns of each matrix in W */ for (i = 0; i < nmat; i++) { - for (j = 0; j < stages; j++) + for (j = 0; j <= stages; j++) { MRIC->W[i][j] = NULL; MRIC->W[i][j] = (sunrealtype*)calloc(stages, sizeof(sunrealtype)); @@ -142,7 +162,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, } } - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (hasGammas) { /* allocate G matrices */ MRIC->G = (sunrealtype***)calloc(nmat, sizeof(sunrealtype**)); @@ -156,7 +176,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, for (i = 0; i < nmat; i++) { MRIC->G[i] = NULL; - MRIC->G[i] = (sunrealtype**)calloc(stages, sizeof(sunrealtype*)); + MRIC->G[i] = (sunrealtype**)calloc(stages + 1, sizeof(sunrealtype*)); if (!(MRIC->G[i])) { MRIStepCoupling_Free(MRIC); @@ -167,7 +187,7 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, /* allocate columns of each matrix in G */ for (i = 0; i < nmat; i++) { - for (j = 0; j < stages; j++) + for (j = 0; j <= stages; j++) { MRIC->G[i][j] = NULL; MRIC->G[i][j] = (sunrealtype*)calloc(stages, sizeof(sunrealtype)); @@ -180,11 +200,35 @@ MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, } } + /* for MERK methods, allocate maximum possible number/sizes of stage groups */ + if (type == MRISTEP_MERK) + { + MRIC->ngroup = stages; + MRIC->group = (int**)malloc(stages * sizeof(int*)); + if (!(MRIC->group)) + { + MRIStepCoupling_Free(MRIC); + return (NULL); + } + for (i = 0; i < stages; i++) + { + MRIC->group[i] = NULL; + MRIC->group[i] = (int*)malloc(stages * sizeof(int)); + if (!(MRIC->group[i])) + { + MRIStepCoupling_Free(MRIC); + return (NULL); + } + for (j = 0; j < stages; j++) { MRIC->group[i][j] = -1; } + } + } + return (MRIC); } /*--------------------------------------------------------------- - Routine to allocate and fill a MRIStepCoupling structure + Routine to allocate and fill an explicit, implicit, or ImEx + MRIGARK MRIStepCoupling structure. ---------------------------------------------------------------*/ MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, sunrealtype* W, sunrealtype* G, @@ -218,41 +262,60 @@ MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, /* Abscissae */ for (i = 0; i < stages; i++) { MRIC->c[i] = c[i]; } - /* Coupling coefficients stored as 1D arrays of length nmat * stages * stages, - with each stages * stages matrix stored in C (row-major) order */ - if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) + /* Coupling coefficients stored as 1D arrays, based on whether they + include embedding coefficients */ + if (p == 0) { + /* non-embedded method: coupling coefficient 1D arrays have + length nmat * stages * stages, with each stages * stages + matrix stored in C (row-major) order */ for (k = 0; k < nmat; k++) { for (i = 0; i < stages; i++) { for (j = 0; j < stages; j++) { - MRIC->W[k][i][j] = W[stages * (stages * k + i) + j]; + if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) + { + MRIC->W[k][i][j] = W[stages * (stages * k + i) + j]; + } + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + { + MRIC->G[k][i][j] = G[stages * (stages * k + i) + j]; + } } } } } - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + else { + /* embedded method: coupling coefficient 1D arrays have + length nmat * (stages+1) * stages, with each (stages+1) * stages + matrix stored in C (row-major) order */ for (k = 0; k < nmat; k++) { - for (i = 0; i < stages; i++) + for (i = 0; i <= stages; i++) { for (j = 0; j < stages; j++) { - MRIC->G[k][i][j] = G[stages * (stages * k + i) + j]; + if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) + { + MRIC->W[k][i][j] = W[(stages + 1) * (stages * k + i) + j]; + } + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + { + MRIC->G[k][i][j] = G[(stages + 1) * (stages * k + i) + j]; + } } } } } - return (MRIC); } /*--------------------------------------------------------------- - Construct the MRI coupling matrix for an MIS method based on - a given 'slow' Butcher table. + Construct the MRIGARK coupling matrix for an MIS method based + on a given "slow" Butcher table. ---------------------------------------------------------------*/ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) { @@ -268,6 +331,9 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) /* Check that input table is non-NULL */ if (!B) { return (NULL); } + /* If p>0, check that input table includes embedding coefficients */ + if ((p > 0) && (B->d == NULL)) { return (NULL); } + /* ----------------------------------- * Check that the input table is valid * ----------------------------------- */ @@ -300,14 +366,21 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) padding = SUNFALSE; - /* Last stage time should equal 1 */ + /* Pad if last stage does not equal 1 */ if (SUNRabs(B->c[B->stages - 1] - ONE) > tol) { padding = SUNTRUE; } - /* Last row of A should equal b */ + /* Pad if last row of A does not equal b */ for (j = 0; j < B->stages; j++) { if (SUNRabs(B->A[B->stages - 1][j] - B->b[j]) > tol) { padding = SUNTRUE; } } + + /* If final stage is implicit and the method contains an embedding, + we require padding since d != b */ + if ((p > 0) && (SUNRabs(B->A[B->stages - 1][B->stages - 1]) > tol)) + { + padding = SUNTRUE; + } stages = (padding) ? B->stages + 1 : B->stages; /* ------------------------- @@ -369,6 +442,15 @@ MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p) } } + /* Embedded row = d(:) - A(end,:) */ + if (p > 0) + { + for (j = 0; j < B->stages; j++) + { + C[0][stages][j] = B->d[j] - B->A[B->stages - 1][j]; + } + } + return (MRIC); } @@ -384,11 +466,8 @@ MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC) /* Check for legal input */ if (!MRIC) { return (NULL); } - /* Check for method coefficients and set method type */ - if (MRIC->W && MRIC->G) { type = MRISTEP_IMEX; } - else if (MRIC->W && !(MRIC->G)) { type = MRISTEP_EXPLICIT; } - else if (!(MRIC->W) && MRIC->G) { type = MRISTEP_IMPLICIT; } - else { return (NULL); } + /* Copy method type */ + type = MRIC->type; /* Check for stage times */ if (!(MRIC->c)) { return (NULL); } @@ -413,7 +492,7 @@ MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC) { for (k = 0; k < nmat; k++) { - for (i = 0; i < stages; i++) + for (i = 0; i <= stages; i++) { for (j = 0; j < stages; j++) { @@ -428,7 +507,7 @@ MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC) { for (k = 0; k < nmat; k++) { - for (i = 0; i < stages; i++) + for (i = 0; i <= stages; i++) { for (j = 0; j < stages; j++) { @@ -438,6 +517,19 @@ MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC) } } + /* Copy MERK stage groups */ + if (MRIC->group) + { + MRICcopy->ngroup = MRIC->ngroup; + for (i = 0; i < stages; i++) + { + for (j = 0; j < stages; j++) + { + MRICcopy->group[i][j] = MRIC->group[i][j]; + } + } + } + return (MRICcopy); } @@ -453,10 +545,11 @@ void MRIStepCoupling_Space(MRIStepCoupling MRIC, sunindextype* liw, if (!MRIC) { return; } /* fill outputs based on MRIC */ - *liw = 4; + *liw = 5; if (MRIC->c) { *lrw += MRIC->stages; } - if (MRIC->W) { *lrw += MRIC->nmat * MRIC->stages * MRIC->stages; } - if (MRIC->G) { *lrw += MRIC->nmat * MRIC->stages * MRIC->stages; } + if (MRIC->W) { *lrw += MRIC->nmat * (MRIC->stages + 1) * MRIC->stages; } + if (MRIC->G) { *lrw += MRIC->nmat * (MRIC->stages + 1) * MRIC->stages; } + if (MRIC->group) { *liw += MRIC->stages * MRIC->stages; } } /*--------------------------------------------------------------- @@ -478,7 +571,7 @@ void MRIStepCoupling_Free(MRIStepCoupling MRIC) { if (MRIC->W[k]) { - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { if (MRIC->W[k][i]) { @@ -499,7 +592,7 @@ void MRIStepCoupling_Free(MRIStepCoupling MRIC) { if (MRIC->G[k]) { - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { if (MRIC->G[k][i]) { @@ -514,6 +607,19 @@ void MRIStepCoupling_Free(MRIStepCoupling MRIC) free(MRIC->G); } + if (MRIC->group) + { + for (i = 0; i < MRIC->stages; i++) + { + if (MRIC->group[i]) + { + free(MRIC->group[i]); + MRIC->group[i] = NULL; + } + } + free(MRIC->group); + } + free(MRIC); } } @@ -535,7 +641,7 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) for (i = 0; i < MRIC->nmat; i++) { if (!(MRIC->W[i])) { return; } - for (j = 0; j < MRIC->stages; j++) + for (j = 0; j <= MRIC->stages; j++) { if (!(MRIC->W[i][j])) { return; } } @@ -547,13 +653,30 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) for (i = 0; i < MRIC->nmat; i++) { if (!(MRIC->G[i])) { return; } - for (j = 0; j < MRIC->stages; j++) + for (j = 0; j <= MRIC->stages; j++) { if (!(MRIC->G[i][j])) { return; } } } } + if (MRIC->group) + { + for (i = 0; i < MRIC->stages; i++) + { + if (!(MRIC->group[i])) { return; } + } + } + + switch (MRIC->type) + { + case MRISTEP_EXPLICIT: fprintf(outfile, " type = explicit MRI\n"); break; + case MRISTEP_IMPLICIT: fprintf(outfile, " type = implicit MRI\n"); break; + case MRISTEP_IMEX: fprintf(outfile, " type = ImEx MRI\n"); break; + case MRISTEP_MERK: fprintf(outfile, " type = MERK\n"); break; + case MRISTEP_SR: fprintf(outfile, " type = MRISR\n"); break; + default: fprintf(outfile, " type = unknown\n"); + } fprintf(outfile, " nmat = %i\n", MRIC->nmat); fprintf(outfile, " stages = %i\n", MRIC->stages); fprintf(outfile, " method order (q) = %i\n", MRIC->q); @@ -570,7 +693,7 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) for (k = 0; k < MRIC->nmat; k++) { fprintf(outfile, " W[%i] = \n", k); - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { fprintf(outfile, " "); for (j = 0; j < MRIC->stages; j++) @@ -588,7 +711,7 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) for (k = 0; k < MRIC->nmat; k++) { fprintf(outfile, " G[%i] = \n", k); - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { fprintf(outfile, " "); for (j = 0; j < MRIC->stages; j++) @@ -600,6 +723,23 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) fprintf(outfile, "\n"); } } + + if (MRIC->group) + { + fprintf(outfile, " ngroup = %i\n", MRIC->ngroup); + for (i = 0; i < MRIC->ngroup; i++) + { + fprintf(outfile, " group[%i] = ", i); + for (j = 0; j < MRIC->stages; j++) + { + if (MRIC->group[i][j] >= 0) + { + fprintf(outfile, "%i ", MRIC->group[i][j]); + } + } + fprintf(outfile, "\n"); + } + } } /* =========================================================================== @@ -613,36 +753,99 @@ void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile) * MRISTAGE_ERK_NOFAST -- standard ERK stage * MRISTAGE_DIRK_NOFAST -- standard DIRK stage * MRISTAGE_DIRK_FAST -- coupled DIRK + MIS-like stage + * MRISTAGE_STIFF_ACC -- "extra" stiffly-accurate stage * - * for each nontrivial stage in an MRI-like method. Otherwise (i.e., stage is - * not in [1,MRIC->stages-1]), returns ARK_INVALID_TABLE (<0). + * for each nontrivial stage, or embedding stage, in an MRI-like method. + * Otherwise (i.e., stage is not in [1,MRIC->stages]), returns + * ARK_INVALID_TABLE (<0). * - * The stage type is determined by 2 factors: + * The stage type is determined by 2 factors (for normal stages): * (a) Sum |MRIC->G[:][is][is]| (nonzero => DIRK) * (b) MRIC->c[is] - MRIC->c[is-1] (nonzero => fast) + * Similar tests are used for embedding stages. + * + * Note that MERK and MRI-SR methods do not use the stage-type identifiers, + * so if those tables are input we just return MRISTAGE_ERK_FAST. * ---------------------------------------------------------------------------*/ int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) { - int i; - sunrealtype Gabs, cdiff; + int i, j; + sunbooleantype Gdiag, Grow, Wrow, cdiff; const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; - if ((is < 1) || (is >= MRIC->stages)) { return ARK_INVALID_TABLE; } + if ((is < 0) || (is > MRIC->stages)) { return ARK_INVALID_TABLE; } - /* sum of stage diagonal entries across implicit tables */ - Gabs = ZERO; - if (MRIC->G) + /* report MRISTAGE_ERK_FAST for MERK and MRI-SR methods */ + if ((MRIC->type == MRISTEP_SR) || (MRIC->type == MRISTEP_MERK)) { - for (i = 0; i < MRIC->nmat; i++) { Gabs += SUNRabs(MRIC->G[i][is][is]); } + return (MRISTAGE_ERK_FAST); } - /* abscissae difference */ - cdiff = MRIC->c[is] - MRIC->c[is - 1]; + /* separately handle an embedding "stage" from normal stages */ + if (is < MRIC->stages) + { /* normal */ + Gdiag = Grow = Wrow = cdiff = SUNFALSE; + if (MRIC->G) + { + for (i = 0; i < MRIC->nmat; i++) + { + Gdiag = Gdiag || (SUNRabs(MRIC->G[i][is][is]) > tol); + for (j = 0; j < MRIC->stages; j++) + { + Grow = Grow || (SUNRabs(MRIC->G[i][is][j]) > tol); + } + } + } + if (MRIC->W) + { + for (i = 0; i < MRIC->nmat; i++) + { + for (j = 0; j < MRIC->stages; j++) + { + Wrow = Wrow || (SUNRabs(MRIC->W[i][is][j]) > tol); + } + } + } + + /* abscissae difference */ + cdiff = (SUNRabs(MRIC->c[is] - MRIC->c[is - 1]) > tol); + } + else + { /* embedding */ + Gdiag = Grow = Wrow = cdiff = SUNFALSE; + if (MRIC->G) + { + for (i = 0; i < MRIC->nmat; i++) + { + Gdiag = Gdiag || (SUNRabs(MRIC->G[i][is][is - 1]) > tol); + for (j = 0; j < MRIC->stages; j++) + { + Grow = Grow || (SUNRabs(MRIC->G[i][is][j]) > tol); + } + } + } + if (MRIC->W) + { + for (i = 0; i < MRIC->nmat; i++) + { + for (j = 0; j < MRIC->stages; j++) + { + Wrow = Wrow || (SUNRabs(MRIC->W[i][is][j]) > tol); + } + } + } + cdiff = (SUNRabs(MRIC->c[is - 1] - MRIC->c[is - 2]) > tol); + } - if (Gabs > tol) + /* make determination */ + if (!(Gdiag || Grow || Wrow || cdiff) && (is > 0)) + { /* stiffly-accurate stage */ + return (MRISTAGE_STIFF_ACC); + } + if (Gdiag) { /* DIRK */ - if (cdiff > tol) + if (cdiff) { /* Fast */ return (MRISTAGE_DIRK_FAST); } @@ -650,7 +853,7 @@ int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) } else { /* ERK */ - if (cdiff > tol) + if (cdiff) { /* Fast */ return (MRISTAGE_ERK_FAST); } @@ -663,6 +866,9 @@ int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) * first stage of the pair generally corresponds to a column of zeros and so * does not need to be computed and stored. The stage_map indicates if the RHS * needs to be computed and where to store it i.e., stage_map[i] > -1. + * + * Note: for MERK and MRI-SR methods, this should be an "identity" map, and all + * stage vectors should be allocated. * ---------------------------------------------------------------------------*/ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, int* stage_map, @@ -680,9 +886,23 @@ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, int* stage_map, if (!(MRIC->W) && !(MRIC->G)) { return (ARK_ILL_INPUT); } if (!stage_map || !nstages_active) { return (ARK_ILL_INPUT); } - /* ------------------- - * Compute storage map - * ------------------- */ + /* ------------------------------------------- + * MERK and MRI-SR have "identity" storage map + * ------------------------------------------- */ + + if ((MRIC->type == MRISTEP_MERK) || (MRIC->type == MRISTEP_SR)) + { + /* Number of stage RHS vectors active */ + *nstages_active = MRIC->stages; + + /* Create an identity map (all columns are non-zero) */ + for (j = 0; j < MRIC->stages; j++) { stage_map[j] = j; } + return (ARK_SUCCESS); + } + + /* ---------------------------------------- + * Compute storage map for MRI-GARK methods + * ---------------------------------------- */ /* Number of stage RHS vectors active */ *nstages_active = 0; @@ -701,7 +921,7 @@ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, int* stage_map, { for (k = 0; k < MRIC->nmat; k++) { - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { Wsum += SUNRabs(MRIC->W[k][i][j]); } @@ -712,7 +932,7 @@ int mriStepCoupling_GetStageMap(MRIStepCoupling MRIC, int* stage_map, { for (k = 0; k < MRIC->nmat; k++) { - for (i = 0; i < MRIC->stages; i++) + for (i = 0; i <= MRIC->stages; i++) { Gsum += SUNRabs(MRIC->G[k][i][j]); } diff --git a/src/arkode/arkode_mri_tables.def b/src/arkode/arkode_mri_tables.def index 999ef71f95..9e6bb316a8 100644 --- a/src/arkode/arkode_mri_tables.def +++ b/src/arkode/arkode_mri_tables.def @@ -25,34 +25,43 @@ below. The 'type' column denotes whether the method is explicit (E), - or solve-decoupled implicit (ID). + solve-decoupled implicit (ID), solve-decoupled ImEx (IED), + and/or has stage-restart structure (S). The 'QP' column denotes whether the coefficients of the method are known precisely enough for use in quad precision (128-bit) calculations. - imeth order type QP - ----------------------------------------------------- - ARKODE_MRI_GARK_FORWARD_EULER 1 E Y - ARKODE_MRI_GARK_RALSTON2 2 E Y - ARKODE_MIS_KW3 3 E Y - ARKODE_MRI_GARK_ERK22a 2 E Y - ARKODE_MRI_GARK_ERK22b 2 E Y - ARKODE_MRI_GARK_ERK33a 3 E Y - ARKODE_MRI_GARK_RALSTON3 3 E Y - ARKODE_MRI_GARK_ERK45a 4 E Y - ARKODE_MRI_GARK_BACKWARD_EULER 1 ID Y - ARKODE_MRI_GARK_IRK21a 2 ID Y - ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 2 ID Y - ARKODE_MRI_GARK_ESDIRK34a 3 ID Y - ARKODE_MRI_GARK_ESDIRK46a 4 ID Y - ARKODE_IMEX_MRI_GARK_EULER 1 ID Y - ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 2 ID Y - ARKODE_IMEX_MRI_GARK_MIDPOINT 2 ID Y - ARKODE_IMEX_MRI_GARK3a 3 ID Y - ARKODE_IMEX_MRI_GARK3b 3 ID Y - ARKODE_IMEX_MRI_GARK4 4 ID Y - ----------------------------------------------------- + method embedding + imeth order order type QP + ---------------------------------------------------------------- + ARKODE_MRI_GARK_FORWARD_EULER 1 0 E Y + ARKODE_MRI_GARK_ERK22a 2 1 E Y + ARKODE_MRI_GARK_ERK22b 2 1 E Y + ARKODE_MRI_GARK_RALSTON2 2 1 E Y + ARKODE_MIS_KW3 3 0 E Y + ARKODE_MRI_GARK_ERK33a 3 2 E Y + ARKODE_MRI_GARK_RALSTON3 3 2 E Y + ARKODE_MRI_GARK_ERK45a 4 3 E Y + ARKODE_MERK21 2 1 ES Y + ARKODE_MERK32 3 2 ES Y + ARKODE_MERK43 4 3 ES Y + ARKODE_MERK54 5 4 ES Y + ARKODE_MRI_GARK_BACKWARD_EULER 1 0 ID Y + ARKODE_MRI_GARK_IRK21a 2 1 ID Y + ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 2 0 ID Y + ARKODE_MRI_GARK_ESDIRK34a 3 2 ID Y + ARKODE_MRI_GARK_ESDIRK46a 4 3 ID Y + ARKODE_IMEX_MRI_GARK_EULER 1 0 ID Y + ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 2 0 ID Y + ARKODE_IMEX_MRI_GARK_MIDPOINT 2 0 ID Y + ARKODE_IMEX_MRI_GARK3a 3 0 IED Y + ARKODE_IMEX_MRI_GARK3b 3 0 IED Y + ARKODE_IMEX_MRI_GARK4 4 0 IED Y + ARKODE_IMEX_MRI_SR21 2 1 IEDS Y + ARKODE_IMEX_MRI_SR32 3 2 IEDS Y + ARKODE_IMEX_MRI_SR43 4 3 IEDS Y + ---------------------------------------------------------------- */ @@ -62,35 +71,35 @@ ARK_MRI_TABLE(ARKODE_MRI_NONE, { ARK_MRI_TABLE(ARKODE_MRI_GARK_FORWARD_EULER, { ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_FORWARD_EULER_1_1); - MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 1, 0); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON2, { /* Roberts et al., SISC 44:A1405 - A1427, 2022 */ ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_RALSTON_EULER_2_1_2); - MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) ARK_MRI_TABLE(ARKODE_MIS_KW3, { /* Schlegel et al., JCAM 226:345-357, 2009 */ ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_KNOTH_WOLKE_3_3); - MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 3, 0); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK22a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_EXPLICIT_MIDPOINT_EULER_2_1_2); - MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK22b, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ ARKodeButcherTable B = ARKodeButcherTable_LoadERK(ARKODE_HEUN_EULER_2_1_2); - MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, 2, 0); + MRIStepCoupling C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) @@ -99,7 +108,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK33a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C = MRIStepCoupling_Alloc(2, 4, MRISTEP_EXPLICIT); C->q = 3; - C->p = 0; + C->p = 2; C->c[1] = ONE/SUN_RCONST(3.0); C->c[2] = TWO/SUN_RCONST(3.0); @@ -110,6 +119,9 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK33a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ C->W[0][2][1] = TWO/SUN_RCONST(3.0); C->W[0][3][1] = -TWO/SUN_RCONST(3.0); C->W[0][3][2] = ONE; + C->W[0][4][0] = ONE/SUN_RCONST(12.0); + C->W[0][4][1] = -ONE/SUN_RCONST(3.0); + C->W[0][4][2] = SUN_RCONST(7.0)/SUN_RCONST(12.0); C->W[1][3][0] = ONE/TWO; C->W[1][3][2] = -ONE/TWO; @@ -120,7 +132,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON3, { /* Roberts et al., SISC 44:A1405 - A14 MRIStepCoupling C = MRIStepCoupling_Alloc(2, 4, MRISTEP_EXPLICIT); C->q = 3; - C->p = 0; + C->p = 2; C->c[1] = ONE/TWO; C->c[2] = SUN_RCONST(3.0)/SUN_RCONST(4.0); @@ -132,6 +144,9 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON3, { /* Roberts et al., SISC 44:A1405 - A14 C->W[0][3][0] = SUN_RCONST(47.0)/SUN_RCONST(36.0); C->W[0][3][1] = -ONE/SUN_RCONST(6.0); C->W[0][3][2] = -SUN_RCONST(8.0)/SUN_RCONST(9.0); + C->W[0][4][0] = ONE/SUN_RCONST(40.0); + C->W[0][4][1] = SUN_RCONST(7.0)/SUN_RCONST(40.0); + C->W[0][4][2] = ONE/SUN_RCONST(20.0); C->W[1][2][0] = SUN_RCONST(9.0)/TWO; C->W[1][2][1] = -SUN_RCONST(9.0)/TWO; @@ -142,10 +157,11 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_RALSTON3, { /* Roberts et al., SISC 44:A1405 - A14 }) ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ + /* Embedding coefficients CORRECTED in A. Sandu, arxiv:1808.02759, 2018 */ MRIStepCoupling C = MRIStepCoupling_Alloc(2, 6, MRISTEP_EXPLICIT); C->q = 4; - C->p = 0; + C->p = 3; C->c[1] = SUN_RCONST(0.2); C->c[2] = SUN_RCONST(0.4); @@ -168,6 +184,11 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ C->W[0][5][2] = -SUN_RCONST(1360217.0)/SUN_RCONST(1139280.0); C->W[0][5][3] = -SUN_RCONST(148789.0)/SUN_RCONST(56964.0); C->W[0][5][4] = SUN_RCONST(147889.0)/SUN_RCONST(45120.0); + C->W[0][6][0] = -SUN_RCONST(88227.0)/SUN_RCONST(47470.0); + C->W[0][6][1] = SUN_RCONST(756870829.0)/SUN_RCONST(340217490.0); + C->W[0][6][2] = -SUN_RCONST(713704111.0)/SUN_RCONST(1360869960.0); + C->W[0][6][3] = -SUN_RCONST(31967827.0)/SUN_RCONST(340217490.0); + C->W[0][6][4] = SUN_RCONST(129673.0)/SUN_RCONST(286680.0); C->W[1][2][0] = SUN_RCONST(503.0)/SUN_RCONST(80.0); C->W[1][2][1] = -SUN_RCONST(503.0)/SUN_RCONST(80.0); @@ -183,6 +204,8 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ERK45a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ C->W[1][5][2] = ONE; C->W[1][5][3] = SUN_RCONST(5.0); C->W[1][5][4] = -SUN_RCONST(41933.0)/SUN_RCONST(7520.0); + C->W[1][6][0] = SUN_RCONST(6213.0)/SUN_RCONST(1880.0); + C->W[1][6][1] = -SUN_RCONST(6213.0)/SUN_RCONST(1880.0); return C; }) @@ -203,9 +226,10 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_BACKWARD_EULER, { ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ MRIStepCoupling C; - ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNFALSE); + ARKodeButcherTable B = ARKodeButcherTable_Alloc(3, SUNTRUE); B->q=2; + B->p=1; B->c[1] = ONE; B->c[2] = ONE; @@ -217,7 +241,9 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IRK21a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ B->b[0] = SUN_RCONST(0.5); B->b[2] = SUN_RCONST(0.5); - C = MRIStepCoupling_MIStoMRI(B, 2, 0); + B->d[2] = SUN_RCONST(1.0); + + C = MRIStepCoupling_MIStoMRI(B, B->q, B->p); ARKodeButcherTable_Free(B); return C; }) @@ -240,11 +266,11 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, { }) ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ - MRIStepCoupling C = MRIStepCoupling_Alloc(1, 7, MRISTEP_IMPLICIT); + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 8, MRISTEP_IMPLICIT); sunrealtype beta = SUN_RCONST(0.4358665215084589994160194511935568425); C->q = 3; - C->p = 0; + C->p = 2; C->c[1] = ONE/SUN_RCONST(3.0); C->c[2] = ONE/SUN_RCONST(3.0); @@ -252,6 +278,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 C->c[4] = TWO/SUN_RCONST(3.0); C->c[5] = ONE; C->c[6] = ONE; + C->c[7] = ONE; C->G[0][1][0] = ONE/SUN_RCONST(3.0); C->G[0][2][0] = -beta; @@ -266,14 +293,18 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK34a, { /* A. Sandu, SINUM 57:2300-2327, 2019 C->G[0][5][4] = SUN_RCONST(-0.9934660860338359976640778047742273701); C->G[0][6][0] = -beta; C->G[0][6][6] = beta; + C->G[0][8][0] = SUN_RCONST(0.2453831999117524372455680781104585876241); + C->G[0][8][2] = SUN_RCONST(0.4204215033044044563073464989473988121422); + C->G[0][8][4] = -SUN_RCONST(1.576992606344066224351397232226173387157); + C->G[0][8][6] = SUN_RCONST(0.9111879031279093307984826551683159873903); return C; }) ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 */ - MRIStepCoupling C = MRIStepCoupling_Alloc(2, 11, MRISTEP_IMPLICIT); + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 12, MRISTEP_IMPLICIT); C->q = 4; - C->p = 0; + C->p = 3; C->c[1] = ONE/SUN_RCONST(5.0); C->c[2] = ONE/SUN_RCONST(5.0); @@ -285,6 +316,7 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 C->c[8] = SUN_RCONST(4.0)/SUN_RCONST(5.0); C->c[9] = ONE; C->c[10] = ONE; + C->c[11] = ONE; C->G[0][1][0] = ONE/SUN_RCONST(5.0); C->G[0][2][0] = -ONE/SUN_RCONST(4.0); @@ -321,6 +353,12 @@ ARK_MRI_TABLE(ARKODE_MRI_GARK_ESDIRK46a, { /* A. Sandu, SINUM 57:2300-2327, 2019 C->G[0][10][6] = SUN_RCONST(127.0)/SUN_RCONST(300.0); C->G[0][10][8] = -SUN_RCONST(313.0)/SUN_RCONST(300.0); C->G[0][10][10] = ONE/SUN_RCONST(4.0); + C->G[0][12][0] = -ONE/SUN_RCONST(4.0); + C->G[0][12][2] = SUN_RCONST(5595.0)/SUN_RCONST(8804.0); + C->G[0][12][4] = -SUN_RCONST(2445.0)/SUN_RCONST(8804.0); + C->G[0][12][6] = -SUN_RCONST(4225.0)/SUN_RCONST(8804.0); + C->G[0][12][8] = SUN_RCONST(2205.0)/SUN_RCONST(4402.0); + C->G[0][12][10] = -SUN_RCONST(567.0)/SUN_RCONST(4402.0); C->G[1][3][0] = -SUN_RCONST(1674554930619.0)/SUN_RCONST(964681845400.0); C->G[1][3][2] = SUN_RCONST(1674554930619.0)/SUN_RCONST(964681845400.0); @@ -618,3 +656,465 @@ ARK_MRI_TABLE(ARKODE_IMEX_MRI_GARK4, { /* R. Chinomona & D. Reynolds SINUM 43(5) return C; }) +ARK_MRI_TABLE(ARKODE_IMEX_MRI_SR21, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 */ + MRIStepCoupling C = MRIStepCoupling_Alloc(1, 4, MRISTEP_SR); + + C->q = 2; + C->p = 1; + + C->c[1] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + C->c[2] = SUN_RCONST(4.0)/SUN_RCONST(15.0); + C->c[3] = ONE; + + C->W[0][1][0] = SUN_RCONST(3.0)/SUN_RCONST(5.0); + C->W[0][2][0] = SUN_RCONST(14.0)/SUN_RCONST(165.0); + C->W[0][2][1] = SUN_RCONST(2.0)/SUN_RCONST(11.0); + C->W[0][3][0] = -SUN_RCONST(13.0)/SUN_RCONST(54.0); + C->W[0][3][1] = SUN_RCONST(137.0)/SUN_RCONST(270.0); + C->W[0][3][2] = SUN_RCONST(11.0)/SUN_RCONST(15.0); + C->W[0][4][0] = -SUN_RCONST(0.25); + C->W[0][4][1] = SUN_RCONST(0.5); + C->W[0][4][2] = SUN_RCONST(0.75); + + C->G[0][1][0] = -SUN_RCONST(11.0)/SUN_RCONST(23.0); + C->G[0][1][1] = SUN_RCONST(11.0)/SUN_RCONST(23.0); + C->G[0][2][0] = -SUN_RCONST(6692.0)/SUN_RCONST(52371.0); + C->G[0][2][1] = -SUN_RCONST(18355.0)/SUN_RCONST(52371.0); + C->G[0][2][2] = SUN_RCONST(11.0)/SUN_RCONST(23.0); + C->G[0][3][0] = SUN_RCONST(11621.0)/SUN_RCONST(90666.0); + C->G[0][3][1] = -SUN_RCONST(215249.0)/SUN_RCONST(226665.0); + C->G[0][3][2] = SUN_RCONST(17287.0)/SUN_RCONST(50370.0); + C->G[0][3][3] = SUN_RCONST(11.0)/SUN_RCONST(23.0); + C->G[0][4][0] = -SUN_RCONST(31.0)/SUN_RCONST(12.0); + C->G[0][4][1] = -ONE/SUN_RCONST(6.0); + C->G[0][4][2] = SUN_RCONST(11.0)/SUN_RCONST(4.0); + return C; + }) + +ARK_MRI_TABLE(ARKODE_IMEX_MRI_SR32, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 */ + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 5, MRISTEP_SR); + + C->q = 3; + C->p = 2; + + C->c[1] = SUN_RCONST(23.0)/SUN_RCONST(34.0); + C->c[2] = SUN_RCONST(4.0)/SUN_RCONST(5.0); + C->c[3] = SUN_RCONST(17.0)/SUN_RCONST(15.0); + C->c[4] = ONE; + + C->W[0][1][0] = SUN_RCONST(23.0)/SUN_RCONST(34.0); + C->W[0][2][0] = SUN_RCONST(71.0)/SUN_RCONST(70.0); + C->W[0][2][1] = -SUN_RCONST(3.0)/SUN_RCONST(14.0); + C->W[0][3][0] = SUN_RCONST(124.0)/SUN_RCONST(1155.0); + C->W[0][3][1] = SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->W[0][3][2] = SUN_RCONST(5.0)/SUN_RCONST(11.0); + C->W[0][4][0] = SUN_RCONST(162181.0)/SUN_RCONST(187680.0); + C->W[0][4][1] = SUN_RCONST(119.0)/SUN_RCONST(1380.0); + C->W[0][4][2] = SUN_RCONST(11.0)/SUN_RCONST(32.0); + C->W[0][4][3] = -SUN_RCONST(5.0)/SUN_RCONST(17.0); + C->W[0][5][0] = SUN_RCONST(76355.0)/SUN_RCONST(74834.0); + C->W[0][5][1] = -SUN_RCONST(46.0)/SUN_RCONST(31.0); + C->W[0][5][2] = SUN_RCONST(67.0)/SUN_RCONST(34.0); + C->W[0][5][3] = -SUN_RCONST(36.0)/SUN_RCONST(71.0); + + C->W[1][2][0] = -SUN_RCONST(14453.0)/SUN_RCONST(63825.0); + C->W[1][2][1] = SUN_RCONST(14453.0)/SUN_RCONST(63825.0); + C->W[1][3][0] = -SUN_RCONST(2101267877.0)/SUN_RCONST(1206582300.0); + C->W[1][3][1] = SUN_RCONST(2476735438.0)/SUN_RCONST(301645575.0); + C->W[1][3][2] = -SUN_RCONST(13575085.0)/SUN_RCONST(2098404.0); + C->W[1][4][0] = -SUN_RCONST(762580446799.0)/SUN_RCONST(588660102960.0); + C->W[1][4][1] = SUN_RCONST(11083240219.0)/SUN_RCONST(4328383110.0); + C->W[1][4][2] = -SUN_RCONST(211274129.0)/SUN_RCONST(100368304.0); + C->W[1][4][3] = SUN_RCONST(89562055.0)/SUN_RCONST(106641323.0); + C->W[1][5][0] = -SUN_RCONST(3732974.0)/SUN_RCONST(2278035.0); + C->W[1][5][1] = SUN_RCONST(13857574.0)/SUN_RCONST(2278035.0); + C->W[1][5][2] = -SUN_RCONST(52.0)/SUN_RCONST(9.0); + C->W[1][5][3] = SUN_RCONST(4.0)/SUN_RCONST(3.0); + + C->G[0][1][0] = -SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->G[0][1][1] = SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->G[0][2][0] = -SUN_RCONST(2707004.0)/SUN_RCONST(3127425.0); + C->G[0][2][1] = SUN_RCONST(919904.0)/SUN_RCONST(3127425.0); + C->G[0][2][2] = SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->G[0][3][0] = SUN_RCONST(852879271.0)/SUN_RCONST(703839675.0); + C->G[0][3][1] = -SUN_RCONST(1575000496.0)/SUN_RCONST(703839675.0); + C->G[0][3][2] = SUN_RCONST(5.0)/SUN_RCONST(11.0); + C->G[0][3][3] = SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->G[0][4][0] = SUN_RCONST(43136869.0)/SUN_RCONST(2019912118.0); + C->G[0][4][1] = -SUN_RCONST(73810600.0)/SUN_RCONST(1009956059.0); + C->G[0][4][2] = -SUN_RCONST(17653551.0)/SUN_RCONST(87822266.0); + C->G[0][4][3] = -SUN_RCONST(13993902.0)/SUN_RCONST(43911133.0); + C->G[0][4][4] = SUN_RCONST(4.0)/SUN_RCONST(7.0); + C->G[0][5][0] = -SUN_RCONST(179.0)/SUN_RCONST(4140.0); + C->G[0][5][1] = SUN_RCONST(799.0)/SUN_RCONST(14490.0); + C->G[0][5][2] = ONE/SUN_RCONST(14.0); + C->G[0][5][3] = -ONE/SUN_RCONST(12.0); + return C; + }) + +ARK_MRI_TABLE(ARKODE_IMEX_MRI_SR43, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, arXiv:2301.00865, 2023 */ + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 7, MRISTEP_SR); + + C->q = 4; + C->p = 3; + + C->c[1] = ONE/SUN_RCONST(4.0); + C->c[2] = SUN_RCONST(3.0)/SUN_RCONST(4.0); + C->c[3] = SUN_RCONST(11.0)/SUN_RCONST(20.0); + C->c[4] = ONE/SUN_RCONST(2.0); + C->c[5] = ONE; + C->c[6] = ONE; + + C->W[0][1][0] = ONE/SUN_RCONST(4.0); + C->W[0][2][0] = SUN_RCONST(9.0)/SUN_RCONST(8.0); + C->W[0][2][1] = -SUN_RCONST(3.0)/SUN_RCONST(8.0); + C->W[0][3][0] = SUN_RCONST(187.0)/SUN_RCONST(2340.0); + C->W[0][3][1] = SUN_RCONST(7.0)/SUN_RCONST(9.0); + C->W[0][3][2] = -SUN_RCONST(4.0)/SUN_RCONST(13.0); + C->W[0][4][0] = SUN_RCONST(64.0)/SUN_RCONST(165.0); + C->W[0][4][1] = ONE/SUN_RCONST(6.0); + C->W[0][4][2] = -SUN_RCONST(3.0)/SUN_RCONST(5.0); + C->W[0][4][3] = SUN_RCONST(6.0)/SUN_RCONST(11.0); + C->W[0][5][0] = SUN_RCONST(1816283.0)/SUN_RCONST(549120.0); + C->W[0][5][1] = -SUN_RCONST(2.0)/SUN_RCONST(9.0); + C->W[0][5][2] = -SUN_RCONST(4.0)/SUN_RCONST(11.0); + C->W[0][5][3] = -ONE/SUN_RCONST(6.0); + C->W[0][5][4] = -SUN_RCONST(2561809.0)/SUN_RCONST(1647360.0); + C->W[0][6][1] = SUN_RCONST(7.0)/SUN_RCONST(11.0); + C->W[0][6][2] = -SUN_RCONST(2203.0)/SUN_RCONST(264.0); + C->W[0][6][3] = SUN_RCONST(10825.0)/SUN_RCONST(792.0); + C->W[0][6][4] = -SUN_RCONST(85.0)/SUN_RCONST(12.0); + C->W[0][6][5] = SUN_RCONST(841.0)/SUN_RCONST(396.0); + C->W[0][7][0] = ONE/SUN_RCONST(400.0); + C->W[0][7][1] = SUN_RCONST(49.0)/SUN_RCONST(12.0); + C->W[0][7][2] = SUN_RCONST(43.0)/SUN_RCONST(6.0); + C->W[0][7][3] = -SUN_RCONST(7.0)/SUN_RCONST(10.0); + C->W[0][7][4] = -SUN_RCONST(85.0)/SUN_RCONST(12.0); + C->W[0][7][5] = -SUN_RCONST(2963.0)/SUN_RCONST(1200.0); + + C->W[1][2][0] = -SUN_RCONST(11.0)/SUN_RCONST(4.0); + C->W[1][2][1] = SUN_RCONST(11.0)/SUN_RCONST(4.0); + C->W[1][3][0] = -SUN_RCONST(1228.0)/SUN_RCONST(2925.0); + C->W[1][3][1] = -SUN_RCONST(92.0)/SUN_RCONST(225.0); + C->W[1][3][2] = SUN_RCONST(808.0)/SUN_RCONST(975.0); + C->W[1][4][0] = -SUN_RCONST(2572.0)/SUN_RCONST(2805.0); + C->W[1][4][1] = SUN_RCONST(167.0)/SUN_RCONST(255.0); + C->W[1][4][2] = SUN_RCONST(199.0)/SUN_RCONST(136.0); + C->W[1][4][3] = -SUN_RCONST(1797.0)/SUN_RCONST(1496.0); + C->W[1][5][0] = -SUN_RCONST(1816283.0)/SUN_RCONST(274560.0); + C->W[1][5][1] = SUN_RCONST(253.0)/SUN_RCONST(36.0); + C->W[1][5][2] = -SUN_RCONST(23.0)/SUN_RCONST(44.0); + C->W[1][5][3] = SUN_RCONST(76.0)/SUN_RCONST(3.0); + C->W[1][5][4] = -SUN_RCONST(20775791.0)/SUN_RCONST(823680.0); + C->W[1][6][1] = SUN_RCONST(107.0)/SUN_RCONST(132.0); + C->W[1][6][2] = SUN_RCONST(1289.0)/SUN_RCONST(88.0); + C->W[1][6][3] = -SUN_RCONST(9275.0)/SUN_RCONST(792.0); + C->W[1][6][5] = -SUN_RCONST(371.0)/SUN_RCONST(99.0); + C->W[1][7][0] = -ONE/SUN_RCONST(200.0); + C->W[1][7][1] = -SUN_RCONST(137.0)/SUN_RCONST(24.0); + C->W[1][7][2] = -SUN_RCONST(235.0)/SUN_RCONST(16.0); + C->W[1][7][3] = SUN_RCONST(1237.0)/SUN_RCONST(80.0); + C->W[1][7][5] = SUN_RCONST(2963.0)/SUN_RCONST(600.0); + + C->G[0][1][0] = -ONE/SUN_RCONST(4.0); + C->G[0][1][1] = ONE/SUN_RCONST(4.0); + C->G[0][2][0] = ONE/SUN_RCONST(4.0); + C->G[0][2][1] = -ONE/SUN_RCONST(2.0); + C->G[0][2][2] = ONE/SUN_RCONST(4.0); + C->G[0][3][0] = SUN_RCONST(13.0)/SUN_RCONST(100.0); + C->G[0][3][1] = -SUN_RCONST(7.0)/SUN_RCONST(30.0); + C->G[0][3][2] = -SUN_RCONST(11.0)/SUN_RCONST(75.0); + C->G[0][3][3] = ONE/SUN_RCONST(4.0); + C->G[0][4][0] = SUN_RCONST(6.0)/SUN_RCONST(85.0); + C->G[0][4][1] = -SUN_RCONST(301.0)/SUN_RCONST(1360.0); + C->G[0][4][2] = -SUN_RCONST(99.0)/SUN_RCONST(544.0); + C->G[0][4][3] = SUN_RCONST(45.0)/SUN_RCONST(544.0); + C->G[0][4][4] = ONE/SUN_RCONST(4.0); + C->G[0][5][1] = -SUN_RCONST(9.0)/SUN_RCONST(4.0); + C->G[0][5][2] = -SUN_RCONST(19.0)/SUN_RCONST(48.0); + C->G[0][5][3] = -SUN_RCONST(75.0)/SUN_RCONST(16.0); + C->G[0][5][4] = SUN_RCONST(85.0)/SUN_RCONST(12.0); + C->G[0][5][5] = ONE/SUN_RCONST(4.0); + return C; + }) + +ARK_MRI_TABLE(ARKODE_MERK21, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 (embedding unpublished) */ + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 3, MRISTEP_MERK); + sunrealtype c2 = SUN_RCONST(0.5); + + C->q = 2; + C->p = 1; + C->ngroup = 2; + C->group[0][0] = 1; + C->group[0][1] = 3; + C->group[1][0] = 2; + + C->c[1] = c2; + C->c[2] = ONE; + + C->W[0][1][0] = ONE; + C->W[0][2][0] = ONE; + C->W[0][3][0] = ONE; + + C->W[1][2][0] = -ONE/c2; + C->W[1][2][1] = ONE/c2; + return C; + }) + +ARK_MRI_TABLE(ARKODE_MERK32, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 (embedding unpublished) */ + MRIStepCoupling C = MRIStepCoupling_Alloc(2, 4, MRISTEP_MERK); + sunrealtype c2 = SUN_RCONST(0.5); + + C->q = 3; + C->p = 2; + C->ngroup = 3; + C->group[0][0] = 1; + C->group[1][0] = 2; + C->group[1][1] = 4; + C->group[2][0] = 3; + + C->c[1] = c2; + C->c[2] = SUN_RCONST(2.0)/SUN_RCONST(3.0); + C->c[3] = ONE; + + C->W[0][1][0] = ONE; + C->W[0][2][0] = ONE; + C->W[0][3][0] = ONE; + C->W[0][4][0] = ONE; + + C->W[1][2][0] = -ONE/c2; + C->W[1][2][1] = ONE/c2; + C->W[1][3][0] = -SUN_RCONST(1.5); + C->W[1][3][2] = SUN_RCONST(1.5); + C->W[1][4][0] = -ONE/c2; + C->W[1][4][1] = ONE/c2; + return C; + }) + +ARK_MRI_TABLE(ARKODE_MERK43, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 (embedding unpublished) */ + MRIStepCoupling C = MRIStepCoupling_Alloc(3, 7, MRISTEP_MERK); + sunrealtype c2 = SUN_RCONST(0.5); + sunrealtype c3 = SUN_RCONST(0.5); + sunrealtype c4 = ONE/SUN_RCONST(3.0); + sunrealtype c5 = SUN_RCONST(5.0)/SUN_RCONST(6.0); + sunrealtype c6 = ONE/SUN_RCONST(3.0); + + C->q = 4; + C->p = 3; + C->ngroup = 4; + C->group[0][0] = 1; + C->group[1][0] = 3; + C->group[1][1] = 2; + C->group[2][0] = 5; + C->group[2][1] = 4; + C->group[2][2] = 7; + C->group[3][0] = 6; + + C->c[1] = c2; + C->c[2] = c3; + C->c[3] = c4; + C->c[4] = c5; + C->c[5] = c6; + C->c[6] = ONE; + + C->W[0][1][0] = ONE; + C->W[0][2][0] = ONE; + C->W[0][3][0] = ONE; + C->W[0][4][0] = ONE; + C->W[0][5][0] = ONE; + C->W[0][6][0] = ONE; + C->W[0][7][0] = ONE; + + C->W[1][2][0] = -ONE/c2; + C->W[1][2][1] = ONE/c2; + C->W[1][3][0] = -ONE/c2; + C->W[1][3][1] = ONE/c2; + C->W[1][4][0] = c4/c3/(c3-c4) - c3/c4/(c3-c4); + C->W[1][4][2] = -c4/c3/(c3-c4); + C->W[1][4][3] = c3/c4/(c3-c4); + C->W[1][5][0] = c4/c3/(c3-c4) - c3/c4/(c3-c4); + C->W[1][5][2] = -c4/c3/(c3-c4); + C->W[1][5][3] = c3/c4/(c3-c4); + C->W[1][6][0] = c6/c5/(c5-c6) - c5/c6/(c5-c6); + C->W[1][6][4] = -c6/c5/(c5-c6); + C->W[1][6][5] = c5/c6/(c5-c6); + C->W[1][7][0] = c4/c3/(c3-c4) - c3/c4/(c3-c4); + C->W[1][7][2] = -c4/c3/(c3-c4); + C->W[1][7][3] = c3/c4/(c3-c4); + + C->W[2][4][0] = ONE/c4/(c3-c4) - ONE/c3/(c3-c4); + C->W[2][4][2] = ONE/c3/(c3-c4); + C->W[2][4][3] = -ONE/c4/(c3-c4); + C->W[2][5][0] = ONE/c4/(c3-c4) - ONE/c3/(c3-c4); + C->W[2][5][2] = ONE/c3/(c3-c4); + C->W[2][5][3] = -ONE/c4/(c3-c4); + C->W[2][6][0] = ONE/c6/(c5-c6) - ONE/c5/(c5-c6); + C->W[2][6][4] = ONE/c5/(c5-c6); + C->W[2][6][5] = -ONE/c6/(c5-c6); + C->W[2][7][0] = ONE/c4/(c3-c4) - ONE/c3/(c3-c4); + C->W[2][7][2] = ONE/c3/(c3-c4); + C->W[2][7][3] = -ONE/c4/(c3-c4); + + return C; + }) + +ARK_MRI_TABLE(ARKODE_MERK54, { /* A.C. Fish, D.R. Reynolds, S.B. Roberts, JCAM 438:115534, 2024 (embedding unpublished) */ + MRIStepCoupling C = MRIStepCoupling_Alloc(4, 11, MRISTEP_MERK); + sunrealtype c2 = SUN_RCONST(0.5); + sunrealtype c3 = SUN_RCONST(0.5); + sunrealtype c4 = ONE/SUN_RCONST(3.0); + sunrealtype c5 = SUN_RCONST(0.5); + sunrealtype c6 = ONE/SUN_RCONST(3.0); + sunrealtype c7 = SUN_RCONST(0.25); + sunrealtype c8 = SUN_RCONST(0.7); + sunrealtype c9 = SUN_RCONST(0.5); + sunrealtype c10 = SUN_RCONST(2.0)/SUN_RCONST(3.0); + sunrealtype a2 = ONE/c2; + sunrealtype a3 = c4/c3/(c4-c3); + sunrealtype a4 = c3/c4/(c3-c4); + sunrealtype a5 = c6*c7/c5/(c5-c6)/(c5-c7); + sunrealtype a6 = c5*c7/c6/(c6-c5)/(c6-c7); + sunrealtype a7 = c5*c6/c7/(c7-c5)/(c7-c6); + sunrealtype a8 = c9*c10/c8/(c8-c9)/(c8-c10); + sunrealtype a9 = c8*c10/c9/(c9-c8)/(c9-c10); + sunrealtype a10 = c8*c9/c10/(c10-c8)/(c10-c9); + sunrealtype b3 = ONE/c3/(c3-c4); + sunrealtype b4 = ONE/c4/(c3-c4); + sunrealtype b5 = (c6+c7)/c5/(c5-c6)/(c5-c7); + sunrealtype b6 = (c5+c7)/c6/(c6-c5)/(c6-c7); + sunrealtype b7 = (c5+c6)/c7/(c7-c5)/(c7-c6); + sunrealtype b8 = (c9+c10)/c8/(c8-c9)/(c8-c10); + sunrealtype b9 = (c8+c10)/c9/(c9-c8)/(c9-c10); + sunrealtype b10 = (c8+c9)/c10/(c10-c8)/(c10-c9); + sunrealtype g5 = ONE/c5/(c5-c6)/(c5-c7); + sunrealtype g6 = ONE/c6/(c6-c5)/(c6-c7); + sunrealtype g7 = ONE/c7/(c7-c5)/(c7-c6); + sunrealtype g8 = ONE/c8/(c8-c9)/(c8-c10); + sunrealtype g9 = ONE/c9/(c9-c8)/(c9-c10); + sunrealtype g10 = ONE/c10/(c10-c8)/(c10-c9); + + C->q = 5; + C->p = 4; + C->ngroup = 5; + C->group[0][0] = 1; + C->group[1][0] = 3; + C->group[1][1] = 2; + C->group[2][0] = 6; + C->group[2][1] = 5; + C->group[2][2] = 4; + C->group[3][0] = 8; + C->group[3][1] = 9; + C->group[3][2] = 7; + C->group[3][3] = 11; + C->group[4][0] = 10; + + C->c[1] = c2; + C->c[2] = c3; + C->c[3] = c4; + C->c[4] = c5; + C->c[5] = c6; + C->c[6] = c7; + C->c[7] = c8; + C->c[8] = c9; + C->c[9] = c10; + C->c[10] = ONE; + + C->W[0][1][0] = ONE; + C->W[0][2][0] = ONE; + C->W[0][3][0] = ONE; + C->W[0][4][0] = ONE; + C->W[0][5][0] = ONE; + C->W[0][6][0] = ONE; + C->W[0][7][0] = ONE; + C->W[0][8][0] = ONE; + C->W[0][9][0] = ONE; + C->W[0][10][0] = ONE; + C->W[0][11][0] = ONE; + + C->W[1][2][0] = -a2; + C->W[1][2][1] = a2; + C->W[1][3][0] = -a2; + C->W[1][3][1] = a2; + C->W[1][4][0] = -(a3 + a4); + C->W[1][4][2] = a3; + C->W[1][4][3] = a4; + C->W[1][5][0] = -(a3 + a4); + C->W[1][5][2] = a3; + C->W[1][5][3] = a4; + C->W[1][6][0] = -(a3 + a4); + C->W[1][6][2] = a3; + C->W[1][6][3] = a4; + C->W[1][7][0] = -(a5 + a6 + a7); + C->W[1][7][4] = a5; + C->W[1][7][5] = a6; + C->W[1][7][6] = a7; + C->W[1][8][0] = -(a5 + a6 + a7); + C->W[1][8][4] = a5; + C->W[1][8][5] = a6; + C->W[1][8][6] = a7; + C->W[1][9][0] = -(a5 + a6 + a7); + C->W[1][9][4] = a5; + C->W[1][9][5] = a6; + C->W[1][9][6] = a7; + C->W[1][10][0] = -(a8 + a9 + a10); + C->W[1][10][7] = a8; + C->W[1][10][8] = a9; + C->W[1][10][9] = a10; + C->W[1][11][0] = -(a5 + a6 + a7); + C->W[1][11][4] = a5; + C->W[1][11][5] = a6; + C->W[1][11][6] = a7; + + C->W[2][4][0] = b4 - b3; + C->W[2][4][2] = b3; + C->W[2][4][3] = -b4; + C->W[2][5][0] = b4 - b3; + C->W[2][5][2] = b3; + C->W[2][5][3] = -b4; + C->W[2][6][0] = b4 - b3; + C->W[2][6][2] = b3; + C->W[2][6][3] = -b4; + C->W[2][7][0] = b5 + b6 + b7; + C->W[2][7][4] = -b5; + C->W[2][7][5] = -b6; + C->W[2][7][6] = -b7; + C->W[2][8][0] = b5 + b6 + b7; + C->W[2][8][4] = -b5; + C->W[2][8][5] = -b6; + C->W[2][8][6] = -b7; + C->W[2][9][0] = b5 + b6 + b7; + C->W[2][9][4] = -b5; + C->W[2][9][5] = -b6; + C->W[2][9][6] = -b7; + C->W[2][10][0] = b8 + b9 + b10; + C->W[2][10][7] = -b8; + C->W[2][10][8] = -b9; + C->W[2][10][9] = -b10; + C->W[2][11][0] = b5 + b6 + b7; + C->W[2][11][4] = -b5; + C->W[2][11][5] = -b6; + C->W[2][11][6] = -b7; + + C->W[3][7][0] = -(g5 + g6 + g7); + C->W[3][7][4] = g5; + C->W[3][7][5] = g6; + C->W[3][7][6] = g7; + C->W[3][8][0] = -(g5 + g6 + g7); + C->W[3][8][4] = g5; + C->W[3][8][5] = g6; + C->W[3][8][6] = g7; + C->W[3][9][0] = -(g5 + g6 + g7); + C->W[3][9][4] = g5; + C->W[3][9][5] = g6; + C->W[3][9][6] = g7; + C->W[3][10][0] = -(g8 + g9 + g10); + C->W[3][10][7] = g8; + C->W[3][10][8] = g9; + C->W[3][10][9] = g10; + C->W[3][11][0] = -(g5 + g6 + g7); + C->W[3][11][4] = g5; + C->W[3][11][5] = g6; + C->W[3][11][6] = g7; + + return C; + }) diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index a078d19a33..823324bf81 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -110,7 +110,7 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, ark_mem->step_getgammas = mriStep_GetGammas; ark_mem->step_init = mriStep_Init; ark_mem->step_fullrhs = mriStep_FullRHS; - ark_mem->step = mriStep_TakeStep; + ark_mem->step = mriStep_TakeStepMRIGARK; ark_mem->step_setuserdata = mriStep_SetUserData; ark_mem->step_printallstats = mriStep_PrintAllStats; ark_mem->step_writeparameters = mriStep_WriteParameters; @@ -137,10 +137,14 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, ark_mem->step_getnumrhsevals = mriStep_GetNumRhsEvals; ark_mem->step_getnumlinsolvsetups = mriStep_GetNumLinSolvSetups; ark_mem->step_getcurrentgamma = mriStep_GetCurrentGamma; + ark_mem->step_setadaptcontroller = mriStep_SetAdaptController; + ark_mem->step_getestlocalerrors = mriStep_GetEstLocalErrors; ark_mem->step_getnonlinearsystemdata = mriStep_GetNonlinearSystemData; ark_mem->step_getnumnonlinsolviters = mriStep_GetNumNonlinSolvIters; ark_mem->step_getnumnonlinsolvconvfails = mriStep_GetNumNonlinSolvConvFails; ark_mem->step_getnonlinsolvstats = mriStep_GetNonlinSolvStats; + ark_mem->step_setforcing = mriStep_SetInnerForcing; + ark_mem->step_supports_adaptive = SUNTRUE; ark_mem->step_supports_implicit = SUNTRUE; ark_mem->step_mem = (void*)step_mem; @@ -159,16 +163,18 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, be allocated later on (based on the MRI method) */ /* Copy the slow RHS functions into stepper memory */ - step_mem->fse = fse; - step_mem->fsi = fsi; + step_mem->fse = fse; + step_mem->fsi = fsi; + step_mem->fse_is_current = SUNFALSE; + step_mem->fsi_is_current = SUNFALSE; /* Set implicit/explicit problem based on function pointers */ step_mem->explicit_rhs = (fse == NULL) ? SUNFALSE : SUNTRUE; step_mem->implicit_rhs = (fsi == NULL) ? SUNFALSE : SUNTRUE; /* Update the ARKODE workspace requirements */ - ark_mem->liw += 42; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ - ark_mem->lrw += 10; + ark_mem->liw += 49; /* fcn/data ptr, int, long int, sunindextype, sunbooleantype */ + ark_mem->lrw += 14; /* Create a default Newton NLS object (just in case; will be deleted if the user attaches a nonlinear solver) */ @@ -203,22 +209,58 @@ void* MRIStepCreate(ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, N_Vector y0, step_mem->lfree = NULL; step_mem->lmem = NULL; + /* Initialize error norm */ + step_mem->eRNrm = ONE; + /* Initialize all the counters */ - step_mem->nfse = 0; - step_mem->nfsi = 0; - step_mem->nsetups = 0; - step_mem->nstlp = 0; - step_mem->nls_iters = 0; - step_mem->nls_fails = 0; - - /* Initialize fused op work space */ - step_mem->cvals = NULL; + step_mem->nfse = 0; + step_mem->nfsi = 0; + step_mem->nsetups = 0; + step_mem->nstlp = 0; + step_mem->nls_iters = 0; + step_mem->nls_fails = 0; + step_mem->inner_fails = 0; + + /* Initialize fused op work space with sufficient storage for + at least filling the full RHS on an ImEx problem */ + step_mem->nfusedopvecs = 3; + step_mem->cvals = NULL; + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); + if (step_mem->cvals == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error allocating MRIStep storage"); + ARKodeFree((void**)&ark_mem); + return (NULL); + } + ark_mem->lrw += step_mem->nfusedopvecs; step_mem->Xvecs = NULL; + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, sizeof(N_Vector)); + if (step_mem->Xvecs == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Error allocating MRIStep storage"); + ARKodeFree((void**)&ark_mem); + return (NULL); + } + ark_mem->liw += step_mem->nfusedopvecs; + + /* Initialize adaptivity parameters */ + step_mem->inner_rtol_factor = ONE; + step_mem->inner_dsm = ONE; + step_mem->inner_rtol_factor_new = ONE; /* Initialize pre and post inner evolve functions */ step_mem->pre_inner_evolve = NULL; step_mem->post_inner_evolve = NULL; + /* Initialize external polynomial forcing data */ + step_mem->expforcing = SUNFALSE; + step_mem->impforcing = SUNFALSE; + step_mem->forcing = NULL; + step_mem->nforcing = 0; + /* Initialize main ARKODE infrastructure (allocates vectors) */ retval = arkInit(ark_mem, t0, y0, FIRST_INIT); if (retval != ARK_SUCCESS) @@ -329,15 +371,19 @@ int MRIStepReInit(void* arkode_mem, ARKRhsFn fse, ARKRhsFn fsi, sunrealtype t0, } /* Copy the input parameters into ARKODE state */ - step_mem->fse = fse; - step_mem->fsi = fsi; + step_mem->fse = fse; + step_mem->fsi = fsi; + step_mem->fse_is_current = SUNFALSE; + step_mem->fsi_is_current = SUNFALSE; /* Initialize all the counters */ - step_mem->nfse = 0; - step_mem->nfsi = 0; - step_mem->nsetups = 0; - step_mem->nstlp = 0; - step_mem->nls_iters = 0; + step_mem->nfse = 0; + step_mem->nfsi = 0; + step_mem->nsetups = 0; + step_mem->nstlp = 0; + step_mem->nls_iters = 0; + step_mem->nls_fails = 0; + step_mem->inner_fails = 0; return (ARK_SUCCESS); } @@ -384,10 +430,11 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, "Unable to resize vector"); return (ARK_MEM_FAIL); } + if (step_mem->unify_Fs) { step_mem->Fsi = step_mem->Fse; } } /* Resize Fsi */ - if (step_mem->Fsi) + if (step_mem->Fsi && !step_mem->unify_Fs) { if (!arkResizeVecArray(resize, resize_data, step_mem->nstages_allocated, y0, &(step_mem->Fsi), lrw_diff, &(ark_mem->lrw), @@ -496,7 +543,12 @@ int mriStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) /* Reset the inner integrator with this same state */ retval = mriStepInnerStepper_Reset(step_mem->stepper, tR, yR); - if (retval != ARK_SUCCESS) { return (ARK_INNERSTEP_FAIL); } + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } return (ARK_SUCCESS); } @@ -548,7 +600,7 @@ void mriStep_Free(ARKodeMem ark_mem) { free(step_mem->stagetypes); step_mem->stagetypes = NULL; - ark_mem->liw -= step_mem->stages; + ark_mem->liw -= (step_mem->stages + 1); } if (step_mem->stage_map) { @@ -608,6 +660,7 @@ void mriStep_Free(ARKodeMem ark_mem) arkFreeVecArray(step_mem->nstages_allocated, &(step_mem->Fse), ark_mem->lrw1, &(ark_mem->lrw), ark_mem->liw1, &(ark_mem->liw)); + if (step_mem->unify_Fs) { step_mem->Fsi = NULL; } } if (step_mem->Fsi) @@ -663,7 +716,7 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) fprintf(outfile, "MRIStep: predictor = %i\n", step_mem->predictor); fprintf(outfile, "MRIStep: convfail = %i\n", step_mem->convfail); fprintf(outfile, "MRIStep: stagetypes ="); - for (i = 0; i < step_mem->stages; i++) + for (i = 0; i <= step_mem->stages; i++) { fprintf(outfile, " %i", step_mem->stagetypes[i]); } @@ -675,6 +728,8 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) fprintf(outfile, "MRIStep: nsetups = %li\n", step_mem->nsetups); fprintf(outfile, "MRIStep: nstlp = %li\n", step_mem->nstlp); fprintf(outfile, "MRIStep: nls_iters = %li\n", step_mem->nls_iters); + fprintf(outfile, "MRIStep: nls_fails = %li\n", step_mem->nls_fails); + fprintf(outfile, "MRIStep: inner_fails = %li\n", step_mem->inner_fails); /* output boolean quantities */ fprintf(outfile, "MRIStep: user_linear = %i\n", step_mem->linear); @@ -726,7 +781,7 @@ void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) fprintf(outfile, "MRIStep: Fse[%i]:\n", i); N_VPrintFile(step_mem->Fse[i], outfile); } - if (step_mem->Fsi) + if (step_mem->Fsi && !step_mem->unify_Fs) for (i = 0; i < step_mem->nstages_active; i++) { fprintf(outfile, "MRIStep: Fsi[%i]:\n", i); @@ -862,17 +917,18 @@ int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat within arkInitialSetup. With initialization types FIRST_INIT this routine: - - 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/checks the coefficient tables to be used + - allocates any internal memory that depends on the MRI method + structure or solver options With other initialization types, this routine does nothing. ---------------------------------------------------------------*/ -int mriStep_Init(ARKodeMem ark_mem, int init_type) +int mriStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type) { ARKodeMRIStepMem step_mem; int retval, j; sunbooleantype reset_efun; + SUNAdaptController_Type adapt_type; /* access ARKodeMRIStepMem structure */ retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); @@ -885,10 +941,16 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) if (init_type == FIRST_INIT) { /* enforce use of arkEwtSmallReal if using a fixed step size for - an explicit method and an internal error weight function */ + an explicit method, an internal error weight function, and not performing + accumulated temporal error estimation */ reset_efun = SUNTRUE; if (step_mem->implicit_rhs) { reset_efun = SUNFALSE; } + if (!ark_mem->fixedstep) { reset_efun = SUNFALSE; } if (ark_mem->user_efun) { reset_efun = SUNFALSE; } + if (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE) + { + reset_efun = SUNFALSE; + } if (reset_efun) { ark_mem->user_efun = SUNFALSE; @@ -896,14 +958,6 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) ark_mem->e_data = ark_mem; } - /* assume fixed outer step size */ - if (!ark_mem->fixedstep) - { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, - __FILE__, "Adaptive outer time stepping is not currently supported"); - return (ARK_ILL_INPUT); - } - /* Create coupling structure (if not already set) */ retval = mriStep_SetCoupling(ark_mem); if (retval != ARK_SUCCESS) @@ -922,6 +976,35 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_ILL_INPUT); } + /* Attach correct TakeStep routine for this coupling table */ + switch (step_mem->MRIC->type) + { + case MRISTEP_EXPLICIT: ark_mem->step = mriStep_TakeStepMRIGARK; break; + case MRISTEP_IMPLICIT: ark_mem->step = mriStep_TakeStepMRIGARK; break; + case MRISTEP_IMEX: ark_mem->step = mriStep_TakeStepMRIGARK; break; + case MRISTEP_MERK: ark_mem->step = mriStep_TakeStepMERK; break; + case MRISTEP_SR: ark_mem->step = mriStep_TakeStepMRISR; break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown method type"); + return (ARK_ILL_INPUT); + } + + /* Retrieve/store method and embedding orders now that tables are finalized */ + step_mem->stages = step_mem->MRIC->stages; + step_mem->q = ark_mem->hadapt_mem->q = step_mem->MRIC->q; + step_mem->p = ark_mem->hadapt_mem->p = step_mem->MRIC->p; + + /* Ensure that if adaptivity or error accumulation is enabled, then + method includes embedding coefficients */ + if ((!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) && + (step_mem->p <= 0)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Temporal error estimation cannot be performed without embedding coefficients"); + return (ARK_ILL_INPUT); + } + /* allocate/fill derived quantities from MRIC structure */ /* stage map */ @@ -954,7 +1037,7 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) free(step_mem->stagetypes); ark_mem->liw -= step_mem->stages; } - step_mem->stagetypes = (int*)calloc(step_mem->MRIC->stages, + step_mem->stagetypes = (int*)calloc(step_mem->MRIC->stages + 1, sizeof(*step_mem->stagetypes)); if (step_mem->stagetypes == NULL) { @@ -962,8 +1045,8 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) MSG_ARK_MEM_FAIL); return (ARK_MEM_FAIL); } - ark_mem->liw += step_mem->MRIC->stages; - for (j = 0; j < step_mem->MRIC->stages; j++) + ark_mem->liw += (step_mem->MRIC->stages + 1); + for (j = 0; j <= step_mem->MRIC->stages; j++) { step_mem->stagetypes[j] = mriStepCoupling_GetStageType(step_mem->MRIC, j); } @@ -1011,9 +1094,9 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) free(step_mem->Xvecs); ark_mem->liw -= step_mem->nfusedopvecs; } - step_mem->nfusedopvecs = 2 * step_mem->MRIC->stages + 2; - step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, - sizeof(*step_mem->cvals)); + step_mem->nfusedopvecs = 2 * step_mem->MRIC->stages + 2 + step_mem->nforcing; + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(*step_mem->cvals)); if (step_mem->cvals == NULL) { arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, @@ -1037,6 +1120,16 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) step_mem->q = step_mem->MRIC->q; step_mem->p = step_mem->MRIC->p; + /* If an MRISR method is applied to a non-ImEx problem, we "unify" + the Fse and Fsi vectors to point at the same memory */ + step_mem->unify_Fs = SUNFALSE; + if ((step_mem->MRIC->type == MRISTEP_SR) && + ((step_mem->explicit_rhs && !step_mem->implicit_rhs) || + (!step_mem->explicit_rhs && step_mem->implicit_rhs))) + { + step_mem->unify_Fs = SUNTRUE; + } + /* Allocate MRI RHS vector memory, update storage requirements */ /* Allocate Fse[0] ... Fse[nstages_active - 1] and */ /* Fsi[0] ... Fsi[nstages_active - 1] if needed */ @@ -1049,15 +1142,17 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) arkFreeVecArray(step_mem->nstages_allocated, &(step_mem->Fse), ark_mem->lrw1, &(ark_mem->lrw), ark_mem->liw1, &(ark_mem->liw)); + if (step_mem->unify_Fs) { step_mem->Fsi = NULL; } } if (step_mem->implicit_rhs) { arkFreeVecArray(step_mem->nstages_allocated, &(step_mem->Fsi), ark_mem->lrw1, &(ark_mem->lrw), ark_mem->liw1, &(ark_mem->liw)); + if (step_mem->unify_Fs) { step_mem->Fse = NULL; } } } - if (step_mem->explicit_rhs) + if (step_mem->explicit_rhs && !step_mem->unify_Fs) { if (!arkAllocVecArray(step_mem->nstages_active, ark_mem->ewt, &(step_mem->Fse), ark_mem->lrw1, &(ark_mem->lrw), @@ -1066,7 +1161,7 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_MEM_FAIL); } } - if (step_mem->implicit_rhs) + if (step_mem->implicit_rhs && !step_mem->unify_Fs) { if (!arkAllocVecArray(step_mem->nstages_active, ark_mem->ewt, &(step_mem->Fsi), ark_mem->lrw1, &(ark_mem->lrw), @@ -1075,6 +1170,17 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) return (ARK_MEM_FAIL); } } + if (step_mem->unify_Fs) + { + if (!arkAllocVecArray(step_mem->nstages_active, ark_mem->ewt, + &(step_mem->Fse), ark_mem->lrw1, &(ark_mem->lrw), + ark_mem->liw1, &(ark_mem->liw))) + { + return (ARK_MEM_FAIL); + } + step_mem->Fsi = step_mem->Fse; + } + step_mem->nstages_allocated = step_mem->nstages_active; } @@ -1168,43 +1274,119 @@ int mriStep_Init(ARKodeMem ark_mem, int init_type) } } - return (ARK_SUCCESS); -} + /*** Perform timestep adaptivity checks and initial setup ***/ -/*------------------------------------------------------------------------------ - mriStep_FullRHS: + /* get timestep adaptivity type */ + adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller); - This is just a wrapper to call the user-supplied RHS functions, - f(t,y) = fse(t,y) + fsi(t,y) + ff(t,y). + if (ark_mem->fixedstep) + { + /* Fixed step sizes: user must supply the initial step size */ + if (ark_mem->hin == ZERO) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Timestep adaptivity disabled, but missing user-defined fixed stepsize"); + return (ARK_ILL_INPUT); + } + } + else + { + /* ensure that a compatible adaptivity controller is provided */ + if ((adapt_type != SUN_ADAPTCONTROLLER_MRI_H_TOL) && + (adapt_type != SUN_ADAPTCONTROLLER_H)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "SUNAdaptController type is unsupported by MRIStep"); + return (ARK_ILL_INPUT); + } - This will be called in one of three 'modes': + /* Controller provides adaptivity (at least at the slow time scale): + - verify that the MRI method includes an embedding, and + - estimate initial slow step size (store in ark_mem->hin) */ + if (step_mem->MRIC->p <= 0) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "Timestep adaptivity enabled, but non-embedded MRI table specified"); + return (ARK_ILL_INPUT); + } + if (ark_mem->hin == ZERO) + { + /* tempv1 = fslow(t0, y0) */ + if (mriStep_SlowRHS(ark_mem, ark_mem->tcur, ark_mem->yn, ark_mem->tempv1, + ARK_FULLRHS_START) != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + "error calling slow RHS function(s)"); + return (ARK_RHSFUNC_FAIL); + } + retval = mriStep_Hin(ark_mem, ark_mem->tcur, tout, ark_mem->tempv1, + &(ark_mem->hin)); + if (retval != ARK_SUCCESS) + { + retval = arkHandleFailure(ark_mem, retval); + return (retval); + } + } + } - ARK_FULLRHS_START -> called at the beginning of a simulation i.e., at - (tn, yn) = (t0, y0) or (tR, yR) + /* Perform additional setup for (H,tol) controller */ + if (adapt_type == SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + /* Verify that adaptivity type is supported by inner stepper */ + if (!mriStepInnerStepper_SupportsRTolAdaptivity(step_mem->stepper)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "MRI H-TOL SUNAdaptController provided, but unsupported by inner stepper"); + return (ARK_ILL_INPUT); + } - 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 + /* initialize fast stepper to use the same relative tolerance as MRIStep */ + step_mem->inner_rtol_factor = ONE; + } - ARK_FULLRHS_OTHER -> called elsewhere (e.g. for dense output) + return (ARK_SUCCESS); +} - 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. +/*------------------------------------------------------------------------------ + mriStep_FullRHS: - 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. + This is just a wrapper to call the user-supplied RHS functions, + f(t,y) = fse(t,y) + fsi(t,y) + ff(t,y). - Presently ff(t,y) is always called with ARK_FULLRHS_OTHER mode. + Note: this relies on the utility routine mriStep_UpdateF0 to update Fse[0] + and Fsi[0] as appropriate (i.e., leveraging previous evaluations, etc.), and + merely combines the resulting values together with ff to construct the output. + + However, in ARK_FULLRHS_OTHER mode, this routine must call all slow RHS + functions directly, since that mode cannot reuse internally stored values. + + ARK_FULLRHS_OTHER -> called in the following circumstances: + (a) when estimating the initial time step size, + (b) for high-order dense output with the Hermite + interpolation module, + (c) by an "outer" stepper when MRIStep is used as an + inner solver), or + (d) when a high-order implicit predictor is requested from + the Hermite interpolation module within the time step + t_{n} \to t_{n+1}. + + While instances (a)-(c) will occur in-between MRIStep time + steps, instance (d) can occur at the start of each internal + MRIStep stage. Since the (t,y) input does not correspond + to an "official" time step, thus the RHS functions should + always be evaluated, and the values should *not* be stored + anywhere that will interfere with other reused MRIStep data + from one stage to the next (but it may use nonlinear solver + scratch space). + + Note that this routine always calls the fast RHS function, ff(t,y), in + ARK_FULLRHS_OTHER mode. ----------------------------------------------------------------------------*/ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode) { ARKodeMRIStepMem step_mem; - int retval; + int nvec, retval; /* access ARKodeMRIStepMem structure */ retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); @@ -1213,124 +1395,48 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, /* ensure that inner stepper provides fullrhs function */ if (!(step_mem->stepper->ops->fullrhs)) { - arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, MSG_ARK_MISSING_FULLRHS); - return ARK_ILL_INPUT; + return ARK_RHSFUNC_FAIL; } /* perform RHS functions contingent on 'mode' argument */ switch (mode) { case ARK_FULLRHS_START: + case ARK_FULLRHS_END: - /* 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, __LINE__, __func__, - __FILE__, MSG_ARK_RHSFUNC_FAILED, t); - return (ARK_RHSFUNC_FAIL); - } - } - - /* 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, __LINE__, __func__, - __FILE__, 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, __LINE__, __func__, __FILE__, - MSG_ARK_RHSFUNC_FAILED, t); - return (ARK_RHSFUNC_FAIL); - } - } - - /* combine RHS vectors into output */ - 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 + /* update the internal storage for Fse[0] and Fsi[0] */ + retval = mriStep_UpdateF0(ark_mem, step_mem, t, y, mode); + if (retval != 0) { - /* explicit */ - N_VLinearSum(ONE, step_mem->Fse[0], ONE, f, f); + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); } - break; - - case ARK_FULLRHS_END: - - /* compute the full RHS */ - if (!(ark_mem->fn_is_current)) + /* evaluate fast component */ + retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, + ARK_FULLRHS_OTHER); + if (retval != ARK_SUCCESS) { - /* 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, __LINE__, __func__, - __FILE__, MSG_ARK_RHSFUNC_FAILED, t); - return (ARK_RHSFUNC_FAIL); - } - } - - /* 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, __LINE__, __func__, - __FILE__, 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, __LINE__, __func__, __FILE__, - MSG_ARK_RHSFUNC_FAILED, t); - return (ARK_RHSFUNC_FAIL); - } + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); } /* combine RHS vectors into output */ 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); + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = f; + step_mem->cvals[1] = ONE; + step_mem->Xvecs[1] = step_mem->Fse[0]; + step_mem->cvals[2] = ONE; + step_mem->Xvecs[2] = step_mem->Fsi[0]; + nvec = 3; + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, f); } else if (step_mem->implicit_rhs) { @@ -1347,6 +1453,20 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, case ARK_FULLRHS_OTHER: + /* compute the fast component (force new RHS computation) */ + nvec = 0; + retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, + ARK_FULLRHS_OTHER); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + step_mem->cvals[nvec] = ONE; + step_mem->Xvecs[nvec] = f; + nvec++; + /* compute the explicit component and store in ark_tempv2 */ if (step_mem->explicit_rhs) { @@ -1358,6 +1478,9 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, MSG_ARK_RHSFUNC_FAILED, t); return (ARK_RHSFUNC_FAIL); } + step_mem->cvals[nvec] = ONE; + step_mem->Xvecs[nvec] = ark_mem->tempv2; + nvec++; } /* compute the implicit component and store in sdata */ @@ -1371,35 +1494,19 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, MSG_ARK_RHSFUNC_FAILED, t); return (ARK_RHSFUNC_FAIL); } + step_mem->cvals[nvec] = ONE; + step_mem->Xvecs[nvec] = step_mem->sdata; + nvec++; } - /* compute the fast component (force new RHS computation) */ - retval = mriStepInnerStepper_FullRhs(step_mem->stepper, t, y, f, - ARK_FULLRHS_OTHER); - if (retval != ARK_SUCCESS) + /* Add external forcing components to linear combination */ + if (step_mem->expforcing || step_mem->impforcing) { - arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_RHSFUNC_FAILED, t); - return (ARK_RHSFUNC_FAIL); + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); } /* combine RHS vectors into output */ - 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 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); - } + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, f); break; @@ -1413,227 +1520,1451 @@ int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, return (ARK_SUCCESS); } -/*--------------------------------------------------------------- - mriStep_TakeStep: +/*------------------------------------------------------------------------------ + mriStep_UpdateF0: + + This routine is called by mriStep_FullRHS to update the internal storage for + Fse[0] and Fsi[0], incorporating forcing from a slower time scale as necessary. + This supports the ARK_FULLRHS_START and ARK_FULLRHS_END "mode" values + provided to mriStep_FullRHS, and contains all internal logic regarding whether + RHS functions must be called, versus if the relevant data can just be copied. + + ARK_FULLRHS_START -> called in the following circumstances: + (a) at the beginning of a simulation i.e., at + (tn, yn) = (t0, y0) or (tR, yR), or + (b) when transitioning between time steps t_{n-1} + \to t_{n} to fill f_{n-1} within the Hermite + interpolation module. + + In each case, we may check the fn_is_current flag to + know whether ARKODE believes the values stored in + Fse[0] and Fsi[0] are up-to-date, allowing us to copy + those values instead of recomputing. MRIStep + additionally stores internal fse_is_current and + fsi_is_current flags to denote whether it + additionally believes recomputation is necessary -- + this is because unlike ARKStep and ERKStep, when + MRIStep is used as an inner stepper for an outer + MRIStep calculation, it must store any forcing terms + *inside* its own values of one of Fse or Fsi (to + avoid a combinatorial explosion of separate forcing + vectors when used in a telescopic MRI calculation). + For whichever of Fse[0] and Fsi[0] are deemed not + current, the corresponding RHS function is + recomputed and stored in Fe[0] and/or Fi[0] for + reuse later, before copying the values into the + output vector. + + ARK_FULLRHS_END -> called in the following circumstances: + (a) when temporal root-finding is enabled, this will be + called in-between steps t_{n-1} \to t_{n} to fill f_{n}, + (b) when high-order dense output is requested from the + Hermite interpolation module in-between steps t_{n-1} + \to t_{n} to fill f_{n}, or + (c) when an implicit predictor is requested from the Hermite + interpolation module within the time step t_{n} \to + t_{n+1}, in which case f_{n} needs to be filled. + + Again, we may check the fn_is_current flags to know whether + ARKODE believes that the values stored in Fse[0] and Fsi[0] + are up-to-date, and may just be copied. We also again + verify the ability to copy by viewing the MRIStep-specific + fse_is_current and fsi_is_current flags. If one or both of + Fse[0] and Fsi[0] are determined to be not current. In all + other cases, the RHS should be recomputed and stored in + Fse[0] and Fsi[0] for reuse later, before copying the + values into the output vector. - This routine serves the primary purpose of the MRIStep module: - it performs a single MRI step (with embedding, if possible). + ----------------------------------------------------------------------------*/ +int mriStep_UpdateF0(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, + sunrealtype t, N_Vector y, int mode) +{ + int nvec, retval; - The output variable dsmPtr should contain estimate of the - weighted local error if an embedding is present; otherwise it - should be 0. + /* perform RHS functions contingent on 'mode' argument */ + switch (mode) + { + case ARK_FULLRHS_START: - The input/output variable nflagPtr is used to gauge convergence - of any algebraic solvers within the step. At the start of a new - time step, this will initially have the value FIRST_CALL. On - return from this function, nflagPtr should have a value: - 0 => algebraic solve completed successfully - >0 => solve did not converge at this step size - (but may with a smaller stepsize) - <0 => solve encountered an unrecoverable failure + /* update the RHS components */ - The return value from this routine is: - 0 => step completed successfully - >0 => step encountered recoverable failure; - reduce step and retry (if possible) - <0 => step encountered unrecoverable failure + /* explicit component */ + if (step_mem->explicit_rhs) + { + /* if either ARKODE or MRIStep consider Fse[0] stale, then recompute */ + if (!step_mem->fse_is_current || !ark_mem->fn_is_current) + { + 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, __LINE__, __func__, + __FILE__, MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + step_mem->fse_is_current = SUNTRUE; + + /* Add external forcing, if applicable */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[0]); + } + } + } + + /* implicit component */ + if (step_mem->implicit_rhs) + { + /* if either ARKODE or MRIStep consider Fsi[0] stale, then recompute */ + if (!step_mem->fsi_is_current || !ark_mem->fn_is_current) + { + 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, __LINE__, __func__, + __FILE__, MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + step_mem->fsi_is_current = SUNTRUE; + + /* Add external forcing, if applicable */ + if (step_mem->impforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fsi[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fsi[0]); + } + } + } + + break; + + case ARK_FULLRHS_END: + + /* 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, __LINE__, __func__, + __FILE__, MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + step_mem->fse_is_current = SUNTRUE; + + /* Add external forcing, as appropriate */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[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, __LINE__, __func__, + __FILE__, MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + step_mem->fsi_is_current = SUNTRUE; + + /* Add external forcing, as appropriate */ + if (step_mem->impforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fsi[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fsi[0]); + } + } + } + + break; + + default: + /* return with RHS failure if unknown mode is requested */ + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + "Unknown full RHS mode"); + return (ARK_RHSFUNC_FAIL); + } + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + mriStep_TakeStepMRIGARK: + + This routine serves the primary purpose of the MRIStep module: + it performs a single MRI step (with embedding, if possible). + + The vector ark_mem->yn holds the previous time-step solution + on input, and the vector ark_mem->ycur should hold the result + of this step on output. + + If timestep adaptivity is enabled, this routine also computes + the error estimate y-ytilde, where ytilde is the + embedded solution, and the norm weights come from ark_ewt. + This estimate is stored in ark_mem->tempv1, in case the calling + routine wishes to examine the error locations. + + The output variable dsmPtr should contain a scalar-valued + estimate of the temporal error from this step, ||y-ytilde||_WRMS + if timestep adaptivity is enabled; otherwise it should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. At the start of a new + time step, this will initially have the value FIRST_CALL. On + return from this function, nflagPtr should have a value: + 0 => algebraic solve completed successfully + >0 => solve did not converge at this step size + (but may with a smaller stepsize) + <0 => solve encountered an unrecoverable failure + Since the fast-scale evolution could be considered a different + type of "algebraic solver", we similarly report any fast-scale + evolution error as a recoverable nflagPtr value. + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + ARKodeMRIStepMem step_mem; /* outer stepper memory */ + int is; /* current stage index */ + int retval; /* reusable return flag */ + N_Vector tmp; /* N_Vector pointer */ + SUNAdaptController_Type adapt_type; /* timestep adaptivity type */ + sunrealtype t0, tf; /* start/end of each stage */ + sunbooleantype calc_fslow; + sunbooleantype need_inner_dsm; + sunbooleantype do_embedding; + sunbooleantype nested_mri; + int nvec; + + /* access the MRIStep mem structure */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* initialize algebraic solver convergence flag to success; + error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* determine whether embedding stage is needed */ + do_embedding = !ark_mem->fixedstep || + (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE); + + /* if MRI adaptivity is enabled: reset fast accumulated error, + and send appropriate control parameter to the fast integrator */ + adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller); + need_inner_dsm = SUNFALSE; + if (adapt_type == SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + need_inner_dsm = SUNTRUE; + step_mem->inner_dsm = ZERO; + retval = mriStepInnerStepper_ResetAccumulatedError(step_mem->stepper); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper error estimate"); + return (ARK_INNERSTEP_FAIL); + } + retval = mriStepInnerStepper_SetRTol(step_mem->stepper, + step_mem->inner_rtol_factor * + ark_mem->reltol); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to set the inner stepper tolerance"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* for adaptive computations, reset the inner integrator to the beginning of this step */ + if (!ark_mem->fixedstep) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tn, + ark_mem->yn); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* 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 */ + 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 decide between calling the + full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner + integrator) versus just updating the stored values of Fse[0] and Fsi[0]. In + either case, we use ARK_FULLRHS_START mode because MRIGARK methods do not + evaluate the RHS functions at the end of the time step (so nothing can be + leveraged). */ + nested_mri = step_mem->expforcing || step_mem->impforcing; + if (ark_mem->fn == NULL || nested_mri) + { + retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, + ARK_FULLRHS_START); + if (retval) { return ARK_RHSFUNC_FAIL; } + + /* For a nested MRI configuration we might still need fn to create a predictor + but it should be fn only for the current nesting level which is why we use + UpdateF0 in this case rather than FullRHS */ + if (ark_mem->fn != NULL && nested_mri && step_mem->implicit_rhs) + { + if (step_mem->implicit_rhs && step_mem->explicit_rhs) + { + N_VLinearSum(ONE, step_mem->Fsi[0], ONE, step_mem->Fse[0], ark_mem->fn); + } + else { N_VScale(ONE, step_mem->Fsi[0], ark_mem->fn); } + } + } + else if (ark_mem->fn != NULL && !ark_mem->fn_is_current) + { + retval = mriStep_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; + +#ifdef SUNDIALS_DEBUG + printf(" MRIStep step %li, stage 0, h = %" RSYM ", t_n = %" RSYM "\n", + ark_mem->nst, ark_mem->h, ark_mem->tn); +#endif + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + + if (step_mem->explicit_rhs) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow explicit RHS", "Fse_0(:) =", ""); + N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); + } + if (step_mem->implicit_rhs) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow implicit RHS", "Fsi_0(:) =", ""); + N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); + } +#endif + + /* The first stage is the previous time-step solution, so its RHS + is the [already-computed] slow RHS from the start of the step */ + + /* Loop over remaining internal stages */ + for (is = 1; is < step_mem->stages - 1; is++) + { + /* Set relevant stage times (including desired stage time for implicit solves) */ + t0 = ark_mem->tn + step_mem->MRIC->c[is - 1] * ark_mem->h; + tf = ark_mem->tcur = ark_mem->tn + step_mem->MRIC->c[is] * ark_mem->h; + + /* Solver diagnostics reporting */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "start-stage", + "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 + vector ark_mem->ycur stores the previous stage solution on input, and + should store the result of this stage solution on output. */ + switch (step_mem->stagetypes[is]) + { + case (MRISTAGE_ERK_FAST): + retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); + if (retval != ARK_SUCCESS) { return retval; } + retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, + ark_mem->tempv2, need_inner_dsm); + if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + break; + case (MRISTAGE_ERK_NOFAST): + retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + break; + case (MRISTAGE_DIRK_NOFAST): + retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + break; + case (MRISTAGE_DIRK_FAST): + retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + break; + case (MRISTAGE_STIFF_ACC): retval = ARK_SUCCESS; break; + } + if (retval != ARK_SUCCESS) { return retval; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* apply user-supplied stage postprocessing function (if supplied) */ + if ((ark_mem->ProcessStage != NULL) && + (step_mem->stagetypes[is] != MRISTAGE_STIFF_ACC)) + { + retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + } + + /* conditionally reset the inner integrator with the modified stage solution */ + if (step_mem->stagetypes[is] != MRISTAGE_STIFF_ACC) + { + if ((step_mem->stagetypes[is] != MRISTAGE_ERK_FAST) || + (ark_mem->ProcessStage != NULL)) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, tf, ark_mem->ycur); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + } + + /* Compute updated slow RHS, except: + 1. if the stage is excluded from stage_map + 2. if the next stage has "STIFF_ACC" type, and temporal estimation is disabled */ + calc_fslow = SUNTRUE; + if (step_mem->stage_map[is] == -1) { calc_fslow = SUNFALSE; } + if (!do_embedding && (step_mem->stagetypes[is + 1] == MRISTAGE_STIFF_ACC)) + { + calc_fslow = SUNFALSE; + } + if (calc_fslow) + { + /* store explicit slow rhs */ + if (step_mem->explicit_rhs) + { + retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, + step_mem->Fse[step_mem->stage_map[is]], + ark_mem->user_data); + step_mem->nfse++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + + /* Add external forcing to Fse, if applicable */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[step_mem->stage_map[is]]; + nvec = 1; + mriStep_ApplyForcing(step_mem, tf, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[step_mem->stage_map[is]]); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow explicit RHS", + "Fse_%i(:) =", is); + N_VPrintFile(step_mem->Fse[step_mem->stage_map[is]], + ARK_LOGGER->debug_fp); +#endif + } + + /* store implicit slow rhs */ + if (step_mem->implicit_rhs) + { + if (!step_mem->deduce_rhs || + (step_mem->stagetypes[is] != MRISTAGE_DIRK_NOFAST)) + { + retval = step_mem->fsi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fsi[step_mem->stage_map[is]], + ark_mem->user_data); + step_mem->nfsi++; + + /* Add external forcing to Fsi, if applicable */ + if (step_mem->impforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fsi[step_mem->stage_map[is]]; + nvec = 1; + mriStep_ApplyForcing(step_mem, tf, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fsi[step_mem->stage_map[is]]); + } + } + else + { + N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, + -ONE / step_mem->gamma, step_mem->sdata, + step_mem->Fsi[step_mem->stage_map[is]]); + } + + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow implicit RHS", + "Fsi_%i(:) =", is); + N_VPrintFile(step_mem->Fsi[step_mem->stage_map[is]], + ARK_LOGGER->debug_fp); +#endif + } + } /* compute slow RHS */ + } /* loop over stages */ + + /* perform embedded stage (if needed) */ + if (do_embedding) + { + is = step_mem->stages; + + /* Temporarily swap ark_mem->ycur and ark_mem->tempv4 pointers, copying + data so that both hold the current ark_mem->ycur value. This ensures + that during this embedding "stage": + - ark_mem->ycur will be the correct initial condition for the final stage. + - ark_mem->tempv4 will hold the embedded solution vector. */ + N_VScale(ONE, ark_mem->ycur, ark_mem->tempv4); + tmp = ark_mem->ycur; + ark_mem->ycur = ark_mem->tempv4; + ark_mem->tempv4 = tmp; + + /* Reset ark_mem->tcur as the time value corresponding with the end of the step */ + /* Set relevant stage times (including desired stage time for implicit solves) */ + t0 = ark_mem->tn + step_mem->MRIC->c[is - 2] * ark_mem->h; + tf = ark_mem->tcur = ark_mem->tn + ark_mem->h; + + /* Solver diagnostics reporting */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "embedding-stage", + "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 embedding stage type, and call corresponding routine; the + vector ark_mem->ycur stores the previous stage solution on input, and + should store the result of this stage solution on output. */ + switch (step_mem->stagetypes[is]) + { + case (MRISTAGE_ERK_FAST): + retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); + if (retval != ARK_SUCCESS) { return retval; } + retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, + ark_mem->tempv2, SUNFALSE); + if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + break; + case (MRISTAGE_ERK_NOFAST): + retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + break; + case (MRISTAGE_DIRK_NOFAST): + retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + break; + case (MRISTAGE_DIRK_FAST): + retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + break; + } + if (retval != ARK_SUCCESS) { return retval; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "embedded solution", "ytilde(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* Swap back ark_mem->ycur with ark_mem->tempv4, and reset the inner integrator */ + tmp = ark_mem->ycur; + ark_mem->ycur = ark_mem->tempv4; + ark_mem->tempv4 = tmp; + retval = mriStepInnerStepper_Reset(step_mem->stepper, t0, ark_mem->ycur); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* Compute final stage (for evolved solution), along with error estimate */ + { + is = step_mem->stages - 1; + + /* Set relevant stage times (including desired stage time for implicit solves) */ + t0 = ark_mem->tn + step_mem->MRIC->c[is - 1] * ark_mem->h; + tf = ark_mem->tcur = ark_mem->tn + ark_mem->h; + + /* Solver diagnostics reporting */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "start-stage", + "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 final stage type, and call corresponding routine; the + vector ark_mem->ycur stores the previous stage solution on input, and + should store the result of this stage solution on output. */ + switch (step_mem->stagetypes[is]) + { + case (MRISTAGE_ERK_FAST): + retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); + if (retval != ARK_SUCCESS) { return retval; } + retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, + ark_mem->tempv2, need_inner_dsm); + if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + break; + case (MRISTAGE_ERK_NOFAST): + retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + break; + case (MRISTAGE_DIRK_NOFAST): + retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + break; + case (MRISTAGE_DIRK_FAST): + retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + break; + case (MRISTAGE_STIFF_ACC): retval = ARK_SUCCESS; break; + } + if (retval != ARK_SUCCESS) { return retval; } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* apply user-supplied stage postprocessing function (if supplied) */ + if ((ark_mem->ProcessStage != NULL) && + (step_mem->stagetypes[is] != MRISTAGE_STIFF_ACC)) + { + retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + } + + /* conditionally reset the inner integrator with the modified stage solution */ + if (step_mem->stagetypes[is] != MRISTAGE_STIFF_ACC) + { + if ((step_mem->stagetypes[is] != MRISTAGE_ERK_FAST) || + (ark_mem->ProcessStage != NULL)) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, tf, ark_mem->ycur); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + } + + /* Compute temporal error estimate via difference between step + solution and embedding, store in ark_mem->tempv1, and take norm. */ + if (do_embedding) + { + N_VLinearSum(ONE, ark_mem->tempv4, -ONE, ark_mem->ycur, ark_mem->tempv1); + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + + } /* loop over stages */ + + /* Solver diagnostics reporting */ +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "updated solution", "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, + ark_mem->nst, ark_mem->h, *dsmPtr); +#endif + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + mriStep_TakeStepMRISR: + + This routine performs a single MRISR step. + + The vector ark_mem->yn holds the previous time-step solution + on input, and the vector ark_mem->ycur should hold the result + of this step on output. + + If timestep adaptivity is enabled, this routine also computes + the error estimate y-ytilde, where ytilde is the + embedded solution, and the norm weights come from ark_ewt. + This estimate is stored in ark_mem->tempv1, in case the calling + routine wishes to examine the error locations. + + The output variable dsmPtr should contain a scalar-valued + estimate of the temporal error from this step, ||y-ytilde||_WRMS + if timestep adaptivity is enabled; otherwise it should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. At the start of a new + time step, this will initially have the value FIRST_CALL. On + return from this function, nflagPtr should have a value: + 0 => algebraic solve completed successfully + >0 => solve did not converge at this step size + (but may with a smaller stepsize) + <0 => solve encountered an unrecoverable failure + Since the fast-scale evolution could be considered a different + type of "algebraic solver", we similarly report any fast-scale + evolution error as a recoverable nflagPtr value. + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure + ---------------------------------------------------------------*/ +int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +{ + ARKodeMRIStepMem step_mem; /* outer stepper memory */ + int stage, j; /* stage indices */ + int retval; /* reusable return flag */ + N_Vector ytilde; /* embedded solution */ + N_Vector ytemp; /* temporary vector */ + SUNAdaptController_Type adapt_type; /* timestep adaptivity type */ + sunbooleantype embedding; /* flag indicating embedding */ + sunbooleantype solution; /* or solution stages */ + sunbooleantype impl_corr; /* is slow correct. implicit? */ + sunrealtype cstage; /* current stage abscissa */ + sunbooleantype need_inner_dsm; + sunbooleantype nested_mri; + int nvec, max_stages; + const sunrealtype tol = SUN_RCONST(100.0) * SUN_UNIT_ROUNDOFF; + + /* access the MRIStep mem structure */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* initialize algebraic solver convergence flag to success; + error estimate to zero */ + *nflagPtr = ARK_SUCCESS; + *dsmPtr = ZERO; + + /* set N_Vector shortcuts */ + ytilde = ark_mem->tempv4; + ytemp = ark_mem->tempv2; + + /* if MRI adaptivity is enabled: reset fast accumulated error, + and send appropriate control parameter to the fast integrator */ + adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller); + need_inner_dsm = SUNFALSE; + if (adapt_type == SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + need_inner_dsm = SUNTRUE; + step_mem->inner_dsm = ZERO; + retval = mriStepInnerStepper_ResetAccumulatedError(step_mem->stepper); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper error estimate"); + return (ARK_INNERSTEP_FAIL); + } + retval = mriStepInnerStepper_SetRTol(step_mem->stepper, + step_mem->inner_rtol_factor * + ark_mem->reltol); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to set the inner stepper tolerance"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* for adaptive computations, reset the inner integrator to the beginning of this step */ + if (!ark_mem->fixedstep) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tn, + ark_mem->yn); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* Evaluate the slow RHS functions if needed. NOTE: we decide between calling the + full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner + integrator) versus just updating the stored values of Fse[0] and Fsi[0]. In + either case, we use ARK_FULLRHS_START mode because MRISR methods do not + evaluate the RHS functions at the end of the time step (so nothing can be + leveraged). */ + nested_mri = step_mem->expforcing || step_mem->impforcing; + if (ark_mem->fn == NULL || nested_mri) + { + retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, + ARK_FULLRHS_START); + if (retval) { return ARK_RHSFUNC_FAIL; } + + /* For a nested MRI configuration we might still need fn to create a predictor + but it should be fn only for the current nesting level which is why we use + UpdateF0 in this case rather than FullRHS */ + if (ark_mem->fn != NULL && nested_mri && step_mem->implicit_rhs) + { + if (step_mem->implicit_rhs && step_mem->explicit_rhs) + { + N_VLinearSum(ONE, step_mem->Fsi[0], ONE, step_mem->Fse[0], ark_mem->fn); + } + else { N_VScale(ONE, step_mem->Fsi[0], ark_mem->fn); } + } + } + if (ark_mem->fn != NULL && !ark_mem->fn_is_current) + { + retval = mriStep_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; + + /* combine both RHS into FSE for ImEx problems, since MRISR fast forcing function + only depends on Omega coefficients */ + if (step_mem->implicit_rhs && step_mem->explicit_rhs) + { + N_VLinearSum(ONE, step_mem->Fse[0], ONE, step_mem->Fsi[0], step_mem->Fse[0]); + } + +#ifdef SUNDIALS_DEBUG + printf(" MRIStep step %li, stage 0, h = %" RSYM ", t_n = %" RSYM "\n", + ark_mem->nst, ark_mem->h, ark_mem->tn); +#endif + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow stage", "z_0(:) =", ""); + N_VPrintFile(ark_mem->yn, ARK_LOGGER->debug_fp); + + if (step_mem->explicit_rhs) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow explicit RHS", "Fse_0(:) =", ""); + N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); + } + + if (step_mem->implicit_rhs) + { + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow implicit RHS", "Fsi_0(:) =", ""); + N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); + } +#endif + + /* The first stage is the previous time-step solution, so its RHS + is the [already-computed] slow RHS from the start of the step */ + + /* Determine how many stages will be needed */ + max_stages = (ark_mem->fixedstep && + (ark_mem->AccumErrorType == ARK_ACCUMERROR_NONE)) + ? step_mem->stages + : step_mem->stages + 1; + + /* Loop over stages */ + for (stage = 1; stage < max_stages; stage++) + { + /* Solver diagnostics reporting */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "start-stage", "step = %li, stage = %i, h = %" RSYM, + ark_mem->nst, stage, ark_mem->h); +#endif + + /* Determine if this is an "embedding" or "solution" stage */ + solution = (stage == step_mem->stages - 1); + embedding = (stage == step_mem->stages); + + /* Set initial condition for this stage */ + N_VScale(ONE, ark_mem->yn, ark_mem->ycur); + + /* Set current stage abscissa */ + cstage = (embedding) ? ONE : step_mem->MRIC->c[stage]; + + /* Compute forcing function for inner solver */ + retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, stage, ark_mem->tn, + ark_mem->tn + cstage * ark_mem->h); + if (retval != ARK_SUCCESS) { return retval; } + + /* Reset the inner stepper on all but the first stage due to + "stage-restart" structure */ + if (stage > 1) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tn, + ark_mem->ycur); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* Evolve fast IVP for this stage, potentially get inner dsm on + all non-embedding stages */ + retval = mriStep_StageERKFast(ark_mem, step_mem, ark_mem->tn, + ark_mem->tn + cstage * ark_mem->h, + ark_mem->ycur, ytemp, + need_inner_dsm && !embedding); + if (retval != ARK_SUCCESS) + { + *nflagPtr = CONV_FAIL; + return retval; + } + + /* set current stage time for implicit correction, postprocessing + and RHS calls */ + ark_mem->tcur = ark_mem->tn + cstage * ark_mem->h; + + /* perform MRISR slow/implicit correction */ + impl_corr = SUNFALSE; + if (step_mem->implicit_rhs) + { + /* determine whether implicit RHS correction will require an implicit solve */ + impl_corr = SUNRabs(step_mem->MRIC->G[0][stage][stage]) > tol; + + /* perform implicit solve for correction */ + if (impl_corr) + { + /* store current stage index (for an "embedded" stage, subtract 1) */ + step_mem->istage = (stage == step_mem->stages) ? stage - 1 : stage; + + /* Call predictor for current stage solution (result placed in zpred) */ + retval = mriStep_Predict(ark_mem, step_mem->istage, step_mem->zpred); + if (retval != ARK_SUCCESS) { return (retval); } + + /* If a user-supplied predictor routine is provided, call that here + Note that mriStep_Predict is *still* called, so this user-supplied + routine can just "clean up" the built-in prediction, if desired. */ + if (step_mem->stage_predict) + { + retval = step_mem->stage_predict(ark_mem->tcur, step_mem->zpred, + ark_mem->user_data); + if (retval < 0) { return (ARK_USER_PREDICT_FAIL); } + if (retval > 0) { return (TRY_AGAIN); } + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "predictor", + "zpred(:) =", ""); + N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); +#endif + + /* fill sdata with explicit contributions to correction */ + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = ark_mem->ycur; + step_mem->cvals[1] = -ONE; + step_mem->Xvecs[1] = step_mem->zpred; + for (j = 0; j < stage; j++) + { + step_mem->cvals[j + 2] = ark_mem->h * step_mem->MRIC->G[0][stage][j]; + step_mem->Xvecs[j + 2] = step_mem->Fsi[j]; + } + retval = N_VLinearCombination(stage + 2, step_mem->cvals, + step_mem->Xvecs, step_mem->sdata); + if (retval != 0) { return (ARK_VECTOROP_ERR); } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "rhs data", + "sdata(:) =", ""); + N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); +#endif + + /* Update gamma for implicit solver */ + step_mem->gamma = ark_mem->h * step_mem->MRIC->G[0][stage][stage]; + if (ark_mem->firststage) { step_mem->gammap = step_mem->gamma; } + step_mem->gamrat = + (ark_mem->firststage) ? ONE : step_mem->gamma / step_mem->gammap; + + /* perform implicit solve (result is stored in ark_mem->ycur); return + with positive value on anything but success */ + *nflagPtr = mriStep_Nls(ark_mem, *nflagPtr); + if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } + } + /* perform explicit update for correction */ + else + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = ark_mem->ycur; + for (j = 0; j < stage; j++) + { + step_mem->cvals[j + 1] = ark_mem->h * step_mem->MRIC->G[0][stage][j]; + step_mem->Xvecs[j + 1] = step_mem->Fsi[j]; + } + retval = N_VLinearCombination(stage + 1, step_mem->cvals, + step_mem->Xvecs, ark_mem->ycur); + if (retval != 0) { return (ARK_VECTOROP_ERR); } + } + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow stage", "z_%i(:) =", stage); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* apply user-supplied stage postprocessing function (if supplied), + and reset the inner integrator with the modified stage solution */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tcur, + ark_mem->ycur); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + + /* Compute updated slow RHS (except for final solution or embedding) */ + if ((!solution) && (!embedding)) + { + /* store explicit slow rhs */ + if (step_mem->explicit_rhs) + { + retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, + step_mem->Fse[stage], ark_mem->user_data); + step_mem->nfse++; + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + + /* Add external forcing to Fse[stage], if applicable */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[stage]; + nvec = 1; + mriStep_ApplyForcing(step_mem, ark_mem->tcur, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[stage]); + } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow explicit RHS", + "Fse_%i(:) =", stage); + N_VPrintFile(step_mem->Fse[stage], ARK_LOGGER->debug_fp); +#endif + } + + /* store implicit slow rhs */ + if (step_mem->implicit_rhs) + { + if (!step_mem->deduce_rhs || !impl_corr) + { + retval = step_mem->fsi(ark_mem->tcur, ark_mem->ycur, + step_mem->Fsi[stage], ark_mem->user_data); + step_mem->nfsi++; + + /* Add external forcing to Fsi[stage], if applicable */ + if (step_mem->impforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fsi[stage]; + nvec = 1; + mriStep_ApplyForcing(step_mem, ark_mem->tcur, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fsi[stage]); + } + } + else + { + N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, + -ONE / step_mem->gamma, step_mem->sdata, + step_mem->Fsi[stage]); + } + + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow implicit RHS", + "Fsi_%i(:) =", stage); + N_VPrintFile(step_mem->Fsi[stage], ARK_LOGGER->debug_fp); +#endif + } + + /* combine both RHS into Fse for ImEx problems since + fast forcing function only depends on Omega coefficients */ + if (step_mem->implicit_rhs && step_mem->explicit_rhs) + { + N_VLinearSum(ONE, step_mem->Fse[stage], ONE, step_mem->Fsi[stage], + step_mem->Fse[stage]); + } + } + + /* If this is the solution stage, archive for error estimation */ + if (solution) { N_VScale(ONE, ark_mem->ycur, ytilde); } + + } /* loop over stages */ + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "updated solution", "ycur(:) =", ""); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* if temporal error estimation is enabled: compute estimate via difference between + step solution and embedding, store in ark_mem->tempv1, store norm in dsmPtr, and + copy solution back to ycur */ + if (!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) + { + N_VLinearSum(ONE, ytilde, -ONE, ark_mem->ycur, ark_mem->tempv1); + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + N_VScale(ONE, ytilde, ark_mem->ycur); + } + + /* Solver diagnostics reporting */ +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "end-step", + "step = %li, t = %" RSYM ", h = %" RSYM ", dsm = %" RSYM, + ark_mem->nst, ark_mem->tn, ark_mem->h, *dsmPtr); +#endif + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + mriStep_TakeStepMERK: + + This routine performs a single MERK step. + + The vector ark_mem->yn holds the previous time-step solution + on input, and the vector ark_mem->ycur should hold the result + of this step on output. + + If timestep adaptivity is enabled, this routine also computes + the error estimate y-ytilde, where ytilde is the + embedded solution, and the norm weights come from ark_ewt. + This estimate is stored in ark_mem->tempv1, in case the calling + routine wishes to examine the error locations. + + The output variable dsmPtr should contain a scalar-valued + estimate of the temporal error from this step, ||y-ytilde||_WRMS + if timestep adaptivity is enabled; otherwise it should be 0. + + The input/output variable nflagPtr is used to gauge convergence + of any algebraic solvers within the step. At the start of a new + time step, this will initially have the value FIRST_CALL. On + return from this function, nflagPtr should have a value: + 0 => algebraic solve completed successfully + >0 => solve did not converge at this step size + (but may with a smaller stepsize) + <0 => solve encountered an unrecoverable failure + Since the fast-scale evolution could be considered a different + type of "algebraic solver", we similarly report any fast-scale + evolution error as a recoverable nflagPtr value. + + The return value from this routine is: + 0 => step completed successfully + >0 => step encountered recoverable failure; + reduce step and retry (if possible) + <0 => step encountered unrecoverable failure ---------------------------------------------------------------*/ -int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) +int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { - ARKodeMRIStepMem step_mem; /* outer stepper memory */ - int is; /* current stage index */ - int retval; /* reusable return flag */ + ARKodeMRIStepMem step_mem; /* outer stepper memory */ + int ig; /* current stage group index */ + int is; /* stage index in group */ + int stage, nextstage; /* current/next stages */ + int retval; /* reusable return flag */ + N_Vector ytilde; /* embedded solution */ + N_Vector ytemp; /* temporary vector */ + SUNAdaptController_Type adapt_type; /* timestep adaptivity type */ + sunrealtype t0, tf; /* start/end of each stage */ + sunbooleantype embedding; /* flag indicating embedding */ + sunbooleantype solution; /* or solution stages */ + sunrealtype cstage; /* current stage abscissa */ + sunbooleantype need_inner_dsm; + sunbooleantype nested_mri; + int nvec; + + /* access the MRIStep mem structure */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } /* initialize algebraic solver convergence flag to success; error estimate to zero */ *nflagPtr = ARK_SUCCESS; *dsmPtr = ZERO; - /* access the MRIStep mem structure */ - retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); - if (retval != ARK_SUCCESS) { return (retval); } + /* set N_Vector shortcuts */ + ytilde = ark_mem->tempv4; + ytemp = ark_mem->tempv2; - /* call nonlinear solver setup if it exists */ - if (step_mem->NLS) + /* initial time for step */ + t0 = ark_mem->tn; + + /* if MRI adaptivity is enabled: reset fast accumulated error, + and send appropriate control parameter to the fast integrator */ + adapt_type = SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller); + need_inner_dsm = SUNFALSE; + if (adapt_type == SUN_ADAPTCONTROLLER_MRI_H_TOL) { - if ((step_mem->NLS)->ops->setup) + need_inner_dsm = SUNTRUE; + step_mem->inner_dsm = ZERO; + retval = mriStepInnerStepper_ResetAccumulatedError(step_mem->stepper); + if (retval != ARK_SUCCESS) { - 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); } + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper error estimate"); + return (ARK_INNERSTEP_FAIL); } - } - - /* 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 = mriStepInnerStepper_SetRTol(step_mem->stepper, + step_mem->inner_rtol_factor * + ark_mem->reltol); + if (retval != ARK_SUCCESS) { - 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; } + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to set the inner stepper tolerance"); + return (ARK_INNERSTEP_FAIL); } + } - /* compute the implicit component */ - if (step_mem->implicit_rhs) + /* for adaptive computations, reset the inner integrator to the beginning of this step */ + if (!ark_mem->fixedstep) + { + retval = mriStepInnerStepper_Reset(step_mem->stepper, t0, ark_mem->yn); + if (retval != ARK_SUCCESS) { - 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; } + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); } + } - ark_mem->fn_is_current = SUNTRUE; + /* Evaluate the slow RHS function if needed. NOTE: we decide between calling the + full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner + integrator) versus just updating the stored value of Fse[0]. In either case, + we use ARK_FULLRHS_START mode because MERK methods do not evaluate Fse at the + end of the time step (so nothing can be leveraged). */ + nested_mri = step_mem->expforcing || step_mem->impforcing; + if (ark_mem->fn == NULL || nested_mri) + { + retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, + ARK_FULLRHS_START); + if (retval) { return ARK_RHSFUNC_FAIL; } + } + if (ark_mem->fn != NULL && !ark_mem->fn_is_current) + { + retval = mriStep_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; #ifdef SUNDIALS_DEBUG printf(" MRIStep step %li, stage 0, h = %" RSYM ", t_n = %" RSYM "\n", - ark_mem->nst, ark_mem->h, ark_mem->tcur); + ark_mem->nst, ark_mem->h, t0); #endif #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", "slow stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); + N_VPrintFile(ark_mem->yn, ARK_LOGGER->debug_fp); - if (step_mem->explicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow explicit RHS", "Fse_0(:) =", ""); - N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); - } - if (step_mem->implicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow implicit RHS", "Fsi_0(:) =", ""); - N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); - } + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "slow explicit RHS", "Fse_0(:) =", ""); + N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); #endif /* The first stage is the previous time-step solution, so its RHS is the [already-computed] slow RHS from the start of the step */ - /* Loop over remaining stages */ - for (is = 1; is < step_mem->stages; is++) + /* Loop over stage groups */ + for (ig = 0; ig < step_mem->MRIC->ngroup; ig++) { - /* Set current stage time */ - ark_mem->tcur = ark_mem->tn + step_mem->MRIC->c[is] * ark_mem->h; - /* Solver diagnostics reporting */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "start-stage", - "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); + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", + "start-stage", "step = %li, stage group = %i, h = %" RSYM, + ark_mem->nst, ig, ark_mem->h); #endif - /* Determine current stage type, and call corresponding routine; the - vector ark_mem->ycur stores the previous stage solution on input, and - should store the result of this stage solution on output. */ - switch (step_mem->stagetypes[is]) - { - case (MRISTAGE_ERK_FAST): - retval = mriStep_StageERKFast(ark_mem, step_mem, is); - break; - case (MRISTAGE_ERK_NOFAST): - retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); - break; - case (MRISTAGE_DIRK_NOFAST): - retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); - break; - case (MRISTAGE_DIRK_FAST): - retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); - break; - } + /* Set up fast RHS for this stage group */ + retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, + step_mem->MRIC->group[ig][0], + ark_mem->tn, ark_mem->tn + ark_mem->h); if (retval != ARK_SUCCESS) { return (retval); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - - /* apply user-supplied stage postprocessing function (if supplied) */ - if (ark_mem->ProcessStage != NULL) - { - retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, - ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } - } + /* Set initial condition for this stage group */ + N_VScale(ONE, ark_mem->yn, ark_mem->ycur); + t0 = ark_mem->tn; - /* conditionally reset the inner integrator with the modified stage solution */ - if ((step_mem->stagetypes[is] != MRISTAGE_ERK_FAST) || - (ark_mem->ProcessStage != NULL)) + /* Evolve fast IVP over each subinterval in stage group */ + for (is = 0; is < step_mem->stages; is++) { - retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tcur, - ark_mem->ycur); - if (retval != ARK_SUCCESS) { return (ARK_INNERSTEP_FAIL); } - } + /* Get stage index from group; skip to the next group if + we've reached the end of this one */ + stage = step_mem->MRIC->group[ig][is]; + if (stage < 0) { break; } + nextstage = -1; + if (stage < step_mem->stages) + { + nextstage = step_mem->MRIC->group[ig][is + 1]; + } - /* Compute updated slow RHS except at last stage which is the new solution. - * The new solution RHS evaluation happens in arkCompleteStep */ - if (is < step_mem->stages - 1 && step_mem->stage_map[is] > -1) - { - /* store explicit slow rhs */ - if (step_mem->explicit_rhs) + /* Determine if this is an "embedding" or "solution" stage */ + embedding = solution = SUNFALSE; + if (ig == step_mem->MRIC->ngroup - 2) { - retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, - step_mem->Fse[step_mem->stage_map[is]], - ark_mem->user_data); - step_mem->nfse++; - if (retval < 0) { return (ARK_RHSFUNC_FAIL); } - if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + if ((stage >= 0) && (nextstage < 0)) { embedding = SUNTRUE; } + } + if (ig == step_mem->MRIC->ngroup - 1) + { + if ((stage >= 0) && (nextstage < 0)) { solution = SUNTRUE; } + } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow explicit RHS", - "Fse_%i(:) =", is); - N_VPrintFile(step_mem->Fse[step_mem->stage_map[is]], - ARK_LOGGER->debug_fp); -#endif + /* Skip the embedding if we're using fixed time-stepping and + temporal error estimation is disabled */ + if (ark_mem->fixedstep && embedding && + (ark_mem->AccumErrorType == ARK_ACCUMERROR_NONE)) + { + break; } - /* store implicit slow rhs */ - if (step_mem->implicit_rhs) + /* Set current stage abscissa */ + cstage = (stage >= step_mem->stages) ? ONE : step_mem->MRIC->c[stage]; + + /* Set desired output time for subinterval */ + tf = ark_mem->tn + cstage * ark_mem->h; + + /* Reset the inner stepper on the first stage within all but the + first stage group due to "stage-restart" structure */ + if ((stage > 1) && (is == 0)) { - if (!step_mem->deduce_rhs || - (step_mem->stagetypes[is] != MRISTAGE_DIRK_NOFAST)) + retval = mriStepInnerStepper_Reset(step_mem->stepper, t0, ark_mem->ycur); + if (retval != ARK_SUCCESS) { - retval = step_mem->fsi(ark_mem->tcur, ark_mem->ycur, - step_mem->Fsi[step_mem->stage_map[is]], - ark_mem->user_data); - step_mem->nfsi++; + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); } - else + } + + /* Evolve fast IVP for this stage, potentially get inner dsm on all + non-embedding stages */ + retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, + ytemp, need_inner_dsm && !embedding); + if (retval != ARK_SUCCESS) + { + *nflagPtr = CONV_FAIL; + return retval; + } + + /* Update "initial time" for next stage in group */ + t0 = tf; + + /* set current stage time for postprocessing and RHS calls */ + ark_mem->tcur = tf; + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::mriStep_TakeStep", "slow stage", + "z_%i(:) =", stage); + N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); +#endif + + /* apply user-supplied stage postprocessing function (if supplied), + and reset the inner integrator with the modified stage solution */ + if (ark_mem->ProcessStage != NULL) + { + retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, + ark_mem->user_data); + if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tcur, + ark_mem->ycur); + if (retval != ARK_SUCCESS) { - N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, - -ONE / step_mem->gamma, step_mem->sdata, - step_mem->Fsi[step_mem->stage_map[is]]); + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to reset the inner stepper"); + return (ARK_INNERSTEP_FAIL); } + } + /* Compute updated slow RHS (except for final solution or embedding) */ + if ((!solution) && (!embedding)) + { + /* store explicit slow rhs */ + retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, + step_mem->Fse[stage], ark_mem->user_data); + step_mem->nfse++; if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + /* Add external forcing to Fse[stage], if applicable */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[stage]; + nvec = 1; + mriStep_ApplyForcing(step_mem, ark_mem->tcur, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[stage]); + } + #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow implicit RHS", - "Fsi_%i(:) =", is); - N_VPrintFile(step_mem->Fsi[step_mem->stage_map[is]], - ARK_LOGGER->debug_fp); + "ARKODE::mriStep_TakeStep", "slow explicit RHS", + "Fse_%i(:) =", is); + N_VPrintFile(step_mem->Fse[stage], ARK_LOGGER->debug_fp); #endif } - } /* compute slow RHS */ - } /* loop over stages */ + + /* If this is the embedding stage, archive solution for error estimation */ + if (embedding) { N_VScale(ONE, ark_mem->ycur, ytilde); } + + } /* loop over stages */ + + } /* loop over stage groups */ #ifdef SUNDIALS_LOGGING_EXTRA_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", @@ -1641,11 +2972,20 @@ int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); #endif + /* if temporal error estimation is enabled: compute estimate via difference between + step solution and embedding, store in ark_mem->tempv1, and store norm in dsmPtr */ + if (!ark_mem->fixedstep || (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE)) + { + N_VLinearSum(ONE, ytilde, -ONE, ark_mem->ycur, ark_mem->tempv1); + *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); + } + /* Solver diagnostics reporting */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, - ark_mem->nst, ark_mem->h, *dsmPtr); + "end-step", + "step = %li, t = %" RSYM ", h = %" RSYM ", dsm = %" RSYM, + ark_mem->nst, ark_mem->tn, ark_mem->h, *dsmPtr); #endif return (ARK_SUCCESS); @@ -1725,14 +3065,13 @@ sunbooleantype mriStep_CheckNVector(N_Vector tmpl) mriStep_SetCoupling This routine determines the MRI method to use, based on the - desired accuracy. + desired accuracy and fixed/adaptive time stepping choice. ---------------------------------------------------------------*/ int mriStep_SetCoupling(ARKodeMem ark_mem) { ARKodeMRIStepMem step_mem; sunindextype Cliw, Clrw; - int q_actual; - ARKODE_MRITableID table_id; + ARKODE_MRITableID table_id = ARKODE_MRI_NONE; /* access ARKodeMRIStepMem structure */ if (ark_mem->step_mem == NULL) @@ -1742,55 +3081,82 @@ int mriStep_SetCoupling(ARKodeMem ark_mem) return (ARK_MEM_NULL); } step_mem = (ARKodeMRIStepMem)ark_mem->step_mem; - q_actual = step_mem->q; /* if coupling has already been specified, just return */ if (step_mem->MRIC != NULL) { return (ARK_SUCCESS); } - if (q_actual < 1 || q_actual > 4) - { - arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, - "No MRI method at requested order, using q=3."); - q_actual = 3; - } - /* select method based on order and type */ - - /**** ImEx methods ****/ - if (step_mem->implicit_rhs && step_mem->explicit_rhs) + if (ark_mem->fixedstep) /**** fixed-step methods ****/ { - switch (q_actual) + if (step_mem->implicit_rhs && step_mem->explicit_rhs) /**** ImEx methods ****/ { - case 1: table_id = MRISTEP_DEFAULT_IMEX_SD_1; break; - case 2: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; - case 3: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; - case 4: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; + switch (step_mem->q) + { + case 1: table_id = MRISTEP_DEFAULT_IMEX_SD_1; break; + case 2: table_id = MRISTEP_DEFAULT_IMEX_SD_2; break; + case 3: table_id = MRISTEP_DEFAULT_IMEX_SD_3; break; + case 4: table_id = MRISTEP_DEFAULT_IMEX_SD_4; break; + } } - - /**** implicit methods ****/ - } - else if (step_mem->implicit_rhs) - { - switch (q_actual) + else if (step_mem->implicit_rhs) /**** implicit methods ****/ + { + switch (step_mem->q) + { + case 1: table_id = MRISTEP_DEFAULT_IMPL_SD_1; break; + case 2: table_id = MRISTEP_DEFAULT_IMPL_SD_2; break; + case 3: table_id = MRISTEP_DEFAULT_IMPL_SD_3; break; + case 4: table_id = MRISTEP_DEFAULT_IMPL_SD_4; break; + } + } + else /**** explicit methods ****/ { - case 1: table_id = MRISTEP_DEFAULT_IMPL_SD_1; break; - case 2: table_id = MRISTEP_DEFAULT_IMPL_SD_2; break; - case 3: table_id = MRISTEP_DEFAULT_IMPL_SD_3; break; - case 4: table_id = MRISTEP_DEFAULT_IMPL_SD_4; break; + switch (step_mem->q) + { + case 1: table_id = MRISTEP_DEFAULT_EXPL_1; break; + case 2: table_id = MRISTEP_DEFAULT_EXPL_2; break; + case 3: table_id = MRISTEP_DEFAULT_EXPL_3; break; + case 4: table_id = MRISTEP_DEFAULT_EXPL_4; break; + case 5: table_id = MRISTEP_DEFAULT_EXPL_5_AD; break; + } } - - /**** explicit methods ****/ } - else + else /**** adaptive methods ****/ { - switch (q_actual) + if (step_mem->implicit_rhs && step_mem->explicit_rhs) /**** ImEx methods ****/ + { + switch (step_mem->q) + { + case 2: table_id = MRISTEP_DEFAULT_IMEX_SD_2_AD; break; + case 3: table_id = MRISTEP_DEFAULT_IMEX_SD_3_AD; break; + case 4: table_id = MRISTEP_DEFAULT_IMEX_SD_4_AD; break; + } + } + else if (step_mem->implicit_rhs) /**** implicit methods ****/ + { + switch (step_mem->q) + { + case 2: table_id = MRISTEP_DEFAULT_IMPL_SD_2; break; + case 3: table_id = MRISTEP_DEFAULT_IMPL_SD_3; break; + case 4: table_id = MRISTEP_DEFAULT_IMPL_SD_4; break; + } + } + else /**** explicit methods ****/ { - case 1: table_id = MRISTEP_DEFAULT_EXPL_1; break; - case 2: table_id = MRISTEP_DEFAULT_EXPL_2; break; - case 3: table_id = MRISTEP_DEFAULT_EXPL_3; break; - case 4: table_id = MRISTEP_DEFAULT_EXPL_4; break; + switch (step_mem->q) + { + case 2: table_id = MRISTEP_DEFAULT_EXPL_2_AD; break; + case 3: table_id = MRISTEP_DEFAULT_EXPL_3_AD; break; + case 4: table_id = MRISTEP_DEFAULT_EXPL_4_AD; break; + case 5: table_id = MRISTEP_DEFAULT_EXPL_5_AD; break; + } } } + if (table_id == ARKODE_MRI_NONE) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "No MRI method is available for the requested configuration."); + return (ARK_ILL_INPUT); + } step_mem->MRIC = MRIStepCoupling_LoadTable(table_id); if (step_mem->MRIC == NULL) @@ -1868,8 +3234,36 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) return (ARK_INVALID_TABLE); } + /* Check that coupling table has compatible type */ + if (step_mem->implicit_rhs && step_mem->explicit_rhs && + (step_mem->MRIC->type != MRISTEP_IMEX) && + (step_mem->MRIC->type != MRISTEP_SR)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid coupling table for an IMEX problem!"); + return (ARK_ILL_INPUT); + } + if (step_mem->explicit_rhs && (step_mem->MRIC->type != MRISTEP_EXPLICIT) && + (step_mem->MRIC->type != MRISTEP_IMEX) && + (step_mem->MRIC->type != MRISTEP_MERK) && + (step_mem->MRIC->type != MRISTEP_SR)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid coupling table for an explicit problem!"); + return (ARK_ILL_INPUT); + } + if (step_mem->implicit_rhs && (step_mem->MRIC->type != MRISTEP_IMPLICIT) && + (step_mem->MRIC->type != MRISTEP_IMEX) && + (step_mem->MRIC->type != MRISTEP_SR)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid coupling table for an implicit problem!"); + return (ARK_ILL_INPUT); + } + /* Check that the matrices are defined appropriately */ - if (step_mem->implicit_rhs && step_mem->explicit_rhs) + if ((step_mem->MRIC->type == MRISTEP_IMEX) || + (step_mem->MRIC->type == MRISTEP_SR)) { /* ImEx */ if (!(step_mem->MRIC->W) || !(step_mem->MRIC->G)) @@ -1879,7 +3273,8 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) return (ARK_ILL_INPUT); } } - else if (step_mem->explicit_rhs) + else if ((step_mem->MRIC->type == MRISTEP_EXPLICIT) || + (step_mem->MRIC->type == MRISTEP_MERK)) { /* Explicit */ if (!(step_mem->MRIC->W) || step_mem->MRIC->G) @@ -1889,7 +3284,7 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) return (ARK_ILL_INPUT); } } - else + else if (step_mem->MRIC->type == MRISTEP_IMPLICIT) { /* Implicit */ if (step_mem->MRIC->W || !(step_mem->MRIC->G)) @@ -1944,6 +3339,39 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) } } + /* Check that MERK "groups" are structured appropriately */ + if (step_mem->MRIC->type == MRISTEP_MERK) + { + int* group_counter = (int*)calloc(step_mem->MRIC->stages + 1, sizeof(int)); + for (i = 0; i < step_mem->MRIC->ngroup; i++) + { + for (j = 0; j < step_mem->MRIC->stages; j++) + { + k = step_mem->MRIC->group[i][j]; + if (k == -1) { break; } + if ((k < 0) || (k > step_mem->MRIC->stages)) + { + free(group_counter); + arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, + __FILE__, "Invalid MERK group index!"); + return (ARK_INVALID_TABLE); + } + group_counter[k]++; + } + } + for (i = 1; i <= step_mem->MRIC->stages; i++) + { + if ((group_counter[i] == 0) || (group_counter[i] > 1)) + { + free(group_counter); + arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, + __FILE__, "Duplicated/missing stages from MERK groups!"); + return (ARK_INVALID_TABLE); + } + } + free(group_counter); + } + /* Check that no stage has MRISTAGE_DIRK_FAST type (for now) */ okay = SUNTRUE; for (i = 0; i < step_mem->MRIC->stages; i++) @@ -1960,20 +3388,25 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) return (ARK_INVALID_TABLE); } - /* check that stage times are sorted */ - okay = SUNTRUE; - for (i = 1; i < step_mem->MRIC->stages; i++) + /* check that MRI-GARK stage times are sorted */ + if ((step_mem->MRIC->type == MRISTEP_IMPLICIT) || + (step_mem->MRIC->type == MRISTEP_EXPLICIT) || + (step_mem->MRIC->type == MRISTEP_IMEX)) { - if ((step_mem->MRIC->c[i] - step_mem->MRIC->c[i - 1]) < -tol) + okay = SUNTRUE; + for (i = 1; i < step_mem->MRIC->stages; i++) { - okay = SUNFALSE; + if ((step_mem->MRIC->c[i] - step_mem->MRIC->c[i - 1]) < -tol) + { + okay = SUNFALSE; + } + } + if (!okay) + { + arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, __FILE__, + "Stage times must be sorted."); + return (ARK_INVALID_TABLE); } - } - if (!okay) - { - arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, __FILE__, - "Stage times must be sorted."); - return (ARK_INVALID_TABLE); } /* check that the first stage is just the old step solution */ @@ -2007,30 +3440,28 @@ int mriStep_CheckCoupling(ARKodeMem ark_mem) /*--------------------------------------------------------------- mriStep_StageERKFast - This routine performs a single MRI stage with explicit slow - time scale and fast time scale that requires evolution. - ---------------------------------------------------------------*/ -int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) -{ - sunrealtype cdiff; /* stage time increment */ - sunrealtype t0; /* start time for stage */ - int retval; /* reusable return flag */ - -#ifdef SUNDIALS_DEBUG - printf(" MRIStep ERK fast stage\n"); -#endif + This routine performs a single MRI stage, is, with explicit + slow time scale and fast time scale that requires evolution. - /* Set initial time for fast evolution */ - t0 = ark_mem->tn + step_mem->MRIC->c[is - 1] * ark_mem->h; + On input, ycur is the initial condition for the fast IVP at t0. + On output, ycur is the solution of the fast IVP at tf. + The vector ytemp is only used if temporal adaptivity is enabled, + and the fast error is not provided by the fast integrator. - /* compute the inner forcing */ - cdiff = step_mem->MRIC->c[is] - step_mem->MRIC->c[is - 1]; - retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, cdiff); - if (retval != ARK_SUCCESS) { return (retval); } + get_inner_dsm indicates whether this stage is one that should + accumulate an inner temporal error estimate. + ---------------------------------------------------------------*/ +int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, + sunrealtype t0, sunrealtype tf, N_Vector ycur, + SUNDIALS_MAYBE_UNUSED N_Vector ytemp, + sunbooleantype get_inner_dsm) +{ + int retval; /* reusable return flag */ + SUNAdaptController_Type adapt_type; /* timestep adaptivity type */ - /* Set inner forcing time normalization constants */ - step_mem->stepper->tshift = t0; - step_mem->stepper->tscale = cdiff * ark_mem->h; +#ifdef SUNDIALS_DEBUG + printf(" MRIStep ERK fast stage\n"); +#endif /* pre inner evolve function (if supplied) */ if (step_mem->pre_inner_evolve) @@ -2041,16 +3472,52 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) if (retval != 0) { return (ARK_OUTERTOINNER_FAIL); } } + /* Get the adaptivity type (if applicable) */ + adapt_type = (get_inner_dsm) + ? SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller) + : SUN_ADAPTCONTROLLER_NONE; + /* advance inner method in time */ - retval = mriStepInnerStepper_Evolve(step_mem->stepper, t0, ark_mem->tcur, - ark_mem->ycur); - if (retval != 0) { return (ARK_INNERSTEP_FAIL); } + retval = mriStepInnerStepper_Evolve(step_mem->stepper, t0, tf, ycur); + if (retval < 0) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, + "Failure when evolving the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + if (retval > 0) + { + /* increment stepper-specific counter, and decrement ARKODE-level nonlinear + solver counter (since that will be incremented automatically by ARKODE). + Return with "TRY_AGAIN" which should cause ARKODE to cut the step size + and retry the step. */ + step_mem->inner_fails++; + ark_mem->ncfn--; + return TRY_AGAIN; + } + + /* for normal stages (i.e., not the embedding) with MRI adaptivity enabled, get an + estimate for the fast time scale error */ + if (get_inner_dsm) + { + /* if the fast integrator uses adaptive steps, retrieve the error estimate */ + if (adapt_type == SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + retval = mriStepInnerStepper_GetAccumulatedError(step_mem->stepper, + &(step_mem->inner_dsm)); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, + __FILE__, "Unable to get accumulated error from the inner stepper"); + return (ARK_INNERSTEP_FAIL); + } + } + } /* post inner evolve function (if supplied) */ if (step_mem->post_inner_evolve) { - retval = step_mem->post_inner_evolve(ark_mem->tcur, ark_mem->ycur, - ark_mem->user_data); + retval = step_mem->post_inner_evolve(tf, ycur, ark_mem->user_data); if (retval != 0) { return (ARK_INNERTOOUTER_FAIL); } } @@ -2072,16 +3539,17 @@ int mriStep_StageERKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) printf(" MRIStep ERK stage\n"); #endif - /* determine effective ERK coefficients (store in cvals) */ + /* determine effective ERK coefficients (store in Ae_row and Ai_row) */ retval = mriStep_RKCoeffs(step_mem->MRIC, is, step_mem->stage_map, step_mem->Ae_row, step_mem->Ai_row); if (retval != ARK_SUCCESS) { return (retval); } - /* call fused vector operation to perform ERK update */ + /* call fused vector operation to perform ERK update -- bound on + j needs "SUNMIN" to handle the case of an "embedding" stage */ step_mem->cvals[0] = ONE; step_mem->Xvecs[0] = ark_mem->ycur; nvec = 1; - for (j = 0; j < is; j++) + for (j = 0; j < SUNMIN(is, step_mem->stages); j++) { if (step_mem->explicit_rhs && step_mem->stage_map[j] > -1) { @@ -2144,16 +3612,16 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, printf(" MRIStep DIRK stage\n"); #endif - /* store current stage index */ - step_mem->istage = is; + /* store current stage index (for an "embedded" stage, subtract 1) */ + step_mem->istage = (is == step_mem->stages) ? is - 1 : is; /* Call predictor for current stage solution (result placed in zpred) */ - retval = mriStep_Predict(ark_mem, is, step_mem->zpred); + retval = mriStep_Predict(ark_mem, step_mem->istage, step_mem->zpred); if (retval != ARK_SUCCESS) { return (retval); } /* If a user-supplied predictor routine is provided, call that here Note that mriStep_Predict is *still* called, so this user-supplied - routine can just 'clean up' the built-in prediction, if desired. */ + routine can just "clean up" the built-in prediction, if desired. */ if (step_mem->stage_predict) { retval = step_mem->stage_predict(ark_mem->tcur, step_mem->zpred, @@ -2197,18 +3665,19 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, mriStep_ComputeInnerForcing Constructs the 'coefficient' vectors for the forcing polynomial - for a 'fast' outer MRI stage i: + for a 'fast' outer MRI-GARK stage i: p_i(theta) = sum_{k=0}^{n-1} forcing[k] * theta^k - where theta = (t - t0) / (cdiff*h) is the mapped 'time' for + where theta = (t - t0) / (tf-t0) is the mapped 'time' for each 'fast' MRIStep evolution, with: * t0 -- the start of this outer MRIStep stage - * cdiff*h, the temporal width of this MRIStep stage + * tf-t0, the temporal width of this MRIStep stage * n -- shorthand for MRIC->nmat - explicit and solve-decoupled implicit or IMEX MRI-based methods - define this forcing polynomial for each outer stage i > 0: + Defining cdiff = (tf-t0)/h, explicit and solve-decoupled + implicit or IMEX MRI-based methods define this forcing polynomial + for each outer stage i > 0: p_i(theta) = w_i,0(theta) * fse_0 + ... + w_i,{i-1}(theta) * fse_{i-1} + g_i,0(theta) * fsi_0 + ... + g_i,{i-1}(theta) * fsi_{i-1} @@ -2244,33 +3713,76 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ( W[k][i][0] * fse_0 + ... + W[k][i][i-1] * fse_{i-1} + ( G[k][i][0] * fsi_0 + ... + G[k][i][i-1] * fsi_{i-1} ) + We may use an identical formula for MERK methods, so long as we set t0=tn, + tf=tn+h, stage_map[j]=j (identity map), and implicit_rhs=SUNFALSE. + With this configuration: tf-t0=h, theta = (t-tn)/h, and cdiff=1. MERK methods + define the forcing polynomial for each outer stage i > 0 as: + + p_i(theta) = w_i,0(theta) * fse_0 + ... + w_i,{i-1}(theta) * fse_{i-1} + + where + + w_i,j(theta) = w_0,i,j + w_1,i,j * theta + ... + w_n,i,j * theta^{n-1}, + w_k,i,j = MRIC->W[k][i][j] + + which is equivalent to the formula above. + + We may use a similar formula for MRISR methods, so long as we set t0=tn, + tf=tn+h*ci, stage_map[j]=j (identity map), and implicit_rhs=SUNFALSE. + With this configuration: tf-t0=ci*h, theta = (t-tn)/(ci*h), and cdiff=1/ci. + MRISR methods define the forcing polynomial for each outer stage i > 0 as: + + p_i(theta) = w_i,0(theta) * fs_0 + ... + w_i,{i-1}(theta) * fs_{i-1} + + where fs_j = fse_j + fsi_j and + + w_i,j(theta) = w_0,i,j + w_1,i,j * theta + ... + w_n,i,j * theta^{n-1}, + w_k,i,j = 1/ci * MRIC->W[k][i][j] + + which is equivalent to the formula above, so long as the stage RHS vectors + Fse[j] are repurposed to instead store (fse_j + fsi_j). + This routine additionally returns a success/failure flag: ARK_SUCCESS -- successful evaluation ---------------------------------------------------------------*/ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int stage, - sunrealtype cdiff) + sunrealtype t0, sunrealtype tf) { sunrealtype rcdiff; int j, k, nmat, nstore, retval; sunrealtype* cvals; N_Vector* Xvecs; + sunbooleantype implicit_rhs = step_mem->implicit_rhs; + sunbooleantype explicit_rhs = step_mem->explicit_rhs; /* local shortcuts for fused vector operations */ cvals = step_mem->cvals; Xvecs = step_mem->Xvecs; + /* Set inner forcing time normalization constants */ + step_mem->stepper->tshift = t0; + step_mem->stepper->tscale = tf - t0; + + /* Adjust implicit/explicit RHS flags for MRISR methods, since these + ignore the G coefficients in the forcing function */ + if (step_mem->MRIC->type == MRISTEP_SR) + { + implicit_rhs = SUNFALSE; + explicit_rhs = SUNTRUE; + } + /* compute inner forcing vectors (assumes cdiff != 0) */ nstore = 0; - for (j = 0; j < stage; j++) + for (j = 0; j < SUNMIN(stage, step_mem->stages); j++) { - if (step_mem->explicit_rhs && step_mem->stage_map[j] > -1) + if (explicit_rhs && step_mem->stage_map[j] > -1) { Xvecs[nstore] = step_mem->Fse[step_mem->stage_map[j]]; nstore += 1; } - if (step_mem->implicit_rhs && step_mem->stage_map[j] > -1) + if (implicit_rhs && step_mem->stage_map[j] > -1) { Xvecs[nstore] = step_mem->Fsi[step_mem->stage_map[j]]; nstore += 1; @@ -2278,16 +3790,16 @@ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, } nmat = step_mem->MRIC->nmat; - rcdiff = ONE / cdiff; + rcdiff = ark_mem->h / (tf - t0); for (k = 0; k < nmat; k++) { nstore = 0; - for (j = 0; j < stage; j++) + for (j = 0; j < SUNMIN(stage, step_mem->stages); j++) { if (step_mem->stage_map[j] > -1) { - if (step_mem->explicit_rhs && step_mem->implicit_rhs) + if (explicit_rhs && implicit_rhs) { /* ImEx */ cvals[nstore] = rcdiff * step_mem->MRIC->W[k][stage][j]; @@ -2295,7 +3807,7 @@ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, cvals[nstore] = rcdiff * step_mem->MRIC->G[k][stage][j]; nstore += 1; } - else if (step_mem->explicit_rhs) + else if (explicit_rhs) { /* explicit only */ cvals[nstore] = rcdiff * step_mem->MRIC->W[k][stage][j]; @@ -2329,9 +3841,8 @@ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, } /*--------------------------------------------------------------- - Compute/return the 'effective' RK coefficients for a 'nofast' - stage. It is assumed that the array 'A' has already been - allocated to have length MRIC->stages. + Compute/return the effective RK coefficients for a "nofast" + stage. We may assume that "A" has already been allocated. ---------------------------------------------------------------*/ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int* stage_map, @@ -2340,7 +3851,7 @@ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int* stage_map, int j, k; sunrealtype kconst; - if (is < 1 || is >= MRIC->stages || !stage_map || !Ae_row || !Ai_row) + if (is < 1 || is > MRIC->stages || !stage_map || !Ae_row || !Ai_row) { return ARK_INVALID_TABLE; } @@ -2352,13 +3863,14 @@ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int* stage_map, Ai_row[j] = ZERO; } - /* compute RK coefficients */ + /* compute RK coefficients -- note that bounds on j need + "SUNMIN" to handle the case of an "embedding" stage */ for (k = 0; k < MRIC->nmat; k++) { kconst = ONE / (k + ONE); if (MRIC->W) { - for (j = 0; j < is; j++) + for (j = 0; j < SUNMIN(is, MRIC->stages - 1); j++) { if (stage_map[j] > -1) { @@ -2368,7 +3880,7 @@ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int* stage_map, } if (MRIC->G) { - for (j = 0; j <= is; j++) + for (j = 0; j <= SUNMIN(is, MRIC->stages - 1); j++) { if (stage_map[j] > -1) { @@ -2558,10 +4070,8 @@ int mriStep_StageSetup(ARKodeMem ark_mem) step_mem->gamma = ark_mem->h * step_mem->Ai_row[step_mem->stage_map[i]]; if (ark_mem->firststage) { step_mem->gammap = step_mem->gamma; } - step_mem->gamrat = (ark_mem->firststage) - ? ONE - : step_mem->gamma / - step_mem->gammap; /* protect x/x != 1.0 */ + step_mem->gamrat = (ark_mem->firststage) ? ONE + : step_mem->gamma / step_mem->gammap; /* set cvals and Xvecs for setting stage data */ cvals[0] = ONE; @@ -2595,8 +4105,123 @@ int mriStep_StageSetup(ARKodeMem ark_mem) } /*--------------------------------------------------------------- - User-callable functions for a custom inner integrator + mriStep_SlowRHS: + + Wrapper routine to call the user-supplied slow RHS functions, + f(t,y) = fse(t,y) + fsi(t,y), with API matching + ARKTimestepFullRHSFn. This is only used to determine an + initial slow time-step size to use when one is not specified + by the user (i.e., mode should correspond with + ARK_FULLRHS_START. + ---------------------------------------------------------------*/ +int mriStep_SlowRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, + SUNDIALS_MAYBE_UNUSED int mode) +{ + ARKodeMRIStepMem step_mem; + int nvec, retval; + + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* 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++; + step_mem->fse_is_current = SUNTRUE; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + + /* Add external forcing, if applicable */ + if (step_mem->expforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fse[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fse[0]); + } + } + + /* 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++; + step_mem->fsi_is_current = SUNTRUE; + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return (ARK_RHSFUNC_FAIL); + } + + /* Add external forcing, if applicable */ + if (step_mem->impforcing) + { + step_mem->cvals[0] = ONE; + step_mem->Xvecs[0] = step_mem->Fsi[0]; + nvec = 1; + mriStep_ApplyForcing(step_mem, t, ONE, &nvec); + N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, + step_mem->Fsi[0]); + } + } + + /* combine RHS vectors into output */ + if (step_mem->explicit_rhs && step_mem->implicit_rhs) /* ImEx */ + { + N_VLinearSum(ONE, step_mem->Fse[0], ONE, step_mem->Fsi[0], f); + } + else + { + if (step_mem->implicit_rhs) { N_VScale(ONE, step_mem->Fsi[0], f); } + else { N_VScale(ONE, step_mem->Fse[0], f); } + } + + return (ARK_SUCCESS); +} + +/*--------------------------------------------------------------- + mriStep_Hin + + This routine computes a tentative initial step size h0. This + employs the same safeguards as ARKODE's arkHin utility routine, + but employs a simpler algorithm that estimates the first step + such that an explicit Euler step (for only the slow RHS + routine(s)) would be within user-specified tolerances of the + initial condition. ---------------------------------------------------------------*/ +int mriStep_Hin(ARKodeMem ark_mem, sunrealtype tcur, sunrealtype tout, + N_Vector fcur, sunrealtype* h) +{ + int sign; + sunrealtype tdiff, tdist, tround, fnorm, h0_inv; + + /* If tout is too close to tn, give up */ + if ((tdiff = tout - tcur) == ZERO) { return (ARK_TOO_CLOSE); } + sign = (tdiff > ZERO) ? 1 : -1; + tdist = SUNRabs(tdiff); + tround = ark_mem->uround * SUNMAX(SUNRabs(tcur), SUNRabs(tout)); + if (tdist < TWO * tround) { return (ARK_TOO_CLOSE); } + + /* h0 should bound the change due to a forward Euler step, and + include safeguard against "too-small" ||f(t0,y0)||: */ + fnorm = N_VWrmsNorm(fcur, ark_mem->ewt) / H0_BIAS; + h0_inv = SUNMAX(ONE / H0_UBFACTOR / tdist, fnorm); + *h = sign / h0_inv; + return (ARK_SUCCESS); +} + +/*=============================================================== + User-callable functions for a custom inner integrator + ===============================================================*/ int MRIStepInnerStepper_Create(SUNContext sunctx, MRIStepInnerStepper* stepper) { @@ -2762,6 +4387,72 @@ int MRIStepInnerStepper_SetResetFn(MRIStepInnerStepper stepper, return ARK_SUCCESS; } +int MRIStepInnerStepper_SetAccumulatedErrorGetFn(MRIStepInnerStepper stepper, + MRIStepInnerGetAccumulatedError fn) +{ + if (stepper == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper memory is NULL"); + return ARK_ILL_INPUT; + } + + if (stepper->ops == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper operations structure is NULL"); + return ARK_ILL_INPUT; + } + + stepper->ops->geterror = fn; + + return ARK_SUCCESS; +} + +int MRIStepInnerStepper_SetAccumulatedErrorResetFn( + MRIStepInnerStepper stepper, MRIStepInnerResetAccumulatedError fn) +{ + if (stepper == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper memory is NULL"); + return ARK_ILL_INPUT; + } + + if (stepper->ops == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper operations structure is NULL"); + return ARK_ILL_INPUT; + } + + stepper->ops->reseterror = fn; + + return ARK_SUCCESS; +} + +int MRIStepInnerStepper_SetRTolFn(MRIStepInnerStepper stepper, + MRIStepInnerSetRTol fn) +{ + if (stepper == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper memory is NULL"); + return ARK_ILL_INPUT; + } + + if (stepper->ops == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Inner stepper operations structure is NULL"); + return ARK_ILL_INPUT; + } + + stepper->ops->setrtol = fn; + + return ARK_SUCCESS; +} + int MRIStepInnerStepper_AddForcing(MRIStepInnerStepper stepper, sunrealtype t, N_Vector f) { @@ -2828,6 +4519,19 @@ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper) else { return ARK_ILL_INPUT; } } +/* Check whether stepper supports fast/slow tolerance adaptivity */ +sunbooleantype mriStepInnerStepper_SupportsRTolAdaptivity(MRIStepInnerStepper stepper) +{ + if (stepper == NULL) { return SUNFALSE; } + if (stepper->ops == NULL) { return SUNFALSE; } + + if (stepper->ops->geterror && stepper->ops->reseterror && stepper->ops->setrtol) + { + return SUNTRUE; + } + else { return SUNFALSE; } +} + /* Evolve the inner (fast) ODE */ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector y) @@ -2860,14 +4564,21 @@ int mriStepInnerStepper_EvolveSUNStepper(MRIStepInnerStepper stepper, SUNStepper sunstepper = (SUNStepper)stepper->content; sunrealtype tret; - SUNErrCode err = sunstepper->ops->setstoptime(sunstepper, tout); - if (err != SUN_SUCCESS) - { - stepper->last_flag = sunstepper->last_flag; - return ARK_SUNSTEPPER_ERR; - } + SUNErrCode err = SUNStepper_SetForcing(sunstepper, stepper->tshift, + stepper->tscale, stepper->forcing, + stepper->nforcing); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + err = SUNStepper_SetStopTime(sunstepper, tout); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } - err = sunstepper->ops->evolve(sunstepper, tout, y, &tret); + err = SUNStepper_Evolve(sunstepper, tout, y, &tret); + stepper->last_flag = sunstepper->last_flag; + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + err = SUNStepper_SetForcing(sunstepper, ZERO, ONE, NULL, 0); stepper->last_flag = sunstepper->last_flag; if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } @@ -2902,7 +4613,7 @@ int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, default: mode = SUN_FULLRHS_OTHER; break; } - SUNErrCode err = sunstepper->ops->fullrhs(sunstepper, t, y, f, mode); + SUNErrCode err = SUNStepper_FullRhs(sunstepper, t, y, f, mode); stepper->last_flag = sunstepper->last_flag; if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } return ARK_SUCCESS; @@ -2933,11 +4644,62 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, } } +/* Gets the inner (fast) stepper accumulated error */ +int mriStepInnerStepper_GetAccumulatedError(MRIStepInnerStepper stepper, + sunrealtype* accum_error) +{ + if (stepper == NULL) { return ARK_ILL_INPUT; } + if (stepper->ops == NULL) { return ARK_ILL_INPUT; } + + if (stepper->ops->geterror) + { + stepper->last_flag = stepper->ops->geterror(stepper, accum_error); + return stepper->last_flag; + } + else { return ARK_INNERSTEP_FAIL; } +} + +/* Resets the inner (fast) stepper accumulated error */ +int mriStepInnerStepper_ResetAccumulatedError(MRIStepInnerStepper stepper) +{ + if (stepper == NULL) { return ARK_ILL_INPUT; } + if (stepper->ops == NULL) { return ARK_ILL_INPUT; } + + if (stepper->ops->geterror) + { + stepper->last_flag = stepper->ops->reseterror(stepper); + return stepper->last_flag; + } + else + { + /* assume stepper provides exact solution and needs no reset */ + return ARK_SUCCESS; + } +} + +/* Sets the inner (fast) stepper relative tolerance scaling factor */ +int mriStepInnerStepper_SetRTol(MRIStepInnerStepper stepper, sunrealtype rtol) +{ + if (stepper == NULL) { return ARK_ILL_INPUT; } + if (stepper->ops == NULL) { return ARK_ILL_INPUT; } + + if (stepper->ops->setrtol) + { + stepper->last_flag = stepper->ops->setrtol(stepper, rtol); + return stepper->last_flag; + } + else + { + /* assume stepper provides exact solution */ + return ARK_SUCCESS; + } +} + int mriStepInnerStepper_ResetSUNStepper(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR) { SUNStepper sunstepper = (SUNStepper)stepper->content; - SUNErrCode err = sunstepper->ops->reset(sunstepper, tR, yR); + SUNErrCode err = SUNStepper_Reset(sunstepper, tR, yR); stepper->last_flag = sunstepper->last_flag; if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } return ARK_SUCCESS; @@ -3073,6 +4835,147 @@ void mriStepInnerStepper_PrintMem(MRIStepInnerStepper stepper, FILE* outfile) return; } +/*--------------------------------------------------------------- + Utility routines for MRIStep to serve as an MRIStepInnerStepper + ---------------------------------------------------------------*/ + +/*------------------------------------------------------------------------------ + mriStep_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. + ----------------------------------------------------------------------------*/ + +void mriStep_ApplyForcing(ARKodeMRIStepMem step_mem, sunrealtype t, + sunrealtype s, int* nvec) +{ + sunrealtype tau, taui; + int i; + + /* always append the constant forcing term */ + step_mem->cvals[*nvec] = s; + step_mem->Xvecs[*nvec] = step_mem->forcing[0]; + (*nvec) += 1; + + /* compute normalized time tau and initialize tau^i */ + tau = (t - step_mem->tshift) / (step_mem->tscale); + taui = tau; + for (i = 1; i < step_mem->nforcing; i++) + { + step_mem->cvals[*nvec] = s * taui; + step_mem->Xvecs[*nvec] = step_mem->forcing[i]; + taui *= tau; + (*nvec) += 1; + } +} + +/*------------------------------------------------------------------------------ + mriStep_SetInnerForcing + + Sets an array of coefficient vectors for a time-dependent external polynomial + forcing term in the ODE RHS i.e., y' = f(t,y) + p(t). This function is + primarily intended for using MRIStep as an inner integrator within another + [outer] instance of MRIStep, where this instance is used to solve a + modified ODE at a fast time scale. The polynomial is of the form + + p(t) = sum_{i = 0}^{nvecs - 1} forcing[i] * ((t - tshift) / (tscale))^i + + where tshift and tscale are used to normalize the time t (e.g., with MRIGARK + methods). + ----------------------------------------------------------------------------*/ + +int mriStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* forcing, int nvecs) +{ + ARKodeMRIStepMem step_mem; + int retval; + + /* access ARKodeMRIStepMem structure */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + if (nvecs > 0) + { + /* enable forcing, and signal that the corresponding pre-existing RHS + vector is no longer current, since it has a stale forcing function */ + if (step_mem->explicit_rhs) + { + step_mem->expforcing = SUNTRUE; + step_mem->impforcing = SUNFALSE; + step_mem->fse_is_current = SUNFALSE; + } + else + { + step_mem->expforcing = SUNFALSE; + step_mem->impforcing = SUNTRUE; + step_mem->fsi_is_current = SUNFALSE; + } + step_mem->tshift = tshift; + step_mem->tscale = tscale; + step_mem->forcing = forcing; + step_mem->nforcing = nvecs; + + /* Signal that any pre-existing RHS vector is no longer current, since it + has a stale forcing function */ + ark_mem->fn_is_current = SUNFALSE; + + /* If cvals and Xvecs are not allocated then mriStep_Init has not been + called and the number of stages has not been set yet. These arrays will + be allocated in mriStep_Init and take into account the value of nforcing. + On subsequent calls will check if enough space has allocated in case + nforcing has increased since the original allocation. */ + if (step_mem->cvals != NULL && step_mem->Xvecs != NULL) + { + /* check if there are enough reusable arrays for fused operations */ + if ((step_mem->nfusedopvecs - nvecs) < (2 * step_mem->MRIC->stages + 2)) + { + /* free current work space */ + if (step_mem->cvals != NULL) + { + free(step_mem->cvals); + ark_mem->lrw -= step_mem->nfusedopvecs; + } + if (step_mem->Xvecs != NULL) + { + free(step_mem->Xvecs); + ark_mem->liw -= step_mem->nfusedopvecs; + } + + /* allocate reusable arrays for fused vector operations */ + step_mem->nfusedopvecs = 2 * step_mem->MRIC->stages + 2 + nvecs; + + step_mem->cvals = NULL; + step_mem->cvals = (sunrealtype*)calloc(step_mem->nfusedopvecs, + sizeof(sunrealtype)); + if (step_mem->cvals == NULL) { return (ARK_MEM_FAIL); } + ark_mem->lrw += step_mem->nfusedopvecs; + + step_mem->Xvecs = NULL; + step_mem->Xvecs = (N_Vector*)calloc(step_mem->nfusedopvecs, + sizeof(N_Vector)); + if (step_mem->Xvecs == NULL) { return (ARK_MEM_FAIL); } + ark_mem->liw += step_mem->nfusedopvecs; + } + } + } + else + { + /* disable forcing */ + step_mem->expforcing = SUNFALSE; + step_mem->impforcing = SUNFALSE; + step_mem->tshift = ZERO; + step_mem->tscale = ONE; + step_mem->forcing = NULL; + step_mem->nforcing = 0; + } + + return (ARK_SUCCESS); +} + /*=============================================================== EOF ===============================================================*/ diff --git a/src/arkode/arkode_mristep_controller.c b/src/arkode/arkode_mristep_controller.c new file mode 100644 index 0000000000..4e026c061f --- /dev/null +++ b/src/arkode/arkode_mristep_controller.c @@ -0,0 +1,142 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 MRIStep's multirate adaptivity controller + * layer. + * ---------------------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "arkode_impl.h" +#include "arkode_mristep_impl.h" + +/*-------------------------------------------- + MRIStep SUNAdaptController wrapper functions + --------------------------------------------*/ + +SUNAdaptController SUNAdaptController_MRIStep(ARKodeMem ark_mem, + SUNAdaptController CMRI) +{ + SUNAdaptController C; + mriStepControlContent content; + ARKodeMRIStepMem step_mem; + int retval; + + /* Return with failure if input controller is NULL or has + unsupported type */ + if (CMRI == NULL) { return (NULL); } + if (SUNAdaptController_GetType(CMRI) != SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + return (NULL); + } + + /* Return with failure if stepper is inaccessible */ + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) return (NULL); + + /* Create an empty controller object */ + C = NULL; + C = SUNAdaptController_NewEmpty(CMRI->sunctx); + if (C == NULL) { return (NULL); } + + /* Attach operations */ + C->ops->gettype = SUNAdaptController_GetType_MRIStep; + C->ops->estimatestep = SUNAdaptController_EstimateStep_MRIStep; + C->ops->reset = SUNAdaptController_Reset_MRIStep; + C->ops->write = SUNAdaptController_Write_MRIStep; + C->ops->updateh = SUNAdaptController_UpdateH_MRIStep; + C->ops->space = SUNAdaptController_Space_MRIStep; + + /* Create content */ + content = NULL; + content = (mriStepControlContent)malloc(sizeof *content); + if (content == NULL) + { + SUNAdaptController_Destroy(C); + return (NULL); + } + + /* Attach ARKODE memory, MRI stepper memory and MRI controller objects */ + content->ark_mem = ark_mem; + content->step_mem = step_mem; + content->C = CMRI; + + /* Attach content and return */ + C->content = content; + return (C); +} + +SUNErrCode SUNAdaptController_EstimateStep_MRIStep(SUNAdaptController C, + sunrealtype H, int P, + sunrealtype DSM, + sunrealtype* Hnew) +{ + /* Shortcuts to ARKODE and MRIStep memory */ + ARKodeMem ark_mem = MRICONTROL_A(C); + ARKodeMRIStepMem step_mem = MRICONTROL_S(C); + if ((ark_mem == NULL) || (step_mem == NULL)) { return SUN_ERR_MEM_FAIL; } + + /* Estimate slow stepsize from MRI controller */ + return SUNAdaptController_EstimateStepTol(MRICONTROL_C(C), H, + step_mem->inner_rtol_factor, P, DSM, + step_mem->inner_dsm, Hnew, + &(step_mem->inner_rtol_factor_new)); +} + +SUNErrCode SUNAdaptController_UpdateH_MRIStep(SUNAdaptController C, + sunrealtype H, sunrealtype DSM) +{ + /* Shortcuts to ARKODE and MRIStep memory */ + ARKodeMem ark_mem = MRICONTROL_A(C); + ARKodeMRIStepMem step_mem = MRICONTROL_S(C); + if ((ark_mem == NULL) || (step_mem == NULL)) { return SUN_ERR_MEM_FAIL; } + + /* Update MRI controller */ + SUNErrCode retval = SUNAdaptController_UpdateMRIHTol(MRICONTROL_C(C), H, + step_mem->inner_rtol_factor, + DSM, step_mem->inner_dsm); + if (retval != SUN_SUCCESS) { return (retval); } + + /* Update inner controller parameter to most-recent prediction */ + step_mem->inner_rtol_factor = step_mem->inner_rtol_factor_new; + + /* return with success*/ + return SUN_SUCCESS; +} + +SUNAdaptController_Type SUNAdaptController_GetType_MRIStep(SUNAdaptController C) +{ + return SUNAdaptController_GetType(MRICONTROL_C(C)); +} + +SUNErrCode SUNAdaptController_Reset_MRIStep(SUNAdaptController C) +{ + return SUNAdaptController_Reset(MRICONTROL_C(C)); +} + +SUNErrCode SUNAdaptController_Write_MRIStep(SUNAdaptController C, FILE* fptr) +{ + return SUNAdaptController_Write(MRICONTROL_C(C), fptr); +} + +SUNErrCode SUNAdaptController_Space_MRIStep(SUNAdaptController C, + long int* lenrw, long int* leniw) +{ + return SUNAdaptController_Space(MRICONTROL_C(C), lenrw, leniw); +} + +/*=============================================================== + EOF + ===============================================================*/ diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index 3ae944b12d..1fe308d863 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -31,6 +31,7 @@ extern "C" { #endif /* Stage type identifiers */ +#define MRISTAGE_STIFF_ACC -1 #define MRISTAGE_ERK_FAST 0 #define MRISTAGE_ERK_NOFAST 1 #define MRISTAGE_DIRK_NOFAST 2 @@ -72,8 +73,11 @@ typedef struct ARKodeMRIStepMemRec a nonlinear solve */ /* Outer RK method storage and parameters */ - N_Vector* Fse; /* explicit RHS at each stage */ - N_Vector* Fsi; /* implicit RHS at each stage */ + N_Vector* Fse; /* explicit RHS at each stage */ + N_Vector* Fsi; /* implicit RHS at each stage */ + sunbooleantype unify_Fs; /* Fse and Fsi point at the same memory */ + sunbooleantype fse_is_current; + sunbooleantype fsi_is_current; MRIStepCoupling MRIC; /* slow->fast coupling table */ int q; /* method order */ int p; /* embedding order */ @@ -103,18 +107,18 @@ typedef struct ARKodeMRIStepMemRec sunrealtype crate; /* estimated nonlin convergence rate */ sunrealtype delp; /* norm of previous nonlinear solver update */ sunrealtype eRNrm; /* estimated residual norm, used in nonlin - and linear solver convergence tests */ + and linear solver convergence tests */ sunrealtype nlscoef; /* coefficient in nonlin. convergence test */ int msbp; /* positive => max # steps between lsetup - negative => call at each Newton iter */ + negative => call at each Newton iter */ long int nstlp; /* step number of last setup call */ int maxcor; /* max num iterations for solving the - nonlinear equation */ + nonlinear equation */ int convfail; /* NLS fail flag (for interface routines) */ sunbooleantype jcur; /* is Jacobian info for lin solver current? */ - ARKStagePredictFn stage_predict; /* User-supplied stage predictor */ + ARKStagePredictFn stage_predict; /* User-supplied stage predictor */ /* Linear Solver Data */ ARKLinsolInitFn linit; @@ -130,13 +134,27 @@ typedef struct ARKodeMRIStepMemRec MRIStepPreInnerFn pre_inner_evolve; MRIStepPostInnerFn post_inner_evolve; + /* MRI adaptivity parameters */ + sunrealtype inner_rtol_factor; /* prev control parameter */ + sunrealtype inner_dsm; /* prev inner stepper accumulated error */ + sunrealtype inner_rtol_factor_new; /* upcoming control parameter */ + /* Counters */ - long int nfse; /* num fse calls */ - long int nfsi; /* num fsi calls */ - long int nsetups; /* num linear solver setup calls */ - long int nls_iters; /* num nonlinear solver iters */ - long int nls_fails; /* num nonlinear solver fails */ - int nfusedopvecs; /* length of cvals and Xvecs arrays */ + long int nfse; /* num fse calls */ + long int nfsi; /* num fsi calls */ + long int nsetups; /* num linear solver setup calls */ + long int nls_iters; /* num nonlinear solver iters */ + long int nls_fails; /* num nonlinear solver fails */ + long int inner_fails; /* num recov. inner solver fails */ + int nfusedopvecs; /* length of cvals and Xvecs arrays */ + + /* Data for using MRIStep with external polynomial forcing */ + sunbooleantype expforcing; /* add forcing to explicit RHS */ + sunbooleantype impforcing; /* add forcing to implicit RHS */ + sunrealtype tshift; /* time normalization shift */ + sunrealtype tscale; /* time normalization scaling */ + N_Vector* forcing; /* array of forcing vectors */ + int nforcing; /* number of forcing vectors */ /* Reusable arrays for fused vector operations */ sunrealtype* cvals; @@ -155,6 +173,9 @@ struct _MRIStepInnerStepper_Ops MRIStepInnerEvolveFn evolve; MRIStepInnerFullRhsFn fullrhs; MRIStepInnerResetFn reset; + MRIStepInnerGetAccumulatedError geterror; + MRIStepInnerResetAccumulatedError reseterror; + MRIStepInnerSetRTol setrtol; }; struct _MRIStepInnerStepper @@ -195,14 +216,20 @@ int mriStep_AttachLinsol(ARKodeMem ark_mem, ARKLinsolInitFn linit, ARKLinsolFreeFn lfree, SUNLinearSolver_Type lsolve_type, void* lmem); void mriStep_DisableLSetup(ARKodeMem ark_mem); -int mriStep_Init(ARKodeMem ark_mem, int init_type); +int mriStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type); void* mriStep_GetLmem(ARKodeMem ark_mem); ARKRhsFn mriStep_GetImplicitRHS(ARKodeMem ark_mem); int mriStep_GetGammas(ARKodeMem ark_mem, sunrealtype* gamma, sunrealtype* gamrat, sunbooleantype** jcur, sunbooleantype* dgamma_fail); int mriStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); -int mriStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int mriStep_UpdateF0(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, + sunrealtype t, N_Vector y, int mode); +int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, + int* nflagPtr); +int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); +int mriStep_SetAdaptController(ARKodeMem ark_mem, SUNAdaptController C); int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data); int mriStep_SetDefaults(ARKodeMem ark_mem); int mriStep_SetOrder(ARKodeMem ark_mem, int ord); @@ -219,6 +246,7 @@ int mriStep_SetMaxNonlinIters(ARKodeMem ark_mem, int maxcor); int mriStep_SetNonlinConvCoef(ARKodeMem ark_mem, sunrealtype nlscoef); int mriStep_SetStagePredictFn(ARKodeMem ark_mem, ARKStagePredictFn PredictStage); int mriStep_SetDeduceImplicitRhs(ARKodeMem ark_mem, sunbooleantype deduce); +int mriStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele); int mriStep_GetNumRhsEvals(ARKodeMem ark_mem, int partition_index, long int* rhs_evals); int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma); @@ -239,6 +267,8 @@ int mriStep_Resize(ARKodeMem ark_mem, N_Vector y0, sunrealtype hscale, int mriStep_ComputeState(ARKodeMem ark_mem, N_Vector zcor, N_Vector z); void mriStep_Free(ARKodeMem ark_mem); void mriStep_PrintMem(ARKodeMem ark_mem, FILE* outfile); +int mriStep_SetInnerForcing(ARKodeMem ark_mem, sunrealtype tshift, + sunrealtype tscale, N_Vector* f, int nvecs); /* Internal utility routines */ int mriStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, @@ -248,7 +278,9 @@ int mriStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, sunbooleantype mriStep_CheckNVector(N_Vector tmpl); int mriStep_SetCoupling(ARKodeMem ark_mem); int mriStep_CheckCoupling(ARKodeMem ark_mem); -int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is); +int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, + sunrealtype t0, sunrealtype tf, N_Vector ycur, + N_Vector ytemp, sunbooleantype get_inner_dsm); int mriStep_StageERKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is); int mriStep_StageDIRKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is, int* nflagPtr); @@ -258,6 +290,12 @@ int mriStep_Predict(ARKodeMem ark_mem, int istage, N_Vector yguess); int mriStep_StageSetup(ARKodeMem ark_mem); int mriStep_NlsInit(ARKodeMem ark_mem); int mriStep_Nls(ARKodeMem ark_mem, int nflag); +int mriStep_SlowRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, + int mode); +int mriStep_Hin(ARKodeMem ark_mem, sunrealtype tcur, sunrealtype tout, + N_Vector fcur, sunrealtype* h); +void mriStep_ApplyForcing(ARKodeMRIStepMem step_mem, sunrealtype t, + sunrealtype s, int* nvec); /* private functions passed to nonlinear solver */ int mriStep_NlsResidual(N_Vector yy, N_Vector res, void* arkode_mem); @@ -270,6 +308,8 @@ int mriStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, /* Inner stepper functions */ int mriStepInnerStepper_HasRequiredOps(MRIStepInnerStepper stepper); +sunbooleantype mriStepInnerStepper_SupportsRTolAdaptivity( + MRIStepInnerStepper stepper); int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, sunrealtype tout, N_Vector y); int mriStepInnerStepper_EvolveSUNStepper(MRIStepInnerStepper stepper, @@ -282,6 +322,10 @@ int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, int mode); int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); +int mriStepInnerStepper_GetAccumulatedError(MRIStepInnerStepper stepper, + sunrealtype* accum_error); +int mriStepInnerStepper_ResetAccumulatedError(MRIStepInnerStepper stepper); +int mriStepInnerStepper_SetRTol(MRIStepInnerStepper stepper, sunrealtype rtol); int mriStepInnerStepper_ResetSUNStepper(MRIStepInnerStepper stepper, sunrealtype tR, N_Vector yR); int mriStepInnerStepper_AllocVecs(MRIStepInnerStepper stepper, int count, @@ -294,12 +338,51 @@ void mriStepInnerStepper_PrintMem(MRIStepInnerStepper stepper, FILE* outfile); /* Compute forcing for inner stepper */ int mriStep_ComputeInnerForcing(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, - int stage, sunrealtype cdiff); + int stage, sunrealtype t0, sunrealtype tf); /* Return effective RK coefficients (nofast stage) */ int mriStep_RKCoeffs(MRIStepCoupling MRIC, int is, int* stage_map, sunrealtype* Ae_row, sunrealtype* Ai_row); +/*=============================================================== + MRIStep SUNAdaptController wrapper module -- this is used to + insert MRIStep in-between ARKODE at the "slow" time scale, and + the inner-steppers that comprise the MRI time-step evolution. + Since ARKODE itself only calls single-scale controller + functions (e.g., EstimateStep and UpdateH), then this serves to + translate those single-rate controller functions to the multi- + rate context, leveraging MRIStep-specific knowledge of the + slow+fast time scale relationship to CALL multi-rate controller + functions (e.g., EstimateMRISteps, EstimateStepTol, UpdateMRIH, + and UpdateMRIHTol) provided by the underlying multi-rate + controller. + ===============================================================*/ + +typedef struct _mriStepControlContent +{ + ARKodeMem ark_mem; /* ARKODE memory pointer */ + ARKodeMRIStepMem step_mem; /* MRIStep memory pointer */ + SUNAdaptController C; /* attached controller pointer */ +}* mriStepControlContent; + +#define MRICONTROL_C(C) (((mriStepControlContent)(C->content))->C) +#define MRICONTROL_A(C) (((mriStepControlContent)(C->content))->ark_mem) +#define MRICONTROL_S(C) (((mriStepControlContent)(C->content))->step_mem) + +SUNAdaptController SUNAdaptController_MRIStep(ARKodeMem ark_mem, + SUNAdaptController C); +SUNAdaptController_Type SUNAdaptController_GetType_MRIStep(SUNAdaptController C); +SUNErrCode SUNAdaptController_EstimateStep_MRIStep(SUNAdaptController C, + sunrealtype H, int P, + sunrealtype DSM, + sunrealtype* Hnew); +SUNErrCode SUNAdaptController_Reset_MRIStep(SUNAdaptController C); +SUNErrCode SUNAdaptController_Write_MRIStep(SUNAdaptController C, FILE* fptr); +SUNErrCode SUNAdaptController_UpdateH_MRIStep(SUNAdaptController C, + sunrealtype h, sunrealtype dsm); +SUNErrCode SUNAdaptController_Space_MRIStep(SUNAdaptController C, + long int* lenrw, long int* leniw); + /*=============================================================== Reusable MRIStep Error Messages ===============================================================*/ diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index f7b75eaf9f..b4ef0d31c6 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -222,10 +222,58 @@ int MRIStepGetLastInnerStepFlag(void* arkode_mem, int* flag) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + MRIStepGetNumInnerStepperFails: + + Returns the number of recoverable failures encountered by the + inner stepper. + ---------------------------------------------------------------*/ +int MRIStepGetNumInnerStepperFails(void* arkode_mem, long int* inner_fails) +{ + ARKodeMem ark_mem; + ARKodeMRIStepMem step_mem; + int retval; + + /* access ARKodeMem and ARKodeMRIStepMem structures */ + retval = mriStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* set output from step_mem */ + *inner_fails = step_mem->inner_fails; + + return (ARK_SUCCESS); +} + /*=============================================================== Private functions attached to ARKODE ===============================================================*/ +/*--------------------------------------------------------------- + mriStep_SetAdaptController: + + Specifies a temporal adaptivity controller for MRIStep to use. + If a non-MRI controller is provided, this just passes that + through to arkReplaceAdaptController. However, if an MRI + controller is provided, then this wraps that inside a + "SUNAdaptController_MRIStep" wrapper, which will properly + interact with the fast integration module. + ---------------------------------------------------------------*/ +int mriStep_SetAdaptController(ARKodeMem ark_mem, SUNAdaptController C) +{ + /* Retrieve the controller type */ + SUNAdaptController_Type ctype = SUNAdaptController_GetType(C); + + /* If this does not have MRI type, then just pass to ARKODE */ + if (ctype != SUN_ADAPTCONTROLLER_MRI_H_TOL) + { + return (arkReplaceAdaptController(ark_mem, C)); + } + + /* Create the mriStepControl wrapper, and pass that to ARKODE */ + SUNAdaptController Cwrapper = SUNAdaptController_MRIStep(ark_mem, C); + return (arkReplaceAdaptController(ark_mem, Cwrapper)); +} + /*--------------------------------------------------------------- mriStep_SetUserData: @@ -260,7 +308,8 @@ int mriStep_SetUserData(ARKodeMem ark_mem, void* user_data) int mriStep_SetDefaults(ARKodeMem ark_mem) { ARKodeMRIStepMem step_mem; - sunindextype lenrw, leniw; + sunindextype Clenrw, Cleniw; + long int lenrw, leniw; int retval; /* access ARKodeMRIStepMem structure */ @@ -293,12 +342,47 @@ int mriStep_SetDefaults(ARKodeMem ark_mem) /* Remove pre-existing coupling table */ if (step_mem->MRIC) { - MRIStepCoupling_Space(step_mem->MRIC, &leniw, &lenrw); - ark_mem->lrw -= lenrw; - ark_mem->liw -= leniw; + MRIStepCoupling_Space(step_mem->MRIC, &Cleniw, &Clenrw); + ark_mem->lrw -= Clenrw; + ark_mem->liw -= Cleniw; MRIStepCoupling_Free(step_mem->MRIC); } step_mem->MRIC = NULL; + + /* Remove pre-existing SUNAdaptController object, and replace with "I" */ + if (ark_mem->hadapt_mem->owncontroller) + { + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw -= leniw; + ark_mem->lrw -= lenrw; + } + retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller); + ark_mem->hadapt_mem->owncontroller = SUNFALSE; + if (retval != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_Destroy failure"); + return (ARK_MEM_FAIL); + } + } + ark_mem->hadapt_mem->hcontroller = SUNAdaptController_I(ark_mem->sunctx); + if (ark_mem->hadapt_mem->hcontroller == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "SUNAdaptController_I allocation failure"); + return (ARK_MEM_FAIL); + } + ark_mem->hadapt_mem->owncontroller = SUNTRUE; + retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, + &leniw); + if (retval == SUN_SUCCESS) + { + ark_mem->liw += leniw; + ark_mem->lrw += lenrw; + } return (ARK_SUCCESS); } @@ -624,6 +708,29 @@ int mriStep_GetCurrentGamma(ARKodeMem ark_mem, sunrealtype* gamma) return (retval); } +/*--------------------------------------------------------------- + mriStep_GetEstLocalErrors: Returns the current local truncation + error estimate vector + ---------------------------------------------------------------*/ +int mriStep_GetEstLocalErrors(ARKodeMem ark_mem, N_Vector ele) +{ + int retval; + ARKodeMRIStepMem step_mem; + retval = mriStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* return an error if local truncation error is not computed */ + if ((ark_mem->fixedstep && (ark_mem->AccumErrorType == ARK_ACCUMERROR_NONE)) || + (step_mem->p <= 0)) + { + return (ARK_STEPPER_UNSUPPORTED); + } + + /* otherwise, copy local truncation error vector to output */ + N_VScale(ONE, ark_mem->tempv1, ele); + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- mriStep_GetNumLinSolvSetups: @@ -726,7 +833,9 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) fprintf(outfile, "Explicit slow RHS fn evals = %ld\n", step_mem->nfse); fprintf(outfile, "Implicit slow RHS fn evals = %ld\n", step_mem->nfsi); - /* nonlinear solver stats */ + /* inner stepper and nonlinear solver stats */ + fprintf(outfile, "Inner stepper failures = %ld\n", + step_mem->inner_fails); fprintf(outfile, "NLS iters = %ld\n", step_mem->nls_iters); fprintf(outfile, "NLS fails = %ld\n", step_mem->nls_fails); if (ark_mem->nst > 0) @@ -767,7 +876,8 @@ int mriStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, SUNOutputFormat fmt) fprintf(outfile, ",Explicit slow RHS fn evals,%ld", step_mem->nfse); fprintf(outfile, ",Implicit slow RHS fn evals,%ld", step_mem->nfsi); - /* nonlinear solver stats */ + /* inner stepper and nonlinear solver stats */ + fprintf(outfile, ",Inner stepper failures,%ld", step_mem->inner_fails); fprintf(outfile, ",NLS iters,%ld", step_mem->nls_iters); fprintf(outfile, ",NLS fails,%ld", step_mem->nls_fails); if (ark_mem->nst > 0) diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 6c3cf4a669..4e4ff84465 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -362,7 +362,8 @@ void sprkStep_Free(ARKodeMem ark_mem) With initialization type RESET_INIT, this routine does nothing. ---------------------------------------------------------------*/ -int sprkStep_Init(ARKodeMem ark_mem, int init_type) +int sprkStep_Init(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tout, + int init_type) { ARKodeSPRKStepMem step_mem = NULL; int retval = 0; diff --git a/src/arkode/arkode_sprkstep_impl.h b/src/arkode/arkode_sprkstep_impl.h index d94f5c5c80..543adc5ef5 100644 --- a/src/arkode/arkode_sprkstep_impl.h +++ b/src/arkode/arkode_sprkstep_impl.h @@ -67,7 +67,7 @@ typedef struct ARKodeSPRKStepMemRec ===============================================================*/ /* Interface routines supplied to ARKODE */ -int sprkStep_Init(ARKodeMem ark_mem, int init_type); +int sprkStep_Init(ARKodeMem ark_mem, sunrealtype tout, int init_type); int sprkStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, N_Vector f, int mode); int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr); diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c index 4bfdf17364..77798fc2b7 100644 --- a/src/arkode/fmod_int32/farkode_mod.c +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -353,6 +353,20 @@ SWIGEXPORT int _wrap_FARKodeReset(void *farg1, double const *farg2, N_Vector far } +SWIGEXPORT int _wrap_FARKodeCreateMRIStepInnerStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)ARKodeCreateMRIStepInnerStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -1139,6 +1153,32 @@ SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) } +SWIGEXPORT int _wrap_FARKodeSetAccumulatedErrorType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKAccumError arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKAccumError)(*farg2); + result = (int)ARKodeSetAccumulatedErrorType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResetAccumulatedError(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeResetAccumulatedError(arg1); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; @@ -1500,6 +1540,20 @@ SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3 } +SWIGEXPORT int _wrap_FARKodeGetAccumulatedError(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetAccumulatedError(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 3cd700fa7e..ce6af7d24f 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -105,8 +105,18 @@ module farkode_mod end enum integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON + ! typedef enum ARKAccumError + enum, bind(c) + enumerator :: ARK_ACCUMERROR_NONE + enumerator :: ARK_ACCUMERROR_MAX + enumerator :: ARK_ACCUMERROR_SUM + enumerator :: ARK_ACCUMERROR_AVG + end enum + integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) + public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset + public :: FARKodeCreateMRIStepInnerStepper public :: FARKodeSStolerances public :: FARKodeSVtolerances public :: FARKodeWFtolerances @@ -163,6 +173,8 @@ module farkode_mod public :: FARKodeSetMinStep public :: FARKodeSetMaxStep public :: FARKodeSetMaxNumConstrFails + public :: FARKodeSetAccumulatedErrorType + public :: FARKodeResetAccumulatedError public :: FARKodeEvolve public :: FARKodeGetDky public :: FARKodeComputeState @@ -191,6 +203,7 @@ module farkode_mod public :: FARKodeGetTolScaleFactor public :: FARKodeGetNumConstrFails public :: FARKodeGetStepStats + public :: FARKodeGetAccumulatedError public :: FARKodeGetNumLinSolvSetups public :: FARKodeGetCurrentTime public :: FARKodeGetCurrentState @@ -486,6 +499,15 @@ function swigc_FARKodeReset(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FARKodeCreateMRIStepInnerStepper(farg1, farg2) & +bind(C, name="_wrap_FARKodeCreateMRIStepInnerStepper") & +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_FARKodeSStolerances(farg1, farg2, farg3) & bind(C, name="_wrap_FARKodeSStolerances") & result(fresult) @@ -991,6 +1013,23 @@ function swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeSetAccumulatedErrorType(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAccumulatedErrorType") & +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_FARKodeResetAccumulatedError(farg1) & +bind(C, name="_wrap_FARKodeResetAccumulatedError") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + function swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FARKodeEvolve") & result(fresult) @@ -1225,6 +1264,15 @@ function swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetAccumulatedError(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetAccumulatedError") & +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_FARKodeGetNumLinSolvSetups(farg1, farg2) & bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & result(fresult) @@ -2440,6 +2488,22 @@ function FARKodeReset(arkode_mem, tr, yr) & swig_result = fresult end function +function FARKodeCreateMRIStepInnerStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKodeCreateMRIStepInnerStepper(farg1, farg2) +swig_result = fresult +end function + function FARKodeSStolerances(arkode_mem, reltol, abstol) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3339,6 +3403,35 @@ function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & swig_result = fresult end function +function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKAccumError), intent(in) :: accum_type +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = accum_type +fresult = swigc_FARKodeSetAccumulatedErrorType(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResetAccumulatedError(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeResetAccumulatedError(farg1) +swig_result = fresult +end function + function FARKodeEvolve(arkode_mem, tout, yout, tret, itask) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3774,6 +3867,22 @@ function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & swig_result = fresult end function +function FARKodeGetAccumulatedError(arkode_mem, accum_error) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: accum_error +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accum_error(1)) +fresult = swigc_FARKodeGetAccumulatedError(farg1, farg2) +swig_result = fresult +end function + function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.c b/src/arkode/fmod_int32/farkode_mristep_mod.c index b454003c6d..378b438a2c 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.c +++ b/src/arkode/fmod_int32/farkode_mristep_mod.c @@ -308,6 +308,30 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { return result; } +SWIGEXPORT void _wrap_MRIStepCouplingMem_type_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + MRISTEP_METHOD_TYPE arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::type", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (MRISTEP_METHOD_TYPE)(*farg2); + if (arg1) (arg1)->type = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_type_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + MRISTEP_METHOD_TYPE result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::type", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (MRISTEP_METHOD_TYPE) ((arg1)->type); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void _wrap_MRIStepCouplingMem_nmat_set(SwigClassWrapper const *farg1, int const *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; int arg2 ; @@ -476,6 +500,54 @@ SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) } +SWIGEXPORT void _wrap_MRIStepCouplingMem_ngroup_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::ngroup", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->ngroup = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_ngroup_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::ngroup", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->ngroup); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_group_set(SwigClassWrapper const *farg1, void *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int **arg2 = (int **) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::group", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int **)(farg2); + if (arg1) (arg1)->group = arg2; +} + + +SWIGEXPORT void * _wrap_MRIStepCouplingMem_group_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int **result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::group", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int **) ((arg1)->group); + fresult = result; + return fresult; +} + + SWIGEXPORT SwigClassWrapper _wrap_new_MRIStepCouplingMem() { SwigClassWrapper fresult ; struct MRIStepCouplingMem *result = 0 ; @@ -741,6 +813,20 @@ SWIGEXPORT int _wrap_FMRIStepGetLastInnerStepFlag(void *farg1, int *farg2) { } +SWIGEXPORT int _wrap_FMRIStepGetNumInnerStepperFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumInnerStepperFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { int fresult ; SUNContext arg1 = (SUNContext) 0 ; @@ -851,6 +937,48 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerRe } +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(void *farg1, MRIStepInnerGetAccumulatedError farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerGetAccumulatedError arg2 = (MRIStepInnerGetAccumulatedError) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerGetAccumulatedError)(farg2); + result = (int)MRIStepInnerStepper_SetAccumulatedErrorGetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(void *farg1, MRIStepInnerResetAccumulatedError farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerResetAccumulatedError arg2 = (MRIStepInnerResetAccumulatedError) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerResetAccumulatedError)(farg2); + result = (int)MRIStepInnerStepper_SetAccumulatedErrorResetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetRTolFn(void *farg1, MRIStepInnerSetRTol farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerSetRTol arg2 = (MRIStepInnerSetRTol) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerSetRTol)(farg2); + result = (int)MRIStepInnerStepper_SetRTolFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index 9505d486cb..6d50d60f17 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -31,9 +31,11 @@ module farkode_mristep_mod enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT enumerator :: MRISTEP_IMEX + enumerator :: MRISTEP_MERK + enumerator :: MRISTEP_SR end enum integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) - public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX + public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR ! typedef enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 @@ -57,7 +59,14 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_GARK_EULER enumerator :: ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL enumerator :: ARKODE_IMEX_MRI_GARK_MIDPOINT - enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT + enumerator :: ARKODE_MERK21 + enumerator :: ARKODE_MERK32 + enumerator :: ARKODE_MERK43 + enumerator :: ARKODE_MERK54 + enumerator :: ARKODE_IMEX_MRI_SR21 + enumerator :: ARKODE_IMEX_MRI_SR32 + enumerator :: ARKODE_IMEX_MRI_SR43 + enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & @@ -65,11 +74,16 @@ module farkode_mristep_mod ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & ARKODE_MRI_GARK_ERK22a, ARKODE_MRI_GARK_ERK22b, ARKODE_MRI_GARK_RALSTON3, ARKODE_MRI_GARK_BACKWARD_EULER, & ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, ARKODE_IMEX_MRI_GARK_EULER, ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, & - ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MAX_MRI_NUM + ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MERK21, ARKODE_MERK32, ARKODE_MERK43, ARKODE_MERK54, ARKODE_IMEX_MRI_SR21, & + ARKODE_IMEX_MRI_SR32, ARKODE_IMEX_MRI_SR43, ARKODE_MAX_MRI_NUM integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3 integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2_AD = ARKODE_MRI_GARK_ERK22b + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3_AD = ARKODE_MRI_GARK_ERK33a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4_AD = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_5_AD = ARKODE_MERK54 integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a @@ -78,6 +92,9 @@ module farkode_mristep_mod integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2_AD = ARKODE_IMEX_MRI_SR21 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3_AD = ARKODE_IMEX_MRI_SR32 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4_AD = ARKODE_IMEX_MRI_SR43 integer, parameter :: swig_cmem_own_bit = 0 integer, parameter :: swig_cmem_rvalue_bit = 1 @@ -90,6 +107,8 @@ module farkode_mristep_mod type, public :: MRIStepCouplingMem type(SwigClassWrapper), public :: swigdata contains + procedure :: set_type => swigf_MRIStepCouplingMem_type_set + procedure :: get_type => swigf_MRIStepCouplingMem_type_get procedure :: set_nmat => swigf_MRIStepCouplingMem_nmat_set procedure :: get_nmat => swigf_MRIStepCouplingMem_nmat_get procedure :: set_stages => swigf_MRIStepCouplingMem_stages_set @@ -104,6 +123,10 @@ module farkode_mristep_mod procedure :: get_W => swigf_MRIStepCouplingMem_W_get procedure :: set_G => swigf_MRIStepCouplingMem_G_set procedure :: get_G => swigf_MRIStepCouplingMem_G_get + procedure :: set_ngroup => swigf_MRIStepCouplingMem_ngroup_set + procedure :: get_ngroup => swigf_MRIStepCouplingMem_ngroup_get + procedure :: set_group => swigf_MRIStepCouplingMem_group_set + procedure :: get_group => swigf_MRIStepCouplingMem_group_get procedure :: release => swigf_release_MRIStepCouplingMem procedure, private :: swigf_MRIStepCouplingMem_op_assign__ generic :: assignment(=) => swigf_MRIStepCouplingMem_op_assign__ @@ -131,6 +154,7 @@ module farkode_mristep_mod public :: FMRIStepSetPostInnerFn public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag + public :: FMRIStepGetNumInnerStepperFails public :: FMRIStepInnerStepper_Create public :: FMRIStepInnerStepper_CreateFromSUNStepper public :: FMRIStepInnerStepper_Free @@ -139,6 +163,9 @@ module farkode_mristep_mod public :: FMRIStepInnerStepper_SetEvolveFn public :: FMRIStepInnerStepper_SetFullRhsFn public :: FMRIStepInnerStepper_SetResetFn + public :: FMRIStepInnerStepper_SetAccumulatedErrorGetFn + public :: FMRIStepInnerStepper_SetAccumulatedErrorResetFn + public :: FMRIStepInnerStepper_SetRTolFn public :: FMRIStepInnerStepper_AddForcing public :: FMRIStepInnerStepper_GetForcingData public :: FMRIStepResize @@ -230,6 +257,23 @@ module farkode_mristep_mod ! WRAPPER DECLARATIONS interface +subroutine swigc_MRIStepCouplingMem_type_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_type_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_type_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_type_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + subroutine swigc_MRIStepCouplingMem_nmat_set(farg1, farg2) & bind(C, name="_wrap_MRIStepCouplingMem_nmat_set") use, intrinsic :: ISO_C_BINDING @@ -349,6 +393,40 @@ function swigc_MRIStepCouplingMem_G_get(farg1) & type(C_PTR) :: fresult end function +subroutine swigc_MRIStepCouplingMem_ngroup_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_ngroup_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_ngroup_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_ngroup_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_group_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_group_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_group_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_group_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + function swigc_new_MRIStepCouplingMem() & bind(C, name="_wrap_new_MRIStepCouplingMem") & result(fresult) @@ -522,6 +600,15 @@ function swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepGetNumInnerStepperFails(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumInnerStepperFails") & +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_FMRIStepInnerStepper_Create(farg1, farg2) & bind(C, name="_wrap_FMRIStepInnerStepper_Create") & result(fresult) @@ -593,6 +680,33 @@ function swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetAccumulatedErrorGetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetAccumulatedErrorResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetRTolFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetRTolFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) & bind(C, name="_wrap_FMRIStepInnerStepper_AddForcing") & result(fresult) @@ -1417,6 +1531,31 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & contains ! MODULE SUBPROGRAMS +subroutine swigf_MRIStepCouplingMem_type_set(self, type) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(MRISTEP_METHOD_TYPE), intent(in) :: type +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = type +call swigc_MRIStepCouplingMem_type_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_type_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(MRISTEP_METHOD_TYPE) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_type_get(farg1) +swig_result = fresult +end function + subroutine swigf_MRIStepCouplingMem_nmat_set(self, nmat) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self @@ -1592,6 +1731,56 @@ function swigf_MRIStepCouplingMem_G_get(self) & call c_f_pointer(fresult, swig_result) end function +subroutine swigf_MRIStepCouplingMem_ngroup_set(self, ngroup) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: ngroup +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = ngroup +call swigc_MRIStepCouplingMem_ngroup_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_ngroup_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_ngroup_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_group_set(self, group) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: group +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(group) +call swigc_MRIStepCouplingMem_group_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_group_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_group_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + function swigf_create_MRIStepCouplingMem() & result(self) use, intrinsic :: ISO_C_BINDING @@ -1925,6 +2114,22 @@ function FMRIStepGetLastInnerStepFlag(arkode_mem, flag) & swig_result = fresult end function +function FMRIStepGetNumInnerStepperFails(arkode_mem, inner_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: inner_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(inner_fails(1)) +fresult = swigc_FMRIStepGetNumInnerStepperFails(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_Create(sunctx, stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2050,6 +2255,54 @@ function FMRIStepInnerStepper_SetResetFn(stepper, fn) & swig_result = fresult end function +function FMRIStepInnerStepper_SetAccumulatedErrorGetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetAccumulatedErrorResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetRTolFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetRTolFn(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_AddForcing(stepper, t, f) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c index 5a63d50210..dcc19f5c3c 100644 --- a/src/arkode/fmod_int64/farkode_mod.c +++ b/src/arkode/fmod_int64/farkode_mod.c @@ -353,6 +353,20 @@ SWIGEXPORT int _wrap_FARKodeReset(void *farg1, double const *farg2, N_Vector far } +SWIGEXPORT int _wrap_FARKodeCreateMRIStepInnerStepper(void *farg1, void *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + MRIStepInnerStepper *arg2 = (MRIStepInnerStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (MRIStepInnerStepper *)(farg2); + result = (int)ARKodeCreateMRIStepInnerStepper(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeSStolerances(void *farg1, double const *farg2, double const *farg3) { int fresult ; void *arg1 = (void *) 0 ; @@ -1139,6 +1153,32 @@ SWIGEXPORT int _wrap_FARKodeSetMaxNumConstrFails(void *farg1, int const *farg2) } +SWIGEXPORT int _wrap_FARKodeSetAccumulatedErrorType(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + ARKAccumError arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (ARKAccumError)(*farg2); + result = (int)ARKodeSetAccumulatedErrorType(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FARKodeResetAccumulatedError(void *farg1) { + int fresult ; + void *arg1 = (void *) 0 ; + int result; + + arg1 = (void *)(farg1); + result = (int)ARKodeResetAccumulatedError(arg1); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeEvolve(void *farg1, double const *farg2, N_Vector farg3, double *farg4, int const *farg5) { int fresult ; void *arg1 = (void *) 0 ; @@ -1500,6 +1540,20 @@ SWIGEXPORT int _wrap_FARKodeGetStepStats(void *farg1, long *farg2, double *farg3 } +SWIGEXPORT int _wrap_FARKodeGetAccumulatedError(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetAccumulatedError(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetNumLinSolvSetups(void *farg1, long *farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index 3b255deb0d..9f15a8f8d7 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -105,8 +105,18 @@ module farkode_mod end enum integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON + ! typedef enum ARKAccumError + enum, bind(c) + enumerator :: ARK_ACCUMERROR_NONE + enumerator :: ARK_ACCUMERROR_MAX + enumerator :: ARK_ACCUMERROR_SUM + enumerator :: ARK_ACCUMERROR_AVG + end enum + integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) + public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset + public :: FARKodeCreateMRIStepInnerStepper public :: FARKodeSStolerances public :: FARKodeSVtolerances public :: FARKodeWFtolerances @@ -163,6 +173,8 @@ module farkode_mod public :: FARKodeSetMinStep public :: FARKodeSetMaxStep public :: FARKodeSetMaxNumConstrFails + public :: FARKodeSetAccumulatedErrorType + public :: FARKodeResetAccumulatedError public :: FARKodeEvolve public :: FARKodeGetDky public :: FARKodeComputeState @@ -191,6 +203,7 @@ module farkode_mod public :: FARKodeGetTolScaleFactor public :: FARKodeGetNumConstrFails public :: FARKodeGetStepStats + public :: FARKodeGetAccumulatedError public :: FARKodeGetNumLinSolvSetups public :: FARKodeGetCurrentTime public :: FARKodeGetCurrentState @@ -486,6 +499,15 @@ function swigc_FARKodeReset(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FARKodeCreateMRIStepInnerStepper(farg1, farg2) & +bind(C, name="_wrap_FARKodeCreateMRIStepInnerStepper") & +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_FARKodeSStolerances(farg1, farg2, farg3) & bind(C, name="_wrap_FARKodeSStolerances") & result(fresult) @@ -991,6 +1013,23 @@ function swigc_FARKodeSetMaxNumConstrFails(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeSetAccumulatedErrorType(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetAccumulatedErrorType") & +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_FARKodeResetAccumulatedError(farg1) & +bind(C, name="_wrap_FARKodeResetAccumulatedError") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + function swigc_FARKodeEvolve(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FARKodeEvolve") & result(fresult) @@ -1225,6 +1264,15 @@ function swigc_FARKodeGetStepStats(farg1, farg2, farg3, farg4, farg5, farg6) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetAccumulatedError(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetAccumulatedError") & +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_FARKodeGetNumLinSolvSetups(farg1, farg2) & bind(C, name="_wrap_FARKodeGetNumLinSolvSetups") & result(fresult) @@ -2440,6 +2488,22 @@ function FARKodeReset(arkode_mem, tr, yr) & swig_result = fresult end function +function FARKodeCreateMRIStepInnerStepper(arkode_mem, stepper) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: stepper +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepper) +fresult = swigc_FARKodeCreateMRIStepInnerStepper(farg1, farg2) +swig_result = fresult +end function + function FARKodeSStolerances(arkode_mem, reltol, abstol) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3339,6 +3403,35 @@ function FARKodeSetMaxNumConstrFails(arkode_mem, maxfails) & swig_result = fresult end function +function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(ARKAccumError), intent(in) :: accum_type +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = accum_type +fresult = swigc_FARKodeSetAccumulatedErrorType(farg1, farg2) +swig_result = fresult +end function + +function FARKodeResetAccumulatedError(arkode_mem) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = arkode_mem +fresult = swigc_FARKodeResetAccumulatedError(farg1) +swig_result = fresult +end function + function FARKodeEvolve(arkode_mem, tout, yout, tret, itask) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3774,6 +3867,22 @@ function FARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) & swig_result = fresult end function +function FARKodeGetAccumulatedError(arkode_mem, accum_error) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: accum_error +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(accum_error(1)) +fresult = swigc_FARKodeGetAccumulatedError(farg1, farg2) +swig_result = fresult +end function + function FARKodeGetNumLinSolvSetups(arkode_mem, nlinsetups) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.c b/src/arkode/fmod_int64/farkode_mristep_mod.c index d5597bea4f..303a28af2f 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.c +++ b/src/arkode/fmod_int64/farkode_mristep_mod.c @@ -308,6 +308,30 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { return result; } +SWIGEXPORT void _wrap_MRIStepCouplingMem_type_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + MRISTEP_METHOD_TYPE arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::type", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (MRISTEP_METHOD_TYPE)(*farg2); + if (arg1) (arg1)->type = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_type_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + MRISTEP_METHOD_TYPE result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::type", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (MRISTEP_METHOD_TYPE) ((arg1)->type); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void _wrap_MRIStepCouplingMem_nmat_set(SwigClassWrapper const *farg1, int const *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; int arg2 ; @@ -476,6 +500,54 @@ SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) } +SWIGEXPORT void _wrap_MRIStepCouplingMem_ngroup_set(SwigClassWrapper const *farg1, int const *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::ngroup", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->ngroup = arg2; +} + + +SWIGEXPORT int _wrap_MRIStepCouplingMem_ngroup_get(SwigClassWrapper const *farg1) { + int fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::ngroup", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int) ((arg1)->ngroup); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_MRIStepCouplingMem_group_set(SwigClassWrapper const *farg1, void *farg2) { + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int **arg2 = (int **) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::group", return ); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + arg2 = (int **)(farg2); + if (arg1) (arg1)->group = arg2; +} + + +SWIGEXPORT void * _wrap_MRIStepCouplingMem_group_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; + int **result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::group", return 0); + arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); + result = (int **) ((arg1)->group); + fresult = result; + return fresult; +} + + SWIGEXPORT SwigClassWrapper _wrap_new_MRIStepCouplingMem() { SwigClassWrapper fresult ; struct MRIStepCouplingMem *result = 0 ; @@ -741,6 +813,20 @@ SWIGEXPORT int _wrap_FMRIStepGetLastInnerStepFlag(void *farg1, int *farg2) { } +SWIGEXPORT int _wrap_FMRIStepGetNumInnerStepperFails(void *farg1, long *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + long *arg2 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (long *)(farg2); + result = (int)MRIStepGetNumInnerStepperFails(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_Create(void *farg1, void *farg2) { int fresult ; SUNContext arg1 = (SUNContext) 0 ; @@ -851,6 +937,48 @@ SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetResetFn(void *farg1, MRIStepInnerRe } +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(void *farg1, MRIStepInnerGetAccumulatedError farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerGetAccumulatedError arg2 = (MRIStepInnerGetAccumulatedError) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerGetAccumulatedError)(farg2); + result = (int)MRIStepInnerStepper_SetAccumulatedErrorGetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(void *farg1, MRIStepInnerResetAccumulatedError farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerResetAccumulatedError arg2 = (MRIStepInnerResetAccumulatedError) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerResetAccumulatedError)(farg2); + result = (int)MRIStepInnerStepper_SetAccumulatedErrorResetFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FMRIStepInnerStepper_SetRTolFn(void *farg1, MRIStepInnerSetRTol farg2) { + int fresult ; + MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; + MRIStepInnerSetRTol arg2 = (MRIStepInnerSetRTol) 0 ; + int result; + + arg1 = (MRIStepInnerStepper)(farg1); + arg2 = (MRIStepInnerSetRTol)(farg2); + result = (int)MRIStepInnerStepper_SetRTolFn(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FMRIStepInnerStepper_AddForcing(void *farg1, double const *farg2, N_Vector farg3) { int fresult ; MRIStepInnerStepper arg1 = (MRIStepInnerStepper) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index e2202c73da..2563b41dd7 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -31,9 +31,11 @@ module farkode_mristep_mod enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT enumerator :: MRISTEP_IMEX + enumerator :: MRISTEP_MERK + enumerator :: MRISTEP_SR end enum integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) - public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX + public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR ! typedef enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 @@ -57,7 +59,14 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_GARK_EULER enumerator :: ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL enumerator :: ARKODE_IMEX_MRI_GARK_MIDPOINT - enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_GARK_MIDPOINT + enumerator :: ARKODE_MERK21 + enumerator :: ARKODE_MERK32 + enumerator :: ARKODE_MERK43 + enumerator :: ARKODE_MERK54 + enumerator :: ARKODE_IMEX_MRI_SR21 + enumerator :: ARKODE_IMEX_MRI_SR32 + enumerator :: ARKODE_IMEX_MRI_SR43 + enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & @@ -65,11 +74,16 @@ module farkode_mristep_mod ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & ARKODE_MRI_GARK_ERK22a, ARKODE_MRI_GARK_ERK22b, ARKODE_MRI_GARK_RALSTON3, ARKODE_MRI_GARK_BACKWARD_EULER, & ARKODE_MRI_GARK_IMPLICIT_MIDPOINT, ARKODE_IMEX_MRI_GARK_EULER, ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL, & - ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MAX_MRI_NUM + ARKODE_IMEX_MRI_GARK_MIDPOINT, ARKODE_MERK21, ARKODE_MERK32, ARKODE_MERK43, ARKODE_MERK54, ARKODE_IMEX_MRI_SR21, & + ARKODE_IMEX_MRI_SR32, ARKODE_IMEX_MRI_SR43, ARKODE_MAX_MRI_NUM integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2 = ARKODE_MRI_GARK_ERK22b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3 = ARKODE_MIS_KW3 integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4 = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_2_AD = ARKODE_MRI_GARK_ERK22b + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_3_AD = ARKODE_MRI_GARK_ERK33a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_4_AD = ARKODE_MRI_GARK_ERK45a + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_EXPL_5_AD = ARKODE_MERK54 integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_1 = ARKODE_MRI_GARK_BACKWARD_EULER integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_2 = ARKODE_MRI_GARK_IRK21a integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMPL_SD_3 = ARKODE_MRI_GARK_ESDIRK34a @@ -78,6 +92,9 @@ module farkode_mristep_mod integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2 = ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3 = ARKODE_IMEX_MRI_GARK3b integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4 = ARKODE_IMEX_MRI_GARK4 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_2_AD = ARKODE_IMEX_MRI_SR21 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_3_AD = ARKODE_IMEX_MRI_SR32 + integer(C_INT), parameter, public :: MRISTEP_DEFAULT_IMEX_SD_4_AD = ARKODE_IMEX_MRI_SR43 integer, parameter :: swig_cmem_own_bit = 0 integer, parameter :: swig_cmem_rvalue_bit = 1 @@ -90,6 +107,8 @@ module farkode_mristep_mod type, public :: MRIStepCouplingMem type(SwigClassWrapper), public :: swigdata contains + procedure :: set_type => swigf_MRIStepCouplingMem_type_set + procedure :: get_type => swigf_MRIStepCouplingMem_type_get procedure :: set_nmat => swigf_MRIStepCouplingMem_nmat_set procedure :: get_nmat => swigf_MRIStepCouplingMem_nmat_get procedure :: set_stages => swigf_MRIStepCouplingMem_stages_set @@ -104,6 +123,10 @@ module farkode_mristep_mod procedure :: get_W => swigf_MRIStepCouplingMem_W_get procedure :: set_G => swigf_MRIStepCouplingMem_G_set procedure :: get_G => swigf_MRIStepCouplingMem_G_get + procedure :: set_ngroup => swigf_MRIStepCouplingMem_ngroup_set + procedure :: get_ngroup => swigf_MRIStepCouplingMem_ngroup_get + procedure :: set_group => swigf_MRIStepCouplingMem_group_set + procedure :: get_group => swigf_MRIStepCouplingMem_group_get procedure :: release => swigf_release_MRIStepCouplingMem procedure, private :: swigf_MRIStepCouplingMem_op_assign__ generic :: assignment(=) => swigf_MRIStepCouplingMem_op_assign__ @@ -131,6 +154,7 @@ module farkode_mristep_mod public :: FMRIStepSetPostInnerFn public :: FMRIStepGetCurrentCoupling public :: FMRIStepGetLastInnerStepFlag + public :: FMRIStepGetNumInnerStepperFails public :: FMRIStepInnerStepper_Create public :: FMRIStepInnerStepper_CreateFromSUNStepper public :: FMRIStepInnerStepper_Free @@ -139,6 +163,9 @@ module farkode_mristep_mod public :: FMRIStepInnerStepper_SetEvolveFn public :: FMRIStepInnerStepper_SetFullRhsFn public :: FMRIStepInnerStepper_SetResetFn + public :: FMRIStepInnerStepper_SetAccumulatedErrorGetFn + public :: FMRIStepInnerStepper_SetAccumulatedErrorResetFn + public :: FMRIStepInnerStepper_SetRTolFn public :: FMRIStepInnerStepper_AddForcing public :: FMRIStepInnerStepper_GetForcingData public :: FMRIStepResize @@ -230,6 +257,23 @@ module farkode_mristep_mod ! WRAPPER DECLARATIONS interface +subroutine swigc_MRIStepCouplingMem_type_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_type_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_type_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_type_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + subroutine swigc_MRIStepCouplingMem_nmat_set(farg1, farg2) & bind(C, name="_wrap_MRIStepCouplingMem_nmat_set") use, intrinsic :: ISO_C_BINDING @@ -349,6 +393,40 @@ function swigc_MRIStepCouplingMem_G_get(farg1) & type(C_PTR) :: fresult end function +subroutine swigc_MRIStepCouplingMem_ngroup_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_ngroup_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_ngroup_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_ngroup_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_MRIStepCouplingMem_group_set(farg1, farg2) & +bind(C, name="_wrap_MRIStepCouplingMem_group_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_MRIStepCouplingMem_group_get(farg1) & +bind(C, name="_wrap_MRIStepCouplingMem_group_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + function swigc_new_MRIStepCouplingMem() & bind(C, name="_wrap_new_MRIStepCouplingMem") & result(fresult) @@ -522,6 +600,15 @@ function swigc_FMRIStepGetLastInnerStepFlag(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepGetNumInnerStepperFails(farg1, farg2) & +bind(C, name="_wrap_FMRIStepGetNumInnerStepperFails") & +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_FMRIStepInnerStepper_Create(farg1, farg2) & bind(C, name="_wrap_FMRIStepInnerStepper_Create") & result(fresult) @@ -593,6 +680,33 @@ function swigc_FMRIStepInnerStepper_SetResetFn(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetAccumulatedErrorGetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetAccumulatedErrorResetFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FMRIStepInnerStepper_SetRTolFn(farg1, farg2) & +bind(C, name="_wrap_FMRIStepInnerStepper_SetRTolFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FMRIStepInnerStepper_AddForcing(farg1, farg2, farg3) & bind(C, name="_wrap_FMRIStepInnerStepper_AddForcing") & result(fresult) @@ -1417,6 +1531,31 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & contains ! MODULE SUBPROGRAMS +subroutine swigf_MRIStepCouplingMem_type_set(self, type) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(MRISTEP_METHOD_TYPE), intent(in) :: type +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = type +call swigc_MRIStepCouplingMem_type_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_type_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(MRISTEP_METHOD_TYPE) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_type_get(farg1) +swig_result = fresult +end function + subroutine swigf_MRIStepCouplingMem_nmat_set(self, nmat) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self @@ -1592,6 +1731,56 @@ function swigf_MRIStepCouplingMem_G_get(self) & call c_f_pointer(fresult, swig_result) end function +subroutine swigf_MRIStepCouplingMem_ngroup_set(self, ngroup) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT), intent(in) :: ngroup +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = ngroup +call swigc_MRIStepCouplingMem_ngroup_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_ngroup_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_ngroup_get(farg1) +swig_result = fresult +end function + +subroutine swigf_MRIStepCouplingMem_group_set(self, group) +use, intrinsic :: ISO_C_BINDING +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: group +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(group) +call swigc_MRIStepCouplingMem_group_set(farg1, farg2) +end subroutine + +function swigf_MRIStepCouplingMem_group_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(MRIStepCouplingMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_MRIStepCouplingMem_group_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + function swigf_create_MRIStepCouplingMem() & result(self) use, intrinsic :: ISO_C_BINDING @@ -1925,6 +2114,22 @@ function FMRIStepGetLastInnerStepFlag(arkode_mem, flag) & swig_result = fresult end function +function FMRIStepGetNumInnerStepperFails(arkode_mem, inner_fails) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_LONG), dimension(*), target, intent(inout) :: inner_fails +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(inner_fails(1)) +fresult = swigc_FMRIStepGetNumInnerStepperFails(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_Create(sunctx, stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -2050,6 +2255,54 @@ function FMRIStepInnerStepper_SetResetFn(stepper, fn) & swig_result = fresult end function +function FMRIStepInnerStepper_SetAccumulatedErrorGetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetAccumulatedErrorGetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetAccumulatedErrorResetFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetAccumulatedErrorResetFn(farg1, farg2) +swig_result = fresult +end function + +function FMRIStepInnerStepper_SetRTolFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FMRIStepInnerStepper_SetRTolFn(farg1, farg2) +swig_result = fresult +end function + function FMRIStepInnerStepper_AddForcing(stepper, t, f) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sunadaptcontroller/CMakeLists.txt b/src/sunadaptcontroller/CMakeLists.txt index f82df5e169..2a5c3db1a5 100644 --- a/src/sunadaptcontroller/CMakeLists.txt +++ b/src/sunadaptcontroller/CMakeLists.txt @@ -11,9 +11,10 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# controller level CMakeLists.txt for SUNDIALS +# adaptivity controller level CMakeLists.txt for SUNDIALS # ------------------------------------------------------------------------------ -# required native matrices +# required native adaptivity controllers add_subdirectory(imexgus) add_subdirectory(soderlind) +add_subdirectory(mrihtol) diff --git a/src/sunadaptcontroller/mrihtol/CMakeLists.txt b/src/sunadaptcontroller/mrihtol/CMakeLists.txt new file mode 100644 index 0000000000..1702a5f664 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/CMakeLists.txt @@ -0,0 +1,28 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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_sunadaptcontrollermrihtol + SOURCES sunadaptcontroller_mrihtol.c + HEADERS + ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunadaptcontroller + OBJECT_LIB_ONLY) + +# Add F2003 module if the interface is enabled +if(BUILD_FORTRAN_MODULE_INTERFACE) + add_subdirectory("fmod_int${SUNDIALS_INDEX_SIZE}") +endif() diff --git a/src/sunadaptcontroller/mrihtol/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/mrihtol/fmod_int32/CMakeLists.txt new file mode 100644 index 0000000000..befc6cb2ed --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int32/CMakeLists.txt @@ -0,0 +1,21 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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_fsunadaptcontrollermrihtol_mod + SOURCES fsunadaptcontroller_mrihtol_mod.f90 fsunadaptcontroller_mrihtol_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollermrihtol_mod OBJECT_LIB_ONLY) + +message(STATUS "Added SUNAdaptController_MRIHTol F2003 interface") diff --git a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.c b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.c new file mode 100644 index 0000000000..f01662c5a8 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.c @@ -0,0 +1,639 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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_mrihtol.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +#include <string.h> + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__HControl_set(SwigClassWrapper const *farg1, SUNAdaptController farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::HControl", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (SUNAdaptController)(farg2); + if (arg1) (arg1)->HControl = arg2; +} + + +SWIGEXPORT SUNAdaptController _wrap_SUNAdaptControllerContent_MRIHTol__HControl_get(SwigClassWrapper const *farg1) { + SUNAdaptController fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::HControl", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (SUNAdaptController) ((arg1)->HControl); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__TolControl_set(SwigClassWrapper const *farg1, SUNAdaptController farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::TolControl", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (SUNAdaptController)(farg2); + if (arg1) (arg1)->TolControl = arg2; +} + + +SWIGEXPORT SUNAdaptController _wrap_SUNAdaptControllerContent_MRIHTol__TolControl_get(SwigClassWrapper const *farg1) { + SUNAdaptController fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::TolControl", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (SUNAdaptController) ((arg1)->TolControl); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_relch", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_max_relch = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_relch", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_max_relch); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_min_tolfac", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_min_tolfac = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_min_tolfac", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_min_tolfac); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_tolfac", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_max_tolfac = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_tolfac", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_max_tolfac); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_SUNAdaptControllerContent_MRIHTol_() { + SwigClassWrapper fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *result = 0 ; + + result = (struct SUNAdaptControllerContent_MRIHTol_ *)calloc(1, sizeof(struct SUNAdaptControllerContent_MRIHTol_)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_SUNAdaptControllerContent_MRIHTol_(SwigClassWrapper *farg1) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + + SWIG_check_mutable(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::~SUNAdaptControllerContent_MRIHTol_()", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + struct SUNAdaptControllerContent_MRIHTol_ *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_MRIHTol(SUNAdaptController farg1, SUNAdaptController farg2, void *farg3) { + SUNAdaptController fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNAdaptController)SUNAdaptController_MRIHTol(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_MRIHTol(SUNAdaptController farg1, double const *farg2, double const *farg3, double const *farg4) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (SUNErrCode)SUNAdaptController_SetParams_MRIHTol(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetSlowController_MRIHTol(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController *arg2 = (SUNAdaptController *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController *)(farg2); + result = (SUNErrCode)SUNAdaptController_GetSlowController_MRIHTol(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetFastController_MRIHTol(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController *arg2 = (SUNAdaptController *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController *)(farg2); + result = (SUNErrCode)SUNAdaptController_GetFastController_MRIHTol(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetType_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController_Type result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNAdaptController_Type)SUNAdaptController_GetType_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStepTol_MRIHTol(SUNAdaptController farg1, double const *farg2, double const *farg3, int const *farg4, double const *farg5, double const *farg6, double *farg7, double *farg8) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int arg4 ; + sunrealtype arg5 ; + sunrealtype arg6 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (sunrealtype *)(farg8); + result = (int)SUNAdaptController_EstimateStepTol_MRIHTol(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Reset_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_SetDefaults_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_MRIHTol(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_MRIHTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_MRIHTol(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_MRIHTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateMRIHTol_MRIHTol(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_UpdateMRIHTol_MRIHTol(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Space_MRIHTol(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_MRIHTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 new file mode 100644 index 0000000000..5d38166728 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 @@ -0,0 +1,688 @@ +! 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-2024, 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_mrihtol_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct SUNAdaptControllerContent_MRIHTol_ + type, public :: SUNAdaptControllerContent_MRIHTol_ + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_HControl => swigf_SUNAdaptControllerContent_MRIHTol__HControl_set + procedure :: get_HControl => swigf_SUNAdaptControllerContent_MRIHTol__HControl_get + procedure :: set_TolControl => swigf_SUNAdaptControllerContent_MRIHTol__TolControl_set + procedure :: get_TolControl => swigf_SUNAdaptControllerContent_MRIHTol__TolControl_get + procedure :: set_inner_max_relch => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set + procedure :: get_inner_max_relch => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get + procedure :: set_inner_min_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set + procedure :: get_inner_min_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get + procedure :: set_inner_max_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set + procedure :: get_inner_max_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get + procedure :: release => swigf_release_SUNAdaptControllerContent_MRIHTol_ + procedure, private :: swigf_SUNAdaptControllerContent_MRIHTol__op_assign__ + generic :: assignment(=) => swigf_SUNAdaptControllerContent_MRIHTol__op_assign__ + end type SUNAdaptControllerContent_MRIHTol_ + interface SUNAdaptControllerContent_MRIHTol_ + module procedure swigf_create_SUNAdaptControllerContent_MRIHTol_ + end interface + public :: FSUNAdaptController_MRIHTol + public :: FSUNAdaptController_SetParams_MRIHTol + public :: FSUNAdaptController_GetSlowController_MRIHTol + public :: FSUNAdaptController_GetFastController_MRIHTol + public :: FSUNAdaptController_GetType_MRIHTol + public :: FSUNAdaptController_EstimateStepTol_MRIHTol + public :: FSUNAdaptController_Reset_MRIHTol + public :: FSUNAdaptController_SetDefaults_MRIHTol + public :: FSUNAdaptController_Write_MRIHTol + public :: FSUNAdaptController_SetErrorBias_MRIHTol + public :: FSUNAdaptController_UpdateMRIHTol_MRIHTol + public :: FSUNAdaptController_Space_MRIHTol + +! WRAPPER DECLARATIONS +interface +subroutine swigc_SUNAdaptControllerContent_MRIHTol__HControl_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__HControl_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__HControl_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__HControl_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__TolControl_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__TolControl_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__TolControl_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__TolControl_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_new_SUNAdaptControllerContent_MRIHTol_() & +bind(C, name="_wrap_new_SUNAdaptControllerContent_MRIHTol_") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_SUNAdaptControllerContent_MRIHTol_(farg1) & +bind(C, name="_wrap_delete_SUNAdaptControllerContent_MRIHTol_") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__op_assign__(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FSUNAdaptController_MRIHTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_MRIHTol(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_MRIHTol") & +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_GetSlowController_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_GetSlowController_MRIHTol") & +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_GetFastController_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_GetFastController_MRIHTol") & +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_GetType_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_GetType_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_EstimateStepTol_MRIHTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStepTol_MRIHTol") & +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), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +real(C_DOUBLE), intent(in) :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Reset_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Reset_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetDefaults_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_SetDefaults_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Write_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_Write_MRIHTol") & +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_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetErrorBias_MRIHTol") & +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_UpdateMRIHTol_MRIHTol(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_UpdateMRIHTol_MRIHTol") & +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_Space_MRIHTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_Space_MRIHTol") & +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 +subroutine swigf_SUNAdaptControllerContent_MRIHTol__HControl_set(self, hcontrol) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(SUNAdaptController), target, intent(inout) :: hcontrol +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(hcontrol) +call swigc_SUNAdaptControllerContent_MRIHTol__HControl_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__HControl_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__HControl_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__TolControl_set(self, tolcontrol) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(SUNAdaptController), target, intent(inout) :: tolcontrol +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(tolcontrol) +call swigc_SUNAdaptControllerContent_MRIHTol__TolControl_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__TolControl_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__TolControl_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(self, inner_max_relch) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_max_relch +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_max_relch +call swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(self, inner_min_tolfac) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_min_tolfac +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_min_tolfac +call swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(self, inner_max_tolfac) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_max_tolfac +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_max_tolfac +call swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(farg1) +swig_result = fresult +end function + +function swigf_create_SUNAdaptControllerContent_MRIHTol_() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptControllerContent_MRIHTol_) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_SUNAdaptControllerContent_MRIHTol_() +self%swigdata = fresult +end function + +subroutine swigf_release_SUNAdaptControllerContent_MRIHTol_(self) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_SUNAdaptControllerContent_MRIHTol_(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(inout) :: self +type(SUNAdaptControllerContent_MRIHTol_), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_SUNAdaptControllerContent_MRIHTol__op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FSUNAdaptController_MRIHTol(hcontrol, tolcontrol, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(SUNAdaptController), target, intent(inout) :: hcontrol +type(SUNAdaptController), target, intent(inout) :: tolcontrol +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(hcontrol) +farg2 = c_loc(tolcontrol) +farg3 = sunctx +fresult = swigc_FSUNAdaptController_MRIHTol(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_MRIHTol(c, inner_max_relch, inner_min_tolfac, inner_max_tolfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: inner_max_relch +real(C_DOUBLE), intent(in) :: inner_min_tolfac +real(C_DOUBLE), intent(in) :: inner_max_tolfac +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 = inner_max_relch +farg3 = inner_min_tolfac +farg4 = inner_max_tolfac +fresult = swigc_FSUNAdaptController_SetParams_MRIHTol(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNAdaptController_GetSlowController_MRIHTol(c, cslow) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR), target, intent(inout) :: cslow +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = c_loc(cslow) +fresult = swigc_FSUNAdaptController_GetSlowController_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR), target, intent(inout) :: cfast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = c_loc(cfast) +fresult = swigc_FSUNAdaptController_GetFastController_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_GetType_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_EstimateStepTol_MRIHTol(c, h, tolfac, p, dsm, dsm5, hnew, tolfacnew) & +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) :: tolfac +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm5 +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolfacnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +integer(C_INT) :: farg4 +real(C_DOUBLE) :: farg5 +real(C_DOUBLE) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = c_loc(c) +farg2 = h +farg3 = tolfac +farg4 = p +farg5 = dsm +farg6 = dsm5 +farg7 = c_loc(hnew(1)) +farg8 = c_loc(tolfacnew(1)) +fresult = swigc_FSUNAdaptController_EstimateStepTol_MRIHTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FSUNAdaptController_Reset_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_SetDefaults_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Write_MRIHTol(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_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_SetErrorBias_MRIHTol(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_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_UpdateMRIHTol_MRIHTol(c, h, tolfac, dsm, dsm4) & +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) :: tolfac +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm4 +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 = h +farg3 = tolfac +farg4 = dsm +farg5 = dsm4 +fresult = swigc_FSUNAdaptController_UpdateMRIHTol_MRIHTol(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_Space_MRIHTol(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_MRIHTol(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sunadaptcontroller/mrihtol/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/mrihtol/fmod_int64/CMakeLists.txt new file mode 100644 index 0000000000..befc6cb2ed --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int64/CMakeLists.txt @@ -0,0 +1,21 @@ +# --------------------------------------------------------------- +# Programmer(s): Daniel R. Reynolds @ SMU +# --------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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_fsunadaptcontrollermrihtol_mod + SOURCES fsunadaptcontroller_mrihtol_mod.f90 fsunadaptcontroller_mrihtol_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollermrihtol_mod OBJECT_LIB_ONLY) + +message(STATUS "Added SUNAdaptController_MRIHTol F2003 interface") diff --git a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.c b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.c new file mode 100644 index 0000000000..f01662c5a8 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.c @@ -0,0 +1,639 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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_mrihtol.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +#include <string.h> + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__HControl_set(SwigClassWrapper const *farg1, SUNAdaptController farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::HControl", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (SUNAdaptController)(farg2); + if (arg1) (arg1)->HControl = arg2; +} + + +SWIGEXPORT SUNAdaptController _wrap_SUNAdaptControllerContent_MRIHTol__HControl_get(SwigClassWrapper const *farg1) { + SUNAdaptController fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::HControl", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (SUNAdaptController) ((arg1)->HControl); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__TolControl_set(SwigClassWrapper const *farg1, SUNAdaptController farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::TolControl", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (SUNAdaptController)(farg2); + if (arg1) (arg1)->TolControl = arg2; +} + + +SWIGEXPORT SUNAdaptController _wrap_SUNAdaptControllerContent_MRIHTol__TolControl_get(SwigClassWrapper const *farg1) { + SUNAdaptController fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + SUNAdaptController result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::TolControl", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (SUNAdaptController) ((arg1)->TolControl); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_relch", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_max_relch = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_relch", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_max_relch); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_min_tolfac", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_min_tolfac = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_min_tolfac", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_min_tolfac); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(SwigClassWrapper const *farg1, double const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_tolfac", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + arg2 = (sunrealtype)(*farg2); + if (arg1) (arg1)->inner_max_tolfac = arg2; +} + + +SWIGEXPORT double _wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(SwigClassWrapper const *farg1) { + double fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + sunrealtype result; + + SWIG_check_mutable_nonnull(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::inner_max_tolfac", return 0); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + result = (sunrealtype) ((arg1)->inner_max_tolfac); + fresult = (sunrealtype)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_SUNAdaptControllerContent_MRIHTol_() { + SwigClassWrapper fresult ; + struct SUNAdaptControllerContent_MRIHTol_ *result = 0 ; + + result = (struct SUNAdaptControllerContent_MRIHTol_ *)calloc(1, sizeof(struct SUNAdaptControllerContent_MRIHTol_)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_SUNAdaptControllerContent_MRIHTol_(SwigClassWrapper *farg1) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + + SWIG_check_mutable(*farg1, "struct SUNAdaptControllerContent_MRIHTol_ *", "SUNAdaptControllerContent_MRIHTol_", "SUNAdaptControllerContent_MRIHTol_::~SUNAdaptControllerContent_MRIHTol_()", return ); + arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_SUNAdaptControllerContent_MRIHTol__op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct SUNAdaptControllerContent_MRIHTol_ *arg1 = (struct SUNAdaptControllerContent_MRIHTol_ *) 0 ; + struct SUNAdaptControllerContent_MRIHTol_ *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT SUNAdaptController _wrap_FSUNAdaptController_MRIHTol(SUNAdaptController farg1, SUNAdaptController farg2, void *farg3) { + SUNAdaptController fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController arg2 = (SUNAdaptController) 0 ; + SUNContext arg3 = (SUNContext) 0 ; + SUNAdaptController result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController)(farg2); + arg3 = (SUNContext)(farg3); + result = (SUNAdaptController)SUNAdaptController_MRIHTol(arg1,arg2,arg3); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetParams_MRIHTol(SUNAdaptController farg1, double const *farg2, double const *farg3, double const *farg4) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + sunrealtype arg4 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + result = (SUNErrCode)SUNAdaptController_SetParams_MRIHTol(arg1,arg2,arg3,arg4); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetSlowController_MRIHTol(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController *arg2 = (SUNAdaptController *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController *)(farg2); + result = (SUNErrCode)SUNAdaptController_GetSlowController_MRIHTol(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetFastController_MRIHTol(SUNAdaptController farg1, void *farg2) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController *arg2 = (SUNAdaptController *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (SUNAdaptController *)(farg2); + result = (SUNErrCode)SUNAdaptController_GetFastController_MRIHTol(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_GetType_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + SUNAdaptController_Type result; + + arg1 = (SUNAdaptController)(farg1); + result = (SUNAdaptController_Type)SUNAdaptController_GetType_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStepTol_MRIHTol(SUNAdaptController farg1, double const *farg2, double const *farg3, int const *farg4, double const *farg5, double const *farg6, double *farg7, double *farg8) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int arg4 ; + sunrealtype arg5 ; + sunrealtype arg6 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (sunrealtype *)(farg8); + result = (int)SUNAdaptController_EstimateStepTol_MRIHTol(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Reset_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_Reset_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetDefaults_MRIHTol(SUNAdaptController farg1) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + int result; + + arg1 = (SUNAdaptController)(farg1); + result = (int)SUNAdaptController_SetDefaults_MRIHTol(arg1); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Write_MRIHTol(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_MRIHTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_SetErrorBias_MRIHTol(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_MRIHTol(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateMRIHTol_MRIHTol(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_UpdateMRIHTol_MRIHTol(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNAdaptController_Space_MRIHTol(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_MRIHTol(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 new file mode 100644 index 0000000000..5d38166728 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 @@ -0,0 +1,688 @@ +! 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-2024, 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_mrihtol_mod + use, intrinsic :: ISO_C_BINDING + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct SUNAdaptControllerContent_MRIHTol_ + type, public :: SUNAdaptControllerContent_MRIHTol_ + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_HControl => swigf_SUNAdaptControllerContent_MRIHTol__HControl_set + procedure :: get_HControl => swigf_SUNAdaptControllerContent_MRIHTol__HControl_get + procedure :: set_TolControl => swigf_SUNAdaptControllerContent_MRIHTol__TolControl_set + procedure :: get_TolControl => swigf_SUNAdaptControllerContent_MRIHTol__TolControl_get + procedure :: set_inner_max_relch => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set + procedure :: get_inner_max_relch => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get + procedure :: set_inner_min_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set + procedure :: get_inner_min_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get + procedure :: set_inner_max_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set + procedure :: get_inner_max_tolfac => swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get + procedure :: release => swigf_release_SUNAdaptControllerContent_MRIHTol_ + procedure, private :: swigf_SUNAdaptControllerContent_MRIHTol__op_assign__ + generic :: assignment(=) => swigf_SUNAdaptControllerContent_MRIHTol__op_assign__ + end type SUNAdaptControllerContent_MRIHTol_ + interface SUNAdaptControllerContent_MRIHTol_ + module procedure swigf_create_SUNAdaptControllerContent_MRIHTol_ + end interface + public :: FSUNAdaptController_MRIHTol + public :: FSUNAdaptController_SetParams_MRIHTol + public :: FSUNAdaptController_GetSlowController_MRIHTol + public :: FSUNAdaptController_GetFastController_MRIHTol + public :: FSUNAdaptController_GetType_MRIHTol + public :: FSUNAdaptController_EstimateStepTol_MRIHTol + public :: FSUNAdaptController_Reset_MRIHTol + public :: FSUNAdaptController_SetDefaults_MRIHTol + public :: FSUNAdaptController_Write_MRIHTol + public :: FSUNAdaptController_SetErrorBias_MRIHTol + public :: FSUNAdaptController_UpdateMRIHTol_MRIHTol + public :: FSUNAdaptController_Space_MRIHTol + +! WRAPPER DECLARATIONS +interface +subroutine swigc_SUNAdaptControllerContent_MRIHTol__HControl_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__HControl_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__HControl_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__HControl_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__TolControl_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__TolControl_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__TolControl_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__TolControl_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +end subroutine + +function swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(farg1) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: fresult +end function + +function swigc_new_SUNAdaptControllerContent_MRIHTol_() & +bind(C, name="_wrap_new_SUNAdaptControllerContent_MRIHTol_") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_SUNAdaptControllerContent_MRIHTol_(farg1) & +bind(C, name="_wrap_delete_SUNAdaptControllerContent_MRIHTol_") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_SUNAdaptControllerContent_MRIHTol__op_assign__(farg1, farg2) & +bind(C, name="_wrap_SUNAdaptControllerContent_MRIHTol__op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FSUNAdaptController_MRIHTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +type(C_PTR) :: fresult +end function + +function swigc_FSUNAdaptController_SetParams_MRIHTol(farg1, farg2, farg3, farg4) & +bind(C, name="_wrap_FSUNAdaptController_SetParams_MRIHTol") & +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_GetSlowController_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_GetSlowController_MRIHTol") & +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_GetFastController_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_GetFastController_MRIHTol") & +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_GetType_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_GetType_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_EstimateStepTol_MRIHTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStepTol_MRIHTol") & +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), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +real(C_DOUBLE), intent(in) :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Reset_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_Reset_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_SetDefaults_MRIHTol(farg1) & +bind(C, name="_wrap_FSUNAdaptController_SetDefaults_MRIHTol") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_FSUNAdaptController_Write_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_Write_MRIHTol") & +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_MRIHTol(farg1, farg2) & +bind(C, name="_wrap_FSUNAdaptController_SetErrorBias_MRIHTol") & +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_UpdateMRIHTol_MRIHTol(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_UpdateMRIHTol_MRIHTol") & +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_Space_MRIHTol(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNAdaptController_Space_MRIHTol") & +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 +subroutine swigf_SUNAdaptControllerContent_MRIHTol__HControl_set(self, hcontrol) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(SUNAdaptController), target, intent(inout) :: hcontrol +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(hcontrol) +call swigc_SUNAdaptControllerContent_MRIHTol__HControl_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__HControl_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__HControl_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__TolControl_set(self, tolcontrol) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(SUNAdaptController), target, intent(inout) :: tolcontrol +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(tolcontrol) +call swigc_SUNAdaptControllerContent_MRIHTol__TolControl_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__TolControl_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__TolControl_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(self, inner_max_relch) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_max_relch +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_max_relch +call swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_max_relch_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(self, inner_min_tolfac) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_min_tolfac +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_min_tolfac +call swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_min_tolfac_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(self, inner_max_tolfac) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE), intent(in) :: inner_max_tolfac +type(SwigClassWrapper) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = self%swigdata +farg2 = inner_max_tolfac +call swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_set(farg1, farg2) +end subroutine + +function swigf_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE) :: swig_result +class(SUNAdaptControllerContent_MRIHTol_), intent(in) :: self +real(C_DOUBLE) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SUNAdaptControllerContent_MRIHTol__inner_max_tolfac_get(farg1) +swig_result = fresult +end function + +function swigf_create_SUNAdaptControllerContent_MRIHTol_() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptControllerContent_MRIHTol_) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_SUNAdaptControllerContent_MRIHTol_() +self%swigdata = fresult +end function + +subroutine swigf_release_SUNAdaptControllerContent_MRIHTol_(self) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_SUNAdaptControllerContent_MRIHTol_(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_SUNAdaptControllerContent_MRIHTol__op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(SUNAdaptControllerContent_MRIHTol_), intent(inout) :: self +type(SUNAdaptControllerContent_MRIHTol_), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_SUNAdaptControllerContent_MRIHTol__op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FSUNAdaptController_MRIHTol(hcontrol, tolcontrol, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SUNAdaptController), pointer :: swig_result +type(SUNAdaptController), target, intent(inout) :: hcontrol +type(SUNAdaptController), target, intent(inout) :: tolcontrol +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 + +farg1 = c_loc(hcontrol) +farg2 = c_loc(tolcontrol) +farg3 = sunctx +fresult = swigc_FSUNAdaptController_MRIHTol(farg1, farg2, farg3) +call c_f_pointer(fresult, swig_result) +end function + +function FSUNAdaptController_SetParams_MRIHTol(c, inner_max_relch, inner_min_tolfac, inner_max_tolfac) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +real(C_DOUBLE), intent(in) :: inner_max_relch +real(C_DOUBLE), intent(in) :: inner_min_tolfac +real(C_DOUBLE), intent(in) :: inner_max_tolfac +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 = inner_max_relch +farg3 = inner_min_tolfac +farg4 = inner_max_tolfac +fresult = swigc_FSUNAdaptController_SetParams_MRIHTol(farg1, farg2, farg3, farg4) +swig_result = fresult +end function + +function FSUNAdaptController_GetSlowController_MRIHTol(c, cslow) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR), target, intent(inout) :: cslow +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = c_loc(cslow) +fresult = swigc_FSUNAdaptController_GetSlowController_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(SUNAdaptController), target, intent(inout) :: c +type(C_PTR), target, intent(inout) :: cfast +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = c_loc(c) +farg2 = c_loc(cfast) +fresult = swigc_FSUNAdaptController_GetFastController_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_GetType_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_EstimateStepTol_MRIHTol(c, h, tolfac, p, dsm, dsm5, hnew, tolfacnew) & +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) :: tolfac +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm5 +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolfacnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +integer(C_INT) :: farg4 +real(C_DOUBLE) :: farg5 +real(C_DOUBLE) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = c_loc(c) +farg2 = h +farg3 = tolfac +farg4 = p +farg5 = dsm +farg6 = dsm5 +farg7 = c_loc(hnew(1)) +farg8 = c_loc(tolfacnew(1)) +fresult = swigc_FSUNAdaptController_EstimateStepTol_MRIHTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + +function FSUNAdaptController_Reset_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_SetDefaults_MRIHTol(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_MRIHTol(farg1) +swig_result = fresult +end function + +function FSUNAdaptController_Write_MRIHTol(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_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_SetErrorBias_MRIHTol(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_MRIHTol(farg1, farg2) +swig_result = fresult +end function + +function FSUNAdaptController_UpdateMRIHTol_MRIHTol(c, h, tolfac, dsm, dsm4) & +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) :: tolfac +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm4 +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 = h +farg3 = tolfac +farg4 = dsm +farg5 = dsm4 +fresult = swigc_FSUNAdaptController_UpdateMRIHTol_MRIHTol(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSUNAdaptController_Space_MRIHTol(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_MRIHTol(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c b/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c new file mode 100644 index 0000000000..774bb87be9 --- /dev/null +++ b/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c @@ -0,0 +1,274 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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_MRIHTol module. + * -----------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> + +#include <sunadaptcontroller/sunadaptcontroller_mrihtol.h> +#include <sundials/sundials_core.h> +#include "sundials/priv/sundials_errors_impl.h" +#include "sundials/sundials_errors.h" + +#include "sundials_macros.h" + +/* ------------------ + * Default parameters + * ------------------ */ + +/* maximum relative change for inner tolerance factor */ +#define INNER_MAX_RELCH SUN_RCONST(20.0) +/* minimum tolerance factor for inner solver */ +#define INNER_MIN_TOLFAC SUN_RCONST(1.e-5) +/* maximum tolerance factor for inner solver */ +#define INNER_MAX_TOLFAC SUN_RCONST(1.0) + +/* --------------- + * Macro accessors + * --------------- */ + +#define MRIHTOL_CONTENT(C) ((SUNAdaptControllerContent_MRIHTol)(C->content)) +#define MRIHTOL_CSLOW(C) (MRIHTOL_CONTENT(C)->HControl) +#define MRIHTOL_CFAST(C) (MRIHTOL_CONTENT(C)->TolControl) +#define MRIHTOL_INNER_MAX_RELCH(C) (MRIHTOL_CONTENT(C)->inner_max_relch) +#define MRIHTOL_INNER_MIN_TOLFAC(C) (MRIHTOL_CONTENT(C)->inner_min_tolfac) +#define MRIHTOL_INNER_MAX_TOLFAC(C) (MRIHTOL_CONTENT(C)->inner_max_tolfac) + +/* ----------------------------------------------------------------- + * exported functions + * ----------------------------------------------------------------- */ + +/* ----------------------------------------------------------------- + * Function to create a new MRIHTol controller + */ + +SUNAdaptController SUNAdaptController_MRIHTol(SUNAdaptController HControl, + SUNAdaptController TolControl, + SUNContext sunctx) +{ + SUNFunctionBegin(sunctx); + + SUNAdaptController C; + SUNAdaptControllerContent_MRIHTol content; + + /* Verify that input controllers have the appropriate type */ + SUNAssertNull(SUNAdaptController_GetType(HControl) == SUN_ADAPTCONTROLLER_H, + SUN_ERR_ARG_INCOMPATIBLE); + SUNAssertNull(SUNAdaptController_GetType(TolControl) == SUN_ADAPTCONTROLLER_H, + SUN_ERR_ARG_INCOMPATIBLE); + + /* Create an empty controller object */ + C = NULL; + C = SUNAdaptController_NewEmpty(sunctx); + SUNCheckLastErrNull(); + + /* Attach operations */ + C->ops->gettype = SUNAdaptController_GetType_MRIHTol; + C->ops->estimatesteptol = SUNAdaptController_EstimateStepTol_MRIHTol; + C->ops->reset = SUNAdaptController_Reset_MRIHTol; + C->ops->setdefaults = SUNAdaptController_SetDefaults_MRIHTol; + C->ops->write = SUNAdaptController_Write_MRIHTol; + C->ops->seterrorbias = SUNAdaptController_SetErrorBias_MRIHTol; + C->ops->updatemrihtol = SUNAdaptController_UpdateMRIHTol_MRIHTol; + C->ops->space = SUNAdaptController_Space_MRIHTol; + + /* Create content */ + content = NULL; + content = (SUNAdaptControllerContent_MRIHTol)malloc(sizeof *content); + SUNAssertNull(content, SUN_ERR_MALLOC_FAIL); + + /* Attach input controllers */ + content->HControl = HControl; + content->TolControl = TolControl; + + /* Set parameters to default values */ + content->inner_max_relch = INNER_MAX_RELCH; + content->inner_min_tolfac = INNER_MIN_TOLFAC; + content->inner_max_tolfac = INNER_MAX_TOLFAC; + + /* Attach content */ + C->content = content; + + return C; +} + +/* ----------------------------------------------------------------- + * Function to set MRIHTol parameters + */ + +SUNErrCode SUNAdaptController_SetParams_MRIHTol(SUNAdaptController C, + sunrealtype inner_max_relch, + sunrealtype inner_min_tolfac, + sunrealtype inner_max_tolfac) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(inner_max_tolfac > inner_min_tolfac, SUN_ERR_ARG_OUTOFRANGE); + if (inner_max_relch < SUN_RCONST(1.0)) + { + MRIHTOL_INNER_MAX_RELCH(C) = INNER_MAX_RELCH; + } + else { MRIHTOL_INNER_MAX_RELCH(C) = inner_max_relch; } + if (inner_min_tolfac <= SUN_RCONST(0.0)) + { + MRIHTOL_INNER_MIN_TOLFAC(C) = INNER_MIN_TOLFAC; + } + else { MRIHTOL_INNER_MIN_TOLFAC(C) = inner_min_tolfac; } + if ((inner_max_tolfac <= SUN_RCONST(0.0)) || + (inner_max_tolfac > SUN_RCONST(1.0))) + { + MRIHTOL_INNER_MAX_TOLFAC(C) = INNER_MAX_TOLFAC; + } + else { MRIHTOL_INNER_MAX_TOLFAC(C) = inner_max_tolfac; } + return SUN_SUCCESS; +} + +/* ----------------------------------------------------------------- + * Function to get slow and fast sub-controllers + */ + +SUNErrCode SUNAdaptController_GetSlowController_MRIHTol(SUNAdaptController C, + SUNAdaptController* Cslow) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(Cslow, SUN_ERR_ARG_CORRUPT); + *Cslow = MRIHTOL_CSLOW(C); + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_GetFastController_MRIHTol(SUNAdaptController C, + SUNAdaptController* Cfast) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(Cfast, SUN_ERR_ARG_CORRUPT); + *Cfast = MRIHTOL_CFAST(C); + return SUN_SUCCESS; +} + +/* ----------------------------------------------------------------- + * implementation of controller operations + * ----------------------------------------------------------------- */ + +SUNAdaptController_Type SUNAdaptController_GetType_MRIHTol( + SUNDIALS_MAYBE_UNUSED SUNAdaptController C) +{ + return SUN_ADAPTCONTROLLER_MRI_H_TOL; +} + +SUNErrCode SUNAdaptController_EstimateStepTol_MRIHTol( + SUNAdaptController C, sunrealtype H, sunrealtype tolfac, int P, + sunrealtype DSM, sunrealtype dsm, sunrealtype* Hnew, sunrealtype* tolfacnew) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(Hnew, SUN_ERR_ARG_CORRUPT); + SUNAssert(tolfacnew, SUN_ERR_ARG_CORRUPT); + sunrealtype tolfacest; + + /* Call slow time scale sub-controller to fill Hnew -- note that all heuristics + bounds on Hnew will be enforced by the time integrator itself */ + SUNCheckCall(SUNAdaptController_EstimateStep(MRIHTOL_CSLOW(C), H, P, DSM, Hnew)); + + /* Call fast time scale sub-controller with order=1: no matter the integrator + order, we expect its error to be proportional to the tolerance factor */ + SUNCheckCall(SUNAdaptController_EstimateStep(MRIHTOL_CFAST(C), tolfac, 0, dsm, + &tolfacest)); + + /* Enforce bounds on estimated tolerance factor */ + /* keep relative change within bounds */ + tolfacest = SUNMAX(tolfacest, tolfac / MRIHTOL_INNER_MAX_RELCH(C)); + tolfacest = SUNMIN(tolfacest, tolfac * MRIHTOL_INNER_MAX_RELCH(C)); + /* enforce absolute min/max bounds */ + tolfacest = SUNMAX(tolfacest, MRIHTOL_INNER_MIN_TOLFAC(C)); + tolfacest = SUNMIN(tolfacest, MRIHTOL_INNER_MAX_TOLFAC(C)); + + /* Set result and return */ + *tolfacnew = tolfacest; + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_Reset_MRIHTol(SUNAdaptController C) +{ + SUNFunctionBegin(C->sunctx); + SUNCheckCall(SUNAdaptController_Reset(MRIHTOL_CSLOW(C))); + SUNCheckCall(SUNAdaptController_Reset(MRIHTOL_CFAST(C))); + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_SetDefaults_MRIHTol(SUNAdaptController C) +{ + SUNFunctionBegin(C->sunctx); + SUNCheckCall(SUNAdaptController_SetDefaults(MRIHTOL_CSLOW(C))); + SUNCheckCall(SUNAdaptController_SetDefaults(MRIHTOL_CFAST(C))); + MRIHTOL_INNER_MAX_RELCH(C) = INNER_MAX_RELCH; + MRIHTOL_INNER_MIN_TOLFAC(C) = INNER_MIN_TOLFAC; + MRIHTOL_INNER_MAX_TOLFAC(C) = INNER_MAX_TOLFAC; + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_Write_MRIHTol(SUNAdaptController C, FILE* fptr) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(fptr, SUN_ERR_ARG_CORRUPT); + fprintf(fptr, "Multirate H-Tol SUNAdaptController module:\n"); +#if defined(SUNDIALS_EXTENDED_PRECISION) + fprintf(fptr, " inner_max_relch = %32Lg\n", MRIHTOL_INNER_MAX_RELCH(C)); + fprintf(fptr, " inner_min_tolfac = %32Lg\n", MRIHTOL_INNER_MIN_TOLFAC(C)); + fprintf(fptr, " inner_max_tolfac = %32Lg\n", MRIHTOL_INNER_MAX_TOLFAC(C)); +#else + fprintf(fptr, " inner_max_relch = %16g\n", MRIHTOL_INNER_MAX_RELCH(C)); + fprintf(fptr, " inner_min_tolfac = %16g\n", MRIHTOL_INNER_MIN_TOLFAC(C)); + fprintf(fptr, " inner_max_tolfac = %16g\n", MRIHTOL_INNER_MAX_TOLFAC(C)); +#endif + fprintf(fptr, "\nSlow step controller:\n"); + SUNCheckCall(SUNAdaptController_Write(MRIHTOL_CSLOW(C), fptr)); + fprintf(fptr, "\nFast tolerance controller:\n"); + SUNCheckCall(SUNAdaptController_Write(MRIHTOL_CFAST(C), fptr)); + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_SetErrorBias_MRIHTol(SUNAdaptController C, + sunrealtype bias) +{ + SUNFunctionBegin(C->sunctx); + SUNCheckCall(SUNAdaptController_SetErrorBias(MRIHTOL_CSLOW(C), bias)); + SUNCheckCall(SUNAdaptController_SetErrorBias(MRIHTOL_CFAST(C), bias)); + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_UpdateMRIHTol_MRIHTol(SUNAdaptController C, + sunrealtype H, + sunrealtype tolfac, + sunrealtype DSM, + sunrealtype dsm) +{ + SUNFunctionBegin(C->sunctx); + SUNCheckCall(SUNAdaptController_UpdateH(MRIHTOL_CSLOW(C), H, DSM)); + SUNCheckCall(SUNAdaptController_UpdateH(MRIHTOL_CFAST(C), tolfac, dsm)); + return SUN_SUCCESS; +} + +SUNErrCode SUNAdaptController_Space_MRIHTol(SUNAdaptController C, + long int* lenrw, long int* leniw) +{ + SUNFunctionBegin(C->sunctx); + SUNAssert(lenrw, SUN_ERR_ARG_CORRUPT); + SUNAssert(leniw, SUN_ERR_ARG_CORRUPT); + long int lrw, liw; + SUNCheckCall(SUNAdaptController_Space(MRIHTOL_CSLOW(C), lenrw, leniw)); + SUNCheckCall(SUNAdaptController_Space(MRIHTOL_CFAST(C), &lrw, &liw)); + *lenrw += lrw; + *leniw += liw; + return SUN_SUCCESS; +} diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index 9cec8422c8..43855b4e60 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -2560,6 +2560,32 @@ SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStep(SUNAdaptController farg1, } +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStepTol(SUNAdaptController farg1, double const *farg2, double const *farg3, int const *farg4, double const *farg5, double const *farg6, double *farg7, double *farg8) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int arg4 ; + sunrealtype arg5 ; + sunrealtype arg6 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (sunrealtype *)(farg8); + result = (SUNErrCode)SUNAdaptController_EstimateStepTol(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNAdaptController_Reset(SUNAdaptController farg1) { int fresult ; SUNAdaptController arg1 = (SUNAdaptController) 0 ; @@ -2628,6 +2654,26 @@ SWIGEXPORT int _wrap_FSUNAdaptController_UpdateH(SUNAdaptController farg1, doubl } +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateMRIHTol(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (SUNErrCode)SUNAdaptController_UpdateMRIHTol(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNAdaptController_Space(SUNAdaptController farg1, long *farg2, long *farg3) { int fresult ; SUNAdaptController arg1 = (SUNAdaptController) 0 ; diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index 0b95e5c880..bc425ba37b 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -511,19 +511,22 @@ module fsundials_core_mod enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H + enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) - public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H + public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! 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 :: estimatesteptol 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 :: updatemrihtol type(C_FUNPTR), public :: space end type SUNAdaptController_Ops ! struct struct _generic_SUNAdaptController @@ -537,11 +540,13 @@ module fsundials_core_mod public :: FSUNAdaptController_GetType public :: FSUNAdaptController_Destroy public :: FSUNAdaptController_EstimateStep + public :: FSUNAdaptController_EstimateStepTol public :: FSUNAdaptController_Reset public :: FSUNAdaptController_SetDefaults public :: FSUNAdaptController_Write public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH + public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space ! typedef enum SUNFullRhsMode enum, bind(c) @@ -2014,6 +2019,21 @@ function swigc_FSUNAdaptController_EstimateStep(farg1, farg2, farg3, farg4, farg integer(C_INT) :: fresult end function +function swigc_FSUNAdaptController_EstimateStepTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStepTol") & +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), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +real(C_DOUBLE), intent(in) :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + function swigc_FSUNAdaptController_Reset(farg1) & bind(C, name="_wrap_FSUNAdaptController_Reset") & result(fresult) @@ -2058,6 +2078,18 @@ function swigc_FSUNAdaptController_UpdateH(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNAdaptController_UpdateMRIHTol(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_UpdateMRIHTol") & +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_Space(farg1, farg2, farg3) & bind(C, name="_wrap_FSUNAdaptController_Space") & result(fresult) @@ -4894,6 +4926,40 @@ function FSUNAdaptController_EstimateStep(c, h, p, dsm, hnew) & swig_result = fresult end function +function FSUNAdaptController_EstimateStepTol(c, h, tolfac, p, dsm, dsm5, hnew, tolfacnew) & +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) :: tolfac +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm5 +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolfacnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +integer(C_INT) :: farg4 +real(C_DOUBLE) :: farg5 +real(C_DOUBLE) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = c_loc(c) +farg2 = h +farg3 = tolfac +farg4 = p +farg5 = dsm +farg6 = dsm5 +farg7 = c_loc(hnew(1)) +farg8 = c_loc(tolfacnew(1)) +fresult = swigc_FSUNAdaptController_EstimateStepTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + function FSUNAdaptController_Reset(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4971,6 +5037,31 @@ function FSUNAdaptController_UpdateH(c, h, dsm) & swig_result = fresult end function +function FSUNAdaptController_UpdateMRIHTol(c, h, tolfac, dsm, dsm4) & +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) :: tolfac +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm4 +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 = h +farg3 = tolfac +farg4 = dsm +farg5 = dsm4 +fresult = swigc_FSUNAdaptController_UpdateMRIHTol(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + function FSUNAdaptController_Space(c, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index b1f96d2b55..7062f9a507 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -2560,6 +2560,32 @@ SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStep(SUNAdaptController farg1, } +SWIGEXPORT int _wrap_FSUNAdaptController_EstimateStepTol(SUNAdaptController farg1, double const *farg2, double const *farg3, int const *farg4, double const *farg5, double const *farg6, double *farg7, double *farg8) { + int fresult ; + SUNAdaptController arg1 = (SUNAdaptController) 0 ; + sunrealtype arg2 ; + sunrealtype arg3 ; + int arg4 ; + sunrealtype arg5 ; + sunrealtype arg6 ; + sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype *arg8 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype)(*farg5); + arg6 = (sunrealtype)(*farg6); + arg7 = (sunrealtype *)(farg7); + arg8 = (sunrealtype *)(farg8); + result = (SUNErrCode)SUNAdaptController_EstimateStepTol(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNAdaptController_Reset(SUNAdaptController farg1) { int fresult ; SUNAdaptController arg1 = (SUNAdaptController) 0 ; @@ -2628,6 +2654,26 @@ SWIGEXPORT int _wrap_FSUNAdaptController_UpdateH(SUNAdaptController farg1, doubl } +SWIGEXPORT int _wrap_FSUNAdaptController_UpdateMRIHTol(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 ; + SUNErrCode result; + + arg1 = (SUNAdaptController)(farg1); + arg2 = (sunrealtype)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (sunrealtype)(*farg5); + result = (SUNErrCode)SUNAdaptController_UpdateMRIHTol(arg1,arg2,arg3,arg4,arg5); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNAdaptController_Space(SUNAdaptController farg1, long *farg2, long *farg3) { int fresult ; SUNAdaptController arg1 = (SUNAdaptController) 0 ; diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 13be2c2a2a..e16ea3b306 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -511,19 +511,22 @@ module fsundials_core_mod enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H + enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) - public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H + public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! 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 :: estimatesteptol 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 :: updatemrihtol type(C_FUNPTR), public :: space end type SUNAdaptController_Ops ! struct struct _generic_SUNAdaptController @@ -537,11 +540,13 @@ module fsundials_core_mod public :: FSUNAdaptController_GetType public :: FSUNAdaptController_Destroy public :: FSUNAdaptController_EstimateStep + public :: FSUNAdaptController_EstimateStepTol public :: FSUNAdaptController_Reset public :: FSUNAdaptController_SetDefaults public :: FSUNAdaptController_Write public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH + public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space ! typedef enum SUNFullRhsMode enum, bind(c) @@ -2014,6 +2019,21 @@ function swigc_FSUNAdaptController_EstimateStep(farg1, farg2, farg3, farg4, farg integer(C_INT) :: fresult end function +function swigc_FSUNAdaptController_EstimateStepTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) & +bind(C, name="_wrap_FSUNAdaptController_EstimateStepTol") & +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), intent(in) :: farg4 +real(C_DOUBLE), intent(in) :: farg5 +real(C_DOUBLE), intent(in) :: farg6 +type(C_PTR), value :: farg7 +type(C_PTR), value :: farg8 +integer(C_INT) :: fresult +end function + function swigc_FSUNAdaptController_Reset(farg1) & bind(C, name="_wrap_FSUNAdaptController_Reset") & result(fresult) @@ -2058,6 +2078,18 @@ function swigc_FSUNAdaptController_UpdateH(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNAdaptController_UpdateMRIHTol(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSUNAdaptController_UpdateMRIHTol") & +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_Space(farg1, farg2, farg3) & bind(C, name="_wrap_FSUNAdaptController_Space") & result(fresult) @@ -4894,6 +4926,40 @@ function FSUNAdaptController_EstimateStep(c, h, p, dsm, hnew) & swig_result = fresult end function +function FSUNAdaptController_EstimateStepTol(c, h, tolfac, p, dsm, dsm5, hnew, tolfacnew) & +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) :: tolfac +integer(C_INT), intent(in) :: p +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm5 +real(C_DOUBLE), dimension(*), target, intent(inout) :: hnew +real(C_DOUBLE), dimension(*), target, intent(inout) :: tolfacnew +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 +real(C_DOUBLE) :: farg3 +integer(C_INT) :: farg4 +real(C_DOUBLE) :: farg5 +real(C_DOUBLE) :: farg6 +type(C_PTR) :: farg7 +type(C_PTR) :: farg8 + +farg1 = c_loc(c) +farg2 = h +farg3 = tolfac +farg4 = p +farg5 = dsm +farg6 = dsm5 +farg7 = c_loc(hnew(1)) +farg8 = c_loc(tolfacnew(1)) +fresult = swigc_FSUNAdaptController_EstimateStepTol(farg1, farg2, farg3, farg4, farg5, farg6, farg7, farg8) +swig_result = fresult +end function + function FSUNAdaptController_Reset(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4971,6 +5037,31 @@ function FSUNAdaptController_UpdateH(c, h, dsm) & swig_result = fresult end function +function FSUNAdaptController_UpdateMRIHTol(c, h, tolfac, dsm, dsm4) & +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) :: tolfac +real(C_DOUBLE), intent(in) :: dsm +real(C_DOUBLE), intent(in) :: dsm4 +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 = h +farg3 = tolfac +farg4 = dsm +farg5 = dsm4 +fresult = swigc_FSUNAdaptController_UpdateMRIHTol(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + function FSUNAdaptController_Space(c, lenrw, leniw) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/sundials_adaptcontroller.c b/src/sundials/sundials_adaptcontroller.c index 39a56480d0..4641f1751c 100644 --- a/src/sundials/sundials_adaptcontroller.c +++ b/src/sundials/sundials_adaptcontroller.c @@ -46,15 +46,17 @@ SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx) SUNAssertNull(ops, SUN_ERR_MALLOC_FAIL); /* 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; + ops->gettype = NULL; + ops->destroy = NULL; + ops->reset = NULL; + ops->estimatestep = NULL; + ops->estimatesteptol = NULL; + ops->setdefaults = NULL; + ops->write = NULL; + ops->seterrorbias = NULL; + ops->updateh = NULL; + ops->updatemrihtol = NULL; + ops->space = NULL; /* attach ops and initialize content to NULL */ C->ops = ops; @@ -137,6 +139,26 @@ SUNErrCode SUNAdaptController_EstimateStep(SUNAdaptController C, sunrealtype h, return (ier); } +SUNErrCode SUNAdaptController_EstimateStepTol(SUNAdaptController C, + sunrealtype H, sunrealtype tolfac, + int P, sunrealtype DSM, + sunrealtype dsm, sunrealtype* Hnew, + sunrealtype* tolfacnew) +{ + SUNErrCode ier = SUN_SUCCESS; + if (C == NULL) { return SUN_ERR_ARG_CORRUPT; } + SUNFunctionBegin(C->sunctx); + SUNAssert(Hnew, SUN_ERR_ARG_CORRUPT); + SUNAssert(tolfacnew, SUN_ERR_ARG_CORRUPT); + *Hnew = H; /* initialize outputs with identity */ + *tolfacnew = tolfac; + if (C->ops->estimatesteptol) + { + ier = C->ops->estimatesteptol(C, H, tolfac, P, DSM, dsm, Hnew, tolfacnew); + } + return (ier); +} + SUNErrCode SUNAdaptController_Reset(SUNAdaptController C) { SUNErrCode ier = SUN_SUCCESS; @@ -184,6 +206,20 @@ SUNErrCode SUNAdaptController_UpdateH(SUNAdaptController C, sunrealtype h, return (ier); } +SUNErrCode SUNAdaptController_UpdateMRIHTol(SUNAdaptController C, sunrealtype H, + sunrealtype tolfac, sunrealtype DSM, + sunrealtype dsm) +{ + SUNErrCode ier = SUN_SUCCESS; + if (C == NULL) { return SUN_ERR_ARG_CORRUPT; } + SUNFunctionBegin(C->sunctx); + if (C->ops->updatemrihtol) + { + ier = C->ops->updatemrihtol(C, H, tolfac, DSM, dsm); + } + return (ier); +} + SUNErrCode SUNAdaptController_Space(SUNAdaptController C, long int* lenrw, long int* leniw) { diff --git a/swig/Makefile b/swig/Makefile index 4bcefe8423..424d4857a4 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -27,7 +27,7 @@ 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 +SUNADAPTCONTROLLER=imexgus soderlind mrihtol INCLUDES=-I../include diff --git a/swig/sunadaptcontroller/fsunadaptcontroller_mrihtol_mod.i b/swig/sunadaptcontroller/fsunadaptcontroller_mrihtol_mod.i new file mode 100644 index 0000000000..feb54e4bf1 --- /dev/null +++ b/swig/sunadaptcontroller/fsunadaptcontroller_mrihtol_mod.i @@ -0,0 +1,29 @@ +// --------------------------------------------------------------- +// Programmer: Daniel R. Reynolds @ SMU +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2024, 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_mrihtol_mod + +// include code common to all implementations +%include "fsunadaptcontroller.i" + +%{ +#include "sunadaptcontroller/sunadaptcontroller_mrihtol.h" +%} + +%sunadaptcontroller_impl(MRIHTol) + +// Process and wrap functions in the following files +%include "sunadaptcontroller/sunadaptcontroller_mrihtol.h" diff --git a/test/answers b/test/answers index 5dca98a66d..294c370633 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 5dca98a66d4f833c19a4fd63163f466ac5f50b56 +Subproject commit 294c3706336ef84e9719b419a4e29d9a551e7294 diff --git a/test/test_driver.sh b/test/test_driver.sh index 3a1d25f4ec..4faee8b8ea 100755 --- a/test/test_driver.sh +++ b/test/test_driver.sh @@ -374,7 +374,7 @@ args_phase=() case "$testtype" in BRANCH) - # Don't creat tarballs + # Don't create tarballs tarball=NONE # Address sanitizer tests (TPLs OFF) 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 303d85f057..c4f9757a29 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 @@ -225,8 +225,8 @@ int main(int argc, char* argv[]) if (check_flag((void*)inner_mem, "ARKStepCreate", 0)) { return 1; } MRIStepInnerStepper inner_stepper = NULL; - flag = ARKStepCreateMRIStepInnerStepper(inner_mem, &inner_stepper); - if (check_flag(&flag, "ARKStepCreateMRIStepInnerStepper", 1)) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(inner_mem, &inner_stepper); + if (check_flag(&flag, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } mristep_mem = MRIStepCreate(NULL, f, T0, y, inner_stepper, ctx); if (check_flag((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } 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 index a78e16c9fd..9ca728ed54 100644 --- 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 @@ -28,10 +28,10 @@ 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 linear iterations = 6234 + Total number of Jacobian-vector products = 6234 Total number of Preconditioner setups = 50 - Total number of Preconditioner solves = 6250 + Total number of Preconditioner solves = 6234 Total number of linear solver convergence failures = 0 Total number of Newton iterations = 1768 Total number of nonlinear solver convergence failures = 0 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 index bbf3267c89..d0a8f738c5 100644 --- 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 @@ -28,10 +28,10 @@ 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 linear iterations = 4722 + Total number of Jacobian-vector products = 4722 Total number of Preconditioner setups = 1 - Total number of Preconditioner solves = 4731 + Total number of Preconditioner solves = 4722 Total number of linear solver convergence failures = 0 Total number of Newton iterations = 1000 Total number of nonlinear solver convergence failures = 0 diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index c1f22fc6bc..c62580c508 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -11,37 +11,49 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# ARKode C++ serial unit_tests +# ARKODE C++ serial unit_tests # --------------------------------------------------------------- -# List of test tuples of the form "name\;args" +# List of test tuples of the form "name\;args\;type" where the type is 'develop' +# for tests excluded from 'make test' in releases set(unit_tests - "ark_test_analytic_sys_mri.cpp\;0" - "ark_test_analytic_sys_mri.cpp\;1" - "ark_test_dahlquist_ark.cpp\;0 -1 0" - "ark_test_dahlquist_ark.cpp\;0 0 0" - "ark_test_dahlquist_ark.cpp\;0 0 1" - "ark_test_dahlquist_ark.cpp\;0 1 0" - "ark_test_dahlquist_ark.cpp\;0 1 1" - "ark_test_dahlquist_ark.cpp\;1 -1 0" - "ark_test_dahlquist_ark.cpp\;1 0 0" - "ark_test_dahlquist_ark.cpp\;1 0 1" - "ark_test_dahlquist_ark.cpp\;1 1 0" - "ark_test_dahlquist_ark.cpp\;1 1 1" - "ark_test_dahlquist_ark.cpp\;2 -1 0" - "ark_test_dahlquist_ark.cpp\;2 0 0" - "ark_test_dahlquist_ark.cpp\;2 0 1" - "ark_test_dahlquist_ark.cpp\;2 1 0" - "ark_test_dahlquist_ark.cpp\;2 1 1" - "ark_test_dahlquist_erk.cpp\;-1" - "ark_test_dahlquist_erk.cpp\;0" - "ark_test_dahlquist_erk.cpp\;1" - "ark_test_dahlquist_mri.cpp\;-1" - "ark_test_dahlquist_mri.cpp\;0" - "ark_test_dahlquist_mri.cpp\;1" - "ark_test_butcher.cpp\;" - "ark_test_getjac.cpp\;" - "ark_test_getjac_mri.cpp\;") + "ark_test_accumerror_brusselator.cpp\;20 3 1\;exclude-single" + "ark_test_accumerror_brusselator.cpp\;20 -4 0\;exclude-single" + "ark_test_accumerror_brusselator.cpp\;20 5 0\;exclude-single" + "ark_test_accumerror_kpr.cpp\;20 2 0\;exclude-single" + "ark_test_accumerror_kpr.cpp\;20 3 1\;exclude-single" + "ark_test_accumerror_kpr.cpp\;20 -4 1\;exclude-single" + "ark_test_analytic_sys_mri.cpp\;0\;develop" + "ark_test_analytic_sys_mri.cpp\;1\;develop" + "ark_test_dahlquist_ark.cpp\;0 -1 0\;develop" + "ark_test_dahlquist_ark.cpp\;0 0 0\;develop" + "ark_test_dahlquist_ark.cpp\;0 0 1\;develop" + "ark_test_dahlquist_ark.cpp\;0 1 0\;develop" + "ark_test_dahlquist_ark.cpp\;0 1 1\;develop" + "ark_test_dahlquist_ark.cpp\;1 -1 0\;develop" + "ark_test_dahlquist_ark.cpp\;1 0 0\;develop" + "ark_test_dahlquist_ark.cpp\;1 0 1\;develop" + "ark_test_dahlquist_ark.cpp\;1 1 0\;develop" + "ark_test_dahlquist_ark.cpp\;1 1 1\;develop" + "ark_test_dahlquist_ark.cpp\;2 -1 0\;develop" + "ark_test_dahlquist_ark.cpp\;2 0 0\;develop" + "ark_test_dahlquist_ark.cpp\;2 0 1\;develop" + "ark_test_dahlquist_ark.cpp\;2 1 0\;develop" + "ark_test_dahlquist_ark.cpp\;2 1 1\;develop" + "ark_test_dahlquist_erk.cpp\;-1\;develop" + "ark_test_dahlquist_erk.cpp\;0\;develop" + "ark_test_dahlquist_erk.cpp\;1\;develop" + "ark_test_dahlquist_mri.cpp\;-1\;develop" + "ark_test_dahlquist_mri.cpp\;0\;develop" + "ark_test_dahlquist_mri.cpp\;1\;develop" + "ark_test_butcher.cpp\;\;develop" + "ark_test_getjac.cpp\;\;develop" + "ark_test_getjac_mri.cpp\;\;develop" + "ark_test_kpr_mriadapt.cpp\;--hs 0.002 --rtol 0.000004 --scontrol 0\;exclude-single" + "ark_test_brusselator_mriadapt.cpp\;--rtol 0.000004 --scontrol 0\;exclude-single" + "ark_test_slowerror_brusselator.cpp\;\;exclude-single" + "ark_test_slowerror_kpr.cpp\;\;exclude-single" + "ark_test_slowerror_polynomial.cpp\;\;exclude-single") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -49,6 +61,7 @@ foreach(test_tuple ${unit_tests}) # Parse the test tuple list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) + list(GET test_tuple 2 test_type) # Extract the file name without extension get_filename_component(test_target ${test} NAME_WE) @@ -83,6 +96,7 @@ foreach(test_tuple ${unit_tests}) sundials_sunnonlinsolfixedpoint_obj sundials_sunadaptcontrollerimexgus_obj sundials_sunadaptcontrollersoderlind_obj + sundials_sunadaptcontrollermrihtol_obj ${EXE_EXTRA_LINK_LIBS}) # Tell CMake that we depend on the ARKODE library since it does not pick @@ -110,7 +124,7 @@ foreach(test_tuple ${unit_tests}) TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" ${diff_output}) + EXAMPLE_TYPE ${test_type} ${diff_output}) endforeach() diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp new file mode 100644 index 0000000000..2d01042362 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp @@ -0,0 +1,717 @@ +/*----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Routine to test the accumulated temporal error estimation + * approaches from ARKStep. Uses the + * "stiff Brusselator" test problem with 3 components, + * du/dt = a - (w+1)*u + v*u^2 + * dv/dt = w*u - v*u^2 + * dw/dt = (b-w)/ep - w*u + * for t in the interval [0.0, 10.0], with initial conditions + * Y0 = [u0,v0,w0]. + * + * The stiffness of the problem is essentially determined + * by ep, wherein if the dynamical time step is given by H and + * the explicit time step size is given by h, then H/h = 1/(100 ep), + * i.e., the stability-limited step takes over at values of + * ep < 1e-2. This file defaults to a moderately stiff setup with + * ep = 1/2500. + * + * We may run the problem in one of 3 different testing scenarios: + * + * Test 1: u0=3.9, v0=1.1, w0=2.8, a=1.2, b=2.5 + * Here, all three components exhibit a rapid transient change + * during the first 0.2 time units, followed by a slow and + * smooth evolution. + * + * Test 2 [default]: u0=1.2, v0=3.1, w0=3, a=1, b=3.5 + * Here, w experiences a fast initial transient, jumping 0.5 + * within a few steps. All values proceed smoothly until + * around t=6.5, when both u and v undergo a sharp transition, + * with u increaseing from around 0.5 to 5 and v decreasing + * from around 6 to 1 in less than 0.5 time units. After this + * transition, both u and v continue to evolve somewhat + * rapidly for another 1.4 time units, and finish off smoothly. + * + * Test 3: u0=3, v0=3, w0=3.5, a=0.5, b=3 + * Here, all components undergo very rapid initial transients + * during the first 0.3 time units, and all then proceed very + * smoothly for the remainder of the simulation. + * + * We partition the full time integration interval, 0 < t < 5, into + * Npart pieces, and run the accumulation test over each. + * + * We use either the ARKStep/DIRK/Newton/Dense solver (0) or + * the ARKStep/ERK solver (1). Either defaults to using a + * 4th-order method. + * + * By default, all runs use temporal adaptivity; however, if the + * requested 'ord' command-line input is negative, we run with + * order |ord|, using fixed step sizes. + * + * The program should be run with arguments in the following order: + * $ a.out Npart ord method ep test + * Not all arguments are required, but these must be omitted from + * end-to-beginning, i.e. any one of + * $ a.out Npart ord method ep + * $ a.out Npart ord method + * $ a.out Npart ord + * $ a.out Npart + * $ a.out + * are acceptable. We require: + * * method = {0, 1} + * * test = {1, 2, 3} + * * ep > 0 + * * Npart > 0 + * + * For either temporally adaptive (ord >= 0) or fixed-step (ord < 0) + * runs, we test a variety of tolerances/step sizes, and compare + * the error at the end of each partition (computed via a reference + * solution) against the integrator-reported accumulated error + * estimate. + *-----------------------------------------------------------------*/ + +// Header files +#include <arkode/arkode_arkstep.h> +#include <cmath> +#include <iostream> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <string.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> +#include <sunmatrix/sunmatrix_dense.h> +#include <vector> + +#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 + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +using namespace std; + +// User data structure +struct UserData +{ + sunrealtype a; + sunrealtype b; + sunrealtype ep; + int Npart; +}; + +// User-supplied Functions Called by the Solver +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Private utility functions +static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, N_Vector* yref, + UserData& udata); +static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, sunrealtype Tf, + int rk_type, int order, N_Vector* yref, UserData& udata); +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp); +static int check_retval(void* returnvalue, const char* funcname, int opt); + +// Main Program +int main(int argc, char* argv[]) +{ + // general problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(10.0); // final time + sunindextype NEQ = 3; // number of dependent vars. + int rk_type = 1; // type of RK method [DIRK=0, ERK=1] + int order = 4; // order of accuracy for RK method + int test = 2; // test problem to run + sunbooleantype adaptive = SUNTRUE; // adaptive run vs convergence order + sunrealtype u0, v0, w0; // parameters + + // general problem variables + int retval; // reusable error-checking flag + N_Vector y = NULL; // empty vector for storing solution + N_Vector* yref = NULL; // empty vectors for storing reference solution + void* arkode_mem = NULL; // empty ARKStep memory structure + void* arkode_ref = NULL; // empty ARKStep memory structure for reference solution + SUNMatrix A = NULL; // empty matrix for solver + SUNLinearSolver LS = NULL; // empty linear solver object + UserData udata; // user-data structure + sunrealtype* ydata = NULL; + udata.ep = SUN_RCONST(0.0004); // stiffness parameter + udata.Npart = 20; // partition size + + // + // Initialization + // + + // Retrieve the command-line options: Npart ord method ep test + if (argc > 1) udata.Npart = atoi(argv[1]); + if (argc > 2) order = atoi(argv[2]); + if (argc > 3) rk_type = atoi(argv[3]); + if (argc > 4) udata.ep = SUNStrToReal(argv[4]); + if (argc > 5) test = atoi(argv[5]); + + // Check arguments for validity + // method = {0, 1} + // test = {1, 2, 3} + // ep > 0 + // Npart > 0 + if ((rk_type < 0) || (rk_type > 1)) + { + cerr << "ERROR: RK type be an integer in {0,1} \n"; + return (-1); + } + if ((test < 1) || (test > 3)) + { + cerr << "ERROR: test type be an integer in {1,2,3} \n"; + return (-1); + } + if (udata.ep <= ZERO) + { + cerr << "ERROR: ep must be a positive real number\n"; + return (-1); + } + if (udata.Npart < 1) + { + cerr << "ERROR: Npart must be a positive integer\n"; + return (-1); + } + + // Handle adaptive run vs order-of-convergence run + if (order < 0) + { + adaptive = SUNFALSE; + order = abs(order); + } + if (order == 0) order = 4; + + // set up the test problem according to the desired test + if (test == 1) + { + u0 = SUN_RCONST(3.9); + v0 = SUN_RCONST(1.1); + w0 = SUN_RCONST(2.8); + udata.a = SUN_RCONST(1.2); + udata.b = SUN_RCONST(2.5); + } + else if (test == 3) + { + u0 = SUN_RCONST(3.0); + v0 = SUN_RCONST(3.0); + w0 = SUN_RCONST(3.5); + udata.a = SUN_RCONST(0.5); + udata.b = SUN_RCONST(3.0); + } + else + { + u0 = SUN_RCONST(1.2); + v0 = SUN_RCONST(3.1); + w0 = SUN_RCONST(3.0); + udata.a = SUN_RCONST(1.0); + udata.b = SUN_RCONST(3.5); + } + + // Initial problem output (and set implicit solver tolerances as needed) + cout + << "\nAccumulated error estimation test (stiff Brusselator ODE problem):\n"; + cout << " time domain: (" << T0 << "," << Tf << "]\n"; + cout << " partition size = " << udata.Npart << endl; + cout << " initial conditions: u0 = " << u0 << ", v0 = " << v0 + << ", w0 = " << w0 << endl; + cout << " problem parameters: a = " << udata.a << ", b = " << udata.b + << ", ep = " << udata.ep << endl; + if (rk_type == 0) { cout << " DIRK solver, order = " << order << endl; } + else if (rk_type == 1) + { + cout << " ERK solver, order = " << order << endl; + } + + // + // Problem Setup + // + + // Create SUNDIALS context + sundials::Context ctx; + + // Create serial vectors for the solution and reference + y = N_VNew_Serial(NEQ, ctx); + if (check_retval((void*)y, "N_VNew_Serial", 0)) return 1; + yref = N_VCloneVectorArray(udata.Npart + 1, y); + if (check_retval((void*)yref, "N_VNew_Serial", 0)) return 1; + ydata = N_VGetArrayPointer(y); + if (check_retval((void*)ydata, "N_VGetArrayPointer", 0)) return 1; + + // Generate reference solution + ydata[0] = u0; + ydata[1] = v0; + ydata[2] = w0; + arkode_ref = ARKStepCreate(fn, NULL, T0, y, ctx); + if (check_retval((void*)arkode_ref, "ARKStepCreate", 0)) return 1; + retval = ARKodeSetUserData(arkode_ref, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetOrder(arkode_ref, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(arkode_ref, SUN_RCONST(1.e-10), SUN_RCONST(1.e-12)); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_ref, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + N_VScale(ONE, y, yref[0]); + sunrealtype hpart = (Tf - T0) / udata.Npart; + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + sunrealtype t = T0 + ipart * hpart; + retval = ARKodeSetStopTime(arkode_ref, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_ref, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + N_VScale(ONE, y, yref[ipart + 1]); + } + ARKodeFree(&arkode_ref); + + // Set up ARKStep integrator + ydata[0] = u0; + ydata[1] = v0; + ydata[2] = w0; + if (rk_type == 0) + { // DIRK method + arkode_mem = ARKStepCreate(NULL, fn, T0, y, ctx); + } + else + { // ERK method + arkode_mem = ARKStepCreate(fn, NULL, T0, y, ctx); + } + if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) return 1; + retval = ARKodeSetUserData(arkode_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, SUN_RCONST(1.e-4), SUN_RCONST(1.e-9)); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + if (rk_type == 0) + { // DIRK method + A = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)A, "SUNDenseMatrix", 0)) return 1; + LS = SUNLinSol_Dense(y, A, ctx); + if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return 1; + retval = ARKodeSetJacFn(arkode_mem, Jac); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + } + else + { // ERK method + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + } + + // Integrate ODE, based on run type + if (adaptive) + { + retval = adaptive_run(arkode_mem, y, T0, Tf, rk_type, order, yref, udata); + if (check_retval(&retval, "adaptive_run", 1)) return 1; + } + else + { + retval = fixed_run(arkode_mem, y, T0, Tf, rk_type, order, yref, udata); + if (check_retval(&retval, "fixed_run", 1)) return 1; + } + + // Clean up and return + ARKodeFree(&arkode_mem); + if (LS) { SUNLinSolFree(LS); } // free system linear solver + if (A) { SUNMatDestroy(A); } // free system matrix + N_VDestroy(y); // Free y and yref vectors + N_VDestroyVectorArray(yref, udata.Npart + 1); + return 0; +} + +//------------------------------ +// Functions called by the solver +//------------------------------ + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function + dydata[0] = udata->a - (w + ONE) * u + v * u * u; + dydata[1] = w * u - v * u * u; + dydata[2] = (udata->b - w) / udata->ep - w * u; + + // Return with success + return 0; +} + +static int Jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the Jacobian + SM_ELEMENT_D(J, 0, 0) = -(w + ONE) + TWO * u * v; + SM_ELEMENT_D(J, 0, 1) = u * u; + SM_ELEMENT_D(J, 0, 2) = -u; + + SM_ELEMENT_D(J, 1, 0) = w - TWO * u * v; + SM_ELEMENT_D(J, 1, 1) = -u * u; + SM_ELEMENT_D(J, 1, 2) = u; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -ONE / udata->ep - u; + + // Return with success + return 0; +} + +/*------------------------------- + * Private helper functions + *-------------------------------*/ + +//------------------------------ +// Private helper functions +//------------------------------ + +static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, N_Vector* yref, + UserData& udata) +{ + // Reused variables + int retval; + sunrealtype t; + sunrealtype hpart = (Tf - T0) / udata.Npart; + sunrealtype abstol = SUN_RCONST(1.e-12); + vector<sunrealtype> rtols = {SUN_RCONST(1.e-2), SUN_RCONST(1.e-4), + SUN_RCONST(1.e-6)}; + vector<ARKAccumError> accum_types = {ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, + ARK_ACCUMERROR_AVG}; + vector<sunrealtype> dsm(udata.Npart); + vector<sunrealtype> dsm_est(udata.Npart); + vector<long int> Nsteps(udata.Npart); + + // Loop over tolerances + cout << "\nAdaptive-step runs:\n"; + for (size_t irtol = 0; irtol < rtols.size(); irtol++) + { + // Loop over accumulation types + for (size_t iaccum = 0; iaccum < accum_types.size(); iaccum++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve over partition interval + t = T0 + ipart * hpart; + N_VScale(ONE, yref[ipart], y); + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + } + else + { // ERK + retval = ARKStepReInit(arkode_mem, fn, NULL, t, y); + } + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, rtols[irtol], abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + // Compute/print solution error + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* yrefdata = N_VGetArrayPointer(yref[ipart + 1]); + const sunrealtype udsm = abs(ydata[0] - yrefdata[0]) / + (abstol + rtols[irtol] * abs(yrefdata[0])); + const sunrealtype vdsm = abs(ydata[1] - yrefdata[1]) / + (abstol + rtols[irtol] * abs(yrefdata[1])); + const sunrealtype wdsm = abs(ydata[2] - yrefdata[2]) / + (abstol + rtols[irtol] * abs(yrefdata[2])); + dsm[ipart] = + rtols[irtol] * + sqrt((udsm * udsm + vdsm * vdsm + wdsm * wdsm) / SUN_RCONST(3.0)); + cout << " rtol " << rtols[irtol] << " rk_type " << rk_type + << " order " << order << " acc " << accum_types[iaccum] << " t " + << t << " dsm " << dsm[ipart] << " dsm_est " << dsm_est[ipart] + << " nsteps " << Nsteps[ipart] << endl; + } + } + } + + return (0); +} + +static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, sunrealtype Tf, + int rk_type, int order, N_Vector* yref, UserData& udata) +{ + // Reused variables + int retval; + sunrealtype hpart = (Tf - T0) / udata.Npart; + long int nsteps2; + sunrealtype t, t2; + sunrealtype reltol = SUN_RCONST(1.e-9); + sunrealtype abstol = SUN_RCONST(1.e-12); + N_Vector y2 = N_VClone(y); + N_Vector ewt = N_VClone(y); + ; + N_Vector vtemp = N_VClone(y); + + // Set array of fixed step sizes to use, storage for corresponding errors/orders + sunrealtype hmax = (Tf - T0) / 400; + if (rk_type == 1) hmax = min(hmax, udata.ep); + vector<sunrealtype> hvals = {hmax, hmax / 4, hmax / 16, hmax / 64}; + vector<ARKAccumError> accum_types = {ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, + ARK_ACCUMERROR_AVG}; + vector<sunrealtype> dsm(udata.Npart); + vector<sunrealtype> dsm_est(udata.Npart); + vector<long int> Nsteps(udata.Npart); + + // Loop over step sizes + cout << "\nFixed-step runs:\n"; + for (size_t ih = 0; ih < hvals.size(); ih++) + { + // Loop over built-in accumulation types + for (size_t iaccum = 0; iaccum < accum_types.size(); iaccum++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve to Tf + t = T0 + ipart * hpart; + N_VScale(ONE, yref[ipart], y); + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + } + else + { // ERK + retval = ARKStepReInit(arkode_mem, fn, NULL, t, y); + } + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + if (rk_type == 0) + { + retval = ARKodeSetJacEvalFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(arkode_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + } + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + // Compute/print solution error + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* yrefdata = N_VGetArrayPointer(yref[ipart + 1]); + const sunrealtype udsm = abs(ydata[0] - yrefdata[0]) / + (abstol + reltol * abs(yrefdata[0])); + const sunrealtype vdsm = abs(ydata[1] - yrefdata[1]) / + (abstol + reltol * abs(yrefdata[1])); + const sunrealtype wdsm = abs(ydata[2] - yrefdata[2]) / + (abstol + reltol * abs(yrefdata[2])); + dsm[ipart] = reltol * sqrt((udsm * udsm + vdsm * vdsm + wdsm * wdsm) / + SUN_RCONST(3.0)); + cout << " h " << hvals[ih] << " rk_type " << rk_type << " order " + << order << " acc " << accum_types[iaccum] << " t " << t + << " dsm " << dsm[ipart] << " dsm_est " << dsm_est[ipart] + << " nsteps " << Nsteps[ipart] << endl; + } + } + + // Test double-step error estimator + + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve over partition interval + t = t2 = T0 + ipart * hpart; + N_VScale(ONE, yref[ipart], y); + N_VScale(ONE, yref[ipart], y2); + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + } + else + { // ERK + retval = ARKStepReInit(arkode_mem, fn, NULL, t, y); + } + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, ARK_ACCUMERROR_NONE); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + if (rk_type == 0) + { + retval = ARKodeSetJacEvalFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(arkode_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + } + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t2, y2); + } + else + { // ERK + retval = ARKStepReInit(arkode_mem, fn, NULL, t2, y2); + } + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, 2.0 * hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t2 + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t2 + hpart, y2, &t2, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &nsteps2); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + retval = computeErrorWeights(y2, ewt, reltol, abstol, vtemp); + if (check_retval(&retval, "computeErrorWeights", 1)) break; + N_VLinearSum(ONE, y2, -ONE, y, y2); + dsm_est[ipart] = reltol * N_VWrmsNorm(y2, ewt); + Nsteps[ipart] += nsteps2; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* yrefdata = N_VGetArrayPointer(yref[ipart + 1]); + const sunrealtype udsm = abs(ydata[0] - yrefdata[0]) / + (abstol + reltol * abs(yrefdata[0])); + const sunrealtype vdsm = abs(ydata[1] - yrefdata[1]) / + (abstol + reltol * abs(yrefdata[1])); + const sunrealtype wdsm = abs(ydata[2] - yrefdata[2]) / + (abstol + reltol * abs(yrefdata[2])); + dsm[ipart] = reltol * sqrt((udsm * udsm + vdsm * vdsm + wdsm * wdsm) / + SUN_RCONST(3.0)); + cout << " h " << hvals[ih] << " rk_type " << rk_type << " order " + << order << " acc " << 2 << " t " << t << " dsm " << dsm[ipart] + << " dsm_est " << dsm_est[ipart] << " nsteps " << Nsteps[ipart] + << endl; + } + } + + N_VDestroy(y2); + N_VDestroy(ewt); + return (0); +} + +/* Error weight calculation routine (mimics what's in ARKODE already) */ +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp) +{ + N_VAbs(ycur, vtemp); + N_VScale(rtol, vtemp, vtemp); + N_VAddConst(vtemp, atol, vtemp); + N_VInv(vtemp, weight); + return (0); +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a retval so check if + retval >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* returnvalue, const char* funcname, int opt) +{ + int* retval; + + // Check if SUNDIALS function returned NULL pointer - no memory allocated + if (opt == 0 && returnvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + // Check if retval < 0 + else if (opt == 1) + { + retval = (int*)returnvalue; + if (*retval < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *retval); + return 1; + } + } + + // Check if function returned NULL pointer - no memory allocated + else if (opt == 2 && returnvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_-4_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_-4_0.out new file mode 100644 index 0000000000..717234ba15 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_-4_0.out @@ -0,0 +1,329 @@ + +Accumulated error estimation test (stiff Brusselator ODE problem): + time domain: (0,10] + partition size = 20 + initial conditions: u0 = 1.2, v0 = 3.1, w0 = 3 + problem parameters: a = 1, b = 3.5, ep = 0.0004 + DIRK solver, order = 4 + +Fixed-step runs: + h 0.025 rk_type 0 order 4 acc 1 t 0.5 dsm 2.02741e-07 dsm_est 0.244873 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 1 dsm 4.36512e-10 dsm_est 9.15797e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 1.5 dsm 1.47944e-09 dsm_est 1.03904e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 2 dsm 3.07014e-09 dsm_est 7.16968e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 2.5 dsm 2.41009e-09 dsm_est 9.26427e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 3 dsm 2.2919e-10 dsm_est 1.68058e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 3.5 dsm 2.10843e-11 dsm_est 1.6358e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 4 dsm 4.85414e-11 dsm_est 8.11006e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 4.5 dsm 1.96723e-10 dsm_est 1.90108e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 5 dsm 8.22132e-10 dsm_est 5.32797e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 5.5 dsm 1.54757e-09 dsm_est 9.55312e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 6 dsm 1.4066e-09 dsm_est 5.43427e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 6.5 dsm 1.53642e-07 dsm_est 8.50911e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 7 dsm 4.94724e-06 dsm_est 0.000100467 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 7.5 dsm 4.18294e-08 dsm_est 1.0711e-05 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 8 dsm 1.04878e-08 dsm_est 1.1263e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 8.5 dsm 2.79702e-09 dsm_est 2.16903e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 9 dsm 1.60168e-09 dsm_est 1.38178e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 9.5 dsm 1.4347e-09 dsm_est 1.88007e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 1 t 10 dsm 5.54538e-10 dsm_est 1.51522e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 0.5 dsm 2.02741e-07 dsm_est 0.270414 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 1 dsm 4.36512e-10 dsm_est 1.01676e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 1.5 dsm 1.47944e-09 dsm_est 1.91745e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 2 dsm 3.07014e-09 dsm_est 7.81488e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 2.5 dsm 2.41009e-09 dsm_est 7.35801e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 3 dsm 2.2919e-10 dsm_est 2.95688e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 3.5 dsm 2.10843e-11 dsm_est 2.56198e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 4 dsm 4.85414e-11 dsm_est 9.1097e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 4.5 dsm 1.96723e-10 dsm_est 1.8883e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 5 dsm 8.22132e-10 dsm_est 7.19339e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 5.5 dsm 1.54757e-09 dsm_est 1.54279e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 6 dsm 1.4066e-09 dsm_est 2.77932e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 6.5 dsm 1.53642e-07 dsm_est 3.43927e-06 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 7 dsm 4.94724e-06 dsm_est 0.000536526 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 7.5 dsm 4.18294e-08 dsm_est 2.81303e-05 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 8 dsm 1.04878e-08 dsm_est 1.09073e-06 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 8.5 dsm 2.79702e-09 dsm_est 2.81903e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 9 dsm 1.60168e-09 dsm_est 1.22752e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 9.5 dsm 1.4347e-09 dsm_est 3.48997e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 10 dsm 5.54538e-10 dsm_est 1.97881e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 0.5 dsm 2.02741e-07 dsm_est 0.0135207 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 1 dsm 4.36512e-10 dsm_est 5.08381e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 1.5 dsm 1.47944e-09 dsm_est 9.58723e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 2 dsm 3.07014e-09 dsm_est 3.90744e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 2.5 dsm 2.41009e-09 dsm_est 3.67901e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 3 dsm 2.2919e-10 dsm_est 1.47844e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 3.5 dsm 2.10843e-11 dsm_est 1.28099e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 4 dsm 4.85414e-11 dsm_est 4.55485e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 4.5 dsm 1.96723e-10 dsm_est 9.4415e-11 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 5 dsm 8.22132e-10 dsm_est 3.5967e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 5.5 dsm 1.54757e-09 dsm_est 7.71393e-10 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 6 dsm 1.4066e-09 dsm_est 1.38966e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 6.5 dsm 1.53642e-07 dsm_est 1.71964e-07 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 7 dsm 4.94724e-06 dsm_est 2.68263e-05 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 7.5 dsm 4.18294e-08 dsm_est 1.40652e-06 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 8 dsm 1.04878e-08 dsm_est 5.45367e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 8.5 dsm 2.79702e-09 dsm_est 1.40952e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 9 dsm 1.60168e-09 dsm_est 6.13761e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 9.5 dsm 1.4347e-09 dsm_est 1.74499e-08 nsteps 20 + h 0.025 rk_type 0 order 4 acc 3 t 10 dsm 5.54538e-10 dsm_est 9.89407e-09 nsteps 20 + h 0.025 rk_type 0 order 4 acc 2 t 0.5 dsm 2.02741e-07 dsm_est 2.04151e-07 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 1 dsm 4.36512e-10 dsm_est 1.51075e-09 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 1.5 dsm 1.47944e-09 dsm_est 1.30553e-09 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 2 dsm 3.07014e-09 dsm_est 6.93616e-10 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 2.5 dsm 2.41009e-09 dsm_est 3.64938e-09 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 3 dsm 2.2919e-10 dsm_est 1.30625e-09 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 3.5 dsm 2.10843e-11 dsm_est 3.14425e-10 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 4 dsm 4.85414e-11 dsm_est 7.33721e-10 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 4.5 dsm 1.96723e-10 dsm_est 6.03307e-11 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 5 dsm 8.22132e-10 dsm_est 6.73954e-10 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 5.5 dsm 1.54757e-09 dsm_est 2.31912e-10 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 6 dsm 1.4066e-09 dsm_est 2.44839e-08 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 6.5 dsm 1.53642e-07 dsm_est 2.36231e-06 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 7 dsm 4.94724e-06 dsm_est 8.33486e-05 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 7.5 dsm 4.18294e-08 dsm_est 5.85759e-07 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 8 dsm 1.04878e-08 dsm_est 1.52644e-07 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 8.5 dsm 2.79702e-09 dsm_est 5.7594e-08 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 9 dsm 1.60168e-09 dsm_est 3.77187e-08 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 9.5 dsm 1.4347e-09 dsm_est 2.25916e-09 nsteps 30 + h 0.025 rk_type 0 order 4 acc 2 t 10 dsm 5.54538e-10 dsm_est 8.39636e-09 nsteps 30 + h 0.00625 rk_type 0 order 4 acc 1 t 0.5 dsm 2.01526e-08 dsm_est 0.12061 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 1 dsm 9.02564e-12 dsm_est 3.15224e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 1.5 dsm 6.18719e-12 dsm_est 1.15612e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 2 dsm 1.21264e-11 dsm_est 3.56333e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 2.5 dsm 9.39437e-12 dsm_est 3.71652e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 3 dsm 6.39567e-12 dsm_est 6.60675e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 3.5 dsm 4.31321e-12 dsm_est 1.02486e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 4 dsm 5.26346e-12 dsm_est 6.34128e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 4.5 dsm 3.00982e-11 dsm_est 6.6337e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 5 dsm 3.35644e-12 dsm_est 3.78322e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 5.5 dsm 1.37915e-11 dsm_est 3.71144e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 6 dsm 9.91766e-11 dsm_est 2.23847e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 6.5 dsm 3.01672e-09 dsm_est 3.42521e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 7 dsm 1.77811e-08 dsm_est 4.60341e-07 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 7.5 dsm 7.42418e-10 dsm_est 6.0223e-08 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 8 dsm 3.89202e-10 dsm_est 4.90508e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 8.5 dsm 3.7018e-11 dsm_est 2.41013e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 9 dsm 2.94415e-11 dsm_est 5.60347e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 9.5 dsm 1.42778e-11 dsm_est 7.48066e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 1 t 10 dsm 4.93463e-12 dsm_est 6.33468e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 0.5 dsm 2.01526e-08 dsm_est 0.141954 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 1 dsm 9.02564e-12 dsm_est 1.9256e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 1.5 dsm 6.18719e-12 dsm_est 3.09827e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 2 dsm 1.21264e-11 dsm_est 1.26799e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 2.5 dsm 9.39437e-12 dsm_est 1.15943e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 3 dsm 6.39567e-12 dsm_est 4.63554e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31321e-12 dsm_est 4.07949e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 4 dsm 5.26346e-12 dsm_est 1.47561e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00982e-11 dsm_est 3.61156e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 5 dsm 3.35644e-12 dsm_est 1.54366e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 5.5 dsm 1.37915e-11 dsm_est 2.39536e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 6 dsm 9.91766e-11 dsm_est 4.28866e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 6.5 dsm 3.01672e-09 dsm_est 5.01151e-08 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 7 dsm 1.77811e-08 dsm_est 9.3156e-06 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 7.5 dsm 7.42418e-10 dsm_est 5.06067e-07 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 8 dsm 3.89202e-10 dsm_est 1.79275e-08 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 8.5 dsm 3.7018e-11 dsm_est 4.65518e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 9 dsm 2.94415e-11 dsm_est 1.94773e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.42778e-11 dsm_est 5.55728e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 10 dsm 4.93463e-12 dsm_est 3.15451e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 0.5 dsm 2.01526e-08 dsm_est 0.00177442 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 1 dsm 9.02564e-12 dsm_est 2.40701e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 1.5 dsm 6.18719e-12 dsm_est 3.87284e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 2 dsm 1.21264e-11 dsm_est 1.58498e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 2.5 dsm 9.39437e-12 dsm_est 1.44929e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 3 dsm 6.39567e-12 dsm_est 5.79442e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 3.5 dsm 4.31321e-12 dsm_est 5.09937e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 4 dsm 5.26346e-12 dsm_est 1.84452e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 4.5 dsm 3.00982e-11 dsm_est 4.51445e-13 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 5 dsm 3.35644e-12 dsm_est 1.92957e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 5.5 dsm 1.37915e-11 dsm_est 2.9942e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 6 dsm 9.91766e-11 dsm_est 5.36083e-12 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 6.5 dsm 3.01672e-09 dsm_est 6.26439e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 7 dsm 1.77811e-08 dsm_est 1.16445e-07 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 7.5 dsm 7.42418e-10 dsm_est 6.32584e-09 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 8 dsm 3.89202e-10 dsm_est 2.24093e-10 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 8.5 dsm 3.7018e-11 dsm_est 5.81897e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 9 dsm 2.94415e-11 dsm_est 2.43467e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 9.5 dsm 1.42778e-11 dsm_est 6.94659e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 3 t 10 dsm 4.93463e-12 dsm_est 3.94313e-11 nsteps 80 + h 0.00625 rk_type 0 order 4 acc 2 t 0.5 dsm 2.01526e-08 dsm_est 5.96471e-08 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 1 dsm 9.02564e-12 dsm_est 2.62428e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 1.5 dsm 6.18719e-12 dsm_est 8.82608e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 2 dsm 1.21264e-11 dsm_est 1.81216e-10 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 2.5 dsm 9.39437e-12 dsm_est 1.39896e-10 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 3 dsm 6.39567e-12 dsm_est 1.30298e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31321e-12 dsm_est 1.17983e-12 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 4 dsm 5.26346e-12 dsm_est 2.82746e-12 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00982e-11 dsm_est 1.13213e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 5 dsm 3.35644e-12 dsm_est 4.77357e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 5.5 dsm 1.37915e-11 dsm_est 1.78455e-10 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 6 dsm 9.91766e-11 dsm_est 1.16563e-09 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 6.5 dsm 3.01672e-09 dsm_est 1.01849e-08 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 7 dsm 1.77811e-08 dsm_est 2.72392e-07 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 7.5 dsm 7.42418e-10 dsm_est 3.28703e-09 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 8 dsm 3.89202e-10 dsm_est 2.22651e-09 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 8.5 dsm 3.7018e-11 dsm_est 5.88999e-10 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 9 dsm 2.94415e-11 dsm_est 2.41758e-10 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.42778e-11 dsm_est 9.06696e-11 nsteps 120 + h 0.00625 rk_type 0 order 4 acc 2 t 10 dsm 4.93463e-12 dsm_est 3.23538e-11 nsteps 120 + h 0.0015625 rk_type 0 order 4 acc 1 t 0.5 dsm 1.12995e-09 dsm_est 0.0161685 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 1 dsm 8.83314e-12 dsm_est 4.22807e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 1.5 dsm 1.84069e-12 dsm_est 1.48779e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 2 dsm 2.23198e-13 dsm_est 3.06e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 2.5 dsm 5.57615e-13 dsm_est 3.16293e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 3 dsm 6.33215e-12 dsm_est 9.28211e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 3.5 dsm 4.31345e-12 dsm_est 1.06725e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 4 dsm 5.25911e-12 dsm_est 7.27486e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 4.5 dsm 3.00873e-11 dsm_est 8.86785e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 5 dsm 1.04948e-12 dsm_est 5.07072e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 5.5 dsm 6.97828e-12 dsm_est 1.75823e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 6 dsm 5.98205e-11 dsm_est 1.17286e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 6.5 dsm 1.87435e-11 dsm_est 1.34855e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 7 dsm 6.39659e-10 dsm_est 1.86951e-09 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 7.5 dsm 1.83962e-11 dsm_est 2.58837e-10 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 8 dsm 1.77418e-10 dsm_est 3.6664e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 8.5 dsm 2.78724e-12 dsm_est 2.99588e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 9 dsm 2.4955e-11 dsm_est 5.0593e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 9.5 dsm 1.29649e-11 dsm_est 4.22112e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 1 t 10 dsm 4.44459e-12 dsm_est 2.19913e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 0.5 dsm 1.12995e-09 dsm_est 0.0169353 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 1 dsm 8.83314e-12 dsm_est 6.94907e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 1.5 dsm 1.84069e-12 dsm_est 6.39115e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 2 dsm 2.23198e-13 dsm_est 2.81498e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 2.5 dsm 5.57615e-13 dsm_est 2.25223e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 3 dsm 6.33215e-12 dsm_est 7.33588e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31345e-12 dsm_est 7.40715e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 4 dsm 5.25911e-12 dsm_est 3.01034e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00873e-11 dsm_est 1.41635e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 5 dsm 1.04948e-12 dsm_est 7.0874e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 5.5 dsm 6.97828e-12 dsm_est 3.92895e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 6 dsm 5.98205e-11 dsm_est 8.03594e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 6.5 dsm 1.87435e-11 dsm_est 7.78898e-10 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 7 dsm 6.39659e-10 dsm_est 1.4936e-07 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 7.5 dsm 1.83962e-11 dsm_est 8.20268e-09 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 8 dsm 1.77418e-10 dsm_est 2.85684e-10 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 8.5 dsm 2.78724e-12 dsm_est 1.0185e-10 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 9 dsm 2.4955e-11 dsm_est 3.17765e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.29649e-11 dsm_est 9.11804e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 10 dsm 4.44459e-12 dsm_est 5.14784e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 0.5 dsm 1.12995e-09 dsm_est 5.29229e-05 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 1 dsm 8.83314e-12 dsm_est 2.17158e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 1.5 dsm 1.84069e-12 dsm_est 1.99723e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 2 dsm 2.23198e-13 dsm_est 8.79682e-15 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 2.5 dsm 5.57615e-13 dsm_est 7.03822e-15 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 3 dsm 6.33215e-12 dsm_est 2.29246e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 3.5 dsm 4.31345e-12 dsm_est 2.31473e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 4 dsm 5.25911e-12 dsm_est 9.40731e-15 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 4.5 dsm 3.00873e-11 dsm_est 4.42611e-15 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 5 dsm 1.04948e-12 dsm_est 2.21481e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 5.5 dsm 6.97828e-12 dsm_est 1.2278e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 6 dsm 5.98205e-11 dsm_est 2.51123e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 6.5 dsm 1.87435e-11 dsm_est 2.43406e-12 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 7 dsm 6.39659e-10 dsm_est 4.6675e-10 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 7.5 dsm 1.83962e-11 dsm_est 2.56334e-11 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 8 dsm 1.77418e-10 dsm_est 8.92764e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 8.5 dsm 2.78724e-12 dsm_est 3.18282e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 9 dsm 2.4955e-11 dsm_est 9.93014e-14 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 9.5 dsm 1.29649e-11 dsm_est 2.84939e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 3 t 10 dsm 4.44459e-12 dsm_est 1.6087e-13 nsteps 320 + h 0.0015625 rk_type 0 order 4 acc 2 t 0.5 dsm 1.12995e-09 dsm_est 2.29243e-09 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 1 dsm 8.83314e-12 dsm_est 1.01708e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 1.5 dsm 1.84069e-12 dsm_est 3.46845e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 2 dsm 2.23198e-13 dsm_est 7.13223e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 2.5 dsm 5.57615e-13 dsm_est 5.5096e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 3 dsm 6.33215e-12 dsm_est 5.10951e-14 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31345e-12 dsm_est 4.40878e-15 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 4 dsm 5.25911e-12 dsm_est 1.13938e-14 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00873e-11 dsm_est 3.76833e-14 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 5 dsm 1.04948e-12 dsm_est 1.75165e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 5.5 dsm 6.97828e-12 dsm_est 6.76285e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 6 dsm 5.98205e-11 dsm_est 4.58434e-12 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 6.5 dsm 1.87435e-11 dsm_est 1.80355e-10 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 7 dsm 6.39659e-10 dsm_est 7.2409e-10 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 7.5 dsm 1.83962e-11 dsm_est 3.9885e-11 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 8 dsm 1.77418e-10 dsm_est 1.97323e-11 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 8.5 dsm 2.78724e-12 dsm_est 2.15597e-12 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 9 dsm 2.4955e-11 dsm_est 9.29203e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.29649e-11 dsm_est 3.52852e-13 nsteps 480 + h 0.0015625 rk_type 0 order 4 acc 2 t 10 dsm 4.44459e-12 dsm_est 1.2586e-13 nsteps 480 + h 0.000390625 rk_type 0 order 4 acc 1 t 0.5 dsm 4.75504e-11 dsm_est 0.000360159 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 1 dsm 8.83253e-12 dsm_est 9.41667e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 1.5 dsm 1.8399e-12 dsm_est 3.31853e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 2 dsm 2.21232e-13 dsm_est 6.92196e-15 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 2.5 dsm 5.57029e-13 dsm_est 7.49969e-16 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 3 dsm 6.33194e-12 dsm_est 2.00962e-15 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 3.5 dsm 4.31407e-12 dsm_est 2.37702e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 4 dsm 5.25853e-12 dsm_est 1.62111e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 1 t 4.5 dsm 3.00881e-11 dsm_est 1.97207e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 5 dsm 1.04964e-12 dsm_est 1.12957e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 5.5 dsm 6.97849e-12 dsm_est 3.92461e-15 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 6 dsm 5.9817e-11 dsm_est 2.61272e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 6.5 dsm 1.43381e-11 dsm_est 2.24496e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 7 dsm 2.94602e-12 dsm_est 7.37178e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 7.5 dsm 1.82124e-11 dsm_est 1.0358e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 8 dsm 1.77421e-10 dsm_est 6.91895e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 8.5 dsm 2.81466e-12 dsm_est 6.67292e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 9 dsm 2.496e-11 dsm_est 1.06333e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 9.5 dsm 1.2967e-11 dsm_est 9.36985e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 1 t 10 dsm 4.44606e-12 dsm_est 4.86957e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 0.5 dsm 4.75504e-11 dsm_est 0.000554502 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 1 dsm 8.83253e-12 dsm_est 2.11629e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 1.5 dsm 1.8399e-12 dsm_est 1.46902e-13 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 2 dsm 2.21232e-13 dsm_est 8.08167e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 2.5 dsm 5.57029e-13 dsm_est 6.12168e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 3 dsm 6.33194e-12 dsm_est 1.25998e-13 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31407e-12 dsm_est 1.46827e-13 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 4 dsm 5.25853e-12 dsm_est 8.29578e-14 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00881e-11 dsm_est 7.37135e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 5 dsm 1.04964e-12 dsm_est 2.31694e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 5.5 dsm 6.97849e-12 dsm_est 8.07729e-14 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 6 dsm 5.9817e-11 dsm_est 1.6949e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 6.5 dsm 1.43381e-11 dsm_est 1.23339e-11 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 7 dsm 2.94602e-12 dsm_est 2.35276e-09 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 7.5 dsm 1.82124e-11 dsm_est 1.29354e-10 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 8 dsm 1.77421e-10 dsm_est 4.5438e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 8.5 dsm 2.81466e-12 dsm_est 2.19649e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 9 dsm 2.496e-11 dsm_est 5.49027e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.2967e-11 dsm_est 1.50929e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 10 dsm 4.44606e-12 dsm_est 8.49403e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 0.5 dsm 4.75504e-11 dsm_est 4.33205e-07 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 1 dsm 8.83253e-12 dsm_est 1.65335e-16 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 1.5 dsm 1.8399e-12 dsm_est 1.14767e-16 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 2 dsm 2.21232e-13 dsm_est 6.3138e-17 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 2.5 dsm 5.57029e-13 dsm_est 4.78256e-17 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 3 dsm 6.33194e-12 dsm_est 9.84357e-17 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 3.5 dsm 4.31407e-12 dsm_est 1.14709e-16 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 4 dsm 5.25853e-12 dsm_est 6.48108e-17 nsteps 1280 + h 0.000390625 rk_type 0 order 4 acc 3 t 4.5 dsm 3.00881e-11 dsm_est 5.75886e-17 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 5 dsm 1.04964e-12 dsm_est 1.81011e-16 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 5.5 dsm 6.97849e-12 dsm_est 6.31038e-17 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 6 dsm 5.9817e-11 dsm_est 1.32414e-16 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 6.5 dsm 1.43381e-11 dsm_est 9.63583e-15 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 7 dsm 2.94602e-12 dsm_est 1.8381e-12 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 7.5 dsm 1.82124e-11 dsm_est 1.01058e-13 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 8 dsm 1.77421e-10 dsm_est 3.54984e-15 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 8.5 dsm 2.81466e-12 dsm_est 1.71601e-15 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 9 dsm 2.496e-11 dsm_est 4.28927e-16 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 9.5 dsm 1.2967e-11 dsm_est 1.17913e-15 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 3 t 10 dsm 4.44606e-12 dsm_est 6.63596e-16 nsteps 1281 + h 0.000390625 rk_type 0 order 4 acc 2 t 0.5 dsm 4.75504e-11 dsm_est 2.63435e-10 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 1 dsm 8.83253e-12 dsm_est 2.03794e-15 nsteps 1922 + h 0.000390625 rk_type 0 order 4 acc 2 t 1.5 dsm 1.8399e-12 dsm_est 3.00814e-14 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 2 dsm 2.21232e-13 dsm_est 4.15128e-14 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 2.5 dsm 5.57029e-13 dsm_est 1.58845e-15 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 3 dsm 6.33194e-12 dsm_est 5.52712e-16 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 3.5 dsm 4.31407e-12 dsm_est 1.6025e-15 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 4 dsm 5.25853e-12 dsm_est 9.59599e-16 nsteps 1920 + h 0.000390625 rk_type 0 order 4 acc 2 t 4.5 dsm 3.00881e-11 dsm_est 5.29038e-14 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 5 dsm 1.04964e-12 dsm_est 7.31539e-14 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 5.5 dsm 6.97849e-12 dsm_est 1.08618e-13 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 6 dsm 5.9817e-11 dsm_est 2.24477e-13 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 6.5 dsm 1.43381e-11 dsm_est 1.46745e-12 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 7 dsm 2.94602e-12 dsm_est 3.70208e-11 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 7.5 dsm 1.82124e-11 dsm_est 5.47248e-13 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 8 dsm 1.77421e-10 dsm_est 4.99362e-13 nsteps 1921 + h 0.000390625 rk_type 0 order 4 acc 2 t 8.5 dsm 2.81466e-12 dsm_est 6.74349e-15 nsteps 1922 + h 0.000390625 rk_type 0 order 4 acc 2 t 9 dsm 2.496e-11 dsm_est 1.91764e-15 nsteps 1922 + h 0.000390625 rk_type 0 order 4 acc 2 t 9.5 dsm 1.2967e-11 dsm_est 1.53261e-15 nsteps 1922 + h 0.000390625 rk_type 0 order 4 acc 2 t 10 dsm 4.44606e-12 dsm_est 7.50123e-16 nsteps 1922 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_3_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_3_1.out new file mode 100644 index 0000000000..8e2a11d1e1 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_3_1.out @@ -0,0 +1,189 @@ + +Accumulated error estimation test (stiff Brusselator ODE problem): + time domain: (0,10] + partition size = 20 + initial conditions: u0 = 1.2, v0 = 3.1, w0 = 3 + problem parameters: a = 1, b = 3.5, ep = 0.0004 + ERK solver, order = 3 + +Adaptive-step runs: + rtol 0.01 rk_type 1 order 3 acc 1 t 0.5 dsm 0.00199866 dsm_est 0.00993779 nsteps 492 + rtol 0.01 rk_type 1 order 3 acc 1 t 1 dsm 0.00148824 dsm_est 0.00998004 nsteps 473 + rtol 0.01 rk_type 1 order 3 acc 1 t 1.5 dsm 0.00330184 dsm_est 0.00995476 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 1 t 2 dsm 0.000346469 dsm_est 0.00994631 nsteps 450 + rtol 0.01 rk_type 1 order 3 acc 1 t 2.5 dsm 0.0103541 dsm_est 0.00997759 nsteps 430 + rtol 0.01 rk_type 1 order 3 acc 1 t 3 dsm 0.0108871 dsm_est 0.00988341 nsteps 447 + rtol 0.01 rk_type 1 order 3 acc 1 t 3.5 dsm 0.00245302 dsm_est 0.00996656 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 1 t 4 dsm 0.00613073 dsm_est 0.00995474 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 1 t 4.5 dsm 0.00368671 dsm_est 0.00994184 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 1 t 5 dsm 0.000382639 dsm_est 0.0099621 nsteps 466 + rtol 0.01 rk_type 1 order 3 acc 1 t 5.5 dsm 0.00138001 dsm_est 0.00996202 nsteps 443 + rtol 0.01 rk_type 1 order 3 acc 1 t 6 dsm 0.00204504 dsm_est 0.00995126 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 1 t 6.5 dsm 0.00544154 dsm_est 0.00991159 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 1 t 7 dsm 0.00167909 dsm_est 0.00996267 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 1 t 7.5 dsm 0.00762228 dsm_est 0.0099702 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 1 t 8 dsm 0.00815849 dsm_est 0.00996685 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 1 t 8.5 dsm 0.00479833 dsm_est 0.00996162 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 1 t 9 dsm 0.00530688 dsm_est 0.00991151 nsteps 460 + rtol 0.01 rk_type 1 order 3 acc 1 t 9.5 dsm 0.00453492 dsm_est 0.00996905 nsteps 461 + rtol 0.01 rk_type 1 order 3 acc 1 t 10 dsm 0.000530102 dsm_est 0.00998737 nsteps 461 + rtol 0.01 rk_type 1 order 3 acc 2 t 0.5 dsm 0.00199866 dsm_est 2.09808 nsteps 492 + rtol 0.01 rk_type 1 order 3 acc 2 t 1 dsm 0.00148824 dsm_est 1.89996 nsteps 473 + rtol 0.01 rk_type 1 order 3 acc 2 t 1.5 dsm 0.00330184 dsm_est 1.97327 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 2 t 2 dsm 0.000346469 dsm_est 1.9 nsteps 450 + rtol 0.01 rk_type 1 order 3 acc 2 t 2.5 dsm 0.0103541 dsm_est 1.68792 nsteps 430 + rtol 0.01 rk_type 1 order 3 acc 2 t 3 dsm 0.0108871 dsm_est 1.87188 nsteps 447 + rtol 0.01 rk_type 1 order 3 acc 2 t 3.5 dsm 0.00245302 dsm_est 1.9467 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 2 t 4 dsm 0.00613073 dsm_est 1.9405 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 2 t 4.5 dsm 0.00368671 dsm_est 1.94315 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 2 t 5 dsm 0.000382639 dsm_est 1.83475 nsteps 466 + rtol 0.01 rk_type 1 order 3 acc 2 t 5.5 dsm 0.00138001 dsm_est 1.86654 nsteps 443 + rtol 0.01 rk_type 1 order 3 acc 2 t 6 dsm 0.00204504 dsm_est 1.9419 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 2 t 6.5 dsm 0.00544154 dsm_est 1.96228 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 2 t 7 dsm 0.00167909 dsm_est 1.90643 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 2 t 7.5 dsm 0.00762228 dsm_est 1.79247 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 2 t 8 dsm 0.00815849 dsm_est 1.84371 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 2 t 8.5 dsm 0.00479833 dsm_est 1.97902 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 2 t 9 dsm 0.00530688 dsm_est 1.94856 nsteps 460 + rtol 0.01 rk_type 1 order 3 acc 2 t 9.5 dsm 0.00453492 dsm_est 1.91705 nsteps 461 + rtol 0.01 rk_type 1 order 3 acc 2 t 10 dsm 0.000530102 dsm_est 1.91042 nsteps 461 + rtol 0.01 rk_type 1 order 3 acc 3 t 0.5 dsm 0.00199866 dsm_est 0.00443873 nsteps 492 + rtol 0.01 rk_type 1 order 3 acc 3 t 1 dsm 0.00148824 dsm_est 0.00401521 nsteps 473 + rtol 0.01 rk_type 1 order 3 acc 3 t 1.5 dsm 0.00330184 dsm_est 0.00441678 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 3 t 2 dsm 0.000346469 dsm_est 0.00425191 nsteps 450 + rtol 0.01 rk_type 1 order 3 acc 3 t 2.5 dsm 0.0103541 dsm_est 0.00381705 nsteps 430 + rtol 0.01 rk_type 1 order 3 acc 3 t 3 dsm 0.0108871 dsm_est 0.0041182 nsteps 447 + rtol 0.01 rk_type 1 order 3 acc 3 t 3.5 dsm 0.00245302 dsm_est 0.00412426 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 3 t 4 dsm 0.00613073 dsm_est 0.00411939 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 3 t 4.5 dsm 0.00368671 dsm_est 0.00412003 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 3 t 5 dsm 0.000382639 dsm_est 0.00388215 nsteps 466 + rtol 0.01 rk_type 1 order 3 acc 3 t 5.5 dsm 0.00138001 dsm_est 0.00418117 nsteps 443 + rtol 0.01 rk_type 1 order 3 acc 3 t 6 dsm 0.00204504 dsm_est 0.00411411 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 3 t 6.5 dsm 0.00544154 dsm_est 0.00415099 nsteps 465 + rtol 0.01 rk_type 1 order 3 acc 3 t 7 dsm 0.00167909 dsm_est 0.00420804 nsteps 459 + rtol 0.01 rk_type 1 order 3 acc 3 t 7.5 dsm 0.00762228 dsm_est 0.00381522 nsteps 464 + rtol 0.01 rk_type 1 order 3 acc 3 t 8 dsm 0.00815849 dsm_est 0.00390452 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 3 t 8.5 dsm 0.00479833 dsm_est 0.0042077 nsteps 463 + rtol 0.01 rk_type 1 order 3 acc 3 t 9 dsm 0.00530688 dsm_est 0.00413179 nsteps 460 + rtol 0.01 rk_type 1 order 3 acc 3 t 9.5 dsm 0.00453492 dsm_est 0.00406231 nsteps 461 + rtol 0.01 rk_type 1 order 3 acc 3 t 10 dsm 0.000530102 dsm_est 0.00404373 nsteps 461 + rtol 0.0001 rk_type 1 order 3 acc 1 t 0.5 dsm 4.52215e-05 dsm_est 9.69104e-05 nsteps 501 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1 dsm 1.81631e-05 dsm_est 9.49781e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1.5 dsm 2.77186e-05 dsm_est 9.49662e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2 dsm 1.52803e-05 dsm_est 9.4909e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2.5 dsm 4.78098e-05 dsm_est 9.49489e-05 nsteps 464 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3 dsm 2.25476e-05 dsm_est 9.47509e-05 nsteps 465 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3.5 dsm 5.07755e-05 dsm_est 9.47129e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4 dsm 2.29469e-05 dsm_est 9.49709e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4.5 dsm 3.88359e-05 dsm_est 9.46293e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 1 t 5 dsm 1.51443e-05 dsm_est 9.49444e-05 nsteps 469 + rtol 0.0001 rk_type 1 order 3 acc 1 t 5.5 dsm 1.12906e-05 dsm_est 9.45516e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 1 t 6 dsm 2.05734e-05 dsm_est 9.49206e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 1 t 6.5 dsm 2.51686e-05 dsm_est 9.49703e-05 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 1 t 7 dsm 6.45125e-05 dsm_est 9.93155e-05 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 1 t 7.5 dsm 6.30239e-05 dsm_est 9.4983e-05 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 1 t 8 dsm 2.85855e-05 dsm_est 9.44898e-05 nsteps 478 + rtol 0.0001 rk_type 1 order 3 acc 1 t 8.5 dsm 4.15619e-05 dsm_est 9.47874e-05 nsteps 480 + rtol 0.0001 rk_type 1 order 3 acc 1 t 9 dsm 9.3894e-06 dsm_est 9.91602e-05 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 1 t 9.5 dsm 1.95141e-05 dsm_est 9.49246e-05 nsteps 482 + rtol 0.0001 rk_type 1 order 3 acc 1 t 10 dsm 2.83938e-05 dsm_est 9.5044e-05 nsteps 479 + rtol 0.0001 rk_type 1 order 3 acc 2 t 0.5 dsm 4.52215e-05 dsm_est 0.0204462 nsteps 501 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1 dsm 1.81631e-05 dsm_est 0.0195291 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1.5 dsm 2.77186e-05 dsm_est 0.018621 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2 dsm 1.52803e-05 dsm_est 0.0193526 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2.5 dsm 4.78098e-05 dsm_est 0.0188743 nsteps 464 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3 dsm 2.25476e-05 dsm_est 0.0188411 nsteps 465 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3.5 dsm 5.07755e-05 dsm_est 0.0186928 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4 dsm 2.29469e-05 dsm_est 0.0192501 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4.5 dsm 3.88359e-05 dsm_est 0.0190057 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 2 t 5 dsm 1.51443e-05 dsm_est 0.0192704 nsteps 469 + rtol 0.0001 rk_type 1 order 3 acc 2 t 5.5 dsm 1.12906e-05 dsm_est 0.0189727 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 2 t 6 dsm 2.05734e-05 dsm_est 0.0185915 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 2 t 6.5 dsm 2.51686e-05 dsm_est 0.0195025 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 2 t 7 dsm 6.45125e-05 dsm_est 0.019722 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 2 t 7.5 dsm 6.30239e-05 dsm_est 0.0180237 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 2 t 8 dsm 2.85855e-05 dsm_est 0.019557 nsteps 478 + rtol 0.0001 rk_type 1 order 3 acc 2 t 8.5 dsm 4.15619e-05 dsm_est 0.0195763 nsteps 480 + rtol 0.0001 rk_type 1 order 3 acc 2 t 9 dsm 9.3894e-06 dsm_est 0.0195109 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 2 t 9.5 dsm 1.95141e-05 dsm_est 0.0192328 nsteps 482 + rtol 0.0001 rk_type 1 order 3 acc 2 t 10 dsm 2.83938e-05 dsm_est 0.0195692 nsteps 479 + rtol 0.0001 rk_type 1 order 3 acc 3 t 0.5 dsm 4.52215e-05 dsm_est 4.27945e-05 nsteps 501 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1 dsm 1.81631e-05 dsm_est 4.18953e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1.5 dsm 2.77186e-05 dsm_est 4.01946e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2 dsm 1.52803e-05 dsm_est 4.11232e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2.5 dsm 4.78098e-05 dsm_est 4.02797e-05 nsteps 464 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3 dsm 2.25476e-05 dsm_est 4.21717e-05 nsteps 465 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3.5 dsm 5.07755e-05 dsm_est 4.02733e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4 dsm 2.29469e-05 dsm_est 4.06438e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4.5 dsm 3.88359e-05 dsm_est 4.00905e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 3 t 5 dsm 1.51443e-05 dsm_est 4.10729e-05 nsteps 469 + rtol 0.0001 rk_type 1 order 3 acc 3 t 5.5 dsm 1.12906e-05 dsm_est 4.00276e-05 nsteps 470 + rtol 0.0001 rk_type 1 order 3 acc 3 t 6 dsm 2.05734e-05 dsm_est 4.01607e-05 nsteps 474 + rtol 0.0001 rk_type 1 order 3 acc 3 t 6.5 dsm 2.51686e-05 dsm_est 4.12268e-05 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 3 t 7 dsm 6.45125e-05 dsm_est 4.17595e-05 nsteps 481 + rtol 0.0001 rk_type 1 order 3 acc 3 t 7.5 dsm 6.30239e-05 dsm_est 3.85507e-05 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 3 t 8 dsm 2.85855e-05 dsm_est 4.15334e-05 nsteps 478 + rtol 0.0001 rk_type 1 order 3 acc 3 t 8.5 dsm 4.15619e-05 dsm_est 4.13654e-05 nsteps 480 + rtol 0.0001 rk_type 1 order 3 acc 3 t 9 dsm 9.3894e-06 dsm_est 4.17504e-05 nsteps 475 + rtol 0.0001 rk_type 1 order 3 acc 3 t 9.5 dsm 1.95141e-05 dsm_est 4.05915e-05 nsteps 482 + rtol 0.0001 rk_type 1 order 3 acc 3 t 10 dsm 2.83938e-05 dsm_est 4.15708e-05 nsteps 479 + rtol 1e-06 rk_type 1 order 3 acc 1 t 0.5 dsm 6.49367e-08 dsm_est 9.89086e-07 nsteps 550 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1 dsm 5.83524e-07 dsm_est 9.4678e-07 nsteps 488 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1.5 dsm 2.01442e-08 dsm_est 9.47358e-07 nsteps 491 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2 dsm 6.89174e-08 dsm_est 9.48104e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2.5 dsm 3.25214e-07 dsm_est 9.49113e-07 nsteps 463 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3 dsm 3.48745e-07 dsm_est 9.48334e-07 nsteps 481 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3.5 dsm 1.27971e-06 dsm_est 9.46641e-07 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4 dsm 5.22124e-07 dsm_est 9.49243e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4.5 dsm 6.25795e-07 dsm_est 9.48421e-07 nsteps 486 + rtol 1e-06 rk_type 1 order 3 acc 1 t 5 dsm 5.82624e-07 dsm_est 9.48091e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 1 t 5.5 dsm 5.29296e-07 dsm_est 9.82269e-07 nsteps 483 + rtol 1e-06 rk_type 1 order 3 acc 1 t 6 dsm 3.47222e-07 dsm_est 9.87002e-07 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 1 t 6.5 dsm 8.05504e-07 dsm_est 9.48638e-07 nsteps 477 + rtol 1e-06 rk_type 1 order 3 acc 1 t 7 dsm 4.05624e-08 dsm_est 9.61095e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 1 t 7.5 dsm 7.28832e-08 dsm_est 9.4602e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 1 t 8 dsm 9.01356e-07 dsm_est 9.48084e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 1 t 8.5 dsm 9.82212e-07 dsm_est 9.4573e-07 nsteps 489 + rtol 1e-06 rk_type 1 order 3 acc 1 t 9 dsm 2.03978e-07 dsm_est 9.47478e-07 nsteps 468 + rtol 1e-06 rk_type 1 order 3 acc 1 t 9.5 dsm 2.77163e-07 dsm_est 9.49943e-07 nsteps 475 + rtol 1e-06 rk_type 1 order 3 acc 1 t 10 dsm 4.2482e-07 dsm_est 9.47165e-07 nsteps 476 + rtol 1e-06 rk_type 1 order 3 acc 2 t 0.5 dsm 6.49367e-08 dsm_est 0.000190015 nsteps 550 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1 dsm 5.83524e-07 dsm_est 0.000191707 nsteps 488 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1.5 dsm 2.01442e-08 dsm_est 0.000154747 nsteps 491 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2 dsm 6.89174e-08 dsm_est 0.000191171 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2.5 dsm 3.25214e-07 dsm_est 0.000189145 nsteps 463 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3 dsm 3.48745e-07 dsm_est 0.000193684 nsteps 481 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3.5 dsm 1.27971e-06 dsm_est 0.000198922 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4 dsm 5.22124e-07 dsm_est 0.000197072 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4.5 dsm 6.25795e-07 dsm_est 0.000191436 nsteps 486 + rtol 1e-06 rk_type 1 order 3 acc 2 t 5 dsm 5.82624e-07 dsm_est 0.000196185 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 2 t 5.5 dsm 5.29296e-07 dsm_est 0.000199124 nsteps 483 + rtol 1e-06 rk_type 1 order 3 acc 2 t 6 dsm 3.47222e-07 dsm_est 0.000199936 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 2 t 6.5 dsm 8.05504e-07 dsm_est 0.000193196 nsteps 477 + rtol 1e-06 rk_type 1 order 3 acc 2 t 7 dsm 4.05624e-08 dsm_est 0.000198041 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 2 t 7.5 dsm 7.28832e-08 dsm_est 0.000199497 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 2 t 8 dsm 9.01356e-07 dsm_est 0.000197732 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 2 t 8.5 dsm 9.82212e-07 dsm_est 0.000189126 nsteps 489 + rtol 1e-06 rk_type 1 order 3 acc 2 t 9 dsm 2.03978e-07 dsm_est 0.000189873 nsteps 468 + rtol 1e-06 rk_type 1 order 3 acc 2 t 9.5 dsm 2.77163e-07 dsm_est 0.000192779 nsteps 475 + rtol 1e-06 rk_type 1 order 3 acc 2 t 10 dsm 4.2482e-07 dsm_est 0.000186705 nsteps 476 + rtol 1e-06 rk_type 1 order 3 acc 3 t 0.5 dsm 6.49367e-08 dsm_est 3.76189e-07 nsteps 550 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1 dsm 5.83524e-07 dsm_est 4.03986e-07 nsteps 488 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1.5 dsm 2.01442e-08 dsm_est 3.17531e-07 nsteps 491 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2 dsm 6.89174e-08 dsm_est 4.03334e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2.5 dsm 3.25214e-07 dsm_est 4.26069e-07 nsteps 463 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3 dsm 3.48745e-07 dsm_est 4.13425e-07 nsteps 481 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3.5 dsm 1.27971e-06 dsm_est 4.2656e-07 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4 dsm 5.22124e-07 dsm_est 4.19481e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4.5 dsm 6.25795e-07 dsm_est 4.03617e-07 nsteps 486 + rtol 1e-06 rk_type 1 order 3 acc 3 t 5 dsm 5.82624e-07 dsm_est 4.13815e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 3 t 5.5 dsm 5.29296e-07 dsm_est 4.27331e-07 nsteps 483 + rtol 1e-06 rk_type 1 order 3 acc 3 t 6 dsm 3.47222e-07 dsm_est 4.28557e-07 nsteps 484 + rtol 1e-06 rk_type 1 order 3 acc 3 t 6.5 dsm 8.05504e-07 dsm_est 4.16753e-07 nsteps 477 + rtol 1e-06 rk_type 1 order 3 acc 3 t 7 dsm 4.05624e-08 dsm_est 4.18718e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 3 t 7.5 dsm 7.28832e-08 dsm_est 4.22063e-07 nsteps 487 + rtol 1e-06 rk_type 1 order 3 acc 3 t 8 dsm 9.01356e-07 dsm_est 4.22563e-07 nsteps 485 + rtol 1e-06 rk_type 1 order 3 acc 3 t 8.5 dsm 9.82212e-07 dsm_est 3.97686e-07 nsteps 489 + rtol 1e-06 rk_type 1 order 3 acc 3 t 9 dsm 2.03978e-07 dsm_est 4.06169e-07 nsteps 468 + rtol 1e-06 rk_type 1 order 3 acc 3 t 9.5 dsm 2.77163e-07 dsm_est 4.12601e-07 nsteps 475 + rtol 1e-06 rk_type 1 order 3 acc 3 t 10 dsm 4.2482e-07 dsm_est 3.9924e-07 nsteps 476 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_5_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_5_0.out new file mode 100644 index 0000000000..36b63bfbfd --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator_20_5_0.out @@ -0,0 +1,189 @@ + +Accumulated error estimation test (stiff Brusselator ODE problem): + time domain: (0,10] + partition size = 20 + initial conditions: u0 = 1.2, v0 = 3.1, w0 = 3 + problem parameters: a = 1, b = 3.5, ep = 0.0004 + DIRK solver, order = 5 + +Adaptive-step runs: + rtol 0.01 rk_type 0 order 5 acc 1 t 0.5 dsm 7.48644e-05 dsm_est 3.4373e-05 nsteps 9 + rtol 0.01 rk_type 0 order 5 acc 1 t 1 dsm 0.000110257 dsm_est 2.23308e-06 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 1 t 1.5 dsm 0.00132404 dsm_est 2.08137e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 2 dsm 0.00110273 dsm_est 6.3665e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 2.5 dsm 6.10485e-05 dsm_est 1.85399e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 3 dsm 0.000275174 dsm_est 6.46876e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 3.5 dsm 0.00032811 dsm_est 1.68426e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 4 dsm 7.35974e-05 dsm_est 4.88814e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 4.5 dsm 0.000394423 dsm_est 1.74045e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 5 dsm 4.44693e-05 dsm_est 4.77027e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 5.5 dsm 0.000153383 dsm_est 6.89334e-07 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 1 t 6 dsm 0.00039377 dsm_est 3.77896e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 6.5 dsm 0.000506258 dsm_est 1.01998e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 7 dsm 0.00148699 dsm_est 4.63864e-05 nsteps 12 + rtol 0.01 rk_type 0 order 5 acc 1 t 7.5 dsm 0.000435975 dsm_est 0.000225656 nsteps 4 + rtol 0.01 rk_type 0 order 5 acc 1 t 8 dsm 0.000824606 dsm_est 1.36787e-05 nsteps 7 + rtol 0.01 rk_type 0 order 5 acc 1 t 8.5 dsm 0.00100819 dsm_est 1.09309e-05 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 9 dsm 0.00058073 dsm_est 4.52926e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 9.5 dsm 6.70214e-05 dsm_est 2.50118e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 1 t 10 dsm 0.000490488 dsm_est 4.64334e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 0.5 dsm 7.48644e-05 dsm_est 5.4592e-05 nsteps 9 + rtol 0.01 rk_type 0 order 5 acc 2 t 1 dsm 0.000110257 dsm_est 2.23312e-06 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 2 t 1.5 dsm 0.00132404 dsm_est 2.37777e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 2 dsm 0.00110273 dsm_est 8.17396e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 2.5 dsm 6.10485e-05 dsm_est 3.28054e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 3 dsm 0.000275174 dsm_est 6.76339e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 3.5 dsm 0.00032811 dsm_est 1.69526e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 4 dsm 7.35974e-05 dsm_est 4.93897e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 4.5 dsm 0.000394423 dsm_est 1.74465e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 5 dsm 4.44693e-05 dsm_est 4.91596e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 5.5 dsm 0.000153383 dsm_est 6.90221e-07 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 2 t 6 dsm 0.00039377 dsm_est 4.6301e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 6.5 dsm 0.000506258 dsm_est 1.7875e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 7 dsm 0.00148699 dsm_est 7.28369e-05 nsteps 12 + rtol 0.01 rk_type 0 order 5 acc 2 t 7.5 dsm 0.000435975 dsm_est 0.000234031 nsteps 4 + rtol 0.01 rk_type 0 order 5 acc 2 t 8 dsm 0.000824606 dsm_est 2.56036e-05 nsteps 7 + rtol 0.01 rk_type 0 order 5 acc 2 t 8.5 dsm 0.00100819 dsm_est 1.09812e-05 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 9 dsm 0.00058073 dsm_est 4.93642e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 9.5 dsm 6.70214e-05 dsm_est 2.55332e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 2 t 10 dsm 0.000490488 dsm_est 4.66143e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 0.5 dsm 7.48644e-05 dsm_est 8.43563e-06 nsteps 9 + rtol 0.01 rk_type 0 order 5 acc 3 t 1 dsm 0.000110257 dsm_est 1.92448e-06 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 3 t 1.5 dsm 0.00132404 dsm_est 1.36392e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 2 dsm 0.00110273 dsm_est 3.97765e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 2.5 dsm 6.10485e-05 dsm_est 1.42453e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 3 dsm 0.000275174 dsm_est 3.75126e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 3.5 dsm 0.00032811 dsm_est 1.23035e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 4 dsm 7.35974e-05 dsm_est 3.49622e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 4.5 dsm 0.000394423 dsm_est 1.33208e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 5 dsm 4.44693e-05 dsm_est 3.3167e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 5.5 dsm 0.000153383 dsm_est 5.43622e-07 nsteps 5 + rtol 0.01 rk_type 0 order 5 acc 3 t 6 dsm 0.00039377 dsm_est 1.51647e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 6.5 dsm 0.000506258 dsm_est 6.62913e-07 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 7 dsm 0.00148699 dsm_est 1.33552e-05 nsteps 12 + rtol 0.01 rk_type 0 order 5 acc 3 t 7.5 dsm 0.000435975 dsm_est 0.000128373 nsteps 4 + rtol 0.01 rk_type 0 order 5 acc 3 t 8 dsm 0.000824606 dsm_est 9.87403e-06 nsteps 7 + rtol 0.01 rk_type 0 order 5 acc 3 t 8.5 dsm 0.00100819 dsm_est 5.15624e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 9 dsm 0.00058073 dsm_est 2.61771e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 9.5 dsm 6.70214e-05 dsm_est 1.42911e-06 nsteps 6 + rtol 0.01 rk_type 0 order 5 acc 3 t 10 dsm 0.000490488 dsm_est 3.46267e-06 nsteps 6 + rtol 0.0001 rk_type 0 order 5 acc 1 t 0.5 dsm 1.9124e-05 dsm_est 4.10549e-06 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 1 t 1 dsm 1.46639e-06 dsm_est 2.99051e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 1.5 dsm 1.49779e-06 dsm_est 2.8794e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 2 dsm 2.48711e-06 dsm_est 5.23997e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 2.5 dsm 8.68487e-07 dsm_est 8.11031e-09 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 3 dsm 4.6854e-06 dsm_est 3.54429e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 1 t 3.5 dsm 4.86491e-06 dsm_est 1.27286e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 1 t 4 dsm 9.38226e-06 dsm_est 6.18062e-10 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 4.5 dsm 3.64804e-06 dsm_est 5.92484e-10 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 5 dsm 1.20837e-06 dsm_est 1.11283e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 5.5 dsm 1.96373e-05 dsm_est 1.16786e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 1 t 6 dsm 6.78601e-06 dsm_est 5.56249e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 1 t 6.5 dsm 3.28653e-05 dsm_est 5.49255e-08 nsteps 8 + rtol 0.0001 rk_type 0 order 5 acc 1 t 7 dsm 1.0851e-05 dsm_est 2.95421e-06 nsteps 17 + rtol 0.0001 rk_type 0 order 5 acc 1 t 7.5 dsm 8.11463e-06 dsm_est 7.59043e-08 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 1 t 8 dsm 1.12113e-05 dsm_est 6.59216e-08 nsteps 7 + rtol 0.0001 rk_type 0 order 5 acc 1 t 8.5 dsm 7.59151e-06 dsm_est 8.65901e-08 nsteps 5 + rtol 0.0001 rk_type 0 order 5 acc 1 t 9 dsm 1.10466e-05 dsm_est 2.02617e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 1 t 9.5 dsm 1.12334e-05 dsm_est 1.10517e-07 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 1 t 10 dsm 9.05222e-07 dsm_est 1.64841e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 0.5 dsm 1.9124e-05 dsm_est 5.71969e-06 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 2 t 1 dsm 1.46639e-06 dsm_est 2.99989e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 1.5 dsm 1.49779e-06 dsm_est 2.89735e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 2 dsm 2.48711e-06 dsm_est 5.35748e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 2.5 dsm 8.68487e-07 dsm_est 1.05987e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 3 dsm 4.6854e-06 dsm_est 3.58967e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 3.5 dsm 4.86491e-06 dsm_est 1.53193e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 4 dsm 9.38226e-06 dsm_est 1.14771e-09 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 4.5 dsm 3.64804e-06 dsm_est 8.14332e-10 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 5 dsm 1.20837e-06 dsm_est 1.18132e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 5.5 dsm 1.96373e-05 dsm_est 1.51402e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 2 t 6 dsm 6.78601e-06 dsm_est 8.14402e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 6.5 dsm 3.28653e-05 dsm_est 1.13828e-07 nsteps 8 + rtol 0.0001 rk_type 0 order 5 acc 2 t 7 dsm 1.0851e-05 dsm_est 4.33597e-06 nsteps 17 + rtol 0.0001 rk_type 0 order 5 acc 2 t 7.5 dsm 8.11463e-06 dsm_est 2.04239e-07 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 2 t 8 dsm 1.12113e-05 dsm_est 6.62221e-08 nsteps 7 + rtol 0.0001 rk_type 0 order 5 acc 2 t 8.5 dsm 7.59151e-06 dsm_est 8.67008e-08 nsteps 5 + rtol 0.0001 rk_type 0 order 5 acc 2 t 9 dsm 1.10466e-05 dsm_est 3.06823e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 9.5 dsm 1.12334e-05 dsm_est 1.36785e-07 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 2 t 10 dsm 9.05222e-07 dsm_est 3.2806e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 0.5 dsm 1.9124e-05 dsm_est 8.037e-08 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 3 t 1 dsm 1.46639e-06 dsm_est 1.96624e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 1.5 dsm 1.49779e-06 dsm_est 1.97143e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 2 dsm 2.48711e-06 dsm_est 3.32323e-08 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 2.5 dsm 8.68487e-07 dsm_est 5.8804e-09 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 3 dsm 4.6854e-06 dsm_est 2.06494e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 3.5 dsm 4.86491e-06 dsm_est 7.91268e-09 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 4 dsm 9.38226e-06 dsm_est 5.58758e-10 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 4.5 dsm 3.64804e-06 dsm_est 4.12749e-10 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 5 dsm 1.20837e-06 dsm_est 6.31634e-09 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 5.5 dsm 1.96373e-05 dsm_est 7.63049e-09 nsteps 3 + rtol 0.0001 rk_type 0 order 5 acc 3 t 6 dsm 6.78601e-06 dsm_est 3.45501e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 6.5 dsm 3.28653e-05 dsm_est 2.5131e-08 nsteps 8 + rtol 0.0001 rk_type 0 order 5 acc 3 t 7 dsm 1.0851e-05 dsm_est 4.68539e-07 nsteps 17 + rtol 0.0001 rk_type 0 order 5 acc 3 t 7.5 dsm 8.11463e-06 dsm_est 1.75019e-08 nsteps 13 + rtol 0.0001 rk_type 0 order 5 acc 3 t 8 dsm 1.12113e-05 dsm_est 2.06416e-08 nsteps 7 + rtol 0.0001 rk_type 0 order 5 acc 3 t 8.5 dsm 7.59151e-06 dsm_est 4.50463e-08 nsteps 5 + rtol 0.0001 rk_type 0 order 5 acc 3 t 9 dsm 1.10466e-05 dsm_est 1.18403e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 9.5 dsm 1.12334e-05 dsm_est 6.19359e-08 nsteps 4 + rtol 0.0001 rk_type 0 order 5 acc 3 t 10 dsm 9.05222e-07 dsm_est 1.24356e-08 nsteps 4 + rtol 1e-06 rk_type 0 order 5 acc 1 t 0.5 dsm 1.88136e-07 dsm_est 1.26411e-07 nsteps 20 + rtol 1e-06 rk_type 0 order 5 acc 1 t 1 dsm 3.6815e-08 dsm_est 2.79712e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 1 t 1.5 dsm 3.46973e-08 dsm_est 3.51635e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 1 t 2 dsm 2.15722e-07 dsm_est 6.11647e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 1 t 2.5 dsm 9.55646e-08 dsm_est 1.88588e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 1 t 3 dsm 1.61192e-07 dsm_est 1.2608e-08 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 1 t 3.5 dsm 4.89781e-08 dsm_est 3.86937e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 1 t 4 dsm 2.89671e-09 dsm_est 1.89611e-10 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 1 t 4.5 dsm 1.33856e-07 dsm_est 1.34787e-10 nsteps 4 + rtol 1e-06 rk_type 0 order 5 acc 1 t 5 dsm 1.14768e-07 dsm_est 3.89832e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 1 t 5.5 dsm 3.35877e-07 dsm_est 5.30354e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 1 t 6 dsm 3.66079e-07 dsm_est 3.68188e-09 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 1 t 6.5 dsm 1.18284e-06 dsm_est 5.36543e-09 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 1 t 7 dsm 6.15151e-07 dsm_est 1.3137e-07 nsteps 32 + rtol 1e-06 rk_type 0 order 5 acc 1 t 7.5 dsm 7.6586e-08 dsm_est 5.37386e-09 nsteps 17 + rtol 1e-06 rk_type 0 order 5 acc 1 t 8 dsm 4.14322e-07 dsm_est 7.83969e-10 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 1 t 8.5 dsm 2.50606e-07 dsm_est 1.87037e-08 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 1 t 9 dsm 1.33343e-07 dsm_est 8.70204e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 1 t 9.5 dsm 1.44237e-07 dsm_est 1.59014e-08 nsteps 6 + rtol 1e-06 rk_type 0 order 5 acc 1 t 10 dsm 1.34853e-07 dsm_est 2.74315e-08 nsteps 6 + rtol 1e-06 rk_type 0 order 5 acc 2 t 0.5 dsm 1.88136e-07 dsm_est 3.10757e-07 nsteps 20 + rtol 1e-06 rk_type 0 order 5 acc 2 t 1 dsm 3.6815e-08 dsm_est 2.85172e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 2 t 1.5 dsm 3.46973e-08 dsm_est 3.53495e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 2 t 2 dsm 2.15722e-07 dsm_est 6.21173e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 2 t 2.5 dsm 9.55646e-08 dsm_est 1.95849e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 2 t 3 dsm 1.61192e-07 dsm_est 1.42375e-08 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 2 t 3.5 dsm 4.89781e-08 dsm_est 5.44995e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 2 t 4 dsm 2.89671e-09 dsm_est 2.05845e-10 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 2 t 4.5 dsm 1.33856e-07 dsm_est 1.4524e-10 nsteps 4 + rtol 1e-06 rk_type 0 order 5 acc 2 t 5 dsm 1.14768e-07 dsm_est 3.97399e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 2 t 5.5 dsm 3.35877e-07 dsm_est 5.39098e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 2 t 6 dsm 3.66079e-07 dsm_est 4.54425e-09 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 2 t 6.5 dsm 1.18284e-06 dsm_est 1.43453e-08 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 2 t 7 dsm 6.15151e-07 dsm_est 3.71172e-07 nsteps 32 + rtol 1e-06 rk_type 0 order 5 acc 2 t 7.5 dsm 7.6586e-08 dsm_est 1.05078e-08 nsteps 17 + rtol 1e-06 rk_type 0 order 5 acc 2 t 8 dsm 4.14322e-07 dsm_est 1.80819e-09 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 2 t 8.5 dsm 2.50606e-07 dsm_est 1.87833e-08 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 2 t 9 dsm 1.33343e-07 dsm_est 1.22048e-08 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 2 t 9.5 dsm 1.44237e-07 dsm_est 3.40516e-08 nsteps 6 + rtol 1e-06 rk_type 0 order 5 acc 2 t 10 dsm 1.34853e-07 dsm_est 3.35247e-08 nsteps 6 + rtol 1e-06 rk_type 0 order 5 acc 3 t 0.5 dsm 1.88136e-07 dsm_est 1.26851e-08 nsteps 20 + rtol 1e-06 rk_type 0 order 5 acc 3 t 1 dsm 3.6815e-08 dsm_est 1.6608e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 3 t 1.5 dsm 3.46973e-08 dsm_est 1.70095e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 3 t 2 dsm 2.15722e-07 dsm_est 2.55077e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 3 t 2.5 dsm 9.55646e-08 dsm_est 8.55183e-10 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 3 t 3 dsm 1.61192e-07 dsm_est 6.55528e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 3 t 3.5 dsm 4.89781e-08 dsm_est 2.24419e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 3 t 4 dsm 2.89671e-09 dsm_est 1.14512e-10 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 3 t 4.5 dsm 1.33856e-07 dsm_est 9.42445e-11 nsteps 4 + rtol 1e-06 rk_type 0 order 5 acc 3 t 5 dsm 1.14768e-07 dsm_est 2.14148e-09 nsteps 5 + rtol 1e-06 rk_type 0 order 5 acc 3 t 5.5 dsm 3.35877e-07 dsm_est 2.26456e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 3 t 6 dsm 3.66079e-07 dsm_est 1.25374e-09 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 3 t 6.5 dsm 1.18284e-06 dsm_est 2.39129e-09 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 3 t 7 dsm 6.15151e-07 dsm_est 2.56642e-08 nsteps 32 + rtol 1e-06 rk_type 0 order 5 acc 3 t 7.5 dsm 7.6586e-08 dsm_est 1.02588e-09 nsteps 17 + rtol 1e-06 rk_type 0 order 5 acc 3 t 8 dsm 4.14322e-07 dsm_est 2.56944e-10 nsteps 13 + rtol 1e-06 rk_type 0 order 5 acc 3 t 8.5 dsm 2.50606e-07 dsm_est 7.50375e-09 nsteps 9 + rtol 1e-06 rk_type 0 order 5 acc 3 t 9 dsm 1.33343e-07 dsm_est 3.79527e-09 nsteps 7 + rtol 1e-06 rk_type 0 order 5 acc 3 t 9.5 dsm 1.44237e-07 dsm_est 1.06042e-08 nsteps 6 + rtol 1e-06 rk_type 0 order 5 acc 3 t 10 dsm 1.34853e-07 dsm_est 1.51614e-08 nsteps 6 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp new file mode 100644 index 0000000000..4a7cd7535e --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp @@ -0,0 +1,725 @@ +/* ---------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ---------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ---------------------------------------------------------------- + * Routine to test the accumulated temporal error estimation + * approaches from ARKStep and ERKStep. Uses a nonlinear + * Kvaerno-Prothero-Robinson ODE test problem with analytical + * solution, + * + * [u]' = [ G e ] [(u^2-p-1)/(2u)] + [ p'(t)/(2u) ] + * [v] [ e -1 ] [(v^2-q-2)/(2v)] [ q'(t)/(2v) ] + * + * where p(t) = cos(t), and q(t) = cos(omega*t*(1+exp(-(t-2)^2))). + * + * This problem has analytical solution given by + * u(t) = sqrt(2+p(t)), v(t) = sqrt(2+q(t)). + * We use the parameters: e = 0.1 and G = -10 [default] + * + * The stiffness of the problem is essentially determined + * by G, for |G| > 50 it is "stiff" and ideally suited to an + * implicit method. + * + * Coupling between the two components is determined by e, with + * coupling strength proportional to |e|. + * + * The "fast" variable, v, oscillates at a frequency "omega" times + * faster than u. + * + * We partition the full time integration interval, 0 < t < 5, into + * Npart pieces, and run the accumulation test over each. + * + * We use either the ARKStep/DIRK/Newton/Dense solver (0) or + * ERKStep (1). Either defaults to using a 4th-order method. + * + * By default, all runs use temporal adaptivity; however, if the + * requested 'ord' command-line input is negative, we run with + * order |ord|, using fixed step sizes. + * + * The program should be run with arguments in the following order: + * $ a.out Npart ord method G e omega + * Not all arguments are required, but these must be omitted from + * end-to-beginning, i.e. any one of + * $ a.out Npart ord method G e + * $ a.out Npart ord method G + * $ a.out Npart ord method + * $ a.out Npart ord + * $ a.out Npart + * $ a.out + * are acceptable. We require: + * * method = {0, 1} + * * G < 0.0 + * * omega > 0.0 + * * Npart > 0 + * + * For either temporally adaptive (ord >= 0) or fixed-step (ord < 0) + * runs, we test a variety of tolerances/step sizes, and compare + * the true error at the end of each partition against the + * integrator-reported accumulated error estimate. + * ----------------------------------------------------------------*/ + +// Header files +#include <arkode/arkode_arkstep.h> +#include <arkode/arkode_erkstep.h> +#include <cmath> +#include <iostream> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <string.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> +#include <sunmatrix/sunmatrix_dense.h> +#include <sunnonlinsol/sunnonlinsol_newton.h> +#include <vector> + +#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 + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +using namespace std; + +// User data structure +struct UserData +{ + sunrealtype G; + sunrealtype e; + sunrealtype omega; + int Npart; +}; + +// User-supplied functions called by the solver +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Private utility functions +static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, UserData& udata); +static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, UserData& udata); +static sunrealtype p(sunrealtype t); +static sunrealtype q(sunrealtype t, UserData& udata); +static sunrealtype pdot(sunrealtype t); +static sunrealtype qdot(sunrealtype t, UserData& udata); +static sunrealtype utrue(sunrealtype t); +static sunrealtype vtrue(sunrealtype t, UserData& udata); +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata); +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp); +static int check_retval(void* returnvalue, const char* funcname, int opt); + +// Main Program +int main(int argc, char* argv[]) +{ + // general problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(5.0); // final time + sunindextype NEQ = 2; // number of dependent vars. + int rk_type = 1; // type of RK method [DIRK=0, ERK=1] + int order = 4; // order of accuracy for RK method + sunbooleantype adaptive = SUNTRUE; // adaptive vs fixed-step run + + // general problem variables + int retval; // reusable error-checking flag + N_Vector y = NULL; // empty vector for the computed solution + void* arkode_mem = NULL; // empty ARKODE memory structure + SUNMatrix A = NULL; // empty system matrix + SUNLinearSolver LS = NULL; // empty system linear solver object + UserData udata; // user-data structure + udata.G = SUN_RCONST(-10.0); // stiffness parameter + udata.e = SUN_RCONST(0.1); // coupling strength + udata.omega = SUN_RCONST(5.0); // time scale ratio + udata.Npart = 20; // partition size + + // + // Initialization + // + + // Retrieve the command-line options: Npart ord method G e omega + if (argc > 1) udata.Npart = atoi(argv[1]); + if (argc > 2) order = atoi(argv[2]); + if (argc > 3) rk_type = atoi(argv[3]); + if (argc > 4) udata.G = SUNStrToReal(argv[4]); + if (argc > 5) udata.e = SUNStrToReal(argv[5]); + if (argc > 6) udata.omega = SUNStrToReal(argv[6]); + + // Check arguments for validity + // 0 <= rk_type <= 1 + // G < 0.0 + // omega > 0.0 + // Npart > 0 + if ((rk_type < 0) || (rk_type > 1)) + { + cerr << "ERROR: RK type be an integer in {0,1} \n"; + return (-1); + } + if (udata.G >= ZERO) + { + cerr << "ERROR: G must be a negative real number\n"; + return (-1); + } + if (udata.omega <= ZERO) + { + cerr << "ERROR: omega must be a positive real number\n"; + return (-1); + } + if (udata.Npart < 1) + { + cerr << "ERROR: Npart must be a positive integer\n"; + return (-1); + } + + // Handle adaptive run vs order-of-convergence run + if (order < 0) + { + adaptive = SUNFALSE; + order = abs(order); + } + if (order == 0) order = 4; + + // Initial problem output (and set implicit solver tolerances as needed) + cout << "\nAccumulated error estimation test (Nonlinear " + "Kvaerno-Prothero-Robinson problem):\n"; + cout << " time domain: (" << T0 << "," << Tf << "]\n"; + cout << " partition size = " << udata.Npart << endl; + cout << " G = " << udata.G << endl; + cout << " e = " << udata.e << endl; + cout << " omega = " << udata.omega << endl; + if (rk_type == 0) { cout << " DIRK solver, order = " << order << endl; } + else if (rk_type == 1) + { + cout << " ERK solver, order = " << order << endl; + } + + // + // Problem Setup + // + + // Create SUNDIALS context + sundials::Context ctx; + + // Create and initialize serial vector for the solution + y = N_VNew_Serial(NEQ, ctx); + if (check_retval((void*)y, "N_VNew_Serial", 0)) return 1; + retval = Ytrue(T0, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + + // Initialize ARKStep or ERKStep. + if (rk_type == 0) + { // DIRK method + + arkode_mem = ARKStepCreate(NULL, fn, T0, y, ctx); + if (check_retval((void*)arkode_mem, "ARKStepCreate", 0)) return 1; + + // Initialize/attach linear solvers (if required) + A = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)A, "SUNDenseMatrix", 0)) return 1; + LS = SUNLinSol_Dense(y, A, ctx); + if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return (1); + retval = ARKodeSetJacFn(arkode_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + + // Set desired solver order + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + + // Set the user data pointer + retval = ARKodeSetUserData(arkode_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + } + else + { // ERK method + + arkode_mem = ERKStepCreate(fn, T0, y, ctx); + if (check_retval((void*)arkode_mem, "ERKStepCreate", 0)) return 1; + + // Set maximum stepsize for ERK run + retval = ARKodeSetMaxStep(arkode_mem, ONE / abs(udata.G)); + if (check_retval(&retval, "ARKodeSetMaxStep", 1)) return (1); + + // Set desired solver order + retval = ARKodeSetOrder(arkode_mem, order); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + + // Set the user data pointer + retval = ARKodeSetUserData(arkode_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + } + + // Integrate ODE, based on run type + if (adaptive) + { + retval = adaptive_run(arkode_mem, y, T0, Tf, rk_type, order, udata); + if (check_retval(&retval, "adaptive_run", 1)) return 1; + } + else + { + retval = fixed_run(arkode_mem, y, T0, Tf, rk_type, order, udata); + if (check_retval(&retval, "fixed_run", 1)) return 1; + } + + // Clean up and return + ARKodeFree(&arkode_mem); + if (LS != NULL) SUNLinSolFree(LS); // free system linear solver + if (A != NULL) SUNMatDestroy(A); // free system matrix + N_VDestroy(y); // Free y vector + return 0; +} + +//------------------------------ +// Functions called by the solver +//------------------------------ + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [G e]*[(-2+u^2-p(t))/(2*u)] + [pdot(t)/(2u)] + // [e -1] [(-2+v^2-s(t))/(2*v)] [qdot(t)/(2v)] + tmp1 = (-TWO + u * u - p(t)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *udata)) / (TWO * v); + dydata[0] = udata->G * tmp1 + udata->e * tmp2 + pdot(t) / (TWO * u); + dydata[1] = udata->e * tmp1 - tmp2 + qdot(t, *udata) / (TWO * v); + + // Return with success + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype t11, t22; + + // fill in the Jacobian: + // [G e]*[1-(u^2-p(t)-2)/(2*u^2), 0] + [-r'(t)/(2*u^2), 0] + // [e -1] [0, 1-(v^2-s(t)-2)/(2*v^2)] [0, -s'(t)/(2*v^2)] + t11 = ONE - (u * u - p(t) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *udata) - TWO) / (TWO * v * v); + SM_ELEMENT_D(J, 0, 0) = udata->G * t11 - pdot(t) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = udata->e * t22; + SM_ELEMENT_D(J, 1, 0) = udata->e * t11; + SM_ELEMENT_D(J, 1, 1) = -t22 - qdot(t, *udata) / (TWO * v * v); + + // Return with success + return 0; +} + +//------------------------------ +// Private helper functions +//------------------------------ + +static int adaptive_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, UserData& udata) +{ + // Reused variables + int retval; + sunrealtype t; + sunrealtype hpart = (Tf - T0) / udata.Npart; + sunrealtype abstol = SUN_RCONST(1.e-12); + vector<sunrealtype> rtols = {SUN_RCONST(1.e-2), SUN_RCONST(1.e-4), + SUN_RCONST(1.e-6)}; + vector<ARKAccumError> accum_types = {ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, + ARK_ACCUMERROR_AVG}; + vector<sunrealtype> dsm(udata.Npart); + vector<sunrealtype> dsm_est(udata.Npart); + vector<long int> Nsteps(udata.Npart); + sunrealtype* ydata = N_VGetArrayPointer(y); + + // Loop over tolerances + cout << "\nAdaptive-step runs:\n"; + for (size_t irtol = 0; irtol < rtols.size(); irtol++) + { + // Loop over accumulation types + for (size_t iaccum = 0; iaccum < accum_types.size(); iaccum++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve over partition interval + t = T0 + ipart * hpart; + retval = Ytrue(t, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) + return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, rtols[irtol], abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + else + { // ERK + retval = ERKStepReInit(arkode_mem, fn, t, y); + if (check_retval(&retval, "ERKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) + return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, rtols[irtol], abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + + // Compute/print solution error + sunrealtype udsm = abs(ydata[0] - utrue(t)) / + (abstol + rtols[irtol] * abs(utrue(t))); + sunrealtype vdsm = abs(ydata[1] - vtrue(t, udata)) / + (abstol + rtols[irtol] * abs(vtrue(t, udata))); + dsm[ipart] = rtols[irtol] * sqrt(0.5 * (udsm * udsm + vdsm * vdsm)); + cout << " rtol " << rtols[irtol] << " rk_type " << rk_type + << " order " << order << " acc " << accum_types[iaccum] << " t " + << t << " dsm " << dsm[ipart] << " dsm_est " << dsm_est[ipart] + << " nsteps " << Nsteps[ipart] << endl; + } + } + } + + return (0); +} + +static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, int rk_type, int order, UserData& udata) +{ + // local variables + int retval; + sunrealtype hpart = (Tf - T0) / udata.Npart; + long int nsteps2; + sunrealtype t, t2; + sunrealtype reltol = SUN_RCONST(1.e-9); + sunrealtype abstol = SUN_RCONST(1.e-12); + N_Vector y2 = N_VClone(y); + N_Vector ewt = N_VClone(y); + N_Vector vtemp = N_VClone(y); + + // Set array of fixed step sizes to use, storage for corresponding errors/orders + sunrealtype hmax = (Tf - T0) / 1000; + if (rk_type == 1) hmax = min(hmax, ONE / abs(udata.G)); + vector<sunrealtype> hvals = {hmax, hmax / 4, hmax / 16, hmax / 64}; + vector<ARKAccumError> accum_types = {ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, + ARK_ACCUMERROR_AVG}; + vector<sunrealtype> dsm(udata.Npart); + vector<sunrealtype> dsm_est(udata.Npart); + vector<long int> Nsteps(udata.Npart); + sunrealtype* ydata = N_VGetArrayPointer(y); + + // Loop over step sizes + cout << "\nFixed-step runs:\n"; + for (size_t ih = 0; ih < hvals.size(); ih++) + { + // Loop over built-in accumulation types + for (size_t iaccum = 0; iaccum < accum_types.size(); iaccum++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve over partition interval + t = T0 + ipart * hpart; + retval = Ytrue(t, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) + return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetJacEvalFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(arkode_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + else + { // ERK + retval = ERKStepReInit(arkode_mem, fn, t, y); + if (check_retval(&retval, "ERKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, accum_types[iaccum]); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) + return 1; + retval = ARKodeResetAccumulatedError(arkode_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetAccumulatedError(arkode_mem, &(dsm_est[ipart])); + if (check_retval(&retval, "ARKodeGetAccumulatedError", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + + // Compute/print solution error + sunrealtype udsm = abs(ydata[0] - utrue(t)) / + (abstol + reltol * abs(utrue(t))); + sunrealtype vdsm = abs(ydata[1] - vtrue(t, udata)) / + (abstol + reltol * abs(vtrue(t, udata))); + dsm[ipart] = reltol * sqrt(0.5 * (udsm * udsm + vdsm * vdsm)); + cout << " h " << hvals[ih] << " rk_type " << rk_type << " order " + << order << " acc " << accum_types[iaccum] << " t " << t + << " dsm " << dsm[ipart] << " dsm_est " << dsm_est[ipart] + << " nsteps " << Nsteps[ipart] << endl; + } + } + + // Test double-step error estimator + + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run, and evolve over partition interval + t = t2 = T0 + ipart * hpart; + retval = Ytrue(t, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + retval = Ytrue(t2, y2, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + if (rk_type == 0) + { // DIRK + retval = ARKStepReInit(arkode_mem, NULL, fn, t, y); + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, ARK_ACCUMERROR_NONE); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetJacEvalFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(arkode_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(arkode_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + retval = ARKStepReInit(arkode_mem, NULL, fn, t2, y2); + if (check_retval(&retval, "ARKStepReInit", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, 2.0 * hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t2 + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t2 + hpart, y2, &t2, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &nsteps2); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + else + { // ERK + retval = ERKStepReInit(arkode_mem, fn, t, y); + if (check_retval(&retval, "ERKStepReInit", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(arkode_mem, ARK_ACCUMERROR_NONE); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + retval = ARKodeSetStopTime(arkode_mem, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeSStolerances(arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &(Nsteps[ipart])); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + + retval = ERKStepReInit(arkode_mem, fn, t2, y2); + if (check_retval(&retval, "ERKStepReInit", 1)) return 1; + retval = ARKodeSetFixedStep(arkode_mem, 2.0 * hvals[ih]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeSetStopTime(arkode_mem, t2 + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_mem, t2 + hpart, y2, &t2, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) break; + retval = ARKodeGetNumSteps(arkode_mem, &nsteps2); + if (check_retval(&retval, "ARKodeGetNumSteps", 1)) break; + } + retval = computeErrorWeights(y2, ewt, reltol, abstol, vtemp); + if (check_retval(&retval, "computeErrorWeights", 1)) break; + N_VLinearSum(ONE, y2, -ONE, y, y2); + dsm_est[ipart] = reltol * N_VWrmsNorm(y2, ewt); + Nsteps[ipart] += nsteps2; + sunrealtype udsm = abs(ydata[0] - utrue(t)) / + (abstol + reltol * abs(utrue(t))); + sunrealtype vdsm = abs(ydata[1] - vtrue(t, udata)) / + (abstol + reltol * abs(vtrue(t, udata))); + dsm[ipart] = reltol * sqrt(0.5 * (udsm * udsm + vdsm * vdsm)); + cout << " h " << hvals[ih] << " rk_type " << rk_type << " order " + << order << " acc " << 2 << " t " << t << " dsm " << dsm[ipart] + << " dsm_est " << dsm_est[ipart] << " nsteps " << Nsteps[ipart] + << endl; + } + } + + N_VDestroy(y2); + N_VDestroy(ewt); + return (0); +} + +static sunrealtype p(sunrealtype t) { return (cos(t)); } + +static sunrealtype q(sunrealtype t, UserData& udata) +{ + return (cos(udata.omega * t * (ONE + exp(-(t - 2) * (t - 2))))); +} + +static sunrealtype pdot(sunrealtype t) { return (-sin(t)); } + +static sunrealtype qdot(sunrealtype t, UserData& udata) +{ + return (-sin(udata.omega * t * (ONE + exp(-(t - 2) * (t - 2)))) * udata.omega * + (ONE + exp(-(t - 2) * (t - 2)) - + t * 2 * (t - 2) * (exp(-(t - 2) * (t - 2))))); +} + +static sunrealtype utrue(sunrealtype t) { return (SUNRsqrt(TWO + p(t))); } + +static sunrealtype vtrue(sunrealtype t, UserData& udata) +{ + return (SUNRsqrt(TWO + q(t, udata))); +} + +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue(t); + ydata[1] = vtrue(t, udata); + return (0); +} + +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp) +{ + N_VAbs(ycur, vtemp); + N_VScale(rtol, vtemp, vtemp); + N_VAddConst(vtemp, atol, vtemp); + N_VInv(vtemp, weight); + return (0); +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a retval so check if + retval < 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* returnvalue, const char* funcname, int opt) +{ + int* retval; + + // Check if SUNDIALS function returned NULL pointer - no memory allocated + if (opt == 0 && returnvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + // Check if retval < 0 + else if (opt == 1) + { + retval = (int*)returnvalue; + if (*retval < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *retval); + return 1; + } + } + + // Check if function returned NULL pointer - no memory allocated + else if (opt == 2 && returnvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +//---- end of file ---- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_-4_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_-4_1.out new file mode 100644 index 0000000000..0ddc51a414 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_-4_1.out @@ -0,0 +1,330 @@ + +Accumulated error estimation test (Nonlinear Kvaerno-Prothero-Robinson problem): + time domain: (0,5] + partition size = 20 + G = -10 + e = 0.1 + omega = 5 + ERK solver, order = 4 + +Fixed-step runs: + h 0.005 rk_type 1 order 4 acc 1 t 0.25 dsm 5.99625e-11 dsm_est 2.97934e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 0.5 dsm 1.42974e-10 dsm_est 1.09464e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 0.75 dsm 2.42719e-10 dsm_est 4.48851e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 1 dsm 6.83162e-10 dsm_est 2.52438e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 1.25 dsm 3.14281e-09 dsm_est 6.51615e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 1.5 dsm 4.52762e-09 dsm_est 3.9027e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 1.75 dsm 4.7305e-10 dsm_est 1.03348e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 2 dsm 1.22724e-09 dsm_est 2.15168e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 2.25 dsm 2.1725e-10 dsm_est 4.54458e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 2.5 dsm 1.44845e-10 dsm_est 1.64155e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 2.75 dsm 1.45894e-10 dsm_est 1.12159e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 3 dsm 2.11123e-10 dsm_est 1.10902e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 3.25 dsm 2.34671e-10 dsm_est 3.64366e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 3.5 dsm 1.99557e-10 dsm_est 7.94986e-10 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 3.75 dsm 1.51624e-10 dsm_est 7.64317e-10 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 4 dsm 9.7978e-11 dsm_est 1.84333e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 4.25 dsm 3.36113e-11 dsm_est 3.03774e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 4.5 dsm 7.15711e-11 dsm_est 1.1807e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 4.75 dsm 3.79788e-11 dsm_est 3.66885e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 1 t 5 dsm 4.13058e-11 dsm_est 1.68612e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 0.25 dsm 5.99625e-11 dsm_est 6.92498e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 0.5 dsm 1.42974e-10 dsm_est 3.44716e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 0.75 dsm 2.42719e-10 dsm_est 1.11167e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 1 dsm 6.83162e-10 dsm_est 3.96873e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 1.25 dsm 3.14281e-09 dsm_est 9.51778e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 1.5 dsm 4.52762e-09 dsm_est 4.8884e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 1.75 dsm 4.7305e-10 dsm_est 1.58084e-05 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 2 dsm 1.22724e-09 dsm_est 3.22447e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 2.25 dsm 2.1725e-10 dsm_est 1.37158e-06 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 2.5 dsm 1.44845e-10 dsm_est 5.71622e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 2.75 dsm 1.45894e-10 dsm_est 2.89412e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 3 dsm 2.11123e-10 dsm_est 2.24322e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 3.25 dsm 2.34671e-10 dsm_est 1.10202e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 3.5 dsm 1.99557e-10 dsm_est 2.70653e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 3.75 dsm 1.51624e-10 dsm_est 2.01726e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 4 dsm 9.7978e-11 dsm_est 4.76316e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 4.25 dsm 3.36113e-11 dsm_est 1.20904e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 4.5 dsm 7.15711e-11 dsm_est 3.7071e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 4.75 dsm 3.79788e-11 dsm_est 8.7779e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 5 dsm 4.13058e-11 dsm_est 6.13145e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 0.25 dsm 5.99625e-11 dsm_est 1.385e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 0.5 dsm 1.42974e-10 dsm_est 6.89431e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 0.75 dsm 2.42719e-10 dsm_est 2.22335e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 1 dsm 6.83162e-10 dsm_est 7.93747e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 1.25 dsm 3.14281e-09 dsm_est 1.90356e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 1.5 dsm 4.52762e-09 dsm_est 9.7768e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 1.75 dsm 4.7305e-10 dsm_est 3.16168e-07 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 2 dsm 1.22724e-09 dsm_est 6.44894e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 2.25 dsm 2.1725e-10 dsm_est 2.74317e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 2.5 dsm 1.44845e-10 dsm_est 1.14324e-08 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 2.75 dsm 1.45894e-10 dsm_est 5.78824e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 3 dsm 2.11123e-10 dsm_est 4.48643e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 3.25 dsm 2.34671e-10 dsm_est 2.20404e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 3.5 dsm 1.99557e-10 dsm_est 5.41306e-10 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 3.75 dsm 1.51624e-10 dsm_est 4.03452e-10 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 4 dsm 9.7978e-11 dsm_est 9.52633e-10 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 4.25 dsm 3.36113e-11 dsm_est 2.41808e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 4.5 dsm 7.15711e-11 dsm_est 7.4142e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 4.75 dsm 3.79788e-11 dsm_est 1.75558e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 3 t 5 dsm 4.13058e-11 dsm_est 1.22629e-09 nsteps 50 + h 0.005 rk_type 1 order 4 acc 2 t 0.25 dsm 5.99625e-11 dsm_est 9.19534e-10 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 0.5 dsm 1.42974e-10 dsm_est 2.10629e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 0.75 dsm 2.42719e-10 dsm_est 3.82746e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 1 dsm 6.83162e-10 dsm_est 1.03061e-08 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 1.25 dsm 3.14281e-09 dsm_est 4.33257e-08 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 1.5 dsm 4.52762e-09 dsm_est 6.98227e-08 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 1.75 dsm 4.7305e-10 dsm_est 3.66571e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 2 dsm 1.22724e-09 dsm_est 1.87356e-08 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 2.25 dsm 2.1725e-10 dsm_est 3.03702e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 2.5 dsm 1.44845e-10 dsm_est 2.22121e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 2.75 dsm 1.45894e-10 dsm_est 2.22678e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 3 dsm 2.11123e-10 dsm_est 3.23991e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 3.25 dsm 2.34671e-10 dsm_est 3.61593e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 3.5 dsm 1.99557e-10 dsm_est 3.07907e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 3.75 dsm 1.51624e-10 dsm_est 2.34121e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 4 dsm 9.7978e-11 dsm_est 1.51474e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 4.25 dsm 3.36113e-11 dsm_est 5.09945e-10 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 4.5 dsm 7.15711e-11 dsm_est 1.10419e-09 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 4.75 dsm 3.79788e-11 dsm_est 5.88316e-10 nsteps 75 + h 0.005 rk_type 1 order 4 acc 2 t 5 dsm 4.13058e-11 dsm_est 6.25891e-10 nsteps 75 + h 0.00125 rk_type 1 order 4 acc 1 t 0.25 dsm 2.30499e-13 dsm_est 1.18706e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 0.5 dsm 5.68219e-13 dsm_est 4.29143e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 0.75 dsm 9.09327e-13 dsm_est 1.75788e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 1 dsm 2.66412e-12 dsm_est 1.00941e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 1.25 dsm 1.30178e-11 dsm_est 2.55862e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 1.5 dsm 1.73534e-11 dsm_est 1.64905e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 1.75 dsm 3.44384e-12 dsm_est 4.05424e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 2 dsm 4.73982e-12 dsm_est 8.44242e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 2.25 dsm 8.24836e-13 dsm_est 1.78198e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 2.5 dsm 5.58183e-13 dsm_est 6.41367e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 2.75 dsm 5.66294e-13 dsm_est 4.38146e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 3 dsm 8.06614e-13 dsm_est 4.34752e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 3.25 dsm 8.98387e-13 dsm_est 1.416e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 3.5 dsm 7.63217e-13 dsm_est 3.10184e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 3.75 dsm 5.78309e-13 dsm_est 2.99367e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 4 dsm 3.75531e-13 dsm_est 7.27428e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 4.25 dsm 1.33194e-13 dsm_est 1.19044e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 4.5 dsm 2.44986e-13 dsm_est 4.62152e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 4.75 dsm 1.41286e-13 dsm_est 1.51237e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 1 t 5 dsm 1.73009e-13 dsm_est 6.57848e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 0.25 dsm 2.30499e-13 dsm_est 1.08204e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 0.5 dsm 5.68219e-13 dsm_est 5.40888e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 0.75 dsm 9.09327e-13 dsm_est 1.7413e-08 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 1 dsm 2.66412e-12 dsm_est 6.10198e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 1.25 dsm 1.30178e-11 dsm_est 1.49252e-07 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 1.5 dsm 1.73534e-11 dsm_est 7.5991e-08 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 1.75 dsm 3.44384e-12 dsm_est 2.47716e-07 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 2 dsm 4.73982e-12 dsm_est 4.99807e-08 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 2.25 dsm 8.24836e-13 dsm_est 2.14752e-08 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 2.5 dsm 5.58183e-13 dsm_est 8.93029e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 2.75 dsm 5.66294e-13 dsm_est 4.52416e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 3 dsm 8.06614e-13 dsm_est 3.502e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 3.25 dsm 8.98387e-13 dsm_est 1.71624e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 3.5 dsm 7.63217e-13 dsm_est 4.19654e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 3.75 dsm 5.78309e-13 dsm_est 3.14069e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 4 dsm 3.75531e-13 dsm_est 7.43405e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 4.25 dsm 1.33194e-13 dsm_est 1.89465e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 4.5 dsm 2.44986e-13 dsm_est 5.80293e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 4.75 dsm 1.41286e-13 dsm_est 1.36602e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 5 dsm 1.73009e-13 dsm_est 9.5065e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 0.25 dsm 2.30499e-13 dsm_est 5.41022e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 0.5 dsm 5.68219e-13 dsm_est 2.70444e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 0.75 dsm 9.09327e-13 dsm_est 8.70648e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 1 dsm 2.66412e-12 dsm_est 3.05099e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 1.25 dsm 1.30178e-11 dsm_est 7.46262e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 1.5 dsm 1.73534e-11 dsm_est 3.79955e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 1.75 dsm 3.44384e-12 dsm_est 1.23858e-09 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 2 dsm 4.73982e-12 dsm_est 2.49903e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 2.25 dsm 8.24836e-13 dsm_est 1.07376e-10 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 2.5 dsm 5.58183e-13 dsm_est 4.46515e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 2.75 dsm 5.66294e-13 dsm_est 2.26208e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 3 dsm 8.06614e-13 dsm_est 1.751e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 3.25 dsm 8.98387e-13 dsm_est 8.58119e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 3.5 dsm 7.63217e-13 dsm_est 2.09827e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 3.75 dsm 5.78309e-13 dsm_est 1.57035e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 4 dsm 3.75531e-13 dsm_est 3.71703e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 4.25 dsm 1.33194e-13 dsm_est 9.47327e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 4.5 dsm 2.44986e-13 dsm_est 2.90146e-11 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 4.75 dsm 1.41286e-13 dsm_est 6.83008e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 3 t 5 dsm 1.73009e-13 dsm_est 4.75325e-12 nsteps 200 + h 0.00125 rk_type 1 order 4 acc 2 t 0.25 dsm 2.30499e-13 dsm_est 3.47846e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 0.5 dsm 5.68219e-13 dsm_est 8.44621e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 0.75 dsm 9.09327e-13 dsm_est 1.38911e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 1 dsm 2.66412e-12 dsm_est 3.99292e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 1.25 dsm 1.30178e-11 dsm_est 1.91091e-10 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 1.5 dsm 1.73534e-11 dsm_est 2.61959e-10 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 1.75 dsm 3.44384e-12 dsm_est 4.28383e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 2 dsm 4.73982e-12 dsm_est 7.1306e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 2.25 dsm 8.24836e-13 dsm_est 1.31816e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 2.5 dsm 5.58183e-13 dsm_est 8.4007e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 2.75 dsm 5.66294e-13 dsm_est 8.47988e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 3 dsm 8.06614e-13 dsm_est 1.22473e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 3.25 dsm 8.98387e-13 dsm_est 1.35837e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 3.5 dsm 7.63217e-13 dsm_est 1.15437e-11 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 3.75 dsm 5.78309e-13 dsm_est 8.76917e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 4 dsm 3.75531e-13 dsm_est 5.66133e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 4.25 dsm 1.33194e-13 dsm_est 1.9304e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 4.5 dsm 2.44986e-13 dsm_est 4.1717e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 4.75 dsm 1.41286e-13 dsm_est 2.17896e-12 nsteps 300 + h 0.00125 rk_type 1 order 4 acc 2 t 5 dsm 1.73009e-13 dsm_est 2.38734e-12 nsteps 300 + h 0.0003125 rk_type 1 order 4 acc 1 t 0.25 dsm 9.97977e-16 dsm_est 4.66004e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 0.5 dsm 7.34738e-15 dsm_est 1.67783e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 0.75 dsm 1.89479e-14 dsm_est 6.87079e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 1 dsm 6.41345e-15 dsm_est 3.96662e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 1.25 dsm 1.49538e-13 dsm_est 1.00006e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 1.5 dsm 1.0257e-13 dsm_est 6.56125e-12 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 1.75 dsm 4.74681e-14 dsm_est 1.58483e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 2 dsm 3.28771e-14 dsm_est 3.30065e-12 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 2.25 dsm 2.08777e-13 dsm_est 6.96642e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 2.5 dsm 1.03256e-14 dsm_est 2.50524e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 2.75 dsm 1.44079e-14 dsm_est 1.71146e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 3 dsm 6.86653e-14 dsm_est 1.69952e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 3.25 dsm 4.56716e-14 dsm_est 5.52408e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 3.5 dsm 1.14798e-14 dsm_est 1.21147e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 3.75 dsm 1.10427e-14 dsm_est 1.17036e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 4 dsm 5.31806e-14 dsm_est 2.84886e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 1 t 4.25 dsm 2.08119e-13 dsm_est 4.65384e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 4.5 dsm 1.57233e-14 dsm_est 1.80608e-13 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 4.75 dsm 1.39902e-13 dsm_est 5.98529e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 1 t 5 dsm 7.63042e-14 dsm_est 2.56897e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.25 dsm 9.97977e-16 dsm_est 1.6907e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.5 dsm 7.34738e-15 dsm_est 8.45809e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.75 dsm 1.89479e-14 dsm_est 2.72242e-10 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 1 dsm 6.41345e-15 dsm_est 9.49565e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.25 dsm 1.49538e-13 dsm_est 2.33397e-09 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.5 dsm 1.0257e-13 dsm_est 1.18555e-09 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.75 dsm 4.74681e-14 dsm_est 3.87341e-09 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 2 dsm 3.28771e-14 dsm_est 7.79395e-10 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.25 dsm 2.08777e-13 dsm_est 3.3572e-10 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.5 dsm 1.03256e-14 dsm_est 1.39527e-10 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.75 dsm 1.44079e-14 dsm_est 7.06925e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 3 dsm 6.86653e-14 dsm_est 5.47055e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.25 dsm 4.56716e-14 dsm_est 2.67951e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.5 dsm 1.14798e-14 dsm_est 6.54805e-12 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.75 dsm 1.10427e-14 dsm_est 4.9065e-12 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 4 dsm 5.31806e-14 dsm_est 1.16127e-11 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.25 dsm 2.08119e-13 dsm_est 2.96268e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.5 dsm 1.57233e-14 dsm_est 9.07089e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.75 dsm 1.39902e-13 dsm_est 2.13237e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 5 dsm 7.63042e-14 dsm_est 1.48242e-11 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 0.25 dsm 9.97977e-16 dsm_est 2.11337e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 0.5 dsm 7.34738e-15 dsm_est 1.05726e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 0.75 dsm 1.89479e-14 dsm_est 3.40303e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 1 dsm 6.41345e-15 dsm_est 1.18696e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 1.25 dsm 1.49538e-13 dsm_est 2.91746e-12 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 1.5 dsm 1.0257e-13 dsm_est 1.48193e-12 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 1.75 dsm 4.74681e-14 dsm_est 4.84176e-12 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 2 dsm 3.28771e-14 dsm_est 9.74244e-13 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 2.25 dsm 2.08777e-13 dsm_est 4.1965e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 2.5 dsm 1.03256e-14 dsm_est 1.74409e-13 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 2.75 dsm 1.44079e-14 dsm_est 8.83656e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 3 dsm 6.86653e-14 dsm_est 6.83819e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 3.25 dsm 4.56716e-14 dsm_est 3.34939e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 3.5 dsm 1.14798e-14 dsm_est 8.18506e-15 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 3.75 dsm 1.10427e-14 dsm_est 6.13312e-15 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 4 dsm 5.31806e-14 dsm_est 1.45159e-14 nsteps 800 + h 0.0003125 rk_type 1 order 4 acc 3 t 4.25 dsm 2.08119e-13 dsm_est 3.70335e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 4.5 dsm 1.57233e-14 dsm_est 1.13386e-13 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 4.75 dsm 1.39902e-13 dsm_est 2.66546e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 3 t 5 dsm 7.63042e-14 dsm_est 1.85303e-14 nsteps 801 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.25 dsm 9.97977e-16 dsm_est 1.35296e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.5 dsm 7.34738e-15 dsm_est 3.14131e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 0.75 dsm 1.89479e-14 dsm_est 6.96153e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 1 dsm 6.41345e-15 dsm_est 1.77682e-13 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.25 dsm 1.49538e-13 dsm_est 5.92376e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.5 dsm 1.0257e-13 dsm_est 9.50139e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 1.75 dsm 4.74681e-14 dsm_est 1.5963e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 2 dsm 3.28771e-14 dsm_est 2.52198e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.25 dsm 2.08777e-13 dsm_est 3.31346e-13 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.5 dsm 1.03256e-14 dsm_est 3.26259e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 2.75 dsm 1.44079e-14 dsm_est 3.69706e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 3 dsm 6.86653e-14 dsm_est 8.29842e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.25 dsm 4.56716e-14 dsm_est 7.57076e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.5 dsm 1.14798e-14 dsm_est 4.72639e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 3.75 dsm 1.10427e-14 dsm_est 3.43678e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 4 dsm 5.31806e-14 dsm_est 4.43107e-14 nsteps 1200 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.25 dsm 2.08119e-13 dsm_est 3.19466e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.5 dsm 1.57233e-14 dsm_est 3.54399e-14 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 4.75 dsm 1.39902e-13 dsm_est 2.1045e-13 nsteps 1201 + h 0.0003125 rk_type 1 order 4 acc 2 t 5 dsm 7.63042e-14 dsm_est 1.1047e-13 nsteps 1201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 0.25 dsm 1.20076e-14 dsm_est 1.82253e-16 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 0.5 dsm 6.92895e-14 dsm_est 6.55669e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 0.75 dsm 7.1887e-14 dsm_est 2.68471e-15 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 1 dsm 5.29714e-14 dsm_est 1.55185e-15 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 1.25 dsm 4.54758e-13 dsm_est 3.90711e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 1.5 dsm 1.61784e-13 dsm_est 2.57413e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 1.75 dsm 1.4649e-13 dsm_est 6.1914e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 2 dsm 6.85301e-14 dsm_est 1.28969e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 2.25 dsm 3.74507e-13 dsm_est 2.72291e-15 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 2.5 dsm 1.92671e-14 dsm_est 9.81217e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 2.75 dsm 1.93516e-14 dsm_est 6.71729e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 3 dsm 1.23711e-13 dsm_est 6.65622e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 3.25 dsm 8.16997e-14 dsm_est 2.16207e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 3.5 dsm 1.95956e-14 dsm_est 4.74185e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 3.75 dsm 2.16401e-14 dsm_est 4.58122e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 4 dsm 9.37664e-14 dsm_est 1.11469e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 4.25 dsm 2.10442e-13 dsm_est 1.82276e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 4.5 dsm 1.64627e-14 dsm_est 7.11037e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 4.75 dsm 1.39177e-13 dsm_est 2.35957e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 1 t 5 dsm 7.51104e-14 dsm_est 1.00425e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.25 dsm 1.20076e-14 dsm_est 2.64165e-13 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.5 dsm 6.92895e-14 dsm_est 1.32181e-12 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.75 dsm 7.1887e-14 dsm_est 4.25372e-12 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1 dsm 5.29714e-14 dsm_est 1.48185e-12 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.25 dsm 4.54758e-13 dsm_est 3.64743e-11 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.5 dsm 1.61784e-13 dsm_est 1.85159e-11 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.75 dsm 1.4649e-13 dsm_est 6.05314e-11 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2 dsm 6.85301e-14 dsm_est 1.2171e-11 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.25 dsm 3.74507e-13 dsm_est 5.24549e-12 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.5 dsm 1.92671e-14 dsm_est 2.18076e-12 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.75 dsm 1.93516e-14 dsm_est 1.10503e-12 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3 dsm 1.23711e-13 dsm_est 8.55102e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.25 dsm 8.16997e-14 dsm_est 4.18589e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.5 dsm 1.95956e-14 dsm_est 1.02298e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.75 dsm 2.16401e-14 dsm_est 7.6628e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4 dsm 9.37664e-14 dsm_est 1.81659e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.25 dsm 2.10442e-13 dsm_est 4.62687e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.5 dsm 1.64627e-14 dsm_est 1.42144e-12 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.75 dsm 1.39177e-13 dsm_est 3.32669e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 5 dsm 7.51104e-14 dsm_est 2.32583e-13 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 0.25 dsm 1.20076e-14 dsm_est 8.25514e-17 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 0.5 dsm 6.92895e-14 dsm_est 4.13064e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 0.75 dsm 7.1887e-14 dsm_est 1.32929e-15 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 1 dsm 5.29714e-14 dsm_est 4.63079e-16 nsteps 3200 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 1.25 dsm 4.54758e-13 dsm_est 1.13982e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 1.5 dsm 1.61784e-13 dsm_est 5.78623e-15 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 1.75 dsm 1.4649e-13 dsm_est 1.89161e-14 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 2 dsm 6.85301e-14 dsm_est 3.80343e-15 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 2.25 dsm 3.74507e-13 dsm_est 1.63922e-15 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 2.5 dsm 1.92671e-14 dsm_est 6.81488e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 2.75 dsm 1.93516e-14 dsm_est 3.45321e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 3 dsm 1.23711e-13 dsm_est 2.67219e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 3.25 dsm 8.16997e-14 dsm_est 1.30809e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 3.5 dsm 1.95956e-14 dsm_est 3.19683e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 3.75 dsm 2.16401e-14 dsm_est 2.39462e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 4 dsm 9.37664e-14 dsm_est 5.67685e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 4.25 dsm 2.10442e-13 dsm_est 1.4459e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 4.5 dsm 1.64627e-14 dsm_est 4.44199e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 4.75 dsm 1.39177e-13 dsm_est 1.03959e-16 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 3 t 5 dsm 7.51104e-14 dsm_est 7.26822e-17 nsteps 3201 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.25 dsm 1.20076e-14 dsm_est 9.70841e-15 nsteps 4800 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.5 dsm 6.92895e-14 dsm_est 1.22494e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 0.75 dsm 7.1887e-14 dsm_est 1.01008e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1 dsm 5.29714e-14 dsm_est 7.31368e-14 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.25 dsm 4.54758e-13 dsm_est 7.05734e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.5 dsm 1.61784e-13 dsm_est 2.49851e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 1.75 dsm 1.4649e-13 dsm_est 2.2764e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2 dsm 6.85301e-14 dsm_est 1.06912e-13 nsteps 4801 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.25 dsm 3.74507e-13 dsm_est 1.85903e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.5 dsm 1.92671e-14 dsm_est 4.28748e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 2.75 dsm 1.93516e-14 dsm_est 3.17803e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3 dsm 1.23711e-13 dsm_est 2.14064e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.25 dsm 8.16997e-14 dsm_est 9.8125e-16 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.5 dsm 1.95956e-14 dsm_est 1.42241e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 3.75 dsm 2.16401e-14 dsm_est 9.52702e-16 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4 dsm 9.37664e-14 dsm_est 1.67292e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.25 dsm 2.10442e-13 dsm_est 5.74872e-16 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.5 dsm 1.64627e-14 dsm_est 2.39534e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 4.75 dsm 1.39177e-13 dsm_est 1.10424e-15 nsteps 4802 + h 7.8125e-05 rk_type 1 order 4 acc 2 t 5 dsm 7.51104e-14 dsm_est 1.21712e-15 nsteps 4802 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_2_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_2_0.out new file mode 100644 index 0000000000..8809b5e0a0 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_2_0.out @@ -0,0 +1,190 @@ + +Accumulated error estimation test (Nonlinear Kvaerno-Prothero-Robinson problem): + time domain: (0,5] + partition size = 20 + G = -10 + e = 0.1 + omega = 5 + DIRK solver, order = 2 + +Adaptive-step runs: + rtol 0.01 rk_type 0 order 2 acc 1 t 0.25 dsm 5.77245e-05 dsm_est 0.00686971 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 1 t 0.5 dsm 0.00372257 dsm_est 0.00877859 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 1 t 0.75 dsm 0.000232425 dsm_est 0.0066976 nsteps 13 + rtol 0.01 rk_type 0 order 2 acc 1 t 1 dsm 0.00327055 dsm_est 0.00759421 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 1 t 1.25 dsm 0.00363058 dsm_est 0.00633487 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 1 t 1.5 dsm 0.00267076 dsm_est 0.00679482 nsteps 12 + rtol 0.01 rk_type 0 order 2 acc 1 t 1.75 dsm 0.00971976 dsm_est 0.00698823 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 1 t 2 dsm 0.000918207 dsm_est 0.00684032 nsteps 14 + rtol 0.01 rk_type 0 order 2 acc 1 t 2.25 dsm 0.0016944 dsm_est 0.00722321 nsteps 10 + rtol 0.01 rk_type 0 order 2 acc 1 t 2.5 dsm 0.0056199 dsm_est 0.00390805 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 1 t 2.75 dsm 0.00855479 dsm_est 0.00899318 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 1 t 3 dsm 0.0023308 dsm_est 0.00881185 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 1 t 3.25 dsm 0.000539467 dsm_est 0.00351937 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 1 t 3.5 dsm 0.000312605 dsm_est 0.00446438 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 1 t 3.75 dsm 0.00144605 dsm_est 0.00759178 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 1 t 4 dsm 0.00023147 dsm_est 0.0031488 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 1 t 4.25 dsm 0.00806953 dsm_est 0.00741572 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 1 t 4.5 dsm 0.000322019 dsm_est 0.00679423 nsteps 11 + rtol 0.01 rk_type 0 order 2 acc 1 t 4.75 dsm 0.00405487 dsm_est 0.00313156 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 1 t 5 dsm 0.000699178 dsm_est 0.0036148 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 2 t 0.25 dsm 5.77245e-05 dsm_est 0.0164981 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 2 t 0.5 dsm 0.00372257 dsm_est 0.0210208 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 2 t 0.75 dsm 0.000232425 dsm_est 0.0308702 nsteps 13 + rtol 0.01 rk_type 0 order 2 acc 2 t 1 dsm 0.00327055 dsm_est 0.0340018 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 2 t 1.25 dsm 0.00363058 dsm_est 0.045914 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 2 t 1.5 dsm 0.00267076 dsm_est 0.0507535 nsteps 12 + rtol 0.01 rk_type 0 order 2 acc 2 t 1.75 dsm 0.00971976 dsm_est 0.05629 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 2 t 2 dsm 0.000918207 dsm_est 0.0375381 nsteps 14 + rtol 0.01 rk_type 0 order 2 acc 2 t 2.25 dsm 0.0016944 dsm_est 0.031166 nsteps 10 + rtol 0.01 rk_type 0 order 2 acc 2 t 2.5 dsm 0.0056199 dsm_est 0.00967058 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 2 t 2.75 dsm 0.00855479 dsm_est 0.0140582 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 2 t 3 dsm 0.0023308 dsm_est 0.014547 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 2 t 3.25 dsm 0.000539467 dsm_est 0.0111796 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 2 t 3.5 dsm 0.000312605 dsm_est 0.00770553 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 2 t 3.75 dsm 0.00144605 dsm_est 0.00972643 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 2 t 4 dsm 0.00023147 dsm_est 0.00981914 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 2 t 4.25 dsm 0.00806953 dsm_est 0.0118304 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 2 t 4.5 dsm 0.000322019 dsm_est 0.0262973 nsteps 11 + rtol 0.01 rk_type 0 order 2 acc 2 t 4.75 dsm 0.00405487 dsm_est 0.00626689 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 2 t 5 dsm 0.000699178 dsm_est 0.0128716 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 3 t 0.25 dsm 5.77245e-05 dsm_est 0.00353036 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 3 t 0.5 dsm 0.00372257 dsm_est 0.00558255 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 3 t 0.75 dsm 0.000232425 dsm_est 0.00326237 nsteps 13 + rtol 0.01 rk_type 0 order 2 acc 3 t 1 dsm 0.00327055 dsm_est 0.00560468 nsteps 9 + rtol 0.01 rk_type 0 order 2 acc 3 t 1.25 dsm 0.00363058 dsm_est 0.00326167 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 3 t 1.5 dsm 0.00267076 dsm_est 0.00448671 nsteps 12 + rtol 0.01 rk_type 0 order 2 acc 3 t 1.75 dsm 0.00971976 dsm_est 0.00430156 nsteps 16 + rtol 0.01 rk_type 0 order 2 acc 3 t 2 dsm 0.000918207 dsm_est 0.00360429 nsteps 14 + rtol 0.01 rk_type 0 order 2 acc 3 t 2.25 dsm 0.0016944 dsm_est 0.00427241 nsteps 10 + rtol 0.01 rk_type 0 order 2 acc 3 t 2.5 dsm 0.0056199 dsm_est 0.0029018 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 3 t 2.75 dsm 0.00855479 dsm_est 0.00614645 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 3 t 3 dsm 0.0023308 dsm_est 0.00499894 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 3 t 3.25 dsm 0.000539467 dsm_est 0.00271774 nsteps 8 + rtol 0.01 rk_type 0 order 2 acc 3 t 3.5 dsm 0.000312605 dsm_est 0.0029728 nsteps 6 + rtol 0.01 rk_type 0 order 2 acc 3 t 3.75 dsm 0.00144605 dsm_est 0.00565195 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 3 t 4 dsm 0.00023147 dsm_est 0.00239782 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 3 t 4.25 dsm 0.00806953 dsm_est 0.00616552 nsteps 4 + rtol 0.01 rk_type 0 order 2 acc 3 t 4.5 dsm 0.000322019 dsm_est 0.00389097 nsteps 11 + rtol 0.01 rk_type 0 order 2 acc 3 t 4.75 dsm 0.00405487 dsm_est 0.00155112 nsteps 7 + rtol 0.01 rk_type 0 order 2 acc 3 t 5 dsm 0.000699178 dsm_est 0.00252209 nsteps 8 + rtol 0.0001 rk_type 0 order 2 acc 1 t 0.25 dsm 7.46709e-07 dsm_est 7.18663e-05 nsteps 49 + rtol 0.0001 rk_type 0 order 2 acc 1 t 0.5 dsm 6.50352e-05 dsm_est 7.49302e-05 nsteps 42 + rtol 0.0001 rk_type 0 order 2 acc 1 t 0.75 dsm 4.48379e-06 dsm_est 7.39118e-05 nsteps 84 + rtol 0.0001 rk_type 0 order 2 acc 1 t 1 dsm 3.76158e-05 dsm_est 7.93376e-05 nsteps 61 + rtol 0.0001 rk_type 0 order 2 acc 1 t 1.25 dsm 6.82164e-05 dsm_est 9.03489e-05 nsteps 110 + rtol 0.0001 rk_type 0 order 2 acc 1 t 1.5 dsm 3.68171e-05 dsm_est 8.51313e-05 nsteps 109 + rtol 0.0001 rk_type 0 order 2 acc 1 t 1.75 dsm 2.35133e-05 dsm_est 8.17961e-05 nsteps 136 + rtol 0.0001 rk_type 0 order 2 acc 1 t 2 dsm 1.61655e-05 dsm_est 6.74799e-05 nsteps 91 + rtol 0.0001 rk_type 0 order 2 acc 1 t 2.25 dsm 6.22229e-05 dsm_est 8.55795e-05 nsteps 65 + rtol 0.0001 rk_type 0 order 2 acc 1 t 2.5 dsm 4.95459e-05 dsm_est 9.95948e-05 nsteps 38 + rtol 0.0001 rk_type 0 order 2 acc 1 t 2.75 dsm 4.09894e-05 dsm_est 7.97659e-05 nsteps 35 + rtol 0.0001 rk_type 0 order 2 acc 1 t 3 dsm 3.51226e-05 dsm_est 9.83341e-05 nsteps 41 + rtol 0.0001 rk_type 0 order 2 acc 1 t 3.25 dsm 9.918e-06 dsm_est 7.80442e-05 nsteps 34 + rtol 0.0001 rk_type 0 order 2 acc 1 t 3.5 dsm 6.68205e-06 dsm_est 6.93297e-05 nsteps 29 + rtol 0.0001 rk_type 0 order 2 acc 1 t 3.75 dsm 1.12533e-05 dsm_est 7.07769e-05 nsteps 22 + rtol 0.0001 rk_type 0 order 2 acc 1 t 4 dsm 4.18856e-06 dsm_est 7.35665e-05 nsteps 31 + rtol 0.0001 rk_type 0 order 2 acc 1 t 4.25 dsm 5.65033e-05 dsm_est 9.50758e-05 nsteps 27 + rtol 0.0001 rk_type 0 order 2 acc 1 t 4.5 dsm 8.06381e-06 dsm_est 7.57142e-05 nsteps 60 + rtol 0.0001 rk_type 0 order 2 acc 1 t 4.75 dsm 3.08146e-05 dsm_est 7.53944e-05 nsteps 36 + rtol 0.0001 rk_type 0 order 2 acc 1 t 5 dsm 1.43844e-05 dsm_est 7.56604e-05 nsteps 37 + rtol 0.0001 rk_type 0 order 2 acc 2 t 0.25 dsm 7.46709e-07 dsm_est 0.00190862 nsteps 49 + rtol 0.0001 rk_type 0 order 2 acc 2 t 0.5 dsm 6.50352e-05 dsm_est 0.00204717 nsteps 42 + rtol 0.0001 rk_type 0 order 2 acc 2 t 0.75 dsm 4.48379e-06 dsm_est 0.00379996 nsteps 84 + rtol 0.0001 rk_type 0 order 2 acc 2 t 1 dsm 3.76158e-05 dsm_est 0.00364205 nsteps 61 + rtol 0.0001 rk_type 0 order 2 acc 2 t 1.25 dsm 6.82164e-05 dsm_est 0.00560546 nsteps 110 + rtol 0.0001 rk_type 0 order 2 acc 2 t 1.5 dsm 3.68171e-05 dsm_est 0.00560365 nsteps 109 + rtol 0.0001 rk_type 0 order 2 acc 2 t 1.75 dsm 2.35133e-05 dsm_est 0.00647595 nsteps 136 + rtol 0.0001 rk_type 0 order 2 acc 2 t 2 dsm 1.61655e-05 dsm_est 0.00463485 nsteps 91 + rtol 0.0001 rk_type 0 order 2 acc 2 t 2.25 dsm 6.22229e-05 dsm_est 0.00349003 nsteps 65 + rtol 0.0001 rk_type 0 order 2 acc 2 t 2.5 dsm 4.95459e-05 dsm_est 0.00168906 nsteps 38 + rtol 0.0001 rk_type 0 order 2 acc 2 t 2.75 dsm 4.09894e-05 dsm_est 0.00204891 nsteps 35 + rtol 0.0001 rk_type 0 order 2 acc 2 t 3 dsm 3.51226e-05 dsm_est 0.00157108 nsteps 41 + rtol 0.0001 rk_type 0 order 2 acc 2 t 3.25 dsm 9.918e-06 dsm_est 0.00168635 nsteps 34 + rtol 0.0001 rk_type 0 order 2 acc 2 t 3.5 dsm 6.68205e-06 dsm_est 0.00104605 nsteps 29 + rtol 0.0001 rk_type 0 order 2 acc 2 t 3.75 dsm 1.12533e-05 dsm_est 0.00113201 nsteps 22 + rtol 0.0001 rk_type 0 order 2 acc 2 t 4 dsm 4.18856e-06 dsm_est 0.00148082 nsteps 31 + rtol 0.0001 rk_type 0 order 2 acc 2 t 4.25 dsm 5.65033e-05 dsm_est 0.0013283 nsteps 27 + rtol 0.0001 rk_type 0 order 2 acc 2 t 4.5 dsm 8.06381e-06 dsm_est 0.00333997 nsteps 60 + rtol 0.0001 rk_type 0 order 2 acc 2 t 4.75 dsm 3.08146e-05 dsm_est 0.00136969 nsteps 36 + rtol 0.0001 rk_type 0 order 2 acc 2 t 5 dsm 1.43844e-05 dsm_est 0.00206727 nsteps 37 + rtol 0.0001 rk_type 0 order 2 acc 3 t 0.25 dsm 7.46709e-07 dsm_est 3.95038e-05 nsteps 49 + rtol 0.0001 rk_type 0 order 2 acc 3 t 0.5 dsm 6.50352e-05 dsm_est 4.6374e-05 nsteps 42 + rtol 0.0001 rk_type 0 order 2 acc 3 t 0.75 dsm 4.48379e-06 dsm_est 4.43011e-05 nsteps 84 + rtol 0.0001 rk_type 0 order 2 acc 3 t 1 dsm 3.76158e-05 dsm_est 5.97518e-05 nsteps 61 + rtol 0.0001 rk_type 0 order 2 acc 3 t 1.25 dsm 6.82164e-05 dsm_est 4.87769e-05 nsteps 110 + rtol 0.0001 rk_type 0 order 2 acc 3 t 1.5 dsm 3.68171e-05 dsm_est 5.35469e-05 nsteps 109 + rtol 0.0001 rk_type 0 order 2 acc 3 t 1.75 dsm 2.35133e-05 dsm_est 4.62728e-05 nsteps 136 + rtol 0.0001 rk_type 0 order 2 acc 3 t 2 dsm 1.61655e-05 dsm_est 5.09881e-05 nsteps 91 + rtol 0.0001 rk_type 0 order 2 acc 3 t 2.25 dsm 6.22229e-05 dsm_est 5.36889e-05 nsteps 65 + rtol 0.0001 rk_type 0 order 2 acc 3 t 2.5 dsm 4.95459e-05 dsm_est 5.23304e-05 nsteps 38 + rtol 0.0001 rk_type 0 order 2 acc 3 t 2.75 dsm 4.09894e-05 dsm_est 5.62503e-05 nsteps 35 + rtol 0.0001 rk_type 0 order 2 acc 3 t 3 dsm 3.51226e-05 dsm_est 4.33776e-05 nsteps 41 + rtol 0.0001 rk_type 0 order 2 acc 3 t 3.25 dsm 9.918e-06 dsm_est 5.1345e-05 nsteps 34 + rtol 0.0001 rk_type 0 order 2 acc 3 t 3.5 dsm 6.68205e-06 dsm_est 3.84131e-05 nsteps 29 + rtol 0.0001 rk_type 0 order 2 acc 3 t 3.75 dsm 1.12533e-05 dsm_est 5.1961e-05 nsteps 22 + rtol 0.0001 rk_type 0 order 2 acc 3 t 4 dsm 4.18856e-06 dsm_est 4.8569e-05 nsteps 31 + rtol 0.0001 rk_type 0 order 2 acc 3 t 4.25 dsm 5.65033e-05 dsm_est 4.99955e-05 nsteps 27 + rtol 0.0001 rk_type 0 order 2 acc 3 t 4.5 dsm 8.06381e-06 dsm_est 5.6039e-05 nsteps 60 + rtol 0.0001 rk_type 0 order 2 acc 3 t 4.75 dsm 3.08146e-05 dsm_est 3.95264e-05 nsteps 36 + rtol 0.0001 rk_type 0 order 2 acc 3 t 5 dsm 1.43844e-05 dsm_est 5.62992e-05 nsteps 37 + rtol 1e-06 rk_type 0 order 2 acc 1 t 0.25 dsm 5.66725e-09 dsm_est 7.18787e-07 nsteps 488 + rtol 1e-06 rk_type 0 order 2 acc 1 t 0.5 dsm 9.92276e-07 dsm_est 8.1602e-07 nsteps 403 + rtol 1e-06 rk_type 0 order 2 acc 1 t 0.75 dsm 8.0717e-08 dsm_est 7.2088e-07 nsteps 823 + rtol 1e-06 rk_type 0 order 2 acc 1 t 1 dsm 5.67858e-07 dsm_est 9.90249e-07 nsteps 596 + rtol 1e-06 rk_type 0 order 2 acc 1 t 1.25 dsm 1.03484e-06 dsm_est 7.69939e-07 nsteps 1091 + rtol 1e-06 rk_type 0 order 2 acc 1 t 1.5 dsm 5.45182e-07 dsm_est 9.21351e-07 nsteps 1080 + rtol 1e-06 rk_type 0 order 2 acc 1 t 1.75 dsm 3.61096e-07 dsm_est 8.11495e-07 nsteps 1337 + rtol 1e-06 rk_type 0 order 2 acc 1 t 2 dsm 2.2003e-07 dsm_est 6.89881e-07 nsteps 898 + rtol 1e-06 rk_type 0 order 2 acc 1 t 2.25 dsm 9.38782e-07 dsm_est 7.22168e-07 nsteps 635 + rtol 1e-06 rk_type 0 order 2 acc 1 t 2.5 dsm 5.20042e-07 dsm_est 7.8752e-07 nsteps 372 + rtol 1e-06 rk_type 0 order 2 acc 1 t 2.75 dsm 4.66825e-07 dsm_est 7.09276e-07 nsteps 354 + rtol 1e-06 rk_type 0 order 2 acc 1 t 3 dsm 3.30086e-07 dsm_est 7.18289e-07 nsteps 409 + rtol 1e-06 rk_type 0 order 2 acc 1 t 3.25 dsm 1.19548e-07 dsm_est 7.25689e-07 nsteps 320 + rtol 1e-06 rk_type 0 order 2 acc 1 t 3.5 dsm 4.13474e-08 dsm_est 7.16259e-07 nsteps 288 + rtol 1e-06 rk_type 0 order 2 acc 1 t 3.75 dsm 1.02293e-07 dsm_est 7.17021e-07 nsteps 225 + rtol 1e-06 rk_type 0 order 2 acc 1 t 4 dsm 3.98477e-08 dsm_est 7.20467e-07 nsteps 304 + rtol 1e-06 rk_type 0 order 2 acc 1 t 4.25 dsm 7.93335e-07 dsm_est 7.48243e-07 nsteps 268 + rtol 1e-06 rk_type 0 order 2 acc 1 t 4.5 dsm 7.4366e-08 dsm_est 7.22713e-07 nsteps 597 + rtol 1e-06 rk_type 0 order 2 acc 1 t 4.75 dsm 5.08713e-07 dsm_est 8.6505e-07 nsteps 347 + rtol 1e-06 rk_type 0 order 2 acc 1 t 5 dsm 1.42752e-07 dsm_est 7.22893e-07 nsteps 366 + rtol 1e-06 rk_type 0 order 2 acc 2 t 0.25 dsm 5.66725e-09 dsm_est 0.000191192 nsteps 488 + rtol 1e-06 rk_type 0 order 2 acc 2 t 0.5 dsm 9.92276e-07 dsm_est 0.000207431 nsteps 403 + rtol 1e-06 rk_type 0 order 2 acc 2 t 0.75 dsm 8.0717e-08 dsm_est 0.00038834 nsteps 823 + rtol 1e-06 rk_type 0 order 2 acc 2 t 1 dsm 5.67858e-07 dsm_est 0.000365552 nsteps 596 + rtol 1e-06 rk_type 0 order 2 acc 2 t 1.25 dsm 1.03484e-06 dsm_est 0.000558232 nsteps 1091 + rtol 1e-06 rk_type 0 order 2 acc 2 t 1.5 dsm 5.45182e-07 dsm_est 0.000561123 nsteps 1080 + rtol 1e-06 rk_type 0 order 2 acc 2 t 1.75 dsm 3.61096e-07 dsm_est 0.000646341 nsteps 1337 + rtol 1e-06 rk_type 0 order 2 acc 2 t 2 dsm 2.2003e-07 dsm_est 0.000468686 nsteps 898 + rtol 1e-06 rk_type 0 order 2 acc 2 t 2.25 dsm 9.38782e-07 dsm_est 0.00034842 nsteps 635 + rtol 1e-06 rk_type 0 order 2 acc 2 t 2.5 dsm 5.20042e-07 dsm_est 0.000167351 nsteps 372 + rtol 1e-06 rk_type 0 order 2 acc 2 t 2.75 dsm 4.66825e-07 dsm_est 0.000203788 nsteps 354 + rtol 1e-06 rk_type 0 order 2 acc 2 t 3 dsm 3.30086e-07 dsm_est 0.000158918 nsteps 409 + rtol 1e-06 rk_type 0 order 2 acc 2 t 3.25 dsm 1.19548e-07 dsm_est 0.000177948 nsteps 320 + rtol 1e-06 rk_type 0 order 2 acc 2 t 3.5 dsm 4.13474e-08 dsm_est 0.0001041 nsteps 288 + rtol 1e-06 rk_type 0 order 2 acc 2 t 3.75 dsm 1.02293e-07 dsm_est 0.000113361 nsteps 225 + rtol 1e-06 rk_type 0 order 2 acc 2 t 4 dsm 3.98477e-08 dsm_est 0.000151291 nsteps 304 + rtol 1e-06 rk_type 0 order 2 acc 2 t 4.25 dsm 7.93335e-07 dsm_est 0.000130015 nsteps 268 + rtol 1e-06 rk_type 0 order 2 acc 2 t 4.5 dsm 7.4366e-08 dsm_est 0.000335997 nsteps 597 + rtol 1e-06 rk_type 0 order 2 acc 2 t 4.75 dsm 5.08713e-07 dsm_est 0.000143029 nsteps 347 + rtol 1e-06 rk_type 0 order 2 acc 2 t 5 dsm 1.42752e-07 dsm_est 0.000210843 nsteps 366 + rtol 1e-06 rk_type 0 order 2 acc 3 t 0.25 dsm 5.66725e-09 dsm_est 3.9261e-07 nsteps 488 + rtol 1e-06 rk_type 0 order 2 acc 3 t 0.5 dsm 9.92276e-07 dsm_est 5.09315e-07 nsteps 403 + rtol 1e-06 rk_type 0 order 2 acc 3 t 0.75 dsm 8.0717e-08 dsm_est 4.63477e-07 nsteps 823 + rtol 1e-06 rk_type 0 order 2 acc 3 t 1 dsm 5.67858e-07 dsm_est 6.16216e-07 nsteps 596 + rtol 1e-06 rk_type 0 order 2 acc 3 t 1.25 dsm 1.03484e-06 dsm_est 4.92364e-07 nsteps 1091 + rtol 1e-06 rk_type 0 order 2 acc 3 t 1.5 dsm 5.45182e-07 dsm_est 5.41053e-07 nsteps 1080 + rtol 1e-06 rk_type 0 order 2 acc 3 t 1.75 dsm 3.61096e-07 dsm_est 4.72477e-07 nsteps 1337 + rtol 1e-06 rk_type 0 order 2 acc 3 t 2 dsm 2.2003e-07 dsm_est 5.24929e-07 nsteps 898 + rtol 1e-06 rk_type 0 order 2 acc 3 t 2.25 dsm 9.38782e-07 dsm_est 5.42556e-07 nsteps 635 + rtol 1e-06 rk_type 0 order 2 acc 3 t 2.5 dsm 5.20042e-07 dsm_est 4.96892e-07 nsteps 372 + rtol 1e-06 rk_type 0 order 2 acc 3 t 2.75 dsm 4.66825e-07 dsm_est 5.60217e-07 nsteps 354 + rtol 1e-06 rk_type 0 order 2 acc 3 t 3 dsm 3.30086e-07 dsm_est 4.24795e-07 nsteps 409 + rtol 1e-06 rk_type 0 order 2 acc 3 t 3.25 dsm 1.19548e-07 dsm_est 5.56477e-07 nsteps 320 + rtol 1e-06 rk_type 0 order 2 acc 3 t 3.5 dsm 4.13474e-08 dsm_est 3.67781e-07 nsteps 288 + rtol 1e-06 rk_type 0 order 2 acc 3 t 3.75 dsm 1.02293e-07 dsm_est 5.03214e-07 nsteps 225 + rtol 1e-06 rk_type 0 order 2 acc 3 t 4 dsm 3.98477e-08 dsm_est 4.99206e-07 nsteps 304 + rtol 1e-06 rk_type 0 order 2 acc 3 t 4.25 dsm 7.93335e-07 dsm_est 4.93361e-07 nsteps 268 + rtol 1e-06 rk_type 0 order 2 acc 3 t 4.5 dsm 7.4366e-08 dsm_est 5.62432e-07 nsteps 597 + rtol 1e-06 rk_type 0 order 2 acc 3 t 4.75 dsm 5.08713e-07 dsm_est 4.57462e-07 nsteps 347 + rtol 1e-06 rk_type 0 order 2 acc 3 t 5 dsm 1.42752e-07 dsm_est 5.75749e-07 nsteps 366 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_3_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_3_1.out new file mode 100644 index 0000000000..9c8d250c22 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr_20_3_1.out @@ -0,0 +1,190 @@ + +Accumulated error estimation test (Nonlinear Kvaerno-Prothero-Robinson problem): + time domain: (0,5] + partition size = 20 + G = -10 + e = 0.1 + omega = 5 + ERK solver, order = 3 + +Adaptive-step runs: + rtol 0.01 rk_type 1 order 3 acc 1 t 0.25 dsm 6.04149e-05 dsm_est 0.000128901 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 0.5 dsm 0.000268262 dsm_est 0.00122853 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 0.75 dsm 0.000162426 dsm_est 0.00195582 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 1 dsm 0.00010345 dsm_est 0.0018572 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 1.25 dsm 0.00145293 dsm_est 0.00223784 nsteps 7 + rtol 0.01 rk_type 1 order 3 acc 1 t 1.5 dsm 0.000475504 dsm_est 0.00220612 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 1 t 1.75 dsm 0.000953909 dsm_est 0.00848961 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 2 dsm 0.00190469 dsm_est 0.00438086 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 1 t 2.25 dsm 0.00091692 dsm_est 0.00242184 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 2.5 dsm 0.000303064 dsm_est 0.00155453 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 2.75 dsm 8.75302e-05 dsm_est 0.000628795 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 3 dsm 0.000106108 dsm_est 0.000628042 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 3.25 dsm 0.000146676 dsm_est 0.000206402 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 3.5 dsm 0.000132279 dsm_est 0.000121892 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 3.75 dsm 0.000106549 dsm_est 7.66243e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 4 dsm 7.68783e-05 dsm_est 6.29323e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 4.25 dsm 9.2941e-05 dsm_est 0.000487848 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 4.5 dsm 1.84821e-05 dsm_est 0.000635863 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 4.75 dsm 6.25225e-05 dsm_est 0.000713957 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 1 t 5 dsm 1.27772e-05 dsm_est 0.000232819 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 0.25 dsm 6.04149e-05 dsm_est 0.000142481 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 0.5 dsm 0.000268262 dsm_est 0.0017944 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 0.75 dsm 0.000162426 dsm_est 0.00306316 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 1 dsm 0.00010345 dsm_est 0.00295527 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 1.25 dsm 0.00145293 dsm_est 0.00455884 nsteps 7 + rtol 0.01 rk_type 1 order 3 acc 2 t 1.5 dsm 0.000475504 dsm_est 0.00371453 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 2 t 1.75 dsm 0.000953909 dsm_est 0.0112601 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 2 dsm 0.00190469 dsm_est 0.00636832 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 2 t 2.25 dsm 0.00091692 dsm_est 0.00259729 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 2.5 dsm 0.000303064 dsm_est 0.00186612 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 2.75 dsm 8.75302e-05 dsm_est 0.00125767 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 3 dsm 0.000106108 dsm_est 0.00108028 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 3.25 dsm 0.000146676 dsm_est 0.000287211 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 3.5 dsm 0.000132279 dsm_est 0.000198803 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 3.75 dsm 0.000106549 dsm_est 0.000127557 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 4 dsm 7.68783e-05 dsm_est 9.87869e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 4.25 dsm 9.2941e-05 dsm_est 0.000739077 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 4.5 dsm 1.84821e-05 dsm_est 0.000782096 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 4.75 dsm 6.25225e-05 dsm_est 0.00123861 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 2 t 5 dsm 1.27772e-05 dsm_est 0.000335449 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 0.25 dsm 6.04149e-05 dsm_est 5.47626e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 0.5 dsm 0.000268262 dsm_est 0.000688366 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 0.75 dsm 0.000162426 dsm_est 0.00119286 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 1 dsm 0.00010345 dsm_est 0.00117728 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 1.25 dsm 0.00145293 dsm_est 0.00131716 nsteps 7 + rtol 0.01 rk_type 1 order 3 acc 3 t 1.5 dsm 0.000475504 dsm_est 0.00085833 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 3 t 1.75 dsm 0.000953909 dsm_est 0.0042376 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 2 dsm 0.00190469 dsm_est 0.00253135 nsteps 6 + rtol 0.01 rk_type 1 order 3 acc 3 t 2.25 dsm 0.00091692 dsm_est 0.00101199 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 2.5 dsm 0.000303064 dsm_est 0.000742258 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 2.75 dsm 8.75302e-05 dsm_est 0.000500525 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 3 dsm 0.000106108 dsm_est 0.000425438 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 3.25 dsm 0.000146676 dsm_est 0.000113454 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 3.5 dsm 0.000132279 dsm_est 7.91918e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 3.75 dsm 0.000106549 dsm_est 5.03981e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 4 dsm 7.68783e-05 dsm_est 3.86745e-05 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 4.25 dsm 9.2941e-05 dsm_est 0.00028618 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 4.5 dsm 1.84821e-05 dsm_est 0.000303327 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 4.75 dsm 6.25225e-05 dsm_est 0.000490051 nsteps 5 + rtol 0.01 rk_type 1 order 3 acc 3 t 5 dsm 1.27772e-05 dsm_est 0.000133564 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 1 t 0.25 dsm 2.72131e-05 dsm_est 1.82775e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 1 t 0.5 dsm 1.24325e-05 dsm_est 7.57337e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 1 t 0.75 dsm 3.04294e-06 dsm_est 5.32249e-05 nsteps 11 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1 dsm 5.56473e-06 dsm_est 4.83864e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1.25 dsm 2.64925e-05 dsm_est 9.09824e-05 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1.5 dsm 3.99013e-05 dsm_est 6.618e-05 nsteps 17 + rtol 0.0001 rk_type 1 order 3 acc 1 t 1.75 dsm 6.46566e-06 dsm_est 9.0814e-05 nsteps 20 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2 dsm 2.27591e-05 dsm_est 4.33739e-05 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2.25 dsm 2.35987e-05 dsm_est 6.01739e-05 nsteps 12 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2.5 dsm 1.9839e-05 dsm_est 5.21299e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 1 t 2.75 dsm 4.82543e-06 dsm_est 7.16519e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3 dsm 1.42111e-05 dsm_est 8.44199e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3.25 dsm 8.99237e-05 dsm_est 5.93926e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3.5 dsm 7.05943e-05 dsm_est 2.57508e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 1 t 3.75 dsm 0.00011745 dsm_est 7.78236e-05 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4 dsm 8.6392e-05 dsm_est 6.06003e-05 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4.25 dsm 1.06282e-05 dsm_est 9.64146e-05 nsteps 8 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4.5 dsm 3.00465e-06 dsm_est 6.91731e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 1 t 4.75 dsm 2.24177e-06 dsm_est 6.08731e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 1 t 5 dsm 4.61559e-06 dsm_est 3.8972e-05 nsteps 7 + rtol 0.0001 rk_type 1 order 3 acc 2 t 0.25 dsm 2.72131e-05 dsm_est 4.924e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 2 t 0.5 dsm 1.24325e-05 dsm_est 0.000277893 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 2 t 0.75 dsm 3.04294e-06 dsm_est 0.000266101 nsteps 11 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1 dsm 5.56473e-06 dsm_est 0.00021078 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1.25 dsm 2.64925e-05 dsm_est 0.000612671 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1.5 dsm 3.99013e-05 dsm_est 0.000376163 nsteps 17 + rtol 0.0001 rk_type 1 order 3 acc 2 t 1.75 dsm 6.46566e-06 dsm_est 0.000664655 nsteps 20 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2 dsm 2.27591e-05 dsm_est 0.000263341 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2.25 dsm 2.35987e-05 dsm_est 0.000218874 nsteps 12 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2.5 dsm 1.9839e-05 dsm_est 0.000144657 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 2 t 2.75 dsm 4.82543e-06 dsm_est 0.000184366 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3 dsm 1.42111e-05 dsm_est 0.000233128 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3.25 dsm 8.99237e-05 dsm_est 9.1606e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3.5 dsm 7.05943e-05 dsm_est 6.46269e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 2 t 3.75 dsm 0.00011745 dsm_est 0.000129769 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4 dsm 8.6392e-05 dsm_est 0.000108688 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4.25 dsm 1.06282e-05 dsm_est 0.000207268 nsteps 8 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4.5 dsm 3.00465e-06 dsm_est 0.00017063 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 2 t 4.75 dsm 2.24177e-06 dsm_est 0.000176806 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 2 t 5 dsm 4.61559e-06 dsm_est 8.40566e-05 nsteps 7 + rtol 0.0001 rk_type 1 order 3 acc 3 t 0.25 dsm 2.72131e-05 dsm_est 1.26444e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 3 t 0.5 dsm 1.24325e-05 dsm_est 3.83049e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 3 t 0.75 dsm 3.04294e-06 dsm_est 3.06274e-05 nsteps 11 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1 dsm 5.56473e-06 dsm_est 2.34303e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1.25 dsm 2.64925e-05 dsm_est 4.97711e-05 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1.5 dsm 3.99013e-05 dsm_est 2.68233e-05 nsteps 17 + rtol 0.0001 rk_type 1 order 3 acc 3 t 1.75 dsm 6.46566e-06 dsm_est 4.0356e-05 nsteps 20 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2 dsm 2.27591e-05 dsm_est 2.34866e-05 nsteps 14 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2.25 dsm 2.35987e-05 dsm_est 2.21042e-05 nsteps 12 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2.5 dsm 1.9839e-05 dsm_est 1.76794e-05 nsteps 10 + rtol 0.0001 rk_type 1 order 3 acc 3 t 2.75 dsm 4.82543e-06 dsm_est 2.9381e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3 dsm 1.42111e-05 dsm_est 4.44933e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3.25 dsm 8.99237e-05 dsm_est 2.62142e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3.5 dsm 7.05943e-05 dsm_est 1.71657e-05 nsteps 6 + rtol 0.0001 rk_type 1 order 3 acc 3 t 3.75 dsm 0.00011745 dsm_est 5.1548e-05 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4 dsm 8.6392e-05 dsm_est 4.3218e-05 nsteps 5 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4.25 dsm 1.06282e-05 dsm_est 4.16064e-05 nsteps 8 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4.5 dsm 3.00465e-06 dsm_est 3.06597e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 3 t 4.75 dsm 2.24177e-06 dsm_est 2.78662e-05 nsteps 9 + rtol 0.0001 rk_type 1 order 3 acc 3 t 5 dsm 4.61559e-06 dsm_est 2.06734e-05 nsteps 7 + rtol 1e-06 rk_type 1 order 3 acc 1 t 0.25 dsm 4.12033e-07 dsm_est 8.83529e-07 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 1 t 0.5 dsm 2.46326e-07 dsm_est 8.87311e-07 nsteps 31 + rtol 1e-06 rk_type 1 order 3 acc 1 t 0.75 dsm 3.64026e-08 dsm_est 8.31388e-07 nsteps 39 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1 dsm 2.25687e-07 dsm_est 5.06051e-07 nsteps 45 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1.25 dsm 5.93423e-07 dsm_est 9.4211e-07 nsteps 53 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1.5 dsm 6.11123e-07 dsm_est 7.4438e-07 nsteps 68 + rtol 1e-06 rk_type 1 order 3 acc 1 t 1.75 dsm 1.11041e-07 dsm_est 8.66272e-07 nsteps 76 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2 dsm 4.68945e-07 dsm_est 8.0627e-07 nsteps 49 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2.25 dsm 2.82077e-07 dsm_est 7.6683e-07 nsteps 46 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2.5 dsm 3.42754e-07 dsm_est 6.52319e-07 nsteps 37 + rtol 1e-06 rk_type 1 order 3 acc 1 t 2.75 dsm 8.76441e-08 dsm_est 7.34826e-07 nsteps 30 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3 dsm 9.61476e-08 dsm_est 8.15376e-07 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3.25 dsm 1.10578e-06 dsm_est 8.36809e-07 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3.5 dsm 8.13041e-07 dsm_est 6.57651e-07 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 1 t 3.75 dsm 8.63105e-07 dsm_est 6.37719e-07 nsteps 15 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4 dsm 6.24598e-07 dsm_est 6.02239e-07 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4.25 dsm 1.79535e-07 dsm_est 8.62348e-07 nsteps 24 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4.5 dsm 4.23449e-08 dsm_est 8.85746e-07 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 1 t 4.75 dsm 1.70945e-08 dsm_est 6.68877e-07 nsteps 35 + rtol 1e-06 rk_type 1 order 3 acc 1 t 5 dsm 4.21376e-08 dsm_est 6.1895e-07 nsteps 23 + rtol 1e-06 rk_type 1 order 3 acc 2 t 0.25 dsm 4.12033e-07 dsm_est 5.39389e-06 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 2 t 0.5 dsm 2.46326e-07 dsm_est 1.9237e-05 nsteps 31 + rtol 1e-06 rk_type 1 order 3 acc 2 t 0.75 dsm 3.64026e-08 dsm_est 1.83009e-05 nsteps 39 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1 dsm 2.25687e-07 dsm_est 9.58735e-06 nsteps 45 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1.25 dsm 5.93423e-07 dsm_est 3.20094e-05 nsteps 53 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1.5 dsm 6.11123e-07 dsm_est 1.91705e-05 nsteps 68 + rtol 1e-06 rk_type 1 order 3 acc 2 t 1.75 dsm 1.11041e-07 dsm_est 3.76134e-05 nsteps 76 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2 dsm 4.68945e-07 dsm_est 1.77029e-05 nsteps 49 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2.25 dsm 2.82077e-07 dsm_est 1.41512e-05 nsteps 46 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2.5 dsm 3.42754e-07 dsm_est 8.81414e-06 nsteps 37 + rtol 1e-06 rk_type 1 order 3 acc 2 t 2.75 dsm 8.76441e-08 dsm_est 1.05628e-05 nsteps 30 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3 dsm 9.61476e-08 dsm_est 1.02396e-05 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3.25 dsm 1.10578e-06 dsm_est 5.86128e-06 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3.5 dsm 8.13041e-07 dsm_est 4.13828e-06 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 2 t 3.75 dsm 8.63105e-07 dsm_est 4.96105e-06 nsteps 15 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4 dsm 6.24598e-07 dsm_est 3.42283e-06 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4.25 dsm 1.79535e-07 dsm_est 1.35763e-05 nsteps 24 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4.5 dsm 4.23449e-08 dsm_est 9.97609e-06 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 2 t 4.75 dsm 1.70945e-08 dsm_est 8.39064e-06 nsteps 35 + rtol 1e-06 rk_type 1 order 3 acc 2 t 5 dsm 4.21376e-08 dsm_est 4.92976e-06 nsteps 23 + rtol 1e-06 rk_type 1 order 3 acc 3 t 0.25 dsm 4.12033e-07 dsm_est 3.51639e-07 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 3 t 0.5 dsm 2.46326e-07 dsm_est 6.81523e-07 nsteps 31 + rtol 1e-06 rk_type 1 order 3 acc 3 t 0.75 dsm 3.64026e-08 dsm_est 5.27456e-07 nsteps 39 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1 dsm 2.25687e-07 dsm_est 2.33885e-07 nsteps 45 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1.25 dsm 5.93423e-07 dsm_est 6.2587e-07 nsteps 53 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1.5 dsm 6.11123e-07 dsm_est 3.04709e-07 nsteps 68 + rtol 1e-06 rk_type 1 order 3 acc 3 t 1.75 dsm 1.11041e-07 dsm_est 5.31606e-07 nsteps 76 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2 dsm 4.68945e-07 dsm_est 4.08204e-07 nsteps 49 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2.25 dsm 2.82077e-07 dsm_est 3.48802e-07 nsteps 46 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2.5 dsm 3.42754e-07 dsm_est 2.65247e-07 nsteps 37 + rtol 1e-06 rk_type 1 order 3 acc 3 t 2.75 dsm 8.76441e-08 dsm_est 3.82534e-07 nsteps 30 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3 dsm 9.61476e-08 dsm_est 3.90658e-07 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3.25 dsm 1.10578e-06 dsm_est 3.96373e-07 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3.5 dsm 8.13041e-07 dsm_est 2.65458e-07 nsteps 19 + rtol 1e-06 rk_type 1 order 3 acc 3 t 3.75 dsm 8.63105e-07 dsm_est 4.14868e-07 nsteps 15 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4 dsm 6.24598e-07 dsm_est 2.48565e-07 nsteps 17 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4.25 dsm 1.79535e-07 dsm_est 6.40873e-07 nsteps 24 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4.5 dsm 4.23449e-08 dsm_est 4.08016e-07 nsteps 29 + rtol 1e-06 rk_type 1 order 3 acc 3 t 4.75 dsm 1.70945e-08 dsm_est 2.72362e-07 nsteps 35 + rtol 1e-06 rk_type 1 order 3 acc 3 t 5 dsm 4.21376e-08 dsm_est 2.53485e-07 nsteps 23 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 c56ac4292d..163881fa4a 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 @@ -129,8 +129,8 @@ int main(int argc, char* argv[]) if (check_flag((void*)inner_mem, "ARKStepCreate", 0)) { return 1; } MRIStepInnerStepper inner_stepper = NULL; - flag = ARKStepCreateMRIStepInnerStepper(inner_mem, &inner_stepper); - if (check_flag(&flag, "ARKStepCreateMRIStepInnerStepper", 1)) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(inner_mem, &inner_stepper); + if (check_flag(&flag, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } mristep_mem = MRIStepCreate(NULL, f, T0, y, inner_stepper, sunctx); if (check_flag((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp new file mode 100644 index 0000000000..1169aabc17 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp @@ -0,0 +1,1388 @@ +/* ---------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ---------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ---------------------------------------------------------------- + * Multirate stiff Brusselator ODE test problem: + * du/dt = a - (w+1)*u + v*u^2 + * dv/dt = w*u - v*u^2 + * dw/dt = (b-w)/ep - w*u + * for t in the interval [0.0, 10.0], with initial conditions + * u0=1.2, v0=3.1, w0=3, and parameters a=1, b=3.5. + * + * Problem stiffness is determined by ep, wherein if the dynamical + * time step is given by H and the explicit time step size is given + * by h, then H/h = 1/(100 ep), i.e., the stability-limited step + * takes over at values of ep < 1e-2. + * + * This program allows a single problem-defining input parameter: + * ep: stiffness factor [default = 1/2500] + * + * We perform a multirate splitting of this problem as + * f^s(t,u,v,w) = [a - (w+1)*u + v*u^2] + * [ w*u - v*u^2 ] + * [ -w*u ] + * f^f(t,u,v,w) = [ 0 ] + * [ 0 ] + * [(b-w)/ep] + * For methods that support ImEx treatment of the slow time scale, we + * further split the slow operator f^s into + * f^I(t,u,v,w) = [-(w+1)*u] + * [ w*u ] + * [ -w*u ] + * f^E(t,u,v,w) = [a + v*u^2] + * [ -v*u^2 ] + * [ 0 ] + * + * Additional input options may be used to select between various + * solver options: + * - slow fixed/initial step size: hs [default = 0.01] + * - fast fixed/initial step size: hf [default = 0.0001] + * - set initial adaptive step size as hs/hf above: set_h0 [default 0] + * - relative solution tolerance: rtol [default = 1e-4] + * - absolute solution tolerance: atol [default = 1e-11] + * - slow stepsize safety factor: safety [default = 0.96] + * - relative solution tolerance for fast integrator: fast_rtol [default = 1e-4] + * - use p (0) vs q (1) for slow adaptivity: slow_pq [default = 0] + * - use p (0) vs q (1) for fast adaptivity: fast_pq [default = 0] + * - "slow" MRI method: mri_method [default = ARKODE_MRI_GARK_ERK45a] + * - "fast" ERKStep method order: fast_order [default 4] + * To put all physics at the slow scale, use "0", otherwise + * specify a valid explicit method order. + * - "slow" MRI temporal adaptivity controller: scontrol [default = 6] + * 0: no controller [fixed time steps] + * 5: I controller (as part of MRI-HTOL) + * 6: I controller (alone) + * 7: PI controller (as part of MRI-HTOL) + * 8: PI controller (alone) + * 9: PID controller (as part of MRI-HTOL) + * 10: PID controller (alone) + * 11: ExpGus controller (as part of MRI-HTOL) + * 12: ExpGus controller (alone) + * 13: ImpGus controller (as part of MRI-HTOL) + * 14: ImpGus controller (alone) + * 15: ImExGus controller (as part of MRI-HTOL) + * 16: ImExGus controller (alone) + * - "fast" ERKStep temporal adaptivity controller: fcontrol [default = 1] + * Note that this will only be used for 5 <= scontrol <= 16. + * 0: no controller [fixed time steps] + * 1: I controller + * 2: PI controller + * 3: PID controller + * 4: ExpGus controller + * 5: ImpGus controller + * 6: ImExGus controller + * - "fast" ERKStep accumulated error type: faccum [default = 0] + * Note that this will only be used for multirate scontrol options + * -1: no accumulation + * 0: maximum accumulation + * 1: additive accumulation + * 2: average accumulation + * - controller parameters: (k1s, k2s, k3s, k1f, k2f, k3f, + * bias, htol_relch, htol_minfac, htol_maxfac) + * slow single-rate controllers: use k1s through k3s, as appropriate. + * fast single-rate controllers: use k1f through k3f, as appropriate. + * MRIHTol controllers: use htol_relch, htol_minfac, htol_maxfac. + * all controllers (fast and slow) use bias. + * ** if any one of a relevant set are "-1" then the defaults are used + * + * Outputs and solution error values are printed at equal intervals + * of 0.5 and run statistics are printed at the end. + * ----------------------------------------------------------------*/ + +// Header files +#include <arkode/arkode_erkstep.h> // prototypes for ERKStep fcts., consts +#include <arkode/arkode_mristep.h> // prototypes for MRIStep fcts., consts +#include <cmath> +#include <cstdio> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <nvector/nvector_serial.h> // serial N_Vector type, fcts., macros +#include <sunadaptcontroller/sunadaptcontroller_imexgus.h> +#include <sunadaptcontroller/sunadaptcontroller_mrihtol.h> +#include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include <sundials/sundials_core.hpp> +#include <sundials/sundials_logger.h> +#include <sunlinsol/sunlinsol_dense.h> // dense linear solver +#include <sunmatrix/sunmatrix_dense.h> // dense matrix type, fcts., macros +#include "../../utilities/test_utilities.hpp" // common utility functions + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define ESYM "Le" +#define FSYM "Lf" +#else +#define ESYM "e" +#define FSYM "f" +#endif + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +// Problem options +struct Options +{ + // Problem parameters + sunrealtype a = SUN_RCONST(1.0); + sunrealtype b = SUN_RCONST(3.5); + sunrealtype ep = SUN_RCONST(0.0004); + + // Step sizes and tolerances + int set_h0 = 0; + sunrealtype hs = SUN_RCONST(1.0e-2); + sunrealtype hf = SUN_RCONST(1.0e-4); + sunrealtype rtol = SUN_RCONST(1.0e-4); + sunrealtype atol = SUN_RCONST(1.0e-11); + sunrealtype fast_rtol = SUN_RCONST(1.0e-4); + + // Method selection + std::string mri_method = "ARKODE_MRI_GARK_ERK45a"; + int fast_order = 4; + int scontrol = 6; + int fcontrol = 1; + int faccum = 0; + int slow_pq = 0; + int fast_pq = 0; + + // controller parameters + sunrealtype k1s = SUN_RCONST(-1.0); + sunrealtype k2s = SUN_RCONST(-1.0); + sunrealtype k3s = SUN_RCONST(-1.0); + sunrealtype k1f = SUN_RCONST(-1.0); + sunrealtype k2f = SUN_RCONST(-1.0); + sunrealtype k3f = SUN_RCONST(-1.0); + sunrealtype bias = SUN_RCONST(-1.0); + sunrealtype htol_relch = SUN_RCONST(-1.0); + sunrealtype htol_minfac = SUN_RCONST(-1.0); + sunrealtype htol_maxfac = SUN_RCONST(-1.0); + sunrealtype slow_safety = SUN_RCONST(-1.0); +}; + +// User-supplied functions called by the solver +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Utility functions +static void InputHelp(); +static int ReadInputs(std::vector<std::string>& args, Options& opts, + SUNContext ctx); +static void PrintSlowAdaptivity(Options opts); +static void PrintFastAdaptivity(Options opts); + +// Main Program +int main(int argc, char* argv[]) +{ + // SUNDIALS context objects + sundials::Context sunctx; // main solver + sundials::Context refctx; // reference solver + + // Read input options + Options opts; + std::vector<std::string> args(argv + 1, argv + argc); + int flag = ReadInputs(args, opts, sunctx); + if (check_flag(flag, "ReadInputs")) return 1; + + // General problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(10.0); // final time + sunindextype NEQ = 3; // number of dependent vars. + int Nt = 20; // number of output times + + // Initial problem output + // While traversing these, set various function pointers, table constants, and method orders. + ARKRhsFn f_f, f_se, f_si; + ARKLsJacFn J_s; + int retval; + sunbooleantype slowimplicit, slowimex; + slowimplicit = slowimex = SUNFALSE; + f_si = NULL; + J_s = NULL; + f_f = (opts.fast_order == 0) ? f0 : ff; + f_se = (opts.fast_order == 0) ? fn : fs; + if ((opts.mri_method == "ARKODE_MRI_GARK_IRK21a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK34a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + slowimplicit = SUNTRUE; + f_se = NULL; + f_si = (opts.fast_order == 0) ? fn : fs; + J_s = (opts.fast_order == 0) ? Jn : Js; + } + if ((opts.mri_method == "ARKODE_IMEX_MRI_SR21") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR32") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR43")) + { + slowimex = SUNTRUE; + slowimplicit = SUNTRUE; + f_se = (opts.fast_order == 0) ? f0 : fse; + f_si = (opts.fast_order == 0) ? fn : fsi; + J_s = (opts.fast_order == 0) ? Jn : Jsi; + } + std::cout << "\nAdaptive multirate stiff Brusselator test problem:\n"; + std::cout << " time domain: (" << T0 << "," << Tf << "]\n"; + std::cout << " ep = " << opts.ep << std::endl; + std::cout << "\n Slow integrator: " << opts.mri_method; + if (slowimex) { std::cout << " (ImEx)" << std::endl; } + else if (slowimplicit) { std::cout << " (implicit)" << std::endl; } + else { std::cout << " (explicit)" << std::endl; } + PrintSlowAdaptivity(opts); + if (opts.fast_order == 0) { std::cout << "\n Fast integrator disabled"; } + else { std::cout << "\n Fast order " << opts.fast_order << std::endl; } + PrintFastAdaptivity(opts); + + // If SUNLogger is enabled, manually disable it for the reference solver + SUNLogger logger = NULL; + retval = SUNLogger_Create(SUN_COMM_NULL, 0, &logger); + retval = SUNContext_SetLogger(refctx, logger); + retval = SUNLogger_SetErrorFilename(logger, "/dev/null"); + retval = SUNLogger_SetWarningFilename(logger, "/dev/null"); + retval = SUNLogger_SetInfoFilename(logger, "/dev/null"); + retval = SUNLogger_SetDebugFilename(logger, "/dev/null"); + + // Create and initialize serial vectors for the solution and reference + N_Vector y = N_VNew_Serial(NEQ, sunctx); + if (check_ptr((void*)y, "N_VNew_Serial")) return 1; + N_Vector yref = N_VNew_Serial(NEQ, refctx); + if (check_ptr((void*)yref, "N_VNew_Serial")) return 1; + + // Set initial conditions + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* yrefdata = N_VGetArrayPointer(yref); + ydata[0] = SUN_RCONST(1.2); + ydata[1] = SUN_RCONST(3.1); + ydata[2] = SUN_RCONST(3.0); + N_VScale(ONE, y, yref); + + // Create and configure reference solver object + void* arkode_ref = ERKStepCreate(fn, T0, yref, refctx); + if (check_ptr((void*)arkode_ref, "ERKStepCreate")) return 1; + retval = ARKodeSetUserData(arkode_ref, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + retval = ARKodeSetOrder(arkode_ref, 5); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(arkode_ref, SUN_RCONST(1.e-10), SUN_RCONST(1.e-12)); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_ref, 10000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return (1); + + // Create and configure fast controller object + SUNAdaptController fcontrol = NULL; + switch (opts.fcontrol) + { + case (1): + fcontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_I")) return 1; + if (opts.k1f > -1) + { + retval = SUNAdaptController_SetParams_I(fcontrol, opts.k1f); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + case (2): + fcontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PI")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_PI(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + case (3): + fcontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PID")) return 1; + if (std::min(opts.k1f, std::min(opts.k2f, opts.k3f)) > -1) + { + retval = SUNAdaptController_SetParams_PID(fcontrol, opts.k1f, opts.k2f, + opts.k3f); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + case (4): + fcontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ExpGus")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + case (5): + fcontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImpGus")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + case (6): + fcontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImExGus")) return 1; + break; + } + if ((opts.bias > -1) && (opts.fcontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(fcontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create ERKStep (fast) integrator + void* inner_arkode_mem = NULL; // ARKode memory structure + inner_arkode_mem = ERKStepCreate(f_f, T0, y, sunctx); + if (check_ptr((void*)inner_arkode_mem, "ERKStepCreate")) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, opts.fast_order); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, opts.fast_rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + if (opts.fcontrol != 0) + { + retval = ARKodeSetAdaptController(inner_arkode_mem, fcontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + retval = ARKodeSetAdaptivityAdjustment(inner_arkode_mem, opts.fast_pq - 1); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + else + { + retval = ARKodeSetFixedStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + ARKAccumError acc_type = ARK_ACCUMERROR_NONE; + if (opts.faccum == 0) { acc_type = ARK_ACCUMERROR_MAX; } + if (opts.faccum == 1) { acc_type = ARK_ACCUMERROR_SUM; } + if (opts.faccum == 2) { acc_type = ARK_ACCUMERROR_AVG; } + retval = ARKodeSetAccumulatedErrorType(inner_arkode_mem, acc_type); + if (check_flag(retval, "ARKodeSetAccumulatedErrorType")) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(inner_arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + + // Create inner stepper + MRIStepInnerStepper inner_stepper = NULL; // inner stepper + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_flag(retval, "ARKodeCreateMRIStepInnerStepper")) return 1; + + // Create slow controller object, and select orders of accuracy as relevant + SUNAdaptController scontrol = NULL; + SUNAdaptController scontrol_H = NULL; + SUNAdaptController scontrol_Tol = NULL; + switch (opts.scontrol) + { + case (5): + scontrol_H = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_I (slow H)")) return 1; + scontrol_Tol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_I (slow Tol)")) + return 1; + if (opts.k1s > -1) + { + retval = SUNAdaptController_SetParams_I(scontrol_H, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(scontrol_Tol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (6): + scontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptControllerI (slow)")) return 1; + if (opts.k1s > -1) + { + retval = SUNAdaptController_SetParams_I(scontrol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + case (7): + scontrol_H = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PI (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PI (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_PI(scontrol_H, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(scontrol_Tol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (8): + scontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PI (slow)")) return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_PI(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + case (9): + scontrol_H = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PID (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PID (slow Tol)")) + return 1; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + retval = SUNAdaptController_SetParams_PID(scontrol_H, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(scontrol_Tol, opts.k1s, + opts.k2s, opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (10): + scontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PID (slow)")) return 1; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + retval = SUNAdaptController_SetParams_PID(scontrol, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + case (11): + scontrol_H = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ExpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ExpGus (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (12): + scontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ExpGus (slow)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + case (13): + scontrol_H = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImpGus (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (14): + scontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImpGus (slow)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + case (15): + scontrol_H = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImExGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImExGus (slow Tol)")) + return 1; + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (16): + scontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImExGus (slow)")) + return 1; + break; + } + if ((opts.bias > -1) && (opts.scontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(scontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create MRI (slow) integrator + void* arkode_mem = NULL; // ARKode memory structure + arkode_mem = MRIStepCreate(f_se, f_si, T0, y, inner_stepper, sunctx); + if (check_ptr((void*)arkode_mem, "MRIStepCreate")) return 1; + MRIStepCoupling C = MRIStepCoupling_LoadTableByName((opts.mri_method).c_str()); + if (check_ptr((void*)C, "MRIStepCoupling_LoadTableByName")) return 1; + retval = MRIStepSetCoupling(arkode_mem, C); + if (check_flag(retval, "MRIStepSetCoupling")) return 1; + SUNMatrix As = NULL; // matrix for slow solver + SUNLinearSolver LSs = NULL; // slow linear solver object + if (slowimplicit) + { + As = SUNDenseMatrix(NEQ, NEQ, sunctx); + if (check_ptr((void*)As, "SUNDenseMatrix")) return 1; + LSs = SUNLinSol_Dense(y, As, sunctx); + if (check_ptr((void*)LSs, "SUNLinSol_Dense")) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_flag(retval, "ARKodeSetLinearSolver")) return 1; + retval = ARKodeSetJacFn(arkode_mem, J_s); + if (check_flag(retval, "ARKodeSetJacFn")) return 1; + } + retval = ARKodeSStolerances(arkode_mem, opts.rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + if (opts.scontrol != 0) + { + retval = ARKodeSetAdaptController(arkode_mem, scontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.slow_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + if (opts.slow_safety > -1) + { + retval = ARKodeSetSafetyFactor(arkode_mem, opts.slow_safety); + if (check_flag(retval, "ARKodeSetSafetyFactor")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + + // + // Integrate ODE + // + + // Main time-stepping loop: calls ARKodeEvolve to perform the + // integration, then prints results. Stops when the final time + // has been reached + sunrealtype t = T0; + sunrealtype t2 = T0; + sunrealtype dTout = (Tf - T0) / Nt; + sunrealtype tout = T0 + dTout; + sunrealtype u, v, w, uerr, verr, werr, uerrtot, verrtot, werrtot, errtot; + sunrealtype accuracy; + uerr = verr = werr = uerrtot = verrtot = werrtot = errtot = accuracy = ZERO; + printf(" t u v w uerr verr " + "werr\n"); + printf(" " + "---------------------------------------------------------------------" + "----\n"); + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %.1" ESYM + " %.1" ESYM " %.1" ESYM "\n", + t, ydata[0], ydata[1], ydata[2], uerr, verr, werr); + while (Tf - t > SUN_RCONST(1.0e-8)) + { + // reset reference solver so that it begins with identical state + retval = ARKodeReset(arkode_ref, t, y); + + // evolve solution in one-step mode + retval = ARKodeSetStopTime(arkode_mem, tout); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_ONE_STEP); + if (retval < 0) + { + printf("ARKodeEvolve error (%i)\n", retval); + return 1; + } + + // evolve reference solver to same time in "normal" mode + retval = ARKodeSetStopTime(arkode_ref, t); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_ref, t, yref, &t2, ARK_NORMAL); + if (retval < 0) + { + printf("ARKodeEvolve reference solution error (%i)\n", retval); + return 1; + } + + // access/print solution and error + u = ydata[0]; + v = ydata[1]; + w = ydata[2]; + uerr = std::abs(yrefdata[0] - u); + verr = std::abs(yrefdata[1] - v); + werr = std::abs(yrefdata[2] - w); + uerrtot += uerr * uerr; + verrtot += verr * verr; + werrtot += werr * werr; + errtot += uerr * uerr + verr * verr + werr * werr; + accuracy = std::max(accuracy, + uerr / std::abs(opts.atol + opts.rtol * yrefdata[0])); + accuracy = std::max(accuracy, + verr / std::abs(opts.atol + opts.rtol * yrefdata[1])); + accuracy = std::max(accuracy, + werr / std::abs(opts.atol + opts.rtol * yrefdata[2])); + + // Periodically output current results to screen + if (t >= tout) + { + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %10.6" FSYM + " %.1" ESYM " %.1" ESYM " %.1" ESYM "\n", + t, u, v, w, uerr, verr, werr); + } + } + printf(" " + "---------------------------------------------------------------------" + "----\n"); + + // + // Finalize + // + + // Get some slow integrator statistics + long int nsts, natts, netfs, nfse, nfsi; + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(arkode_mem, &natts); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netfs); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + check_flag(retval, "ARKodeGetNumRhsEvals"); + + // Get some fast integrator statistics + long int nstf, nattf, netff, nff; + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(inner_arkode_mem, &nattf); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(inner_arkode_mem, &netff); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_flag(retval, "ARKodeGetNumRhsEvals"); + + // Print some final statistics + uerrtot = std::sqrt(uerrtot / (sunrealtype)nsts); + verrtot = std::sqrt(verrtot / (sunrealtype)nsts); + werrtot = std::sqrt(werrtot / (sunrealtype)nsts); + errtot = std::sqrt(errtot / SUN_RCONST(3.0) / (sunrealtype)nsts); + std::cout << "\nFinal Solver Statistics:\n"; + std::cout << " Slow steps = " << nsts << " (attempts = " << natts + << ", fails = " << netfs << ")\n"; + std::cout << " Fast steps = " << nstf << " (attempts = " << nattf + << ", fails = " << netff << ")\n"; + std::cout << " u error = " << uerrtot << ", v error = " << verrtot + << ", w error = " << werrtot << ", total error = " << errtot + << std::endl; + std::cout << " Relative accuracy = " << accuracy << std::endl; + std::cout << " Total RHS evals: Fse = " << nfse << ", Fsi = " << nfsi + << ", Ff = " << nff << std::endl; + + // Get/print slow integrator decoupled implicit solver statistics + if (slowimplicit) + { + long int nnis, nncs, njes; + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_flag(retval, "ARKodeGetNonlinSolvStats"); + retval = ARKodeGetNumJacEvals(arkode_mem, &njes); + check_flag(retval, "ARKodeGetNumJacEvals"); + std::cout << " Slow Newton iters = " << nnis << std::endl; + std::cout << " Slow Newton conv fails = " << nncs << std::endl; + std::cout << " Slow Jacobian evals = " << njes << std::endl; + } + + // Clean up and return + N_VDestroy(y); + MRIStepCoupling_Free(C); + if (As) { SUNMatDestroy(As); } + if (LSs) { SUNLinSolFree(LSs); } + if (scontrol) { SUNAdaptController_Destroy(scontrol); } + if (scontrol_H) { SUNAdaptController_Destroy(scontrol_H); } + if (scontrol_Tol) { SUNAdaptController_Destroy(scontrol_Tol); } + if (fcontrol) { SUNAdaptController_Destroy(fcontrol); } + ARKodeFree(&inner_arkode_mem); // Free fast integrator memory + MRIStepInnerStepper_Free(&inner_stepper); // Free inner stepper structure + ARKodeFree(&arkode_mem); // Free slow integrator memory + ARKodeFree(&arkode_ref); // Free reference solver memory + SUNLogger_Destroy(&logger); // Free logger + + return 0; +} + +// ------------------------------ +// Functions called by the solver +// ----------------------------- + +// ff routine to compute the fast portion of the ODE RHS. +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype w = ydata[2]; + + // fill in the RHS function: + dydata[0] = ZERO; + dydata[1] = ZERO; + dydata[2] = (opts->b - w) / opts->ep; + + // Return with success + return 0; +} + +// fs routine to compute the slow portion of the ODE RHS. +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function: + dydata[0] = opts->a - (w + ONE) * u + v * u * u; + dydata[1] = w * u - v * u * u; + dydata[2] = -w * u; + + // Return with success + return 0; +} + +// fse routine to compute the slow portion of the ODE RHS. +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + // fill in the RHS function: + dydata[0] = opts->a + v * u * u; + dydata[1] = -v * u * u; + dydata[2] = ZERO; + + // Return with success + return 0; +} + +// fsi routine to compute the slow portion of the ODE RHS.(currently same as fse) +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function: + dydata[0] = -(w + ONE) * u; + dydata[1] = w * u; + dydata[2] = -w * u; + + // Return with success + return 0; +} + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function: + dydata[0] = opts->a - (w + ONE) * u + v * u * u; + dydata[1] = w * u - v * u * u; + dydata[2] = (opts->b - w) / opts->ep - w * u; + + // Return with success + return 0; +} + +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VConst(ZERO, ydot); + return (0); +} + +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the Jacobian: + SM_ELEMENT_D(J, 0, 0) = -(w + ONE) + TWO * u * v; + SM_ELEMENT_D(J, 0, 1) = u * u; + SM_ELEMENT_D(J, 0, 2) = -u; + + SM_ELEMENT_D(J, 1, 0) = w - TWO * u * v; + SM_ELEMENT_D(J, 1, 1) = -u * u; + SM_ELEMENT_D(J, 1, 2) = u; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -u; + + // Return with success + return 0; +} + +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype w = ydata[2]; + + // fill in the Jacobian: + SM_ELEMENT_D(J, 0, 0) = -(w + ONE); + SM_ELEMENT_D(J, 0, 1) = ZERO; + SM_ELEMENT_D(J, 0, 2) = -u; + + SM_ELEMENT_D(J, 1, 0) = w; + SM_ELEMENT_D(J, 1, 1) = ZERO; + SM_ELEMENT_D(J, 1, 2) = u; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -u; + + // Return with success + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the Jacobian: + SM_ELEMENT_D(J, 0, 0) = -(w + ONE) + TWO * u * v; + SM_ELEMENT_D(J, 0, 1) = u * u; + SM_ELEMENT_D(J, 0, 2) = -u; + + SM_ELEMENT_D(J, 1, 0) = w - TWO * u * v; + SM_ELEMENT_D(J, 1, 1) = -u * u; + SM_ELEMENT_D(J, 1, 2) = u; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -ONE / opts->ep - u; + + // Return with success + return 0; +} + +// ------------------------------ +// Private helper functions +// ----------------------------- + +// ----------------------------------------------------------------------------- +// Utility functions +// ----------------------------------------------------------------------------- + +// Print command line options +void InputHelp() +{ + std::cout << std::endl; + std::cout << "Command line options:" << std::endl; + std::cout << " --help : print options and exit\n"; + std::cout << " --ep : stiffness factor\n"; + std::cout << " --hs : slow (fixed/initial) step size\n"; + std::cout << " --hf : fast (fixed/initial) step size\n"; + std::cout + << " --set_h0 : use hs/hf above to set the initial step size\n"; + std::cout << " --rtol : relative solution tolerance\n"; + std::cout << " --atol : absolute solution tolerance\n"; + std::cout + << " --fast_rtol : relative solution tolerance for fast method\n"; + std::cout << " --mri_method : MRI method name (valid ARKODE_MRITableID)\n"; + std::cout << " --fast_order : fast RK method order\n"; + std::cout << " --scontrol : slow time step controller, int in [0,16] " + "(see source)\n"; + std::cout << " --fcontrol : fast time step controller, int in [0,6] " + "(see source)\n"; + std::cout << " --faccum : fast error accumulation type {-1,0,1,2}\n"; + std::cout << " --slow_pq : use p (0) vs q (1) for slow adaptivity\n"; + std::cout << " --fast_pq : use p (0) vs q (1) for fast adaptivity\n"; + std::cout << " --k1s, --k2s, ..., -k6s : slow controller parameters\n"; + std::cout << " --k1f, --k2f, -k3f : fast controller parameters\n"; + std::cout << " --bias : slow and fast controller bias factors\n"; + std::cout << " --safety : slow time step safety factor\n"; + std::cout + << " --htol_relch : HTol controller maximum relative tolerance change\n"; + std::cout + << " --htol_minfac : HTol controller minimum relative tolerance factor\n"; + std::cout + << " --htol_maxfac : HTol controller maximum relative tolerance factor\n"; +} + +// Read input options +int ReadInputs(std::vector<std::string>& args, Options& opts, SUNContext ctx) +{ + if (find(args.begin(), args.end(), "--help") != args.end()) + { + InputHelp(); + return 1; + } + + // Problem options + find_arg(args, "--ep", opts.ep); + find_arg(args, "--hs", opts.hs); + find_arg(args, "--hf", opts.hf); + find_arg(args, "--set_h0", opts.set_h0); + find_arg(args, "--rtol", opts.rtol); + find_arg(args, "--atol", opts.atol); + find_arg(args, "--fast_rtol", opts.fast_rtol); + find_arg(args, "--mri_method", opts.mri_method); + find_arg(args, "--fast_order", opts.fast_order); + find_arg(args, "--scontrol", opts.scontrol); + find_arg(args, "--fcontrol", opts.fcontrol); + find_arg(args, "--faccum", opts.faccum); + find_arg(args, "--slow_pq", opts.slow_pq); + find_arg(args, "--fast_pq", opts.fast_pq); + find_arg(args, "--k1s", opts.k1s); + find_arg(args, "--k2s", opts.k2s); + find_arg(args, "--k3s", opts.k3s); + find_arg(args, "--k1f", opts.k1f); + find_arg(args, "--k2f", opts.k2f); + find_arg(args, "--k3f", opts.k3f); + find_arg(args, "--bias", opts.bias); + find_arg(args, "--safety", opts.slow_safety); + find_arg(args, "--htol_relch", opts.htol_relch); + find_arg(args, "--htol_minfac", opts.htol_minfac); + find_arg(args, "--htol_maxfac", opts.htol_maxfac); + + // Check inputs for validity + // 0 < rtol < 1 + if ((opts.rtol < ZERO) || (opts.rtol > ONE)) + { + std::cerr << "ERROR: rtol must be in (0,1), (" << opts.rtol << " input)\n"; + return -1; + } + // 0 < atol < 1 + if ((opts.atol < ZERO) || (opts.atol > ONE)) + { + std::cerr << "ERROR: atol must be in (0,1), (" << opts.atol << " input)\n"; + return -1; + } + // 0 < fast_rtol < 1 + if ((opts.fast_rtol < ZERO) || (opts.fast_rtol > ONE)) + { + std::cerr << "ERROR: fast_rtol must be in (0,1), (" << opts.fast_rtol + << " input)\n"; + return -1; + } + // slow_pq in {0,1} + if ((opts.slow_pq < 0) || (opts.slow_pq > 1)) + { + std::cerr << "ERROR: slow_pq must be in {0,1}, (" << opts.slow_pq + << " input)\n"; + return -1; + } + // fast_pq in {0,1} + if ((opts.fast_pq < 0) || (opts.fast_pq > 1)) + { + std::cerr << "ERROR: fast_pq must be in {0,1}, (" << opts.fast_pq + << " input)\n"; + return -1; + } + // scontrol in [0,16] + if ((opts.scontrol < 0) || (opts.scontrol > 16)) + { + std::cerr << "ERROR: scontrol must be in [0,16], (" << opts.scontrol + << " input)\n"; + return -1; + } + // fcontrol in [0,6] + if ((opts.fcontrol < 0) || (opts.fcontrol > 6)) + { + std::cerr << "ERROR: fcontrol must be in [0,6], (" << opts.fcontrol + << " input)\n"; + return -1; + } + // hs > 0 if scontrol == 0 + if ((opts.hs <= 0) && (opts.scontrol == 0)) + { + std::cerr << "ERROR: positive hs required with scontrol = 0, (" << opts.hs + << " input)\n"; + return -1; + } + // hf > 0 if fcontrol == 0 + if ((opts.hf <= 0) && (opts.fcontrol == 0)) + { + std::cerr << "ERROR: positive hf required with fcontrol = 0, (" << opts.hf + << " input)\n"; + return -1; + } + // ep > 0.0 + if (opts.ep <= ZERO) + { + std::cerr << "ERROR: ep must be a positive real number, (" << opts.ep + << " input)\n"; + return -1; + } + + return 0; +} + +static void PrintSlowAdaptivity(Options opts) +{ + switch (opts.scontrol) + { + case (0): + std::cout << " fixed steps, hs = " << opts.hs << std::endl; + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + case (5): + std::cout + << " MRI-HTOL controller (using I for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (opts.k1s > -1) + { + std::cout << " slow controller parameter: " << opts.k1s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (6): + std::cout << " Decoupled I controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (opts.k1s > -1) + { + std::cout << " slow controller parameter: " << opts.k1s << "\n"; + } + break; + case (7): + std::cout + << " MRI-HTOL controller (using PI for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (8): + std::cout << " Decoupled PI controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (9): + std::cout + << " MRI-HTOL controller (using PID for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << " " << opts.k3s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (10): + std::cout << " Decoupled PID controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << " " << opts.k3s << "\n"; + } + break; + case (11): + std::cout + << " MRI-HTOL controller (using ExpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (12): + std::cout << " Decoupled ExpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (13): + std::cout + << " MRI-HTOL controller (using ImpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (14): + std::cout << " Decoupled ImpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (15): + std::cout + << " MRI-HTOL controller (using ImExGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + break; + case (16): + std::cout << " Decoupled ImExGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + } + if (opts.bias > -1) + { + std::cout << " controller bias factor: " << opts.bias << "\n"; + } + if (opts.slow_safety > -1) + { + std::cout << " slow step safety factor: " << opts.slow_safety << "\n"; + } +} + +static void PrintFastAdaptivity(Options opts) +{ + switch (opts.fcontrol) + { + case (0): + std::cout << " fixed steps, hf = " << opts.hf << std::endl; + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + case (1): + std::cout << " I controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (opts.k1f > -1) + { + std::cout << " fast controller parameter: " << opts.k1f << "\n"; + } + break; + case (2): + std::cout << " PI controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (3): + std::cout << " PID controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, std::min(opts.k2f, opts.k3f)) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << " " << opts.k3f << "\n"; + } + break; + case (4): + std::cout + << " ExpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (5): + std::cout + << " ImpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (6): + std::cout + << " ImExGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + } +} + +//---- end of file ----// diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt_--rtol_0.000004_--scontrol_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt_--rtol_0.000004_--scontrol_0.out new file mode 100644 index 0000000000..760c6d2b1d --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt_--rtol_0.000004_--scontrol_0.out @@ -0,0 +1,43 @@ + +Adaptive multirate stiff Brusselator test problem: + time domain: (0,10] + ep = 0.0004 + + Slow integrator: ARKODE_MRI_GARK_ERK45a (explicit) + fixed steps, hs = 0.01 + rtol = 4e-06, atol = 1e-11 + + Fast order 4 + I controller for fast time scale, based on order of RK embedding + fast_rtol = 0.0001, atol = 1e-11 + t u v w uerr verr werr + ------------------------------------------------------------------------- + 0.000000 1.200000 3.100000 3.000000 0.0e+00 0.0e+00 0.0e+00 + 0.500000 1.200613 2.996066 3.498311 1.2e-07 1.2e-07 8.6e-06 + 1.000000 1.107158 3.008131 3.498438 1.2e-07 1.2e-07 1.3e-05 + 1.500000 0.917798 3.188082 3.498698 1.0e-07 1.0e-07 1.7e-05 + 2.000000 0.691486 3.512327 3.499015 7.6e-08 7.6e-08 1.7e-05 + 2.500000 0.510160 3.896431 3.499274 5.5e-08 5.5e-08 1.2e-05 + 3.000000 0.410222 4.269502 3.499416 4.6e-08 4.6e-08 9.6e-06 + 3.500000 0.372044 4.614020 3.499469 3.0e-08 3.0e-08 9.8e-06 + 4.000000 0.367587 4.934562 3.499478 5.3e-08 5.3e-08 7.9e-06 + 4.500000 0.382205 5.233154 3.499474 3.2e-08 3.2e-08 9.1e-06 + 5.000000 0.412956 5.504352 3.499431 4.1e-08 4.1e-08 8.5e-06 + 5.500000 0.467990 5.730486 3.499356 5.5e-08 5.5e-08 1.1e-05 + 6.000000 0.585318 5.854262 3.499196 6.5e-08 6.6e-08 1.5e-05 + 6.500000 1.060808 5.503433 3.498555 5.4e-07 5.5e-07 3.8e-05 + 7.000000 4.794999 0.734608 3.493240 3.6e-06 3.6e-06 5.8e-05 + 7.500000 3.037708 1.057903 3.495704 2.0e-06 2.0e-06 4.7e-05 + 8.000000 1.833974 1.562357 3.497406 7.7e-07 7.8e-07 2.7e-05 + 8.500000 1.008519 2.191334 3.498570 2.5e-07 2.5e-07 1.8e-05 + 9.000000 0.534097 2.794912 3.499237 6.6e-08 6.7e-08 1.5e-05 + 9.500000 0.352784 3.263320 3.499486 4.3e-08 4.3e-08 2.0e-05 + 10.000000 0.305955 3.648439 3.499562 2.5e-08 2.5e-08 9.8e-06 + ------------------------------------------------------------------------- + +Final Solver Statistics: + Slow steps = 1000 (attempts = 1000, fails = 0) + Fast steps = 11777 (attempts = 16708, fails = 4931) + u error = 1.83324e-06, v error = 1.63119e-06, w error = 5.54867e-05, total error = 3.20666e-05 + Relative accuracy = 83.5081 + Total RHS evals: Fse = 5000, Fsi = 0, Ff = 79611 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 966d5425fb..4134c124bd 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 @@ -155,6 +155,10 @@ int main(int argc, char* argv[]) numfails += run_tests(MRISTEP_IMEX, prob_opts, prob_data, sunctx); + numfails += run_tests(MRISTEP_MERK, prob_opts, prob_data, sunctx); + + numfails += run_tests(MRISTEP_SR, prob_opts, prob_data, sunctx); + if (numfails) { std::cout << "\n\nFailed " << numfails << " tests!\n"; } else { std::cout << "\n\nAll tests passed!\n"; } @@ -185,7 +189,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, SUNMatrix A = nullptr; SUNLinearSolver LS = nullptr; - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { // Initialize dense matrix data structures and solvers A = SUNDenseMatrix(1, 1, sunctx); @@ -229,8 +233,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // Wrap ARKStep integrator as fast integrator object MRIStepInnerStepper inner_stepper = nullptr; - flag = ARKStepCreateMRIStepInnerStepper(arkstep_mem, &inner_stepper); - if (check_flag(&flag, "ARKStepCreateMRIStepInnerStepper", 1)) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(arkstep_mem, &inner_stepper); + if (check_flag(&flag, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } // ---------------------- // Create slow integrator @@ -239,7 +243,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, // Create slow integrator based on MRI type void* mristep_mem = nullptr; - if (type == MRISTEP_EXPLICIT) + if ((type == MRISTEP_EXPLICIT) || (type == MRISTEP_MERK)) { mristep_mem = MRIStepCreate(fe, nullptr, prob_opts.t0, y, inner_stepper, sunctx); @@ -249,7 +253,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, mristep_mem = MRIStepCreate(nullptr, fi, prob_opts.t0, y, inner_stepper, sunctx); } - else if (type == MRISTEP_IMEX) + else if ((type == MRISTEP_IMEX) || (type == MRISTEP_SR)) { mristep_mem = MRIStepCreate(fe, fi, prob_opts.t0, y, inner_stepper, sunctx); } @@ -268,7 +272,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, flag = ARKodeSetFixedStep(mristep_mem, prob_opts.hs); if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { // Attach linear solver flag = ARKodeSetLinearSolver(mristep_mem, LS, A); @@ -295,9 +299,9 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, if (check_flag(&flag, "ARKStepSetInterpolantType", 1)) { return 1; } } - // ------------------------------------ - // Evolve with various IMEX MRI methods - // ------------------------------------ + // ------------------------------- + // Evolve with various MRI methods + // ------------------------------- // Methods to test paired with whether they are stiffly accurate std::map<std::string, bool> methods; @@ -317,6 +321,17 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, {"ARKODE_MRI_GARK_RALSTON3", false}, {"ARKODE_MRI_GARK_ERK45a", false}}); } + else if (type == MRISTEP_MERK) + { + std::cout << "\n=================\n"; + std::cout << "Test MERK methods\n"; + std::cout << "=================\n"; + + methods.insert({{"ARKODE_MERK21", true}, + {"ARKODE_MERK32", true}, + {"ARKODE_MERK43", true}, + {"ARKODE_MERK54", true}}); + } else if (type == MRISTEP_IMPLICIT) { std::cout << "\n=========================\n"; @@ -342,10 +357,21 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, {"ARKODE_IMEX_MRI_GARK3b", false}, {"ARKODE_IMEX_MRI_GARK4", false}}); } + else if (type == MRISTEP_SR) + { + std::cout << "\n========================\n"; + std::cout << "Test IMEX MRI SR methods\n"; + std::cout << "========================\n"; + + methods.insert({{"ARKODE_IMEX_MRI_SR21", true}, + {"ARKODE_IMEX_MRI_SR32", true}, + {"ARKODE_IMEX_MRI_SR43", true}}); + } else { return 1; } for (const auto& pair : methods) { + int methodfails = 0; std::string id = pair.first; bool stiffly_accurate = pair.second; std::cout << "\nTesting method " << id << "\n"; @@ -408,7 +434,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, flag = ARKodeGetNumRhsEvals(mristep_mem, 1, &mri_nfsi); if (check_flag(&flag, "ARKodeGetNumRhsEvals", 1)) { return 1; } - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { flag = ARKodeGetNumNonlinSolvIters(mristep_mem, &mri_nni); if (check_flag(&flag, "ARKodeGetNumNonlinSolvIters", 1)) { return 1; } @@ -427,11 +453,8 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, } sunrealtype pow = prob_data.lambda_f; - if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) - { - pow += prob_data.lambda_e; - } - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type != MRISTEP_IMPLICIT) { pow += prob_data.lambda_e; } + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { pow += prob_data.lambda_i; } @@ -449,7 +472,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, std::cout << " Fe evals = " << mri_nfse << "\n"; std::cout << " Fi evals = " << mri_nfsi << "\n"; - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { std::cout << " NLS iters = " << mri_nni << "\n"; std::cout << " NLS fails = " << mri_ncfn << "\n"; @@ -467,31 +490,29 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, int nstages_evaluated = nstages_stored; if (stiffly_accurate) nstages_evaluated--; long int fe_evals = 0; - if (type == MRISTEP_EXPLICIT || type == MRISTEP_IMEX) - { - fe_evals = mri_nst * nstages_evaluated; - } + if (type != MRISTEP_IMPLICIT) { fe_evals = mri_nst * nstages_evaluated; } if (mri_nfse != fe_evals) { - numfails++; + methodfails++; std::cout << "Fe RHS evals: " << mri_nfse << " vs " << fe_evals << "\n"; } long int fi_evals = 0; - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { fi_evals = mri_nst * nstages_evaluated + mri_nni; } if (mri_nfsi != fi_evals) { - numfails++; + methodfails++; std::cout << "Fi RHS evals: " << mri_nfsi << " vs " << fi_evals << "\n"; } - if (numfails) { std::cout << "Failed " << numfails << " tests\n"; } + if (methodfails) { std::cout << "Failed " << methodfails << " tests\n"; } else { std::cout << "All checks passed\n"; } + numfails += methodfails; // ------------------- // Setup for next test @@ -508,7 +529,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, if (check_flag(&flag, "ARKStepReInit", 1)) { return 1; } // Re-initialize slow integrator based on MRI type - if (type == MRISTEP_EXPLICIT) + if ((type == MRISTEP_EXPLICIT) || (type == MRISTEP_MERK)) { flag = MRIStepReInit(mristep_mem, fe, nullptr, prob_opts.t0, y); } @@ -516,7 +537,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, { flag = MRIStepReInit(mristep_mem, nullptr, fi, prob_opts.t0, y); } - else if (type == MRISTEP_IMEX) + else if (type == MRISTEP_IMEX || type == MRISTEP_SR) { flag = MRIStepReInit(mristep_mem, fe, fi, prob_opts.t0, y); } @@ -528,7 +549,7 @@ int run_tests(MRISTEP_METHOD_TYPE type, ProblemOptions& prob_opts, MRIStepInnerStepper_Free(&inner_stepper); ARKodeFree(&mristep_mem); ARKodeFree(&arkstep_mem); - if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX) + if (type == MRISTEP_IMPLICIT || type == MRISTEP_IMEX || type == MRISTEP_SR) { SUNLinSolFree(LS); SUNMatDestroy(A); diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out index 9f09d86912..dedbba4239 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_-1.out @@ -14,6 +14,7 @@ Test explicit MRI methods ========================= Testing method ARKODE_MIS_KW3 + type = explicit MRI nmat = 1 stages = 4 method order (q) = 3 @@ -24,6 +25,7 @@ Testing method ARKODE_MIS_KW3 0.3333333333333333 0 0 0 -0.5208333333333333 0.9375 0 0 0.3541666666666666 -0.6375 0.5333333333333333 0 + 0 0 0 0 Stored stages = 3 @@ -40,15 +42,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22a + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.5 1 W[0] = 0 0 0 0.5 0 0 -0.5 1 0 + 0.5 0 0 Stored stages = 2 @@ -65,15 +69,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22b + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 1 1 W[0] = 0 0 0 1 0 0 -0.5 0.5 0 + 0 0 0 Stored stages = 2 @@ -90,22 +96,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK33a + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 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 + 0.08333333333333333 -0.3333333333333333 0.5833333333333334 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0 -0.5 0 + 0 0 0 0 Stored stages = 3 @@ -122,10 +131,11 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK45a + type = explicit MRI nmat = 2 stages = 6 method order (q) = 4 - embedding order (p) = 0 + embedding order (p) = 3 c = 0 0.2 0.4 0.6 0.8 1 W[0] = 0 0 0 0 0 0 @@ -134,6 +144,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + -1.858584369075205 2.224667606006969 -0.5244469581796045 -0.09396291472257937 0.45232663597042 0 W[1] = 0 0 0 0 0 0 @@ -142,6 +153,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + 3.304787234042553 -3.304787234042553 0 0 0 0 Stored stages = 5 @@ -158,6 +170,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_FORWARD_EULER + type = explicit MRI nmat = 1 stages = 2 method order (q) = 1 @@ -166,6 +179,7 @@ Testing method ARKODE_MRI_GARK_FORWARD_EULER W[0] = 0 0 1 0 + 0 0 Stored stages = 1 @@ -182,15 +196,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON2 + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.6666666666666666 1 W[0] = 0 0 0 0.6666666666666666 0 0 -0.4166666666666666 0.75 0 + 0.3333333333333334 0 0 Stored stages = 2 @@ -207,22 +223,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON3 + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 c = 0 0.5 0.75 1 W[0] = 0 0 0 0 0.5 0 0 0 -2.75 3 0 0 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + 0.025 0.175 0.05 0 W[1] = 0 0 0 0 0 0 0 0 4.5 -4.5 0 0 -2.166666666666667 -0.5 2.666666666666667 0 + 0 0 0 0 Stored stages = 3 @@ -243,6 +262,7 @@ Test implicit MRI methods ========================= Testing method ARKODE_MRI_GARK_BACKWARD_EULER + type = implicit MRI nmat = 1 stages = 3 method order (q) = 1 @@ -252,6 +272,7 @@ Testing method ARKODE_MRI_GARK_BACKWARD_EULER 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -273,19 +294,22 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK34a + type = implicit MRI 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 + embedding order (p) = 2 + c = 0 0.3333333333333333 0.3333333333333333 0.6666666666666666 0.6666666666666666 1 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 + 0 0 0 0 0 0 0 0 + 0.3333333333333333 0 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 0 + -0.3045790611944505 0 0.6379123945277838 0 0 0 0 0 + 0.2116913105640267 0 -0.6475578320724856 0 0.435866521508459 0 0 0 + 0.4454209388055495 0 0.8813784805616198 0 -0.993466086033836 0 0 0 + -0.435866521508459 0 0 0 0 0 0.435866521508459 0 + 0 0 0 0 0 0 0 0 + 0.2453831999117524 0 0.4204215033044045 0 -1.576992606344066 0 0.9111879031279093 0 Stored stages = 4 @@ -307,36 +331,41 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK46a + type = implicit MRI nmat = 2 - stages = 11 + stages = 12 method order (q) = 4 - embedding order (p) = 0 - c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 + embedding order (p) = 3 + c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 1 G[0] = - 0 0 0 0 0 0 0 0 0 0 0 - 0.2 0 0 0 0 0 0 0 0 0 0 - -0.25 0 0.25 0 0 0 0 0 0 0 0 - 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 - 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 - 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 - 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 - -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 - 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 - -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 - 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 0 + 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 0 + 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 0 + 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 0 + 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 0 + -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 0 + 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 0 + -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 0 + 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.6355065879145843 0 -0.2777146751476601 0 -0.4798955020445252 0 0.5009086778736938 0 -0.1288050885960927 0 G[1] = - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 - -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 - -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 - -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 - 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 - -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 - 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 - 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 0 + -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 0 + -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 0 + -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 0 + 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 0 + -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 0 + 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 0 + 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -358,6 +387,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + type = implicit MRI nmat = 1 stages = 4 method order (q) = 2 @@ -368,6 +398,7 @@ Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -389,15 +420,18 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IRK21a + type = implicit MRI nmat = 1 - stages = 3 + stages = 4 method order (q) = 2 - embedding order (p) = 0 - c = 0 1 1 + embedding order (p) = 1 + c = 0 1 1 1 G[0] = - 0 0 0 - 1 0 0 - -0.5 0 0.5 + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + -0.5 0 0.5 0 Stored stages = 2 @@ -423,6 +457,7 @@ Test IMEX MRI methods ===================== Testing method ARKODE_IMEX_MRI_GARK3a + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -437,6 +472,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a -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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -447,6 +483,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -468,6 +505,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK3b + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -482,6 +520,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -492,6 +531,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -513,6 +553,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK4 + type = ImEx MRI nmat = 2 stages = 12 method order (q) = 4 @@ -531,6 +572,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.424429547752048 0 2.430325019757162 0 1.905479301151525 0 -1.231139266635725 0 -0.5552355065209142 0 0 0 -0.01044135044479749 0 0.07260303614655074 0 -0.1288275951677261 0 0.1129355350093824 0 -0.04626962554340952 0 0 0 -0.8108522787762101 0 0.2560073199220492 0 0.8068294072697528 0 -0.4557148228721824 0 -0.04626962554340952 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -545,6 +587,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -1.110471013041828 0 0 0 0 0 0 0 1.110471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -559,6 +602,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 3.337028151688726 0 1.547057811385124 0 -4.12988801314935 0 0.9260375565964145 0 -1.555235506520914 0 0 0 -0.8212936292210076 0 0.3286103560686 0 0.6780018121020267 0 -0.3427792878628 0 -0.09253925108681904 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -573,6 +617,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.610471013041828 0 0 0 0 0 0 0 2.610471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -594,6 +639,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_EULER + type = ImEx MRI nmat = 1 stages = 3 method order (q) = 1 @@ -603,11 +649,13 @@ Testing method ARKODE_IMEX_MRI_GARK_EULER 0 0 0 1 0 0 0 0 0 + 0 0 0 G[0] = 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -629,6 +677,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -639,12 +688,14 @@ Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT 0.5 0 0 0 0 0 0 0 -0.5 0 1 0 + 0 0 0 0 G[0] = 0 0 0 0 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -666,6 +717,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -676,12 +728,14 @@ Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 1 0 0 0 0 0 0 0 -0.5 0 0.5 0 + 0 0 0 0 G[0] = 0 0 0 0 1 0 0 0 -0.5 0 0.5 0 0 0 0 0 + 0 0 0 0 Stored stages = 2 @@ -702,5 +756,391 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +================= +Test MERK methods +================= + +Testing method ARKODE_MERK21 + type = MERK + nmat = 2 + stages = 3 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.5 1 + W[0] = + 0 0 0 + 1 0 0 + 1 0 0 + 1 0 0 + + W[1] = + 0 0 0 + 0 0 0 + -2 2 0 + 0 0 0 + + ngroup = 2 + group[0] = 1 3 + group[1] = 2 + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.12939e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK32 + type = MERK + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + -2 2 0 0 + -1.5 0 1.5 0 + -2 2 0 0 + + ngroup = 3 + group[0] = 1 + group[1] = 2 4 + group[2] = 3 + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 4.5532e-10 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK43 + type = MERK + nmat = 3 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.5 0.5 0.3333333333333333 0.8333333333333334 0.3333333333333333 1 + W[0] = + 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 + -2 2 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.200000000000001 0 0 0 -0.7999999999999999 5.000000000000001 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 3.6 0 0 0 2.4 -6 0 + 5.999999999999998 0 12 -18 0 0 0 + + ngroup = 4 + group[0] = 1 + group[1] = 3 2 + group[2] = 5 4 7 + group[3] = 6 + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.19176e-12 + Steps = 1 + Fe evals = 6 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK54 + type = MERK + nmat = 4 + stages = 11 + method order (q) = 5 + embedding order (p) = 4 + c = 0 0.5 0.5 0.3333333333333333 0.5 0.3333333333333333 0.25 0.7 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -4.928571428571431 0 0 0 0 0 0 71.42857142857147 28.00000000000001 -94.50000000000004 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 7.999999999999943 0 0 0 0 0 0 -250.0000000000001 -82.00000000000004 324.0000000000002 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + + W[3] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -4.285714285714278 0 0 0 0 0 0 214.2857142857144 60.00000000000002 -270.0000000000001 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + + ngroup = 5 + group[0] = 1 + group[1] = 3 2 + group[2] = 6 5 4 + group[3] = 8 9 7 11 + group[4] = 10 + Stored stages = 11 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -3.58946e-12 + Steps = 1 + Fe evals = 10 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +======================== +Test IMEX MRI SR methods +======================== + +Testing method ARKODE_IMEX_MRI_SR21 + type = MRISR + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.6 0.2666666666666667 1 + W[0] = + 0 0 0 0 + 0.6 0 0 0 + 0.08484848484848485 0.1818181818181818 0 0 + -0.2407407407407407 0.5074074074074074 0.7333333333333333 0 + -0.25 0.5 0.75 0 + + G[0] = + 0 0 0 0 + -0.4782608695652174 0.4782608695652174 0 0 + -0.1277806419583357 -0.3504802276068817 0.4782608695652174 0 + 0.1281737365715925 -0.9496349237862043 0.3432003176493945 0.4782608695652174 + -2.583333333333333 -0.1666666666666667 2.75 0 + + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 6.56922e-07 + Steps = 1 + Fe evals = 3 + 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 ARKODE_IMEX_MRI_SR32 + type = MRISR + nmat = 2 + stages = 5 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.6764705882352942 0.8 1.133333333333333 1 + W[0] = + 0 0 0 0 0 + 0.6764705882352942 0 0 0 0 + 1.014285714285714 -0.2142857142857143 0 0 0 + 0.1073593073593074 0.5714285714285714 0.4545454545454545 0 0 + 0.8641357630008525 0.08623188405797101 0.34375 -0.2941176470588235 0 + 1.020324985968944 -1.483870967741935 1.970588235294118 -0.5070422535211268 0 + + W[1] = + 0 0 0 0 0 + 0 0 0 0 0 + -0.2264473168820995 0.2264473168820995 0 0 0 + -1.741503979463316 8.210746794478919 -6.469242815015602 0 0 + -1.295451217034184 2.560595940177763 -2.104988533033297 0.8398438098897179 0 + -1.638681583030989 6.083126027475434 -5.777777777777778 1.333333333333333 0 + + G[0] = + 0 0 0 0 0 + -0.5714285714285714 0.5714285714285714 0 0 0 + -0.8655695979919582 0.2941410265633868 0.5714285714285714 0 0 + 1.211752194844657 -2.237726220818683 0.4545454545454545 0.5714285714285714 0 + 0.02135581474837214 -0.07308298152405064 -0.2010145240388127 -0.3186868806140802 0.5714285714285714 + -0.04323671497584541 0.05514147688060732 0.07142857142857142 -0.08333333333333333 0 + + G[1] = + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + + Stored stages = 5 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -3.76499e-09 + Steps = 1 + Fe evals = 4 + Fi evals = 8 + NLS iters = 4 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_SR43 + type = MRISR + nmat = 2 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.25 0.75 0.55 0.5 1 1 + W[0] = + 0 0 0 0 0 0 0 + 0.25 0 0 0 0 0 0 + 1.125 -0.375 0 0 0 0 0 + 0.07991452991452991 0.7777777777777778 -0.3076923076923077 0 0 0 0 + 0.3878787878787879 0.1666666666666667 -0.6 0.5454545454545454 0 0 0 + 3.307624927156177 -0.2222222222222222 -0.3636363636363636 -0.1666666666666667 -1.555099674630925 0 0 + 0 0.6363636363636364 -8.344696969696969 13.66792929292929 -7.083333333333333 2.123737373737374 0 + 0.0025 4.083333333333333 7.166666666666667 -0.7 -7.083333333333333 -2.469166666666667 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2.75 2.75 0 0 0 0 0 + -0.4198290598290598 -0.4088888888888889 0.8287179487179487 0 0 0 0 + -0.9169340463458111 0.6549019607843137 1.463235294117647 -1.20120320855615 0 0 0 + -6.615249854312355 7.027777777777778 -0.5227272727272727 25.33333333333333 -25.22313398407148 0 0 + 0 0.8106060606060606 14.64772727272727 -11.71085858585859 0 -3.747474747474747 0 + -0.005 -5.708333333333333 -14.6875 15.4625 0 4.938333333333333 0 + + G[0] = + 0 0 0 0 0 0 0 + -0.25 0.25 0 0 0 0 0 + 0.25 -0.5 0.25 0 0 0 0 + 0.13 -0.2333333333333333 -0.1466666666666667 0.25 0 0 0 + 0.07058823529411765 -0.2213235294117647 -0.1819852941176471 0.08272058823529412 0.25 0 0 + 0 -2.25 -0.3958333333333333 -4.6875 7.083333333333333 0.25 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + G[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -6.94172e-11 + Steps = 1 + Fe evals = 6 + Fi evals = 11 + NLS iters = 5 + 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/CXX_serial/ark_test_dahlquist_mri_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out index 4591cb3cd3..b4d2dc4117 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_0.out @@ -14,6 +14,7 @@ Test explicit MRI methods ========================= Testing method ARKODE_MIS_KW3 + type = explicit MRI nmat = 1 stages = 4 method order (q) = 3 @@ -24,6 +25,7 @@ Testing method ARKODE_MIS_KW3 0.3333333333333333 0 0 0 -0.5208333333333333 0.9375 0 0 0.3541666666666666 -0.6375 0.5333333333333333 0 + 0 0 0 0 Stored stages = 3 @@ -40,15 +42,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22a + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.5 1 W[0] = 0 0 0 0.5 0 0 -0.5 1 0 + 0.5 0 0 Stored stages = 2 @@ -65,15 +69,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22b + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 1 1 W[0] = 0 0 0 1 0 0 -0.5 0.5 0 + 0 0 0 Stored stages = 2 @@ -90,22 +96,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK33a + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 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 + 0.08333333333333333 -0.3333333333333333 0.5833333333333334 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0 -0.5 0 + 0 0 0 0 Stored stages = 3 @@ -122,10 +131,11 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK45a + type = explicit MRI nmat = 2 stages = 6 method order (q) = 4 - embedding order (p) = 0 + embedding order (p) = 3 c = 0 0.2 0.4 0.6 0.8 1 W[0] = 0 0 0 0 0 0 @@ -134,6 +144,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + -1.858584369075205 2.224667606006969 -0.5244469581796045 -0.09396291472257937 0.45232663597042 0 W[1] = 0 0 0 0 0 0 @@ -142,6 +153,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + 3.304787234042553 -3.304787234042553 0 0 0 0 Stored stages = 5 @@ -158,6 +170,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_FORWARD_EULER + type = explicit MRI nmat = 1 stages = 2 method order (q) = 1 @@ -166,6 +179,7 @@ Testing method ARKODE_MRI_GARK_FORWARD_EULER W[0] = 0 0 1 0 + 0 0 Stored stages = 1 @@ -182,15 +196,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON2 + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.6666666666666666 1 W[0] = 0 0 0 0.6666666666666666 0 0 -0.4166666666666666 0.75 0 + 0.3333333333333334 0 0 Stored stages = 2 @@ -207,22 +223,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON3 + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 c = 0 0.5 0.75 1 W[0] = 0 0 0 0 0.5 0 0 0 -2.75 3 0 0 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + 0.025 0.175 0.05 0 W[1] = 0 0 0 0 0 0 0 0 4.5 -4.5 0 0 -2.166666666666667 -0.5 2.666666666666667 0 + 0 0 0 0 Stored stages = 3 @@ -243,6 +262,7 @@ Test implicit MRI methods ========================= Testing method ARKODE_MRI_GARK_BACKWARD_EULER + type = implicit MRI nmat = 1 stages = 3 method order (q) = 1 @@ -252,6 +272,7 @@ Testing method ARKODE_MRI_GARK_BACKWARD_EULER 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -273,19 +294,22 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK34a + type = implicit MRI 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 + embedding order (p) = 2 + c = 0 0.3333333333333333 0.3333333333333333 0.6666666666666666 0.6666666666666666 1 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 + 0 0 0 0 0 0 0 0 + 0.3333333333333333 0 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 0 + -0.3045790611944505 0 0.6379123945277838 0 0 0 0 0 + 0.2116913105640267 0 -0.6475578320724856 0 0.435866521508459 0 0 0 + 0.4454209388055495 0 0.8813784805616198 0 -0.993466086033836 0 0 0 + -0.435866521508459 0 0 0 0 0 0.435866521508459 0 + 0 0 0 0 0 0 0 0 + 0.2453831999117524 0 0.4204215033044045 0 -1.576992606344066 0 0.9111879031279093 0 Stored stages = 4 @@ -307,36 +331,41 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK46a + type = implicit MRI nmat = 2 - stages = 11 + stages = 12 method order (q) = 4 - embedding order (p) = 0 - c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 + embedding order (p) = 3 + c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 1 G[0] = - 0 0 0 0 0 0 0 0 0 0 0 - 0.2 0 0 0 0 0 0 0 0 0 0 - -0.25 0 0.25 0 0 0 0 0 0 0 0 - 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 - 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 - 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 - 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 - -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 - 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 - -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 - 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 0 + 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 0 + 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 0 + 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 0 + 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 0 + -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 0 + 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 0 + -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 0 + 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.6355065879145843 0 -0.2777146751476601 0 -0.4798955020445252 0 0.5009086778736938 0 -0.1288050885960927 0 G[1] = - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 - -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 - -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 - -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 - 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 - -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 - 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 - 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 0 + -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 0 + -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 0 + -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 0 + 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 0 + -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 0 + 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 0 + 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -358,6 +387,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + type = implicit MRI nmat = 1 stages = 4 method order (q) = 2 @@ -368,6 +398,7 @@ Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -389,15 +420,18 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IRK21a + type = implicit MRI nmat = 1 - stages = 3 + stages = 4 method order (q) = 2 - embedding order (p) = 0 - c = 0 1 1 + embedding order (p) = 1 + c = 0 1 1 1 G[0] = - 0 0 0 - 1 0 0 - -0.5 0 0.5 + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + -0.5 0 0.5 0 Stored stages = 2 @@ -423,6 +457,7 @@ Test IMEX MRI methods ===================== Testing method ARKODE_IMEX_MRI_GARK3a + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -437,6 +472,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a -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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -447,6 +483,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -468,6 +505,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK3b + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -482,6 +520,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -492,6 +531,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -513,6 +553,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK4 + type = ImEx MRI nmat = 2 stages = 12 method order (q) = 4 @@ -531,6 +572,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.424429547752048 0 2.430325019757162 0 1.905479301151525 0 -1.231139266635725 0 -0.5552355065209142 0 0 0 -0.01044135044479749 0 0.07260303614655074 0 -0.1288275951677261 0 0.1129355350093824 0 -0.04626962554340952 0 0 0 -0.8108522787762101 0 0.2560073199220492 0 0.8068294072697528 0 -0.4557148228721824 0 -0.04626962554340952 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -545,6 +587,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -1.110471013041828 0 0 0 0 0 0 0 1.110471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -559,6 +602,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 3.337028151688726 0 1.547057811385124 0 -4.12988801314935 0 0.9260375565964145 0 -1.555235506520914 0 0 0 -0.8212936292210076 0 0.3286103560686 0 0.6780018121020267 0 -0.3427792878628 0 -0.09253925108681904 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -573,6 +617,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.610471013041828 0 0 0 0 0 0 0 2.610471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -594,6 +639,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_EULER + type = ImEx MRI nmat = 1 stages = 3 method order (q) = 1 @@ -603,11 +649,13 @@ Testing method ARKODE_IMEX_MRI_GARK_EULER 0 0 0 1 0 0 0 0 0 + 0 0 0 G[0] = 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -629,6 +677,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -639,12 +688,14 @@ Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT 0.5 0 0 0 0 0 0 0 -0.5 0 1 0 + 0 0 0 0 G[0] = 0 0 0 0 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -666,6 +717,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -676,12 +728,14 @@ Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 1 0 0 0 0 0 0 0 -0.5 0 0.5 0 + 0 0 0 0 G[0] = 0 0 0 0 1 0 0 0 -0.5 0 0.5 0 0 0 0 0 + 0 0 0 0 Stored stages = 2 @@ -702,5 +756,391 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +================= +Test MERK methods +================= + +Testing method ARKODE_MERK21 + type = MERK + nmat = 2 + stages = 3 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.5 1 + W[0] = + 0 0 0 + 1 0 0 + 1 0 0 + 1 0 0 + + W[1] = + 0 0 0 + 0 0 0 + -2 2 0 + 0 0 0 + + ngroup = 2 + group[0] = 1 3 + group[1] = 2 + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.12939e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK32 + type = MERK + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + -2 2 0 0 + -1.5 0 1.5 0 + -2 2 0 0 + + ngroup = 3 + group[0] = 1 + group[1] = 2 4 + group[2] = 3 + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 4.5532e-10 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK43 + type = MERK + nmat = 3 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.5 0.5 0.3333333333333333 0.8333333333333334 0.3333333333333333 1 + W[0] = + 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 + -2 2 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.200000000000001 0 0 0 -0.7999999999999999 5.000000000000001 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 3.6 0 0 0 2.4 -6 0 + 5.999999999999998 0 12 -18 0 0 0 + + ngroup = 4 + group[0] = 1 + group[1] = 3 2 + group[2] = 5 4 7 + group[3] = 6 + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.19176e-12 + Steps = 1 + Fe evals = 6 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK54 + type = MERK + nmat = 4 + stages = 11 + method order (q) = 5 + embedding order (p) = 4 + c = 0 0.5 0.5 0.3333333333333333 0.5 0.3333333333333333 0.25 0.7 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -4.928571428571431 0 0 0 0 0 0 71.42857142857147 28.00000000000001 -94.50000000000004 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 7.999999999999943 0 0 0 0 0 0 -250.0000000000001 -82.00000000000004 324.0000000000002 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + + W[3] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -4.285714285714278 0 0 0 0 0 0 214.2857142857144 60.00000000000002 -270.0000000000001 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + + ngroup = 5 + group[0] = 1 + group[1] = 3 2 + group[2] = 6 5 4 + group[3] = 8 9 7 11 + group[4] = 10 + Stored stages = 11 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -3.58946e-12 + Steps = 1 + Fe evals = 10 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +======================== +Test IMEX MRI SR methods +======================== + +Testing method ARKODE_IMEX_MRI_SR21 + type = MRISR + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.6 0.2666666666666667 1 + W[0] = + 0 0 0 0 + 0.6 0 0 0 + 0.08484848484848485 0.1818181818181818 0 0 + -0.2407407407407407 0.5074074074074074 0.7333333333333333 0 + -0.25 0.5 0.75 0 + + G[0] = + 0 0 0 0 + -0.4782608695652174 0.4782608695652174 0 0 + -0.1277806419583357 -0.3504802276068817 0.4782608695652174 0 + 0.1281737365715925 -0.9496349237862043 0.3432003176493945 0.4782608695652174 + -2.583333333333333 -0.1666666666666667 2.75 0 + + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 6.56922e-07 + Steps = 1 + Fe evals = 3 + 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 ARKODE_IMEX_MRI_SR32 + type = MRISR + nmat = 2 + stages = 5 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.6764705882352942 0.8 1.133333333333333 1 + W[0] = + 0 0 0 0 0 + 0.6764705882352942 0 0 0 0 + 1.014285714285714 -0.2142857142857143 0 0 0 + 0.1073593073593074 0.5714285714285714 0.4545454545454545 0 0 + 0.8641357630008525 0.08623188405797101 0.34375 -0.2941176470588235 0 + 1.020324985968944 -1.483870967741935 1.970588235294118 -0.5070422535211268 0 + + W[1] = + 0 0 0 0 0 + 0 0 0 0 0 + -0.2264473168820995 0.2264473168820995 0 0 0 + -1.741503979463316 8.210746794478919 -6.469242815015602 0 0 + -1.295451217034184 2.560595940177763 -2.104988533033297 0.8398438098897179 0 + -1.638681583030989 6.083126027475434 -5.777777777777778 1.333333333333333 0 + + G[0] = + 0 0 0 0 0 + -0.5714285714285714 0.5714285714285714 0 0 0 + -0.8655695979919582 0.2941410265633868 0.5714285714285714 0 0 + 1.211752194844657 -2.237726220818683 0.4545454545454545 0.5714285714285714 0 + 0.02135581474837214 -0.07308298152405064 -0.2010145240388127 -0.3186868806140802 0.5714285714285714 + -0.04323671497584541 0.05514147688060732 0.07142857142857142 -0.08333333333333333 0 + + G[1] = + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + + Stored stages = 5 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -3.76499e-09 + Steps = 1 + Fe evals = 4 + Fi evals = 8 + NLS iters = 4 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_SR43 + type = MRISR + nmat = 2 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.25 0.75 0.55 0.5 1 1 + W[0] = + 0 0 0 0 0 0 0 + 0.25 0 0 0 0 0 0 + 1.125 -0.375 0 0 0 0 0 + 0.07991452991452991 0.7777777777777778 -0.3076923076923077 0 0 0 0 + 0.3878787878787879 0.1666666666666667 -0.6 0.5454545454545454 0 0 0 + 3.307624927156177 -0.2222222222222222 -0.3636363636363636 -0.1666666666666667 -1.555099674630925 0 0 + 0 0.6363636363636364 -8.344696969696969 13.66792929292929 -7.083333333333333 2.123737373737374 0 + 0.0025 4.083333333333333 7.166666666666667 -0.7 -7.083333333333333 -2.469166666666667 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2.75 2.75 0 0 0 0 0 + -0.4198290598290598 -0.4088888888888889 0.8287179487179487 0 0 0 0 + -0.9169340463458111 0.6549019607843137 1.463235294117647 -1.20120320855615 0 0 0 + -6.615249854312355 7.027777777777778 -0.5227272727272727 25.33333333333333 -25.22313398407148 0 0 + 0 0.8106060606060606 14.64772727272727 -11.71085858585859 0 -3.747474747474747 0 + -0.005 -5.708333333333333 -14.6875 15.4625 0 4.938333333333333 0 + + G[0] = + 0 0 0 0 0 0 0 + -0.25 0.25 0 0 0 0 0 + 0.25 -0.5 0.25 0 0 0 0 + 0.13 -0.2333333333333333 -0.1466666666666667 0.25 0 0 0 + 0.07058823529411765 -0.2213235294117647 -0.1819852941176471 0.08272058823529412 0.25 0 0 + 0 -2.25 -0.3958333333333333 -4.6875 7.083333333333333 0.25 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + G[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -6.94172e-11 + Steps = 1 + Fe evals = 6 + Fi evals = 11 + NLS iters = 5 + 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/CXX_serial/ark_test_dahlquist_mri_1.out b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out index 5311a51fcd..9f48d829f2 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out +++ b/test/unit_tests/arkode/CXX_serial/ark_test_dahlquist_mri_1.out @@ -14,6 +14,7 @@ Test explicit MRI methods ========================= Testing method ARKODE_MIS_KW3 + type = explicit MRI nmat = 1 stages = 4 method order (q) = 3 @@ -24,6 +25,7 @@ Testing method ARKODE_MIS_KW3 0.3333333333333333 0 0 0 -0.5208333333333333 0.9375 0 0 0.3541666666666666 -0.6375 0.5333333333333333 0 + 0 0 0 0 Stored stages = 3 @@ -40,15 +42,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22a + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.5 1 W[0] = 0 0 0 0.5 0 0 -0.5 1 0 + 0.5 0 0 Stored stages = 2 @@ -65,15 +69,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK22b + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 1 1 W[0] = 0 0 0 1 0 0 -0.5 0.5 0 + 0 0 0 Stored stages = 2 @@ -90,22 +96,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK33a + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 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 + 0.08333333333333333 -0.3333333333333333 0.5833333333333334 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0 -0.5 0 + 0 0 0 0 Stored stages = 3 @@ -122,10 +131,11 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ERK45a + type = explicit MRI nmat = 2 stages = 6 method order (q) = 4 - embedding order (p) = 0 + embedding order (p) = 3 c = 0 0.2 0.4 0.6 0.8 1 W[0] = 0 0 0 0 0 0 @@ -134,6 +144,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + -1.858584369075205 2.224667606006969 -0.5244469581796045 -0.09396291472257937 0.45232663597042 0 W[1] = 0 0 0 0 0 0 @@ -142,6 +153,7 @@ Testing method ARKODE_MRI_GARK_ERK45a -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 + 3.304787234042553 -3.304787234042553 0 0 0 0 Stored stages = 5 @@ -158,6 +170,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_FORWARD_EULER + type = explicit MRI nmat = 1 stages = 2 method order (q) = 1 @@ -166,6 +179,7 @@ Testing method ARKODE_MRI_GARK_FORWARD_EULER W[0] = 0 0 1 0 + 0 0 Stored stages = 1 @@ -182,15 +196,17 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON2 + type = explicit MRI nmat = 1 stages = 3 method order (q) = 2 - embedding order (p) = 0 + embedding order (p) = 1 c = 0 0.6666666666666666 1 W[0] = 0 0 0 0.6666666666666666 0 0 -0.4166666666666666 0.75 0 + 0.3333333333333334 0 0 Stored stages = 2 @@ -207,22 +223,25 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_RALSTON3 + type = explicit MRI nmat = 2 stages = 4 method order (q) = 3 - embedding order (p) = 0 + embedding order (p) = 2 c = 0 0.5 0.75 1 W[0] = 0 0 0 0 0.5 0 0 0 -2.75 3 0 0 1.305555555555556 -0.1666666666666667 -0.8888888888888888 0 + 0.025 0.175 0.05 0 W[1] = 0 0 0 0 0 0 0 0 4.5 -4.5 0 0 -2.166666666666667 -0.5 2.666666666666667 0 + 0 0 0 0 Stored stages = 3 @@ -243,6 +262,7 @@ Test implicit MRI methods ========================= Testing method ARKODE_MRI_GARK_BACKWARD_EULER + type = implicit MRI nmat = 1 stages = 3 method order (q) = 1 @@ -252,6 +272,7 @@ Testing method ARKODE_MRI_GARK_BACKWARD_EULER 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -273,19 +294,22 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK34a + type = implicit MRI 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 + embedding order (p) = 2 + c = 0 0.3333333333333333 0.3333333333333333 0.6666666666666666 0.6666666666666666 1 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 + 0 0 0 0 0 0 0 0 + 0.3333333333333333 0 0 0 0 0 0 0 + -0.435866521508459 0 0.435866521508459 0 0 0 0 0 + -0.3045790611944505 0 0.6379123945277838 0 0 0 0 0 + 0.2116913105640267 0 -0.6475578320724856 0 0.435866521508459 0 0 0 + 0.4454209388055495 0 0.8813784805616198 0 -0.993466086033836 0 0 0 + -0.435866521508459 0 0 0 0 0 0.435866521508459 0 + 0 0 0 0 0 0 0 0 + 0.2453831999117524 0 0.4204215033044045 0 -1.576992606344066 0 0.9111879031279093 0 Stored stages = 4 @@ -307,36 +331,41 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_ESDIRK46a + type = implicit MRI nmat = 2 - stages = 11 + stages = 12 method order (q) = 4 - embedding order (p) = 0 - c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 + embedding order (p) = 3 + c = 0 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 1 1 1 G[0] = - 0 0 0 0 0 0 0 0 0 0 0 - 0.2 0 0 0 0 0 0 0 0 0 0 - -0.25 0 0.25 0 0 0 0 0 0 0 0 - 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 - 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 - 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 - 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 - -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 - 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 - -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 - 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.25 0 0 0 0 0 0 0 0 0 + 0.9179311933794375 0 -0.7179311933794374 0 0 0 0 0 0 0 0 0 + 2.643172353961828 0 -2.893172353961828 0 0.25 0 0 0 0 0 0 0 + 0.501564151341775 0 0.06834736723773695 0 -0.369911518579512 0 0 0 0 0 0 0 + 4.342116951031425 0 0.03897604588394062 0 -4.631092996915365 0 0.25 0 0 0 0 0 + -1.690014953911908 0 0.7232372452056922 0 1.84784916447243 0 -0.681071455766214 0 0 0 0 0 + 3.315267994849762 0 1.086235127654301 0 -1.202424037428737 0 -3.449079085075326 0 0.25 0 0 0 + -1.563558636602688 0 1.020883954835773 0 2.489384426659126 0 -0.1865282766779755 0 -1.560181468214235 0 0 0 + 0.19 0 -0.2433333333333333 0 0.4233333333333333 0 0.4233333333333333 0 -1.043333333333333 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -0.25 0 0.6355065879145843 0 -0.2777146751476601 0 -0.4798955020445252 0 0.5009086778736938 0 -0.1288050885960927 0 G[1] = - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 - -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 - -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 - -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 - -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 - 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 - -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 - 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 - 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + -1.735862386758875 0 1.735862386758875 0 0 0 0 0 0 0 0 0 + -5.82844997108155 0 5.82844997108155 0 0 0 0 0 0 0 0 0 + -0.4610230395256553 0 -0.9787999976333687 0 1.439823037159024 0 0 0 0 0 0 0 + -7.403989721900906 0 0.06115468960863698 0 7.342835032292269 0 0 0 0 0 0 0 + 2.099785727661873 0 -1.585581271787903 0 -2.976347367406398 0 2.462142911532428 0 0 0 0 0 + -5.523652150637583 0 -1.829811152193671 0 1.834216697306453 0 5.519246605524801 0 0 0 0 0 + 2.020233434143436 0 -2.384427012786476 0 -4.40813747576723 0 0.1519681179818014 0 4.62036293642847 0 0 0 + 0.12 0 -0.09666666666666666 0 0.2366666666666667 0 0.2366666666666667 0 -0.4966666666666666 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -358,6 +387,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT + type = implicit MRI nmat = 1 stages = 4 method order (q) = 2 @@ -368,6 +398,7 @@ Testing method ARKODE_MRI_GARK_IMPLICIT_MIDPOINT 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -389,15 +420,18 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_MRI_GARK_IRK21a + type = implicit MRI nmat = 1 - stages = 3 + stages = 4 method order (q) = 2 - embedding order (p) = 0 - c = 0 1 1 + embedding order (p) = 1 + c = 0 1 1 1 G[0] = - 0 0 0 - 1 0 0 - -0.5 0 0.5 + 0 0 0 0 + 1 0 0 0 + -0.5 0 0.5 0 + 0 0 0 0 + -0.5 0 0.5 0 Stored stages = 2 @@ -423,6 +457,7 @@ Test IMEX MRI methods ===================== Testing method ARKODE_IMEX_MRI_GARK3a + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -437,6 +472,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a -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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -447,6 +483,7 @@ Testing method ARKODE_IMEX_MRI_GARK3a 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -468,6 +505,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK3b + type = ImEx MRI nmat = 1 stages = 8 method order (q) = 3 @@ -482,6 +520,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 @@ -492,6 +531,7 @@ Testing method ARKODE_IMEX_MRI_GARK3b 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 + 0 0 0 0 0 0 0 0 Stored stages = 4 @@ -513,6 +553,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK4 + type = ImEx MRI nmat = 2 stages = 12 method order (q) = 4 @@ -531,6 +572,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.424429547752048 0 2.430325019757162 0 1.905479301151525 0 -1.231139266635725 0 -0.5552355065209142 0 0 0 -0.01044135044479749 0 0.07260303614655074 0 -0.1288275951677261 0 0.1129355350093824 0 -0.04626962554340952 0 0 0 -0.8108522787762101 0 0.2560073199220492 0 0.8068294072697528 0 -0.4557148228721824 0 -0.04626962554340952 0 0.25 0 + 0 0 0 0 0 0 0 0 0 0 0 0 W[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -545,6 +587,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -1.110471013041828 0 0 0 0 0 0 0 1.110471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[0] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -559,6 +602,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 3.337028151688726 0 1.547057811385124 0 -4.12988801314935 0 0.9260375565964145 0 -1.555235506520914 0 0 0 -0.8212936292210076 0 0.3286103560686 0 0.6780018121020267 0 -0.3427792878628 0 -0.09253925108681904 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 G[1] = 0 0 0 0 0 0 0 0 0 0 0 0 @@ -573,6 +617,7 @@ Testing method ARKODE_IMEX_MRI_GARK4 -2.610471013041828 0 0 0 0 0 0 0 2.610471013041828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 Stored stages = 6 @@ -594,6 +639,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_EULER + type = ImEx MRI nmat = 1 stages = 3 method order (q) = 1 @@ -603,11 +649,13 @@ Testing method ARKODE_IMEX_MRI_GARK_EULER 0 0 0 1 0 0 0 0 0 + 0 0 0 G[0] = 0 0 0 1 0 0 -1 0 1 + 0 0 0 Stored stages = 2 @@ -629,6 +677,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -639,12 +688,14 @@ Testing method ARKODE_IMEX_MRI_GARK_MIDPOINT 0.5 0 0 0 0 0 0 0 -0.5 0 1 0 + 0 0 0 0 G[0] = 0 0 0 0 0.5 0 0 0 -0.5 0 0.5 0 0 0 0.5 0 + 0 0 0 0 Stored stages = 2 @@ -666,6 +717,7 @@ Comparing Solver Statistics: All checks passed Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL + type = ImEx MRI nmat = 1 stages = 4 method order (q) = 2 @@ -676,12 +728,14 @@ Testing method ARKODE_IMEX_MRI_GARK_TRAPEZOIDAL 1 0 0 0 0 0 0 0 -0.5 0 0.5 0 + 0 0 0 0 G[0] = 0 0 0 0 1 0 0 0 -0.5 0 0.5 0 0 0 0 0 + 0 0 0 0 Stored stages = 2 @@ -702,5 +756,391 @@ MRIStep Statistics: Comparing Solver Statistics: All checks passed +================= +Test MERK methods +================= + +Testing method ARKODE_MERK21 + type = MERK + nmat = 2 + stages = 3 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.5 1 + W[0] = + 0 0 0 + 1 0 0 + 1 0 0 + 1 0 0 + + W[1] = + 0 0 0 + 0 0 0 + -2 2 0 + 0 0 0 + + ngroup = 2 + group[0] = 1 3 + group[1] = 2 + Stored stages = 3 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.12939e-07 + Steps = 1 + Fe evals = 2 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK32 + type = MERK + nmat = 2 + stages = 4 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + 1 0 0 0 + + W[1] = + 0 0 0 0 + 0 0 0 0 + -2 2 0 0 + -1.5 0 1.5 0 + -2 2 0 0 + + ngroup = 3 + group[0] = 1 + group[1] = 2 4 + group[2] = 3 + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = 4.5532e-10 + Steps = 1 + Fe evals = 3 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK43 + type = MERK + nmat = 3 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.5 0.5 0.3333333333333333 0.8333333333333334 0.3333333333333333 1 + W[0] = + 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + 1 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 + -2 2 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + -4.200000000000001 0 0 0 -0.7999999999999999 5.000000000000001 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 + 3.6 0 0 0 2.4 -6 0 + 5.999999999999998 0 12 -18 0 0 0 + + ngroup = 4 + group[0] = 1 + group[1] = 3 2 + group[2] = 5 4 7 + group[3] = 6 + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -4.19176e-12 + Steps = 1 + Fe evals = 6 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_MERK54 + type = MERK + nmat = 4 + stages = 11 + method order (q) = 5 + embedding order (p) = 4 + c = 0 0.5 0.5 0.3333333333333333 0.5 0.3333333333333333 0.25 0.7 0.5 0.6666666666666666 1 + W[0] = + 0 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + 1 0 0 0 0 0 0 0 0 0 0 + + W[1] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -2 2 0 0 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -4.999999999999998 0 -4 8.999999999999998 0 0 0 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + -4.928571428571431 0 0 0 0 0 0 71.42857142857147 28.00000000000001 -94.50000000000004 0 + -9.000000000000007 0 0 0 4 -27 32.00000000000001 0 0 0 0 + + W[2] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 5.999999999999998 0 12 -18 0 0 0 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + 7.999999999999943 0 0 0 0 0 0 -250.0000000000001 -82.00000000000004 324.0000000000002 0 + 26 0 0 0 -27.99999999999999 162 -160 0 0 0 0 + + W[3] = + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + -4.285714285714278 0 0 0 0 0 0 214.2857142857144 60.00000000000002 -270.0000000000001 0 + -24.00000000000006 0 0 0 47.99999999999999 -216 192.0000000000001 0 0 0 0 + + ngroup = 5 + group[0] = 1 + group[1] = 3 2 + group[2] = 6 5 4 + group[3] = 8 9 7 11 + group[4] = 10 + Stored stages = 11 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.980199 + y_n = 0.980199 + Error = -3.58946e-12 + Steps = 1 + Fe evals = 10 + Fi evals = 0 + +Comparing Solver Statistics: +All checks passed + +======================== +Test IMEX MRI SR methods +======================== + +Testing method ARKODE_IMEX_MRI_SR21 + type = MRISR + nmat = 1 + stages = 4 + method order (q) = 2 + embedding order (p) = 1 + c = 0 0.6 0.2666666666666667 1 + W[0] = + 0 0 0 0 + 0.6 0 0 0 + 0.08484848484848485 0.1818181818181818 0 0 + -0.2407407407407407 0.5074074074074074 0.7333333333333333 0 + -0.25 0.5 0.75 0 + + G[0] = + 0 0 0 0 + -0.4782608695652174 0.4782608695652174 0 0 + -0.1277806419583357 -0.3504802276068817 0.4782608695652174 0 + 0.1281737365715925 -0.9496349237862043 0.3432003176493945 0.4782608695652174 + -2.583333333333333 -0.1666666666666667 2.75 0 + + Stored stages = 4 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970445 + Error = 6.56922e-07 + Steps = 1 + Fe evals = 3 + 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 ARKODE_IMEX_MRI_SR32 + type = MRISR + nmat = 2 + stages = 5 + method order (q) = 3 + embedding order (p) = 2 + c = 0 0.6764705882352942 0.8 1.133333333333333 1 + W[0] = + 0 0 0 0 0 + 0.6764705882352942 0 0 0 0 + 1.014285714285714 -0.2142857142857143 0 0 0 + 0.1073593073593074 0.5714285714285714 0.4545454545454545 0 0 + 0.8641357630008525 0.08623188405797101 0.34375 -0.2941176470588235 0 + 1.020324985968944 -1.483870967741935 1.970588235294118 -0.5070422535211268 0 + + W[1] = + 0 0 0 0 0 + 0 0 0 0 0 + -0.2264473168820995 0.2264473168820995 0 0 0 + -1.741503979463316 8.210746794478919 -6.469242815015602 0 0 + -1.295451217034184 2.560595940177763 -2.104988533033297 0.8398438098897179 0 + -1.638681583030989 6.083126027475434 -5.777777777777778 1.333333333333333 0 + + G[0] = + 0 0 0 0 0 + -0.5714285714285714 0.5714285714285714 0 0 0 + -0.8655695979919582 0.2941410265633868 0.5714285714285714 0 0 + 1.211752194844657 -2.237726220818683 0.4545454545454545 0.5714285714285714 0 + 0.02135581474837214 -0.07308298152405064 -0.2010145240388127 -0.3186868806140802 0.5714285714285714 + -0.04323671497584541 0.05514147688060732 0.07142857142857142 -0.08333333333333333 0 + + G[1] = + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + 0 0 0 0 0 + + Stored stages = 5 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -3.76499e-09 + Steps = 1 + Fe evals = 4 + Fi evals = 8 + NLS iters = 4 + NLS fails = 0 + LS setups = 1 + LS Fi evals = 0 + Ji evals = 1 + +Comparing Solver Statistics: +All checks passed + +Testing method ARKODE_IMEX_MRI_SR43 + type = MRISR + nmat = 2 + stages = 7 + method order (q) = 4 + embedding order (p) = 3 + c = 0 0.25 0.75 0.55 0.5 1 1 + W[0] = + 0 0 0 0 0 0 0 + 0.25 0 0 0 0 0 0 + 1.125 -0.375 0 0 0 0 0 + 0.07991452991452991 0.7777777777777778 -0.3076923076923077 0 0 0 0 + 0.3878787878787879 0.1666666666666667 -0.6 0.5454545454545454 0 0 0 + 3.307624927156177 -0.2222222222222222 -0.3636363636363636 -0.1666666666666667 -1.555099674630925 0 0 + 0 0.6363636363636364 -8.344696969696969 13.66792929292929 -7.083333333333333 2.123737373737374 0 + 0.0025 4.083333333333333 7.166666666666667 -0.7 -7.083333333333333 -2.469166666666667 0 + + W[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + -2.75 2.75 0 0 0 0 0 + -0.4198290598290598 -0.4088888888888889 0.8287179487179487 0 0 0 0 + -0.9169340463458111 0.6549019607843137 1.463235294117647 -1.20120320855615 0 0 0 + -6.615249854312355 7.027777777777778 -0.5227272727272727 25.33333333333333 -25.22313398407148 0 0 + 0 0.8106060606060606 14.64772727272727 -11.71085858585859 0 -3.747474747474747 0 + -0.005 -5.708333333333333 -14.6875 15.4625 0 4.938333333333333 0 + + G[0] = + 0 0 0 0 0 0 0 + -0.25 0.25 0 0 0 0 0 + 0.25 -0.5 0.25 0 0 0 0 + 0.13 -0.2333333333333333 -0.1466666666666667 0.25 0 0 0 + 0.07058823529411765 -0.2213235294117647 -0.1819852941176471 0.08272058823529412 0.25 0 0 + 0 -2.25 -0.3958333333333333 -4.6875 7.083333333333333 0.25 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + G[1] = + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + + Stored stages = 7 + +MRIStep Statistics: + Time = 0.01 + y(t) = 0.970446 + y_n = 0.970446 + Error = -6.94172e-11 + Steps = 1 + Fe evals = 6 + Fi evals = 11 + NLS iters = 5 + 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/CXX_serial/ark_test_getjac_mri.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp index 4737434ff6..3f3da4398a 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_getjac_mri.cpp @@ -226,8 +226,8 @@ int main(int argc, char* argv[]) // Create inner stepper MRIStepInnerStepper inner_stepper; - flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); - if (check_flag(flag, "ARKStepCreateMRIStepInnerStepper")) { return 1; } + flag = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_flag(flag, "ARKodeCreateMRIStepInnerStepper")) { return 1; } // Create MRIStep memory structure void* arkode_mem = MRIStepCreate(nullptr, f, ZERO, y, inner_stepper, sunctx); diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp new file mode 100644 index 0000000000..67d7d0e162 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp @@ -0,0 +1,1442 @@ +/* ---------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ---------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ---------------------------------------------------------------- + * Multirate nonlinear Kvaerno-Prothero-Robinson ODE test problem: + * + * [u]' = [ G e ] [(u^2-r-1)/(2u)] + [ r'(t)/(2u) ] + * [v] [ e -1 ] [(v^2-s-2)/(2v)] [ s'(t)/(2v) ] + * = [ fs(t,u,v) ] + * [ ff(t,u,v) ] + * + * where r(t) = cos(t), and s(t) = cos(w*t*(1+exp(-(t-2)^2))). + * + * This problem has analytical solution given by + * u(t) = sqrt(2+r(t)), v(t) = sqrt(2+s(t)). + * However, we use a reference solver here to assess performance + * of the local multirate adaptivity controller. + * + * This program allows a number of parameters: + * e: fast/slow coupling strength [default = 0.5] + * G: stiffness at slow time scale [default = -1e2] + * w: time-scale separation factor [default = 100] + * + * The stiffness of the slow time scale is essentially determined + * by G, for |G| > 50 it is 'stiff' and ideally suited to a + * multirate method that is implicit at the slow time scale. + * + * Coupling between the two components is determined by e, with + * coupling strength proportional to |e|. + * + * The "fast" variable, v, oscillates at a frequency "w" times + * faster than u. + * + * Additional input options may be used to select between various + * solver options: + * - slow fixed/initial step size: hs [default = 0.01] + * - fast fixed/initial step size: hf [default = 0.0001] + * - set initial adaptive step size as hs/hf above: set_h0 [default 0] + * - relative solution tolerance: rtol [default = 1e-4] + * - absolute solution tolerance: atol [default = 1e-11] + * - relative solution tolerance for fast integrator: fast_rtol [default = 1e-4] + * - use p (0) vs q (1) for slow adaptivity: slow_pq [default = 0] + * - use p (0) vs q (1) for fast adaptivity: fast_pq [default = 0] + * - slow stepsize safety factor: safety [default = 0.96] + * - "slow" MRI method: mri_method [default = ARKODE_MRI_GARK_ERK45a] + * - "fast" ERKStep method order: fast_order [default 4] + * To put all physics at the slow scale, use "0", otherwise + * specify a valid explicit method order. + * - "slow" MRI temporal adaptivity controller: scontrol [default = 6] + * 0: no controller [fixed time steps] + * 5: I controller (as part of MRI-HTOL) + * 6: I controller (alone) + * 7: PI controller (as part of MRI-HTOL) + * 8: PI controller (alone) + * 9: PID controller (as part of MRI-HTOL) + * 10: PID controller (alone) + * 11: ExpGus controller (as part of MRI-HTOL) + * 12: ExpGus controller (alone) + * 13: ImpGus controller (as part of MRI-HTOL) + * 14: ImpGus controller (alone) + * 15: ImExGus controller (as part of MRI-HTOL) + * 16: ImExGus controller (alone) + * - "fast" ERKStep temporal adaptivity controller: fcontrol [default = 1] + * Note that this will only be used for 5 <= scontrol <= 16. + * 0: no controller [fixed time steps] + * 1: I controller + * 2: PI controller + * 3: PID controller + * 4: ExpGus controller + * 5: ImpGus controller + * 6: ImExGus controller + * - "fast" ERKStep accumulated error type: faccum [default = 0] + * Note that this will only be used for multirate scontrol options + * -1: no accumulation + * 0: maximum accumulation + * 1: additive accumulation + * 2: average accumulation + * - controller parameters: (k1s, k2s, k3s, k1f, k2f, k3f, + * bias, htol_relch, htol_minfac, htol_maxfac) + * slow single-rate controllers: use k1s through k3s, as appropriate. + * fast single-rate controllers: use k1f through k3f, as appropriate. + * MRIHTol controllers: use htol_relch, htol_minfac, htol_maxfac. + * all controllers (fast and slow) use bias. + * ** if any one of a relevant set are "-1" then the defaults are used + * + * Outputs and solution error values are printed at equal intervals + * of 0.5 and run statistics are printed at the end. + * ----------------------------------------------------------------*/ + +// Header files +#include <arkode/arkode_erkstep.h> // prototypes for ERKStep fcts., consts +#include <arkode/arkode_mristep.h> // prototypes for MRIStep fcts., consts +#include <cmath> +#include <cstdio> +#include <fstream> +#include <iomanip> +#include <iostream> +#include <nvector/nvector_serial.h> // serial N_Vector type, fcts., macros +#include <sunadaptcontroller/sunadaptcontroller_imexgus.h> +#include <sunadaptcontroller/sunadaptcontroller_mrihtol.h> +#include <sunadaptcontroller/sunadaptcontroller_soderlind.h> +#include <sundials/sundials_core.hpp> +#include <sundials/sundials_logger.h> +#include <sunlinsol/sunlinsol_dense.h> // dense linear solver +#include <sunmatrix/sunmatrix_dense.h> // dense matrix type, fcts., macros +#include "../../utilities/test_utilities.hpp" // common utility functions + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define ESYM "Le" +#define FSYM "Lf" +#else +#define ESYM "e" +#define FSYM "f" +#endif + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +// Problem options +struct Options +{ + // Problem parameters + sunrealtype e = SUN_RCONST(0.5); + sunrealtype G = SUN_RCONST(-100.0); + sunrealtype w = SUN_RCONST(100.0); + + // Step sizes and tolerances + int set_h0 = 0; + sunrealtype hs = SUN_RCONST(1.0e-2); + sunrealtype hf = SUN_RCONST(1.0e-4); + sunrealtype rtol = SUN_RCONST(1.0e-4); + sunrealtype atol = SUN_RCONST(1.0e-11); + sunrealtype fast_rtol = SUN_RCONST(1.0e-4); + + // Method selection + std::string mri_method = "ARKODE_MRI_GARK_ERK45a"; + int fast_order = 4; + int scontrol = 6; + int fcontrol = 1; + int faccum = 0; + int slow_pq = 0; + int fast_pq = 0; + + // controller parameters + sunrealtype k1s = SUN_RCONST(-1.0); + sunrealtype k2s = SUN_RCONST(-1.0); + sunrealtype k3s = SUN_RCONST(-1.0); + sunrealtype k1f = SUN_RCONST(-1.0); + sunrealtype k2f = SUN_RCONST(-1.0); + sunrealtype k3f = SUN_RCONST(-1.0); + sunrealtype bias = SUN_RCONST(-1.0); + sunrealtype htol_relch = SUN_RCONST(-1.0); + sunrealtype htol_minfac = SUN_RCONST(-1.0); + sunrealtype htol_maxfac = SUN_RCONST(-1.0); + sunrealtype slow_safety = SUN_RCONST(-1.0); +}; + +// User-supplied functions called by the solver +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Utility functions +static void InputHelp(); +static int ReadInputs(std::vector<std::string>& args, Options& opts, + SUNContext ctx); +static void PrintSlowAdaptivity(Options opts); +static void PrintFastAdaptivity(Options opts); +static sunrealtype r(sunrealtype t, Options* opts); +static sunrealtype s(sunrealtype t, Options* opts); +static sunrealtype rdot(sunrealtype t, Options* opts); +static sunrealtype sdot(sunrealtype t, Options* opts); +static sunrealtype utrue(sunrealtype t, Options* opts); +static sunrealtype vtrue(sunrealtype t, Options* opts); +static int Ytrue(sunrealtype t, N_Vector y, Options* opts); + +// Main Program +int main(int argc, char* argv[]) +{ + // SUNDIALS context objects + sundials::Context sunctx; // main solver + sundials::Context refctx; // reference solver + + // Read input options + Options opts; + std::vector<std::string> args(argv + 1, argv + argc); + int flag = ReadInputs(args, opts, sunctx); + if (check_flag(flag, "ReadInputs")) return 1; + + // General problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(5.0); // final time + sunindextype NEQ = 2; // number of dependent vars. + int Nt = 20; // number of output times + + // Initial problem output + // While traversing these, set various function pointers, table constants, and method orders. + ARKRhsFn f_f, f_se, f_si; + ARKLsJacFn J_s; + int retval; + sunbooleantype slowimplicit, slowimex; + slowimplicit = slowimex = SUNFALSE; + f_si = NULL; + J_s = NULL; + f_f = (opts.fast_order == 0) ? f0 : ff; + f_se = (opts.fast_order == 0) ? fn : fs; + if ((opts.mri_method == "ARKODE_MRI_GARK_IRK21a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK34a") || + (opts.mri_method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + slowimplicit = SUNTRUE; + f_se = NULL; + f_si = (opts.fast_order == 0) ? fn : fs; + J_s = (opts.fast_order == 0) ? Jn : Js; + } + if ((opts.mri_method == "ARKODE_IMEX_MRI_SR21") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR32") || + (opts.mri_method == "ARKODE_IMEX_MRI_SR43")) + { + slowimex = SUNTRUE; + slowimplicit = SUNTRUE; + f_se = (opts.fast_order == 0) ? f0 : fse; + f_si = (opts.fast_order == 0) ? fn : fsi; + J_s = (opts.fast_order == 0) ? Jn : Jsi; + } + std::cout << "\nAdaptive multirate nonlinear Kvaerno-Prothero-Robinson test " + "problem:\n"; + std::cout << " time domain: (" << T0 << "," << Tf << "]\n"; + std::cout << " G = " << opts.G << std::endl; + std::cout << " w = " << opts.w << std::endl; + std::cout << " e = " << opts.e << std::endl; + std::cout << "\n Slow integrator: " << opts.mri_method; + if (slowimex) { std::cout << " (ImEx)" << std::endl; } + else if (slowimplicit) { std::cout << " (implicit)" << std::endl; } + else { std::cout << " (explicit)" << std::endl; } + PrintSlowAdaptivity(opts); + if (opts.fast_order == 0) { std::cout << "\n Fast integrator disabled"; } + else { std::cout << "\n Fast order " << opts.fast_order << std::endl; } + PrintFastAdaptivity(opts); + + // If SUNLogger is enabled, manually disable it for the reference solver + SUNLogger logger = NULL; + retval = SUNLogger_Create(SUN_COMM_NULL, 0, &logger); + retval = SUNContext_SetLogger(refctx, logger); + retval = SUNLogger_SetErrorFilename(logger, "/dev/null"); + retval = SUNLogger_SetWarningFilename(logger, "/dev/null"); + retval = SUNLogger_SetInfoFilename(logger, "/dev/null"); + retval = SUNLogger_SetDebugFilename(logger, "/dev/null"); + + // Create and initialize serial vectors for the solution and reference + N_Vector y = N_VNew_Serial(NEQ, sunctx); + if (check_ptr((void*)y, "N_VNew_Serial")) return 1; + N_Vector yref = N_VNew_Serial(NEQ, refctx); + if (check_ptr((void*)yref, "N_VNew_Serial")) return 1; + sunrealtype* ydata = N_VGetArrayPointer(y); + if (check_ptr((void*)ydata, "N_VGetArrayPointer")) return 1; + sunrealtype* yrefdata = N_VGetArrayPointer(yref); + if (check_ptr((void*)yrefdata, "N_VGetArrayPointer")) return 1; + + // Set initial conditions + retval = Ytrue(T0, y, &opts); + if (check_flag(retval, "Ytrue")) return 1; + N_VScale(ONE, y, yref); + + // Create and configure reference solver object + void* arkode_ref = ERKStepCreate(fn, T0, yref, refctx); + if (check_ptr((void*)arkode_ref, "ERKStepCreate")) return 1; + retval = ARKodeSetUserData(arkode_ref, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + retval = ARKodeSetOrder(arkode_ref, 5); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(arkode_ref, SUN_RCONST(1.e-10), SUN_RCONST(1.e-12)); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_ref, 10000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return (1); + + // Create and configure fast controller object + SUNAdaptController fcontrol = NULL; + switch (opts.fcontrol) + { + case (1): + fcontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_I")) return 1; + if (opts.k1f > -1) + { + retval = SUNAdaptController_SetParams_I(fcontrol, opts.k1f); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + case (2): + fcontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PI")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_PI(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + case (3): + fcontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_PID")) return 1; + if (std::min(opts.k1f, std::min(opts.k2f, opts.k3f)) > -1) + { + retval = SUNAdaptController_SetParams_PID(fcontrol, opts.k1f, opts.k2f, + opts.k3f); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + case (4): + fcontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ExpGus")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + case (5): + fcontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImpGus")) return 1; + if (std::min(opts.k1f, opts.k2f) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(fcontrol, opts.k1f, opts.k2f); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + case (6): + fcontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)fcontrol, "SUNAdaptController_ImExGus")) return 1; + break; + } + if ((opts.bias > -1) && (opts.fcontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(fcontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create ERKStep (fast) integrator + void* inner_arkode_mem = NULL; // ARKode memory structure + inner_arkode_mem = ERKStepCreate(f_f, T0, y, sunctx); + if (check_ptr((void*)inner_arkode_mem, "ERKStepCreate")) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, opts.fast_order); + if (check_flag(retval, "ARKodeSetOrder")) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, opts.fast_rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + if (opts.fcontrol != 0) + { + retval = ARKodeSetAdaptController(inner_arkode_mem, fcontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.fast_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(inner_arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(inner_arkode_mem, opts.hf); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + ARKAccumError acc_type = ARK_ACCUMERROR_NONE; + if (opts.faccum == 0) { acc_type = ARK_ACCUMERROR_MAX; } + if (opts.faccum == 1) { acc_type = ARK_ACCUMERROR_SUM; } + if (opts.faccum == 2) { acc_type = ARK_ACCUMERROR_AVG; } + retval = ARKodeSetAccumulatedErrorType(inner_arkode_mem, acc_type); + if (check_flag(retval, "ARKodeSetAccumulatedErrorType")) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(inner_arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + + // Create inner stepper + MRIStepInnerStepper inner_stepper = NULL; // inner stepper + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_flag(retval, "ARKodeCreateMRIStepInnerStepper")) return 1; + + // Create slow controller object, and select orders of accuracy as relevant + SUNAdaptController scontrol = NULL; + SUNAdaptController scontrol_H = NULL; + SUNAdaptController scontrol_Tol = NULL; + switch (opts.scontrol) + { + case (5): + scontrol_H = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_I (slow H)")) return 1; + scontrol_Tol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_I (slow Tol)")) + return 1; + if (opts.k1s > -1) + { + retval = SUNAdaptController_SetParams_I(scontrol_H, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + retval = SUNAdaptController_SetParams_I(scontrol_Tol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (6): + scontrol = SUNAdaptController_I(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptControllerI (slow)")) return 1; + if (opts.k1s > -1) + { + retval = SUNAdaptController_SetParams_I(scontrol, opts.k1s); + if (check_flag(retval, "SUNAdaptController_SetParams_I")) return 1; + } + break; + case (7): + scontrol_H = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PI (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PI (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_PI(scontrol_H, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + retval = SUNAdaptController_SetParams_PI(scontrol_Tol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (8): + scontrol = SUNAdaptController_PI(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PI (slow)")) return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_PI(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_PI")) return 1; + } + break; + case (9): + scontrol_H = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_PID (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_PID (slow Tol)")) + return 1; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + retval = SUNAdaptController_SetParams_PID(scontrol_H, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + retval = SUNAdaptController_SetParams_PID(scontrol_Tol, opts.k1s, + opts.k2s, opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (10): + scontrol = SUNAdaptController_PID(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_PID (slow)")) return 1; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + retval = SUNAdaptController_SetParams_PID(scontrol, opts.k1s, opts.k2s, + opts.k3s); + if (check_flag(retval, "SUNAdaptController_SetParams_PID")) return 1; + } + break; + case (11): + scontrol_H = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ExpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ExpGus (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + retval = SUNAdaptController_SetParams_ExpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (12): + scontrol = SUNAdaptController_ExpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ExpGus (slow)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ExpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ExpGus")) return 1; + } + break; + case (13): + scontrol_H = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImpGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImpGus (slow Tol)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol_H, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + retval = SUNAdaptController_SetParams_ImpGus(scontrol_Tol, opts.k1s, + opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (14): + scontrol = SUNAdaptController_ImpGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImpGus (slow)")) + return 1; + if (std::min(opts.k1s, opts.k2s) > -1) + { + retval = SUNAdaptController_SetParams_ImpGus(scontrol, opts.k1s, opts.k2s); + if (check_flag(retval, "SUNAdaptController_SetParams_ImpGus")) return 1; + } + break; + case (15): + scontrol_H = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_H, "SUNAdaptController_ImExGus (slow H)")) + return 1; + scontrol_Tol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol_Tol, "SUNAdaptController_ImExGus (slow Tol)")) + return 1; + scontrol = SUNAdaptController_MRIHTol(scontrol_H, scontrol_Tol, sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_MRIHTol")) return 1; + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + retval = SUNAdaptController_SetParams_MRIHTol(scontrol, opts.htol_relch, + opts.htol_minfac, + opts.htol_maxfac); + if (check_flag(retval, "SUNAdaptController_SetParams_MRIHTol")) return 1; + } + break; + case (16): + scontrol = SUNAdaptController_ImExGus(sunctx); + if (check_ptr((void*)scontrol, "SUNAdaptController_ImExGus (slow)")) + return 1; + break; + } + if ((opts.bias > -1) && (opts.scontrol > 0)) + { + retval = SUNAdaptController_SetErrorBias(scontrol, opts.bias); + if (check_flag(retval, "SUNAdaptController_SetErrorBias")) return 1; + } + + // Create MRI (slow) integrator + void* arkode_mem = NULL; // ARKode memory structure + arkode_mem = MRIStepCreate(f_se, f_si, T0, y, inner_stepper, sunctx); + if (check_ptr((void*)arkode_mem, "MRIStepCreate")) return 1; + MRIStepCoupling C = MRIStepCoupling_LoadTableByName((opts.mri_method).c_str()); + if (check_ptr((void*)C, "MRIStepCoupling_LoadTableByName")) return 1; + retval = MRIStepSetCoupling(arkode_mem, C); + if (check_flag(retval, "MRIStepSetCoupling")) return 1; + SUNMatrix As = NULL; // matrix for slow solver + SUNLinearSolver LSs = NULL; // slow linear solver object + if (slowimplicit) + { + As = SUNDenseMatrix(NEQ, NEQ, sunctx); + if (check_ptr((void*)As, "SUNDenseMatrix")) return 1; + LSs = SUNLinSol_Dense(y, As, sunctx); + if (check_ptr((void*)LSs, "SUNLinSol_Dense")) return 1; + retval = ARKodeSetLinearSolver(arkode_mem, LSs, As); + if (check_flag(retval, "ARKodeSetLinearSolver")) return 1; + retval = ARKodeSetJacFn(arkode_mem, J_s); + if (check_flag(retval, "ARKodeSetJacFn")) return 1; + } + retval = ARKodeSStolerances(arkode_mem, opts.rtol, opts.atol); + if (check_flag(retval, "ARKodeSStolerances")) return 1; + retval = ARKodeSetMaxNumSteps(arkode_mem, 100000); + if (check_flag(retval, "ARKodeSetMaxNumSteps")) return 1; + retval = ARKodeSetUserData(arkode_mem, (void*)&opts); + if (check_flag(retval, "ARKodeSetUserData")) return 1; + if (opts.scontrol != 0) + { + retval = ARKodeSetAdaptController(arkode_mem, scontrol); + if (check_flag(retval, "ARKodeSetAdaptController")) return 1; + if (opts.set_h0 != 0) + { + retval = ARKodeSetInitStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetInitStep")) return 1; + } + if (opts.slow_pq == 1) + { + retval = ARKodeSetAdaptivityAdjustment(arkode_mem, 0); + if (check_flag(retval, "ARKodeSetAdaptivityAdjustment")) return 1; + } + if (opts.slow_safety > -1) + { + retval = ARKodeSetSafetyFactor(arkode_mem, opts.slow_safety); + if (check_flag(retval, "ARKodeSetSafetyFactor")) return 1; + } + } + else + { + retval = ARKodeSetFixedStep(arkode_mem, opts.hs); + if (check_flag(retval, "ARKodeSetFixedStep")) return 1; + } + + // + // Integrate ODE + // + + // Main time-stepping loop: calls ARKodeEvolve to perform the + // integration, then prints results. Stops when the final time + // has been reached + sunrealtype t = T0; + sunrealtype t2 = T0; + sunrealtype dTout = (Tf - T0) / Nt; + sunrealtype tout = T0 + dTout; + sunrealtype u, v, uerr, verr, uerrtot, verrtot, errtot, accuracy; + uerr = verr = uerrtot = verrtot = errtot = accuracy = ZERO; + printf(" t u v uerr verr\n"); + printf(" ------------------------------------------------------\n"); + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %.2" ESYM " %.2" ESYM + "\n", + t, ydata[0], ydata[1], uerr, verr); + while (Tf - t > SUN_RCONST(1.0e-8)) + { + // reset reference solver so that it begins with identical state + retval = ARKodeReset(arkode_ref, t, y); + + // evolve solution in one-step mode + retval = ARKodeSetStopTime(arkode_mem, tout); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_mem, tout, y, &t, ARK_ONE_STEP); + if (retval < 0) + { + printf("ARKodeEvolve error (%i)\n", retval); + return 1; + } + + // evolve reference solver to same time in "normal" mode + retval = ARKodeSetStopTime(arkode_ref, t); + if (check_flag(retval, "ARKodeSetStopTime")) return 1; + retval = ARKodeEvolve(arkode_ref, t, yref, &t2, ARK_NORMAL); + if (retval < 0) + { + printf("ARKodeEvolve reference solution error (%i)\n", retval); + return 1; + } + + // access/print solution and error + u = ydata[0]; + v = ydata[1]; + uerr = std::abs(yrefdata[0] - u); + verr = std::abs(yrefdata[1] - v); + uerrtot += uerr * uerr; + verrtot += verr * verr; + errtot += uerr * uerr + verr * verr; + accuracy = std::max(accuracy, + uerr / std::abs(opts.atol + opts.rtol * yrefdata[0])); + accuracy = std::max(accuracy, + verr / std::abs(opts.atol + opts.rtol * yrefdata[1])); + + // Periodically output current results to screen + if (t >= tout) + { + tout += dTout; + tout = (tout > Tf) ? Tf : tout; + printf(" %10.6" FSYM " %10.6" FSYM " %10.6" FSYM " %.2" ESYM + " %.2" ESYM "\n", + t, u, v, uerr, verr); + } + } + printf(" ------------------------------------------------------\n"); + + // + // Finalize + // + + // Get some slow integrator statistics + long int nsts, natts, netfs, nfse, nfsi; + retval = ARKodeGetNumSteps(arkode_mem, &nsts); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(arkode_mem, &natts); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(arkode_mem, &netfs); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 0, &nfse); + check_flag(retval, "ARKodeGetNumRhsEvals"); + retval = ARKodeGetNumRhsEvals(arkode_mem, 1, &nfsi); + check_flag(retval, "ARKodeGetNumRhsEvals"); + + // Get some fast integrator statistics + long int nstf, nattf, netff, nff; + retval = ARKodeGetNumSteps(inner_arkode_mem, &nstf); + check_flag(retval, "ARKodeGetNumSteps"); + retval = ARKodeGetNumStepAttempts(inner_arkode_mem, &nattf); + check_flag(retval, "ARKodeGetNumStepAttempts"); + retval = ARKodeGetNumErrTestFails(inner_arkode_mem, &netff); + check_flag(retval, "ARKodeGetNumErrTestFails"); + retval = ARKodeGetNumRhsEvals(inner_arkode_mem, 0, &nff); + check_flag(retval, "ARKodeGetNumRhsEvals"); + + // Print some final statistics + uerrtot = std::sqrt(uerrtot / (sunrealtype)nsts); + verrtot = std::sqrt(verrtot / (sunrealtype)nsts); + errtot = std::sqrt(errtot / SUN_RCONST(2.0) / (sunrealtype)nsts); + std::cout << "\nFinal Solver Statistics:\n"; + std::cout << " Slow steps = " << nsts << " (attempts = " << natts + << ", fails = " << netfs << ")\n"; + std::cout << " Fast steps = " << nstf << " (attempts = " << nattf + << ", fails = " << netff << ")\n"; + std::cout << " u error = " << uerrtot << ", v error = " << verrtot + << ", total error = " << errtot << std::endl; + std::cout << " Relative accuracy = " << accuracy << std::endl; + std::cout << " Total RHS evals: Fse = " << nfse << ", Fsi = " << nfsi + << ", Ff = " << nff << std::endl; + + // Get/print slow integrator decoupled implicit solver statistics + if (slowimplicit) + { + long int nnis, nncs, njes; + retval = ARKodeGetNonlinSolvStats(arkode_mem, &nnis, &nncs); + check_flag(retval, "ARKodeGetNonlinSolvStats"); + retval = ARKodeGetNumJacEvals(arkode_mem, &njes); + check_flag(retval, "ARKodeGetNumJacEvals"); + std::cout << " Slow Newton iters = " << nnis << std::endl; + std::cout << " Slow Newton conv fails = " << nncs << std::endl; + std::cout << " Slow Jacobian evals = " << njes << std::endl; + } + + // Clean up and return + N_VDestroy(y); + MRIStepCoupling_Free(C); + if (As) { SUNMatDestroy(As); } + if (LSs) { SUNLinSolFree(LSs); } + if (scontrol) { SUNAdaptController_Destroy(scontrol); } + if (scontrol_H) { SUNAdaptController_Destroy(scontrol_H); } + if (scontrol_Tol) { SUNAdaptController_Destroy(scontrol_Tol); } + if (fcontrol) { SUNAdaptController_Destroy(fcontrol); } + ARKodeFree(&inner_arkode_mem); // Free fast integrator memory + MRIStepInnerStepper_Free(&inner_stepper); // Free inner stepper structure + ARKodeFree(&arkode_mem); // Free slow integrator memory + ARKodeFree(&arkode_ref); // Free reference solver memory + SUNLogger_Destroy(&logger); // Free logger + + return 0; +} + +// ------------------------------ +// Functions called by the solver +// ----------------------------- + +// ff routine to compute the fast portion of the ODE RHS. +static int ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [0 0]*[(-2+u^2-r(t))/(2*u)] + [ 0 ] + // [e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2v)] + tmp1 = (-TWO + u * u - r(t, opts)) / (TWO * u); + tmp2 = (-TWO + v * v - s(t, opts)) / (TWO * v); + dydata[0] = ZERO; + dydata[1] = opts->e * tmp1 - tmp2 + sdot(t, opts) / (TWO * v); + + // Return with success + return 0; +} + +// fs routine to compute the slow portion of the ODE RHS. +static int fs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [G e]*[(-2+u^2-r(t))/(2*u)] + [rdot(t)/(2u)] + // [0 0] [(-2+v^2-s(t))/(2*v)] [ 0 ] + tmp1 = (-TWO + u * u - r(t, opts)) / (TWO * u); + tmp2 = (-TWO + v * v - s(t, opts)) / (TWO * v); + dydata[0] = opts->G * tmp1 + opts->e * tmp2 + rdot(t, opts) / (TWO * u); + dydata[1] = ZERO; + + // Return with success + return 0; +} + +// fse routine to compute the slow portion of the ODE RHS. +static int fse(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + + // fill in the slow explicit RHS function: + // [rdot(t)/(2u)] + // [ 0 ] + dydata[0] = rdot(t, opts) / (TWO * u); + dydata[1] = ZERO; + + // Return with success + return 0; +} + +// fsi routine to compute the slow portion of the ODE RHS.(currently same as fse) +static int fsi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the slow implicit RHS function: + // [G e]*[(-2+u^2-r(t))/(2*u)] + // [0 0] [(-2+v^2-s(t))/(2*v)] + tmp1 = (-TWO + u * u - r(t, opts)) / (TWO * u); + tmp2 = (-TWO + v * v - s(t, opts)) / (TWO * v); + dydata[0] = opts->G * tmp1 + opts->e * tmp2; + dydata[1] = ZERO; + + // Return with success + return 0; +} + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [G e]*[(-2+u^2-r(t))/(2*u)] + [rdot(t)/(2u)] + // [e -1] [(-2+v^2-s(t))/(2*v)] [sdot(t)/(2v)] + tmp1 = (-TWO + u * u - r(t, opts)) / (TWO * u); + tmp2 = (-TWO + v * v - s(t, opts)) / (TWO * v); + dydata[0] = opts->G * tmp1 + opts->e * tmp2 + rdot(t, opts) / (TWO * u); + dydata[1] = opts->e * tmp1 - tmp2 + sdot(t, opts) / (TWO * v); + + // Return with success + return 0; +} + +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VConst(ZERO, ydot); + return (0); +} + +static int Js(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype t11, t22; + + // fill in the Jacobian: + // [G e]*[1-(u^2-r(t)-2)/(2*u^2), 0] + [-r'(t)/(2*u^2), 0] + // [0 0] [0, 1-(v^2-s(t)-2)/(2*v^2)] [0, 0] + t11 = ONE - (u * u - r(t, opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - s(t, opts) - TWO) / (TWO * v * v); + SM_ELEMENT_D(J, 0, 0) = opts->G * t11 - rdot(t, opts) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = opts->e * t22; + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + + // Return with success + return 0; +} + +static int Jsi(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype t11, t22; + + // fill in the Jacobian: + // [G e]*[1-(u^2-r(t)-2)/(2*u^2), 0] + // [0 0] [0, 1-(v^2-s(t)-2)/(2*v^2)] + t11 = ONE - (u * u - r(t, opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - s(t, opts) - TWO) / (TWO * v * v); + SM_ELEMENT_D(J, 0, 0) = opts->G * t11; + SM_ELEMENT_D(J, 0, 1) = opts->e * t22; + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + + // Return with success + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + Options* opts = (Options*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype t11, t22; + + // fill in the Jacobian: + // [G e]*[1-(u^2-r(t)-2)/(2*u^2), 0] + [-r'(t)/(2*u^2), 0] + // [e -1] [0, 1-(v^2-s(t)-2)/(2*v^2)] [0, -s'(t)/(2*v^2)] + t11 = ONE - (u * u - r(t, opts) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - s(t, opts) - TWO) / (TWO * v * v); + SM_ELEMENT_D(J, 0, 0) = opts->G * t11 - rdot(t, opts) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = opts->e * t22; + SM_ELEMENT_D(J, 1, 0) = opts->e * t11; + SM_ELEMENT_D(J, 1, 1) = -t22 - sdot(t, opts) / (TWO * v * v); + + // Return with success + return 0; +} + +// ------------------------------ +// Private helper functions +// ----------------------------- + +static sunrealtype r(sunrealtype t, Options* opts) { return (cos(t)); } + +static sunrealtype s(sunrealtype t, Options* opts) +{ + return (cos(opts->w * t * (ONE + exp(-(t - TWO) * (t - TWO))))); +} + +static sunrealtype rdot(sunrealtype t, Options* opts) { return (-sin(t)); } + +static sunrealtype sdot(sunrealtype t, Options* opts) +{ + const sunrealtype tTwo = t - TWO; + const sunrealtype eterm = exp(-tTwo * tTwo); + return (-sin(opts->w * t * (ONE + eterm)) * opts->w * + (ONE + eterm * (ONE - TWO * t * tTwo))); +} + +static sunrealtype utrue(sunrealtype t, Options* opts) +{ + return (std::sqrt(TWO + r(t, opts))); +} + +static sunrealtype vtrue(sunrealtype t, Options* opts) +{ + return (std::sqrt(TWO + s(t, opts))); +} + +static int Ytrue(sunrealtype t, N_Vector y, Options* opts) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue(t, opts); + ydata[1] = vtrue(t, opts); + return (0); +} + +// ----------------------------------------------------------------------------- +// Utility functions +// ----------------------------------------------------------------------------- + +// Print command line options +void InputHelp() +{ + std::cout << std::endl; + std::cout << "Command line options:" << std::endl; + std::cout << " --help : print options and exit\n"; + std::cout << " --e : fast/slow coupling strength\n"; + std::cout << " --G : stiffness at slow time scale\n"; + std::cout << " --w : time-scale separation factor\n"; + std::cout << " --hs : slow (fixed/initial) step size\n"; + std::cout << " --hf : fast (fixed/initial) step size\n"; + std::cout + << " --set_h0 : use hs/hf above to set the initial step size\n"; + std::cout << " --rtol : relative solution tolerance\n"; + std::cout << " --atol : absolute solution tolerance\n"; + std::cout + << " --fast_rtol : relative solution tolerance for fast method\n"; + std::cout << " --mri_method : MRI method name (valid ARKODE_MRITableID)\n"; + std::cout << " --fast_order : fast RK method order\n"; + std::cout << " --scontrol : slow time step controller, int in [0,16] " + "(see source)\n"; + std::cout << " --fcontrol : fast time step controller, int in [0,6] " + "(see source)\n"; + std::cout << " --faccum : fast error accumulation type {-1,0,1,2}\n"; + std::cout << " --slow_pq : use p (0) vs q (1) for slow adaptivity\n"; + std::cout << " --fast_pq : use p (0) vs q (1) for fast adaptivity\n"; + std::cout << " --k1s, --k2s, ..., -k6s : slow controller parameters\n"; + std::cout << " --k1f, --k2f, -k3f : fast controller parameters\n"; + std::cout << " --bias : slow and fast controller bias factors\n"; + std::cout << " --safety : slow time step safety factor\n"; + std::cout + << " --htol_relch : HTol controller maximum relative tolerance change\n"; + std::cout + << " --htol_minfac : HTol controller minimum relative tolerance factor\n"; + std::cout + << " --htol_maxfac : HTol controller maximum relative tolerance factor\n"; +} + +// Read input options +int ReadInputs(std::vector<std::string>& args, Options& opts, SUNContext ctx) +{ + if (find(args.begin(), args.end(), "--help") != args.end()) + { + InputHelp(); + return 1; + } + + // Problem options + find_arg(args, "--e", opts.e); + find_arg(args, "--G", opts.G); + find_arg(args, "--w", opts.w); + find_arg(args, "--hs", opts.hs); + find_arg(args, "--hf", opts.hf); + find_arg(args, "--set_h0", opts.set_h0); + find_arg(args, "--rtol", opts.rtol); + find_arg(args, "--atol", opts.atol); + find_arg(args, "--fast_rtol", opts.fast_rtol); + find_arg(args, "--mri_method", opts.mri_method); + find_arg(args, "--fast_order", opts.fast_order); + find_arg(args, "--scontrol", opts.scontrol); + find_arg(args, "--fcontrol", opts.fcontrol); + find_arg(args, "--faccum", opts.faccum); + find_arg(args, "--slow_pq", opts.slow_pq); + find_arg(args, "--fast_pq", opts.fast_pq); + find_arg(args, "--k1s", opts.k1s); + find_arg(args, "--k2s", opts.k2s); + find_arg(args, "--k3s", opts.k3s); + find_arg(args, "--k1f", opts.k1f); + find_arg(args, "--k2f", opts.k2f); + find_arg(args, "--k3f", opts.k3f); + find_arg(args, "--bias", opts.bias); + find_arg(args, "--safety", opts.slow_safety); + find_arg(args, "--htol_relch", opts.htol_relch); + find_arg(args, "--htol_minfac", opts.htol_minfac); + find_arg(args, "--htol_maxfac", opts.htol_maxfac); + + // Check inputs for validity + // 0 < rtol < 1 + if ((opts.rtol < ZERO) || (opts.rtol > ONE)) + { + std::cerr << "ERROR: rtol must be in (0,1), (" << opts.rtol << " input)\n"; + return -1; + } + // 0 < atol < 1 + if ((opts.atol < ZERO) || (opts.atol > ONE)) + { + std::cerr << "ERROR: atol must be in (0,1), (" << opts.atol << " input)\n"; + return -1; + } + // 0 < fast_rtol < 1 + if ((opts.fast_rtol < ZERO) || (opts.fast_rtol > ONE)) + { + std::cerr << "ERROR: fast_rtol must be in (0,1), (" << opts.fast_rtol + << " input)\n"; + return -1; + } + // slow_pq in {0,1} + if ((opts.slow_pq < 0) || (opts.slow_pq > 1)) + { + std::cerr << "ERROR: slow_pq must be in {0,1}, (" << opts.slow_pq + << " input)\n"; + return -1; + } + // fast_pq in {0,1} + if ((opts.fast_pq < 0) || (opts.fast_pq > 1)) + { + std::cerr << "ERROR: fast_pq must be in {0,1}, (" << opts.fast_pq + << " input)\n"; + return -1; + } + // scontrol in [0,16] + if ((opts.scontrol < 0) || (opts.scontrol > 16)) + { + std::cerr << "ERROR: scontrol must be in [0,16], (" << opts.scontrol + << " input)\n"; + return -1; + } + // fcontrol in [0,6] + if ((opts.fcontrol < 0) || (opts.fcontrol > 6)) + { + std::cerr << "ERROR: fcontrol must be in [0,6], (" << opts.fcontrol + << " input)\n"; + return -1; + } + // hs > 0 if scontrol == 0 + if ((opts.hs <= 0) && (opts.scontrol == 0)) + { + std::cerr << "ERROR: positive hs required with scontrol = 0, (" << opts.hs + << " input)\n"; + return -1; + } + // hf > 0 if fcontrol == 0 + if ((opts.hf <= 0) && (opts.fcontrol == 0)) + { + std::cerr << "ERROR: positive hf required with fcontrol = 0, (" << opts.hf + << " input)\n"; + return -1; + } + // G < 0.0 + if (opts.G >= ZERO) + { + std::cerr << "ERROR: G must be a negative real number, (" << opts.G + << " input)\n"; + return -1; + } + // w >= 1.0 + if (opts.w < ONE) + { + std::cerr << "ERROR: w must be >= 1.0, (" << opts.w << " input)\n"; + return -1; + } + + return 0; +} + +static void PrintSlowAdaptivity(Options opts) +{ + switch (opts.scontrol) + { + case (0): + std::cout << " fixed steps, hs = " << opts.hs << std::endl; + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + case (5): + std::cout + << " MRI-HTOL controller (using I for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (opts.k1s > -1) + { + std::cout << " slow controller parameter: " << opts.k1s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (6): + std::cout << " Decoupled I controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (opts.k1s > -1) + { + std::cout << " slow controller parameter: " << opts.k1s << "\n"; + } + break; + case (7): + std::cout + << " MRI-HTOL controller (using PI for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (8): + std::cout << " Decoupled PI controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (9): + std::cout + << " MRI-HTOL controller (using PID for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << " " << opts.k3s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (10): + std::cout << " Decoupled PID controller for slow time scale, based on " + "order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, std::min(opts.k2s, opts.k3s)) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << " " << opts.k3s << "\n"; + } + break; + case (11): + std::cout + << " MRI-HTOL controller (using ExpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (12): + std::cout << " Decoupled ExpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (13): + std::cout + << " MRI-HTOL controller (using ImpGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + if (std::min(opts.htol_relch, std::min(opts.htol_minfac, opts.htol_maxfac)) > + -1) + { + std::cout << " HTol controller parameters: " << opts.htol_relch << " " + << opts.htol_minfac << " " << opts.htol_maxfac << "\n"; + } + break; + case (14): + std::cout << " Decoupled ImpGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1s, opts.k2s) > -1) + { + std::cout << " slow controller parameters: " << opts.k1s << " " + << opts.k2s << "\n"; + } + break; + case (15): + std::cout + << " MRI-HTOL controller (using ImExGus for H) based on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + std::cout << " fast error accumulation strategy = " << opts.faccum << "\n"; + break; + case (16): + std::cout << " Decoupled ImExGus controller for slow time scale, based " + "on order of MRI " + << ((opts.slow_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " rtol = " << opts.rtol << ", atol = " << opts.atol << "\n"; + break; + } + if (opts.bias > -1) + { + std::cout << " controller bias factor: " << opts.bias << "\n"; + } + if (opts.slow_safety > -1) + { + std::cout << " slow step safety factor: " << opts.slow_safety << "\n"; + } +} + +static void PrintFastAdaptivity(Options opts) +{ + switch (opts.fcontrol) + { + case (0): + std::cout << " fixed steps, hf = " << opts.hf << std::endl; + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + case (1): + std::cout << " I controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (opts.k1f > -1) + { + std::cout << " fast controller parameter: " << opts.k1f << "\n"; + } + break; + case (2): + std::cout << " PI controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (3): + std::cout << " PID controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, std::min(opts.k2f, opts.k3f)) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << " " << opts.k3f << "\n"; + } + break; + case (4): + std::cout + << " ExpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (5): + std::cout + << " ImpGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + if (std::min(opts.k1f, opts.k2f) > -1) + { + std::cout << " fast controller parameters: " << opts.k1f << " " + << opts.k2f << "\n"; + } + break; + case (6): + std::cout + << " ImExGus controller for fast time scale, based on order of RK " + << ((opts.fast_pq == 1) ? "method\n" : "embedding\n"); + std::cout << " fast_rtol = " << opts.fast_rtol + << ", atol = " << opts.atol << "\n"; + break; + } +} + +//---- end of file ----// diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt_--hs_0.002_--rtol_0.000004_--scontrol_0.out b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt_--hs_0.002_--rtol_0.000004_--scontrol_0.out new file mode 100644 index 0000000000..8e57f80640 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt_--hs_0.002_--rtol_0.000004_--scontrol_0.out @@ -0,0 +1,45 @@ + +Adaptive multirate nonlinear Kvaerno-Prothero-Robinson test problem: + time domain: (0,5] + G = -100 + w = 100 + e = 0.5 + + Slow integrator: ARKODE_MRI_GARK_ERK45a (explicit) + fixed steps, hs = 0.002 + rtol = 4e-06, atol = 1e-11 + + Fast order 4 + I controller for fast time scale, based on order of RK embedding + fast_rtol = 0.0001, atol = 1e-11 + t u v uerr verr + ------------------------------------------------------ + 0.000000 1.732051 1.732051 0.00e+00 0.00e+00 + 0.250000 1.723053 1.584050 5.10e-11 1.74e-10 + 0.500000 1.696344 1.512598 4.30e-11 2.73e-10 + 0.750000 1.652782 1.036015 4.02e-11 3.15e-09 + 1.000000 1.593833 1.458873 3.25e-11 2.89e-09 + 1.250000 1.521618 1.458201 3.35e-11 1.27e-08 + 1.500000 1.439006 1.011474 4.36e-11 6.25e-08 + 1.750000 1.349724 1.730452 3.65e-12 3.67e-09 + 2.000000 1.258512 1.214374 1.24e-11 5.83e-09 + 2.250000 1.171250 1.024071 2.70e-11 1.63e-10 + 2.500000 1.094923 1.471085 4.59e-11 3.37e-13 + 2.750000 1.037158 1.313348 6.43e-11 2.13e-11 + 3.000000 1.004991 1.274175 7.65e-11 2.92e-11 + 3.250000 1.002931 1.043458 7.96e-11 6.41e-12 + 3.500000 1.031282 1.053648 6.81e-11 1.65e-13 + 3.750000 1.086021 1.006374 5.10e-11 3.61e-12 + 4.000000 1.160326 1.571824 3.06e-11 1.90e-11 + 4.250000 1.246560 1.705136 7.61e-12 4.47e-11 + 4.500000 1.337611 1.431830 3.19e-12 5.54e-11 + 4.750000 1.427446 1.162908 1.55e-11 1.82e-10 + 5.000000 1.511179 1.070831 2.51e-11 3.35e-10 + ------------------------------------------------------ + +Final Solver Statistics: + Slow steps = 2500 (attempts = 2500, fails = 0) + Fast steps = 12502 (attempts = 12502, fails = 0) + u error = 4.31846e-11, v error = 9.52053e-09, total error = 6.7321e-09 + Relative accuracy = 0.0160086 + Total RHS evals: Fse = 12500, Fsi = 0, Ff = 65012 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.cpp new file mode 100644 index 0000000000..e094279c41 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.cpp @@ -0,0 +1,623 @@ +/*----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Routine to test an MRI method's embedding-based error + * estimate. Uses the "stiff Brusselator" test problem with 3 + * components, + * du/dt = a - (w+1)*u + v*u^2 + * dv/dt = w*u - v*u^2 + * dw/dt = (b-w)/ep - w*u + * for t in the interval [0.0, 10.0], with initial conditions + * Y0 = [u0,v0,w0]. + * + * The stiffness of the problem is essentially determined + * by ep, wherein if the dynamical time step is given by H and + * the explicit time step size is given by h, then H/h = 1/(100 ep), + * i.e., the stability-limited step takes over at values of + * ep < 1e-2. This file defaults to a moderately stiff setup with + * ep = 1/2500. + * + * We may run the problem in one of 3 different testing scenarios: + * + * Test 1: u0=3.9, v0=1.1, w0=2.8, a=1.2, b=2.5 + * Here, all three components exhibit a rapid transient change + * during the first 0.2 time units, followed by a slow and + * smooth evolution. + * + * Test 2 [default]: u0=1.2, v0=3.1, w0=3, a=1, b=3.5 + * Here, w experiences a fast initial transient, jumping 0.5 + * within a few steps. All values proceed smoothly until + * around t=6.5, when both u and v undergo a sharp transition, + * with u increaseing from around 0.5 to 5 and v decreasing + * from around 6 to 1 in less than 0.5 time units. After this + * transition, both u and v continue to evolve somewhat + * rapidly for another 1.4 time units, and finish off smoothly. + * + * Test 3: u0=3, v0=3, w0=3.5, a=0.5, b=3 + * Here, all components undergo very rapid initial transients + * during the first 0.3 time units, and all then proceed very + * smoothly for the remainder of the simulation. + * + * We partition the full time integration interval, 0 < t < 5, into + * Npart pieces. We then run a single time step starting at the + * beginning of each partition, using a variety of slow step sizes, + * H = {hmax, hmax/4, hmax/16, hmax/64, hmax/256} with + * hmax=(t_f-t_0)/20/Npart. + * + * We place the entire ODE in the "slow" RHS partition. For IMEX + * methods, the third row is treated implicitly, and the first two + * are treated explicitly. For the fast time scale, all tests use + * ARKODE's default fifth-order ERK method, with relative and + * absolute tolerances set to 1e-10 and 1e-12, respectively. + * + * We select the slow integrator based on a command-line argument, + * with the default being ARKODE_MRI_GARK_ERK33a. + * + * The program should be run with arguments in the following order: + * $ a.out method Npart ep test + * Not all arguments are required, but these must be omitted from + * end-to-beginning, i.e. any one of + * $ a.out method Npart ep + * $ a.out method Npart + * $ a.out method + * $ a.out + * are acceptable. We require: + * * method = string corresponding to a valid embedded ARKODE_MRITableID + * * Npart > 0 + * * ep > 0 + * * test = {1, 2, 3} + *-----------------------------------------------------------------*/ + +// Header files +#include <algorithm> +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_mristep.h> +#include <cmath> +#include <iostream> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <string.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> +#include <sunmatrix/sunmatrix_dense.h> +#include <vector> + +#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 + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +using namespace std; + +// User data structure +struct UserData +{ + sunrealtype a; + sunrealtype b; + sunrealtype ep; + int Npart; +}; + +// User-supplied Functions Called by the Solver +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Private utility functions +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp); +static int check_retval(void* returnvalue, const char* funcname, int opt); +static int run_test(void* mristep_mem, void* arkode_ref, N_Vector y, + sunrealtype T0, sunrealtype Tf, N_Vector* yref, + vector<sunrealtype> Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata); + +// Main Program +int main(int argc, char* argv[]) +{ + // general problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(10.0); // final time + sunindextype NEQ = 3; // number of dependent vars. + string method; // MRI method name + int test = 2; // test problem to run + sunrealtype u0, v0, w0; // parameters + sunrealtype reltol = SUN_RCONST(1.e-10); // fast solver tolerances + sunrealtype abstol = SUN_RCONST(1.e-12); + + // general problem variables + int retval; // reusable error-checking flag + UserData udata; // user-data structure + udata.ep = SUN_RCONST(0.0004); // stiffness parameter + udata.Npart = 20; // partition size + + // + // Initialization + // + + // Retrieve the command-line options: method Npart ep test + if (argc > 1) { method = argv[1]; } + else { method = "ARKODE_MRI_GARK_ERK33a"; } + if (argc > 2) udata.Npart = atoi(argv[2]); + if (argc > 3) udata.ep = SUNStrToReal(argv[3]); + if (argc > 4) test = atoi(argv[4]); + + // Check arguments for validity + // Npart > 0 + // ep > 0 + // test = {1, 2, 3} + if (udata.Npart < 1) + { + cerr << "ERROR: Npart must be a positive integer\n"; + return (-1); + } + if (udata.ep <= ZERO) + { + cerr << "ERROR: ep must be a positive real number\n"; + return (-1); + } + if ((test < 1) || (test > 3)) + { + cerr << "ERROR: test type be an integer in {1,2,3} \n"; + return (-1); + } + + // set up the test problem according to the desired test + if (test == 1) + { + u0 = SUN_RCONST(3.9); + v0 = SUN_RCONST(1.1); + w0 = SUN_RCONST(2.8); + udata.a = SUN_RCONST(1.2); + udata.b = SUN_RCONST(2.5); + } + else if (test == 3) + { + u0 = SUN_RCONST(3.0); + v0 = SUN_RCONST(3.0); + w0 = SUN_RCONST(3.5); + udata.a = SUN_RCONST(0.5); + udata.b = SUN_RCONST(3.0); + } + else + { + u0 = SUN_RCONST(1.2); + v0 = SUN_RCONST(3.1); + w0 = SUN_RCONST(3.0); + udata.a = SUN_RCONST(1.0); + udata.b = SUN_RCONST(3.5); + } + + sunbooleantype implicit = SUNFALSE; + sunbooleantype imex = SUNFALSE; + if ((method == "ARKODE_MRI_GARK_IRK21a") || + (method == "ARKODE_MRI_GARK_ESDIRK34a") || + (method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + implicit = SUNTRUE; + } + if ((method == "ARKODE_IMEX_MRI_SR21") || + (method == "ARKODE_IMEX_MRI_SR32") || (method == "ARKODE_IMEX_MRI_SR43")) + { + imex = SUNTRUE; + implicit = SUNTRUE; + } + + // Initial problem output (and set implicit solver tolerances as needed) + cout << "\nSlow error estimation test (stiff Brusselator ODE problem):\n"; + cout << " time domain: (" << T0 << "," << Tf << "]\n"; + cout << " partition size = " << udata.Npart << endl; + cout << " initial conditions: u0 = " << u0 << ", v0 = " << v0 + << ", w0 = " << w0 << endl; + cout << " problem parameters: a = " << udata.a << ", b = " << udata.b + << ", ep = " << udata.ep << endl; + cout << " MRI method: " << method; + if (imex) { cout << " (ImEx)" << endl; } + else if (implicit) { cout << " (implicit)" << endl; } + else { cout << " (explicit)" << endl; } + + // + // Problem Setup + // + + // Create SUNDIALS context + sundials::Context ctx; + + // Create serial vectors for the solution and reference + N_Vector y = N_VNew_Serial(NEQ, ctx); + if (check_retval((void*)y, "N_VNew_Serial", 0)) return 1; + N_Vector* yref = N_VCloneVectorArray(udata.Npart + 1, y); + if (check_retval((void*)yref, "N_VNew_Serial", 0)) return 1; + sunrealtype* ydata = N_VGetArrayPointer(y); + if (check_retval((void*)ydata, "N_VGetArrayPointer", 0)) return 1; + ydata[0] = u0; + ydata[1] = v0; + ydata[2] = w0; + + // Generate reference solution + void* arkode_ref = ERKStepCreate(fn, T0, y, ctx); + if (check_retval((void*)arkode_ref, "ERKStepCreate", 0)) return 1; + retval = ARKodeSetUserData(arkode_ref, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetOrder(arkode_ref, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(arkode_ref, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetMaxNumSteps(arkode_ref, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + N_VScale(ONE, y, yref[0]); + sunrealtype hpart = (Tf - T0) / udata.Npart; + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + sunrealtype t = T0 + ipart * hpart; + retval = ARKodeSetStopTime(arkode_ref, t + hpart); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + retval = ARKodeEvolve(arkode_ref, t + hpart, y, &t, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + N_VScale(ONE, y, yref[ipart + 1]); + } + + // Set up fast ERKStep integrator as fifth-order adaptive method + ydata[0] = u0; + ydata[1] = v0; + ydata[2] = w0; + void* inner_arkode_mem = ERKStepCreate(f0, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ERKStepCreate", 0)) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + + // Create inner stepper wrapper + MRIStepInnerStepper inner_stepper = NULL; // inner stepper + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) return 1; + + // Set up slow MRIStep integrator + void* mristep_mem = NULL; + if (imex) { mristep_mem = MRIStepCreate(fe, fi, T0, y, inner_stepper, ctx); } + else if (implicit) + { + mristep_mem = MRIStepCreate(NULL, fn, T0, y, inner_stepper, ctx); + } + else { mristep_mem = MRIStepCreate(fn, NULL, T0, y, inner_stepper, ctx); } + if (check_retval((void*)mristep_mem, "MRIStepCreate", 0)) return 1; + MRIStepCoupling C = MRIStepCoupling_LoadTableByName(method.c_str()); + if (check_retval((void*)C, "MRIStepCoupling_LoadTableByName", 0)) return 1; + retval = MRIStepSetCoupling(mristep_mem, C); + if (check_retval(&retval, "MRIStepSetCoupling", 1)) return 1; + SUNMatrix A = NULL; // matrix for slow solver + SUNLinearSolver LS = NULL; // slow linear solver object + if (implicit) + { + A = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)A, "SUNDenseMatrix", 0)) return 1; + LS = SUNLinSol_Dense(y, A, ctx); + if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) return 1; + retval = ARKodeSetLinearSolver(mristep_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return 1; + if (imex) { retval = ARKodeSetJacFn(mristep_mem, Ji); } + else { retval = ARKodeSetJacFn(mristep_mem, Jn); } + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + retval = ARKodeSetJacEvalFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(mristep_mem, 50); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + } + retval = ARKodeSStolerances(mristep_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetUserData(mristep_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(mristep_mem, ARK_ACCUMERROR_MAX); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + + // Run test for various H values + sunrealtype hmax = (Tf - T0) / 20.0 / udata.Npart; + vector<sunrealtype> Hvals(5); + for (size_t i = 0; i < Hvals.size(); i++) + { + Hvals[i] = hmax / SUNRpowerI(SUN_RCONST(4.0), (int)i); + } + retval = run_test(mristep_mem, arkode_ref, y, T0, Tf, yref, Hvals, method, + reltol, abstol, udata); + if (check_retval(&retval, "run_test", 1)) return 1; + + // Clean up and return + MRIStepCoupling_Free(C); + ARKodeFree(&arkode_ref); + ARKodeFree(&inner_arkode_mem); + MRIStepInnerStepper_Free(&inner_stepper); + ARKodeFree(&mristep_mem); + if (LS) { SUNLinSolFree(LS); } // free system linear solver + if (A) { SUNMatDestroy(A); } // free system matrix + N_VDestroy(y); // Free y and yref vectors + N_VDestroyVectorArray(yref, udata.Npart + 1); + return 0; +} + +//------------------------------ +// Functions called by the solver +//------------------------------ + +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + // fill in the RHS function with zeros and return with success + N_VConst(ZERO, ydot); + return 0; +} + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function + dydata[0] = udata->a - (w + ONE) * u + v * u * u; + dydata[1] = w * u - v * u * u; + dydata[2] = (udata->b - w) / udata->ep - w * u; + + // Return with success + return 0; +} + +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype w = ydata[2]; + + // fill in the RHS function + dydata[0] = ZERO; + dydata[1] = ZERO; + dydata[2] = (udata->b - w) / udata->ep - w * u; + + // Return with success + return 0; +} + +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the RHS function + dydata[0] = udata->a - (w + ONE) * u + v * u * u; + dydata[1] = w * u - v * u * u; + dydata[2] = ZERO; + + // Return with success + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype v = ydata[1]; + const sunrealtype w = ydata[2]; + + // fill in the Jacobian + SM_ELEMENT_D(J, 0, 0) = -(w + ONE) + TWO * u * v; + SM_ELEMENT_D(J, 0, 1) = u * u; + SM_ELEMENT_D(J, 0, 2) = -u; + + SM_ELEMENT_D(J, 1, 0) = w - TWO * u * v; + SM_ELEMENT_D(J, 1, 1) = -u * u; + SM_ELEMENT_D(J, 1, 2) = u; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -ONE / udata->ep - u; + + // Return with success + return 0; +} + +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; // access solution values + const sunrealtype w = ydata[2]; + + // fill in the Jacobian + SM_ELEMENT_D(J, 0, 0) = ZERO; + SM_ELEMENT_D(J, 0, 1) = ZERO; + SM_ELEMENT_D(J, 0, 2) = ZERO; + + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + SM_ELEMENT_D(J, 1, 2) = ZERO; + + SM_ELEMENT_D(J, 2, 0) = -w; + SM_ELEMENT_D(J, 2, 1) = ZERO; + SM_ELEMENT_D(J, 2, 2) = -ONE / udata->ep - u; + + // Return with success + return 0; +} + +//------------------------------ +// Private helper functions +//------------------------------ + +static int run_test(void* mristep_mem, void* arkode_ref, N_Vector y, + sunrealtype T0, sunrealtype Tf, N_Vector* yref, + vector<sunrealtype> Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata) +{ + // Reused variables + int retval; + sunrealtype hpart = (Tf - T0) / udata.Npart; + sunrealtype t, t2; + N_Vector y2 = N_VClone(y); + N_Vector ele = N_VClone(y); + N_Vector ewt = N_VClone(y); + N_Vector vtemp = N_VClone(y); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* y2data = N_VGetArrayPointer(y2); + + // Set storage for errors + vector<vector<sunrealtype>> dsm(Hvals.size(), + vector<sunrealtype>(udata.Npart, ZERO)); + vector<vector<sunrealtype>> dsm_est(Hvals.size(), + vector<sunrealtype>(udata.Npart, ZERO)); + + // Loop over step sizes + for (size_t iH = 0; iH < Hvals.size(); iH++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrators for this run + t = t2 = T0 + ipart * hpart; + N_VScale(ONE, yref[ipart], y); + retval = ARKodeReset(mristep_mem, t, y); + if (check_retval(&retval, "ARKodeReset", 1)) return 1; + retval = ARKodeSetFixedStep(mristep_mem, Hvals[iH]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeResetAccumulatedError(mristep_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + N_VScale(ONE, yref[ipart], y2); + retval = ARKodeReset(arkode_ref, t2, y2); + if (check_retval(&retval, "ARKodeReset", 1)) return 1; + retval = ARKodeSetStopTime(arkode_ref, t2 + Hvals[iH]); + if (check_retval(&retval, "ARKodeSetStopTime", 1)) return 1; + + // Run ERKStep to compute reference solution, and MRIStep to compute one step + retval = ARKodeEvolve(arkode_ref, t2 + Hvals[iH], y2, &t2, ARK_NORMAL); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + retval = ARKodeEvolve(mristep_mem, t + Hvals[iH], y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + retval = ARKodeGetEstLocalErrors(mristep_mem, ele); + if (check_retval(&retval, "ARKodeGetEstLocalErrors", 1)) return 1; + retval = computeErrorWeights(y, ewt, reltol, abstol, vtemp); + if (check_retval(&retval, "computeErrorWeights", 1)) return 1; + dsm_est[iH][ipart] = N_VWrmsNorm(ewt, ele); + + // Compute/print solution error + sunrealtype udsm = abs(ydata[0] - y2data[0]) / + (abstol + reltol * abs(y2data[0])); + sunrealtype vdsm = abs(ydata[1] - y2data[1]) / + (abstol + reltol * abs(y2data[1])); + sunrealtype wdsm = abs(ydata[2] - y2data[2]) / + (abstol + reltol * abs(y2data[2])); + dsm[iH][ipart] = + sqrt((udsm * udsm + vdsm * vdsm + wdsm * wdsm) / SUN_RCONST(3.0)); + cout << " H " << Hvals[iH] << " method " << method << " t " << t + << " dsm " << dsm[iH][ipart] << " dsm_est " << dsm_est[iH][ipart] + << endl; + } + } + + cout << endl << method << " summary:" << endl; + for (size_t iH = 0; iH < Hvals.size(); iH++) + { + cout << " Stepsize " << Hvals[iH] << " \tmaxdsm " + << *max_element(dsm[iH].begin(), dsm[iH].end()) << " \tmaxdsmest " + << *max_element(dsm_est[iH].begin(), dsm_est[iH].end()) << endl; + } + + N_VDestroy(ele); + N_VDestroy(ewt); + N_VDestroy(vtemp); + N_VDestroy(y2); + return (0); +} + +/* Error weight calculation routine (mimics what's in ARKODE already) */ +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp) +{ + N_VAbs(ycur, vtemp); + N_VScale(rtol, vtemp, vtemp); + N_VAddConst(vtemp, atol, vtemp); + N_VInv(vtemp, weight); + return (0); +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a retval so check if + retval >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* returnvalue, const char* funcname, int opt) +{ + int* retval; + + // Check if SUNDIALS function returned NULL pointer - no memory allocated + if (opt == 0 && returnvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + // Check if retval < 0 + else if (opt == 1) + { + retval = (int*)returnvalue; + if (*retval < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *retval); + return 1; + } + } + + // Check if function returned NULL pointer - no memory allocated + else if (opt == 2 && returnvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.out b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.out new file mode 100644 index 0000000000..80f4ea9e89 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_brusselator.out @@ -0,0 +1,114 @@ + +Slow error estimation test (stiff Brusselator ODE problem): + time domain: (0,10] + partition size = 20 + initial conditions: u0 = 1.2, v0 = 3.1, w0 = 3 + problem parameters: a = 1, b = 3.5, ep = 0.0004 + MRI method: ARKODE_MRI_GARK_ERK33a (explicit) + H 0.025 method ARKODE_MRI_GARK_ERK33a t 0.025 dsm 3.18615e+13 dsm_est 2.87651e+09 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 0.525 dsm 837.406 dsm_est 1222.98 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 1.025 dsm 2348.79 dsm_est 726.699 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 1.525 dsm 7973.51 dsm_est 2607.8 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 2.025 dsm 9623.78 dsm_est 2984.3 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 2.525 dsm 8578.19 dsm_est 2152.09 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 3.025 dsm 1758.42 dsm_est 2231.61 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 3.525 dsm 6231.49 dsm_est 2031.06 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 4.025 dsm 581.953 dsm_est 611.637 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 4.525 dsm 18745.1 dsm_est 4370.47 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 5.025 dsm 1260.35 dsm_est 475.824 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 5.525 dsm 883.239 dsm_est 2069.94 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 6.025 dsm 1948.31 dsm_est 14304.8 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 6.525 dsm 61433.5 dsm_est 330405 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 7.025 dsm 742189 dsm_est 1.51629e+06 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 7.525 dsm 9668.21 dsm_est 19961.4 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 8.025 dsm 893.005 dsm_est 6498.9 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 8.525 dsm 844.884 dsm_est 2277.18 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 9.025 dsm 810.509 dsm_est 10912.2 + H 0.025 method ARKODE_MRI_GARK_ERK33a t 9.525 dsm 1454.42 dsm_est 10680.6 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 0.00625 dsm 4.33933e+11 dsm_est 1.53179e+09 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 0.50625 dsm 12.1853 dsm_est 19.2231 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 1.00625 dsm 32.4451 dsm_est 11.3701 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 1.50625 dsm 109.586 dsm_est 40.659 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 2.00625 dsm 131.993 dsm_est 46.7335 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 2.50625 dsm 117.719 dsm_est 33.46 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 3.00625 dsm 24.1579 dsm_est 34.5477 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 3.50625 dsm 85.0006 dsm_est 31.747 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 4.00625 dsm 7.95919 dsm_est 9.62849 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 4.50625 dsm 255.567 dsm_est 68.3015 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 5.00625 dsm 17.322 dsm_est 7.33608 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 5.50625 dsm 12.3537 dsm_est 31.9016 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 6.00625 dsm 25.1474 dsm_est 221.476 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 6.50625 dsm 230.645 dsm_est 5222.75 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 7.00625 dsm 3236.88 dsm_est 24290.4 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 7.50625 dsm 116.715 dsm_est 305.487 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 8.00625 dsm 11.908 dsm_est 101.68 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 8.50625 dsm 13.9795 dsm_est 36.3543 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 9.00625 dsm 10.4298 dsm_est 164.536 + H 0.00625 method ARKODE_MRI_GARK_ERK33a t 9.50625 dsm 18.0339 dsm_est 165.001 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 0.0015625 dsm 4.30937e+09 dsm_est 1.04109e+09 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 0.501563 dsm 0.124019 dsm_est 0.300808 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 1.00156 dsm 0.4016 dsm_est 0.177725 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 1.50156 dsm 1.08417 dsm_est 0.634969 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 2.00156 dsm 1.63593 dsm_est 0.730609 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 2.50156 dsm 1.21684 dsm_est 0.522198 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 3.00156 dsm 0.297567 dsm_est 0.53854 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 3.50156 dsm 0.843901 dsm_est 0.496086 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 4.00156 dsm 0.0984505 dsm_est 0.150722 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 4.50156 dsm 3.172 dsm_est 1.06726 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 5.00156 dsm 0.177227 dsm_est 0.114246 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 5.50156 dsm 0.153004 dsm_est 0.496739 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 6.00156 dsm 0.2503 dsm_est 3.45242 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 6.50156 dsm 0.94962 dsm_est 81.8018 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 7.00156 dsm 12.9921 dsm_est 381.512 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 7.50156 dsm 1.43794 dsm_est 4.74552 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 8.00156 dsm 0.120488 dsm_est 1.58917 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 8.50156 dsm 0.179682 dsm_est 0.571046 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 9.00156 dsm 0.118533 dsm_est 2.54788 + H 0.0015625 method ARKODE_MRI_GARK_ERK33a t 9.50156 dsm 0.220342 dsm_est 2.57065 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 0.000390625 dsm 2.73843e+07 dsm_est 2.97866e+07 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 0.500391 dsm 0.00068624 dsm_est 0.00470174 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 1.00039 dsm 0.00193295 dsm_est 0.00277739 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 1.50039 dsm 0.00652841 dsm_est 0.00992044 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 2.00039 dsm 0.007873 dsm_est 0.0114169 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 2.50039 dsm 0.00699861 dsm_est 0.00815712 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 3.00039 dsm 0.00143196 dsm_est 0.00840977 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 3.50039 dsm 0.00507095 dsm_est 0.00775185 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 4.00039 dsm 0.000473415 dsm_est 0.00235627 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 4.50039 dsm 0.0152604 dsm_est 0.0166753 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 5.00039 dsm 0.00103306 dsm_est 0.00178339 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 5.50039 dsm 0.000737914 dsm_est 0.00775519 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 6.00039 dsm 0.00150366 dsm_est 0.0539128 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 6.50039 dsm 0.00386116 dsm_est 1.27888 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 7.00039 dsm 0.0511055 dsm_est 5.9684 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 7.50039 dsm 0.00692078 dsm_est 0.074038 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 8.00039 dsm 0.000733274 dsm_est 0.0248325 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 8.50039 dsm 0.000872554 dsm_est 0.00893449 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 9.00039 dsm 0.000620849 dsm_est 0.0397209 + H 0.000390625 method ARKODE_MRI_GARK_ERK33a t 9.50039 dsm 0.00105929 dsm_est 0.0401369 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 9.76563e-05 dsm 130431 dsm_est 498019 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 0.500098 dsm 3.22403e-06 dsm_est 7.35991e-05 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 1.0001 dsm 8.76951e-06 dsm_est 4.34727e-05 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 1.5001 dsm 2.85184e-05 dsm_est 0.000154848 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 2.0001 dsm 3.58103e-05 dsm_est 0.000178405 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 2.5001 dsm 3.14166e-05 dsm_est 0.000127273 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 3.0001 dsm 6.6836e-06 dsm_est 0.000131134 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 3.5001 dsm 2.19334e-05 dsm_est 0.000121472 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 4.0001 dsm 1.46115e-06 dsm_est 3.65453e-05 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 4.5001 dsm 6.79441e-05 dsm_est 0.000260953 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 5.0001 dsm 4.63814e-06 dsm_est 2.73436e-05 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 5.5001 dsm 3.99263e-06 dsm_est 0.000121193 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 6.0001 dsm 7.38533e-06 dsm_est 0.000842724 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 6.5001 dsm 1.91204e-05 dsm_est 0.0199852 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 7.0001 dsm 0.00020015 dsm_est 0.0932838 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 7.5001 dsm 3.17543e-05 dsm_est 0.00115569 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 8.0001 dsm 4.92456e-06 dsm_est 0.000387364 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 8.5001 dsm 3.86449e-06 dsm_est 0.000139579 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 9.0001 dsm 3.70097e-06 dsm_est 0.000619442 + H 9.76563e-05 method ARKODE_MRI_GARK_ERK33a t 9.5001 dsm 3.7359e-06 dsm_est 0.000626912 + +ARKODE_MRI_GARK_ERK33a summary: + Stepsize 0.025 maxdsm 3.18615e+13 maxdsmest 2.87651e+09 + Stepsize 0.00625 maxdsm 4.33933e+11 maxdsmest 1.53179e+09 + Stepsize 0.0015625 maxdsm 4.30937e+09 maxdsmest 1.04109e+09 + Stepsize 0.000390625 maxdsm 2.73843e+07 maxdsmest 2.97866e+07 + Stepsize 9.76563e-05 maxdsm 130431 maxdsmest 498019 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.cpp new file mode 100644 index 0000000000..a7346214c4 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.cpp @@ -0,0 +1,576 @@ +/* ---------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + * ---------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ---------------------------------------------------------------- + * Routine to test an MRI method's embedding-based error + * estimate. Uses a nonlinear Kvaerno-Prothero-Robinson ODE test + * problem with analytical solution, + * + * [u]' = [ G e ] [(u^2-p-1)/(2u)] + [ p'(t)/(2u) ] + * [v] [ e -1 ] [(v^2-q-2)/(2v)] [ q'(t)/(2v) ] + * + * where p(t) = cos(t), and q(t) = cos(omega*t*(1+exp(-(t-2)^2))). + * This problem has analytical solution given by + * u(t) = sqrt(2+p(t)), v(t) = sqrt(2+q(t)). + * We use the parameters: e = 0.1 and G = -10 [default] + * + * The stiffness of the problem is essentially determined + * by G, for |G| > 50 it is "stiff" and ideally suited to an + * implicit method. + * + * Coupling between the two components is determined by e, with + * coupling strength proportional to |e|. + * + * The "fast" variable, v, oscillates at a frequency "omega" times + * faster than u. + * + * We partition the full time integration interval, 0 < t < 5, into + * Npart pieces. We then run a single time step starting at the + * beginning of each partition, using a variety of slow step sizes, + * H = {hmax, hmax/4, hmax/16, hmax/64, hmax/256} with + * hmax=(t_f-t_0)/20/Npart. + * + * We place the entire ODE in the "slow" RHS partition. For IMEX + * methods, the first row is treated implicitly, and the second is + * treated explicitly. For the fast time scale, all tests use + * ARKODE's default fifth-order ERK method, with relative and + * absolute tolerances set to 1e-10 and 1e-12, respectively. + * + * We select the slow integrator based on a command-line argument, + * with the default being ARKODE_MRI_GARK_ERK33a. + * + * The program should be run with arguments in the following order: + * $ a.out method Npart G e omega + * Not all arguments are required, but these must be omitted from + * end-to-beginning, i.e. any one of + * $ a.out method Npart G e + * $ a.out method Npart G + * $ a.out method Npart + * $ a.out method + * $ a.out + * are acceptable. We require: + * * method = string corresponding to a valid embedded ARKODE_MRITableID + * * Npart > 0 + * * G < 0.0 + * * omega > 0.0 + * ----------------------------------------------------------------*/ + +// Header files +#include <algorithm> +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_mristep.h> +#include <cmath> +#include <iostream> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <string.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> +#include <sunmatrix/sunmatrix_dense.h> +#include <vector> + +#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 + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +using namespace std; + +// User data structure +struct UserData +{ + sunrealtype G; + sunrealtype e; + sunrealtype omega; + int Npart; +}; + +// User-supplied functions called by the solver +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Private utility functions +static sunrealtype p(sunrealtype t); +static sunrealtype q(sunrealtype t, UserData& udata); +static sunrealtype pdot(sunrealtype t); +static sunrealtype qdot(sunrealtype t, UserData& udata); +static sunrealtype utrue(sunrealtype t); +static sunrealtype vtrue(sunrealtype t, UserData& udata); +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata); +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp); +static int check_retval(void* returnvalue, const char* funcname, int opt); +static int run_test(void* mristep_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, vector<sunrealtype> Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata); + +// Main Program +int main(int argc, char* argv[]) +{ + // general problem parameters + sunrealtype T0 = SUN_RCONST(0.0); // initial time + sunrealtype Tf = SUN_RCONST(5.0); // final time + sunindextype NEQ = 2; // number of dependent vars. + string method; // MRI method name + sunrealtype reltol = SUN_RCONST(1.e-10); // fast solver tolerances + sunrealtype abstol = SUN_RCONST(1.e-12); + + // general problem variables + int retval; // reusable error-checking flag + UserData udata; // user-data structure + udata.G = SUN_RCONST(-10.0); // stiffness parameter + udata.e = SUN_RCONST(0.1); // coupling strength + udata.omega = SUN_RCONST(5.0); // time scale ratio + udata.Npart = 20; // partition size + + // + // Initialization + // + + // Retrieve the command-line options: method Npart G e omega + if (argc > 1) { method = argv[1]; } + else { method = "ARKODE_MRI_GARK_ERK33a"; } + if (argc > 2) udata.Npart = atoi(argv[2]); + if (argc > 3) udata.G = SUNStrToReal(argv[3]); + if (argc > 4) udata.e = SUNStrToReal(argv[4]); + if (argc > 5) udata.omega = SUNStrToReal(argv[5]); + + // Check arguments for validity + // G < 0.0 + // omega > 0.0 + // Npart > 0 + if (udata.G >= ZERO) + { + cerr << "ERROR: G must be a negative real number\n"; + return (-1); + } + if (udata.omega <= ZERO) + { + cerr << "ERROR: omega must be a positive real number\n"; + return (-1); + } + if (udata.Npart < 1) + { + cerr << "ERROR: Npart must be a positive integer\n"; + return (-1); + } + + sunbooleantype implicit = SUNFALSE; + sunbooleantype imex = SUNFALSE; + if ((method == "ARKODE_MRI_GARK_IRK21a") || + (method == "ARKODE_MRI_GARK_ESDIRK34a") || + (method == "ARKODE_MRI_GARK_ESDIRK46a")) + { + implicit = SUNTRUE; + } + if ((method == "ARKODE_IMEX_MRI_SR21") || + (method == "ARKODE_IMEX_MRI_SR32") || (method == "ARKODE_IMEX_MRI_SR43")) + { + imex = SUNTRUE; + implicit = SUNTRUE; + } + + // Initial problem output (and set implicit solver tolerances as needed) + cout << "\nSlow error estimation test (Nonlinear Kvaerno-Prothero-Robinson " + "problem):\n"; + cout << " time domain: (" << T0 << "," << Tf << "]\n"; + cout << " partition size = " << udata.Npart << endl; + cout << " problem parameters: G = " << udata.G << ", e = " << udata.e + << ", omega = " << udata.omega << endl; + cout << " MRI method: " << method; + if (imex) { cout << " (ImEx)" << endl; } + else if (implicit) { cout << " (implicit)" << endl; } + else { cout << " (explicit)" << endl; } + + // + // Problem Setup + // + + // Create SUNDIALS context + sundials::Context ctx; + + // Create and initialize serial vector for the solution + N_Vector y = N_VNew_Serial(NEQ, ctx); + if (check_retval((void*)y, "N_VNew_Serial", 0)) return 1; + retval = Ytrue(T0, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + + // Set up fast ERKStep integrator as fifth-order adaptive method + void* inner_arkode_mem = ERKStepCreate(f0, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ERKStepCreate", 0)) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + + // Create inner stepper wrapper + MRIStepInnerStepper inner_stepper = NULL; // inner stepper + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) return 1; + + // Set up slow MRIStep integrator + void* mristep_mem = NULL; + if (imex) { mristep_mem = MRIStepCreate(fe, fi, T0, y, inner_stepper, ctx); } + else if (implicit) + { + mristep_mem = MRIStepCreate(NULL, fn, T0, y, inner_stepper, ctx); + } + else { mristep_mem = MRIStepCreate(fn, NULL, T0, y, inner_stepper, ctx); } + if (check_retval((void*)mristep_mem, "MRIStepCreate", 0)) return 1; + MRIStepCoupling C = MRIStepCoupling_LoadTableByName(method.c_str()); + if (check_retval((void*)C, "MRIStepCoupling_LoadTableByName", 0)) return 1; + retval = MRIStepSetCoupling(mristep_mem, C); + if (check_retval(&retval, "MRIStepSetCoupling", 1)) return 1; + SUNMatrix A = NULL; // matrix for slow solver + SUNLinearSolver LS = NULL; // slow linear solver object + if (implicit) + { + A = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)A, "SUNDenseMatrix", 0)) return 1; + LS = SUNLinSol_Dense(y, A, ctx); + if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) return 1; + retval = ARKodeSetLinearSolver(mristep_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return 1; + if (imex) { retval = ARKodeSetJacFn(mristep_mem, Ji); } + else { retval = ARKodeSetJacFn(mristep_mem, Jn); } + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + retval = ARKodeSetJacEvalFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(mristep_mem, 50); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + } + retval = ARKodeSStolerances(mristep_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetUserData(mristep_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(mristep_mem, ARK_ACCUMERROR_MAX); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + + // Run test for various H values + sunrealtype hmax = (Tf - T0) / 20 / udata.Npart; + vector<sunrealtype> Hvals(5); + for (size_t i = 0; i < Hvals.size(); i++) + { + Hvals[i] = hmax / SUNRpowerI(SUN_RCONST(4.0), (int)i); + } + retval = run_test(mristep_mem, y, T0, Tf, Hvals, method, reltol, abstol, udata); + if (check_retval(&retval, "run_test", 1)) return 1; + + // Clean up and return + MRIStepCoupling_Free(C); + ARKodeFree(&inner_arkode_mem); + MRIStepInnerStepper_Free(&inner_stepper); + ARKodeFree(&mristep_mem); + if (LS) { SUNLinSolFree(LS); } // free system linear solver + if (A) { SUNMatDestroy(A); } // free system matrix + N_VDestroy(y); // Free y vector + return 0; +} + +//------------------------------ +// Functions called by the solver +//------------------------------ + +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + // fill in the RHS function with zeros and return with success + N_VConst(ZERO, ydot); + return 0; +} + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [G e]*[(-2+u^2-p(t))/(2*u)] + [pdot(t)/(2u)] + // [e -1] [(-2+v^2-s(t))/(2*v)] [qdot(t)/(2v)] + tmp1 = (-TWO + u * u - p(t)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *udata)) / (TWO * v); + dydata[0] = udata->G * tmp1 + udata->e * tmp2 + pdot(t) / (TWO * u); + dydata[1] = udata->e * tmp1 - tmp2 + qdot(t, *udata) / (TWO * v); + + // Return with success + return 0; +} + +static int fi(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [G e]*[(-2+u^2-p(t))/(2*u)] + [pdot(t)/(2u)] + // [0 0] [(-2+v^2-s(t))/(2*v)] [ 0 ] + tmp1 = (-TWO + u * u - p(t)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *udata)) / (TWO * v); + dydata[0] = udata->G * tmp1 + udata->e * tmp2 + pdot(t) / (TWO * u); + dydata[1] = ZERO; + + // Return with success + return 0; +} + +static int fe(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* dydata = N_VGetArrayPointer(ydot); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype tmp1, tmp2; + + // fill in the RHS function: + // [0 0]*[(-2+u^2-p(t))/(2*u)] + [ 0 ] + // [e -1] [(-2+v^2-s(t))/(2*v)] [qdot(t)/(2v)] + tmp1 = (-TWO + u * u - p(t)) / (TWO * u); + tmp2 = (-TWO + v * v - q(t, *udata)) / (TWO * v); + dydata[0] = ZERO; + dydata[1] = udata->e * tmp1 - tmp2 + qdot(t, *udata) / (TWO * v); + + // Return with success + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + sunrealtype t11, t22; + + // fill in the Jacobian: + // [G e]*[1-(u^2-p(t)-2)/(2*u^2), 0] + [-p'(t)/(2*u^2), 0] + // [e -1] [0, 1-(v^2-q(t)-2)/(2*v^2)] [0, -q'(t)/(2*v^2)] + t11 = ONE - (u * u - p(t) - TWO) / (TWO * u * u); + t22 = ONE - (v * v - q(t, *udata) - TWO) / (TWO * v * v); + SM_ELEMENT_D(J, 0, 0) = udata->G * t11 - pdot(t) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = udata->e * t22; + SM_ELEMENT_D(J, 1, 0) = udata->e * t11; + SM_ELEMENT_D(J, 1, 1) = -t22 - qdot(t, *udata) / (TWO * v * v); + + // Return with success + return 0; +} + +static int Ji(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* ydata = N_VGetArrayPointer(y); + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + // fill in the Jacobian: + // [G/2 + (G*(1+p(t))-pdot(t))/(2*u^2) e/2+e*(2+s(t))/(2*v^2)] + // [ 0 0 ] + SM_ELEMENT_D(J, 0, 0) = udata->G / TWO + + (udata->G * (ONE + p(t)) - pdot(t)) / (TWO * u * u); + SM_ELEMENT_D(J, 0, 1) = udata->e / TWO + + udata->e * (TWO + q(t, *udata)) / (TWO * v * v); + SM_ELEMENT_D(J, 1, 0) = ZERO; + SM_ELEMENT_D(J, 1, 1) = ZERO; + + // Return with success + return 0; +} + +//------------------------------ +// Private helper functions +//------------------------------ + +static int run_test(void* mristep_mem, N_Vector y, sunrealtype T0, + sunrealtype Tf, vector<sunrealtype> Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata) +{ + // Reused variables + int retval; + sunrealtype hpart = (Tf - T0) / udata.Npart; + sunrealtype t; + N_Vector ele = N_VClone(y); + N_Vector ewt = N_VClone(y); + N_Vector vtemp = N_VClone(y); + sunrealtype* ydata = N_VGetArrayPointer(y); + + // Set storage for errors + vector<vector<sunrealtype>> dsm(Hvals.size(), + vector<sunrealtype>(udata.Npart, ZERO)); + vector<vector<sunrealtype>> dsm_est(Hvals.size(), + vector<sunrealtype>(udata.Npart, ZERO)); + + // Loop over step sizes + for (size_t iH = 0; iH < Hvals.size(); iH++) + { + // Loop over partition + for (int ipart = 0; ipart < udata.Npart; ipart++) + { + // Reset integrator for this run + t = T0 + ipart * hpart; + retval = Ytrue(t, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + retval = ARKodeReset(mristep_mem, t, y); + if (check_retval(&retval, "ARKodeReset", 1)) return 1; + retval = ARKodeSetFixedStep(mristep_mem, Hvals[iH]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeResetAccumulatedError(mristep_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + + // Run ARKodeEvolve to compute one step + retval = ARKodeEvolve(mristep_mem, t + Hvals[iH], y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + retval = ARKodeGetEstLocalErrors(mristep_mem, ele); + if (check_retval(&retval, "ARKodeGetEstLocalErrors", 1)) return 1; + retval = computeErrorWeights(y, ewt, reltol, abstol, vtemp); + if (check_retval(&retval, "computeErrorWeights", 1)) return 1; + dsm_est[iH][ipart] = N_VWrmsNorm(ewt, ele); + + // Compute/print solution error + sunrealtype udsm = abs(ydata[0] - utrue(t)) / + (abstol + reltol * abs(utrue(t))); + sunrealtype vdsm = abs(ydata[1] - vtrue(t, udata)) / + (abstol + reltol * abs(vtrue(t, udata))); + dsm[iH][ipart] = sqrt(0.5 * (udsm * udsm + vdsm * vdsm)); + cout << " H " << Hvals[iH] << " method " << method << " t " << t + << " dsm " << dsm[iH][ipart] << " dsm_est " << dsm_est[iH][ipart] + << endl; + } + } + + cout << endl << method << " summary:" << endl; + for (size_t iH = 0; iH < Hvals.size(); iH++) + { + cout << " Stepsize " << Hvals[iH] << " \tmaxdsm " + << *max_element(dsm[iH].begin(), dsm[iH].end()) << " \tmaxdsmest " + << *max_element(dsm_est[iH].begin(), dsm_est[iH].end()) << endl; + } + + N_VDestroy(ele); + N_VDestroy(ewt); + N_VDestroy(vtemp); + return (0); +} + +static sunrealtype p(sunrealtype t) { return (cos(t)); } + +static sunrealtype q(sunrealtype t, UserData& udata) +{ + return (cos(udata.omega * t * (ONE + exp(-(t - 2) * (t - 2))))); +} + +static sunrealtype pdot(sunrealtype t) { return (-sin(t)); } + +static sunrealtype qdot(sunrealtype t, UserData& udata) +{ + return (-sin(udata.omega * t * (ONE + exp(-(t - 2) * (t - 2)))) * udata.omega * + (ONE + exp(-(t - 2) * (t - 2)) - + t * 2 * (t - 2) * (exp(-(t - 2) * (t - 2))))); +} + +static sunrealtype utrue(sunrealtype t) { return (SUNRsqrt(TWO + p(t))); } + +static sunrealtype vtrue(sunrealtype t, UserData& udata) +{ + return (SUNRsqrt(TWO + q(t, udata))); +} + +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue(t); + ydata[1] = vtrue(t, udata); + return (0); +} + +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp) +{ + N_VAbs(ycur, vtemp); + N_VScale(rtol, vtemp, vtemp); + N_VAddConst(vtemp, atol, vtemp); + N_VInv(vtemp, weight); + return (0); +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a retval so check if + retval < 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* returnvalue, const char* funcname, int opt) +{ + int* retval; + + // Check if SUNDIALS function returned NULL pointer - no memory allocated + if (opt == 0 && returnvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + // Check if retval < 0 + else if (opt == 1) + { + retval = (int*)returnvalue; + if (*retval < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *retval); + return 1; + } + } + + // Check if function returned NULL pointer - no memory allocated + else if (opt == 2 && returnvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +//---- end of file ---- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.out b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.out new file mode 100644 index 0000000000..87e6b5cc1e --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_kpr.out @@ -0,0 +1,113 @@ + +Slow error estimation test (Nonlinear Kvaerno-Prothero-Robinson problem): + time domain: (0,5] + partition size = 20 + problem parameters: G = -10, e = 0.1, omega = 5 + MRI method: ARKODE_MRI_GARK_ERK33a (explicit) + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 0.0125 dsm 59.7276 dsm_est 727.532 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 0.2625 dsm 159.194 dsm_est 4712.03 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 0.5125 dsm 496.974 dsm_est 33493.8 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 0.7625 dsm 712.688 dsm_est 32624.2 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 1.0125 dsm 1224.36 dsm_est 1716.11 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 1.2625 dsm 5167.32 dsm_est 267128 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 1.5125 dsm 4827.92 dsm_est 54878.4 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 1.7625 dsm 13680.4 dsm_est 176534 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 2.0125 dsm 130.837 dsm_est 49597.7 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 2.2625 dsm 162.492 dsm_est 34976.3 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 2.5125 dsm 287.688 dsm_est 7113.08 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 2.7625 dsm 382.02 dsm_est 4317.48 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 3.0125 dsm 301.235 dsm_est 4949.38 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 3.2625 dsm 258.571 dsm_est 2977.9 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 3.5125 dsm 218.068 dsm_est 1269.3 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 3.7625 dsm 162.764 dsm_est 1320.67 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 4.0125 dsm 130.736 dsm_est 2369.28 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 4.2625 dsm 20.6137 dsm_est 12728.2 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 4.5125 dsm 176.78 dsm_est 15676.7 + H 0.0125 method ARKODE_MRI_GARK_ERK33a t 4.7625 dsm 90.7369 dsm_est 3719.41 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 0.003125 dsm 0.232651 dsm_est 10.9877 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 0.253125 dsm 0.594785 dsm_est 70.8981 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 0.503125 dsm 1.46693 dsm_est 527.764 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 0.753125 dsm 2.86452 dsm_est 520.741 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 1.00313 dsm 4.48531 dsm_est 12.8296 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 1.25313 dsm 37.2232 dsm_est 3954.15 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 1.50313 dsm 17.7805 dsm_est 786.062 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 1.75313 dsm 58.1561 dsm_est 2999.34 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 2.00312 dsm 0.615846 dsm_est 764.348 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 2.25312 dsm 0.208735 dsm_est 542.352 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 2.50312 dsm 1.15342 dsm_est 106.225 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 2.75312 dsm 1.54621 dsm_est 59.6688 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 3.00312 dsm 1.18391 dsm_est 80.2941 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 3.25312 dsm 1.00984 dsm_est 46.1362 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 3.50312 dsm 0.853892 dsm_est 19.4476 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 3.75312 dsm 0.637603 dsm_est 20.4096 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 4.00312 dsm 0.50676 dsm_est 35.5067 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 4.25312 dsm 0.0997811 dsm_est 197.159 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 4.50312 dsm 0.602658 dsm_est 244.1 + H 0.003125 method ARKODE_MRI_GARK_ERK33a t 4.75312 dsm 0.3657 dsm_est 59.8484 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 0.00078125 dsm 0.000906789 dsm_est 0.1702 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 0.250781 dsm 0.00229725 dsm_est 1.09748 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 0.500781 dsm 0.00528907 dsm_est 8.25834 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 0.750781 dsm 0.0112664 dsm_est 8.18019 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 1.00078 dsm 0.0172485 dsm_est 0.149038 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 1.25078 dsm 0.162364 dsm_est 60.7616 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 1.50078 dsm 0.0684956 dsm_est 12.019 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 1.75078 dsm 0.231817 dsm_est 47.8533 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 2.00078 dsm 0.00251159 dsm_est 11.9018 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 2.25078 dsm 0.000388484 dsm_est 8.4539 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 2.50078 dsm 0.00453393 dsm_est 1.64038 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 2.75078 dsm 0.00608412 dsm_est 0.901588 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 3.00078 dsm 0.00463348 dsm_est 1.26635 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 3.25078 dsm 0.00394414 dsm_est 0.719303 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 3.50078 dsm 0.00333765 dsm_est 0.302408 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 3.75078 dsm 0.00249229 dsm_est 0.318005 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 4.00078 dsm 0.00197527 dsm_est 0.548996 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 4.25078 dsm 0.000423031 dsm_est 3.07331 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 4.50078 dsm 0.00226465 dsm_est 3.80981 + H 0.00078125 method ARKODE_MRI_GARK_ERK33a t 4.75078 dsm 0.00143499 dsm_est 0.942031 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 0.000195313 dsm 2.85013e-06 dsm_est 0.00265424 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 0.250195 dsm 9.05953e-06 dsm_est 0.0171084 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 0.500195 dsm 2.05759e-05 dsm_est 0.129079 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 0.750195 dsm 4.6605e-05 dsm_est 0.127987 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 1.0002 dsm 6.66547e-05 dsm_est 0.00213263 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 1.2502 dsm 0.000653038 dsm_est 0.945246 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 1.5002 dsm 0.000267427 dsm_est 0.186783 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 1.7502 dsm 0.000909834 dsm_est 0.751614 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 2.0002 dsm 1.02331e-05 dsm_est 0.185807 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 2.2502 dsm 1.54333e-06 dsm_est 0.132009 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 2.5002 dsm 1.7004e-05 dsm_est 0.0255566 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 2.7502 dsm 2.75731e-05 dsm_est 0.0139673 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 3.0002 dsm 1.60122e-05 dsm_est 0.0198318 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 3.2502 dsm 1.59604e-05 dsm_est 0.0112328 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 3.5002 dsm 1.2611e-05 dsm_est 0.00471821 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 3.7502 dsm 1.0072e-05 dsm_est 0.00496521 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 4.0002 dsm 7.64165e-06 dsm_est 0.00855534 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 4.2502 dsm 3.12732e-06 dsm_est 0.0479914 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 4.5002 dsm 6.25467e-06 dsm_est 0.0595107 + H 0.000195313 method ARKODE_MRI_GARK_ERK33a t 4.7502 dsm 1.05712e-05 dsm_est 0.0147462 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 4.88281e-05 dsm 2.01535e-06 dsm_est 4.1115e-05 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 0.250049 dsm 0 dsm_est 0.000267507 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 0.500049 dsm 1.50297e-06 dsm_est 0.00201586 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 0.750049 dsm 1.49086e-06 dsm_est 0.00200068 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 1.00005 dsm 9.78971e-07 dsm_est 3.2652e-05 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 1.25005 dsm 3.17142e-06 dsm_est 0.0147541 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 1.50005 dsm 2.18254e-06 dsm_est 0.0029151 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 1.75005 dsm 2.39243e-06 dsm_est 0.0117588 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 2.00005 dsm 1.0054e-06 dsm_est 0.00290265 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 2.25005 dsm 2.03676e-06 dsm_est 0.00206178 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 2.50005 dsm 3.37798e-06 dsm_est 0.000398446 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 2.75005 dsm 4.72989e-06 dsm_est 0.000217912 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 3.00005 dsm 6.95491e-06 dsm_est 0.000310377 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 3.25005 dsm 1.55004e-06 dsm_est 0.000175458 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 3.50005 dsm 9.19766e-07 dsm_est 7.37004e-05 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 3.75005 dsm 0 dsm_est 7.66833e-05 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 4.00005 dsm 1.08798e-06 dsm_est 0.000134086 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 4.25005 dsm 3.12694e-06 dsm_est 0.000748179 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 4.50005 dsm 1.16508e-06 dsm_est 0.000930348 + H 4.88281e-05 method ARKODE_MRI_GARK_ERK33a t 4.75005 dsm 6.40365e-06 dsm_est 0.000231401 + +ARKODE_MRI_GARK_ERK33a summary: + Stepsize 0.0125 maxdsm 13680.4 maxdsmest 267128 + Stepsize 0.003125 maxdsm 58.1561 maxdsmest 3954.15 + Stepsize 0.00078125 maxdsm 0.231817 maxdsmest 60.7616 + Stepsize 0.000195313 maxdsm 0.000909834 maxdsmest 0.945246 + Stepsize 4.88281e-05 maxdsm 6.95491e-06 maxdsmest 0.0147541 diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.cpp new file mode 100644 index 0000000000..4d9105c163 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.cpp @@ -0,0 +1,414 @@ +/*----------------------------------------------------------------- + * Programmer(s): Daniel R. Reynolds @ SMU + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Routine to test an MRI method's embedding-based error + * estimate. Uses a simple polynomial test problem with 1 + * component, + * dy/dt = a*t^2 + b*t + c, y(0) = 1. + * + * We run a single time step, using a variety of slow step sizes, + * H = {1, 1/2, 1/4, 1/8, 1/16}. + * + * We place the entire ODE in the "slow" RHS partition. All tests + * use ARKODE's default fifth-order ERK method, with relative and + * absolute tolerances set to 1e-10 and 1e-12, respectively. + * + * When using an IMEX method (e.g., IMEX-MRI-SR), the entire slow + * partition is treated implicitly. + * + * We select the slow integrator based on a command-line argument, + * with the default being ARKODE_MRI_GARK_ERK22a. + * + * The program should be run with arguments in the following order: + * $ a.out method a b c + * Not all arguments are required, but these must be omitted from + * end-to-beginning, i.e. any one of + * $ a.out method a b + * $ a.out method a + * $ a.out method + * $ a.out + * are acceptable. We require that the "method" argument be a + * string corresponding to a valid embedded ARKODE_MRITableID. + *-----------------------------------------------------------------*/ + +// Header files +#include <algorithm> +#include <arkode/arkode_arkstep.h> +#include <arkode/arkode_mristep.h> +#include <cmath> +#include <iostream> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <string.h> +#include <sundials/sundials_core.hpp> +#include <sunlinsol/sunlinsol_dense.h> +#include <sunmatrix/sunmatrix_dense.h> +#include <vector> + +#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 + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) + +using namespace std; + +// User data structure +struct UserData +{ + sunrealtype a; + sunrealtype b; + sunrealtype c; +}; + +// User-supplied Functions Called by the Solver +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); + +// Private utility functions +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata); +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp); +static int check_retval(void* returnvalue, const char* funcname, int opt); +static int run_test(void* mristep_mem, N_Vector y, sunrealtype T0, + vector<sunrealtype>& Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata); + +// Main Program +int main(int argc, char* argv[]) +{ + // general problem parameters + sunrealtype T0 = ZERO; // initial time + sunindextype NEQ = 1; // number of dependent vars. + string method; // MRI method name + sunrealtype reltol = SUN_RCONST(1.e-10); // fast solver tolerances + sunrealtype abstol = SUN_RCONST(1.e-12); + + // general problem variables + int retval; // reusable error-checking flag + UserData udata; // user-data structure + + // + // Initialization + // + + // Retrieve the command-line options: method Npart ep test + if (argc > 1) { method = argv[1]; } + else { method = "ARKODE_MRI_GARK_ERK22a"; } + if (argc > 2) { udata.a = SUNStrToReal(argv[2]); } + else { udata.a = ONE; } + if (argc > 3) { udata.b = SUNStrToReal(argv[3]); } + else { udata.b = ONE; } + if (argc > 4) { udata.c = SUNStrToReal(argv[4]); } + else { udata.c = ONE; } + + sunbooleantype implicit = SUNFALSE; + if ((method == "ARKODE_MRI_GARK_IRK21a") || + (method == "ARKODE_MRI_GARK_ESDIRK34a") || + (method == "ARKODE_MRI_GARK_ESDIRK46a") || + (method == "ARKODE_IMEX_MRI_SR21") || + (method == "ARKODE_IMEX_MRI_SR32") || (method == "ARKODE_IMEX_MRI_SR43")) + { + implicit = SUNTRUE; + } + + // Initial problem output (and set implicit solver tolerances as needed) + cout << "\nSlow error estimation test (polynomial ODE problem):\n"; + cout << " problem parameters: a = " << udata.a << ", b = " << udata.b + << ", c = " << udata.c << endl; + cout << " MRI method: " << method; + if (implicit) { cout << " (implicit)" << endl; } + else { cout << " (explicit)" << endl; } + + // + // Problem Setup + // + + // Create SUNDIALS context + sundials::Context ctx; + + // Create serial vectors for the solution and reference + N_Vector y = N_VNew_Serial(NEQ, ctx); + if (check_retval((void*)y, "N_VNew_Serial", 0)) return 1; + retval = Ytrue(T0, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + + // Set up fast ARKStep integrator as fifth-order adaptive ERK + void* inner_arkode_mem = ARKStepCreate(f0, NULL, T0, y, ctx); + if (check_retval((void*)inner_arkode_mem, "ARKStepCreate", 0)) return 1; + retval = ARKodeSetOrder(inner_arkode_mem, 5); + if (check_retval(&retval, "ARKodeSetOrder", 1)) return 1; + retval = ARKodeSStolerances(inner_arkode_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetMaxNumSteps(inner_arkode_mem, 1000000); + if (check_retval(&retval, "ARKodeSetMaxNumSteps", 1)) return (1); + + // Create inner stepper wrapper + MRIStepInnerStepper inner_stepper = NULL; // inner stepper + retval = ARKodeCreateMRIStepInnerStepper(inner_arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) return 1; + + // Set up slow MRIStep integrator + void* mristep_mem = NULL; + if (implicit) + { + mristep_mem = MRIStepCreate(NULL, fn, T0, y, inner_stepper, ctx); + } + else { mristep_mem = MRIStepCreate(fn, NULL, T0, y, inner_stepper, ctx); } + if (check_retval((void*)mristep_mem, "MRIStepCreate", 0)) return 1; + MRIStepCoupling C = MRIStepCoupling_LoadTableByName(method.c_str()); + if (check_retval((void*)C, "MRIStepCoupling_LoadTableByName", 0)) return 1; + retval = MRIStepSetCoupling(mristep_mem, C); + if (check_retval(&retval, "MRIStepSetCoupling", 1)) return 1; + SUNMatrix A = NULL; // matrix for slow solver + SUNLinearSolver LS = NULL; // slow linear solver object + if (implicit) + { + A = SUNDenseMatrix(NEQ, NEQ, ctx); + if (check_retval((void*)A, "SUNDenseMatrix", 0)) return 1; + LS = SUNLinSol_Dense(y, A, ctx); + if (check_retval((void*)LS, "SUNLinSol_Dense", 0)) return 1; + retval = ARKodeSetLinearSolver(mristep_mem, LS, A); + if (check_retval(&retval, "ARKodeSetLinearSolver", 1)) return 1; + retval = ARKodeSetJacFn(mristep_mem, Jn); + if (check_retval(&retval, "ARKodeSetJacFn", 1)) return 1; + retval = ARKodeSetJacEvalFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetJacEvalFrequency", 1)) return 1; + retval = ARKodeSetLSetupFrequency(mristep_mem, 1); + if (check_retval(&retval, "ARKodeSetLSetupFrequency", 1)) return 1; + retval = ARKodeSetMaxNonlinIters(mristep_mem, 20); + if (check_retval(&retval, "ARKodeSetMaxNonlinIters", 1)) return 1; + } + retval = ARKodeSStolerances(mristep_mem, reltol, abstol); + if (check_retval(&retval, "ARKodeSStolerances", 1)) return 1; + retval = ARKodeSetUserData(mristep_mem, (void*)&udata); + if (check_retval(&retval, "ARKodeSetUserData", 1)) return 1; + retval = ARKodeSetAccumulatedErrorType(mristep_mem, ARK_ACCUMERROR_MAX); + if (check_retval(&retval, "ARKodeSetAccumulatedErrorType", 1)) return 1; + + // Run test for various H values + vector<sunrealtype> Hvals(5); + for (size_t i = 0; i < Hvals.size(); i++) + { + Hvals[i] = SUN_RCONST(0.01) / SUNRpowerI(SUN_RCONST(2.0), (int)i); + } + retval = run_test(mristep_mem, y, T0, Hvals, method, reltol, abstol, udata); + if (check_retval(&retval, "run_test", 1)) return 1; + + // Clean up and return + MRIStepCoupling_Free(C); + ARKodeFree(&inner_arkode_mem); + MRIStepInnerStepper_Free(&inner_stepper); + ARKodeFree(&mristep_mem); + if (LS) { SUNLinSolFree(LS); } // free system linear solver + if (A) { SUNMatDestroy(A); } // free system matrix + N_VDestroy(y); // Free y and yref vectors + return 0; +} + +//------------------------------ +// Functions called by the solver +//------------------------------ + +static int f0(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + // fill in the RHS function with zeros and return with success + N_VConst(ZERO, ydot); + return 0; +} + +static int fn(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + // fill in the RHS function and return with success + UserData* udata = (UserData*)user_data; + sunrealtype* dydata = N_VGetArrayPointer(ydot); + dydata[0] = udata->a * t * t + udata->b * t + udata->c; + return 0; +} + +static int Jn(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) +{ + // fill in the Jacobian and return with success + SM_ELEMENT_D(J, 0, 0) = ZERO; + return 0; +} + +//------------------------------ +// Private helper functions +//------------------------------ + +static int run_test(void* mristep_mem, N_Vector y, sunrealtype T0, + vector<sunrealtype>& Hvals, string method, + sunrealtype reltol, sunrealtype abstol, UserData& udata) +{ + // Reused variables + int retval; + sunrealtype t; + N_Vector vtemp = N_VClone(y); + N_Vector ele = N_VClone(y); + N_Vector ewt = N_VClone(y); + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* vdata = N_VGetArrayPointer(vtemp); + + // Set storage for errors + vector<sunrealtype> dsm(Hvals.size(), ZERO); + vector<sunrealtype> dsm_est(Hvals.size(), ZERO); + + // Loop over step sizes + for (size_t iH = 0; iH < Hvals.size(); iH++) + { + // Reset integrator for this run + t = T0; + retval = Ytrue(t, y, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + retval = ARKodeReset(mristep_mem, t, y); + if (check_retval(&retval, "ARKodeReset", 1)) return 1; + retval = ARKodeSetFixedStep(mristep_mem, Hvals[iH]); + if (check_retval(&retval, "ARKodeSetFixedStep", 1)) return 1; + retval = ARKodeResetAccumulatedError(mristep_mem); + if (check_retval(&retval, "ARKodeResetAccumulatedError", 1)) return 1; + + // Run ARKodeEvolve to compute one step + retval = ARKodeEvolve(mristep_mem, t + Hvals[iH], y, &t, ARK_ONE_STEP); + if (check_retval(&retval, "ARKodeEvolve", 1)) return 1; + retval = ARKodeGetEstLocalErrors(mristep_mem, ele); + if (check_retval(&retval, "ARKodeGetEstLocalErrors", 1)) return 1; + retval = computeErrorWeights(y, ewt, reltol, abstol, vtemp); + if (check_retval(&retval, "computeErrorWeights", 1)) return 1; + dsm_est[iH] = N_VWrmsNorm(ewt, ele); + + // Compute/print solution error + retval = Ytrue(t, vtemp, udata); + if (check_retval(&retval, "Ytrue", 1)) return 1; + dsm[iH] = abs(ydata[0] - vdata[0]) / (abstol + reltol * abs(vdata[0])); + if (method == "ARKODE_MRI_GARK_ERK22a") + { + printf(" H %.5f dsm %.2e dsm_est %.2e dsm_anal %.2e " + " dsm_est_anal %.2e\n", + Hvals[iH], dsm[iH], dsm_est[iH], + Hvals[iH] * Hvals[iH] * Hvals[iH] * abs(udata.a / 12.0) / + (abstol + reltol * abs(vdata[0])), + Hvals[iH] * Hvals[iH] * + abs(udata.a * Hvals[iH] / 4.0 + udata.b / 2.0) / + (abstol + reltol * abs(vdata[0]))); + } + else if (method == "ARKODE_MRI_GARK_IRK21a") + { + printf(" H %.5f dsm %.2e dsm_est %.2e dsm_anal %.2e " + " dsm_est_anal %.2e\n", + Hvals[iH], dsm[iH], dsm_est[iH], + Hvals[iH] * Hvals[iH] * Hvals[iH] * abs(udata.a / 6.0) / + (abstol + reltol * abs(vdata[0])), + Hvals[iH] * Hvals[iH] * + abs(udata.a * Hvals[iH] / 2.0 + udata.b / 2.0) / + (abstol + reltol * abs(vdata[0]))); + } + else if (method == "ARKODE_IMEX_MRI_SR21") + { + printf(" H %.5f dsm %.2e dsm_est %.2e dsm_anal %.2e " + " dsm_est_anal %.2e\n", + Hvals[iH], dsm[iH], dsm_est[iH], + Hvals[iH] * Hvals[iH] * Hvals[iH] * abs(udata.a * 3137.0 / 50370.0) / + (abstol + reltol * abs(vdata[0])), + Hvals[iH] * Hvals[iH] * + abs(udata.a * Hvals[iH] * 20191.0 / 755550.0 - + udata.b * 19.0 / 30.0) / + (abstol + reltol * abs(vdata[0]))); + } + else + { + printf(" H %.5f dsm %.2e dsm_est %.2e\n", Hvals[iH], + dsm[iH], dsm_est[iH]); + } + } + + N_VDestroy(ele); + N_VDestroy(ewt); + N_VDestroy(vtemp); + return (0); +} + +static int Ytrue(sunrealtype t, N_Vector y, UserData& udata) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = udata.a / SUN_RCONST(3.0) * t * t * t + + udata.b / SUN_RCONST(2.0) * t * t + udata.c * t + ONE; + return (0); +} + +/* Error weight calculation routine (mimics what's in ARKODE already) */ +static int computeErrorWeights(N_Vector ycur, N_Vector weight, sunrealtype rtol, + sunrealtype atol, N_Vector vtemp) +{ + N_VAbs(ycur, vtemp); + N_VScale(rtol, vtemp, vtemp); + N_VAddConst(vtemp, atol, vtemp); + N_VInv(vtemp, weight); + return (0); +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a retval so check if + retval >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_retval(void* returnvalue, const char* funcname, int opt) +{ + int* retval; + + // Check if SUNDIALS function returned NULL pointer - no memory allocated + if (opt == 0 && returnvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + // Check if retval < 0 + else if (opt == 1) + { + retval = (int*)returnvalue; + if (*retval < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with retval = %d\n\n", + funcname, *retval); + return 1; + } + } + + // Check if function returned NULL pointer - no memory allocated + else if (opt == 2 && returnvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.out b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.out new file mode 100644 index 0000000000..25faa25bff --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_slowerror_polynomial.out @@ -0,0 +1,9 @@ + +Slow error estimation test (polynomial ODE problem): + problem parameters: a = 1, b = 1, c = 1 + MRI method: ARKODE_MRI_GARK_ERK22a (explicit) + H 0.01000 dsm 8.17e+02 dsm_est 4.93e+05 dsm_anal 8.17e+02 dsm_est_anal 4.93e+05 + H 0.00500 dsm 1.03e+02 dsm_est 1.23e+05 dsm_anal 1.03e+02 dsm_est_anal 1.23e+05 + H 0.00250 dsm 1.29e+01 dsm_est 3.09e+04 dsm_anal 1.29e+01 dsm_est_anal 3.09e+04 + H 0.00125 dsm 1.61e+00 dsm_est 7.73e+03 dsm_anal 1.61e+00 dsm_est_anal 7.73e+03 + H 0.00063 dsm 2.01e-01 dsm_est 1.93e+03 dsm_anal 2.01e-01 dsm_est_anal 1.93e+03 diff --git a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c index 25c5de6982..24be91856d 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c +++ b/test/unit_tests/arkode/C_serial/ark_test_getuserdata.c @@ -165,10 +165,10 @@ int main(int argc, char* argv[]) } /* Create inner stepper */ - retval = ARKStepCreateMRIStepInnerStepper(arkode_inner_mem, &inner_stepper); + retval = ARKodeCreateMRIStepInnerStepper(arkode_inner_mem, &inner_stepper); if (retval) { - fprintf(stderr, "ARKStepCreateMRIStepInnerStepper returned %i", retval); + fprintf(stderr, "ARKodeCreateMRIStepInnerStepper returned %i", retval); return 1; } diff --git a/test/unit_tests/arkode/C_serial/ark_test_reset.c b/test/unit_tests/arkode/C_serial/ark_test_reset.c index 537adbf978..8574dd31a4 100644 --- a/test/unit_tests/arkode/C_serial/ark_test_reset.c +++ b/test/unit_tests/arkode/C_serial/ark_test_reset.c @@ -125,7 +125,7 @@ int main(void) check_retval(&retval, "ARKodeSetStopTime", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -143,7 +143,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -161,7 +161,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -179,7 +179,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -218,7 +218,7 @@ int main(void) /* Initially evolve to dTout, and check result */ retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -236,7 +236,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -254,7 +254,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -272,7 +272,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(arkode_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -299,11 +299,8 @@ int main(void) if (check_retval(&retval, "ARKodeSStolerances", 1)) { return 1; } retval = ARKodeSetMaxNumSteps(arkode_mem, 100); check_retval(&retval, "ARKodeSetMaxNumSteps", 1); - retval = ARKStepCreateMRIStepInnerStepper(arkode_mem, &inner_stepper); - if (check_retval(&retval, "ARKStepCreateMRIStepInnerStepper", 1)) - { - return 1; - } + retval = ARKodeCreateMRIStepInnerStepper(arkode_mem, &inner_stepper); + if (check_retval(&retval, "ARKodeCreateMRIStepInnerStepper", 1)) { return 1; } mristep_mem = MRIStepCreate(NULL, f, t, y, inner_stepper, ctx); if (check_retval((void*)mristep_mem, "MRIStepCreate", 0)) { return 1; } retval = ARKodeSetUserData(mristep_mem, (void*)&lambda); @@ -316,13 +313,13 @@ int main(void) if (check_retval(&retval, "ARKodeSetLinear", 1)) { return 1; } retval = ARKodeSetMaxNumSteps(mristep_mem, 100); check_retval(&retval, "ARKodeSetMaxNumSteps", 1); - retval = ARKodeSetFixedStep(mristep_mem, dTout * SUN_RCONST(0.105)); + retval = ARKodeSetFixedStep(mristep_mem, dTout * SUN_RCONST(0.100)); check_retval(&retval, "ARKodeSetFixedStep", 1); /* Initially evolve to dTout, and check result */ retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Initial ARKodeEvolve had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -340,7 +337,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Second ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -358,7 +355,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Third ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); @@ -376,7 +373,7 @@ int main(void) check_retval(&retval, "ARKodeReset", 1); retval = ARKodeEvolve(mristep_mem, t + dTout, y, &t, ARK_NORMAL); if (check_retval(&retval, "ARKodeEvolve", 1)) { return 1; } - if (check_ans(y, t, SUN_RCONST(0.001), SUN_RCONST(0.000001))) + if (check_ans(y, t, rtol, atol)) { printf(" Fourth ARKodeEvolve call had insufficient accuracy\n"); printf(" t = %" GSYM "\n", t); diff --git a/test/unit_tests/utilities/test_utilities.hpp b/test/unit_tests/utilities/test_utilities.hpp new file mode 100644 index 0000000000..6798740d63 --- /dev/null +++ b/test/unit_tests/utilities/test_utilities.hpp @@ -0,0 +1,110 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * 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 + * ----------------------------------------------------------------------------- + * Utility functions for C++ unit tests. + * ---------------------------------------------------------------------------*/ + +#include <algorithm> +#include <iostream> +#include <string> +#include <vector> + +// Check function return flag +static int check_flag(const int flag, const std::string funcname) +{ + if (!flag) return 0; + if (flag < 0) std::cerr << "ERROR: "; + std::cerr << funcname << " returned " << flag << std::endl; + return 1; +} + +// Check if a function returned a NULL pointer +static int check_ptr(const void* ptr, const std::string funcname) +{ + if (ptr) return 0; + std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; + return 1; +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + sunrealtype& dest) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { +#if defined(SUNDIALS_SINGLE_PRECISION) + dest = stof(*(it + 1)); +#elif defined(SUNDIALS_DOUBLE_PRECISION) + dest = stod(*(it + 1)); +#elif defined(SUNDIALS_EXTENDED_PRECISION) + dest = stold(*(it + 1)); +#endif + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + long long& dest) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = stoll(*(it + 1)); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + long int& dest) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = stol(*(it + 1)); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + int& dest) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = stoi(*(it + 1)); + args.erase(it, it + 2); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + bool& dest, bool store = true) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = store; + args.erase(it); + } +} + +inline void find_arg(std::vector<std::string>& args, const std::string key, + std::string& dest) +{ + auto it = std::find(args.begin(), args.end(), key); + if (it != args.end()) + { + dest = *(it + 1); + args.erase(it, it + 2); + } +} From 2936842d7f67a19807a54915f26e689f927640f8 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 5 Dec 2024 06:30:54 -0800 Subject: [PATCH 123/137] Bugfix: Initialize kflag in ARKODE (#607) Uninitialized variable caught with valgrind. --- src/arkode/arkode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index c64713a320..5c3bfff04b 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -869,6 +869,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, /* Looping point for step attempts */ dsm = ZERO; + kflag = ARK_SUCCESS; attempts = ncf = nef = constrfails = ark_mem->last_kflag = 0; relax_fails = 0; nflag = FIRST_CALL; From 6cb2d045adcbeb4e2c7b7dd3ee438bf02904bd4c Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Thu, 5 Dec 2024 10:16:19 -0800 Subject: [PATCH 124/137] Docs: Add acknowledgements (#606) Add acknowledgements to README and online docs landing page --- README.md | 16 ++++++++++++++++ doc/superbuild/source/index.rst | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/README.md b/README.md index 1d84b9b6e2..313cc11fd2 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,22 @@ Yu Pan, Slaven Peles, Cosmin Petra, H. Hunter Schwartz, Jean M. Sexton, Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang. +## Acknowledgements ## + +This material is based on work supported by the U.S. Department of Energy, +Office of Science, Office of Advanced Scientific Computing Research, Scientific +Discovery through Advanced Computing (SciDAC) program via the Frameworks, +Algorithms, and Scalable Technologies for Mathematics (FASTMath) Institute under +DOE awards DE-AC52-07NA27344 and DE-SC-0021354. + +This material is also based on work supported by the U.S. Department of Energy, +Office of Science, Office of Advanced Scientific Computing Research, +Next-Generation Scientific Software Technologies program under contract +DE-AC52-07NA27344. Additional support is also provided by SciDAC +partnerships with the U.S. Department of Energy’s FES, NP, BES, OE, and BER +offices as well as the LLNL Institutional Scientific Capability Portfolio. + + ## License ## SUNDIALS is released under the BSD 3-clause license. See the [LICENSE](./LICENSE) diff --git a/doc/superbuild/source/index.rst b/doc/superbuild/source/index.rst index d597a82a0c..4af642e5f2 100644 --- a/doc/superbuild/source/index.rst +++ b/doc/superbuild/source/index.rst @@ -150,6 +150,22 @@ Yu Pan, Slaven Peles, Cosmin Petra, Steven B. Roberts, H. Hunter Schwartz, Jean M. Sexton, Dan Shumaker, Steve G. Smith, Shahbaj Sohal, Allan G. Taylor, Hilari C. Tiedeman, Chris White, Ting Yan, and Ulrike M. Yang. +Acknowledgments +=============== + +This material is based on work supported by the U.S. Department of Energy, +Office of Science, Office of Advanced Scientific Computing Research, Scientific +Discovery through Advanced Computing (SciDAC) program via the Frameworks, +Algorithms, and Scalable Technologies for Mathematics (FASTMath) Institute under +DOE awards DE-AC52-07NA27344 and DE-SC-0021354. + +This material is also based on work supported by the U.S. Department of Energy, +Office of Science, Office of Advanced Scientific Computing Research, +Next-Generation Scientific Software Technologies program under contract +DE-AC52-07NA27344. Additional support is also provided by SciDAC +partnerships with the U.S. Department of Energy’s FES, NP, BES, OE, and BER +offices as well as the LLNL Institutional Scientific Capability Portfolio. + SUNDIALS License and Notices ============================ From 924274f8339fc2fd7c69f4b8761bf53a35107d2b Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Thu, 5 Dec 2024 21:17:08 -0800 Subject: [PATCH 125/137] Bugfix: Enable more warning flags, fix minor bugs (#608) Add new warnings flags for gcc and clang. --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- CHANGELOG.md | 5 ++++ .../raja/advection_reaction_3D.cpp | 2 +- .../raja/advection_reaction_3D.hpp | 2 +- .../raja/arkode_driver.cpp | 3 --- cmake/SundialsSetupCompilers.cmake | 23 +++++++++++------ doc/shared/RecentChanges.rst | 6 +++++ .../arkode/CXX_parallel/ark_brusselator1D.h | 2 +- .../ark_brusselator1D_task_local_nls.cpp | 25 +++++++++---------- .../ark_brusselator1D_task_local_nls.c | 2 +- examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c | 4 +-- examples/ida/C_openmp/idaFoodWeb_bnd_omp.c | 4 +-- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 4 +-- examples/ida/serial/idaFoodWeb_kry.c | 4 +-- examples/idas/C_openmp/idasFoodWeb_bnd_omp.c | 4 +-- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 4 +-- examples/idas/serial/idasRoberts_ASAi_klu.c | 4 +-- examples/idas/serial/idasRoberts_ASAi_sps.c | 4 +-- examples/idas/serial/idasRoberts_FSA_klu.c | 4 +-- examples/idas/serial/idasRoberts_FSA_sps.c | 4 +-- src/arkode/arkode_arkstep_impl.h | 10 -------- src/arkode/arkode_ls.c | 2 +- src/cvode/cvode_proj.c | 2 +- src/cvodes/cvodes_proj.c | 2 +- src/ida/ida.c | 2 +- src/idas/idas.c | 2 +- src/sundials/sundials_logger.c | 10 ++++---- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 4 +-- src/sunmatrix/sparse/sunmatrix_sparse.c | 12 ++++----- 28 files changed, 80 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa56fad501..07ad0283f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,11 @@ inner stepper object, `ARKodeCreateMRIStepInnerStepper`. ### Bug Fixes +Fixed a bug where `CVodeSetProjFailEta` would ignore the `eta` parameter. + +Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors +were reported as unrecoverable. + Fixed a [bug](https://github.com/LLNL/sundials/issues/581) in the sparse matrix implementation of `SUNMatScaleAddI` which caused out of bounds writes unless `indexvals` were in ascending order for each row/column. diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp index 7ee19de56d..770f1f3a54 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.cpp @@ -483,7 +483,7 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, uopt->fused = 0; /* use fused vector ops */ uopt->save = 1; /* save solution to disk */ uopt->nout = 10; /* number of output times */ - uopt->outputdir = (char*)"."; /* output directory */ + uopt->outputdir = "."; /* output directory */ /* Parse CLI args and set udata/uopt appropriately */ int retval = ParseArgs(argc, argv, udata, uopt); diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp index 2caa282af9..791686d9ca 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp @@ -57,7 +57,7 @@ struct UserOptions int fused; /* use fused vector ops */ int nout; /* number of outputs */ int save; /* save solution to disk */ - char* outputdir; + const char* outputdir; }; /* diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index fd59c98f87..2a77a3b89b 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -58,7 +58,6 @@ int EvolveProblemDIRK(N_Vector y, UserData* udata, UserOptions* uopt) long int nfe, nfi; /* RHS stats */ long int nni, ncnf; /* nonlinear solver stats */ long int nli, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = true; @@ -248,7 +247,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, npsol; /* linear solver stats */ - char fname[MXSTR]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = false; @@ -449,7 +447,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]; /* Additively split methods should not add the advection and reaction terms */ udata->add_reactions = true; diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index aad26bdaf7..da0ae0091b 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -79,26 +79,33 @@ endif() if(ENABLE_ALL_WARNINGS) message(STATUS "Enabling all compiler warnings") + # Some warning flags are not supported by all compilers so ignore unknown + # flags with -Wno-unknown-warning-option. Ironically, this is not supported by + # some compilers. + set(WARNING_FLAGS + "-Wno-unknown-warning-option -Wall -Wpedantic -Wextra -Wshadow \ +-Wwrite-strings -Wcast-align -Wdisabled-optimization -Wvla -Walloca \ +-Wduplicated-cond -Wduplicated-branches") + # TODO(SBR): Try to add -Wredundant-decls once SuperLU version is updated in + # CI tests + # Avoid numerous warnings from printf if(SUNDIALS_PRECISION MATCHES "EXTENDED") - set(CMAKE_C_FLAGS "-Wdouble-promotion ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wdouble-promotion ${CMAKE_CXX_FLAGS}") + set(WARNING_FLAGS "-Wdouble-promotion ${WARNING_FLAGS}") endif() if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32" )) - set(CMAKE_C_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_CXX_FLAGS}") + set(WARNING_FLAGS "-Wconversion -Wno-sign-conversion ${WARNING_FLAGS}") endif() # Avoid numerous warnings from SWIG generated functions if(NOT BUILD_FORTRAN_MODULE_INTERFACE) - set(CMAKE_C_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wmissing-declarations -Wcast-qual ${CMAKE_CXX_FLAGS}") + set(WARNING_FLAGS "-Wmissing-declarations -Wcast-qual ${WARNING_FLAGS}") endif() - set(CMAKE_C_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_C_FLAGS}") - set(CMAKE_CXX_FLAGS "-Wall -Wpedantic -Wextra -Wshadow ${CMAKE_CXX_FLAGS}") + set(CMAKE_C_FLAGS "${WARNING_FLAGS} ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${WARNING_FLAGS} ${CMAKE_CXX_FLAGS}") # TODO(DJG): Add -fcheck=all,no-pointer,no-recursion once Jenkins is updated # to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 9885baca5a..ff174afb81 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -63,6 +63,12 @@ inner stepper object, :c:func:`ARKodeCreateMRIStepInnerStepper`. **Bug Fixes** +Fixed a bug where :c:func:`CVodeSetProjFailEta` would ignore the `eta` +parameter. + +Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors +were reported as unrecoverable. + Fixed a `bug <https://github.com/LLNL/sundials/issues/581>`__ in the sparse matrix implementation of :c:func:`SUNMatScaleAddI` which caused out of bounds writes unless ``indexvals`` were in ascending order for each row/column. diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index 8f4b873e9e..dd8e49ea98 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -118,7 +118,7 @@ struct UserOptions int nout; /* number of outputs */ int monitor; /* print solution to screen */ int printtime; /* print timing information */ - char* outputdir; + const char* outputdir; }; /* 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 cbf3f23bd4..870e9b7a30 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -1090,7 +1090,6 @@ int TaskLocalNewton_GetNumConvFails(SUNNonlinearSolver NLS, long int* nconvfails SUNNonlinearSolver TaskLocalNewton(SUNContext ctx, N_Vector y) { - void* tmp_comm; SUNNonlinearSolver NLS; TaskLocalNewton_Content content; @@ -1416,18 +1415,18 @@ int SetupProblem(int argc, char* argv[], UserData* udata, UserOptions* uopt, udata->WFID = NULL; /* set default integrator options */ - uopt->order = 3; /* method order */ - uopt->expl = 0; /* imex or explicit */ - uopt->t0 = 0.0; /* initial time */ - uopt->tf = 10.0; /* final time */ - uopt->rtol = 1.0e-6; /* relative tolerance */ - uopt->atol = 1.0e-9; /* absolute tolerance */ - uopt->global = 0; /* use global NLS */ - uopt->fused = 0; /* use fused vector ops */ - uopt->monitor = 0; /* print solution to screen */ - uopt->printtime = 0; /* print timing */ - uopt->nout = 40; /* number of output times */ - uopt->outputdir = (char*)"."; /* output directory */ + uopt->order = 3; /* method order */ + uopt->expl = 0; /* imex or explicit */ + uopt->t0 = 0.0; /* initial time */ + uopt->tf = 10.0; /* final time */ + uopt->rtol = 1.0e-6; /* relative tolerance */ + uopt->atol = 1.0e-9; /* absolute tolerance */ + uopt->global = 0; /* use global NLS */ + uopt->fused = 0; /* use fused vector ops */ + uopt->monitor = 0; /* print solution to screen */ + uopt->printtime = 0; /* print timing */ + uopt->nout = 40; /* number of output times */ + uopt->outputdir = "."; /* output directory */ /* check for input args */ if (argc > 1) 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 d3a71248c6..a790d5ba5a 100644 --- a/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c +++ b/examples/arkode/C_parallel/ark_brusselator1D_task_local_nls.c @@ -106,7 +106,7 @@ typedef struct FILE* UFID; /* solution output file pointer */ FILE* VFID; FILE* WFID; - char* outputdir; + const char* outputdir; }* UserOptions; /* diff --git a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c index 66ed23f301..00e97611f1 100644 --- a/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c +++ b/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c @@ -113,7 +113,7 @@ static void PrintFinalStats(void* cvode_mem); /* Private function to check function return values */ -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* Functions Called by the Solver */ @@ -461,7 +461,7 @@ static void PrintFinalStats(void* cvode_mem) opt == 2 means function allocates memory so check if returned NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c index 049c988242..ec5cb6f9f9 100644 --- a/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_bnd_omp.c @@ -189,7 +189,7 @@ static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype* cxy, sunrealtype* ratesxy, UserData webdata); static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -726,7 +726,7 @@ static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c index 68e497b9cf..0162736651 100644 --- a/examples/ida/C_openmp/idaFoodWeb_kry_omp.c +++ b/examples/ida/C_openmp/idaFoodWeb_kry_omp.c @@ -204,7 +204,7 @@ static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype* cxy, sunrealtype* ratesxy, UserData webdata); static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -864,7 +864,7 @@ static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/ida/serial/idaFoodWeb_kry.c b/examples/ida/serial/idaFoodWeb_kry.c index 9ce75a1191..c7b1d8a7b2 100644 --- a/examples/ida/serial/idaFoodWeb_kry.c +++ b/examples/ida/serial/idaFoodWeb_kry.c @@ -182,7 +182,7 @@ static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype* cxy, sunrealtype* ratesxy, UserData webdata); static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -823,7 +823,7 @@ static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c index 4569bbc6a8..94347e79e8 100644 --- a/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_bnd_omp.c @@ -189,7 +189,7 @@ static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype* cxy, sunrealtype* ratesxy, UserData webdata); static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -727,7 +727,7 @@ static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c index 00b2487143..54ad1b7587 100644 --- a/examples/idas/C_openmp/idasFoodWeb_kry_omp.c +++ b/examples/idas/C_openmp/idasFoodWeb_kry_omp.c @@ -204,7 +204,7 @@ static void Fweb(sunrealtype tcalc, N_Vector cc, N_Vector crate, static void WebRates(sunrealtype xx, sunrealtype yy, sunrealtype* cxy, sunrealtype* ratesxy, UserData webdata); static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -862,7 +862,7 @@ static sunrealtype dotprod(sunindextype size, sunrealtype* x1, sunrealtype* x2) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/serial/idasRoberts_ASAi_klu.c b/examples/idas/serial/idasRoberts_ASAi_klu.c index 38490aa654..ca114d28fe 100644 --- a/examples/idas/serial/idasRoberts_ASAi_klu.c +++ b/examples/idas/serial/idasRoberts_ASAi_klu.c @@ -122,7 +122,7 @@ static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, /* Prototypes of private functions */ static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -808,7 +808,7 @@ static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/serial/idasRoberts_ASAi_sps.c b/examples/idas/serial/idasRoberts_ASAi_sps.c index a7c321fe19..b9698de4c1 100644 --- a/examples/idas/serial/idasRoberts_ASAi_sps.c +++ b/examples/idas/serial/idasRoberts_ASAi_sps.c @@ -122,7 +122,7 @@ static int rhsQB(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, /* Prototypes of private functions */ static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector qB); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -809,7 +809,7 @@ static void PrintOutput(sunrealtype tfinal, N_Vector yB, N_Vector ypB, N_Vector * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/serial/idasRoberts_FSA_klu.c b/examples/idas/serial/idasRoberts_FSA_klu.c index 61b50d8756..911b82056e 100644 --- a/examples/idas/serial/idasRoberts_FSA_klu.c +++ b/examples/idas/serial/idasRoberts_FSA_klu.c @@ -113,7 +113,7 @@ static void PrintSensOutput(N_Vector* uS); static void PrintFinalStats(void* ida_mem, sunbooleantype sensi); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -840,7 +840,7 @@ static void PrintFinalStats(void* ida_mem, sunbooleantype sensi) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/idas/serial/idasRoberts_FSA_sps.c b/examples/idas/serial/idasRoberts_FSA_sps.c index fed0c48010..0843b74b48 100644 --- a/examples/idas/serial/idasRoberts_FSA_sps.c +++ b/examples/idas/serial/idasRoberts_FSA_sps.c @@ -113,7 +113,7 @@ static void PrintSensOutput(N_Vector* uS); static void PrintFinalStats(void* ida_mem, sunbooleantype sensi); -static int check_retval(void* returnvalue, char* funcname, int opt); +static int check_retval(void* returnvalue, const char* funcname, int opt); /* *-------------------------------------------------------------------- @@ -841,7 +841,7 @@ static void PrintFinalStats(void* ida_mem, sunbooleantype sensi) * NULL pointer */ -static int check_retval(void* returnvalue, char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/src/arkode/arkode_arkstep_impl.h b/src/arkode/arkode_arkstep_impl.h index ce4d1b4e63..1d5c15e4a3 100644 --- a/src/arkode/arkode_arkstep_impl.h +++ b/src/arkode/arkode_arkstep_impl.h @@ -272,16 +272,6 @@ int arkStep_NlsLSolve(N_Vector delta, void* arkode_mem); int arkStep_NlsConvTest(SUNNonlinearSolver NLS, N_Vector y, N_Vector del, sunrealtype tol, N_Vector ewt, void* arkode_mem); -/* private functions for interfacing with MRIStep */ -int arkStep_SetInnerForcing(ARKodeMem arkode_mem, sunrealtype tshift, - sunrealtype tscale, N_Vector* f, int nvecs); -int arkStep_MRIStepInnerEvolve(MRIStepInnerStepper stepper, sunrealtype t0, - sunrealtype tout, N_Vector y); -int arkStep_MRIStepInnerFullRhs(MRIStepInnerStepper stepper, sunrealtype t, - N_Vector y, N_Vector f, int mode); -int arkStep_MRIStepInnerReset(MRIStepInnerStepper stepper, sunrealtype tR, - N_Vector yR); - /* private functions for relaxation */ int arkStep_SetRelaxFn(ARKodeMem ark_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); int arkStep_RelaxDeltaE(ARKodeMem ark_mem, ARKRelaxJacFn relax_jac_fn, diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 1ed0939246..69c74c358e 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -769,7 +769,7 @@ int ARKodeSetJacEvalFrequency(void* arkode_mem, long int msbj) if (retval != ARK_SUCCESS) { return (retval); } /* store input and return */ - arkls_mem->msbj = (msbj <= ZERO) ? ARKLS_MSBJ : msbj; + arkls_mem->msbj = (msbj <= 0) ? ARKLS_MSBJ : msbj; return (ARKLS_SUCCESS); } diff --git a/src/cvode/cvode_proj.c b/src/cvode/cvode_proj.c index 02de98df7f..b23573e8bf 100644 --- a/src/cvode/cvode_proj.c +++ b/src/cvode/cvode_proj.c @@ -218,7 +218,7 @@ int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) else { /* Update the eta value */ - proj_mem->eta_pfail = PROJ_FAIL_ETA; + proj_mem->eta_pfail = eta; } return (CV_SUCCESS); diff --git a/src/cvodes/cvodes_proj.c b/src/cvodes/cvodes_proj.c index 109bc8699c..757be33f7a 100644 --- a/src/cvodes/cvodes_proj.c +++ b/src/cvodes/cvodes_proj.c @@ -218,7 +218,7 @@ int CVodeSetProjFailEta(void* cvode_mem, sunrealtype eta) else { /* Update the eta value */ - proj_mem->eta_pfail = PROJ_FAIL_ETA; + proj_mem->eta_pfail = eta; } return (CV_SUCCESS); diff --git a/src/ida/ida.c b/src/ida/ida.c index c532e2c7a5..725fd5a0a3 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -2485,7 +2485,7 @@ static int IDAStep(IDAMem IDA_mem) saved_t = IDA_mem->ida_tn; ncf = nef = 0; - if (IDA_mem->ida_nst == ZERO) + if (IDA_mem->ida_nst == 0) { IDA_mem->ida_kk = 1; IDA_mem->ida_kused = 0; diff --git a/src/idas/idas.c b/src/idas/idas.c index 05f5c976cf..67bcc59092 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -5890,7 +5890,7 @@ static int IDAStep(IDAMem IDA_mem) saved_t = IDA_mem->ida_tn; ncf = nef = 0; - if (IDA_mem->ida_nst == ZERO) + if (IDA_mem->ida_nst == 0) { IDA_mem->ida_kk = 1; IDA_mem->ida_kused = 0; diff --git a/src/sundials/sundials_logger.c b/src/sundials/sundials_logger.c index 6038d5f137..713ece22b3 100644 --- a/src/sundials/sundials_logger.c +++ b/src/sundials/sundials_logger.c @@ -38,7 +38,7 @@ void sunCreateLogMessage(SUNLogLevel lvl, int rank, const char* scope, const char* label, const char* txt, va_list args, char** log_msg) { - char* prefix; + const char* prefix; char* formatted_txt; int msg_length; @@ -53,10 +53,10 @@ void sunCreateLogMessage(SUNLogLevel lvl, int rank, const char* scope, fprintf(stderr, "[FATAL LOGGER ERROR] %s\n", "message size too large"); } - if (lvl == SUN_LOGLEVEL_DEBUG) { prefix = (char*)"DEBUG"; } - else if (lvl == SUN_LOGLEVEL_WARNING) { prefix = (char*)"WARNING"; } - else if (lvl == SUN_LOGLEVEL_INFO) { prefix = (char*)"INFO"; } - else if (lvl == SUN_LOGLEVEL_ERROR) { prefix = (char*)"ERROR"; } + if (lvl == SUN_LOGLEVEL_DEBUG) { prefix = "DEBUG"; } + else if (lvl == SUN_LOGLEVEL_WARNING) { prefix = "WARNING"; } + else if (lvl == SUN_LOGLEVEL_INFO) { prefix = "INFO"; } + else if (lvl == SUN_LOGLEVEL_ERROR) { prefix = "ERROR"; } msg_length = sunsnprintf(NULL, 0, "[%s][rank %d][%s][%s] %s\n", prefix, rank, scope, label, formatted_txt); diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index 247b2548cf..c7d0066589 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -702,7 +702,7 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC - : SUNLS_PSOLVE_FAIL_UNREC; + : SUNLS_PSOLVE_FAIL_REC; return (LASTFLAG(S)); } N_VScale(ONE, vtemp2, vtemp1); @@ -905,7 +905,7 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC - : SUNLS_PSOLVE_FAIL_UNREC; + : SUNLS_PSOLVE_FAIL_REC; return (LASTFLAG(S)); } N_VScale(ONE, vtemp1, x); diff --git a/src/sunmatrix/sparse/sunmatrix_sparse.c b/src/sunmatrix/sparse/sunmatrix_sparse.c index 89a1ca576a..0b27de18c4 100644 --- a/src/sunmatrix/sparse/sunmatrix_sparse.c +++ b/src/sunmatrix/sparse/sunmatrix_sparse.c @@ -390,21 +390,21 @@ void SUNSparseMatrix_Print(SUNMatrix A, FILE* outfile) { SUNFunctionBegin(A->sunctx); sunindextype i, j; - char* matrixtype; - char* indexname; + const char* matrixtype; + const char* indexname; SUNAssertVoid(SUNMatGetID(A) == SUNMATRIX_SPARSE, SUN_ERR_ARG_WRONGTYPE); /* perform operation */ if (SM_SPARSETYPE_S(A) == CSC_MAT) { - indexname = (char*)"col"; - matrixtype = (char*)"CSC"; + indexname = "col"; + matrixtype = "CSC"; } else { - indexname = (char*)"row"; - matrixtype = (char*)"CSR"; + indexname = "row"; + matrixtype = "CSR"; } fprintf(outfile, "\n"); fprintf(outfile, "%ld by %ld %s matrix, NNZ: %ld \n", (long int)SM_ROWS_S(A), From 8d68be1958bd4ddc754bcb289c026e1d3379ae84 Mon Sep 17 00:00:00 2001 From: Steven Roberts <roberts115@llnl.gov> Date: Fri, 6 Dec 2024 07:44:57 -0800 Subject: [PATCH 126/137] Feature: operator splitting (#572) Add operator splitting stepper module to ARKODE ----- Co-authored-by: David Gardner <gardner48@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: Cody Balos <cjbalos@gmail.com> Co-authored-by: Balos, Cody, J <balos1@llnl.gov> --- CHANGELOG.md | 25 +- doc/arkode/guide/source/Constants.rst | 26 + doc/arkode/guide/source/Mathematics.rst | 456 ++++++--- .../Usage/ForcingStep/User_callable.rst | 185 ++++ .../guide/source/Usage/ForcingStep/index.rst | 32 + doc/arkode/guide/source/Usage/General.rst | 16 +- .../source/Usage/SplittingStep/Skeleton.rst | 112 +++ .../SplittingStepCoefficients.rst | 434 ++++++++ .../Usage/SplittingStep/User_callable.rst | 212 ++++ .../source/Usage/SplittingStep/index.rst | 32 + .../guide/source/Usage/User_callable.rst | 61 +- doc/arkode/guide/source/Usage/index.rst | 12 +- doc/shared/RecentChanges.rst | 30 +- doc/shared/sundials.bib | 94 ++ .../sunstepper/SUNStepper_Description.rst | 27 + .../sunstepper/SUNStepper_Implementing.rst | 6 +- examples/arkode/C_serial/CMakeLists.txt | 6 + ...k_advection_diffusion_reaction_splitting.c | 358 +++++++ ...advection_diffusion_reaction_splitting.out | 102 ++ .../C_serial/ark_analytic_partitioned.c | 270 +++++ .../ark_analytic_partitioned_forcing.out | 54 + .../ark_analytic_partitioned_splitting.out | 54 + ..._splitting_ARKODE_SPLITTING_BEST_2_2_2.out | 55 + ..._splitting_ARKODE_SPLITTING_RUTH_3_3_2.out | 55 + ...litting_ARKODE_SPLITTING_YOSHIDA_8_6_2.out | 55 + include/arkode/arkode.h | 5 + include/arkode/arkode_forcingstep.h | 43 + include/arkode/arkode_splittingstep.h | 115 +++ include/sundials/sundials_math.h | 14 + include/sundials/sundials_stepper.h | 10 + src/arkode/CMakeLists.txt | 5 + src/arkode/arkode.c | 1 + src/arkode/arkode_forcingstep.c | 557 ++++++++++ src/arkode/arkode_forcingstep_impl.h | 30 + src/arkode/arkode_impl.h | 3 + src/arkode/arkode_io.c | 117 +++ src/arkode/arkode_splittingstep.c | 747 ++++++++++++++ .../arkode_splittingstep_coefficients.c | 482 +++++++++ .../arkode_splittingstep_coefficients.def | 68 ++ src/arkode/arkode_splittingstep_impl.h | 32 + src/arkode/arkode_sunstepper.c | 17 + .../fmod_int32/farkode_forcingstep_mod.c | 264 +++++ .../fmod_int32/farkode_forcingstep_mod.f90 | 144 +++ src/arkode/fmod_int32/farkode_mod.c | 28 + src/arkode/fmod_int32/farkode_mod.f90 | 53 + .../fmod_int32/farkode_splittingstep_mod.c | 764 ++++++++++++++ .../fmod_int32/farkode_splittingstep_mod.f90 | 947 ++++++++++++++++++ .../fmod_int64/farkode_forcingstep_mod.c | 264 +++++ .../fmod_int64/farkode_forcingstep_mod.f90 | 144 +++ src/arkode/fmod_int64/farkode_mod.c | 28 + src/arkode/fmod_int64/farkode_mod.f90 | 53 + .../fmod_int64/farkode_splittingstep_mod.c | 764 ++++++++++++++ .../fmod_int64/farkode_splittingstep_mod.f90 | 947 ++++++++++++++++++ src/sundials/fmod_int32/fsundials_core_mod.c | 28 + .../fmod_int32/fsundials_core_mod.f90 | 52 + src/sundials/fmod_int64/fsundials_core_mod.c | 28 + .../fmod_int64/fsundials_core_mod.f90 | 52 + src/sundials/sundials_math.c | 9 + src/sundials/sundials_stepper.c | 33 +- src/sundials/sundials_stepper_impl.h | 1 + swig/Makefile | 2 +- swig/arkode/farkode_forcingstep_mod.i | 30 + swig/arkode/farkode_splittingstep_mod.i | 30 + test/answers | 2 +- .../arkode/CXX_serial/CMakeLists.txt | 3 +- .../CXX_serial/ark_test_splittingstep.cpp | 529 ++++++++++ .../CXX_serial/ark_test_splittingstep.out | 385 +++++++ .../unit_tests/arkode/C_serial/CMakeLists.txt | 2 + .../arkode/C_serial/ark_test_forcingstep.c | 300 ++++++ .../ark_test_splittingstep_coefficients.c | 217 ++++ 70 files changed, 10932 insertions(+), 186 deletions(-) create mode 100644 doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst create mode 100644 doc/arkode/guide/source/Usage/ForcingStep/index.rst create mode 100644 doc/arkode/guide/source/Usage/SplittingStep/Skeleton.rst create mode 100644 doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst create mode 100644 doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst create mode 100644 doc/arkode/guide/source/Usage/SplittingStep/index.rst create mode 100644 examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c create mode 100644 examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.out create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned.c create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned_forcing.out create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned_splitting.out create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_BEST_2_2_2.out create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_RUTH_3_3_2.out create mode 100644 examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_YOSHIDA_8_6_2.out create mode 100644 include/arkode/arkode_forcingstep.h create mode 100644 include/arkode/arkode_splittingstep.h create mode 100644 src/arkode/arkode_forcingstep.c create mode 100644 src/arkode/arkode_forcingstep_impl.h create mode 100644 src/arkode/arkode_splittingstep.c create mode 100644 src/arkode/arkode_splittingstep_coefficients.c create mode 100644 src/arkode/arkode_splittingstep_coefficients.def create mode 100644 src/arkode/arkode_splittingstep_impl.h create mode 100644 src/arkode/fmod_int32/farkode_forcingstep_mod.c create mode 100644 src/arkode/fmod_int32/farkode_forcingstep_mod.f90 create mode 100644 src/arkode/fmod_int32/farkode_splittingstep_mod.c create mode 100644 src/arkode/fmod_int32/farkode_splittingstep_mod.f90 create mode 100644 src/arkode/fmod_int64/farkode_forcingstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_forcingstep_mod.f90 create mode 100644 src/arkode/fmod_int64/farkode_splittingstep_mod.c create mode 100644 src/arkode/fmod_int64/farkode_splittingstep_mod.f90 create mode 100644 swig/arkode/farkode_forcingstep_mod.i create mode 100644 swig/arkode/farkode_splittingstep_mod.i create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.cpp create mode 100644 test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.out create mode 100644 test/unit_tests/arkode/C_serial/ark_test_forcingstep.c create mode 100644 test/unit_tests/arkode/C_serial/ark_test_splittingstep_coefficients.c diff --git a/CHANGELOG.md b/CHANGELOG.md index 07ad0283f6..bd86096342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,25 @@ ### Major Features +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, LSRKStep. +This currently supports five explicit low-storage methods: the second-order Runge--Kutta--Chebyshev +and Runge--Kutta--Legendre methods, and the second- through fourth-order optimal strong stability +preserving Runge--Kutta methods. All methods include embeddings for temporal adaptivity. + +Added an operator splitting module, SplittingStep, and forcing method module, +ForcingStep, to ARKODE. These modules support a broad range of operator-split +time integration methods for multiphysics applications. + ### New Features and Enhancements +Added the `ARKodeSetStepDirection` and `ARKodeGetStepDirection` functions to +change and query the direction of integration. + Added the `SUNStepper` base class to represent a generic solution procedure for -IVPs. A SUNStepper can be created from an ARKODE memory block with the new -function `ARKodeCreateSUNStepper`. To enable interoperability with -`MRIStepInnerStepper`, the function `MRIStepInnerStepper_CreateFromSUNStepper` -was added. +IVPs. This is used by the SplittingStep and ForcingStep modules of ARKODE. A +SUNStepper can be created from an ARKODE memory block with the new function +`ARKodeCreateSUNStepper`. To enable interoperability with `MRIStepInnerStepper`, +the function `MRIStepInnerStepper_CreateFromSUNStepper` was added. The following DIRK schemes now have coefficients accurate to quad precision: * `ARKODE_BILLINGTON_3_3_2` @@ -26,11 +38,6 @@ Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. -Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, LSRKStep. -This currently supports five explicit low-storage methods: the second-order Runge--Kutta--Chebyshev -and Runge--Kutta--Legendre methods, and the second- through fourth-order optimal strong stability -preserving Runge--Kutta methods. All methods include embeddings for temporal adaptivity. - The Trilinos Teptra NVector interface has been updated to utilize CMake imported targets added in Trilinos 14 to improve support for different Kokkos backends with Trilinos. As such, Trilinos 14 or newer is required and the diff --git a/doc/arkode/guide/source/Constants.rst b/doc/arkode/guide/source/Constants.rst index 46f4e143b6..d49d4c0335 100644 --- a/doc/arkode/guide/source/Constants.rst +++ b/doc/arkode/guide/source/Constants.rst @@ -336,6 +336,30 @@ contains the ARKODE output constants. +-----------------------------------------------+------------------------------------------------------------+ | | | +-----------------------------------------------+------------------------------------------------------------+ + | **Splitting Coefficients specification** | | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_LIE_TROTTER_1_1_2` | 1st order Lie-Trotter splitting for problems with two | + | | partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_STRANG_2_2_2` | 2nd order Strang splitting for problems with two | + | | partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_BEST_2_2_2` | 2nd order splitting with optimal error for problems with | + | | two partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_SUZUKI_3_3_2` | 3rd order Suzuki splitting for problems with two | + | | partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_RUTH_3_3_2` | 3rd order Ruth splitting for problems with two partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_YOSHIDA_4_4_2` | 4th order Yoshida splitting for problems with two | + | | partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | :index:`ARKODE_SPLITTING_YOSHIDA_8_6_2` | 6th order Yoshida splitting for problems with two | + | | partitions. | + +-----------------------------------------------+------------------------------------------------------------+ + | | | + +-----------------------------------------------+------------------------------------------------------------+ | **MRI method types** | | +-----------------------------------------------+------------------------------------------------------------+ | :index:`MRISTEP_EXPLICIT` | Use an explicit (at the slow time scale) MRI method. | @@ -600,6 +624,8 @@ contains the ARKODE output constants. +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_SUNSTEPPER_ERR` | -51 | An error occurred in the SUNStepper module. | +-------------------------------------+------+------------------------------------------------------------+ + | :index:`ARK_STEP_DIRECTION_ERR` | -52 | An error occurred changing the step direction. | + +-------------------------------------+------+------------------------------------------------------------+ | :index:`ARK_UNRECOGNIZED_ERROR` | -99 | An unknown error was encountered. | +-------------------------------------+------+------------------------------------------------------------+ | | diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index d550d65635..5c378b6b6b 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -58,18 +58,32 @@ In the sub-sections that follow, we elaborate on the numerical methods utilized in ARKODE. We first discuss the "single-step" nature of the ARKODE infrastructure, including its usage modes and approaches for interpolated solution output. We then discuss the current suite -of time-stepping modules supplied with ARKODE, including the ARKStep -module for :ref:`additive Runge--Kutta methods <ARKODE.Mathematics.ARK>`, -the ERKStep module that is optimized for :ref:`explicit Runge--Kutta -methods <ARKODE.Mathematics.ERK>`, the SPRKStep module that provides -:ref:`symplectic partitioned Runge--Kutta methods <ARKODE.Mathematics.SPRKStep>` -for Hamiltonian dynamics, the MRIStep module that provides a variety of -:ref:`multirate infinitesimal methods <ARKODE.Mathematics.MRIStep>`, and the -LSRKStep module that supports :ref:`low-storage Runge--Kutta methods -<ARKODE.Mathematics.LSRK>`. We then discuss the :ref:`adaptive temporal +of time-stepping modules supplied with ARKODE, including + +* ARKStep for :ref:`additive Runge--Kutta methods <ARKODE.Mathematics.ARK>` + +* ERKStep that is optimized for :ref:`explicit Runge--Kutta methods + <ARKODE.Mathematics.ERK>` + +* ForcingStep for :ref:`a forcing method <ARKODE.Mathematics.ForcingStep>` + +* LSRKStep that supports :ref:`low-storage Runge--Kutta methods + <ARKODE.Mathematics.LSRK>` + +* MRIStep for :ref:`multirate infinitesimal step (MIS), multirate infinitesimal + GARK (MRI-GARK), and implicit-explicit MRI-GARK (IMEX-MRI-GARK) methods + <ARKODE.Mathematics.MRIStep>` + +* SplittingStep for :ref:`operator splitting methods + <ARKODE.Mathematics.SplittingStep>` + +* SPRKStep for :ref:`symplectic partitioned Runge--Kutta methods + <ARKODE.Mathematics.SPRKStep>` + +We then discuss the :ref:`adaptive temporal error controllers <ARKODE.Mathematics.Adaptivity>` shared by the time-stepping -modules, including discussion of our choice of norms for measuring errors -within various components of the solver. +modules, including discussion of our choice of norms for measuring errors within +various components of the solver. We then discuss the nonlinear and linear solver strategies used by ARKODE for solving implicit algebraic systems that arise in computing each @@ -462,116 +476,92 @@ simplified form admits a more efficient and memory-friendly implementation than the more general form :eq:`ARKODE_IVP_simple_explicit`. -.. _ARKODE.Mathematics.SPRKStep: +.. _ARKODE.Mathematics.ForcingStep: -SPRKStep -- Symplectic Partitioned Runge--Kutta methods -======================================================= +ForcingStep -- Forcing method +============================= -The SPRKStep time-stepping module in ARKODE is designed for problems where the -state vector is partitioned as +The ForcingStep time-stepping module in ARKODE is designed for IVPs of the form .. math:: - y(t) = - \begin{bmatrix} - p(t) \\ - q(t) - \end{bmatrix} - -and the component partitioned IVP is given by - -.. math:: - \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 - -The right-hand side functions :math:`f_1(t,p)` and :math:`f_2(t,q)` typically -arise from the **separable** Hamiltonian system - -.. math:: - H(t, p, q) = T(t, p) + V(t, q) - -where - -.. math:: - 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`. + \dot{y} = f_1(t,y) + f_2(t,y), \qquad y(t_0) = y_0, -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, +with two additive partitions. One step of the forcing method implemented in +ForcingStep is given by .. math:: - \begin{array}{c|cccc} - c_1 & 0 & \cdots & 0 & 0 \\ - c_2 & a_1 & 0 & \cdots & \vdots \\ - \vdots & \vdots & \ddots & \ddots & \vdots \\ - c_s & a_1 & \cdots & a_{s-1} & 0 \\ - \hline - & a_1 & \cdots & a_{s-1} & a_s - \end{array} - \qquad \qquad - \begin{array}{c|cccc} - \hat{c}_1 & \hat{a}_1 & \cdots & 0 & 0 \\ - \hat{c}_2 & \hat{a}_1 & \hat{a}_2 & \cdots & \vdots \\ - \vdots & \vdots & \ddots & \ddots & \vdots \\ - \hat{c}_s & \hat{a}_1 & \hat{a}_2 & \cdots & \hat{a}_{s} \\ - \hline - & \hat{a}_1 & \hat{a}_2 & \cdots & \hat{a}_{s} - \end{array}. + v_1(t_{n-1}) &= y_{n-1}, \\ + \dot{v}_1 &= f_1(t, v_1), \\ + f_1^* &= \frac{v_1(t_n) - y_{n-1}}{h_n}, \\ + v_2(t_{n-1}) &= y_{n-1}, \\ + \dot{v}_2 &= f_1^* + f_2(t, v_2), \\ + y_n &= v_2(t_n). -These methods approximately conserve a nearby Hamiltonian for exponentially long -times :cite:p:`HaWa:06`. SPRKStep makes the assumption that the Hamiltonian is -separable, in which case the resulting method is explicit. SPRKStep provides -schemes with order of accuracy and conservation equal to -:math:`q = \{1,2,3,4,5,6,8,10\}`. The references for these these methods and -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:`f_1` and -:math:`f_2` -can be ignored). +Like a Lie--Trotter method from +:ref:`SplittingStep <ARKODE.Mathematics.SplittingStep>`, the partitions are +evolved through a sequence of inner IVPs which can be solved with an arbitrary +integrator or exact solution procedure. However, the IVP for partition two +includes a "forcing" or "tendency" term :math:`f_1^*` to strengthen the +coupling. This coupling leads to a first order method provided :math:`v_1` and +:math:`v_2` are integrated to at least first order accuracy. Currently, a fixed +time step must be specified for the overall ForcingStep integrator, but +partition integrators are free to use adaptive time steps. -#. 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 \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)` +.. _ARKODE.Mathematics.LSRK: -#. Set :math:`p_n = P_s, q_n = Q_{s+1}` +LSRKStep -- Low-Storage Runge--Kutta methods +============================================ -.. _ARKODE.Mathematics.SPRKStep.Compensated: +The LSRKStep time-stepping module in ARKODE supports a variety of so-called +"low-storage" Runge--Kutta (LSRK) methods, :cite:p:`VSH:04, MBA:14, K:08, FCS:22`. This category includes traditional explicit +fixed-step and low-storage Runge--Kutta methods, adaptive +low-storage Runge--Kutta methods, and others. These are characterized by coefficient tables +that have an exploitable structure, such that their implementation does not require +that all stages be stored simultaneously. At present, this module supports explicit, +adaptive "super-time-stepping" (STS) and "strong-stability-preserving" (SSP) methods. -Optionally, a different algorithm leveraging compensated summation can be used -that is more robust to roundoff error at the expense of 2 extra vector operations -per stage and an additional 5 per time step. It also requires one extra vector to -be stored. However, it is significantly more robust to roundoff error accumulation -:cite:p:`Sof:02`. When compensated summation is enabled, the following incremental -form is used to compute a time step: +The LSRK time-stepping module in ARKODE currently supports IVP +of the form :eq:`ARKODE_IVP_simple_explicit`, i.e., unlike the more general problem form :eq:`ARKODE_IMEX_IVP`, LSRKStep +requires that problems have an identity mass matrix (i.e., :math:`M(t)=I`) +and that the right-hand side function is not split into separate +components. -#. Set :math:`\Delta P_0 = 0, \Delta Q_1 = 0` +LSRKStep currently supports two families of second-order, explicit, and temporally adaptive STS methods: +Runge--Kutta--Chebyshev (RKC), :cite:p:`VSH:04` and Runge--Kutta--Legendre (RKL), :cite:p:`MBA:14`. These methods have the form -#. For :math:`i = 1,\ldots,s` do: +.. math:: + z_0 &= y_n,\\ + z_1 &= z_0 + h \tilde{\mu}_1 f(t_n,z_0),\\ + z_j &= (1-\mu_j-\nu_j)z_0 + \mu_j z_{j-1} + \nu_jz_{j-2} + h \tilde{\gamma}_j f(t_n,z_0) + h \tilde{\mu}_j f(t_n + c_{j-1}h, z_{j-1}) \\ + y_{n+1} &= z_s. + :label: ARKODE_RKC_RKL - #. :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)` +The corresponding coefficients can be found in :cite:p:`VSH:04` and :cite:p:`MBA:14`, respectively. -#. Set :math:`\Delta p_n = \Delta P_s, \Delta q_n = \Delta Q_{s+1}` +LSRK methods of STS type are designed for stiff problems characterized by +having Jacobians with eigenvalues that have large real and small imaginary parts. +While those problems are traditionally treated using implicit methods, STS methods +are explicit. To achieve stability for these stiff problems, STS methods use more stages than +conventional Runge-Kutta methods to extend the stability region along the negative +real axis. The extent of this stability region is proportional to the square of the number +of stages used. -#. Using compensated summation, set :math:`p_n = p_{n-1} + \Delta p_n, q_n = q_{n-1} + \Delta q_n` +LSRK methods of the SSP type are designed to preserve the so-called "strong-stability" properties of advection-type equations. +For details, see :cite:p:`K:08`. +The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p:`SO:88` of explicit Runge--Kutta methods: -Since temporal error based adaptive time-stepping is known to ruin the -conservation property :cite:p:`HaWa:06`, SPRKStep requires that ARKODE be run -using a fixed time-step size. +.. math:: + z_1 &= y_n,\\ + z_i &= \sum_{j = 1}^{i-1} \left(\alpha_{i,j}y_j + \beta_{i,j}h f(t_n + c_jh, z_j)\right),\\ + y_{n+1} &= z_s. + :label: ARKODE_SSP -.. However, it is possible for a user to provide a -.. problem-specific adaptivity controller such as the one described in :cite:p:`HaSo:05`. -.. The `ark_kepler.c` example demonstrates an implementation of such controller. +The coefficients of the Shu--Osher representation are not uniquely determined by the Butcher table :cite:p:`SR:02`. +In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in +:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and +:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The +corresponding coefficients and embedding weights can be found in :cite:p:`K:08` and :cite:p:`FCS:22`, respectively. .. _ARKODE.Mathematics.MRIStep: @@ -833,60 +823,240 @@ and finally finishing the IVP solve to :math:`t_{n-1}+h^S` to obtain :math:`\til -.. _ARKODE.Mathematics.LSRK: +.. _ARKODE.Mathematics.SplittingStep: -LSRKStep -- Low-Storage Runge--Kutta methods -============================================ +SplittingStep -- Operator splitting methods +================================================ -The LSRKStep time-stepping module in ARKODE supports a variety of so-called -"low-storage" Runge--Kutta (LSRK) methods, :cite:p:`VSH:04, MBA:14, K:08, FCS:22`. This category includes traditional explicit -fixed-step and low-storage Runge--Kutta methods, adaptive -low-storage Runge--Kutta methods, and others. These are characterized by coefficient tables -that have an exploitable structure, such that their implementation does not require -that all stages be stored simultaneously. At present, this module supports explicit, -adaptive "super-time-stepping" (STS) and "strong-stability-preserving" (SSP) methods. +The SplittingStep time-stepping module in ARKODE is designed for IVPs of the +form -The LSRK time-stepping module in ARKODE currently supports IVP -of the form :eq:`ARKODE_IVP_simple_explicit`, i.e., unlike the more general problem form :eq:`ARKODE_IMEX_IVP`, LSRKStep -requires that problems have an identity mass matrix (i.e., :math:`M(t)=I`) -and that the right-hand side function is not split into separate -components. +.. math:: + \dot{y} = f_1(t,y) + f_2(t,y) + \dots + f_P(t,y), \qquad y(t_0) = y_0, -LSRKStep currently supports two families of second-order, explicit, and temporally adaptive STS methods: -Runge--Kutta--Chebyshev (RKC), :cite:p:`VSH:04` and Runge--Kutta--Legendre (RKL), :cite:p:`MBA:14`. These methods have the form +with :math:`P > 1` additive partitions. Operator splitting methods, such as +those implemented in SplittingStep, allow each partition to be integrated +separately, possibly with different numerical integrators or exact solution +procedures. Coupling is only performed though initial conditions which are +passed from the flow of one partition to the next. + +The following algorithmic procedure is used in the Splitting-Step module: + +#. For :math:`i = 1, \dots, r` do: + + #. Set :math:`y_{n, i} = y_{n - 1}`. + + #. For :math:`j = 1, \dots, s` do: + + #. For :math:`k = 1, \dots, P` do: + + #. Let :math:`t_{\text{start}} = t_{n-1} + \beta_{i,j,k} h_n` and + :math:`t_{\text{end}} = t_{n-1} + \beta_{i,j+1,k} h_n`. + + #. Let :math:`v(t_{\text{start}}) = y_{n,i}`. + + #. For :math:`t \in [t_{\text{start}}, t_{\text{end}}]` solve + :math:`\dot{v} = f_{k}(t, v)`. + + #. Set :math:`y_{n, i} = v(t_{\text{end}})`. + +#. Set :math:`y_n = \sum_{i=1}^r \alpha_i y_{n,i}` + +Here, :math:`s` denotes the number of stages, while :math:`r` denotes the number +of sequential methods within the overall operator splitting scheme. The +sequential methods have independent flows which are linearly combined to produce +the next step. The coefficients :math:`\alpha \in \mathbb{R}^{r}` and +:math:`\beta \in \mathbb{R}^{r \times (s + 1) \times P}` determine the +particular scheme and properties such as the order of accuracy. + +An alternative representation of the SplittingStep solution is .. math:: - z_0 &= y_n,\\ - z_1 &= z_0 + h \tilde{\mu}_1 f(t_n,z_0),\\ - z_j &= (1-\mu_j-\nu_j)z_0 + \mu_j z_{j-1} + \nu_jz_{j-2} + h \tilde{\gamma}_j f(t_n,z_0) + h \tilde{\mu}_j f(t_n + c_{j-1}h, z_{j-1}) \\ - y_{n+1} &= z_s. - :label: ARKODE_RKC_RKL + y_n = \sum_{i=1}^P \alpha_i \left( + \phi^P_{\gamma_{i,s,P} h_n} \circ + \phi^{P-1}_{\gamma_{i,s,P-1} h_n} \circ \dots \circ + \phi^{1}_{\gamma_{i,s,1} h_n} \circ + \phi^P_{\gamma_{i,s-1,P} h_n} \circ \dots \circ + \phi^1_{\gamma_{i,s-1,1} h_n} \circ \dots \circ + \phi^P_{\gamma_{i,1,P} h_n} \circ \dots \circ + \phi^1_{\gamma_{i,1,1} h_n} + \right)(y_{n-1}) -The corresponding coefficients can be found in :cite:p:`VSH:04` and :cite:p:`MBA:14`, respectively. +where :math:`\gamma_{i,j,k} = \beta_{i,j+1,k} - \beta_{i,j,k}` is the scaling +factor for the step size, :math:`h_n`, and :math:`\phi^k_{h_n}` is the flow map +for partition :math:`k`: -LSRK methods of STS type are designed for stiff problems characterized by -having Jacobians with eigenvalues that have large real and small imaginary parts. -While those problems are traditionally treated using implicit methods, STS methods -are explicit. To achieve stability for these stiff problems, STS methods use more stages than -conventional Runge-Kutta methods to extend the stability region along the negative -real axis. The extent of this stability region is proportional to the square of the number -of stages used. +.. math:: + \phi^k_{h_n}(y_{n-1}) = v(t_n), + \quad \begin{cases} + v(t_{n-1}) = y_{n-1}, \\ \dot{v} = f_k(t, v). + \end{cases} -LSRK methods of the SSP type are designed to preserve the so-called "strong-stability" properties of advection-type equations. -For details, see :cite:p:`K:08`. -The SSPRK methods in ARKODE use the following Shu--Osher representation :cite:p:`SO:88` of explicit Runge--Kutta methods: +For example, the Lie--Trotter splitting :cite:p:`BCM:24`, given by .. math:: - z_1 &= y_n,\\ - z_i &= \sum_{j = 1}^{i-1} \left(\alpha_{i,j}y_j + \beta_{i,j}h f(t_n + c_jh, z_j)\right),\\ - y_{n+1} &= z_s. - :label: ARKODE_SSP + y_n = L_{h_n}(y_{n-1}) = \left( \phi^P_{h_n} \circ \phi^{P-1}_{h_n} + \circ \dots \circ \phi^1_{h_n} \right) (y_{n-1}), + :label: ARKODE_Lie-Trotter -The coefficients of the Shu--Osher representation are not uniquely determined by the Butcher table :cite:p:`SR:02`. -In particular, the methods SSP(s,2), SSP(s,3), and SSP(10,4) implemented herein and presented in -:cite:p:`K:08` have "almost" all zero coefficients appearing in :math:`\alpha_{i,i-1}` and -:math:`\beta_{i,i-1}`. This feature facilitates their implementation in a low-storage manner. The -corresponding coefficients and embedding weights can be found in :cite:p:`K:08` and :cite:p:`FCS:22`, respectively. +is a first order, one-stage, sequential operator splitting method suitable for +any number of partitions. Its coefficients are + +.. math:: + \alpha_1 &= 1, \\ + \beta_{1,j,k} &= \begin{cases} + 0 & j = 1 \\ + 1 & j = 2 + \end{cases}, \qquad + j = 1, 2 \quad \textrm{and} \quad + k = 1, \dots, P. + +Higher order operator splitting methods are often constructed by composing the +Lie--Trotter splitting with its adjoint: + +.. math:: + L^*_{h_n} = L^{-1}_{-h_n} + = \phi^1_{h_n} \circ \phi^{2}_{h_n} \circ \dots \circ \phi^{P}_{h_n}. + :label: ARKODE_Lie-Trotter_adjoint + +This is the case for the Strang splitting :cite:p:`Strang:68` + +.. math:: + y_n = S_{h_n}(y_{n-1}) = \left( L^*_{h_n/2} \circ L_{h_n/2} \right)(y_{n-1}), + :label: ARKODE_Strang + +which has :math:`P` stages and coefficients + +.. math:: + \alpha_1 &= 1, \\ + \beta_{1,j,k} &= \begin{cases} + 0 & j = 1 \\ + 1 & j + k > P + 1 \\ + \frac{1}{2} & \text{otherwise} + \end{cases}, \qquad + j = 1, \dots, P+1 \quad \textrm{and} \quad + k = 1, \dots, P. + +SplittingStep provides standard operator splitting methods such as the +Lie--Trotter and Strang splitting, as well as schemes of arbitrarily high order. +Alternatively, users may provide their own coefficients (see +:numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients`). Generally, +methods of order three and higher with real coefficients require backward +integration, i.e., there exist negative :math:`\gamma_{i,j,k}` coefficients. +Currently, a fixed time step must be specified for the overall SplittingStep +integrator, but partition integrators are free to use adaptive time steps. + + +.. _ARKODE.Mathematics.SPRKStep: + +SPRKStep -- Symplectic Partitioned Runge--Kutta methods +======================================================= + +The SPRKStep time-stepping module in ARKODE is designed for problems where the +state vector is partitioned as + +.. math:: + y(t) = + \begin{bmatrix} + p(t) \\ + q(t) + \end{bmatrix} + +and the component partitioned IVP is given by + +.. math:: + \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 + +The right-hand side functions :math:`f_1(t,p)` and :math:`f_2(t,q)` typically +arise from the **separable** Hamiltonian system + +.. math:: + H(t, p, q) = T(t, p) + V(t, q) + +where + +.. math:: + 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. +SPRKStep utilizes Symplectic Partitioned Runge-Kutta (SPRK) methods represented by the pair +of explicit and diagonally implicit Butcher tableaux, + +.. math:: + \begin{array}{c|cccc} + c_1 & 0 & \cdots & 0 & 0 \\ + c_2 & a_1 & 0 & \cdots & \vdots \\ + \vdots & \vdots & \ddots & \ddots & \vdots \\ + c_s & a_1 & \cdots & a_{s-1} & 0 \\ + \hline + & a_1 & \cdots & a_{s-1} & a_s + \end{array} + \qquad \qquad + \begin{array}{c|cccc} + \hat{c}_1 & \hat{a}_1 & \cdots & 0 & 0 \\ + \hat{c}_2 & \hat{a}_1 & \hat{a}_2 & \cdots & \vdots \\ + \vdots & \vdots & \ddots & \ddots & \vdots \\ + \hat{c}_s & \hat{a}_1 & \hat{a}_2 & \cdots & \hat{a}_{s} \\ + \hline + & \hat{a}_1 & \hat{a}_2 & \cdots & \hat{a}_{s} + \end{array}. + +These methods approximately conserve a nearby Hamiltonian for exponentially long +times :cite:p:`HaWa:06`. SPRKStep makes the assumption that the Hamiltonian is +separable, in which case the resulting method is explicit. SPRKStep provides +schemes with order of accuracy and conservation equal to +:math:`q = \{1,2,3,4,5,6,8,10\}`. The references for these these methods and +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:`f_1` and +:math:`f_2` +can be ignored). + +#. 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 \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 = P_s, q_n = Q_{s+1}` + +.. _ARKODE.Mathematics.SPRKStep.Compensated: + +Optionally, a different algorithm leveraging compensated summation can be used +that is more robust to roundoff error at the expense of 2 extra vector operations +per stage and an additional 5 per time step. It also requires one extra vector to +be stored. However, it is significantly more robust to roundoff error accumulation +:cite:p:`Sof:02`. When compensated summation is enabled, the following incremental +form is used to compute a time step: + +#. Set :math:`\Delta P_0 = 0, \Delta Q_1 = 0` + +#. For :math:`i = 1,\ldots,s` do: + + #. :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 = \Delta P_s, \Delta 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 requires that ARKODE be run +using a fixed time-step size. + +.. However, it is possible for a user to provide a +.. problem-specific adaptivity controller such as the one described in :cite:p:`HaSo:05`. +.. The `ark_kepler.c` example demonstrates an implementation of such controller. .. _ARKODE.Mathematics.Error.Norm: diff --git a/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst b/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst new file mode 100644 index 0000000000..baf80b2ba1 --- /dev/null +++ b/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst @@ -0,0 +1,185 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.ForcingStep.UserCallable: + +ForcingStep User-callable functions +=================================== + +This section describes the ForcingStep-specific functions that may be called +by the user to setup and then solve an IVP using the ForcingStep time-stepping +module. + +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +ForcingStep does not support any of the categories beyond the functions that +apply for all time-stepping modules. + + +.. _ARKODE.Usage.ForcingStep.Initialization: + +ForcingStep initialization functions +------------------------------------ + +.. c:function:: void* ForcingStepCreate(SUNStepper stepper1, SUNStepper stepper2, sunrealtype t0, N_Vector y0, SUNContext sunctx) + + This function allocates and initializes memory for a problem to be solved + using the ForcingStep time-stepping module in ARKODE. + + :param stepper1: A :c:type:`SUNStepper` to integrate partition one. At + minimum, it must implement the :c:func:`SUNStepper_Evolve`, + :c:func:`SUNStepper_Reset`, and :c:func:`SUNStepper_SetStopTime` + operations. + :param stepper2: A :c:type:`SUNStepper` to integrate partition two + including the forcing from partition one. At + minimum, it must implement the :c:func:`SUNStepper_Evolve`, + :c:func:`SUNStepper_Reset`, :c:func:`SUNStepper_SetStopTime`, and + :c:func:`SUNStepper_SetForcing` operations. + :param t0: The initial value of :math:`t`. + :param y0: The initial condition vector :math:`y(t_0)`. + :param sunctx: The :c:type:`SUNContext` object (see + :numref:`SUNDIALS.SUNContext`) + + :return: If successful, a pointer to initialized problem memory of type + ``void*``, to be passed to all user-facing ForcingStep routines listed + below. If unsuccessful, a ``NULL`` pointer will be returned, and an error + message will be printed to ``stderr``. + + **Example usage:** + + .. code-block:: C + + /* inner ARKODE objects for integrating individual partitions */ + void *partition_mem[] = {NULL, NULL}; + + /* SUNSteppers to wrap the inner ARKStep objects */ + SUNStepper steppers[] = {NULL, NULL}; + + /* create ARKStep objects, setting right-hand side functions and the + initial condition */ + partition_mem[0] = ARKStepCreate(fe1, fi1, t0, y0, sunctx); + partition_mem[1] = ARKStepCreate(fe2, fi2, t0, y0, sunctx); + + /* setup ARKStep */ + . . . + + /* create SUNStepper wrappers for the ARKStep memory blocks */ + flag = ARKodeCreateSUNStepper(partition_mem[0], &stepper[0]); + flag = ARKodeCreateSUNStepper(partition_mem[1], &stepper[1]); + + /* create a ForcingStep object */ + arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y0, sunctx); + + **Example codes:** + * ``examples/arkode/C_serial/ark_analytic_partitioned.c`` + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.ForcingStep.OptionalOutputs: + + +Optional output functions +------------------------------ + +.. c:function:: int ForcingStepGetNumEvolves(void* arkode_mem, int partition, long int *evolves) + + Returns the number of times the :c:type:`SUNStepper` for the given partition + index has been evolved (so far). + + :param arkode_mem: pointer to the ForcingStep memory block. + :param partition: index of the partition (0 or 1) or a negative number to + indicate the total number across both partitions. + :param evolves: number of :c:type:`SUNStepper` evolves. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the ForcingStep memory was ``NULL`` + :retval ARK_ILL_INPUT: if *partition* was out of bounds + + .. versionadded:: x.y.z + + +ForcingStep re-initialization function +-------------------------------------- + +To reinitialize the ForcingStep module for the solution of a new problem, +where a prior call to :c:func:`ForcingStepCreate` has been made, the user must +call the function :c:func:`ForcingStepReInit` and re-initialize each +:c:type:`SUNStepper`. The new problem must have the same size as the previous +one. This routine retains the current settings for all ForcingStep module +options and performs the same input checking and initializations that are done +in :c:func:`ForcingStepCreate`, but it performs no memory allocation as it +assumes that the existing internal memory is sufficient for the new problem. A +call to this re-initialization routine deletes the solution history that was +stored internally during the previous integration, and deletes any +previously-set *tstop* value specified via a call to +:c:func:`ARKodeSetStopTime`. Following a successful call to +:c:func:`ForcingStepReInit`, call :c:func:`ARKodeEvolve` again for +the solution of the new problem. + +One important use of the :c:func:`ForcingStepReInit` function is in the +treating of jump discontinuities in the RHS function. Except in cases of fairly +small jumps, it is usually more efficient to stop at each point of discontinuity +and restart the integrator with a readjusted ODE model, using a call to this +routine. To stop when the location of the discontinuity is known, simply make +that location a value of ``tout``. To stop when the location of the +discontinuity is determined by the solution, use the rootfinding feature. In +either case, it is critical that the RHS function *not* incorporate the +discontinuity, but rather have a smooth extension over the discontinuity, so +that the step across it (and subsequent rootfinding, if used) can be done +efficiently. Then use a switch within the RHS function (communicated through +``user_data``) that can be flipped between the stopping of the integration and +the restart, so that the restarted problem uses the new values (which have +jumped). Similar comments apply if there is to be a jump in the dependent +variable vector. + +Another use of :c:func:`ForcingStepReInit` is changing the partitioning of +the ODE and the :c:type:`SUNStepper` objects used to evolve each partition. + + +.. c:function:: int ForcingStepReInit(void* arkode_mem, SUNStepper stepper1, SUNStepper stepper2, sunrealtype t0, N_Vector y0) + + Provides required problem specifications and re-initializes the ForcingStep + time-stepper module. + + :param arkode_mem: pointer to the ForcingStep memory block. + :param stepper1: A :c:type:`SUNStepper` to integrate partition one. At + minimum, it must implement the :c:func:`SUNStepper_Evolve`, + :c:func:`SUNStepper_Reset`, and :c:func:`SUNStepper_SetStopTime` + operations. + :param stepper2: A :c:type:`SUNStepper` to integrate partition two + including the forcing from partition one. At + minimum, it must implement the :c:func:`SUNStepper_Evolve`, + :c:func:`SUNStepper_Reset`, :c:func:`SUNStepper_SetStopTime`, and + :c:func:`SUNStepper_SetForcing` operations. + :param t0: The initial value of :math:`t`. + :param y0: The initial condition vector :math:`y(t_0)`. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the ForcingStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if a memory allocation failed + :retval ARK_ILL_INPUT: if an argument has an illegal value + + .. warning:: + + This function does not perform any re-initialization of the + :c:type:`SUNStepper` objects. It is up to the user to do this, if + necessary. + + .. note:: + All previously set options are retained but may be updated by calling + the appropriate "Set" functions. + + .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/Usage/ForcingStep/index.rst b/doc/arkode/guide/source/Usage/ForcingStep/index.rst new file mode 100644 index 0000000000..820f4f1d14 --- /dev/null +++ b/doc/arkode/guide/source/Usage/ForcingStep/index.rst @@ -0,0 +1,32 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.ForcingStep: + +========================================== +Using the ForcingStep time-stepping module +========================================== + +This section is concerned with the use of the ForcingStep time-stepping module +for the solution of initial value problems (IVPs) in a C or C++ language +setting. Usage of ForcingStep follows that of the rest of ARKODE, and so in +this section we primarily focus on those usage aspects that are specific to +ForcingStep. A skeleton of a program using ForcingStep follows essentially the +same structure as SplittingStep +(see :numref:`ARKODE.Usage.SplittingStep.Skeleton`). + +.. toctree:: + :maxdepth: 1 + + User_callable diff --git a/doc/arkode/guide/source/Usage/General.rst b/doc/arkode/guide/source/Usage/General.rst index 745e9e9ed9..adaa7b9641 100644 --- a/doc/arkode/guide/source/Usage/General.rst +++ b/doc/arkode/guide/source/Usage/General.rst @@ -51,13 +51,15 @@ to the SUNDIALS core header file. .. code:: c - #include <sundials/sundials_core.h> // Provides core SUNDIALS types - #include <arkode/arkode_erkstep.h> // ERKStep provides explicit RK methods. - #include <arkode/arkode_arkstep.h> // ARKStep provides explicit, implicit, IMEX additive RK methods. - #include <arkode/arkode_mristep.h> // MRIStep provides mutlirate RK methods. - #include <arkode/arkode_sprkstep.h> // SPRKStep provides symplectic partition RK methods. - #include <arkode/arkode_lsrkstep.h> // LSRKStep provides low-storage RK methods. - + #include <sundials/sundials_core.h> // Provides core SUNDIALS types + #include <arkode/arkode_arkstep.h> // ARKStep provides explicit, implicit, IMEX additive RK methods. + #include <arkode/arkode_erkstep.h> // ERKStep provides explicit RK methods. + #include <arkode/arkode_forcingstep.h> // ForcingStep provides a forcing method. + #include <arkode/arkode_lsrkstep.h> // LSRKStep provides low-storage RK methods. + #include <arkode/arkode_mristep.h> // MRIStep provides multirate RK methods. + #include <arkode/arkode_splittingstep.h> // SplittingStep provides operator splitting methods. + #include <arkode/arkode_sprkstep.h> // SPRKStep provides symplectic partitioned RK methods. + Each of these define several types and various constants, include function prototypes, and include the shared ``arkode/arkode.h`` and ``arkode/arkode_ls.h`` header files. No other header files are required to be diff --git a/doc/arkode/guide/source/Usage/SplittingStep/Skeleton.rst b/doc/arkode/guide/source/Usage/SplittingStep/Skeleton.rst new file mode 100644 index 0000000000..0c1e82e36c --- /dev/null +++ b/doc/arkode/guide/source/Usage/SplittingStep/Skeleton.rst @@ -0,0 +1,112 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + Based on MRIStep by David J. Gardner @ LLNL + Daniel R. Reynolds @ SMU + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.SplittingStep.Skeleton: + +A skeleton of the user's main program +============================================ + +While SplittingStep usage generally follows the same pattern as the rest of +ARKODE, since it is the composition of other steppers, we summarize the +differences in using SplittingStep here. Steps that are unchanged from the +skeleton program presented in :numref:`ARKODE.Usage.Skeleton` are *italicized*. + +.. index:: SplittingStep user main program + +#. *Initialize parallel or multi-threaded environment, if appropriate.* + +#. *Create the SUNDIALS simulation context object* + +#. *Set problem dimensions, etc.* + +#. *Set vector of initial values* + +#. Create a stepper object for each problem partition + + * If using an ARKODE stepper module as an partition integrator, create and + configure the stepper as normal following the steps detailed in the section + for the desired stepper. + + Once the ARKODE stepper object is setup, create a :c:type:`SUNStepper` + object with :c:func:`ARKodeCreateSUNStepper`. + + * If supplying a user-defined partition integrator, create the + :c:type:`SUNStepper` object as described in section + :numref:`SUNStepper.Implementing`. + + .. note:: + + When using ARKODE for partition integrators, it is the user's + responsibility to create and configure the integrator. User-specified + options regarding how the integration should be performed (e.g., adaptive + vs. fixed time step, explicit/implicit/ImEx partitioning, algebraic + solvers, etc.) will be respected during evolution of a partition during + SplittingStep integration. + + If a *user_data* pointer needs to be passed to user functions called by + a partition integrator then it should be attached to the partition integrator here by calling + :c:func:`ARKodeSetUserData`. This *user_data* pointer will only be + passed to user-supplied functions that are attached to a partition + integrator. To supply a *user_data* pointer to user-supplied functions + called by the SplittingStep integrator, the desired pointer should be + attached by calling :c:func:`ARKodeSetUserData` after creating the + SplittingStep memory below. The *user_data* pointers attached to the + partition and SplittingStep integrators may be the same or different + depending on what is required by the user code. + + Specifying a rootfinding problem for a partition integrator is not + supported. Rootfinding problems should be created and initialized with + SplittingStep. See the steps below and :c:func:`ARKodeRootInit` for more + details. + +#. Create a SplittingStep object + + Create the SplittingStep object by calling :c:func:`SplittingStepCreate`. One + of the inputs to :c:func:`SplittingStepCreate` is an array of + :c:type:`SUNStepper` objects with one to evolve each partition. + +#. Set the SplittingStep step size + + Call :c:func:`ARKodeSetFixedStep()` on the SplittingStep object to specify + the overall time step size. + +#. *Set optional inputs* + +#. *Specify rootfinding problem* + +#. *Advance solution in time* + +#. *Get optional outputs* + +#. *Deallocate memory for solution vector* + +#. Free solver memory + + * If an ARKODE stepper module was used as a partition IVP integrator, call + :c:func:`SUNStepper_Destroy` and :c:func:`ARKodeFree` to free the memory + allocated for that integrator. + + * If a user-defined partition integrator was supplied, free the integrator + content and call :c:func:`SUNStepper_Destroy` to free the :c:type:`SUNStepper` + object. + + * Call :c:func:`ARKodeFree` to free the memory allocated for the + SplittingStep integration object. + +#. *Free the SUNContext object* + +#. *Finalize MPI, if used* diff --git a/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst b/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst new file mode 100644 index 0000000000..21b9acf876 --- /dev/null +++ b/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst @@ -0,0 +1,434 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.SplittingStep.SplittingStepCoefficients: + +Operator Splitting Coefficients Data Structure +---------------------------------------------- + +SplittingStep supplies several functions to construct operator splitting +coefficients of various orders and partitions. There are also a number of +built-in methods of fixed orders and partitions (see +:numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients`). +Finally, a user may construct a custom set of coefficients and attach it with +:c:func:`SplittingStepSetCoefficients`. The operator splitting coefficients are +stored in a :c:type:`SplittingStepCoefficients` object which is a pointer to a +:c:struct:`SplittingStepCoefficientsMem` structure: + +.. c:type:: SplittingStepCoefficientsMem *SplittingStepCoefficients + +.. c:struct:: SplittingStepCoefficientsMem + + Structure for storing the coefficients defining an operator splitting method. + + As described in :numref:`ARKODE.Mathematics.SplittingStep`, an operator + splitting method is defined by a vector :math:`\alpha \in \mathbb{R}^{r}` and + a tensor :math:`\beta \in \mathbb{R}^{r \times (s + 1) \times P}` where :math:`r` is + the number of sequential methods, :math:`s` is the number of stages, and :math:`P` + is the number of partitions. + + .. c:member:: sunrealtype *alpha + + An array containing the weight of each sequential method used to produce the + overall operator splitting solution. The array is of length + ``[sequential_methods]``. + + .. c:member:: sunrealtype ***beta + + A three-dimensional array containing the time nodes of the partition integrations. + The array has dimensions ``[sequential_methods][stages+1][partitions]``. + + .. c:member:: int sequential_methods + + The number of sequential methods, :math:`r`, combined to produce the overall + operator splitting solution + + .. c:member:: int stages + + The number of stages, :math:`s` + + .. c:member:: int partitions + + The number of partitions, :math:`P`, in the IVP + + .. c:member:: int order + + The method order of accuracy + + +.. _ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Functions: + +SplittingStepCoefficients Functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +This section describes the functions for creating and interacting with operator +splitting coefficients. The function prototypes and as well as the relevant +integer constants are defined ``arkode/arkode_splittingstep.h``. + +.. _ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Functions.Table: +.. table:: SplittingStepCoefficients functions + + +--------------------------------------------------------------+--------------------------------------------------------------+ + | Function name | Description | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_LoadCoefficients()` | Load a pre-defined SplittingStepCoefficients by ID | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_LoadCoefficientsByName()` | Load a pre-defined SplittingStepCoefficients by name | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_IDToName()` | Convert a pre-defined SplittingStepCoefficients to its name | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_LieTrotter()` | Create a Lie--Trotter splitting method | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Strang()` | Create a Strang splitting method | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_SymmetricParallel()` | Create a symmetrization of the Lie--Trotter splitting method | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_ThirdOrderSuzuki()` | Create a third order composition method of Suzuki | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_TripleJump()` | Create an arbitrary order, three-jump composition method | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_SuzukiFractal()` | Create an arbitrary order, five-jump composition method | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Alloc()` | Allocate an empty :c:type:`SplittingStepCoefficients` | + | | object | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Create()` | Create a new :c:type:`SplittingStepCoefficients` object | + | | from coefficient arrays | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Copy()` | Create a copy of a :c:type:`SplittingStepCoefficients` | + | | object | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Destroy()` | Deallocate a :c:type:`SplittingStepCoefficients` object | + +--------------------------------------------------------------+--------------------------------------------------------------+ + | :c:func:`SplittingStepCoefficients_Write()` | Write the :c:type:`SplittingStepCoefficients` object to an | + | | output file | + +--------------------------------------------------------------+--------------------------------------------------------------+ + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_LoadCoefficients(ARKODE_SplittingCoefficientsID method) + + Retrieves specified splitting coefficients. For further information on the + current set of splitting coefficients and their corresponding identifiers, + see + :numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients`. + + :param method: the splitting coefficients identifier. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``method`` was invalid or an allocation error occurred. + + .. versionadded:: x.y.z + + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_LoadCoefficientsByName(const char *method) + + Retrieves specified splitting coefficients. For further information on the + current set of splitting coefficients and their corresponding name, see + :numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients`. + + :param method: the splitting coefficients identifier. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``method`` was invalid or an allocation error occurred. + + .. note:: + + This function is case sensitive. + + .. versionadded:: x.y.z + + +.. c:function:: const char* SplittingStepCoefficients_IDToName(ARKODE_SplittingCoefficientsID method) + + Converts specified splitting coefficients ID to a string of the same name. + For further information on the current set of splitting coefficients and + their corresponding name, see + :numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients`. + + :param method: the splitting coefficients identifier. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``method`` was invalid or an allocation error occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_LieTrotter(int partitions) + + Create the coefficients for the first order Lie--Trotter splitting, + see :eq:`ARKODE_Lie-Trotter`. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``partitions`` was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Strang(int partitions) + + Create the coefficients for the second order Strang splitting + :cite:p:`Strang:68`, see :eq:`ARKODE_Strang`. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``partitions`` was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Parallel(int partitions) + + Create the coefficients for the first order parallel splitting method + + .. math:: + y_n = \phi^1_{h_n}(y_{n-1}) + \phi^2_{h_n}(y_{n-1}) + \dots + + \phi^P_{h_n}(y_{n-1}) + (1 - P) y_{n-1}. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``partitions`` was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_SymmetricParallel(int partitions) + + Create the coefficients for the second order, symmetrized Lie--Trotter + splitting :cite:p:`Strang:63` + + .. math:: + y_n = \frac{1}{2} \left( L_{h_n}(y_{n-1}) + L^*_{h_n}(y_{n-1}) \right), + + where :math:`L_{h_n}` is the Lie--Trotter splitting :eq:`ARKODE_Lie-Trotter` + and :math:`L^*_{h_n}` is its adjoint :eq:`ARKODE_Lie-Trotter_adjoint`. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``partitions`` was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_ThirdOrderSuzuki(int partitions) + + Create the coefficients for a splitting method of Suzuki :cite:p:`Suzuki:92` + + .. math:: + y_n = \left( L_{p_1 h_n} \circ L^*_{p_2 h_n} \circ L_{p_3 h_n} + \circ L^*_{p_4 h_n} \circ L_{p_5 h_n} \right) (y_{n-1}), + + where :math:`L_{h_n}` is the Lie--Trotter splitting :eq:`ARKODE_Lie-Trotter` + and :math:`L^*_{h_n}` is its adjoint :eq:`ARKODE_Lie-Trotter_adjoint`. The + parameters :math:`p_1, \dots, p_5` are selected to give third order. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if ``partitions`` was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_TripleJump(int partitions, int order) + + Create the coefficients for the triple jump splitting method + :cite:p:`CrGo:89` + + .. math:: + T_{h_n}^{[2]} &= S_{h_n}, \\ + T_{h_n}^{[i+2]} &= T_{\gamma_1 h_n}^{[i]} \circ + T_{(1 - 2 \gamma_1) h_n}^{[i]} \circ T_{\gamma_1 h_n}^{[i]}, \\ + y_n &= T_{h_n}^{[\mathrm{order}]}(y_{n-1}), + + where :math:`S` is the Strang splitting :eq:`ARKODE_Strang` and + :math:`\gamma_1` is selected to increase the order by two each recursion. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :param order: A positive even number for the method order of accuracy. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if an argument was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_SuzukiFractal(int partitions, int order) + + Create the coefficients for the quintuple jump splitting method + :cite:p:`Suzuki:90` + + .. math:: + Q_{h_n}^{[2]} &= S_{h_n}, \\ + Q_{h_n}^{[i+2]} &= Q_{\gamma_1 h_n}^{[i]} \circ + Q_{\gamma_1 h_n}^{[i]} \circ Q_{(1 - 4 \gamma_1) h_n}^i \circ + Q_{\gamma_1 h_n}^{[i]} \circ Q_{\gamma_1 h_n}^{[i]}, \\ + y_n &= Q_{h_n}^{[\mathrm{order}]}(y_{n-1}), + + where :math:`S` is the Strang splitting :eq:`ARKODE_Strang` and + :math:`\gamma_1` is selected to increase the order by two each recursion. + + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :param order: A positive even number for the method order of accuracy. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if an argument was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Alloc(int sequential_methods, int stages, int partitions) + + Allocates an empty :c:type:`SplittingStepCoefficients` object. + + :param sequential_methods: The number of sequential methods, :math:`r \geq 1`, + combined to produce the overall operator splitting solution. + :param stages: The number of stages, :math:`s \geq 1`. + :param partitions: The number of partitions, :math:`P > 1`, in the IVP. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if an argument was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Create(int sequential_methods, int stages, int partitions, int order, sunrealtype* alpha, sunrealtype* beta) + + Allocates a :c:type:`SplittingStepCoefficients` object and fills it with the + given values. + + :param sequential_methods: The number of sequential methods, :math:`r \geq 1` + combined to produce the overall operator splitting solution. + :param stages: The number of stages, :math:`s \geq 1`. + :param partitions: The number of partitions, :math:`P > 1` in the IVP. + :param order: The method order of accuracy. + :param alpha: An array of length ``sequential_methods`` containing the weight + of each sequential method used to produce the overall operator splitting + solution. + :param beta: An array of length + ``sequential_methods * (stages+1) * partitions`` containing the time nodes + of the partition integrations in the C order + + .. math:: + & \beta_{1,1,1}, \dots, \beta_{1,1,P}, + \dots, + \beta_{1,s+1,1}, \dots, \beta_{1,s+1,P}, + \dots, \\ + & \beta_{2,1,1}, \dots, \beta_{2,1,P}, + \dots, + \beta_{2,s+1,1}, \dots, \beta_{2,s+1,P}, + \dots, \\ + & \beta_{r,1,1}, \dots, \beta_{r,1,P}, + \dots, + \beta_{r,s+1,1}, \dots, \beta_{r,s+1,P}. + + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if an argument was invalid or an allocation error + occurred. + + .. versionadded:: x.y.z + + +.. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Copy(SplittingStepCoefficients coefficients) + + Creates copy of the given splitting coefficients. + + :param coefficients: The splitting coefficients to copy. + :return: A :c:type:`SplittingStepCoefficients` structure if successful or a + ``NULL`` pointer if an allocation error occurred. + + .. versionadded:: x.y.z + + +.. c:function:: void SplittingStepCoefficients_Destroy(SplittingStepCoefficients* coefficients) + + Deallocate the splitting coefficients memory. + + :param coefficients: A pointer to the splitting coefficients. + + .. versionadded:: x.y.z + + +.. c:function:: void SplittingStepCoefficients_Write(SplittingStepCoefficients coefficients, FILE* outfile) + + Write the splitting coefficients to the provided file pointer. + + :param coefficients: The splitting coefficients. + :param outfile: Pointer to use for printing the splitting coefficients. It + can be ``stdout`` or ``stderr``, or it may point to a specific file + created using ``fopen``. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients: + +Operator Splitting Coefficients +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +SplittingStep currently provides several pre-defined coefficients for problems +with two partitions. We list the identifiers, order of accuracy, and relevant +references for each in the table below. We use the naming convention + +.. code-block:: text + + ARKODE_SPLITTING_<name>_<stages>_<order>_<partitions> + +Each of the splitting coefficients that are packaged with SplittingStep are +specified by a unique ID having type: + +.. c:enum:: ARKODE_SplittingCoefficientsID + +with values specified for each method below (e.g., +``ARKODE_SPLITTING_LIE_TROTTER_1_1_2``). + +.. table:: Operator splitting coefficients. + + ====================================== ===== ===================== + Table name Order Reference + ====================================== ===== ===================== + ``ARKODE_SPLITTING_LIE_TROTTER_1_1_2`` 1 + ``ARKODE_SPLITTING_STRANG_2_2_2`` 2 :cite:p:`Strang:68` + ``ARKODE_SPLITTING_BEST_2_2_2`` 2 :cite:p:`AuHoKeKo:16` + ``ARKODE_SPLITTING_SUZUKI_3_3_2`` 3 :cite:p:`Suzuki:92` + ``ARKODE_SPLITTING_RUTH_3_3_2`` 3 :cite:p:`Ruth:93` + ``ARKODE_SPLITTING_YOSHIDA_4_4_2`` 4 :cite:p:`Yoshida:90` + ``ARKODE_SPLITTING_YOSHIDA_8_6_2`` 6 :cite:p:`Yoshida:90` + ====================================== ===== ===================== + + +.. _ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Default: + +Default Operator Splitting Coefficients +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The default SplittingStep coefficients are Lie--Trotter. If a particular order +is requested with :c:func:`ARKodeSetOrder`, the following are the default for +each order + +.. table:: Default operator splitting coefficients by order. + + ============ ========================================================== + Order Default operator splitting coefficients + ============ ========================================================== + 1 :c:func:`SplittingStepCoefficients_LieTrotter` + 2 :c:func:`SplittingStepCoefficients_Strang` + 3 :c:func:`SplittingStepCoefficients_ThirdOrderSuzuki` + 4, 6, 8, ... :c:func:`SplittingStepCoefficients_TripleJump` + 5, 7, 9, ... Warning: this will select a triple jump method of the next + even order + ============ ========================================================== diff --git a/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst b/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst new file mode 100644 index 0000000000..78252a247f --- /dev/null +++ b/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst @@ -0,0 +1,212 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.SplittingStep.UserCallable: + +SplittingStep User-callable functions +===================================== + +This section describes the SplittingStep-specific functions that may be called +by the user to setup and then solve an IVP using the SplittingStep time-stepping +module. + +As discussed in the main :ref:`ARKODE user-callable function introduction +<ARKODE.Usage.UserCallable>`, each of ARKODE's time-stepping modules +clarifies the categories of user-callable functions that it supports. +SplittingStep does not support any of the categories beyond the functions that +apply for all time-stepping modules. + + +.. _ARKODE.Usage.SplittingStep.Initialization: + +SplittingStep initialization functions +-------------------------------------- + +.. c:function:: void* SplittingStepCreate(SUNStepper* steppers, int partitions, sunrealtype t0, N_Vector y0, SUNContext sunctx) + + This function allocates and initializes memory for a problem to be solved + using the SplittingStep time-stepping module in ARKODE. + + :param steppers: an array of :c:type:`SUNStepper` objects with one for each + partition of the IVP. At minimum, they must implement the + :c:func:`SUNStepper_Evolve`, :c:func:`SUNStepper_Reset`, + :c:func:`SUNStepper_SetStopTime`, and + :c:func:`SUNStepper_SetStepDirection` operations. + :param partitions: the number of partitions, :math:`P > 1`, in the IVP. + :param t0: the initial value of :math:`t`. + :param y0: the initial condition vector :math:`y(t_0)`. + :param sunctx: the :c:type:`SUNContext` object (see + :numref:`SUNDIALS.SUNContext`) + + :return: If successful, a pointer to initialized problem memory of type + ``void*``, to be passed to all user-facing SplittingStep routines listed + below. If unsuccessful, a ``NULL`` pointer will be returned, and an error + message will be printed to ``stderr``. + + **Example usage:** + + .. code-block:: C + + /* ARKODE objects for integrating individual partitions */ + void *partition_mem[] = {NULL, NULL}; + + /* SUNSteppers to wrap the ARKODE objects */ + SUNStepper steppers[] = {NULL, NULL}; + + /* create ARKODE objects, setting right-hand side functions and the + initial condition */ + partition_mem[0] = ERKStepCreate(f1, t0, y0, sunctx); + partition_mem[1] = ARKStepCreate(fe2, fi2, t0, y0, sunctx); + + /* setup ARKODE objects */ + . . . + + /* create SUNStepper wrappers for the ARKODE memory blocks */ + flag = ARKodeCreateSUNStepper(partition_mem[0], &stepper[0]); + flag = ARKodeCreateSUNStepper(partition_mem[1], &stepper[1]); + + /* create a SplittingStep object with two partitions */ + arkode_mem = SplittingStepCreate(steppers, 2, t0, y0, sunctx); + + **Example codes:** + * ``examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c`` + * ``examples/arkode/C_serial/ark_analytic_partitioned.c`` + + .. versionadded:: x.y.z + + +Optional inputs for IVP method selection +---------------------------------------- + +.. c:function:: int SplittingStepSetCoefficients(void* arkode_mem, SplittingStepCoefficients coefficients) + + Specifies a set of coefficients for the operator splitting method. + + :param arkode_mem: pointer to the SplittingStep memory block. + :param coefficients: the splitting coefficients for the method. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the SplittingStep memory is ``NULL`` + :retval ARK_ILL_INPUT: if an argument has an illegal value + + .. note:: + + For a description of the :c:type:`SplittingStepCoefficients` type and + related functions for creating splitting coefficients see + :numref:`ARKODE.Usage.SplittingStep.SplittingStepCoefficients`. + + .. warning:: + + This should not be used with :c:func:`ARKodeSetOrder`. + + .. versionadded:: x.y.z + + +.. _ARKODE.Usage.SplittingStep.OptionalOutputs: + + +Optional output functions +------------------------------ + +.. c:function:: int SplittingStepGetNumEvolves(void* arkode_mem, int partition, long int *evolves) + + Returns the number of times the :c:type:`SUNStepper` for the given partition + index has been evolved (so far). + + :param arkode_mem: pointer to the SplittingStep memory block. + :param partition: index of the partition between 0 and :math:`P - 1` or a + negative number to indicate the total number across all + partitions. + :param evolves: number of :c:type:`SUNStepper` evolves. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the SplittingStep memory was ``NULL`` + :retval ARK_ILL_INPUT: if *partition* was out of bounds + + .. versionadded:: x.y.z + + +SplittingStep re-initialization function +---------------------------------------- + +To reinitialize the SplittingStep module for the solution of a new problem, +where a prior call to :c:func:`SplittingStepCreate` has been made, the user must +call the function :c:func:`SplittingStepReInit` and re-initialize each +:c:type:`SUNStepper`. The new problem must have the same size as the previous +one. This routine retains the current settings for all SplittingStep module +options and performs the same input checking and initializations that are done +in :c:func:`SplittingStepCreate`, but it performs no memory allocation as it +assumes that the existing internal memory is sufficient for the new problem. A +call to this re-initialization routine deletes the solution history that was +stored internally during the previous integration, and deletes any +previously-set *tstop* value specified via a call to +:c:func:`ARKodeSetStopTime`. Following a successful call to +:c:func:`SplittingStepReInit`, call :c:func:`ARKodeEvolve` again for +the solution of the new problem. + +One important use of the :c:func:`SplittingStepReInit` function is in the +treating of jump discontinuities in the RHS function. Except in cases of fairly +small jumps, it is usually more efficient to stop at each point of discontinuity +and restart the integrator with a readjusted ODE model, using a call to this +routine. To stop when the location of the discontinuity is known, simply make +that location a value of ``tout``. To stop when the location of the +discontinuity is determined by the solution, use the rootfinding feature. In +either case, it is critical that the RHS function *not* incorporate the +discontinuity, but rather have a smooth extension over the discontinuity, so +that the step across it (and subsequent rootfinding, if used) can be done +efficiently. Then use a switch within the RHS function (communicated through +``user_data``) that can be flipped between the stopping of the integration and +the restart, so that the restarted problem uses the new values (which have +jumped). Similar comments apply if there is to be a jump in the dependent +variable vector. + +Another use of :c:func:`SplittingStepReInit` is changing the partitioning of +the ODE and the :c:type:`SUNStepper` objects used to evolve each partition. + + +.. c:function:: int SplittingStepReInit(void* arkode_mem, SUNStepper* steppers, int partitions, sunrealtype t0, N_Vector y0) + + Provides required problem specifications and re-initializes the SplittingStep + time-stepper module. + + :param arkode_mem: pointer to the SplittingStep memory block. + :param steppers: an array of :c:type:`SUNStepper` objects with one for each + partition of the IVP. At minimum, they must implement the + :c:func:`SUNStepper_Evolve`, :c:func:`SUNStepper_Reset`, + :c:func:`SUNStepper_SetStopTime`, and + :c:func:`SUNStepper_SetStepDirection` operations. + :param partitions: the number of partitions, :math:`P > 1`, in the IVP. + :param t0: the initial value of :math:`t`. + :param y0: the initial condition vector :math:`y(t_0)`. + + :retval ARK_SUCCESS: if successful + :retval ARK_MEM_NULL: if the SplittingStep memory was ``NULL`` + :retval ARK_MEM_FAIL: if a memory allocation failed + :retval ARK_ILL_INPUT: if an argument has an illegal value + + .. warning:: + + This function does not perform any re-initialization of the + :c:type:`SUNStepper` objects. It is up to the user to do this, if + necessary. + + .. warning:: + + If the number of partitions changes and coefficients were previously + specified with :c:func:`SplittingStepSetCoefficients`, the coefficients + will be reset since they are no longer compatible. Otherwise, all + previously set options are retained but may be updated by calling the + appropriate "Set" functions. + + .. versionadded:: x.y.z diff --git a/doc/arkode/guide/source/Usage/SplittingStep/index.rst b/doc/arkode/guide/source/Usage/SplittingStep/index.rst new file mode 100644 index 0000000000..1a8719e36f --- /dev/null +++ b/doc/arkode/guide/source/Usage/SplittingStep/index.rst @@ -0,0 +1,32 @@ +.. ---------------------------------------------------------------- + Programmer(s): Steven B. Roberts @ LLNL + ---------------------------------------------------------------- + SUNDIALS Copyright Start + Copyright (c) 2002-2024, 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.Usage.SplittingStep: + +============================================ +Using the SplittingStep time-stepping module +============================================ + +This section is concerned with the use of the SplittingStep time-stepping module +for the solution of initial value problems (IVPs) in a C or C++ language +setting. Usage of SplittingStep follows that of the rest of ARKODE, and so in +this section we primarily focus on those usage aspects that are specific to +SplittingStep. + +.. toctree:: + :maxdepth: 1 + + Skeleton + User_callable + SplittingStepCoefficients diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index fc11496f61..6a9ab9fcfe 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -47,8 +47,13 @@ E. functions that apply for time-stepping modules that support relaxation Runge- In the function descriptions below, we identify those that have any of the restrictions B-E above. Then in the introduction for each of the stepper-specific documentation sections -(:numref:`ARKODE.Usage.ARKStep.UserCallable`, :numref:`ARKODE.Usage.ERKStep.UserCallable`, -:numref:`ARKODE.Usage.MRIStep.UserCallable`, and :numref:`ARKODE.Usage.SPRKStep.UserCallable`) +(:numref:`ARKODE.Usage.ARKStep.UserCallable`, +:numref:`ARKODE.Usage.ERKStep.UserCallable`, +:numref:`ARKODE.Usage.ForcingStep.UserCallable`, +:numref:`ARKODE.Usage.LSRKStep.UserCallable`, +:numref:`ARKODE.Usage.MRIStep.UserCallable`, +:numref:`ARKODE.Usage.SplittingStep.UserCallable`, +and :numref:`ARKODE.Usage.SPRKStep.UserCallable`) we clarify the categories of these functions that are supported. @@ -58,7 +63,10 @@ ARKODE initialization and deallocation functions ------------------------------------------------------ For functions to create an ARKODE stepper instance see :c:func:`ARKStepCreate`, -:c:func:`ERKStepCreate`, :c:func:`MRIStepCreate`, or :c:func:`SPRKStepCreate`. +:c:func:`ERKStepCreate`, :c:func:`ForcingStepCreate`, +:c:func:`LSRKStepCreateSTS`, :c:func:`LSRKStepCreateSSP`, +:c:func:`MRIStepCreate`, :c:func:`SplittingStepCreate`, or +:c:func:`SPRKStepCreate`. .. c:function:: void ARKodeFree(void** arkode_mem) @@ -880,6 +888,7 @@ Set dense output interpolation type (SPRKStep) :c:func:`ARKodeSetInterpolantT Set dense output interpolation type (others) :c:func:`ARKodeSetInterpolantType` ``ARK_INTERP_HERMITE`` Set dense output polynomial degree :c:func:`ARKodeSetInterpolantDegree` 5 Disable time step adaptivity (fixed-step mode) :c:func:`ARKodeSetFixedStep` disabled +Set forward or backward integration direction :c:func:`ARKodeSetStepDirection` 0.0 Supply an initial step size to attempt :c:func:`ARKodeSetInitStep` estimated Maximum no. of warnings for :math:`t_n+h = t_n` :c:func:`ARKodeSetMaxHnilWarns` 10 Maximum no. of internal steps before *tout* :c:func:`ARKodeSetMaxNumSteps` 500 @@ -1096,6 +1105,35 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr .. versionadded:: 6.1.0 +.. c:function:: int ARKodeSetStepDirection(void* arkode_mem, sunrealtype stepdir) + + Specifies the direction of integration (forward or backward). + + :param arkode_mem: pointer to the ARKODE memory block. + :param stepdir: value whose sign determines the direction. A positive value + selects forward integration, a negative value selects + backward integration, and zero leaves the current direction + unchanged. + + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + :retval ARK_ILL_INPUT: an argument had an illegal value. + + .. note:: + + The step direction can only be set after a call to either ``*Create``, + ``*StepReInit``, or :c:func:`ARKodeReset` but before a call to + :c:func:`ARKodeEvolve`. + + When the direction changes for an adaptive method, the adaptivity + controller and next step size are reset. A new initial step size will be + estimated at the next call to :c:func:`ARKodeEvolve` or can be specified + with :c:func:`ARKodeSetInitStep`. + + .. versionadded:: x.y.z + + .. c:function:: int ARKodeSetInitStep(void* arkode_mem, sunrealtype hin) @@ -3241,6 +3279,7 @@ Cumulative number of internal steps :c:func:`ARKodeGetNumStep Actual initial time step size used :c:func:`ARKodeGetActualInitStep` Step size used for the last successful step :c:func:`ARKodeGetLastStep` Step size to be attempted on the next step :c:func:`ARKodeGetCurrentStep` +Integration direction, e.g., forward or backward :c:func:`ARKodeGetStepDirection` Current internal time reached by the solver :c:func:`ARKodeGetCurrentTime` Current internal solution reached by the solver :c:func:`ARKodeGetCurrentState` Current :math:`\gamma` value used by the solver :c:func:`ARKodeGetCurrentGamma` @@ -3343,6 +3382,22 @@ Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumul .. versionadded:: 6.1.0 +.. c:function:: int ARKodeGetStepDirection(void *arkode_mem, sunrealtype *stepdir) + + Returns the direction of integration that will be used on the next internal + step. + + :param arkode_mem: pointer to the ARKODE memory block. + :param stepdir: a positive number if integrating forward, a negative number + if integrating backward, or zero if the direction has not + been set. + + :retval ARK_SUCCESS: the function exited successfully. + :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. + + .. versionadded:: x.y.z + + .. c:function:: int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) Returns the current internal time reached by the solver. diff --git a/doc/arkode/guide/source/Usage/index.rst b/doc/arkode/guide/source/Usage/index.rst index 88cbfa7d3d..bc6232e8ee 100644 --- a/doc/arkode/guide/source/Usage/index.rst +++ b/doc/arkode/guide/source/Usage/index.rst @@ -37,8 +37,12 @@ ARKODE's time stepping modules, including "relaxation" methods and preconitioners. Following our discussion of these commonalities, we separately discuss the usage details that that are specific to each of ARKODE's time stepping modules: :ref:`ARKStep <ARKODE.Usage.ARKStep>`, -:ref:`ERKStep <ARKODE.Usage.ERKStep>`, :ref:`SPRKStep <ARKODE.Usage.SPRKStep>`, -:ref:`MRIStep <ARKODE.Usage.MRIStep>`, and :ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. +:ref:`ERKStep <ARKODE.Usage.ERKStep>`, +:ref:`ForcingStep <ARKODE.Usage.ForcingStep>`, +:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`, +:ref:`MRIStep <ARKODE.Usage.MRIStep>`, +:ref:`SplittingStep <ARKODE.Usage.SplittingStep>`, and +:ref:`SPRKStep <ARKODE.Usage.SPRKStep>`. ARKODE also uses various input and output constants; these are defined as needed throughout this chapter, but for convenience the full list is provided @@ -77,6 +81,8 @@ ARKBBDPRE can only be used with NVECTOR_PARALLEL. Preconditioners ARKStep/index.rst ERKStep/index.rst + ForcingStep/index.rst LSRKStep/index.rst - SPRKStep/index.rst MRIStep/index.rst + SplittingStep/index.rst + SPRKStep/index.rst diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ff174afb81..c4cac39aa7 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,11 +1,29 @@ **Major Features** +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, +:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. This currently supports five explicit low-storage +methods: the second-order Runge--Kutta--Chebyshev and Runge--Kutta--Legendre methods, +and the second- through fourth-order optimal strong stability preserving Runge--Kutta methods. +All methods include embeddings for temporal adaptivity. + +Added an operator splitting module, +:ref:`SplittingStep <ARKODE.Usage.SplittingStep>`, and forcing method module, +:ref:`ForcingStep <ARKODE.Usage.ForcingStep>`, to ARKODE. These modules support +a broad range of operator-split time integration methods for multiphysics +applications. + **New Features and Enhancements** +Added the :c:func:`ARKodeSetStepDirection` and :c:func:`ARKodeGetStepDirection` +functions to change and query the direction of integration. + Added the :c:type:`SUNStepper` base class to represent a generic solution -procedure for IVPs. A SUNStepper can be created from an ARKODE memory block with -the new function :c:func:`ARKodeCreateSUNStepper`. To enable interoperability -with :c:type:`MRIStepInnerStepper`, the function +procedure for IVPs. This is used by the +:ref:`SplittingStep <ARKODE.Usage.SplittingStep>` and +:ref:`ForcingStep <ARKODE.Usage.ForcingStep>` modules of ARKODE. A SUNStepper +can be created from an ARKODE memory block with the new function +:c:func:`ARKodeCreateSUNStepper`. To enable interoperability with +:c:type:`MRIStepInnerStepper`, the function :c:func:`MRIStepInnerStepper_CreateFromSUNStepper` was added. The following DIRK schemes now have coefficients accurate to quad precision: @@ -28,12 +46,6 @@ only valid for Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. -Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, -:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. This currently supports five explicit low-storage -methods: the second-order Runge--Kutta--Chebyshev and Runge--Kutta--Legendre methods, -and the second- through fourth-order optimal strong stability preserving Runge--Kutta methods. -All methods include embeddings for temporal adaptivity. - The Trilinos Tpetra NVector interface has been updated to utilize CMake imported targets added in Trilinos 14 to improve support for different Kokkos backends with Trilinos. As such, Trilinos 14 or newer is required and the diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index bdd9f72079..4350c1db0b 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -1689,6 +1689,20 @@ @inproceedings{Caliper:2016 % FROM ARKODE %--------------------------------------------------------- +@article{AuHoKeKo:16, + title = {Practical splitting methods for the adaptive integration of nonlinear evolution equations. {P}art {I}: {C}onstruction of optimized schemes and pairs of schemes}, + volume = {57}, + ISSN = {1572-9125}, + DOI = {10.1007/s10543-016-0626-9}, + number = {1}, + journal = {BIT Numerical Mathematics}, + publisher = {Springer Science and Business Media LLC}, + author = {Auzinger, Winfried and Hofst\"{a}tter, Harald and Ketcheson, David and Koch, Othmar}, + year = {2016}, + month = jul, + pages = {55–74} +} + @article{Bank:85, author = {Bank, R.E. and Coughran, W.M. and Fichtner, W. and Grosse, E.H. and Rose, D.J. and Smith, R.K.}, journal = {IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems}, @@ -1707,6 +1721,16 @@ @article{Billington:83 year = {1983} } +@article{BCM:24, + title={Splitting methods for differential equations}, + volume={33}, + DOI={10.1017/S0962492923000077}, + journal={Acta Numerica}, + author={Blanes, Sergio and Casas, Fernando and Murua, Ander}, + year={2024}, + pages={1–161} +} + @article{Bogacki:89, author = {Bogacki, P. and Shampine, L.F.}, journal = {Applied Mathematics Letters}, @@ -1772,6 +1796,20 @@ @article{ChiRen:21 doi = {10.1137/20M1354349} } +@article{CrGo:89, + title = {Higher-order hybrid Monte Carlo algorithms}, + author = {Creutz, Michael and Gocksch, Andreas}, + journal = {Phys. Rev. Lett.}, + volume = {63}, + issue = {1}, + pages = {9--12}, + numpages = {0}, + year = {1989}, + month = {Jul}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevLett.63.9} +} + @article{Diele:11, year = {2011}, title = {{Explicit symplectic partitioned Runge–Kutta–Nyström methods for non-autonomous dynamics}}, @@ -2172,6 +2210,62 @@ @article{Sof:04 doi = {10.1016/j.mcm.2005.01.010} } +@article{Strang:63, + title = {Accurate partial difference methods {I}: {L}inear cauchy problems}, + volume = {12}, + ISSN = {1432-0673}, + DOI = {10.1007/bf00281235}, + number = {1}, + journal = {Archive for Rational Mechanics and Analysis}, + publisher = {Springer Science and Business Media LLC}, + author = {Strang, Gilbert}, + year = {1963}, + month = jan, + pages = {392–402} +} + +@article{Strang:68, + title = {On the Construction and Comparison of Difference Schemes}, + volume = {5}, + ISSN = {1095-7170}, + DOI = {10.1137/0705041}, + number = {3}, + journal = {SIAM Journal on Numerical Analysis}, + publisher = {Society for Industrial & Applied Mathematics (SIAM)}, + author = {Strang, Gilbert}, + year = {1968}, + month = sep, + pages = {506–517} +} + +@article{Suzuki:90, + title = {Fractal decomposition of exponential operators with applications to many-body theories and {M}onte {C}arlo simulations}, + volume = {146}, + ISSN = {0375-9601}, + DOI = {10.1016/0375-9601(90)90962-n}, + number = {6}, + journal = {Physics Letters A}, + publisher = {Elsevier BV}, + author = {Suzuki, Masuo}, + year = {1990}, + month = jun, + pages = {319–323} +} + +@article{Suzuki:92, + title = {General Nonsymmetric Higher-Order Decomposition of Exponential Operators and Symplectic Integrators}, + volume = {61}, + ISSN = {1347-4073}, + DOI = {10.1143/jpsj.61.3015}, + number = {9}, + journal = {Journal of the Physical Society of Japan}, + publisher = {Physical Society of Japan}, + author = {Suzuki, Masuo}, + year = {1992}, + month = sep, + pages = {3015–3019} +} + @article{Ver:10, author = {Verner, J.H}, title = {Numerically optimal {Runge–Kutta} pairs with interpolants}, diff --git a/doc/shared/sunstepper/SUNStepper_Description.rst b/doc/shared/sunstepper/SUNStepper_Description.rst index cb4b62d962..94d9b5564b 100644 --- a/doc/shared/sunstepper/SUNStepper_Description.rst +++ b/doc/shared/sunstepper/SUNStepper_Description.rst @@ -160,6 +160,17 @@ Stepping Functions :return: A :c:type:`SUNErrCode` indicating success or failure. +.. c:function:: SUNErrCode SUNStepper_SetStepDirection(SUNStepper stepper, sunrealtype stepdir) + + This function specifies the direction of integration (forward or backward). + + :param stepper: the stepper object. + :param stepdir: value whose sign determines the direction. A positive value + selects forward integration, a negative value selects backward + integration, and zero leaves the current direction unchanged. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + .. c:function:: SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) This function sets the data necessary to compute the forcing term @@ -322,6 +333,16 @@ determined by the "consumer" of the :c:type:`SUNStepper`. :return: A :c:type:`SUNErrCode` indicating success or failure. +.. c:function:: SUNErrCode SUNStepper_SetStepDirectionFn(SUNStepper stepper, SUNStepperSetStepDirectionFn fn) + + This function attaches a :c:type:`SUNStepperSetStepDirectionFn` function to a + :c:type:`SUNStepper` object. + + :param stepper: a stepper object. + :param fn: the :c:type:`SUNStepperSetStepDirectionFn` function to attach. + :return: A :c:type:`SUNErrCode` indicating success or failure. + + .. c:function:: SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, SUNStepperSetForcingFn fn) This function attaches a :c:type:`SUNStepperSetForcingFn` function to a @@ -382,6 +403,12 @@ abstract base class. :c:func:`SUNStepper_SetStopTime`. +.. c:type:: SUNErrCode (*SUNStepperSetStepDirectionFn)(SUNStepper stepper, sunrealtype stepdir) + + This type represents a function with the signature of + :c:func:`SUNStepper_SetStepDirection`. + + .. c:type:: SUNErrCode (*SUNStepperSetForcingFn)(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) This type represents a function with the signature of diff --git a/doc/shared/sunstepper/SUNStepper_Implementing.rst b/doc/shared/sunstepper/SUNStepper_Implementing.rst index 1f57de65de..dda9d11ade 100644 --- a/doc/shared/sunstepper/SUNStepper_Implementing.rst +++ b/doc/shared/sunstepper/SUNStepper_Implementing.rst @@ -40,7 +40,8 @@ To create a SUNStepper implementation: recorded with :c:func:`SUNStepper_SetLastFlag`. #. In the user code, before creating the outer memory structure that uses the - :c:type:`SUNStepper`, do the following: + :c:type:`SUNStepper`, e.g., with :c:func:`SplittingStepCreate` or + :c:func:`ForcingStepCreate`, do the following: #. Create a :c:type:`SUNStepper` object with :c:func:`SUNStepper_Create`. @@ -51,4 +52,5 @@ To create a SUNStepper implementation: #. Attach the member function implementations using the functions described in :numref:`SUNStepper.Description.BaseMethods.AttachFunctions`. -#. Attach the :c:type:`SUNStepper` object to the outer memory structure. +#. Attach the :c:type:`SUNStepper` object to the outer memory structure, e.g., + with :c:func:`SplittingStepCreate` or :c:func:`ForcingStepCreate`. diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index 382a9f957c..1f905adc99 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -23,10 +23,16 @@ set(ARKODE_examples # tests that are always run "ark_analytic\;\;" # develop tests + "ark_advection_diffusion_reaction_splitting\;\;develop" "ark_analytic_lsrk\;\;develop" "ark_analytic_lsrk_varjac\;\;develop" "ark_analytic_mels\;\;develop" "ark_analytic_nonlin\;\;develop" + "ark_analytic_partitioned\;forcing\;develop" + "ark_analytic_partitioned\;splitting\;develop" + "ark_analytic_partitioned\;splitting ARKODE_SPLITTING_BEST_2_2_2\;develop" + "ark_analytic_partitioned\;splitting ARKODE_SPLITTING_RUTH_3_3_2\;exclude-single" + "ark_analytic_partitioned\;splitting ARKODE_SPLITTING_YOSHIDA_8_6_2\;exclude-single" "ark_analytic_ssprk\;\;develop" "ark_brusselator_1D_mri\;\;develop" "ark_brusselator_fp\;\;exclude-single" diff --git a/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c b/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c new file mode 100644 index 0000000000..b6354fd915 --- /dev/null +++ b/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c @@ -0,0 +1,358 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *--------------------------------------------------------------- + * Example problem: + * + * The following test simulates a simple 1D advection-diffusion- + * reaction equation, + * u_t = (a/2)*(u^2)_x + b*u_xx + c*(u - u^3) + * for t in [0, 1], x in [0, 1], with initial conditions + * u(0,x) = u_0 + * and Dirichlet boundary conditions at x=0 and x=1 + * u(0,t) = u(1,t) = u_0 + * + * The spatial derivatives are computed using second-order + * centered differences, with the data distributed over N + * points (excluding boundary points) on a uniform spatial grid. + * + * This program solves the problem with an operator splitting + * method where advection is treated with a strong stability + * preserving ERK method, diffusion is treated with a DIRK + * method, and reaction is treated with a different ERK method. + * + * Outputs are printed at equal intervals, and run statistics are + * printed at the end. + *---------------------------------------------------------------*/ + +#include <arkode/arkode_arkstep.h> +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_splittingstep.h> +#include <math.h> +#include <nvector/nvector_serial.h> +#include <stdio.h> +#include <sunlinsol/sunlinsol_band.h> +#include <sunmatrix/sunmatrix_band.h> + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define GSYM "Lg" +#define FSYM "Lf" +#else +#define GSYM "g" +#define FSYM "f" +#endif + +/* user data structure */ +typedef struct +{ + sunindextype N; /* number of grid points (excluding boundaries) */ + sunrealtype dx; /* mesh spacing */ + sunrealtype a; /* advection coefficient */ + sunrealtype b; /* diffusion coefficient */ + sunrealtype c; /* reaction coefficient */ + sunrealtype u0; /* initial and boundary values */ +} UserData; + +/* User-supplied Functions Called by the Solver */ +static int f_advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int f_diffusion(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int jac_diffusion(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, + void* user_data, N_Vector tmp1, N_Vector tmp2, + N_Vector tmp3); +static int f_reaction(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); + +/* Private function to check function return values */ +static int check_flag(void* flagvalue, const char* funcname, int opt); + +int main(void) +{ + /* Problem parameters */ + sunrealtype T0 = SUN_RCONST(0.0); + sunrealtype Tf = SUN_RCONST(1.0); + sunrealtype DT = SUN_RCONST(0.06); + sunindextype N = 128; + UserData udata = {.N = N, + .dx = SUN_RCONST(1.0) / (N + 1), + .a = SUN_RCONST(1.0), + .b = SUN_RCONST(0.125), + .c = SUN_RCONST(4.0), + .u0 = SUN_RCONST(0.1)}; + + printf("\n1D Advection-Diffusion-Reaction PDE test problem:\n"); + printf(" N = %li\n", (long int)udata.N); + printf(" advection coefficient = %" GSYM "\n", udata.a); + printf(" diffusion coefficient = %" GSYM "\n", udata.b); + printf(" reaction coefficient = %" GSYM "\n\n", udata.c); + + /* Create the SUNDIALS context object for this simulation */ + SUNContext ctx; + int flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + /* Initialize vector with initial condition */ + N_Vector y = N_VNew_Serial(udata.N, ctx); + if (check_flag(y, "N_VNew_Serial", 0)) { return 1; } + N_VConst(udata.u0, y); + + /* Create advection integrator */ + void* advection_mem = ERKStepCreate(f_advection, T0, y, ctx); + if (check_flag(advection_mem, "ERKStepCreate", 0)) { return 1; } + + flag = ARKodeSetUserData(advection_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + /* Choose a strong stability preserving method for advecton */ + flag = ERKStepSetTableNum(advection_mem, ARKODE_SHU_OSHER_3_2_3); + if (check_flag(&flag, "ERKStepSetTableNum", 1)) { return 1; } + + SUNStepper advection_stepper; + flag = ARKodeCreateSUNStepper(advection_mem, &advection_stepper); + if (check_flag(&flag, "ARKodeCreateSUNStepper", 1)) { return 1; } + + /* Create diffusion integrator */ + void* diffusion_mem = ARKStepCreate(NULL, f_diffusion, T0, y, ctx); + if (check_flag(diffusion_mem, "ARKStepCreate", 0)) { return 1; } + + flag = ARKodeSetUserData(diffusion_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + flag = ARKodeSetOrder(diffusion_mem, 3); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + + SUNMatrix jac_mat = SUNBandMatrix(udata.N, 1, 1, ctx); + if (check_flag(jac_mat, "SUNBandMatrix", 0)) { return 1; } + + SUNLinearSolver ls = SUNLinSol_Band(y, jac_mat, ctx); + if (check_flag(ls, "SUNLinSol_Band", 0)) { return 1; } + + flag = ARKodeSetLinearSolver(diffusion_mem, ls, jac_mat); + if (check_flag(&flag, "ARKStepSetOrder", 1)) { return 1; } + + flag = ARKodeSetJacFn(diffusion_mem, jac_diffusion); + if (check_flag(&flag, "ARKodeSetJacFn", 1)) { return 1; } + + flag = ARKodeSetLinear(diffusion_mem, SUNFALSE); + if (check_flag(&flag, "ARKodeSetLinear", 1)) { return 1; } + + SUNStepper diffusion_stepper; + flag = ARKodeCreateSUNStepper(diffusion_mem, &diffusion_stepper); + if (check_flag(&flag, "ARKodeCreateSUNStepper", 1)) { return 1; } + + /* Create reaction integrator */ + void* reaction_mem = ERKStepCreate(f_reaction, T0, y, ctx); + if (check_flag(reaction_mem, "ERKStepCreate", 0)) { return 1; } + + flag = ARKodeSetUserData(reaction_mem, &udata); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + flag = ARKodeSetOrder(reaction_mem, 3); + if (check_flag(&flag, "ARKodeSetOrder", 1)) { return 1; } + + SUNStepper reaction_stepper; + flag = ARKodeCreateSUNStepper(reaction_mem, &reaction_stepper); + if (check_flag(&flag, "ARKodeCreateSUNStepper", 1)) { return 1; } + + /* Create operator splitting integrator */ + SUNStepper steppers[] = {advection_stepper, diffusion_stepper, + reaction_stepper}; + void* arkode_mem = SplittingStepCreate(steppers, 3, T0, y, ctx); + if (check_flag(arkode_mem, "SplittingStepCreate", 0)) { return 1; } + + flag = ARKodeSetFixedStep(arkode_mem, DT); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + + flag = ARKodeSetStopTime(arkode_mem, Tf); + if (check_flag(&flag, "ARKodeSetStopTime", 1)) { return 1; } + + /* Evolve solution in time */ + sunrealtype tret = T0; + printf(" t ||u||_rms\n"); + printf(" ----------------------\n"); + printf(" %10.6" FSYM " %10.6f\n", tret, sqrt(N_VDotProd(y, y) / udata.N)); + while (tret < Tf) + { + flag = ARKodeEvolve(arkode_mem, Tf, y, &tret, ARK_ONE_STEP); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + printf(" %10.6" FSYM " %10.6f\n", tret, sqrt(N_VDotProd(y, y) / udata.N)); + } + printf(" ----------------------\n"); + + /* Print statistics */ + printf("\nSplitting Stepper Statistics:\n"); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + printf("\nAdvection Stepper Statistics:\n"); + flag = ARKodePrintAllStats(advection_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + printf("\nDiffusion Stepper Statistics:\n"); + flag = ARKodePrintAllStats(diffusion_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + printf("\nReaction Stepper Statistics:\n"); + flag = ARKodePrintAllStats(reaction_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + /* Clean up and return with successful completion */ + N_VDestroy(y); + ARKodeFree(&advection_mem); + SUNStepper_Destroy(&advection_stepper); + ARKodeFree(&diffusion_mem); + SUNStepper_Destroy(&diffusion_stepper); + ARKodeFree(&reaction_mem); + SUNStepper_Destroy(&reaction_stepper); + ARKodeFree(&arkode_mem); + SUNLinSolFree(ls); + SUNMatDestroy(jac_mat); + SUNContext_Free(&ctx); + + return 0; +} + +/* f routine to compute the advection RHS function. */ +static int f_advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* Y = NULL; + Y = N_VGetArrayPointer(y); /* access data arrays */ + if (check_flag((void*)Y, "N_VGetArrayPointer", 0)) { return 1; } + + sunrealtype* Ydot = NULL; + Ydot = N_VGetArrayPointer(ydot); + if (check_flag((void*)Ydot, "N_VGetArrayPointer", 0)) { return 1; } + + sunrealtype coeff = udata->a / (SUN_RCONST(4.0) * udata->dx); + sunrealtype u0_sqr = udata->u0 * udata->u0; + + /* Left boundary */ + Ydot[0] = coeff * (Y[1] * Y[1] - u0_sqr); + /* Interior */ + for (sunindextype i = 1; i < udata->N - 1; i++) + { + Ydot[i] = coeff * (Y[i + 1] * Y[i + 1] - Y[i - 1] * Y[i - 1]); + } + /* Right boundary */ + Ydot[udata->N - 1] = coeff * (u0_sqr - Y[udata->N - 1] * Y[udata->N - 1]); + + return 0; +} + +/* f routine to compute the diffusion RHS function. */ +static int f_diffusion(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* Y = NULL; + Y = N_VGetArrayPointer(y); /* access data arrays */ + if (check_flag((void*)Y, "N_VGetArrayPointer", 0)) { return 1; } + + sunrealtype* Ydot = NULL; + Ydot = N_VGetArrayPointer(ydot); + if (check_flag((void*)Ydot, "N_VGetArrayPointer", 0)) { return 1; } + + sunrealtype coeff = udata->b / (udata->dx * udata->dx); + + /* Left boundary */ + Ydot[0] = coeff * (udata->u0 - 2 * Y[0] + Y[1]); + /* Interior */ + for (sunindextype i = 1; i < udata->N - 1; i++) + { + Ydot[i] = coeff * (Y[i + 1] - 2 * Y[i] + Y[i - 1]); + } + /* Right boundary */ + Ydot[udata->N - 1] = coeff * + (Y[udata->N - 2] - 2 * Y[udata->N - 1] + udata->u0); + + return 0; +} + +/* Routine to compute the diffusion Jacobian function. */ +static int jac_diffusion(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, + void* user_data, N_Vector tmp1, N_Vector tmp2, + N_Vector tmp3) +{ + UserData* udata = (UserData*)user_data; + sunrealtype coeff = udata->b / (udata->dx * udata->dx); + + SM_ELEMENT_B(Jac, 0, 0) = -2 * coeff; + for (int i = 1; i < udata->N; i++) + { + SM_ELEMENT_B(Jac, i - 1, i) = coeff; + SM_ELEMENT_B(Jac, i, i) = -2 * coeff; + SM_ELEMENT_B(Jac, i, i - 1) = coeff; + } + + return 0; +} + +/* f routine to compute the reaction RHS function. */ +static int f_reaction(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + UserData* udata = (UserData*)user_data; + sunrealtype* Y = NULL; + Y = N_VGetArrayPointer(y); /* access data arrays */ + if (check_flag((void*)Y, "N_VGetArrayPointer", 0)) { return 1; } + + sunrealtype* Ydot = NULL; + Ydot = N_VGetArrayPointer(ydot); + if (check_flag((void*)Ydot, "N_VGetArrayPointer", 0)) { return 1; } + + for (sunindextype i = 0; i < udata->N; i++) + { + Ydot[i] = udata->c * Y[i] * (SUN_RCONST(1.0) - Y[i] * Y[i]); + } + + return 0; +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a flag so check if + flag >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_flag(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with flag = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} diff --git a/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.out b/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.out new file mode 100644 index 0000000000..5e9e2912a0 --- /dev/null +++ b/examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.out @@ -0,0 +1,102 @@ + +1D Advection-Diffusion-Reaction PDE test problem: + N = 128 + advection coefficient = 1 + diffusion coefficient = 0.125 + reaction coefficient = 4 + + t ||u||_rms + ---------------------- + 0.000000 0.100000 + 0.060000 0.126735 + 0.120000 0.154225 + 0.180000 0.185713 + 0.240000 0.221939 + 0.300000 0.263178 + 0.360000 0.309221 + 0.420000 0.359242 + 0.480000 0.411736 + 0.540000 0.464562 + 0.600000 0.515253 + 0.660000 0.561485 + 0.720000 0.601561 + 0.780000 0.634693 + 0.840000 0.660982 + 0.900000 0.681150 + 0.960000 0.696244 + 1.000000 0.702991 + ---------------------- + +Splitting Stepper Statistics: +Current time = 1 +Steps = 17 +Step attempts = 17 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.06 +Last step size = 0.03999999999999956 +Current step size = 0.06 +Partition 0 evolves = 17 +Partition 1 evolves = 17 +Partition 2 evolves = 17 + +Advection Stepper Statistics: +Current time = 1 +Steps = 55 +Step attempts = 64 +Stability limited steps = 0 +Accuracy limited steps = 64 +Error test fails = 9 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 2.059355438929501e-06 +Last step size = 0.004032057223863014 +Current step size = 0.004032057223863014 +RHS fn evals = 185 + +Diffusion Stepper Statistics: +Current time = 1 +Steps = 247 +Step attempts = 302 +Stability limited steps = 0 +Accuracy limited steps = 302 +Error test fails = 55 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 2.059355438929501e-06 +Last step size = 0.006555275857754277 +Current step size = 0.006555275857754277 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 1831 +NLS iters = 906 +NLS fails = 0 +NLS iters per step = 3.668016194331984 +LS setups = 213 +Jac fn evals = 72 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.07947019867549669 +Prec evals per NLS iter = 0 + +Reaction Stepper Statistics: +Current time = 1 +Steps = 42 +Step attempts = 49 +Stability limited steps = 0 +Accuracy limited steps = 49 +Error test fails = 7 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.00180442856879795 +Last step size = 0.03999999999999956 +Current step size = 0.03999999999999956 +RHS fn evals = 166 diff --git a/examples/arkode/C_serial/ark_analytic_partitioned.c b/examples/arkode/C_serial/ark_analytic_partitioned.c new file mode 100644 index 0000000000..173dea29c4 --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned.c @@ -0,0 +1,270 @@ +/*------------------------------------------------------------------------------ + * Programmer(s): Steven B. Roberts @ LLNL + *------------------------------------------------------------------------------ + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + *------------------------------------------------------------------------------ + * We consider the initial value problem + * y' + lambda*y = y^2, y(0) = 1 + * proposed in + * + * Estep, D., et al. "An a posteriori–a priori analysis of multiscale operator + * splitting." SIAM Journal on Numerical Analysis 46.3 (2008): 1116-1146. + * + * The parameter lambda is positive, t is in [0, 1], and the exact solution is + * + * y(t) = lambda*y / (y(0) - (y(0) - lambda)*exp(lambda*t)) + * + * This program solves the problem with a splitting or forcing method which can + * be specified with the command line syntax + * + * ./ark_analytic_partitioned <integrator> <coefficients> + * integrator: either 'splitting' or 'forcing' + * coefficients (splitting only): the SplittingStepCoefficients to load + * + * The linear term lambda*y and nonlinear term y^2 are treated as the two + * partitions. The former is integrated using a time step of 5e-3, while the + * later uses a time step of 1e-3. The overall splitting or forcing integrator + * uses a time step of 1e-2. Once solved, the program prints the error and + * statistics. + *----------------------------------------------------------------------------*/ + +/* Header files */ +#include <arkode/arkode_arkstep.h> +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_forcingstep.h> +#include <arkode/arkode_splittingstep.h> +#include <nvector/nvector_serial.h> +#include <string.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 + +typedef struct +{ + sunrealtype lambda; +} UserData; + +/* User-supplied Functions Called by the Solver */ +static int f_linear(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static int f_nonlinear(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); +static N_Vector exact_sol(N_Vector y0, sunrealtype tf, UserData* user_data); + +/* Private function to check function return values */ +static int check_flag(void* flagvalue, const char* funcname, int opt); + +int main(int argc, char* argv[]) +{ + /* Parse arguments */ + const char* integrator_name = (argc > 1) ? argv[1] : "splitting"; + if (strcmp(integrator_name, "splitting") != 0 && + strcmp(integrator_name, "forcing") != 0) + { + fprintf(stderr, "Invalid integrator: %s\nMust be 'splitting' or 'forcing'\n", + integrator_name); + return 1; + } + char* coefficients_name = (argc > 2) ? argv[2] : NULL; + + /* Problem parameters */ + sunrealtype t0 = SUN_RCONST(0.0); /* initial time */ + sunrealtype tf = SUN_RCONST(1.0); /* final time */ + sunrealtype dt = SUN_RCONST(0.01); /* outer time step */ + sunrealtype dt_linear = dt / 5; /* linear integrator time step */ + sunrealtype dt_nonlinear = dt / 10; /* nonlinear integrator time step */ + + UserData user_data = {.lambda = SUN_RCONST(2.0)}; + + /* Create the SUNDIALS context object for this simulation */ + SUNContext ctx; + int flag = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (check_flag(&flag, "SUNContext_Create", 1)) { return 1; } + + /* Initialize vector with initial condition */ + N_Vector y = N_VNew_Serial(1, ctx); + if (check_flag(y, "N_VNew_Serial", 0)) { return 1; } + N_VConst(SUN_RCONST(1.0), y); + + N_Vector y_exact = exact_sol(y, tf, &user_data); + + printf("\nAnalytical ODE test problem:\n"); + printf(" integrator = %s method\n", integrator_name); + if (coefficients_name != NULL) + { + printf(" coefficients = %s\n", coefficients_name); + } + printf(" lambda = %" GSYM "\n", user_data.lambda); + + /* Create the integrator for the linear partition */ + void* linear_mem = ERKStepCreate(f_linear, t0, y, ctx); + if (check_flag(linear_mem, "N_VNew_Serial", 0)) { return 1; } + + flag = ARKodeSetUserData(linear_mem, &user_data); + if (check_flag(&flag, "ARKodeSetUserData", 1)) { return 1; } + + flag = ARKodeSetFixedStep(linear_mem, dt_linear); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + + /* Create the integrator for the nonlinear partition */ + void* nonlinear_mem = ARKStepCreate(f_nonlinear, NULL, t0, y, ctx); + if (check_flag(nonlinear_mem, "N_VNew_Serial", 0)) { return 1; } + + flag = ARKodeSetFixedStep(nonlinear_mem, dt_nonlinear); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + + /* Create SUNSteppers out of the integrators */ + SUNStepper steppers[2]; + ARKodeCreateSUNStepper(linear_mem, &steppers[0]); + ARKodeCreateSUNStepper(nonlinear_mem, &steppers[1]); + + /* Create the outer integrator */ + void* arkode_mem; + if (strcmp(integrator_name, "splitting") == 0) + { + arkode_mem = SplittingStepCreate(steppers, 2, t0, y, ctx); + if (check_flag(arkode_mem, "SplittingStepCreate", 0)) { return 1; } + + if (coefficients_name != NULL) + { + SplittingStepCoefficients coefficients = + SplittingStepCoefficients_LoadCoefficientsByName(coefficients_name); + if (check_flag(coefficients, + "SplittingStepCoefficients_LoadCoefficientsByName", 0)) + { + return 1; + } + + flag = SplittingStepSetCoefficients(arkode_mem, coefficients); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + + SplittingStepCoefficients_Destroy(&coefficients); + } + } + else + { + arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y, ctx); + if (check_flag(arkode_mem, "ForcingStepCreate", 0)) { return 1; } + } + + flag = ARKodeSetFixedStep(arkode_mem, dt); + if (check_flag(&flag, "ARKodeSetFixedStep", 1)) { return 1; } + + /* Compute the numerical solution */ + sunrealtype tret; + flag = ARKodeEvolve(arkode_mem, tf, y, &tret, ARK_NORMAL); + if (check_flag(&flag, "ARKodeEvolve", 1)) { return 1; } + + /* Print the numerical error and statistics */ + N_Vector y_err = N_VClone(y); + if (check_flag(y_err, "N_VClone", 0)) { return 1; } + N_VLinearSum(SUN_RCONST(1.0), y, -SUN_RCONST(1.0), y_exact, y_err); + printf("\nError: %" GSYM "\n", N_VMaxNorm(y_err)); + + printf("\nSplitting Stepper Statistics:\n"); + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + printf("\nLinear Stepper Statistics:\n"); + flag = ARKodePrintAllStats(linear_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + printf("\nNonlinear Stepper Statistics:\n"); + flag = ARKodePrintAllStats(nonlinear_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(&flag, "ARKodePrintAllStats", 1)) { return 1; } + + /* Free memory */ + N_VDestroy(y); + N_VDestroy(y_exact); + N_VDestroy(y_err); + ARKodeFree(&linear_mem); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&nonlinear_mem); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + SUNContext_Free(&ctx); + + return 0; +} + +/* RHS for f^1(t, y) = -lambda * y */ +static int f_linear(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype lambda = ((UserData*)user_data)->lambda; + N_VScale(-lambda, y, ydot); + return 0; +} + +/* RHS for f^2(t, y) = y^2 */ +static int f_nonlinear(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VProd(y, y, ydot); + return 0; +} + +/* Compute the exact analytic solution */ +static N_Vector exact_sol(N_Vector y0, sunrealtype tf, UserData* user_data) +{ + N_Vector sol = N_VClone(y0); + sunrealtype y0_val = N_VGetArrayPointer(y0)[0]; + sunrealtype lambda = user_data->lambda; + N_VGetArrayPointer(sol)[0] = + lambda * y0_val / (y0_val - (y0_val - lambda) * SUNRexp(lambda * tf)); + return sol; +} + +/* Check function return value... + opt == 0 means SUNDIALS function allocates memory so check if + returned NULL pointer + opt == 1 means SUNDIALS function returns a flag so check if + flag >= 0 + opt == 2 means function allocates memory so check if returned + NULL pointer +*/ +static int check_flag(void* flagvalue, const char* funcname, int opt) +{ + int* errflag; + + /* Check if SUNDIALS function returned NULL pointer - no memory allocated */ + if (opt == 0 && flagvalue == NULL) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + /* Check if flag < 0 */ + else if (opt == 1) + { + errflag = (int*)flagvalue; + if (*errflag < 0) + { + fprintf(stderr, "\nSUNDIALS_ERROR: %s() failed with flag = %d\n\n", + funcname, *errflag); + return 1; + } + } + + /* Check if function returned NULL pointer - no memory allocated */ + else if (opt == 2 && flagvalue == NULL) + { + fprintf(stderr, "\nMEMORY_ERROR: %s() failed - returned NULL pointer\n\n", + funcname); + return 1; + } + + return 0; +} diff --git a/examples/arkode/C_serial/ark_analytic_partitioned_forcing.out b/examples/arkode/C_serial/ark_analytic_partitioned_forcing.out new file mode 100644 index 0000000000..dd81702c9d --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned_forcing.out @@ -0,0 +1,54 @@ + +Analytical ODE test problem: + integrator = forcing method + lambda = 2 + +Error: 0.00185186 + +Splitting Stepper Statistics: +Current time = 1.000000000000001 +Steps = 100 +Step attempts = 100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.01 +Last step size = 0.01 +Current step size = 0.01 +Partition 0 evolves = 100 +Partition 1 evolves = 100 + +Linear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 500 +Step attempts = 500 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.002 +Last step size = 0.002 +Current step size = 0.002 +RHS fn evals = 2500 + +Nonlinear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 1000 +Step attempts = 1000 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit RHS fn evals = 5000 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 diff --git a/examples/arkode/C_serial/ark_analytic_partitioned_splitting.out b/examples/arkode/C_serial/ark_analytic_partitioned_splitting.out new file mode 100644 index 0000000000..77962e7939 --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned_splitting.out @@ -0,0 +1,54 @@ + +Analytical ODE test problem: + integrator = splitting method + lambda = 2 + +Error: 0.001796 + +Splitting Stepper Statistics: +Current time = 1.000000000000001 +Steps = 100 +Step attempts = 100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.01 +Last step size = 0.01 +Current step size = 0.01 +Partition 0 evolves = 100 +Partition 1 evolves = 100 + +Linear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 500 +Step attempts = 500 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.002 +Last step size = 0.002 +Current step size = 0.002 +RHS fn evals = 2500 + +Nonlinear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 1000 +Step attempts = 1000 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit RHS fn evals = 5000 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 diff --git a/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_BEST_2_2_2.out b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_BEST_2_2_2.out new file mode 100644 index 0000000000..47ae2487bf --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_BEST_2_2_2.out @@ -0,0 +1,55 @@ + +Analytical ODE test problem: + integrator = splitting method + coefficients = ARKODE_SPLITTING_BEST_2_2_2 + lambda = 2 + +Error: 7.26922e-07 + +Splitting Stepper Statistics: +Current time = 1.000000000000001 +Steps = 100 +Step attempts = 100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.01 +Last step size = 0.01 +Current step size = 0.01 +Partition 0 evolves = 200 +Partition 1 evolves = 200 + +Linear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 600 +Step attempts = 600 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.002 +Last step size = 0.0010710678118655 +Current step size = 0.002 +RHS fn evals = 3000 + +Nonlinear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 1100 +Step attempts = 1100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.0009289321881345005 +Current step size = 0.001 +Explicit RHS fn evals = 5500 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 diff --git a/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_RUTH_3_3_2.out b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_RUTH_3_3_2.out new file mode 100644 index 0000000000..9a3aea8caf --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_RUTH_3_3_2.out @@ -0,0 +1,55 @@ + +Analytical ODE test problem: + integrator = splitting method + coefficients = ARKODE_SPLITTING_RUTH_3_3_2 + lambda = 2 + +Error: 6.71891e-09 + +Splitting Stepper Statistics: +Current time = 1.000000000000001 +Steps = 100 +Step attempts = 100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.01 +Last step size = 0.01 +Current step size = 0.01 +Partition 0 evolves = 300 +Partition 1 evolves = 300 + +Linear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 1300 +Step attempts = 1300 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.002 +Last step size = 0.0006666666666667037 +Current step size = 0.002 +RHS fn evals = 6500 + +Nonlinear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 1200 +Step attempts = 1200 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.0009166666666666759 +Current step size = 0.001 +Explicit RHS fn evals = 6000 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 diff --git a/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_YOSHIDA_8_6_2.out b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_YOSHIDA_8_6_2.out new file mode 100644 index 0000000000..4a619c463d --- /dev/null +++ b/examples/arkode/C_serial/ark_analytic_partitioned_splitting_ARKODE_SPLITTING_YOSHIDA_8_6_2.out @@ -0,0 +1,55 @@ + +Analytical ODE test problem: + integrator = splitting method + coefficients = ARKODE_SPLITTING_YOSHIDA_8_6_2 + lambda = 2 + +Error: 1.44246e-12 + +Splitting Stepper Statistics: +Current time = 1.000000000000001 +Steps = 100 +Step attempts = 100 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.01 +Last step size = 0.01 +Current step size = 0.01 +Partition 0 evolves = 1000 +Partition 1 evolves = 900 + +Linear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 2200 +Step attempts = 2200 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.002 +Last step size = 0.001936124638611257 +Current step size = 0.002 +RHS fn evals = 11000 + +Nonlinear Stepper Statistics: +Current time = 1.000000000000001 +Steps = 16500 +Step attempts = 16500 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.0008722492772224025 +Current step size = 0.001 +Explicit RHS fn evals = 82500 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 516dffd60c..2bd95604f3 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -146,6 +146,8 @@ extern "C" { #define ARK_SUNSTEPPER_ERR -51 +#define ARK_STEP_DIRECTION_ERR -52 + #define ARK_UNRECOGNIZED_ERROR -99 /* ------------------------------ @@ -250,6 +252,7 @@ SUNDIALS_EXPORT int ARKodeSetInterpolateStopTime(void* arkode_mem, SUNDIALS_EXPORT int ARKodeSetStopTime(void* arkode_mem, sunrealtype tstop); SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_EXPORT int ARKodeSetStepDirection(void* arkode_mem, sunrealtype stepdir); SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); @@ -328,6 +331,8 @@ SUNDIALS_EXPORT int ARKodeGetWorkSpace(void* arkode_mem, long int* lenrw, SUNDIALS_EXPORT int ARKodeGetNumSteps(void* arkode_mem, long int* nsteps); SUNDIALS_EXPORT int ARKodeGetLastStep(void* arkode_mem, sunrealtype* hlast); SUNDIALS_EXPORT int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_EXPORT int ARKodeGetStepDirection(void* arkode_mem, + sunrealtype* stepdir); SUNDIALS_EXPORT int ARKodeGetErrWeights(void* arkode_mem, N_Vector eweight); SUNDIALS_EXPORT int ARKodeGetNumGEvals(void* arkode_mem, long int* ngevals); SUNDIALS_EXPORT int ARKodeGetRootInfo(void* arkode_mem, int* rootsfound); diff --git a/include/arkode/arkode_forcingstep.h b/include/arkode/arkode_forcingstep.h new file mode 100644 index 0000000000..4c1eecb276 --- /dev/null +++ b/include/arkode/arkode_forcingstep.h @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE ForcingStep module. + *--------------------------------------------------------------*/ + +#ifndef ARKODE_FORCINGINGSTEP_H_ +#define ARKODE_FORCINGINGSTEP_H_ + +#include <sundials/sundials_nvector.h> +#include <sundials/sundials_stepper.h> +#include <sundials/sundials_types.h> + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +SUNDIALS_EXPORT void* ForcingStepCreate(SUNStepper stepper1, + SUNStepper stepper2, sunrealtype t0, + N_Vector y0, SUNContext sunctx); + +SUNDIALS_EXPORT int ForcingStepReInit(void* arkode_mem, SUNStepper stepper1, + SUNStepper stepper2, sunrealtype t0, + N_Vector y0); + +SUNDIALS_EXPORT int ForcingStepGetNumEvolves(void* arkode_mem, int partition, + long int* evolves); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/arkode/arkode_splittingstep.h b/include/arkode/arkode_splittingstep.h new file mode 100644 index 0000000000..b052389527 --- /dev/null +++ b/include/arkode/arkode_splittingstep.h @@ -0,0 +1,115 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE SplittingStep module. + *--------------------------------------------------------------*/ + +#ifndef ARKODE_SPLITTINGSTEP_H_ +#define ARKODE_SPLITTINGSTEP_H_ + +#include <sundials/sundials_nvector.h> +#include <sundials/sundials_stepper.h> +#include <sundials/sundials_types.h> + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/*--------------------------------------------------------------- + Types : struct SplittingStepCoefficientsMem, SplittingStepCoefficients + ---------------------------------------------------------------*/ +struct SplittingStepCoefficientsMem +{ + sunrealtype* alpha; /* weights for sum over sequential splitting methods */ + sunrealtype*** beta; /* subintegration nodes, indexed by the sequential method, stage, and partition */ + int sequential_methods; /* number of sequential splitting methods */ + int stages; /* number of stages within each sequential splitting method */ + int partitions; /* number of RHS partitions */ + int order; /* order of convergence */ +}; + +typedef _SUNDIALS_STRUCT_ SplittingStepCoefficientsMem* SplittingStepCoefficients; + +/* Splitting names use the convention + * ARKODE_SPLITTING_<name>_<stages>_<order>_<partitions> */ +typedef enum +{ + ARKODE_SPLITTING_NONE = -1, /* ensure enum is signed int */ + ARKODE_MIN_SPLITTING_NUM = 0, + ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM, + ARKODE_SPLITTING_STRANG_2_2_2, + ARKODE_SPLITTING_BEST_2_2_2, + ARKODE_SPLITTING_SUZUKI_3_3_2, + ARKODE_SPLITTING_RUTH_3_3_2, + ARKODE_SPLITTING_YOSHIDA_4_4_2, + ARKODE_SPLITTING_YOSHIDA_8_6_2, + ARKODE_MAX_SPLITTING_NUM = ARKODE_SPLITTING_YOSHIDA_8_6_2 +} ARKODE_SplittingCoefficientsID; + +/* Coefficient memory management */ +SUNDIALS_EXPORT SplittingStepCoefficients SplittingStepCoefficients_Alloc( + int sequential_methods, int stages, int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients SplittingStepCoefficients_Create( + int sequential_methods, int stages, int partitions, int order, + sunrealtype* alpha, sunrealtype* beta); +SUNDIALS_EXPORT void SplittingStepCoefficients_Destroy( + SplittingStepCoefficients* coefficients); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_Copy(SplittingStepCoefficients coefficients); +SUNDIALS_EXPORT void SplittingStepCoefficients_Write( + SplittingStepCoefficients coefficients, FILE* outfile); + +/* Load splitting coefficients */ +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_LoadCoefficients(ARKODE_SplittingCoefficientsID id); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_LoadCoefficientsByName(const char* name); +SUNDIALS_EXPORT const char* SplittingStepCoefficients_IDToName( + ARKODE_SplittingCoefficientsID id); + +/* Constructors for splitting coefficients */ +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_LieTrotter(int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_Strang(int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_Parallel(int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_SymmetricParallel(int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_ThirdOrderSuzuki(int partitions); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_TripleJump(int partitions, int order); +SUNDIALS_EXPORT SplittingStepCoefficients +SplittingStepCoefficients_SuzukiFractal(int partitions, int order); + +/* Functions for SplittingStep integrator */ +SUNDIALS_EXPORT void* SplittingStepCreate(SUNStepper* steppers, int partitions, + sunrealtype t0, N_Vector y0, + SUNContext sunctx); + +SUNDIALS_EXPORT int SplittingStepReInit(void* arkode_mem, SUNStepper* steppers, + int partitions, sunrealtype t0, + N_Vector y0); + +SUNDIALS_EXPORT int SplittingStepSetCoefficients( + void* arkode_mem, SplittingStepCoefficients coefficients); + +SUNDIALS_EXPORT int SplittingStepGetNumEvolves(void* arkode_mem, int partition, + long int* evolves); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/sundials/sundials_math.h b/include/sundials/sundials_math.h index bf7a96dab7..b12798c2b7 100644 --- a/include/sundials/sundials_math.h +++ b/include/sundials/sundials_math.h @@ -184,6 +184,20 @@ extern "C" { #endif #endif +/* + * ----------------------------------------------------------------- + * Function : SUNIpowerI + * ----------------------------------------------------------------- + * Usage : int exponent, base, ans; + * ans = SUNIpowerI(base,exponent); + * ----------------------------------------------------------------- + * SUNIpowerI returns the value of base^exponent, where base and + * exponent are of type int and exponent is nonnegative. + * ----------------------------------------------------------------- + */ + +SUNDIALS_EXPORT int SUNIpowerI(int base, int exponent); + /* * ----------------------------------------------------------------- * Function : SUNRpowerI diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h index e735792e89..8a356df85b 100644 --- a/include/sundials/sundials_stepper.h +++ b/include/sundials/sundials_stepper.h @@ -52,6 +52,9 @@ typedef SUNErrCode (*SUNStepperResetFn)(SUNStepper stepper, sunrealtype tR, typedef SUNErrCode (*SUNStepperSetStopTimeFn)(SUNStepper stepper, sunrealtype tstop); +typedef SUNErrCode (*SUNStepperSetStepDirectionFn)(SUNStepper stepper, + sunrealtype stepdir); + typedef SUNErrCode (*SUNStepperSetForcingFn)(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, @@ -83,6 +86,9 @@ SUNErrCode SUNStepper_Reset(SUNStepper stepper, sunrealtype tR, N_Vector vR); SUNDIALS_EXPORT SUNErrCode SUNStepper_SetStopTime(SUNStepper stepper, sunrealtype tstop); +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetStepDirection(SUNStepper stepper, sunrealtype stepdir); + SUNDIALS_EXPORT SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, @@ -116,6 +122,10 @@ SUNDIALS_EXPORT SUNErrCode SUNStepper_SetStopTimeFn(SUNStepper stepper, SUNStepperSetStopTimeFn fn); +SUNDIALS_EXPORT +SUNErrCode SUNStepper_SetStepDirectionFn(SUNStepper stepper, + SUNStepperSetStepDirectionFn fn); + SUNDIALS_EXPORT SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, SUNStepperSetForcingFn fn); diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index edcc90e1a2..9b2474390b 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -29,6 +29,7 @@ set(arkode_SOURCES arkode_butcher.c arkode_erkstep_io.c arkode_erkstep.c + arkode_forcingstep.c arkode_interp.c arkode_io.c arkode_ls.c @@ -41,6 +42,8 @@ set(arkode_SOURCES arkode_mristep.c arkode_relaxation.c arkode_root.c + arkode_splittingstep_coefficients.c + arkode_splittingstep.c arkode_sprkstep_io.c arkode_sprkstep.c arkode_sprk.c @@ -58,9 +61,11 @@ set(arkode_HEADERS arkode_butcher_dirk.h arkode_butcher_erk.h arkode_erkstep.h + arkode_forcingstep.h arkode_ls.h arkode_lsrkstep.h arkode_mristep.h + arkode_splittingstep.h arkode_sprk.h arkode_sprkstep.h) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 5c3bfff04b..099e2e361c 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1501,6 +1501,7 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->step_setnonlinconvcoef = NULL; ark_mem->step_setstagepredictfn = NULL; ark_mem->step_getnumrhsevals = NULL; + ark_mem->step_setstepdirection = NULL; ark_mem->step_getnumlinsolvsetups = NULL; ark_mem->step_setadaptcontroller = NULL; ark_mem->step_getestlocalerrors = NULL; diff --git a/src/arkode/arkode_forcingstep.c b/src/arkode/arkode_forcingstep.c new file mode 100644 index 0000000000..9f839aba89 --- /dev/null +++ b/src/arkode/arkode_forcingstep.c @@ -0,0 +1,557 @@ +/*------------------------------------------------------------------------------ + * Programmer(s): Steven B. Roberts @ LLNL + *------------------------------------------------------------------------------ + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE's forcing method + *----------------------------------------------------------------------------*/ + +#include <arkode/arkode_forcingstep.h> +#include <sundials/sundials_nvector.h> + +#include "arkode_forcingstep_impl.h" +#include "arkode_impl.h" + +/*------------------------------------------------------------------------------ + Shortcut routine to unpack step_mem structure from ark_mem. If missing it + returns ARK_MEM_NULL. + ----------------------------------------------------------------------------*/ +static int forcingStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeForcingStepMem* step_mem) +{ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + "Time step module memory is NULL."); + return ARK_MEM_NULL; + } + *step_mem = (ARKodeForcingStepMem)ark_mem->step_mem; + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. + If either is missing it returns ARK_MEM_NULL. + ----------------------------------------------------------------------------*/ +static int forcingStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, + ARKodeForcingStepMem* step_mem) +{ + /* access ARKodeMem structure */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + *ark_mem = (ARKodeMem)arkode_mem; + + return forcingStep_AccessStepMem(*ark_mem, __func__, step_mem); +} + +/*------------------------------------------------------------------------------ + This routine is called just prior to performing internal time steps (after + all user "set" routines have been called) from within arkInitialSetup. + ----------------------------------------------------------------------------*/ +static int forcingStep_Init(ARKodeMem ark_mem, + SUNDIALS_MAYBE_UNUSED sunrealtype tout, int init_type) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* assume fixed outer step size */ + if (!ark_mem->fixedstep) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Adaptive outer time stepping is not currently supported"); + return ARK_ILL_INPUT; + } + + if (ark_mem->interp_type == ARK_INTERP_HERMITE && + (step_mem->stepper[0]->ops->fullrhs == NULL || + step_mem->stepper[1]->ops->fullrhs == NULL)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "The SUNSteppers must implement SUNStepper_FullRhs when " + "using Hermite interpolation"); + return ARK_ILL_INPUT; + } + + /* immediately return if resize or reset */ + if (init_type == RESIZE_INIT || init_type == RESET_INIT) + { + return ARK_SUCCESS; + } + + /* On first initialization, make the SUNStepper consistent with the current + * state in case a user provided a different initial condition for the + * ForcingStep integrator and SUNStepper. */ + SUNErrCode err = SUNStepper_Reset(step_mem->stepper[1], ark_mem->tn, + ark_mem->yn); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Resetting the second partition SUNStepper failed"); + return ARK_SUNSTEPPER_ERR; + } + + ark_mem->interp_degree = 1; + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine resets the ForcingStep integrator by resetting the partition + integrators + ----------------------------------------------------------------------------*/ +static int forcingStep_Reset(ARKodeMem ark_mem, sunrealtype tR, N_Vector yR) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + SUNErrCode err = SUNStepper_Reset(step_mem->stepper[0], tR, yR); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Resetting the first partition SUNStepper failed"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_Reset(step_mem->stepper[1], tR, yR); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, __FILE__, + "Resetting the second partition SUNStepper failed"); + return ARK_SUNSTEPPER_ERR; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine sets the step direction of the partition integrators and is + called once the ForcingStep integrator has updated its step direction. + ----------------------------------------------------------------------------*/ +static int forcingStep_SetStepDirection(ARKodeMem ark_mem, sunrealtype stepdir) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + SUNErrCode err = SUNStepper_SetStepDirection(step_mem->stepper[0], stepdir); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, + __FILE__, "Setting the step direction for the first partition SUNStepper failed"); + return ARK_SUNSTEPPER_ERR; + } + + err = SUNStepper_SetStepDirection(step_mem->stepper[1], stepdir); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_SUNSTEPPER_ERR, __LINE__, __func__, + __FILE__, "Setting the step direction for the second partition SUNStepper failed"); + return ARK_SUNSTEPPER_ERR; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This is just a wrapper to call the user-supplied RHS function, + f^1(t,y) + f^2(t,y). + + This will be called in one of three '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) + + The stepper for partition 1 has a state that is inconsistent with the + ForcingStep integrator, so we cannot pass it the SUN_FULLRHS_END option. For + partition 2, the state should be consistent, and we can use SUN_FULLRHS_END. + ----------------------------------------------------------------------------*/ +static int forcingStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, + N_Vector f, int mode) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* TODO(SBR): Possible optimization in FULLRHS_START mode. Currently that + * mode is not forwarded to the SUNSteppers */ + SUNErrCode err = SUNStepper_FullRhs(step_mem->stepper[0], t, y, + ark_mem->tempv1, SUN_FULLRHS_OTHER); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + + err = SUNStepper_FullRhs(step_mem->stepper[1], t, y, f, + mode == ARK_FULLRHS_END ? SUN_FULLRHS_END + : SUN_FULLRHS_OTHER); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + N_VLinearSum(SUN_RCONST(1.0), f, SUN_RCONST(1.0), ark_mem->tempv1, f); + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine performs a single step of the forcing method. + ----------------------------------------------------------------------------*/ +static int forcingStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, + int* nflagPtr) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + *nflagPtr = ARK_SUCCESS; /* No algebraic solver */ + *dsmPtr = ZERO; /* No error estimate */ + + SUNStepper s0 = step_mem->stepper[0]; + sunrealtype tout = ark_mem->tn + ark_mem->h; + sunrealtype tret = 0; + + /* Evolve stepper 0 on its own */ + SUNErrCode err = SUNStepper_Reset(s0, ark_mem->tn, ark_mem->yn); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + err = SUNStepper_SetStopTime(s0, tout); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + err = SUNStepper_Evolve(s0, tout, ark_mem->ycur, &tret); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + step_mem->n_stepper_evolves[0]++; + + SUNStepper s1 = step_mem->stepper[1]; + /* A reset is not needed because steeper 1's state is consistent with the + * forcing method */ + err = SUNStepper_SetStopTime(s1, tout); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + /* Write tendency (ycur - yn)/h into stepper 1 forcing */ + sunrealtype hinv = SUN_RCONST(1.0) / ark_mem->h; + N_VLinearSum(hinv, ark_mem->ycur, -hinv, ark_mem->yn, ark_mem->tempv1); + err = SUNStepper_SetForcing(s1, ZERO, ZERO, &ark_mem->tempv1, 1); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + /* Evolve stepper 1 with the forcing */ + err = SUNStepper_Evolve(s1, tout, ark_mem->ycur, &tret); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + step_mem->n_stepper_evolves[1]++; + + /* Clear the forcing so it doesn't get included in a fullRhs call */ + err = SUNStepper_SetForcing(s1, ZERO, ZERO, NULL, 0); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Prints integrator statistics + ----------------------------------------------------------------------------*/ +static int forcingStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, + SUNOutputFormat fmt) +{ + // TODO(SBR): update when https://github.com/LLNL/sundials/pull/517 merged + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + for (int k = 0; k < NUM_PARTITIONS; k++) + { + fprintf(outfile, "Partition %i evolves = %ld\n", k, + step_mem->n_stepper_evolves[k]); + } + break; + case SUN_OUTPUTFORMAT_CSV: + for (int k = 0; k < NUM_PARTITIONS; k++) + { + fprintf(outfile, ",Partition %i evolves,%ld", k, + step_mem->n_stepper_evolves[k]); + } + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Frees all ForcingStep memory. + ----------------------------------------------------------------------------*/ +static void forcingStep_Free(ARKodeMem ark_mem) +{ + if (ark_mem->step_mem != NULL) { free(ark_mem->step_mem); } + ark_mem->step_mem = NULL; +} + +/*------------------------------------------------------------------------------ + This routine outputs the memory from the ForcingStep structure to a specified + file pointer (useful when debugging). + ----------------------------------------------------------------------------*/ +static void forcingStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +{ + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return; } + + /* output long integer quantities */ + for (int k = 0; k < NUM_PARTITIONS; k++) + { + fprintf(outfile, "ForcingStep: partition %i: n_stepper_evolves = %li\n", k, + step_mem->n_stepper_evolves[k]); + } +} + +/*------------------------------------------------------------------------------ + This routine checks if all required vector operations are present. If any of + them are missing it returns SUNFALSE. + ----------------------------------------------------------------------------*/ +static sunbooleantype forcingStep_CheckNVector(N_Vector y) +{ + return y->ops->nvlinearsum != NULL; +} + +/*------------------------------------------------------------------------------ + This routine checks if all required SUNStepper operations are present. If any + of them are missing it return SUNFALSE. + ----------------------------------------------------------------------------*/ +static sunbooleantype forcingStep_CheckSUNStepper(SUNStepper stepper, + sunbooleantype needs_forcing) +{ + SUNStepper_Ops ops = stepper->ops; + return ops->evolve != NULL && ops->reset != NULL && + ops->setstoptime != NULL && (!needs_forcing || ops->setforcing != NULL); +} + +/*------------------------------------------------------------------------------ + This routine validates arguments when (re)initializing a ForcingStep + integrator + ----------------------------------------------------------------------------*/ +static int forcingStep_CheckArgs(ARKodeMem ark_mem, SUNStepper stepper1, + SUNStepper stepper2, N_Vector y0) +{ + if (stepper1 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepper1 = NULL illegal."); + return ARK_ILL_INPUT; + } + if (!forcingStep_CheckSUNStepper(stepper1, SUNFALSE)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepper1 does not implement the required operations."); + return ARK_ILL_INPUT; + } + + if (stepper2 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepper2 = NULL illegal."); + return ARK_ILL_INPUT; + } + if (!forcingStep_CheckSUNStepper(stepper2, SUNTRUE)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepper2 does not implement the required operations."); + return ARK_ILL_INPUT; + } + + if (y0 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return ARK_ILL_INPUT; + } + + /* Test if all required vector operations are implemented */ + if (!forcingStep_CheckNVector(y0)) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_NVECTOR); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine initializes the step memory and resets the statistics + ----------------------------------------------------------------------------*/ +static void forcingStep_InitStepMem(ARKodeForcingStepMem step_mem, + SUNStepper stepper1, SUNStepper stepper2) +{ + step_mem->stepper[0] = stepper1; + step_mem->stepper[1] = stepper2; + step_mem->n_stepper_evolves[0] = 0; + step_mem->n_stepper_evolves[1] = 0; +} + +/*------------------------------------------------------------------------------ + Creates the ForcingStep integrator + ----------------------------------------------------------------------------*/ +void* ForcingStepCreate(SUNStepper stepper1, SUNStepper stepper2, + sunrealtype t0, N_Vector y0, SUNContext sunctx) +{ + int retval = forcingStep_CheckArgs(NULL, stepper1, stepper2, y0); + if (retval != ARK_SUCCESS) { return NULL; } + + if (sunctx == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_SUNCTX); + return NULL; + } + + /* Create ark_mem structure and set default values */ + ARKodeMem ark_mem = arkCreate(sunctx); + if (ark_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return NULL; + } + + ARKodeForcingStepMem step_mem = (ARKodeForcingStepMem)malloc(sizeof(*step_mem)); + if (step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_ARKMEM_FAIL); + ARKodeFree((void**)&ark_mem); + return NULL; + } + forcingStep_InitStepMem(step_mem, stepper1, stepper2); + + /* Attach step_mem structure and function pointers to ark_mem */ + ark_mem->step_init = forcingStep_Init; + ark_mem->step_fullrhs = forcingStep_FullRHS; + ark_mem->step_reset = forcingStep_Reset; + ark_mem->step_setstepdirection = forcingStep_SetStepDirection; + ark_mem->step = forcingStep_TakeStep; + ark_mem->step_printallstats = forcingStep_PrintAllStats; + ark_mem->step_free = forcingStep_Free; + ark_mem->step_printmem = forcingStep_PrintMem; + ark_mem->step_mem = (void*)step_mem; + + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Error setting default solver options"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + + return ark_mem; +} + +/*------------------------------------------------------------------------------ + This routine re-initializes the ForcingStep module to solve a new problem of + the same size as was previously solved. This routine should also be called + when the problem dynamics or desired solvers have changed dramatically, so + that the problem integration should resume as if started from scratch. + + Note all internal counters are set to 0 on re-initialization. + ----------------------------------------------------------------------------*/ +int ForcingStepReInit(void* arkode_mem, SUNStepper stepper1, + SUNStepper stepper2, sunrealtype t0, N_Vector y0) +{ + ARKodeMem ark_mem = NULL; + ARKodeForcingStepMem step_mem = NULL; + + int retval = forcingStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Check if ark_mem was allocated */ + if (ark_mem->MallocDone == SUNFALSE) + { + arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MALLOC); + return ARK_NO_MALLOC; + } + + retval = forcingStep_CheckArgs(ark_mem, stepper1, stepper2, y0); + if (retval != ARK_SUCCESS) { return retval; } + + forcingStep_InitStepMem(step_mem, stepper1, stepper2); + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + return retval; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Accesses the number of times a given partition was evolved + ----------------------------------------------------------------------------*/ +int ForcingStepGetNumEvolves(void* arkode_mem, int partition, long int* evolves) +{ + ARKodeMem ark_mem = NULL; + ARKodeForcingStepMem step_mem = NULL; + int retval = forcingStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (partition >= NUM_PARTITIONS) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "The partition index is %i but there are only 2 partitions", + partition); + return ARK_ILL_INPUT; + } + + if (partition < 0) + { + *evolves = step_mem->n_stepper_evolves[0] + step_mem->n_stepper_evolves[1]; + } + else { *evolves = step_mem->n_stepper_evolves[partition]; } + + return ARK_SUCCESS; +} diff --git a/src/arkode/arkode_forcingstep_impl.h b/src/arkode/arkode_forcingstep_impl.h new file mode 100644 index 0000000000..a7940a9c4c --- /dev/null +++ b/src/arkode/arkode_forcingstep_impl.h @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 header defines the step memory for ForcingStep. + *--------------------------------------------------------------*/ + +#ifndef ARKODE_FORCINGSTEP_IMPL_H_ +#define ARKODE_FORCINGSTEP_IMPL_H_ + +#include <sundials/sundials_stepper.h> + +#define NUM_PARTITIONS 2 + +typedef struct ARKodeForcingStepMemRec +{ + SUNStepper stepper[NUM_PARTITIONS]; + long int n_stepper_evolves[NUM_PARTITIONS]; +}* ARKodeForcingStepMem; + +#endif diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 020fc6f6aa..dd388d9323 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -230,6 +230,8 @@ typedef int (*ARKTimestepSetDefaults)(ARKodeMem ark_mem); typedef int (*ARKTimestepSetOrder)(ARKodeMem ark_mem, int maxord); typedef int (*ARKTimestepGetNumRhsEvals)(ARKodeMem ark_mem, int partition_index, long int* num_rhs_evals); +typedef int (*ARKTimestepSetStepDirection)(ARKodeMem ark_mem, + sunrealtype stepdir); /* time stepper interface functions -- temporal adaptivity */ typedef int (*ARKTimestepGetEstLocalErrors)(ARKodeMem ark_mem, N_Vector ele); @@ -419,6 +421,7 @@ struct ARKodeMemRec ARKTimestepSetDefaults step_setdefaults; ARKTimestepSetOrder step_setorder; ARKTimestepGetNumRhsEvals step_getnumrhsevals; + ARKTimestepSetStepDirection step_setstepdirection; /* Time stepper module -- temporal adaptivity */ sunbooleantype step_supports_adaptive; diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index f8e1087b43..6c9ee34baa 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -1245,6 +1245,93 @@ int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ARKodeSetStepDirection: + + Specifies the direction of integration (forward or backward) + based on the sign of stepdir. If 0, the direction will remain + unchanged. Note that if a fixed step size was previously set, + this function can change the sign of that. + + This should only be called after ARKodeReset, or between + creating a stepper and ARKodeEvolve. + ---------------------------------------------------------------*/ +int ARKodeSetStepDirection(void* arkode_mem, sunrealtype stepdir) +{ + /* stepdir is a sunrealtype because the direction typically comes from a time + * step h or tend-tstart which are sunrealtypes. If stepdir was in int, + * conversions would be required which can cause undefined behavior when + * greater than MAX_INT */ + int retval; + ARKodeMem ark_mem; + sunrealtype h; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + ark_mem = (ARKodeMem)arkode_mem; + + /* do not change direction once the module has been initialized i.e., after calling + ARKodeEvolve unless ReInit or Reset are called. */ + if (!ark_mem->initsetup) + { + arkProcessError(ark_mem, ARK_STEP_DIRECTION_ERR, __LINE__, __func__, + __FILE__, "Step direction cannot be specified after module initialization."); + return ARK_STEP_DIRECTION_ERR; + } + + if (stepdir != ZERO) + { + retval = ARKodeGetStepDirection(arkode_mem, &h); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to access step direction"); + return retval; + } + + if (h != ZERO && ((h > ZERO) != (stepdir > ZERO))) + { + /* Reverse the sign of h. If adaptive, h will be overwritten anyway by the + * initial step estimation since ARKodeReset must be called before this. + * However, the sign of h will be used to check if the integration + * direction and stop time are consistent, e.g., in ARKodeSetStopTime, so + * we should not set h = 0. */ + ark_mem->h = -h; + /* Clear previous initial step and force an initial step recomputation. + * Normally, this would not occur after a reset, but it is necessary here + * because the timestep used in one direction may not be suitable for the + * other */ + ark_mem->h0u = ZERO; + /* Reverse the step if in fixed mode. If adaptive, reset to 0 to clear any + * old value from a call to ARKodeSetInit */ + ark_mem->hin = ark_mem->fixedstep ? -h : ZERO; + + /* Reset error controller (e.g., error and step size history) */ + if (ark_mem->hadapt_mem && ark_mem->hadapt_mem->hcontroller) + { + SUNErrCode err = + SUNAdaptController_Reset(ark_mem->hadapt_mem->hcontroller); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_CONTROLLER_ERR, __LINE__, __func__, + __FILE__, "Unable to reset error controller object"); + return ARK_CONTROLLER_ERR; + } + } + } + } + + if (ark_mem->step_setstepdirection != NULL) + { + return ark_mem->step_setstepdirection(ark_mem, stepdir); + } + + return ARK_SUCCESS; +} + /*--------------------------------------------------------------- ARKodeSetRootDirection: @@ -2134,6 +2221,35 @@ int ARKodeGetCurrentStep(void* arkode_mem, sunrealtype* hcur) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ARKodeGetStepDirection: + + Gets the direction of integration (forward or backward) based + on the sign of stepdir. A value of 0 indicates integration can + proceed in either direction. + ---------------------------------------------------------------*/ +int ARKodeGetStepDirection(void* arkode_mem, sunrealtype* stepdir) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + if (stepdir == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepdir cannot be NULL"); + } + + *stepdir = (ark_mem->fixedstep || ark_mem->h == ZERO) ? ark_mem->hin + : ark_mem->h; + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- ARKodeGetCurrentState: @@ -2957,6 +3073,7 @@ char* ARKodeGetReturnFlagName(long int flag) sprintf(name, "ARK_MAX_STAGE_LIMIT_FAIL"); break; case ARK_SUNSTEPPER_ERR: sprintf(name, "ARK_SUNSTEPPER_ERR"); break; + case ARK_STEP_DIRECTION_ERR: sprintf(name, "ARK_STEP_DIRECTION_ERR"); break; case ARK_UNRECOGNIZED_ERROR: sprintf(name, "ARK_UNRECOGNIZED_ERROR"); break; default: sprintf(name, "NONE"); } diff --git a/src/arkode/arkode_splittingstep.c b/src/arkode/arkode_splittingstep.c new file mode 100644 index 0000000000..b54c253ff2 --- /dev/null +++ b/src/arkode/arkode_splittingstep.c @@ -0,0 +1,747 @@ +/*------------------------------------------------------------------------------ + * Programmer(s): Steven B. Roberts @ LLNL + *------------------------------------------------------------------------------ + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 ARKODE's operator splitting module + *----------------------------------------------------------------------------*/ + +#include <arkode/arkode_splittingstep.h> +#include <sundials/sundials_nvector.h> + +#include "arkode_impl.h" +#include "arkode_splittingstep_impl.h" + +/*------------------------------------------------------------------------------ + Shortcut routine to unpack step_mem structure from ark_mem. If missing it + returns ARK_MEM_NULL. + ----------------------------------------------------------------------------*/ +static int splittingStep_AccessStepMem(ARKodeMem ark_mem, const char* fname, + ARKodeSplittingStepMem* step_mem) +{ + if (ark_mem->step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_NULL, __LINE__, fname, __FILE__, + "Time step module memory is NULL."); + return ARK_MEM_NULL; + } + *step_mem = (ARKodeSplittingStepMem)ark_mem->step_mem; + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Shortcut routine to unpack ark_mem and step_mem structures from void* pointer. + If either is missing it returns ARK_MEM_NULL. + ----------------------------------------------------------------------------*/ +static int splittingStep_AccessARKODEStepMem(void* arkode_mem, const char* fname, + ARKodeMem* ark_mem, + ARKodeSplittingStepMem* step_mem) +{ + /* access ARKodeMem structure */ + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, fname, __FILE__, + MSG_ARK_NO_MEM); + return ARK_MEM_NULL; + } + *ark_mem = (ARKodeMem)arkode_mem; + + return splittingStep_AccessStepMem(*ark_mem, __func__, step_mem); +} + +/*------------------------------------------------------------------------------ + This routine determines the splitting coefficients to use based on the desired + accuracy. + ----------------------------------------------------------------------------*/ +static int splittingStep_SetCoefficients(ARKodeMem ark_mem, + ARKodeSplittingStepMem step_mem) +{ + if (step_mem->coefficients != NULL) { return ARK_SUCCESS; } + + if (step_mem->order <= 1) + { + /* Lie-Trotter is the default (order < 1) */ + step_mem->coefficients = + SplittingStepCoefficients_LieTrotter(step_mem->partitions); + } + else if (step_mem->order == 3) + { + step_mem->coefficients = + SplittingStepCoefficients_ThirdOrderSuzuki(step_mem->partitions); + } + else if (step_mem->order % 2 == 0) + { + /* Triple jump only works for even order */ + step_mem->coefficients = + SplittingStepCoefficients_TripleJump(step_mem->partitions, step_mem->order); + } + else + { + /* Bump the order up to be even but with a warning */ + int new_order = step_mem->order + 1; + arkProcessError(ark_mem, ARK_WARNING, __LINE__, __func__, __FILE__, + "No splitting method at requested order, using q=%i.", + new_order); + step_mem->coefficients = + SplittingStepCoefficients_TripleJump(step_mem->partitions, new_order); + } + + if (step_mem->coefficients == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Failed to allocate splitting coefficients"); + return ARK_MEM_FAIL; + } + + return ARK_SUCCESS; +} + +/*----------------------------------------------------------------------------- + This routine is called just prior to performing internal time steps (after all + user "set" routines have been called) from within arkInitialSetup. + + With initialization types FIRST_INIT this routine: + - sets/checks the splitting coefficients to be used + + With other initialization types, this routine does nothing. + ----------------------------------------------------------------------------*/ +static int splittingStep_Init(ARKodeMem ark_mem, + SUNDIALS_MAYBE_UNUSED sunrealtype tout, + int init_type) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (ark_mem->interp_type == ARK_INTERP_HERMITE) + { + for (int i = 0; i < step_mem->partitions; i++) + { + if (step_mem->steppers[i]->ops->fullrhs == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "steppers[%d] must implement SUNStepper_FullRhs when using Hermite interpolation", + i); + return ARK_ILL_INPUT; + } + } + } + + /* immediately return if resize or reset */ + if (init_type == RESIZE_INIT || init_type == RESET_INIT) + { + return ARK_SUCCESS; + } + + /* assume fixed step size */ + if (!ark_mem->fixedstep) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Adaptive outer time stepping is not currently supported"); + return ARK_ILL_INPUT; + } + + retval = splittingStep_SetCoefficients(ark_mem, step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + ark_mem->interp_degree = + SUNMAX(1, SUNMIN(step_mem->coefficients->order - 1, ark_mem->interp_degree)); + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This is just a wrapper to call the user-supplied RHS function, + f^1(t,y) + f^2(t,y) + ... + f^P(t,y). + + This will be called in one of three '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) + + In SplittingStep, we accumulate the RHS functions in ARK_FULLRHS_OTHER mode. + Generally, inner steppers will not have the correct yn when this function is + called and will not be able to reuse a function evaluation since their state + resets at the next SUNStepper_Evolve call. + ----------------------------------------------------------------------------*/ +static int splittingStep_FullRHS(ARKodeMem ark_mem, sunrealtype t, N_Vector y, + N_Vector f, SUNDIALS_MAYBE_UNUSED int mode) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + for (int i = 0; i < step_mem->partitions; i++) + { + SUNErrCode err = SUNStepper_FullRhs(step_mem->steppers[i], t, y, + i == 0 ? f : ark_mem->tempv1, + SUN_FULLRHS_OTHER); + if (err != SUN_SUCCESS) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, t); + return ARK_RHSFUNC_FAIL; + } + if (i > 0) { N_VLinearSum(ONE, f, ONE, ark_mem->tempv1, f); } + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine performs a sequential operator splitting method + ----------------------------------------------------------------------------*/ +static int splittingStep_SequentialMethod(ARKodeMem ark_mem, + ARKodeSplittingStepMem step_mem, + int i, N_Vector y) +{ + SplittingStepCoefficients coefficients = step_mem->coefficients; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::splittingStep_SequentialMethod", + "start-sequential-method", + "step = %li, sequential method = %i", ark_mem->nst, i); +#endif + + for (int j = 0; j < coefficients->stages; j++) + { +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::splittingStep_SequentialMethod", "start-stage", + "step = %li, sequential method = %i, stage = %i", + ark_mem->nst, i, j); +#endif + for (int k = 0; k < coefficients->partitions; k++) + { + sunrealtype beta_start = coefficients->beta[i][j][k]; + sunrealtype beta_end = coefficients->beta[i][j + 1][k]; + + if (beta_start == beta_end) { continue; } + + sunrealtype t_start = ark_mem->tn + beta_start * ark_mem->h; + sunrealtype t_end = ark_mem->tn + beta_end * ark_mem->h; + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG + SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, + "ARKODE::splittingStep_SequentialMethod", + "start-inner-evolve", + "step = %li, sequential method = %i, stage = %i, " + "partition = %i, t0 = %" RSYM ", tout = %" RSYM, + ark_mem->nst, i, j, k, t_start, t_end); +#endif + + SUNStepper stepper = step_mem->steppers[k]; + /* TODO(SBR): A potential future optimization is removing this reset and + * a call to SUNStepper_SetStopTime later for methods that start a step + * evolving the same partition the last step ended with (essentially a + * FSAL property). Care is needed when a reset occurs, the step direction + * changes, the coefficients change, etc. */ + SUNErrCode err = SUNStepper_Reset(stepper, t_start, y); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + err = SUNStepper_SetStepDirection(stepper, t_end - t_start); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + err = SUNStepper_SetStopTime(stepper, t_end); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + sunrealtype tret = ZERO; + err = SUNStepper_Evolve(stepper, t_end, y, &tret); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + + step_mem->n_stepper_evolves[k]++; + } + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine performs a single step of the splitting method. + ----------------------------------------------------------------------------*/ +static int splittingStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, + int* nflagPtr) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + *nflagPtr = ARK_SUCCESS; /* No algebraic solver */ + *dsmPtr = ZERO; /* No error estimate */ + + SplittingStepCoefficients coefficients = step_mem->coefficients; + + N_VScale(ONE, ark_mem->yn, ark_mem->ycur); + retval = splittingStep_SequentialMethod(ark_mem, step_mem, 0, ark_mem->ycur); + if (retval != ARK_SUCCESS) { return retval; } + + if (coefficients->alpha[0] != ONE) + { + N_VScale(coefficients->alpha[0], ark_mem->ycur, ark_mem->ycur); + } + + for (int i = 1; i < coefficients->sequential_methods; i++) + { + N_VScale(ONE, ark_mem->yn, ark_mem->tempv1); + retval = splittingStep_SequentialMethod(ark_mem, step_mem, i, + ark_mem->tempv1); + if (retval != ARK_SUCCESS) { return retval; } + N_VLinearSum(ONE, ark_mem->ycur, coefficients->alpha[i], ark_mem->tempv1, + ark_mem->ycur); + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Prints integrator statistics + ----------------------------------------------------------------------------*/ +static int splittingStep_PrintAllStats(ARKodeMem ark_mem, FILE* outfile, + SUNOutputFormat fmt) +{ + // TODO(SBR): update when https://github.com/LLNL/sundials/pull/517 merged + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + switch (fmt) + { + case SUN_OUTPUTFORMAT_TABLE: + for (int k = 0; k < step_mem->partitions; k++) + { + fprintf(outfile, "Partition %i evolves = %ld\n", k, + step_mem->n_stepper_evolves[k]); + } + break; + case SUN_OUTPUTFORMAT_CSV: + for (int k = 0; k < step_mem->partitions; k++) + { + fprintf(outfile, ",Partition %i evolves,%ld", k, + step_mem->n_stepper_evolves[k]); + } + break; + default: + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Invalid formatting option."); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Outputs all solver parameters to the provided file pointer. + ----------------------------------------------------------------------------*/ +static int splittingStep_WriteParameters(ARKodeMem ark_mem, FILE* fp) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + fprintf(fp, "SplittingStep time step module parameters:\n Method order %i\n\n", + step_mem->order); + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Frees all SplittingStep memory. + ----------------------------------------------------------------------------*/ +static void splittingStep_Free(ARKodeMem ark_mem) +{ + ARKodeSplittingStepMem step_mem = (ARKodeSplittingStepMem)ark_mem->step_mem; + if (step_mem != NULL) + { + if (step_mem->steppers != NULL) { free(step_mem->steppers); } + if (step_mem->n_stepper_evolves != NULL) + { + free(step_mem->n_stepper_evolves); + } + SplittingStepCoefficients_Destroy(&step_mem->coefficients); + free(step_mem); + } + ark_mem->step_mem = NULL; +} + +/*------------------------------------------------------------------------------ + This routine outputs the memory from the SplittingStep structure to a + specified file pointer (useful when debugging). + ----------------------------------------------------------------------------*/ +static void splittingStep_PrintMem(ARKodeMem ark_mem, FILE* outfile) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return; } + + /* output integer quantities */ + fprintf(outfile, "SplittingStep: partitions = %i\n", step_mem->partitions); + fprintf(outfile, "SplittingStep: order = %i\n", step_mem->order); + + /* output long integer quantities */ + for (int k = 0; k < step_mem->partitions; k++) + { + fprintf(outfile, "SplittingStep: partition %i: n_stepper_evolves = %li\n", + k, step_mem->n_stepper_evolves[k]); + } + + /* output sunrealtype quantities */ + fprintf(outfile, "SplittingStep: Coefficients:\n"); + SplittingStepCoefficients_Write(step_mem->coefficients, outfile); +} + +/*------------------------------------------------------------------------------ + Specifies the method order + ----------------------------------------------------------------------------*/ +static int splittingStep_SetOrder(ARKodeMem ark_mem, int order) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + /* set user-provided value, or default, depending on argument */ + step_mem->order = SUNMAX(1, order); + + SplittingStepCoefficients_Destroy(&step_mem->coefficients); + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Resets all SplittingStep optional inputs to their default values. Does not + change problem-defining function pointers or user_data pointer. + ----------------------------------------------------------------------------*/ +static int splittingStep_SetDefaults(ARKodeMem ark_mem) +{ + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessStepMem(ark_mem, __func__, &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + return splittingStep_SetOrder(ark_mem, 0); +} + +/*------------------------------------------------------------------------------ + This routine checks if all required vector operations are present. If any of + them is missing it returns SUNFALSE. + ----------------------------------------------------------------------------*/ +static sunbooleantype splittingStep_CheckNVector(N_Vector y) +{ + return y->ops->nvlinearsum != NULL && y->ops->nvscale != NULL; +} + +/*------------------------------------------------------------------------------ + This routine checks if all required SUNStepper operations are present. If any + of them are missing it return SUNFALSE. + ----------------------------------------------------------------------------*/ +static sunbooleantype splittingStep_CheckSUNStepper(SUNStepper stepper) +{ + SUNStepper_Ops ops = stepper->ops; + return ops->evolve != NULL && ops->reset != NULL && + ops->setstoptime != NULL && ops->setstepdirection != NULL; +} + +/*------------------------------------------------------------------------------ + This routine validates arguments when (re)initializing a SplittingStep + integrator + ----------------------------------------------------------------------------*/ +static int splittingStep_CheckArgs(ARKodeMem ark_mem, SUNStepper* steppers, + int partitions, N_Vector y0) +{ + if (steppers == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "steppers = NULL illegal."); + return ARK_ILL_INPUT; + } + + if (partitions <= 1) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "The number of partitions must be greater than one"); + return ARK_ILL_INPUT; + } + + for (int i = 0; i < partitions; i++) + { + if (steppers[i] == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "steppers[%d] = NULL illegal.", i); + return ARK_ILL_INPUT; + } + + if (!splittingStep_CheckSUNStepper(steppers[i])) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "stepper[%d] does not implement the required operations.", + i); + return ARK_ILL_INPUT; + } + } + + if (y0 == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_Y0); + return ARK_ILL_INPUT; + } + + /* Test if all required vector operations are implemented */ + if (!splittingStep_CheckNVector(y0)) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_BAD_NVECTOR); + return ARK_ILL_INPUT; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + This routine initializes the step memory and resets the statistics + ----------------------------------------------------------------------------*/ +static int splittingStep_InitStepMem(ARKodeMem ark_mem, + ARKodeSplittingStepMem step_mem, + SUNStepper* steppers, int partitions) +{ + if (step_mem->steppers != NULL) { free(step_mem->steppers); } + step_mem->steppers = malloc(partitions * sizeof(*steppers)); + if (step_mem->steppers == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_ARKMEM_FAIL); + return ARK_MEM_FAIL; + } + memcpy(step_mem->steppers, steppers, partitions * sizeof(*steppers)); + + if (step_mem->n_stepper_evolves != NULL) + { + free(step_mem->n_stepper_evolves); + } + step_mem->n_stepper_evolves = calloc(partitions, + sizeof(*step_mem->n_stepper_evolves)); + + /* If the number of partitions changed, the coefficients are no longer + * compatible and must be cleared. If a user previously called ARKodeSetOrder + * that will still be respected at the next call to ARKodeEvolve */ + if (step_mem->partitions != partitions) + { + SplittingStepCoefficients_Destroy(&step_mem->coefficients); + } + step_mem->partitions = partitions; + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + Creates the SplittingStep integrator + ---------------------------------------------------------------*/ +void* SplittingStepCreate(SUNStepper* steppers, int partitions, sunrealtype t0, + N_Vector y0, SUNContext sunctx) +{ + int retval = splittingStep_CheckArgs(NULL, steppers, partitions, y0); + if (retval != ARK_SUCCESS) { return NULL; } + + if (sunctx == NULL) + { + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + MSG_ARK_NULL_SUNCTX); + return NULL; + } + + /* Create ark_mem structure and set default values */ + ARKodeMem ark_mem = arkCreate(sunctx); + if (ark_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return NULL; + } + + ARKodeSplittingStepMem step_mem = + (ARKodeSplittingStepMem)malloc(sizeof(*step_mem)); + if (step_mem == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_ARKMEM_FAIL); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + step_mem->partitions = partitions; + step_mem->order = 0; + step_mem->steppers = NULL; + step_mem->n_stepper_evolves = NULL; + step_mem->coefficients = NULL; + retval = splittingStep_InitStepMem(ark_mem, step_mem, steppers, partitions); + if (retval != ARK_SUCCESS) + { + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Attach step_mem structure and function pointers to ark_mem */ + ark_mem->step_init = splittingStep_Init; + ark_mem->step_fullrhs = splittingStep_FullRHS; + ark_mem->step = splittingStep_TakeStep; + ark_mem->step_printallstats = splittingStep_PrintAllStats; + ark_mem->step_writeparameters = splittingStep_WriteParameters; + ark_mem->step_free = splittingStep_Free; + ark_mem->step_printmem = splittingStep_PrintMem; + ark_mem->step_setdefaults = splittingStep_SetDefaults; + ark_mem->step_setorder = splittingStep_SetOrder; + ark_mem->step_mem = (void*)step_mem; + + /* Set default values for ARKStep optional inputs */ + retval = splittingStep_SetDefaults(ark_mem); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Error setting default solver options"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + ARKodeFree((void**)&ark_mem); + return NULL; + } + + ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); + + return ark_mem; +} + +/*------------------------------------------------------------------------------ + This routine re-initializes the SplittingStep module to solve a new problem of + the same size as was previously solved. This routine should also be called + when the problem dynamics or desired solvers have changed dramatically, so + that the problem integration should resume as if started from scratch. + + Note all internal counters are set to 0 on re-initialization. + ----------------------------------------------------------------------------*/ +int SplittingStepReInit(void* arkode_mem, SUNStepper* steppers, int partitions, + sunrealtype t0, N_Vector y0) +{ + ARKodeMem ark_mem = NULL; + ARKodeSplittingStepMem step_mem = NULL; + + int retval = splittingStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return (retval); } + + /* Check if ark_mem was allocated */ + if (ark_mem->MallocDone == SUNFALSE) + { + arkProcessError(ark_mem, ARK_NO_MALLOC, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MALLOC); + return ARK_NO_MALLOC; + } + + retval = splittingStep_CheckArgs(ark_mem, steppers, partitions, y0); + if (retval != ARK_SUCCESS) { return retval; } + + splittingStep_InitStepMem(ark_mem, step_mem, steppers, partitions); + + /* Initialize main ARKODE infrastructure */ + retval = arkInit(ark_mem, t0, y0, FIRST_INIT); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Unable to initialize main ARKODE infrastructure"); + return retval; + } + + return ARK_SUCCESS; +} + +/*--------------------------------------------------------------- + Sets the SplittingStep coefficients. + ---------------------------------------------------------------*/ +int SplittingStepSetCoefficients(void* arkode_mem, + SplittingStepCoefficients coefficients) +{ + ARKodeMem ark_mem = NULL; + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (coefficients == NULL) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Splitting coefficients must be non-NULL"); + return ARK_ILL_INPUT; + } + + if (step_mem->partitions != coefficients->partitions) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "The splitting method has %i partitions but the coefficients have %i.", + step_mem->partitions, coefficients->partitions); + return ARK_ILL_INPUT; + } + + SplittingStepCoefficients_Destroy(&step_mem->coefficients); + step_mem->coefficients = SplittingStepCoefficients_Copy(coefficients); + if (step_mem->coefficients == NULL) + { + arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__, + "Failed to copy splitting coefficients"); + return ARK_MEM_NULL; + } + + return ARK_SUCCESS; +} + +/*------------------------------------------------------------------------------ + Accesses the number of times a given partition was evolved + ----------------------------------------------------------------------------*/ +int SplittingStepGetNumEvolves(void* arkode_mem, int partition, long int* evolves) +{ + ARKodeMem ark_mem = NULL; + ARKodeSplittingStepMem step_mem = NULL; + int retval = splittingStep_AccessARKODEStepMem(arkode_mem, __func__, &ark_mem, + &step_mem); + if (retval != ARK_SUCCESS) { return retval; } + + if (partition >= step_mem->partitions) + { + arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, + __FILE__, "The partition index is %i but there are only %i partitions", + partition, step_mem->partitions); + return ARK_ILL_INPUT; + } + + if (partition < 0) + { + *evolves = 0; + for (int k = 0; k < step_mem->partitions; k++) + { + *evolves += step_mem->n_stepper_evolves[k]; + } + } + else { *evolves = step_mem->n_stepper_evolves[partition]; } + + return ARK_SUCCESS; +} diff --git a/src/arkode/arkode_splittingstep_coefficients.c b/src/arkode/arkode_splittingstep_coefficients.c new file mode 100644 index 0000000000..c0d362e470 --- /dev/null +++ b/src/arkode/arkode_splittingstep_coefficients.c @@ -0,0 +1,482 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 splitting coefficients + *--------------------------------------------------------------*/ + +#include <arkode/arkode_splittingstep.h> +#include <stdlib.h> + +#include "arkode_impl.h" + +/*--------------------------------------------------------------- + Routine to allocate splitting coefficients with zero values for + alpha and beta + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_Alloc( + const int sequential_methods, const int stages, const int partitions) +{ + if (sequential_methods < 1 || stages < 1 || partitions < 1) { return NULL; } + + SplittingStepCoefficients coefficients = + (SplittingStepCoefficients)malloc(sizeof(*coefficients)); + if (coefficients == NULL) { return NULL; } + + coefficients->sequential_methods = sequential_methods; + coefficients->stages = stages; + coefficients->partitions = partitions; + coefficients->order = 0; + + coefficients->alpha = (sunrealtype*)calloc(sequential_methods, + sizeof(*coefficients->alpha)); + if (coefficients->alpha == NULL) + { + SplittingStepCoefficients_Destroy(&coefficients); + return NULL; + } + + /* In order for beta to be indexed like beta[i][j][k], we can't use a single + malloc. The j index requires allocating a matrix of pointers into beta. The + i index requires allocating an array of pointers into that matrix. */ + + /* Array of pointers for index i */ + coefficients->beta = + (sunrealtype***)malloc(sequential_methods * sizeof(*coefficients->beta)); + if (coefficients->beta == NULL) + { + SplittingStepCoefficients_Destroy(&coefficients); + return NULL; + } + + /* Matrix of pointers for index j */ + sunrealtype** beta_cols = (sunrealtype**)malloc( + sequential_methods * (stages + 1) * sizeof(*beta_cols)); + if (beta_cols == NULL) + { + SplittingStepCoefficients_Destroy(&coefficients); + return NULL; + } + + for (int i = 0; i < sequential_methods; i++) + { + coefficients->beta[i] = &beta_cols[i * (stages + 1)]; + } + + /* Contiguous memory to store the beta tensor -- use calloc so only non-zero + * coefficients need to be set */ + sunrealtype* beta_mem = + (sunrealtype*)calloc(sequential_methods * (stages + 1) * partitions, + sizeof(*beta_mem)); + if (beta_mem == NULL) + { + SplittingStepCoefficients_Destroy(&coefficients); + return NULL; + } + + /* Set pointers into the beta tensor */ + for (int i = 0; i < sequential_methods; i++) + { + for (int j = 0; j <= stages; j++) + { + coefficients->beta[i][j] = &beta_mem[(i * (stages + 1) + j) * partitions]; + } + } + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to create splitting coefficients which performs a copy + of the alpha and beta parameters + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_Create( + const int sequential_methods, const int stages, const int partitions, + const int order, sunrealtype* const alpha, sunrealtype* const beta) +{ + if (alpha == NULL || beta == NULL || order < 1) { return NULL; } + + SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(sequential_methods, stages, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = order; + memcpy(coefficients->alpha, alpha, sequential_methods * sizeof(sunrealtype)); + memcpy(coefficients->beta[0][0], beta, + sequential_methods * (stages + 1) * partitions * sizeof(sunrealtype)); + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to free splitting coefficients + ---------------------------------------------------------------*/ +void SplittingStepCoefficients_Destroy(SplittingStepCoefficients* coefficients) +{ + if (coefficients == NULL || *coefficients == NULL) { return; } + + SplittingStepCoefficients coeffs = *coefficients; + if (coeffs->alpha != NULL) { free(coeffs->alpha); } + if (coeffs->beta != NULL) + { + if (coeffs->beta[0] != NULL) + { + if (coeffs->beta[0][0] != NULL) { free(coeffs->beta[0][0]); } + free(coeffs->beta[0]); + } + free(coeffs->beta); + } + free(coeffs); + *coefficients = NULL; +} + +/*--------------------------------------------------------------- + Routine to create a copy of splitting coefficients + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_Copy( + const SplittingStepCoefficients coefficients) +{ + if (coefficients == NULL) { return NULL; } + + SplittingStepCoefficients coefficientsCopy = + SplittingStepCoefficients_Alloc(coefficients->sequential_methods, + coefficients->stages, + coefficients->partitions); + if (coefficientsCopy == NULL) { return NULL; } + + coefficientsCopy->order = coefficients->order; + memcpy(coefficientsCopy->alpha, coefficients->alpha, + coefficients->sequential_methods * sizeof(sunrealtype)); + + /* beta[0][0] points to the contiguous memory allocation, so we can copy it + with a single memcpy */ + memcpy(coefficientsCopy->beta[0][0], coefficients->beta[0][0], + coefficients->sequential_methods * (coefficients->stages + 1) * + coefficients->partitions * sizeof(sunrealtype)); + + return coefficientsCopy; +} + +/*--------------------------------------------------------------- + Routine to load coefficients from an ID + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_LoadCoefficients( + const ARKODE_SplittingCoefficientsID method) +{ + switch (method) + { +#define ARK_SPLITTING_COEFFICIENTS(name, coeff) \ + case name: coeff break; +#include "arkode_splittingstep_coefficients.def" +#undef ARK_SPLITTING_COEFFICIENTS + + default: + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown splitting coefficients"); + return NULL; + } +} + +/*--------------------------------------------------------------- + Routine to load coefficients using a string representation of + an enum entry in ARKODE_SplittingCoefficientsID + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_LoadCoefficientsByName( + const char* const method) +{ +#define ARK_SPLITTING_COEFFICIENTS(name, coeff) \ + if (strcmp(#name, method) == 0) coeff +#include "arkode_splittingstep_coefficients.def" +#undef ARK_SPLITTING_COEFFICIENTS + + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown splitting coefficients"); + + return NULL; +} + +/*--------------------------------------------------------------- + Routine to convert a coefficient enum value to its string + representation + ---------------------------------------------------------------*/ +const char* SplittingStepCoefficients_IDToName( + const ARKODE_SplittingCoefficientsID id) +{ + /* Use X-macro to test each coefficient name */ + switch (id) + { +#define ARK_SPLITTING_COEFFICIENTS(name, coeff) \ + case name: return #name; +#include "arkode_splittingstep_coefficients.def" +#undef ARK_SPLITTING_COEFFICIENTS + + default: + arkProcessError(NULL, ARK_ILL_INPUT, __LINE__, __func__, __FILE__, + "Unknown splitting coefficients"); + return NULL; + } +} + +/*--------------------------------------------------------------- + Routine to construct the standard Lie-Trotter splitting + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_LieTrotter(const int partitions) +{ + const SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(1, 1, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = 1; + coefficients->alpha[0] = SUN_RCONST(1.0); + for (int i = 0; i < partitions; i++) + { + coefficients->beta[0][1][i] = SUN_RCONST(1.0); + } + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to construct the standard Stang splitting + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_Strang(const int partitions) +{ + return SplittingStepCoefficients_TripleJump(partitions, 2); +} + +/*--------------------------------------------------------------- + Routine to construct a parallel splitting method + Phi_1(h) + Phi_2(h) + ... + Phi_p(h) - (p - 1) * y_n + where Phi_i is the flow of partition i and p = partitions. + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_Parallel(const int partitions) +{ + const SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(partitions + 1, 1, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = 1; + for (int i = 0; i < partitions; i++) + { + coefficients->alpha[i] = SUN_RCONST(1.0); + coefficients->beta[i][1][i] = SUN_RCONST(1.0); + } + + coefficients->alpha[partitions] = 1 - partitions; + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to construct a symmetric parallel splitting which is + the average of the Lie-Trotter method and its adjoint + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_SymmetricParallel( + const int partitions) +{ + const SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(2, partitions, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = 2; + coefficients->alpha[0] = SUN_RCONST(0.5); + coefficients->alpha[1] = SUN_RCONST(0.5); + + for (int i = 0; i < partitions; i++) + { + coefficients->beta[0][partitions][i] = SUN_RCONST(1.0); + for (int j = partitions - i - 1; j < partitions; j++) + { + coefficients->beta[1][i + 1][j] = SUN_RCONST(1.0); + } + } + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to construct a 3rd order method of Suzuki of the form + L(p1 h) * L*(p2 h) * L(p3 h) * L*(p4 h) * L(p5 h) + where L is a Lie-Trotter splitting and L* is its adjoint. + Composition is denoted by *. + ---------------------------------------------------------------*/ +SplittingStepCoefficients SplittingStepCoefficients_ThirdOrderSuzuki( + const int partitions) +{ + const SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(1, 2 * partitions - 1, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = 3; + coefficients->alpha[0] = SUN_RCONST(1.0); + + for (int i = 1; i < partitions; i++) + { + for (int j = 0; j < partitions; j++) + { + // Constants from https://doi.org/10.1143/JPSJ.61.3015 pg. 3019 + const sunrealtype p1 = + SUN_RCONST(0.2683300957817599249569552299254991394812); + const sunrealtype p2 = + SUN_RCONST(0.6513314272356399320939424082278836500821); + + coefficients->beta[0][i][j] = i + j < partitions ? p1 : (p1 + p2); + coefficients->beta[0][partitions + i - 1][j] = + SUN_RCONST(1.0) - (i + j < partitions ? (p1 + p2) : p1); + } + } + + for (int i = 0; i < partitions; i++) + { + coefficients->beta[0][2 * partitions - 1][i] = SUN_RCONST(1.0); + } + + return coefficients; +} + +/*--------------------------------------------------------------- + Routine to construct a composition method of the form + S(gamma_0 h)^c * S(gamma_1 h) * S(gamma_0)^c + where S is a lower order splitting (with Stang as the base case), + * and ^ denote composition, and c = composition_stages. This + covers both the triple jump (c=1) and Suzuki fractal (c=2). + ---------------------------------------------------------------*/ +static sunrealtype* const* SplittingStepCoefficients_ComposeStrangHelper( + const int partitions, const int order, const int composition_stages, + const sunrealtype start, const sunrealtype end, sunrealtype* const* const beta) +{ + const sunrealtype diff = end - start; + if (order == 2) + { + /* The base case is an order 2 Strang splitting */ + const sunrealtype mid = start + diff / SUN_RCONST(2.0); + for (int j = 1; j <= partitions; j++) + { + for (int k = 0; k < partitions; k++) + { + beta[j][k] = (k + j < partitions) ? mid : end; + } + } + + return &beta[partitions - 1]; + } + + sunrealtype* const* beta_cur = beta; + sunrealtype start_cur = start; + /* This is essentially the gamma coefficient from Geometric Numerical + * Integration (https://doi.org/10.1007/3-540-30666-8) pg 44-45 scaled by the + * current interval */ + const sunrealtype gamma = + diff / (composition_stages - 1 - + SUNRpowerR(composition_stages - 1, SUN_RCONST(1.0) / (order - 1))); + for (int i = 1; i <= composition_stages; i++) + { + /* To avoid roundoff issues, this ensures end_cur=1 for the last value of i*/ + const sunrealtype end_cur = 2 * i < composition_stages + ? (start + i * gamma) + : (end + (i - composition_stages) * gamma); + /* Recursively generate coefficients and shift beta_cur */ + beta_cur = SplittingStepCoefficients_ComposeStrangHelper(partitions, + order - 2, + composition_stages, + start_cur, end_cur, + beta_cur); + start_cur = end_cur; + } + + return beta_cur; +} + +/*--------------------------------------------------------------- + Routine which does validation and setup before calling + SplittingStepCoefficients_ComposeStrangHelper to fill in the + beta coefficients + ---------------------------------------------------------------*/ +static SplittingStepCoefficients SplittingStepCoefficients_ComposeStrang( + const int partitions, const int order, const int composition_stages) +{ + if (order < 2 || order % 2 != 0) + { + // Only even orders allowed + return NULL; + } + + const int stages = 1 + (partitions - 1) * + SUNIpowerI(composition_stages, order / 2 - 1); + const SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Alloc(1, stages, partitions); + if (coefficients == NULL) { return NULL; } + + coefficients->order = order; + coefficients->alpha[0] = SUN_RCONST(1.0); + + SplittingStepCoefficients_ComposeStrangHelper(partitions, order, + composition_stages, + SUN_RCONST(0.0), SUN_RCONST(1.0), + coefficients->beta[0]); + + return coefficients; +} + +SplittingStepCoefficients SplittingStepCoefficients_TripleJump(const int partitions, + const int order) +{ + return SplittingStepCoefficients_ComposeStrang(partitions, order, 3); +} + +SplittingStepCoefficients SplittingStepCoefficients_SuzukiFractal( + const int partitions, const int order) +{ + return SplittingStepCoefficients_ComposeStrang(partitions, order, 5); +} + +/*--------------------------------------------------------------- + Routine to print a splitting coefficient structure + ---------------------------------------------------------------*/ +void SplittingStepCoefficients_Write(const SplittingStepCoefficients coefficients, + FILE* const outfile) +{ + // TODO(SBR): update when https://github.com/LLNL/sundials/pull/517 merged + if (outfile == NULL || coefficients == NULL || coefficients->alpha == NULL || + coefficients->beta == NULL || coefficients->beta[0] == NULL || + coefficients->beta[0][0] == NULL) + { + return; + } + + fprintf(outfile, " sequential methods = %i\n", + coefficients->sequential_methods); + fprintf(outfile, " stages = %i\n", coefficients->stages); + fprintf(outfile, " partitions = %i\n", coefficients->partitions); + fprintf(outfile, " order = %i\n", coefficients->order); + fprintf(outfile, " alpha = "); + for (int i = 0; i < coefficients->sequential_methods; i++) + { + fprintf(outfile, "%" RSYM " ", coefficients->alpha[i]); + } + fprintf(outfile, "\n"); + + for (int i = 0; i < coefficients->sequential_methods; i++) + { + fprintf(outfile, " beta[%i] = \n", i); + for (int j = 0; j <= coefficients->stages; j++) + { + fprintf(outfile, " "); + for (int k = 0; k < coefficients->partitions; k++) + { + fprintf(outfile, "%" RSYM " ", coefficients->beta[i][j][k]); + } + fprintf(outfile, "\n"); + } + fprintf(outfile, "\n"); + } +} diff --git a/src/arkode/arkode_splittingstep_coefficients.def b/src/arkode/arkode_splittingstep_coefficients.def new file mode 100644 index 0000000000..2bc7e154d3 --- /dev/null +++ b/src/arkode/arkode_splittingstep_coefficients.def @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 file defines splitting coefficients using X-macros + *--------------------------------------------------------------*/ + +/* + When adding a new method, enter the coefficients below and add + a new enum entry to include/arkode/arkode_splittingstep_coefficients.h +*/ + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_NONE, { + return NULL; + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_LIE_TROTTER_1_1_2, { + return SplittingStepCoefficients_LieTrotter(2); + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_STRANG_2_2_2, { + return SplittingStepCoefficients_Strang(2); + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_BEST_2_2_2, { + const SplittingStepCoefficients coefficients = SplittingStepCoefficients_Alloc(1, 2, 2); + coefficients->order = 2; + coefficients->alpha[0] = SUN_RCONST(1.0); + coefficients->beta[0][1][0] = SUN_RCONST(1.0) - SUNRsqrt(SUN_RCONST(0.5)); + coefficients->beta[0][1][1] = SUNRsqrt(SUN_RCONST(0.5)); + coefficients->beta[0][2][0] = SUN_RCONST(1.0); + coefficients->beta[0][2][1] = SUN_RCONST(1.0); + return coefficients; + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_SUZUKI_3_3_2, { + return SplittingStepCoefficients_ThirdOrderSuzuki(2); + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_RUTH_3_3_2, { + const SplittingStepCoefficients coefficients = SplittingStepCoefficients_Alloc(1, 3, 2); + coefficients->order = 3; + coefficients->alpha[0] = SUN_RCONST(1.0); + coefficients->beta[0][1][0] = SUN_RCONST(1.0); + coefficients->beta[0][1][1] = -SUN_RCONST(1.0) / SUN_RCONST(24.0); + coefficients->beta[0][2][0] = SUN_RCONST(1.0) / SUN_RCONST(3.0); + coefficients->beta[0][2][1] = SUN_RCONST(17.0) / SUN_RCONST(24.0); + coefficients->beta[0][3][0] = SUN_RCONST(1.0); + coefficients->beta[0][3][1] = SUN_RCONST(1.0); + return coefficients; + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_YOSHIDA_4_4_2, { + return SplittingStepCoefficients_TripleJump(2, 4); + }) + +ARK_SPLITTING_COEFFICIENTS(ARKODE_SPLITTING_YOSHIDA_8_6_2, { + return SplittingStepCoefficients_TripleJump(2, 6); + }) diff --git a/src/arkode/arkode_splittingstep_impl.h b/src/arkode/arkode_splittingstep_impl.h new file mode 100644 index 0000000000..88988b4eb6 --- /dev/null +++ b/src/arkode/arkode_splittingstep_impl.h @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + *--------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 header defines the step memory for SplittingStep. + *--------------------------------------------------------------*/ + +#ifndef ARKODE_SPLITTINGSTEP_IMPL_H_ +#define ARKODE_SPLITTINGSTEP_IMPL_H_ + +#include <arkode/arkode_splittingstep.h> + +typedef struct ARKodeSplittingStepMemRec +{ + SUNStepper* steppers; + SplittingStepCoefficients coefficients; + long int* n_stepper_evolves; + + int partitions; + int order; +}* ARKodeSplittingStepMem; + +#endif diff --git a/src/arkode/arkode_sunstepper.c b/src/arkode/arkode_sunstepper.c index 261379bf2a..869e3937ac 100644 --- a/src/arkode/arkode_sunstepper.c +++ b/src/arkode/arkode_sunstepper.c @@ -115,6 +115,20 @@ static SUNErrCode arkSUNStepperSetStopTime(SUNStepper stepper, sunrealtype tstop return SUN_SUCCESS; } +static SUNErrCode arkSUNStepperSetStepDirection(SUNStepper stepper, + sunrealtype stepdir) +{ + SUNFunctionBegin(stepper->sunctx); + /* extract the ARKODE memory struct */ + void* arkode_mem; + SUNCheckCall(SUNStepper_GetContent(stepper, &arkode_mem)); + + stepper->last_flag = ARKodeSetStepDirection(arkode_mem, stepdir); + if (stepper->last_flag != ARK_SUCCESS) { return SUN_ERR_OP_FAIL; } + + return SUN_SUCCESS; +} + static SUNErrCode arkSUNStepperSetForcing(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) @@ -199,6 +213,9 @@ int ARKodeCreateSUNStepper(void* arkode_mem, SUNStepper* stepper) return ARK_SUNSTEPPER_ERR; } + err = SUNStepper_SetStepDirectionFn(*stepper, arkSUNStepperSetStepDirection); + if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (ark_mem->step_setforcing != NULL) { err = SUNStepper_SetForcingFn(*stepper, arkSUNStepperSetForcing); diff --git a/src/arkode/fmod_int32/farkode_forcingstep_mod.c b/src/arkode/fmod_int32/farkode_forcingstep_mod.c new file mode 100644 index 0000000000..efb8ae114a --- /dev/null +++ b/src/arkode/fmod_int32/farkode_forcingstep_mod.c @@ -0,0 +1,264 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_forcingstep.h" + +SWIGEXPORT void * _wrap_FForcingStepCreate(void *farg1, void *farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepper)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)ForcingStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FForcingStepReInit(void *farg1, void *farg2, void *farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; + SUNStepper arg3 = (SUNStepper) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper)(farg2); + arg3 = (SUNStepper)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)ForcingStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FForcingStepGetNumEvolves(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)ForcingStepGetNumEvolves(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 b/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 new file mode 100644 index 0000000000..05d52265fe --- /dev/null +++ b/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 @@ -0,0 +1,144 @@ +! 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-2024, 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 farkode_forcingstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FForcingStepCreate + public :: FForcingStepReInit + public :: FForcingStepGetNumEvolves + +! WRAPPER DECLARATIONS +interface +function swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FForcingStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FForcingStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FForcingStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FForcingStepGetNumEvolves(farg1, farg2, farg3) & +bind(C, name="_wrap_FForcingStepGetNumEvolves") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FForcingStepCreate(stepper1, stepper2, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = stepper1 +farg2 = stepper2 +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FForcingStepReInit(arkode_mem, stepper1, stepper2, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = stepper1 +farg3 = stepper2 +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FForcingStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FForcingStepGetNumEvolves(arkode_mem, partition, evolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition +integer(C_LONG), dimension(*), target, intent(inout) :: evolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition +farg3 = c_loc(evolves(1)) +fresult = swigc_FForcingStepGetNumEvolves(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c index 77798fc2b7..4c6dfdc4e3 100644 --- a/src/arkode/fmod_int32/farkode_mod.c +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -619,6 +619,20 @@ SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FARKodeSetStepDirection(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetStepDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1321,6 +1335,20 @@ SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { } +SWIGEXPORT int _wrap_FARKodeGetStepDirection(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetStepDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index ce6af7d24f..816d31aba5 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -97,6 +97,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT integer(C_INT), parameter, public :: ARK_SUNSTEPPER_ERR = -51_C_INT + integer(C_INT), parameter, public :: ARK_STEP_DIRECTION_ERR = -52_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -135,6 +136,7 @@ module farkode_mod public :: FARKodeSetStopTime public :: FARKodeClearStopTime public :: FARKodeSetFixedStep + public :: FARKodeSetStepDirection public :: FARKodeSetUserData public :: FARKodeSetPostprocessStepFn public :: FARKodeSetPostprocessStageFn @@ -184,6 +186,7 @@ module farkode_mod public :: FARKodeGetNumSteps public :: FARKodeGetLastStep public :: FARKodeGetCurrentStep + public :: FARKodeGetStepDirection public :: FARKodeGetErrWeights public :: FARKodeGetNumGEvals public :: FARKodeGetRootInfo @@ -670,6 +673,15 @@ function swigc_FARKodeSetFixedStep(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeSetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStepDirection") & +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_FARKodeSetUserData(farg1, farg2) & bind(C, name="_wrap_FARKodeSetUserData") & result(fresult) @@ -1119,6 +1131,15 @@ function swigc_FARKodeGetCurrentStep(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetStepDirection") & +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_FARKodeGetErrWeights(farg1, farg2) & bind(C, name="_wrap_FARKodeGetErrWeights") & result(fresult) @@ -2792,6 +2813,22 @@ function FARKodeSetFixedStep(arkode_mem, hfixed) & swig_result = fresult end function +function FARKodeSetStepDirection(arkode_mem, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = stepdir +fresult = swigc_FARKodeSetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FARKodeSetUserData(arkode_mem, user_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3600,6 +3637,22 @@ function FARKodeGetCurrentStep(arkode_mem, hcur) & swig_result = fresult end function +function FARKodeGetStepDirection(arkode_mem, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepdir(1)) +fresult = swigc_FARKodeGetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FARKodeGetErrWeights(arkode_mem, eweight) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.c b/src/arkode/fmod_int32/farkode_splittingstep_mod.c new file mode 100644 index 0000000000..3006138373 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.c @@ -0,0 +1,764 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "arkode/arkode_splittingstep.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +#include <string.h> + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper const *farg1, double *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->alpha = arg2; +} + + +SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->alpha); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper const *farg1, void *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (sunrealtype ***)(farg2); + if (arg1) (arg1)->beta = arg2; +} + + +SWIGEXPORT void * _wrap_SplittingStepCoefficientsMem_beta_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype ***result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (sunrealtype ***) ((arg1)->beta); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_sequential_methods_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::sequential_methods", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->sequential_methods = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_sequential_methods_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::sequential_methods", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->sequential_methods); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_stages_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::stages", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->stages = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_stages_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::stages", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->stages); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_partitions_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::partitions", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->partitions = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_partitions_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::partitions", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->partitions); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_order_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::order", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->order = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_order_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::order", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->order); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_SplittingStepCoefficientsMem() { + SwigClassWrapper fresult ; + struct SplittingStepCoefficientsMem *result = 0 ; + + result = (struct SplittingStepCoefficientsMem *)calloc(1, sizeof(struct SplittingStepCoefficientsMem)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_SplittingStepCoefficientsMem(SwigClassWrapper *farg1) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + + SWIG_check_mutable(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::~SplittingStepCoefficientsMem()", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + struct SplittingStepCoefficientsMem *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Alloc(int const *farg1, int const *farg2, int const *farg3) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Alloc(arg1,arg2,arg3); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Create(int const *farg1, int const *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Create(arg1,arg2,arg3,arg4,arg5,arg6); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_FSplittingStepCoefficients_Destroy(void *farg1) { + SplittingStepCoefficients *arg1 = (SplittingStepCoefficients *) 0 ; + + arg1 = (SplittingStepCoefficients *)(farg1); + SplittingStepCoefficients_Destroy(arg1); +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Copy(SwigClassWrapper const *farg1) { + SwigClassWrapper fresult ; + SplittingStepCoefficients arg1 = (SplittingStepCoefficients) 0 ; + SplittingStepCoefficients result; + + SWIG_check_mutable(*farg1, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepCoefficients_Copy(SplittingStepCoefficients)", return SwigClassWrapper_uninitialized()); + arg1 = (SplittingStepCoefficients)(farg1->cptr); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Copy(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_FSplittingStepCoefficients_Write(SwigClassWrapper const *farg1, void *farg2) { + SplittingStepCoefficients arg1 = (SplittingStepCoefficients) 0 ; + FILE *arg2 = (FILE *) 0 ; + + SWIG_check_mutable(*farg1, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepCoefficients_Write(SplittingStepCoefficients,FILE *)", return ); + arg1 = (SplittingStepCoefficients)(farg1->cptr); + arg2 = (FILE *)(farg2); + SplittingStepCoefficients_Write(arg1,arg2); +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LoadCoefficients(int const *farg1) { + SwigClassWrapper fresult ; + ARKODE_SplittingCoefficientsID arg1 ; + SplittingStepCoefficients result; + + arg1 = (ARKODE_SplittingCoefficientsID)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LoadCoefficients(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LoadCoefficientsByName(SwigArrayWrapper *farg1) { + SwigClassWrapper fresult ; + char *arg1 = (char *) 0 ; + SplittingStepCoefficients result; + + arg1 = (char *)(farg1->data); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LoadCoefficientsByName((char const *)arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FSplittingStepCoefficients_IDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_SplittingCoefficientsID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_SplittingCoefficientsID)(*farg1); + result = (char *)SplittingStepCoefficients_IDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LieTrotter(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LieTrotter(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Strang(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Strang(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Parallel(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Parallel(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SymmetricParallel(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_SymmetricParallel(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_ThirdOrderSuzuki(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_ThirdOrderSuzuki(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_TripleJump(int const *farg1, int const *farg2) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + result = (SplittingStepCoefficients)SplittingStepCoefficients_TripleJump(arg1,arg2); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SuzukiFractal(int const *farg1, int const *farg2) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + result = (SplittingStepCoefficients)SplittingStepCoefficients_SuzukiFractal(arg1,arg2); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void * _wrap_FSplittingStepCreate(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + SUNStepper *arg1 = (SUNStepper *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNStepper *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)SplittingStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepReInit(void *farg1, void *farg2, int const *farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + int arg3 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper *)(farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)SplittingStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepSetCoefficients(void *farg1, SwigClassWrapper const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SplittingStepCoefficients arg2 = (SplittingStepCoefficients) 0 ; + int result; + + arg1 = (void *)(farg1); + SWIG_check_mutable(*farg2, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepSetCoefficients(void *,SplittingStepCoefficients)", return 0); + arg2 = (SplittingStepCoefficients)(farg2->cptr); + result = (int)SplittingStepSetCoefficients(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepGetNumEvolves(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)SplittingStepGetNumEvolves(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 new file mode 100644 index 0000000000..9e988fe7d0 --- /dev/null +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 @@ -0,0 +1,947 @@ +! 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-2024, 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 farkode_splittingstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct SplittingStepCoefficientsMem + type, public :: SplittingStepCoefficientsMem + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_alpha => swigf_SplittingStepCoefficientsMem_alpha_set + procedure :: get_alpha => swigf_SplittingStepCoefficientsMem_alpha_get + procedure :: set_beta => swigf_SplittingStepCoefficientsMem_beta_set + procedure :: get_beta => swigf_SplittingStepCoefficientsMem_beta_get + procedure :: set_sequential_methods => swigf_SplittingStepCoefficientsMem_sequential_methods_set + procedure :: get_sequential_methods => swigf_SplittingStepCoefficientsMem_sequential_methods_get + procedure :: set_stages => swigf_SplittingStepCoefficientsMem_stages_set + procedure :: get_stages => swigf_SplittingStepCoefficientsMem_stages_get + procedure :: set_partitions => swigf_SplittingStepCoefficientsMem_partitions_set + procedure :: get_partitions => swigf_SplittingStepCoefficientsMem_partitions_get + procedure :: set_order => swigf_SplittingStepCoefficientsMem_order_set + procedure :: get_order => swigf_SplittingStepCoefficientsMem_order_get + procedure :: release => swigf_release_SplittingStepCoefficientsMem + procedure, private :: swigf_SplittingStepCoefficientsMem_op_assign__ + generic :: assignment(=) => swigf_SplittingStepCoefficientsMem_op_assign__ + end type SplittingStepCoefficientsMem + interface SplittingStepCoefficientsMem + module procedure swigf_create_SplittingStepCoefficientsMem + end interface + ! typedef enum ARKODE_SplittingCoefficientsID + enum, bind(c) + enumerator :: ARKODE_SPLITTING_NONE = -1 + enumerator :: ARKODE_MIN_SPLITTING_NUM = 0 + enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM + enumerator :: ARKODE_SPLITTING_STRANG_2_2_2 + enumerator :: ARKODE_SPLITTING_BEST_2_2_2 + enumerator :: ARKODE_SPLITTING_SUZUKI_3_3_2 + enumerator :: ARKODE_SPLITTING_RUTH_3_3_2 + enumerator :: ARKODE_SPLITTING_YOSHIDA_4_4_2 + enumerator :: ARKODE_SPLITTING_YOSHIDA_8_6_2 + enumerator :: ARKODE_MAX_SPLITTING_NUM = ARKODE_SPLITTING_YOSHIDA_8_6_2 + end enum + integer, parameter, public :: ARKODE_SplittingCoefficientsID = kind(ARKODE_SPLITTING_NONE) + public :: ARKODE_SPLITTING_NONE, ARKODE_MIN_SPLITTING_NUM, ARKODE_SPLITTING_LIE_TROTTER_1_1_2, ARKODE_SPLITTING_STRANG_2_2_2, & + ARKODE_SPLITTING_BEST_2_2_2, ARKODE_SPLITTING_SUZUKI_3_3_2, ARKODE_SPLITTING_RUTH_3_3_2, ARKODE_SPLITTING_YOSHIDA_4_4_2, & + ARKODE_SPLITTING_YOSHIDA_8_6_2, ARKODE_MAX_SPLITTING_NUM + public :: FSplittingStepCoefficients_Alloc + public :: FSplittingStepCoefficients_Create + public :: FSplittingStepCoefficients_Destroy + public :: FSplittingStepCoefficients_Copy + public :: FSplittingStepCoefficients_Write + public :: FSplittingStepCoefficients_LoadCoefficients + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FSplittingStepCoefficients_LoadCoefficientsByName + public :: FSplittingStepCoefficients_IDToName + public :: FSplittingStepCoefficients_LieTrotter + public :: FSplittingStepCoefficients_Strang + public :: FSplittingStepCoefficients_Parallel + public :: FSplittingStepCoefficients_SymmetricParallel + public :: FSplittingStepCoefficients_ThirdOrderSuzuki + public :: FSplittingStepCoefficients_TripleJump + public :: FSplittingStepCoefficients_SuzukiFractal + public :: FSplittingStepCreate + public :: FSplittingStepReInit + public :: FSplittingStepSetCoefficients + public :: FSplittingStepGetNumEvolves + +! WRAPPER DECLARATIONS +interface +subroutine swigc_SplittingStepCoefficientsMem_alpha_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_alpha_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_alpha_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_alpha_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_beta_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_beta_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_beta_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_beta_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_sequential_methods_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_sequential_methods_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_sequential_methods_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_sequential_methods_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_stages_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_partitions_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_partitions_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_partitions_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_partitions_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_order_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_order_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_order_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_order_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_new_SplittingStepCoefficientsMem() & +bind(C, name="_wrap_new_SplittingStepCoefficientsMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_SplittingStepCoefficientsMem(farg1) & +bind(C, name="_wrap_delete_SplittingStepCoefficientsMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_SplittingStepCoefficientsMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FSplittingStepCoefficients_Alloc(farg1, farg2, farg3) & +bind(C, name="_wrap_FSplittingStepCoefficients_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Create(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSplittingStepCoefficients_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_FSplittingStepCoefficients_Destroy(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Destroy") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSplittingStepCoefficients_Copy(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_FSplittingStepCoefficients_Write(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_Write") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FSplittingStepCoefficients_LoadCoefficients(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LoadCoefficients") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_LoadCoefficientsByName(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LoadCoefficientsByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(SwigClassWrapper) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FSplittingStepCoefficients_IDToName(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_IDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_LieTrotter(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LieTrotter") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Strang(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Strang") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Parallel(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_SymmetricParallel(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_SymmetricParallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_ThirdOrderSuzuki(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_ThirdOrderSuzuki") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_TripleJump(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_TripleJump") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_SuzukiFractal(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_SuzukiFractal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSplittingStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FSplittingStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSplittingStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: 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_FSplittingStepSetCoefficients(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepSetCoefficients") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSplittingStepGetNumEvolves(farg1, farg2, farg3) & +bind(C, name="_wrap_FSplittingStepGetNumEvolves") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +subroutine swigf_SplittingStepCoefficientsMem_alpha_set(self, alpha) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: alpha +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(alpha(1)) +call swigc_SplittingStepCoefficientsMem_alpha_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_alpha_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_alpha_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_SplittingStepCoefficientsMem_beta_set(self, beta) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: beta +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(beta) +call swigc_SplittingStepCoefficientsMem_beta_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_beta_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_beta_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SplittingStepCoefficientsMem_sequential_methods_set(self, sequential_methods) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: sequential_methods +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = sequential_methods +call swigc_SplittingStepCoefficientsMem_sequential_methods_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_sequential_methods_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_sequential_methods_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_stages_set(self, stages) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: stages +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = stages +call swigc_SplittingStepCoefficientsMem_stages_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_stages_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_stages_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_partitions_set(self, partitions) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = partitions +call swigc_SplittingStepCoefficientsMem_partitions_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_partitions_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_partitions_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_order_set(self, order) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = order +call swigc_SplittingStepCoefficientsMem_order_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_order_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_order_get(farg1) +swig_result = fresult +end function + +function swigf_create_SplittingStepCoefficientsMem() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_SplittingStepCoefficientsMem() +self%swigdata = fresult +end function + +subroutine swigf_release_SplittingStepCoefficientsMem(self) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_SplittingStepCoefficientsMem(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_SplittingStepCoefficientsMem_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(inout) :: self +type(SplittingStepCoefficientsMem), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_SplittingStepCoefficientsMem_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FSplittingStepCoefficients_Alloc(sequential_methods, stages, partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: sequential_methods +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = sequential_methods +farg2 = stages +farg3 = partitions +fresult = swigc_FSplittingStepCoefficients_Alloc(farg1, farg2, farg3) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Create(sequential_methods, stages, partitions, order, alpha, beta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: sequential_methods +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +real(C_DOUBLE), dimension(*), target, intent(inout) :: alpha +real(C_DOUBLE), dimension(*), target, intent(inout) :: beta +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = sequential_methods +farg2 = stages +farg3 = partitions +farg4 = order +farg5 = c_loc(alpha(1)) +farg6 = c_loc(beta(1)) +fresult = swigc_FSplittingStepCoefficients_Create(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result%swigdata = fresult +end function + +subroutine FSplittingStepCoefficients_Destroy(coefficients) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: coefficients +type(C_PTR) :: farg1 + +farg1 = c_loc(coefficients) +call swigc_FSplittingStepCoefficients_Destroy(farg1) +end subroutine + +function FSplittingStepCoefficients_Copy(coefficients) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +type(SwigClassWrapper) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = coefficients%swigdata +fresult = swigc_FSplittingStepCoefficients_Copy(farg1) +swig_result%swigdata = fresult +end function + +subroutine FSplittingStepCoefficients_Write(coefficients, outfile) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +type(C_PTR) :: outfile +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = coefficients%swigdata +farg2 = outfile +call swigc_FSplittingStepCoefficients_Write(farg1, farg2) +end subroutine + +function FSplittingStepCoefficients_LoadCoefficients(id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(ARKODE_SplittingCoefficientsID), intent(in) :: id +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = id +fresult = swigc_FSplittingStepCoefficients_LoadCoefficients(farg1) +swig_result%swigdata = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FSplittingStepCoefficients_LoadCoefficientsByName(name) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +character(kind=C_CHAR, len=*), target :: name +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(SwigClassWrapper) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(name, farg1_chars, farg1) +fresult = swigc_FSplittingStepCoefficients_LoadCoefficientsByName(farg1) +swig_result%swigdata = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FSplittingStepCoefficients_IDToName(id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_SplittingCoefficientsID), intent(in) :: id +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = id +fresult = swigc_FSplittingStepCoefficients_IDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FSplittingStepCoefficients_LieTrotter(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_LieTrotter(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Strang(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_Strang(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Parallel(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_Parallel(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_SymmetricParallel(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_SymmetricParallel(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_ThirdOrderSuzuki(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_ThirdOrderSuzuki(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_TripleJump(partitions, order) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 + +farg1 = partitions +farg2 = order +fresult = swigc_FSplittingStepCoefficients_TripleJump(farg1, farg2) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_SuzukiFractal(partitions, order) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 + +farg1 = partitions +farg2 = order +fresult = swigc_FSplittingStepCoefficients_SuzukiFractal(farg1, farg2) +swig_result%swigdata = fresult +end function + +function FSplittingStepCreate(steppers, partitions, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR), target, intent(inout) :: steppers +integer(C_INT), intent(in) :: partitions +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = c_loc(steppers) +farg2 = partitions +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSplittingStepReInit(arkode_mem, steppers, partitions, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: steppers +integer(C_INT), intent(in) :: partitions +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = c_loc(steppers) +farg3 = partitions +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FSplittingStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSplittingStepSetCoefficients(arkode_mem, coefficients) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = arkode_mem +farg2 = coefficients%swigdata +fresult = swigc_FSplittingStepSetCoefficients(farg1, farg2) +swig_result = fresult +end function + +function FSplittingStepGetNumEvolves(arkode_mem, partition, evolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition +integer(C_LONG), dimension(*), target, intent(inout) :: evolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition +farg3 = c_loc(evolves(1)) +fresult = swigc_FSplittingStepGetNumEvolves(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int64/farkode_forcingstep_mod.c b/src/arkode/fmod_int64/farkode_forcingstep_mod.c new file mode 100644 index 0000000000..efb8ae114a --- /dev/null +++ b/src/arkode/fmod_int64/farkode_forcingstep_mod.c @@ -0,0 +1,264 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +#include <stdio.h> +#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 "arkode/arkode_forcingstep.h" + +SWIGEXPORT void * _wrap_FForcingStepCreate(void *farg1, void *farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepper)(farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)ForcingStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FForcingStepReInit(void *farg1, void *farg2, void *farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; + SUNStepper arg3 = (SUNStepper) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper)(farg2); + arg3 = (SUNStepper)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)ForcingStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FForcingStepGetNumEvolves(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)ForcingStepGetNumEvolves(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 b/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 new file mode 100644 index 0000000000..05d52265fe --- /dev/null +++ b/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 @@ -0,0 +1,144 @@ +! 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-2024, 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 farkode_forcingstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + public :: FForcingStepCreate + public :: FForcingStepReInit + public :: FForcingStepGetNumEvolves + +! WRAPPER DECLARATIONS +interface +function swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FForcingStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FForcingStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FForcingStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +type(C_PTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +integer(C_INT) :: fresult +end function + +function swigc_FForcingStepGetNumEvolves(farg1, farg2, farg3) & +bind(C, name="_wrap_FForcingStepGetNumEvolves") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +function FForcingStepCreate(stepper1, stepper2, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = stepper1 +farg2 = stepper2 +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FForcingStepReInit(arkode_mem, stepper1, stepper2, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +type(C_PTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = stepper1 +farg3 = stepper2 +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FForcingStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FForcingStepGetNumEvolves(arkode_mem, partition, evolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition +integer(C_LONG), dimension(*), target, intent(inout) :: evolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition +farg3 = c_loc(evolves(1)) +fresult = swigc_FForcingStepGetNumEvolves(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/arkode/fmod_int64/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c index dcc19f5c3c..39e5e0bc14 100644 --- a/src/arkode/fmod_int64/farkode_mod.c +++ b/src/arkode/fmod_int64/farkode_mod.c @@ -619,6 +619,20 @@ SWIGEXPORT int _wrap_FARKodeSetFixedStep(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FARKodeSetStepDirection(void *farg1, double const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (int)ARKodeSetStepDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeSetUserData(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -1321,6 +1335,20 @@ SWIGEXPORT int _wrap_FARKodeGetCurrentStep(void *farg1, double *farg2) { } +SWIGEXPORT int _wrap_FARKodeGetStepDirection(void *farg1, double *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (int)ARKodeGetStepDirection(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKodeGetErrWeights(void *farg1, N_Vector farg2) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index 9f15a8f8d7..0dc1704eac 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -97,6 +97,7 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_DOMEIG_FAIL = -49_C_INT integer(C_INT), parameter, public :: ARK_MAX_STAGE_LIMIT_FAIL = -50_C_INT integer(C_INT), parameter, public :: ARK_SUNSTEPPER_ERR = -51_C_INT + integer(C_INT), parameter, public :: ARK_STEP_DIRECTION_ERR = -52_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT ! typedef enum ARKRelaxSolver enum, bind(c) @@ -135,6 +136,7 @@ module farkode_mod public :: FARKodeSetStopTime public :: FARKodeClearStopTime public :: FARKodeSetFixedStep + public :: FARKodeSetStepDirection public :: FARKodeSetUserData public :: FARKodeSetPostprocessStepFn public :: FARKodeSetPostprocessStageFn @@ -184,6 +186,7 @@ module farkode_mod public :: FARKodeGetNumSteps public :: FARKodeGetLastStep public :: FARKodeGetCurrentStep + public :: FARKodeGetStepDirection public :: FARKodeGetErrWeights public :: FARKodeGetNumGEvals public :: FARKodeGetRootInfo @@ -670,6 +673,15 @@ function swigc_FARKodeSetFixedStep(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeSetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeSetStepDirection") & +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_FARKodeSetUserData(farg1, farg2) & bind(C, name="_wrap_FARKodeSetUserData") & result(fresult) @@ -1119,6 +1131,15 @@ function swigc_FARKodeGetCurrentStep(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FARKodeGetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FARKodeGetStepDirection") & +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_FARKodeGetErrWeights(farg1, farg2) & bind(C, name="_wrap_FARKodeGetErrWeights") & result(fresult) @@ -2792,6 +2813,22 @@ function FARKodeSetFixedStep(arkode_mem, hfixed) & swig_result = fresult end function +function FARKodeSetStepDirection(arkode_mem, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = arkode_mem +farg2 = stepdir +fresult = swigc_FARKodeSetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FARKodeSetUserData(arkode_mem, user_data) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3600,6 +3637,22 @@ function FARKodeGetCurrentStep(arkode_mem, hcur) & swig_result = fresult end function +function FARKodeGetStepDirection(arkode_mem, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +real(C_DOUBLE), dimension(*), target, intent(inout) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = arkode_mem +farg2 = c_loc(stepdir(1)) +fresult = swigc_FARKodeGetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FARKodeGetErrWeights(arkode_mem, eweight) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.c b/src/arkode/fmod_int64/farkode_splittingstep_mod.c new file mode 100644 index 0000000000..3006138373 --- /dev/null +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.c @@ -0,0 +1,764 @@ +/* ---------------------------------------------------------------------------- + * 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-2024, 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 <assert.h> +#define SWIG_exception_impl(DECL, CODE, MSG, RETURNNULL) \ + { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } + + +enum { + SWIG_MEM_OWN = 0x01, + SWIG_MEM_RVALUE = 0x02, + SWIG_MEM_CONST = 0x04 +}; + + +#define SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if ((SWIG_CLASS_WRAPPER).cmemflags & SWIG_MEM_CONST) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass const " TYPENAME " (class " FNAME ") " \ + "as a mutable reference", \ + RETURNNULL); \ + } + + +#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + if (!(SWIG_CLASS_WRAPPER).cptr) { \ + SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ + "Cannot pass null " TYPENAME " (class " FNAME ") " \ + "as a reference", RETURNNULL); \ + } + + +#define SWIG_check_mutable_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ + SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); \ + SWIG_check_mutable(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL); + + +#include <stdio.h> +#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 "arkode/arkode_splittingstep.h" + + +typedef struct { + void* cptr; + int cmemflags; +} SwigClassWrapper; + + +SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { + SwigClassWrapper result; + result.cptr = NULL; + result.cmemflags = 0; + return result; +} + + +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif + + +#include <string.h> + + +SWIGINTERN void SWIG_assign(SwigClassWrapper* self, SwigClassWrapper other) { + if (self->cptr == NULL) { + /* LHS is unassigned */ + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture pointer from RHS, clear 'moving' flag */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_RVALUE); + } else { + /* Become a reference to the other object */ + self->cptr = other.cptr; + self->cmemflags = other.cmemflags & (~SWIG_MEM_OWN); + } + } else if (other.cptr == NULL) { + /* Replace LHS with a null pointer */ + free(self->cptr); + *self = SwigClassWrapper_uninitialized(); + } else { + if (self->cmemflags & SWIG_MEM_OWN) { + free(self->cptr); + } + self->cptr = other.cptr; + if (other.cmemflags & SWIG_MEM_RVALUE) { + /* Capture RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_RVALUE; + } else { + /* Point to RHS */ + self->cmemflags = other.cmemflags & ~SWIG_MEM_OWN; + } + } +} + + +typedef struct { + void* data; + size_t size; +} SwigArrayWrapper; + + +SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { + SwigArrayWrapper result; + result.data = NULL; + result.size = 0; + return result; +} + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper const *farg1, double *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (sunrealtype *)(farg2); + if (arg1) (arg1)->alpha = arg2; +} + + +SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrapper const *farg1) { + double * fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype *result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (sunrealtype *) ((arg1)->alpha); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper const *farg1, void *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype ***arg2 = (sunrealtype ***) 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (sunrealtype ***)(farg2); + if (arg1) (arg1)->beta = arg2; +} + + +SWIGEXPORT void * _wrap_SplittingStepCoefficientsMem_beta_get(SwigClassWrapper const *farg1) { + void * fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + sunrealtype ***result = 0 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (sunrealtype ***) ((arg1)->beta); + fresult = result; + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_sequential_methods_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::sequential_methods", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->sequential_methods = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_sequential_methods_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::sequential_methods", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->sequential_methods); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_stages_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::stages", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->stages = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_stages_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::stages", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->stages); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_partitions_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::partitions", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->partitions = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_partitions_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::partitions", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->partitions); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_order_set(SwigClassWrapper const *farg1, int const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int arg2 ; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::order", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + arg2 = (int)(*farg2); + if (arg1) (arg1)->order = arg2; +} + + +SWIGEXPORT int _wrap_SplittingStepCoefficientsMem_order_get(SwigClassWrapper const *farg1) { + int fresult ; + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + int result; + + SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::order", return 0); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + result = (int) ((arg1)->order); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_new_SplittingStepCoefficientsMem() { + SwigClassWrapper fresult ; + struct SplittingStepCoefficientsMem *result = 0 ; + + result = (struct SplittingStepCoefficientsMem *)calloc(1, sizeof(struct SplittingStepCoefficientsMem)); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (1 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_delete_SplittingStepCoefficientsMem(SwigClassWrapper *farg1) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + + SWIG_check_mutable(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::~SplittingStepCoefficientsMem()", return ); + arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); + free((char *) arg1); +} + + +SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_op_assign__(SwigClassWrapper *farg1, SwigClassWrapper const *farg2) { + struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; + struct SplittingStepCoefficientsMem *arg2 = 0 ; + + (void)sizeof(arg1); + (void)sizeof(arg2); + SWIG_assign(farg1, *farg2); + +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Alloc(int const *farg1, int const *farg2, int const *farg3) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Alloc(arg1,arg2,arg3); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Create(int const *farg1, int const *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype *arg6 = (sunrealtype *) 0 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + arg3 = (int)(*farg3); + arg4 = (int)(*farg4); + arg5 = (sunrealtype *)(farg5); + arg6 = (sunrealtype *)(farg6); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Create(arg1,arg2,arg3,arg4,arg5,arg6); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_FSplittingStepCoefficients_Destroy(void *farg1) { + SplittingStepCoefficients *arg1 = (SplittingStepCoefficients *) 0 ; + + arg1 = (SplittingStepCoefficients *)(farg1); + SplittingStepCoefficients_Destroy(arg1); +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Copy(SwigClassWrapper const *farg1) { + SwigClassWrapper fresult ; + SplittingStepCoefficients arg1 = (SplittingStepCoefficients) 0 ; + SplittingStepCoefficients result; + + SWIG_check_mutable(*farg1, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepCoefficients_Copy(SplittingStepCoefficients)", return SwigClassWrapper_uninitialized()); + arg1 = (SplittingStepCoefficients)(farg1->cptr); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Copy(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void _wrap_FSplittingStepCoefficients_Write(SwigClassWrapper const *farg1, void *farg2) { + SplittingStepCoefficients arg1 = (SplittingStepCoefficients) 0 ; + FILE *arg2 = (FILE *) 0 ; + + SWIG_check_mutable(*farg1, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepCoefficients_Write(SplittingStepCoefficients,FILE *)", return ); + arg1 = (SplittingStepCoefficients)(farg1->cptr); + arg2 = (FILE *)(farg2); + SplittingStepCoefficients_Write(arg1,arg2); +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LoadCoefficients(int const *farg1) { + SwigClassWrapper fresult ; + ARKODE_SplittingCoefficientsID arg1 ; + SplittingStepCoefficients result; + + arg1 = (ARKODE_SplittingCoefficientsID)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LoadCoefficients(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LoadCoefficientsByName(SwigArrayWrapper *farg1) { + SwigClassWrapper fresult ; + char *arg1 = (char *) 0 ; + SplittingStepCoefficients result; + + arg1 = (char *)(farg1->data); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LoadCoefficientsByName((char const *)arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigArrayWrapper _wrap_FSplittingStepCoefficients_IDToName(int const *farg1) { + SwigArrayWrapper fresult ; + ARKODE_SplittingCoefficientsID arg1 ; + char *result = 0 ; + + arg1 = (ARKODE_SplittingCoefficientsID)(*farg1); + result = (char *)SplittingStepCoefficients_IDToName(arg1); + fresult.size = strlen((const char*)(result)); + fresult.data = (char *)(result); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_LieTrotter(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_LieTrotter(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Strang(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Strang(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Parallel(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_Parallel(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SymmetricParallel(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_SymmetricParallel(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_ThirdOrderSuzuki(int const *farg1) { + SwigClassWrapper fresult ; + int arg1 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + result = (SplittingStepCoefficients)SplittingStepCoefficients_ThirdOrderSuzuki(arg1); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_TripleJump(int const *farg1, int const *farg2) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + result = (SplittingStepCoefficients)SplittingStepCoefficients_TripleJump(arg1,arg2); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SuzukiFractal(int const *farg1, int const *farg2) { + SwigClassWrapper fresult ; + int arg1 ; + int arg2 ; + SplittingStepCoefficients result; + + arg1 = (int)(*farg1); + arg2 = (int)(*farg2); + result = (SplittingStepCoefficients)SplittingStepCoefficients_SuzukiFractal(arg1,arg2); + fresult.cptr = result; + fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); + return fresult; +} + + +SWIGEXPORT void * _wrap_FSplittingStepCreate(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { + void * fresult ; + SUNStepper *arg1 = (SUNStepper *) 0 ; + int arg2 ; + sunrealtype arg3 ; + N_Vector arg4 = (N_Vector) 0 ; + SUNContext arg5 = (SUNContext) 0 ; + void *result = 0 ; + + arg1 = (SUNStepper *)(farg1); + arg2 = (int)(*farg2); + arg3 = (sunrealtype)(*farg3); + arg4 = (N_Vector)(farg4); + arg5 = (SUNContext)(farg5); + result = (void *)SplittingStepCreate(arg1,arg2,arg3,arg4,arg5); + fresult = result; + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepReInit(void *farg1, void *farg2, int const *farg3, double const *farg4, N_Vector farg5) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNStepper *arg2 = (SUNStepper *) 0 ; + int arg3 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNStepper *)(farg2); + arg3 = (int)(*farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + result = (int)SplittingStepReInit(arg1,arg2,arg3,arg4,arg5); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepSetCoefficients(void *farg1, SwigClassWrapper const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + SplittingStepCoefficients arg2 = (SplittingStepCoefficients) 0 ; + int result; + + arg1 = (void *)(farg1); + SWIG_check_mutable(*farg2, "SplittingStepCoefficients", "SplittingStepCoefficientsMem", "SplittingStepSetCoefficients(void *,SplittingStepCoefficients)", return 0); + arg2 = (SplittingStepCoefficients)(farg2->cptr); + result = (int)SplittingStepSetCoefficients(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSplittingStepGetNumEvolves(void *farg1, int const *farg2, long *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + long *arg3 = (long *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (long *)(farg3); + result = (int)SplittingStepGetNumEvolves(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + + diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 new file mode 100644 index 0000000000..9e988fe7d0 --- /dev/null +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 @@ -0,0 +1,947 @@ +! 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-2024, 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 farkode_splittingstep_mod + use, intrinsic :: ISO_C_BINDING + use farkode_mod + use fsundials_core_mod + implicit none + private + + ! DECLARATION CONSTRUCTS + + integer, parameter :: swig_cmem_own_bit = 0 + integer, parameter :: swig_cmem_rvalue_bit = 1 + integer, parameter :: swig_cmem_const_bit = 2 + type, bind(C) :: SwigClassWrapper + type(C_PTR), public :: cptr = C_NULL_PTR + integer(C_INT), public :: cmemflags = 0 + end type + ! struct struct SplittingStepCoefficientsMem + type, public :: SplittingStepCoefficientsMem + type(SwigClassWrapper), public :: swigdata + contains + procedure :: set_alpha => swigf_SplittingStepCoefficientsMem_alpha_set + procedure :: get_alpha => swigf_SplittingStepCoefficientsMem_alpha_get + procedure :: set_beta => swigf_SplittingStepCoefficientsMem_beta_set + procedure :: get_beta => swigf_SplittingStepCoefficientsMem_beta_get + procedure :: set_sequential_methods => swigf_SplittingStepCoefficientsMem_sequential_methods_set + procedure :: get_sequential_methods => swigf_SplittingStepCoefficientsMem_sequential_methods_get + procedure :: set_stages => swigf_SplittingStepCoefficientsMem_stages_set + procedure :: get_stages => swigf_SplittingStepCoefficientsMem_stages_get + procedure :: set_partitions => swigf_SplittingStepCoefficientsMem_partitions_set + procedure :: get_partitions => swigf_SplittingStepCoefficientsMem_partitions_get + procedure :: set_order => swigf_SplittingStepCoefficientsMem_order_set + procedure :: get_order => swigf_SplittingStepCoefficientsMem_order_get + procedure :: release => swigf_release_SplittingStepCoefficientsMem + procedure, private :: swigf_SplittingStepCoefficientsMem_op_assign__ + generic :: assignment(=) => swigf_SplittingStepCoefficientsMem_op_assign__ + end type SplittingStepCoefficientsMem + interface SplittingStepCoefficientsMem + module procedure swigf_create_SplittingStepCoefficientsMem + end interface + ! typedef enum ARKODE_SplittingCoefficientsID + enum, bind(c) + enumerator :: ARKODE_SPLITTING_NONE = -1 + enumerator :: ARKODE_MIN_SPLITTING_NUM = 0 + enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM + enumerator :: ARKODE_SPLITTING_STRANG_2_2_2 + enumerator :: ARKODE_SPLITTING_BEST_2_2_2 + enumerator :: ARKODE_SPLITTING_SUZUKI_3_3_2 + enumerator :: ARKODE_SPLITTING_RUTH_3_3_2 + enumerator :: ARKODE_SPLITTING_YOSHIDA_4_4_2 + enumerator :: ARKODE_SPLITTING_YOSHIDA_8_6_2 + enumerator :: ARKODE_MAX_SPLITTING_NUM = ARKODE_SPLITTING_YOSHIDA_8_6_2 + end enum + integer, parameter, public :: ARKODE_SplittingCoefficientsID = kind(ARKODE_SPLITTING_NONE) + public :: ARKODE_SPLITTING_NONE, ARKODE_MIN_SPLITTING_NUM, ARKODE_SPLITTING_LIE_TROTTER_1_1_2, ARKODE_SPLITTING_STRANG_2_2_2, & + ARKODE_SPLITTING_BEST_2_2_2, ARKODE_SPLITTING_SUZUKI_3_3_2, ARKODE_SPLITTING_RUTH_3_3_2, ARKODE_SPLITTING_YOSHIDA_4_4_2, & + ARKODE_SPLITTING_YOSHIDA_8_6_2, ARKODE_MAX_SPLITTING_NUM + public :: FSplittingStepCoefficients_Alloc + public :: FSplittingStepCoefficients_Create + public :: FSplittingStepCoefficients_Destroy + public :: FSplittingStepCoefficients_Copy + public :: FSplittingStepCoefficients_Write + public :: FSplittingStepCoefficients_LoadCoefficients + type, bind(C) :: SwigArrayWrapper + type(C_PTR), public :: data = C_NULL_PTR + integer(C_SIZE_T), public :: size = 0 + end type + public :: FSplittingStepCoefficients_LoadCoefficientsByName + public :: FSplittingStepCoefficients_IDToName + public :: FSplittingStepCoefficients_LieTrotter + public :: FSplittingStepCoefficients_Strang + public :: FSplittingStepCoefficients_Parallel + public :: FSplittingStepCoefficients_SymmetricParallel + public :: FSplittingStepCoefficients_ThirdOrderSuzuki + public :: FSplittingStepCoefficients_TripleJump + public :: FSplittingStepCoefficients_SuzukiFractal + public :: FSplittingStepCreate + public :: FSplittingStepReInit + public :: FSplittingStepSetCoefficients + public :: FSplittingStepGetNumEvolves + +! WRAPPER DECLARATIONS +interface +subroutine swigc_SplittingStepCoefficientsMem_alpha_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_alpha_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_alpha_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_alpha_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_beta_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_beta_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_beta_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_beta_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_sequential_methods_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_sequential_methods_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_sequential_methods_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_sequential_methods_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_stages_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_stages_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_stages_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_stages_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_partitions_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_partitions_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_partitions_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_partitions_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +subroutine swigc_SplittingStepCoefficientsMem_order_set(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_order_set") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT), intent(in) :: farg2 +end subroutine + +function swigc_SplittingStepCoefficientsMem_order_get(farg1) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_order_get") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: fresult +end function + +function swigc_new_SplittingStepCoefficientsMem() & +bind(C, name="_wrap_new_SplittingStepCoefficientsMem") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_delete_SplittingStepCoefficientsMem(farg1) & +bind(C, name="_wrap_delete_SplittingStepCoefficientsMem") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +end subroutine + +subroutine swigc_SplittingStepCoefficientsMem_op_assign__(farg1, farg2) & +bind(C, name="_wrap_SplittingStepCoefficientsMem_op_assign__") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper), intent(inout) :: farg1 +type(SwigClassWrapper) :: farg2 +end subroutine + +function swigc_FSplittingStepCoefficients_Alloc(farg1, farg2, farg3) & +bind(C, name="_wrap_FSplittingStepCoefficients_Alloc") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Create(farg1, farg2, farg3, farg4, farg5, farg6) & +bind(C, name="_wrap_FSplittingStepCoefficients_Create") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT), intent(in) :: farg3 +integer(C_INT), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_FSplittingStepCoefficients_Destroy(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Destroy") +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +end subroutine + +function swigc_FSplittingStepCoefficients_Copy(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Copy") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +subroutine swigc_FSplittingStepCoefficients_Write(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_Write") +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg2 +end subroutine + +function swigc_FSplittingStepCoefficients_LoadCoefficients(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LoadCoefficients") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_LoadCoefficientsByName(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LoadCoefficientsByName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(SwigClassWrapper) :: fresult +end function + + subroutine SWIG_free(cptr) & + bind(C, name="free") + use, intrinsic :: ISO_C_BINDING + type(C_PTR), value :: cptr +end subroutine +function swigc_FSplittingStepCoefficients_IDToName(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_IDToName") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +integer(C_INT), intent(in) :: farg1 +type(SwigArrayWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_LieTrotter(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_LieTrotter") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Strang(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Strang") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_Parallel(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_Parallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_SymmetricParallel(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_SymmetricParallel") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_ThirdOrderSuzuki(farg1) & +bind(C, name="_wrap_FSplittingStepCoefficients_ThirdOrderSuzuki") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_TripleJump(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_TripleJump") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCoefficients_SuzukiFractal(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepCoefficients_SuzukiFractal") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +integer(C_INT), intent(in) :: farg1 +integer(C_INT), intent(in) :: farg2 +type(SwigClassWrapper) :: fresult +end function + +function swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSplittingStepCreate") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +real(C_DOUBLE), intent(in) :: farg3 +type(C_PTR), value :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR) :: fresult +end function + +function swigc_FSplittingStepReInit(farg1, farg2, farg3, farg4, farg5) & +bind(C, name="_wrap_FSplittingStepReInit") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: 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_FSplittingStepSetCoefficients(farg1, farg2) & +bind(C, name="_wrap_FSplittingStepSetCoefficients") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigclasswrapper +type(C_PTR), value :: farg1 +type(SwigClassWrapper) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSplittingStepGetNumEvolves(farg1, farg2, farg3) & +bind(C, name="_wrap_FSplittingStepGetNumEvolves") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + +end interface + + +contains + ! MODULE SUBPROGRAMS +subroutine swigf_SplittingStepCoefficientsMem_alpha_set(self, alpha) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +real(C_DOUBLE), dimension(*), target, intent(inout) :: alpha +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(alpha(1)) +call swigc_SplittingStepCoefficientsMem_alpha_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_alpha_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +real(C_DOUBLE), dimension(:), pointer :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_alpha_get(farg1) +call c_f_pointer(fresult, swig_result, [1]) +end function + +subroutine swigf_SplittingStepCoefficientsMem_beta_set(self, beta) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR), target, intent(inout) :: beta +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = self%swigdata +farg2 = c_loc(beta) +call swigc_SplittingStepCoefficientsMem_beta_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_beta_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), pointer :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +type(C_PTR) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_beta_get(farg1) +call c_f_pointer(fresult, swig_result) +end function + +subroutine swigf_SplittingStepCoefficientsMem_sequential_methods_set(self, sequential_methods) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: sequential_methods +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = sequential_methods +call swigc_SplittingStepCoefficientsMem_sequential_methods_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_sequential_methods_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_sequential_methods_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_stages_set(self, stages) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: stages +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = stages +call swigc_SplittingStepCoefficientsMem_stages_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_stages_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_stages_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_partitions_set(self, partitions) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = partitions +call swigc_SplittingStepCoefficientsMem_partitions_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_partitions_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_partitions_get(farg1) +swig_result = fresult +end function + +subroutine swigf_SplittingStepCoefficientsMem_order_set(self, order) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: farg1 +integer(C_INT) :: farg2 + +farg1 = self%swigdata +farg2 = order +call swigc_SplittingStepCoefficientsMem_order_set(farg1, farg2) +end subroutine + +function swigf_SplittingStepCoefficientsMem_order_get(self) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: self +integer(C_INT) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +fresult = swigc_SplittingStepCoefficientsMem_order_get(farg1) +swig_result = fresult +end function + +function swigf_create_SplittingStepCoefficientsMem() & +result(self) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: self +type(SwigClassWrapper) :: fresult + +fresult = swigc_new_SplittingStepCoefficientsMem() +self%swigdata = fresult +end function + +subroutine swigf_release_SplittingStepCoefficientsMem(self) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(inout) :: self +type(SwigClassWrapper) :: farg1 + +farg1 = self%swigdata +if (btest(farg1%cmemflags, swig_cmem_own_bit)) then +call swigc_delete_SplittingStepCoefficientsMem(farg1) +endif +farg1%cptr = C_NULL_PTR +farg1%cmemflags = 0 +self%swigdata = farg1 +end subroutine + +subroutine swigf_SplittingStepCoefficientsMem_op_assign__(self, other) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(inout) :: self +type(SplittingStepCoefficientsMem), intent(in) :: other +type(SwigClassWrapper) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = self%swigdata +farg2 = other%swigdata +call swigc_SplittingStepCoefficientsMem_op_assign__(farg1, farg2) +self%swigdata = farg1 +end subroutine + +function FSplittingStepCoefficients_Alloc(sequential_methods, stages, partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: sequential_methods +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 + +farg1 = sequential_methods +farg2 = stages +farg3 = partitions +fresult = swigc_FSplittingStepCoefficients_Alloc(farg1, farg2, farg3) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Create(sequential_methods, stages, partitions, order, alpha, beta) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: sequential_methods +integer(C_INT), intent(in) :: stages +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +real(C_DOUBLE), dimension(*), target, intent(inout) :: alpha +real(C_DOUBLE), dimension(*), target, intent(inout) :: beta +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 +integer(C_INT) :: farg3 +integer(C_INT) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 + +farg1 = sequential_methods +farg2 = stages +farg3 = partitions +farg4 = order +farg5 = c_loc(alpha(1)) +farg6 = c_loc(beta(1)) +fresult = swigc_FSplittingStepCoefficients_Create(farg1, farg2, farg3, farg4, farg5, farg6) +swig_result%swigdata = fresult +end function + +subroutine FSplittingStepCoefficients_Destroy(coefficients) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), target, intent(inout) :: coefficients +type(C_PTR) :: farg1 + +farg1 = c_loc(coefficients) +call swigc_FSplittingStepCoefficients_Destroy(farg1) +end subroutine + +function FSplittingStepCoefficients_Copy(coefficients) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +type(SwigClassWrapper) :: fresult +type(SwigClassWrapper) :: farg1 + +farg1 = coefficients%swigdata +fresult = swigc_FSplittingStepCoefficients_Copy(farg1) +swig_result%swigdata = fresult +end function + +subroutine FSplittingStepCoefficients_Write(coefficients, outfile) +use, intrinsic :: ISO_C_BINDING +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +type(C_PTR) :: outfile +type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg2 + +farg1 = coefficients%swigdata +farg2 = outfile +call swigc_FSplittingStepCoefficients_Write(farg1, farg2) +end subroutine + +function FSplittingStepCoefficients_LoadCoefficients(id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(ARKODE_SplittingCoefficientsID), intent(in) :: id +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = id +fresult = swigc_FSplittingStepCoefficients_LoadCoefficients(farg1) +swig_result%swigdata = fresult +end function + + +subroutine SWIG_string_to_chararray(string, chars, wrap) + use, intrinsic :: ISO_C_BINDING + character(kind=C_CHAR, len=*), intent(IN) :: string + character(kind=C_CHAR), dimension(:), target, allocatable, intent(OUT) :: chars + type(SwigArrayWrapper), intent(OUT) :: wrap + integer :: i + + allocate(character(kind=C_CHAR) :: chars(len(string) + 1)) + do i=1,len(string) + chars(i) = string(i:i) + end do + i = len(string) + 1 + chars(i) = C_NULL_CHAR ! C string compatibility + wrap%data = c_loc(chars) + wrap%size = len(string) +end subroutine + +function FSplittingStepCoefficients_LoadCoefficientsByName(name) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +character(kind=C_CHAR, len=*), target :: name +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +type(SwigClassWrapper) :: fresult +type(SwigArrayWrapper) :: farg1 + +call SWIG_string_to_chararray(name, farg1_chars, farg1) +fresult = swigc_FSplittingStepCoefficients_LoadCoefficientsByName(farg1) +swig_result%swigdata = fresult +end function + + +subroutine SWIG_chararray_to_string(wrap, string) + use, intrinsic :: ISO_C_BINDING + type(SwigArrayWrapper), intent(IN) :: wrap + character(kind=C_CHAR, len=:), allocatable, intent(OUT) :: string + character(kind=C_CHAR), dimension(:), pointer :: chars + integer(kind=C_SIZE_T) :: i + call c_f_pointer(wrap%data, chars, [wrap%size]) + allocate(character(kind=C_CHAR, len=wrap%size) :: string) + do i=1, wrap%size + string(i:i) = chars(i) + end do +end subroutine + +function FSplittingStepCoefficients_IDToName(id) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +character(kind=C_CHAR, len=:), allocatable :: swig_result +integer(ARKODE_SplittingCoefficientsID), intent(in) :: id +type(SwigArrayWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = id +fresult = swigc_FSplittingStepCoefficients_IDToName(farg1) +call SWIG_chararray_to_string(fresult, swig_result) +if (.false.) call SWIG_free(fresult%data) +end function + +function FSplittingStepCoefficients_LieTrotter(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_LieTrotter(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Strang(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_Strang(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_Parallel(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_Parallel(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_SymmetricParallel(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_SymmetricParallel(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_ThirdOrderSuzuki(partitions) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 + +farg1 = partitions +fresult = swigc_FSplittingStepCoefficients_ThirdOrderSuzuki(farg1) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_TripleJump(partitions, order) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 + +farg1 = partitions +farg2 = order +fresult = swigc_FSplittingStepCoefficients_TripleJump(farg1, farg2) +swig_result%swigdata = fresult +end function + +function FSplittingStepCoefficients_SuzukiFractal(partitions, order) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(SplittingStepCoefficientsMem) :: swig_result +integer(C_INT), intent(in) :: partitions +integer(C_INT), intent(in) :: order +type(SwigClassWrapper) :: fresult +integer(C_INT) :: farg1 +integer(C_INT) :: farg2 + +farg1 = partitions +farg2 = order +fresult = swigc_FSplittingStepCoefficients_SuzukiFractal(farg1, farg2) +swig_result%swigdata = fresult +end function + +function FSplittingStepCreate(steppers, partitions, t0, y0, sunctx) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +type(C_PTR) :: swig_result +type(C_PTR), target, intent(inout) :: steppers +integer(C_INT), intent(in) :: partitions +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +type(C_PTR) :: sunctx +type(C_PTR) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +real(C_DOUBLE) :: farg3 +type(C_PTR) :: farg4 +type(C_PTR) :: farg5 + +farg1 = c_loc(steppers) +farg2 = partitions +farg3 = t0 +farg4 = c_loc(y0) +farg5 = sunctx +fresult = swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSplittingStepReInit(arkode_mem, steppers, partitions, t0, y0) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_PTR), target, intent(inout) :: steppers +integer(C_INT), intent(in) :: partitions +real(C_DOUBLE), intent(in) :: t0 +type(N_Vector), target, intent(inout) :: y0 +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 +integer(C_INT) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 + +farg1 = arkode_mem +farg2 = c_loc(steppers) +farg3 = partitions +farg4 = t0 +farg5 = c_loc(y0) +fresult = swigc_FSplittingStepReInit(farg1, farg2, farg3, farg4, farg5) +swig_result = fresult +end function + +function FSplittingStepSetCoefficients(arkode_mem, coefficients) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +class(SplittingStepCoefficientsMem), intent(in) :: coefficients +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(SwigClassWrapper) :: farg2 + +farg1 = arkode_mem +farg2 = coefficients%swigdata +fresult = swigc_FSplittingStepSetCoefficients(farg1, farg2) +swig_result = fresult +end function + +function FSplittingStepGetNumEvolves(arkode_mem, partition, evolves) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: partition +integer(C_LONG), dimension(*), target, intent(inout) :: evolves +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = arkode_mem +farg2 = partition +farg3 = c_loc(evolves(1)) +fresult = swigc_FSplittingStepGetNumEvolves(farg1, farg2, farg3) +swig_result = fresult +end function + + +end module diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index 43855b4e60..65ed483e8d 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -2802,6 +2802,20 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirection(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; @@ -2948,6 +2962,20 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTim } +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirectionFn(void *farg1, SUNStepperSetStepDirectionFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetStepDirectionFn arg2 = (SUNStepperSetStepDirectionFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStepDirectionFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index bc425ba37b..bc9928d476 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -563,6 +563,7 @@ module fsundials_core_mod public :: FSUNStepper_FullRhs public :: FSUNStepper_Reset public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetStepDirection public :: FSUNStepper_SetForcing public :: FSUNStepper_SetContent public :: FSUNStepper_GetContent @@ -573,6 +574,7 @@ module fsundials_core_mod public :: FSUNStepper_SetFullRhsFn public :: FSUNStepper_SetResetFn public :: FSUNStepper_SetStopTimeFn + public :: FSUNStepper_SetStepDirectionFn public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetDestroyFn @@ -2170,6 +2172,15 @@ function swigc_FSUNStepper_SetStopTime(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirection") & +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_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSUNStepper_SetForcing") & result(fresult) @@ -2263,6 +2274,15 @@ function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirectionFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & bind(C, name="_wrap_FSUNStepper_SetForcingFn") & result(fresult) @@ -5214,6 +5234,22 @@ function FSUNStepper_SetStopTime(stepper, tstop) & swig_result = fresult end function +function FSUNStepper_SetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = stepdir +fresult = swigc_FSUNStepper_SetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -5383,6 +5419,22 @@ function FSUNStepper_SetStopTimeFn(stepper, fn) & swig_result = fresult end function +function FSUNStepper_SetStepDirectionFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcingFn(stepper, fn) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index 7062f9a507..9f10b04ab6 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -2802,6 +2802,20 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirection(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; @@ -2948,6 +2962,20 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTim } +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirectionFn(void *farg1, SUNStepperSetStepDirectionFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetStepDirectionFn arg2 = (SUNStepperSetStepDirectionFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStepDirectionFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index e16ea3b306..cae4c451ab 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -563,6 +563,7 @@ module fsundials_core_mod public :: FSUNStepper_FullRhs public :: FSUNStepper_Reset public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetStepDirection public :: FSUNStepper_SetForcing public :: FSUNStepper_SetContent public :: FSUNStepper_GetContent @@ -573,6 +574,7 @@ module fsundials_core_mod public :: FSUNStepper_SetFullRhsFn public :: FSUNStepper_SetResetFn public :: FSUNStepper_SetStopTimeFn + public :: FSUNStepper_SetStepDirectionFn public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetDestroyFn @@ -2170,6 +2172,15 @@ function swigc_FSUNStepper_SetStopTime(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirection") & +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_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSUNStepper_SetForcing") & result(fresult) @@ -2263,6 +2274,15 @@ function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirectionFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & bind(C, name="_wrap_FSUNStepper_SetForcingFn") & result(fresult) @@ -5214,6 +5234,22 @@ function FSUNStepper_SetStopTime(stepper, tstop) & swig_result = fresult end function +function FSUNStepper_SetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = stepdir +fresult = swigc_FSUNStepper_SetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -5383,6 +5419,22 @@ function FSUNStepper_SetStopTimeFn(stepper, fn) & swig_result = fresult end function +function FSUNStepper_SetStepDirectionFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcingFn(stepper, fn) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/sundials_math.c b/src/sundials/sundials_math.c index b60e9c2540..9b2f5a17f3 100644 --- a/src/sundials/sundials_math.c +++ b/src/sundials/sundials_math.c @@ -22,6 +22,15 @@ #include <sundials/sundials_math.h> #include <sundials/sundials_types.h> +int SUNIpowerI(int base, int exponent) +{ + int i; + int prod = 1; + + for (i = 1; i <= exponent; i++) { prod *= base; } + return (prod); +} + sunrealtype SUNRpowerI(sunrealtype base, int exponent) { int i, expt; diff --git a/src/sundials/sundials_stepper.c b/src/sundials/sundials_stepper.c index def6592823..f099835fc3 100644 --- a/src/sundials/sundials_stepper.c +++ b/src/sundials/sundials_stepper.c @@ -35,13 +35,14 @@ SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper_ptr) stepper->ops = malloc(sizeof(*(stepper->ops))); SUNAssert(stepper->ops, SUN_ERR_MALLOC_FAIL); - stepper->ops->evolve = NULL; - stepper->ops->onestep = NULL; - stepper->ops->fullrhs = NULL; - stepper->ops->reset = NULL; - stepper->ops->setstoptime = NULL; - stepper->ops->setforcing = NULL; - stepper->ops->destroy = NULL; + stepper->ops->evolve = NULL; + stepper->ops->onestep = NULL; + stepper->ops->fullrhs = NULL; + stepper->ops->reset = NULL; + stepper->ops->setstoptime = NULL; + stepper->ops->setstepdirection = NULL; + stepper->ops->setforcing = NULL; + stepper->ops->destroy = NULL; *stepper_ptr = stepper; @@ -112,6 +113,16 @@ SUNErrCode SUNStepper_SetStopTime(SUNStepper stepper, sunrealtype tstop) return SUN_ERR_NOT_IMPLEMENTED; } +SUNErrCode SUNStepper_SetStepDirection(SUNStepper stepper, sunrealtype stepdir) +{ + SUNFunctionBegin(stepper->sunctx); + if (stepper->ops->setstepdirection) + { + return stepper->ops->setstepdirection(stepper, stepdir); + } + return SUN_ERR_NOT_IMPLEMENTED; +} + SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, N_Vector* forcing, int nforcing) @@ -187,6 +198,14 @@ SUNErrCode SUNStepper_SetStopTimeFn(SUNStepper stepper, SUNStepperSetStopTimeFn return SUN_SUCCESS; } +SUNErrCode SUNStepper_SetStepDirectionFn(SUNStepper stepper, + SUNStepperSetStepDirectionFn fn) +{ + SUNFunctionBegin(stepper->sunctx); + stepper->ops->setstepdirection = fn; + return SUN_SUCCESS; +} + SUNErrCode SUNStepper_SetForcingFn(SUNStepper stepper, SUNStepperSetForcingFn fn) { SUNFunctionBegin(stepper->sunctx); diff --git a/src/sundials/sundials_stepper_impl.h b/src/sundials/sundials_stepper_impl.h index ab3b763c51..f1c70112ea 100644 --- a/src/sundials/sundials_stepper_impl.h +++ b/src/sundials/sundials_stepper_impl.h @@ -29,6 +29,7 @@ struct SUNStepper_Ops_ SUNStepperFullRhsFn fullrhs; SUNStepperResetFn reset; SUNStepperSetStopTimeFn setstoptime; + SUNStepperSetStepDirectionFn setstepdirection; SUNStepperSetForcingFn setforcing; SUNStepperDestroyFn destroy; }; diff --git a/swig/Makefile b/swig/Makefile index 424d4857a4..3affd0014d 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -16,7 +16,7 @@ SWIG ?= swig -ARKODE=farkode_mod farkode_arkstep_mod farkode_erkstep_mod farkode_sprkstep_mod farkode_mristep_mod farkode_lsrkstep_mod +ARKODE=farkode_mod farkode_arkstep_mod farkode_erkstep_mod farkode_sprkstep_mod farkode_mristep_mod farkode_lsrkstep_mod farkode_splittingstep_mod farkode_forcingstep_mod CVODE=fcvode_mod CVODES=fcvodes_mod IDA=fida_mod diff --git a/swig/arkode/farkode_forcingstep_mod.i b/swig/arkode/farkode_forcingstep_mod.i new file mode 100644 index 0000000000..94ff80cccb --- /dev/null +++ b/swig/arkode/farkode_forcingstep_mod.i @@ -0,0 +1,30 @@ +// --------------------------------------------------------------- +// Programmer: Steven B. Roberts @ LLNL +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2024, 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 farkode_forcingstep_mod + +%include "../sundials/fsundials.i" + +// include the header file(s) in the c wrapper that is generated +%{ +#include "arkode/arkode_forcingstep.h" +%} + +// Load the typedefs and generate a "use" statements in the module +%import "farkode_mod.i" + +// Process definitions from these files +%include "arkode/arkode_forcingstep.h" diff --git a/swig/arkode/farkode_splittingstep_mod.i b/swig/arkode/farkode_splittingstep_mod.i new file mode 100644 index 0000000000..38a9b71b25 --- /dev/null +++ b/swig/arkode/farkode_splittingstep_mod.i @@ -0,0 +1,30 @@ +// --------------------------------------------------------------- +// Programmer: Steven B. Roberts @ LLNL +// --------------------------------------------------------------- +// SUNDIALS Copyright Start +// Copyright (c) 2002-2024, 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 farkode_splittingstep_mod + +%include "../sundials/fsundials.i" + +// include the header file(s) in the c wrapper that is generated +%{ +#include "arkode/arkode_splittingstep.h" +%} + +// Load the typedefs and generate a "use" statements in the module +%import "farkode_mod.i" + +// Process definitions from these files +%include "arkode/arkode_splittingstep.h" diff --git a/test/answers b/test/answers index 294c370633..6c8ba5d077 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 294c3706336ef84e9719b419a4e29d9a551e7294 +Subproject commit 6c8ba5d07756970fa1695c7d71bdd329147f0f26 diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index c62580c508..f87368e0f0 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -53,7 +53,8 @@ set(unit_tests "ark_test_brusselator_mriadapt.cpp\;--rtol 0.000004 --scontrol 0\;exclude-single" "ark_test_slowerror_brusselator.cpp\;\;exclude-single" "ark_test_slowerror_kpr.cpp\;\;exclude-single" - "ark_test_slowerror_polynomial.cpp\;\;exclude-single") + "ark_test_slowerror_polynomial.cpp\;\;exclude-single" + "ark_test_splittingstep.cpp\;\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.cpp new file mode 100644 index 0000000000..fdfc12ff93 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.cpp @@ -0,0 +1,529 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 tests on several ODEs with analytical solutions to verify the + * SplittingStep module. + * ---------------------------------------------------------------------------*/ + +#include <arkode/arkode_arkstep.h> +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_splittingstep.h> +#include <nvector/nvector_serial.h> +#include <sundials/sundials_context.hpp> +#include <sundials/sundials_stepper.h> +#include <sunnonlinsol/sunnonlinsol_fixedpoint.h> + +#include <cmath> +#include <iostream> +#include <vector> + +/* Integrates the ODE + * + * y' = \sum_{i=0}^{P-1} 2^i / (1 - 2^P) * y, y(0) = 1 + * + * with a 3rd order operator splitting method. Each partition is solved by an + * ERK method. Using the exact solution y(t) = exp(-t), we confirm the numerical + * solution is sufficiently accurate. + */ +static int test_forward(sundials::Context& ctx, int order, int partitions) +{ + constexpr auto t0 = SUN_RCONST(0.0); + constexpr auto tf = SUN_RCONST(1.0); + constexpr auto dt = SUN_RCONST(8.0e-3); + constexpr auto local_tol = SUN_RCONST(1.0e-6); + constexpr auto global_tol = SUN_RCONST(10.0) * local_tol; + auto y = N_VNew_Serial(1, ctx); + N_VConst(SUN_RCONST(1.0), y); + + ARKRhsFn f = [](sunrealtype, N_Vector z, N_Vector zdot, void* user_data) + { + auto lambda = *static_cast<sunrealtype*>(user_data); + N_VScale(lambda, z, zdot); + return 0; + }; + + std::vector<void*> partition_mem(partitions); + std::vector<sunrealtype> lambda(partitions); + std::vector<SUNStepper> steppers(partitions); + for (int i = 0; i < partitions; i++) + { + partition_mem[i] = ERKStepCreate(f, t0, y, ctx); + /* The lambdas sum up to 1 */ + lambda[i] = std::pow(SUN_RCONST(2.0), i) / + (1 - std::pow(SUN_RCONST(2.0), partitions)); + ARKodeSetUserData(partition_mem[i], &lambda[i]); + ARKodeSStolerances(partition_mem[i], local_tol, local_tol); + ARKodeCreateSUNStepper(partition_mem[i], &steppers[i]); + } + + auto arkode_mem = SplittingStepCreate(steppers.data(), partitions, t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetOrder(arkode_mem, order); + auto tret = t0; + ARKodeEvolve(arkode_mem, tf, y, &tret, ARK_NORMAL); + + /* Check that the solution matches the exact solution */ + auto exact_solution = std::exp(t0 - tf); + auto numerical_solution = N_VGetArrayPointer(y)[0]; + auto err = numerical_solution - exact_solution; + + std::cout << "Forward solution of order " << order << " with " << partitions + << " partitions completed with an error of " << err << "\n"; + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = SUNRCompareTol(exact_solution, numerical_solution, + global_tol); + if (fail) + { + std::cerr << "Error exceeded tolerance of " << global_tol << "\n"; + } + std::cout << "\n"; + + N_VDestroy(y); + for (int i = 0; i < partitions; i++) + { + ARKodeFree(&partition_mem[i]); + SUNStepper_Destroy(&steppers[i]); + } + ARKodeFree(&arkode_mem); + + return fail; +} + +/* Integrates the ODE + * + * y_1' = y_2 - t + * y_2' = t - y_1 + * + * with initial condition y(0) = [1, 1]^T backward in time to t = -1, then + * forward to t = 0.4, and backward to t = 0. We apply a splitting method using + * a component partitioning and check that the numerical solution is close to + * the original initial condition. + */ +static int test_mixed_directions(const sundials::Context& ctx, const char* name) +{ + constexpr auto t0 = SUN_RCONST(0.0); + constexpr auto t1 = SUN_RCONST(-1.0); + constexpr auto t2 = SUN_RCONST(0.4); + constexpr auto t3 = t0; + constexpr auto dt = -SUN_RCONST(1.23e-3); + constexpr auto local_tol = SUN_RCONST(1.0e-6); + constexpr auto global_tol = SUN_RCONST(20.0) * local_tol; + auto y = N_VNew_Serial(2, ctx); + N_VConst(SUN_RCONST(1.0), y); + auto err = N_VClone(y); + N_VConst(SUN_RCONST(1.0), err); + + ARKRhsFn f1 = [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VGetArrayPointer(zdot)[0] = N_VGetArrayPointer(z)[1] - t; + N_VGetArrayPointer(zdot)[1] = SUN_RCONST(0.0); + return 0; + }; + + ARKRhsFn f2 = [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VGetArrayPointer(zdot)[0] = SUN_RCONST(0.0); + N_VGetArrayPointer(zdot)[1] = t - N_VGetArrayPointer(z)[0]; + return 0; + }; + + void* parititon_mem[] = {ARKStepCreate(nullptr, f1, t0, y, ctx), + ERKStepCreate(f2, t0, y, ctx)}; + ARKodeSStolerances(parititon_mem[0], local_tol, local_tol); + ARKodeSStolerances(parititon_mem[1], local_tol, local_tol); + + SUNStepper steppers[] = {nullptr, nullptr}; + ARKodeCreateSUNStepper(parititon_mem[0], &steppers[0]); + ARKodeCreateSUNStepper(parititon_mem[1], &steppers[1]); + + SUNNonlinearSolver nls = SUNNonlinSol_FixedPoint(y, 1, ctx); + ARKodeSetNonlinearSolver(parititon_mem[0], nls); + + auto arkode_mem = SplittingStepCreate(steppers, 2, t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + ARKodeSetMaxNumSteps(arkode_mem, -1); + auto coefficients = SplittingStepCoefficients_LoadCoefficientsByName(name); + SplittingStepSetCoefficients(arkode_mem, coefficients); + SplittingStepCoefficients_Destroy(&coefficients); + + /* Integrate from 0 to -1 */ + auto tret = t0; + ARKodeEvolve(arkode_mem, t1, y, &tret, ARK_NORMAL); + + /* Integrate from -1 to 0.4 */ + ARKodeReset(arkode_mem, t1, y); + ARKodeSetStepDirection(arkode_mem, t2 - t1); + ARKodeEvolve(arkode_mem, t2, y, &tret, ARK_NORMAL); + + /* Integrate from 0.4 to 0 */ + ARKodeReset(arkode_mem, t2, y); + ARKodeSetStepDirection(arkode_mem, t3 - t2); + ARKodeEvolve(arkode_mem, t3, y, &tret, ARK_NORMAL); + + N_VLinearSum(SUN_RCONST(1.0), err, -SUN_RCONST(1.0), y, err); + auto max_err = N_VMaxNorm(err); + + std::cout << "Mixed direction solution using " << name + << " completed with an error of " << max_err << "\n"; + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = max_err > global_tol; + if (fail) + { + std::cerr << "Error exceeded tolerance of " << global_tol << "\n"; + } + std::cout << "\n"; + + N_VDestroy(y); + N_VDestroy(err); + ARKodeFree(&parititon_mem[0]); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&parititon_mem[1]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + SUNNonlinSolFree(nls); + + return fail; +} + +/* Integrates the ODE + * + * y' = [y^2] - [y*(y + 1)] = -y + * + * with initial condition y(0) = 1 and partitioning specified by the square + * brackets. Powers and products are done componentwise. At t = 0.5, we resize + * from 1D to 2D: + * + * y_new = [1, y_old]^T + * + * Then we integrate to t = 1 and check the error against the exact solution + * y(1) = [exp(-0.5), exp(-1)]. + */ +static int test_resize(const sundials::Context& ctx) +{ + constexpr auto t0 = SUN_RCONST(0.0); + constexpr auto t1 = SUN_RCONST(0.5); + constexpr auto t2 = SUN_RCONST(1.0); + constexpr auto dt = SUN_RCONST(8.0e-3); + constexpr auto local_tol = SUN_RCONST(1.0e-5); + constexpr auto global_tol = local_tol; + auto y = N_VNew_Serial(1, ctx); + N_VConst(SUN_RCONST(1.0), y); + + ARKRhsFn f1 = [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VProd(z, z, zdot); + return 0; + }; + + ARKRhsFn f2 = [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VConst(-SUN_RCONST(1.0), zdot); + N_VLinearSum(SUN_RCONST(1.0), zdot, -SUN_RCONST(1.0), z, zdot); + N_VProd(zdot, z, zdot); + return 0; + }; + + void* parititon_mem[] = {ERKStepCreate(f1, t0, y, ctx), + ERKStepCreate(f2, t0, y, ctx)}; + ARKodeSStolerances(parititon_mem[0], local_tol, local_tol); + ARKodeSStolerances(parititon_mem[1], local_tol, local_tol); + + SUNStepper steppers[] = {nullptr, nullptr}; + ARKodeCreateSUNStepper(parititon_mem[0], &steppers[0]); + ARKodeCreateSUNStepper(parititon_mem[1], &steppers[1]); + + auto arkode_mem = SplittingStepCreate(steppers, 2, t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + auto coefficients = SplittingStepCoefficients_SymmetricParallel(2); + SplittingStepSetCoefficients(arkode_mem, coefficients); + SplittingStepCoefficients_Destroy(&coefficients); + + /* Integrate from 0 to 0.5 */ + auto tret = t0; + ARKodeEvolve(arkode_mem, t1, y, &tret, ARK_NORMAL); + + /* Resize */ + auto y_new = N_VNew_Serial(2, ctx); + N_VGetArrayPointer(y_new)[0] = SUN_RCONST(1.0); + N_VGetArrayPointer(y_new)[1] = N_VGetArrayPointer(y)[0]; + N_VDestroy(y); + ARKodeResize(arkode_mem, y_new, SUN_RCONST(1.0), t1, nullptr, nullptr); + ARKodeResize(parititon_mem[0], y_new, SUN_RCONST(1.0), t1, nullptr, nullptr); + ARKodeResize(parititon_mem[1], y_new, SUN_RCONST(1.0), t1, nullptr, nullptr); + + /* Integrate from 0.5 to 1 */ + ARKodeEvolve(arkode_mem, t2, y_new, &tret, ARK_NORMAL); + + auto err = N_VClone(y_new); + N_VGetArrayPointer(err)[0] = std::exp(t1 - t2); + N_VGetArrayPointer(err)[1] = std::exp(t0 - t2); + N_VLinearSum(SUN_RCONST(1.0), err, -SUN_RCONST(1.0), y_new, err); + auto max_err = N_VMaxNorm(err); + + std::cout << "Resized solution completed with an error of " << max_err << "\n"; + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = max_err > global_tol; + if (fail) + { + std::cerr << "Error exceeded tolerance of " << global_tol << "\n"; + } + std::cout << "\n"; + + N_VDestroy(y_new); + N_VDestroy(err); + ARKodeFree(&parititon_mem[0]); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&parititon_mem[1]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + + return fail; +} + +/* Creates a custom SUNStepper for the linear, scalar ODE y' = lambda*y */ +static SUNStepper create_exp_stepper(const sundials::Context& ctx, + const sunrealtype& lam, N_Vector y) +{ + SUNStepper stepper = nullptr; + SUNStepper_Create(ctx, &stepper); + + struct Content + { + sunrealtype lambda; + sunrealtype t{}; + N_Vector v; + + Content(sunrealtype l, N_Vector tmpl) : lambda(l), v(N_VClone(tmpl)) {} + + ~Content() { N_VDestroy(v); } + + static Content& from_stepper(SUNStepper s) + { + void* content = nullptr; + SUNStepper_GetContent(s, &content); + return *static_cast<Content*>(content); + } + }; + + SUNStepper_SetContent(stepper, new Content(lam, y)); + + auto reset = [](SUNStepper s, sunrealtype tR, N_Vector vR) + { + auto& content = Content::from_stepper(s); + content.t = tR; + N_VScale(SUN_RCONST(1.0), vR, content.v); + return 0; + }; + SUNStepper_SetResetFn(stepper, reset); + + auto empty_func = [](auto...) { return 0; }; + SUNStepper_SetStopTimeFn(stepper, empty_func); + SUNStepper_SetStepDirectionFn(stepper, empty_func); + SUNStepper_SetFullRhsFn(stepper, empty_func); + + auto evolve = + [](SUNStepper s, sunrealtype tout, N_Vector vret, sunrealtype* tret) + { + auto& content = Content::from_stepper(s); + N_VScale(std::exp(content.lambda * (tout - content.t)), content.v, vret); + *tret = tout; + return 0; + }; + SUNStepper_SetEvolveFn(stepper, evolve); + + auto destroy = [](SUNStepper s) + { + delete &Content::from_stepper(s); + return 0; + }; + SUNStepper_SetDestroyFn(stepper, destroy); + return stepper; +} + +/* Integrates the ODE + * + * y' = -0.6*y - 0.4*y + * + * with initial condition y(0) = 1 with a sixth order splitting method and + * exact, custom SUNSteppers for the two partitions. We integrate to t = 1 and + * compare the numerical solution to the exact solution y(t) = exp(-t). + */ +static int test_custom_stepper(const sundials::Context& ctx, int order) +{ + constexpr auto lambda1 = SUN_RCONST(-0.6); + constexpr auto lambda2 = SUN_RCONST(-0.4); + constexpr auto t0 = SUN_RCONST(0.0); + constexpr auto tf = SUN_RCONST(1.0); + constexpr auto dt = SUN_RCONST(0.1); + auto y = N_VNew_Serial(1, ctx); + N_VConst(SUN_RCONST(1.0), y); + + SUNStepper steppers[] = {create_exp_stepper(ctx, lambda1, y), + create_exp_stepper(ctx, lambda2, y)}; + + auto arkode_mem = SplittingStepCreate(steppers, 2, t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + auto coefficients = SplittingStepCoefficients_SuzukiFractal(2, order); + SplittingStepSetCoefficients(arkode_mem, coefficients); + SplittingStepCoefficients_Destroy(&coefficients); + + auto tret = t0; + ARKodeEvolve(arkode_mem, tf, y, &tret, ARK_NORMAL); + + /* Check that the solution matches the exact solution */ + auto exact_solution = std::exp(t0 - tf); + auto numerical_solution = N_VGetArrayPointer(y)[0]; + auto err = numerical_solution - exact_solution; + + std::cout << "Custom SUNStepper solution of order " << order + << " completed with an error of " << err << "\n"; + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = SUNRCompare(exact_solution, numerical_solution); + if (fail) { std::cerr << "Error exceeded tolerance\n"; } + std::cout << "\n"; + + N_VDestroy(y); + SUNStepper_Destroy(&steppers[0]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + return fail; +} + +/* Integrates the ODE + * + * y' = [y / (1 + t)] + [-y / (2 + t)] + [y / (3 + t)] + * + * with initial condition y(0) = 1 and partitioning specified by the square + * brackets. After integration to t = 1, the third partition and its + * corresponding SUNStepper are dropped from the ODE so there are only two + * partitions. Then we integrate to t = 2 and check the error against the exact + * solution y(2) = 2. + */ +static int test_reinit(const sundials::Context& ctx) +{ + constexpr auto t0 = SUN_RCONST(0.0); + constexpr auto t1 = SUN_RCONST(1.0); + constexpr auto t2 = SUN_RCONST(2.0); + constexpr auto dt = SUN_RCONST(8.0e-3); + constexpr auto local_tol = SUN_RCONST(1.0e-6); + constexpr auto global_tol = SUN_RCONST(10.0) * local_tol; + auto y = N_VNew_Serial(1, ctx); + N_VConst(SUN_RCONST(1.0), y); + + ARKRhsFn fns[] = {[](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VScale(SUN_RCONST(1.0) / (SUN_RCONST(1.0) + t), z, zdot); + return 0; + }, + [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VScale(-SUN_RCONST(1.0) / (SUN_RCONST(2.0) + t), z, zdot); + return 0; + }, + [](sunrealtype t, N_Vector z, N_Vector zdot, void*) + { + N_VScale(SUN_RCONST(1.0) / (SUN_RCONST(3.0) + t), z, zdot); + return 0; + }}; + + void* partition_mem[] = {nullptr, nullptr, nullptr}; + SUNStepper steppers[] = {nullptr, nullptr, nullptr}; + + for (std::size_t i = 0; i < 3; i++) + { + partition_mem[i] = ERKStepCreate(fns[i], t0, y, ctx); + ARKodeSStolerances(partition_mem[i], local_tol, local_tol); + ARKodeCreateSUNStepper(partition_mem[i], &steppers[i]); + } + + auto arkode_mem = SplittingStepCreate(steppers, 3, t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetOrder(arkode_mem, 2); + auto tret = t0; + ARKodeEvolve(arkode_mem, t1, y, &tret, ARK_NORMAL); + + SplittingStepReInit(arkode_mem, steppers, 2, t1, y); + for (std::size_t i = 0; i < 2; i++) + { + ERKStepReInit(partition_mem[i], fns[i], t1, y); + } + + ARKodeEvolve(arkode_mem, t2, y, &tret, ARK_NORMAL); + + /* Check that the solution matches the exact solution */ + auto exact_solution = SUN_RCONST(2.0); + auto numerical_solution = N_VGetArrayPointer(y)[0]; + auto err = numerical_solution - exact_solution; + + std::cout << "Reinitialized solution completed with an error of " << err + << "\n"; + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = SUNRCompareTol(exact_solution, numerical_solution, + global_tol); + if (fail) + { + std::cerr << "Error exceeded tolerance of " << global_tol << "\n"; + } + std::cout << "\n"; + + N_VDestroy(y); + for (std::size_t i = 0; i < 3; i++) + { + ARKodeFree(&partition_mem[i]); + SUNStepper_Destroy(&steppers[i]); + } + ARKodeFree(&arkode_mem); + + return fail; +} + +int main() +{ + sundials::Context ctx; + SUNContext_PushErrHandler(ctx, SUNAbortErrHandlerFn, nullptr); + + int errors = 0; + + /* Run the tests */ + constexpr auto min_partitions = 2; + constexpr auto max_partitions = 5; + for (auto p = min_partitions; p <= max_partitions; p++) + { + constexpr auto min_order = 1; + constexpr auto max_order = 4; + for (auto order = min_order; order <= max_order; order++) + { + errors += test_forward(ctx, order, p); + } + } + + auto names = {"ARKODE_SPLITTING_STRANG_2_2_2", "ARKODE_SPLITTING_BEST_2_2_2", + "ARKODE_SPLITTING_SUZUKI_3_3_2", "ARKODE_SPLITTING_RUTH_3_3_2"}; + for (auto name : names) { errors += test_mixed_directions(ctx, name); } + + errors += test_resize(ctx); + errors += test_custom_stepper(ctx, 4); + errors += test_custom_stepper(ctx, 6); + errors += test_reinit(ctx); + + if (errors == 0) { std::cout << "Success\n"; } + else { std::cout << errors << " Test Failures\n"; } + + return errors; +} diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.out b/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.out new file mode 100644 index 0000000000..c9f06b5c31 --- /dev/null +++ b/test/unit_tests/arkode/CXX_serial/ark_test_splittingstep.out @@ -0,0 +1,385 @@ +Forward solution of order 1 with 2 partitions completed with an error of 1.70008e-12 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 125 +Partition 1 evolves = 125 + +Forward solution of order 2 with 2 partitions completed with an error of 1.65234e-12 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 250 +Partition 1 evolves = 125 + +Forward solution of order 3 with 2 partitions completed with an error of 1.0843e-12 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 375 +Partition 1 evolves = 375 + +Forward solution of order 4 with 2 partitions completed with an error of -2.71305e-12 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 500 +Partition 1 evolves = 375 + +Forward solution of order 1 with 3 partitions completed with an error of 7.87148e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 125 +Partition 1 evolves = 125 +Partition 2 evolves = 125 + +Forward solution of order 2 with 3 partitions completed with an error of 7.64167e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 250 +Partition 1 evolves = 250 +Partition 2 evolves = 125 + +Forward solution of order 3 with 3 partitions completed with an error of 4.87888e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 375 +Partition 1 evolves = 625 +Partition 2 evolves = 375 + +Forward solution of order 4 with 3 partitions completed with an error of -1.02113e-12 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 500 +Partition 1 evolves = 750 +Partition 2 evolves = 375 + +Forward solution of order 1 with 4 partitions completed with an error of 5.57776e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 125 +Partition 1 evolves = 125 +Partition 2 evolves = 125 +Partition 3 evolves = 125 + +Forward solution of order 2 with 4 partitions completed with an error of 5.41345e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 250 +Partition 1 evolves = 250 +Partition 2 evolves = 250 +Partition 3 evolves = 125 + +Forward solution of order 3 with 4 partitions completed with an error of 3.46445e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 375 +Partition 1 evolves = 625 +Partition 2 evolves = 625 +Partition 3 evolves = 375 + +Forward solution of order 4 with 4 partitions completed with an error of -7.25808e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 500 +Partition 1 evolves = 750 +Partition 2 evolves = 750 +Partition 3 evolves = 375 + +Forward solution of order 1 with 5 partitions completed with an error of 4.72899e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 125 +Partition 1 evolves = 125 +Partition 2 evolves = 125 +Partition 3 evolves = 125 +Partition 4 evolves = 125 + +Forward solution of order 2 with 5 partitions completed with an error of 4.58966e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 250 +Partition 1 evolves = 250 +Partition 2 evolves = 250 +Partition 3 evolves = 250 +Partition 4 evolves = 125 + +Forward solution of order 3 with 5 partitions completed with an error of 2.95819e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 375 +Partition 1 evolves = 625 +Partition 2 evolves = 625 +Partition 3 evolves = 625 +Partition 4 evolves = 375 + +Forward solution of order 4 with 5 partitions completed with an error of -6.1845e-13 +Current time = 1.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 500 +Partition 1 evolves = 750 +Partition 2 evolves = 750 +Partition 3 evolves = 750 +Partition 4 evolves = 375 + +Mixed direction solution using ARKODE_SPLITTING_STRANG_2_2_2 completed with an error of 5.094e-07 +Current time = -0.0009800000000017288 +Steps = 2279 +Step attempts = 2279 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = -0.00123 +Last step size = -0.00123 +Current step size = -0.00123 +Partition 0 evolves = 4558 +Partition 1 evolves = 2279 + +Mixed direction solution using ARKODE_SPLITTING_BEST_2_2_2 completed with an error of 5.09492e-07 +Current time = -0.0009800000000017288 +Steps = 2279 +Step attempts = 2279 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = -0.00123 +Last step size = -0.00123 +Current step size = -0.00123 +Partition 0 evolves = 4558 +Partition 1 evolves = 4558 + +Mixed direction solution using ARKODE_SPLITTING_SUZUKI_3_3_2 completed with an error of 1.08724e-10 +Current time = -0.0009800000000017288 +Steps = 2279 +Step attempts = 2279 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = -0.00123 +Last step size = -0.00123 +Current step size = -0.00123 +Partition 0 evolves = 6837 +Partition 1 evolves = 6837 + +Mixed direction solution using ARKODE_SPLITTING_RUTH_3_3_2 completed with an error of 1.96248e-10 +Current time = -0.0009800000000017288 +Steps = 2279 +Step attempts = 2279 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = -0.00123 +Last step size = -0.00123 +Current step size = -0.00123 +Partition 0 evolves = 6837 +Partition 1 evolves = 6837 + +Resized solution completed with an error of 7.14694e-06 +Current time = 1.004 +Steps = 126 +Step attempts = 126 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 252 +Partition 1 evolves = 252 + +Custom SUNStepper solution of order 4 completed with an error of -8.32667e-16 +Current time = 1.1 +Steps = 11 +Step attempts = 11 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.1 +Last step size = 0.1 +Current step size = 0.1 +Partition 0 evolves = 66 +Partition 1 evolves = 55 + +Custom SUNStepper solution of order 6 completed with an error of 1.16573e-15 +Current time = 1.1 +Steps = 11 +Step attempts = 11 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.1 +Last step size = 0.1 +Current step size = 0.1 +Partition 0 evolves = 286 +Partition 1 evolves = 275 + +Reinitialized solution completed with an error of -2.44249e-15 +Current time = 2.000000000000001 +Steps = 125 +Step attempts = 125 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.008 +Last step size = 0.008 +Current step size = 0.008 +Partition 0 evolves = 250 +Partition 1 evolves = 125 + +Success diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index 6794a213b4..f8b9425fe2 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -25,6 +25,7 @@ set(ARKODE_unit_tests "ark_test_arkstepsetforcing\;1 3 2.0 10.0" "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_forcingstep\;" "ark_test_getuserdata\;" "ark_test_innerstepper\;" "ark_test_interp\;-100" @@ -32,6 +33,7 @@ set(ARKODE_unit_tests "ark_test_interp\;-1000000" "ark_test_mass\;" "ark_test_reset\;" + "ark_test_splittingstep_coefficients\;" "ark_test_tstop\;") # Add the build and install targets for each test diff --git a/test/unit_tests/arkode/C_serial/ark_test_forcingstep.c b/test/unit_tests/arkode/C_serial/ark_test_forcingstep.c new file mode 100644 index 0000000000..80d0d92281 --- /dev/null +++ b/test/unit_tests/arkode/C_serial/ark_test_forcingstep.c @@ -0,0 +1,300 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Steven B. Roberts @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 tests on several ODEs with analytical solutions to verify the + * ForcingStep module. + * ---------------------------------------------------------------------------*/ + +#include <arkode/arkode_erkstep.h> +#include <arkode/arkode_forcingstep.h> +#include <nvector/nvector_serial.h> + +#if defined(SUNDIALS_EXTENDED_PRECISION) +#define GSYM "Lg" +#else +#define GSYM "g" +#endif + +/* RHS function for f_1(t, y) = t / y */ +static int f_forward_1(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VInv(y, ydot); + N_VScale(t, ydot, ydot); + return 0; +} + +/* RHS function for f_2(t, y) = 1 / y */ +static int f_forward_2(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + N_VInv(y, ydot); + return 0; +} + +/* Integrates the ODE + * + * y' = [t / y] + [1 / y] + * + * with initial condition y(0) = 1 and partitioning specified by the square + * brackets. We integrate to t = 1 and check the error against the exact + * solution y(t) = |t + 1|. + */ +static int test_forward(SUNContext ctx) +{ + sunrealtype t0 = SUN_RCONST(0.0); + sunrealtype tf = SUN_RCONST(1.0); + sunrealtype dt = SUN_RCONST(1.0e-4); + sunrealtype local_tol = SUN_RCONST(1.0e-6); + sunrealtype global_tol = SUN_RCONST(10.0) * local_tol; + + N_Vector y = N_VNew_Serial(1, ctx); + /* Use the wrong initial condition for the partitions to ensure it gets reset + * to the correct value of 1 by ForcingStep */ + N_VConst(SUN_RCONST(0.0), y); + + void* parititon_mem[] = {ERKStepCreate(f_forward_1, t0, y, ctx), + ERKStepCreate(f_forward_2, t0, y, ctx)}; + ARKodeSStolerances(parititon_mem[0], local_tol, local_tol); + ARKodeSStolerances(parititon_mem[1], local_tol, local_tol); + + SUNStepper steppers[] = {NULL, NULL}; + ARKodeCreateSUNStepper(parititon_mem[0], &steppers[0]); + ARKodeCreateSUNStepper(parititon_mem[1], &steppers[1]); + + N_VConst(SUN_RCONST(1.0), y); + void* arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetMaxNumSteps(arkode_mem, -1); + + sunrealtype tret = t0; + ARKodeEvolve(arkode_mem, tf, y, &tret, ARK_NORMAL); + + sunrealtype exact_solution = SUN_RCONST(2.0); + sunrealtype numerical_solution = N_VGetArrayPointer(y)[0]; + sunrealtype err = numerical_solution - exact_solution; + + printf("Forward direction solution completed with an error of %" GSYM "\n", + err); + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = SUNRCompareTol(exact_solution, numerical_solution, + global_tol); + if (fail) + { + fprintf(stderr, "Error exceeded tolerance of %" GSYM "\n", global_tol); + } + printf("\n"); + + N_VDestroy(y); + ARKodeFree(&parititon_mem[0]); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&parititon_mem[1]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + + return fail; +} + +static int f_mixed_direction_1(sunrealtype t, N_Vector z, N_Vector zdot, + void* data) +{ + N_VGetArrayPointer(zdot)[0] = N_VGetArrayPointer(z)[1] - t; + N_VGetArrayPointer(zdot)[1] = SUN_RCONST(0.0); + return 0; +} + +static int f_mixed_direction_2(sunrealtype t, N_Vector z, N_Vector zdot, + void* data) +{ + N_VGetArrayPointer(zdot)[0] = SUN_RCONST(0.0); + N_VGetArrayPointer(zdot)[1] = t - N_VGetArrayPointer(z)[0]; + return 0; +} + +/* Integrates the ODE + * + * y_1' = y_2 - t + * y_2' = t - y_1 + * + * with initial condition y(0) = [1, 1]^T backward in time to t = -1, then + * forward to t = 0.4, and backward to t = 0. We apply a splitting method using + * a component partitioning and check that the numerical solution is close to + * the original initial condition. + */ +static int test_mixed_directions(SUNContext ctx) +{ + sunrealtype t0 = SUN_RCONST(0.0); + sunrealtype t1 = SUN_RCONST(-1.0); + sunrealtype t2 = SUN_RCONST(0.4); + sunrealtype t3 = t0; + sunrealtype dt = -SUN_RCONST(1.23e-4); + sunrealtype local_tol = SUN_RCONST(1.0e-4); + sunrealtype global_tol = SUN_RCONST(10.0) * local_tol; + N_Vector y = N_VNew_Serial(2, ctx); + N_VConst(SUN_RCONST(1.0), y); + N_Vector err = N_VClone(y); + N_VConst(SUN_RCONST(1.0), err); + + void* parititon_mem[] = {ERKStepCreate(f_mixed_direction_1, t0, y, ctx), + ERKStepCreate(f_mixed_direction_2, t0, y, ctx)}; + ARKodeSStolerances(parititon_mem[0], local_tol, local_tol); + ARKodeSStolerances(parititon_mem[1], local_tol, local_tol); + + SUNStepper steppers[] = {NULL, NULL}; + ARKodeCreateSUNStepper(parititon_mem[0], &steppers[0]); + ARKodeCreateSUNStepper(parititon_mem[1], &steppers[1]); + + void* arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetInterpolantType(arkode_mem, ARK_INTERP_HERMITE); + ARKodeSetMaxNumSteps(arkode_mem, -1); + + /* Integrate from 0 to -1 */ + sunrealtype tret = t0; + ARKodeEvolve(arkode_mem, t1, y, &tret, ARK_NORMAL); + + /* Integrate from -1 to 0.4 */ + ARKodeReset(arkode_mem, t1, y); + ARKodeSetStepDirection(arkode_mem, t2 - t1); + ARKodeEvolve(arkode_mem, t2, y, &tret, ARK_NORMAL); + + /* Integrate from 0.4 to 0 */ + ARKodeReset(arkode_mem, t2, y); + ARKodeSetStepDirection(arkode_mem, t3 - t2); + ARKodeEvolve(arkode_mem, t3, y, &tret, ARK_NORMAL); + + N_VLinearSum(SUN_RCONST(1.0), err, -SUN_RCONST(1.0), y, err); + sunrealtype max_err = N_VMaxNorm(err); + + printf("Mixed direction solution completed with an error of %" GSYM "\n", + max_err); + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = max_err > global_tol; + if (fail) + { + fprintf(stderr, "Error exceeded tolerance of %" GSYM "\n", global_tol); + } + printf("\n"); + + N_VDestroy(y); + N_VDestroy(err); + ARKodeFree(&parititon_mem[0]); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&parititon_mem[1]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + + return fail; +} + +/* Integrates the ODE + * + * y' = [t / y] + [1 / y] + * + * with initial condition y(0) = 1 and partitioning specified by the square + * brackets. We integrate to t = 1 then reinitialize the forcing method by + * swapping the SUNSteppers and updating the initial condition to y(1) = -1. + * Next we integrate to t = 2 and check the error against the exact solution + * y(2) = -sqrt(6). + */ +static int test_reinit(SUNContext ctx) +{ + sunrealtype t0 = SUN_RCONST(0.0); + sunrealtype t1 = SUN_RCONST(1.0); + sunrealtype t2 = SUN_RCONST(2.0); + sunrealtype dt = SUN_RCONST(1.0e-4); + sunrealtype local_tol = SUN_RCONST(1.0e-6); + sunrealtype global_tol = SUN_RCONST(10.0) * local_tol; + + N_Vector y = N_VNew_Serial(1, ctx); + N_VConst(SUN_RCONST(1.0), y); + + void* parititon_mem[] = {ERKStepCreate(f_forward_1, t0, y, ctx), + ERKStepCreate(f_forward_2, t0, y, ctx)}; + ARKodeSStolerances(parititon_mem[0], local_tol, local_tol); + ARKodeSStolerances(parititon_mem[1], local_tol, local_tol); + + SUNStepper steppers[] = {NULL, NULL}; + ARKodeCreateSUNStepper(parititon_mem[0], &steppers[0]); + ARKodeCreateSUNStepper(parititon_mem[1], &steppers[1]); + + void* arkode_mem = ForcingStepCreate(steppers[0], steppers[1], t0, y, ctx); + ARKodeSetFixedStep(arkode_mem, dt); + ARKodeSetMaxNumSteps(arkode_mem, -1); + + sunrealtype tret = t0; + ARKodeEvolve(arkode_mem, t1, y, &tret, ARK_NORMAL); + + /* Change the state and swap the steppers so now forcing is applied to + * steppers[0] rather than steppers[1] */ + N_VConst(SUN_RCONST(-1.0), y); + ERKStepReInit(parititon_mem[0], f_forward_1, t1, y); + ForcingStepReInit(arkode_mem, steppers[1], steppers[0], t1, y); + ERKStepReInit(parititon_mem[1], f_forward_2, t1, y); + + ARKodeEvolve(arkode_mem, t2, y, &tret, ARK_NORMAL); + + sunrealtype exact_solution = -SUNRsqrt(SUN_RCONST(6.0)); + sunrealtype numerical_solution = N_VGetArrayPointer(y)[0]; + sunrealtype err = numerical_solution - exact_solution; + + printf("Reinitialized solution completed with an error of %" GSYM "\n", err); + ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + + sunbooleantype fail = SUNRCompareTol(exact_solution, numerical_solution, + global_tol); + if (fail) + { + fprintf(stderr, "Error exceeded tolerance of %" GSYM "\n", global_tol); + } + printf("\n"); + + N_VDestroy(y); + ARKodeFree(&parititon_mem[0]); + SUNStepper_Destroy(&steppers[0]); + ARKodeFree(&parititon_mem[1]); + SUNStepper_Destroy(&steppers[1]); + ARKodeFree(&arkode_mem); + + return fail; +} + +int main() +{ + SUNContext ctx = NULL; + SUNErrCode err = SUNContext_Create(SUN_COMM_NULL, &ctx); + if (err != SUN_SUCCESS) + { + fprintf(stderr, "Failed to create the SUNContext\n"); + return 1; + } + + err = SUNContext_PushErrHandler(ctx, SUNAbortErrHandlerFn, NULL); + if (err != SUN_SUCCESS) + { + fprintf(stderr, "Failed to add error handler\n"); + return 1; + } + + int errors = 0; + errors += test_forward(ctx); + errors += test_mixed_directions(ctx); + errors += test_reinit(ctx); + + SUNContext_Free(&ctx); + + if (errors == 0) { printf("Success\n"); } + else { printf("%d Test Failures\n", errors); } + + return 0; +} diff --git a/test/unit_tests/arkode/C_serial/ark_test_splittingstep_coefficients.c b/test/unit_tests/arkode/C_serial/ark_test_splittingstep_coefficients.c new file mode 100644 index 0000000000..937ea2e9b4 --- /dev/null +++ b/test/unit_tests/arkode/C_serial/ark_test_splittingstep_coefficients.c @@ -0,0 +1,217 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Steven Roberts @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 that checks splitting coefficients constructors and loading + * functions + * ---------------------------------------------------------------------------*/ + +#include <stdio.h> +#include <stdlib.h> + +#include "arkode/arkode_splittingstep.h" +#include "sundials/sundials_math.h" + +#define ZERO SUN_RCONST(0.0) +#define ONE SUN_RCONST(1.0) +#define TWO SUN_RCONST(2.0) +#define HALF SUN_RCONST(0.5) +#define GAMMA \ + (SUN_RCONST(1.0) / \ + (SUN_RCONST(4.0) - \ + SUNRpowerR(SUN_RCONST(4.0), SUN_RCONST(1.0) / SUN_RCONST(3.0)))) + +static int check_coefficients(const char* name, + SplittingStepCoefficients coefficients, + int expected_sequential_methods, + int expected_stages, int expected_partitions, + int expected_order, + const sunrealtype* expected_alpha, + const sunrealtype* expected_beta) +{ + printf("Testing %s\n", name); + + if (coefficients == NULL) + { + fprintf(stderr, "Expected non-NULL coefficients\n"); + } + + if (coefficients->sequential_methods != expected_sequential_methods) + { + fprintf(stderr, "Expected %d sequential methods, but there are %d\n", + expected_sequential_methods, coefficients->sequential_methods); + return 1; + } + + if (coefficients->stages != expected_stages) + { + fprintf(stderr, "Expected %d stages, but there are %d\n", expected_stages, + coefficients->stages); + return 1; + } + + if (coefficients->partitions != expected_partitions) + { + fprintf(stderr, "Expected %d partitions, but there are %d\n", + expected_partitions, coefficients->partitions); + return 1; + } + + if (coefficients->order != expected_order) + { + fprintf(stderr, "Expected order %d, but is %d\n", expected_order, + coefficients->order); + return 1; + } + + int retval = 0; + + for (int i = 0; i < expected_sequential_methods; i++) + { + if (SUNRCompare(coefficients->alpha[i], expected_alpha[i])) + { + fprintf(stderr, "alpha[%d] incorrect\n", i); + retval++; + } + } + + for (int i = 0; i < expected_sequential_methods; i++) + { + for (int j = 0; j <= expected_stages; j++) + { + for (int k = 0; k < expected_partitions; k++) + { + if (SUNRCompare(coefficients->beta[i][j][k], + expected_beta[(i * (expected_stages + 1) + j) * expected_partitions + + k])) + { + fprintf(stderr, "beta[%d][%d][%d] incorrect\n", i, j, k); + retval++; + } + } + } + } + + if (retval > 0) { SplittingStepCoefficients_Write(coefficients, stderr); } + + return retval; +} + +/* Main program */ +int main(int argc, char* argv[]) +{ + int retval = 0; + + printf("Testing Splitting Coefficients\n"); + + SplittingStepCoefficients coefficients = + SplittingStepCoefficients_Create(1, 2, 2, 1, NULL, NULL); + if (coefficients != NULL) + { + fprintf(stderr, "Coefficients created with NULL coefficients\n"); + retval++; + } + + sunrealtype alpha_lie_trotter[] = {ONE}; + sunrealtype beta_lie_trotter[] = {ZERO, ZERO, ONE, ONE}; + + coefficients = SplittingStepCoefficients_Create(0, 0, 0, 1, alpha_lie_trotter, + beta_lie_trotter); + if (coefficients != NULL) + { + fprintf(stderr, "Coefficients created with invalid sizes\n"); + retval++; + } + + coefficients = SplittingStepCoefficients_Create(1, 1, 2, 1, alpha_lie_trotter, + beta_lie_trotter); + retval += check_coefficients("Lie-Trotter (manually created)", coefficients, + 1, 1, 2, 1, alpha_lie_trotter, beta_lie_trotter); + + SplittingStepCoefficients coefficients_copy = + SplittingStepCoefficients_Copy(coefficients); + retval += check_coefficients("Lie-Trotter (copy)", coefficients_copy, 1, 1, 2, + 1, alpha_lie_trotter, beta_lie_trotter); + SplittingStepCoefficients_Destroy(&coefficients); + SplittingStepCoefficients_Destroy(&coefficients_copy); + + coefficients = SplittingStepCoefficients_LoadCoefficients( + ARKODE_SPLITTING_LIE_TROTTER_1_1_2); + retval += check_coefficients("Lie-Trotter (load by enum)", coefficients, 1, 1, + 2, 1, alpha_lie_trotter, beta_lie_trotter); + SplittingStepCoefficients_Destroy(&coefficients); + + coefficients = SplittingStepCoefficients_LoadCoefficientsByName( + "ARKODE_SPLITTING_LIE_TROTTER_1_1_2"); + retval += check_coefficients("Lie-Trotter (load by name)", coefficients, 1, 1, + 2, 1, alpha_lie_trotter, beta_lie_trotter); + SplittingStepCoefficients_Destroy(&coefficients); + + coefficients = SplittingStepCoefficients_LieTrotter(2); + retval += check_coefficients("Lie-Trotter (constructor)", coefficients, 1, 1, + 2, 1, alpha_lie_trotter, beta_lie_trotter); + SplittingStepCoefficients_Destroy(&coefficients); + + sunrealtype alpha_strang[] = {ONE}; + sunrealtype beta_strang[] = {ZERO, ZERO, ZERO, HALF, HALF, ONE, + HALF, ONE, ONE, ONE, ONE, ONE}; + + coefficients = SplittingStepCoefficients_Strang(3); + retval += check_coefficients("Strang", coefficients, 1, 3, 3, 2, alpha_strang, + beta_strang); + SplittingStepCoefficients_Destroy(&coefficients); + + sunrealtype alpha_parallel[] = {ONE, ONE, -ONE}; + sunrealtype beta_parallel[] = {ZERO, ZERO, ONE, ZERO, ZERO, ZERO, + ZERO, ONE, ZERO, ZERO, ZERO, ZERO}; + + coefficients = SplittingStepCoefficients_Parallel(2); + retval += check_coefficients("Parallel", coefficients, 3, 1, 2, 1, + alpha_parallel, beta_parallel); + SplittingStepCoefficients_Destroy(&coefficients); + + sunrealtype alpha_symmetric_parallel[] = {HALF, HALF, -ONE}; + sunrealtype beta_symmetric_parallel[] = {ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, + ZERO, ZERO, ZERO, ONE, ONE, ONE, + ZERO, ZERO, ZERO, ZERO, ZERO, ONE, + ZERO, ONE, ONE, ONE, ONE, ONE}; + + coefficients = SplittingStepCoefficients_SymmetricParallel(3); + retval += check_coefficients("Symmetric Parallel", coefficients, 2, 3, 3, 2, + alpha_symmetric_parallel, beta_symmetric_parallel); + SplittingStepCoefficients_Destroy(&coefficients); + + sunrealtype alpha_suzuki_fractal[] = {ONE}; + sunrealtype beta_suzuki_fractal[] = {ZERO, + ZERO, + HALF * GAMMA, + GAMMA, + (ONE + HALF) * GAMMA, + TWO * GAMMA, + HALF, + ONE - TWO * GAMMA, + ONE - (ONE + HALF) * GAMMA, + ONE - GAMMA, + ONE - HALF * GAMMA, + ONE, + ONE, + ONE}; + + coefficients = SplittingStepCoefficients_SuzukiFractal(2, 4); + retval += check_coefficients("Suzuki Fractal", coefficients, 1, 6, 2, 4, + alpha_suzuki_fractal, beta_suzuki_fractal); + SplittingStepCoefficients_Destroy(&coefficients); + + printf("%d test failures\n", retval); + + return retval; +} From f7208a4762d5234d76c022b673189e49557175b3 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Fri, 6 Dec 2024 10:10:10 -0800 Subject: [PATCH 127/137] Bugfix: out of bounds read setting stage type (#609) Fix out of bounds read when setting MRI stage type --- cmake/SundialsSetupCompilers.cmake | 39 +++++++++++++++++++++++------- src/arkode/arkode_mri_tables.c | 2 ++ src/arkode/arkode_mristep_impl.h | 1 + 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index da0ae0091b..ab008f1ad0 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -132,18 +132,39 @@ if(ENABLE_WARNINGS_AS_ERRORS) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Werror") endif() +# With clang it is not possible to combine the -fsanitize=address and +# -fsanitize=memory checkers. + if(ENABLE_ADDRESS_SANITIZER) message(STATUS "Enabling address sanitizer") - set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" - ) - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" - ) - set(CMAKE_Fortran_FLAGS - "${CMAKE_Fortran_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" - ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=address") +endif() + +if(ENABLE_MEMORY_SANITIZER) + message(STATUS "Enabling memory sanitizer") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=memory") +endif() + +if(ENABLE_LEAK_SANITIZER) + message(STATUS "Enabling leak sanitizer") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=leak") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=leak") +endif() + +if(ENABLE_UNDEFINED_BEHAVIOR_SANITIZER) + message(STATUS "Enabling undefined behavior sanitizer") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=undefined") endif() if(SUNDIALS_DEBUG) diff --git a/src/arkode/arkode_mri_tables.c b/src/arkode/arkode_mri_tables.c index 75db52c6de..eb196bcbd0 100644 --- a/src/arkode/arkode_mri_tables.c +++ b/src/arkode/arkode_mri_tables.c @@ -776,6 +776,8 @@ int mriStepCoupling_GetStageType(MRIStepCoupling MRIC, int is) if ((is < 0) || (is > MRIC->stages)) { return ARK_INVALID_TABLE; } + if (is == 0) { return MRISTAGE_FIRST; } + /* report MRISTAGE_ERK_FAST for MERK and MRI-SR methods */ if ((MRIC->type == MRISTEP_SR) || (MRIC->type == MRISTEP_MERK)) { diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index 1fe308d863..367d82c9c6 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -31,6 +31,7 @@ extern "C" { #endif /* Stage type identifiers */ +#define MRISTAGE_FIRST -2 #define MRISTAGE_STIFF_ACC -1 #define MRISTAGE_ERK_FAST 0 #define MRISTAGE_ERK_NOFAST 1 From 3d7f3bad92cb583f94e354590082db7f96ade9f6 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 09:10:40 -0800 Subject: [PATCH 128/137] Bugfix: Memory leaks (#610) * Fix memory leak when attaching an H-Tol controller to MRIStep * Fix memory leak / out of bound array access in Lagrange interpolation module * Fix memory leaks in unit tests --- CHANGELOG.md | 4 ++++ doc/shared/RecentChanges.rst | 4 ++++ examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 | 1 + src/arkode/arkode_impl.h | 3 ++- src/arkode/arkode_interp.c | 4 ++-- src/arkode/arkode_io.c | 7 ++++--- src/arkode/arkode_mristep_io.c | 7 ++++--- .../arkode/CXX_serial/ark_test_accumerror_brusselator.cpp | 4 ++-- .../arkode/CXX_serial/ark_test_accumerror_kpr.cpp | 1 + .../arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp | 1 + .../unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp | 1 + 11 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd86096342..a3df100774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,10 @@ not include contributions from the fast right-hand side function. With this fix, will see one additional fast right-hand side function evaluation per slow step with the Hermite interpolation option. +Fixed potential memory leaks and out of bounds array accesses that could occur +in the ARKODE Lagrange interpolation module when changing the method order or +polynomial degree after re-initializing an integrator. + Fixed a CMake configuration issue related to aliasing an `ALIAS` target when using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index c4cac39aa7..c7bf19413d 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -108,6 +108,10 @@ not include contributions from the fast right-hand side function. With this fix, will see one additional fast right-hand side function evaluation per slow step with the Hermite interpolation option. +Fixed potential memory leaks and out of bounds array accesses that could occur +in the ARKODE Lagrange interpolation module when changing the method order or +polynomial degree after re-initializing an integrator. + Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. diff --git a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 index d26cf5f56f..e34589b3b5 100644 --- a/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 +++ b/examples/arkode/F2003_serial/ark_roberts_dns_f2003.f90 @@ -435,6 +435,7 @@ program main retval = FSUNLinSolFree(sunlinsol_LS) call FSUNMatDestroy(sunmat_A) call FN_VDestroy(sunvec_y) + call FN_VDestroy(sunvec_f) call FN_VDestroy(sunvec_dky) call FN_VDestroy(sunvec_av) retval = FSUNContext_Free(sunctx) diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index dd388d9323..64bdc12f49 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -659,7 +659,8 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr, int arkAccessHAdaptMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem, ARKodeHAdaptMem* hadapt_mem); -int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C); +int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C, + sunbooleantype take_ownership); int arkSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, int pq, sunrealtype adapt_params[3]); int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index daf42de479..5bff398e6e 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -909,7 +909,7 @@ void arkInterpFree_Lagrange(ARKodeMem ark_mem, ARKInterp I) { if (LINT_YHIST(I) != NULL) { - for (i = 0; i < LINT_NMAX(I); i++) + for (i = 0; i < LINT_NMAXALLOC(I); i++) { if (LINT_YJ(I, i) != NULL) { @@ -1039,7 +1039,7 @@ int arkInterpInit_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tnew) } if (LINT_YHIST(I) != NULL) { - for (i = 0; i < LINT_NMAX(I); i++) + for (i = 0; i < LINT_NMAXALLOC(I); i++) { if (LINT_YJ(I, i) != NULL) { diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index 6c9ee34baa..f359d2280d 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -915,7 +915,7 @@ int ARKodeSetAdaptController(void* arkode_mem, SUNAdaptController C) } /* Otherwise, call a utility routine to replace the current controller object */ - return (arkReplaceAdaptController(ark_mem, C)); + return (arkReplaceAdaptController(ark_mem, C, SUNFALSE)); } /*--------------------------------------------------------------- @@ -3197,7 +3197,8 @@ int ARKodeWriteParameters(void* arkode_mem, FILE* fp) object. If a NULL-valued SUNAdaptController is input, the default will be re-enabled. ---------------------------------------------------------------*/ -int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C) +int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C, + sunbooleantype take_ownership) { int retval; long int lenrw, leniw; @@ -3238,7 +3239,7 @@ int arkReplaceAdaptController(ARKodeMem ark_mem, SUNAdaptController C) } ark_mem->hadapt_mem->owncontroller = SUNTRUE; } - else { ark_mem->hadapt_mem->owncontroller = SUNFALSE; } + else { ark_mem->hadapt_mem->owncontroller = take_ownership; } /* Attach new SUNAdaptController object */ retval = SUNAdaptController_Space(C, &lenrw, &leniw); diff --git a/src/arkode/arkode_mristep_io.c b/src/arkode/arkode_mristep_io.c index b4ef0d31c6..7d5a372e2f 100644 --- a/src/arkode/arkode_mristep_io.c +++ b/src/arkode/arkode_mristep_io.c @@ -266,12 +266,13 @@ int mriStep_SetAdaptController(ARKodeMem ark_mem, SUNAdaptController C) /* If this does not have MRI type, then just pass to ARKODE */ if (ctype != SUN_ADAPTCONTROLLER_MRI_H_TOL) { - return (arkReplaceAdaptController(ark_mem, C)); + return (arkReplaceAdaptController(ark_mem, C, SUNFALSE)); } - /* Create the mriStepControl wrapper, and pass that to ARKODE */ + /* Create the mriStepControl wrapper, pass that to ARKODE, and give ownership + of the wrapper to ARKODE */ SUNAdaptController Cwrapper = SUNAdaptController_MRIStep(ark_mem, C); - return (arkReplaceAdaptController(ark_mem, Cwrapper)); + return (arkReplaceAdaptController(ark_mem, Cwrapper, SUNTRUE)); } /*--------------------------------------------------------------- diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp index 2d01042362..4c3c1507fc 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_brusselator.cpp @@ -491,8 +491,7 @@ static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, sunrealtype T sunrealtype abstol = SUN_RCONST(1.e-12); N_Vector y2 = N_VClone(y); N_Vector ewt = N_VClone(y); - ; - N_Vector vtemp = N_VClone(y); + N_Vector vtemp = N_VClone(y); // Set array of fixed step sizes to use, storage for corresponding errors/orders sunrealtype hmax = (Tf - T0) / 400; @@ -657,6 +656,7 @@ static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, sunrealtype T N_VDestroy(y2); N_VDestroy(ewt); + N_VDestroy(vtemp); return (0); } diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp index 4a7cd7535e..f9b3279166 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_accumerror_kpr.cpp @@ -635,6 +635,7 @@ static int fixed_run(void* arkode_mem, N_Vector y, sunrealtype T0, N_VDestroy(y2); N_VDestroy(ewt); + N_VDestroy(vtemp); return (0); } diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp index 1169aabc17..5107c9fec3 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_brusselator_mriadapt.cpp @@ -792,6 +792,7 @@ int main(int argc, char* argv[]) // Clean up and return N_VDestroy(y); + N_VDestroy(yref); MRIStepCoupling_Free(C); if (As) { SUNMatDestroy(As); } if (LSs) { SUNLinSolFree(LSs); } diff --git a/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp index 67d7d0e162..6230b669ef 100644 --- a/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp +++ b/test/unit_tests/arkode/CXX_serial/ark_test_kpr_mriadapt.cpp @@ -791,6 +791,7 @@ int main(int argc, char* argv[]) // Clean up and return N_VDestroy(y); + N_VDestroy(yref); MRIStepCoupling_Free(C); if (As) { SUNMatDestroy(As); } if (LSs) { SUNLinSolFree(LSs); } From 028073500e77f4e6befd2617d963bbe584eda3d8 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 10:35:14 -0800 Subject: [PATCH 129/137] Bugfix: Initialize yerr to zero (#615) Fix a bug in SPRKStep where `yerr` was not initialized to zero when using compensated summations --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/arkode/arkode_sprkstep.c | 10 +++++++--- src/arkode/arkode_sprkstep_io.c | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3df100774..570bf29710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,9 @@ not include contributions from the fast right-hand side function. With this fix, will see one additional fast right-hand side function evaluation per slow step with the Hermite interpolation option. +Fixed a bug in SPRKStep when using compensated summations where the error vector +was not initialized to zero. + Fixed potential memory leaks and out of bounds array accesses that could occur in the ARKODE Lagrange interpolation module when changing the method order or polynomial degree after re-initializing an integrator. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index c7bf19413d..02bb920980 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -108,6 +108,9 @@ not include contributions from the fast right-hand side function. With this fix, will see one additional fast right-hand side function evaluation per slow step with the Hermite interpolation option. +Fixed a bug in SPRKStep when using compensated summations where the error vector +was not initialized to zero. + Fixed potential memory leaks and out of bounds array accesses that could occur in the ARKODE Lagrange interpolation module when changing the method order or polynomial degree after re-initializing an integrator. diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index 4e4ff84465..bfd4c88899 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -114,6 +114,8 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, ARKodeFree((void**)&ark_mem); return (NULL); } + /* Zero yerr for compensated summation */ + N_VConst(ZERO, step_mem->yerr); } else { step_mem->yerr = NULL; } ark_mem->step_init = sprkStep_Init; @@ -147,9 +149,6 @@ void* SPRKStepCreate(ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0, step_mem->nf2 = 0; step_mem->istage = 0; - /* 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. */ ARKodeSetInterpolantType(ark_mem, ARK_INTERP_LAGRANGE); @@ -286,6 +285,8 @@ int sprkStep_Resize(ARKodeMem ark_mem, N_Vector y0, "Unable to resize vector"); return (ARK_MEM_FAIL); } + /* Zero yerr for compensated summation */ + N_VConst(ZERO, step_mem->yerr); } return (ARK_SUCCESS); @@ -431,6 +432,9 @@ int sprkStep_Init(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED sunrealtype tout, ark_mem->interp_degree = 1; } + /* Zero yerr for compensated summation */ + if (ark_mem->use_compensated_sums) { N_VConst(ZERO, step_mem->yerr); } + return (ARK_SUCCESS); } diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index 4ae9775e68..ccd98523f0 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -58,6 +58,8 @@ int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff) { return ARK_MEM_FAIL; } + /* Zero yerr for compensated summation */ + N_VConst(ZERO, step_mem->yerr); } } else From d8e3390b464deeef89d2d61dc58cfee1e3514a3c Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 10:35:35 -0800 Subject: [PATCH 130/137] Bugfix: Add missing int32 fortran functions (#611) Add missing 32-bit ``sunindextype`` Fortran interface functions for * ``N_VGetSubvectorArrayPointer_ManyVector`` * ``N_VGetSubvectorArrayPointer_MPIManyVector`` * ``SUNBandMatrix_Column`` * ``SUNDenseMatrix_Column`` --- CHANGELOG.md | 6 ++++++ doc/shared/RecentChanges.rst | 6 ++++++ .../fmod_int32/fnvector_manyvector_mod.c | 15 +++++++++++++++ .../fmod_int32/fnvector_mpimanyvector_mod.c | 15 +++++++++++++++ .../fmod_int64/fnvector_manyvector_mod.c | 15 +++++++++++++++ .../fmod_int64/fnvector_mpimanyvector_mod.c | 15 +++++++++++++++ .../band/fmod_int32/fsunmatrix_band_mod.c | 15 +++++++++++++++ .../band/fmod_int64/fsunmatrix_band_mod.c | 15 +++++++++++++++ .../dense/fmod_int32/fsunmatrix_dense_mod.c | 15 +++++++++++++++ .../dense/fmod_int64/fsunmatrix_dense_mod.c | 15 +++++++++++++++ swig/nvector/fnvector_manyvector_mod.i | 15 +++++++++++++++ swig/nvector/fnvector_mpimanyvector_mod.i | 15 +++++++++++++++ swig/sunmatrix/fsunmatrix_band_mod.i | 15 +++++++++++++++ swig/sunmatrix/fsunmatrix_dense_mod.i | 15 +++++++++++++++ 14 files changed, 192 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 570bf29710..7b7e5fa6df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,12 @@ Fixed potential memory leaks and out of bounds array accesses that could occur in the ARKODE Lagrange interpolation module when changing the method order or polynomial degree after re-initializing an integrator. +Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to +``N_VGetSubvectorArrayPointer_ManyVector``, +``N_VGetSubvectorArrayPointer_MPIManyVector``, ``SUNBandMatrix_Column`` and +``SUNDenseMatrix_Column`` where 64-bit ``sunindextype`` interface functions were +used. + Fixed a CMake configuration issue related to aliasing an `ALIAS` target when using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 02bb920980..1ade86691b 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -115,6 +115,12 @@ Fixed potential memory leaks and out of bounds array accesses that could occur in the ARKODE Lagrange interpolation module when changing the method order or polynomial degree after re-initializing an integrator. +Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to +:c:func:`N_VGetSubvectorArrayPointer_ManyVector`, +:c:func:`N_VGetSubvectorArrayPointer_MPIManyVector`, +:c:func:`SUNBandMatrix_Column` and :c:func:`SUNDenseMatrix_Column` where 64-bit +``sunindextype`` interface functions were used. + Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. diff --git a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c index 39cc98fdf7..a47b40955b 100644 --- a/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c +++ b/src/nvector/manyvector/fmod_int32/fnvector_manyvector_mod.c @@ -991,6 +991,20 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_ManyVector(N_Vector farg1, int +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -1003,5 +1017,6 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1 fresult = result; return fresult; } +#endif diff --git a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c index b567955a3d..cf94761e89 100644 --- a/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c +++ b/src/nvector/manyvector/fmod_int32/fnvector_mpimanyvector_mod.c @@ -1151,6 +1151,20 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_MPIManyVector(N_Vector farg1, i +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -1163,5 +1177,6 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector fa fresult = result; return fresult; } +#endif diff --git a/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c b/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c index 3cd395bf66..2faf356f7c 100644 --- a/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c +++ b/src/nvector/manyvector/fmod_int64/fnvector_manyvector_mod.c @@ -991,6 +991,20 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_ManyVector(N_Vector farg1, int +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -1003,5 +1017,6 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1 fresult = result; return fresult; } +#endif diff --git a/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c b/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c index 2374d9a846..014692fc53 100644 --- a/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c +++ b/src/nvector/manyvector/fmod_int64/fnvector_mpimanyvector_mod.c @@ -1151,6 +1151,20 @@ SWIGEXPORT int _wrap_FN_VEnableDotProdMultiLocal_MPIManyVector(N_Vector farg1, i +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -1163,5 +1177,6 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector fa fresult = result; return fresult; } +#endif diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c index d506997738..43380cde1a 100644 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c @@ -484,6 +484,20 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -496,5 +510,6 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * fresult = result; return fresult; } +#endif diff --git a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c index 0a5bac84c8..750d4f3c7b 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c @@ -484,6 +484,20 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -496,5 +510,6 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * fresult = result; return fresult; } +#endif diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c index 7f6d3a1a4d..2e32706ed0 100644 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c @@ -414,6 +414,20 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -426,5 +440,6 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const fresult = result; return fresult; } +#endif diff --git a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c index 140e8d8d61..9b69f100cf 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c @@ -414,6 +414,20 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -426,5 +440,6 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const fresult = result; return fresult; } +#endif diff --git a/swig/nvector/fnvector_manyvector_mod.i b/swig/nvector/fnvector_manyvector_mod.i index 417197d0ef..60f0cf4f80 100644 --- a/swig/nvector/fnvector_manyvector_mod.i +++ b/swig/nvector/fnvector_manyvector_mod.i @@ -31,6 +31,20 @@ %include "nvector/nvector_manyvector.h" %insert("wrapper") %{ +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_ManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -43,6 +57,7 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_ManyVector(N_Vector farg1 fresult = result; return fresult; } +#endif %} %insert("fdecl") %{ diff --git a/swig/nvector/fnvector_mpimanyvector_mod.i b/swig/nvector/fnvector_mpimanyvector_mod.i index 71dbe86b05..ad376f44e3 100644 --- a/swig/nvector/fnvector_mpimanyvector_mod.i +++ b/swig/nvector/fnvector_mpimanyvector_mod.i @@ -31,6 +31,20 @@ %include "nvector/nvector_mpimanyvector.h" %insert("wrapper") %{ +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int32_t const *farg2) { + double * fresult ; + N_Vector arg1 = (N_Vector) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (N_Vector)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)N_VGetSubvectorArrayPointer_MPIManyVector(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector farg1, int64_t const *farg2) { double * fresult ; N_Vector arg1 = (N_Vector) 0 ; @@ -43,6 +57,7 @@ SWIGEXPORT double * _wrap_FN_VGetSubvectorArrayPointer_MPIManyVector(N_Vector fa fresult = result; return fresult; } +#endif %} %insert("fdecl") %{ diff --git a/swig/sunmatrix/fsunmatrix_band_mod.i b/swig/sunmatrix/fsunmatrix_band_mod.i index 11e468608a..c6c37e8bb3 100644 --- a/swig/sunmatrix/fsunmatrix_band_mod.i +++ b/swig/sunmatrix/fsunmatrix_band_mod.i @@ -45,6 +45,20 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNBandMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -57,6 +71,7 @@ SWIGEXPORT double * _wrap_FSUNBandMatrix_Column(SUNMatrix farg1, int64_t const * fresult = result; return fresult; } +#endif %} %insert("fdecl") %{ diff --git a/swig/sunmatrix/fsunmatrix_dense_mod.i b/swig/sunmatrix/fsunmatrix_dense_mod.i index 572922617c..c6123ab32d 100644 --- a/swig/sunmatrix/fsunmatrix_dense_mod.i +++ b/swig/sunmatrix/fsunmatrix_dense_mod.i @@ -45,6 +45,20 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Data(SUNMatrix farg1) { return fresult; } +#ifdef SUNDIALS_INT32_T +SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int32_t const *farg2) { + double * fresult ; + SUNMatrix arg1 = (SUNMatrix) 0 ; + sunindextype arg2 ; + sunrealtype *result = 0 ; + + arg1 = (SUNMatrix)(farg1); + arg2 = (sunindextype)(*farg2); + result = (sunrealtype *)SUNDenseMatrix_Column(arg1,arg2); + fresult = result; + return fresult; +} +#else SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const *farg2) { double * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; @@ -57,6 +71,7 @@ SWIGEXPORT double * _wrap_FSUNDenseMatrix_Column(SUNMatrix farg1, int64_t const fresult = result; return fresult; } +#endif %} %insert("fdecl") %{ From 32156b408b3aad6c4a86f2c03eeb172a038875b6 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 10:36:01 -0800 Subject: [PATCH 131/137] Bugfix: Rootfinding with Fixed Step Size (#614) Fix a bug when enabling rootfinding with fixed step sizes and the initial value of the rootfinding function is zero. In this case, uninitialized right-hand side data (`fn`) is used to compute a forward Euler step to get a state near the initial condition to determine if any rootfinding functions are active at the initial condition. --- CHANGELOG.md | 5 ++++ doc/shared/RecentChanges.rst | 5 ++++ ..._--count-orbits_--use-compensated-sums.out | 4 +-- src/arkode/arkode.c | 8 +----- src/arkode/arkode_root.c | 28 +++++++++++++++++-- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b7e5fa6df..f12076ec7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,11 @@ provided. Fixed the loading of ARKStep's default first order explicit method. +Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the +initial value of the rootfinding function is zero. In this case, uninitialized +right-hand side data was used to compute a state value near the initial +condition to determine if any rootfinding functions are initially active. + Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated `CUDA_ARCH` option was used. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 1ade86691b..8fd709f423 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -90,6 +90,11 @@ of ``0`` was provided. Fixed the loading of ARKStep's default first order explicit method. +Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the +initial value of the rootfinding function is zero. In this case, uninitialized +right-hand side data was used to compute a state value near the initial +condition to determine if any rootfinding functions are initially active. + Fixed a CMake bug regarding usage of missing "print_warning" macro that was only triggered when the deprecated ``CUDA_ARCH`` option was used. 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 f9b0aca194..d8d0a63fe6 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 = 10280 -f1 RHS fn evals = 40031 -f2 RHS fn evals = 40031 +f1 RHS fn evals = 40032 +f2 RHS fn evals = 40032 diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 099e2e361c..1a952f0bc6 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -2138,13 +2138,7 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) if (ark_mem->root_mem->nrtfn > 0) { retval = arkRootCheck1((void*)ark_mem); - - if (retval == ARK_RTFUNC_FAIL) - { - arkProcessError(ark_mem, ARK_RTFUNC_FAIL, __LINE__, __func__, __FILE__, - MSG_ARK_RTFUNC_FAILED, ark_mem->tcur); - return (ARK_RTFUNC_FAIL); - } + if (retval != ARK_SUCCESS) { return retval; } } } diff --git a/src/arkode/arkode_root.c b/src/arkode/arkode_root.c index 05d0a4a08c..1ccdf8aa2d 100644 --- a/src/arkode/arkode_root.c +++ b/src/arkode/arkode_root.c @@ -434,7 +434,12 @@ int arkRootCheck1(void* arkode_mem) retval = rootmem->gfun(rootmem->tlo, ark_mem->yn, rootmem->glo, rootmem->root_data); rootmem->nge = 1; - if (retval != 0) { return (ARK_RTFUNC_FAIL); } + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RTFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RTFUNC_FAILED, ark_mem->tcur); + return (ARK_RTFUNC_FAIL); + } zroot = SUNFALSE; for (i = 0; i < rootmem->nrtfn; i++) @@ -447,6 +452,20 @@ int arkRootCheck1(void* arkode_mem) } if (!zroot) { return (ARK_SUCCESS); } + /* call full RHS if needed */ + 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) + { + arkProcessError(ark_mem, ARK_RHSFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RHSFUNC_FAILED, ark_mem->tcur); + return ARK_RHSFUNC_FAIL; + } + ark_mem->fn_is_current = SUNTRUE; + } + /* Some g_i is zero at t0; look at g at t0+(small increment). */ hratio = SUNMAX(rootmem->ttol / SUNRabs(ark_mem->h), TENTH); smallh = hratio * ark_mem->h; @@ -454,7 +473,12 @@ int arkRootCheck1(void* arkode_mem) N_VLinearSum(ONE, ark_mem->yn, smallh, ark_mem->fn, ark_mem->ycur); retval = rootmem->gfun(tplus, ark_mem->ycur, rootmem->ghi, rootmem->root_data); rootmem->nge++; - if (retval != 0) { return (ARK_RTFUNC_FAIL); } + if (retval != 0) + { + arkProcessError(ark_mem, ARK_RTFUNC_FAIL, __LINE__, __func__, __FILE__, + MSG_ARK_RTFUNC_FAILED, ark_mem->tcur); + return (ARK_RTFUNC_FAIL); + } /* We check now only the components of g which were exactly 0.0 at t0 * to see if we can 'activate' them. */ From 0d43b7a4495864b82c8014365c9870bf723c02c7 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 11:02:28 -0800 Subject: [PATCH 132/137] Bugfix: Dissipated Entropy Example (#613) Fix dissipated entropy example: * Vector and matrix size * Initial condition * Answer function --------- Co-authored-by: Cody Balos <balos1@llnl.gov> --- .../C_serial/ark_dissipated_exp_entropy.c | 9 +- .../ark_dissipated_exp_entropy_1_0.out | 19 ++--- .../ark_dissipated_exp_entropy_1_1.out | 83 ++++++++++--------- test/answers | 2 +- 4 files changed, 56 insertions(+), 57 deletions(-) diff --git a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c index 1b7dc0ad38..35de91fff0 100644 --- a/examples/arkode/C_serial/ark_dissipated_exp_entropy.c +++ b/examples/arkode/C_serial/ark_dissipated_exp_entropy.c @@ -174,14 +174,13 @@ int main(int argc, char* argv[]) if (check_flag(flag, "SUNContext_Create")) { return 1; } /* Create serial vector and set the initial condition values */ - y = N_VNew_Serial(2, ctx); + y = N_VNew_Serial(1, ctx); if (check_ptr(y, "N_VNew_Serial")) { return 1; } ydata = N_VGetArrayPointer(y); if (check_ptr(ydata, "N_VGetArrayPointer")) { return 1; } - ydata[0] = SUN_RCONST(1.0); - ydata[1] = SUN_RCONST(0.5); + ydata[0] = SUN_RCONST(0.5); ytrue = N_VClone(y); if (check_ptr(ytrue, "N_VClone")) { return 1; } @@ -208,7 +207,7 @@ int main(int argc, char* argv[]) if (implicit) { /* Create dense matrix and linear solver */ - A = SUNDenseMatrix(2, 2, ctx); + A = SUNDenseMatrix(1, 1, ctx); if (check_ptr(A, "SUNDenseMatrix")) { return 1; } LS = SUNLinSol_Dense(y, A, ctx); @@ -445,7 +444,7 @@ int JacEnt(N_Vector y, N_Vector J, void* user_data) int ans(sunrealtype t, N_Vector y) { sunrealtype* ydata = N_VGetArrayPointer(y); - ydata[0] = LOG(EXP(SUN_RCONST(-0.5)) + t); + ydata[0] = -LOG(EXP(SUN_RCONST(-0.5)) + t); return 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 35872dff8b..409930257c 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 @@ -7,20 +7,19 @@ 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 4.675332e-01 1.798296e-01 1.197013e+00 1.083801e-01 -1.521269e+00 - 80 1.147092e+00 -4.153968e-01 6.600783e-01 -9.770808e-01 -2.058204e+00 - 120 3.654055e+00 -1.391763e+00 2.486366e-01 -2.841170e+00 -2.469645e+00 + 0 0.000000e+00 5.000000e-01 1.648721e+00 0.000000e+00 0.000000e+00 + 40 5.092477e-01 -1.095523e-01 8.962353e-01 2.657564e-09 -7.524860e-01 + 80 1.755130e+00 -8.593651e-01 4.234308e-01 5.763892e-09 -1.225290e+00 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 130 (attempted = 130) - Total number of error test failures = 0 - Total RHS evals: Fe = 652, Fi = 0 - Total Relaxation Fn evals = 391 - Total Relaxation Jac evals = 781 + Internal solver steps = 116 (attempted = 118) + Total number of error test failures = 2 + Total RHS evals: Fe = 590, Fi = 0 + Total Relaxation Fn evals = 353 + Total Relaxation Jac evals = 707 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 131 + Total Relaxation NLS iters = 117 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 d10cdad5ac..c2ecfea762 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 @@ -7,53 +7,54 @@ 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.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.668375e-02 9.639809e-01 -2.804267e-01 -1.754301e+00 - 640 7.021782e-01 -6.771234e-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.007408e-01 -1.558236e-01 8.557101e-01 -4.974763e-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.510008e-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.525717e-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.724955e-01 4.618590e-01 -1.649552e+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.583416e-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 + 0 0.000000e+00 5.000000e-01 1.648721e+00 0.000000e+00 0.000000e+00 + 40 5.415674e-02 4.144745e-01 1.513575e+00 4.128002e-08 -1.351461e-01 + 80 1.081866e-01 3.358683e-01 1.399155e+00 6.309560e-08 -2.495665e-01 + 120 1.608974e-01 2.647106e-01 1.303054e+00 7.765270e-08 -3.456674e-01 + 160 2.124232e-01 1.997276e-01 1.221070e+00 8.845053e-08 -4.276512e-01 + 200 2.628598e-01 1.399630e-01 1.150231e+00 9.362293e-08 -4.984900e-01 + 240 3.084856e-01 8.881351e-02 1.092877e+00 7.376738e-08 -5.558444e-01 + 280 3.455218e-01 4.913523e-02 1.050362e+00 6.221645e-08 -5.983589e-01 + 320 3.727057e-01 2.098228e-02 1.021204e+00 5.764933e-08 -6.275173e-01 + 360 3.890271e-01 4.452145e-03 1.004462e+00 5.523737e-08 -6.442592e-01 + 400 3.941524e-01 -6.827931e-04 9.993174e-01 5.497047e-08 -6.494038e-01 + 440 4.005241e-01 -7.029981e-03 9.929947e-01 5.474605e-08 -6.557266e-01 + 480 4.140846e-01 -2.040562e-02 9.798012e-01 5.453027e-08 -6.689201e-01 + 520 4.345895e-01 -4.029720e-02 9.605039e-01 5.467294e-08 -6.882173e-01 + 560 4.626231e-01 -6.686741e-02 9.353192e-01 5.520839e-08 -7.134021e-01 + 600 4.973590e-01 -9.883992e-02 9.058877e-01 5.899048e-08 -7.428336e-01 + 640 5.432713e-01 -1.395897e-01 8.697150e-01 6.097036e-08 -7.790062e-01 + 680 5.987904e-01 -1.867459e-01 8.296545e-01 6.604792e-08 -8.190667e-01 + 720 6.615702e-01 -2.375203e-01 7.885809e-01 7.096595e-08 -8.601404e-01 + 760 7.441152e-01 -3.005828e-01 7.403866e-01 8.639873e-08 -9.083347e-01 + 800 8.291615e-01 -3.616470e-01 6.965282e-01 9.435878e-08 -9.521931e-01 + 840 9.468128e-01 -4.404095e-01 6.437727e-01 1.147833e-07 -1.004949e+00 + 880 1.069867e+00 -5.166468e-01 5.965174e-01 1.384619e-07 -1.052204e+00 + 920 1.227474e+00 -6.065017e-01 5.452550e-01 1.625221e-07 -1.103466e+00 + 960 1.404582e+00 -6.986879e-01 4.972373e-01 1.907560e-07 -1.151484e+00 + 1000 1.614505e+00 -7.979735e-01 4.502405e-01 2.176350e-07 -1.198481e+00 + 1040 1.872242e+00 -9.077633e-01 4.034256e-01 2.731687e-07 -1.245296e+00 + 1080 2.149170e+00 -1.013671e+00 3.628843e-01 2.957052e-07 -1.285837e+00 + 1120 2.524196e+00 -1.141265e+00 3.194148e-01 3.419873e-07 -1.329306e+00 + 1160 2.940656e+00 -1.266154e+00 2.819137e-01 4.138031e-07 -1.366808e+00 + 1200 3.435286e+00 -1.396694e+00 2.474136e-01 4.319564e-07 -1.401308e+00 + 1240 4.068492e+00 -1.542234e+00 2.139028e-01 4.695475e-07 -1.434818e+00 + 1280 4.793715e+00 -1.686444e+00 1.851769e-01 5.328542e-07 -1.463544e+00 ------------------------------------------------------------------------------- Final Solver Statistics: - Internal solver steps = 1245 (attempted = 1246) + Internal solver steps = 1290 (attempted = 1291) 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: Fe = 0, Fi = 11269 + Total number of Newton iterations = 7395 + Total number of linear solver convergence failures = 119 + Total linear solver setups = 190 + Total number of Jacobian evaluations = 134 Total RHS evals for setting up the linear system = 0 - Total Relaxation Fn evals = 4401 - Total Relaxation Jac evals = 5647 + Total Relaxation Fn evals = 4371 + Total Relaxation Jac evals = 5662 Total Relaxation fails = 0 Total Relaxation bound fails = 0 Total Relaxation NLS fails = 0 - Total Relaxation NLS iters = 1909 + Total Relaxation NLS iters = 1789 diff --git a/test/answers b/test/answers index 6c8ba5d077..a5e4ab70cb 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit 6c8ba5d07756970fa1695c7d71bdd329147f0f26 +Subproject commit a5e4ab70cbddac437d97a8f08018b22331eff555 From 8028e9e1166e70f9717d30d42ebc86bf689409b4 Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Mon, 9 Dec 2024 14:25:57 -0800 Subject: [PATCH 133/137] CI: Address sanitizer (#612) Add test without TPLs to run CI with the address sanitizer enabled --------- Co-authored-by: Cody Balos <balos1@llnl.gov> --- .github/actions/test-driver/action.yml | 10 +++- .github/workflows/test-address-sanitizer.yml | 59 ++++++++++++++++++++ .github/workflows/ubuntu-latest.yml | 2 + test/test_driver.sh | 30 +++++++--- 4 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-address-sanitizer.yml diff --git a/.github/actions/test-driver/action.yml b/.github/actions/test-driver/action.yml index f56126095e..47c0fab83f 100644 --- a/.github/actions/test-driver/action.yml +++ b/.github/actions/test-driver/action.yml @@ -8,6 +8,9 @@ inputs: indexsize: description: SUNDIALS_INDEX_SIZE required: true + tpls: + description: "enable/disable TPLs" + required: true runs: using: composite @@ -26,5 +29,10 @@ runs: run: | git config --global --add safe.directory $GITHUB_WORKSPACE cd test - ./test_driver.sh --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${{ inputs.precision }} --indexsize ${{ inputs.indexsize }} + ./test_driver.sh \ + --testtype CUSTOM \ + --env env/docker.sh \ + --tpls ${{ inputs.tpls }} \ + --sunrealtype ${{ inputs.precision }} \ + --indexsize ${{ inputs.indexsize }} shell: bash diff --git a/.github/workflows/test-address-sanitizer.yml b/.github/workflows/test-address-sanitizer.yml new file mode 100644 index 0000000000..bb2aa80324 --- /dev/null +++ b/.github/workflows/test-address-sanitizer.yml @@ -0,0 +1,59 @@ +# +name: Build and Test - Ubuntu/gcc (Address Sanitizer) + +on: + push: + branches: + - main + - develop + pull_request: + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +jobs: + sanitizer_build_and_test: + runs-on: ubuntu-latest + container: + image: ghcr.io/llnl/sundials-ci-int${{ matrix.indexsize }}-${{ matrix.precision }}:latest + options: --user root + strategy: + max-parallel: 2 + matrix: + indexsize: [32, 64] + precision: ['double'] + buildtype: ['Debug'] + # Address sanitizer is enabled in test_driver.sh with TPLs OFF + tpls: ['OFF'] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + - name: Run test_driver.sh + uses: ./.github/actions/test-driver + with: + indexsize: ${{ matrix.indexsize }} + precision: ${{ matrix.precision }} + tpls: ${{ matrix.tpls }} + env: + CMAKE_BUILD_TYPE: ${{ matrix.buildtype }} + - name: Archive build files from failed build + uses: actions/upload-artifact@v4 + if: failure() + with: + name: build_files + path: | + ${{ github.workspace }}/test/build_* + !${{ github.workspace }}/test/build_*/Testing/output + - name: Archive output files from failed build + uses: actions/upload-artifact@v4 + if: failure() + with: + name: output_files + path: | + ${{ github.workspace }}/test/build_*/Testing/ diff --git a/.github/workflows/ubuntu-latest.yml b/.github/workflows/ubuntu-latest.yml index 9b83c16c30..c63b2125be 100644 --- a/.github/workflows/ubuntu-latest.yml +++ b/.github/workflows/ubuntu-latest.yml @@ -27,6 +27,7 @@ jobs: # Disable extended tests until compiler warnings are addressed precision: ['single', 'double'] buildtype: ['Debug', 'Release', 'RelWithDebInfo'] + tpls: ['ON'] exclude: - buildtype: Debug precision: single @@ -49,6 +50,7 @@ jobs: with: indexsize: ${{ matrix.indexsize }} precision: ${{ matrix.precision }} + tpls: ${{ matrix.tpls }} env: CMAKE_BUILD_TYPE: ${{ matrix.buildtype }} - name: Archive build files from failed build diff --git a/test/test_driver.sh b/test/test_driver.sh index 4faee8b8ea..8e70c7aad6 100755 --- a/test/test_driver.sh +++ b/test/test_driver.sh @@ -64,7 +64,7 @@ help () all -- create all possible tarballs --sunrealtype TYPE - Real type precision to use in a custom test. TYPE must be one of: + Precision to use in a custom test. TYPE must be one of: double -- (default) use double precision single -- use single precision @@ -83,8 +83,8 @@ help () shared -- build shared libraries both -- build static and shared libraries - --tpls - Enable external third-party libraries in a custom test. + --tpls ON/OFF + Enable or disable external third-party libraries in a custom test. --suntesttype TYPE SUNDIALS test type for a custom test. TYPE must be one of: @@ -126,7 +126,7 @@ help () $0 $0 --testtype release --buildjobs 4 - $0 --phase CONFIG --indexsize 32 --tpls --env env/default.sh + $0 --phase CONFIG --indexsize 32 --tpls ON --env env/default.sh EOF } @@ -270,8 +270,20 @@ while [[ $# -gt 0 ]]; do shift 2;; --tpls) - tpls="ON" - shift;; + tpls=$2 + case "$tpls" in + ON|On|on) + tpls=ON + ;; + OFF|Off|off) + tpls=OFF + ;; + *) + echo "ERROR: Invalid tpl option $tpl" + help + exit 1;; + esac + shift 2;; --suntesttype) suntesttype=$2 @@ -384,7 +396,7 @@ case "$testtype" in args_libtypes+=("static") args_tpls+=("OFF") args_suntests+=("DEV") - args_phase+=("BUILD") + args_phase+=("TEST") done # Basic development tests @@ -409,7 +421,7 @@ case "$testtype" in args_libtypes+=("static") args_tpls+=("OFF") args_suntests+=("DEV") - args_phase+=("BUILD") + args_phase+=("TEST") done # More development tests @@ -441,7 +453,7 @@ case "$testtype" in args_libtypes+=("static") args_tpls+=("OFF") args_suntests+=("DEV") - args_phase+=("BUILD") + args_phase+=("TEST") done # Even more development tests From 91ef8068a829946426cca6582c619cc72d3c9e4c Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 10 Dec 2024 12:15:41 -0800 Subject: [PATCH 134/137] Maintenance: Rename set function (#618) Update set function name to be consistent with `SetNum` naming convention --- .../guide/source/Usage/LSRKStep/User_callable.rst | 6 +++--- examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp | 4 ++-- examples/arkode/C_serial/ark_analytic_ssprk.c | 4 ++-- include/arkode/arkode_lsrkstep.h | 2 +- src/arkode/arkode_lsrkstep_io.c | 4 ++-- src/arkode/fmod_int32/farkode_lsrkstep_mod.c | 4 ++-- src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 | 10 +++++----- src/arkode/fmod_int64/farkode_lsrkstep_mod.c | 4 ++-- src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 | 10 +++++----- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst index 0f9d53f581..f59296229a 100644 --- a/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/LSRKStep/User_callable.rst @@ -245,7 +245,7 @@ Allowable Method Families set to :math:`1.01`. Calling this function with ``dom_eig_safety < 1`` resets the default value. -.. c:function:: int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages); +.. c:function:: int LSRKStepSetNumSSPStages(void* arkode_mem, int num_of_stages); Sets the number of stages, ``s`` in ``SSP(s, p)`` methods. This input is only utilized by SSPRK methods. @@ -262,7 +262,7 @@ Allowable Method Families * *ARKLS_MEM_NULL* if ``arkode_mem`` was ``NULL``. * *ARK_ILL_INPUT* if an argument had an illegal value (e.g. SSP method is not declared) -.. note:: If LSRKStepSetSSPStageNum routine is not called, then the default ``num_of_stages`` is +.. note:: If LSRKStepSetNumSSPStages routine is not called, then the default ``num_of_stages`` is set. Calling this function with ``num_of_stages <= 0`` resets the default values: * ``num_of_stages = 10`` for :c:enumerator:`ARKODE_LSRK_SSP_S_2` @@ -390,4 +390,4 @@ dependent variable vector. the appropriate "Set" functions. If an error occurred, :c:func:`LSRKStepReInitSSP()` also - sends an error message to the error handler function. \ No newline at end of file + sends an error message to the error handler function. diff --git a/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp b/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp index 2813b150bf..f78f0c5e36 100644 --- a/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp +++ b/examples/arkode/CXX_manyvector/ark_sod_lsrk.cpp @@ -112,8 +112,8 @@ int main(int argc, char* argv[]) // Select number of SSPRK stages if (uopts.stages > 0) { - flag = LSRKStepSetSSPStageNum(arkode_mem, uopts.stages); - if (check_flag(flag, "LSRKStepSetSSPStageNum")) { return 1; } + flag = LSRKStepSetNumSSPStages(arkode_mem, uopts.stages); + if (check_flag(flag, "LSRKStepSetNumSSPStages")) { return 1; } } } else diff --git a/examples/arkode/C_serial/ark_analytic_ssprk.c b/examples/arkode/C_serial/ark_analytic_ssprk.c index c0f611f999..ffaf937827 100644 --- a/examples/arkode/C_serial/ark_analytic_ssprk.c +++ b/examples/arkode/C_serial/ark_analytic_ssprk.c @@ -133,8 +133,8 @@ int main(void) if (check_flag(&flag, "LSRKStepSetSSPMethod", 1)) { return 1; } /* Specify the SSP number of stages */ - flag = LSRKStepSetSSPStageNum(arkode_mem, 9); - if (check_flag(&flag, "LSRKStepSetSSPStageNum", 1)) { return 1; } + flag = LSRKStepSetNumSSPStages(arkode_mem, 9); + if (check_flag(&flag, "LSRKStepSetNumSSPStages", 1)) { return 1; } /* Open output stream for results, output comment line */ UFID = fopen("solution.txt", "w"); diff --git a/include/arkode/arkode_lsrkstep.h b/include/arkode/arkode_lsrkstep.h index 1f3c281233..6b88fa69f9 100644 --- a/include/arkode/arkode_lsrkstep.h +++ b/include/arkode/arkode_lsrkstep.h @@ -83,7 +83,7 @@ SUNDIALS_EXPORT int LSRKStepSetMaxNumStages(void* arkode_mem, SUNDIALS_EXPORT int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety); -SUNDIALS_EXPORT int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages); +SUNDIALS_EXPORT int LSRKStepSetNumSSPStages(void* arkode_mem, int num_of_stages); /* Optional output functions */ diff --git a/src/arkode/arkode_lsrkstep_io.c b/src/arkode/arkode_lsrkstep_io.c index a80df94efe..af8ccfaa3c 100644 --- a/src/arkode/arkode_lsrkstep_io.c +++ b/src/arkode/arkode_lsrkstep_io.c @@ -320,7 +320,7 @@ int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety) } /*--------------------------------------------------------------- - LSRKStepSetSSPStageNum sets the number of stages in the following + LSRKStepSetNumSSPStages sets the number of stages in the following SSP methods: ARKODE_LSRK_SSP_S_2 -- num_of_stages must be greater than or equal to 2 @@ -332,7 +332,7 @@ int LSRKStepSetDomEigSafetyFactor(void* arkode_mem, sunrealtype dom_eig_safety) Calling this function with num_of_stages =< 0 resets the default value. ---------------------------------------------------------------*/ -int LSRKStepSetSSPStageNum(void* arkode_mem, int num_of_stages) +int LSRKStepSetNumSSPStages(void* arkode_mem, int num_of_stages) { ARKodeMem ark_mem; ARKodeLSRKStepMem step_mem; diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.c b/src/arkode/fmod_int32/farkode_lsrkstep_mod.c index 6bd21a6cca..2924e2ad83 100644 --- a/src/arkode/fmod_int32/farkode_lsrkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.c @@ -414,7 +414,7 @@ SWIGEXPORT int _wrap_FLSRKStepSetDomEigSafetyFactor(void *farg1, double const *f } -SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FLSRKStepSetNumSSPStages(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -422,7 +422,7 @@ SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)LSRKStepSetSSPStageNum(arg1,arg2); + result = (int)LSRKStepSetNumSSPStages(arg1,arg2); fresult = (int)(result); return fresult; } diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 index b00334f720..42f847d80d 100644 --- a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 @@ -52,7 +52,7 @@ module farkode_lsrkstep_mod public :: FLSRKStepSetDomEigFrequency public :: FLSRKStepSetMaxNumStages public :: FLSRKStepSetDomEigSafetyFactor - public :: FLSRKStepSetSSPStageNum + public :: FLSRKStepSetNumSSPStages public :: FLSRKStepGetNumDomEigUpdates public :: FLSRKStepGetMaxNumStages @@ -176,8 +176,8 @@ function swigc_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FLSRKStepSetSSPStageNum(farg1, farg2) & -bind(C, name="_wrap_FLSRKStepSetSSPStageNum") & +function swigc_FLSRKStepSetNumSSPStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetNumSSPStages") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -444,7 +444,7 @@ function FLSRKStepSetDomEigSafetyFactor(arkode_mem, dom_eig_safety) & swig_result = fresult end function -function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & +function FLSRKStepSetNumSSPStages(arkode_mem, num_of_stages) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result @@ -456,7 +456,7 @@ function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & farg1 = arkode_mem farg2 = num_of_stages -fresult = swigc_FLSRKStepSetSSPStageNum(farg1, farg2) +fresult = swigc_FLSRKStepSetNumSSPStages(farg1, farg2) swig_result = fresult end function diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.c b/src/arkode/fmod_int64/farkode_lsrkstep_mod.c index 6bd21a6cca..2924e2ad83 100644 --- a/src/arkode/fmod_int64/farkode_lsrkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.c @@ -414,7 +414,7 @@ SWIGEXPORT int _wrap_FLSRKStepSetDomEigSafetyFactor(void *farg1, double const *f } -SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { +SWIGEXPORT int _wrap_FLSRKStepSetNumSSPStages(void *farg1, int const *farg2) { int fresult ; void *arg1 = (void *) 0 ; int arg2 ; @@ -422,7 +422,7 @@ SWIGEXPORT int _wrap_FLSRKStepSetSSPStageNum(void *farg1, int const *farg2) { arg1 = (void *)(farg1); arg2 = (int)(*farg2); - result = (int)LSRKStepSetSSPStageNum(arg1,arg2); + result = (int)LSRKStepSetNumSSPStages(arg1,arg2); fresult = (int)(result); return fresult; } diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 index b00334f720..42f847d80d 100644 --- a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 @@ -52,7 +52,7 @@ module farkode_lsrkstep_mod public :: FLSRKStepSetDomEigFrequency public :: FLSRKStepSetMaxNumStages public :: FLSRKStepSetDomEigSafetyFactor - public :: FLSRKStepSetSSPStageNum + public :: FLSRKStepSetNumSSPStages public :: FLSRKStepGetNumDomEigUpdates public :: FLSRKStepGetMaxNumStages @@ -176,8 +176,8 @@ function swigc_FLSRKStepSetDomEigSafetyFactor(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FLSRKStepSetSSPStageNum(farg1, farg2) & -bind(C, name="_wrap_FLSRKStepSetSSPStageNum") & +function swigc_FLSRKStepSetNumSSPStages(farg1, farg2) & +bind(C, name="_wrap_FLSRKStepSetNumSSPStages") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -444,7 +444,7 @@ function FLSRKStepSetDomEigSafetyFactor(arkode_mem, dom_eig_safety) & swig_result = fresult end function -function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & +function FLSRKStepSetNumSSPStages(arkode_mem, num_of_stages) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result @@ -456,7 +456,7 @@ function FLSRKStepSetSSPStageNum(arkode_mem, num_of_stages) & farg1 = arkode_mem farg2 = num_of_stages -fresult = swigc_FLSRKStepSetSSPStageNum(farg1, farg2) +fresult = swigc_FLSRKStepSetNumSSPStages(farg1, farg2) swig_result = fresult end function From 175fe69fbda717fbe969e56cecaadd768830c173 Mon Sep 17 00:00:00 2001 From: Cody Balos <balos1@llnl.gov> Date: Tue, 10 Dec 2024 15:30:14 -0800 Subject: [PATCH 135/137] Bugfix: SYCL vector compilation with oneapi 2025 (#617) Fix SYCL vector build with 2025 oneAPI compilers. Fix for #596 --------- Co-authored-by: David Gardner <gardner48@llnl.gov> --- .github/workflows/ubuntu-latest-oneapi.yml | 45 +++++++++++++++++++ CHANGELOG.md | 3 ++ doc/shared/RecentChanges.rst | 3 ++ .../cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp | 12 ++--- include/nvector/nvector_sycl.h | 2 +- include/sundials/sundials_sycl_policies.hpp | 16 ++++--- src/nvector/sycl/nvector_sycl.cpp | 30 ++++++------- 7 files changed, 83 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/ubuntu-latest-oneapi.yml diff --git a/.github/workflows/ubuntu-latest-oneapi.yml b/.github/workflows/ubuntu-latest-oneapi.yml new file mode 100644 index 0000000000..bebd04efad --- /dev/null +++ b/.github/workflows/ubuntu-latest-oneapi.yml @@ -0,0 +1,45 @@ +name: Build - Ubuntu/dpcpp + +on: + pull_request: + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + strategy: + matrix: + ONEAPI_VERSION: [ + '2024.2.1-0-devel-ubuntu22.04', + 'latest' # 2025.0.0-0-devel-ubuntu24.04 at the time of commit + ] + + runs-on: ubuntu-latest + container: intel/oneapi-basekit:${{ matrix.ONEAPI_VERSION }} + + steps: + - uses: actions/checkout@v4 + + - name: Configure CMake + run: | + cmake \ + -B ${{github.workspace}}/build \ + -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -D CMAKE_C_COMPILER=$(which icx) \ + -D CMAKE_CXX_COMPILER=$(which icpx) \ + -D CMAKE_CXX_FLAGS="-fsycl" \ + -D SUNDIALS_BUILD_WITH_PROFILING=ON \ + -D ENABLE_ALL_WARNINGS=ON \ + -D ENABLE_WARNINGS_AS_ERRORS=ON \ + -D ENABLE_SYCL=ON + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} diff --git a/CHANGELOG.md b/CHANGELOG.md index f12076ec7f..6d7a947422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,9 @@ inner stepper object, `ARKodeCreateMRIStepInnerStepper`. ### Bug Fixes +Fixed a build failure with the SYCL NVector when using Intel oneAPI 2025.0 +compilers. See GitHub Issue [#596](https://github.com/LLNL/sundials/issues/596). + Fixed a bug where `CVodeSetProjFailEta` would ignore the `eta` parameter. Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 8fd709f423..ce0a252848 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -75,6 +75,9 @@ inner stepper object, :c:func:`ARKodeCreateMRIStepInnerStepper`. **Bug Fixes** +Fixed a build failure with the SYCL NVector when using Intel oneAPI 2025.0 +compilers. See GitHub Issue `#596 <https://github.com/LLNL/sundials/issues/596>`__. + Fixed a bug where :c:func:`CVodeSetProjFailEta` would ignore the `eta` parameter. diff --git a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp index 9997ad52d9..84718e9e54 100644 --- a/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp +++ b/examples/cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp @@ -248,9 +248,9 @@ static int f(sunrealtype t, N_Vector u, N_Vector udot, void* user_data) h.parallel_for(sycl::range{MX, MY}, [=](sycl::id<2> idx) { - sunindextype i = idx[0]; - sunindextype j = idx[1]; - sunindextype tid = i * MY + j; + size_t i = idx[0]; + size_t j = idx[1]; + size_t tid = i * MY + j; sunrealtype uij = udata[tid]; sunrealtype udn = (j == 0) ? ZERO : udata[tid - 1]; @@ -293,9 +293,9 @@ static int jtv(N_Vector v, N_Vector Jv, sunrealtype t, N_Vector u, N_Vector fu, h.parallel_for(sycl::range{MX, MY}, [=](sycl::id<2> idx) { - sunindextype i = idx[0]; - sunindextype j = idx[1]; - sunindextype tid = i * MY + j; + size_t i = idx[0]; + size_t j = idx[1]; + size_t tid = i * MY + j; // set the tid-th element of Jv Jvdata[tid] = -TWO * (verdc + hordc) * vdata[tid]; diff --git a/include/nvector/nvector_sycl.h b/include/nvector/nvector_sycl.h index 82935ccca6..11613cabfb 100644 --- a/include/nvector/nvector_sycl.h +++ b/include/nvector/nvector_sycl.h @@ -105,7 +105,7 @@ static inline sunrealtype* N_VGetDeviceArrayPointer_Sycl(N_Vector x) * NVECTOR API functions * ----------------------------------------------------------------- */ -static inline N_Vector_ID N_VGetVectorID_Sycl(N_Vector v) +static inline N_Vector_ID N_VGetVectorID_Sycl(N_Vector) { return SUNDIALS_NVEC_SYCL; } diff --git a/include/sundials/sundials_sycl_policies.hpp b/include/sundials/sundials_sycl_policies.hpp index db0a887bfa..cf9950f4f9 100644 --- a/include/sundials/sundials_sycl_policies.hpp +++ b/include/sundials/sundials_sycl_policies.hpp @@ -50,13 +50,14 @@ class ThreadDirectExecPolicy : public ExecPolicy : blockDim_(ex.blockDim_) {} - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const + virtual size_t gridSize(size_t numWorkUnits = 0, size_t /* blockDim */ = 0) const { /* ceil(n/m) = floor((n + m - 1) / m) */ return (numWorkUnits + blockSize() - 1) / blockSize(); } - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const + virtual size_t blockSize(size_t /* numWorkUnits */ = 0, + size_t /* gridDim */ = 0) const { return blockDim_; } @@ -86,12 +87,14 @@ class GridStrideExecPolicy : public ExecPolicy : blockDim_(ex.blockDim_), gridDim_(ex.gridDim_) {} - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const + virtual size_t gridSize(size_t /* numWorkUnits */ = 0, + size_t /* blockDim */ = 0) const { return gridDim_; } - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const + virtual size_t blockSize(size_t /* numWorkUnits */ = 0, + size_t /* gridDim */ = 0) const { return blockDim_; } @@ -124,7 +127,7 @@ class BlockReduceExecPolicy : public ExecPolicy : blockDim_(ex.blockDim_), gridDim_(ex.gridDim_) {} - virtual size_t gridSize(size_t numWorkUnits = 0, size_t blockDim = 0) const + virtual size_t gridSize(size_t numWorkUnits = 0, size_t /* blockDim */ = 0) const { if (gridDim_ == 0) { @@ -133,7 +136,8 @@ class BlockReduceExecPolicy : public ExecPolicy return gridDim_; } - virtual size_t blockSize(size_t numWorkUnits = 0, size_t gridDim = 0) const + virtual size_t blockSize(size_t /* numWorkUnits */ = 0, + size_t /* gridDim */ = 0) const { return blockDim_; } diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index 2f5b6a0a61..13d0155d55 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -1146,7 +1146,7 @@ sunrealtype N_VWrmsNorm_Sycl(N_Vector x, N_Vector w) { const sunindextype N = NVEC_SYCL_LENGTH(x); const sunrealtype sum = N_VWSqrSumLocal_Sycl(x, w); - return std::sqrt(sum / N); + return ::sycl::sqrt(sum / N); } sunrealtype N_VWSqrSumMaskLocal_Sycl(N_Vector x, N_Vector w, N_Vector id) @@ -1192,7 +1192,7 @@ sunrealtype N_VWrmsNormMask_Sycl(N_Vector x, N_Vector w, N_Vector id) { const sunindextype N = NVEC_SYCL_LENGTH(x); const sunrealtype sum = N_VWSqrSumMaskLocal_Sycl(x, w, id); - return std::sqrt(sum / N); + return ::sycl::sqrt(sum / N); } sunrealtype N_VMin_Sycl(N_Vector x) @@ -1233,7 +1233,7 @@ sunrealtype N_VMin_Sycl(N_Vector x) sunrealtype N_VWL2Norm_Sycl(N_Vector x, N_Vector w) { - return std::sqrt(N_VWSqrSumLocal_Sycl(x, w)); + return ::sycl::sqrt(N_VWSqrSumLocal_Sycl(x, w)); } sunrealtype N_VL1Norm_Sycl(N_Vector x) @@ -2285,14 +2285,14 @@ static int FusedBuffer_CopyRealArray(N_Vector v, sunrealtype* rdata, int nval, return SUN_ERR_GENERIC; } - sunrealtype* h_buffer = (sunrealtype*)((char*)(vcp->fused_buffer_host->ptr) + - vcp->fused_buffer_offset); + sunrealtype* h_buffer = reinterpret_cast<sunrealtype*>( + (char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nval; j++) { h_buffer[j] = rdata[j]; } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (sunrealtype*)((char*)(vcp->fused_buffer_dev->ptr) + - vcp->fused_buffer_offset); + *shortcut = reinterpret_cast<sunrealtype*>( + (char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); vcp->fused_buffer_offset += nval * sizeof(sunrealtype); @@ -2314,14 +2314,14 @@ static int FusedBuffer_CopyPtrArray1D(N_Vector v, N_Vector* X, int nvec, return SUN_ERR_GENERIC; } - sunrealtype** h_buffer = (sunrealtype**)((char*)(vcp->fused_buffer_host->ptr) + - vcp->fused_buffer_offset); + sunrealtype** h_buffer = reinterpret_cast<sunrealtype**>( + (char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) { h_buffer[j] = NVEC_SYCL_DDATAp(X[j]); } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (sunrealtype**)((char*)(vcp->fused_buffer_dev->ptr) + - vcp->fused_buffer_offset); + *shortcut = reinterpret_cast<sunrealtype**>( + (char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); vcp->fused_buffer_offset += nvec * sizeof(sunrealtype*); @@ -2342,8 +2342,8 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector** X, int nvec, return SUN_ERR_GENERIC; } - sunrealtype** h_buffer = (sunrealtype**)((char*)(vcp->fused_buffer_host->ptr) + - vcp->fused_buffer_offset); + sunrealtype** h_buffer = reinterpret_cast<sunrealtype**>( + (char*)(vcp->fused_buffer_host->ptr) + vcp->fused_buffer_offset); for (int j = 0; j < nvec; j++) { @@ -2354,8 +2354,8 @@ static int FusedBuffer_CopyPtrArray2D(N_Vector v, N_Vector** X, int nvec, } /* Set shortcut to the device buffer and update offset*/ - *shortcut = (sunrealtype**)((char*)(vcp->fused_buffer_dev->ptr) + - vcp->fused_buffer_offset); + *shortcut = reinterpret_cast<sunrealtype**>( + (char*)(vcp->fused_buffer_dev->ptr) + vcp->fused_buffer_offset); /* Update the offset */ vcp->fused_buffer_offset += nvec * nsum * sizeof(sunrealtype*); From 545db2ab5afd7f4b0f556503b461d318c2784c0f Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Tue, 10 Dec 2024 18:49:43 -0800 Subject: [PATCH 136/137] Feature: Logging Updates (#501) Follow on to utilities added in #499 * Make info logging output in the integrators more consistent * Update parser for MRI and operator splitting methods * Add function to extract lists of data for plotting * Add example scripts using log parser --------- Co-authored-by: Steven Roberts <roberts115@llnl.gov> Co-authored-by: Daniel R. Reynolds <reynolds@smu.edu> Co-authored-by: Cody Balos <balos1@llnl.gov> --- .cmake-format.py | 1 + .github/workflows/ubuntu-clang-latest.yml | 15 +- .gitignore | 3 + CHANGELOG.md | 6 + cmake/macros/SundialsAddTest.cmake | 18 +- .../source/Usage/ARKStep/User_callable.rst | 6 +- .../source/Usage/ERKStep/User_callable.rst | 6 +- .../source/Usage/MRIStep/User_callable.rst | 6 +- .../source/Usage/SPRKStep/User_callable.rst | 6 +- .../guide/source/Usage/User_callable.rst | 6 +- doc/cvode/guide/source/Usage/index.rst | 6 +- doc/cvodes/guide/source/Usage/SIM.rst | 6 +- doc/ida/guide/source/Usage/index.rst | 6 +- doc/idas/guide/source/Usage/SIM.rst | 6 +- doc/kinsol/guide/source/Usage/index.rst | 6 +- doc/shared/RecentChanges.rst | 6 + doc/shared/sundials/Logging.rst | 127 +- doc/shared/sundials/Types.rst | 6 +- doc/superbuild/source/developers/index.rst | 1 - .../developers/style_guide/Documentation.rst | 62 +- .../developers/style_guide/SourceCode.rst | 227 ++- .../source/developers/sundialsdev/index.rst | 23 - scripts/shared | 14 +- scripts/sundialsdev/logs.py | 120 -- scripts/tarscript | 14 +- src/arkode/arkode.c | 50 +- src/arkode/arkode_adapt.c | 19 +- src/arkode/arkode_arkstep.c | 257 +-- src/arkode/arkode_arkstep_nls.c | 16 +- src/arkode/arkode_erkstep.c | 84 +- src/arkode/arkode_forcingstep.c | 64 +- src/arkode/arkode_interp.c | 14 +- src/arkode/arkode_ls.c | 100 +- src/arkode/arkode_lsrkstep.c | 849 ++++---- src/arkode/arkode_mristep.c | 612 +++--- src/arkode/arkode_mristep_nls.c | 15 +- src/arkode/arkode_relaxation.c | 45 +- src/arkode/arkode_splittingstep.c | 97 +- src/arkode/arkode_sprkstep.c | 76 +- src/cvode/cvode.c | 83 +- src/cvode/cvode_ls.c | 54 +- src/cvodes/cvodes.c | 146 +- src/cvodes/cvodes_ls.c | 54 +- src/ida/ida.c | 130 +- src/ida/ida_ls.c | 43 +- src/idas/idas.c | 159 +- src/idas/idas_ls.c | 41 +- src/kinsol/kinsol.c | 75 +- src/kinsol/kinsol_impl.h | 36 +- src/kinsol/kinsol_ls.c | 4 +- src/sundials/sundials_logger_impl.h | 102 + src/sunlinsol/pcg/sunlinsol_pcg.c | 70 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 88 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 65 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 81 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 129 +- .../fixedpoint/sunnonlinsol_fixedpoint.c | 45 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 63 +- test/answers | 2 +- test/unit_tests/CMakeLists.txt | 1 + .../ida/CXX_serial/ida_test_kpr.cpp | 2 +- .../idas/CXX_serial/idas_test_kpr.cpp | 2 +- test/unit_tests/logging/CMakeLists.txt | 177 ++ .../logging/test_logging_arkode_arkstep.cpp | 224 ++ .../logging/test_logging_arkode_arkstep_0.out | 27 + .../test_logging_arkode_arkstep_1_0.out | 28 + .../test_logging_arkode_arkstep_1_1_0.out | 40 + .../test_logging_arkode_arkstep_1_1_1.out | 40 + .../test_logging_arkode_arkstep_2_0.out | 28 + .../test_logging_arkode_arkstep_2_1_0.out | 40 + .../test_logging_arkode_arkstep_2_1_1.out | 40 + .../test_logging_arkode_arkstep_lvl3_0.out | 69 + .../test_logging_arkode_arkstep_lvl3_1_0.out | 196 ++ ...test_logging_arkode_arkstep_lvl3_1_1_0.out | 382 ++++ ...test_logging_arkode_arkstep_lvl3_1_1_1.out | 257 +++ .../test_logging_arkode_arkstep_lvl3_2_0.out | 226 +++ ...test_logging_arkode_arkstep_lvl3_2_1_0.out | 412 ++++ ...test_logging_arkode_arkstep_lvl3_2_1_1.out | 263 +++ .../test_logging_arkode_arkstep_lvl4_0.out | 78 + .../test_logging_arkode_arkstep_lvl4_1_0.out | 205 ++ ...test_logging_arkode_arkstep_lvl4_1_1_0.out | 391 ++++ ...test_logging_arkode_arkstep_lvl4_1_1_1.out | 266 +++ .../test_logging_arkode_arkstep_lvl4_2_0.out | 235 +++ ...test_logging_arkode_arkstep_lvl4_2_1_0.out | 421 ++++ ...test_logging_arkode_arkstep_lvl4_2_1_1.out | 272 +++ .../test_logging_arkode_arkstep_lvl5_0.out | 258 +++ .../test_logging_arkode_arkstep_lvl5_1_0.out | 517 +++++ ...test_logging_arkode_arkstep_lvl5_1_1_0.out | 703 +++++++ ...test_logging_arkode_arkstep_lvl5_1_1_1.out | 578 ++++++ .../test_logging_arkode_arkstep_lvl5_2_0.out | 643 ++++++ ...test_logging_arkode_arkstep_lvl5_2_1_0.out | 829 ++++++++ ...test_logging_arkode_arkstep_lvl5_2_1_1.out | 680 +++++++ .../logging/test_logging_arkode_erkstep.cpp | 131 ++ .../logging/test_logging_arkode_erkstep.out | 21 + .../test_logging_arkode_erkstep_lvl3.out | 77 + .../test_logging_arkode_erkstep_lvl4.out | 89 + .../test_logging_arkode_erkstep_lvl5.out | 201 ++ .../test_logging_arkode_forcingstep.cpp | 162 ++ .../test_logging_arkode_forcingstep.out | 22 + .../test_logging_arkode_forcingstep_lvl3.out | 292 +++ .../test_logging_arkode_forcingstep_lvl4.out | 292 +++ .../test_logging_arkode_forcingstep_lvl5.out | 706 +++++++ .../logging/test_logging_arkode_lsrkstep.cpp | 164 ++ .../test_logging_arkode_lsrkstep_0.out | 26 + .../test_logging_arkode_lsrkstep_1.out | 26 + .../test_logging_arkode_lsrkstep_2.out | 22 + .../test_logging_arkode_lsrkstep_3.out | 22 + .../test_logging_arkode_lsrkstep_4.out | 22 + .../test_logging_arkode_lsrkstep_5.out | 22 + .../test_logging_arkode_lsrkstep_lvl3_0.out | 59 + .../test_logging_arkode_lsrkstep_lvl3_1.out | 59 + .../test_logging_arkode_lsrkstep_lvl3_2.out | 94 + .../test_logging_arkode_lsrkstep_lvl3_3.out | 94 + .../test_logging_arkode_lsrkstep_lvl3_4.out | 58 + .../test_logging_arkode_lsrkstep_lvl3_5.out | 94 + .../test_logging_arkode_lsrkstep_lvl4_0.out | 68 + .../test_logging_arkode_lsrkstep_lvl4_1.out | 68 + .../test_logging_arkode_lsrkstep_lvl4_2.out | 103 + .../test_logging_arkode_lsrkstep_lvl4_3.out | 103 + .../test_logging_arkode_lsrkstep_lvl4_4.out | 67 + .../test_logging_arkode_lsrkstep_lvl4_5.out | 103 + .../test_logging_arkode_lsrkstep_lvl5_0.out | 113 ++ .../test_logging_arkode_lsrkstep_lvl5_1.out | 113 ++ .../test_logging_arkode_lsrkstep_lvl5_2.out | 220 ++ .../test_logging_arkode_lsrkstep_lvl5_3.out | 211 ++ .../test_logging_arkode_lsrkstep_lvl5_4.out | 130 ++ .../test_logging_arkode_lsrkstep_lvl5_5.out | 220 ++ .../logging/test_logging_arkode_mristep.cpp | 317 +++ .../logging/test_logging_arkode_mristep_0.out | 28 + .../test_logging_arkode_mristep_1_0.out | 29 + .../test_logging_arkode_mristep_1_1_0.out | 41 + .../test_logging_arkode_mristep_1_1_1.out | 41 + .../test_logging_arkode_mristep_2_0.out | 29 + .../test_logging_arkode_mristep_2_1_0.out | 41 + .../test_logging_arkode_mristep_2_1_1.out | 41 + .../logging/test_logging_arkode_mristep_3.out | 28 + .../test_logging_arkode_mristep_4_0.out | 29 + .../test_logging_arkode_mristep_4_1_0.out | 41 + .../test_logging_arkode_mristep_4_1_1.out | 41 + .../test_logging_arkode_mristep_5_0.out | 29 + .../test_logging_arkode_mristep_5_1_0.out | 41 + .../test_logging_arkode_mristep_5_1_1.out | 41 + .../logging/test_logging_arkode_mristep_6.out | 28 + .../test_logging_arkode_mristep_lvl3_0.out | 272 +++ .../test_logging_arkode_mristep_lvl3_1_0.out | 378 ++++ ...test_logging_arkode_mristep_lvl3_1_1_0.out | 507 +++++ ...test_logging_arkode_mristep_lvl3_1_1_1.out | 411 ++++ .../test_logging_arkode_mristep_lvl3_2_0.out | 378 ++++ ...test_logging_arkode_mristep_lvl3_2_1_0.out | 507 +++++ ...test_logging_arkode_mristep_lvl3_2_1_1.out | 411 ++++ .../test_logging_arkode_mristep_lvl3_3.out | 300 +++ .../test_logging_arkode_mristep_lvl3_4_0.out | 382 ++++ ...test_logging_arkode_mristep_lvl3_4_1_0.out | 511 +++++ ...test_logging_arkode_mristep_lvl3_4_1_1.out | 415 ++++ .../test_logging_arkode_mristep_lvl3_5_0.out | 382 ++++ ...test_logging_arkode_mristep_lvl3_5_1_0.out | 511 +++++ ...test_logging_arkode_mristep_lvl3_5_1_1.out | 415 ++++ .../test_logging_arkode_mristep_lvl3_6.out | 230 +++ .../test_logging_arkode_mristep_lvl4_0.out | 314 +++ .../test_logging_arkode_mristep_lvl4_1_0.out | 429 ++++ ...test_logging_arkode_mristep_lvl4_1_1_0.out | 558 +++++ ...test_logging_arkode_mristep_lvl4_1_1_1.out | 462 +++++ .../test_logging_arkode_mristep_lvl4_2_0.out | 432 ++++ ...test_logging_arkode_mristep_lvl4_2_1_0.out | 561 +++++ ...test_logging_arkode_mristep_lvl4_2_1_1.out | 465 +++++ .../test_logging_arkode_mristep_lvl4_3.out | 354 ++++ .../test_logging_arkode_mristep_lvl4_4_0.out | 436 ++++ ...test_logging_arkode_mristep_lvl4_4_1_0.out | 565 ++++++ ...test_logging_arkode_mristep_lvl4_4_1_1.out | 469 +++++ .../test_logging_arkode_mristep_lvl4_5_0.out | 436 ++++ ...test_logging_arkode_mristep_lvl4_5_1_0.out | 565 ++++++ ...test_logging_arkode_mristep_lvl4_5_1_1.out | 469 +++++ .../test_logging_arkode_mristep_lvl4_6.out | 266 +++ .../test_logging_arkode_mristep_lvl5_0.out | 1286 ++++++++++++ .../test_logging_arkode_mristep_lvl5_1_0.out | 1557 ++++++++++++++ ...test_logging_arkode_mristep_lvl5_1_1_0.out | 1686 +++++++++++++++ ...test_logging_arkode_mristep_lvl5_1_1_1.out | 1590 +++++++++++++++ .../test_logging_arkode_mristep_lvl5_2_0.out | 1620 +++++++++++++++ ...test_logging_arkode_mristep_lvl5_2_1_0.out | 1749 ++++++++++++++++ ...test_logging_arkode_mristep_lvl5_2_1_1.out | 1653 +++++++++++++++ .../test_logging_arkode_mristep_lvl5_3.out | 1446 +++++++++++++ .../test_logging_arkode_mristep_lvl5_4_0.out | 1636 +++++++++++++++ ...test_logging_arkode_mristep_lvl5_4_1_0.out | 1765 ++++++++++++++++ ...test_logging_arkode_mristep_lvl5_4_1_1.out | 1669 +++++++++++++++ .../test_logging_arkode_mristep_lvl5_5_0.out | 1672 +++++++++++++++ ...test_logging_arkode_mristep_lvl5_5_1_0.out | 1801 +++++++++++++++++ ...test_logging_arkode_mristep_lvl5_5_1_1.out | 1705 ++++++++++++++++ .../test_logging_arkode_mristep_lvl5_6.out | 1046 ++++++++++ .../test_logging_arkode_splittingstep.cpp | 162 ++ .../test_logging_arkode_splittingstep.out | 22 + ...test_logging_arkode_splittingstep_lvl3.out | 304 +++ ...test_logging_arkode_splittingstep_lvl4.out | 304 +++ ...test_logging_arkode_splittingstep_lvl5.out | 727 +++++++ .../logging/test_logging_arkode_sprkstep.cpp | 128 ++ .../test_logging_arkode_sprkstep_0.out | 22 + .../test_logging_arkode_sprkstep_1.out | 22 + .../test_logging_arkode_sprkstep_lvl3_0.out | 52 + .../test_logging_arkode_sprkstep_lvl3_1.out | 52 + .../test_logging_arkode_sprkstep_lvl4_0.out | 52 + .../test_logging_arkode_sprkstep_lvl4_1.out | 52 + .../test_logging_arkode_sprkstep_lvl5_0.out | 358 ++++ .../test_logging_arkode_sprkstep_lvl5_1.out | 358 ++++ .../unit_tests/logging/test_logging_cvode.cpp | 196 ++ .../logging/test_logging_cvode_0.out | 26 + .../logging/test_logging_cvode_1_0.out | 38 + .../logging/test_logging_cvode_1_1.out | 38 + .../logging/test_logging_cvode_lvl3_0.out | 70 + .../logging/test_logging_cvode_lvl3_1_0.out | 122 ++ .../logging/test_logging_cvode_lvl3_1_1.out | 93 + .../logging/test_logging_cvode_lvl4_0.out | 81 + .../logging/test_logging_cvode_lvl4_1_0.out | 133 ++ .../logging/test_logging_cvode_lvl4_1_1.out | 104 + .../logging/test_logging_cvode_lvl5_0.out | 97 + .../logging/test_logging_cvode_lvl5_1_0.out | 149 ++ .../logging/test_logging_cvode_lvl5_1_1.out | 120 ++ .../logging/test_logging_cvodes.cpp | 196 ++ .../logging/test_logging_cvodes_0.out | 26 + .../logging/test_logging_cvodes_1_0.out | 38 + .../logging/test_logging_cvodes_1_1.out | 38 + .../logging/test_logging_cvodes_lvl3_0.out | 70 + .../logging/test_logging_cvodes_lvl3_1_0.out | 122 ++ .../logging/test_logging_cvodes_lvl3_1_1.out | 93 + .../logging/test_logging_cvodes_lvl4_0.out | 81 + .../logging/test_logging_cvodes_lvl4_1_0.out | 133 ++ .../logging/test_logging_cvodes_lvl4_1_1.out | 104 + .../logging/test_logging_cvodes_lvl5_0.out | 97 + .../logging/test_logging_cvodes_lvl5_1_0.out | 149 ++ .../logging/test_logging_cvodes_lvl5_1_1.out | 120 ++ test/unit_tests/logging/test_logging_ida.cpp | 189 ++ .../unit_tests/logging/test_logging_ida_0.out | 38 + .../unit_tests/logging/test_logging_ida_1.out | 38 + .../logging/test_logging_ida_lvl3_0.out | 157 ++ .../logging/test_logging_ida_lvl3_1.out | 108 + .../logging/test_logging_ida_lvl4_0.out | 177 ++ .../logging/test_logging_ida_lvl4_1.out | 128 ++ .../logging/test_logging_ida_lvl5_0.out | 177 ++ .../logging/test_logging_ida_lvl5_1.out | 128 ++ test/unit_tests/logging/test_logging_idas.cpp | 189 ++ .../logging/test_logging_idas_0.out | 38 + .../logging/test_logging_idas_1.out | 38 + .../logging/test_logging_idas_lvl3_0.out | 157 ++ .../logging/test_logging_idas_lvl3_1.out | 108 + .../logging/test_logging_idas_lvl4_0.out | 177 ++ .../logging/test_logging_idas_lvl4_1.out | 128 ++ .../logging/test_logging_idas_lvl5_0.out | 177 ++ .../logging/test_logging_idas_lvl5_1.out | 128 ++ test/unit_tests/problems/estep.hpp | 129 ++ test/unit_tests/problems/kepler.hpp | 164 ++ test/unit_tests/problems/kpr.hpp | 386 ++++ test/unit_tests/problems/prv.hpp | 113 ++ test/unit_tests/utilities/check_return.hpp | 36 + tools/log_example.py | 163 ++ tools/log_example_mri.py | 83 + tools/log_example_print.py | 39 + .../suntools}/__init__.py | 0 .../sundials_csv.py => tools/suntools/csv.py | 0 tools/suntools/logs.py | 418 ++++ 257 files changed, 61977 insertions(+), 1775 deletions(-) delete mode 100644 doc/superbuild/source/developers/sundialsdev/index.rst delete mode 100644 scripts/sundialsdev/logs.py create mode 100644 test/unit_tests/logging/CMakeLists.txt create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_erkstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_erkstep.out create mode 100644 test/unit_tests/logging/test_logging_arkode_erkstep_lvl3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_erkstep_lvl4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_erkstep_lvl5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_forcingstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_forcingstep.out create mode 100644 test/unit_tests/logging/test_logging_arkode_forcingstep_lvl3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_forcingstep_lvl4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_forcingstep_lvl5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_2.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_2.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_2.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_2.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_6.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl3_6.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl4_6.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_mristep_lvl5_6.out create mode 100644 test/unit_tests/logging/test_logging_arkode_splittingstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_splittingstep.out create mode 100644 test/unit_tests/logging/test_logging_arkode_splittingstep_lvl3.out create mode 100644 test/unit_tests/logging/test_logging_arkode_splittingstep_lvl4.out create mode 100644 test/unit_tests/logging/test_logging_arkode_splittingstep_lvl5.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep.cpp create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_1.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_1.out create mode 100644 test/unit_tests/logging/test_logging_cvode.cpp create mode 100644 test/unit_tests/logging/test_logging_cvode_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl3_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl3_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvode_lvl5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvodes.cpp create mode 100644 test/unit_tests/logging/test_logging_cvodes_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl3_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl3_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl4_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl4_1_1.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl5_1_0.out create mode 100644 test/unit_tests/logging/test_logging_cvodes_lvl5_1_1.out create mode 100644 test/unit_tests/logging/test_logging_ida.cpp create mode 100644 test/unit_tests/logging/test_logging_ida_0.out create mode 100644 test/unit_tests/logging/test_logging_ida_1.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl3_1.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl4_1.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_ida_lvl5_1.out create mode 100644 test/unit_tests/logging/test_logging_idas.cpp create mode 100644 test/unit_tests/logging/test_logging_idas_0.out create mode 100644 test/unit_tests/logging/test_logging_idas_1.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl3_0.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl3_1.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl4_0.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl4_1.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl5_0.out create mode 100644 test/unit_tests/logging/test_logging_idas_lvl5_1.out create mode 100644 test/unit_tests/problems/estep.hpp create mode 100644 test/unit_tests/problems/kepler.hpp create mode 100644 test/unit_tests/problems/kpr.hpp create mode 100644 test/unit_tests/problems/prv.hpp create mode 100644 test/unit_tests/utilities/check_return.hpp create mode 100755 tools/log_example.py create mode 100755 tools/log_example_mri.py create mode 100755 tools/log_example_print.py rename {scripts/sundialsdev => tools/suntools}/__init__.py (100%) rename scripts/sundials_csv.py => tools/suntools/csv.py (100%) create mode 100644 tools/suntools/logs.py diff --git a/.cmake-format.py b/.cmake-format.py index c6d5938ef6..e54ca58d3a 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -59,6 +59,7 @@ 'EXTRA_ARGS': '+', 'FLOAT_PRECISION': 1, 'INTEGER_PRECISION': 1, + 'LABELS': '+', 'MPI_NPROCS': 1, 'TEST_ARGS': '+'}, 'pargs': {'flags': ['NODIFF'], 'nargs': '2+'}}, diff --git a/.github/workflows/ubuntu-clang-latest.yml b/.github/workflows/ubuntu-clang-latest.yml index 2010b54dbf..57b3dfc85e 100644 --- a/.github/workflows/ubuntu-clang-latest.yml +++ b/.github/workflows/ubuntu-clang-latest.yml @@ -43,12 +43,25 @@ jobs: -D CMAKE_CXX_COMPILER=$(which clang++) \ -D SUNDIALS_LOGGING_LEVEL=${{matrix.logging_level}} \ -D ENABLE_ALL_WARNINGS=ON \ - -D ENABLE_WARNINGS_AS_ERRORS=ON + -D ENABLE_WARNINGS_AS_ERRORS=ON \ + -D SUNDIALS_TEST_DEVTESTS=ON \ + -D SUNDIALS_TEST_UNITTESTS=ON \ + -D SUNDIALS_TEST_ENABLE_GTEST=OFF \ + -D SUNDIALS_TEST_FLOAT_PRECISION=4 \ + -D SUNDIALS_TEST_INTEGER_PRECISION=10 - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + - name: Test + # Run logging tests + run: | + ctest \ + --test-dir ${{github.workspace}}/build \ + --label-regex logging \ + --verbose + build_cycle_profiling: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 763405865e..fcaaffcbd6 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,6 @@ uberenv_libs # swig /swig/swig + +# tools +/tools/suntools/__pycache__ diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d7a947422..f9e1929344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,12 @@ backends with Trilinos. As such, Trilinos 14 or newer is required and the Example programs using *hypre* have been updated to support v2.20 and newer. +The information level logging output in ARKODE, CVODE(S), and IDA(S) has been +updated to be more uniform across the packages and a new `tools` directory +has been added with a Python module, `suntools`, containing utilities for +parsing logging output. The Python utilities for parsing CSV output have been +relocated from the `scripts` directory to the Python module. + The build system has been updated to utilize the CMake LAPACK imported target which should ease building SUNDIALS with LAPACK libraries that require setting specific linker flags e.g., MKL. diff --git a/cmake/macros/SundialsAddTest.cmake b/cmake/macros/SundialsAddTest.cmake index 4b4733820e..6888571fea 100644 --- a/cmake/macros/SundialsAddTest.cmake +++ b/cmake/macros/SundialsAddTest.cmake @@ -21,7 +21,8 @@ # [ANSWER_DIR path] # [ANSWER_FIEL file] # [EXAMPLE_TYPE type] -# [TEST_ARGS arg1 arg2 ...]) +# [TEST_ARGS arg1 arg2 ...] +# [LABELS label1 label2 ...]) # ~~~ # # CMake macro to add a SUNDIALS regression test. Keyword input arguments can be @@ -46,6 +47,11 @@ # # The option EXAMPLE_TYPE set the example type i.e., release or develop examples # +# The option TEST_ARGS are command line arguments to pass to the executable +# +# The options LABELS are labels added to the test properties to easily run (or +# exclude) groups of test with ctest -L <label> (or ctest -LE <label>) +# # When SUNDIALS_TEST_DEVTESTS is OFF (default) the executable is run and success # or failure is determined by the executable return value (zero or non-zero # respectively). @@ -83,7 +89,7 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) set(options "NODIFF") set(oneValueArgs "MPI_NPROCS" "FLOAT_PRECISION" "INTEGER_PRECISION" "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE") - set(multiValueArgs "TEST_ARGS" "EXTRA_ARGS") + set(multiValueArgs "LABELS" "TEST_ARGS" "EXTRA_ARGS") # parse inputs and create variables SUNDIALS_ADD_TEST_<keyword> cmake_parse_arguments(SUNDIALS_ADD_TEST "${options}" "${oneValueArgs}" @@ -282,6 +288,14 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) endif() + if(SUNDIALS_TEST_DEVTESTS OR NOT SUNDIALS_ADD_TEST_EXAMPLE_TYPE) + # set any labels (must quote SUNDIALS_ADD_TEST_LABELS) + if(SUNDIALS_ADD_TEST_LABELS) + set_tests_properties(${NAME} PROPERTIES LABELS + "${SUNDIALS_ADD_TEST_LABELS}") + endif() + endif() + endif() endmacro() diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index 65cbe33287..2dbece5aa1 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -3060,9 +3060,9 @@ Main solver optional output functions .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 5.2.0 diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 4d9506ff76..88f99d5b55 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -1644,9 +1644,9 @@ Main solver optional output functions .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 5.2.0 diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 08cd106970..31319cf95f 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -1724,9 +1724,9 @@ Main solver optional output functions .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 5.2.0 diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 41710d2461..6ea553ef30 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -738,9 +738,9 @@ Main solver optional output functions .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. deprecated:: 6.1.0 diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 6a9ab9fcfe..76a1003c35 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -3542,9 +3542,9 @@ Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumul .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 6.1.0 diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index b2e793d5e3..85704745a9 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -2736,9 +2736,9 @@ described next. .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 6.2.0 diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 8bc54ff2a2..716e063b23 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -2736,9 +2736,9 @@ described next. .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 6.2.0 diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 36b20b743e..86a41b42d9 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -2602,9 +2602,9 @@ described next. .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 6.2.0 diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index f8bbe96021..ee62a6b8f2 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -2631,9 +2631,9 @@ described next. .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 5.2.0 diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index ebe2aeef76..6f578c8b97 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -1474,9 +1474,9 @@ functions are described next. .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. .. versionadded:: 6.2.0 diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index ce0a252848..5e61e9f216 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -53,6 +53,12 @@ backends with Trilinos. As such, Trilinos 14 or newer is required and the Example programs using *hypre* have been updated to support v2.20 and newer. +The information level logging output in ARKODE, CVODE(S), and IDA(S) has been +updated to be more uniform across the packages and a new ``tools`` directory +has been added with a Python module, ``suntools``, containing utilities for +parsing logging output. The Python utilities for parsing CSV output have been +relocated from the ``scripts`` directory to the Python module. + The build system has been updated to utilize the CMake LAPACK imported target which should ease building SUNDIALS with LAPACK libraries that require setting specific linker flags e.g., MKL. diff --git a/doc/shared/sundials/Logging.rst b/doc/shared/sundials/Logging.rst index 8ce0b31774..98aaa2622c 100644 --- a/doc/shared/sundials/Logging.rst +++ b/doc/shared/sundials/Logging.rst @@ -28,19 +28,16 @@ Enabling Logging ---------------- To enable logging, the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` must be -set to a value greater than ``0`` when configuring SUNDIALS. This option -specifies the maximum desired output level. See the documentation entry for -:cmakeop:`SUNDIALS_LOGGING_LEVEL` for the numeric values correspond to errors, -warnings, info output, and debug output where errors < warnings < info -output < debug output < extra debug output. -More details in regards to configuring SUNDIALS with CMake can be -found in :numref:`Installation`. +set to the maximum desired output level when configuring SUNDIALS. See the +:cmakeop:`SUNDIALS_LOGGING_LEVEL` documentation for the numeric values +corresponding to errors, warnings, info output, and debug output where errors < +warnings < info output < debug output < extra debug output. By default only +warning and error messages are logged. .. note:: As of version 7.0.0, enabling MPI in SUNDIALS enables MPI-aware logging. - When SUNDIALS is built with logging enabled, then the default logger (stored in the :c:type:`SUNContext` object) may be configured through environment variables without any changes to user code. The available environment variables are: @@ -59,23 +56,59 @@ The different variables may all be set to the same file, or to distinct files, or some combination there of. To disable output for one of the streams, then do not set the environment variable, or set it to an empty string. +If :cmakeop:`SUNDIALS_LOGGING_LEVEL` was set at build-time to a level lower than +the corresponding environment variable, then setting the environment variable +will do nothing. For example, if the logging level is set to ``2`` (errors and +warnings), setting ``SUNLOGGER_INFO_FILENAME`` will do nothing. + .. warning:: - A non-default logger should be created prior to any other SUNDIALS calls - in order to capture all log events. + A non-default logger should be created and attached to the context object prior + to any other SUNDIALS calls in order to capture all log events. -.. note:: +Error or warning logs are a single line output with an error or warning message - If :cmakeop:`SUNDIALS_LOGGING_LEVEL` was set to ``1`` (corresponding to - error-level output) at build-time, then setting the environment variable - ``SUNLOGGER_INFO_FILENAME`` will do nothing. +.. code-block:: text -.. note:: + [level][rank][scope][label] message describing the error or warning + +Informational or debugging logs are either a single line output with a +comma-separated list of key-value pairs of the form + +.. code-block:: text + + [level][rank][scope][label] key1 = value, key2 = value + +or multiline output with one value per line for keys corresponding to a vector +or array e.g., + +.. code-block:: text + + [level][rank][scope][label] y(:) = + y[0] + y[1] + ... - Extra debugging output is turned on by setting :cmakeop:`SUNDIALS_LOGGING_LEVEL` to 5. - This extra output includes vector-values (so long as the :c:type:`N_Vector` used - supports printing). +In the example log outputs above, the values in brackets have the following +meaning: +* ``level`` is the log level of the message and will be ``ERROR``, ``WARNING``, + ``INFO``, or ``DEBUG`` + +* ``rank`` is the MPI rank the message was written from (``0`` by default or if + SUNDIALS was built without MPI enabled) + +* ``scope`` is the message scope i.e., the name of the function from which the + message was written + +* ``label`` provides additional context or information about the logging + output e.g., ``begin-step``, ``end-linear-solve``, etc. + +.. note:: + + When extra debugging output is enabled, the output will include vector values + (so long as the :c:type:`N_Vector` used supports printing). Depending on the + problem size, this may result in very large logging files. Logger API ---------- @@ -97,29 +130,29 @@ functions to identify the output level or file. The SUNDIALS logging level -.. c:enumerator:: SUN_LOGLEVEL_ALL + .. c:enumerator:: SUN_LOGLEVEL_ALL - Represents all output levels + Represents all output levels -.. c:enumerator:: SUN_LOGLEVEL_NONE + .. c:enumerator:: SUN_LOGLEVEL_NONE - Represents none of the output levels + Represents none of the output levels -.. c:enumerator:: SUN_LOGLEVEL_ERROR + .. c:enumerator:: SUN_LOGLEVEL_ERROR - Represents error-level logging messages + Represents error-level logging messages -.. c:enumerator:: SUN_LOGLEVEL_WARNING + .. c:enumerator:: SUN_LOGLEVEL_WARNING - Represents warning-level logging messages + Represents warning-level logging messages -.. c:enumerator:: SUN_LOGLEVEL_INFO + .. c:enumerator:: SUN_LOGLEVEL_INFO - Represents info-level logging messages + Represents info-level logging messages -.. c:enumerator:: SUN_LOGLEVEL_DEBUG + .. c:enumerator:: SUN_LOGLEVEL_DEBUG - Represents deubg-level logging messages + Represents deubg-level logging messages The :c:type:`SUNLogger` class provides the following methods. @@ -134,8 +167,8 @@ The :c:type:`SUNLogger` class provides the following methods. * ``output_rank`` -- the MPI rank used for output (can be ``-1`` to print to all ranks). * ``logger`` -- [in,out] On input this is a pointer to a - :c:type:`SUNLogger`, on output it will point to a new - :c:type:`SUNLogger` instance. + :c:type:`SUNLogger`, on output it will point to a new + :c:type:`SUNLogger` instance. **Returns:** * Returns zero if successful, or non-zero if an error occurred. @@ -156,8 +189,8 @@ The :c:type:`SUNLogger` class provides the following methods. **Arguments:** * ``comm`` -- the MPI communicator to use, if MPI is enabled, otherwise can be ``SUN_COMM_NULL``. * ``logger`` -- [in,out] On input this is a pointer to a - :c:type:`SUNLogger`, on output it will point to a new - :c:type:`SUNLogger` instance. + :c:type:`SUNLogger`, on output it will point to a new + :c:type:`SUNLogger` instance. **Returns:** * Returns zero if successful, or non-zero if an error occurred. @@ -278,16 +311,20 @@ The :c:type:`SUNLogger` class provides the following methods. Example Usage ------------- -As previously mentioned, if it is enabled at build time, there is a default -:c:type:`SUNLogger` attached to a :c:type:`SUNContext` instance when it is -created. This logger can be configured using the environment variables, e.g., +As noted above, enabling logging must be done when configuring SUNDIALS by +setting the CMake option :cmakeop:`SUNDIALS_LOGGING_LEVEL` to the desired +logging level. When running a program with SUNDIALS logging enabled, a default +logger is created and attached to the :c:type:`SUNContext` instance at creation. +Environment variables or run-time functions can be used to determine where the +logging output is written. For example, consider the CVODE Roberts example, where +we can direct the informational output to the file ``sun.log`` as follows .. code-block:: - SUNDIALS_INFO_FILENAME=stdout ./examples/cvode/serial/cvKrylovDemo_ls + SUNDIALS_INFO_FILENAME=sun.log ./examples/cvode/serial/cvRoberts_dns -SUNDIALS also includes several example codes that demonstrate how to use the -logging interface via the C API. +Alternatively, the following examples demonstrate how to use the logging +interface via the C API: .. code-block:: @@ -296,3 +333,13 @@ logging interface via the C API. examples/cvode/parallel/cvAdvDiff_diag_p.c examples/kinsol/CXX_parallel/kin_em_p.cpp examples/kinsol/CUDA_mpi/kin_em_mpicuda.cpp + +To assist with extracting informational logging data from output files the +``tools`` directory contains a Python module, ``suntools``, that provides +utilities for parsing log files. Some example scripts using the ``suntools`` +module are included in the ``tools`` directory. For example, we can plot the +step size history from the CVODE Roberts problem with + +.. code-block:: + + ./log_example.py sun.log diff --git a/doc/shared/sundials/Types.rst b/doc/shared/sundials/Types.rst index 59cf1b29ba..a1be93f378 100644 --- a/doc/shared/sundials/Types.rst +++ b/doc/shared/sundials/Types.rst @@ -154,9 +154,9 @@ Output formatting type .. note:: - The file ``scripts/sundials_csv.py`` provides python utility functions to - read and output the data from a SUNDIALS CSV output file using the key - and value pair format. + The Python module ``tools/suntools`` provides utilities to read and output + the data from a SUNDIALS CSV output file using the key and value pair + format. MPI types --------- diff --git a/doc/superbuild/source/developers/index.rst b/doc/superbuild/source/developers/index.rst index 9b1d381e1d..419a8289d1 100644 --- a/doc/superbuild/source/developers/index.rst +++ b/doc/superbuild/source/developers/index.rst @@ -40,7 +40,6 @@ meant for SUNDIALS developers. pull_requests/index releases/index packages/index - sundialsdev/index appendix/index .. only:: html diff --git a/doc/superbuild/source/developers/style_guide/Documentation.rst b/doc/superbuild/source/developers/style_guide/Documentation.rst index c21f600714..6c9449a7b4 100644 --- a/doc/superbuild/source/developers/style_guide/Documentation.rst +++ b/doc/superbuild/source/developers/style_guide/Documentation.rst @@ -139,6 +139,8 @@ Pay special attention to the two trailing underscores - two underscores indicates an anonymous link. +.. _Style.Documentation.UserCallable: + User-Callable Functions ======================= @@ -317,26 +319,28 @@ following. * ``examples/package/subdir/pkg_foo_demo.c`` +.. _Style.Documentation.UserSupplied: + User-Supplied Functions ======================= Document user-supplied functions with the :external+sphinx:rst:dir:`c:type` directive. The directive is followed by the ``typedef`` for the function pointer. The description of the function type mirrors the style used for -user-callable function with one exception. As :external+sphinx:rst:dir:`c:type` -does not currently support the ``param``, ``retval``, and ``returns`` fields, -these sections must be manually created. The style that follows is chosen to -reflect that of ``param``, ``retval``, and ``returns`` fields as much as -possible. Function parameters should be listed under a boldface "Parameters:" -section with the parameters in boldface and separated from their description by -an en-dash. As user-supplied functions typically return a ``int``, but specific -values are not required, a description of how the return value is interpreted -should be given under a boldface "Returns:" section (skipping a line and -indenting 2 spaces). If specific return values are required, these should be -documented similarly to the function parameters and listed under a boldface -"Return values:" section. If the function returns ``void``, a return section -should not be included. Below we give, two examples describing user-supplied -functions. +user-callable functions (see :ref:`Style.Documentation.UserCallable`) with one +exception. As :external+sphinx:rst:dir:`c:type` does not currently support the +``param``, ``retval``, and ``returns`` fields, these sections must be manually +created. The style that follows is chosen to reflect that of ``param``, +``retval``, and ``returns`` fields as much as possible. Function parameters +should be listed under a boldface "Parameters:" section with the parameters in +boldface and separated from their description by an en-dash. As user-supplied +functions typically return a ``int``, but specific values are not required, a +description of how the return value is interpreted should be given under a +boldface "Returns:" section (skipping a line and indenting 2 spaces). If +specific return values are required, these should be documented similarly to the +function parameters and listed under a boldface "Return values:" section. If the +function returns ``void``, a return section should not be included. Below we +give two examples describing user-supplied functions. .. code-block:: rst @@ -408,3 +412,33 @@ following. **Examples codes:** * ``examples/package/subdir/pkg_bar_demo.c`` + + +.. _Style.Documentation.MacroFunction: + +Function-like Macros +==================== + +Document function-like macros with the :external+sphinx:rst:dir:`c:macro` +directive followed by the macro. The guidelines for documenting function-like +macros are the same as those used for documenting user-callable functions (see +:ref:`Style.Documentation.UserCallable`) with one exception. As +:external+sphinx:rst:dir:`c:macro` does not include the parameter types, the +types should be included in the parameter descriptions when relevant i.e., when +the macro is a wrapper to function (see :c:macro:`SUNLogInfo`). For example, + +.. code-block:: rst + + .. c:macro:: FnLikeMacro(p1, p2) + + Brief description of what the function-like macro does. + + Additional information about the macro and its usage. + + :param p1: the :c:type:`p1_type` parameter. + :param p2: the :c:type:`p1_type` parameter. + + :retval retval1: under some conditions. + :retval retval2: under some other conditions. + + .. versionadded:: x.y.z diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 022cffbc7e..b992b2bea0 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -355,24 +355,8 @@ not adhere to all of these rules. ``sunindextype`` for it. Instead use the appropriate integer type (e.g., ``uint64_t``) directly. Do not use ``sunindextype`` for counters either. -#. ``SUNLogger`` statements must be in the format: +#. Follow the logging style detailed in :ref:`Style.Logging`. - .. code-block:: c - - [log level][rank][scope][label] key1 = value, key2 = value - - or if the payload (the part after the label) is a vector/array: - - .. code-block:: c - - [log level][rank][scope][label] key(:) = - value1 - value2 - - Note that the ``(:)`` is needed for the ``scripts/sundialsdev/logs.py`` Python - utility to understand that the payload is an array. - - .. code-block:: c .. _Style.Formatting: @@ -460,3 +444,212 @@ There are other scenarios (e.g., a function call with a lot of parameters) where .. }; .. See the clang-tidy documentation for more details. + + +.. _Style.Logging: + +Logging +------- + +Use the macros below to add informational and debugging messages to SUNDIALS +code rather than adding ``#ifdef SUNDIALS_LOGGING_<level>`` / ``#endif`` blocks +containing calls to :c:func:`SUNLogger_QueueMsg`. Error and warning messages are +handled through package-specific ``ProcessError`` functions or the ``SUNAssert`` +and ``SUNCheck`` macros. + +The logging macros help ensure messages follow the required format presented in +:numref:`SUNDIALS.Logging.Enabling` and used by the ``suntools`` Python module +for parsing logging output. For informational and debugging output the log +message payload (the part after the brackets) must be either be a +comma-separated list of key-value pairs with the key and value separated by an +equals sign with a space on either side e.g., + +.. code-block:: C + + /* log an informational message */ + SUNLogInfo(sunctx->logger, "begin-step", "t = %g, h = %g", t, h); + + /* log a debugging message */ + SUNLogDebug(sunctx->logger, "error-estimates", "eqm1 = %g, eq = %g, eqp1 = %g", eqm1, eq, eqp1); + +or the name of a vector/array followed by ``(:) =`` with each vector/array entry +written to a separate line e.g., a vector may be logged with + +.. code-block:: C + + SUNLogExtraDebugVec(sunctx->logger, "new-solution", ynew, "ynew(:) ="); + +where the message can contain format specifiers e.g., if ``Fe`` is an array of +vectors you may use + +.. code-block:: C + + SUNLogExtraDebugVec(sunctx->logger, "new-solution", Fe[i], "Fe_%d(:) =", i); + +To assist in parsing logging messages, ``begin-`` and ``end-`` markers are used +in the log message ``label`` field to denote where particular regions begin and +end. When adding a new ``begin-`` / ``end-`` label the ``logs.py`` script will +need to be updated accordingly. The region markers currently supported by the +Python module for parsing log files are as follows: + +* ``begin-step-attempt`` / ``end-step-attempt`` + +* ``begin-nonlinear-solve`` / ``end-nonlinear-solve`` + +* ``begin-nonlinear-iterate`` / ``end-nonlinear-iterate`` + +* ``begin-linear-solve`` / ``end-linear-solve`` + +* ``begin-linear-iterate`` / ``end-linear-iterate`` + +* ``begin-group`` / ``end-group`` + +* ``begin-stage`` / ``end-stage`` + +* ``begin-fast-steps`` / ``end-fast-steps`` + +* ``begin-mass-linear-solve`` / ``end-mass-linear-solve`` + +* ``begin-compute-solution`` / ``end-compute-solution`` + +* ``begin-compute-embedding`` / ``end-compute-embedding`` + +Logging Macros +^^^^^^^^^^^^^^ + +.. versionadded:: x.y.z + +To log informational messages use the following macros: + +.. c:macro:: SUNLogInfo(logger, label, msg_txt, ...) + + When information logging is enabled this macro expands to a call to + :c:func:`SUNLogger_QueueMsg` to log an informational message. Otherwise, this + expands to nothing. + + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogInfoIf(condition, logger, label, msg_txt, ...) + + When information logging is enabled this macro expands to a conditional call + to :c:func:`SUNLogger_QueueMsg` to log an informational message. Otherwise, + this expands to nothing. + + :param condition: a boolean expression that determines if the log message + should be queued. + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format. + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +To log debugging messages use the following macros: + +.. c:macro:: SUNLogDebug(logger, label, msg_txt, ...) + + When debugging logging is enabled this macro expands to a call to + :c:func:`SUNLogger_QueueMsg` to log a debug message. Otherwise, this expands + to nothing. + + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format. + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogDebugIf(condition, logger, label, msg_txt, ...) + + When debugging logging is enabled this macro expands to a conditional call to + :c:func:`SUNLogger_QueueMsg` to log a debug message. Otherwise, this expands + to nothing. + + :param condition: a boolean expression that determines if the log message + should be queued. + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format. + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +To log extra debugging messages use the following macros: + +.. c:macro:: SUNLogExtraDebug(logger, label, msg_txt, ...) + + When extra debugging logging is enabled, this macro expands to a call to + :c:func:`SUNLogger_QueueMsg` to log an extra debug message. Otherwise, this expands + to nothing. + + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogExtraDebugIf(condition, logger, label, msg_txt, ...) + + When extra debugging logging is enabled, this macro expands to a conditional + call to :c:func:`SUNLogger_QueueMsg` to log an extra debug message. Otherwise, this + expands to nothing. + + :param condition: a boolean expression that determines if the log message + should be queued. + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param msg_txt: the ``const char*`` message text, may contain format + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogExtraDebugVec(logger, label, vec, msg_txt, ...) + + When extra debugging logging is enabled, this macro expands to a call to + :c:func:`SUNLogger_QueueMsg` and :c:func:`N_VPrintFile` to log an extra + debug message and output the vector data. Otherwise, this expands to nothing. + + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param vec: the ``N_Vector`` to print. + :param msg_txt: the ``const char*`` message text, may contain format + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogExtraDebugVecIf(condition, logger, label, vec, msg_txt, ...) + + When extra debugging logging is enabled, this macro expands to a conditional + call to :c:func:`SUNLogger_QueueMsg` and :c:func:`N_VPrintFile` to log an extra + debug message and output the vector data. Otherwise, this expands to nothing. + + :param condition: a boolean expression that determines if the log message + should be queued. + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param vec: the ``N_Vector`` to print. + :param msg_txt: the ``const char*`` message text, may contain format + specifiers. + :param ...: the arguments for format specifiers in ``msg_txt``. + +.. c:macro:: SUNLogExtraDebugVecArray(logger, label, nvecs, vecs, msg_txt) + + When extra debugging logging is enabled, this macro expands to a loop calling + :c:func:`SUNLogger_QueueMsg` and :c:func:`N_VPrintFile` for each vector in + the vector array to log an extra debug message and output the vector data. + Otherwise, this expands to nothing. + + :param logger: the :c:type:`SUNLogger` to handle the message. + :param label: the ``const char*`` message label. + :param nvecs: the ``int`` number of vectors to print. + :param vecs: the ``N_Vector*`` (vector array) to print. + :param msg_txt: the ``const char*`` message text, must contain a format + specifier for the vector array index. + + .. warning:: + + The input parameter ``msg_txt`` **must** include a format specifier for + the vector array index (of type ``int``) **only** e.g., + + .. code-block:: C + + SUNLogExtraDebugVecArray(logger, "YS-vector-array", "YS[%d](:) =", YS, 5); diff --git a/doc/superbuild/source/developers/sundialsdev/index.rst b/doc/superbuild/source/developers/sundialsdev/index.rst deleted file mode 100644 index 75dfee59b1..0000000000 --- a/doc/superbuild/source/developers/sundialsdev/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. - ----------------------------------------------------------------------------- - SUNDIALS Copyright Start - Copyright (c) 2002-2024, 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_DEV: - -sundialsdev Python Library -========================== - -This is a Python library of utilities SUNDIALS developer may find useful. -Right now it consists of the following modules: - -- ``logs``: this module has functions for parsing logs produced by `SUNLogger`. - diff --git a/scripts/shared b/scripts/shared index c6e5ae255c..185111a6f1 100755 --- a/scripts/shared +++ b/scripts/shared @@ -71,9 +71,6 @@ $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 - echo " --- Add shared source files to $tarfile" $tar $tarfile $distrobase/src/CMakeLists.txt $tar $tarfile $distrobase/src/nvector @@ -97,11 +94,10 @@ echo " --- Add testing files to $tarfile" $tar $tarfile $distrobase/test/testRunner echo " --- Add unit tests files to $tarfile" -$tar $tarfile $distrobase/test/unit_tests/CMakeLists.txt -$tar $tarfile $distrobase/test/unit_tests/profiling -$tar $tarfile $distrobase/test/unit_tests/sunmemory -$tar $tarfile $distrobase/test/unit_tests/sundials -$tar $tarfile $distrobase/test/unit_tests/utilities +$tar $tarfile $distrobase/test/unit_tests/ echo " --- Add external files to $tarfile" -$tar $tarfile $distrobase/external +$tar $tarfile $distrobase/external/ + +echo " --- Add tools to $tarfile" +$tar $tarfile $distrobase/tools/ diff --git a/scripts/sundialsdev/logs.py b/scripts/sundialsdev/logs.py deleted file mode 100644 index 7965555d1c..0000000000 --- a/scripts/sundialsdev/logs.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python3 -# ----------------------------------------------------------------------------- -# Programmer(s): Cody Balos @ LLNL -# ----------------------------------------------------------------------------- -# SUNDIALS Copyright Start -# Copyright (c) 2002-2024, 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 of Python functions that may be useful to SUNDIALS developers writing -# scripts to parse logs produced by SUNLogger. -# ----------------------------------------------------------------------------- - -import re -import numpy as np - - -def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): - """ - This function parses the payload of in a SUNDIALS log file line - into a dictionary. The payload of a SUNDIALS log file line - is the part after all the [ ] brackets. - """ - kvpstrs = payload.split(",") - kvp_dict = {} - for kvpstr in kvpstrs: - kvp = kvpstr.split("=") - if len(kvp) == 1: - kvp_dict[kvp[0].strip()] = "" - else: - key, value = kvp - values = [] - if array_indicator in key: - for line in all_lines[line_number + 1 :]: - if line.startswith("["): - break - values.append(np.double(line)) - kvp_dict[key.strip()] = values - else: - kvp_dict[key.strip()] = value.strip() - return kvp_dict - - -def parse_logfile_line(line, line_number, all_lines): - """ - This function takes a line from a SUNDIALS log file and parses it into a dictionary. - A log file line has the form: - [loglvl][rank][scope][label] key1 = value, key2 = value - Log file payloads can be multiline if they are an array/vector with one value per line. - I.e. - [loglvl][rank][scope][label] y(:) - y_1 - y_2 - ... - """ - pattern = re.compile(r"\[(\w+)\]\[(rank \d+)\]\[(.*)\]\[(.*)\](.*)") - matches = pattern.findall(line) - line_dict = {} - if matches: - line_dict["loglvl"] = matches[0][0] - line_dict["rank"] = matches[0][1] - line_dict["scope"] = matches[0][2] - line_dict["label"] = matches[0][3] - line_dict["payload"] = parse_logfile_payload( - matches[0][4], line_number, all_lines - ) - return line_dict - - -def log_file_to_list(filename, step_scope_txt): - """ - This function takes a debug log file from a SUNDIALS log file and creates a list where - each list element represents an integrator step attempt. - - E.g., - [ - [ - { - "loglvl": "DEBUG", - "rank": "rank 0", - "scope": "<step_scope_txt>", - "label": "enter-step-attempt-loop", - "payload": {"step": "0", "h": "1e-06", "q": "1", "t_n": "0"}, - }, ... - ], ... - ] - """ - with open(filename, "r") as logfile: - log = [] - lines_for_this_step = None - all_lines = logfile.readlines() - for line_number, line in enumerate(all_lines): - line_dict = parse_logfile_line(line.rstrip(), line_number, all_lines) - if not line_dict: - continue - if ( - line_dict["scope"] == step_scope_txt - and line_dict["label"] == "enter-step-attempt-loop" - ): - if lines_for_this_step is None: - lines_for_this_step = [line_dict] - else: - log.append(lines_for_this_step) - lines_for_this_step = [line_dict] - else: - lines_for_this_step.append(line_dict) - return log - - -def cvode_debug_file_to_list(filename): - """ - This function takes a debug log file from CVODE and creates a list where - each list entry is a step attempt. See log_file_to_list. - """ - return log_file_to_list(filename, "CVODE::cvStep") diff --git a/scripts/tarscript b/scripts/tarscript index 8a95748e56..fbae0f00d3 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -177,7 +177,7 @@ fi # Define some names #------------------ -# Location of the scripts +# Location of the tarscript scriptdir=`pwd` # Sundials directory @@ -205,9 +205,9 @@ mkdir $tmpdir/cmake mkdir $tmpdir/doc mkdir $tmpdir/examples mkdir $tmpdir/include -mkdir $tmpdir/scripts mkdir $tmpdir/src mkdir $tmpdir/test +mkdir $tmpdir/tools #---------------------------------- # Copy appropriate files in $tmpdir @@ -238,6 +238,8 @@ cp -r $sundialsdir/examples/sunlinsol $tmpdir/examples/ cp -r $sundialsdir/examples/sunnonlinsol $tmpdir/examples/ cp -r $sundialsdir/examples/templates $tmpdir/examples/ +cp -r $sundialsdir/external $tmpdir/ + cp -r $sundialsdir/include/sundials $tmpdir/include/ cp -r $sundialsdir/include/nvector $tmpdir/include/ cp -r $sundialsdir/include/sunmatrix $tmpdir/include/ @@ -246,8 +248,6 @@ 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/ - cp $sundialsdir/src/CMakeLists.txt $tmpdir/src/ cp -r $sundialsdir/src/sundials $tmpdir/src/ cp -r $sundialsdir/src/nvector $tmpdir/src/ @@ -260,7 +260,7 @@ cp -r $sundialsdir/src/sunadaptcontroller $tmpdir/src/ cp $sundialsdir/test/testRunner $tmpdir/test/ cp -r $sundialsdir/test/unit_tests $tmpdir/test/ -cp -r $sundialsdir/external $tmpdir/ +cp -r $sundialsdir/tools $tmpdir/ # Clean up tmpdir rm -rf $tmpdir/doc/shared/__pycache__ @@ -271,7 +271,7 @@ find $tmpdir -name ".DS_Store" -delete # Remove ignored or untracked files that may have been added cd $sundialsdir -for f in $(git ls-files --others --directory benchmarks cmake doc examples include scripts src test); do +for f in $(git ls-files --others --directory benchmarks cmake doc examples external include src test tools); do rm -rf $tmpdir/$f done cd - @@ -346,7 +346,7 @@ done #--------------------------- # NOTE: The "shared" script must be called first for each case below as it -# creates the initial archive appended to by the package scripts +# creates the initial archive appended to by the package tarscripts # Initial name of the directory to be archived distrobase="$tmpdir" diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 1a952f0bc6..3ded262d29 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -885,23 +885,29 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, ark_mem->nst_attempts++; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::ARKodeEvolve", - "start-step", - "step = %li, attempt = %i, h = %" RSYM - ", tcur = %" RSYM, - ark_mem->nst, attempts, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-step-attempt", + "step = %li, tn = %" RSYM ", h = %" RSYM, ark_mem->nst + 1, + ark_mem->tn, ark_mem->h); /* Call time stepper module to attempt a step: 0 => step completed successfully >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) + { + /* Log fatal errors here, other returns handled below */ + SUNLogInfo(ARK_LOGGER, "end-step-attempt", + "status = failed step, kflag = %i", kflag); + break; + } /* handle solver convergence failures */ kflag = arkCheckConvergence(ark_mem, &nflag, &ncf); + + SUNLogInfoIf(kflag != ARK_SUCCESS, ARK_LOGGER, "end-step-attempt", + "status = failed step, kflag = %i", kflag); + if (kflag < 0) { break; } /* Perform relaxation: @@ -912,6 +918,10 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, if (ark_mem->relax_enabled && (kflag == ARK_SUCCESS)) { kflag = arkRelax(ark_mem, &relax_fails, &dsm); + + SUNLogInfoIf(kflag != ARK_SUCCESS, ARK_LOGGER, "end-step-attempt", + "status = failed relaxtion, kflag = %i", kflag); + if (kflag < 0) { break; } } @@ -919,6 +929,10 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, if (ark_mem->constraintsSet && (kflag == ARK_SUCCESS)) { kflag = arkCheckConstraints(ark_mem, &constrfails, &nflag); + + SUNLogInfoIf(kflag != ARK_SUCCESS, ARK_LOGGER, "end-step-attempt", + "status = failed constraints, kflag = %i", kflag); + if (kflag < 0) { break; } } @@ -927,6 +941,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, if (ark_mem->fixedstep) { ark_mem->eta = ONE; + SUNLogInfo(ARK_LOGGER, "end-step-attempt", "status = success"); break; } @@ -934,6 +949,11 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, if (kflag == ARK_SUCCESS) { kflag = arkCheckTemporalError(ark_mem, &nflag, &nef, dsm); + + SUNLogInfoIf(kflag != ARK_SUCCESS, ARK_LOGGER, "end-step-attempt", + "status = failed error test, dsm = %" RSYM ", kflag = %i", + dsm, kflag); + if (kflag < 0) { break; } } @@ -942,11 +962,17 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, { ark_mem->last_kflag = kflag; kflag = ARK_SUCCESS; + SUNLogInfo(ARK_LOGGER, "end-step-attempt", "status = success"); break; } /* break attempt loop on successful step */ - if (kflag == ARK_SUCCESS) { break; } + if (kflag == ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-step-attempt", + "status = success, dsm = %" RSYM, dsm); + break; + } /* unsuccessful step, if |h| = hmin, return ARK_ERR_FAILURE */ if (SUNRabs(ark_mem->h) <= ark_mem->hmin * ONEPSM) @@ -2592,12 +2618,6 @@ int arkCompleteStep(ARKodeMem ark_mem, sunrealtype dsm) } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkCompleteStep", - "end-step", "step = %li, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif - /* store this step's contribution to accumulated temporal error */ if (ark_mem->AccumErrorType != ARK_ACCUMERROR_NONE) { diff --git a/src/arkode/arkode_adapt.c b/src/arkode/arkode_adapt.c index ada5cda343..e24d0e38d6 100644 --- a/src/arkode/arkode_adapt.c +++ b/src/arkode/arkode_adapt.c @@ -143,11 +143,8 @@ int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, } if (h_cfl <= ZERO) { h_cfl = SUN_RCONST(1.0e30) * SUNRabs(hcur); } -#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 + SUNLogDebug(ARK_LOGGER, "new-step-before-bounds", + "h_acc = %" RSYM ", h_cfl = %" RSYM, h_acc, h_cfl); /* enforce safety factors */ h_acc *= hadapt_mem->safety; @@ -159,11 +156,8 @@ int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, /* 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_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 + SUNLogDebug(ARK_LOGGER, "new-step-after-max-min-bounds", + "h_acc = %" RSYM ", h_cfl = %" RSYM, h_acc, h_cfl); /* increment the relevant step counter, set desired step */ if (SUNRabs(h_acc) < SUNRabs(h_cfl)) { hadapt_mem->nst_acc++; } @@ -189,10 +183,7 @@ int arkAdapt(ARKodeMem ark_mem, ARKodeHAdaptMem hadapt_mem, N_Vector ycur, /* enforce maximum time step size */ ark_mem->eta /= SUNMAX(ONE, SUNRabs(hcur) * ark_mem->hmax_inv * 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); -#endif + SUNLogDebug(ARK_LOGGER, "new-step-eta", "eta = %" RSYM, ark_mem->eta); return (retval); } diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index eb7ccedc68..0e8bc1ee3a 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -1695,6 +1695,10 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VConst(ZERO, zcor0); /* set guess to all 0 (since using predictor-corrector form) */ retval = SUNNonlinSolSetup(step_mem->NLS, zcor0, ark_mem); + + SUNLogInfoIf(retval != 0, ARK_LOGGER, "setup-nonlinear-solver", + "status = failed nonlinear solver setup, retval = %i", retval); + if (retval < 0) { return (ARK_NLS_SETUP_FAIL); } if (retval > 0) { return (ARK_NLS_SETUP_RECVR); } } @@ -1760,6 +1764,12 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) step_mem->autonomous && step_mem->mass_type != MASS_TIMEDEP; + SUNLogInfoIf(is_start == 1, ARK_LOGGER, "begin-stage", + "stage = %i, implicit = %i, tcur = %" RSYM, 0, implicit_stage, + ark_mem->tcur); + SUNLogExtraDebugVecIf(is_start == 1, ARK_LOGGER, "explicit stage", + ark_mem->yn, "z_0(:) ="); + /* Call the RHS if needed. */ eval_rhs = !implicit_stage || save_fn_for_interp || save_fn_for_residual; @@ -1782,7 +1792,12 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) 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; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed full rhs eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } ark_mem->fn_is_current = SUNTRUE; } else @@ -1799,6 +1814,10 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fi(ark_mem->tn, ark_mem->yn, step_mem->Fi[0], ark_mem->user_data); step_mem->nfi++; + + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed implicit rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return ARK_UNREC_RHSFUNC_ERR; } } @@ -1831,37 +1850,11 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } -#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 + SUNLogExtraDebugVecIf(is_start == 1 && step_mem->implicit, ARK_LOGGER, + "implicit RHS", step_mem->Fi[0], "Fi_0(:) ="); + SUNLogExtraDebugVecIf(is_start == 1 && step_mem->explicit, ARK_LOGGER, + "explicit RHS", step_mem->Fe[0], "Fe_0(:) ="); + SUNLogInfoIf(is_start == 1, ARK_LOGGER, "end-stage", "status = success"); /* loop over internal stages to the step */ for (is = is_start; is < step_mem->stages; is++) @@ -1886,21 +1879,21 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } else { ark_mem->tcur = ark_mem->tn + step_mem->Be->c[is] * ark_mem->h; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "start-stage", - "step = %li, stage = %i, implicit = %i, h = %" RSYM - ", tcur = %" RSYM, - ark_mem->nst, is, implicit_stage, ark_mem->h, - ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, implicit = %i, tcur = %" RSYM, is, implicit_stage, + ark_mem->tcur); /* setup time-dependent mass matrix */ if ((step_mem->mass_type == MASS_TIMEDEP) && (step_mem->msetup != NULL)) { retval = step_mem->msetup((void*)ark_mem, ark_mem->tcur, ark_mem->tempv1, ark_mem->tempv2, ark_mem->tempv3); - if (retval != ARK_SUCCESS) { return (ARK_MASSSETUP_FAIL); } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed mass setup, retval = %i", retval); + return (ARK_MASSSETUP_FAIL); + } } /* if implicit, call built-in and user-supplied predictors @@ -1908,7 +1901,12 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) if (implicit_stage) { retval = arkStep_Predict(ark_mem, is, step_mem->zpred); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed predict, retval = %i", retval); + return (retval); + } /* if a user-supplied predictor routine is provided, call that here. Note that arkStep_Predict is *still* called, so this user-supplied @@ -1917,28 +1915,26 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = step_mem->stage_predict(ark_mem->tcur, step_mem->zpred, ark_mem->user_data); + + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed predict, retval = %i", retval); if (retval < 0) { return (ARK_USER_PREDICT_FAIL); } if (retval > 0) { return (TRY_AGAIN); } } - } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "predictor", - "zpred(:) =", ""); - N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "predictor", step_mem->zpred, "zpred(:) ="); + } /* set up explicit data for evaluation of ARK stage (store in sdata) */ retval = arkStep_StageSetup(ark_mem, implicit_stage); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed stage setup, retval = %i", retval); + return (retval); + } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "rhs data", - "sdata(:) =", ""); - N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "rhs data", step_mem->sdata, "sdata(:) ="); /* perform implicit solve if required */ if (implicit_stage) @@ -1946,14 +1942,15 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* implicit solve result is stored in ark_mem->ycur; return with positive value on anything but success */ *nflagPtr = arkStep_Nls(ark_mem, *nflagPtr); - if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } + if (*nflagPtr != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", "status = failed solve, nflag = %i", + *nflagPtr); + return (TRY_AGAIN); + } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "implicit stage", - "z_%i(:) =", is); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "implicit stage", ark_mem->ycur, + "z_%i(:) =", is); /* otherwise no implicit solve is needed */ } @@ -1965,19 +1962,20 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* perform solve; return with positive value on anything but success */ *nflagPtr = step_mem->msolve((void*)ark_mem, step_mem->sdata, step_mem->nlscoef); - if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } + if (*nflagPtr != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed mass solve, nflag = %i", *nflagPtr); + return (TRY_AGAIN); + } } /* set y to be yn + sdata (either computed in arkStep_StageSetup, or updated in prev. block) */ N_VLinearSum(ONE, ark_mem->yn, ONE, step_mem->sdata, ark_mem->ycur); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "explicit stage", - "z_%i(:) =", is); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "explicit stage", ark_mem->ycur, + "z_%i(:) =", is); } /* apply user-supplied stage postprocessing function (if supplied) */ @@ -1987,7 +1985,12 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } } /* successful stage solve */ @@ -2003,29 +2006,40 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fi(ark_mem->tcur, ark_mem->ycur, step_mem->Fi[is], ark_mem->user_data); step_mem->nfi++; - } - else if (step_mem->mass_type == MASS_FIXED) - { - retval = step_mem->mmult((void*)ark_mem, step_mem->zcor, ark_mem->tempv1); - if (retval != ARK_SUCCESS) { return (ARK_MASSMULT_FAIL); } - N_VLinearSum(ONE / step_mem->gamma, ark_mem->tempv1, - -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fi[is]); + + SUNLogExtraDebugVec(ARK_LOGGER, "implicit RHS", step_mem->Fi[is], + "Fi_%i(:) =", is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed implicit rhs eval, retval = %i", retval); + + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } } else { - N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, - -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fi[is]); - } + if (step_mem->mass_type == MASS_FIXED) + { + retval = step_mem->mmult((void*)ark_mem, step_mem->zcor, + ark_mem->tempv1); + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed mass mult, retval = %i", retval); + return (ARK_MASSMULT_FAIL); + } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "implicit RHS", - "Fi_%i(:) =", is); - N_VPrintFile(step_mem->Fi[is], ARK_LOGGER->debug_fp); -#endif + N_VLinearSum(ONE / step_mem->gamma, ark_mem->tempv1, + -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fi[is]); + } + else + { + N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, + -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fi[is]); + } - if (retval < 0) { return (ARK_RHSFUNC_FAIL); } - if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + SUNLogExtraDebugVec(ARK_LOGGER, "implicit RHS", step_mem->Fi[is], + "Fi_%i(:) =", is); + } } /* store explicit RHS */ @@ -2035,12 +2049,10 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) 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); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "explicit RHS", step_mem->Fe[is], + "Fe_%i(:) =", is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed explicit rhs eval, retval = %i", retval); if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } @@ -2054,30 +2066,39 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { *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); } + + SUNLogExtraDebugVec(ARK_LOGGER, "M^{-1} implicit RHS", step_mem->Fi[is], + "Fi_%i(:) =", is); + + if (*nflagPtr != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed mass solve, nflag = %i", *nflagPtr); + 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); } + SUNLogExtraDebugVec(ARK_LOGGER, "M^{-1} explicit RHS", step_mem->Fe[is], + "Fe_%i(:) =", is); + if (*nflagPtr != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed mass solve, nflag = %i", *nflagPtr); + return (TRY_AGAIN); + } } } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + } /* loop over stages */ + SUNLogInfo(ARK_LOGGER, "begin-compute-solution", "mass type = %i", + step_mem->mass_type); + /* compute time-evolved solution (in ark_ycur), error estimate (in dsm). This can fail recoverably due to nonconvergence of the mass matrix solve, so handle that appropriately. */ @@ -2086,21 +2107,15 @@ int arkStep_TakeStep_Z(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) *nflagPtr = arkStep_ComputeSolutions_MassFixed(ark_mem, dsmPtr); } else { *nflagPtr = arkStep_ComputeSolutions(ark_mem, dsmPtr); } + + SUNLogInfoIf(*nflagPtr != ARK_SUCCESS, ARK_LOGGER, "end-compute-solution", + "status = failed compute solution, retval = %i", *nflagPtr); + if (*nflagPtr < 0) { return (*nflagPtr); } if (*nflagPtr > 0) { return (TRY_AGAIN); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_TakeStep_Z", - "updated solution", "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_INFO, - "ARKODE::arkStep_TakeStep_Z", "end-step", - "step = %li, h = %" RSYM ", dsm = %" RSYM ", nflag = %d", - ark_mem->nst, ark_mem->h, *dsmPtr, *nflagPtr); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + SUNLogInfo(ARK_LOGGER, "end-compute-solution", "status = success"); return (ARK_SUCCESS); } diff --git a/src/arkode/arkode_arkstep_nls.c b/src/arkode/arkode_arkstep_nls.c index 939a82ad02..75aad1c968 100644 --- a/src/arkode/arkode_arkstep_nls.c +++ b/src/arkode/arkode_arkstep_nls.c @@ -418,16 +418,15 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) /* Reset the stored residual norm (for iterative linear solvers) */ step_mem->eRNrm = SUN_RCONST(0.1) * step_mem->nlscoef; + SUNLogInfo(ARK_LOGGER, "begin-nonlinear-solve", "tol = %.16g", + step_mem->nlscoef); + /* solve the nonlinear system for the actual correction */ retval = SUNNonlinSolSolve(step_mem->NLS, step_mem->zpred, step_mem->zcor, ark_mem->ewt, step_mem->nlscoef, callLSetup, ark_mem); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkStep_Nls", - "correction", "zcor(:) =", ""); - N_VPrintFile(step_mem->zcor, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "correction", step_mem->zcor, "zcor(:) ="); /* increment counters */ (void)SUNNonlinSolGetNumIters(step_mem->NLS, &nls_iters_inc); @@ -441,9 +440,16 @@ int arkStep_Nls(ARKodeMem ark_mem, int nflag) { step_mem->jcur = SUNFALSE; N_VLinearSum(ONE, step_mem->zcor, ONE, step_mem->zpred, ark_mem->ycur); + + SUNLogInfo(ARK_LOGGER, "end-nonlinear-solve", + "status = success, iters = %li", nls_iters_inc); + return (ARK_SUCCESS); } + SUNLogInfo(ARK_LOGGER, "end-nonlinear-solve", + "status = failed, retval = %i, iters = %li", retval, nls_iters_inc); + /* check for recoverable failure, return ARKODE::CONV_FAIL */ if (retval == SUN_NLS_CONV_RECVR) { return (CONV_FAIL); } diff --git a/src/arkode/arkode_erkstep.c b/src/arkode/arkode_erkstep.c index a62b732afc..1cf08548f9 100644 --- a/src/arkode/arkode_erkstep.c +++ b/src/arkode/arkode_erkstep.c @@ -743,21 +743,9 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) cvals = step_mem->cvals; Xvecs = step_mem->Xvecs; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "stage RHS", "F_0(:) =", ""); - N_VPrintFile(step_mem->F[0], ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = 0, tcur = %" RSYM, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* 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 @@ -770,10 +758,18 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) 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; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } ark_mem->fn_is_current = SUNTRUE; } + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->F[0], "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + /* 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; is < step_mem->stages; is++) @@ -781,12 +777,8 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Set current stage time(s) */ ark_mem->tcur = ark_mem->tn + step_mem->B->c[is] * ark_mem->h; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::erkStep_TakeStep", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, is, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, is, + ark_mem->tcur); /* Set ycur to current stage solution */ nvec = 0; @@ -814,46 +806,56 @@ int erkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* call fused vector operation to do the work */ retval = N_VLinearCombination(nvec, cvals, Xvecs, ark_mem->ycur); - if (retval != 0) { return (ARK_VECTOROP_ERR); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return (ARK_VECTOROP_ERR); + } /* apply user-supplied stage postprocessing function (if supplied) */ if (ark_mem->ProcessStage != NULL) { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } } /* compute updated RHS */ retval = step_mem->f(ark_mem->tcur, ark_mem->ycur, step_mem->F[is], ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->F[is], + "F_%i(:) =", is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::erkStep_TakeStep", "stage RHS", "F_%i(:) =", is); - N_VPrintFile(step_mem->F[is], ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); } /* loop over stages */ + SUNLogInfo(ARK_LOGGER, "begin-compute-solution", ""); + /* compute time-evolved solution (in ark_ycur), error estimate (in dsm) */ retval = erkStep_ComputeSolutions(ark_mem, dsmPtr); - if (retval < 0) { return (retval); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "updated solution", "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + if (retval < 0) + { + SUNLogInfo(ARK_LOGGER, "end-compute-solution", + "status = failed compute solution, retval = %i", retval); + return (retval); + } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::erkStep_TakeStep", - "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, - ark_mem->nst, ark_mem->h, *dsmPtr); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + SUNLogInfo(ARK_LOGGER, "end-compute-solution", "status = success"); return (ARK_SUCCESS); } diff --git a/src/arkode/arkode_forcingstep.c b/src/arkode/arkode_forcingstep.c index 9f839aba89..48fc14954e 100644 --- a/src/arkode/arkode_forcingstep.c +++ b/src/arkode/arkode_forcingstep.c @@ -234,37 +234,85 @@ static int forcingStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, SUNStepper s0 = step_mem->stepper[0]; sunrealtype tout = ark_mem->tn + ark_mem->h; - sunrealtype tret = 0; + sunrealtype tret = ZERO; /* Evolve stepper 0 on its own */ + SUNLogInfo(ARK_LOGGER, "begin-partition", "partition = 0"); + SUNErrCode err = SUNStepper_Reset(s0, ark_mem->tn, ark_mem->yn); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed stepper reset, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } + err = SUNStepper_SetStopTime(s0, tout); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set stop time, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } + err = SUNStepper_Evolve(s0, tout, ark_mem->ycur, &tret); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + SUNLogExtraDebugVec(ARK_LOGGER, "partition state", ark_mem->ycur, "y_par(:) ="); + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", "status = failed evolve, err = %i", + err); + return ARK_SUNSTEPPER_ERR; + } step_mem->n_stepper_evolves[0]++; + SUNLogInfo(ARK_LOGGER, "end-partition", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-partition", "partition = 1"); + SUNStepper s1 = step_mem->stepper[1]; /* A reset is not needed because steeper 1's state is consistent with the * forcing method */ err = SUNStepper_SetStopTime(s1, tout); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set stop time, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } /* Write tendency (ycur - yn)/h into stepper 1 forcing */ sunrealtype hinv = SUN_RCONST(1.0) / ark_mem->h; N_VLinearSum(hinv, ark_mem->ycur, -hinv, ark_mem->yn, ark_mem->tempv1); err = SUNStepper_SetForcing(s1, ZERO, ZERO, &ark_mem->tempv1, 1); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + SUNLogExtraDebugVec(ARK_LOGGER, "forcing", ark_mem->tempv1, "forcing(:) ="); + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set forcing, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } /* Evolve stepper 1 with the forcing */ err = SUNStepper_Evolve(s1, tout, ark_mem->ycur, &tret); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + SUNLogExtraDebugVec(ARK_LOGGER, "partition state", ark_mem->ycur, "y_par(:) ="); + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", "status = failed evolve, err = %i", + err); + return ARK_SUNSTEPPER_ERR; + } step_mem->n_stepper_evolves[1]++; /* Clear the forcing so it doesn't get included in a fullRhs call */ err = SUNStepper_SetForcing(s1, ZERO, ZERO, NULL, 0); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set forcing, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } + + SUNLogInfo(ARK_LOGGER, "end-partition", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "current state", ark_mem->ycur, "y_cur(:) ="); return ARK_SUCCESS; } diff --git a/src/arkode/arkode_interp.c b/src/arkode/arkode_interp.c index 5bff398e6e..82b0a40b98 100644 --- a/src/arkode/arkode_interp.c +++ b/src/arkode/arkode_interp.c @@ -460,11 +460,8 @@ int arkInterpEvaluate_Hermite(ARKodeMem ark_mem, ARKInterp interp, q = SUNMAX(order, 0); /* respect lower bound */ q = SUNMIN(q, HINT_DEGREE(interp)); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkInterpEvaluate_Hermite", "interp-eval", - "tau = %" RSYM ", d = %i, q = %i", tau, d, q); -#endif + SUNLogDebug(ARK_LOGGER, "interp-eval", "tau = %" RSYM ", d = %i, q = %i", tau, + d, q); /* call full RHS if needed -- called just AFTER the end of a step, so yn has been updated to ycur */ @@ -1203,11 +1200,8 @@ int arkInterpEvaluate_Lagrange(ARKodeMem ark_mem, ARKInterp I, sunrealtype tau, q = SUNMAX(degree, 0); /* respect lower bound */ q = SUNMIN(q, nhist - 1); /* respect max possible */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkInterpEvaluate_Lagrange", "interp-eval", - "tau = %" RSYM ", d = %i, q = %i", tau, deriv, q); -#endif + SUNLogDebug(ARK_LOGGER, "interp-eval", "tau = %" RSYM ", d = %i, q = %i", tau, + deriv, q); /* error on illegal deriv */ if ((deriv < 0) || (deriv > 3)) diff --git a/src/arkode/arkode_ls.c b/src/arkode/arkode_ls.c index 69c74c358e..e3ae45c59c 100644 --- a/src/arkode/arkode_ls.c +++ b/src/arkode/arkode_ls.c @@ -3290,13 +3290,16 @@ int arkLsSetup(ARKodeMem ark_mem, int convfail, sunrealtype tpred, int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, N_Vector fnow, sunrealtype eRNrm, int mnewt) { - sunrealtype bnorm, resnorm; + sunrealtype bnorm; ARKLsMem arkls_mem; sunrealtype gamma, gamrat, delta, deltar, rwt_mean; sunbooleantype dgamma_fail, *jcur; - long int nps_inc; int nli_inc, retval; + /* used when logging is enabled */ + SUNDIALS_MAYBE_UNUSED long int nps_inc; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm; + /* access ARKLsMem structure */ retval = arkLs_AccessLMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } @@ -3314,16 +3317,30 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, { deltar = arkls_mem->eplifac * eRNrm; bnorm = N_VWrmsNorm(b, ark_mem->rwt); + + SUNLogInfo(ARK_LOGGER, "begin-linear-solve", + "iterative = 1, b-norm = %.16g, b-tol = %.16g, res-tol = %.16g", + bnorm, deltar, deltar * arkls_mem->nrmfac); + if (bnorm <= deltar) { if (mnewt > 0) { N_VConst(ZERO, b); } arkls_mem->last_flag = ARKLS_SUCCESS; + + SUNLogInfo(ARK_LOGGER, "end-linear-solve", "status = success small rhs", + ""); + return (arkls_mem->last_flag); } /* Adjust tolerance for 2-norm */ delta = deltar * arkls_mem->nrmfac; } - else { delta = bnorm = ZERO; } + else + { + delta = bnorm = ZERO; + + SUNLogInfo(ARK_LOGGER, "begin-linear-solve", "iterative = 0"); + } /* Set scaling vectors for LS to use (if applicable) */ if (arkls_mem->LS->ops->setscalingvectors) @@ -3335,6 +3352,10 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, arkProcessError(ark_mem, ARKLS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in call to SUNLinSolSetScalingVectors"); arkls_mem->last_flag = ARKLS_SUNLS_FAIL; + + SUNLogInfo(ARK_LOGGER, "end-linear-solve", + "status = failed set scaling vectors"); + return (arkls_mem->last_flag); } @@ -3365,7 +3386,12 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(arkls_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-linear-solve", "status = failed set zero guess", + ""); + return (-1); + } /* Store previous nps value in nps_inc */ nps_inc = arkls_mem->nps; @@ -3380,6 +3406,8 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, { arkProcessError(ark_mem, arkls_mem->last_flag, __LINE__, __func__, __FILE__, MSG_LS_JTSETUP_FAILED); + + SUNLogInfo(ARK_LOGGER, "end-linear-solve", "status = failed J-times setup"); return (arkls_mem->last_flag); } } @@ -3422,22 +3450,16 @@ int arkLsSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype tnow, N_Vector ynow, arkls_mem->nli += nli_inc; if (retval != SUN_SUCCESS) { arkls_mem->ncfl++; } - /* Log solver statistics to diagnostics file (if requested) */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::arkLsSolve", - "ls-stats", - "bnorm = %" RSYM ", resnorm = %" RSYM - ", ls_iters = %i, prec_solves = %i", - bnorm, 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 */ arkls_mem->last_flag = retval; + SUNLogInfoIf(retval == SUN_SUCCESS, ARK_LOGGER, "end-linear-solve", + "status = success, iters = %i, p-solves = %i, resnorm = %.16g", + nli_inc, (int)(arkls_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, ARK_LOGGER, + "end-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, resnorm = %.16g", + retval, nli_inc, (int)(arkls_mem->nps - nps_inc), resnorm); + switch (retval) { case SUN_SUCCESS: return (0); break; @@ -3762,11 +3784,14 @@ int arkLsMassSetup(ARKodeMem ark_mem, sunrealtype t, N_Vector vtemp1, ---------------------------------------------------------------*/ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) { - sunrealtype resnorm, delta, rwt_mean; + sunrealtype delta, rwt_mean; ARKLsMassMem arkls_mem; - long int nps_inc; int nli_inc, retval; + /* used when logging is enabled */ + SUNDIALS_MAYBE_UNUSED long int nps_inc; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm; + /* access ARKLsMassMem structure */ retval = arkLs_AccessMassMem(ark_mem, __func__, &arkls_mem); if (retval != ARK_SUCCESS) { return (retval); } @@ -3775,8 +3800,16 @@ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) if (arkls_mem->iterative) { delta = arkls_mem->eplifac * nlscoef * arkls_mem->nrmfac; + + SUNLogInfo(ARK_LOGGER, "begin-mass-linear-solve", + "iterative = 1, res-tol = %.16g", delta); + } + else + { + delta = ZERO; + + SUNLogInfo(ARK_LOGGER, "begin-mass-linear-solve", "iterative = 0"); } - else { delta = ZERO; } /* Set initial guess x = 0 for LS */ N_VConst(ZERO, arkls_mem->x); @@ -3791,6 +3824,9 @@ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) arkProcessError(ark_mem, ARKLS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in call to SUNLinSolSetScalingVectors"); arkls_mem->last_flag = ARKLS_SUNLS_FAIL; + + SUNLogInfo(ARK_LOGGER, "end-mass-linear-solve", + "status = failed set scaling vectors"); return (arkls_mem->last_flag); } @@ -3821,7 +3857,12 @@ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(arkls_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-mass-linear-solve", + "status = failed set zero guess"); + return (-1); + } /* Store previous nps value in nps_inc */ nps_inc = arkls_mem->nps; @@ -3850,17 +3891,12 @@ int arkLsMassSolve(ARKodeMem ark_mem, N_Vector b, sunrealtype nlscoef) arkls_mem->nli += nli_inc; if (retval != SUN_SUCCESS) { arkls_mem->ncfl++; } - /* Log solver statistics to diagnostics file (if requested) */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "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 + SUNLogInfoIf(retval == SUN_SUCCESS, ARK_LOGGER, "end-mass-linear-solve", + "status = success, iters = %i, p-solves = %i, res-norm = %.16g", + nli_inc, (int)(arkls_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, ARK_LOGGER, + "end-mass-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, res-norm = %.16g", + retval, nli_inc, (int)(arkls_mem->nps - nps_inc), resnorm); /* Interpret solver return value */ arkls_mem->last_flag = retval; diff --git a/src/arkode/arkode_lsrkstep.c b/src/arkode/arkode_lsrkstep.c index ce6d56fc6b..7c0ed55d28 100644 --- a/src/arkode/arkode_lsrkstep.c +++ b/src/arkode/arkode_lsrkstep.c @@ -528,6 +528,12 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) if (ss >= step_mem->stage_max_limit) { + SUNLogInfo(ARK_LOGGER, "compute-num-stages", + "spectral radius = %" RSYM ", num stages = %" RSYM + ", max stages = %i, max stage limit = %i", + step_mem->spectral_radius, ss, step_mem->stage_max, + step_mem->stage_max_limit); + if (!ark_mem->fixedstep) { hmax = ark_mem->hadapt_mem->safety * SUNSQR(step_mem->stage_max_limit) / @@ -550,12 +556,14 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) step_mem->req_stages = (int)ss; step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "compute-num-stages", + "spectral radius = %" RSYM + ", num stages = %i, max stages = %i, max stage limit = %i", + step_mem->spectral_radius, step_mem->req_stages, + step_mem->stage_max, step_mem->stage_max_limit); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* Compute RHS function, if necessary. */ if ((!ark_mem->fn_is_current && ark_mem->initsetup) || @@ -564,22 +572,22 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, ark_mem->user_data); step_mem->nfe++; + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } } + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + /* Track the number of successful steps to determine if the previous step failed. */ step_mem->step_nst = ark_mem->nst + 1; -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "stage RHS", "F(:) =", ""); - N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); -#endif - w0 = (ONE + TWO / (c13 * SUNSQR((sunrealtype)(step_mem->req_stages)))); temp1 = SUNSQR(w0) - ONE; @@ -597,6 +605,9 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) mus = w1 * bjm1; + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + ark_mem->h * mus); + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * mus, ark_mem->fn, ark_mem->tempv2); /* apply user-supplied stage postprocessing function (if supplied) */ @@ -604,7 +615,12 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * mus, ark_mem->tempv2, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } thjm2 = ZERO; @@ -628,27 +644,26 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) nu = -bj / bjm2; mus = mu * w1 / w0; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + ark_mem->h * thjm1); -#endif - /* Use the ycur array for temporary storage here */ retval = step_mem->fe(ark_mem->tcur + ark_mem->h * thjm1, ark_mem->tempv2, ark_mem->ycur, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->ycur, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + + /* compute new stage time factor */ + thj = mu * thjm1 + nu * thjm2 + mus * (ONE - ajm1); + + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + ark_mem->h * thj); cvals[0] = mus * ark_mem->h; Xvecs[0] = ark_mem->ycur; @@ -662,17 +677,24 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) Xvecs[4] = ark_mem->fn; retval = N_VLinearCombination(5, cvals, Xvecs, ark_mem->ycur); - if (retval != 0) { return ARK_VECTOROP_ERR; } - - /* compute new stage time factor */ - thj = mu * thjm1 + nu * thjm2 + mus * (ONE - ajm1); + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } /* apply user-supplied stage postprocessing function (if supplied) */ if (ark_mem->ProcessStage != NULL && j < step_mem->req_stages) { retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * thj, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } /* Shift the data for the next stage */ @@ -698,12 +720,21 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + SUNLogInfo(ARK_LOGGER, "begin-compute-embedding", ""); + /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "solution RHS", ark_mem->tempv2, "F_n(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } @@ -718,8 +749,12 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) Xvecs[3] = ark_mem->tempv2; retval = N_VLinearCombination(4, cvals, Xvecs, ark_mem->tempv1); - if (retval != 0) { return ARK_VECTOROP_ERR; } - + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); } @@ -728,25 +763,18 @@ int lsrkStep_TakeStepRKC(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "solution RHS", ark_mem->tempv2, "F_n(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKC", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", "status = success"); return ARK_SUCCESS; } @@ -813,6 +841,12 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) if (ss >= step_mem->stage_max_limit) { + SUNLogInfo(ARK_LOGGER, "compute-num-stages", + "spectral radius = %" RSYM ", num stages = %" RSYM + ", max stages = %i, max stage limit = %i", + step_mem->spectral_radius, ss, step_mem->stage_max, + step_mem->stage_max_limit); + if (!ark_mem->fixedstep) { hmax = @@ -837,12 +871,14 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) step_mem->req_stages = (int)ss; step_mem->stage_max = SUNMAX(step_mem->req_stages, step_mem->stage_max); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "compute-num-stages", + "spectral radius = %" RSYM + ", num stages = %i, max stages = %i, max stage limit = %i", + step_mem->spectral_radius, step_mem->req_stages, + step_mem->stage_max, step_mem->stage_max_limit); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* Compute RHS function, if necessary. */ if ((!ark_mem->fn_is_current && ark_mem->initsetup) || @@ -851,22 +887,22 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, ark_mem->user_data); step_mem->nfe++; + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } } + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + /* Track the number of successful steps to determine if the previous step failed. */ step_mem->step_nst = ark_mem->nst + 1; -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "stage RHS", "F(:) =", ""); - N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); -#endif - w1 = FOUR / ((step_mem->req_stages + TWO) * (step_mem->req_stages - ONE)); bjm2 = ONE / THREE; @@ -878,6 +914,9 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) mus = w1 * bjm1; cjm1 = mus; + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + ark_mem->h * mus); + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * mus, ark_mem->fn, ark_mem->tempv2); /* apply user-supplied stage postprocessing function (if supplied) */ @@ -885,7 +924,12 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * mus, ark_mem->tempv2, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } /* Evaluate stages j = 2,...,step_mem->req_stages */ @@ -899,27 +943,22 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) mus = w1 * mu; cj = temj * w1 / FOUR; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + ark_mem->h * cjm1); -#endif - /* Use the ycur array for temporary storage here */ retval = step_mem->fe(ark_mem->tcur + ark_mem->h * cjm1, ark_mem->tempv2, ark_mem->ycur, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->ycur, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + ark_mem->h * cj); cvals[0] = mus * ark_mem->h; Xvecs[0] = ark_mem->ycur; @@ -933,14 +972,24 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) Xvecs[4] = ark_mem->fn; retval = N_VLinearCombination(5, cvals, Xvecs, ark_mem->ycur); - if (retval != 0) { return ARK_VECTOROP_ERR; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } /* apply user-supplied stage postprocessing function (if supplied) */ if (ark_mem->ProcessStage != NULL && j < step_mem->req_stages) { retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * cj, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } /* Shift the data for the next stage */ @@ -959,12 +1008,21 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + SUNLogInfo(ARK_LOGGER, "begin-compute-embedding", ""); + /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "solution RHS", ark_mem->tempv2, "F_n(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } @@ -979,8 +1037,12 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) Xvecs[3] = ark_mem->tempv2; retval = N_VLinearCombination(4, cvals, Xvecs, ark_mem->tempv1); - if (retval != 0) { return ARK_VECTOROP_ERR; } - + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); } @@ -989,25 +1051,18 @@ int lsrkStep_TakeStepRKL(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "solution RHS", ark_mem->tempv2, "F_n(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } lsrkStep_DomEigUpdateLogic(ark_mem, step_mem, *dsmPtr); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepRKL", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", "status = success"); return ARK_SUCCESS; } @@ -1068,12 +1123,9 @@ int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr bt3 = (rs - ONE) / (rs * rs); } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* The method is not FSAL. Therefore, fn ​is computed at the beginning of the step unless a renewed step or ARKODE updated fn. */ @@ -1082,18 +1134,20 @@ int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, ark_mem->user_data); step_mem->nfe++; + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", "F(:) =", ""); - N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + ark_mem->h * sm1inv); N_VLinearSum(ONE, ark_mem->yn, sm1inv * ark_mem->h, ark_mem->fn, ark_mem->ycur); if (!ark_mem->fixedstep) @@ -1107,34 +1161,33 @@ int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tn + sm1inv * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } /* Evaluate stages j = 2,...,step_mem->req_stages - 1 */ for (int j = 2; j < step_mem->req_stages; j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + - ((sunrealtype)j - ONE) * sm1inv * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * sm1inv * ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv2, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + ark_mem->h * j * sm1inv); N_VLinearSum(ONE, ark_mem->ycur, sm1inv * ark_mem->h, ark_mem->tempv2, ark_mem->ycur); @@ -1149,31 +1202,31 @@ int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tcur + j * sm1inv * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, step_mem->req_stages, ark_mem->h, - ark_mem->tcur + ark_mem->h); -#endif - /* Evaluate the last stage for j = step_mem->req_stages */ retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv2, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv2, + "F_%i(:) =", step_mem->req_stages - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "stage RHS", - "F_%i(:) =", step_mem->req_stages); - N_VPrintFile(ark_mem->tempv2, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, + step_mem->req_stages, ark_mem->tn + ark_mem->h); cvals[0] = ONE / (sm1inv * rs); Xvecs[0] = ark_mem->ycur; @@ -1183,34 +1236,28 @@ int lsrkStep_TakeStepSSPs2(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr Xvecs[2] = ark_mem->tempv2; retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); - if (!ark_mem->fixedstep) + if (retval != 0) { - N_VLinearSum(ONE, ark_mem->tempv1, bt3 * ark_mem->h, ark_mem->tempv2, - ark_mem->tempv1); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { - N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); + N_VLinearSum(ONE, ark_mem->tempv1, bt3 * ark_mem->h, ark_mem->tempv2, + ark_mem->tempv1); + SUNLogExtraDebugVec(ARK_LOGGER, "embedded solution", ark_mem->tempv1, + "y_embedded(:) ="); + N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs2", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif - return ARK_SUCCESS; } @@ -1260,12 +1307,9 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr sunrealtype rat = ONE / (rs - rn); int in = (int)SUNRround(rn); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* The method is not FSAL. Therefore, fn ​is computed at the beginning of the step unless ARKODE updated fn. */ @@ -1274,10 +1318,21 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, ark_mem->user_data); step_mem->nfe++; + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } } + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + rat * ark_mem->h); + N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * rat, ark_mem->fn, ark_mem->ycur); if (!ark_mem->fixedstep) { @@ -1289,33 +1344,33 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * rat, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } /* Evaluate stages j = 2,...,step_mem->req_stages */ for (int j = 2; j <= ((in - 1) * (in - 2) / 2); j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + j * rat * ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, ark_mem->ycur); @@ -1330,7 +1385,12 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tcur + j * rat * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } } @@ -1338,27 +1398,22 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr for (int j = ((in - 1) * (in - 2) / 2 + 1); j <= (in * (in + 1) / 2 - 1); j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * rat * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + j * rat * ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, ark_mem->ycur); @@ -1373,32 +1428,32 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tcur + j * rat * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, (in * (in + 1) / 2), ark_mem->h, - ark_mem->tcur + - rat * (rn * (rn + ONE) / TWO - ONE) * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + rat * (rn * (rn + ONE) / TWO - ONE) * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, + "F_%i(:) =", in * (in + 1) / 2 - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", - "F_%i(:) =", (in * (in + 1) / 2)); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, + (in * (in + 1) / 2), + ark_mem->tn + (in * (in - 1) / 2) * rat * ark_mem->h); cvals[0] = (rn - ONE) / (TWO * rn - ONE); Xvecs[0] = ark_mem->ycur; @@ -1408,6 +1463,13 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr Xvecs[2] = ark_mem->tempv3; retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } + if (!ark_mem->fixedstep) { N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, @@ -1417,37 +1479,30 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr /* apply user-supplied stage postprocessing function (if supplied) */ if (ark_mem->ProcessStage != NULL) { - retval = - ark_mem->ProcessStage(ark_mem->tcur + - rat * (rn * (rn + ONE) / TWO - rn) * ark_mem->h, - ark_mem->ycur, ark_mem->user_data); + retval = ark_mem->ProcessStage(ark_mem->tcur + + rat * (rn * (rn - ONE) / TWO) * ark_mem->h, + ark_mem->ycur, ark_mem->user_data); if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } } for (int j = (in * (in + 1) / 2 + 1); j <= step_mem->req_stages; j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + - ((sunrealtype)j - rn - ONE) * rat * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - rn - ONE) * rat * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + ((sunrealtype)j - rn) * rat * ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * rat, ark_mem->tempv3, ark_mem->ycur); @@ -1463,31 +1518,29 @@ int lsrkStep_TakeStepSSPs3(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr retval = ark_mem->ProcessStage(ark_mem->tcur + ((sunrealtype)j - rn) * rat * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + SUNLogInfo(ARK_LOGGER, "begin-compute-embedding", ""); + /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { + SUNLogExtraDebugVec(ARK_LOGGER, "embedded solution", ark_mem->tempv1, + "y_embedded(:) ="); N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); - *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSPs3", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", "status = success"); return ARK_SUCCESS; } @@ -1536,12 +1589,9 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr sunrealtype rs = SUN_RCONST(4.0); sunrealtype p5 = SUN_RCONST(0.5); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* The method is not FSAL. Therefore, fn ​is computed at the beginning of the step unless ARKODE updated fn. */ @@ -1551,17 +1601,19 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr ark_mem->user_data); step_mem->nfe++; ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", "F(:) =", ""); - N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + p5 * ark_mem->h); N_VLinearSum(ONE, ark_mem->yn, ark_mem->h * p5, ark_mem->fn, ark_mem->ycur); if (!ark_mem->fixedstep) @@ -1574,29 +1626,28 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tn + ark_mem->h * p5, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, 2, ark_mem->h, - ark_mem->tcur + ark_mem->h * p5); -#endif - retval = step_mem->fe(ark_mem->tcur + ark_mem->h * p5, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, "F_1(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", - "F_%i(:) =", 2); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 2, + ark_mem->tn + ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * p5, ark_mem->tempv3, ark_mem->ycur); @@ -1611,28 +1662,28 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, 3, ark_mem->h, ark_mem->tcur + ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, "F_2(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", - "F_%i(:) =", 3); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 3, + ark_mem->tn + p5 * ark_mem->h); cvals[0] = ONE / THREE; Xvecs[0] = ark_mem->ycur; @@ -1642,6 +1693,13 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr Xvecs[2] = ark_mem->tempv3; retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } + if (!ark_mem->fixedstep) { N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, @@ -1653,60 +1711,47 @@ int lsrkStep_TakeStepSSP43(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr { retval = ark_mem->ProcessStage(ark_mem->tcur + ark_mem->h * p5, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, 4, ark_mem->h, - ark_mem->tcur + ark_mem->h * p5); -#endif - retval = step_mem->fe(ark_mem->tcur + ark_mem->h * p5, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, "F_3(:) ="); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "stage RHS", - "F_%i(:) =", 4); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, + step_mem->req_stages, ark_mem->tn + ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, ark_mem->h * p5, ark_mem->tempv3, ark_mem->ycur); + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + + /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { N_VLinearSum(ONE, ark_mem->tempv1, ark_mem->h / rs, ark_mem->tempv3, ark_mem->tempv1); - } + SUNLogExtraDebugVec(ARK_LOGGER, "embedded solution", ark_mem->tempv1, + "y_embedded(:) ="); - /* Compute yerr (if step adaptivity enabled) */ - if (!ark_mem->fixedstep) - { N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); - *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP43", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif - return ARK_SUCCESS; } @@ -1749,12 +1794,9 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt sunrealtype* cvals = step_mem->cvals; N_Vector* Xvecs = step_mem->Xvecs; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", - "step = %li, stage = 0, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, ark_mem->h, ark_mem->tcur); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 0, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", ark_mem->yn, "z_0(:) ="); /* The method is not FSAL. Therefore, fn ​is computed at the beginning of the step unless ARKODE updated fn. */ @@ -1763,19 +1805,20 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt retval = step_mem->fe(ark_mem->tn, ark_mem->yn, ark_mem->fn, ark_mem->user_data); step_mem->nfe++; + if (retval != ARK_SUCCESS) + { + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } ark_mem->fn_is_current = SUNTRUE; - if (retval != ARK_SUCCESS) { return (ARK_RHSFUNC_FAIL); } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", - "F(:) =", ""); - N_VPrintFile(ark_mem->fn, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->fn, "F_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 1, + ark_mem->tn + onesixth * ark_mem->h); N_VScale(ONE, ark_mem->yn, ark_mem->tempv2); @@ -1790,37 +1833,36 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt /* Evaluate stages j = 2,...,step_mem->req_stages */ for (int j = 2; j <= 5; j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + - ((sunrealtype)j - ONE) * onesixth * ark_mem->h); -#endif - /* apply user-supplied stage postprocessing function (if supplied) */ if (ark_mem->ProcessStage != NULL) { retval = ark_mem->ProcessStage(ark_mem->tcur + ((sunrealtype)j - ONE) * onesixth * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - ONE) * onesixth * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, + "F_%i(:) =", j - 1); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j, + ark_mem->tn + j * onesixth * ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, onesixth * ark_mem->h, ark_mem->tempv3, ark_mem->ycur); @@ -1830,6 +1872,11 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt ark_mem->tempv3, ark_mem->tempv1); } } + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, 6, + ark_mem->tn + TWO * onesixth * ark_mem->h); + N_VLinearSum(SUN_RCONST(1.0) / SUN_RCONST(25.0), ark_mem->tempv2, SUN_RCONST(9.0) / SUN_RCONST(25.0), ark_mem->ycur, ark_mem->tempv2); @@ -1841,33 +1888,31 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { retval = ark_mem->ProcessStage(ark_mem->tcur + TWO * onesixth * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } for (int j = 6; j <= 9; j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, j, ark_mem->h, - ark_mem->tcur + - ((sunrealtype)j - FOUR) * onesixth * ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ((sunrealtype)j - FOUR) * onesixth * ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, "F_%i(:) =", j); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", - "F_%i(:) =", j); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i, tcur = %" RSYM, j + 1, + ark_mem->tn + (j - 3) * onesixth * ark_mem->h); N_VLinearSum(ONE, ark_mem->ycur, onesixth * ark_mem->h, ark_mem->tempv3, ark_mem->ycur); @@ -1889,30 +1934,26 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt retval = ark_mem->ProcessStage(ark_mem->tcur + ((sunrealtype)j - THREE) * onesixth * ark_mem->h, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return ARK_POSTPROCESS_STAGE_FAIL; } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return ARK_POSTPROCESS_STAGE_FAIL; + } } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "start-stage", - "step = %li, stage = %i, h = %" RSYM ", tcur = %" RSYM, - ark_mem->nst, 10, ark_mem->h, ark_mem->tcur + ark_mem->h); -#endif - retval = step_mem->fe(ark_mem->tcur + ark_mem->h, ark_mem->ycur, ark_mem->tempv3, ark_mem->user_data); step_mem->nfe++; + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", ark_mem->tempv3, "F_10(:) =", 9); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return ARK_RHSFUNC_FAIL; } if (retval > 0) { return RHSFUNC_RECVR; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "stage RHS", - "F_%i(:) =", 10); - N_VPrintFile(ark_mem->tempv3, ARK_LOGGER->debug_fp); -#endif - cvals[0] = SUN_RCONST(0.6); Xvecs[0] = ark_mem->ycur; cvals[1] = ONE; @@ -1921,29 +1962,25 @@ int lsrkStep_TakeStepSSP104(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt Xvecs[2] = ark_mem->tempv3; retval = N_VLinearCombination(3, cvals, Xvecs, ark_mem->ycur); + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return ARK_VECTOROP_ERR; + } + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); /* Compute yerr (if step adaptivity enabled) */ if (!ark_mem->fixedstep) { + SUNLogExtraDebugVec(ARK_LOGGER, "embedded solution", ark_mem->tempv1, + "y_embedded(:) ="); N_VLinearSum(ONE, ark_mem->ycur, -ONE, ark_mem->tempv1, ark_mem->tempv1); - *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "updated solution", - "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif - -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::lsrkStep_TakeStepSSP104", "error-test", - "step = %li, h = %" RSYM ", dsm = %" RSYM, ark_mem->nst, - ark_mem->h, *dsmPtr); -#endif - return ARK_SUCCESS; } diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 823324bf81..0c334a86d8 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -1832,6 +1832,11 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt } } + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = 0, stage type = %d, tcur = %" RSYM, MRISTAGE_FIRST, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, "z_0(:) ="); + /* Evaluate the slow RHS functions if needed. NOTE: we decide between calling the full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner integrator) versus just updating the stored values of Fse[0] and Fsi[0]. In @@ -1843,7 +1848,12 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed update F0 eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } /* For a nested MRI configuration we might still need fn to create a predictor but it should be fn only for the current nesting level which is why we use @@ -1861,33 +1871,20 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { retval = mriStep_FullRHS(ark_mem, ark_mem->tn, ark_mem->yn, ark_mem->fn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed full rhs eval, retval = %i", 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->tn); -#endif - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); - - if (step_mem->explicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow explicit RHS", "Fse_0(:) =", ""); - N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); - } - if (step_mem->implicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow implicit RHS", "Fsi_0(:) =", ""); - N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); - } -#endif + SUNLogExtraDebugVecIf(step_mem->explicit_rhs, ARK_LOGGER, "slow explicit RHS", + step_mem->Fse[0], "Fse_0(:) ="); + SUNLogExtraDebugVecIf(step_mem->implicit_rhs, ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[0], "Fsi_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); /* The first stage is the previous time-step solution, so its RHS is the [already-computed] slow RHS from the start of the step */ @@ -1899,15 +1896,9 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt t0 = ark_mem->tn + step_mem->MRIC->c[is - 1] * ark_mem->h; tf = ark_mem->tcur = ark_mem->tn + step_mem->MRIC->c[is] * ark_mem->h; - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "start-stage", - "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 + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, stage type = %d, tcur = %" RSYM, is, + step_mem->stagetypes[is], ark_mem->tcur); /* Determine current stage type, and call corresponding routine; the vector ark_mem->ycur stores the previous stage solution on input, and @@ -1916,29 +1907,41 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { case (MRISTAGE_ERK_FAST): retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); - if (retval != ARK_SUCCESS) { return retval; } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed forcing computation, retval = %i", retval); + return retval; + } retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, ark_mem->tempv2, need_inner_dsm); - if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + if (retval != ARK_SUCCESS) + { + *nflagPtr = CONV_FAIL; + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed fast ERK stage, retval = %i", retval); + } break; case (MRISTAGE_ERK_NOFAST): retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed ERK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_NOFAST): retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed DIRK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_FAST): retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed fast DIRK stage, retval = %i", retval); break; case (MRISTAGE_STIFF_ACC): retval = ARK_SUCCESS; break; } if (retval != ARK_SUCCESS) { return retval; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, "z_%i(:) =", is); /* apply user-supplied stage postprocessing function (if supplied) */ if ((ark_mem->ProcessStage != NULL) && @@ -1946,7 +1949,12 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } } /* conditionally reset the inner integrator with the modified stage solution */ @@ -1958,6 +1966,8 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt retval = mriStepInnerStepper_Reset(step_mem->stepper, tf, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -1983,6 +1993,13 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt step_mem->Fse[step_mem->stage_map[is]], ark_mem->user_data); step_mem->nfse++; + + SUNLogExtraDebugVec(ARK_LOGGER, "slow explicit RHS", + step_mem->Fse[step_mem->stage_map[is]], + "Fse_%i(:) =", is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed explicit rhs eval, retval = %i", retval); + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } @@ -1996,14 +2013,6 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, step_mem->Fse[step_mem->stage_map[is]]); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow explicit RHS", - "Fse_%i(:) =", is); - N_VPrintFile(step_mem->Fse[step_mem->stage_map[is]], - ARK_LOGGER->debug_fp); -#endif } /* store implicit slow rhs */ @@ -2017,6 +2026,15 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt ark_mem->user_data); step_mem->nfsi++; + SUNLogExtraDebugVec(ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[step_mem->stage_map[is]], + "Fsi_%i(:) =", is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed implicit rhs eval, retval = %i", retval); + + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + /* Add external forcing to Fsi, if applicable */ if (step_mem->impforcing) { @@ -2033,21 +2051,17 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fsi[step_mem->stage_map[is]]); - } - if (retval < 0) { return (ARK_RHSFUNC_FAIL); } - if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow implicit RHS", - "Fsi_%i(:) =", is); - N_VPrintFile(step_mem->Fsi[step_mem->stage_map[is]], - ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[step_mem->stage_map[is]], + "Fsi_%i(:) =", is); + } } } /* compute slow RHS */ - } /* loop over stages */ + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + + } /* loop over stages */ /* perform embedded stage (if needed) */ if (do_embedding) @@ -2069,15 +2083,9 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt t0 = ark_mem->tn + step_mem->MRIC->c[is - 2] * ark_mem->h; tf = ark_mem->tcur = ark_mem->tn + ark_mem->h; - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "embedding-stage", - "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 + SUNLogInfo(ARK_LOGGER, "begin-compute-embedding", + "stage = %i, stage type = %d, tcur = %" RSYM, is, + step_mem->stagetypes[is], ark_mem->tcur); /* Determine embedding stage type, and call corresponding routine; the vector ark_mem->ycur stores the previous stage solution on input, and @@ -2086,28 +2094,41 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { case (MRISTAGE_ERK_FAST): retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); - if (retval != ARK_SUCCESS) { return retval; } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", + "status = failed forcing computation, retval = %i", retval); + return retval; + } retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, ark_mem->tempv2, SUNFALSE); - if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + if (retval != ARK_SUCCESS) + { + *nflagPtr = CONV_FAIL; + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", + "status = failed fast ERK stage, retval = %i", retval); + } break; case (MRISTAGE_ERK_NOFAST): retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed ERK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_NOFAST): retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed DIRK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_FAST): retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-compute-embedding", + "status = failed fast DIRK stage, retval = %i", retval); break; } if (retval != ARK_SUCCESS) { return retval; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "embedded solution", "ytilde(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "embedded solution", ark_mem->ycur, + "y_embedded(:) ="); /* Swap back ark_mem->ycur with ark_mem->tempv4, and reset the inner integrator */ tmp = ark_mem->ycur; @@ -2116,10 +2137,14 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt retval = mriStepInnerStepper_Reset(step_mem->stepper, t0, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", + "status = failed reset, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); } + + SUNLogInfo(ARK_LOGGER, "end-compute-embedding", "status = success"); } /* Compute final stage (for evolved solution), along with error estimate */ @@ -2130,15 +2155,9 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt t0 = ark_mem->tn + step_mem->MRIC->c[is - 1] * ark_mem->h; tf = ark_mem->tcur = ark_mem->tn + ark_mem->h; - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "start-stage", - "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 + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, stage type = %d, tcur = %" RSYM, is, + step_mem->stagetypes[is], ark_mem->tcur); /* Determine final stage type, and call corresponding routine; the vector ark_mem->ycur stores the previous stage solution on input, and @@ -2147,29 +2166,41 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { case (MRISTAGE_ERK_FAST): retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, is, t0, tf); - if (retval != ARK_SUCCESS) { return retval; } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed forcing computation, retval = %i", retval); + return retval; + } retval = mriStep_StageERKFast(ark_mem, step_mem, t0, tf, ark_mem->ycur, ark_mem->tempv2, need_inner_dsm); - if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; } + if (retval != ARK_SUCCESS) + { + *nflagPtr = CONV_FAIL; + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed fast ERK stage, retval = %i", retval); + } break; case (MRISTAGE_ERK_NOFAST): retval = mriStep_StageERKNoFast(ark_mem, step_mem, is); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed ERK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_NOFAST): retval = mriStep_StageDIRKNoFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed DIRK stage, retval = %i", retval); break; case (MRISTAGE_DIRK_FAST): retval = mriStep_StageDIRKFast(ark_mem, step_mem, is, nflagPtr); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed fast DIRK stage, retval = %i", retval); break; case (MRISTAGE_STIFF_ACC): retval = ARK_SUCCESS; break; } if (retval != ARK_SUCCESS) { return retval; } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow stage", "z_%i(:) =", is); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, "z_%i(:) =", is); /* apply user-supplied stage postprocessing function (if supplied) */ if ((ark_mem->ProcessStage != NULL) && @@ -2177,7 +2208,12 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } } /* conditionally reset the inner integrator with the modified stage solution */ @@ -2189,6 +2225,8 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt retval = mriStepInnerStepper_Reset(step_mem->stepper, tf, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -2204,19 +2242,11 @@ int mriStep_TakeStepMRIGARK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPt *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + } /* loop over stages */ - /* Solver diagnostics reporting */ -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "updated solution", "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, - ark_mem->nst, ark_mem->h, *dsmPtr); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); return (ARK_SUCCESS); } @@ -2327,6 +2357,11 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = 0, stage type = %d, tcur = %" RSYM, MRISTAGE_FIRST, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, "z_0(:) ="); + /* Evaluate the slow RHS functions if needed. NOTE: we decide between calling the full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner integrator) versus just updating the stored values of Fse[0] and Fsi[0]. In @@ -2338,7 +2373,12 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed update F0 eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } /* For a nested MRI configuration we might still need fn to create a predictor but it should be fn only for the current nesting level which is why we use @@ -2356,10 +2396,21 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = mriStep_FullRHS(ark_mem, ark_mem->tn, ark_mem->yn, ark_mem->fn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed full rhs eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } } ark_mem->fn_is_current = SUNTRUE; + SUNLogExtraDebugVecIf(step_mem->explicit_rhs, ARK_LOGGER, "slow explicit RHS", + step_mem->Fse[0], "Fse_0(:) ="); + SUNLogExtraDebugVecIf(step_mem->implicit_rhs, ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[0], "Fsi_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + /* combine both RHS into FSE for ImEx problems, since MRISR fast forcing function only depends on Omega coefficients */ if (step_mem->implicit_rhs && step_mem->explicit_rhs) @@ -2367,31 +2418,6 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VLinearSum(ONE, step_mem->Fse[0], ONE, step_mem->Fsi[0], step_mem->Fse[0]); } -#ifdef SUNDIALS_DEBUG - printf(" MRIStep step %li, stage 0, h = %" RSYM ", t_n = %" RSYM "\n", - ark_mem->nst, ark_mem->h, ark_mem->tn); -#endif - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->yn, ARK_LOGGER->debug_fp); - - if (step_mem->explicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow explicit RHS", "Fse_0(:) =", ""); - N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); - } - - if (step_mem->implicit_rhs) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow implicit RHS", "Fsi_0(:) =", ""); - N_VPrintFile(step_mem->Fsi[0], ARK_LOGGER->debug_fp); - } -#endif - /* The first stage is the previous time-step solution, so its RHS is the [already-computed] slow RHS from the start of the step */ @@ -2404,13 +2430,6 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Loop over stages */ for (stage = 1; stage < max_stages; stage++) { - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "start-stage", "step = %li, stage = %i, h = %" RSYM, - ark_mem->nst, stage, ark_mem->h); -#endif - /* Determine if this is an "embedding" or "solution" stage */ solution = (stage == step_mem->stages - 1); embedding = (stage == step_mem->stages); @@ -2421,10 +2440,19 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Set current stage abscissa */ cstage = (embedding) ? ONE : step_mem->MRIC->c[stage]; + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, stage type = %d, tcur = %" RSYM, stage, + MRISTAGE_ERK_FAST, ark_mem->tn + cstage * ark_mem->h); + /* Compute forcing function for inner solver */ retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, stage, ark_mem->tn, ark_mem->tn + cstage * ark_mem->h); - if (retval != ARK_SUCCESS) { return retval; } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed forcing computation, retval = %i", retval); + return retval; + } /* Reset the inner stepper on all but the first stage due to "stage-restart" structure */ @@ -2434,6 +2462,8 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -2449,6 +2479,8 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) if (retval != ARK_SUCCESS) { *nflagPtr = CONV_FAIL; + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed fast ERK stage, retval = %i", retval); return retval; } @@ -2471,7 +2503,12 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Call predictor for current stage solution (result placed in zpred) */ retval = mriStep_Predict(ark_mem, step_mem->istage, step_mem->zpred); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed predict, retval = %i", retval); + return (retval); + } /* If a user-supplied predictor routine is provided, call that here Note that mriStep_Predict is *still* called, so this user-supplied @@ -2480,16 +2517,15 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = step_mem->stage_predict(ark_mem->tcur, step_mem->zpred, ark_mem->user_data); + + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed predict, retval = %i", retval); if (retval < 0) { return (ARK_USER_PREDICT_FAIL); } if (retval > 0) { return (TRY_AGAIN); } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "predictor", - "zpred(:) =", ""); - N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "predictor", step_mem->zpred, + "zpred(:) ="); /* fill sdata with explicit contributions to correction */ step_mem->cvals[0] = ONE; @@ -2503,14 +2539,15 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } retval = N_VLinearCombination(stage + 2, step_mem->cvals, step_mem->Xvecs, step_mem->sdata); - if (retval != 0) { return (ARK_VECTOROP_ERR); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return (ARK_VECTOROP_ERR); + } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "rhs data", - "sdata(:) =", ""); - N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "rhs data", step_mem->sdata, + "sdata(:) ="); /* Update gamma for implicit solver */ step_mem->gamma = ark_mem->h * step_mem->MRIC->G[0][stage][stage]; @@ -2521,7 +2558,12 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* perform implicit solve (result is stored in ark_mem->ycur); return with positive value on anything but success */ *nflagPtr = mriStep_Nls(ark_mem, *nflagPtr); - if (*nflagPtr != ARK_SUCCESS) { return (TRY_AGAIN); } + if (*nflagPtr != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed solve, nflag = %i", *nflagPtr); + return (TRY_AGAIN); + } } /* perform explicit update for correction */ else @@ -2535,15 +2577,17 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } retval = N_VLinearCombination(stage + 1, step_mem->cvals, step_mem->Xvecs, ark_mem->ycur); - if (retval != 0) { return (ARK_VECTOROP_ERR); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed vector op, retval = %i", retval); + return (ARK_VECTOROP_ERR); + } } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow stage", "z_%i(:) =", stage); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, + "z_%i(:) =", stage); /* apply user-supplied stage postprocessing function (if supplied), and reset the inner integrator with the modified stage solution */ @@ -2551,11 +2595,18 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tcur, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -2571,6 +2622,12 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, step_mem->Fse[stage], ark_mem->user_data); step_mem->nfse++; + + SUNLogExtraDebugVec(ARK_LOGGER, "slow explicit RHS", + step_mem->Fse[stage], "Fse_%i(:) =", stage); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed explicit rhs eval, retval = %i", retval); + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } @@ -2584,13 +2641,6 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, step_mem->Fse[stage]); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow explicit RHS", - "Fse_%i(:) =", stage); - N_VPrintFile(step_mem->Fse[stage], ARK_LOGGER->debug_fp); -#endif } /* store implicit slow rhs */ @@ -2602,6 +2652,14 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) step_mem->Fsi[stage], ark_mem->user_data); step_mem->nfsi++; + SUNLogExtraDebugVec(ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[stage], "Fsi_%i(:) =", stage); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed implicit rhs eval, retval = %i", retval); + + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } + if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } + /* Add external forcing to Fsi[stage], if applicable */ if (step_mem->impforcing) { @@ -2618,17 +2676,10 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VLinearSum(ONE / step_mem->gamma, step_mem->zcor, -ONE / step_mem->gamma, step_mem->sdata, step_mem->Fsi[stage]); - } - if (retval < 0) { return (ARK_RHSFUNC_FAIL); } - if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow implicit RHS", - "Fsi_%i(:) =", stage); - N_VPrintFile(step_mem->Fsi[stage], ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow implicit RHS", + step_mem->Fsi[stage], "Fsi_%i(:) =", stage); + } } /* combine both RHS into Fse for ImEx problems since @@ -2643,13 +2694,9 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* If this is the solution stage, archive for error estimation */ if (solution) { N_VScale(ONE, ark_mem->ycur, ytilde); } - } /* loop over stages */ + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "updated solution", "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + } /* loop over stages */ /* if temporal error estimation is enabled: compute estimate via difference between step solution and embedding, store in ark_mem->tempv1, store norm in dsmPtr, and @@ -2661,13 +2708,7 @@ int mriStep_TakeStepMRISR(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VScale(ONE, ytilde, ark_mem->ycur); } - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "end-step", - "step = %li, t = %" RSYM ", h = %" RSYM ", dsm = %" RSYM, - ark_mem->nst, ark_mem->tn, ark_mem->h, *dsmPtr); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); return (ARK_SUCCESS); } @@ -2781,6 +2822,11 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) } } + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = 0, stage type = %d, tcur = %" RSYM, MRISTAGE_FIRST, + ark_mem->tcur); + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, "z_0(:) ="); + /* Evaluate the slow RHS function if needed. NOTE: we decide between calling the full RHS function (if ark_mem->fn is non-NULL and MRIStep is not an inner integrator) versus just updating the stored value of Fse[0]. In either case, @@ -2791,30 +2837,29 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = mriStep_UpdateF0(ark_mem, step_mem, ark_mem->tn, ark_mem->yn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed update F0 eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } } - if (ark_mem->fn != NULL && !ark_mem->fn_is_current) + else if (ark_mem->fn != NULL && !ark_mem->fn_is_current) { retval = mriStep_FullRHS(ark_mem, ark_mem->tn, ark_mem->yn, ark_mem->fn, ARK_FULLRHS_START); - if (retval) { return ARK_RHSFUNC_FAIL; } + if (retval) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed full rhs eval, retval = %i", 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, t0); -#endif - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow stage", "z_0(:) =", ""); - N_VPrintFile(ark_mem->yn, ARK_LOGGER->debug_fp); - - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "slow explicit RHS", "Fse_0(:) =", ""); - N_VPrintFile(step_mem->Fse[0], ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow explicit RHS", step_mem->Fse[0], + "Fse_0(:) ="); + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); /* The first stage is the previous time-step solution, so its RHS is the [already-computed] slow RHS from the start of the step */ @@ -2822,18 +2867,18 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Loop over stage groups */ for (ig = 0; ig < step_mem->MRIC->ngroup; ig++) { - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "start-stage", "step = %li, stage group = %i, h = %" RSYM, - ark_mem->nst, ig, ark_mem->h); -#endif + SUNLogInfo(ARK_LOGGER, "begin-group", "group = %i", ig); /* Set up fast RHS for this stage group */ retval = mriStep_ComputeInnerForcing(ark_mem, step_mem, step_mem->MRIC->group[ig][0], ark_mem->tn, ark_mem->tn + ark_mem->h); - if (retval != ARK_SUCCESS) { return (retval); } + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-group", + "status = failed forcing computation, retval = %i", retval); + return (retval); + } /* Set initial condition for this stage group */ N_VScale(ONE, ark_mem->yn, ark_mem->ycur); @@ -2877,6 +2922,10 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* Set desired output time for subinterval */ tf = ark_mem->tn + cstage * ark_mem->h; + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, stage type = %i, tcur = %" RSYM, stage, + step_mem->stagetypes[stage], tf); + /* Reset the inner stepper on the first stage within all but the first stage group due to "stage-restart" structure */ if ((stage > 1) && (is == 0)) @@ -2884,6 +2933,10 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = mriStepInnerStepper_Reset(step_mem->stepper, t0, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); + SUNLogInfo(ARK_LOGGER, "end-group", + "status = failed stage computation, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -2896,6 +2949,10 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) ytemp, need_inner_dsm && !embedding); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed fast ERK stage, retval = %i", retval); + SUNLogInfo(ARK_LOGGER, "end-group", + "status = failed stage computation, retval = %i", retval); *nflagPtr = CONV_FAIL; return retval; } @@ -2906,12 +2963,8 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* set current stage time for postprocessing and RHS calls */ ark_mem->tcur = tf; -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow stage", - "z_%i(:) =", stage); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "slow stage", ark_mem->ycur, + "z_%i(:) =", stage); /* apply user-supplied stage postprocessing function (if supplied), and reset the inner integrator with the modified stage solution */ @@ -2919,11 +2972,23 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + SUNLogInfo(ARK_LOGGER, "end-group", + "status = failed stage computation, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } + retval = mriStepInnerStepper_Reset(step_mem->stepper, ark_mem->tcur, ark_mem->ycur); if (retval != ARK_SUCCESS) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed reset, retval = %i", retval); + SUNLogInfo(ARK_LOGGER, "end-group", + "status = failed stage computation, retval = %i", retval); arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, "Unable to reset the inner stepper"); return (ARK_INNERSTEP_FAIL); @@ -2937,6 +3002,14 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) retval = step_mem->fse(ark_mem->tcur, ark_mem->ycur, step_mem->Fse[stage], ark_mem->user_data); step_mem->nfse++; + + SUNLogExtraDebugVec(ARK_LOGGER, "slow explicit RHS", + step_mem->Fse[stage], "Fse_%i(:) =", stage); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-stage", + "status = failed explicit rhs eval, retval = %i", retval); + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-group", + "status = failed stage computation, retval = %i", retval); + if (retval < 0) { return (ARK_RHSFUNC_FAIL); } if (retval > 0) { return (ARK_UNREC_RHSFUNC_ERR); } @@ -2950,27 +3023,20 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) N_VLinearCombination(nvec, step_mem->cvals, step_mem->Xvecs, step_mem->Fse[stage]); } - -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_TakeStep", "slow explicit RHS", - "Fse_%i(:) =", is); - N_VPrintFile(step_mem->Fse[stage], ARK_LOGGER->debug_fp); -#endif } /* If this is the embedding stage, archive solution for error estimation */ if (embedding) { N_VScale(ONE, ark_mem->ycur, ytilde); } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); + } /* loop over stages */ + SUNLogInfo(ARK_LOGGER, "end-group", "status = success"); + } /* loop over stage groups */ -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "updated solution", "ycur(:) =", ""); - N_VPrintFile(ark_mem->ycur, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); /* if temporal error estimation is enabled: compute estimate via difference between step solution and embedding, store in ark_mem->tempv1, and store norm in dsmPtr */ @@ -2980,14 +3046,6 @@ int mriStep_TakeStepMERK(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) *dsmPtr = N_VWrmsNorm(ark_mem->tempv1, ark_mem->ewt); } - /* Solver diagnostics reporting */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_TakeStep", - "end-step", - "step = %li, t = %" RSYM ", h = %" RSYM ", dsm = %" RSYM, - ark_mem->nst, ark_mem->tn, ark_mem->h, *dsmPtr); -#endif - return (ARK_SUCCESS); } @@ -3459,10 +3517,6 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int retval; /* reusable return flag */ SUNAdaptController_Type adapt_type; /* timestep adaptivity type */ -#ifdef SUNDIALS_DEBUG - printf(" MRIStep ERK fast stage\n"); -#endif - /* pre inner evolve function (if supplied) */ if (step_mem->pre_inner_evolve) { @@ -3477,8 +3531,15 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, ? SUNAdaptController_GetType(ark_mem->hadapt_mem->hcontroller) : SUN_ADAPTCONTROLLER_NONE; + SUNLogInfo(ARK_LOGGER, "begin-fast-steps", ""); + /* advance inner method in time */ retval = mriStepInnerStepper_Evolve(step_mem->stepper, t0, tf, ycur); + + SUNLogInfoIf(retval != 0, ARK_LOGGER, "end-fast-steps", + "status = failed, retval = %i", retval); + SUNLogInfoIf(retval == 0, ARK_LOGGER, "end-fast-steps", "status = success"); + if (retval < 0) { arkProcessError(ark_mem, ARK_INNERSTEP_FAIL, __LINE__, __func__, __FILE__, @@ -3535,10 +3596,6 @@ int mriStep_StageERKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) { int retval, j, nvec; -#ifdef SUNDIALS_DEBUG - printf(" MRIStep ERK stage\n"); -#endif - /* determine effective ERK coefficients (store in Ae_row and Ai_row) */ retval = mriStep_RKCoeffs(step_mem->MRIC, is, step_mem->stage_map, step_mem->Ae_row, step_mem->Ai_row); @@ -3587,10 +3644,6 @@ int mriStep_StageDIRKFast(ARKodeMem ark_mem, SUNDIALS_MAYBE_UNUSED int is, SUNDIALS_MAYBE_UNUSED int* nflagPtr) { -#ifdef SUNDIALS_DEBUG - printf(" MRIStep DIRK fast stage\n"); -#endif - /* this is not currently implemented */ arkProcessError(ark_mem, ARK_INVALID_TABLE, __LINE__, __func__, __FILE__, "This routine is not yet implemented."); @@ -3608,10 +3661,6 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, { int retval; -#ifdef SUNDIALS_DEBUG - printf(" MRIStep DIRK stage\n"); -#endif - /* store current stage index (for an "embedded" stage, subtract 1) */ step_mem->istage = (is == step_mem->stages) ? is - 1 : is; @@ -3630,12 +3679,7 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, if (retval > 0) { return (TRY_AGAIN); } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_StageDIRKNoFast", "predictor", - "zpred(:) =", ""); - N_VPrintFile(step_mem->zpred, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "predictor", step_mem->zpred, "zpred(:) ="); /* determine effective DIRK coefficients (store in cvals) */ retval = mriStep_RKCoeffs(step_mem->MRIC, is, step_mem->stage_map, @@ -3646,12 +3690,7 @@ int mriStep_StageDIRKNoFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, retval = mriStep_StageSetup(ark_mem); if (retval != ARK_SUCCESS) { return (retval); } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_StageDIRKNoFast", "rhs data", - "sdata(:) =", ""); - N_VPrintFile(step_mem->sdata, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "rhs data", step_mem->sdata, "sdata(:) ="); /* perform implicit solve (result is stored in ark_mem->ycur); return with positive value on anything but success */ @@ -3827,15 +3866,8 @@ int mriStep_ComputeInnerForcing(SUNDIALS_MAYBE_UNUSED ARKodeMem ark_mem, if (retval != 0) { return (ARK_VECTOROP_ERR); } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - for (k = 0; k < nmat; k++) - { - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::mriStep_ComputeInnerForcing", "forcing", - "forcing_%i(:) =", k); - N_VPrintFile(step_mem->stepper->forcing[k], ARK_LOGGER->debug_fp); - } -#endif + SUNLogExtraDebugVecArray(ARK_LOGGER, "forcing", nmat, + step_mem->stepper->forcing, "forcing_%i(:) ="); return (ARK_SUCCESS); } @@ -4540,20 +4572,8 @@ int mriStepInnerStepper_Evolve(MRIStepInnerStepper stepper, sunrealtype t0, if (stepper->ops == NULL) { return ARK_ILL_INPUT; } if (stepper->ops->evolve == NULL) { return ARK_ILL_INPUT; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, - "ARKODE::mriStepInnerStepper_Evolve", "start-inner-evolve", - "t0 = %" RSYM ", tout = %" RSYM, t0, tout); -#endif - stepper->last_flag = stepper->ops->evolve(stepper, t0, tout, y); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, - "ARKODE::mriStepInnerStepper_Evolve", "end-inner-evolve", - "flag = %i", stepper->last_flag); -#endif - return stepper->last_flag; } @@ -4626,11 +4646,7 @@ int mriStepInnerStepper_Reset(MRIStepInnerStepper stepper, sunrealtype tR, if (stepper == NULL) { return ARK_ILL_INPUT; } if (stepper->ops == NULL) { return ARK_ILL_INPUT; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(stepper->sunctx->logger, SUN_LOGLEVEL_INFO, - "ARKODE::mriStepInnerStepper_Reset", "reset-inner-state", - "tR = %" RSYM, tR); -#endif + SUNLogDebug(stepper->sunctx->logger, "reset-inner-state", "tR = %" RSYM, tR); if (stepper->ops->reset) { diff --git a/src/arkode/arkode_mristep_nls.c b/src/arkode/arkode_mristep_nls.c index 882eedad75..a4f9b6d5b2 100644 --- a/src/arkode/arkode_mristep_nls.c +++ b/src/arkode/arkode_mristep_nls.c @@ -321,16 +321,15 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) /* Reset the stored residual norm (for iterative linear solvers) */ step_mem->eRNrm = SUN_RCONST(0.1) * step_mem->nlscoef; + SUNLogInfo(ARK_LOGGER, "begin-nonlinear-solve", "tol = %.16g", + step_mem->nlscoef); + /* solve the nonlinear system for the actual correction */ retval = SUNNonlinSolSolve(step_mem->NLS, step_mem->zpred, step_mem->zcor, ark_mem->ewt, step_mem->nlscoef, callLSetup, ark_mem); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, "ARKODE::mriStep_Nls", - "correction", "zcor(:) =", ""); - N_VPrintFile(step_mem->zcor, ARK_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(ARK_LOGGER, "correction", step_mem->zcor, "zcor(:) ="); /* increment counters */ (void)SUNNonlinSolGetNumIters(step_mem->NLS, &nls_iters_inc); @@ -344,9 +343,15 @@ int mriStep_Nls(ARKodeMem ark_mem, int nflag) { step_mem->jcur = SUNFALSE; N_VLinearSum(ONE, step_mem->zcor, ONE, step_mem->zpred, ark_mem->ycur); + + SUNLogInfo(ARK_LOGGER, "end-nonlinear-solve", + "status = success, iters = %li", nls_iters_inc); return (ARK_SUCCESS); } + SUNLogInfo(ARK_LOGGER, "end-nonlinear-solve", + "status = failed, retval = %i, iters = %li", retval, nls_iters_inc); + /* check for recoverable failure, return ARKODE::CONV_FAIL */ if (retval == SUN_NLS_CONV_RECVR) { return (CONV_FAIL); } diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index c911077580..24343e25e4 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -122,12 +122,9 @@ static int arkRelaxNewtonSolve(ARKodeMem ark_mem) retval = arkRelaxResidual(relax_mem->relax_param, &(relax_mem->res), 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 + SUNLogExtraDebug(ARK_LOGGER, "residual", + "iter = %i, relax_param = %" RSYM ", residual = %" RSYM, i, + relax_mem->relax_param, relax_mem->res); /* Check for convergence */ if (SUNRabs(relax_mem->res) < relax_mem->res_tol) { return ARK_SUCCESS; } @@ -347,19 +344,14 @@ static 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 + SUNLogExtraDebug(ARK_LOGGER, "compute delta e", "delta_e = %" RSYM, + relax_mem->delta_e); /* Get the change in state (delta_y = tempv2) */ 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 + SUNLogExtraDebugVec(ARK_LOGGER, "compute delta y", ark_mem->tempv2, + "delta_y(:) ="); /* Store the current relaxation function value */ retval = relax_mem->relax_fn(ark_mem->yn, &(relax_mem->e_old), @@ -368,10 +360,8 @@ static 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 + SUNLogExtraDebug(ARK_LOGGER, "compute old e", "e_old = %" RSYM, + relax_mem->e_old); /* Initial guess for relaxation parameter */ relax_mem->relax_param = relax_mem->relax_param_prev; @@ -895,12 +885,6 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout) /* Cut step size and try again */ ark_mem->eta = relax_mem->eta_fail; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "relaxation", - "relaxation failed"); -#endif - return TRY_AGAIN; } @@ -912,13 +896,10 @@ int arkRelax(ARKodeMem ark_mem, int* relax_fails, sunrealtype* dsm_inout) N_VLinearSum(relax_val, ark_mem->ycur, (ONE - relax_val), ark_mem->yn, ark_mem->ycur); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::arkStep_TakeStep_Z", "relaxation", - "relaxation parameter = %" RSYM ", relaxed h = %" RSYM - ", relaxed error = %" RSYM, - relax_val, ark_mem->h, *dsm_inout); -#endif + SUNLogDebug(ARK_LOGGER, "relaxation", + "relaxation parameter = %" RSYM ", relaxed h = %" RSYM + ", relaxed error = %" RSYM, + relax_val, ark_mem->h, *dsm_inout); return ARK_SUCCESS; } diff --git a/src/arkode/arkode_splittingstep.c b/src/arkode/arkode_splittingstep.c index b54c253ff2..ec0e8c91f1 100644 --- a/src/arkode/arkode_splittingstep.c +++ b/src/arkode/arkode_splittingstep.c @@ -212,21 +212,10 @@ static int splittingStep_SequentialMethod(ARKodeMem ark_mem, { SplittingStepCoefficients coefficients = step_mem->coefficients; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::splittingStep_SequentialMethod", - "start-sequential-method", - "step = %li, sequential method = %i", ark_mem->nst, i); -#endif - for (int j = 0; j < coefficients->stages; j++) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::splittingStep_SequentialMethod", "start-stage", - "step = %li, sequential method = %i, stage = %i", - ark_mem->nst, i, j); -#endif + SUNLogInfo(ARK_LOGGER, "begin-stage", "stage = %i", j); + for (int k = 0; k < coefficients->partitions; k++) { sunrealtype beta_start = coefficients->beta[i][j][k]; @@ -237,14 +226,9 @@ static int splittingStep_SequentialMethod(ARKodeMem ark_mem, sunrealtype t_start = ark_mem->tn + beta_start * ark_mem->h; sunrealtype t_end = ark_mem->tn + beta_end * ark_mem->h; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(ARK_LOGGER, SUN_LOGLEVEL_DEBUG, - "ARKODE::splittingStep_SequentialMethod", - "start-inner-evolve", - "step = %li, sequential method = %i, stage = %i, " - "partition = %i, t0 = %" RSYM ", tout = %" RSYM, - ark_mem->nst, i, j, k, t_start, t_end); -#endif + SUNLogInfo(ARK_LOGGER, "begin-partition", + "partition = %i, t_start = %" RSYM ", t_end = %" RSYM, k, + t_start, t_end); SUNStepper stepper = step_mem->steppers[k]; /* TODO(SBR): A potential future optimization is removing this reset and @@ -253,20 +237,51 @@ static int splittingStep_SequentialMethod(ARKodeMem ark_mem, * FSAL property). Care is needed when a reset occurs, the step direction * changes, the coefficients change, etc. */ SUNErrCode err = SUNStepper_Reset(stepper, t_start, y); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed stepper reset, err = %i", err); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed partition, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } err = SUNStepper_SetStepDirection(stepper, t_end - t_start); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set direction, err = %i", err); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed partition, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } err = SUNStepper_SetStopTime(stepper, t_end); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed set stop time, err = %i", err); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed partition, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } sunrealtype tret = ZERO; err = SUNStepper_Evolve(stepper, t_end, y, &tret); - if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } - + SUNLogExtraDebugVec(ARK_LOGGER, "partition state", y, "y_par(:) ="); + if (err != SUN_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-partition", + "status = failed evolve, err = %i", err); + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed partition, err = %i", err); + return ARK_SUNSTEPPER_ERR; + } step_mem->n_stepper_evolves[k]++; + + SUNLogInfo(ARK_LOGGER, "end-partition", "status = success"); } + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); } return ARK_SUCCESS; @@ -287,25 +302,51 @@ static int splittingStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, SplittingStepCoefficients coefficients = step_mem->coefficients; + SUNLogInfo(ARK_LOGGER, "begin-sequential-method", "sequential method = 0"); + N_VScale(ONE, ark_mem->yn, ark_mem->ycur); retval = splittingStep_SequentialMethod(ark_mem, step_mem, 0, ark_mem->ycur); - if (retval != ARK_SUCCESS) { return retval; } + SUNLogExtraDebugVec(ARK_LOGGER, "sequential state", ark_mem->ycur, + "y_seq(:) ="); + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-sequential-method", + "status = failed sequential method, retval = %i", retval); + return retval; + } if (coefficients->alpha[0] != ONE) { N_VScale(coefficients->alpha[0], ark_mem->ycur, ark_mem->ycur); } + SUNLogExtraDebugVec(ARK_LOGGER, "current state", ark_mem->ycur, "y_cur(:) ="); + SUNLogInfo(ARK_LOGGER, "end-sequential-method", "status = success"); for (int i = 1; i < coefficients->sequential_methods; i++) { + SUNLogInfo(ARK_LOGGER, "begin-sequential-method", "sequential method = %i", + i); + N_VScale(ONE, ark_mem->yn, ark_mem->tempv1); retval = splittingStep_SequentialMethod(ark_mem, step_mem, i, ark_mem->tempv1); - if (retval != ARK_SUCCESS) { return retval; } + SUNLogExtraDebugVec(ARK_LOGGER, "sequential state", ark_mem->tempv1, + "y_seq(:) ="); + if (retval != ARK_SUCCESS) + { + SUNLogInfo(ARK_LOGGER, "end-sequential-method", + "status = failed sequential method, retval = %i", retval); + return retval; + } N_VLinearSum(ONE, ark_mem->ycur, coefficients->alpha[i], ark_mem->tempv1, ark_mem->ycur); + + SUNLogExtraDebugVec(ARK_LOGGER, "current state", ark_mem->ycur, "y_cur(:) ="); + SUNLogInfo(ARK_LOGGER, "end-sequential-method", "status = success"); } + SUNLogExtraDebugVec(ARK_LOGGER, "current state", ark_mem->ycur, "y_cur(:) ="); + return ARK_SUCCESS; } diff --git a/src/arkode/arkode_sprkstep.c b/src/arkode/arkode_sprkstep.c index bfd4c88899..4170246d23 100644 --- a/src/arkode/arkode_sprkstep.c +++ b/src/arkode/arkode_sprkstep.c @@ -557,12 +557,26 @@ int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* store current stage index */ step_mem->istage = is; + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, t = %" RSYM ", that = %" RSYM, is, + ark_mem->tn + ci * ark_mem->h, ark_mem->tn + chati * ark_mem->h); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", prev_stage, "z2_%i(:) =", is); + /* evaluate p' with the previous velocity */ N_VConst(ZERO, step_mem->sdata); /* either have to do this or ask user to set other outputs to zero */ retval = sprkStep_f1(step_mem, ark_mem->tn + chati * ark_mem->h, prev_stage, step_mem->sdata, ark_mem->user_data); - if (retval != 0) { return ARK_RHSFUNC_FAIL; } + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->sdata, + "f1_%i(:) =", is); + + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } /* position update */ N_VLinearSum(ONE, prev_stage, ark_mem->h * ahati, step_mem->sdata, @@ -571,12 +585,23 @@ int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) /* set current stage time(s) */ ark_mem->tcur = ark_mem->tn + chati * ark_mem->h; + SUNLogExtraDebugVec(ARK_LOGGER, "stage", curr_stage, "z1_%i(:) =", is); + /* evaluate q' with the current positions */ N_VConst(ZERO, step_mem->sdata); /* either have to do this or ask user to set other outputs to zero */ retval = sprkStep_f2(step_mem, ark_mem->tn + ci * ark_mem->h, curr_stage, step_mem->sdata, ark_mem->user_data); - if (retval != 0) { return ARK_RHSFUNC_FAIL; } + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->sdata, + "f2_%i(:) =", is); + + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return ARK_RHSFUNC_FAIL; + } /* velocity update */ N_VLinearSum(ONE, curr_stage, ark_mem->h * ai, step_mem->sdata, curr_stage); @@ -586,18 +611,27 @@ int sprkStep_TakeStep(ARKodeMem ark_mem, sunrealtype* dsmPtr, int* nflagPtr) { retval = ark_mem->ProcessStage(ark_mem->tcur, ark_mem->ycur, ark_mem->user_data); - if (retval != 0) { return (ARK_POSTPROCESS_STAGE_FAIL); } + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); + return (ARK_POSTPROCESS_STAGE_FAIL); + } } /* keep track of the stage number */ step_mem->istage++; prev_stage = curr_stage; + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); } *nflagPtr = 0; *dsmPtr = 0; + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + return ARK_SUCCESS; } @@ -642,16 +676,31 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, /* store current stage index */ step_mem->istage = is; + SUNLogInfo(ARK_LOGGER, "begin-stage", + "stage = %i, t = %" RSYM ", that = %" RSYM, is, + ark_mem->tn + ci * ark_mem->h, ark_mem->tn + chati * ark_mem->h); + /* [ ] + [ ] [ q_n ] + [ \Delta Q_i ] */ N_VLinearSum(ONE, ark_mem->yn, ONE, delta_Yi, yn_plus_delta_Yi); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", yn_plus_delta_Yi, "z2_%i(:) =", is); + /* Evaluate p' with the previous velocity */ N_VConst(ZERO, step_mem->sdata); /* either have to do this or ask user to set other outputs to zero */ retval = sprkStep_f1(step_mem, ark_mem->tn + chati * ark_mem->h, yn_plus_delta_Yi, step_mem->sdata, ark_mem->user_data); - if (retval != 0) { return (ARK_RHSFUNC_FAIL); } + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->sdata, + "f1_%i(:) =", is); + + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } /* Incremental position update: [ \Delta P_i ] = [ \Delta P_{i-1} ] + [ sdata ] @@ -662,6 +711,8 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, [ ] + [ ] */ N_VLinearSum(ONE, ark_mem->yn, ONE, delta_Yi, yn_plus_delta_Yi); + SUNLogExtraDebugVec(ARK_LOGGER, "stage", yn_plus_delta_Yi, "z1_%i(:) =", is); + /* set current stage time(s) */ ark_mem->tcur = ark_mem->tn + chati * ark_mem->h; @@ -670,7 +721,16 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, set other outputs to zero */ retval = sprkStep_f2(step_mem, ark_mem->tn + ci * ark_mem->h, yn_plus_delta_Yi, step_mem->sdata, ark_mem->user_data); - if (retval != 0) { return (ARK_RHSFUNC_FAIL); } + + SUNLogExtraDebugVec(ARK_LOGGER, "stage RHS", step_mem->sdata, + "f2_%i(:) =", is); + + if (retval != 0) + { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed rhs eval, retval = %i", retval); + return (ARK_RHSFUNC_FAIL); + } /* Incremental velocity update: [ ] = [ ] + [ ] @@ -681,12 +741,16 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, * won't work with the increment form */ if (ark_mem->ProcessStage != NULL) { + SUNLogInfo(ARK_LOGGER, "end-stage", + "status = failed postprocess stage, retval = %i", retval); arkProcessError(ark_mem, ARK_POSTPROCESS_STAGE_FAIL, __LINE__, __func__, __FILE__, "Compensated summation is not compatible with stage " "PostProcessing!\n"); return (ARK_POSTPROCESS_STAGE_FAIL); } + + SUNLogInfo(ARK_LOGGER, "end-stage", "status = success"); } /* @@ -701,6 +765,8 @@ int sprkStep_TakeStep_Compensated(ARKodeMem ark_mem, sunrealtype* dsmPtr, *nflagPtr = 0; *dsmPtr = SUN_RCONST(0.0); + SUNLogExtraDebugVec(ARK_LOGGER, "updated solution", ark_mem->ycur, "ycur(:) ="); + return 0; } diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index 8b5e62b22d..4075fe9c3b 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -2353,13 +2353,9 @@ static int cvStep(CVodeMem cv_mem) for (;;) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvStep", - "enter-step-attempt-loop", - "step = %li, h = %.16g, q = %d, t_n = %.16g", - cv_mem->cv_nst, cv_mem->cv_next_h, cv_mem->cv_next_q, - cv_mem->cv_tn); -#endif + SUNLogInfo(CV_LOGGER, "begin-step-attempt", + "step = %li, tn = %" RSYM ", h = %" RSYM ", q = %d", + cv_mem->cv_nst + 1, cv_mem->cv_tn, cv_mem->cv_h, cv_mem->cv_q); cvPredict(cv_mem); cvSet(cv_mem); @@ -2367,6 +2363,9 @@ static int cvStep(CVodeMem cv_mem) nflag = cvNls(cv_mem, nflag); kflag = cvHandleNFlag(cv_mem, &nflag, saved_t, &ncf); + SUNLogInfoIf(kflag == PREDICT_AGAIN || kflag != DO_ERROR_TEST, CV_LOGGER, + "end-step-attempt", "status = failed solve, kflag = %i", kflag); + /* Go back in loop if we need to predict again (nflag=PREV_CONV_FAIL) */ if (kflag == PREDICT_AGAIN) { continue; } @@ -2381,6 +2380,9 @@ static int cvStep(CVodeMem cv_mem) /* Perform projection (nflag=CV_SUCCESS) */ pflag = cvDoProjection(cv_mem, &nflag, saved_t, &npf); + SUNLogInfoIf(pflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed projection, pflag = %i", pflag); + /* Go back in loop if we need to predict again (nflag=PREV_PROJ_FAIL) */ if (pflag == PREDICT_AGAIN) { continue; } @@ -2391,6 +2393,10 @@ static int cvStep(CVodeMem cv_mem) /* Perform error test (nflag=CV_SUCCESS) */ eflag = cvDoErrorTest(cv_mem, &nflag, saved_t, &nef, &dsm); + SUNLogInfoIf(eflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed error test, dsm = %" RSYM ", eflag = %i", dsm, + eflag); + /* Go back in loop if we need to predict again (nflag=PREV_ERR_FAIL) */ if (eflag == TRY_AGAIN) { continue; } @@ -2401,6 +2407,9 @@ static int cvStep(CVodeMem cv_mem) break; } + SUNLogInfo(CV_LOGGER, "end-step-attempt", "status = success, dsm = %" RSYM, + dsm); + /* Nonlinear system solve and error test were both successful. Update data, and consider change of step and/or order. */ @@ -2702,11 +2711,7 @@ static void cvPredict(CVodeMem cv_mem) } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvPredict", - "return", "zn_0(:) =", ""); - N_VPrintFile(cv_mem->cv_zn[0], CV_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(CV_LOGGER, "return", cv_mem->cv_zn[0], "zn_0(:) ="); } /* @@ -3041,6 +3046,8 @@ static int cvNls(CVodeMem cv_mem, int nflag) if (flag > 0) { return (SUN_NLS_CONV_RECVR); } } + SUNLogInfo(CV_LOGGER, "begin-nonlinear-solve", "tol = %.16g", cv_mem->cv_tq[4]); + /* solve the nonlinear system */ flag = SUNNonlinSolSolve(cv_mem->NLS, cv_mem->cv_zn[0], cv_mem->cv_acor, cv_mem->cv_ewt, cv_mem->cv_tq[4], callSetup, cv_mem); @@ -3053,7 +3060,13 @@ static int cvNls(CVodeMem cv_mem, int nflag) cv_mem->cv_nnf += nnf_inc; /* if the solve failed return */ - if (flag != SUN_SUCCESS) { return (flag); } + if (flag != SUN_SUCCESS) + { + SUNLogInfo(CV_LOGGER, "end-nonlinear-solve", + "status = failed, flag = %i, iters = %li", flag, nni_inc); + + return (flag); + } /* solve successful */ @@ -3066,6 +3079,9 @@ static int cvNls(CVodeMem cv_mem, int nflag) cv_mem->cv_acnrm = N_VWrmsNorm(cv_mem->cv_acor, cv_mem->cv_ewt); } + SUNLogInfo(CV_LOGGER, "end-nonlinear-solve", "status = success, iters = %li", + nni_inc); + /* update Jacobian status */ cv_mem->cv_jcur = SUNFALSE; @@ -3292,11 +3308,8 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, dsm = cv_mem->cv_acnrm * cv_mem->cv_tq[2]; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvDoErrorTest", - "error-test", "step = %li, h = %.16g, dsm = %.16g", - cv_mem->cv_nst, cv_mem->cv_h, dsm); -#endif + SUNLogDebug(CV_LOGGER, "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, + cv_mem->cv_nst, cv_mem->cv_h, dsm); /* If est. local error norm dsm passes test, return CV_SUCCESS */ *dsmPtr = dsm; @@ -3332,10 +3345,7 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, cvRescale(cv_mem); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvDoErrorTest", - "new-step-eta", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta", "eta = %" RSYM, cv_mem->cv_eta); return (TRY_AGAIN); } @@ -3350,10 +3360,7 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, cv_mem->cv_q--; cv_mem->cv_qwait = cv_mem->cv_L; cvRescale(cv_mem); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvDoErrorTest", - "new-step-eta-mxnef1", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta-mxnef1", "eta = %" RSYM, cv_mem->cv_eta); return (TRY_AGAIN); } @@ -3375,10 +3382,8 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, N_VScale(cv_mem->cv_h, cv_mem->cv_tempv, cv_mem->cv_zn[1]); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvDoErrorTest", - "new-step-eta-mxnef1-q1", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta-mxnef1-q1", "eta = %" RSYM, + cv_mem->cv_eta); return (TRY_AGAIN); } @@ -3449,11 +3454,8 @@ static void cvCompleteStep(CVodeMem cv_mem) } #endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvCompleteStep", - "return", "nst = %d, nscon = %d", cv_mem->cv_nst, - cv_mem->cv_nscon); -#endif + SUNLogDebug(CV_LOGGER, "return", "nst = %d, nscon = %d", cv_mem->cv_nst, + cv_mem->cv_nscon); } /* @@ -3500,13 +3502,10 @@ static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm) } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvPrepareNextStep", - "return", - "eta = %.16g, hprime = %.16g, qprime = %d, qwait = %d\n", - cv_mem->cv_eta, cv_mem->cv_hprime, cv_mem->cv_qprime, - cv_mem->cv_qwait); -#endif + SUNLogDebug(CV_LOGGER, "return", + "eta = %" RSYM ", hprime = %" RSYM ", qprime = %d, qwait = %d", + cv_mem->cv_eta, cv_mem->cv_hprime, cv_mem->cv_qprime, + cv_mem->cv_qwait); } /* diff --git a/src/cvode/cvode_ls.c b/src/cvode/cvode_ls.c index c5b7755151..f6bf625a54 100644 --- a/src/cvode/cvode_ls.c +++ b/src/cvode/cvode_ls.c @@ -1646,10 +1646,10 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, sunrealtype bnorm = ZERO; sunrealtype deltar, delta, w_mean; int curiter, nli_inc, retval; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - sunrealtype resnorm; - long int nps_inc; -#endif + + /* only used with logging */ + SUNDIALS_MAYBE_UNUSED long int nps_inc; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm; /* access CVLsMem structure */ if (cv_mem->cv_lmem == NULL) @@ -1670,16 +1670,29 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, { deltar = cvls_mem->eplifac * cv_mem->cv_tq[4]; bnorm = N_VWrmsNorm(b, weight); + + SUNLogInfo(CV_LOGGER, "begin-linear-solve", + "iterative = 1, b-norm = %.16g, b-tol = %.16g, res-tol = %.16g", + bnorm, deltar, deltar * cvls_mem->nrmfac); + if (bnorm <= deltar) { if (curiter > 0) { N_VConst(ZERO, b); } cvls_mem->last_flag = CVLS_SUCCESS; + + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = success small rhs"); + return (cvls_mem->last_flag); } /* Adjust tolerance for 2-norm */ delta = deltar * cvls_mem->nrmfac; } - else { delta = ZERO; } + else + { + delta = ZERO; + + SUNLogInfo(CV_LOGGER, "begin-linear-solve", "iterative = 0"); + } /* Set vectors ycur and fcur for use by the Atimes and Psolve interface routines */ @@ -1695,6 +1708,10 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, cvProcessError(cv_mem, CVLS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in calling SUNLinSolSetScalingVectors"); cvls_mem->last_flag = CVLS_SUNLS_FAIL; + + SUNLogInfo(CV_LOGGER, "end-linear-solve", + "status = failed set scaling vectors"); + return (cvls_mem->last_flag); } @@ -1725,12 +1742,15 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(cvls_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = failed set zero guess", + ""); + return (-1); + } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG /* Store previous nps value in nps_inc */ nps_inc = cvls_mem->nps; -#endif /* If a user-provided jtsetup routine is supplied, call that here */ if (cvls_mem->jtsetup) @@ -1742,6 +1762,9 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, { cvProcessError(cv_mem, retval, __LINE__, __func__, __FILE__, MSG_LS_JTSETUP_FAILED); + + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = failed J-times setup", + ""); return (cvls_mem->last_flag); } } @@ -1758,15 +1781,11 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, } /* Retrieve statistics from iterative linear solvers */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG resnorm = ZERO; -#endif nli_inc = 0; if (cvls_mem->iterative) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG if (cvls_mem->LS->ops->resnorm) resnorm = SUNLinSolResNorm(cvls_mem->LS); -#endif if (cvls_mem->LS->ops->numiters) { nli_inc = SUNLinSolNumIters(cvls_mem->LS); @@ -1780,11 +1799,12 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, /* Interpret solver return value */ cvls_mem->last_flag = retval; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvLsSolve", - "ls-stats", "bnorm = %.16g, resnorm = %.16g, ls_iters = %i, prec_solves = %i", - bnorm, resnorm, nli_inc, (int)(cvls_mem->nps - nps_inc)); -#endif + SUNLogInfoIf(retval == SUN_SUCCESS, CV_LOGGER, "end-linear-solve", + "status = success, iters = %i, p-solves = %i, res-norm = %.16g", + nli_inc, (int)(cvls_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, CV_LOGGER, + "end-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, res-norm = %.16g", + retval, nli_inc, (int)(cvls_mem->nps - nps_inc), resnorm); switch (retval) { diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 1966d560c7..d2dc784cec 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -5857,13 +5857,9 @@ static int cvStep(CVodeMem cv_mem) for (;;) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvStep", - "enter-step-attempt-loop", - "step = %li, h = %.16g, q = %d, t_n = %.16g", - cv_mem->cv_nst, cv_mem->cv_next_h, cv_mem->cv_next_q, - cv_mem->cv_tn); -#endif + SUNLogInfo(CV_LOGGER, "begin-step-attempt", + "step = %li, tn = %" RSYM ", h = %" RSYM ", q = %d", + cv_mem->cv_nst + 1, cv_mem->cv_tn, cv_mem->cv_h, cv_mem->cv_q); cvPredict(cv_mem); cvSet(cv_mem); @@ -5873,6 +5869,9 @@ static int cvStep(CVodeMem cv_mem) nflag = cvNls(cv_mem, nflag); kflag = cvHandleNFlag(cv_mem, &nflag, saved_t, &ncf, &(cv_mem->cv_ncfn)); + SUNLogInfoIf(kflag == PREDICT_AGAIN || kflag != DO_ERROR_TEST, CV_LOGGER, + "end-step-attempt", "status = failed solve, kflag = %i", kflag); + /* Go back in loop if we need to predict again (nflag=PREV_CONV_FAIL) */ if (kflag == PREDICT_AGAIN) { continue; } @@ -5887,6 +5886,9 @@ static int cvStep(CVodeMem cv_mem) /* Perform projection (nflag=CV_SUCCESS) */ pflag = cvDoProjection(cv_mem, &nflag, saved_t, &npf); + SUNLogInfoIf(pflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed projection, pflag = %i", pflag); + /* Go back in loop if we need to predict again (nflag=PREV_PROJ_FAIL) */ if (pflag == PREDICT_AGAIN) { continue; } @@ -5898,6 +5900,10 @@ static int cvStep(CVodeMem cv_mem) eflag = cvDoErrorTest(cv_mem, &nflag, saved_t, cv_mem->cv_acnrm, &nef, &(cv_mem->cv_netf), &dsm); + SUNLogInfoIf(eflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed error test, dsm = %" RSYM ", eflag = %i", dsm, + eflag); + /* Go back in loop if we need to predict again (nflag=PREV_ERR_FAIL) */ if (eflag == TRY_AGAIN) { continue; } @@ -5915,6 +5921,10 @@ static int cvStep(CVodeMem cv_mem) nflag = cvQuadNls(cv_mem); kflag = cvHandleNFlag(cv_mem, &nflag, saved_t, &ncf, &(cv_mem->cv_ncfn)); + SUNLogInfoIf(kflag == PREDICT_AGAIN || kflag != DO_ERROR_TEST, CV_LOGGER, + "end-step-attempt", "status = failed quad solve, kflag = %i", + kflag); + if (kflag == PREDICT_AGAIN) { continue; } if (kflag != DO_ERROR_TEST) { return (kflag); } @@ -5925,6 +5935,11 @@ static int cvStep(CVodeMem cv_mem) eflag = cvDoErrorTest(cv_mem, &nflag, saved_t, cv_mem->cv_acnrmQ, &nefQ, &(cv_mem->cv_netfQ), &dsmQ); + SUNLogInfoIf(eflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed quad error test, dsmQ = %" RSYM + ", eflag = %i", + dsmQ, eflag); + if (eflag == TRY_AGAIN) { continue; } if (eflag != CV_SUCCESS) { return (eflag); } @@ -5947,6 +5962,10 @@ static int cvStep(CVodeMem cv_mem) retval = cv_mem->cv_f(cv_mem->cv_tn, cv_mem->cv_y, cv_mem->cv_ftemp, cv_mem->cv_user_data); cv_mem->cv_nfe++; + + SUNLogInfoIf(retval != 0, CV_LOGGER, "end-step-attempt", + "status = failed rhs eval, retval = %i", retval); + if (retval < 0) { return (CV_RHSFUNC_FAIL); } if (retval > 0) { @@ -5967,13 +5986,18 @@ static int cvStep(CVodeMem cv_mem) for (is = 0; is < cv_mem->cv_Ns; is++) { cv_mem->sens_solve_idx = is; - nflag = cvStgr1Nls(cv_mem, is); + + nflag = cvStgr1Nls(cv_mem, is); kflag = cvHandleNFlag(cv_mem, &nflag, saved_t, &(cv_mem->cv_ncfS1[is]), &(cv_mem->cv_ncfnS1[is])); if (kflag != DO_ERROR_TEST) { break; } } } + SUNLogInfoIf(kflag == PREDICT_AGAIN || kflag != DO_ERROR_TEST, CV_LOGGER, + "end-step-attempt", "status = failed sens solve, kflag = %i", + kflag); + if (kflag == PREDICT_AGAIN) { continue; } if (kflag != DO_ERROR_TEST) { return (kflag); } @@ -5989,6 +6013,11 @@ static int cvStep(CVodeMem cv_mem) eflag = cvDoErrorTest(cv_mem, &nflag, saved_t, cv_mem->cv_acnrmS, &nefS, &(cv_mem->cv_netfS), &dsmS); + SUNLogInfoIf(eflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed sens error test, dsmS = %" RSYM + ", eflag = %i", + dsmS, eflag); + if (eflag == TRY_AGAIN) { continue; } if (eflag != CV_SUCCESS) { return (eflag); } @@ -6017,6 +6046,10 @@ static int cvStep(CVodeMem cv_mem) nflag = cvQuadSensNls(cv_mem); kflag = cvHandleNFlag(cv_mem, &nflag, saved_t, &ncf, &(cv_mem->cv_ncfn)); + SUNLogInfoIf(kflag == PREDICT_AGAIN || kflag != DO_ERROR_TEST, CV_LOGGER, + "end-step-attempt", + "status = failed quad sens solve, kflag = %i", kflag); + if (kflag == PREDICT_AGAIN) { continue; } if (kflag != DO_ERROR_TEST) { return (kflag); } @@ -6028,6 +6061,11 @@ static int cvStep(CVodeMem cv_mem) eflag = cvDoErrorTest(cv_mem, &nflag, saved_t, cv_mem->cv_acnrmQS, &nefQS, &(cv_mem->cv_netfQS), &dsmQS); + SUNLogInfoIf(eflag != CV_SUCCESS, CV_LOGGER, "end-step-attempt", + "status = failed quad sens error test, dsmQS = %" RSYM + ", eflag = %i", + dsmQS, eflag); + if (eflag == TRY_AGAIN) { continue; } if (eflag != CV_SUCCESS) { return (eflag); } @@ -6040,6 +6078,9 @@ static int cvStep(CVodeMem cv_mem) break; } + SUNLogInfo(CV_LOGGER, "end-step-attempt", "status = success, dsm = %" RSYM, + dsm); + /* Nonlinear system solve and error test were both successful. Update data, and consider change of step and/or order. */ @@ -6506,9 +6547,6 @@ void cvRescale(CVodeMem cv_mem) static void cvPredict(CVodeMem cv_mem) { -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - int i; -#endif int j, k; cv_mem->cv_tn += cv_mem->cv_h; @@ -6529,11 +6567,7 @@ static void cvPredict(CVodeMem cv_mem) } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "forward", "zn_0(:) =", ""); - N_VPrintFile(cv_mem->cv_zn[0], CV_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(CV_LOGGER, "forward", cv_mem->cv_zn[0], "zn_0(:) ="); if (cv_mem->cv_quadr) { @@ -6546,11 +6580,7 @@ static void cvPredict(CVodeMem cv_mem) } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "quad", "znQ_0(:) =", ""); - N_VPrintFile(cv_mem->cv_znQ[0], CV_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(CV_LOGGER, "quad", cv_mem->cv_znQ[0], "znQ_0(:) ="); } if (cv_mem->cv_sensi) @@ -6562,14 +6592,8 @@ static void cvPredict(CVodeMem cv_mem) (void)N_VLinearSumVectorArray(cv_mem->cv_Ns, ONE, cv_mem->cv_znS[j - 1], ONE, cv_mem->cv_znS[j], cv_mem->cv_znS[j - 1]); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - for (i = 0; i < cv_mem->cv_Ns; i++) - { - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "sensi", " i = %d, znS_i(:) = ", i); - N_VPrintFile(cv_mem->cv_znS[0][i], CV_LOGGER->debug_fp); - } -#endif + SUNLogExtraDebugVecArray(CV_LOGGER, "sensi", cv_mem->cv_Ns, + cv_mem->cv_znS[0], "znS_%d(:) ="); } } } @@ -6583,14 +6607,8 @@ static void cvPredict(CVodeMem cv_mem) (void)N_VLinearSumVectorArray(cv_mem->cv_Ns, ONE, cv_mem->cv_znQS[j - 1], ONE, cv_mem->cv_znQS[j], cv_mem->cv_znQS[j - 1]); -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - for (i = 0; i < cv_mem->cv_Ns; i++) - { - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPredict", - "quad-sensi", " i = %d, znQS_i(:) = ", i); - N_VPrintFile(cv_mem->cv_znQS[0][i], CV_LOGGER->debug_fp); - } -#endif + SUNLogExtraDebugVecArray(CV_LOGGER, "quad-sensi", cv_mem->cv_Ns, + cv_mem->cv_znQS[0], "znQS_%d(:) ="); } } } @@ -6946,6 +6964,8 @@ static int cvNls(CVodeMem cv_mem, int nflag) if (flag > 0) { return (SUN_NLS_CONV_RECVR); } } + SUNLogInfo(CV_LOGGER, "begin-nonlinear-solve", "tol = %.16g", cv_mem->cv_tq[4]); + /* solve the nonlinear system */ if (do_sensi_sim) { @@ -6973,7 +6993,13 @@ static int cvNls(CVodeMem cv_mem, int nflag) } /* if the solve failed return */ - if (flag != SUN_SUCCESS) { return (flag); } + if (flag != SUN_SUCCESS) + { + SUNLogInfo(CV_LOGGER, "end-nonlinear-solve", + "status = failed, flag = %i, iters = %li", flag, nni_inc); + + return (flag); + } /* solve successful */ @@ -6997,6 +7023,9 @@ static int cvNls(CVodeMem cv_mem, int nflag) else { cv_mem->cv_acnrm = N_VWrmsNorm(cv_mem->cv_acor, cv_mem->cv_ewt); } } + SUNLogInfo(CV_LOGGER, "end-nonlinear-solve", "status = success, iters = %li", + nni_inc); + /* update Jacobian status */ cv_mem->cv_jcur = SUNFALSE; @@ -7468,11 +7497,8 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, dsm = acor_nrm * cv_mem->cv_tq[2]; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvDoErrorTest", - "error-test", "step = %li, h = %.16g, dsm = %.16g", - cv_mem->cv_nst, cv_mem->cv_h, dsm); -#endif + SUNLogDebug(CV_LOGGER, "error-test", "step = %li, h = %" RSYM ", dsm = %" RSYM, + cv_mem->cv_nst, cv_mem->cv_h, dsm); /* If est. local error norm dsm passes test, return CV_SUCCESS */ *dsmPtr = dsm; @@ -7508,10 +7534,7 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, cvRescale(cv_mem); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvDoErrorTest", - "new-step-eta", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta", "eta = %" RSYM, cv_mem->cv_eta); return (TRY_AGAIN); } @@ -7526,10 +7549,7 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, cv_mem->cv_q--; cv_mem->cv_qwait = cv_mem->cv_L; cvRescale(cv_mem); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvDoErrorTest", - "new-step-eta-mxnef1", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta-mxnef1", "eta = %" RSYM, cv_mem->cv_eta); return (TRY_AGAIN); } @@ -7551,10 +7571,8 @@ static int cvDoErrorTest(CVodeMem cv_mem, int* nflagPtr, sunrealtype saved_t, N_VScale(cv_mem->cv_h, cv_mem->cv_tempv, cv_mem->cv_zn[1]); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvDoErrorTest", - "new-step-eta-mxnef1-q1", "eta = %.16g", cv_mem->cv_eta); -#endif + SUNLogDebug(CV_LOGGER, "new-step-eta-mxnef1-q1", "eta = %" RSYM, + cv_mem->cv_eta); if (cv_mem->cv_quadr) { @@ -7728,11 +7746,8 @@ static void cvCompleteStep(CVodeMem cv_mem) } #endif -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvCompleteStep", - "return", "nst = %d, nscon = %d", cv_mem->cv_nst, - cv_mem->cv_nscon); -#endif + SUNLogDebug(CV_LOGGER, "return", "nst = %d, nscon = %d", cv_mem->cv_nst, + cv_mem->cv_nscon); } /* @@ -7779,13 +7794,10 @@ static void cvPrepareNextStep(CVodeMem cv_mem, sunrealtype dsm) } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODES::cvPrepareNextStep", - "return", - "eta = %.16g, hprime = %.16g, qprime = %d, qwait = %d\n", - cv_mem->cv_eta, cv_mem->cv_hprime, cv_mem->cv_qprime, - cv_mem->cv_qwait); -#endif + SUNLogDebug(CV_LOGGER, "return", + "eta = %" RSYM ", hprime = %" RSYM ", qprime = %d, qwait = %d", + cv_mem->cv_eta, cv_mem->cv_hprime, cv_mem->cv_qprime, + cv_mem->cv_qwait); } /* diff --git a/src/cvodes/cvodes_ls.c b/src/cvodes/cvodes_ls.c index 0e3d550499..5d5bca0da5 100644 --- a/src/cvodes/cvodes_ls.c +++ b/src/cvodes/cvodes_ls.c @@ -1725,10 +1725,10 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, sunrealtype deltar, delta, w_mean; int curiter, nli_inc, retval; sunbooleantype do_sensi_sim, do_sensi_stg, do_sensi_stg1; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - sunrealtype resnorm; - long int nps_inc; -#endif + + /* only used with logging */ + SUNDIALS_MAYBE_UNUSED long int nps_inc; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm; /* access CVLsMem structure */ if (cv_mem->cv_lmem == NULL) @@ -1766,16 +1766,29 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, { deltar = cvls_mem->eplifac * cv_mem->cv_tq[4]; bnorm = N_VWrmsNorm(b, weight); + + SUNLogInfo(CV_LOGGER, "begin-linear-solve", + "iterative = 1, b-norm = %.16g, b-tol = %.16g, res-tol = %.16g", + bnorm, deltar, deltar * cvls_mem->nrmfac); + if (bnorm <= deltar) { if (curiter > 0) { N_VConst(ZERO, b); } cvls_mem->last_flag = CVLS_SUCCESS; + + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = success small rhs"); + return (cvls_mem->last_flag); } /* Adjust tolerance for 2-norm */ delta = deltar * cvls_mem->nrmfac; } - else { delta = ZERO; } + else + { + delta = ZERO; + + SUNLogInfo(CV_LOGGER, "begin-linear-solve", "iterative = 0"); + } /* Set vectors ycur and fcur for use by the Atimes and Psolve interface routines */ @@ -1791,6 +1804,10 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, cvProcessError(cv_mem, CVLS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in calling SUNLinSolSetScalingVectors"); cvls_mem->last_flag = CVLS_SUNLS_FAIL; + + SUNLogInfo(CV_LOGGER, "end-linear-solve", + "status = failed set scaling vectors"); + return (cvls_mem->last_flag); } @@ -1821,12 +1838,15 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(cvls_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = failed set zero guess", + ""); + return (-1); + } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG /* Store previous nps value in nps_inc */ nps_inc = cvls_mem->nps; -#endif /* If a user-provided jtsetup routine is supplied, call that here */ if (cvls_mem->jtsetup) @@ -1838,6 +1858,9 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, { cvProcessError(cv_mem, retval, __LINE__, __func__, __FILE__, MSG_LS_JTSETUP_FAILED); + + SUNLogInfo(CV_LOGGER, "end-linear-solve", "status = failed J-times setup", + ""); return (cvls_mem->last_flag); } } @@ -1854,15 +1877,11 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, } /* Retrieve statistics from iterative linear solvers */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG resnorm = ZERO; -#endif nli_inc = 0; if (cvls_mem->iterative) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG if (cvls_mem->LS->ops->resnorm) resnorm = SUNLinSolResNorm(cvls_mem->LS); -#endif if (cvls_mem->LS->ops->numiters) { nli_inc = SUNLinSolNumIters(cvls_mem->LS); @@ -1876,11 +1895,12 @@ int cvLsSolve(CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ynow, /* Interpret solver return value */ cvls_mem->last_flag = retval; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG - SUNLogger_QueueMsg(CV_LOGGER, SUN_LOGLEVEL_DEBUG, "CVODE::cvLsSolve", - "ls-stats", "bnorm = %.16g, resnorm = %.16g, ls_iters = %i, prec_solves = %i", - bnorm, resnorm, nli_inc, (int)(cvls_mem->nps - nps_inc)); -#endif + SUNLogInfoIf(retval == SUN_SUCCESS, CV_LOGGER, "end-linear-solve", + "status = success, iters = %i, p-solves = %i, res-norm = %.16g", + nli_inc, (int)(cvls_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, CV_LOGGER, + "end-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, res-norm = %.16g", + retval, nli_inc, (int)(cvls_mem->nps - nps_inc), resnorm); switch (retval) { diff --git a/src/ida/ida.c b/src/ida/ida.c index 725fd5a0a3..94cc3a18b6 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -2504,11 +2504,10 @@ static int IDAStep(IDAMem IDA_mem) for (;;) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDAStep", - "start-step-attempt", "step = %li, h = %" RSYM, - IDA_mem->ida_nst, IDA_mem->ida_hh); -#endif + SUNLogInfo(IDA_LOGGER, "begin-step-attempt", + "step = %li, tn = %" RSYM ", h = %" RSYM ", q = %d", + IDA_mem->ida_nst + 1, IDA_mem->ida_tn, IDA_mem->ida_hh, + IDA_mem->ida_kk); /*----------------------- Set method coefficients @@ -2555,6 +2554,14 @@ static int IDAStep(IDAMem IDA_mem) kflag = IDAHandleNFlag(IDA_mem, nflag, err_k, err_km1, &(IDA_mem->ida_ncfn), &ncf, &(IDA_mem->ida_netf), &nef); + SUNLogInfoIf(nflag == ERROR_TEST_FAIL, IDA_LOGGER, "end-step-attempt", + "status = failed error test, dsm = %" RSYM ", kflag = %i", + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk], kflag); + + SUNLogInfoIf(nflag != ERROR_TEST_FAIL && kflag != IDA_SUCCESS, IDA_LOGGER, + "end-step-attempt", "status = failed solve, kflag = %i", + kflag); + /* exit on nonrecoverable failure */ if (kflag != PREDICT_AGAIN) { return (kflag); } @@ -2568,6 +2575,9 @@ static int IDAStep(IDAMem IDA_mem) } /* end loop */ + SUNLogInfo(IDA_LOGGER, "end-step-attempt", "status = success, dsm = %" RSYM, + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk]); + /* Nonlinear system solve and error test were both successful; update data, and consider change of step and/or order */ @@ -2736,6 +2746,9 @@ static int IDANls(IDAMem IDA_mem) if (retval > 0) { return (IDA_NLS_SETUP_RECVR); } } + SUNLogInfo(IDA_LOGGER, "begin-nonlinear-solve", "tol = %.16g", + IDA_mem->ida_epsNewt); + /* solve the nonlinear system */ retval = SUNNonlinSolSolve(IDA_mem->NLS, IDA_mem->ida_yypredict, IDA_mem->ida_ee, IDA_mem->ida_ewt, @@ -2748,14 +2761,13 @@ static int IDANls(IDAMem IDA_mem) (void)SUNNonlinSolGetNumConvFails(IDA_mem->NLS, &nnf_inc); IDA_mem->ida_nnf += nnf_inc; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDANls", "nls-return", - "flag = %i, iters = %li, fails = %li", retval, nni_inc, - nnf_inc); -#endif - /* return if nonlinear solver failed */ - if (retval != SUN_SUCCESS) { return (retval); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(IDA_LOGGER, "end-nonlinear-solve", + "status = failed, flag = %i, iters = %li", retval, nni_inc); + return (retval); + } /* update yy and yp based on the final correction from the nonlinear solver */ N_VLinearSum(ONE, IDA_mem->ida_yypredict, ONE, IDA_mem->ida_ee, @@ -2763,6 +2775,9 @@ static int IDANls(IDAMem IDA_mem) N_VLinearSum(ONE, IDA_mem->ida_yppredict, IDA_mem->ida_cj, IDA_mem->ida_ee, IDA_mem->ida_yp); + SUNLogInfo(IDA_LOGGER, "end-nonlinear-solve", "status = success, iters = %li", + nni_inc); + /* If otherwise successful, check and enforce inequality constraints. */ if (IDA_mem->ida_constraintsSet) @@ -2865,11 +2880,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, *err_k = IDA_mem->ida_sigma[IDA_mem->ida_kk] * enorm_k; terr_k = (IDA_mem->ida_kk + 1) * (*err_k); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDATestError", - "estimate-error-order-k", - "err_k = %" RSYM ", terr_k = %" RSYM, *err_k, terr_k); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-k", + "err_k = %" RSYM ", terr_k = %" RSYM, *err_k, terr_k); IDA_mem->ida_knew = IDA_mem->ida_kk; @@ -2883,12 +2895,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, *err_km1 = IDA_mem->ida_sigma[IDA_mem->ida_kk - 1] * enorm_km1; terr_km1 = IDA_mem->ida_kk * (*err_km1); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDATestError", - "estimate-error-order-km1", - "err_km1 = %" RSYM ", terr_km1 = %" RSYM, *err_km1, - terr_km1); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-km1", + "err_km1 = %" RSYM ", terr_km1 = %" RSYM, *err_km1, terr_km1); if (IDA_mem->ida_kk > 2) { @@ -2900,12 +2908,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, err_km2 = IDA_mem->ida_sigma[IDA_mem->ida_kk - 2] * enorm_km2; terr_km2 = (IDA_mem->ida_kk - 1) * err_km2; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDATestError", - "estimate-error-order-km2", - "err_km2 = %" RSYM ", terr_km2 = %" RSYM, err_km2, - terr_km2); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-km2", + "err_km2 = %" RSYM ", terr_km2 = %" RSYM, err_km2, terr_km2); /* Decrease order if errors are reduced */ if (SUNMAX(terr_km1, terr_km2) <= terr_k) @@ -2923,14 +2927,10 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDATestError", - "new-order", "kk = %i, knew = %i", IDA_mem->ida_kk, - IDA_mem->ida_knew); + SUNLogDebug(IDA_LOGGER, "new-order", "kk = %i, knew = %i", IDA_mem->ida_kk, + IDA_mem->ida_knew); - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDATestError", - "error-estimate", "ck_enorm_k = %" RSYM, ck * enorm_k); -#endif + SUNLogDebug(IDA_LOGGER, "error-estimate", "ck_enorm_k = %" RSYM, ck * enorm_k); /* Perform error test */ if (ck * enorm_k > ONE) { return (ERROR_TEST_FAIL); } @@ -3087,12 +3087,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDAHandleNFlag", - "first-error-test_fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "first-error-test_fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -3106,12 +3103,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDAHandleNFlag", - "second-error-test-fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "second-error-test-fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -3124,12 +3118,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDAHandleNFlag", - "error-test-fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "error-test-fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -3246,12 +3237,8 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k if (terr_kp1 >= HALF * terr_k) { action = MAINTAIN; } else { action = RAISE; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, - "IDA::IDACompleteStep", "order-selection-raise", - "terr_k = %" RSYM ", terr_kp1 = %" RSYM, terr_k, - terr_kp1); -#endif + SUNLogDebug(IDA_LOGGER, "order-selection-raise", + "terr_k = %" RSYM ", terr_kp1 = %" RSYM, terr_k, terr_kp1); } else { @@ -3260,13 +3247,10 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k else if (terr_kp1 >= terr_k) { action = MAINTAIN; } else { action = RAISE; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDACompleteStep", - "order-selection-rasie-or-lower", - "terr_km1 = %" RSYM ", terr_k = %" RSYM - ", terr_kp1 = %" RSYM, - terr_km1, terr_k, terr_kp1); -#endif + SUNLogDebug(IDA_LOGGER, "order-selection-rasie-or-lower", + "terr_km1 = %" RSYM ", terr_k = %" RSYM + ", terr_kp1 = %" RSYM, + terr_km1, terr_k, terr_kp1); } } @@ -3312,14 +3296,10 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k } IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDA::IDACompleteStep", - "new-step-and-order", - "knew = %i, err_knew = %" RSYM ", eta = %" RSYM - ", hnew = %" RSYM, - IDA_mem->ida_kk, err_knew, IDA_mem->ida_eta, - IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "new-step-and-order", + "knew = %i, err_knew = %" RSYM ", eta = %" RSYM + ", hnew = %" RSYM, + IDA_mem->ida_kk, err_knew, IDA_mem->ida_eta, IDA_mem->ida_hh); } /* end of phase if block */ diff --git a/src/ida/ida_ls.c b/src/ida/ida_ls.c index c317a1e1c6..1d6a3a1199 100644 --- a/src/ida/ida_ls.c +++ b/src/ida/ida_ls.c @@ -1435,9 +1435,14 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector ypcur, N_Vector rescur) { IDALsMem idals_mem; - int nli_inc, retval; + int retval; + int nli_inc = 0; sunrealtype tol, w_mean; + /* only used with logging */ + SUNDIALS_MAYBE_UNUSED long int nps_inc = 0; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm = SUN_RCONST(0.0); + /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { @@ -1449,14 +1454,22 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, /* If the linear solver is iterative: set convergence test constant tol, in terms of the Newton convergence test constant epsNewt and safety - factors. The factor nrmlfac assures that the convergence test is + factors. The factor nrmfac assures that the convergence test is applied to the WRMS norm of the residual vector, rather than the weighted L2 norm. */ if (idals_mem->iterative) { tol = idals_mem->nrmfac * idals_mem->eplifac * IDA_mem->ida_epsNewt; + + SUNLogInfo(IDA_LOGGER, "begin-linear-solve", + "iterative = 1, res-tol = %.16g", tol); + } + else + { + tol = ZERO; + + SUNLogInfo(IDA_LOGGER, "begin-linear-solve", "iterative = 0"); } - else { tol = ZERO; } /* Set vectors ycur, ypcur and rcur for use by the Atimes and Psolve interface routines */ @@ -1473,6 +1486,10 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, IDAProcessError(IDA_mem, IDALS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in calling SUNLinSolSetScalingVectors"); idals_mem->last_flag = IDALS_SUNLS_FAIL; + + SUNLogInfo(IDA_LOGGER, "end-linear-solve", + "status = failed set scaling vectors"); + return (idals_mem->last_flag); } @@ -1503,7 +1520,15 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(idals_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(IDA_LOGGER, "end-linear-solve", "status = failed set zero guess", + ""); + return (-1); + } + + /* Store previous nps value in nps_inc */ + nps_inc = idals_mem->nps; /* If a user-provided jtsetup routine is supplied, call that here */ if (idals_mem->jtsetup) @@ -1516,6 +1541,8 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, { IDAProcessError(IDA_mem, retval, __LINE__, __func__, __FILE__, MSG_LS_JTSETUP_FAILED); + + SUNLogInfo(IDA_LOGGER, "end-linear-solve", "status = failed J-times setup"); return (idals_mem->last_flag); } } @@ -1528,6 +1555,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, { /* Retrieve solver statistics */ nli_inc = SUNLinSolNumIters(idals_mem->LS); + resnorm = SUNLinSolResNorm(idals_mem->LS); /* Copy x (or preconditioned residual vector if no iterations required) to b */ if ((nli_inc == 0) && @@ -1559,6 +1587,13 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, /* Interpret solver return value */ idals_mem->last_flag = retval; + SUNLogInfoIf(retval == SUN_SUCCESS, IDA_LOGGER, "end-linear-solve", + "status = success, iters = %i, p-solves = %i, res-norm = %.16g", + nli_inc, (int)(idals_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, IDA_LOGGER, + "end-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, res-norm = %.16g", + retval, nli_inc, (int)(idals_mem->nps - nps_inc), resnorm); + switch (retval) { case SUN_SUCCESS: return (0); break; diff --git a/src/idas/idas.c b/src/idas/idas.c index 67bcc59092..9edab3406c 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -5910,11 +5910,10 @@ static int IDAStep(IDAMem IDA_mem) for (;;) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDAStep", - "start-step-attempt", "step = %li, h = %" RSYM, - IDA_mem->ida_nst, IDA_mem->ida_hh); -#endif + SUNLogInfo(IDA_LOGGER, "begin-step-attempt", + "step = %li, tn = %" RSYM ", h = %" RSYM ", q = %d", + IDA_mem->ida_nst + 1, IDA_mem->ida_tn, IDA_mem->ida_hh, + IDA_mem->ida_kk); /*----------------------- Set method coefficients @@ -5967,6 +5966,14 @@ static int IDAStep(IDAMem IDA_mem) kflag = IDAHandleNFlag(IDA_mem, nflag, err_k, err_km1, &(IDA_mem->ida_ncfn), &ncf, &(IDA_mem->ida_netf), &nef); + SUNLogInfoIf(nflag == ERROR_TEST_FAIL, IDA_LOGGER, "end-step-attempt", + "status = failed error test, dsm = %" RSYM ", kflag = %i", + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk], kflag); + + SUNLogInfoIf(nflag != ERROR_TEST_FAIL && kflag != IDA_SUCCESS, IDA_LOGGER, + "end-step-attempt", "status = failed solve, kflag = %i", + kflag); + /* exit on nonrecoverable failure */ if (kflag != PREDICT_AGAIN) { return (kflag); } @@ -5997,6 +6004,14 @@ static int IDAStep(IDAMem IDA_mem) &(IDA_mem->ida_ncfnQ), &ncf, &(IDA_mem->ida_netfQ), &nef); + SUNLogInfoIf(nflag == ERROR_TEST_FAIL, IDA_LOGGER, + "end-step-attempt", "status = failed quad error test, dsmQ = %.16g, kflag = %i", + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk], kflag); + + SUNLogInfoIf(nflag != ERROR_TEST_FAIL && kflag != IDA_SUCCESS, + IDA_LOGGER, "end-step-attempt", + "status = failed quad solve, kflag = %i", kflag); + /* exit on nonrecoverable failure */ if (kflag != PREDICT_AGAIN) { return (kflag); } @@ -6018,6 +6033,9 @@ static int IDAStep(IDAMem IDA_mem) retval = IDA_mem->ida_res(IDA_mem->ida_tn, IDA_mem->ida_yy, IDA_mem->ida_yp, IDA_mem->ida_delta, IDA_mem->ida_user_data); + SUNLogInfoIf(retval != 0, IDA_LOGGER, "end-step-attempt", + "status = failed res eval, retval = %i", retval); + if (retval < 0) { return (IDA_RES_FAIL); } if (retval > 0) { continue; } @@ -6042,6 +6060,14 @@ static int IDAStep(IDAMem IDA_mem) &(IDA_mem->ida_ncfnQ), &ncf, &(IDA_mem->ida_netfQ), &nef); + SUNLogInfoIf(nflag == ERROR_TEST_FAIL, IDA_LOGGER, + "end-step-attempt", "status = failed sens error test, dsmS = %.16g, kflag = %i", + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk], kflag); + + SUNLogInfoIf(nflag != ERROR_TEST_FAIL && kflag != IDA_SUCCESS, + IDA_LOGGER, "end-step-attempt", + "status = failed sens solve, kflag = %i", kflag); + /* exit on nonrecoverable failure */ if (kflag != PREDICT_AGAIN) { return (kflag); } @@ -6073,6 +6099,14 @@ static int IDAStep(IDAMem IDA_mem) &(IDA_mem->ida_ncfnQ), &ncf, &(IDA_mem->ida_netfQ), &nef); + SUNLogInfoIf(nflag == ERROR_TEST_FAIL, IDA_LOGGER, + "end-step-attempt", "status = failed quad sens error test, dsmQS = %.16g, kflag = %i", + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk], kflag); + + SUNLogInfoIf(nflag != ERROR_TEST_FAIL && kflag != IDA_SUCCESS, + IDA_LOGGER, "end-step-attempt", + "status = failed quad sens solve, kflag = %i", kflag); + /* exit on nonrecoverable failure */ if (kflag != PREDICT_AGAIN) { return (kflag); } @@ -6087,6 +6121,9 @@ static int IDAStep(IDAMem IDA_mem) } /* end loop */ + SUNLogInfo(IDA_LOGGER, "end-step-attempt", "status = success, dsm = %" RSYM, + ck * err_k / IDA_mem->ida_sigma[IDA_mem->ida_kk]); + /* Nonlinear system solve and error test were both successful; update data, and consider change of step and/or order */ @@ -6329,6 +6366,9 @@ static int IDANls(IDAMem IDA_mem) if (retval > 0) { return (IDA_NLS_SETUP_RECVR); } } + SUNLogInfo(IDA_LOGGER, "begin-nonlinear-solve", "tol = %.16g", + IDA_mem->ida_epsNewt); + /* solve the nonlinear system */ if (sensi_sim) { @@ -6356,16 +6396,15 @@ static int IDANls(IDAMem IDA_mem) IDA_mem->ida_nnf += nnf_inc; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDANls", - "nls-return", "flag = %i, iters = %li, fails = %li", - retval, nni_inc, nnf_inc); -#endif - /* return if nonlinear solver failed */ - if (retval != SUN_SUCCESS) { return (retval); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(IDA_LOGGER, "end-nonlinear-solve", + "status = failed, flag = %i, iters = %li", retval, nni_inc); + return (retval); + } - /* update the state using the final correction from the nonlinear solver */ + /* update yy and yp based on the final correction from the nonlinear solver */ N_VLinearSum(ONE, IDA_mem->ida_yypredict, ONE, IDA_mem->ida_ee, IDA_mem->ida_yy); N_VLinearSum(ONE, IDA_mem->ida_yppredict, IDA_mem->ida_cj, IDA_mem->ida_ee, @@ -6380,6 +6419,9 @@ static int IDANls(IDAMem IDA_mem) IDA_mem->ida_cj, IDA_mem->ida_eeS, IDA_mem->ida_ypS); } + SUNLogInfo(IDA_LOGGER, "end-nonlinear-solve", "status = success, iters = %li", + nni_inc); + /* If otherwise successful, check and enforce inequality constraints. */ if (IDA_mem->ida_constraintsSet) @@ -6675,11 +6717,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, *err_k = IDA_mem->ida_sigma[IDA_mem->ida_kk] * enorm_k; terr_k = (IDA_mem->ida_kk + 1) * (*err_k); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDATestError", - "estimate-error-order-k", - "err_k = %" RSYM ", terr_k = %" RSYM, *err_k, terr_k); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-k", + "err_k = %" RSYM ", terr_k = %" RSYM, *err_k, terr_k); IDA_mem->ida_knew = IDA_mem->ida_kk; @@ -6693,12 +6732,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, *err_km1 = IDA_mem->ida_sigma[IDA_mem->ida_kk - 1] * enorm_km1; terr_km1 = IDA_mem->ida_kk * (*err_km1); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDATestError", - "estimate-error-order-km1", - "err_km1 = %" RSYM ", terr_km1 = %" RSYM, *err_km1, - terr_km1); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-km1", + "err_km1 = %" RSYM ", terr_km1 = %" RSYM, *err_km1, terr_km1); if (IDA_mem->ida_kk > 2) { @@ -6710,12 +6745,8 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, *err_km2 = IDA_mem->ida_sigma[IDA_mem->ida_kk - 2] * enorm_km2; terr_km2 = (IDA_mem->ida_kk - 1) * (*err_km2); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDATestError", - "estimate-error-order-km2", - "err_km2 = %" RSYM ", terr_km2 = %" RSYM, *err_km2, - terr_km2); -#endif + SUNLogDebug(IDA_LOGGER, "estimate-error-order-km2", + "err_km2 = %" RSYM ", terr_km2 = %" RSYM, err_km2, terr_km2); /* Decrease order if errors are reduced */ if (SUNMAX(terr_km1, terr_km2) <= terr_k) @@ -6733,14 +6764,10 @@ static int IDATestError(IDAMem IDA_mem, sunrealtype ck, sunrealtype* err_k, } } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDATestError", - "new-order", "kk = %i, knew = %i", IDA_mem->ida_kk, - IDA_mem->ida_knew); + SUNLogDebug(IDA_LOGGER, "new-order", "kk = %i, knew = %i", IDA_mem->ida_kk, + IDA_mem->ida_knew); - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDATestError", - "error-estimate", "ck_enorm_k = %" RSYM, ck * enorm_k); -#endif + SUNLogDebug(IDA_LOGGER, "error-estimate", "ck_enorm_k = %" RSYM, ck * enorm_k); /* Perform error test */ if (ck * enorm_k > ONE) { return (ERROR_TEST_FAIL); } @@ -7251,12 +7278,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDAHandleNFlag", - "first-error-test_fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "first-error-test_fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -7270,12 +7294,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDAHandleNFlag", - "second-error-test-fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "second-error-test-fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -7288,12 +7309,9 @@ static int IDAHandleNFlag(IDAMem IDA_mem, int nflag, sunrealtype err_k, IDA_mem->ida_hmin / SUNRabs(IDA_mem->ida_hh)); IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDAHandleNFlag", - "error-test-fail", - "kk = %i, eta = %" RSYM ", h = %" RSYM, - IDA_mem->ida_kk, IDA_mem->ida_eta, IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "error-test-fail", + "kk = %i, eta = %" RSYM ", h = %" RSYM, IDA_mem->ida_kk, + IDA_mem->ida_eta, IDA_mem->ida_hh); return (PREDICT_AGAIN); } @@ -7471,12 +7489,8 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k if (terr_kp1 >= HALF * terr_k) { action = MAINTAIN; } else { action = RAISE; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, - "IDAS::IDACompleteStep", "order-selection-raise", - "terr_k = %" RSYM ", terr_kp1 = %" RSYM, terr_k, - terr_kp1); -#endif + SUNLogDebug(IDA_LOGGER, "order-selection-raise", + "terr_k = %" RSYM ", terr_kp1 = %" RSYM, terr_k, terr_kp1); } else { @@ -7485,13 +7499,10 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k else if (terr_kp1 >= terr_k) { action = MAINTAIN; } else { action = RAISE; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDACompleteStep", - "order-selection-rasie-or-lower", - "terr_km1 = %" RSYM ", terr_k = %" RSYM - ", terr_kp1 = %" RSYM, - terr_km1, terr_k, terr_kp1); -#endif + SUNLogDebug(IDA_LOGGER, "order-selection-rasie-or-lower", + "terr_km1 = %" RSYM ", terr_k = %" RSYM + ", terr_kp1 = %" RSYM, + terr_km1, terr_k, terr_kp1); } } @@ -7537,14 +7548,10 @@ static void IDACompleteStep(IDAMem IDA_mem, sunrealtype err_k, sunrealtype err_k } IDA_mem->ida_hh *= IDA_mem->ida_eta; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(IDA_LOGGER, SUN_LOGLEVEL_INFO, "IDAS::IDACompleteStep", - "new-step-and-order", - "knew = %i, err_knew = %" RSYM ", eta = %" RSYM - ", hnew = %" RSYM, - IDA_mem->ida_kk, err_knew, IDA_mem->ida_eta, - IDA_mem->ida_hh); -#endif + SUNLogDebug(IDA_LOGGER, "new-step-and-order", + "knew = %i, err_knew = %" RSYM ", eta = %" RSYM + ", hnew = %" RSYM, + IDA_mem->ida_kk, err_knew, IDA_mem->ida_eta, IDA_mem->ida_hh); } /* end of phase if block */ diff --git a/src/idas/idas_ls.c b/src/idas/idas_ls.c index 9df01ba85c..7de3eb21cf 100644 --- a/src/idas/idas_ls.c +++ b/src/idas/idas_ls.c @@ -1476,9 +1476,14 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector ypcur, N_Vector rescur) { IDALsMem idals_mem; - int nli_inc, retval; + int retval; + int nli_inc = 0; sunrealtype tol, w_mean; + /* only used with logging */ + SUNDIALS_MAYBE_UNUSED long int nps_inc = 0; + SUNDIALS_MAYBE_UNUSED sunrealtype resnorm = SUN_RCONST(0.0); + /* access IDALsMem structure */ if (IDA_mem->ida_lmem == NULL) { @@ -1496,8 +1501,16 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, if (idals_mem->iterative) { tol = idals_mem->nrmfac * idals_mem->eplifac * IDA_mem->ida_epsNewt; + + SUNLogInfo(IDA_LOGGER, "begin-linear-solve", + "iterative = 1, res-tol = %.16g", tol); + } + else + { + tol = ZERO; + + SUNLogInfo(IDA_LOGGER, "begin-linear-solve", "iterative = 0"); } - else { tol = ZERO; } /* Set vectors ycur, ypcur and rcur for use by the Atimes and Psolve interface routines */ @@ -1514,6 +1527,10 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, IDAProcessError(IDA_mem, IDALS_SUNLS_FAIL, __LINE__, __func__, __FILE__, "Error in calling SUNLinSolSetScalingVectors"); idals_mem->last_flag = IDALS_SUNLS_FAIL; + + SUNLogInfo(IDA_LOGGER, "end-linear-solve", + "status = failed set scaling vectors"); + return (idals_mem->last_flag); } @@ -1544,7 +1561,15 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, /* Set zero initial guess flag */ retval = SUNLinSolSetZeroGuess(idals_mem->LS, SUNTRUE); - if (retval != SUN_SUCCESS) { return (-1); } + if (retval != SUN_SUCCESS) + { + SUNLogInfo(IDA_LOGGER, "end-linear-solve", "status = failed set zero guess", + ""); + return (-1); + } + + /* Store previous nps value in nps_inc */ + nps_inc = idals_mem->nps; /* If a user-provided jtsetup routine is supplied, call that here */ if (idals_mem->jtsetup) @@ -1557,6 +1582,8 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, { IDAProcessError(IDA_mem, retval, __LINE__, __func__, __FILE__, MSG_LS_JTSETUP_FAILED); + + SUNLogInfo(IDA_LOGGER, "end-linear-solve", "status = failed J-times setup"); return (idals_mem->last_flag); } } @@ -1569,6 +1596,7 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, { /* Retrieve solver statistics */ nli_inc = SUNLinSolNumIters(idals_mem->LS); + resnorm = SUNLinSolResNorm(idals_mem->LS); /* Copy x (or preconditioned residual vector if no iterations required) to b */ if ((nli_inc == 0) && @@ -1600,6 +1628,13 @@ int idaLsSolve(IDAMem IDA_mem, N_Vector b, N_Vector weight, N_Vector ycur, /* Interpret solver return value */ idals_mem->last_flag = retval; + SUNLogInfoIf(retval == SUN_SUCCESS, IDA_LOGGER, "end-linear-solve", + "status = success, iters = %i, p-solves = %i, res-norm = %.16g", + nli_inc, (int)(idals_mem->nps - nps_inc), resnorm); + SUNLogInfoIf(retval != SUN_SUCCESS, IDA_LOGGER, + "end-linear-solve", "status = failed, retval = %i, iters = %i, p-solves = %i, res-norm = %.16g", + retval, nli_inc, (int)(idals_mem->nps - nps_inc), resnorm); + switch (retval) { case SUN_SUCCESS: return (0); break; diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index cc3081e7b5..7d603d5fad 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -537,7 +537,7 @@ int KINSol(void* kinmem, N_Vector u, int strategy_in, N_Vector u_scale, } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSol", INFO_TOL, + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", __func__, INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); #endif @@ -709,7 +709,7 @@ int KINSol(void* kinmem, N_Vector u, int strategy_in, N_Vector u_scale, /* print the current nni, fnorm, and nfe values */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSol", INFO_NNI, + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", __func__, INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); #endif @@ -718,7 +718,7 @@ int KINSol(void* kinmem, N_Vector u, int strategy_in, N_Vector u_scale, } /* end of loop; return */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINSol", INFO_RETVAL, ret); + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", __func__, INFO_RETVAL, ret); #endif switch (ret) @@ -1521,7 +1521,7 @@ static int KINSolInit(KINMem kin_mem) /* all error checking is complete at this point */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", "KINSolInit", INFO_TOL, + KINPrintInfo(kin_mem, PRNT_TOL, "KINSOL", __func__, INFO_TOL, kin_mem->kin_scsteptol, kin_mem->kin_fnormtol); #endif @@ -1593,7 +1593,7 @@ static int KINSolInit(KINMem kin_mem) } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINSolInit", INFO_FMAX, fmax); + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", __func__, INFO_FMAX, fmax); #endif /* initialize the linear solver if linit != NULL */ @@ -1615,7 +1615,7 @@ static int KINSolInit(KINMem kin_mem) kin_mem->kin_f1norm = HALF * kin_mem->kin_fnorm * kin_mem->kin_fnorm; kin_mem->kin_fnorm_sub = kin_mem->kin_fnorm; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINSolInit", INFO_NNI, + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", __func__, INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); #endif @@ -1718,7 +1718,7 @@ static int KINFullNewton(KINMem kin_mem, sunrealtype* fnormp, pnorm = kin_mem->kin_mxnewtstep; } #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, pnorm); + KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", __func__, INFO_PNORM, pnorm); #endif /* If constraints are active, then constrain the step accordingly */ @@ -1736,8 +1736,7 @@ static int KINFullNewton(KINMem kin_mem, sunrealtype* fnormp, pnorm *= kin_mem->kin_stepmul; kin_mem->kin_stepl = pnorm; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", "KINFullNewton", INFO_PNORM, - pnorm); + KINPrintInfo(kin_mem, PRNT_PNORM, "KINSOL", __func__, INFO_PNORM, pnorm); #endif if (pnorm <= kin_mem->kin_scsteptol) { @@ -1794,8 +1793,7 @@ static int KINFullNewton(KINMem kin_mem, sunrealtype* fnormp, kin_mem->kin_sJpnorm *= ratio; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", "KINFullNewton", INFO_FNORM, - *fnormp); + KINPrintInfo(kin_mem, PRNT_FNORM, "KINSOL", __func__, INFO_FNORM, *fnormp); #endif if (pnorm > (POINT99 * kin_mem->kin_mxnewtstep)) { *maxStepTaken = SUNTRUE; } @@ -1904,8 +1902,7 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, rlmax = ONE; kin_mem->kin_stepl = pnorm; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", "KINLineSearch", INFO_PNORM1, - pnorm); + KINPrintInfo(kin_mem, PRNT_PNORM1, "KINSOL", __func__, INFO_PNORM1, pnorm); #endif if (pnorm <= kin_mem->kin_scsteptol) { @@ -1965,7 +1962,7 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, rl = ONE; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", "KINLineSearch", INFO_LAM, rlmin, + KINPrintInfo(kin_mem, PRNT_LAM, "KINSOL", __func__, INFO_LAM, rlmin, kin_mem->kin_f1norm, pnorm); #endif @@ -1978,8 +1975,8 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, alpha_cond = kin_mem->kin_f1norm + (alpha * slpi * rl); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", "KINLinesearch", INFO_ALPHA, - *fnormp, *f1normp, alpha_cond, rl); + KINPrintInfo(kin_mem, PRNT_ALPHA, "KINSOL", __func__, INFO_ALPHA, *fnormp, + *f1normp, alpha_cond, rl); #endif /* If ALPHA condition is satisfied, break out from loop */ @@ -2077,7 +2074,7 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", "KINLineSearch", INFO_BETA, + KINPrintInfo(kin_mem, PRNT_BETA, "KINSOL", __func__, INFO_BETA, *f1normp, beta_cond, rl); #endif } @@ -2109,7 +2106,7 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, beta_cond = kin_mem->kin_f1norm + (beta * slpi * rl); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", "KINLineSearch", + KINPrintInfo(kin_mem, PRNT_ALPHABETA, "KINSOL", __func__, INFO_ALPHABETA, *f1normp, alpha_cond, beta_cond, rl); #endif @@ -2152,7 +2149,7 @@ static int KINLineSearch(KINMem kin_mem, sunrealtype* fnormp, kin_mem->kin_nbktrk += nbktrk_l; #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_ADJ, "KINSOL", "KINLineSearch", INFO_ADJ, nbktrk_l); + KINPrintInfo(kin_mem, PRNT_ADJ, "KINSOL", __func__, INFO_ADJ, nbktrk_l); #endif /* scale sFdotJp and sJpnorm by rl * ratio for later use in KINForcingTerm */ @@ -2255,7 +2252,7 @@ static int KINStop(KINMem kin_mem, sunbooleantype maxStepTaken, int sflag) fmax = KINScFNorm(kin_mem, kin_mem->kin_fval, kin_mem->kin_fscale); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINStop", INFO_FMAX, fmax); + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", __func__, INFO_FMAX, fmax); #endif if (fmax <= kin_mem->kin_fnormtol) { return (KIN_SUCCESS); } @@ -2545,9 +2542,7 @@ void KINPrintInfo(SUNDIALS_MAYBE_UNUSED KINMem kin_mem, int info_code, vsnprintf(msg, sizeof msg, msgfmt, ap); } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_INFO, "KINSOL", fname, "%s", msg); -#endif + SUNLogInfo(KIN_LOGGER, "KINSOL", fname, "%s", msg); /* finalize argument processing */ @@ -2726,13 +2721,13 @@ static int KINPicardAA(KINMem kin_mem) kin_mem->kin_fscale); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINPicardAA", INFO_FMAX, + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", __func__, INFO_FMAX, kin_mem->kin_fnorm); #endif #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO /* print the current iter, fnorm, and nfe values */ - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINPicardAA", INFO_NNI, + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", __func__, INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); #endif @@ -2753,7 +2748,7 @@ static int KINPicardAA(KINMem kin_mem) } /* end of loop; return */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINPicardAA", INFO_RETVAL, ret); + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", __func__, INFO_RETVAL, ret); #endif return (ret); @@ -2841,11 +2836,7 @@ static int KINFP(KINMem kin_mem) ret = CONTINUE_ITERATIONS; tolfac = ONE; -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", "begin", - "%s", "u_0(:) ="); - N_VPrintFile(kin_mem->kin_uu, KIN_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(KIN_LOGGER, "begin", kin_mem->kin_uu, "u_0(:) ="); /* initialize iteration count */ kin_mem->kin_nni = 0; @@ -2860,12 +2851,8 @@ static int KINFP(KINMem kin_mem) kin_mem->kin_user_data); kin_mem->kin_nfe++; -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", - "while-loop-before-compute-new", - "G_%ld(:) =", kin_mem->kin_nni - 1); - N_VPrintFile(kin_mem->kin_fval, KIN_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(KIN_LOGGER, "while-loop-before-compute-new", + kin_mem->kin_fval, "G_%ld(:) =", kin_mem->kin_nni - 1); if (retval < 0) { @@ -2916,12 +2903,8 @@ static int KINFP(KINMem kin_mem) else { tolfac = ONE; } } -#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG - SUNLogger_QueueMsg(KIN_LOGGER, SUN_LOGLEVEL_DEBUG, "KINSOL::KINFP", - "while-loop-after-compute-new", - "u_%ld(:) =", kin_mem->kin_nni); - N_VPrintFile(kin_mem->kin_unew, KIN_LOGGER->debug_fp); -#endif + SUNLogExtraDebugVec(KIN_LOGGER, "while-loop-after-compute-new", + kin_mem->kin_unew, "u_%ld(:) =", kin_mem->kin_nni); /* compute change between iterations */ N_VLinearSum(ONE, kin_mem->kin_unew, -ONE, kin_mem->kin_uu, delta); @@ -2930,13 +2913,13 @@ static int KINFP(KINMem kin_mem) kin_mem->kin_fnorm = KINScFNorm(kin_mem, delta, kin_mem->kin_fscale); #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", "KINFP", INFO_FMAX, + KINPrintInfo(kin_mem, PRNT_FMAX, "KINSOL", __func__, INFO_FMAX, kin_mem->kin_fnorm); #endif #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO /* print the current iter, fnorm, and nfe values */ - KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", "KINFP", INFO_NNI, + KINPrintInfo(kin_mem, PRNT_NNI, "KINSOL", __func__, INFO_NNI, kin_mem->kin_nni, kin_mem->kin_nfe, kin_mem->kin_fnorm); #endif @@ -2958,7 +2941,7 @@ static int KINFP(KINMem kin_mem) } /* end of loop; return */ #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO - KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", "KINFP", INFO_RETVAL, ret); + KINPrintInfo(kin_mem, PRNT_RETVAL, "KINSOL", __func__, INFO_RETVAL, ret); #endif return (ret); diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index 117bf003f5..0e16581223 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -475,50 +475,50 @@ void KINInfoHandler(const char* module, const char* function, char* msg, #if defined(SUNDIALS_EXTENDED_PRECISION) #define INFO_RVAR "%s = %26.16Lg" -#define INFO_NNI "nni = %4ld nfe = %6ld fnorm = %26.16Lg" -#define INFO_TOL "scsteptol = %12.3Lg fnormtol = %12.3Lg" +#define INFO_NNI "nni = %4ld, nfe = %6ld, fnorm = %26.16Lg" +#define INFO_TOL "scsteptol = %12.3Lg, fnormtol = %12.3Lg" #define INFO_FMAX "scaled f norm (for stopping) = %12.3Lg" #define INFO_PNORM "pnorm = %12.4Le" #define INFO_PNORM1 "(ivio=1) pnorm = %12.4Le" #define INFO_FNORM "fnorm(L2) = %20.8Le" -#define INFO_LAM "min_lam = %11.4Le f1norm = %11.4Le pnorm = %11.4Le" +#define INFO_LAM "min_lam = %11.4Le, f1norm = %11.4Le, pnorm = %11.4Le" #define INFO_ALPHA \ - "fnorm = %15.8Le f1norm = %15.8Le alpha_cond = %15.8Le lam = %15.8Le" -#define INFO_BETA "f1norm = %15.8Le beta_cond = %15.8Le lam = %15.8Le" + "fnorm = %15.8Le, f1norm = %15.8Le, alpha_cond = %15.8Le, lam = %15.8Le" +#define INFO_BETA "f1norm = %15.8Le, beta_cond = %15.8Le, lam = %15.8Le" #define INFO_ALPHABETA \ - "f1norm = %15.8Le alpha_cond = %15.8Le beta_cond = %15.8Le lam = %15.8Le" + "f1norm = %15.8Le, alpha_cond = %15.8Le, beta_cond = %15.8Le, lam = %15.8Le" #elif defined(SUNDIALS_DOUBLE_PRECISION) #define INFO_RVAR "%s = %26.16lg" -#define INFO_NNI "nni = %4ld nfe = %6ld fnorm = %26.16lg" -#define INFO_TOL "scsteptol = %12.3lg fnormtol = %12.3lg" +#define INFO_NNI "nni = %4ld, nfe = %6ld, fnorm = %26.16lg" +#define INFO_TOL "scsteptol = %12.3lg, fnormtol = %12.3lg" #define INFO_FMAX "scaled f norm (for stopping) = %12.3lg" #define INFO_PNORM "pnorm = %12.4le" #define INFO_PNORM1 "(ivio=1) pnorm = %12.4le" #define INFO_FNORM "fnorm(L2) = %20.8le" -#define INFO_LAM "min_lam = %11.4le f1norm = %11.4le pnorm = %11.4le" +#define INFO_LAM "min_lam = %11.4le, f1norm = %11.4le, pnorm = %11.4le" #define INFO_ALPHA \ - "fnorm = %15.8le f1norm = %15.8le alpha_cond = %15.8le lam = %15.8le" -#define INFO_BETA "f1norm = %15.8le beta_cond = %15.8le lam = %15.8le" + "fnorm = %15.8le, f1norm = %15.8le, alpha_cond = %15.8le,lam = %15.8le" +#define INFO_BETA "f1norm = %15.8le, beta_cond = %15.8le, lam = %15.8le" #define INFO_ALPHABETA \ - "f1norm = %15.8le alpha_cond = %15.8le beta_cond = %15.8le lam = %15.8le" + "f1norm = %15.8le, alpha_cond = %15.8le, beta_cond = %15.8le, lam = %15.8le" #else #define INFO_RVAR "%s = %26.16g" -#define INFO_NNI "nni = %4ld nfe = %6ld fnorm = %26.16g" -#define INFO_TOL "scsteptol = %12.3g fnormtol = %12.3g" +#define INFO_NNI "nni = %4ld, nfe = %6ld, fnorm = %26.16g" +#define INFO_TOL "scsteptol = %12.3g, fnormtol = %12.3g" #define INFO_FMAX "scaled f norm (for stopping) = %12.3g" #define INFO_PNORM "pnorm = %12.4e" #define INFO_PNORM1 "(ivio=1) pnorm = %12.4e" #define INFO_FNORM "fnorm(L2) = %20.8e" -#define INFO_LAM "min_lam = %11.4e f1norm = %11.4e pnorm = %11.4e" +#define INFO_LAM "min_lam = %11.4e, f1norm = %11.4e, pnorm = %11.4e" #define INFO_ALPHA \ - "fnorm = %15.8e f1norm = %15.8e alpha_cond = %15.8e lam = %15.8e" -#define INFO_BETA "f1norm = %15.8e beta_cond = %15.8e lam = %15.8e" + "fnorm = %15.8e, f1norm = %15.8e, alpha_cond = %15.8e, lam = %15.8e" +#define INFO_BETA "f1norm = %15.8e, beta_cond = %15.8e, lam = %15.8e" #define INFO_ALPHABETA \ - "f1norm = %15.8e alpha_cond = %15.8e beta_cond = %15.8e lam = %15.8e" + "f1norm = %15.8e, alpha_cond = %15.8e, beta_cond = %15.8e, lam = %15.8e" #endif diff --git a/src/kinsol/kinsol_ls.c b/src/kinsol/kinsol_ls.c index 750c713c3b..a13fef09f8 100644 --- a/src/kinsol/kinsol_ls.c +++ b/src/kinsol/kinsol_ls.c @@ -1252,7 +1252,7 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, sunrealtype* sJpnorm, #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO if (kinls_mem->iterative) { - KINPrintInfo(kin_mem, PRNT_NLI, "KINLS", "kinLsSolve", INFO_NLI, nli_inc); + KINPrintInfo(kin_mem, PRNT_NLI, "KINLS", __func__, INFO_NLI, nli_inc); } #endif @@ -1336,7 +1336,7 @@ int kinLsSolve(KINMem kin_mem, N_Vector xx, N_Vector bb, sunrealtype* sJpnorm, #if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGLEVEL_INFO if (kin_mem->kin_inexact_ls) { - KINPrintInfo(kin_mem, PRNT_EPS, "KINLS", "kinLsSolve", INFO_EPS, res_norm, + KINPrintInfo(kin_mem, PRNT_EPS, "KINLS", __func__, INFO_EPS, res_norm, kin_mem->kin_eps); } #endif diff --git a/src/sundials/sundials_logger_impl.h b/src/sundials/sundials_logger_impl.h index b6f93eeeae..ddded4f470 100644 --- a/src/sundials/sundials_logger_impl.h +++ b/src/sundials/sundials_logger_impl.h @@ -32,6 +32,108 @@ #define SUNDIALS_LOGGING_EXTRA_DEBUG #endif +/* + In the variadic logging macros below, the message text (msg_txt) is not + explicitly included as a macro parameter and instead inserted by + __VA_ARGS__. This allows us to omit adding an empty string for the optional + arguments when the message does not include format specifiers e.g., + + SUNLogInfo(logger, "label", "message"); + + instead of + + SUNLogInfo(logger, "label", "message", ""); + + Without this workaround, an orphaned comma is placed end of the argument list + if the empty string is not included. Note the C23 standard adds __VA_OPT__ + which will allow for explicitly including msg_txt while removing the trailing + comma when no additional arguments are needed. +*/ + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO +#define SUNLogInfo(logger, label, /* msg_txt, */...) \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_INFO, __func__, label, \ + /* msg_txt, */ __VA_ARGS__) +#define SUNLogInfoIf(condition, logger, label, /* msg_txt, */...) \ + do { \ + if ((condition)) \ + { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_INFO, __func__, label, \ + /* msg_txt, */ __VA_ARGS__); \ + } \ + } \ + while (0) +#else +#define SUNLogInfo(logger, label, /* msg_txt, */...) +#define SUNLogInfoIf(condition, logger, label, /* msg_txt, */...) +#endif + +#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_DEBUG +#define SUNLogDebug(logger, label, /* msg_txt, */...) \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__) +#define SUNLogDebugIf(condition, logger, label, /* msg_txt, */...) \ + do { \ + if ((condition)) \ + { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__); \ + } \ + } \ + while (0) +#else +#define SUNLogDebug(logger, label, /* msg_txt, */...) +#define SUNLogDebugIf(condition, logger, label, /* msg_txt, */...) +#endif + +#ifdef SUNDIALS_LOGGING_EXTRA_DEBUG +#define SUNLogExtraDebug(logger, label, /* msg_txt, */...) \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__) +#define SUNLogExtraDebugIf(condition, logger, label, /* msg_txt, */...) \ + do { \ + if ((condition)) \ + { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__); \ + } \ + } \ + while (0) +#define SUNLogExtraDebugVec(logger, label, vec, /*msg_txt, */...) \ + do { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__); \ + N_VPrintFile(vec, logger->debug_fp); \ + } \ + while (0) +#define SUNLogExtraDebugVecIf(condition, logger, label, vec, /* msg_txt, */...) \ + do { \ + if ((condition)) \ + { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, \ + /* msg_txt, */ __VA_ARGS__); \ + N_VPrintFile(vec, logger->debug_fp); \ + } \ + } \ + while (0) +#define SUNLogExtraDebugVecArray(logger, label, nvecs, vecs, msg_txt) \ + do { \ + for (int vi = 0; vi < (nvecs); ++vi) \ + { \ + SUNLogger_QueueMsg(logger, SUN_LOGLEVEL_DEBUG, __func__, label, msg_txt, \ + vi); \ + N_VPrintFile(vecs[vi], logger->debug_fp); \ + } \ + } \ + while (0) +#else +#define SUNLogExtraDebug(logger, label, /* msg_txt, */...) +#define SUNLogExtraDebugIf(condition, logger, label, /* msg_txt, */...) +#define SUNLogExtraDebugVec(logger, label, vec, /* msg_txt, */...) +#define SUNLogExtraDebugVecIf(condition, logger, label, vec, /* msg_txt, */...) +#define SUNLogExtraDebugVecArray(logger, label, nvecs, vecs, msg_txt) +#endif + struct SUNLogger_ { /* MPI information */ diff --git a/src/sunlinsol/pcg/sunlinsol_pcg.c b/src/sunlinsol/pcg/sunlinsol_pcg.c index 30a7647a1d..c93c651a0b 100644 --- a/src/sunlinsol/pcg/sunlinsol_pcg.c +++ b/src/sunlinsol/pcg/sunlinsol_pcg.c @@ -311,6 +311,10 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, /* If preconditioning, check if psolve has been set */ SUNAssert(!UsePrec || psolve, SUN_ERR_ARG_CORRUPT); + SUNLogInfo(S->sunctx->logger, "linear-solver", "solver = pcg"); + + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Set r to initial residual r_0 = b - A*x_0 */ if (*zeroguess) { @@ -325,6 +329,10 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec"); + return (LASTFLAG(S)); } N_VLinearSum(ONE, b, -ONE, r, r); @@ -346,16 +354,15 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, SUNCheckLastErr(); *res_norm = r0_norm = rho = SUNRsqrt(rho); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, "SUNLinSolSolve_PCG", - "initial-residual", "nli = %li, resnorm = %.16g", - (long int)0, *res_norm); -#endif - if (rho <= delta) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = success", + *res_norm); + return (LASTFLAG(S)); } @@ -368,6 +375,11 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = failed preconditioner solve", + *res_norm); + return (LASTFLAG(S)); } } @@ -385,9 +397,15 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, N_VScale(ONE, z, p); SUNCheckLastErr(); + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = continue", + *res_norm); + /* Begin main iteration loop */ for (l = 0; l < l_max; l++) { + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* increment counter */ (*nli)++; @@ -398,6 +416,10 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec"); + return (LASTFLAG(S)); } @@ -437,11 +459,8 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, SUNCheckLastErr(); *res_norm = rho = SUNRsqrt(rho); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_PCG", "iterate-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, res-norm = %.16g", *nli, *res_norm); if (rho <= delta) { @@ -461,6 +480,10 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve"); + return (LASTFLAG(S)); } } @@ -481,13 +504,32 @@ int SUNLinSolSolve_PCG(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix nul, /* Update p = z + beta*p */ N_VLinearSum(ONE, z, beta, p, p); SUNCheckLastErr(); + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = continue"); } /* Main loop finished, return with result */ *zeroguess = SUNFALSE; - if (converged == SUNTRUE) { LASTFLAG(S) = SUN_SUCCESS; } - else if (rho < r0_norm) { LASTFLAG(S) = SUNLS_RES_REDUCED; } - else { LASTFLAG(S) = SUNLS_CONV_FAIL; } + if (converged == SUNTRUE) + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = success"); + + LASTFLAG(S) = SUN_SUCCESS; + } + else if (rho < r0_norm) + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed residual reduced"); + + LASTFLAG(S) = SUNLS_RES_REDUCED; + } + else + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed max iterations"); + + LASTFLAG(S) = SUNLS_CONV_FAIL; + } return (LASTFLAG(S)); } diff --git a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c index daa873987c..4f582b1c45 100644 --- a/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c +++ b/src/sunlinsol/spbcgs/sunlinsol_spbcgs.c @@ -348,11 +348,19 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, scale_x = (sx != NULL); scale_b = (sb != NULL); + SUNLogInfo(S->sunctx->logger, "linear-solver", "solver = spbcgs"); + + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Check for unsupported use case */ if (preOnRight && !(*zeroguess)) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_ERR_ARG_INCOMPATIBLE; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed unsupported configuration"); + return SUN_ERR_ARG_INCOMPATIBLE; } @@ -377,6 +385,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } N_VLinearSum(ONE, b, -ONE, r_star, r_star); @@ -393,6 +405,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -423,19 +439,20 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *res_norm = r_norm = rho = SUNRsqrt(beta_denom); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPBCGS", "initial-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif - if (r_norm <= delta) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "cur-iter = 0, res-norm = %.16g, status = success", *res_norm); + return (LASTFLAG(S)); } + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "cur-iter = 0, res-norm = %.16g, status = continue", *res_norm); + /* Copy r_star to r and p */ N_VScale(ONE, r_star, r); @@ -454,6 +471,8 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, for (l = 0; l < l_max; l++) { + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + (*nli)++; /* Generate Ap = A-tilde p, where A-tilde = sb P1_inv A P2_inv sx_inv */ @@ -483,6 +502,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -495,6 +518,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = ", status); + return (LASTFLAG(S)); } @@ -508,6 +535,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -568,6 +599,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -580,6 +615,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -593,6 +632,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -654,11 +697,8 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *res_norm = rho = SUNRsqrt(N_VDotProd(r, r)); SUNCheckLastErr(); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPBCGS", "iterate-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, res-norm = %.16g", *nli, *res_norm); if (rho <= delta) { @@ -687,6 +727,9 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* update beta_denom for next iteration */ beta_denom = beta_num; + + SUNLogInfoIf(l < l_max - 1, S->sunctx->logger, "end-linear-iterate", + "status = continue"); } /* Main loop finished */ @@ -708,6 +751,10 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } N_VScale(ONE, vtemp, x); @@ -715,14 +762,29 @@ int SUNLinSolSolve_SPBCGS(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, } *zeroguess = SUNFALSE; - if (converged == SUNTRUE) { LASTFLAG(S) = SUN_SUCCESS; } - else { LASTFLAG(S) = SUNLS_RES_REDUCED; } + if (converged == SUNTRUE) + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = success"); + + LASTFLAG(S) = SUN_SUCCESS; + } + else + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed residual reduced"); + + LASTFLAG(S) = SUNLS_RES_REDUCED; + } return (LASTFLAG(S)); } else { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_CONV_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed max iterations"); + return (LASTFLAG(S)); } } diff --git a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c index 63a2c2940a..cca603af1a 100644 --- a/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c +++ b/src/sunlinsol/spfgmr/sunlinsol_spfgmr.c @@ -426,6 +426,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* If preconditioning, check if psolve has been set */ SUNAssert(!preOnRight || psolve, SUN_ERR_ARG_CORRUPT); + SUNLogInfo(S->sunctx->logger, "linear-solver", "solver = spfgmr"); + + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Set vtemp and V[0] to initial (unscaled) residual r_0 = b - A*x_0 */ if (*zeroguess) { @@ -440,6 +444,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } N_VLinearSum(ONE, b, -ONE, vtemp, vtemp); @@ -463,19 +471,22 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, SUNCheckLastErr(); *res_norm = r_norm = beta = SUNRsqrt(r_norm); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPFGMR", "initial-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif - if (r_norm <= delta) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = success", + *res_norm); + return (LASTFLAG(S)); } + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = continue", + *res_norm); + /* Initialize rho to avoid compiler warning message */ rho = beta; @@ -499,6 +510,8 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* Inner loop: generate Krylov sequence and Arnoldi basis. */ for (l = 0; l < l_max; l++) { + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + (*nli)++; krydim = l + 1; @@ -528,6 +541,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -541,6 +558,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -567,6 +588,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_QRFACT_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed QR factorization"); + return (LASTFLAG(S)); } @@ -574,11 +599,9 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, rotation_product *= givens[2 * l + 1]; *res_norm = rho = SUNRabs(rotation_product * r_norm); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPFGMR", "iterate-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, total-iters = %i, res-norm = %.16g", l + 1, + *nli, *res_norm); if (rho <= delta) { @@ -589,6 +612,9 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* Normalize V[l+1] with norm value from the Gram-Schmidt routine. */ N_VScale(ONE / Hes[l + 1][l], V[l + 1], V[l + 1]); SUNCheckLastErr(); + + SUNLogInfoIf(l < l_max - 1, S->sunctx->logger, "end-linear-iterate", + "status = continue"); } /* Inner loop is done. Compute the new correction vector xcor. */ @@ -600,6 +626,10 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_QRSOL_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed QR solve"); + return (LASTFLAG(S)); } @@ -629,6 +659,9 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, } *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = success"); + return (LASTFLAG(S)); } @@ -656,6 +689,8 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, Xv[k] = V[k]; } SUNCheckCall(N_VLinearCombination(krydim + 1, cv, Xv, V[0])); + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = continue"); } /* Failed to converge, even after allowed restarts. @@ -675,11 +710,19 @@ int SUNLinSolSolve_SPFGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, } *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_RES_REDUCED; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed residual reduced"); + return (LASTFLAG(S)); } *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_CONV_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed max iterations"); + return (LASTFLAG(S)); } diff --git a/src/sunlinsol/spgmr/sunlinsol_spgmr.c b/src/sunlinsol/spgmr/sunlinsol_spgmr.c index 221a2f5660..54cb9446f0 100644 --- a/src/sunlinsol/spgmr/sunlinsol_spgmr.c +++ b/src/sunlinsol/spgmr/sunlinsol_spgmr.c @@ -410,6 +410,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* If preconditioning, check if psolve has been set */ SUNAssert(!(preOnLeft || preOnRight) || psolve, SUN_ERR_ARG_CORRUPT); + SUNLogInfo(S->sunctx->logger, "linear-solver", "solver = spgmr"); + + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Set vtemp and V[0] to initial (unscaled) residual r_0 = b - A*x_0 */ if (*zeroguess) { @@ -424,6 +428,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } N_VLinearSum(ONE, b, -ONE, vtemp, vtemp); @@ -441,6 +449,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -467,19 +479,22 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, SUNCheckLastErr(); *res_norm = r_norm = beta = SUNRsqrt(r_norm); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPGMR", "initial-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif - if (r_norm <= delta) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = success", + *res_norm); + return (LASTFLAG(S)); } + SUNLogInfo(S->sunctx->logger, + "end-linear-iterate", "cur-iter = 0, total-iters = 0, res-norm = %.16g, status = continue", + *res_norm); + /* Initialize rho to avoid compiler warning message */ rho = beta; @@ -504,6 +519,8 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* Inner loop: generate Krylov sequence and Arnoldi basis */ for (l = 0; l < l_max; l++) { + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + (*nli)++; krydim = l_plus_1 = l + 1; @@ -532,6 +549,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -543,6 +564,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -555,6 +580,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -592,6 +621,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_QRFACT_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed QR factorization"); + return (LASTFLAG(S)); } @@ -599,11 +632,9 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, rotation_product *= givens[2 * l + 1]; *res_norm = rho = SUNRabs(rotation_product * r_norm); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPGMR", "iterate-residual", - "nli = %li, resnorm = %.16g", (long int)*nli, *res_norm); -#endif + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, total-iters = %i, res-norm = %.16g", l + 1, + *nli, *res_norm); if (rho <= delta) { @@ -614,6 +645,9 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* Normalize V[l+1] with norm value from the Gram-Schmidt routine */ N_VScale(ONE / Hes[l_plus_1][l], V[l_plus_1], V[l_plus_1]); SUNCheckLastErr(); + + SUNLogInfoIf(l < l_max - 1, S->sunctx->logger, "end-linear-iterate", + "status = continue"); } /* Inner loop is done. Compute the new correction vector xcor */ @@ -625,6 +659,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_QRSOL_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed QR solve"); + return (LASTFLAG(S)); } @@ -657,6 +695,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -680,6 +722,9 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = success"); + return (LASTFLAG(S)); } @@ -707,6 +752,8 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, Xv[k] = V[k]; } SUNCheckCall(N_VLinearCombination(krydim + 1, cv, Xv, V[0])); + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = continue"); } /* Failed to converge, even after allowed restarts. @@ -729,6 +776,10 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -752,11 +803,19 @@ int SUNLinSolSolve_SPGMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_RES_REDUCED; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed residual reduced"); + return (LASTFLAG(S)); } *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_CONV_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed max iterations"); + return (LASTFLAG(S)); } diff --git a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c index c7d0066589..ad2c64a03b 100644 --- a/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c +++ b/src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c @@ -350,11 +350,19 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, scale_x = (sx != NULL); scale_b = (sb != NULL); + SUNLogInfo(S->sunctx->logger, "linear-solver", "solver = sptfqmr"); + + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Check for unsupported use case */ if (preOnRight && !(*zeroguess)) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_ERR_ARG_INCOMPATIBLE; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed unsupported configuration"); + return SUN_ERR_ARG_INCOMPATIBLE; } @@ -379,6 +387,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } N_VLinearSum(ONE, b, -ONE, r_star, r_star); @@ -394,6 +406,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -425,19 +441,20 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, to do anything */ *res_norm = r_init_norm = SUNRsqrt(rho[0]); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPFTQMR", "initial-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif - if (r_init_norm <= delta) { *zeroguess = SUNFALSE; LASTFLAG(S) = SUN_SUCCESS; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "cur-iter = 0, res-norm = %.16g, status = success", *res_norm); + return (LASTFLAG(S)); } + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = 0, res-norm = %.16g", *res_norm); + /* Set v = A*r_0 (preconditioned and scaled) */ if (scale_x) { @@ -460,6 +477,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -469,6 +490,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, { *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -480,6 +505,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -520,9 +549,13 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, tau = r_init_norm; v_bar = eta = ZERO; + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = continue"); + /* START outer loop */ for (n = 0; n < l_max; ++n) { + SUNLogInfo(S->sunctx->logger, "begin-linear-iterate", ""); + /* Increment linear iteration counter */ (*nli)++; @@ -556,6 +589,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -566,6 +603,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -577,6 +618,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -654,16 +699,13 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, /* NOTE: just use approximation to norm of residual, if possible */ *res_norm = r_curr_norm = tau * SUNRsqrt(m + 1); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFOs - SUNLogger_QueueMsg(S->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNLinSolSolve_SPTFQMR", "iterate-residual", - "nli = %li, resnorm = %.16g", (long int)0, *res_norm); -#endif - /* Exit inner loop if iteration has converged based upon approximation to norm of current residual */ if (r_curr_norm <= delta) { + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, res-norm = %.16g", n + 1, *nli, *res_norm); + converged = SUNTRUE; break; } @@ -703,6 +745,11 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", + status); + return (LASTFLAG(S)); } N_VScale(ONE, vtemp2, vtemp1); @@ -715,6 +762,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -726,6 +777,11 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", + status); + return (LASTFLAG(S)); } } @@ -758,6 +814,11 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", + status); + return (LASTFLAG(S)); } } @@ -783,11 +844,17 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, (meaning exit if we have converged) */ if (r_curr_norm <= delta) { + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, res-norm = %.16g", n + 1, *nli, *res_norm); + converged = SUNTRUE; break; } } + SUNLogInfo(S->sunctx->logger, "linear-iterate", + "cur-iter = %i, res-norm = %.16g", n + 1, *nli, *res_norm); + } /* END inner loop */ /* If converged, then exit outer loop as well */ @@ -838,6 +905,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -848,6 +919,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_ATIMES_FAIL_UNREC : SUNLS_ATIMES_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed matvec, retval = %d", status); + return (LASTFLAG(S)); } @@ -859,6 +934,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } } @@ -885,6 +964,9 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, SUNCheckLastErr(); rho[0] = rho[1]; + SUNLogInfoIf(n < l_max - 1, S->sunctx->logger, "end-linear-iterate", + "status = continue"); + } /* END outer loop */ /* Determine return value */ @@ -906,6 +988,10 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, *zeroguess = SUNFALSE; LASTFLAG(S) = (status < 0) ? SUNLS_PSOLVE_FAIL_UNREC : SUNLS_PSOLVE_FAIL_REC; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed preconditioner solve, retval = %d", status); + return (LASTFLAG(S)); } N_VScale(ONE, vtemp1, x); @@ -913,14 +999,29 @@ int SUNLinSolSolve_SPTFQMR(SUNLinearSolver S, SUNDIALS_MAYBE_UNUSED SUNMatrix A, } *zeroguess = SUNFALSE; - if (converged == SUNTRUE) { LASTFLAG(S) = SUN_SUCCESS; } - else { LASTFLAG(S) = SUNLS_RES_REDUCED; } + if (converged == SUNTRUE) + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", "status = success"); + + LASTFLAG(S) = SUN_SUCCESS; + } + else + { + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed residual reduced"); + + LASTFLAG(S) = SUNLS_RES_REDUCED; + } return (LASTFLAG(S)); } else { *zeroguess = SUNFALSE; LASTFLAG(S) = SUNLS_CONV_FAIL; + + SUNLogInfo(S->sunctx->logger, "end-linear-iterate", + "status = failed max iterations"); + return (LASTFLAG(S)); } } diff --git a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c index ff1d45a2c9..d8a52c9e47 100644 --- a/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c +++ b/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c @@ -182,6 +182,8 @@ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, /* check that all required function pointers have been set */ SUNAssert(FP_CONTENT(NLS)->Sys && FP_CONTENT(NLS)->CTest, SUN_ERR_ARG_CORRUPT); + SUNLogInfo(NLS->sunctx->logger, "nonlinear-solver", "solver = Fixed-Point"); + /* set local shortcut variables */ yprev = FP_CONTENT(NLS)->yprev; gy = FP_CONTENT(NLS)->gy; @@ -191,13 +193,6 @@ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, FP_CONTENT(NLS)->niters = 0; FP_CONTENT(NLS)->nconvfails = 0; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNNonlinSolSolve_FixedPoint", "begin-iteration", - "iter = %ld, nni = %ld", (long int)0, - FP_CONTENT(NLS)->niters); -#endif - /* Looping point for attempts at solution of the nonlinear system: Evaluate fixed-point function (store in gy). Performs the accelerated fixed-point iteration. @@ -206,6 +201,8 @@ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, FP_CONTENT(NLS)->curiter < FP_CONTENT(NLS)->maxiters; FP_CONTENT(NLS)->curiter++) { + SUNLogInfo(NLS->sunctx->logger, "begin-nonlinear-iterate", ""); + /* update previous solution guess */ N_VScale(ONE, ycor, yprev); SUNCheckLastErr(); @@ -215,7 +212,13 @@ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, callback and returns integrator specific error values where 0 == success, < 0 is a failure, > 0 is recoverable error. */ retval = FP_CONTENT(NLS)->Sys(ycor, gy, mem); - if (retval != 0) { return retval; } + if (retval != 0) + { + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = failed nonlinear system evaluation, retval = %d", + retval); + return retval; + } /* perform fixed point update, based on choice of acceleration or not */ if (FP_CONTENT(NLS)->m == 0) @@ -240,26 +243,36 @@ int SUNNonlinSolSolve_FixedPoint(SUNNonlinearSolver NLS, retval = FP_CONTENT(NLS)->CTest(NLS, ycor, delta, tol, w, FP_CONTENT(NLS)->ctest_data); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, - "SUNNonlinSolSolve_FixedPoint", "end-of-iterate", - "iter = %ld, nni = %ld, wrmsnorm = %.16g", - (long int)FP_CONTENT(NLS)->curiter, - FP_CONTENT(NLS)->niters, N_VWrmsNorm(delta, w)); -#endif + SUNLogInfo(NLS->sunctx->logger, "nonlinear-iterate", + "cur-iter = %d, update-norm = %.16g", FP_CONTENT(NLS)->niters, + N_VWrmsNorm(delta, w)); /* return if successful */ - if (retval == 0) { return SUN_SUCCESS; } + if (retval == 0) + { + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = success"); + return SUN_SUCCESS; + } /* check if the iterations should continue; otherwise increment the convergence failure count and return error flag */ if (retval != SUN_NLS_CONTINUE) { + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = failed, retval = %i", retval); FP_CONTENT(NLS)->nconvfails++; return (retval); } + + SUNLogInfoIf(FP_CONTENT(NLS)->curiter < FP_CONTENT(NLS)->maxiters - 1, + NLS->sunctx->logger, "end-nonlinear-iterate", + "status = continue"); } + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = failed max iterations"); + /* if we've reached this point, then we exhausted the iteration limit; increment the convergence failure count and return */ FP_CONTENT(NLS)->nconvfails++; diff --git a/src/sunnonlinsol/newton/sunnonlinsol_newton.c b/src/sunnonlinsol/newton/sunnonlinsol_newton.c index 94364f20ac..cea69f7085 100644 --- a/src/sunnonlinsol/newton/sunnonlinsol_newton.c +++ b/src/sunnonlinsol/newton/sunnonlinsol_newton.c @@ -191,6 +191,8 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, SUNAssert(!callLSetup || (callLSetup && NEWTON_CONTENT(NLS)->LSetup), SUN_ERR_ARG_CORRUPT); + SUNLogInfo(NLS->sunctx->logger, "nonlinear-solver", "solver = Newton"); + /* set local shortcut variables */ delta = NEWTON_CONTENT(NLS)->delta; @@ -207,20 +209,11 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, Perform Newton iteration */ for (;;) { + SUNLogInfo(NLS->sunctx->logger, "begin-nonlinear-iterate", ""); + /* initialize current iteration counter for this solve attempt */ NEWTON_CONTENT(NLS)->curiter = 0; -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "begin-attempt", "iter = %ld, nni = %ld", - (long int)NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters); - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "start-iterate", "iter = %ld, nni = %ld", - (long int)NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters); -#endif - /* compute the nonlinear residual, store in delta */ retval = NEWTON_CONTENT(NLS)->Sys(ycor, delta, mem); if (retval != SUN_SUCCESS) { break; } @@ -255,25 +248,18 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, retval = NEWTON_CONTENT(NLS)->CTest(NLS, ycor, delta, tol, w, NEWTON_CONTENT(NLS)->ctest_data); -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "end-iterate", "iter = %ld, nni = %ld, wrmsnorm = %.16g", - NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters - 1, N_VWrmsNorm(delta, w)); -#endif - - /* Update here so begin/end logging iterations match */ NEWTON_CONTENT(NLS)->curiter++; + SUNLogInfo(NLS->sunctx->logger, "nonlinear-iterate", + "cur-iter = %i, total-iters = %li, update-norm = %.16g", + NEWTON_CONTENT(NLS)->curiter, NEWTON_CONTENT(NLS)->niters, + N_VWrmsNorm(delta, w)); + /* if successful update Jacobian status and return */ if (retval == SUN_SUCCESS) { -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "end-attempt", "success, iter = %ld, nni = %ld", - (long int)NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters); -#endif + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = success"); NEWTON_CONTENT(NLS)->jcur = SUNFALSE; return SUN_SUCCESS; } @@ -288,12 +274,9 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, break; } -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "start-iterate", "iter = %ld, nni = %ld", - (long int)NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters); -#endif + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = continue"); + SUNLogInfo(NLS->sunctx->logger, "begin-nonlinear-iterate", ""); /* compute the nonlinear residual, store in delta */ retval = NEWTON_CONTENT(NLS)->Sys(ycor, delta, mem); @@ -303,13 +286,6 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, /* all errors go here */ -#if SUNDIALS_LOGGING_LEVEL >= SUNDIALS_LOGGING_INFO - SUNLogger_QueueMsg(NLS->sunctx->logger, SUN_LOGLEVEL_INFO, __func__, - "end-attempt", "failure, iter = %ld, nni = %ld", - (long int)NEWTON_CONTENT(NLS)->curiter, - NEWTON_CONTENT(NLS)->niters); -#endif - /* If there is a recoverable convergence failure and the Jacobian-related data appears not to be current, increment the convergence failure count, reset the initial correction to zero, and loop again with a call to @@ -322,9 +298,18 @@ int SUNNonlinSolSolve_Newton(SUNNonlinearSolver NLS, jbad = SUNTRUE; N_VConst(ZERO, ycor); SUNCheckLastErr(); + + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = continue"); + continue; } - else { break; } + else + { + SUNLogInfo(NLS->sunctx->logger, "end-nonlinear-iterate", + "status = failure, retval = %i", retval); + break; + } } /* end of setup loop */ diff --git a/test/answers b/test/answers index a5e4ab70cb..2a8beef77b 160000 --- a/test/answers +++ b/test/answers @@ -1 +1 @@ -Subproject commit a5e4ab70cbddac437d97a8f08018b22331eff555 +Subproject commit 2a8beef77b5b6f76c5c25e3381704b9199f36749 diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt index 29e3a74114..5db2dc0e0d 100644 --- a/test/unit_tests/CMakeLists.txt +++ b/test/unit_tests/CMakeLists.txt @@ -49,6 +49,7 @@ if(BUILD_KINSOL) endif() if(CXX_FOUND) + add_subdirectory(logging) add_subdirectory(sunmemory) if(SUNDIALS_BUILD_WITH_PROFILING) add_subdirectory(profiling) diff --git a/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp b/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp index 0cd794adc0..908d6af528 100644 --- a/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp +++ b/test/unit_tests/ida/CXX_serial/ida_test_kpr.cpp @@ -193,7 +193,7 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void* user_data) } /* ----------------------------------------------------------------------------- - * Compute the ODE RHS Jacobin: + * Compute the DAE residual Jacobian: * [a/2 + (a(1+r(t))-r'(t))/(2u^2) - cj b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-s'(t))/(2u^2) - cj ] * ---------------------------------------------------------------------------*/ diff --git a/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp b/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp index 55da14923e..95a5122aa6 100644 --- a/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp +++ b/test/unit_tests/idas/CXX_serial/idas_test_kpr.cpp @@ -193,7 +193,7 @@ int res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, void* user_data) } /* ----------------------------------------------------------------------------- - * Compute the ODE RHS Jacobin: + * Compute the DAE residual Jacobian: * [a/2 + (a(1+r(t))-r'(t))/(2u^2) - cj b/2 + b*(2+s(t))/(2*v^2) ] * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-s'(t))/(2u^2) - cj ] * ---------------------------------------------------------------------------*/ diff --git a/test/unit_tests/logging/CMakeLists.txt b/test/unit_tests/logging/CMakeLists.txt new file mode 100644 index 0000000000..fbb966653d --- /dev/null +++ b/test/unit_tests/logging/CMakeLists.txt @@ -0,0 +1,177 @@ +# ------------------------------------------------------------------------------ +# Programmer(s): David J. Gardner @ LLNL +# ------------------------------------------------------------------------------ +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ------------------------------------------------------------------------------ + +# List of test tuples of the form "name\;args" +set(unit_tests) + +if(BUILD_ARKODE) + # ARKStep + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;0") # ERK + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;1 1 1") # DIRK Newton + # + Dense + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;1 1 0") # DIRK Newton + # + GMRES + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;1 0") # DIRK + # Fixed-point + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;2 1 1") # ImEx Newton + # + Dense + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;2 1 0") # ImEx Newton + # + GMRES + list(APPEND unit_tests "test_logging_arkode_arkstep.cpp\;2 0") # ImEx + # Fixed-point + # ERKStep + list(APPEND unit_tests "test_logging_arkode_erkstep.cpp\;") + # ForcingStep + list(APPEND unit_tests "test_logging_arkode_forcingstep.cpp\;") + # LSRKStep + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;0") # RKC + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;1") # RKL + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;2") # SSPs2 + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;3") # SSPs3 + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;4") # SSP43 + list(APPEND unit_tests "test_logging_arkode_lsrkstep.cpp\;5") # SSP104 + # MRIStep -- MRI-GARK + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;0") # Explicit + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;1 1 1") # Implicit + # Newton + + # Dense + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;1 1 0") # Implicit + # Newton + + # GMRES + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;1 0") # Implicit + # Fixed-point + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;2 1 1") # ImEx Newton + # + Dense + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;2 1 0") # ImEx Newton + # + GMRES + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;2 0") # ImEx + # Fixed-point + # MRIStep -- MRI-SR + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;3") # Explicit + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;4 1 1") # Implicit + # Newton + + # Dense + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;4 1 0") # Implicit + # Newton + + # GMRES + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;4 0") # Implicit + # Fixed-point + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;5 1 1") # ImEx Newton + # + Dense + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;5 1 0") # ImEx Newton + # + GMRES + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;5 0") # ImEx + # Fixed-point + # MRIStep -- MERK + list(APPEND unit_tests "test_logging_arkode_mristep.cpp\;6") # Explicit + # SplittingStep + list(APPEND unit_tests "test_logging_arkode_splittingstep.cpp\;") + # SPRKStep + list(APPEND unit_tests "test_logging_arkode_sprkstep.cpp\;0") + list(APPEND unit_tests "test_logging_arkode_sprkstep.cpp\;1") # Compensated + # sum +endif() + +if(BUILD_CVODE) + list(APPEND unit_tests "test_logging_cvode.cpp\;1 1") # Newton + Dense + list(APPEND unit_tests "test_logging_cvode.cpp\;1 0") # Newton + GMRES + list(APPEND unit_tests "test_logging_cvode.cpp\;0") # Fixed-point +endif() + +if(BUILD_CVODES) + list(APPEND unit_tests "test_logging_cvodes.cpp\;1 1") # Newton + Dense + list(APPEND unit_tests "test_logging_cvodes.cpp\;1 0") # Newton + GMRES + list(APPEND unit_tests "test_logging_cvodes.cpp\;0") # Fixed-point +endif() + +if(BUILD_IDA) + list(APPEND unit_tests "test_logging_ida.cpp\;1") # Newton + Dense + list(APPEND unit_tests "test_logging_ida.cpp\;0") # Newton + GMRES +endif() + +if(BUILD_IDAS) + list(APPEND unit_tests "test_logging_idas.cpp\;1") # Newton + Dense + list(APPEND unit_tests "test_logging_idas.cpp\;0") # Newton + GMRES +endif() + +# if(BUILD_KINSOL) list(APPEND unit_tests "test_logging_kinsol.cpp\;") endif() + +# Add the build and install targets for each test +foreach(test_tuple ${unit_tests}) + + # parse the test tuple + list(GET test_tuple 0 test_src) + list(GET test_tuple 1 test_args) + + # extract the file name without extension + get_filename_component(test_target ${test_src} NAME_WE) + + # The CMake regular expression support is somewhat limited (see this issue + # https://gitlab.kitware.com/cmake/cmake/-/issues/17686) so the ordering here + # matters i.e., match cvodes before cvode and idas before ida + string(REGEX MATCH "arkode|cvodes|cvode|idas|ida|kinsol" _pkg ${test_target}) + + # 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_target}) + + # test source files + add_executable(${test_target} ${test_src}) + + set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") + + # include location of public and private header files + target_include_directories( + ${test_target} PRIVATE ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/test/unit_tests) + + # libraries to link against + target_link_libraries(${test_target} sundials_${_pkg} sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) + + endif() + + # Set the test name + if(${SUNDIALS_LOGGING_LEVEL} GREATER 2) + set(test_name "${test_target}_lvl${SUNDIALS_LOGGING_LEVEL}") + else() + set(test_name "${test_target}") + endif() + + if("${test_args}" STREQUAL "") + set(test_name ${test_name}) + else() + string(REPLACE " " "_" test_name "${test_name}_${test_args}") + string(REPLACE " " ";" test_args "${test_args}") + endif() + + # For now, only diff when dev test are enabled + # TODO(DJG): Update Jenkins diff handling for testing single/extended + if(SUNDIALS_TEST_DEVTESTS) + set(diff_output "") + else() + set(diff_output "NODIFF") + endif() + + # add test to regression tests + sundials_add_test( + ${test_name} ${test_target} + TEST_ARGS ${test_args} + ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} + ANSWER_FILE ${test_name}.out + LABELS "logging" ${diff_output}) + +endforeach() + +message(STATUS "Added logging units tests") diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep.cpp b/test/unit_tests/logging/test_logging_arkode_arkstep.cpp new file mode 100644 index 0000000000..fd76f2686c --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep.cpp @@ -0,0 +1,224 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in ARKStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode_arkstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sundials/sundials_nonlinearsolver.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" +#include "sunnonlinsol/sunnonlinsol_fixedpoint.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start ARKStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use ERK (0) or DIRK (1) otherwise use ImEx + int method_type = 0; + if (argc > 1) { method_type = stoi(argv[1]); } + + // Use Newton (1) otherwise use fixed-point + bool newton = true; + if (argc > 2) { newton = stoi(argv[2]); } + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 3) { direct = stoi(argv[3]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + // Create ARKStep memory structure + void* arkode_mem = nullptr; + if (method_type == 0) + { + cout << "Using ERK method" << endl; + arkode_mem = ARKStepCreate(ode_rhs, nullptr, zero, y, sunctx); + if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } + } + else if (method_type == 1) + { + cout << "Using DIRK method" << endl; + arkode_mem = ARKStepCreate(nullptr, ode_rhs, zero, y, sunctx); + if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } + } + else + { + cout << "Using ImEx method" << endl; + arkode_mem = ARKStepCreate(ode_rhs_ex, ode_rhs_im, zero, y, sunctx); + if (check_ptr(arkode_mem, "ARKStepCreate")) { return 1; } + } + + flag = ARKodeSetUserData(arkode_mem, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + SUNNonlinearSolver NLS = nullptr; + + if (method_type > 0) + { + if (!newton) + { + cout << "Using fixed-point nonlinear solver" << endl; + + NLS = SUNNonlinSol_FixedPoint(y, 0, sunctx); + if (check_ptr(NLS, "SUNNonlinSol_FixedPoint")) { return 1; } + + flag = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + } + else { cout << "Using Newton nonlinear solver" << endl; } + + if (newton && direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + + if (method_type == 1) + { + flag = ARKodeSetJacFn(arkode_mem, ode_rhs_jac); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + } + else + { + flag = ARKodeSetJacFn(arkode_mem, ode_rhs_jac_im); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + } + } + else if (newton) + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKode")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + SUNMatDestroy(A); + SUNLinSolFree(LS); + SUNNonlinSolFree(NLS); + ARKodeFree(&arkode_mem); + + cout << "End ARKStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_0.out new file mode 100644 index 0000000000..3231e1f77b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_0.out @@ -0,0 +1,27 @@ +Start ARKStep Logging test +Using ERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 + 2.517915854919593e-03 1.224744224325435e+00 1.731684811946959e+00 2.964961609563943e-12 1.116839953851922e-11 + 4.069501512093439e-03 1.224743181155563e+00 1.731094930827531e+00 3.276268145668837e-12 1.207456357121828e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.004069501512093439 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001551585657173846 +Current step size = 0.005891448410411261 +Explicit RHS fn evals = 17 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_1_0.out new file mode 100644 index 0000000000..dc63f717b1 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_1_0.out @@ -0,0 +1,28 @@ +Start ARKStep Logging test +Using DIRK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309104e+00 1.732050195224279e+00 2.442490654175344e-15 1.998401444325282e-15 + 3.747645245885612e-03 1.224743437035635e+00 1.731240118427390e+00 9.108140908153928e-10 5.271953984475886e-10 + 5.983772473598933e-03 1.224741215598295e+00 1.729984808853534e+00 1.411835537368233e-09 7.625806652811207e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.005983772473598933 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002236127227713321 +Current step size = 0.01008263498360196 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_0.out new file mode 100644 index 0000000000..95dfaba3c7 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_0.out @@ -0,0 +1,40 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870316961e+00 1.732050195224250e+00 7.854161765408207e-12 2.731148640577885e-14 + 3.781706040192805e-03 1.224743411877806e+00 1.731225318313145e+00 1.057254284120290e-10 1.072486544018147e-10 + 6.015016008565610e-03 1.224741178982448e+00 1.729963189938353e+00 2.336992821483364e-10 1.590565457121329e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.00601501600856561 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233309968372805 +Current step size = 0.01012222046831338 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 25 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 25 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 25 +LS iters per NLS iter = 0.9259259259259259 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_1.out new file mode 100644 index 0000000000..32ed4bcd8a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_1_1_1.out @@ -0,0 +1,40 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224358e+00 2.220446049250313e-16 8.104628079763643e-14 + 3.781888019234090e-03 1.224743411639714e+00 1.731225239016591e+00 8.112177596331094e-12 2.569811030639357e-11 + 6.015183160113438e-03 1.224741178552313e+00 1.729963074226947e+00 8.796519068710040e-12 8.689449160215190e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.006015183160113438 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233295140879348 +Current step size = 0.01012243049502511 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 44 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_2_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_2_0.out new file mode 100644 index 0000000000..630881c055 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_2_0.out @@ -0,0 +1,28 @@ +Start ARKStep Logging test +Using ImEx method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 6.661338147750939e-16 4.440892098500626e-16 + 6.516232489625870e-03 1.224740537689633e+00 1.729601039259757e+00 2.278266464372791e-11 2.184104008762233e-10 + 1.016972555592109e-02 1.224734315814070e+00 1.726089959024652e+00 2.482614114285298e-11 2.127358289527592e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01016972555592109 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003653493066295218 +Current step size = 0.02097401965432383 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 55 +NLS iters = 35 +NLS fails = 0 +NLS iters per step = 11.66666666666667 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_0.out new file mode 100644 index 0000000000..b313e81b9e --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_0.out @@ -0,0 +1,40 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 4.440892098500626e-16 0.000000000000000e+00 + 6.554112583561956e-03 1.224740487151591e+00 1.729572495016884e+00 2.946975996565016e-11 2.206064220189319e-10 + 1.020477566424183e-02 1.224734242922404e+00 1.726048871574017e+00 3.169020601490047e-11 2.147166888732954e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020477566424183 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650663080679877 +Current step size = 0.021026187632719 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 47 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 29 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 29 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 29 +LS iters per NLS iter = 1.074074074074074 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_1.out new file mode 100644 index 0000000000..58b43ea292 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_2_1_1.out @@ -0,0 +1,40 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.554114938847760e-03 1.224740487151368e+00 1.729572493235030e+00 2.654254593892347e-11 2.225244433162743e-10 + 1.020478290001611e-02 1.224734242910499e+00 1.726048863075356e+00 2.852318381485475e-11 2.167570567479515e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020478290001611 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650667961168346 +Current step size = 0.02102619488941004 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 46 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_0.out new file mode 100644 index 0000000000..213d39f82b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_0.out @@ -0,0 +1,69 @@ +Start ARKStep Logging test +Using ERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.002414929829310085 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001310450940264551 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001310450940264551 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002517915854919593 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001914183397592072 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0133919487764742 + 2.517915854919593e-03 1.224744224325435e+00 1.731684811946959e+00 2.964961609563943e-12 1.116839953851922e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002517915854919593, h = 0.001551585657173846 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002517915854919593 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.003293708683506516 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.003293708683506516 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.004069501512093439 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.003681605097799978 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.002281919499449541 + 4.069501512093439e-03 1.224743181155563e+00 1.731094930827531e+00 3.276268145668837e-12 1.207456357121828e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.004069501512093439 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001551585657173846 +Current step size = 0.005891448410411261 +Explicit RHS fn evals = 17 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_0.out new file mode 100644 index 0000000000..133c9cc8fc --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_0.out @@ -0,0 +1,196 @@ +Start ARKStep Logging test +Using DIRK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.03124727847178982 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1562371643297375 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 4.895203386441746e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09624183453536866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.08528677931681904 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499813593647933 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.823414317944671e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.257351772282993e-09 + 1.029860256095084e-04 1.224744870309104e+00 1.732050195224279e+00 2.442490654175344e-15 1.998401444325282e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003644659220276104 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001014150830678534 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 43.57700668684354 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.04633595994229208 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002836480440816586 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 209.0149703261905 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2042649292783136 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002107548596761365 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 130.3177912362241 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1317639651299175 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00192531563574756 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 115.7066352240969 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1179815315332422 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003747645245885612 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 330.9200194658451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.3098605220101286 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.007864906415392474 + 3.747645245885612e-03 1.224743437035635e+00 1.731240118427390e+00 9.108140908153928e-10 5.271953984475886e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003747645245885612, h = 0.002236127227713321 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004306677052813943 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 113.5127839162196 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.06347372373964355 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005424740666670603 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 369.9413329159526 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1961628166373034 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.004977515221127939 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 262.6686572611258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1422666879689584 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004865708859742272 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 237.752750401516 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1294572005123361 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005983772473598933 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 512.8615902035506 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2648770776226016 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001116850591343922 + 5.983772473598933e-03 1.224741215598295e+00 1.729984808853534e+00 1.411835537368233e-09 7.625806652811207e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.005983772473598933 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002236127227713321 +Current step size = 0.01008263498360196 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_0.out new file mode 100644 index 0000000000..f74ac6e566 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_0.out @@ -0,0 +1,382 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.03124727847178982, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.044190325002054, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 8.016227206018892e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 8.016227206018892e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647747457602 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1562371643708069, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2209527167999096, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.008105378087632e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.008105378087632e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331731583946 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.834156785593834e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09624183456739453, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1361065077128771, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.468991359913261e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.468991359913261e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623937258978928 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.08528677935133332, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1206137200497772, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.187949946472201e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.187949946472201e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459686493964 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499813599405794, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270295684377, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413027919782981e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413027919782981e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749849628705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534693105165771e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.010389402682452e-09 + 1.029860256095084e-04 1.224744870316961e+00 1.732050195224250e+00 7.854161765408207e-12 2.731148640577885e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678720014583297 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022666029255333 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 44.35369875822553, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 62.72560232529324, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.04062175054285926 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.005089991166117e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.005089991166117e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31583324937814 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.393376666599104e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862026036546981 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 212.8147091519881, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 300.9654479552272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1948470890329139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.023368215406643e-17 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.023368215406643e-17 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6569919499078 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.748984444407891e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126282033630322 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 132.6733466500091, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 187.6284461978699, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1214861228197153 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.410337134365055e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.410337134365055e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5690472826842 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.141721415834757e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942346032901157 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.7961695173268, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.5889405270037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1078639628765014 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.818288520560997e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.818288520560997e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7022409131975 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.14887367151013e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003781706040192805 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 336.9671105380513, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 476.5434577965859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3085169077524141 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.17116109814417e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.17116109814417e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.736319034684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.346288867431381e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008163105466437349 + 3.781706040192805e-03 1.224743411877806e+00 1.731225318313145e+00 1.057254284120290e-10 1.072486544018147e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003781706040192805, h = 0.002233309968372805 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340033532286006 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 114.2475703576066, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 161.5704634679017, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.06347262680418689 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.746714923333988e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.746714923333988e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.2024221826183 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.199113684336701e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456688516472409 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 372.0708229808176, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 526.1876040227913, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.206598731109143 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.060023072317438e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.060023072317438e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.939257112824 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.123782867339571e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010026522797847 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 264.2522611564104, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 373.7091316151527, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1467632212595206 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.453408637887063e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.453408637887063e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1544278478215 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.142262491733078e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898361024379207 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 239.1950412070286, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 338.2728713273712, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1328534050683189 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.003480721324008e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.003480721324008e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.1054906887548 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.769091705246994e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00601501600856561 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 515.6509104293493, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 729.2405109792198, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.2862495506617406 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.660035032647116e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.660035032647116e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.479276837567 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 7.67937747240094e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001111259275024442 + 6.015016008565610e-03 1.224741178982448e+00 1.729963189938353e+00 2.336992821483364e-10 1.590565457121329e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.00601501600856561 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233309968372805 +Current step size = 0.01012222046831338 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 25 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 25 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 25 +LS iters per NLS iter = 0.9259259259259259 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_1.out new file mode 100644 index 0000000000..3ff3e766e9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_1_1_1.out @@ -0,0 +1,257 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647749568791 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331594653479 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.380843176869396e-08 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623936755399637 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459315580529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749520049542 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.009107594385155e-09 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224358e+00 2.220446049250313e-16 8.104628079763643e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678901993624582 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022711524015654 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31728809265712 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.002706685111211134 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862162520827944 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6403773707838 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03696205723054138 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126382122103028 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5646009288685 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01706360659869033 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942437022421799 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.69961092995 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01382292596398069 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00378188801923409 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.69118258825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07750779266514742 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008164718360412736 + 3.781888019234090e-03 1.224743411639714e+00 1.731225239016591e+00 8.112177596331094e-12 2.569811030639357e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00378188801923409, h = 0.002233295140879348 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340211804453927 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.1880202704021 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01832920615797257 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456859374893601 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.8754828183439 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07514845578796357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010200346717731 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1139062313106 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04898184989809135 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898535589673764 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.0698529878246 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04334360894804039 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.006015183160113438 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.3793206142866 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.1148530271845262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.00111123036409299 + 6.015183160113438e-03 1.224741178552313e+00 1.729963074226947e+00 8.796519068710040e-12 8.689449160215190e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.006015183160113438 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233295140879348 +Current step size = 0.01012243049502511 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 44 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_0.out new file mode 100644 index 0000000000..5b62247a95 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_0.out @@ -0,0 +1,226 @@ +Start ARKStep Logging test +Using ImEx method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.02755359227464431 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09609143371919215 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1806077954736169 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 5.678291534219827e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499814051260959 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.859528530294883e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.827144826036898e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 6.661338147750939e-16 4.440892098500626e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006413246464016361 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003309609257617689 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 15.98161350203798 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0319537758652567 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.00223218385166294 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.2088497628645 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2296232565062182 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004079198833299652 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 392.2454526225389 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.768204971049801 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.00247350314635035 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005554245520023415 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 727.0172799128682 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.423068579652633 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.004581420253567278 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00651623248962587 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1001.424779946844 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.961856568802519 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.006318952069057399 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004005675669815595 + 6.516232489625870e-03 1.224740537689633e+00 1.729601039259757e+00 2.278266464372791e-11 2.184104008762233e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00651623248962587, h = 0.003653493066295218 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00651623248962587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008342979022773478 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 561.6874348987023 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.6264035376264484 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001148411251882187 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007729192187635882 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 407.4437320238362 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.45442507084866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.0008331059917899451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008781398190728904 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 816.9903551651699 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.9109014874897468 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001669947504647432 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009621701595976804 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1181.257906176007 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.316629339620776 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002413704717815864 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01016972555592109 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1436.644014581929 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.601181087086898 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002935513140712882 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004151480914860668 + 1.016972555592109e-02 1.224734315814070e+00 1.726089959024652e+00 2.482614114285298e-11 2.127358289527592e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01016972555592109 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003653493066295218 +Current step size = 0.02097401965432383 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 55 +NLS iters = 35 +NLS fails = 0 +NLS iters per step = 11.66666666666667 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_0.out new file mode 100644 index 0000000000..a42a7302fa --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_0.out @@ -0,0 +1,412 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.964790102879962e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.02755359227464431, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.03896666388690052, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 7.068684245838184e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 7.068684245838184e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288474442038 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09609143375169925, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1358938088395288, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.465154402188027e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.465154402188027e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896628805572 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1806077956037432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2554179940131215, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.633330046263267e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.633330046263267e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1806031579260884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.276257185735068e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499814053442976, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270937789918, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413182655035927e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413182655035927e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.24997498617904 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534802522694541e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742325031242378e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 4.440892098500626e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451126557952447 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328549304585732 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 16.08083333497015, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 22.74173259657616, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02645577285028037 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.441887564474575e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.441887564474575e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.0545285272489 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.371604616849797e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760042849721 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 118.5357260444194, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 167.6348313977596, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1903179152662646 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.729212284236706e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.729212284236706e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454261629101 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.939363556579449e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102684491540025 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 396.7799729589967, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 561.131619036643, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.636716394760145 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.484127247738153e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.484127247738153e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432917940788 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002185148605823037, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586443599869088 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 735.4741661021753, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1040.117540476739, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.179209245221302 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.439840890719091e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.439840890719091e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2949033035875 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0007513008267848697, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001062499818661282, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.409470765856917e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.409470765856917e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007490846834053407 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.006554112583561956 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1013.105862937948, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1432.748051486545, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.625758816210647 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.461866393280248e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.461866393280248e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.480559058974 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001425560608310061, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002016047146256928, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.674392594609514e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.674392594609514e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001421355552797087 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100678731752195 + 6.554112583561956e-03 1.224740487151591e+00 1.729572495016884e+00 2.946975996565016e-11 2.206064220189319e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.006554112583561956, h = 0.003650663080679877 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.006554112583561956 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379444123901894 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 564.5140709613839, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 798.343455304037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.5122389740491479 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.025142508879052e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.025142508879052e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0009893185947 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002506099885822652, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766132726347675 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 409.2658290091583, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 578.7892860006197, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3714280685337064 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.888978519100137e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.888978519100137e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.893774404372 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0001316914393787291, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00881752369358348 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 820.3045390101707, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1160.085804344393, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7440015048060086 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.496786641166685e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.496786641166685e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5592726848695 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0005293932474467006, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.0007486751103678599, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.624757031827298e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 5.624757031827298e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005285091861003915 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00965717620213985 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1185.704265874136, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1676.839053762838, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.074784364303355 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.722145958622607e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.722145958622607e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.627633160195 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001105910995128215, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001563994328087847, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.175020868105581e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.175020868105581e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001104064176681669 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020477566424183 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1441.799134798569, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2039.011890649931, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.306631795919364 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.979711756780436e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.979711756780436e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490301836212 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001634877898056415, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002312066496255401, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.737042516505863e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.737042516505863e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001632147729277761 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138555190661009 + 1.020477566424183e-02 1.224734242922404e+00 1.726048871574017e+00 3.169020601490047e-11 2.147166888732954e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020477566424183 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650663080679877 +Current step size = 0.021026187632719 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 47 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 29 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 29 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 29 +LS iters per NLS iter = 1.074074074074074 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_1.out new file mode 100644 index 0000000000..63c8ea6012 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl3_2_1_1.out @@ -0,0 +1,263 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964697559380313e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288476307282 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896636098527 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.180603158079822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.25245970796259e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749863599196 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742319852554314e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451128913238251 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328550482228634 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.05452507214864 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.129920641765477e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760824804608 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454769917176 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.953618323509618e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102685951817224 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432178884001 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0002187086232103356 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586445601862022 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2942058683061 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007520421592194119 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00655411493884776 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.478964763825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001424579352601338 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100655316169613 + 6.554114938847760e-03 1.224740487151368e+00 1.729572493235030e+00 2.654254593892347e-11 2.225244433162743e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00655411493884776, h = 0.003650667961168346 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00655411493884776 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379448919431933 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0014806129656 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0003203746251509396 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766136701955651 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.8942864970894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0001318689853766368 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008817529074772134 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5599166135717 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005296666417807359 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009657182705840853 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.62805856745 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001106743799152199 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020478290001611 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490382360151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001636494915150856 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138569211494713 + 1.020478290001611e-02 1.224734242910499e+00 1.726048863075356e+00 2.852318381485475e-11 2.167570567479515e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020478290001611 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650667961168346 +Current step size = 0.02102619488941004 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 46 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_0.out new file mode 100644 index 0000000000..1b43d2b34a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_0.out @@ -0,0 +1,78 @@ +Start ARKStep Logging test +Using ERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002515551905531338, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002414929829310085, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 23.44910209921841 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.002414929829310085 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001310450940264551 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001310450940264551 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002517915854919593 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001914183397592072 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00161623505955609, h_cfl = 2.414929829310085e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001551585657173846, h_cfl = 1.207464914655042e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6424972015096253 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0133919487764742 + 2.517915854919593e-03 1.224744224325435e+00 1.731684811946959e+00 2.964961609563943e-12 1.116839953851922e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002517915854919593, h = 0.001551585657173846 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002517915854919593 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.003293708683506516 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.003293708683506516 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.004069501512093439 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.003681605097799978 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006136925427511731, h_cfl = 1.551585657173847e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.005891448410411261, h_cfl = 7.757928285869233e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.797050058546112 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.002281919499449541 + 4.069501512093439e-03 1.224743181155563e+00 1.731094930827531e+00 3.276268145668837e-12 1.207456357121828e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.004069501512093439 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001551585657173846 +Current step size = 0.005891448410411261 +Explicit RHS fn evals = 17 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_0.out new file mode 100644 index 0000000000..fb7138783d --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_0.out @@ -0,0 +1,205 @@ +Start ARKStep Logging test +Using DIRK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.03124727847178982 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1562371643297375 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 4.895203386441746e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09624183453536866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.08528677931681904 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499813593647933 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.823414317944671e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003796520021120941, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003644659220276104, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.38984244421219 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.257351772282993e-09 + 1.029860256095084e-04 1.224744870309104e+00 1.732050195224279e+00 2.442490654175344e-15 1.998401444325282e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003644659220276104 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001014150830678534 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 43.57700668684354 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.04633595994229208 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002836480440816586 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 209.0149703261905 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2042649292783136 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002107548596761365 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 130.3177912362241 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1317639651299175 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00192531563574756 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 115.7066352240969 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1179815315332422 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003747645245885612 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 330.9200194658451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.3098605220101286 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00232929919553471, h_cfl = 3.644659220276104e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002236127227713321, h_cfl = 1.822329610138052e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6135353383035691 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.007864906415392474 + 3.747645245885612e-03 1.224743437035635e+00 1.731240118427390e+00 9.108140908153928e-10 5.271953984475886e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003747645245885612, h = 0.002236127227713321 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004306677052813943 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 113.5127839162196 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.06347372373964355 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005424740666670603 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 369.9413329159526 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1961628166373034 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.004977515221127939 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 262.6686572611258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1422666879689584 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004865708859742272 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 237.752750401516 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1294572005123361 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005983772473598933 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 512.8615902035506 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2648770776226016 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.01050274477458537, h_cfl = 2.236127227713321e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01008263498360195, h_cfl = 1.118063613856661e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.50897196664097 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001116850591343922 + 5.983772473598933e-03 1.224741215598295e+00 1.729984808853534e+00 1.411835537368233e-09 7.625806652811207e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.005983772473598933 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002236127227713321 +Current step size = 0.01008263498360196 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_0.out new file mode 100644 index 0000000000..f1328a7ed4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_0.out @@ -0,0 +1,391 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.03124727847178982, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.044190325002054, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 8.016227206018892e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 8.016227206018892e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647747457602 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1562371643708069, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2209527167999096, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.008105378087632e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.008105378087632e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331731583946 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.834156785593834e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09624183456739453, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1361065077128771, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.468991359913261e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.468991359913261e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623937258978928 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.08528677935133332, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1206137200497772, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.187949946472201e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.187949946472201e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459686493964 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499813599405794, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270295684377, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413027919782981e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413027919782981e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749849628705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534693105165771e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003832000015190934, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003678720014583297, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.72057463924165 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.010389402682452e-09 + 1.029860256095084e-04 1.224744870316961e+00 1.732050195224250e+00 7.854161765408207e-12 2.731148640577885e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678720014583297 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022666029255333 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 44.35369875822553, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 62.72560232529324, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.04062175054285926 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.005089991166117e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.005089991166117e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31583324937814 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.393376666599104e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862026036546981 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 212.8147091519881, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 300.9654479552272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1948470890329139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.023368215406643e-17 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.023368215406643e-17 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6569919499078 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.748984444407891e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126282033630322 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 132.6733466500091, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 187.6284461978699, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1214861228197153 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.410337134365055e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.410337134365055e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5690472826842 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.141721415834757e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942346032901157 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.7961695173268, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.5889405270037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1078639628765014 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.818288520560997e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.818288520560997e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7022409131975 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.14887367151013e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003781706040192805 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 336.9671105380513, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 476.5434577965859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3085169077524141 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.17116109814417e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.17116109814417e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.736319034684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.346288867431381e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002326364550388339, h_cfl = 3.678720014583297e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002233309968372805, h_cfl = 1.839360007291648e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.607088867736454 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008163105466437349 + 3.781706040192805e-03 1.224743411877806e+00 1.731225318313145e+00 1.057254284120290e-10 1.072486544018147e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003781706040192805, h = 0.002233309968372805 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340033532286006 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 114.2475703576066, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 161.5704634679017, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.06347262680418689 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.746714923333988e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.746714923333988e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.2024221826183 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.199113684336701e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456688516472409 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 372.0708229808176, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 526.1876040227913, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.206598731109143 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.060023072317438e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.060023072317438e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.939257112824 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.123782867339571e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010026522797847 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 264.2522611564104, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 373.7091316151527, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1467632212595206 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.453408637887063e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.453408637887063e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1544278478215 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.142262491733078e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898361024379207 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 239.1950412070286, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 338.2728713273712, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1328534050683189 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.003480721324008e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.003480721324008e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.1054906887548 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.769091705246994e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00601501600856561 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 515.6509104293493, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 729.2405109792198, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.2862495506617406 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.660035032647116e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.660035032647116e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.479276837567 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 7.67937747240094e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0105439796544931, h_cfl = 2.233309968372805e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01012222046831338, h_cfl = 1.116654984186403e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.532384940585946 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001111259275024442 + 6.015016008565610e-03 1.224741178982448e+00 1.729963189938353e+00 2.336992821483364e-10 1.590565457121329e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.00601501600856561 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233309968372805 +Current step size = 0.01012222046831338 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 25 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 25 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 25 +LS iters per NLS iter = 0.9259259259259259 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_1.out new file mode 100644 index 0000000000..9d73e95bdd --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_1_1_1.out @@ -0,0 +1,266 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647749568791 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331594653479 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.380843176869396e-08 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623936755399637 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459315580529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749520049542 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003832189576692273, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003678901993624582, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.72234166578926 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.009107594385155e-09 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224358e+00 2.220446049250313e-16 8.104628079763643e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678901993624582 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022711524015654 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31728809265712 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.002706685111211134 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862162520827944 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6403773707838 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03696205723054138 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126382122103028 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5646009288685 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01706360659869033 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942437022421799 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.69961092995 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01382292596398069 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00378188801923409 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.69118258825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07750779266514742 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002326349105082655, h_cfl = 3.678901993624582e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002233295140879348, h_cfl = 1.839450996812291e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6070548073173944 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008164718360412736 + 3.781888019234090e-03 1.224743411639714e+00 1.731225239016591e+00 8.112177596331094e-12 2.569811030639357e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00378188801923409, h = 0.002233295140879348 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340211804453927 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.1880202704021 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01832920615797257 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456859374893601 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.8754828183439 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07514845578796357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010200346717731 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1139062313106 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04898184989809135 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898535589673764 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.0698529878246 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04334360894804039 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.006015183160113438 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.3793206142866 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.1148530271845262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.01054419843231782, h_cfl = 2.233295140879348e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01012243049502511, h_cfl = 1.116647570439674e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.53250907582213 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.00111123036409299 + 6.015183160113438e-03 1.224741178552313e+00 1.729963074226947e+00 8.796519068710040e-12 8.689449160215190e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.006015183160113438 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233295140879348 +Current step size = 0.01012243049502511 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 44 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_0.out new file mode 100644 index 0000000000..8deb92c66e --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_0.out @@ -0,0 +1,235 @@ +Start ARKStep Logging test +Using ImEx method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.02755359227464431 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09609143371919215 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1806077954736169 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 5.678291534219827e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499814051260959 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.859528530294883e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00668046506668371, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006413246464016361, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.27297758176857 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.827144826036898e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 6.661338147750939e-16 4.440892098500626e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006413246464016361 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003309609257617689 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 15.98161350203798 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0319537758652567 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.00223218385166294 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.2088497628645 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2296232565062182 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004079198833299652 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 392.2454526225389 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.768204971049801 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.00247350314635035 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005554245520023415 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 727.0172799128682 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.423068579652633 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.004581420253567278 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00651623248962587 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1001.424779946844 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.961856568802519 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.006318952069057399 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003805721944057518, h_cfl = 6.413246464016361e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003653493066295217, h_cfl = 3.206623232008181e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5696791924019057 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004005675669815595 + 6.516232489625870e-03 1.224740537689633e+00 1.729601039259757e+00 2.278266464372791e-11 2.184104008762233e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00651623248962587, h = 0.003653493066295218 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00651623248962587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008342979022773478 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 561.6874348987023 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.6264035376264484 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001148411251882187 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007729192187635882 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 407.4437320238362 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.45442507084866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.0008331059917899451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008781398190728904 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 816.9903551651699 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.9109014874897468 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001669947504647432 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009621701595976804 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1181.257906176007 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.316629339620776 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002413704717815864 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01016972555592109 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1436.644014581929 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.601181087086898 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002935513140712882 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02184793713992066, h_cfl = 3.653493066295218e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.02097401965432383, h_cfl = 1.826746533147609e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.740812771157737 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004151480914860668 + 1.016972555592109e-02 1.224734315814070e+00 1.726089959024652e+00 2.482614114285298e-11 2.127358289527592e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01016972555592109 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003653493066295218 +Current step size = 0.02097401965432383 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 55 +NLS iters = 35 +NLS fails = 0 +NLS iters per step = 11.66666666666667 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_0.out new file mode 100644 index 0000000000..9b2f52735e --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_0.out @@ -0,0 +1,421 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.964790102879962e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.02755359227464431, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.03896666388690052, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 7.068684245838184e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 7.068684245838184e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288474442038 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09609143375169925, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1358938088395288, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.465154402188027e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.465154402188027e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896628805572 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1806077956037432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2554179940131215, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.633330046263267e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.633330046263267e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1806031579260884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.276257185735068e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499814053442976, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270937789918, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413182655035927e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413182655035927e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.24997498617904 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534802522694541e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006719923497867133, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006451126557952447, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.64079538726109 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742325031242378e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 4.440892098500626e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451126557952447 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328549304585732 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 16.08083333497015, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 22.74173259657616, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02645577285028037 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.441887564474575e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.441887564474575e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.0545285272489 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.371604616849797e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760042849721 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 118.5357260444194, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 167.6348313977596, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1903179152662646 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.729212284236706e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.729212284236706e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454261629101 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.939363556579449e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102684491540025 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 396.7799729589967, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 561.131619036643, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.636716394760145 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.484127247738153e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.484127247738153e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432917940788 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002185148605823037, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586443599869088 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 735.4741661021753, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1040.117540476739, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.179209245221302 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.439840890719091e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.439840890719091e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2949033035875 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0007513008267848697, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001062499818661282, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.409470765856917e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.409470765856917e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007490846834053407 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.006554112583561956 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1013.105862937948, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1432.748051486545, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.625758816210647 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.461866393280248e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.461866393280248e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.480559058974 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001425560608310061, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002016047146256928, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.674392594609514e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.674392594609514e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001421355552797087 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003802774042374871, h_cfl = 6.451126557952447e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003650663080679877, h_cfl = 3.225563278976224e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5658954366938629 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100678731752195 + 6.554112583561956e-03 1.224740487151591e+00 1.729572495016884e+00 2.946975996565016e-11 2.206064220189319e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.006554112583561956, h = 0.003650663080679877 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.006554112583561956 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379444123901894 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 564.5140709613839, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 798.343455304037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.5122389740491479 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.025142508879052e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.025142508879052e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0009893185947 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002506099885822652, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766132726347675 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 409.2658290091583, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 578.7892860006197, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3714280685337064 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.888978519100137e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.888978519100137e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.893774404372 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0001316914393787291, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00881752369358348 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 820.3045390101707, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1160.085804344393, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7440015048060086 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.496786641166685e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.496786641166685e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5592726848695 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0005293932474467006, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.0007486751103678599, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.624757031827298e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 5.624757031827298e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005285091861003915 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00965717620213985 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1185.704265874136, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1676.839053762838, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.074784364303355 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.722145958622607e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.722145958622607e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.627633160195 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001105910995128215, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001563994328087847, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.175020868105581e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.175020868105581e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001104064176681669 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020477566424183 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1441.799134798569, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2039.011890649931, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.306631795919364 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.979711756780436e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.979711756780436e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490301836212 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001634877898056415, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002312066496255401, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.737042516505863e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.737042516505863e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001632147729277761 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02190227878408229, h_cfl = 3.650663080679877e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.021026187632719, h_cfl = 1.825331540339938e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.759553036815223 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138555190661009 + 1.020477566424183e-02 1.224734242922404e+00 1.726048871574017e+00 3.169020601490047e-11 2.147166888732954e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020477566424183 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650663080679877 +Current step size = 0.021026187632719 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 47 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 29 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 29 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 29 +LS iters per NLS iter = 1.074074074074074 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_1.out new file mode 100644 index 0000000000..92f157774c --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl4_2_1_1.out @@ -0,0 +1,272 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964697559380313e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288476307282 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896636098527 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.180603158079822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.25245970796259e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749863599196 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006719925951289845, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006451128913238251, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.64081825721642 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742319852554314e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451128913238251 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328550482228634 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.05452507214864 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.129920641765477e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760824804608 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454769917176 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.953618323509618e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102685951817224 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432178884001 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0002187086232103356 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586445601862022 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2942058683061 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007520421592194119 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00655411493884776 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.478964763825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001424579352601338 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003802779126217027, h_cfl = 6.451128913238251e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003650667961168346, h_cfl = 3.225564456619126e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5658959866197795 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100655316169613 + 6.554114938847760e-03 1.224740487151368e+00 1.729572493235030e+00 2.654254593892347e-11 2.225244433162743e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00655411493884776, h = 0.003650667961168346 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00655411493884776 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379448919431933 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0014806129656 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0003203746251509396 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766136701955651 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.8942864970894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0001318689853766368 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008817529074772134 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5599166135717 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005296666417807359 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009657182705840853 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.62805856745 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001106743799152199 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020478290001611 +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490382360151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001636494915150856 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02190228634313546, h_cfl = 3.650667961168346e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.02102619488941004, h_cfl = 1.825333980584173e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.759547324780779 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138569211494713 + 1.020478290001611e-02 1.224734242910499e+00 1.726048863075356e+00 2.852318381485475e-11 2.167570567479515e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020478290001611 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650667961168346 +Current step size = 0.02102619488941004 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 46 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_0.out new file mode 100644 index 0000000000..bd71dbaa45 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_0.out @@ -0,0 +1,258 @@ +Start ARKStep Logging test +Using ERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +1.1719990452195032e-16 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.0349761842647577e-21 +4.2673725841929259e-21 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.0434965378977631e-05 +-5.9460528606460573e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.3732780587686200e-10 +-3.0618017609099279e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448708542612e+00 +1.7320505013887011e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-1.0586980816170437e-05 +-5.9457480002098806e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0903110774615028e-09 +-6.1232895581729812e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448703012778e+00 +1.7320501952399214e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-2.1021910950562200e-05 +-1.1891797736938324e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.723951920713131e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1036469467812032e-10 +-3.4444093451935336e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448707812243e+00 +1.7320504631279428e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.5766446427037753e-05 +-8.9188496712662869e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091062e+00 +1.7320501952242768e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002515551905531338, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002414929829310085, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 23.44910209921841 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.002414929829310085 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448703091062e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-2.1021934429493368e-05 +-1.1891797717486953e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001310450940264551 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5383248261792105e-08 +-1.4358928516040411e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448449258580e+00 +1.7320358362957609e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-2.2570664088408641e-04 +-1.5138592207716248e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001310450940264551 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7253284987217969e-07 +-1.8279318948087589e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247445977762563e+00 +1.7318674020347959e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-3.0942952838901327e-04 +-1.5123232637631015e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002517915854919593 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4725059817597985e-07 +-3.6521545612210971e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441230585081e+00 +1.7316849797681548e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-5.1368073663721485e-04 +-2.9068262281917068e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001914183397592072 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.9197022573340586e-07 +-2.1089114783662453e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247444783388803e+00 +1.7318393040764402e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-3.9067756713848019e-04 +-2.2100389908331053e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442243254352e+00 +1.7316848119469588e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00161623505955609, h_cfl = 2.414929829310085e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001551585657173846, h_cfl = 1.207464914655042e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6424972015096253 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0133919487764742 + 2.517915854919593e-03 1.224744224325435e+00 1.731684811946959e+00 2.964961609563943e-12 1.116839953851922e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002517915854919593, h = 0.001551585657173846 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002517915854919593 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442243254352e+00 +1.7316848119469588e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-5.1396713859683273e-04 +-2.9068243253515669e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.003293708683506516 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.9873202025276405e-07 +-2.2550934655697668e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247438255934149e+00 +1.7314593026004017e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-6.5508725381151222e-04 +-3.8021423830036460e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.003293708683506516 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.0821199360567276e-07 +-2.9496747940006233e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247437161134416e+00 +1.7313898444675586e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-6.8959742055192609e-04 +-3.8016008656274547e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.004069501512093439 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0699694669524497e-06 +-5.8985093774072378e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247431543559681e+00 +1.7310949610092181e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-8.3061368682849036e-04 +-4.6964615005457105e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.003681605097799978 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4134759063292287e-07 +-4.1637512929463936e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247434829778445e+00 +1.7312684368176641e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-7.5149082043131387e-04 +-4.2492304938629710e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247431811555634e+00 +1.7310949308275310e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006136925427511731, h_cfl = 1.551585657173847e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.005891448410411261, h_cfl = 7.757928285869233e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.797050058546112 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.002281919499449541 + 4.069501512093439e-03 1.224743181155563e+00 1.731094930827531e+00 3.276268145668837e-12 1.207456357121828e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.004069501512093439 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001551585657173846 +Current step size = 0.005891448410411261 +Explicit RHS fn evals = 17 +Implicit RHS fn evals = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_0.out new file mode 100644 index 0000000000..a725e5d24f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_0.out @@ -0,0 +1,517 @@ +Start ARKStep Logging test +Using DIRK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.03124727847178982 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.3482114694817062e-10 +-7.6544069683096959e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247448712567679e+00 +1.7320507310248074e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-5.2744855434165435e-06 +-2.9729122414792089e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7159915162563899e-10 +-1.5308420811789943e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1562371643297375 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 4.895203386441746e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.7801963866676182e-10 +-3.8271244855419026e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448707135693e+00 +1.7320504248564286e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.5785446875319835e-05 +-8.9188116306507040e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1966020565906560e-10 +-6.7356743000148608e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09624183453536866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1497525290288219e-10 +-2.3575626677356586e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448709766138e+00 +1.7320505718126105e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.1587149897517827e-05 +-6.5404400699907578e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9203496310720011e-11 +-5.5830416748822856e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.08528677931681904 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.6786739924915098e-10 +-2.0892050479431925e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448710237216e+00 +1.7320505986483723e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0538689897045994e-05 +-5.9458448412770216e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.4124311520652384e-10 +-3.0617235286251100e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499813593647933 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.823414317944671e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0824850889102213e-09 +-6.1234459843085585e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-2.1021934424180757e-05 +-1.1891797717489950e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003796520021120941, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003644659220276104, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.38984244421219 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.257351772282993e-09 + 1.029860256095084e-04 1.224744870309104e+00 1.732050195224279e+00 2.442490654175344e-15 1.998401444325282e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003644659220276104 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001014150830678534 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 43.57700668684354 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.04633595994229208 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1037586989525144e-07 +-1.0665669566797927e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247446599332341e+00 +1.7319435385286108e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-2.3074476451876455e-04 +-1.1705543726043446e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002836480440816586 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.2049301676687675e-07 +-2.1331358934734672e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 209.0149703261905 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2042649292783136 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-9.7014597510064218e-07 +-5.1163040588714660e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247439001631288e+00 +1.7315385648183916e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-6.0258944624920930e-04 +-3.2740202406040253e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002107548596761365 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9808592414894612e-07 +-9.7322488527043608e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 130.3177912362241 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1317639651299175 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.1892168789443219e-07 +-3.1897993011555841e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442513874160e+00 +1.7317312152941633e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-4.6145172520038437e-04 +-2.4326850843144060e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00192531563574756 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6517105235824326e-07 +-8.0726783502178717e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 115.7066352240969 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1179815315332422 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.5508531874120538e-07 +-2.8321292927868202e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247443152237851e+00 +1.7317669822950001e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-4.2756035369781892e-04 +-2.2222805550988206e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003747645245885612 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091040e+00 +1.7320501952242788e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.3532761753850468e-07 +-4.1596377780023664e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 330.9200194658451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.3098605220101286 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.4332734690205068e-06 +-8.1007679688875145e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-7.6498190245061107e-04 +-4.3253817811449907e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00232929919553471, h_cfl = 3.644659220276104e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002236127227713321, h_cfl = 1.822329610138052e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6135353383035691 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.007864906415392474 + 3.747645245885612e-03 1.224743437035635e+00 1.731240118427390e+00 9.108140908153928e-10 5.271953984475886e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003747645245885612, h = 0.002236127227713321 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004306677052813943 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 113.5127839162196 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.06347372373964355 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.9654977891445632e-07 +-2.7782303764351229e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247429404858561e+00 +1.7309622953897466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-8.8802202009468311e-04 +-4.9697190728107943e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005424740666670603 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9286510897135357e-07 +-5.5564620663992091e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 369.9413329159526 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1961628166373034 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.6172337632817263e-06 +-9.0547080473034054e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247418198018716e+00 +1.7303346476226598e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.1162106350751314e-03 +-6.2576901579145128e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.004977515221127939 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7530871438233328e-07 +-3.2186745513632103e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 262.6686572611258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1422666879689584 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1501455808253400e-06 +-6.4289877959560946e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247422868900542e+00 +1.7305972196477943e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.0277950773381820e-03 +-5.7426332462581242e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004865708859742272 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.7935013656236019e-07 +-2.6808251045464616e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 237.752750401516 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.1294572005123361 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0420987047818668e-06 +-5.8191303223959737e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247423949369300e+00 +1.7306582053951505e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0062154830822632e-03 +-5.6138245809715936e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005983772473598933 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434370356349e+00 +1.7312401184273900e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5381140406291581e-06 +-8.6950990000653379e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 512.8615902035506 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2648770776226016 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.2214373400379068e-06 +-1.2553095738561651e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247412155982949e+00 +1.7299848088535339e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-1.2214255933759850e-03 +-6.9012157832719911e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247412155982949e+00 +1.7299848088535339e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.01050274477458537, h_cfl = 2.236127227713321e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01008263498360195, h_cfl = 1.118063613856661e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.50897196664097 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001116850591343922 + 5.983772473598933e-03 1.224741215598295e+00 1.729984808853534e+00 1.411835537368233e-09 7.625806652811207e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.005983772473598933 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002236127227713321 +Current step size = 0.01008263498360196 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_0.out new file mode 100644 index 0000000000..e742186a9e --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_0.out @@ -0,0 +1,703 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.03124727847178982, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.044190325002054, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 8.016227206018892e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 8.016227206018892e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647747457602 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.3481769092357109e-10 +-7.6542107541446623e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247448712567712e+00 +1.7320507310267697e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-5.2744845688476538e-06 +-2.9729122434364007e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7159910144215067e-10 +-1.5308420821868113e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1562371643708069, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2209527167999096, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.008105378087632e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.008105378087632e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331731583946 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.834156785593834e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.7311017409714737e-10 +-3.8271246604140156e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448707184787e+00 +1.7320504248564113e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.5785456702682842e-05 +-8.9188116281787924e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1966013105105124e-10 +-6.7356743078863062e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09624183456739453, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1361065077128771, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.468991359913261e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.468991359913261e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623937258978928 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1496456274914079e-10 +-2.3575023593389748e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448709766244e+00 +1.7320505718186412e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.1587146903331380e-05 +-6.5404400759934778e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9203409452501710e-11 +-5.5830416833676241e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.08528677935133332, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1206137200497772, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.187949946472201e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.187949946472201e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459686493964 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.6785789867628583e-10 +-2.0891515860906222e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448710237310e+00 +1.7320505986537187e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0538687242480638e-05 +-5.9458448466004777e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.4124150489787098e-10 +-3.0617235427863065e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499813599405794, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270295684377, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413027919782981e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413027919782981e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749849628705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534693105165771e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0746283427385906e-09 +-6.1234462760470280e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-2.1021950151815365e-05 +-1.1891797713532633e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003832000015190934, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003678720014583297, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.72057463924165 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.010389402682452e-09 + 1.029860256095084e-04 1.224744870316961e+00 1.732050195224250e+00 7.854161765408207e-12 2.731148640577885e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678720014583297 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022666029255333 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 44.35369875822553, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 62.72560232529324, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.04062175054285926 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.005089991166117e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.005089991166117e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31583324937814 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.393376666599104e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1421796474290096e-07 +-1.0855698511574932e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247446560989959e+00 +1.7319416382391337e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-2.3292829336001299e-04 +-1.1803777623123327e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862026036546981 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.2843898737310469e-07 +-2.1711396494937117e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 212.8147091519881, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 300.9654479552272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1948470890329139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.023368215406643e-17 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.023368215406643e-17 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6569919499078 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.748984444407891e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-9.8779534589461126e-07 +-5.2092913761333452e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247438825216146e+00 +1.7315292660866362e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-6.0824656359804833e-04 +-3.3034873774330420e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126282033630322 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0183575912132512e-07 +-9.9027075632427539e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 132.6733466500091, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 187.6284461978699, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1214861228197153 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.410337134365055e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.410337134365055e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5690472826842 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.141721415834757e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.3026578553169328e-07 +-3.2474393165745323e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442400511750e+00 +1.7317254512925921e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-4.6586194777400747e-04 +-2.4542975298298644e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942346032901157 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6830503897369111e-07 +-8.2140251652316766e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.7961695173268, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.5889405270037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1078639628765014 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.818288520560997e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.818288520560997e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7022409131975 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.14887367151013e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.6530614209119544e-07 +-2.8832586718988384e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247443050108184e+00 +1.7317618693570596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-4.3168497928305151e-04 +-2.2419276107545005e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.003781706040192805 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703169606e+00 +1.7320501952242495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4859427090853822e-07 +-4.2346813415649991e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 336.9671105380513, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 476.5434577965859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3085169077524141 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.17116109814417e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.17116109814417e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.736319034684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.346288867431381e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.4584391541599209e-06 +-8.2487691110435374e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-7.7193685800496415e-04 +-4.3646560336956441e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002326364550388339, h_cfl = 3.678720014583297e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002233309968372805, h_cfl = 1.839360007291648e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.607088867736454 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008163105466437349 + 3.781706040192805e-03 1.224743411877806e+00 1.731225318313145e+00 1.057254284120290e-10 1.072486544018147e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.003781706040192805, h = 0.002233309968372805 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340033532286006 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 114.2475703576066, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 161.5704634679017, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.06347262680418689 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.746714923333988e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.746714923333988e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.2024221826183 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.199113684336701e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.9959120738474801e-07 +-2.7961959870598631e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247429122865992e+00 +1.7309456987144392e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-8.9481077349216355e-04 +-5.0081645163650157e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456688516472409 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9919491012371452e-07 +-5.5923918688244800e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 372.0708229808176, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 526.1876040227913, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.206598731109143 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.060023072317438e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.060023072317438e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.939257112824 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.123782867339571e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.6259695904615053e-06 +-9.1067688658183043e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247417859082159e+00 +1.7303146414265633e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.1227126376804786e-03 +-6.2944717635931957e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010026522797847 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7915792587012851e-07 +-3.2405262093896932e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 264.2522611564104, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 373.7091316151527, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1467632212595206 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.453408637887063e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.453408637887063e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1544278478215 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.142262491733078e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1566608074494443e-06 +-6.4677047347908359e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247422552169991e+00 +1.7305785478396660e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.0344044966321467e-03 +-5.7800813108534710e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898361024379207 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.8255777116728590e-07 +-2.6990384664404745e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 239.1950412070286, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 338.2728713273712, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1328534050683189 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.003480721324008e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.003480721324008e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.1054906887548 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.769091705246994e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0480325020834030e-06 +-5.8543925115564000e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247423638453043e+00 +1.7306398790619895e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0128504292255085e-03 +-5.6514391624051907e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00601501600856561 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434118778064e+00 +1.7312253183131452e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5475051306595572e-06 +-8.7480745506617226e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 515.6509104293493, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 729.2405109792198, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.2862495506617406 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.660035032647116e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.660035032647116e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.479276837567 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 7.67937747240094e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.2328953581312280e-06 +-1.2621283747921829e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247411789824483e+00 +1.7299631899383530e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-1.2278068461039863e-03 +-6.9371627671470348e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247411789824483e+00 +1.7299631899383530e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0105439796544931, h_cfl = 2.233309968372805e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01012222046831338, h_cfl = 1.116654984186403e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.532384940585946 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.001111259275024442 + 6.015016008565610e-03 1.224741178982448e+00 1.729963189938353e+00 2.336992821483364e-10 1.590565457121329e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.00601501600856561 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233309968372805 +Current step size = 0.01012222046831338 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 45 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 25 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 25 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 25 +LS iters per NLS iter = 0.9259259259259259 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_1.out new file mode 100644 index 0000000000..c098acf4d0 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_1_1_1.out @@ -0,0 +1,578 @@ +Start ARKStep Logging test +Using DIRK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 2.57465064023771e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.03124647749568791 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.3579950010291991e-10 +-7.6542104122109757e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247448712557893e+00 +1.7320507310267730e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-5.2744826035395038e-06 +-2.9729122439306394e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 7.723951920713131e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7159900024251293e-10 +-1.5308420824413097e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1562331594653479 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.380843176869396e-08 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.7801910931035622e-10 +-3.8271244899425649e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448707135697e+00 +1.7320504248564281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.5785446876482720e-05 +-8.9188116306499667e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 5.664231408522962e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1966010271374946e-10 +-6.7356743085989097e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09623936755399637 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1798849863265629e-10 +-2.3575021291435974e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448709736004e+00 +1.7320505718186643e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.1587140843698826e-05 +-6.5404400775284973e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9203388001812322e-11 +-5.5830416839101964e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.08528459315580529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.7053762831836956e-10 +-2.0891514005216457e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448710210513e+00 +1.7320505986537371e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0538681873903700e-05 +-5.9458448479587176e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.4124136795295400e-10 +-3.0617235431608137e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749520049542 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0824827371528319e-09 +-6.1234451920229918e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-2.1021934388982939e-05 +-1.1891797717567420e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003832189576692273, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003678901993624582, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 35.72234166578926 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.009107594385155e-09 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224358e+00 2.220446049250313e-16 8.104628079763643e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.003678901993624582 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.001022711524015654 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 44.31728809265712 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.002706685111211134 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1424081012507486e-07 +-1.0856717925573979e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247446560682960e+00 +1.7319416280451021e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-2.3293994847666617e-04 +-1.1804302462967765e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.002862162520827944 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.2848162042280723e-07 +-2.1713435932179835e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 212.6403773707838 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03696205723054138 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-9.8792918648185469e-07 +-5.2097898080482534e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247438823799197e+00 +1.7315292162435532e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-6.0827667407825539e-04 +-3.3036448130988644e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002126382122103028 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0185589112983600e-07 +-9.9036222382275211e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 132.5646009288685 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01706360659869033 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.3034263103465453e-07 +-3.2477483896250104e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442399664752e+00 +1.7317254203853953e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-4.6588546404923348e-04 +-2.4544129999026967e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.001942437022421799 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6832186766517422e-07 +-8.2147836257821262e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.69961092995 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01382292596398069 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.6537378455154328e-07 +-2.8835328550818061e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247443049353217e+00 +1.7317618419388496e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-4.3170698019948990e-04 +-2.2420325802228500e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00378188801923409 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091062e+00 +1.7320501952243579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4866545746777953e-07 +-4.2350840809807916e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 336.69118258825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07750779266514742 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.4586693925950136e-06 +-8.2495620776723664e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-7.7197374255023312e-04 +-4.3648658658737233e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002326349105082655, h_cfl = 3.678901993624582e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002233295140879348, h_cfl = 1.839450996812291e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.6070548073173944 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.008164718360412736 + 3.781888019234090e-03 1.224743411639714e+00 1.731225239016591e+00 8.112177596331094e-12 2.569811030639357e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00378188801923409, h = 0.002233295140879348 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 1, tcur = 0.004340211804453927 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 114.1880202704021 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01832920615797257 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.9961423206822671e-07 +-2.7962920156547524e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_0(:) = +1.2247429120254816e+00 +1.7309456098150251e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-8.9484676352198558e-04 +-5.0083699848527374e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.005456859374893601 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.9922846440263078e-07 +-5.5925841754487973e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 371.8754828183439 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.07514845578796357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.6260847989341616e-06 +-9.1070469314003400e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247417855549145e+00 +1.7303145343234505e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +-1.1227469644861643e-03 +-6.2946684718537382e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.005010200346717731 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7917834218482936e-07 +-3.2406431388396861e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 264.1139062313106 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04898184989809135 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1567305025030118e-06 +-6.4679115787376102e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247422549092111e+00 +1.7305784478587167e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.0344394705485615e-03 +-5.7802815280918118e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004898535589673764 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.8257478595443393e-07 +-2.6991359268352383e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 239.0698529878246 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.04334360894804039 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0480928814649056e-06 +-5.8545809149947788e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247423635468322e+00 +1.7306397809250911e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-1.0128855530277137e-03 +-5.6516402563726797e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.006015183160113438 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247434116397136e+00 +1.7312252390165905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5475549047635512e-06 +-8.7483581751387346e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 515.3793206142866 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.1148530271845262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.2330874006087650e-06 +-1.2621647896432532e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247411785523130e+00 +1.7299630742269472e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +-1.2278403929067386e-03 +-6.9373550809677820e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247411785523130e+00 +1.7299630742269472e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.01054419843231782, h_cfl = 2.233295140879348e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.01012243049502511, h_cfl = 1.116647570439674e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.53250907582213 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.00111123036409299 + 6.015183160113438e-03 1.224741178552313e+00 1.729963074226947e+00 8.796519068710040e-12 8.689449160215190e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.006015183160113438 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.002233295140879348 +Current step size = 0.01012243049502511 +Explicit RHS fn evals = 0 +Implicit RHS fn evals = 44 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_0.out new file mode 100644 index 0000000000..8a8ccdb07f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_0.out @@ -0,0 +1,643 @@ +Start ARKStep Logging test +Using ImEx method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +1.1719990452195032e-16 +8.2872847241886988e-17 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-0.0000000000000000e+00 +-0.0000000000000000e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.0174880921323788e-21 +2.1336862920964629e-21 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +1.9567818777089853e-12 +-3.9379501189115846e-12 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448713935458e+00 +1.7320508075649392e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +7.5995957885092471e-08 +-1.5294593680104785e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.0510967219525537e-05 +-5.9458999098063806e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1975210952189841e-10 +-6.7494192688419586e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.02755359227464431 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1888937217555571e-10 +-6.7495928914961100e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448712726996e+00 +1.7320507400729483e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-1.2758628770424467e-12 +1.0601476785765427e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-6.9792822361780495e-06 +-3.9480780841510609e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1785903213863801e-10 +-2.3538178455265424e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.09609143371919215 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1485028447453718e-10 +-2.3538783954447332e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448709767386e+00 +1.7320505721810378e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-3.7865532081412623e-12 +3.1775317164462653e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.3033599353550797e-05 +-7.3729161894770644e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.8672373011473824e-10 +-4.4240972474176714e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.1806077954736169 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 5.678291534219827e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-7.8672381006516453e-10 +-4.4240972467424570e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448706048651e+00 +1.7320503651591526e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +1.3895574563263699e-11 +-1.1585813651008607e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.7868644269775553e-05 +-1.0108029051474801e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0824834230817177e-09 +-6.1234460279062781e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.2499814051260959 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 7.859528530294883e-06 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0824840288878546e-09 +-6.1234460228425902e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247448703091048e+00 +1.7320501952242748e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +1.8138487523918061e-15 +1.3693468361341544e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.1021934429794637e-05 +-1.1891797717486920e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00668046506668371, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006413246464016361, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.27297758176857 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.827144826036898e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 6.661338147750939e-16 4.440892098500626e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006413246464016361 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +1.4000376029448485e-15 +-6.5848477406779886e-16 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-2.1021934429794623e-05 +-1.1891797717486904e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003309609257617689 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.7409423322087393e-08 +-3.8132514831236419e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 15.98161350203798 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0319537758652567 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +4.0253676971641669e-07 +-3.9081117281501846e-05 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247452728458754e+00 +1.7320111141069958e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +2.9320676648354857e-04 +-5.9173140187880071e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-6.7556970600828200e-04 +-3.8189050521759765e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.00223218385166294 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1233713417060236e-07 +-2.8665807172030961e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.2088497628645 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.2296232565062182 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.1279828986866291e-07 +-2.8665784287708622e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442575108158e+00 +1.7317635373814002e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +4.0020905129513667e-07 +-4.3172168613118595e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-4.5564247071947704e-04 +-2.5770752169946637e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004079198833299652 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.1171472853395593e-06 +-9.5931732875004087e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 392.2454526225389 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.768204971049801 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.00247350314635035 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1153867050673083e-06 +-9.5931848260113551e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247427549224006e+00 +1.7310908767416762e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.0891708649548059e-06 +-7.1474141316535110e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-8.3266210476225309e-04 +-4.7076386800373343e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005554245520023415 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.2557835292753584e-06 +-1.7780698004740464e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 727.0172799128682 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.423068579652633 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.004581420253567278 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.2510131216586284e-06 +-1.7780731104363764e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247406192959840e+00 +1.7302721221138408e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +2.9588271305444701e-06 +-2.0553286085059976e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.1337537260565713e-03 +-6.4068875589511909e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00651623248962587 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091057e+00 +1.7320501952242773e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.3325888282791265e-06 +-2.4491976542600690e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1001.424779946844 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.961856568802519 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.006318952069057399 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.3325858874323891e-06 +-2.4491976073059609e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247405377232183e+00 +1.7296009976169713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +-2.0952203768622859e-08 +4.1866597941691547e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-1.3301156805088615e-03 +-7.5136431075490018e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003805721944057518, h_cfl = 6.413246464016361e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003653493066295217, h_cfl = 3.206623232008181e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5696791924019057 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004005675669815595 + 6.516232489625870e-03 1.224740537689633e+00 1.729601039259757e+00 2.278266464372791e-11 2.184104008762233e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00651623248962587, h = 0.003653493066295218 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00651623248962587 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-6.3639890005590165e-11 +2.0701916773341653e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-1.3301156805453364e-03 +-7.5136429266465743e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008342979022773478 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4297842662484397e-06 +-1.3725521165669826e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 561.6874348987023 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.6264035376264484 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001148411251882187 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.3431082266141650e-06 +-1.3727268289445834e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247381945814064e+00 +1.7282283124308122e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +9.4892484729706785e-05 +-1.9128027522201174e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.7029929894602689e-03 +-9.6102100074242625e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007729192187635882 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7828723429844098e-06 +-9.9576493244616575e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 407.4437320238362 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.45442507084866 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.0008331059917899451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.7827680506127250e-06 +-9.9576507550576572e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247387549215825e+00 +1.7286052741842510e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +1.1118077793629503e-07 +-1.5496930393066578e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-1.5777069189828661e-03 +-8.9071184187214203e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008781398190728904 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.6140567796582825e-06 +-1.9966699167415524e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 816.9903551651699 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.9109014874897468 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.001669947504647432 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.6139303596903754e-06 +-1.9966699143500856e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247369237592733e+00 +1.7276043693454066e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.3239060854035968e-07 +5.9426498165216687e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.7924839940899804e-03 +-1.0113801455831668e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009621701595976804 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.3195173927214688e-06 +-2.8869158617291328e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1181.257906176007 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.316629339620776 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002413704717815864 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.3191329446550348e-06 +-2.8869159661527766e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247352185566884e+00 +1.7267141232936039e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +4.1220992378548160e-07 +-1.0952239208735320e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.9640067895105606e-03 +-1.1075867176952459e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01016972555592109 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247405376896330e+00 +1.7296010392597567e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.2218834026920998e-06 +-3.5110637867083140e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1436.644014581929 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 1.601181087086898 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 3, update-norm = 0.002935513140712882 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.2218663042840858e-06 +-3.5110638068636259e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 3 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247343158233286e+00 +1.7260899754528931e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +8.1388886091025488e-09 +-1.6223289611699112e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.0758686450697539e-03 +-1.1702462187423066e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247343158140704e+00 +1.7260899590246517e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02184793713992066, h_cfl = 3.653493066295218e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.02097401965432383, h_cfl = 1.826746533147609e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.740812771157737 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004151480914860668 + 1.016972555592109e-02 1.224734315814070e+00 1.726089959024652e+00 2.482614114285298e-11 2.127358289527592e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01016972555592109 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003653493066295218 +Current step size = 0.02097401965432383 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 55 +NLS iters = 35 +NLS fails = 0 +NLS iters per step = 11.66666666666667 +LS setups = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_0.out new file mode 100644 index 0000000000..caf1d121a2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_0.out @@ -0,0 +1,829 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +1.1719990452195032e-16 +8.2872847241886988e-17 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-0.0000000000000000e+00 +-0.0000000000000000e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.0174880921323788e-21 +2.1336862920964629e-21 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.964790102879962e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964790102879962e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +1.9567818777089853e-12 +-3.9379501189115846e-12 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448713935458e+00 +1.7320508075649392e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +7.5995957885092471e-08 +-1.5294593680104785e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.0510967219525537e-05 +-5.9458999098063806e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1975210952189841e-10 +-6.7494192688419586e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.02755359227464431, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.03896666388690052, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 7.068684245838184e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 7.068684245838184e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288474442038 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1888631929507176e-10 +-6.7494195732252162e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448712727027e+00 +1.7320507400746814e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +-4.1554001125808017e-13 +-6.7128532330695060e-13 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-6.9792822361780325e-06 +-3.9480780841471110e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1785899233054202e-10 +-2.3538178463242521e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.09609143375169925, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.1358938088395288, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.465154402188027e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.465154402188027e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896628805572 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1483959202180620e-10 +-2.3538179526718011e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448709767494e+00 +1.7320505721870820e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +-7.8618047881146899e-13 +-2.8612864609804735e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.3033599353550682e-05 +-7.3729161894513359e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.8672357084020925e-10 +-4.4240972506109194e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.1806077956037432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.2554179940131215, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 4.633330046263267e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 4.633330046263267e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1806031579260884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.276257185735068e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-7.8104841577091928e-10 +-4.4240974517073731e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448706105406e+00 +1.7320503651591321e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +2.5343909024273787e-12 +-8.7275700794757553e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.7868644269692747e-05 +-1.0108029051474921e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0824828741971454e-09 +-6.1234460332706966e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.2499814053442976, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.3535270937789918, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 6.413182655035927e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 6.413182655035927e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.24997498617904 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.534802522694541e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0746281531744045e-09 +-6.1234463058454406e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247448703169608e+00 +1.7320501952242466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +-1.5724173731640418e-11 +3.9575442718008646e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.1021934429659796e-05 +-1.1891797717487114e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006719923497867133, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006451126557952447, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.64079538726109 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742325031242378e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 4.440892098500626e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451126557952447 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +6.6384528363763395e-16 +-1.3791810515199151e-16 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-2.1021934429794620e-05 +-1.1891797717486906e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328549304585732 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.7807579748720866e-08 +-3.8357746038539260e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 16.08083333497015, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 22.74173259657616, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02645577285028037 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.441887564474575e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.441887564474575e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.0545285272489 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.371604616849797e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +4.1065768731816349e-07 +-3.9323371407767405e-05 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247452809667934e+00 +1.7320108718528691e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +2.9667062070608111e-04 +-5.9873244526994118e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-6.7943579983871115e-04 +-3.8407280040483810e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760042849721 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1994934426902163e-07 +-2.8990047225807558e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 118.5357260444194, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 167.6348313977596, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1903179152662646 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.729212284236706e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.729212284236706e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454261629101 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.939363556579449e-05, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.1927671135393944e-07 +-2.8990121876678747e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442510323947e+00 +1.7317602940055101e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +4.0503847617715441e-07 +-4.3881842166203714e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-4.5820957227463193e-04 +-2.5915896613633821e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102684491540025 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.1442295039687314e-06 +-9.7039827486588637e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 396.7799729589967, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 561.131619036643, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.636716394760145 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.484127247738153e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.484127247738153e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432917940788 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002185148605823037, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1422257539145861e-06 +-9.7039988111651291e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247427280833521e+00 +1.7310797953431603e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.1069231967747766e-06 +-7.2495106824125849e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-8.3745608119651467e-04 +-4.7347121578388540e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586443599869088 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.3121010924227227e-06 +-1.7987358663048027e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 735.4741661021753, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1040.117540476739, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.179209245221302 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.439840890719091e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.439840890719091e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2949033035875 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0007513008267848697, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001062499818661282, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.409470765856917e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.409470765856917e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007490846834053407 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.3072491027471047e-06 +-1.7987392346440424e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247405630600032e+00 +1.7302514559896327e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +3.0093335915916137e-06 +-2.0876521758698387e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.1403261047943261e-03 +-6.4439511607395894e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.006554112583561956 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091059e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.3831261135363656e-06 +-2.4777428984873277e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1013.105862937948, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1432.748051486545, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.625758816210647 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.461866393280248e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.461866393280248e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.480559058974 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001425560608310061, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002016047146256928, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.674392594609514e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 2.674392594609514e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001421355552797087 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.3831632222699693e-06 +-2.4777428320950506e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247404871458836e+00 +1.7295724523921818e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +-2.1352298980168809e-08 +4.2827719783304886e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-1.3378478397965770e-03 +-7.5571963364610406e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003802774042374871, h_cfl = 6.451126557952447e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003650663080679877, h_cfl = 3.225563278976224e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5658954366938629 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100678731752195 + 6.554112583561956e-03 1.224740487151591e+00 1.729572495016884e+00 2.946975996565016e-11 2.206064220189319e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.006554112583561956, h = 0.003650663080679877 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.006554112583561956 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-5.1363737724206097e-11 +2.0587151955196107e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-1.3378478397903419e-03 +-7.5571961502166130e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379444123901894 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4420159050228890e-06 +-1.3794388487647024e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 564.5140709613839, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 798.343455304037, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.5122389740491479 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.025142508879052e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.025142508879052e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0009893185947 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0002506099885822652, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.3552996726137345e-06 +-1.3796136443748139e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247381318519188e+00 +1.7281928813725087e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +9.4739883125846108e-05 +-1.9097334320951703e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.7104362650597550e-03 +-9.6520186315442846e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766132726347675 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7907155448473009e-06 +-1.0002022155517314e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 409.2658290091583, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 578.7892860006197, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.3714280685337064 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.888978519100137e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.888978519100137e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.893774404372 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0001316914393787291, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.7904828517812788e-06 +-1.0002026199724535e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247386966687397e+00 +1.7285722923969111e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +1.1079697157560710e-07 +-1.5478889293047411e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-1.5852472616163448e-03 +-8.9495173747256951e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.00881752369358348 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.6282288795238112e-06 +-2.0047378966247306e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 820.3045390101707, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1160.085804344393, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7440015048060086 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.496786641166685e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.496786641166685e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5592726848695 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0005293932474467006, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.0007486751103678599, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.624757031827298e-07 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 5.624757031827298e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005285091861003915 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.6281093084336706e-06 +-2.0047378909181512e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247368590422829e+00 +1.7275677571259656e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.3162933310600198e-07 +6.8681535194182303e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.7998579389507678e-03 +-1.0155192186229975e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.00965717620213985 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.3383007104567680e-06 +-2.8977367044873393e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1185.704265874136, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1676.839053762838, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.074784364303355 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.722145958622607e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.722145958622607e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.627633160195 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001105910995128215, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.001563994328087847, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.175020868105581e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.175020868105581e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001104064176681669 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.3379273958469437e-06 +-2.8977368036736573e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247351492241956e+00 +1.7266747582132100e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +4.1032510042213582e-07 +-1.0739179444837017e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.9712478454126797e-03 +-1.1116448524878384e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020477566424183 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871515915e+00 +1.7295724950168836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.2442370948396269e-06 +-3.5236069078921021e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1441.799134798569, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2039.011890649931, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.306631795919364 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.979711756780436e-13 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.979711756780436e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490301836212 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.001634877898056415, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002312066496255401, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 1.737042516505863e-06 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, resnorm = 1.737042516505863e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001632147729277761 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.2442313303061256e-06 +-3.5236069245221050e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247342429202612e+00 +1.7260488880923615e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +8.2194805241496819e-09 +-1.6320544347160601e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.0830230328756426e-03 +-1.1742513812974198e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247342429224044e+00 +1.7260488715740170e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02190227878408229, h_cfl = 3.650663080679877e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.021026187632719, h_cfl = 1.825331540339938e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.759553036815223 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138555190661009 + 1.020477566424183e-02 1.224734242922404e+00 1.726048871574017e+00 3.169020601490047e-11 2.147166888732954e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020477566424183 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650663080679877 +Current step size = 0.021026187632719 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 47 +NLS iters = 27 +NLS fails = 0 +NLS iters per step = 9 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 29 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 29 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 29 +LS iters per NLS iter = 1.074074074074074 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_1.out new file mode 100644 index 0000000000..cb0fd631ed --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_arkstep_lvl5_2_1_1.out @@ -0,0 +1,680 @@ +Start ARKStep Logging test +Using ImEx method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +1.1719990452195032e-16 +8.2872847241886988e-17 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-0.0000000000000000e+00 +-0.0000000000000000e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.0174880921323788e-21 +2.1336862920964629e-21 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.964697559380313e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +1.9566304323180198e-12 +-3.9378235455224482e-12 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247448713935456e+00 +1.7320508075649395e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +7.5995958375887289e-08 +-1.5294593714809218e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.0510967219525540e-05 +-5.9458999098063797e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 3.419136050235679e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1975210952471765e-10 +-6.7494192688417588e-08 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.02755288476307282 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.1975207553887908e-10 +-6.7494192717046560e-08 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247448712718370e+00 +1.7320507400746845e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +1.3176459665558473e-12 +-1.1073861384540185e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-6.9792822361829657e-06 +-3.9480780841471040e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 6.385133587789521e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1785891214585049e-10 +-2.3538178465259544e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.09608896636098527 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.1785877672083249e-10 +-2.3538178476552349e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247448709737301e+00 +1.7320505721870925e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +5.2577714137188794e-12 +-4.3814726068795874e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.3033599353582813e-05 +-7.3729161894512917e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 8.753812176808214e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.8672325001637078e-10 +-4.4240972514178470e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.180603158079822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.25245970796259e-13 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-7.8672289230745134e-10 +-4.4240972544004533e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247448706048660e+00 +1.7320503651591517e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +1.3893494183907939e-11 +-1.1584508346205501e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.7868644269775539e-05 +-1.0108029051474806e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0824827392366587e-09 +-6.1234460336101832e-07 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.2499749863599196 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.0824827399689575e-09 +-6.1234460335954617e-07 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247448703091062e+00 +1.7320501952242737e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +-1.3012215100047188e-15 +3.1576701690002997e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.1021934429794617e-05 +-1.1891797717486928e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.006719925951289845, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.006451128913238251, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 62.64081825721642 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.742319852554314e-10 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.006451128913238251 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-2.4264802083724324e-16 +8.8705220966727803e-17 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-2.1021934429794610e-05 +-1.1891797717486906e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.003328550482228634 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.7807604506514678e-08 +-3.8357760042830063e-05 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 16.05452507214864 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.129920641765477e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +4.1065785024887790e-07 +-3.9323385795550430e-05 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247452809669566e+00 +1.7320108718384812e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +2.9667083773838898e-04 +-5.9873288270613230e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-6.7943604022255939e-04 +-3.8407293609244092e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.002244760824804608 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1994981963308827e-07 +-2.8990067442569872e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 118.3454769917176 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.953618323509618e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.1929648654133114e-07 +-2.8990138222312003e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247442510126199e+00 +1.7317602938420538e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +4.0509690656551196e-07 +-4.3886732434035768e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-4.5820973189758177e-04 +-2.5915905637732384e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.004102685951817224 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.1442310271419409e-06 +-9.7039896593374795e-04 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 396.1432178884001 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0002187086232103356 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.1424447466510006e-06 +-9.7040013600155719e-04 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247427278643597e+00 +1.7310797950882753e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.1075769930358795e-06 +-7.2549646736720538e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-8.3745637942210559e-04 +-4.7347138399883171e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.005586445601862022 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.3121031160657201e-06 +-1.7987371559445879e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 734.2942058683061 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007520421592194119 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.3072497202137318e-06 +-1.7987405228745478e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247405630593862e+00 +1.7302514547014023e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +3.0093311825797051e-06 +-2.0876531884634739e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.1403265134450578e-03 +-6.4439534652147978e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.00655411493884776 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247448703091064e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.3831263198340605e-06 +-2.4777446806212061e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1011.478964763825 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001424579352601338 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-4.3831607741131602e-06 +-2.4777446115456883e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247404871483323e+00 +1.7295724506127312e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +-2.1363255745115990e-08 +4.2830034279925051e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-1.3378483205559986e-03 +-7.5571990444177584e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003802779126217027, h_cfl = 6.451128913238251e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003650667961168346, h_cfl = 3.225564456619126e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.5658959866197795 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.004100655316169613 + 6.554114938847760e-03 1.224740487151368e+00 1.729572493235030e+00 2.654254593892347e-11 2.225244433162743e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.00655411493884776, h = 0.003650667961168346 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00655411493884776 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_0(:) = +-5.8177126792407835e-11 +2.0925313035129372e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +-1.3378483205526829e-03 +-7.5571988581837657e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 1, tcur = 0.008379448919431933 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4420200534686225e-06 +-1.3794411871964954e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 564.0014806129656 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0003203746251509396 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-2.3555531812209585e-06 +-1.3796154832950733e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_1(:) = +1.2247381315981865e+00 +1.7281928777517346e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_1(:) = +9.4740878326696616e-05 +-1.9097447425667612e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +-1.7104372442686014e-03 +-9.6520241237757498e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 1, tcur = 0.007766136701955651 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7907189281485339e-06 +-1.0002039927151931e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 408.8942864970894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0001318689853766368 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-1.7906174533382056e-06 +-1.0002041342835040e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_2(:) = +1.2247386965339142e+00 +1.7285722891007460e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_2(:) = +1.1118492442866392e-07 +-1.5511496782376229e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +-1.5852480732880558e-03 +-8.9495219362911327e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 1, tcur = 0.008817529074772134 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.6282356983250378e-06 +-2.0047415814651698e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 819.5599166135717 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0005296666417807359 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-3.6281155710687730e-06 +-2.0047415751940699e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_3(:) = +1.2247368590357965e+00 +1.7275677516598356e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_3(:) = +1.3162222103951659e-07 +6.8711811078490099e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +-1.7998590373553198e-03 +-1.0155198351526731e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 1, tcur = 0.009657182705840853 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.3383116645474833e-06 +-2.8977421540129634e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1184.62805856745 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001106743799152199 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-5.3379371796878708e-06 +-2.8977422520242639e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_4(:) = +1.2247351492141880e+00 +1.7266747509830054e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_4(:) = +4.1031927634032651e-07 +-1.0738999148623674e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +-1.9712491729398287e-03 +-1.1116455964561234e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 5, implicit = 1, tcur = 0.01020478290001611 +[DEBUG][rank 0][arkStep_TakeStep_Z][predictor] zpred(:) = +1.2247404871513676e+00 +1.7295724932350296e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.2442487674651759e-06 +-3.5236136246383004e-03 + +[INFO][rank 0][arkStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1440.490382360151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001636494915150856 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][arkStep_Nls][correction] zcor(:) = +-6.2442412748781892e-06 +-3.5236136395310640e-03 + +[INFO][rank 0][arkStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit stage] z_5(:) = +1.2247342429100927e+00 +1.7260488795954985e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][implicit RHS] Fi_5(:) = +8.2095520908622548e-09 +-1.6317850493869213e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_5(:) = +-2.0830245098250881e-03 +-1.1742522080968119e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247342429104990e+00 +1.7260488630753557e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.02190228634313546, h_cfl = 3.650667961168346e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.02102619488941004, h_cfl = 1.825333980584173e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.759547324780779 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0004138569211494713 + 1.020478290001611e-02 1.224734242910499e+00 1.726048863075356e+00 2.852318381485475e-11 2.167570567479515e-10 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.01020478290001611 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.003650667961168346 +Current step size = 0.02102619488941004 +Explicit RHS fn evals = 20 +Implicit RHS fn evals = 46 +NLS iters = 26 +NLS fails = 0 +NLS iters per step = 8.666666666666666 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.03846153846153846 +Prec evals per NLS iter = 0 +End ARKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_erkstep.cpp b/test/unit_tests/logging/test_logging_arkode_erkstep.cpp new file mode 100644 index 0000000000..6975b4d604 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_erkstep.cpp @@ -0,0 +1,131 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in ERKStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode_erkstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_logger.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start ERKStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + // Create ERKStep memory structure + void* arkode_mem = ERKStepCreate(ode_rhs, zero, y, sunctx); + if (check_ptr(arkode_mem, "ERKStepCreate")) { return 1; } + + flag = ARKodeSetUserData(arkode_mem, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + ARKodeFree(&arkode_mem); + + cout << "End ERKStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_erkstep.out b/test/unit_tests/logging/test_logging_arkode_erkstep.out new file mode 100644 index 0000000000..6b5321f906 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_erkstep.out @@ -0,0 +1,21 @@ +Start ERKStep Logging test + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 + 1.269512694589208e-03 1.224744706901909e+00 1.731957760691857e+00 7.771561172376096e-14 3.164135620181696e-13 + 2.436039363568907e-03 1.224744265725872e+00 1.731708225192427e+00 1.558753126573720e-13 5.899725152858082e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.002436039363568907 +Steps = 3 +Step attempts = 4 +Stability limited steps = 0 +Accuracy limited steps = 4 +Error test fails = 1 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001166526668979699 +Current step size = 0.003648121325513829 +RHS fn evals = 21 +End ERKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_erkstep_lvl3.out b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl3.out new file mode 100644 index 0000000000..9809f9d359 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl3.out @@ -0,0 +1,77 @@ +Start ERKStep Logging test + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 5.14930128047542e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 7.723951920713131e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.008882575353349156 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.004544273702284087 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.004544273702284087 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.008985561378958664 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.006764917540621375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = failed error test, dsm = 2.462475155319869, kflag = 5 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.006764917540621375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.0006862493600993581 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.0006862493600993581 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001269512694589208 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000977881027344283 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007282628719708946 + 1.269512694589208e-03 1.224744706901909e+00 1.731957760691857e+00 7.771561172376096e-14 3.164135620181696e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001269512694589208, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001269512694589208 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001852776029079057 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001852776029079057 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002436039363568907 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002144407696323982 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007283923530119241 + 2.436039363568907e-03 1.224744265725872e+00 1.731708225192427e+00 1.558753126573720e-13 5.899725152858082e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.002436039363568907 +Steps = 3 +Step attempts = 4 +Stability limited steps = 0 +Accuracy limited steps = 4 +Error test fails = 1 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001166526668979699 +Current step size = 0.003648121325513829 +RHS fn evals = 21 +End ERKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_erkstep_lvl4.out b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl4.out new file mode 100644 index 0000000000..a83ad4c0ff --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl4.out @@ -0,0 +1,89 @@ +Start ERKStep Logging test + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 5.14930128047542e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 5.14930128047542e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 7.723951920713131e-05 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.008972298336716318, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.008882575353349156, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 86.25029756007065 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.008882575353349156 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.004544273702284087 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.004544273702284087 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.008985561378958664 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.006764917540621375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001178309766646161, h_cfl = 8.882575353349156e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001166526668979699, h_cfl = 4.441287676674578e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.1313275286248895 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = failed error test, dsm = 2.462475155319869, kflag = 5 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.006764917540621375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.0006862493600993581 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.0006862493600993581 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001269512694589208 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000977881027344283 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001351152074913978, h_cfl = 1.166526668979699e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001166526668979699, h_cfl = 5.832633344898497e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 1 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007282628719708946 + 1.269512694589208e-03 1.224744706901909e+00 1.731957760691857e+00 7.771561172376096e-14 3.164135620181696e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001269512694589208, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001269512694589208 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001852776029079057 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001852776029079057 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002436039363568907 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002144407696323982 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003684971035872554, h_cfl = 1.166526668979699e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003648121325513829, h_cfl = 5.832633344898497e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.127336410323694 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007283923530119241 + 2.436039363568907e-03 1.224744265725872e+00 1.731708225192427e+00 1.558753126573720e-13 5.899725152858082e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.002436039363568907 +Steps = 3 +Step attempts = 4 +Stability limited steps = 0 +Accuracy limited steps = 4 +Error test fails = 1 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001166526668979699 +Current step size = 0.003648121325513829 +RHS fn evals = 21 +End ERKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_erkstep_lvl5.out b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl5.out new file mode 100644 index 0000000000..e84abe1983 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_erkstep_lvl5.out @@ -0,0 +1,201 @@ +Start ERKStep Logging test + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +1.1719990452195032e-16 +8.2872847241886988e-17 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.0434965378977631e-05 +-5.9460528606460573e-03 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 5.14930128047542e-05 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.0586980816170437e-05 +-5.9457480002098806e-03 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0001029860256095084 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-2.1021910950562200e-05 +-1.1891797736938324e-02 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 7.723951920713131e-05 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.5766446427037753e-05 +-8.9188496712662869e-03 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +1.2247448703091062e+00 +1.7320501952242768e+00 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.008972298336716318, h_cfl = 1.029860256095084e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.008882575353349156, h_cfl = 5.14930128047542e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 86.25029756007065 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.419249037637078e-08 + 1.029860256095084e-04 1.224744870309106e+00 1.732050195224277e+00 2.220446049250313e-16 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.008882575353349156 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0001029860256095084 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.2247448703091062e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-2.1021934429493368e-05 +-1.1891797717486953e-02 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.004544273702284087 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-3.6259872019437094e-04 +-5.2515863612937741e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.004544273702284087 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.4993497806597587e-03 +-5.2357042582410707e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.008985561378958664 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.8220070513158568e-03 +-1.0347727011591834e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.006764917540621375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.3786676734203799e-03 +-7.7995401735825853e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +1.2247366288691779e+00 +1.7273955442047693e+00 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001178309766646161, h_cfl = 8.882575353349156e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001166526668979699, h_cfl = 4.441287676674578e+27 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 0.1313275286248895 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = failed error test, dsm = 2.462475155319869, kflag = 5 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.006764917540621375 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.2247448703091062e+00 +1.7320501952242768e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-2.1021934429493368e-05 +-1.1891797717486953e-02 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.0006862493600993581 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.3032904192622404e-04 +-7.9258731610232086e-02 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.0006862493600993581 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.4984787087207163e-04 +-7.9221268462670358e-02 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001269512694589208 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-2.5910496725266611e-04 +-1.4658284865381860e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000977881027344283 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9960290761018702e-04 +-1.1291238030246764e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +1.2247447069019091e+00 +1.7319577606918570e+00 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001351152074913978, h_cfl = 1.166526668979699e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001166526668979699, h_cfl = 5.832633344898497e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 1 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007282628719708946 + 1.269512694589208e-03 1.224744706901909e+00 1.731957760691857e+00 7.771561172376096e-14 3.164135620181696e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001269512694589208, h = 0.001166526668979699 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001269512694589208 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.2247447069019091e+00 +1.7319577606918570e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-2.5913815852688147e-04 +-1.4658282390787855e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001852776029079057 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-3.6844720918717511e-04 +-2.1393286069092612e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001852776029079057 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-3.8796112051977795e-04 +-2.1389846191129469e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002436039363568907 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-4.9722280946114911e-04 +-2.8123397151515173e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002144407696323982 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-4.3771935210554133e-04 +-2.4757691908584015e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +1.2247442657258725e+00 +1.7317082251924272e+00 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003684971035872554, h_cfl = 1.166526668979699e+27 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003648121325513829, h_cfl = 5.832633344898497e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.127336410323694 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0007283923530119241 + 2.436039363568907e-03 1.224744265725872e+00 1.731708225192427e+00 1.558753126573720e-13 5.899725152858082e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.002436039363568907 +Steps = 3 +Step attempts = 4 +Stability limited steps = 0 +Accuracy limited steps = 4 +Error test fails = 1 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.001166526668979699 +Current step size = 0.003648121325513829 +RHS fn evals = 21 +End ERKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_forcingstep.cpp b/test/unit_tests/logging/test_logging_arkode_forcingstep.cpp new file mode 100644 index 0000000000..e961e5e434 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_forcingstep.cpp @@ -0,0 +1,162 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in ForcingStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators and vectors +#include "arkode/arkode_erkstep.h" +#include "arkode/arkode_forcingstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_logger.h" + +#include "problems/estep.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::estep; + +int main(int argc, char* argv[]) +{ + cout << "Start ForcingStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Step sizes: overall, partition 1, partition 2 + sunrealtype dt = SUN_RCONST(0.001); + sunrealtype dt_1 = dt / 2; + sunrealtype dt_2 = dt / 4; + + // Create initial condition + N_Vector y = N_VNew_Serial(1, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + flag = initial_condition(y); + if (check_flag(flag, "initial_condition")) { return 1; } + + // Create partition 1 integrator + void* stepper_1 = ERKStepCreate(ode_rhs_1, zero, y, sunctx); + if (check_ptr(stepper_1, "ERKStepCreate")) { return 1; } + + flag = ARKodeSetUserData(stepper_1, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + flag = ARKodeSetFixedStep(stepper_1, dt_1); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // Create partition 1 integrator + void* stepper_2 = ERKStepCreate(ode_rhs_2, zero, y, sunctx); + if (check_ptr(stepper_2, "ERKStepCreate")) { return 1; } + + flag = ARKodeSetFixedStep(stepper_2, dt_2); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // Create the overall integrator + SUNStepper steppers[2]; + + flag = ARKodeCreateSUNStepper(stepper_1, &steppers[0]); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + flag = ARKodeCreateSUNStepper(stepper_2, &steppers[1]); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + void* arkode_mem = ForcingStepCreate(steppers[0], steppers[1], zero, y, sunctx); + if (check_ptr(arkode_mem, "ForcingStepCreate")) { return 1; } + + flag = ARKodeSetFixedStep(arkode_mem, dt); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // True solution vector + N_Vector yt = N_VClone(y); + + flag = true_solution(zero, problem_data, yt); + if (check_flag(flag, "true_solution")) { return 1; } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + const int width = numeric_limits<sunrealtype>::digits10 + 8; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << setw(width) << " t"; + cout << setw(width) << " y"; + cout << setw(width) << " y err" << endl; + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yt_data = N_VGetArrayPointer(yt); + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - yt_data[0]) << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { return 1; } + + flag = true_solution(tret, problem_data, yt); + if (check_flag(flag, "true_solution")) { return 1; } + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - yt_data[0]) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + N_VDestroy(yt); + ARKodeFree(&arkode_mem); + ARKodeFree(&stepper_1); + ARKodeFree(&stepper_2); + SUNStepper_Destroy(&steppers[0]); + SUNStepper_Destroy(&steppers[1]); + + cout << "End ForcingStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_forcingstep.out b/test/unit_tests/logging/test_logging_arkode_forcingstep.out new file mode 100644 index 0000000000..58be05868b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_forcingstep.out @@ -0,0 +1,22 @@ +Start ForcingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 9.990010003330001e-01 9.999996670728706e-07 + 2.000000000000000e-03 9.980020006646669e-01 1.997998004599211e-06 + 3.000000000000000e-03 9.970030029929939e-01 2.993993026279007e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End ForcingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl3.out b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl3.out new file mode 100644 index 0000000000..5f36995dc7 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl3.out @@ -0,0 +1,292 @@ +Start ForcingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.990010003330001e-01 9.999996670728706e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.980020006646669e-01 1.997998004599211e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.970030029929939e-01 2.993993026279007e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End ForcingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl4.out b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl4.out new file mode 100644 index 0000000000..5f36995dc7 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl4.out @@ -0,0 +1,292 @@ +Start ForcingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.990010003330001e-01 9.999996670728706e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.980020006646669e-01 1.997998004599211e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.970030029929939e-01 2.993993026279007e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End ForcingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl5.out b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl5.out new file mode 100644 index 0000000000..0cc07e9b6a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_forcingstep_lvl5.out @@ -0,0 +1,706 @@ +Start ForcingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.0000000000000000e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-2.0000000000000000e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9990000000000001e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9990005000000000e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9980009995000001e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9985005623281094e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9900049983337502e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9900049983337502e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9980009996667500e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9970019991669166e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9970024986671666e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9960039971680830e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9965030606830623e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9800199866733308e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9800199866733308e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[DEBUG][rank 0][forcingStep_TakeStep][forcing] forcing(:) = +-1.9980013326669210e+00 + +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.0000000000000000e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9975051522943725e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9975045286602637e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9950093684165087e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9962571435044589e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9975043728654289e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9975043728654289e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9950093685463370e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9925138963097027e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9925132726752142e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9900174882116322e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9912655753706747e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9950074979168746e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9950074979168746e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9900174883414539e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9875213921962747e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9875207685617162e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9850243605013178e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9862727594198053e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9925093748423055e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9925093748423055e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9850243606311362e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9825276412009678e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9825270175666514e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9800299865335362e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9812786968992684e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9900100033300010e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9900100033300010e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[DEBUG][rank 0][forcingStep_TakeStep][current state] y_cur(:) = +9.9900100033300010e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.990010003330001e-01 9.999996670728706e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9900100033300010e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9980020006660002e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9970029996656673e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9970034991661674e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9960049971668341e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9965040609318445e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9800249866670876e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9800249866670876e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9960049973334175e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9950069948347509e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9950074938360001e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9940099898395816e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9945085547902757e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9700499500299922e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9700499500299922e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[DEBUG][rank 0][forcingStep_TakeStep][forcing] forcing(:) = +-1.9960053300008829e+00 + +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9900100033300010e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9800299866633491e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9775376289713569e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9775370065821412e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9750443375983089e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9762908665892802e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9875143743214723e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9875143743214723e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9750443377278031e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9725513579962222e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9725507356072474e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9700574448953228e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9713042847113253e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9850174987452123e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9850174987452123e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9700574450248092e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9675638438767267e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9675632214883070e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9650693096719167e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9663164600009913e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9825193762904363e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9825193762904363e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9650693098013998e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9625750878609920e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9625744654734361e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9600799331773038e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9613273937069435e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9800200066466693e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9800200066466693e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[DEBUG][rank 0][forcingStep_TakeStep][current state] y_cur(:) = +9.9800200066466693e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.980020006646669e-01 1.997998004599211e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 0 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9800200066466693e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9960040013293339e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9950059993286693e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9950064983296696e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9940089948310042e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9945075595329151e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9700449749871056e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9700449749871056e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9940089949974211e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9930119904999224e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9930124890021712e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9920159825084189e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9925140488948272e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9600799133733475e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9600799133733475e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[INFO][rank 0][forcingStep_TakeStep][begin-partition] partition = 1 +[DEBUG][rank 0][forcingStep_TakeStep][forcing] forcing(:) = +-1.9940093273321802e+00 + +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9800200066466693e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9600799333067791e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9575900706128206e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9575894494684947e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9550992767277469e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9563445571303111e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9775243807554304e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9775243807554304e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9550992768569035e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9526087946122810e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9526081734688199e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9501173814892097e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9513629714719976e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9750275095452046e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9750275095452046e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9501173816183608e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9476262804467785e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9476256593044876e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9451342487102634e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9463801479610059e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9725293927064507e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9725293927064507e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9451342488394090e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9426425293656551e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9426419082248474e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9401498796413412e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9413960878472252e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9700300299299394e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][forcingStep_TakeStep][partition state] y_par(:) = +9.9700300299299394e-01 + +[INFO][rank 0][forcingStep_TakeStep][end-partition] status = success +[DEBUG][rank 0][forcingStep_TakeStep][current state] y_cur(:) = +9.9700300299299394e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.970030029929939e-01 2.993993026279007e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End ForcingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep.cpp b/test/unit_tests/logging/test_logging_arkode_lsrkstep.cpp new file mode 100644 index 0000000000..6d30f401aa --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep.cpp @@ -0,0 +1,164 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in LSRKStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode_lsrkstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_logger.h" + +#include "problems/prv.hpp" +#include "sundials/sundials_nvector.h" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::prv; + +int main(int argc, char* argv[]) +{ + cout << "Start LSRKStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use RKC (0), RKL (1), SSPs2 (2), SSPs3 (3), SSP43 (4), SSP104 (5) + int method = 0; + if (argc > 1) { method = stoi(argv[1]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(1, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + N_VConst(true_solution(zero), y); + + // Create LSRKStep memory structure + void* arkode_mem = nullptr; + if (method < 2) { arkode_mem = LSRKStepCreateSTS(ode_rhs, zero, y, sunctx); } + else { arkode_mem = LSRKStepCreateSSP(ode_rhs, zero, y, sunctx); } + if (check_ptr(arkode_mem, "LSRKStepCreate")) { return 1; } + + // Select method + if (method == 0) + { + flag = LSRKStepSetSTSMethodByName(arkode_mem, "ARKODE_LSRK_RKC_2"); + } + else if (method == 1) + { + flag = LSRKStepSetSTSMethodByName(arkode_mem, "ARKODE_LSRK_RKL_2"); + } + else if (method == 2) + { + flag = LSRKStepSetSSPMethodByName(arkode_mem, "ARKODE_LSRK_SSP_S_2"); + } + else if (method == 3) + { + flag = LSRKStepSetSSPMethodByName(arkode_mem, "ARKODE_LSRK_SSP_S_3"); + } + else if (method == 4) + { + flag = LSRKStepSetSSPMethodByName(arkode_mem, "ARKODE_LSRK_SSP_S_3"); + if (flag == 0) { flag = LSRKStepSetNumSSPStages(arkode_mem, 4); } + } + else if (method == 5) + { + flag = LSRKStepSetSSPMethodByName(arkode_mem, "ARKODE_LSRK_SSP_10_4"); + } + else + { + cerr << "Invalid method option\n"; + return 1; + } + if (check_flag(flag, "LSRKStepSetMethodByName")) { return 1; } + + flag = ARKodeSetUserData(arkode_mem, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + // Specify dominant eigenvalue function + flag = LSRKStepSetDomEigFn(arkode_mem, ode_dom_eig); + if (check_flag(flag, "LSRKStepSetDomEigFn")) { return 1; } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + const int width = numeric_limits<sunrealtype>::digits10 + 8; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << setw(width) << " t"; + cout << setw(width) << " y"; + cout << setw(width) << " y err" << endl; + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + sunrealtype* y_data = N_VGetArrayPointer(y); + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - true_solution(tret)) << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { return 1; } + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - true_solution(tret)) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + ARKodeFree(&arkode_mem); + + cout << "End LSRKStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_0.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_0.out new file mode 100644 index 0000000000..8dc65c67c2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_0.out @@ -0,0 +1,26 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515624999988e-12 1.211690350419474e-26 + 4.660370515962586e-09 4.660370515962578e-09 7.444625512977249e-24 + 9.774571052271429e-08 9.774571052271400e-08 2.646977960169689e-23 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_1.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_1.out new file mode 100644 index 0000000000..0650f64394 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_1.out @@ -0,0 +1,26 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 + 4.660370515962586e-09 4.660370515962586e-09 0.000000000000000e+00 + 9.774571052271429e-08 9.774571052271410e-08 1.323488980084844e-22 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_2.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_2.out new file mode 100644 index 0000000000..251e0400fc --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_2.out @@ -0,0 +1,22 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 + 6.104125976562500e-08 6.104125976562493e-08 0.000000000000000e+00 + 1.281744384765625e-06 1.281744384764889e-06 3.388131789017201e-20 +--------------------------------------------------------------------- +Current time = 1.281744384765625e-06 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 1.220703125e-06 +Current step size = 2.44140625e-05 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_3.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_3.out new file mode 100644 index 0000000000..75a8baee69 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_3.out @@ -0,0 +1,22 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 + 4.660370515962586e-09 4.660370515962586e-09 8.271806125530277e-25 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 29 +Number of stages used = 9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_4.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_4.out new file mode 100644 index 0000000000..a1709cf38a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_4.out @@ -0,0 +1,22 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 + 4.660370515962586e-09 4.660370515962585e-09 8.271806125530277e-25 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 14 +Number of stages used = 4 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_5.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_5.out new file mode 100644 index 0000000000..74c20b7c01 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_5.out @@ -0,0 +1,22 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.103515625000001e-12 6.103515625000001e-12 8.077935669463161e-28 + 5.086597062056021e-10 5.086597062056018e-10 3.101927297073854e-25 + 8.765030586579745e-09 8.765030586579742e-09 3.308722450212111e-24 +--------------------------------------------------------------------- +Current time = 8.765030586579745e-09 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 8.256370880374143e-09 +Current step size = 1.651274176074829e-07 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_0.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_0.out new file mode 100644 index 0000000000..54b2ab6b3a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_0.out @@ -0,0 +1,59 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.469364872685183e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 6.103515624999991e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.693522803355793e-17 + 6.103515625000001e-12 6.103515624999988e-12 1.211690350419474e-26 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.126575200891454e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 4.660370515962578e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.790263934461531e-14 + 4.660370515962586e-09 4.660370515962578e-09 7.444625512977249e-24 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 2.706980422129166e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 9.774571052271414e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.323427303468993e-12 + 9.774571052271429e-08 9.774571052271400e-08 2.646977960169689e-23 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_1.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_1.out new file mode 100644 index 0000000000..6ca12deadc --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_1.out @@ -0,0 +1,59 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 1.557525849070862e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962586e-09 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 3.568881718487982e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.117483685550389e-12 + 9.774571052271429e-08 9.774571052271410e-08 1.323488980084844e-22 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_2.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_2.out new file mode 100644 index 0000000000..0dc19f2db5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_2.out @@ -0,0 +1,94 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.781684027777778e-13 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356336805555556e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.712673611111111e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.390842013888889e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747178819444445e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425347222222223e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.103515625e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 6.103515625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.787787543402777e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356947157118055e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.035115559895833e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.713283962673611e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.391452365451389e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069620768229166e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747789171006944e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425957573784722e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.104125976562500e-08 6.104125976562493e-08 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 6.1041259765625e-08, h = 1.220703125e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 1.966749403211805e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 3.323086208767361e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 4.679423014322917e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 6.035759819878472e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 7.392096625434028e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 8.748433430989583e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 1.010477023654514e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 1.146110704210069e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 1.281744384765625e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 1.281744384765625e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.010476029833067e-10 + 1.281744384765625e-06 1.281744384764889e-06 3.388131789017201e-20 +--------------------------------------------------------------------- +Current time = 1.281744384765625e-06 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 1.220703125e-06 +Current step size = 2.44140625e-05 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_3.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_3.out new file mode 100644 index 0000000000..49b45760a2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_3.out @@ -0,0 +1,94 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 7.818146823479309e-10 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 1.557525849070862e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 3.108948182516724e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 3.884659349239654e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 3.108948182516724e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 3.884659349239654e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.271805620659329e-15 + 4.660370515962586e-09 4.660370515962586e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 2.01745938504212e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 3.568881718487982e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 6.671726385379705e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 8.223148718825566e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 6.671726385379705e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 8.223148718825566e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 29 +Number of stages used = 9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_4.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_4.out new file mode 100644 index 0000000000..c2a4c7ea99 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_4.out @@ -0,0 +1,58 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962585e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 14 +Number of stages used = 4 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_5.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_5.out new file mode 100644 index 0000000000..87dad7e353 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl3_5.out @@ -0,0 +1,94 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 5.025561905806021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 8.986288072176701e-11 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 1.73622245818534e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 2.57381610915301e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 3.41140976012068e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 4.24900341108835e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 1.73622245818534e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 2.57381610915301e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 3.41140976012068e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 4.24900341108835e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 5.086597062056021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.067951405164832e-15 + 5.086597062056021e-10 5.086597062056018e-10 3.101927297073854e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 5.086597062056021e-10, h = 8.256370880374143e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 5.086597062056021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.884721519601293e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 3.260783332996983e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 4.636845146392673e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 6.012906959788364e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 7.388968773184054e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 3.260783332996983e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 4.636845146392673e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 6.012906959788364e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 7.388968773184054e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 8.765030586579745e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.308705620159824e-14 + 8.765030586579745e-09 8.765030586579742e-09 3.308722450212111e-24 +--------------------------------------------------------------------- +Current time = 8.765030586579745e-09 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 8.256370880374143e-09 +Current step size = 1.651274176074829e-07 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_0.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_0.out new file mode 100644 index 0000000000..3c3d91cb4b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_0.out @@ -0,0 +1,68 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.469364872685183e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 6.103515624999991e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.693522803355793e-17 + 6.103515625000001e-12 6.103515624999988e-12 1.211690350419474e-26 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.126575200891454e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 4.660370515962578e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.790263934461531e-14 + 4.660370515962586e-09 4.660370515962578e-09 7.444625512977249e-24 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 2.706980422129166e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 9.774571052271414e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.323427303468993e-12 + 9.774571052271429e-08 9.774571052271400e-08 2.646977960169689e-23 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_1.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_1.out new file mode 100644 index 0000000000..2e8d948b0f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_1.out @@ -0,0 +1,68 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 1.557525849070862e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962586e-09 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 3.568881718487982e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.117483685550389e-12 + 9.774571052271429e-08 9.774571052271410e-08 1.323488980084844e-22 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_2.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_2.out new file mode 100644 index 0000000000..498d5adb70 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_2.out @@ -0,0 +1,103 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.781684027777778e-13 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356336805555556e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.712673611111111e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.390842013888889e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747178819444445e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425347222222223e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.103515625e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.851058010743364e-06, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 6.103515625e-08, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 10000 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 6.103515625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.787787543402777e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356947157118055e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.035115559895833e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.713283962673611e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.391452365451389e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069620768229166e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747789171006944e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425957573784722e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.000305900411149458, h_cfl = 6.103515625e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.220703125e-06, h_cfl = 3.0517578125e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.104125976562500e-08 6.104125976562493e-08 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 6.1041259765625e-08, h = 1.220703125e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 1.966749403211805e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 3.323086208767361e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 4.679423014322917e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 6.035759819878472e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 7.392096625434028e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 8.748433430989583e-07 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 1.010477023654514e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 1.146110704210069e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 1.281744384765625e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 1.281744384765625e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.03225252825599285, h_cfl = 1.220703125e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.44140625e-05, h_cfl = 6.103515625e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.010476029833067e-10 + 1.281744384765625e-06 1.281744384764889e-06 3.388131789017201e-20 +--------------------------------------------------------------------- +Current time = 1.281744384765625e-06 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 1.220703125e-06 +Current step size = 2.44140625e-05 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_3.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_3.out new file mode 100644 index 0000000000..9b27cd9b66 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_3.out @@ -0,0 +1,103 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 7.818146823479309e-10 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 1.557525849070862e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 3.108948182516724e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 3.884659349239654e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 3.108948182516724e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 3.884659349239654e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.271805620659329e-15 + 4.660370515962586e-09 4.660370515962586e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 2.01745938504212e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 3.568881718487982e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 6.671726385379705e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 8.223148718825566e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 6.671726385379705e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 8.223148718825566e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 29 +Number of stages used = 9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_4.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_4.out new file mode 100644 index 0000000000..b66e0af18f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_4.out @@ -0,0 +1,67 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962585e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 14 +Number of stages used = 4 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_5.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_5.out new file mode 100644 index 0000000000..eb0354adac --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl4_5.out @@ -0,0 +1,103 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 2.034505208333333e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 3.0517578125e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 4.069010416666667e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 5.234960318547938e-10, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 5.025561905806021e-10, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 5.025561905806021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 8.986288072176701e-11 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 1.73622245818534e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 2.57381610915301e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 3.41140976012068e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 4.24900341108835e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 1.73622245818534e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 2.57381610915301e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 3.41140976012068e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 4.24900341108835e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 5.086597062056021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.600386333723065e-09, h_cfl = 5.02556190580602e+20 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 8.256370880374143e-09, h_cfl = 2.51278095290301e+20 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.067951405164832e-15 + 5.086597062056021e-10 5.086597062056018e-10 3.101927297073854e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 5.086597062056021e-10, h = 8.256370880374143e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 5.086597062056021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.884721519601293e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 3.260783332996983e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 4.636845146392673e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 6.012906959788364e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 7.388968773184054e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 3.260783332996983e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 4.636845146392673e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 6.012906959788364e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 7.388968773184054e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 8.765030586579745e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.04407858682386e-07, h_cfl = 8.256370880374143e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.651274176074829e-07, h_cfl = 4.128185440187071e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.308705620159824e-14 + 8.765030586579745e-09 8.765030586579742e-09 3.308722450212111e-24 +--------------------------------------------------------------------- +Current time = 8.765030586579745e-09 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 8.256370880374143e-09 +Current step size = 1.651274176074829e-07 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_0.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_0.out new file mode 100644 index 0000000000..75a1bf0e48 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_0.out @@ -0,0 +1,113 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.469364872685183e-12 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 6.103515624999991e-12 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKC][updated solution] ycur(:) = +6.1035156249999884e-12 + +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKC][solution RHS] F_n(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.693522803355793e-17 + 6.103515625000001e-12 6.103515624999988e-12 1.211690350419474e-26 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage] z_0(:) = +6.1035156249999884e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 1.126575200891454e-09 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 4.660370515962578e-09 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKC][updated solution] ycur(:) = +4.6603705159625781e-09 + +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKC][solution RHS] F_n(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.790263934461531e-14 + 4.660370515962586e-09 4.660370515962578e-09 7.444625512977249e-24 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage] z_0(:) = +4.6603705159625781e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 1, tcur = 2.706980422129166e-08 +[DEBUG][rank 0][lsrkStep_TakeStepRKC][stage RHS] F_1(:) = +9.9999999999999933e-01 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-stage] stage = 2, tcur = 9.774571052271414e-08 +[INFO][rank 0][lsrkStep_TakeStepRKC][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKC][updated solution] ycur(:) = +9.7745710522713998e-08 + +[INFO][rank 0][lsrkStep_TakeStepRKC][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKC][solution RHS] F_n(:) = +9.9999999999999045e-01 + +[INFO][rank 0][lsrkStep_TakeStepRKC][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.323427303468993e-12 + 9.774571052271429e-08 9.774571052271400e-08 2.646977960169689e-23 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_1.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_1.out new file mode 100644 index 0000000000..e40daa9a00 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_1.out @@ -0,0 +1,113 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 2.034505208333333e-12 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKL][updated solution] ycur(:) = +6.1035156250000005e-12 + +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKL][solution RHS] F_n(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage] z_0(:) = +6.1035156250000005e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 1.557525849070862e-09 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKL][updated solution] ycur(:) = +4.6603705159625856e-09 + +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKL][solution RHS] F_n(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962586e-09 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][compute-num-stages] spectral radius = 999.9, num stages = 2, max stages = 2, max stage limit = 200 +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage] z_0(:) = +4.6603705159625856e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 1, tcur = 3.568881718487982e-08 +[DEBUG][rank 0][lsrkStep_TakeStepRKL][stage RHS] F_1(:) = +9.9999999999999867e-01 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepRKL][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepRKL][updated solution] ycur(:) = +9.7745710522714104e-08 + +[INFO][rank 0][lsrkStep_TakeStepRKL][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepRKL][solution RHS] F_n(:) = +9.9999999999999045e-01 + +[INFO][rank 0][lsrkStep_TakeStepRKL][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.117483685550389e-12 + 9.774571052271429e-08 9.774571052271410e-08 1.323488980084844e-22 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 9 +Number of dom_eig updates = 1 +Max. num. of stages used = 2 +Max. num. of stages allowed = 200 +Max. spectral radius = 999.9 +Min. spectral radius = 999.9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_2.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_2.out new file mode 100644 index 0000000000..9525638cb7 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_2.out @@ -0,0 +1,220 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.781684027777778e-13 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356336805555556e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.034505208333333e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.712673611111111e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.390842013888889e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_5(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069010416666667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747178819444445e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425347222222223e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.103515625e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_9(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][updated solution] ycur(:) = +6.1035156249999997e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][embedded solution] y_embedded(:) = +6.1035156250000005e-12 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.851058010743364e-06, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 6.103515625e-08, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 10000 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 6.103515625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage] z_0(:) = +6.1035156249999997e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 6.787787543402777e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 1.356947157118055e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_2(:) = +9.9999999999999978e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 2.035115559895833e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_3(:) = +9.9999999999999956e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 2.713283962673611e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_4(:) = +9.9999999999999933e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 3.391452365451389e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_5(:) = +9.9999999999999889e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 4.069620768229166e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_6(:) = +9.9999999999999845e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 4.747789171006944e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_7(:) = +9.9999999999999778e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 5.425957573784722e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_8(:) = +9.9999999999999711e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 6.1041259765625e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_9(:) = +9.9999999999999623e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 6.1041259765625e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][updated solution] ycur(:) = +6.1041259765624925e-08 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][embedded solution] y_embedded(:) = +6.1041259765624925e-08 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.000305900411149458, h_cfl = 6.103515625e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.220703125e-06, h_cfl = 3.0517578125e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.104125976562500e-08 6.104125976562493e-08 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 6.1041259765625e-08, h = 1.220703125e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 0, tcur = 6.1041259765625e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage] z_0(:) = +6.1041259765624925e-08 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_0(:) = +9.9999999999999623e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 1, tcur = 1.966749403211805e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_1(:) = +9.9999999999996136e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 2, tcur = 3.323086208767361e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_2(:) = +9.9999999999988964e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 3, tcur = 4.679423014322917e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_3(:) = +9.9999999999978106e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 4, tcur = 6.035759819878472e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_4(:) = +9.9999999999963562e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 5, tcur = 7.392096625434028e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_5(:) = +9.9999999999945355e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 6, tcur = 8.748433430989583e-07 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_6(:) = +9.9999999999923461e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 7, tcur = 1.010477023654514e-06 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_7(:) = +9.9999999999897893e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 8, tcur = 1.146110704210069e-06 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_8(:) = +9.9999999999868627e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 9, tcur = 1.281744384765625e-06 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][stage RHS] F_9(:) = +9.9999999999835698e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs2][begin-stage] stage = 10, tcur = 1.281744384765625e-06 +[INFO][rank 0][lsrkStep_TakeStepSSPs2][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][updated solution] ycur(:) = +1.2817443847648892e-06 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs2][embedded solution] y_embedded(:) = +1.2817443847649093e-06 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.03225252825599285, h_cfl = 1.220703125e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.44140625e-05, h_cfl = 6.103515625e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.010476029833067e-10 + 1.281744384765625e-06 1.281744384764889e-06 3.388131789017201e-20 +--------------------------------------------------------------------- +Current time = 1.281744384765625e-06 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 1.220703125e-06 +Current step size = 2.44140625e-05 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_3.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_3.out new file mode 100644 index 0000000000..2953970c43 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_3.out @@ -0,0 +1,211 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_5(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 4.069010416666667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 5.086263020833334e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][updated solution] ycur(:) = +6.1035156250000005e-12 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][embedded solution] y_embedded(:) = +6.1035156250000005e-12 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage] z_0(:) = +6.1035156250000005e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 7.818146823479309e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 1.557525849070862e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 3.108948182516724e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 3.884659349239654e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_5(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 2.333237015793793e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 3.108948182516724e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 3.884659349239654e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][updated solution] ycur(:) = +4.6603705159625864e-09 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][embedded solution] y_embedded(:) = +4.6603705159625856e-09 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.271805620659329e-15 + 4.660370515962586e-09 4.660370515962586e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage] z_0(:) = +4.6603705159625864e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 1, tcur = 2.01745938504212e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_1(:) = +9.9999999999999956e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 2, tcur = 3.568881718487982e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_2(:) = +9.9999999999999867e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_3(:) = +9.9999999999999734e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 4, tcur = 6.671726385379705e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_4(:) = +9.9999999999999556e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 5, tcur = 8.223148718825566e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_5(:) = +9.9999999999999334e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 6, tcur = 5.120304051933844e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_6(:) = +9.9999999999999734e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 7, tcur = 6.671726385379705e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_7(:) = +9.9999999999999556e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 8, tcur = 8.223148718825566e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][stage RHS] F_8(:) = +9.9999999999999334e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-stage] stage = 9, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][updated solution] ycur(:) = +9.7745710522713972e-08 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][begin-compute-embedding] +[DEBUG][rank 0][lsrkStep_TakeStepSSPs3][embedded solution] y_embedded(:) = +9.7745710522713998e-08 + +[INFO][rank 0][lsrkStep_TakeStepSSPs3][end-compute-embedding] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 29 +Number of stages used = 9 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_4.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_4.out new file mode 100644 index 0000000000..fe4195ba8c --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_4.out @@ -0,0 +1,130 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][updated solution] ycur(:) = +6.1035156249999997e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][embedded solution] y_embedded(:) = +6.1035156250000005e-12 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 4.848194792018318e-09, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 4.654267000337585e-09, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 762.5551053353099 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.077935669463161e-18 + 6.103515625000001e-12 6.103515625000000e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 4.654267000337585e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage] z_0(:) = +6.1035156249999997e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 2.333237015793793e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 4.660370515962586e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 2.333237015793793e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 4.660370515962586e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][updated solution] ycur(:) = +4.6603705159625847e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][embedded solution] y_embedded(:) = +4.6603705159625847e-09 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.2949687022872e-07, h_cfl = 4.654267000337585e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.30853400067517e-08, h_cfl = 2.327133500168793e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 4.660370515962586e-09 4.660370515962585e-09 8.271806125530277e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 4.660370515962586e-09, h = 9.30853400067517e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 0, tcur = 4.660370515962586e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage] z_0(:) = +4.6603705159625847e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 1, tcur = 5.120304051933844e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_1(:) = +9.9999999999999734e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 2, tcur = 9.774571052271429e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_2(:) = +9.9999999999999045e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 3, tcur = 5.120304051933844e-08 +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][stage RHS] F_3(:) = +9.9999999999999734e-01 + +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP43][begin-stage] stage = 4, tcur = 9.774571052271429e-08 +[INFO][rank 0][lsrkStep_TakeStepSSP43][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][updated solution] ycur(:) = +9.7745710522713972e-08 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP43][embedded solution] y_embedded(:) = +9.7745710522713945e-08 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.083921183639362e-05, h_cfl = 9.308534000675171e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.861706800135034e-06, h_cfl = 4.654267000337585e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.646854606937986e-13 + 9.774571052271429e-08 9.774571052271397e-08 0.000000000000000e+00 +--------------------------------------------------------------------- +Current time = 9.774571052271429e-08 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 9.30853400067517e-08 +Current step size = 1.861706800135034e-06 +RHS fn evals = 14 +Number of stages used = 4 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_5.out b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_5.out new file mode 100644 index 0000000000..6930759601 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_lsrkstep_lvl5_5.out @@ -0,0 +1,220 @@ +Start LSRKStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 6.103515625000001e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage] z_0(:) = +0.0000000000000000e+00 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.017252604166667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 2.034505208333333e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 4.069010416666667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 5.086263020833334e-12 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 2.034505208333333e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 3.0517578125e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 4.069010416666667e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 5.086263020833334e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_9(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_10(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][updated solution] ycur(:) = +6.1035156250000013e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][embedded solution] y_embedded(:) = +6.1035156250000013e-12 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 5.234960318547938e-10, h_cfl = 6.103515625000001e+18 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 5.025561905806021e-10, h_cfl = 3.0517578125e+18 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0 + 6.103515625000001e-12 6.103515625000001e-12 8.077935669463161e-28 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 6.103515625000001e-12, h = 5.025561905806021e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 6.103515625000001e-12 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage] z_0(:) = +6.1035156250000013e-12 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 8.986288072176701e-11 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 1.73622245818534e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 2.57381610915301e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 3.41140976012068e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 4.24900341108835e-10 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 1.73622245818534e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 2.57381610915301e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 3.41140976012068e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 4.24900341108835e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_9(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 5.086597062056021e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_10(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][updated solution] ycur(:) = +5.0865970620560179e-10 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][embedded solution] y_embedded(:) = +5.0865970620560200e-10 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.600386333723065e-09, h_cfl = 5.02556190580602e+20 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 8.256370880374143e-09, h_cfl = 2.51278095290301e+20 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.067951405164832e-15 + 5.086597062056021e-10 5.086597062056018e-10 3.101927297073854e-25 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 5.086597062056021e-10, h = 8.256370880374143e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 0, tcur = 5.086597062056021e-10 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage] z_0(:) = +5.0865970620560179e-10 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_0(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 1, tcur = 1.884721519601293e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_1(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 2, tcur = 3.260783332996983e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_2(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 3, tcur = 4.636845146392673e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_3(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 4, tcur = 6.012906959788364e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_4(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 5, tcur = 7.388968773184054e-09 +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 6, tcur = 3.260783332996983e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_6(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 7, tcur = 4.636845146392673e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_7(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 8, tcur = 6.012906959788364e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_8(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 9, tcur = 7.388968773184054e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_9(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[INFO][rank 0][lsrkStep_TakeStepSSP104][begin-stage] stage = 10, tcur = 8.765030586579745e-09 +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][stage RHS] F_10(:) = +1.0000000000000000e+00 + +[INFO][rank 0][lsrkStep_TakeStepSSP104][end-stage] status = success +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][updated solution] ycur(:) = +8.7650305865797416e-09 + +[DEBUG][rank 0][lsrkStep_TakeStepSSP104][embedded solution] y_embedded(:) = +8.7650305865797449e-09 + +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 3.04407858682386e-07, h_cfl = 8.256370880374143e+21 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.651274176074829e-07, h_cfl = 4.128185440187071e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.308705620159824e-14 + 8.765030586579745e-09 8.765030586579742e-09 3.308722450212111e-24 +--------------------------------------------------------------------- +Current time = 8.765030586579745e-09 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 3 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 6.103515625000001e-12 +Last step size = 8.256370880374143e-09 +Current step size = 1.651274176074829e-07 +RHS fn evals = 32 +Number of stages used = 10 +End LSRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep.cpp b/test/unit_tests/logging/test_logging_arkode_mristep.cpp new file mode 100644 index 0000000000..b7fe08101b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep.cpp @@ -0,0 +1,317 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in MRIStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode.h" +#include "arkode/arkode_arkstep.h" +#include "arkode/arkode_mristep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sundials/sundials_nonlinearsolver.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" +#include "sunnonlinsol/sunnonlinsol_fixedpoint.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start MRIStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Method to use: + // 0 = Ex-MRI-GARK + // 1 = Im-MRI-GARK + // 2 = ImEx-MRI-GARK + // 3 = Ex-MRI-SR + // 4 = Im-MRI-SR + // 5 = ImEx-MRI-SR + // 6 = MERK + int method_type = 0; + if (argc > 1) { method_type = stoi(argv[1]); } + + // Use Newton (1) otherwise use fixed-point + bool newton = true; + if (argc > 2) { newton = stoi(argv[2]); } + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 3) { direct = stoi(argv[3]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + // Create fast stepper + void* inner_arkode_mem = ARKStepCreate(ode_rhs_ff, nullptr, zero, y, sunctx); + if (check_ptr(inner_arkode_mem, "ARKStepCreate")) { return 1; } + + flag = ARKodeSetUserData(inner_arkode_mem, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype inner_rtol = SUN_RCONST(1.0e-6); + const sunrealtype inner_atol = SUN_RCONST(1.0e-10); + + flag = ARKodeSStolerances(inner_arkode_mem, inner_rtol, inner_atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + MRIStepInnerStepper stepper = nullptr; + flag = ARKStepCreateMRIStepInnerStepper(inner_arkode_mem, &stepper); + if (check_flag(flag, "ARKStepCreateMRIStepInnerStepper")) { return 1; } + + // Create MRIStep memory structure + void* arkode_mem = nullptr; + if (method_type == 0) + { + cout << "Using Ex-MRI-GARK method" << endl; + arkode_mem = MRIStepCreate(ode_rhs_s, nullptr, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 1) + { + cout << "Using Im-MRI-GARK method" << endl; + arkode_mem = MRIStepCreate(nullptr, ode_rhs_s, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 2) + { + cout << "Using ImEx-MRI-GARK method" << endl; + arkode_mem = MRIStepCreate(ode_rhs_se, ode_rhs_si, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 3) + { + cout << "Using Ex-MRI-SR method" << endl; + arkode_mem = MRIStepCreate(ode_rhs_s, nullptr, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 4) + { + cout << "Using Im-MRI-SR method" << endl; + arkode_mem = MRIStepCreate(nullptr, ode_rhs_s, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 5) + { + cout << "Using ImEx-MRI-SR method" << endl; + arkode_mem = MRIStepCreate(ode_rhs_se, ode_rhs_si, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else if (method_type == 6) + { + cout << "Using MERK method" << endl; + arkode_mem = MRIStepCreate(ode_rhs_s, nullptr, zero, y, stepper, sunctx); + if (check_ptr(arkode_mem, "MRIStepCreate")) { return 1; } + } + else + { + cerr << "ERROR: Invalid method type option " << method_type; + return 1; + } + + // Set MRI-SR or MERK method + MRIStepCoupling C = nullptr; + if (method_type == 3 || method_type == 4 || method_type == 5) + { + C = MRIStepCoupling_LoadTable(ARKODE_IMEX_MRI_SR21); + if (check_ptr(C, "MRIStepCoupling_LoadTable")) { return 1; } + } + else if (method_type == 6) + { + C = MRIStepCoupling_LoadTable(ARKODE_MERK21); + if (check_ptr(C, "MRIStepCoupling_LoadTable")) { return 1; } + } + + if (C) + { + flag = MRIStepSetCoupling(arkode_mem, C); + if (check_flag(flag, "MRIStepSetCoupling")) { return 1; } + MRIStepCoupling_Free(C); + } + + flag = ARKodeSetUserData(arkode_mem, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = ARKodeSStolerances(arkode_mem, rtol, atol); + if (check_flag(flag, "ARKodeSStolerances")) { return 1; } + + // Set the slow step size + const sunrealtype hfixed = SUN_RCONST(0.001); + + flag = ARKodeSetFixedStep(arkode_mem, hfixed); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + SUNNonlinearSolver NLS = nullptr; + + if (method_type == 1 || method_type == 2 || method_type == 4 || method_type == 5) + { + if (!newton) + { + cout << "Using fixed-point nonlinear solver" << endl; + + NLS = SUNNonlinSol_FixedPoint(y, 0, sunctx); + if (check_ptr(NLS, "SUNNonlinSol_FixedPoint")) { return 1; } + + flag = ARKodeSetNonlinearSolver(arkode_mem, NLS); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + } + else + { + cout << "Using Newton nonlinear solver" << endl; + if (direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + + if (method_type == 1 || method_type == 4) + { + // implicit slow + flag = ARKodeSetJacFn(arkode_mem, ode_rhs_jac); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + } + else if (method_type == 2 || method_type == 5) + { + // implicit-explicit slow + flag = ARKodeSetJacFn(arkode_mem, ode_rhs_jac_im); + if (check_flag(flag, "ARKodeSetJacFn")) { return 1; } + } + else + { + cerr << "ERROR: Unknown splitting option"; + return 1; + } + } + else + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = ARKodeSetLinearSolver(arkode_mem, LS, A); + if (check_flag(flag, "ARKodeSetLinearSolver")) { return 1; } + } + } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKode")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + SUNMatDestroy(A); + SUNLinSolFree(LS); + SUNNonlinSolFree(NLS); + MRIStepInnerStepper_Free(&stepper); + ARKodeFree(&inner_arkode_mem); + ARKodeFree(&arkode_mem); + + cout << "End MRIStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_0.out new file mode 100644 index 0000000000..ac27da23bd --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_0.out @@ -0,0 +1,28 @@ +Start MRIStep Logging test +Using Ex-MRI-GARK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769329543e+00 1.731993073504213e+00 2.242650509742816e-14 2.664535259100376e-15 + 2.000000000000000e-03 1.224744463143411e+00 1.731819882857615e+00 4.485301019485632e-14 4.218847493575595e-15 + 3.000000000000000e-03 1.224743952833347e+00 1.731531270273564e+00 6.727951529228449e-14 6.217248937900877e-15 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_1_0.out new file mode 100644 index 0000000000..47733731e6 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_1_0.out @@ -0,0 +1,29 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769312645e+00 1.731993073504226e+00 1.687561201890730e-11 1.043609643147647e-14 + 2.000000000000000e-03 1.224744463066094e+00 1.731819882857627e+00 7.727218864772567e-11 7.993605777301127e-15 + 3.000000000000000e-03 1.224743952652198e+00 1.731531270273541e+00 1.810818162084615e-10 2.975397705995420e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_1_1_0.out new file mode 100644 index 0000000000..4f37f708a3 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_1_1_0.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769329781e+00 1.731993073504227e+00 2.609024107869118e-13 1.154631945610163e-14 + 2.000000000000000e-03 1.224744463146273e+00 1.731819882857643e+00 2.906785923073585e-12 2.398081733190338e-14 + 3.000000000000000e-03 1.224743952843819e+00 1.731531270273608e+00 1.053868103895184e-11 3.752553823233029e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_1_1_1.out new file mode 100644 index 0000000000..c78f6fd09b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_1_1_1.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769329545e+00 1.731993073520500e+00 2.398081733190338e-14 1.628497336980672e-11 + 2.000000000000000e-03 1.224744463143431e+00 1.731819882932031e+00 6.394884621840902e-14 7.441158800247649e-11 + 3.000000000000000e-03 1.224743952869449e+00 1.731531504991570e+00 3.616884569623835e-11 2.347179997030935e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_2_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_2_0.out new file mode 100644 index 0000000000..5e53d4b2ee --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_2_0.out @@ -0,0 +1,29 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769310943e+00 1.731993073504207e+00 1.857802800486752e-11 8.437694987151190e-15 + 2.000000000000000e-03 1.224744463059331e+00 1.731819882857589e+00 8.403544526913720e-11 3.019806626980426e-14 + 3.000000000000000e-03 1.224743952637017e+00 1.731531270273480e+00 1.962627838025810e-10 8.992806499463768e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_2_1_0.out new file mode 100644 index 0000000000..e450b9fb23 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_2_1_0.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769329784e+00 1.731993073504208e+00 2.637889906509372e-13 7.105427357601002e-15 + 2.000000000000000e-03 1.224744463146502e+00 1.731819882857606e+00 3.135491866146367e-12 1.332267629550188e-14 + 3.000000000000000e-03 1.224743952844747e+00 1.731531270273553e+00 1.146727157674832e-11 1.776356839400250e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_2_1_1.out new file mode 100644 index 0000000000..da3019afb6 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_2_1_1.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769329530e+00 1.731993073522877e+00 9.103828801926284e-15 1.866129473171441e-11 + 2.000000000000000e-03 1.224744463143402e+00 1.731819882942073e+00 3.552713678800501e-14 8.445355526021103e-11 + 3.000000000000000e-03 1.224743952868526e+00 1.731531529558496e+00 3.524580627356499e-11 2.592849255300678e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_3.out b/test/unit_tests/logging/test_logging_arkode_mristep_3.out new file mode 100644 index 0000000000..fdfb2626b9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_3.out @@ -0,0 +1,28 @@ +Start MRIStep Logging test +Using Ex-MRI-SR method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769314268e+00 1.731993073495719e+00 1.525224391230040e-11 8.496092718246473e-12 + 2.000000000000000e-03 1.224744463112885e+00 1.731819882840752e+00 3.048206131950337e-11 1.686739636852508e-11 + 3.000000000000000e-03 1.224743952787591e+00 1.731531270248313e+00 4.568923017700399e-11 2.525712972101246e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_4_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_4_0.out new file mode 100644 index 0000000000..6de8a27c70 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_4_0.out @@ -0,0 +1,29 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769293108e+00 1.731993073495728e+00 3.641287271705096e-11 8.487210934049472e-12 + 2.000000000000000e-03 1.224744463044450e+00 1.731819882840759e+00 9.891665264660787e-11 1.686029094116748e-11 + 3.000000000000000e-03 1.224743952645809e+00 1.731531270248295e+00 1.874711497151793e-10 2.527533737861631e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_4_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_4_1_0.out new file mode 100644 index 0000000000..319f0bc47a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_4_1_0.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769306441e+00 1.731993073495728e+00 2.307976032511760e-11 8.487210934049472e-12 + 2.000000000000000e-03 1.224744463099111e+00 1.731819882840765e+00 4.425571020760799e-11 1.685385164762465e-11 + 3.000000000000000e-03 1.224743952771547e+00 1.731531270248329e+00 6.173306310586213e-11 2.524158659866771e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_4_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_4_1_1.out new file mode 100644 index 0000000000..2c2896ad6f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_4_1_1.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769306223e+00 1.731993073507874e+00 2.329714199333921e-11 3.659073044559591e-12 + 2.000000000000000e-03 1.224744463096872e+00 1.731819882889337e+00 4.649436391446216e-11 3.171818363512102e-11 + 3.000000000000000e-03 1.224743952790514e+00 1.731531402623384e+00 4.276623499777088e-11 1.323498133309897e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_5_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_5_0.out new file mode 100644 index 0000000000..0599c21ae4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_5_0.out @@ -0,0 +1,29 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769381067e+00 1.731993073495719e+00 5.154610072111154e-11 8.496092718246473e-12 + 2.000000000000000e-03 1.224744463220070e+00 1.731819882840785e+00 7.670308832530282e-11 1.683408967778632e-11 + 3.000000000000000e-03 1.224743952908896e+00 1.731531270248400e+00 7.561573589498494e-11 2.517031028048677e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_5_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_5_1_0.out new file mode 100644 index 0000000000..b2645972c0 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_5_1_0.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769394401e+00 1.731993073495719e+00 6.488076742527937e-11 8.496092718246473e-12 + 2.000000000000000e-03 1.224744463274739e+00 1.731819882840792e+00 1.313724684592898e-10 1.682742833963857e-11 + 3.000000000000000e-03 1.224743953034659e+00 1.731531270248434e+00 2.013786915000537e-10 2.513611541132832e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_5_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_5_1_1.out new file mode 100644 index 0000000000..1bbfb08a0a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_5_1_1.out @@ -0,0 +1,41 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769394184e+00 1.731993073508899e+00 6.466338575705777e-11 4.683364807078760e-12 + 2.000000000000000e-03 1.224744463272502e+00 1.731819882893496e+00 1.291351470200652e-10 3.587685704076193e-11 + 3.000000000000000e-03 1.224743953054848e+00 1.731531408143622e+00 2.215676531136523e-10 1.378700513754438e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_6.out b/test/unit_tests/logging/test_logging_arkode_mristep_6.out new file mode 100644 index 0000000000..50eb484aeb --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_6.out @@ -0,0 +1,28 @@ +Start MRIStep Logging test +Using MERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 1.224744769278491e+00 1.731993073504249e+00 5.103006905926577e-11 3.375077994860476e-14 + 2.000000000000000e-03 1.224744463041408e+00 1.731819882857753e+00 1.019582196448710e-10 1.338928967697939e-13 + 3.000000000000000e-03 1.224743952680496e+00 1.731531270273762e+00 1.527842297122106e-10 1.914024494453770e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 6 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_0.out new file mode 100644 index 0000000000..df003f735b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_0.out @@ -0,0 +1,272 @@ +Start MRIStep Logging test +Using Ex-MRI-GARK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00075 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618640185768e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0002691273172028848 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006154363413985574 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006154363413985574 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006827181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.061352125450266e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00075, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00075 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009374999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.534938689302334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329543e+00 1.731993073504213e+00 2.242650509742816e-14 2.664535259100376e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85185275272059e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00175 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.0004166666666666664 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.00175 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001645833333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.184752984633551e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.00175, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00175 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0019375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.535440853723494e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143411e+00 1.731819882857615e+00 4.485301019485632e-14 4.218847493575595e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85375335258683e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00275 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0004166666666666659 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002645833333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.185319915370691e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.00275, h = 0.00025 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00275 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0029375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.53635312385524e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952833347e+00 1.731531270273564e+00 6.727951529228449e-14 6.217248937900877e-15 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_0.out new file mode 100644 index 0000000000..4e9fc5212f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_0.out @@ -0,0 +1,378 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.618808553272737 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0007928652556788505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618612523282e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769616071643e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 10.47508400821115 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00318668913410324 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85151446454876e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56852920005934 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00721853154020951 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769312645e+00 1.731993073504226e+00 1.687561201890730e-11 1.043609643147647e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852819112485e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 18.33117208795071 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.005605053590958301 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341592e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 41.89912728820217 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.012810580405903 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983467222143e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70323030012283 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02165342185634298 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463066094e+00 1.731819882857627e+00 7.727218864772567e-11 7.993605777301127e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753308321081e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 34.04320255383404 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01041601086240528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673527563141e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 73.3217906642831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0224314713676539 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790955e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347848203848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03608300450075731 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952652198e+00 1.731531270273541e+00 1.810818162084615e-10 2.975397705995420e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_0.out new file mode 100644 index 0000000000..74bc33b4dd --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_0.out @@ -0,0 +1,507 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.618808553272737, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.703554573296969, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00112125978322437 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.161068318927283e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.161068318927283e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.618813609683919 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.232026095373332e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618889148138e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681770943876267e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 10.4750840049673, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 14.81400586682223, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00450658843870752 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.098125567835629e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.098125567835629e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47509900841071 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.162702708411542e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514752241806e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56852919194102, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093362842919, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01020836739073424 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.355663625576664e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.355663625576664e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854611856336 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159124529421133e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329781e+00 1.731993073504227e+00 2.609024107869118e-13 1.154631945610163e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852796981838e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 18.33117208679076, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 25.9241921793346, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.007926620801967321 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.96020189895167e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.96020189895167e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3311884590036 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.923065181149995e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341581e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 41.8991272714572, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 59.25431403889118, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01811631882340358 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.767859298135969e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.767859298135969e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.89916487967248 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.734177522130014e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983533617987e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70323025789027, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946713429621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0306210098787736 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.142537668128806e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.142537668128806e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328103277684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884719277568e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146273e+00 1.731819882857643e+00 2.906785923073585e-12 2.398081733190338e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753396852466e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 34.04320254847141, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 48.14435875066259, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0147300815422269 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.475993886304119e-19 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.475993886304119e-19 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.04323020408164 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.451037074099789e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85467361609875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 73.32179062888304, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 103.6926707248469, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03172118985328261 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.528691940896443e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.528691940896443e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.32185080179332 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.155370726632578e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790828e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347847337331, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435506897594, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05102477837646521 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.409058797851785e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.409058797851785e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348693449266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999452862407404e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952843819e+00 1.731531270273608e+00 1.053868103895184e-11 3.752553823233029e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_1.out new file mode 100644 index 0000000000..88baba4c9a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_1_1_1.out @@ -0,0 +1,411 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.617700682819475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001112474382861515 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861619470059087e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769782044082e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47064411639136 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004452567171048158 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514785420889e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55851273849144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01002676147689013 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329545e+00 1.731993073520500e+00 2.398081733190338e-14 1.628497336980672e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852664152388e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3233881738182 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.007796994789490233 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341133666858e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.88133272968303 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01782130916736245 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983334309895e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.67317810828131 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.030079277696704 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143431e+00 1.731819882932031e+00 6.394884621840902e-14 7.441158800247649e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753352378277e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.02874272231963 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673693492052e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.2761708669783 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748275024137e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7390695187308 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952869449e+00 1.731531504991570e+00 3.616884569623835e-11 2.347179997030935e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_0.out new file mode 100644 index 0000000000..5727f91ed5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_0.out @@ -0,0 +1,378 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 4.47758963593855 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.001381168840186244 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.44270566101614e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480983041563123e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 12.14796270537412 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.003729401476593421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422835575235e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56857053242068 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007204341456067922 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769310943e+00 1.731993073504207e+00 1.857802800486752e-11 8.437694987151190e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573793277643e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 25.02295754400714 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007673490841823296 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925979834815e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.9883942369528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01409326137946229 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213435739734e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70326789489285 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02163921128613955 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463059331e+00 1.731819882857589e+00 8.403544526913720e-11 3.019806626980426e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125643031044e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.56773766995966 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01396408830693848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193419476551e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 79.82720625180357 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02445379030807663 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668466049585e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8348216738145 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0360687584086095 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952637017e+00 1.731531270273480e+00 1.962627838025810e-10 8.992806499463768e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_0.out new file mode 100644 index 0000000000..db122e64bc --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_0.out @@ -0,0 +1,507 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.47758963593855, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 6.332267989885506, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.001953262537596359 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42665892042333e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42665892042333e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.477589426294661 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.39281563810194e-09, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705992966839e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480987744230228e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 12.14796270362833, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 17.17981361067371, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.005274126908187331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.872043759800531e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.872043759800531e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14796838587409 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.951101105650146e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422957291812e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56857051892312, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33099207360777, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01018828512419516 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.097815390178688e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.097815390178688e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56859237983746 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159120204033942e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329784e+00 1.731993073504208e+00 2.637889906509372e-13 7.105427357601002e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779999255e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 25.02295754230139, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 35.38780592700876, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0108517582955742 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.310220087272859e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.310220087272859e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.02297210770475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.30993571467114e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925957703379e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.98839422006409, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 65.0374108177751, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01993022435383186 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.601715600583093e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.601715600583093e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.98842420996601 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.508449719859987e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213391475553e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70326784116725, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98952028507621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03060090279483382 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.928833636261717e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.928833636261717e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.7033235562848 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884213617642e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146502e+00 1.731819882857606e+00 3.135491866146367e-12 1.332267629550188e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125651884173e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.56773766224819, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 64.44251260861067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0197475505808735 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.813872614936062e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.813872614936062e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.56776698106852 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.425041483437005e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193375207932e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 79.82720621190367, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 112.892717671228, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03458090468247423 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.108501437863291e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.108501437863291e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.82726049775935 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.371022992941138e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668421778799e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8348215690963, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6436027828297, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05100462411786148 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.464460115747127e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.464460115747127e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8349111208192 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999444839290604e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952844747e+00 1.731531270273553e+00 1.146727157674832e-11 1.776356839400250e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_1.out new file mode 100644 index 0000000000..cd2d17b023 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_2_1_1.out @@ -0,0 +1,411 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.475638659002295 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001949917579727998 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705218408666e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480985254579955e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14267813696497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.005287100222820616 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422913020145e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55833268368898 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01025211853916463 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329530e+00 1.731993073522877e+00 9.103828801926284e-15 1.866129473171441e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779983966e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.01207820825822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01088917366868417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487926046185586e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.96839978231188 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.02001100770869457 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213369269281e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6725364586391 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03076033257676166 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143402e+00 1.731819882942073e+00 3.552713678800501e-14 8.445355526021103e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.41912564738839e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.54793022201162 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193460191508e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.77268774500753 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668406571682e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7290852919884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952868526e+00 1.731531529558496e+00 3.524580627356499e-11 2.592849255300678e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_3.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_3.out new file mode 100644 index 0000000000..f13bddbf6f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_3.out @@ -0,0 +1,300 @@ +Start MRIStep Logging test +Using Ex-MRI-SR method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469436431449e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.618934781454142e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064153609642308e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809673922718e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769314268e+00 1.731993073495719e+00 1.525224391230040e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654011537726e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261462524817 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463112885e+00 1.731819882840752e+00 3.048206131950337e-11 1.686739636852508e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614179993884e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964755177207e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086788760326 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952787591e+00 1.731531270248313e+00 4.568923017700399e-11 2.525712972101246e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_0.out new file mode 100644 index 0000000000..7bac9765c4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_0.out @@ -0,0 +1,382 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484795600596831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002839677462856478 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469364509253e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.646426838510152e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676008618859752 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005643456517840985 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064449683586706e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670049984e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853116193789 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007921301090223275 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769293108e+00 1.731993073495728e+00 3.641287271705096e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654015963828e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76658769079079 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01234458166289366 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826571203e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24595765940638 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004788932282498826 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614628789052 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322912588983 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376154766714745 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463044450e+00 1.731819882840759e+00 9.891665264660787e-11 1.686029094116748e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614193273577e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04725301387548 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02184661245053742 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964799442913e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.81568292207747 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009012485355207473 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393408678876031 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347805661338 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959596958504103 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952645809e+00 1.731531270248295e+00 1.874711497151793e-10 2.527533737861631e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_0.out new file mode 100644 index 0000000000..80bf3a0135 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_0.out @@ -0,0 +1,511 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484795600596831, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99931301232761, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004015866839014629 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.355316732970741e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.355316732970741e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484806428685115 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518415627456097e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.95446933684687e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034588e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676008618858404, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370234119443755, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0007981043352652857 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.774836283552402e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.774836283552402e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676009569925 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.704998826808452e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809665070755e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844451011408e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853116193524, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093641442174, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120221282537529 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.829268876391666e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.829268876391666e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.5685496216454 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271877873619188e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306441e+00 1.731993073495728e+00 2.307976032511760e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389957e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76658771011432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99580698182362, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01745737857060591 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.044483986313881e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.044483986313881e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76662068822849 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144290571601441e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182771244593e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.24595765886783, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14682653016375, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006772498770722619 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42491424547357e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42491424547357e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24596845308144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511949813658031e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629674277 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322912330754, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.9894655297539, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360218033634896 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.152035138603228e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.152035138603228e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328448815538 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178327890492011e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463099111e+00 1.731819882840765e+00 4.425571020760799e-11 1.685385164762465e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614171140701e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04725306864341, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99070748479045, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03089427150794729 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.181096200144441e-18 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.181096200144441e-18 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04730818679262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.960152942248941e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.81568291912277, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92310246851997, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01274532455113983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.285389427812277e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.285389427812277e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81570355371161 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655086190669431e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086789645609 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347805551639, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435447803702, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599240898342154 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.717421103006767e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.717421103006767e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348728123731 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291179996932946e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952771547e+00 1.731531270248329e+00 6.173306310586213e-11 2.524158659866771e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_1.out new file mode 100644 index 0000000000..0d9de09509 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_4_1_1.out @@ -0,0 +1,415 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480918398010767 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.003886272468077529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469389405397e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.970596152824813e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.675240952507911 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007682656087209085 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670603232e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55774369269417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01080099623073331 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306223e+00 1.731993073507874e+00 2.329714199333921e-11 3.659073044559591e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654002685442e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74977069074764 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01684727551980917 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892949201e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23943664292217 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006528828278646521 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614626991023 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6708677907402 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03240190722051899 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463096872e+00 1.731819882889337e+00 4.649436391446216e-11 3.171818363512102e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614202090989e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01750170982633 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98796482152001e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80340866628079 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086790420591 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7808468031958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952790514e+00 1.731531402623384e+00 4.276623499777088e-11 1.323498133309897e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_0.out new file mode 100644 index 0000000000..2c9426d02a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_0.out @@ -0,0 +1,382 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484739570785543 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002872021134577523 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469444730164e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.483386286293241e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676051713901 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005550288725063259 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.45080967336947e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844408964292e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853105559693 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00792134563849221 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769381067e+00 1.731993073495719e+00 5.154610072111154e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389983e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76651861107677 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01237684727413916 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24598132523421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004779612504313948 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614627903846 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322900199585 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376157169292097 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463220070e+00 1.731819882840785e+00 7.670308832530282e-11 1.683408967778632e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614197700071e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04718221193126 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02187885806556827 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044311e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.8157053695451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009003158261554924 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989621 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347804246883 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959595686370691 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952908896e+00 1.731531270248400e+00 7.561573589498494e-11 2.517031028048677e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_0.out new file mode 100644 index 0000000000..94170fae9c --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_0.out @@ -0,0 +1,511 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484739570785543, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99923377420859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004061628839918641 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.261188224676155e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.261188224676155e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484739092489631 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518443352071625e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469455795117e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676051713894338, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370295065028044, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.000784909752142059 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.830518996709413e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.830518996709413e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676055870103954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.705857208966444e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06434270796446e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809675029214e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853105559414, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093626403272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120227586871812 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.102299192199702e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.102299192199702e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854949834894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271889714640072e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394401e+00 1.731993073495719e+00 6.488076742527937e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654029242241e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76651862332542, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99570927834978, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01750303644230911 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.148830835061795e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.148830835061795e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76654034473584 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144297537687311e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98718285976718e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.2459813244254, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14685999831622, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006759308947646806 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.729049992208015e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.729049992208015e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24599536081284 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511848546542516e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261463144475 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322899932275, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946535441294, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360221435305671 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.396025428056713e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.396025428056713e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328434722259 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178331477975891e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463274739e+00 1.731819882840792e+00 1.313724684592898e-10 1.682742833963857e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184420337e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04718225429593, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99060733817983, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03093990190491139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.983157730959663e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.983157730959663e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04722612054304 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.96013596045361e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964644512875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.815705366597, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92313421404247, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01273212495283929 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.431424283260585e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.431424283260585e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81572924528313 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655080176519261e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989607 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347804136278, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.643544580208, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599239103918983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.062550360780627e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.062550360780627e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348726538357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291178169077933e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953034659e+00 1.731531270248434e+00 2.013786915000537e-10 2.513611541132832e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_1.out new file mode 100644 index 0000000000..12f1e71ba5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_5_1_1.out @@ -0,0 +1,415 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480683165445265 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004053988672151497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469486223738e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.67525688591453 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007986236836926118 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809672262975e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844417816317e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55729311954163 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01125102526633561 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394184e+00 1.731993073508899e+00 6.466338575705777e-11 4.683364807078760e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654024816112e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74898235634708 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01755499643145954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826556093e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23919293845223 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006799198459570063 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629644375 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.66951636300151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0337519319761958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463272502e+00 1.731819882893496e+00 1.291351470200652e-10 3.587685704076193e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184381587e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01617199533266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964732983807e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80292351487524 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086787755202 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7785945816081 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953054848e+00 1.731531408143622e+00 2.215676531136523e-10 1.378700513754438e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_6.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_6.out new file mode 100644 index 0000000000..b64d29efd2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl3_6.out @@ -0,0 +1,230 @@ +Start MRIStep Logging test +Using MERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0005 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.287097149330938e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.681308618402001e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.716129532441251e-08, h = 1.413040570968547e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.236815808086858e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.236815808086858e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.430201866292959e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.076941723550822e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.649460766305993e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.430201866292959e-06, h = 2.321449271066302e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.430201866292959e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.303744822162447e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.303744822162447e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.464469457695598e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.884107139929023e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.140805973034775e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.464469457695598e-05, h = 0.0004642898542132603 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.464469457695598e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002567896216835862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002567896216835862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004889345487902163 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003728620852369013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.826224996633818e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004889345487902163, h = 1.106545120978371e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004889345487902163 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004944672743951082 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004944672743951082 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004972336371975541 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.889886968307349e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001106545120978371 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001106545120978371 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001659817681467556 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.425094080723045e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002213090241956742, h = 0.0007786909758043252 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006106545120978368 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006106545120978368 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999994 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008053272560489181 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0001445442462304924 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769278491e+00 1.731993073504249e+00 5.103006905926577e-11 3.375077994860476e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0015 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.001, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.456665619756245e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932628225837462 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463041408e+00 1.731819882857753e+00 1.019582196448710e-10 1.338928967697939e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0025 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.002, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.457617220747888e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934099230043387 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952680496e+00 1.731531270273762e+00 1.527842297122106e-10 1.914024494453770e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 6 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_0.out new file mode 100644 index 0000000000..6544d69c5c --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_0.out @@ -0,0 +1,314 @@ +Start MRIStep Logging test +Using Ex-MRI-GARK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00075 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886608518576, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831571144177833, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123678626051 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618640185768e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0002691273172028848 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006154363413985574 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006154363413985574 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006827181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002342768924220768, h_cfl = 2.691273172028848e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002249058167251937, h_cfl = 1.345636586014424e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.356855746295192 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.061352125450266e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00075, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00075 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009374999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002092677993913014, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002008970874156493, h_cfl = 1.249999999999999e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.035883496625978 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.534938689302334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329543e+00 1.731993073504213e+00 2.242650509742816e-14 2.664535259100376e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002019467844874993, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001938689131079993, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.816067393239986 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85185275272059e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00175 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.0004166666666666664 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.00175 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001645833333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002325110420635145, h_cfl = 4.166666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002232106003809739, h_cfl = 2.083333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.357054409143378 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.184752984633551e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.00175, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00175 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0019375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002121473803752882, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002036614851602766, h_cfl = 1.249999999999999e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.146459406411072 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.535440853723494e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143411e+00 1.731819882857615e+00 4.485301019485632e-14 4.218847493575595e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001905013896432126, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001828813340574841, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.486440021724523 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85375335258683e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00275 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0004166666666666659 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002541666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002645833333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002324933765203915, h_cfl = 4.166666666666659e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002231936414595759, h_cfl = 2.08333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.35664739502983 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.185319915370691e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.00275, h = 0.00025 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00275 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002875 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0029375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002121273546461272, h_cfl = 2.5e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00203642260460282, h_cfl = 1.25e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.145690418411281 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.53635312385524e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952833347e+00 1.731531270273564e+00 6.727951529228449e-14 6.217248937900877e-15 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_0.out new file mode 100644 index 0000000000..3fec8b4975 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_0.out @@ -0,0 +1,429 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.618808553272737 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0007928652556788505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886631954655, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831571166676468, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123693875294 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618612523282e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071596762738, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908732892228, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011675525584 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769616071643e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 10.47508400821115 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00318668913410324 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00201351024220627, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969832518019, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909497554061 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85151446454876e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56852920005934 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00721853154020951 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769312645e+00 1.731993073504226e+00 1.687561201890730e-11 1.043609643147647e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746961420123, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757082963318, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271248889962 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852819112485e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 18.33117208795071 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.005605053590958301 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280774688737, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189543701188, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568631103569 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341592e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 41.89912728820217 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.012810580405903 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236369311113, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042146914538669, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126440743616008 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983467222143e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70323030012283 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02165342185634298 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463066094e+00 1.731819882857627e+00 7.727218864772567e-11 7.993605777301127e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183712206665, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042096363718398, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289091155196 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753308321081e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 34.04320255383404 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01041601086240528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127119983291906, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00204203518396023, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.1261055518807 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673527563141e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 73.3217906642831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0224314713676539 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045935429419, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964098012242, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892294036728 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790955e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347848203848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03608300450075731 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952652198e+00 1.731531270273541e+00 1.810818162084615e-10 2.975397705995420e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_0.out new file mode 100644 index 0000000000..cd61d77a59 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_0.out @@ -0,0 +1,558 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.618808553272737, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.703554573296969, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00112125978322437 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.161068318927283e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.161068318927283e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.618813609683919 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.232026095373332e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886397593916, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831570941690159, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123541382885 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618889148138e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071501057282, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908641014991, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011626074447 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681770943876267e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 10.4750840049673, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 14.81400586682223, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00450658843870752 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.098125567835629e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.098125567835629e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47509900841071 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.162702708411542e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00201351024912287, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969839157955, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909517473869 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514752241806e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56852919194102, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093362842919, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01020836739073424 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.355663625576664e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.355663625576664e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854611856336 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159124529421133e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329781e+00 1.731993073504227e+00 2.609024107869118e-13 1.154631945610163e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746951253171, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757073203045, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271219609141 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852796981838e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 18.33117208679076, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 25.9241921793346, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.007926620801967321 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.96020189895167e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.96020189895167e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3311884590036 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.923065181149995e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280769804621, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189539012436, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568617037314 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341581e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 41.8991272714572, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 59.25431403889118, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01811631882340358 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.767859298135969e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.767859298135969e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.89916487967248 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.734177522130014e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236364007833, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042146909447519, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.12644072834256 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983533617987e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70323025789027, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946713429621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0306210098787736 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.142537668128806e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.142537668128806e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328103277684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884719277568e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146273e+00 1.731819882857643e+00 2.906785923073585e-12 2.398081733190338e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183706742662, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042096358472956, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289075418868 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753396852466e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 34.04320254847141, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 48.14435875066259, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0147300815422269 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.475993886304119e-19 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.475993886304119e-19 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.04323020408164 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.451037074099789e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00212711997753779, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042035178436279, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126105535308846 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85467361609875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 73.32179062888304, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 103.6926707248469, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03172118985328261 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.528691940896443e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.528691940896443e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.32185080179332 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.155370726632578e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045936851595, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964099377531, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892298132595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790828e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347847337331, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435506897594, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05102477837646521 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.409058797851785e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.409058797851785e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348693449266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999452862407404e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952843819e+00 1.731531270273608e+00 1.053868103895184e-11 3.752553823233029e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_1.out new file mode 100644 index 0000000000..ea21ca016b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_1_1_1.out @@ -0,0 +1,462 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.617700682819475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001112474382861515 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157885905437562, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831570469220059, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123221149604 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861619470059087e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071651456697, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908785398429, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011703786026 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769782044082e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47064411639136 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004452567171048158 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002013510190539819, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969782918226, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909348754682 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514785420889e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55851273849144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01002676147689013 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329545e+00 1.731993073520500e+00 2.398081733190338e-14 1.628497336980672e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746983550014, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757104208013, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271312624047 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852664152388e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3233881738182 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.007796994789490233 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280759621378, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189529236523, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568587709575 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341133666858e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.88133272968303 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01782130916736245 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236384874792, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0020421469294798, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126440788439403 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983334309895e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.67317810828131 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.030079277696704 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143431e+00 1.731819882932031e+00 6.394884621840902e-14 7.441158800247649e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183703426417, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00204209635528936, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289065868082 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753352378277e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.02874272231963 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00212711997252938, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042035173628204, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126105520884623 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673693492052e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.2761708669783 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045936467591, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964099008887, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892297026663 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748275024137e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7390695187308 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952869449e+00 1.731531504991570e+00 3.616884569623835e-11 2.347179997030935e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_0.out new file mode 100644 index 0000000000..44d65c9844 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_0.out @@ -0,0 +1,432 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 4.47758963593855 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.001381168840186244 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545729167712, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029963900001004, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.162276829080684 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.44270566101614e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024868239103, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480983041563123e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 12.14796270537412 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.003729401476593421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001522938943322793, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021385589881, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246310781768 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422835575235e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56857053242068 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007204341456067922 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769310943e+00 1.731993073504207e+00 1.857802800486752e-11 8.437694987151190e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109904163659, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225507997112, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095588097819 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573793277643e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 25.02295754400714 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007673490841823296 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738579556575, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429036374312, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684100018917118 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925979834815e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.9883942369528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01409326137946229 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990625018675, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551000017928, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874500620789 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213435739734e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70326789489285 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02163921128613955 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463059331e+00 1.731819882857589e+00 8.403544526913720e-11 3.019806626980426e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765825198395, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535192190459, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.858219403642281 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125643031044e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.56773766995966 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01396408830693848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553829678998, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251676491838, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471231974887 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193419476551e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 79.82720625180357 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02445379030807663 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820260655438, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00181038745022922, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294674055113 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668466049585e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8348216738145 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0360687584086095 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952637017e+00 1.731531270273480e+00 1.962627838025810e-10 8.992806499463768e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_0.out new file mode 100644 index 0000000000..a99d2ee1ba --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_0.out @@ -0,0 +1,561 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.47758963593855, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 6.332267989885506, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.001953262537596359 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42665892042333e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42665892042333e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.477589426294661 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.39281563810194e-09, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545630537986, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029963805316466, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.162276780001601 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705992966839e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024156162993, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480987744230228e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 12.14796270362833, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 17.17981361067371, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.005274126908187331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.872043759800531e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.872043759800531e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14796838587409 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.951101105650146e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00152293912788855, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021562773008, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246938942064 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422957291812e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56857051892312, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33099207360777, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01018828512419516 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.097815390178688e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.097815390178688e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56859237983746 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159120204033942e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329784e+00 1.731993073504208e+00 2.637889906509372e-13 7.105427357601002e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109755115509, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225364910889, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095259817906 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779999255e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 25.02295754230139, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 35.38780592700876, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0108517582955742 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.310220087272859e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.310220087272859e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.02297210770475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.30993571467114e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738578277529, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429035146428, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684100014563951 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925957703379e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.98839422006409, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 65.0374108177751, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01993022435383186 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.601715600583093e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.601715600583093e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.98842420996601 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.508449719859987e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990630919255, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551005682485, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874520703118 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213391475553e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70326784116725, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98952028507621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03060090279483382 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.928833636261717e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.928833636261717e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.7033235562848 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884213617642e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146502e+00 1.731819882857606e+00 3.135491866146367e-12 1.332267629550188e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765820445304, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535187627492, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.858219393173556 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125651884173e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.56773766224819, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 64.44251260861067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0197475505808735 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.813872614936062e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.813872614936062e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.56776698106852 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.425041483437005e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553839765699, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251686175071, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471266304468 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193375207932e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 79.82720621190367, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 112.892717671228, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03458090468247423 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.108501437863291e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.108501437863291e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.82726049775935 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.371022992941138e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820264398724, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810387453822775, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294686795201 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668421778799e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8348215690963, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6436027828297, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05100462411786148 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.464460115747127e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.464460115747127e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8349111208192 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999444839290604e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952844747e+00 1.731531270273553e+00 1.146727157674832e-11 1.776356839400250e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_1.out new file mode 100644 index 0000000000..9e3205a335 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_2_1_1.out @@ -0,0 +1,465 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.475638659002295 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001949917579727998 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545860675966, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029964026248927, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.16227689452043 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705218408666e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024518003245, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480985254579955e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14267813696497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.005287100222820616 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001522939033375331, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021472040318, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246617271065 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422913020145e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55833268368898 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01025211853916463 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329530e+00 1.731993073522877e+00 9.103828801926284e-15 1.866129473171441e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109837952736, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225444434626, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095442267654 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779983966e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.01207820825822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01088917366868417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738564091452, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429021527794, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684099966282349 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487926046185586e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.96839978231188 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.02001100770869457 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990638869279, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551013314508, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874547760627 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213369269281e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6725364586391 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03076033257676166 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143402e+00 1.731819882942073e+00 3.552713678800501e-14 8.445355526021103e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765817803392, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535185091256, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.85821938735472 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.41912564738839e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.54793022201162 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553825035457, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251672034038, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471216170827 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193460191508e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.77268774500753 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820271331692, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810387460478425, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294710391211 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668406571682e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7290852919884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952868526e+00 1.731531529558496e+00 3.524580627356499e-11 2.592849255300678e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_3.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_3.out new file mode 100644 index 0000000000..f4c720a07a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_3.out @@ -0,0 +1,354 @@ +Start MRIStep Logging test +Using Ex-MRI-SR method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674153956226, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967187797977, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164123207857 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469436431449e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634421513462e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.618934781454142e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404364362730721, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064153609642308e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534110004361672, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472745604187206, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359862723658343 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809673922718e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682863348538355, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535548814596821, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550367096815337 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769314268e+00 1.731993073495719e+00 1.525224391230040e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794540378942, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522758763785, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871264606313 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654011537726e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868659677365, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00214643391329027, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127174838516 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00236999152476531, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191863774698, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.2751918637747 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261462524817 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463112885e+00 1.731819882840752e+00 3.048206131950337e-11 1.686739636852508e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458424088719, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00326924008712517, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733478541956 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614179993884e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250121127217, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880116282128, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300436057982 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964755177207e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854906908199, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060710631871, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060710631873 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086788760326 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952787591e+00 1.731531270248313e+00 4.568923017700399e-11 2.525712972101246e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_0.out new file mode 100644 index 0000000000..c7fec00f02 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_0.out @@ -0,0 +1,436 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484795600596831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002839677462856478 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674215266165, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967246655518, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.11516414537051 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469364509253e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634400131705e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.646426838510152e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676008618859752 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005643456517840985 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404330240967631, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064449683586706e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534113512840757, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472748972327127, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359870407597604 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670049984e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682859333259777, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544959929386, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550359955212135 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853116193789 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007921301090223275 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769293108e+00 1.731993073495728e+00 3.641287271705096e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794541412499, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522759755999, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871266260003 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654015963828e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76658769079079 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01234458166289366 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868673761018, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433926810577, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127225539666 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826571203e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24595765940638 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004788932282498826 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991518741408, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191857991752, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191857991754 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614628789052 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322912588983 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376154766714745 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463044450e+00 1.731819882840759e+00 9.891665264660787e-11 1.686029094116748e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458426380418, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240089325201, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733482208675 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614193273577e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04725301387548 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02184661245053742 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250112576088, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880108073044, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300405273919 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964799442913e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.81568292207747 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009012485355207473 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854910396215, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060713980366, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060713980368 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393408678876031 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347805661338 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959596958504103 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952645809e+00 1.731531270248295e+00 1.874711497151793e-10 2.527533737861631e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_0.out new file mode 100644 index 0000000000..d418dad8d4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_0.out @@ -0,0 +1,565 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484795600596831, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99931301232761, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004015866839014629 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.355316732970741e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.355316732970741e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484806428685115 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518415627456097e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674238846908, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967269293031, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164153894606 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.95446933684687e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634391907952e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034588e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676008618858404, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370234119443755, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0007981043352652857 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.774836283552402e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.774836283552402e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676009569925 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.704998826808452e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404386294498222, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534107753002054, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472743442881971, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.35985779294331 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809665070755e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682865914687657, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00353555127810015, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550371660986841 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844451011408e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853116193524, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093641442174, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120221282537529 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.829268876391666e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.829268876391666e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.5685496216454 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271877873619188e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306441e+00 1.731993073495728e+00 2.307976032511760e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794542140617, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522760454992, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871267424992 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389957e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76658771011432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99580698182362, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01745737857060591 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.044483986313881e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.044483986313881e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76662068822849 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144290571601441e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868685585981, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433938162542, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127268109535 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182771244593e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.24595765886783, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14682653016375, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006772498770722619 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42491424547357e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42491424547357e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24596845308144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511949813658031e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991513950708, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227519185339268, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191853392681 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629674277 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322912330754, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.9894655297539, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360218033634896 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.152035138603228e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.152035138603228e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328448815538 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178327890492011e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463099111e+00 1.731819882840765e+00 4.425571020760799e-11 1.685385164762465e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458432453699, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240095155551, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733491925924 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614171140701e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04725306864341, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99070748479045, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03089427150794729 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.181096200144441e-18 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.181096200144441e-18 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04730818679262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.960152942248941e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250125232029, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120222747, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300450835306 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.81568291912277, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92310246851997, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01274532455113983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.285389427812277e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.285389427812277e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81570355371161 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655086190669431e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854905095393, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708891577, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708891579 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086789645609 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347805551639, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435447803702, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599240898342154 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.717421103006767e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.717421103006767e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348728123731 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291179996932946e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952771547e+00 1.731531270248329e+00 6.173306310586213e-11 2.524158659866771e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_1.out new file mode 100644 index 0000000000..91d5efc4cf --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_4_1_1.out @@ -0,0 +1,469 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480918398010767 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.003886272468077529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674194043493, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967226281753, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164137698822 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469389405397e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634407533082e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.970596152824813e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.675240952507911 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007682656087209085 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404386289653829, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00153410775187103, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472743441796188, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359857790466248 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670603232e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682865918977238, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535551282218148, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550371668616321 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55774369269417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01080099623073331 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306223e+00 1.731993073507874e+00 2.329714199333921e-11 3.659073044559591e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794542729744, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522761020554, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871268367595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654002685442e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74977069074764 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01684727551980917 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868658914024, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433912557463, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127172090488 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892949201e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23943664292217 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006528828278646521 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00236999152469835, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191863710416, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191863710418 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614626991023 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6708677907402 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03240190722051899 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463096872e+00 1.731819882889337e+00 4.649436391446216e-11 3.171818363512102e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458421340622, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240084486997, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733474145002 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614202090989e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01750170982633 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250108435563, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00197688010409814, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300390368028 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98796482152001e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80340866628079 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854911908458, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227506071543212, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060715432122 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086790420591 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7808468031958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952790514e+00 1.731531402623384e+00 4.276623499777088e-11 1.323498133309897e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_0.out new file mode 100644 index 0000000000..8a5caf3396 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_0.out @@ -0,0 +1,436 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484739570785543 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002872021134577523 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674146882004, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967181006723, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164120650628 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469444730164e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634423980587e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.483386286293241e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676051713901 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005550288725063259 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404323881355509, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534114165041092, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472749598439449, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359871835985131 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.45080967336947e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682858593170752, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544249443922, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550358638884499 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844408964292e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853105559693 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00792134563849221 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769381067e+00 1.731993073495719e+00 5.154610072111154e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794539263066, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522757692544, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871262820911 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389983e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76651861107677 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01237684727413916 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868660048197, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433913646269, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127176173512 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24598132523421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004779612504313948 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991524318626, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227519186334588, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191863345882 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614627903846 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322900199585 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376157169292097 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463220070e+00 1.731819882840785e+00 7.670308832530282e-11 1.683408967778632e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458421962382, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240085083887, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733475139817 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614197700071e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04718221193126 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02187885806556827 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250126014113, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120973548, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300453650809 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044311e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.8157053695451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009003158261554924 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854904993055, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708793333, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708793335 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989621 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347804246883 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959595686370691 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952908896e+00 1.731531270248400e+00 7.561573589498494e-11 2.517031028048677e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_0.out new file mode 100644 index 0000000000..2b815a000b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_0.out @@ -0,0 +1,565 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484739570785543, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99923377420859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004061628839918641 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.261188224676155e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.261188224676155e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484739092489631 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518443352071625e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674137449705, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967171951717, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164117240989 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469455795117e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634427270088e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676051713894338, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370295065028044, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.000784909752142059 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.830518996709413e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.830518996709413e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676055870103954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.705857208966444e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404342563461688, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06434270796446e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534112244459035, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472747754680673, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359867629707846 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809675029214e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682860787673002, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535546356166082, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.5503625420419 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853105559414, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093626403272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120227586871812 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.102299192199702e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.102299192199702e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854949834894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271889714640072e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394401e+00 1.731993073495719e+00 6.488076742527937e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794538508985, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522756968625, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871261614381 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654029242241e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76651862332542, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99570927834978, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01750303644230911 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.148830835061795e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.148830835061795e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76654034473584 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144297537687311e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00223586866744231, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433920744618, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.04912720279232 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98718285976718e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.2459813244254, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14685999831622, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006759308947646806 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.729049992208015e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.729049992208015e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24599536081284 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511848546542516e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991520997443, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191860157545, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191860157547 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261463144475 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322899932275, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946535441294, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360221435305671 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.396025428056713e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.396025428056713e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328434722259 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178331477975891e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463274739e+00 1.731819882840792e+00 1.313724684592898e-10 1.682742833963857e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458425788795, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240088757243, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733481262078 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184420337e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04718225429593, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99060733817983, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03093990190491139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.983157730959663e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.983157730959663e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04722612054304 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.96013596045361e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250143306553, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00197688013757429, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300515903591 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964644512875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.815705366597, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92313421404247, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01273212495283929 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.431424283260585e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.431424283260585e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81572924528313 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655080176519261e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854897811197, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060701898749, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060701898751 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989607 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347804136278, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.643544580208, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599239103918983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.062550360780627e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.062550360780627e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348726538357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291178169077933e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953034659e+00 1.731531270248434e+00 2.013786915000537e-10 2.513611541132832e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_1.out new file mode 100644 index 0000000000..c830389d39 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_5_1_1.out @@ -0,0 +1,469 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480683165445265 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004053988672151497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674111510887, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967147050451, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164107864483 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469486223738e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634436316217e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.67525688591453 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007986236836926118 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404323877531033, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534114165267298, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472749598656606, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359871836480545 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809672262975e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682858591084714, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544247441325, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550358635174256 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844417816317e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55729311954163 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01125102526633561 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394184e+00 1.731993073508899e+00 6.466338575705777e-11 4.683364807078760e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00268179453937895, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522757803792, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871263006324 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654024816112e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74898235634708 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01755499643145954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868674431794, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433927454522, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127227954459 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826556093e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23919293845223 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006799198459570063 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991518503224, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191857763095, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191857763097 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629644375 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.66951636300151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0337519319761958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463272502e+00 1.731819882893496e+00 1.291351470200652e-10 3.587685704076193e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458427581809, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240090478537, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733484130901 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184381587e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01617199533266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250125619163, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120594397, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300452228991 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964732983807e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80292351487524 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854905105276, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708901065, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708901067 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086787755202 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7785945816081 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953054848e+00 1.731531408143622e+00 2.215676531136523e-10 1.378700513754438e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_6.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_6.out new file mode 100644 index 0000000000..b28e0097f5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl4_6.out @@ -0,0 +1,266 @@ +Start MRIStep Logging test +Using MERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0005 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.580647662206255e-09 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.287097149330938e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.47191726142557e-06, h_cfl = 1.716129532441251e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.413040570968547e-06, h_cfl = 8.580647662206255e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472582 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.681308618402001e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.716129532441251e-08, h = 1.413040570968547e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.236815808086858e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.236815808086858e-07 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.430201866292959e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.076941723550822e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.418176324027398e-05, h_cfl = 1.413040570968547e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.321449271066302e-05, h_cfl = 7.065202854842734e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.649460766305993e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.430201866292959e-06, h = 2.321449271066302e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.430201866292959e-06 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.303744822162447e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.303744822162447e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.464469457695598e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.884107139929023e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007714727828648842, h_cfl = 2.321449271066302e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004642898542132603, h_cfl = 1.160724635533151e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.140805973034775e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.464469457695598e-05, h = 0.0004642898542132603 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.464469457695598e-05 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002567896216835862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002567896216835862 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004889345487902163 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003728620852369013 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001579461103257322, h_cfl = 4.642898542132604e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001516282659127029, h_cfl = 2.321449271066302e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.265810453033421 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.826224996633818e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004889345487902163, h = 1.106545120978371e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004889345487902163 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004944672743951082 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004944672743951082 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004972336371975541 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0009627071870500957, h_cfl = 1.106545120978371e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002213090241956742, h_cfl = 5.532725604891855e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.889886968307349e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001106545120978371 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001106545120978371 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001659817681467556 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008472366368884156, h_cfl = 2.213090241956742e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.000813347171412879, h_cfl = 1.106545120978371e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.675164961613785 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.425094080723045e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002213090241956742, h = 0.0007786909758043252 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006106545120978368 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006106545120978368 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999994 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008053272560489181 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003338723049155477, h_cfl = 7.786909758043252e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003205174127189258, h_cfl = 3.893454879021626e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.11610539582608 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0001445442462304924 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769278491e+00 1.731993073504249e+00 5.103006905926577e-11 3.375077994860476e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0015 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.001, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00125 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003123484376240414, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002998545001190797, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.9970900023816 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.456665619756245e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002729592859383356, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002620409145008021, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.620409145008024 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932628225837462 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463041408e+00 1.731819882857753e+00 1.019582196448710e-10 1.338928967697939e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0025 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.002, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00225 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002375 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003004917511165991, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002884720810719351, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.769441621438706 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.457617220747888e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002639908311389489, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00253431197893391, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.534311978933912 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934099230043387 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952680496e+00 1.731531270273762e+00 1.527842297122106e-10 1.914024494453770e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 6 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_0.out new file mode 100644 index 0000000000..39d6d55637 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_0.out @@ -0,0 +1,1286 @@ +Start MRIStep Logging test +Using Ex-MRI-GARK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +4.7406846863098245e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6053856682085423e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +-3.7785658061256218e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688734e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6053856310312784e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3408681156627590e-24 +-7.5571315697172442e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688696e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.3210771299314208e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +-4.2508865157902688e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688730e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9080784746839703e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.3210771301878156e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-6.2224519411136004e-13 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075682477e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-5.5709046861272483e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-2.6239714461655333e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075426302e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-5.5709021244515720e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1040548000210391e-22 +-5.2479404791632934e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577931e-23 +-2.9753011668513490e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075391168e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.2903012504834220e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-8.5194859796217894e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508066644420e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0036266807812572e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-7.7662280884078046e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507997501624e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0036197705080342e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768115e-21 +-1.5532349231157368e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507919840413e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8971494422882198e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-9.0564472278026476e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507984599434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4503863368916410e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.8971494422348200e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-2.9360907931865759e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320504983749085e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.9769020554131735e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-3.0595185570055904e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320477324654309e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.9766286211624975e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.6276484389536231e-20 +-6.1181907623552925e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320446737932254e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.7638060803422323e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152176e-20 +-3.5517453331153056e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320472402386546e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8702874510251369e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.7638060394313270e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.3882737364138767e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320445345476552e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.8063965878194383e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.4039831909200959e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320445329767096e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.8063964341772422e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.6457988351929386e-22 +-2.8079662684988434e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320443925784019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.8489869720701411e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947040e-22 +-2.1000836986792525e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320444633666590e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.8276917428533966e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_1(:) = +-6.8064060628792247e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00075 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.5314413641492905e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.8489869720696276e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1297393130425637e-08 +-2.8393851697686186e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448600941959e+00 +1.7320415531932267e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.7008249417963652e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1297393130425637e-08 +-3.4677832692787757e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448600941959e+00 +1.7320409247951274e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.7007638074714753e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2594786260851273e-08 +-6.9354763413723103e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448487968027e+00 +1.7320374571020551e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.5525966116538074e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6946089695638454e-08 +-4.9659920308202206e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448544454993e+00 +1.7320394265863657e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1266961967908885e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448487968027e+00 +1.7320374570582269e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886608518576, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831571144177833, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123678626051 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618640185768e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0002691273172028848 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448487968027e+00 +1.7320374570582269e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.5525966074114877e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006154363413985574 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0607635289351237e-08 +-7.4717771423124676e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448281891673e+00 +1.7320299852810845e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.1064575037149705e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006154363413985574 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0607635289351237e-08 +-9.5627092139555982e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448281891673e+00 +1.7320278943490128e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.1062569894116898e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007499999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1215270578702474e-08 +-1.9124878789146170e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448075815321e+00 +1.7320183321794378e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-8.6600920017551195e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006827181706992786 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0911452934026854e-08 +-1.3559764106430567e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448178853497e+00 +1.7320238972941204e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-7.8832282114519550e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448075815321e+00 +1.7320183319212286e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002342768924220768, h_cfl = 2.691273172028848e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002249058167251937, h_cfl = 1.345636586014424e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.356855746295192 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.061352125450266e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448075815321e+00 +1.7320183319212286e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-1.5308030199797466e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.5300795632542635e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00075, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00075 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448075815321e+00 +1.7320183319212286e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-8.6600919772252427e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9125994540678279e-08 +-1.0825114971531545e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447884555376e+00 +1.7320075068062570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0103457038865726e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9125994540678279e-08 +-1.2629321298582147e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447884555376e+00 +1.7320057025999300e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0103287142769918e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8251989081356559e-08 +-2.5258217856924772e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693295430e+00 +1.7319930737033717e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620498350778e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009374999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.8688991811017417e-08 +-1.8267247774675333e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447788925403e+00 +1.7320000646734539e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0825000539838989e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693295430e+00 +1.7319930735042126e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002092677993913014, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002008970874156493, h_cfl = 1.249999999999999e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.035883496625978 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.534938689302334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247447693295430e+00 +1.7319930735042126e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693295430e+00 +1.7319930735042126e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329543e+00 1.731993073504213e+00 2.242650509742816e-14 2.664535259100376e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693295430e+00 +1.7319930735042126e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-2.0412412826749547e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412412826749547e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693295430e+00 +1.7319930735042126e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479762590e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020688044582544e-08 +-1.9244367466270964e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447353088550e+00 +1.7319738291367464e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3471042808681047e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020688044582544e-08 +-2.2451738014468388e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447353088550e+00 +1.7319706217661981e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3470747017841533e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041376089165088e-08 +-4.4902490059471733e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447012881669e+00 +1.7319481710141531e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.5395094280350119e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031032066873813e-08 +-3.2474481146996852e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447182985109e+00 +1.7319605990230655e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4433004648629949e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447012881669e+00 +1.7319481705628721e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002019467844874993, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001938689131079993, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.816067393239986 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85185275272059e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247447012881669e+00 +1.7319481705628721e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_1(:) = +-2.7218816431900944e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00175 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.5726820938340189e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.0004166666666666664 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447012881669e+00 +1.7319481705628721e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.5395094239233412e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001541666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4430876954875343e-08 +-3.2073112998402921e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446268572899e+00 +1.7319160974498737e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7800447825417720e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001541666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.4430876954875343e-08 +-3.7084266302953558e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446268572899e+00 +1.7319110862965692e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7799998213607038e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.00175 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4886175390975069e-07 +-7.4166659223362606e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445524264131e+00 +1.7318740039036487e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.0205196927351796e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001645833333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1164631543231301e-07 +-5.3746534612451886e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445896418514e+00 +1.7318944240282597e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.9002730638403170e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445524264131e+00 +1.7318740030745077e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002325110420635145, h_cfl = 4.166666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002232106003809739, h_cfl = 2.083333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.357054409143378 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.184752984633551e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247445524264131e+00 +1.7318740030745077e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-3.5720436435653953e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.5713200665942884e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.00175, h = 0.0002499999999999998 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00175 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445524264131e+00 +1.7318740030745077e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.0205196854111016e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001875 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4641500832428567e-08 +-2.5256496067638749e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247445077849122e+00 +1.7318487465784400e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1648176970596372e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001875 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4641500832428567e-08 +-2.7060221213245443e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247445077849122e+00 +1.7318469428532943e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1648019144645875e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9283001664857134e-08 +-5.4120047861614639e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631434115e+00 +1.7318198830266460e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090931457614758e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0019375 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.6962251248642854e-08 +-3.9913792225586784e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247444854641618e+00 +1.7318340892822821e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2369523515123488e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631434115e+00 +1.7318198828576150e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002121473803752882, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002036614851602766, h_cfl = 1.249999999999999e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.146459406411072 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.535440853723494e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247444631434115e+00 +1.7318198828576150e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444631434115e+00 +1.7318198828576150e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143411e+00 1.731819882857615e+00 4.485301019485632e-14 4.218847493575595e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444631434115e+00 +1.7318198828576150e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-4.0824815447279339e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824815447279322e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631434115e+00 +1.7318198828576150e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931442965393e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041359078798852e-08 +-3.8484885738275638e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443951020525e+00 +1.7317813979718768e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5014733557284241e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041359078798852e-08 +-4.1691222595473722e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443951020525e+00 +1.7317781916350194e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5014459237352205e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3608271815759770e-07 +-8.3381530791173987e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443270606932e+00 +1.7317365013268238e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6938122103208478e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206203861819826e-07 +-6.1334129176894448e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443610813729e+00 +1.7317585487284382e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5976377325039196e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443270606932e+00 +1.7317365009469841e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001905013896432126, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001828813340574841, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.486440021724523 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85375335258683e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247443270606932e+00 +1.7317365009469841e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_1(:) = +-4.7631213191499233e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 0, tcur = 0.00275 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.6139210371774139e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0004166666666666659 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247443270606932e+00 +1.7317365009469841e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.6938122071133114e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002541666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1695668827452925e-07 +-5.6121087648193886e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442101040049e+00 +1.7316803798593359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.9342526570773531e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002541666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1695668827452925e-07 +-6.1130263689111418e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442101040049e+00 +1.7316753706832950e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.9342110530871401e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.3391337654905851e-07 +-1.2225879387863062e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247440931473168e+00 +1.7316142421531053e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.1746259855389553e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002645833333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7543503241179387e-07 +-8.9816337681903363e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441516256607e+00 +1.7316466846093022e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0544322406377666e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247440931473168e+00 +1.7316142414635605e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002324933765203915, h_cfl = 4.166666666666659e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002231936414595759, h_cfl = 2.08333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.35664739502983 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.185319915370691e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247440931473168e+00 +1.7316142414635605e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-5.6132824811321762e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.6125587842809045e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.00275, h = 0.00025 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.00275 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247440931473168e+00 +1.7316142414635605e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.1746259799076715e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002875 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.0156984803511302e-08 +-3.9682824748845896e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440229903319e+00 +1.7315745586388116e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.3188566184069873e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002875 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.0156984803511302e-08 +-4.1485707730087344e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440229903319e+00 +1.7315727557558305e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.3188420451026790e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4031396960702260e-07 +-8.2971051127566972e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439528333472e+00 +1.7315312704124328e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630622922103182e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0029375 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0523547720526696e-07 +-6.1552351970712324e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247439879118396e+00 +1.7315526891115898e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3909571391256599e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439528333472e+00 +1.7315312702735641e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002121273546461272, h_cfl = 2.5e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00203642260460282, h_cfl = 1.25e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.145690418411281 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.53635312385524e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247439528333472e+00 +1.7315312702735641e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439528333472e+00 +1.7315312702735641e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952833347e+00 1.731531270273564e+00 6.727951529228449e-14 6.217248937900877e-15 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_0.out new file mode 100644 index 0000000000..00e6054315 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_0.out @@ -0,0 +1,1557 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +4.7406846863098245e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6053856682085423e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +-3.7785658061256218e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688734e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6053856310312784e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3408681156627590e-24 +-7.5571315697172442e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688696e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.3210771299314208e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +-4.2508865157902688e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688730e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9080784746839703e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.3210771301878156e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-6.2224519411136004e-13 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075682477e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-5.5709046861272483e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-2.6239714461655333e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075426302e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-5.5709021244515720e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1040548000210391e-22 +-5.2479404791632934e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577931e-23 +-2.9753011668513490e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075391168e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.2903012504834220e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-8.5194859796217894e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508066644420e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0036266807812572e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-7.7662280884078046e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507997501624e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0036197705080342e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768115e-21 +-1.5532349231157368e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507919840413e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8971494422882198e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-9.0564472278026476e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507984599434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4503863368916410e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.8971494422348200e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-2.9360907931865759e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320504983749085e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.9769020554131735e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-3.0595185570055904e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320477324654309e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.9766286211624975e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.6276484389536231e-20 +-6.1181907623552925e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320446737932254e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.7638060803422323e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152176e-20 +-3.5517453331153056e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320472402386546e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8702874510251369e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.7638060394313270e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.3882737364138767e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320445345476552e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.8063965878194383e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.4039831909200959e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320445329767096e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.8063964341772422e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.6457988351929386e-22 +-2.8079662684988434e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320443925784019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.8489869720701411e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947040e-22 +-2.1000836986792525e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320444633666590e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.8276917428533966e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-6.4149904805965718e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.618808553272737 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0007928652556788505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.9642203176362480e-08 +-6.4149904805965718e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448417493858e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-6.8004777869172742e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.3014327206966917e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448417493858e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.8489884541797879e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006268491234702e-09 +-2.8393862631164633e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448321487588e+00 +1.7320415531921334e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.7008263389618679e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006268491234702e-09 +-3.4677842999632225e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448321487588e+00 +1.7320409247940967e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.7007652046430641e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9201253698246940e-08 +-6.9354784027501833e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448225481321e+00 +1.7320374570999939e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.5525979238878413e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4400940273685204e-08 +-4.9659936003487057e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448273484456e+00 +1.7320394265847963e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1266975514912889e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448225481321e+00 +1.7320374570561652e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886631954655, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831571166676468, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123693875294 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618612523282e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448225481321e+00 +1.7320374570561652e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.5525979196454724e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918495821385e-08 +-5.1581964415835813e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448104582137e+00 +1.7320322988597237e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6252981023261451e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918495821385e-08 +-6.1547026437727703e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448104582137e+00 +1.7320313023535214e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6252022634728430e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4179836991642769e-08 +-1.2309227224721896e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447983682951e+00 +1.7320251478289406e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.6978909351402405e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8134877743732075e-08 +-8.8582980346159097e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448044132543e+00 +1.7320285987581305e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-7.1615721136348051e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447983682951e+00 +1.7320251477434736e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071596762738, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908732892228, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011675525584 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769616071643e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247447983682951e+00 +1.7320251477434736e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.8986267328609749e-08 +-2.5659825403590020e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 10.47508400821115 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00318668913410324 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8267597228318949e-08 +-2.5659825403590020e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247447831239917e+00 +1.7320251477434736e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-1.3599695161688519e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.2551123433845044e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447831239917e+00 +1.7320251477434736e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.6978916891885879e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585205723075047e-08 +-1.2829819481980970e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448207091973e+00 +1.7320123179239917e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.6224321887741396e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585205723075047e-08 +-1.6037386981290222e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448207091973e+00 +1.7320091103564923e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.6221292518436141e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.5170411446150093e-08 +-3.2073764172812027e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448582944032e+00 +1.7319930739793008e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546616075861313e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6377808584612573e-08 +-2.2852869579736191e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448395018004e+00 +1.7320022948738938e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0584455776019856e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448582944032e+00 +1.7319930735042257e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00201351024220627, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969832518019, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909497554061 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85151446454876e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247448582944032e+00 +1.7319930735042257e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3097185780404099e-08 +-5.7734064651482342e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56852920005934 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00721853154020951 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0207894393290694e-07 +-5.7734064651482342e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769312645e+00 1.731993073504226e+00 1.687561201890730e-11 1.043609643147647e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-2.0412409446764196e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412409446764196e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480608726e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020682411273627e-08 +-1.9244367467681190e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447352919625e+00 +1.7319738291367581e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3471042809526759e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020682411273627e-08 +-2.2451738015877908e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447352919625e+00 +1.7319706217662099e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3470747018687246e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041364822547253e-08 +-4.4902490062290774e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447012712802e+00 +1.7319481710141633e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.5395094281195390e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031023616910434e-08 +-3.2474481149111399e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447182816213e+00 +1.7319605990230766e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4433004649475453e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447012712802e+00 +1.7319481705628823e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746961420123, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757082963318, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271248889962 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852819112485e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247447012712802e+00 +1.7319481705628823e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +2.0929494246993597e-08 +-4.4902941343405445e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 18.33117208795071 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.005605053590958301 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-9.7690818613802914e-08 +-4.4902941343405445e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446716218264e+00 +1.7319481705628823e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-2.7212883822533301e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.3426730125679313e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446716218264e+00 +1.7319481705628823e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.5395095722551372e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711216876132133e-08 +-2.5658492870918927e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446159106095e+00 +1.7319225120700115e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7319354609981777e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711216876132133e-08 +-2.8865591016636265e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446159106095e+00 +1.7319193049718657e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7319065971148512e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1142243375226427e-07 +-5.7730219903828313e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445601993927e+00 +1.7318904403429785e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9243228400219578e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.3566825314198200e-08 +-4.2095373969514579e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445880550012e+00 +1.7319060751889128e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8281232071260242e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445601993927e+00 +1.7318904399155015e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280774688737, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189543701188, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568631103569 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341592e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445601993927e+00 +1.7318904399155015e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-7.6105388819637662e-08 +-1.0263358872419914e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 41.89912728820217 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.012810580405903 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2437206693643256e-07 +-1.0263358872419914e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445449405781e+00 +1.7318904399155015e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4012095307805291e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.1386952869695882e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445449405781e+00 +1.7318904399155015e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9243229125162398e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5644921449493123e-09 +-3.2072048541937316e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247445485050701e+00 +1.7318583678669597e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1167277744850593e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5644921449493123e-09 +-3.5278796241417645e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247445485050701e+00 +1.7318551611192601e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1166996263663226e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.1289842898986247e-09 +-7.0556654212210724e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445520695623e+00 +1.7318198832612892e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090927031643102e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.3467382174239681e-09 +-5.1715324399556739e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445502873162e+00 +1.7318387245911020e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2129047418052736e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445520695623e+00 +1.7318198828576272e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236369311113, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042146914538669, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126440743616008 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983467222143e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247445520695623e+00 +1.7318198828576272e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693126450e+00 +1.7319930735042257e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2827222362248019e-07 +-1.7319064659848671e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70323030012283 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02165342185634298 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0624655064708818e-07 +-1.7319064659848671e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463066094e+00 1.731819882857627e+00 7.727218864772567e-11 7.993605777301127e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-4.0824799985838097e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824799985838081e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931446832313e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041333309730115e-08 +-3.8484885744720509e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443950247612e+00 +1.7317813979718826e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5014733561149305e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041333309730115e-08 +-4.1691222601915495e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443950247612e+00 +1.7317781916350252e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5014459241217268e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3608266661946023e-07 +-8.3381530804057535e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443269834277e+00 +1.7317365013268231e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6938122107071688e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206199996459517e-07 +-6.1334129186558253e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443610040945e+00 +1.7317585487284406e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5976377328903322e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443269834277e+00 +1.7317365009469836e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183712206665, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042096363718398, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289091155196 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753308321081e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247443269834277e+00 +1.7317365009469836e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +4.1858968920318391e-08 +-8.3381910643609558e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 34.04320255383404 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01041601086240528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.6573935335000972e-07 +-8.3381910643609558e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442973267411e+00 +1.7317365009469836e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-4.7625267557383589e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.3839107643257537e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442973267411e+00 +1.7317365009469836e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.6938123557830701e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9731846072095748e-08 +-4.4896872596384430e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442075948949e+00 +1.7316916040743873e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8861633883154819e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9731846072095748e-08 +-4.8102723138591286e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442075948949e+00 +1.7316883982238451e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8861366728941101e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7946369214419150e-07 +-9.6204555763136849e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441178630489e+00 +1.7316402963912205e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0784716406485779e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3459776910814362e-07 +-7.0951573545935902e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441627289719e+00 +1.7316655493734376e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.9823129106051893e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441178630489e+00 +1.7316402960352122e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127119983291906, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00204203518396023, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.1261055518807 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673527563141e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441178630489e+00 +1.7316402960352122e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2322444949387241e-07 +-1.7958682241503432e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 73.3217906642831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0224314713676539 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.6047635688466940e-07 +-1.7958682241503432e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441025897374e+00 +1.7316402960352122e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-5.4424469761782791e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.8273725200808788e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441025897374e+00 +1.7316402960352122e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0784717140879586e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0456208668014637e-08 +-5.1307861901465958e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440721335288e+00 +1.7315889881733106e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.2707888835270321e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0456208668014637e-08 +-5.4513148058783852e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440721335288e+00 +1.7315857828871535e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.2707628850945208e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.0912417336029273e-08 +-1.0902542950315065e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247440416773201e+00 +1.7315312706057091e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630618495366805e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5684313002021952e-08 +-8.0567433762313614e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440569054244e+00 +1.7315597286014499e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3669212094406925e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247440416773201e+00 +1.7315312702735406e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045935429419, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964098012242, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892294036728 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790955e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247440416773201e+00 +1.7315312702735406e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630660944e+00 +1.7318198828576272e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.4344713870768440e-07 +-2.8861258408663382e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347848203848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03608300450075731 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1041389615648809e-07 +-2.8861258408663382e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439526521982e+00 +1.7315312702735406e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439526521982e+00 +1.7315312702735406e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439526521982e+00 +1.7315312702735406e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952652198e+00 1.731531270273541e+00 1.810818162084615e-10 2.975397705995420e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_0.out new file mode 100644 index 0000000000..48de1d1887 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_0.out @@ -0,0 +1,1686 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +4.7406846863098245e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6053856682085423e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +-3.7785658061256218e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688734e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6053856310312784e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3408681156627590e-24 +-7.5571315697172442e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688696e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.3210771299314208e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +-4.2508865157902688e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688730e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9080784746839703e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.3210771301878156e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-6.2224519411136004e-13 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075682477e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-5.5709046861272483e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-2.6239714461655333e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075426302e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-5.5709021244515720e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1040548000210391e-22 +-5.2479404791632934e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577931e-23 +-2.9753011668513490e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075391168e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.2903012504834220e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-8.5194859796217894e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508066644420e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0036266807812572e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-7.7662280884078046e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507997501624e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0036197705080342e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768115e-21 +-1.5532349231157368e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507919840413e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8971494422882198e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-9.0564472278026476e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507984599434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4503863368916410e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.8971494422348200e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-2.9360907931865759e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320504983749085e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.9769020554131735e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-3.0595185570055904e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320477324654309e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.9766286211624975e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.6276484389536231e-20 +-6.1181907623552925e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320446737932254e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.7638060803422323e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152176e-20 +-3.5517453331153056e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320472402386546e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8702874510251369e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.7638060394313270e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.3882737364138767e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320445345476552e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.8063965878194383e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.4039831909200959e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320445329767096e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.8063964341772422e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.6457988351929386e-22 +-2.8079662684988434e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320443925784019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.8489869720701411e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947040e-22 +-2.1000836986792525e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320444633666590e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.8276917428533966e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-6.4149904805965718e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.618808553272737, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.703554573296969, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00112125978322437 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 6.161068318927283e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 6.161068318927283e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.618813609683919 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.232026095373332e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.9641005420688385e-08 +-6.4149904805965718e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448417505835e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-6.8004780264424220e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.3014327665355097e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448417505835e+00 +1.7320443925783966e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.8489884541199053e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006271872749394e-09 +-2.8393862630722880e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448321499563e+00 +1.7320415531921336e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.7008263389020068e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006271872749394e-09 +-3.4677842999190633e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448321499563e+00 +1.7320409247940967e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.7007652045831905e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9201254374549879e-08 +-6.9354784026618463e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448225493291e+00 +1.7320374570999939e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.5525979238279899e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4400940780912409e-08 +-4.9659936002824534e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448273496426e+00 +1.7320394265847963e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1266975514314382e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448225493291e+00 +1.7320374570561654e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157886397593916, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831570941690159, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123541382885 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861618889148138e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448225493291e+00 +1.7320374570561654e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.5525979195856459e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918921650215e-08 +-5.1581964415280040e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448104594103e+00 +1.7320322988597239e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6252981022663249e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918921650215e-08 +-6.1547026437171990e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448104594103e+00 +1.7320313023535217e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6252022634130353e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4179837843300430e-08 +-1.2309227224610777e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447983694912e+00 +1.7320251478289408e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.6978909350804536e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8134878382475323e-08 +-8.8582980345325599e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448044144507e+00 +1.7320285987581310e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-7.1615721135750349e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447983694912e+00 +1.7320251477434738e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071501057282, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908641014991, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011626074447 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681770943876267e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247447983694912e+00 +1.7320251477434738e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.8985069623259161e-08 +-2.5659825403367975e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 10.4750840049673, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 14.81400586682223, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.00450658843870752 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.098125567835629e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.098125567835629e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47509900841071 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.162702708411542e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8261555664408316e-08 +-2.5659825403367982e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247447831300333e+00 +1.7320251477434738e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-1.3599696369928014e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.2551126401543000e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447831300333e+00 +1.7320251477434738e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.6978916888865337e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585210669238306e-08 +-1.2829819481477548e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448207152440e+00 +1.7320123179239924e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.6224321884718605e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585210669238306e-08 +-1.6037386980786424e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448207152440e+00 +1.7320091103564930e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.6221292515413379e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.5170421338476612e-08 +-3.2073764171804437e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448583004548e+00 +1.7319930739793019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546616075558840e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6377816003857465e-08 +-2.2852869578980634e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448395078493e+00 +1.7320022948738949e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0584455775717518e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448583004548e+00 +1.7319930735042268e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00201351024912287, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969839157955, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909517473869 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514752241806e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247448583004548e+00 +1.7319930735042268e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3091134176741472e-08 +-5.7734064650372119e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56852919194102, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093362842919, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01020836739073424 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.355663625576664e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.355663625576664e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854611856336 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159124529421133e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0206180734277936e-07 +-5.7734064650372139e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329781e+00 1.731993073504227e+00 2.609024107869118e-13 1.154631945610163e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-2.0412412873733736e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412412873733736e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479751994e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020688122889522e-08 +-1.9244367466253305e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447353090934e+00 +1.7319738291367606e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3471042808670436e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020688122889522e-08 +-2.2451738014450705e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447353090934e+00 +1.7319706217662123e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3470747017830922e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041376245779045e-08 +-4.4902490059436361e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447012884052e+00 +1.7319481710141673e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.5395094280339505e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031032184334287e-08 +-3.2474481146970330e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447182987492e+00 +1.7319605990230797e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4433004648619341e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447012884052e+00 +1.7319481705628863e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746951253171, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757073203045, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271219609141 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852796981838e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247447012884052e+00 +1.7319481705628863e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +2.0929497637687065e-08 +-4.4902941340518865e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 18.33117208679076, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 25.9241921793346, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.007926620801967321 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.96020189895167e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.96020189895167e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3311884590036 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 6.923065181149995e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-9.7682254961199432e-08 +-4.4902941340518851e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446716475265e+00 +1.7319481705628863e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-2.7212888961780846e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.3426736829498941e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446716475265e+00 +1.7319481705628863e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.5395095721266730e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711228049164844e-08 +-2.5658492868777858e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446159362985e+00 +1.7319225120700175e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7319354608697871e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711228049164844e-08 +-2.8865591014496422e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446159362985e+00 +1.7319193049718717e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7319065969864589e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1142245609832969e-07 +-5.7730219899548574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445602250704e+00 +1.7318904403429867e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9243228398936435e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.3566842073747260e-08 +-4.2095373966304324e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445880806844e+00 +1.7319060751889199e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8281232069976711e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445602250704e+00 +1.7318904399155099e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280769804621, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189539012436, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568617037314 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341067341581e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445602250704e+00 +1.7318904399155099e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-7.6096821626861300e-08 +-1.0263358871687167e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 41.8991272714572, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 59.25431403889118, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01811631882340358 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.767859298135969e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.767859298135969e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.89916487967248 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.734177522130014e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2434355129501485e-07 +-1.0263358871687166e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445449862302e+00 +1.7318904399155099e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4012104436553081e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.1387043260750549e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445449862302e+00 +1.7318904399155099e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9243229122880540e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5645072101250903e-09 +-3.2072048538134219e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247445485507373e+00 +1.7318583678669719e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1167277742568300e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5645072101250903e-09 +-3.5278796237613817e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247445485507373e+00 +1.7318551611192723e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1166996261380933e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.1290144202501806e-09 +-7.0556654204603081e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445521152447e+00 +1.7318198832613054e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090927029360395e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.3467608151876354e-09 +-5.1715324393851288e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445503329910e+00 +1.7318387245911162e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2129047415770239e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445521152447e+00 +1.7318198828576432e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236364007833, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042146909447519, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.12644072834256 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983533617987e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247445521152447e+00 +1.7318198828576432e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297815e+00 +1.7319930735042268e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2824366285310272e-07 +-1.7319064658360972e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70323025789027, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946713429621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0306210098787736 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 8.142537668128806e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 8.142537668128806e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328103277684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884719277568e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0618350816911757e-07 +-1.7319064658360969e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146273e+00 1.731819882857643e+00 2.906785923073585e-12 2.398081733190338e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-4.0824816018169901e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824816018169885e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931442824741e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041360030283111e-08 +-3.8484885738041220e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443951049133e+00 +1.7317813979719052e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5014733557143637e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041360030283111e-08 +-4.1691222595239378e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443951049133e+00 +1.7317781916350479e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5014459237211584e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3608272006056622e-07 +-8.3381530790705246e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443270635534e+00 +1.7317365013268524e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6938122103067885e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206204004542467e-07 +-6.1334129176542881e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443610842332e+00 +1.7317585487284666e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5976377324898597e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443270635534e+00 +1.7317365009470129e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183706742662, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042096358472956, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289075418868 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753396852466e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247443270635534e+00 +1.7317365009470129e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +4.1858985509180174e-08 +-8.3381910630286882e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 34.04320254847141, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 48.14435875066259, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0147300815422269 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.475993886304119e-19 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.475993886304119e-19 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.04323020408164 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.451037074099789e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.6572327087728307e-07 +-8.3381910630286882e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442974230025e+00 +1.7317365009470129e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-4.7625286804467356e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.3839129827779704e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442974230025e+00 +1.7317365009470129e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.6938123553020099e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9731883046299362e-08 +-4.4896872588366755e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442076911195e+00 +1.7316916040744246e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8861633878346699e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9731883046299362e-08 +-4.8102723130577751e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442076911195e+00 +1.7316883982238824e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8861366724132981e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7946376609259872e-07 +-9.6204555747109779e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441179592364e+00 +1.7316402963912658e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0784716401680123e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3459782456944902e-07 +-7.0951573533914052e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441628251778e+00 +1.7316655493734789e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.9823129101245016e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441179592364e+00 +1.7316402960352575e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00212711997753779, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042035178436279, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126105535308846 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.85467361609875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441179592364e+00 +1.7316402960352575e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2320835026909067e-07 +-1.7958682238572443e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 73.32179062888304, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 103.6926707248469, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03172118985328261 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.528691940896443e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.528691940896443e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.32185080179332 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.155370726632578e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.6042450720410523e-07 +-1.7958682238572449e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441027217663e+00 +1.7316402960352575e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-5.4424496159413780e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.8273718840660529e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441027217663e+00 +1.7316402960352575e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0784717134281880e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0456198067767541e-08 +-5.1307861890469783e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440722655683e+00 +1.7315889881733670e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.2707888828672921e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0456198067767541e-08 +-5.4513148047788179e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440722655683e+00 +1.7315857828872097e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.2707628844347791e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.0912396135535082e-08 +-1.0902542948115926e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247440418093700e+00 +1.7315312706057764e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630618488769682e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5684297101651305e-08 +-8.0567433745819931e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440570374692e+00 +1.7315597286015116e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3669212087809663e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247440418093700e+00 +1.7315312702736079e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045936851595, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964099377531, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892298132595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748234790828e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247440418093700e+00 +1.7315312702736079e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631462734e+00 +1.7318198828576432e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.4339519787613935e-07 +-2.8861258403534151e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347847337331, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435506897594, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05102477837646521 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.409058797851785e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.409058797851785e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348693449266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999452862407404e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1030245465525719e-07 +-2.8861258403534151e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439528438187e+00 +1.7315312702736079e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439528438187e+00 +1.7315312702736079e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439528438187e+00 +1.7315312702736079e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952843819e+00 1.731531270273608e+00 1.053868103895184e-11 3.752553823233029e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_1.out new file mode 100644 index 0000000000..14421fb266 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_1_1_1.out @@ -0,0 +1,1590 @@ +Start MRIStep Logging test +Using Im-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.144086354960834e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +4.7406846863098245e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6053856682085423e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 5.72043177480417e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.7043405783137950e-25 +-3.7785658061256218e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688734e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6053856310312784e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3408681156627590e-24 +-7.5571315697172442e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688696e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.3210771299314208e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +-4.2508865157902688e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688730e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9080784746839703e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 9.812781742837131e-07, h_cfl = 1.144086354960834e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 9.420270473123646e-07, h_cfl = 5.72043177480417e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.054311027668149e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.144086354960834e-08, h = 9.420270473123646e-07 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.144086354960834e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.3210771301878156e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-6.2224519411136004e-13 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075682477e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-5.5709046861272483e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 4.824543872057906e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.5202740001051954e-23 +-2.6239714461655333e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075426302e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-5.5709021244515720e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1040548000210391e-22 +-5.2479404791632934e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 7.179611490338818e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577931e-23 +-2.9753011668513490e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075391168e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.2903012504834220e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.612117549351599e-05, h_cfl = 9.420270473123646e+23 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.547632847377535e-05, h_cfl = 4.710135236561823e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.125318529963199e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 9.534679108619729e-07, h = 1.547632847377535e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 9.534679108619729e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075163905e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1009699095050957e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-8.5194859796217894e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508066644420e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0036266807812572e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.691632147749645e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.0691210973840574e-22 +-7.7662280884078046e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507997501624e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0036197705080342e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768115e-21 +-1.5532349231157368e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507919840413e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8971494422882198e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.256071426619348e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-9.0564472278026476e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507984599434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4503863368916410e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005706037288326979, h_cfl = 1.547632847377535e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0003095265694755069, h_cfl = 7.738164236887673e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.253820759884639e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 1.642979638463732e-05, h = 0.0003095265694755069 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.642979638463732e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507919839878e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.8971494422348200e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-2.9360907931865759e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320504983749085e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.9769020554131735e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001711930811223908 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8138242194768116e-20 +-3.0595185570055904e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320477324654309e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.9766286211624975e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.6276484389536231e-20 +-6.1181907623552925e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320446737932254e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.7638060803422323e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002485747234912675 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152176e-20 +-3.5517453331153056e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320472402386546e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8702874510251369e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001387641353489307, h_cfl = 3.09526569475507e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001332135699349735, h_cfl = 1.547632847377535e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.303784652823311 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.606776744248313e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0003259563658601442, h = 7.376967473189085e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003259563658601442 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320446733750288e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.7638060394313270e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.3882737364138767e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320445345476552e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.8063965878194383e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003296448495967387 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.3228994175964693e-22 +-1.4039831909200959e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320445329767096e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.8063964341772422e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.6457988351929386e-22 +-2.8079662684988434e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320443925784019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.8489869720701411e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000331489091465036 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947040e-22 +-2.1000836986792525e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320444633666590e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.8276917428533966e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005832695060001238, h_cfl = 7.376967473189085e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001475393494637817, h_cfl = 3.688483736594543e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.165109125384501e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320443925783966e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-6.4149904805965718e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.617700682819475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001112474382861515 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.9641006763474470e-08 +-6.4149893193238363e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448417505822e+00 +1.7320443925795579e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0003333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-6.8004779681096115e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.3014327553721429e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0003333333333333333, h = 0.0001475393494637817 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0003333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448417505822e+00 +1.7320443925795579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.8489884542335137e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006271049231454e-09 +-2.8393862631560964e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448321499550e+00 +1.7320415531932947e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.7008263390150323e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004071030080652242 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6006271049231454e-09 +-3.4677843000024419e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448321499550e+00 +1.7320409247952580e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.7007652046962285e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.9201254209846291e-08 +-6.9354784028286211e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448225493280e+00 +1.7320374571011550e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.5525979239404187e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004439878454311696 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4400940657384719e-08 +-4.9659936004076906e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448273496415e+00 +1.7320394265859576e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1266975515441897e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448225493280e+00 +1.7320374570573265e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008157885905437562, h_cfl = 1.475393494637817e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0007831570469220059, h_cfl = 7.376967473189085e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.308123221149604 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.861619470059087e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.000480872682797115, h = 0.0001857939838695515 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000480872682797115 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448225493280e+00 +1.7320374570573265e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.5525979196980872e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918817945895e-08 +-5.1581964416324585e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448104594092e+00 +1.7320322988608849e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.6252981023780522e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005737696747318907 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2089918817945895e-08 +-6.1547026438209902e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448104594092e+00 +1.7320313023546827e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.6252022635247612e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006666666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4179837635891790e-08 +-1.2309227224818356e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447983694904e+00 +1.7320251478301016e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.6978909351914260e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006202181706992786 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8134878226918844e-08 +-8.8582980346884970e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448044144498e+00 +1.7320285987592918e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-7.1615721136863597e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447983694904e+00 +1.7320251477446347e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002154071651456697, h_cfl = 1.857939838695515e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002067908785398429, h_cfl = 9.289699193477576e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 11.13011703786026 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.681769782044082e-07 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247447983694904e+00 +1.7320251477446347e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.8985070889176265e-08 +-2.5659824242518781e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 10.47064411639136 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004452567171048158 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8261593085000358e-08 +-2.5659819594634788e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247447831299958e+00 +1.7320251477492825e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0006666666666666666 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-1.3599696071986899e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.2551125667799669e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0006666666666666666, h = 0.0003333333333333331 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447831299958e+00 +1.7320251477492825e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.6978916894434646e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585209446332754e-08 +-1.2829819482405766e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448207152052e+00 +1.7320123179298001e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.6224321890223133e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008333333333333332 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.7585209446332754e-08 +-1.6037386981703845e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448207152052e+00 +1.7320091103623008e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.6221292520917906e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.5170418892665509e-08 +-3.2073764173639280e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448583004148e+00 +1.7319930739851088e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546616076102816e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009166666666666665 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6377814169499138e-08 +-2.2852869580360814e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448395078100e+00 +1.7320022948797023e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0584455776264734e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448583004148e+00 +1.7319930735100337e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002013510190539819, h_cfl = 3.333333333333331e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001932969782918226, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.798909348754682 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851514785420889e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247448583004148e+00 +1.7319930735100337e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3091174144770359e-08 +-5.7734058843461611e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55851273849144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01002676147689013 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0206204432033357e-07 +-5.7734048376839718e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329545e+00 1.731993073520500e+00 2.398081733190338e-14 1.628497336980672e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-2.0412412012675116e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412412012675116e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620481282695e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020686687791822e-08 +-1.9244367468804470e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447353088579e+00 +1.7319738291530316e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3471042810182754e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.4020686687791822e-08 +-2.2451738016971235e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447353088579e+00 +1.7319706217824833e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3470747019343243e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041373375583644e-08 +-4.4902490064477434e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447012881711e+00 +1.7319481710304359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.5395094281833455e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031030031687733e-08 +-3.2474481150762625e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447182985145e+00 +1.7319605990393494e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4433004650122458e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447012881711e+00 +1.7319481705791546e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002299746983550014, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002207757104208013, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.623271312624047 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.851852664152388e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247447012881711e+00 +1.7319481705791546e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001333333333333333 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +2.0929496771200669e-08 +-4.4902941345625891e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 18.3233881738182 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.007796994789490233 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-9.7682370106868261e-08 +-4.4902933206867404e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446716471744e+00 +1.7319481705872934e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001333333333333333 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-2.7212887670995334e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.3426735146055989e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001333333333333333, h = 0.000333333333333333 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446716471744e+00 +1.7319481705872934e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.5395095723508104e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711225243426592e-08 +-2.5658492872513480e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446159359492e+00 +1.7319225120944208e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7319354610911633e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5711225243426592e-08 +-2.8865591018186027e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446159359492e+00 +1.7319193049962753e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7319065972078385e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1142245048685318e-07 +-5.7730219906927891e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445602247240e+00 +1.7318904403673865e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9243228401122625e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.3566837865139879e-08 +-4.2095373971856035e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445880803365e+00 +1.7319060752133215e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8281232072176698e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445602247240e+00 +1.7318904399399098e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127280759621378, h_cfl = 3.33333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042189529236523, h_cfl = 1.666666666666665e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126568587709575 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852341133666858e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445602247240e+00 +1.7318904399399098e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-7.6096937630647958e-08 +-1.0263358059048322e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 41.88133272968303 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01782130916736245 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2434430386004631e-07 +-1.0263356198793709e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445449852408e+00 +1.7318904399585122e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4012102088583200e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +2.1387018918020461e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445449852408e+00 +1.7318904399585122e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9243229126752426e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5645031530034089e-09 +-3.2072048544587364e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247445485497439e+00 +1.7318583679099677e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1167277746392044e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5645031530034089e-09 +-3.5278796243986730e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247445485497439e+00 +1.7318551611622683e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1166996265204699e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.1290063060068177e-09 +-7.0556654217348975e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445521142470e+00 +1.7318198833042948e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090927033136022e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.3467547295051133e-09 +-5.1715324403440764e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445503319956e+00 +1.7318387246341087e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2129047419569908e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445521142470e+00 +1.7318198829006328e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127236384874792, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0020421469294798, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126440788439403 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.852983334309895e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247445521142470e+00 +1.7318198829006328e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295446e+00 +1.7319930735205002e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2824442733098544e-07 +-1.7319061986742490e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.67317810828131 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.030079277696704 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0618611407134861e-07 +-1.7319058846938736e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143431e+00 1.731819882932031e+00 6.394884621840902e-14 7.441158800247649e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-4.0824811730309811e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824811730309795e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931449413818e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041352883849631e-08 +-3.8484885749023016e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443951020778e+00 +1.7317813980462817e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5014733563648733e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002166666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8041352883849631e-08 +-4.1691222606081210e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443951020778e+00 +1.7317781917094248e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5014459243716736e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002333333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3608270576769926e-07 +-8.3381530812389086e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443270607248e+00 +1.7317365014012185e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6938122109489104e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206202932577445e-07 +-6.1334129192858173e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443610814013e+00 +1.7317585488028380e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5976377331361755e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443270607248e+00 +1.7317365010213788e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127183703426417, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00204209635528936, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126289065868082 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.853753352378277e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247443270607248e+00 +1.7317365010213788e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002333333333333334 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +4.1858981030688257e-08 +-8.3381910652047253e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 34.02874272231963 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.6571630018547195e-07 +-8.3346426265853518e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442974271303e+00 +1.7317365365057649e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002333333333333334 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-4.7623509692290599e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.3835732820104853e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002333333333333334, h = 0.0003333333333333328 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002333333333333334 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442974271303e+00 +1.7317365365057649e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.6938126555552749e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9726221366841274e-08 +-4.4896877592587839e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442077009090e+00 +1.7316916396281723e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8861636840667337e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.9726221366841274e-08 +-4.8102728067778817e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442077009090e+00 +1.7316884337776970e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8861369686463573e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002666666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7945244273368255e-07 +-9.6204565621545087e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441179746876e+00 +1.7316403319401432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0784719323815268e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002583333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3458933205026190e-07 +-7.0951580964858881e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441628377982e+00 +1.7316655849247999e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.9823132043473349e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441179746876e+00 +1.7316403315841351e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00212711997252938, h_cfl = 3.333333333333328e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002042035173628204, h_cfl = 1.666666666666664e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.126105520884623 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.854673693492052e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441179746876e+00 +1.7316403315841351e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002666666666666667 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.2320155498819360e-07 +-1.7955134789571225e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 73.2761708669783 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.6039715834514013e-07 +-1.7947493797855279e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441027462722e+00 +1.7316404079940522e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002666666666666667 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-5.4418903119967310e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.8285683670685908e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002666666666666667, h = 0.0003333333333333332 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441027462722e+00 +1.7316404079940522e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0784726338557328e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0476139451143170e-08 +-5.1307877230928863e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440722701328e+00 +1.7315891001168213e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.2707897908296096e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002833333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0476139451143170e-08 +-5.4513163180493475e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440722701328e+00 +1.7315858948308718e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.2707637924000710e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.0952278902286340e-08 +-1.0902545974666899e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247440417939932e+00 +1.7315313825343055e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630627443820799e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002916666666666666 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5714209176714749e-08 +-8.0567456522817436e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440570320631e+00 +1.7315598405375294e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3669221105147978e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247440417939932e+00 +1.7315313822021372e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002127045936467591, h_cfl = 3.333333333333332e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002041964099008887, h_cfl = 1.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.125892297026663 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.855748275024137e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247440417939932e+00 +1.7315313822021372e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434306e+00 +1.7318198829320308e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-2.4340775053934476e-07 +-2.8850072989361486e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7390695187308 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1027398181664359e-07 +-2.8837794046078020e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439528694488e+00 +1.7315315049915700e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = -1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439528694488e+00 +1.7315315049915700e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439528694488e+00 +1.7315315049915700e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952869449e+00 1.731531504991570e+00 3.616884569623835e-11 2.347179997030935e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_0.out new file mode 100644 index 0000000000..9102cd9aab --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_0.out @@ -0,0 +1,1620 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +6.1989172313708505e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.6371994311708601e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +-6.4606546253197653e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688708e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.6371993670721352e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7533185641265866e-24 +-1.2921309154747402e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688643e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.7274398799278809e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3149889230949401e-24 +-7.2682364172830469e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.2955799098182033e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.7274398800560780e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-1.0639251752699482e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075678007e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.2845130562184719e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-4.4865103090255557e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075239995e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.2845086762910995e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4436615757196633e-22 +-8.9730152228821661e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0827461817897473e-22 +-5.0872192687095676e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075179923e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0840394303739344e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.4566758729363121e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508060224584e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3123431954948648e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.3278839880753896e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507942002945e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3123313822883717e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134609e-21 +-2.6557440699533699e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507809216936e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.4807117632403230e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7788168196350954e-21 +-1.5484858693447888e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507919942756e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8965245322040000e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.4807117631208860e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.0201767961106226e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320502789038943e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5850485697902034e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.2313215262676757e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320455496000478e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5845826971662583e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.7435115190269222e-20 +-1.0460757494550389e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320403201640795e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-4.9215386380348593e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5576336392701913e-20 +-6.0727889759923864e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320447081325980e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.7531810140477219e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-4.9215385478418264e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.3736874368566389e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320400818670278e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.9772295306148802e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.4005475304776807e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320400791810187e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.9772292697325332e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1305242791872246e-21 +-4.8010948093051328e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320398391262908e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.0329202291137985e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.4789320939041850e-22 +-3.5907486669449202e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320399601609049e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.0050748175839127e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-1.0968442598846551e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 4.47758963593855 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.001381168840186244 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8971386607453142e-11 +-1.0968442598846551e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448713726174e+00 +1.7320398391262783e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-8.8970878322398587e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8740779602967195e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.4420787267032387e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713726174e+00 +1.7320398391262783e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.0329202300611685e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910463661956914e-08 +-4.8548149748970629e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448574621538e+00 +1.7320349843113034e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.1467840061051257e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910463661956914e-08 +-5.9292612789800244e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448574621538e+00 +1.7320339098649993e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.1466803745250223e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7820927323913828e-08 +-1.1858322629439841e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448435516901e+00 +1.7320279808036489e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.2605326304862286e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0865695492935375e-08 +-8.4909002757694385e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448505069221e+00 +1.7320313482260026e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.7036339799890432e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448435516901e+00 +1.7320279807073891e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545729167712, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029963900001004, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.162276829080684 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.44270566101614e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448435516901e+00 +1.7320279807073891e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.2605326212637517e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276585468868413e-09 +-3.2361773108397287e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448371240315e+00 +1.7320247445300783e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.7751969210255026e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276585468868413e-09 +-3.4655743835435070e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448371240315e+00 +1.7320245151330056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.7751750110986395e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2855317093773683e-08 +-6.9311292356250966e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448306963731e+00 +1.7320210495781534e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-8.2898362024615493e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6414878203302599e-09 +-5.1123304353456857e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448339102023e+00 +1.7320228683769536e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.0325114855944707e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448306963731e+00 +1.7320210495688495e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024868239103, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480983041563123e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247448306963731e+00 +1.7320210495688495e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.5303701232409777e-08 +-2.9758000027690912e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 12.14796270537412 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.003729401476593421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.5324396569906511e-08 +-2.9758000027690912e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247448360671924e+00 +1.7320210495688495e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-1.4654750482267112e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4560825977706726e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.6083546068275961e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448360671924e+00 +1.7320210495688495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-8.2898359330347199e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993177861804168e-08 +-1.1691434952567602e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447710740145e+00 +1.7320093581338969e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.9183578730413904e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993177861804168e-08 +-1.3988194319606989e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447710740145e+00 +1.7320070613745300e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.9181413493690529e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2998635572360834e-07 +-2.7975777897951721e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447060808367e+00 +1.7319930737909515e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546623668960283e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.7489766792706259e-08 +-2.0120781181172802e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447385774257e+00 +1.7320009287876683e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0732441997669399e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447060808367e+00 +1.7319930735042068e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001522938943322793, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021385589881, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246310781768 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422835575235e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247447060808367e+00 +1.7319930735042068e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3025724429055542e-07 +-5.7734064670356133e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56857053242068 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007204341456067922 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3024355617993035e-07 +-5.7734064670356133e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447411480328e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-2.0412413291850040e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6362972301911524e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769310943e+00 1.731993073504207e+00 1.857802800486752e-11 8.437694987151190e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-2.0412412822468201e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +3.7152058512715457e-11 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412409107262348e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480692074e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485428765950111e-08 +-2.5163926520487908e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447248255139e+00 +1.7319679095776863e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.4063038210989059e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485428765950111e-08 +-3.0648037734321698e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447248255139e+00 +1.7319624254664725e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.4062534328410545e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970857531900223e-08 +-6.1293879213175935e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446803400850e+00 +1.7319317796249936e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.6578818115831298e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.6728143148925164e-08 +-4.3914709544624431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447025827993e+00 +1.7319491587946623e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.5320820430434803e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446803400850e+00 +1.7319317786241679e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109904163659, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225507997112, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095588097819 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573793277643e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247446803400850e+00 +1.7319317786241679e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-8.8970873763541570e-08 +-6.1294880038920141e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 25.02295754400714 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007673490841823296 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8999322153602641e-08 +-6.1294880038920141e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446803116204e+00 +1.7319317786241679e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-2.9309497138466301e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8684663167164401e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.4833189058418632e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446803116204e+00 +1.7319317786241679e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.6578818026752318e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126420276197904e-08 +-2.3381665706775094e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446311852002e+00 +1.7319083969584612e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8207064310861676e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126420276197904e-08 +-2.5678036307013935e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446311852002e+00 +1.7319061005878609e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8206858814778498e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8252840552395807e-08 +-5.1355492977926776e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445820587799e+00 +1.7318804231311899e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9835032489237425e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.3689630414296852e-08 +-3.7655704522133223e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446066219900e+00 +1.7318941229196458e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.9021006507330826e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445820587799e+00 +1.7318804228755065e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738579556575, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429036374312, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684100018917118 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925979834815e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445820587799e+00 +1.7318804228755065e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.8186067383144968e-07 +-1.1265062870036147e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.9883942369528 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01409326137946229 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8189698061615481e-07 +-1.1265062870036147e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445874139620e+00 +1.7318804228755065e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-3.5067156723683432e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4473472738764811e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-6.6495939977230599e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445874139620e+00 +1.7318804228755065e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9835032198838284e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781464812299475e-08 +-2.7974014275805879e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247444936324972e+00 +1.7318524488612306e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1463126779703690e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781464812299475e-08 +-3.0270170923847948e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247444936324972e+00 +1.7318501527045826e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1462925620562501e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8756292962459895e-07 +-6.0539774444665648e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443998510323e+00 +1.7318198831010618e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090934628683152e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4067219721844919e-07 +-4.4543992409502643e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247444467417647e+00 +1.7318358788830970e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2276991516131775e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443998510323e+00 +1.7318198828575890e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990625018675, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551000017928, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874500620789 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213435739734e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247443998510323e+00 +1.7318198828575890e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693109426e+00 +1.7319930735042068e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.3440645615226613e-07 +-1.7319064661780459e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70326789489285 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02163921128613955 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.3441450778033596e-07 +-1.7319064661780459e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444348964347e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-4.0824816379673008e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6493849413305985e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463059331e+00 1.731819882857589e+00 8.403544526913720e-11 3.019806626980426e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-4.0824815440909770e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.6805587464310136e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824798635322320e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931447167165e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970814862306007e-08 +-5.0322819841335137e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443740885162e+00 +1.7317695600377476e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5606520962985807e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970814862306007e-08 +-5.5805126100350226e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443740885162e+00 +1.7317640777314887e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5606053794954092e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7794162972461201e-07 +-1.1160821597165102e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442851177015e+00 +1.7317082746416175e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.8121399619441229e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3345622229345902e-07 +-8.1651093910280195e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443296031089e+00 +1.7317382317636787e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6863875455863734e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442851177015e+00 +1.7317082738005309e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765825198395, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535192190459, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.858219403642281 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125643031044e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247442851177015e+00 +1.7317082738005309e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.7794170290316275e-07 +-1.1160905705809299e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 45.56773766995966 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01396408830693848 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.7797958485633952e-07 +-1.1160905705809299e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442850797463e+00 +1.7317082738005309e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-4.9721891792775487e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8534867899909999e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.5245564069139781e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442850797463e+00 +1.7317082738005309e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.8121399550888826e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7914680573877736e-08 +-3.9660557371733406e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442071650658e+00 +1.7316686132431591e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.9748984565606490e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7914680573877736e-08 +-4.1955995361466861e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442071650658e+00 +1.7316663178051694e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.9748794455898686e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5582936114775547e-07 +-8.3911454486679929e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441292503851e+00 +1.7316243623460443e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.1376260897898284e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1687202086081662e-07 +-6.2073013159148806e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441682077254e+00 +1.7316462007873719e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0562590431165032e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441292503851e+00 +1.7316243621336684e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553829678998, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251676491838, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471231974887 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193419476551e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441292503851e+00 +1.7316243621336684e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.2841752652787474e-07 +-1.9552072392059472e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 79.82720625180357 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02445379030807663 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.2846939891931796e-07 +-1.9552072392059472e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441345899321e+00 +1.7316243621336684e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-5.5479545435088392e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4292508480873240e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.6908291255826428e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441345899321e+00 +1.7316243621336684e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.1376260613531509e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2256969163976328e-07 +-4.4250997604921629e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440120202404e+00 +1.7315801111360636e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.3003602008215271e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2256969163976328e-07 +-4.6546092009112194e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440120202404e+00 +1.7315778160416593e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.3003416242761002e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4513938327952656e-07 +-9.3091660035664884e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247438894505489e+00 +1.7315312704736328e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630626096139167e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8385453745964491e-07 +-6.8958292713458005e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247439507353948e+00 +1.7315554038409551e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3817084458784386e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247438894505489e+00 +1.7315312702734804e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820260655438, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00181038745022922, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294674055113 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668466049585e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247438894505489e+00 +1.7315312702734804e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444630593312e+00 +1.7318198828575890e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.3855544036051835e-07 +-2.8861258410861623e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8348216738145 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0360687584086095 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3858518292645864e-07 +-2.8861258410861623e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439244741483e+00 +1.7315312702734804e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-6.1237199059593060e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6718219058562805e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439526370172e+00 +1.7315312702734804e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439526370172e+00 +1.7315312702734804e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952637017e+00 1.731531270273480e+00 1.962627838025810e-10 8.992806499463768e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_0.out new file mode 100644 index 0000000000..56a246dad8 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_0.out @@ -0,0 +1,1749 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +6.1989172313708505e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.6371994311708601e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +-6.4606546253197653e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688708e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.6371993670721352e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7533185641265866e-24 +-1.2921309154747402e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688643e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.7274398799278809e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3149889230949401e-24 +-7.2682364172830469e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.2955799098182033e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.7274398800560780e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-1.0639251752699482e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075678007e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.2845130562184719e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-4.4865103090255557e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075239995e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.2845086762910995e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4436615757196633e-22 +-8.9730152228821661e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0827461817897473e-22 +-5.0872192687095676e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075179923e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0840394303739344e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.4566758729363121e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508060224584e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3123431954948648e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.3278839880753896e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507942002945e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3123313822883717e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134609e-21 +-2.6557440699533699e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507809216936e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.4807117632403230e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7788168196350954e-21 +-1.5484858693447888e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507919942756e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8965245322040000e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.4807117631208860e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.0201767961106226e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320502789038943e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5850485697902034e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.2313215262676757e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320455496000478e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5845826971662583e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.7435115190269222e-20 +-1.0460757494550389e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320403201640795e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-4.9215386380348593e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5576336392701913e-20 +-6.0727889759923864e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320447081325980e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.7531810140477219e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-4.9215385478418264e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.3736874368566389e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320400818670278e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.9772295306148802e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.4005475304776807e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320400791810187e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.9772292697325332e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1305242791872246e-21 +-4.8010948093051328e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320398391262908e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.0329202291137985e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.4789320939041850e-22 +-3.5907486669449202e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320399601609049e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.0050748175839127e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-1.0968442598846551e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.47758963593855, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 6.332267989885506, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.001953262537596359 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42665892042333e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42665892042333e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.477589426294661 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.39281563810194e-09, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.6881753582792283e-11 +-1.0968442598846546e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448713747071e+00 +1.7320398391262783e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-8.8970878322246785e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8744959080927067e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.4420787623571244e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713747071e+00 +1.7320398391262783e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.0329202299566819e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910464005878555e-08 +-4.8548149747962736e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448574642430e+00 +1.7320349843113036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.1467840060006905e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910464005878555e-08 +-5.9292612788792851e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448574642430e+00 +1.7320339098649995e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.1466803744205871e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7820928011757110e-08 +-1.1858322629238362e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448435537791e+00 +1.7320279808036492e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.2605326303817899e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0865696008817833e-08 +-8.4909002756183143e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448505090111e+00 +1.7320313482260028e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.7036339798846212e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448435537791e+00 +1.7320279807073891e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545630537986, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029963805316466, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.162276780001601 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705992966839e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448435537791e+00 +1.7320279807073891e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.2605326211593005e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276587058039642e-09 +-3.2361773107931728e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448371261205e+00 +1.7320247445300783e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.7751969209210514e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276587058039642e-09 +-3.4655743834969511e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448371261205e+00 +1.7320245151330056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.7751750109941897e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2855317411607928e-08 +-6.9311292355319857e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448306984616e+00 +1.7320210495781536e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-8.2898362023571329e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6414880587059463e-09 +-5.1123304352758512e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448339122911e+00 +1.7320228683769539e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.0325114854900584e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448306984616e+00 +1.7320210495688497e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024156162993, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480987744230228e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247448306984616e+00 +1.7320210495688497e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.5301611032315305e-08 +-2.9758000027468867e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 12.14796270362833, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 17.17981361067371, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.005274126908187331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.872043759800531e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.872043759800531e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14796838587409 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.951101105650146e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.5316630590410054e-08 +-2.9758000027468860e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247448360749584e+00 +1.7320210495688497e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-1.4654750482174185e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4576357887299533e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.6083542769079699e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448360749584e+00 +1.7320210495688497e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-8.2898359326464444e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993173208836513e-08 +-1.1691434952020005e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447710817851e+00 +1.7320093581338978e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.9183578726529387e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993173208836513e-08 +-1.3988194319059144e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447710817851e+00 +1.7320070613745306e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.9181413489805761e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2998634641767303e-07 +-2.7975777896855958e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447060886121e+00 +1.7319930737909528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546623668571636e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.7489759813254763e-08 +-2.0120781180351096e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447385851986e+00 +1.7320009287876694e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0732441997280862e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447060886121e+00 +1.7319930735042082e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00152293912788855, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021562773008, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246938942064 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422957291812e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247447060886121e+00 +1.7319930735042082e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3024946535398598e-07 +-5.7734064669023866e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56857051892312, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33099207360777, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01018828512419516 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.097815390178688e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.097815390178688e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56859237983746 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.159120204033942e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3022471426414292e-07 +-5.7734064669023872e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447411668746e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-2.0412413291536011e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6325289350319049e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329784e+00 1.731993073504208e+00 2.637889906509372e-13 7.105427357601002e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-2.0412412822154170e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-5.3089134668866307e-13 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412412875243303e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479750114e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485436977633871e-08 +-2.5163926518435063e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447248443475e+00 +1.7319679095776896e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.4063038210047685e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485436977633871e-08 +-3.0648037732270130e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447248443475e+00 +1.7319624254664758e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.4062534327469176e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970873955267743e-08 +-6.1293879209072826e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446803589104e+00 +1.7319317796249991e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.6578818114890542e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.6728155466450807e-08 +-4.3914709541546611e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447026016289e+00 +1.7319491587946667e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.5320820429493723e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446803589104e+00 +1.7319317786241735e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109755115509, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225364910889, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095259817906 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779999255e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247446803589104e+00 +1.7319317786241735e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-8.8970873770106062e-08 +-6.1294880034701293e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 25.02295754230139, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 35.38780592700876, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0108517582955742 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.310220087272859e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.310220087272859e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.02297210770475 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.30993571467114e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8987534912805221e-08 +-6.1294880034701280e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446803422495e+00 +1.7319317786241735e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-2.9309497137733315e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8745918517299070e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.4833194836750910e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446803422495e+00 +1.7319317786241735e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.6578818025221362e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126428425574621e-08 +-2.3381665704615935e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446312158210e+00 +1.7319083969584688e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8207064309331306e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126428425574621e-08 +-2.5678036304855603e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446312158210e+00 +1.7319061005878686e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8206858813248142e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8252856851149243e-08 +-5.1355492973610147e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445820893925e+00 +1.7318804231311999e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9835032487707666e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.3689642638361926e-08 +-3.7655704518895430e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446066526069e+00 +1.7318941229196545e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.9021006505800758e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445820893925e+00 +1.7318804228755162e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738578277529, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429035146428, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684100014563951 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487925957703379e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445820893925e+00 +1.7318804228755162e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.8184887730253744e-07 +-1.1265062869192377e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.98839422006409, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 65.0374108177751, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01993022435383186 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 9.601715600583093e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 9.601715600583093e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.98842420996601 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.508449719859987e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8186316808347051e-07 +-1.1265062869192373e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445874666163e+00 +1.7318804228755162e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-3.5067156722175821e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4578776485889356e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-6.6495931383095375e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445874666163e+00 +1.7318804228755162e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9835032196206431e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781452691700971e-08 +-2.7974014272094086e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247444936851637e+00 +1.7318524488612441e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1463126777071542e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781452691700971e-08 +-3.0270170920135741e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247444936851637e+00 +1.7318501527045962e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1462925617930362e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8756290538340194e-07 +-6.0539774437241262e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443999037109e+00 +1.7318198831010789e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090934626050705e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4067217903755145e-07 +-4.4543992403934499e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247444467944373e+00 +1.7318358788831123e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2276991513499478e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443999037109e+00 +1.7318198828576059e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990630919255, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551005682485, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874520703118 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213391475553e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247443999037109e+00 +1.7318198828576059e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693297844e+00 +1.7319930735042082e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.3437258667066619e-07 +-1.7319064660226147e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70326784116725, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98952028507621, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03060090279483382 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.928833636261717e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.928833636261717e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.7033235562848 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.073884213617642e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.3434617870545338e-07 +-1.7319064660226147e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444349836056e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-4.0824816376767314e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6319515876694253e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463146502e+00 1.731819882857606e+00 3.135491866146367e-12 1.332267629550188e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-4.0824815438004076e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +-6.2776539506729569e-12 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824816065769488e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931442810073e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970852849047882e-08 +-5.0322819831839579e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443741756492e+00 +1.7317695600377740e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5606520958631401e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970852849047882e-08 +-5.5805126090860530e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443741756492e+00 +1.7317640777315151e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5606053790599703e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7794170569809576e-07 +-1.1160821595267170e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442852047965e+00 +1.7317082746416532e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.8121399615089460e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3345627927357182e-07 +-8.1651093896043496e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443296902227e+00 +1.7317382317637098e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6863875451510671e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442852047965e+00 +1.7317082738005669e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765820445304, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535187627492, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.858219393173556 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.419125651884173e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247442852047965e+00 +1.7317082738005669e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.7794170285626894e-07 +-1.1160905703899715e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 45.56773766224819, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 64.44251260861067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0197475505808735 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.813872614936062e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.813872614936062e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.56776698106852 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.425041483437005e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.7795782736178756e-07 +-1.1160905703899719e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442851886747e+00 +1.7317082738005669e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-4.9721891788353232e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8752706795920109e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.5245585208699220e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442851886747e+00 +1.7317082738005669e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.8121399545445414e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7914710387710737e-08 +-3.9660557364056374e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442072739643e+00 +1.7316686132432029e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.9748984560165198e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7914710387710737e-08 +-4.1955995353792824e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442072739643e+00 +1.7316663178052132e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.9748794450457383e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5582942077542147e-07 +-8.3911454471331814e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441293592540e+00 +1.7316243623460956e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.1376260892459040e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1687206558156612e-07 +-6.2073013147636625e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441683166091e+00 +1.7316462007874194e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0562590425724756e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441293592540e+00 +1.7316243621337195e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553839765699, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251686175071, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471266304468 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193375207932e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441293592540e+00 +1.7316243621337195e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.2839573540567387e-07 +-1.9552072388639985e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 79.82720621190367, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 112.892717671228, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03458090468247423 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.108501437863291e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.108501437863291e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.82726049775935 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.371022992941138e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.2840843660907345e-07 +-1.9552072388639982e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441347380654e+00 +1.7316243621337195e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-5.5479545428378124e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4588749624294499e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.6908286769073217e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441347380654e+00 +1.7316243621337195e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.1376260606129014e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2256968531194404e-07 +-4.4250997594481636e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440121683801e+00 +1.7315801111361251e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.3003602000813270e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2256968531194404e-07 +-4.6546091998672899e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440121683801e+00 +1.7315778160417208e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.3003416235359007e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4513937062388807e-07 +-9.3091660014786321e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247438895986948e+00 +1.7315312704737047e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630626088737626e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8385452796791604e-07 +-6.8958292697798818e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247439508835374e+00 +1.7315554038410217e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3817084451382617e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247438895986948e+00 +1.7315312702735526e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820264398724, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810387453822775, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294686795201 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668421778799e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247438895986948e+00 +1.7315312702735526e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631465021e+00 +1.7318198828576059e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.3849435978571907e-07 +-2.8861258405332713e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8348215690963, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6436027828297, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05100462411786148 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.464460115747127e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.464460115747127e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8349111208192 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.999444839290604e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3846462366900770e-07 +-2.8861258405332718e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439246818783e+00 +1.7315312702735526e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-6.1237199049206555e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6302794985155313e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439528447472e+00 +1.7315312702735526e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439528447472e+00 +1.7315312702735526e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952844747e+00 1.731531270273553e+00 1.146727157674832e-11 1.776356839400250e-14 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 30 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_1.out new file mode 100644 index 0000000000..fc2aaf3340 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_2_1_1.out @@ -0,0 +1,1653 @@ +Start MRIStep Logging test +Using ImEx-MRI-GARK method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.496006819526213e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +6.1989172313708505e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.6371994311708601e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.480034097631063e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.7665928206329331e-25 +-6.4606546253197653e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688708e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.6371993670721352e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7533185641265866e-24 +-1.2921309154747402e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688643e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.7274398799278809e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.122005114644659e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3149889230949401e-24 +-7.2682364172830469e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688699e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.2955799098182033e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.283118913371641e-06, h_cfl = 1.496006819526213e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.231794156836775e-06, h_cfl = 7.480034097631063e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472585 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.231805049533112e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.496006819526213e-08, h = 1.231794156836775e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.496006819526213e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688645e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.7274398800560780e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-1.0639251752699482e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075678007e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.2845130562184719e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 6.308571466136496e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.2183078785983163e-23 +-4.4865103090255557e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075239995e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.2845086762910995e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4436615757196633e-22 +-8.9730152228821661e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 9.388056858228434e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0827461817897473e-22 +-5.0872192687095676e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075179923e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0840394303739344e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.108004205495869e-05, h_cfl = 1.231794156836775e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.023684037276034e-05, h_cfl = 6.158970784183875e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.42875171995309 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 8.361269338183975e-16 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.246754225032037e-06, h = 2.023684037276034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.246754225032037e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508074791343e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.4396277740047413e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.4566758729363121e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508060224584e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3123431954948648e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.13651744114122e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1858778797567304e-21 +-1.3278839880753896e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507942002945e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3123313822883717e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134609e-21 +-2.6557440699533699e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507809216936e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.4807117632403230e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.642438450460229e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.7788168196350954e-21 +-1.5484858693447888e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507919942756e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8965245322040000e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007461211873381922, h_cfl = 2.023684037276034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004047368074552068, h_cfl = 1.011842018638017e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.587902436910164e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.148359459779237e-05, h = 0.0004047368074552068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.148359459779237e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507809215739e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.4807117631208860e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.0201767961106226e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320502789038943e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5850485697902034e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002238519983253957 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.3717557595134611e-20 +-5.2313215262676757e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320455496000478e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5845826971662583e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.7435115190269222e-20 +-1.0460757494550389e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320403201640795e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-4.9215386380348593e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003250362001891974 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.5576336392701913e-20 +-6.0727889759923864e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320447081325980e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.7531810140477219e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001474585099681421, h_cfl = 4.047368074552068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001415601695694164, h_cfl = 2.023684037276034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.49758576343673 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.054536139332359e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004262204020529991, h = 9.646119455459874e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004262204020529991 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320403192357716e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-4.9215385478418264e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.3736874368566389e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320400818670278e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-4.9772295306148802e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000431043461780729 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.6526213959361231e-22 +-2.4005475304776807e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320400791810187e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-4.9772292697325332e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1305242791872246e-21 +-4.8010948093051328e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320398391262908e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.0329202291137985e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.000433454991644594 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.4789320939041850e-22 +-3.5907486669449202e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320399601609049e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.0050748175839127e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008221669095400283, h_cfl = 9.646119455459875e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0001929223891091975, h_cfl = 4.823059727729937e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.399381689992988e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320398391262783e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.000435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.1083514705106001e-20 +-1.0968442598846551e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 4.475638659002295 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001949917579727998 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.6887165601339281e-11 +-1.0968440517137329e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247448713747018e+00 +1.7320398391283600e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.000435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-8.8970878322247178e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8743907606210766e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.4420787533866932e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.000435866521508459, h = 0.0001929223891091975 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.000435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713747018e+00 +1.7320398391283600e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.0329202301590562e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910463919348703e-08 +-4.8548149749914859e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448574642379e+00 +1.7320349843133851e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.1467840062017012e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005323277160630578 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3910463919348703e-08 +-5.9292612790731819e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448574642379e+00 +1.7320339098670809e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.1466803746215971e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7820927838697407e-08 +-1.1858322629626156e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448435537740e+00 +1.7320279808057304e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-7.2605326305814510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005805583133403571 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0865695879023057e-08 +-8.4909002759096513e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448505090059e+00 +1.7320313482280840e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.7036339800849387e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448435537740e+00 +1.7320279807094703e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008364545860675966, h_cfl = 1.929223891091975e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008029964026248927, h_cfl = 9.646119455459875e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.16227689452043 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.442705218408666e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0006287889106176565, h = 8.914435013657296e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0006287889106176565 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448435537740e+00 +1.7320279807094703e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-7.2605326213589491e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276586658208013e-09 +-3.2361773108821604e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448371261154e+00 +1.7320247445321595e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.7751969211200825e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.000673361085685943 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4276586658208013e-09 +-3.4655743835856634e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448371261154e+00 +1.7320245151350866e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.7751750111932069e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0007179332607542294 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2855317331641603e-08 +-6.9311292357093984e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448306984567e+00 +1.7320210495802346e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-8.2898362025555242e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0006956471732200863 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.6414879987312010e-09 +-5.1123304354090184e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448339122859e+00 +1.7320228683790349e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-8.0325114856887550e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448306984567e+00 +1.7320210495709307e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001966024518003245, h_cfl = 8.914435013657296e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001782887002731459, h_cfl = 4.457217506828648e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.480985254579955e-08 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247448306984567e+00 +1.7320210495709307e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.5301616332039388e-08 +-2.9757997946466830e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 12.14267813696497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.005287100222820616 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.5316685259642287e-08 +-2.9757992302012752e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247448360749036e+00 +1.7320210495765751e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.0007179332607542295 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-1.4654750482174844e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4572385544195316e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.6083543619226139e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.0007179332607542295, h = 0.0002820667392457702 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0007179332607542295 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448360749036e+00 +1.7320210495765751e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-8.2898359333847427e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993174407826685e-08 +-1.1691434953061251e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447710817292e+00 +1.7320093581416220e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.9183578733839414e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0008589666303771146 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.4993174407826685e-08 +-1.3988194320090101e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447710817292e+00 +1.7320070613822549e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.9181413497115678e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999998 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2998634881565337e-07 +-2.7975777898917843e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447060885548e+00 +1.7319930737986762e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546623669295350e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0009294833151885572 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.7489761611740020e-08 +-2.0120781181901383e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447385851420e+00 +1.7320009287953932e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.0732441998008208e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447060885548e+00 +1.7319930735119315e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001522939033375331, h_cfl = 2.820667392457702e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001462021472040318, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.183246617271065 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487422913020145e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247447060885548e+00 +1.7319930735119315e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.001 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.3024952356044277e-07 +-5.7734056945646373e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55833268368898 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01025211853916463 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3022496892758314e-07 +-5.7734046000567416e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247447411666199e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-2.0412413291540256e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6335132798040400e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769329530e+00 1.731993073522877e+00 9.103828801926284e-15 1.866129473171441e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-2.0412412822158415e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +9.3127376499048129e-12 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412411890884647e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0004358665215084587 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620481505229e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485434832388956e-08 +-2.5163926522260043e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447248440948e+00 +1.7319679095963543e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.4063038211775231e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4485434832388956e-08 +-3.0648037736035022e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447248440948e+00 +1.7319624254851405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.4062534329196719e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970869664777911e-08 +-6.1293879216602596e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446803586601e+00 +1.7319317796436600e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.6578818116590505e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.6728152248583440e-08 +-4.3914709547216480e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447026013774e+00 +1.7319491588133293e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.5320820431207477e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446803586601e+00 +1.7319317786428341e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002572109837952736, h_cfl = 4.358665215084587e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002469225444434626, h_cfl = 2.179332607542293e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.665095442267654 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.418573779983966e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247446803586601e+00 +1.7319317786428341e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.001435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-8.8970873619722298e-08 +-6.1294880042472855e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 25.01207820825822 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01088917366868417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-8.8987754617939093e-08 +-6.1294868417663477e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247446803417750e+00 +1.7319317786544588e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-2.9309497137744672e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-3.8729826894760647e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.4833193319369225e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.001435866521508459, h = 0.0002820667392457701 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247446803417750e+00 +1.7319317786544588e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.6578818027983722e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126426285560101e-08 +-2.3381665708511786e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446312153487e+00 +1.7319083969887503e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8207064312064725e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.9126426285560101e-08 +-2.5678036308710637e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446312153487e+00 +1.7319061006181500e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8206858815981558e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8252852571120202e-08 +-5.1355492981320207e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247445820889225e+00 +1.7318804231614775e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9835032490412163e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.3689639428340148e-08 +-3.7655704524693269e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446066521355e+00 +1.7318941229499341e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.9021006508519731e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247445820889225e+00 +1.7318804229057940e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257738564091452, h_cfl = 2.820667392457701e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167429021527794, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.684099966282349 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.487926046185586e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247445820889225e+00 +1.7318804229057940e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.001717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.8184909944076147e-07 +-1.1265061708254365e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.96839978231188 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.02001100770869457 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8186415876442011e-07 +-1.1265059571958069e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247445874653708e+00 +1.7318804229271569e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-3.5067156722211481e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +-3.4550465257831265e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-6.6495933844260696e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247445874653708e+00 +1.7318804229271569e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9835032200841340e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781456162765359e-08 +-2.7974014278630856e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247444936839147e+00 +1.7318524489128784e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.1463126781657504e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.3781456162765359e-08 +-3.0270170926603478e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247444936839147e+00 +1.7318501527562304e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.1462925622516324e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8756291232553072e-07 +-6.0539774450176736e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443999024585e+00 +1.7318198831527067e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090934630587739e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.4067218424414805e-07 +-4.4543992413661988e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247444467931865e+00 +1.7318358789347432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2276991518060965e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443999024585e+00 +1.7318198829092342e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885990638869279, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810551013314508, h_cfl = 1.410333696228851e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418874547760627 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.488213369269281e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247443999024585e+00 +1.7318198829092342e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.002 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247447693295297e+00 +1.7319930735228766e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.3437359305001307e-07 +-1.7319061364240440e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6725364586391 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03076033257676166 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.3434902404443183e-07 +-1.7319058080374219e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247444349805057e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-4.0824816376870644e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +5.6367949373295764e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463143402e+00 1.731819882942073e+00 3.552713678800501e-14 8.445355526021103e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_0(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_0(:) = +-4.0824815438107406e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_0(:) = +4.2155842365700585e-11 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 1, stage type = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824811222523187e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002, h = 0.0004358665215084585 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931450285537e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970842294003302e-08 +-5.0322819848131106e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443741725599e+00 +1.7317695601222247e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5606520965982216e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002217933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-8.8970842294003302e-08 +-5.5805126106880403e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443741725599e+00 +1.7317640778159660e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5606053797950556e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002435866521508458 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7794168458800660e-07 +-1.1160821598471161e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442852017176e+00 +1.7317082747260881e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.8121399622315751e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002326899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3345626344100495e-07 +-8.1651093920175221e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443296871388e+00 +1.7317382318481527e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6863875458799219e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442852017176e+00 +1.7317082738850020e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002205765817803392, h_cfl = 4.358665215084585e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002117535185091256, h_cfl = 2.179332607542292e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.85821938735472 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.41912564738839e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_1(:) = +1.2247442852017176e+00 +1.7317082738850020e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 2, stage type = 2, tcur = 0.002435866521508459 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-1.7794170287257101e-07 +-1.1160905707074953e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 45.54793022201162 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.7794862201029117e-07 +-1.1156047068530326e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_2(:) = +1.2247442851947801e+00 +1.7317083224713874e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002435866521508459 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_2(:) = +-4.9721891788105372e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_2(:) = +-1.4429507578079948e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 3, stage type = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.5243509413804165e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.002435866521508459, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002435866521508459 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247442851947801e+00 +1.7317083224713874e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.8121403621851360e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7911782824223786e-08 +-3.9660563113149043e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442072829973e+00 +1.7316686619082742e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.9748988590185105e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002576899891131344 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.7911782824223786e-08 +-4.1956001037465689e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442072829973e+00 +1.7316663664703500e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.9748798480486938e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5582356564844757e-07 +-8.3911465838704772e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247441293712145e+00 +1.7316244110055488e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.1376264876118676e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002647416575942787 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1686767423633569e-07 +-6.2073021697687145e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247441683271059e+00 +1.7316462494496898e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0562594432564943e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247441293712145e+00 +1.7316244107931731e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002257553825035457, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002167251672034038, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.683471216170827 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489193460191508e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_3(:) = +1.2247441293712145e+00 +1.7316244107931731e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 4, stage type = 2, tcur = 0.002717933260754229 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-3.2839027103691621e-07 +-1.9547214889970022e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 79.77268774500753 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.2837835770642712e-07 +-1.9538705832610731e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_4(:) = +1.2247441347650445e+00 +1.7316244958837468e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002717933260754229 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_4(:) = +-5.5479545427156000e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_4(:) = +3.2232303305719437e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 5, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.6920111134588553e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002717933260754229, h = 0.0002820667392457703 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002717933260754229 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247441347650445e+00 +1.7316244958837468e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.1376271556291596e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2258636161306683e-07 +-4.4251013037864910e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247440121786830e+00 +1.7315802448707089e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.3003612824799444e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002858966630377115 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2258636161306683e-07 +-4.6546107264105331e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247440121786830e+00 +1.7315779497764827e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.3003427059370549e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.003 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4517272322613365e-07 +-9.3091690545722729e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247438895923213e+00 +1.7315314041932011e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630636786615904e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002929483315188557 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8387954241960025e-07 +-6.8958315662702045e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247439508855020e+00 +1.7315555375680840e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.3817095212315817e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247438895923213e+00 +1.7315314039930489e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001885820271331692, h_cfl = 2.820667392457703e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001810387460478425, h_cfl = 1.410333696228852e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.418294710391211 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.489668406571682e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_5(:) = +1.2247438895923213e+00 +1.7315314039930489e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 6, stage type = 2, tcur = 0.003 +[DEBUG][rank 0][mriStep_StageDIRKNoFast][predictor] zpred(:) = +1.2247444631434021e+00 +1.7318198829420728e+00 + +[DEBUG][rank 0][mriStep_StageDIRKNoFast][rhs data] sdata(:) = +-5.3851392912567548e-07 +-2.8847894902384041e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7290852919884 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3843774558909810e-07 +-2.8835338357697290e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_6(:) = +1.2247439247056566e+00 +1.7315315295584959e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow explicit RHS] Fse_6(:) = +-6.1237199048017640e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow implicit RHS] Fsi_6(:) = +1.8589770046461746e-07 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRIGARK][begin-stage] stage = 7, stage type = 1, tcur = 0.003 +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][slow stage] z_7(:) = +1.2247439528685258e+00 +1.7315315295584959e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.003 +[INFO][rank 0][mriStep_TakeStepMRIGARK][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRIGARK][updated solution] ycur(:) = +1.2247439528685258e+00 +1.7315315295584959e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952868526e+00 1.731531529558496e+00 3.524580627356499e-11 2.592849255300678e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 12 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_3.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_3.out new file mode 100644 index 0000000000..a952b02930 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_3.out @@ -0,0 +1,1446 @@ +Start MRIStep Logging test +Using Ex-MRI-SR method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-1.2254796263946310e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3555429072323917e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094942284548030e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448602966466e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743569277778e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094942284548030e-08 +-2.0360974959501188e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448602966466e+00 +1.7320487714713813e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725496051852e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2189884569096061e-08 +-4.0716590505205752e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492017043e+00 +1.7320467359098266e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413589536904e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6642413426822047e-08 +-2.2904091653250148e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547491755e+00 +1.7320485171597120e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084375837905e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492017043e+00 +1.7320467356443114e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674153956226, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967187797977, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164123207857 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469436431449e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492017043e+00 +1.7320467356443114e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413328722541e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781591761825418e-11 +-1.6802156961075714e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491559227e+00 +1.7320467188421544e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681121803422e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781591761825418e-11 +-1.6836822575347090e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491559227e+00 +1.7320467188074888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681087752847e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1563183523650836e-11 +-3.3673645113380280e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491101411e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948878957975e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8672387642738124e-11 +-2.5242234243740391e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491330319e+00 +1.7320467104020771e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314992102761e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491101411e+00 +1.7320467019706662e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634421513462e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.618934781454142e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448491101411e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-5.4403058920472641e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0207732054765795e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186016921554643e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702729873e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717796963985e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186016921554643e-09 +-1.3866420144848115e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702729873e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579234064838e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372033843109285e-09 +-2.7732536604817700e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691543856e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296606774453e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6779025382331965e-09 +-1.5599608810181516e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697136865e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472633171931e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691543856e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404364362730721, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064153609642308e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691543856e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296605260095e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372033843109283e-08 +-5.5465375961367138e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467823518e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698771529573e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372033843109283e-08 +-6.1017770822233959e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467823518e+00 +1.7320446780591066e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240803154377e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4744067686218566e-08 +-1.2201161745591176e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244103178e+00 +1.7320385786744432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939300901139e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3558050764663921e-08 +-7.0716009271379722e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448355963348e+00 +1.7320437082352618e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503572970357e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244103178e+00 +1.7320385774980036e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534110004361672, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472745604187206, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359862723658343 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809673922718e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244103178e+00 +1.7320385774980036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938160558666e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548024738564205e-08 +-1.4342442212646087e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968622931e+00 +1.7320242350557911e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189391329657e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548024738564205e-08 +-2.2753136255971913e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968622931e+00 +1.7320158243617476e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188088322530e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5096049477128410e-08 +-4.5501953823091131e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693142683e+00 +1.7319930755441806e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620670923328e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1322037107846306e-08 +-3.0974095399983003e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447830882807e+00 +1.7320076034026035e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380187369700e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682863348538355, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535548814596821, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550367096815337 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769314268e+00 1.731993073495719e+00 1.525224391230040e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-2.0412410196735464e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412410196735470e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479733610e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237230590206332e-08 +-3.4639861439200793e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447080770377e+00 +1.7319584336342799e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735423265642e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237230590206332e-08 +-4.5032206269796875e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447080770377e+00 +1.7319480412894495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786255770563e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247446118041266e-07 +-9.0058717534623268e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468398071e+00 +1.7319030147781846e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630415972764e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855845885309498e-08 +-6.3649095238232204e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774584225e+00 +1.7319294244004810e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983375538932e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468398071e+00 +1.7319030122014651e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794540378942, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522758763785, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871264606313 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654011537726e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247446468398071e+00 +1.7319030122014651e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-3.2667200949979355e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8767949346674467e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479733610e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357265795565941e-08 +-1.5395493972978140e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447309570025e+00 +1.7319776780017462e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141134744872e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357265795565941e-08 +-1.7448188179659822e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447309570025e+00 +1.7319756253075396e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951374569305e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6714531591131881e-08 +-3.4895870332184797e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446925997367e+00 +1.7319581776253870e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425348038215e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7535898693348918e-08 +-2.5402336071937066e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447117783696e+00 +1.7319676711596472e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741978800803e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446925997367e+00 +1.7319581773931210e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868659677365, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00214643391329027, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127174838516 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247446925997367e+00 +1.7319581773931210e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-2.5852714618523724e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0620138377137273e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142683e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479733610e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310069188568624e-07 +-5.7733102398668000e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162135764e+00 +1.7319353403933204e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509139180953e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310069188568624e-07 +-8.6602545695904691e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162135764e+00 +1.7319064709500234e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910889278892e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0620138377137249e-07 +-1.7317910889278878e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631128845e+00 +1.7318198943868264e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932443690046e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2965103782852935e-07 +-1.1906830484058438e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445396632306e+00 +1.7318740051908785e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197679216230e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00236999152476531, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191863774698, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.2751918637747 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261462524817 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463112885e+00 1.731819882840752e+00 3.048206131950337e-11 1.686739636852508e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-4.0824810186075914e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824810186075925e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931443030263e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247443055822763e-07 +-6.9272794329090713e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443406384539e+00 +1.7317506100464228e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868341404174e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247443055822763e-07 +-7.9661605024212434e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443406384539e+00 +1.7317402212357276e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988755427787e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494886111645526e-07 +-1.5931793253256654e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442181640233e+00 +1.7316605649082193e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446876784518e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371164583734144e-07 +-1.1559471422789185e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794012386e+00 +1.7317042881265239e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501460715050e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442181640233e+00 +1.7316605627482384e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458424088719, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00326924008712517, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733478541956 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614179993884e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247442181640233e+00 +1.7316605627482384e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-5.3079589301364548e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9180341401045425e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931443030263e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573788534727215e-08 +-3.0787908590707007e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443975390959e+00 +1.7317890949321610e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962777140188e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573788534727215e-08 +-3.2839950369520238e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443975390959e+00 +1.7317870428903823e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786757555960e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3114757706945443e-07 +-6.5679431353482534e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443319653075e+00 +1.7317542034093985e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730335789359e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8360682802090809e-08 +-4.8490241180630878e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443647522018e+00 +1.7317713925995712e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313863414069e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443319653075e+00 +1.7317542032137083e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250121127217, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880116282128, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300436057982 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964755177207e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443319653075e+00 +1.7317542032137083e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-4.6265110417457339e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1032529388327997e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631128845e+00 +1.7318198828407518e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931443030263e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516264694163978e-07 +-1.1545465721515122e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442079502375e+00 +1.7317044281835368e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702537200613e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516264694163978e-07 +-1.4431351268600294e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442079502375e+00 +1.7316755693280659e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297632558507e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1032529388327957e-07 +-2.8860297632558483e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439527875907e+00 +1.7315312798644262e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623680550476e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8274397041245968e-07 +-2.0563963141195788e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440803689140e+00 +1.7316142432093400e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260580568852e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439527875907e+00 +1.7315312702483132e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854906908199, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060710631871, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060710631873 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086788760326 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439527875907e+00 +1.7315312702483132e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439527875907e+00 +1.7315312702483132e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952787591e+00 1.731531270248313e+00 4.568923017700399e-11 2.525712972101246e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_0.out new file mode 100644 index 0000000000..dcc0bdc70f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_0.out @@ -0,0 +1,1636 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484795600596831 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002839677462856478 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.8558590180178093e-08 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448128329987e+00 +1.7320300230875767e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-1.2243085131554785e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3475580442381696e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084339551122506e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448603072495e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743563976333e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084339551122506e-08 +-2.0360974952461641e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448603072495e+00 +1.7320487714713819e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725490751043e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2168679102245011e-08 +-4.0716590491128344e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492229098e+00 +1.7320467359098282e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413578935662e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6626509326683759e-08 +-2.2904091645331212e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547650797e+00 +1.7320485171597126e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084367886464e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492229098e+00 +1.7320467356443128e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674215266165, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967246655518, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.11516414537051 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469364509253e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492229098e+00 +1.7320467356443128e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413318121174e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737841195053851e-11 +-1.6802156955267026e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491771720e+00 +1.7320467188421558e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681111180035e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737841195053851e-11 +-1.6836822569526336e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491771720e+00 +1.7320467188074902e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681077129460e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1475682390107701e-11 +-3.3673645101738772e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491314341e+00 +1.7320467019706676e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948868312789e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8606761792580766e-11 +-2.5242234235013778e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491543032e+00 +1.7320467104020785e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314981468403e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491314341e+00 +1.7320467019706676e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634400131705e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.646426838510152e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +2.0649437804629074e-08 +-4.1055982096249721e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676008618859752 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005643456517840985 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3865115081454182e-09 +-4.1055982096249721e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448660050775e+00 +1.7320467019706676e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-5.4436848041717855e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0204267608332523e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182220450779500e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702733670e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717795065335e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182220450779500e-09 +-1.3866420142767502e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702733670e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579232166188e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364440901559000e-09 +-2.7732536600656476e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691551448e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296602978513e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6773330676169250e-09 +-1.5599608807840734e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697142558e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472630325087e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404330240967631, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.064449683586706e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296601464152e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364440901558998e-08 +-5.5465375953047665e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467907038e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698767353539e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364440901558998e-08 +-6.1017770813081446e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467907038e+00 +1.7320446780591074e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240798979227e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4728881803117996e-08 +-1.2201161743761062e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244262631e+00 +1.7320385786744450e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939292930266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3546661352338499e-08 +-7.0716009260772523e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448356084834e+00 +1.7320437082352627e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503566897000e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244262631e+00 +1.7320385774980056e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534113512840757, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472748972327127, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359870407597604 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670049984e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244262631e+00 +1.7320385774980056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938152588056e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538675095025643e-08 +-1.4342442210495024e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968875880e+00 +1.7320242350557951e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189378685993e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538675095025643e-08 +-2.2753136252559715e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968875880e+00 +1.7320158243617529e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188075680087e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5077350190051287e-08 +-4.5501953816267393e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693489129e+00 +1.7319930755441892e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620669191915e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1308012642538467e-08 +-3.0974095395337868e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447831182505e+00 +1.7320076034026102e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380172391112e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693489129e+00 +1.7319930734957281e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682859333259777, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544959929386, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550359955212135 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.4608074683250003e-09 +-5.7734073149129372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853116193789 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.007921301090223275 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0209848128118822e-07 +-5.7734073149129372e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769293108e+00 1.731993073495728e+00 3.641287271705096e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-2.0412405964536466e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412405964536471e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693489129e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620478002208e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237217893609344e-08 +-3.4639861434006584e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447081116949e+00 +1.7319584336342941e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735421534077e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237217893609344e-08 +-4.5032206264602178e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447081116949e+00 +1.7319480412894634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786254038979e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247443578721869e-07 +-9.0058717524233765e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468744771e+00 +1.7319030147782037e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630414240966e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855826840414010e-08 +-6.3649095230440300e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774930859e+00 +1.7319294244004977e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983373807257e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468744771e+00 +1.7319030122014847e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794541412499, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522759755999, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871266260003 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654015963828e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4794080300771410e-08 +-9.0061294243382051e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76658769079079 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01234458166289366 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8099298336513346e-07 +-9.0061294243382051e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247445883001244e+00 +1.7319030122014847e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-3.2655494573599619e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8759966379806787e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480792463e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346621839742370e-08 +-1.5395493974389944e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447309464858e+00 +1.7319776780017537e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141135271412e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346621839742370e-08 +-1.7448188180361877e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447309464858e+00 +1.7319756253075478e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951375095900e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6693243679484740e-08 +-3.4895870333589056e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446925998640e+00 +1.7319581776253945e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425348032550e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7519932759613555e-08 +-2.5402336073256357e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447117731749e+00 +1.7319676711596548e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741979061237e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446925998640e+00 +1.7319581773931285e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868673761018, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433926810577, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127225539666 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826571203e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +6.3840911332632291e-08 +-3.4896102599546452e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24595765940638 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004788932282498826 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.9826572008822304e-08 +-3.4896102599546452e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247447094665358e+00 +1.7319581773931285e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-2.5856087621903956e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0616673029723184e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480792463e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308336514861579e-07 +-5.7733102403962267e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162097426e+00 +1.7319353403933242e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509139372978e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308336514861579e-07 +-8.6602545696864820e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162097426e+00 +1.7319064709500311e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910889471275e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0616673029723158e-07 +-1.7317910889471261e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631263775e+00 +1.7318198943868333e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932443015999e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2962504772292367e-07 +-1.1906830484365107e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445396680601e+00 +1.7318740051908843e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197678975273e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631263775e+00 +1.7318198828407589e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991518741408, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191857991752, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191857991754 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614628789052 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447692931077e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.1096026748366064e-07 +-1.7319065496912422e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322912588983 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376154766714745 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0624865768420810e-07 +-1.7319065496912422e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463044450e+00 1.731819882840759e+00 9.891665264660787e-11 1.686029094116748e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-4.0824796501086802e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824796501086813e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631263775e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931442356238e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247438950326028e-07 +-6.9272794327068636e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443406519880e+00 +1.7317506100464319e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868340728243e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247438950326028e-07 +-7.9661605022184637e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443406519880e+00 +1.7317402212357367e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988754751855e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494877900652056e-07 +-1.5931793252851095e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442181775985e+00 +1.7316605649082304e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446876106666e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371158425489042e-07 +-1.1559471422485231e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794147934e+00 +1.7317042881265341e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501460038164e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442181775985e+00 +1.7316605627482495e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458426380418, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240089325201, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733482208675 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614193273577e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.9617824717749579e-08 +-1.5932009250940737e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04725301387548 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02184661245053742 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0345690188759436e-07 +-1.5932009250940737e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247441595875481e+00 +1.7316605627482495e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-5.3067876544144615e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9172351075898926e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931446452614e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5563134767865211e-08 +-3.0787908595270143e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443974813153e+00 +1.7317890949321637e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962780029452e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5563134767865211e-08 +-3.2839950373372591e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443974813153e+00 +1.7317870428903857e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786760445277e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3112626953573042e-07 +-6.5679431361187376e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443319181803e+00 +1.7317542034093978e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730338145668e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8344702151797822e-08 +-4.8490241186675996e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443646997478e+00 +1.7317713925995724e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313866036866e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443319181803e+00 +1.7317542032137077e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250112576088, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880108073044, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300405273919 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964799442913e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +1.0703233192513347e-07 +-6.5679627051284939e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.81568292207747 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009012485355207473 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.1426659576834601e-07 +-6.5679627051284939e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443487778542e+00 +1.7317542032137077e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-4.6268472291704609e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1029054917535867e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931446452614e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514527458767910e-07 +-1.1545465723226298e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442078991753e+00 +1.7317044281835268e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702539752894e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514527458767910e-07 +-1.4431351269876436e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442078991753e+00 +1.7316755693280601e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297635111143e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1029054917535819e-07 +-2.8860297635111118e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439527539008e+00 +1.7315312798644078e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623682233508e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8271791188151870e-07 +-2.0563963143273254e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440803265381e+00 +1.7316142432093262e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260582686536e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439527539008e+00 +1.7315312702482950e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854910396215, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060713980366, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060713980368 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393408678876031 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630444499e+00 +1.7318198828407589e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.1745967117431619e-07 +-2.8861259246393267e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347805661338 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959596958504103 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1039864120733202e-07 +-2.8861259246393267e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439526458088e+00 +1.7315312702482950e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439526458088e+00 +1.7315312702482950e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952645809e+00 1.731531270248295e+00 1.874711497151793e-10 2.527533737861631e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_0.out new file mode 100644 index 0000000000..461d0d68af --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_0.out @@ -0,0 +1,1765 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484795600596831, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99931301232761, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004015866839014629 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.355316732970741e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.355316732970741e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484806428685115 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518415627456097e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.8553863630954659e-08 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448128377254e+00 +1.7320300230875767e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-1.2243086076853187e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3475586887598073e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084340406953235e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448603072486e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743563976786e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084340406953235e-08 +-2.0360974952462242e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448603072486e+00 +1.7320487714713819e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725490751496e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2168680813906470e-08 +-4.0716590491129547e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492229080e+00 +1.7320467359098282e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413578936568e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6626510610429854e-08 +-2.2904091645331885e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547650783e+00 +1.7320485171597126e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084367887099e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492229080e+00 +1.7320467356443128e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674238846908, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967269293031, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164153894606 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.95446933684687e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492229080e+00 +1.7320467356443128e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413318122080e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737844726509176e-11 +-1.6802156955267519e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491771702e+00 +1.7320467188421558e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681111180940e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737844726509176e-11 +-1.6836822569526832e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491771702e+00 +1.7320467188074902e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681077130365e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1475689453018351e-11 +-3.3673645101739765e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491314323e+00 +1.7320467019706676e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948868313650e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8606767089763764e-11 +-2.5242234235014523e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491543014e+00 +1.7320467104020785e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314981469312e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491314323e+00 +1.7320467019706676e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634391907952e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034588e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +2.0649439341356229e-08 +-4.1055982096249721e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676008618858404, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370234119443755, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0007981043352652857 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.774836283552402e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.774836283552402e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676009569925 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.704998826808452e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3855753663217472e-09 +-4.1055982096249730e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448660060136e+00 +1.7320467019706676e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-5.4436849913947521e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0204268225280775e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182221126854611e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702733668e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717795066694e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182221126854611e-09 +-1.3866420142768993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702733668e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579232167547e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364442253709221e-09 +-2.7732536600659454e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691551448e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296602978513e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6773331690281919e-09 +-1.5599608807842594e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697142558e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472630325087e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404386294498222, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296601464152e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364442253709221e-08 +-5.5465375953047665e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467907025e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698767354219e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364442253709221e-08 +-6.1017770813082937e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467907025e+00 +1.7320446780591074e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240798979907e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4728884507418441e-08 +-1.2201161743761360e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244262602e+00 +1.7320385786744450e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939292931716e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3546663380563834e-08 +-7.0716009260774183e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448356084814e+00 +1.7320437082352627e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503566897999e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244262602e+00 +1.7320385774980056e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534107753002054, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472743442881971, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.35985779294331 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809665070755e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244262602e+00 +1.7320385774980056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938152589506e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538676760009171e-08 +-1.4342442210495416e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968875835e+00 +1.7320242350557951e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189378688213e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538676760009171e-08 +-2.2753136252560315e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968875835e+00 +1.7320158243617529e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188075682308e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5077353520018343e-08 +-4.5501953816268593e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693489066e+00 +1.7319930755441892e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620669192227e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1308015140013755e-08 +-3.0974095395338688e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447831182450e+00 +1.7320076034026102e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380172393888e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693489066e+00 +1.7319930734957281e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682865914687657, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00353555127810015, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550371660986841 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844451011408e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.4608053512399927e-09 +-5.7734073149129372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853116193524, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093641442174, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120221282537529 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.829268876391666e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.829268876391666e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.5685496216454 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271877873619188e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0208514805502336e-07 +-5.7734073149129379e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306441e+00 1.731993073495728e+00 2.307976032511760e-11 8.487210934049472e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-2.0412408630927689e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412408630927694e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693489066e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620478002521e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237225892783013e-08 +-3.4639861434007526e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447081116807e+00 +1.7319584336342941e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735421534790e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237225892783013e-08 +-4.5032206264604319e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447081116807e+00 +1.7319480412894634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786254039689e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247445178556603e-07 +-9.0058717524238034e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468744549e+00 +1.7319030147782037e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630414242076e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855838839174513e-08 +-6.3649095230443052e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774930677e+00 +1.7319294244004977e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983373808167e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468744549e+00 +1.7319030122014847e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794542140617, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522760454992, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871267424992 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389957e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4807422865317994e-08 +-9.0061294243382051e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76658771011432, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99580698182362, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01745737857060591 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.044483986313881e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.044483986313881e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76662068822849 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144290571601441e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8098535057400427e-07 +-9.0061294243382078e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247445883210903e+00 +1.7319030122014847e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-3.2655498766225776e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8759970086812735e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480125809e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346626782416965e-08 +-1.5395493973501074e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447309598141e+00 +1.7319776780017546e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141134605081e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346626782416965e-08 +-1.7448188179473434e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447309598141e+00 +1.7319756253075487e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951374429572e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6693253564833930e-08 +-3.4895870331812178e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446926131873e+00 +1.7319581776253963e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425347366544e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7519940173625451e-08 +-2.5402336071923537e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447117865007e+00 +1.7319676711596561e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741978395061e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446926131873e+00 +1.7319581773931298e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868685585981, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433938162542, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127268109535 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182771244593e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +6.3840919664127187e-08 +-3.4896102598214185e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.24595765886783, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14682653016375, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006772498770722619 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.42491424547357e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.42491424547357e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24596845308144 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511949813658031e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.9818572079162638e-08 +-3.4896102598214185e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247447094878687e+00 +1.7319581773931298e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-2.5856091887957537e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0616677643623049e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620480125809e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308338821811511e-07 +-5.7733102400628996e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162230526e+00 +1.7319353403933275e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509138707774e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308338821811511e-07 +-8.6602545693538799e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162230526e+00 +1.7319064709500345e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910888806073e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0616677643623023e-07 +-1.7317910888806060e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631396645e+00 +1.7318198943868399e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932442352230e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2962508232717267e-07 +-1.1906830483865933e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445396813585e+00 +1.7318740051908894e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197678310793e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631396645e+00 +1.7318198828407654e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991513950708, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227519185339268, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191853392681 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629674277 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693064408e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.1096029191301892e-07 +-1.7319065496268493e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322912330754, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.9894655297539, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360218033634896 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.152035138603228e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 1.152035138603228e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328448815538 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178327890492011e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0620732984122282e-07 +-1.7319065496268490e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463099111e+00 1.731819882840765e+00 4.425571020760799e-11 1.685385164762465e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-4.0824807431130206e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824807431130217e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631396645e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931441692447e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247442229339052e-07 +-6.9272794325077254e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443406652421e+00 +1.7317506100464404e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868340066261e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247442229339052e-07 +-7.9661605020198690e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443406652421e+00 +1.7317402212357451e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988754089857e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494884458678104e-07 +-1.5931793252453894e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442181908199e+00 +1.7316605649082408e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446875446472e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371163344008575e-07 +-1.1559471422187132e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794280310e+00 +1.7317042881265434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501459377059e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442181908199e+00 +1.7316605627482600e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458432453699, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240095155551, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733491925924 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614171140701e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.9659211962112279e-08 +-1.5932009250541057e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04725306864341, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99070748479045, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03089427150794729 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.181096200144441e-18 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.181096200144441e-18 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04730818679262 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.960152942248941e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0346042339533319e-07 +-1.5932009250541054e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247441596386874e+00 +1.7316605627482600e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-5.3067886769270559e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9172361525316797e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931443720125e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5563148700422367e-08 +-3.0787908591626824e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443975359622e+00 +1.7317890949321737e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962777297962e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5563148700422367e-08 +-3.2839950369730607e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443975359622e+00 +1.7317870428903956e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786757713787e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3112629740084473e-07 +-6.5679431353903408e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443319728135e+00 +1.7317542034094116e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730335415169e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8344723050633564e-08 +-4.8490241181212519e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443647543879e+00 +1.7317713925995841e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313863305861e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443319728135e+00 +1.7317542032137214e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250125232029, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120222747, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300450835306 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044334e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +1.0703235397308217e-07 +-6.5679627043957467e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.81568291912277, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92310246851997, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01274532455113983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.285389427812277e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.285389427812277e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81570355371161 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655086190669431e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.1425142403157897e-07 +-6.5679627043957481e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443488476868e+00 +1.7317542032137214e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-4.6268486254891954e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1029067714204474e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931443720125e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514533857102216e-07 +-1.1545465721860053e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442079537723e+00 +1.7317044281835468e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702537024709e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514533857102216e-07 +-1.4431351268512341e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442079537723e+00 +1.7316755693280803e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297632382964e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1029067714204432e-07 +-2.8860297632382940e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439528084338e+00 +1.7315312798644416e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623679509553e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8271800785653321e-07 +-2.0563963141226313e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440803811029e+00 +1.7316142432093531e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260579960478e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439528084338e+00 +1.7315312702483288e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854905095393, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708891577, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708891579 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086789645609 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630991109e+00 +1.7318198828407654e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.1745976390179006e-07 +-2.8861259243662118e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347805551639, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.6435447803702, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599240898342154 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.717421103006767e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 3.717421103006767e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348728123731 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291179996932946e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1032756388729088e-07 +-2.8861259243662124e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439527715469e+00 +1.7315312702483288e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439527715469e+00 +1.7315312702483288e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952771547e+00 1.731531270248329e+00 6.173306310586213e-11 2.524158659866771e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_1.out new file mode 100644 index 0000000000..15ea8a977a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_4_1_1.out @@ -0,0 +1,1669 @@ +Start MRIStep Logging test +Using Im-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480918398010767 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.003886272468077529 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.8553888836324380e-08 +-2.0784476930205360e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448128377001e+00 +1.7320300230919470e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-1.2243085853261794e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3475585363111305e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084340204523627e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448603072488e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743563976650e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1084340204523627e-08 +-2.0360974952462060e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448603072488e+00 +1.7320487714713819e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725490751359e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2168680409047254e-08 +-4.0716590491129183e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492229085e+00 +1.7320467359098282e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413578936342e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6626510306785440e-08 +-2.2904091645331682e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547650785e+00 +1.7320485171597126e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084367887005e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492229085e+00 +1.7320467356443128e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674194043493, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967226281753, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164137698822 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469389405397e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492229085e+00 +1.7320467356443128e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413318121854e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737843891214193e-11 +-1.6802156955267397e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491771706e+00 +1.7320467188421558e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681111180715e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5737843891214193e-11 +-1.6836822569526709e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491771706e+00 +1.7320467188074902e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681077130140e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1475687782428386e-11 +-3.3673645101739513e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491314328e+00 +1.7320467019706676e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948868313424e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8606765836821283e-11 +-2.5242234235014337e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491543018e+00 +1.7320467104020785e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314981469083e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491314328e+00 +1.7320467019706676e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634407533082e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.970596152824813e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +2.0649439001801817e-08 +-4.1055982096249721e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.675240952507911 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007682656087209085 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.3855759618329732e-09 +-4.1055973456764745e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448660060130e+00 +1.7320467019715315e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-5.4436849480715918e-05 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0204268080058528e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182220967714609e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702733668e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717795066694e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1182220967714609e-09 +-1.3866420142768993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702733668e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579232167547e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364441935429217e-09 +-2.7732536600659454e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691551448e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296602978513e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6773331451571915e-09 +-1.5599608807842594e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697142558e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472630325087e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404386289653829, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.063963430758315e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691551448e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296601464152e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364441935429216e-08 +-5.5465375953047665e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467907029e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698767353993e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2364441935429216e-08 +-6.1017770813082445e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467907029e+00 +1.7320446780591074e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240798979678e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4728883870858431e-08 +-1.2201161743761258e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244262609e+00 +1.7320385786744450e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939292931404e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3546662903143825e-08 +-7.0716009260773599e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448356084818e+00 +1.7320437082352627e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503566897770e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244262609e+00 +1.7320385774980056e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00153410775187103, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472743441796188, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359857790466248 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809670603232e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244262609e+00 +1.7320385774980056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938152589187e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538676368091943e-08 +-1.4342442210495329e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968875844e+00 +1.7320242350557951e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189378687811e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7538676368091943e-08 +-2.2753136252560206e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968875844e+00 +1.7320158243617529e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188075681905e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5077352736183887e-08 +-4.5501953816268376e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693489082e+00 +1.7319930755441892e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620669192147e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1308014552137917e-08 +-3.0974095395338532e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447831182463e+00 +1.7320076034026102e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380172393208e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693489082e+00 +1.7319930734957281e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682865918977238, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535551282218148, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550371668616321 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844435520364e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.4608057715444910e-09 +-5.7734073149129372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55774369269417 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01080099623073331 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0208536560049759e-07 +-5.7734061002883788e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769306223e+00 1.731993073507874e+00 2.329714199333921e-11 3.659073044559591e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-2.0412407980138390e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412407980138395e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693489082e+00 +1.7319930734957281e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620478002440e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237223940415110e-08 +-3.4639861434007275e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447081116842e+00 +1.7319584336342941e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735421534613e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237223940415110e-08 +-4.5032206264603784e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447081116842e+00 +1.7319480412894634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786254039512e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247444788083022e-07 +-9.0058717524236964e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468744603e+00 +1.7319030147782037e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630414241810e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855835910622671e-08 +-6.3649095230442374e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774930724e+00 +1.7319294244004977e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983373807931e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468744603e+00 +1.7319030122014847e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794542729744, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522761020554, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871268367595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654002685442e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4807203267049808e-08 +-9.0061306389666029e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74977069074764 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01684727551980917 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.8098567046402302e-07 +-9.0061287444670961e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247445883205530e+00 +1.7319030122204297e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-3.2655497711517312e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8759969160624009e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620481270339e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346625547498667e-08 +-1.5395493975027113e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447309595978e+00 +1.7319776780138993e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141135738602e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8346625547498667e-08 +-1.7448188180984795e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447309595978e+00 +1.7319756253196934e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951375563096e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6693251094997334e-08 +-3.4895870334834906e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446926129724e+00 +1.7319581776375395e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425348489060e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7519938321247994e-08 +-2.5402336074196082e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447117862851e+00 +1.7319676711718002e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741979523101e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446926129724e+00 +1.7319581774052735e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868658914024, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433912557463, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127172090488 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892949201e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +6.3840917578490494e-08 +-3.4896102600878720e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23943664292217 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006528828278646521 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.9818647334992893e-08 +-3.4896095259151938e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247447094875761e+00 +1.7319581774126152e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-2.5856090855177040e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0616676507755293e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620481270339e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308338253877633e-07 +-5.7733102406351646e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162228408e+00 +1.7319353404054680e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509139811002e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5308338253877633e-07 +-8.6602545699054936e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162228408e+00 +1.7319064709621752e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910889909346e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0616676507755265e-07 +-1.7317910889909331e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631394584e+00 +1.7318198943989753e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932443414264e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2962507380816450e-07 +-1.1906830484701114e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445396811496e+00 +1.7318740052030273e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197679393413e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631394584e+00 +1.7318198828529008e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00236999152469835, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191863710416, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191863710418 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614626991023 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693062234e+00 +1.7319930735078743e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.1096028622597713e-07 +-1.7319065497356512e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.6708677907402 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.03240190722051899 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0620935125911909e-07 +-1.7319061853693479e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463096872e+00 1.731819882889337e+00 4.649436391446216e-11 3.171818363512102e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-4.0824804554866900e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824804554866911e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631394584e+00 +1.7318198828529008e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931442754484e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247441366460058e-07 +-6.9272794328263372e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443406650447e+00 +1.7317506100585724e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868341103315e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247441366460058e-07 +-7.9661605023309849e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443406650447e+00 +1.7317402212478774e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988755126933e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494882732920117e-07 +-1.5931793253076140e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442181906312e+00 +1.7316605649203700e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446876458585e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371162049690086e-07 +-1.1559471422656621e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794278378e+00 +1.7317042881386742e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501460401668e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442181906312e+00 +1.7316605627603894e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458421340622, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240084486997, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733474145002 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614202090989e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-4.9657175802361520e-08 +-1.5932012894803727e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01750170982633 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0344390384820746e-07 +-1.5924708716715297e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247441596529685e+00 +1.7316606358021702e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-5.3064236929429177e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9169872082977526e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931448041638e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5559829443970004e-08 +-3.0787908597388837e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443975370429e+00 +1.7317890949807400e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962781409834e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5559829443970004e-08 +-3.2839950375213099e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443975370429e+00 +1.7317870429389621e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786761825689e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3111965888794001e-07 +-6.5679431364868486e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443319772133e+00 +1.7317542034579725e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730339317464e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8339744165955013e-08 +-4.8490241189541109e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443647571281e+00 +1.7317713926481479e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313867312961e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443319772133e+00 +1.7317542032622826e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250108435563, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00197688010409814, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300390368028 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98796482152001e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +1.0702619679834452e-07 +-6.5679627054837653e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80340866628079 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.1425074787646166e-07 +-6.5649513032830920e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443488461243e+00 +1.7317542333763045e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +-4.6266977813303936e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1026110260369000e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931448041638e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5513055130184477e-07 +-1.1545465724020809e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442079663209e+00 +1.7317044282320972e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702540443119e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5513055130184477e-07 +-1.4431351270221548e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442079663209e+00 +1.7316755693766352e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297635801807e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1026110260368953e-07 +-2.8860297635801782e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439528357695e+00 +1.7315312799129794e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623682025791e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8269582695276718e-07 +-2.0563963143959601e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440804010452e+00 +1.7316142432578978e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260582927854e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439528357695e+00 +1.7315312702968666e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854911908458, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227506071543212, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060715432122 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086790420591 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444630968722e+00 +1.7318198828893374e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.1745966904967574e-07 +-2.8861259247081605e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7808468031958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1030635856856885e-07 +-2.8848026595381710e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439527905137e+00 +1.7315314026233837e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439527905137e+00 +1.7315314026233837e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952790514e+00 1.731531402623384e+00 4.276623499777088e-11 1.323498133309897e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 0 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_0.out new file mode 100644 index 0000000000..c30aa63410 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_0.out @@ -0,0 +1,1672 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 8.484739570785543 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.002872021134577523 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.9864432745239724e-11 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448713517246e+00 +1.7320300230875767e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-1.2247447979467626e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3403120151440330e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3555374714617959e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935066637513e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448602966540e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743569274107e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935066637513e-08 +-2.0360974959496313e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448602966540e+00 +1.7320487714713813e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725496048181e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2189870133275026e-08 +-4.0716590505196003e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492017188e+00 +1.7320467359098266e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413589529698e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6642402599956269e-08 +-2.2904091653244655e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547491864e+00 +1.7320485171597120e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084375832465e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492017188e+00 +1.7320467356443114e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674146882004, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967181006723, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164120650628 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469444730164e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492017188e+00 +1.7320467356443114e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413328715335e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781561978215532e-11 +-1.6802156961071766e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491559372e+00 +1.7320467188421544e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681121796171e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781561978215532e-11 +-1.6836822575343116e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491559372e+00 +1.7320467188074888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681087745596e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1563123956431065e-11 +-3.3673645113372333e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491101556e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948878950766e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8672342967323299e-11 +-2.5242234243734439e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491330464e+00 +1.7320467104020771e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314992095555e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491101556e+00 +1.7320467019706662e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634423980587e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 6.483386286293241e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.2255707022780660e-08 +-4.1055982109572398e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 1.676051713901 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005550288725063259 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2242293871998756e-08 +-4.1055982109572398e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448491492952e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-5.4433105738595036e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9968511892257957e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0207733751935617e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186018781377200e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702729871e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717796964892e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186018781377200e-09 +-1.3866420144849109e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702729871e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579234065745e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372037562754401e-09 +-2.7732536604819686e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691543852e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296606776721e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6779028172065802e-09 +-1.5599608810182602e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697136860e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472633174197e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691543852e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404323881355509, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691543852e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296605262359e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372037562754398e-08 +-5.5465375961372104e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467823476e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698771531659e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372037562754398e-08 +-6.1017770822238533e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467823476e+00 +1.7320446780591066e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240803156462e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4744075125508797e-08 +-1.2201161745592089e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244103101e+00 +1.7320385786744432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939300905032e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3558056344131599e-08 +-7.0716009271385050e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448355963289e+00 +1.7320437082352618e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503572973347e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244103101e+00 +1.7320385774980036e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534114165041092, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472749598439449, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359871835985131 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.45080967336947e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244103101e+00 +1.7320385774980036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938160562566e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548029318785941e-08 +-1.4342442212647139e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968622807e+00 +1.7320242350557911e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189391335916e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548029318785941e-08 +-2.2753136255973603e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968622807e+00 +1.7320158243617476e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188088328789e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5096058637571881e-08 +-4.5501953823094513e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693142515e+00 +1.7319930755441806e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620670924172e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1322043978178914e-08 +-3.0974095399985307e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447830882661e+00 +1.7320076034026035e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380187377041e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693142515e+00 +1.7319930734957192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682858593170752, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544249443922, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550358638884499 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844408964292e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.0199734610235782e-07 +-5.7734073158011157e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 23.56853105559693 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.00792134563849221 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0201052215427040e-07 +-5.7734073158011157e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769381067e+00 1.731993073495719e+00 5.154610072111154e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-2.0412412821299464e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-1.0734004556011921e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412423555304026e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142515e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479734454e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237270665912006e-08 +-3.4639861439203321e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447080769809e+00 +1.7319584336342799e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735423268484e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237270665912006e-08 +-4.5032206269805400e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447080769809e+00 +1.7319480412894495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786255773402e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247454133182401e-07 +-9.0058717534640304e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468397101e+00 +1.7319030147781846e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630415977613e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855905998868009e-08 +-6.3649095238242734e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774583455e+00 +1.7319294244004810e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983375542785e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468397101e+00 +1.7319030122014651e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794539263066, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522757692544, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871262820911 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654020389983e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.2254130528094580e-07 +-9.0061294254040192e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 36.76651861107677 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.01237684727413916 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.2259689042719381e-07 +-9.0061294254040192e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247446467841763e+00 +1.7319030122014651e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-3.2659855291765393e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3345335419762910e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8767946012124476e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620476393690e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357261349499285e-08 +-1.5395493968524915e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447310238053e+00 +1.7319776780017506e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141131405149e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357261349499285e-08 +-1.7448188175206858e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447310238053e+00 +1.7319756253075440e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951371229571e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6714522698998570e-08 +-3.4895870323278842e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446926665440e+00 +1.7319581776253958e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425344698667e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7535892024248931e-08 +-2.5402336065257510e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447118451746e+00 +1.7319676711596539e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741975461167e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446926665440e+00 +1.7319581773931296e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868660048197, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433913646269, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127176173512 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182892963146e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-7.6688802928446289e-08 +-3.4896102589554445e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 14.24598132523421 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.004779612504313948 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-7.6682434002464837e-08 +-3.4896102589554445e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247446926986327e+00 +1.7319581773931296e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-2.5855721921105873e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9875259083419154e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0620144019338736e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620476393690e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310072009669355e-07 +-5.7733102381968400e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162803466e+00 +1.7319353403933373e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509135843956e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310072009669355e-07 +-8.6602545679219701e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162803466e+00 +1.7319064709500400e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910885941884e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0620144019338711e-07 +-1.7317910885941869e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631796265e+00 +1.7318198943868597e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932440355838e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2965108014504033e-07 +-1.1906830481555141e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445397299865e+00 +1.7318740051909036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197675880648e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631796265e+00 +1.7318198828407851e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991524318626, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00227519186334588, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191863345882 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614627903846 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693810667e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-3.0612154947108023e-07 +-1.7319065493404118e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 70.70322900199585 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02376157169292097 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0616099692236107e-07 +-1.7319065493404118e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463220070e+00 1.731819882840785e+00 7.670308832530282e-11 1.683408967778632e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-4.0824815435551822e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-1.6182317202176099e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824831617869032e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631796265e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931439696055e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247449485360696e-07 +-6.9272794319088081e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443407051317e+00 +1.7317506100464661e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868338073955e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247449485360696e-07 +-7.9661605014221768e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443407051317e+00 +1.7317402212357709e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988752097550e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494898970721393e-07 +-1.5931793251258513e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442182306367e+00 +1.7316605649082726e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446873458246e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371174228041043e-07 +-1.1559471421290134e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794678842e+00 +1.7317042881265723e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501457386813e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442182306367e+00 +1.7316605627482917e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458421962382, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240085083887, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733475139817 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614197700071e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4498935556889249e-07 +-1.5932009249342016e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 65.04718221193126 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02187885806556827 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.4506072053909620e-07 +-1.5932009249342016e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247442181593491e+00 +1.7316605627482917e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-5.3072246272269725e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3420917813768941e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9180347581174967e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931437673895e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573796774899929e-08 +-3.0787908583565184e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443976462729e+00 +1.7317890949322017e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962771784825e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573796774899929e-08 +-3.2839950362379757e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443976462729e+00 +1.7317870428904227e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786752200572e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3114759354979986e-07 +-6.5679431339201504e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443320724762e+00 +1.7317542034094460e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730330434964e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8360695162349900e-08 +-4.8490241169919625e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443648593745e+00 +1.7317713925996152e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313858059180e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443320724762e+00 +1.7317542032137558e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250126014113, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120973548, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300453650809 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964733044311e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.3112184019393055e-07 +-6.5679627029302523e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 26.8157053695451 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.009003158261554924 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3112248854313671e-07 +-6.5679627029302523e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443320975810e+00 +1.7317542032137558e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-4.6268120339998809e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9834752213812049e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1032543147923868e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931437673895e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516271573961913e-07 +-1.1545465718836938e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442080573538e+00 +1.7317044281835967e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702531849788e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516271573961913e-07 +-1.4431351265924882e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442080573538e+00 +1.7316755693281258e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297627207682e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1032543147923826e-07 +-2.8860297627207658e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439528946382e+00 +1.7315312798645131e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623675205047e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8274407360942867e-07 +-2.0563963137181632e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440804759961e+00 +1.7316142432094133e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260575220731e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439528946382e+00 +1.7315312702484000e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854904993055, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708793333, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708793335 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989621 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632200697e+00 +1.7318198828407851e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.1024548984602376e-07 +-2.8861259238510684e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 117.8347804246883 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.03959595686370691 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1031117389954834e-07 +-2.8861259238510684e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439529088957e+00 +1.7315312702484000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439529088957e+00 +1.7315312702484000e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952908896e+00 1.731531270248400e+00 7.561573589498494e-11 2.517031028048677e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_0.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_0.out new file mode 100644 index 0000000000..cc5d6d7a63 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_0.out @@ -0,0 +1,1801 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 8.484739570785543, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 11.99923377420859, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.004061628839918641 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.261188224676155e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.261188224676155e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.484739092489631 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.518443352071625e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.5084110059761341e-11 +-2.0784481300495362e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448713565048e+00 +1.7320300230875767e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-1.2247447979419823e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3412680392131972e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3555381232637956e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935932135499e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448602966531e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743569274560e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935932135499e-08 +-2.0360974959496914e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448602966531e+00 +1.7320487714713813e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725496048634e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2189871864270998e-08 +-4.0716590505197206e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492017170e+00 +1.7320467359098266e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413589530559e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6642403898203250e-08 +-2.2904091653245337e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547491850e+00 +1.7320485171597120e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084375833145e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492017170e+00 +1.7320467356443114e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674137449705, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967171951717, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164117240989 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469455795117e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492017170e+00 +1.7320467356443114e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413328716196e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781565549561332e-11 +-1.6802156961072236e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491559354e+00 +1.7320467188421544e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681121797077e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781565549561332e-11 +-1.6836822575343612e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491559354e+00 +1.7320467188074888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681087746502e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1563131099122665e-11 +-3.3673645113373325e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491101538e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948878951675e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8672348324341995e-11 +-2.5242234243735177e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491330446e+00 +1.7320467104020771e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314992096416e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491101538e+00 +1.7320467019706662e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634427270088e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.2255705448462166e-08 +-4.1055982109572398e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.676051713894338, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.370295065028044, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.000784909752142059 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.830518996709413e-16 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 4.830518996709413e-16 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.676055870103954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.705857208966444e-10, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2241373093805551e-08 +-4.1055982109572406e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448491502158e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-5.4433105738554121e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9966670623003566e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0207734372028466e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186019460898280e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702729871e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717796964892e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186019460898280e-09 +-1.3866420144849109e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702729871e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579234065745e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038921796559e-09 +-2.7732536604819686e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691543850e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296606777627e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6779029191347421e-09 +-1.5599608810182542e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697136860e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472633174197e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691543850e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404342563461688, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06434270796446e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691543850e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296605263266e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038921796557e-08 +-5.5465375961374084e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467823461e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698771532429e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038921796557e-08 +-6.1017770822240218e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467823461e+00 +1.7320446780591066e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240803157232e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4744077843593115e-08 +-1.2201161745592426e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244103072e+00 +1.7320385786744432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939300906482e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3558058382694840e-08 +-7.0716009271387023e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448355963266e+00 +1.7320437082352618e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503572974478e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244103072e+00 +1.7320385774980036e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534112244459035, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472747754680673, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359867629707846 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809675029214e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244103072e+00 +1.7320385774980036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938160564016e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548030992255921e-08 +-1.4342442212647530e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968622762e+00 +1.7320242350557911e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189391338136e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548030992255921e-08 +-2.2753136255974203e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968622762e+00 +1.7320158243617476e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188088331009e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5096061984511843e-08 +-4.5501953823095712e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693142453e+00 +1.7319930755441806e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620670924480e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1322046488383884e-08 +-3.0974095399986134e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447830882607e+00 +1.7320076034026035e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380187379720e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693142453e+00 +1.7319930734957192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682860787673002, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535546356166082, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.5503625420419 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844413390305e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.0199734387279251e-07 +-5.7734073158011157e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 23.56853105559414, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 33.33093626403272, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01120227586871812 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 7.102299192199702e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 7.102299192199702e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.56854949834894 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.271889714640072e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0199718764843075e-07 +-5.7734073158011136e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394401e+00 1.731993073495719e+00 6.488076742527937e-11 8.496092718246473e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-2.0412412821077221e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-1.3400926207275895e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412426222003434e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142453e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479734762e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237278666010224e-08 +-3.4639861439204249e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447080769667e+00 +1.7319584336342799e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735423269192e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237278666010224e-08 +-4.5032206269807521e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447080769667e+00 +1.7319480412894495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786255774110e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247455733202045e-07 +-9.0058717534644559e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468396879e+00 +1.7319030147781846e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630415978723e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855917999015343e-08 +-6.3649095238245472e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774583273e+00 +1.7319294244004810e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983375543698e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468396879e+00 +1.7319030122014651e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002681794538508985, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522756968625, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871261614381 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654029242241e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.2255464939726777e-07 +-9.0061294254040192e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 36.76651862332542, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 51.99570927834978, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01750303644230911 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.148830835061795e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.148830835061795e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.76654034473584 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.144297537687311e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.2258920305646812e-07 +-9.0061294254040165e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247446468051983e+00 +1.7319030122014651e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-3.2659855291204801e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3387379492131508e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8767949726878821e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620475726960e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357266302505081e-08 +-1.5395493967635941e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447310371351e+00 +1.7319776780017515e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141130738743e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357266302505081e-08 +-1.7448188174318317e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447310371351e+00 +1.7319756253075449e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951370563162e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6714532605010162e-08 +-3.4895870321501754e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446926798689e+00 +1.7319581776253976e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425344032583e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7535899453757619e-08 +-2.5402336063924537e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447118585020e+00 +1.7319676711596552e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741974794916e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446926798689e+00 +1.7319581773931316e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00223586866744231, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433920744618, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.04912720279232 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.98718285976718e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-7.6688794554983240e-08 +-3.4896102587556044e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 14.2459813244254, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 20.14685999831622, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.006759308947646806 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.729049992208015e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.729049992208015e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.24599536081284 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 4.511848546542516e-08, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-7.6674448626352435e-08 +-3.4896102587556044e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247446927199528e+00 +1.7319581773931316e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-2.5855721920655782e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9832619926399214e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0620148636959920e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620475726960e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310074318479946e-07 +-5.7733102378634749e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162936582e+00 +1.7319353403933406e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509135178677e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310074318479946e-07 +-8.6602545675893314e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162936582e+00 +1.7319064709500434e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910885276594e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0620148636959893e-07 +-1.7317910885276578e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631929150e+00 +1.7318198943868663e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932439691991e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2965111477719920e-07 +-1.1906830481055904e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445397432866e+00 +1.7318740051909087e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197675216102e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631929150e+00 +1.7318198828407918e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991520997443, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191860157545, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191860157547 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.000393261463144475 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693944014e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-3.0612157378190393e-07 +-1.7319065492737984e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 70.70322899932275, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 99.98946535441294, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03360221435305671 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.396025428056713e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.396025428056713e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.70328434722259 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.178331477975891e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0611966236997286e-07 +-1.7319065492737987e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463274739e+00 1.731819882840792e+00 1.313724684592898e-10 1.682742833963857e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-4.0824815433729511e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-2.7115855897751726e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824842549585421e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631929150e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931439032211e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247452764875611e-07 +-6.9272794317096551e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443407183873e+00 +1.7317506100464748e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868337411918e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247452764875611e-07 +-7.9661605012235659e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443407183873e+00 +1.7317402212357795e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988751435513e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494905529751222e-07 +-1.5931793250861288e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442182438597e+00 +1.7316605649082832e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446872797991e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371179147313416e-07 +-1.1559471420992015e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794811234e+00 +1.7317042881265818e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501456725658e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442182438597e+00 +1.7316605627483024e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458425788795, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240088757243, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733481262078 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184420337e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4503074967992138e-07 +-1.5932009248942336e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 65.04718225429593, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 91.99060733817983, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.03093990190491139 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.983157730959663e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.983157730959663e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.04722612054304 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 9.96013596045361e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.4506418771914065e-07 +-1.5932009248942333e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247442182105515e+00 +1.7316605627483024e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-5.3072246270050960e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3523317279447949e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9180358039717321e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931434941006e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573810719623073e-08 +-3.0787908579921330e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443977009282e+00 +1.7317890949322119e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962769052940e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5573810719623073e-08 +-3.2839950358737244e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443977009282e+00 +1.7317870428904332e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786749468710e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3114762143924615e-07 +-6.5679431331916533e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443321271176e+00 +1.7317542034094600e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730327704082e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8360716079434609e-08 +-4.8490241164455381e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443649140231e+00 +1.7317713925996274e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313855327793e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443321271176e+00 +1.7317542032137698e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250143306553, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00197688013757429, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300515903591 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964644512875e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.3112181831161681e-07 +-6.5679627021975051e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 26.815705366597, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 37.92313421404247, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.01273212495283929 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 5.431424283260585e-15 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 5.431424283260585e-15 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.81572924528313 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 1.655080176519261e-07, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3110732961450352e-07 +-6.5679627021975065e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443321674094e+00 +1.7317542032137698e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-4.6268120337360848e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9695102423337695e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1032555949963418e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931434941006e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516277974981690e-07 +-1.1545465717470494e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442081119593e+00 +1.7317044281836171e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702529121226e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5516277974981690e-07 +-1.4431351264560600e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442081119593e+00 +1.7316755693281463e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297624479120e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1032555949963379e-07 +-2.8860297624479095e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439529491795e+00 +1.7315312798645470e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623672480704e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8274416962472532e-07 +-2.0563963135134404e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440805305694e+00 +1.7316142432094404e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260572494289e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439529491795e+00 +1.7315312702484342e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854897811197, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060701898749, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060701898751 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086786989607 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632747391e+00 +1.7318198828407918e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.1024558266542958e-07 +-2.8861259235757331e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 117.8347804136278, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 166.643544580208, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.05599239103918983 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.062550360780627e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, resnorm = 2.062550360780627e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.8348726538357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.291178169077933e-06, b-tol = 0.0005000000000000001, res-tol = 0.0007071067811865477 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1024008034800520e-07 +-2.8861259235757325e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439530346587e+00 +1.7315312702484342e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439530346587e+00 +1.7315312702484342e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953034659e+00 1.731531270248434e+00 2.013786915000537e-10 2.513611541132832e-11 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 27 +Inner stepper failures = 0 +NLS iters = 18 +NLS fails = 0 +NLS iters per step = 6 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 18 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 18 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 18 +LS iters per NLS iter = 1 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_1.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_1.out new file mode 100644 index 0000000000..da579019c2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_5_1_1.out @@ -0,0 +1,1705 @@ +Start MRIStep Logging test +Using ImEx-MRI-SR method +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 2.059355438929501e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +8.5332324353576826e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.1889694230616173e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.02967771946475e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2067813040964829e-24 +-1.2242553240514061e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688650e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.1889694108828618e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4135626081929657e-24 +-2.4485106230224258e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3779388340687632e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.544516579197126e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.8101719561447239e-24 +-1.3772872301180226e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688634e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.7834541255044815e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.766300713710683e-06, h_cfl = 2.059355438929501e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.695648685162256e-06, h_cfl = 1.029677719464751e+22 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472583 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 4.861712124677889e-19 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 2.059355438929501e-08, h = 1.695648685162256e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.059355438929501e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688525e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3779388338123684e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-2.0160744284751053e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075668364e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.0027630277357223e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.68417896970423e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.9364932001893499e-23 +-8.5016690475470017e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508074838359e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.0027621977792367e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.9872986400378700e-22 +-1.7003324021947768e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.292330068260987e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.4904739800284026e-22 +-9.6399751925935201e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508074724528e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4922542246468209e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.901811588832878e-05, h_cfl = 1.695648685162256e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.785739125279562e-05, h_cfl = 8.47824342581128e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.270050270926313e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.716242239551551e-06, h = 2.785739125279562e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716242239551551e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508073988192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9817458362989841e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.7603134562689734e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508046385057e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.8065329798490591e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.564493786594936e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6324417975291304e-21 +-2.5162648015366993e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507822361713e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.8065106008801368e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582609e-21 +-5.0324672611040883e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507570741466e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4148689076686934e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 2.260928567914827e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.4486626962936955e-21 +-2.9342862858857047e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507780559564e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.6106953640960742e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008040108168818409, h_cfl = 2.785739125279562e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0005571478250559124, h_cfl = 1.392869562639781e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.365757457818316e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.957363349234717e-05, h = 0.0005571478250559124 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.957363349234717e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507570738355e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.4148689073582993e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.5129339229286827e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320498057804432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.5586084640419201e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0003081475460203033 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +3.2648835950582604e-20 +-9.9133548298325844e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320408437190056e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.5577306688127808e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.5297671901165209e-20 +-1.9821819042637574e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320309352547929e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.7747965740933266e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004474345022842815 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.8973253925873913e-20 +-1.1507434916573431e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320392496389190e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.1664931509040730e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001732294472367856, h_cfl = 5.571478250559124e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001663002693473142, h_cfl = 2.785739125279562e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.984850014098595 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.787223456299231e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0005867214585482596, h = 1.327854145174034e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0005867214585482596 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320309328611767e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-6.7747963440942832e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.4979707041077427e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320304830641062e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-6.8514575742804049e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0005933607292741297 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +7.7812189516736378e-22 +-4.5488681702461341e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320304779743596e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-6.8514570854394510e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5562437903347276e-21 +-9.0977356913827813e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320300230876076e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-6.9281182547766579e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0005966803646370648 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.1671828427510456e-21 +-6.8042154646761999e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320302524396303e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-6.8897877999666526e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320300230875767e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00118656220548466, h_cfl = 1.327854145174034e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002655708290348068, h_cfl = 6.63927072587017e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.221308228319648e-11 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.6052128249628413e-20 +-2.0784481300495372e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 8.480683165445265 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.004053988672151497 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.5109224364062977e-11 +-2.0784476551625048e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247448713564797e+00 +1.7320300230923256e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-1.2247447979420075e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3410255733684976e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-8.3555379579463464e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002655708290348068 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935712618040e-08 +1.1004305373251416e-20 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448602966533e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5333743569274423e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001327854145174034 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1094935712618040e-08 +-2.0360974959496732e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448602966533e+00 +1.7320487714713813e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5331725496048497e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2189871425236080e-08 +-4.0716590505196842e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448492017174e+00 +1.7320467359098266e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0665413589530333e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001991781217761051 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6642403568927060e-08 +-2.2904091653245125e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448547491853e+00 +1.7320485171597120e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.2999084375833010e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448492017174e+00 +1.7320467356443114e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008617674111510887, h_cfl = 2.655708290348068e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0008272967147050451, h_cfl = 1.327854145174034e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.115164107864483 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.954469486223738e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002655708290348068, h = 1.095837631859871e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002655708290348068 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448492017174e+00 +1.7320467356443114e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-3.0665413328715970e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781564643755923e-11 +-1.6802156961072114e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448491559358e+00 +1.7320467188421544e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-3.0728681121796851e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002661187478507367 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.5781564643755923e-11 +-1.6836822575343490e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448491559358e+00 +1.7320467188074888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-3.0728681087746276e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002666666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1563129287511846e-11 +-3.3673645113373074e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448491101542e+00 +1.7320467019706662e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0791948878951446e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0002663927072587017 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.8672346965633888e-11 +-2.5242234243734988e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448491330450e+00 +1.7320467104020771e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.0760314992096190e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448491101542e+00 +1.7320467019706662e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 8.300634436316217e-05, h_cfl = 1.095837631859871e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.191675263719742e-05, h_cfl = 5.479188159299354e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.186709029034592e-16 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.2255705854167800e-08 +-4.1055982109572398e-06 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 1.67525688591453 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0007986236836926118 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.2241373738339830e-08 +-4.1055972754450757e-06 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247448491502153e+00 +1.7320467019716017e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-5.4433105738554142e-05 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9967139259229676e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-1.0207734214632975e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0, h = 2.191675263719742e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186019288418377e-09 +9.0815184667034262e-22 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448702729871e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2653717796964892e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.095837631859871e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.1186019288418377e-09 +-1.3866420144849109e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448702729871e+00 +1.7320507937024570e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2653579234065745e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038576836754e-09 +-2.7732536604819686e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448691543852e+00 +1.7320507798363405e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5307296606776721e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.643756447789806e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.6779028932627567e-09 +-1.5599608810182602e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448697136860e+00 +1.7320507919692685e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.8980472633174197e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448691543852e+00 +1.7320507798361888e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0005404323877531033, h_cfl = 2.191675263719742e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004383350527439483, h_cfl = 1.095837631859871e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.06450479224059e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 2.191675263719742e-05, h = 0.0004383350527439483 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.191675263719742e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448691543852e+00 +1.7320507798361888e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5307296605262359e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038576836752e-08 +-5.5465375961372104e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448467823465e+00 +1.7320502251824292e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.7840698771532203e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002410842790091716 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2372038576836752e-08 +-6.1017770822239727e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448467823465e+00 +1.7320446780591066e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.7835240803157003e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.4744077153673503e-08 +-1.2201161745592327e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448244103081e+00 +1.7320385786744432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.3144939300906031e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003506680421951587 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.3558057865255131e-08 +-7.0716009271386405e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448355963273e+00 +1.7320437082352618e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.0491503572974118e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448244103081e+00 +1.7320385774980036e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001534114165267298, h_cfl = 4.383350527439483e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001472749598656606, h_cfl = 2.191675263719742e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.359871836480545 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.450809672262975e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.0004602518053811457, h = 0.0005397481946188539 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004602518053811457 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448244103081e+00 +1.7320385774980036e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.3144938160563565e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548030567486259e-08 +-1.4342442212647408e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447968622776e+00 +1.7320242350557911e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.4310189391337456e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0007301259026905727 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.7548030567486259e-08 +-2.2753136255974020e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447968622776e+00 +1.7320158243617476e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.4302188088330329e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999996 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.5096061134972518e-08 +-4.5501953823095339e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447693142470e+00 +1.7319930755441806e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546620670924394e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008650629513452862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.1322045851229389e-08 +-3.0974095399985876e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447830882623e+00 +1.7320076034026035e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.9886380187378956e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447693142470e+00 +1.7319930734957192e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003682858591084714, h_cfl = 5.397481946188539e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003535544247441325, h_cfl = 2.698740973094269e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 6.550358635174256 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 3.335844417816317e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.0199734423813991e-07 +-5.7734073158011157e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 23.55729311954163 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01125102526633561 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.0199740489106686e-07 +-5.7734059978447271e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769394184e+00 1.731993073508899e+00 6.466338575705777e-11 4.683364807078760e-12 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-2.0412412821080842e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-1.2698480785892690e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0016 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412425519561635e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.001, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693142470e+00 +1.7319930734957192e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620479734676e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237276558684830e-08 +-3.4639861439203985e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447080769704e+00 +1.7319584336342799e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5010735423269006e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1237276558684830e-08 +-4.5032206269806965e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447080769704e+00 +1.7319480412894495e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5009786255773924e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247455311736966e-07 +-9.0058717534643434e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446468396939e+00 +1.7319030147781846e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.8473630415978423e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.1855914838027244e-08 +-6.3649095238244740e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446774583322e+00 +1.7319294244004810e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.6741983375543451e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446468396939e+00 +1.7319030122014651e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.00268179453937895, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002574522757803792, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.290871263006324 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.094654024816112e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.2255442937991680e-07 +-9.0061307433497717e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 36.74898235634708 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.01755499643145954 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.2258952213813686e-07 +-9.0061286870036112e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247446468046619e+00 +1.7319030122220287e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-3.2659855291219107e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-7.3376024761442997e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.8767948729198177e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.001, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620476967906e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357264972264223e-08 +-1.5395493969290535e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447310369191e+00 +1.7319776780149294e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.3086141131967766e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.001133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8357264972264223e-08 +-1.7448188175957014e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447310369191e+00 +1.7319756253207226e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.3085951371792176e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6714529944528446e-08 +-3.4895870324779121e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446926796541e+00 +1.7319581776385740e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.4625425345249687e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0012 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.7535897458396334e-08 +-2.5402336066388532e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247447118582866e+00 +1.7319676711728322e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.3855741976017971e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446926796541e+00 +1.7319581774063078e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002235868674431794, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002146433927454522, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 8.049127227954459 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987182826556093e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-7.6688796767645837e-08 +-3.4896102590886713e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 14.23919293845223 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.006799198459570063 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-7.6674523609921790e-08 +-3.4896094626516041e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247446927196604e+00 +1.7319581774142720e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-2.5855721920661957e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +2.9843774989770155e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-3.0620147411892639e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 13, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620476967906e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310073705946308e-07 +-5.7733102384839482e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446162934470e+00 +1.7319353404065139e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320509136374826e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5310073705946308e-07 +-8.6602545681874058e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446162934470e+00 +1.7319064709632168e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910886472782e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0620147411892615e-07 +-1.7317910886472767e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444631927098e+00 +1.7318198944000338e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932440843431e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.2965110558919459e-07 +-1.1906830481961428e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445397430783e+00 +1.7318740052040791e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205197676389894e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444631927098e+00 +1.7318198828539597e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369991518503224, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275191857763095, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275191857763097 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932614629644375 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247447693941840e+00 +1.7319930735088986e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-3.0612156762352759e-07 +-1.7319065493892616e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 70.66951636300151 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.0337519319761958 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-3.0612168232798021e-07 +-1.7319061540256212e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463272502e+00 1.731819882893496e+00 1.291351470200652e-10 3.587685704076193e-11 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_0(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_0(:) = +-4.0824815433804088e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_0(:) = +-2.4033178483205057e-10 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 1, stage type = 0, tcur = 0.0026 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824839466982584e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 14, tn = 0.002, h = 0.0005999999999999993 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444631927098e+00 +1.7318198828539597e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931440183687e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247451840094761e-07 +-6.9272794320550981e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443407181915e+00 +1.7317506100596392e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.6553868338536279e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0023 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.2247451840094761e-07 +-7.9661605015608747e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443407181915e+00 +1.7317402212489441e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.6552988752559903e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002599999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.4494903680189523e-07 +-1.5931793251535922e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442182436730e+00 +1.7316605649214443e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.0015446873895307e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002449999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.8371177760142141e-07 +-1.1559471421501033e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247442794809322e+00 +1.7317042881397446e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.8284501457836503e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442182436730e+00 +1.7316605627614634e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003405458427581809, h_cfl = 5.999999999999993e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003269240090478537, h_cfl = 2.999999999999997e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.448733484130901 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.096614184381587e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-2.4502871384123470e-07 +-1.5932013203268092e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 65.01617199533266 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-2.4504698580765387e-07 +-1.5924403135587339e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_1(:) = +1.2247442182255159e+00 +1.7316606388621403e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_1(:) = +-5.3072246269402499e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_1(:) = +-3.5496328150800420e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 2, stage type = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.9177764309188236e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 15, tn = 0.002, h = 0.0002666666666666666 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931439620577e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5570352412250953e-08 +-3.0787908586160758e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443977021493e+00 +1.7317890949849100e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.4629962773512204e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.002133333333333333 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.5570352412250953e-08 +-3.2839950364682928e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443977021493e+00 +1.7317870429431315e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.4629786753927996e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002266666666666667 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.3114070482450191e-07 +-6.5679431343807968e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247443321317970e+00 +1.7317542034621523e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.6168730331943102e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0022 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.8355528618376435e-08 +-4.8490241173484082e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443649169731e+00 +1.7317713926523226e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.5399313859676953e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247443321317970e+00 +1.7317542032664621e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002059250125619163, h_cfl = 2.666666666666666e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001976880120594397, h_cfl = 1.333333333333333e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 7.413300452228991 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.987964732983807e-06 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-1.3112823326904340e-07 +-6.5679627033965460e-05 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 26.80292351487524 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-1.3110662625196716e-07 +-6.5648261767550079e-05 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_2(:) = +1.2247443321658755e+00 +1.7317542346317285e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow explicit RHS] Fse_2(:) = +-4.6268120337418798e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow implicit RHS] Fsi_2(:) = +4.5407149350998570e-08 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMRISR][begin-stage] stage = 3, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-5.1029474957413746e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 16, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931439620577e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514737478706853e-07 +-1.1545465719810279e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442081251270e+00 +1.7317044282362979e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862702532852874e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5514737478706853e-07 +-1.4431351266426426e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442081251270e+00 +1.7316755693808319e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297628211229e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1029474957413706e-07 +-2.8860297628211206e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439529777522e+00 +1.7315312799172140e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623675265437e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.8272106218060279e-07 +-2.0563963138111032e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440805514396e+00 +1.7316142432621149e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746260575752533e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439529777522e+00 +1.7315312703011012e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002369854905105276, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002275060708901065, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.275060708901067 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934086787755202 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][predictor] zpred(:) = +1.2247444632725017e+00 +1.7318198828934961e+00 + +[DEBUG][rank 0][mriStep_TakeStepMRISR][rhs data] sdata(:) = +-5.1024548807047213e-07 +-2.8861259239487680e-04 + +[INFO][rank 0][mriStep_Nls][begin-nonlinear-solve] tol = 0.1 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][arkLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][arkLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, resnorm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 117.7785945816081 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[DEBUG][rank 0][mriStep_Nls][correction] zcor(:) = +-5.1021765406485327e-07 +-2.8847474987429448e-04 + +[INFO][rank 0][mriStep_Nls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][mriStep_TakeStepMRISR][slow stage] z_3(:) = +1.2247439530548476e+00 +1.7315314081436217e+00 + +[INFO][rank 0][mriStep_TakeStepMRISR][end-stage] status = success +[DEBUG][rank 0][mriStep_TakeStepMRISR][updated solution] ycur(:) = +1.2247439530548476e+00 +1.7315314081436217e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743953054848e+00 1.731531408143622e+00 2.215676531136523e-10 1.378700513754438e-07 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 9 +Implicit slow RHS fn evals = 24 +Inner stepper failures = 0 +NLS iters = 15 +NLS fails = 0 +NLS iters per step = 5 +LS setups = 1 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.06666666666666667 +Prec evals per NLS iter = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_6.out b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_6.out new file mode 100644 index 0000000000..3067bfa29d --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_mristep_lvl5_6.out @@ -0,0 +1,1046 @@ +Start MRIStep Logging test +Using MERK method + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0 +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0005 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 1.716129532441251e-08 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +7.1110270294647367e-25 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-9.9080785169891240e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 8.580647662206255e-09 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.0056510867470693e-24 +-8.5017730763758747e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075688688e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-9.9080784323788145e-07 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.716129532441251e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.0113021734941386e-24 +-1.7003546007549496e-14 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508075688601e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.9816156949121734e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.287097149330938e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.5084766301206039e-24 +-9.5644946562629979e-15 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075688676e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.4862117712487205e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508075688599e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 1.47191726142557e-06, h_cfl = 1.716129532441251e+22 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 1.413040570968547e-06, h_cfl = 8.580647662206255e+21 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 82.33880626472582 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.681308618402001e-18 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 1.716129532441251e-08, h = 1.413040570968547e-06 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.716129532441251e-08 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688599e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.9816156946557782e-06 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 7.236815808086858e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577919e-23 +-1.4000516863083169e-12 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075674599e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-8.3563579887305288e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 7.236815808086858e-07 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +8.2804110001577919e-23 +-5.9039364318066809e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320508075098204e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-8.3563522250561589e-05 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 1.430201866292959e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.6560822000315584e-22 +-1.1807864719307641e-10 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320508074507812e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.6514548638396702e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.076941723550822e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2420616500236688e-22 +-6.6944273701660396e-11 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320508075019156e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.2435451873439189e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320508074507810e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 2.418176324027398e-05, h_cfl = 1.413040570968547e+24 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 2.321449271066302e-05, h_cfl = 7.065202854842734e+23 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 16.4287517199531 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.649460766305993e-15 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 1.430201866292959e-06, h = 2.321449271066302e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 1.430201866292959e-06 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508074507810e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.6514548638371066e-04 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 1.303744822162447e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-1.9168843449267750e-09 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508055338966e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.5054426026294332e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 1.303744822162447e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.3603681646076087e-21 +-1.7474043162531271e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320507899767379e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.5054270589925608e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 2.464469457695598e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152174e-21 +-3.4947725487417670e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320507725030556e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.8457241211930439e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 1.884107139929023e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.0405522469114132e-21 +-2.0376994912285665e-08 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320507870737860e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.1755794850147948e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320507725028751e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0007714727828648842, h_cfl = 2.321449271066302e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0004642898542132603, h_cfl = 1.160724635533151e+25 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.140805973034775e-10 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 2.464469457695598e-05, h = 0.0004642898542132603 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 2.464469457695598e-05 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320507725028751e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.8457241210128386e-03 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0002567896216835862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152170e-20 +-6.6062041863810468e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320501118824565e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.9654501042546091e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0002567896216835862 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +2.7207363292152170e-20 +-6.8841419829053511e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320438883608922e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.9648384063363804e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0004889345487902163 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +5.4414726584304341e-20 +-1.3765443914437932e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320370070589606e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.6456837939373124e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0003728620852369013 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +4.0811044938228262e-20 +-7.9913320555792460e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320427811708194e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-4.3054198693064413e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320370056639329e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.001579461103257322, h_cfl = 4.642898542132604e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.001516282659127029, h_cfl = 2.321449271066302e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.265810453033421 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 1.826224996633818e-05 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.0004889345487902163, h = 1.106545120978371e-05 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0004889345487902163 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320370056639329e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-5.6456836589817337e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0004944672743951082 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947510e-22 +-3.1236018537167770e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320366933037477e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-5.7095686698695018e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0004944672743951082 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +6.4843491263947510e-22 +-3.1589476772675320e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448713915889e+00 +1.7320366897691652e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-5.7095683280628418e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0005 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2968698252789502e-21 +-6.3178949763105717e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448713915889e+00 +1.7320363738744353e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-5.7734533036852109e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0004972336371975541 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +9.7265236895921284e-22 +-4.7251666914550415e-07 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448713915889e+00 +1.7320365331472638e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-5.7415109057583139e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448713915889e+00 +1.7320363738744173e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0009627071870500957, h_cfl = 1.106545120978371e+25 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.0002213090241956742, h_cfl = 5.532725604891855e+24 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 20 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 5.889886968307349e-12 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_1(:) = +1.2247448713915889e+00 +1.7320363738744173e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_1(:) = +-1.0211309833389652e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +1.1719990452195032e-16 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +-2.0422619666802744e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.001 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0, h = 0.0002213090241956742 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +8.2872847241886988e-17 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0001106545120978371 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +1.2968698252789502e-20 +9.1702544777095879e-21 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.2777978346165390e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0001106545120978371 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5006315409424421e-09 +-1.4139409594916583e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448688909575e+00 +1.7320493936279178e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.2776576086118234e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0002213090241956742 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.0012630818848843e-09 +-2.8275715861806119e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247448663903258e+00 +1.7320479799972910e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.5554523371556875e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0001659817681467556 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.8132104835553837e-09 +-1.5905674194401964e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448685783784e+00 +1.7320492170014579e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.9165906132528884e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247448663903258e+00 +1.7320479798432702e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.0008472366368884156, h_cfl = 2.213090241956742e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.000813347171412879, h_cfl = 1.106545120978371e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 3.675164961613785 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 9.425094080723045e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0002213090241956742, h = 0.0007786909758043252 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.0002213090241956742 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247448663903258e+00 +1.7320479798432702e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.5554523219808438e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0006106545120978368 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.7597287067941030e-08 +-9.9495383111234592e-06 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247448487930388e+00 +1.7320380303049592e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-7.0519820807514802e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0006106545120978368 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-4.8555917626005746e-08 +-2.7456574039074930e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247448178344080e+00 +1.7320205232692312e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-7.0503041967777930e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0009999999999999994 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-9.7111835252011492e-08 +-5.4900082547062291e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247447692784905e+00 +1.7319930797607230e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.1546621066256180e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.0008053272560489181 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-6.1224389979734344e-08 +-3.4614874891151101e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247448051659358e+00 +1.7320133649683791e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-9.2989172395070388e-02 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003338723049155477, h_cfl = 7.786909758043252e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.003205174127189258, h_cfl = 3.893454879021626e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 4.11610539582608 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0001445442462304924 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_2(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][updated solution] ycur(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 1.224744769278491e+00 1.731993073504249e+00 5.103006905926577e-11 3.375077994860476e-14 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.001 +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_0(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_0(:) = +-2.0412402615292352e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412402615292352e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0015 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.001, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620482318611e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031006538230838e-08 +-2.8866551205796502e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247447182474840e+00 +1.7319642069530432e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.4433335377782813e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00125 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1031006538230838e-08 +-3.6083338444457003e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247447182474840e+00 +1.7319569901658045e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.4432673838952331e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206201307646168e-07 +-7.2163369194761588e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247446672164775e+00 +1.7319209101350543e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-1.7319207870601550e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001375 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-7.6546509807346260e-08 +-5.1417500326851759e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247446927319807e+00 +1.7319416560039222e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-1.5876131104107960e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247446672164775e+00 +1.7319209086319269e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003123484376240414, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002998545001190797, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.9970900023816 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.456665619756245e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_1(:) = +1.2247446672164775e+00 +1.7319209086319269e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_1(:) = +-3.0623708205624944e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-2.0412402615292352e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +-2.0422611180665183e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.002 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.001 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.001, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.001 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247447692784905e+00 +1.7319930735042490e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-1.1546620482318611e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206201307646168e-07 +-5.7733102411593004e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247446672164775e+00 +1.7319353404018374e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-1.7320506589802412e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0015 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5311854102812455e-07 +-8.6602532949011984e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247446161599496e+00 +1.7319064709712999e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-1.7317910893875138e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.001999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.0623708205624910e-07 +-1.7317910893875123e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247444630414084e+00 +1.7318198943953103e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.3090932447999130e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.001749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.1053161356031324e-07 +-1.1906829928518353e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247445587468770e+00 +1.7318740052049639e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.0205196726278116e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002729592859383356, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002620409145008021, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.620409145008024 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003932628225837462 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_2(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][updated solution] ycur(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 1.224744463041408e+00 1.731819882857753e+00 1.019582196448710e-10 1.338928967697939e-13 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 0, stage type = -2, tcur = 0.002 +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_0(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_0(:) = +-4.0824795043172744e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 0 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824795043172744e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +-0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 1, stage type = 0, tcur = 0.0025 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.002, h = 0.0004999999999999996 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931448077512e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206198760793177e-07 +-5.7727328620193731e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247443609794209e+00 +1.7317621555291329e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.5976683907934150e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.00225 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.0206198760793177e-07 +-6.4941709769835327e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247443609794209e+00 +1.7317549411479833e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.5976070685533881e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0412397521586354e-07 +-1.2988035342766929e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247442589174331e+00 +1.7316900025043254e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-2.8861497852904600e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002375 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-1.5309298141189766e-07 +-9.4706072758587808e-05 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247443099484270e+00 +1.7317251767849946e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-2.7418980493674971e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247442589174331e+00 +1.7316900012423466e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.003004917511165991, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.002884720810719351, h_cfl = 2.499999999999998e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 5.769441621438706 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 2.457617220747888e-05 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_1(:) = +1.2247442589174331e+00 +1.7316900012423466e+00 + +[DEBUG][rank 0][mriStep_TakeStepMERK][slow explicit RHS] Fse_1(:) = +-5.1036091284798770e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[INFO][rank 0][mriStep_TakeStepMERK][begin-group] group = 1 +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_0(:) = +-4.0824795043172744e-04 +0.0000000000000000e+00 + +[DEBUG][rank 0][mriStep_ComputeInnerForcing][forcing] forcing_1(:) = +-2.0422592483252051e-04 +0.0000000000000000e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][begin-stage] stage = 2, stage type = 0, tcur = 0.003 +[DEBUG][rank 0][mriStepInnerStepper_Reset][reset-inner-state] tR = 0.002 +[INFO][rank 0][mriStep_StageERKFast][begin-fast-steps] +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.002, h = 0.0009999999999999992 +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 0, implicit = 0, tcur = 0.002 +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_0(:) = +1.2247444630414084e+00 +1.7318198828577531e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_0(:) = +0.0000000000000000e+00 +-2.3090931448077512e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 1, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.0412397521586354e-07 +-1.1545465724038746e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_1(:) = +1.2247442589174331e+00 +1.7317044282005127e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_1(:) = +0.0000000000000000e+00 +-2.8862699990255491e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 2, implicit = 0, tcur = 0.0025 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-2.5518045642399356e-07 +-1.4431349995127734e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_2(:) = +1.2247442078609521e+00 +1.7316755693578019e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_2(:) = +0.0000000000000000e+00 +-2.8860297639500793e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 3, implicit = 0, tcur = 0.002999999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-5.1036091284798713e-07 +-2.8860297639500771e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_3(:) = +1.2247439526804955e+00 +1.7315312798813580e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_3(:) = +0.0000000000000000e+00 +-3.4630623687259776e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-stage] stage = 4, implicit = 0, tcur = 0.002749999999999999 +[DEBUG][rank 0][arkStep_TakeStep_Z][rhs data] sdata(:) = +-3.6362450418294160e-07 +-2.0563962587450812e-04 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit stage] z_4(:) = +1.2247440994169041e+00 +1.7316142432318786e+00 + +[DEBUG][rank 0][arkStep_TakeStep_Z][explicit RHS] Fe_4(:) = +0.0000000000000000e+00 +-3.1746259630010004e-01 + +[INFO][rank 0][arkStep_TakeStep_Z][end-stage] status = success +[INFO][rank 0][arkStep_TakeStep_Z][begin-compute-solution] mass type = 0 +[DEBUG][rank 0][arkStep_TakeStep_Z][updated solution] ycur(:) = +1.2247439526804957e+00 +1.7315312702737617e+00 + +[INFO][rank 0][arkStep_TakeStep_Z][end-compute-solution] status = success +[DEBUG][rank 0][arkAdapt][new-step-before-bounds] h_acc = 0.002639908311389489, h_cfl = 9.999999999999992e+26 +[DEBUG][rank 0][arkAdapt][new-step-after-max-min-bounds] h_acc = 0.00253431197893391, h_cfl = 4.999999999999996e+26 +[DEBUG][rank 0][arkAdapt][new-step-eta] eta = 2.534311978933912 +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success, dsm = 0.0003934099230043387 +[INFO][rank 0][mriStep_StageERKFast][end-fast-steps] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][slow stage] z_2(:) = +1.2247439526804957e+00 +1.7315312702737617e+00 + +[INFO][rank 0][mriStep_TakeStepMERK][end-stage] status = success +[INFO][rank 0][mriStep_TakeStepMERK][end-group] status = success +[DEBUG][rank 0][mriStep_TakeStepMERK][updated solution] ycur(:) = +1.2247439526804957e+00 +1.7315312702737617e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 1.224743952680496e+00 1.731531270273762e+00 1.527842297122106e-10 1.914024494453770e-13 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Explicit slow RHS fn evals = 6 +Implicit slow RHS fn evals = 0 +Inner stepper failures = 0 +NLS iters = 0 +NLS fails = 0 +NLS iters per step = 0 +LS setups = 0 +End MRIStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_splittingstep.cpp b/test/unit_tests/logging/test_logging_arkode_splittingstep.cpp new file mode 100644 index 0000000000..4b533d9d58 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_splittingstep.cpp @@ -0,0 +1,162 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in SplittingStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators and vectors +#include "arkode/arkode_erkstep.h" +#include "arkode/arkode_splittingstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_logger.h" + +#include "problems/estep.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::estep; + +int main(int argc, char* argv[]) +{ + cout << "Start SplittingStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Step sizes: overall, partition 1, partition 2 + sunrealtype dt = SUN_RCONST(0.001); + sunrealtype dt_1 = dt / 2; + sunrealtype dt_2 = dt / 4; + + // Create initial condition + N_Vector y = N_VNew_Serial(1, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + flag = initial_condition(y); + if (check_flag(flag, "initial_condition")) { return 1; } + + // Create partition 1 integrator + void* stepper_1 = ERKStepCreate(ode_rhs_1, zero, y, sunctx); + if (check_ptr(stepper_1, "ERKStepCreate")) { return 1; } + + flag = ARKodeSetUserData(stepper_1, &problem_data); + if (check_flag(flag, "ARKodeSetUserData")) { return 1; } + + flag = ARKodeSetFixedStep(stepper_1, dt_1); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // Create partition 1 integrator + void* stepper_2 = ERKStepCreate(ode_rhs_2, zero, y, sunctx); + if (check_ptr(stepper_2, "ERKStepCreate")) { return 1; } + + flag = ARKodeSetFixedStep(stepper_2, dt_2); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // Create the overall integrator + SUNStepper steppers[2]; + + flag = ARKodeCreateSUNStepper(stepper_1, &steppers[0]); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + flag = ARKodeCreateSUNStepper(stepper_2, &steppers[1]); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + void* arkode_mem = SplittingStepCreate(steppers, 2, zero, y, sunctx); + if (check_ptr(arkode_mem, "SplittingStepCreate")) { return 1; } + + flag = ARKodeSetFixedStep(arkode_mem, dt); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // True solution vector + N_Vector yt = N_VClone(y); + + flag = true_solution(zero, problem_data, yt); + if (check_flag(flag, "true_solution")) { return 1; } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + const int width = numeric_limits<sunrealtype>::digits10 + 8; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << setw(width) << " t"; + cout << setw(width) << " y"; + cout << setw(width) << " y err" << endl; + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + sunrealtype* y_data = N_VGetArrayPointer(y); + sunrealtype* yt_data = N_VGetArrayPointer(yt); + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - yt_data[0]) << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { return 1; } + + flag = true_solution(tret, problem_data, yt); + if (check_flag(flag, "true_solution")) { return 1; } + + cout << setw(width) << tret << setw(width) << y_data[0] << setw(width) + << abs(y_data[0] - yt_data[0]) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 3 * width; i++) { cout << "-"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + N_VDestroy(yt); + ARKodeFree(&arkode_mem); + ARKodeFree(&stepper_1); + ARKodeFree(&stepper_2); + SUNStepper_Destroy(&steppers[0]); + SUNStepper_Destroy(&steppers[1]); + + cout << "End SplittingStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_splittingstep.out b/test/unit_tests/logging/test_logging_arkode_splittingstep.out new file mode 100644 index 0000000000..ac3cd2817e --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_splittingstep.out @@ -0,0 +1,22 @@ +Start SplittingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 + 1.000000000000000e-03 9.989990016676641e-01 9.986656689386919e-07 + 2.000000000000000e-03 9.979980073386400e-01 1.995328022363907e-06 + 3.000000000000000e-03 9.969970190148773e-01 2.989985090406932e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End SplittingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl3.out b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl3.out new file mode 100644 index 0000000000..dc0292704a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl3.out @@ -0,0 +1,304 @@ +Start SplittingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.989990016676641e-01 9.986656689386919e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.979980073386400e-01 1.995328022363907e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.969970190148773e-01 2.989985090406932e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End SplittingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl4.out b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl4.out new file mode 100644 index 0000000000..dc0292704a --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl4.out @@ -0,0 +1,304 @@ +Start SplittingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.989990016676641e-01 9.986656689386919e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.979980073386400e-01 1.995328022363907e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.969970190148773e-01 2.989985090406932e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End SplittingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl5.out b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl5.out new file mode 100644 index 0000000000..3d0f54fecf --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_splittingstep_lvl5.out @@ -0,0 +1,727 @@ +Start SplittingStep Logging test + t y y err +--------------------------------------------------------------------- + 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +1.0000000000000000e+00 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-2.0000000000000000e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9990000000000001e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9990005000000000e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9980009995000001e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9985005623281094e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9900049983337502e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.0005, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9900049983337502e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9980009996667500e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9970019991669166e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9970024986671666e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9960039971680830e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9965030606830623e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9800199866733308e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9800199866733308e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0, t_end = 0.001 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9800199866733308e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9600798934399148e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9625650933550369e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9625657134910184e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9650518440163471e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9638085073643801e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9825106280629616e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.00025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9825106280629616e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9650518439389990e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9675389049973095e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9675395257526056e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9700275183505982e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0004375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9687832503912499e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9850025129056197e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.0005, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0005 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9850025129056197e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9700275182731535e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9725164423335100e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9725170637088900e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9750069202395630e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0006875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9737617200424888e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9874956421327277e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.00075, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00075 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9874956421327277e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9750069201620228e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9774977090855976e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.000875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9774983310818388e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9799900534075303e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0009375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9787439200412209e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9899900166766409e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9899900166766409e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[DEBUG][rank 0][splittingStep_TakeStep][sequential state] y_seq(:) = +9.9899900166766409e-01 + +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9899900166766409e-01 + +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9899900166766409e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 9.989990016676641e-01 9.986656689386919e-07 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.001, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9899900166766409e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9979980033353282e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9969990043336605e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9969995038331614e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9960010038314950e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9965000665980466e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9800050199903900e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 4, tn = 0.0015, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9800050199903900e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9960010039980780e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9950030034960791e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9950035024963300e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9940060004955817e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9945045644488149e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9700300033099909e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9700300033099909e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.001, t_end = 0.002 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.001, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9700300033099909e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9401498266901422e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9426275708756573e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9426281885322310e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9451068596068082e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0011875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9438672537653572e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9725156603185372e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.00125, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00125 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9725156603185372e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9451068595298475e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9475864574166484e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9475870756894391e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9500676013901368e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0014375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9488270679659307e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9750025570488343e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 7, tn = 0.0015, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0015 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9750025570488343e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9500676013130784e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9525490547507356e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001625 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9525496736405117e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9550320558180461e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0016875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9537905938853899e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9774906944285802e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 8, tn = 0.00175, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00175 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9774906944285802e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9550320557408911e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9575153665812743e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.001875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9575159860888096e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9600002265962106e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0019375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9587578352282535e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9799800733863997e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9799800733863997e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[DEBUG][rank 0][splittingStep_TakeStep][sequential state] y_seq(:) = +9.9799800733863997e-01 + +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9799800733863997e-01 + +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9799800733863997e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 9.979980073386400e-01 1.995328022363907e-06 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][splittingStep_TakeStep][begin-sequential-method] sequential method = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-stage] stage = 0 +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 0, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 5, tn = 0.002, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9799800733863997e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9959960146772799e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9949980166699413e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9949985156689449e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9940010161616111e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9944995788686046e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9700050816401353e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 6, tn = 0.0025, h = 0.0005 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9700050816401353e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +-1.9940010163280271e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.00275 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +-1.9930040158198630e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.00275 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +-1.9930045143201172e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +-1.9920080118137069e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +-1.9925060762071918e+00 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9600400598997840e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9600400598997840e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][begin-partition] partition = 1, t_start = 0.002, t_end = 0.003 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 9, tn = 0.002, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9600400598997840e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9202397994808489e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9227101028934483e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002125 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9227107180780627e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9251819446697664e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0021875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9239460621516318e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9625207375408709e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 10, tn = 0.00225, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.00225 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9625207375408709e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9251819445931899e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9276540942875435e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9276547100852941e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9301277838789581e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0024375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9288909774914980e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9650026511799217e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 11, tn = 0.0025, h = 0.00025 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.0025 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9650026511799217e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9301277838022872e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002625000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9326017816187129e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002625000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9326023980303635e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.002750000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9350773208674503e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.002687500000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9338395896895992e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9674858017409207e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 12, tn = 0.002750000000000001, h = 0.0002499999999999991 +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 0, tcur = 0.002750000000000001 +[DEBUG][rank 0][erkStep_TakeStep][stage] z_0(:) = +9.9674858017409207e-01 + +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_0(:) = +9.9350773207906840e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 1, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_1(:) = +9.9375531685717911e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 2, tcur = 0.002875 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_2(:) = +9.9375537855981089e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 3, tcur = 0.003 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_3(:) = +9.9400305593223792e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-stage] stage = 4, tcur = 0.0029375 +[DEBUG][rank 0][erkStep_TakeStep][stage RHS] F_4(:) = +9.9387919024319205e-01 + +[INFO][rank 0][erkStep_TakeStep][end-stage] status = success +[INFO][rank 0][erkStep_TakeStep][begin-compute-solution] +[DEBUG][rank 0][erkStep_TakeStep][updated solution] ycur(:) = +9.9699701901487725e-01 + +[INFO][rank 0][erkStep_TakeStep][end-compute-solution] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success +[DEBUG][rank 0][splittingStep_SequentialMethod][partition state] y_par(:) = +9.9699701901487725e-01 + +[INFO][rank 0][splittingStep_SequentialMethod][end-partition] status = success +[INFO][rank 0][splittingStep_SequentialMethod][end-stage] status = success +[DEBUG][rank 0][splittingStep_TakeStep][sequential state] y_seq(:) = +9.9699701901487725e-01 + +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9699701901487725e-01 + +[INFO][rank 0][splittingStep_TakeStep][end-sequential-method] status = success +[DEBUG][rank 0][splittingStep_TakeStep][current state] y_cur(:) = +9.9699701901487725e-01 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 9.969970190148773e-01 2.989985090406932e-06 +--------------------------------------------------------------------- +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +Partition 0 evolves = 3 +Partition 1 evolves = 3 +End SplittingStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep.cpp b/test/unit_tests/logging/test_logging_arkode_sprkstep.cpp new file mode 100644 index 0000000000..742b0dd040 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep.cpp @@ -0,0 +1,128 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in SPRKStep + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "arkode/arkode_sprkstep.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_logger.h" + +#include "problems/kepler.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kepler; + +int main(int argc, char* argv[]) +{ + cout << "Start SPRKStep Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use compensated summation + bool use_compensated_sum = false; + if (argc > 1) { use_compensated_sum = stoi(argv[1]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(4, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + flag = initial_condition(y, eccentricity); + if (check_flag(flag, "initial_condition")) { return 1; } + + // Create SPRKStep memory structure + void* arkode_mem = SPRKStepCreate(ode_rhs_force, ode_rhs_velocity, zero, y, + sunctx); + if (check_ptr(arkode_mem, "SPKStepCreate")) { return 1; } + + // Step size + const sunrealtype dt = SUN_RCONST(0.001); + flag = ARKodeSetFixedStep(arkode_mem, dt); + if (check_flag(flag, "ARKodeSetFixedStep")) { return 1; } + + // Compensated summation + flag = SPRKStepSetUseCompensatedSums(arkode_mem, use_compensated_sum); + if (check_flag(flag, "SPRKStepSetUseCompensatedSums")) { return 1; } + + // Initial time and fist output time + const sunrealtype dtout = dt; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + sunrealtype* ydata = N_VGetArrayPointer(y); + if (check_ptr(y, "N_VGetArrayPointer")) { return 1; } + + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " q1 "; + cout << " q2 "; + cout << " q3 "; + cout << " q4 " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << ydata[2] << setw(25) << ydata[3] << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = ARKodeEvolve(arkode_mem, tout, y, &tret, ARK_ONE_STEP); + if (check_flag(flag, "ARKodeEvolve")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << ydata[2] << setw(25) << ydata[3] << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = ARKodePrintAllStats(arkode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "ARKodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + ARKodeFree(&arkode_mem); + + cout << "End SPRKStep Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_0.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_0.out new file mode 100644 index 0000000000..208a8459f9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_0.out @@ -0,0 +1,22 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 + 2.000000000000000e-03 3.999875001822874e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 + 3.000000000000000e-03 3.999718759228028e-01 5.999859381323369e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_1.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_1.out new file mode 100644 index 0000000000..c5202f4fa5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_1.out @@ -0,0 +1,22 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 + 2.000000000000000e-03 3.999875001822875e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 + 3.000000000000000e-03 3.999718759228029e-01 5.999859381323370e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_0.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_0.out new file mode 100644 index 0000000000..3111898c52 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_0.out @@ -0,0 +1,52 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.001, that = 0.001 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.002, that = 0.002 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822874e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.003, that = 0.003 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228028e-01 5.999859381323369e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_1.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_1.out new file mode 100644 index 0000000000..455d78afc4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl3_1.out @@ -0,0 +1,52 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.001, that = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.002, that = 0.002 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822875e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.003, that = 0.003 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228029e-01 5.999859381323370e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_0.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_0.out new file mode 100644 index 0000000000..3111898c52 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_0.out @@ -0,0 +1,52 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.001, that = 0.001 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.002, that = 0.002 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822874e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.003, that = 0.003 +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228028e-01 5.999859381323369e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_1.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_1.out new file mode 100644 index 0000000000..455d78afc4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl4_1.out @@ -0,0 +1,52 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.001, that = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.002, that = 0.002 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822875e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.003, that = 0.003 +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228029e-01 5.999859381323370e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_0.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_0.out new file mode 100644 index 0000000000..2ac4822c1b --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_0.out @@ -0,0 +1,358 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_0(:) = +4.0000000000000002e-01 +0.0000000000000000e+00 +0.0000000000000000e+00 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499999999999991e+00 +-0.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_0(:) = +4.0000000000000002e-01 +0.0000000000000000e+00 +-8.4060124548394422e-04 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_0(:) = +-8.4060124548394422e-04 +2.0000000000000000e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_1(:) = +3.9999956679376303e-01 +1.0307056748622458e-03 +-8.4060124548394422e-04 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499512906481511e+00 +-1.6104668098815830e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_1(:) = +3.9999956679376303e-01 +1.0307056748622458e-03 +5.6451157293554511e-04 +2.0000036206483105e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_1(:) = +5.6451157293554511e-04 +2.0000036206483105e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_2(:) = +3.9999951836882031e-01 +8.5914132544977488e-04 +5.6451157293554511e-04 +2.0000036206483105e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499718016002399e+00 +-1.3424038807715487e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_2(:) = +3.9999951836882031e-01 +8.5914132544977488e-04 +-4.1624671032736617e-03 +1.9999934677792726e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_2(:) = +-4.1624671032736617e-03 +1.9999934677792726e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.001, that = 0.001 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_3(:) = +3.9999768029401112e-01 +1.7423044881649283e-03 +-4.1624671032736617e-03 +1.9999934677792726e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2498946228868002e+00 +-2.7223206504621723e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_3(:) = +3.9999768029401112e-01 +1.7423044881649283e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_3(:) = +-6.2499544274776577e-03 +1.9999843751302071e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep][updated solution] ycur(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_0(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2498632832590486e+00 +-3.1249479173917131e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_0(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-7.0905372850795668e-03 +1.9999801721940289e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_0(:) = +-7.0905372850795668e-03 +1.9999801721940289e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_1(:) = +3.9999322088288441e-01 +3.0306902482374271e-03 +-7.0905372850795668e-03 +1.9999801721940289e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2496736664511046e+00 +-4.7352865115494969e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_1(:) = +3.9999322088288441e-01 +3.0306902482374271e-03 +-5.6854868820773877e-03 +1.9999908180558394e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_1(:) = +-5.6854868820773877e-03 +1.9999908180558394e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_2(:) = +3.9999370859543049e-01 +2.8591269970571920e-03 +-5.6854868820773877e-03 +1.9999908180558394e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2497176305965656e+00 +-4.4672543636670288e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_2(:) = +3.9999370859543049e-01 +2.8591269970571920e-03 +-1.0412273323672963e-02 +1.9999570313176132e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_2(:) = +-1.0412273323672963e-02 +1.9999570313176132e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.002, that = 0.002 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_3(:) = +3.9998911071229348e-01 +3.7422740700494362e-03 +-1.0412273323672963e-02 +1.9999570313176132e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2495197216388769e+00 +-5.8470130756569469e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_3(:) = +3.9998911071229348e-01 +3.7422740700494362e-03 +-1.2499635429509276e-02 +1.9999375020832559e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_3(:) = +-1.2499635429509276e-02 +1.9999375020832559e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep][updated solution] ycur(:) = +3.9998750018228740e-01 +3.9999583341637258e-03 +-1.2499635429509276e-02 +1.9999375020832559e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822874e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_0(:) = +3.9998750018228740e-01 +3.9999583341637258e-03 +-1.2499635429509276e-02 +1.9999375020832559e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2494531571434671e+00 +-6.2495833566022986e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_0(:) = +3.9998750018228740e-01 +3.9999583341637258e-03 +-1.3340163126707414e-02 +1.9999290966311707e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_0(:) = +-1.3340163126707414e-02 +1.9999290966311707e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_1(:) = +3.9998062529136824e-01 +5.0306274687736616e-03 +-1.3340163126707414e-02 +1.9999290966311707e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2491226650180272e+00 +-7.8596327288291232e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_1(:) = +3.9998062529136824e-01 +5.0306274687736616e-03 +-1.1935236599738917e-02 +1.9999467666419943e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_1(:) = +-1.1935236599738917e-02 +1.9999467666419943e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_2(:) = +3.9998164912006595e-01 +4.8590679964126641e-03 +-1.1935236599738917e-02 +1.9999467666419943e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2491900755900351e+00 +-7.5916581589682328e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_2(:) = +3.9998164912006595e-01 +4.8590679964126641e-03 +-1.6661624040931682e-02 +1.9998893494129673e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_2(:) = +-1.6661624040931682e-02 +1.9998893494129673e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep][begin-stage] stage = 3, t = 0.003, that = 0.003 +[DEBUG][rank 0][sprkStep_TakeStep][stage] z2_3(:) = +3.9997429162974357e-01 +5.7421851822248102e-03 +-1.6661624040931682e-02 +1.9998893494129673e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2488714714232731e+00 +-8.9711208744511550e-02 + +[DEBUG][rank 0][sprkStep_TakeStep][stage] z1_3(:) = +3.9997429162974357e-01 +5.7421851822248102e-03 +-1.8748769628860150e-02 +1.9998593855459914e+00 + +[DEBUG][rank 0][sprkStep_TakeStep][stage RHS] f2_3(:) = +-1.8748769628860150e-02 +1.9998593855459914e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep][updated solution] ycur(:) = +3.9997187592280281e-01 +5.9998593813233693e-03 +-1.8748769628860150e-02 +1.9998593855459914e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228028e-01 5.999859381323369e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_1.out b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_1.out new file mode 100644 index 0000000000..bae18ff70f --- /dev/null +++ b/test/unit_tests/logging/test_logging_arkode_sprkstep_lvl5_1.out @@ -0,0 +1,358 @@ +Start SPRKStep Logging test + t q1 q2 q3 q4 +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 4.000000000000000e-01 0.000000000000000e+00 0.000000000000000e+00 2.000000000000000e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 1, tn = 0, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.0005153528374311229, that = 0.0001344961992774311 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_0(:) = +4.0000000000000002e-01 +0.0000000000000000e+00 +0.0000000000000000e+00 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499999999999991e+00 +-0.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_0(:) = +4.0000000000000002e-01 +0.0000000000000000e+00 +-8.4060124548394422e-04 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_0(:) = +-8.4060124548394422e-04 +2.0000000000000000e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.0004295708180181493, that = -9.032360380198973e-05 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_1(:) = +3.9999956679376303e-01 +1.0307056748622458e-03 +-8.4060124548394422e-04 +2.0000000000000000e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499512906481511e+00 +-1.6104668098815830e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_1(:) = +3.9999956679376303e-01 +1.0307056748622458e-03 +5.6451157293554511e-04 +2.0000036206483105e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_1(:) = +5.6451157293554511e-04 +2.0000036206483105e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.0008711538416346159, that = 0.0006659963967136786 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_2(:) = +3.9999951836882031e-01 +8.5914132544977488e-04 +5.6451157293554511e-04 +2.0000036206483105e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2499718016002399e+00 +-1.3424038807715487e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_2(:) = +3.9999951836882031e-01 +8.5914132544977488e-04 +-4.1624671032736617e-03 +1.9999934677792726e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_2(:) = +-4.1624671032736617e-03 +1.9999934677792726e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.001, that = 0.001 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_3(:) = +3.9999768029401112e-01 +1.7423044881649283e-03 +-4.1624671032736617e-03 +1.9999934677792726e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2498946228868002e+00 +-2.7223206504621723e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_3(:) = +3.9999768029401112e-01 +1.7423044881649283e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_3(:) = +-6.2499544274776577e-03 +1.9999843751302071e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][updated solution] ycur(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 1.000000000000000e-03 3.999968750113932e-01 1.999994791691249e-03 -6.249954427477658e-03 1.999984375130207e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 2, tn = 0.001, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.001515352837431123, that = 0.001134496199277431 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_0(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-6.2499544274776577e-03 +1.9999843751302071e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2498632832590486e+00 +-3.1249479173917131e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_0(:) = +3.9999687501139319e-01 +1.9999947916912487e-03 +-7.0905372850795668e-03 +1.9999801721940289e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_0(:) = +-7.0905372850795668e-03 +1.9999801721940289e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.001429570818018149, that = 0.0009096763961980103 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_1(:) = +3.9999322088288441e-01 +3.0306902482374271e-03 +-7.0905372850795668e-03 +1.9999801721940289e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2496736664511046e+00 +-4.7352865115494969e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_1(:) = +3.9999322088288441e-01 +3.0306902482374271e-03 +-5.6854868820773868e-03 +1.9999908180558392e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_1(:) = +-5.6854868820773868e-03 +1.9999908180558392e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.001871153841634616, that = 0.001665996396713679 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_2(:) = +3.9999370859543049e-01 +2.8591269970571920e-03 +-5.6854868820773868e-03 +1.9999908180558392e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2497176305965656e+00 +-4.4672543636670288e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_2(:) = +3.9999370859543049e-01 +2.8591269970571920e-03 +-1.0412273323672963e-02 +1.9999570313176129e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_2(:) = +-1.0412273323672963e-02 +1.9999570313176129e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.002, that = 0.002 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_3(:) = +3.9998911071229354e-01 +3.7422740700494362e-03 +-1.0412273323672963e-02 +1.9999570313176129e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2495197216388751e+00 +-5.8470130756569441e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_3(:) = +3.9998911071229354e-01 +3.7422740700494362e-03 +-1.2499635429509276e-02 +1.9999375020832557e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_3(:) = +-1.2499635429509276e-02 +1.9999375020832557e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][updated solution] ycur(:) = +3.9998750018228746e-01 +3.9999583341637258e-03 +-1.2499635429509276e-02 +1.9999375020832557e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 2.000000000000000e-03 3.999875001822875e-01 3.999958334163726e-03 -1.249963542950928e-02 1.999937502083256e+00 +[INFO][rank 0][ARKodeEvolve][begin-step-attempt] step = 3, tn = 0.002, h = 0.001 +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 0, t = 0.002515352837431123, that = 0.002134496199277431 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_0(:) = +3.9998750018228746e-01 +3.9999583341637258e-03 +-1.2499635429509276e-02 +1.9999375020832557e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_0(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2494531571434653e+00 +-6.2495833566022958e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_0(:) = +3.9998750018228746e-01 +3.9999583341637258e-03 +-1.3340163126707414e-02 +1.9999290966311705e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_0(:) = +-1.3340163126707414e-02 +1.9999290966311705e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 1, t = 0.00242957081801815, that = 0.00190967639619801 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_1(:) = +3.9998062529136830e-01 +5.0306274687736616e-03 +-1.3340163126707414e-02 +1.9999290966311705e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_1(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2491226650180254e+00 +-7.8596327288291204e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_1(:) = +3.9998062529136830e-01 +5.0306274687736616e-03 +-1.1935236599738917e-02 +1.9999467666419941e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_1(:) = +-1.1935236599738917e-02 +1.9999467666419941e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 2, t = 0.002871153841634616, that = 0.002665996396713679 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_2(:) = +3.9998164912006601e-01 +4.8590679964126641e-03 +-1.1935236599738917e-02 +1.9999467666419941e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_2(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2491900755900334e+00 +-7.5916581589682300e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_2(:) = +3.9998164912006601e-01 +4.8590679964126641e-03 +-1.6661624040931682e-02 +1.9998893494129670e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_2(:) = +-1.6661624040931682e-02 +1.9998893494129670e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[INFO][rank 0][sprkStep_TakeStep_Compensated][begin-stage] stage = 3, t = 0.003, that = 0.003 +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z2_3(:) = +3.9997429162974368e-01 +5.7421851822248102e-03 +-1.6661624040931682e-02 +1.9998893494129670e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f1_3(:) = +0.0000000000000000e+00 +0.0000000000000000e+00 +-6.2488714714232669e+00 +-8.9711208744511439e-02 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage] z1_3(:) = +3.9997429162974368e-01 +5.7421851822248102e-03 +-1.8748769628860150e-02 +1.9998593855459912e+00 + +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][stage RHS] f2_3(:) = +-1.8748769628860150e-02 +1.9998593855459912e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 + +[INFO][rank 0][sprkStep_TakeStep_Compensated][end-stage] status = success +[DEBUG][rank 0][sprkStep_TakeStep_Compensated][updated solution] ycur(:) = +3.9997187592280292e-01 +5.9998593813233702e-03 +-1.8748769628860150e-02 +1.9998593855459912e+00 + +[INFO][rank 0][ARKodeEvolve][end-step-attempt] status = success + 3.000000000000000e-03 3.999718759228029e-01 5.999859381323370e-03 -1.874876962886015e-02 1.999859385545991e+00 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.003 +Steps = 3 +Step attempts = 3 +Stability limited steps = 0 +Accuracy limited steps = 0 +Error test fails = 0 +NLS step fails = 0 +Inequality constraint fails = 0 +Initial step size = 0.001 +Last step size = 0.001 +Current step size = 0.001 +f1 RHS fn evals = 12 +f2 RHS fn evals = 12 +End SPRKStep Logging test diff --git a/test/unit_tests/logging/test_logging_cvode.cpp b/test/unit_tests/logging/test_logging_cvode.cpp new file mode 100644 index 0000000000..6ed143eed9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode.cpp @@ -0,0 +1,196 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in CVODE + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "cvode/cvode.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sundials/sundials_nonlinearsolver.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" +#include "sunnonlinsol/sunnonlinsol_fixedpoint.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start CVODE Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use Newton (1) otherwise use fixed-point + bool newton = true; + if (argc > 1) { newton = stoi(argv[1]); } + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 2) { direct = stoi(argv[2]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + // Create CVODE memory structure + void* cvode_mem = CVodeCreate(CV_BDF, sunctx); + if (check_ptr(cvode_mem, "CVodeCreate")) { return 1; } + + flag = CVodeInit(cvode_mem, ode_rhs, zero, y); + if (check_flag(flag, "CVodeInit")) { return 1; } + + flag = CVodeSetUserData(cvode_mem, &problem_data); + if (check_flag(flag, "CVodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = CVodeSStolerances(cvode_mem, rtol, atol); + if (check_flag(flag, "CVodeSStolerances")) { return 1; } + + SUNNonlinearSolver NLS = nullptr; + + if (!newton) + { + cout << "Using fixed-point nonlinear solver" << endl; + + NLS = SUNNonlinSol_FixedPoint(y, 0, sunctx); + if (check_ptr(NLS, "SUNNonlinSol_FixedPoint")) { return 1; } + + flag = CVodeSetNonlinearSolver(cvode_mem, NLS); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + } + else { cout << "Using Newton nonlinear solver" << endl; } + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + + if (newton && direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = CVodeSetLinearSolver(cvode_mem, LS, A); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + + flag = CVodeSetJacFn(cvode_mem, ode_rhs_jac); + if (check_flag(flag, "CVodeSetJacFn")) { return 1; } + } + else if (newton) + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = CVodeSetLinearSolver(cvode_mem, LS, A); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = CVode(cvode_mem, tout, y, &tret, CV_ONE_STEP); + if (check_flag(flag, "CVode")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = CVodePrintAllStats(cvode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "CVodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + SUNMatDestroy(A); + SUNLinSolFree(LS); + SUNNonlinSolFree(NLS); + CVodeFree(&cvode_mem); + + cout << "End CVODE Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_cvode_0.out b/test/unit_tests/logging/test_logging_cvode_0.out new file mode 100644 index 0000000000..84798e5d15 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_0.out @@ -0,0 +1,26 @@ +Start CVODE Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_1_0.out b/test/unit_tests/logging/test_logging_cvode_1_0.out new file mode 100644 index 0000000000..8e226b800b --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_1_0.out @@ -0,0 +1,38 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_1_1.out b/test/unit_tests/logging/test_logging_cvode_1_1.out new file mode 100644 index 0000000000..d3b4c300b7 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_1_1.out @@ -0,0 +1,38 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl3_0.out b/test/unit_tests/logging/test_logging_cvode_lvl3_0.out new file mode 100644 index 0000000000..5e2a61457a --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl3_0.out @@ -0,0 +1,70 @@ +Start CVODE Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl3_1_0.out b/test/unit_tests/logging/test_logging_cvode_lvl3_1_0.out new file mode 100644 index 0000000000..062c3e881a --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl3_1_0.out @@ -0,0 +1,122 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl3_1_1.out b/test/unit_tests/logging/test_logging_cvode_lvl3_1_1.out new file mode 100644 index 0000000000..8ca5f749bb --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl3_1_1.out @@ -0,0 +1,93 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl4_0.out b/test/unit_tests/logging/test_logging_cvode_lvl4_0.out new file mode 100644 index 0000000000..780e6be9a4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl4_0.out @@ -0,0 +1,81 @@ +Start CVODE Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621899552651 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.249962018079078 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198472955140451 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219560396963 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714755410129, dsm = 0.5885921138418445 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714755410129, qprime = 2, qwait = 2 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl4_1_0.out b/test/unit_tests/logging/test_logging_cvode_lvl4_1_0.out new file mode 100644 index 0000000000..cee096772e --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl4_1_0.out @@ -0,0 +1,133 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621905732853 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499620187042475 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.19847341436515 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219509439317 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714702930874, dsm = 0.5885920933306285 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714702930874, qprime = 2, qwait = 2 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl4_1_1.out b/test/unit_tests/logging/test_logging_cvode_lvl4_1_1.out new file mode 100644 index 0000000000..29744cec0b --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl4_1_1.out @@ -0,0 +1,104 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621932116032 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499618413377005 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198477691401965 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219034840186 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714214160092, dsm = 0.5885920559914323 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714214160092, qprime = 2, qwait = 2 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl5_0.out b/test/unit_tests/logging/test_logging_cvode_lvl5_0.out new file mode 100644 index 0000000000..cf207a83b2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl5_0.out @@ -0,0 +1,97 @@ +Start CVODE Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621899552651 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448669990217e+00 +1.7320483583160731e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.249962018079078 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448208773850e+00 +1.7320226411804154e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198472955140451 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219560396963 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448528145659e+00 +1.7320404491473784e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714755410129, dsm = 0.5885921138418445 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714755410129, qprime = 2, qwait = 2 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl5_1_0.out b/test/unit_tests/logging/test_logging_cvode_lvl5_1_0.out new file mode 100644 index 0000000000..b1d73a0e2d --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl5_1_0.out @@ -0,0 +1,149 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621905732853 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448671247101e+00 +1.7320483583156228e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499620187042475 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448216312835e+00 +1.7320226411776802e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.19847341436515 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219509439317 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448531116913e+00 +1.7320404491464272e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714702930874, dsm = 0.5885920933306285 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714702930874, qprime = 2, qwait = 2 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvode_lvl5_1_1.out b/test/unit_tests/logging/test_logging_cvode_lvl5_1_1.out new file mode 100644 index 0000000000..60be1b2612 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvode_lvl5_1_1.out @@ -0,0 +1,120 @@ +Start CVODE Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621932116032 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448669990604e+00 +1.7320483583160411e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499618413377005 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448208776175e+00 +1.7320226411897481e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198477691401965 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219034840186 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[DEBUG][rank 0][cvPredict][return] zn_0(:) = +1.2247448528146598e+00 +1.7320404491518191e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714214160092, dsm = 0.5885920559914323 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714214160092, qprime = 2, qwait = 2 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODE Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes.cpp b/test/unit_tests/logging/test_logging_cvodes.cpp new file mode 100644 index 0000000000..9d415408d9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes.cpp @@ -0,0 +1,196 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in CVODES + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "cvodes/cvodes.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sundials/sundials_nonlinearsolver.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" +#include "sunnonlinsol/sunnonlinsol_fixedpoint.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start CVODES Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use Newton (1) otherwise use fixed-point + bool newton = true; + if (argc > 1) { newton = stoi(argv[1]); } + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 2) { direct = stoi(argv[2]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + // Create CVODE memory structure + void* cvode_mem = CVodeCreate(CV_BDF, sunctx); + if (check_ptr(cvode_mem, "CVodeCreate")) { return 1; } + + flag = CVodeInit(cvode_mem, ode_rhs, zero, y); + if (check_flag(flag, "CVodeInit")) { return 1; } + + flag = CVodeSetUserData(cvode_mem, &problem_data); + if (check_flag(flag, "CVodeSetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = CVodeSStolerances(cvode_mem, rtol, atol); + if (check_flag(flag, "CVodeSStolerances")) { return 1; } + + SUNNonlinearSolver NLS = nullptr; + + if (!newton) + { + cout << "Using fixed-point nonlinear solver" << endl; + + NLS = SUNNonlinSol_FixedPoint(y, 0, sunctx); + if (check_ptr(NLS, "SUNNonlinSol_FixedPoint")) { return 1; } + + flag = CVodeSetNonlinearSolver(cvode_mem, NLS); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + } + else { cout << "Using Newton nonlinear solver" << endl; } + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + + if (newton && direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = CVodeSetLinearSolver(cvode_mem, LS, A); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + + flag = CVodeSetJacFn(cvode_mem, ode_rhs_jac); + if (check_flag(flag, "CVodeSetJacFn")) { return 1; } + } + else if (newton) + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = CVodeSetLinearSolver(cvode_mem, LS, A); + if (check_flag(flag, "CVodeSetLinearSolver")) { return 1; } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = CVode(cvode_mem, tout, y, &tret, CV_ONE_STEP); + if (check_flag(flag, "CVode")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = CVodePrintAllStats(cvode_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "CVodePrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + SUNMatDestroy(A); + SUNLinSolFree(LS); + SUNNonlinSolFree(NLS); + CVodeFree(&cvode_mem); + + cout << "End CVODES Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_cvodes_0.out b/test/unit_tests/logging/test_logging_cvodes_0.out new file mode 100644 index 0000000000..526cfde367 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_0.out @@ -0,0 +1,26 @@ +Start CVODES Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_1_0.out b/test/unit_tests/logging/test_logging_cvodes_1_0.out new file mode 100644 index 0000000000..4aaa3ff53d --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_1_0.out @@ -0,0 +1,38 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_1_1.out b/test/unit_tests/logging/test_logging_cvodes_1_1.out new file mode 100644 index 0000000000..92e236d6e4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_1_1.out @@ -0,0 +1,38 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl3_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl3_0.out new file mode 100644 index 0000000000..648a0c9991 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl3_0.out @@ -0,0 +1,70 @@ +Start CVODES Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl3_1_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl3_1_0.out new file mode 100644 index 0000000000..c63bd74a30 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl3_1_0.out @@ -0,0 +1,122 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl3_1_1.out b/test/unit_tests/logging/test_logging_cvodes_lvl3_1_1.out new file mode 100644 index 0000000000..240570afb5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl3_1_1.out @@ -0,0 +1,93 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl4_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl4_0.out new file mode 100644 index 0000000000..ff3b3f8746 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl4_0.out @@ -0,0 +1,81 @@ +Start CVODES Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621899552651 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.249962018079078 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198472955140451 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219560396963 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714755410129, dsm = 0.5885921138418445 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714755410129, qprime = 2, qwait = 2 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl4_1_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl4_1_0.out new file mode 100644 index 0000000000..f24fc420c2 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl4_1_0.out @@ -0,0 +1,133 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621905732853 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499620187042475 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.19847341436515 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219509439317 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714702930874, dsm = 0.5885920933306285 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714702930874, qprime = 2, qwait = 2 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl4_1_1.out b/test/unit_tests/logging/test_logging_cvodes_lvl4_1_1.out new file mode 100644 index 0000000000..eaca739dd3 --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl4_1_1.out @@ -0,0 +1,104 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621932116032 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499618413377005 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198477691401965 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219034840186 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714214160092, dsm = 0.5885920559914323 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714214160092, qprime = 2, qwait = 2 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl5_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl5_0.out new file mode 100644 index 0000000000..4f259d75ee --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl5_0.out @@ -0,0 +1,97 @@ +Start CVODES Logging test +Using fixed-point nonlinear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.499975381317856 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.259026232096693e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621899552651 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621899552651 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195305e+00 1.732049582942475e+00 1.113801051388918e-09 6.122818017040288e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448669990217e+00 +1.7320483583160731e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 0.4999746839964076 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 6.230194580154422e-05 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.249962018079078 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.249962018079078 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802767e+00 1.732047133691379e+00 2.258890852147033e-09 1.224500395968775e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448208773850e+00 +1.7320226411804154e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 33.34377648386529 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.02644643520889491 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198472955140451 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219560396963 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198472955140451, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714755410129, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448528145659e+00 +1.7320404491473784e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683315129505 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-solver] solver = Fixed-Point +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 1, update-norm = 2.482944084048132 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][begin-nonlinear-iterate] +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][nonlinear-iterate] cur-iter = 2, update-norm = 0.0005559126276672459 +[INFO][rank 0][SUNNonlinSolSolve_FixedPoint][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714755410129, dsm = 0.5885921138418445 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885921138418445 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714755410129, qprime = 2, qwait = 2 + 4.870435267600296e-04 1.224744841922327e+00 1.732034367982330e+00 5.258975033228808e-09 2.744234303353466e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435267600296 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714755410129 +Current step size = 0.0002810714755410129 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl5_1_0.out b/test/unit_tests/logging/test_logging_cvodes_lvl5_1_0.out new file mode 100644 index 0000000000..c4394a6c4d --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl5_1_0.out @@ -0,0 +1,149 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.499975381317856, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070719651123717, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.130293423419247e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243811465705 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627663976220471e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621905732853 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621905732853 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869258150e+00 1.732049582942250e+00 1.050956877080012e-09 6.122820268572582e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448671247101e+00 +1.7320483583156228e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.4999746801363614, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.7070709734919923, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 5.129626861394919e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999240374084951 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 3.627192645756874e-05, b-tol = 0.01, res-tol = 0.01414213562373095 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499620187042475 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499620187042475 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864928434e+00 1.732047133690926e+00 2.133223819811292e-09 1.224500849161814e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448216312835e+00 +1.7320226411776802e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 33.34377627547665, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 47.15522062951332, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.02280194342842776 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32282742612932 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.01612377930633392, b-tol = 0.02032258064516129, res-tol = 0.02874046917080807 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.19847341436515 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219509439317 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.19847341436515, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714702930874, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448531116913e+00 +1.7320404491464272e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683318751525 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 2.482943969856862, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 3.511413036784067, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 1, p-solves = 0, res-norm = 0.0004635068923188323 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482495053589632 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 1, b-norm = 0.0003277492125626657, b-tol = 0.02108841659375763, res-tol = 0.02982352475586586 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success small rhs +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714702930874, dsm = 0.5885920933306285 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920933306285 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714702930874, qprime = 2, qwait = 2 + 4.870435215121043e-04 1.224744842672905e+00 1.732034367979995e+00 4.508398321334539e-09 2.744236933471811e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0004870435215121043 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714702930874 +Current step size = 0.0002810714702930874 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 11 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS RHS fn evals = 4 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 4 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 4 +LS iters per NLS iter = 0.5 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_cvodes_lvl5_1_1.out b/test/unit_tests/logging/test_logging_cvodes_lvl5_1_1.out new file mode 100644 index 0000000000..0921b423bb --- /dev/null +++ b/test/unit_tests/logging/test_logging_cvodes_lvl5_1_1.out @@ -0,0 +1,120 @@ +Start CVODES Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][cvStep][begin-step-attempt] step = 1, tn = 0, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448713915889e+00 +1.7320508075688772e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.4999243864411202 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 2.207987840210415e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 0, h = 0.0001029860256095084, dsm = 0.2499621932116032 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499621932116032 +[DEBUG][rank 0][cvCompleteStep][return] nst = 1, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0001029860256095084, qprime = 1, qwait = 1 + 1.029860256095084e-04 1.224744869195325e+00 1.732049582942459e+00 1.113781733508290e-09 6.122818176912403e-07 +[INFO][rank 0][cvStep][begin-step-attempt] step = 2, tn = 0.0001029860256095084, h = 0.0001029860256095084, q = 1 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448669990604e+00 +1.7320483583160411e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.2 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.499923682675401 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 1, h = 0.0001029860256095084, dsm = 0.2499618413377005 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.2499618413377005 +[DEBUG][rank 0][cvCompleteStep][return] nst = 2, nscon = 2 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 10, hprime = 0.001029860256095084, qprime = 2, qwait = 2 + 2.059720512190168e-04 1.224744864802806e+00 1.732047133692213e+00 2.258852216385776e-09 1.224499561969239e-06 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.001029860256095084, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448208776175e+00 +1.7320226411897481e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4064516129032258 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 33.32111802218621 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001726792321093216 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.001029860256095084, dsm = 8.198477691401965 +[DEBUG][rank 0][cvDoErrorTest][new-step-eta] eta = 0.2729219034840186 +[INFO][rank 0][cvStep][end-step-attempt] status = failed error test, dsm = 8.198477691401965, eflag = 5 +[INFO][rank 0][cvStep][begin-step-attempt] step = 3, tn = 0.0002059720512190168, h = 0.0002810714214160092, q = 2 +[DEBUG][rank 0][cvPredict][forward] zn_0(:) = +1.2247448528146598e+00 +1.7320404491518191e+00 + +[INFO][rank 0][cvNls][begin-nonlinear-solve] tol = 0.4217683352485581 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.482483008202045 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][cvLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][cvLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.190779226370788e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][cvNls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][cvDoErrorTest][error-test] step = 2, h = 0.0002810714214160092, dsm = 0.5885920559914323 +[INFO][rank 0][cvStep][end-step-attempt] status = success, dsm = 0.5885920559914323 +[DEBUG][rank 0][cvCompleteStep][return] nst = 3, nscon = 1 +[DEBUG][rank 0][cvPrepareNextStep][return] eta = 1, hprime = 0.0002810714214160092, qprime = 2, qwait = 2 + 4.870434726350260e-04 1.224744841922706e+00 1.732034367987314e+00 5.258602220337139e-09 2.744232363793842e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.000487043472635026 +Steps = 3 +Error test fails = 1 +NLS step fails = 0 +Initial step size = 0.0001029860256095084 +Last step size = 0.0002810714214160092 +Current step size = 0.0002810714214160092 +Last method order = 2 +Current method order = 2 +Stab. lim. order reductions = 0 +RHS fn evals = 10 +NLS iters = 7 +NLS fails = 0 +NLS iters per step = 2.333333333333333 +LS setups = 3 +Jac fn evals = 1 +LS RHS fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.1428571428571428 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End CVODES Logging test diff --git a/test/unit_tests/logging/test_logging_ida.cpp b/test/unit_tests/logging/test_logging_ida.cpp new file mode 100644 index 0000000000..dbc5b92a7e --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida.cpp @@ -0,0 +1,189 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in IDA + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "ida/ida.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start IDA Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 1) { direct = stoi(argv[1]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + N_Vector yp = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype uptrue, vptrue; + flag = true_sol_p(zero, &uptrue, &vptrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ypdata = N_VGetArrayPointer(yp); + ypdata[0] = uptrue; + ypdata[1] = vptrue; + + // Create IDA memory structure + void* ida_mem = IDACreate(sunctx); + if (check_ptr(ida_mem, "IDACreate")) { return 1; } + + flag = IDAInit(ida_mem, dae_res, zero, y, yp); + if (check_flag(flag, "IDAInit")) { return 1; } + + flag = IDASetUserData(ida_mem, &problem_data); + if (check_flag(flag, "IDASetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = IDASStolerances(ida_mem, rtol, atol); + if (check_flag(flag, "IDASStolerances")) { return 1; } + + cout << "Using Newton nonlinear solver" << endl; + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + + if (direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = IDASetLinearSolver(ida_mem, LS, A); + if (check_flag(flag, "IDASetLinearSolver")) { return 1; } + + flag = IDASetJacFn(ida_mem, dae_res_jac); + if (check_flag(flag, "IDASetJacFn")) { return 1; } + } + else + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = IDASetLinearSolver(ida_mem, LS, A); + if (check_flag(flag, "IDASetLinearSolver")) { return 1; } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = IDASolve(ida_mem, tout, &tret, y, yp, IDA_ONE_STEP); + if (check_flag(flag, "IDA")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = IDAPrintAllStats(ida_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "IDAPrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + N_VDestroy(yp); + SUNMatDestroy(A); + SUNLinSolFree(LS); + IDAFree(&ida_mem); + + cout << "End IDA Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_ida_0.out b/test/unit_tests/logging/test_logging_ida_0.out new file mode 100644 index 0000000000..5fcbfe698d --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_0.out @@ -0,0 +1,38 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_1.out b/test/unit_tests/logging/test_logging_ida_1.out new file mode 100644 index 0000000000..1df06ee067 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_1.out @@ -0,0 +1,38 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl3_0.out b/test/unit_tests/logging/test_logging_ida_lvl3_0.out new file mode 100644 index 0000000000..1b54e6ecd3 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl3_0.out @@ -0,0 +1,157 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl3_1.out b/test/unit_tests/logging/test_logging_ida_lvl3_1.out new file mode 100644 index 0000000000..f6c65bb964 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl3_1.out @@ -0,0 +1,108 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl4_0.out b/test/unit_tests/logging/test_logging_ida_lvl4_0.out new file mode 100644 index 0000000000..c408f80e60 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl4_0.out @@ -0,0 +1,177 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55789427880343, terr_k = 47.11578855760686 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55789427880343 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.472879066184171, terr_k = 2.945758132368342 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.472879066184171 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206337478212727, terr_k = 0.1841267495642545 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206337478212727 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206337478212727, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909885009994345, terr_k = 0.9819770019988689 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909885009994345 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909885009994345, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682407643803889, terr_k = 0.7364815287607778 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682407643803889 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682407643803889, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl4_1.out b/test/unit_tests/logging/test_logging_ida_lvl4_1.out new file mode 100644 index 0000000000..02bf58b245 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl4_1.out @@ -0,0 +1,128 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55720056878195, terr_k = 47.1144011375639 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55720056878195 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.47287510018879, terr_k = 2.945750200377581 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.47287510018879 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206329852007912, terr_k = 0.1841265970401582 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206329852007912 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206329852007912, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909887043039554, terr_k = 0.9819774086079108 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909887043039554 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909887043039554, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682403808929263, terr_k = 0.7364807617858526 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682403808929263 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682403808929263, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl5_0.out b/test/unit_tests/logging/test_logging_ida_lvl5_0.out new file mode 100644 index 0000000000..c408f80e60 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl5_0.out @@ -0,0 +1,177 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55789427880343, terr_k = 47.11578855760686 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55789427880343 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.472879066184171, terr_k = 2.945758132368342 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.472879066184171 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206337478212727, terr_k = 0.1841267495642545 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206337478212727 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206337478212727, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909885009994345, terr_k = 0.9819770019988689 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909885009994345 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909885009994345, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682407643803889, terr_k = 0.7364815287607778 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682407643803889 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682407643803889, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_ida_lvl5_1.out b/test/unit_tests/logging/test_logging_ida_lvl5_1.out new file mode 100644 index 0000000000..02bf58b245 --- /dev/null +++ b/test/unit_tests/logging/test_logging_ida_lvl5_1.out @@ -0,0 +1,128 @@ +Start IDA Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55720056878195, terr_k = 47.1144011375639 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55720056878195 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.47287510018879, terr_k = 2.945750200377581 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.47287510018879 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206329852007912, terr_k = 0.1841265970401582 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206329852007912 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206329852007912, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909887043039554, terr_k = 0.9819774086079108 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909887043039554 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909887043039554, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682403808929263, terr_k = 0.7364807617858526 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682403808929263 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682403808929263, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDA Logging test diff --git a/test/unit_tests/logging/test_logging_idas.cpp b/test/unit_tests/logging/test_logging_idas.cpp new file mode 100644 index 0000000000..5a6737f851 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas.cpp @@ -0,0 +1,189 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Test logging output in IDA + * ---------------------------------------------------------------------------*/ + +#include <cmath> +#include <cstdio> +#include <iomanip> +#include <iostream> +#include <limits> + +// Include desired integrators, vectors, linear solvers, and nonlinear solvers +#include "idas/idas.h" +#include "nvector/nvector_serial.h" +#include "sundials/sundials_context.hpp" +#include "sundials/sundials_iterative.h" +#include "sundials/sundials_logger.h" +#include "sundials/sundials_matrix.h" +#include "sunlinsol/sunlinsol_dense.h" +#include "sunlinsol/sunlinsol_spgmr.h" +#include "sunmatrix/sunmatrix_dense.h" + +#include "problems/kpr.hpp" +#include "utilities/check_return.hpp" + +using namespace std; +using namespace problems::kpr; + +int main(int argc, char* argv[]) +{ + cout << "Start IDAS Logging test" << endl; + + // SUNDIALS context object for this simulation + sundials::Context sunctx; + + // Use direct dense solver (1) otherwise use GMRES + bool direct = true; + if (argc > 1) { direct = stoi(argv[1]); } + + // Ensure logging output goes to stdout + SUNLogger logger; + int flag = SUNContext_GetLogger(sunctx, &logger); + if (check_flag(flag, "SUNContext_GetLogger")) { return 1; } + + SUNLogger_SetErrorFilename(logger, "stdout"); + SUNLogger_SetWarningFilename(logger, "stdout"); + SUNLogger_SetInfoFilename(logger, "stdout"); + SUNLogger_SetDebugFilename(logger, "stdout"); + + // Create initial condition + N_Vector y = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype utrue, vtrue; + flag = true_sol(zero, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ydata = N_VGetArrayPointer(y); + ydata[0] = utrue; + ydata[1] = vtrue; + + N_Vector yp = N_VNew_Serial(2, sunctx); + if (check_ptr(y, "N_VNew_Serial")) { return 1; } + + sunrealtype uptrue, vptrue; + flag = true_sol_p(zero, &uptrue, &vptrue); + if (check_flag(flag, "true_sol")) { return 1; } + + sunrealtype* ypdata = N_VGetArrayPointer(yp); + ypdata[0] = uptrue; + ypdata[1] = vptrue; + + // Create IDA memory structure + void* ida_mem = IDACreate(sunctx); + if (check_ptr(ida_mem, "IDACreate")) { return 1; } + + flag = IDAInit(ida_mem, dae_res, zero, y, yp); + if (check_flag(flag, "IDAInit")) { return 1; } + + flag = IDASetUserData(ida_mem, &problem_data); + if (check_flag(flag, "IDASetUserData")) { return 1; } + + // Relative and absolute tolerances + const sunrealtype rtol = SUN_RCONST(1.0e-6); + const sunrealtype atol = SUN_RCONST(1.0e-10); + + flag = IDASStolerances(ida_mem, rtol, atol); + if (check_flag(flag, "IDASStolerances")) { return 1; } + + cout << "Using Newton nonlinear solver" << endl; + + SUNMatrix A = nullptr; + SUNLinearSolver LS = nullptr; + + if (direct) + { + cout << "Using dense direct linear solver" << endl; + + A = SUNDenseMatrix(2, 2, sunctx); + if (check_ptr(A, "SUNDenseMatrix")) { return 1; } + + LS = SUNLinSol_Dense(y, A, sunctx); + if (check_ptr(LS, "SUNLinSol_Dense")) { return 1; } + + flag = IDASetLinearSolver(ida_mem, LS, A); + if (check_flag(flag, "IDASetLinearSolver")) { return 1; } + + flag = IDASetJacFn(ida_mem, dae_res_jac); + if (check_flag(flag, "IDASetJacFn")) { return 1; } + } + else + { + cout << "Using GMRES iterative linear solver" << endl; + + LS = SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx); + if (check_ptr(LS, "SUNLinSol_SPGMR")) { return 1; } + + flag = IDASetLinearSolver(ida_mem, LS, A); + if (check_flag(flag, "IDASetLinearSolver")) { return 1; } + } + + // Initial time and fist output time + const sunrealtype dtout = one; // output interval + const int nout = 3; // number of outputs + sunrealtype tret = zero; + sunrealtype tout = tret + dtout; + + // Output initial contion + cout << scientific; + cout << setprecision(numeric_limits<sunrealtype>::digits10); + cout << " t "; + cout << " u "; + cout << " v "; + cout << " u err "; + cout << " v err " << endl; + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) << abs(ydata[1] - vtrue) + << endl; + + // Advance in time + for (int i = 0; i < nout; i++) + { + flag = IDASolve(ida_mem, tout, &tret, y, yp, IDA_ONE_STEP); + if (check_flag(flag, "IDA")) { return 1; } + + flag = true_sol(tret, &utrue, &vtrue); + if (check_flag(flag, "true_sol")) { return 1; } + + cout << setw(22) << tret << setw(25) << ydata[0] << setw(25) << ydata[1] + << setw(25) << abs(ydata[0] - utrue) << setw(25) + << abs(ydata[1] - vtrue) << endl; + + // update output time + tout += dtout; + } + for (int i = 0; i < 9; i++) { cout << "--------------"; } + cout << endl; + + // Print some final statistics + flag = IDAPrintAllStats(ida_mem, stdout, SUN_OUTPUTFORMAT_TABLE); + if (check_flag(flag, "IDAPrintAllStats")) { return 1; } + + // Clean up and return with successful completion + N_VDestroy(y); + N_VDestroy(yp); + SUNMatDestroy(A); + SUNLinSolFree(LS); + IDAFree(&ida_mem); + + cout << "End IDAS Logging test" << endl; + + return 0; +} + +/*---- end of file ----*/ diff --git a/test/unit_tests/logging/test_logging_idas_0.out b/test/unit_tests/logging/test_logging_idas_0.out new file mode 100644 index 0000000000..82cdea6174 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_0.out @@ -0,0 +1,38 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_1.out b/test/unit_tests/logging/test_logging_idas_1.out new file mode 100644 index 0000000000..fa546d160a --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_1.out @@ -0,0 +1,38 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl3_0.out b/test/unit_tests/logging/test_logging_idas_lvl3_0.out new file mode 100644 index 0000000000..16094b44b9 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl3_0.out @@ -0,0 +1,157 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl3_1.out b/test/unit_tests/logging/test_logging_idas_lvl3_1.out new file mode 100644 index 0000000000..1b0f1b0f33 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl3_1.out @@ -0,0 +1,108 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl4_0.out b/test/unit_tests/logging/test_logging_idas_lvl4_0.out new file mode 100644 index 0000000000..c2a91e79a4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl4_0.out @@ -0,0 +1,177 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55789427880343, terr_k = 47.11578855760686 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55789427880343 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.472879066184171, terr_k = 2.945758132368342 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.472879066184171 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206337478212727, terr_k = 0.1841267495642545 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206337478212727 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206337478212727, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909885009994345, terr_k = 0.9819770019988689 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909885009994345 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909885009994345, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682407643803889, terr_k = 0.7364815287607778 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682407643803889 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682407643803889, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl4_1.out b/test/unit_tests/logging/test_logging_idas_lvl4_1.out new file mode 100644 index 0000000000..e3632e48f5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl4_1.out @@ -0,0 +1,128 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55720056878195, terr_k = 47.1144011375639 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55720056878195 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.47287510018879, terr_k = 2.945750200377581 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.47287510018879 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206329852007912, terr_k = 0.1841265970401582 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206329852007912 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206329852007912, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909887043039554, terr_k = 0.9819774086079108 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909887043039554 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909887043039554, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682403808929263, terr_k = 0.7364807617858526 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682403808929263 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682403808929263, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl5_0.out b/test/unit_tests/logging/test_logging_idas_lvl5_0.out new file mode 100644 index 0000000000..c2a91e79a4 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl5_0.out @@ -0,0 +1,177 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using GMRES iterative linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 66691.82847592614, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 46.95867102658294 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.616555100562898e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440252190049 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 0.002535603149750046, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0.002535603149750046 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 0.001792942181586226 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55789427880343, terr_k = 47.11578855760686 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55789427880343 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55789427880343, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 16667.76487850195, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 2.935430959038331 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 4.927495525463239e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.94575020235945 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 1.392019618041086e-05, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 1.392019618041086e-05 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 9.843065114615596e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.472879066184171, terr_k = 2.945758132368342 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.472879066184171 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.472879066184171, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 4166.567910172532, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.1834724280998176 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 1.928892842056602e-14 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970496903 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 2.652857600555803e-07, status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 2.652857600555803e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.875853598875282e-07 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206337478212727, terr_k = 0.1841267495642545 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206337478212727 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206337478212727 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206337478212727, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587421e+00 1.732050356527687e+00 4.054883095960804e-10 2.255137558915266e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.376916946092, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338673377551882 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 3.189342023043572e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364827514991518 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909885009994345, terr_k = 0.9819770019988689 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909885009994345 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909885009994345 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909885009994345, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733311e+00 1.732047650340516e+00 2.070158044986670e-09 1.127482510687727e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 1, res-tol = 0.02333452377915607 +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-solver] solver = spgmr +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] cur-iter = 0, total-iters = 0, res-norm = 8333.354402951227, status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 1, total-iters = 1, res-norm = 0.7338444173105051 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = continue +[INFO][rank 0][SUNLinSolSolve_SPGMR][begin-linear-iterate] +[INFO][rank 0][SUNLinSolSolve_SPGMR][linear-iterate] cur-iter = 2, total-iters = 2, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNLinSolSolve_SPGMR][end-linear-iterate] status = success +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 2, p-solves = 0, res-norm = 2.21216303720036e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364815287607778 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682407643803889, terr_k = 0.7364815287607778 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682407643803889 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682407643803889 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682407643803889, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633826e+00 1.732043140054366e+00 3.790763480893133e-09 2.029337465403458e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 8 +IC linesearch backtrack ops = 0 +NLS iters = 8 +NLS fails = 0 +NLS iters per step = 2.666666666666667 +LS setups = 0 +Jac fn evals = 0 +LS residual fn evals = 10 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 10 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 10 +LS iters per NLS iter = 1.25 +Jac evals per NLS iter = 0 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/logging/test_logging_idas_lvl5_1.out b/test/unit_tests/logging/test_logging_idas_lvl5_1.out new file mode 100644 index 0000000000..e3632e48f5 --- /dev/null +++ b/test/unit_tests/logging/test_logging_idas_lvl5_1.out @@ -0,0 +1,128 @@ +Start IDAS Logging test +Using Newton nonlinear solver +Using dense direct linear solver + t u v u err v err +------------------------------------------------------------------------------------------------------------------------------ + 0.000000000000000e+00 1.224744871391589e+00 1.732050807568877e+00 0.000000000000000e+00 0.000000000000000e+00 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.001, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 47.11440249313684 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.752418576295284e-06 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 23.55720056878195, terr_k = 47.1144011375639 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 23.55720056878195 +[DEBUG][rank 0][IDAHandleNFlag][first-error-test_fail] kk = 1, eta = 0.25, h = 0.00025 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 23.55720056878195, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 0.00025, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 2.945750201857205 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.836388936391201e-09 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 1.47287510018879, terr_k = 2.945750200377581 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 1.47287510018879 +[DEBUG][rank 0][IDAHandleNFlag][second-error-test-fail] kk = 1, eta = 0.25, h = 6.25e-05 +[INFO][rank 0][IDAStep][end-step-attempt] status = failed error test, dsm = 1.47287510018879, kflag = 20 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 1, tn = 0, h = 6.25e-05, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.1841265970416357 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 1.814364670808554e-12 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.09206329852007912, terr_k = 0.1841265970401582 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.09206329852007912 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.09206329852007912 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.09206329852007912, eta = 2, hnew = 0.000125 + 6.250000000000000e-05 1.224744870587232e+00 1.732050356528061e+00 4.056768254656618e-10 2.255133815243227e-07 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 2, tn = 6.25e-05, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364830565025812 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = continue +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 2, total-iters = 2, update-norm = 5.772592627786376e-11 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 2 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.4909887043039554, terr_k = 0.9819774086079108 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.4909887043039554 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.4909887043039554 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.4909887043039554, eta = 1, hnew = 0.000125 + 1.875000000000000e-04 1.224744865733123e+00 1.732047650340890e+00 2.070346782900856e-09 1.127482136320523e-06 +[INFO][rank 0][IDAStep][begin-step-attempt] step = 3, tn = 0.0001875, h = 0.000125, q = 1 +[INFO][rank 0][IDANls][begin-nonlinear-solve] tol = 0.33 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-solver] solver = Newton +[INFO][rank 0][SUNNonlinSolSolve_Newton][begin-nonlinear-iterate] +[INFO][rank 0][idaLsSolve][begin-linear-solve] iterative = 0 +[INFO][rank 0][idaLsSolve][end-linear-solve] status = success, iters = 0, p-solves = 0, res-norm = 0 +[INFO][rank 0][SUNNonlinSolSolve_Newton][nonlinear-iterate] cur-iter = 1, total-iters = 1, update-norm = 0.7364807617858526 +[INFO][rank 0][SUNNonlinSolSolve_Newton][end-nonlinear-iterate] status = success +[INFO][rank 0][IDANls][end-nonlinear-solve] status = success, iters = 1 +[DEBUG][rank 0][IDATestError][estimate-error-order-k] err_k = 0.3682403808929263, terr_k = 0.7364807617858526 +[DEBUG][rank 0][IDATestError][new-order] kk = 1, knew = 1 +[DEBUG][rank 0][IDATestError][error-estimate] ck_enorm_k = 0.3682403808929263 +[INFO][rank 0][IDAStep][end-step-attempt] status = success, dsm = 0.3682403808929263 +[DEBUG][rank 0][IDACompleteStep][new-step-and-order] knew = 1, err_knew = 0.3682403808929263, eta = 1, hnew = 0.000125 + 3.125000000000000e-04 1.224744857633637e+00 1.732043140056620e+00 3.790952218807320e-09 2.029335211872763e-06 +------------------------------------------------------------------------------------------------------------------------------ +Current time = 0.0003125 +Steps = 3 +Error test fails = 2 +NLS step fails = 0 +Initial step size = 0.001 +Last step size = 0.000125 +Current step size = 0.000125 +Last method order = 1 +Current method order = 1 +Residual fn evals = 9 +IC linesearch backtrack ops = 0 +NLS iters = 9 +NLS fails = 0 +NLS iters per step = 3 +LS setups = 4 +Jac fn evals = 4 +LS residual fn evals = 0 +Prec setup evals = 0 +Prec solves = 0 +LS iters = 0 +LS fails = 0 +Jac-times setups = 0 +Jac-times evals = 0 +LS iters per NLS iter = 0 +Jac evals per NLS iter = 0.4444444444444444 +Prec evals per NLS iter = 0 +Root fn evals = 0 +End IDAS Logging test diff --git a/test/unit_tests/problems/estep.hpp b/test/unit_tests/problems/estep.hpp new file mode 100644 index 0000000000..b1c569af69 --- /dev/null +++ b/test/unit_tests/problems/estep.hpp @@ -0,0 +1,129 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * ODE test problem from D. Estep, et al., "An a posteriori-a priori analysis of + * multiscale operator splitting," SIAM Journal on Numerical Analysis, 2008: + * + * y' = -lambda * y + y^2 + * + * where lambda is positive and the initial condition is y(0) = 1. The system + * as the analytic solution: + * + * y(t) = lambda * y(0) / (y(0) - (y(0) - lambda) * exp(lambda * t)) + * + * Right-hand side (RHS) functions are defined for the full problem as well as + * an additive partitioning: + * + * Full RHS = ode_rhs = -lambda * y + y^2 + * Partition 1 = ode_rhs_1 = -lambda * y + * Partition 2 = ode_rhs_2 = y^2 + * ---------------------------------------------------------------------------*/ + +#ifndef ESTEP_HPP_ +#define ESTEP_HPP_ + +#include <sundials/sundials_core.hpp> + +namespace problems { +namespace estep { + +// problem constants +constexpr sunrealtype zero = SUN_RCONST(0.0); +constexpr sunrealtype one = SUN_RCONST(1.0); +constexpr sunrealtype two = SUN_RCONST(2.0); + +// initial condition +constexpr sunrealtype y0 = one; + +// lambda constant +sunrealtype problem_data = two; + +inline int initial_condition(N_Vector y_vec) +{ + if (y_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + if (y_data == nullptr) { return 1; } + + y_data[0] = y0; + + return 0; +} + +inline int true_solution(sunrealtype t, sunrealtype lambda, N_Vector y_vec) +{ + if (y_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + if (y_data == nullptr) { return 1; } + + y_data[0] = lambda * y0 / (y0 - (y0 - lambda) * std::exp(lambda * t)); + + return 0; +} + +inline int ode_rhs(sunrealtype t, N_Vector y_vec, N_Vector f_vec, void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr || user_data == nullptr) + { + return 1; + } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + const sunrealtype lambda = *static_cast<sunrealtype*>(user_data); + + f_data[0] = -lambda * y_data[0] + y_data[0] * y_data[0]; + + return 0; +} + +inline int ode_rhs_1(sunrealtype t, N_Vector y_vec, N_Vector f_vec, + void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr || user_data == nullptr) + { + return 1; + } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + const sunrealtype lambda = *static_cast<sunrealtype*>(user_data); + + f_data[0] = -lambda * y_data[0]; + + return 0; +} + +inline int ode_rhs_2(sunrealtype t, N_Vector y_vec, N_Vector f_vec, + void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + f_data[0] = y_data[0] * y_data[0]; + + return 0; +} + +} // namespace estep +} // namespace problems + +#endif diff --git a/test/unit_tests/problems/kepler.hpp b/test/unit_tests/problems/kepler.hpp new file mode 100644 index 0000000000..0ca9f0cbc1 --- /dev/null +++ b/test/unit_tests/problems/kepler.hpp @@ -0,0 +1,164 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Kepler ODE test problem + * + * q1' = p1 + * q2' = p2 + * p1' = -q1 / (q1^2 + q2^2)^(3/2) + * p2' = -q2 / (q1^2 + q2^2)^(3/2) + * + * with the initial condition + * + * q1(0) = 1 - e + * q2(0) = 0 + * p1(0) = 0 + * p2(0) = sqrt((1 + e) / (1 - e)) + * + * where e is the eccentricity. The Hamiltonian for the system is + * + * H(p,q) = 1/2 * (p1^2 + p2^2) - 1 / sqrt(q1^2 + q2^2) + * + * is conserved as well as the angular momentum, + * + * L(p,q) = q1 * p2 - q2 * p1. + * + * Right-hand side (RHS) functions are defined for the full problem as well as + * a component partitioning: + * + * Full RHS = ode_rhs = RHS terms for q' and p' + * Velocity RHS = ode_rhs_velocity = RHS terms for q' + * Force RHS = ode_rhs_force = RHS terms for p' + * ---------------------------------------------------------------------------*/ + +#ifndef KEPLER_HPP_ +#define KEPLER_HPP_ + +#include <cmath> +#include <sundials/sundials_core.hpp> + +namespace problems { +namespace kepler { + +// Problem constants +constexpr sunrealtype zero = SUN_RCONST(0.0); +constexpr sunrealtype half = SUN_RCONST(0.5); +constexpr sunrealtype one = SUN_RCONST(1.0); + +// eccentricity +sunrealtype eccentricity = SUN_RCONST(0.6); + +inline int initial_condition(N_Vector y_vec, sunrealtype ecc) +{ + if (y_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + if (y_data == nullptr) { return 1; } + + y_data[0] = one - ecc; + y_data[1] = zero; + y_data[2] = zero; + y_data[3] = std::sqrt((one + ecc) / (one - ecc)); + + return 0; +} + +inline int hamiltonian(N_Vector y_vec, sunrealtype* H) +{ + if (y_vec == nullptr || H == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + if (y_data == nullptr) { return 1; } + + const sunrealtype q1 = y_data[0]; + const sunrealtype q2 = y_data[1]; + const sunrealtype p1 = y_data[2]; + const sunrealtype p2 = y_data[3]; + + const sunrealtype qTq = q1 * q1 + q2 * q2; + const sunrealtype pTp = p1 * p1 + p2 * p2; + + *H = half * pTp - one / std::sqrt(qTq); + + return 0; +} + +inline int angular_momentum(N_Vector y_vec, sunrealtype* L) +{ + if (y_vec == nullptr || L == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + if (y_data == nullptr) { return 1; } + + const sunrealtype q1 = y_data[0]; + const sunrealtype q2 = y_data[1]; + const sunrealtype p1 = y_data[2]; + const sunrealtype p2 = y_data[3]; + + *L = q1 * p2 - q2 * p1; + + return 0; +} + +inline int ode_rhs_velocity(sunrealtype t, N_Vector y_vec, N_Vector f_vec, + void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + const sunrealtype p1 = y_data[2]; + const sunrealtype p2 = y_data[3]; + + f_data[0] = p1; + f_data[1] = p2; + + return 0; +} + +inline int ode_rhs_force(sunrealtype t, N_Vector y_vec, N_Vector f_vec, + void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr) { return 1; } + + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + const sunrealtype q1 = y_data[0]; + const sunrealtype q2 = y_data[1]; + + const sunrealtype sqrt_qTq = std::sqrt(q1 * q1 + q2 * q2); + + f_data[2] = -q1 / std::pow(sqrt_qTq, 3); + f_data[3] = -q2 / std::pow(sqrt_qTq, 3); + + return 0; +} + +inline int ode_rhs(sunrealtype t, N_Vector y_vec, N_Vector f_vec, void* user_data) +{ + int retval = 0; + + retval += ode_rhs_velocity(t, y_vec, f_vec, user_data); + retval += ode_rhs_force(t, y_vec, f_vec, user_data); + + return retval; +} + +} // namespace kepler +} // namespace problems + +#endif diff --git a/test/unit_tests/problems/kpr.hpp b/test/unit_tests/problems/kpr.hpp new file mode 100644 index 0000000000..ca0d683545 --- /dev/null +++ b/test/unit_tests/problems/kpr.hpp @@ -0,0 +1,386 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Kvaerno-Prothero-Robinson (KPR) ODE test problem: + * + * [u]' = [ a b ] [ (-1 + u^2 - rho(t)) / (2u) ] + [ rho'(t) / (2u) ] + * [v] [ c d ] [ (-2 + v^2 - sigma(t)) / (2v) ] [ sigma'(t) / (2v) ] + * + * This problem has analytical solution given by + * + * u(t) = sqrt(1 + rho(t)) + * v(t) = sqrt(2 + sigma(t)) + * + * where, in this test, we use the functions + * + * rho(t) = 0.5 * cos(t) + * sigma(t) = cos(2t) + * + * For ImEx methods, the first term is treated implicitly while the second term + * is the treated explicitly. + * + * For MRI methods the u equation is considered slow (potentially with the same + * ImEx splitting as above) while the v equation is considered fast. + * ---------------------------------------------------------------------------*/ + +#ifndef KPR_HPP_ +#define KPR_HPP_ + +#include <cmath> +#include <sunmatrix/sunmatrix_dense.h> + +namespace problems { +namespace kpr { + +// Macros for problem constants +constexpr sunrealtype zero = SUN_RCONST(0.0); +constexpr sunrealtype half = SUN_RCONST(0.5); +constexpr sunrealtype one = SUN_RCONST(1.0); +constexpr sunrealtype two = SUN_RCONST(2.0); +constexpr sunrealtype twenty = SUN_RCONST(20.0); + +// constants a, b, c, and d +sunrealtype problem_data[4] = {-two, half, half, -one}; + +// ----------------------------------------------------------------------------- +// Helper functions +// ----------------------------------------------------------------------------- + +// Compute rho(t) +inline sunrealtype rho(sunrealtype t) { return half * std::cos(t); } + +// Compute rho'(t) +inline sunrealtype rho_p(sunrealtype t) { return -half * std::sin(t); } + +// Compute sigma(t) +inline sunrealtype sig(sunrealtype t) { return cos(twenty * t); } + +// Compute sigma'(t) +inline sunrealtype sig_p(sunrealtype t) +{ + return -twenty * std::sin(twenty * t); +} + +// Compute the true solution +inline int true_sol(sunrealtype t, sunrealtype* u, sunrealtype* v) +{ + *u = std::sqrt(one + rho(t)); + *v = std::sqrt(two + sig(t)); + + return 0; +} + +// Compute the true solution derivative +inline int true_sol_p(sunrealtype t, sunrealtype* up, sunrealtype* vp) +{ + *up = rho_p(t) / (two * std::sqrt(one + rho(t))); + *vp = sig_p(t) / (two * std::sqrt(two + sig(t))); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE RHS function: + * [a b] * [ (-1 + u^2 - r(t)) / (2u) ] + [ r'(t) / (2u) ] + * [c d] [ (-2 + v^2 - s(t)) / (2v) ] [ s'(t) / (2v) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + fdata[0] = a * tmp1 + b * tmp2 + rho_p(t) / (two * u); + fdata[1] = c * tmp1 + d * tmp2 + sig_p(t) / (two * v); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE RHS Jacobin: + * [a/2 + (a(1+r(t))-rdot(t))/(2u^2) b/2 + b*(2+s(t))/(2*v^2) ] + * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-sdot(t))/(2u^2) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_jac(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, + N_Vector tmp3) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + Jdata[0] = a / two + (a * (one + rho(t)) - rho_p(t)) / (two * u * u); + Jdata[1] = c / two + c * (one + rho(t)) / (two * u * u); + Jdata[2] = b / two + b * (two + sig(t)) / (two * v * v); + Jdata[3] = d / two + (d * (two + sig(t)) - sig_p(t)) / (two * v * v); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Explicit RHS function: + * [ r'(t) / (2u) ] + * [ s'(t) / (2v) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_ex(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + fdata[0] = rho_p(t) / (two * u); + fdata[1] = sig_p(t) / (two * v); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Implicit RHS function: + * [a b] * [ (-1 + u^2 - r(t)) / (2u) ] + * [c d] [ (-2 + v^2 - s(t)) / (2v) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_im(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + fdata[0] = a * tmp1 + b * tmp2; + fdata[1] = c * tmp1 + d * tmp2; + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Implicit RHS Jacobin: + * [a/2 + (a(1+r(t)))/(2u^2) b/2 + b*(2+s(t))/(2v^2) ] + * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t)))/(2u^2) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_jac_im(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix J, + void* user_data, N_Vector tmp1, N_Vector tmp2, + N_Vector tmp3) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + Jdata[0] = a / two + (a * (one + rho(t))) / (two * u * u); + Jdata[1] = c / two + c * (one + rho(t)) / (two * u * u); + Jdata[2] = b / two + b * (two + sig(t)) / (two * v * v); + Jdata[3] = d / two + (d * (two + sig(t))) / (two * v * v); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Slow RHS function: + * [a b] * [ (-1 + u^2 - r(t)) / (2u) ] + [ r'(t) / (2u) ] + * [c d] [ 0 ] [ 0 ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_s(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + fdata[0] = a * tmp1 + b * tmp2 + rho_p(t) / (two * u); + fdata[1] = zero; + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Slow Explicit RHS function: + * [ r'(t) / (2u) ] + * [ 0 ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_se(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + + fdata[0] = rho_p(t) / (two * u); + fdata[1] = zero; + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Slow Implicit RHS function: + * [a b] * [ (-1 + u^2 - r(t)) / (2u) ] + * [c d] [ 0 ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_si(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + fdata[0] = a * tmp1 + b * tmp2; + fdata[1] = zero; + + return 0; +} + +/* ----------------------------------------------------------------------------- + * ODE Fast RHS function: + * [a b] * [ 0 ] + [ 0 ] + * [c d] [ (-2 + v^2 - s(t)) / (2v) ] [ s'(t) / (2v) ] + * ---------------------------------------------------------------------------*/ +inline int ode_rhs_ff(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* fdata = N_VGetArrayPointer(ydot); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + fdata[0] = zero; + fdata[1] = c * tmp1 + d * tmp2 + sig_p(t) / (two * v); + + return 0; +} + +/* ----------------------------------------------------------------------------- + * DAE residual function: + * ru = [a b] * [ (-1 + u^2 - r(t)) / (2*u) ] + [ r'(t) / (2u) ] - [u'] + * rv = [c d] [ (-2 + v^2 - s(t)) / (2*v) ] [ s'(t) / (2v) ] - [v'] + * ---------------------------------------------------------------------------*/ +inline int dae_res(sunrealtype t, N_Vector y, N_Vector yp, N_Vector rr, + void* user_data) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* ypdata = N_VGetArrayPointer(yp); + sunrealtype* rdata = N_VGetArrayPointer(rr); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + const sunrealtype up = ypdata[0]; + const sunrealtype vp = ypdata[1]; + + const sunrealtype tmp1 = (-one + u * u - rho(t)) / (two * u); + const sunrealtype tmp2 = (-two + v * v - sig(t)) / (two * v); + + rdata[0] = (a * tmp1 + b * tmp2 + rho_p(t) / (two * u)) - up; + rdata[1] = (c * tmp1 + d * tmp2 + sig_p(t) / (two * v)) - vp; + + return 0; +} + +/* ----------------------------------------------------------------------------- + * DAE residual Jacobian: + * [a/2 + (a(1+r(t))-r'(t))/(2u^2) - cj b/2 + b*(2+s(t))/(2*v^2) ] + * [c/2 + c(1+r(t))/(2u^2) d/2 + (d(2+s(t))-s'(t))/(2u^2) - cj ] + * ---------------------------------------------------------------------------*/ +inline int dae_res_jac(sunrealtype t, sunrealtype cj, N_Vector y, N_Vector yp, + N_Vector rr, SUNMatrix J, void* user_data, + N_Vector tempv1, N_Vector tempv2, N_Vector tempv3) +{ + sunrealtype* udata = (sunrealtype*)user_data; + const sunrealtype a = udata[0]; + const sunrealtype b = udata[1]; + const sunrealtype c = udata[2]; + const sunrealtype d = udata[3]; + + sunrealtype* ydata = N_VGetArrayPointer(y); + sunrealtype* Jdata = SUNDenseMatrix_Data(J); + + const sunrealtype u = ydata[0]; + const sunrealtype v = ydata[1]; + + Jdata[0] = (a / two + (a * (one + rho(t)) - rho_p(t)) / (two * u * u)) - cj; + Jdata[1] = c / two + c * (one + rho(t)) / (two * u * u); + Jdata[2] = b / two + b * (two + sig(t)) / (two * v * v); + Jdata[3] = (d / two + (d * (two + sig(t)) - sig_p(t)) / (two * v * v)) - cj; + + return 0; +} + +} // namespace kpr +} // namespace problems + +#endif // KPR_HPP_ diff --git a/test/unit_tests/problems/prv.hpp b/test/unit_tests/problems/prv.hpp new file mode 100644 index 0000000000..4832e1ae15 --- /dev/null +++ b/test/unit_tests/problems/prv.hpp @@ -0,0 +1,113 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Prothero-Robinson ODE test problem with a time-varying coefficient (PRV): + * + * y' = L(t) (y - phi(t)) + phi'(t), + * + * where phi(t) = atan(t), phi'(t) = 1 / (1 + t^2), and the coefficient is + * given by + * + * L(t) = lambda - alpha * cos((10 - t) / 10 * pi). + * + * This problem has the analytic solution y(t) = atan(t). + * + * The stiffness of the problem depends on the value of L(t) where the lambda + * determines the center of the parameter and alpha the radius of the interval + * in which the stiffness parameter lies. For a well-posed problem, the values + * should be chosen such that L(t) is negative. + * + * Right-hand side (RHS) function is defined for the full problem as well as + * a function for computing the dominant eigenvalue, L(t). + * ---------------------------------------------------------------------------*/ + +#ifndef PRV_HPP_ +#define PRV_HPP_ + +#include <cmath> +#include <sundials/sundials_core.hpp> + +namespace problems { +namespace prv { + +// Problem constants +static const sunrealtype pi = std::acos(SUN_RCONST(-1.0)); + +constexpr sunrealtype zero = SUN_RCONST(0.0); +constexpr sunrealtype one = SUN_RCONST(1.0); +constexpr sunrealtype ten = SUN_RCONST(10.0); + +// lambda and alpha +sunrealtype problem_data[2] = {SUN_RCONST(-1000.0), SUN_RCONST(10.0)}; + +// ----------------------------------------------------------------------------- +// Helper functions +// ----------------------------------------------------------------------------- + +// Compute L(t) +inline sunrealtype l_coef(sunrealtype t, sunrealtype c[2]) +{ + return c[0] - c[1] * std::cos((ten - t) / ten * pi); +} + +// Compute phi(t) +inline sunrealtype phi(sunrealtype t) { return std::atan(t); } + +// Compute phi'(t) +inline sunrealtype phi_prime(sunrealtype t) { return one / (one + t * t); } + +// Compute the true solution +inline sunrealtype true_solution(sunrealtype t) { return phi(t); } + +// ----------------------------------------------------------------------------- +// Problem functions +// ----------------------------------------------------------------------------- + +// ODE RHS function +inline int ode_rhs(sunrealtype t, N_Vector y_vec, N_Vector f_vec, void* user_data) +{ + if (y_vec == nullptr || f_vec == nullptr || user_data == nullptr) + { + return 1; + } + + sunrealtype* u_data = static_cast<sunrealtype*>(user_data); + sunrealtype* y_data = N_VGetArrayPointer(y_vec); + sunrealtype* f_data = N_VGetArrayPointer(f_vec); + if (y_data == nullptr || f_data == nullptr) { return 1; } + + f_data[0] = l_coef(t, u_data) * (y_data[0] - phi(t)) + phi_prime(t); + + return 0; +} + +// Dominant eigenvalue function +inline int ode_dom_eig(sunrealtype t, N_Vector y_vec, N_Vector f_vec, + sunrealtype* lambdaR, sunrealtype* lambdaI, + void* user_data, N_Vector temp1, N_Vector temp2, + N_Vector temp3) +{ + if (user_data == nullptr) { return 1; } + + sunrealtype* u_data = static_cast<sunrealtype*>(user_data); + + *lambdaR = l_coef(t, u_data); + *lambdaI = zero; + + return 0; +} + +} // namespace prv +} // namespace problems + +#endif diff --git a/test/unit_tests/utilities/check_return.hpp b/test/unit_tests/utilities/check_return.hpp new file mode 100644 index 0000000000..7b034a933b --- /dev/null +++ b/test/unit_tests/utilities/check_return.hpp @@ -0,0 +1,36 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): David J. Gardner @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, 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 + * ----------------------------------------------------------------------------- + * Utility functions for checking function returns + * ---------------------------------------------------------------------------*/ + +#include <iostream> +#include <string> + +// Check function for non-zero return flag +static int check_flag(int flag, const std::string funcname) +{ + if (!flag) { return 0; } + if (flag < 0) { std::cerr << "ERROR: "; } + else { std::cerr << "WARNING: "; } + std::cerr << funcname << " returned " << flag << std::endl; + return (flag < 0) ? 1 : 0; +} + +// Check if a function returned a NULL pointer +static int check_ptr(void* ptr, const std::string funcname) +{ + if (ptr) { return 0; } + std::cerr << "ERROR: " << funcname << " returned NULL" << std::endl; + return 1; +} diff --git a/tools/log_example.py b/tools/log_example.py new file mode 100755 index 0000000000..d7fb39402b --- /dev/null +++ b/tools/log_example.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python3 +# ----------------------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ----------------------------------------------------------------------------- +# Example script demonstrating how to use Python functions to extract and plot +# logs produced by the SUNLogger for adaptive integrators. +# ----------------------------------------------------------------------------- + +def main(): + + import argparse + import matplotlib.pyplot as plt + import matplotlib.ticker as tik + + from suntools import logs as sunlog + + parser = argparse.ArgumentParser(description='Plots') + + parser.add_argument('logfiles', type=str, nargs='+', + help='Log files to plot') + + parser.add_argument('--val', type=str, default='h', + choices=['h', 'q', 'dsm'], + help='Value to plot (default: %(default)s)') + + parser.add_argument('--step-range', type=int, nargs=2, + default=None, metavar=('LOWER_BOUND', 'UPPER_BOUND'), + help='Step range to plot') + + parser.add_argument('--time-range', type=float, nargs=2, + default=None, metavar=('LOWER_BOUND', 'UPPER_BOUND'), + help='Time range to plot') + + parser.add_argument('--step-number', action='store_true', + help='Plot value vs step number') + + parser.add_argument('--scatter', action='store_true', + help='Create scatter plot') + + parser.add_argument('--logx', action='store_true', + help='Use log scale for x-axis') + + parser.add_argument('--logy', action='store_true', + help='Use log scale for y-axis') + + parser.add_argument('--labels', type=str, nargs='+', + help='Plot labels') + + parser.add_argument('--save', type=str, nargs='?', const='fig.pdf', + default=None, metavar='FILE_NAME', + help='Save figure to file') + + # parse command line args + args = parser.parse_args() + + fig, ax = plt.subplots() + colors = plt.get_cmap("tab10") + + for idx, lf in enumerate(args.logfiles): + + # parse log file + log = sunlog.log_file_to_list(lf) + + # get successful step data + steps_s, times_s, vals_s = sunlog.get_history(log, args.val, 'success', + step_range=args.step_range, + time_range=args.time_range) + + # get data for error test failures + steps_etf, times_etf, vals_etf = sunlog.get_history(log, args.val, 'failed error test', + step_range=args.step_range, + time_range=args.time_range) + + # get data for solver failures + steps_sf, times_sf, vals_sf = sunlog.get_history(log, args.val, 'failed solve', + step_range=args.step_range, + time_range=args.time_range) + + # plot log data + if args.step_number: + x_s = steps_s + x_etf = steps_etf + x_sf = steps_sf + else: + x_s = times_s + x_etf = times_etf + x_sf = times_sf + + if len(args.logfiles) == 1: + s_color = 'green' + etf_color = 'red' + sf_color = 'darkorange' + else: + s_color = colors(idx) + etf_color = s_color + sf_color = s_color + + if args.labels: + s_label = f'{args.labels[idx]} successful' + etf_label = f'{args.labels[idx]} error test failed' + sf_label = f'{args.labels[idx]} solver failed' + else: + s_label = 'successful' + etf_label = 'error test failed' + sf_label = 'solver failed' + + # plot successful data + if args.scatter: + ax.scatter(x_s, vals_s, color=s_color, marker='o', label=s_label, + zorder=0.1) + else: + ax.plot(x_s, vals_s, color=s_color, marker='.', label=s_label, + zorder=0.1) + + # always add failures as scatter plot + ax.scatter(x_etf, vals_etf, color=etf_color, marker='x', label=etf_label, + zorder=0.2) + + ax.scatter(x_sf, vals_sf, color=sf_color, marker='d', label=sf_label, + zorder=0.2) + + if args.logx: + ax.set_xscale("log") + if args.logy: + ax.set_yscale("log") + + if args.step_number: + ax.set_xlabel("step") + else: + ax.set_xlabel("time") + + if args.val == 'h': + ax.set_ylabel("step size") + elif args.val == 'q': + ax.set_ylabel("order") + ax.yaxis.set_major_locator(tik.MaxNLocator(integer=True)) + elif args.val == 'dsm': + ax.set_ylabel("LTE estimate") + + ax.legend(loc='best') + + ax.grid(alpha=0.3, linestyle='--') + + if args.save: + plt.savefig(args.save, bbox_inches='tight') + else: + plt.show() + + +# run the main routine +if __name__ == '__main__': + import sys + sys.exit(main()) diff --git a/tools/log_example_mri.py b/tools/log_example_mri.py new file mode 100755 index 0000000000..ef138020c7 --- /dev/null +++ b/tools/log_example_mri.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +# ----------------------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ----------------------------------------------------------------------------- +# Example script demonstrating how to use Python functions to extract and plot +# logs produced by the SUNLogger with an MRI method. +# ----------------------------------------------------------------------------- + +def main(): + + import argparse + import matplotlib.pyplot as plt + + from suntools import logs as sunlog + + parser = argparse.ArgumentParser(description='Plots') + + parser.add_argument('logfile', type=str, + help='Log file to plot') + + parser.add_argument('--step-number', action='store_true', + help='Plot value vs step number') + + parser.add_argument('--step-range', type=int, nargs=2, + default=None, metavar=('LOWER_BOUND', 'UPPER_BOUND'), + help='Step range to plot') + + parser.add_argument('--time-range', type=float, nargs=2, + default=None, metavar=('LOWER_BOUND', 'UPPER_BOUND'), + help='Time range to plot') + + parser.add_argument('--save', type=str, nargs='?', const='fig.pdf', + default=None, metavar='FILE_NAME', + help='''Save figure to file''') + + # parse command line args + args = parser.parse_args() + + # parse log file + log = sunlog.log_file_to_list(args.logfile) + + # plot log data + steps, times, vals = sunlog.get_history(log, 'h', + step_range=args.step_range, + time_range=args.time_range) + + if args.step_number: + x = steps + else: + x = times + + fig, ax = plt.subplots() + + ax.scatter(x, vals, color='green', marker='o') + + if args.step_number: + ax.set_xlabel("step") + else: + ax.set_xlabel("time") + + ax.set_ylabel("step size") + ax.grid(alpha=0.3, linestyle='--') + + if args.save: + plt.savefig(args.save, bbox_inches='tight') + else: + plt.show() + + +# run the main routine +if __name__ == '__main__': + import sys + sys.exit(main()) diff --git a/tools/log_example_print.py b/tools/log_example_print.py new file mode 100755 index 0000000000..755e124660 --- /dev/null +++ b/tools/log_example_print.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# ----------------------------------------------------------------------------- +# Programmer(s): David J. Gardner @ LLNL +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 +# ----------------------------------------------------------------------------- +# Example script that prints a parsed log file +# ----------------------------------------------------------------------------- + +def main(): + + import argparse + + from suntools import logs as sunlog + + parser = argparse.ArgumentParser(description='Plots') + + parser.add_argument('logfile', type=str, + help='Log file to print') + + # parse command line args + args = parser.parse_args() + + # parse log and print + sunlog.print_log(sunlog.log_file_to_list(args.logfile)) + + +# run the main routine +if __name__ == '__main__': + import sys + sys.exit(main()) diff --git a/scripts/sundialsdev/__init__.py b/tools/suntools/__init__.py similarity index 100% rename from scripts/sundialsdev/__init__.py rename to tools/suntools/__init__.py diff --git a/scripts/sundials_csv.py b/tools/suntools/csv.py similarity index 100% rename from scripts/sundials_csv.py rename to tools/suntools/csv.py diff --git a/tools/suntools/logs.py b/tools/suntools/logs.py new file mode 100644 index 0000000000..5c09344e02 --- /dev/null +++ b/tools/suntools/logs.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +# ----------------------------------------------------------------------------- +# Programmer(s): Cody Balos and David J. Gardner @ LLNL +# ----------------------------------------------------------------------------- +# SUNDIALS Copyright Start +# Copyright (c) 2002-2024, 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 of Python functions that may be useful to SUNDIALS developers writing +# scripts to parse logs produced by SUNLogger. +# ----------------------------------------------------------------------------- + +import re +import numpy as np +from collections import ChainMap + + +def convert_to_num(s): + """Try to convert a string to an int or float""" + try: + return np.longlong(s) + except ValueError: + try: + return np.double(s) + except ValueError: + return s + + +def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): + """ + Parse the payload of a SUNDIALS log file line into a dictionary. The payload + of a SUNDIALS log file line is the part after all the [ ] brackets. + """ + kvpstrs = payload.split(",") + kvp_dict = {} + for kvpstr in kvpstrs: + kvp = kvpstr.split("=") + if len(kvp) == 1: + # Check for empty payload + if not kvp[0].strip(): + continue + kvp_dict[kvp[0].strip()] = "" + else: + key, value = kvp + values = [] + if array_indicator in key: + for line in all_lines[line_number + 1 :]: + if line.startswith("[") or not line.strip(): + break + values.append(np.double(line)) + kvp_dict[key.strip()] = values + else: + kvp_dict[key.strip()] = value.strip() + return kvp_dict + + +def parse_logfile_line(line, line_number, all_lines): + """ + Parse a line from a SUNDIALS log file into a dictionary. + + A log file line has the form: + [loglvl][rank][scope][label] key1 = value, key2 = value + The log line payload (everything after the brackets) can be multiline with + one value per line for keys corresponding to an array/vector: + [loglvl][rank][scope][label] y(:) = + y_1 + y_2 + ... + """ + pattern = re.compile(r"\[(\w+)\]\[(rank \d+)\]\[(.*)\]\[(.*)\](.*)") + matches = pattern.findall(line) + line_dict = {} + if matches: + line_dict["loglvl"] = matches[0][0] + line_dict["rank"] = convert_to_num(matches[0][1].split()[1]) + line_dict["scope"] = matches[0][2] + line_dict["label"] = matches[0][3] + line_dict["payload"] = parse_logfile_payload( + matches[0][4], line_number, all_lines + ) + return line_dict + + +class StepData: + """ + Helper class for parsing a step attempt from a SUNDIALS log file into a + hierarchical dictionary where entries may be lists of dictionaries. + """ + + def __init__(self): + self.container = [ChainMap()] + self.parent_keys = ["main"] + + def __repr__(self): + tmp = "Container:" + for entry in self.container: + tmp += f"\n {entry}" + tmp += "\nParent Keys:" + for entry in self.parent_keys: + tmp += f"\n {entry}" + return tmp + + def update(self, data): + """Update the active dictionary""" + self.container[-1].update(data) + + def open_dict(self, key): + """Activate a dictionary""" + self.container[-1][key] = {} + self.container[-1] = self.container[-1].new_child(self.container[-1][key]) + + def close_dict(self): + """Deactivate the active dictionary""" + self.container[-1] = self.container[-1].parents + + def open_list(self, key): + """Activate a list of dictionaries""" + if key in self.container[-1]: + self.container.append(ChainMap()) + else: + self.container[-1][key] = [] + self.container.append(ChainMap()) + self.parent_keys.append(key) + + def close_list(self): + """Deactivate a the active list""" + tmp = self.container[-1].maps[0] + self.container[-2][self.parent_keys[-1]].append(tmp) + self.parent_keys.pop() + self.container.pop() + + def get_step(self): + """Get the step dictionary and reset the container""" + tmp = self.container.pop().maps[0] + self.container = [ChainMap()] + self.parent_keys = ["main"] + return tmp + + +def log_file_to_list(filename): + """ + This function takes a SUNDIALS log file and creates a list where each list + element represents an integrator step attempt. + + E.g., + [ + { + step : 1, + tn : 0.0, + stages : [ {stage : 1, tcur : 0.0, ...}, {stage : 2, tcur : 0.5, ...}, ...] + ... + }, ... + ] + """ + with open(filename, "r") as logfile: + + # List of step attempts, each entry is a dictionary for one attempt + step_attempts = [] + + # Time level for nested integrators e.g., MRI methods + level = 0 + + # Partition for split integrators e.g., operator splitting methods + partition = 0 + + # Read the log file + all_lines = logfile.readlines() + + # Create instance of helper class for building attempt dictionary + s = StepData() + + for line_number, line in enumerate(all_lines): + + line_dict = parse_logfile_line(line.rstrip(), line_number, all_lines) + + if not line_dict: + continue + + label = line_dict["label"] + + if label == "begin-step-attempt": + line_dict["payload"]["level"] = level + if level > 0: + s.open_list(f"time-level-{level}") + if partition > 0: + s.open_list(f"evolve") + s.update(line_dict["payload"]) + continue + elif label == "end-step-attempt": + s.update(line_dict["payload"]) + if level > 0 or partition > 0: + s.close_list() + else: + step_attempts.append(s.get_step()) + continue + + if label == "begin-sequential-method": + s.open_list("sequential methods") + s.update(line_dict["payload"]) + continue + elif label == "end-sequential-method": + s.update(line_dict["payload"]) + s.close_list() + continue + + if label == "begin-partition": + s.open_list("partitions") + s.update(line_dict["payload"]) + partition += 1 + continue + elif label == "end-partition": + s.update(line_dict["payload"]) + s.close_list() + partition -= 1 + continue + + if label == "begin-nonlinear-solve": + s.open_dict("nonlinear-solve") + s.update(line_dict["payload"]) + continue + elif label == "end-nonlinear-solve": + s.update(line_dict["payload"]) + s.close_dict() + continue + + if label == "begin-nonlinear-iterate": + s.open_list("iterations") + s.update(line_dict["payload"]) + continue + elif label == "end-nonlinear-iterate": + s.update(line_dict["payload"]) + s.close_list() + continue + + if label == "begin-linear-solve": + s.open_dict("linear-solve") + s.update(line_dict["payload"]) + continue + elif label == "end-linear-solve": + s.update(line_dict["payload"]) + s.close_dict() + continue + + if label == "begin-linear-iterate": + s.open_list("iterations") + s.update(line_dict["payload"]) + continue + elif label == "end-linear-iterate": + s.update(line_dict["payload"]) + s.close_list() + continue + + if label == "begin-group": + s.open_list("groups") + s.update(line_dict["payload"]) + continue + elif label == "end-group": + s.update(line_dict["payload"]) + s.close_list() + continue + + if label == "begin-stage": + s.open_list("stages") + s.update(line_dict["payload"]) + continue + elif label == "end-stage": + s.update(line_dict["payload"]) + s.close_list() + continue + + if label == "begin-fast-steps": + level += 1 + continue + elif label == "end-fast-steps": + level -= 1 + continue + + if label == "begin-mass-linear-solve": + s.open_dict("mass-linear-solve") + s.update(line_dict["payload"]) + continue + elif label == "end-mass-linear-solve": + s.update(line_dict["payload"]) + s.close_dict() + continue + + if label == "begin-compute-solution": + s.open_dict("compute-solution") + s.update(line_dict["payload"]) + continue + elif label == "end-compute-solution": + s.update(line_dict["payload"]) + s.close_dict() + continue + + if label == "begin-compute-embedding": + s.open_dict("compute-embedding") + s.update(line_dict["payload"]) + continue + elif label == "end-compute-embedding": + s.update(line_dict["payload"]) + s.close_dict() + continue + + s.update(line_dict["payload"]) + + return step_attempts + + +def print_log_list(a_list, indent=0): + """Print list value in step attempt dictionary""" + spaces = (indent + 2) * " " + for entry in a_list: + if type(entry) is list: + print(f"{spaces}[") + print_log_list(entry, indent + 2) + print(f"{spaces}]") + elif type(entry) is dict: + print(f"{spaces}{{") + print_log_dict(entry, indent + 2) + print(f"{spaces}}}") + else: + print(f"{spaces}{entry}") + + +def print_log_dict(a_dict, indent=0): + """Print dictionary value in step attempt dictionary""" + spaces = (indent + 2) * " " + for key in a_dict: + if type(a_dict[key]) is list: + print(f"{spaces}{key} :") + print(f"{spaces}[") + print_log_list(a_dict[key], indent=indent + 2) + print(f"{spaces}]") + elif type(a_dict[key]) is dict: + print(f"{spaces}{key} :") + print(f"{spaces}{{") + print_log_dict(a_dict[key], indent=indent + 2) + print(f"{spaces}}}") + else: + print(f"{spaces}{key} : {a_dict[key]}") + + +def print_log(log, indent=0): + """ + Print the entries from a log file list of step attempts. + """ + spaces = indent * " " + subspaces = (indent + 2) * " " + for entry in log: + print(f"{spaces}{{") + for key in entry: + if type(entry[key]) is list: + print(f"{subspaces}{key} :") + print(f"{subspaces}[") + print_log_list(entry[key], indent=indent + 2) + print(f"{subspaces}]") + elif type(entry[key]) is dict: + print(f"{subspaces}{key} :") + print(f"{subspaces}{{") + print_log_dict(entry[key], indent=indent + 2) + print(f"{subspaces}}}") + else: + print(f"{subspaces}{key} : {entry[key]}") + print(f"{spaces}}}") + + +def get_history(log, key, step_status=None, time_range=None, step_range=None): + """ + Extract the step/time series of the requested value. + """ + + steps = [] + times = [] + values = [] + + for entry in log: + + step = np.longlong(entry["step"]) + time = np.double(entry["t_n"]) + + if time_range is not None: + if time < time_range[0] or time > time_range[1]: + continue + + if step_range is not None: + if step < step_range[0] or step > step_range[1]: + continue + + if step_status is not None: + if step_status not in entry["status"]: + continue + + if key not in entry: + continue + + steps.append(step) + times.append(time) + values.append(convert_to_num(entry[key])) + + if "stages" in entry: + for s in entry["stages"]: + next_level_key = f'time-level-{entry["level"] + 1}' + if next_level_key in s: + sub_steps, sub_times, sub_values = get_history( + s[next_level_key], key + ) + steps.extend(sub_steps) + times.extend(sub_times) + values.extend(sub_values) + + return steps, times, values From 0eff39663606f2ff280c4059a947ed62ae38180a Mon Sep 17 00:00:00 2001 From: David Gardner <gardner48@llnl.gov> Date: Wed, 11 Dec 2024 07:27:48 -0800 Subject: [PATCH 137/137] Release: 7.2.0 (#620) SUNDIALS Release v7.2.0 --- CHANGELOG.md | 166 ++++++++++------- CITATIONS.md | 12 +- CMakeLists.txt | 26 +-- README.md | 2 +- doc/arkode/guide/source/Introduction.rst | 2 +- .../source/Usage/ARKStep/User_callable.rst | 4 +- .../source/Usage/ERKStep/User_callable.rst | 2 +- .../Usage/ForcingStep/User_callable.rst | 6 +- .../Custom_Inner_Stepper/Description.rst | 8 +- .../source/Usage/MRIStep/MRIStepCoupling.rst | 2 +- .../source/Usage/MRIStep/User_callable.rst | 4 +- .../source/Usage/SPRKStep/User_callable.rst | 2 +- .../SplittingStepCoefficients.rst | 30 +-- .../Usage/SplittingStep/User_callable.rst | 8 +- .../guide/source/Usage/User_callable.rst | 16 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvodes/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Introduction.rst | 2 +- doc/idas/guide/source/Introduction.rst | 2 +- doc/kinsol/guide/source/Introduction.rst | 2 +- doc/shared/Changelog.rst | 2 +- doc/shared/History.rst | 2 + doc/shared/RecentChanges.rst | 176 ++++++++++-------- .../SUNAdaptController_Description.rst | 16 +- .../SUNAdaptController_MRIHTol.rst | 2 +- doc/shared/sundials.bib | 24 +-- doc/shared/sundials/Install.rst | 2 +- doc/shared/sundials_vars.py | 16 +- .../sunstepper/SUNStepper_Description.rst | 2 +- doc/sundials/biblio.bib | 24 +-- doc/sundials/ug.tex | 14 +- scripts/startReleaseCycle.sh | 17 +- scripts/tarscript | 14 +- scripts/updateVersion.sh | 4 +- src/arkode/README.md | 10 +- src/cvode/README.md | 10 +- src/cvodes/README.md | 10 +- src/ida/README.md | 10 +- src/idas/README.md | 10 +- src/kinsol/README.md | 10 +- 40 files changed, 366 insertions(+), 309 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e1929344..e4fd3ff71f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,36 @@ # SUNDIALS Changelog -## Changes to SUNDIALS in release X.Y.Z +## Changes to SUNDIALS in release 7.2.0 ### Major Features -Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, LSRKStep. -This currently supports five explicit low-storage methods: the second-order Runge--Kutta--Chebyshev -and Runge--Kutta--Legendre methods, and the second- through fourth-order optimal strong stability -preserving Runge--Kutta methods. All methods include embeddings for temporal adaptivity. +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, +LSRKStep. This currently supports five explicit low-storage methods: the +second-order Runge--Kutta--Chebyshev and Runge--Kutta--Legendre methods, and the +second- through fourth-order optimal strong stability preserving Runge--Kutta +methods. All methods include embeddings for temporal adaptivity. Added an operator splitting module, SplittingStep, and forcing method module, ForcingStep, to ARKODE. These modules support a broad range of operator-split time integration methods for multiphysics applications. +Added support for multirate time step adaptivity controllers, based on the +recently introduced `SUNAdaptController` base class, to ARKODE's MRIStep module. +As a part of this, we added embeddings for existing MRI-GARK methods, as well as +support for embedded MERK and IMEX-MRI-SR methods. Added new default MRI methods +for temporally adaptive versus fixed-step runs. + ### New Features and Enhancements -Added the `ARKodeSetStepDirection` and `ARKodeGetStepDirection` functions to -change and query the direction of integration. +#### Logging + +The information level logging output in ARKODE, CVODE(S), and IDA(S) has been +updated to be more uniform across the packages and a new `tools` directory has +been added with a Python module, `suntools`, containing utilities for parsing +logging output. The Python utilities for parsing CSV output have been relocated +from the `scripts` directory to the Python module. + +#### SUNStepper Added the `SUNStepper` base class to represent a generic solution procedure for IVPs. This is used by the SplittingStep and ForcingStep modules of ARKODE. A @@ -24,6 +38,21 @@ SUNStepper can be created from an ARKODE memory block with the new function `ARKodeCreateSUNStepper`. To enable interoperability with `MRIStepInnerStepper`, the function `MRIStepInnerStepper_CreateFromSUNStepper` was added. +#### ARKODE + +Added functionality to ARKODE to accumulate a temporal error estimate over +multiple time steps. See the routines `ARKodeSetAccumulatedErrorType`, +`ARKodeResetAccumulatedError`, and `ARKodeGetAccumulatedError` for details. + +Added the `ARKodeSetStepDirection` and `ARKodeGetStepDirection` functions to +change and query the direction of integration. + +Added the function `MRIStepGetNumInnerStepperFails` to retrieve the number of +recoverable failures reported by the MRIStepInnerStepper. + +Added a utility routine to wrap any valid ARKODE integrator for use as an +MRIStep inner stepper object, `ARKodeCreateMRIStepInnerStepper`. + The following DIRK schemes now have coefficients accurate to quad precision: * `ARKODE_BILLINGTON_3_3_2` * `ARKODE_KVAERNO_4_2_3` @@ -32,92 +61,96 @@ The following DIRK schemes now have coefficients accurate to quad precision: * `ARKODE_KVAERNO_5_3_4` * `ARKODE_KVAERNO_7_4_5` +#### CMake + The default value of `CMAKE_CUDA_ARCHITECTURES` is no longer set to `70` and is now determined automatically by CMake. The previous default was only valid for Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. -The Trilinos Teptra NVector interface has been updated to utilize CMake -imported targets added in Trilinos 14 to improve support for different Kokkos -backends with Trilinos. As such, Trilinos 14 or newer is required and the +The build system has been updated to utilize the CMake LAPACK imported target +which should ease building SUNDIALS with LAPACK libraries that require setting +specific linker flags e.g., MKL. + +#### Third Party Libraries + +The Trilinos Teptra NVector interface has been updated to utilize CMake imported +targets added in Trilinos 14 to improve support for different Kokkos backends +with Trilinos. As such, Trilinos 14 or newer is required and the `Trilinos_INTERFACE_*` CMake options have been removed. Example programs using *hypre* have been updated to support v2.20 and newer. -The information level logging output in ARKODE, CVODE(S), and IDA(S) has been -updated to be more uniform across the packages and a new `tools` directory -has been added with a Python module, `suntools`, containing utilities for -parsing logging output. The Python utilities for parsing CSV output have been -relocated from the `scripts` directory to the Python module. +### Bug Fixes -The build system has been updated to utilize the CMake LAPACK imported target -which should ease building SUNDIALS with LAPACK libraries that require setting -specific linker flags e.g., MKL. +#### CMake -Added support for multirate time step adaptivity controllers, based on the -recently introduced `SUNAdaptController` base class, to ARKODE's MRIStep module. -As a part of this, we added embeddings for existing MRI-GARK methods, as well as -support for embedded MERK and IMEX-MRI-SR methods. Added new default MRI methods -for temporally adaptive versus fixed-step runs. Added the function -`MRIStepGetNumInnerStepperFails` to retrieve the number of recoverable -failures reported by the MRIStepInnerStepper. +Fixed a CMake bug regarding usage of missing "print_warning" macro that was only +triggered when the deprecated `CUDA_ARCH` option was used. -Added functionality to ARKODE to accumulate a temporal error -estimate over multiple time steps. See the routines `ARKodeSetAccumulatedErrorType`, -`ARKodeResetAccumulatedError`, and `ARKodeGetAccumulatedError` for details. +Fixed a CMake configuration issue related to aliasing an `ALIAS` target when +using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. -Added a utility routine to wrap any valid ARKODE integrator for use as an MRIStep -inner stepper object, `ARKodeCreateMRIStepInnerStepper`. +Fixed a CMake issue which caused third-party CMake variables to be unset. Users +may see more options in the CMake GUI now as a result of the fix. See details +in GitHub Issue [#538](https://github.com/LLNL/sundials/issues/538). -### Bug Fixes +#### NVector Fixed a build failure with the SYCL NVector when using Intel oneAPI 2025.0 compilers. See GitHub Issue [#596](https://github.com/LLNL/sundials/issues/596). -Fixed a bug where `CVodeSetProjFailEta` would ignore the `eta` parameter. +Fixed compilation errors when building the Trilinos Teptra NVector with CUDA +support. -Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors -were reported as unrecoverable. +#### SUNMatrix Fixed a [bug](https://github.com/LLNL/sundials/issues/581) in the sparse matrix implementation of `SUNMatScaleAddI` which caused out of bounds writes unless `indexvals` were in ascending order for each row/column. -Fixed `ARKodeResize` not using the default `hscale` when an argument of `0` was -provided. +#### SUNLinearSolver -Fixed the loading of ARKStep's default first order explicit method. +Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors +were reported as unrecoverable. -Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the -initial value of the rootfinding function is zero. In this case, uninitialized -right-hand side data was used to compute a state value near the initial -condition to determine if any rootfinding functions are initially active. +#### ARKODE -Fixed a CMake bug regarding usage of missing "print_warning" macro -that was only triggered when the deprecated `CUDA_ARCH` option was used. +Fixed `ARKodeResize` not using the default `hscale` when an argument of `0` was +provided. Fixed a memory leak that could occur if ``ARKodeSetDefaults`` is called repeatedly. -Fixed compilation errors when building the Trilinos Teptra NVector with CUDA -support. +Fixed the loading of ARKStep's default first order explicit method. Fixed loading the default IMEX-MRI method if `ARKodeSetOrder` is used to specify -a third or fourth order method. Previously, the default second order method -was loaded in both cases. +a third or fourth order method. Previously, the default second order method was +loaded in both cases. -Fixed a bug in MRIStep where the data supplied to the Hermite interpolation module did -not include contributions from the fast right-hand side function. With this fix, users -will see one additional fast right-hand side function evaluation per slow step with the -Hermite interpolation option. +Fixed potential memory leaks and out of bounds array accesses that could occur +in the ARKODE Lagrange interpolation module when changing the method order or +polynomial degree after re-initializing an integrator. + +Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the +initial value of the rootfinding function is zero. In this case, uninitialized +right-hand side data was used to compute a state value near the initial +condition to determine if any rootfinding functions are initially active. + +Fixed a bug in MRIStep where the data supplied to the Hermite interpolation +module did not include contributions from the fast right-hand side +function. With this fix, users will see one additional fast right-hand side +function evaluation per slow step with the Hermite interpolation option. Fixed a bug in SPRKStep when using compensated summations where the error vector was not initialized to zero. -Fixed potential memory leaks and out of bounds array accesses that could occur -in the ARKODE Lagrange interpolation module when changing the method order or -polynomial degree after re-initializing an integrator. +#### CVODE(S) + +Fixed a bug where `CVodeSetProjFailEta` would ignore the `eta` parameter. + +#### Fortran Interfaces Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to ``N_VGetSubvectorArrayPointer_ManyVector``, @@ -125,13 +158,6 @@ Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to ``SUNDenseMatrix_Column`` where 64-bit ``sunindextype`` interface functions were used. -Fixed a CMake configuration issue related to aliasing an `ALIAS` target when -using `ENABLE_KLU=ON` in combination with a static-only build of SuiteSparse. - -Fixed a CMake issue which caused third-party CMake variables to be unset. -Users may see more options in the CMake GUI now as a result of the fix. -See details in GitHub Issue [#538](https://github.com/LLNL/sundials/issues/538). - ### Deprecation Notices Deprecated the ARKStep-specific utility routine for wrapping an ARKStep instance @@ -277,7 +303,7 @@ ARKODE-wide equivalent, instructions have been added to the user guide for how to retain the current functionality using other user-callable functions. The unsupported implementations of `N_VGetArrayPointer` and `N_VSetArrayPointer` -for the *hypre* and PETSc vectors are now deprecated. Users should access the +for the *hypre* and PETSc vectors are now deprecated. Users should access the underlying wrapped external library vector objects instead with `N_VGetVector_ParHyp` and `N_VGetVector_Petsc`, respectively. @@ -584,9 +610,9 @@ ARKODE. ### New Features Updated CVODE, CVODES and ARKODE default behavior when returning the solution when -the internal time has reached a user-specified stop time. Previously, the output +the internal time has reached a user-specified stop time. Previously, the output solution was interpolated to the value of `tstop`; the default is now to copy the -internal solution vector. Users who wish to revert to interpolation may call a new +internal solution vector. Users who wish to revert to interpolation may call a new routine `CVodeSetInterpolateStopTime`, `ARKStepSetInterpolateStopTime`, `ERKStepSetInterpolateStopTime`, or `MRIStepSetInterpolateStopTime`. @@ -906,7 +932,7 @@ instead. * `SUNLinSolSetInfoFile_SPBCGS` * `SUNLinSolSetPrintLevel_SPBCGS` -The `SUNLinSolSetInfoFile_*` and `SUNNonlinSolSetInfoFile_*` family of +The `SUNLinSolSetInfoFile_*` and `SUNNonlinSolSetInfoFile_*` family of functions are now enabled by setting the CMake option `SUNDIALS_LOGGING_LEVEL` to a value `>= 3`. @@ -1067,7 +1093,7 @@ can be enabled with the CMake option `SUNDIALS_BUILD_WITH_PROFILING`. A built-in profiler will be used by default, but the [Caliper](https://github.com/LLNL/Caliper) library can also be used instead with the CMake option `ENABLE_CALIPER`. See the documentation section on profiling -for more details. **WARNING**: Profiling will impact performance, and should be +for more details. **WARNING**: Profiling will impact performance, and should be enabled judiciously. #### IMEX MRI Methods and MRIStepInnerStepper Object @@ -1402,9 +1428,9 @@ use the `SUNLinSolNewEmpty` constructor will, at a minimum, need set the to leverage this new set function to remove one dot product per solve. The time integrator packages (ARKODE, CVODE(S), and IDA(S)) all now support a -new "matrix-embedded" SUNLinearSolver type. This type supports user-supplied +new "matrix-embedded" SUNLinearSolver type. This type supports user-supplied SUNLinearSolver implementations that set up and solve the specified linear -system at each linear solve call. Any matrix-related data structures are held +system at each linear solve call. Any matrix-related data structures are held internally to the linear solver itself, and are not provided by the SUNDIALS package. @@ -1779,7 +1805,7 @@ should be used instead. Added support for a user-supplied function to update the prediction for each implicit stage solution in ARKStep. If supplied, this routine will be called *after* any existing ARKStep predictor algorithm completes, so that the -predictor may be modified by the user as desired. The new user-supplied routine +predictor may be modified by the user as desired. The new user-supplied routine has type `ARKStepStagePredictFn`, and may be set by calling `ARKStepSetStagePredictFn`. @@ -1977,7 +2003,7 @@ The inputs values passed to the first two inputs of the `SUNNonlinSolSolve` function in the `SUNNonlinearSolver` have been changed to be the predicted state and the initial guess for the correction to that state. Additionally, the definitions of `SUNNonlinSolLSetupFn` and `SUNNonlinSolLSolveFn` in the -SUNNonlinearSolver API have been updated to remove unused input parameters. For +SUNNonlinearSolver API have been updated to remove unused input parameters. For more information on the nonlinear system formulation and the API functions see the `SUNNonlinearSolver` chapter in the user guides. diff --git a/CITATIONS.md b/CITATIONS.md index 9e93aa7ced..78a67ab733 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -69,7 +69,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Cody J. Balos}, title = {User Documentation for ARKODE}, year = {2024}, - note = {v6.1.1} + note = {v6.2.0} } ``` @@ -78,7 +78,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODE}, year = {2024}, - note = {v7.1.1} + note = {v7.2.0} } ``` @@ -87,7 +87,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for CVODES}, year = {2024}, - note = {v7.1.1} + note = {v7.2.0} } ``` @@ -96,7 +96,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDA}, year = {2024}, - note = {v7.1.1} + note = {v7.2.0} } ``` @@ -105,7 +105,7 @@ they are using rather than the combined SUNDIALS online guide: author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for IDAS}, year = {2024}, - note = {v6.1.1} + note = {v6.2.0} } ``` @@ -114,6 +114,6 @@ they are using rather than the combined SUNDIALS online guide: author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, title = {User Documentation for KINSOL}, year = {2024}, - note = {v7.1.1} + note = {v7.2.0} } ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 61b164f678..9a1aec9040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ include(FindPackageHandleStandardArgs) # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") -set(PACKAGE_STRING "SUNDIALS 7.1.1") +set(PACKAGE_STRING "SUNDIALS 7.2.0") set(PACKAGE_TARNAME "sundials") # Set SUNDIALS version numbers @@ -53,8 +53,8 @@ message(STATUS "SUNDIALS_GIT_VERSION: ${SUNDIALS_GIT_VERSION}") # (use "" for the version label if none is needed) set(PACKAGE_VERSION_MAJOR "7") -set(PACKAGE_VERSION_MINOR "1") -set(PACKAGE_VERSION_PATCH "1") +set(PACKAGE_VERSION_MINOR "2") +set(PACKAGE_VERSION_PATCH "0") set(PACKAGE_VERSION_LABEL "") if(PACKAGE_VERSION_LABEL) @@ -69,37 +69,37 @@ endif() # Specify the VERSION and SOVERSION for shared libraries -set(arkodelib_VERSION "6.1.1") +set(arkodelib_VERSION "6.2.0") set(arkodelib_SOVERSION "6") -set(cvodelib_VERSION "7.1.1") +set(cvodelib_VERSION "7.2.0") set(cvodelib_SOVERSION "7") -set(cvodeslib_VERSION "7.1.1") +set(cvodeslib_VERSION "7.2.0") set(cvodeslib_SOVERSION "7") -set(idalib_VERSION "7.1.1") +set(idalib_VERSION "7.2.0") set(idalib_SOVERSION "7") -set(idaslib_VERSION "6.1.1") +set(idaslib_VERSION "6.2.0") set(idaslib_SOVERSION "6") -set(kinsollib_VERSION "7.1.1") +set(kinsollib_VERSION "7.2.0") set(kinsollib_SOVERSION "7") set(cpodeslib_VERSION "0.0.0") set(cpodeslib_SOVERSION "0") -set(nveclib_VERSION "7.1.1") +set(nveclib_VERSION "7.2.0") set(nveclib_SOVERSION "7") -set(sunmatrixlib_VERSION "5.1.1") +set(sunmatrixlib_VERSION "5.2.0") set(sunmatrixlib_SOVERSION "5") -set(sunlinsollib_VERSION "5.1.1") +set(sunlinsollib_VERSION "5.2.0") set(sunlinsollib_SOVERSION "5") -set(sunnonlinsollib_VERSION "4.1.1") +set(sunnonlinsollib_VERSION "4.2.0") set(sunnonlinsollib_SOVERSION "4") set(sundialslib_VERSION diff --git a/README.md b/README.md index 313cc11fd2..d00f7f276b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SUNDIALS: SUite of Nonlinear and DIfferential/ALgebraic equation Solvers # -### Version 7.1.1 (Jun 2024) ### +### Version 7.2.0 (Dec 2024) ### **Center for Applied Scientific Computing, Lawrence Livermore National Laboratory** diff --git a/doc/arkode/guide/source/Introduction.rst b/doc/arkode/guide/source/Introduction.rst index 7427e78f0a..33cbe273c1 100644 --- a/doc/arkode/guide/source/Introduction.rst +++ b/doc/arkode/guide/source/Introduction.rst @@ -126,7 +126,7 @@ require a linear solver, ARKODE may use a variety of SUNLinearSolver modules provided with SUNDIALS, or again may utilize a user-supplied module. -Changes to SUNDIALS in release 6.1.0 +Changes to SUNDIALS in release 6.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index 2dbece5aa1..74107072dc 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -3160,7 +3160,7 @@ Main solver optional output functions The *nfi_evals* value does not account for calls made to :math:`f^I` by a linear solver or preconditioner module. - .. deprecated:: x.y.z + .. deprecated:: 6.2.0 Use :c:func:`ARKodeGetNumRhsEvals` instead. @@ -4409,6 +4409,6 @@ wrap an ARKStep memory block as an :c:type:`MRIStepInnerStepper`. **Example codes:** * ``examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp`` - .. deprecated:: x.y.z + .. deprecated:: 6.2.0 Use :c:func:`ARKodeCreateMRIStepInnerStepper` instead. diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 88f99d5b55..88c485e26c 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -1743,7 +1743,7 @@ Main solver optional output functions * *ARK_SUCCESS* if successful * *ARK_MEM_NULL* if the ERKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.2.0 Use :c:func:`ARKodeGetNumRhsEvals` instead. diff --git a/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst b/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst index baf80b2ba1..2e2adc723f 100644 --- a/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ForcingStep/User_callable.rst @@ -85,7 +85,7 @@ ForcingStep initialization functions **Example codes:** * ``examples/arkode/C_serial/ark_analytic_partitioned.c`` - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. _ARKODE.Usage.ForcingStep.OptionalOutputs: @@ -108,7 +108,7 @@ Optional output functions :retval ARK_MEM_NULL: if the ForcingStep memory was ``NULL`` :retval ARK_ILL_INPUT: if *partition* was out of bounds - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 ForcingStep re-initialization function @@ -182,4 +182,4 @@ the ODE and the :c:type:`SUNStepper` objects used to evolve each partition. All previously set options are retained but may be updated by calling the appropriate "Set" functions. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 diff --git a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst index 9a9590bb9b..561b82522f 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/Custom_Inner_Stepper/Description.rst @@ -102,7 +102,7 @@ Creating and Destroying an Object MRIStepInnerStepper inner_stepper = NULL; flag = MRIStepInnerStepper_CreateFromSUNStepper(sunstepper, &inner_stepper); - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: int MRIStepInnerStepper_Free(MRIStepInnerStepper *stepper) @@ -264,7 +264,7 @@ Setting Member Functions :retval ARK_SUCCESS: if successful :retval ARK_ILL_INPUT: if the stepper is ``NULL`` - .. versionadded: x.y.z + .. versionadded: 6.2.0 .. c:function:: int MRIStepInnerStepper_SetAccumulatedErrorResetFn(MRIStepInnerStepper stepper, MRIStepInnerResetAccumulatedError fn) @@ -278,7 +278,7 @@ Setting Member Functions :retval ARK_SUCCESS: if successful :retval ARK_ILL_INPUT: if the stepper is ``NULL`` - .. versionadded: x.y.z + .. versionadded: 6.2.0 .. c:function:: int MRIStepInnerStepper_SetRTolFn(MRIStepInnerStepper stepper, MRIStepInnerSetRTol fn) @@ -292,7 +292,7 @@ Setting Member Functions :retval ARK_SUCCESS: if successful :retval ARK_ILL_INPUT: if the stepper is ``NULL`` - .. versionadded: x.y.z + .. versionadded: 6.2.0 diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst index 6da195368f..502e5b9de5 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst @@ -227,7 +227,7 @@ are defined ``arkode/arkode_mristep.h``. C->group[1][1] = 4; C->group[2][0] = 3; - .. versionchanged:: x.y.z + .. versionchanged:: 6.2.0 This function now supports a broader range of MRI method types. diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 31319cf95f..809d7ba4c9 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -1560,7 +1560,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw) @@ -1762,7 +1762,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the MRIStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.2.0 Use :c:func:`ARKodeGetNumRhsEvals` instead. diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index 6ea553ef30..00c41d9013 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -789,7 +789,7 @@ Main solver optional output functions :retval ARK_SUCCESS: if successful :retval ARK_MEM_NULL: if the SPRKStep memory was ``NULL`` - .. deprecated:: x.y.z + .. deprecated:: 6.2.0 Use :c:func:`ARKodeGetNumRhsEvals` instead. diff --git a/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst b/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst index 21b9acf876..a4adc901e2 100644 --- a/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst +++ b/doc/arkode/guide/source/Usage/SplittingStep/SplittingStepCoefficients.rst @@ -128,7 +128,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. :return: A :c:type:`SplittingStepCoefficients` structure if successful or a ``NULL`` pointer if ``method`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 @@ -146,7 +146,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. This function is case sensitive. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: const char* SplittingStepCoefficients_IDToName(ARKODE_SplittingCoefficientsID method) @@ -160,7 +160,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. :return: A :c:type:`SplittingStepCoefficients` structure if successful or a ``NULL`` pointer if ``method`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_LieTrotter(int partitions) @@ -173,7 +173,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if ``partitions`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Strang(int partitions) @@ -186,7 +186,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if ``partitions`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Parallel(int partitions) @@ -202,7 +202,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if ``partitions`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_SymmetricParallel(int partitions) @@ -221,7 +221,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if ``partitions`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_ThirdOrderSuzuki(int partitions) @@ -241,7 +241,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if ``partitions`` was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_TripleJump(int partitions, int order) @@ -264,7 +264,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if an argument was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_SuzukiFractal(int partitions, int order) @@ -288,7 +288,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if an argument was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Alloc(int sequential_methods, int stages, int partitions) @@ -303,7 +303,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if an argument was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Create(int sequential_methods, int stages, int partitions, int order, sunrealtype* alpha, sunrealtype* beta) @@ -340,7 +340,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. ``NULL`` pointer if an argument was invalid or an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: SplittingStepCoefficients SplittingStepCoefficients_Copy(SplittingStepCoefficients coefficients) @@ -351,7 +351,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. :return: A :c:type:`SplittingStepCoefficients` structure if successful or a ``NULL`` pointer if an allocation error occurred. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: void SplittingStepCoefficients_Destroy(SplittingStepCoefficients* coefficients) @@ -360,7 +360,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. :param coefficients: A pointer to the splitting coefficients. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: void SplittingStepCoefficients_Write(SplittingStepCoefficients coefficients, FILE* outfile) @@ -372,7 +372,7 @@ integer constants are defined ``arkode/arkode_splittingstep.h``. can be ``stdout`` or ``stderr``, or it may point to a specific file created using ``fopen``. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. _ARKODE.Usage.SplittingStep.SplittingStepCoefficients.Coefficients: diff --git a/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst b/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst index 78252a247f..c378743617 100644 --- a/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SplittingStep/User_callable.rst @@ -83,7 +83,7 @@ SplittingStep initialization functions * ``examples/arkode/C_serial/ark_advection_diffusion_reaction_splitting.c`` * ``examples/arkode/C_serial/ark_analytic_partitioned.c`` - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 Optional inputs for IVP method selection @@ -110,7 +110,7 @@ Optional inputs for IVP method selection This should not be used with :c:func:`ARKodeSetOrder`. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. _ARKODE.Usage.SplittingStep.OptionalOutputs: @@ -134,7 +134,7 @@ Optional output functions :retval ARK_MEM_NULL: if the SplittingStep memory was ``NULL`` :retval ARK_ILL_INPUT: if *partition* was out of bounds - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 SplittingStep re-initialization function @@ -209,4 +209,4 @@ the ODE and the :c:type:`SUNStepper` objects used to evolve each partition. previously set options are retained but may be updated by calling the appropriate "Set" functions. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index 76a1003c35..0a378f1b2e 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -1131,7 +1131,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr estimated at the next call to :c:func:`ARKodeEvolve` or can be specified with :c:func:`ARKodeSetInitStep`. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 @@ -1819,7 +1819,7 @@ tolerance. The type of error accumulation that ARKODE should use. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:enumerator:: ARK_ACCUMERROR_NONE @@ -1859,7 +1859,7 @@ tolerance. :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported by the current time-stepping module. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: int ARKodeResetAccumulatedError(void* arkode_mem) @@ -1874,7 +1874,7 @@ tolerance. :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported by the current time-stepping module. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 @@ -3395,7 +3395,7 @@ Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumul :retval ARK_SUCCESS: the function exited successfully. :retval ARK_MEM_NULL: ``arkode_mem`` was ``NULL``. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: int ARKodeGetCurrentTime(void* arkode_mem, sunrealtype* tcur) @@ -3647,7 +3647,7 @@ Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumul :retval ARK_ILL_INPUT: if ``num_partiton`` was invalid for the stepper or ``num_rhs_evals`` was ``NULL`` - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 .. c:function:: int ARKodeGetNumErrTestFails(void* arkode_mem, long int* netfails) @@ -3764,7 +3764,7 @@ Retrieve the accumulated temporal error estimate :c:func:`ARKodeGetAccumul :retval ARK_STEPPER_UNSUPPORTED: temporal error estimation is not supported by the current time-stepping module. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 @@ -4962,4 +4962,4 @@ block as a :c:type:`SUNStepper`. :c:func:`SUNStepper_SetForcing` function only if ``inner_arkode_mem`` is an ARKStep, ERKStep, or MRIStep integrator. - .. versionadded:: x.y.z + .. versionadded:: 6.2.0 diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index ba5bd22a84..4f4cdff53a 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -108,7 +108,7 @@ implementations. .. efficiency of C, and the greater ease of interfacing the solver to .. applications written in extended Fortran. -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release 7.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index 419fd7ee20..a3b9df3a7c 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -109,7 +109,7 @@ greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release 7.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index b100289002..0206802bcb 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -69,7 +69,7 @@ systems. the greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release 7.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 5f1b554c5f..1317e1b030 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -83,7 +83,7 @@ integrate any final-condition ODE dependent on the solution of the original IVP the greater ease of interfacing the solver to applications written in extended Fortran. -Changes to SUNDIALS in release 6.1.0 +Changes to SUNDIALS in release 6.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/kinsol/guide/source/Introduction.rst b/doc/kinsol/guide/source/Introduction.rst index 5dd8e82594..3b1e969d29 100644 --- a/doc/kinsol/guide/source/Introduction.rst +++ b/doc/kinsol/guide/source/Introduction.rst @@ -85,7 +85,7 @@ applications written in Fortran. .. _KINSOL.Introduction.Changes: -Changes to SUNDIALS in release 7.1.0 +Changes to SUNDIALS in release 7.2.0 ==================================== .. include:: ../../../shared/RecentChanges.rst diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 2824b85a83..6bd419aeec 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -21,7 +21,7 @@ Changelog .. SED_REPLACEMENT_KEY -Changes to SUNDIALS in release X.Y.Z +Changes to SUNDIALS in release 7.2.0 ==================================== .. include:: RecentChanges_link.rst diff --git a/doc/shared/History.rst b/doc/shared/History.rst index f5cda1f326..4de146a29e 100644 --- a/doc/shared/History.rst +++ b/doc/shared/History.rst @@ -21,6 +21,8 @@ Release History +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Date | SUNDIALS | ARKODE | CVODE | CVODES | IDA | IDAS | KINSOL | +==========+===================+===================+===================+===================+===================+===================+===================+ +| Dec 2024 | 7.2.0 | 6.2.0 | 7.2.0 | 7.2.0 | 7.2.0 | 6.2.0 | 7.2.0 | ++----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Jun 2024 | 7.1.1 | 6.1.1 | 7.1.1 | 7.1.1 | 7.1.1 | 6.1.1 | 7.1.1 | +----------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+ | Jun 2024 | 7.1.0 | 6.1.0 | 7.1.0 | 7.1.0 | 7.1.0 | 6.1.0 | 7.1.0 | diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 5e61e9f216..68293f2969 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -1,51 +1,82 @@ **Major Features** -Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, -:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. This currently supports five explicit low-storage -methods: the second-order Runge--Kutta--Chebyshev and Runge--Kutta--Legendre methods, -and the second- through fourth-order optimal strong stability preserving Runge--Kutta methods. -All methods include embeddings for temporal adaptivity. - -Added an operator splitting module, -:ref:`SplittingStep <ARKODE.Usage.SplittingStep>`, and forcing method module, -:ref:`ForcingStep <ARKODE.Usage.ForcingStep>`, to ARKODE. These modules support -a broad range of operator-split time integration methods for multiphysics -applications. +Added a time-stepping module to ARKODE for low storage Runge--Kutta methods, +:ref:`LSRKStep <ARKODE.Usage.LSRKStep>`. This currently supports five explicit +low-storage methods: the second-order Runge--Kutta--Chebyshev and +Runge--Kutta--Legendre methods, and the second- through fourth-order optimal +strong stability preserving Runge--Kutta methods. All methods include +embeddings for temporal adaptivity. + +Added an operator splitting module, :ref:`SplittingStep +<ARKODE.Usage.SplittingStep>`, and forcing method module, :ref:`ForcingStep +<ARKODE.Usage.ForcingStep>`, to ARKODE. These modules support a broad range of +operator-split time integration methods for multiphysics applications. + +Added support for multirate time step adaptivity controllers, based on the +recently introduced :c:type:`SUNAdaptController` base class, to ARKODE's MRIStep +module. As a part of this, we added embeddings for existing MRI-GARK methods, +as well as support for embedded MERK and IMEX-MRI-SR methods. Added new default +MRI methods for temporally adaptive versus fixed-step runs. **New Features and Enhancements** -Added the :c:func:`ARKodeSetStepDirection` and :c:func:`ARKodeGetStepDirection` -functions to change and query the direction of integration. +*Logging* + +The information level logging output in ARKODE, CVODE(S), and IDA(S) has been +updated to be more uniform across the packages and a new ``tools`` directory has +been added with a Python module, ``suntools``, containing utilities for parsing +logging output. The Python utilities for parsing CSV output have been relocated +from the ``scripts`` directory to the Python module. + +*SUNStepper* Added the :c:type:`SUNStepper` base class to represent a generic solution -procedure for IVPs. This is used by the -:ref:`SplittingStep <ARKODE.Usage.SplittingStep>` and -:ref:`ForcingStep <ARKODE.Usage.ForcingStep>` modules of ARKODE. A SUNStepper -can be created from an ARKODE memory block with the new function -:c:func:`ARKodeCreateSUNStepper`. To enable interoperability with -:c:type:`MRIStepInnerStepper`, the function +procedure for IVPs. This is used by the :ref:`SplittingStep +<ARKODE.Usage.SplittingStep>` and :ref:`ForcingStep <ARKODE.Usage.ForcingStep>` +modules of ARKODE. A SUNStepper can be created from an ARKODE memory block with +the new function :c:func:`ARKodeCreateSUNStepper`. To enable interoperability +with :c:type:`MRIStepInnerStepper`, the function :c:func:`MRIStepInnerStepper_CreateFromSUNStepper` was added. +*ARKODE* + +Added functionality to ARKODE to accumulate a temporal error estimate over +multiple time steps. See the routines :c:func:`ARKodeSetAccumulatedErrorType`, +:c:func:`ARKodeResetAccumulatedError`, and :c:func:`ARKodeGetAccumulatedError` +for details. + +Added the :c:func:`ARKodeSetStepDirection` and :c:func:`ARKodeGetStepDirection` +functions to change and query the direction of integration. + +Added the function :c:func:`MRIStepGetNumInnerStepperFails` to retrieve the +number of recoverable failures reported by the MRIStepInnerStepper. + +Added a utility routine to wrap any valid ARKODE integrator for use as an +MRIStep inner stepper object, :c:func:`ARKodeCreateMRIStepInnerStepper`. + The following DIRK schemes now have coefficients accurate to quad precision: * ``ARKODE_BILLINGTON_3_3_2`` - * ``ARKODE_KVAERNO_4_2_3`` - * ``ARKODE_CASH_5_2_4`` - * ``ARKODE_CASH_5_3_4`` - * ``ARKODE_KVAERNO_5_3_4`` - * ``ARKODE_KVAERNO_7_4_5`` +*CMake* + The default value of :cmakeop:`CMAKE_CUDA_ARCHITECTURES` is no longer set to ``70`` and is now determined automatically by CMake. The previous default was only valid for Volta GPUs while the automatically selected value will vary across compilers and compiler versions. As such, users are encouraged to override this value with the architecture for their system. +The build system has been updated to utilize the CMake LAPACK imported target +which should ease building SUNDIALS with LAPACK libraries that require setting +specific linker flags e.g., MKL. + +*Third Party Libraries* + The Trilinos Tpetra NVector interface has been updated to utilize CMake imported targets added in Trilinos 14 to improve support for different Kokkos backends with Trilinos. As such, Trilinos 14 or newer is required and the @@ -53,81 +84,76 @@ backends with Trilinos. As such, Trilinos 14 or newer is required and the Example programs using *hypre* have been updated to support v2.20 and newer. -The information level logging output in ARKODE, CVODE(S), and IDA(S) has been -updated to be more uniform across the packages and a new ``tools`` directory -has been added with a Python module, ``suntools``, containing utilities for -parsing logging output. The Python utilities for parsing CSV output have been -relocated from the ``scripts`` directory to the Python module. +**Bug Fixes** -The build system has been updated to utilize the CMake LAPACK imported target -which should ease building SUNDIALS with LAPACK libraries that require setting -specific linker flags e.g., MKL. +*CMake* -Added support for multirate time step adaptivity controllers, based on the -recently introduced :c:type:`SUNAdaptController` base class, to ARKODE's MRIStep module. -As a part of this, we added embeddings for existing MRI-GARK methods, as well as -support for embedded MERK and IMEX-MRI-SR methods. Added new default MRI methods -for temporally adaptive versus fixed-step runs. Added the function -:c:func:`MRIStepGetNumInnerStepperFails` to retrieve the number of recoverable -failures reported by the MRIStepInnerStepper. +Fixed a CMake bug regarding usage of missing "print_warning" macro that was only +triggered when the deprecated ``CUDA_ARCH`` option was used. -Added functionality to ARKODE to accumulate a temporal error -estimate over multiple time steps. See the routines -:c:func:`ARKodeSetAccumulatedErrorType`, :c:func:`ARKodeResetAccumulatedError`, -and :c:func:`ARKodeGetAccumulatedError` for details. +Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when +using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. -Added a utility routine to wrap any valid ARKODE integrator for use as an MRIStep -inner stepper object, :c:func:`ARKodeCreateMRIStepInnerStepper`. +Fixed a CMake issue which caused third-party CMake variables to be unset. Users +may see more options in the CMake GUI now as a result of the fix. See details +in GitHub Issue `#538 <https://github.com/LLNL/sundials/issues/538>`__. -**Bug Fixes** +*NVector* Fixed a build failure with the SYCL NVector when using Intel oneAPI 2025.0 compilers. See GitHub Issue `#596 <https://github.com/LLNL/sundials/issues/596>`__. -Fixed a bug where :c:func:`CVodeSetProjFailEta` would ignore the `eta` -parameter. +Fixed compilation errors when building the Trilinos Teptra NVector with CUDA +support. -Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors -were reported as unrecoverable. +*SUNMatrix* Fixed a `bug <https://github.com/LLNL/sundials/issues/581>`__ in the sparse matrix implementation of :c:func:`SUNMatScaleAddI` which caused out of bounds writes unless ``indexvals`` were in ascending order for each row/column. -Fixed :c:func:`ARKodeResize` not using the default ``hscale`` when an argument -of ``0`` was provided. +*SUNLinearSolver* -Fixed the loading of ARKStep's default first order explicit method. +Fixed a bug in the SPTFQMR linear solver where recoverable preconditioner errors +were reported as unrecoverable. -Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the -initial value of the rootfinding function is zero. In this case, uninitialized -right-hand side data was used to compute a state value near the initial -condition to determine if any rootfinding functions are initially active. +*ARKODE* -Fixed a CMake bug regarding usage of missing "print_warning" macro -that was only triggered when the deprecated ``CUDA_ARCH`` option was used. +Fixed :c:func:`ARKodeResize` not using the default ``hscale`` when an argument +of ``0`` was provided. Fixed a memory leak that could occur if :c:func:`ARKodeSetDefaults` is called repeatedly. -Fixed compilation errors when building the Trilinos Teptra NVector with CUDA -support. +Fixed the loading of ARKStep's default first order explicit method. Fixed loading the default IMEX-MRI method if :c:func:`ARKodeSetOrder` is used to -specify a third or fourth order method. Previously, the default second order method -was loaded in both cases. +specify a third or fourth order method. Previously, the default second order +method was loaded in both cases. -Fixed a bug in MRIStep where the data supplied to the Hermite interpolation module did -not include contributions from the fast right-hand side function. With this fix, users -will see one additional fast right-hand side function evaluation per slow step with the -Hermite interpolation option. +Fixed potential memory leaks and out of bounds array accesses that could occur +in the ARKODE Lagrange interpolation module when changing the method order or +polynomial degree after re-initializing an integrator. + +Fixed a bug in ARKODE when enabling rootfinding with fixed step sizes and the +initial value of the rootfinding function is zero. In this case, uninitialized +right-hand side data was used to compute a state value near the initial +condition to determine if any rootfinding functions are initially active. + +Fixed a bug in MRIStep where the data supplied to the Hermite interpolation +module did not include contributions from the fast right-hand side +function. With this fix, users will see one additional fast right-hand side +function evaluation per slow step with the Hermite interpolation option. Fixed a bug in SPRKStep when using compensated summations where the error vector was not initialized to zero. -Fixed potential memory leaks and out of bounds array accesses that could occur -in the ARKODE Lagrange interpolation module when changing the method order or -polynomial degree after re-initializing an integrator. +*CVODE(S)* + +Fixed a bug where :c:func:`CVodeSetProjFailEta` would ignore the `eta` +parameter. + +*Fortran Interfaces* Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to :c:func:`N_VGetSubvectorArrayPointer_ManyVector`, @@ -135,17 +161,11 @@ Fixed a bug in the 32-bit ``sunindextype`` Fortran interfaces to :c:func:`SUNBandMatrix_Column` and :c:func:`SUNDenseMatrix_Column` where 64-bit ``sunindextype`` interface functions were used. -Fixed a CMake configuration issue related to aliasing an ``ALIAS`` target when -using ``ENABLE_KLU=ON`` in combination with a static-only build of SuiteSparse. - -Fixed a CMake issue which caused third-party CMake variables to be unset. -Users may see more options in the CMake GUI now as a result of the fix. -See details in GitHub Issue `#538 <https://github.com/LLNL/sundials/issues/538>`__. - **Deprecation Notices** Deprecated the ARKStep-specific utility routine for wrapping an ARKStep instance -as an MRIStep inner stepper object, :c:func:`ARKStepCreateMRIStepInnerStepper`. Use +as an MRIStep inner stepper object, +:c:func:`ARKStepCreateMRIStepInnerStepper`. Use :c:func:`ARKodeCreateMRIStepInnerStepper` instead. The ARKODE stepper specific functions to retrieve the number of right-hand side diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst index 3407edc9f4..1b6278749b 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Description.rst @@ -18,7 +18,7 @@ The SUNAdaptController API .. versionadded:: 6.7.0 -.. versionchanged:: x.y.z +.. versionchanged:: 7.2.0 Added support multirate time step adaptivity controllers @@ -87,7 +87,7 @@ The virtual table structure is defined as The function implementing :c:func:`SUNAdaptController_EstimateStepTol` - .. versionadded:: x.y.z + .. versionadded:: 7.2.0 .. c:member:: SUNErrCode (*reset)(SUNAdaptController C) @@ -113,7 +113,7 @@ The virtual table structure is defined as The function implementing :c:func:`SUNAdaptController_UpdateMRIHTol` - .. versionadded:: x.y.z + .. versionadded:: 7.2.0 .. c:member:: SUNErrCode (*space)(SUNAdaptController C, long int *lenrw, long int *leniw) @@ -149,7 +149,7 @@ following set of SUNAdaptController types: Controls both a slow time step and a tolerance factor to apply on the next-faster time scale within a multirate simulation that has an arbitrary number of time scales. - .. versionadded:: x.y.z + .. versionadded:: 7.2.0 @@ -249,7 +249,7 @@ note these requirements below. Additionally, we note the behavior of the base SU :param tolfacnew: (output) the estimated relative tolerance factor. :return: :c:type:`SUNErrCode` indicating success or failure. - .. versionadded:: x.y.z + .. versionadded:: 7.2.0 .. c:function:: SUNErrCode SUNAdaptController_Reset(SUNAdaptController C) @@ -260,8 +260,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - .. versionadded:: x.y.z - .. c:function:: SUNErrCode SUNAdaptController_SetDefaults(SUNAdaptController C) @@ -270,8 +268,6 @@ note these requirements below. Additionally, we note the behavior of the base SU :param C: the :c:type:`SUNAdaptController` object. :return: :c:type:`SUNErrCode` indicating success or failure. - .. versionadded:: x.y.z - .. c:function:: SUNErrCode SUNAdaptController_Write(SUNAdaptController C, FILE* fptr) @@ -323,7 +319,7 @@ note these requirements below. Additionally, we note the behavior of the base SU :param dsm: the successful fast temporal error estimate. :return: :c:type:`SUNErrCode` indicating success or failure. - .. versionadded:: x.y.z + .. versionadded:: 7.2.0 .. c:function:: SUNErrCode SUNAdaptController_Space(SUNAdaptController C, long int *lenrw, long int *leniw) diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst index 5d1e4c4fc6..8323180bb5 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst @@ -17,7 +17,7 @@ The SUNAdaptController_MRIHTol Module ====================================== -.. versionadded:: x.y.z +.. versionadded:: 7.2.0 Mathematical motivation ----------------------- diff --git a/doc/shared/sundials.bib b/doc/shared/sundials.bib index 4350c1db0b..324fd9a0f9 100644 --- a/doc/shared/sundials.bib +++ b/doc/shared/sundials.bib @@ -27,7 +27,7 @@ % @techreport{arkode_ug, author = {Daniel R. Reynolds and David J. Gardner and Carol S. Woodward and Rujeko Chinomona and Cody J. Balos}, -title = {{User Documentation for ARKODE v6.1.1}}, +title = {{User Documentation for ARKODE v6.2.0}}, institution = {LLNL}, number = {LLNL-SM-668082}, year = 2024 @@ -37,7 +37,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author = {Daniel R. Reynolds}, -title = {{Example Programs for ARKODE v6.1.1}}, +title = {{Example Programs for ARKODE v6.2.0}}, institution = {Southern Methodist University}, year = 2024 } @@ -46,7 +46,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODE v7.1.1}}, +title = {{User Documentation for CVODE v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208108}, year = 2024 @@ -56,7 +56,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author = {Alan C. Hindmarsh and Radu Serban}, -title = {{Example Programs for CVODE v7.1.1}}, +title = {{Example Programs for CVODE v7.2.0}}, institution = {LLNL}, note = {UCRL-SM-208110}, year = 2024 @@ -66,7 +66,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for CVODES v7.1.1}}, +title = {{User Documentation for CVODES v7.2.0}}, institution = {LLNL}, note = {UCRL-SM-208111}, year = 2024 @@ -76,7 +76,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for CVODES v7.1.1}}, +title = {{Example Programs for CVODES v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208115}, year = 2024 @@ -86,7 +86,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDA v7.1.1}}, +title = {{User Documentation for IDA v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208112}, year = 2024 @@ -96,7 +96,7 @@ @techreport{ida_ug % @techreport{ida_ex, author = {Alan C. Hindmarsh and Radu Serban and Aaron Collier}, -title = {{Example Programs for IDA v7.1.1}}, +title = {{Example Programs for IDA v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208113}, year = 2024 @@ -106,7 +106,7 @@ @techreport{ida_ex % @techreport{idas_ug, author = {Radu Serban and Cosmin Petra and Alan C. Hindmarsh and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for IDAS v6.1.1}}, +title = {{User Documentation for IDAS v6.2.0}}, institution = {LLNL}, number = {UCRL-SM-234051}, year = 2024 @@ -116,7 +116,7 @@ @techreport{idas_ug % @techreport{idas_ex, author = {Radu Serban and Alan C. Hindmarsh}, -title = {{Example Programs for IDAS v6.1.1}}, +title = {{Example Programs for IDAS v6.2.0}}, institution = {LLNL}, number = {LLNL-TR-437091}, year = 2024 @@ -126,7 +126,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author = {Alan C. Hindmarsh and Radu Serban and Cody J. Balos and David J. Gardner and Daniel R. Reynolds and Carol S. Woodward}, -title = {{User Documentation for KINSOL v7.1.1}}, +title = {{User Documentation for KINSOL v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208116}, year = 2024 @@ -136,7 +136,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author = {Aaron M. Collier and Radu Serban}, -title = {{Example Programs for KINSOL v7.1.1}}, +title = {{Example Programs for KINSOL v7.2.0}}, institution = {LLNL}, number = {UCRL-SM-208114}, year = 2024 diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index 0b778bb07c..171923b511 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -533,7 +533,7 @@ illustration only. this value with the architecture for their system as the default varies across compilers and compiler versions. - .. versionchanged:: x.y.z + .. versionchanged:: 7.2.0 In prior versions ``CMAKE_CUDA_ARCHITECTURES`` defaulted to ``70``. diff --git a/doc/shared/sundials_vars.py b/doc/shared/sundials_vars.py index 4c5f76c563..c83bdfd734 100644 --- a/doc/shared/sundials_vars.py +++ b/doc/shared/sundials_vars.py @@ -9,14 +9,14 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ---------------------------------------------------------------- -doc_version = 'develop' -sundials_version = 'v7.1.1' -arkode_version = 'v6.1.1' -cvode_version = 'v7.1.1' -cvodes_version = 'v7.1.1' -ida_version = 'v7.1.1' -idas_version = 'v6.1.1' -kinsol_version = 'v7.1.1' +doc_version = 'v7.2.0' +sundials_version = 'v7.2.0' +arkode_version = 'v6.2.0' +cvode_version = 'v7.2.0' +cvodes_version = 'v7.2.0' +ida_version = 'v7.2.0' +idas_version = 'v6.2.0' +kinsol_version = 'v7.2.0' year = '2024' # Warn about all references where the target cannot be found diff --git a/doc/shared/sunstepper/SUNStepper_Description.rst b/doc/shared/sunstepper/SUNStepper_Description.rst index 94d9b5564b..0ed17d224a 100644 --- a/doc/shared/sunstepper/SUNStepper_Description.rst +++ b/doc/shared/sunstepper/SUNStepper_Description.rst @@ -18,7 +18,7 @@ The SUNStepper API ================== -.. versionadded:: x.y.z +.. versionadded:: 7.2.0 As with other SUNDIALS classes, the :c:type:`SUNStepper` abstract base class is implemented using a C structure containing a ``content`` pointer to the derived diff --git a/doc/sundials/biblio.bib b/doc/sundials/biblio.bib index 56b49481c8..c6841b90ee 100644 --- a/doc/sundials/biblio.bib +++ b/doc/sundials/biblio.bib @@ -16,7 +16,7 @@ @techreport{arkode_ug, author={Daniel R. Reynolds and David J. Gardner and Alan C. Hindmarsh and Carol S. Woodward and Jean M. Sexton}, -title={{User Documentation for ARKODE v6.1.1}}, +title={{User Documentation for ARKODE v6.2.0}}, institution={LLNL}, number={LLNL-SM-668082}, year = 2024 @@ -26,7 +26,7 @@ @techreport{arkode_ug % @techreport{arkode_ex, author={Daniel R. Reynolds}, -title={{Example Programs for ARKODE v6.1.1}}, +title={{Example Programs for ARKODE v6.2.0}}, institution={Southern Methodist University}, year = 2024 } @@ -35,7 +35,7 @@ @techreport{arkode_ex % @techreport{cvode_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODE v7.1.1}}, +title={{User Documentation for CVODE v7.2.0}}, institution={LLNL}, number={UCRL-SM-208108}, year = 2024 @@ -45,7 +45,7 @@ @techreport{cvode_ug % @techreport{cvode_ex, author={A. C. Hindmarsh and R. Serban and D. R. Reynolds}, -title={{Example Programs for CVODE v7.1.1}}, +title={{Example Programs for CVODE v7.2.0}}, institution={LLNL}, note={UCRL-SM-208110}, year = 2024 @@ -55,7 +55,7 @@ @techreport{cvode_ex % @techreport{cvodes_ug, author={A. C. Hindmarsh and R. Serban}, -title={{User Documentation for CVODES v7.1.1}}, +title={{User Documentation for CVODES v7.2.0}}, institution={LLNL}, note={UCRL-SM-208111}, year = 2024 @@ -65,7 +65,7 @@ @techreport{cvodes_ug % @techreport{cvodes_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for CVODES v7.1.1}}, +title={{Example Programs for CVODES v7.2.0}}, institution={LLNL}, number={UCRL-SM-208115}, year = 2024 @@ -75,7 +75,7 @@ @techreport{cvodes_ex % @techreport{ida_ug, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{User Documentation for IDA v7.1.1}}, +title={{User Documentation for IDA v7.2.0}}, institution={LLNL}, number={UCRL-SM-208112}, year = 2024 @@ -85,7 +85,7 @@ @techreport{ida_ug % @techreport{ida_ex, author={A. C. Hindmarsh and R. Serban and A. Collier}, -title={{Example Programs for IDA v7.1.1}}, +title={{Example Programs for IDA v7.2.0}}, institution={LLNL}, number={UCRL-SM-208113}, year = 2024 @@ -95,7 +95,7 @@ @techreport{ida_ex % @techreport{idas_ug, author={R. Serban and C. Petra and A. C. Hindmarsh}, -title={{User Documentation for IDAS v6.1.1}}, +title={{User Documentation for IDAS v6.2.0}}, institution={LLNL}, number={UCRL-SM-234051}, year = 2024 @@ -105,7 +105,7 @@ @techreport{idas_ug % @techreport{idas_ex, author={R. Serban and A. C. Hindmarsh}, -title={{Example Programs for IDAS v6.1.1}}, +title={{Example Programs for IDAS v6.2.0}}, institution={LLNL}, number={LLNL-TR-437091}, year = 2024 @@ -115,7 +115,7 @@ @techreport{idas_ex % @techreport{kinsol_ug, author={A. M. Collier and A. C. Hindmarsh and R. Serban and C.S. Woodward}, -title={{User Documentation for KINSOL v7.1.1}}, +title={{User Documentation for KINSOL v7.2.0}}, institution={LLNL}, number={UCRL-SM-208116}, year = 2024 @@ -125,7 +125,7 @@ @techreport{kinsol_ug % @techreport{kinsol_ex, author={A. M. Collier and R. Serban}, -title={{Example Programs for KINSOL v7.1.1}}, +title={{Example Programs for KINSOL v7.2.0}}, institution={LLNL}, number={UCRL-SM-208114}, year = 2024 diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index a7478dc4e8..46c6705121 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -59,29 +59,29 @@ %----- VERSIONS AND UCRL NUMBERS OF SUNDIALS CODES -\newcommand{\sunrelease}{v7.1.1} +\newcommand{\sunrelease}{v7.2.0} -\newcommand{\cvrelease}{v7.1.1} +\newcommand{\cvrelease}{v7.2.0} \newcommand{\cvucrlug}{UCRL-SM-208108} \newcommand{\cvucrlex}{UCRL-SM-208110} -\newcommand{\cvsrelease}{v7.1.1} +\newcommand{\cvsrelease}{v7.2.0} \newcommand{\cvsucrlug}{UCRL-SM-208111} \newcommand{\cvsucrlex}{UCRL-SM-208115} -\newcommand{\idarelease}{v7.1.1} +\newcommand{\idarelease}{v7.2.0} \newcommand{\idaucrlug}{UCRL-SM-208112} \newcommand{\idaucrlex}{UCRL-SM-208113} -\newcommand{\idasrelease}{v6.1.1} +\newcommand{\idasrelease}{v6.2.0} \newcommand{\idasucrlug}{UCRL-SM-234051} \newcommand{\idasucrlex}{LLNL-TR-437091} -\newcommand{\kinrelease}{v7.1.1} +\newcommand{\kinrelease}{v7.2.0} \newcommand{\kinucrlug}{UCRL-SM-208116} \newcommand{\kinucrlex}{UCRL-SM-208114} -\newcommand{\arkrelease}{v6.1.1} +\newcommand{\arkrelease}{v6.2.0} \newcommand{\arkucrlug}{LLNL-SM-668082} \newcommand{\arkucrlex}{????-??-??????} diff --git a/scripts/startReleaseCycle.sh b/scripts/startReleaseCycle.sh index f4ee9075db..ff9a393816 100755 --- a/scripts/startReleaseCycle.sh +++ b/scripts/startReleaseCycle.sh @@ -69,7 +69,8 @@ rm -f tmp.txt fn="../doc/shared/Changelog.rst" -# Move recent changes to changelog +# Replace line containing RecentChanges_link.rst in Changelog.rst with the +# contents of RecentChanges.rst sedi -e '/RecentChanges_link.rst/ {' \ -e 'r ../doc/shared/RecentChanges.rst' \ -e 'd' \ @@ -87,7 +88,7 @@ cat > ../doc/shared/RecentChanges.rst <<HEREDOC **Deprecation Notices** HEREDOC -# Add new entry to changelog +# Create temporary file with new changelog entry cat > tmp.txt <<HEREDOC .. SED_REPLACEMENT_KEY @@ -97,6 +98,7 @@ Changes to SUNDIALS in release X.Y.Z .. include:: RecentChanges_link.rst HEREDOC +# Replace the line containing SED_REPLACEMENT with the new changelog entry sedi -e '/SED_REPLACEMENT_KEY/ {' \ -e 'r tmp.txt' \ -e 'd' \ @@ -104,3 +106,14 @@ sedi -e '/SED_REPLACEMENT_KEY/ {' \ $fn rm -f tmp.txt + +# ------------------------------------------------------------------------------ +# Update package introductions +# ------------------------------------------------------------------------------ + +# Replace section titles +for pkg in arkode cvode cvodes ida idas kinsol +do + sedi 's/Changes to SUNDIALS.*/Changes to SUNDIALS in release X.Y.Z/I' \ + "../doc/${pkg}/guide/source/Introduction.rst" +done diff --git a/scripts/tarscript b/scripts/tarscript index fbae0f00d3..1b2a08b29f 100755 --- a/scripts/tarscript +++ b/scripts/tarscript @@ -57,13 +57,13 @@ function print_usage # VERSION NUMBERS #--------------------------------------------------------- -SUN_VER="7.1.1" -CV_VER="7.1.1" -CVS_VER="7.1.1" -IDA_VER="7.1.1" -IDAS_VER="6.1.1" -KIN_VER="7.1.1" -ARK_VER="6.1.1" +SUN_VER="7.2.0" +CV_VER="7.2.0" +CVS_VER="7.2.0" +IDA_VER="7.2.0" +IDAS_VER="6.2.0" +KIN_VER="7.2.0" +ARK_VER="6.2.0" #--------------------------------------------------------- # Test if the script is executed from within its directory diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index 89d68697e0..34c7f6cf6b 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -19,8 +19,8 @@ # development releases the label string is of the form "-dev.#" and for full # releases the label string is "". sun_major=${1:-7} -sun_minor=${2:-1} -sun_patch=${3:-1} +sun_minor=${2:-2} +sun_patch=${3:-0} sun_label=${4:-""} month=${5:-$(date +"%b")} year=${6:-$(date +"%Y")} diff --git a/src/arkode/README.md b/src/arkode/README.md index 8ae6ccd1cc..15bfa40d37 100644 --- a/src/arkode/README.md +++ b/src/arkode/README.md @@ -1,5 +1,5 @@ # ARKODE -### Version 6.1.1 (Jun 2024) +### Version 6.2.0 (Dec 2024) **Daniel R. Reynolds, Department of Mathematics, SMU** @@ -44,8 +44,8 @@ the "SUNDIALS Release History" appendix of the ARKODE User Guide. ## References * D. R. Reynolds, D. J. Gardner, C. S. Woodward, and C. J. Balos, - "User Documentation for ARKODE v6.1.1," LLNL technical report - LLNL-SM-668082, Jun 2024. + "User Documentation for ARKODE v6.2.0," LLNL technical report + LLNL-SM-668082, Dec 2024. -* D. R. Reynolds, "Example Programs for ARKODE v6.1.1," Technical Report, - Southern Methodist University Center for Scientific Computation, Jun 2024. +* D. R. Reynolds, "Example Programs for ARKODE v6.2.0," Technical Report, + Southern Methodist University Center for Scientific Computation, Dec 2024. diff --git a/src/cvode/README.md b/src/cvode/README.md index 04e3c19f74..e589f0d9c1 100644 --- a/src/cvode/README.md +++ b/src/cvode/README.md @@ -1,5 +1,5 @@ # CVODE -### Version 7.1.1 (Jun 2024) +### Version 7.2.0 (Dec 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the CVODE User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODE v7.1.1," - LLNL technical report UCRL-SM-208108, Jun 2024. + and C. S. Woodward, "User Documentation for CVODE v7.2.0," + LLNL technical report UCRL-SM-208108, Dec 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.1.1," - LLNL technical report UCRL-SM-208110, Jun 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODE v7.2.0," + LLNL technical report UCRL-SM-208110, Dec 2024. * S.D. Cohen and A.C. Hindmarsh, "CVODE, a Stiff/nonstiff ODE Solver in C," Computers in Physics, 10(2), pp. 138-143, 1996. diff --git a/src/cvodes/README.md b/src/cvodes/README.md index 0c4171ee58..a7ae59ee64 100644 --- a/src/cvodes/README.md +++ b/src/cvodes/README.md @@ -1,5 +1,5 @@ # CVODES -### Version 7.1.1 (Jun 2024) +### Version 7.2.0 (Dec 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -44,11 +44,11 @@ the "SUNDIALS Release History" appendix of the CVODES User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for CVODES v7.1.1," - LLNL technical report UCRL-SM-208111, Jun 2024. + and C. S. Woodward, "User Documentation for CVODES v7.2.0," + LLNL technical report UCRL-SM-208111, Dec 2024. -* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.1.1," - LLNL technical report UCRL-SM-208115, Jun 2024. +* A. C. Hindmarsh and R. Serban, "Example Programs for CVODES v7.2.0," + LLNL technical report UCRL-SM-208115, Dec 2024. * R. Serban and A. C. Hindmarsh, "CVODES: the Sensitivity-Enabled ODE solver in SUNDIALS," Proceedings of IDETC/CIE 2005, Sept. 2005, diff --git a/src/ida/README.md b/src/ida/README.md index 3e668d9e42..da5bb1d29a 100644 --- a/src/ida/README.md +++ b/src/ida/README.md @@ -1,5 +1,5 @@ # IDA -### Version 7.1.1 (Jun 2024) +### Version 7.2.0 (Dec 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -47,11 +47,11 @@ the "SUNDIALS Release History" appendix of the IDA User Guide. ## References * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds - and C. S. Woodward, "User Documentation for IDA v7.1.1," - LLNL technical report UCRL-SM-208112, Jun 2024. + and C. S. Woodward, "User Documentation for IDA v7.2.0," + LLNL technical report UCRL-SM-208112, Dec 2024. -* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.1.1," - LLNL technical report UCRL-SM-208113, Jun 2024. +* A. C. Hindmarsh, R. Serban, and A. Collier, "Example Programs for IDA v7.2.0," + LLNL technical report UCRL-SM-208113, Dec 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/idas/README.md b/src/idas/README.md index db24f4c494..628f1f7ff3 100644 --- a/src/idas/README.md +++ b/src/idas/README.md @@ -1,5 +1,5 @@ # IDAS -### Version 6.1.1 (Jun 2024) +### Version 6.2.0 (Dec 2024) **Radu Serban, Cosmin Petra, Alan C. Hindmarsh, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -43,11 +43,11 @@ the "SUNDIALS Release History" appendix of the IDAS User Guide. ## References * R. Serban, C. Petra, A. C. Hindmarsh, C. J. Balos, D. J. Gardner, - D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.1.1," - LLNL technical report UCRL-SM-234051, Jun 2024. + D. R. Reynolds and C. S. Woodward, "User Documentation for IDAS v6.2.0," + LLNL technical report UCRL-SM-234051, Dec 2024. -* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.1.1," - LLNL technical report LLNL-TR-437091, Jun 2024. +* R. Serban and A.C. Hindmarsh, "Example Programs for IDAS v6.2.0," + LLNL technical report LLNL-TR-437091, Dec 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and diff --git a/src/kinsol/README.md b/src/kinsol/README.md index 37d11bec6d..c9c0214215 100644 --- a/src/kinsol/README.md +++ b/src/kinsol/README.md @@ -1,5 +1,5 @@ # KINSOL -### Version 7.1.1 (Jun 2024) +### Version 7.2.0 (Dec 2024) **Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, and Carol S. Woodward, Center for Applied Scientific Computing, LLNL** @@ -48,11 +48,11 @@ the "SUNDIALS Release History" appendix of the KINSOL User Guide. * A. C. Hindmarsh, R. Serban, C. J. Balos, D. J. Gardner, D. R. Reynolds and C. S. Woodward, - "User Documentation for KINSOL v7.1.1," LLNL technical report - UCRL-SM-208116, Jun 2024. + "User Documentation for KINSOL v7.2.0," LLNL technical report + UCRL-SM-208116, Dec 2024. -* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.1.1," - LLNL technical report UCRL-SM-208114, Jun 2024. +* A. M. Collier and R. Serban, "Example Programs for KINSOL v7.2.0," + LLNL technical report UCRL-SM-208114, Dec 2024. * A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and